@inkeep/open-knowledge 0.25.0-beta.20 → 0.25.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/constants-BUU-f5cR.mjs +2 -0
- package/dist/{dist-t4ugaFF0.mjs → dist-CDX3FPEf.mjs} +1 -1
- package/dist/{dist-CgoRMunD.mjs → dist-TG9U-N9P.mjs} +10 -10
- package/dist/index.mjs +1 -1
- package/dist/init-DXxXuTdF.mjs +1 -0
- package/dist/{init-DGGa0Poi.mjs → init-OSum2tdu.mjs} +4 -4
- package/dist/loader-CTgKrU6h.mjs +1 -0
- package/dist/{loader-D1yXqf8H.mjs → loader-OqBg2MkQ.mjs} +2 -2
- package/dist/{preview-Ar8Am8Lv.mjs → preview-DgLBzg0c.mjs} +2 -2
- package/dist/preview-DvHkfk9B.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-D48vVOLP.js → ActivityModeContent-Bq2-szSy.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-CGxx7K6d.js → ConsentDialogBody-Cw7ziXls.js} +1 -1
- package/dist/public/assets/{DocumentContext-CJ22lSnF.js → DocumentContext-Cp5LrwUt.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-O-QyePZs.js → EnableSyncConfirmDialog-D6td4gmM.js} +1 -1
- package/dist/public/assets/{GraphPanel-PKzv55Hr.js → GraphPanel-CzvW16mF.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-Cb9g3XUL.js → ManagedArtifactProperties-7tx2h5fh.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-D0V6I7sX.js → McpConsentDialogBody-BNMbefiw.js} +1 -1
- package/dist/public/assets/{PropertyPanel-lSIKHRqy.js → PropertyPanel-BYMeaHwv.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-Df7GQEXC.js → SettingsDialogBody-C4TH7Apf.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-6YHbhuib.js → ShareBranchSwitchDialog-CAYidTth.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DodAWemk.js → ShareReceiveDialog-B_g3WoKU.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-BERnm3PE.js → ShareReceiveMissDialog-Bi8yB_Er.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-CNMkj80k.js → SkillEditorActions-zGJNqarO.js} +1 -1
- package/dist/public/assets/{SourceEditor-D5AjvnZ3.js → SourceEditor-z66BI1TW.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DGdTOOBW.js → TerminalPanel-vd5LQunA.js} +1 -1
- package/dist/public/assets/{agent-presence-DzX-AMwj.js → agent-presence-0f5jUZHx.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DDPu-Wza.js → auth-state-cache-CBnUAJVI.js} +1 -1
- package/dist/public/assets/{button-Cw_0dYAP.js → button-cneJOVxD.js} +1 -1
- package/dist/public/assets/{calendar-Br-BjNEv.js → calendar-BSusn3yJ.js} +1 -1
- package/dist/public/assets/check-Dqb-7gfx.js +1 -0
- package/dist/public/assets/{checkbox--aCx_VEt.js → checkbox-CF2d2zZW.js} +1 -1
- package/dist/public/assets/chevron-down-D3nis7uo.js +1 -0
- package/dist/public/assets/chevron-left-C6Q_NKVx.js +1 -0
- package/dist/public/assets/chevron-right-BfmqRYl8.js +1 -0
- package/dist/public/assets/{collapsible-C2BV6FHW.js → collapsible-NtcTfAgP.js} +1 -1
- package/dist/public/assets/{config-context-B6QjZ1RW.js → config-context-CVpOcWSZ.js} +1 -1
- package/dist/public/assets/{config-provider-AZSpuXXy.js → config-provider-VM6ptPr5.js} +1 -1
- package/dist/public/assets/{cursor-DWg4aKeS.js → cursor-CGeB2PU5.js} +1 -1
- package/dist/public/assets/{dialog-YBH5PjUS.js → dialog-DqxKeWl_.js} +1 -1
- package/dist/public/assets/{dist-D2AYnwsl.js → dist-BHLnUfd3.js} +1 -1
- package/dist/public/assets/{dist-C5Xa8yL1.js → dist-BpbMCVke.js} +1 -1
- package/dist/public/assets/{dist-DBck2Wni.js → dist-D6OstNsL.js} +1 -1
- package/dist/public/assets/{dist-CMd99jCo.js → dist-DFcaTwzj.js} +1 -1
- package/dist/public/assets/{dist-DoPCS53q.js → dist-Dk6VEDeZ.js} +1 -1
- package/dist/public/assets/{git-branch-3nYAHKh5.js → git-branch-DtntyZcb.js} +1 -1
- package/dist/public/assets/{index-aIqgABmi.js → index-BuvV9Y-n.js} +98 -98
- package/dist/public/assets/index-DJtUU5yP.css +1 -0
- package/dist/public/assets/{input-DkflumBI.js → input-DaVPmsWF.js} +1 -1
- package/dist/public/assets/{label-TedtbqkV.js → label-C2i80316.js} +1 -1
- package/dist/public/assets/loader-circle-CiIO3Fk-.js +1 -0
- package/dist/public/assets/{miss-dialog-store-D4V6ccBu.js → miss-dialog-store-Ay7SdCdU.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-C6BHQB0v.js → open-managed-artifact-tab-C0CwefFo.js} +1 -1
- package/dist/public/assets/{panel-BIPkPKNj.js → panel-BH2RZRZQ.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-tesr5n6G.js → pending-receive-nav-store-BPFyzD9L.js} +1 -1
- package/dist/public/assets/{project-paths-CuasytRc.js → project-paths-CXBtKZyA.js} +1 -1
- package/dist/public/assets/{prop-types-DIo-gx4O.js → prop-types-DgIMu1uN.js} +1 -1
- package/dist/public/assets/{radio-group-DDwGQ5DT.js → radio-group-Cn-Ci2Ym.js} +1 -1
- package/dist/public/assets/{refresh-cw-BHaAFbCQ.js → refresh-cw-EVALIeLp.js} +1 -1
- package/dist/public/assets/{selection-context-BPs74l1N.js → selection-context-B7L1o08O.js} +1 -1
- package/dist/public/assets/{skill-actions-CFGl3BfZ.js → skill-actions-BWXoXFJf.js} +1 -1
- package/dist/public/assets/{skill-scope-D_YpwXm9.js → skill-scope-Bt2TwqtA.js} +1 -1
- package/dist/public/assets/{skills-api-D8o77mG3.js → skills-api-C8U58cr0.js} +1 -1
- package/dist/public/assets/{textarea-rwbHA8E5.js → textarea-CHe7do1z.js} +1 -1
- package/dist/public/assets/{toggle-group-hi4Tembn.js → toggle-group-DFnOh2oq.js} +1 -1
- package/dist/public/assets/{tooltip-DaINFyme.js → tooltip-DY1syGNr.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-xkKqYj3i.js → typing-burst-detector-g8ADg4Q2.js} +1 -1
- package/dist/public/index.html +43 -43
- package/dist/{repair-launch-json-BYyble1D.mjs → repair-launch-json-e3Xal7gR.mjs} +2 -2
- package/dist/{repair-mcp-configs-BBygiH0z.mjs → repair-mcp-configs-uJr9vJYZ.mjs} +2 -2
- package/dist/{repair-skills-B_7y-_86.mjs → repair-skills-BEfm4X9B.mjs} +2 -2
- package/dist/repair-skills-Bz8yC6_P.mjs +1 -0
- package/dist/{src-DkOsQ2G0.mjs → src-BlGVwaKa.mjs} +2 -2
- package/dist/start-B8B-OPqe.mjs +1 -0
- package/dist/{start-xUVUMhK7.mjs → start-BL2OEs-Z.mjs} +2 -2
- package/dist/{write-project-skill-DRxDENrm.mjs → write-project-skill-qMcfR4xG.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-DKK5Ti8D.mjs +0 -2
- package/dist/init-Cp3rQ4fC.mjs +0 -1
- package/dist/loader-BNb29T7L.mjs +0 -1
- package/dist/preview-CVDn-KrD.mjs +0 -1
- package/dist/public/assets/check-SPk0tvuH.js +0 -1
- package/dist/public/assets/chevron-down-DxD_aY5H.js +0 -1
- package/dist/public/assets/chevron-left-BqTNmlIi.js +0 -1
- package/dist/public/assets/chevron-right-B5-WDYn2.js +0 -1
- package/dist/public/assets/index-CiDjoHbL.css +0 -1
- package/dist/public/assets/loader-circle-BFgDr9-d.js +0 -1
- package/dist/repair-skills-qrIBetAi.mjs +0 -1
- package/dist/start-BsKqWH7z.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./compiler-runtime-CVnuRdak.js";import{i as n}from"./button-
|
|
1
|
+
import{r as e,t}from"./compiler-runtime-CVnuRdak.js";import{i as n}from"./button-cneJOVxD.js";var r=t(),i=e();function a(e){let t=(0,r.c)(12),a,o,s,c;t[0]===e?(a=t[1],o=t[2],s=t[3],c=t[4]):({className:a,type:c,ref:s,...o}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s,t[4]=c);let l;t[5]===a?l=t[6]:(l=n(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,a),t[5]=a,t[6]=l);let u;return t[7]!==o||t[8]!==s||t[9]!==l||t[10]!==c?(u=(0,i.jsx)(`input`,{type:c,ref:s,"data-slot":`input`,className:l,...o}),t[7]=o,t[8]=s,t[9]=l,t[10]=c,t[11]=u):u=t[11],u}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{i}from"./button-
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{i}from"./button-cneJOVxD.js";import{d as a}from"./dist-BpbMCVke.js";var o=e(t(),1),s=n(),c=`Label`,l=o.forwardRef((e,t)=>(0,s.jsx)(a.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));l.displayName=c;var u=l,d=r();function f(e){let t=(0,d.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,s.jsx)(u,{"data-slot":`label`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}export{f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as e}from"./button-cneJOVxD.js";var t=e(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./button-
|
|
1
|
+
import{u as e}from"./button-cneJOVxD.js";var t=e(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]);function n(){let e=null,t=new Set;function n(){for(let e of t)e()}function r(t){e!==t&&(e=t,n())}return{arm(e){r(e)},dismiss(){r(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}var r=n();export{t as n,r as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{t as n}from"./react-dom-C-oc-P2K.js";import{u as r}from"./button-
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{t as n}from"./react-dom-C-oc-P2K.js";import{u as r}from"./button-cneJOVxD.js";import{i,u as a}from"./documents-events-Bsq-Lwvc.js";import{s as o}from"./doc-hash-CyR3apuv.js";var s=r(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),c=e(n()),l=e(t());function u(){var e=[...arguments];return(0,l.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var d=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function f(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function p(e){return`nodeType`in e}function m(e){return e?f(e)?e:p(e)?e.ownerDocument?.defaultView??window:window:window}function h(e){let{Document:t}=m(e);return e instanceof t}function g(e){return f(e)?!1:e instanceof m(e).HTMLElement}function _(e){return e instanceof m(e).SVGElement}function v(e){return e?f(e)?e.document:p(e)?h(e)?e:g(e)||_(e)?e.ownerDocument:document:document:document}var y=d?l.useLayoutEffect:l.useEffect;function b(e){let t=(0,l.useRef)(e);return y(()=>{t.current=e}),(0,l.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function x(){let e=(0,l.useRef)(null);return[(0,l.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,l.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function S(e,t){t===void 0&&(t=[e]);let n=(0,l.useRef)(e);return y(()=>{n.current!==e&&(n.current=e)},t),n}function C(e,t){let n=(0,l.useRef)();return(0,l.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function w(e){let t=b(e),n=(0,l.useRef)(null);return[n,(0,l.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function T(e){let t=(0,l.useRef)();return(0,l.useEffect)(()=>{t.current=e},[e]),t.current}var E={};function ee(e,t){return(0,l.useMemo)(()=>{if(t)return t;let n=E[e]==null?0:E[e]+1;return E[e]=n,e+`-`+n},[e,t])}function D(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var O=D(1),k=D(-1);function A(e){return`clientX`in e&&`clientY`in e}function te(e){if(!e)return!1;let{KeyboardEvent:t}=m(e.target);return t&&e instanceof t}function ne(e){if(!e)return!1;let{TouchEvent:t}=m(e.target);return t&&e instanceof t}function re(e){if(ne(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return A(e)?{x:e.clientX,y:e.clientY}:null}var j=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[j.Translate.toString(e),j.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ie=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function M(e){return e.matches(ie)?e:e.querySelector(ie)}var ae={display:`none`};function oe(e){let{id:t,value:n}=e;return l.createElement(`div`,{id:t,style:ae},n)}function N(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return l.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function P(){let[e,t]=(0,l.useState)(``);return{announce:(0,l.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var F=(0,l.createContext)(null);function I(e){let t=(0,l.useContext)(F);(0,l.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function se(){let[e]=(0,l.useState)(()=>new Set),t=(0,l.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,l.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var ce={draggable:`
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{i}from"./button-Cw_0dYAP.js";var a=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},o=new class extends a{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},s={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c=new class{#e=s;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function l(e){setTimeout(e,0)}var u=typeof window>`u`||`Deno`in globalThis;function d(){}function f(e,t){return typeof e==`function`?e(t):e}function p(e){return typeof e==`number`&&e>=0&&e!==1/0}function m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function h(e,t){return typeof e==`function`?e(t):e}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>E(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>x(e[n],t[n])):!1}var S=Object.prototype.hasOwnProperty;function C(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=T(e)&&T(t);if(!r&&!(E(e)&&E(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:S.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=C(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function w(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function T(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e){if(!D(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!D(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function D(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{c.setTimeout(t,e)})}function O(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:C(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function j(e,t){return typeof e==`function`?e(...t):!!e}function re(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var M=(()=>{let e=()=>u;return{isServer(){return e()},setIsServer(t){e=t}}})();function N(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ie=l;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ie,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var P=ae(),F=new class extends a{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oe(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??`online`)===`online`?F.isOnline():!0}var L=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function R(e){let t=!1,n=0,r,i=N(),a=()=>i.status!==`pending`,s=t=>{if(!a()){let n=new L(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>o.isFocused()&&(e.networkMode===`always`||F.isOnline())&&e.canRun(),d=()=>I(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(M.isServer()?0:3),o=e.retryDelay??oe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ee(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var z=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),p(this.gcTime)&&(this.#e=c.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(M.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(c.clearTimeout(this.#e),this.#e=void 0)}},se=class extends z{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=H(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=H(this.options);e.data!==void 0&&(this.setState(V(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=O(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(d).catch(d):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>h(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!m(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=A(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=R({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof L&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof L){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...B(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...V(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function B(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function V(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function H(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ce=class extends a{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=N(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),U(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return W(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!w(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&G(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ue(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(d)),t}#g(){this.#b();let e=h(this.options.staleTime,this.#t);if(M.isServer()||this.#r.isStale||!p(e))return;let t=m(this.#r.dataUpdatedAt,e)+1;this.#d=c.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(M.isServer()||g(this.options.enabled,this.#t)===!1||!p(this.#p)||this.#p===0)&&(this.#f=c.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(c.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(c.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&U(e,t),o=i&&G(e,n,t,r);(a||o)&&(l={...l,...B(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=O(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=O(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:K(e,t),refetch:this.refetch,promise:this.#o,isEnabled:g(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=N())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!w(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){P.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function le(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function U(e,t){return le(e,t)||e.state.data!==void 0&&W(e,t,t.refetchOnMount)}function W(e,t,n){if(g(t.enabled,e)!==!1&&h(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&K(e,t)}return!1}function G(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&K(e,n)}function K(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(h(t.staleTime,e))}function ue(e,t){return!w(e.getCurrentResult(),t)}var q=e(t(),1),J=n(),Y=q.createContext(void 0),X=e=>{let t=q.useContext(Y);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},de=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,J.jsx)(Y.Provider,{value:e,children:t})),Z=q.createContext(!1),fe=()=>q.useContext(Z);Z.Provider;function pe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var me=q.createContext(pe()),he=()=>q.useContext(me),ge=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?j(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},_e=e=>{q.useEffect(()=>{e.clearReset()},[e])},ve=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||j(n,[e.error,r])),ye=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},be=(e,t)=>e.isLoading&&e.isFetching&&!t,xe=(e,t)=>e?.suspense&&t.isPending,Q=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Se(e,t,n){let r=fe(),i=he(),a=X(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,ye(o),ge(o,i,s),_e(i);let c=!a.getQueryCache().get(o.queryHash),[l]=q.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(e=>{let t=f?l.subscribe(P.batchCalls(e)):d;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),q.useEffect(()=>{l.setOptions(o)},[o,l]),xe(o,u))throw Q(o,l,i);if(ve({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!M.isServer()&&be(u,r)&&(c?Q(o,l,i):s?.promise)?.catch(d).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Ce(e,t){return Se(e,ce,t)}var $=r();function we(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`flex h-full min-h-0 flex-col`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`section`,{"data-slot":`panel`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Te(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`shrink-0 flex items-center justify-between px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-header`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ee(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm font-medium uppercase font-mono tracking-wider text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`h2`,{"data-slot":`panel-title`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function De(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-xs text-muted-foreground font-mono bg-muted-foreground/5 rounded-md px-2 py-1`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-count`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Oe(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`subtle-scrollbar scroll-fade-mask min-h-0 flex-1 overflow-y-auto px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-body`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function ke(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-muted-foreground/60`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-empty`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ae(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-destructive`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-error`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}export{a as A,v as C,h as D,x as E,k as O,y as S,d as T,te as _,Ae as a,f as b,Ce as c,se as d,z as f,re as g,P as h,ke as i,o as k,de as l,F as m,Oe as n,Te as o,R as p,De as r,Ee as s,we as t,X as u,ne as v,_ as w,b as x,A as y};
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{i}from"./button-cneJOVxD.js";var a=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},o=new class extends a{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},s={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c=new class{#e=s;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function l(e){setTimeout(e,0)}var u=typeof window>`u`||`Deno`in globalThis;function d(){}function f(e,t){return typeof e==`function`?e(t):e}function p(e){return typeof e==`number`&&e>=0&&e!==1/0}function m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function h(e,t){return typeof e==`function`?e(t):e}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>E(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>x(e[n],t[n])):!1}var S=Object.prototype.hasOwnProperty;function C(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=T(e)&&T(t);if(!r&&!(E(e)&&E(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:S.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=C(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function w(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function T(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e){if(!D(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!D(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function D(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{c.setTimeout(t,e)})}function O(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:C(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function j(e,t){return typeof e==`function`?e(...t):!!e}function re(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var M=(()=>{let e=()=>u;return{isServer(){return e()},setIsServer(t){e=t}}})();function N(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ie=l;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ie,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var P=ae(),F=new class extends a{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oe(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??`online`)===`online`?F.isOnline():!0}var L=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function R(e){let t=!1,n=0,r,i=N(),a=()=>i.status!==`pending`,s=t=>{if(!a()){let n=new L(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>o.isFocused()&&(e.networkMode===`always`||F.isOnline())&&e.canRun(),d=()=>I(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(M.isServer()?0:3),o=e.retryDelay??oe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ee(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var z=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),p(this.gcTime)&&(this.#e=c.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(M.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(c.clearTimeout(this.#e),this.#e=void 0)}},se=class extends z{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=H(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=H(this.options);e.data!==void 0&&(this.setState(V(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=O(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(d).catch(d):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>h(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!m(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=A(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=R({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof L&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof L){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...B(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...V(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function B(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function V(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function H(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ce=class extends a{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=N(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),U(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return W(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!w(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&G(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ue(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(d)),t}#g(){this.#b();let e=h(this.options.staleTime,this.#t);if(M.isServer()||this.#r.isStale||!p(e))return;let t=m(this.#r.dataUpdatedAt,e)+1;this.#d=c.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(M.isServer()||g(this.options.enabled,this.#t)===!1||!p(this.#p)||this.#p===0)&&(this.#f=c.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(c.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(c.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&U(e,t),o=i&&G(e,n,t,r);(a||o)&&(l={...l,...B(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=O(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=O(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:K(e,t),refetch:this.refetch,promise:this.#o,isEnabled:g(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=N())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!w(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){P.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function le(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function U(e,t){return le(e,t)||e.state.data!==void 0&&W(e,t,t.refetchOnMount)}function W(e,t,n){if(g(t.enabled,e)!==!1&&h(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&K(e,t)}return!1}function G(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&K(e,n)}function K(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(h(t.staleTime,e))}function ue(e,t){return!w(e.getCurrentResult(),t)}var q=e(t(),1),J=n(),Y=q.createContext(void 0),X=e=>{let t=q.useContext(Y);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},de=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,J.jsx)(Y.Provider,{value:e,children:t})),Z=q.createContext(!1),fe=()=>q.useContext(Z);Z.Provider;function pe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var me=q.createContext(pe()),he=()=>q.useContext(me),ge=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?j(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},_e=e=>{q.useEffect(()=>{e.clearReset()},[e])},ve=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||j(n,[e.error,r])),ye=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},be=(e,t)=>e.isLoading&&e.isFetching&&!t,xe=(e,t)=>e?.suspense&&t.isPending,Q=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Se(e,t,n){let r=fe(),i=he(),a=X(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,ye(o),ge(o,i,s),_e(i);let c=!a.getQueryCache().get(o.queryHash),[l]=q.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(e=>{let t=f?l.subscribe(P.batchCalls(e)):d;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),q.useEffect(()=>{l.setOptions(o)},[o,l]),xe(o,u))throw Q(o,l,i);if(ve({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!M.isServer()&&be(u,r)&&(c?Q(o,l,i):s?.promise)?.catch(d).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Ce(e,t){return Se(e,ce,t)}var $=r();function we(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`flex h-full min-h-0 flex-col`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`section`,{"data-slot":`panel`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Te(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`shrink-0 flex items-center justify-between px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-header`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ee(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm font-medium uppercase font-mono tracking-wider text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`h2`,{"data-slot":`panel-title`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function De(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-xs text-muted-foreground font-mono bg-muted-foreground/5 rounded-md px-2 py-1`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-count`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Oe(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`subtle-scrollbar scroll-fade-mask min-h-0 flex-1 overflow-y-auto px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-body`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function ke(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-muted-foreground/60`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-empty`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ae(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-destructive`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-error`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}export{a as A,v as C,h as D,x as E,k as O,y as S,d as T,te as _,Ae as a,f as b,Ce as c,se as d,z as f,re as g,P as h,ke as i,o as k,de as l,F as m,Oe as n,Te as o,R as p,De as r,Ee as s,we as t,X as u,ne as v,_ as w,b as x,A as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{t as o,u as s}from"./button-
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{t as o,u as s}from"./button-cneJOVxD.js";import{i as c,n as l,t as u}from"./EnableSyncConfirmDialog-D6td4gmM.js";import{r as d}from"./config-context-CVpOcWSZ.js";import{t as f}from"./loader-circle-CiIO3Fk-.js";import{n as p}from"./miss-dialog-store-Ay7SdCdU.js";import{t as m}from"./refresh-cw-EVALIeLp.js";import{_ as h,r as g,u as _}from"./doc-hash-CyR3apuv.js";var v=s(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),y=s(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),b=s(`file-question-mark`,[[`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 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),x=s(`file-x-corner`,[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]]),S=r(),C=e(t(),1),w=n();function T(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function E(e){let t=(0,S.c)(6),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={phase:`pending`},t[0]=n):n=t[0];let[r,i]=(0,C.useState)(n),a=e.branch,o,s;return t[1]!==a||t[2]!==e.kind||t[3]!==e.path?(o=()=>{let t=window.okDesktop??null;if(!t||a===null){i({phase:`resolved`,resolution:{verdict:`unknown`}});return}let n=!1;return t.project.fetchTargetStatus({projectPath:t.config.projectPath,branch:a,path:e.path,kind:e.kind}).then(e=>{n||i({phase:`resolved`,resolution:e??{verdict:`unknown`}})}).catch(e=>{n||(console.warn(`[receive] miss target-status fetch failed`,e instanceof Error?e.message:e),i({phase:`resolved`,resolution:{verdict:`unknown`}}))}),()=>{n=!0}},s=[a,e.kind,e.path],t[1]=a,t[2]=e.kind,t[3]=e.path,t[4]=o,t[5]=s):(o=t[4],s=t[5]),(0,C.useEffect)(o,s),r}function D(e){let t=(0,S.c)(15),{onEnabled:n}=e,r=c(),a;t[0]===n?a=t[1]:(a={onEnabled:n},t[0]=n,t[1]=a);let{confirmOpen:s,setConfirmOpen:d,onToggleRequest:f,onConfirm:p}=l(r,a),h;t[2]===f?h=t[3]:(h=()=>f(!0),t[2]=f,t[3]=h);let g,_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,w.jsx)(m,{className:`size-4`,"aria-hidden":`true`}),_=(0,w.jsx)(i,{id:`XU0OXn`}),t[4]=g,t[5]=_):(g=t[4],_=t[5]);let v;t[6]===h?v=t[7]:(v=(0,w.jsxs)(o,{onClick:h,"data-testid":`share-receive-miss-enable-sync`,children:[g,_]}),t[6]=h,t[7]=v);let y;t[8]!==s||t[9]!==p||t[10]!==d?(y=(0,w.jsx)(u,{open:s,onOpenChange:d,onConfirm:p}),t[8]=s,t[9]=p,t[10]=d,t[11]=y):y=t[11];let b;return t[12]!==v||t[13]!==y?(b=(0,w.jsxs)(w.Fragment,{children:[v,y]}),t[12]=v,t[13]=y,t[14]=b):b=t[14],b}function O(e){let t=(0,S.c)(61),{nav:n,state:r,onBrowseFolder:s,onOpenRenamed:c,onEnableAutoSync:l}=e,{_:u}=a(),m=n.branch,h;t[0]!==u||t[1]!==n.kind?(h=n.kind===`folder`?u({id:`ugoTXs`}):u({id:`XH30C4`}),t[0]=u,t[1]=n.kind,t[2]=h):h=t[2];let g=h;if(r.phase===`pending`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(f,{className:`size-5 animate-spin`,"aria-hidden":`true`}),(0,w.jsx)(i,{id:`c8jBgX`})]}),t[3]=e):e=t[3],e}let{resolution:_}=r,C,T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,w.jsx)(d,{className:`size-4`,"aria-hidden":`true`}),T=(0,w.jsx)(i,{id:`hItdtk`}),t[4]=C,t[5]=T):(C=t[4],T=t[5]);let E;t[6]===s?E=t[7]:(E=(0,w.jsxs)(o,{variant:`outline`,onClick:s,"data-testid":`share-receive-miss-browse`,children:[C,T]}),t[6]=s,t[7]=E);let O=E,k,A,j;if(_.verdict===`renamed`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsx)(p,{className:`size-9`,"aria-hidden":`true`}),t[8]=e):e=t[8],k=e;let n;t[9]!==_.renamedTo||t[10]!==g?(n={0:_.renamedTo,targetNoun:g},t[9]=_.renamedTo,t[10]=g,t[11]=n):n=t[11];let r;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,w.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[12]=r):r=t[12];let a;t[13]===n?a=t[14]:(a=(0,w.jsx)(i,{id:`P0HC30`,values:n,components:r}),t[13]=n,t[14]=a),A=a;let s;t[15]!==c||t[16]!==_.renamedTo?(s=()=>c(_.renamedTo),t[15]=c,t[16]=_.renamedTo,t[17]=s):s=t[17];let l,u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,w.jsx)(p,{className:`size-4`,"aria-hidden":`true`}),u=(0,w.jsx)(i,{id:`AItsE5`}),t[18]=l,t[19]=u):(l=t[18],u=t[19]);let d;t[20]===s?d=t[21]:(d=(0,w.jsxs)(o,{onClick:s,"data-testid":`share-receive-miss-open-renamed`,children:[l,u]}),t[20]=s,t[21]=d);let f;t[22]!==O||t[23]!==d?(f=(0,w.jsxs)(w.Fragment,{children:[d,O]}),t[22]=O,t[23]=d,t[24]=f):f=t[24],j=f}else if(_.verdict===`deleted`){let e;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsx)(x,{className:`size-9`,"aria-hidden":`true`}),t[25]=e):e=t[25],k=e;let n;t[26]!==m||t[27]!==g?(n={targetNoun:g,branch:m},t[26]=m,t[27]=g,t[28]=n):n=t[28];let r;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,w.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[29]=r):r=t[29];let a;t[30]===n?a=t[31]:(a=(0,w.jsx)(i,{id:`kpqWwG`,values:n,components:r}),t[30]=n,t[31]=a),A=a,j=O}else if(_.verdict===`never-on-branch`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsx)(b,{className:`size-9`,"aria-hidden":`true`}),t[32]=e):e=t[32],k=e;let n;t[33]!==m||t[34]!==g?(n={targetNoun:g,branch:m},t[33]=m,t[34]=g,t[35]=n):n=t[35];let r;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,w.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[36]=r):r=t[36];let a;t[37]===n?a=t[38]:(a=(0,w.jsx)(i,{id:`i9TPUi`,values:n,components:r}),t[37]=n,t[38]=a),A=a,j=O}else if(_.verdict===`changed-locally`){let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsx)(y,{className:`size-9`,"aria-hidden":`true`}),t[39]=e):e=t[39],k=e;let n;t[40]!==m||t[41]!==g?(n=m===null?(0,w.jsx)(i,{id:`UuYo7g`,values:{targetNoun:g}}):(0,w.jsx)(i,{id:`HoWElC`,values:{targetNoun:g,branch:m},components:{0:(0,w.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[40]=m,t[41]=g,t[42]=n):n=t[42],A=n;let r;t[43]===l?r=t[44]:(r=(0,w.jsx)(D,{onEnabled:l}),t[43]=l,t[44]=r);let a;t[45]!==O||t[46]!==r?(a=(0,w.jsxs)(w.Fragment,{children:[r,O]}),t[45]=O,t[46]=r,t[47]=a):a=t[47],j=a}else{let e;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,w.jsx)(v,{className:`size-9`,"aria-hidden":`true`}),t[48]=e):e=t[48],k=e;let n;t[49]===m?n=t[50]:(n=m===null?(0,w.jsx)(i,{id:`Xewl6B`}):(0,w.jsx)(i,{id:`d1JjXo`,values:{branch:m},components:{0:(0,w.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[49]=m,t[50]=n),A=n,j=O}let M;t[51]===k?M=t[52]:(M=(0,w.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:k}),t[51]=k,t[52]=M);let N;t[53]===A?N=t[54]:(N=(0,w.jsx)(`p`,{className:`max-w-md text-balance text-base leading-6 text-foreground/90`,children:A}),t[53]=A,t[54]=N);let P;t[55]===j?P=t[56]:(P=(0,w.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:j}),t[55]=j,t[56]=P);let F;return t[57]!==M||t[58]!==N||t[59]!==P?(F=(0,w.jsxs)(w.Fragment,{children:[M,N,P]}),t[57]=M,t[58]=N,t[59]=P,t[60]=F):F=t[60],F}function k(e){return e.replace(/^\/+|\/+$/g,``)}function A(e,t){if(t.kind===`folder`){if(_(e))return k(t.path)===``;let n=g(e);return n!==null&&k(n)===k(t.path)}let n=g(e);return n===null?!1:h(n).normalizedTarget===h(t.path).normalizedTarget}function j(){let e=null,t=new Set,n=!1;function r(){for(let e of t)e()}function i(t){e!==t&&(e=t,r())}function a(){e!==null&&(A(window.location.hash,e)||i(null))}function o(){n||typeof window>`u`||(n=!0,window.addEventListener(`hashchange`,a))}return{arm(e){o(),i(e)},clear(){i(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dispose(){n&&typeof window<`u`&&(window.removeEventListener(`hashchange`,a),n=!1),i(null)}}}var M=j();function N(e,t){return e===null||e.kind!==`missing`||t===null||h(t.path).normalizedTarget!==e.target?null:t}export{E as a,T as i,M as n,v as o,O as r,N as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./compiler-runtime-CVnuRdak.js";import{n}from"./dist-CQw2y-s3.js";import{i as r}from"./button-
|
|
1
|
+
import{r as e,t}from"./compiler-runtime-CVnuRdak.js";import{n}from"./dist-CQw2y-s3.js";import{i as r}from"./button-cneJOVxD.js";import{t as i}from"./label-C2i80316.js";import{n as a,r as o,t as s}from"./radio-group-Cn-Ci2Ym.js";var c=t(),l=e(),u=`flex items-start gap-2 rounded-md border p-3 text-sm font-normal transition-colors cursor-pointer`;function d(e){let t=(0,c.c)(34),{value:d,onValueChange:f,disabled:p,idPrefix:m,testIdPrefix:h}=e,g=p===void 0?!1:p,_=`${m}-sharing-shared`,v=`${m}-sharing-local-only`,y;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,l.jsxs)(`legend`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,l.jsx)(n,{id:`wtcxiD`}),(0,l.jsx)(o,{})]}),t[0]=y):y=t[0];let b;t[1]===f?b=t[2]:(b=e=>f(e),t[1]=f,t[2]=b);let x=d===`shared`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,S;t[3]===x?S=t[4]:(S=r(u,x),t[3]=x,t[4]=S);let C=`${h}-shared`,w;t[5]!==_||t[6]!==C?(w=(0,l.jsx)(a,{id:_,value:`shared`,"data-testid":C,className:`mt-0.5`}),t[5]=_,t[6]=C,t[7]=w):w=t[7];let T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,l.jsx)(`span`,{className:`block font-medium`,children:(0,l.jsx)(n,{id:`0Gd0NU`})}),t[8]=T):T=t[8];let E;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,l.jsxs)(`span`,{children:[T,(0,l.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,l.jsx)(n,{id:`dJw2_7`})})]}),t[9]=E):E=t[9];let D;t[10]!==_||t[11]!==S||t[12]!==w?(D=(0,l.jsxs)(i,{htmlFor:_,className:S,children:[w,E]}),t[10]=_,t[11]=S,t[12]=w,t[13]=D):D=t[13];let O=d===`local-only`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,k;t[14]===O?k=t[15]:(k=r(u,O),t[14]=O,t[15]=k);let A=`${h}-local-only`,j;t[16]!==v||t[17]!==A?(j=(0,l.jsx)(a,{id:v,value:`local-only`,"data-testid":A,className:`mt-0.5`}),t[16]=v,t[17]=A,t[18]=j):j=t[18];let M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,l.jsx)(`span`,{className:`block font-medium`,children:(0,l.jsx)(n,{id:`OgyJSr`})}),t[19]=M):M=t[19];let N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,l.jsxs)(`span`,{children:[M,(0,l.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,l.jsx)(n,{id:`cZ_8zB`})})]}),t[20]=N):N=t[20];let P;t[21]!==v||t[22]!==k||t[23]!==j?(P=(0,l.jsxs)(i,{htmlFor:v,className:k,children:[j,N]}),t[21]=v,t[22]=k,t[23]=j,t[24]=P):P=t[24];let F;t[25]!==g||t[26]!==D||t[27]!==P||t[28]!==b||t[29]!==d?(F=(0,l.jsxs)(s,{value:d,onValueChange:b,disabled:g,className:`grid-cols-2 gap-3`,children:[D,P]}),t[25]=g,t[26]=D,t[27]=P,t[28]=b,t[29]=d,t[30]=F):F=t[30];let I;return t[31]!==F||t[32]!==h?(I=(0,l.jsxs)(`fieldset`,{className:`flex flex-col space-y-2`,"data-testid":h,children:[y,F]}),t[31]=F,t[32]=h,t[33]=I):I=t[33],I}function f(){let e=null,t=null,n=new Set,r=!1,i=null;function a(){for(let e of n)e()}function o(){e!==null&&(e=null,a())}return{install({bridge:n}){if(n&&n.onboarding)return r?i??void 0:(r=!0,t=n,i=n.onboarding.onShow(t=>{e=t,a()}),n.onboarding.signalReady(),()=>{i?.(),i=null,r=!1,t=null,o()})},getSnapshot(){return e},subscribe(e){return n.add(e),()=>{n.delete(e)}},async confirm(e){let n=t;if(!n)return{ok:!1,error:`Not attached to desktop bridge`};try{let t=await n.onboarding.confirm(e);return t.ok&&o(),t}catch(e){return{ok:!1,error:e instanceof Error?e.message:`Unknown error`}}},async cancel(){let e=t;if(!e)return{ok:!1,error:`Not attached to desktop bridge`};try{let t=await e.onboarding.cancel();return t.ok&&o(),t}catch(e){return{ok:!1,error:e instanceof Error?e.message:`Unknown error`}}},dismiss(){o()}}}var p=f();function m(e){return p.install(e)}function h(e,t){let n=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``)||(e.startsWith(`/`)?`/`:``),r=n(e),i=n(t);if(r===i)return`.`;let a=r.endsWith(`/`)?r:`${r}/`;return i.startsWith(a)?i.slice(a.length):null}function g(e){if(e===``||e===`.`)return!0;if(e.startsWith(`/`)||/^[A-Za-z]:/.test(e))return!1;let t=e.replace(/\\/g,`/`).split(`/`),n=0;for(let e of t)if(!(e===``||e===`.`))if(e===`..`){if(--n,n<0)return!1}else n+=1;return!0}export{d as a,m as i,h as n,p as r,g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,t}from"./chunk-CFjPhJqf.js";import{n,r,t as i}from"./compiler-runtime-CVnuRdak.js";import{wr as a}from"./dist-BGXCkPeI.js";import{u as o}from"./button-
|
|
1
|
+
import{o as e,t}from"./chunk-CFjPhJqf.js";import{n,r,t as i}from"./compiler-runtime-CVnuRdak.js";import{wr as a}from"./dist-BGXCkPeI.js";import{u as o}from"./button-cneJOVxD.js";import{o as s,u as c}from"./documents-events-Bsq-Lwvc.js";import{p as ee}from"./doc-hash-CyR3apuv.js";import{r as te}from"./startup-marks-ChdnUQ0e.js";var l=o(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),u=o(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),d=o(`triangle-alert`,[[`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`}]]),f=e(n(),1),ne=i(),p=null,m=new Set;function h(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function g(e,t){return e===null?!1:e===t?!0:h(e.pages,t.pages)&&h(e.folderPaths,t.folderPaths)&&h(e.assetPaths??new Set,t.assetPaths??new Set)&&h(e.filePaths??new Set,t.filePaths??new Set)&&_(e.pageIcons,t.pageIcons)}function _(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function re(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function ie(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function ae(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function v(){return p}function oe(e){if(!g(p,e)){p=e;for(let t of Array.from(m))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function y(e){if(m.add(e),p!==null)try{e(p)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{m.delete(e)}}var b=null;function x(){if(b)return b;let e=(async()=>{let e=await fetch(`/api/documents`),t=await e.json().catch(e=>(console.warn(`[documents-fetch] /api/documents response was not valid JSON:`,e),null));return{ok:e.ok,status:e.status,body:t}})();return b=e,e.then(()=>{b===e&&(b=null)},()=>{b===e&&(b=null)}),e}var se=r(),S=(0,f.createContext)(null);function C(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function ce(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function le(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function ue(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(c(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function de(){let{ok:e,status:t,body:n}=await x();if(!e)throw Error(c(n)??`/api/documents responded with ${t}`);let r=n??{};return Array.isArray(r.documents)?{assetPaths:r.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:r.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),filePaths:r.documents.filter(e=>e.kind===`file`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[],filePaths:[]}}function fe(e){console.error(`[PageListContext] Failed to load pages:`,e)}function w(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function T(e){let t=(0,ne.c)(54),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,o]=(0,f.useState)(r),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=new Map,t[1]=c):c=t[1];let[l,u]=(0,f.useState)(c),d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=new Map,t[2]=d):d=t[2];let[p,m]=(0,f.useState)(d),h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[3]=h):h=t[3];let[g,_]=(0,f.useState)(h),v;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(v=new Set,t[4]=v):v=t[4];let[y,b]=(0,f.useState)(v),x;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(x=new Set,t[5]=x):x=t[5];let[w,T]=(0,f.useState)(x),E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=new Set,t[6]=E):E=t[6];let[D,O]=(0,f.useState)(E),[k,A]=(0,f.useState)(!0),[j,M]=(0,f.useState)(null),N=(0,f.useRef)(0),P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(){let e=N.current+=1;Promise.all([ue(),de().catch(ge)]).then(t=>{let[n,r]=t;if(e!==N.current)return;let i=new Set(n.map(he));o(i),u(new Map(n.map(me))),m(new Map(n.map(pe))),_(new Set(r.assetPaths)),b(new Set(r.folderPaths)),T(new Set(r.filePaths)),O(e=>ce(e,i)),M(null),te()}).catch(t=>{e===N.current&&(fe(t),M(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===N.current&&A(!1)})},t[7]=P):P=t[7];let F=P,I;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){O(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),M(null)},t[8]=I):I=t[8];let _e=I,L,R;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{F();let e=()=>{document.visibilityState===`visible`&&F()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=s(e=>{e.includes(`files`)&&F()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},R=[],t[9]=L,t[10]=R):(L=t[9],R=t[10]),(0,f.useEffect)(L,R);let z,B,V,H,U,W,G,K;if(t[11]!==D||t[12]!==g||t[13]!==w||t[14]!==y||t[15]!==p||t[16]!==l||t[17]!==i){W=C(i,D);let e;t[26]!==D||t[27]!==l?(e=le(l,D),t[26]=D,t[27]=l,t[28]=e):e=t[28],U=e,H=p,z=g,B=w,V=new Set([...ee(W),...y]),G=re(W,a),K=ie(W,a),t[11]=D,t[12]=g,t[13]=w,t[14]=y,t[15]=p,t[16]=l,t[17]=i,t[18]=z,t[19]=B,t[20]=V,t[21]=H,t[22]=U,t[23]=W,t[24]=G,t[25]=K}else z=t[18],B=t[19],V=t[20],H=t[21],U=t[22],W=t[23],G=t[24],K=t[25];let q=K,J;t[29]===p?J=t[30]:(J=ae(p),t[29]=p,t[30]=J);let Y=J,X,Z;t[31]!==z||t[32]!==B||t[33]!==V||t[34]!==Y||t[35]!==W||t[36]!==q||t[37]!==G?(X=()=>{oe({pages:W,folderPaths:V,pagesBySlug:G,pagesByBasename:q,assetPaths:z,filePaths:B,pageIcons:Y})},Z=[W,V,G,q,z,B,Y],t[31]=z,t[32]=B,t[33]=V,t[34]=Y,t[35]=W,t[36]=q,t[37]=G,t[38]=X,t[39]=Z):(X=t[38],Z=t[39]),(0,f.useEffect)(X,Z);let Q;t[40]!==z||t[41]!==j||t[42]!==B||t[43]!==V||t[44]!==k||t[45]!==H||t[46]!==U||t[47]!==W||t[48]!==q||t[49]!==G?(Q={pages:W,pagesBySlug:G,pagesByBasename:q,pageTitles:U,pageMeta:H,folderPaths:V,assetPaths:z,filePaths:B,loading:k,error:j,refetch:F,addPage:_e},t[40]=z,t[41]=j,t[42]=B,t[43]=V,t[44]=k,t[45]=H,t[46]=U,t[47]=W,t[48]=q,t[49]=G,t[50]=Q):Q=t[50];let $;return t[51]!==n||t[52]!==Q?($=(0,se.jsx)(S,{value:Q,children:n}),t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}function pe(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function me(e){return[e.docName,e.title]}function he(e){return e.docName}function ge(e){return w(e),{assetPaths:[],folderPaths:[],filePaths:[]}}function E(){let e=(0,f.use)(S);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function D(){return(0,f.use)(S)}var O=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),k=t(((e,t)=>{var n=O();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),A=t(((e,t)=>{t.exports=k()()}));export{x as a,d as c,E as i,u as l,T as n,v as o,D as r,y as s,A as t,l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{i as o,l as s}from"./button-
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{i as o,l as s}from"./button-cneJOVxD.js";import{i as c}from"./collapsible-NtcTfAgP.js";import{a as l,c as u,d,o as f,u as p}from"./dist-BpbMCVke.js";import{i as m,n as h,r as g,t as _}from"./tooltip-DY1syGNr.js";import{g as v}from"./dist-BHLnUfd3.js";import{t as y}from"./dist-CJgFPpZH.js";import{t as b}from"./dist-DFcaTwzj.js";import{n as x,r as S,t as C}from"./dist-D6OstNsL.js";var w=e(t(),1),T=n(),E=`Radio`,[D,O]=p(E),[k,A]=D(E),j=w.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:c=`on`,onCheck:l,form:f,...p}=e,[m,h]=w.useState(null),g=s(t,e=>h(e)),_=w.useRef(!1),v=m?f||!!m.closest(`form`):!0;return(0,T.jsxs)(k,{scope:n,checked:i,disabled:o,children:[(0,T.jsx)(d.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":I(i),"data-disabled":o?``:void 0,disabled:o,value:c,...p,ref:g,onClick:u(e.onClick,e=>{i||l?.(),v&&(_.current=e.isPropagationStopped(),_.current||e.stopPropagation())})}),v&&(0,T.jsx)(F,{control:m,bubbles:!_.current,name:r,value:c,checked:i,required:a,disabled:o,form:f,style:{transform:`translateX(-100%)`}})]})});j.displayName=E;var M=`RadioIndicator`,N=w.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=A(M,n);return(0,T.jsx)(l,{present:r||a.checked,children:(0,T.jsx)(d.span,{"data-state":I(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});N.displayName=M;var P=`RadioBubbleInput`,F=w.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=w.useRef(null),c=s(o,a),l=y(n),u=b(t);return w.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(l!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[l,n,r]),(0,T.jsx)(d.input,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:c,style:{...i.style,...u,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});F.displayName=P;function I(e){return e?`checked`:`unchecked`}var L=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],R=`RadioGroup`,[z,ee]=p(R,[S,O]),B=S(),V=O(),[H,U]=z(R),W=w.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:u=!0,onValueChange:p,...m}=e,h=B(n),g=v(l),[_,y]=f({prop:a,defaultProp:i??null,onChange:p,caller:R});return(0,T.jsx)(H,{scope:n,name:r,required:o,disabled:s,value:_,onValueChange:y,children:(0,T.jsx)(x,{asChild:!0,...h,orientation:c,dir:g,loop:u,children:(0,T.jsx)(d.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:g,...m,ref:t})})})});W.displayName=R;var G=`RadioGroupItem`,K=w.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=U(G,n),o=a.disabled||r,c=B(n),l=V(n),d=w.useRef(null),f=s(t,d),p=a.value===i.value,m=w.useRef(!1);return w.useEffect(()=>{let e=e=>{L.includes(e.key)&&(m.current=!0)},t=()=>m.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,T.jsx)(C,{asChild:!0,...c,focusable:!o,active:p,children:(0,T.jsx)(j,{disabled:o,required:a.required,checked:p,...l,...i,name:a.name,ref:f,onCheck:()=>a.onValueChange(i.value),onKeyDown:u(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:u(i.onFocus,()=>{m.current&&d.current?.click()})})})});K.displayName=G;var q=`RadioGroupIndicator`,J=w.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,T.jsx)(N,{...V(n),...r,ref:t})});J.displayName=q;var Y=W,X=K,Z=J,Q=r();function $(){let e=(0,Q.c)(8),{_:t}=a(),n;e[0]===t?n=e[1]:(n=t({id:`RrAIZx`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,T.jsx)(c,{className:`size-3.5`,"aria-hidden":!0}),e[2]=r):r=e[2];let o;e[3]===n?o=e[4]:(o=(0,T.jsx)(m,{className:`text-muted-foreground hover:text-foreground`,"aria-label":n,"data-testid":`config-sharing-info`,children:r}),e[3]=n,e[4]=o);let s;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,T.jsx)(h,{className:`max-w-xs`,children:(0,T.jsx)(`p`,{className:`leading-relaxed wrap-break-word`,children:(0,T.jsx)(i,{id:`0njBIq`,components:{0:(0,T.jsx)(`code`,{}),1:(0,T.jsx)(`code`,{}),2:(0,T.jsx)(`code`,{}),3:(0,T.jsx)(`br`,{}),4:(0,T.jsx)(`strong`,{className:`font-semibold`}),5:(0,T.jsx)(`br`,{}),6:(0,T.jsx)(`strong`,{className:`font-semibold`}),7:(0,T.jsx)(`code`,{})}})})}),e[5]=s):s=e[5];let l;return e[6]===o?l=e[7]:(l=(0,T.jsx)(g,{children:(0,T.jsxs)(_,{children:[o,s]})}),e[6]=o,e[7]=l),l}function te(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`grid w-full gap-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,T.jsx)(Y,{"data-slot":`radio-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ne(e){let t=(0,Q.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,T.jsx)(Z,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:(0,T.jsx)(`span`,{className:`absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground`})}),t[5]=a):a=t[5];let s;return t[6]!==r||t[7]!==i?(s=(0,T.jsx)(X,{"data-slot":`radio-group-item`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=s):s=t[8],s}export{ne as n,$ as r,te as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./button-
|
|
1
|
+
import{u as e}from"./button-cneJOVxD.js";var t=e(`refresh-cw`,[[`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`}]]);export{t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ot as e,tt as t}from"./DocumentContext-
|
|
1
|
+
import{ot as e,tt as t}from"./DocumentContext-Cp5LrwUt.js";function n(n){let r=t(n.state.selection.content(),n.state.schema);return e().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),n=[],r=!1;for(let e of t){let t=e.trim();if(/^(```|~~~)/.test(t)){r||n.push(`code`),r=!r;continue}if(r||t===``)continue;if(/^\|.*\|?$/.test(t)&&t.includes(`|`)){n[n.length-1]!==`table`&&n.push(`table`);continue}if(/^<\/?[A-Za-z]/.test(t)){n[n.length-1]!==`component`&&n.push(`component`);continue}let i=t.match(/^#{1,6}\s+(.*)$/);if(i){n.push(i[1]??``);continue}let a=t.match(/^[-*+]\s+(.*)$/);if(a){n.push(`• ${a[1]??``}`);continue}let o=t.match(/^\d+\.\s+(.*)$/);if(o){n.push(`• ${o[1]??``}`);continue}let s=t.match(/^>\s?(.*)$/);if(s){n.push(s[1]??``);continue}n.push(t)}return n.join(` `).replace(/\s+/g,` `).trim()}var o=new Map,s=new Set,c=(e,t)=>`${t}:${e}`;function l(){for(let e of s)e()}function u(e,t){return e.markdown===t.markdown&&e.sourceLineStart===t.sourceLineStart&&e.sourceLineEnd===t.sourceLineEnd}function d(e,t,n){let r=c(e,t);if(n===null){o.delete(r)&&l();return}let i=o.get(r);i&&u(i,n)||(o.set(r,n),l())}function f(e,t){return e===null?null:o.get(c(e,t))??null}function p(e){return s.add(e),()=>{s.delete(e)}}function m(e,t){if(e.state.selection.empty)return null;let r=n(e);return r.trim()?{surface:`wysiwyg`,docName:t,markdown:r,charLen:r.trim().length,lineCount:(r.match(/\n/g)?.length??0)+1}:null}function h(e,t){return e.trim()?{surface:`frontmatter`,docName:t,markdown:e,charLen:e.trim().length,lineCount:(e.match(/\n/g)?.length??0)+1}:null}function g(e,t){let n=[],r=1/0,i=-1;for(let t of e.state.selection.ranges)t.empty||(n.push(e.state.sliceDoc(t.from,t.to)),r=Math.min(r,t.from),i=Math.max(i,t.to));if(n.length===0)return null;let a=n.join(`
|
|
4
4
|
`);if(!a.trim())return null;let o=e.state.doc.lineAt(r).number,s=e.state.doc.lineAt(i).number;return{surface:`source`,docName:t,markdown:a,charLen:a.trim().length,lineCount:s-o+1,sourceLineStart:o,sourceLineEnd:s}}export{h as a,r as c,i,p as l,a as n,g as o,d as r,m as s,f as t,n as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{n as o}from"./dist-BVOt51sU.js";import{$t as s,Bt as c,Ct as l,J as u,Lt as d,Mt as f,Or as p,Qt as m,Zt as h,dn as g,en as _,ft as v,in as y,jt as b,k as x,n as S,nn as C,rn as w,t as T,tn as E,wt as D,xt as O,zt as k}from"./dist-BGXCkPeI.js";import{i as A,t as j,u as M}from"./button-Cw_0dYAP.js";import{c as N,l as P,n as F,o as ee,s as I}from"./skill-scope-D_YpwXm9.js";import{n as L,r as R}from"./config-context-B6QjZ1RW.js";import{t as z}from"./loader-circle-BFgDr9-d.js";import{t as B}from"./refresh-cw-BHaAFbCQ.js";import{a as V,i as H,n as U,t as W}from"./cursor-DWg4aKeS.js";import{n as G}from"./dist-DoPCS53q.js";import{a as te,c as ne,i as re,n as K,o as ie,r as q,s as ae,t as oe}from"./dialog-YBH5PjUS.js";import{C as J,S as Y,_ as X,a as se,d as ce,f as le,g as ue,n as de,s as fe,t as pe,v as me,w as he,x as ge}from"./skills-api-D8o77mG3.js";import{t as _e}from"./label-TedtbqkV.js";import{t as ve}from"./input-DkflumBI.js";import{l as ye,o as be,s as xe,u as Se}from"./documents-events-Bsq-Lwvc.js";var Ce=M(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),we=M(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Te=M(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=r(),Q=e(t(),1);function Ee(){let[e]=(0,Q.useState)(De);return e}function De(){return g()!=null}var Oe=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`},{id:`opencode`,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`}],ke=Oe.filter(e=>e.id!==`claude-cowork`&&e.id!==`opencode`),$=n();function Ae(){let e=(0,Z.c)(3),[t,n]=(0,Q.useState)(Ne),r,i;return e[0]===t?(r=e[1],i=e[2]):(r=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let r=await t.json().catch(Me);if(!e||!t.ok)return;let i=b.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(je),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Q.useEffect)(r,i),t}function je(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function Me(){return null}function Ne(){return Pe()}function Pe(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}function Fe(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Ie(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Se(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Le(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Fe(e):Ie()}var Re=`ok:skill:cowork:installed`,ze=`1`,Be=250,Ve=`/api/skill/install-state`;function He(e){return`${Re}:v${e}`}var Ue=new Map;async function We(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Ue.get(n);if(r)return r;let i=Ge(e,t);return Ue.set(n,i),i.finally(()=>{Ue.get(n)===i&&Ue.delete(n)}),i}async function Ge(e,t){let n=e.installer===void 0?Le():e.installer,r=Ke(e.storage),i=e.fetchSnapshot??Je,a=e.serverTimeoutMs??Be,o=null;if(!t.force){try{o=await Ye(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=He(o?.currentVersion??e.fallbackSkillVersion??qe());if(!t.force&&r?.getItem(s)===ze)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,ze)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function Ke(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function qe(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Je(){let e;try{e=await fetch(Ve,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function Ye(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Xe(e){return We({},e)}function Ze(){return We({},{force:!0})}async function Qe(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function $e(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Qe({target:`claude-cowork`,url:d({mode:`cowork`},e)},n);case`claude-code`:return Qe({target:`claude-code`,url:d({mode:`code`},e)},n);case`codex`:return Qe({target:`codex`,url:k(e)},n);case`cursor`:return Qe({target:`cursor`,url:c(e),workspacePath:e.projectDir},n);case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function et(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:tt(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:tt(e)}}}function tt(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}async function nt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function rt(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function it(e){return`${e}.md`}function at(e){if(!e.docName||!e.workspace)return null;let t=it(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:rt(n,t,r)}}function ot(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function st(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function ct(e){return et(e.installUrl).then(()=>void 0)}function lt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function ut(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function dt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=it(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:rt(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function ft(e){return`Opened in ${e}.`}function pt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function mt(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function ht(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function gt(e,t,n){if(e.scope===`doc`){let r={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n};return e.selection===void 0?r:{...r,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n}}function _t(e,t,n){return e.compose?f(gt(e.compose,t,n)):e.selection?C({...e.selection,target:t}):e.skill?w(e.skill.name,e.skill.scope,n):e.ask?h(e.ask.relativePath,e.ask.instruction,n,t):p(e.docContext===null?e.folderRelativePath?E(e.folderRelativePath,n,e.instruction):e.createDescription===void 0?s(n,e.instruction):m(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[]):_(e.docContext.relativePath,n,e.instruction))}function vt(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${u} ${_t(e,l[t].handoffTarget,!1)}`:y(e.docContext?.relativePath??null)}async function yt(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:_t(t,e,n.autoOpen)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=ht(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(ft(u));else{let i=mt(r),a=pt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{yt(e,t,n,r+1)}}})}return a}function bt(e){return Oe.find(t=>t.id===e)?.displayName??e}function xt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function St(){return{dispatchHandoff:$e,recordHandoff:nt,toast:{success:e=>{G.success(e)},error:(e,t)=>{G.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>xt(),getDisplayName:bt,ensureCoworkSkillInstalled:Xe,autoOpen:!0}}function Ct(){let e=(0,Z.c)(2),{merged:t}=L(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>yt(e,t,{...St(),autoOpen:n}),reinstallCoworkSkill:Ze},e[0]=n,e[1]=r),r}var wt=[...new Set(Oe.flatMap(e=>e.schemes))];function Tt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of Oe){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Et(e){return Tt({},e)}async function Dt(e){let t=e.schemes??wt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ot=Object.fromEntries(wt.map(e=>[e,{installed:!1}]));async function kt(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ot}if(!t.ok)return Ot;let n;try{n=await t.json()}catch{return Ot}if(typeof n!=`object`||!n||Array.isArray(n))return Ot;let r=n,i={};for(let e of wt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function At(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function jt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Et({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Tt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!At(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Mt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Nt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Dt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>kt({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Pt(){let e=(0,Z.c)(5),[t,n]=(0,Q.useState)(Ft),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=jt(Nt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Ft(){return Et({isElectronHost:Mt(),now:Date.now})}function It(e){return!(e instanceof Error)||e.name!==`NotAllowedError`?!1:/permission denied|permissions policy/i.test(e.message)}function Lt(e){let t=globalThis.document;if(!t?.body||typeof t.createElement!=`function`||typeof t.execCommand!=`function`)return!1;let n=t.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,n.style.pointerEvents=`none`,n.setAttribute(`readonly`,``),t.body.appendChild(n);try{return n.focus(),n.select(),t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}async function Rt(e){let t=globalThis.okDesktop?.clipboard;if(t&&typeof t.writeText==`function`){await t.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n&&typeof n.writeText==`function`)try{await n.writeText(e);return}catch(t){if(Lt(e))return;throw t}if(!Lt(e))throw Error(`clipboard API unavailable`)}function zt(e){let t=(0,Z.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`title`,{children:`OpenCode icon`}),r=(0,$.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M384 416H128V96H384V416ZM320 160H192V352H320V160Z`}),i=(0,$.jsx)(`path`,{fill:`currentColor`,fillOpacity:.55,d:`M320 224V352H192V224H320Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,$.jsxs)(`svg`,{role:`img`,"aria-label":`OpenCode icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 512 512`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var Bt={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`,opencode:`opencode`};function Vt(e){let t=(0,Z.c)(27),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:s}=o(),c=Bt[r],l=c?(s===`dark`?S[c]:void 0)??T[c]:void 0,u;t[5]!==l||t[6]!==a?(u=l?{...a,"--ok-brand-color":l}:a,t[5]=l,t[6]=a,t[7]=u):u=t[7];let d=u,f=l&&`[&_*]:![color:var(--ok-brand-color)]`,p;t[8]!==n||t[9]!==f?(p=A(f,n),t[8]=n,t[9]=f,t[10]=p):p=t[10];let m=p;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==m||t[12]!==d||t[13]!==i?(e=(0,$.jsx)(H,{style:d,className:m,...i}),t[11]=m,t[12]=d,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==m||t[16]!==d||t[17]!==i?(e=(0,$.jsx)(U,{style:d,className:m,...i}),t[15]=m,t[16]=d,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==m||t[20]!==d||t[21]!==i?(e=(0,$.jsx)(W,{style:d,className:m,...i}),t[19]=m,t[20]=d,t[21]=i,t[22]=e):e=t[22],e}if(r===`opencode`){let e;return t[23]!==m||t[24]!==d||t[25]!==i?(e=(0,$.jsx)(zt,{style:d,className:m,...i}),t[23]=m,t[24]=d,t[25]=i,t[26]=e):e=t[26],e}return null}var Ht=(0,Q.createContext)(null);function Ut(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(Ht,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Wt(){return(0,Q.use)(Ht)}var Gt=D;function Kt(e){return l[e].handoffTarget}function qt(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:l,customConfirmLabel:u,customConfirmLabelBusy:d,children:f}=e,{_:p}=a(),m;t[0]!==p||t[1]!==n?(m=n??p({id:`L3CEC1`}),t[0]=p,t[1]=n,t[2]=m):m=t[2];let h=m,g;t[3]!==p||t[4]!==u?(g=u??p({id:`cnGeoo`}),t[3]=p,t[4]=u,t[5]=g):g=t[5];let _=g,v;t[6]!==p||t[7]!==u||t[8]!==d?(v=d??u??p({id:`s3caR3`}),t[6]=p,t[7]=u,t[8]=d,t[9]=v):v=t[9];let y=v,b;t[10]!==p||t[11]!==s||t[12]!==h?(b=s??p({id:`77SdEP`,values:{itemName:h}}),t[10]=p,t[11]=s,t[12]=h,t[13]=b):b=t[13];let x;t[14]===b?x=t[15]:(x=(0,$.jsx)(ne,{children:b}),t[14]=b,t[15]=x);let S;t[16]!==p||t[17]!==c||t[18]!==h?(S=c??p({id:`16D5Zj`,values:{itemName:h}}),t[16]=p,t[17]=c,t[18]=h,t[19]=S):S=t[19];let C;t[20]===S?C=t[21]:(C=(0,$.jsx)(te,{className:`whitespace-pre-wrap`,children:S}),t[20]=S,t[21]=C);let w;t[22]===l?w=t[23]:(w=l?(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:l}):null,t[22]=l,t[23]=w);let T;t[24]!==x||t[25]!==C||t[26]!==w?(T=(0,$.jsxs)(ae,{children:[x,C,w]}),t[24]=x,t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;t[28]===f?E=t[29]:(E=f?(0,$.jsx)(K,{children:f}):null,t[28]=f,t[29]=E);let D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(i,{id:`dEgA5A`}),t[30]=D):D=t[30];let O;t[31]===r?O=t[32]:(O=(0,$.jsx)(q,{asChild:!0,children:(0,$.jsx)(j,{variant:`outline`,disabled:r,children:D})}),t[31]=r,t[32]=O);let k;t[33]!==_||t[34]!==y||t[35]!==r?(k=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(z,{className:`size-4 animate-spin`}),` `,y]}):_,t[33]=_,t[34]=y,t[35]=r,t[36]=k):k=t[36];let A;t[37]!==r||t[38]!==o||t[39]!==k?(A=(0,$.jsx)(j,{variant:`destructive`,onClick:o,disabled:r,children:k}),t[37]=r,t[38]=o,t[39]=k,t[40]=A):A=t[40];let M;t[41]!==O||t[42]!==A?(M=(0,$.jsxs)(ie,{children:[O,A]}),t[41]=O,t[42]=A,t[43]=M):M=t[43];let N;return t[44]!==E||t[45]!==M||t[46]!==T?(N=(0,$.jsxs)(re,{children:[T,E,M]}),t[44]=E,t[45]=M,t[46]=T,t[47]=N):N=t[47],N}function Jt(e){return e?ye._({id:`wTcjov`}):null}function Yt(e){let t=(0,Z.c)(30),{_:n}=a(),r=Ee(),o=Wt();if(r)return null;let{input:s,installStates:c,dispatch:u}=e,d=s===null,f,p,m,h,g,_,v;if(t[0]!==n||t[1]!==u||t[2]!==s||t[3]!==d||t[4]!==c||t[5]!==o){let e=Jt(d),r;t[13]===c?r=t[14]:(r=e=>c[e.id]?.installed===!0,t[13]=c,t[14]=r);let a=ke.filter(r),y;t[15]===c?y=t[16]:(y=ke.some(e=>c[e.id]?.installed==null),t[15]=c,t[16]=y),m=y;let b=a.length>0,x=o!==null;h=!b&&!x,p=Y,t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(he,{children:[(0,$.jsx)(V,{"aria-hidden":`true`}),(0,$.jsx)(i,{id:`O7_W_a`})]}),t[17]=v):v=t[17],f=J,g=x?(0,$.jsxs)(ue,{"aria-label":n({id:`ALhMYW`}),children:[(0,$.jsx)(me,{children:(0,$.jsx)(i,{id:`ALhMYW`})}),Gt.map(t=>{let{displayName:r}=l[t];return(0,$.jsxs)(X,{onSelect:()=>{s!==null&&o.launchInTerminal(s,t)},disabled:d,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,$.jsx)(Vt,{id:Kt(t),"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,_=b?(0,$.jsxs)($.Fragment,{children:[x?(0,$.jsx)(ge,{}):null,(0,$.jsxs)(ue,{"aria-label":n({id:`BBqGS9`}),children:[(0,$.jsx)(me,{children:(0,$.jsx)(i,{id:`BBqGS9`})}),a.map(t=>{let r=!d,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,$.jsxs)(X,{disabled:!r,onSelect:()=>{s&&u(t.id,s)},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,$.jsx)(Vt,{id:t.id,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=u,t[2]=s,t[3]=d,t[4]=c,t[5]=o,t[6]=f,t[7]=p,t[8]=m,t[9]=h,t[10]=g,t[11]=_,t[12]=v}else f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],v=t[12];let y;t[18]!==m||t[19]!==h?(y=h?(0,$.jsx)(X,{disabled:!0,"data-testid":`file-tree-open-in-empty`,children:m?(0,$.jsx)(i,{id:`EcR0fl`}):(0,$.jsx)(i,{id:`l6OXqI`})}):null,t[18]=m,t[19]=h,t[20]=y):y=t[20];let b;t[21]!==f||t[22]!==g||t[23]!==_||t[24]!==y?(b=(0,$.jsxs)(f,{children:[g,_,y]}),t[21]=f,t[22]=g,t[23]=_,t[24]=y,t[25]=b):b=t[25];let x;return t[26]!==p||t[27]!==v||t[28]!==b?(x=(0,$.jsxs)(p,{children:[v,b]}),t[26]=p,t[27]=v,t[28]=b,t[29]=x):x=t[29],x}function Xt(e){let t=(0,Z.c)(8),n=e?.enabled??!0,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(0),c,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=()=>s(en),t=xe(e),n=be(t=>{t.includes(`files`)&&e()});return()=>{t(),n()}},l=[],t[1]=c,t[2]=l):(c=t[1],l=t[2]),(0,Q.useEffect)(c,l);let u;t[3]===n?u=t[4]:(u=()=>{if(!n)return;let e=!1;return a($t),fetch(`/api/skills`).then(Zt).then(t=>{if(e)return;let n=O.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skills response failed schema validation:`,n.error.issues),a({status:`error`,message:`Server returned an incomplete skills response.`});return}a({status:`ready`,data:n.data.skills})}).catch(t=>{e||a({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},t[3]=n,t[4]=u);let d;return t[5]!==n||t[6]!==o?(d=[o,n],t[5]=n,t[6]=o,t[7]=d):d=t[7],(0,Q.useEffect)(u,d),i}async function Zt(e){if(!e.ok){let t=await e.json().catch(Qt);throw Error(Se(t)??`HTTP ${e.status}`)}return e.json()}function Qt(){return null}function $t(e){return e.status===`ready`?e:{status:`loading`}}function en(e){return e+1}function tn(e){let t=(0,Z.c)(16),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:o}=a(),[s,c]=(0,Q.useState)(!1),l;t[0]!==o||t[1]!==i||t[2]!==r?(l=async function(e){c(!0);let t=await pe(e.scope,e.name);if(c(!1),!t.ok){let{error:e}=t;G.error(o({id:`AtBdnD`,values:{error:e}}));return}G.success(o({id:`h9QFb9`,values:{0:e.name}})),i(),r(!1)},t[0]=o,t[1]=i,t[2]=r,t[3]=l):l=t[3];let u=l,d=n!==null,f;t[4]!==s||t[5]!==r?(f=e=>{!e&&!s&&r(!1)},t[4]=s,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==n?(p=n?(0,$.jsx)(qt,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:s,onDelete:()=>u(n),customDescription:o({id:`E1Da_b`,values:{0:n.path}})}):null,t[7]=o,t[8]=s,t[9]=u,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,$.jsx)(oe,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function nn(e){let t=(0,Z.c)(68),{skill:n,existingNames:r,onOpenChange:o,onRenamed:s}=e,{_:c}=a(),l=n!==null,u=(0,Q.useId)(),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(!1),h;t[0]===n?h=t[1]:(h=()=>{n&&f(n.name)},t[0]=n,t[1]=h);let g=n?.scope,_=n?.name,y;if(t[2]!==g||t[3]!==_?(y=[g,_],t[2]=g,t[3]=_,t[4]=y):y=t[4],(0,Q.useEffect)(h,y),!n)return null;let b,x,S,C;t[5]!==r||t[6]!==d||t[7]!==n.name?(S=d.trim(),C=S===n.name,b=S===``||!v.test(S),x=!b&&!C&&r.has(S),t[5]=r,t[6]=d,t[7]=n.name,t[8]=b,t[9]=x,t[10]=S,t[11]=C):(b=t[8],x=t[9],S=t[10],C=t[11]);let w=x,T=!b&&!w&&!C&&!p,E;t[12]!==c||t[13]!==T||t[14]!==o||t[15]!==s||t[16]!==n||t[17]!==S?(E=async function(){if(!n||!T)return;m(!0);let e=await fe({scope:n.scope,fromName:n.name,toName:S});if(m(!1),!e.ok){G.error(c({id:`zKxoPm`,values:{0:n.name,1:e.error}}));return}G.success(c({id:`dUCQo4`,values:{trimmed:S}})),s?.(S),o(!1)},t[12]=c,t[13]=T,t[14]=o,t[15]=s,t[16]=n,t[17]=S,t[18]=E):E=t[18];let D=E,O;t[19]===o?O=t[20]:(O=e=>e?null:o(!1),t[19]=o,t[20]=O);let k;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(ne,{children:(0,$.jsx)(i,{id:`dw_3cv`})}),t[21]=k):k=t[21];let A;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsxs)(ae,{children:[k,(0,$.jsx)(te,{children:(0,$.jsx)(i,{id:`R9IDFz`})})]}),t[22]=A):A=t[22];let M;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(i,{id:`6YtxFj`}),t[23]=M):M=t[23];let N;t[24]===u?N=t[25]:(N=(0,$.jsx)(_e,{htmlFor:u,children:M}),t[24]=u,t[25]=N);let P;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>f(e.target.value),t[26]=P):P=t[26];let F;t[27]===D?F=t[28]:(F=e=>{e.key===`Enter`&&D()},t[27]=D,t[28]=F);let ee=b||w,I=b&&S!==``||w?`${u}-error`:void 0,L;t[29]!==u||t[30]!==d||t[31]!==F||t[32]!==ee||t[33]!==I?(L=(0,$.jsx)(ve,{id:u,value:d,onChange:P,onKeyDown:F,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":ee,"aria-describedby":I,className:`font-mono`}),t[29]=u,t[30]=d,t[31]=F,t[32]=ee,t[33]=I,t[34]=L):L=t[34];let R;t[35]!==w||t[36]!==u||t[37]!==b||t[38]!==S?(R=b&&S!==``?(0,$.jsx)(`p`,{id:`${u}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`A50vr3`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}):w?(0,$.jsx)(`p`,{id:`${u}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`YJ1BTp`})}):null,t[35]=w,t[36]=u,t[37]=b,t[38]=S,t[39]=R):R=t[39];let z;t[40]!==N||t[41]!==L||t[42]!==R?(z=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[N,L,R]}),t[40]=N,t[41]=L,t[42]=R,t[43]=z):z=t[43];let B;t[44]===o?B=t[45]:(B=()=>o(!1),t[44]=o,t[45]=B);let V;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(i,{id:`dEgA5A`}),t[46]=V):V=t[46];let H;t[47]!==p||t[48]!==B?(H=(0,$.jsx)(j,{variant:`ghost`,onClick:B,disabled:p,children:V}),t[47]=p,t[48]=B,t[49]=H):H=t[49];let U;t[50]===D?U=t[51]:(U=()=>void D(),t[50]=D,t[51]=U);let W=!T,K;t[52]===p?K=t[53]:(K=p?(0,$.jsx)(i,{id:`tHKQ6j`}):(0,$.jsx)(i,{id:`2wxgft`}),t[52]=p,t[53]=K);let q;t[54]!==U||t[55]!==W||t[56]!==K?(q=(0,$.jsx)(j,{onClick:U,disabled:W,children:K}),t[54]=U,t[55]=W,t[56]=K,t[57]=q):q=t[57];let J;t[58]!==H||t[59]!==q?(J=(0,$.jsxs)(ie,{children:[H,q]}),t[58]=H,t[59]=q,t[60]=J):J=t[60];let Y;t[61]!==z||t[62]!==J?(Y=(0,$.jsxs)(re,{children:[A,z,J]}),t[61]=z,t[62]=J,t[63]=Y):Y=t[63];let X;return t[64]!==l||t[65]!==Y||t[66]!==O?(X=(0,$.jsx)(oe,{open:l,onOpenChange:O,children:Y}),t[64]=l,t[65]=Y,t[66]=O,t[67]=X):X=t[67],X}function rn(e){let t=(0,Z.c)(15),{skill:n,onOpenChange:r,onUpdated:o}=e,{_:s}=a(),[c,l]=(0,Q.useState)(!1),u;t[0]!==s||t[1]!==r||t[2]!==o?(u=async function(e){l(!0);let t=await le({scope:e.scope,name:e.name});l(!1);let n=F(e.name);if(!t.ok){G.error(s({id:`FRqZ9v`,values:{0:t.error}}));return}G.success(t.checkpointRef?s({id:`My9uXI`,values:{0:t.version,display:n}}):s({id:`mPneVR`,values:{0:t.version,display:n}})),o(),r(!1)},t[0]=s,t[1]=r,t[2]=o,t[3]=u):u=t[3];let d=u,f=n!==null,p;t[4]!==r||t[5]!==c?(p=e=>{!e&&!c&&r(!1)},t[4]=r,t[5]=c,t[6]=p):p=t[6];let m;t[7]!==d||t[8]!==n||t[9]!==c?(m=n?(0,$.jsxs)(re,{className:`sm:max-w-lg`,children:[(0,$.jsxs)(ae,{children:[(0,$.jsx)(ne,{children:(0,$.jsx)(i,{id:`iAoh55`,values:{0:F(n.name)}})}),(0,$.jsx)(te,{children:n.installedVersion?(0,$.jsx)(i,{id:`47EXvY`,values:{0:n.bundledVersion??``,1:n.installedVersion}}):(0,$.jsx)(i,{id:`nD7Fx9`,values:{0:n.bundledVersion??``}})})]}),(0,$.jsx)(K,{}),(0,$.jsxs)(ie,{children:[(0,$.jsx)(q,{asChild:!0,children:(0,$.jsx)(j,{variant:`outline`,disabled:c,children:(0,$.jsx)(i,{id:`dEgA5A`})})}),(0,$.jsx)(j,{onClick:()=>void d(n),disabled:c,children:c?(0,$.jsx)(i,{id:`JL3si7`}):(0,$.jsx)(i,{id:`EkH9pt`})})]})]}):null,t[7]=d,t[8]=n,t[9]=c,t[10]=m):m=t[10];let h;return t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,$.jsx)(oe,{open:f,onOpenChange:p,children:m}),t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14],h}function an(){let e=(0,Z.c)(30),{_:t}=a(),[n,r]=(0,Q.useState)(null),[i,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),d;e[0]===t?d=e[1]:(d=async function(e,n){u(e.name);let r=await se({scope:e.scope,name:e.name,...n?{targets:[...n]}:{}});if(u(null),!r.ok)return G.error(t({id:`Mj8R8K`,values:{0:r.error}})),r;let i=on,a=new Set(r.hosts),o=r.hosts.filter(t=>!e.hosts.includes(t)),s=e.hosts.filter(e=>!a.has(e)),c=e=>{let t=r.warningCodes.indexOf(e);return t>=0?r.warnings[t]:void 0},l=c(`no-targets`);if(l)return G.warning(l),r;if(o.length>0){let e=c(`scripts-present`);e&&G.warning(e)}return r.hosts.length===0?G.success(t({id:`0LBDjY`,values:{0:e.name}})):o.length>0&&s.length===0?G.success(t({id:`PPFQ3o`,values:{0:e.name,1:i(o)}})):s.length>0&&o.length===0?G.success(t({id:`OOIVJo`,values:{0:e.name,1:i(s)}})):o.length>0&&s.length>0?G.success(t({id:`OxplNM`,values:{0:e.name,1:i(o),2:i(s)}})):G.success(t({id:`wDgmsr`,values:{0:e.name,1:i(r.hosts)}})),r},e[0]=t,e[1]=d);let f=d,p;e[2]===t?p=e[3]:(p=async function(e){u(e.name);let n=await ce({scope:e.scope,name:e.name});return u(null),n.ok?G.success(t({id:`0LBDjY`,values:{0:e.name}})):G.error(t({id:`nJq7et`,values:{0:n.error}})),n},e[2]=t,e[3]=p);let m=p,h;e[4]===t?h=e[5]:(h=async function(e,n){let r=await de({scope:e.scope,name:e.name,existingNames:n});if(!r.ok){G.error(t({id:`UPjaXD`,values:{0:e.name,1:r.error}}));return}G.success(t({id:`0g7rCZ`,values:{0:r.name}}))},e[4]=t,e[5]=h);let g=h,_,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e||r(null)},v=()=>r(null),e[6]=_,e[7]=v):(_=e[6],v=e[7]);let y;e[8]===n?y=e[9]:(y=(0,$.jsx)(tn,{skill:n,onOpenChange:_,onDeleted:v}),e[8]=n,e[9]=y);let b=i?.skill??null,x=i?.existingNames??cn,S,C;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e||o(null)},C=()=>o(null),e[10]=S,e[11]=C):(S=e[10],C=e[11]);let w;e[12]!==b||e[13]!==x?(w=(0,$.jsx)(nn,{skill:b,existingNames:x,onOpenChange:S,onRenamed:C}),e[12]=b,e[13]=x,e[14]=w):w=e[14];let T,E;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e||c(null)},E=()=>c(null),e[15]=T,e[16]=E):(T=e[15],E=e[16]);let D;e[17]===s?D=e[18]:(D=(0,$.jsx)(rn,{skill:s,onOpenChange:T,onUpdated:E}),e[17]=s,e[18]=D);let O;e[19]!==w||e[20]!==D||e[21]!==y?(O=(0,$.jsxs)($.Fragment,{children:[y,w,D]}),e[19]=w,e[20]=D,e[21]=y,e[22]=O):O=e[22];let k=O,A;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=(e,t)=>o({skill:e,existingNames:t}),e[23]=A):A=e[23];let j;return e[24]!==k||e[25]!==g||e[26]!==f||e[27]!==l||e[28]!==m?(j={installingName:l,install:f,uninstall:m,duplicate:g,requestDelete:r,requestRename:A,requestUpdate:c,dialogs:k},e[24]=k,e[25]=g,e[26]=f,e[27]=l,e[28]=m,e[29]=j):j=e[29],j}function on(e){return e.map(sn).join(`, `)}function sn(e){return x[e]??e}var cn=new Set;function ln(e){let t=(0,Z.c)(19),{skill:n,onEdit:r,onInstall:a,onUninstall:o,onDelete:s}=e,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(I,{"aria-hidden":!0}),l=(0,$.jsx)(i,{id:`ePK91l`}),t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===r?u=t[3]:(u=(0,$.jsxs)(X,{onSelect:r,children:[c,l]}),t[2]=r,t[3]=u);let d;t[4]!==a||t[5]!==n.installed?(d=a&&!n.installed?(0,$.jsxs)(X,{onSelect:a,children:[(0,$.jsx)(Ce,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`TKQ7K-`})]}):null,t[4]=a,t[5]=n.installed,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.installed?(f=n.installed?(0,$.jsxs)(X,{onSelect:o,children:[(0,$.jsx)(Te,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`fo0VXg`})]}):null,t[7]=o,t[8]=n.installed,t[9]=f):f=t[9];let p,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(ee,{"aria-hidden":!0}),m=(0,$.jsx)(i,{id:`cnGeoo`}),t[10]=p,t[11]=m):(p=t[10],m=t[11]);let h;t[12]===s?h=t[13]:(h=(0,$.jsxs)(X,{variant:`destructive`,onSelect:s,children:[p,m]}),t[12]=s,t[13]=h);let g;return t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==h?(g=(0,$.jsxs)($.Fragment,{children:[u,d,f,h]}),t[14]=u,t[15]=d,t[16]=f,t[17]=h,t[18]=g):g=t[18],g}function un(e){let t=(0,Z.c)(65),{skill:n,actions:r,existingNames:o}=e,{_:s}=a(),c=Ae(),l=Pt().states,{dispatch:u}=Ct(),d=typeof window<`u`?window.okDesktop:void 0,f=n.absolutePath,p;t[0]===s?p=t[1]:(p=async function(e){try{await Rt(e),G.success(s({id:`SXCSQd`}))}catch{G.error(s({id:`cRHuuI`}))}},t[0]=s,t[1]=p);let m=p,h;t[2]===f?h=t[3]:(h=d&&f?(0,$.jsxs)(X,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,$.jsx)(R,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`LtSYdi`})]}):null,t[2]=f,t[3]=h);let g;t[4]!==n.name||t[5]!==n.scope||t[6]!==c?(g=ut({skillName:n.name,scope:n.scope,workspace:c}),t[4]=n.name,t[5]=n.scope,t[6]=c,t[7]=g):g=t[7];let _;t[8]!==u||t[9]!==l||t[10]!==g?(_=(0,$.jsx)(Yt,{input:g,installStates:l,isElectronHost:d!=null,dispatch:u}),t[8]=u,t[9]=l,t[10]=g,t[11]=_):_=t[11];let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(he,{children:[(0,$.jsx)(N,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`zd00pH`})]}),t[12]=v):v=t[12];let y;t[13]!==f||t[14]!==m?(y=f?(0,$.jsx)(X,{onSelect:()=>void m(f),children:(0,$.jsx)(i,{id:`z2funE`})}):null,t[13]=f,t[14]=m,t[15]=y):y=t[15];let b;t[16]!==m||t[17]!==n.path?(b=()=>void m(n.path),t[16]=m,t[17]=n.path,t[18]=b):b=t[18];let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(i,{id:`xloBjn`}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,$.jsx)(X,{onSelect:b,children:x}),t[20]=b,t[21]=S);let C;t[22]!==y||t[23]!==S?(C=(0,$.jsxs)(Y,{children:[v,(0,$.jsxs)(J,{children:[y,S]})]}),t[22]=y,t[23]=S,t[24]=C):C=t[24];let w;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(ge,{}),t[25]=w):w=t[25];let T;t[26]!==r||t[27]!==o||t[28]!==n?(T=()=>void r.duplicate(n,o),t[26]=r,t[27]=o,t[28]=n,t[29]=T):T=t[29];let E,D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(P,{"aria-hidden":!0}),D=(0,$.jsx)(i,{id:`euc6Ns`}),t[30]=E,t[31]=D):(E=t[30],D=t[31]);let O;t[32]===T?O=t[33]:(O=(0,$.jsxs)(X,{onSelect:T,children:[E,D]}),t[32]=T,t[33]=O);let k;t[34]!==r||t[35]!==o||t[36]!==n?(k=()=>r.requestRename(n,o),t[34]=r,t[35]=o,t[36]=n,t[37]=k):k=t[37];let A,j;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(we,{"aria-hidden":!0}),j=(0,$.jsx)(i,{id:`2wxgft`}),t[38]=A,t[39]=j):(A=t[38],j=t[39]);let M;t[40]===k?M=t[41]:(M=(0,$.jsxs)(X,{onSelect:k,children:[A,j]}),t[40]=k,t[41]=M);let F;t[42]!==r||t[43]!==n?(F=n.updateAvailable?(0,$.jsxs)(X,{onSelect:()=>r.requestUpdate(n),children:[(0,$.jsx)(B,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`6g2jsp`})]}):null,t[42]=r,t[43]=n,t[44]=F):F=t[44];let I;t[45]!==r||t[46]!==n?(I=n.installed?(0,$.jsxs)(X,{onSelect:()=>void r.uninstall(n),children:[(0,$.jsx)(Te,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`fo0VXg`})]}):(0,$.jsxs)(X,{onSelect:()=>void r.install(n),children:[(0,$.jsx)(Ce,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`TKQ7K-`})]}),t[45]=r,t[46]=n,t[47]=I):I=t[47];let L;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(ge,{}),t[48]=L):L=t[48];let z;t[49]!==r||t[50]!==n?(z=()=>r.requestDelete(n),t[49]=r,t[50]=n,t[51]=z):z=t[51];let V,H;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(ee,{"aria-hidden":!0}),H=(0,$.jsx)(i,{id:`cnGeoo`}),t[52]=V,t[53]=H):(V=t[52],H=t[53]);let U;t[54]===z?U=t[55]:(U=(0,$.jsxs)(X,{variant:`destructive`,onSelect:z,children:[V,H]}),t[54]=z,t[55]=U);let W;return t[56]!==C||t[57]!==O||t[58]!==M||t[59]!==h||t[60]!==F||t[61]!==I||t[62]!==U||t[63]!==_?(W=(0,$.jsxs)($.Fragment,{children:[h,_,C,w,O,M,F,I,L,U]}),t[56]=C,t[57]=O,t[58]=M,t[59]=h,t[60]=F,t[61]=I,t[62]=U,t[63]=_,t[64]=W):W=t[64],W}export{Ce as A,ct as C,Ae as D,rt as E,ke as O,bt as S,it as T,lt as _,Yt as a,ut as b,Kt as c,Vt as d,It as f,st as g,dt as h,Xt as i,Ee as k,Ut as l,Pt as m,un as n,qt as o,Rt as p,an as r,Gt as s,ln as t,Wt as u,at as v,Ct as w,vt as x,ot as y};
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{n as o}from"./dist-BVOt51sU.js";import{$t as s,Bt as c,Ct as l,J as u,Lt as d,Mt as f,Or as p,Qt as m,Zt as h,dn as g,en as _,ft as v,in as y,jt as b,k as x,n as S,nn as C,rn as w,t as T,tn as E,wt as D,xt as O,zt as k}from"./dist-BGXCkPeI.js";import{i as A,t as j,u as M}from"./button-cneJOVxD.js";import{c as N,l as P,n as F,o as ee,s as I}from"./skill-scope-Bt2TwqtA.js";import{n as L,r as R}from"./config-context-CVpOcWSZ.js";import{t as z}from"./loader-circle-CiIO3Fk-.js";import{t as B}from"./refresh-cw-EVALIeLp.js";import{a as V,i as H,n as U,t as W}from"./cursor-CGeB2PU5.js";import{n as G}from"./dist-Dk6VEDeZ.js";import{a as te,c as ne,i as re,n as K,o as ie,r as q,s as ae,t as oe}from"./dialog-DqxKeWl_.js";import{C as J,S as Y,_ as X,a as se,d as ce,f as le,g as ue,n as de,s as fe,t as pe,v as me,w as he,x as ge}from"./skills-api-C8U58cr0.js";import{t as _e}from"./label-C2i80316.js";import{t as ve}from"./input-DaVPmsWF.js";import{l as ye,o as be,s as xe,u as Se}from"./documents-events-Bsq-Lwvc.js";var Ce=M(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),we=M(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Te=M(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=r(),Q=e(t(),1);function Ee(){let[e]=(0,Q.useState)(De);return e}function De(){return g()!=null}var Oe=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`},{id:`opencode`,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`}],ke=Oe.filter(e=>e.id!==`claude-cowork`&&e.id!==`opencode`),$=n();function Ae(){let e=(0,Z.c)(3),[t,n]=(0,Q.useState)(Ne),r,i;return e[0]===t?(r=e[1],i=e[2]):(r=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let r=await t.json().catch(Me);if(!e||!t.ok)return;let i=b.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(je),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Q.useEffect)(r,i),t}function je(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function Me(){return null}function Ne(){return Pe()}function Pe(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}function Fe(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Ie(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Se(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Le(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Fe(e):Ie()}var Re=`ok:skill:cowork:installed`,ze=`1`,Be=250,Ve=`/api/skill/install-state`;function He(e){return`${Re}:v${e}`}var Ue=new Map;async function We(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Ue.get(n);if(r)return r;let i=Ge(e,t);return Ue.set(n,i),i.finally(()=>{Ue.get(n)===i&&Ue.delete(n)}),i}async function Ge(e,t){let n=e.installer===void 0?Le():e.installer,r=Ke(e.storage),i=e.fetchSnapshot??Je,a=e.serverTimeoutMs??Be,o=null;if(!t.force){try{o=await Ye(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=He(o?.currentVersion??e.fallbackSkillVersion??qe());if(!t.force&&r?.getItem(s)===ze)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,ze)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function Ke(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function qe(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Je(){let e;try{e=await fetch(Ve,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function Ye(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Xe(e){return We({},e)}function Ze(){return We({},{force:!0})}async function Qe(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function $e(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Qe({target:`claude-cowork`,url:d({mode:`cowork`},e)},n);case`claude-code`:return Qe({target:`claude-code`,url:d({mode:`code`},e)},n);case`codex`:return Qe({target:`codex`,url:k(e)},n);case`cursor`:return Qe({target:`cursor`,url:c(e),workspacePath:e.projectDir},n);case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function et(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:tt(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:tt(e)}}}function tt(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}async function nt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function rt(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function it(e){return`${e}.md`}function at(e){if(!e.docName||!e.workspace)return null;let t=it(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:rt(n,t,r)}}function ot(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function st(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function ct(e){return et(e.installUrl).then(()=>void 0)}function lt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function ut(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function dt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=it(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:rt(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function ft(e){return`Opened in ${e}.`}function pt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function mt(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function ht(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function gt(e,t,n){if(e.scope===`doc`){let r={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n};return e.selection===void 0?r:{...r,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n}}function _t(e,t,n){return e.compose?f(gt(e.compose,t,n)):e.selection?C({...e.selection,target:t}):e.skill?w(e.skill.name,e.skill.scope,n):e.ask?h(e.ask.relativePath,e.ask.instruction,n,t):p(e.docContext===null?e.folderRelativePath?E(e.folderRelativePath,n,e.instruction):e.createDescription===void 0?s(n,e.instruction):m(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[]):_(e.docContext.relativePath,n,e.instruction))}function vt(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${u} ${_t(e,l[t].handoffTarget,!1)}`:y(e.docContext?.relativePath??null)}async function yt(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:_t(t,e,n.autoOpen)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=ht(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(ft(u));else{let i=mt(r),a=pt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{yt(e,t,n,r+1)}}})}return a}function bt(e){return Oe.find(t=>t.id===e)?.displayName??e}function xt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function St(){return{dispatchHandoff:$e,recordHandoff:nt,toast:{success:e=>{G.success(e)},error:(e,t)=>{G.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>xt(),getDisplayName:bt,ensureCoworkSkillInstalled:Xe,autoOpen:!0}}function Ct(){let e=(0,Z.c)(2),{merged:t}=L(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>yt(e,t,{...St(),autoOpen:n}),reinstallCoworkSkill:Ze},e[0]=n,e[1]=r),r}var wt=[...new Set(Oe.flatMap(e=>e.schemes))];function Tt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of Oe){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Et(e){return Tt({},e)}async function Dt(e){let t=e.schemes??wt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ot=Object.fromEntries(wt.map(e=>[e,{installed:!1}]));async function kt(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ot}if(!t.ok)return Ot;let n;try{n=await t.json()}catch{return Ot}if(typeof n!=`object`||!n||Array.isArray(n))return Ot;let r=n,i={};for(let e of wt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function At(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function jt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Et({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Tt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!At(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Mt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Nt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Dt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>kt({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Pt(){let e=(0,Z.c)(5),[t,n]=(0,Q.useState)(Ft),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=jt(Nt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Ft(){return Et({isElectronHost:Mt(),now:Date.now})}function It(e){return!(e instanceof Error)||e.name!==`NotAllowedError`?!1:/permission denied|permissions policy/i.test(e.message)}function Lt(e){let t=globalThis.document;if(!t?.body||typeof t.createElement!=`function`||typeof t.execCommand!=`function`)return!1;let n=t.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,n.style.pointerEvents=`none`,n.setAttribute(`readonly`,``),t.body.appendChild(n);try{return n.focus(),n.select(),t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}async function Rt(e){let t=globalThis.okDesktop?.clipboard;if(t&&typeof t.writeText==`function`){await t.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n&&typeof n.writeText==`function`)try{await n.writeText(e);return}catch(t){if(Lt(e))return;throw t}if(!Lt(e))throw Error(`clipboard API unavailable`)}function zt(e){let t=(0,Z.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`title`,{children:`OpenCode icon`}),r=(0,$.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M384 416H128V96H384V416ZM320 160H192V352H320V160Z`}),i=(0,$.jsx)(`path`,{fill:`currentColor`,fillOpacity:.55,d:`M320 224V352H192V224H320Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,$.jsxs)(`svg`,{role:`img`,"aria-label":`OpenCode icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 512 512`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var Bt={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`,opencode:`opencode`};function Vt(e){let t=(0,Z.c)(27),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:s}=o(),c=Bt[r],l=c?(s===`dark`?S[c]:void 0)??T[c]:void 0,u;t[5]!==l||t[6]!==a?(u=l?{...a,"--ok-brand-color":l}:a,t[5]=l,t[6]=a,t[7]=u):u=t[7];let d=u,f=l&&`[&_*]:![color:var(--ok-brand-color)]`,p;t[8]!==n||t[9]!==f?(p=A(f,n),t[8]=n,t[9]=f,t[10]=p):p=t[10];let m=p;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==m||t[12]!==d||t[13]!==i?(e=(0,$.jsx)(H,{style:d,className:m,...i}),t[11]=m,t[12]=d,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==m||t[16]!==d||t[17]!==i?(e=(0,$.jsx)(U,{style:d,className:m,...i}),t[15]=m,t[16]=d,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==m||t[20]!==d||t[21]!==i?(e=(0,$.jsx)(W,{style:d,className:m,...i}),t[19]=m,t[20]=d,t[21]=i,t[22]=e):e=t[22],e}if(r===`opencode`){let e;return t[23]!==m||t[24]!==d||t[25]!==i?(e=(0,$.jsx)(zt,{style:d,className:m,...i}),t[23]=m,t[24]=d,t[25]=i,t[26]=e):e=t[26],e}return null}var Ht=(0,Q.createContext)(null);function Ut(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(Ht,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Wt(){return(0,Q.use)(Ht)}var Gt=D;function Kt(e){return l[e].handoffTarget}function qt(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:l,customConfirmLabel:u,customConfirmLabelBusy:d,children:f}=e,{_:p}=a(),m;t[0]!==p||t[1]!==n?(m=n??p({id:`L3CEC1`}),t[0]=p,t[1]=n,t[2]=m):m=t[2];let h=m,g;t[3]!==p||t[4]!==u?(g=u??p({id:`cnGeoo`}),t[3]=p,t[4]=u,t[5]=g):g=t[5];let _=g,v;t[6]!==p||t[7]!==u||t[8]!==d?(v=d??u??p({id:`s3caR3`}),t[6]=p,t[7]=u,t[8]=d,t[9]=v):v=t[9];let y=v,b;t[10]!==p||t[11]!==s||t[12]!==h?(b=s??p({id:`77SdEP`,values:{itemName:h}}),t[10]=p,t[11]=s,t[12]=h,t[13]=b):b=t[13];let x;t[14]===b?x=t[15]:(x=(0,$.jsx)(ne,{children:b}),t[14]=b,t[15]=x);let S;t[16]!==p||t[17]!==c||t[18]!==h?(S=c??p({id:`16D5Zj`,values:{itemName:h}}),t[16]=p,t[17]=c,t[18]=h,t[19]=S):S=t[19];let C;t[20]===S?C=t[21]:(C=(0,$.jsx)(te,{className:`whitespace-pre-wrap`,children:S}),t[20]=S,t[21]=C);let w;t[22]===l?w=t[23]:(w=l?(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:l}):null,t[22]=l,t[23]=w);let T;t[24]!==x||t[25]!==C||t[26]!==w?(T=(0,$.jsxs)(ae,{children:[x,C,w]}),t[24]=x,t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;t[28]===f?E=t[29]:(E=f?(0,$.jsx)(K,{children:f}):null,t[28]=f,t[29]=E);let D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(i,{id:`dEgA5A`}),t[30]=D):D=t[30];let O;t[31]===r?O=t[32]:(O=(0,$.jsx)(q,{asChild:!0,children:(0,$.jsx)(j,{variant:`outline`,disabled:r,children:D})}),t[31]=r,t[32]=O);let k;t[33]!==_||t[34]!==y||t[35]!==r?(k=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(z,{className:`size-4 animate-spin`}),` `,y]}):_,t[33]=_,t[34]=y,t[35]=r,t[36]=k):k=t[36];let A;t[37]!==r||t[38]!==o||t[39]!==k?(A=(0,$.jsx)(j,{variant:`destructive`,onClick:o,disabled:r,children:k}),t[37]=r,t[38]=o,t[39]=k,t[40]=A):A=t[40];let M;t[41]!==O||t[42]!==A?(M=(0,$.jsxs)(ie,{children:[O,A]}),t[41]=O,t[42]=A,t[43]=M):M=t[43];let N;return t[44]!==E||t[45]!==M||t[46]!==T?(N=(0,$.jsxs)(re,{children:[T,E,M]}),t[44]=E,t[45]=M,t[46]=T,t[47]=N):N=t[47],N}function Jt(e){return e?ye._({id:`wTcjov`}):null}function Yt(e){let t=(0,Z.c)(30),{_:n}=a(),r=Ee(),o=Wt();if(r)return null;let{input:s,installStates:c,dispatch:u}=e,d=s===null,f,p,m,h,g,_,v;if(t[0]!==n||t[1]!==u||t[2]!==s||t[3]!==d||t[4]!==c||t[5]!==o){let e=Jt(d),r;t[13]===c?r=t[14]:(r=e=>c[e.id]?.installed===!0,t[13]=c,t[14]=r);let a=ke.filter(r),y;t[15]===c?y=t[16]:(y=ke.some(e=>c[e.id]?.installed==null),t[15]=c,t[16]=y),m=y;let b=a.length>0,x=o!==null;h=!b&&!x,p=Y,t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(he,{children:[(0,$.jsx)(V,{"aria-hidden":`true`}),(0,$.jsx)(i,{id:`O7_W_a`})]}),t[17]=v):v=t[17],f=J,g=x?(0,$.jsxs)(ue,{"aria-label":n({id:`ALhMYW`}),children:[(0,$.jsx)(me,{children:(0,$.jsx)(i,{id:`ALhMYW`})}),Gt.map(t=>{let{displayName:r}=l[t];return(0,$.jsxs)(X,{onSelect:()=>{s!==null&&o.launchInTerminal(s,t)},disabled:d,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,$.jsx)(Vt,{id:Kt(t),"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,_=b?(0,$.jsxs)($.Fragment,{children:[x?(0,$.jsx)(ge,{}):null,(0,$.jsxs)(ue,{"aria-label":n({id:`BBqGS9`}),children:[(0,$.jsx)(me,{children:(0,$.jsx)(i,{id:`BBqGS9`})}),a.map(t=>{let r=!d,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,$.jsxs)(X,{disabled:!r,onSelect:()=>{s&&u(t.id,s)},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,$.jsx)(Vt,{id:t.id,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=u,t[2]=s,t[3]=d,t[4]=c,t[5]=o,t[6]=f,t[7]=p,t[8]=m,t[9]=h,t[10]=g,t[11]=_,t[12]=v}else f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],v=t[12];let y;t[18]!==m||t[19]!==h?(y=h?(0,$.jsx)(X,{disabled:!0,"data-testid":`file-tree-open-in-empty`,children:m?(0,$.jsx)(i,{id:`EcR0fl`}):(0,$.jsx)(i,{id:`l6OXqI`})}):null,t[18]=m,t[19]=h,t[20]=y):y=t[20];let b;t[21]!==f||t[22]!==g||t[23]!==_||t[24]!==y?(b=(0,$.jsxs)(f,{children:[g,_,y]}),t[21]=f,t[22]=g,t[23]=_,t[24]=y,t[25]=b):b=t[25];let x;return t[26]!==p||t[27]!==v||t[28]!==b?(x=(0,$.jsxs)(p,{children:[v,b]}),t[26]=p,t[27]=v,t[28]=b,t[29]=x):x=t[29],x}function Xt(e){let t=(0,Z.c)(8),n=e?.enabled??!0,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(0),c,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=()=>s(en),t=xe(e),n=be(t=>{t.includes(`files`)&&e()});return()=>{t(),n()}},l=[],t[1]=c,t[2]=l):(c=t[1],l=t[2]),(0,Q.useEffect)(c,l);let u;t[3]===n?u=t[4]:(u=()=>{if(!n)return;let e=!1;return a($t),fetch(`/api/skills`).then(Zt).then(t=>{if(e)return;let n=O.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skills response failed schema validation:`,n.error.issues),a({status:`error`,message:`Server returned an incomplete skills response.`});return}a({status:`ready`,data:n.data.skills})}).catch(t=>{e||a({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},t[3]=n,t[4]=u);let d;return t[5]!==n||t[6]!==o?(d=[o,n],t[5]=n,t[6]=o,t[7]=d):d=t[7],(0,Q.useEffect)(u,d),i}async function Zt(e){if(!e.ok){let t=await e.json().catch(Qt);throw Error(Se(t)??`HTTP ${e.status}`)}return e.json()}function Qt(){return null}function $t(e){return e.status===`ready`?e:{status:`loading`}}function en(e){return e+1}function tn(e){let t=(0,Z.c)(16),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:o}=a(),[s,c]=(0,Q.useState)(!1),l;t[0]!==o||t[1]!==i||t[2]!==r?(l=async function(e){c(!0);let t=await pe(e.scope,e.name);if(c(!1),!t.ok){let{error:e}=t;G.error(o({id:`AtBdnD`,values:{error:e}}));return}G.success(o({id:`h9QFb9`,values:{0:e.name}})),i(),r(!1)},t[0]=o,t[1]=i,t[2]=r,t[3]=l):l=t[3];let u=l,d=n!==null,f;t[4]!==s||t[5]!==r?(f=e=>{!e&&!s&&r(!1)},t[4]=s,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==n?(p=n?(0,$.jsx)(qt,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:s,onDelete:()=>u(n),customDescription:o({id:`E1Da_b`,values:{0:n.path}})}):null,t[7]=o,t[8]=s,t[9]=u,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,$.jsx)(oe,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function nn(e){let t=(0,Z.c)(68),{skill:n,existingNames:r,onOpenChange:o,onRenamed:s}=e,{_:c}=a(),l=n!==null,u=(0,Q.useId)(),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(!1),h;t[0]===n?h=t[1]:(h=()=>{n&&f(n.name)},t[0]=n,t[1]=h);let g=n?.scope,_=n?.name,y;if(t[2]!==g||t[3]!==_?(y=[g,_],t[2]=g,t[3]=_,t[4]=y):y=t[4],(0,Q.useEffect)(h,y),!n)return null;let b,x,S,C;t[5]!==r||t[6]!==d||t[7]!==n.name?(S=d.trim(),C=S===n.name,b=S===``||!v.test(S),x=!b&&!C&&r.has(S),t[5]=r,t[6]=d,t[7]=n.name,t[8]=b,t[9]=x,t[10]=S,t[11]=C):(b=t[8],x=t[9],S=t[10],C=t[11]);let w=x,T=!b&&!w&&!C&&!p,E;t[12]!==c||t[13]!==T||t[14]!==o||t[15]!==s||t[16]!==n||t[17]!==S?(E=async function(){if(!n||!T)return;m(!0);let e=await fe({scope:n.scope,fromName:n.name,toName:S});if(m(!1),!e.ok){G.error(c({id:`zKxoPm`,values:{0:n.name,1:e.error}}));return}G.success(c({id:`dUCQo4`,values:{trimmed:S}})),s?.(S),o(!1)},t[12]=c,t[13]=T,t[14]=o,t[15]=s,t[16]=n,t[17]=S,t[18]=E):E=t[18];let D=E,O;t[19]===o?O=t[20]:(O=e=>e?null:o(!1),t[19]=o,t[20]=O);let k;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(ne,{children:(0,$.jsx)(i,{id:`dw_3cv`})}),t[21]=k):k=t[21];let A;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsxs)(ae,{children:[k,(0,$.jsx)(te,{children:(0,$.jsx)(i,{id:`R9IDFz`})})]}),t[22]=A):A=t[22];let M;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(i,{id:`6YtxFj`}),t[23]=M):M=t[23];let N;t[24]===u?N=t[25]:(N=(0,$.jsx)(_e,{htmlFor:u,children:M}),t[24]=u,t[25]=N);let P;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>f(e.target.value),t[26]=P):P=t[26];let F;t[27]===D?F=t[28]:(F=e=>{e.key===`Enter`&&D()},t[27]=D,t[28]=F);let ee=b||w,I=b&&S!==``||w?`${u}-error`:void 0,L;t[29]!==u||t[30]!==d||t[31]!==F||t[32]!==ee||t[33]!==I?(L=(0,$.jsx)(ve,{id:u,value:d,onChange:P,onKeyDown:F,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":ee,"aria-describedby":I,className:`font-mono`}),t[29]=u,t[30]=d,t[31]=F,t[32]=ee,t[33]=I,t[34]=L):L=t[34];let R;t[35]!==w||t[36]!==u||t[37]!==b||t[38]!==S?(R=b&&S!==``?(0,$.jsx)(`p`,{id:`${u}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`A50vr3`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}):w?(0,$.jsx)(`p`,{id:`${u}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`YJ1BTp`})}):null,t[35]=w,t[36]=u,t[37]=b,t[38]=S,t[39]=R):R=t[39];let z;t[40]!==N||t[41]!==L||t[42]!==R?(z=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[N,L,R]}),t[40]=N,t[41]=L,t[42]=R,t[43]=z):z=t[43];let B;t[44]===o?B=t[45]:(B=()=>o(!1),t[44]=o,t[45]=B);let V;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(i,{id:`dEgA5A`}),t[46]=V):V=t[46];let H;t[47]!==p||t[48]!==B?(H=(0,$.jsx)(j,{variant:`ghost`,onClick:B,disabled:p,children:V}),t[47]=p,t[48]=B,t[49]=H):H=t[49];let U;t[50]===D?U=t[51]:(U=()=>void D(),t[50]=D,t[51]=U);let W=!T,K;t[52]===p?K=t[53]:(K=p?(0,$.jsx)(i,{id:`tHKQ6j`}):(0,$.jsx)(i,{id:`2wxgft`}),t[52]=p,t[53]=K);let q;t[54]!==U||t[55]!==W||t[56]!==K?(q=(0,$.jsx)(j,{onClick:U,disabled:W,children:K}),t[54]=U,t[55]=W,t[56]=K,t[57]=q):q=t[57];let J;t[58]!==H||t[59]!==q?(J=(0,$.jsxs)(ie,{children:[H,q]}),t[58]=H,t[59]=q,t[60]=J):J=t[60];let Y;t[61]!==z||t[62]!==J?(Y=(0,$.jsxs)(re,{children:[A,z,J]}),t[61]=z,t[62]=J,t[63]=Y):Y=t[63];let X;return t[64]!==l||t[65]!==Y||t[66]!==O?(X=(0,$.jsx)(oe,{open:l,onOpenChange:O,children:Y}),t[64]=l,t[65]=Y,t[66]=O,t[67]=X):X=t[67],X}function rn(e){let t=(0,Z.c)(15),{skill:n,onOpenChange:r,onUpdated:o}=e,{_:s}=a(),[c,l]=(0,Q.useState)(!1),u;t[0]!==s||t[1]!==r||t[2]!==o?(u=async function(e){l(!0);let t=await le({scope:e.scope,name:e.name});l(!1);let n=F(e.name);if(!t.ok){G.error(s({id:`FRqZ9v`,values:{0:t.error}}));return}G.success(t.checkpointRef?s({id:`My9uXI`,values:{0:t.version,display:n}}):s({id:`mPneVR`,values:{0:t.version,display:n}})),o(),r(!1)},t[0]=s,t[1]=r,t[2]=o,t[3]=u):u=t[3];let d=u,f=n!==null,p;t[4]!==r||t[5]!==c?(p=e=>{!e&&!c&&r(!1)},t[4]=r,t[5]=c,t[6]=p):p=t[6];let m;t[7]!==d||t[8]!==n||t[9]!==c?(m=n?(0,$.jsxs)(re,{className:`sm:max-w-lg`,children:[(0,$.jsxs)(ae,{children:[(0,$.jsx)(ne,{children:(0,$.jsx)(i,{id:`iAoh55`,values:{0:F(n.name)}})}),(0,$.jsx)(te,{children:n.installedVersion?(0,$.jsx)(i,{id:`47EXvY`,values:{0:n.bundledVersion??``,1:n.installedVersion}}):(0,$.jsx)(i,{id:`nD7Fx9`,values:{0:n.bundledVersion??``}})})]}),(0,$.jsx)(K,{}),(0,$.jsxs)(ie,{children:[(0,$.jsx)(q,{asChild:!0,children:(0,$.jsx)(j,{variant:`outline`,disabled:c,children:(0,$.jsx)(i,{id:`dEgA5A`})})}),(0,$.jsx)(j,{onClick:()=>void d(n),disabled:c,children:c?(0,$.jsx)(i,{id:`JL3si7`}):(0,$.jsx)(i,{id:`EkH9pt`})})]})]}):null,t[7]=d,t[8]=n,t[9]=c,t[10]=m):m=t[10];let h;return t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,$.jsx)(oe,{open:f,onOpenChange:p,children:m}),t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14],h}function an(){let e=(0,Z.c)(30),{_:t}=a(),[n,r]=(0,Q.useState)(null),[i,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),d;e[0]===t?d=e[1]:(d=async function(e,n){u(e.name);let r=await se({scope:e.scope,name:e.name,...n?{targets:[...n]}:{}});if(u(null),!r.ok)return G.error(t({id:`Mj8R8K`,values:{0:r.error}})),r;let i=on,a=new Set(r.hosts),o=r.hosts.filter(t=>!e.hosts.includes(t)),s=e.hosts.filter(e=>!a.has(e)),c=e=>{let t=r.warningCodes.indexOf(e);return t>=0?r.warnings[t]:void 0},l=c(`no-targets`);if(l)return G.warning(l),r;if(o.length>0){let e=c(`scripts-present`);e&&G.warning(e)}return r.hosts.length===0?G.success(t({id:`0LBDjY`,values:{0:e.name}})):o.length>0&&s.length===0?G.success(t({id:`PPFQ3o`,values:{0:e.name,1:i(o)}})):s.length>0&&o.length===0?G.success(t({id:`OOIVJo`,values:{0:e.name,1:i(s)}})):o.length>0&&s.length>0?G.success(t({id:`OxplNM`,values:{0:e.name,1:i(o),2:i(s)}})):G.success(t({id:`wDgmsr`,values:{0:e.name,1:i(r.hosts)}})),r},e[0]=t,e[1]=d);let f=d,p;e[2]===t?p=e[3]:(p=async function(e){u(e.name);let n=await ce({scope:e.scope,name:e.name});return u(null),n.ok?G.success(t({id:`0LBDjY`,values:{0:e.name}})):G.error(t({id:`nJq7et`,values:{0:n.error}})),n},e[2]=t,e[3]=p);let m=p,h;e[4]===t?h=e[5]:(h=async function(e,n){let r=await de({scope:e.scope,name:e.name,existingNames:n});if(!r.ok){G.error(t({id:`UPjaXD`,values:{0:e.name,1:r.error}}));return}G.success(t({id:`0g7rCZ`,values:{0:r.name}}))},e[4]=t,e[5]=h);let g=h,_,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e||r(null)},v=()=>r(null),e[6]=_,e[7]=v):(_=e[6],v=e[7]);let y;e[8]===n?y=e[9]:(y=(0,$.jsx)(tn,{skill:n,onOpenChange:_,onDeleted:v}),e[8]=n,e[9]=y);let b=i?.skill??null,x=i?.existingNames??cn,S,C;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e||o(null)},C=()=>o(null),e[10]=S,e[11]=C):(S=e[10],C=e[11]);let w;e[12]!==b||e[13]!==x?(w=(0,$.jsx)(nn,{skill:b,existingNames:x,onOpenChange:S,onRenamed:C}),e[12]=b,e[13]=x,e[14]=w):w=e[14];let T,E;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e||c(null)},E=()=>c(null),e[15]=T,e[16]=E):(T=e[15],E=e[16]);let D;e[17]===s?D=e[18]:(D=(0,$.jsx)(rn,{skill:s,onOpenChange:T,onUpdated:E}),e[17]=s,e[18]=D);let O;e[19]!==w||e[20]!==D||e[21]!==y?(O=(0,$.jsxs)($.Fragment,{children:[y,w,D]}),e[19]=w,e[20]=D,e[21]=y,e[22]=O):O=e[22];let k=O,A;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=(e,t)=>o({skill:e,existingNames:t}),e[23]=A):A=e[23];let j;return e[24]!==k||e[25]!==g||e[26]!==f||e[27]!==l||e[28]!==m?(j={installingName:l,install:f,uninstall:m,duplicate:g,requestDelete:r,requestRename:A,requestUpdate:c,dialogs:k},e[24]=k,e[25]=g,e[26]=f,e[27]=l,e[28]=m,e[29]=j):j=e[29],j}function on(e){return e.map(sn).join(`, `)}function sn(e){return x[e]??e}var cn=new Set;function ln(e){let t=(0,Z.c)(19),{skill:n,onEdit:r,onInstall:a,onUninstall:o,onDelete:s}=e,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(I,{"aria-hidden":!0}),l=(0,$.jsx)(i,{id:`ePK91l`}),t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===r?u=t[3]:(u=(0,$.jsxs)(X,{onSelect:r,children:[c,l]}),t[2]=r,t[3]=u);let d;t[4]!==a||t[5]!==n.installed?(d=a&&!n.installed?(0,$.jsxs)(X,{onSelect:a,children:[(0,$.jsx)(Ce,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`TKQ7K-`})]}):null,t[4]=a,t[5]=n.installed,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.installed?(f=n.installed?(0,$.jsxs)(X,{onSelect:o,children:[(0,$.jsx)(Te,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`fo0VXg`})]}):null,t[7]=o,t[8]=n.installed,t[9]=f):f=t[9];let p,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(ee,{"aria-hidden":!0}),m=(0,$.jsx)(i,{id:`cnGeoo`}),t[10]=p,t[11]=m):(p=t[10],m=t[11]);let h;t[12]===s?h=t[13]:(h=(0,$.jsxs)(X,{variant:`destructive`,onSelect:s,children:[p,m]}),t[12]=s,t[13]=h);let g;return t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==h?(g=(0,$.jsxs)($.Fragment,{children:[u,d,f,h]}),t[14]=u,t[15]=d,t[16]=f,t[17]=h,t[18]=g):g=t[18],g}function un(e){let t=(0,Z.c)(65),{skill:n,actions:r,existingNames:o}=e,{_:s}=a(),c=Ae(),l=Pt().states,{dispatch:u}=Ct(),d=typeof window<`u`?window.okDesktop:void 0,f=n.absolutePath,p;t[0]===s?p=t[1]:(p=async function(e){try{await Rt(e),G.success(s({id:`SXCSQd`}))}catch{G.error(s({id:`cRHuuI`}))}},t[0]=s,t[1]=p);let m=p,h;t[2]===f?h=t[3]:(h=d&&f?(0,$.jsxs)(X,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,$.jsx)(R,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`LtSYdi`})]}):null,t[2]=f,t[3]=h);let g;t[4]!==n.name||t[5]!==n.scope||t[6]!==c?(g=ut({skillName:n.name,scope:n.scope,workspace:c}),t[4]=n.name,t[5]=n.scope,t[6]=c,t[7]=g):g=t[7];let _;t[8]!==u||t[9]!==l||t[10]!==g?(_=(0,$.jsx)(Yt,{input:g,installStates:l,isElectronHost:d!=null,dispatch:u}),t[8]=u,t[9]=l,t[10]=g,t[11]=_):_=t[11];let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(he,{children:[(0,$.jsx)(N,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`zd00pH`})]}),t[12]=v):v=t[12];let y;t[13]!==f||t[14]!==m?(y=f?(0,$.jsx)(X,{onSelect:()=>void m(f),children:(0,$.jsx)(i,{id:`z2funE`})}):null,t[13]=f,t[14]=m,t[15]=y):y=t[15];let b;t[16]!==m||t[17]!==n.path?(b=()=>void m(n.path),t[16]=m,t[17]=n.path,t[18]=b):b=t[18];let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(i,{id:`xloBjn`}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,$.jsx)(X,{onSelect:b,children:x}),t[20]=b,t[21]=S);let C;t[22]!==y||t[23]!==S?(C=(0,$.jsxs)(Y,{children:[v,(0,$.jsxs)(J,{children:[y,S]})]}),t[22]=y,t[23]=S,t[24]=C):C=t[24];let w;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(ge,{}),t[25]=w):w=t[25];let T;t[26]!==r||t[27]!==o||t[28]!==n?(T=()=>void r.duplicate(n,o),t[26]=r,t[27]=o,t[28]=n,t[29]=T):T=t[29];let E,D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(P,{"aria-hidden":!0}),D=(0,$.jsx)(i,{id:`euc6Ns`}),t[30]=E,t[31]=D):(E=t[30],D=t[31]);let O;t[32]===T?O=t[33]:(O=(0,$.jsxs)(X,{onSelect:T,children:[E,D]}),t[32]=T,t[33]=O);let k;t[34]!==r||t[35]!==o||t[36]!==n?(k=()=>r.requestRename(n,o),t[34]=r,t[35]=o,t[36]=n,t[37]=k):k=t[37];let A,j;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(we,{"aria-hidden":!0}),j=(0,$.jsx)(i,{id:`2wxgft`}),t[38]=A,t[39]=j):(A=t[38],j=t[39]);let M;t[40]===k?M=t[41]:(M=(0,$.jsxs)(X,{onSelect:k,children:[A,j]}),t[40]=k,t[41]=M);let F;t[42]!==r||t[43]!==n?(F=n.updateAvailable?(0,$.jsxs)(X,{onSelect:()=>r.requestUpdate(n),children:[(0,$.jsx)(B,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`6g2jsp`})]}):null,t[42]=r,t[43]=n,t[44]=F):F=t[44];let I;t[45]!==r||t[46]!==n?(I=n.installed?(0,$.jsxs)(X,{onSelect:()=>void r.uninstall(n),children:[(0,$.jsx)(Te,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`fo0VXg`})]}):(0,$.jsxs)(X,{onSelect:()=>void r.install(n),children:[(0,$.jsx)(Ce,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`TKQ7K-`})]}),t[45]=r,t[46]=n,t[47]=I):I=t[47];let L;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(ge,{}),t[48]=L):L=t[48];let z;t[49]!==r||t[50]!==n?(z=()=>r.requestDelete(n),t[49]=r,t[50]=n,t[51]=z):z=t[51];let V,H;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(ee,{"aria-hidden":!0}),H=(0,$.jsx)(i,{id:`cnGeoo`}),t[52]=V,t[53]=H):(V=t[52],H=t[53]);let U;t[54]===z?U=t[55]:(U=(0,$.jsxs)(X,{variant:`destructive`,onSelect:z,children:[V,H]}),t[54]=z,t[55]=U);let W;return t[56]!==C||t[57]!==O||t[58]!==M||t[59]!==h||t[60]!==F||t[61]!==I||t[62]!==U||t[63]!==_?(W=(0,$.jsxs)($.Fragment,{children:[h,_,C,w,O,M,F,I,L,U]}),t[56]=C,t[57]=O,t[58]=M,t[59]=h,t[60]=F,t[61]=I,t[62]=U,t[63]=_,t[64]=W):W=t[64],W}export{Ce as A,ct as C,Ae as D,rt as E,ke as O,bt as S,it as T,lt as _,Yt as a,ut as b,Kt as c,Vt as d,It as f,st as g,dt as h,Xt as i,Ee as k,Ut as l,Pt as m,un as n,qt as o,Rt as p,an as r,Gt as s,ln as t,Wt as u,at as v,Ct as w,vt as x,ot as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./dist-CQw2y-s3.js";import{u as t}from"./button-
|
|
1
|
+
import{r as e}from"./dist-CQw2y-s3.js";import{u as t}from"./button-cneJOVxD.js";var n=t(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`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`}]]),r=t(`copy`,[[`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`}]]),i=t(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),a=t(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),o=[`global`,`project`];function s(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}var c=`open-knowledge-pack-`;function l(e){return e.startsWith(c)?e.slice(20):e}function u(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function d(){let{_:t}=e();return{project:t({id:`HyvSqq`}),global:t({id:`C7XjNB`})}}export{d as a,r as c,u as i,n as l,l as n,a as o,s as r,i as s,o as t};
|