mainflow 0.40.0 → 0.41.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3 -3
- package/dist/facts.d.ts +15 -0
- package/dist/facts.js +21 -1
- package/dist/hooks.d.ts +0 -15
- package/dist/hooks.js +4 -23
- package/dist/{host-erQ_Sr8U.js → host-BAMZmRy8.js} +168 -1
- package/dist/host.js +1 -1
- package/dist/{launch-I_JDTAtU.js → launch-CMeKJsNd.js} +2 -2
- package/dist/launch.js +1 -1
- package/dist/native/mainflow-swap-darwin-arm64 +0 -0
- package/dist/native/mainflow-swap-darwin-x64 +0 -0
- package/dist/{operation-Bf6DtnfD.js → operation-DlR1P_Pt.js} +1 -1
- package/dist/{ui-CFtibt8x.js → ui-9uuI4Jif.js} +32 -37
- package/dist/web/assets/index-D3P-pLas.css +1 -0
- package/dist/web/assets/{index-BrA-csjk.js → index-DvYj_6IC.js} +28 -28
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-CuHEjqof.css +0 -1
|
@@ -4,17 +4,17 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
|
|
|
4
4
|
`))),e[Vl]=Rl(i);let a=r||i.props&&i.props.type===`number`;al(e,t?`change`:`input`,t=>{t.target.composing||e[Vl](Ul(e.value,n,a))}),(n||a)&&al(e,`change`,()=>{e.value=Ul(e.value,n,a)}),t||(al(e,`compositionstart`,zl),al(e,`compositionend`,Bl),al(e,`change`,Bl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Hl];delete e[Hl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Vl](Ul(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Vl]=Rl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ue(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Gl={deep:!0,created(e,t,n){e[Vl]=Rl(n),al(e,`change`,()=>{let t=e._modelValue,n=Zl(e),r=e.checked,i=e[Vl];if(p(t)){let e=Oe(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Ql(e,r))})},mounted:Kl,beforeUpdate(e,t,n){e[Vl]=Rl(n),Kl(e,t,n)}};function Kl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=Oe(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=De(t,Ql(e,!0))}e.checked!==i&&(e.checked=i)}var ql={created(e,{value:t},n){e.checked=De(t,n.props.value),e[Vl]=Rl(n),al(e,`change`,()=>{e[Vl](Zl(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Vl]=Rl(r),t!==n&&(e.checked=De(t,r.props.value))}},Jl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,al(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ue(Zl(e)):Zl(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[Vl](i)}finally{tr(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Vl]=Rl(r)},mounted(e,{value:t}){Xl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Vl]=Rl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Yl(t,n[1],n[0]))&&Xl(e,t)}};function Yl(e,t,n){if(!n||p(e))return De(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Xl(e,t){let n=e.multiple,r=p(t);if(!n||r||h(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Zl(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Oe(t,o)>-1}else a.selected=t.has(o)}else if(De(Zl(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Zl(e){return`_value`in e?e._value:e.value}function Ql(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var $l={created(e,t,n){tu(e,t,n,null,`created`)},mounted(e,t,n){tu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){tu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){tu(e,t,n,r,`updated`)}};function eu(e,t){switch(e){case`SELECT`:return Jl;case`TEXTAREA`:return Wl;default:switch(t){case`checkbox`:return Gl;case`radio`:return ql;default:return Wl}}}function tu(e,t,n,r,i){let a=eu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function nu(){Wl.getSSRProps=({value:e})=>({value:e}),ql.getSSRProps=({value:e},t)=>{if(t.props&&De(t.props.value,e))return{checked:!0}},Gl.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&Oe(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},$l.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=eu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var ru=[`ctrl`,`shift`,`alt`,`meta`],iu={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)=>ru.some(n=>e[`${n}Key`]&&!t.includes(n))},au=(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=iu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},ou={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},su=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=ae(n.key);if(t.some(e=>e===r||ou[e]===r))return e(n)}))},cu=l({patchProp:_l},_c),lu,uu=!1;function du(){return lu||=Ro(cu)}function fu(){return lu=uu?lu:zo(cu),uu=!0,lu}var pu=((...e)=>{du().render(...e)}),mu=((...e)=>{fu().hydrate(...e)}),hu=((...e)=>{let t=du().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=vu(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,_u(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),gu=((...e)=>{let t=fu().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=vu(e);if(t)return n(t,!0,_u(t))},t});function _u(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function vu(e){return y(e)?document.querySelector(e):e}var yu=!1,bu=()=>{yu||(yu=!0,nu(),Uc())},xu=t({BaseTransition:()=>ei,BaseTransitionPropsValidators:()=>Xr,Comment:()=>ls,DeprecationTypes:()=>null,EffectScope:()=>Pe,ErrorCodes:()=>Hn,ErrorTypeStrings:()=>oc,Fragment:()=>z,KeepAlive:()=>Hi,ReactiveEffect:()=>Be,Static:()=>us,Suspense:()=>Zo,Teleport:()=>Ur,Text:()=>cs,TrackOpTypes:()=>kn,Transition:()=>Cc,TransitionGroup:()=>Ml,TriggerOpTypes:()=>An,VueElement:()=>wl,assertNumber:()=>Vn,callWithAsyncErrorHandling:()=>Gn,callWithErrorHandling:()=>Wn,camelize:()=>D,capitalize:()=>oe,cloneVNode:()=>ws,compatUtils:()=>null,compile:()=>Su,computed:()=>J,createApp:()=>hu,createBlock:()=>H,createCommentVNode:()=>K,createElementBlock:()=>V,createElementVNode:()=>U,createHydrationRenderer:()=>zo,createPropsRestProxy:()=>La,createRenderer:()=>Ro,createSSRApp:()=>gu,createSlots:()=>ga,createStaticVNode:()=>Ts,createTextVNode:()=>G,createVNode:()=>W,customRef:()=>xn,defineAsyncComponent:()=>zi,defineComponent:()=>I,defineCustomElement:()=>xl,defineEmits:()=>Ta,defineExpose:()=>Ea,defineModel:()=>ka,defineOptions:()=>Da,defineProps:()=>wa,defineSSRCustomElement:()=>Sl,defineSlots:()=>Oa,devtools:()=>sc,effect:()=>$e,effectScope:()=>Fe,getCurrentInstance:()=>Ps,getCurrentScope:()=>Ie,getCurrentWatcher:()=>Pn,getTransitionRawChildren:()=>oi,guardReactiveProps:()=>Cs,h:()=>ec,handleError:()=>Kn,hasInjectionContext:()=>Cr,hydrate:()=>mu,hydrateOnIdle:()=>Mi,hydrateOnInteraction:()=>Ii,hydrateOnMediaQuery:()=>Fi,hydrateOnVisible:()=>Pi,initCustomFormatter:()=>tc,initDirectivesForSSR:()=>bu,inject:()=>Sr,isMemoSame:()=>rc,isProxy:()=>sn,isReactive:()=>rn,isReadonly:()=>an,isRef:()=>fn,isRuntimeOnly:()=>qs,isShallow:()=>on,isVNode:()=>_s,markRaw:()=>ln,mergeDefaults:()=>Fa,mergeModels:()=>Ia,mergeProps:()=>q,nextTick:()=>tr,nodeOps:()=>_c,normalizeClass:()=>k,normalizeProps:()=>A,normalizeStyle:()=>he,onActivated:()=>Wi,onBeforeMount:()=>Qi,onBeforeUnmount:()=>na,onBeforeUpdate:()=>ea,onDeactivated:()=>Gi,onErrorCaptured:()=>sa,onMounted:()=>$i,onRenderTracked:()=>oa,onRenderTriggered:()=>aa,onScopeDispose:()=>Le,onServerPrefetch:()=>ia,onUnmounted:()=>ra,onUpdated:()=>ta,onWatcherCleanup:()=>Fn,openBlock:()=>B,patchProp:()=>_l,popScopeId:()=>_r,provide:()=>xr,proxyRefs:()=>yn,pushScopeId:()=>gr,queuePostFlushCb:()=>ar,reactive:()=>Qt,readonly:()=>en,ref:()=>M,registerRuntimeCompiler:()=>Ks,render:()=>pu,renderList:()=>L,renderSlot:()=>R,resolveComponent:()=>ua,resolveDirective:()=>pa,resolveDynamicComponent:()=>fa,resolveFilter:()=>null,resolveTransitionHooks:()=>ni,setBlockTracking:()=>hs,setDevtoolsHook:()=>cc,setTransitionHooks:()=>ai,shallowReactive:()=>$t,shallowReadonly:()=>tn,shallowRef:()=>pn,ssrContextKey:()=>wr,ssrUtils:()=>lc,stop:()=>et,toDisplayString:()=>j,toHandlerKey:()=>se,toHandlers:()=>va,toRaw:()=>cn,toRef:()=>Tn,toRefs:()=>Sn,toValue:()=>_n,transformVNodeArgs:()=>ys,triggerRef:()=>gn,unref:()=>N,useAttrs:()=>Ma,useCssModule:()=>Dl,useCssVars:()=>Gc,useHost:()=>Tl,useId:()=>si,useModel:()=>io,useSSRContext:()=>Tr,useShadowRoot:()=>El,useSlots:()=>ja,useTemplateRef:()=>li,useTransitionState:()=>Jr,vModelCheckbox:()=>Gl,vModelDynamic:()=>$l,vModelRadio:()=>ql,vModelSelect:()=>Jl,vModelText:()=>Wl,vShow:()=>Vc,version:()=>ic,warn:()=>ac,watch:()=>F,watchEffect:()=>Er,watchPostEffect:()=>Dr,watchSyncEffect:()=>Or,withAsyncContext:()=>Ra,withCtx:()=>P,withDefaults:()=>Aa,withDirectives:()=>yr,withKeys:()=>su,withMemo:()=>nc,withModifiers:()=>au,withScopeId:()=>vr}),Su=()=>{},Cu={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`},wu=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim();function Tu(e){return e!=null}function Eu(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Cu.width,a=e.size??e.height??Cu.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?wu(...c):wu(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Cu[`stroke-width`])*Number(e.size??e.width??Cu.width)/Number(t.size??t.width??Cu.width):t.strokeWidth??Cu[`stroke-width`];return[`svg`,{...Object.entries(Cu).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Tu(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Tu(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Tu(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 Du=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ou=e=>e===``,ku=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Au=Symbol(`lucide-icons`);function ju(){return Sr(Au,{})}var Mu=({name:e,iconNode:t,"icon-node":n,icon:r={name:e&&ku(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=``}=ju(),S=Ou(i)||Ou(a)||i===!0||a===!0||y===!0,C=Ou(o)||Ou(s)||o===!0||s===!0||b===!0;delete m.class;let w=h.default?.(),[,T,ee=[]]=Eu(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||Du(m),attributes:m});return ec(`svg`,T,[...ee.map(([e,t])=>ec(e,t)),...w??[]])};function Y(e,t=[]){let n=typeof e==`string`?{name:e,node:t}:e;return(e,{slots:t})=>ec(Mu,{...e,icon:n},t.default?{default:t.default}:void 0)}var Nu=Y({name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]}),Pu=Y({name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]}),Fu=Y({name:`arrow-down-narrow-wide`,size:24,node:[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h4`,key:`6d7r33`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h10`,key:`1438ji`}]]}),Iu=Y({name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]}),Lu=Y({name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]}),Ru=Y({name:`arrow-up-narrow-wide`,size:24,node:[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}],[`path`,{d:`M11 16h7`,key:`uosisv`}],[`path`,{d:`M11 20h10`,key:`jvxblo`}]],aliases:[`sort-asc`]}),zu=Y({name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]}),Bu=Y({name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]}),Vu=Y({name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]}),Hu=Y({name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]}),Uu=Y({name:`calendar-check`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]}),Wu=Y({name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]}),Gu=Y({name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]}),Ku=Y({name:`calendar-range`,size:24,node:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M17 13h-6`,key:`1qbiup`}],[`path`,{d:`M13 17H7`,key:`1x38vv`}],[`path`,{d:`M7 13h.01`,key:`1vezk1`}],[`path`,{d:`M17 17h.01`,key:`1sd3ek`}]]}),qu=Y({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),Ju=Y({name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}),Yu=Y({name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]}),Xu=Y({name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}),Zu=Y({name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]}),Qu=Y({name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]}),$u=Y({name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]}),ed=Y({name:`circle-pause`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]],aliases:[`pause-circle`]}),td=Y({name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]}),nd=Y({name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),rd=Y({name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]}),id=Y({name:`cloud-off`,size:24,node:[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]}),ad=Y({name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]}),od=Y({name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]}),sd=Y({name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]}),cd=Y({name:`corner-down-right`,size:24,node:[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]}),ld=Y({name:`corner-left-up`,size:24,node:[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]}),ud=Y({name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]}),dd=Y({name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]}),fd=Y({name:`file-code`,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`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]}),pd=Y({name:`file-diff`,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:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]}),md=Y({name:`file-exclamation-point`,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:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`file-warning`]}),hd=Y({name:`file-image`,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`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]}),gd=Y({name:`file-text`,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`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}),_d=Y({name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]}),vd=Y({name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]}),yd=Y({name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]}),bd=Y({name:`folder-search`,size:24,node:[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]}),xd=Y({name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]}),Sd=Y({name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]}),Cd=Y({name:`funnel`,size:24,node:[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]],aliases:[`filter`]}),wd=Y({name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]}),Td=Y({name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]}),Ed=Y({name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]}),Dd=Y({name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]}),Od=Y({name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]}),kd=Y({name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]}),Ad=Y({name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]}),jd=Y({name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]}),Md=Y({name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]}),Nd=Y({name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]}),Pd=Y({name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]}),Fd=Y({name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]}),Id=Y({name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]}),Ld=Y({name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]}),Rd=Y({name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]}),zd=Y({name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]}),Bd=Y({name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]}),Vd=Y({name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]}),Hd=Y({name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]}),Ud=Y({name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]}),Wd=Y({name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]}),Gd=Y({name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]}),Kd=Y({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`}]]}),qd=Y({name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]}),Jd=Y({name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]}),Yd=Y({name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]}),Xd=Y({name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]}),Zd=Y({name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]}),Qd=Y({name:`server-off`,size:24,node:[[`path`,{d:`M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5`,key:`bt2siv`}],[`path`,{d:`M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z`,key:`1hjrv1`}],[`path`,{d:`M22 17v-1a2 2 0 0 0-2-2h-1`,key:`1iynyr`}],[`path`,{d:`M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z`,key:`161ggg`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]}),$d=Y({name:`split`,size:24,node:[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]}),ef=Y({name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]}),tf=Y({name:`square-check-big`,size:24,node:[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-square`]}),nf=Y({name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]}),rf=Y({name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]}),af=Y({name:`target`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]}),of=Y({name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]}),sf=Y({name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]}),cf=Y({name:`wallet`,size:24,node:[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]}),lf=Y({name:`waypoints`,size:24,node:[[`path`,{d:`m10.586 5.414-5.172 5.172`,key:`4mc350`}],[`path`,{d:`m18.586 13.414-5.172 5.172`,key:`8c96vv`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`circle`,{cx:`12`,cy:`20`,r:`2`,key:`144qzu`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}],[`circle`,{cx:`20`,cy:`12`,r:`2`,key:`1xzzfp`}],[`circle`,{cx:`4`,cy:`12`,r:`2`,key:`1hvhnz`}]]}),uf=Y({name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]});function df(e,t){return Ie()?(Le(e,t),!0):!1}var ff=new WeakMap,pf=(...e)=>{let t=e[0],n=Ps()?.proxy??Ie();if(n==null&&!Cr())throw Error(`injectLocal must be called in setup`);return n&&ff.has(n)&&t in ff.get(n)?ff.get(n)[t]:Sr(...e)},mf=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var hf=e=>e!==void 0,gf=Object.prototype.toString,_f=e=>gf.call(e)===`[object Object]`;function vf(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function yf(e){return Array.isArray(e)?e:[e]}function bf(e){return Qt(fn(e)?new Proxy({},{get(t,n,r){return N(Reflect.get(e.value,n,r))},set(t,n,r){return fn(e.value[n])&&!fn(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function xf(e){return bf(J(e))}function Sf(e,...t){let n=t.flat(),r=n[0];return xf(()=>Object.fromEntries(typeof r==`function`?Object.entries(Sn(e)).filter(([e,t])=>!r(_n(t),e)):Object.entries(Sn(e)).filter(e=>!n.includes(e[0]))))}function Cf(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=null,o=pn(!1);function s(){a&&=(clearInterval(a),null)}function c(){o.value=!1,s()}function l(){let n=_n(t);n<=0||(o.value=!0,i&&e(),s(),o.value&&(a=setInterval(e,n)))}return r&&mf&&l(),(fn(t)||typeof t==`function`)&&df(F(t,()=>{o.value&&mf&&l()})),df(c),{isActive:tn(o),pause:c,resume:l}}function wf(e,t,n){return F(e,t,{...n,immediate:!0})}var Tf=mf?window:void 0;mf&&window.document,mf&&window.navigator,mf&&window.location;function Ef(e){let t=_n(e);return t?.$el??t}function Df(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=J(()=>{let t=yf(_n(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return wf(()=>[n.value?.map(e=>Ef(e))??[Tf].filter(e=>e!=null),yf(_n(n.value?e[1]:e[0])),yf(N(n.value?e[2]:e[1])),_n(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=_f(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function Of(){let e=pn(!1),t=Ps();return t&&$i(()=>{e.value=!0},t),e}function kf(e){let t=Of();return J(()=>(t.value,!!e()))}function Af(e,t={}){let{immediate:n=!0,fpsLimit:r=null,window:i=Tf,once:a=!1}=t,o=pn(!1),s=J(()=>{let e=_n(r);return e?1e3/e:null}),c=0,l=null;function u(t){if(!o.value||!i)return;c||=t;let n=t-c;if(s.value&&n<s.value){l=i.requestAnimationFrame(u);return}if(c=t,e({delta:n,timestamp:t}),a){o.value=!1,l=null;return}l=i.requestAnimationFrame(u)}function d(){!o.value&&i&&(o.value=!0,c=0,l=i.requestAnimationFrame(u))}function f(){o.value=!1,l!=null&&i&&(i.cancelAnimationFrame(l),l=null)}return n&&d(),df(f),{isActive:tn(o),pause:f,resume:d}}var jf=Symbol(`vueuse-ssr-width`);function Mf(){let e=Cr()?pf(jf,null):null;return typeof e==`number`?e:void 0}function Nf(e,t={}){let{window:n=Tf,ssrWidth:r=Mf()}=t,i=kf(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=pn(typeof r==`number`),o=pn(),s=pn(!1);return Er(()=>{if(a.value){a.value=!i.value;let t=_n(e).split(`,`);s.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=vf(n[1])),i&&a&&(a=r<=vf(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(_n(e)),s.value=o.value.matches)}),Df(o,`change`,e=>{s.value=e.matches},{passive:!0}),J(()=>s.value)}function Pf(e){return JSON.parse(JSON.stringify(e))}function Ff(e,t,n={}){let{window:r=Tf,...i}=n,a,o=kf(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=F(J(()=>{let t=_n(e);return Array.isArray(t)?t.map(e=>Ef(e)):[Ef(t)]}),e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t instanceof Element&&a.observe(t,i)}},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return df(l),{isSupported:o,stop:l}}function If(e={}){let{controls:t=!1,scheduler:n=Af}=e,r=pn(new Date),i=n(()=>r.value=new Date);return t?{now:r,...i}:r}function Lf(e,t,n,r={}){var i,a;let{clone:o=!1,passive:s=!1,eventName:c,deep:l=!1,defaultValue:u,shouldEmit:d}=r,f=Ps(),p=n||f?.emit||(f==null||(i=f.$emit)==null?void 0:i.bind(f))||(f==null||(a=f.proxy)==null||(a=a.$emit)==null?void 0:a.bind(f?.proxy)),m=c;t||=`modelValue`,m||=`update:${t.toString()}`;let h=e=>o?typeof o==`function`?o(e):Pf(e):e,g=()=>hf(e[t])?h(e[t]):u,_=e=>{d?d(e)&&p(m,e):p(m,e)};if(s){let n=M(g()),r=!1;return F(()=>e[t],e=>{r||(r=!0,n.value=h(e),tr(()=>r=!1))}),F(n,n=>{!r&&(n!==e[t]||l)&&_(n)},{deep:l}),n}return J({get(){return g()},set(e){_(e)}})}var Rf=e=>e.startsWith(`/`);function zf(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function Bf(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&zf(e.default)}var Vf=Object.assign;function Hf(e,t){let n={};for(let r in t){let i=t[r];n[r]=Wf(i)?i.map(e):e(i)}return n}var Uf=()=>{},Wf=Array.isArray;function Gf(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var Kf=Symbol(``);function qf(e,t){return Vf(Error(),{type:e,[Kf]:!0},t)}function Jf(e,t){return e instanceof Error&&Kf in e&&(t==null||!!(e.type&t))}var Yf=Symbol(``),Xf=Symbol(``),Zf=Symbol(``),Qf=Symbol(``),$f=Symbol(``);function ep(){return Sr(Zf)}function tp(e){return Sr(Qf)}var np=typeof document<`u`,rp=/#/g,ip=/&/g,ap=/\//g,op=/=/g,sp=/\?/g,cp=/\+/g,lp=/%5B/g,up=/%5D/g,dp=/%5E/g,fp=/%60/g,pp=/%7B/g,mp=/%7C/g,hp=/%7D/g,gp=/%20/g;function _p(e){return e==null?``:encodeURI(``+e).replace(mp,`|`).replace(lp,`[`).replace(up,`]`)}function vp(e){return _p(e).replace(pp,`{`).replace(hp,`}`).replace(dp,`^`)}function yp(e){return _p(e).replace(cp,`%2B`).replace(gp,`+`).replace(rp,`%23`).replace(ip,`%26`).replace(fp,"`").replace(pp,`{`).replace(hp,`}`).replace(dp,`^`)}function bp(e){return yp(e).replace(op,`%3D`)}function xp(e){return _p(e).replace(rp,`%23`).replace(sp,`%3F`)}function Sp(e){return xp(e).replace(ap,`%2F`)}function Cp(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var wp=/\/$/,Tp=e=>e.replace(wp,``);function Ep(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=Pp(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:Cp(o)}}function Dp(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function Op(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function kp(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&Ap(t.matched[r],n.matched[i])&&jp(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Ap(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function jp(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Mp(e[n],t[n]))return!1;return!0}function Mp(e,t){return Wf(e)?Np(e,t):Wf(t)?Np(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function Np(e,t){return Wf(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function Pp(e,t){if(Rf(e))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`){if(s===`..`)a>1&&a--;else break}return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var Fp={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};function Ip(e){if(!e){if(np){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^/]+/,``)}else e=`/`}return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),Tp(e)}var Lp=/^[^#]+#/;function Rp(e,t){return e.replace(Lp,`#`)+t}function zp(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var Bp=()=>history.scrollRestoration===`manual`?{left:window.scrollX,top:window.scrollY}:null;function Vp(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=zp(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function Hp(e,t){return(history.state?history.state.position-t:-1)+e}var Up=new Map;function Wp(e){Up.set(e,Bp())}function Gp(e){let t=Up.get(e);return Up.delete(e),t}function Kp(e){return typeof e==`string`||e&&typeof e==`object`}function qp(e){return typeof e==`string`||typeof e==`symbol`}function Jp(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(cp,` `),i=r.indexOf(`=`),a=Cp(i<0?r:r.slice(0,i)),o=i<0?null:Cp(r.slice(i+1));if(a in t){let e=t[a];Wf(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function Yp(e){let t=``;for(let n in e){let r=e[n];if(n=bp(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(Wf(r)?r.map(e=>e&&yp(e)):[r&&yp(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function Xp(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=Wf(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}function Zp(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Qp(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(qf(4,{from:n,to:t})):e instanceof Error?c(e):Kp(e)?c(qf(2,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function $p(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(t===`beforeRouteEnter`||o.instances[e]){if(zf(s)){let c=(s.__vccOpts||s)[t];c&&a.push(Qp(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=Bf(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&Qp(c,n,r,o,e,i)()}))}}}return a}function em(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>Ap(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>Ap(e,s))||i.push(s))}return[n,r,i]}var tm=()=>location.protocol+`//`+location.host;function nm(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Op(n,``)}return Op(n,e)+r+i}function rm(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=nm(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:`pop`,direction:u?u>0?`forward`:`back`:``})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){let{history:e}=window;e.state&&e.replaceState(Vf({},e.state,{scroll:Bp()}),``)}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),{pauseListeners:c,listen:l,destroy:d}}function im(e,t,n,r=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:null}}function am(e){let{history:t,location:n}=window,r={value:nm(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:tm()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,Vf({},t.state,im(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=Vf({},i.value,t.state,{forward:e,scroll:Bp()});a(o.current,o,!0),a(e,Vf({},im(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function om(e){e=Ip(e);let t=am(e),n=rm(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=Vf({location:``,base:e,go:r,createHref:Rp.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}var sm={type:0,value:``},cm=/[a-zA-Z0-9_]/;function lm(e){if(!e)return[[]];if(e===`/`)return[[sm]];if(!Rf(e))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;)switch(c=e[s++],n){case 0:c===`\\`?(r=n,n=4):c===`/`?(l&&d(),o()):c===`:`?(d(),n=1):f();break;case 4:f(),n=r;break;case 1:c===`(`?n=2:cm.test(c)?f():(d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case 2:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`)}return n===2&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var um=`[^/]+?`,dm={sensitive:!1,strict:!1,start:!0,end:!0},fm=/[.+*?^${}()[\]/\\]/g;function pm(e,t){let n=Vf({},dm,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=40+(n.sensitive?.25:0);if(o.type===0)r||(i+=`/`),i+=o.value.replace(fm,`\\$&`),s+=40;else if(o.type===1){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||um;if(u!==um){s+=10;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=20,c&&(s+=-8),n&&(s+=-20),u===`.*`&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===0)n+=e.value;else if(e.type===1){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(Wf(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=Wf(c)?c.join(`/`):c;if(!l){if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`)}n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function mm(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function hm(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=mm(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(gm(r))return 1;if(gm(i))return-1}return i.length-r.length}function gm(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var _m={strict:!1,end:!0,sensitive:!1};function vm(e,t,n){let r=Vf(pm(lm(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function ym(e,t){let n=[],r=new Map;t=Gf(_m,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=xm(e);s.aliasOf=r&&r.record;let l=Gf(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(xm(Vf({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&!Rf(u)){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=vm(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!Cm(d)&&o(e.name)),Dm(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:Uf}function o(e){if(qp(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Tm(e,n);n.splice(t,0,e),e.record.name&&!Cm(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw qf(1,{location:e});s=i.record.name,a=Vf(bm(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&bm(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name,i.keys.forEach(e=>{e.optional&&!a[e.name]&&delete a[e.name]}));else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw qf(1,{location:e,currentLocation:t});s=i.record.name,a=Vf({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:wm(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function bm(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function xm(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Sm(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Sm(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function Cm(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function wm(e){return e.reduce((e,t)=>Vf(e,t.meta),{})}function Tm(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;hm(e,t[i])<0?r=i:n=i+1}let i=Em(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Em(e){let t=e;for(;t=t.parent;)if(Dm(t)&&hm(e,t)===0)return t}function Dm({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Om(e){let t=Sr(Zf),n=Sr(Qf),r=J(()=>{let n=N(e.to);return t.resolve(n)}),i=J(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(Ap.bind(null,i));if(o>-1)return o;let s=Nm(e[t-2]);return t>1&&Nm(i)===s&&a[a.length-1].path!==s?a.findIndex(Ap.bind(null,e[t-2])):o}),a=J(()=>i.value>-1&&Mm(n.params,r.value.params)),o=J(()=>i.value>-1&&i.value===n.matched.length-1&&jp(n.params,r.value.params));function s(n={}){if(jm(n)){let n=t[N(e.replace)?`replace`:`push`](N(e.to)).catch(Uf);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:J(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function km(e){return e.length===1?e[0]:e}var Am=I({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Om,setup(e,{slots:t}){let n=Qt(Om(e)),{options:r}=Sr(Zf),i=J(()=>({[Pm(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[Pm(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&km(t.default(n));return e.custom?r:ec(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function jm(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(e.button===void 0||e.button===0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Mm(e,t){for(let n in t){let r=t[n],i=e[n];if(Wf(r)){if(!Wf(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}else if(r!==i)return!1}return!0}function Nm(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var Pm=(e,t,n)=>e??t??n,Fm=I({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=Sr($f),i=J(()=>e.route||r.value),a=Sr(Xf,0),o=J(()=>{let e=N(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),s=J(()=>i.value.matched[o.value]);xr(Xf,J(()=>o.value+1)),xr(Yf,s),xr($f,i);let c=M();return F(()=>[c.value,s.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!Ap(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,a=e.name,o=s.value,l=o&&o.components[a];if(!l)return Im(n.default,{Component:l,route:r});let u=o.props[a],d=ec(l,Vf({},u?u===!0?r.params:typeof u==`function`?u(r):u:null,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[a]=null)},ref:c}));return Im(n.default,{Component:d,route:r})||d}}});function Im(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var Lm=Fm;function Rm(e){let t=ym(e.routes,e),n=e.parseQuery||Jp,r=e.stringifyQuery||Yp,i=e.history,a=Zp(),o=Zp(),s=Zp(),c=pn(Fp),l=pn(0),u=Fp;np&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let d=Hf.bind(null,e=>``+e),f=Hf.bind(null,Sp),p=Hf.bind(null,Cp);function m(e,n){let r,i;qp(e)?(r=t.getRecordMatcher(e),i=n):i=e;let a=t.addRoute(i,r);return l.value++,()=>{a(),l.value++}}function h(e){let n=t.getRecordMatcher(e);n&&(t.removeRoute(n),l.value++)}function g(){t.clearRoutes(),l.value++}function _(){return t.getRoutes().map(e=>e.record)}function v(e){return!!t.getRecordMatcher(e)}function y(e,a){if(l.value,typeof e==`string`){a||=e.startsWith(`/`)?Fp:c.value;let r=Ep(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return Vf(r,o,{params:p(o.params),redirectedFrom:void 0,href:s})}a=Vf({},a||(e.path!=null&&e.path.startsWith(`/`)&&!(`name`in e&&e.name)?Fp:c.value));let o;if(e.path!=null)o=Vf({},e,{path:Ep(n,e.path,a.path).path});else{let t=Vf({},e.params);for(let e in t)t[e]??delete t[e];o=Vf({},e,{params:f(t)}),a.params=f(a.params)}let s=t.resolve(o,a),u=e.hash||``;s.params=d(p(s.params));let m=Dp(r,Vf({},e,{hash:vp(u),path:s.path})),h=i.createHref(m);return Vf({fullPath:m,hash:u,query:r===Yp?Xp(e.query):e.query||{}},s,{redirectedFrom:void 0,href:h})}function b(e){return typeof e==`string`?Ep(n,e,c.value.path):Vf({},e)}function x(e,t){if(u!==e)return qf(8,{from:t,to:e})}function S(e){return T(e)}function C(e){return S(Vf(b(e),{replace:!0}))}function w(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=b(i):{path:i},i.params={}),Vf({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function T(e,t){let n=u=y(e),i=c.value,a=e.state,o=e.force,s=e.replace===!0,l=w(n,i);if(l)return T(Vf(b(l),{state:typeof l==`object`?Vf({},a,l.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&kp(r,i,n)&&(f=qf(16,{to:d,from:i}),ue(i,i,!0,!1)),(f?Promise.resolve(f):te(d,i)).catch(e=>Jf(e)?Jf(e,2)?e:le(e):O(e,d,i)).then(e=>{if(e){if(Jf(e,2))return T(Vf({replace:s},b(e.to),{state:typeof e.to==`object`?Vf({},a,e.to.state):a,force:o}),t||d)}else e=re(d,i,!0,s,a);return ne(d,i,e),e})}function ee(e,t){let n=x(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=pe.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function te(e,t){let n,[r,i,s]=em(e,t);n=$p(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(Qp(r,e,t))});let c=ee.bind(null,e,t);return n.push(c),he(n).then(()=>{n=[];for(let r of a.list())n.push(Qp(r,e,t));return n.push(c),he(n)}).then(()=>{n=$p(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(Qp(r,e,t))});return n.push(c),he(n)}).then(()=>{n=[];for(let r of s)if(r.beforeEnter){if(Wf(r.beforeEnter))for(let i of r.beforeEnter)n.push(Qp(i,e,t));else n.push(Qp(r.beforeEnter,e,t))}return n.push(c),he(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=$p(s,`beforeRouteEnter`,e,t,E),n.push(c),he(n))).then(()=>{n=[];for(let r of o.list())n.push(Qp(r,e,t));return n.push(c),he(n)}).catch(e=>Jf(e,8)?e:Promise.reject(e))}function ne(e,t,n){s.list().forEach(r=>E(()=>r(e,t,n)))}function re(e,t,n,r,a){let o=x(e,t);if(o)return o;let s=t===Fp,l=np?history.state:{};n&&(r||s?i.replace(e.fullPath,Vf({scroll:s&&l&&l.scroll},a)):i.push(e.fullPath,a)),c.value=e,ue(e,t,n,s),le()}let D;function ie(){D||=i.listen((e,t,n)=>{if(!me.listening)return;let r=y(e),a=w(r,me.currentRoute.value);if(a){T(Vf(a,{replace:!0,force:!0}),r).catch(Uf);return}u=r;let o=c.value;np&&n.delta&&Wp(Hp(o.fullPath,n.delta)),te(r,o).catch(e=>Jf(e,12)?e:Jf(e,2)?(T(Vf(b(e.to),{force:!0}),r).then(e=>{Jf(e,20)&&!n.delta&&n.type===`pop`&&i.go(-1,!1)}).catch(Uf),Promise.reject()):(n.delta&&i.go(-n.delta,!1),O(e,r,o))).then(e=>{e||=re(r,o,!1),e&&(n.delta&&!Jf(e,8)?i.go(-n.delta,!1):n.type===`pop`&&Jf(e,20)&&i.go(-1,!1)),ne(r,o,e)}).catch(Uf)})}let ae=Zp(),oe=Zp(),se;function O(e,t,n){le(e);let r=oe.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function ce(){return se&&c.value!==Fp?Promise.resolve():new Promise((e,t)=>{ae.add([e,t])})}function le(e){return se||(se=!e,ie(),ae.list().forEach(([t,n])=>e?n(e):t()),ae.reset()),e}function ue(t,n,r,i){let{scrollBehavior:a}=e;if(!np||!a)return Promise.resolve();let o=!r&&Gp(Hp(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return tr().then(()=>a(t,n,o)).then(e=>t===c.value&&e&&Vp(e)).catch(e=>t===c.value&&O(e,t,n))}let de=e=>i.go(e),fe,pe=new Set,me={currentRoute:c,listening:!0,addRoute:m,removeRoute:h,clearRoutes:g,hasRoute:v,getRoutes:_,resolve:y,options:e,push:S,replace:C,go:de,back:()=>de(-1),forward:()=>de(1),beforeEach:a.add,beforeResolve:o.add,afterEach:s.add,onError:oe.add,isReady:ce,install(e){e.component(`RouterLink`,Am),e.component(`RouterView`,Lm),e.config.globalProperties.$router=me,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>N(c)}),np&&!fe&&c.value===Fp&&(fe=!0,S(i.location).catch(e=>{}));let t={};for(let e in Fp)Object.defineProperty(t,e,{get:()=>c.value[e],enumerable:!0});e.provide(Zf,me),e.provide(Qf,$t(t)),e.provide($f,c);let n=e.unmount;pe.add(e),e.unmount=function(){pe.delete(e),pe.size<1&&(u=Fp,D&&D(),D=null,c.value=Fp,fe=!1,se=!1),n()}}};function he(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return me}function zm(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=zm(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Bm(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=zm(e))&&(r&&(r+=` `),r+=t);return r}var Vm=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Hm=Bm,Um=(e,t)=>n=>{if(t?.variants==null)return Hm(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Vm(t)||Vm(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Hm(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Wm=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Gm=(e,t)=>({classGroupId:e,validator:t}),Km=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qm=`-`,Jm=[],Ym=`arbitrary..`,Xm=e=>{let t=$m(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Qm(e);let n=e.split(qm);return Zm(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Wm(i,t):t:i||Jm}return n[e]||Jm}}},Zm=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Zm(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(qm):e.slice(t).join(qm),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Qm=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ym+r:void 0})(),$m=e=>{let{theme:t,classGroups:n}=e;return eh(n,t)},eh=(e,t)=>{let n=Km();for(let r in e){let i=e[r];th(i,n,r,t)}return n},th=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];nh(i,t,n,r)}},nh=(e,t,n,r)=>{if(typeof e==`string`){rh(e,t,n);return}if(typeof e==`function`){ih(e,t,n,r);return}ah(e,t,n,r)},rh=(e,t,n)=>{let r=e===``?t:oh(t,e);r.classGroupId=n},ih=(e,t,n,r)=>{if(sh(e)){th(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Gm(n,e))},ah=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];th(o,oh(t,a),n,r)}},oh=(e,t)=>{let n=e,r=t.split(qm),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Km(),n.nextPart.set(t,i)),n=i}return n},sh=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ch=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},lh=`!`,uh=`:`,dh=[],fh=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ph=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===uh){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(lh)?(c=s.slice(0,-1),l=!0):s.startsWith(lh)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return fh(t,l,c,u)};if(t){let e=t+uh,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):fh(dh,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},mh=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},hh=e=>({cache:ch(e.cacheSize),parseClassName:ph(e),sortModifiers:mh(e),postfixLookupClassGroupIds:gh(e),...Xm(e)}),gh=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},_h=/\s+/,vh=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(_h),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+lh:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},yh=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=bh(n))&&(i&&(i+=` `),i+=r);return i},bh=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=bh(e[r]))&&(n&&(n+=` `),n+=t);return n},xh=(e,...t)=>{let n,r,i,a,o=o=>(n=hh(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=vh(e,n);return i(e,a),a};return a=o,(...e)=>a(yh(...e))},Sh=[],Ch=e=>{let t=t=>t[e]||Sh;return t.isThemeGetter=!0,t.themeKey=e,t},wh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Th=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Eh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Dh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,kh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Ah=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mh=e=>Eh.test(e),Nh=e=>!!e&&!Number.isNaN(Number(e)),Ph=e=>!!e&&Number.isInteger(Number(e)),Fh=e=>e.endsWith(`%`)&&Nh(e.slice(0,-1)),Ih=e=>Dh.test(e),Lh=()=>!0,Rh=e=>Oh.test(e)&&!kh.test(e),zh=()=>!1,Bh=e=>Ah.test(e),Vh=e=>jh.test(e),Hh=e=>!X(e)&&!Z(e),Uh=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Wh=e=>ag(e,lg,zh),X=e=>wh.test(e),Gh=e=>ag(e,ug,Rh),Kh=e=>ag(e,dg,Nh),qh=e=>ag(e,pg,Lh),Jh=e=>ag(e,fg,zh),Yh=e=>ag(e,sg,zh),Xh=e=>ag(e,cg,Vh),Zh=e=>ag(e,mg,Bh),Z=e=>Th.test(e),Qh=e=>og(e,ug),$h=e=>og(e,fg),eg=e=>og(e,sg),tg=e=>og(e,lg),ng=e=>og(e,cg),rg=e=>og(e,mg,!0),ig=e=>og(e,pg,!0),ag=(e,t,n)=>{let r=wh.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},og=(e,t,n=!1)=>{let r=Th.exec(e);return r?r[1]?t(r[1]):n:!1},sg=e=>e===`position`||e===`percentage`,cg=e=>e===`image`||e===`url`,lg=e=>e===`length`||e===`size`||e===`bg-size`,ug=e=>e===`length`,dg=e=>e===`number`,fg=e=>e===`family-name`,pg=e=>e===`number`||e===`weight`,mg=e=>e===`shadow`,hg=xh(()=>{let e=Ch(`color`),t=Ch(`font`),n=Ch(`text`),r=Ch(`font-weight`),i=Ch(`tracking`),a=Ch(`leading`),o=Ch(`breakpoint`),s=Ch(`container`),c=Ch(`spacing`),l=Ch(`radius`),u=Ch(`shadow`),d=Ch(`inset-shadow`),f=Ch(`text-shadow`),p=Ch(`drop-shadow`),m=Ch(`blur`),h=Ch(`perspective`),g=Ch(`aspect`),_=Ch(`ease`),v=Ch(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Z,X],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Z,X,c],T=()=>[Mh,`full`,`auto`,...w()],ee=()=>[Ph,`none`,`subgrid`,Z,X],E=()=>[`auto`,{span:[`full`,Ph,Z,X]},Ph,Z,X],te=()=>[Ph,`auto`,Z,X],ne=()=>[`auto`,`min`,`max`,`fr`,Z,X],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],D=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ie=()=>[`auto`,...w()],ae=()=>[Mh,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],oe=()=>[s,Mh,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],se=()=>[Mh,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],O=()=>[e,Z,X],ce=()=>[...b(),eg,Yh,{position:[Z,X]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,tg,Wh,{size:[Z,X]}],de=()=>[Fh,Qh,Gh],fe=()=>[``,`none`,`full`,l,Z,X],pe=()=>[``,Nh,Qh,Gh],me=()=>[`solid`,`dashed`,`dotted`,`double`],he=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ge=()=>[Nh,Fh,eg,Yh],_e=()=>[``,`none`,m,Z,X],ve=()=>[`none`,Nh,Z,X],ye=()=>[`none`,Nh,Z,X],k=()=>[Nh,Z,X],A=()=>[Mh,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ih],breakpoint:[Ih],color:[Lh],container:[Ih],"drop-shadow":[Ih],ease:[`in`,`out`,`in-out`],font:[Hh],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ih],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ih],shadow:[Ih],spacing:[`px`,Nh],text:[Ih],"text-shadow":[Ih],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Mh,X,Z,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Z,X]}],"container-named":[Uh],columns:[{columns:[Nh,`auto`,X,Z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ph,`auto`,Z,X]}],basis:[{basis:[Mh,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Nh,Mh,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,Nh,Z,X]}],shrink:[{shrink:[``,Nh,Z,X]}],order:[{order:[Ph,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...D(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...D()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...D(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...D(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...D(),`baseline`]}],"place-self":[{"place-self":[`auto`,...D()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mbs:[{mbs:ie()}],mbe:[{mbe:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ae()}],"inline-size":[{inline:[`auto`,...oe()]}],"min-inline-size":[{"min-inline":[`auto`,...oe()]}],"max-inline-size":[{"max-inline":[`none`,...oe()]}],"block-size":[{block:[`auto`,...se()]}],"min-block-size":[{"min-block":[`auto`,...se()]}],"max-block-size":[{"max-block":[`none`,...se()]}],w:[{w:[s,`screen`,...ae()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ae()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ae()]}],h:[{h:[`screen`,`lh`,...ae()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ae()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...ae()]}],"font-size":[{text:[`base`,n,Qh,Gh]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ig,qh]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Fh,X]}],"font-family":[{font:[$h,Jh,t]}],"font-features":[{"font-features":[X]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Z,X]}],"line-clamp":[{"line-clamp":[Nh,`none`,Z,Kh]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...me(),`wavy`]}],"text-decoration-thickness":[{decoration:[Nh,`from-font`,`auto`,Z,Gh]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[Nh,`auto`,Z,X]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ph,Z,X]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Z,X]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ph,Z,X],radial:[``,Z,X],conic:[``,Ph,Z,X]},ng,Xh]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...me(),`hidden`,`none`]}],"divide-style":[{divide:[...me(),`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...me(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Nh,Z,X]}],"outline-w":[{outline:[``,Nh,Qh,Gh]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`inner`,`none`,u,rg,Zh]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,d,rg,Zh]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:pe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[Nh,Gh]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,f,rg,Zh]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[Nh,Z,X]}],"mix-blend":[{"mix-blend":[...he(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Nh]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Nh]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:_e()}],brightness:[{brightness:[Nh,Z,X]}],contrast:[{contrast:[Nh,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,rg,Zh]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,Nh,Z,X]}],"hue-rotate":[{"hue-rotate":[Nh,Z,X]}],invert:[{invert:[``,Nh,Z,X]}],saturate:[{saturate:[Nh,Z,X]}],sepia:[{sepia:[``,Nh,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[Nh,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[Nh,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Nh,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Nh,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,Nh,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[Nh,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[Nh,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,Nh,Z,X]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Nh,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,_,Z,X]}],delay:[{delay:[Nh,Z,X]}],animate:[{animate:[`none`,v,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":[`scale-3d`],skew:[{skew:k()}],"skew-x":[{"skew-x":k()}],"skew-y":[{"skew-y":k()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:A()}],"translate-x":[{"translate-x":A()}],"translate-y":[{"translate-y":A()}],"translate-z":[{"translate-z":A()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ph,Z,X]}],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Z,X]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Z,X]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[Nh,Qh,Gh,Kh]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function gg(...e){return hg(Bm(e))}var _g=I({__name:`Alert`,props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){let t=e;return(n,r)=>(B(),V(`div`,{"data-slot":`alert`,class:k(N(gg)(N(bg)({variant:e.variant}),t.class)),role:`alert`},[R(n.$slots,`default`)],2))}}),vg=I({__name:`AlertDescription`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`div`,{"data-slot":`alert-description`,class:k(N(gg)(`text-muted-foreground col-start-2 text-sm [&_p]:leading-relaxed`,t.class))},[R(e.$slots,`default`)],2))}}),yg=I({__name:`AlertTitle`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`div`,{"data-slot":`alert-title`,class:k(N(gg)(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,t.class))},[R(e.$slots,`default`)],2))}}),bg=Um(`relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-card-foreground [&>svg]:text-destructive`,warning:`bg-card text-card-foreground [&>svg]:text-warning`}},defaultVariants:{variant:`default`}});function xg(e){return typeof e==`string`?`'${e}'`:new Tg().serialize(e)}var Sg=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Cg=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Sg.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function wg(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Cg[n]?Cg[n]:n+128,s=a<128&&Cg[a]?Cg[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var Tg=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?wg(e,t):n===`number`&&r===`number`?e-t:wg(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(wg),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})();function Eg(e,t){return e===t||xg(e)===xg(t)}function Dg(e,t){let n=typeof e==`string`&&!t?`${e}Context`:t,r=Symbol(n);return[t=>{let n=Sr(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},e=>(xr(r,e),e)]}function Og(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function kg(e,t,n){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function Ag(e){return e==null}function jg(e,t){return Ag(e)?!1:Array.isArray(e)?e.some(e=>Eg(e,t)):Eg(e,t)}function Mg(e,t){return Ie()?(Le(e,t),!0):!1}function Ng(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return Mg(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}function Pg(e){let t=!1,n,r=Fe(!0);return((...i)=>(t||=(n=r.run(()=>e(...i)),!0),n))}var Fg=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Ig=e=>e!==void 0,Lg=Object.prototype.toString,Rg=e=>Lg.call(e)===`[object Object]`,zg=()=>{},Bg=Vg();function Vg(){var e,t;return Fg&&!!((e=window)!=null&&(e=e.navigator)!=null&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Hg(...e){if(e.length!==1)return Tn(...e);let t=e[0];return typeof t==`function`?en(xn(()=>({get:t,set:zg}))):M(t)}function Ug(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return`cancel`in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}var Wg=e=>e();function Gg(e=Wg,t={}){let{initialState:n=`active`}=t,r=Hg(n===`active`);function i(){r.value=!1}function a(){r.value=!0}return{isActive:tn(r),pause:i,resume:a,eventFilter:(...t)=>{r.value&&e(...t)}}}function Kg(e){return Array.isArray(e)?e:[e]}function qg(e){return e||Ps()}function Jg(e){if(!Fg)return e;let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return((...a)=>(t+=1,r||(r=Fe(!0),n=r.run(()=>e(...a))),Mg(i),n))}function Yg(e){return Qt(fn(e)?new Proxy({},{get(t,n,r){return N(Reflect.get(e.value,n,r))},set(t,n,r){return fn(e.value[n])&&!fn(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function Xg(e){return Yg(J(e))}function Zg(e,...t){let n=t.flat(),r=n[0];return Xg(()=>Object.fromEntries(typeof r==`function`?Object.entries(Sn(e)).filter(([e,t])=>!r(_n(t),e)):Object.entries(Sn(e)).filter(e=>!n.includes(e[0]))))}function Qg(e,t=1e4){return xn((n,r)=>{let i=_n(e),a,o=()=>setTimeout(()=>{i=_n(e),r()},_n(t));return Mg(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function $g(e,t,n={}){let{eventFilter:r=Wg,...i}=n;return F(e,Ug(r,t),i)}function e_(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=Gg(r,{initialState:i});return{stop:$g(e,t,{...a,eventFilter:o}),pause:s,resume:c,isActive:l}}function t_(e,t,...[n]){let{flush:r=`sync`,deep:i=!1,immediate:a=!0,direction:o=`both`,transform:s={}}=n||{},c=[],l=`ltr`in s&&s.ltr||(e=>e),u=`rtl`in s&&s.rtl||(e=>e);return(o===`both`||o===`ltr`)&&c.push(e_(e,e=>{c.forEach(e=>e.pause()),t.value=l(e),c.forEach(e=>e.resume())},{flush:r,deep:i,immediate:a})),(o===`both`||o===`rtl`)&&c.push(e_(t,t=>{c.forEach(e=>e.pause()),e.value=u(t),c.forEach(e=>e.resume())},{flush:r,deep:i,immediate:a})),()=>{c.forEach(e=>e.stop())}}function n_(e,t){qg(t)&&na(e,t)}function r_(e,t,n){return F(e,t,{...n,immediate:!0})}var i_=Fg?window:void 0;Fg&&window.document,Fg&&window.navigator,Fg&&window.location;function a_(e){let t=_n(e);return t?.$el??t}function o_(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=J(()=>{let t=Kg(_n(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return r_(()=>[n.value?.map(e=>a_(e))??[i_].filter(e=>e!=null),Kg(_n(n.value?e[1]:e[0])),Kg(N(n.value?e[2]:e[1])),_n(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=Rg(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function s_(){let e=pn(!1),t=Ps();return t&&$i(()=>{e.value=!0},t),e}function c_(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function l_(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=i_,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=c_(t);return o_(i,a,e=>{e.repeat&&_n(s)||c(e)&&n(e)},o)}function u_(e){return JSON.parse(JSON.stringify(e))}function d_(e,t,n,r={}){var i,a;let{clone:o=!1,passive:s=!1,eventName:c,deep:l=!1,defaultValue:u,shouldEmit:d}=r,f=Ps(),p=n||f?.emit||(f==null||(i=f.$emit)==null?void 0:i.bind(f))||(f==null||(a=f.proxy)==null||(a=a.$emit)==null?void 0:a.bind(f?.proxy)),m=c;t||=`modelValue`,m||=`update:${t.toString()}`;let h=e=>o?typeof o==`function`?o(e):u_(e):e,g=()=>Ig(e[t])?h(e[t]):u,_=e=>{d?d(e)&&p(m,e):p(m,e)};if(s){let n=M(g()),r=!1;return F(()=>e[t],e=>{r||(r=!0,n.value=h(e),tr(()=>r=!1))}),F(n,n=>{!r&&(n!==e[t]||l)&&_(n)},{deep:l}),n}return J({get(){return g()},set(e){_(e)}})}function f_(e){return e?e.flatMap(e=>e.type===z?f_(e.children):[e]):[]}var p_=[`INPUT`,`TEXTAREA`];function m_(e,t,n,r={}){if(!t||r.enableIgnoredElement&&p_.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=h_(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function h_(e,t,n,r=e.includes(t)?e.length:e.length+1){if(--r===0)return null;let i=e.indexOf(t),a;if(a=i===-1?n.goForward?0:e.length-1:n.goForward?i+1:i-1,!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?h_(e,o,n,r):o:null}var[g_,__]=Dg(`ConfigProvider`),v_=Qt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});function y_(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function b_(e,t,n=`.`,r){if(!y_(t))return b_(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:y_(a)&&y_(i[t])?b_(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function x_(e){return(...t)=>t.reduce((t,n)=>b_(t,n,``,e),{})}var S_=x_(),C_=Jg(()=>{let e=M(new Map),t=M(),n=J(()=>{for(let t of e.value.values())if(t)return!0;return!1}),r=g_({scrollBody:M(!0)}),i=null,a=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,v_.layersWithOutsidePointerEventsDisabled.size===0&&(document.body.style.pointerEvents=``),document.documentElement.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=t.value??``,Bg&&i?.(),t.value=void 0};return F(n,(e,o)=>{if(!Fg)return;if(!e){o&&a();return}t.value===void 0&&(t.value=document.body.style.overflow);let s=window.innerWidth-document.documentElement.clientWidth,c={padding:s,margin:0},l=r.scrollBody?.value?typeof r.scrollBody.value==`object`?S_({padding:r.scrollBody.value.padding===!0?s:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?s:r.scrollBody.value.margin},c):c:{padding:0,margin:0};s>0&&(document.body.style.paddingRight=typeof l.padding==`number`?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin==`number`?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty(`--scrollbar-width`,`${s}px`),document.body.style.overflow=`hidden`),Bg&&(i=o_(document,`touchmove`,e=>E_(e),{passive:!1})),tr(()=>{n.value&&(document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`)})},{immediate:!0,flush:`sync`}),e});function w_(e){let t=Math.random().toString(36).substring(2,7),n=C_();n.value.set(t,e??!1);let r=J({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return n_(()=>{n.value.delete(t)}),r}function T_(e){let t=window.getComputedStyle(e);if(t.overflowX===`scroll`||t.overflowY===`scroll`||t.overflowX===`auto`&&e.clientWidth<e.scrollWidth||t.overflowY===`auto`&&e.clientHeight<e.scrollHeight)return!0;{let t=e.parentNode;return!(t instanceof Element)||t.tagName===`BODY`?!1:T_(t)}}function E_(e){let t=e||window.event,n=t.target;return n instanceof Element&&T_(n)?!1:t.touches.length>1||(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function D_(e){let t=g_({dir:M(`ltr`)});return J(()=>e?.value||t.dir?.value||`ltr`)}function O_(e){let t=Ps(),n=t?.type.emits,r={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(t=>{r[se(D(t))]=(...n)=>e(t,...n)}),r}var k_=0;function A_(){Er(e=>{if(!Fg)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??j_()),document.body.insertAdjacentElement(`beforeend`,t[1]??j_()),k_++,e(()=>{k_===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),k_--})})}function j_(){let e=document.createElement(`span`);return e.setAttribute(`data-reka-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function M_(e){return J(()=>!_n(e)||!!a_(e)?.closest(`form`))}function N_(){let e=Ps(),t=M(),n=J(()=>r());ta(()=>{n.value!==r()&&gn(t)});function r(){return t.value&&`$el`in t.value&&[`#text`,`#comment`].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:a_(t)}let i=Object.assign({},e.exposed),a={};for(let t in e.props)Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(i).length>0)for(let e in i)Object.defineProperty(a,e,{enumerable:!0,configurable:!0,get:()=>i[e]});Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=a;function o(n){if(t.value=n,n&&(Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),!(n instanceof Element)&&!Object.hasOwn(n,`$el`))){let t=n.$.exposed,r=Object.assign({},a);for(let e in t)Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>t[e]});e.exposed=r}}return{forwardRef:o,currentRef:t,currentElement:n}}function P_(e){let t=Ps(),n=Object.keys(t?.type.props??{}).reduce((e,n)=>{let r=(t?.type.props[n]).default;return r!==void 0&&(e[n]=r),e},{}),r=Tn(e);return J(()=>{let e={},i=t?.vnode.props??{};return Object.keys(i).forEach(t=>{e[D(t)]=i[t]}),Object.keys({...n,...e}).reduce((e,t)=>(r.value[t]!==void 0&&(e[t]=r.value[t]),e),{})})}function F_(e,t){let n=P_(e),r=t?O_(t):{};return J(()=>({...n.value,...r}))}function I_(){let e=Ps()?.vnode?.scopeId;return e?{[e]:``}:{}}function L_(e,t){let n=Qg(!1,300);Mg(()=>{n.value=!1});let r=M(null),i=Ng();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=z_(a,R_(a,i.getBoundingClientRect()),1),s=B_(t.getBoundingClientRect()),c=H_([...o,...s]);r.value=c,n.value=!0}return Er(n=>{if(e.value&&t.value){let r=e.value,i=t.value,a=e=>o(e,i),s=e=>o(e,r);r.addEventListener(`pointerleave`,a),i.addEventListener(`pointerleave`,s),n(()=>{r.removeEventListener(`pointerleave`,a),i.removeEventListener(`pointerleave`,s)})}}),Er(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!V_(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())},s=e.value?.ownerDocument;s?.addEventListener(`pointermove`,o),n(()=>s?.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function R_(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function z_(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function B_(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function V_(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function H_(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),U_(t)}function U_(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t.at(-1),n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n.at(-1),t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var W_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},G_=new WeakMap,K_=new WeakMap,q_={},J_=0,Y_=function(e){return e&&(e.host||Y_(e.parentNode))},X_=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Y_(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Z_=function(e,t,n,r){var i=X_(t,Array.isArray(e)?e:[e]);q_[n]||(q_[n]=new WeakMap);var a=q_[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(G_.get(e)||0)+1,l=(a.get(e)||0)+1;G_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&K_.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),J_++,function(){o.forEach(function(e){var t=G_.get(e)-1,i=a.get(e)-1;G_.set(e,t),a.set(e,i),t||(K_.has(e)||e.removeAttribute(r),K_.delete(e)),i||e.removeAttribute(n)}),J_--,J_||(G_=new WeakMap,G_=new WeakMap,K_=new WeakMap,q_={})}},Q_=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||W_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Z_(r,i,n,`aria-hidden`)):function(){return null}};function $_(e){let t;F(()=>a_(e),e=>{let n=!1;try{n=!!e?.closest(`[popover]:not(:popover-open)`)}catch{}e&&!n?t=Q_(e):t&&t()}),ra(()=>{t&&t()})}var ev=0;function tv(e,t=`reka`){if(e)return e;let n,r=g_({useId:void 0});return n=r.useId?r.useId():`useId`in xu?si?.():`${++ev}`,t?`${t}-${n}`:n}function nv(e){let t=M(),n=J(()=>t.value?.width??0),r=J(()=>t.value?.height??0),i;return $i(()=>{let n=a_(e);n?(t.value={width:n.offsetWidth,height:n.offsetHeight},i=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let r=e[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=n.offsetWidth,a=n.offsetHeight;t.value={width:i,height:a}}),i.observe(n,{box:`border-box`})):t.value=void 0}),ra(()=>{i?.disconnect(),i=void 0}),{width:n,height:r}}function rv(e,t){let n=M(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}function iv(e){let t=Qg(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=Og(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=ov(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function av(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ov(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=av(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function sv(e,t){let n=M({}),r=M(`none`),i=M(e),a=e.value?`mounted`:`unmounted`,o,s=t.value?.ownerDocument.defaultView??i_,{state:c,dispatch:l}=rv(a,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),u=e=>{if(Fg){let n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(n)}};F(e,async(e,i)=>{let a=i!==e;if(await tr(),a){let a=r.value,o=cv(t.value);e?(l(`MOUNT`),u(`enter`),o===`none`&&u(`after-enter`)):o===`none`||o===`undefined`||n.value?.display===`none`?(l(`UNMOUNT`),u(`leave`),u(`after-leave`)):i&&a!==o?(l(`ANIMATION_OUT`),u(`leave`)):(l(`UNMOUNT`),u(`after-leave`))}},{immediate:!0});let d=e=>{if(e.target!==t.value)return;let n=cv(t.value),r=n.includes(CSS.escape(e.animationName)),a=c.value===`mounted`?`enter`:`leave`;if(r&&(u(`after-${a}`),l(`ANIMATION_END`),!i.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,o=s?.setTimeout(()=>{t.value?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}n===`none`&&l(`ANIMATION_END`)},f=e=>{e.target===t.value&&(r.value=cv(t.value))},p=F(t,(e,t)=>{e?(n.value=getComputedStyle(e),e.addEventListener(`animationstart`,f),e.addEventListener(`animationcancel`,d),e.addEventListener(`animationend`,d)):(l(`ANIMATION_END`),o!==void 0&&s?.clearTimeout(o),t?.removeEventListener(`animationstart`,f),t?.removeEventListener(`animationcancel`,d),t?.removeEventListener(`animationend`,d))},{immediate:!0}),m=F(c,()=>{let e=cv(t.value);r.value=c.value===`mounted`?e:`none`});return ra(()=>{p(),m(),t.value&&(t.value.removeEventListener(`animationstart`,f),t.value.removeEventListener(`animationcancel`,d),t.value.removeEventListener(`animationend`,d)),o!==void 0&&s?.clearTimeout(o)}),{isPresent:J(()=>[`mounted`,`unmountSuspended`].includes(c.value))}}function cv(e){return e&&getComputedStyle(e).animationName||`none`}var lv=I({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){let{present:r,forceMount:i}=Sn(e),a=M(),{isPresent:o}=sv(r,a);n({present:o});let s=t.default({present:o.value});s=f_(s||[]);let c=Ps();if(s&&s?.length>1){let e=c?.parent?.type.name?`<${c.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(e=>` - ${e}`).join(`
|
|
5
5
|
`)].join(`
|
|
6
6
|
`))}return()=>i.value||r.value||o.value?ec(t.default({present:o.value})[0],{ref:e=>{let t=a_(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),uv=I({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=f_(n.default()),r=e.findIndex(e=>e.type!==ls);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?q(t,i.props):t,o=ws({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),dv=[`area`,`img`,`input`],fv=I({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&dv.includes(r)?()=>ec(r,t):r===`template`?()=>ec(uv,t,{default:n.default}):()=>ec(e.as,t,{default:n.default})}});function pv(){let e=M();return{primitiveElement:e,currentElement:J(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:a_(e))}}var[mv,hv]=Dg(`DialogRoot`),gv=I({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=d_(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=M(),a=M(),{modal:o,unmountOnHide:s}=Sn(n);return hv({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>R(e.$slots,`default`,{open:N(r),close:()=>r.value=!1})}}),_v=I({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;N_();let n=mv();return(e,r)=>(B(),H(N(fv),q(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>N(n).onOpenChange(!1)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`type`]))}}),vv=`dismissableLayer.pointerDownOutside`,yv=`dismissableLayer.focusOutside`;function bv(e,t){if(!(t instanceof Element))return!1;if(e.contains(t))return!0;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function xv(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=M(!1),a=M(()=>{});return Er(o=>{if(!Fg||!_n(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(bv(t.value,o)){r.removeEventListener(`click`,a.value),i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){kg(vv,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{_n(n)&&(i.value=!0)}}}function Sv(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=M(!1);return Er(a=>{if(!Fg||!_n(n))return;let o=async n=>{if(!t?.value)return;await tr(),await tr();let r=n.target;t.value&&r&&!bv(t.value,r)&&n.target&&!i.value&&kg(yv,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{_n(n)&&(i.value=!0)},onBlurCapture:()=>{_n(n)&&(i.value=!1)}}}var Cv=I({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=N_(),o=J(()=>a.value?.ownerDocument??globalThis.document),s=J(()=>v_.layersRoot),c=J(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=J(()=>v_.layersWithOutsidePointerEventsDisabled.size>0),u=J(()=>{let e=Array.from(s.value),[t]=[...v_.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=xv(async e=>{let t=[...v_.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await tr(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=Sv(e=>{let t=[...v_.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return l_(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),F([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{e&&n&&t&&(v_.layersWithOutsidePointerEventsDisabled.size===0&&(v_.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),v_.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{v_.layersWithOutsidePointerEventsDisabled.delete(e),v_.layersWithOutsidePointerEventsDisabled.size===0&&!Ag(v_.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=v_.originalBodyPointerEvents)}))},{immediate:!0}),F([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),Er(e=>{e(()=>{a.value&&(s.value.delete(a.value),v_.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(B(),H(N(fv),{ref:N(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:he({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:N(f).onFocusCapture,onBlurCapture:N(f).onBlurCapture,onPointerdownCapture:N(d).onPointerDownCapture},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),wv=Pg(()=>M([]));function Tv(){let e=wv();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=Ev(e.value,t),e.value.unshift(t)},remove(t){e.value=Ev(e.value,t),e.value[0]?.resume()}}}function Ev(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var Dv=`focusScope.autoFocusOnMount`,Ov=`focusScope.autoFocusOnUnmount`,kv={bubbles:!1,cancelable:!0};function Av(e,{select:t=!1}={}){let n=Og();for(let r of e)if(Iv(r,{select:t}),Og()!==n)return!0}function jv(e){let t=Mv(e);return[Nv(t,e),Nv(t.reverse(),e)]}function Mv(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nv(e,t){for(let n of e)if(!Pv(n,{upTo:t}))return n}function Pv(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Fv(e){return e instanceof HTMLInputElement&&`select`in e}function Iv(e,{select:t=!1}={}){if(e&&e.focus){let n=Og();e.focus({preventScroll:!0}),e!==n&&Fv(e)&&t&&e.select()}}var Lv=I({__name:`FocusScope`,props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},present:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(e,{emit:t}){let n=e,r=t,{currentRef:i,currentElement:a}=N_(),o=M(null),s=Tv(),c=Qt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Er(e=>{if(!Fg)return;let t=a.value;if(!n.trapped)return;function r(e){if(c.paused||!t)return;let n=e.target;t.contains(n)?o.value=n:Iv(o.value,{select:!0})}function i(e){if(c.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||Iv(o.value,{select:!0}))}function s(e){let n=o.value;if(n===null||!e.some(e=>e.removedNodes.length>0))return;let r=Og();r&&t.contains(r)||t.contains(n)||Iv(t)}document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,i);let l=new MutationObserver(s);t&&l.observe(t,{childList:!0,subtree:!0}),e(()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,i),l.disconnect()})});function l(e,t){let n=new CustomEvent(Dv,kv),i=e=>r(`mountAutoFocus`,e);e.addEventListener(Dv,i),e.dispatchEvent(n),e.removeEventListener(Dv,i),n.defaultPrevented||(Av(Mv(e),{select:!0}),Og()===t&&Iv(e))}Er(async e=>{let t=a.value;if(await tr(),!t)return;n.present!==!1&&s.add(c);let i=Og();!t.contains(i)&&n.present!==!1&&l(t,i),e(()=>{let e=new CustomEvent(Ov,kv),n=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(Ov,n),t.dispatchEvent(e),t.setAttribute(`data-focus-scope-unmounting`,``),setTimeout(()=>{e.defaultPrevented||Iv(i??document.body,{select:!0}),t.removeEventListener(Ov,n),s.remove(c),t.removeAttribute(`data-focus-scope-unmounting`)},0)})}),F(()=>n.present,async(e,t)=>{if(!Fg)return;if(e===!1&&t===!0){s.remove(c);return}if(e!==!0||t!==!1)return;s.add(c),await tr();let n=a.value;if(!n)return;let r=Og();n.contains(r)||l(n,r)});function u(e){if(!n.loop&&!n.trapped||c.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=Og();if(t&&r){let t=e.currentTarget,[i,a]=jv(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&Iv(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&Iv(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(B(),H(N(fv),{ref_key:`currentRef`,ref:i,tabindex:`-1`,"as-child":e.asChild,as:e.as,onKeydown:u},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),Rv=`menu.itemSelect`,zv=[`Enter`,` `],Bv=[`ArrowDown`,`PageUp`,`Home`],Vv=[`ArrowUp`,`PageDown`,`End`],Hv=[...Bv,...Vv],Uv={ltr:[...zv,`ArrowRight`],rtl:[...zv,`ArrowLeft`]},Wv={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]};function Gv(e){return e?`open`:`closed`}function Kv(e){return e===`indeterminate`}function qv(e){return Kv(e)?`indeterminate`:e?`checked`:`unchecked`}function Jv(e){let t=Og();for(let n of e)if(n===t||(n.focus(),Og()!==t))return}function Yv(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Xv(e,t){return t?Yv({x:e.clientX,y:e.clientY},t):!1}function Zv(e){return e.pointerType===`mouse`}var Qv=I({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=mv(),{forwardRef:a,currentElement:o}=N_();return i.titleId||=tv(void 0,`reka-dialog-title`),i.descriptionId||=tv(void 0,`reka-dialog-description`),$i(()=>{i.contentElement=o,Og()!==document.body&&(i.triggerElement.value=Og())}),(e,t)=>(B(),H(N(Lv),{"as-child":``,loop:``,trapped:n.trapFocus,present:n.present,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:P(()=>[W(N(Cv),q({id:N(i).contentId,ref:N(a),as:e.as,"as-child":e.asChild,present:n.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":N(i).descriptionId,"aria-labelledby":N(i).titleId,"data-state":N(Gv)(N(i).open.value)},e.$attrs,{onDismiss:t[0]||=e=>N(i).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>r(`focusOutside`,e),onInteractOutside:t[3]||=e=>r(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>r(`pointerDownOutside`,e)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),$v=I({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=mv(),a=O_(r),{forwardRef:o,currentElement:s}=N_();$_(J(()=>n.present?s.value:void 0));let c=J(()=>{let{present:e,...t}=n;return t});return F(()=>n.present,(e,t)=>{!e&&t&&i.triggerElement.value?.focus()}),(e,t)=>(B(),H(Qv,q({...c.value,...N(a)},{ref:N(o),present:e.present,"trap-focus":N(i).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),N(i).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),ey=I({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=O_(t);N_();let i=mv(),a=M(!1),o=M(!1),s=J(()=>{let{present:e,...t}=n;return t});return F(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(B(),H(Qv,q({...s.value,...N(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||N(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;N(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`present`]))}}),ty=I({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=mv(),a=O_(r),{forwardRef:o}=N_(),s=J(()=>n.forceMount||!i.unmountOnHide.value);return(e,t)=>(B(),H(N(lv),{present:N(i).open.value,"force-mount":s.value},{default:P(({present:t})=>[N(i).modal.value?yr((B(),H($v,q({key:0,ref:N(o),present:!s.value||t},{...n,...N(a),...e.$attrs}),{default:P(()=>[R(e.$slots,`default`)]),_:2},1040,[`present`])),[[Vc,e.forceMount||N(i).unmountOnHide.value||t]]):yr((B(),H(ey,q({key:1,ref:N(o),present:!s.value||t},{...n,...N(a),...e.$attrs}),{default:P(()=>[R(e.$slots,`default`)]),_:2},1040,[`present`])),[[Vc,e.forceMount||N(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),ny=I({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;N_();let n=mv();return(e,r)=>(B(),H(N(fv),q(t,{id:N(n).descriptionId}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),ry=I({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(e){let t=e,n=mv(),r=w_(t.present);return F(()=>t.present,e=>r.value=e),N_(),(e,t)=>(B(),H(N(fv),{as:e.as,"as-child":e.asChild,"data-state":N(n).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=au(()=>{},[`left`,`self`,`prevent`])},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),iy=I({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=mv(),{forwardRef:r}=N_(),i=J(()=>t.forceMount||!n.unmountOnHide.value);return(e,t)=>N(n)?.modal.value?(B(),H(N(lv),{key:0,present:N(n).open.value,"force-mount":i.value},{default:P(({present:t})=>[yr(W(ry,q(e.$attrs,{ref:N(r),as:e.as,"as-child":e.asChild,present:!i.value||t}),{default:P(()=>[R(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[Vc,e.forceMount||N(n).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`])):K(`v-if`,!0)}}),ay=I({__name:`Teleport`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e,n=g_({}),r=J(()=>t.to??n.teleportTo?.value??`body`),i=s_();return(e,t)=>N(i)||e.forceMount?(B(),H(Ur,{key:0,to:r.value,disabled:e.disabled,defer:e.defer},[R(e.$slots,`default`)],8,[`to`,`disabled`,`defer`])):K(`v-if`,!0)}}),oy=I({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),H(N(ay),A(Cs(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),sy=I({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=mv();return N_(),(e,r)=>(B(),H(N(fv),q(t,{id:N(n).titleId}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),cy=`data-reka-collection-item`;function ly(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;n?(i={collectionRef:M(),itemMap:M(new Map)},xr(r,i)):i=Sr(r);let a=(e,t=!1)=>{if(!i.collectionRef.value)return;let n=i.itemMap.value.get(e);return n&&(t||n.ref.dataset.disabled!==``)?n:void 0},o=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${cy}]`)),r=new Map(n.map((e,t)=>[e,t])),a=Array.from(i.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?a:a.filter(e=>e.ref.dataset.disabled!==``)},s=I({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=pv();return F(a,()=>{i.collectionRef.value=a.value}),()=>ec(uv,{ref:r,...n},t)}}),c=I({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=pv();return Er(t=>{if(a.value){let n=ln(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>ec(uv,{...n,[cy]:``,ref:r},t)}});return{getItems:o,getItem:a,reactiveItems:J(()=>Array.from(i.itemMap.value.values())),itemMapSize:J(()=>i.itemMap.value.size),CollectionSlot:s,CollectionItem:c}}var uy=I({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(B(),H(N(fv),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`focusable`||e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),dy=I({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=pv();return F(J(()=>t.checked??t.value),(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(B(),H(uy,q({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),fy=I({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=J(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=J(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(e,i)=>(B(),V(z,null,[K(` We render single input if it's required `),n.value?(B(),H(dy,q({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(B(!0),V(z,{key:1},L(r.value,n=>(B(),H(dy,q({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),py=`rovingFocusGroup.onEntryFocus`,my={bubbles:!1,cancelable:!0},hy={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function gy(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function _y(e,t,n){let r=gy(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return hy[r]}function vy(e,t=!1){let n=Og();for(let r of e)if(r===n||(r.focus({preventScroll:t}),Og()!==n))return}function yy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[by,xy]=Dg(`PopperRoot`),Sy=I({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=M();return xy({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>R(e.$slots,`default`)}}),Cy=I({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=N_(),i=by();return Dr(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(B(),H(N(fv),{ref:N(n),as:e.as,"as-child":e.asChild},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function wy(e){return e!==null}function Ty(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Ey(n),u={start:e.dir===`rtl`?`100%`:`0%`,center:`50%`,end:e.dir===`rtl`?`0%`:`100%`}[l],d={start:`0%`,center:`50%`,end:`100%`}[l],f=(i.arrow?.x??0)+o/2,p=(i.arrow?.y??0)+s/2,m=``,h=``;return c===`bottom`?(m=a?u:`${f}px`,h=`${-s}px`):c===`top`?(m=a?u:`${f}px`,h=`${r.floating.height+s}px`):c===`right`?(m=`${-s}px`,h=a?d:`${p}px`):c===`left`&&(m=`${r.floating.width+s}px`,h=a?d:`${p}px`),{data:{x:m,y:h}}}}}function Ey(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Dy=[`top`,`right`,`bottom`,`left`],Oy=Math.min,ky=Math.max,Ay=Math.round,jy=Math.floor,My=e=>({x:e,y:e}),Ny={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Py(e,t,n){return ky(e,Oy(t,n))}function Fy(e,t){return typeof e==`function`?e(t):e}function Iy(e){return e.split(`-`)[0]}function Ly(e){return e.split(`-`)[1]}function Ry(e){return e===`x`?`y`:`x`}function zy(e){return e===`y`?`height`:`width`}function By(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Vy(e){return Ry(By(e))}function Hy(e,t,n){n===void 0&&(n=!1);let r=Ly(e),i=Vy(e),a=zy(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Zy(o)),[o,Zy(o)]}function Uy(e){let t=Zy(e);return[Wy(e),t,Wy(t)]}function Wy(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Gy=[`left`,`right`],Ky=[`right`,`left`],qy=[`top`,`bottom`],Jy=[`bottom`,`top`];function Yy(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ky:Gy:t?Gy:Ky;case`left`:case`right`:return t?qy:Jy;default:return[]}}function Xy(e,t,n,r){let i=Ly(e),a=Yy(Iy(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Wy)))),a}function Zy(e){let t=Iy(e);return Ny[t]+e.slice(t.length)}function Qy(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function $y(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Qy(e)}function eb(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function tb(e,t,n){let{reference:r,floating:i}=e,a=By(t),o=Vy(t),s=zy(o),c=Iy(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ly(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function nb(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Fy(t,e),p=$y(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=eb(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=eb(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var rb=50,ib=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:nb},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=tb(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<rb&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=tb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ab=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Fy(e,t)||{};if(l==null)return{};let d=$y(u),f={x:n,y:r},p=Vy(i),m=zy(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=Oy(d[_],T),E=Oy(d[v],T),te=C-h[m]-E,ne=C/2-h[m]/2+w,re=Py(ee,ne,te),D=!c.arrow&&Ly(i)!=null&&ne!==re&&a.reference[m]/2-(ne<ee?ee:E)-h[m]/2<0,ie=D?ne<ee?ne-ee:ne-te:0;return{[p]:f[p]+ie,data:{[p]:re,centerOffset:ne-re-ie,...D&&{alignmentOffset:ie}},reset:D}}}),ob=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Fy(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Iy(r),_=By(o),v=Iy(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Zy(o)]:Uy(o)),x=p!==`none`;!d&&x&&b.push(...Xy(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Hy(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===By(t)||T.every(e=>By(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=By(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function sb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cb(e){return Dy.some(t=>e[t]>=0)}var lb=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Fy(e,t);switch(i){case`referenceHidden`:{let e=sb(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cb(e)}}}case`escaped`:{let e=sb(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cb(e)}}}default:return{}}}}},ub=new Set([`left`,`top`]);async function db(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Iy(n),s=Ly(n),c=By(n)===`y`,l=ub.has(o)?-1:1,u=a&&c?-1:1,d=Fy(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var fb=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await db(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},pb=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Fy(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=By(i),p=Ry(f),m=u[p],h=u[f],g=(e,t)=>Py(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},mb=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Fy(e,t),u={x:n,y:r},d=By(i),f=Ry(d),p=u[f],m=u[d],h=Fy(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ub.has(Iy(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},hb=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Fy(e,t),c=await i.detectOverflow(t,s),l=Iy(n),u=Ly(n),d=By(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Oy(p-c[m],g),y=Oy(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ky(c.left,c.right):S=p-2*ky(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function gb(){return typeof window<`u`}function _b(e){return bb(e)?(e.nodeName||``).toLowerCase():`#document`}function vb(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yb(e){return((bb(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function bb(e){return gb()?e instanceof Node||e instanceof vb(e).Node:!1}function xb(e){return gb()?e instanceof Element||e instanceof vb(e).Element:!1}function Sb(e){return gb()?e instanceof HTMLElement||e instanceof vb(e).HTMLElement:!1}function Cb(e){return!gb()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof vb(e).ShadowRoot}function wb(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Fb(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Tb(e){return/^(table|td|th)$/.test(_b(e))}function Eb(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Db=/transform|translate|scale|rotate|perspective|filter/,Ob=/paint|layout|strict|content/,kb=e=>!!e&&e!==`none`,Ab;function jb(e){let t=xb(e)?Fb(e):e;return kb(t.transform)||kb(t.translate)||kb(t.scale)||kb(t.rotate)||kb(t.perspective)||!Nb()&&(kb(t.backdropFilter)||kb(t.filter))||Db.test(t.willChange||``)||Ob.test(t.contain||``)}function Mb(e){let t=Lb(e);for(;Sb(t)&&!Pb(t);){if(jb(t))return t;if(Eb(t))return null;t=Lb(t)}return null}function Nb(){return Ab??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ab}function Pb(e){return/^(html|body|#document)$/.test(_b(e))}function Fb(e){return vb(e).getComputedStyle(e)}function Ib(e){return xb(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lb(e){if(_b(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Cb(e)&&e.host||yb(e);return Cb(t)?t.host:t}function Rb(e){let t=Lb(e);return Pb(t)?(e.ownerDocument||e).body:Sb(t)&&wb(t)?t:Rb(t)}function zb(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Rb(e),i=r===e.ownerDocument?.body,a=vb(r);if(i){let e=Bb(a);return t.concat(a,a.visualViewport||[],wb(r)?r:[],e&&n?zb(e):[])}return t.concat(r,zb(r,[],n))}function Bb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vb(e){let t=Fb(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Sb(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ay(n)!==a||Ay(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Hb(e){return xb(e)?e:e.contextElement}function Ub(e){let t=Hb(e);if(!Sb(t))return My(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Vb(t),o=(a?Ay(n.width):n.width)/r,s=(a?Ay(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Wb=My(0);function Gb(e){let t=vb(e);return!Nb()||!t.visualViewport?Wb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kb(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===vb(e)}function qb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Hb(e),o=My(1);t&&(r?xb(r)&&(o=Ub(r)):o=Ub(e));let s=Kb(a,n,r)?Gb(a):My(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=vb(a),t=xb(r)?vb(r):r,n=e,i=Bb(n);for(;i&&t!==n;){let e=Ub(i),t=i.getBoundingClientRect(),r=Fb(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=vb(i),i=Bb(n)}}return eb({width:u,height:d,x:c,y:l})}function Jb(e,t){let n=Ib(e).scrollLeft;return t?t.left+n:qb(yb(e)).left+n}function Yb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Jb(e,n),y:n.top+t.scrollTop}}function Xb(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=yb(r),s=t?Eb(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=My(1),u=My(0),d=Sb(r);if((d||!a)&&((_b(r)!==`body`||wb(o))&&(c=Ib(r)),d)){let e=qb(r);l=Ub(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Yb(o,c):My(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Zb(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Qb(e){let t=Ib(e),n=e.ownerDocument.body,r=ky(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ky(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Jb(e),o=-t.scrollTop;return Fb(n).direction===`rtl`&&(a+=ky(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var $b=25;function ex(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=vb(e),a=yb(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Nb()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Jb(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=$b&&(s-=o)}return{width:s,height:c,x:l,y:u}}function tx(e,t){let n=qb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ub(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function nx(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ex(e,n,t);else if(t===`document`)r=Qb(yb(e));else if(xb(t))r=tx(t,n);else{let n=Gb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return eb(r)}function rx(e,t){let n=t.get(e);if(n)return n;let r=zb(e,[],!1).filter(e=>xb(e)&&_b(e)!==`body`),i=null,a=Fb(e).position===`fixed`,o=a?Lb(e):e;for(;xb(o)&&!Pb(o);){let e=Fb(o),t=jb(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Lb(o)}return t.set(e,r),r}function ix(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Eb(t)?[]:rx(t,this._c):[].concat(n),r],o=nx(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=nx(t,a[e],i);s=ky(n.top,s),c=Oy(n.right,c),l=Oy(n.bottom,l),u=ky(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ax(e){let{width:t,height:n}=Vb(e);return{width:t,height:n}}function ox(e,t,n){let r=Sb(t),i=yb(t),a=n===`fixed`,o=qb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=My(0);if((r||!a)&&((_b(t)!==`body`||wb(i))&&(s=Ib(t)),r)){let e=qb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Jb(i));let l=i&&!r&&!a?Yb(i,s):My(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function sx(e){return Fb(e).position===`static`}function cx(e,t){if(!Sb(e)||Fb(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return yb(e)===n&&(n=n.ownerDocument.body),n}function lx(e,t){let n=vb(e);if(Eb(e))return n;if(!Sb(e)){let t=Lb(e);for(;t&&!Pb(t);){if(xb(t)&&!sx(t))return t;t=Lb(t)}return n}let r=cx(e,t);for(;r&&Tb(r)&&sx(r);)r=cx(r,t);return r&&Pb(r)&&sx(r)&&!jb(r)?n:r||Mb(e)||n}var ux=async function(e){let t=this.getOffsetParent||lx,n=this.getDimensions,r=await n(e.floating);return{reference:ox(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dx(e){return Fb(e).direction===`rtl`}var fx={convertOffsetParentRelativeRectToViewportRelativeRect:Xb,getDocumentElement:yb,getClippingRect:ix,getOffsetParent:lx,getElementRects:ux,getClientRects:Zb,getDimensions:ax,getScale:Ub,isElement:xb,isRTL:dx};function px(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mx(e,t,n){let r=null,i,a=yb(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=jy(d),h=jy(a.clientWidth-(u+f)),g=jy(a.clientHeight-(d+p)),_=jy(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ky(0,Oy(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!px(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=vb(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function hx(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Hb(e),u=i||a?[...l?zb(l):[],...t?zb(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?mx(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?qb(e):null;c&&g();function g(){let t=qb(e);h&&!px(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var gx=fb,_x=pb,vx=ob,yx=hb,bx=lb,xx=ab,Sx=mb,Cx=(e,t,n)=>{let r=new Map,i=n??{},a={...fx,...i.platform,_c:r};return ib(e,t,{...i,platform:a})};function wx(e){return typeof e==`object`&&!!e&&`$el`in e}function Tx(e){if(wx(e)){let t=e.$el;return bb(t)&&_b(t)===`#comment`?null:t}return e}function Ex(e){return typeof e==`function`?e():N(e)}function Dx(e){return{name:`arrow`,options:e,fn(t){let n=Tx(Ex(e.element));return n==null?{}:xx({element:n,padding:e.padding}).fn(t)}}}function Ox(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kx(e,t){let n=Ox(e);return Math.round(t*n)/n}function Ax(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=J(()=>Ex(n.open)??!0),a=J(()=>Ex(n.middleware)),o=J(()=>Ex(n.placement)??`bottom`),s=J(()=>Ex(n.strategy)??`absolute`),c=J(()=>Ex(n.transform)??!0),l=J(()=>Tx(e.value)),u=J(()=>Tx(t.value)),d=M(0),f=M(0),p=M(s.value),m=M(o.value),h=pn({}),g=M(!1),_=J(()=>{let e={position:p.value,left:`0`,top:`0`};if(!u.value)return e;let t=kx(u.value,d.value),n=kx(u.value,f.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...Ox(u.value)>=1.5&&{willChange:`transform`}}:{position:p.value,left:t+`px`,top:n+`px`}}),v;function y(){if(l.value==null||u.value==null)return;let e=i.value;Cx(l.value,u.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(t=>{d.value=t.x,f.value=t.y,p.value=t.strategy,m.value=t.placement,h.value=t.middlewareData,g.value=e!==!1})}function b(){typeof v==`function`&&(v(),v=void 0)}function x(){if(b(),r===void 0){y();return}if(l.value!=null&&u.value!=null){v=r(l.value,u.value,y);return}}function S(){i.value||(g.value=!1)}return F([a,o,s,i],y,{flush:`sync`}),F([l,u],x,{flush:`sync`}),F(i,S,{flush:`sync`}),Ie()&&Le(b),{x:tn(d),y:tn(f),strategy:tn(p),placement:tn(m),middlewareData:tn(h),isPositioned:tn(g),floatingStyles:_,update:y}}var jx=[`dir`],Mx={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[Nx,Px]=Dg(`PopperContent`),Fx=I({inheritAttrs:!1,__name:`PopperContent`,props:Fa({memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Mx}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=by(),{forwardRef:a,currentElement:o}=N_(),s=D_(J(()=>n.dir)),c=M(),l=M(),{width:u,height:d}=nv(l),f=J(()=>n.side+(n.align===`center`?``:`-${n.align}`)),p=J(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),m=J(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=J(()=>({padding:p.value,boundary:m.value.filter(wy),altBoundary:m.value.length>0})),g=J(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),_=J(()=>[gx({mainAxis:n.sideOffset+d.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&vx({...h.value,...g.value}),n.avoidCollisions&&_x({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?Sx():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&vx({...h.value,...g.value}),yx({...h.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--reka-popper-available-width`,`${n}px`),o.setProperty(`--reka-popper-available-height`,`${r}px`),o.setProperty(`--reka-popper-anchor-width`,`${i}px`),o.setProperty(`--reka-popper-anchor-height`,`${a}px`)}}),l.value&&Dx({element:l.value,padding:n.arrowPadding}),Ty({arrowWidth:u.value,arrowHeight:d.value,dir:s.value}),n.hideWhenDetached&&bx({strategy:`referenceHidden`,...h.value})]),{floatingStyles:v,placement:y,isPositioned:b,middlewareData:x,update:S}=Ax(J(()=>n.reference??i.anchor.value),c,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...e)=>hx(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:_}),C=J(()=>Ey(y.value)[0]),w=J(()=>Ey(y.value)[1]);Dr(()=>{b.value&&r(`placed`)});let T=J(()=>{let e=x.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),ee=M(``);return Er(()=>{o.value&&(ee.value=window.getComputedStyle(o.value).zIndex)}),Px({placedSide:C,onArrowChange:e=>l.value=e,arrowX:J(()=>x.value.arrow?.x??0),arrowY:J(()=>x.value.arrow?.y??0),shouldHideArrow:T}),(e,t)=>(B(),V(`div`,{ref_key:`floatingRef`,ref:c,"data-reka-popper-content-wrapper":``,dir:N(s),style:he({...N(v),transform:N(b)?N(v).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ee.value,"--reka-popper-transform-origin":[N(x).transformOrigin?.x,N(x).transformOrigin?.y].join(` `),...N(x).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[n.memoDependencies?nc([n.asChild,n.as,C.value,w.value,N(b),...Object.values(e.$attrs),...n.memoDependencies],()=>(B(),H(N(fv),q({key:0,ref:N(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,style:{animation:N(b)?void 0:`none`}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])),t,0):(B(),H(N(fv),q({key:1,ref:N(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,dir:N(s),style:{animation:N(b)?void 0:`none`}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`dir`,`style`]))],12,jx))}}),[Ix,Lx]=Dg(`RovingFocusGroup`),Rx=I({__name:`RovingFocusGroup`,props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`entryFocus`,`update:currentTabStopId`],setup(e,{expose:t,emit:n}){let r=e,i=n,{loop:a,orientation:o,dir:s}=Sn(r),c=D_(s),l=d_(r,`currentTabStopId`,i,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),u=M(!1),d=M(!1),f=M(0),{getItems:p,CollectionSlot:m}=ly({isProvider:!0});function h(e){let t=!d.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!u.value){let t=new CustomEvent(py,my);if(e.currentTarget.dispatchEvent(t),i(`entryFocus`,t),!t.defaultPrevented){let e=p().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);vy([e.find(e=>e.getAttribute(`data-active`)===``),e.find(e=>e.getAttribute(`data-highlighted`)===``),e.find(e=>e.id===l.value),...e].filter(Boolean),r.preventScrollOnEntryFocus)}}d.value=!1}function g(){setTimeout(()=>{d.value=!1},1)}return t({getItems:p}),Lx({loop:a,dir:c,orientation:o,currentTabStopId:l,onItemFocus:e=>{l.value=e},onItemShiftTab:()=>{u.value=!0},onFocusableItemAdd:()=>{f.value++},onFocusableItemRemove:()=>{f.value--}}),(e,t)=>(B(),H(N(m),null,{default:P(()=>[W(N(fv),{tabindex:u.value||f.value===0?-1:0,"data-orientation":N(o),as:e.as,"as-child":e.asChild,dir:N(c),style:{outline:`none`},onMousedown:t[0]||=e=>d.value=!0,onMouseup:g,onFocus:h,onBlur:t[1]||=e=>u.value=!1},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`as`,`as-child`,`dir`])]),_:3}))}}),zx=I({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Ix(),r=tv(),i=J(()=>t.tabStopId||r),a=J(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:s}=ly();$i(()=>{t.focusable&&n.onFocusableItemAdd()}),ra(()=>{t.focusable&&n.onFocusableItemRemove()}),F(()=>t.focusable,(e,t)=>{e!==t&&(e?n.onFocusableItemAdd():n.onFocusableItemRemove())});function c(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=_y(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...o().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?yy(i,t+1):i.slice(t+1)}tr(()=>vy(i))}}return(e,t)=>(B(),H(N(s),null,{default:P(()=>[W(N(fv),{tabindex:a.value?0:-1,"data-orientation":N(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?N(n).onItemFocus(i.value):t.preventDefault()},onFocus:t[1]||=e=>N(n).onItemFocus(i.value),onKeydown:c},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[Bx,Vx]=Dg(`CheckboxGroupRoot`);function Hx(e){return e===`indeterminate`}function Ux(e){return Hx(e)?`indeterminate`:e?`checked`:`unchecked`}var[Wx,Gx]=Dg(`CheckboxRoot`),Kx=I({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=N_(),o=Bx(null),s=d_(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),c=J(()=>o?.disabled.value||n.disabled),l=J(()=>Eg(s.value,n.trueValue)),u=J(()=>Ag(o?.modelValue.value)?s.value===`indeterminate`?`indeterminate`:l.value:jg(o.modelValue.value,n.value));function d(){if(Ag(o?.modelValue.value))s.value===`indeterminate`?s.value=n.trueValue:s.value=l.value?n.falseValue:n.trueValue;else{let e=[...o.modelValue.value||[]];if(jg(e,n.value)){let t=e.findIndex(e=>Eg(e,n.value));e.splice(t,1)}else e.push(n.value);o.modelValue.value=e}}let f=M_(a),p=I_(),m=Ma(),h=J(()=>{if(!m[`aria-label`])return n.id&&a.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0});return Gx({disabled:c,state:u}),(e,t)=>(B(),V(z,null,[(B(),H(fa(N(o)?.rovingFocus.value?N(zx):N(fv)),q({...e.$attrs,...N(p)},{id:e.id,ref:N(i),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":N(Hx)(u.value)?`mixed`:u.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||h.value,"data-state":N(Ux)(u.value),"data-disabled":c.value?``:void 0,disabled:c.value,focusable:N(o)?.rovingFocus.value?!c.value:void 0,onKeydown:su(au(()=>{},[`prevent`]),[`enter`]),onClick:d}),{default:P(()=>[R(e.$slots,`default`,{modelValue:N(s),state:u.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),N(f)&&e.name&&!N(o)?(B(),H(N(fy),q({key:0,type:`checkbox`,checked:!!u.value,name:e.name,value:e.value,disabled:c.value,required:e.required},N(p)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):K(`v-if`,!0)],64))}}),qx=I({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=N_(),n=Wx();return(e,r)=>(B(),H(N(lv),{present:e.forceMount||N(Hx)(N(n).state.value)||N(n).state.value===!0},{default:P(()=>[W(N(fv),q({ref:N(t),"data-state":N(Ux)(N(n).state.value),"data-disabled":N(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),Jx=I({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(B(),H(N(Cy),A(Cs(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}});function Yx(){let e=M(!1);return $i(()=>{o_(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),o_([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}var Xx=Jg(Yx),[Zx,Qx]=Dg([`MenuRoot`,`MenuSub`],`MenuContext`),[$x,eS]=Dg(`MenuRoot`),tS=I({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i,dir:a}=Sn(n),o=D_(a),s=d_(n,`open`,r),c=M(),l=Xx();return Qx({open:s,onOpenChange:e=>{s.value=e},content:c,onContentChange:e=>{c.value=e}}),eS({onClose:()=>{s.value=!1},isUsingKeyboardRef:l,dir:o,modal:i}),(e,t)=>(B(),H(N(Sy),null,{default:P(()=>[R(e.$slots,`default`)]),_:3}))}}),[nS,rS]=Dg(`MenuContent`),iS=I({__name:`MenuContentImpl`,props:Fa({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Mx}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,i=Zx(),a=$x(),{trapFocus:o,disableOutsidePointerEvents:s,loop:c}=Sn(n);A_(),w_(s.value);let l=M(``),u=M(0),d=M(0),f=M(null),p=M(`right`),m=M(0),h=M(null),g=M(),{forwardRef:_,currentElement:v}=N_(),{handleTypeaheadSearch:y}=iv(),b=M();function x(e){let t=m_(e,b.value||Og(),v.value,{loop:c.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!1,attributeName:`[data-reka-collection-item]:not([data-disabled])`});t&&(b.value=t,t.scrollIntoView({block:`nearest`}))}function S(){b.value&&b.value.click()}let C=M(),w=M();F(b,e=>{if(w.value&&(e===void 0||e!==w.value.trigger.value)){if(e===void 0)return;w.value.onOpenChange(!1),w.value=void 0}}),F(v,e=>{i.onContentChange(e)}),ra(()=>{window.clearTimeout(u.value)});function T(e){return p.value===f.value?.side&&Xv(e,f.value?.area)}async function ee(e){r(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),v.value?.focus({preventScroll:!0}))}function E(e){if(e.defaultPrevented)return;let t=e.target,n=t.closest(`[data-reka-menu-content]`)===e.currentTarget,r=[`input`,`textarea`].includes(t.tagName.toLowerCase()),i=e.ctrlKey||e.altKey||e.metaKey,o=e.key.length===1,s=m_(e,Og(),v.value,{loop:c.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!0,attributeName:`[data-reka-collection-item]:not([data-disabled])`});if(s)return s?.focus();if(e.code===`Space`)return;let l=g.value?.getItems()??[];if(n&&(e.key===`Tab`&&a.modal.value&&e.preventDefault(),!i&&o&&!r&&y(e.key,l)),e.target!==v.value||!Hv.includes(e.key))return;e.preventDefault();let u=[...l.map(e=>e.ref)];Vv.includes(e.key)&&u.reverse(),Jv(u)}function te(e){e?.currentTarget?.contains?.(e.target)||(window.clearTimeout(u.value),l.value=``)}function ne(e){if(!Zv(e))return;let t=e.target,n=m.value!==e.clientX;if((e?.currentTarget)?.contains(t)&&n){let t=e.clientX>m.value?`right`:`left`;p.value=t,m.value=e.clientX}}function re(e){Zv(e)&&C.value&&C.value.focus()}return rS({onItemEnter:e=>!!T(e),onItemLeave:e=>T(e)?!0:([`INPUT`,`TEXTAREA`].includes(Og()?.tagName||``)||v.value?.focus(),h.value=null,!1),onTriggerLeave:e=>!!T(e),searchRef:l,highlightedElement:b,onKeydownNavigation:x,onKeydownEnter:S,filterElement:C,onFilterElementChange:e=>{C.value=e},activeSubmenuContext:w,pointerGraceTimerRef:d,onPointerGraceIntentChange:e=>{f.value=e}}),(e,t)=>(B(),H(N(Lv),{"as-child":``,trapped:N(o),onMountAutoFocus:ee,onUnmountAutoFocus:t[7]||=e=>r(`closeAutoFocus`,e)},{default:P(()=>[W(N(Cv),{"as-child":``,"disable-outside-pointer-events":N(s),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>r(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>r(`focusOutside`,e),onInteractOutside:t[5]||=e=>r(`interactOutside`,e),onDismiss:t[6]||=e=>r(`dismiss`)},{default:P(()=>[W(N(Rx),{ref_key:`rovingFocusGroupRef`,ref:g,"current-tab-stop-id":h.value,"onUpdate:currentTabStopId":t[0]||=e=>h.value=e,"as-child":``,orientation:`vertical`,dir:N(a).dir.value,loop:N(c),onEntryFocus:t[1]||=e=>{r(`entryFocus`,e),N(a).isUsingKeyboardRef.value||e.preventDefault()}},{default:P(()=>[W(N(Fx),{ref:N(_),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-reka-menu-content":``,"data-state":N(Gv)(N(i).open.value),dir:N(a).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,"position-strategy":e.positionStrategy,"update-position-strategy":e.updatePositionStrategy,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,reference:e.reference,onKeydown:E,onBlur:te,onPointermove:ne,onPointerenter:re},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`position-strategy`,`update-position-strategy`,`sticky`,`hide-when-detached`,`reference`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),aS=I({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=nS(),{forwardRef:r,currentElement:i}=N_(),{CollectionItem:a}=ly(),o=M(!1),s=J(()=>o.value||i.value!=null&&n.highlightedElement.value===i.value);async function c(e){if(!e.defaultPrevented&&Zv(e)){if(t.disabled)n.onItemLeave(e);else if(!n.onItemEnter(e)){let t=e.currentTarget;n.highlightedElement.value=t,[`INPUT`,`TEXTAREA`].includes(Og()?.tagName||``)||t.focus({preventScroll:!0})}}}async function l(e){await tr(),!e.defaultPrevented&&Zv(e)&&n.highlightedElement.value===i.value&&!n.onItemLeave(e)&&n.highlightedElement.value===i.value&&(n.highlightedElement.value=void 0)}return(e,t)=>(B(),H(N(a),{value:{textValue:e.textValue}},{default:P(()=>[W(N(fv),q({ref:N(r),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":s.value?``:void 0,onPointermove:c,onPointerleave:l,onFocus:t[0]||=async t=>{let r=t.currentTarget;await tr(),!(t.defaultPrevented||e.disabled)&&(o.value=!0,N(n).highlightedElement.value=r)},onBlur:t[1]||=async e=>{await tr(),!e.defaultPrevented&&(o.value=!1)}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),oS=I({__name:`MenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=N_(),o=$x(),s=nS(),c=M(!1);async function l(){let e=a.value;if(!n.disabled&&e){let e=new CustomEvent(Rv,{bubbles:!0,cancelable:!0});r(`select`,e),await tr(),e.defaultPrevented?c.value=!1:o.onClose()}}return(e,t)=>(B(),H(aS,q(n,{ref:N(i),onClick:l,onPointerdown:t[0]||=()=>{c.value=!0},onPointerup:t[1]||=async e=>{await tr(),!e.defaultPrevented&&(c.value||e.currentTarget?.click())},onKeydown:t[2]||=async t=>{let n=N(s).searchRef.value!==``;e.disabled||n&&t.key===` `||N(zv).includes(t.key)&&(t.currentTarget?.click(),t.preventDefault())}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),[sS,cS]=Dg([`MenuCheckboxItem`,`MenuRadioItem`],`MenuItemIndicatorContext`),lS=I({__name:`MenuItemIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=sS({modelValue:M(!1)});return(e,n)=>(B(),H(N(lv),{present:e.forceMount||N(Kv)(N(t).modelValue.value)||N(t).modelValue.value===!0},{default:P(()=>[W(N(fv),{as:e.as,"as-child":e.asChild,"data-state":N(qv)(N(t).modelValue.value)},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`])]),_:3},8,[`present`]))}}),uS=I({__name:`MenuCheckboxItem`,props:{modelValue:{type:[Boolean,String],required:!1,default:!1},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`,`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=P_(Zg(n,[`modelValue`])),a=d_(n,`modelValue`,r);return cS({modelValue:a}),(e,t)=>(B(),H(oS,q({role:`menuitemcheckbox`},N(i),{"aria-checked":N(Kv)(N(a))?`mixed`:N(a),"data-state":N(qv)(N(a)),onSelect:t[0]||=async e=>{r(`select`,e),N(Kv)(N(a))?a.value=!0:a.value=!N(a)}}),{default:P(()=>[R(e.$slots,`default`,{modelValue:N(a)})]),_:3},16,[`aria-checked`,`data-state`]))}}),dS=I({__name:`MenuRootContentModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=F_(n,r),a=Zx(),{forwardRef:o,currentElement:s}=N_();return $_(s),(e,t)=>(B(),H(iS,q(N(i),{ref:N(o),"trap-focus":N(a).open.value,"disable-outside-pointer-events":N(a).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>N(a).onOpenChange(!1),onFocusOutside:t[1]||=au(e=>r(`focusOutside`,e),[`prevent`])}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),fS=I({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=F_(e,t),r=Zx();return(e,t)=>(B(),H(iS,q(N(n),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>N(r).onOpenChange(!1)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),pS=I({__name:`MenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=F_(e,t),r=Zx(),i=$x();return(e,t)=>(B(),H(N(lv),{present:e.forceMount||N(r).open.value},{default:P(()=>[N(i).modal.value?(B(),H(dS,A(q({key:0},{...e.$attrs,...N(n)})),{default:P(()=>[R(e.$slots,`default`)]),_:3},16)):(B(),H(fS,A(q({key:1},{...e.$attrs,...N(n)})),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),[mS,hS]=Dg(`MenuGroup`),gS=I({__name:`MenuGroup`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=tv(void 0,`reka-menu-group`);return hS({id:n}),(e,r)=>(B(),H(N(fv),q({role:`group`},t,{"aria-labelledby":N(n)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-labelledby`]))}}),_S=I({__name:`MenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=mS({id:``});return(e,r)=>(B(),H(N(fv),q(t,{id:N(n).id||void 0}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`id`]))}}),vS=I({__name:`MenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),H(N(ay),A(Cs(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),[yS,bS]=Dg(`MenuRadioGroup`),xS=I({__name:`MenuRadioGroup`,props:{modelValue:{type:null,required:!1,default:``},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=P_(Zg(n,[`modelValue`])),a=d_(n,`modelValue`,r);return bS({modelValue:a,onValueChange:e=>{a.value=e}}),(e,t)=>(B(),H(gS,A(Cs(N(i))),{default:P(()=>[R(e.$slots,`default`,{modelValue:N(a)})]),_:3},16))}}),SS=I({__name:`MenuRadioItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=P_(Zg(n,[`value`])),{value:a}=Sn(n),o=yS(),s=J(()=>o.modelValue.value===a?.value);return cS({modelValue:s}),(e,t)=>(B(),H(oS,q({role:`menuitemradio`},N(i),{"aria-checked":s.value,"data-state":N(qv)(s.value),onSelect:t[0]||=async e=>{r(`select`,e),N(o).onValueChange(N(a))}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`aria-checked`,`data-state`]))}}),CS=I({__name:`MenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(B(),H(N(fv),q(t,{role:`separator`,"aria-orientation":`horizontal`}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),[wS,TS]=Dg(`MenuSub`),ES=I({__name:`MenuSub`,props:{open:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=d_(n,`open`,t,{defaultValue:!1,passive:n.open===void 0}),i=Zx(),a=M(),o=M();return Er(e=>{i?.open.value===!1&&(r.value=!1),e(()=>r.value=!1)}),Qx({open:r,onOpenChange:e=>{r.value=e},content:o,onContentChange:e=>{o.value=e}}),TS({triggerId:``,contentId:``,trigger:a,onTriggerChange:e=>{a.value=e}}),(e,t)=>(B(),H(N(Sy),null,{default:P(()=>[R(e.$slots,`default`)]),_:3}))}}),DS=I({__name:`MenuSubContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1,default:!0},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=F_(e,t),r=Zx(),i=$x(),a=wS(),o=nS(),{forwardRef:s,currentElement:c}=N_();return a.contentId||=tv(void 0,`reka-menu-sub-content`),(e,t)=>(B(),H(N(lv),{present:e.forceMount||N(r).open.value},{default:P(()=>[W(iS,q(N(n),{id:N(a).contentId,ref:N(s),"aria-labelledby":N(a).triggerId,align:`start`,side:N(i).dir.value===`rtl`?`left`:`right`,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,"trap-focus":!1,onOpenAutoFocus:t[0]||=au(e=>{N(i).isUsingKeyboardRef.value&&N(c)?.focus()},[`prevent`]),onCloseAutoFocus:t[1]||=au(()=>{},[`prevent`]),onFocusOutside:t[2]||=e=>{if(e.defaultPrevented)return;let t=N(o).filterElement.value?.contains(e.target);e.target!==N(a).trigger.value&&!t&&N(r).onOpenChange(!1)},onEscapeKeyDown:t[3]||=e=>{N(i).onClose(),e.preventDefault()},onKeydown:t[4]||=e=>{let t=e.currentTarget?.contains(e.target),n=N(Wv)[N(i).dir.value].includes(e.key);t&&n&&(N(r).onOpenChange(!1),N(o).filterElement.value?(N(o).filterElement.value.focus(),N(o).highlightedElement.value=N(a).trigger.value,N(a).trigger.value?.scrollIntoView({block:`nearest`})):N(a).trigger.value?.focus(),e.preventDefault())}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`,`side`])]),_:3},8,[`present`]))}}),OS=I({__name:`MenuSubTrigger`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Zx(),r=$x(),i=wS(),a=nS();F(n.open,e=>{e?a.activeSubmenuContext.value={onOpenChange:n.onOpenChange,trigger:i.trigger}:a.activeSubmenuContext.value?.trigger.value===i.trigger.value&&(a.activeSubmenuContext.value=void 0)});let o=M(null);i.triggerId||=tv(void 0,`reka-menu-sub-trigger`);function s(){o.value&&window.clearTimeout(o.value),o.value=null}ra(()=>{s()});function c(e){Zv(e)&&(a.onItemEnter(e)||!t.disabled&&!n.open.value&&!o.value&&(a.onPointerGraceIntentChange(null),o.value=window.setTimeout(()=>{n.onOpenChange(!0),s()},100)))}async function l(e){if(!Zv(e))return;s();let t=n.content.value?.getBoundingClientRect();if(t?.width){let r=n.content.value?.dataset.side,i=r===`right`,o=i?-5:5,s=t[i?`left`:`right`],c=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:s,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(a.pointerGraceTimerRef.value),a.pointerGraceTimerRef.value=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e))return;a.onPointerGraceIntentChange(null)}}async function u(e){let i=a.searchRef.value!==``;t.disabled||i&&e.key===` `||Uv[r.dir.value].includes(e.key)&&(n.onOpenChange(!0),await tr(),n.content.value?.focus(),e.preventDefault())}return(e,r)=>(B(),H(Jx,{"as-child":``},{default:P(()=>[W(aS,q(t,{id:N(i).triggerId,ref:e=>{e&&N(i)?.onTriggerChange(e?.$el)},"aria-haspopup":`menu`,"aria-expanded":N(n).open.value,"aria-controls":N(i).contentId,"data-state":N(Gv)(N(n).open.value),onClick:r[0]||=async e=>{t.disabled||e.defaultPrevented||(e.currentTarget?.focus(),N(n).open.value||N(n).onOpenChange(!0))},onPointermove:c,onPointerleave:l,onKeydown:u}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`aria-expanded`,`aria-controls`,`data-state`])]),_:3}))}}),kS=I({__name:`DropdownMenuCheckboxItem`,props:{modelValue:{type:[Boolean,String],required:!1},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`,`update:modelValue`],setup(e,{emit:t}){let n=e,r=O_(t);return N_(),(e,t)=>(B(),H(N(uS),A(Cs({...n,...N(r)})),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),[AS,jS]=Dg(`DropdownMenuRoot`),MS=I({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;N_();let i=d_(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=M(),{modal:o,dir:s}=Sn(n),c=D_(s);return jS({open:i,onOpenChange:e=>{i.value=e},onOpenToggle:()=>{i.value=!i.value},triggerId:``,triggerElement:a,contentId:``,modal:o,dir:c}),(e,t)=>(B(),H(N(tS),{open:N(i),"onUpdate:open":t[0]||=e=>fn(i)?i.value=e:null,dir:N(c),modal:N(o)},{default:P(()=>[R(e.$slots,`default`,{open:N(i)})]),_:3},8,[`open`,`dir`,`modal`]))}}),NS=I({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=F_(e,t);N_();let r=AS(),i=M(!1);function a(e){e.defaultPrevented||(i.value||setTimeout(()=>{r.triggerElement.value?.focus()},0),i.value=!1,e.preventDefault())}return r.contentId||=tv(void 0,`reka-dropdown-menu-content`),(e,t)=>(B(),H(N(pS),q(N(n),{id:N(r).contentId,"aria-labelledby":N(r)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`},onCloseAutoFocus:a,onInteractOutside:t[0]||=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,a=t.button===2||n;(!N(r).modal.value||a)&&(i.value=!0),N(r).triggerElement.value?.contains(e.target)&&e.preventDefault()}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),PS=I({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=O_(t);return N_(),(e,t)=>(B(),H(N(oS),A(Cs({...n,...N(r)})),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),FS=I({__name:`DropdownMenuItemIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return N_(),(e,n)=>(B(),H(N(lS),A(Cs(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),IS=I({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return N_(),(e,n)=>(B(),H(N(_S),A(Cs(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),LS=I({__name:`DropdownMenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),H(N(vS),A(Cs(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),RS=I({__name:`DropdownMenuRadioGroup`,props:{modelValue:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=O_(t);return N_(),(e,t)=>(B(),H(N(xS),A(Cs({...n,...N(r)})),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),zS=I({__name:`DropdownMenuRadioItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=F_(e,t);return N_(),(e,t)=>(B(),H(N(SS),A(Cs(N(n))),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),BS=I({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return N_(),(e,n)=>(B(),H(N(CS),A(Cs(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),VS=I({__name:`DropdownMenuSub`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=d_(n,`open`,t,{passive:n.open===void 0,defaultValue:n.defaultOpen??!1});return N_(),(e,t)=>(B(),H(N(ES),{open:N(r),"onUpdate:open":t[0]||=e=>fn(r)?r.value=e:null},{default:P(()=>[R(e.$slots,`default`,{open:N(r)})]),_:3},8,[`open`]))}}),HS=I({__name:`DropdownMenuSubContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=F_(e,t);return N_(),(e,t)=>(B(),H(N(DS),q(N(n),{style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),US=I({__name:`DropdownMenuSubTrigger`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return N_(),(e,n)=>(B(),H(N(OS),A(Cs(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),WS=I({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=AS(),{forwardRef:r,currentElement:i}=N_();return $i(()=>{n.triggerElement=i}),n.triggerId||=tv(void 0,`reka-dropdown-menu-trigger`),(e,i)=>(B(),H(N(Jx),{"as-child":``},{default:P(()=>[W(N(fv),{id:N(n).triggerId,ref:N(r),type:e.as===`button`?`button`:void 0,"as-child":t.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":N(n).open.value,"aria-controls":N(n).open.value?N(n).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":N(n).open.value?`open`:`closed`,onClick:i[0]||=async t=>{!e.disabled&&t.button===0&&t.ctrlKey===!1&&(N(n)?.onOpenToggle(),await tr(),N(n).open.value&&t.preventDefault())},onKeydown:i[1]||=su(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&N(n).onOpenToggle(),t.key===`ArrowDown`&&N(n).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),[GS,KS]=Dg(`HoverCardRoot`),qS=I({__name:`HoverCardRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},openDelay:{type:Number,required:!1,default:700},closeDelay:{type:Number,required:!1,default:300},enableTouch:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{openDelay:i,closeDelay:a,enableTouch:o}=Sn(n);N_();let s=d_(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),c=M(0),l=M(0),u=M(!1),d=M(!1),f=M(!1),p=M();function m(){clearTimeout(l.value),c.value=window.setTimeout(()=>s.value=!0,i.value)}function h(){clearTimeout(c.value),!u.value&&!d.value&&(l.value=window.setTimeout(()=>s.value=!1,a.value))}function g(){clearTimeout(c.value),s.value=!1}return KS({open:s,onOpenChange(e){s.value=e},onOpen:m,onClose:h,onDismiss:g,hasSelectionRef:u,isPointerDownOnContentRef:d,isPointerInTransitRef:f,triggerElement:p,enableTouch:o}),(e,t)=>(B(),H(N(Sy),null,{default:P(()=>[R(e.$slots,`default`,{open:N(s)})]),_:3}))}});function JS(e){return t=>t.pointerType===`touch`?void 0:e()}function YS(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var XS=I({__name:`HoverCardContentImpl`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(e,{emit:t}){let n=e,r=t,i=P_(n),{forwardRef:a,currentElement:o}=N_(),s=GS(),{isPointerInTransit:c,onPointerExit:l}=L_(s.triggerElement,o);t_(s.isPointerInTransitRef,c,{direction:`rtl`}),l(()=>{s.onClose()});let u=M(!1),d;Er(e=>{if(u.value){let t=document.body;d=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect=`none`,t.style.webkitUserSelect=`none`,e(()=>{t.style.userSelect=d,t.style.webkitUserSelect=d})}});function f(){u.value=!1,s.isPointerDownOnContentRef.value=!1,tr(()=>{document.getSelection()?.toString()!==``&&(s.hasSelectionRef.value=!0)})}return $i(()=>{o.value&&(document.addEventListener(`pointerup`,f),YS(o.value).forEach(e=>e.setAttribute(`tabindex`,`-1`))),o_(window,`scroll`,e=>{e.target?.contains(s.triggerElement.value)&&s.onDismiss()},{capture:!0})}),ra(()=>{document.removeEventListener(`pointerup`,f),s.hasSelectionRef.value=!1,s.isPointerDownOnContentRef.value=!1}),(e,t)=>(B(),H(N(Cv),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[1]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[2]||=e=>r(`pointerDownOutside`,e),onFocusOutside:t[3]||=au(e=>r(`focusOutside`,e),[`prevent`]),onDismiss:N(s).onDismiss},{default:P(()=>[W(N(Fx),q({...N(i),...e.$attrs},{ref:N(a),"data-state":N(s).open.value?`open`:`closed`,style:{userSelect:u.value?`text`:void 0,WebkitUserSelect:u.value?`text`:void 0,"--reka-hover-card-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-hover-card-content-available-width":`var(--reka-popper-available-width)`,"--reka-hover-card-content-available-height":`var(--reka-popper-available-height)`,"--reka-hover-card-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-hover-card-trigger-height":`var(--reka-popper-anchor-height)`},onPointerdown:t[0]||=e=>{e.currentTarget.contains(e.target)&&(u.value=!0),N(s).hasSelectionRef.value=!1,N(s).isPointerDownOnContentRef.value=!0}}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`,`style`])]),_:3},8,[`onDismiss`]))}}),ZS=I({__name:`HoverCardContent`,props:{forceMount:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(e,{emit:t}){let n=F_(e,t),{forwardRef:r}=N_(),i=GS();return(e,t)=>(B(),H(N(lv),{present:e.forceMount||N(i).open.value},{default:P(()=>[W(XS,q(N(n),{ref:N(r),onPointerenter:t[0]||=e=>N(JS)(N(i).onOpen)(e)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`]))}}),QS=I({__name:`HoverCardPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),H(N(ay),A(Cs(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),$S=I({__name:`HoverCardTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`a`}},setup(e){let{forwardRef:t,currentElement:n}=N_(),r=GS();r.triggerElement=n;function i(){setTimeout(()=>{!r.isPointerInTransitRef.value&&!r.open.value&&r.onClose()},0)}function a(e){r.enableTouch.value&&e.pointerType===`touch`&&(r.open.value?r.onDismiss():r.onOpenChange(!0))}return(e,n)=>(B(),H(N(Cy),{"as-child":``,reference:e.reference},{default:P(()=>[W(N(fv),{ref:N(t),"as-child":e.asChild,as:e.as,"data-state":N(r).open.value?`open`:`closed`,"data-grace-area-trigger":``,onPointerenter:n[0]||=e=>N(JS)(N(r).onOpen)(e),onPointerleave:n[1]||=e=>N(JS)(i)(e),onPointerup:a,onFocus:n[2]||=e=>N(r).onOpen(),onBlur:n[3]||=e=>N(r).onClose()},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`data-state`])]),_:3},8,[`reference`]))}}),[eC,tC]=Dg(`TabsRoot`),nC=I({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{orientation:i,unmountOnHide:a,dir:o}=Sn(n),s=D_(o);N_();let c=d_(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),l=M(),u=pn(new Set);return tC({modelValue:c,changeModelValue:e=>{c.value=e},orientation:i,dir:s,unmountOnHide:a,activationMode:n.activationMode,baseId:tv(void 0,`reka-tabs`),tabsList:l,contentIds:u,registerContent:e=>{u.value=new Set([...u.value,e])},unregisterContent:e=>{let t=new Set(u.value);t.delete(e),u.value=t}}),(e,t)=>(B(),H(N(fv),{dir:N(s),"data-orientation":N(i),"as-child":e.asChild,as:e.as},{default:P(()=>[R(e.$slots,`default`,{modelValue:N(c)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function rC(e,t){return`${e}-trigger-${t}`}function iC(e,t){return`${e}-content-${t}`}var aC=I({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=Sn(e),{forwardRef:n,currentElement:r}=N_(),i=eC();return i.tabsList=r,(e,r)=>(B(),H(N(Rx),{"as-child":``,orientation:N(i).orientation.value,dir:N(i).dir.value,loop:N(t)},{default:P(()=>[W(N(fv),{ref:N(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":N(i).orientation.value},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),oC=I({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=N_(),r=eC(),i=J(()=>rC(r.baseId,t.value)),a=J(()=>r.contentIds.value.has(t.value)?iC(r.baseId,t.value):void 0),o=J(()=>t.value===r.modelValue.value);return(e,t)=>(B(),H(N(zx),{"as-child":``,focusable:!e.disabled,active:o.value},{default:P(()=>[W(N(fv),{id:i.value,ref:N(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":N(r).orientation.value,onMousedown:t[0]||=au(t=>{!e.disabled&&t.ctrlKey===!1?N(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=su(t=>N(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=N(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&N(r).changeModelValue(e.value)}},{default:P(()=>[R(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),sC=I({__name:`Button`,props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;return(n,r)=>(B(),H(N(fv),{"data-slot":`button`,"data-variant":e.variant,"data-size":e.size,as:e.as,"as-child":e.asChild,class:k(N(gg)(N(cC)({variant:e.variant,size:e.size}),t.class))},{default:P(()=>[R(n.$slots,`default`)]),_:3},8,[`data-variant`,`data-size`,`as`,`as-child`,`class`]))}}),cC=Um(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}}),lC=I({__name:`DropdownMenu`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},dir:{},modal:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=F_(e,t);return(e,t)=>(B(),H(N(MS),q({"data-slot":`dropdown-menu`},N(n)),{default:P(t=>[R(e.$slots,`default`,A(Cs(t)))]),_:3},16))}}),uC={class:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`},dC=I({__name:`DropdownMenuCheckboxItem`,props:{modelValue:{type:[Boolean,String]},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`select`,`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(e,t)=>(B(),H(N(kS),q({"data-slot":`dropdown-menu-checkbox-item`},N(i),{class:N(gg)(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n.class)}),{default:P(()=>[U(`span`,uC,[W(N(FS),null,{default:P(()=>[R(e.$slots,`indicator-icon`,{},()=>[W(N(qu),{class:`size-4`})])]),_:3})]),R(e.$slots,`default`)]),_:3},16,[`class`]))}}),fC=I({inheritAttrs:!1,__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(e,t)=>(B(),H(N(LS),null,{default:P(()=>[W(N(NS),q({"data-slot":`dropdown-menu-content`},{...e.$attrs,...N(i)},{class:N(gg)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--reka-dropdown-menu-content-available-height) min-w-[8rem] origin-(--reka-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,n.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),pC=I({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean},variant:{default:`default`}},setup(e){let t=e,n=P_(Sf(t,`inset`,`variant`,`class`));return(r,i)=>(B(),H(N(PS),q({"data-slot":`dropdown-menu-item`,"data-inset":e.inset?``:void 0,"data-variant":e.variant},N(n),{class:N(gg)(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,t.class)}),{default:P(()=>[R(r.$slots,`default`)]),_:3},16,[`data-inset`,`data-variant`,`class`]))}}),mC=I({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean}},setup(e){let t=e,n=P_(Sf(t,`class`,`inset`));return(r,i)=>(B(),H(N(IS),q({"data-slot":`dropdown-menu-label`,"data-inset":e.inset?``:void 0},N(n),{class:N(gg)(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,t.class)}),{default:P(()=>[R(r.$slots,`default`)]),_:3},16,[`data-inset`,`class`]))}}),hC=I({__name:`DropdownMenuRadioGroup`,props:{modelValue:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=F_(e,t);return(e,t)=>(B(),H(N(RS),q({"data-slot":`dropdown-menu-radio-group`},N(n)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),gC={class:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`},_C=I({__name:`DropdownMenuRadioItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(e,t)=>(B(),H(N(zS),q({"data-slot":`dropdown-menu-radio-item`},N(i),{class:N(gg)(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n.class)}),{default:P(()=>[U(`span`,gC,[W(N(FS),null,{default:P(()=>[R(e.$slots,`indicator-icon`,{},()=>[W(N(nd),{class:`size-2 fill-current`})])]),_:3})]),R(e.$slots,`default`)]),_:3},16,[`class`]))}}),vC=I({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Sf(t,`class`);return(e,r)=>(B(),H(N(BS),q({"data-slot":`dropdown-menu-separator`},N(n),{class:N(gg)(`bg-border -mx-1 my-1 h-px`,t.class)}),null,16,[`class`]))}}),yC=I({__name:`DropdownMenuSub`,props:{defaultOpen:{type:Boolean},open:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=F_(e,t);return(e,t)=>(B(),H(N(VS),q({"data-slot":`dropdown-menu-sub`},N(n)),{default:P(t=>[R(e.$slots,`default`,A(Cs(t)))]),_:3},16))}}),bC=I({__name:`DropdownMenuSubContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},memoDependencies:{},sideOffset:{},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(e,t)=>(B(),H(N(HS),q({"data-slot":`dropdown-menu-sub-content`},N(i),{class:N(gg)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] max-w-(--reka-dropdown-menu-content-available-width) origin-(--reka-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg`,n.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`]))}}),xC=I({__name:`DropdownMenuSubTrigger`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean}},setup(e){let t=e,n=P_(Sf(t,`class`,`inset`));return(r,i)=>(B(),H(N(US),q({"data-slot":`dropdown-menu-sub-trigger`},N(n),{"data-inset":e.inset?``:void 0,class:N(gg)(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,t.class)}),{default:P(()=>[R(r.$slots,`default`),W(N(Xu),{class:`ml-auto size-4`})]),_:3},16,[`data-inset`,`class`]))}}),SC=I({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=P_(e);return(e,n)=>(B(),H(N(WS),q({"data-slot":`dropdown-menu-trigger`},N(t)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),CC=(e,t)=>`${e}/${t}`,wC=(e,t)=>`${e}/${t}`,TC=e=>`session:${e}`,EC=(e,t)=>`file:${e}/${t}`,DC=e=>e;function OC(e){let t=/^([a-z0-9]+(?:-[a-z0-9]+)*):(.+)$/.exec(e);return!t||t[1]===`file`||t[1]===`session`?null:{hub:t[1],local:t[2]}}function kC(e){let t=OC(e);if(!t)return null;let n=`https://${t.hub}.mainflow.localhost`,[r=``]=t.local.split(`#`),[i=``,a]=r.split(`/`);return/^i\d{3}$/.test(i)?`${n}/issues?peek=${i}`:/^f\d{3}$/.test(i)?`${n}/findings?peek=${i}`:/^w\d{3}$/.test(i)?`${n}/mainlines?peek=${i}`:a?.startsWith(`t`)?`${n}/mainlines/${i}/tasks/${a}`:a?.startsWith(`d`)?`${n}/mainlines/${i}/decisions/${a}`:`${n}/mainlines/${i}`}function AC(e){if(!e)return null;let t;return(t=/^(m\d{3})$/.exec(e))?{kind:`mainline`,ref:e,m:t[1]}:(t=/^(m\d{3})\/(t\d{3})$/.exec(e))?{kind:`task`,ref:e,m:t[1],t:t[2]}:(t=/^(m\d{3})\/(d\d{3})$/.exec(e))?{kind:`decision`,ref:e,m:t[1],d:t[2]}:/^i\d{3}$/.test(e)?{kind:`issue`,ref:e,id:e}:/^f\d{3}$/.test(e)?{kind:`finding`,ref:e,id:e}:/^w\d{3}$/.test(e)?{kind:`group`,ref:e,id:e}:e.startsWith(`session:`)?{kind:`session`,ref:e,id:e.slice(8)}:(t=/^file:(m\d{3})\/(.+)$/.exec(e))?{kind:`file`,ref:e,m:t[1],path:t[2]}:/^local\/sync\/conflicts\/[^/:]+$/.test(e)?{kind:`conflict`,ref:e,saved:e}:null}var jC=M(``),MC;function NC(e){jC.value=e,clearTimeout(MC),MC=setTimeout(()=>jC.value=``,1200)}var PC=e=>(Array.isArray(e)?e[0]:e)??void 0;function FC(){let e=tp(),t=ep(),n=J(()=>AC(PC(e.query.peek)??void 0)),r=J(()=>(PC(e.query.trail)??``).split(`,`).filter(Boolean)),i=J(()=>PC(e.query.full)===`1`);function a(t,i={}){let a=i.chain&&n.value?[...r.value,n.value.ref]:[],o={...e.query,peek:t};return delete o.full,a.length?o.trail=a.join(`,`):delete o.trail,{path:e.path,query:o}}function o(e,n={}){let r=kC(e);return r?void window.open(r,`_blank`,`noopener`):t.push(a(e,n))}function s(){let n=r.value.at(-1);if(n){if(window.history.state?.back)t.back();else{let i={...e.query,peek:n},a=r.value.slice(0,-1);a.length?i.trail=a.join(`,`):delete i.trail,t.replace({path:e.path,query:i})}}}function c(){let n={...e.query};delete n.peek,delete n.trail,delete n.full,t.push({path:e.path,query:n})}function l(){let n={...e.query};i.value?delete n.full:n.full=`1`,t.replace({path:e.path,query:n})}return{current:n,trail:r,full:i,to:a,open:o,back:s,close:c,toggleFull:l}}var IC={conflict:`改動被拒`,"edit-rejected":`Edit 無法重做`,"merge-lost":`合併少了內容`,"deletion-undone":`刪除被還原`,"removal-kept":`刪檔被保留`,"removed-unsynced":`伺服器已刪,這裡跟著刪`,"skipped-binary":`非文字檔不同步`,"skipped-large":`檔案太大不同步`,refused:`佇列寫入被拒`,uncertain:`可能重複套用`,"stale-id":`引用的編號已被改號`,"upload-needed":`等別的環境上傳`,"upload-refused":`整份上傳被拒`},LC={conflict:`{F}的改動被同步伺服器拒絕{K}。讀最新的檔,對照存檔重做。`,"edit-rejected":`{F}的 Edit 無法在最新版本上重做{K}。讀最新的檔,重新 Edit。`,"merge-lost":`{F}合併後少了這裡寫的行。讀最新的檔,補回少的部分。`,"deletion-undone":`{F}在這裡刪掉的行仍在合併結果裡。改用 mainflow 指令或 Edit 刪除。`,"removal-kept":`{F}在刪除前被別人改過,所以保留下來。確定要刪時再刪一次。`,"removed-unsynced":`{F}在這台機器從沒同步過,同步伺服器上已經沒有它,所以這裡也刪掉了{K}。要留下時,用存檔的內容重新建立。`,"skipped-binary":`{F}不是 UTF-8 文字檔,所以不同步,其他環境看不到它。`,"skipped-large":`{F}超過同步伺服器的單檔上限 1,900,000 bytes,所以不同步,這裡的檔也不會被覆寫,其他環境看不到它。要讓其他環境看到時拆成較小的檔,不需要時加進 .mainflow/.gitignore。`,refused:`同步伺服器拒絕了寄件佇列裡{F}的改動{K}。照原文說明處理。`,uncertain:`{F}重送時已超過同步伺服器保留回覆的期間,伺服器分不出先前有沒有套用,所以當成新的寫入再送一次,可能重複。檢查結果有沒有重複。`,"stale-id":`{F}在同步伺服器改號前就已送出,伺服器照原樣保留了{R}。{R}現在指向別的環境新增的項目,這裡新增的項目改成{N}。要指這裡新增的項目時,把引用改成{N}。`,"upload-needed":`同步伺服器上沒有這個 hub。這個環境開啟按需下載,副本可能缺檔,所以不上傳,等別的環境上傳後才同步。在保留全部檔案、關閉按需下載的環境啟動同步程式,上傳 hub。`,"upload-refused":`同步伺服器上沒有這個 hub,又拒絕了這個環境的整份上傳,所以這裡沒有收進、刪除或送出任何檔。照原文說明處理,例如把太大的檔拆小或加進 .mainflow/.gitignore,下次連線會再上傳。`},RC=`{F}:同步程式回報了一則提醒,原文見細節。`;function zC(e,t=!0){let n=(t,n)=>e.renumbered?.length?` ${e.renumbered.map(e=>e[t]).join(`、`)} `:n,r=(LC[e.kind]??RC).replace(`{K}`,e.saved?`,這裡寫的內容已存檔`:``).replaceAll(`{R}`,n(`from`,`當時的暫定編號`)).replaceAll(`{N}`,n(`to`,`新的編號`)),i=e.path?t?` ${e.path} `:`這個檔`:`一筆寫入`;return r.replace(`{F}`,i).replace(/^ /,``).replace(/ (?=[,。:、])/g,``).replace(/。 /g,`。`)}var BC=`x-mainflow-write`;function VC(e){if(!e)return null;try{let t=JSON.parse(decodeURIComponent(e));return{queued:t.queued===!0,...typeof t.stopped==`string`?{stopped:t.stopped}:{},...typeof t.restarted==`string`?{restarted:t.restarted}:{},notices:Array.isArray(t.notices)?t.notices:[]}}catch{return null}}function HC(e){let t=[];return e.stopped?t.push(`已寫在這台電腦並排入同步佇列,但同步程式沒有在跑,啟動後才會送出。`):e.queued&&t.push(`已寫在這台電腦並排入同步佇列,尚未經同步伺服器確認。伺服器拒絕時會出現在同步提醒。`),e.restarted&&t.push(`原本的同步程式已停止,已重新啟動。`),e.notices.length&&t.push(`這次寫入另有 ${e.notices.length} 則提醒,涉及 ${[...new Set(e.notices.map(e=>e.path))].join(`、`)}。`),t.length?{text:t.join(``),detail:[...e.restarted?[e.restarted]:[],...e.stopped?[e.stopped]:[],...e.notices.map(e=>e.message)].join(`
|
|
7
|
-
`)}:null}var UC=class extends Error{status;constructor(e,t){super(e),this.status=t}},WC=/^\/h\/[a-z0-9-]+\//.exec(globalThis.location?.pathname??``)?.[0]??`/`,GC=e=>`${WC}${e.slice(1)}`,KC=null,qC=e=>void(KC=e);async function JC(e,t,n=!0){let r=await fetch(n?GC(e):e,t),i=VC(r.headers.get(BC));i&&KC?.(i);let a=await r.json().catch(()=>({}));if(!r.ok)throw new UC(a.error??r.statusText,r.status);return a}var YC=(e,t)=>JC(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),XC={hub:()=>JC(`/api/hub`),mainline:e=>JC(`/api/mainlines/${e}`),fetchRemote:(e,t)=>YC(`/api/mainlines/${e}/fetch`,{path:t}),mainlines:e=>JC(`/api/mainlines?ids=${e.map(encodeURIComponent).join(`,`)}`),sessions:()=>JC(`/api/sessions`),host:()=>JC(`/api/host`),archiveIssue:(e,t,n)=>YC(`/api/issues/${e}/archive`,{archived:t,version:n}),archiveFinding:(e,t,n)=>YC(`/api/findings/${e}/archive`,{archived:t,version:n}),archiveSession:(e,t)=>YC(`/api/sessions/${e}/archive`,{archived:t}),archiveMany:(e,t,n)=>YC(`/api/archive`,{kind:e,ids:t,archived:n}),trace:e=>JC(`/api/sessions/${e}/trace`),issues:()=>JC(`/api/issues`),findings:()=>JC(`/api/findings`),ops:()=>JC(`/api/ops`),relations:()=>JC(`/api/relations`),reveal:e=>YC(`/api/reveal`,{path:e}),archive:(e,t,n)=>YC(`/api/mainlines/${e}/archive`,{archived:t,version:n}),mainlineTitle:(e,t,n)=>YC(`/api/mainlines/${e}/title`,{title:t,version:n}),mainlineStatus:(e,t,n)=>YC(`/api/mainlines/${e}/status`,{status:t,version:n}),taskStatus:(e,t,n,r)=>YC(`/api/tasks/${e}/${t}/status`,{status:n,version:r}),check:(e,t,n,r)=>YC(`/api/check`,{ref:e,done:t,evidence:n,version:r}),sync:()=>JC(`/api/sync`),conflict:e=>JC(`/api/sync/conflicts/${encodeURIComponent(e.split(`/`).at(-1))}`),hubs:()=>JC(`/api/hubs`,void 0,!1)},ZC=e=>GC(`/api/files/${e.split(`/`).map(encodeURIComponent).join(`/`)}`);function QC(e){let[t=``,n=``]=e.split(`#`),[r=``,i=``]=t.split(`/`);return{m:r,t:i,item:n}}function $C(e,t){try{let n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}}function ew(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}var Q=Qt({summary:null,mainlines:{},sessions:[],issues:[],findings:[],ops:[],relations:{hubs:[],targets:{},backlinks:{},groupMembers:{},deps:[],mainlineDeps:[],cycles:[]},sync:{remote:!1,running:!1,notices:[]},hubs:[],error:``,problems:[],sessionProblems:[],hostError:``,stale:null,note:null,paletteOpen:!1}),tw=new Set([`active`,`planning`,`paused`]);function nw(){return rw?(iw=!0,rw):(rw=(async()=>{try{do iw=!1,await aw();while(iw)}finally{rw=null}})(),rw)}var rw=null,iw=!1;async function aw(){try{await ow(),Q.stale=null,Sw()}catch(e){Q.stale=e.message||`無法連到伺服器`}}async function ow(){let e=Object.keys(Q.mainlines),t=XC.hub();t.then(e=>uw(e.mainlines.filter(e=>!e.archivedAt&&tw.has(e.status)).map(e=>e.id))).catch(()=>void 0);let n=XC.host().catch(()=>({})),[r,{sessions:i,problems:a},o,s,c,l]=await Promise.all([t,XC.sessions(),XC.issues(),XC.findings(),XC.ops(),XC.relations()]);Q.summary=r,Q.problems=r.problems,Q.sessionProblems=a??[],Q.hostError=(await n).hostError??``,Q.relations=l,Q.sessions=i,Q.issues=o,Q.findings=s,Q.ops=c;for(let e of Object.keys(Q.mainlines))r.mainlines.some(t=>t.id===e)||delete Q.mainlines[e];let u=e.filter(e=>Q.mainlines[e]);if(u.length)for(let e of await XC.mainlines(u))Q.mainlines[e.id]=e}async function sw(){try{let{sessions:e,problems:t}=await XC.sessions();Q.sessions=e,Q.sessionProblems=t??[]}catch(e){Q.stale=e.message||`無法連到伺服器`}}var cw=new Map;function lw(e){if(Q.mainlines[e])return Promise.resolve();let t=cw.get(e);return t||(t=XC.mainline(e).then(t=>void(Q.mainlines[e]=t)).finally(()=>cw.delete(e)),cw.set(e,t)),t}async function uw(e,t=[]){let n=async e=>{let t=[...new Set(e)].filter(e=>!Q.mainlines[e]&&!cw.has(e)),n=[...new Set(e)].filter(e=>cw.has(e)).map(e=>cw.get(e));if(t.length){let e=XC.mainlines(t).then(e=>{for(let t of e)Q.mainlines[t.id]=t});for(let n of t){let t=e.finally(()=>cw.delete(n));t.catch(()=>void 0),cw.set(n,t)}n.push(e)}await Promise.all(n)};try{await n(e),await n(t)}catch(e){Q.error=e.message}}qC(e=>Q.note=HC(e));async function dw(e){Q.note=null;try{return await e(),Q.error=``,!0}catch(e){return Q.error=e.message,!1}finally{await nw()}}var fw=`mainflow.syncSeen:${WC}`,pw=M(String($C(fw,``))),mw=e=>e.at<=pw.value,hw=()=>Q.sync.notices.filter(e=>!mw(e)).length;function gw(){let e=Q.sync.notices[0]?.at;!e||e<=pw.value||(pw.value=e,ew(fw,e))}async function _w(){try{Q.sync=await XC.sync()}catch{Q.sync={remote:!1,running:!1,notices:[]}}}function vw(e){Q.error=e.message}function yw(e){console.error(e),Q.error=e instanceof Error?e.message:String(e)}function bw(){let e=new EventSource(GC(`/api/events`)),t;e.addEventListener(`change`,()=>{clearTimeout(t),t=setTimeout(()=>void Promise.all([nw(),_w()]).catch(vw),150)}),e.addEventListener(`notice`,()=>void _w()),e.addEventListener(`error`,()=>void(Q.stale??=`與伺服器的連線中斷`));let n=-1/0,r=()=>{let e=Date.now();e-n<2e3||(n=e,nw())};e.addEventListener(`open`,()=>Q.stale!==null&&r()),document.addEventListener(`visibilitychange`,()=>document.visibilityState!==`hidden`&&r()),window.addEventListener(`focus`,r);let i;e.addEventListener(`session`,()=>{clearTimeout(i),i=setTimeout(()=>void sw().catch(vw),150)})}var xw=null;function Sw(){return Q.hubs.length>0?Promise.resolve():xw??=Cw().finally(()=>xw=null)}async function Cw(){try{let{hubs:e}=await XC.hubs();Q.hubs=e.map(e=>({...e,current:e.base===WC}))}catch{return}if(Q.hubs.length<2)return;let e=new EventSource(`/api/hubs/events`),t=e=>t=>{let{hub:n}=JSON.parse(t.data),r=Q.hubs.find(e=>e.name===n);r&&!r.current&&r.activity!==`notice`&&(r.activity=e)};e.addEventListener(`change`,t(`change`)),e.addEventListener(`session`,t(`change`)),e.addEventListener(`notice`,t(`notice`)),e.addEventListener(`error`,()=>{e.readyState===EventSource.CLOSED&&(e.close(),Q.hubs=[])})}var ww=(e,t)=>e.serves.some(e=>e.startsWith(`${t}/`)||e.startsWith(`${t}#`)),Tw=(e,t,n)=>e.serves.some(e=>e.startsWith(`${t}/${n}#`)),Ew=e=>e.actions.find(e=>e.status===`doing`)??e.actions.find(e=>e.status===`todo`);function Dw(e){return e.title??e.description??Ew(e)?.do??e.actions.at(-1)?.do??e.id.slice(-8)}var Ow=e=>(Ew(e)??e.actions.at(-1))?.serves[0]?.match(/^m\d{3}/)?.[0],kw=()=>Q.sessions.filter(e=>!e.archivedAt&&!e.delegatedFrom),Aw=()=>kw().filter(e=>e.status===`active`||e.status===`paused`);function jw(e,t){return Q.sessions.map(n=>({session:n,actions:n.actions.filter(n=>t?Tw(n,e,t):ww(n,e))})).filter(e=>e.actions.length>0)}function Mw(e){if(OC(e))return Nw(e);let t=e.split(`#`)[0],[n=``,r]=t.split(`/`),i=Q.mainlines[n],a=Q.summary?.mainlines.find(e=>e.id===n);if(r?.startsWith(`t`)){let e=i?.tasks.find(e=>e.id===r);return{id:t,title:e?.title,status:e?.status,context:a?.title}}if(r?.startsWith(`d`)){let e=i?.decisions.find(e=>e.id===r);return{id:t,title:e?.title,status:e?.status,context:a?.title}}if(/^m\d{3}$/.test(t))return{id:t,title:a?.title,status:a?.status};let o=Q.issues.find(e=>e.id===t);if(o)return{id:t,title:o.title,status:o.status};let s=Q.findings.find(e=>e.id===t);if(s)return{id:t,title:s.title,status:s.status};let c=Q.summary?.groups.find(e=>e.id===t);return c?{id:t,title:c.title,status:c.status}:{id:t}}function Nw(e){let t=OC(e),n=Q.relations.targets[e];if(n)return{id:e,title:n.title,status:n.status,context:`${t.hub} hub`};let r=Q.relations.hubs.find(e=>e.name===t.hub),i=r?r.available?`對方 hub 找不到這個項目`:`這台機器上沒有這個 hub`:`沒有登記這個 hub`;return{id:e,context:`${t.hub} hub:${i}`}}function Pw(e){for(let t of new Set(e.flatMap(e=>e&&/^m\d{3}\//.test(e)?[e.slice(0,4)]:[])))Q.summary?.mainlines.some(e=>e.id===t)&&lw(t).catch(e=>Q.error=e.message)}var Fw={mainline:{label:`主脈絡`,icon:lf},phase:{label:`階段任務`,icon:tf},branch:{label:`分支任務`,icon:$d},decision:{label:`決策`,icon:Yd},issue:{label:`待辦事項`,icon:Id},finding:{label:`發現`,icon:Md},group:{label:`組`,icon:Hu},session:{label:`會話`,icon:Vu},criterion:{label:`解決條件`,icon:af},item:{label:`checklist 項目`,icon:Pd},doc:{label:`文件`,icon:gd},artifact:{label:`產物`,icon:Ad},image:{label:`圖片`,icon:hd},page:{label:`HTML 頁面`,icon:fd},view:{label:`自訂視圖`,icon:jd},link:{label:`外部連結`,icon:Nd}},Iw=e=>e?.kind===`branch`?`branch`:`phase`;function Lw(e){let t=OC(e);return t?AC(t.local)?.kind===`task`&&!t.local.includes(`#`)?`phase`:Rw(t.local):Rw(e)}function Rw(e){if(/#c\d{3}$/.test(e))return`item`;if(/#r\d{3}$/.test(e))return`criterion`;let t=AC(e);if(t)return t.kind===`task`?Iw(Q.mainlines[t.m]?.tasks.find(e=>e.id===t.t)):t.kind===`file`?zw(t.path):t.kind===`conflict`?zw(t.saved):t.kind}function zw(e,t){if(t===`參考來源`)return/^https?:/.test(e)?`link`:`doc`;if(t===`自訂視圖`)return`view`;if(t===`決策`)return`decision`;let n=e.slice(e.lastIndexOf(`.`)+1).toLowerCase();return[`png`,`jpg`,`jpeg`,`gif`,`svg`,`webp`].includes(n)?`image`:n===`html`?`page`:t===`產物`&&n!==`md`?`artifact`:`doc`}var Bw=[`active`,`planning`,`paused`,`done`,`dropped`],Vw=[`todo`,`doing`,`blocked`,`done`,`dropped`],Hw={planning:`todo`,todo:`todo`,open:`todo`,active:`doing`,doing:`doing`,planned:`doing`,paused:`waiting`,blocked:`waiting`,proposed:`waiting`,done:`done`,accepted:`done`,closed:`done`,valid:`done`,ended:`done`,dropped:`off`,superseded:`off`,obsolete:`off`,"handed-off":`off`},Uw=e=>Hw[e]??`todo`,Ww=new Set([`done`,`dropped`,`closed`,`obsolete`,`superseded`,`ended`,`handed-off`]),Gw={active:`進行中`,planning:`規劃中`,paused:`暫停`,done:`完成`,dropped:`放棄`,todo:`待辦`,doing:`進行中`,blocked:`卡住`,proposed:`待裁決`,accepted:`採用`,superseded:`已取代`,ended:`已結束`,"handed-off":`已交接`,open:`未處理`,planned:`已排入`,closed:`已關閉`,valid:`有效`,obsolete:`過時`},Kw={skill:`skill`,agent:`agent`,rule:`rule`,instruction:`instruction`,file:`檔案`,hook:`hook`},qw={user:`使用者`,ai:`AI`,relay:`第三方轉達`},Jw={explicit:`明確選擇`,recommended:`照建議預設`},Yw={open:`未合併`,merged:`已合併`,abandoned:`已放棄`},Xw={pending:{label:`未完成`,tone:`text-warning`},met:{label:`已完成`,tone:`text-muted-foreground`},dropped:{label:`已放棄`,tone:`text-muted-foreground`},unknown:{label:`無法確認`,tone:`text-muted-foreground`}},Zw=[`title`,`aria-label`],Qw=I({__name:`TypeIcon`,props:{type:{},status:{}},setup(e){let t=e,n={todo:`text-status-todo`,doing:`text-status-doing`,waiting:`text-status-waiting`,done:`text-status-done`,off:`text-status-off`},r=J(()=>t.type?Fw[t.type]:void 0),i=J(()=>[r.value?.label,t.status?Gw[t.status]??t.status:``].filter(Boolean).join(`・`));return(t,a)=>r.value?(B(),V(`span`,{key:0,class:`inline-flex shrink-0`,title:i.value,role:`img`,"aria-label":i.value},[(B(),H(fa(r.value.icon),{class:k([`size-3.5`,e.status?n[N(Uw)(e.status)]:`text-muted-foreground`])},null,8,[`class`]))],8,Zw)):K(``,!0)}}),$w={class:`palette`,role:`dialog`,"aria-label":`指令面板`},eT=[`onMouseenter`,`onClick`],tT={class:`label`},nT={class:`hint`},rT={key:0,class:`none`},iT=I({__name:`CommandPalette`,setup(e){let t=ep(),n=M(``),r=M(0),i=M(null),a=J(()=>[{label:`總覽`,hint:`頁面`,to:`/`},{label:`主脈絡`,hint:`頁面`,to:`/mainlines`},{label:`會話`,hint:`頁面`,to:`/sessions`},...(Q.summary?.mainlines??[]).map(e=>({label:`${e.id} ${e.title}`,hint:e.archivedAt?`主脈絡 · 已封存`:`主脈絡`,to:`/mainlines/${e.id}`,type:`mainline`,status:e.status})),...Object.values(Q.mainlines).flatMap(e=>e.tasks.map(t=>({label:`${e.id}/${t.id} ${t.title}`,hint:`任務`,to:`/mainlines/${e.id}/tasks/${t.id}`,type:Iw(t),status:t.status}))),...Q.sessions.map(e=>({label:`${Dw(e)} ${e.id.slice(-8)}`,hint:`會話`,to:`/sessions/${e.id}`,type:`session`,status:e.status}))]),o=J(()=>{let e=n.value.trim().toLowerCase();return(e?a.value.filter(t=>t.label.toLowerCase().includes(e)):a.value).slice(0,12)});F(n,()=>r.value=0),F(()=>Q.paletteOpen,e=>{e&&(n.value=``,tr(()=>i.value?.focus()))});function s(e){(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),Q.paletteOpen=!Q.paletteOpen)}function c(e){e&&(Q.paletteOpen=!1,t.push(e.to))}function l(e){let t=o.value.length;t>0&&(r.value=(r.value+e+t)%t)}return $i(()=>window.addEventListener(`keydown`,s)),na(()=>window.removeEventListener(`keydown`,s)),(e,t)=>N(Q).paletteOpen?(B(),V(`div`,{key:0,class:`overlay`,onClick:t[5]||=au(e=>N(Q).paletteOpen=!1,[`self`])},[U(`div`,$w,[yr(U(`input`,{ref_key:`input`,ref:i,"onUpdate:modelValue":t[0]||=e=>n.value=e,class:`search`,placeholder:`搜尋主脈絡、任務、會話…`,onKeydown:[t[1]||=su(au(e=>l(1),[`prevent`]),[`down`]),t[2]||=su(au(e=>l(-1),[`prevent`]),[`up`]),t[3]||=su(au(e=>c(o.value[r.value]),[`prevent`]),[`enter`]),t[4]||=su(e=>N(Q).paletteOpen=!1,[`esc`])]},null,544),[[Wl,n.value]]),U(`ul`,null,[(B(!0),V(z,null,L(o.value,(e,t)=>(B(),V(`li`,{key:e.to,class:k({active:t===r.value}),onMouseenter:e=>r.value=t,onClick:t=>c(e)},[U(`span`,tT,[W(Qw,{type:e.type,status:e.status},null,8,[`type`,`status`]),G(j(e.label),1)]),U(`span`,nT,j(e.hint),1)],42,eT))),128)),o.value.length===0?(B(),V(`li`,rT,`沒有符合的項目`)):K(``,!0)])])])):K(``,!0)}}),aT=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},oT=aT(iT,[[`__scopeId`,`data-v-8755e91b`]]),sT={key:0,class:`mx-auto max-w-xl px-6 py-16 text-center`,role:`alert`,"data-error-boundary":``},cT={class:`mt-1 text-sm text-muted-foreground`,"data-error-message":``},lT=I({__name:`ErrorBoundary`,props:{resetKey:{}},setup(e){let t=e,n=M(null);return sa(e=>(console.error(e),n.value=e instanceof Error?e:Error(String(e)),!1)),F(()=>t.resetKey,()=>n.value=null),(e,t)=>n.value?(B(),V(`div`,sT,[W(N(Qu),{class:`mx-auto mb-3 size-6 text-destructive`}),t[2]||=U(`p`,{class:`font-medium`},`這個頁面顯示時出錯了`,-1),U(`p`,cT,j(n.value.message),1),W(N(sC),{variant:`outline`,size:`sm`,class:`mt-4`,"data-retry":``,onClick:t[0]||=e=>n.value=null},{default:P(()=>[...t[1]||=[G(`重試`,-1)]]),_:1})])):R(e.$slots,`default`,{},void 0,void 0,1)}}),uT={key:0,class:`banner`,role:`alert`,"data-stale":``},dT={class:`flex-1`},fT={class:`cursor-pointer`},pT={class:`mt-2 space-y-1`},mT={class:`break-all`},hT={class:`text-muted-foreground`},gT={key:0,class:`text-muted-foreground`},_T=50,vT=aT(I({__name:`HubStatus`,setup(e){let t=J(()=>[...Q.problems,...Q.sessionProblems]),n=J(()=>new Set(t.value.map(e=>e.file)).size),r=J(()=>t.value.slice(0,_T));return(e,i)=>(B(),V(z,null,[N(Q).stale===null?K(``,!0):(B(),V(`p`,uT,[W(N(Qu),{class:`size-4 shrink-0 text-warning`}),U(`span`,dT,`資料可能過時:`+j(N(Q).stale),1),W(N(sC),{variant:`outline`,size:`xs`,"data-reload":``,onClick:i[0]||=e=>N(nw)()},{default:P(()=>[W(N(Kd),{class:`size-3`}),i[1]||=G(`重新載入`,-1)]),_:1})])),N(Q).hostError?(B(),H(N(_g),{key:1,variant:`warning`,class:`status-alert`,role:`alert`,"data-host-error":``},{default:P(()=>[W(N(Qd)),W(N(yg),null,{default:P(()=>[...i[2]||=[G(`主機名稱不可用`,-1)]]),_:1}),W(N(vg),null,{default:P(()=>[G(j(N(Q).hostError),1)]),_:1})]),_:1})):K(``,!0),t.value.length?(B(),H(N(_g),{key:2,variant:`warning`,class:`status-alert`,role:`alert`,"data-problems":``},{default:P(()=>[W(N(md)),W(N(yg),null,{default:P(()=>[G(`有 `+j(n.value)+` 個檔案讀不到或有問題`,1)]),_:1}),W(N(vg),null,{default:P(()=>[U(`details`,null,[U(`summary`,fT,`共 `+j(t.value.length)+` 筆,讀不到的檔案不在列表裡`,1),U(`ul`,pT,[(B(!0),V(z,null,L(r.value,(e,t)=>(B(),V(`li`,{key:t,"data-problem":``},[U(`code`,mT,j(e.file),1),U(`span`,hT,`:`+j(e.field?`${e.field},`:``)+j(e.message),1)]))),128)),t.value.length>r.value.length?(B(),V(`li`,gT,`還有 `+j(t.value.length-r.value.length)+` 筆`,1)):K(``,!0)])])]),_:1})]),_:1})):K(``,!0)],64))}}),[[`__scopeId`,`data-v-ee1ac6ae`]]);async function yT(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}}var bT=`[data-peek-list] [data-peek]`,xT=`is-cursor`;function ST(e){let t=e;return!!t&&(t.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(t.tagName))}function CT(e){let t=AC(e);return t?t.kind===`session`?t.id:t.kind===`file`?t.path:t.ref:e}function wT(){let{current:e,open:t,close:n}=FC(),r=()=>[...document.querySelectorAll(bT)].filter(e=>e.offsetParent!==null);function i(n){let i=r();if(!i.length)return;let a=i.findIndex(t=>t.classList.contains(xT)||t.dataset.peek===e.value?.ref),o=i[Math.min(i.length-1,Math.max(0,a+n))];for(let e of i)e.classList.toggle(xT,e===o);o.scrollIntoView({block:`nearest`}),e.value&&t(o.dataset.peek)}async function a(e,t){NC(await yT(e)?`已複製${t}`:`無法複製${t}`)}function o(r){if(Q.paletteOpen||ST(r.target))return;let o=r.metaKey||r.ctrlKey,s=()=>document.querySelector(`${bT}.${xT}`)?.dataset.peek;if(o&&!r.shiftKey&&r.key===`.`){let t=e.value?.ref??s();t&&(r.preventDefault(),a(CT(t),` ID`));return}if(o&&r.shiftKey&&(r.key===`,`||r.key===`<`)){r.preventDefault(),a(window.location.href,`連結`);return}if(!(o||r.altKey)){if(r.key===`j`||r.key===`k`)r.preventDefault(),i(r.key===`j`?1:-1);else if(r.key===`Enter`){let e=s();e&&(r.preventDefault(),t(e))}else r.key===`Escape`&&e.value&&n()}}$i(()=>window.addEventListener(`keydown`,o)),na(()=>window.removeEventListener(`keydown`,o))}var TT={class:`brand`},ET={class:`truncate`},DT={key:0,class:`size-1.5 shrink-0 rounded-full bg-status-done`,title:`其他 hub 有新變動`},OT={class:`flex min-w-0 flex-1 flex-col`},kT={key:0,class:`truncate text-xs text-muted-foreground`},AT={key:1,class:`text-xs text-muted-foreground`},jT={key:0,class:`text-xs text-warning`},MT={key:1,class:`text-xs text-status-done`},NT={key:1,class:`truncate`},PT=[`aria-label`,`aria-expanded`],FT=[`aria-label`,`title`],IT=[`title`],LT={key:0,class:`flex-1 text-left`},RT={key:1},zT={key:0,class:`count`},BT={class:`truncate`},VT={class:`main`},HT={key:0,class:`banner`,role:`alert`},UT={class:`flex-1`},WT={key:1,class:`banner`,role:`status`,"data-write-note":``},GT=[`title`],KT=[`title`],qT={class:`page`},JT={key:1,class:`px-6 py-16 text-center text-muted-foreground`},YT={key:2,class:`px-6 py-16 text-center text-muted-foreground`,"data-load-failed":``},XT=`mainflow.sidebarCollapsed`,ZT=aT(I({__name:`App`,setup(e){let t=tp();wT(),$i(async()=>{await Promise.all([nw(),_w()]),bw(),Sw()});let n=e=>window.location.assign(e),r=J(()=>Q.hubs.some(e=>!e.current&&e.activity)),i=M(!!$C(XT,!1));function a(){i.value=!i.value,ew(XT,i.value)}let o=M(!1),s=Nf(`(max-width: 720px)`),c=J(()=>i.value&&!s.value);F(()=>t.fullPath,()=>o.value=!1);let l=J(()=>(Q.summary?.mainlines??[]).filter(e=>!e.archivedAt&&(e.status===`active`||e.status===`planning`||e.status===`paused`))),u=[{to:`/`,label:`總覽`,icon:kd,exact:!0},{to:`/mainlines`,label:`主脈絡`,icon:Fw.mainline.icon},{to:`/sessions`,label:`會話`,icon:Fw.session.icon},{to:`/issues`,label:`待辦事項`,icon:Fw.issue.icon,count:()=>Q.summary?.openIssues},{to:`/findings`,label:`發現`,icon:Fw.finding.icon,count:()=>Q.summary?.validFindings},{to:`/ops`,label:`操作紀錄`,icon:Xd},{to:`/sync`,label:`同步提醒`,icon:Kd,count:()=>Q.sync.notices.length||void 0,shown:()=>Q.sync.remote||Q.sync.notices.length>0}],d=e=>e.exact?t.path===e.to:t.path.startsWith(e.to);return(e,i)=>(B(),V(`div`,{class:k([`layout`,{collapsed:c.value}])},[U(`nav`,{class:k([`sidebar`,{"menu-open":o.value}]),"aria-label":`範圍`},[U(`div`,TT,[!c.value&&N(Q).hubs.length>1?(B(),H(N(lC),{key:0},{default:P(()=>[W(N(SC),{class:`hub-switch`,"aria-label":`切換 hub`},{default:P(()=>[U(`span`,ET,j(N(Q).summary?.hub??`mainflow`),1),r.value?(B(),V(`span`,DT)):K(``,!0),W(N(Zu),{class:`size-3.5 shrink-0 text-muted-foreground`})]),_:1}),W(N(fC),{align:`start`,class:`w-64`},{default:P(()=>[W(N(mC),{class:`text-xs text-muted-foreground`},{default:P(()=>[...i[5]||=[G(`切換 hub`,-1)]]),_:1}),(B(!0),V(z,null,L(N(Q).hubs,e=>(B(),H(N(pC),{key:e.name,disabled:!e.available||e.current,"data-hub":e.name,onSelect:t=>n(e.base)},{default:P(()=>[U(`span`,OT,[U(`span`,{class:k([`truncate`,{"font-medium":e.current}])},j(e.name),3),e.available?e.current?(B(),V(`span`,AT,`目前的 hub`)):K(``,!0):(B(),V(`span`,kT,j(e.reason),1))]),e.activity===`notice`?(B(),V(`span`,jT,`新提醒`)):e.activity===`change`?(B(),V(`span`,MT,`有變動`)):K(``,!0)]),_:2},1032,[`disabled`,`data-hub`,`onSelect`]))),128))]),_:1})]),_:1})):c.value?K(``,!0):(B(),V(`span`,NT,j(N(Q).summary?.hub??`mainflow`),1)),U(`button`,{class:`icon-toggle menu-toggle`,"aria-label":o.value?`關閉選單`:`開啟選單`,"aria-expanded":o.value,onClick:i[0]||=e=>o.value=!o.value},[W(N(zd),{class:`size-4`})],8,PT),U(`button`,{class:`icon-toggle collapse-toggle`,"aria-label":c.value?`展開側欄`:`收合側欄`,title:c.value?`展開側欄`:`收合側欄`,onClick:a},[c.value?(B(),H(N(Ud),{key:0,class:`size-4`})):(B(),H(N(Hd),{key:1,class:`size-4`}))],8,FT)]),U(`button`,{class:`search`,title:c.value?`搜尋(⌘K)`:void 0,onClick:i[1]||=e=>N(Q).paletteOpen=!0},[W(N(Zd),{class:`size-4 shrink-0`}),c.value?K(``,!0):(B(),V(`span`,LT,`搜尋`)),c.value?K(``,!0):(B(),V(`kbd`,RT,`⌘K`))],8,IT),(B(!0),V(z,null,L(u.filter(e=>!e.shown||e.shown()),e=>(B(),H(N(Am),{key:e.to,to:e.to,class:k([`nav`,{current:d(e)}]),title:c.value?e.label:void 0},{default:P(()=>[(B(),H(fa(e.icon),{class:`size-4 shrink-0`})),c.value?K(``,!0):(B(),V(z,{key:0},[G(j(e.label),1),e.count?.()?(B(),V(`span`,zT,j(e.count()),1)):K(``,!0)],64))]),_:2},1032,[`to`,`class`,`title`]))),128)),c.value?K(``,!0):(B(),V(z,{key:0},[i[6]||=U(`div`,{class:`nav-label`},`進行中的主脈絡`,-1),(B(!0),V(z,null,L(l.value,e=>(B(),H(N(Am),{key:e.id,to:`/mainlines/${e.id}`,class:`nav sub`,"active-class":`current`},{default:P(()=>[W(Qw,{type:`mainline`,status:e.status},null,8,[`status`]),U(`span`,BT,j(e.title),1)]),_:2},1032,[`to`]))),128))],64))],2),U(`main`,VT,[N(Q).error?(B(),V(`p`,HT,[W(N(Qu),{class:`size-4 shrink-0 text-destructive`}),U(`span`,UT,j(N(Q).error),1),W(N(sC),{variant:`ghost`,size:`xs`,onClick:i[2]||=e=>N(Q).error=``},{default:P(()=>[...i[7]||=[G(`關閉`,-1)]]),_:1})])):K(``,!0),N(Q).note?(B(),V(`p`,WT,[W(N(id),{class:`size-4 shrink-0 text-warning`}),U(`span`,{class:`flex-1`,title:N(Q).note.detail||void 0},j(N(Q).note.text),9,GT),W(N(sC),{variant:`ghost`,size:`xs`,onClick:i[3]||=e=>N(Q).note=null},{default:P(()=>[...i[8]||=[G(`關閉`,-1)]]),_:1})])):K(``,!0),W(vT),N(hw)()>0&&N(t).path!==`/sync`?(B(),H(N(_g),{key:2,variant:`warning`,class:`sync-alert`,role:`alert`,"data-sync-alert":``},{default:P(()=>[W(N(of)),W(N(yg),null,{default:P(()=>[G(`同步有 `+j(N(hw)())+` 則新提醒`,1)]),_:1}),W(N(vg),{class:`flex min-w-0 items-center gap-2`},{default:P(()=>[U(`span`,{class:`min-w-0 flex-1 truncate`,title:N(Q).sync.notices[0]?.message},j(N(Q).sync.notices[0]&&N(zC)(N(Q).sync.notices[0])),9,KT),W(N(sC),{variant:`outline`,size:`xs`,"as-child":``},{default:P(()=>[W(N(Am),{to:`/sync`},{default:P(()=>[...i[9]||=[G(`查看`,-1)]]),_:1})]),_:1}),W(N(sC),{variant:`ghost`,size:`xs`,onClick:i[4]||=e=>N(gw)()},{default:P(()=>[...i[10]||=[G(`略過`,-1)]]),_:1})]),_:1})]),_:1})):K(``,!0),U(`div`,qT,[N(Q).summary?(B(),H(lT,{key:0,"reset-key":N(t).fullPath},{default:P(()=>[W(N(Lm))]),_:1},8,[`reset-key`])):N(Q).stale===null?(B(),V(`p`,JT,`載入中…`)):(B(),V(`p`,YT,`讀不到這個 hub 的資料`))])]),W(oT)],2))}}),[[`__scopeId`,`data-v-5e122eab`]]),QT=I({__name:`Badge`,props:{asChild:{type:Boolean},as:{},variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Sf(t,`class`);return(r,i)=>(B(),H(N(fv),q({"data-slot":`badge`,class:N(gg)(N($T)({variant:e.variant}),t.class)},N(n)),{default:P(()=>[R(r.$slots,`default`)]),_:3},16,[`class`]))}}),$T=Um(`inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`}},defaultVariants:{variant:`default`}}),eE=I({__name:`ArchiveButton`,props:{archived:{type:Boolean}},emits:[`toggle`],setup(e){return(t,n)=>(B(),H(N(sC),{variant:`ghost`,size:`xs`,class:`text-muted-foreground`,onClick:n[0]||=au(e=>t.$emit(`toggle`),[`stop`])},{default:P(()=>[e.archived?(B(),H(N(Nu),{key:0})):(B(),H(N(Pu),{key:1})),G(j(e.archived?`取消封存`:`封存`),1)]),_:1}))}}),tE=`(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)`;RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}${tE}?$`),RegExp(`^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}${tE}?)?$`);var nE=RegExp(`^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})(${tE})?$`);function rE(e){let t=nE.exec(e);if(!t)return NaN;let[,n,r,i,a,o,s]=t;return s?Date.parse(`${n}-${r}-${i}T${a}:${o}:00${s}`):new Date(Number(n),Number(r)-1,Number(i),Number(a),Number(o)).getTime()}var iE=e=>e.length===10?new Date(`${e}T00:00`).getTime():rE(e),aE=e=>new Date(iE(e)).toLocaleString(`sv-SE`),oE=e=>e.length===10?e:aE(e).slice(0,10),sE=e=>aE(e).slice(11,16),cE=e=>e.length===10?e:aE(e).slice(0,16),lE=()=>new Date().toLocaleDateString(`sv-SE`);function uE(e){return Math.round((new Date(`${e.slice(0,10)}T00:00`).getTime()-new Date(`${lE()}T00:00`).getTime())/864e5)}function dE(e){if(!e)return;let t=uE(e);return t<0?`overdue`:t<=7?`soon`:void 0}var fE=[`title`],pE=I({__name:`DueDate`,props:{day:{},ended:{type:Boolean}},setup(e){let t=e,n=J(()=>t.ended?void 0:dE(t.day)),r=J(()=>{if(!t.day||!n.value)return t.day??``;let e=uE(t.day);return e<0?`已逾期 ${-e} 天`:e===0?`今天到期`:`${e} 天後到期`});return(t,i)=>e.day?(B(),V(`span`,{key:0,class:k([`inline-flex items-center gap-1 text-xs tabular-nums`,n.value?`text-foreground`:`text-muted-foreground`]),title:r.value},[n.value?(B(),H(N(Wu),{key:0,class:k([`size-3.5`,n.value===`overdue`?`text-destructive`:`text-warning`])},null,8,[`class`])):K(``,!0),G(j(e.day),1)],10,fE)):K(``,!0)}}),mE=I({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(e,t)=>(B(),H(N(Kx),q({"data-slot":`checkbox`},N(i),{class:N(gg)(`peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50`,n.class)}),{default:P(t=>[W(N(qx),{"data-slot":`checkbox-indicator`,class:`grid place-content-center text-current transition-none`},{default:P(()=>[R(e.$slots,`default`,A(Cs(t)),()=>[W(N(qu),{class:`size-3.5`})])]),_:2},1024)]),_:3},16,[`class`]))}}),hE=I({__name:`TableBody`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`tbody`,{"data-slot":`table-body`,class:k(N(gg)(`[&_tr:last-child]:border-0`,t.class))},[R(e.$slots,`default`)],2))}}),gE=I({__name:`TableCell`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`td`,{"data-slot":`table-cell`,class:k(N(gg)(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5`,t.class))},[R(e.$slots,`default`)],2))}}),_E=I({__name:`TableRow`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`tr`,{"data-slot":`table-row`,class:k(N(gg)(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,t.class))},[R(e.$slots,`default`)],2))}}),vE=I({__name:`TableHead`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`th`,{"data-slot":`table-head`,class:k(N(gg)(`text-muted-foreground h-9 px-2 text-left align-middle text-xs font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5`,t.class))},[R(e.$slots,`default`)],2))}}),yE=I({__name:`TableHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`thead`,{"data-slot":`table-header`,class:k(N(gg)(`[&_tr]:border-b`,t.class))},[R(e.$slots,`default`)],2))}}),bE=[`title`],xE=I({__name:`PriorityFlag`,props:{priority:{}},setup(e){let t={P0:`text-priority-p0`,P1:`text-priority-p1`,P3:`text-priority-p3`};return(n,r)=>e.priority&&e.priority!==`P2`?(B(),V(`span`,{key:0,class:`inline-flex items-center gap-1 text-xs text-muted-foreground`,title:`優先度 ${e.priority}`},[W(N(_d),{class:k([`size-3.5`,t[e.priority]]),fill:`currentColor`},null,8,[`class`]),G(j(e.priority),1)],8,bE)):K(``,!0)}}),SE=[`aria-label`],CE={key:0,cx:`7`,cy:`7`,r:`5.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-dasharray":`2.2 2`},wE=I({__name:`StatusIcon`,props:{status:{}},setup(e){let t=e,n={todo:`dashed`,doing:`half`,waiting:`pause`,done:`check`,off:`cross`},r={todo:`text-status-todo`,doing:`text-status-doing`,waiting:`text-status-waiting`,done:`text-status-done`,off:`text-status-off`},i=J(()=>Uw(t.status)),a=J(()=>t.status===`handed-off`?`arrow`:n[i.value]);return(t,n)=>(B(),V(`svg`,{class:k([`shrink-0`,r[i.value]]),width:`14`,height:`14`,viewBox:`0 0 14 14`,role:`img`,"aria-label":N(Gw)[e.status]??e.status},[a.value===`dashed`?(B(),V(`circle`,CE)):a.value===`half`?(B(),V(z,{key:1},[n[0]||=U(`circle`,{cx:`7`,cy:`7`,r:`5.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},null,-1),n[1]||=U(`path`,{d:`M7 3.5 A3.5 3.5 0 0 1 7 10.5 Z`,fill:`currentColor`},null,-1)],64)):a.value===`pause`?(B(),V(z,{key:2},[n[2]||=U(`circle`,{cx:`7`,cy:`7`,r:`5.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},null,-1),n[3]||=U(`path`,{d:`M5.5 5v4M8.5 5v4`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`},null,-1)],64)):a.value===`check`?(B(),V(z,{key:3},[n[4]||=U(`circle`,{cx:`7`,cy:`7`,r:`6.25`,fill:`currentColor`},null,-1),n[5]||=U(`path`,{d:`M4.5 7.2l1.7 1.7 3.4-3.6`,fill:`none`,stroke:`var(--background)`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)],64)):a.value===`arrow`?(B(),V(z,{key:4},[n[6]||=U(`circle`,{cx:`7`,cy:`7`,r:`6.25`,fill:`currentColor`},null,-1),n[7]||=U(`path`,{d:`M4.5 7h5M7.5 5l2 2-2 2`,fill:`none`,stroke:`var(--background)`,"stroke-width":`1.4`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)],64)):(B(),V(z,{key:5},[n[8]||=U(`circle`,{cx:`7`,cy:`7`,r:`6.25`,fill:`currentColor`},null,-1),n[9]||=U(`path`,{d:`M5 5l4 4M9 5l-4 4`,stroke:`var(--background)`,"stroke-width":`1.4`,"stroke-linecap":`round`},null,-1)],64))],10,SE))}}),TE=I({__name:`StatusBadge`,props:{status:{}},setup(e){return(t,n)=>(B(),H(N(QT),{variant:`outline`,class:`h-[22px] gap-1.5 [&>svg]:size-3.5`},{default:P(()=>[W(wE,{status:e.status},null,8,[`status`]),G(j(N(Gw)[e.status]??e.status),1)]),_:1}))}}),EE={key:0,class:`w-full caption-bottom text-body`},DE=[`title`,`onClick`],OE={key:0,class:`group/ghead`},kE=[`colspan`],AE={class:`flex min-w-0 items-center gap-2 text-sm`},jE={key:1,class:`-ml-1 size-5 shrink-0`},ME=[`aria-label`,`aria-expanded`,`onClick`],NE=[`data-peek`,`aria-current`,`onClick`],PE={class:`shrink-0 font-mono text-xs text-muted-foreground`},FE={class:`truncate font-medium`},IE=[`data-peek`,`aria-current`,`onClick`],LE={class:`shrink-0 font-mono text-xs text-muted-foreground`},RE=[`title`],zE={key:6,class:`font-medium`},BE={key:7,class:`text-xs text-muted-foreground tabular-nums`},VE={class:`shrink-0 text-xs text-muted-foreground`,"data-group-priority":``},HE=[`title`],UE=[`title`],WE={class:`opacity-0 transition-opacity group-hover/row:opacity-100 focus-within:opacity-100`},GE={key:0},KE=[`colspan`],qE={key:1},JE=[`colspan`],YE={key:1,class:`px-6 py-16 text-center text-sm text-muted-foreground`},XE=I({__name:`ListTable`,props:{view:{},columns:{},itemRef:{type:Function},itemType:{type:Function},selection:{},limit:{}},setup(e){let t=e,{open:n,current:r}=FC(),i=e=>t.itemRef?.(e),a=e=>i(e)!==void 0&&r.value?.ref===i(e)||void 0;function o(e){let t=i(e);t&&n(t)}let s=e=>e.flatMap(e=>[{item:e,depth:0},...t.view.spec.nested?.(e)??[]]),c=J(()=>t.limit??1/0),l=M({}),u=e=>l.value[e]??c.value,d=e=>l.value={...l.value,[e]:u(e)+c.value},f=e=>s([...e.items,...!t.view.endedFolded.has(e.key)||e.items.length===0&&!e.key?e.ended:[]]),p=e=>!(e==null||e===``||Array.isArray(e)&&e.length===0),m=J(()=>{let e=s(t.view.groups.value.flatMap(e=>[...e.leader?[e.leader]:[],...e.items,...e.ended])).map(e=>e.item);return t.columns.filter((t,n)=>n===0||!t.value||e.some(e=>p(t.value(e))))}),h=()=>m.value.length+(t.selection?2:1),g=(e,n)=>n===0?[`w-full max-w-0 min-w-48`,t.selection?`pl-2`:`pl-6`]:[`w-px whitespace-nowrap`,e.optional&&`@max-3xl:hidden`,e.class],_=(e,n)=>t.selection?.active.value||n?``:`opacity-0 ${e}:opacity-100 focus-visible:opacity-100`,v=e=>{let{field:n,dir:r,chosen:i}=t.view.sort.value;return i&&e.sort===n.key?r:void 0};function y(e){let t=v(e);return t===`desc`?`改為由小到大`:t===`asc`?`取消排序,回到預設順序`:`由大到小排序`}return(t,s)=>e.view.groups.value.length?(B(),V(`table`,EE,[W(N(yE),{class:`sticky top-0 z-10 bg-background [&_tr]:border-b`},{default:P(()=>[W(N(_E),{class:`group/head hover:bg-transparent`},{default:P(()=>[e.selection?(B(),H(N(vE),{key:0,class:`w-px pr-0 pl-6`},{default:P(()=>[W(N(mE),{"model-value":e.selection.all.value,class:k(_(`group-hover/head`)),"aria-label":`全選`,"onUpdate:modelValue":s[0]||=t=>e.selection.setAll(t===!0)},null,8,[`model-value`,`class`])]),_:1})):K(``,!0),(B(!0),V(z,null,L(m.value,(t,n)=>(B(),H(N(vE),{key:t.key,class:k(g(t,n)),"aria-sort":v(t)===`desc`?`descending`:v(t)===`asc`?`ascending`:void 0},{default:P(()=>[t.sort&&e.view.spec.sorts.some(e=>e.key===t.sort)?(B(),V(`button`,{key:0,type:`button`,class:k([`group/sort -mx-1 inline-flex items-center gap-1 rounded-sm px-1 hover:bg-accent hover:text-foreground`,{"text-foreground":v(t)}]),title:y(t),onClick:n=>e.view.cycleSort(t.sort)},[G(j(t.label)+` `,1),v(t)===`desc`?(B(),H(N(Iu),{key:0,class:`size-3`})):v(t)===`asc`?(B(),H(N(Bu),{key:1,class:`size-3`})):(B(),H(N(Lu),{key:2,class:`size-3 opacity-0 group-hover/sort:opacity-100`}))],10,DE)):(B(),V(z,{key:1},[G(j(t.label),1)],64))]),_:2},1032,[`class`,`aria-sort`]))),128)),W(N(vE),{class:`w-px pr-6`},{default:P(()=>[...s[3]||=[U(`span`,{class:`sr-only`},`操作`,-1)]]),_:1})]),_:1})]),_:1}),(B(!0),V(z,null,L(e.view.groups.value,l=>(B(),H(N(hE),{key:l.key,class:`[&_tr:last-child]:border-b`},{default:P(()=>[l.key?(B(),V(`tr`,OE,[U(`td`,{colspan:h(),class:`sticky top-9 z-[5] bg-background px-6 pt-4 pb-1`},[U(`div`,AE,[e.selection?(B(),H(N(mE),{key:0,"model-value":e.selection.groupChecked(l),class:k([`mr-1`,_(`group-hover/ghead`)]),"aria-label":`選取分組 ${l.label}`,"onUpdate:modelValue":t=>e.selection.setGroup(l,t===!0)},null,8,[`model-value`,`class`,`aria-label`,`onUpdate:modelValue`])):K(``,!0),l.leader&&l.items.length+l.ended.length===0?(B(),V(`span`,jE)):(B(),V(`button`,{key:2,type:`button`,class:`-ml-1 grid size-5 shrink-0 place-items-center rounded-sm hover:bg-accent`,"aria-label":e.view.collapsed.has(l.key)?`展開分組`:`收合分組`,"aria-expanded":!e.view.collapsed.has(l.key),onClick:t=>e.view.toggleCollapsed(l.key)},[e.view.collapsed.has(l.key)?(B(),H(N(Xu),{key:1,class:`size-4 text-muted-foreground`})):(B(),H(N(Ju),{key:0,class:`size-4 text-muted-foreground`}))],8,ME)),l.leader?(B(),V(`button`,{key:3,type:`button`,class:k([`-mx-1 flex min-w-0 items-center gap-2 rounded-sm px-1 hover:bg-accent/50`,{"bg-muted":a(l.leader)}]),"data-peek":i(l.leader),"aria-current":a(l.leader),onClick:e=>o(l.leader)},[e.itemType?(B(),H(Qw,{key:0,type:e.itemType(l.leader),status:l.status},null,8,[`type`,`status`])):l.status?(B(),H(wE,{key:1,status:l.status,class:`shrink-0`},null,8,[`status`])):K(``,!0),U(`span`,PE,j(e.view.spec.id(l.leader)),1),U(`span`,FE,j(l.label),1)],10,NE)):l.detail?(B(),V(`button`,{key:4,type:`button`,class:k([`-mx-1 flex min-w-0 shrink-0 items-center gap-2 rounded-sm px-1 hover:bg-accent/50`,{"bg-muted":N(r)?.ref===l.detail.ref}]),"data-peek":l.detail.ref,"aria-current":N(r)?.ref===l.detail.ref||void 0,onClick:e=>N(n)(l.detail.ref)},[W(Qw,{type:`group`,status:l.detail.status},null,8,[`status`]),U(`span`,LE,j(l.detail.ref),1),U(`span`,{class:`max-w-80 truncate font-medium`,title:l.detail.title},j(l.detail.title),9,RE)],10,IE)):l.status?(B(),H(TE,{key:5,status:l.status},null,8,[`status`])):(B(),V(`span`,zE,j(l.label),1)),l.items.length+l.ended.length?(B(),V(`span`,BE,j(l.items.length+l.ended.length),1)):K(``,!0),l.detail?(B(),V(z,{key:8},[U(`span`,VE,[W(xE,{priority:l.detail.priority},null,8,[`priority`]),!l.detail.priority||l.detail.priority===`P2`?(B(),V(z,{key:0},[G(`P2`)],64)):K(``,!0)]),l.detail.trigger?(B(),V(`span`,{key:0,class:`flex min-w-0 shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`時機:${l.detail.trigger}`,"data-group-trigger":``},[W(N(rd),{class:`size-3.5 shrink-0`}),G(j(l.detail.trigger),1)],8,HE)):K(``,!0),l.detail.summary?(B(),V(`span`,{key:1,class:`min-w-0 truncate text-xs text-muted-foreground`,title:l.detail.summary,"data-group-summary":``},j(l.detail.summary),9,UE)):K(``,!0)],64)):K(``,!0)])],8,kE)])):K(``,!0),e.view.collapsed.has(l.key)?K(``,!0):(B(),V(z,{key:1},[(B(!0),V(z,null,L(f(l).slice(0,u(l.key)),({item:n,depth:r})=>(B(),H(N(_E),{key:e.view.spec.id(n),class:`group/row h-9 transition-colors duration-[120ms]`,"data-peek":i(n),"aria-current":a(n),"data-state":e.selection?.has(n)?`selected`:void 0,onClick:e=>o(n)},{default:P(()=>[e.selection?(B(),H(N(gE),{key:0,class:`w-px pr-0 pl-6`,onClick:s[1]||=au(()=>{},[`stop`])},{default:P(()=>[W(N(mE),{"model-value":e.selection.has(n),class:k(_(`group-hover/row`,e.selection.has(n))),"aria-label":`選取 ${e.view.spec.id(n)}`,"onUpdate:modelValue":t=>e.selection.toggle(n,t===!0)},null,8,[`model-value`,`class`,`aria-label`,`onUpdate:modelValue`])]),_:2},1024)):K(``,!0),(B(!0),V(z,null,L(m.value,(e,i)=>(B(),H(N(gE),{key:e.key,class:k(g(e,i))},{default:P(()=>[R(t.$slots,e.key,{item:n,depth:r})]),_:2},1032,[`class`]))),128)),W(N(gE),{class:`w-px pr-6 text-right whitespace-nowrap`,onClick:s[2]||=au(()=>{},[`stop`])},{default:P(()=>[U(`span`,WE,[R(t.$slots,`actions`,{item:n})])]),_:2},1024)]),_:2},1032,[`data-peek`,`aria-current`,`data-state`,`onClick`]))),128)),f(l).length>u(l.key)?(B(),V(`tr`,GE,[U(`td`,{colspan:h(),class:`px-4 py-1`},[W(N(sC),{variant:`ghost`,size:`xs`,class:`text-muted-foreground`,onClick:e=>d(l.key)},{default:P(()=>[W(N(Ju)),G(`再顯示 `+j(Math.min(c.value,f(l).length-u(l.key)))+` 個,還有 `+j(f(l).length-u(l.key))+` 個`,1)]),_:2},1032,[`onClick`])],8,KE)])):K(``,!0),l.ended.length&&(l.items.length!==0||l.key)?(B(),V(`tr`,qE,[U(`td`,{colspan:h(),class:`px-4 py-1`},[W(N(sC),{variant:`ghost`,size:`xs`,class:`text-muted-foreground`,"aria-expanded":!e.view.endedFolded.has(l.key),onClick:t=>e.view.toggleEnded(l.key)},{default:P(()=>[e.view.endedFolded.has(l.key)?(B(),H(N(Xu),{key:1})):(B(),H(N(Ju),{key:0})),G(j(e.view.endedFolded.has(l.key)?`已結束 ${l.ended.length} 個`:`收起已結束 ${l.ended.length} 個`),1)]),_:2},1032,[`aria-expanded`,`onClick`])],8,JE)])):K(``,!0)],64))]),_:2},1024))),128))])):(B(),V(`div`,YE,[e.view.total.value>0?(B(),V(z,{key:0},[s[5]||=G(` 沒有符合條件的項目。`,-1),W(N(sC),{variant:`link`,size:`xs`,class:`px-0`,onClick:e.view.clearAll},{default:P(()=>[...s[4]||=[G(`清除篩選與搜尋`,-1)]]),_:1},8,[`onClick`])],64)):R(t.$slots,`empty`,{},void 0,void 0,1)]))}}),ZE=I({__name:`Input`,props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=Lf(n,`modelValue`,t,{passive:!0,defaultValue:n.defaultValue});return(e,t)=>yr((B(),V(`input`,{"onUpdate:modelValue":t[0]||=e=>fn(r)?r.value=e:null,"data-slot":`input`,class:k(N(gg)(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,n.class))},null,2)),[[Wl,N(r)]])}}),QE={class:`flex flex-wrap items-center gap-2 px-6 py-2`},$E={class:`relative`},eD={class:`text-muted-foreground`},tD=[`aria-label`,`onClick`],nD={class:`ml-auto text-xs text-muted-foreground tabular-nums`},rD={key:0,class:`ml-auto text-xs text-muted-foreground`},iD={class:`truncate`},aD={key:0,class:`px-2 py-1.5 text-xs text-muted-foreground`},oD=I({__name:`ListToolbar`,props:{view:{},grouping:{type:Boolean,default:!0}},setup(e){let t=e,n={without:`不含已封存`,with:`包含已封存`,only:`只看已封存`},r=e=>t.view.setSort(String(e)),i=e=>t.view.setSort(t.view.sort.value.field.key,e);return(t,a)=>(B(),V(`div`,QE,[U(`label`,$E,[W(N(Zd),{class:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),W(N(ZE),{modelValue:e.view.search.value,"onUpdate:modelValue":a[0]||=t=>e.view.search.value=t,class:`h-8 w-56 pl-8`,placeholder:`搜尋 ID、名稱或欄位`,"aria-label":`搜尋`},null,8,[`modelValue`])]),(B(!0),V(z,null,L(e.view.activeFilters.value,t=>(B(),H(N(QT),{key:`${t.field.key}:${t.value}`,variant:`secondary`,class:`h-6 gap-1 pr-1`},{default:P(()=>[U(`span`,eD,j(t.field.label),1),G(j(t.label)+` `,1),U(`button`,{type:`button`,class:`grid size-4 place-items-center rounded-sm hover:bg-accent`,"aria-label":`移除篩選 ${t.field.label} ${t.label}`,onClick:n=>e.view.toggleFilter(t.field.key,t.value)},[W(N(uf),{class:`size-3`})],8,tD)]),_:2},1024))),128)),e.view.spec.archived&&e.view.archived.value===`only`?(B(),H(N(QT),{key:0,variant:`secondary`,class:`h-6 gap-1 pr-1`},{default:P(()=>[G(j(n[e.view.archived.value])+` `,1),U(`button`,{type:`button`,class:`grid size-4 place-items-center rounded-sm hover:bg-accent`,"aria-label":`移除封存篩選`,onClick:a[1]||=t=>e.view.setArchived(`without`)},[W(N(uf),{class:`size-3`})])]),_:1})):K(``,!0),e.view.activeFilters.value.length>1?(B(),H(N(sC),{key:1,variant:`ghost`,size:`xs`,class:`text-muted-foreground`,onClick:e.view.clearAll},{default:P(()=>[...a[7]||=[G(`清除全部`,-1)]]),_:1},8,[`onClick`])):K(``,!0),U(`span`,nD,[e.view.shown.value===e.view.total.value?(B(),V(z,{key:0},[G(j(e.view.total.value)+` 個`,1)],64)):(B(),V(z,{key:1},[G(j(e.view.shown.value)+` / `+j(e.view.total.value)+` 個`,1)],64))]),R(t.$slots,`views`),e.view.spec.archived?(B(),H(N(sC),{key:2,variant:`outline`,size:`sm`,class:k({"bg-accent text-accent-foreground":e.view.archived.value!==`without`}),"aria-pressed":e.view.archived.value!==`without`,onClick:a[2]||=t=>e.view.setArchived(e.view.archived.value===`without`?`with`:`without`)},{default:P(()=>[W(N(Pu)),a[8]||=G(`顯示已封存 `,-1)]),_:1},8,[`class`,`aria-pressed`])):K(``,!0),W(N(lC),null,{default:P(()=>[W(N(SC),{"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`,size:`sm`},{default:P(()=>[W(N(Fd)),a[9]||=G(`篩選`,-1)]),_:1})]),_:1}),W(N(fC),{align:`end`,class:`w-48`},{default:P(()=>[(B(!0),V(z,null,L(e.view.spec.filters,t=>(B(),H(N(yC),{key:t.key},{default:P(()=>[W(N(xC),null,{default:P(()=>[G(j(t.label)+` `,1),e.view.filters.value[t.key]?.length?(B(),V(`span`,rD,j(e.view.filters.value[t.key].length),1)):K(``,!0)]),_:2},1024),W(N(bC),{class:`max-h-80 w-56`},{default:P(()=>[(B(!0),V(z,null,L(e.view.optionsOf(t),n=>(B(),H(N(dC),{key:n.value,"model-value":e.view.filters.value[t.key]?.includes(n.value),onSelect:au(r=>e.view.toggleFilter(t.key,n.value),[`prevent`])},{default:P(()=>[n.status?(B(),H(wE,{key:0,status:n.status},null,8,[`status`])):K(``,!0),U(`span`,iD,j(n.label),1)]),_:2},1032,[`model-value`,`onSelect`]))),128)),e.view.optionsOf(t).length===0?(B(),V(`p`,aD,`沒有可選的值`)):K(``,!0)]),_:2},1024)]),_:2},1024))),128)),e.view.spec.archived?(B(),V(z,{key:0},[W(N(vC)),W(N(yC),null,{default:P(()=>[W(N(xC),null,{default:P(()=>[W(N(Cd),{class:`size-4 text-muted-foreground`}),a[10]||=G(`封存`,-1)]),_:1}),W(N(bC),null,{default:P(()=>[W(N(hC),{"model-value":e.view.archived.value,"onUpdate:modelValue":a[3]||=t=>e.view.setArchived(t)},{default:P(()=>[(B(),V(z,null,L(n,(e,t)=>W(N(_C),{key:t,value:t},{default:P(()=>[G(j(e),1)]),_:2},1032,[`value`])),64))]),_:1},8,[`model-value`])]),_:1})]),_:1})],64)):K(``,!0)]),_:1})]),_:1}),W(N(lC),null,{default:P(()=>[W(N(SC),{"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`,size:`sm`},{default:P(()=>[e.view.sort.value.dir===`desc`?(B(),H(N(Fu),{key:0})):(B(),H(N(Ru),{key:1})),G(j(e.view.sort.value.field.label),1)]),_:1})]),_:1}),W(N(fC),{align:`end`,class:`w-44`},{default:P(()=>[W(N(mC),{class:`text-xs text-muted-foreground`},{default:P(()=>[...a[11]||=[G(`排序`,-1)]]),_:1}),W(N(hC),{"model-value":e.view.sort.value.field.key,"onUpdate:modelValue":r},{default:P(()=>[(B(!0),V(z,null,L(e.view.spec.sorts,e=>(B(),H(N(_C),{key:e.key,value:e.key},{default:P(()=>[G(j(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`]),W(N(vC)),W(N(hC),{"model-value":e.view.sort.value.dir,"onUpdate:modelValue":a[4]||=e=>i(e)},{default:P(()=>[W(N(_C),{value:`asc`},{default:P(()=>[...a[12]||=[G(`由小到大`,-1)]]),_:1}),W(N(_C),{value:`desc`},{default:P(()=>[...a[13]||=[G(`由大到小`,-1)]]),_:1})]),_:1},8,[`model-value`]),e.view.sort.value.chosen?(B(),V(z,{key:0},[W(N(vC)),W(N(pC),{onSelect:a[5]||=t=>e.view.clearSort()},{default:P(()=>[...a[14]||=[G(`回到預設順序`,-1)]]),_:1})],64)):K(``,!0)]),_:1})]),_:1}),e.grouping&&e.view.spec.groups.length?(B(),H(N(lC),{key:3},{default:P(()=>[W(N(SC),{"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`,size:`sm`},{default:P(()=>[W(N(Ad)),G(j(e.view.spec.groups.find(t=>t.key===e.view.group.value)?.label??`不分組`),1)]),_:1})]),_:1}),W(N(fC),{align:`end`,class:`w-40`},{default:P(()=>[W(N(mC),{class:`text-xs text-muted-foreground`},{default:P(()=>[...a[15]||=[G(`分組`,-1)]]),_:1}),W(N(hC),{"model-value":e.view.group.value,"onUpdate:modelValue":a[6]||=t=>e.view.setGroup(String(t))},{default:P(()=>[(B(!0),V(z,null,L(e.view.spec.groups,e=>(B(),H(N(_C),{key:e.key,value:e.key},{default:P(()=>[G(j(e.label),1)]),_:2},1032,[`value`]))),128)),W(N(_C),{value:``},{default:P(()=>[...a[16]||=[G(`不分組`,-1)]]),_:1})]),_:1},8,[`model-value`])]),_:1})]),_:1})):K(``,!0)]))}}),sD={key:0,class:`pointer-events-none sticky bottom-4 z-20 flex justify-center px-6`,role:`toolbar`,"aria-label":`批次操作`},cD={class:`pointer-events-auto flex items-center gap-1 rounded-lg border bg-popover py-1 pr-1 pl-3 text-sm shadow-md`},lD={class:`mr-2 tabular-nums`},uD={key:0,class:`text-muted-foreground tabular-nums`},dD={key:0,class:`text-muted-foreground tabular-nums`},fD=I({__name:`SelectionBar`,props:{selection:{}},setup(e){return(t,n)=>e.selection.active.value?(B(),V(`div`,sD,[U(`div`,cD,[U(`span`,lD,`已選 `+j(e.selection.selected.value.length)+` 個`,1),W(N(sC),{variant:`ghost`,size:`sm`,disabled:!e.selection.archivable.value,onClick:n[0]||=t=>e.selection.setArchived(!0)},{default:P(()=>[W(N(Pu)),n[3]||=G(`封存`,-1),e.selection.archivable.value?(B(),V(`span`,uD,j(e.selection.archivable.value),1)):K(``,!0)]),_:1},8,[`disabled`]),W(N(sC),{variant:`ghost`,size:`sm`,disabled:!e.selection.restorable.value,onClick:n[1]||=t=>e.selection.setArchived(!1)},{default:P(()=>[W(N(Nu)),n[4]||=G(`取消封存`,-1),e.selection.restorable.value?(B(),V(`span`,dD,j(e.selection.restorable.value),1)):K(``,!0)]),_:1},8,[`disabled`]),W(N(sC),{variant:`ghost`,size:`icon-sm`,"aria-label":`清除選取`,onClick:n[2]||=t=>e.selection.clear()},{default:P(()=>[W(N(uf))]),_:1})])])):K(``,!0)}}),pD={key:2,class:`shrink-0 font-mono text-xs text-muted-foreground`},mD=[`title`],hD=I({__name:`NameCell`,props:{status:{},id:{},title:{},muted:{type:Boolean},depth:{},type:{}},setup(e){return(t,n)=>(B(),V(`span`,{class:`flex min-w-0 items-center gap-2`,style:he(e.depth?{paddingLeft:`${e.depth*24}px`}:void 0)},[e.type?(B(),H(Qw,{key:0,type:e.type,status:e.status},null,8,[`type`,`status`])):e.status?(B(),H(wE,{key:1,status:e.status,class:`shrink-0`},null,8,[`status`])):K(``,!0),e.id?(B(),V(`span`,pD,j(e.id),1)):K(``,!0),U(`span`,{class:k([`truncate`,{"text-muted-foreground":e.muted}]),title:e.title},j(e.title),11,mD),R(t.$slots,`default`)],4))}}),gD={class:`flex min-w-0 items-baseline gap-3 px-6 pt-6 pb-2`},_D={class:`shrink-0 text-title font-semibold`},vD=[`title`],yD=I({__name:`PageHeader`,props:{title:{},description:{}},setup(e){return(t,n)=>(B(),V(`header`,gD,[U(`h1`,_D,j(e.title),1),e.description?(B(),V(`p`,{key:0,class:`min-w-0 truncate text-sm text-muted-foreground`,title:e.description},j(e.description),9,vD)):K(``,!0)]))}}),bD={class:`group/copy inline-flex min-w-0 items-center gap-0.5`},xD=[`title`],SD=[`aria-label`,`title`],CD=I({__name:`CopyText`,props:{text:{},label:{},mono:{type:Boolean,default:!0}},setup(e){let t=e,n=M(`idle`),r;async function i(){n.value=await yT(t.text)?`copied`:`failed`,clearTimeout(r),r=setTimeout(()=>n.value=`idle`,1200)}let a={idle:e=>`複製 ${e}`,copied:()=>`已複製`,failed:()=>`無法複製,請手動選取`};return(t,r)=>(B(),V(`span`,bD,[U(`span`,{class:k([`truncate select-text`,e.mono?`font-mono text-xs text-muted-foreground`:``]),title:e.text},j(e.label??e.text),11,xD),U(`button`,{type:`button`,class:k([`inline-grid size-5 shrink-0 place-items-center rounded-sm text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100 group-hover/copy:opacity-100`,{"text-status-done opacity-100":n.value===`copied`,"text-destructive opacity-100":n.value===`failed`}]),"aria-label":a[n.value](e.text),title:a[n.value](e.text),onClick:au(i,[`stop`])},[n.value===`copied`?(B(),H(N(qu),{key:0,class:`size-3`})):n.value===`failed`?(B(),H(N(uf),{key:1,class:`size-3`})):(B(),H(N(sd),{key:2,class:`size-3`}))],10,SD)]))}}),wD=I({__name:`EditableTitle`,props:{value:{}},emits:[`save`],setup(e,{emit:t}){let n=e,r=t,i=M(!1),a=M(``),o=M();async function s(){a.value=n.value,i.value=!0,await tr(),o.value?.select()}function c(e){if(!i.value)return;i.value=!1;let t=a.value.trim();e&&t&&t!==n.value&&r(`save`,t)}return(t,n)=>i.value?yr((B(),V(`input`,{key:0,ref_key:`input`,ref:o,"onUpdate:modelValue":n[0]||=e=>a.value=e,class:`-mx-1 w-full rounded-sm bg-transparent px-1 outline-none ring-1 ring-ring`,"aria-label":`主脈絡標題`,onKeydown:[n[1]||=su(au(e=>c(!0),[`prevent`]),[`enter`]),n[2]||=su(au(e=>c(!1),[`stop`,`prevent`]),[`esc`])],onBlur:n[3]||=e=>c(!0)},null,544)),[[Wl,a.value]]):(B(),V(`button`,{key:1,type:`button`,class:`-mx-1 cursor-text rounded-sm px-1 text-left hover:bg-accent/50`,title:`點一下改標題`,onClick:s},j(e.value),1))}}),TD={class:`flex flex-col gap-2 px-5 pt-1 pb-4`},ED={key:0,class:`flex items-center gap-1.5`},DD={key:1,class:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`},OD=I({__name:`PanelHeader`,props:{id:{},title:{},mono:{type:Boolean},type:{},status:{},editable:{type:Boolean}},emits:[`rename`],setup(e){return(t,n)=>(B(),V(`header`,TD,[e.id||e.type?(B(),V(`div`,ED,[W(Qw,{type:e.type,status:e.status},null,8,[`type`,`status`]),e.id?(B(),H(CD,{key:0,text:e.id},null,8,[`text`])):K(``,!0)])):K(``,!0),U(`h2`,{class:k([`text-base font-semibold break-words`,{"font-mono text-sm":e.mono}])},[e.editable?(B(),H(wD,{key:0,value:e.title,onSave:n[0]||=e=>t.$emit(`rename`,e)},null,8,[`value`])):(B(),V(z,{key:1},[G(j(e.title),1)],64))],2),t.$slots.default?(B(),V(`div`,DD,[R(t.$slots,`default`)])):K(``,!0),R(t.$slots,`notice`)]))}}),kD={class:`px-5 py-3`},AD={key:0,class:`mb-2 text-sm font-medium`},jD={key:0,class:`ml-1.5 text-xs font-normal text-muted-foreground tabular-nums`},MD=I({__name:`PanelSection`,props:{title:{},count:{}},setup(e){return(t,n)=>(B(),V(`section`,kD,[e.title?(B(),V(`h3`,AD,[G(j(e.title),1),e.count===void 0?K(``,!0):(B(),V(`span`,jD,j(e.count),1))])):K(``,!0),R(t.$slots,`default`)]))}}),ND={class:`pb-8`},PD={key:0},FD=[`title`],ID={class:`text-sm`},LD={class:`mt-1 text-xs text-muted-foreground`},RD={class:`mt-1 font-mono break-words`},zD={key:0,class:`px-5 text-sm text-destructive`,role:`alert`},BD={class:`min-w-0`},VD={class:`side`,"data-side":`mine`},HD={class:`min-w-0`},UD={class:`mb-1.5 text-xs font-medium text-muted-foreground`},WD={key:0,class:`side`,"data-side":`theirs`},GD={key:1,class:`text-sm text-muted-foreground`},KD={key:2,class:`px-5 text-muted-foreground`},qD=aT(I({__name:`ConflictPeek`,props:{saved:{}},setup(e){let t=e,n=M(null),r=M(``),i=M(null),a=J(()=>Q.sync.notices.find(e=>e.saved===t.saved));Er(async()=>{n.value=null,r.value=``;try{n.value=await XC.conflict(t.saved),await tr(),i.value?.querySelector(`.only`)?.scrollIntoView({block:`center`})}catch(e){r.value=e.message}});let o=e=>(e??``).split(`
|
|
8
|
-
`),s=(e,t)=>{let n=new Set(o(t));return o(e).map(e=>({line:e,only:!n.has(e)}))},c=J(()=>n.value?s(n.value.mine,n.value.theirs.text):[]),l=J(()=>n.value?s(n.value.theirs.text,n.value.mine):[]),u=J(()=>n.value?.theirs.source===`server`?`hub 目前的版本(同步伺服器)`:`hub 目前的版本(本機同步副本)`);return(t,o)=>(B(),V(`div`,
|
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rO(e,t){return eO(e)||tO(e,t)||iO(e,t)||nO()}function iO(e,t){if(e){if(typeof e==`string`)return $D(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$D(e,t):void 0}}var aO=Object.entries,oO=Object.setPrototypeOf,sO=Object.isFrozen,cO=Object.getPrototypeOf,lO=Object.getOwnPropertyDescriptor,uO=Object.freeze,dO=Object.seal,fO=Object.create,pO=typeof Reflect<`u`&&Reflect,mO=pO.apply,hO=pO.construct;uO||=function(e){return e},dO||=function(e){return e},mO||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},hO||=function(e){return new e(...[...arguments].slice(1))};var gO=IO(Array.prototype.forEach),_O=IO(Array.prototype.lastIndexOf),vO=IO(Array.prototype.pop),yO=IO(Array.prototype.push),bO=IO(Array.prototype.splice),xO=Array.isArray,SO=IO(String.prototype.toLowerCase),CO=IO(String.prototype.toString),wO=IO(String.prototype.match),TO=IO(String.prototype.replace),EO=IO(String.prototype.indexOf),DO=IO(String.prototype.trim),OO=IO(Number.prototype.toString),kO=IO(Boolean.prototype.toString),AO=typeof BigInt>`u`?null:IO(BigInt.prototype.toString),jO=typeof Symbol>`u`?null:IO(Symbol.prototype.toString),MO=IO(Object.prototype.hasOwnProperty),NO=IO(Object.prototype.toString),PO=IO(RegExp.prototype.test),FO=LO(TypeError);function IO(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return mO(e,t,n)}}function LO(e){return function(){return hO(e,[...arguments])}}function RO(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:SO;if(oO&&oO(e,null),!xO(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(sO(t)||(t[r]=e),i=e)}e[i]=!0}return e}function zO(e){for(let t=0;t<e.length;t++)MO(e,t)||(e[t]=null);return e}function BO(e){let t=fO(null);for(let r of aO(e)){var n=rO(r,2);let i=n[0],a=n[1];MO(e,i)&&(t[i]=xO(a)?zO(a):a&&typeof a==`object`&&a.constructor===Object?BO(a):a)}return t}function VO(e){switch(typeof e){case`string`:return e;case`number`:return OO(e);case`boolean`:return kO(e);case`bigint`:return AO?AO(e):`0`;case`symbol`:return jO?jO(e):`Symbol()`;case`undefined`:return NO(e);case`function`:case`object`:{if(e===null)return NO(e);let t=e,n=HO(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:NO(e)}return NO(e)}default:return NO(e)}}function HO(e,t){for(;e!==null;){let n=lO(e,t);if(n){if(n.get)return IO(n.get);if(typeof n.value==`function`)return IO(n.value)}e=cO(e)}function n(){return null}return n}function UO(e){try{return PO(e,``),!0}catch{return!1}}var WO=uO(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),GO=uO(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),KO=uO([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),qO=uO([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),JO=uO(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),YO=uO([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),XO=uO([`#text`]),ZO=uO(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),QO=uO(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),$O=uO(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ek=uO([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),tk=dO(/{{[\w\W]*|^[\w\W]*}}/g),nk=dO(/<%[\w\W]*|^[\w\W]*%>/g),rk=dO(/\${[\w\W]*/g),ik=dO(/^data-[\-\w.\u00B7-\uFFFF]+$/),ak=dO(/^aria-[\-\w]+$/),ok=dO(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sk=dO(/^(?:\w+script|data):/i),ck=dO(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lk=dO(/^html$/i),uk=dO(/^[a-z][.\w]*(-[.\w]+)+$/i),dk=dO(/<[/\w!]/g),fk=dO(/<[/\w]/g),pk=dO(/<\/no(script|embed|frames)/i),mk=dO(/\/>/i),hk={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},gk=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],_k=uO(RO({},gk)),vk=function(){let e={};return gO(gk,t=>{e[t]=dO(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),uO(e)}(),yk=function(){return typeof window>`u`?null:window},bk=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},xk=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sk=function(e,t,n,r){return MO(e,t)&&xO(e[t])?RO(r.base?BO(r.base):{},e[t],r.transform):n},Ck=function(e,t,n){let r=MO(e,t)?e[t]:void 0;return r&&typeof r==`object`?BO(r):n()};function wk(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yk(),t=e=>wk(e);if(t.version=`3.4.15`,t.removed=[],!e||!e.document||e.document.nodeType!==hk.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=HO(d,`cloneNode`),p=HO(d,`remove`),m=HO(d,`removeAttributeNode`),h=HO(d,`nextSibling`),g=HO(d,`childNodes`),_=HO(d,`parentNode`),v=HO(d,`shadowRoot`),y=HO(d,`attributes`),b=o&&o.prototype?HO(o.prototype,`nodeType`):null,x=o&&o.prototype?HO(o.prototype,`nodeName`):null,S=o&&o.prototype?HO(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,ee=``,E,te=!1,ne=0,re=function(){if(ne>0)throw FO(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){re(),ne++;try{return T.createHTML(e)}finally{ne--}},ie=function(e){re(),ne++;try{return T.createScriptURL(e)}finally{ne--}},ae=function(){return te||=(E=bk(u,i),!0),E},oe=n,se=oe.implementation,O=oe.createNodeIterator,ce=oe.createDocumentFragment,le=oe.getElementsByTagName,ue=r.importNode,de=xk();t.isSupported=typeof aO==`function`&&typeof _==`function`&&se&&se.createHTMLDocument!==void 0;let fe=tk,pe=nk,me=rk,he=ik,ge=ak,_e=sk,ve=ck,ye=uk,k=ok,A=null,be=RO({},[...WO,...GO,...KO,...JO,...XO]),xe=null,Se=RO({},[...ZO,...QO,...$O,...ek]),Ce=Object.seal(fO(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,Te=null,Ee=Object.seal(fO(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),De=!0,Oe=!0,ke=!1,j=!0,Ae=!1,je=!0,Me=!1,Ne=!1,Pe=null,Fe=null,Ie=!1,Le=!1,Re=!1,ze=!1,Be=!0,Ve=!1,He=`user-content-`,Ue=!0,We=!1,Ge={},Ke=null,qe=RO({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Je=null,Ye=RO({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Xe=null,Ze=RO({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Qe=`http://www.w3.org/1998/Math/MathML`,$e=`http://www.w3.org/2000/svg`,et=`http://www.w3.org/1999/xhtml`,tt=et,nt=!1,rt=null,it=RO({},[Qe,$e,et],CO),at=uO([`mi`,`mo`,`mn`,`ms`,`mtext`]),ot=RO({},at),st=uO([`annotation-xml`]),ct=RO({},st),lt=RO({},[`title`,`style`,`font`,`a`,`script`]),ut=null,dt=[`application/xhtml+xml`,`text/html`],ft=null,pt=null,mt=n.createElement(`form`),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pt&&pt===e)return;(!e||typeof e!=`object`)&&(e={}),e=BO(e),ut=dt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ft=ut===`application/xhtml+xml`?CO:SO,A=Sk(e,`ALLOWED_TAGS`,be,{transform:ft}),xe=Sk(e,`ALLOWED_ATTR`,Se,{transform:ft}),rt=Sk(e,`ALLOWED_NAMESPACES`,it,{transform:CO}),Xe=Sk(e,`ADD_URI_SAFE_ATTR`,Ze,{transform:ft,base:Ze}),Je=Sk(e,`ADD_DATA_URI_TAGS`,Ye,{transform:ft,base:Ye}),Ke=Sk(e,`FORBID_CONTENTS`,qe,{transform:ft}),we=Sk(e,`FORBID_TAGS`,BO({}),{transform:ft}),Te=Sk(e,`FORBID_ATTR`,BO({}),{transform:ft}),Ge=MO(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?BO(e.USE_PROFILES):e.USE_PROFILES:!1,De=e.ALLOW_ARIA_ATTR!==!1,Oe=e.ALLOW_DATA_ATTR!==!1,ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,j=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=e.SAFE_FOR_TEMPLATES||!1,je=e.SAFE_FOR_XML!==!1,Me=e.WHOLE_DOCUMENT||!1,Le=e.RETURN_DOM||!1,Re=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Be=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,Ue=e.KEEP_CONTENT!==!1,We=e.IN_PLACE||!1,k=UO(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:ok,tt=typeof e.NAMESPACE==`string`?e.NAMESPACE:et,ot=Ck(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>RO({},at)),ct=Ck(e,`HTML_INTEGRATION_POINTS`,()=>RO({},st));let t=Ck(e,`CUSTOM_ELEMENT_HANDLING`,()=>fO(null));if(Ce=fO(null),MO(t,`tagNameCheck`)&&ht(t.tagNameCheck)&&(Ce.tagNameCheck=t.tagNameCheck),MO(t,`attributeNameCheck`)&&ht(t.attributeNameCheck)&&(Ce.attributeNameCheck=t.attributeNameCheck),MO(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Ce.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),dO(Ce),Ae&&(Oe=!1),Re&&(Le=!0),Ge&&(A=RO({},XO),xe=fO(null),Ge.html===!0&&(RO(A,WO),RO(xe,ZO)),Ge.svg===!0&&(RO(A,GO),RO(xe,QO),RO(xe,ek)),Ge.svgFilters===!0&&(RO(A,KO),RO(xe,QO),RO(xe,ek)),Ge.mathMl===!0&&(RO(A,JO),RO(xe,$O),RO(xe,ek))),Ee.tagCheck=null,Ee.attributeCheck=null,MO(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ee.tagCheck=e.ADD_TAGS:xO(e.ADD_TAGS)&&(A===be&&(A=BO(A)),RO(A,e.ADD_TAGS,ft))),MO(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ee.attributeCheck=e.ADD_ATTR:xO(e.ADD_ATTR)&&(xe===Se&&(xe=BO(xe)),RO(xe,e.ADD_ATTR,ft))),MO(e,`ADD_FORBID_CONTENTS`)&&xO(e.ADD_FORBID_CONTENTS)&&(Ke===qe&&(Ke=BO(Ke)),RO(Ke,e.ADD_FORBID_CONTENTS,ft)),Ue&&(A[`#text`]=!0),Me&&RO(A,[`html`,`head`,`body`]),A.table&&(RO(A,[`tbody`]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw FO(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw FO(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{ee=D(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,ee=``):(T===void 0&&(T=ae()),T&&typeof ee==`string`&&(ee=D(``)));uO&&uO(e),pt=e},_t=RO({},[...GO,...KO,...qO]),vt=RO({},[...JO,...YO]),yt=function(e,t,n){return t.namespaceURI===et?e===`svg`:t.namespaceURI===Qe?e===`svg`&&(n===`annotation-xml`||ot[n]):!!_t[e]},bt=function(e,t,n){return t.namespaceURI===et?e===`math`:t.namespaceURI===$e?e===`math`&&ct[n]:!!vt[e]},xt=function(e,t,n){return t.namespaceURI===$e&&!ct[n]||t.namespaceURI===Qe&&!ot[n]?!1:!vt[e]&&(lt[e]||!_t[e])},St=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:tt,tagName:`template`});let n=SO(e.tagName),r=SO(t.tagName);return rt[e.namespaceURI]?e.namespaceURI===$e?yt(n,t,r):e.namespaceURI===Qe?bt(n,t,r):e.namespaceURI===et?xt(n,t,r):!!(ut===`application/xhtml+xml`&&rt[e.namespaceURI]):!1},Ct=function(e){yO(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw FO(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},wt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Tt=function(e){Ot(e);let t=g(e);if(t){let e=[];gO(t,t=>{yO(e,t)}),gO(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&wt(e,r,i)}},Et=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}yO(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Le||Re)try{Ct(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Dt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||xe[ft(i)]||wt(e,r,i)}},Ot=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===hk.element&&Dt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},kt=function(e,t){return je?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},At=function(e){if(!je)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===hk.processingInstruction||n===hk.comment&&PO(fk,e.data)){try{p(e)}catch{}continue}if(n===hk.element){let t=e,n=ft(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&kt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},jt=function(e){let t=null,r=null;if(Ie)e=`<remove></remove>`+e;else{let t=wO(e,/^[\r\n\t ]+/);r=t&&t[0]}ut===`application/xhtml+xml`&&tt===et&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?D(e):e;if(tt===et)try{t=new l().parseFromString(i,ut)}catch{}if(!t||!t.documentElement){t=se.createDocument(tt,`template`,null);try{t.documentElement.innerHTML=nt?ee:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),tt===et?le.call(t,Me?`html`:`body`)[0]:Me?t.documentElement:a},Mt=function(e){let t=S?S(e):e.ownerDocument;return O.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Nt=function(e){return e=TO(e,fe,` `),e=TO(e,pe,` `),e=TO(e,me,` `),e},Pt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=O.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Nt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&gO(i,e=>{It(e.content)&&Pt(e.content)})},Ft=function(e){let t=x?x(e):null;return typeof t!=`string`||ft(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},It=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===hk.documentFragment}catch{return!1}},Lt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Rt(e,n,r){e.length!==0&&gO(e,e=>{e.call(t,n,r,pt)})}let zt=function(e,t){return!!(je&&e.hasChildNodes()&&!Lt(e.firstElementChild)&&PO(dk,e.textContent)&&PO(dk,e.innerHTML)||je&&e.namespaceURI===et&&_k[t]&&(Lt(e.firstElementChild)||typeof e.textContent==`string`&&PO(vk[t],e.textContent))||e.nodeType===hk.processingInstruction||je&&e.nodeType===hk.comment&&PO(fk,e.data))},Bt=function(e,t){return e instanceof RegExp?PO(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Vt=function(e,t,n){if(!we[t]&&qt(t)&&Bt(Ce.tagNameCheck,t))return!1;if(Ue&&!Ke[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Ct(e),!0},Ht=function(e,t,n,r){return e.length===0?t:t===n||t===r?BO(t):t},Ut=function(e,t){return e===t||_(e)!==null?!1:(We&&Ot(e),!0)},Wt=function(e,n){if(Rt(de.beforeSanitizeElements,e,null),Ut(e,n))return!0;if(Ft(e))return Ct(e),!0;let r=ft(w(e));if(A=Ht(de.uponSanitizeElement,A,be,Pe),Rt(de.uponSanitizeElement,e,{tagName:r,allowedTags:A}),Ut(e,n))return!0;if(zt(e,r))return Ct(e),!0;if(we[r]||!(Ee.tagCheck instanceof Function&&Ee.tagCheck(r))&&!A[r]){let t=Vt(e,r,n);return t===!1&&Rt(de.afterSanitizeElements,e,null),t}if(C(e)===hk.element&&!St(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&PO(pk,e.innerHTML))return Ct(e),!0;if(Ae&&e.nodeType===hk.text){let n=Nt(e.textContent);e.textContent!==n&&(yO(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Rt(de.afterSanitizeElements,e,null),!1},Gt=function(e,t,r){if(Te[t]||kt(t,e)||Be&&(t===`id`||t===`name`)&&(r in n||r in mt))return!1;let i=xe[t]||Ee.attributeCheck instanceof Function&&Ee.attributeCheck(t,e);return Oe&&PO(he,t)||De&&PO(ge,t)?!0:i?Xe[t]||PO(k,TO(r,ve,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&EO(r,`data:`)===0&&Je[e]||ke&&!PO(_e,TO(r,ve,``))?!0:!r:qt(e)&&Bt(Ce.tagNameCheck,e)&&Bt(Ce.attributeNameCheck,t,e)||t===`is`&&Ce.allowCustomizedBuiltInElements&&Bt(Ce.tagNameCheck,r)},Kt=RO({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),qt=function(e){return!Kt[SO(e)]&&PO(ye,e)},Jt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return ie(r)}return r},Yt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Ft(e)||(Ct(e),!1)}catch{return Et(t,e),!1}},Xt=function(e){Rt(de.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||Ft(e))return;xe=Ht(de.uponSanitizeAttribute,xe,Se,Fe);let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0},i=n.length,a=ft(e.nodeName);for(;i--;){let o=n[i],s=o.name,c=o.namespaceURI,l=o.value,u=ft(s),d=l,f=s===`value`?d:DO(d),p=!1;if(r.attrName=u,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,r),f=r.attrValue,Ve&&(u===`id`||u===`name`)&&EO(f,He)!==0&&(Et(s,e,o),f=He+f,p=!0),je&&PO(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Et(s,e,o);continue}if(u===`attributename`&&wO(f,`href`)){Et(s,e,o);continue}if(!r.forceKeepAttr){if(!r.keepAttr){Et(s,e,o);continue}if(!j&&PO(mk,f)){Et(s,e,o);continue}if(Ae&&(f=Nt(f)),!Gt(a,u,f)){Et(s,e,o);continue}f=Jt(a,u,c,f),f!==d&&Yt(e,s,c,f)&&p&&vO(t.removed)}}Rt(de.afterSanitizeAttributes,e,null)},Zt=function(e){let t=null,n=Mt(e);for(Rt(de.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Rt(de.uponSanitizeShadowNode,t,null),Wt(t,e),Xt(t),It(t.content)&&Zt(t.content),C(t)===hk.element){let e=v(t);It(e)&&(Qt(e),Zt(e))}Rt(de.afterSanitizeShadowDOM,e,null)},Qt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Zt(e.shadow);continue}let n=e.node,r=C(n)===hk.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&ft(e)===`template`){let e=n.content;It(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);It(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(nt=!e,nt&&(e=`<!-->`),typeof e!=`string`&&!Lt(e)&&(e=VO(e),typeof e!=`string`))throw FO(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ne?(A=Pe,xe=Fe):gt(n),(de.uponSanitizeElement.length>0||de.uponSanitizeAttribute.length>0)&&(A=BO(A)),de.uponSanitizeAttribute.length>0&&(xe=BO(xe)),t.removed=[];let c=We&&typeof e!=`string`&&Lt(e);if(c){At(e);let t=w(e);if(typeof t==`string`){let n=ft(t);if(!A[n]||we[n])throw Tt(e),FO(`root node is forbidden and cannot be sanitized in-place`)}if(Ft(e))throw Tt(e),FO(`root node is clobbered and cannot be sanitized in-place`);try{Qt(e)}catch(t){throw Tt(e),t}}else if(Lt(e))i=jt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===hk.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Qt(i);else{if(!Le&&!Ae&&!Me&&e.indexOf(`<`)===-1)return T&&ze?D(e):e;if(i=jt(e),!i)return Le?null:ze?ee:``}i&&Ie&&Ct(i.firstChild);let l=c?e:i;try{let e=Mt(l);for(;o=e.nextNode();)Wt(o,l),Xt(o),It(o.content)&&Zt(o.content)}catch(n){throw c&&(Tt(e),gO(t.removed,e=>{e.element&&Ot(e.element)})),n}if(c)return gO(t.removed,e=>{e.element&&Ot(e.element)}),Ae&&Pt(e),e;if(Le){if(Ae&&Pt(i),Re)for(s=ce.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(xe.shadowroot||xe.shadowrootmode)&&(s=ue.call(r,s,!0)),s}let u=Me?i.outerHTML:i.innerHTML;return Me&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&PO(lk,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
10
|
-
`+u),Ae&&(u=Nt(u)),T&&ze?D(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(e),Ne=!0,Pe=A,Fe=xe},t.clearConfig=function(){pt=null,Ne=!1,Pe=null,Fe=null,T=E,ee=``},t.isValidAttribute=function(e,t,n){pt||gt({});let r=ft(e),i=ft(t);return Gt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&
|
|
11
|
-
]`).replace(`lheading`,
|
|
12
|
-
`),n=t.length-1;for(;n>=0&&
|
|
13
|
-
`)}function
|
|
7
|
+
`)}:null}var UC=class extends Error{status;constructor(e,t){super(e),this.status=t}},WC=/^\/h\/[a-z0-9-]+\//.exec(globalThis.location?.pathname??``)?.[0]??`/`,GC=e=>`${WC}${e.slice(1)}`,KC=null,qC=e=>void(KC=e);async function JC(e,t,n=!0){let r=await fetch(n?GC(e):e,t),i=VC(r.headers.get(BC));i&&KC?.(i);let a=await r.json().catch(()=>({}));if(!r.ok)throw new UC(a.error??r.statusText,r.status);return a}var YC=(e,t)=>JC(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),XC={hub:()=>JC(`/api/hub`),mainline:e=>JC(`/api/mainlines/${e}`),fetchRemote:(e,t)=>YC(`/api/mainlines/${e}/fetch`,{path:t}),mainlines:e=>JC(`/api/mainlines?ids=${e.map(encodeURIComponent).join(`,`)}`),sessions:()=>JC(`/api/sessions`),host:()=>JC(`/api/host`),archiveIssue:(e,t,n)=>YC(`/api/issues/${e}/archive`,{archived:t,version:n}),archiveFinding:(e,t,n)=>YC(`/api/findings/${e}/archive`,{archived:t,version:n}),archiveSession:(e,t)=>YC(`/api/sessions/${e}/archive`,{archived:t}),archiveMany:(e,t,n)=>YC(`/api/archive`,{kind:e,ids:t,archived:n}),trace:e=>JC(`/api/sessions/${e}/trace`),issues:()=>JC(`/api/issues`),findings:()=>JC(`/api/findings`),ops:()=>JC(`/api/ops`),relations:()=>JC(`/api/relations`),reveal:e=>YC(`/api/reveal`,{path:e}),archive:(e,t,n)=>YC(`/api/mainlines/${e}/archive`,{archived:t,version:n}),mainlineTitle:(e,t,n)=>YC(`/api/mainlines/${e}/title`,{title:t,version:n}),mainlineStatus:(e,t,n)=>YC(`/api/mainlines/${e}/status`,{status:t,version:n}),taskStatus:(e,t,n,r)=>YC(`/api/tasks/${e}/${t}/status`,{status:n,version:r}),check:(e,t,n,r)=>YC(`/api/check`,{ref:e,done:t,evidence:n,version:r}),sync:()=>JC(`/api/sync`),markHandled:e=>YC(`/api/sync/handled`,e===void 0?{}:{key:e}),conflict:e=>JC(`/api/sync/conflicts/${encodeURIComponent(e.split(`/`).at(-1))}`),hubs:()=>JC(`/api/hubs`,void 0,!1)},ZC=e=>GC(`/api/files/${e.split(`/`).map(encodeURIComponent).join(`/`)}`);function QC(e){let[t=``,n=``]=e.split(`#`),[r=``,i=``]=t.split(`/`);return{m:r,t:i,item:n}}function $C(e,t){try{let n=localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}}function ew(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}var Q=Qt({summary:null,mainlines:{},sessions:[],issues:[],findings:[],ops:[],relations:{hubs:[],targets:{},backlinks:{},groupMembers:{},deps:[],mainlineDeps:[],cycles:[]},sync:{remote:!1,running:!1,notices:[]},hubs:[],error:``,problems:[],sessionProblems:[],hostError:``,stale:null,note:null,paletteOpen:!1}),tw=new Set([`active`,`planning`,`paused`]);function nw(){return rw?(iw=!0,rw):(rw=(async()=>{try{do iw=!1,await aw();while(iw)}finally{rw=null}})(),rw)}var rw=null,iw=!1;async function aw(){try{await ow(),Q.stale=null,Ew()}catch(e){Q.stale=e.message||`無法連到伺服器`}}async function ow(){let e=Object.keys(Q.mainlines),t=XC.hub();t.then(e=>uw(e.mainlines.filter(e=>!e.archivedAt&&tw.has(e.status)).map(e=>e.id))).catch(()=>void 0);let n=XC.host().catch(()=>({})),[r,{sessions:i,problems:a},o,s,c,l]=await Promise.all([t,XC.sessions(),XC.issues(),XC.findings(),XC.ops(),XC.relations()]);Q.summary=r,Q.problems=r.problems,Q.sessionProblems=a??[],Q.hostError=(await n).hostError??``,Q.relations=l,Q.sessions=i,Q.issues=o,Q.findings=s,Q.ops=c;for(let e of Object.keys(Q.mainlines))r.mainlines.some(t=>t.id===e)||delete Q.mainlines[e];let u=e.filter(e=>Q.mainlines[e]);if(u.length)for(let e of await XC.mainlines(u))Q.mainlines[e.id]=e}async function sw(){try{let{sessions:e,problems:t}=await XC.sessions();Q.sessions=e,Q.sessionProblems=t??[]}catch(e){Q.stale=e.message||`無法連到伺服器`}}var cw=new Map;function lw(e){if(Q.mainlines[e])return Promise.resolve();let t=cw.get(e);return t||(t=XC.mainline(e).then(t=>void(Q.mainlines[e]=t)).finally(()=>cw.delete(e)),cw.set(e,t)),t}async function uw(e,t=[]){let n=async e=>{let t=[...new Set(e)].filter(e=>!Q.mainlines[e]&&!cw.has(e)),n=[...new Set(e)].filter(e=>cw.has(e)).map(e=>cw.get(e));if(t.length){let e=XC.mainlines(t).then(e=>{for(let t of e)Q.mainlines[t.id]=t});for(let n of t){let t=e.finally(()=>cw.delete(n));t.catch(()=>void 0),cw.set(n,t)}n.push(e)}await Promise.all(n)};try{await n(e),await n(t)}catch(e){Q.error=e.message}}qC(e=>Q.note=HC(e));async function dw(e){Q.note=null;try{return await e(),Q.error=``,!0}catch(e){return Q.error=e.message,!1}finally{await nw()}}var fw=`mainflow.syncSeen:${WC}`,pw=M(String($C(fw,``))),mw=e=>e.at<=pw.value,hw=()=>Q.sync.notices.filter(e=>!e.handled),gw=()=>hw().filter(e=>!mw(e)),_w=()=>gw().length,vw=e=>`${e.at}|${e.kind}|${e.path}`;async function yw(e){try{await XC.markHandled(e),Q.error=``}catch(e){Sw(e)}finally{await xw()}}function bw(){let e=Q.sync.notices[0]?.at;!e||e<=pw.value||(pw.value=e,ew(fw,e))}async function xw(){try{Q.sync=await XC.sync()}catch{Q.sync={remote:!1,running:!1,notices:[]}}}function Sw(e){Q.error=e.message}function Cw(e){console.error(e),Q.error=e instanceof Error?e.message:String(e)}function ww(){let e=new EventSource(GC(`/api/events`)),t;e.addEventListener(`change`,()=>{clearTimeout(t),t=setTimeout(()=>void Promise.all([nw(),xw()]).catch(Sw),150)}),e.addEventListener(`notice`,()=>void xw()),e.addEventListener(`error`,()=>void(Q.stale??=`與伺服器的連線中斷`));let n=-1/0,r=()=>{let e=Date.now();e-n<2e3||(n=e,nw())};e.addEventListener(`open`,()=>Q.stale!==null&&r()),document.addEventListener(`visibilitychange`,()=>document.visibilityState!==`hidden`&&r()),window.addEventListener(`focus`,r);let i;e.addEventListener(`session`,()=>{clearTimeout(i),i=setTimeout(()=>void sw().catch(Sw),150)})}var Tw=null;function Ew(){return Q.hubs.length>0?Promise.resolve():Tw??=Dw().finally(()=>Tw=null)}async function Dw(){try{let{hubs:e}=await XC.hubs();Q.hubs=e.map(e=>({...e,current:e.base===WC}))}catch{return}if(Q.hubs.length<2)return;let e=new EventSource(`/api/hubs/events`),t=e=>t=>{let{hub:n}=JSON.parse(t.data),r=Q.hubs.find(e=>e.name===n);r&&!r.current&&r.activity!==`notice`&&(r.activity=e)};e.addEventListener(`change`,t(`change`)),e.addEventListener(`session`,t(`change`)),e.addEventListener(`notice`,t(`notice`)),e.addEventListener(`error`,()=>{e.readyState===EventSource.CLOSED&&(e.close(),Q.hubs=[])})}var Ow=(e,t)=>e.serves.some(e=>e.startsWith(`${t}/`)||e.startsWith(`${t}#`)),kw=(e,t,n)=>e.serves.some(e=>e.startsWith(`${t}/${n}#`)),Aw=e=>e.actions.find(e=>e.status===`doing`)??e.actions.find(e=>e.status===`todo`);function jw(e){return e.title??e.description??Aw(e)?.do??e.actions.at(-1)?.do??e.id.slice(-8)}var Mw=e=>(Aw(e)??e.actions.at(-1))?.serves[0]?.match(/^m\d{3}/)?.[0],Nw=()=>Q.sessions.filter(e=>!e.archivedAt&&!e.delegatedFrom),Pw=()=>Nw().filter(e=>e.status===`active`||e.status===`paused`);function Fw(e,t){return Q.sessions.map(n=>({session:n,actions:n.actions.filter(n=>t?kw(n,e,t):Ow(n,e))})).filter(e=>e.actions.length>0)}function Iw(e){if(OC(e))return Lw(e);let t=e.split(`#`)[0],[n=``,r]=t.split(`/`),i=Q.mainlines[n],a=Q.summary?.mainlines.find(e=>e.id===n);if(r?.startsWith(`t`)){let e=i?.tasks.find(e=>e.id===r);return{id:t,title:e?.title,status:e?.status,context:a?.title}}if(r?.startsWith(`d`)){let e=i?.decisions.find(e=>e.id===r);return{id:t,title:e?.title,status:e?.status,context:a?.title}}if(/^m\d{3}$/.test(t))return{id:t,title:a?.title,status:a?.status};let o=Q.issues.find(e=>e.id===t);if(o)return{id:t,title:o.title,status:o.status};let s=Q.findings.find(e=>e.id===t);if(s)return{id:t,title:s.title,status:s.status};let c=Q.summary?.groups.find(e=>e.id===t);return c?{id:t,title:c.title,status:c.status}:{id:t}}function Lw(e){let t=OC(e),n=Q.relations.targets[e];if(n)return{id:e,title:n.title,status:n.status,context:`${t.hub} hub`};let r=Q.relations.hubs.find(e=>e.name===t.hub),i=r?r.available?`對方 hub 找不到這個項目`:`這台機器上沒有這個 hub`:`沒有登記這個 hub`;return{id:e,context:`${t.hub} hub:${i}`}}function Rw(e){for(let t of new Set(e.flatMap(e=>e&&/^m\d{3}\//.test(e)?[e.slice(0,4)]:[])))Q.summary?.mainlines.some(e=>e.id===t)&&lw(t).catch(e=>Q.error=e.message)}var zw={mainline:{label:`主脈絡`,icon:lf},phase:{label:`階段任務`,icon:tf},branch:{label:`分支任務`,icon:$d},decision:{label:`決策`,icon:Yd},issue:{label:`待辦事項`,icon:Id},finding:{label:`發現`,icon:Md},group:{label:`組`,icon:Hu},session:{label:`會話`,icon:Vu},criterion:{label:`解決條件`,icon:af},item:{label:`checklist 項目`,icon:Pd},doc:{label:`文件`,icon:gd},artifact:{label:`產物`,icon:Ad},image:{label:`圖片`,icon:hd},page:{label:`HTML 頁面`,icon:fd},view:{label:`自訂視圖`,icon:jd},link:{label:`外部連結`,icon:Nd}},Bw=e=>e?.kind===`branch`?`branch`:`phase`;function Vw(e){let t=OC(e);return t?AC(t.local)?.kind===`task`&&!t.local.includes(`#`)?`phase`:Hw(t.local):Hw(e)}function Hw(e){if(/#c\d{3}$/.test(e))return`item`;if(/#r\d{3}$/.test(e))return`criterion`;let t=AC(e);if(t)return t.kind===`task`?Bw(Q.mainlines[t.m]?.tasks.find(e=>e.id===t.t)):t.kind===`file`?Uw(t.path):t.kind===`conflict`?Uw(t.saved):t.kind}function Uw(e,t){if(t===`參考來源`)return/^https?:/.test(e)?`link`:`doc`;if(t===`自訂視圖`)return`view`;if(t===`決策`)return`decision`;let n=e.slice(e.lastIndexOf(`.`)+1).toLowerCase();return[`png`,`jpg`,`jpeg`,`gif`,`svg`,`webp`].includes(n)?`image`:n===`html`?`page`:t===`產物`&&n!==`md`?`artifact`:`doc`}var Ww=[`active`,`planning`,`paused`,`done`,`dropped`],Gw=[`todo`,`doing`,`blocked`,`done`,`dropped`],Kw={planning:`todo`,todo:`todo`,open:`todo`,active:`doing`,doing:`doing`,planned:`doing`,paused:`waiting`,blocked:`waiting`,proposed:`waiting`,done:`done`,accepted:`done`,closed:`done`,valid:`done`,ended:`done`,dropped:`off`,superseded:`off`,obsolete:`off`,"handed-off":`off`},qw=e=>Kw[e]??`todo`,Jw=new Set([`done`,`dropped`,`closed`,`obsolete`,`superseded`,`ended`,`handed-off`]),Yw={active:`進行中`,planning:`規劃中`,paused:`暫停`,done:`完成`,dropped:`放棄`,todo:`待辦`,doing:`進行中`,blocked:`卡住`,proposed:`待裁決`,accepted:`採用`,superseded:`已取代`,ended:`已結束`,"handed-off":`已交接`,open:`未處理`,planned:`已排入`,closed:`已關閉`,valid:`有效`,obsolete:`過時`},Xw={skill:`skill`,agent:`agent`,rule:`rule`,instruction:`instruction`,file:`檔案`,hook:`hook`},Zw={user:`使用者`,ai:`AI`,relay:`第三方轉達`},Qw={explicit:`明確選擇`,recommended:`照建議預設`},$w={open:`未合併`,merged:`已合併`,abandoned:`已放棄`},eT={pending:{label:`未完成`,tone:`text-warning`},met:{label:`已完成`,tone:`text-muted-foreground`},dropped:{label:`已放棄`,tone:`text-muted-foreground`},unknown:{label:`無法確認`,tone:`text-muted-foreground`}},tT=[`title`,`aria-label`],nT=I({__name:`TypeIcon`,props:{type:{},status:{}},setup(e){let t=e,n={todo:`text-status-todo`,doing:`text-status-doing`,waiting:`text-status-waiting`,done:`text-status-done`,off:`text-status-off`},r=J(()=>t.type?zw[t.type]:void 0),i=J(()=>[r.value?.label,t.status?Yw[t.status]??t.status:``].filter(Boolean).join(`・`));return(t,a)=>r.value?(B(),V(`span`,{key:0,class:`inline-flex shrink-0`,title:i.value,role:`img`,"aria-label":i.value},[(B(),H(fa(r.value.icon),{class:k([`size-3.5`,e.status?n[N(qw)(e.status)]:`text-muted-foreground`])},null,8,[`class`]))],8,tT)):K(``,!0)}}),rT={class:`palette`,role:`dialog`,"aria-label":`指令面板`},iT=[`onMouseenter`,`onClick`],aT={class:`label`},oT={class:`hint`},sT={key:0,class:`none`},cT=I({__name:`CommandPalette`,setup(e){let t=ep(),n=M(``),r=M(0),i=M(null),a=J(()=>[{label:`總覽`,hint:`頁面`,to:`/`},{label:`主脈絡`,hint:`頁面`,to:`/mainlines`},{label:`會話`,hint:`頁面`,to:`/sessions`},...(Q.summary?.mainlines??[]).map(e=>({label:`${e.id} ${e.title}`,hint:e.archivedAt?`主脈絡 · 已封存`:`主脈絡`,to:`/mainlines/${e.id}`,type:`mainline`,status:e.status})),...Object.values(Q.mainlines).flatMap(e=>e.tasks.map(t=>({label:`${e.id}/${t.id} ${t.title}`,hint:`任務`,to:`/mainlines/${e.id}/tasks/${t.id}`,type:Bw(t),status:t.status}))),...Q.sessions.map(e=>({label:`${jw(e)} ${e.id.slice(-8)}`,hint:`會話`,to:`/sessions/${e.id}`,type:`session`,status:e.status}))]),o=J(()=>{let e=n.value.trim().toLowerCase();return(e?a.value.filter(t=>t.label.toLowerCase().includes(e)):a.value).slice(0,12)});F(n,()=>r.value=0),F(()=>Q.paletteOpen,e=>{e&&(n.value=``,tr(()=>i.value?.focus()))});function s(e){(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),Q.paletteOpen=!Q.paletteOpen)}function c(e){e&&(Q.paletteOpen=!1,t.push(e.to))}function l(e){let t=o.value.length;t>0&&(r.value=(r.value+e+t)%t)}return $i(()=>window.addEventListener(`keydown`,s)),na(()=>window.removeEventListener(`keydown`,s)),(e,t)=>N(Q).paletteOpen?(B(),V(`div`,{key:0,class:`overlay`,onClick:t[5]||=au(e=>N(Q).paletteOpen=!1,[`self`])},[U(`div`,rT,[yr(U(`input`,{ref_key:`input`,ref:i,"onUpdate:modelValue":t[0]||=e=>n.value=e,class:`search`,placeholder:`搜尋主脈絡、任務、會話…`,onKeydown:[t[1]||=su(au(e=>l(1),[`prevent`]),[`down`]),t[2]||=su(au(e=>l(-1),[`prevent`]),[`up`]),t[3]||=su(au(e=>c(o.value[r.value]),[`prevent`]),[`enter`]),t[4]||=su(e=>N(Q).paletteOpen=!1,[`esc`])]},null,544),[[Wl,n.value]]),U(`ul`,null,[(B(!0),V(z,null,L(o.value,(e,t)=>(B(),V(`li`,{key:e.to,class:k({active:t===r.value}),onMouseenter:e=>r.value=t,onClick:t=>c(e)},[U(`span`,aT,[W(nT,{type:e.type,status:e.status},null,8,[`type`,`status`]),G(j(e.label),1)]),U(`span`,oT,j(e.hint),1)],42,iT))),128)),o.value.length===0?(B(),V(`li`,sT,`沒有符合的項目`)):K(``,!0)])])])):K(``,!0)}}),lT=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},uT=lT(cT,[[`__scopeId`,`data-v-8755e91b`]]),dT={key:0,class:`mx-auto max-w-xl px-6 py-16 text-center`,role:`alert`,"data-error-boundary":``},fT={class:`mt-1 text-sm text-muted-foreground`,"data-error-message":``},pT=I({__name:`ErrorBoundary`,props:{resetKey:{}},setup(e){let t=e,n=M(null);return sa(e=>(console.error(e),n.value=e instanceof Error?e:Error(String(e)),!1)),F(()=>t.resetKey,()=>n.value=null),(e,t)=>n.value?(B(),V(`div`,dT,[W(N(Qu),{class:`mx-auto mb-3 size-6 text-destructive`}),t[2]||=U(`p`,{class:`font-medium`},`這個頁面顯示時出錯了`,-1),U(`p`,fT,j(n.value.message),1),W(N(sC),{variant:`outline`,size:`sm`,class:`mt-4`,"data-retry":``,onClick:t[0]||=e=>n.value=null},{default:P(()=>[...t[1]||=[G(`重試`,-1)]]),_:1})])):R(e.$slots,`default`,{},void 0,void 0,1)}}),mT={key:0,class:`banner`,role:`alert`,"data-stale":``},hT={class:`flex-1`},gT={class:`cursor-pointer`},_T={class:`mt-2 space-y-1`},vT={class:`break-all`},yT={class:`text-muted-foreground`},bT={key:0,class:`text-muted-foreground`},xT=50,ST=lT(I({__name:`HubStatus`,setup(e){let t=J(()=>[...Q.problems,...Q.sessionProblems]),n=J(()=>new Set(t.value.map(e=>e.file)).size),r=J(()=>t.value.slice(0,xT));return(e,i)=>(B(),V(z,null,[N(Q).stale===null?K(``,!0):(B(),V(`p`,mT,[W(N(Qu),{class:`size-4 shrink-0 text-warning`}),U(`span`,hT,`資料可能過時:`+j(N(Q).stale),1),W(N(sC),{variant:`outline`,size:`xs`,"data-reload":``,onClick:i[0]||=e=>N(nw)()},{default:P(()=>[W(N(Kd),{class:`size-3`}),i[1]||=G(`重新載入`,-1)]),_:1})])),N(Q).hostError?(B(),H(N(_g),{key:1,variant:`warning`,class:`status-alert`,role:`alert`,"data-host-error":``},{default:P(()=>[W(N(Qd)),W(N(yg),null,{default:P(()=>[...i[2]||=[G(`主機名稱不可用`,-1)]]),_:1}),W(N(vg),null,{default:P(()=>[G(j(N(Q).hostError),1)]),_:1})]),_:1})):K(``,!0),t.value.length?(B(),H(N(_g),{key:2,variant:`warning`,class:`status-alert`,role:`alert`,"data-problems":``},{default:P(()=>[W(N(md)),W(N(yg),null,{default:P(()=>[G(`有 `+j(n.value)+` 個檔案讀不到或有問題`,1)]),_:1}),W(N(vg),null,{default:P(()=>[U(`details`,null,[U(`summary`,gT,`共 `+j(t.value.length)+` 筆,讀不到的檔案不在列表裡`,1),U(`ul`,_T,[(B(!0),V(z,null,L(r.value,(e,t)=>(B(),V(`li`,{key:t,"data-problem":``},[U(`code`,vT,j(e.file),1),U(`span`,yT,`:`+j(e.field?`${e.field},`:``)+j(e.message),1)]))),128)),t.value.length>r.value.length?(B(),V(`li`,bT,`還有 `+j(t.value.length-r.value.length)+` 筆`,1)):K(``,!0)])])]),_:1})]),_:1})):K(``,!0)],64))}}),[[`__scopeId`,`data-v-ee1ac6ae`]]);async function CT(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}}var wT=`[data-peek-list] [data-peek]`,TT=`is-cursor`;function ET(e){let t=e;return!!t&&(t.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(t.tagName))}function DT(e){let t=AC(e);return t?t.kind===`session`?t.id:t.kind===`file`?t.path:t.ref:e}function OT(){let{current:e,open:t,close:n}=FC(),r=()=>[...document.querySelectorAll(wT)].filter(e=>e.offsetParent!==null);function i(n){let i=r();if(!i.length)return;let a=i.findIndex(t=>t.classList.contains(TT)||t.dataset.peek===e.value?.ref),o=i[Math.min(i.length-1,Math.max(0,a+n))];for(let e of i)e.classList.toggle(TT,e===o);o.scrollIntoView({block:`nearest`}),e.value&&t(o.dataset.peek)}async function a(e,t){NC(await CT(e)?`已複製${t}`:`無法複製${t}`)}function o(r){if(Q.paletteOpen||ET(r.target))return;let o=r.metaKey||r.ctrlKey,s=()=>document.querySelector(`${wT}.${TT}`)?.dataset.peek;if(o&&!r.shiftKey&&r.key===`.`){let t=e.value?.ref??s();t&&(r.preventDefault(),a(DT(t),` ID`));return}if(o&&r.shiftKey&&(r.key===`,`||r.key===`<`)){r.preventDefault(),a(window.location.href,`連結`);return}if(!(o||r.altKey)){if(r.key===`j`||r.key===`k`)r.preventDefault(),i(r.key===`j`?1:-1);else if(r.key===`Enter`){let e=s();e&&(r.preventDefault(),t(e))}else r.key===`Escape`&&e.value&&n()}}$i(()=>window.addEventListener(`keydown`,o)),na(()=>window.removeEventListener(`keydown`,o))}var kT={class:`brand`},AT={class:`truncate`},jT={key:0,class:`size-1.5 shrink-0 rounded-full bg-status-done`,title:`其他 hub 有新變動`},MT={class:`flex min-w-0 flex-1 flex-col`},NT={key:0,class:`truncate text-xs text-muted-foreground`},PT={key:1,class:`text-xs text-muted-foreground`},FT={key:0,class:`text-xs text-warning`},IT={key:1,class:`text-xs text-status-done`},LT={key:1,class:`truncate`},RT=[`aria-label`,`aria-expanded`],zT=[`aria-label`,`title`],BT=[`title`],VT={key:0,class:`flex-1 text-left`},HT={key:1},UT={key:0,class:`count`},WT={class:`truncate`},GT={class:`main`},KT={key:0,class:`banner`,role:`alert`},qT={class:`flex-1`},JT={key:1,class:`banner`,role:`status`,"data-write-note":``},YT=[`title`],XT=[`title`],ZT={class:`page`},QT={key:1,class:`px-6 py-16 text-center text-muted-foreground`},$T={key:2,class:`px-6 py-16 text-center text-muted-foreground`,"data-load-failed":``},eE=`mainflow.sidebarCollapsed`,tE=lT(I({__name:`App`,setup(e){let t=tp();OT(),$i(async()=>{await Promise.all([nw(),xw()]),ww(),Ew()});let n=e=>window.location.assign(e),r=J(()=>Q.hubs.some(e=>!e.current&&e.activity)),i=M(!!$C(eE,!1));function a(){i.value=!i.value,ew(eE,i.value)}let o=M(!1),s=Nf(`(max-width: 720px)`),c=J(()=>i.value&&!s.value);F(()=>t.fullPath,()=>o.value=!1);let l=J(()=>(Q.summary?.mainlines??[]).filter(e=>!e.archivedAt&&(e.status===`active`||e.status===`planning`||e.status===`paused`))),u=[{to:`/`,label:`總覽`,icon:kd,exact:!0},{to:`/mainlines`,label:`主脈絡`,icon:zw.mainline.icon},{to:`/sessions`,label:`會話`,icon:zw.session.icon},{to:`/issues`,label:`待辦事項`,icon:zw.issue.icon,count:()=>Q.summary?.openIssues},{to:`/findings`,label:`發現`,icon:zw.finding.icon,count:()=>Q.summary?.validFindings},{to:`/ops`,label:`操作紀錄`,icon:Xd},{to:`/sync`,label:`同步提醒`,icon:Kd,count:()=>hw().length||void 0,shown:()=>Q.sync.remote||Q.sync.notices.length>0}],d=e=>e.exact?t.path===e.to:t.path.startsWith(e.to);return(e,i)=>(B(),V(`div`,{class:k([`layout`,{collapsed:c.value}])},[U(`nav`,{class:k([`sidebar`,{"menu-open":o.value}]),"aria-label":`範圍`},[U(`div`,kT,[!c.value&&N(Q).hubs.length>1?(B(),H(N(lC),{key:0},{default:P(()=>[W(N(SC),{class:`hub-switch`,"aria-label":`切換 hub`},{default:P(()=>[U(`span`,AT,j(N(Q).summary?.hub??`mainflow`),1),r.value?(B(),V(`span`,jT)):K(``,!0),W(N(Zu),{class:`size-3.5 shrink-0 text-muted-foreground`})]),_:1}),W(N(fC),{align:`start`,class:`w-64`},{default:P(()=>[W(N(mC),{class:`text-xs text-muted-foreground`},{default:P(()=>[...i[5]||=[G(`切換 hub`,-1)]]),_:1}),(B(!0),V(z,null,L(N(Q).hubs,e=>(B(),H(N(pC),{key:e.name,disabled:!e.available||e.current,"data-hub":e.name,onSelect:t=>n(e.base)},{default:P(()=>[U(`span`,MT,[U(`span`,{class:k([`truncate`,{"font-medium":e.current}])},j(e.name),3),e.available?e.current?(B(),V(`span`,PT,`目前的 hub`)):K(``,!0):(B(),V(`span`,NT,j(e.reason),1))]),e.activity===`notice`?(B(),V(`span`,FT,`新提醒`)):e.activity===`change`?(B(),V(`span`,IT,`有變動`)):K(``,!0)]),_:2},1032,[`disabled`,`data-hub`,`onSelect`]))),128))]),_:1})]),_:1})):c.value?K(``,!0):(B(),V(`span`,LT,j(N(Q).summary?.hub??`mainflow`),1)),U(`button`,{class:`icon-toggle menu-toggle`,"aria-label":o.value?`關閉選單`:`開啟選單`,"aria-expanded":o.value,onClick:i[0]||=e=>o.value=!o.value},[W(N(zd),{class:`size-4`})],8,RT),U(`button`,{class:`icon-toggle collapse-toggle`,"aria-label":c.value?`展開側欄`:`收合側欄`,title:c.value?`展開側欄`:`收合側欄`,onClick:a},[c.value?(B(),H(N(Ud),{key:0,class:`size-4`})):(B(),H(N(Hd),{key:1,class:`size-4`}))],8,zT)]),U(`button`,{class:`search`,title:c.value?`搜尋(⌘K)`:void 0,onClick:i[1]||=e=>N(Q).paletteOpen=!0},[W(N(Zd),{class:`size-4 shrink-0`}),c.value?K(``,!0):(B(),V(`span`,VT,`搜尋`)),c.value?K(``,!0):(B(),V(`kbd`,HT,`⌘K`))],8,BT),(B(!0),V(z,null,L(u.filter(e=>!e.shown||e.shown()),e=>(B(),H(N(Am),{key:e.to,to:e.to,class:k([`nav`,{current:d(e)}]),title:c.value?e.label:void 0},{default:P(()=>[(B(),H(fa(e.icon),{class:`size-4 shrink-0`})),c.value?K(``,!0):(B(),V(z,{key:0},[G(j(e.label),1),e.count?.()?(B(),V(`span`,UT,j(e.count()),1)):K(``,!0)],64))]),_:2},1032,[`to`,`class`,`title`]))),128)),c.value?K(``,!0):(B(),V(z,{key:0},[i[6]||=U(`div`,{class:`nav-label`},`進行中的主脈絡`,-1),(B(!0),V(z,null,L(l.value,e=>(B(),H(N(Am),{key:e.id,to:`/mainlines/${e.id}`,class:`nav sub`,"active-class":`current`},{default:P(()=>[W(nT,{type:`mainline`,status:e.status},null,8,[`status`]),U(`span`,WT,j(e.title),1)]),_:2},1032,[`to`]))),128))],64))],2),U(`main`,GT,[N(Q).error?(B(),V(`p`,KT,[W(N(Qu),{class:`size-4 shrink-0 text-destructive`}),U(`span`,qT,j(N(Q).error),1),W(N(sC),{variant:`ghost`,size:`xs`,onClick:i[2]||=e=>N(Q).error=``},{default:P(()=>[...i[7]||=[G(`關閉`,-1)]]),_:1})])):K(``,!0),N(Q).note?(B(),V(`p`,JT,[W(N(id),{class:`size-4 shrink-0 text-warning`}),U(`span`,{class:`flex-1`,title:N(Q).note.detail||void 0},j(N(Q).note.text),9,YT),W(N(sC),{variant:`ghost`,size:`xs`,onClick:i[3]||=e=>N(Q).note=null},{default:P(()=>[...i[8]||=[G(`關閉`,-1)]]),_:1})])):K(``,!0),W(ST),N(_w)()>0&&N(t).path!==`/sync`?(B(),H(N(_g),{key:2,variant:`warning`,class:`sync-alert`,role:`alert`,"data-sync-alert":``},{default:P(()=>[W(N(of)),W(N(yg),null,{default:P(()=>[G(`同步有 `+j(N(_w)())+` 則新提醒`,1)]),_:1}),W(N(vg),{class:`flex min-w-0 items-center gap-2`},{default:P(()=>[U(`span`,{class:`min-w-0 flex-1 truncate`,title:N(gw)()[0]?.message},j(N(gw)()[0]&&N(zC)(N(gw)()[0])),9,XT),W(N(sC),{variant:`outline`,size:`xs`,"as-child":``},{default:P(()=>[W(N(Am),{to:`/sync`},{default:P(()=>[...i[9]||=[G(`查看`,-1)]]),_:1})]),_:1}),W(N(sC),{variant:`ghost`,size:`xs`,onClick:i[4]||=e=>N(bw)()},{default:P(()=>[...i[10]||=[G(`略過`,-1)]]),_:1})]),_:1})]),_:1})):K(``,!0),U(`div`,ZT,[N(Q).summary?(B(),H(pT,{key:0,"reset-key":N(t).fullPath},{default:P(()=>[W(N(Lm))]),_:1},8,[`reset-key`])):N(Q).stale===null?(B(),V(`p`,QT,`載入中…`)):(B(),V(`p`,$T,`讀不到這個 hub 的資料`))])]),W(uT)],2))}}),[[`__scopeId`,`data-v-1b0517af`]]),nE=I({__name:`Badge`,props:{asChild:{type:Boolean},as:{},variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Sf(t,`class`);return(r,i)=>(B(),H(N(fv),q({"data-slot":`badge`,class:N(gg)(N(rE)({variant:e.variant}),t.class)},N(n)),{default:P(()=>[R(r.$slots,`default`)]),_:3},16,[`class`]))}}),rE=Um(`inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`}},defaultVariants:{variant:`default`}}),iE=I({__name:`ArchiveButton`,props:{archived:{type:Boolean}},emits:[`toggle`],setup(e){return(t,n)=>(B(),H(N(sC),{variant:`ghost`,size:`xs`,class:`text-muted-foreground`,onClick:n[0]||=au(e=>t.$emit(`toggle`),[`stop`])},{default:P(()=>[e.archived?(B(),H(N(Nu),{key:0})):(B(),H(N(Pu),{key:1})),G(j(e.archived?`取消封存`:`封存`),1)]),_:1}))}}),aE=`(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)`;RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}${aE}?$`),RegExp(`^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}${aE}?)?$`);var oE=RegExp(`^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})(${aE})?$`);function sE(e){let t=oE.exec(e);if(!t)return NaN;let[,n,r,i,a,o,s]=t;return s?Date.parse(`${n}-${r}-${i}T${a}:${o}:00${s}`):new Date(Number(n),Number(r)-1,Number(i),Number(a),Number(o)).getTime()}var cE=e=>e.length===10?new Date(`${e}T00:00`).getTime():sE(e),lE=e=>new Date(cE(e)).toLocaleString(`sv-SE`),uE=e=>e.length===10?e:lE(e).slice(0,10),dE=e=>lE(e).slice(11,16),fE=e=>e.length===10?e:lE(e).slice(0,16),pE=()=>new Date().toLocaleDateString(`sv-SE`);function mE(e){return Math.round((new Date(`${e.slice(0,10)}T00:00`).getTime()-new Date(`${pE()}T00:00`).getTime())/864e5)}function hE(e){if(!e)return;let t=mE(e);return t<0?`overdue`:t<=7?`soon`:void 0}var gE=[`title`],_E=I({__name:`DueDate`,props:{day:{},ended:{type:Boolean}},setup(e){let t=e,n=J(()=>t.ended?void 0:hE(t.day)),r=J(()=>{if(!t.day||!n.value)return t.day??``;let e=mE(t.day);return e<0?`已逾期 ${-e} 天`:e===0?`今天到期`:`${e} 天後到期`});return(t,i)=>e.day?(B(),V(`span`,{key:0,class:k([`inline-flex items-center gap-1 text-xs tabular-nums`,n.value?`text-foreground`:`text-muted-foreground`]),title:r.value},[n.value?(B(),H(N(Wu),{key:0,class:k([`size-3.5`,n.value===`overdue`?`text-destructive`:`text-warning`])},null,8,[`class`])):K(``,!0),G(j(e.day),1)],10,gE)):K(``,!0)}}),vE=I({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(e,t)=>(B(),H(N(Kx),q({"data-slot":`checkbox`},N(i),{class:N(gg)(`peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50`,n.class)}),{default:P(t=>[W(N(qx),{"data-slot":`checkbox-indicator`,class:`grid place-content-center text-current transition-none`},{default:P(()=>[R(e.$slots,`default`,A(Cs(t)),()=>[W(N(qu),{class:`size-3.5`})])]),_:2},1024)]),_:3},16,[`class`]))}}),yE=I({__name:`TableBody`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`tbody`,{"data-slot":`table-body`,class:k(N(gg)(`[&_tr:last-child]:border-0`,t.class))},[R(e.$slots,`default`)],2))}}),bE=I({__name:`TableCell`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`td`,{"data-slot":`table-cell`,class:k(N(gg)(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5`,t.class))},[R(e.$slots,`default`)],2))}}),xE=I({__name:`TableRow`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`tr`,{"data-slot":`table-row`,class:k(N(gg)(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,t.class))},[R(e.$slots,`default`)],2))}}),SE=I({__name:`TableHead`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`th`,{"data-slot":`table-head`,class:k(N(gg)(`text-muted-foreground h-9 px-2 text-left align-middle text-xs font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5`,t.class))},[R(e.$slots,`default`)],2))}}),CE=I({__name:`TableHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`thead`,{"data-slot":`table-header`,class:k(N(gg)(`[&_tr]:border-b`,t.class))},[R(e.$slots,`default`)],2))}}),wE=[`title`],TE=I({__name:`PriorityFlag`,props:{priority:{}},setup(e){let t={P0:`text-priority-p0`,P1:`text-priority-p1`,P3:`text-priority-p3`};return(n,r)=>e.priority&&e.priority!==`P2`?(B(),V(`span`,{key:0,class:`inline-flex items-center gap-1 text-xs text-muted-foreground`,title:`優先度 ${e.priority}`},[W(N(_d),{class:k([`size-3.5`,t[e.priority]]),fill:`currentColor`},null,8,[`class`]),G(j(e.priority),1)],8,wE)):K(``,!0)}}),EE=[`aria-label`],DE={key:0,cx:`7`,cy:`7`,r:`5.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-dasharray":`2.2 2`},OE=I({__name:`StatusIcon`,props:{status:{}},setup(e){let t=e,n={todo:`dashed`,doing:`half`,waiting:`pause`,done:`check`,off:`cross`},r={todo:`text-status-todo`,doing:`text-status-doing`,waiting:`text-status-waiting`,done:`text-status-done`,off:`text-status-off`},i=J(()=>qw(t.status)),a=J(()=>t.status===`handed-off`?`arrow`:n[i.value]);return(t,n)=>(B(),V(`svg`,{class:k([`shrink-0`,r[i.value]]),width:`14`,height:`14`,viewBox:`0 0 14 14`,role:`img`,"aria-label":N(Yw)[e.status]??e.status},[a.value===`dashed`?(B(),V(`circle`,DE)):a.value===`half`?(B(),V(z,{key:1},[n[0]||=U(`circle`,{cx:`7`,cy:`7`,r:`5.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},null,-1),n[1]||=U(`path`,{d:`M7 3.5 A3.5 3.5 0 0 1 7 10.5 Z`,fill:`currentColor`},null,-1)],64)):a.value===`pause`?(B(),V(z,{key:2},[n[2]||=U(`circle`,{cx:`7`,cy:`7`,r:`5.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},null,-1),n[3]||=U(`path`,{d:`M5.5 5v4M8.5 5v4`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`},null,-1)],64)):a.value===`check`?(B(),V(z,{key:3},[n[4]||=U(`circle`,{cx:`7`,cy:`7`,r:`6.25`,fill:`currentColor`},null,-1),n[5]||=U(`path`,{d:`M4.5 7.2l1.7 1.7 3.4-3.6`,fill:`none`,stroke:`var(--background)`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)],64)):a.value===`arrow`?(B(),V(z,{key:4},[n[6]||=U(`circle`,{cx:`7`,cy:`7`,r:`6.25`,fill:`currentColor`},null,-1),n[7]||=U(`path`,{d:`M4.5 7h5M7.5 5l2 2-2 2`,fill:`none`,stroke:`var(--background)`,"stroke-width":`1.4`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)],64)):(B(),V(z,{key:5},[n[8]||=U(`circle`,{cx:`7`,cy:`7`,r:`6.25`,fill:`currentColor`},null,-1),n[9]||=U(`path`,{d:`M5 5l4 4M9 5l-4 4`,stroke:`var(--background)`,"stroke-width":`1.4`,"stroke-linecap":`round`},null,-1)],64))],10,EE))}}),kE=I({__name:`StatusBadge`,props:{status:{}},setup(e){return(t,n)=>(B(),H(N(nE),{variant:`outline`,class:`h-[22px] gap-1.5 [&>svg]:size-3.5`},{default:P(()=>[W(OE,{status:e.status},null,8,[`status`]),G(j(N(Yw)[e.status]??e.status),1)]),_:1}))}}),AE={key:0,class:`w-full caption-bottom text-body`},jE=[`title`,`onClick`],ME={key:0,class:`group/ghead`},NE=[`colspan`],PE={class:`flex min-w-0 items-center gap-2 text-sm`},FE={key:1,class:`-ml-1 size-5 shrink-0`},IE=[`aria-label`,`aria-expanded`,`onClick`],LE=[`data-peek`,`aria-current`,`onClick`],RE={class:`shrink-0 font-mono text-xs text-muted-foreground`},zE={class:`truncate font-medium`},BE=[`data-peek`,`aria-current`,`onClick`],VE={class:`shrink-0 font-mono text-xs text-muted-foreground`},HE=[`title`],UE={key:6,class:`font-medium`},WE={key:7,class:`text-xs text-muted-foreground tabular-nums`},GE={class:`shrink-0 text-xs text-muted-foreground`,"data-group-priority":``},KE=[`title`],qE=[`title`],JE={class:`opacity-0 transition-opacity group-hover/row:opacity-100 focus-within:opacity-100`},YE={key:0},XE=[`colspan`],ZE={key:1},QE=[`colspan`],$E={key:1,class:`px-6 py-16 text-center text-sm text-muted-foreground`},eD=I({__name:`ListTable`,props:{view:{},columns:{},itemRef:{type:Function},itemType:{type:Function},selection:{},limit:{}},setup(e){let t=e,{open:n,current:r}=FC(),i=e=>t.itemRef?.(e),a=e=>i(e)!==void 0&&r.value?.ref===i(e)||void 0;function o(e){let t=i(e);t&&n(t)}let s=e=>e.flatMap(e=>[{item:e,depth:0},...t.view.spec.nested?.(e)??[]]),c=J(()=>t.limit??1/0),l=M({}),u=e=>l.value[e]??c.value,d=e=>l.value={...l.value,[e]:u(e)+c.value},f=e=>s([...e.items,...!t.view.endedFolded.has(e.key)||e.items.length===0&&!e.key?e.ended:[]]),p=e=>!(e==null||e===``||Array.isArray(e)&&e.length===0),m=J(()=>{let e=s(t.view.groups.value.flatMap(e=>[...e.leader?[e.leader]:[],...e.items,...e.ended])).map(e=>e.item);return t.columns.filter((t,n)=>n===0||!t.value||e.some(e=>p(t.value(e))))}),h=()=>m.value.length+(t.selection?2:1),g=(e,n)=>n===0?[`w-full max-w-0 min-w-48`,t.selection?`pl-2`:`pl-6`]:[`w-px whitespace-nowrap`,e.optional&&`@max-3xl:hidden`,e.class],_=(e,n)=>t.selection?.active.value||n?``:`opacity-0 ${e}:opacity-100 focus-visible:opacity-100`,v=e=>{let{field:n,dir:r,chosen:i}=t.view.sort.value;return i&&e.sort===n.key?r:void 0};function y(e){let t=v(e);return t===`desc`?`改為由小到大`:t===`asc`?`取消排序,回到預設順序`:`由大到小排序`}return(t,s)=>e.view.groups.value.length?(B(),V(`table`,AE,[W(N(CE),{class:`sticky top-0 z-10 bg-background [&_tr]:border-b`},{default:P(()=>[W(N(xE),{class:`group/head hover:bg-transparent`},{default:P(()=>[e.selection?(B(),H(N(SE),{key:0,class:`w-px pr-0 pl-6`},{default:P(()=>[W(N(vE),{"model-value":e.selection.all.value,class:k(_(`group-hover/head`)),"aria-label":`全選`,"onUpdate:modelValue":s[0]||=t=>e.selection.setAll(t===!0)},null,8,[`model-value`,`class`])]),_:1})):K(``,!0),(B(!0),V(z,null,L(m.value,(t,n)=>(B(),H(N(SE),{key:t.key,class:k(g(t,n)),"aria-sort":v(t)===`desc`?`descending`:v(t)===`asc`?`ascending`:void 0},{default:P(()=>[t.sort&&e.view.spec.sorts.some(e=>e.key===t.sort)?(B(),V(`button`,{key:0,type:`button`,class:k([`group/sort -mx-1 inline-flex items-center gap-1 rounded-sm px-1 hover:bg-accent hover:text-foreground`,{"text-foreground":v(t)}]),title:y(t),onClick:n=>e.view.cycleSort(t.sort)},[G(j(t.label)+` `,1),v(t)===`desc`?(B(),H(N(Iu),{key:0,class:`size-3`})):v(t)===`asc`?(B(),H(N(Bu),{key:1,class:`size-3`})):(B(),H(N(Lu),{key:2,class:`size-3 opacity-0 group-hover/sort:opacity-100`}))],10,jE)):(B(),V(z,{key:1},[G(j(t.label),1)],64))]),_:2},1032,[`class`,`aria-sort`]))),128)),W(N(SE),{class:`w-px pr-6`},{default:P(()=>[...s[3]||=[U(`span`,{class:`sr-only`},`操作`,-1)]]),_:1})]),_:1})]),_:1}),(B(!0),V(z,null,L(e.view.groups.value,l=>(B(),H(N(yE),{key:l.key,class:`[&_tr:last-child]:border-b`},{default:P(()=>[l.key?(B(),V(`tr`,ME,[U(`td`,{colspan:h(),class:`sticky top-9 z-[5] bg-background px-6 pt-4 pb-1`},[U(`div`,PE,[e.selection?(B(),H(N(vE),{key:0,"model-value":e.selection.groupChecked(l),class:k([`mr-1`,_(`group-hover/ghead`)]),"aria-label":`選取分組 ${l.label}`,"onUpdate:modelValue":t=>e.selection.setGroup(l,t===!0)},null,8,[`model-value`,`class`,`aria-label`,`onUpdate:modelValue`])):K(``,!0),l.leader&&l.items.length+l.ended.length===0?(B(),V(`span`,FE)):(B(),V(`button`,{key:2,type:`button`,class:`-ml-1 grid size-5 shrink-0 place-items-center rounded-sm hover:bg-accent`,"aria-label":e.view.collapsed.has(l.key)?`展開分組`:`收合分組`,"aria-expanded":!e.view.collapsed.has(l.key),onClick:t=>e.view.toggleCollapsed(l.key)},[e.view.collapsed.has(l.key)?(B(),H(N(Xu),{key:1,class:`size-4 text-muted-foreground`})):(B(),H(N(Ju),{key:0,class:`size-4 text-muted-foreground`}))],8,IE)),l.leader?(B(),V(`button`,{key:3,type:`button`,class:k([`-mx-1 flex min-w-0 items-center gap-2 rounded-sm px-1 hover:bg-accent/50`,{"bg-muted":a(l.leader)}]),"data-peek":i(l.leader),"aria-current":a(l.leader),onClick:e=>o(l.leader)},[e.itemType?(B(),H(nT,{key:0,type:e.itemType(l.leader),status:l.status},null,8,[`type`,`status`])):l.status?(B(),H(OE,{key:1,status:l.status,class:`shrink-0`},null,8,[`status`])):K(``,!0),U(`span`,RE,j(e.view.spec.id(l.leader)),1),U(`span`,zE,j(l.label),1)],10,LE)):l.detail?(B(),V(`button`,{key:4,type:`button`,class:k([`-mx-1 flex min-w-0 shrink-0 items-center gap-2 rounded-sm px-1 hover:bg-accent/50`,{"bg-muted":N(r)?.ref===l.detail.ref}]),"data-peek":l.detail.ref,"aria-current":N(r)?.ref===l.detail.ref||void 0,onClick:e=>N(n)(l.detail.ref)},[W(nT,{type:`group`,status:l.detail.status},null,8,[`status`]),U(`span`,VE,j(l.detail.ref),1),U(`span`,{class:`max-w-80 truncate font-medium`,title:l.detail.title},j(l.detail.title),9,HE)],10,BE)):l.status?(B(),H(kE,{key:5,status:l.status},null,8,[`status`])):(B(),V(`span`,UE,j(l.label),1)),l.items.length+l.ended.length?(B(),V(`span`,WE,j(l.items.length+l.ended.length),1)):K(``,!0),l.detail?(B(),V(z,{key:8},[U(`span`,GE,[W(TE,{priority:l.detail.priority},null,8,[`priority`]),!l.detail.priority||l.detail.priority===`P2`?(B(),V(z,{key:0},[G(`P2`)],64)):K(``,!0)]),l.detail.trigger?(B(),V(`span`,{key:0,class:`flex min-w-0 shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`時機:${l.detail.trigger}`,"data-group-trigger":``},[W(N(rd),{class:`size-3.5 shrink-0`}),G(j(l.detail.trigger),1)],8,KE)):K(``,!0),l.detail.summary?(B(),V(`span`,{key:1,class:`min-w-0 truncate text-xs text-muted-foreground`,title:l.detail.summary,"data-group-summary":``},j(l.detail.summary),9,qE)):K(``,!0)],64)):K(``,!0)])],8,NE)])):K(``,!0),e.view.collapsed.has(l.key)?K(``,!0):(B(),V(z,{key:1},[(B(!0),V(z,null,L(f(l).slice(0,u(l.key)),({item:n,depth:r})=>(B(),H(N(xE),{key:e.view.spec.id(n),class:`group/row h-9 transition-colors duration-[120ms]`,"data-peek":i(n),"aria-current":a(n),"data-state":e.selection?.has(n)?`selected`:void 0,onClick:e=>o(n)},{default:P(()=>[e.selection?(B(),H(N(bE),{key:0,class:`w-px pr-0 pl-6`,onClick:s[1]||=au(()=>{},[`stop`])},{default:P(()=>[W(N(vE),{"model-value":e.selection.has(n),class:k(_(`group-hover/row`,e.selection.has(n))),"aria-label":`選取 ${e.view.spec.id(n)}`,"onUpdate:modelValue":t=>e.selection.toggle(n,t===!0)},null,8,[`model-value`,`class`,`aria-label`,`onUpdate:modelValue`])]),_:2},1024)):K(``,!0),(B(!0),V(z,null,L(m.value,(e,i)=>(B(),H(N(bE),{key:e.key,class:k(g(e,i))},{default:P(()=>[R(t.$slots,e.key,{item:n,depth:r})]),_:2},1032,[`class`]))),128)),W(N(bE),{class:`w-px pr-6 text-right whitespace-nowrap`,onClick:s[2]||=au(()=>{},[`stop`])},{default:P(()=>[U(`span`,JE,[R(t.$slots,`actions`,{item:n})])]),_:2},1024)]),_:2},1032,[`data-peek`,`aria-current`,`data-state`,`onClick`]))),128)),f(l).length>u(l.key)?(B(),V(`tr`,YE,[U(`td`,{colspan:h(),class:`px-4 py-1`},[W(N(sC),{variant:`ghost`,size:`xs`,class:`text-muted-foreground`,onClick:e=>d(l.key)},{default:P(()=>[W(N(Ju)),G(`再顯示 `+j(Math.min(c.value,f(l).length-u(l.key)))+` 個,還有 `+j(f(l).length-u(l.key))+` 個`,1)]),_:2},1032,[`onClick`])],8,XE)])):K(``,!0),l.ended.length&&(l.items.length!==0||l.key)?(B(),V(`tr`,ZE,[U(`td`,{colspan:h(),class:`px-4 py-1`},[W(N(sC),{variant:`ghost`,size:`xs`,class:`text-muted-foreground`,"aria-expanded":!e.view.endedFolded.has(l.key),onClick:t=>e.view.toggleEnded(l.key)},{default:P(()=>[e.view.endedFolded.has(l.key)?(B(),H(N(Xu),{key:1})):(B(),H(N(Ju),{key:0})),G(j(e.view.endedFolded.has(l.key)?`已結束 ${l.ended.length} 個`:`收起已結束 ${l.ended.length} 個`),1)]),_:2},1032,[`aria-expanded`,`onClick`])],8,QE)])):K(``,!0)],64))]),_:2},1024))),128))])):(B(),V(`div`,$E,[e.view.total.value>0?(B(),V(z,{key:0},[s[5]||=G(` 沒有符合條件的項目。`,-1),W(N(sC),{variant:`link`,size:`xs`,class:`px-0`,onClick:e.view.clearAll},{default:P(()=>[...s[4]||=[G(`清除篩選與搜尋`,-1)]]),_:1},8,[`onClick`])],64)):R(t.$slots,`empty`,{},void 0,void 0,1)]))}}),tD=I({__name:`Input`,props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=Lf(n,`modelValue`,t,{passive:!0,defaultValue:n.defaultValue});return(e,t)=>yr((B(),V(`input`,{"onUpdate:modelValue":t[0]||=e=>fn(r)?r.value=e:null,"data-slot":`input`,class:k(N(gg)(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,n.class))},null,2)),[[Wl,N(r)]])}}),nD={class:`flex flex-wrap items-center gap-2 px-6 py-2`},rD={class:`relative`},iD={class:`text-muted-foreground`},aD=[`aria-label`,`onClick`],oD={class:`ml-auto text-xs text-muted-foreground tabular-nums`},sD={key:0,class:`ml-auto text-xs text-muted-foreground`},cD={class:`truncate`},lD={key:0,class:`px-2 py-1.5 text-xs text-muted-foreground`},uD=I({__name:`ListToolbar`,props:{view:{},grouping:{type:Boolean,default:!0}},setup(e){let t=e,n={without:`不含已封存`,with:`包含已封存`,only:`只看已封存`},r=e=>t.view.setSort(String(e)),i=e=>t.view.setSort(t.view.sort.value.field.key,e);return(t,a)=>(B(),V(`div`,nD,[U(`label`,rD,[W(N(Zd),{class:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),W(N(tD),{modelValue:e.view.search.value,"onUpdate:modelValue":a[0]||=t=>e.view.search.value=t,class:`h-8 w-56 pl-8`,placeholder:`搜尋 ID、名稱或欄位`,"aria-label":`搜尋`},null,8,[`modelValue`])]),(B(!0),V(z,null,L(e.view.activeFilters.value,t=>(B(),H(N(nE),{key:`${t.field.key}:${t.value}`,variant:`secondary`,class:`h-6 gap-1 pr-1`},{default:P(()=>[U(`span`,iD,j(t.field.label),1),G(j(t.label)+` `,1),U(`button`,{type:`button`,class:`grid size-4 place-items-center rounded-sm hover:bg-accent`,"aria-label":`移除篩選 ${t.field.label} ${t.label}`,onClick:n=>e.view.toggleFilter(t.field.key,t.value)},[W(N(uf),{class:`size-3`})],8,aD)]),_:2},1024))),128)),e.view.spec.archived&&e.view.archived.value===`only`?(B(),H(N(nE),{key:0,variant:`secondary`,class:`h-6 gap-1 pr-1`},{default:P(()=>[G(j(n[e.view.archived.value])+` `,1),U(`button`,{type:`button`,class:`grid size-4 place-items-center rounded-sm hover:bg-accent`,"aria-label":`移除封存篩選`,onClick:a[1]||=t=>e.view.setArchived(`without`)},[W(N(uf),{class:`size-3`})])]),_:1})):K(``,!0),e.view.activeFilters.value.length>1?(B(),H(N(sC),{key:1,variant:`ghost`,size:`xs`,class:`text-muted-foreground`,onClick:e.view.clearAll},{default:P(()=>[...a[7]||=[G(`清除全部`,-1)]]),_:1},8,[`onClick`])):K(``,!0),U(`span`,oD,[e.view.shown.value===e.view.total.value?(B(),V(z,{key:0},[G(j(e.view.total.value)+` 個`,1)],64)):(B(),V(z,{key:1},[G(j(e.view.shown.value)+` / `+j(e.view.total.value)+` 個`,1)],64))]),R(t.$slots,`views`),e.view.spec.archived?(B(),H(N(sC),{key:2,variant:`outline`,size:`sm`,class:k({"bg-accent text-accent-foreground":e.view.archived.value!==`without`}),"aria-pressed":e.view.archived.value!==`without`,onClick:a[2]||=t=>e.view.setArchived(e.view.archived.value===`without`?`with`:`without`)},{default:P(()=>[W(N(Pu)),a[8]||=G(`顯示已封存 `,-1)]),_:1},8,[`class`,`aria-pressed`])):K(``,!0),W(N(lC),null,{default:P(()=>[W(N(SC),{"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`,size:`sm`},{default:P(()=>[W(N(Fd)),a[9]||=G(`篩選`,-1)]),_:1})]),_:1}),W(N(fC),{align:`end`,class:`w-48`},{default:P(()=>[(B(!0),V(z,null,L(e.view.spec.filters,t=>(B(),H(N(yC),{key:t.key},{default:P(()=>[W(N(xC),null,{default:P(()=>[G(j(t.label)+` `,1),e.view.filters.value[t.key]?.length?(B(),V(`span`,sD,j(e.view.filters.value[t.key].length),1)):K(``,!0)]),_:2},1024),W(N(bC),{class:`max-h-80 w-56`},{default:P(()=>[(B(!0),V(z,null,L(e.view.optionsOf(t),n=>(B(),H(N(dC),{key:n.value,"model-value":e.view.filters.value[t.key]?.includes(n.value),onSelect:au(r=>e.view.toggleFilter(t.key,n.value),[`prevent`])},{default:P(()=>[n.status?(B(),H(OE,{key:0,status:n.status},null,8,[`status`])):K(``,!0),U(`span`,cD,j(n.label),1)]),_:2},1032,[`model-value`,`onSelect`]))),128)),e.view.optionsOf(t).length===0?(B(),V(`p`,lD,`沒有可選的值`)):K(``,!0)]),_:2},1024)]),_:2},1024))),128)),e.view.spec.archived?(B(),V(z,{key:0},[W(N(vC)),W(N(yC),null,{default:P(()=>[W(N(xC),null,{default:P(()=>[W(N(Cd),{class:`size-4 text-muted-foreground`}),a[10]||=G(`封存`,-1)]),_:1}),W(N(bC),null,{default:P(()=>[W(N(hC),{"model-value":e.view.archived.value,"onUpdate:modelValue":a[3]||=t=>e.view.setArchived(t)},{default:P(()=>[(B(),V(z,null,L(n,(e,t)=>W(N(_C),{key:t,value:t},{default:P(()=>[G(j(e),1)]),_:2},1032,[`value`])),64))]),_:1},8,[`model-value`])]),_:1})]),_:1})],64)):K(``,!0)]),_:1})]),_:1}),W(N(lC),null,{default:P(()=>[W(N(SC),{"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`,size:`sm`},{default:P(()=>[e.view.sort.value.dir===`desc`?(B(),H(N(Fu),{key:0})):(B(),H(N(Ru),{key:1})),G(j(e.view.sort.value.field.label),1)]),_:1})]),_:1}),W(N(fC),{align:`end`,class:`w-44`},{default:P(()=>[W(N(mC),{class:`text-xs text-muted-foreground`},{default:P(()=>[...a[11]||=[G(`排序`,-1)]]),_:1}),W(N(hC),{"model-value":e.view.sort.value.field.key,"onUpdate:modelValue":r},{default:P(()=>[(B(!0),V(z,null,L(e.view.spec.sorts,e=>(B(),H(N(_C),{key:e.key,value:e.key},{default:P(()=>[G(j(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`]),W(N(vC)),W(N(hC),{"model-value":e.view.sort.value.dir,"onUpdate:modelValue":a[4]||=e=>i(e)},{default:P(()=>[W(N(_C),{value:`asc`},{default:P(()=>[...a[12]||=[G(`由小到大`,-1)]]),_:1}),W(N(_C),{value:`desc`},{default:P(()=>[...a[13]||=[G(`由大到小`,-1)]]),_:1})]),_:1},8,[`model-value`]),e.view.sort.value.chosen?(B(),V(z,{key:0},[W(N(vC)),W(N(pC),{onSelect:a[5]||=t=>e.view.clearSort()},{default:P(()=>[...a[14]||=[G(`回到預設順序`,-1)]]),_:1})],64)):K(``,!0)]),_:1})]),_:1}),e.grouping&&e.view.spec.groups.length?(B(),H(N(lC),{key:3},{default:P(()=>[W(N(SC),{"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`,size:`sm`},{default:P(()=>[W(N(Ad)),G(j(e.view.spec.groups.find(t=>t.key===e.view.group.value)?.label??`不分組`),1)]),_:1})]),_:1}),W(N(fC),{align:`end`,class:`w-40`},{default:P(()=>[W(N(mC),{class:`text-xs text-muted-foreground`},{default:P(()=>[...a[15]||=[G(`分組`,-1)]]),_:1}),W(N(hC),{"model-value":e.view.group.value,"onUpdate:modelValue":a[6]||=t=>e.view.setGroup(String(t))},{default:P(()=>[(B(!0),V(z,null,L(e.view.spec.groups,e=>(B(),H(N(_C),{key:e.key,value:e.key},{default:P(()=>[G(j(e.label),1)]),_:2},1032,[`value`]))),128)),W(N(_C),{value:``},{default:P(()=>[...a[16]||=[G(`不分組`,-1)]]),_:1})]),_:1},8,[`model-value`])]),_:1})]),_:1})):K(``,!0)]))}}),dD={key:0,class:`pointer-events-none sticky bottom-4 z-20 flex justify-center px-6`,role:`toolbar`,"aria-label":`批次操作`},fD={class:`pointer-events-auto flex items-center gap-1 rounded-lg border bg-popover py-1 pr-1 pl-3 text-sm shadow-md`},pD={class:`mr-2 tabular-nums`},mD={key:0,class:`text-muted-foreground tabular-nums`},hD={key:0,class:`text-muted-foreground tabular-nums`},gD=I({__name:`SelectionBar`,props:{selection:{}},setup(e){return(t,n)=>e.selection.active.value?(B(),V(`div`,dD,[U(`div`,fD,[U(`span`,pD,`已選 `+j(e.selection.selected.value.length)+` 個`,1),W(N(sC),{variant:`ghost`,size:`sm`,disabled:!e.selection.archivable.value,onClick:n[0]||=t=>e.selection.setArchived(!0)},{default:P(()=>[W(N(Pu)),n[3]||=G(`封存`,-1),e.selection.archivable.value?(B(),V(`span`,mD,j(e.selection.archivable.value),1)):K(``,!0)]),_:1},8,[`disabled`]),W(N(sC),{variant:`ghost`,size:`sm`,disabled:!e.selection.restorable.value,onClick:n[1]||=t=>e.selection.setArchived(!1)},{default:P(()=>[W(N(Nu)),n[4]||=G(`取消封存`,-1),e.selection.restorable.value?(B(),V(`span`,hD,j(e.selection.restorable.value),1)):K(``,!0)]),_:1},8,[`disabled`]),W(N(sC),{variant:`ghost`,size:`icon-sm`,"aria-label":`清除選取`,onClick:n[2]||=t=>e.selection.clear()},{default:P(()=>[W(N(uf))]),_:1})])])):K(``,!0)}}),_D={key:2,class:`shrink-0 font-mono text-xs text-muted-foreground`},vD=[`title`],yD=I({__name:`NameCell`,props:{status:{},id:{},title:{},muted:{type:Boolean},depth:{},type:{}},setup(e){return(t,n)=>(B(),V(`span`,{class:`flex min-w-0 items-center gap-2`,style:he(e.depth?{paddingLeft:`${e.depth*24}px`}:void 0)},[e.type?(B(),H(nT,{key:0,type:e.type,status:e.status},null,8,[`type`,`status`])):e.status?(B(),H(OE,{key:1,status:e.status,class:`shrink-0`},null,8,[`status`])):K(``,!0),e.id?(B(),V(`span`,_D,j(e.id),1)):K(``,!0),U(`span`,{class:k([`truncate`,{"text-muted-foreground":e.muted}]),title:e.title},j(e.title),11,vD),R(t.$slots,`default`)],4))}}),bD={class:`flex min-w-0 items-baseline gap-3 px-6 pt-6 pb-2`},xD={class:`shrink-0 text-title font-semibold`},SD=[`title`],CD=I({__name:`PageHeader`,props:{title:{},description:{}},setup(e){return(t,n)=>(B(),V(`header`,bD,[U(`h1`,xD,j(e.title),1),e.description?(B(),V(`p`,{key:0,class:`min-w-0 truncate text-sm text-muted-foreground`,title:e.description},j(e.description),9,SD)):K(``,!0)]))}}),wD={class:`group/copy inline-flex min-w-0 items-center gap-0.5`},TD=[`title`],ED=[`aria-label`,`title`],DD=I({__name:`CopyText`,props:{text:{},label:{},mono:{type:Boolean,default:!0}},setup(e){let t=e,n=M(`idle`),r;async function i(){n.value=await CT(t.text)?`copied`:`failed`,clearTimeout(r),r=setTimeout(()=>n.value=`idle`,1200)}let a={idle:e=>`複製 ${e}`,copied:()=>`已複製`,failed:()=>`無法複製,請手動選取`};return(t,r)=>(B(),V(`span`,wD,[U(`span`,{class:k([`truncate select-text`,e.mono?`font-mono text-xs text-muted-foreground`:``]),title:e.text},j(e.label??e.text),11,TD),U(`button`,{type:`button`,class:k([`inline-grid size-5 shrink-0 place-items-center rounded-sm text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100 group-hover/copy:opacity-100`,{"text-status-done opacity-100":n.value===`copied`,"text-destructive opacity-100":n.value===`failed`}]),"aria-label":a[n.value](e.text),title:a[n.value](e.text),onClick:au(i,[`stop`])},[n.value===`copied`?(B(),H(N(qu),{key:0,class:`size-3`})):n.value===`failed`?(B(),H(N(uf),{key:1,class:`size-3`})):(B(),H(N(sd),{key:2,class:`size-3`}))],10,ED)]))}}),OD=I({__name:`EditableTitle`,props:{value:{}},emits:[`save`],setup(e,{emit:t}){let n=e,r=t,i=M(!1),a=M(``),o=M();async function s(){a.value=n.value,i.value=!0,await tr(),o.value?.select()}function c(e){if(!i.value)return;i.value=!1;let t=a.value.trim();e&&t&&t!==n.value&&r(`save`,t)}return(t,n)=>i.value?yr((B(),V(`input`,{key:0,ref_key:`input`,ref:o,"onUpdate:modelValue":n[0]||=e=>a.value=e,class:`-mx-1 w-full rounded-sm bg-transparent px-1 outline-none ring-1 ring-ring`,"aria-label":`主脈絡標題`,onKeydown:[n[1]||=su(au(e=>c(!0),[`prevent`]),[`enter`]),n[2]||=su(au(e=>c(!1),[`stop`,`prevent`]),[`esc`])],onBlur:n[3]||=e=>c(!0)},null,544)),[[Wl,a.value]]):(B(),V(`button`,{key:1,type:`button`,class:`-mx-1 cursor-text rounded-sm px-1 text-left hover:bg-accent/50`,title:`點一下改標題`,onClick:s},j(e.value),1))}}),kD={class:`flex flex-col gap-2 px-5 pt-1 pb-4`},AD={key:0,class:`flex items-center gap-1.5`},jD={key:1,class:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`},MD=I({__name:`PanelHeader`,props:{id:{},title:{},mono:{type:Boolean},type:{},status:{},editable:{type:Boolean}},emits:[`rename`],setup(e){return(t,n)=>(B(),V(`header`,kD,[e.id||e.type?(B(),V(`div`,AD,[W(nT,{type:e.type,status:e.status},null,8,[`type`,`status`]),e.id?(B(),H(DD,{key:0,text:e.id},null,8,[`text`])):K(``,!0)])):K(``,!0),U(`h2`,{class:k([`text-base font-semibold break-words`,{"font-mono text-sm":e.mono}])},[e.editable?(B(),H(OD,{key:0,value:e.title,onSave:n[0]||=e=>t.$emit(`rename`,e)},null,8,[`value`])):(B(),V(z,{key:1},[G(j(e.title),1)],64))],2),t.$slots.default?(B(),V(`div`,jD,[R(t.$slots,`default`)])):K(``,!0),R(t.$slots,`notice`)]))}}),ND={class:`px-5 py-3`},PD={key:0,class:`mb-2 text-sm font-medium`},FD={key:0,class:`ml-1.5 text-xs font-normal text-muted-foreground tabular-nums`},ID=I({__name:`PanelSection`,props:{title:{},count:{}},setup(e){return(t,n)=>(B(),V(`section`,ND,[e.title?(B(),V(`h3`,PD,[G(j(e.title),1),e.count===void 0?K(``,!0):(B(),V(`span`,FD,j(e.count),1))])):K(``,!0),R(t.$slots,`default`)]))}}),LD={class:`pb-8`},RD={key:0},zD=[`title`],BD={class:`text-sm`},VD={class:`mt-1 text-xs text-muted-foreground`},HD={class:`mt-1 font-mono break-words`},UD={key:0,class:`px-5 text-sm text-destructive`,role:`alert`},WD={class:`min-w-0`},GD={class:`side`,"data-side":`mine`},KD={class:`min-w-0`},qD={class:`mb-1.5 text-xs font-medium text-muted-foreground`},JD={key:0,class:`side`,"data-side":`theirs`},YD={key:1,class:`text-sm text-muted-foreground`},XD={key:2,class:`px-5 text-muted-foreground`},ZD=lT(I({__name:`ConflictPeek`,props:{saved:{}},setup(e){let t=e,n=M(null),r=M(``),i=M(null),a=J(()=>Q.sync.notices.find(e=>e.saved===t.saved));Er(async()=>{n.value=null,r.value=``;try{n.value=await XC.conflict(t.saved),await tr(),i.value?.querySelector(`.only`)?.scrollIntoView({block:`center`})}catch(e){r.value=e.message}});let o=e=>(e??``).split(`
|
|
8
|
+
`),s=(e,t)=>{let n=new Set(o(t));return o(e).map(e=>({line:e,only:!n.has(e)}))},c=J(()=>n.value?s(n.value.mine,n.value.theirs.text):[]),l=J(()=>n.value?s(n.value.theirs.text,n.value.mine):[]),u=J(()=>n.value?.theirs.source===`server`?`hub 目前的版本(同步伺服器)`:`hub 目前的版本(本機同步副本)`);return(t,o)=>(B(),V(`div`,LD,[W(MD,{title:n.value?.path||a.value?.path||e.saved,mono:``},{notice:P(()=>[a.value?(B(),V(z,{key:0},[U(`p`,BD,j(N(zC)(a.value,!1)),1),U(`details`,VD,[o[0]||=U(`summary`,{class:`cursor-pointer`},`同步程式的原文`,-1),U(`p`,HD,j(a.value.message),1)])],64)):K(``,!0)]),default:P(()=>[a.value?(B(),V(`span`,RD,j(N(IC)[a.value.kind]??a.value.kind),1)):K(``,!0),a.value?(B(),V(`span`,{key:1,title:a.value.at},j(new Date(a.value.at).toLocaleString(`sv-SE`)),9,zD)):K(``,!0),W(DD,{text:e.saved},null,8,[`text`])]),_:1},8,[`title`]),r.value?(B(),V(`p`,UD,j(r.value),1)):n.value?(B(),H(ID,{key:1},{default:P(()=>[U(`div`,{ref_key:`sides`,ref:i,class:`grid grid-cols-2 gap-3`,"data-conflict-sides":``},[U(`div`,WD,[o[1]||=U(`h3`,{class:`mb-1.5 text-xs font-medium text-muted-foreground`},`這個環境寫的內容(被拒,存檔)`,-1),U(`pre`,GD,[(B(!0),V(z,null,L(c.value,(e,t)=>(B(),V(`span`,{key:t,class:k({only:e.only})},j(e.line),3))),128))])]),U(`div`,KD,[U(`h3`,qD,j(u.value),1),n.value.theirs.text===null?(B(),V(`p`,YD,`hub 裡已經沒有這個檔。`)):(B(),V(`pre`,JD,[(B(!0),V(z,null,L(l.value,(e,t)=>(B(),V(`span`,{key:t,class:k({only:e.only})},j(e.line),3))),128))]))])],512),o[2]||=U(`p`,{class:`mt-2 text-xs text-muted-foreground`},`標底色的行只出現在那一邊。要保留這個環境的內容時,讀 hub 目前的版本,再對照存檔重做。`,-1)]),_:1})):(B(),V(`p`,XD,`載入存檔…`))]))}}),[[`__scopeId`,`data-v-14fd5e2b`]]),QD=I({__name:`FieldGrid`,props:{columns:{default:2}},setup(e){return(t,n)=>(B(),V(`dl`,{class:k([`grid gap-x-8 gap-y-0.5`,e.columns===2?`grid-cols-1 min-[1100px]:grid-cols-2`:`grid-cols-1`])},[R(t.$slots,`default`)],2))}}),$D={class:`-mx-2 grid min-h-8 grid-cols-[16px_96px_minmax(0,1fr)] items-center gap-x-2 rounded-md px-2 transition-colors hover:bg-accent/50`},eO={key:1},tO={class:`text-xs text-muted-foreground`},nO={class:`m-0 flex min-w-0 flex-wrap items-center gap-1.5`},$=I({__name:`FieldItem`,props:{label:{},icon:{}},setup(e){return(t,n)=>(B(),V(`div`,$D,[e.icon?(B(),H(fa(e.icon),{key:0,class:`size-3.5 text-muted-foreground`})):(B(),V(`span`,eO)),U(`dt`,tO,j(e.label),1),U(`dd`,nO,[R(t.$slots,`default`)])]))}});function rO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iO(e){if(Array.isArray(e))return e}function aO(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function oO(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
9
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sO(e,t){return iO(e)||aO(e,t)||cO(e,t)||oO()}function cO(e,t){if(e){if(typeof e==`string`)return rO(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rO(e,t):void 0}}var lO=Object.entries,uO=Object.setPrototypeOf,dO=Object.isFrozen,fO=Object.getPrototypeOf,pO=Object.getOwnPropertyDescriptor,mO=Object.freeze,hO=Object.seal,gO=Object.create,_O=typeof Reflect<`u`&&Reflect,vO=_O.apply,yO=_O.construct;mO||=function(e){return e},hO||=function(e){return e},vO||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},yO||=function(e){return new e(...[...arguments].slice(1))};var bO=BO(Array.prototype.forEach),xO=BO(Array.prototype.lastIndexOf),SO=BO(Array.prototype.pop),CO=BO(Array.prototype.push),wO=BO(Array.prototype.splice),TO=Array.isArray,EO=BO(String.prototype.toLowerCase),DO=BO(String.prototype.toString),OO=BO(String.prototype.match),kO=BO(String.prototype.replace),AO=BO(String.prototype.indexOf),jO=BO(String.prototype.trim),MO=BO(Number.prototype.toString),NO=BO(Boolean.prototype.toString),PO=typeof BigInt>`u`?null:BO(BigInt.prototype.toString),FO=typeof Symbol>`u`?null:BO(Symbol.prototype.toString),IO=BO(Object.prototype.hasOwnProperty),LO=BO(Object.prototype.toString),RO=BO(RegExp.prototype.test),zO=VO(TypeError);function BO(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return vO(e,t,n)}}function VO(e){return function(){return yO(e,[...arguments])}}function HO(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:EO;if(uO&&uO(e,null),!TO(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(dO(t)||(t[r]=e),i=e)}e[i]=!0}return e}function UO(e){for(let t=0;t<e.length;t++)IO(e,t)||(e[t]=null);return e}function WO(e){let t=gO(null);for(let r of lO(e)){var n=sO(r,2);let i=n[0],a=n[1];IO(e,i)&&(t[i]=TO(a)?UO(a):a&&typeof a==`object`&&a.constructor===Object?WO(a):a)}return t}function GO(e){switch(typeof e){case`string`:return e;case`number`:return MO(e);case`boolean`:return NO(e);case`bigint`:return PO?PO(e):`0`;case`symbol`:return FO?FO(e):`Symbol()`;case`undefined`:return LO(e);case`function`:case`object`:{if(e===null)return LO(e);let t=e,n=KO(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:LO(e)}return LO(e)}default:return LO(e)}}function KO(e,t){for(;e!==null;){let n=pO(e,t);if(n){if(n.get)return BO(n.get);if(typeof n.value==`function`)return BO(n.value)}e=fO(e)}function n(){return null}return n}function qO(e){try{return RO(e,``),!0}catch{return!1}}var JO=mO(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),YO=mO(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),XO=mO([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),ZO=mO([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),QO=mO(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),$O=mO([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),ek=mO([`#text`]),tk=mO(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),nk=mO(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),rk=mO(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ik=mO([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),ak=hO(/{{[\w\W]*|^[\w\W]*}}/g),ok=hO(/<%[\w\W]*|^[\w\W]*%>/g),sk=hO(/\${[\w\W]*/g),ck=hO(/^data-[\-\w.\u00B7-\uFFFF]+$/),lk=hO(/^aria-[\-\w]+$/),uk=hO(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dk=hO(/^(?:\w+script|data):/i),fk=hO(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pk=hO(/^html$/i),mk=hO(/^[a-z][.\w]*(-[.\w]+)+$/i),hk=hO(/<[/\w!]/g),gk=hO(/<[/\w]/g),_k=hO(/<\/no(script|embed|frames)/i),vk=hO(/\/>/i),yk={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bk=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],xk=mO(HO({},bk)),Sk=function(){let e={};return bO(bk,t=>{e[t]=hO(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),mO(e)}(),Ck=function(){return typeof window>`u`?null:window},wk=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Tk=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ek=function(e,t,n,r){return IO(e,t)&&TO(e[t])?HO(r.base?WO(r.base):{},e[t],r.transform):n},Dk=function(e,t,n){let r=IO(e,t)?e[t]:void 0;return r&&typeof r==`object`?WO(r):n()};function Ok(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ck(),t=e=>Ok(e);if(t.version=`3.4.15`,t.removed=[],!e||!e.document||e.document.nodeType!==yk.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=KO(d,`cloneNode`),p=KO(d,`remove`),m=KO(d,`removeAttributeNode`),h=KO(d,`nextSibling`),g=KO(d,`childNodes`),_=KO(d,`parentNode`),v=KO(d,`shadowRoot`),y=KO(d,`attributes`),b=o&&o.prototype?KO(o.prototype,`nodeType`):null,x=o&&o.prototype?KO(o.prototype,`nodeName`):null,S=o&&o.prototype?KO(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,ee=``,E,te=!1,ne=0,re=function(){if(ne>0)throw zO(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){re(),ne++;try{return T.createHTML(e)}finally{ne--}},ie=function(e){re(),ne++;try{return T.createScriptURL(e)}finally{ne--}},ae=function(){return te||=(E=wk(u,i),!0),E},oe=n,se=oe.implementation,O=oe.createNodeIterator,ce=oe.createDocumentFragment,le=oe.getElementsByTagName,ue=r.importNode,de=Tk();t.isSupported=typeof lO==`function`&&typeof _==`function`&&se&&se.createHTMLDocument!==void 0;let fe=ak,pe=ok,me=sk,he=ck,ge=lk,_e=dk,ve=fk,ye=mk,k=uk,A=null,be=HO({},[...JO,...YO,...XO,...QO,...ek]),xe=null,Se=HO({},[...tk,...nk,...rk,...ik]),Ce=Object.seal(gO(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,Te=null,Ee=Object.seal(gO(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),De=!0,Oe=!0,ke=!1,j=!0,Ae=!1,je=!0,Me=!1,Ne=!1,Pe=null,Fe=null,Ie=!1,Le=!1,Re=!1,ze=!1,Be=!0,Ve=!1,He=`user-content-`,Ue=!0,We=!1,Ge={},Ke=null,qe=HO({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Je=null,Ye=HO({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Xe=null,Ze=HO({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Qe=`http://www.w3.org/1998/Math/MathML`,$e=`http://www.w3.org/2000/svg`,et=`http://www.w3.org/1999/xhtml`,tt=et,nt=!1,rt=null,it=HO({},[Qe,$e,et],DO),at=mO([`mi`,`mo`,`mn`,`ms`,`mtext`]),ot=HO({},at),st=mO([`annotation-xml`]),ct=HO({},st),lt=HO({},[`title`,`style`,`font`,`a`,`script`]),ut=null,dt=[`application/xhtml+xml`,`text/html`],ft=null,pt=null,mt=n.createElement(`form`),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pt&&pt===e)return;(!e||typeof e!=`object`)&&(e={}),e=WO(e),ut=dt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ft=ut===`application/xhtml+xml`?DO:EO,A=Ek(e,`ALLOWED_TAGS`,be,{transform:ft}),xe=Ek(e,`ALLOWED_ATTR`,Se,{transform:ft}),rt=Ek(e,`ALLOWED_NAMESPACES`,it,{transform:DO}),Xe=Ek(e,`ADD_URI_SAFE_ATTR`,Ze,{transform:ft,base:Ze}),Je=Ek(e,`ADD_DATA_URI_TAGS`,Ye,{transform:ft,base:Ye}),Ke=Ek(e,`FORBID_CONTENTS`,qe,{transform:ft}),we=Ek(e,`FORBID_TAGS`,WO({}),{transform:ft}),Te=Ek(e,`FORBID_ATTR`,WO({}),{transform:ft}),Ge=IO(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?WO(e.USE_PROFILES):e.USE_PROFILES:!1,De=e.ALLOW_ARIA_ATTR!==!1,Oe=e.ALLOW_DATA_ATTR!==!1,ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,j=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=e.SAFE_FOR_TEMPLATES||!1,je=e.SAFE_FOR_XML!==!1,Me=e.WHOLE_DOCUMENT||!1,Le=e.RETURN_DOM||!1,Re=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Be=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,Ue=e.KEEP_CONTENT!==!1,We=e.IN_PLACE||!1,k=qO(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:uk,tt=typeof e.NAMESPACE==`string`?e.NAMESPACE:et,ot=Dk(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>HO({},at)),ct=Dk(e,`HTML_INTEGRATION_POINTS`,()=>HO({},st));let t=Dk(e,`CUSTOM_ELEMENT_HANDLING`,()=>gO(null));if(Ce=gO(null),IO(t,`tagNameCheck`)&&ht(t.tagNameCheck)&&(Ce.tagNameCheck=t.tagNameCheck),IO(t,`attributeNameCheck`)&&ht(t.attributeNameCheck)&&(Ce.attributeNameCheck=t.attributeNameCheck),IO(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Ce.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),hO(Ce),Ae&&(Oe=!1),Re&&(Le=!0),Ge&&(A=HO({},ek),xe=gO(null),Ge.html===!0&&(HO(A,JO),HO(xe,tk)),Ge.svg===!0&&(HO(A,YO),HO(xe,nk),HO(xe,ik)),Ge.svgFilters===!0&&(HO(A,XO),HO(xe,nk),HO(xe,ik)),Ge.mathMl===!0&&(HO(A,QO),HO(xe,rk),HO(xe,ik))),Ee.tagCheck=null,Ee.attributeCheck=null,IO(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ee.tagCheck=e.ADD_TAGS:TO(e.ADD_TAGS)&&(A===be&&(A=WO(A)),HO(A,e.ADD_TAGS,ft))),IO(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ee.attributeCheck=e.ADD_ATTR:TO(e.ADD_ATTR)&&(xe===Se&&(xe=WO(xe)),HO(xe,e.ADD_ATTR,ft))),IO(e,`ADD_FORBID_CONTENTS`)&&TO(e.ADD_FORBID_CONTENTS)&&(Ke===qe&&(Ke=WO(Ke)),HO(Ke,e.ADD_FORBID_CONTENTS,ft)),Ue&&(A[`#text`]=!0),Me&&HO(A,[`html`,`head`,`body`]),A.table&&(HO(A,[`tbody`]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw zO(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw zO(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{ee=D(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,ee=``):(T===void 0&&(T=ae()),T&&typeof ee==`string`&&(ee=D(``)));mO&&mO(e),pt=e},_t=HO({},[...YO,...XO,...ZO]),vt=HO({},[...QO,...$O]),yt=function(e,t,n){return t.namespaceURI===et?e===`svg`:t.namespaceURI===Qe?e===`svg`&&(n===`annotation-xml`||ot[n]):!!_t[e]},bt=function(e,t,n){return t.namespaceURI===et?e===`math`:t.namespaceURI===$e?e===`math`&&ct[n]:!!vt[e]},xt=function(e,t,n){return t.namespaceURI===$e&&!ct[n]||t.namespaceURI===Qe&&!ot[n]?!1:!vt[e]&&(lt[e]||!_t[e])},St=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:tt,tagName:`template`});let n=EO(e.tagName),r=EO(t.tagName);return rt[e.namespaceURI]?e.namespaceURI===$e?yt(n,t,r):e.namespaceURI===Qe?bt(n,t,r):e.namespaceURI===et?xt(n,t,r):!!(ut===`application/xhtml+xml`&&rt[e.namespaceURI]):!1},Ct=function(e){CO(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw zO(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},wt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Tt=function(e){Ot(e);let t=g(e);if(t){let e=[];bO(t,t=>{CO(e,t)}),bO(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&wt(e,r,i)}},Et=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}CO(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Le||Re)try{Ct(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Dt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||xe[ft(i)]||wt(e,r,i)}},Ot=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===yk.element&&Dt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},kt=function(e,t){return je?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},At=function(e){if(!je)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===yk.processingInstruction||n===yk.comment&&RO(gk,e.data)){try{p(e)}catch{}continue}if(n===yk.element){let t=e,n=ft(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&kt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},jt=function(e){let t=null,r=null;if(Ie)e=`<remove></remove>`+e;else{let t=OO(e,/^[\r\n\t ]+/);r=t&&t[0]}ut===`application/xhtml+xml`&&tt===et&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?D(e):e;if(tt===et)try{t=new l().parseFromString(i,ut)}catch{}if(!t||!t.documentElement){t=se.createDocument(tt,`template`,null);try{t.documentElement.innerHTML=nt?ee:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),tt===et?le.call(t,Me?`html`:`body`)[0]:Me?t.documentElement:a},Mt=function(e){let t=S?S(e):e.ownerDocument;return O.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Nt=function(e){return e=kO(e,fe,` `),e=kO(e,pe,` `),e=kO(e,me,` `),e},Pt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=O.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Nt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&bO(i,e=>{It(e.content)&&Pt(e.content)})},Ft=function(e){let t=x?x(e):null;return typeof t!=`string`||ft(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},It=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===yk.documentFragment}catch{return!1}},Lt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Rt(e,n,r){e.length!==0&&bO(e,e=>{e.call(t,n,r,pt)})}let zt=function(e,t){return!!(je&&e.hasChildNodes()&&!Lt(e.firstElementChild)&&RO(hk,e.textContent)&&RO(hk,e.innerHTML)||je&&e.namespaceURI===et&&xk[t]&&(Lt(e.firstElementChild)||typeof e.textContent==`string`&&RO(Sk[t],e.textContent))||e.nodeType===yk.processingInstruction||je&&e.nodeType===yk.comment&&RO(gk,e.data))},Bt=function(e,t){return e instanceof RegExp?RO(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Vt=function(e,t,n){if(!we[t]&&qt(t)&&Bt(Ce.tagNameCheck,t))return!1;if(Ue&&!Ke[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Ct(e),!0},Ht=function(e,t,n,r){return e.length===0?t:t===n||t===r?WO(t):t},Ut=function(e,t){return e===t||_(e)!==null?!1:(We&&Ot(e),!0)},Wt=function(e,n){if(Rt(de.beforeSanitizeElements,e,null),Ut(e,n))return!0;if(Ft(e))return Ct(e),!0;let r=ft(w(e));if(A=Ht(de.uponSanitizeElement,A,be,Pe),Rt(de.uponSanitizeElement,e,{tagName:r,allowedTags:A}),Ut(e,n))return!0;if(zt(e,r))return Ct(e),!0;if(we[r]||!(Ee.tagCheck instanceof Function&&Ee.tagCheck(r))&&!A[r]){let t=Vt(e,r,n);return t===!1&&Rt(de.afterSanitizeElements,e,null),t}if(C(e)===yk.element&&!St(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&RO(_k,e.innerHTML))return Ct(e),!0;if(Ae&&e.nodeType===yk.text){let n=Nt(e.textContent);e.textContent!==n&&(CO(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Rt(de.afterSanitizeElements,e,null),!1},Gt=function(e,t,r){if(Te[t]||kt(t,e)||Be&&(t===`id`||t===`name`)&&(r in n||r in mt))return!1;let i=xe[t]||Ee.attributeCheck instanceof Function&&Ee.attributeCheck(t,e);return Oe&&RO(he,t)||De&&RO(ge,t)?!0:i?Xe[t]||RO(k,kO(r,ve,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&AO(r,`data:`)===0&&Je[e]||ke&&!RO(_e,kO(r,ve,``))?!0:!r:qt(e)&&Bt(Ce.tagNameCheck,e)&&Bt(Ce.attributeNameCheck,t,e)||t===`is`&&Ce.allowCustomizedBuiltInElements&&Bt(Ce.tagNameCheck,r)},Kt=HO({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),qt=function(e){return!Kt[EO(e)]&&RO(ye,e)},Jt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return ie(r)}return r},Yt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Ft(e)||(Ct(e),!1)}catch{return Et(t,e),!1}},Xt=function(e){Rt(de.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||Ft(e))return;xe=Ht(de.uponSanitizeAttribute,xe,Se,Fe);let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0},i=n.length,a=ft(e.nodeName);for(;i--;){let o=n[i],s=o.name,c=o.namespaceURI,l=o.value,u=ft(s),d=l,f=s===`value`?d:jO(d),p=!1;if(r.attrName=u,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,r),f=r.attrValue,Ve&&(u===`id`||u===`name`)&&AO(f,He)!==0&&(Et(s,e,o),f=He+f,p=!0),je&&RO(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Et(s,e,o);continue}if(u===`attributename`&&OO(f,`href`)){Et(s,e,o);continue}if(!r.forceKeepAttr){if(!r.keepAttr){Et(s,e,o);continue}if(!j&&RO(vk,f)){Et(s,e,o);continue}if(Ae&&(f=Nt(f)),!Gt(a,u,f)){Et(s,e,o);continue}f=Jt(a,u,c,f),f!==d&&Yt(e,s,c,f)&&p&&SO(t.removed)}}Rt(de.afterSanitizeAttributes,e,null)},Zt=function(e){let t=null,n=Mt(e);for(Rt(de.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Rt(de.uponSanitizeShadowNode,t,null),Wt(t,e),Xt(t),It(t.content)&&Zt(t.content),C(t)===yk.element){let e=v(t);It(e)&&(Qt(e),Zt(e))}Rt(de.afterSanitizeShadowDOM,e,null)},Qt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Zt(e.shadow);continue}let n=e.node,r=C(n)===yk.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&ft(e)===`template`){let e=n.content;It(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);It(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(nt=!e,nt&&(e=`<!-->`),typeof e!=`string`&&!Lt(e)&&(e=GO(e),typeof e!=`string`))throw zO(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ne?(A=Pe,xe=Fe):gt(n),(de.uponSanitizeElement.length>0||de.uponSanitizeAttribute.length>0)&&(A=WO(A)),de.uponSanitizeAttribute.length>0&&(xe=WO(xe)),t.removed=[];let c=We&&typeof e!=`string`&&Lt(e);if(c){At(e);let t=w(e);if(typeof t==`string`){let n=ft(t);if(!A[n]||we[n])throw Tt(e),zO(`root node is forbidden and cannot be sanitized in-place`)}if(Ft(e))throw Tt(e),zO(`root node is clobbered and cannot be sanitized in-place`);try{Qt(e)}catch(t){throw Tt(e),t}}else if(Lt(e))i=jt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===yk.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Qt(i);else{if(!Le&&!Ae&&!Me&&e.indexOf(`<`)===-1)return T&&ze?D(e):e;if(i=jt(e),!i)return Le?null:ze?ee:``}i&&Ie&&Ct(i.firstChild);let l=c?e:i;try{let e=Mt(l);for(;o=e.nextNode();)Wt(o,l),Xt(o),It(o.content)&&Zt(o.content)}catch(n){throw c&&(Tt(e),bO(t.removed,e=>{e.element&&Ot(e.element)})),n}if(c)return bO(t.removed,e=>{e.element&&Ot(e.element)}),Ae&&Pt(e),e;if(Le){if(Ae&&Pt(i),Re)for(s=ce.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(xe.shadowroot||xe.shadowrootmode)&&(s=ue.call(r,s,!0)),s}let u=Me?i.outerHTML:i.innerHTML;return Me&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&RO(pk,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
10
|
+
`+u),Ae&&(u=Nt(u)),T&&ze?D(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(e),Ne=!0,Pe=A,Fe=xe},t.clearConfig=function(){pt=null,Ne=!1,Pe=null,Fe=null,T=E,ee=``},t.isValidAttribute=function(e,t,n){pt||gt({});let r=ft(e),i=ft(t);return Gt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&IO(de,e)&&CO(de[e],t)},t.removeHook=function(e,t){if(IO(de,e)){if(t!==void 0){let n=xO(de[e],t);return n===-1?void 0:wO(de[e],n,1)[0]}return SO(de[e])}},t.removeHooks=function(e){IO(de,e)&&(de[e]=[])},t.removeAllHooks=function(){de=Tk()},t}var kk=Ok();function Ak(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var jk=Ak();function Mk(e){jk=e}var Nk={exec:()=>null};function Pk(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Fk(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Lk.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ik=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Lk={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Pk(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Pk(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Pk(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Pk(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Pk(e=>RegExp(`^ {0,${e}}(?:</?(?:${Qk})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:Pk(e=>RegExp(`^ {0,${e}}>`))},Rk=/^(?:[ \t]*(?:\n|$))+/,zk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Vk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Hk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Uk=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Wk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Gk=Fk(Wk).replace(/bull/g,Uk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Kk=Fk(Wk).replace(/bull/g,Uk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Jk=/^[^\n]+/,Yk=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Xk=Fk(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Yk).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Zk=Fk(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Uk).getRegex(),Qk=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,$k=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,eA=Fk(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,$k).replace(`tag`,Qk).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),tA=e=>Fk(qk).replace(`hr`,Vk).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Qk).getRegex(),nA=tA(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),rA=tA(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),iA={blockquote:Fk(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,rA).getRegex(),code:zk,def:Xk,fences:Bk,heading:Hk,hr:Vk,html:eA,lheading:Gk,list:Zk,newline:Rk,paragraph:nA,table:Nk,text:Jk},aA=Fk(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Vk).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Qk).getRegex(),oA={...iA,lheading:Kk,table:aA,paragraph:Fk(qk).replace(`hr`,Vk).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,aA).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Qk).getRegex()},sA={...iA,html:Fk(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,$k).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nk,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Fk(qk).replace(`hr`,Vk).replace(`heading`,` *#{1,6} *[^
|
|
11
|
+
]`).replace(`lheading`,Gk).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},cA=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lA=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uA=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,dA=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fA=/[\p{P}\p{S}]/u,pA=/[\s\p{P}\p{S}]/u,mA=/[^\s\p{P}\p{S}]/u,hA=Fk(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,pA).getRegex(),gA=/[\p{Pi}\p{Ps}"']/u,_A=/(?!~)[\p{P}\p{S}]/u,vA=/(?!~)[\s\p{P}\p{S}]/u,yA=/(?:[^\s\p{P}\p{S}]|~)/u,bA=Fk(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ik?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),xA=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,SA=Fk(xA,`u`).replace(/punct/g,fA).getRegex(),CA=Fk(xA,`u`).replace(/punct/g,_A).getRegex(),wA=Fk(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,gA).replace(/punct/g,fA).getRegex(),TA=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,EA=Fk(TA,`gu`).replace(/notPunctSpace/g,mA).replace(/punctSpace/g,pA).replace(/punct/g,fA).getRegex(),DA=Fk(TA,`gu`).replace(/notPunctSpace/g,yA).replace(/punctSpace/g,vA).replace(/punct/g,_A).getRegex(),OA=Fk(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,mA).replace(/punctSpace/g,pA).replace(/punct/g,fA).getRegex(),kA=Fk(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,mA).replace(/punctSpace/g,pA).replace(/punct/g,fA).getRegex(),AA=Fk(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,mA).replace(/punctSpace/g,pA).replace(/punct/g,fA).getRegex(),jA=Fk(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,fA).getRegex(),MA=Fk(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,mA).replace(/punctSpace/g,pA).replace(/punct/g,fA).getRegex(),NA=Fk(/\\(punct)/,`gu`).replace(/punct/g,fA).getRegex(),PA=Fk(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),FA=Fk($k).replace(`(?:-->|$)`,`-->`).getRegex(),IA=Fk(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,FA).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),LA=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,RA=Fk(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,LA).getRegex(),zA=Fk(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,RA).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),BA=Fk(/^!?\[(label)\]\[(ref)\]/).replace(`label`,RA).replace(`ref`,Yk).getRegex(),VA=Fk(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Yk).getRegex(),HA=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,UA=Fk(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,LA).getRegex(),WA=Fk(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Fk(/^!?\[(label)\]\[(ref)\]/).replace(`label`,UA).replace(`ref`,HA).getRegex()).replace(`nolink`,Fk(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,HA).getRegex()).getRegex(),GA=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,KA=Fk(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),qA={_backpedal:Nk,anyPunctuation:NA,autolink:PA,blockSkip:bA,br:uA,code:lA,del:Nk,delLDelim:Nk,delRDelim:Nk,emStrongLDelim:SA,emStrongRDelimAst:EA,emStrongRDelimUnd:kA,escape:cA,link:zA,nolink:VA,punctuation:hA,reflink:BA,reflinkSearch:WA,tag:IA,text:dA,url:Nk},JA={...qA,emStrongLDelim:wA,emStrongRDelimAst:OA,emStrongRDelimUnd:AA,link:Fk(/^!?\[(label)\]\((.*?)\)/).replace(`label`,RA).getRegex(),reflink:Fk(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,RA).getRegex()},YA={...qA,emStrongRDelimAst:DA,emStrongLDelim:CA,delLDelim:jA,delRDelim:MA,url:Fk(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,KA).replace(`protocol`,GA).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Fk(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,GA).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},XA={...YA,br:Fk(uA).replace(`{2,}`,`*`).getRegex(),text:Fk(YA.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},ZA={normal:iA,gfm:oA,pedantic:sA},QA={normal:qA,gfm:YA,breaks:XA,pedantic:JA},$A={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},ej=e=>$A[e];function tj(e,t){if(t){if(Lk.escapeTest.test(e))return e.replace(Lk.escapeReplace,ej)}else if(Lk.escapeTestNoEncode.test(e))return e.replace(Lk.escapeReplaceNoEncode,ej);return e}function nj(e){return e.replace(Lk.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function rj(e){try{e=encodeURI(e).replace(Lk.percentDecode,`%`)}catch{return null}return e}function ij(e,t){let n=e.replace(Lk.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Lk.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(Lk.slashPipe,`|`);return n}function aj(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function oj(e){let t=e.split(`
|
|
12
|
+
`),n=t.length-1;for(;n>=0&&Lk.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
13
|
+
`)}function sj(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function cj(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function lj(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function uj(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function dj(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
14
14
|
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
|
15
|
-
`)}function
|
|
16
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:
|
|
17
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=
|
|
15
|
+
`)}function fj(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var pj=class{options;rules;lexer;constructor(e){this.options=e||jk}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:oj(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=dj(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=aj(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:aj(t[0],`
|
|
16
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:aj(t[0],`
|
|
17
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=aj(t[0],`
|
|
18
18
|
`).split(`
|
|
19
19
|
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
20
20
|
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -29,19 +29,19 @@ ${d.join(`
|
|
|
29
29
|
`+e.join(`
|
|
30
30
|
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
31
31
|
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
32
|
-
`,1)[0],l=t[1].length,u=this.options.pedantic?
|
|
32
|
+
`,1)[0],l=t[1].length,u=this.options.pedantic?lj(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>lj(e,l)),d=e.split(`
|
|
33
33
|
`,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
|
|
34
34
|
`,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
|
|
35
35
|
`,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
|
|
36
36
|
`+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
|
|
37
37
|
`+d}f=!d.trim(),r+=l+`
|
|
38
|
-
`,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=
|
|
39
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=
|
|
40
|
-
`):[],a={type:`table`,raw:
|
|
41
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(
|
|
38
|
+
`,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=oj(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=sj(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:aj(t[0],`
|
|
39
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ij(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
40
|
+
`):[],a={type:`table`,raw:aj(t[0],`
|
|
41
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(ij(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:aj(t[0],`
|
|
42
42
|
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
43
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&
|
|
44
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(
|
|
43
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&fj(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=aj(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=cj(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),uj(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&fj(e,n[1],r,this.rules))return;let i=t[sj((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return uj(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:nj(t[0]),escaped:e}}}},mj=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||jk,this.options.tokenizer=this.options.tokenizer||new pj,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:Lk,block:ZA.normal,inline:QA.normal};this.options.pedantic?(t.block=ZA.pedantic,t.inline=QA.pedantic):this.options.gfm&&(t.block=ZA.gfm,t.inline=this.options.breaks?QA.breaks:QA.gfm),this.tokenizer.rules=t}static get rules(){return{block:ZA,inline:QA}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Lk.carriageReturn,`
|
|
44
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Lk.tabCharGlobal,` `).replace(Lk.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
45
45
|
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
46
46
|
`)?``:`
|
|
47
47
|
`)+i.raw,n.text+=`
|
|
@@ -54,9 +54,9 @@ ${d.join(`
|
|
|
54
54
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
55
55
|
`)?``:`
|
|
56
56
|
`)+i.raw,n.text+=`
|
|
57
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,
|
|
58
|
-
`:``;return r?`<pre><code class="language-`+
|
|
59
|
-
`:`<pre><code>`+(n?i:
|
|
57
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,sj(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,sj(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},hj=class{options;parser;constructor(e){this.options=e||jk}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Lk.notSpaceStart)?.[0],i=e?e.replace(Lk.endingNewline,``)+`
|
|
58
|
+
`:``;return r?`<pre><code class="language-`+tj(r)+`">`+(n?i:tj(i,!0))+`</code></pre>
|
|
59
|
+
`:`<pre><code>`+(n?i:tj(i,!0))+`</code></pre>
|
|
60
60
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
61
61
|
${this.parser.parse(e)}</blockquote>
|
|
62
62
|
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
@@ -72,11 +72,11 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
72
72
|
`}tablerow({text:e}){return`<tr>
|
|
73
73
|
${e}</tr>
|
|
74
74
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
75
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
76
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+
|
|
77
|
-
`),class:`-mx-2 flex h-8 min-w-0 items-center gap-2 rounded-md px-2 transition-colors duration-[120ms] hover:bg-accent/50`},[e.label?(B(),V(`span`,
|
|
78
|
-
`),i=J(()=>{let e=Q.relations,n=t.mainline?e.mainlineDeps.map(e=>({from:e.from,to:e.to,state:e.state,note:r(e.edges)})):e.deps.filter(e=>e.from===t.self||e.to===t.self).map(e=>({from:e.from,to:e.to,state:e.state,note:e.note}));return[...n.filter(e=>e.from===t.self).map((e,t)=>({key:`dep-out-${t}`,ref:e.to,label:`依賴`,note:e.note,dep:e.state,...
|
|
79
|
-
`)[0]),9,Nj)):K(``,!0),e.dep?(B(),V(`span`,{key:1,class:k(N(Xw)[e.dep].tone)},j(N(Xw)[e.dep].label),3)):K(``,!0)])]),_:2},1032,[`peek`,`id`,`title`,`status`,`label`]))],64))),128))]),_:1},8,[`count`])):K(``,!0)}}),Fj={class:`flex flex-col`},Ij=[`href`,`title`],Lj={key:3,class:`truncate`},Rj={key:5,class:`ml-auto shrink-0 text-xs text-muted-foreground`},zj=I({__name:`RefSources`,props:{refs:{}},setup(e){return(t,n)=>(B(),V(`ul`,Fj,[(B(!0),V(z,null,L(e.refs,e=>(B(),V(`li`,{key:e.title+(e.url??e.path),class:`-mx-2 flex min-h-8 min-w-0 items-center gap-2 rounded-md px-2 transition-colors hover:bg-accent/50`},[e.url?(B(),H(N(dd),{key:0,class:`size-3.5 shrink-0 text-muted-foreground`})):(B(),H(N(gd),{key:1,class:`size-3.5 shrink-0 text-muted-foreground`})),e.url?(B(),V(`a`,{key:2,href:e.url,target:`_blank`,rel:`noreferrer`,class:`truncate underline decoration-border underline-offset-4 hover:decoration-foreground`,title:e.url},j(e.title),9,Ij)):(B(),V(`span`,Lj,j(e.title),1)),e.path?(B(),H(CD,{key:4,text:e.path,class:`min-w-0`},null,8,[`text`])):K(``,!0),e.date?(B(),V(`span`,Rj,j(e.date),1)):K(``,!0)]))),128))]))}}),Bj=I({__name:`HoverCard`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},openDelay:{},closeDelay:{},enableTouch:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=F_(e,t);return(e,t)=>(B(),H(N(qS),q({"data-slot":`hover-card`},N(n)),{default:P(t=>[R(e.$slots,`default`,A(Cs(t)))]),_:3},16))}}),Vj=I({inheritAttrs:!1,__name:`HoverCardContent`,props:{forceMount:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=P_(Sf(t,`class`));return(e,r)=>(B(),H(N(QS),null,{default:P(()=>[W(N(ZS),q({"data-slot":`hover-card-content`},{...e.$attrs,...N(n)},{class:N(gg)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 rounded-md border p-4 shadow-md outline-hidden`,t.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),Hj=I({__name:`HoverCardTrigger`,props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),H(N($S),q({"data-slot":`hover-card-trigger`},t),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),Uj={class:`shrink-0 font-mono text-[11px] text-muted-foreground`},Wj={key:0,class:`truncate`},Gj={class:`font-mono text-xs text-muted-foreground`},Kj={key:0,class:`mt-1 font-semibold`},qj={class:`mt-2 flex items-center gap-2`},Jj={key:1,class:`text-xs text-muted-foreground`},Yj=I({__name:`RefLabel`,props:{id:{},title:{},status:{},context:{}},emits:[`open`],setup(e,{emit:t}){let n=t;return(t,r)=>(B(),H(N(Bj),{"open-delay":300,"close-delay":100},{default:P(()=>[W(N(Hj),{"as-child":``},{default:P(()=>[U(`button`,{type:`button`,class:`inline-flex h-6 max-w-full min-w-0 items-center gap-1.5 overflow-hidden rounded-md border bg-background px-2 text-xs transition-colors hover:bg-accent`,onClick:r[0]||=au(t=>n(`open`,e.id),[`stop`])},[W(Qw,{type:N(Lw)(e.id),status:e.status},null,8,[`type`,`status`]),U(`span`,Uj,j(e.id),1),e.title?(B(),V(`span`,Wj,j(e.title),1)):K(``,!0)])]),_:1}),W(N(Vj),{class:`w-64`},{default:P(()=>[U(`p`,Gj,j(e.id),1),e.title?(B(),V(`p`,Kj,j(e.title),1)):K(``,!0),U(`div`,qj,[e.status?(B(),H(TE,{key:0,status:e.status},null,8,[`status`])):K(``,!0),e.context?(B(),V(`span`,Jj,j(e.context),1)):K(``,!0)])]),_:1})]),_:1}))}});function Xj(e){let t=tp(),n=J(()=>e?.()??String(t.params.m??``));return F(n,e=>{e&&lw(e).catch(e=>Q.error=e.message)},{immediate:!0}),{id:n,mainline:J(()=>Q.mainlines[n.value])}}var Zj={key:0,class:`pb-8`},Qj={key:0},$j={key:1},eM={key:2,class:`tabular-nums`},tM={key:0,class:`text-xs`},nM={class:`text-xs`},rM={class:`text-xs`},iM={key:1,class:`text-sm text-muted-foreground`},aM={key:1,class:`px-5 text-muted-foreground`},oM=I({__name:`DecisionPeek`,props:{m:{},d:{}},setup(e){let t=e,{open:n}=FC(),{mainline:r}=Xj(()=>t.m),i=J(()=>r.value?.decisions.find(e=>e.id===t.d)),a=J(()=>r.value?.decisions.find(e=>e.id===i.value?.supersededBy)),o=J(()=>r.value?.decisions.filter(e=>e.supersededBy===t.d)??[]),s=e=>n(e,{chain:!0}),c=e=>Mw(e.split(`#`)[0]);return(n,l)=>i.value&&N(r)?(B(),V(`div`,Zj,[W(OD,{id:`${e.m}/${i.value.id}`,title:i.value.title,type:`decision`,status:i.value.status},{notice:P(()=>[i.value.status===`proposed`?(B(),H(N(_g),{key:0,variant:`warning`},{default:P(()=>[W(N(Qu)),W(N(yg),null,{default:P(()=>[...l[0]||=[G(`還沒裁決`,-1)]]),_:1}),i.value.affects?.length?(B(),H(N(vg),{key:0,class:`text-xs text-muted-foreground`},{default:P(()=>[...l[1]||=[G(`在等它的項目列在「影響的項目」。`,-1)]]),_:1})):K(``,!0)]),_:1})):K(``,!0),a.value?(B(),H(N(_g),{key:1},{default:P(()=>[W(N(qd)),W(N(yg),null,{default:P(()=>[G(`已被 `+j(a.value.id)+` 取代`,1)]),_:1}),W(N(vg),{class:`text-xs text-muted-foreground`},{default:P(()=>[...l[2]||=[G(`以下保留當時的理由。新的決定見「取代關係」。`,-1)]]),_:1})]),_:1})):K(``,!0)]),default:P(()=>[W(TE,{status:i.value.status},null,8,[`status`]),i.value.by?(B(),V(`span`,Qj,j(N(qw)[i.value.by])+`決定`,1)):K(``,!0),i.value.basis?(B(),V(`span`,$j,j(N(Jw)[i.value.basis]),1)):K(``,!0),i.value.decidedAt?(B(),V(`span`,eM,j(N(cE)(i.value.decidedAt)),1)):K(``,!0)]),_:1},8,[`id`,`title`,`status`]),W(MD,null,{default:P(()=>[W(JD,{columns:1},{default:P(()=>[i.value.reversible===void 0?K(``,!0):(B(),H($,{key:0,label:`能否改回`,icon:N(sf)},{default:P(()=>[G(j(i.value.reversible?`可以低成本改回`:`不易改回`),1)]),_:1},8,[`icon`])),i.value.priority?(B(),H($,{key:1,label:`優先度`,icon:N(_d)},{default:P(()=>[W(xE,{priority:i.value.priority},null,8,[`priority`]),i.value.priority===`P2`?(B(),V(`span`,tM,`P2`)):K(``,!0)]),_:1},8,[`icon`])):K(``,!0),i.value.category?(B(),H($,{key:2,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(i.value.category),1)]),_:1},8,[`icon`])):K(``,!0),i.value.labels?.length?(B(),H($,{key:3,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(i.value.labels,e=>(B(),H(N(QT),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,nM,j(N(cE)(i.value.created)),1)]),_:1},8,[`icon`]),i.value.closedAt?(B(),H($,{key:4,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,rM,j(N(cE)(i.value.closedAt)),1)]),_:1},8,[`icon`])):K(``,!0),i.value.resolution?(B(),H($,{key:5,label:`結果`,icon:N($u)},{default:P(()=>[G(j(i.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),i.value.origin?(B(),H($,{key:6,label:`來源`,icon:N(cd)},{default:P(()=>[W(Yj,q(N(Mw)(i.value.origin),{onOpen:s}),null,16)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),i.value.body.trim()?(B(),H(MD,{key:0,title:`內文`},{default:P(()=>[W(yj,{source:i.value.body},null,8,[`source`])]),_:1})):K(``,!0),i.value.affects?.length?(B(),H(MD,{key:1,title:`影響的項目`,count:i.value.affects.length},{default:P(()=>[(B(!0),V(z,null,L(i.value.affects,e=>(B(),H(wj,q({key:e,peek:e.split(`#`)[0]},{ref_for:!0},c(e),{id:e}),{default:P(()=>[G(j(e.includes(`#`)?`checklist 項目`:``),1)]),_:2},1040,[`peek`,`id`]))),128))]),_:1},8,[`count`])):K(``,!0),W(Pj,{self:N(wC)(t.m,t.d),links:i.value.links},null,8,[`self`,`links`]),i.value.refs?.length?(B(),H(MD,{key:2,title:`參考來源`,count:i.value.refs.length},{default:P(()=>[W(zj,{refs:i.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0),W(MD,{title:`取代關係`},{default:P(()=>[a.value?(B(),H(wj,{key:0,peek:N(wC)(e.m,a.value.id),label:`被取代為`,id:a.value.id,title:a.value.title,status:a.value.status},null,8,[`peek`,`id`,`title`,`status`])):K(``,!0),(B(!0),V(z,null,L(o.value,t=>(B(),H(wj,{key:t.id,peek:N(wC)(e.m,t.id),label:`取代了`,id:t.id,title:t.title,status:t.status},null,8,[`peek`,`id`,`title`,`status`]))),128)),!a.value&&o.value.length===0?(B(),V(`p`,iM,`沒有取代關係。`)):K(``,!0)]),_:1})])):(B(),V(`p`,aM,`載入 `+j(e.m)+`/`+j(e.d)+`…`,1))}}),sM=`modulepreload`,cM=function(e){return`/`+e},lM={},uM=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),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?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=cM(t,n),t=s(t),t in lM)return;lM[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:sM,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).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)})},dM=`__mainflowVue`;function fM(e){return e.replace(/import\s*\{([^}]*)\}\s*from\s*['"]vue['"];?/g,(e,t)=>`const { ${t.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>e.replace(/\s+as\s+/,`: `)).join(`, `)} } = globalThis.${dM};`)}async function pM(e){let t=URL.createObjectURL(new Blob([fM(e)],{type:`text/javascript`}));try{return await uM(()=>import(t),[])}finally{URL.revokeObjectURL(t)}}async function mM(e,t){globalThis[dM]=xu;let{parse:n,compileScript:r,compileTemplate:i}=await uM(async()=>{let{parse:e,compileScript:t,compileTemplate:n}=await import(`./index.browser-C_4gp6WJ.js`);return{parse:e,compileScript:t,compileTemplate:n}},[]),{descriptor:a,errors:o}=n(e,{filename:t});if(o.length)throw Error(o.map(e=>e.message).join(`; `));for(let e of[a.script,a.scriptSetup])if(e?.lang&&e.lang!==`js`)throw Error(`<script lang="${e.lang}"> is not supported here; write the view in plain JavaScript`);if(a.styles.some(e=>e.scoped))throw Error(`<style scoped> is not supported here; use an unscoped <style> with a class prefix`);let s=`mf-${Math.abs([...t].reduce((e,t)=>e*31+t.charCodeAt(0)|0,7)).toString(36)}`,c={};if((a.script||a.scriptSetup)&&(c={...(await pM(r(a,{id:s,inlineTemplate:!0}).content)).default}),!a.scriptSetup&&a.template){let e=i({source:a.template.content,filename:t,id:s});if(e.errors.length)throw Error(e.errors.map(String).join(`; `));c.render=(await pM(e.code)).render}let l=a.styles.map(e=>e.content).join(`
|
|
80
|
-
`);if(l){let e=document.querySelector(`style[data-mainflow-view="${s}"]`);e||(e=document.createElement(`style`),e.dataset.mainflowView=s,document.head.append(e)),e.textContent=l}return c}var hM={key:0,class:`mb-2 text-sm`},gM=[`src`,`title`],_M=[`src`,`alt`],vM={key:6,class:`overflow-auto rounded-lg border bg-muted/50 p-3 font-mono text-xs leading-relaxed`},yM=I({__name:`CustomContent`,props:{path:{},ctx:{}},setup(e){let t=e,n=[`png`,`jpg`,`jpeg`,`gif`,`svg`,`webp`],r=e=>e.slice(e.lastIndexOf(`.`)+1).toLowerCase(),i=M(``),a=M(``),o=M(null),s=pn(null),c;async function l(){a.value=``,c?.(),c=void 0,s.value=null;let e=r(t.path);try{if(e===`vue`)s.value=await mM(await(await fetch(ZC(t.path))).text(),t.path);else if(e===`js`||e===`mjs`){let e=await uM(()=>import(ZC(t.path)),[]);if(!e.mount)throw Error(`the module must export mount(el, ctx)`);o.value&&(c=e.mount(o.value,t.ctx)??void 0)}else e!==`html`&&!n.includes(e)&&(i.value=await(await fetch(ZC(t.path))).text())}catch(e){a.value=e.message}}return F(()=>[t.path,t.ctx],()=>void l(),{immediate:!0,flush:`post`}),na(()=>c?.()),(t,c)=>(B(),V(`div`,null,[a.value?(B(),V(`p`,hM,`無法渲染 `+j(e.path)+`:`+j(a.value),1)):K(``,!0),r(e.path)===`md`?(B(),H(yj,{key:1,source:i.value},null,8,[`source`])):r(e.path)===`html`?(B(),V(`iframe`,{key:2,src:N(ZC)(e.path),sandbox:`allow-scripts allow-same-origin`,class:`h-[480px] w-full rounded-lg border bg-white`,title:e.path},null,8,gM)):n.includes(r(e.path))?(B(),V(`img`,{key:3,src:N(ZC)(e.path),alt:e.path,class:`max-w-full rounded-lg border`},null,8,_M)):r(e.path)===`js`||r(e.path)===`mjs`?(B(),V(`div`,{key:4,ref_key:`mountPoint`,ref:o},null,512)):r(e.path)===`vue`&&s.value?(B(),H(fa(s.value),{key:5,ctx:e.ctx},null,8,[`ctx`])):r(e.path)===`vue`?K(``,!0):(B(),V(`pre`,vM,j(i.value),1))]))}}),bM=[`主脈絡文件`,`任務文件`,`產物`,`決策`,`自訂視圖`,`參考來源`],xM=e=>e.slice(e.lastIndexOf(`/`)+1),SM=e=>xM(e).includes(`.`)?xM(e).slice(xM(e).lastIndexOf(`.`)+1).toLowerCase():``;function CM(e){let t=t=>t.slice(e.dir.length+1),n=(e,n,r,i)=>({key:e,name:xM(e),kind:n,ext:SM(e),source:r,inMainline:t(e),updated:i}),r=(t,n)=>(t??[]).map(t=>({key:`${n??e.id}:${t.url??t.path}`,name:t.title,kind:`參考來源`,ext:t.url?``:SM(t.path??``),source:n,url:t.url,path:t.path,updated:t.date}));return[n(e.file,`主脈絡文件`,void 0,e.updated),...e.artifacts.map(e=>n(e,`產物`)),...e.tasks.flatMap(e=>[n(e.file,`任務文件`,e.id,e.updated),...e.artifacts.map(t=>n(t,`產物`,e.id))]),...e.decisions.map(e=>n(e.file,`決策`,e.id,e.updated)),...e.views.map(e=>n(e,`自訂視圖`)),...(e.remoteFiles??[]).map(t=>({...n(t,`產物`,e.tasks.find(e=>t.startsWith(`${e.dir}/`))?.id),remoteOnly:!0})),...r(e.refs),...e.tasks.flatMap(e=>r(e.refs,e.id))]}var wM=(e,t)=>e.remoteFiles?.includes(t)??!1;function TM(e,t){return CM(e).find(e=>e.key===t)?.kind??``}var EM={key:0,class:`pb-8`},DM={key:0},OM=[`title`],kM=[`href`],AM={key:0,class:`text-sm text-muted-foreground`},jM={key:1,class:`space-y-2 text-sm`},MM={key:1,class:`px-5 text-muted-foreground`},NM=I({__name:`FilePeek`,props:{m:{},path:{}},setup(e){let t=e,{mainline:n}=Xj(()=>t.m),r=J(()=>n.value?`${n.value.dir}/${t.path}`:``),i=J(()=>n.value?.tasks.find(e=>r.value.startsWith(`${e.dir}/`))),a=J(()=>n.value?.decisions.find(e=>e.file===r.value)),o=J(()=>n.value?TM(n.value,r.value):``),s=J(()=>({mainline:n.value,task:i.value})),c=J(()=>!!n.value&&wM(n.value,r.value)),l=M(`idle`),u=M(``),d=J(()=>c.value&&l.value!==`done`);async function f(){l.value=`loading`,u.value=``;try{let e=await XC.fetchRemote(t.m,r.value);l.value=e.fetched?`done`:`failed`,u.value=e.error??``}catch(e){l.value=`failed`,u.value=e.message}}F([r,c],()=>{c.value&&(l.value=`idle`,f())},{immediate:!0});let p=J(()=>t.path.slice(t.path.lastIndexOf(`/`)+1));return(t,c)=>N(n)?(B(),V(`div`,EM,[W(OD,{title:p.value,mono:``,type:N(zw)(e.path,o.value||void 0)},{default:P(()=>[U(`span`,null,j(o.value),1),d.value?(B(),V(`span`,DM,`只在伺服器上`)):K(``,!0),U(`span`,{class:`truncate font-mono`,title:e.path},j(e.path),9,OM),d.value?K(``,!0):(B(),H(N(sC),{key:1,variant:`ghost`,size:`xs`,class:`ml-auto text-muted-foreground`,"as-child":``},{default:P(()=>[U(`a`,{href:N(ZC)(r.value),target:`_blank`},[W(N(ef)),c[0]||=G(`原始檔`,-1)],8,kM)]),_:1}))]),_:1},8,[`title`,`type`]),W(MD,null,{default:P(()=>[d.value&&l.value!==`failed`?(B(),V(`p`,AM,`這個檔案只在同步伺服器上,正在下載…`)):d.value?(B(),V(`div`,jM,[U(`p`,null,`無法下載這個檔案:`+j(u.value),1),W(N(sC),{variant:`outline`,size:`xs`,onClick:f},{default:P(()=>[...c[1]||=[G(`重試`,-1)]]),_:1})])):(B(),H(yM,{key:2,path:r.value,ctx:s.value},null,8,[`path`,`ctx`]))]),_:1}),W(MD,{title:`所屬`},{default:P(()=>[a.value?(B(),H(wj,{key:0,peek:N(wC)(e.m,a.value.id),id:a.value.id,title:a.value.title,status:a.value.status},null,8,[`peek`,`id`,`title`,`status`])):i.value?(B(),H(wj,{key:1,peek:N(CC)(e.m,i.value.id),id:i.value.id,title:i.value.title,status:i.value.status},null,8,[`peek`,`id`,`title`,`status`])):K(``,!0),W(wj,{peek:e.m,id:e.m,title:N(n).title,status:N(n).status},null,8,[`peek`,`id`,`title`,`status`])]),_:1})])):(B(),V(`p`,MM,`載入 `+j(e.m)+`…`,1))}}),PM={key:0,class:`pb-8`},FM={class:`text-xs`},IM={class:`text-xs`},LM={class:`text-xs`},RM={key:1,class:`px-5 text-muted-foreground`},zM=I({__name:`FindingPeek`,props:{id:{}},setup(e){let t=e,{open:n}=FC(),r=J(()=>Q.findings.find(e=>e.id===t.id)),i=()=>r.value&&dw(()=>XC.archiveFinding(r.value.id,!r.value.archivedAt,r.value.version));return Pw([r.value?.origin]),(a,o)=>r.value?(B(),V(`div`,PM,[W(OD,{id:r.value.id,title:r.value.title,type:`finding`,status:r.value.status},{default:P(()=>[W(TE,{status:r.value.status},null,8,[`status`]),W(eE,{archived:!!r.value.archivedAt,onToggle:i},null,8,[`archived`])]),_:1},8,[`id`,`title`,`status`]),W(MD,null,{default:P(()=>[W(JD,{columns:1},{default:P(()=>[r.value.appliesTo?.length?(B(),H($,{key:0,label:`適用範圍`,icon:N(bd)},{default:P(()=>[(B(!0),V(z,null,L(r.value.appliesTo,e=>(B(),H(CD,{key:e,text:e},null,8,[`text`]))),128))]),_:1},8,[`icon`])):K(``,!0),r.value.reviewAfter?(B(),H($,{key:1,label:`重新確認`,icon:N(qd)},{default:P(()=>[W(pE,{day:r.value.reviewAfter,ended:r.value.status===`obsolete`},null,8,[`day`,`ended`])]),_:1},8,[`icon`])):K(``,!0),r.value.origin?(B(),H($,{key:2,label:`來源`,icon:N(cd)},{default:P(()=>[W(Yj,q(N(Mw)(r.value.origin),{onOpen:o[0]||=e=>N(n)(e,{chain:!0})}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.category?(B(),H($,{key:3,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(r.value.category),1)]),_:1},8,[`icon`])):K(``,!0),r.value.labels?.length?(B(),H($,{key:4,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(r.value.labels,e=>(B(),H(N(QT),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,FM,j(r.value.created),1)]),_:1},8,[`icon`]),r.value.closedAt?(B(),H($,{key:5,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,IM,j(r.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),r.value.resolution?(B(),H($,{key:6,label:`結果`,icon:N($u)},{default:P(()=>[G(j(r.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),r.value.archivedAt?(B(),H($,{key:7,label:`封存`,icon:N(Pu)},{default:P(()=>[U(`span`,LM,j(r.value.archivedAt),1)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),r.value.body.trim()?(B(),H(MD,{key:0,title:`內文`},{default:P(()=>[W(yj,{source:r.value.body},null,8,[`source`])]),_:1})):K(``,!0),W(Pj,{self:t.id,links:r.value.links},null,8,[`self`,`links`]),r.value.refs?.length?(B(),H(MD,{key:1,title:`參考來源`,count:r.value.refs.length},{default:P(()=>[W(zj,{refs:r.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0)])):(B(),V(`p`,RM,`找不到發現 `+j(e.id)+`。`,1))}}),BM=I({__name:`Dialog`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean},unmountOnHide:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=F_(e,t);return(e,t)=>(B(),H(N(gv),q({"data-slot":`dialog`},N(n)),{default:P(t=>[R(e.$slots,`default`,A(Cs(t)))]),_:3},16))}}),VM=I({__name:`DialogOverlay`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Sf(t,`class`);return(e,r)=>(B(),H(N(iy),q({"data-slot":`dialog-overlay`},N(n),{class:N(gg)(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80`,t.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`]))}}),HM=I({inheritAttrs:!1,__name:`DialogContent`,props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},showCloseButton:{type:Boolean,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(t,r)=>(B(),H(N(oy),null,{default:P(()=>[W(VM),W(N(ty),q({"data-slot":`dialog-content`},{...t.$attrs,...N(i)},{class:N(gg)(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg`,n.class)}),{default:P(()=>[R(t.$slots,`default`),e.showCloseButton?(B(),H(N(_v),{key:0,"data-slot":`dialog-close`,class:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`},{default:P(()=>[W(N(uf)),r[0]||=U(`span`,{class:`sr-only`},`Close`,-1)]),_:1})):K(``,!0)]),_:3},16,[`class`])]),_:3}))}}),UM=I({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=P_(Sf(t,`class`));return(e,r)=>(B(),H(N(ny),q({"data-slot":`dialog-description`},N(n),{class:N(gg)(`text-muted-foreground text-sm`,t.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`]))}}),WM=I({__name:`DialogFooter`,props:{class:{type:[Boolean,null,String,Object,Array]},showCloseButton:{type:Boolean,default:!1}},setup(e){let t=e;return(n,r)=>(B(),V(`div`,{"data-slot":`dialog-footer`,class:k(N(gg)(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,t.class))},[R(n.$slots,`default`),e.showCloseButton?(B(),H(N(_v),{key:0,"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`},{default:P(()=>[...r[0]||=[G(` Close `,-1)]]),_:1})]),_:1})):K(``,!0)],2))}}),GM=I({__name:`DialogHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`div`,{"data-slot":`dialog-header`,class:k(N(gg)(`flex flex-col gap-2 text-center sm:text-left`,t.class))},[R(e.$slots,`default`)],2))}}),KM=I({__name:`DialogTitle`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=P_(Sf(t,`class`));return(e,r)=>(B(),H(N(sy),q({"data-slot":`dialog-title`},N(n),{class:N(gg)(`text-lg leading-none font-semibold`,t.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`]))}}),qM={class:`break-words`},JM={key:2,class:`font-mono`},YM=I({__name:`EvidenceText`,props:{text:{}},setup(e){let t=e,{to:n}=FC(),r=/(\.mainflow\/mainlines\/(m\d{3})-[^/\s]+\/([^\s,、;))]+))|(\bm\d{3}\/[td]\d{3}(?:#c\d{3})?\b|\b[if]\d{3}\b)|(\b[0-9a-f]{7,40}\b)|([\w./-]+\.\w+:\d+(?:-\d+)?)/g,i=J(()=>{let e=[],n=0;for(let i of t.text.matchAll(r)){let r=i.index??0;r>n&&e.push({kind:`text`,value:t.text.slice(n,r)});let[a,o,s,c,l,u]=i;o&&!/[{}*]/.test(c)?e.push({kind:`file`,value:a,peek:EC(s,c)}):l?e.push({kind:`ref`,value:a,peek:l.split(`#`)[0]}):u&&/\d/.test(u)&&/[a-f]/.test(u)?e.push({kind:`commit`,value:a}):!o&&!u?e.push({kind:`code`,value:a}):e.push({kind:`text`,value:a}),n=r+a.length}return n<t.text.length&&e.push({kind:`text`,value:t.text.slice(n)}),e}),a=e=>e.slice(e.lastIndexOf(`/`)+1);return(e,t)=>(B(),V(`span`,qM,[(B(!0),V(z,null,L(i.value,(e,r)=>(B(),V(z,{key:r},[e.kind===`ref`||e.kind===`file`?(B(),H(N(Am),{key:0,to:N(n)(e.peek,{chain:!0}),class:`font-mono text-foreground underline decoration-border underline-offset-4 hover:decoration-foreground`,title:e.value,onClick:t[0]||=au(()=>{},[`stop`])},{default:P(()=>[G(j(e.kind===`file`?a(e.value):e.value),1)]),_:2},1032,[`to`,`title`])):e.kind===`commit`?(B(),H(CD,{key:1,text:e.value,class:`align-baseline`},null,8,[`text`])):e.kind===`code`?(B(),V(`code`,JM,j(e.value),1)):(B(),V(z,{key:3},[G(j(e.value),1)],64))],64))),128))]))}}),XM={class:`flex flex-col`},ZM={key:1,class:`mt-0.5 grid size-4 shrink-0 place-items-center rounded-[4px] border border-dashed text-[10px] text-muted-foreground`,"aria-label":`已不需要`},QM={class:`flex min-w-0 flex-1 flex-col gap-0.5`},$M={class:`flex min-w-0 items-start gap-2`},eN=[`title`],tN={key:0,class:`text-xs text-muted-foreground`},nN={key:1,class:`text-xs text-muted-foreground`},rN={key:0},iN={key:2,class:`text-xs text-muted-foreground`},aN={key:3,class:`text-xs text-muted-foreground`},oN={key:1,class:`text-sm text-muted-foreground`},sN={key:0,class:`text-xs text-muted-foreground`},cN=I({__name:`Checklist`,props:{items:{},refPrefix:{},version:{}},setup(e){let t=e,n=J(()=>t.items.filter(e=>!e.done&&!e.dropped)),r=J(()=>t.items.filter(e=>e.done||e.dropped)),i=M(!1),a=J(()=>[...n.value,...i.value?r.value:[]]),o=M(null),s=M(``);async function c(e){if(e.done){await dw(()=>XC.check(`${t.refPrefix}${e.id}`,!1,void 0,t.version));return}o.value=e,s.value=``}async function l(){let e=o.value;e&&s.value.trim()&&await dw(()=>XC.check(`${t.refPrefix}${e.id}`,!0,s.value.trim(),t.version))&&(o.value=null)}return(t,n)=>(B(),V(z,null,[U(`ul`,XM,[(B(!0),V(z,null,L(a.value,e=>(B(),V(`li`,{key:e.id,class:`-mx-2 flex gap-3 rounded-md px-2 py-1.5 transition-colors duration-[120ms] hover:bg-accent/50`},[e.dropped?(B(),V(`span`,ZM,`–`)):(B(),H(N(mE),{key:0,"model-value":e.done||o.value?.id===e.id,class:`mt-0.5`,"aria-label":e.done?`取消勾選 ${e.id}`:`勾選 ${e.id}`,"onUpdate:modelValue":t=>c(e)},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`])),U(`div`,QM,[U(`div`,$M,[W(CD,{text:e.id,class:`mt-px shrink-0`},null,8,[`text`]),U(`span`,{class:k([`min-w-0 flex-1`,{"text-muted-foreground":e.done,"text-muted-foreground line-through":e.dropped}])},j(e.text),3),(B(!0),V(z,null,L(e.serves??[],e=>(B(),V(`span`,{key:e,class:`shrink-0 rounded-sm bg-secondary px-1.5 font-mono text-[11px] text-muted-foreground`,title:`推進解決條件 ${e}`},j(e),9,eN))),128))]),e.doneWhen&&!e.done&&!e.dropped?(B(),V(`p`,tN,`完成定義:`+j(e.doneWhen),1)):K(``,!0),e.done&&e.evidence?(B(),V(`p`,nN,[W(YM,{text:e.evidence},null,8,[`text`]),e.doneAt?(B(),V(`span`,rN,` · `+j(e.doneAt),1)):K(``,!0)])):K(``,!0),e.dropped?(B(),V(`p`,iN,[n[6]||=G(` 不需要了`,-1),e.supersededBy?(B(),V(z,{key:0},[n[4]||=G(`,由 `,-1),W(YM,{text:e.supersededBy},null,8,[`text`]),n[5]||=G(` 取代`,-1)],64)):K(``,!0),e.note?(B(),V(z,{key:1},[G(`:`+j(e.note),1)],64)):K(``,!0)])):e.note?(B(),V(`p`,aN,j(e.note),1)):K(``,!0)])]))),128))]),r.value.length?(B(),H(N(sC),{key:0,variant:`ghost`,size:`xs`,class:`-ml-2 text-muted-foreground`,"aria-expanded":i.value,onClick:n[0]||=e=>i.value=!i.value},{default:P(()=>[i.value?(B(),H(N(Ju),{key:0})):(B(),H(N(Xu),{key:1})),G(j(i.value?`收起已完成`:`已完成 ${r.value.length} 個`),1)]),_:1},8,[`aria-expanded`])):K(``,!0),e.items.length===0?(B(),V(`p`,oN,`沒有項目`)):K(``,!0),W(N(BM),{open:o.value!==null,"onUpdate:open":n[3]||=e=>!e&&(o.value=null)},{default:P(()=>[W(N(HM),{class:`sm:max-w-lg`},{default:P(()=>[W(N(GM),null,{default:P(()=>[W(N(KM),null,{default:P(()=>[G(`勾選 `+j(o.value?.id),1)]),_:1}),W(N(UM),null,{default:P(()=>[G(j(o.value?.text),1)]),_:1})]),_:1}),U(`form`,{class:`flex flex-col gap-3`,onSubmit:au(l,[`prevent`])},[o.value?.doneWhen?(B(),V(`p`,sN,`完成定義:`+j(o.value.doneWhen),1)):K(``,!0),W(N(ZE),{modelValue:s.value,"onUpdate:modelValue":n[1]||=e=>s.value=e,autofocus:``,placeholder:`證據:commit、檔案:行號或指令輸出`,"aria-label":`證據`},null,8,[`modelValue`]),W(N(WM),null,{default:P(()=>[W(N(sC),{type:`button`,variant:`ghost`,onClick:n[2]||=e=>o.value=null},{default:P(()=>[...n[7]||=[G(`取消`,-1)]]),_:1}),W(N(sC),{type:`submit`,disabled:!s.value.trim()},{default:P(()=>[...n[8]||=[G(`勾選`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`])],64))}}),lN=[`P0`,`P1`,`P2`,`P3`].map(e=>({value:e,label:e})),uN=e=>e??`P2`,dN=e=>e.map(e=>({value:e,label:Gw[e]??e,status:e})),fN=e=>Ww.has(e);function pN(e,t){let n=e.filters.flatMap(e=>e.values(t).flatMap(t=>[t,e.optionLabel?.(t)??e.options?.find(e=>e.value===t)?.label??``]));return[e.id(t),e.text(t),...n].filter(Boolean).join(` `)}var mN=e=>({doing:e.filter(e=>e.status===`doing`).length,open:e.filter(e=>!fN(e.status)).length}),hN=e=>({key:`status`,label:`狀態`,value:e=>e.status,order:e,groupLabel:e=>Gw[e]??e,status:e=>e}),gN=(e,t)=>e.values?.(t)??[e.value(t)];function _N(e,t){let n=new Map;for(let r of t)for(let t of gN(e,r))n.set(t,[...n.get(t)??[],r]);let r=t=>e.order?.includes(t)?e.order.indexOf(t):1/0,i=t=>Number(e.trailing?.includes(t)??!1);return[...n.keys()].sort((t,n)=>i(t)-i(n)||r(t)-r(n)||t.localeCompare(n)*(e.latestFirst?-1:1)).map(t=>({key:t,label:e.groupLabel?.(t)??t,status:e.status?.(t),detail:e.detail?.(t),items:n.get(t)}))}var vN=`f.`,yN=e=>(Array.isArray(e)?e[0]:e)??void 0,bN=(e,t=``)=>{if(!e.startsWith(t))return!1;let n=e.slice(t.length);return n===`q`||n===`sort`||n===`archived`||n.startsWith(vN)},xN=e=>$C(e,{}),SN=(e,t)=>ew(e,{...xN(e),...t});function CN(e,t){let n=tp(),r=ep(),i=`mainflow.list.${e.key}`,a=e.queryPrefix??``,o=xN(i),s=e=>Object.fromEntries(Object.entries(e).filter(([e])=>bN(e,a)));function c(e){let t={...n.query};for(let[n,r]of Object.entries(e))r?t[n]=r:delete t[n];r.replace({query:t})}let l=o.query??{},u=Object.keys(l).length>0&&Object.keys(s(n.query)).length===0;$i(()=>u&&void r.replace({query:{...n.query,...l}}));let d=()=>`${n.path}?${yN(n.query.view)??``}`,f=d();F(()=>s(n.query),(e,t)=>{d()!==f||u&&t===void 0||SN(i,{query:e})},{deep:!0,immediate:!0});let p=J({get:()=>yN(n.query[`${a}q`])??``,set:e=>c({[`${a}q`]:e.trim()?e:void 0})}),m=J(()=>{let t=yN(n.query[`${a}sort`])??``,r=t.replace(/^-/,``),i=e.sorts.find(e=>e.key===r),o=i??e.sorts.find(t=>t.key===e.defaultSort);return{field:o,dir:i?t.startsWith(`-`)?`desc`:`asc`:o.dir,chosen:!!i}});function h(t,n){let r=e.sorts.find(e=>e.key===t);c({[`${a}sort`]:`${(n??r.dir)===`desc`?`-`:``}${t}`})}let g=()=>c({[`${a}sort`]:void 0});function _(e){let{field:t,dir:n,chosen:r}=m.value;!r||t.key!==e?h(e,`desc`):n===`desc`?h(e,`asc`):g()}let v=J(()=>Object.fromEntries(e.filters.map(e=>[e.key,(yN(n.query[`${a}${vN}${e.key}`])??``).split(`,`).filter(Boolean)])));function y(e,t){let n=v.value[e]??[],r=n.includes(t)?n.filter(e=>e!==t):[...n,t];c({[`${a}${vN}${e}`]:r.join(`,`)||void 0})}let b=e=>c({[`${a}${vN}${e}`]:void 0}),x=()=>c({[`${a}q`]:void 0,[`${a}archived`]:void 0,...Object.fromEntries(e.filters.map(e=>[`${a}${vN}${e.key}`,void 0]))}),S=J(()=>{let e=yN(n.query[`${a}archived`]);return e===`with`||e===`only`?e:`without`}),C=e=>c({[`${a}archived`]:e===`without`?void 0:e}),w=M(o.group!==void 0&&(o.group===``||e.groups.some(e=>e.key===o.group))?o.group:e.defaultGroup);function T(e){w.value=e,SN(i,{group:e})}function ee(e){if(e.options)return e.options;let n=new Set(t().flatMap(e.values));for(let t of v.value[e.key]??[])n.add(t);return[...n].sort().map(t=>({value:t,label:e.optionLabel?.(t)??t}))}let E=J(()=>{let n=p.value.toLowerCase().split(/\s+/).filter(Boolean);return t().filter(t=>{if(e.archived){let n=e.archived(t);if(S.value===`without`&&n||S.value===`only`&&!n)return!1}for(let n of e.filters){let e=v.value[n.key]??[];if(e.length>0&&!n.values(t).some(t=>e.includes(t)))return!1}let r=pN(e,t).toLowerCase();return n.every(e=>r.includes(e))})}),te=J(()=>{let{field:t,dir:n}=m.value,r=n===`asc`?1:-1;return[...E.value].sort((n,i)=>{let a=t.value(n),o=t.value(i),s=Number(a==null||a===``)-Number(o==null||o===``);return s===0?((typeof a==`number`&&typeof o==`number`?a-o:String(a).localeCompare(String(o)))||e.id(n).localeCompare(e.id(i)))*r:s})}),ne=J(()=>{let t=e.groups.find(e=>e.key===w.value),n=S.value!==`only`&&!v.value.status?.length,r=t=>n?{items:t.filter(t=>!e.ended?.(t)),ended:t.filter(t=>e.ended?.(t))}:{items:t,ended:[]};return t?_N(t,te.value).map(({key:e,label:n,status:i,detail:a,items:o})=>{let s=t.leader?.(e);return{key:e,label:n,status:i,leader:s,detail:a,...r(o.filter(e=>e!==s))}}):te.value.length?[{key:``,label:``,...r(te.value)}]:[]}),re=Qt(new Set(o.collapsed??[])),D=Qt(new Set(o.endedFolded??[])),ie=(e,t,n)=>{e.has(t)?e.delete(t):e.add(t),SN(i,{[n]:[...e]})};return{spec:e,search:p,sort:m,setSort:h,clearSort:g,cycleSort:_,filters:v,toggleFilter:y,clearFilter:b,clearAll:x,activeFilters:J(()=>e.filters.flatMap(e=>(v.value[e.key]??[]).map(t=>({field:e,value:t,label:ee(e).find(e=>e.value===t)?.label??t})))),optionsOf:ee,archived:S,setArchived:C,group:w,setGroup:T,total:J(()=>t().length),shown:J(()=>E.value.length),sorted:te,groups:ne,collapsed:re,endedFolded:D,toggleCollapsed:e=>ie(re,e,`collapsed`),toggleEnded:e=>ie(D,e,`endedFolded`)}}var wN=`未分組`;function TN(e,t){if(!e)return!1;let n=Q.summary?.hub;return e===t||n!==void 0&&e===`${n}:${t}`}var EN=e=>e?Q.summary?.groups.find(t=>t.id===e):void 0;function DN(e=Q.summary?.groups??[]){return[...e].sort((e,t)=>Number(fN(e.status))-Number(fN(t.status))||uN(e.priority).localeCompare(uN(t.priority))||e.id.localeCompare(t.id))}var ON=e=>e===`未分組`?wN:`${e} ${EN(e)?.title??``}`.trim();function kN(e){return{key:`group`,label:`組`,value:t=>e(t)??`未分組`,get order(){return DN().map(e=>e.id)},trailing:[wN],groupLabel:ON,detail:e=>{let t=EN(e);return t&&{ref:t.id,title:t.title,status:t.status,priority:t.priority??null,trigger:t.trigger,summary:t.summary}}}}function AN(e){return{key:`group`,label:`組`,values:t=>[e(t)||`未分組`],optionLabel:ON}}var jN={key:0,class:`pb-8`},MN={key:0,class:`text-xs`},NN={class:`text-xs`},PN={class:`text-xs`},FN={class:`flex flex-col gap-1.5 text-sm`},IN={class:`shrink-0 font-mono text-xs text-muted-foreground`},LN={class:`shrink-0`},RN=[`title`],zN={key:0,class:`text-sm text-muted-foreground`},BN={key:1,class:`px-5 text-muted-foreground`},VN=I({__name:`GroupPeek`,props:{id:{}},setup(e){let t=e,{open:n}=FC(),r=J(()=>EN(t.id)),i=e=>{let t=r.value?.order.indexOf(e)??-1;return t<0?2**53-1:t},a=J(()=>(Q.summary?.mainlines??[]).filter(e=>TN(e.group,t.id)&&!e.archivedAt).sort((e,t)=>i(e.id)-i(t.id))),o=J(()=>Q.issues.filter(e=>TN(e.group,t.id)&&!e.archivedAt).sort((e,t)=>i(e.id)-i(t.id))),s=e=>Q.sessions.filter(e=>!e.archivedAt&&(e.status===`active`||e.status===`paused`)).filter(t=>t.actions.some(t=>(t.status===`doing`||t.status===`blocked`)&&t.serves.some(e))).map(e=>({session:e,name:Dw(e)})),c=e=>s(t=>t.startsWith(`${e}/`)||t.startsWith(`${e}#`)),l=J(()=>s(e=>e.startsWith(`${t.id}#`))),u=J(()=>(Q.relations.groupMembers[t.id]??[]).filter(e=>!e.archived)),d=J(()=>u.value.filter(e=>e.kind===`mainline`)),f=J(()=>u.value.filter(e=>e.kind===`issue`));return(i,s)=>r.value?(B(),V(`div`,jN,[W(OD,{id:r.value.id,title:r.value.title,type:`group`,status:r.value.status},{default:P(()=>[W(TE,{status:r.value.status},null,8,[`status`])]),_:1},8,[`id`,`title`,`status`]),W(MD,null,{default:P(()=>[W(JD,{columns:1},{default:P(()=>[W($,{label:`優先度`,icon:N(_d)},{default:P(()=>[W(xE,{priority:r.value.priority},null,8,[`priority`]),!r.value.priority||r.value.priority===`P2`?(B(),V(`span`,MN,`P2`)):K(``,!0)]),_:1},8,[`icon`]),r.value.trigger?(B(),H($,{key:0,label:`時機`,icon:N(rd)},{default:P(()=>[G(j(r.value.trigger),1)]),_:1},8,[`icon`])):K(``,!0),r.value.origin?(B(),H($,{key:1,label:`來源`,icon:N(cd)},{default:P(()=>[W(Yj,q(N(Mw)(r.value.origin),{onOpen:s[0]||=e=>N(n)(e,{chain:!0})}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.category?(B(),H($,{key:2,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(r.value.category),1)]),_:1},8,[`icon`])):K(``,!0),r.value.labels?.length?(B(),H($,{key:3,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(r.value.labels,e=>(B(),H(N(QT),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,NN,j(r.value.created),1)]),_:1},8,[`icon`]),r.value.closedAt?(B(),H($,{key:4,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,PN,j(r.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),r.value.resolution?(B(),H($,{key:5,label:`結果`,icon:N($u)},{default:P(()=>[G(j(r.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),r.value.body.trim()?(B(),H(MD,{key:0,title:`內文`},{default:P(()=>[W(yj,{source:r.value.body},null,8,[`source`])]),_:1})):K(``,!0),W(MD,{title:`解決條件`,count:r.value.criteria?.length??0},{default:P(()=>[W(cN,{items:r.value.criteria??[],"ref-prefix":`${r.value.id}#`,version:r.value.version},null,8,[`items`,`ref-prefix`,`version`]),(B(!0),V(z,null,L(l.value,({session:e,name:t})=>(B(),H(wj,{key:e.id,peek:N(TC)(e.id),title:t,status:e.status},{default:P(()=>[...s[1]||=[G(`在做組的條件`,-1)]]),_:1},8,[`peek`,`title`,`status`]))),128))]),_:1},8,[`count`]),r.value.grants?.length?(B(),H(MD,{key:1,title:`授權`,count:r.value.grants.length},{default:P(()=>[U(`ul`,FN,[(B(!0),V(z,null,L(r.value.grants,e=>(B(),V(`li`,{key:e.id,class:`flex min-w-0 items-baseline gap-2`},[U(`span`,IN,j(e.id),1),U(`span`,LN,j(e.action),1),U(`span`,{class:`min-w-0 truncate text-muted-foreground`,title:e.note?`${e.target}:${e.note}`:e.target},j(e.target),9,RN)]))),128))])]),_:1},8,[`count`])):K(``,!0),W(MD,{title:`主脈絡`,count:a.value.length},{default:P(()=>[(B(!0),V(z,null,L(a.value,(e,t)=>(B(),H(wj,{key:e.id,peek:e.id,id:`${t+1}. ${e.id}`,title:e.title,status:e.status},{default:P(()=>[(B(!0),V(z,null,L(c(e.id),e=>(B(),V(`span`,{key:e.session.id,class:`mr-2`},j(e.name),1))),128)),G(j(N(Gw)[e.status]??e.status),1)]),_:2},1032,[`peek`,`id`,`title`,`status`]))),128)),a.value.length===0?(B(),V(`p`,zN,[s[2]||=G(`還沒有主脈絡在這組。用 `,-1),U(`code`,null,`mainflow mainline set <m> --group `+j(r.value.id),1),s[3]||=G(` 加入。`,-1)])):K(``,!0)]),_:1},8,[`count`]),o.value.length?(B(),H(MD,{key:2,title:`待辦事項`,count:o.value.length},{default:P(()=>[(B(!0),V(z,null,L(o.value,e=>(B(),H(wj,{key:e.id,peek:e.id,id:e.id,title:e.title,status:e.status},{default:P(()=>[W(xE,{priority:e.priority},null,8,[`priority`])]),_:2},1032,[`peek`,`id`,`title`,`status`]))),128))]),_:1},8,[`count`])):K(``,!0),u.value.length?(B(),H(MD,{key:3,title:`其他 hub 的成員`,count:u.value.length},{default:P(()=>[(B(!0),V(z,null,L([...d.value,...f.value],e=>(B(),H(wj,{key:e.ref,peek:e.ref,id:e.ref,title:e.title,status:e.status},{default:P(()=>[G(j(e.kind===`issue`?`待辦`:`主脈絡`)+` · `+j(N(Gw)[e.status]??e.status),1)]),_:2},1032,[`peek`,`id`,`title`,`status`]))),128))]),_:1},8,[`count`])):K(``,!0),W(Pj,{self:t.id,links:r.value.links},null,8,[`self`,`links`]),r.value.refs?.length?(B(),H(MD,{key:4,title:`參考來源`,count:r.value.refs.length},{default:P(()=>[W(zj,{refs:r.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0)])):(B(),V(`p`,BN,`找不到組 `+j(e.id)+`。`,1))}}),HN={key:0,class:`pb-8`},UN={key:0,class:`text-xs`},WN={class:`text-xs`},GN={class:`text-xs`},KN={class:`text-xs`},qN={key:1,class:`px-5 text-muted-foreground`},JN=I({__name:`IssuePeek`,props:{id:{}},setup(e){let t=e,{open:n}=FC(),r=J(()=>Q.issues.find(e=>e.id===t.id)),i=e=>n(e,{chain:!0}),a=()=>r.value&&dw(()=>XC.archiveIssue(r.value.id,!r.value.archivedAt,r.value.version));return Pw([r.value?.origin,r.value?.plannedIn]),(n,o)=>r.value?(B(),V(`div`,HN,[W(OD,{id:r.value.id,title:r.value.title,type:`issue`,status:r.value.status},{default:P(()=>[W(TE,{status:r.value.status},null,8,[`status`]),W(eE,{archived:!!r.value.archivedAt,onToggle:a},null,8,[`archived`])]),_:1},8,[`id`,`title`,`status`]),W(MD,null,{default:P(()=>[W(JD,{columns:1},{default:P(()=>[r.value.priority?(B(),H($,{key:0,label:`優先度`,icon:N(_d)},{default:P(()=>[W(xE,{priority:r.value.priority},null,8,[`priority`]),r.value.priority===`P2`?(B(),V(`span`,UN,`P2`)):K(``,!0)]),_:1},8,[`icon`])):K(``,!0),r.value.group?(B(),H($,{key:1,label:`組`,icon:N(Hu)},{default:P(()=>[W(Yj,q(N(Mw)(r.value.group),{onOpen:i}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.due?(B(),H($,{key:2,label:`到期`,icon:N(Wu)},{default:P(()=>[W(pE,{day:r.value.due,ended:r.value.status===`closed`},null,8,[`day`,`ended`])]),_:1},8,[`icon`])):K(``,!0),r.value.plannedIn?(B(),H($,{key:3,label:`排入`,icon:N(Ku)},{default:P(()=>[W(Yj,q(N(Mw)(r.value.plannedIn),{onOpen:i}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.origin?(B(),H($,{key:4,label:`來源`,icon:N(cd)},{default:P(()=>[W(Yj,q(N(Mw)(r.value.origin),{onOpen:i}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.category?(B(),H($,{key:5,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(r.value.category),1)]),_:1},8,[`icon`])):K(``,!0),r.value.labels?.length?(B(),H($,{key:6,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(r.value.labels,e=>(B(),H(N(QT),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,WN,j(r.value.created),1)]),_:1},8,[`icon`]),r.value.closedAt?(B(),H($,{key:7,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,GN,j(r.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),r.value.resolution?(B(),H($,{key:8,label:`結果`,icon:N($u)},{default:P(()=>[G(j(r.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),r.value.archivedAt?(B(),H($,{key:9,label:`封存`,icon:N(Pu)},{default:P(()=>[U(`span`,KN,j(r.value.archivedAt),1)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),r.value.body.trim()?(B(),H(MD,{key:0,title:`內文`},{default:P(()=>[W(yj,{source:r.value.body},null,8,[`source`])]),_:1})):K(``,!0),W(Pj,{self:t.id,links:r.value.links},null,8,[`self`,`links`]),r.value.refs?.length?(B(),H(MD,{key:1,title:`參考來源`,count:r.value.refs.length},{default:P(()=>[W(zj,{refs:r.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0)])):(B(),V(`p`,qN,`找不到待辦 `+j(e.id)+`。`,1))}}),YN=[`title`],XN={class:`h-1.5 w-14 overflow-hidden rounded-full bg-primary/20`},ZN={class:`min-w-7 tabular-nums`},QN=I({__name:`ProgressBar`,props:{done:{},total:{}},setup(e){let t=e,n=J(()=>t.total===0?0:Math.round(t.done/t.total*100));return(t,r)=>(B(),V(`span`,{class:`inline-flex items-center gap-2 text-xs text-muted-foreground`,title:`${e.done}/${e.total}`},[U(`span`,XN,[U(`span`,{class:`block h-full rounded-full bg-primary`,style:he({width:`${n.value}%`})},null,4)]),U(`span`,ZN,j(e.done)+`/`+j(e.total),1)],8,YN))}}),$N={key:0,class:`text-xs`},eP={class:`text-xs`},tP={class:`text-xs`},nP={class:`text-xs tabular-nums`},rP={class:`text-xs`},iP={class:`flex flex-col gap-2`},aP={class:`mr-2 font-mono text-xs text-muted-foreground`},oP={class:`w-full text-xs`},sP={class:`py-1.5 tabular-nums`},cP={class:`text-right tabular-nums`},lP={class:`text-right tabular-nums`},uP={class:`pl-3 text-muted-foreground`},dP={key:0,class:`text-sm text-muted-foreground`},fP=I({__name:`MainlineBody`,props:{mainline:{},columns:{default:1}},setup(e){let t=e,{open:n}=FC(),r=J(()=>t.mainline),i=J(()=>r.value.tasks.flatMap(e=>e.checklist).filter(e=>!e.dropped)),a=J(()=>r.value.criteria.filter(e=>!e.dropped)),o=J(()=>r.value.decisions.filter(e=>e.status===`proposed`)),s=J(()=>Math.round((r.value.costs??[]).reduce((e,t)=>e+(t.actual??0),0)*100)/100),c=J(()=>r.value.budget?.unit??r.value.costs?.[0]?.unit??``),l=J(()=>Q.issues.filter(e=>!e.archivedAt&&(e.origin?.startsWith(`${r.value.id}/`)||e.plannedIn?.startsWith(`${r.value.id}/`)))),u=J(()=>jw(r.value.id)),d=[`done`,`dropped`];return(t,f)=>(B(),V(z,null,[W(MD,null,{default:P(()=>[W(JD,{columns:e.columns},{default:P(()=>[W($,{label:`解決條件`,icon:N(af)},{default:P(()=>[W(QN,{done:a.value.filter(e=>e.done).length,total:a.value.length},null,8,[`done`,`total`])]),_:1},8,[`icon`]),W($,{label:`checklist`,icon:N(Pd)},{default:P(()=>[W(QN,{done:i.value.filter(e=>e.done).length,total:i.value.length},null,8,[`done`,`total`])]),_:1},8,[`icon`]),r.value.group?(B(),H($,{key:0,label:`組`,icon:N(Hu)},{default:P(()=>[W(Yj,q(N(Mw)(r.value.group),{onOpen:f[0]||=e=>N(n)(e,{chain:!0})}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.priority?(B(),H($,{key:1,label:`優先度`,icon:N(_d)},{default:P(()=>[W(xE,{priority:r.value.priority},null,8,[`priority`]),r.value.priority===`P2`?(B(),V(`span`,$N,`P2`)):K(``,!0)]),_:1},8,[`icon`])):K(``,!0),r.value.due?(B(),H($,{key:2,label:`到期`,icon:N(Wu)},{default:P(()=>[W(pE,{day:r.value.due,ended:d.includes(r.value.status)},null,8,[`day`,`ended`])]),_:1},8,[`icon`])):K(``,!0),r.value.category?(B(),H($,{key:3,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(r.value.category),1)]),_:1},8,[`icon`])):K(``,!0),r.value.labels?.length?(B(),H($,{key:4,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(r.value.labels,e=>(B(),H(N(QT),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,eP,j(r.value.created),1)]),_:1},8,[`icon`]),r.value.closedAt?(B(),H($,{key:5,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,tP,j(r.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),r.value.resolution?(B(),H($,{key:6,label:`結果`,icon:N($u)},{default:P(()=>[G(j(r.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),r.value.origin?(B(),H($,{key:7,label:`來源`,icon:N(cd)},{default:P(()=>[W(Yj,q(N(Mw)(r.value.origin),{onOpen:f[1]||=e=>N(n)(e,{chain:!0})}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.budget||r.value.costs?.length?(B(),H($,{key:8,label:`花費`,icon:N(cf)},{default:P(()=>[U(`span`,nP,[G(j(s.value),1),r.value.budget?(B(),V(z,{key:0},[G(` / `+j(r.value.budget.amount),1)],64)):K(``,!0),G(` `+j(c.value),1)])]),_:1},8,[`icon`])):K(``,!0),r.value.archivedAt?(B(),H($,{key:9,label:`封存`,icon:N(Pu)},{default:P(()=>[U(`span`,rP,j(r.value.archivedAt),1)]),_:1},8,[`icon`])):K(``,!0)]),_:1},8,[`columns`])]),_:1}),o.value.length?(B(),H(MD,{key:0,title:`待裁決的決策`,count:o.value.length},{default:P(()=>[U(`div`,iP,[(B(!0),V(z,null,L(o.value,e=>(B(),H(N(_g),{key:e.id,variant:`warning`,class:`cursor-pointer transition-colors hover:bg-accent/50`,onClick:t=>N(n)(N(wC)(r.value.id,e.id),{chain:!0})},{default:P(()=>[W(N(Qu)),W(N(yg),null,{default:P(()=>[U(`span`,aP,j(e.id),1),G(j(e.title),1)]),_:2},1024),e.affects?.length?(B(),H(N(vg),{key:0,class:`text-xs text-muted-foreground`},{default:P(()=>[G(`在等它的有 `+j(e.affects.join(`、`)),1)]),_:2},1024)):K(``,!0)]),_:2},1032,[`onClick`]))),128))])]),_:1},8,[`count`])):K(``,!0),W(MD,{title:`解決條件`,count:r.value.criteria.length},{default:P(()=>[W(cN,{items:r.value.criteria,"ref-prefix":`${r.value.id}#`,version:r.value.version},null,8,[`items`,`ref-prefix`,`version`])]),_:1},8,[`count`]),r.value.body.trim()?(B(),H(MD,{key:1,title:`內文`},{default:P(()=>[W(yj,{source:r.value.body},null,8,[`source`])]),_:1})):K(``,!0),W(Pj,{self:r.value.id,links:r.value.links,mainline:``},null,8,[`self`,`links`]),r.value.refs?.length?(B(),H(MD,{key:2,title:`參考來源`,count:r.value.refs.length},{default:P(()=>[W(zj,{refs:r.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0),r.value.costs?.length?(B(),H(MD,{key:3,title:`花費明細`,count:r.value.costs.length},{default:P(()=>[U(`table`,oP,[f[2]||=U(`thead`,{class:`text-muted-foreground`},[U(`tr`,{class:`border-b`},[U(`th`,{class:`py-1.5 text-left font-medium`},`日期`),U(`th`,{class:`text-left font-medium`},`項目`),U(`th`,{class:`text-right font-medium`},`預估`),U(`th`,{class:`text-right font-medium`},`實際`),U(`th`,{class:`pl-3 text-left font-medium`},`備註`)])],-1),U(`tbody`,null,[(B(!0),V(z,null,L(r.value.costs,(e,t)=>(B(),V(`tr`,{key:t,class:`border-b`},[U(`td`,sP,j(e.date),1),U(`td`,null,j(e.item),1),U(`td`,cP,j(e.estimate??``),1),U(`td`,lP,j(e.actual??``),1),U(`td`,uP,j(e.note??``),1)]))),128))])])]),_:1},8,[`count`])):K(``,!0),l.value.length?(B(),H(MD,{key:4,title:`相關的待辦`,count:l.value.length},{default:P(()=>[(B(!0),V(z,null,L(l.value,e=>(B(),H(wj,{key:e.id,peek:e.id,id:e.id,title:e.title,status:e.status},null,8,[`peek`,`id`,`title`,`status`]))),128))]),_:1},8,[`count`])):K(``,!0),W(MD,{title:`推進過它的會話`,count:u.value.length},{default:P(()=>[(B(!0),V(z,null,L(u.value,({session:e,actions:t})=>(B(),H(wj,{key:e.id,peek:N(TC)(e.id),title:N(Dw)(e),status:e.status},{default:P(()=>[G(j(t.length)+` 個行動`,1)]),_:2},1032,[`peek`,`title`,`status`]))),128)),u.value.length===0?(B(),V(`p`,dP,`這台電腦上沒有推進它的會話。會話只記在本機。`)):K(``,!0)]),_:1},8,[`count`])],64))}}),pP={class:`inline-flex h-7 items-center gap-1.5 rounded-full border bg-background px-2.5 text-xs font-medium transition-colors hover:bg-accent focus-within:ring-3 focus-within:ring-ring/50`},mP=[`value`],hP=[`value`],gP=I({__name:`StatusSelect`,props:{status:{},options:{}},emits:[`change`],setup(e,{emit:t}){let n=t;return(t,r)=>(B(),V(`label`,pP,[W(wE,{status:e.status},null,8,[`status`]),U(`select`,{class:`cursor-pointer bg-transparent outline-none`,value:e.status,onChange:r[0]||=e=>n(`change`,e.target.value)},[(B(!0),V(z,null,L(e.options,e=>(B(),V(`option`,{key:e,value:e},j(N(Gw)[e]??e),9,hP))),128))],40,mP)]))}}),_P={key:0,class:`pb-8`},vP={key:1,class:`px-5 text-muted-foreground`},yP=I({__name:`MainlinePeek`,props:{m:{}},setup(e){let t=e,{mainline:n}=Xj(()=>t.m),r=e=>n.value&&dw(()=>XC.mainlineStatus(t.m,e,n.value.version)),i=e=>n.value&&dw(()=>XC.mainlineTitle(t.m,e,n.value.version)),a=()=>n.value&&dw(()=>XC.archive(t.m,!n.value.archivedAt,n.value.version));return(t,o)=>N(n)?(B(),V(`div`,_P,[W(OD,{id:N(n).id,title:N(n).title,type:`mainline`,status:N(n).status,editable:``,onRename:i},{default:P(()=>[W(gP,{status:N(n).status,options:N(Bw),onChange:r},null,8,[`status`,`options`]),W(eE,{archived:!!N(n).archivedAt,onToggle:a},null,8,[`archived`]),W(N(sC),{variant:`ghost`,size:`xs`,class:`ml-auto text-muted-foreground`,"as-child":``},{default:P(()=>[W(N(Am),{to:`/mainlines/${N(n).id}`},{default:P(()=>[W(N(ef)),o[0]||=G(`開啟工作區`,-1)]),_:1},8,[`to`])]),_:1})]),_:1},8,[`id`,`title`,`status`]),W(fP,{mainline:N(n)},null,8,[`mainline`])])):(B(),V(`p`,vP,`載入 `+j(e.m)+`…`,1))}}),bP=[`datetime`,`title`],xP=I({__name:`RelativeTime`,props:{at:{}},setup(e){let t=e,n=If({scheduler:e=>Cf(e,6e4)}),r=new Intl.RelativeTimeFormat(`zh-TW`,{numeric:`auto`}),i=J(()=>new Date(iE(t.at))),a=J(()=>{let e=Math.round((n.value.getTime()-i.value.getTime())/6e4);if(t.at.length===10){let n=Math.round(e/1440);return n>=0&&n<7?r.format(-n,`day`):t.at}return e<1?`剛剛`:e<60?r.format(-e,`minute`):e<1440?r.format(-Math.round(e/60),`hour`):e<10080?r.format(-Math.round(e/1440),`day`):oE(t.at)});return(t,n)=>(B(),V(`time`,{datetime:e.at,title:N(cE)(e.at)},j(a.value),9,bP))}}),SP={key:0,class:`pb-8`},CP=[`title`],wP={key:0,class:`flex flex-col gap-1 text-sm`},TP={key:0},EP={key:0,class:`text-xs text-muted-foreground`},DP={key:1,class:`text-xs text-muted-foreground`},OP={class:`font-mono text-xs`},kP={class:`flex flex-col`},AP=[`aria-expanded`,`onClick`],jP={class:`mt-px shrink-0 font-mono text-xs text-muted-foreground`},MP={class:`min-w-0 flex-1`},NP={key:2,class:`shrink-0 text-xs text-muted-foreground tabular-nums`},PP={class:`flex flex-wrap gap-1 pb-1 pl-12`},FP={key:0,class:`pb-1 pl-12 text-xs text-muted-foreground`},IP={key:1,class:`mb-2 ml-12 flex flex-col gap-1.5 rounded-md border p-3 text-xs`},LP={key:0,class:`text-muted-foreground`},RP={key:1,class:`text-muted-foreground`},zP={key:2,class:`text-muted-foreground`},BP={class:`w-20 shrink-0 text-muted-foreground`},VP={key:0,class:`text-muted-foreground`},HP={key:1,class:`text-destructive`},UP={key:0,class:`text-sm text-muted-foreground`},WP={key:0,class:`text-sm text-muted-foreground`},GP={class:`w-20 text-muted-foreground`},KP={class:`tabular-nums`},qP={key:1,class:`px-5 text-muted-foreground`},JP=I({__name:`SessionPeek`,props:{id:{}},setup(e){let t=e,{open:n}=FC(),r=J(()=>Q.sessions.find(e=>e.id===t.id)),i=M(null),a=M(null),o=e=>Q.sessions.find(t=>t.id===e),s=J(()=>{let e=r.value;return e?[...e.delegatedFrom?[{label:`委派自`,id:e.delegatedFrom}]:[],...e.handoffFrom?[{label:`接手自`,id:e.handoffFrom}]:[],...Q.sessions.filter(t=>t.delegatedFrom===e.id).map(e=>({label:`委派給`,id:e.id})),...Q.sessions.filter(t=>t.handoffFrom===e.id).map(e=>({label:`交接給`,id:e.id}))]:[]});F(()=>[r.value?.id,r.value?.actions.length,r.value?.actions.map(e=>e.status).join()],async()=>{let e=r.value;if(e){for(let t of new Set(e.actions.flatMap(e=>e.serves.map(e=>QC(e).m))))lw(t).catch(e=>Q.error=e.message);i.value=await XC.trace(e.id).catch(()=>null)}},{immediate:!0});function c(e){let{m:t,t:n,item:r}=QC(e);if(!n){let n=Q.mainlines[t]?.criteria.find(e=>e.id===r);return{ref:e,task:t,text:n?.text,done:n?.done??!1}}let i=Q.mainlines[t]?.tasks.find(e=>e.id===n);return{ref:e,task:`${t}/${n}`,text:i?.checklist.find(e=>e.id===r)?.text,done:i?.checklist.find(e=>e.id===r)?.done??!1}}let l=J(()=>[...new Set((r.value?.actions??[]).flatMap(e=>e.serves))].map(c));function u(e){return Object.keys(Kw).map(t=>({kind:t,items:e.filter(e=>e.kind===t)})).filter(e=>e.items.length>0)}let d=e=>u(i.value?.byAction[e]??[]),f=e=>(i.value?.byAction[e]??[]).length,p=()=>r.value&&dw(()=>XC.archiveSession(r.value.id,!r.value.archivedAt));return(t,c)=>r.value?(B(),V(`div`,SP,[W(OD,{title:N(Dw)(r.value),type:`session`,status:r.value.status},{notice:P(()=>[r.value.description||r.value.summary?(B(),V(`div`,wP,[r.value.description?(B(),V(`p`,TP,[G(j(r.value.description),1),r.value.depth===void 0?K(``,!0):(B(),V(`span`,EP,` · 深度 `+j(r.value.depth),1))])):K(``,!0),r.value.summary?(B(),V(`p`,DP,j(r.value.summary),1)):K(``,!0)])):K(``,!0)]),default:P(()=>[W(TE,{status:r.value.status},null,8,[`status`]),r.value.elsewhere?(B(),V(`span`,{key:0,title:`工作目錄 ${r.value.cwd} 不在這台電腦上`,"data-elsewhere":``},`其他環境`,8,CP)):K(``,!0),W(CD,{text:r.value.id,label:r.value.id.slice(-8)},null,8,[`text`,`label`]),W(eE,{archived:!!r.value.archivedAt,onToggle:p},null,8,[`archived`])]),_:1},8,[`title`,`status`]),W(MD,null,{default:P(()=>[W(JD,{columns:1},{default:P(()=>[W($,{label:`ID`,icon:N(Od)},{default:P(()=>[W(CD,{text:r.value.id},null,8,[`text`])]),_:1},8,[`icon`]),W($,{label:`agent`,icon:N(Vu)},{default:P(()=>[W(N(QT),{variant:`secondary`},{default:P(()=>[G(j(r.value.agent),1)]),_:1})]),_:1},8,[`icon`]),i.value?.model??r.value.model?(B(),H($,{key:0,label:`模型`,icon:N(ud)},{default:P(()=>[U(`span`,OP,j(i.value?.model??r.value.model),1)]),_:1},8,[`icon`])):K(``,!0),r.value.effort?(B(),H($,{key:1,label:`effort`,icon:N(wd)},{default:P(()=>[G(j(r.value.effort),1)]),_:1},8,[`icon`])):K(``,!0),W($,{label:`開始`,icon:N(rd)},{default:P(()=>[W(xP,{at:r.value.started,class:`text-xs`},null,8,[`at`])]),_:1},8,[`icon`]),r.value.branch?(B(),H($,{key:2,label:`分支`,icon:N(Td)},{default:P(()=>[W(CD,{text:r.value.branch},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),r.value.worktree?(B(),H($,{key:3,label:`worktree`,icon:N(xd)},{default:P(()=>[W(CD,{text:r.value.worktree},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),W($,{label:`工作目錄`,icon:N(Sd)},{default:P(()=>[W(CD,{text:r.value.cwd},null,8,[`text`])]),_:1},8,[`icon`]),r.value.transcript?(B(),H($,{key:4,label:`對話紀錄`,icon:N(Xd)},{default:P(()=>[W(CD,{text:r.value.transcript,class:`min-w-0`},null,8,[`text`]),W(N(sC),{variant:`ghost`,size:`icon-xs`,class:`text-muted-foreground`,title:`在 Finder 顯示`,"aria-label":`在 Finder 顯示`,onClick:c[0]||=e=>N(dw)(()=>N(XC).reveal(r.value.transcript))},{default:P(()=>[W(N(yd))]),_:1})]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),W(MD,{title:`行動佇列`,count:r.value.actions.length},{default:P(()=>[U(`ul`,kP,[(B(!0),V(z,null,L(r.value.actions,e=>(B(),V(`li`,{key:e.id,class:`flex flex-col`},[U(`button`,{type:`button`,class:`-mx-2 flex min-h-8 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors duration-[120ms] hover:bg-accent/50`,"aria-expanded":a.value===e.id,onClick:t=>a.value=a.value===e.id?null:e.id},[a.value===e.id?(B(),H(N(Ju),{key:0,class:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`})):(B(),H(N(Xu),{key:1,class:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`})),W(wE,{status:e.status,class:`mt-0.5 shrink-0`},null,8,[`status`]),U(`span`,jP,j(e.id),1),U(`span`,MP,j(e.do),1),e.startedAt?(B(),V(`span`,NP,j(N(sE)(e.startedAt))+j(e.doneAt?`–${N(sE)(e.doneAt)}`:``),1)):K(``,!0)],8,AP),U(`div`,PP,[(B(!0),V(z,null,L(e.serves,e=>(B(),H(Yj,q({key:e},{ref_for:!0},N(Mw)(e.split(`#`)[0]),{id:e,onOpen:()=>N(n)(e.split(`#`)[0],{chain:!0})}),null,16,[`id`,`onOpen`]))),128))]),e.note?(B(),V(`p`,FP,j(e.note),1)):K(``,!0),a.value===e.id?(B(),V(`div`,IP,[i.value?.available?e.startedAt?f(e.id)===0?(B(),V(`p`,zP,`這段時間沒有用到 skill、agent,也沒有載入 rule 或用 Read 讀檔。用 Bash 讀的檔不會出現在這裡。`)):K(``,!0):(B(),V(`p`,RP,`這個行動沒有開始時間,追溯不到它的時間窗。`)):(B(),V(`p`,LP,`沒有對話紀錄,無法追溯。`)),(B(!0),V(z,null,L(d(e.id),e=>(B(),V(`div`,{key:e.kind,class:`flex flex-wrap items-baseline gap-1.5`},[U(`span`,BP,j(N(Kw)[e.kind]),1),(B(!0),V(z,null,L(e.items,e=>(B(),H(N(QT),{key:e.path??e.name,variant:`secondary`,class:`font-mono font-normal`,title:e.path??e.name},{default:P(()=>[G(j(e.name),1),e.count>1?(B(),V(`span`,VP,`×`+j(e.count),1)):K(``,!0),e.detail?.startsWith(`blocked`)?(B(),V(`span`,HP,`擋下`)):K(``,!0)]),_:2},1032,[`title`]))),128))]))),128))])):K(``,!0)]))),128))]),r.value.actions.length===0?(B(),V(`p`,UP,`這個會話沒有行動。`)):K(``,!0)]),_:1},8,[`count`]),W(MD,{title:`委派與接手`,count:s.value.length},{default:P(()=>[(B(!0),V(z,null,L(s.value,e=>(B(),H(wj,{key:e.label+e.id,peek:N(TC)(e.id),label:e.label,title:o(e.id)?N(Dw)(o(e.id)):e.id,status:o(e.id)?.status},null,8,[`peek`,`label`,`title`,`status`]))),128)),s.value.length===0?(B(),V(`p`,WP,`沒有委派或交接關係。`)):K(``,!0)]),_:1},8,[`count`]),W(MD,{title:`服務的項目與條件`,count:l.value.length},{default:P(()=>[(B(!0),V(z,null,L(l.value,e=>(B(),H(wj,{key:e.ref,peek:e.task,id:e.ref,title:e.text},{default:P(()=>[W(N(mE),{"model-value":e.done,disabled:``,class:`pointer-events-none`,"aria-label":e.done?`已完成`:`未完成`},null,8,[`model-value`,`aria-label`])]),_:2},1032,[`peek`,`id`,`title`]))),128))]),_:1},8,[`count`]),i.value?.unattributed.length?(B(),H(MD,{key:0,title:`沒有對應行動的使用`,count:i.value.unattributed.length},{default:P(()=>[(B(!0),V(z,null,L(u(i.value.unattributed),e=>(B(),V(`div`,{key:e.kind,class:`flex min-h-7 items-center gap-2 text-xs`},[U(`span`,GP,j(N(Kw)[e.kind]),1),U(`span`,KP,j(e.items.length),1)]))),128))]),_:1},8,[`count`])):K(``,!0)])):(B(),V(`p`,qP,`這台電腦上沒有會話 `+j(e.id)+`。`,1))}}),YP={key:0,class:`pb-8`},XP={class:`truncate`},ZP={key:0,class:`flex items-center gap-1.5`},QP={key:1},$P={key:2},eF={key:0,class:`text-xs`},tF={class:`text-xs`},nF={class:`text-xs`},rF={class:`text-xs`},iF={class:`shrink-0 font-mono`},aF={class:`truncate`},oF={key:0,class:`text-sm text-muted-foreground`},sF={key:1,class:`px-5 text-muted-foreground`},cF=I({__name:`TaskPeek`,props:{m:{},t:{}},setup(e){let t=e,{open:n}=FC(),{mainline:r}=Xj(()=>t.m),i=J(()=>r.value?.tasks.find(e=>e.id===t.t)),a=J(()=>r.value?.tasks.filter(e=>e.parent===t.t)??[]),o=J(()=>(i.value?.checklist??[]).filter(e=>!e.dropped)),s=J(()=>jw(t.m,t.t)),c=e=>n(e,{chain:!0}),l=J(()=>{let e=i.value?.blockedBy?.waitingFor,t=e?Lw(e):void 0;return t&&t!==`session`&&!e.startsWith(`file:`)?e:void 0});Er(()=>Pw([l.value]));let u=e=>e.slice((r.value?.dir.length??0)+1),d=e=>e.slice(e.lastIndexOf(`/`)+1),f=e=>i.value&&dw(()=>XC.taskStatus(t.m,t.t,e,i.value.version));return(n,p)=>i.value&&N(r)?(B(),V(`div`,YP,[W(OD,{id:`${e.m}/${i.value.id}`,title:i.value.title,type:N(Iw)(i.value),status:i.value.status},{notice:P(()=>[i.value.blockedBy?(B(),H(N(_g),{key:0,variant:`warning`},{default:P(()=>[W(N(ed)),W(N(yg),null,{default:P(()=>[G(`卡住:`+j(i.value.blockedBy.reason),1)]),_:1}),W(N(vg),{class:`text-xs text-muted-foreground`},{default:P(()=>[l.value?(B(),V(`p`,ZP,[p[0]||=G(`等待 `,-1),W(Yj,q(N(Mw)(l.value),{onOpen:c}),null,16)])):i.value.blockedBy.waitingFor?(B(),V(`p`,QP,`等待 `+j(i.value.blockedBy.waitingFor),1)):K(``,!0),i.value.blockedBy.signal?(B(),V(`p`,$P,`看到「`+j(i.value.blockedBy.signal)+`」就可以繼續`,1)):K(``,!0)]),_:1})]),_:1})):K(``,!0)]),default:P(()=>[W(gP,{status:i.value.status,options:N(Vw),onChange:f},null,8,[`status`,`options`]),U(`span`,XP,j(N(r).title),1)]),_:1},8,[`id`,`title`,`type`,`status`]),W(MD,null,{default:P(()=>[W(JD,{columns:1},{default:P(()=>[W($,{label:`checklist`,icon:N(Pd)},{default:P(()=>[W(QN,{done:o.value.filter(e=>e.done).length,total:o.value.length},null,8,[`done`,`total`])]),_:1},8,[`icon`]),i.value.priority?(B(),H($,{key:0,label:`優先度`,icon:N(_d)},{default:P(()=>[W(xE,{priority:i.value.priority},null,8,[`priority`]),i.value.priority===`P2`?(B(),V(`span`,eF,`P2`)):K(``,!0)]),_:1},8,[`icon`])):K(``,!0),W($,{label:`種類`,icon:N(Ad)},{default:P(()=>[G(j(i.value.kind===`branch`?`分支`:`階段`),1)]),_:1},8,[`icon`]),i.value.parent?(B(),H($,{key:1,label:`上層任務`,icon:N(ld)},{default:P(()=>[W(Yj,q(N(Mw)(N(CC)(e.m,i.value.parent)),{onOpen:c}),null,16)]),_:1},8,[`icon`])):K(``,!0),i.value.repo?(B(),H($,{key:2,label:`倉庫`,icon:N(vd)},{default:P(()=>[G(j(i.value.repo),1)]),_:1},8,[`icon`])):K(``,!0),i.value.branch?(B(),H($,{key:3,label:`分支`,icon:N(Td)},{default:P(()=>[W(CD,{text:i.value.branch},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),i.value.base?(B(),H($,{key:4,label:`基底`,icon:N(Ed)},{default:P(()=>[W(CD,{text:i.value.base},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),i.value.worktree?(B(),H($,{key:5,label:`worktree`,icon:N(xd)},{default:P(()=>[W(CD,{text:i.value.worktree},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),i.value.merge?(B(),H($,{key:6,label:`合併狀態`,icon:N(Dd)},{default:P(()=>[G(j(N(Yw)[i.value.merge]),1)]),_:1},8,[`icon`])):K(``,!0),i.value.category?(B(),H($,{key:7,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(i.value.category),1)]),_:1},8,[`icon`])):K(``,!0),i.value.labels?.length?(B(),H($,{key:8,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(i.value.labels,e=>(B(),H(N(QT),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,tF,j(i.value.created),1)]),_:1},8,[`icon`]),i.value.startedAt?(B(),H($,{key:9,label:`開始`,icon:N(Wd)},{default:P(()=>[U(`span`,nF,j(i.value.startedAt),1)]),_:1},8,[`icon`])):K(``,!0),i.value.closedAt?(B(),H($,{key:10,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,rF,j(i.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),i.value.resolution?(B(),H($,{key:11,label:`結果`,icon:N($u)},{default:P(()=>[G(j(i.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),i.value.origin?(B(),H($,{key:12,label:`來源`,icon:N(cd)},{default:P(()=>[W(Yj,q(N(Mw)(i.value.origin),{onOpen:c}),null,16)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),W(MD,{title:`checklist`,count:i.value.checklist.length},{default:P(()=>[W(cN,{items:i.value.checklist,"ref-prefix":`${e.m}/${i.value.id}#`,version:i.value.version},null,8,[`items`,`ref-prefix`,`version`])]),_:1},8,[`count`]),i.value.body.trim()?(B(),H(MD,{key:0,title:`內文`},{default:P(()=>[W(yj,{source:i.value.body},null,8,[`source`])]),_:1})):K(``,!0),i.value.artifacts.length?(B(),H(MD,{key:1,title:`產物`,count:i.value.artifacts.length},{default:P(()=>[(B(!0),V(z,null,L(i.value.artifacts,t=>(B(),H(wj,{key:t,peek:N(EC)(e.m,u(t)),title:d(t)},null,8,[`peek`,`title`]))),128))]),_:1},8,[`count`])):K(``,!0),a.value.length?(B(),H(MD,{key:2,title:`子任務`,count:a.value.length},{default:P(()=>[(B(!0),V(z,null,L(a.value,t=>(B(),H(wj,{key:t.id,peek:N(CC)(e.m,t.id),id:t.id,title:t.title,status:t.status},null,8,[`peek`,`id`,`title`,`status`]))),128))]),_:1},8,[`count`])):K(``,!0),W(Pj,{self:N(CC)(t.m,t.t),links:i.value.links},null,8,[`self`,`links`]),i.value.refs?.length?(B(),H(MD,{key:3,title:`參考來源`,count:i.value.refs.length},{default:P(()=>[W(zj,{refs:i.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0),W(MD,{title:`服務它的行動`,count:s.value.reduce((e,t)=>e+t.actions.length,0)},{default:P(()=>[(B(!0),V(z,null,L(s.value,({session:e,actions:t})=>(B(),V(z,{key:e.id},[W(wj,{peek:N(TC)(e.id),title:N(Dw)(e),status:e.status},null,8,[`peek`,`title`,`status`]),(B(!0),V(z,null,L(t,e=>(B(),V(`div`,{key:e.id,class:`flex min-h-7 items-center gap-2 pl-6 text-xs text-muted-foreground`},[W(wE,{status:e.status,class:`shrink-0`},null,8,[`status`]),U(`span`,iF,j(e.id),1),U(`span`,aF,j(e.do),1)]))),128))],64))),128)),s.value.length===0?(B(),V(`p`,oF,`這台電腦上沒有服務這個任務的行動。`)):K(``,!0)]),_:1},8,[`count`])])):(B(),V(`p`,sF,`載入 `+j(e.m)+`/`+j(e.t)+`…`,1))}}),lF={class:`flex h-11 shrink-0 items-center gap-1 px-2`},uF={key:0,class:`truncate text-xs text-muted-foreground`},dF={key:1,class:`ml-2 text-xs text-status-done`,role:`status`},fF={class:`min-h-0 flex-1 overflow-auto`},pF=`mainflow.panelWidth`,mF=360,hF=1200,gF=aT(I({__name:`PeekPanel`,setup(e){let{current:t,trail:n,full:r,back:i,close:a,toggleFull:o}=FC(),s=Number($C(pF,880)),c=M(s>=mF&&s<=hF?s:880);function l(e){let t=e.clientX,n=c.value,r=e=>c.value=Math.min(hF,Math.max(mF,n+t-e.clientX)),i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i),ew(pF,c.value)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)}let u=J(()=>{let e=AC(n.value.at(-1));return e?e.kind===`session`?`會話`:e.kind===`file`?e.path.split(`/`).at(-1):e.kind===`conflict`?`存檔`:e.ref:``});return(e,s)=>N(t)?(B(),V(`aside`,{key:0,class:k([`peek-panel flex min-h-0 flex-col border-l bg-background max-[1100px]:shadow-lg`,N(r)?`flex-1`:`shrink-0`]),style:he({"--panel-width":`${c.value}px`}),"aria-label":`預覽面板`},[N(r)?K(``,!0):(B(),V(`div`,{key:0,class:`absolute inset-y-0 -left-1 w-2 cursor-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`拖曳調整面板寬度`,onPointerdown:au(l,[`prevent`])},null,32)),U(`div`,lF,[W(N(sC),{variant:`ghost`,size:`icon-sm`,disabled:!N(n).length,"aria-label":`上一步`,title:`上一步`,onClick:N(i)},{default:P(()=>[W(N(Yu))]),_:1},8,[`disabled`,`onClick`]),u.value?(B(),V(`span`,uF,`回到 `+j(u.value),1)):K(``,!0),N(jC)?(B(),V(`span`,dF,j(N(jC)),1)):K(``,!0),s[0]||=U(`span`,{class:`ml-auto`},null,-1),W(N(sC),{variant:`ghost`,size:`icon-sm`,"aria-label":N(r)?`回到並排`:`開成整頁`,title:N(r)?`回到並排`:`開成整頁`,onClick:N(o)},{default:P(()=>[N(r)?(B(),H(N(Bd),{key:0})):(B(),H(N(Rd),{key:1}))]),_:1},8,[`aria-label`,`title`,`onClick`]),W(N(sC),{variant:`ghost`,size:`icon-sm`,"aria-label":`關閉(Esc)`,title:`關閉(Esc)`,onClick:N(a)},{default:P(()=>[W(N(uf))]),_:1},8,[`onClick`])]),U(`div`,fF,[N(t).kind===`task`?(B(),H(cF,{key:N(t).ref,m:N(t).m,t:N(t).t},null,8,[`m`,`t`])):N(t).kind===`decision`?(B(),H(oM,{key:N(t).ref,m:N(t).m,d:N(t).d},null,8,[`m`,`d`])):N(t).kind===`file`?(B(),H(NM,{key:N(t).ref,m:N(t).m,path:N(t).path},null,8,[`m`,`path`])):N(t).kind===`session`?(B(),H(JP,{key:N(t).ref,id:N(t).id},null,8,[`id`])):N(t).kind===`mainline`?(B(),H(yP,{key:N(t).ref,m:N(t).m},null,8,[`m`])):N(t).kind===`issue`?(B(),H(JN,{key:N(t).ref,id:N(t).id},null,8,[`id`])):N(t).kind===`conflict`?(B(),H(qD,{key:N(t).ref,saved:N(t).saved},null,8,[`saved`])):N(t).kind===`group`?(B(),H(VN,{key:N(t).ref,id:N(t).id},null,8,[`id`])):(B(),H(zM,{key:N(t).ref,id:N(t).id},null,8,[`id`]))])],6)):K(``,!0)}}),[[`__scopeId`,`data-v-d9c80ff7`]]),_F={class:`flex h-full min-h-0 flex-col`},vF={class:`relative flex min-h-0 flex-1`},yF={class:`@container min-w-0 flex-1 overflow-auto`,"data-peek-list":``},bF=I({__name:`PageLayout`,setup(e){let{current:t,full:n}=FC();return(e,r)=>(B(),V(`div`,_F,[R(e.$slots,`header`),U(`div`,vF,[yr(U(`div`,yF,[R(e.$slots,`default`)],512),[[Vc,!(N(t)&&N(n))]]),W(gF)])]))}});function xF(e,t){let n=Qt(new Set),r=e.spec.id,i=t=>[...t.leader?[t.leader]:[],...t.items,...t.ended].flatMap(t=>[t,...(e.spec.nested?.(t)??[]).map(e=>e.item)]),a=J(()=>[...new Map(e.groups.value.flatMap(i).map(e=>[r(e),e])).values()]);F(a,e=>{let t=new Set(e.map(r));for(let e of n)t.has(e)||n.delete(e)});let o=J(()=>a.value.filter(e=>n.has(r(e)))),s=e=>{let t=e.filter(e=>n.has(r(e))).length;return t===0?!1:t===e.length||`indeterminate`},c=(e,t)=>e.forEach(e=>t?n.add(r(e)):n.delete(r(e)));async function l(e){let i=o.value.filter(n=>t.archived(n)!==e).map(r);i.length&&await dw(async()=>{let n=await XC.archiveMany(t.kind,i,e);if(n.failed.length)throw Error(`${n.failed.length} 個沒有${e?`封存`:`取消封存`}:${n.failed.map(e=>`${e.id}(${e.error})`).join(`、`)}`)})&&n.clear()}return{selected:o,active:J(()=>o.value.length>0),all:J(()=>s(a.value)),groupChecked:e=>s(i(e)),has:e=>n.has(r(e)),toggle:(e,t)=>c([e],t),setAll:e=>c(a.value,e),setGroup:(e,t)=>c(i(e),t),clear:()=>n.clear(),archivable:J(()=>o.value.filter(e=>!t.archived(e)).length),restorable:J(()=>o.value.filter(e=>t.archived(e)).length),setArchived:l}}var SF={key:0,class:`shrink-0 text-xs text-muted-foreground`},CF=[`title`],wF=I({__name:`FindingList`,setup(e){let t=[`valid`,`obsolete`],n=CN({key:`findings`,id:e=>e.id,text:e=>e.title,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:dN(t)},{key:`category`,label:`分類`,values:e=>e.category?[e.category]:[]},{key:`label`,label:`標籤`,values:e=>e.labels??[]},{key:`applies`,label:`適用範圍`,values:e=>e.appliesTo??[]}],sorts:[{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`applies`,label:`適用範圍`,value:e=>e.appliesTo?.join(`、`),dir:`asc`},{key:`created`,label:`建立`,value:e=>e.created,dir:`desc`},{key:`review`,label:`重新確認日`,value:e=>e.reviewAfter,dir:`asc`}],groups:[hN(t),{key:`category`,label:`分類`,value:e=>e.category??`未分類`}],defaultSort:`created`,defaultGroup:`status`,ended:e=>fN(e.status),archived:e=>!!e.archivedAt},()=>Q.findings),r=xF(n,{kind:`finding`,archived:e=>!!e.archivedAt}),i=[{key:`name`,label:`名稱`,sort:`name`},{key:`applies`,label:`適用範圍`,class:`max-w-72 truncate font-mono text-xs text-muted-foreground`,sort:`applies`,value:e=>e.appliesTo,optional:!0},{key:`review`,label:`重新確認`,sort:`review`,value:e=>e.reviewAfter}],a=e=>dw(()=>XC.archiveFinding(e.id,!e.archivedAt,e.version));return(e,t)=>(B(),H(bF,null,{header:P(()=>[W(yD,{title:`發現`,description:`踩過的坑與經驗。下一個任務動手前先看這裡。`}),W(oD,{view:N(n)},null,8,[`view`])]),default:P(()=>[W(XE,{view:N(n),selection:N(r),columns:i,"item-ref":e=>e.id},{name:P(({item:e})=>[W(hD,{status:e.status,id:e.id,title:e.title,muted:!!e.archivedAt},{default:P(()=>[(B(!0),V(z,null,L(e.labels??[],e=>(B(),H(N(QT),{key:e,variant:`secondary`,class:`shrink-0`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128)),e.archivedAt?(B(),V(`span`,SF,`已封存`)):K(``,!0)]),_:2},1032,[`status`,`id`,`title`,`muted`])]),applies:P(({item:e})=>[U(`span`,{title:e.appliesTo?.join(`
|
|
81
|
-
`)},j(e.appliesTo?.join(`、`)),9,CF)]),review:P(({item:e})=>[W(pE,{day:e.reviewAfter,ended:e.status===`obsolete`},null,8,[`day`,`ended`])]),actions:P(({item:e})=>[W(eE,{archived:!!e.archivedAt,onToggle:t=>a(e)},null,8,[`archived`,`onToggle`])]),empty:P(()=>[...t[0]||=[G(`還沒有發現。用 `,-1),U(`code`,null,`mainflow new finding <slug> --title <title>`,-1),G(` 記下來。`,-1)]]),_:1},8,[`view`,`selection`,`item-ref`]),W(fD,{selection:N(r)},null,8,[`selection`])]),_:1}))}}),TF=e=>(e.plannedIn??e.origin??``).match(/^m\d{3}/)?.[0]??``,EF=e=>e?`${e} ${Q.summary?.mainlines.find(t=>t.id===e)?.title??``}`.trim():`不屬於主脈絡`,DF=`未分類`,OF=`沒有標籤`,kF=e=>e.labels?.length?e.labels:[OF],AF=e=>[{key:`status`,label:`狀態`,values:e=>[e.status],options:dN(e)},{key:`priority`,label:`優先度`,values:e=>[uN(e.priority)],options:lN},{key:`category`,label:`分類`,values:e=>e.category?[e.category]:[]},{key:`label`,label:`標籤`,values:e=>e.labels??[]},{key:`mainline`,label:`來源主脈絡`,values:e=>[TF(e)].filter(Boolean),optionLabel:EF},AN(e=>e.group)],jF=e=>[hN(e),{key:`category`,label:`分類`,value:e=>e.category??DF,trailing:[DF]},{key:`label`,label:`標籤`,value:e=>kF(e)[0],values:kF,trailing:[OF]},{key:`priority`,label:`優先度`,value:e=>uN(e.priority),order:[`P0`,`P1`,`P2`,`P3`]},{key:`mainline`,label:`主脈絡`,value:TF,groupLabel:EF,trailing:[``]},kN(e=>e.group)],MF={key:0,class:`shrink-0 text-xs text-muted-foreground`},NF=I({__name:`IssueList`,setup(e){let t=[`open`,`planned`,`closed`],n=CN({key:`issues`,id:e=>e.id,text:e=>e.title,filters:AF(t),sorts:[{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`planned`,label:`排入`,value:e=>e.plannedIn,dir:`asc`},{key:`origin`,label:`來源`,value:e=>e.origin,dir:`asc`},{key:`order`,label:`手動順序`,value:e=>e.order,dir:`asc`},{key:`priority`,label:`優先度`,value:e=>uN(e.priority),dir:`asc`},{key:`due`,label:`到期`,value:e=>e.due,dir:`asc`},{key:`created`,label:`建立`,value:e=>e.created,dir:`desc`}],groups:jF(t),defaultSort:`order`,defaultGroup:`status`,ended:e=>fN(e.status),archived:e=>!!e.archivedAt},()=>Q.issues),r=xF(n,{kind:`issue`,archived:e=>!!e.archivedAt}),i=[{key:`name`,label:`名稱`,sort:`name`},{key:`priority`,label:`優先度`,sort:`priority`},{key:`due`,label:`到期`,sort:`due`,value:e=>e.due},{key:`planned`,label:`排入`,class:`max-w-56`,sort:`planned`,value:e=>e.plannedIn},{key:`origin`,label:`來源`,class:`max-w-56`,sort:`origin`,value:e=>e.origin,optional:!0}],{open:a}=FC();Er(()=>Pw(Q.issues.flatMap(e=>[e.plannedIn,e.origin])));let o=e=>dw(()=>XC.archiveIssue(e.id,!e.archivedAt,e.version));return(e,t)=>(B(),H(bF,null,{header:P(()=>[W(yD,{title:`待辦事項`,description:`跨主脈絡的後續事項。主脈絡結束或封存後仍留在這裡。`}),W(oD,{view:N(n)},null,8,[`view`])]),default:P(()=>[W(XE,{view:N(n),selection:N(r),columns:i,"item-ref":e=>e.id},{name:P(({item:e})=>[W(hD,{status:e.status,id:e.id,title:e.title,muted:!!e.archivedAt},{default:P(()=>[e.archivedAt?(B(),V(`span`,MF,`已封存`)):K(``,!0)]),_:2},1032,[`status`,`id`,`title`,`muted`])]),priority:P(({item:e})=>[W(xE,{priority:e.priority},null,8,[`priority`])]),due:P(({item:e})=>[W(pE,{day:e.due,ended:e.status===`closed`},null,8,[`day`,`ended`])]),planned:P(({item:e})=>[e.plannedIn?(B(),H(Yj,q({key:0},N(Mw)(e.plannedIn),{onOpen:N(a)}),null,16,[`onOpen`])):K(``,!0)]),origin:P(({item:e})=>[e.origin?(B(),H(Yj,q({key:0},N(Mw)(e.origin),{onOpen:N(a)}),null,16,[`onOpen`])):K(``,!0)]),actions:P(({item:e})=>[W(eE,{archived:!!e.archivedAt,onToggle:t=>o(e)},null,8,[`archived`,`onToggle`])]),empty:P(()=>[...t[0]||=[G(`沒有待辦事項。用 `,-1),U(`code`,null,`mainflow new issue <slug> --title <title>`,-1),G(` 記下主脈絡結束後還要處理的事。`,-1)]]),_:1},8,[`view`,`selection`,`item-ref`]),W(fD,{selection:N(r)},null,8,[`selection`])]),_:1}))}}),PF=I({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(e,t)=>(B(),H(N(nC),q({"data-slot":`tabs`},N(i),{class:N(gg)(`flex flex-col gap-2`,n.class)}),{default:P(t=>[R(e.$slots,`default`,A(Cs(t)))]),_:3},16,[`class`]))}}),FF=I({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default:`default`}},setup(e){let t=e,n=Sf(t,`class`,`variant`);return(r,i)=>(B(),H(N(aC),q({"data-slot":`tabs-list`,"data-variant":e.variant},N(n),{class:N(gg)(`group/tabs-list text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-0.75`,e.variant===`line`?`gap-1 rounded-none bg-transparent p-0`:`bg-muted`,t.class)}),{default:P(()=>[R(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),IF=I({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=P_(Sf(t,`class`));return(e,r)=>(B(),H(N(oC),q({"data-slot":`tabs-trigger`,class:N(gg)(`data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-3 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:text-foreground/60 group-data-[variant=line]/tabs-list:hover:text-foreground group-data-[variant=line]/tabs-list:data-[state=active]:text-foreground group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-foreground after:opacity-0 after:transition-opacity group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,t.class)},N(n)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`]))}}),LF={class:`w-full text-body`},RF={colspan:`3`,class:`sticky top-9 z-[5] bg-background px-6 pt-4 pb-1`},zF={class:`flex items-center gap-2 text-sm`},BF={key:0,class:`grid size-4 shrink-0 place-items-center rounded-[4px] border border-dashed text-[10px] text-muted-foreground`,"aria-label":`已不需要`},VF={class:`font-mono text-xs text-muted-foreground`},HF=[`title`],UF={key:1,class:`font-medium text-muted-foreground`},WF={class:`flex min-w-0 items-center gap-2`},GF={class:`shrink-0 font-mono text-xs text-muted-foreground`},KF=[`title`],qF={class:`flex min-w-0 items-center gap-2 text-xs`},JF={class:`truncate`},YF={key:0},XF={colspan:`3`,class:`px-6 pb-2 text-xs text-muted-foreground`},ZF={key:1},QF={key:0,class:`px-6 py-16 text-center text-sm text-muted-foreground`},$F=I({__name:`CriteriaView`,props:{mainline:{}},setup(e){let t=e,{open:n,current:r}=FC(),i=J(()=>t.mainline.tasks.flatMap(e=>e.checklist.filter(e=>!e.dropped).map(t=>({task:e,item:t})))),a=J(()=>[...t.mainline.criteria.map(e=>({key:e.id,criterion:e,rows:i.value.filter(t=>t.item.serves?.includes(e.id))})),{key:``,criterion:void 0,rows:i.value.filter(e=>!e.item.serves?.length)}].filter(e=>e.criterion||e.rows.length)),o=e=>r.value?.ref===e||void 0;return(t,r)=>(B(),V(z,null,[U(`table`,LF,[W(N(yE),{class:`sticky top-0 z-10 bg-background [&_tr]:border-b`},{default:P(()=>[W(N(_E),{class:`hover:bg-transparent`},{default:P(()=>[W(N(vE),{class:`pl-6`},{default:P(()=>[...r[0]||=[G(`checklist 項目`,-1)]]),_:1}),W(N(vE),{class:`w-72`},{default:P(()=>[...r[1]||=[G(`任務`,-1)]]),_:1}),W(N(vE),{class:`w-28 pr-6`},{default:P(()=>[...r[2]||=[G(`完成`,-1)]]),_:1})]),_:1})]),_:1}),(B(!0),V(z,null,L(a.value,t=>(B(),H(N(hE),{key:t.key,class:`[&_tr:last-child]:border-b`},{default:P(()=>[U(`tr`,null,[U(`td`,RF,[U(`div`,zF,[t.criterion?(B(),V(z,{key:0},[t.criterion.dropped?(B(),V(`span`,BF,`–`)):(B(),H(N(mE),{key:1,"model-value":t.criterion.done,disabled:``,class:`pointer-events-none`,"aria-label":t.criterion.done?`已達成`:`未達成`},null,8,[`model-value`,`aria-label`])),U(`span`,VF,j(t.criterion.id),1),U(`span`,{class:k([`min-w-0 truncate font-medium`,{"text-muted-foreground line-through":t.criterion.dropped}]),title:t.criterion.text},j(t.criterion.text),11,HF),t.criterion.dropped?K(``,!0):(B(),H(QN,{key:2,class:`ml-auto shrink-0`,done:t.rows.filter(e=>e.item.done).length,total:t.rows.length},null,8,[`done`,`total`]))],64)):(B(),V(`span`,UF,`沒有推進任何解決條件`))])])]),(B(!0),V(z,null,L(t.rows,t=>(B(),H(N(_E),{key:`${t.task.id}#${t.item.id}`,class:`h-9 transition-colors duration-[120ms]`,"data-peek":N(CC)(e.mainline.id,t.task.id),"aria-current":o(N(CC)(e.mainline.id,t.task.id)),onClick:r=>N(n)(N(CC)(e.mainline.id,t.task.id))},{default:P(()=>[W(N(gE),{class:`max-w-0 pl-6`},{default:P(()=>[U(`span`,WF,[U(`span`,GF,j(t.task.id)+`#`+j(t.item.id),1),U(`span`,{class:k([`truncate`,{"text-muted-foreground":t.item.done}]),title:t.item.text},j(t.item.text),11,KF)])]),_:2},1024),W(N(gE),{class:`max-w-72`},{default:P(()=>[U(`span`,qF,[W(Qw,{type:N(Iw)(t.task),status:t.task.status},null,8,[`type`,`status`]),U(`span`,JF,j(t.task.title),1)])]),_:2},1024),W(N(gE),{class:`pr-6 text-xs text-muted-foreground`},{default:P(()=>[G(j(t.item.done?t.item.doneAt??`已完成`:``),1)]),_:2},1024)]),_:2},1032,[`data-peek`,`aria-current`,`onClick`]))),128)),t.criterion?.dropped?(B(),V(`tr`,YF,[U(`td`,XF,[r[3]||=G(`不再需要`,-1),t.criterion.note?(B(),V(z,{key:0},[G(`:`+j(t.criterion.note),1)],64)):K(``,!0)])])):t.criterion&&t.rows.length===0?(B(),V(`tr`,ZF,[...r[4]||=[U(`td`,{colspan:`3`,class:`px-6 pb-2 text-xs text-muted-foreground`},`還沒有 checklist 項目推進這條條件。`,-1)]])):K(``,!0)]),_:2},1024))),128))]),a.value.length===0?(B(),V(`p`,QF,`這條主脈絡還沒有解決條件。`)):K(``,!0)],64))}}),eI={key:0,class:`shrink-0 text-xs text-muted-foreground`},tI=[`title`],nI=I({__name:`DecisionTable`,props:{mainline:{}},setup(e){let t=e,n=[`proposed`,`accepted`,`superseded`],r=CN({key:`decisions`,id:e=>e.id,text:e=>e.title,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:dN(n)},{key:`by`,label:`決策者`,values:e=>e.by?[e.by]:[],optionLabel:e=>qw[e]??e},{key:`basis`,label:`裁決方式`,values:e=>e.basis?[e.basis]:[],optionLabel:e=>Jw[e]??e}],sorts:[{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`by`,label:`決策者`,value:e=>e.by,dir:`asc`},{key:`reversible`,label:`能否改回`,value:e=>e.reversible===void 0?null:+!!e.reversible,dir:`desc`},{key:`created`,label:`建立`,value:e=>iE(e.created),dir:`desc`},{key:`decided`,label:`裁決時間`,value:e=>e.decidedAt?iE(e.decidedAt):void 0,dir:`desc`}],groups:[hN(n)],defaultSort:`created`,defaultGroup:`status`,ended:e=>fN(e.status)},()=>t.mainline.decisions),i=[{key:`name`,label:`名稱`,sort:`name`},{key:`by`,label:`決策者`,class:`text-xs text-muted-foreground`,sort:`by`,value:e=>e.by},{key:`basis`,label:`裁決方式`,class:`text-xs text-muted-foreground`,value:e=>e.basis},{key:`decided`,label:`裁決`,class:`font-mono text-xs text-muted-foreground tabular-nums`,sort:`decided`,value:e=>e.decidedAt},{key:`affects`,label:`影響`,class:`max-w-56 truncate font-mono text-xs text-muted-foreground`,value:e=>e.affects,optional:!0},{key:`reversible`,label:`能否改回`,class:`text-xs text-muted-foreground`,sort:`reversible`,value:e=>e.reversible,optional:!0}];return(t,n)=>(B(),V(z,null,[W(oD,{view:N(r)},null,8,[`view`]),W(XE,{view:N(r),columns:i,"item-ref":t=>N(wC)(e.mainline.id,t.id)},{name:P(({item:e})=>[W(hD,{status:e.status,id:e.id,title:e.title,muted:e.status===`superseded`},{default:P(()=>[e.supersededBy?(B(),V(`span`,eI,`由 `+j(e.supersededBy)+` 取代`,1)):K(``,!0)]),_:2},1032,[`status`,`id`,`title`,`muted`])]),by:P(({item:e})=>[G(j(e.by?N(qw)[e.by]:``),1)]),basis:P(({item:e})=>[G(j(e.basis?N(Jw)[e.basis]:``),1)]),decided:P(({item:e})=>[G(j(e.decidedAt?N(cE)(e.decidedAt):``),1)]),affects:P(({item:e})=>[U(`span`,{title:e.affects?.join(`
|
|
82
|
-
`)},j(e.affects?.join(`、`)),9,tI)]),reversible:P(({item:e})=>[G(j(e.reversible===void 0?``:e.reversible?`可以`:`不易改回`),1)]),empty:P(()=>[n[0]||=G(`還沒有決策。用 `,-1),U(`code`,null,`mainflow new decision `+j(e.mainline.id)+` <slug> --title <title>`,1),n[1]||=G(` 記下選擇與理由。`,-1)]),_:1},8,[`view`,`item-ref`])],64))}}),rI={class:`flex min-w-0 items-center gap-2`},iI=[`href`,`title`],aI=[`title`],oI={key:0,class:`whitespace-nowrap`},sI=[`title`],cI=`-`,lI=I({__name:`FilesView`,props:{mainline:{}},setup(e){let t=e,n=J(()=>CM(t.mainline)),r=e=>{let n=t.mainline.tasks.find(t=>t.id===e)??t.mainline.decisions.find(t=>t.id===e);return n?`${e} ${n.title}`:e===cI||!e?`主脈絡本身`:e},i=CN({key:`files`,id:e=>e.key,text:e=>`${e.name} ${e.path??``}`,filters:[{key:`kind`,label:`類型`,values:e=>[e.kind],options:bM.map(e=>({value:e,label:e}))},{key:`source`,label:`來源`,values:e=>[e.source??cI],optionLabel:r},{key:`ext`,label:`副檔名`,values:e=>e.ext?[e.ext]:[],optionLabel:e=>`.${e}`}],sorts:[{key:`kind`,label:`類型`,value:e=>bM.indexOf(e.kind),dir:`asc`},{key:`name`,label:`檔名`,value:e=>e.name,dir:`asc`},{key:`updated`,label:`更新`,value:e=>e.updated,dir:`desc`},{key:`source`,label:`來源`,value:e=>e.source,dir:`asc`}],groups:[{key:`kind`,label:`類型`,value:e=>e.kind,order:bM},{key:`source`,label:`來源`,value:e=>e.source??cI,groupLabel:r}],defaultSort:`kind`,defaultGroup:`kind`},()=>n.value),a=[{key:`name`,label:`檔名`,sort:`name`},{key:`kind`,label:`類型`,class:`text-xs text-muted-foreground`,sort:`kind`},{key:`source`,label:`來源`,class:`max-w-64 truncate text-xs text-muted-foreground`,sort:`source`,value:e=>e.source,optional:!0},{key:`updated`,label:`更新`,class:`text-xs text-muted-foreground`,sort:`updated`,value:e=>e.updated}],o=e=>e.inMainline?EC(t.mainline.id,e.inMainline):void 0;return(e,t)=>(B(),V(z,null,[W(oD,{view:N(i)},null,8,[`view`]),W(XE,{view:N(i),columns:a,"item-ref":o},{name:P(({item:e})=>[U(`span`,rI,[W(Qw,{type:N(zw)(e.url??e.key,e.kind)},null,8,[`type`]),e.url?(B(),V(`a`,{key:0,href:e.url,target:`_blank`,rel:`noreferrer`,class:`truncate underline decoration-border underline-offset-4 hover:decoration-foreground`,title:e.url,onClick:t[0]||=au(()=>{},[`stop`])},j(e.name),9,iI)):(B(),V(`span`,{key:1,class:k([`truncate`,{"font-mono text-xs":e.inMainline}]),title:e.inMainline??e.path},j(e.name),11,aI)),e.remoteOnly?(B(),H(N(ad),{key:2,class:`size-3.5 shrink-0 text-muted-foreground`,"aria-label":`只在伺服器上`,title:`只在同步伺服器上,點開時下載`})):K(``,!0),e.path?(B(),H(CD,{key:3,text:e.path,class:`min-w-0`},null,8,[`text`])):K(``,!0)])]),kind:P(({item:e})=>[G(j(e.kind),1),e.remoteOnly?(B(),V(`span`,oI,`・只在伺服器上`)):K(``,!0)]),source:P(({item:e})=>[U(`span`,{title:r(e.source??``)},j(e.source?r(e.source):``),9,sI)]),updated:P(({item:e})=>[e.updated?(B(),H(xP,{key:0,at:e.updated},null,8,[`at`])):K(``,!0)]),empty:P(()=>[...t[1]||=[G(`這條主脈絡還沒有檔案。`,-1)]]),_:1},8,[`view`])],64))}}),uI=I({__name:`Card`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`div`,{"data-slot":`card`,class:k(N(gg)(`bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-4 shadow-sm`,t.class))},[R(e.$slots,`default`)],2))}}),dI={class:`inline-flex gap-1.5 font-mono text-xs`},fI=[`title`],pI=I({__name:`DepList`,props:{deps:{},within:{}},setup(e){let t=e,n=e=>t.within&&e.startsWith(`${t.within}/`)?e.slice(t.within.length+1):e;return(t,r)=>(B(),V(`span`,dI,[(B(!0),V(z,null,L(e.deps,e=>(B(),V(`span`,{key:e.to,class:k(N(Xw)[e.state].tone),title:`${e.to} ${N(Xw)[e.state].label}`},j(n(e.to)),11,fI))),128))]))}}),mI={class:`flex items-center rounded-md border p-0.5`,role:`group`,"aria-label":`任務排列`},hI={key:0,class:`flex min-h-0 gap-3 overflow-x-auto px-6 pt-2 pb-6`},gI=[`aria-label`],_I={class:`flex items-center gap-2 py-1`},vI={class:`text-xs text-muted-foreground tabular-nums`},yI={class:`flex items-center gap-2 text-xs`},bI={class:`font-mono text-muted-foreground`},xI={class:`line-clamp-2 [overflow-wrap:anywhere]`},SI={class:`flex items-center justify-between gap-2`},CI={key:0,class:`min-w-0 truncate text-xs text-muted-foreground`},wI={key:0,class:`py-2 text-xs text-muted-foreground`},TI=[`title`],EI=`mainflow.list.tasks.mode`,DI=I({__name:`TaskViews`,props:{mainline:{}},setup(e){let t=e,n=[{key:`table`,label:`表格`,icon:Jd},{key:`board`,label:`看板`,icon:od},{key:`tree`,label:`樹狀`,icon:Ld}],r=$C(EI,`table`),i=M(n.some(e=>e.key===r)?r:`table`);function a(e){i.value=e,ew(EI,e)}let o=()=>t.mainline.tasks,s=J(()=>new Map(t.mainline.tasks.map(e=>[e.id,e])));function c(e){let t=e;for(;t?.kind===`branch`&&t.parent;)t=s.value.get(t.parent);return t?.id??e.id}let l=e=>e.checklist.filter(e=>e.done).length,u={id:e=>e.id,text:e=>`${e.title} ${e.branch??``}`,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:dN(Vw)},{key:`priority`,label:`優先度`,values:e=>[uN(e.priority)],options:lN},{key:`repo`,label:`倉庫`,values:e=>e.repo?[e.repo]:[]},{key:`kind`,label:`種類`,values:e=>[e.kind],options:[{value:`phase`,label:`階段`},{value:`branch`,label:`分支`}]},{key:`label`,label:`標籤`,values:e=>e.labels??[]}]},d=CN({...u,key:`tasks`,sorts:[{key:`order`,label:`手動順序`,value:e=>e.order??Number(e.id.slice(1)),dir:`asc`},{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`repo`,label:`倉庫`,value:e=>e.repo,dir:`asc`},{key:`depends`,label:`依賴`,value:e=>b(e)[0]?.to,dir:`asc`},{key:`branch`,label:`分支`,value:e=>e.branch,dir:`asc`},{key:`status`,label:`狀態`,value:e=>Vw.indexOf(e.status),dir:`asc`},{key:`priority`,label:`優先度`,value:e=>uN(e.priority),dir:`asc`},{key:`progress`,label:`checklist 進度`,value:e=>e.checklist.length?l(e)/e.checklist.length:null,dir:`desc`}],groups:[{key:`phase`,label:`階段`,value:c,groupLabel:e=>s.value.get(e)?.title??e,status:e=>s.value.get(e)?.status,leader:e=>s.value.get(e)},hN(Vw),{key:`repo`,label:`倉庫`,value:e=>e.repo??`沒有指定倉庫`}],defaultSort:`order`,defaultGroup:`status`,ended:e=>fN(e.status)},o),f=e=>t.mainline.tasks.filter(t=>t.parent===e).sort((e,t)=>(e.order??1/0)-(t.order??1/0)||e.id.localeCompare(t.id)),p=(e,t=1)=>f(e.id).flatMap(e=>[{item:e,depth:t},...p(e,t+1)]),m=CN({...u,key:`tasks`,sorts:[{key:`order`,label:`手動順序`,value:e=>e.order??Number(e.id.slice(1)),dir:`asc`}],groups:[],defaultSort:`order`,defaultGroup:``,nested:e=>p(e)},()=>t.mainline.tasks.filter(e=>!e.parent||!s.value.has(e.parent))),h=J(()=>Vw.map(e=>({status:e,tasks:d.sorted.value.filter(t=>t.status===e)}))),g=[{key:`name`,label:`名稱`,sort:`name`},{key:`priority`,label:`優先度`,sort:`priority`},{key:`progress`,label:`checklist`,sort:`progress`,value:e=>e.checklist.length},{key:`repo`,label:`倉庫`,class:`text-xs text-muted-foreground`,sort:`repo`,value:e=>e.repo},{key:`depends`,label:`依賴`,sort:`depends`,value:e=>b(e),optional:!0},{key:`branch`,label:`分支`,class:`max-w-56 truncate font-mono text-xs text-muted-foreground`,sort:`branch`,value:e=>e.branch,optional:!0}],{open:_,current:v}=FC(),y=e=>CC(t.mainline.id,e.id);function b(e){return Q.relations.deps.filter(t=>t.from===y(e))}return(t,r)=>(B(),V(z,null,[W(oD,{view:i.value===`tree`?N(m):N(d),grouping:i.value===`table`},{views:P(()=>[U(`div`,mI,[(B(),V(z,null,L(n,e=>W(N(sC),{key:e.key,variant:i.value===e.key?`secondary`:`ghost`,size:`xs`,"aria-pressed":i.value===e.key,onClick:t=>a(e.key)},{default:P(()=>[(B(),H(fa(e.icon))),G(j(e.label),1)]),_:2},1032,[`variant`,`aria-pressed`,`onClick`])),64))])]),_:1},8,[`view`,`grouping`]),i.value===`board`?(B(),V(`div`,hI,[(B(!0),V(z,null,L(h.value,e=>(B(),V(`section`,{key:e.status,class:`flex w-64 shrink-0 flex-col gap-2`,"aria-label":N(Gw)[e.status]},[U(`div`,_I,[W(TE,{status:e.status},null,8,[`status`]),U(`span`,vI,j(e.tasks.length),1)]),(B(!0),V(z,null,L(e.tasks,e=>(B(),H(N(uI),{key:e.id,class:k([`min-w-0 cursor-pointer gap-2 p-3 shadow-xs transition-colors duration-[120ms] hover:bg-accent/50`,{"bg-muted":N(v)?.ref===y(e)}]),"data-peek":y(e),"aria-current":N(v)?.ref===y(e)||void 0,onClick:t=>N(_)(y(e))},{default:P(()=>[U(`div`,yI,[W(Qw,{type:N(Iw)(e),status:e.status},null,8,[`type`,`status`]),U(`span`,bI,j(e.id),1),W(xE,{priority:e.priority},null,8,[`priority`])]),U(`p`,xI,j(e.title),1),U(`div`,SI,[W(QN,{done:l(e),total:e.checklist.length},null,8,[`done`,`total`]),e.repo?(B(),V(`span`,CI,j(e.repo),1)):K(``,!0)])]),_:2},1032,[`class`,`data-peek`,`aria-current`,`onClick`]))),128)),e.tasks.length===0?(B(),V(`p`,wI,`沒有任務`)):K(``,!0)],8,gI))),128))])):(B(),H(XE,{key:1,view:i.value===`tree`?N(m):N(d),columns:g,"item-ref":y,"item-type":N(Iw)},{name:P(({item:e,depth:t})=>[W(hD,{status:e.status,id:e.id,title:e.title,depth:t,type:N(Iw)(e)},null,8,[`status`,`id`,`title`,`depth`,`type`])]),priority:P(({item:e})=>[W(xE,{priority:e.priority},null,8,[`priority`])]),progress:P(({item:e})=>[W(QN,{done:l(e),total:e.checklist.length},null,8,[`done`,`total`])]),repo:P(({item:e})=>[G(j(e.repo),1)]),depends:P(({item:t})=>[W(pI,{deps:b(t),within:e.mainline.id},null,8,[`deps`,`within`])]),branch:P(({item:e})=>[U(`span`,{title:e.branch},j(e.branch),9,TI)]),empty:P(()=>[r[0]||=G(`還沒有任務。執行 `,-1),U(`code`,null,`mainflow new task `+j(e.mainline.id)+` <slug> --title <title>`,1),r[1]||=G(` 建立。`,-1)]),_:1},8,[`view`,`item-type`]))],64))}}),OI={class:`px-6 pt-6 pb-3`},kI={class:`mt-1 text-title font-semibold`},AI={class:`mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground`},jI={key:0},MI={key:0,class:`text-xs text-muted-foreground tabular-nums`},NI={key:0,class:`max-w-5xl px-1 pt-2 pb-10`},PI={key:1,class:`px-6 py-16 text-center text-muted-foreground`},FI=`mainflow.mainlineView`,II=I({__name:`MainlineDetail`,setup(e){let t=tp(),n=ep(),{id:r,mainline:i}=Xj(),a=[{key:`overview`,label:`概覽`},{key:`tasks`,label:`任務`},{key:`criteria`,label:`條件`},{key:`decisions`,label:`決策`},{key:`files`,label:`資料`}],o=J(()=>a.find(e=>e.key===t.query.view)?.key??`overview`),s=e=>{let t=i.value;if(t)return{overview:void 0,tasks:t.tasks.length,criteria:t.criteria.length,decisions:t.decisions.length,files:CM(t).length}[e]},c=e=>n.replace({query:{view:String(e)}});F(()=>[r.value,t.query.view,t.query.tab],([e,r,i])=>{if(!e||typeof i==`string`)return;let a=$C(FI,{});typeof r==`string`?ew(FI,{...a,[e]:r}):a[e]&&a[e]!==`overview`&&n.replace({query:{...t.query,view:a[e]}})},{immediate:!0}),Er(()=>{let e=t.query.tab;if(typeof e!=`string`)return;let{tab:r,...i}=t.query,a={...i,view:e===`views`?`files`:e};n.replace({query:a})});let l=e=>i.value&&dw(()=>XC.mainlineStatus(r.value,e,i.value.version)),u=e=>i.value&&dw(()=>XC.mainlineTitle(r.value,e,i.value.version)),d=()=>i.value&&dw(()=>XC.archive(r.value,!i.value.archivedAt,i.value.version));return(e,t)=>N(i)?(B(),H(bF,{key:0},{header:P(()=>[U(`header`,OI,[W(CD,{text:N(i).id},null,8,[`text`]),U(`h1`,kI,[W(wD,{value:N(i).title,onSave:u},null,8,[`value`])]),U(`div`,AI,[W(gP,{status:N(i).status,options:N(Bw),onChange:l},null,8,[`status`,`options`]),W(xE,{priority:N(i).priority},null,8,[`priority`]),N(i).archivedAt?(B(),V(`span`,jI,`已封存 `+j(N(i).archivedAt),1)):K(``,!0),W(eE,{class:`ml-auto`,archived:!!N(i).archivedAt,onToggle:d},null,8,[`archived`])])]),W(N(PF),{"model-value":o.value,"onUpdate:modelValue":c},{default:P(()=>[W(N(FF),{variant:`line`,class:`h-9 w-full justify-start border-b px-6`},{default:P(()=>[(B(),V(z,null,L(a,e=>W(N(IF),{key:e.key,value:e.key,class:`flex-none px-2`},{default:P(()=>[G(j(e.label),1),s(e.key)===void 0?K(``,!0):(B(),V(`span`,MI,j(s(e.key)),1))]),_:2},1032,[`value`])),64))]),_:1})]),_:1},8,[`model-value`])]),default:P(()=>[o.value===`overview`?(B(),V(`div`,NI,[W(fP,{mainline:N(i),columns:2},null,8,[`mainline`])])):o.value===`tasks`?(B(),H(DI,{key:1,mainline:N(i)},null,8,[`mainline`])):o.value===`criteria`?(B(),H($F,{key:2,mainline:N(i)},null,8,[`mainline`])):o.value===`decisions`?(B(),H(nI,{key:3,mainline:N(i)},null,8,[`mainline`])):(B(),H(lI,{key:4,mainline:N(i)},null,8,[`mainline`]))]),_:1})):(B(),V(`p`,PI,`載入 `+j(N(r))+`…`,1))}}),LI={key:0,class:`shrink-0 text-xs text-muted-foreground`},RI=I({__name:`MainlineList`,setup(e){let t={key:`mainlines`,id:e=>e.id,text:e=>e.title,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:dN(Bw)},{key:`priority`,label:`優先度`,values:e=>[uN(e.priority)],options:lN},{key:`category`,label:`分類`,values:e=>e.category?[e.category]:[]},{key:`label`,label:`標籤`,values:e=>e.labels},AN(e=>e.group)],sorts:[{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`criteria`,label:`解決條件`,value:e=>e.criteria.total?e.criteria.done/e.criteria.total:null,dir:`desc`},{key:`priority`,label:`優先度`,value:e=>uN(e.priority),dir:`asc`},{key:`updated`,label:`更新`,value:e=>e.updated,dir:`desc`},{key:`created`,label:`建立`,value:e=>e.created,dir:`desc`},{key:`due`,label:`到期`,value:e=>e.due,dir:`asc`}],groups:[hN(Bw),{key:`priority`,label:`優先度`,value:e=>uN(e.priority),order:[`P0`,`P1`,`P2`,`P3`]},{key:`category`,label:`分類`,value:e=>e.category??`未分類`},kN(e=>e.group)],defaultSort:`updated`,defaultGroup:`status`,ended:e=>fN(e.status),archived:e=>!!e.archivedAt},n=e=>Q.relations.mainlineDeps.filter(t=>t.from===e.id),r=CN(t,()=>Q.summary?.mainlines??[]),i=xF(r,{kind:`mainline`,archived:e=>!!e.archivedAt}),a=[{key:`name`,label:`名稱`,sort:`name`},{key:`priority`,label:`優先度`,sort:`priority`},{key:`criteria`,label:`解決條件`,sort:`criteria`,value:e=>e.criteria.total},{key:`deps`,label:`依賴`,value:n,optional:!0},{key:`due`,label:`到期`,sort:`due`,value:e=>e.due},{key:`updated`,label:`更新`,class:`text-xs text-muted-foreground`,sort:`updated`,optional:!0}],o=e=>dw(()=>XC.archive(e.id,!e.archivedAt));return(e,t)=>(B(),H(bF,null,{header:P(()=>[W(yD,{title:`主脈絡`,description:`一條主脈絡是一件要做完的事:意圖、解決條件,以及推進它的任務與決策。`}),W(oD,{view:N(r)},null,8,[`view`])]),default:P(()=>[W(XE,{view:N(r),selection:N(i),columns:a,"item-ref":e=>e.id},{name:P(({item:e})=>[W(hD,{status:e.status,id:e.id,title:e.title,muted:!!e.archivedAt},{default:P(()=>[(B(!0),V(z,null,L(e.labels,e=>(B(),H(N(QT),{key:e,variant:`secondary`,class:`shrink-0`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128)),e.archivedAt?(B(),V(`span`,LI,`已封存`)):K(``,!0)]),_:2},1032,[`status`,`id`,`title`,`muted`])]),priority:P(({item:e})=>[W(xE,{priority:e.priority},null,8,[`priority`])]),criteria:P(({item:e})=>[W(QN,{done:e.criteria.done,total:e.criteria.total},null,8,[`done`,`total`])]),deps:P(({item:e})=>[W(pI,{deps:n(e)},null,8,[`deps`])]),due:P(({item:e})=>[W(pE,{day:e.due,ended:N(fN)(e.status)},null,8,[`day`,`ended`])]),updated:P(({item:e})=>[W(xP,{at:e.updated},null,8,[`at`])]),actions:P(({item:e})=>[W(N(sC),{variant:`ghost`,size:`xs`,class:`text-muted-foreground`,"as-child":``},{default:P(()=>[W(N(Am),{to:`/mainlines/${e.id}`,onClick:t[0]||=au(()=>{},[`stop`])},{default:P(()=>[W(N(ef)),t[1]||=G(`開啟`,-1)]),_:1},8,[`to`])]),_:2},1024),W(eE,{archived:!!e.archivedAt,onToggle:t=>o(e)},null,8,[`archived`,`onToggle`])]),empty:P(()=>[...t[2]||=[G(`沒有主脈絡。在 hub 內執行 `,-1),U(`code`,null,`mainflow new mainline <slug> --title <title>`,-1),G(` 建立第一個。`,-1)]]),_:1},8,[`view`,`selection`,`item-ref`]),W(fD,{selection:N(i)},null,8,[`selection`])]),_:1}))}}),zI=[`title`],BI=[`title`],VI=[`title`],HI=I({__name:`OpsLog`,setup(e){let t=e=>!/fail|error|denied|reject|abort|失敗|錯誤|拒絕|中止/i.test(e.result),n=e=>e.ref?.match(/^m\d{3}/)?.[0]??``,r=CN({key:`ops`,id:e=>`${e.at}|${e.target}|${e.operation}`,text:e=>`${e.operation} ${e.target} ${e.ref??``}`,filters:[{key:`result`,label:`結果`,values:e=>[t(e)?`success`:`failed`],options:[{value:`success`,label:`成功`},{value:`failed`,label:`沒有成功`}]},{key:`target`,label:`目標系統`,values:e=>[e.target]},{key:`mainline`,label:`主脈絡`,values:e=>[n(e)].filter(Boolean),optionLabel:e=>`${e} ${Q.summary?.mainlines.find(t=>t.id===e)?.title??``}`.trim()}],sorts:[{key:`at`,label:`時間`,value:e=>iE(e.at),dir:`desc`},{key:`operation`,label:`操作`,value:e=>e.operation,dir:`asc`},{key:`target`,label:`目標系統`,value:e=>e.target,dir:`asc`},{key:`result`,label:`結果`,value:e=>+!!t(e),dir:`asc`},{key:`ref`,label:`關聯`,value:e=>e.ref,dir:`asc`}],groups:[{key:`month`,label:`月份`,value:e=>oE(e.at).slice(0,7),latestFirst:!0},{key:`day`,label:`日期`,value:e=>oE(e.at),latestFirst:!0}],defaultSort:`at`,defaultGroup:`month`},()=>Q.ops),i=[{key:`operation`,label:`操作`,sort:`operation`},{key:`target`,label:`目標系統`,class:`max-w-64 truncate font-mono text-xs text-muted-foreground`,sort:`target`,optional:!0},{key:`result`,label:`結果`,class:`max-w-40 truncate text-xs`,sort:`result`},{key:`ref`,label:`關聯`,class:`max-w-56`,sort:`ref`,value:e=>e.ref,optional:!0},{key:`at`,label:`時間`,class:`font-mono text-xs text-muted-foreground tabular-nums`,sort:`at`}],{open:a}=FC();return Er(()=>Pw(Q.ops.map(e=>e.ref))),(e,n)=>(B(),H(bF,null,{header:P(()=>[W(yD,{title:`操作紀錄`,description:`對外部系統執行過的操作,只追加不改寫。`}),W(oD,{view:N(r)},null,8,[`view`])]),default:P(()=>[W(XE,{view:N(r),columns:i},{operation:P(({item:e})=>[U(`span`,{class:`block truncate`,title:e.operation},j(e.operation),9,zI)]),target:P(({item:e})=>[U(`span`,{title:e.target},j(e.target),9,BI)]),result:P(({item:e})=>[U(`span`,{class:k(t(e)?`text-muted-foreground`:`text-foreground`),title:e.result},[t(e)?K(``,!0):(B(),H(N(Qu),{key:0,class:`mr-1 inline size-3.5 align-[-2px] text-destructive`})),G(j(e.result),1)],10,VI)]),ref:P(({item:e})=>[e.ref?(B(),H(Yj,q({key:0},N(Mw)(e.ref),{onOpen:N(a)}),null,16,[`onOpen`])):K(``,!0)]),at:P(({item:e})=>[G(j(N(cE)(e.at).slice(5)),1)]),empty:P(()=>[...n[0]||=[G(`還沒有紀錄。用 `,-1),U(`code`,null,`mainflow ops add --target <系統> --op <操作> --result <結果>`,-1),G(` 記錄 push、發布、合併這類對外操作。`,-1)]]),_:1},8,[`view`])]),_:1}))}}),UI={key:0,class:`overflow-x-auto px-6 pb-2`},WI=[`aria-colcount`],GI=[`title`],KI={class:`text-xs text-muted-foreground tabular-nums`},qI={key:0,class:`col-span-full flex min-w-0 items-center gap-2 pt-4 pb-2 text-sm`,role:`rowheader`},JI=[`aria-label`,`aria-expanded`,`onClick`],YI={key:1,class:`truncate font-medium`},XI={class:`text-xs text-muted-foreground tabular-nums`},ZI={key:1,class:`px-6 py-16 text-center text-sm text-muted-foreground`},QI=I({__name:`BoardView`,props:{view:{},axis:{}},setup(e){let t=e,n=J(()=>t.view.spec.groups.find(e=>e.key===t.axis)??t.view.spec.groups[0]),r=J(()=>_N(n.value,t.view.sorted.value)),i=J(()=>t.view.group.value!==``),a=(e,t)=>e.filter(e=>gN(n.value,e).includes(t)),o=e=>[...e.items,...e.ended];return(t,n)=>e.view.groups.value.length?(B(),V(`div`,UI,[U(`div`,{class:`grid gap-x-3`,style:he({gridTemplateColumns:`repeat(${r.value.length}, minmax(20rem, 1fr))`}),role:`table`,"aria-colcount":r.value.length},[(B(!0),V(z,null,L(r.value,e=>(B(),V(`div`,{key:e.key,class:`flex min-w-0 items-center gap-2 border-b py-2`,role:`columnheader`},[e.status?(B(),H(TE,{key:0,status:e.status},null,8,[`status`])):(B(),V(`span`,{key:1,class:`truncate text-sm font-medium`,title:e.label},j(e.label),9,GI)),U(`span`,KI,j(e.items.length),1)]))),128)),(B(!0),V(z,null,L(e.view.groups.value,n=>(B(),V(z,{key:n.key},[i.value?(B(),V(`div`,qI,[U(`button`,{type:`button`,class:`-ml-1 grid size-5 shrink-0 place-items-center rounded-sm hover:bg-accent`,"aria-label":e.view.collapsed.has(n.key)?`展開分組`:`收合分組`,"aria-expanded":!e.view.collapsed.has(n.key),onClick:t=>e.view.toggleCollapsed(n.key)},[e.view.collapsed.has(n.key)?(B(),H(N(Xu),{key:1,class:`size-4 text-muted-foreground`})):(B(),H(N(Ju),{key:0,class:`size-4 text-muted-foreground`}))],8,JI),n.status?(B(),H(TE,{key:0,status:n.status},null,8,[`status`])):(B(),V(`span`,YI,j(n.label),1)),U(`span`,XI,j(o(n).length),1)])):K(``,!0),!e.view.collapsed.has(n.key)||!i.value?(B(!0),V(z,{key:1},L(r.value,r=>(B(),V(`div`,{key:r.key,class:`flex min-w-0 flex-col gap-2 py-2`,role:`cell`},[(B(!0),V(z,null,L(a(o(n),r.key),n=>R(t.$slots,`card`,{item:n},void 0,void 0,e.view.spec.id(n))),128))]))),128)):K(``,!0)],64))),128))],12,WI)])):(B(),V(`div`,ZI,[e.view.total.value>0?(B(),V(z,{key:0},[n[1]||=G(` 沒有符合條件的項目。`,-1),W(N(sC),{variant:`link`,size:`xs`,class:`px-0`,onClick:e.view.clearAll},{default:P(()=>[...n[0]||=[G(`清除篩選與搜尋`,-1)]]),_:1},8,[`onClick`])],64)):R(t.$slots,`empty`,{},void 0,void 0,1)]))}}),$I=.01,eL=e=>Math.min(2,Math.max($I,e));function tL(e,t,n,r){let i=eL(t),a=(n-e.x)/e.zoom,o=(r-e.y)/e.zoom;return{zoom:i,x:n-a*i,y:r-o*i}}function nL(e,t,n=.9){if(e.width<=0||e.height<=0||t.width<=0||t.height<=0)return{x:0,y:0,zoom:1};let r=eL(Math.min(1,t.width*n/e.width,t.height*n/e.height));return{zoom:r,x:(t.width-e.width*r)/2,y:(t.height-e.height*r)/2}}function rL(e){if(e.deltaMode!==0)return!0;let t=e.wheelDeltaY;return typeof t==`number`&&t!==0&&t%120==0&&e.deltaX===0}function iL(e,t){let n=new Set(t.flatMap(e=>[e.from,e.to])),r=new Map;for(let e of t)r.set(e.from,[...r.get(e.from)??[],e.to]);let i=new Map,a=new Set;function o(e){let t=i.get(e);if(t!==void 0)return t;if(a.has(e))return 0;a.add(e);let n=Math.max(0,...(r.get(e)??[]).map(e=>o(e)+1));return a.delete(e),i.set(e,n),n}let s=[];for(let t of e){if(!n.has(t))continue;let e=o(t);for(;s.length<=e;)s.push([]);s[e].push(t)}return{columns:s.filter(e=>e.length>0),free:e.filter(e=>!n.has(e))}}function aL(e,t,n){let r=e=>e===void 0?1/0:n.includes(e)?n.indexOf(e):n.length;return[...new Set([...e.columns.flat(),...e.free].map(t))].sort((e,t)=>r(e)-r(t)||(e??``).localeCompare(t??``)).map(n=>{let r=e.columns.map(e=>e.filter(e=>t(e)===n)),i=e.free.filter(e=>t(e)===n);return n===void 0?{columns:r,free:i}:{group:n,columns:r,free:i}})}var oL=[`data-node`,`aria-pressed`,`title`],sL={class:`flex min-w-0 items-center gap-2`},cL={class:`truncate`},lL={class:`shrink-0 font-mono text-xs text-muted-foreground`},uL=[`title`],dL={class:`h-1 w-12 overflow-hidden rounded-full bg-muted`},fL={class:`flex min-w-0 items-center gap-2`},pL=[`title`],mL=I({__name:`MainlineNode`,props:{id:{},picked:{type:Boolean}},emits:[`pick`],setup(e){let t=e,n=J(()=>Q.summary?.mainlines.find(e=>e.id===t.id)),r=J(()=>n.value?.title??Mw(t.id).title??``),i=J(()=>n.value?.status??Mw(t.id).status),a=J(()=>n.value?.items),o=J(()=>fN(i.value??``)),s=J(()=>OC(t.id)),c=J(()=>{let e=Q.mainlines[t.id]?.tasks;return e?mN(e):void 0}),l=J(()=>a.value?.total?Math.round(100*a.value.done/a.value.total):0);return(t,n)=>(B(),V(`button`,{type:`button`,class:k([`relative z-[1] flex w-full min-w-0 flex-col gap-1.5 rounded-xl border px-3 py-2.5 text-left transition-[background-color,border-color] duration-[120ms] focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,[s.value?`border-dashed border-muted-foreground/60 bg-background hover:bg-[color-mix(in_oklab,var(--accent)_50%,var(--background))]`:`bg-card shadow-xs hover:bg-[color-mix(in_oklab,var(--accent)_50%,var(--card))]`,{"border-ring":e.picked}]]),"data-node":e.id,"aria-pressed":e.picked,title:s.value?`${e.id}:在新分頁開啟另一個 hub`:void 0,onClick:n[0]||=n=>t.$emit(`pick`,e.id,n)},[U(`span`,sL,[W(Qw,{type:`mainline`,status:i.value},null,8,[`status`]),s.value?(B(),H(N(QT),{key:0,variant:`outline`,class:`min-w-0 shrink font-mono text-[11px] text-muted-foreground`},{default:P(()=>[U(`span`,cL,j(s.value.hub),1)]),_:1})):K(``,!0),U(`span`,lL,j(s.value?.local??e.id),1),s.value?(B(),H(N(zu),{key:1,class:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`})):K(``,!0),a.value?(B(),V(`span`,{key:2,class:`ml-auto flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground tabular-nums`,title:`checklist ${a.value.done}/${a.value.total}`},[U(`span`,dL,[U(`span`,{class:`block h-full bg-foreground`,style:he({width:`${l.value}%`})},null,4)]),G(` `+j(a.value.done)+`/`+j(a.value.total),1)],8,uL)):K(``,!0)]),U(`span`,fL,[U(`span`,{class:k([`truncate font-medium`,{"text-muted-foreground":o.value}])},j(r.value),3),!o.value&&c.value?(B(),V(`span`,{key:0,class:k([`ml-auto inline-flex shrink-0 items-center gap-1 text-xs tabular-nums`,{"text-muted-foreground":!c.value.doing}]),title:`進行中 ${c.value.doing}/未完成 ${c.value.open} 個任務`},[W(Qw,{type:`phase`,status:c.value.doing?`doing`:void 0},null,8,[`status`]),G(j(c.value.doing)+`/`+j(c.value.open),1)],10,pL)):K(``,!0)])],10,oL))}}),hL=[`data-serves`,`data-session`,`aria-pressed`],gL={"data-session-icon":``,class:`relative row-span-2 grid size-6 place-items-center rounded-md bg-muted text-foreground`},_L={class:`flex min-w-0 items-baseline gap-1`},vL={class:`truncate font-medium`},yL=[`title`],bL=[`title`],xL={class:`truncate leading-4 text-muted-foreground`},SL=I({__name:`SessionNode`,props:{session:{},serves:{},picked:{type:Boolean}},emits:[`pick`],setup(e){let t=e,n=J(()=>t.session.actions.find(e=>e.status===`doing`)??t.session.actions.find(e=>e.status===`todo`)),r=J(()=>mN(t.session.actions)),i=Fw.session.icon;return(t,a)=>(B(),V(`button`,{type:`button`,class:k([`relative z-[1] grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 rounded-md border py-1 pr-2 pl-1 text-left text-xs transition-colors duration-[120ms] hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,e.picked?`border-ring`:`border-transparent`]),"data-serves":e.serves,"data-session":e.session.id,"aria-pressed":e.picked,onClick:a[0]||=e=>t.$emit(`pick`,e)},[U(`span`,gL,[(B(),H(fa(N(i)),{class:`size-3.5`})),U(`span`,{class:k([`absolute -right-0.5 -bottom-0.5 size-2 rounded-full border-[1.5px] border-background`,n.value?`bg-status-done`:`bg-status-todo`])},null,2)]),U(`span`,_L,[U(`span`,vL,j(N(Dw)(e.session)),1),e.session.elsewhere?(B(),V(`span`,{key:0,class:`shrink-0 text-muted-foreground`,title:`其他環境:工作目錄 ${e.session.cwd} 不在這台電腦上`,"data-elsewhere":``},`其他環境`,8,yL)):K(``,!0),r.value.open?(B(),V(`span`,{key:1,class:k([`shrink-0 tabular-nums`,{"text-muted-foreground":!r.value.doing}]),title:`進行中 ${r.value.doing}/未處理 ${r.value.open} 個行動`},`(`+j(r.value.doing)+`/`+j(r.value.open)+`)`,11,bL)):K(``,!0)]),U(`span`,xL,j(n.value?.do??`沒有待做的行動`),1)],10,hL))}}),CL={class:`rounded-xl border bg-card text-body shadow-xs`},wL={class:`flex h-10 items-center gap-2 px-4`},TL={class:`font-mono text-xs text-muted-foreground`},EL={class:`flex flex-col gap-4 px-4 pb-4`},DL={class:`text-base font-semibold [overflow-wrap:anywhere]`},OL={class:`grid grid-cols-[72px_1fr] items-center gap-x-3 gap-y-1.5 text-xs`},kL={class:`flex flex-col gap-0.5`},AL=[`onClick`],jL={class:`shrink-0 font-mono text-muted-foreground`},ML={class:`truncate`},NL={class:`ml-auto shrink-0 text-muted-foreground`},PL={key:0,class:`px-1.5 text-xs text-muted-foreground`},FL={class:`flex flex-col gap-0.5`},IL={key:0,class:`px-1.5 text-xs text-muted-foreground`},LL={class:`flex h-10 items-center gap-2 px-4`},RL={class:`flex flex-col gap-4 px-4 pb-4`},zL={class:`text-base font-semibold [overflow-wrap:anywhere]`},BL={class:`grid grid-cols-[72px_1fr] items-center gap-x-3 gap-y-1.5 text-xs`},VL={class:`flex flex-col gap-0.5`},HL={class:`flex flex-col gap-0.5`},UL={class:`shrink-0 font-mono text-muted-foreground`},WL={class:`truncate`},GL={key:1,class:`px-1.5 text-xs text-muted-foreground`},KL={key:2,class:`px-4 py-6 text-sm text-muted-foreground`},qL=I({__name:`RunningPreview`,props:{picked:{}},emits:[`pickMainline`,`pickSession`],setup(e,{emit:t}){let n=e,r=t,{open:i}=FC(),a=[`doing`,`blocked`,`todo`],o=Ew,s=J(()=>{if(n.picked?.kind!==`mainline`)return;let e=n.picked.id,t=Q.summary?.mainlines.find(t=>t.id===e),r=(Q.mainlines[e]?.tasks??[]).filter(e=>a.includes(e.status)).sort((e,t)=>a.indexOf(e.status)-a.indexOf(t.status)||(e.order??0)-(t.order??0));return{id:e,loaded:!!Q.mainlines[e],title:t?.title??Mw(e).title??e,status:t?.status,criteria:t?.criteria,items:t?.items,tasks:r,sessions:kw().filter(t=>Ow(t)===e)}}),c=J(()=>n.picked?.kind===`session`?Q.sessions.find(e=>e.id===n.picked.id):void 0),l=e=>{let t=e=>Q.sessions.filter(t=>t.delegatedFrom===e).flatMap(e=>[e,...t(e.id)]),n=t(e.id);return n.length?`${n.filter(e=>e.status===`active`).length} 個進行中,共 ${n.length} 個`:`沒有`};return(e,t)=>(B(),V(`div`,CL,[s.value?(B(),V(z,{key:0},[U(`div`,wL,[W(Qw,{type:`mainline`,status:s.value.status},null,8,[`status`]),U(`span`,TL,j(s.value.id),1),t[2]||=U(`span`,{class:`text-xs text-muted-foreground`},`主脈絡`,-1)]),U(`div`,EL,[U(`h3`,DL,j(s.value.title),1),U(`dl`,OL,[t[5]||=U(`dt`,{class:`text-muted-foreground`},`狀態`,-1),U(`dd`,null,[s.value.status?(B(),H(TE,{key:0,status:s.value.status},null,8,[`status`])):K(``,!0)]),s.value.criteria?(B(),V(z,{key:0},[t[3]||=U(`dt`,{class:`text-muted-foreground`},`解決條件`,-1),U(`dd`,null,[W(QN,{done:s.value.criteria.done,total:s.value.criteria.total},null,8,[`done`,`total`])])],64)):K(``,!0),s.value.items?(B(),V(z,{key:1},[t[4]||=U(`dt`,{class:`text-muted-foreground`},`checklist`,-1),U(`dd`,null,[W(QN,{done:s.value.items.done,total:s.value.items.total},null,8,[`done`,`total`])])],64)):K(``,!0)]),U(`section`,kL,[t[6]||=U(`h4`,{class:`mb-0.5 text-xs font-medium text-muted-foreground`},`未完成的任務`,-1),(B(!0),V(z,null,L(s.value.tasks,e=>(B(),V(`button`,{key:e.id,type:`button`,class:`flex h-7 min-w-0 items-center gap-2 rounded-md px-1.5 text-left text-xs hover:bg-accent`,onClick:t=>N(i)(N(CC)(s.value.id,e.id))},[W(Qw,{type:N(Iw)(e),status:e.status},null,8,[`type`,`status`]),U(`span`,jL,j(e.id),1),U(`span`,ML,j(e.title),1),U(`span`,NL,j(N(Gw)[e.status]),1)],8,AL))),128)),s.value.tasks.length?K(``,!0):(B(),V(`p`,PL,j(s.value.loaded?`沒有`:`載入中…`),1))]),U(`section`,FL,[t[7]||=U(`h4`,{class:`mb-0.5 text-xs font-medium text-muted-foreground`},`會話`,-1),(B(!0),V(z,null,L(s.value.sessions,e=>(B(),H(SL,{key:e.id,session:e,onPick:t=>r(`pickSession`,e.id)},null,8,[`session`,`onPick`]))),128)),s.value.sessions.length?K(``,!0):(B(),V(`p`,IL,`沒有`))]),U(`div`,null,[W(N(sC),{variant:`outline`,size:`sm`,"as-child":``},{default:P(()=>[W(N(Am),{to:`/mainlines/${s.value.id}`},{default:P(()=>[...t[8]||=[G(`開啟主脈絡`,-1)]]),_:1},8,[`to`])]),_:1})])])],64)):c.value?(B(),V(z,{key:1},[U(`div`,LL,[W(Qw,{type:`session`,status:c.value.status},null,8,[`status`]),t[9]||=U(`span`,{class:`text-xs text-muted-foreground`},`會話`,-1)]),U(`div`,RL,[U(`h3`,zL,j(N(Dw)(c.value)),1),U(`dl`,BL,[t[10]||=U(`dt`,{class:`text-muted-foreground`},`狀態`,-1),U(`dd`,null,[W(TE,{status:c.value.status},null,8,[`status`])]),t[11]||=U(`dt`,{class:`text-muted-foreground`},`子代理`,-1),U(`dd`,null,j(l(c.value)),1)]),U(`section`,VL,[t[12]||=U(`h4`,{class:`mb-0.5 text-xs font-medium text-muted-foreground`},`目前行動`,-1),U(`p`,{class:k([`text-xs [overflow-wrap:anywhere]`,{"text-muted-foreground":!N(o)(c.value)}])},j(N(o)(c.value)?.do??`沒有待做的行動`),3)]),U(`section`,HL,[t[13]||=U(`h4`,{class:`mb-0.5 text-xs font-medium text-muted-foreground`},`服務的主脈絡`,-1),N(Ow)(c.value)?(B(),V(`button`,{key:0,type:`button`,class:`flex h-7 min-w-0 items-center gap-2 rounded-md px-1.5 text-left text-xs hover:bg-accent`,onClick:t[0]||=e=>r(`pickMainline`,N(Ow)(c.value))},[W(Qw,{type:`mainline`,status:N(Mw)(N(Ow)(c.value)).status},null,8,[`status`]),U(`span`,UL,j(N(Ow)(c.value)),1),U(`span`,WL,j(N(Mw)(N(Ow)(c.value)).title),1)])):(B(),V(`p`,GL,`沒有`))]),U(`div`,null,[W(N(sC),{variant:`outline`,size:`sm`,onClick:t[1]||=e=>N(i)(N(TC)(c.value.id))},{default:P(()=>[...t[14]||=[G(`開啟會話`,-1)]]),_:1})])])],64)):(B(),V(`p`,KL,`點關係圖裡的主脈絡或會話看詳情。`))]))}}),JL=[`width`,`height`],YL=[`id`],XL=[`fill`],ZL=[`d`,`stroke`,`stroke-dasharray`,`marker-end`],QL=[`onClick`],$L={class:`shrink-0 font-mono`},eR={class:`truncate`},tR={key:2,class:`flex flex-wrap items-start gap-x-6 gap-y-3`},nR={key:0,class:`flex flex-col gap-1.5 px-[9px]`},rR={class:`flex flex-wrap gap-x-6 gap-y-1`},iR={key:2,class:`absolute bottom-3 left-1/2 z-20 -translate-x-1/2 cursor-auto`,role:`toolbar`,"aria-label":`批次操作`,"data-canvas-overlay":``},aR={class:`flex items-center gap-1 rounded-lg border bg-popover py-1 pr-1 pl-3 text-sm shadow-md`},oR={class:`mr-2 tabular-nums`},sR={class:`text-muted-foreground tabular-nums`},cR={class:`absolute right-3 bottom-3 z-20 flex cursor-auto items-center rounded-full border bg-popover p-0.5 text-xs shadow-sm`,role:`toolbar`,"aria-label":`縮放`,"data-canvas-overlay":``},lR={key:1,class:`text-sm text-muted-foreground`},uR=20,dR=260,fR=48,pR=4,mR=4,hR=`mainflow.overview.canvasHeight`,gR=240,_R=`mainflow.overview.previewWidth`,vR=260,yR=560,bR=I({__name:`RunningMap`,setup(e){let t=e=>`${e.kind}:${e.id}`,n=[`active`,`planning`,`paused`],r=e=>e&&!fN(e)?Math.max(0,n.indexOf(e)):n.length,i=(e,t)=>e.map((e,t)=>({item:e,i:t})).sort((e,n)=>r(t(e.item))-r(t(n.item))||e.i-n.i).map(e=>e.item),a=J(()=>(Q.summary?.mainlines??[]).filter(e=>!e.archivedAt)),o=e=>Mw(e).status,s=J(()=>a.value.map(e=>e.id)),c=J(()=>new Set((Q.summary?.mainlines??[]).filter(e=>e.archivedAt).map(e=>e.id))),l=J(()=>Q.relations.mainlineDeps.filter(e=>![e.from,e.to].some(e=>c.value.has(e)))),u=J(()=>new Map(Object.entries(Q.relations.groupMembers).flatMap(([e,t])=>t.filter(e=>e.kind===`mainline`&&!e.archived).map(t=>[t.ref,e])))),d=J(()=>i([...new Set([...s.value,...u.value.keys(),...l.value.flatMap(e=>[e.to,e.from])])],o)),f=J(()=>new Set(d.value)),p=J(()=>iL(d.value,l.value)),m=e=>OC(e)?u.value.get(e):(Q.summary?.mainlines??[]).find(t=>t.id===e)?.group??void 0,h=J(()=>aL(p.value,m,DN().map(e=>e.id))),{open:g}=FC(),_=J(()=>i(kw(),e=>e.status)),v=e=>_.value.filter(t=>Ow(t)===e),y=J(()=>_.value.filter(e=>!f.value.has(Ow(e)??``))),b=e=>e.kind===`mainline`?f.value.has(e.id):_.value.some(t=>t.id===e.id),x=Qt(new Map),S=J(()=>[...x.values()].filter(b)),C=M(),w=J(()=>C.value&&x.has(t(C.value))&&b(C.value)?C.value:void 0),T=(e,n)=>x.has(t({kind:e,id:n})),ee=e=>!!e?.shiftKey;function E(){x.clear(),C.value=void 0}function te(e,n){let r=t(e);if(ee(n)){x.has(r)?x.delete(r):x.set(r,e);return}x.clear(),x.set(r,e),C.value=e}function ne(e,t){if(OC(e)){ee(t)||window.open(kC(e)??void 0,`_blank`,`noopener`);return}te({kind:`mainline`,id:e},t)}let re=(e,t)=>te({kind:`session`,id:e},t);async function D(){let e=new Map;for(let t of S.value)e.set(t.kind,[...e.get(t.kind)??[],t.id]);await dw(async()=>{let t=[];for(let[n,r]of e){let e=await XC.archiveMany(n,r,!0);t.push(...e.failed.map(e=>`${e.id}(${e.error})`))}if(t.length)throw Error(`${t.length} 個沒有封存:${t.join(`、`)}`)})&&E()}let ie=M(),ae=J(()=>{let e=ie.value;return e&&{left:`${Math.min(e.x1,e.x2)}px`,top:`${Math.min(e.y1,e.y2)}px`,width:`${Math.abs(e.x2-e.x1)}px`,height:`${Math.abs(e.y2-e.y1)}px`}});function oe(e){let t=[],n=t=>{let n=t.getBoundingClientRect();return n.left<e.right&&n.right>e.left&&n.top<e.bottom&&n.bottom>e.top};for(let e of O.value?.querySelectorAll(`[data-node], [data-session]`)??[])n(e)&&(e.dataset.node?OC(e.dataset.node)||t.push({kind:`mainline`,id:e.dataset.node}):t.push({kind:`session`,id:e.dataset.session}));return t}let{current:se}=FC();Df(window,`keydown`,e=>{e.key!==`Escape`||se.value||Q.paletteOpen||!x.size||(w.value&&S.value.length>1?C.value=void 0:E())},{capture:!0});let O=M(),ce=M([]),le=M({width:0,height:0});function ue(e,t){let n=0,r=0;for(let i=e;i&&i!==t;i=i.offsetParent)n+=i.offsetLeft,r+=i.offsetTop;return{left:n,top:r,right:n+e.offsetWidth,bottom:r+e.offsetHeight,height:e.offsetHeight}}function de(){let e=O.value;if(!e)return;let t=t=>{let n=e.querySelector(`[data-node="${CSS.escape(t)}"]`);return n?ue(n,e):void 0},n=[];for(let e of l.value){let r=t(e.to),i=t(e.from);if(!r||!i)continue;let a=r.right,o=r.top+uR,s=i.left-2,c=i.top+uR;n.push({key:`${e.to}>${e.from}`,d:`M${a},${o} C${a+28},${o} ${s-28},${c} ${s},${c}`,kind:e.state===`pending`?`pending`:`other`})}for(let r of e.querySelectorAll(`[data-serves]`)){let i=t(r.dataset.serves),a=r.querySelector(`[data-session-icon]`);if(!i||!a)continue;let o=ue(a,e);n.push({key:`s:${r.dataset.session}`,d:`M${i.left+12},${i.bottom} V${o.top+o.height/2} H${o.left}`,kind:`session`})}ce.value=n,le.value={width:e.offsetWidth,height:e.offsetHeight},Se||Ce()}Ff(O,de),F([p,_,()=>Q.mainlines],()=>void tr(de),{deep:!0});let fe={pending:`var(--muted-foreground)`,other:`var(--status-off)`,session:`var(--status-off)`},pe={pending:void 0,other:`4 3`,session:`2 2`},me=J(()=>{let e=p.value.columns.length*308-fR,t=e=>Math.min(e,pR)*284-24,n=e=>t(e)+18;return Math.max(dR,e+18,...h.value.map(e=>n(e.free.length)),t(y.value.length))}),ge=M(),_e=M({x:0,y:0,zoom:1}),ve=M({width:0,height:0});function ye(){let e=ge.value;e&&(ve.value={width:e.clientWidth,height:e.clientHeight})}Ff(ge,()=>{ye(),Se||Ce()});let A=M(!1),be;function xe(e){A.value=!0,_e.value=e,clearTimeout(be),be=setTimeout(()=>A.value=!1,320)}let Se=!1;function Ce(){ye(),le.value.width&&le.value.height&&ve.value.width&&ve.value.height&&(_e.value=nL(le.value,ve.value),Se=!0)}let we=()=>(ye(),xe(nL(le.value,ve.value))),Te=e=>(ye(),xe(tL(_e.value,_e.value.zoom*e,ve.value.width/2,ve.value.height/2))),Ee=J(()=>`${Math.round(_e.value.zoom*100)}%`),De=0;function Oe(e){let t=ge.value.getBoundingClientRect();if(e.ctrlKey||e.metaKey){e.preventDefault(),_e.value=tL(_e.value,eL(_e.value.zoom*Math.exp(-e.deltaY*.01)),e.clientX-t.left,e.clientY-t.top);return}let n=performance.now()<De||!rL(e);if(e.preventDefault(),!n){ke(ge.value).scrollBy({top:Ae(e,e.deltaY),left:Ae(e,e.deltaX)});return}De=performance.now()+120,_e.value={..._e.value,x:_e.value.x-e.deltaX,y:_e.value.y-e.deltaY}}function ke(e){for(let t=e.parentElement;t;t=t.parentElement){let{overflowY:e}=getComputedStyle(t);if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t}return document.scrollingElement??document.documentElement}let Ae=(e,t)=>e.deltaMode===1?t*16:e.deltaMode===2?t*window.innerHeight:t;function je(e){let n=ge.value,r=n.getBoundingClientRect(),i=new Map(x),a=e.clientX-r.left,o=e.clientY-r.top;try{n.setPointerCapture(e.pointerId)}catch{}let s=e=>{let n=e.clientX-r.left,s=e.clientY-r.top;if(!ie.value&&Math.hypot(n-a,s-o)<mR)return;ie.value={x1:a,y1:o,x2:n,y2:s};let c=oe({left:r.left+Math.min(a,n),top:r.top+Math.min(o,s),right:r.left+Math.max(a,n),bottom:r.top+Math.max(o,s)});x.clear();for(let[e,t]of i)x.set(e,t);for(let e of c)x.set(t(e),e)},c=()=>{n.removeEventListener(`pointermove`,s),n.removeEventListener(`pointerup`,c),n.removeEventListener(`pointercancel`,c),ie.value=void 0};n.addEventListener(`pointermove`,s),n.addEventListener(`pointerup`,c),n.addEventListener(`pointercancel`,c)}let Me=M(!1);function Ne(e){if(e.button!==0||e.target.closest(`button, a, [data-canvas-overlay]`))return;if(e.shiftKey)return je(e);let t={x:e.clientX,y:e.clientY,vx:_e.value.x,vy:_e.value.y},n=!1,r=ge.value;try{r.setPointerCapture(e.pointerId)}catch{}let i=e=>{let r=e.clientX-t.x,i=e.clientY-t.y;!n&&Math.hypot(r,i)<mR||(n=!0,Me.value=!0,_e.value={..._e.value,x:t.vx+r,y:t.vy+i})},a=()=>{r.removeEventListener(`pointermove`,i),r.removeEventListener(`pointerup`,a),r.removeEventListener(`pointercancel`,a),Me.value=!1,n||E()};r.addEventListener(`pointermove`,i),r.addEventListener(`pointerup`,a),r.addEventListener(`pointercancel`,a)}let Pe=e=>Math.round(Math.min(Math.max(gR,window.innerHeight),Math.max(gR,e))),Fe=Number($C(hR,null)),Ie=M(Fe>0?Pe(Fe):null);function Le(e){let t=e.clientY,n=ge.value.offsetHeight,r=e=>Ie.value=Pe(n+e.clientY-t),i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i),ew(hR,Ie.value)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)}function Re(){Ie.value=null,ew(hR,null)}let ze=e=>Math.min(yR,Math.max(vR,e)),Be=M(ze(Number($C(_R,340))||340)),Ve=J(()=>ve.value.width?Math.min(Be.value,ve.value.width*.6):Be.value);function He(e){let t=e.clientX,n=Ve.value,r=e=>Be.value=ze(n+t-e.clientX),i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i),ew(_R,Be.value)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)}return(e,t)=>d.value.length||_.value.length?(B(),V(`div`,{key:0,ref_key:`viewport`,ref:ge,class:k([`relative w-full touch-none overflow-hidden rounded-xl border bg-background select-none`,[Me.value?`cursor-grabbing`:`cursor-grab`,Ie.value===null&&`h-[60vh]`]]),style:he(Ie.value===null?void 0:{height:`${Ie.value}px`}),"data-canvas":``,onPointerdown:Ne,onWheel:Oe},[U(`div`,{ref_key:`canvas`,ref:O,class:k([`absolute top-0 left-0 flex origin-top-left flex-col gap-6`,{"transition-transform duration-300 ease-out":A.value}]),style:he({width:`${me.value}px`,transform:`translate(${_e.value.x}px, ${_e.value.y}px) scale(${_e.value.zoom})`})},[(B(),V(`svg`,{class:`pointer-events-none absolute inset-0 overflow-visible`,width:le.value.width,height:le.value.height,"aria-hidden":`true`},[U(`defs`,null,[(B(),V(z,null,L([`pending`,`other`],e=>U(`marker`,{id:`run-arrow-${e}`,key:e,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`7`,markerHeight:`7`,orient:`auto`},[U(`path`,{d:`M0,0 L8,4 L0,8 z`,fill:fe[e]},null,8,XL)],8,YL)),64))]),(B(!0),V(z,null,L(ce.value,e=>(B(),V(`path`,{key:e.key,d:e.d,fill:`none`,"stroke-width":`1.5`,stroke:fe[e.kind],"stroke-dasharray":pe[e.kind],"marker-end":e.kind===`session`?void 0:`url(#run-arrow-${e.kind})`},null,8,ZL))),128))],8,JL)),(B(!0),V(z,null,L(h.value,e=>(B(),H(fa(e.group?`section`:`div`),{key:e.group??`ungrouped`,class:k([`flex flex-col gap-4 rounded-xl border p-2`,e.group?`border-dashed`:`border-transparent`]),"data-map-group":e.group},{default:P(()=>[e.group?(B(),V(`button`,{key:0,type:`button`,class:`relative z-[1] -mb-1 flex max-w-full min-w-0 items-center gap-1.5 self-start rounded-sm bg-background px-1 text-left text-xs text-muted-foreground hover:bg-accent`,onClick:t=>N(g)(e.group)},[W(Qw,{type:`group`,status:N(EN)(e.group)?.status},null,8,[`status`]),U(`span`,$L,j(e.group),1),U(`span`,eR,j(N(EN)(e.group)?.title),1),W(xE,{priority:N(EN)(e.group)?.priority,class:`shrink-0`},null,8,[`priority`])],8,QL)):K(``,!0),e.columns.some(e=>e.length)?(B(),V(`div`,{key:1,class:`grid gap-y-4`,style:he({columnGap:`${fR}px`,gridTemplateColumns:`repeat(${e.columns.length}, ${dR}px)`})},[(B(!0),V(z,null,L(e.columns,(e,t)=>(B(),V(`div`,{key:t,class:`flex min-w-0 flex-col gap-4`},[(B(!0),V(z,null,L(e,e=>(B(),V(`div`,{key:e,class:`flex max-w-full flex-col gap-1.5`,style:he({width:`${dR}px`})},[W(mL,{id:e,picked:T(`mainline`,e),onPick:ne},null,8,[`id`,`picked`]),(B(!0),V(z,null,L(v(e),t=>(B(),H(SL,{key:t.id,session:t,serves:e,picked:T(`session`,t.id),class:`ml-5`,onPick:e=>re(t.id,e)},null,8,[`session`,`serves`,`picked`,`onPick`]))),128))],4))),128))]))),128))],4)):K(``,!0),e.free.length?(B(),V(`div`,tR,[(B(!0),V(z,null,L(e.free,e=>(B(),V(`div`,{key:e,class:`flex max-w-full flex-col gap-1.5`,style:he({width:`${dR}px`})},[W(mL,{id:e,picked:T(`mainline`,e),onPick:ne},null,8,[`id`,`picked`]),(B(!0),V(z,null,L(v(e),t=>(B(),H(SL,{key:t.id,session:t,serves:e,picked:T(`session`,t.id),class:`ml-5`,onPick:e=>re(t.id,e)},null,8,[`session`,`serves`,`picked`,`onPick`]))),128))],4))),128))])):K(``,!0)]),_:2},1032,[`class`,`data-map-group`]))),128)),y.value.length?(B(),V(`div`,nR,[U(`div`,rR,[(B(!0),V(z,null,L(y.value,e=>(B(),H(SL,{key:e.id,session:e,picked:T(`session`,e.id),class:`max-w-full`,style:he({width:`${dR}px`}),onPick:t=>re(e.id,t)},null,8,[`session`,`picked`,`style`,`onPick`]))),128))])])):K(``,!0)],6),w.value?(B(),V(`aside`,{key:0,class:`absolute top-3 right-3 z-20 flex max-h-[calc(100%-1.5rem)] cursor-auto flex-col overflow-y-auto overscroll-contain rounded-xl shadow-lg`,style:he({width:`${Ve.value}px`}),"aria-label":`預覽`,"data-canvas-overlay":``,onWheel:t[0]||=au(()=>{},[`stop`])},[U(`div`,{class:`absolute inset-y-0 left-0 z-10 w-2 cursor-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`拖曳調整預覽寬度`,onPointerdown:au(He,[`prevent`,`stop`])},null,32),W(qL,{picked:w.value,onPickMainline:ne,onPickSession:re},null,8,[`picked`])],36)):K(``,!0),ie.value?(B(),V(`div`,{key:1,class:`pointer-events-none absolute z-20 rounded-sm border border-ring bg-ring/10`,style:he(ae.value),"aria-hidden":`true`},null,4)):K(``,!0),S.value.length>=1?(B(),V(`div`,iR,[U(`div`,aR,[U(`span`,oR,`已選 `+j(S.value.length)+` 個`,1),W(N(sC),{variant:`ghost`,size:`sm`,onClick:D},{default:P(()=>[W(N(Pu)),t[4]||=G(`封存`,-1),U(`span`,sR,j(S.value.length),1)]),_:1}),W(N(sC),{variant:`ghost`,size:`icon-sm`,"aria-label":`清除選取`,onClick:t[1]||=e=>E()},{default:P(()=>[W(N(uf))]),_:1})])])):K(``,!0),U(`div`,{class:`absolute inset-x-0 bottom-0 z-10 h-2 cursor-row-resize`,role:`separator`,"aria-orientation":`horizontal`,"aria-label":`拖曳調整畫布高度,雙擊回到預設高度`,"data-canvas-overlay":``,onPointerdown:au(Le,[`prevent`,`stop`]),onDblclick:Re},null,32),U(`div`,cR,[W(N(sC),{variant:`ghost`,size:`icon-sm`,class:`rounded-full`,"aria-label":`縮小`,onClick:t[2]||=e=>Te(1/N(1.2))},{default:P(()=>[W(N(Vd))]),_:1}),U(`button`,{type:`button`,class:`h-7 min-w-12 rounded-full px-1.5 tabular-nums hover:bg-accent`,title:`全部置入畫面`,"aria-label":`全部置入畫面`,onClick:we},j(Ee.value),1),W(N(sC),{variant:`ghost`,size:`icon-sm`,class:`rounded-full`,"aria-label":`放大`,onClick:t[3]||=e=>Te(N(1.2))},{default:P(()=>[W(N(Gd))]),_:1})])],38)):(B(),V(`p`,lR,[...t[5]||=[G(`沒有主脈絡。在 hub 內執行 `,-1),U(`code`,null,`mainflow new mainline <slug> --title <title>`,-1),G(` 建立。`,-1)]]))}}),xR={class:`flex flex-col gap-8 px-6 pt-2 pb-10`},SR={key:0,"aria-labelledby":`attention`,class:`-mb-4 rounded-lg border bg-card`},CR={id:`attention`,class:`text-sm font-medium`},wR=[`aria-expanded`],TR={class:`text-xs text-muted-foreground tabular-nums`},ER={key:2,class:`ml-2 flex min-w-0 items-center gap-3 overflow-hidden text-xs font-normal text-muted-foreground`},DR={class:`tabular-nums`},OR={id:`attention-list`,class:`border-t`},kR=[`data-peek`,`aria-current`,`onClick`],AR={class:`shrink-0 font-mono text-xs text-muted-foreground`},jR={class:`min-w-0 truncate`},MR=[`title`],NR={class:`truncate`},PR={key:0,class:`hidden max-w-48 shrink-0 truncate text-xs text-muted-foreground xl:inline`},FR={"aria-labelledby":`running`},IR={id:`running`,class:`mb-2 flex items-center gap-1.5 text-sm font-medium`},LR={class:`text-xs font-normal text-muted-foreground tabular-nums`},RR={type:`button`,class:`grid size-5 place-items-center rounded-sm text-muted-foreground hover:text-foreground`,"aria-label":`依賴線的說明`},zR={"aria-labelledby":`issues`,class:`-mx-6 min-w-0`},BR={id:`issues`,class:`px-6 text-sm font-medium`},VR={class:`ml-1 text-xs text-muted-foreground tabular-nums`},HR={class:`flex min-w-0 items-center gap-2`},UR={class:`shrink-0 font-mono text-xs text-muted-foreground`},WR=[`title`],GR={key:0,class:`flex min-w-0 items-center gap-1.5 overflow-hidden text-xs`},KR=`mainflow.overview.attentionOpen`,qR=`mainflow.list.overview.issues.axis`,JR=`箭頭由要先完成的主脈絡指向等待它的主脈絡;實線是還沒完成的依賴,虛線是已完成或無法確認的依賴。`,YR=I({__name:`Overview`,setup(e){let{open:t,current:n}=FC(),r=e=>n.value?.ref===e||void 0,i=J(()=>(Q.summary?.mainlines??[]).filter(e=>!e.archivedAt)),a=J(()=>i.value.filter(e=>e.status===`active`||e.status===`planning`||e.status===`paused`)),o=J(()=>[...new Set([...a.value.map(e=>e.id),...Q.relations.mainlineDeps.flatMap(e=>[e.from,e.to]).filter(e=>/^m\d{3}$/.test(e))])]);Er(()=>void uw(o.value));let s=J(()=>a.value.flatMap(e=>Q.mainlines[e.id]?[Q.mainlines[e.id]]:[])),c={overdue:{label:`逾期`,icon:Wu,tone:`text-destructive`},blocked:{label:`卡住`,icon:ed,tone:`text-status-waiting`},proposed:{label:`待裁決`,icon:Qu,tone:`text-warning`},due:{label:`即將到期`,icon:Wu,tone:`text-warning`},review:{label:`待重新確認`,icon:qd,tone:`text-warning`}},l=J(()=>[...s.value.flatMap(e=>e.tasks.filter(e=>e.status===`blocked`).map(t=>({ref:CC(e.id,t.id),type:Iw(t),status:t.status,id:`${e.id}/${t.id}`,title:t.title,kind:`blocked`,reason:`卡住:${t.blockedBy?.reason??`沒有寫原因`}`,context:e.title}))),...s.value.flatMap(e=>e.decisions.filter(e=>e.status===`proposed`).map(t=>({ref:wC(e.id,t.id),type:`decision`,status:t.status,id:`${e.id}/${t.id}`,title:t.title,kind:`proposed`,reason:t.affects?.length?`待裁決,影響 ${t.affects.join(`、`)}`:`待裁決`,context:e.title}))),...Q.issues.filter(e=>e.status!==`closed`&&!e.archivedAt&&dE(e.due)).map(e=>{let t=uE(e.due);return{ref:e.id,type:`issue`,status:e.status,id:e.id,title:e.title,kind:t<0?`overdue`:`due`,reason:t<0?`已逾期 ${-t} 天`:t===0?`今天到期`:`${t} 天後到期`}}),...Q.findings.filter(e=>e.status===`valid`&&!e.archivedAt&&e.reviewAfter&&uE(e.reviewAfter)<0).map(e=>({ref:e.id,type:`finding`,status:e.status,id:e.id,title:e.title,kind:`review`,reason:`${e.reviewAfter} 起該重新確認是否仍成立`}))]),u=J(()=>Object.keys(c).flatMap(e=>{let t=l.value.filter(t=>t.kind===e).length;return t?[{kind:e,n:t,...c[e]}]:[]})),d=M($C(KR,!1)===!0);function f(){d.value=!d.value,ew(KR,d.value)}let p=[`open`,`planned`],m=CN({key:`overview.issues`,queryPrefix:`i.`,id:e=>e.id,text:e=>e.title,filters:AF(p),sorts:[{key:`order`,label:`手動順序`,value:e=>e.order,dir:`asc`},{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`priority`,label:`優先度`,value:e=>uN(e.priority),dir:`asc`},{key:`planned`,label:`排入`,value:e=>e.plannedIn??e.due,dir:`asc`}],groups:jF(p),defaultSort:`order`,defaultGroup:`status`},()=>Q.issues.filter(e=>!e.archivedAt&&e.status!==`closed`)),h=$C(qR,`priority`),g=M(m.spec.groups.some(e=>e.key===h)?h:`priority`);function _(e){g.value=e,ew(qR,e)}let v=J(()=>m.spec.groups.find(e=>e.key===g.value)?.label),y=e=>uN(e.priority)!==`P2`||g.value!==`category`&&!!e.category||!!e.labels?.length,b=J(()=>a.value.length),x=J(()=>Aw().length);return(e,n)=>(B(),H(bF,null,{header:P(()=>[W(yD,{title:`總覽`,description:`現在要注意什麼、進行中的主脈絡與會話怎麼串在一起、還有哪些待辦。`})]),default:P(()=>[U(`div`,xR,[l.value.length?(B(),V(`section`,SR,[U(`h2`,CR,[U(`button`,{type:`button`,class:`flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2 text-left hover:bg-accent/50`,"aria-expanded":d.value,"aria-controls":`attention-list`,onClick:f},[d.value?(B(),H(N(Ju),{key:0,class:`size-4 shrink-0 text-muted-foreground`})):(B(),H(N(Xu),{key:1,class:`size-4 shrink-0 text-muted-foreground`})),n[1]||=G(` 需要注意 `,-1),U(`span`,TR,j(l.value.length),1),d.value?K(``,!0):(B(),V(`span`,ER,[(B(!0),V(z,null,L(u.value,e=>(B(),V(`span`,{key:e.kind,class:`flex shrink-0 items-center gap-1`},[(B(),H(fa(e.icon),{class:k([`size-3.5`,e.tone])},null,8,[`class`])),G(j(e.label)+` `,1),U(`span`,DR,j(e.n),1)]))),128))]))],8,wR)]),yr(U(`ul`,OR,[(B(!0),V(z,null,L(l.value,e=>(B(),V(`li`,{key:e.ref+e.reason,class:`flex h-9 cursor-pointer items-center gap-2 border-b px-3 transition-colors duration-[120ms] last:border-b-0 hover:bg-muted/50`,"data-peek":e.ref,"aria-current":r(e.ref),onClick:n=>N(t)(e.ref)},[W(Qw,{type:e.type,status:e.status},null,8,[`type`,`status`]),U(`span`,AR,j(e.id),1),U(`span`,jR,j(e.title),1),U(`span`,{class:`ml-auto flex min-w-0 shrink items-center gap-1 text-xs text-muted-foreground`,title:e.reason},[(B(),H(fa(c[e.kind].icon),{class:k([`size-3.5 shrink-0`,c[e.kind].tone])},null,8,[`class`])),U(`span`,NR,j(e.reason),1)],8,MR),e.context?(B(),V(`span`,PR,j(e.context),1)):K(``,!0)],8,kR))),128))],512),[[Vc,d.value]])])):K(``,!0),U(`section`,FR,[U(`h2`,IR,[n[2]||=G(` 進行中 `,-1),U(`span`,LR,j(b.value)+` 條主脈絡 · `+j(x.value)+` 個會話`,1),W(N(Bj),{"open-delay":150,"close-delay":100},{default:P(()=>[W(N(Hj),{"as-child":``},{default:P(()=>[U(`button`,RR,[W(N(td),{class:`size-3.5`})])]),_:1}),W(N(Vj),{class:`w-72 text-xs`},{default:P(()=>[G(j(JR))]),_:1})]),_:1})]),W(bR)]),U(`section`,zR,[U(`h2`,BR,[n[3]||=G(`待辦事項 `,-1),U(`span`,VR,j(N(m).total.value),1)]),W(oD,{view:N(m)},{views:P(()=>[W(N(lC),null,{default:P(()=>[W(N(SC),{"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`,size:`sm`,"aria-label":`橫軸:${v.value}`},{default:P(()=>[W(N(od)),G(j(v.value),1)]),_:1},8,[`aria-label`])]),_:1}),W(N(fC),{align:`end`,class:`w-40`},{default:P(()=>[W(N(mC),{class:`text-xs text-muted-foreground`},{default:P(()=>[...n[4]||=[G(`橫軸`,-1)]]),_:1}),W(N(hC),{"model-value":g.value,"onUpdate:modelValue":n[0]||=e=>_(String(e))},{default:P(()=>[(B(!0),V(z,null,L(N(m).spec.groups,e=>(B(),H(N(_C),{key:e.key,value:e.key},{default:P(()=>[G(j(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])]),_:1})]),_:1})]),_:1},8,[`view`]),W(QI,{view:N(m),axis:g.value},{card:P(({item:e})=>[W(N(uI),{class:k([`min-w-0 cursor-pointer gap-1 px-3 py-2 shadow-xs transition-colors duration-[120ms] hover:bg-accent/50`,{"bg-muted":r(e.id)}]),"data-peek":e.id,"aria-current":r(e.id),onClick:n=>N(t)(e.id)},{default:P(()=>[U(`div`,HR,[W(Qw,{type:`issue`,status:e.status},null,8,[`status`]),U(`span`,UR,j(e.id),1),U(`span`,{class:`truncate`,title:e.title},j(e.title),9,WR)]),y(e)?(B(),V(`div`,GR,[W(xE,{priority:e.priority,class:`shrink-0`},null,8,[`priority`]),g.value!==`category`&&e.category?(B(),H(N(QT),{key:0,variant:`outline`},{default:P(()=>[G(j(e.category),1)]),_:2},1024)):K(``,!0),(B(!0),V(z,null,L(e.labels??[],e=>(B(),H(N(QT),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))])):K(``,!0)]),_:2},1032,[`class`,`data-peek`,`aria-current`,`onClick`])]),empty:P(()=>[...n[5]||=[G(`沒有未處理或已排入的待辦。`,-1)]]),_:1},8,[`view`,`axis`])])])]),_:1}))}}),XR=[`title`],ZR={key:1,class:`shrink-0 text-xs text-muted-foreground`},QR=I({__name:`SessionList`,setup(e){let t=[`active`,`paused`,`handed-off`,`ended`],n=e=>e.actions.find(e=>e.status===`doing`)??e.actions.find(e=>e.status===`todo`),r=e=>[...new Set(e.actions.flatMap(e=>e.serves.map(e=>e.slice(0,4))))],i=e=>e?`${e} ${Q.summary?.mainlines.find(t=>t.id===e)?.title??``}`.trim():`沒有服務的主脈絡`,a=e=>Math.max(...[e.started,...e.actions.flatMap(e=>[e.startedAt,e.doneAt])].filter(e=>!!e).map(iE)),o=e=>Q.sessions.filter(t=>t.delegatedFrom===e).sort((e,t)=>iE(e.started)-iE(t.started)),s=(e,t=1)=>o(e.id).flatMap(e=>[{item:e,depth:t},...s(e,t+1)]),c=J(()=>{let e=new Set(Q.sessions.map(e=>e.id));return Q.sessions.filter(t=>!t.delegatedFrom||!e.has(t.delegatedFrom))}),l=CN({key:`sessions`,id:e=>e.id,text:e=>`${Dw(e)} ${e.branch??``}`,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:dN(t)},{key:`agent`,label:`agent`,values:e=>[e.agent]},{key:`branch`,label:`分支`,values:e=>e.branch?[e.branch]:[]},{key:`mainline`,label:`主脈絡`,values:r,optionLabel:i}],sorts:[{key:`name`,label:`名稱`,value:e=>Dw(e),dir:`asc`},{key:`serves`,label:`服務的任務`,value:e=>p(e),dir:`asc`},{key:`subagents`,label:`子代理數`,value:e=>o(e.id).length,dir:`desc`},{key:`started`,label:`開始時間`,value:e=>iE(e.started),dir:`desc`},{key:`active`,label:`最後活動`,value:a,dir:`desc`}],groups:[hN(t),{key:`mainline`,label:`主脈絡`,value:e=>r(e)[0]??``,groupLabel:i},{key:`day`,label:`日期`,value:e=>oE(e.started),latestFirst:!0}],defaultSort:`started`,defaultGroup:`status`,ended:e=>fN(e.status),archived:e=>!!e.archivedAt,nested:e=>s(e)},()=>c.value),u=xF(l,{kind:`session`,archived:e=>!!e.archivedAt}),d=[{key:`name`,label:`會話`,sort:`name`},{key:`serves`,label:`服務的任務`,class:`max-w-56`,sort:`serves`,value:e=>p(e),optional:!0},{key:`subagents`,label:`子代理`,class:`text-xs text-muted-foreground tabular-nums`,sort:`subagents`,value:e=>o(e.id).length||void 0,optional:!0},{key:`started`,label:`開始`,class:`text-xs text-muted-foreground`,sort:`started`}],{open:f}=FC();Er(()=>Pw(Q.sessions.flatMap(e=>e.actions.flatMap(e=>e.serves))));let p=e=>(n(e)??e.actions[0])?.serves[0]?.split(`#`)[0],m=e=>dw(()=>XC.archiveSession(e.id,!e.archivedAt));return(e,t)=>(B(),H(bF,null,{header:P(()=>[W(yD,{title:`會話`,description:`推進過 hub 的 AI 會話,含同步程式從其他環境帶來的會話。存在 .mainflow/local/sessions/,不入版控。`}),W(oD,{view:N(l)},null,8,[`view`])]),default:P(()=>[W(XE,{view:N(l),selection:N(u),columns:d,"item-ref":e=>N(TC)(e.id)},{name:P(({item:e,depth:t})=>[W(hD,{status:e.status,title:N(Dw)(e),muted:t>0||!!e.archivedAt,depth:t},{default:P(()=>[e.elsewhere?(B(),V(`span`,{key:0,class:`shrink-0 text-xs text-muted-foreground`,title:`工作目錄 ${e.cwd} 不在這台電腦上`,"data-elsewhere":``},`其他環境`,8,XR)):K(``,!0),e.archivedAt?(B(),V(`span`,ZR,`已封存`)):K(``,!0)]),_:2},1032,[`status`,`title`,`muted`,`depth`])]),serves:P(({item:e})=>[p(e)?(B(),H(Yj,q({key:0},N(Mw)(p(e)),{onOpen:N(f)}),null,16,[`onOpen`])):K(``,!0)]),subagents:P(({item:e,depth:t})=>[G(j(t===0&&o(e.id).length?o(e.id).length:``),1)]),started:P(({item:e})=>[W(xP,{at:e.started},null,8,[`at`])]),actions:P(({item:e})=>[W(eE,{archived:!!e.archivedAt,onToggle:t=>m(e)},null,8,[`archived`,`onToggle`])]),empty:P(()=>[...t[0]||=[G(`沒有會話資料。會話存在 `,-1),U(`code`,null,`.mainflow/local/sessions/`,-1),G(`,不入版控;有同步時,其他環境的會話也會出現在這裡。`,-1)]]),_:1},8,[`view`,`selection`,`item-ref`]),W(fD,{selection:N(u)},null,8,[`selection`])]),_:1}))}}),$R={class:`flex min-w-0 items-center gap-2`},ez={key:0,class:`size-1.5 shrink-0 rounded-full bg-warning`,title:`新提醒`},tz=[`title`],nz=[`title`],rz=[`title`],iz=I({__name:`SyncNotices`,setup(e){let t=CN({key:`sync`,id:e=>`${e.at}|${e.kind}|${e.path}`,text:e=>`${zC(e)} ${e.path} ${e.message}`,filters:[{key:`kind`,label:`種類`,values:e=>[e.kind],options:Object.entries(IC).map(([e,t])=>({value:e,label:t}))},{key:`path`,label:`檔案`,values:e=>e.path?[e.path]:[]}],sorts:[{key:`at`,label:`時間`,value:e=>e.at,dir:`desc`},{key:`kind`,label:`種類`,value:e=>e.kind,dir:`asc`},{key:`path`,label:`檔案`,value:e=>e.path,dir:`asc`}],groups:[{key:`day`,label:`日期`,value:e=>e.at.slice(0,10),latestFirst:!0}],defaultSort:`at`,defaultGroup:`day`},()=>Q.sync.notices),n=[{key:`message`,label:`提醒`},{key:`kind`,label:`種類`,class:`text-xs`},{key:`path`,label:`檔案`,class:`max-w-72 truncate font-mono text-xs text-muted-foreground`,value:e=>e.path,optional:!0},{key:`at`,label:`時間`,class:`font-mono text-xs text-muted-foreground tabular-nums`}],r=e=>new Date(e).toLocaleString(`sv-SE`).slice(5);return $i(async()=>{await _w(),gw()}),(e,i)=>(B(),H(bF,null,{header:P(()=>[W(yD,{title:`同步提醒`,description:`同步程式找到的、寫入者的內容可能沒有照原樣進入 hub 的改動。被拒的內容存在 .mainflow/local/sync/conflicts/,點開可以和 hub 的版本並排比對。`}),W(oD,{view:N(t)},null,8,[`view`])]),default:P(()=>[W(XE,{view:N(t),columns:n,"item-ref":e=>e.saved?N(DC)(e.saved):void 0},{message:P(({item:e})=>[U(`span`,$R,[N(mw)(e)?K(``,!0):(B(),V(`span`,ez)),e.saved?(B(),H(N(pd),{key:1,class:`size-3.5 shrink-0 text-muted-foreground`,"aria-label":`有存檔,可並排比對`})):K(``,!0),U(`span`,{class:`truncate`,title:`原文:${e.message}`},j(N(zC)(e,!1)),9,tz)])]),kind:P(({item:e})=>[G(j(N(IC)[e.kind]??e.kind),1)]),path:P(({item:e})=>[U(`span`,{title:e.path},j(e.path),9,nz)]),at:P(({item:e})=>[U(`span`,{title:e.at},j(r(e.at)),9,rz)]),empty:P(()=>[N(Q).sync.remote?(B(),V(z,{key:0},[G(`沒有提醒。同步程式只在寫入者的內容可能遺失時提醒,只多了別人改動的合併不列在這裡。`)],64)):(B(),V(z,{key:1},[i[0]||=G(`這個 hub 沒有設定同步伺服器。設定方式見 mainflow 的 `,-1),i[1]||=U(`code`,null,`docs/sync.md`,-1),i[2]||=G(`。`,-1)],64))]),_:1},8,[`view`,`item-ref`])]),_:1}))}}),az=e=>Array.isArray(e)?e.join(`/`):e??``,oz=Rm({history:om(WC),routes:[{path:`/`,component:YR},{path:`/mainlines`,component:RI},{path:`/mainlines/:m`,component:II},{path:`/issues`,component:NF},{path:`/findings`,component:wF},{path:`/ops`,component:HI},{path:`/sessions`,component:QR},{path:`/sync`,component:iz},{path:`/mainlines/:m/tasks/:t`,redirect:e=>({path:`/mainlines/${az(e.params.m)}`,query:{view:`tasks`,peek:CC(az(e.params.m),az(e.params.t))}})},{path:`/mainlines/:m/decisions/:d`,redirect:e=>({path:`/mainlines/${az(e.params.m)}`,query:{view:`decisions`,peek:wC(az(e.params.m),az(e.params.d))}})},{path:`/mainlines/:m/files/:path(.*)`,redirect:e=>({path:`/mainlines/${az(e.params.m)}`,query:{peek:EC(az(e.params.m),az(e.params.path))}})},{path:`/sessions/:s`,redirect:e=>({path:`/sessions`,query:{peek:TC(az(e.params.s))}})}]}),sz=hu(ZT);sz.config.errorHandler=yw,sz.use(oz).mount(`#app`);
|
|
75
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${tj(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?tj(n,!0):this.parser.parseInline(r),o=rj(e);if(o===null)return a;e=tj(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+tj(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=rj(e);if(i===null)return tj(n);e=i;let a=`<img src="${tj(e)}" alt="${tj(n)}"`;return t&&(a+=` title="${tj(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:tj(e.text)}},gj=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},_j=class e{options;renderer;textRenderer;constructor(e){this.options=e||jk,this.options.renderer=this.options.renderer||new hj,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new gj}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},vj=class{options;block;constructor(e){this.options=e||jk}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?mj.lex:mj.lexInline}provideParser(e=this.block){return e?_j.parse:_j.parseInline}},yj=new class{defaults=Ak();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=_j;Renderer=hj;TextRenderer=gj;Lexer=mj;Tokenizer=pj;Hooks=vj;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new hj(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new pj(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new vj;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=vj.passThroughHooks.has(n)?e=>{if(this.defaults.async&&vj.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return mj.lex(e,t??this.defaults)}parser(e,t){return _j.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?mj.lex:mj.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?_j.parse:_j.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?mj.lex:mj.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?_j.parse:_j.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
76
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+tj(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function bj(e,t){return yj.parse(e,t)}bj.options=bj.setOptions=function(e){return yj.setOptions(e),bj.defaults=yj.defaults,Mk(bj.defaults),bj},bj.getDefaults=Ak,bj.defaults=jk;function xj(...e){return yj.use(...e),bj.defaults=yj.defaults,Mk(bj.defaults),bj}bj.use=xj,bj.walkTokens=function(e,t){return yj.walkTokens(e,t)},bj.parseInline=yj.parseInline,bj.Parser=_j,bj.parser=_j.parse,bj.Renderer=hj,bj.TextRenderer=gj,bj.Lexer=mj,bj.lexer=mj.lex,bj.Tokenizer=pj,bj.Hooks=vj,bj.parse=bj,bj.options,bj.setOptions,bj.walkTokens,bj.parseInline,_j.parse,mj.lex;var Sj=[`innerHTML`],Cj=I({__name:`MarkdownView`,props:{source:{}},setup(e){let t=e,n=J(()=>kk.sanitize(bj.parse(t.source,{async:!1})));return(e,t)=>(B(),V(`div`,{class:`prose`,innerHTML:n.value},null,8,Sj))}}),wj={key:0,class:`shrink-0 text-xs text-muted-foreground`},Tj={key:1,class:`shrink-0 font-mono text-xs text-muted-foreground`},Ej={class:`truncate`},Dj={class:`ml-auto shrink-0 text-xs text-muted-foreground`},Oj=I({__name:`RelatedLink`,props:{peek:{},id:{},title:{},status:{},label:{}},setup(e){let{to:t}=FC();return(n,r)=>(B(),H(N(Am),{to:N(t)(e.peek,{chain:!0}),class:`-mx-2 flex h-8 min-w-0 items-center gap-2 rounded-md px-2 transition-colors duration-[120ms] hover:bg-accent/50`},{default:P(()=>[e.label?(B(),V(`span`,wj,j(e.label),1)):K(``,!0),W(nT,{type:N(Vw)(e.peek),status:e.status},null,8,[`type`,`status`]),e.id?(B(),V(`span`,Tj,j(e.id),1)):K(``,!0),U(`span`,Ej,j(e.title??``),1),U(`span`,Dj,[R(n.$slots,`default`)])]),_:3},8,[`to`]))}}),kj=[`href`,`title`],Aj={key:0,class:`w-12 shrink-0 text-xs text-muted-foreground`},jj={class:`shrink-0 font-mono text-xs text-muted-foreground`},Mj={key:1,class:`truncate`},Nj={key:2,class:`truncate text-xs text-muted-foreground`},Pj={class:`ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground`},Fj=I({__name:`RemoteLink`,props:{id:{},title:{},status:{},label:{},context:{},note:{}},setup(e){return(t,n)=>(B(),V(`a`,{href:N(kC)(e.id)??void 0,target:`_blank`,rel:`noopener`,title:[e.context,e.note].filter(Boolean).join(`
|
|
77
|
+
`),class:`-mx-2 flex h-8 min-w-0 items-center gap-2 rounded-md px-2 transition-colors duration-[120ms] hover:bg-accent/50`},[e.label?(B(),V(`span`,Aj,j(e.label),1)):K(``,!0),W(nT,{type:N(Vw)(e.id),status:e.status},null,8,[`type`,`status`]),U(`span`,jj,j(e.id),1),e.title?(B(),V(`span`,Mj,j(e.title),1)):(B(),V(`span`,Nj,j(e.context),1)),U(`span`,Pj,[R(t.$slots,`default`),W(N(dd),{class:`size-3.5`})])],8,kj))}}),Ij={class:`flex items-center gap-2`},Lj=[`title`],Rj=I({__name:`LinksSection`,props:{self:{},links:{},mainline:{type:Boolean}},setup(e){let t=e,n={"depends-on":{out:`依賴`,in:`被依賴`},relates:{out:`相關`,in:`相關`},"split-from":{out:`拆自`,in:`拆出`}},r=e=>e.map(e=>`${e.from} → ${e.to}`).join(`
|
|
78
|
+
`),i=J(()=>{let e=Q.relations,n=t.mainline?e.mainlineDeps.map(e=>({from:e.from,to:e.to,state:e.state,note:r(e.edges)})):e.deps.filter(e=>e.from===t.self||e.to===t.self).map(e=>({from:e.from,to:e.to,state:e.state,note:e.note}));return[...n.filter(e=>e.from===t.self).map((e,t)=>({key:`dep-out-${t}`,ref:e.to,label:`依賴`,note:e.note,dep:e.state,...Iw(e.to)})),...n.filter(e=>e.to===t.self).map((e,t)=>({key:`dep-in-${t}`,ref:e.from,label:`被依賴`,note:e.note,dep:e.state,...Iw(e.from)}))]}),a=J(()=>[...i.value,...(t.links??[]).filter(e=>e.rel!==`depends-on`).map((e,t)=>({key:`out-${t}`,ref:e.to,label:n[e.rel]?.out??e.rel,note:e.note,...Iw(e.to)})),...(Q.relations.backlinks[t.self]??[]).filter(e=>e.rel!==`depends-on`).map((e,t)=>{let r=OC(e.from)?Iw(e.from):{...Iw(e.from),...e.title?{title:e.title,status:e.status}:{}};return{key:`in-${t}`,ref:e.from,label:n[e.rel]?.in??e.rel,note:e.note,...r}})]);return Er(()=>Rw(a.value.map(e=>e.ref))),(e,t)=>a.value.length?(B(),H(ID,{key:0,title:`關聯`,count:a.value.length},{default:P(()=>[(B(!0),V(z,null,L(a.value,e=>(B(),V(z,{key:e.key},[N(OC)(e.ref)?(B(),H(Fj,{key:0,id:e.ref,title:e.title,status:e.status,label:e.label,context:e.context,note:e.note},{default:P(()=>[e.dep?(B(),V(`span`,{key:0,class:k(N(eT)[e.dep].tone)},j(N(eT)[e.dep].label),3)):K(``,!0)]),_:2},1032,[`id`,`title`,`status`,`label`,`context`,`note`])):(B(),H(Oj,{key:1,peek:e.ref.split(`#`)[0],id:e.ref,title:e.title,status:e.status,label:e.label},{default:P(()=>[U(`span`,Ij,[e.note?(B(),V(`span`,{key:0,class:`block max-w-48 truncate`,title:e.note},j(e.note.split(`
|
|
79
|
+
`)[0]),9,Lj)):K(``,!0),e.dep?(B(),V(`span`,{key:1,class:k(N(eT)[e.dep].tone)},j(N(eT)[e.dep].label),3)):K(``,!0)])]),_:2},1032,[`peek`,`id`,`title`,`status`,`label`]))],64))),128))]),_:1},8,[`count`])):K(``,!0)}}),zj={class:`flex flex-col`},Bj=[`href`,`title`],Vj={key:3,class:`truncate`},Hj={key:5,class:`ml-auto shrink-0 text-xs text-muted-foreground`},Uj=I({__name:`RefSources`,props:{refs:{}},setup(e){return(t,n)=>(B(),V(`ul`,zj,[(B(!0),V(z,null,L(e.refs,e=>(B(),V(`li`,{key:e.title+(e.url??e.path),class:`-mx-2 flex min-h-8 min-w-0 items-center gap-2 rounded-md px-2 transition-colors hover:bg-accent/50`},[e.url?(B(),H(N(dd),{key:0,class:`size-3.5 shrink-0 text-muted-foreground`})):(B(),H(N(gd),{key:1,class:`size-3.5 shrink-0 text-muted-foreground`})),e.url?(B(),V(`a`,{key:2,href:e.url,target:`_blank`,rel:`noreferrer`,class:`truncate underline decoration-border underline-offset-4 hover:decoration-foreground`,title:e.url},j(e.title),9,Bj)):(B(),V(`span`,Vj,j(e.title),1)),e.path?(B(),H(DD,{key:4,text:e.path,class:`min-w-0`},null,8,[`text`])):K(``,!0),e.date?(B(),V(`span`,Hj,j(e.date),1)):K(``,!0)]))),128))]))}}),Wj=I({__name:`HoverCard`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},openDelay:{},closeDelay:{},enableTouch:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=F_(e,t);return(e,t)=>(B(),H(N(qS),q({"data-slot":`hover-card`},N(n)),{default:P(t=>[R(e.$slots,`default`,A(Cs(t)))]),_:3},16))}}),Gj=I({inheritAttrs:!1,__name:`HoverCardContent`,props:{forceMount:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=P_(Sf(t,`class`));return(e,r)=>(B(),H(N(QS),null,{default:P(()=>[W(N(ZS),q({"data-slot":`hover-card-content`},{...e.$attrs,...N(n)},{class:N(gg)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 rounded-md border p-4 shadow-md outline-hidden`,t.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),Kj=I({__name:`HoverCardTrigger`,props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),H(N($S),q({"data-slot":`hover-card-trigger`},t),{default:P(()=>[R(e.$slots,`default`)]),_:3},16))}}),qj={class:`shrink-0 font-mono text-[11px] text-muted-foreground`},Jj={key:0,class:`truncate`},Yj={class:`font-mono text-xs text-muted-foreground`},Xj={key:0,class:`mt-1 font-semibold`},Zj={class:`mt-2 flex items-center gap-2`},Qj={key:1,class:`text-xs text-muted-foreground`},$j=I({__name:`RefLabel`,props:{id:{},title:{},status:{},context:{}},emits:[`open`],setup(e,{emit:t}){let n=t;return(t,r)=>(B(),H(N(Wj),{"open-delay":300,"close-delay":100},{default:P(()=>[W(N(Kj),{"as-child":``},{default:P(()=>[U(`button`,{type:`button`,class:`inline-flex h-6 max-w-full min-w-0 items-center gap-1.5 overflow-hidden rounded-md border bg-background px-2 text-xs transition-colors hover:bg-accent`,onClick:r[0]||=au(t=>n(`open`,e.id),[`stop`])},[W(nT,{type:N(Vw)(e.id),status:e.status},null,8,[`type`,`status`]),U(`span`,qj,j(e.id),1),e.title?(B(),V(`span`,Jj,j(e.title),1)):K(``,!0)])]),_:1}),W(N(Gj),{class:`w-64`},{default:P(()=>[U(`p`,Yj,j(e.id),1),e.title?(B(),V(`p`,Xj,j(e.title),1)):K(``,!0),U(`div`,Zj,[e.status?(B(),H(kE,{key:0,status:e.status},null,8,[`status`])):K(``,!0),e.context?(B(),V(`span`,Qj,j(e.context),1)):K(``,!0)])]),_:1})]),_:1}))}});function eM(e){let t=tp(),n=J(()=>e?.()??String(t.params.m??``));return F(n,e=>{e&&lw(e).catch(e=>Q.error=e.message)},{immediate:!0}),{id:n,mainline:J(()=>Q.mainlines[n.value])}}var tM={key:0,class:`pb-8`},nM={key:0},rM={key:1},iM={key:2,class:`tabular-nums`},aM={key:0,class:`text-xs`},oM={class:`text-xs`},sM={class:`text-xs`},cM={key:1,class:`text-sm text-muted-foreground`},lM={key:1,class:`px-5 text-muted-foreground`},uM=I({__name:`DecisionPeek`,props:{m:{},d:{}},setup(e){let t=e,{open:n}=FC(),{mainline:r}=eM(()=>t.m),i=J(()=>r.value?.decisions.find(e=>e.id===t.d)),a=J(()=>r.value?.decisions.find(e=>e.id===i.value?.supersededBy)),o=J(()=>r.value?.decisions.filter(e=>e.supersededBy===t.d)??[]),s=e=>n(e,{chain:!0}),c=e=>Iw(e.split(`#`)[0]);return(n,l)=>i.value&&N(r)?(B(),V(`div`,tM,[W(MD,{id:`${e.m}/${i.value.id}`,title:i.value.title,type:`decision`,status:i.value.status},{notice:P(()=>[i.value.status===`proposed`?(B(),H(N(_g),{key:0,variant:`warning`},{default:P(()=>[W(N(Qu)),W(N(yg),null,{default:P(()=>[...l[0]||=[G(`還沒裁決`,-1)]]),_:1}),i.value.affects?.length?(B(),H(N(vg),{key:0,class:`text-xs text-muted-foreground`},{default:P(()=>[...l[1]||=[G(`在等它的項目列在「影響的項目」。`,-1)]]),_:1})):K(``,!0)]),_:1})):K(``,!0),a.value?(B(),H(N(_g),{key:1},{default:P(()=>[W(N(qd)),W(N(yg),null,{default:P(()=>[G(`已被 `+j(a.value.id)+` 取代`,1)]),_:1}),W(N(vg),{class:`text-xs text-muted-foreground`},{default:P(()=>[...l[2]||=[G(`以下保留當時的理由。新的決定見「取代關係」。`,-1)]]),_:1})]),_:1})):K(``,!0)]),default:P(()=>[W(kE,{status:i.value.status},null,8,[`status`]),i.value.by?(B(),V(`span`,nM,j(N(Zw)[i.value.by])+`決定`,1)):K(``,!0),i.value.basis?(B(),V(`span`,rM,j(N(Qw)[i.value.basis]),1)):K(``,!0),i.value.decidedAt?(B(),V(`span`,iM,j(N(fE)(i.value.decidedAt)),1)):K(``,!0)]),_:1},8,[`id`,`title`,`status`]),W(ID,null,{default:P(()=>[W(QD,{columns:1},{default:P(()=>[i.value.reversible===void 0?K(``,!0):(B(),H($,{key:0,label:`能否改回`,icon:N(sf)},{default:P(()=>[G(j(i.value.reversible?`可以低成本改回`:`不易改回`),1)]),_:1},8,[`icon`])),i.value.priority?(B(),H($,{key:1,label:`優先度`,icon:N(_d)},{default:P(()=>[W(TE,{priority:i.value.priority},null,8,[`priority`]),i.value.priority===`P2`?(B(),V(`span`,aM,`P2`)):K(``,!0)]),_:1},8,[`icon`])):K(``,!0),i.value.category?(B(),H($,{key:2,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(i.value.category),1)]),_:1},8,[`icon`])):K(``,!0),i.value.labels?.length?(B(),H($,{key:3,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(i.value.labels,e=>(B(),H(N(nE),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,oM,j(N(fE)(i.value.created)),1)]),_:1},8,[`icon`]),i.value.closedAt?(B(),H($,{key:4,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,sM,j(N(fE)(i.value.closedAt)),1)]),_:1},8,[`icon`])):K(``,!0),i.value.resolution?(B(),H($,{key:5,label:`結果`,icon:N($u)},{default:P(()=>[G(j(i.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),i.value.origin?(B(),H($,{key:6,label:`來源`,icon:N(cd)},{default:P(()=>[W($j,q(N(Iw)(i.value.origin),{onOpen:s}),null,16)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),i.value.body.trim()?(B(),H(ID,{key:0,title:`內文`},{default:P(()=>[W(Cj,{source:i.value.body},null,8,[`source`])]),_:1})):K(``,!0),i.value.affects?.length?(B(),H(ID,{key:1,title:`影響的項目`,count:i.value.affects.length},{default:P(()=>[(B(!0),V(z,null,L(i.value.affects,e=>(B(),H(Oj,q({key:e,peek:e.split(`#`)[0]},{ref_for:!0},c(e),{id:e}),{default:P(()=>[G(j(e.includes(`#`)?`checklist 項目`:``),1)]),_:2},1040,[`peek`,`id`]))),128))]),_:1},8,[`count`])):K(``,!0),W(Rj,{self:N(wC)(t.m,t.d),links:i.value.links},null,8,[`self`,`links`]),i.value.refs?.length?(B(),H(ID,{key:2,title:`參考來源`,count:i.value.refs.length},{default:P(()=>[W(Uj,{refs:i.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0),W(ID,{title:`取代關係`},{default:P(()=>[a.value?(B(),H(Oj,{key:0,peek:N(wC)(e.m,a.value.id),label:`被取代為`,id:a.value.id,title:a.value.title,status:a.value.status},null,8,[`peek`,`id`,`title`,`status`])):K(``,!0),(B(!0),V(z,null,L(o.value,t=>(B(),H(Oj,{key:t.id,peek:N(wC)(e.m,t.id),label:`取代了`,id:t.id,title:t.title,status:t.status},null,8,[`peek`,`id`,`title`,`status`]))),128)),!a.value&&o.value.length===0?(B(),V(`p`,cM,`沒有取代關係。`)):K(``,!0)]),_:1})])):(B(),V(`p`,lM,`載入 `+j(e.m)+`/`+j(e.d)+`…`,1))}}),dM=`modulepreload`,fM=function(e){return`/`+e},pM={},mM=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),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?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=fM(t,n),t=s(t),t in pM)return;pM[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:dM,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).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)})},hM=`__mainflowVue`;function gM(e){return e.replace(/import\s*\{([^}]*)\}\s*from\s*['"]vue['"];?/g,(e,t)=>`const { ${t.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>e.replace(/\s+as\s+/,`: `)).join(`, `)} } = globalThis.${hM};`)}async function _M(e){let t=URL.createObjectURL(new Blob([gM(e)],{type:`text/javascript`}));try{return await mM(()=>import(t),[])}finally{URL.revokeObjectURL(t)}}async function vM(e,t){globalThis[hM]=xu;let{parse:n,compileScript:r,compileTemplate:i}=await mM(async()=>{let{parse:e,compileScript:t,compileTemplate:n}=await import(`./index.browser-C_4gp6WJ.js`);return{parse:e,compileScript:t,compileTemplate:n}},[]),{descriptor:a,errors:o}=n(e,{filename:t});if(o.length)throw Error(o.map(e=>e.message).join(`; `));for(let e of[a.script,a.scriptSetup])if(e?.lang&&e.lang!==`js`)throw Error(`<script lang="${e.lang}"> is not supported here; write the view in plain JavaScript`);if(a.styles.some(e=>e.scoped))throw Error(`<style scoped> is not supported here; use an unscoped <style> with a class prefix`);let s=`mf-${Math.abs([...t].reduce((e,t)=>e*31+t.charCodeAt(0)|0,7)).toString(36)}`,c={};if((a.script||a.scriptSetup)&&(c={...(await _M(r(a,{id:s,inlineTemplate:!0}).content)).default}),!a.scriptSetup&&a.template){let e=i({source:a.template.content,filename:t,id:s});if(e.errors.length)throw Error(e.errors.map(String).join(`; `));c.render=(await _M(e.code)).render}let l=a.styles.map(e=>e.content).join(`
|
|
80
|
+
`);if(l){let e=document.querySelector(`style[data-mainflow-view="${s}"]`);e||(e=document.createElement(`style`),e.dataset.mainflowView=s,document.head.append(e)),e.textContent=l}return c}var yM={key:0,class:`mb-2 text-sm`},bM=[`src`,`title`],xM=[`src`,`alt`],SM={key:6,class:`overflow-auto rounded-lg border bg-muted/50 p-3 font-mono text-xs leading-relaxed`},CM=I({__name:`CustomContent`,props:{path:{},ctx:{}},setup(e){let t=e,n=[`png`,`jpg`,`jpeg`,`gif`,`svg`,`webp`],r=e=>e.slice(e.lastIndexOf(`.`)+1).toLowerCase(),i=M(``),a=M(``),o=M(null),s=pn(null),c;async function l(){a.value=``,c?.(),c=void 0,s.value=null;let e=r(t.path);try{if(e===`vue`)s.value=await vM(await(await fetch(ZC(t.path))).text(),t.path);else if(e===`js`||e===`mjs`){let e=await mM(()=>import(ZC(t.path)),[]);if(!e.mount)throw Error(`the module must export mount(el, ctx)`);o.value&&(c=e.mount(o.value,t.ctx)??void 0)}else e!==`html`&&!n.includes(e)&&(i.value=await(await fetch(ZC(t.path))).text())}catch(e){a.value=e.message}}return F(()=>[t.path,t.ctx],()=>void l(),{immediate:!0,flush:`post`}),na(()=>c?.()),(t,c)=>(B(),V(`div`,null,[a.value?(B(),V(`p`,yM,`無法渲染 `+j(e.path)+`:`+j(a.value),1)):K(``,!0),r(e.path)===`md`?(B(),H(Cj,{key:1,source:i.value},null,8,[`source`])):r(e.path)===`html`?(B(),V(`iframe`,{key:2,src:N(ZC)(e.path),sandbox:`allow-scripts allow-same-origin`,class:`h-[480px] w-full rounded-lg border bg-white`,title:e.path},null,8,bM)):n.includes(r(e.path))?(B(),V(`img`,{key:3,src:N(ZC)(e.path),alt:e.path,class:`max-w-full rounded-lg border`},null,8,xM)):r(e.path)===`js`||r(e.path)===`mjs`?(B(),V(`div`,{key:4,ref_key:`mountPoint`,ref:o},null,512)):r(e.path)===`vue`&&s.value?(B(),H(fa(s.value),{key:5,ctx:e.ctx},null,8,[`ctx`])):r(e.path)===`vue`?K(``,!0):(B(),V(`pre`,SM,j(i.value),1))]))}}),wM=[`主脈絡文件`,`任務文件`,`產物`,`決策`,`自訂視圖`,`參考來源`],TM=e=>e.slice(e.lastIndexOf(`/`)+1),EM=e=>TM(e).includes(`.`)?TM(e).slice(TM(e).lastIndexOf(`.`)+1).toLowerCase():``;function DM(e){let t=t=>t.slice(e.dir.length+1),n=(e,n,r,i)=>({key:e,name:TM(e),kind:n,ext:EM(e),source:r,inMainline:t(e),updated:i}),r=(t,n)=>(t??[]).map(t=>({key:`${n??e.id}:${t.url??t.path}`,name:t.title,kind:`參考來源`,ext:t.url?``:EM(t.path??``),source:n,url:t.url,path:t.path,updated:t.date}));return[n(e.file,`主脈絡文件`,void 0,e.updated),...e.artifacts.map(e=>n(e,`產物`)),...e.tasks.flatMap(e=>[n(e.file,`任務文件`,e.id,e.updated),...e.artifacts.map(t=>n(t,`產物`,e.id))]),...e.decisions.map(e=>n(e.file,`決策`,e.id,e.updated)),...e.views.map(e=>n(e,`自訂視圖`)),...(e.remoteFiles??[]).map(t=>({...n(t,`產物`,e.tasks.find(e=>t.startsWith(`${e.dir}/`))?.id),remoteOnly:!0})),...r(e.refs),...e.tasks.flatMap(e=>r(e.refs,e.id))]}var OM=(e,t)=>e.remoteFiles?.includes(t)??!1;function kM(e,t){return DM(e).find(e=>e.key===t)?.kind??``}var AM={key:0,class:`pb-8`},jM={key:0},MM=[`title`],NM=[`href`],PM={key:0,class:`text-sm text-muted-foreground`},FM={key:1,class:`space-y-2 text-sm`},IM={key:1,class:`px-5 text-muted-foreground`},LM=I({__name:`FilePeek`,props:{m:{},path:{}},setup(e){let t=e,{mainline:n}=eM(()=>t.m),r=J(()=>n.value?`${n.value.dir}/${t.path}`:``),i=J(()=>n.value?.tasks.find(e=>r.value.startsWith(`${e.dir}/`))),a=J(()=>n.value?.decisions.find(e=>e.file===r.value)),o=J(()=>n.value?kM(n.value,r.value):``),s=J(()=>({mainline:n.value,task:i.value})),c=J(()=>!!n.value&&OM(n.value,r.value)),l=M(`idle`),u=M(``),d=J(()=>c.value&&l.value!==`done`);async function f(){l.value=`loading`,u.value=``;try{let e=await XC.fetchRemote(t.m,r.value);l.value=e.fetched?`done`:`failed`,u.value=e.error??``}catch(e){l.value=`failed`,u.value=e.message}}F([r,c],()=>{c.value&&(l.value=`idle`,f())},{immediate:!0});let p=J(()=>t.path.slice(t.path.lastIndexOf(`/`)+1));return(t,c)=>N(n)?(B(),V(`div`,AM,[W(MD,{title:p.value,mono:``,type:N(Uw)(e.path,o.value||void 0)},{default:P(()=>[U(`span`,null,j(o.value),1),d.value?(B(),V(`span`,jM,`只在伺服器上`)):K(``,!0),U(`span`,{class:`truncate font-mono`,title:e.path},j(e.path),9,MM),d.value?K(``,!0):(B(),H(N(sC),{key:1,variant:`ghost`,size:`xs`,class:`ml-auto text-muted-foreground`,"as-child":``},{default:P(()=>[U(`a`,{href:N(ZC)(r.value),target:`_blank`},[W(N(ef)),c[0]||=G(`原始檔`,-1)],8,NM)]),_:1}))]),_:1},8,[`title`,`type`]),W(ID,null,{default:P(()=>[d.value&&l.value!==`failed`?(B(),V(`p`,PM,`這個檔案只在同步伺服器上,正在下載…`)):d.value?(B(),V(`div`,FM,[U(`p`,null,`無法下載這個檔案:`+j(u.value),1),W(N(sC),{variant:`outline`,size:`xs`,onClick:f},{default:P(()=>[...c[1]||=[G(`重試`,-1)]]),_:1})])):(B(),H(CM,{key:2,path:r.value,ctx:s.value},null,8,[`path`,`ctx`]))]),_:1}),W(ID,{title:`所屬`},{default:P(()=>[a.value?(B(),H(Oj,{key:0,peek:N(wC)(e.m,a.value.id),id:a.value.id,title:a.value.title,status:a.value.status},null,8,[`peek`,`id`,`title`,`status`])):i.value?(B(),H(Oj,{key:1,peek:N(CC)(e.m,i.value.id),id:i.value.id,title:i.value.title,status:i.value.status},null,8,[`peek`,`id`,`title`,`status`])):K(``,!0),W(Oj,{peek:e.m,id:e.m,title:N(n).title,status:N(n).status},null,8,[`peek`,`id`,`title`,`status`])]),_:1})])):(B(),V(`p`,IM,`載入 `+j(e.m)+`…`,1))}}),RM={key:0,class:`pb-8`},zM={class:`text-xs`},BM={class:`text-xs`},VM={class:`text-xs`},HM={key:1,class:`px-5 text-muted-foreground`},UM=I({__name:`FindingPeek`,props:{id:{}},setup(e){let t=e,{open:n}=FC(),r=J(()=>Q.findings.find(e=>e.id===t.id)),i=()=>r.value&&dw(()=>XC.archiveFinding(r.value.id,!r.value.archivedAt,r.value.version));return Rw([r.value?.origin]),(a,o)=>r.value?(B(),V(`div`,RM,[W(MD,{id:r.value.id,title:r.value.title,type:`finding`,status:r.value.status},{default:P(()=>[W(kE,{status:r.value.status},null,8,[`status`]),W(iE,{archived:!!r.value.archivedAt,onToggle:i},null,8,[`archived`])]),_:1},8,[`id`,`title`,`status`]),W(ID,null,{default:P(()=>[W(QD,{columns:1},{default:P(()=>[r.value.appliesTo?.length?(B(),H($,{key:0,label:`適用範圍`,icon:N(bd)},{default:P(()=>[(B(!0),V(z,null,L(r.value.appliesTo,e=>(B(),H(DD,{key:e,text:e},null,8,[`text`]))),128))]),_:1},8,[`icon`])):K(``,!0),r.value.reviewAfter?(B(),H($,{key:1,label:`重新確認`,icon:N(qd)},{default:P(()=>[W(_E,{day:r.value.reviewAfter,ended:r.value.status===`obsolete`},null,8,[`day`,`ended`])]),_:1},8,[`icon`])):K(``,!0),r.value.origin?(B(),H($,{key:2,label:`來源`,icon:N(cd)},{default:P(()=>[W($j,q(N(Iw)(r.value.origin),{onOpen:o[0]||=e=>N(n)(e,{chain:!0})}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.category?(B(),H($,{key:3,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(r.value.category),1)]),_:1},8,[`icon`])):K(``,!0),r.value.labels?.length?(B(),H($,{key:4,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(r.value.labels,e=>(B(),H(N(nE),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,zM,j(r.value.created),1)]),_:1},8,[`icon`]),r.value.closedAt?(B(),H($,{key:5,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,BM,j(r.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),r.value.resolution?(B(),H($,{key:6,label:`結果`,icon:N($u)},{default:P(()=>[G(j(r.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),r.value.archivedAt?(B(),H($,{key:7,label:`封存`,icon:N(Pu)},{default:P(()=>[U(`span`,VM,j(r.value.archivedAt),1)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),r.value.body.trim()?(B(),H(ID,{key:0,title:`內文`},{default:P(()=>[W(Cj,{source:r.value.body},null,8,[`source`])]),_:1})):K(``,!0),W(Rj,{self:t.id,links:r.value.links},null,8,[`self`,`links`]),r.value.refs?.length?(B(),H(ID,{key:1,title:`參考來源`,count:r.value.refs.length},{default:P(()=>[W(Uj,{refs:r.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0)])):(B(),V(`p`,HM,`找不到發現 `+j(e.id)+`。`,1))}}),WM=I({__name:`Dialog`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean},unmountOnHide:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=F_(e,t);return(e,t)=>(B(),H(N(gv),q({"data-slot":`dialog`},N(n)),{default:P(t=>[R(e.$slots,`default`,A(Cs(t)))]),_:3},16))}}),GM=I({__name:`DialogOverlay`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Sf(t,`class`);return(e,r)=>(B(),H(N(iy),q({"data-slot":`dialog-overlay`},N(n),{class:N(gg)(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80`,t.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`]))}}),KM=I({inheritAttrs:!1,__name:`DialogContent`,props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},showCloseButton:{type:Boolean,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(t,r)=>(B(),H(N(oy),null,{default:P(()=>[W(GM),W(N(ty),q({"data-slot":`dialog-content`},{...t.$attrs,...N(i)},{class:N(gg)(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg`,n.class)}),{default:P(()=>[R(t.$slots,`default`),e.showCloseButton?(B(),H(N(_v),{key:0,"data-slot":`dialog-close`,class:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`},{default:P(()=>[W(N(uf)),r[0]||=U(`span`,{class:`sr-only`},`Close`,-1)]),_:1})):K(``,!0)]),_:3},16,[`class`])]),_:3}))}}),qM=I({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=P_(Sf(t,`class`));return(e,r)=>(B(),H(N(ny),q({"data-slot":`dialog-description`},N(n),{class:N(gg)(`text-muted-foreground text-sm`,t.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`]))}}),JM=I({__name:`DialogFooter`,props:{class:{type:[Boolean,null,String,Object,Array]},showCloseButton:{type:Boolean,default:!1}},setup(e){let t=e;return(n,r)=>(B(),V(`div`,{"data-slot":`dialog-footer`,class:k(N(gg)(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,t.class))},[R(n.$slots,`default`),e.showCloseButton?(B(),H(N(_v),{key:0,"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`},{default:P(()=>[...r[0]||=[G(` Close `,-1)]]),_:1})]),_:1})):K(``,!0)],2))}}),YM=I({__name:`DialogHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`div`,{"data-slot":`dialog-header`,class:k(N(gg)(`flex flex-col gap-2 text-center sm:text-left`,t.class))},[R(e.$slots,`default`)],2))}}),XM=I({__name:`DialogTitle`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=P_(Sf(t,`class`));return(e,r)=>(B(),H(N(sy),q({"data-slot":`dialog-title`},N(n),{class:N(gg)(`text-lg leading-none font-semibold`,t.class)}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`]))}}),ZM={class:`break-words`},QM={key:2,class:`font-mono`},$M=I({__name:`EvidenceText`,props:{text:{}},setup(e){let t=e,{to:n}=FC(),r=/(\.mainflow\/mainlines\/(m\d{3})-[^/\s]+\/([^\s,、;))]+))|(\bm\d{3}\/[td]\d{3}(?:#c\d{3})?\b|\b[if]\d{3}\b)|(\b[0-9a-f]{7,40}\b)|([\w./-]+\.\w+:\d+(?:-\d+)?)/g,i=J(()=>{let e=[],n=0;for(let i of t.text.matchAll(r)){let r=i.index??0;r>n&&e.push({kind:`text`,value:t.text.slice(n,r)});let[a,o,s,c,l,u]=i;o&&!/[{}*]/.test(c)?e.push({kind:`file`,value:a,peek:EC(s,c)}):l?e.push({kind:`ref`,value:a,peek:l.split(`#`)[0]}):u&&/\d/.test(u)&&/[a-f]/.test(u)?e.push({kind:`commit`,value:a}):!o&&!u?e.push({kind:`code`,value:a}):e.push({kind:`text`,value:a}),n=r+a.length}return n<t.text.length&&e.push({kind:`text`,value:t.text.slice(n)}),e}),a=e=>e.slice(e.lastIndexOf(`/`)+1);return(e,t)=>(B(),V(`span`,ZM,[(B(!0),V(z,null,L(i.value,(e,r)=>(B(),V(z,{key:r},[e.kind===`ref`||e.kind===`file`?(B(),H(N(Am),{key:0,to:N(n)(e.peek,{chain:!0}),class:`font-mono text-foreground underline decoration-border underline-offset-4 hover:decoration-foreground`,title:e.value,onClick:t[0]||=au(()=>{},[`stop`])},{default:P(()=>[G(j(e.kind===`file`?a(e.value):e.value),1)]),_:2},1032,[`to`,`title`])):e.kind===`commit`?(B(),H(DD,{key:1,text:e.value,class:`align-baseline`},null,8,[`text`])):e.kind===`code`?(B(),V(`code`,QM,j(e.value),1)):(B(),V(z,{key:3},[G(j(e.value),1)],64))],64))),128))]))}}),eN={class:`flex flex-col`},tN={key:1,class:`mt-0.5 grid size-4 shrink-0 place-items-center rounded-[4px] border border-dashed text-[10px] text-muted-foreground`,"aria-label":`已不需要`},nN={class:`flex min-w-0 flex-1 flex-col gap-0.5`},rN={class:`flex min-w-0 items-start gap-2`},iN=[`title`],aN={key:0,class:`text-xs text-muted-foreground`},oN={key:1,class:`text-xs text-muted-foreground`},sN={key:0},cN={key:2,class:`text-xs text-muted-foreground`},lN={key:3,class:`text-xs text-muted-foreground`},uN={key:1,class:`text-sm text-muted-foreground`},dN={key:0,class:`text-xs text-muted-foreground`},fN=I({__name:`Checklist`,props:{items:{},refPrefix:{},version:{}},setup(e){let t=e,n=J(()=>t.items.filter(e=>!e.done&&!e.dropped)),r=J(()=>t.items.filter(e=>e.done||e.dropped)),i=M(!1),a=J(()=>[...n.value,...i.value?r.value:[]]),o=M(null),s=M(``);async function c(e){if(e.done){await dw(()=>XC.check(`${t.refPrefix}${e.id}`,!1,void 0,t.version));return}o.value=e,s.value=``}async function l(){let e=o.value;e&&s.value.trim()&&await dw(()=>XC.check(`${t.refPrefix}${e.id}`,!0,s.value.trim(),t.version))&&(o.value=null)}return(t,n)=>(B(),V(z,null,[U(`ul`,eN,[(B(!0),V(z,null,L(a.value,e=>(B(),V(`li`,{key:e.id,class:`-mx-2 flex gap-3 rounded-md px-2 py-1.5 transition-colors duration-[120ms] hover:bg-accent/50`},[e.dropped?(B(),V(`span`,tN,`–`)):(B(),H(N(vE),{key:0,"model-value":e.done||o.value?.id===e.id,class:`mt-0.5`,"aria-label":e.done?`取消勾選 ${e.id}`:`勾選 ${e.id}`,"onUpdate:modelValue":t=>c(e)},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`])),U(`div`,nN,[U(`div`,rN,[W(DD,{text:e.id,class:`mt-px shrink-0`},null,8,[`text`]),U(`span`,{class:k([`min-w-0 flex-1`,{"text-muted-foreground":e.done,"text-muted-foreground line-through":e.dropped}])},j(e.text),3),(B(!0),V(z,null,L(e.serves??[],e=>(B(),V(`span`,{key:e,class:`shrink-0 rounded-sm bg-secondary px-1.5 font-mono text-[11px] text-muted-foreground`,title:`推進解決條件 ${e}`},j(e),9,iN))),128))]),e.doneWhen&&!e.done&&!e.dropped?(B(),V(`p`,aN,`完成定義:`+j(e.doneWhen),1)):K(``,!0),e.done&&e.evidence?(B(),V(`p`,oN,[W($M,{text:e.evidence},null,8,[`text`]),e.doneAt?(B(),V(`span`,sN,` · `+j(e.doneAt),1)):K(``,!0)])):K(``,!0),e.dropped?(B(),V(`p`,cN,[n[6]||=G(` 不需要了`,-1),e.supersededBy?(B(),V(z,{key:0},[n[4]||=G(`,由 `,-1),W($M,{text:e.supersededBy},null,8,[`text`]),n[5]||=G(` 取代`,-1)],64)):K(``,!0),e.note?(B(),V(z,{key:1},[G(`:`+j(e.note),1)],64)):K(``,!0)])):e.note?(B(),V(`p`,lN,j(e.note),1)):K(``,!0)])]))),128))]),r.value.length?(B(),H(N(sC),{key:0,variant:`ghost`,size:`xs`,class:`-ml-2 text-muted-foreground`,"aria-expanded":i.value,onClick:n[0]||=e=>i.value=!i.value},{default:P(()=>[i.value?(B(),H(N(Ju),{key:0})):(B(),H(N(Xu),{key:1})),G(j(i.value?`收起已完成`:`已完成 ${r.value.length} 個`),1)]),_:1},8,[`aria-expanded`])):K(``,!0),e.items.length===0?(B(),V(`p`,uN,`沒有項目`)):K(``,!0),W(N(WM),{open:o.value!==null,"onUpdate:open":n[3]||=e=>!e&&(o.value=null)},{default:P(()=>[W(N(KM),{class:`sm:max-w-lg`},{default:P(()=>[W(N(YM),null,{default:P(()=>[W(N(XM),null,{default:P(()=>[G(`勾選 `+j(o.value?.id),1)]),_:1}),W(N(qM),null,{default:P(()=>[G(j(o.value?.text),1)]),_:1})]),_:1}),U(`form`,{class:`flex flex-col gap-3`,onSubmit:au(l,[`prevent`])},[o.value?.doneWhen?(B(),V(`p`,dN,`完成定義:`+j(o.value.doneWhen),1)):K(``,!0),W(N(tD),{modelValue:s.value,"onUpdate:modelValue":n[1]||=e=>s.value=e,autofocus:``,placeholder:`證據:commit、檔案:行號或指令輸出`,"aria-label":`證據`},null,8,[`modelValue`]),W(N(JM),null,{default:P(()=>[W(N(sC),{type:`button`,variant:`ghost`,onClick:n[2]||=e=>o.value=null},{default:P(()=>[...n[7]||=[G(`取消`,-1)]]),_:1}),W(N(sC),{type:`submit`,disabled:!s.value.trim()},{default:P(()=>[...n[8]||=[G(`勾選`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`])],64))}}),pN=[`P0`,`P1`,`P2`,`P3`].map(e=>({value:e,label:e})),mN=e=>e??`P2`,hN=e=>e.map(e=>({value:e,label:Yw[e]??e,status:e})),gN=e=>Jw.has(e);function _N(e,t){let n=e.filters.flatMap(e=>e.values(t).flatMap(t=>[t,e.optionLabel?.(t)??e.options?.find(e=>e.value===t)?.label??``]));return[e.id(t),e.text(t),...n].filter(Boolean).join(` `)}var vN=e=>({doing:e.filter(e=>e.status===`doing`).length,open:e.filter(e=>!gN(e.status)).length}),yN=e=>({key:`status`,label:`狀態`,value:e=>e.status,order:e,groupLabel:e=>Yw[e]??e,status:e=>e}),bN=(e,t)=>e.values?.(t)??[e.value(t)];function xN(e,t){let n=new Map;for(let r of t)for(let t of bN(e,r))n.set(t,[...n.get(t)??[],r]);let r=t=>e.order?.includes(t)?e.order.indexOf(t):1/0,i=t=>Number(e.trailing?.includes(t)??!1);return[...n.keys()].sort((t,n)=>i(t)-i(n)||r(t)-r(n)||t.localeCompare(n)*(e.latestFirst?-1:1)).map(t=>({key:t,label:e.groupLabel?.(t)??t,status:e.status?.(t),detail:e.detail?.(t),items:n.get(t)}))}var SN=`f.`,CN=e=>(Array.isArray(e)?e[0]:e)??void 0,wN=(e,t=``)=>{if(!e.startsWith(t))return!1;let n=e.slice(t.length);return n===`q`||n===`sort`||n===`archived`||n.startsWith(SN)},TN=e=>$C(e,{}),EN=(e,t)=>ew(e,{...TN(e),...t});function DN(e,t){let n=tp(),r=ep(),i=`mainflow.list.${e.key}`,a=e.queryPrefix??``,o=TN(i),s=e=>Object.fromEntries(Object.entries(e).filter(([e])=>wN(e,a)));function c(e){let t={...n.query};for(let[n,r]of Object.entries(e))r?t[n]=r:delete t[n];r.replace({query:t})}let l=o.query??{},u=Object.keys(l).length>0&&Object.keys(s(n.query)).length===0;$i(()=>u&&void r.replace({query:{...n.query,...l}}));let d=()=>`${n.path}?${CN(n.query.view)??``}`,f=d();F(()=>s(n.query),(e,t)=>{d()!==f||u&&t===void 0||EN(i,{query:e})},{deep:!0,immediate:!0});let p=J({get:()=>CN(n.query[`${a}q`])??``,set:e=>c({[`${a}q`]:e.trim()?e:void 0})}),m=J(()=>{let t=CN(n.query[`${a}sort`])??``,r=t.replace(/^-/,``),i=e.sorts.find(e=>e.key===r),o=i??e.sorts.find(t=>t.key===e.defaultSort);return{field:o,dir:i?t.startsWith(`-`)?`desc`:`asc`:o.dir,chosen:!!i}});function h(t,n){let r=e.sorts.find(e=>e.key===t);c({[`${a}sort`]:`${(n??r.dir)===`desc`?`-`:``}${t}`})}let g=()=>c({[`${a}sort`]:void 0});function _(e){let{field:t,dir:n,chosen:r}=m.value;!r||t.key!==e?h(e,`desc`):n===`desc`?h(e,`asc`):g()}let v=J(()=>Object.fromEntries(e.filters.map(e=>[e.key,(CN(n.query[`${a}${SN}${e.key}`])??``).split(`,`).filter(Boolean)])));function y(e,t){let n=v.value[e]??[],r=n.includes(t)?n.filter(e=>e!==t):[...n,t];c({[`${a}${SN}${e}`]:r.join(`,`)||void 0})}let b=e=>c({[`${a}${SN}${e}`]:void 0}),x=()=>c({[`${a}q`]:void 0,[`${a}archived`]:void 0,...Object.fromEntries(e.filters.map(e=>[`${a}${SN}${e.key}`,void 0]))}),S=J(()=>{let e=CN(n.query[`${a}archived`]);return e===`with`||e===`only`?e:`without`}),C=e=>c({[`${a}archived`]:e===`without`?void 0:e}),w=M(o.group!==void 0&&(o.group===``||e.groups.some(e=>e.key===o.group))?o.group:e.defaultGroup);function T(e){w.value=e,EN(i,{group:e})}function ee(e){if(e.options)return e.options;let n=new Set(t().flatMap(e.values));for(let t of v.value[e.key]??[])n.add(t);return[...n].sort().map(t=>({value:t,label:e.optionLabel?.(t)??t}))}let E=J(()=>{let n=p.value.toLowerCase().split(/\s+/).filter(Boolean);return t().filter(t=>{if(e.archived){let n=e.archived(t);if(S.value===`without`&&n||S.value===`only`&&!n)return!1}for(let n of e.filters){let e=v.value[n.key]??[];if(e.length>0&&!n.values(t).some(t=>e.includes(t)))return!1}let r=_N(e,t).toLowerCase();return n.every(e=>r.includes(e))})}),te=J(()=>{let{field:t,dir:n}=m.value,r=n===`asc`?1:-1;return[...E.value].sort((n,i)=>{let a=t.value(n),o=t.value(i),s=Number(a==null||a===``)-Number(o==null||o===``);return s===0?((typeof a==`number`&&typeof o==`number`?a-o:String(a).localeCompare(String(o)))||e.id(n).localeCompare(e.id(i)))*r:s})}),ne=J(()=>{let t=e.groups.find(e=>e.key===w.value),n=S.value!==`only`&&!v.value.status?.length,r=t=>n?{items:t.filter(t=>!e.ended?.(t)),ended:t.filter(t=>e.ended?.(t))}:{items:t,ended:[]};return t?xN(t,te.value).map(({key:e,label:n,status:i,detail:a,items:o})=>{let s=t.leader?.(e);return{key:e,label:n,status:i,leader:s,detail:a,...r(o.filter(e=>e!==s))}}):te.value.length?[{key:``,label:``,...r(te.value)}]:[]}),re=Qt(new Set(o.collapsed??[])),D=Qt(new Set(o.endedFolded??[])),ie=(e,t,n)=>{e.has(t)?e.delete(t):e.add(t),EN(i,{[n]:[...e]})};return{spec:e,search:p,sort:m,setSort:h,clearSort:g,cycleSort:_,filters:v,toggleFilter:y,clearFilter:b,clearAll:x,activeFilters:J(()=>e.filters.flatMap(e=>(v.value[e.key]??[]).map(t=>({field:e,value:t,label:ee(e).find(e=>e.value===t)?.label??t})))),optionsOf:ee,archived:S,setArchived:C,group:w,setGroup:T,total:J(()=>t().length),shown:J(()=>E.value.length),sorted:te,groups:ne,collapsed:re,endedFolded:D,toggleCollapsed:e=>ie(re,e,`collapsed`),toggleEnded:e=>ie(D,e,`endedFolded`)}}var ON=`未分組`;function kN(e,t){if(!e)return!1;let n=Q.summary?.hub;return e===t||n!==void 0&&e===`${n}:${t}`}var AN=e=>e?Q.summary?.groups.find(t=>t.id===e):void 0;function jN(e=Q.summary?.groups??[]){return[...e].sort((e,t)=>Number(gN(e.status))-Number(gN(t.status))||mN(e.priority).localeCompare(mN(t.priority))||e.id.localeCompare(t.id))}var MN=e=>e===`未分組`?ON:`${e} ${AN(e)?.title??``}`.trim();function NN(e){return{key:`group`,label:`組`,value:t=>e(t)??`未分組`,get order(){return jN().map(e=>e.id)},trailing:[ON],groupLabel:MN,detail:e=>{let t=AN(e);return t&&{ref:t.id,title:t.title,status:t.status,priority:t.priority??null,trigger:t.trigger,summary:t.summary}}}}function PN(e){return{key:`group`,label:`組`,values:t=>[e(t)||`未分組`],optionLabel:MN}}var FN={key:0,class:`pb-8`},IN={key:0,class:`text-xs`},LN={class:`text-xs`},RN={class:`text-xs`},zN={class:`flex flex-col gap-1.5 text-sm`},BN={class:`shrink-0 font-mono text-xs text-muted-foreground`},VN={class:`shrink-0`},HN=[`title`],UN={key:0,class:`text-sm text-muted-foreground`},WN={key:1,class:`px-5 text-muted-foreground`},GN=I({__name:`GroupPeek`,props:{id:{}},setup(e){let t=e,{open:n}=FC(),r=J(()=>AN(t.id)),i=e=>{let t=r.value?.order.indexOf(e)??-1;return t<0?2**53-1:t},a=J(()=>(Q.summary?.mainlines??[]).filter(e=>kN(e.group,t.id)&&!e.archivedAt).sort((e,t)=>i(e.id)-i(t.id))),o=J(()=>Q.issues.filter(e=>kN(e.group,t.id)&&!e.archivedAt).sort((e,t)=>i(e.id)-i(t.id))),s=e=>Q.sessions.filter(e=>!e.archivedAt&&(e.status===`active`||e.status===`paused`)).filter(t=>t.actions.some(t=>(t.status===`doing`||t.status===`blocked`)&&t.serves.some(e))).map(e=>({session:e,name:jw(e)})),c=e=>s(t=>t.startsWith(`${e}/`)||t.startsWith(`${e}#`)),l=J(()=>s(e=>e.startsWith(`${t.id}#`))),u=J(()=>(Q.relations.groupMembers[t.id]??[]).filter(e=>!e.archived)),d=J(()=>u.value.filter(e=>e.kind===`mainline`)),f=J(()=>u.value.filter(e=>e.kind===`issue`));return(i,s)=>r.value?(B(),V(`div`,FN,[W(MD,{id:r.value.id,title:r.value.title,type:`group`,status:r.value.status},{default:P(()=>[W(kE,{status:r.value.status},null,8,[`status`])]),_:1},8,[`id`,`title`,`status`]),W(ID,null,{default:P(()=>[W(QD,{columns:1},{default:P(()=>[W($,{label:`優先度`,icon:N(_d)},{default:P(()=>[W(TE,{priority:r.value.priority},null,8,[`priority`]),!r.value.priority||r.value.priority===`P2`?(B(),V(`span`,IN,`P2`)):K(``,!0)]),_:1},8,[`icon`]),r.value.trigger?(B(),H($,{key:0,label:`時機`,icon:N(rd)},{default:P(()=>[G(j(r.value.trigger),1)]),_:1},8,[`icon`])):K(``,!0),r.value.origin?(B(),H($,{key:1,label:`來源`,icon:N(cd)},{default:P(()=>[W($j,q(N(Iw)(r.value.origin),{onOpen:s[0]||=e=>N(n)(e,{chain:!0})}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.category?(B(),H($,{key:2,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(r.value.category),1)]),_:1},8,[`icon`])):K(``,!0),r.value.labels?.length?(B(),H($,{key:3,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(r.value.labels,e=>(B(),H(N(nE),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,LN,j(r.value.created),1)]),_:1},8,[`icon`]),r.value.closedAt?(B(),H($,{key:4,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,RN,j(r.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),r.value.resolution?(B(),H($,{key:5,label:`結果`,icon:N($u)},{default:P(()=>[G(j(r.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),r.value.body.trim()?(B(),H(ID,{key:0,title:`內文`},{default:P(()=>[W(Cj,{source:r.value.body},null,8,[`source`])]),_:1})):K(``,!0),W(ID,{title:`解決條件`,count:r.value.criteria?.length??0},{default:P(()=>[W(fN,{items:r.value.criteria??[],"ref-prefix":`${r.value.id}#`,version:r.value.version},null,8,[`items`,`ref-prefix`,`version`]),(B(!0),V(z,null,L(l.value,({session:e,name:t})=>(B(),H(Oj,{key:e.id,peek:N(TC)(e.id),title:t,status:e.status},{default:P(()=>[...s[1]||=[G(`在做組的條件`,-1)]]),_:1},8,[`peek`,`title`,`status`]))),128))]),_:1},8,[`count`]),r.value.grants?.length?(B(),H(ID,{key:1,title:`授權`,count:r.value.grants.length},{default:P(()=>[U(`ul`,zN,[(B(!0),V(z,null,L(r.value.grants,e=>(B(),V(`li`,{key:e.id,class:`flex min-w-0 items-baseline gap-2`},[U(`span`,BN,j(e.id),1),U(`span`,VN,j(e.action),1),U(`span`,{class:`min-w-0 truncate text-muted-foreground`,title:e.note?`${e.target}:${e.note}`:e.target},j(e.target),9,HN)]))),128))])]),_:1},8,[`count`])):K(``,!0),W(ID,{title:`主脈絡`,count:a.value.length},{default:P(()=>[(B(!0),V(z,null,L(a.value,(e,t)=>(B(),H(Oj,{key:e.id,peek:e.id,id:`${t+1}. ${e.id}`,title:e.title,status:e.status},{default:P(()=>[(B(!0),V(z,null,L(c(e.id),e=>(B(),V(`span`,{key:e.session.id,class:`mr-2`},j(e.name),1))),128)),G(j(N(Yw)[e.status]??e.status),1)]),_:2},1032,[`peek`,`id`,`title`,`status`]))),128)),a.value.length===0?(B(),V(`p`,UN,[s[2]||=G(`還沒有主脈絡在這組。用 `,-1),U(`code`,null,`mainflow mainline set <m> --group `+j(r.value.id),1),s[3]||=G(` 加入。`,-1)])):K(``,!0)]),_:1},8,[`count`]),o.value.length?(B(),H(ID,{key:2,title:`待辦事項`,count:o.value.length},{default:P(()=>[(B(!0),V(z,null,L(o.value,e=>(B(),H(Oj,{key:e.id,peek:e.id,id:e.id,title:e.title,status:e.status},{default:P(()=>[W(TE,{priority:e.priority},null,8,[`priority`])]),_:2},1032,[`peek`,`id`,`title`,`status`]))),128))]),_:1},8,[`count`])):K(``,!0),u.value.length?(B(),H(ID,{key:3,title:`其他 hub 的成員`,count:u.value.length},{default:P(()=>[(B(!0),V(z,null,L([...d.value,...f.value],e=>(B(),H(Oj,{key:e.ref,peek:e.ref,id:e.ref,title:e.title,status:e.status},{default:P(()=>[G(j(e.kind===`issue`?`待辦`:`主脈絡`)+` · `+j(N(Yw)[e.status]??e.status),1)]),_:2},1032,[`peek`,`id`,`title`,`status`]))),128))]),_:1},8,[`count`])):K(``,!0),W(Rj,{self:t.id,links:r.value.links},null,8,[`self`,`links`]),r.value.refs?.length?(B(),H(ID,{key:4,title:`參考來源`,count:r.value.refs.length},{default:P(()=>[W(Uj,{refs:r.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0)])):(B(),V(`p`,WN,`找不到組 `+j(e.id)+`。`,1))}}),KN={key:0,class:`pb-8`},qN={key:0,class:`text-xs`},JN={class:`text-xs`},YN={class:`text-xs`},XN={class:`text-xs`},ZN={key:1,class:`px-5 text-muted-foreground`},QN=I({__name:`IssuePeek`,props:{id:{}},setup(e){let t=e,{open:n}=FC(),r=J(()=>Q.issues.find(e=>e.id===t.id)),i=e=>n(e,{chain:!0}),a=()=>r.value&&dw(()=>XC.archiveIssue(r.value.id,!r.value.archivedAt,r.value.version));return Rw([r.value?.origin,r.value?.plannedIn]),(n,o)=>r.value?(B(),V(`div`,KN,[W(MD,{id:r.value.id,title:r.value.title,type:`issue`,status:r.value.status},{default:P(()=>[W(kE,{status:r.value.status},null,8,[`status`]),W(iE,{archived:!!r.value.archivedAt,onToggle:a},null,8,[`archived`])]),_:1},8,[`id`,`title`,`status`]),W(ID,null,{default:P(()=>[W(QD,{columns:1},{default:P(()=>[r.value.priority?(B(),H($,{key:0,label:`優先度`,icon:N(_d)},{default:P(()=>[W(TE,{priority:r.value.priority},null,8,[`priority`]),r.value.priority===`P2`?(B(),V(`span`,qN,`P2`)):K(``,!0)]),_:1},8,[`icon`])):K(``,!0),r.value.group?(B(),H($,{key:1,label:`組`,icon:N(Hu)},{default:P(()=>[W($j,q(N(Iw)(r.value.group),{onOpen:i}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.due?(B(),H($,{key:2,label:`到期`,icon:N(Wu)},{default:P(()=>[W(_E,{day:r.value.due,ended:r.value.status===`closed`},null,8,[`day`,`ended`])]),_:1},8,[`icon`])):K(``,!0),r.value.plannedIn?(B(),H($,{key:3,label:`排入`,icon:N(Ku)},{default:P(()=>[W($j,q(N(Iw)(r.value.plannedIn),{onOpen:i}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.origin?(B(),H($,{key:4,label:`來源`,icon:N(cd)},{default:P(()=>[W($j,q(N(Iw)(r.value.origin),{onOpen:i}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.category?(B(),H($,{key:5,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(r.value.category),1)]),_:1},8,[`icon`])):K(``,!0),r.value.labels?.length?(B(),H($,{key:6,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(r.value.labels,e=>(B(),H(N(nE),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,JN,j(r.value.created),1)]),_:1},8,[`icon`]),r.value.closedAt?(B(),H($,{key:7,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,YN,j(r.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),r.value.resolution?(B(),H($,{key:8,label:`結果`,icon:N($u)},{default:P(()=>[G(j(r.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),r.value.archivedAt?(B(),H($,{key:9,label:`封存`,icon:N(Pu)},{default:P(()=>[U(`span`,XN,j(r.value.archivedAt),1)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),r.value.body.trim()?(B(),H(ID,{key:0,title:`內文`},{default:P(()=>[W(Cj,{source:r.value.body},null,8,[`source`])]),_:1})):K(``,!0),W(Rj,{self:t.id,links:r.value.links},null,8,[`self`,`links`]),r.value.refs?.length?(B(),H(ID,{key:1,title:`參考來源`,count:r.value.refs.length},{default:P(()=>[W(Uj,{refs:r.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0)])):(B(),V(`p`,ZN,`找不到待辦 `+j(e.id)+`。`,1))}}),$N=[`title`],eP={class:`h-1.5 w-14 overflow-hidden rounded-full bg-primary/20`},tP={class:`min-w-7 tabular-nums`},nP=I({__name:`ProgressBar`,props:{done:{},total:{}},setup(e){let t=e,n=J(()=>t.total===0?0:Math.round(t.done/t.total*100));return(t,r)=>(B(),V(`span`,{class:`inline-flex items-center gap-2 text-xs text-muted-foreground`,title:`${e.done}/${e.total}`},[U(`span`,eP,[U(`span`,{class:`block h-full rounded-full bg-primary`,style:he({width:`${n.value}%`})},null,4)]),U(`span`,tP,j(e.done)+`/`+j(e.total),1)],8,$N))}}),rP={key:0,class:`text-xs`},iP={class:`text-xs`},aP={class:`text-xs`},oP={class:`text-xs tabular-nums`},sP={class:`text-xs`},cP={class:`flex flex-col gap-2`},lP={class:`mr-2 font-mono text-xs text-muted-foreground`},uP={class:`w-full text-xs`},dP={class:`py-1.5 tabular-nums`},fP={class:`text-right tabular-nums`},pP={class:`text-right tabular-nums`},mP={class:`pl-3 text-muted-foreground`},hP={key:0,class:`text-sm text-muted-foreground`},gP=I({__name:`MainlineBody`,props:{mainline:{},columns:{default:1}},setup(e){let t=e,{open:n}=FC(),r=J(()=>t.mainline),i=J(()=>r.value.tasks.flatMap(e=>e.checklist).filter(e=>!e.dropped)),a=J(()=>r.value.criteria.filter(e=>!e.dropped)),o=J(()=>r.value.decisions.filter(e=>e.status===`proposed`)),s=J(()=>Math.round((r.value.costs??[]).reduce((e,t)=>e+(t.actual??0),0)*100)/100),c=J(()=>r.value.budget?.unit??r.value.costs?.[0]?.unit??``),l=J(()=>Q.issues.filter(e=>!e.archivedAt&&(e.origin?.startsWith(`${r.value.id}/`)||e.plannedIn?.startsWith(`${r.value.id}/`)))),u=J(()=>Fw(r.value.id)),d=[`done`,`dropped`];return(t,f)=>(B(),V(z,null,[W(ID,null,{default:P(()=>[W(QD,{columns:e.columns},{default:P(()=>[W($,{label:`解決條件`,icon:N(af)},{default:P(()=>[W(nP,{done:a.value.filter(e=>e.done).length,total:a.value.length},null,8,[`done`,`total`])]),_:1},8,[`icon`]),W($,{label:`checklist`,icon:N(Pd)},{default:P(()=>[W(nP,{done:i.value.filter(e=>e.done).length,total:i.value.length},null,8,[`done`,`total`])]),_:1},8,[`icon`]),r.value.group?(B(),H($,{key:0,label:`組`,icon:N(Hu)},{default:P(()=>[W($j,q(N(Iw)(r.value.group),{onOpen:f[0]||=e=>N(n)(e,{chain:!0})}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.priority?(B(),H($,{key:1,label:`優先度`,icon:N(_d)},{default:P(()=>[W(TE,{priority:r.value.priority},null,8,[`priority`]),r.value.priority===`P2`?(B(),V(`span`,rP,`P2`)):K(``,!0)]),_:1},8,[`icon`])):K(``,!0),r.value.due?(B(),H($,{key:2,label:`到期`,icon:N(Wu)},{default:P(()=>[W(_E,{day:r.value.due,ended:d.includes(r.value.status)},null,8,[`day`,`ended`])]),_:1},8,[`icon`])):K(``,!0),r.value.category?(B(),H($,{key:3,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(r.value.category),1)]),_:1},8,[`icon`])):K(``,!0),r.value.labels?.length?(B(),H($,{key:4,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(r.value.labels,e=>(B(),H(N(nE),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,iP,j(r.value.created),1)]),_:1},8,[`icon`]),r.value.closedAt?(B(),H($,{key:5,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,aP,j(r.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),r.value.resolution?(B(),H($,{key:6,label:`結果`,icon:N($u)},{default:P(()=>[G(j(r.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),r.value.origin?(B(),H($,{key:7,label:`來源`,icon:N(cd)},{default:P(()=>[W($j,q(N(Iw)(r.value.origin),{onOpen:f[1]||=e=>N(n)(e,{chain:!0})}),null,16)]),_:1},8,[`icon`])):K(``,!0),r.value.budget||r.value.costs?.length?(B(),H($,{key:8,label:`花費`,icon:N(cf)},{default:P(()=>[U(`span`,oP,[G(j(s.value),1),r.value.budget?(B(),V(z,{key:0},[G(` / `+j(r.value.budget.amount),1)],64)):K(``,!0),G(` `+j(c.value),1)])]),_:1},8,[`icon`])):K(``,!0),r.value.archivedAt?(B(),H($,{key:9,label:`封存`,icon:N(Pu)},{default:P(()=>[U(`span`,sP,j(r.value.archivedAt),1)]),_:1},8,[`icon`])):K(``,!0)]),_:1},8,[`columns`])]),_:1}),o.value.length?(B(),H(ID,{key:0,title:`待裁決的決策`,count:o.value.length},{default:P(()=>[U(`div`,cP,[(B(!0),V(z,null,L(o.value,e=>(B(),H(N(_g),{key:e.id,variant:`warning`,class:`cursor-pointer transition-colors hover:bg-accent/50`,onClick:t=>N(n)(N(wC)(r.value.id,e.id),{chain:!0})},{default:P(()=>[W(N(Qu)),W(N(yg),null,{default:P(()=>[U(`span`,lP,j(e.id),1),G(j(e.title),1)]),_:2},1024),e.affects?.length?(B(),H(N(vg),{key:0,class:`text-xs text-muted-foreground`},{default:P(()=>[G(`在等它的有 `+j(e.affects.join(`、`)),1)]),_:2},1024)):K(``,!0)]),_:2},1032,[`onClick`]))),128))])]),_:1},8,[`count`])):K(``,!0),W(ID,{title:`解決條件`,count:r.value.criteria.length},{default:P(()=>[W(fN,{items:r.value.criteria,"ref-prefix":`${r.value.id}#`,version:r.value.version},null,8,[`items`,`ref-prefix`,`version`])]),_:1},8,[`count`]),r.value.body.trim()?(B(),H(ID,{key:1,title:`內文`},{default:P(()=>[W(Cj,{source:r.value.body},null,8,[`source`])]),_:1})):K(``,!0),W(Rj,{self:r.value.id,links:r.value.links,mainline:``},null,8,[`self`,`links`]),r.value.refs?.length?(B(),H(ID,{key:2,title:`參考來源`,count:r.value.refs.length},{default:P(()=>[W(Uj,{refs:r.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0),r.value.costs?.length?(B(),H(ID,{key:3,title:`花費明細`,count:r.value.costs.length},{default:P(()=>[U(`table`,uP,[f[2]||=U(`thead`,{class:`text-muted-foreground`},[U(`tr`,{class:`border-b`},[U(`th`,{class:`py-1.5 text-left font-medium`},`日期`),U(`th`,{class:`text-left font-medium`},`項目`),U(`th`,{class:`text-right font-medium`},`預估`),U(`th`,{class:`text-right font-medium`},`實際`),U(`th`,{class:`pl-3 text-left font-medium`},`備註`)])],-1),U(`tbody`,null,[(B(!0),V(z,null,L(r.value.costs,(e,t)=>(B(),V(`tr`,{key:t,class:`border-b`},[U(`td`,dP,j(e.date),1),U(`td`,null,j(e.item),1),U(`td`,fP,j(e.estimate??``),1),U(`td`,pP,j(e.actual??``),1),U(`td`,mP,j(e.note??``),1)]))),128))])])]),_:1},8,[`count`])):K(``,!0),l.value.length?(B(),H(ID,{key:4,title:`相關的待辦`,count:l.value.length},{default:P(()=>[(B(!0),V(z,null,L(l.value,e=>(B(),H(Oj,{key:e.id,peek:e.id,id:e.id,title:e.title,status:e.status},null,8,[`peek`,`id`,`title`,`status`]))),128))]),_:1},8,[`count`])):K(``,!0),W(ID,{title:`推進過它的會話`,count:u.value.length},{default:P(()=>[(B(!0),V(z,null,L(u.value,({session:e,actions:t})=>(B(),H(Oj,{key:e.id,peek:N(TC)(e.id),title:N(jw)(e),status:e.status},{default:P(()=>[G(j(t.length)+` 個行動`,1)]),_:2},1032,[`peek`,`title`,`status`]))),128)),u.value.length===0?(B(),V(`p`,hP,`這台電腦上沒有推進它的會話。會話只記在本機。`)):K(``,!0)]),_:1},8,[`count`])],64))}}),_P={class:`inline-flex h-7 items-center gap-1.5 rounded-full border bg-background px-2.5 text-xs font-medium transition-colors hover:bg-accent focus-within:ring-3 focus-within:ring-ring/50`},vP=[`value`],yP=[`value`],bP=I({__name:`StatusSelect`,props:{status:{},options:{}},emits:[`change`],setup(e,{emit:t}){let n=t;return(t,r)=>(B(),V(`label`,_P,[W(OE,{status:e.status},null,8,[`status`]),U(`select`,{class:`cursor-pointer bg-transparent outline-none`,value:e.status,onChange:r[0]||=e=>n(`change`,e.target.value)},[(B(!0),V(z,null,L(e.options,e=>(B(),V(`option`,{key:e,value:e},j(N(Yw)[e]??e),9,yP))),128))],40,vP)]))}}),xP={key:0,class:`pb-8`},SP={key:1,class:`px-5 text-muted-foreground`},CP=I({__name:`MainlinePeek`,props:{m:{}},setup(e){let t=e,{mainline:n}=eM(()=>t.m),r=e=>n.value&&dw(()=>XC.mainlineStatus(t.m,e,n.value.version)),i=e=>n.value&&dw(()=>XC.mainlineTitle(t.m,e,n.value.version)),a=()=>n.value&&dw(()=>XC.archive(t.m,!n.value.archivedAt,n.value.version));return(t,o)=>N(n)?(B(),V(`div`,xP,[W(MD,{id:N(n).id,title:N(n).title,type:`mainline`,status:N(n).status,editable:``,onRename:i},{default:P(()=>[W(bP,{status:N(n).status,options:N(Ww),onChange:r},null,8,[`status`,`options`]),W(iE,{archived:!!N(n).archivedAt,onToggle:a},null,8,[`archived`]),W(N(sC),{variant:`ghost`,size:`xs`,class:`ml-auto text-muted-foreground`,"as-child":``},{default:P(()=>[W(N(Am),{to:`/mainlines/${N(n).id}`},{default:P(()=>[W(N(ef)),o[0]||=G(`開啟工作區`,-1)]),_:1},8,[`to`])]),_:1})]),_:1},8,[`id`,`title`,`status`]),W(gP,{mainline:N(n)},null,8,[`mainline`])])):(B(),V(`p`,SP,`載入 `+j(e.m)+`…`,1))}}),wP=[`datetime`,`title`],TP=I({__name:`RelativeTime`,props:{at:{}},setup(e){let t=e,n=If({scheduler:e=>Cf(e,6e4)}),r=new Intl.RelativeTimeFormat(`zh-TW`,{numeric:`auto`}),i=J(()=>new Date(cE(t.at))),a=J(()=>{let e=Math.round((n.value.getTime()-i.value.getTime())/6e4);if(t.at.length===10){let n=Math.round(e/1440);return n>=0&&n<7?r.format(-n,`day`):t.at}return e<1?`剛剛`:e<60?r.format(-e,`minute`):e<1440?r.format(-Math.round(e/60),`hour`):e<10080?r.format(-Math.round(e/1440),`day`):uE(t.at)});return(t,n)=>(B(),V(`time`,{datetime:e.at,title:N(fE)(e.at)},j(a.value),9,wP))}}),EP={key:0,class:`pb-8`},DP=[`title`],OP={key:0,class:`flex flex-col gap-1 text-sm`},kP={key:0},AP={key:0,class:`text-xs text-muted-foreground`},jP={key:1,class:`text-xs text-muted-foreground`},MP={class:`font-mono text-xs`},NP={class:`flex flex-col`},PP=[`aria-expanded`,`onClick`],FP={class:`mt-px shrink-0 font-mono text-xs text-muted-foreground`},IP={class:`min-w-0 flex-1`},LP={key:2,class:`shrink-0 text-xs text-muted-foreground tabular-nums`},RP={class:`flex flex-wrap gap-1 pb-1 pl-12`},zP={key:0,class:`pb-1 pl-12 text-xs text-muted-foreground`},BP={key:1,class:`mb-2 ml-12 flex flex-col gap-1.5 rounded-md border p-3 text-xs`},VP={key:0,class:`text-muted-foreground`},HP={key:1,class:`text-muted-foreground`},UP={key:2,class:`text-muted-foreground`},WP={class:`w-20 shrink-0 text-muted-foreground`},GP={key:0,class:`text-muted-foreground`},KP={key:1,class:`text-destructive`},qP={key:0,class:`text-sm text-muted-foreground`},JP={key:0,class:`text-sm text-muted-foreground`},YP={class:`w-20 text-muted-foreground`},XP={class:`tabular-nums`},ZP={key:1,class:`px-5 text-muted-foreground`},QP=I({__name:`SessionPeek`,props:{id:{}},setup(e){let t=e,{open:n}=FC(),r=J(()=>Q.sessions.find(e=>e.id===t.id)),i=M(null),a=M(null),o=e=>Q.sessions.find(t=>t.id===e),s=J(()=>{let e=r.value;return e?[...e.delegatedFrom?[{label:`委派自`,id:e.delegatedFrom}]:[],...e.handoffFrom?[{label:`接手自`,id:e.handoffFrom}]:[],...Q.sessions.filter(t=>t.delegatedFrom===e.id).map(e=>({label:`委派給`,id:e.id})),...Q.sessions.filter(t=>t.handoffFrom===e.id).map(e=>({label:`交接給`,id:e.id}))]:[]});F(()=>[r.value?.id,r.value?.actions.length,r.value?.actions.map(e=>e.status).join()],async()=>{let e=r.value;if(e){for(let t of new Set(e.actions.flatMap(e=>e.serves.map(e=>QC(e).m))))lw(t).catch(e=>Q.error=e.message);i.value=await XC.trace(e.id).catch(()=>null)}},{immediate:!0});function c(e){let{m:t,t:n,item:r}=QC(e);if(!n){let n=Q.mainlines[t]?.criteria.find(e=>e.id===r);return{ref:e,task:t,text:n?.text,done:n?.done??!1}}let i=Q.mainlines[t]?.tasks.find(e=>e.id===n);return{ref:e,task:`${t}/${n}`,text:i?.checklist.find(e=>e.id===r)?.text,done:i?.checklist.find(e=>e.id===r)?.done??!1}}let l=J(()=>[...new Set((r.value?.actions??[]).flatMap(e=>e.serves))].map(c));function u(e){return Object.keys(Xw).map(t=>({kind:t,items:e.filter(e=>e.kind===t)})).filter(e=>e.items.length>0)}let d=e=>u(i.value?.byAction[e]??[]),f=e=>(i.value?.byAction[e]??[]).length,p=()=>r.value&&dw(()=>XC.archiveSession(r.value.id,!r.value.archivedAt));return(t,c)=>r.value?(B(),V(`div`,EP,[W(MD,{title:N(jw)(r.value),type:`session`,status:r.value.status},{notice:P(()=>[r.value.description||r.value.summary?(B(),V(`div`,OP,[r.value.description?(B(),V(`p`,kP,[G(j(r.value.description),1),r.value.depth===void 0?K(``,!0):(B(),V(`span`,AP,` · 深度 `+j(r.value.depth),1))])):K(``,!0),r.value.summary?(B(),V(`p`,jP,j(r.value.summary),1)):K(``,!0)])):K(``,!0)]),default:P(()=>[W(kE,{status:r.value.status},null,8,[`status`]),r.value.elsewhere?(B(),V(`span`,{key:0,title:`工作目錄 ${r.value.cwd} 不在這台電腦上`,"data-elsewhere":``},`其他環境`,8,DP)):K(``,!0),W(DD,{text:r.value.id,label:r.value.id.slice(-8)},null,8,[`text`,`label`]),W(iE,{archived:!!r.value.archivedAt,onToggle:p},null,8,[`archived`])]),_:1},8,[`title`,`status`]),W(ID,null,{default:P(()=>[W(QD,{columns:1},{default:P(()=>[W($,{label:`ID`,icon:N(Od)},{default:P(()=>[W(DD,{text:r.value.id},null,8,[`text`])]),_:1},8,[`icon`]),W($,{label:`agent`,icon:N(Vu)},{default:P(()=>[W(N(nE),{variant:`secondary`},{default:P(()=>[G(j(r.value.agent),1)]),_:1})]),_:1},8,[`icon`]),i.value?.model??r.value.model?(B(),H($,{key:0,label:`模型`,icon:N(ud)},{default:P(()=>[U(`span`,MP,j(i.value?.model??r.value.model),1)]),_:1},8,[`icon`])):K(``,!0),r.value.effort?(B(),H($,{key:1,label:`effort`,icon:N(wd)},{default:P(()=>[G(j(r.value.effort),1)]),_:1},8,[`icon`])):K(``,!0),W($,{label:`開始`,icon:N(rd)},{default:P(()=>[W(TP,{at:r.value.started,class:`text-xs`},null,8,[`at`])]),_:1},8,[`icon`]),r.value.branch?(B(),H($,{key:2,label:`分支`,icon:N(Td)},{default:P(()=>[W(DD,{text:r.value.branch},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),r.value.worktree?(B(),H($,{key:3,label:`worktree`,icon:N(xd)},{default:P(()=>[W(DD,{text:r.value.worktree},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),W($,{label:`工作目錄`,icon:N(Sd)},{default:P(()=>[W(DD,{text:r.value.cwd},null,8,[`text`])]),_:1},8,[`icon`]),r.value.transcript?(B(),H($,{key:4,label:`對話紀錄`,icon:N(Xd)},{default:P(()=>[W(DD,{text:r.value.transcript,class:`min-w-0`},null,8,[`text`]),W(N(sC),{variant:`ghost`,size:`icon-xs`,class:`text-muted-foreground`,title:`在 Finder 顯示`,"aria-label":`在 Finder 顯示`,onClick:c[0]||=e=>N(dw)(()=>N(XC).reveal(r.value.transcript))},{default:P(()=>[W(N(yd))]),_:1})]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),W(ID,{title:`行動佇列`,count:r.value.actions.length},{default:P(()=>[U(`ul`,NP,[(B(!0),V(z,null,L(r.value.actions,e=>(B(),V(`li`,{key:e.id,class:`flex flex-col`},[U(`button`,{type:`button`,class:`-mx-2 flex min-h-8 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors duration-[120ms] hover:bg-accent/50`,"aria-expanded":a.value===e.id,onClick:t=>a.value=a.value===e.id?null:e.id},[a.value===e.id?(B(),H(N(Ju),{key:0,class:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`})):(B(),H(N(Xu),{key:1,class:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`})),W(OE,{status:e.status,class:`mt-0.5 shrink-0`},null,8,[`status`]),U(`span`,FP,j(e.id),1),U(`span`,IP,j(e.do),1),e.startedAt?(B(),V(`span`,LP,j(N(dE)(e.startedAt))+j(e.doneAt?`–${N(dE)(e.doneAt)}`:``),1)):K(``,!0)],8,PP),U(`div`,RP,[(B(!0),V(z,null,L(e.serves,e=>(B(),H($j,q({key:e},{ref_for:!0},N(Iw)(e.split(`#`)[0]),{id:e,onOpen:()=>N(n)(e.split(`#`)[0],{chain:!0})}),null,16,[`id`,`onOpen`]))),128))]),e.note?(B(),V(`p`,zP,j(e.note),1)):K(``,!0),a.value===e.id?(B(),V(`div`,BP,[i.value?.available?e.startedAt?f(e.id)===0?(B(),V(`p`,UP,`這段時間沒有用到 skill、agent,也沒有載入 rule 或用 Read 讀檔。用 Bash 讀的檔不會出現在這裡。`)):K(``,!0):(B(),V(`p`,HP,`這個行動沒有開始時間,追溯不到它的時間窗。`)):(B(),V(`p`,VP,`沒有對話紀錄,無法追溯。`)),(B(!0),V(z,null,L(d(e.id),e=>(B(),V(`div`,{key:e.kind,class:`flex flex-wrap items-baseline gap-1.5`},[U(`span`,WP,j(N(Xw)[e.kind]),1),(B(!0),V(z,null,L(e.items,e=>(B(),H(N(nE),{key:e.path??e.name,variant:`secondary`,class:`font-mono font-normal`,title:e.path??e.name},{default:P(()=>[G(j(e.name),1),e.count>1?(B(),V(`span`,GP,`×`+j(e.count),1)):K(``,!0),e.detail?.startsWith(`blocked`)?(B(),V(`span`,KP,`擋下`)):K(``,!0)]),_:2},1032,[`title`]))),128))]))),128))])):K(``,!0)]))),128))]),r.value.actions.length===0?(B(),V(`p`,qP,`這個會話沒有行動。`)):K(``,!0)]),_:1},8,[`count`]),W(ID,{title:`委派與接手`,count:s.value.length},{default:P(()=>[(B(!0),V(z,null,L(s.value,e=>(B(),H(Oj,{key:e.label+e.id,peek:N(TC)(e.id),label:e.label,title:o(e.id)?N(jw)(o(e.id)):e.id,status:o(e.id)?.status},null,8,[`peek`,`label`,`title`,`status`]))),128)),s.value.length===0?(B(),V(`p`,JP,`沒有委派或交接關係。`)):K(``,!0)]),_:1},8,[`count`]),W(ID,{title:`服務的項目與條件`,count:l.value.length},{default:P(()=>[(B(!0),V(z,null,L(l.value,e=>(B(),H(Oj,{key:e.ref,peek:e.task,id:e.ref,title:e.text},{default:P(()=>[W(N(vE),{"model-value":e.done,disabled:``,class:`pointer-events-none`,"aria-label":e.done?`已完成`:`未完成`},null,8,[`model-value`,`aria-label`])]),_:2},1032,[`peek`,`id`,`title`]))),128))]),_:1},8,[`count`]),i.value?.unattributed.length?(B(),H(ID,{key:0,title:`沒有對應行動的使用`,count:i.value.unattributed.length},{default:P(()=>[(B(!0),V(z,null,L(u(i.value.unattributed),e=>(B(),V(`div`,{key:e.kind,class:`flex min-h-7 items-center gap-2 text-xs`},[U(`span`,YP,j(N(Xw)[e.kind]),1),U(`span`,XP,j(e.items.length),1)]))),128))]),_:1},8,[`count`])):K(``,!0)])):(B(),V(`p`,ZP,`這台電腦上沒有會話 `+j(e.id)+`。`,1))}}),$P={key:0,class:`pb-8`},eF={class:`truncate`},tF={key:0,class:`flex items-center gap-1.5`},nF={key:1},rF={key:2},iF={key:0,class:`text-xs`},aF={class:`text-xs`},oF={class:`text-xs`},sF={class:`text-xs`},cF={class:`shrink-0 font-mono`},lF={class:`truncate`},uF={key:0,class:`text-sm text-muted-foreground`},dF={key:1,class:`px-5 text-muted-foreground`},fF=I({__name:`TaskPeek`,props:{m:{},t:{}},setup(e){let t=e,{open:n}=FC(),{mainline:r}=eM(()=>t.m),i=J(()=>r.value?.tasks.find(e=>e.id===t.t)),a=J(()=>r.value?.tasks.filter(e=>e.parent===t.t)??[]),o=J(()=>(i.value?.checklist??[]).filter(e=>!e.dropped)),s=J(()=>Fw(t.m,t.t)),c=e=>n(e,{chain:!0}),l=J(()=>{let e=i.value?.blockedBy?.waitingFor,t=e?Vw(e):void 0;return t&&t!==`session`&&!e.startsWith(`file:`)?e:void 0});Er(()=>Rw([l.value]));let u=e=>e.slice((r.value?.dir.length??0)+1),d=e=>e.slice(e.lastIndexOf(`/`)+1),f=e=>i.value&&dw(()=>XC.taskStatus(t.m,t.t,e,i.value.version));return(n,p)=>i.value&&N(r)?(B(),V(`div`,$P,[W(MD,{id:`${e.m}/${i.value.id}`,title:i.value.title,type:N(Bw)(i.value),status:i.value.status},{notice:P(()=>[i.value.blockedBy?(B(),H(N(_g),{key:0,variant:`warning`},{default:P(()=>[W(N(ed)),W(N(yg),null,{default:P(()=>[G(`卡住:`+j(i.value.blockedBy.reason),1)]),_:1}),W(N(vg),{class:`text-xs text-muted-foreground`},{default:P(()=>[l.value?(B(),V(`p`,tF,[p[0]||=G(`等待 `,-1),W($j,q(N(Iw)(l.value),{onOpen:c}),null,16)])):i.value.blockedBy.waitingFor?(B(),V(`p`,nF,`等待 `+j(i.value.blockedBy.waitingFor),1)):K(``,!0),i.value.blockedBy.signal?(B(),V(`p`,rF,`看到「`+j(i.value.blockedBy.signal)+`」就可以繼續`,1)):K(``,!0)]),_:1})]),_:1})):K(``,!0)]),default:P(()=>[W(bP,{status:i.value.status,options:N(Gw),onChange:f},null,8,[`status`,`options`]),U(`span`,eF,j(N(r).title),1)]),_:1},8,[`id`,`title`,`type`,`status`]),W(ID,null,{default:P(()=>[W(QD,{columns:1},{default:P(()=>[W($,{label:`checklist`,icon:N(Pd)},{default:P(()=>[W(nP,{done:o.value.filter(e=>e.done).length,total:o.value.length},null,8,[`done`,`total`])]),_:1},8,[`icon`]),i.value.priority?(B(),H($,{key:0,label:`優先度`,icon:N(_d)},{default:P(()=>[W(TE,{priority:i.value.priority},null,8,[`priority`]),i.value.priority===`P2`?(B(),V(`span`,iF,`P2`)):K(``,!0)]),_:1},8,[`icon`])):K(``,!0),W($,{label:`種類`,icon:N(Ad)},{default:P(()=>[G(j(i.value.kind===`branch`?`分支`:`階段`),1)]),_:1},8,[`icon`]),i.value.parent?(B(),H($,{key:1,label:`上層任務`,icon:N(ld)},{default:P(()=>[W($j,q(N(Iw)(N(CC)(e.m,i.value.parent)),{onOpen:c}),null,16)]),_:1},8,[`icon`])):K(``,!0),i.value.repo?(B(),H($,{key:2,label:`倉庫`,icon:N(vd)},{default:P(()=>[G(j(i.value.repo),1)]),_:1},8,[`icon`])):K(``,!0),i.value.branch?(B(),H($,{key:3,label:`分支`,icon:N(Td)},{default:P(()=>[W(DD,{text:i.value.branch},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),i.value.base?(B(),H($,{key:4,label:`基底`,icon:N(Ed)},{default:P(()=>[W(DD,{text:i.value.base},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),i.value.worktree?(B(),H($,{key:5,label:`worktree`,icon:N(xd)},{default:P(()=>[W(DD,{text:i.value.worktree},null,8,[`text`])]),_:1},8,[`icon`])):K(``,!0),i.value.merge?(B(),H($,{key:6,label:`合併狀態`,icon:N(Dd)},{default:P(()=>[G(j(N($w)[i.value.merge]),1)]),_:1},8,[`icon`])):K(``,!0),i.value.category?(B(),H($,{key:7,label:`分類`,icon:N(nf)},{default:P(()=>[G(j(i.value.category),1)]),_:1},8,[`icon`])):K(``,!0),i.value.labels?.length?(B(),H($,{key:8,label:`標籤`,icon:N(rf)},{default:P(()=>[(B(!0),V(z,null,L(i.value.labels,e=>(B(),H(N(nE),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))]),_:1},8,[`icon`])):K(``,!0),W($,{label:`建立`,icon:N(Gu)},{default:P(()=>[U(`span`,aF,j(i.value.created),1)]),_:1},8,[`icon`]),i.value.startedAt?(B(),H($,{key:9,label:`開始`,icon:N(Wd)},{default:P(()=>[U(`span`,oF,j(i.value.startedAt),1)]),_:1},8,[`icon`])):K(``,!0),i.value.closedAt?(B(),H($,{key:10,label:`結束`,icon:N(Uu)},{default:P(()=>[U(`span`,sF,j(i.value.closedAt),1)]),_:1},8,[`icon`])):K(``,!0),i.value.resolution?(B(),H($,{key:11,label:`結果`,icon:N($u)},{default:P(()=>[G(j(i.value.resolution),1)]),_:1},8,[`icon`])):K(``,!0),i.value.origin?(B(),H($,{key:12,label:`來源`,icon:N(cd)},{default:P(()=>[W($j,q(N(Iw)(i.value.origin),{onOpen:c}),null,16)]),_:1},8,[`icon`])):K(``,!0)]),_:1})]),_:1}),W(ID,{title:`checklist`,count:i.value.checklist.length},{default:P(()=>[W(fN,{items:i.value.checklist,"ref-prefix":`${e.m}/${i.value.id}#`,version:i.value.version},null,8,[`items`,`ref-prefix`,`version`])]),_:1},8,[`count`]),i.value.body.trim()?(B(),H(ID,{key:0,title:`內文`},{default:P(()=>[W(Cj,{source:i.value.body},null,8,[`source`])]),_:1})):K(``,!0),i.value.artifacts.length?(B(),H(ID,{key:1,title:`產物`,count:i.value.artifacts.length},{default:P(()=>[(B(!0),V(z,null,L(i.value.artifacts,t=>(B(),H(Oj,{key:t,peek:N(EC)(e.m,u(t)),title:d(t)},null,8,[`peek`,`title`]))),128))]),_:1},8,[`count`])):K(``,!0),a.value.length?(B(),H(ID,{key:2,title:`子任務`,count:a.value.length},{default:P(()=>[(B(!0),V(z,null,L(a.value,t=>(B(),H(Oj,{key:t.id,peek:N(CC)(e.m,t.id),id:t.id,title:t.title,status:t.status},null,8,[`peek`,`id`,`title`,`status`]))),128))]),_:1},8,[`count`])):K(``,!0),W(Rj,{self:N(CC)(t.m,t.t),links:i.value.links},null,8,[`self`,`links`]),i.value.refs?.length?(B(),H(ID,{key:3,title:`參考來源`,count:i.value.refs.length},{default:P(()=>[W(Uj,{refs:i.value.refs},null,8,[`refs`])]),_:1},8,[`count`])):K(``,!0),W(ID,{title:`服務它的行動`,count:s.value.reduce((e,t)=>e+t.actions.length,0)},{default:P(()=>[(B(!0),V(z,null,L(s.value,({session:e,actions:t})=>(B(),V(z,{key:e.id},[W(Oj,{peek:N(TC)(e.id),title:N(jw)(e),status:e.status},null,8,[`peek`,`title`,`status`]),(B(!0),V(z,null,L(t,e=>(B(),V(`div`,{key:e.id,class:`flex min-h-7 items-center gap-2 pl-6 text-xs text-muted-foreground`},[W(OE,{status:e.status,class:`shrink-0`},null,8,[`status`]),U(`span`,cF,j(e.id),1),U(`span`,lF,j(e.do),1)]))),128))],64))),128)),s.value.length===0?(B(),V(`p`,uF,`這台電腦上沒有服務這個任務的行動。`)):K(``,!0)]),_:1},8,[`count`])])):(B(),V(`p`,dF,`載入 `+j(e.m)+`/`+j(e.t)+`…`,1))}}),pF={class:`flex h-11 shrink-0 items-center gap-1 px-2`},mF={key:0,class:`truncate text-xs text-muted-foreground`},hF={key:1,class:`ml-2 text-xs text-status-done`,role:`status`},gF={class:`min-h-0 flex-1 overflow-auto`},_F=`mainflow.panelWidth`,vF=360,yF=1200,bF=lT(I({__name:`PeekPanel`,setup(e){let{current:t,trail:n,full:r,back:i,close:a,toggleFull:o}=FC(),s=Number($C(_F,880)),c=M(s>=vF&&s<=yF?s:880);function l(e){let t=e.clientX,n=c.value,r=e=>c.value=Math.min(yF,Math.max(vF,n+t-e.clientX)),i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i),ew(_F,c.value)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)}let u=J(()=>{let e=AC(n.value.at(-1));return e?e.kind===`session`?`會話`:e.kind===`file`?e.path.split(`/`).at(-1):e.kind===`conflict`?`存檔`:e.ref:``});return(e,s)=>N(t)?(B(),V(`aside`,{key:0,class:k([`peek-panel flex min-h-0 flex-col border-l bg-background max-[1100px]:shadow-lg`,N(r)?`flex-1`:`shrink-0`]),style:he({"--panel-width":`${c.value}px`}),"aria-label":`預覽面板`},[N(r)?K(``,!0):(B(),V(`div`,{key:0,class:`absolute inset-y-0 -left-1 w-2 cursor-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`拖曳調整面板寬度`,onPointerdown:au(l,[`prevent`])},null,32)),U(`div`,pF,[W(N(sC),{variant:`ghost`,size:`icon-sm`,disabled:!N(n).length,"aria-label":`上一步`,title:`上一步`,onClick:N(i)},{default:P(()=>[W(N(Yu))]),_:1},8,[`disabled`,`onClick`]),u.value?(B(),V(`span`,mF,`回到 `+j(u.value),1)):K(``,!0),N(jC)?(B(),V(`span`,hF,j(N(jC)),1)):K(``,!0),s[0]||=U(`span`,{class:`ml-auto`},null,-1),W(N(sC),{variant:`ghost`,size:`icon-sm`,"aria-label":N(r)?`回到並排`:`開成整頁`,title:N(r)?`回到並排`:`開成整頁`,onClick:N(o)},{default:P(()=>[N(r)?(B(),H(N(Bd),{key:0})):(B(),H(N(Rd),{key:1}))]),_:1},8,[`aria-label`,`title`,`onClick`]),W(N(sC),{variant:`ghost`,size:`icon-sm`,"aria-label":`關閉(Esc)`,title:`關閉(Esc)`,onClick:N(a)},{default:P(()=>[W(N(uf))]),_:1},8,[`onClick`])]),U(`div`,gF,[N(t).kind===`task`?(B(),H(fF,{key:N(t).ref,m:N(t).m,t:N(t).t},null,8,[`m`,`t`])):N(t).kind===`decision`?(B(),H(uM,{key:N(t).ref,m:N(t).m,d:N(t).d},null,8,[`m`,`d`])):N(t).kind===`file`?(B(),H(LM,{key:N(t).ref,m:N(t).m,path:N(t).path},null,8,[`m`,`path`])):N(t).kind===`session`?(B(),H(QP,{key:N(t).ref,id:N(t).id},null,8,[`id`])):N(t).kind===`mainline`?(B(),H(CP,{key:N(t).ref,m:N(t).m},null,8,[`m`])):N(t).kind===`issue`?(B(),H(QN,{key:N(t).ref,id:N(t).id},null,8,[`id`])):N(t).kind===`conflict`?(B(),H(ZD,{key:N(t).ref,saved:N(t).saved},null,8,[`saved`])):N(t).kind===`group`?(B(),H(GN,{key:N(t).ref,id:N(t).id},null,8,[`id`])):(B(),H(UM,{key:N(t).ref,id:N(t).id},null,8,[`id`]))])],6)):K(``,!0)}}),[[`__scopeId`,`data-v-d9c80ff7`]]),xF={class:`flex h-full min-h-0 flex-col`},SF={class:`relative flex min-h-0 flex-1`},CF={class:`@container min-w-0 flex-1 overflow-auto`,"data-peek-list":``},wF=I({__name:`PageLayout`,setup(e){let{current:t,full:n}=FC();return(e,r)=>(B(),V(`div`,xF,[R(e.$slots,`header`),U(`div`,SF,[yr(U(`div`,CF,[R(e.$slots,`default`)],512),[[Vc,!(N(t)&&N(n))]]),W(bF)])]))}});function TF(e,t){let n=Qt(new Set),r=e.spec.id,i=t=>[...t.leader?[t.leader]:[],...t.items,...t.ended].flatMap(t=>[t,...(e.spec.nested?.(t)??[]).map(e=>e.item)]),a=J(()=>[...new Map(e.groups.value.flatMap(i).map(e=>[r(e),e])).values()]);F(a,e=>{let t=new Set(e.map(r));for(let e of n)t.has(e)||n.delete(e)});let o=J(()=>a.value.filter(e=>n.has(r(e)))),s=e=>{let t=e.filter(e=>n.has(r(e))).length;return t===0?!1:t===e.length||`indeterminate`},c=(e,t)=>e.forEach(e=>t?n.add(r(e)):n.delete(r(e)));async function l(e){let i=o.value.filter(n=>t.archived(n)!==e).map(r);i.length&&await dw(async()=>{let n=await XC.archiveMany(t.kind,i,e);if(n.failed.length)throw Error(`${n.failed.length} 個沒有${e?`封存`:`取消封存`}:${n.failed.map(e=>`${e.id}(${e.error})`).join(`、`)}`)})&&n.clear()}return{selected:o,active:J(()=>o.value.length>0),all:J(()=>s(a.value)),groupChecked:e=>s(i(e)),has:e=>n.has(r(e)),toggle:(e,t)=>c([e],t),setAll:e=>c(a.value,e),setGroup:(e,t)=>c(i(e),t),clear:()=>n.clear(),archivable:J(()=>o.value.filter(e=>!t.archived(e)).length),restorable:J(()=>o.value.filter(e=>t.archived(e)).length),setArchived:l}}var EF={key:0,class:`shrink-0 text-xs text-muted-foreground`},DF=[`title`],OF=I({__name:`FindingList`,setup(e){let t=[`valid`,`obsolete`],n=DN({key:`findings`,id:e=>e.id,text:e=>e.title,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:hN(t)},{key:`category`,label:`分類`,values:e=>e.category?[e.category]:[]},{key:`label`,label:`標籤`,values:e=>e.labels??[]},{key:`applies`,label:`適用範圍`,values:e=>e.appliesTo??[]}],sorts:[{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`applies`,label:`適用範圍`,value:e=>e.appliesTo?.join(`、`),dir:`asc`},{key:`created`,label:`建立`,value:e=>e.created,dir:`desc`},{key:`review`,label:`重新確認日`,value:e=>e.reviewAfter,dir:`asc`}],groups:[yN(t),{key:`category`,label:`分類`,value:e=>e.category??`未分類`}],defaultSort:`created`,defaultGroup:`status`,ended:e=>gN(e.status),archived:e=>!!e.archivedAt},()=>Q.findings),r=TF(n,{kind:`finding`,archived:e=>!!e.archivedAt}),i=[{key:`name`,label:`名稱`,sort:`name`},{key:`applies`,label:`適用範圍`,class:`max-w-72 truncate font-mono text-xs text-muted-foreground`,sort:`applies`,value:e=>e.appliesTo,optional:!0},{key:`review`,label:`重新確認`,sort:`review`,value:e=>e.reviewAfter}],a=e=>dw(()=>XC.archiveFinding(e.id,!e.archivedAt,e.version));return(e,t)=>(B(),H(wF,null,{header:P(()=>[W(CD,{title:`發現`,description:`踩過的坑與經驗。下一個任務動手前先看這裡。`}),W(uD,{view:N(n)},null,8,[`view`])]),default:P(()=>[W(eD,{view:N(n),selection:N(r),columns:i,"item-ref":e=>e.id},{name:P(({item:e})=>[W(yD,{status:e.status,id:e.id,title:e.title,muted:!!e.archivedAt},{default:P(()=>[(B(!0),V(z,null,L(e.labels??[],e=>(B(),H(N(nE),{key:e,variant:`secondary`,class:`shrink-0`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128)),e.archivedAt?(B(),V(`span`,EF,`已封存`)):K(``,!0)]),_:2},1032,[`status`,`id`,`title`,`muted`])]),applies:P(({item:e})=>[U(`span`,{title:e.appliesTo?.join(`
|
|
81
|
+
`)},j(e.appliesTo?.join(`、`)),9,DF)]),review:P(({item:e})=>[W(_E,{day:e.reviewAfter,ended:e.status===`obsolete`},null,8,[`day`,`ended`])]),actions:P(({item:e})=>[W(iE,{archived:!!e.archivedAt,onToggle:t=>a(e)},null,8,[`archived`,`onToggle`])]),empty:P(()=>[...t[0]||=[G(`還沒有發現。用 `,-1),U(`code`,null,`mainflow new finding <slug> --title <title>`,-1),G(` 記下來。`,-1)]]),_:1},8,[`view`,`selection`,`item-ref`]),W(gD,{selection:N(r)},null,8,[`selection`])]),_:1}))}}),kF=e=>(e.plannedIn??e.origin??``).match(/^m\d{3}/)?.[0]??``,AF=e=>e?`${e} ${Q.summary?.mainlines.find(t=>t.id===e)?.title??``}`.trim():`不屬於主脈絡`,jF=`未分類`,MF=`沒有標籤`,NF=e=>e.labels?.length?e.labels:[MF],PF=e=>[{key:`status`,label:`狀態`,values:e=>[e.status],options:hN(e)},{key:`priority`,label:`優先度`,values:e=>[mN(e.priority)],options:pN},{key:`category`,label:`分類`,values:e=>e.category?[e.category]:[]},{key:`label`,label:`標籤`,values:e=>e.labels??[]},{key:`mainline`,label:`來源主脈絡`,values:e=>[kF(e)].filter(Boolean),optionLabel:AF},PN(e=>e.group)],FF=e=>[yN(e),{key:`category`,label:`分類`,value:e=>e.category??jF,trailing:[jF]},{key:`label`,label:`標籤`,value:e=>NF(e)[0],values:NF,trailing:[MF]},{key:`priority`,label:`優先度`,value:e=>mN(e.priority),order:[`P0`,`P1`,`P2`,`P3`]},{key:`mainline`,label:`主脈絡`,value:kF,groupLabel:AF,trailing:[``]},NN(e=>e.group)],IF={key:0,class:`shrink-0 text-xs text-muted-foreground`},LF=I({__name:`IssueList`,setup(e){let t=[`open`,`planned`,`closed`],n=DN({key:`issues`,id:e=>e.id,text:e=>e.title,filters:PF(t),sorts:[{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`planned`,label:`排入`,value:e=>e.plannedIn,dir:`asc`},{key:`origin`,label:`來源`,value:e=>e.origin,dir:`asc`},{key:`order`,label:`手動順序`,value:e=>e.order,dir:`asc`},{key:`priority`,label:`優先度`,value:e=>mN(e.priority),dir:`asc`},{key:`due`,label:`到期`,value:e=>e.due,dir:`asc`},{key:`created`,label:`建立`,value:e=>e.created,dir:`desc`}],groups:FF(t),defaultSort:`order`,defaultGroup:`status`,ended:e=>gN(e.status),archived:e=>!!e.archivedAt},()=>Q.issues),r=TF(n,{kind:`issue`,archived:e=>!!e.archivedAt}),i=[{key:`name`,label:`名稱`,sort:`name`},{key:`priority`,label:`優先度`,sort:`priority`},{key:`due`,label:`到期`,sort:`due`,value:e=>e.due},{key:`planned`,label:`排入`,class:`max-w-56`,sort:`planned`,value:e=>e.plannedIn},{key:`origin`,label:`來源`,class:`max-w-56`,sort:`origin`,value:e=>e.origin,optional:!0}],{open:a}=FC();Er(()=>Rw(Q.issues.flatMap(e=>[e.plannedIn,e.origin])));let o=e=>dw(()=>XC.archiveIssue(e.id,!e.archivedAt,e.version));return(e,t)=>(B(),H(wF,null,{header:P(()=>[W(CD,{title:`待辦事項`,description:`跨主脈絡的後續事項。主脈絡結束或封存後仍留在這裡。`}),W(uD,{view:N(n)},null,8,[`view`])]),default:P(()=>[W(eD,{view:N(n),selection:N(r),columns:i,"item-ref":e=>e.id},{name:P(({item:e})=>[W(yD,{status:e.status,id:e.id,title:e.title,muted:!!e.archivedAt},{default:P(()=>[e.archivedAt?(B(),V(`span`,IF,`已封存`)):K(``,!0)]),_:2},1032,[`status`,`id`,`title`,`muted`])]),priority:P(({item:e})=>[W(TE,{priority:e.priority},null,8,[`priority`])]),due:P(({item:e})=>[W(_E,{day:e.due,ended:e.status===`closed`},null,8,[`day`,`ended`])]),planned:P(({item:e})=>[e.plannedIn?(B(),H($j,q({key:0},N(Iw)(e.plannedIn),{onOpen:N(a)}),null,16,[`onOpen`])):K(``,!0)]),origin:P(({item:e})=>[e.origin?(B(),H($j,q({key:0},N(Iw)(e.origin),{onOpen:N(a)}),null,16,[`onOpen`])):K(``,!0)]),actions:P(({item:e})=>[W(iE,{archived:!!e.archivedAt,onToggle:t=>o(e)},null,8,[`archived`,`onToggle`])]),empty:P(()=>[...t[0]||=[G(`沒有待辦事項。用 `,-1),U(`code`,null,`mainflow new issue <slug> --title <title>`,-1),G(` 記下主脈絡結束後還要處理的事。`,-1)]]),_:1},8,[`view`,`selection`,`item-ref`]),W(gD,{selection:N(r)},null,8,[`selection`])]),_:1}))}}),RF=I({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=F_(Sf(n,`class`),r);return(e,t)=>(B(),H(N(nC),q({"data-slot":`tabs`},N(i),{class:N(gg)(`flex flex-col gap-2`,n.class)}),{default:P(t=>[R(e.$slots,`default`,A(Cs(t)))]),_:3},16,[`class`]))}}),zF=I({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default:`default`}},setup(e){let t=e,n=Sf(t,`class`,`variant`);return(r,i)=>(B(),H(N(aC),q({"data-slot":`tabs-list`,"data-variant":e.variant},N(n),{class:N(gg)(`group/tabs-list text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-0.75`,e.variant===`line`?`gap-1 rounded-none bg-transparent p-0`:`bg-muted`,t.class)}),{default:P(()=>[R(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),BF=I({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=P_(Sf(t,`class`));return(e,r)=>(B(),H(N(oC),q({"data-slot":`tabs-trigger`,class:N(gg)(`data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-3 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:text-foreground/60 group-data-[variant=line]/tabs-list:hover:text-foreground group-data-[variant=line]/tabs-list:data-[state=active]:text-foreground group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-foreground after:opacity-0 after:transition-opacity group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,t.class)},N(n)),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`class`]))}}),VF={class:`w-full text-body`},HF={colspan:`3`,class:`sticky top-9 z-[5] bg-background px-6 pt-4 pb-1`},UF={class:`flex items-center gap-2 text-sm`},WF={key:0,class:`grid size-4 shrink-0 place-items-center rounded-[4px] border border-dashed text-[10px] text-muted-foreground`,"aria-label":`已不需要`},GF={class:`font-mono text-xs text-muted-foreground`},KF=[`title`],qF={key:1,class:`font-medium text-muted-foreground`},JF={class:`flex min-w-0 items-center gap-2`},YF={class:`shrink-0 font-mono text-xs text-muted-foreground`},XF=[`title`],ZF={class:`flex min-w-0 items-center gap-2 text-xs`},QF={class:`truncate`},$F={key:0},eI={colspan:`3`,class:`px-6 pb-2 text-xs text-muted-foreground`},tI={key:1},nI={key:0,class:`px-6 py-16 text-center text-sm text-muted-foreground`},rI=I({__name:`CriteriaView`,props:{mainline:{}},setup(e){let t=e,{open:n,current:r}=FC(),i=J(()=>t.mainline.tasks.flatMap(e=>e.checklist.filter(e=>!e.dropped).map(t=>({task:e,item:t})))),a=J(()=>[...t.mainline.criteria.map(e=>({key:e.id,criterion:e,rows:i.value.filter(t=>t.item.serves?.includes(e.id))})),{key:``,criterion:void 0,rows:i.value.filter(e=>!e.item.serves?.length)}].filter(e=>e.criterion||e.rows.length)),o=e=>r.value?.ref===e||void 0;return(t,r)=>(B(),V(z,null,[U(`table`,VF,[W(N(CE),{class:`sticky top-0 z-10 bg-background [&_tr]:border-b`},{default:P(()=>[W(N(xE),{class:`hover:bg-transparent`},{default:P(()=>[W(N(SE),{class:`pl-6`},{default:P(()=>[...r[0]||=[G(`checklist 項目`,-1)]]),_:1}),W(N(SE),{class:`w-72`},{default:P(()=>[...r[1]||=[G(`任務`,-1)]]),_:1}),W(N(SE),{class:`w-28 pr-6`},{default:P(()=>[...r[2]||=[G(`完成`,-1)]]),_:1})]),_:1})]),_:1}),(B(!0),V(z,null,L(a.value,t=>(B(),H(N(yE),{key:t.key,class:`[&_tr:last-child]:border-b`},{default:P(()=>[U(`tr`,null,[U(`td`,HF,[U(`div`,UF,[t.criterion?(B(),V(z,{key:0},[t.criterion.dropped?(B(),V(`span`,WF,`–`)):(B(),H(N(vE),{key:1,"model-value":t.criterion.done,disabled:``,class:`pointer-events-none`,"aria-label":t.criterion.done?`已達成`:`未達成`},null,8,[`model-value`,`aria-label`])),U(`span`,GF,j(t.criterion.id),1),U(`span`,{class:k([`min-w-0 truncate font-medium`,{"text-muted-foreground line-through":t.criterion.dropped}]),title:t.criterion.text},j(t.criterion.text),11,KF),t.criterion.dropped?K(``,!0):(B(),H(nP,{key:2,class:`ml-auto shrink-0`,done:t.rows.filter(e=>e.item.done).length,total:t.rows.length},null,8,[`done`,`total`]))],64)):(B(),V(`span`,qF,`沒有推進任何解決條件`))])])]),(B(!0),V(z,null,L(t.rows,t=>(B(),H(N(xE),{key:`${t.task.id}#${t.item.id}`,class:`h-9 transition-colors duration-[120ms]`,"data-peek":N(CC)(e.mainline.id,t.task.id),"aria-current":o(N(CC)(e.mainline.id,t.task.id)),onClick:r=>N(n)(N(CC)(e.mainline.id,t.task.id))},{default:P(()=>[W(N(bE),{class:`max-w-0 pl-6`},{default:P(()=>[U(`span`,JF,[U(`span`,YF,j(t.task.id)+`#`+j(t.item.id),1),U(`span`,{class:k([`truncate`,{"text-muted-foreground":t.item.done}]),title:t.item.text},j(t.item.text),11,XF)])]),_:2},1024),W(N(bE),{class:`max-w-72`},{default:P(()=>[U(`span`,ZF,[W(nT,{type:N(Bw)(t.task),status:t.task.status},null,8,[`type`,`status`]),U(`span`,QF,j(t.task.title),1)])]),_:2},1024),W(N(bE),{class:`pr-6 text-xs text-muted-foreground`},{default:P(()=>[G(j(t.item.done?t.item.doneAt??`已完成`:``),1)]),_:2},1024)]),_:2},1032,[`data-peek`,`aria-current`,`onClick`]))),128)),t.criterion?.dropped?(B(),V(`tr`,$F,[U(`td`,eI,[r[3]||=G(`不再需要`,-1),t.criterion.note?(B(),V(z,{key:0},[G(`:`+j(t.criterion.note),1)],64)):K(``,!0)])])):t.criterion&&t.rows.length===0?(B(),V(`tr`,tI,[...r[4]||=[U(`td`,{colspan:`3`,class:`px-6 pb-2 text-xs text-muted-foreground`},`還沒有 checklist 項目推進這條條件。`,-1)]])):K(``,!0)]),_:2},1024))),128))]),a.value.length===0?(B(),V(`p`,nI,`這條主脈絡還沒有解決條件。`)):K(``,!0)],64))}}),iI={key:0,class:`shrink-0 text-xs text-muted-foreground`},aI=[`title`],oI=I({__name:`DecisionTable`,props:{mainline:{}},setup(e){let t=e,n=[`proposed`,`accepted`,`superseded`],r=DN({key:`decisions`,id:e=>e.id,text:e=>e.title,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:hN(n)},{key:`by`,label:`決策者`,values:e=>e.by?[e.by]:[],optionLabel:e=>Zw[e]??e},{key:`basis`,label:`裁決方式`,values:e=>e.basis?[e.basis]:[],optionLabel:e=>Qw[e]??e}],sorts:[{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`by`,label:`決策者`,value:e=>e.by,dir:`asc`},{key:`reversible`,label:`能否改回`,value:e=>e.reversible===void 0?null:+!!e.reversible,dir:`desc`},{key:`created`,label:`建立`,value:e=>cE(e.created),dir:`desc`},{key:`decided`,label:`裁決時間`,value:e=>e.decidedAt?cE(e.decidedAt):void 0,dir:`desc`}],groups:[yN(n)],defaultSort:`created`,defaultGroup:`status`,ended:e=>gN(e.status)},()=>t.mainline.decisions),i=[{key:`name`,label:`名稱`,sort:`name`},{key:`by`,label:`決策者`,class:`text-xs text-muted-foreground`,sort:`by`,value:e=>e.by},{key:`basis`,label:`裁決方式`,class:`text-xs text-muted-foreground`,value:e=>e.basis},{key:`decided`,label:`裁決`,class:`font-mono text-xs text-muted-foreground tabular-nums`,sort:`decided`,value:e=>e.decidedAt},{key:`affects`,label:`影響`,class:`max-w-56 truncate font-mono text-xs text-muted-foreground`,value:e=>e.affects,optional:!0},{key:`reversible`,label:`能否改回`,class:`text-xs text-muted-foreground`,sort:`reversible`,value:e=>e.reversible,optional:!0}];return(t,n)=>(B(),V(z,null,[W(uD,{view:N(r)},null,8,[`view`]),W(eD,{view:N(r),columns:i,"item-ref":t=>N(wC)(e.mainline.id,t.id)},{name:P(({item:e})=>[W(yD,{status:e.status,id:e.id,title:e.title,muted:e.status===`superseded`},{default:P(()=>[e.supersededBy?(B(),V(`span`,iI,`由 `+j(e.supersededBy)+` 取代`,1)):K(``,!0)]),_:2},1032,[`status`,`id`,`title`,`muted`])]),by:P(({item:e})=>[G(j(e.by?N(Zw)[e.by]:``),1)]),basis:P(({item:e})=>[G(j(e.basis?N(Qw)[e.basis]:``),1)]),decided:P(({item:e})=>[G(j(e.decidedAt?N(fE)(e.decidedAt):``),1)]),affects:P(({item:e})=>[U(`span`,{title:e.affects?.join(`
|
|
82
|
+
`)},j(e.affects?.join(`、`)),9,aI)]),reversible:P(({item:e})=>[G(j(e.reversible===void 0?``:e.reversible?`可以`:`不易改回`),1)]),empty:P(()=>[n[0]||=G(`還沒有決策。用 `,-1),U(`code`,null,`mainflow new decision `+j(e.mainline.id)+` <slug> --title <title>`,1),n[1]||=G(` 記下選擇與理由。`,-1)]),_:1},8,[`view`,`item-ref`])],64))}}),sI={class:`flex min-w-0 items-center gap-2`},cI=[`href`,`title`],lI=[`title`],uI={key:0,class:`whitespace-nowrap`},dI=[`title`],fI=`-`,pI=I({__name:`FilesView`,props:{mainline:{}},setup(e){let t=e,n=J(()=>DM(t.mainline)),r=e=>{let n=t.mainline.tasks.find(t=>t.id===e)??t.mainline.decisions.find(t=>t.id===e);return n?`${e} ${n.title}`:e===fI||!e?`主脈絡本身`:e},i=DN({key:`files`,id:e=>e.key,text:e=>`${e.name} ${e.path??``}`,filters:[{key:`kind`,label:`類型`,values:e=>[e.kind],options:wM.map(e=>({value:e,label:e}))},{key:`source`,label:`來源`,values:e=>[e.source??fI],optionLabel:r},{key:`ext`,label:`副檔名`,values:e=>e.ext?[e.ext]:[],optionLabel:e=>`.${e}`}],sorts:[{key:`kind`,label:`類型`,value:e=>wM.indexOf(e.kind),dir:`asc`},{key:`name`,label:`檔名`,value:e=>e.name,dir:`asc`},{key:`updated`,label:`更新`,value:e=>e.updated,dir:`desc`},{key:`source`,label:`來源`,value:e=>e.source,dir:`asc`}],groups:[{key:`kind`,label:`類型`,value:e=>e.kind,order:wM},{key:`source`,label:`來源`,value:e=>e.source??fI,groupLabel:r}],defaultSort:`kind`,defaultGroup:`kind`},()=>n.value),a=[{key:`name`,label:`檔名`,sort:`name`},{key:`kind`,label:`類型`,class:`text-xs text-muted-foreground`,sort:`kind`},{key:`source`,label:`來源`,class:`max-w-64 truncate text-xs text-muted-foreground`,sort:`source`,value:e=>e.source,optional:!0},{key:`updated`,label:`更新`,class:`text-xs text-muted-foreground`,sort:`updated`,value:e=>e.updated}],o=e=>e.inMainline?EC(t.mainline.id,e.inMainline):void 0;return(e,t)=>(B(),V(z,null,[W(uD,{view:N(i)},null,8,[`view`]),W(eD,{view:N(i),columns:a,"item-ref":o},{name:P(({item:e})=>[U(`span`,sI,[W(nT,{type:N(Uw)(e.url??e.key,e.kind)},null,8,[`type`]),e.url?(B(),V(`a`,{key:0,href:e.url,target:`_blank`,rel:`noreferrer`,class:`truncate underline decoration-border underline-offset-4 hover:decoration-foreground`,title:e.url,onClick:t[0]||=au(()=>{},[`stop`])},j(e.name),9,cI)):(B(),V(`span`,{key:1,class:k([`truncate`,{"font-mono text-xs":e.inMainline}]),title:e.inMainline??e.path},j(e.name),11,lI)),e.remoteOnly?(B(),H(N(ad),{key:2,class:`size-3.5 shrink-0 text-muted-foreground`,"aria-label":`只在伺服器上`,title:`只在同步伺服器上,點開時下載`})):K(``,!0),e.path?(B(),H(DD,{key:3,text:e.path,class:`min-w-0`},null,8,[`text`])):K(``,!0)])]),kind:P(({item:e})=>[G(j(e.kind),1),e.remoteOnly?(B(),V(`span`,uI,`・只在伺服器上`)):K(``,!0)]),source:P(({item:e})=>[U(`span`,{title:r(e.source??``)},j(e.source?r(e.source):``),9,dI)]),updated:P(({item:e})=>[e.updated?(B(),H(TP,{key:0,at:e.updated},null,8,[`at`])):K(``,!0)]),empty:P(()=>[...t[1]||=[G(`這條主脈絡還沒有檔案。`,-1)]]),_:1},8,[`view`])],64))}}),mI=I({__name:`Card`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(`div`,{"data-slot":`card`,class:k(N(gg)(`bg-card text-card-foreground flex flex-col gap-4 rounded-xl border py-4 shadow-sm`,t.class))},[R(e.$slots,`default`)],2))}}),hI={class:`inline-flex gap-1.5 font-mono text-xs`},gI=[`title`],_I=I({__name:`DepList`,props:{deps:{},within:{}},setup(e){let t=e,n=e=>t.within&&e.startsWith(`${t.within}/`)?e.slice(t.within.length+1):e;return(t,r)=>(B(),V(`span`,hI,[(B(!0),V(z,null,L(e.deps,e=>(B(),V(`span`,{key:e.to,class:k(N(eT)[e.state].tone),title:`${e.to} ${N(eT)[e.state].label}`},j(n(e.to)),11,gI))),128))]))}}),vI={class:`flex items-center rounded-md border p-0.5`,role:`group`,"aria-label":`任務排列`},yI={key:0,class:`flex min-h-0 gap-3 overflow-x-auto px-6 pt-2 pb-6`},bI=[`aria-label`],xI={class:`flex items-center gap-2 py-1`},SI={class:`text-xs text-muted-foreground tabular-nums`},CI={class:`flex items-center gap-2 text-xs`},wI={class:`font-mono text-muted-foreground`},TI={class:`line-clamp-2 [overflow-wrap:anywhere]`},EI={class:`flex items-center justify-between gap-2`},DI={key:0,class:`min-w-0 truncate text-xs text-muted-foreground`},OI={key:0,class:`py-2 text-xs text-muted-foreground`},kI=[`title`],AI=`mainflow.list.tasks.mode`,jI=I({__name:`TaskViews`,props:{mainline:{}},setup(e){let t=e,n=[{key:`table`,label:`表格`,icon:Jd},{key:`board`,label:`看板`,icon:od},{key:`tree`,label:`樹狀`,icon:Ld}],r=$C(AI,`table`),i=M(n.some(e=>e.key===r)?r:`table`);function a(e){i.value=e,ew(AI,e)}let o=()=>t.mainline.tasks,s=J(()=>new Map(t.mainline.tasks.map(e=>[e.id,e])));function c(e){let t=e;for(;t?.kind===`branch`&&t.parent;)t=s.value.get(t.parent);return t?.id??e.id}let l=e=>e.checklist.filter(e=>e.done).length,u={id:e=>e.id,text:e=>`${e.title} ${e.branch??``}`,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:hN(Gw)},{key:`priority`,label:`優先度`,values:e=>[mN(e.priority)],options:pN},{key:`repo`,label:`倉庫`,values:e=>e.repo?[e.repo]:[]},{key:`kind`,label:`種類`,values:e=>[e.kind],options:[{value:`phase`,label:`階段`},{value:`branch`,label:`分支`}]},{key:`label`,label:`標籤`,values:e=>e.labels??[]}]},d=DN({...u,key:`tasks`,sorts:[{key:`order`,label:`手動順序`,value:e=>e.order??Number(e.id.slice(1)),dir:`asc`},{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`repo`,label:`倉庫`,value:e=>e.repo,dir:`asc`},{key:`depends`,label:`依賴`,value:e=>b(e)[0]?.to,dir:`asc`},{key:`branch`,label:`分支`,value:e=>e.branch,dir:`asc`},{key:`status`,label:`狀態`,value:e=>Gw.indexOf(e.status),dir:`asc`},{key:`priority`,label:`優先度`,value:e=>mN(e.priority),dir:`asc`},{key:`progress`,label:`checklist 進度`,value:e=>e.checklist.length?l(e)/e.checklist.length:null,dir:`desc`}],groups:[{key:`phase`,label:`階段`,value:c,groupLabel:e=>s.value.get(e)?.title??e,status:e=>s.value.get(e)?.status,leader:e=>s.value.get(e)},yN(Gw),{key:`repo`,label:`倉庫`,value:e=>e.repo??`沒有指定倉庫`}],defaultSort:`order`,defaultGroup:`status`,ended:e=>gN(e.status)},o),f=e=>t.mainline.tasks.filter(t=>t.parent===e).sort((e,t)=>(e.order??1/0)-(t.order??1/0)||e.id.localeCompare(t.id)),p=(e,t=1)=>f(e.id).flatMap(e=>[{item:e,depth:t},...p(e,t+1)]),m=DN({...u,key:`tasks`,sorts:[{key:`order`,label:`手動順序`,value:e=>e.order??Number(e.id.slice(1)),dir:`asc`}],groups:[],defaultSort:`order`,defaultGroup:``,nested:e=>p(e)},()=>t.mainline.tasks.filter(e=>!e.parent||!s.value.has(e.parent))),h=J(()=>Gw.map(e=>({status:e,tasks:d.sorted.value.filter(t=>t.status===e)}))),g=[{key:`name`,label:`名稱`,sort:`name`},{key:`priority`,label:`優先度`,sort:`priority`},{key:`progress`,label:`checklist`,sort:`progress`,value:e=>e.checklist.length},{key:`repo`,label:`倉庫`,class:`text-xs text-muted-foreground`,sort:`repo`,value:e=>e.repo},{key:`depends`,label:`依賴`,sort:`depends`,value:e=>b(e),optional:!0},{key:`branch`,label:`分支`,class:`max-w-56 truncate font-mono text-xs text-muted-foreground`,sort:`branch`,value:e=>e.branch,optional:!0}],{open:_,current:v}=FC(),y=e=>CC(t.mainline.id,e.id);function b(e){return Q.relations.deps.filter(t=>t.from===y(e))}return(t,r)=>(B(),V(z,null,[W(uD,{view:i.value===`tree`?N(m):N(d),grouping:i.value===`table`},{views:P(()=>[U(`div`,vI,[(B(),V(z,null,L(n,e=>W(N(sC),{key:e.key,variant:i.value===e.key?`secondary`:`ghost`,size:`xs`,"aria-pressed":i.value===e.key,onClick:t=>a(e.key)},{default:P(()=>[(B(),H(fa(e.icon))),G(j(e.label),1)]),_:2},1032,[`variant`,`aria-pressed`,`onClick`])),64))])]),_:1},8,[`view`,`grouping`]),i.value===`board`?(B(),V(`div`,yI,[(B(!0),V(z,null,L(h.value,e=>(B(),V(`section`,{key:e.status,class:`flex w-64 shrink-0 flex-col gap-2`,"aria-label":N(Yw)[e.status]},[U(`div`,xI,[W(kE,{status:e.status},null,8,[`status`]),U(`span`,SI,j(e.tasks.length),1)]),(B(!0),V(z,null,L(e.tasks,e=>(B(),H(N(mI),{key:e.id,class:k([`min-w-0 cursor-pointer gap-2 p-3 shadow-xs transition-colors duration-[120ms] hover:bg-accent/50`,{"bg-muted":N(v)?.ref===y(e)}]),"data-peek":y(e),"aria-current":N(v)?.ref===y(e)||void 0,onClick:t=>N(_)(y(e))},{default:P(()=>[U(`div`,CI,[W(nT,{type:N(Bw)(e),status:e.status},null,8,[`type`,`status`]),U(`span`,wI,j(e.id),1),W(TE,{priority:e.priority},null,8,[`priority`])]),U(`p`,TI,j(e.title),1),U(`div`,EI,[W(nP,{done:l(e),total:e.checklist.length},null,8,[`done`,`total`]),e.repo?(B(),V(`span`,DI,j(e.repo),1)):K(``,!0)])]),_:2},1032,[`class`,`data-peek`,`aria-current`,`onClick`]))),128)),e.tasks.length===0?(B(),V(`p`,OI,`沒有任務`)):K(``,!0)],8,bI))),128))])):(B(),H(eD,{key:1,view:i.value===`tree`?N(m):N(d),columns:g,"item-ref":y,"item-type":N(Bw)},{name:P(({item:e,depth:t})=>[W(yD,{status:e.status,id:e.id,title:e.title,depth:t,type:N(Bw)(e)},null,8,[`status`,`id`,`title`,`depth`,`type`])]),priority:P(({item:e})=>[W(TE,{priority:e.priority},null,8,[`priority`])]),progress:P(({item:e})=>[W(nP,{done:l(e),total:e.checklist.length},null,8,[`done`,`total`])]),repo:P(({item:e})=>[G(j(e.repo),1)]),depends:P(({item:t})=>[W(_I,{deps:b(t),within:e.mainline.id},null,8,[`deps`,`within`])]),branch:P(({item:e})=>[U(`span`,{title:e.branch},j(e.branch),9,kI)]),empty:P(()=>[r[0]||=G(`還沒有任務。執行 `,-1),U(`code`,null,`mainflow new task `+j(e.mainline.id)+` <slug> --title <title>`,1),r[1]||=G(` 建立。`,-1)]),_:1},8,[`view`,`item-type`]))],64))}}),MI={class:`px-6 pt-6 pb-3`},NI={class:`mt-1 text-title font-semibold`},PI={class:`mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground`},FI={key:0},II={key:0,class:`text-xs text-muted-foreground tabular-nums`},LI={key:0,class:`max-w-5xl px-1 pt-2 pb-10`},RI={key:1,class:`px-6 py-16 text-center text-muted-foreground`},zI=`mainflow.mainlineView`,BI=I({__name:`MainlineDetail`,setup(e){let t=tp(),n=ep(),{id:r,mainline:i}=eM(),a=[{key:`overview`,label:`概覽`},{key:`tasks`,label:`任務`},{key:`criteria`,label:`條件`},{key:`decisions`,label:`決策`},{key:`files`,label:`資料`}],o=J(()=>a.find(e=>e.key===t.query.view)?.key??`overview`),s=e=>{let t=i.value;if(t)return{overview:void 0,tasks:t.tasks.length,criteria:t.criteria.length,decisions:t.decisions.length,files:DM(t).length}[e]},c=e=>n.replace({query:{view:String(e)}});F(()=>[r.value,t.query.view,t.query.tab],([e,r,i])=>{if(!e||typeof i==`string`)return;let a=$C(zI,{});typeof r==`string`?ew(zI,{...a,[e]:r}):a[e]&&a[e]!==`overview`&&n.replace({query:{...t.query,view:a[e]}})},{immediate:!0}),Er(()=>{let e=t.query.tab;if(typeof e!=`string`)return;let{tab:r,...i}=t.query,a={...i,view:e===`views`?`files`:e};n.replace({query:a})});let l=e=>i.value&&dw(()=>XC.mainlineStatus(r.value,e,i.value.version)),u=e=>i.value&&dw(()=>XC.mainlineTitle(r.value,e,i.value.version)),d=()=>i.value&&dw(()=>XC.archive(r.value,!i.value.archivedAt,i.value.version));return(e,t)=>N(i)?(B(),H(wF,{key:0},{header:P(()=>[U(`header`,MI,[W(DD,{text:N(i).id},null,8,[`text`]),U(`h1`,NI,[W(OD,{value:N(i).title,onSave:u},null,8,[`value`])]),U(`div`,PI,[W(bP,{status:N(i).status,options:N(Ww),onChange:l},null,8,[`status`,`options`]),W(TE,{priority:N(i).priority},null,8,[`priority`]),N(i).archivedAt?(B(),V(`span`,FI,`已封存 `+j(N(i).archivedAt),1)):K(``,!0),W(iE,{class:`ml-auto`,archived:!!N(i).archivedAt,onToggle:d},null,8,[`archived`])])]),W(N(RF),{"model-value":o.value,"onUpdate:modelValue":c},{default:P(()=>[W(N(zF),{variant:`line`,class:`h-9 w-full justify-start border-b px-6`},{default:P(()=>[(B(),V(z,null,L(a,e=>W(N(BF),{key:e.key,value:e.key,class:`flex-none px-2`},{default:P(()=>[G(j(e.label),1),s(e.key)===void 0?K(``,!0):(B(),V(`span`,II,j(s(e.key)),1))]),_:2},1032,[`value`])),64))]),_:1})]),_:1},8,[`model-value`])]),default:P(()=>[o.value===`overview`?(B(),V(`div`,LI,[W(gP,{mainline:N(i),columns:2},null,8,[`mainline`])])):o.value===`tasks`?(B(),H(jI,{key:1,mainline:N(i)},null,8,[`mainline`])):o.value===`criteria`?(B(),H(rI,{key:2,mainline:N(i)},null,8,[`mainline`])):o.value===`decisions`?(B(),H(oI,{key:3,mainline:N(i)},null,8,[`mainline`])):(B(),H(pI,{key:4,mainline:N(i)},null,8,[`mainline`]))]),_:1})):(B(),V(`p`,RI,`載入 `+j(N(r))+`…`,1))}}),VI={key:0,class:`shrink-0 text-xs text-muted-foreground`},HI=I({__name:`MainlineList`,setup(e){let t={key:`mainlines`,id:e=>e.id,text:e=>e.title,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:hN(Ww)},{key:`priority`,label:`優先度`,values:e=>[mN(e.priority)],options:pN},{key:`category`,label:`分類`,values:e=>e.category?[e.category]:[]},{key:`label`,label:`標籤`,values:e=>e.labels},PN(e=>e.group)],sorts:[{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`criteria`,label:`解決條件`,value:e=>e.criteria.total?e.criteria.done/e.criteria.total:null,dir:`desc`},{key:`priority`,label:`優先度`,value:e=>mN(e.priority),dir:`asc`},{key:`updated`,label:`更新`,value:e=>e.updated,dir:`desc`},{key:`created`,label:`建立`,value:e=>e.created,dir:`desc`},{key:`due`,label:`到期`,value:e=>e.due,dir:`asc`}],groups:[yN(Ww),{key:`priority`,label:`優先度`,value:e=>mN(e.priority),order:[`P0`,`P1`,`P2`,`P3`]},{key:`category`,label:`分類`,value:e=>e.category??`未分類`},NN(e=>e.group)],defaultSort:`updated`,defaultGroup:`status`,ended:e=>gN(e.status),archived:e=>!!e.archivedAt},n=e=>Q.relations.mainlineDeps.filter(t=>t.from===e.id),r=DN(t,()=>Q.summary?.mainlines??[]),i=TF(r,{kind:`mainline`,archived:e=>!!e.archivedAt}),a=[{key:`name`,label:`名稱`,sort:`name`},{key:`priority`,label:`優先度`,sort:`priority`},{key:`criteria`,label:`解決條件`,sort:`criteria`,value:e=>e.criteria.total},{key:`deps`,label:`依賴`,value:n,optional:!0},{key:`due`,label:`到期`,sort:`due`,value:e=>e.due},{key:`updated`,label:`更新`,class:`text-xs text-muted-foreground`,sort:`updated`,optional:!0}],o=e=>dw(()=>XC.archive(e.id,!e.archivedAt));return(e,t)=>(B(),H(wF,null,{header:P(()=>[W(CD,{title:`主脈絡`,description:`一條主脈絡是一件要做完的事:意圖、解決條件,以及推進它的任務與決策。`}),W(uD,{view:N(r)},null,8,[`view`])]),default:P(()=>[W(eD,{view:N(r),selection:N(i),columns:a,"item-ref":e=>e.id},{name:P(({item:e})=>[W(yD,{status:e.status,id:e.id,title:e.title,muted:!!e.archivedAt},{default:P(()=>[(B(!0),V(z,null,L(e.labels,e=>(B(),H(N(nE),{key:e,variant:`secondary`,class:`shrink-0`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128)),e.archivedAt?(B(),V(`span`,VI,`已封存`)):K(``,!0)]),_:2},1032,[`status`,`id`,`title`,`muted`])]),priority:P(({item:e})=>[W(TE,{priority:e.priority},null,8,[`priority`])]),criteria:P(({item:e})=>[W(nP,{done:e.criteria.done,total:e.criteria.total},null,8,[`done`,`total`])]),deps:P(({item:e})=>[W(_I,{deps:n(e)},null,8,[`deps`])]),due:P(({item:e})=>[W(_E,{day:e.due,ended:N(gN)(e.status)},null,8,[`day`,`ended`])]),updated:P(({item:e})=>[W(TP,{at:e.updated},null,8,[`at`])]),actions:P(({item:e})=>[W(N(sC),{variant:`ghost`,size:`xs`,class:`text-muted-foreground`,"as-child":``},{default:P(()=>[W(N(Am),{to:`/mainlines/${e.id}`,onClick:t[0]||=au(()=>{},[`stop`])},{default:P(()=>[W(N(ef)),t[1]||=G(`開啟`,-1)]),_:1},8,[`to`])]),_:2},1024),W(iE,{archived:!!e.archivedAt,onToggle:t=>o(e)},null,8,[`archived`,`onToggle`])]),empty:P(()=>[...t[2]||=[G(`沒有主脈絡。在 hub 內執行 `,-1),U(`code`,null,`mainflow new mainline <slug> --title <title>`,-1),G(` 建立第一個。`,-1)]]),_:1},8,[`view`,`selection`,`item-ref`]),W(gD,{selection:N(i)},null,8,[`selection`])]),_:1}))}}),UI=[`title`],WI=[`title`],GI=[`title`],KI=I({__name:`OpsLog`,setup(e){let t=e=>!/fail|error|denied|reject|abort|失敗|錯誤|拒絕|中止/i.test(e.result),n=e=>e.ref?.match(/^m\d{3}/)?.[0]??``,r=DN({key:`ops`,id:e=>`${e.at}|${e.target}|${e.operation}`,text:e=>`${e.operation} ${e.target} ${e.ref??``}`,filters:[{key:`result`,label:`結果`,values:e=>[t(e)?`success`:`failed`],options:[{value:`success`,label:`成功`},{value:`failed`,label:`沒有成功`}]},{key:`target`,label:`目標系統`,values:e=>[e.target]},{key:`mainline`,label:`主脈絡`,values:e=>[n(e)].filter(Boolean),optionLabel:e=>`${e} ${Q.summary?.mainlines.find(t=>t.id===e)?.title??``}`.trim()}],sorts:[{key:`at`,label:`時間`,value:e=>cE(e.at),dir:`desc`},{key:`operation`,label:`操作`,value:e=>e.operation,dir:`asc`},{key:`target`,label:`目標系統`,value:e=>e.target,dir:`asc`},{key:`result`,label:`結果`,value:e=>+!!t(e),dir:`asc`},{key:`ref`,label:`關聯`,value:e=>e.ref,dir:`asc`}],groups:[{key:`month`,label:`月份`,value:e=>uE(e.at).slice(0,7),latestFirst:!0},{key:`day`,label:`日期`,value:e=>uE(e.at),latestFirst:!0}],defaultSort:`at`,defaultGroup:`month`},()=>Q.ops),i=[{key:`operation`,label:`操作`,sort:`operation`},{key:`target`,label:`目標系統`,class:`max-w-64 truncate font-mono text-xs text-muted-foreground`,sort:`target`,optional:!0},{key:`result`,label:`結果`,class:`max-w-40 truncate text-xs`,sort:`result`},{key:`ref`,label:`關聯`,class:`max-w-56`,sort:`ref`,value:e=>e.ref,optional:!0},{key:`at`,label:`時間`,class:`font-mono text-xs text-muted-foreground tabular-nums`,sort:`at`}],{open:a}=FC();return Er(()=>Rw(Q.ops.map(e=>e.ref))),(e,n)=>(B(),H(wF,null,{header:P(()=>[W(CD,{title:`操作紀錄`,description:`對外部系統執行過的操作,只追加不改寫。`}),W(uD,{view:N(r)},null,8,[`view`])]),default:P(()=>[W(eD,{view:N(r),columns:i},{operation:P(({item:e})=>[U(`span`,{class:`block truncate`,title:e.operation},j(e.operation),9,UI)]),target:P(({item:e})=>[U(`span`,{title:e.target},j(e.target),9,WI)]),result:P(({item:e})=>[U(`span`,{class:k(t(e)?`text-muted-foreground`:`text-foreground`),title:e.result},[t(e)?K(``,!0):(B(),H(N(Qu),{key:0,class:`mr-1 inline size-3.5 align-[-2px] text-destructive`})),G(j(e.result),1)],10,GI)]),ref:P(({item:e})=>[e.ref?(B(),H($j,q({key:0},N(Iw)(e.ref),{onOpen:N(a)}),null,16,[`onOpen`])):K(``,!0)]),at:P(({item:e})=>[G(j(N(fE)(e.at).slice(5)),1)]),empty:P(()=>[...n[0]||=[G(`還沒有紀錄。用 `,-1),U(`code`,null,`mainflow ops add --target <系統> --op <操作> --result <結果>`,-1),G(` 記錄 push、發布、合併這類對外操作。`,-1)]]),_:1},8,[`view`])]),_:1}))}}),qI={key:0,class:`overflow-x-auto px-6 pb-2`},JI=[`aria-colcount`],YI=[`title`],XI={class:`text-xs text-muted-foreground tabular-nums`},ZI={key:0,class:`col-span-full flex min-w-0 items-center gap-2 pt-4 pb-2 text-sm`,role:`rowheader`},QI=[`aria-label`,`aria-expanded`,`onClick`],$I={key:1,class:`truncate font-medium`},eL={class:`text-xs text-muted-foreground tabular-nums`},tL={key:1,class:`px-6 py-16 text-center text-sm text-muted-foreground`},nL=I({__name:`BoardView`,props:{view:{},axis:{}},setup(e){let t=e,n=J(()=>t.view.spec.groups.find(e=>e.key===t.axis)??t.view.spec.groups[0]),r=J(()=>xN(n.value,t.view.sorted.value)),i=J(()=>t.view.group.value!==``),a=(e,t)=>e.filter(e=>bN(n.value,e).includes(t)),o=e=>[...e.items,...e.ended];return(t,n)=>e.view.groups.value.length?(B(),V(`div`,qI,[U(`div`,{class:`grid gap-x-3`,style:he({gridTemplateColumns:`repeat(${r.value.length}, minmax(20rem, 1fr))`}),role:`table`,"aria-colcount":r.value.length},[(B(!0),V(z,null,L(r.value,e=>(B(),V(`div`,{key:e.key,class:`flex min-w-0 items-center gap-2 border-b py-2`,role:`columnheader`},[e.status?(B(),H(kE,{key:0,status:e.status},null,8,[`status`])):(B(),V(`span`,{key:1,class:`truncate text-sm font-medium`,title:e.label},j(e.label),9,YI)),U(`span`,XI,j(e.items.length),1)]))),128)),(B(!0),V(z,null,L(e.view.groups.value,n=>(B(),V(z,{key:n.key},[i.value?(B(),V(`div`,ZI,[U(`button`,{type:`button`,class:`-ml-1 grid size-5 shrink-0 place-items-center rounded-sm hover:bg-accent`,"aria-label":e.view.collapsed.has(n.key)?`展開分組`:`收合分組`,"aria-expanded":!e.view.collapsed.has(n.key),onClick:t=>e.view.toggleCollapsed(n.key)},[e.view.collapsed.has(n.key)?(B(),H(N(Xu),{key:1,class:`size-4 text-muted-foreground`})):(B(),H(N(Ju),{key:0,class:`size-4 text-muted-foreground`}))],8,QI),n.status?(B(),H(kE,{key:0,status:n.status},null,8,[`status`])):(B(),V(`span`,$I,j(n.label),1)),U(`span`,eL,j(o(n).length),1)])):K(``,!0),!e.view.collapsed.has(n.key)||!i.value?(B(!0),V(z,{key:1},L(r.value,r=>(B(),V(`div`,{key:r.key,class:`flex min-w-0 flex-col gap-2 py-2`,role:`cell`},[(B(!0),V(z,null,L(a(o(n),r.key),n=>R(t.$slots,`card`,{item:n},void 0,void 0,e.view.spec.id(n))),128))]))),128)):K(``,!0)],64))),128))],12,JI)])):(B(),V(`div`,tL,[e.view.total.value>0?(B(),V(z,{key:0},[n[1]||=G(` 沒有符合條件的項目。`,-1),W(N(sC),{variant:`link`,size:`xs`,class:`px-0`,onClick:e.view.clearAll},{default:P(()=>[...n[0]||=[G(`清除篩選與搜尋`,-1)]]),_:1},8,[`onClick`])],64)):R(t.$slots,`empty`,{},void 0,void 0,1)]))}}),rL=.01,iL=e=>Math.min(2,Math.max(rL,e));function aL(e,t,n,r){let i=iL(t),a=(n-e.x)/e.zoom,o=(r-e.y)/e.zoom;return{zoom:i,x:n-a*i,y:r-o*i}}function oL(e,t,n=.9){if(e.width<=0||e.height<=0||t.width<=0||t.height<=0)return{x:0,y:0,zoom:1};let r=iL(Math.min(1,t.width*n/e.width,t.height*n/e.height));return{zoom:r,x:(t.width-e.width*r)/2,y:(t.height-e.height*r)/2}}function sL(e){if(e.deltaMode!==0)return!0;let t=e.wheelDeltaY;return typeof t==`number`&&t!==0&&t%120==0&&e.deltaX===0}var cL=.5;function lL(e){return[{point:{x:e.x+e.width/2,y:e.y},axis:`y`,normal:{x:0,y:-1}},{point:{x:e.x+e.width/2,y:e.y+e.height},axis:`y`,normal:{x:0,y:1}},{point:{x:e.x,y:e.y+e.height/2},axis:`x`,normal:{x:-1,y:0}},{point:{x:e.x+e.width,y:e.y+e.height/2},axis:`x`,normal:{x:1,y:0}}]}var uL=e=>({x:e.y,y:e.x}),dL=e=>({x:e.y,y:e.x,width:e.height,height:e.width});function fL(e,t,n){return Math.min(t.x,n.x)<e.x+e.width&&Math.max(t.x,n.x)>e.x&&Math.min(t.y,n.y)<e.y+e.height&&Math.max(t.y,n.y)>e.y}var pL=(e,t)=>e.slice(1).every((n,r)=>!t.some(t=>fL(t,e[r],n))),mL=(e,t)=>e.slice(1).reduce((n,r,i)=>n+t.filter(t=>fL(t,e[i],r)).length,0);function hL(e){let t=0;for(let n=1;n<e.length-1;n++){let r=e[n-1],i=e[n],a=e[n+1];Math.abs(r.x-i.x)<cL&&Math.abs(i.x-a.x)<cL||Math.abs(r.y-i.y)<cL&&Math.abs(i.y-a.y)<cL||t++}return t}var gL=e=>e.slice(1).reduce((t,n,r)=>t+Math.abs(n.x-e[r].x)+Math.abs(n.y-e[r].y),0);function _L(e,t){let n=e=>e.slice(1).map((t,n)=>[e[n],t]),r=0;for(let i of n(e)){let e=Math.abs(i[0].x-i[1].x)<cL;for(let a of t)for(let t of n(a)){if(Math.abs(t[0].x-t[1].x)<cL===e)continue;let n=e?i:t,a=e?t:i,o=Math.min(n[0].y,n[1].y),s=Math.max(n[0].y,n[1].y),c=Math.min(a[0].x,a[1].x),l=Math.max(a[0].x,a[1].x);n[0].x>c&&n[0].x<l&&a[0].y>o&&a[0].y<s&&r++}}return r}function vL(e,t,n){if(e.length<2)return!1;let[r,i]=[e[0],e[1]],[a,o]=[e[e.length-1],e[e.length-2]];return(i.x-r.x)*t.normal.x+(i.y-r.y)*t.normal.y>cL&&(o.x-a.x)*n.normal.x+(o.y-a.y)*n.normal.y>cL}function yL(e){let t=[];for(let n of e){let e=t[t.length-1];if(!(e&&Math.abs(n.x-e.x)<cL&&Math.abs(n.y-e.y)<cL)){if(t.length>=2){let r=t[t.length-2];(Math.abs(r.x-e.x)<cL&&Math.abs(e.x-n.x)<cL||Math.abs(r.y-e.y)<cL&&Math.abs(e.y-n.y)<cL)&&t.pop()}t.push(n)}}return t}function bL(e,t,n){let r=yL(e),i=(e,t)=>Math.abs(e.x-t.x)<cL;if(r.length>=2){let e=r[r.length-1],t=r[r.length-2];i(t,e)!==(n.axis===`y`)&&r.splice(r.length-1,0,n.axis===`y`?{x:e.x,y:t.y}:{x:t.x,y:e.y})}if(r.length>=2){let e=r[0],n=r[1];i(e,n)!==(t.axis===`y`)&&r.splice(1,0,t.axis===`y`?{x:e.x,y:n.y}:{x:n.x,y:e.y})}return yL(r)}function xL(e,t,n){let r=(e.x+t.x)/2,i=[e,{x:r,y:e.y},{x:r,y:t.y},t];if(Math.abs(e.y-t.y)<cL&&pL([e,t],n))return[e,t];for(let i of[r,e.x+18,t.x-18]){let r=[e,{x:i,y:e.y},{x:i,y:t.y},t];if(pL(r,n))return r}let a=n.flatMap(e=>[e.y-18,e.y+e.height+18]).sort((t,n)=>Math.abs(t-e.y)-Math.abs(n-e.y));for(let r of a){let i=[e,{x:e.x+18,y:e.y},{x:e.x+18,y:r},{x:t.x-18,y:r},{x:t.x-18,y:t.y},t];if(pL(i,n))return i}return i}function SL(e,t,n,r){return r===`x`?xL(e,t,n):xL(uL(e),uL(t),n.map(dL)).map(uL)}function CL(e,t,n){let r=[];if(e.axis===t.axis){let n=e.axis===`y`;Math.abs(n?e.point.x-t.point.x:e.point.y-t.point.y)<cL&&r.push([e.point,t.point]);let i=n?[(e.point.y+t.point.y)/2,e.point.y+e.normal.y*18]:[(e.point.x+t.point.x)/2,e.point.x+e.normal.x*18];for(let a of i)r.push(n?[e.point,{x:e.point.x,y:a},{x:t.point.x,y:a},t.point]:[e.point,{x:a,y:e.point.y},{x:a,y:t.point.y},t.point])}else r.push(e.axis===`y`?[e.point,{x:e.point.x,y:t.point.y},t.point]:[e.point,{x:t.point.x,y:e.point.y},t.point]);let i=r.map(n=>bL(n,e,t)).filter(e=>pL(e,n));return i.length?i:[bL(SL(e.point,t.point,n,e.axis),e,t)]}function wL(e,t,n,r=[]){let i;for(let a of lL(e))for(let e of lL(t))for(let t of CL(a,e,n)){let o=[mL(t,n),+!vL(t,a,e),_L(t,r),hL(t),gL(t)];(!i||TL(o,i.score))&&(i={path:t,score:o})}return i?.path??[lL(e)[3].point,lL(t)[2].point]}function TL(e,t){for(let[n,r]of e.entries())if(r!==t[n])return r<t[n];return!1}function EL(e){return e.length<=2?e:e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let r=e[n-1],i=e[n+1];return!(r.x===t.x&&t.x===i.x||r.y===t.y&&t.y===i.y)})}var DL=e=>String(Math.round(e*100)/100);function OL(e,t=8){let n=EL(e);if(n.length<2)return``;let r=`M${DL(n[0].x)},${DL(n[0].y)}`,i=n[0];for(let e=1;e<n.length-1;e++){let a=n[e],o=n[e+1],s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.hypot(o.x-a.x,o.y-a.y),l=Math.min(t,s/2,c/2),u={x:a.x-(a.x-i.x)/(s||1)*l,y:a.y-(a.y-i.y)/(s||1)*l},d={x:a.x+(o.x-a.x)/(c||1)*l,y:a.y+(o.y-a.y)/(c||1)*l};r+=` L${DL(u.x)},${DL(u.y)} Q${DL(a.x)},${DL(a.y)} ${DL(d.x)},${DL(d.y)}`,i=d}let a=n[n.length-1];return`${r} L${DL(a.x)},${DL(a.y)}`}function kL(e,t){if(e.length<2)return e;let n=e[e.length-1],r=e[e.length-2],i=Math.hypot(n.x-r.x,n.y-r.y);return i<=t*2?e:[...e.slice(0,-1),{x:n.x-(n.x-r.x)/i*t,y:n.y-(n.y-r.y)/i*t}]}var AL={width:260,height:72};function jL(e,t){let n=new Set(e),r=t.filter(e=>e.from!==e.to&&n.has(e.from)&&n.has(e.to)),i=new Set(r.flatMap(e=>[e.from,e.to])),a=new Map;for(let e of r)a.set(e.from,[...a.get(e.from)??[],e.to]);let o=new Map,s=new Set;function c(e){let t=o.get(e);if(t!==void 0)return t;if(s.has(e))return 0;s.add(e);let n=Math.max(0,...(a.get(e)??[]).map(e=>c(e)+1));return s.delete(e),o.set(e,n),n}let l=[];for(let t of e){if(!i.has(t))continue;let e=c(t);for(;l.length<=e;)l.push([]);l[e].push(t)}let u=e.filter(e=>!i.has(e));if(u.length){let e=Math.ceil(u.length/7),t=Math.ceil(u.length/e);for(let n=0;n<e;n++)l.push(u.slice(n*t,(n+1)*t))}return l.filter(e=>e.length>0)}function ML(e,t,n){let r=e.id!==void 0,i=r?12:0,a=r?26:0,o=[],s=i,c=0,l=jL(e.ids,t);for(let[e,t]of l.entries()){let r=Math.max(...t.map(e=>n(e).width)),u=i+a;for(let e of t){let t=n(e);o.push([e,{x:s,y:u,width:t.width,height:t.height}]),u+=t.height+16}c=Math.max(c,u-16-i-a),s+=r+(e<l.length-1?48:0)}return{id:e.id,framed:r,width:s+i,height:c+2*i+a,cards:o}}function NL(e,t,n,r={}){let i=r.wrapWidth??1600,a=e=>t.get(e)??AL,o={groups:[],cards:new Map,width:0,height:0},s=0,c=0,l=0;for(let t of e){if(!t.ids.length)continue;let e=ML(t,n,a);s>0&&s+e.width>i&&(s=0,c+=l+28,l=0),o.groups.push({id:e.id,framed:e.framed,x:s,y:c,width:e.width,height:e.height});for(let[t,n]of e.cards)o.cards.set(t,{...n,x:n.x+s,y:n.y+c});l=Math.max(l,e.height),o.width=Math.max(o.width,s+e.width),s+=e.width+28}return o.height=c+l,o}var PL=[`data-node`,`aria-pressed`,`title`],FL={class:`flex min-w-0 items-center gap-2`},IL={class:`truncate`},LL={class:`shrink-0 font-mono text-xs text-muted-foreground`},RL=[`title`],zL={class:`h-1 w-12 overflow-hidden rounded-full bg-muted`},BL={class:`flex min-w-0 items-center gap-2`},VL=[`title`],HL=I({__name:`MainlineNode`,props:{id:{},picked:{type:Boolean}},emits:[`pick`],setup(e){let t=e,n=J(()=>Q.summary?.mainlines.find(e=>e.id===t.id)),r=J(()=>n.value?.title??Iw(t.id).title??``),i=J(()=>n.value?.status??Iw(t.id).status),a=J(()=>n.value?.items),o=J(()=>gN(i.value??``)),s=J(()=>OC(t.id)),c=J(()=>{let e=Q.mainlines[t.id]?.tasks;return e?vN(e):void 0}),l=J(()=>a.value?.total?Math.round(100*a.value.done/a.value.total):0);return(t,n)=>(B(),V(`button`,{type:`button`,class:k([`relative z-[1] flex w-full min-w-0 flex-col gap-1.5 rounded-xl border px-3 py-2.5 text-left transition-[background-color,border-color] duration-[120ms] focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,[s.value?`border-dashed border-muted-foreground/60 bg-background hover:bg-[color-mix(in_oklab,var(--accent)_50%,var(--background))]`:`bg-card shadow-xs hover:bg-[color-mix(in_oklab,var(--accent)_50%,var(--card))]`,{"border-ring":e.picked}]]),"data-node":e.id,"aria-pressed":e.picked,title:s.value?`${e.id}:在新分頁開啟另一個 hub`:void 0,onClick:n[0]||=n=>t.$emit(`pick`,e.id,n)},[U(`span`,FL,[W(nT,{type:`mainline`,status:i.value},null,8,[`status`]),s.value?(B(),H(N(nE),{key:0,variant:`outline`,class:`min-w-0 shrink font-mono text-[11px] text-muted-foreground`},{default:P(()=>[U(`span`,IL,j(s.value.hub),1)]),_:1})):K(``,!0),U(`span`,LL,j(s.value?.local??e.id),1),s.value?(B(),H(N(zu),{key:1,class:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`})):K(``,!0),a.value?(B(),V(`span`,{key:2,class:`ml-auto flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground tabular-nums`,title:`checklist ${a.value.done}/${a.value.total}`},[U(`span`,zL,[U(`span`,{class:`block h-full bg-foreground`,style:he({width:`${l.value}%`})},null,4)]),G(` `+j(a.value.done)+`/`+j(a.value.total),1)],8,RL)):K(``,!0)]),U(`span`,BL,[U(`span`,{class:k([`truncate font-medium`,{"text-muted-foreground":o.value}])},j(r.value),3),!o.value&&c.value?(B(),V(`span`,{key:0,class:k([`ml-auto inline-flex shrink-0 items-center gap-1 text-xs tabular-nums`,{"text-muted-foreground":!c.value.doing}]),title:`進行中 ${c.value.doing}/未完成 ${c.value.open} 個任務`},[W(nT,{type:`phase`,status:c.value.doing?`doing`:void 0},null,8,[`status`]),G(j(c.value.doing)+`/`+j(c.value.open),1)],10,VL)):K(``,!0)])],10,PL))}}),UL=[`data-serves`,`data-session`,`aria-pressed`],WL={"data-session-icon":``,class:`relative row-span-2 grid size-6 place-items-center rounded-md bg-muted text-foreground`},GL={class:`flex min-w-0 items-baseline gap-1`},KL={class:`truncate font-medium`},qL=[`title`],JL=[`title`],YL={class:`truncate leading-4 text-muted-foreground`},XL=I({__name:`SessionNode`,props:{session:{},serves:{},picked:{type:Boolean}},emits:[`pick`],setup(e){let t=e,n=J(()=>t.session.actions.find(e=>e.status===`doing`)??t.session.actions.find(e=>e.status===`todo`)),r=J(()=>vN(t.session.actions)),i=zw.session.icon;return(t,a)=>(B(),V(`button`,{type:`button`,class:k([`relative z-[1] grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 rounded-md border py-1 pr-2 pl-1 text-left text-xs transition-colors duration-[120ms] hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,e.picked?`border-ring`:`border-transparent`]),"data-serves":e.serves,"data-session":e.session.id,"aria-pressed":e.picked,onClick:a[0]||=e=>t.$emit(`pick`,e)},[U(`span`,WL,[(B(),H(fa(N(i)),{class:`size-3.5`})),U(`span`,{class:k([`absolute -right-0.5 -bottom-0.5 size-2 rounded-full border-[1.5px] border-background`,n.value?`bg-status-done`:`bg-status-todo`])},null,2)]),U(`span`,GL,[U(`span`,KL,j(N(jw)(e.session)),1),e.session.elsewhere?(B(),V(`span`,{key:0,class:`shrink-0 text-muted-foreground`,title:`其他環境:工作目錄 ${e.session.cwd} 不在這台電腦上`,"data-elsewhere":``},`其他環境`,8,qL)):K(``,!0),r.value.open?(B(),V(`span`,{key:1,class:k([`shrink-0 tabular-nums`,{"text-muted-foreground":!r.value.doing}]),title:`進行中 ${r.value.doing}/未處理 ${r.value.open} 個行動`},`(`+j(r.value.doing)+`/`+j(r.value.open)+`)`,11,JL)):K(``,!0)]),U(`span`,YL,j(n.value?.do??`沒有待做的行動`),1)],10,UL))}}),ZL={class:`rounded-xl border bg-card text-body shadow-xs`},QL={class:`flex h-10 items-center gap-2 px-4`},$L={class:`font-mono text-xs text-muted-foreground`},eR={class:`flex flex-col gap-4 px-4 pb-4`},tR={class:`text-base font-semibold [overflow-wrap:anywhere]`},nR={class:`grid grid-cols-[72px_1fr] items-center gap-x-3 gap-y-1.5 text-xs`},rR={class:`flex flex-col gap-0.5`},iR=[`onClick`],aR={class:`shrink-0 font-mono text-muted-foreground`},oR={class:`truncate`},sR={class:`ml-auto shrink-0 text-muted-foreground`},cR={key:0,class:`px-1.5 text-xs text-muted-foreground`},lR={class:`flex flex-col gap-0.5`},uR={key:0,class:`px-1.5 text-xs text-muted-foreground`},dR={class:`flex h-10 items-center gap-2 px-4`},fR={class:`flex flex-col gap-4 px-4 pb-4`},pR={class:`text-base font-semibold [overflow-wrap:anywhere]`},mR={class:`grid grid-cols-[72px_1fr] items-center gap-x-3 gap-y-1.5 text-xs`},hR={class:`flex flex-col gap-0.5`},gR={class:`flex flex-col gap-0.5`},_R={class:`shrink-0 font-mono text-muted-foreground`},vR={class:`truncate`},yR={key:1,class:`px-1.5 text-xs text-muted-foreground`},bR={key:2,class:`px-4 py-6 text-sm text-muted-foreground`},xR=I({__name:`RunningPreview`,props:{picked:{}},emits:[`pickMainline`,`pickSession`],setup(e,{emit:t}){let n=e,r=t,{open:i}=FC(),a=[`doing`,`blocked`,`todo`],o=Aw,s=J(()=>{if(n.picked?.kind!==`mainline`)return;let e=n.picked.id,t=Q.summary?.mainlines.find(t=>t.id===e),r=(Q.mainlines[e]?.tasks??[]).filter(e=>a.includes(e.status)).sort((e,t)=>a.indexOf(e.status)-a.indexOf(t.status)||(e.order??0)-(t.order??0));return{id:e,loaded:!!Q.mainlines[e],title:t?.title??Iw(e).title??e,status:t?.status,criteria:t?.criteria,items:t?.items,tasks:r,sessions:Nw().filter(t=>Mw(t)===e)}}),c=J(()=>n.picked?.kind===`session`?Q.sessions.find(e=>e.id===n.picked.id):void 0),l=e=>{let t=e=>Q.sessions.filter(t=>t.delegatedFrom===e).flatMap(e=>[e,...t(e.id)]),n=t(e.id);return n.length?`${n.filter(e=>e.status===`active`).length} 個進行中,共 ${n.length} 個`:`沒有`};return(e,t)=>(B(),V(`div`,ZL,[s.value?(B(),V(z,{key:0},[U(`div`,QL,[W(nT,{type:`mainline`,status:s.value.status},null,8,[`status`]),U(`span`,$L,j(s.value.id),1),t[2]||=U(`span`,{class:`text-xs text-muted-foreground`},`主脈絡`,-1)]),U(`div`,eR,[U(`h3`,tR,j(s.value.title),1),U(`dl`,nR,[t[5]||=U(`dt`,{class:`text-muted-foreground`},`狀態`,-1),U(`dd`,null,[s.value.status?(B(),H(kE,{key:0,status:s.value.status},null,8,[`status`])):K(``,!0)]),s.value.criteria?(B(),V(z,{key:0},[t[3]||=U(`dt`,{class:`text-muted-foreground`},`解決條件`,-1),U(`dd`,null,[W(nP,{done:s.value.criteria.done,total:s.value.criteria.total},null,8,[`done`,`total`])])],64)):K(``,!0),s.value.items?(B(),V(z,{key:1},[t[4]||=U(`dt`,{class:`text-muted-foreground`},`checklist`,-1),U(`dd`,null,[W(nP,{done:s.value.items.done,total:s.value.items.total},null,8,[`done`,`total`])])],64)):K(``,!0)]),U(`section`,rR,[t[6]||=U(`h4`,{class:`mb-0.5 text-xs font-medium text-muted-foreground`},`未完成的任務`,-1),(B(!0),V(z,null,L(s.value.tasks,e=>(B(),V(`button`,{key:e.id,type:`button`,class:`flex h-7 min-w-0 items-center gap-2 rounded-md px-1.5 text-left text-xs hover:bg-accent`,onClick:t=>N(i)(N(CC)(s.value.id,e.id))},[W(nT,{type:N(Bw)(e),status:e.status},null,8,[`type`,`status`]),U(`span`,aR,j(e.id),1),U(`span`,oR,j(e.title),1),U(`span`,sR,j(N(Yw)[e.status]),1)],8,iR))),128)),s.value.tasks.length?K(``,!0):(B(),V(`p`,cR,j(s.value.loaded?`沒有`:`載入中…`),1))]),U(`section`,lR,[t[7]||=U(`h4`,{class:`mb-0.5 text-xs font-medium text-muted-foreground`},`會話`,-1),(B(!0),V(z,null,L(s.value.sessions,e=>(B(),H(XL,{key:e.id,session:e,onPick:t=>r(`pickSession`,e.id)},null,8,[`session`,`onPick`]))),128)),s.value.sessions.length?K(``,!0):(B(),V(`p`,uR,`沒有`))]),U(`div`,null,[W(N(sC),{variant:`outline`,size:`sm`,"as-child":``},{default:P(()=>[W(N(Am),{to:`/mainlines/${s.value.id}`},{default:P(()=>[...t[8]||=[G(`開啟主脈絡`,-1)]]),_:1},8,[`to`])]),_:1})])])],64)):c.value?(B(),V(z,{key:1},[U(`div`,dR,[W(nT,{type:`session`,status:c.value.status},null,8,[`status`]),t[9]||=U(`span`,{class:`text-xs text-muted-foreground`},`會話`,-1)]),U(`div`,fR,[U(`h3`,pR,j(N(jw)(c.value)),1),U(`dl`,mR,[t[10]||=U(`dt`,{class:`text-muted-foreground`},`狀態`,-1),U(`dd`,null,[W(kE,{status:c.value.status},null,8,[`status`])]),t[11]||=U(`dt`,{class:`text-muted-foreground`},`子代理`,-1),U(`dd`,null,j(l(c.value)),1)]),U(`section`,hR,[t[12]||=U(`h4`,{class:`mb-0.5 text-xs font-medium text-muted-foreground`},`目前行動`,-1),U(`p`,{class:k([`text-xs [overflow-wrap:anywhere]`,{"text-muted-foreground":!N(o)(c.value)}])},j(N(o)(c.value)?.do??`沒有待做的行動`),3)]),U(`section`,gR,[t[13]||=U(`h4`,{class:`mb-0.5 text-xs font-medium text-muted-foreground`},`服務的主脈絡`,-1),N(Mw)(c.value)?(B(),V(`button`,{key:0,type:`button`,class:`flex h-7 min-w-0 items-center gap-2 rounded-md px-1.5 text-left text-xs hover:bg-accent`,onClick:t[0]||=e=>r(`pickMainline`,N(Mw)(c.value))},[W(nT,{type:`mainline`,status:N(Iw)(N(Mw)(c.value)).status},null,8,[`status`]),U(`span`,_R,j(N(Mw)(c.value)),1),U(`span`,vR,j(N(Iw)(N(Mw)(c.value)).title),1)])):(B(),V(`p`,yR,`沒有`))]),U(`div`,null,[W(N(sC),{variant:`outline`,size:`sm`,onClick:t[1]||=e=>N(i)(N(TC)(c.value.id))},{default:P(()=>[...t[14]||=[G(`開啟會話`,-1)]]),_:1})])])],64)):(B(),V(`p`,bR,`點關係圖裡的主脈絡或會話看詳情。`))]))}}),SR=[`width`,`height`],CR=[`id`],wR=[`fill`],TR=[`d`,`stroke`,`stroke-dasharray`,`marker-end`],ER=[`onClick`],DR={class:`shrink-0 font-mono`},OR={class:`truncate`},kR=[`data-card`],AR={key:0,class:`flex flex-col gap-1.5 px-[9px]`},jR={class:`flex flex-wrap gap-x-6 gap-y-1`},MR={key:2,class:`absolute bottom-3 left-1/2 z-20 -translate-x-1/2 cursor-auto`,role:`toolbar`,"aria-label":`批次操作`,"data-canvas-overlay":``},NR={class:`flex items-center gap-1 rounded-lg border bg-popover py-1 pr-1 pl-3 text-sm shadow-md`},PR={class:`mr-2 tabular-nums`},FR={class:`text-muted-foreground tabular-nums`},IR={class:`absolute right-3 bottom-3 z-20 flex cursor-auto items-center rounded-full border bg-popover p-0.5 text-xs shadow-sm`,role:`toolbar`,"aria-label":`縮放`,"data-canvas-overlay":``},LR={key:1,class:`text-sm text-muted-foreground`},RR=1,zR=260,BR=4,VR=4,HR=`mainflow.overview.canvasHeight`,UR=240,WR=`mainflow.overview.previewWidth`,GR=260,KR=560,qR=I({__name:`RunningMap`,setup(e){let t=e=>`${e.kind}:${e.id}`,n=[`active`,`planning`,`paused`],r=e=>e&&!gN(e)?Math.max(0,n.indexOf(e)):n.length,i=(e,t)=>e.map((e,t)=>({item:e,i:t})).sort((e,n)=>r(t(e.item))-r(t(n.item))||e.i-n.i).map(e=>e.item),a=J(()=>(Q.summary?.mainlines??[]).filter(e=>!e.archivedAt)),o=e=>Iw(e).status,s=J(()=>a.value.map(e=>e.id)),c=J(()=>new Set((Q.summary?.mainlines??[]).filter(e=>e.archivedAt).map(e=>e.id))),l=J(()=>Q.relations.mainlineDeps.filter(e=>![e.from,e.to].some(e=>c.value.has(e)))),u=J(()=>new Map(Object.entries(Q.relations.groupMembers).flatMap(([e,t])=>t.filter(e=>e.kind===`mainline`&&!e.archived).map(t=>[t.ref,e])))),d=J(()=>i([...new Set([...s.value,...u.value.keys(),...l.value.flatMap(e=>[e.to,e.from])])],o)),f=J(()=>new Set(d.value)),p=e=>OC(e)?u.value.get(e):(Q.summary?.mainlines??[]).find(t=>t.id===e)?.group??void 0,m=J(()=>{let e=jN().map(e=>e.id),t=t=>t===void 0?1/0:e.includes(t)?e.indexOf(t):e.length,n=new Map;for(let e of d.value)n.set(p(e),[...n.get(p(e))??[],e]);return[...n].sort(([e],[n])=>t(e)-t(n)||(e??``).localeCompare(n??``)).map(([e,t])=>({id:e,ids:t}))}),h=M(new Map),g=J(()=>NL(m.value,h.value,l.value)),_=e=>g.value.cards.get(e),v=(e,t)=>{let n=_(e),r=t.framed?RR:0;return{left:`${n.x-t.x-r}px`,top:`${n.y-t.y-r}px`,width:`${zR}px`}},{open:y}=FC(),b=J(()=>i(Nw(),e=>e.status)),x=e=>b.value.filter(t=>Mw(t)===e),S=J(()=>b.value.filter(e=>!f.value.has(Mw(e)??``))),C=e=>e.kind===`mainline`?f.value.has(e.id):b.value.some(t=>t.id===e.id),w=Qt(new Map),T=J(()=>[...w.values()].filter(C)),ee=M(),E=J(()=>ee.value&&w.has(t(ee.value))&&C(ee.value)?ee.value:void 0),te=(e,n)=>w.has(t({kind:e,id:n})),ne=e=>!!e?.shiftKey;function re(){w.clear(),ee.value=void 0}function D(e,n){let r=t(e);if(ne(n)){w.has(r)?w.delete(r):w.set(r,e);return}w.clear(),w.set(r,e),ee.value=e}function ie(e,t){if(OC(e)){ne(t)||window.open(kC(e)??void 0,`_blank`,`noopener`);return}D({kind:`mainline`,id:e},t)}let ae=(e,t)=>D({kind:`session`,id:e},t);async function oe(){let e=new Map;for(let t of T.value)e.set(t.kind,[...e.get(t.kind)??[],t.id]);await dw(async()=>{let t=[];for(let[n,r]of e){let e=await XC.archiveMany(n,r,!0);t.push(...e.failed.map(e=>`${e.id}(${e.error})`))}if(t.length)throw Error(`${t.length} 個沒有封存:${t.join(`、`)}`)})&&re()}let se=M(),O=J(()=>{let e=se.value;return e&&{left:`${Math.min(e.x1,e.x2)}px`,top:`${Math.min(e.y1,e.y2)}px`,width:`${Math.abs(e.x2-e.x1)}px`,height:`${Math.abs(e.y2-e.y1)}px`}});function ce(e){let t=[],n=t=>{let n=t.getBoundingClientRect();return n.left<e.right&&n.right>e.left&&n.top<e.bottom&&n.bottom>e.top};for(let e of ue.value?.querySelectorAll(`[data-node], [data-session]`)??[])n(e)&&(e.dataset.node?OC(e.dataset.node)||t.push({kind:`mainline`,id:e.dataset.node}):t.push({kind:`session`,id:e.dataset.session}));return t}let{current:le}=FC();Df(window,`keydown`,e=>{e.key!==`Escape`||le.value||Q.paletteOpen||!w.size||(E.value&&T.value.length>1?ee.value=void 0:re())},{capture:!0});let ue=M(),de=M([]),fe=M({width:0,height:0});function pe(e,t){let n=0,r=0;for(let i=e;i&&i!==t;i=i.offsetParent)n+=i.offsetLeft,r+=i.offsetTop;return{left:n,top:r,right:n+e.offsetWidth,bottom:r+e.offsetHeight,height:e.offsetHeight}}function me(){let e=ue.value;if(!e)return;let t=new Map,n=new Map;for(let n of e.querySelectorAll(`[data-card]`))t.set(n.dataset.card,n.offsetHeight);for(let t of e.querySelectorAll(`[data-node]`))n.set(t.dataset.node,t.offsetHeight);if([...t].some(([e,t])=>h.value.get(e)?.height!==t)){h.value=new Map([...t].map(([e,t])=>[e,{width:zR,height:t}]));return}let r=t=>{let n=e.querySelector(`[data-node="${CSS.escape(t)}"]`);return n?pe(n,e):void 0},i=e=>({x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}),a=g.value.groups.filter(e=>e.framed).map(e=>({x:e.x,y:e.y,width:e.width,height:38})),o=[],s=[];for(let e of l.value){let t=_(e.to),r=_(e.from);if(!t||!r)continue;let c=(e,t)=>({x:t.x,y:t.y,width:t.width,height:n.get(e)??t.height}),l=c(e.to,t),u=c(e.from,r),d=[...a];for(let[t,n]of g.value.cards)if(t===e.to||t===e.from){let r=t===e.to?l:u;n.height>r.height&&d.push({x:n.x-6,y:r.y+r.height,width:n.width+12,height:n.height-r.height})}else d.push(i(n));let f=wL(l,u,d,s);s.push(f),o.push({key:`${e.to}>${e.from}`,d:OL(kL(f,2)),kind:e.state===`pending`?`pending`:`other`})}for(let t of e.querySelectorAll(`[data-serves]`)){let n=r(t.dataset.serves),i=t.querySelector(`[data-session-icon]`);if(!n||!i)continue;let a=pe(i,e);o.push({key:`s:${t.dataset.session}`,d:`M${n.left+12},${n.bottom} V${a.top+a.height/2} H${a.left}`,kind:`session`})}de.value=o,fe.value={width:e.offsetWidth,height:e.offsetHeight},Te||Ee()}Ff(ue,me),F([g,b,()=>Q.mainlines],()=>void tr(me),{deep:!0});let ge={pending:`var(--muted-foreground)`,other:`var(--status-off)`,session:`var(--status-off)`},_e={pending:void 0,other:`4 3`,session:`2 2`},ve=J(()=>Math.max(zR,g.value.width,Math.min(S.value.length,BR)*284-24)),ye=M(),A=M({x:0,y:0,zoom:1}),be=M({width:0,height:0});function xe(){let e=ye.value;e&&(be.value={width:e.clientWidth,height:e.clientHeight})}Ff(ye,()=>{xe(),Te||Ee()});let Se=M(!1),Ce;function we(e){Se.value=!0,A.value=e,clearTimeout(Ce),Ce=setTimeout(()=>Se.value=!1,320)}let Te=!1;function Ee(){xe(),fe.value.width&&fe.value.height&&be.value.width&&be.value.height&&(A.value=oL(fe.value,be.value),Te=!0)}let De=()=>(xe(),we(oL(fe.value,be.value))),Oe=e=>(xe(),we(aL(A.value,A.value.zoom*e,be.value.width/2,be.value.height/2))),ke=J(()=>`${Math.round(A.value.zoom*100)}%`),Ae=0;function je(e){let t=ye.value.getBoundingClientRect();if(e.ctrlKey||e.metaKey){e.preventDefault(),A.value=aL(A.value,iL(A.value.zoom*Math.exp(-e.deltaY*.01)),e.clientX-t.left,e.clientY-t.top);return}let n=performance.now()<Ae||!sL(e);if(e.preventDefault(),!n){Me(ye.value).scrollBy({top:Ne(e,e.deltaY),left:Ne(e,e.deltaX)});return}Ae=performance.now()+120,A.value={...A.value,x:A.value.x-e.deltaX,y:A.value.y-e.deltaY}}function Me(e){for(let t=e.parentElement;t;t=t.parentElement){let{overflowY:e}=getComputedStyle(t);if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t}return document.scrollingElement??document.documentElement}let Ne=(e,t)=>e.deltaMode===1?t*16:e.deltaMode===2?t*window.innerHeight:t;function Pe(e){let n=ye.value,r=n.getBoundingClientRect(),i=new Map(w),a=e.clientX-r.left,o=e.clientY-r.top;try{n.setPointerCapture(e.pointerId)}catch{}let s=e=>{let n=e.clientX-r.left,s=e.clientY-r.top;if(!se.value&&Math.hypot(n-a,s-o)<VR)return;se.value={x1:a,y1:o,x2:n,y2:s};let c=ce({left:r.left+Math.min(a,n),top:r.top+Math.min(o,s),right:r.left+Math.max(a,n),bottom:r.top+Math.max(o,s)});w.clear();for(let[e,t]of i)w.set(e,t);for(let e of c)w.set(t(e),e)},c=()=>{n.removeEventListener(`pointermove`,s),n.removeEventListener(`pointerup`,c),n.removeEventListener(`pointercancel`,c),se.value=void 0};n.addEventListener(`pointermove`,s),n.addEventListener(`pointerup`,c),n.addEventListener(`pointercancel`,c)}let Fe=M(!1);function Ie(e){if(e.button!==0||e.target.closest(`button, a, [data-canvas-overlay]`))return;if(e.shiftKey)return Pe(e);let t={x:e.clientX,y:e.clientY,vx:A.value.x,vy:A.value.y},n=!1,r=ye.value;try{r.setPointerCapture(e.pointerId)}catch{}let i=e=>{let r=e.clientX-t.x,i=e.clientY-t.y;!n&&Math.hypot(r,i)<VR||(n=!0,Fe.value=!0,A.value={...A.value,x:t.vx+r,y:t.vy+i})},a=()=>{r.removeEventListener(`pointermove`,i),r.removeEventListener(`pointerup`,a),r.removeEventListener(`pointercancel`,a),Fe.value=!1,n||re()};r.addEventListener(`pointermove`,i),r.addEventListener(`pointerup`,a),r.addEventListener(`pointercancel`,a)}let Le=e=>Math.round(Math.min(Math.max(UR,window.innerHeight),Math.max(UR,e))),Re=Number($C(HR,null)),ze=M(Re>0?Le(Re):null);function Be(e){let t=e.clientY,n=ye.value.offsetHeight,r=e=>ze.value=Le(n+e.clientY-t),i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i),ew(HR,ze.value)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)}function Ve(){ze.value=null,ew(HR,null)}let He=e=>Math.min(KR,Math.max(GR,e)),Ue=M(He(Number($C(WR,340))||340)),We=J(()=>be.value.width?Math.min(Ue.value,be.value.width*.6):Ue.value);function Ge(e){let t=e.clientX,n=We.value,r=e=>Ue.value=He(n+t-e.clientX),i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i),ew(WR,Ue.value)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)}return(e,t)=>d.value.length||b.value.length?(B(),V(`div`,{key:0,ref_key:`viewport`,ref:ye,class:k([`relative w-full touch-none overflow-hidden rounded-xl border bg-background select-none`,[Fe.value?`cursor-grabbing`:`cursor-grab`,ze.value===null&&`h-[60vh]`]]),style:he(ze.value===null?void 0:{height:`${ze.value}px`}),"data-canvas":``,onPointerdown:Ie,onWheel:je},[U(`div`,{ref_key:`canvas`,ref:ue,class:k([`absolute top-0 left-0 flex origin-top-left flex-col gap-6`,{"transition-transform duration-300 ease-out":Se.value}]),style:he({width:`${ve.value}px`,transform:`translate(${A.value.x}px, ${A.value.y}px) scale(${A.value.zoom})`})},[(B(),V(`svg`,{class:`pointer-events-none absolute inset-0 overflow-visible`,width:fe.value.width,height:fe.value.height,"aria-hidden":`true`},[U(`defs`,null,[(B(),V(z,null,L([`pending`,`other`],e=>U(`marker`,{id:`run-arrow-${e}`,key:e,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`7`,markerHeight:`7`,orient:`auto`},[U(`path`,{d:`M0,0 L8,4 L0,8 z`,fill:ge[e]},null,8,wR)],8,CR)),64))]),(B(!0),V(z,null,L(de.value,e=>(B(),V(`path`,{key:e.key,d:e.d,fill:`none`,"stroke-width":`1.5`,stroke:ge[e.kind],"stroke-dasharray":_e[e.kind],"marker-end":e.kind===`session`?void 0:`url(#run-arrow-${e.kind})`},null,8,TR))),128))],8,SR)),U(`div`,{class:`relative shrink-0`,style:he({width:`${g.value.width}px`,height:`${g.value.height}px`})},[(B(!0),V(z,null,L(g.value.groups,e=>(B(),H(fa(e.framed?`section`:`div`),{key:e.id??`ungrouped`,class:k([`absolute flex flex-col rounded-xl p-2`,e.framed?`border border-dashed`:`border-0`]),style:he({left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`}),"data-map-group":e.id},{default:P(()=>[e.id?(B(),V(`button`,{key:0,type:`button`,class:`relative z-[1] flex max-w-full min-w-0 items-center gap-1.5 self-start rounded-sm bg-background px-1 text-left text-xs text-muted-foreground hover:bg-accent`,onClick:t=>N(y)(e.id)},[W(nT,{type:`group`,status:N(AN)(e.id)?.status},null,8,[`status`]),U(`span`,DR,j(e.id),1),U(`span`,OR,j(N(AN)(e.id)?.title),1),W(TE,{priority:N(AN)(e.id)?.priority,class:`shrink-0`},null,8,[`priority`])],8,ER)):K(``,!0),(B(!0),V(z,null,L(m.value.find(t=>t.id===e.id)?.ids??[],t=>(B(),V(`div`,{key:t,class:`absolute flex flex-col gap-1.5`,style:he(v(t,e)),"data-card":t},[W(HL,{id:t,picked:te(`mainline`,t),onPick:ie},null,8,[`id`,`picked`]),(B(!0),V(z,null,L(x(t),e=>(B(),H(XL,{key:e.id,session:e,serves:t,picked:te(`session`,e.id),class:`ml-5`,onPick:t=>ae(e.id,t)},null,8,[`session`,`serves`,`picked`,`onPick`]))),128))],12,kR))),128))]),_:2},1032,[`class`,`style`,`data-map-group`]))),128))],4),S.value.length?(B(),V(`div`,AR,[U(`div`,jR,[(B(!0),V(z,null,L(S.value,e=>(B(),H(XL,{key:e.id,session:e,picked:te(`session`,e.id),class:`max-w-full`,style:he({width:`${zR}px`}),onPick:t=>ae(e.id,t)},null,8,[`session`,`picked`,`style`,`onPick`]))),128))])])):K(``,!0)],6),E.value?(B(),V(`aside`,{key:0,class:`absolute top-3 right-3 z-20 flex max-h-[calc(100%-1.5rem)] cursor-auto flex-col overflow-y-auto overscroll-contain rounded-xl shadow-lg`,style:he({width:`${We.value}px`}),"aria-label":`預覽`,"data-canvas-overlay":``,onWheel:t[0]||=au(()=>{},[`stop`])},[U(`div`,{class:`absolute inset-y-0 left-0 z-10 w-2 cursor-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`拖曳調整預覽寬度`,onPointerdown:au(Ge,[`prevent`,`stop`])},null,32),W(xR,{picked:E.value,onPickMainline:ie,onPickSession:ae},null,8,[`picked`])],36)):K(``,!0),se.value?(B(),V(`div`,{key:1,class:`pointer-events-none absolute z-20 rounded-sm border border-ring bg-ring/10`,style:he(O.value),"aria-hidden":`true`},null,4)):K(``,!0),T.value.length>=1?(B(),V(`div`,MR,[U(`div`,NR,[U(`span`,PR,`已選 `+j(T.value.length)+` 個`,1),W(N(sC),{variant:`ghost`,size:`sm`,onClick:oe},{default:P(()=>[W(N(Pu)),t[4]||=G(`封存`,-1),U(`span`,FR,j(T.value.length),1)]),_:1}),W(N(sC),{variant:`ghost`,size:`icon-sm`,"aria-label":`清除選取`,onClick:t[1]||=e=>re()},{default:P(()=>[W(N(uf))]),_:1})])])):K(``,!0),U(`div`,{class:`absolute inset-x-0 bottom-0 z-10 h-2 cursor-row-resize`,role:`separator`,"aria-orientation":`horizontal`,"aria-label":`拖曳調整畫布高度,雙擊回到預設高度`,"data-canvas-overlay":``,onPointerdown:au(Be,[`prevent`,`stop`]),onDblclick:Ve},null,32),U(`div`,IR,[W(N(sC),{variant:`ghost`,size:`icon-sm`,class:`rounded-full`,"aria-label":`縮小`,onClick:t[2]||=e=>Oe(1/N(1.2))},{default:P(()=>[W(N(Vd))]),_:1}),U(`button`,{type:`button`,class:`h-7 min-w-12 rounded-full px-1.5 tabular-nums hover:bg-accent`,title:`全部置入畫面`,"aria-label":`全部置入畫面`,onClick:De},j(ke.value),1),W(N(sC),{variant:`ghost`,size:`icon-sm`,class:`rounded-full`,"aria-label":`放大`,onClick:t[3]||=e=>Oe(N(1.2))},{default:P(()=>[W(N(Gd))]),_:1})])],38)):(B(),V(`p`,LR,[...t[5]||=[G(`沒有主脈絡。在 hub 內執行 `,-1),U(`code`,null,`mainflow new mainline <slug> --title <title>`,-1),G(` 建立。`,-1)]]))}}),JR={class:`flex flex-col gap-8 px-6 pt-2 pb-10`},YR={key:0,"aria-labelledby":`attention`,class:`-mb-4 rounded-lg border bg-card`},XR={id:`attention`,class:`text-sm font-medium`},ZR=[`aria-expanded`],QR={class:`text-xs text-muted-foreground tabular-nums`},$R={key:2,class:`ml-2 flex min-w-0 items-center gap-3 overflow-hidden text-xs font-normal text-muted-foreground`},ez={class:`tabular-nums`},tz={id:`attention-list`,class:`border-t`},nz=[`data-peek`,`aria-current`,`onClick`],rz={class:`shrink-0 font-mono text-xs text-muted-foreground`},iz={class:`min-w-0 truncate`},az=[`title`],oz={class:`truncate`},sz={key:0,class:`hidden max-w-48 shrink-0 truncate text-xs text-muted-foreground xl:inline`},cz={"aria-labelledby":`running`},lz={id:`running`,class:`mb-2 flex items-center gap-1.5 text-sm font-medium`},uz={class:`text-xs font-normal text-muted-foreground tabular-nums`},dz={type:`button`,class:`grid size-5 place-items-center rounded-sm text-muted-foreground hover:text-foreground`,"aria-label":`依賴線的說明`},fz={"aria-labelledby":`issues`,class:`-mx-6 min-w-0`},pz={id:`issues`,class:`px-6 text-sm font-medium`},mz={class:`ml-1 text-xs text-muted-foreground tabular-nums`},hz={class:`flex min-w-0 items-center gap-2`},gz={class:`shrink-0 font-mono text-xs text-muted-foreground`},_z=[`title`],vz={key:0,class:`flex min-w-0 items-center gap-1.5 overflow-hidden text-xs`},yz=`mainflow.overview.attentionOpen`,bz=`mainflow.list.overview.issues.axis`,xz=`箭頭由要先完成的主脈絡指向等待它的主脈絡;實線是還沒完成的依賴,虛線是已完成或無法確認的依賴。`,Sz=I({__name:`Overview`,setup(e){let{open:t,current:n}=FC(),r=e=>n.value?.ref===e||void 0,i=J(()=>(Q.summary?.mainlines??[]).filter(e=>!e.archivedAt)),a=J(()=>i.value.filter(e=>e.status===`active`||e.status===`planning`||e.status===`paused`)),o=J(()=>[...new Set([...a.value.map(e=>e.id),...Q.relations.mainlineDeps.flatMap(e=>[e.from,e.to]).filter(e=>/^m\d{3}$/.test(e))])]);Er(()=>void uw(o.value));let s=J(()=>a.value.flatMap(e=>Q.mainlines[e.id]?[Q.mainlines[e.id]]:[])),c={overdue:{label:`逾期`,icon:Wu,tone:`text-destructive`},blocked:{label:`卡住`,icon:ed,tone:`text-status-waiting`},proposed:{label:`待裁決`,icon:Qu,tone:`text-warning`},due:{label:`即將到期`,icon:Wu,tone:`text-warning`},review:{label:`待重新確認`,icon:qd,tone:`text-warning`}},l=J(()=>[...s.value.flatMap(e=>e.tasks.filter(e=>e.status===`blocked`).map(t=>({ref:CC(e.id,t.id),type:Bw(t),status:t.status,id:`${e.id}/${t.id}`,title:t.title,kind:`blocked`,reason:`卡住:${t.blockedBy?.reason??`沒有寫原因`}`,context:e.title}))),...s.value.flatMap(e=>e.decisions.filter(e=>e.status===`proposed`).map(t=>({ref:wC(e.id,t.id),type:`decision`,status:t.status,id:`${e.id}/${t.id}`,title:t.title,kind:`proposed`,reason:t.affects?.length?`待裁決,影響 ${t.affects.join(`、`)}`:`待裁決`,context:e.title}))),...Q.issues.filter(e=>e.status!==`closed`&&!e.archivedAt&&hE(e.due)).map(e=>{let t=mE(e.due);return{ref:e.id,type:`issue`,status:e.status,id:e.id,title:e.title,kind:t<0?`overdue`:`due`,reason:t<0?`已逾期 ${-t} 天`:t===0?`今天到期`:`${t} 天後到期`}}),...Q.findings.filter(e=>e.status===`valid`&&!e.archivedAt&&e.reviewAfter&&mE(e.reviewAfter)<0).map(e=>({ref:e.id,type:`finding`,status:e.status,id:e.id,title:e.title,kind:`review`,reason:`${e.reviewAfter} 起該重新確認是否仍成立`}))]),u=J(()=>Object.keys(c).flatMap(e=>{let t=l.value.filter(t=>t.kind===e).length;return t?[{kind:e,n:t,...c[e]}]:[]})),d=M($C(yz,!1)===!0);function f(){d.value=!d.value,ew(yz,d.value)}let p=[`open`,`planned`],m=DN({key:`overview.issues`,queryPrefix:`i.`,id:e=>e.id,text:e=>e.title,filters:PF(p),sorts:[{key:`order`,label:`手動順序`,value:e=>e.order,dir:`asc`},{key:`name`,label:`名稱`,value:e=>e.title,dir:`asc`},{key:`priority`,label:`優先度`,value:e=>mN(e.priority),dir:`asc`},{key:`planned`,label:`排入`,value:e=>e.plannedIn??e.due,dir:`asc`}],groups:FF(p),defaultSort:`order`,defaultGroup:`priority`},()=>Q.issues.filter(e=>!e.archivedAt&&e.status!==`closed`)),h=$C(bz,`group`),g=M(m.spec.groups.some(e=>e.key===h)?h:`group`);function _(e){g.value=e,ew(bz,e)}let v=J(()=>m.spec.groups.find(e=>e.key===g.value)?.label),y=e=>mN(e.priority)!==`P2`||g.value!==`category`&&!!e.category||!!e.labels?.length,b=J(()=>a.value.length),x=J(()=>Pw().length);return(e,n)=>(B(),H(wF,null,{header:P(()=>[W(CD,{title:`總覽`,description:`現在要注意什麼、進行中的主脈絡與會話怎麼串在一起、還有哪些待辦。`})]),default:P(()=>[U(`div`,JR,[l.value.length?(B(),V(`section`,YR,[U(`h2`,XR,[U(`button`,{type:`button`,class:`flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2 text-left hover:bg-accent/50`,"aria-expanded":d.value,"aria-controls":`attention-list`,onClick:f},[d.value?(B(),H(N(Ju),{key:0,class:`size-4 shrink-0 text-muted-foreground`})):(B(),H(N(Xu),{key:1,class:`size-4 shrink-0 text-muted-foreground`})),n[1]||=G(` 需要注意 `,-1),U(`span`,QR,j(l.value.length),1),d.value?K(``,!0):(B(),V(`span`,$R,[(B(!0),V(z,null,L(u.value,e=>(B(),V(`span`,{key:e.kind,class:`flex shrink-0 items-center gap-1`},[(B(),H(fa(e.icon),{class:k([`size-3.5`,e.tone])},null,8,[`class`])),G(j(e.label)+` `,1),U(`span`,ez,j(e.n),1)]))),128))]))],8,ZR)]),yr(U(`ul`,tz,[(B(!0),V(z,null,L(l.value,e=>(B(),V(`li`,{key:e.ref+e.reason,class:`flex h-9 cursor-pointer items-center gap-2 border-b px-3 transition-colors duration-[120ms] last:border-b-0 hover:bg-muted/50`,"data-peek":e.ref,"aria-current":r(e.ref),onClick:n=>N(t)(e.ref)},[W(nT,{type:e.type,status:e.status},null,8,[`type`,`status`]),U(`span`,rz,j(e.id),1),U(`span`,iz,j(e.title),1),U(`span`,{class:`ml-auto flex min-w-0 shrink items-center gap-1 text-xs text-muted-foreground`,title:e.reason},[(B(),H(fa(c[e.kind].icon),{class:k([`size-3.5 shrink-0`,c[e.kind].tone])},null,8,[`class`])),U(`span`,oz,j(e.reason),1)],8,az),e.context?(B(),V(`span`,sz,j(e.context),1)):K(``,!0)],8,nz))),128))],512),[[Vc,d.value]])])):K(``,!0),U(`section`,cz,[U(`h2`,lz,[n[2]||=G(` 進行中 `,-1),U(`span`,uz,j(b.value)+` 條主脈絡 · `+j(x.value)+` 個會話`,1),W(N(Wj),{"open-delay":150,"close-delay":100},{default:P(()=>[W(N(Kj),{"as-child":``},{default:P(()=>[U(`button`,dz,[W(N(td),{class:`size-3.5`})])]),_:1}),W(N(Gj),{class:`w-72 text-xs`},{default:P(()=>[G(j(xz))]),_:1})]),_:1})]),W(qR)]),U(`section`,fz,[U(`h2`,pz,[n[3]||=G(`待辦事項 `,-1),U(`span`,mz,j(N(m).total.value),1)]),W(uD,{view:N(m)},{views:P(()=>[W(N(lC),null,{default:P(()=>[W(N(SC),{"as-child":``},{default:P(()=>[W(N(sC),{variant:`outline`,size:`sm`,"aria-label":`橫軸:${v.value}`},{default:P(()=>[W(N(od)),G(j(v.value),1)]),_:1},8,[`aria-label`])]),_:1}),W(N(fC),{align:`end`,class:`w-40`},{default:P(()=>[W(N(mC),{class:`text-xs text-muted-foreground`},{default:P(()=>[...n[4]||=[G(`橫軸`,-1)]]),_:1}),W(N(hC),{"model-value":g.value,"onUpdate:modelValue":n[0]||=e=>_(String(e))},{default:P(()=>[(B(!0),V(z,null,L(N(m).spec.groups,e=>(B(),H(N(_C),{key:e.key,value:e.key},{default:P(()=>[G(j(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])]),_:1})]),_:1})]),_:1},8,[`view`]),W(nL,{view:N(m),axis:g.value},{card:P(({item:e})=>[W(N(mI),{class:k([`min-w-0 cursor-pointer gap-1 px-3 py-2 shadow-xs transition-colors duration-[120ms] hover:bg-accent/50`,{"bg-muted":r(e.id)}]),"data-peek":e.id,"aria-current":r(e.id),onClick:n=>N(t)(e.id)},{default:P(()=>[U(`div`,hz,[W(nT,{type:`issue`,status:e.status},null,8,[`status`]),U(`span`,gz,j(e.id),1),U(`span`,{class:`truncate`,title:e.title},j(e.title),9,_z)]),y(e)?(B(),V(`div`,vz,[W(TE,{priority:e.priority,class:`shrink-0`},null,8,[`priority`]),g.value!==`category`&&e.category?(B(),H(N(nE),{key:0,variant:`outline`},{default:P(()=>[G(j(e.category),1)]),_:2},1024)):K(``,!0),(B(!0),V(z,null,L(e.labels??[],e=>(B(),H(N(nE),{key:e,variant:`secondary`},{default:P(()=>[G(j(e),1)]),_:2},1024))),128))])):K(``,!0)]),_:2},1032,[`class`,`data-peek`,`aria-current`,`onClick`])]),empty:P(()=>[...n[5]||=[G(`沒有未處理或已排入的待辦。`,-1)]]),_:1},8,[`view`,`axis`])])])]),_:1}))}}),Cz=[`title`],wz={key:1,class:`shrink-0 text-xs text-muted-foreground`},Tz=I({__name:`SessionList`,setup(e){let t=[`active`,`paused`,`handed-off`,`ended`],n=e=>e.actions.find(e=>e.status===`doing`)??e.actions.find(e=>e.status===`todo`),r=e=>[...new Set(e.actions.flatMap(e=>e.serves.map(e=>e.slice(0,4))))],i=e=>e?`${e} ${Q.summary?.mainlines.find(t=>t.id===e)?.title??``}`.trim():`沒有服務的主脈絡`,a=e=>Math.max(...[e.started,...e.actions.flatMap(e=>[e.startedAt,e.doneAt])].filter(e=>!!e).map(cE)),o=e=>Q.sessions.filter(t=>t.delegatedFrom===e).sort((e,t)=>cE(e.started)-cE(t.started)),s=(e,t=1)=>o(e.id).flatMap(e=>[{item:e,depth:t},...s(e,t+1)]),c=J(()=>{let e=new Set(Q.sessions.map(e=>e.id));return Q.sessions.filter(t=>!t.delegatedFrom||!e.has(t.delegatedFrom))}),l=DN({key:`sessions`,id:e=>e.id,text:e=>`${jw(e)} ${e.branch??``}`,filters:[{key:`status`,label:`狀態`,values:e=>[e.status],options:hN(t)},{key:`agent`,label:`agent`,values:e=>[e.agent]},{key:`branch`,label:`分支`,values:e=>e.branch?[e.branch]:[]},{key:`mainline`,label:`主脈絡`,values:r,optionLabel:i}],sorts:[{key:`name`,label:`名稱`,value:e=>jw(e),dir:`asc`},{key:`serves`,label:`服務的任務`,value:e=>p(e),dir:`asc`},{key:`subagents`,label:`子代理數`,value:e=>o(e.id).length,dir:`desc`},{key:`started`,label:`開始時間`,value:e=>cE(e.started),dir:`desc`},{key:`active`,label:`最後活動`,value:a,dir:`desc`}],groups:[yN(t),{key:`mainline`,label:`主脈絡`,value:e=>r(e)[0]??``,groupLabel:i},{key:`day`,label:`日期`,value:e=>uE(e.started),latestFirst:!0}],defaultSort:`started`,defaultGroup:`status`,ended:e=>gN(e.status),archived:e=>!!e.archivedAt,nested:e=>s(e)},()=>c.value),u=TF(l,{kind:`session`,archived:e=>!!e.archivedAt}),d=[{key:`name`,label:`會話`,sort:`name`},{key:`serves`,label:`服務的任務`,class:`max-w-56`,sort:`serves`,value:e=>p(e),optional:!0},{key:`subagents`,label:`子代理`,class:`text-xs text-muted-foreground tabular-nums`,sort:`subagents`,value:e=>o(e.id).length||void 0,optional:!0},{key:`started`,label:`開始`,class:`text-xs text-muted-foreground`,sort:`started`}],{open:f}=FC();Er(()=>Rw(Q.sessions.flatMap(e=>e.actions.flatMap(e=>e.serves))));let p=e=>(n(e)??e.actions[0])?.serves[0]?.split(`#`)[0],m=e=>dw(()=>XC.archiveSession(e.id,!e.archivedAt));return(e,t)=>(B(),H(wF,null,{header:P(()=>[W(CD,{title:`會話`,description:`推進過 hub 的 AI 會話,含同步程式從其他環境帶來的會話。存在 .mainflow/local/sessions/,不入版控。`}),W(uD,{view:N(l)},null,8,[`view`])]),default:P(()=>[W(eD,{view:N(l),selection:N(u),columns:d,"item-ref":e=>N(TC)(e.id)},{name:P(({item:e,depth:t})=>[W(yD,{status:e.status,title:N(jw)(e),muted:t>0||!!e.archivedAt,depth:t},{default:P(()=>[e.elsewhere?(B(),V(`span`,{key:0,class:`shrink-0 text-xs text-muted-foreground`,title:`工作目錄 ${e.cwd} 不在這台電腦上`,"data-elsewhere":``},`其他環境`,8,Cz)):K(``,!0),e.archivedAt?(B(),V(`span`,wz,`已封存`)):K(``,!0)]),_:2},1032,[`status`,`title`,`muted`,`depth`])]),serves:P(({item:e})=>[p(e)?(B(),H($j,q({key:0},N(Iw)(p(e)),{onOpen:N(f)}),null,16,[`onOpen`])):K(``,!0)]),subagents:P(({item:e,depth:t})=>[G(j(t===0&&o(e.id).length?o(e.id).length:``),1)]),started:P(({item:e})=>[W(TP,{at:e.started},null,8,[`at`])]),actions:P(({item:e})=>[W(iE,{archived:!!e.archivedAt,onToggle:t=>m(e)},null,8,[`archived`,`onToggle`])]),empty:P(()=>[...t[0]||=[G(`沒有會話資料。會話存在 `,-1),U(`code`,null,`.mainflow/local/sessions/`,-1),G(`,不入版控;有同步時,其他環境的會話也會出現在這裡。`,-1)]]),_:1},8,[`view`,`selection`,`item-ref`]),W(gD,{selection:N(u)},null,8,[`selection`])]),_:1}))}}),Ez={class:`flex items-center gap-2 px-6 pb-2`,"data-notice-controls":``},Dz={class:`flex min-w-0 items-center gap-2`},Oz={key:0,class:`size-1.5 shrink-0 rounded-full bg-warning`,title:`新提醒`},kz=[`title`],Az=[`title`],jz={key:0,class:`text-xs text-muted-foreground`,title:`存檔已刪,或檔案已是同步確認的版本`},Mz={key:1,class:`text-xs text-muted-foreground`},Nz=[`title`],Pz=I({__name:`SyncNotices`,setup(e){let t=vw,n={key:`sync`,id:t,text:e=>`${zC(e)} ${e.path} ${e.message}`,filters:[{key:`kind`,label:`種類`,values:e=>[e.kind],options:Object.entries(IC).map(([e,t])=>({value:e,label:t}))},{key:`path`,label:`檔案`,values:e=>e.path?[e.path]:[]}],sorts:[{key:`at`,label:`時間`,value:e=>e.at,dir:`desc`},{key:`kind`,label:`種類`,value:e=>e.kind,dir:`asc`},{key:`path`,label:`檔案`,value:e=>e.path,dir:`asc`}],groups:[{key:`day`,label:`日期`,value:e=>e.at.slice(0,10),latestFirst:!0}],defaultSort:`at`,defaultGroup:`day`},r=M(!1),i=J(()=>hw().length),a=DN(n,()=>r.value?Q.sync.notices:hw()),o=[{key:`message`,label:`提醒`},{key:`kind`,label:`種類`,class:`text-xs`},{key:`path`,label:`檔案`,class:`max-w-72 truncate font-mono text-xs text-muted-foreground`,value:e=>e.path,optional:!0},{key:`at`,label:`時間`,class:`font-mono text-xs text-muted-foreground tabular-nums`},{key:`handled`,label:`處理`}],s=e=>new Date(e).toLocaleString(`sv-SE`).slice(5);return $i(async()=>{await xw(),bw()}),(e,n)=>(B(),H(wF,null,{header:P(()=>[W(CD,{title:`同步提醒`,description:`同步程式找到的、寫入者的內容可能沒有照原樣進入 hub 的改動。被拒的內容存在 .mainflow/local/sync/conflicts/,點開可以和 hub 的版本並排比對。`}),W(uD,{view:N(a)},null,8,[`view`]),U(`div`,Ez,[W(N(sC),{variant:`outline`,size:`xs`,"data-show-all":``,"aria-pressed":r.value,onClick:n[0]||=e=>r.value=!r.value},{default:P(()=>[G(j(r.value?`只看未處理`:`看全部`),1)]),_:1},8,[`aria-pressed`]),W(N(sC),{variant:`outline`,size:`xs`,"data-mark-all":``,disabled:i.value===0,onClick:n[1]||=e=>N(yw)()},{default:P(()=>[G(`全部標為已處理(`+j(i.value)+`)`,1)]),_:1},8,[`disabled`])])]),default:P(()=>[W(eD,{view:N(a),columns:o,"item-ref":e=>e.saved?N(DC)(e.saved):void 0},{message:P(({item:e})=>[U(`span`,Dz,[N(mw)(e)?K(``,!0):(B(),V(`span`,Oz)),e.saved?(B(),H(N(pd),{key:1,class:`size-3.5 shrink-0 text-muted-foreground`,"aria-label":`有存檔,可並排比對`})):K(``,!0),U(`span`,{class:`truncate`,title:`原文:${e.message}`},j(N(zC)(e,!1)),9,kz)])]),kind:P(({item:e})=>[G(j(N(IC)[e.kind]??e.kind),1)]),path:P(({item:e})=>[U(`span`,{title:e.path},j(e.path),9,Az)]),handled:P(({item:e})=>[e.handled===`auto`?(B(),V(`span`,jz,`已自動處理`)):e.handled?(B(),V(`span`,Mz,`已處理`)):(B(),H(N(sC),{key:2,variant:`ghost`,size:`xs`,"data-mark-one":``,onClick:au(n=>N(yw)(N(t)(e)),[`stop`])},{default:P(()=>[...n[2]||=[G(`標為已處理`,-1)]]),_:1},8,[`onClick`]))]),at:P(({item:e})=>[U(`span`,{title:e.at},j(s(e.at)),9,Nz)]),empty:P(()=>[!r.value&&N(Q).sync.notices.length>0?(B(),V(z,{key:0},[G(`沒有未處理的提醒。切換「看全部」可看已處理的。`)],64)):N(Q).sync.remote?(B(),V(z,{key:1},[G(`沒有提醒。同步程式只在寫入者的內容可能遺失時提醒,只多了別人改動的合併不列在這裡。`)],64)):(B(),V(z,{key:2},[n[3]||=G(`這個 hub 沒有設定同步伺服器。設定方式見 mainflow 的 `,-1),n[4]||=U(`code`,null,`docs/sync.md`,-1),n[5]||=G(`。`,-1)],64))]),_:1},8,[`view`,`item-ref`])]),_:1}))}}),Fz=e=>Array.isArray(e)?e.join(`/`):e??``,Iz=Rm({history:om(WC),routes:[{path:`/`,component:Sz},{path:`/mainlines`,component:HI},{path:`/mainlines/:m`,component:BI},{path:`/issues`,component:LF},{path:`/findings`,component:OF},{path:`/ops`,component:KI},{path:`/sessions`,component:Tz},{path:`/sync`,component:Pz},{path:`/mainlines/:m/tasks/:t`,redirect:e=>({path:`/mainlines/${Fz(e.params.m)}`,query:{view:`tasks`,peek:CC(Fz(e.params.m),Fz(e.params.t))}})},{path:`/mainlines/:m/decisions/:d`,redirect:e=>({path:`/mainlines/${Fz(e.params.m)}`,query:{view:`decisions`,peek:wC(Fz(e.params.m),Fz(e.params.d))}})},{path:`/mainlines/:m/files/:path(.*)`,redirect:e=>({path:`/mainlines/${Fz(e.params.m)}`,query:{peek:EC(Fz(e.params.m),Fz(e.params.path))}})},{path:`/sessions/:s`,redirect:e=>({path:`/sessions`,query:{peek:TC(Fz(e.params.s))}})}]}),Lz=hu(tE);Lz.config.errorHandler=Cw,Lz.use(Iz).mount(`#app`);
|