@hardikg/mdview 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +8 -10
- package/bin/mdview.mjs +123 -44
- package/dist/client/assets/{arc-DjKPIdc5.js → arc-ycQp8V_W.js} +1 -1
- package/dist/client/assets/{architectureDiagram-3BPJPVTR-_OLcSJC-.js → architectureDiagram-3BPJPVTR-CGT8FovT.js} +1 -1
- package/dist/client/assets/{blockDiagram-GPEHLZMM-BxHKbhSj.js → blockDiagram-GPEHLZMM-N8A4M5KF.js} +1 -1
- package/dist/client/assets/{c4Diagram-AAUBKEIU-DiBLe7ZZ.js → c4Diagram-AAUBKEIU-GOIrZjrm.js} +1 -1
- package/dist/client/assets/channel-DsJAWOzB.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-4B03UoyK.js → chunk-2J33WTMH-DMiX8NYo.js} +1 -1
- package/dist/client/assets/{chunk-4BX2VUAB-Dw7jUHGw.js → chunk-4BX2VUAB-BXnUK3rw.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-AZdo8c-x.js → chunk-55IACEB6-BkF4Ba-V.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-g0GurlcS.js → chunk-727SXJPM-DKPIb06m.js} +1 -1
- package/dist/client/assets/{chunk-AQP2D5EJ-eqTzq7th.js → chunk-AQP2D5EJ-BFOc87IV.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-D4omRKrC.js → chunk-FMBD7UC4-IM3YKAF3.js} +1 -1
- package/dist/client/assets/{chunk-ND2GUHAM-mVdFtWqM.js → chunk-ND2GUHAM-UF3KQYdE.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-CyPMaN41.js → chunk-QZHKN3VN-OHnkQvdC.js} +1 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-BD7T43t0.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BD7T43t0.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-BjlwoH6Y.js → cose-bilkent-S5V4N54A-D0XjEe4_.js} +1 -1
- package/dist/client/assets/{dagre-BM42HDAG-DBF5W9Tk.js → dagre-BM42HDAG-1wR5aSmA.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-D9gwS4tw.js → diagram-2AECGRRQ-B8L1OTOq.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-DTpIgGjI.js → diagram-5GNKFQAL-BPGoGDNx.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-ByLH9Z83.js → diagram-KO2AKTUF-Zu0g_DOV.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-Dkd4KfnW.js → diagram-LMA3HP47-bPbOm4sL.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-C-mJW1Tv.js → diagram-OG6HWLK6-DWW4aJ4C.js} +1 -1
- package/dist/client/assets/{erDiagram-TEJ5UH35-DmyZPB5P.js → erDiagram-TEJ5UH35-CUsMs05D.js} +1 -1
- package/dist/client/assets/{flowDiagram-I6XJVG4X-D6RrsDb6.js → flowDiagram-I6XJVG4X-DZCURXAw.js} +1 -1
- package/dist/client/assets/{ganttDiagram-6RSMTGT7-CP_O3OdU.js → ganttDiagram-6RSMTGT7-CzMfUd_H.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-DZgdWY-6.js → gitGraphDiagram-PVQCEYII-Du_KX2ik.js} +1 -1
- package/dist/client/assets/index-BCdIdRge.js +2 -0
- package/dist/client/assets/{infoDiagram-5YYISTIA-BAp5orio.js → infoDiagram-5YYISTIA-D81JEsUe.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-DgqFJxLz.js → ishikawaDiagram-YF4QCWOH-DwkHFgb8.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-BFlCgna7.js → journeyDiagram-JHISSGLW-nEajRNFZ.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-Ck0sh2an.js → kanban-definition-UN3LZRKU-Dvn5P58B.js} +1 -1
- package/dist/client/assets/{linear-CfOau-eX.js → linear-BYNRmGYt.js} +1 -1
- package/dist/client/assets/{mermaid.core-BUwfPdjt.js → mermaid.core-BJg17JjK.js} +4 -4
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-tpaiyCEI.js → mindmap-definition-RKZ34NQL-WIFgsLLz.js} +1 -1
- package/dist/client/assets/{pieDiagram-4H26LBE5-DaNIMGBH.js → pieDiagram-4H26LBE5-DMgTQVGJ.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-BUZRyB7p.js → quadrantDiagram-W4KKPZXB-B0Gh1bMy.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-D70DEVyJ.js → requirementDiagram-4Y6WPE33-DcIINxfV.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-DckSl4S7.js → sankeyDiagram-5OEKKPKP-CDnHepHs.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-If3g75AG.js → sequenceDiagram-3UESZ5HK-D7MMEHjm.js} +1 -1
- package/dist/client/assets/{stateDiagram-AJRCARHV-C-83rolJ.js → stateDiagram-AJRCARHV-Dvdvjjk8.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-I2g3TqMC.js +1 -0
- package/dist/client/assets/{timeline-definition-PNZ67QCA-DIFKx0ow.js → timeline-definition-PNZ67QCA-DYWt9asA.js} +1 -1
- package/dist/client/assets/{vennDiagram-CIIHVFJN-BGLU5r80.js → vennDiagram-CIIHVFJN-Bt0VUni_.js} +1 -1
- package/dist/client/assets/{wardley-L42UT6IY-qocA9kr0.js → wardley-L42UT6IY-DVy2v9KS.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-CWhmOVum.js → wardleyDiagram-YWT4CUSO-Ch7IIKOr.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6-D2Sc4Taz.js → xychartDiagram-2RQKCTM6-Byds5kce.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/channel-oDRyuYVi.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-Dn5QR1VE.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-Dn5QR1VE.js +0 -1
- package/dist/client/assets/index-DFYTyxkU.js +0 -2
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-BeI0-mGo.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var qe,D,Fn,On,q,en,Rn,Bn,ot,xe,ue,Kn,Ft,ht,pt,Ae={},$e=[],jr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,je=Array.isArray;function B(e,t){for(var n in t)e[n]=t[n];return e}function Ot(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Jr(e,t,n){var r,o,s,l={};for(s in t)s=="key"?r=t[s]:s=="ref"?o=t[s]:l[s]=t[s];if(arguments.length>2&&(l.children=arguments.length>3?qe.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)l[s]===void 0&&(l[s]=e.defaultProps[s]);return we(e,l,r,o,null)}function we(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Fn,__i:-1,__u:0};return o==null&&D.vnode!=null&&D.vnode(s),s}function ee(e){return e.children}function me(e,t){this.props=e,this.context=t}function ie(e,t){if(t==null)return e.__?ie(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?ie(e):null}function Gr(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],s=B({},t);s.__v=t.__v+1,D.vnode&&D.vnode(s),Rt(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??ie(t),!!(32&t.__u),o),s.__v=t.__v,s.__.__k[s.__i]=s,qn(r,s,o),t.__e=t.__=null,s.__e!=n&&Vn(s)}}function Vn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Vn(e)}function tn(e){(!e.__d&&(e.__d=!0)&&q.push(e)&&!Me.__r++||en!=D.debounceRendering)&&((en=D.debounceRendering)||Rn)(Me)}function Me(){try{for(var e,t=1;q.length;)q.length>t&&q.sort(Bn),e=q.shift(),t=q.length,Gr(e)}finally{q.length=Me.__r=0}}function Wn(e,t,n,r,o,s,l,a,m,c,d){var u,h,f,p,v,_,k,b=r&&r.__k||$e,T=t.length;for(m=Xr(n,t,b,m,T),u=0;u<T;u++)(f=n.__k[u])!=null&&(h=f.__i!=-1&&b[f.__i]||Ae,f.__i=u,_=Rt(e,f,h,o,s,l,a,m,c,d),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Bt(h.ref,null,f),d.push(f.ref,f.__c||p,f)),v==null&&p!=null&&(v=p),(k=!!(4&f.__u))||h.__k===f.__k?(m=zn(f,m,e,k),k&&h.__e&&(h.__e=null)):typeof f.type=="function"&&_!==void 0?m=_:p&&(m=p.nextSibling),f.__u&=-7);return n.__e=v,m}function Xr(e,t,n,r,o){var s,l,a,m,c,d=n.length,u=d,h=0;for(e.__k=new Array(o),s=0;s<o;s++)(l=t[s])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[s]=we(null,l,null,null,null):je(l)?l=e.__k[s]=we(ee,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[s]=we(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[s]=l,m=s+h,l.__=e,l.__b=e.__b+1,a=null,(c=l.__i=Yr(l,n,m,u))!=-1&&(u--,(a=n[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(o>d?h--:o<d&&h++),typeof l.type!="function"&&(l.__u|=4)):c!=m&&(c==m-1?h--:c==m+1?h++:(c>m?h--:h++,l.__u|=4))):e.__k[s]=null;if(u)for(s=0;s<d;s++)(a=n[s])!=null&&(2&a.__u)==0&&(a.__e==r&&(r=ie(a)),Jn(a,a));return r}function zn(e,t,n,r){var o,s;if(typeof e.type=="function"){for(o=e.__k,s=0;o&&s<o.length;s++)o[s]&&(o[s].__=e,t=zn(o[s],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=ie(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Yr(e,t,n,r){var o,s,l,a=e.key,m=e.type,c=t[n],d=c!=null&&(2&c.__u)==0;if(c===null&&a==null||d&&a==c.key&&m==c.type)return n;if(r>(d?1:0)){for(o=n-1,s=n+1;o>=0||s<t.length;)if((c=t[l=o>=0?o--:s++])!=null&&(2&c.__u)==0&&a==c.key&&m==c.type)return l}return-1}function nn(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||jr.test(t)?n:n+"px"}function ye(e,t,n,r,o){var s,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||nn(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||nn(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(Kn,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n[ue]=r[ue]:(n[ue]=Ft,e.addEventListener(t,s?pt:ht,s)):e.removeEventListener(t,s?pt:ht,s);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function rn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[xe]==null)t[xe]=Ft++;else if(t[xe]<n[ue])return;return n(D.event?D.event(t):t)}}}function Rt(e,t,n,r,o,s,l,a,m,c){var d,u,h,f,p,v,_,k,b,T,A,H,V,N,x,g=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(m=!!(32&n.__u),s=[a=t.__e=n.__e]),(d=D.__b)&&d(t);e:if(typeof g=="function")try{if(k=t.props,b=g.prototype&&g.prototype.render,T=(d=g.contextType)&&r[d.__c],A=d?T?T.props.value:d.__:r,n.__c?_=(u=t.__c=n.__c).__=u.__E:(b?t.__c=u=new g(k,A):(t.__c=u=new me(k,A),u.constructor=g,u.render=Zr),T&&T.sub(u),u.state||(u.state={}),u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),b&&u.__s==null&&(u.__s=u.state),b&&g.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=B({},u.__s)),B(u.__s,g.getDerivedStateFromProps(k,u.__s))),f=u.props,p=u.state,u.__v=t,h)b&&g.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),b&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(b&&g.getDerivedStateFromProps==null&&k!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(k,A),t.__v==n.__v||!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(k,u.__s,A)===!1){t.__v!=n.__v&&(u.props=k,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t)}),$e.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&l.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(k,u.__s,A),b&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,v)})}if(u.context=A,u.props=k,u.__P=e,u.__e=!1,H=D.__r,V=0,b)u.state=u.__s,u.__d=!1,H&&H(t),d=u.render(u.props,u.state,u.context),$e.push.apply(u.__h,u._sb),u._sb=[];else do u.__d=!1,H&&H(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++V<25);u.state=u.__s,u.getChildContext!=null&&(r=B(B({},r),u.getChildContext())),b&&!h&&u.getSnapshotBeforeUpdate!=null&&(v=u.getSnapshotBeforeUpdate(f,p)),N=d!=null&&d.type===ee&&d.key==null?jn(d.props.children):d,a=Wn(e,je(N)?N:[N],t,n,r,o,s,l,a,m,c),u.base=t.__e,t.__u&=-161,u.__h.length&&l.push(u),_&&(u.__E=u.__=null)}catch(U){if(t.__v=null,m||s!=null)if(U.then){for(t.__u|=m?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(x=s.length;x--;)Ot(s[x]);ft(t)}else t.__e=n.__e,t.__k=n.__k,U.then||ft(t);D.__e(U,t,n)}else s==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=Qr(n.__e,t,n,r,o,s,l,m,c);return(d=D.diffed)&&d(t),128&t.__u?void 0:a}function ft(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ft))}function qn(e,t,n){for(var r=0;r<n.length;r++)Bt(n[r],n[++r],n[++r]);D.__c&&D.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){D.__e(s,o.__v)}})}function jn(e){return typeof e!="object"||e==null||e.__b>0?e:je(e)?e.map(jn):B({},e)}function Qr(e,t,n,r,o,s,l,a,m){var c,d,u,h,f,p,v,_=n.props||Ae,k=t.props,b=t.type;if(b=="svg"?o="http://www.w3.org/2000/svg":b=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),s!=null){for(c=0;c<s.length;c++)if((f=s[c])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){e=f,s[c]=null;break}}if(e==null){if(b==null)return document.createTextNode(k);e=document.createElementNS(o,b,k.is&&k),a&&(D.__m&&D.__m(t,s),a=!1),s=null}if(b==null)_===k||a&&e.data==k||(e.data=k);else{if(s=s&&qe.call(e.childNodes),!a&&s!=null)for(_={},c=0;c<e.attributes.length;c++)_[(f=e.attributes[c]).name]=f.value;for(c in _)f=_[c],c=="dangerouslySetInnerHTML"?u=f:c=="children"||c in k||c=="value"&&"defaultValue"in k||c=="checked"&&"defaultChecked"in k||ye(e,c,null,f,o);for(c in k)f=k[c],c=="children"?h=f:c=="dangerouslySetInnerHTML"?d=f:c=="value"?p=f:c=="checked"?v=f:a&&typeof f!="function"||_[c]===f||ye(e,c,f,_[c],o);if(d)a||u&&(d.__html==u.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),Wn(t.type=="template"?e.content:e,je(h)?h:[h],t,n,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":o,s,l,s?s[0]:n.__k&&ie(n,0),a,m),s!=null)for(c=s.length;c--;)Ot(s[c]);a||(c="value",b=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[c]||b=="progress"&&!p||b=="option"&&p!=_[c])&&ye(e,c,p,_[c],o),c="checked",v!=null&&v!=e[c]&&ye(e,c,v,_[c],o))}return e}function Bt(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){D.__e(o,n)}}function Jn(e,t,n){var r,o;if(D.unmount&&D.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Bt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){D.__e(s,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Jn(r[o],t,n||typeof e.type!="function");n||Ot(e.__e),e.__c=e.__=e.__e=void 0}function Zr(e,t,n){return this.constructor(e,n)}function eo(e,t,n){var r,o,s,l;t==document&&(t=document.documentElement),D.__&&D.__(e,t),o=(r=!1)?null:t.__k,s=[],l=[],Rt(t,e=t.__k=Jr(ee,null,[e]),o||Ae,Ae,t.namespaceURI,o?null:t.firstChild?qe.call(t.childNodes):null,s,o?o.__e:t.firstChild,r,l),qn(s,e,l)}qe=$e.slice,D={__e:function(e,t,n,r){for(var o,s,l;t=t.__;)if((o=t.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(e)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),l=o.__d),l)return o.__E=o}catch(a){e=a}throw e}},Fn=0,On=function(e){return e!=null&&e.constructor===void 0},me.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=B({},this.state),typeof e=="function"&&(e=e(B({},n),this.props)),e&&B(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),tn(this))},me.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tn(this))},me.prototype.render=ee,q=[],Rn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Bn=function(e,t){return e.__v.__b-t.__v.__b},Me.__r=0,ot=Math.random().toString(8),xe="__d"+ot,ue="__a"+ot,Kn=/(PointerCapture)$|Capture$/i,Ft=0,ht=rn(!1),pt=rn(!0);var to=0;function i(e,t,n,r,o,s){t||(t={});var l,a,m=t;if("ref"in m)for(a in m={},t)a=="ref"?l=t[a]:m[a]=t[a];var c={type:e,props:m,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--to,__i:-1,__u:0,__source:o,__self:s};if(typeof e=="function"&&(l=e.defaultProps))for(a in l)m[a]===void 0&&(m[a]=l[a]);return D.vnode&&D.vnode(c),c}const Je=["classic","paper","nord","solarized","high-contrast"];var fe,C,st,on,ge=0,Gn=[],E=D,sn=E.__b,ln=E.__r,an=E.diffed,cn=E.__c,un=E.unmount,mn=E.__;function Kt(e,t){E.__h&&E.__h(C,e,ge||t),ge=0;var n=C.__H||(C.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function K(e){return ge=1,no(Qn,e)}function no(e,t,n){var r=Kt(fe++,2);if(r.t=e,!r.__c&&(r.__=[Qn(void 0,t),function(a){var m=r.__N?r.__N[0]:r.__[0],c=r.t(m,a);m!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=C,!C.__f)){var o=function(a,m,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(h){return h.__c});if(d.every(function(h){return!h.__N}))return!s||s.call(this,a,m,c);var u=r.__c.props!==a;return d.some(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(u=!0)}}),s&&s.call(this,a,m,c)||u};C.__f=!0;var s=C.shouldComponentUpdate,l=C.componentWillUpdate;C.componentWillUpdate=function(a,m,c){if(this.__e){var d=s;s=void 0,o(a,m,c),s=d}l&&l.call(this,a,m,c)},C.shouldComponentUpdate=o}return r.__N||r.__}function y(e,t){var n=Kt(fe++,3);!E.__s&&Yn(n.__H,t)&&(n.__=e,n.u=t,C.__H.__h.push(n))}function O(e){return ge=5,F(function(){return{current:e}},[])}function F(e,t){var n=Kt(fe++,7);return Yn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Xn(e,t){return ge=8,F(function(){return e},t)}function ro(){for(var e;e=Gn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(De),t.__h.some(gt),t.__h=[]}catch(n){t.__h=[],E.__e(n,e.__v)}}}E.__b=function(e){C=null,sn&&sn(e)},E.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),mn&&mn(e,t)},E.__r=function(e){ln&&ln(e),fe=0;var t=(C=e.__c).__H;t&&(st===C?(t.__h=[],C.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(De),t.__h.some(gt),t.__h=[],fe=0)),st=C},E.diffed=function(e){an&&an(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Gn.push(t)!==1&&on===E.requestAnimationFrame||((on=E.requestAnimationFrame)||oo)(ro)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),st=C=null},E.__c=function(e,t){t.some(function(n){try{n.__h.some(De),n.__h=n.__h.filter(function(r){return!r.__||gt(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],E.__e(r,n.__v)}}),cn&&cn(e,t)},E.unmount=function(e){un&&un(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{De(r)}catch(o){t=o}}),n.__H=void 0,t&&E.__e(t,n.__v))};var dn=typeof requestAnimationFrame=="function";function oo(e){var t,n=function(){clearTimeout(r),dn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);dn&&(t=requestAnimationFrame(n))}function De(e){var t=C,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),C=t}function gt(e){var t=C;e.__c=e.__(),C=t}function Yn(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Qn(e,t){return typeof t=="function"?t(e):t}var so=Symbol.for("preact-signals");function Vt(){if(Q>1)Q--;else{var e,t=!1;for((function(){var o=Fe;for(Fe=void 0;o!==void 0;)o.S.v===o.v&&(o.S.i=o.i),o=o.o})();de!==void 0;){var n=de;for(de=void 0,He++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&tr(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(He=0,Q--,t)throw e}}var w=void 0;function Zn(e){var t=w;w=void 0;try{return e()}finally{w=t}}var de=void 0,Q=0,He=0,hn=0,Fe=void 0,Oe=0;function er(e){if(w!==void 0){var t=e.n;if(t===void 0||t.t!==w)return t={i:0,S:e,p:w.s,n:void 0,t:w,e:void 0,x:void 0,r:t},w.s!==void 0&&(w.s.n=t),w.s=t,e.n=t,32&w.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=w.s,t.n=void 0,w.s.n=t,w.s=t),t}}function L(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}L.prototype.brand=so;L.prototype.h=function(){return!0};L.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Zn(function(){var r;(r=t.W)==null||r.call(t)}))};L.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Zn(function(){var o;(o=t.Z)==null||o.call(t)}))}};L.prototype.subscribe=function(e){var t=this;return Ge(function(){var n=t.value,r=w;w=void 0;try{e(n)}finally{w=r}},{name:"sub"})};L.prototype.valueOf=function(){return this.value};L.prototype.toString=function(){return this.value+""};L.prototype.toJSON=function(){return this.value};L.prototype.peek=function(){var e=w;w=void 0;try{return this.value}finally{w=e}};Object.defineProperty(L.prototype,"value",{get:function(){var e=er(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(He>100)throw new Error("Cycle detected");(function(n){Q!==0&&He===0&&n.l!==hn&&(n.l=hn,Fe={S:n,v:n.v,i:n.i,o:Fe})})(this),this.v=e,this.i++,Oe++,Q++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Vt()}}}});function I(e,t){return new L(e,t)}function tr(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function nr(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function rr(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function te(e,t){L.call(this,void 0),this.x=e,this.s=void 0,this.g=Oe-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}te.prototype=new L;te.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Oe))return!0;if(this.g=Oe,this.f|=1,this.i>0&&!tr(this))return this.f&=-2,!0;var e=w;try{nr(this),w=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return w=e,rr(this),this.f&=-2,!0};te.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}L.prototype.S.call(this,e)};te.prototype.U=function(e){if(this.t!==void 0&&(L.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};te.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(te.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=er(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function or(e,t){return new te(e,t)}function sr(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Q++;var n=w;w=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Wt(e),r}finally{w=n,Vt()}}}function Wt(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,sr(e)}function io(e){if(w!==this)throw new Error("Out-of-order effect");rr(this),w=e,this.f&=-2,8&this.f&&Wt(this),Vt()}function ae(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t==null?void 0:t.name}ae.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};ae.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,sr(this),nr(this),Q++;var e=w;return w=this,io.bind(this,e)};ae.prototype.N=function(){2&this.f||(this.f|=2,this.u=de,de=this)};ae.prototype.d=function(){this.f|=8,1&this.f||Wt(this)};ae.prototype.dispose=function(){this.d()};function Ge(e,t){var n=new ae(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var ke;function ce(e,t){D[e]=t.bind(null,D[e]||function(){})}function Re(e){if(ke){var t=ke;ke=void 0,t()}ke=e&&e.S()}function ir(e){var t=this,n=e.data,r=z(n);r.value=n;var o=F(function(){for(var s=t.__v;s=s.__;)if(s.__c){s.__c.__$f|=4;break}return t.__$u.c=function(){var l,a=t.__$u.S(),m=o.value;a(),On(m)||((l=t.base)==null?void 0:l.nodeType)!==3?(t.__$f|=1,t.setState({})):t.base.data=m},or(function(){var l=r.value.value;return l===0?0:l===!0?"":l||""})},[]);return o.value}ir.displayName="_st";Object.defineProperties(L.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ir},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});ce("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var s=r[o];s instanceof L&&(n||(t.__np=n={}),n[o]=s,r[o]=s.peek())}}e(t)});ce("__r",function(e,t){e(t),Re();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(o){var s;return Ge(function(){s=this}),s.c=function(){r.__$f|=1,r.setState({})},s})())),Re(n)});ce("__e",function(e,t,n,r){Re(),e(t,n,r)});ce("diffed",function(e,t){Re();var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var s=n.U;if(s)for(var l in s){var a=s[l];a!==void 0&&!(l in r)&&(a.d(),s[l]=void 0)}else n.U=s={};for(var m in r){var c=s[m],d=r[m];c===void 0?(c=lo(n,m,d,o),s[m]=c):c.o(d,o)}}}e(t)});function lo(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,s=I(n);return{o:function(l,a){s.value=l,r=a},d:Ge(function(){var l=s.value.value;r[t]!==l&&(r[t]=l,o?e[t]=l:l?e.setAttribute(t,l):e.removeAttribute(t))})}}ce("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var s=r[o];s&&s.d()}}}}else{var l=t.__c;if(l){var a=l.__$u;a&&(l.__$u=void 0,a.d())}}e(t)});ce("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)});me.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(r||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function z(e){return F(function(){return I(e)},[])}const Xe=I(!1);function ao(){Xe.value=!0}function Ue(){Xe.value=!1}const le=I(null),vt=I(null);async function lr(){const e=await fetch("/api/tree");if(!e.ok)return;const t=await e.json();le.value=t,vt.value=t.config??null}function co(){return y(()=>{lr()},[]),le.value}function ar(e){const t=[];function n(r){for(const o of r)o.type==="file"&&o.isMarkdown?t.push({relPath:o.relPath,name:o.name}):o.type==="dir"&&o.children&&n(o.children)}return n(e),t}function uo(e,t){if(!t)return{...e,score:0,matchRanges:[]};const n=t.toLowerCase(),r=e.relPath.toLowerCase(),s=e.name.toLowerCase().indexOf(n);if(s!==-1){const d=e.relPath.length-e.name.length+s;return{...e,score:1e3-d-e.relPath.length,matchRanges:[[d,d+n.length]]}}const l=r.indexOf(n);if(l!==-1)return{...e,score:500-l-e.relPath.length,matchRanges:[[l,l+n.length]]};const a=[];let m=0,c=-1;for(let d=0;d<r.length&&m<n.length;d++)r[d]===n[m]?(c===-1&&(c=d),m++):c!==-1&&(a.push([c,c+1]),c=-1);return c!==-1&&a.push([c,m-(n.length-1)+c]),m===n.length?{...e,score:100-e.relPath.length,matchRanges:a}:null}function mo(e,t,n=50){const r=[];for(const o of e){const s=uo(o,t);s&&r.push(s)}return r.sort((o,s)=>s.score-o.score),r.slice(0,n)}function ho(e,t){if(t.length===0)return e;const n=[];let r=0;for(const[o,s]of t)o>r&&n.push(e.slice(r,o)),n.push({mark:e.slice(o,s)}),r=s;return r<e.length&&n.push(e.slice(r)),n.map((o,s)=>typeof o=="string"?i("span",{children:o},s,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:23,columnNumber:9},this):i("mark",{class:"palette-match",children:o.mark},s,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:24,columnNumber:9},this))}function po({currentPath:e,onSelect:t}){const n=Xe.value,r=le.value,[o,s]=K(""),[l,a]=K(0),m=O(null),c=O(null),d=F(()=>r?ar(r.tree):[],[r]),u=F(()=>n?o.trim()?mo(d,o.trim()):d.slice(0,50).map(p=>({...p,score:0,matchRanges:[]})):[],[d,o,n]);if(y(()=>{n&&(s(""),a(0),requestAnimationFrame(()=>{var p,v;(p=m.current)==null||p.focus(),(v=m.current)==null||v.select()}))},[n]),y(()=>{l>=u.length&&a(Math.max(0,u.length-1))},[u.length,l]),y(()=>{if(!n||!c.current)return;const p=c.current.children[l];p==null||p.scrollIntoView({block:"nearest"})},[l,n]),!n)return null;function h(p){const v=u[p];v&&(t(v.relPath),Ue())}function f(p){p.key==="Escape"?(p.preventDefault(),Ue()):p.key==="ArrowDown"||p.ctrlKey&&p.key==="n"?(p.preventDefault(),a(v=>u.length===0?0:(v+1)%u.length)):p.key==="ArrowUp"||p.ctrlKey&&p.key==="p"?(p.preventDefault(),a(v=>u.length===0?0:(v-1+u.length)%u.length)):p.key==="Enter"&&(p.preventDefault(),h(l))}return i("div",{class:"palette-overlay",role:"dialog","aria-modal":"true","aria-label":"Switch file",onClick:Ue,children:i("div",{class:"palette",onClick:p=>p.stopPropagation(),children:[i("div",{class:"palette-input-wrap",children:[i("span",{class:"palette-prefix","aria-hidden":!0,children:"⌘P"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:113,columnNumber:11},this),i("input",{ref:m,type:"text",class:"palette-input",placeholder:"Switch file…",value:o,onInput:p=>{s(p.target.value),a(0)},onKeyDown:f,"aria-label":"Find file"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:114,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:112,columnNumber:9},this),i("ul",{class:"palette-list",ref:c,role:"listbox",children:[u.length===0&&i("li",{class:"palette-empty",children:"No files match"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:130,columnNumber:13},this),u.map((p,v)=>{const _=v===l,k=e===p.relPath,b=p.relPath.lastIndexOf("/"),T=b>=0?p.relPath.slice(0,b+1):"",A=b>=0?p.relPath.slice(b+1):p.relPath;return i("li",{class:`palette-item${_?" is-active":""}${k?" is-current":""}`,role:"option","aria-selected":_,onMouseEnter:()=>a(v),onClick:()=>h(v),children:[i("span",{class:"palette-item-name",children:p.matchRanges.length>0?ho(p.relPath,p.matchRanges):i(ee,{children:[T&&i("span",{class:"palette-dir",children:T},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:150,columnNumber:33},this),i("span",{children:A},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:150,columnNumber:72},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:150,columnNumber:23},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:147,columnNumber:17},this),k&&i("span",{class:"palette-tag",children:"current"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:152,columnNumber:31},this)]},p.relPath,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:139,columnNumber:15},this)})]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:128,columnNumber:9},this),i("div",{class:"palette-foot",children:[i("span",{children:[i("kbd",{children:"↑"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:158,columnNumber:17},this),i("kbd",{children:"↓"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:158,columnNumber:29},this)," navigate"]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:158,columnNumber:11},this),i("span",{children:[i("kbd",{children:"Enter"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:159,columnNumber:17},this)," open"]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:159,columnNumber:11},this),i("span",{children:[i("kbd",{children:"Esc"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:160,columnNumber:17},this)," close"]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:160,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:157,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:111,columnNumber:7},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/CommandPalette.tsx",lineNumber:104,columnNumber:5},this)}function fo(e,t=Date.now()){const n=Math.max(0,t-e),r=Math.round(n/1e3);if(r<30)return"just now";if(r<90)return"1 minute ago";const o=Math.round(r/60);if(o<60)return`${o} minutes ago`;const s=Math.round(o/60);if(s<24)return s===1?"1 hour ago":`${s} hours ago`;const l=Math.round(s/24);return l<30?l===1?"yesterday":`${l} days ago`:new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function go(e){return new Date(e).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}const R=I(null);I([]);const ve=I(null);let cr=0;function vo(e,t=600){R.value=e,ve.value=e,cr=performance.now()+t}function bo(e,t,n,r){if(e.length===0)return null;if(t<=0)return e[0].id;if(t+n>=r-1)return e[e.length-1].id;const o=16,s=6;let l=e[0].id;for(const a of e)if(a.top-o<=t+s)l=a.id;else break;return l}const No=.35;function yo(e,t,n,r){if(e.length===0)return null;if(t<=0)return e[0].id;if(t+n>=r-1)return e[e.length-1].id;const o=t+n*No;let s=e[0].id;for(const l of e)if(l.top<=o)s=l.id;else break;return s}function ko(e){y(()=>{if(!e)return;let t=0,n=[],r=[];function o(){const c=e.getBoundingClientRect(),d=e.scrollTop;n=Array.from(e.querySelectorAll(".markdown-content :is(h1,h2,h3,h4,h5,h6)[id]")),r=n.map(u=>{const h=u.getBoundingClientRect();return{id:u.id,top:h.top-c.top+d}})}function s(){if(performance.now()<cr)return;const c=e,d=c.scrollTop,u=c.clientHeight,h=c.scrollHeight,f=bo(r,d,u,h);f!==R.value&&(R.value=f);const p=yo(r,d,u,h);p!==ve.value&&(ve.value=p)}function l(){cancelAnimationFrame(t),t=requestAnimationFrame(s)}o(),s();const a=new ResizeObserver(()=>{o(),s()});a.observe(e);const m=new MutationObserver(()=>{o(),s()});return m.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden"]}),e.addEventListener("scroll",l,{passive:!0}),()=>{cancelAnimationFrame(t),a.disconnect(),m.disconnect(),e.removeEventListener("scroll",l)}},[e])}let pn=!1;function _o(e){try{return localStorage.getItem(e)}catch(t){return pn||(pn=!0,console.warn("[mdview] localStorage read blocked; falling back to defaults. Theme/UI prefs will not persist across reloads.",t)),null}}function xo(e,t){try{localStorage.setItem(e,t)}catch{}}function zt(e,t,n){const r=_o(e),o=r!==null?n.parse(r):null,s=I(o??t);return{signal:s,set(l){s.value=l,xo(e,n.serialize(l))}}}function G(e,t){return zt(e,t,{parse:n=>n==="1"?!0:n==="0"?!1:null,serialize:n=>n?"1":"0"})}function Ye(e,t,n){const r=o=>Math.min(n.max,Math.max(n.min,o));return zt(e,t,{parse:o=>{const s=Number(o);return Number.isFinite(s)?r(s):null},serialize:o=>String(r(o))})}function ur(e,t,n){return zt(e,t,{parse:r=>n.includes(r)?r:null,serialize:r=>r})}const bt=G("mdview-tree-collapsed",!1),Nt=G("mdview-outline-collapsed",!1),yt=G("mdview-focus-mode",!1),kt=G("mdview-minimap",!1),_t=G("mdview-wide-layout",!1),xt=yt.signal,wt=kt.signal,mr=_t.signal;function dr(){yt.set(!yt.signal.value)}function hr(){kt.set(!kt.signal.value)}function pr(){_t.set(!_t.signal.value)}const fr=264,gr=280,Be=180,Ke=480,fn=140,qt=Ye("mdview-tree-width",fr,{min:Be,max:Ke}),jt=Ye("mdview-outline-width",gr,{min:Be,max:Ke}),wo=bt.signal,Do=Nt.signal,gn=qt.signal,vn=jt.signal;function Se(){bt.set(!bt.signal.value)}function Ce(){Nt.set(!Nt.signal.value)}function Uo(e){qt.set(e)}function So(e){jt.set(e)}function Co(){qt.set(fr)}function Eo(){jt.set(gr)}const Io=225;function vr(e){let t=0;for(const n of e)t+=1+vr(n.children);return t}function Po(e,t){const n=document.createElement("div");n.innerHTML=e;const r=(n.textContent??"").trim(),o=r.length===0?0:r.split(/\s+/).filter(Boolean).length,s=Math.max(1,Math.round(o/Io)),l=vr(t);return{words:o,readingMinutes:s,headings:l}}function To(e){const t=e.words.toLocaleString(),n=e.headings;return`${e.readingMinutes} min read · ${t} word${e.words===1?"":"s"} · ${n} heading${n===1?"":"s"}`}const Dt="is-dimmed",Ut="is-focused",bn=new Set(["H1","H2","H3","H4","H5","H6"]);function Nn(e){return Number(e.tagName[1])}function br(e){e.querySelectorAll(`.${Dt}, .${Ut}`).forEach(t=>{t.classList.remove(Dt,Ut)})}function Lo(e,t){if(br(e),!t)return;const n=e.querySelector(`#${CSS.escape(t)}`);if(!n||!bn.has(n.tagName))return;const r=Nn(n),o=n.closest(".markdown-content")??e,s=Array.from(o.children),l=s.indexOf(n);if(l<0)return;let a=s.length;for(let m=l+1;m<s.length;m++){const c=s[m];if(bn.has(c.tagName)&&Nn(c)<=r){a=m;break}}for(let m=0;m<s.length;m++){const c=s[m];m>=l&&m<a?c.classList.add(Ut):c.classList.add(Dt)}}function Ao(e){br(e)}async function $o(e,t,n){for(const r of n)try{await r.run(e,t)}catch(o){console.error(`[mdview] wire "${r.name}" failed:`,o)}}function Nr(){return new URLSearchParams(window.location.search).get("file")}function yr(e,t=""){const r=new URLSearchParams(window.location.search).get("embed"),o=new URLSearchParams({file:e});r!==null&&o.set("embed",r);const s=`?${o.toString()}${t}`;history.pushState({file:e},"",s)}const Qe=I(Nr());function Ee(e){Qe.value=e}function Mo(){y(()=>{const t=()=>Ee(Nr());return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[]);const e=Xn((t,n="")=>{Ee(t),yr(t,n)},[]);return{currentPath:Qe.value,setCurrentPath:Ee,navigate:e}}const St=new Set(["H1","H2","H3","H4","H5","H6"]),Jt="section-toggle",Ho="section-heading-collapsed",it="data-section-collapsed-by",$=new Set;let yn,M=null,kn=!1;function _n(e){return Number(e.tagName[1])}function Gt(e){return!!e&&St.has(e.tagName)}function kr(e,t){const n=e[t];if(!n||!St.has(n.tagName))return null;const r=_n(n);for(let o=t+1;o<e.length;o++){const s=e[o];if(St.has(s.tagName)&&_n(s)<=r)return o}return e.length}function Xt(e){return Array.from(e.children)}function _r(e){return Xt(e).filter(t=>Gt(t)&&!!t.id)}function Ne(e,t,n){const r=Xt(e),o=r.indexOf(t);if(o<0)return;const s=kr(r,o);if(s===null)return;const l=t.querySelector(`button.${Jt}`);l&&(l.setAttribute("aria-expanded",n?"false":"true"),l.setAttribute("aria-label",n?"Expand section":"Collapse section"),l.title=n?"Expand section":"Collapse section"),t.classList.toggle(Ho,n);for(let a=o+1;a<s;a++){const m=r[a];n?m.hasAttribute("hidden")||(m.setAttribute("hidden",""),m.setAttribute(it,t.id)):m.getAttribute(it)===t.id&&(m.removeAttribute("hidden"),m.removeAttribute(it))}}function Fo(e,t){const n=t.id,r=!$.has(n);r?$.add(n):$.delete(n),Ne(e,t,r)}function Yt(e,t){for(const n of _r(e))t?$.add(n.id):$.delete(n.id),Ne(e,n,t)}function Oo(){M&&Yt(M,!1)}function Ro(){M&&Yt(M,!0)}function Ct(e){if(!M||$.size===0||!e||!M.contains(e))return;const t=Xt(M);for(let n=0;n<t.length;n++){const r=t[n];if(!Gt(r)||!r.id||!$.has(r.id))continue;const o=kr(t,n);if(o!==null)for(let s=n+1;s<o;s++){const l=t[s];if(l===e||l.contains(e)){$.delete(r.id),Ne(M,r,!1);break}}}}function lt(e){e&&Ct(document.getElementById(e))}function Bo(e,t){const n=document.createElement("button");return n.type="button",n.className=Jt,n.setAttribute("aria-expanded","true"),n.setAttribute("aria-label","Collapse section"),n.title="Collapse section",n.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),Fo(e,t)}),n}let he=null;function Ko(){M&&he===null&&(he=[...$],Yt(M,!1))}function Vo(){if(!(!M||!he)){for(const e of he){$.add(e);const t=document.getElementById(e);t&&Gt(t)&&M.contains(t)&&Ne(M,t,!0)}he=null}}function Wo(){kn||(window.addEventListener("beforeprint",Ko),window.addEventListener("afterprint",Vo),kn=!0)}const zo={name:"collapsible-sections",run:e=>{M=e;const t=Qe.value;t!==yn&&($.clear(),yn=t);const n=_r(e);for(const o of n)o.querySelector(`button.${Jt}`)||o.insertBefore(Bo(e,o),o.firstChild);const r=new Set(n.map(o=>o.id));for(const o of[...$])r.has(o)||$.delete(o);for(const o of n)Ne(e,o,$.has(o.id));Wo()}};function qo(e){e.querySelectorAll("pre").forEach(n=>{var s;if(n.closest(".mermaid-block")||(s=n.parentElement)!=null&&s.classList.contains("pre-wrap"))return;const r=document.createElement("div");r.className="pre-wrap",n.replaceWith(r),r.appendChild(n);const o=document.createElement("button");o.type="button",o.className="copy-btn",o.textContent="Copy",o.setAttribute("aria-label","Copy code to clipboard"),o.addEventListener("click",async l=>{l.stopPropagation();const a=n.querySelector("code"),m=((a==null?void 0:a.textContent)??n.textContent??"").replace(/\s+$/,"");try{await navigator.clipboard.writeText(m),o.textContent="Copied",o.classList.add("is-copied")}catch{o.textContent="Failed"}window.setTimeout(()=>{o.textContent="Copy",o.classList.remove("is-copied")},1600)}),r.appendChild(o)})}function jo(e){e.querySelectorAll("a[href]").forEach(n=>{if(n.dataset.externalProcessed==="1"||n.hasAttribute("data-internal-link"))return;const r=n.getAttribute("href")??"";if(/^https?:\/\//i.test(r)&&!n.classList.contains("heading-anchor")){if(n.target="_blank",n.rel="noopener noreferrer",n.classList.add("is-external"),!n.querySelector(".external-icon")){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("class","external-icon"),o.setAttribute("viewBox","0 0 12 12"),o.setAttribute("width","11"),o.setAttribute("height","11"),o.setAttribute("aria-hidden","true"),o.innerHTML='<path fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5h5v5M9.5 2.5L4 8M2.5 5.2v4.3h4.3"/>',n.appendChild(o)}n.dataset.externalProcessed="1"}})}const Ze=I(null);function xn(e,t){Ze.value={src:e,alt:t}}function Ie(){Ze.value=null}function Jo(e){e.querySelectorAll(".markdown-content img").forEach(n=>{n.dataset.lightboxWired!=="1"&&(n.closest(".mermaid-block")||(n.dataset.lightboxWired="1",n.classList.add("img-zoomable"),n.setAttribute("tabindex","0"),n.setAttribute("role","button"),n.setAttribute("aria-label",`Open ${n.alt||"image"} fullscreen`),n.addEventListener("click",()=>{xn(n.src,n.alt)}),n.addEventListener("keydown",r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),xn(n.src,n.alt))})))})}const Go="modulepreload",Xo=function(e){return"/"+e},wn={},Qt=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),m=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=l(n.map(c=>{if(c=Xo(c),c in wn)return;wn[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":Go,d||(h.as="script"),h.crossOrigin="",h.href=c,m&&h.setAttribute("nonce",m),document.head.appendChild(h),d)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(l){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=l,window.dispatchEvent(a),!a.defaultPrevented)throw l}return o.then(l=>{for(const a of l||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};let at=null,Dn=!1;function Yo(){return at||(at=Qt(()=>import("./katex-DkKDou_j.js"),[])),at}async function Qo(){if(Dn)return;Dn=!0;const e=(await Qt(async()=>{const{default:n}=await import("./katex.min-DBnXG_UH.js");return{default:n}},[])).default,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)}async function Zo(e){const t=e.querySelectorAll("span.math-inline:not([data-rendered])"),n=e.querySelectorAll("div.math-block:not([data-rendered])");if(t.length===0&&n.length===0)return;const[r]=await Promise.all([Yo(),Qo()]),o=r.default;for(const s of t){const l=decodeURIComponent(s.dataset.source??"");try{o.render(l,s,{displayMode:!1,throwOnError:!1})}catch(a){s.textContent=`[math error: ${a.message}]`}s.dataset.rendered="true"}for(const s of n){const l=decodeURIComponent(s.dataset.source??"");try{o.render(l,s,{displayMode:!0,throwOnError:!1})}catch(a){s.textContent=`[math error: ${a.message}]`}s.dataset.rendered="true"}}const es=/\.(md|markdown|mdx)$/i;function Un(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function ts(e){return!!(e.target&&e.target!==""&&e.target!=="_self"||e.hasAttribute("download"))}function ns(e,t){e.addEventListener("click",n=>{const r=n.target.closest("a");if(!r)return;const o=r.matches("[data-internal-link]")?r.getAttribute("data-internal-link"):null;if(o!==null){if(Un(n))return;n.preventDefault();const c=o??"",d=c.indexOf("#"),u=d>=0?c.slice(0,d):c,h=d>=0?c.slice(d):"";t(u,h);return}if(Un(n)||ts(r))return;const s=r.href;if(!s)return;let l;try{l=new URL(s)}catch{return}if(l.origin!==window.location.origin||!es.test(l.pathname))return;n.preventDefault();let a;try{a=decodeURIComponent(l.pathname)}catch{a=l.pathname}const m=a.replace(/^\/+/,"");t(m,l.hash)})}const rs=["light","dark"],Et=window.matchMedia("(prefers-color-scheme: dark)");function os(){try{const e=localStorage.getItem("mdview-theme");if(e==="light"||e==="dark")return e}catch{}return null}const xr=os(),wr=ur("mdview-theme",xr??(Et.matches?"dark":"light"),rs),Z=wr.signal,Dr=I(xr!==null);function ss(e){wr.set(e),Dr.value=!0}function Ur(){ss(Z.value==="dark"?"light":"dark")}function is(){return y(()=>{const e=t=>{Dr.value||(Z.value=t.matches?"dark":"light")};return Et.addEventListener("change",e),()=>Et.removeEventListener("change",e)},[]),y(()=>{document.documentElement.dataset.theme=Z.value}),Z.value}let ct=null,ls=0,It=null;function as(){return ct||(ct=Qt(()=>import("./mermaid.core-BJg17JjK.js").then(e=>e.bn),[])),ct}function cs(){return Z.value==="dark"?"dark":"default"}async function Sr(e){const t=e.querySelectorAll(".mermaid-block");if(t.length===0)return;const r=(await as()).default,o=cs();if(It!==o){r.initialize({startOnLoad:!1,theme:o,securityLevel:"strict"}),It=o;for(const s of Array.from(t))delete s.dataset.rendered}await Promise.all(Array.from(t).map(s=>us(r,s)))}async function us(e,t){if(t.dataset.rendered)return;const n=decodeURIComponent(t.dataset.source??""),r=`mermaid-${++ls}`;try{if(!await e.parse(n,{suppressErrors:!0})){Sn(t,"syntax error");return}const{svg:s}=await e.render(r,n);t.innerHTML=s,t.dataset.rendered="true"}catch(o){Sn(t,o.message)}finally{ms(r)}}function Sn(e,t){const n=document.createElement("pre");n.className="mermaid-error",n.textContent=`Mermaid: ${t}`,e.replaceChildren(n),e.dataset.rendered="true"}function ms(e){for(const t of[e,`d${e}`]){const n=document.getElementById(t);n&&n.parentElement===document.body&&n.remove()}}Ge(()=>{if(Z.value,It===null)return;const e=document.querySelector(".markdown-content");e&&Sr(e)});function ds(e){e.querySelectorAll(".markdown-content :is(h1,h2,h3,h4,h5,h6)[id]").forEach(n=>{if(n.querySelector(".heading-anchor"))return;const r=document.createElement("a");r.className="heading-anchor",r.href=`#${n.id}`,r.setAttribute("aria-label",`Copy link to ${n.textContent??""}`),r.title="Copy link to this section",r.textContent="#",r.addEventListener("click",async o=>{o.preventDefault();const l=new URLSearchParams(window.location.search).get("file"),a=`${window.location.origin}${window.location.pathname}${l?`?file=${encodeURIComponent(l)}`:""}#${n.id}`;try{await navigator.clipboard.writeText(a),r.textContent="✓",r.classList.add("is-copied")}catch{r.textContent="!"}window.setTimeout(()=>{r.textContent="#",r.classList.remove("is-copied")},1500)}),n.appendChild(r)})}const hs=[zo,{name:"mermaid",run:e=>Sr(e)},{name:"math",run:e=>Zo(e)},{name:"internal-links",run:(e,t)=>ns(e,t.onInternalNavigate)},{name:"copy-buttons",run:e=>qo(e)},{name:"permalinks",run:e=>ds(e)},{name:"external-links",run:e=>jo(e)},{name:"image-lightbox",run:e=>Jo(e)}];function ps({file:e,onInternalNavigate:t}){const n=O(null),r=F(()=>Po(e.html,e.outline),[e]);return y(()=>{n.current&&(n.current.innerHTML=e.html,$o(n.current,{onInternalNavigate:t},hs))},[e]),y(()=>{n.current&&(xt.value?Lo(n.current,ve.value):Ao(n.current))},[xt.value,ve.value,e]),i("article",{class:"markdown-body",children:[e.frontmatter&&Object.keys(e.frontmatter).length>0&&i("details",{class:"frontmatter-block",children:[i("summary",{children:"frontmatter"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:45,columnNumber:11},this),i("pre",{children:i("code",{children:JSON.stringify(e.frontmatter,null,2)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:46,columnNumber:16},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:46,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:44,columnNumber:9},this),r.words>0&&i("div",{class:"doc-stats","aria-label":"Document statistics",children:[i("span",{children:To(r)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:51,columnNumber:11},this),e.lastModified>0&&i(ee,{children:[i("span",{class:"doc-stats-sep","aria-hidden":!0,children:"·"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:54,columnNumber:15},this),i("span",{class:"doc-stats-updated",title:go(e.lastModified),children:["Updated ",fo(e.lastModified)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:55,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:53,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:50,columnNumber:9},this),i("div",{ref:n,class:"markdown-content"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:65,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Content.tsx",lineNumber:42,columnNumber:5},this)}function fs(){return i("div",{class:"skeleton","aria-hidden":"true",children:[i("div",{class:"skeleton__h1"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:4,columnNumber:7},this),i("div",{class:"skeleton__meta"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:5,columnNumber:7},this),i("div",{class:"skeleton__line",style:{width:"94%"}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:6,columnNumber:7},this),i("div",{class:"skeleton__line",style:{width:"88%"}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:7,columnNumber:7},this),i("div",{class:"skeleton__line",style:{width:"76%"}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:8,columnNumber:7},this),i("div",{class:"skeleton__h2"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:9,columnNumber:7},this),i("div",{class:"skeleton__line",style:{width:"92%"}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:10,columnNumber:7},this),i("div",{class:"skeleton__line",style:{width:"84%"}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:11,columnNumber:7},this),i("div",{class:"skeleton__code"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:12,columnNumber:7},this),i("div",{class:"skeleton__line",style:{width:"90%"}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:13,columnNumber:7},this),i("div",{class:"skeleton__line",style:{width:"70%"}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:14,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ContentSkeleton.tsx",lineNumber:3,columnNumber:5},this)}const gs=["node_modules","dist","build","out","target","coverage","vendor","__pycache__","venv","Pods","DerivedData","_build"],P=e=>({width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":1.6,"stroke-linecap":"round","stroke-linejoin":"round"});function Cr({size:e=14,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:i("polyline",{points:"9 6 15 12 9 18"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:23,columnNumber:7},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:22,columnNumber:5},this)}function vs({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:i("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:31,columnNumber:7},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:30,columnNumber:5},this)}function bs({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v1H3V7z"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:39,columnNumber:7},this),i("path",{d:"M3 9h18l-2 8a2 2 0 0 1-2 1.5H6A2 2 0 0 1 4 17L3 9z"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:40,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:38,columnNumber:5},this)}function Ns({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9l-6-6z"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:48,columnNumber:7},this),i("polyline",{points:"14 3 14 9 20 9"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:49,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:47,columnNumber:5},this)}function ys({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9l-6-6z"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:58,columnNumber:7},this),i("polyline",{points:"14 3 14 9 20 9"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:59,columnNumber:7},this),i("path",{d:"M8 14l2 2 2-3 2 3 2-2"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:60,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:57,columnNumber:5},this)}function ks({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("circle",{cx:"12",cy:"12",r:"4"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:68,columnNumber:7},this),i("line",{x1:"12",y1:"2",x2:"12",y2:"5"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:69,columnNumber:7},this),i("line",{x1:"12",y1:"19",x2:"12",y2:"22"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:70,columnNumber:7},this),i("line",{x1:"2",y1:"12",x2:"5",y2:"12"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:71,columnNumber:7},this),i("line",{x1:"19",y1:"12",x2:"22",y2:"12"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:72,columnNumber:7},this),i("line",{x1:"4.5",y1:"4.5",x2:"6.6",y2:"6.6"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:73,columnNumber:7},this),i("line",{x1:"17.4",y1:"17.4",x2:"19.5",y2:"19.5"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:74,columnNumber:7},this),i("line",{x1:"4.5",y1:"19.5",x2:"6.6",y2:"17.4"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:75,columnNumber:7},this),i("line",{x1:"17.4",y1:"6.6",x2:"19.5",y2:"4.5"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:76,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:67,columnNumber:5},this)}function _s({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:i("path",{d:"M21 13.5A8.5 8.5 0 0 1 10.5 3a7 7 0 1 0 10.5 10.5z"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:84,columnNumber:7},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:83,columnNumber:5},this)}function xs({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:92,columnNumber:7},this),i("line",{x1:"9",y1:"4",x2:"9",y2:"20"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:93,columnNumber:7},this),i("polyline",{points:"15 9 12 12 15 15"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:94,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:91,columnNumber:5},this)}function ws({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:102,columnNumber:7},this),i("line",{x1:"9",y1:"4",x2:"9",y2:"20"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:103,columnNumber:7},this),i("polyline",{points:"13 9 16 12 13 15"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:104,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:101,columnNumber:5},this)}function Ds({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:112,columnNumber:7},this),i("line",{x1:"15",y1:"4",x2:"15",y2:"20"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:113,columnNumber:7},this),i("polyline",{points:"9 9 12 12 9 15"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:114,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:111,columnNumber:5},this)}function Us({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:122,columnNumber:7},this),i("line",{x1:"15",y1:"4",x2:"15",y2:"20"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:123,columnNumber:7},this),i("polyline",{points:"11 9 8 12 11 15"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:124,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:121,columnNumber:5},this)}function Ss({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("rect",{x:"2",y:"6",width:"20",height:"13",rx:"2"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:132,columnNumber:7},this),i("line",{x1:"6",y1:"10",x2:"6.01",y2:"10"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:133,columnNumber:7},this),i("line",{x1:"10",y1:"10",x2:"10.01",y2:"10"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:134,columnNumber:7},this),i("line",{x1:"14",y1:"10",x2:"14.01",y2:"10"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:135,columnNumber:7},this),i("line",{x1:"18",y1:"10",x2:"18.01",y2:"10"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:136,columnNumber:7},this),i("line",{x1:"6",y1:"14",x2:"6.01",y2:"14"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:137,columnNumber:7},this),i("line",{x1:"18",y1:"14",x2:"18.01",y2:"14"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:138,columnNumber:7},this),i("line",{x1:"9",y1:"14",x2:"15",y2:"14"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:139,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:131,columnNumber:5},this)}function Cs({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("circle",{cx:"12",cy:"12",r:"3"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:159,columnNumber:7},this),i("circle",{cx:"12",cy:"12",r:"9"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:160,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:158,columnNumber:5},this)}function Es({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:168,columnNumber:7},this),i("line",{x1:"8",y1:"7",x2:"14",y2:"7"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:169,columnNumber:7},this),i("line",{x1:"8",y1:"11",x2:"16",y2:"11"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:170,columnNumber:7},this),i("line",{x1:"8",y1:"15",x2:"12",y2:"15"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:171,columnNumber:7},this),i("line",{x1:"8",y1:"19",x2:"14",y2:"19"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:172,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:167,columnNumber:5},this)}function Is({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("circle",{cx:"12",cy:"12",r:"3"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:180,columnNumber:7},this),i("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.6 1.7 1.7 0 0 0-1.9.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.9 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.6-1.1 1.7 1.7 0 0 0-.3-1.9l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.9.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.9-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.9V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:181,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:179,columnNumber:5},this)}function Er({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:i("polyline",{points:"20 6 9 17 4 12"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:189,columnNumber:7},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:188,columnNumber:5},this)}function Ps({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("polyline",{points:"4 9 4 4 9 4"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:197,columnNumber:7},this),i("polyline",{points:"20 9 20 4 15 4"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:198,columnNumber:7},this),i("polyline",{points:"4 15 4 20 9 20"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:199,columnNumber:7},this),i("polyline",{points:"20 15 20 20 15 20"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:200,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:196,columnNumber:5},this)}function Ts({size:e=16,class:t}){return i("svg",{...P(e),class:t,"aria-hidden":!0,children:[i("circle",{cx:"12",cy:"12",r:"9"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:208,columnNumber:7},this),i("line",{x1:"12",y1:"11",x2:"12",y2:"16"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:209,columnNumber:7},this),i("line",{x1:"12",y1:"8",x2:"12",y2:"8"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:210,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Icons.tsx",lineNumber:207,columnNumber:5},this)}const Ls=["Hidden from the tree to keep the watcher under the OS file-watch limit:","• dotfiles / dotdirs (.git, .next, .venv, …)",`• built-in heavy dirs: ${gs.join(", ")}`,"","Add your own in ~/.config/mdview/config.json:",'{ "ignore": ["my-build-dir"] }',"","Restart mdview after editing."].join(`
|
|
2
|
+
`);function As({tree:e,currentPath:t,onSelect:n,onCollapse:r}){return i("div",{class:"pane-content",children:[i("div",{class:"pane-head",children:[i("span",{class:"pane-head-title",children:["Files",i("span",{class:"pane-head-info",role:"button",tabIndex:0,"aria-label":"Why some folders aren't shown","data-tooltip":Ls,"data-tooltip-multiline":!0,"data-tooltip-align":"left",children:i(Ts,{size:11},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:47,columnNumber:13},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:38,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:36,columnNumber:9},this),i("button",{class:"pane-head-btn","aria-label":"Hide file tree","data-tooltip":"Hide file tree (⌘B)","data-tooltip-align":"right",onClick:r,children:i(xs,{size:14},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:57,columnNumber:11},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:50,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:35,columnNumber:7},this),i("ul",{class:"tree",role:"tree",children:e.map(o=>i(Ir,{node:o,currentPath:t,onSelect:n,depth:0},o.relPath,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:62,columnNumber:11},this))},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:60,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:34,columnNumber:5},this)}function Ir({node:e,currentPath:t,onSelect:n,depth:r}){const o=(t==null?void 0:t.startsWith(e.relPath+"/"))??!1,[s,l]=K(o);y(()=>{o&&l(!0)},[t]);const a=`${10+r*14}px`;if(e.type==="dir")return i("li",{class:"tree-li tree-li-dir",role:"treeitem","aria-expanded":s,children:[i("button",{class:`tree-item tree-dir ${s?"is-open":""}`,style:{paddingLeft:a},onClick:()=>l(h=>!h),children:[i("span",{class:`chev ${s?"open":""}`,"aria-hidden":!0,children:i(Cr,{size:12},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:100,columnNumber:13},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:99,columnNumber:11},this),i("span",{class:"tree-icon","aria-hidden":!0,children:s?i(bs,{size:15},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:103,columnNumber:21},this):i(vs,{size:15},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:103,columnNumber:52},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:102,columnNumber:11},this),i("span",{class:"name",children:e.name},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:105,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:94,columnNumber:9},this),s&&e.children&&e.children.length>0&&i("ul",{class:"tree-children",style:{paddingLeft:`${10+r*14+7}px`},children:e.children.map(h=>i(Ir,{node:h,currentPath:t,onSelect:n,depth:r+1},h.relPath,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:110,columnNumber:15},this))},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:108,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:93,columnNumber:7},this);const m=e.isMarkdown??!1,c=t===e.relPath,d=`tree-item tree-file ${m?"":"is-disabled"} ${c?"is-current":""}`,u=m?`/?file=${encodeURIComponent(e.relPath)}`:void 0;return i("li",{class:"tree-li tree-li-file",role:"treeitem",children:m?i("a",{class:d,style:{paddingLeft:a},href:u,title:e.name,onClick:h=>{h.metaKey||h.ctrlKey||h.shiftKey||h.altKey||(h.preventDefault(),n(e.relPath))},children:[i("span",{class:"tree-icon","aria-hidden":!0,children:i(ys,{size:14},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:150,columnNumber:13},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:149,columnNumber:11},this),i("span",{class:"name",children:e.name},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:152,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:135,columnNumber:9},this):i("span",{class:d,style:{paddingLeft:a},title:e.name,children:[i("span",{class:"tree-icon","aria-hidden":!0,children:i(Ns,{size:14},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:157,columnNumber:13},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:156,columnNumber:11},this),i("span",{class:"name",children:e.name},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:159,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:155,columnNumber:9},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/FolderTree.tsx",lineNumber:133,columnNumber:5},this)}const et=I(!1);function Pr(){et.value=!0}function Pe(){et.value=!1}function Tr(e,t,n=[]){for(const r of e){const o=[...n,r];if(r.id===t)return o;const s=Tr(r.children,t,o);if(s)return s}return null}function Cn(e){return e.trim().toLowerCase()}function $s({outline:e,fileName:t,onJump:n}){var s;const r=R.value;let o=r?Tr(e,r)??[]:[];return t&&o.length>0&&((s=o[0])==null?void 0:s.level)===1&&Cn(o[0].text)===Cn(t)&&(o=o.slice(1)),i("nav",{class:"breadcrumbs","aria-label":"Current section",children:[t&&i("button",{type:"button",class:"bc-item bc-root",onClick:()=>n(null),title:"Scroll to top",children:t},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Breadcrumbs.tsx",lineNumber:44,columnNumber:9},this),o.map((l,a)=>{const m=a===o.length-1;return i("span",{class:"bc-step",children:[i("span",{class:"bc-sep","aria-hidden":!0,children:"›"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Breadcrumbs.tsx",lineNumber:57,columnNumber:13},this),i("button",{type:"button",class:`bc-item${m?" is-current":""}`,onClick:()=>n(l.id),"aria-current":m?"location":void 0,children:l.text},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Breadcrumbs.tsx",lineNumber:58,columnNumber:13},this)]},l.id,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Breadcrumbs.tsx",lineNumber:56,columnNumber:11},this)})]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Breadcrumbs.tsx",lineNumber:42,columnNumber:5},this)}const Lr="mdview-palette";function Ms(){try{const e=localStorage.getItem(Lr);if(e&&Je.includes(e))return e}catch{}return null}const Ar=Ms(),$r=ur(Lr,Ar??"classic",Je),Te=$r.signal,Mr=I(Ar!==null);function Hr(e){$r.set(e),Mr.value=!0}function Hs(){return y(()=>{var e;!Mr.value&&((e=vt.value)!=null&&e.palette)&&(Te.value=vt.value.palette)}),y(()=>{document.documentElement.dataset.palette=Te.value}),Te.value}const Fs={classic:"Classic",paper:"Paper",nord:"Nord",solarized:"Solarized","high-contrast":"High contrast"};function ut({icon:e,label:t,shortcut:n,on:r,onToggle:o}){return i("button",{class:`view-menu-row${r?" is-on":""}`,role:"menuitemcheckbox","aria-checked":r,onClick:o,children:[i("span",{class:"view-menu-icon","aria-hidden":!0,children:e},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:45,columnNumber:7},this),i("span",{class:"view-menu-label",children:t},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:46,columnNumber:7},this),n&&i("span",{class:"view-menu-kbd","aria-hidden":!0,children:n},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:47,columnNumber:20},this),i("span",{class:"view-menu-check","aria-hidden":!0,children:r?i(Er,{size:14},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:49,columnNumber:15},this):null},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:48,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:39,columnNumber:5},this)}function Os(){const[e,t]=K(!1),n=O(null);y(()=>{if(!e)return;function a(c){var d;(d=n.current)!=null&&d.contains(c.target)||t(!1)}function m(c){c.key==="Escape"&&t(!1)}return document.addEventListener("mousedown",a),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",m)}},[e]);const r=xt.value,o=wt.value,s=mr.value,l=Te.value;return i("div",{class:"view-menu",ref:n,children:[i("button",{class:`icon-btn${e?" is-active":""}`,"aria-label":"View settings","data-tooltip":"View settings","aria-haspopup":"menu","aria-expanded":e,onClick:()=>t(a=>!a),children:i(Is,{},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:90,columnNumber:9},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:82,columnNumber:7},this),e&&i("div",{class:"view-menu-popover",role:"menu","aria-label":"View settings",children:[i("div",{class:"view-menu-section",children:[i(ut,{icon:i(Cs,{size:14},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:96,columnNumber:21},this),label:"Focus mode",shortcut:"f",on:r,onToggle:dr},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:95,columnNumber:13},this),i(ut,{icon:i(Es,{size:14},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:103,columnNumber:21},this),label:"Minimap",shortcut:"m",on:o,onToggle:hr},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:102,columnNumber:13},this),i(ut,{icon:i(Ps,{size:14},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:110,columnNumber:21},this),label:"Wide layout",on:s,onToggle:pr},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:109,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:94,columnNumber:11},this),i("div",{class:"view-menu-divider"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:116,columnNumber:11},this),i("div",{class:"view-menu-section",children:[i("div",{class:"view-menu-heading",children:"Palette"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:118,columnNumber:13},this),Je.map(a=>i("button",{role:"menuitemradio","aria-checked":l===a,class:`view-menu-row view-menu-palette${l===a?" is-on":""}`,onClick:()=>Hr(a),children:[i("span",{class:`palette-swatch palette-swatch-${a}`,"aria-hidden":!0},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:127,columnNumber:17},this),i("span",{class:"view-menu-label",children:Fs[a]},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:128,columnNumber:17},this),i("span",{class:"view-menu-check","aria-hidden":!0,children:l===a?i(Er,{size:14},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:130,columnNumber:43},this):null},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:129,columnNumber:17},this)]},a,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:120,columnNumber:15},this))]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:117,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:93,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ViewMenu.tsx",lineNumber:81,columnNumber:5},this)}function Rs({outline:e,fileName:t,onJumpHeading:n}){const r=Z.value,o=r==="dark"?"Switch to light (⌘\\)":"Switch to dark (⌘\\)";return i("div",{class:"header-inner",children:[i("div",{class:"header-left",children:i("span",{class:"brand",children:"mdview"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:20,columnNumber:9},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:19,columnNumber:7},this),i("div",{class:"header-center",children:i($s,{outline:e,fileName:t,onJump:n},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:24,columnNumber:9},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:23,columnNumber:7},this),i("div",{class:"header-right",children:[i(Os,{},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:28,columnNumber:9},this),i("button",{class:"icon-btn theme-btn","aria-label":o,"data-tooltip":o,onClick:Ur,children:r==="dark"?i(ks,{},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:35,columnNumber:31},this):i(_s,{},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:35,columnNumber:45},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:29,columnNumber:9},this),i("button",{class:"icon-btn","aria-label":"Keyboard shortcuts","data-tooltip":"Shortcuts (?)","data-tooltip-align":"right",onClick:Pr,children:i(Ss,{},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:44,columnNumber:11},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:37,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:27,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Header.tsx",lineNumber:18,columnNumber:5},this)}function Bs(){const e=Ze.value;return y(()=>{if(!e)return;function t(r){r.key==="Escape"&&Ie()}window.addEventListener("keydown",t);const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",t),document.body.style.overflow=n}},[e]),e?i("div",{class:"lightbox-overlay",role:"dialog","aria-modal":"true","aria-label":e.alt||"Image preview",onClick:Ie,children:[i("button",{type:"button",class:"lightbox-close","aria-label":"Close image preview",onClick:t=>{t.stopPropagation(),Ie()},children:"×"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Lightbox.tsx",lineNumber:31,columnNumber:7},this),i("img",{class:"lightbox-img",src:e.src,alt:e.alt,onClick:t=>t.stopPropagation()},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Lightbox.tsx",lineNumber:42,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Lightbox.tsx",lineNumber:24,columnNumber:5},this):null}const be=I(null);function Ks(e){be.value=e}function tt(e){const t=[];for(const n of e)t.push({id:n.id,level:n.level}),t.push(...tt(n.children));return t}function En(e,t,n){var l,a;const r=tt(e);if(r.length===0)return null;if(!t)return n===1?((l=r[0])==null?void 0:l.id)??null:((a=r[r.length-1])==null?void 0:a.id)??null;const o=r.findIndex(m=>m.id===t);if(o<0)return null;const s=r[o].level;if(n===1){for(let m=o+1;m<r.length;m++)if(r[m].level===s)return r[m].id}else for(let m=o-1;m>=0;m--)if(r[m].level===s)return r[m].id;return null}function Vs(e,t){if(!e)return[];const n=tt(t),r=e.scrollHeight;if(r===0)return[];const o=[],s=e.getBoundingClientRect();for(const{id:l,level:a}of n){const m=e.querySelector(`#${CSS.escape(l)}`);if(!m)continue;const u=(m.getBoundingClientRect().top-s.top+e.scrollTop)/r;o.push({id:l,level:a,ratio:Math.max(0,Math.min(1,u))})}return o}function Ws({outline:e}){const t=be.value,[n,r]=K([]),[o,s]=K({top:0,height:0}),l=O(null);y(()=>{if(!t)return;const c=()=>r(Vs(t,e));c();const d=new ResizeObserver(c);return d.observe(t),()=>d.disconnect()},[t,e]),y(()=>{if(!t)return;const c=()=>{const d=t.scrollHeight||1;s({top:t.scrollTop/d,height:t.clientHeight/d})};return c(),t.addEventListener("scroll",c,{passive:!0}),()=>t.removeEventListener("scroll",c)},[t]);function a(c){const d=l.current;if(!d||!t)return;const u=d.getBoundingClientRect(),h=Math.max(0,Math.min(1,(c-u.top)/u.height));t.scrollTo({top:h*t.scrollHeight,behavior:"smooth"})}if(!t||n.length===0)return null;const m=R.value;return i("div",{ref:l,class:"minimap",role:"navigation","aria-label":"Document minimap",onClick:c=>a(c.clientY),children:[n.map(c=>i("div",{class:`minimap-bar minimap-level-${c.level}${m===c.id?" is-active":""}`,style:{top:`${(c.ratio*100).toFixed(2)}%`},title:c.id},c.id,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Minimap.tsx",lineNumber:89,columnNumber:9},this)),i("div",{class:"minimap-viewport",style:{top:`${(o.top*100).toFixed(2)}%`,height:`${(o.height*100).toFixed(2)}%`}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Minimap.tsx",lineNumber:96,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Minimap.tsx",lineNumber:81,columnNumber:5},this)}const J=1,se=6,Ve=Ye("mdview-outline-min-level",J,{min:J,max:se}),We=Ye("mdview-outline-max-level",se,{min:J,max:se}),Fr=Ve.signal,Or=We.signal;function zs(e){Ve.set(e),e>We.signal.value&&We.set(e)}function qs(e){We.set(e),e<Ve.signal.value&&Ve.set(e)}const js=or(()=>{const e=Fr.value,t=Or.value,n=new Set;for(let r=e;r<=t;r++)n.add(r);return n});function Rr(e,t){const n=[];for(const r of e){const o=Rr(r.children,t);t.has(r.level)?n.push({...r,children:o}):n.push(...o)}return n}function Js({nodes:e,onJump:t,onCollapse:n}){const r=js.value,o=Fr.value,s=Or.value,l=F(()=>Rr(e,r),[e,r]),a=o===s?`H${o}`:`H${o}–H${s}`,m=se-J,c=(o-J)/m*100,d=100-(s-J)/m*100;return i("nav",{class:"outline","aria-label":"Document outline",children:[i("div",{class:"outline-head",children:[i("button",{class:"pane-head-btn","aria-label":"Hide outline","data-tooltip":"Hide outline (⌘.)","data-tooltip-align":"left",onClick:n,children:i(Ds,{size:14},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:42,columnNumber:11},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:35,columnNumber:9},this),i("span",{class:"outline-title",children:"On this page"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:44,columnNumber:9},this),i("div",{class:"outline-depth","data-tooltip":`Show ${a}`,"data-tooltip-align":"right",children:[i("span",{class:"outline-depth-label","aria-hidden":!0,children:a},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:50,columnNumber:11},this),i("div",{class:"outline-depth-range",role:"group","aria-label":"Heading depth range",children:[i("div",{class:"outline-depth-track","aria-hidden":!0,children:i("div",{class:"outline-depth-track-fill",style:`left:${c}%;right:${d}%`},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:53,columnNumber:15},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:52,columnNumber:13},this),i("input",{type:"range",class:"outline-depth-slider outline-depth-slider-min",min:J,max:se,step:1,value:o,"aria-label":`Minimum heading level (currently H${o})`,onInput:u=>{const h=Number(u.currentTarget.value);Number.isFinite(h)&&zs(h)}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:58,columnNumber:13},this),i("input",{type:"range",class:"outline-depth-slider outline-depth-slider-max",min:J,max:se,step:1,value:s,"aria-label":`Maximum heading level (currently H${s})`,onInput:u=>{const h=Number(u.currentTarget.value);Number.isFinite(h)&&qs(h)}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:71,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:51,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:45,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:34,columnNumber:7},this),l.length===0?i("div",{class:"outline-empty",children:e.length===0?"No headings":"All levels hidden"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:88,columnNumber:9},this):i("ul",{children:l.map(u=>i(Br,{node:u,onJump:t,depth:0},u.id,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:94,columnNumber:13},this))},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:92,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:33,columnNumber:5},this)}function Br({node:e,onJump:t,depth:n}){const[r,o]=K(!1),s=e.children.length>0,l=R.value===e.id,a=Math.min(n,5);return i("li",{class:`outline-li depth-${a}`,children:[i("div",{class:`outline-row ${l?"is-active":""}`,children:[s?i("button",{class:`outline-toggle ${r?"":"open"}`,"aria-label":r?"Expand section":"Collapse section",onClick:m=>{m.stopPropagation(),o(c=>!c)},children:i(Cr,{size:11},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:126,columnNumber:13},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:118,columnNumber:11},this):i("span",{class:"outline-toggle is-spacer","aria-hidden":!0},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:129,columnNumber:11},this),i("button",{class:"outline-link",onClick:()=>t(e.id),title:e.text,children:e.text},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:131,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:116,columnNumber:7},this),s&&!r&&i("ul",{class:"outline-children",children:e.children.map(m=>i(Br,{node:m,onJump:t,depth:n+1},m.id,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:142,columnNumber:13},this))},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:140,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Outline.tsx",lineNumber:115,columnNumber:5},this)}function Gs({scroller:e,trigger:t}){const[n,r]=K(0);return y(()=>{if(!e)return;let o=0;function s(){if(!e)return;const a=e.scrollHeight-e.clientHeight;if(a<=0){r(0);return}const m=Math.max(0,Math.min(1,e.scrollTop/a));r(m)}function l(){cancelAnimationFrame(o),o=requestAnimationFrame(s)}return e.addEventListener("scroll",l,{passive:!0}),s(),()=>{cancelAnimationFrame(o),e.removeEventListener("scroll",l)}},[e,t]),i("div",{class:"reading-progress",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n*100),"aria-label":"Reading progress",children:i("div",{class:"reading-progress__bar",style:{width:`${n*100}%`}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ReadingProgress.tsx",lineNumber:48,columnNumber:7},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ReadingProgress.tsx",lineNumber:40,columnNumber:5},this)}function In(e){const t=O(null),n=O(e);return n.current=e,y(()=>{const r=t.current;if(!r)return;let o=null;function s(m){if(!o)return;const{side:c,onResize:d,min:u,max:h}=n.current,f=m.clientX-o.startX,p=c==="left"?o.startWidth+f:o.startWidth-f;d(Math.min(h,Math.max(u,p)))}function l(){if(!o)return;const{collapseAt:m,onCollapse:c,getCurrent:d}=n.current,u=d(),h=t.current;try{h==null||h.releasePointerCapture(o.pointerId)}catch{}o=null,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),u<m&&c()}function a(m){o={startX:m.clientX,startWidth:n.current.getCurrent(),pointerId:m.pointerId};try{r.setPointerCapture(m.pointerId)}catch{}document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),m.preventDefault()}return r.addEventListener("pointerdown",a),()=>{if(r.removeEventListener("pointerdown",a),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),o){try{r.releasePointerCapture(o.pointerId)}catch{}document.body.style.cursor="",document.body.style.userSelect=""}}},[]),i("div",{ref:t,class:`resizer resizer-${e.side}`,role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/Resizer.tsx",lineNumber:83,columnNumber:5},this)}const nt=I(!1),Zt=I("doc"),Pt=G("mdview-search-case",!1),Tt=G("mdview-search-word",!1),Lt=G("mdview-search-regex",!1),Xs=Pt.signal,Ys=Tt.signal,Qs=Lt.signal;function Zs(){Pt.set(!Pt.signal.value)}function ei(){Tt.set(!Tt.signal.value)}function ti(){Lt.set(!Lt.signal.value)}function mt(e="doc"){Zt.value=e,nt.value=!0}function pe(){nt.value=!1}function ni(e){Zt.value=e}function Pn(e,t){let n=null,r=null;const o=((...s)=>{r=s,n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null;const l=r;r=null,l&&e(...l)},t)});return o.cancel=()=>{n!==null&&(clearTimeout(n),n=null),r=null},o.flush=()=>{if(n===null)return;clearTimeout(n),n=null;const s=r;r=null,s&&e(...s)},o}async function ri(e,t,n){const r=new URLSearchParams({q:e});t.caseSensitive&&r.set("case","1"),t.wholeWord&&r.set("word","1"),t.regex&&r.set("regex","1");const o=await fetch(`/api/search?${r.toString()}`,{signal:n});if(!o.ok)throw new Error(`HTTP ${o.status}`);return await o.json()}const oi={caseSensitive:!1,wholeWord:!1,regex:!1};function si(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ii(e,t){if(!e)return{test:()=>null,matchAll:()=>[],matchAllWithBudget:()=>({matches:[],truncated:!1}),query:e,valid:!0};let n;if(t.regex)try{n=new RegExp(e,t.caseSensitive?"g":"gi")}catch{return{test:()=>null,matchAll:()=>[],matchAllWithBudget:()=>({matches:[],truncated:!1}),query:e,valid:!1}}else{let r=si(e);t.wholeWord&&(r=`\\b${r}\\b`),n=new RegExp(r,t.caseSensitive?"g":"gi")}return{query:e,valid:!0,test(r){return n.lastIndex=0,n.exec(r)},matchAll(r){n.lastIndex=0;const o=[];let s;for(;(s=n.exec(r))!==null;){if(s[0].length===0){n.lastIndex++;continue}o.push({index:s.index,length:s[0].length})}return o},matchAllWithBudget(r,o){n.lastIndex=0;const s=[],l=performance.now()+o;let a;for(;(a=n.exec(r))!==null;){if(a[0].length===0){n.lastIndex++;continue}if(s.push({index:a.index,length:a[0].length}),performance.now()>l)return{matches:s,truncated:!0}}return{matches:s,truncated:!1}}}}const rt="search-hit",At="is-active";function _e(e){e.querySelectorAll(`mark.${rt}`).forEach(n=>{const r=n.parentNode;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);r.removeChild(n),r.normalize()}})}function li(e){let t=e.parentNode;for(;t;){if(t instanceof HTMLElement&&t.tagName==="MARK"&&t.classList.contains(rt))return!0;t=t.parentNode}return!1}function ai(e,t,n=oi){if(!t)return[];const r=ii(t,n);if(!r.valid)return[];const o=[],s=e.querySelector(".markdown-content")??e,l=document.createTreeWalker(s,NodeFilter.SHOW_TEXT,{acceptNode(m){if(!m.nodeValue||li(m))return NodeFilter.FILTER_REJECT;const c=m.parentElement;return!c||c.closest(".heading-anchor, .copy-btn, .external-icon, .search-bar")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let a=l.nextNode();for(;a;){const m=a.nodeValue??"";for(const c of r.matchAll(m))o.push({node:a,start:c.index,end:c.index+c.length});a=l.nextNode()}return o}function ci(e,t){const n=[],r=new Map;e.forEach(s=>{const l=r.get(s.node)??[];l.push(s),r.set(s.node,l)});const o=new Map;return e.forEach((s,l)=>{o.set(s,l)}),r.forEach((s,l)=>{var d;s.sort((u,h)=>u.start-h.start);let a=0;const m=l.parentNode;if(!m)return;const c=document.createDocumentFragment();s.forEach(u=>{u.start>a&&c.appendChild(document.createTextNode(l.nodeValue.slice(a,u.start)));const h=document.createElement("mark");h.className=rt;const f=o.get(u);f===t&&h.classList.add(At),h.dataset.hit=String(f),h.textContent=l.nodeValue.slice(u.start,u.end),c.appendChild(h),n.push(h),a=u.end}),a<(((d=l.nodeValue)==null?void 0:d.length)??0)&&c.appendChild(document.createTextNode(l.nodeValue.slice(a))),m.replaceChild(c,l)}),n}function ui(e,t){const n=e.querySelectorAll(`mark.${rt}`);let r=null;return n.forEach(o=>{Number(o.dataset.hit??-1)===t?(o.classList.add(At),r=o):o.classList.remove(At)}),r}const mi=250,di=150;function hi({scroller:e,fileTrigger:t,onOpenFile:n}){const[r,o]=K(""),s=Zt.value,l=Xs.value,a=Ys.value,m=Qs.value,c=O(null),d=z([]),u=z(0),h=z(0),f=z(null),p=z(!1),v=z(null),_=z(0);y(()=>{var g,U;(g=c.current)==null||g.focus(),(U=c.current)==null||U.select()},[]);const k=F(()=>Pn((g,U,X)=>{_e(g);const ne=ai(g,U,X);d.value=ne,u.value=0,ne.length>0?(ci(ne,0),h.value=g.querySelectorAll("mark.search-hit").length,requestAnimationFrame(()=>{const W=g.querySelector("mark.search-hit.is-active");W&&(Ct(W),W.scrollIntoView({behavior:"smooth",block:"center"}))})):h.value=0},di),[]);y(()=>{if(s==="doc"&&e){if(!r.trim()){k.cancel(),_e(e),d.value=[],u.value=0,h.value=0;return}return k(e,r,{caseSensitive:l,wholeWord:a,regex:m}),()=>k.cancel()}},[r,s,e,t,l,a,m]),y(()=>{if(s!=="doc"||!e||d.value.length===0)return;const g=ui(e,u.value);g&&(Ct(g),g.scrollIntoView({behavior:"smooth",block:"center"}))},[u.value,s,e,d.value.length]);const b=O(null),T=F(()=>Pn((g,U)=>{var ne;(ne=b.current)==null||ne.abort();const X=new AbortController;b.current=X,(async()=>{try{const W=await ri(g,U,X.signal);if(X.signal.aborted)return;f.value=W,v.value=null,_.value=0}catch(W){if(W.name==="AbortError")return;v.value=W.message}finally{b.current===X&&(b.current=null),X.signal.aborted||(p.value=!1)}})()},mi),[]);y(()=>{var g;if(s==="folder"){if(!r.trim()){T.cancel(),(g=b.current)==null||g.abort(),b.current=null,f.value=null,v.value=null,p.value=!1;return}return p.value=!0,T(r.trim(),{caseSensitive:l,wholeWord:a,regex:m}),()=>{var U;T.cancel(),(U=b.current)==null||U.abort(),b.current=null}}},[r,s,l,a,m]),y(()=>()=>{e&&_e(e)},[e]),y(()=>{s!=="doc"&&e&&_e(e)},[s,e]);function A(){if(s==="doc"){if(d.value.length===0)return;u.value=(u.value+1)%d.value.length}else{const g=dt(f.value);if(g.length===0)return;_.value=(_.value+1)%g.length}}function H(){if(s==="doc"){if(d.value.length===0)return;u.value=(u.value-1+d.value.length)%d.value.length}else{const g=dt(f.value);if(g.length===0)return;_.value=(_.value-1+g.length)%g.length}}function V(){const U=dt(f.value)[_.value];U&&(n(U.relPath),pe())}function N(g){g!==s&&ni(g)}function x(g){g.key==="Escape"?(g.preventDefault(),pe()):g.key==="Tab"?(g.preventDefault(),N(s==="doc"?"folder":"doc")):g.key==="Enter"?(g.preventDefault(),s==="doc"?g.shiftKey?H():A():V()):g.key==="ArrowDown"?(g.preventDefault(),A()):g.key==="ArrowUp"&&(g.preventDefault(),H())}return i("div",{class:"search-bar",role:"search","aria-label":"Find",children:[i("div",{class:"search-scope",role:"tablist","aria-label":"Search scope",children:[i("button",{type:"button",role:"tab","aria-selected":s==="doc",class:`scope-pill${s==="doc"?" is-active":""}`,"data-tooltip":"Search in document (Tab)","data-tooltip-side":"top",onClick:()=>N("doc"),tabIndex:-1,children:"Doc"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:253,columnNumber:9},this),i("button",{type:"button",role:"tab","aria-selected":s==="folder",class:`scope-pill${s==="folder"?" is-active":""}`,"data-tooltip":"Search across folder (⇧⌘F)","data-tooltip-side":"top",onClick:()=>N("folder"),tabIndex:-1,children:"Folder"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:265,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:252,columnNumber:7},this),i("input",{ref:c,type:"search",class:"search-input",placeholder:s==="doc"?"Find in document":"Find in folder",value:r,onInput:g=>o(g.target.value),onKeyDown:x,"aria-label":"Search query"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:278,columnNumber:7},this),i("div",{class:"search-options",role:"group","aria-label":"Search options",children:[i("button",{type:"button",class:`search-opt${l?" is-on":""}`,"aria-pressed":l,title:"Match case",onClick:Zs,tabIndex:-1,children:"Aa"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:289,columnNumber:9},this),i("button",{type:"button",class:`search-opt${a?" is-on":""}`,"aria-pressed":a,title:"Whole word",onClick:ei,tabIndex:-1,children:"ab"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:299,columnNumber:9},this),i("button",{type:"button",class:`search-opt${m?" is-on":""}`,"aria-pressed":m,title:"Regular expression",onClick:ti,tabIndex:-1,children:".*"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:309,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:288,columnNumber:7},this),i("span",{class:"search-count","aria-live":"polite",children:fi(s,r.trim(),u.value,h.value,p.value,f.value)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:320,columnNumber:7},this),i("button",{type:"button",class:"search-btn",onClick:H,"aria-label":"Previous match",title:"Previous (↑ / Shift+Enter)",children:"↑"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:330,columnNumber:7},this),i("button",{type:"button",class:"search-btn",onClick:A,"aria-label":"Next match",title:"Next (↓ / Enter)",children:"↓"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:339,columnNumber:7},this),i("button",{type:"button",class:"search-btn search-close",onClick:pe,"aria-label":"Close search",title:"Close (Esc)",children:"×"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:348,columnNumber:7},this),s==="folder"&&i(gi,{state:f.value,loading:p.value,error:v.value,query:r.trim(),activeIndex:_.value,onHover:g=>_.value=g,onPick:g=>{_.value=g,V()}},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:359,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:251,columnNumber:5},this)}function dt(e){if(!e)return[];const t=[];for(const n of e.results)for(const r of n.hits)t.push({relPath:n.relPath,fileTotal:n.total,fileTruncated:n.truncated,hit:r});return t}function pi(e){if(e.results.length===0)return"No matches";const t=e.results.reduce((o,s)=>o+s.total,0),n=e.results.length===1?"file":"files",r=e.truncated?"+":"";return`${t}${r} hits in ${e.results.length} ${n}`}function fi(e,t,n,r,o,s){return e==="doc"?t?r===0?"No matches":`${Math.min(n+1,r)} / ${r}`:"":o?"…":s?pi(s):""}function gi({state:e,loading:t,error:n,query:r,activeIndex:o,onHover:s,onPick:l}){if(!r)return null;if(t&&!e)return i("div",{class:"search-results",children:i("div",{class:"search-empty",children:"Searching…"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:440,columnNumber:40},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:440,columnNumber:12},this);if(n)return i("div",{class:"search-results",children:i("div",{class:"search-empty",children:["Error: ",n]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:443,columnNumber:40},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:443,columnNumber:12},this);if(!e||e.results.length===0)return i("div",{class:"search-results",children:i("div",{class:"search-empty",children:"No matches"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:446,columnNumber:40},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:446,columnNumber:12},this);let a=0;return i("div",{class:"search-results",children:[e.results.map(m=>i("section",{class:"search-file-group",children:[i("header",{class:"search-file-head",children:[i("span",{class:"search-file-path",children:m.relPath},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:454,columnNumber:13},this),i("span",{class:"search-file-count",children:[m.total,m.truncated?"+":""," hits"]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:455,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:453,columnNumber:11},this),i("ul",{children:m.hits.map(c=>{const d=a++;return i("li",{class:`search-hit-row${d===o?" is-active":""}`,onMouseEnter:()=>s(d),onClick:()=>l(d),children:[i("span",{class:"search-hit-line",children:["L",c.line]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:470,columnNumber:19},this),i("span",{class:"search-hit-snippet",children:vi(c.snippet,c.highlight)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:471,columnNumber:19},this)]},`${m.relPath}:${c.line}:${c.col}`,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:464,columnNumber:17},this)})},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:459,columnNumber:11},this)]},m.relPath,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:452,columnNumber:9},this)),e.truncated&&i("div",{class:"search-empty",children:"More results truncated — refine your query."},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:481,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:450,columnNumber:5},this)}function vi(e,t){const[n,r]=t;return i(ee,{children:[i("span",{children:e.slice(0,n)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:491,columnNumber:7},this),i("mark",{class:"search-hit",children:e.slice(n,r)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:492,columnNumber:7},this),i("span",{children:e.slice(r)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:493,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/SearchBar.tsx",lineNumber:490,columnNumber:5},this)}const bi=typeof navigator<"u"&&/mac/i.test(navigator.platform||navigator.userAgent),re=bi?"⌘":"Ctrl";function S(e){return e.metaKey||e.ctrlKey}function Tn(e,t){const n=tt(e.outline).map(o=>o.id);if(n.length===0)return;const r=R.value;if(t===1){const o=r?n.indexOf(r):-1,s=n[Math.min(o+1,n.length-1)];s&&e.onJumpHeading(s)}else{const o=r?n.indexOf(r):n.length,s=n[Math.max(o-1,0)];s&&e.onJumpHeading(s)}}function Ln(e){var l;const t=le.value;if(!t)return null;const n=ar(t.tree);if(n.length===0)return null;const r=Qe.value,o=r?n.findIndex(a=>a.relPath===r):-1;if(o<0)return((l=n[0])==null?void 0:l.relPath)??null;const s=o+e;return s<0||s>=n.length?null:n[s].relPath}function An(e){const t=be.value;t&&t.scrollBy({top:e*(t.clientHeight/2),behavior:"smooth"})}let Le=0;const Ni=600,Kr=[{id:"palette",group:"Find",label:"Switch file (quick switcher)",displayKeys:[re,"P"],whenTyping:"allow",match:e=>S(e)&&e.key.toLowerCase()==="p",run:()=>ao()},{id:"search-doc-meta",group:"Find",label:"Open in-doc search",displayKeys:[re,"F"],whenTyping:"allow",match:e=>S(e)&&!e.shiftKey&&e.key.toLowerCase()==="f",run:()=>mt("doc")},{id:"search-folder-meta",group:"Find",label:"Open folder-wide search",displayKeys:[re,"⇧","F"],whenTyping:"allow",match:e=>S(e)&&e.shiftKey&&e.key.toLowerCase()==="f",run:()=>mt("folder")},{id:"search-doc-slash",group:"Find",label:"Open search (no modifier)",displayKeys:["/"],whenTyping:"block",match:e=>!S(e)&&e.key==="/",run:()=>mt("doc")},{id:"shortcuts-panel",group:"View",label:"Show shortcuts panel",displayKeys:["?"],whenTyping:"block",match:e=>!S(e)&&e.key==="?",run:()=>Pr()},{id:"toggle-tree",group:"View",label:"Toggle file tree",displayKeys:[re,"B"],whenTyping:"allow",match:e=>S(e)&&e.key.toLowerCase()==="b",run:()=>Se()},{id:"toggle-outline",group:"View",label:"Toggle outline",displayKeys:[re,"."],whenTyping:"allow",match:e=>S(e)&&e.key===".",run:()=>Ce()},{id:"toggle-theme",group:"View",label:"Toggle theme",displayKeys:[re,"\\"],whenTyping:"allow",match:e=>S(e)&&e.key==="\\",run:()=>Ur()},{id:"toggle-focus",group:"View",label:"Toggle focus mode",displayKeys:["f"],whenTyping:"block",match:e=>!S(e)&&!e.shiftKey&&e.key==="f",run:()=>dr()},{id:"toggle-minimap",group:"View",label:"Toggle minimap",displayKeys:["m"],whenTyping:"block",match:e=>!S(e)&&!e.shiftKey&&e.key==="m",run:()=>hr()},{id:"toggle-wide-layout",group:"View",label:"Toggle wide layout",displayKeys:["w"],whenTyping:"block",match:e=>!S(e)&&!e.shiftKey&&e.key==="w",run:()=>pr()},{id:"expand-all-sections",group:"View",label:"Expand all sections",displayKeys:["e"],whenTyping:"block",match:e=>!S(e)&&!e.shiftKey&&e.key==="e",run:()=>Oo()},{id:"collapse-all-sections",group:"View",label:"Collapse all sections",displayKeys:["⇧","E"],whenTyping:"block",match:e=>!S(e)&&e.shiftKey&&e.key==="E",run:()=>Ro()},{id:"next-heading",group:"Navigation",label:"Next heading",displayKeys:["j"],whenTyping:"block",match:e=>!S(e)&&e.key==="j",run:e=>Tn(e,1)},{id:"prev-heading",group:"Navigation",label:"Previous heading",displayKeys:["k"],whenTyping:"block",match:e=>!S(e)&&e.key==="k",run:e=>Tn(e,-1)},{id:"doc-top",group:"Navigation",label:"Top of document (gg)",displayKeys:["g","g"],whenTyping:"block",match:e=>{if(S(e)||e.shiftKey||e.key!=="g")return!1;const t=performance.now();return t-Le<Ni?(Le=0,!0):(Le=t,!1)},run:()=>{const e=be.value;e&&e.scrollTo({top:0,behavior:"smooth"})}},{id:"doc-bottom",group:"Navigation",label:"Bottom of document",displayKeys:["⇧","G"],whenTyping:"block",match:e=>!S(e)&&e.shiftKey&&e.key==="G",run:()=>{const e=be.value;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}},{id:"next-file",group:"Navigation",label:"Next file",displayKeys:["⇧","L"],whenTyping:"block",match:e=>!S(e)&&e.shiftKey&&e.key==="L",run:e=>{const t=Ln(1);t&&e.navigate(t)}},{id:"prev-file",group:"Navigation",label:"Previous file",displayKeys:["⇧","H"],whenTyping:"block",match:e=>!S(e)&&e.shiftKey&&e.key==="H",run:e=>{const t=Ln(-1);t&&e.navigate(t)}},{id:"next-same-level",group:"Navigation",label:"Next heading at same level",displayKeys:["]"],whenTyping:"block",match:e=>!S(e)&&e.key==="]",run:e=>{const t=En(e.outline,R.value,1);t&&e.onJumpHeading(t)}},{id:"prev-same-level",group:"Navigation",label:"Previous heading at same level",displayKeys:["["],whenTyping:"block",match:e=>!S(e)&&e.key==="[",run:e=>{const t=En(e.outline,R.value,-1);t&&e.onJumpHeading(t)}},{id:"half-page-down",group:"Navigation",label:"Half page down",displayKeys:["Ctrl","D"],whenTyping:"block",match:e=>e.ctrlKey&&!e.metaKey&&!e.shiftKey&&e.key.toLowerCase()==="d",run:()=>An(1)},{id:"half-page-up",group:"Navigation",label:"Half page up",displayKeys:["Ctrl","U"],whenTyping:"block",match:e=>e.ctrlKey&&!e.metaKey&&!e.shiftKey&&e.key.toLowerCase()==="u",run:()=>An(-1)}],yi=[{id:"esc-close",group:"Navigation",label:"Close search / lightbox / panel",displayKeys:["Esc"],match:()=>!1,run:()=>{}},{id:"enter-next",group:"Find",label:"Next match (in search)",displayKeys:["Enter"],match:()=>!1,run:()=>{}},{id:"shift-enter-prev",group:"Find",label:"Previous match (in search)",displayKeys:["⇧","Enter"],match:()=>!1,run:()=>{}}];function $n(e){e.key!=="g"&&(Le=0)}const Mn=["Navigation","Find","View"];function ki(e){var n;const t=new Map;for(const r of Mn)t.set(r,[]);for(const r of e)(n=t.get(r.group))==null||n.push(r);return Mn.map(r=>({heading:r,items:t.get(r)??[]}))}function _i(){const e=et.value,t=F(()=>ki([...Kr,...yi]),[]);return y(()=>{if(!e)return;function n(r){r.key==="Escape"&&Pe()}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e]),e?i("div",{class:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",onClick:Pe,children:i("div",{class:"shortcuts-panel",onClick:n=>n.stopPropagation(),children:[i("div",{class:"shortcuts-head",children:[i("span",{class:"shortcuts-eyebrow",children:"Keyboard shortcuts"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:47,columnNumber:11},this),i("button",{type:"button",class:"shortcuts-close","aria-label":"Close shortcuts panel",onClick:Pe,children:"×"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:48,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:46,columnNumber:9},this),i("div",{class:"shortcuts-body",children:t.filter(n=>n.items.length>0).map(n=>i("section",{class:"shortcuts-group",children:[i("h3",{class:"shortcuts-group-title",children:n.heading},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:60,columnNumber:15},this),i("ul",{children:n.items.map(r=>i("li",{children:[i("span",{class:"shortcut-label",children:r.label},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:64,columnNumber:21},this),i("span",{class:"shortcut-keys",children:r.displayKeys.map((o,s)=>i("span",{children:[s>0&&i("span",{class:"shortcut-plus","aria-hidden":!0,children:"+"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:68,columnNumber:37},this),i("kbd",{children:o},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:69,columnNumber:27},this)]},`${o}-${s}`,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:67,columnNumber:25},this))},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:65,columnNumber:21},this)]},r.id,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:63,columnNumber:19},this))},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:61,columnNumber:15},this)]},n.heading,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:59,columnNumber:13},this))},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:57,columnNumber:9},this),i("div",{class:"shortcuts-foot",children:["Press ",i("kbd",{children:"Esc"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:80,columnNumber:17},this)," or click outside to close"]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:79,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:45,columnNumber:7},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/components/ShortcutsPanel.tsx",lineNumber:38,columnNumber:5},this):null}const xi=4;function wi(e,t){const n=xi;y(()=>{const r=e.current;if(!r)return;function o(s){s.altKey&&(s.preventDefault(),r.scrollBy({top:s.deltaY*n,left:s.deltaX*n,behavior:"auto"}))}return r.addEventListener("wheel",o,{passive:!1}),()=>{r.removeEventListener("wheel",o)}},[e,n])}const j=I(null),ze=I(null),$t=I(!1);async function Vr(e){$t.value=!0,ze.value=null;try{const t=e?`/api/file?path=${encodeURIComponent(e)}`:"/api/file",n=await fetch(t);if(!n.ok){const r=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(r.error??`HTTP ${n.status}`)}j.value=await n.json()}catch(t){ze.value=t.message,j.value=null}finally{$t.value=!1}}function Di(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||e.isContentEditable}function Ui(e){return e.key!=="Escape"?!1:Ze.value?(Ie(),e.preventDefault(),!0):Xe.value?(Ue(),e.preventDefault(),!0):et.value?(Pe(),e.preventDefault(),!0):nt.value?(pe(),e.preventDefault(),!0):!1}function Si(e){y(()=>{const t={outline:e.outline,onJumpHeading:e.onJumpHeading,navigate:e.navigate};function n(r){if(Ui(r))return;const o=Di(r.target);for(const s of Kr)if(!(o&&s.whenTyping==="block")&&s.match(r)){r.preventDefault(),s.run(t),$n(r);return}$n(r)}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e.outline,e.onJumpHeading,e.navigate])}function Ci(e){y(()=>{const t=new EventSource("/api/watch"),n=r=>{try{const o=JSON.parse(r.data);e(o)}catch{}};return t.addEventListener("change",n),t.addEventListener("add",n),t.addEventListener("unlink",n),t.addEventListener("config",n),()=>t.close()},[e])}function Ei({currentPath:e,scrollerRef:t}){const n=Xn(r=>{var o;if(r.kind==="change"&&r.relPath===e){const s=((o=t.current)==null?void 0:o.scrollTop)??0;Vr(e).then(()=>{requestAnimationFrame(()=>{t.current&&(t.current.scrollTop=s)})});return}(r.kind==="add"||r.kind==="unlink"||r.kind==="config")&&lr()},[e,t]);Ci(n)}let oe=null,Mt=[],Y=null,Hn=null;function Wr(){return typeof window>"u"||window.parent===window?!1:new URLSearchParams(window.location.search).get("embed")==="vscode"}function Ht(e){if(oe===null){Mt.push(e);return}window.parent.postMessage(e,oe)}function Ii(e){if(Y=e,Hn!==null)return;const t=n=>{if(oe===null){if(n.source===window.parent&&n.data!==null&&typeof n.data=="object"&&n.data.type==="mdview/init"){oe=n.origin;for(const r of Mt)window.parent.postMessage(r,oe);Mt=[],Y==null||Y(n.data)}return}n.origin===oe&&(n.data===null||typeof n.data!="object"||typeof n.data.type!="string"||Y==null||Y(n.data))};Hn=t,window.addEventListener("message",t)}function zr(e){for(const t of e){if(t.type==="file"&&t.isMarkdown)return t.relPath;if(t.type==="dir"&&t.children){const n=zr(t.children);if(n)return n}}return null}function Pi(){var V;is(),Hs();const e=co(),{currentPath:t,setCurrentPath:n,navigate:r}=Mo(),o=Wr(),s=O(null),l=wo.value,a=Do.value,m=gn.value,c=vn.value,d=mr.value;y(()=>{const N=le.value;if(N){if(N.root.rootKind==="file"){n(N.root.rootRelPath);return}if(t===null){const x=zr(N.tree);x&&n(x)}}},[e,t]),y(()=>{Vr(t)},[t]),y(()=>{pe()},[t]),y(()=>{const N=j.value;let x=null;if(N){if(N.title)x=N.title;else if(t){const g=t.lastIndexOf("/");x=g>=0?t.slice(g+1):t}}document.title=x?`${x} | mdview`:"mdview"},[j.value,t]),y(()=>{if(!j.value||!s.current)return;const N=window.location.hash.slice(1);N?requestAnimationFrame(()=>{lt(N);const x=document.getElementById(N);x==null||x.scrollIntoView({behavior:"auto",block:"start"})}):s.current.scrollTop=0},[j.value]),ko(s.current),y(()=>{Ks(s.current)},[s.current]),y(()=>{d?document.documentElement.dataset.wide="1":delete document.documentElement.dataset.wide},[d]),Ei({currentPath:t,scrollerRef:s}),Si({outline:((V=j.value)==null?void 0:V.outline)??[],onJumpHeading:N=>f(N),navigate:N=>r(N)}),wi(s);const u=N=>r(N),h=(N,x)=>{if(o&&N){Ht({type:"mdview/internal-link-clicked",relPath:N,fromFile:t??""});return}if(r(N,x),x){const g=x.slice(1);requestAnimationFrame(()=>{var U;lt(g),(U=document.getElementById(g))==null||U.scrollIntoView({behavior:"smooth"})})}},f=N=>{history.replaceState(history.state,"",`#${N}`),vo(N),lt(N);const x=document.getElementById(N);if(x==null||x.scrollIntoView({behavior:"smooth"}),o&&x){const g=x.getAttribute("data-source-line"),U=g!==null?parseInt(g,10):null;U!==null&&!Number.isNaN(U)&&Ht({type:"mdview/heading-clicked",line:U,file:t??""})}},p=N=>{var x;if(N===null){history.replaceState(history.state,"",window.location.pathname+window.location.search),R.value=null,(x=s.current)==null||x.scrollTo({top:0,behavior:"smooth"});return}f(N)},v=j.value,_=le.value,k=wt.value,b=["app-shell",l?"tree-collapsed":"",a?"outline-collapsed":"",k?"has-minimap":""].filter(Boolean).join(" "),T=`--tree-width:${m}px;--outline-width:${c}px`,A=()=>{Co(),l||Se()},H=()=>{Eo(),a||Ce()};return i("div",{class:b,style:T,children:[!o&&i("aside",{class:"pane-tree","aria-label":"File tree",children:l?i("button",{class:"rail-btn","aria-label":"Expand file tree",title:"Expand file tree",onClick:Se,children:[i(ws,{size:15},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:221,columnNumber:15},this),i("span",{class:"rail-label",children:"FILES"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:222,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:215,columnNumber:13},this):_&&i(As,{tree:_.tree,currentPath:t,onSelect:u,onCollapse:Se},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:226,columnNumber:15},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:213,columnNumber:9},this),!o&&!l&&i(In,{side:"left",ariaLabel:"Resize file tree",getCurrent:()=>gn.value,onResize:Uo,collapseAt:fn,onCollapse:A,min:Be,max:Ke},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:238,columnNumber:9},this),i("header",{class:"pane-header",children:[i(Rs,{outline:(v==null?void 0:v.outline)??[],fileName:(v==null?void 0:v.title)??null,onJumpHeading:p},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:251,columnNumber:9},this),i(Gs,{scroller:s.current,trigger:v},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:256,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:250,columnNumber:7},this),i("main",{class:"pane-main",ref:s,children:[nt.value&&i(hi,{scroller:s.current,fileTrigger:v,onOpenFile:u},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:261,columnNumber:11},this),$t.value&&!v&&i(fs,{},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:267,columnNumber:40},this),ze.value&&i("div",{class:"status status-error",children:["Error: ",ze.value]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:268,columnNumber:29},this),v&&i(ps,{file:v,onInternalNavigate:h},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:269,columnNumber:18},this),v&&wt.value&&i(Ws,{outline:v.outline},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:270,columnNumber:41},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:259,columnNumber:7},this),i(Bs,{},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:273,columnNumber:7},this),i(_i,{},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:274,columnNumber:7},this),i(po,{currentPath:t,onSelect:u},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:275,columnNumber:7},this),!a&&i(In,{side:"right",ariaLabel:"Resize outline",getCurrent:()=>vn.value,onResize:So,collapseAt:fn,onCollapse:H,min:Be,max:Ke},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:278,columnNumber:9},this),i("aside",{class:"pane-outline","aria-label":"Outline",children:a?i("button",{class:"rail-btn","aria-label":"Expand outline",title:"Expand outline",onClick:Ce,children:[i(Us,{size:15},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:298,columnNumber:13},this),i("span",{class:"rail-label",children:"OUTLINE"},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:299,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:292,columnNumber:11},this):v&&i(Js,{nodes:v.outline,onJump:f,onCollapse:Ce},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:303,columnNumber:13},this)},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:290,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/App.tsx",lineNumber:211,columnNumber:5},this)}const Ti=new Set(["mdview/init","mdview/set-file","mdview/cursor-changed","mdview/palette-changed"]);function Li(e){return e.length===0||e.startsWith("/")?!1:!e.split("/").some(t=>t==="..")}function Ai(e){if(Ti.has(e.type))switch(e.type){case"mdview/init":{Ht({type:"mdview/ready"});break}case"mdview/set-file":{const t=e.relPath;typeof t=="string"&&Li(t)&&(Ee(t),yr(t));break}case"mdview/cursor-changed":{const t=e.line;if(typeof t!="number")break;requestAnimationFrame(()=>{const n=Array.from(document.querySelectorAll(".markdown-content :is(h1,h2,h3,h4,h5,h6)[data-source-line]"));let r=null;for(const o of n){const s=parseInt(o.getAttribute("data-source-line")??"",10);!Number.isNaN(s)&&s<=t&&(r=o)}r==null||r.scrollIntoView({behavior:"smooth",block:"start"})});break}case"mdview/palette-changed":{const t=e.palette;typeof t=="string"&&Je.includes(t)&&Hr(t);break}}}Wr()&&Ii(Ai);const qr=document.getElementById("app");if(!qr)throw new Error("Missing #app");eo(i(Pi,{},void 0,!1,{fileName:"/Users/hardikgurg/Desktop/prototypes/md-to-html/src/client/main.tsx",lineNumber:91,columnNumber:8},void 0),qr);export{Qt as _};
|
package/dist/client/assets/{infoDiagram-5YYISTIA-BAp5orio.js → infoDiagram-5YYISTIA-D81JEsUe.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as a,l as s,I as o,e as i}from"./mermaid.core-
|
|
1
|
+
import{_ as a,l as s,I as o,e as i}from"./mermaid.core-BJg17JjK.js";import{p as g}from"./wardley-L42UT6IY-DVy2v9KS.js";import"./index-BCdIdRge.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=o(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as o,c as ot,N as ut,I as dt,al as yt,z as ft,k as pt,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-
|
|
1
|
+
import{_ as o,c as ot,N as ut,I as dt,al as yt,z as ft,k as pt,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-BJg17JjK.js";import"./index-BCdIdRge.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],B={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(N){i.length=i.length-2*N,p.length=p.length-N,n.length=n.length-N}o(F,"popStack");function j(){var N;return N=u.pop()||b.lex()||E,typeof N!="number"&&(N instanceof Array&&(u=N,N=u.pop()),N=s.symbols_[N]||N),N}o(j,"lex");for(var A,W,P,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?P=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),P=v[W]&&v[W][A]),typeof P>"u"||!P.length||!P[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(P[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(P[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[P[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(H,[w,S,I,C.yy,P[1],p,n].concat(R)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[P[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as gt}from"./chunk-FMBD7UC4-
|
|
1
|
+
import{g as gt}from"./chunk-FMBD7UC4-IM3YKAF3.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-UF3KQYdE.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as X,e as $t,z as Mt}from"./mermaid.core-BJg17JjK.js";import{d as it}from"./arc-ycQp8V_W.js";import"./index-BCdIdRge.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./mermaid.core-
|
|
1
|
+
import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./mermaid.core-BJg17JjK.js";import{g as Ne}from"./chunk-FMBD7UC4-IM3YKAF3.js";import"./index-BCdIdRge.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+Y.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],G.$=u[u.length-I],G._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(G._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(G,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(G.$),e.push(G._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core-
|
|
1
|
+
import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core-BJg17JjK.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
|