@inkeep/open-knowledge 0.26.0-beta.3 → 0.26.0-beta.4

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.
Files changed (71) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/cli.mjs +6 -6
  4. package/dist/constants-CLOl-YPp.mjs +2 -0
  5. package/dist/index.mjs +1 -1
  6. package/dist/{init-Dfv_79XQ.mjs → init-BRM4D3aN.mjs} +3 -3
  7. package/dist/init-BmxZyzqX.mjs +1 -0
  8. package/dist/loader-5jGFIbzM.mjs +1 -0
  9. package/dist/{loader-CsHEMUCb.mjs → loader-CeUTJnBT.mjs} +2 -2
  10. package/dist/{preview-gGYGk2wA.mjs → preview-CNakf9xz.mjs} +2 -2
  11. package/dist/preview-YlanDsYQ.mjs +1 -0
  12. package/dist/public/assets/{ActivityModeContent-Dh9ZRSoQ.js → ActivityModeContent-DXYPqOq4.js} +1 -1
  13. package/dist/public/assets/{ConsentDialogBody-Bza0TMPd.js → ConsentDialogBody-CJbrNbjF.js} +1 -1
  14. package/dist/public/assets/DocumentContext-CVfa457X.js +36 -0
  15. package/dist/public/assets/{EnableSyncConfirmDialog-C9ftvg6E.js → EnableSyncConfirmDialog-Bp6Kd2LQ.js} +1 -1
  16. package/dist/public/assets/{GraphPanel-BtsCCmfa.js → GraphPanel-BOJfbkTJ.js} +2 -2
  17. package/dist/public/assets/{ManagedArtifactProperties-lwut8ycK.js → ManagedArtifactProperties-DXnRZrvY.js} +1 -1
  18. package/dist/public/assets/McpConsentDialogBody-B0SbotVo.js +1 -0
  19. package/dist/public/assets/{PropertyPanel-D60ytpLJ.js → PropertyPanel-IVYdT8kB.js} +1 -1
  20. package/dist/public/assets/{SettingsDialogBody-BEB9E4L8.js → SettingsDialogBody-C3klTl8y.js} +2 -2
  21. package/dist/public/assets/{ShareBranchSwitchDialog-wS9K-tig.js → ShareBranchSwitchDialog-C19Tz0FD.js} +1 -1
  22. package/dist/public/assets/{ShareReceiveDialog-Dj9jDr9i.js → ShareReceiveDialog-dqLPJobK.js} +1 -1
  23. package/dist/public/assets/{ShareReceiveMissDialog-Dl8ubE0W.js → ShareReceiveMissDialog-BmK1FcKl.js} +1 -1
  24. package/dist/public/assets/{SkillEditorActions-_MpJ084l.js → SkillEditorActions-DrxXwSQZ.js} +1 -1
  25. package/dist/public/assets/{SourceEditor-C0bMqVnT.js → SourceEditor-C69C5VbZ.js} +2 -2
  26. package/dist/public/assets/{TerminalPanel-CWbsUOWf.js → TerminalPanel-F9VxCkzR.js} +3 -3
  27. package/dist/public/assets/{auth-state-cache-D1Zf_XZx.js → auth-state-cache-ceG_ksVa.js} +4 -4
  28. package/dist/public/assets/{checkbox-P04sbGVQ.js → checkbox-f-bVZCIm.js} +1 -1
  29. package/dist/public/assets/config-provider-BCfJ49jt.js +4 -0
  30. package/dist/public/assets/dist-BEjpPm3y.js +1 -0
  31. package/dist/public/assets/{dist-DQdOYnjt.js → dist-Bp_rHida.js} +1 -1
  32. package/dist/public/assets/{dist-CcPVYMcT.js → dist-COgUpCH8.js} +125 -125
  33. package/dist/public/assets/dist-C_vWk3jN.js +1 -0
  34. package/dist/public/assets/{doc-hash-BN71TGv_.js → doc-hash-D4PHQioS.js} +1 -1
  35. package/dist/public/assets/{documents-events-DpvvMnqc.js → documents-events-CC0YYok8.js} +1 -1
  36. package/dist/public/assets/{file-tree-adapter-D0zxekvZ.js → file-tree-adapter-kyG62qi4.js} +1 -1
  37. package/dist/public/assets/{index-DxjAwDPu.js → index-B7eqx3hL.js} +10 -10
  38. package/dist/public/assets/index-ufsO3NHc.css +1 -0
  39. package/dist/public/assets/{keyboard-shortcuts-BlefnxS9.js → keyboard-shortcuts-BvDMvGCY.js} +1 -1
  40. package/dist/public/assets/{open-managed-artifact-tab-D3BcVUm2.js → open-managed-artifact-tab--yPNMSsq.js} +1 -1
  41. package/dist/public/assets/{pending-receive-nav-store-Dof2gLIy.js → pending-receive-nav-store-DHcSK_qb.js} +1 -1
  42. package/dist/public/assets/{project-paths-Dvd83Cnz.js → project-paths-cuCZTJ3P.js} +1 -1
  43. package/dist/public/assets/{prop-types-Dw7AI8Ws.js → prop-types-t38xDaSJ.js} +1 -1
  44. package/dist/public/assets/{radio-group-1_2tsQbc.js → radio-group-G2GVDZug.js} +1 -1
  45. package/dist/public/assets/{receive-store-Chr-F8g-.js → receive-store-D19RejeY.js} +1 -1
  46. package/dist/public/assets/{selection-context-CQ-aBMVN.js → selection-context-DbKYyKpW.js} +1 -1
  47. package/dist/public/assets/{skill-actions-LWoE96gI.js → skill-actions-ClI_nW9-.js} +1 -1
  48. package/dist/public/assets/skills-api-iQOrzhIN.js +1 -0
  49. package/dist/public/assets/{target-navigation-intent-Cr9Afdw3.js → target-navigation-intent-DGRIAiM0.js} +1 -1
  50. package/dist/public/assets/{toggle-group-IN7Np0Is.js → toggle-group-ChBgoXkr.js} +1 -1
  51. package/dist/public/assets/{tooltip-C9Dd0rIc.js → tooltip-C-qXynAd.js} +1 -1
  52. package/dist/public/assets/{typing-burst-detector-CNef6al6.js → typing-burst-detector-B8USnmhk.js} +2 -2
  53. package/dist/public/index.html +29 -29
  54. package/dist/{repair-launch-json-Dt-nN_hi.mjs → repair-launch-json-DS8B8XJT.mjs} +2 -2
  55. package/dist/{repair-mcp-configs-Bql_mi5y.mjs → repair-mcp-configs-DeDm8DcU.mjs} +2 -2
  56. package/dist/{src-CWrclvo9.mjs → src-lhsbbOZY.mjs} +2 -2
  57. package/dist/start-CgJl4R-h.mjs +1 -0
  58. package/dist/{start-C08bcOdE.mjs → start-Dy9qpF1P.mjs} +2 -2
  59. package/package.json +1 -1
  60. package/dist/constants-C9SjgIv3.mjs +0 -2
  61. package/dist/init-Ctw_2Azf.mjs +0 -1
  62. package/dist/loader-doLu8-rF.mjs +0 -1
  63. package/dist/preview-BIQkZ80l.mjs +0 -1
  64. package/dist/public/assets/DocumentContext-MXbwQp5D.js +0 -36
  65. package/dist/public/assets/McpConsentDialogBody-DXwlUNR4.js +0 -1
  66. package/dist/public/assets/config-provider-Czfn62dp.js +0 -4
  67. package/dist/public/assets/dist-C0qRhuIN.js +0 -1
  68. package/dist/public/assets/dist-DfThKWJX.js +0 -1
  69. package/dist/public/assets/index-BBDK8MxG.css +0 -1
  70. package/dist/public/assets/skills-api-4lPs2YSK.js +0 -1
  71. package/dist/start-DYazQJIU.mjs +0 -1
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n}from"./compiler-runtime-CVnuRdak.js";import{t as r}from"./react-dom-C-oc-P2K.js";import{l as i}from"./button-cneJOVxD.js";import{d as a,r as o,s,u as c}from"./dist-D9WIglau.js";var l=n(),u=e(r(),1),d=e(t(),1);function f(e){let[t,n]=d.useState(void 0);return s(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var p=[`top`,`right`,`bottom`,`left`],m=[`start`,`end`],h=p.reduce((e,t)=>e.concat(t,t+`-`+m[0],t+`-`+m[1]),[]),g=Math.min,_=Math.max,v=Math.round,y=Math.floor,b=e=>({x:e,y:e}),x={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function S(e,t,n){return _(e,g(t,n))}function C(e,t){return typeof e==`function`?e(t):e}function w(e){return e.split(`-`)[0]}function T(e){return e.split(`-`)[1]}function E(e){return e===`x`?`y`:`x`}function D(e){return e===`y`?`height`:`width`}function O(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function k(e){return E(O(e))}function A(e,t,n){n===void 0&&(n=!1);let r=T(e),i=k(e),a=D(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=z(o)),[o,z(o)]}function j(e){let t=z(e);return[M(e),t,M(t)]}function M(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var N=[`left`,`right`],P=[`right`,`left`],F=[`top`,`bottom`],I=[`bottom`,`top`];function L(e,t,n){switch(e){case`top`:case`bottom`:return n?t?P:N:t?N:P;case`left`:case`right`:return t?F:I;default:return[]}}function R(e,t,n,r){let i=T(e),a=L(w(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(M)))),a}function z(e){let t=w(e);return x[t]+e.slice(t.length)}function B(e){return{top:0,right:0,bottom:0,left:0,...e}}function V(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:B(e)}function H(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ee(e,t,n){let{reference:r,floating:i}=e,a=O(t),o=k(t),s=D(o),c=w(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(T(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function te(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=C(t,e),p=V(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=H(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=H(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ne=50,re=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:te},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ee(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ne&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ee(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ie=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=C(e,t)||{};if(l==null)return{};let d=V(u),f={x:n,y:r},p=k(i),m=D(p),h=await o.getDimensions(l),_=p===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[m]+a.reference[p]-f[p]-a.floating[m],w=f[p]-a.reference[p],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),O=E?E[b]:0;(!O||!await(o.isElement==null?void 0:o.isElement(E)))&&(O=s.floating[b]||a.floating[m]);let A=x/2-w/2,j=O/2-h[m]/2-1,M=g(d[v],j),N=g(d[y],j),P=M,F=O-h[m]-N,I=O/2-h[m]/2+A,L=S(P,I,F),R=!c.arrow&&T(i)!=null&&I!==L&&a.reference[m]/2-(I<P?M:N)-h[m]/2<0,z=R?I<P?I-P:I-F:0;return{[p]:f[p]+z,data:{[p]:L,centerOffset:I-L-z,...R&&{alignmentOffset:z}},reset:R}}});function ae(e,t,n){return(e?[...n.filter(t=>T(t)===e),...n.filter(t=>T(t)!==e)]:n.filter(e=>w(e)===e)).filter(n=>e?T(n)===e||(t?M(n)!==n:!1):!0)}var oe=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=h,autoAlignment:u=!0,...d}=C(e,t),f=c!==void 0||l===h?ae(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,g=f[m];if(g==null)return{};let _=A(g,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==g)return{reset:{placement:f[0]}};let v=[p[w(g)],p[_[0]],p[_[1]]],y=[...r.autoPlacement?.overflows||[],{placement:g,overflows:v}],b=f[m+1];if(b)return{data:{index:m+1,overflows:y},reset:{placement:b}};let x=y.map(e=>{let t=T(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),S=x.filter(e=>e[2].slice(0,T(e[0])?2:3).every(e=>e<=0))[0]?.[0]||x[0][0];return S===i?{}:{data:{index:m+1,overflows:y},reset:{placement:S}}}}},se=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=C(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=w(r),_=O(o),v=w(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[z(o)]:j(o)),x=p!==`none`;!d&&x&&b.push(...R(o,m,p,y));let S=[o,...b],T=await s.detectOverflow(t,h),E=[],D=i.flip?.overflows||[];if(l&&E.push(T[g]),u){let e=A(r,a,y);E.push(T[e[0]],T[e[1]])}if(D=[...D,{placement:r,overflows:E}],!E.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==O(t))||D.every(e=>O(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:D},reset:{placement:t}};let n=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=D.filter(e=>{if(x){let t=O(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function le(e){return p.some(t=>e[t]>=0)}var ue=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=C(e,t);switch(i){case`referenceHidden`:{let e=ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:le(e)}}}case`escaped`:{let e=ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:le(e)}}}default:return{}}}}};function de(e){let t=g(...e.map(e=>e.left)),n=g(...e.map(e=>e.top)),r=_(...e.map(e=>e.right)),i=_(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function fe(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>H(de(e)))}var pe=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=C(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=fe(u),f=H(de(u)),p=V(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(O(n)===`y`){let e=d[0],t=d[d.length-1],r=w(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=w(n)===`left`,t=_(...d.map(e=>e.right)),r=g(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},me=new Set([`left`,`top`]);async function he(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=w(n),s=T(n),c=O(n)===`y`,l=me.has(o)?-1:1,u=a&&c?-1:1,d=C(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ge=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await he(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_e=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=C(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=O(w(i)),p=E(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=S(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=S(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},ve=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=C(e,t),u={x:n,y:r},d=O(i),f=E(d),p=u[f],m=u[d],h=C(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=me.has(w(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ye=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=C(e,t),u=await o.detectOverflow(t,l),d=w(i),f=T(i),p=O(i)===`y`,{width:m,height:h}=a.floating,v,y;d===`top`||d===`bottom`?(v=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(y=d,v=f===`end`?`top`:`bottom`);let b=h-u.top-u.bottom,x=m-u.left-u.right,S=g(h-u[v],b),E=g(m-u[y],x),D=!t.middlewareData.shift,k=S,A=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=b),D&&!f){let e=_(u.left,0),t=_(u.right,0),n=_(u.top,0),r=_(u.bottom,0);p?A=m-2*(e!==0||t!==0?e+t:_(u.left,u.right)):k=h-2*(n!==0||r!==0?n+r:_(u.top,u.bottom))}await c({...t,availableWidth:A,availableHeight:k});let j=await o.getDimensions(s.floating);return m!==j.width||h!==j.height?{reset:{rects:!0}}:{}}}};function be(){return typeof window<`u`}function U(e){return xe(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){return((xe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function xe(e){return be()?e instanceof Node||e instanceof W(e).Node:!1}function K(e){return be()?e instanceof Element||e instanceof W(e).Element:!1}function q(e){return be()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Se(e){return!be()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function Ce(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function we(e){return/^(table|td|th)$/.test(U(e))}function Te(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ee=/transform|translate|scale|rotate|perspective|filter/,De=/paint|layout|strict|content/,J=e=>!!e&&e!==`none`,Oe;function ke(e){let t=K(e)?X(e):e;return J(t.transform)||J(t.translate)||J(t.scale)||J(t.rotate)||J(t.perspective)||!je()&&(J(t.backdropFilter)||J(t.filter))||Ee.test(t.willChange||``)||De.test(t.contain||``)}function Ae(e){let t=Z(e);for(;q(t)&&!Y(t);){if(ke(t))return t;if(Te(t))return null;t=Z(t)}return null}function je(){return Oe??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Oe}function Y(e){return/^(html|body|#document)$/.test(U(e))}function X(e){return W(e).getComputedStyle(e)}function Me(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Z(e){if(U(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Se(e)&&e.host||G(e);return Se(t)?t.host:t}function Ne(e){let t=Z(e);return Y(t)?e.ownerDocument?e.ownerDocument.body:e.body:q(t)&&Ce(t)?t:Ne(t)}function Pe(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ne(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=Fe(a);return t.concat(a,a.visualViewport||[],Ce(r)?r:[],e&&n?Pe(e):[])}else return t.concat(r,Pe(r,[],n))}function Fe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ie(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=q(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=v(n)!==a||v(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Le(e){return K(e)?e:e.contextElement}function Q(e){let t=Le(e);if(!q(t))return b(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ie(t),o=(a?v(n.width):n.width)/r,s=(a?v(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Re=b(0);function ze(e){let t=W(e);return!je()||!t.visualViewport?Re:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Be(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==W(e)?!1:t}function $(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Le(e),o=b(1);t&&(r?K(r)&&(o=Q(r)):o=Q(e));let s=Be(a,n,r)?ze(a):b(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=W(a),t=r&&K(r)?W(r):r,n=e,i=Fe(n);for(;i&&r&&t!==n;){let e=Q(i),t=i.getBoundingClientRect(),r=X(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=W(i),i=Fe(n)}}return H({width:u,height:d,x:c,y:l})}function Ve(e,t){let n=Me(e).scrollLeft;return t?t.left+n:$(G(e)).left+n}function He(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ve(e,n),y:n.top+t.scrollTop}}function Ue(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=G(r),s=t?Te(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=b(1),u=b(0),d=q(r);if((d||!d&&!a)&&((U(r)!==`body`||Ce(o))&&(c=Me(r)),d)){let e=$(r);l=Q(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?He(o,c):b(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function We(e){return Array.from(e.getClientRects())}function Ge(e){let t=G(e),n=Me(e),r=e.ownerDocument.body,i=_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ve(e),s=-n.scrollTop;return X(r).direction===`rtl`&&(o+=_(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ke=25;function qe(e,t){let n=W(e),r=G(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=je();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ve(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ke&&(a-=o)}else l<=Ke&&(a+=l);return{width:a,height:o,x:s,y:c}}function Je(e,t){let n=$(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=q(e)?Q(e):b(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ye(e,t,n){let r;if(t===`viewport`)r=qe(e,n);else if(t===`document`)r=Ge(G(e));else if(K(t))r=Je(t,n);else{let n=ze(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return H(r)}function Xe(e,t){let n=Z(e);return n===t||!K(n)||Y(n)?!1:X(n).position===`fixed`||Xe(n,t)}function Ze(e,t){let n=t.get(e);if(n)return n;let r=Pe(e,[],!1).filter(e=>K(e)&&U(e)!==`body`),i=null,a=X(e).position===`fixed`,o=a?Z(e):e;for(;K(o)&&!Y(o);){let t=X(o),n=ke(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Ce(o)&&!n&&Xe(e,o))?r=r.filter(e=>e!==o):i=t,o=Z(o)}return t.set(e,r),r}function Qe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Te(t)?[]:Ze(t,this._c):[].concat(n),r],o=Ye(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ye(t,a[e],i);s=_(n.top,s),c=g(n.right,c),l=g(n.bottom,l),u=_(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $e(e){let{width:t,height:n}=Ie(e);return{width:t,height:n}}function et(e,t,n){let r=q(t),i=G(t),a=n===`fixed`,o=$(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=b(0);function l(){c.x=Ve(i)}if(r||!r&&!a)if((U(t)!==`body`||Ce(i))&&(s=Me(t)),r){let e=$(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?He(i,s):b(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function tt(e){return X(e).position===`static`}function nt(e,t){if(!q(e)||X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function rt(e,t){let n=W(e);if(Te(e))return n;if(!q(e)){let t=Z(e);for(;t&&!Y(t);){if(K(t)&&!tt(t))return t;t=Z(t)}return n}let r=nt(e,t);for(;r&&we(r)&&tt(r);)r=nt(r,t);return r&&Y(r)&&tt(r)&&!ke(r)?n:r||Ae(e)||n}var it=async function(e){let t=this.getOffsetParent||rt,n=this.getDimensions,r=await n(e.floating);return{reference:et(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function at(e){return X(e).direction===`rtl`}var ot={convertOffsetParentRelativeRectToViewportRelativeRect:Ue,getDocumentElement:G,getClippingRect:Qe,getOffsetParent:rt,getElementRects:it,getClientRects:We,getDimensions:$e,getScale:Q,isElement:K,isRTL:at};function st(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ct(e,t){let n=null,r,i=G(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=y(d),h=y(i.clientWidth-(u+f)),v=y(i.clientHeight-(d+p)),b=y(u),x={rootMargin:-m+`px `+-h+`px `+-v+`px `+-b+`px`,threshold:_(0,g(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(n!==c){if(!S)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!st(l,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return o(!0),a}function lt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Le(e),u=i||a?[...l?Pe(l):[],...t?Pe(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?ct(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?$(e):null;c&&g();function g(){let t=$(e);h&&!st(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ut=ge,dt=oe,ft=_e,pt=se,mt=ye,ht=ue,gt=ie,_t=pe,vt=ve,yt=(e,t,n)=>{let r=new Map,i={platform:ot,...n},a={...i.platform,_c:r};return re(e,t,{...i,platform:a})},bt=typeof document<`u`?d.useLayoutEffect:function(){};function xt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function St(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ct(e,t){let n=St(e);return Math.round(t*n)/n}function wt(e){let t=d.useRef(e);return bt(()=>{t.current=e}),t}function Tt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[f,p]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=d.useState(r);xt(m,r)||h(r);let[g,_]=d.useState(null),[v,y]=d.useState(null),b=d.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=d.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=d.useRef(null),T=d.useRef(null),E=d.useRef(f),D=c!=null,O=wt(c),k=wt(i),A=wt(l),j=d.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),yt(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!xt(E.current,t)&&(E.current=t,u.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);bt(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[l]);let M=d.useRef(!1);bt(()=>(M.current=!0,()=>{M.current=!1}),[]),bt(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=d.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=d.useMemo(()=>({reference:S,floating:C}),[S,C]),F=d.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ct(P.floating,f.x),r=Ct(P.floating,f.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...St(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var Et=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:gt({element:r.current,padding:i}).fn(n):r?gt({element:r,padding:i}).fn(n):{}}}},Dt=(e,t)=>{let n=ut(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ot=(e,t)=>{let n=ft(e);return{name:n.name,fn:n.fn,options:[e,t]}},kt=(e,t)=>({fn:vt(e).fn,options:[e,t]}),At=(e,t)=>{let n=pt(e);return{name:n.name,fn:n.fn,options:[e,t]}},jt=(e,t)=>{let n=mt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mt=(e,t)=>{let n=ht(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nt=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pt=`Arrow`,Ft=d.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,l.jsx)(a.svg,{...o,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,l.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Ft.displayName=Pt;var It=Ft,Lt=`Popper`,[Rt,zt]=c(Lt),[Bt,Vt]=Rt(Lt),Ht=e=>{let{__scopePopper:t,children:n}=e,[r,i]=d.useState(null);return(0,l.jsx)(Bt,{scope:t,anchor:r,onAnchorChange:i,children:n})};Ht.displayName=Lt;var Ut=`PopperAnchor`,Wt=d.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...o}=e,s=Vt(Ut,n),c=d.useRef(null),u=i(t,c),f=d.useRef(null);return d.useEffect(()=>{let e=f.current;f.current=r?.current||c.current,e!==f.current&&s.onAnchorChange(f.current)}),r?null:(0,l.jsx)(a.div,{...o,ref:u})});Wt.displayName=Ut;var Gt=`PopperContent`,[Kt,qt]=Rt(Gt),Jt=d.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:c=0,align:u=`center`,alignOffset:p=0,arrowPadding:m=0,avoidCollisions:h=!0,collisionBoundary:g=[],collisionPadding:_=0,sticky:v=`partial`,hideWhenDetached:y=!1,updatePositionStrategy:b=`optimized`,onPlaced:x,...S}=e,C=Vt(Gt,n),[w,T]=d.useState(null),E=i(t,e=>T(e)),[D,O]=d.useState(null),k=f(D),A=k?.width??0,j=k?.height??0,M=r+(u===`center`?``:`-`+u),N=typeof _==`number`?_:{top:0,right:0,bottom:0,left:0,..._},P=Array.isArray(g)?g:[g],F=P.length>0,I={padding:N,boundary:P.filter(Qt),altBoundary:F},{refs:L,floatingStyles:R,placement:z,isPositioned:B,middlewareData:V}=Tt({strategy:`fixed`,placement:M,whileElementsMounted:(...e)=>lt(...e,{animationFrame:b===`always`}),elements:{reference:C.anchor},middleware:[Dt({mainAxis:c+j,alignmentAxis:p}),h&&Ot({mainAxis:!0,crossAxis:!1,limiter:v===`partial`?kt():void 0,...I}),h&&At({...I}),jt({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),D&&Nt({element:D,padding:m}),$t({arrowWidth:A,arrowHeight:j}),y&&Mt({strategy:`referenceHidden`,...I})]}),[H,ee]=en(z),te=o(x);s(()=>{B&&te?.()},[B,te]);let ne=V.arrow?.x,re=V.arrow?.y,ie=V.arrow?.centerOffset!==0,[ae,oe]=d.useState();return s(()=>{w&&oe(window.getComputedStyle(w).zIndex)},[w]),(0,l.jsx)(`div`,{ref:L.setFloating,"data-radix-popper-content-wrapper":``,style:{...R,transform:B?R.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(` `),...V.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,l.jsx)(Kt,{scope:n,placedSide:H,onArrowChange:O,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,l.jsx)(a.div,{"data-side":H,"data-align":ee,...S,ref:E,style:{...S.style,animation:B?void 0:`none`}})})})});Jt.displayName=Gt;var Yt=`PopperArrow`,Xt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Zt=d.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=qt(Yt,n),a=Xt[i.placedSide];return(0,l.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,l.jsx)(It,{...r,ref:t,style:{...r.style,display:`block`}})})});Zt.displayName=Yt;function Qt(e){return e!==null}var $t=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=en(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function en(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var tn=Ht,nn=Wt,rn=Jt,an=Zt;export{zt as a,lt as c,ht as d,_t as f,f as g,mt as h,tn as i,yt as l,ft as m,an as n,gt as o,ut as p,rn as r,dt as s,nn as t,pt as u};
@@ -1 +1 @@
1
- import{C as e,G as t,Hn as n,Wn as r,Xn as i,dr as a,ir as o,or as s,wr as c,zn as l}from"./dist-CcPVYMcT.js";function u(e){return e.kind===`asset`}function d(e){return e.kind===`document`}function f(e){return e.kind===`folder`}function p(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??m(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function m(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function h(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function g(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function _(e,t=!1){return e.filter(e=>{let r=e.docName??e.path??``;return r===``?!1:t?!0:!n(r)})}function v(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function y(e){let t=v(e);return t?`${t}.md`:`untitled.md`}function b(e){let t=v(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function x(e){let t=e.trim();return{normalizedTarget:v(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function S(e){let t=new Set;for(let n of e)for(let e of h(n))t.add(e);return t}function C(e,t){if(!t)return;let n=c(e);if(n)return t.get(n)}function w(e,t){if(!t||e.includes(`/`))return;let n=c(e);if(n)return t.get(n)}function T(e,t){if(r(e)){let t=o(e);if(t?.kind===`reference`){let e=`references/${t.rel}.md`;return{kind:`skill-file`,target:`global/${t.name}/${e}`,scope:`global`,name:t.name,path:e}}let n=s(e);if(n?.kind===`skill`&&n.scope===`project`){let e=a(n.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}let n=i(e);if(n)return{kind:`doc`,target:n,docName:n};let{normalizedTarget:c,expectsFolder:l}=x(e);if(!c)return{kind:`missing`,target:c};if(!l&&t.pages.has(c))return{kind:`doc`,target:c,docName:c};if(!l){let e=C(c,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let u=`${c}/index`;if(t.pages.has(u))return{kind:`folder-index`,target:c,folderPath:c,docName:u,noteKind:`canonical-index`};let d=c.split(`/`).pop(),f=d?`${c}/${d}`:null;if(f&&t.pages.has(f))return{kind:`folder-index`,target:c,folderPath:c,docName:f,noteKind:`legacy-folder-note`};if(!l){let e=w(c,t.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(t.folderPaths??S(t.pages)).has(c)?{kind:`folder`,target:c,folderPath:c}:{kind:`missing`,target:c}}function E(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function D(t,n,r=e){return typeof n!=`number`||!l(n,r)?null:{kind:`large-file`,target:t,docName:t,size:n,limit:r}}function O(t,n,r=e){return t.kind!==`doc`&&t.kind!==`folder-index`?t:D(t.docName,n.get(t.docName)?.size,r)??t}function k(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`folder`:return null}}function A(e){return t.includes(e)}function j(e){if(e.startsWith(z)||e.startsWith(U)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=B(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function M(e){if(e.startsWith(z)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function N(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function P(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function F(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function I(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function L(e,t,n){if(e===`folder`)return I(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function R(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var z=`#/__asset__/`;function B(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function V(e){if(!e.startsWith(z))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function H(e){return`${z}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var U=`#/__skill-file__/`;function W(e){return`${U}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function G(e){if(!e.startsWith(U))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,o=a.join(`/`);return!r||!i||!o||!A(r)?null:{scope:r,name:i,path:o}}export{g as C,f as D,d as E,m as O,v as S,u as T,x as _,F as a,b,I as c,P as d,G as f,D as g,E as h,L as i,p as k,W as l,k as m,V as n,H as o,S as p,j as r,N as s,M as t,R as u,T as v,_ as w,y as x,O as y};
1
+ import{Bn as e,C as t,Gn as n,K as r,Tr as i,Un as a,Zn as o,ar as s,fr as c,sr as l}from"./dist-COgUpCH8.js";function u(e){return e.kind===`asset`}function d(e){return e.kind===`document`}function f(e){return e.kind===`folder`}function p(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??m(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function m(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function h(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function g(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function _(e,t=!1){return e.filter(e=>{let n=e.docName??e.path??``;return n===``?!1:t?!0:!a(n)})}function v(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function y(e){let t=v(e);return t?`${t}.md`:`untitled.md`}function b(e){let t=v(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function x(e){let t=e.trim();return{normalizedTarget:v(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function S(e){let t=new Set;for(let n of e)for(let e of h(n))t.add(e);return t}function C(e,t){if(!t)return;let n=i(e);if(n)return t.get(n)}function w(e,t){if(!t||e.includes(`/`))return;let n=i(e);if(n)return t.get(n)}function T(e,t){if(n(e)){let t=s(e);if(t?.kind===`reference`){let e=`references/${t.rel}.md`;return{kind:`skill-file`,target:`global/${t.name}/${e}`,scope:`global`,name:t.name,path:e}}let n=l(e);if(n?.kind===`skill`&&n.scope===`project`){let e=c(n.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}let r=o(e);if(r)return{kind:`doc`,target:r,docName:r};let{normalizedTarget:i,expectsFolder:a}=x(e);if(!i)return{kind:`missing`,target:i};if(!a&&t.pages.has(i))return{kind:`doc`,target:i,docName:i};if(!a){let e=C(i,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let u=`${i}/index`;if(t.pages.has(u))return{kind:`folder-index`,target:i,folderPath:i,docName:u,noteKind:`canonical-index`};let d=i.split(`/`).pop(),f=d?`${i}/${d}`:null;if(f&&t.pages.has(f))return{kind:`folder-index`,target:i,folderPath:i,docName:f,noteKind:`legacy-folder-note`};if(!a){let e=w(i,t.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(t.folderPaths??S(t.pages)).has(i)?{kind:`folder`,target:i,folderPath:i}:{kind:`missing`,target:i}}function E(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function D(n,r,i=t){return typeof r!=`number`||!e(r,i)?null:{kind:`large-file`,target:n,docName:n,size:r,limit:i}}function O(e,n,r=t){return e.kind!==`doc`&&e.kind!==`folder-index`?e:D(e.docName,n.get(e.docName)?.size,r)??e}function k(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`folder`:return null}}function A(e){return r.includes(e)}function j(e){if(e.startsWith(z)||e.startsWith(U)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=B(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function M(e){if(e.startsWith(z)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function N(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function P(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function F(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function I(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function L(e,t,n){if(e===`folder`)return I(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function R(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var z=`#/__asset__/`;function B(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function V(e){if(!e.startsWith(z))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function H(e){return`${z}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var U=`#/__skill-file__/`;function W(e){return`${U}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function G(e){if(!e.startsWith(U))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,o=a.join(`/`);return!r||!i||!o||!A(r)?null:{scope:r,name:i,path:o}}export{g as C,f as D,d as E,m as O,v as S,u as T,x as _,F as a,b,I as c,P as d,G as f,D as g,E as h,L as i,p as k,W as l,k as m,V as n,H as o,S as p,j as r,N as s,M as t,R as u,T as v,_ as w,y as x,O as y};
@@ -1 +1 @@
1
- import{T as e}from"./dist-CcPVYMcT.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}var o=`open-knowledge:branch-changed`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{branch:e}}))}function c(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:templates-changed`;function u(){window.dispatchEvent(new CustomEvent(l))}function d(e){let t=()=>e();return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:skills-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}export{c as a,d as c,u as i,i as n,a as o,p as r,m as s,s as t};
1
+ import{T as e}from"./dist-COgUpCH8.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}var o=`open-knowledge:branch-changed`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{branch:e}}))}function c(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:templates-changed`;function u(){window.dispatchEvent(new CustomEvent(l))}function d(e){let t=()=>e();return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:skills-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}export{c as a,d as c,u as i,i as n,a as o,p as r,m as s,s as t};
@@ -1 +1 @@
1
- import{Fi as e}from"./dist-CcPVYMcT.js";import{t}from"./file-tree-rename-validation-BkATWpiZ.js";import{D as n,E as r,T as i,c as a,g as o,o as s,s as c}from"./doc-hash-BN71TGv_.js";var l=`application/x-open-knowledge-sidebar-item+json`,u={image:!0,video:!0,audio:!0,pdf:!0,text:!0};function d(e){return JSON.stringify(e)}function f(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:a(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:s(e.assetPath)}:{target:o(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:c(e.docName)}}function p(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(l);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!m(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!h(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function m(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function h(e){return typeof e==`string`&&Object.hasOwn(u,e)}var g={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},_={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function v(e){return e===`dark`?g:_}var y=`.md`,b=/\.(md|mdx)$/i;function x(e,t=y){return`${e}${t}`}function S(e){return X(e).replace(b,``)}function C(e){return n(e)?E(e.path):i(e)?e.path:x(e.docName,e.docExt)}function w(e){let t=X(e).match(b);return t?`.${t[1].toLowerCase()}`:void 0}function T(e){return X(e)}function E(e){let t=X(e.trim());return t?`${t}/`:``}function D(e){return e.endsWith(`/`)?T(e):S(e)}function O(e){return e.map(C)}function k(e){return[...e].sort().join(`\0`)}function A(e){return k(O(e))}function j(e){let t=new Set;for(let r of e){let e=(n(r)||i(r)?r.path:r.docName).split(`/`).filter(Boolean);if(e.includes(`.ok`))continue;if(n(r)){let e=E(r.path);e&&t.add(e)}let a=n(r)?e.length:e.length-1;for(let n=1;n<=a;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function M(e){if(!e)return[];let t=X(e.replace(b,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function N(e,t,n){let i=w(e);if(i)return i;let a=n.find(e=>r(e)&&e.docName===t);return a?a.docExt??y:Y(e).includes(`.`)?void 0:y}function P(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),a=n===-1?e:e.slice(n+1),o=t.filter(e=>{if(!i(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${a}.`)});return o.length===1?o[0].path:null}function F(e,t,n){if(w(e))return null;let r=n.find(e=>i(e)&&e.path===t);return r?r.path:Y(e).includes(`.`)?t:P(t,n)}function I(e,t){let n=e.kind===`directory`,r=n?T(e.path):S(e.path);if(n)return{kind:`folder`,name:X(Y(e.path)).replace(b,``),path:r,treePath:R(e.path,!0)};let i=F(e.path,r,t);if(i)return{kind:`asset`,name:X(Y(i)),path:i,treePath:i};let a=N(e.path,r,t);return{kind:`file`,name:X(Y(e.path)).replace(b,``),path:r,treePath:R(e.path,!1),docExt:a}}function L(e){return e.kind===`directory`?T(e.path):e.path}function R(e,t){return t?E(e):b.test(e)?e:`${e}${y}`}function z(e,t,n){let r=E(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${y}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function B(e,t){return e===`file`?R(t,!1):`${T(t)}/index${y}`}function V(e,t){return t.kind===`root`||t.directoryPath==null?Y(e):`${t.directoryPath}${Y(e)}`}function H(e,t){if(t)return T(E(e));let n=S(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function U(e,t){let n=T(E(e));return n?`${n}/${t}`:t}function W(e,t,n){e.append(`parentDocName`,U(t,n)),e.append(`placement`,`parent-dir`)}function G(e,t){return(t.path??U(e,t.src)).replace(/^\/+/,``)}function K(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function q(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function J(n,r){let i=t(n).toLowerCase();if(i===``)return null;let a=new Date().toISOString();if(i===`.md`||i===`.mdx`)return{kind:`document`,docName:S(n),docExt:i,modified:a,size:r.size};let o=i.startsWith(`.`)?i.slice(1):i;return{kind:`asset`,path:n,assetExt:o,mediaKind:e(o),modified:a,size:r.size}}function Y(e){let t=X(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function X(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{D as C,f as D,l as E,p as O,k as S,v as T,L as _,B as a,S as b,O as c,C as d,q as f,H as g,R as h,V as i,d as k,A as l,K as m,j as n,z as o,E as p,M as r,x as s,W as t,J as u,P as v,G as w,I as x,T as y};
1
+ import{Ii as e}from"./dist-COgUpCH8.js";import{t}from"./file-tree-rename-validation-BkATWpiZ.js";import{D as n,E as r,T as i,c as a,g as o,o as s,s as c}from"./doc-hash-D4PHQioS.js";var l=`application/x-open-knowledge-sidebar-item+json`,u={image:!0,video:!0,audio:!0,pdf:!0,text:!0};function d(e){return JSON.stringify(e)}function f(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:a(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:s(e.assetPath)}:{target:o(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:c(e.docName)}}function p(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(l);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!m(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!h(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function m(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function h(e){return typeof e==`string`&&Object.hasOwn(u,e)}var g={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},_={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function v(e){return e===`dark`?g:_}var y=`.md`,b=/\.(md|mdx)$/i;function x(e,t=y){return`${e}${t}`}function S(e){return X(e).replace(b,``)}function C(e){return n(e)?E(e.path):i(e)?e.path:x(e.docName,e.docExt)}function w(e){let t=X(e).match(b);return t?`.${t[1].toLowerCase()}`:void 0}function T(e){return X(e)}function E(e){let t=X(e.trim());return t?`${t}/`:``}function D(e){return e.endsWith(`/`)?T(e):S(e)}function O(e){return e.map(C)}function k(e){return[...e].sort().join(`\0`)}function A(e){return k(O(e))}function j(e){let t=new Set;for(let r of e){let e=(n(r)||i(r)?r.path:r.docName).split(`/`).filter(Boolean);if(e.includes(`.ok`))continue;if(n(r)){let e=E(r.path);e&&t.add(e)}let a=n(r)?e.length:e.length-1;for(let n=1;n<=a;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function M(e){if(!e)return[];let t=X(e.replace(b,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function N(e,t,n){let i=w(e);if(i)return i;let a=n.find(e=>r(e)&&e.docName===t);return a?a.docExt??y:Y(e).includes(`.`)?void 0:y}function P(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),a=n===-1?e:e.slice(n+1),o=t.filter(e=>{if(!i(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${a}.`)});return o.length===1?o[0].path:null}function F(e,t,n){if(w(e))return null;let r=n.find(e=>i(e)&&e.path===t);return r?r.path:Y(e).includes(`.`)?t:P(t,n)}function I(e,t){let n=e.kind===`directory`,r=n?T(e.path):S(e.path);if(n)return{kind:`folder`,name:X(Y(e.path)).replace(b,``),path:r,treePath:R(e.path,!0)};let i=F(e.path,r,t);if(i)return{kind:`asset`,name:X(Y(i)),path:i,treePath:i};let a=N(e.path,r,t);return{kind:`file`,name:X(Y(e.path)).replace(b,``),path:r,treePath:R(e.path,!1),docExt:a}}function L(e){return e.kind===`directory`?T(e.path):e.path}function R(e,t){return t?E(e):b.test(e)?e:`${e}${y}`}function z(e,t,n){let r=E(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${y}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function B(e,t){return e===`file`?R(t,!1):`${T(t)}/index${y}`}function V(e,t){return t.kind===`root`||t.directoryPath==null?Y(e):`${t.directoryPath}${Y(e)}`}function H(e,t){if(t)return T(E(e));let n=S(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function U(e,t){let n=T(E(e));return n?`${n}/${t}`:t}function W(e,t,n){e.append(`parentDocName`,U(t,n)),e.append(`placement`,`parent-dir`)}function G(e,t){return(t.path??U(e,t.src)).replace(/^\/+/,``)}function K(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function q(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function J(n,r){let i=t(n).toLowerCase();if(i===``)return null;let a=new Date().toISOString();if(i===`.md`||i===`.mdx`)return{kind:`document`,docName:S(n),docExt:i,modified:a,size:r.size};let o=i.startsWith(`.`)?i.slice(1):i;return{kind:`asset`,path:n,assetExt:o,mediaKind:e(o),modified:a,size:r.size}}function Y(e){let t=X(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function X(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{D as C,f as D,l as E,p as O,k as S,v as T,L as _,B as a,S as b,O as c,C as d,q as f,H as g,R as h,V as i,d as k,A as l,K as m,j as n,z as o,E as p,M as r,x as s,W as t,J as u,P as v,G as w,I as x,T as y};