@inkeep/open-knowledge 0.0.0-dev-20260422103101 → 0.0.0-dev-20260422171440
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +4 -4
- package/dist/constants-BsBTeRCL.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/init-B6Ufq752.mjs +1 -0
- package/dist/{init-d9wf2ATC.mjs → init-CM66xil2.mjs} +3 -3
- package/dist/{init-BwRnDaUa.mjs → init-DrSlBesI.mjs} +2 -2
- package/dist/init-DrW3fwT1.mjs +1 -0
- package/dist/{loader-X2UYTNqe.mjs → loader-CYvz6nef.mjs} +2 -2
- package/dist/loader-CiFIlkkp.mjs +1 -0
- package/dist/{paths-DYcYIqx2.mjs → paths-D6Xgg5WG.mjs} +2 -2
- package/dist/paths-Szv_tZj8.mjs +1 -0
- package/dist/{preview-CG6UE3J0.mjs → preview-CRZPJMbg.mjs} +2 -2
- package/dist/preview-CT7B_1hJ.mjs +1 -0
- package/dist/public/assets/GraphPanel-DqKpB1Tz.js +46 -0
- package/dist/public/assets/SourceEditor-CV7AqTwb.js +3 -0
- package/dist/public/assets/clipboard-D_fdmuyh.js +80 -0
- package/dist/public/assets/dist-BXy0xauE.js +1 -0
- package/dist/public/assets/dist-BZpbe8U5.js +1 -0
- package/dist/public/assets/dist-C0ssNH5f.js +9 -0
- package/dist/public/assets/dist-C5cYj6hk.js +1 -0
- package/dist/public/assets/dist-CYCPSCCQ.js +1 -0
- package/dist/public/assets/dist-CtX4SukE.js +13 -0
- package/dist/public/assets/dist-ztaVC3x4.js +1 -0
- package/dist/public/assets/index-Cc7W6NSO.js +17 -0
- package/dist/public/assets/panel-DFRQJTBG.js +240 -0
- package/dist/public/assets/toggle-group-D4a_dmpa.js +1 -0
- package/dist/public/assets/w3c-keyname-DLDSJn4E.js +1 -0
- package/dist/public/index.html +8 -4
- package/dist/src-vp93REiw.mjs +1 -0
- package/dist/start-CrLEzGrk.mjs +1 -0
- package/dist/{start-DHi9coRg.mjs → start-Dtc5s628.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-BVlXdKF2.mjs +0 -2
- package/dist/init-BEXFKO6K.mjs +0 -1
- package/dist/init-CXKU8pCL.mjs +0 -1
- package/dist/loader-Ck0aVV42.mjs +0 -1
- package/dist/paths-BIn1dA04.mjs +0 -1
- package/dist/preview-CWlYVyE-.mjs +0 -1
- package/dist/public/assets/dist-4KUZ8qw_.js +0 -1
- package/dist/public/assets/dist-Bvlmbwcy.js +0 -1
- package/dist/public/assets/dist-CWsgPYc6.js +0 -13
- package/dist/public/assets/dist-D5yBWykF.js +0 -1
- package/dist/public/assets/dist-DcQNS1eS.js +0 -1
- package/dist/public/assets/dist-DvCIPVI0.js +0 -9
- package/dist/public/assets/dist-csWIvcml.js +0 -1
- package/dist/public/assets/dist-saWP7AQm.js +0 -1
- package/dist/public/assets/index-Baf8TpjF.js +0 -381
- package/dist/src-2kqr_sLQ.mjs +0 -1
- package/dist/start-BqWssZGZ.mjs +0 -1
- /package/dist/public/assets/{go-B8kgVkyB.js → go-IODVg4Ok.js} +0 -0
- /package/dist/public/assets/{shell-BsPlf5L6.js → shell-COsTRxlr.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$t as e,Bt as t,Gt as n,Ht as r,Jt as i,Kt as a,Lt as o,Qt as s,Rt as c,Ut as l,Vt as u,Wn as d,Xt as f,Yt as p,Z as m,Zt as h,an as g,bn as _,cn as v,dn as y,en as b,fn as x,in as S,ln as C,mn as w,nn as T,pn as E,qt as D,st as O,tn as k,xn as A}from"./panel-DFRQJTBG.js";var j=x(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),M=x(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),N=x(`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`}]]),P=d(w(),1),F=d(A(),1),I=_(),ee=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),te=`VisuallyHidden`,ne=F.forwardRef((e,t)=>(0,I.jsx)(g.span,{...e,ref:t,style:{...ee,...e.style}}));ne.displayName=te;var L=ne;function R(e){let t=e+`CollectionProvider`,[n,r]=S(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=F.useRef(null),a=F.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=v(s),l=F.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,I.jsx)(c,{ref:y(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=v(u),p=F.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=F.useRef(null),s=y(t,o),c=a(u,n);return F.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return F.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var re=F.createContext(void 0);function z(e){let t=F.useContext(re);return e||t||`ltr`}function ie(e){let[t,n]=F.useState(void 0);return k(()=>{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 B=typeof document<`u`?F.useLayoutEffect:function(){};function V(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(!V(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)&&!V(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ae(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oe(e,t){let n=ae(e);return Math.round(t*n)/n}function H(e){let t=F.useRef(e);return B(()=>{t.current=e}),t}function se(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,[d,f]=F.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=F.useState(r);V(p,r)||m(r);let[h,g]=F.useState(null),[_,v]=F.useState(null),y=F.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=F.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=F.useRef(null),w=F.useRef(null),T=F.useRef(d),E=c!=null,D=H(c),O=H(i),k=H(l),A=F.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),u(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!V(T.current,t)&&(T.current=t,P.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);B(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=F.useRef(!1);B(()=>(j.current=!0,()=>{j.current=!1}),[]),B(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=F.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=F.useMemo(()=>({reference:x,floating:S}),[x,S]),I=F.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=oe(N.floating,d.x),r=oe(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ae(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return F.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:I}),[d,A,M,N,I])}var ce=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?{}:c({element:r.current,padding:i}).fn(n):r?c({element:r,padding:i}).fn(n):{}}}},le=(e,t)=>{let n=a(e);return{name:n.name,fn:n.fn,options:[e,t]}},ue=(e,t)=>{let n=D(e);return{name:n.name,fn:n.fn,options:[e,t]}},de=(e,t)=>({fn:n(e).fn,options:[e,t]}),fe=(e,t)=>{let n=r(e);return{name:n.name,fn:n.fn,options:[e,t]}},pe=(e,t)=>{let n=i(e);return{name:n.name,fn:n.fn,options:[e,t]}},me=(e,t)=>{let n=l(e);return{name:n.name,fn:n.fn,options:[e,t]}},he=(e,t)=>{let n=ce(e);return{name:n.name,fn:n.fn,options:[e,t]}},ge=`Arrow`,_e=F.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(g.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});_e.displayName=ge;var ve=_e,ye=`Popper`,[be,xe]=S(ye),[Se,Ce]=be(ye),we=e=>{let{__scopePopper:t,children:n}=e,[r,i]=F.useState(null);return(0,I.jsx)(Se,{scope:t,anchor:r,onAnchorChange:i,children:n})};we.displayName=ye;var Te=`PopperAnchor`,Ee=F.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Ce(Te,n),o=F.useRef(null),s=y(t,o),c=F.useRef(null);return F.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,I.jsx)(g.div,{...i,ref:s})});Ee.displayName=Te;var U=`PopperContent`,[De,Oe]=be(U),ke=F.forwardRef((e,n)=>{let{__scopePopper:r,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:_,...v}=e,b=Ce(U,r),[x,S]=F.useState(null),C=y(n,e=>S(e)),[w,T]=F.useState(null),E=ie(w),D=E?.width??0,O=E?.height??0,A=i+(o===`center`?``:`-`+o),j=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(u)?u:[u],N=M.length>0,P={padding:j,boundary:M.filter(Ne),altBoundary:N},{refs:ee,floatingStyles:te,placement:ne,isPositioned:L,middlewareData:R}=se({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>t(...e,{animationFrame:m===`always`}),elements:{reference:b.anchor},middleware:[le({mainAxis:a+O,alignmentAxis:s}),l&&ue({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?de():void 0,...P}),l&&fe({...P}),pe({...P,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`)}}),w&&he({element:w,padding:c}),Pe({arrowWidth:D,arrowHeight:O}),p&&me({strategy:`referenceHidden`,...P})]}),[re,z]=Fe(ne),B=h(_);k(()=>{L&&B?.()},[L,B]);let V=R.arrow?.x,ae=R.arrow?.y,oe=R.arrow?.centerOffset!==0,[H,ce]=F.useState();return k(()=>{x&&ce(window.getComputedStyle(x).zIndex)},[x]),(0,I.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:L?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:H,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(` `),...R.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(De,{scope:r,placedSide:re,onArrowChange:T,arrowX:V,arrowY:ae,shouldHideArrow:oe,children:(0,I.jsx)(g.div,{"data-side":re,"data-align":z,...v,ref:C,style:{...v.style,animation:L?void 0:`none`}})})})});ke.displayName=U;var Ae=`PopperArrow`,je={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Me=F.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Oe(Ae,n),a=je[i.placedSide];return(0,I.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,I.jsx)(ve,{...r,ref:t,style:{...r.style,display:`block`}})})});Me.displayName=Ae;function Ne(e){return e!==null}var Pe=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]=Fe(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 Fe(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ie=we,Le=Ee,Re=ke,ze=Me,W=`rovingFocusGroup.onEntryFocus`,Be={bubbles:!1,cancelable:!0},G=`RovingFocusGroup`,[Ve,He,Ue]=R(G),[We,Ge]=S(G,[Ue]),[Ke,qe]=We(G),Je=F.forwardRef((e,t)=>(0,I.jsx)(Ve.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(Ve.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(Ye,{...e,ref:t})})}));Je.displayName=G;var Ye=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=F.useRef(null),p=y(t,f),m=z(a),[_,v]=b({prop:o,defaultProp:s??null,onChange:c,caller:G}),[x,S]=F.useState(!1),C=h(l),w=He(n),E=F.useRef(!1),[D,O]=F.useState(0);return F.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(W,C),()=>e.removeEventListener(W,C)},[C]),(0,I.jsx)(Ke,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:_,onItemFocus:F.useCallback(e=>v(e),[v]),onItemShiftTab:F.useCallback(()=>S(!0),[]),onFocusableItemAdd:F.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:F.useCallback(()=>O(e=>e-1),[]),children:(0,I.jsx)(g.div,{tabIndex:x||D===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:T(e.onMouseDown,()=>{E.current=!0}),onFocus:T(e.onFocus,e=>{let t=!E.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(W,Be);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);tt([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),u)}}E.current=!1}),onBlur:T(e.onBlur,()=>S(!1))})})}),Xe=`RovingFocusGroupItem`,Ze=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...c}=e,l=s(),u=a||l,d=qe(Xe,n),f=d.currentTabStopId===u,p=He(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:_}=d;return F.useEffect(()=>{if(r)return m(),()=>h()},[r,m,h]),(0,I.jsx)(Ve.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,I.jsx)(g.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:T(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:T(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:T(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=et(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?nt(n,r+1):n.slice(r+1)}setTimeout(()=>tt(n))}}),children:typeof o==`function`?o({isCurrentTabStop:f,hasTabStop:_!=null}):o})})});Ze.displayName=Xe;var Qe={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function $e(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function et(e,t,n){let r=$e(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Qe[r]}function tt(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function nt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rt=Je,it=Ze,at=`Toggle`,ot=F.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=b({prop:n,onChange:i,defaultProp:r??!1,caller:at});return(0,I.jsx)(g.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:T(e.onClick,()=>{e.disabled||s(!o)})})});ot.displayName=at;var K=`ToggleGroup`,[st,ct]=S(K,[Ge]),lt=Ge(),ut=F.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,I.jsx)(pt,{...r,ref:t});if(n===`multiple`)return(0,I.jsx)(mt,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${K}\``)});ut.displayName=K;var[dt,ft]=st(K),pt=F.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=b({prop:n,defaultProp:r??``,onChange:i,caller:K});return(0,I.jsx)(dt,{scope:e.__scopeToggleGroup,type:`single`,value:F.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:F.useCallback(()=>s(``),[s]),children:(0,I.jsx)(_t,{...a,ref:t})})}),mt=F.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=b({prop:n,defaultProp:r??[],onChange:i,caller:K}),c=F.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=F.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,I.jsx)(dt,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,I.jsx)(_t,{...a,ref:t})})});ut.displayName=K;var[ht,gt]=st(K),_t=F.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=lt(n),u=z(o),d={role:`group`,dir:u,...c};return(0,I.jsx)(ht,{scope:n,rovingFocus:i,disabled:r,children:i?(0,I.jsx)(rt,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,I.jsx)(g.div,{...d,ref:t})}):(0,I.jsx)(g.div,{...d,ref:t})})}),q=`ToggleGroupItem`,vt=F.forwardRef((e,t)=>{let n=ft(q,e.__scopeToggleGroup),r=gt(q,e.__scopeToggleGroup),i=lt(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=F.useRef(null);return r.rovingFocus?(0,I.jsx)(it,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,I.jsx)(yt,{...s,ref:t})}):(0,I.jsx)(yt,{...s,ref:t})});vt.displayName=q;var yt=F.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=ft(q,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,I.jsx)(ot,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),bt=ut,xt=vt,[J,St]=S(`Tooltip`,[xe]),Y=xe(),Ct=`TooltipProvider`,wt=700,Tt=`tooltip.open`,[Et,Dt]=J(Ct),Ot=e=>{let{__scopeTooltip:t,delayDuration:n=wt,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=F.useRef(!0),s=F.useRef(!1),c=F.useRef(0);return F.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(Et,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:F.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:F.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:F.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Ot.displayName=Ct;var X=`Tooltip`,[kt,Z]=J(X),At=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:c}=e,l=Dt(X,e.__scopeTooltip),u=Y(t),[d,f]=F.useState(null),p=s(),m=F.useRef(0),h=o??l.disableHoverableContent,g=c??l.delayDuration,_=F.useRef(!1),[v,y]=b({prop:r,defaultProp:i??!1,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(Tt))):l.onClose(),a?.(e)},caller:X}),x=F.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),S=F.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_.current=!1,y(!0)},[y]),C=F.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),w=F.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{_.current=!0,y(!0),m.current=0},g)},[g,y]);return F.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,I.jsx)(Ie,{...u,children:(0,I.jsx)(kt,{scope:t,contentId:p,open:v,stateAttribute:x,trigger:d,onTriggerChange:f,onTriggerEnter:F.useCallback(()=>{l.isOpenDelayedRef.current?w():S()},[l.isOpenDelayedRef,w,S]),onTriggerLeave:F.useCallback(()=>{h?C():(window.clearTimeout(m.current),m.current=0)},[C,h]),onOpen:S,onClose:C,disableHoverableContent:h,children:n})})};At.displayName=X;var jt=`TooltipTrigger`,Mt=F.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Z(jt,n),a=Dt(jt,n),o=Y(n),s=y(t,F.useRef(null),i.onTriggerChange),c=F.useRef(!1),l=F.useRef(!1),u=F.useCallback(()=>c.current=!1,[]);return F.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,I.jsx)(Le,{asChild:!0,...o,children:(0,I.jsx)(g.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:T(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:T(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:T(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:T(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:T(e.onBlur,i.onClose),onClick:T(e.onClick,i.onClose)})})});Mt.displayName=jt;var Nt=`TooltipPortal`,[Pt,Ft]=J(Nt,{forceMount:void 0}),It=t=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=t,o=Z(Nt,n);return(0,I.jsx)(Pt,{scope:n,forceMount:r,children:(0,I.jsx)(e,{present:r||o.open,children:(0,I.jsx)(p,{asChild:!0,container:a,children:i})})})};It.displayName=Nt;var Q=`TooltipContent`,Lt=F.forwardRef((t,n)=>{let r=Ft(Q,t.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=t,s=Z(Q,t.__scopeTooltip);return(0,I.jsx)(e,{present:i||s.open,children:s.disableHoverableContent?(0,I.jsx)(Ht,{side:a,...o,ref:n}):(0,I.jsx)(Rt,{side:a,...o,ref:n})})}),Rt=F.forwardRef((e,t)=>{let n=Z(Q,e.__scopeTooltip),r=Dt(Q,e.__scopeTooltip),i=F.useRef(null),a=y(t,i),[o,s]=F.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=F.useCallback(()=>{s(null),d(!1)},[d]),p=F.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Kt(r,Gt(r,n.getBoundingClientRect())),a=qt(t.getBoundingClientRect());s(Yt([...i,...a])),d(!0)},[d]);return F.useEffect(()=>()=>f(),[f]),F.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),F.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Jt(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(Ht,{...e,ref:a})}),[zt,Bt]=J(X,{isInside:!1}),Vt=C(`TooltipContent`),Ht=F.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Z(Q,n),l=Y(n),{onClose:u}=c;return F.useEffect(()=>(document.addEventListener(Tt,u),()=>document.removeEventListener(Tt,u)),[u]),F.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,I.jsx)(f,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,I.jsxs)(Re,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,I.jsx)(Vt,{children:r}),(0,I.jsx)(zt,{scope:n,isInside:!0,children:(0,I.jsx)(L,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Lt.displayName=Q;var Ut=`TooltipArrow`,Wt=F.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Y(n);return Bt(Ut,n).isInside?null:(0,I.jsx)(ze,{...i,...r,ref:t})});Wt.displayName=Ut;function Gt(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Kt(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function qt(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Jt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Yt(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Xt(t)}function Xt(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Zt=Ot,Qt=At,$t=Mt,en=It,tn=Lt,nn=Wt,$=E();function rn(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,I.jsx)(Zt,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function an(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(Qt,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function on(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)($t,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function sn(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=a===void 0?0:a,c;t[5]===r?c=t[6]:(c=o(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[5]=r,t[6]=c);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(nn,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=l):l=t[7];let u;return t[8]!==n||t[9]!==i||t[10]!==s||t[11]!==c?(u=(0,I.jsx)(en,{children:(0,I.jsxs)(tn,{"data-slot":`tooltip-content`,sideOffset:s,className:c,...i,children:[n,l]})}),t[8]=n,t[9]=i,t[10]=s,t[11]=c,t[12]=u):u=t[12],u}function cn(e){switch(e.kind){case`doc`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:return`missing`}}function ln(e,t){let n=m(e,t);return{resolvedTarget:n,hashDocName:n.target,displayState:cn(n)}}var un=O(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`,segmented:`text-muted-foreground hover:bg-muted-foreground/10 data-[state=on]:bg-background data-[state=on]:shadow-sm data-[state=on]:text-foreground dark:data-[state=on]:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),dn=F.createContext({size:`default`,variant:`default`,spacing:0,orientation:`horizontal`});function fn(e){let t=(0,$.c)(29),n,r,i,a,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7]):({className:r,variant:l,size:a,spacing:s,orientation:c,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l);let u=s===void 0?0:s,d=c===void 0?`horizontal`:c,f;t[8]===u?f=t[9]:(f={"--gap":u},t[8]=u,t[9]=f);let p=f,m;t[10]===r?m=t[11]:(m=o(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,r),t[10]=r,t[11]=m);let h;t[12]!==d||t[13]!==a||t[14]!==u||t[15]!==l?(h={variant:l,size:a,spacing:u,orientation:d},t[12]=d,t[13]=a,t[14]=u,t[15]=l,t[16]=h):h=t[16];let g;t[17]!==n||t[18]!==h?(g=(0,I.jsx)(dn.Provider,{value:h,children:n}),t[17]=n,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==d||t[21]!==i||t[22]!==a||t[23]!==u||t[24]!==p||t[25]!==m||t[26]!==g||t[27]!==l?(_=(0,I.jsx)(bt,{"data-slot":`toggle-group`,"data-variant":l,"data-size":a,"data-spacing":u,"data-orientation":d,style:p,className:m,...i,children:g}),t[20]=d,t[21]=i,t[22]=a,t[23]=u,t[24]=p,t[25]=m,t[26]=g,t[27]=l,t[28]=_):_=t[28],_}function pn(e){let t=(0,$.c)(19),n,r,i,a,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5]):({className:r,children:n,variant:a,size:s,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s);let c=a===void 0?`default`:a,l=s===void 0?`default`:s,u=F.use(dn),d=u.variant||c,f=u.size||l,p=u.spacing,m;t[6]!==r||t[7]!==u.size||t[8]!==u.variant||t[9]!==l||t[10]!==c?(m=o(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,un({variant:u.variant||c,size:u.size||l}),r),t[6]=r,t[7]=u.size,t[8]=u.variant,t[9]=l,t[10]=c,t[11]=m):m=t[11];let h;return t[12]!==n||t[13]!==u.spacing||t[14]!==i||t[15]!==d||t[16]!==f||t[17]!==m?(h=(0,I.jsx)(xt,{"data-slot":`toggle-group-item`,"data-variant":d,"data-size":f,"data-spacing":p,className:m,...i,children:n}),t[12]=n,t[13]=u.spacing,t[14]=i,t[15]=d,t[16]=f,t[17]=m,t[18]=h):h=t[18],h}export{z as _,sn as a,M as b,it as c,Le as d,ze as f,ie as g,xe as h,an as i,rt as l,Ie as m,pn as n,rn as o,Re as p,ln as r,on as s,fn as t,Ge as u,R as v,j as x,N as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
for(var e={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},t={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},n=typeof navigator<`u`&&/Mac/.test(navigator.platform),r=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),i=0;i<10;i++)e[48+i]=e[96+i]=String(i);for(var i=1;i<=24;i++)e[i+111]=`F`+i;for(var i=65;i<=90;i++)e[i]=String.fromCharCode(i+32),t[i]=String.fromCharCode(i);for(var a in e)t.hasOwnProperty(a)||(t[a]=e[a]);function o(i){var a=!(n&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||r&&i.shiftKey&&i.key&&i.key.length==1||i.key==`Unidentified`)&&i.key||(i.shiftKey?t:e)[i.keyCode]||i.key||`Unidentified`;return a==`Esc`&&(a=`Escape`),a==`Del`&&(a=`Delete`),a==`Left`&&(a=`ArrowLeft`),a==`Up`&&(a=`ArrowUp`),a==`Right`&&(a=`ArrowRight`),a==`Down`&&(a=`ArrowDown`),a}export{o as n,t as r,e as t};
|
package/dist/public/index.html
CHANGED
|
@@ -7,10 +7,14 @@
|
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
9
9
|
<title>Open Knowledge</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-Cc7W6NSO.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/w3c-keyname-DLDSJn4E.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/panel-DFRQJTBG.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-CtX4SukE.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-C5cYj6hk.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-ztaVC3x4.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/clipboard-D_fdmuyh.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/toggle-group-D4a_dmpa.js">
|
|
14
18
|
<link rel="stylesheet" crossorigin href="/assets/index-BMQfimy6.css">
|
|
15
19
|
</head>
|
|
16
20
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./loader-CYvz6nef.mjs";export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./start-Dtc5s628.mjs";export{e as startCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./constants-
|
|
2
|
-
//# sourceMappingURL=start-
|
|
1
|
+
import{a as e}from"./constants-BsBTeRCL.mjs";import{D as t}from"./src-CdcLi3q2.mjs";import{Command as n}from"commander";import{closeSync as r,existsSync as i,mkdirSync as a,openSync as o}from"node:fs";import{join as s}from"node:path";import{spawn as c}from"node:child_process";function l(){let e=process.execPath,t=process.argv[1];return t?{command:e,prefixArgs:[t]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx @inkeep/open-knowledge\`. This re-introduces the version-drift surface that re-exec was fixing. Observed argv: ${JSON.stringify(process.argv)}`),{command:`npx`,prefixArgs:[`@inkeep/open-knowledge`]})}function u(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function d(e){i(e.lockDir)||a(e.lockDir,{recursive:!0});let t=o(s(e.lockDir,`last-spawn-error.log`),`w`),n=e.spawn??c,{PORT:u,...d}=process.env,f=l();try{let r=n(f.command,[...f.prefixArgs,...e.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,t],cwd:e.cwd,env:d});return r.unref(),r}finally{try{r(t)}catch{}}}function f(e){let t=e.sigtermGraceMs??1e4,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>new Promise(t=>setTimeout(t,e)));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function p(e){let{config:n,cwd:r}=e,i=e.skipAutoInit??!1,a=e.skipUiAutoSpawn??!1,o=e.idleThresholdMs??18e5,{existsSync:s,mkdirSync:c}=await import(`node:fs`),{resolve:l}=await import(`node:path`),{bootServer:p,ensureProjectGit:m,getLogger:h,isProcessAlive:g,readUiLock:_}=await import(`./src-DRRh4faC.mjs`),{resolveContentDir:v}=await import(`./paths-Szv_tZj8.mjs`),y=e.log??h(`start`),b=v(n,r);s(b)||(c(b,{recursive:!0}),y.info({contentDir:b},`Created content directory`));let x=!s(l(r,t)),S=i?void 0:async()=>{try{let{initContent:e}=await import(`./init-DrW3fwT1.mjs`),t=e(r);return x||t.created.length>0}catch(e){return console.warn(`Auto-init failed:`,e instanceof Error?e.message:e),!1}},C=!1,w=l(b,t),T=n.server.openOnAgentEdit?()=>{if(C)return;let e=_(w);if(!e||e.port<=0||!g(e.pid))return;C=!0;let t=`http://localhost:${e.port}`;import(`./open-browser-CfwaLBtR.mjs`).then(({openBrowser:e})=>e(t)).catch(()=>{})}:void 0,E=null,D=await p({contentDir:b,projectDir:r,contentRoot:n.content.dir,port:n.server.port,host:n.server.host,quiet:!1,debounce:n.persistence.debounceMs,maxDebounce:n.persistence.maxDebounceMs,includePatterns:n.content.include,excludePatterns:n.content.exclude,onAgentWrite:T,localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:!0,idleShutdownMs:o,skipAutoInit:i,autoInitFn:S,ensureProjectGitFn:i?void 0:()=>m(r),spawnUiSiblingFn:async({lockDir:t})=>{if(E=u({uiLock:_(t),isAlive:g}),E.action===`spawn`&&!a)try{d({lockDir:t,cwd:r,spawn:e.spawn}),y.info({reason:E.reason},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else E.action===`skip`&&y.info({port:E.port,pid:E.pid},`UI already running at port ${E.port}`)},idleShutdownHandler:e=>f({readUiLock:()=>_(D.lockDir),isAlive:g,killPid:(e,t)=>{process.kill(e,t)},destroy:e,log:y}),log:y});return E||={action:`skip`,reason:`alive`,pid:0,port:0},{httpServer:D.httpServer,destroy:D.destroy,lockDir:D.lockDir,contentDir:b,port:D.port,ready:D.ready,degraded:D.degraded,uiSpawnDecision:E,didAutoInit:D.didAutoInit,didGitInit:D.didGitInit}}function m(r){return new n(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--no-init`,`Skip auto-scaffolding of ${t}/`).action(async n=>{let{renderBanner:i}=await import(`./banner-sRCRfb7A.mjs`),{dim:a,error:o,info:s,warning:c}=await import(`./colors-BNRrOlZZ.mjs`),l=r(),u=process.cwd();n.port!==void 0&&(l.server.port=Number(n.port)),n.host!==void 0&&(l.server.host=n.host);let d;try{d=await p({config:l,cwd:u,skipAutoInit:n.init===!1})}catch(e){let{ProjectGitInitError:t}=await import(`./src-DRRh4faC.mjs`);e instanceof t&&(console.error(o(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.`)),e.stderr&&console.error(a(e.stderr.trim())),process.exit(1)),console.error(`${o(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let f=!1,m=async e=>{if(!f){f=!0,console.log(a(`\nShutting down (${e})...`));try{await d.destroy()}catch(e){console.error(`${o(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)}};process.once(`SIGINT`,()=>{m(`SIGINT`)}),process.once(`SIGTERM`,()=>{m(`SIGTERM`)});let h=`http://${l.server.host}:${d.port}`,g=l.server.host===`0.0.0.0`||l.server.host===`::`?`http://0.0.0.0:${d.port}`:void 0,_=d.uiSpawnDecision,v=_.action===`skip`?_.port:3e3,y=v>0?`http://${l.server.host}:${v}`:h;console.log(i({name:`open-knowledge`,version:e,localUrl:y,apiUrl:y===h?void 0:h,networkUrl:g})),d.didAutoInit&&(console.log(` ${s(`✓`)} Scaffolded ${t}/ (first run)`),console.log(` ${a("Tip: Run `open-knowledge init` to register MCP tools for Claude Code")}\n`));let b={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};d.ready.then(async()=>{if(d.degraded.length>0){console.log();for(let e of d.degraded){let t=b[e]??`${e} (check server logs for details)`;console.warn(` ${c(`⚠`)} ${c(e)}: ${a(t)}`)}console.log()}if(d.didAutoInit||d.didGitInit)if(d.didGitInit&&console.log(`\n ${s(`✓`)} Initialized git repo at ${u}/.git/ (default branch: main)`),d.didAutoInit)try{let{previewContent:e,formatPreviewBlock:t}=await import(`./preview-CT7B_1hJ.mjs`),n=e({projectDir:u,contentDir:d.contentDir,include:l.content.include,exclude:l.content.exclude});console.log(`\n${t(n,u)}\n`)}catch(e){console.warn(`Content preview unavailable: ${e instanceof Error?e.message:String(e)}`)}else console.log();if(n.open){let{openBrowser:e}=await import(`./open-browser-CfwaLBtR.mjs`);e(y)}}).catch(e=>{console.error(` ${o(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})})}export{m as a,d as i,f as n,l as o,u as r,p as t};
|
|
2
|
+
//# sourceMappingURL=start-Dtc5s628.mjs.map
|
package/package.json
CHANGED
package/dist/init-BEXFKO6K.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,r,t as i}from"./init-d9wf2ATC.mjs";export{i as detectInstalledEditors,n as formatInitResult,r as initCommand,t as parseEditorFlag,e as runInit};
|
package/dist/init-CXKU8pCL.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./init-BwRnDaUa.mjs";export{o as CLAUDE_MD_SECTION,n as OK_MARKER_BEGIN,i as OK_MARKER_END,t as PREVIEW_GUIDANCE,e as ensureOkGitignoredAtRoot,r as initContent,a as upsertRootInstructions};
|
package/dist/loader-Ck0aVV42.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./loader-X2UYTNqe.mjs";export{e as loadConfig};
|
package/dist/paths-BIn1dA04.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./paths-DYcYIqx2.mjs";export{t as resolveContentDir,e as resolveLockDir};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./preview-CG6UE3J0.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,At as t,H as n,Jt as r,Kt as i,Mt as a,Rt as o,Vt as s,Wt as c,Xt as l,Y as u,Yt as d,Zt as f,an as p,en as m,gt as h,ht as ee,in as g,ln as _,mt as v,nn as y,on as b,rn as x,tn as S,vt as te,wt as C,yt as ne}from"./dist-CWsgPYc6.js";var w=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=u(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(ce(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function re(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function ie(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=re(t)+re(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function ae(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:ie(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function oe(e,t){return n=>{for(let t=u(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var se=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function T(e){return e.selection.main.from}function ce(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var E=s.define();function le(e,t,n,r){let{main:a}=e.selection,o=n-a.from,s=r-a.from;return{...e.changeByRange(c=>{if(c!=a&&n!=r&&e.sliceDoc(c.from+o,c.from+s)!=e.sliceDoc(n,r))return{range:c};let l=e.toText(t);return{changes:{from:c.from+o,to:r==a.from?c.to:c.from+s,insert:l},range:i.cursor(c.from+o+l.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var D=new WeakMap;function ue(e){if(!Array.isArray(e))return e;let t=D.get(e);return t||D.set(e,t=ae(e)),t}var O=m.define(),k=m.define(),de=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=g(e,t),r=p(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(g(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=g(e,0),i=p(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=g(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=p(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,m=-1,h=-1,ee=/[a-z]/.test(e),v=!0;for(let r=0,c=Math.min(e.length,200),y=0;r<c&&u<s;){let c=g(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(m=r),h=r+1,f++):f=0));let b,x=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(b=_(c))==b.toLowerCase()?b==b.toUpperCase()?0:2:1;(!r||x==1&&ee||y==0&&x!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(v=!1)),y=x,r+=p(c)}return u==s&&a[0]==0&&v?this.result(-100+(d?-200:0),a,e):f==s&&m==0?this.ret(-200-e.length+(h==e.length?0:-100),[0,h]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[m,h]):u==s?this.result(-100+(d?-200:0)+-700+(v?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?p(g(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},fe=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},A=r.define({combine(e){return b(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:pe,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>j(e(n),t(n)),optionClass:(e,t)=>n=>j(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function j(e,t){return e?t?e+` `+t:e:t}function pe(e,t,n,r,i,a){let o=e.textDirection==ee.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var M=m.define();function me(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function N(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var he=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(A);this.optionContent=me(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=N(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:M.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(A).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:k.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=N(r.length,i,e.state.facet(A).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=N(t.options.length,t.selected,this.view.state.facet(A).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o=typeof i==`string`?document.createTextNode(i):i(r);if(!o)return;`then`in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>a(this.view.state,e,`completion info`)):(this.addInfoPane(o,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&_e(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(A).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function ge(e,t){return n=>new he(n,e,t)}function _e(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function P(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function ve(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(A);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new se(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new fe(n):new de(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new se(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):P(e.completion)>P(c)&&(s[s.length-1]=e),c=e.completion}return s}var ye=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,F(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=ve(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(A).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,F(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:De,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},be=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(we,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(A),i=(r.override||n.languageDataAt(`autocomplete`,T(n)).map(ue)).map(e=>(this.active.find(t=>t.source==e)||new I(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(R));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!xe(i,this.active)||o?a=ye.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new I(e.source,0):e));for(let e of t.effects)e.is(M)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Se:Ce}};function xe(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var Se={"aria-autocomplete":`list`},Ce={};function F(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var we=[];function Te(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(E);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var I=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=Te(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(O))i=new e(i.source,1,n.value);else if(n.is(k))i=new e(i.source,0);else if(n.is(R))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(T(e.state))}},L=class e extends I{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=T(t.state);if(o>a||!r||n&2&&(T(t.startState)==this.from||o<this.limit))return new I(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return Ee(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new w(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??T(t.state)):new I(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new I(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function Ee(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):ce(e,!0).test(i)}var R=m.define({map(e,t){return e.map(e=>e.map(t))}}),z=S.define({create(){return be.start()},update(e,t){return e.update(t)},provide:e=>[o.from(e,e=>e.tooltip),h.contentAttributes.from(e,e=>e.attrs)]});function B(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(z).active.find(e=>e.source==t.source);return r instanceof L?(typeof n==`string`?e.dispatch({...le(e.state,n,r.from,r.to),annotations:E.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var De=ge(z,B);function V(e,t=`option`){return n=>{let r=n.state.field(z,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(A).interactionDelay)return!1;let i=1,a;t==`page`&&(a=C(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:M.of(s)}),!0}}var Oe=e=>{let t=e.state.field(z,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(A).interactionDelay?!1:B(e,t.open.options[t.open.selected])},H=e=>e.state.field(z,!1)?(e.dispatch({effects:O.of(!0)}),!0):!1,ke=e=>{let t=e.state.field(z,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:k.of(null)}),!0)},Ae=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},je=50,Me=1e3,Ne=te.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(z).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(z),n=e.state.facet(A);if(!e.selectionSet&&!e.docChanged&&e.startState.field(z)==t)return;let r=e.transactions.some(e=>{let t=Te(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>je&&Date.now()-n.time>Me){for(let e of n.context.abortListeners)try{e()}catch(e){a(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(O)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(z);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(A).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new w(t,T(t),e.explicit,this.view),r=new Ae(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:k.of(null)}),a(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(A).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(A),n=this.view.state.field(z);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=T(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new L(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new I(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:R.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(z,!1);if(t&&t.tooltip&&this.view.state.facet(A).closeOnBlur){let n=t.open&&C(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:k.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:O.of(!1)}),20),this.composing=0}}}),Pe=typeof navigator==`object`&&/Win/.test(navigator.platform),Fe=l.highest(h.domEventHandlers({keydown(e,t){let n=t.state.field(z,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(Pe&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&B(t,r),!1}})),U=h.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),Ie=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},Le=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,d.TrackDel),r=t.mapPos(this.to,1,d.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},Re=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],i=[t],a=e.doc.lineAt(t),o=/^\s*/.exec(a.text)[0];for(let a of this.lines){if(r.length){let r=o,s=/^\t*/.exec(a)[0].length;for(let t=0;t<s;t++)r+=e.facet(n);i.push(t+r.length-s),a=r+a.slice(s)}r.push(a),t+=a.length+1}return{text:r,ranges:this.fieldPositions.map(e=>new Le(e.field,i[e.line]+e.from,i[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new Ie(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},ze=v.widget({widget:new class extends ne{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),Be=v.mark({class:`cm-snippetField`}),W=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=v.set(e.map(e=>(e.from==e.to?ze:Be).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},G=m.define({map(e,t){return e&&e.map(t)}}),Ve=m.define(),K=S.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(G))return n.value;if(n.is(Ve)&&e)return new W(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>h.decorations.from(e,e=>e?e.deco:v.none)});function q(e,t){return i.create(e.filter(e=>e.field==t).map(e=>i.range(e.from,e.to)))}function He(e){let t=Re.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:s}=e.state.selection,c={changes:{from:r,to:i==s.from?s.to:i,insert:y.of(a)},scrollIntoView:!0,annotations:n?[E.of(n),x.userEvent.of(`input.complete`)]:void 0};if(o.length&&(c.selection=q(o,0)),o.some(e=>e.field>0)){let t=new W(o,0),n=c.effects=[G.of(t)];e.state.field(K,!1)===void 0&&n.push(m.appendConfig.of([K,Ge,qe,U]))}e.dispatch(e.state.update(c))}}function J(e){return({state:t,dispatch:n})=>{let r=t.field(K,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:q(r.ranges,i),effects:G.of(a?null:new W(r.ranges,i)),scrollIntoView:!0})),!0}}var Ue=[{key:`Tab`,run:J(1),shift:J(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(K,!1)?(t(e.update({effects:G.of(null)})),!0):!1}],We=r.define({combine(e){return e.length?e[0]:Ue}}),Ge=l.highest(t.compute([We],e=>e.facet(We)));function Ke(e,t){return{...t,apply:He(e)}}var qe=h.domEventHandlers({mousedown(e,t){let n=t.state.field(K,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:q(n.ranges,i.field),effects:G.of(n.ranges.some(e=>e.field>i.field)?new W(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Y={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},X=m.define({map(e,t){return t.mapPos(e,-1,d.TrackAfter)??void 0}}),Z=new class extends e{};Z.startSide=1,Z.endSide=-1;var Je=S.define({create(){return f.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(X)&&(e=e.update({add:[Z.range(n.value,n.value+1)]}));return e}});function Ye(){return[et,Je]}var Xe=`()[]{}<>«»»«[]{}`;function Ze(e){for(let t=0;t<16;t+=2)if(Xe.charCodeAt(t)==e)return Xe.charAt(t+1);return _(e<128?e:e+1)}function Qe(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||Y}var $e=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),et=h.inputHandler.of((e,t,n,r)=>{if(($e?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&p(g(r,0))==1||t!=i.from||n!=i.to)return!1;let a=nt(e.state,r);return a?(e.dispatch(a),!0):!1}),tt=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Qe(e,e.selection.main.head).brackets||Y.brackets,r=null,a=e.changeByRange(t=>{if(t.empty){let r=rt(e.doc,t.head);for(let a of n)if(a==r&&$(e.doc,t.head)==Ze(g(a,0)))return{changes:{from:t.head-a.length,to:t.head+a.length},range:i.cursor(t.head-a.length)}}return{range:r=t}});return r||t(e.update(a,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function nt(e,t){let n=Qe(e,e.selection.main.head),r=n.brackets||Y.brackets;for(let i of r){let a=Ze(g(i,0));if(t==i)return a==i?ot(e,i,r.indexOf(i+i+i)>-1,n):it(e,i,a,n.before||Y.before);if(t==a&&Q(e,e.selection.main.from))return at(e,i,a)}return null}function Q(e,t){let n=!1;return e.field(Je).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function $(e,t){let n=e.sliceString(t,t+2);return n.slice(0,p(g(n,0)))}function rt(e,t){let n=e.sliceString(t-2,t);return p(g(n,0))==n.length?n:n.slice(1)}function it(e,t,n,r){let a=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:X.of(o.to+t.length),range:i.range(o.anchor+t.length,o.head+t.length)};let s=$(e.doc,o.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:o.head},effects:X.of(o.head+t.length),range:i.cursor(o.head+t.length)}:{range:a=o}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function at(e,t,n){let r=null,a=e.changeByRange(t=>t.empty&&$(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:i.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function ot(e,t,n,r){let a=r.stringPrefixes||Y.stringPrefixes,o=null,s=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:X.of(r.to+t.length),range:i.range(r.anchor+t.length,r.head+t.length)};let s=r.head,l=$(e.doc,s),u;if(l==t){if(st(e,s))return{changes:{insert:t+t,from:s},effects:X.of(s+t.length),range:i.cursor(s+t.length)};if(Q(e,s)){let r=n&&e.sliceDoc(s,s+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:s,to:s+r.length,insert:r},range:i.cursor(s+r.length)}}}else if(n&&e.sliceDoc(s-2*t.length,s)==t+t&&(u=lt(e,s-2*t.length,a))>-1&&st(e,u))return{changes:{insert:t+t+t+t,from:s},effects:X.of(s+t.length),range:i.cursor(s+t.length)};else if(e.charCategorizer(s)(l)!=c.Word&<(e,s,a)>-1&&!ct(e,s,t,a))return{changes:{insert:t+t,from:s},effects:X.of(s+t.length),range:i.cursor(s+t.length)};return{range:o=r}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:`input.type`})}function st(e,t){let n=u(e).resolveInner(t+1);return n.parent&&n.from==t}function ct(e,t,n,r){let i=u(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function lt(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=c.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=c.Word)return n}return-1}function ut(e={}){return[Fe,z,A.of(e),Ne,ft,U]}var dt=[{key:`Ctrl-Space`,run:H},{mac:"Alt-`",run:H},{mac:`Alt-i`,run:H},{key:`Escape`,run:ke},{key:`ArrowDown`,run:V(!0)},{key:`ArrowUp`,run:V(!1)},{key:`PageDown`,run:V(!0,`page`)},{key:`PageUp`,run:V(!1,`page`)},{key:`Enter`,run:Oe}],ft=l.highest(t.computeN([A],e=>e.facet(A).defaultKeymap?[dt]:[]));export{ae as a,Ke as c,tt as i,ut as n,dt as o,Ye as r,oe as s,w as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as e,L as t,O as n,g as r,i,it as a,rt as o,s}from"./dist-CWsgPYc6.js";import{r as c}from"./dist-saWP7AQm.js";var l=o({String:a.string,Number:a.number,"True False":a.bool,PropertyName:a.propertyName,Null:a.null,", :":a.separator,"[ ]":a.squareBracket,"{ }":a.brace}),u=c.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[l],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),d=i.define({name:`json`,parser:u.configure({props:[t.add({Object:r({except:/^\s*\}/}),Array:r({except:/^\s*\]/})}),n.add({"Object Array":e})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function f(){return new s(d)}export{f as json};
|