vzcode 0.71.0 → 0.73.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.
@@ -276,7 +276,7 @@ Did you specify these with the most recent transformation maps first?`);let I=C(
276
276
  `)+1)),R1(o)&&(o=o.substring(0,o.lastIndexOf(`
277
277
  `)),o.charAt(o.length-1)==="\r"&&(o=o.substring(0,o.length-1)))),o}function Jqe(e){return e.type==="Text"}function zqe(e,r){var n;const a=((n=r.attributes)!==null&&n!==void 0?n:[]).find(o=>o.name===e);return a&&a.value}function g9(e,r){const n=zqe(e,r);if(n!=null&&typeof n=="object"){const i=n.find(Jqe);if(i)return i.data}return null}function sh(e){const r=g9("lang",e)||g9("type",e);return r!=null?r.replace(/^text\//,""):null}function sG(e){const r=sh(e);return!(r&&jqe.includes(r))}function Hqe(e){const r=sh(e)||"";return["typescript","ts"].includes(r)}function Vqe(e){const r=sh(e)||"";return r.endsWith("json")||r.endsWith("importmap")}function Wqe(e){const r=sh(e)||"";return["less"].includes(r)}function Kqe(e){const r=sh(e)||"";return["sass","scss"].includes(r)}function Gqe(e){return e.type==="Element"&&e.name==="template"&&sh(e)==="pug"}function fT(e){return e!==!0&&e.length===1&&e[0].type==="MustacheTag"}function Xqe(e){return e!==!0&&e.length===1&&e[0].type==="AttributeShorthand"}function oG(e){if(Xqe(e.value))return!0;if(fT(e.value)){const r=e.value[0].expression;return r.type==="Identifier"&&r.name===e.name}return!1}function zs(e){return e.raw||e.data}function O1(e,r=1){return e.type==="Text"&&B1(zs(e),r)}function B1(e,r=1){return new RegExp(`^([\\t\\f\\r ]*\\n){${r}}`).test(e)}function b9(e,r=1){return e.type==="Text"&&R1(zs(e),r)}function R1(e,r=1){return new RegExp(`(\\n[\\t\\f\\r ]*){${r}}$`).test(e)}function L1(e){return e.type==="Text"&&/^\s/.test(zs(e))}function oh(e){return e.type==="Text"&&/\s$/.test(zs(e))}function M1(e){e.raw=e.raw&&e.raw.trimRight(),e.data=e.data&&e.data.trimRight()}function $1(e){e.raw=e.raw&&e.raw.trimLeft(),e.data=e.data&&e.data.trimLeft()}function Yqe(e,r){let n=e.findIndex(a=>!da(a)&&!N1(a,r));n=n===-1?e.length-1:n;let i=ZK((a,o)=>!da(a)&&(o===e.length-1&&a.type!=="Comment"||!N1(a,r)),e);i=i===-1?0:i;for(let a=0;a<=n;a++){const o=e[a];o.type==="Text"&&$1(o)}for(let a=e.length-1;a>=i;a--){const o=e[a];o.type==="Text"&&M1(o)}}function Qqe(e,r,n){if(!r)return!0;if(hu(e,n)||!P1(e))return!1;const i=e.children;if(i.length===0)return!0;if(n.htmlWhitespaceSensitivity==="ignore")return!1;const a=i[0];return!L1(a)}function Zqe(e,r,n){if(!r)return!0;if(hu(e,n)||!P1(e))return!1;const i=e.children;if(i.length===0)return!0;if(n.htmlWhitespaceSensitivity==="ignore")return!1;const a=i[i.length-1];return!oh(a)}function eUe(e,r){if(!nG(e)||!P1(e))return"none";const n=e.children;if(n.length===0)return"none";const i=n[0];if(O1(i))return"line";if(L1(i))return"space";const a=r.originalText.lastIndexOf("}",i.start);if(a>0&&i.start>a+1){const o=r.originalText.substring(a+1,i.start);if(o.trim()==="")return B1(o)?"line":"space"}return"none"}function tUe(e,r){if(!nG(e)||!P1(e))return"none";const n=e.children;if(n.length===0)return"none";const i=n[n.length-1];if(b9(i))return"line";if(oh(i))return"space";const a=r.originalText.indexOf("{",i.end);if(a>0&&i.end<a){const o=r.originalText.substring(i.end,a);if(o.trim()==="")return R1(o)?"line":"space"}return"none"}function rUe(e,r){return e.stack.some(i=>i.type==="Attribute"&&(!fT(i.value)||r.svelteStrictMode))}function uG(e,r,n){return pT(n)&&(!nUe(e,n)||iUe(r,n))}function nUe(e,r){return e.end===r.originalText.length?!1:!r.originalText.substring(e.end).match(/^\s/)}function iUe(e,r){const n=e.getParentNode();if(!n||!hu(n,r))return!1;const i=_T(n);return i[i.length-1]===e.getNode()}function aUe(e){e.module&&(e.module.comments=v9(e,e.module)),e.instance&&(e.instance.comments=v9(e,e.instance)),e.css&&(e.css.comments=v9(e,e.css))}function v9(e,r){const n=_T(e.html),i=[],a=[];if(!n.length)return[];let o=r,u=n.find(c=>c.end===o.start);for(;u;){if(u.type==="Comment"&&!dT(u)&&!I1(u))i.push(u),i.length!==a.length&&a.push({type:"Text",data:"",raw:"",start:-1,end:-1});else if(da(u))a.push(u);else break;o=u,u=n.find(c=>c.end===o.start)}a.length=i.length;for(const c of i)n.splice(n.indexOf(c),1);for(const c of a)n.splice(n.indexOf(c),1);return i.map((c,b)=>({comment:c,emptyLineAfter:zs(a[b]).split(`
278
278
  `).length>2})).reverse()}const{join:uh,line:Hs,group:Br,indent:mu,dedent:j1,softline:ol,hardline:Oi,fill:sUe,breakParent:q1,literalline:x9}=t_.builders;function D9(e){return/^\s*<!--\s*@(format|prettier)\W/.test(e)}let U1=!1,hT=!1,lh;function oUe(e,r,n){var i,a;const o=pT(r),u=e.getValue();if(!u)return"";if(_9(u))return uUe(u,r,e,n);const[c,b]=r.svelteStrictMode?['"{','}"']:["{","}"],h=()=>[c,Ia(e,n,"expression"),b],d=u;if((U1||hT&&!I1(d))&&(d.type!=="Text"||!da(d)))return U1&&(U1=!1),QK(r.originalText.slice(r.locStart(d),r.locEnd(d)).split(`
279
- `).map((g,D)=>D==0?[g]:[x9,g]));switch(d.type){case"Fragment":const g=d.children;if(g.length===0||g.every(da))return"";if(Zl(e))return Br(e.map(n,"children"));{Yqe(d.children,e);const C=d9([mT(e,n,r)],S=>k1(S)||typeof S=="string"&&S.trim()===""||S===q1);return C.every(S=>M_(S))?"":Br([...C,Oi])}case"Text":if(Zl(e)){let C=zs(d);const S=e.getParentNode();return S.type==="Attribute"?(S.name==="class"&&e.getParentNode(1).type==="Element"&&(C=C.replace(/([^ \t\n])(([ \t]+$)|([ \t]+(\r?\n))|[ \t]+)/g,(P,N,_,k,M,I)=>k?P:N+(M?I:" ")),C=C.replace(/([^ \t\n])[ \t]+$/,S.value.indexOf(d)===S.value.length-1?"$1":"$1 ")),Rqe(C,x9)):C}else{if(da(d)){const C=zs(d).trim().length<zs(d).length,S=/\n/.test(zs(d));return/\n\r?\s*\n\r?/.test(zs(d))?[Oi,Oi]:S?Oi:C?Hs:""}return sUe(pUe(d))}case"Element":case"InlineComponent":case"Slot":case"SlotTemplate":case"Window":case"Head":case"Title":{const C=!(d.name==="template"&&!sG(d)),S=d.children.every(ae=>da(ae)),P=d.name.toUpperCase()==="!DOCTYPE",N=r.originalText[d.end-2]==="/",_=S&&((d.type==="Element"&&!r.svelteStrictMode||d.type==="Head"||d.type==="InlineComponent"||d.type==="SlotTemplate"||d.type==="Title")&&N||d.type==="Slot"||d.type==="Window"||Eqe.indexOf(d.name)!==-1||P),k=e.map(w1(d,r,n),"attributes"),M=eG(d,r),I=d.type==="InlineComponent"&&d.expression?[M,"this=",...h()]:d.type==="Element"&&d.tag?[M,"this=",...typeof d.tag=="string"?[`"${d.tag}"`]:[c,Ia(e,n,"tag"),b]]:"";if(_)return Br(["<",d.name,mu(Br([I,...k,o||P?"":j1(Hs)])),o&&!P?" ":"",`${P?"":"/"}>`]);const L=d.children,U=L[0],J=L[L.length-1];let z;const Y=Qqe(d,C,r),j=Zqe(d,C,r);S?z=ec(e,r,d)&&d.children.length&&L1(d.children[0])&&!Zl(e)?()=>Hs:()=>o?ol:"":Zl(e)?z=()=>lUe(d,r.originalText,e,n):C?ec(e,r,d)&&!Zl(e)?z=()=>mT(e,n,r):z=()=>mT(e,n,r):z=()=>aG(d,r.originalText,!0);const re=["<",d.name,mu(Br([I,...k,Y&&!S?"":!o&&!Zl(e)?j1(ol):""]))];if(!C&&!S)return Br([...re,">",Br([Oi,z(),Oi]),`</${d.name}>`]);if(Y&&j){const ae=[ol,Br([">",z(),`</${d.name}`])],xe=S&&!o||uG(d,e,r);return Br([...re,Br(S?ae:mu(ae)),xe?"":ol,">"])}let se=ol,le=ol;if(Zl(e))se="",le="";else{let ae=!1;!Y&&U&&U.type==="Text"&&(O1(U)&&U!==J&&(!ec(e,r,d)||oh(J))?(se=Oi,le=Oi,ae=!0):ec(e,r,d)&&(se=Hs),$1(U)),!j&&J&&J.type==="Text"&&(ec(e,r,d)&&!ae&&(le=Hs),M1(J))}return Br(Y?[...re,mu([ol,Br([">",z()])]),le,`</${d.name}>`]:j?[...re,">",mu([se,Br([z(),`</${d.name}`])]),uG(d,e,r)?"":ol,">"]:S?[...re,">",z(),`</${d.name}>`]:[...re,">",mu([se,z()]),le,`</${d.name}>`])}case"Options":if(r.svelteSortOrder!=="none")throw new Error("Options tags should have been handled by prepareChildren");case"Body":case"Document":return Br(["<",d.name,mu(Br([...e.map(w1(d,r,n),"attributes"),o?"":j1(Hs)])),o?" ":"","/>"]);case"Document":return Br(["<",d.name,mu(Br([...e.map(w1(d,r,n),"attributes"),o?"":j1(Hs)])),o?" ":"","/>"]);case"Identifier":return d.name;case"AttributeShorthand":return d.expression.name;case"Attribute":{if(oG(d))return r.svelteAllowShorthand?["{",d.name,"}"]:r.svelteStrictMode?[d.name,'="{',d.name,'}"']:[d.name,"={",d.name,"}"];{if(d.value===!0)return[d.name];const C=!fT(d.value)||((i=r.svelteStrictMode)!==null&&i!==void 0?i:!1),S=lG(e,n,C,d);return C?[d.name,"=",'"',S,'"']:[d.name,"=",S]}}case"MustacheTag":return["{",Ia(e,n,"expression"),"}"];case"IfBlock":{const C=["{#if ",Ia(e,n,"expression"),"}",$_(e,n,r)];return d.else&&C.push(e.call(n,"else")),C.push("{/if}"),Br([C,q1])}case"ElseBlock":{const C=e.getParentNode();if(d.children.length===1&&d.children[0].type==="IfBlock"&&C.type!=="EachBlock"){const S=d.children[0],P=["{:else if ",e.map(N=>Ia(N,n,"expression"),"children")[0],"}",e.map(N=>$_(N,n,r),"children")[0]];return S.else&&P.push(e.map(N=>N.call(n,"else"),"children")[0]),P}return["{:else}",$_(e,n,r)]}case"EachBlock":{const C=["{#each ",Ia(e,n,"expression")," as",J1(d.context,r.originalText)];return d.index&&C.push(", ",d.index),d.key&&C.push(" (",Ia(e,n,"key"),")"),C.push("}",$_(e,n,r)),d.else&&C.push(e.call(n,"else")),C.push("{/each}"),Br([C,q1])}case"AwaitBlock":{const C=d.pending.children.some(_=>!da(_)),S=d.then.children.some(_=>!da(_)),P=d.catch.children.some(_=>!da(_));let N=[];return!C&&S?N.push(Br(["{#await ",Ia(e,n,"expression")," then",J1(d.value,r.originalText),"}"]),e.call(n,"then")):!C&&P?N.push(Br(["{#await ",Ia(e,n,"expression")," catch",J1(d.error,r.originalText),"}"]),e.call(n,"catch")):(N.push(Br(["{#await ",Ia(e,n,"expression"),"}"])),C&&N.push(e.call(n,"pending")),S&&N.push(Br(["{:then",J1(d.value,r.originalText),"}"]),e.call(n,"then"))),(C||S)&&P&&N.push(Br(["{:catch",J1(d.error,r.originalText),"}"]),e.call(n,"catch")),N.push("{/await}"),Br(N)}case"KeyBlock":{const C=["{#key ",Ia(e,n,"expression"),"}",$_(e,n,r)];return C.push("{/key}"),Br([C,q1])}case"ThenBlock":case"PendingBlock":case"CatchBlock":return $_(e,n,r);case"SnippetBlock":{const C=["{#snippet ",Ia(e,n,"expression")];return C.push("}",$_(e,n,r),"{/snippet}"),C}case"EventHandler":return["on:",d.name,d.modifiers&&d.modifiers.length?["|",uh("|",d.modifiers)]:"",d.expression?["=",...h()]:""];case"Binding":return["bind:",d.name,d.expression.type==="Identifier"&&d.expression.name===d.name&&r.svelteAllowShorthand?"":["=",...h()]];case"Class":return["class:",d.name,d.expression.type==="Identifier"&&d.expression.name===d.name&&r.svelteAllowShorthand?"":["=",...h()]];case"StyleDirective":const D=["style:",d.name,d.modifiers&&d.modifiers.length?["|",uh("|",d.modifiers)]:""];if(oG(d)||d.value===!0)return r.svelteAllowShorthand?[...D]:r.svelteStrictMode?[...D,'="{',d.name,'}"']:[...D,"={",d.name,"}"];{const C=!fT(d.value)||((a=r.svelteStrictMode)!==null&&a!==void 0?a:!1),S=lG(e,n,C,d);return C?[...D,"=",'"',S,'"']:[...D,"=",S]}case"Let":return["let:",d.name,!d.expression||d.expression.type==="Identifier"&&d.expression.name===d.name?"":["=",...h()]];case"DebugTag":return["{@debug",d.identifiers.length>0?[" ",uh(", ",e.map(n,"identifiers"))]:"","}"];case"Ref":return["ref:",d.name];case"Comment":{const C=qqe(e);if(dT(d)&&y9(d,e))hT=!0;else if(I1(d)&&y9(d,e))hT=!1;else{if(N1(d,e)||da(C)&&N1(C,e))return"";iG(d)&&(U1=!0)}return cG(d)}case"Transition":return[d.intro&&d.outro?"transition":d.intro?"in":"out",":",d.name,d.modifiers&&d.modifiers.length?["|",uh("|",d.modifiers)]:"",d.expression?["=",...h()]:""];case"Action":return["use:",d.name,d.expression?["=",...h()]:""];case"Animation":return["animate:",d.name,d.expression?["=",...h()]:""];case"RawMustacheTag":return["{@html ",Ia(e,n,"expression"),"}"];case"RenderTag":return["{@render ",Ia(e,n,"expression"),"}"];case"Spread":return["{...",Ia(e,n,"expression"),"}"];case"ConstTag":return["{@const ",Ia(e,n,"expression"),"}"]}throw console.error(JSON.stringify(d,null,4)),new Error("unknown node type: "+d.type)}function uUe(e,r,n,i){if(r.svelteSortOrder==="none"){const c={};e.module&&(c[e.module.end]=e.module),e.instance&&(c[e.instance.end]=e.instance),e.css&&(c[e.css.end]=e.css);const b=_T(e.html);for(let d=0;d<b.length;d++){const g=b[d];c[g.start]&&(b.splice(d,0,c[g.start]),delete c[g.start])}const h=n.call(i,"html");return r.insertPragma&&!D9(r.originalText)?["<!-- @format -->",Oi,h]:h}const a={options:[],scripts:[],markup:[],styles:[]};e.module&&a.scripts.push(n.call(i,"module")),e.instance&&a.scripts.push(n.call(i,"instance")),e.css&&a.styles.push(n.call(i,"css"));const o=n.call(i,"html");o&&a.markup.push(o),lh&&a.options.push(lh);const u=QK(Bqe(r.svelteSortOrder).map(c=>a[c]));if(U1=!1,hT=!1,lh=void 0,r.parentParser==="markdown"){const c=u[u.length-1];F1([c],k1)}return r.insertPragma&&!D9(r.originalText)?["<!-- @format -->",Oi,Br(u)]:Br([uh(Oi,u)])}function lG(e,r,n,i){const a=e.map(o=>o.call(r),"value");return!n||!KK.includes(i.name)?a:mu(Br(d9(a,k1)))}function $_(e,r,n){const i=e.getValue(),a=i.children;if(!a||a.length===0)return"";const o=eUe(i,n),u=tUe(i,n),c=o==="none"?"":u==="line"||o==="line"?Oi:Hs,b=u==="none"?"":u==="line"||o==="line"?Oi:Hs,h=a[0],d=a[a.length-1];return L1(h)&&$1(h),oh(d)&&M1(d),[mu([c,Br(mT(e,r,n))]),b]}function lUe(e,r,n,i){const a=[],o=e.children.length;for(let u=0;u<o;u++){const c=e.children[u];c.type==="Text"?r.substring(c.start,c.end).split(/\r?\n/).forEach((h,d)=>{d>0&&a.push(x9),a.push(h)}):a.push(n.call(i,"children",u))}return a}function mT(e,r,n){if(Zl(e))return e.map(r,"children");const i=cUe(e.getValue().children,e,r,n);if(e.getValue().children=i,i.length===0)return"";const a=[];let o=!1;for(let g=0;g<i.length;g++){const D=i[g];D.type==="Text"?d(g,D):hu(D,n)?h(g):ec(e,n,D)?b(g):(a.push(c(g)),o=!1)}return i.length>1&&i.some(g=>hu(g,n))&&a.push(q1),a;function c(g){return e.call(r,"children",g)}function b(g){o?a.push(Br([Hs,c(g)])):a.push(c(g)),o=!1}function h(g){const D=i[g-1];D&&!hu(D,n)&&(D.type!=="Text"||o||!oh(D))&&a.push(ol),a.push(c(g));const E=i[g+1];E&&(E.type!=="Text"||(!da(E)||i[g+2]&&ec(e,n,i[g+2]))&&!O1(E))&&a.push(ol),o=!1}function d(g,D){if(o=!1,g===0||g===i.length-1){a.push(c(g));return}const E=i[g-1],C=i[g+1];if(L1(D)&&!da(D)){if(ec(e,n,E)&&!O1(D)){$1(D);const S=a.pop();a.push(Br([S,Hs]))}hu(E,n)&&!O1(D)&&$1(D)}oh(D)&&(ec(e,n,C)&&!b9(D)&&(o=!E||!hu(E,n),M1(D)),hu(C,n)&&!b9(D,2)&&(o=!E||!hu(E,n),M1(D))),a.push(c(g))}}function cUe(e,r,n,i){let a;const o=[],u=pT(i);for(let d=0;d<e.length;d++){const g=e[d];if(!(g.type==="Text"&&zs(g)==="")&&!(da(g)&&N1(g,r))){if(i.svelteSortOrder!=="none"){if(h(g,d)){a=cG(g);const D=e[d+1];d+=D&&da(D)?1:0;continue}if(g.type==="Options"){b(g,d,r,n);continue}}o.push(g)}}const c=[];for(let d=0;d<o.length;d++){const g=o[d],D=o[d+1];g.type==="Text"&&D&&D.type==="Text"&&(g.raw+=D.raw,g.data+=D.data,d++),c.push(g)}return c;function b(d,g,D,E){lh=Br([["<",d.name,mu(Br([...D.map(w1(d,i,E),"children",g,"attributes"),u?"":j1(Hs)])),u?" ":"","/>"],Oi]),a&&(lh=Br([a,Oi,lh]))}function h(d,g){if(d.type!=="Comment"||I1(d)||dT(d))return!1;const D=e[g+1];if(D){if(da(D)){const E=e[g+2];return E&&E.type==="Options"}return D.type==="Options"}return!1}}function pUe(e){const r=zs(e),n=r.split(/[\t\n\f\r ]+/);let i=uh(Hs,n).filter(a=>a!=="");return B1(r)&&(i[0]=Oi),B1(r,2)&&(i=[Oi,...i]),R1(r)&&(i[i.length-1]=Oi),R1(r,2)&&(i=[...i,Oi]),i}function Ia(e,r,n){return e.call(r,n)}function J1(e,r){let n=ul(e);return e!=null&&e.typeAnnotation&&(n+=": "+r.slice(e.typeAnnotation.start,e.typeAnnotation.end)),n}function ul(e,r){if(e===null)return"";if(typeof e=="string")return" "+e;switch(e.type){case"ArrayExpression":case"ArrayPattern":return" ["+e.elements.map(ul).join(",").slice(1)+"]";case"AssignmentPattern":return ul(e.left)+" ="+ul(e.right);case"Identifier":return" "+e.name;case"Literal":return" "+e.raw;case"ObjectExpression":return" {"+e.properties.map(n=>ul(n,e)).join(",")+" }";case"ObjectPattern":return" {"+e.properties.map(ul).join(",")+" }";case"Property":return e.value.type==="ObjectPattern"||e.value.type==="ArrayPattern"?" "+e.key.name+":"+ul(e.value):e.value.type==="Identifier"&&e.key.name!==e.value.name||r&&r.type==="ObjectExpression"?ul(e.key)+":"+ul(e.value):ul(e.value);case"RestElement":return" ..."+e.argument.name}throw console.error(JSON.stringify(e,null,4)),new Error("unknown node type: "+e.type)}function cG(e){let r=e.data;return XK(r)&&(r=YK(r)),Br(["<!--",r,"-->"])}function yT(e,r,n,i){function a(o){return o instanceof n?o:new n(function(u){u(o)})}return new(n||(n=Promise))(function(o,u){function c(d){try{h(i.next(d))}catch(g){u(g)}}function b(d){try{h(i.throw(d))}catch(g){u(g)}}function h(d){d.done?o(d.value):a(d.value).then(c,b)}h((i=i.apply(e,r||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function gT(e,r,n=!1){const i=e.leadingComments,a=r.originalText.slice(r.locStart(i&&i[0]||e),r.locEnd(e));return!n||!XK(a)?a:YK(a)}const _Ue=/<[a-z]+((?:\s+[^=>'"\/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)|\s+[^=>'"\/]+)*\s*)>/im,dUe=/([^\s=]+)(?:=(?:(?:("|')([\s\S]*?)\2)|(?:([^>\s]+?)(?:\s|>|$))))?/gim;function pG(e){const[,r]=e.match(_Ue),n=[];let i;for(;i=dUe.exec(r);){const[a,o,u,c,b]=i,h=c||b,d=i.index;let g;if(!h)g=!0;else{let D=d+o.length;u&&(D+=2),g=[{type:"Text",data:h,start:D,end:D+h.length}]}n.push({type:"Attribute",name:o,value:g,start:d,end:d+a.length})}return n}const{builders:{group:C9,hardline:pp,softline:fUe,indent:_G,dedent:hUe,literalline:mUe},utils:{removeLines:yUe}}=t_,gUe=new Set(["Script","Style","Identifier","MemberExpression","CallExpression","ArrowFunctionExpression"]),bUe=new Set(["start","end","type"]);function vUe(e,r){return Object.keys(e).filter(n=>!r.has(n)&&!gUe.has(e.type)&&!bUe.has(n))}function xUe(e,r){var n,i,a,o,u,c,b,h,d,g,D;const E=e.getNode(),C=r;if(!C.locStart||!C.locEnd||!C.originalText)throw new Error("Missing required options");if(_9(E))return aUe(E),E.module&&(E.module.type="Script",E.module.attributes=pG(gT(E.module,C))),E.instance&&(E.instance.type="Script",E.instance.attributes=pG(gT(E.instance,C))),E.css&&(E.css.type="Style",E.css.content.type="StyleProgram"),null;const S=e.getParentNode(),P=()=>{var L;return S.expression?_p(S,(L=C.svelteStrictMode)!==null&&L!==void 0?L:!1,!1,!1,"expression"):void 0},N=L=>_p(S,!1,!0,!1,L);switch(S.type){case"IfBlock":case"ElseBlock":case"AwaitBlock":case"KeyBlock":N("expression");break;case"EachBlock":N("expression"),N("key");break;case"SnippetBlock":E===S.expression&&(S.expression.end=C.originalText.indexOf(")",(u=(i=(n=S.context)===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:(o=(a=S.parameters)===null||a===void 0?void 0:a[S.parameters.length-1])===null||o===void 0?void 0:o.end)!==null&&u!==void 0?u:S.expression.end)+1,S.context=null,S.parameters=null,E.isJS=!0,E.asFunction=!0);break;case"Element":_p(S,(c=C.svelteStrictMode)!==null&&c!==void 0?c:!1,!1,!1,"tag");break;case"MustacheTag":_p(S,rUe(e,C),!1,!1,"expression");break;case"RawMustacheTag":_p(S,!1,!1,!1,"expression");break;case"Spread":_p(S,!1,!1,!1,"expression");break;case"ConstTag":_p(S,!1,!1,!0,"expression");break;case"RenderTag":E===S.expression&&(S.expression.end=C.originalText.indexOf(")",(D=(h=(b=S.argument)===null||b===void 0?void 0:b.end)!==null&&h!==void 0?h:(g=(d=S.arguments)===null||d===void 0?void 0:d[S.arguments.length-1])===null||g===void 0?void 0:g.end)!==null&&D!==void 0?D:S.expression.end)+1,S.argument=null,_p(S,!1,!1,!1,"expression"));break;case"EventHandler":case"Binding":case"Class":case"Let":case"Transition":case"Action":case"Animation":case"InlineComponent":P();break}if(E.isJS)return L=>yT(this,void 0,void 0,function*(){try{const U={parser:"svelteExpressionParser",singleQuote:E.forceSingleQuote?!0:C.singleQuote,_svelte_asFunction:E.asFunction},J=gT(E,C,!0);let z=yield L(E.asFunction?CUe(J):DUe(J),U);if(E.forceSingleLine&&(z=yUe(z)),E.removeParentheses&&(z=$qe(z)),E.asFunction)if(Array.isArray(z)&&typeof z[0]=="string")z[0]=z[0].replace("function ",""),z.splice(-1,1);else throw new Error("Prettier AST changed, asFunction logic needs to change");return z}catch{return gT(E,C,!0)}});const _=(L,U,J)=>(z,Y)=>yT(this,void 0,void 0,function*(){return EUe(L,C.originalText,e,j=>TUe(j,U,z,C),Y,J,C)}),k=L=>_("script",Hqe(E)?"typescript":Vqe(E)?"json":"babel-ts",L),M=L=>_("style",Wqe(E)?"less":Kqe(E)?"scss":"css",L),I=()=>_("template","pug",!1);switch(E.type){case"Script":return k(!0);case"Style":return M(!0);case"Element":{if(E.name==="script")return k(!1);if(E.name==="style")return M(!1);if(Gqe(E))return I()}}return null}function DUe(e){return`(${e}
279
+ `).map((g,D)=>D==0?[g]:[x9,g]));switch(d.type){case"Fragment":const g=d.children;if(g.length===0||g.every(da))return"";if(Zl(e))return Br(e.map(n,"children"));{Yqe(d.children,e);const C=d9([mT(e,n,r)],S=>k1(S)||typeof S=="string"&&S.trim()===""||S===q1);return C.every(S=>M_(S))?"":Br([...C,Oi])}case"Text":if(Zl(e)){let C=zs(d);const S=e.getParentNode();return S.type==="Attribute"?(S.name==="class"&&e.getParentNode(1).type==="Element"&&(C=C.replace(/([^ \t\n])(([ \t]+$)|([ \t]+(\r?\n))|[ \t]+)/g,(P,N,_,k,M,I)=>k?P:N+(M?I:" ")),C=C.replace(/([^ \t\n])[ \t]+$/,S.value.indexOf(d)===S.value.length-1?"$1":"$1 ")),Rqe(C,x9)):C}else{if(da(d)){const C=zs(d).trim().length<zs(d).length,S=/\n/.test(zs(d));return/\n\r?\s*\n\r?/.test(zs(d))?[Oi,Oi]:S?Oi:C?Hs:""}return sUe(pUe(d))}case"Element":case"InlineComponent":case"Slot":case"SlotTemplate":case"Window":case"Head":case"Title":{const C=!(d.name==="template"&&!sG(d)),S=d.children.every(ae=>da(ae)),P=d.name.toUpperCase()==="!DOCTYPE",N=r.originalText[d.end-2]==="/",_=S&&((d.type==="Element"&&!r.svelteStrictMode||d.type==="Head"||d.type==="InlineComponent"||d.type==="SlotTemplate"||d.type==="Title")&&N||d.type==="Slot"||d.type==="Window"||Eqe.indexOf(d.name)!==-1||P),k=e.map(w1(d,r,n),"attributes"),M=eG(d,r),I=d.type==="InlineComponent"&&d.expression?[M,"this=",...h()]:d.type==="Element"&&d.tag?[M,"this=",...typeof d.tag=="string"?[`"${d.tag}"`]:[c,Ia(e,n,"tag"),b]]:"";if(_)return Br(["<",d.name,mu(Br([I,...k,o||P?"":j1(Hs)])),o&&!P?" ":"",`${P?"":"/"}>`]);const L=d.children,U=L[0],J=L[L.length-1];let z;const Y=Qqe(d,C,r),j=Zqe(d,C,r);S?z=ec(e,r,d)&&d.children.length&&L1(d.children[0])&&!Zl(e)?()=>Hs:()=>o?ol:"":Zl(e)?z=()=>lUe(d,r.originalText,e,n):C?ec(e,r,d)&&!Zl(e)?z=()=>mT(e,n,r):z=()=>mT(e,n,r):z=()=>aG(d,r.originalText,!0);const re=["<",d.name,mu(Br([I,...k,Y&&!S?"":!o&&!Zl(e)?j1(ol):""]))];if(!C&&!S)return Br([...re,">",Br([Oi,z(),Oi]),`</${d.name}>`]);if(Y&&j){const ae=[ol,Br([">",z(),`</${d.name}`])],xe=S&&!o||uG(d,e,r);return Br([...re,Br(S?ae:mu(ae)),xe?"":ol,">"])}let se=ol,le=ol;if(Zl(e))se="",le="";else{let ae=!1;!Y&&U&&U.type==="Text"&&(O1(U)&&U!==J&&(!ec(e,r,d)||oh(J))?(se=Oi,le=Oi,ae=!0):ec(e,r,d)&&(se=Hs),$1(U)),!j&&J&&J.type==="Text"&&(ec(e,r,d)&&!ae&&(le=Hs),M1(J))}return Br(Y?[...re,mu([ol,Br([">",z()])]),le,`</${d.name}>`]:j?[...re,">",mu([se,Br([z(),`</${d.name}`])]),uG(d,e,r)?"":ol,">"]:S?[...re,">",z(),`</${d.name}>`]:[...re,">",mu([se,z()]),le,`</${d.name}>`])}case"Options":if(r.svelteSortOrder!=="none")throw new Error("Options tags should have been handled by prepareChildren");case"Body":case"Document":return Br(["<",d.name,mu(Br([...e.map(w1(d,r,n),"attributes"),o?"":j1(Hs)])),o?" ":"","/>"]);case"Document":return Br(["<",d.name,mu(Br([...e.map(w1(d,r,n),"attributes"),o?"":j1(Hs)])),o?" ":"","/>"]);case"Identifier":return d.name;case"AttributeShorthand":return d.expression.name;case"Attribute":{if(oG(d))return r.svelteAllowShorthand?["{",d.name,"}"]:r.svelteStrictMode?[d.name,'="{',d.name,'}"']:[d.name,"={",d.name,"}"];{if(d.value===!0)return[d.name];const C=!fT(d.value)||((i=r.svelteStrictMode)!==null&&i!==void 0?i:!1),S=lG(e,n,C,d);return C?[d.name,"=",'"',S,'"']:[d.name,"=",S]}}case"MustacheTag":return["{",Ia(e,n,"expression"),"}"];case"IfBlock":{const C=["{#if ",Ia(e,n,"expression"),"}",$_(e,n,r)];return d.else&&C.push(e.call(n,"else")),C.push("{/if}"),Br([C,q1])}case"ElseBlock":{const C=e.getParentNode();if(d.children.length===1&&d.children[0].type==="IfBlock"&&C.type!=="EachBlock"){const S=d.children[0],P=["{:else if ",e.map(N=>Ia(N,n,"expression"),"children")[0],"}",e.map(N=>$_(N,n,r),"children")[0]];return S.else&&P.push(e.map(N=>N.call(n,"else"),"children")[0]),P}return["{:else}",$_(e,n,r)]}case"EachBlock":{const C=["{#each ",Ia(e,n,"expression")," as",J1(d.context,r.originalText)];return d.index&&C.push(", ",d.index),d.key&&C.push(" (",Ia(e,n,"key"),")"),C.push("}",$_(e,n,r)),d.else&&C.push(e.call(n,"else")),C.push("{/each}"),Br([C,q1])}case"AwaitBlock":{const C=d.pending.children.some(_=>!da(_)),S=d.then.children.some(_=>!da(_)),P=d.catch.children.some(_=>!da(_));let N=[];return!C&&S?N.push(Br(["{#await ",Ia(e,n,"expression")," then",J1(d.value,r.originalText),"}"]),e.call(n,"then")):!C&&P?N.push(Br(["{#await ",Ia(e,n,"expression")," catch",J1(d.error,r.originalText),"}"]),e.call(n,"catch")):(N.push(Br(["{#await ",Ia(e,n,"expression"),"}"])),C&&N.push(e.call(n,"pending")),S&&N.push(Br(["{:then",J1(d.value,r.originalText),"}"]),e.call(n,"then"))),(C||S)&&P&&N.push(Br(["{:catch",J1(d.error,r.originalText),"}"]),e.call(n,"catch")),N.push("{/await}"),Br(N)}case"KeyBlock":{const C=["{#key ",Ia(e,n,"expression"),"}",$_(e,n,r)];return C.push("{/key}"),Br([C,q1])}case"ThenBlock":case"PendingBlock":case"CatchBlock":return $_(e,n,r);case"SnippetBlock":{const C=["{#snippet ",Ia(e,n,"expression")];return C.push("}",$_(e,n,r),"{/snippet}"),C}case"EventHandler":return["on:",d.name,d.modifiers&&d.modifiers.length?["|",uh("|",d.modifiers)]:"",d.expression?["=",...h()]:""];case"Binding":return["bind:",d.name,d.expression.type==="Identifier"&&d.expression.name===d.name&&r.svelteAllowShorthand?"":["=",...h()]];case"Class":return["class:",d.name,d.expression.type==="Identifier"&&d.expression.name===d.name&&r.svelteAllowShorthand?"":["=",...h()]];case"StyleDirective":const D=["style:",d.name,d.modifiers&&d.modifiers.length?["|",uh("|",d.modifiers)]:""];if(oG(d)||d.value===!0)return r.svelteAllowShorthand?[...D]:r.svelteStrictMode?[...D,'="{',d.name,'}"']:[...D,"={",d.name,"}"];{const C=!fT(d.value)||((a=r.svelteStrictMode)!==null&&a!==void 0?a:!1),S=lG(e,n,C,d);return C?[...D,"=",'"',S,'"']:[...D,"=",S]}case"Let":return["let:",d.name,!d.expression||d.expression.type==="Identifier"&&d.expression.name===d.name?"":["=",...h()]];case"DebugTag":return["{@debug",d.identifiers.length>0?[" ",uh(", ",e.map(n,"identifiers"))]:"","}"];case"Ref":return["ref:",d.name];case"Comment":{const C=qqe(e);if(dT(d)&&y9(d,e))hT=!0;else if(I1(d)&&y9(d,e))hT=!1;else{if(N1(d,e)||da(C)&&N1(C,e))return"";iG(d)&&(U1=!0)}return cG(d)}case"Transition":return[d.intro&&d.outro?"transition":d.intro?"in":"out",":",d.name,d.modifiers&&d.modifiers.length?["|",uh("|",d.modifiers)]:"",d.expression?["=",...h()]:""];case"Action":return["use:",d.name,d.expression?["=",...h()]:""];case"Animation":return["animate:",d.name,d.expression?["=",...h()]:""];case"RawMustacheTag":return["{@html ",Ia(e,n,"expression"),"}"];case"RenderTag":return["{@render ",Ia(e,n,"expression"),"}"];case"Spread":return["{...",Ia(e,n,"expression"),"}"];case"ConstTag":return["{@const ",Ia(e,n,"expression"),"}"]}throw console.error(JSON.stringify(d,null,4)),new Error("unknown node type: "+d.type)}function uUe(e,r,n,i){if(r.svelteSortOrder==="none"){const c={};e.module&&(c[e.module.end]=e.module),e.instance&&(c[e.instance.end]=e.instance),e.css&&(c[e.css.end]=e.css);const b=_T(e.html);for(let d=0;d<b.length;d++){const g=b[d];c[g.start]&&(b.splice(d,0,c[g.start]),delete c[g.start])}const h=n.call(i,"html");return r.insertPragma&&!D9(r.originalText)?["<!-- @format -->",Oi,h]:h}const a={options:[],scripts:[],markup:[],styles:[]};e.module&&a.scripts.push(n.call(i,"module")),e.instance&&a.scripts.push(n.call(i,"instance")),e.css&&a.styles.push(n.call(i,"css"));const o=n.call(i,"html");o&&a.markup.push(o),lh&&a.options.push(lh);const u=QK(Bqe(r.svelteSortOrder).map(c=>a[c]));if(U1=!1,hT=!1,lh=void 0,r.parentParser==="markdown"){const c=u[u.length-1];F1([c],k1)}return r.insertPragma&&!D9(r.originalText)?["<!-- @format -->",Oi,Br(u)]:Br([uh(Oi,u)])}function lG(e,r,n,i){const a=e.map(o=>o.call(r),"value");return!n||!KK.includes(i.name)?a:mu(Br(d9(a,k1)))}function $_(e,r,n){const i=e.getValue(),a=i.children;if(!a||a.length===0)return"";const o=eUe(i,n),u=tUe(i,n),c=o==="none"?"":u==="line"||o==="line"?Oi:Hs,b=u==="none"?"":u==="line"||o==="line"?Oi:Hs,h=a[0],d=a[a.length-1];return L1(h)&&$1(h),oh(d)&&M1(d),[mu([c,Br(mT(e,r,n))]),b]}function lUe(e,r,n,i){const a=[],o=e.children.length;for(let u=0;u<o;u++){const c=e.children[u];c.type==="Text"?r.substring(c.start,c.end).split(/\r?\n/).forEach((h,d)=>{d>0&&a.push(x9),a.push(h)}):a.push(n.call(i,"children",u))}return a}function mT(e,r,n){if(Zl(e))return e.map(r,"children");const i=cUe(e.getValue().children,e,r,n);if(e.getValue().children=i,i.length===0)return"";const a=[];let o=!1;for(let g=0;g<i.length;g++){const D=i[g];D.type==="Text"?d(g,D):hu(D,n)?h(g):ec(e,n,D)?b(g):(a.push(c(g)),o=!1)}return i.length>1&&i.some(g=>hu(g,n))&&a.push(q1),a;function c(g){return e.call(r,"children",g)}function b(g){o?a.push(Br([Hs,c(g)])):a.push(c(g)),o=!1}function h(g){const D=i[g-1];D&&!hu(D,n)&&(D.type!=="Text"||o||!oh(D))&&a.push(ol),a.push(c(g));const E=i[g+1];E&&(E.type!=="Text"||(!da(E)||i[g+2]&&ec(e,n,i[g+2]))&&!O1(E))&&a.push(ol),o=!1}function d(g,D){if(o=!1,g===0||g===i.length-1){a.push(c(g));return}const E=i[g-1],C=i[g+1];if(L1(D)&&!da(D)){if(ec(e,n,E)&&!O1(D)){$1(D);const S=a.pop();a.push(Br([S,Hs]))}hu(E,n)&&!O1(D)&&$1(D)}oh(D)&&(ec(e,n,C)&&!b9(D)&&(o=!E||!hu(E,n),M1(D)),hu(C,n)&&!b9(D,2)&&(o=!E||!hu(E,n),M1(D))),a.push(c(g))}}function cUe(e,r,n,i){let a;const o=[],u=pT(i);for(let d=0;d<e.length;d++){const g=e[d];if(!(g.type==="Text"&&zs(g)==="")&&!(da(g)&&N1(g,r))){if(i.svelteSortOrder!=="none"){if(h(g,d)){a=cG(g);const D=e[d+1];d+=D&&da(D)?1:0;continue}if(g.type==="Options"){b(g,d,r,n);continue}}o.push(g)}}const c=[];for(let d=0;d<o.length;d++){const g=o[d],D=o[d+1];g.type==="Text"&&D&&D.type==="Text"&&(g.raw+=D.raw,g.data+=D.data,d++),c.push(g)}return c;function b(d,g,D,E){lh=Br([["<",d.name,mu(Br([...D.map(w1(d,i,E),"children",g,"attributes"),u?"":j1(Hs)])),u?" ":"","/>"],Oi]),a&&(lh=Br([a,Oi,lh]))}function h(d,g){if(d.type!=="Comment"||I1(d)||dT(d))return!1;const D=e[g+1];if(D){if(da(D)){const E=e[g+2];return E&&E.type==="Options"}return D.type==="Options"}return!1}}function pUe(e){const r=zs(e),n=r.split(/[\t\n\f\r ]+/);let i=uh(Hs,n).filter(a=>a!=="");return B1(r)&&(i[0]=Oi),B1(r,2)&&(i=[Oi,...i]),R1(r)&&(i[i.length-1]=Oi),R1(r,2)&&(i=[...i,Oi]),i}function Ia(e,r,n){return e.call(r,n)}function J1(e,r){let n=ul(e);return e!=null&&e.typeAnnotation&&(n+=": "+r.slice(e.typeAnnotation.start,e.typeAnnotation.end)),n}function ul(e,r){if(e===null)return"";if(typeof e=="string")return" "+e;switch(e.type){case"ArrayExpression":case"ArrayPattern":return" ["+e.elements.map(ul).join(",").slice(1)+"]";case"AssignmentPattern":return ul(e.left)+" ="+ul(e.right);case"Identifier":return" "+e.name;case"Literal":return" "+e.raw;case"ObjectExpression":return" {"+e.properties.map(n=>ul(n,e)).join(",")+" }";case"ObjectPattern":return" {"+e.properties.map(ul).join(",")+" }";case"Property":return e.value.type==="ObjectPattern"||e.value.type==="ArrayPattern"?" "+e.key.name+":"+ul(e.value):e.value.type==="Identifier"&&e.key.name!==e.value.name||r&&r.type==="ObjectExpression"?ul(e.key)+":"+ul(e.value):ul(e.value);case"RestElement":return" ..."+e.argument.name}throw console.error(JSON.stringify(e,null,4)),new Error("unknown node type: "+e.type)}function cG(e){let r=e.data;return XK(r)&&(r=YK(r)),Br(["<!--",r,"-->"])}function yT(e,r,n,i){function a(o){return o instanceof n?o:new n(function(u){u(o)})}return new(n||(n=Promise))(function(o,u){function c(d){try{h(i.next(d))}catch(g){u(g)}}function b(d){try{h(i.throw(d))}catch(g){u(g)}}function h(d){d.done?o(d.value):a(d.value).then(c,b)}h((i=i.apply(e,r||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function gT(e,r,n=!1){const i=e.leadingComments,a=r.originalText.slice(r.locStart(i&&i[0]||e),r.locEnd(e));return!n||!XK(a)?a:YK(a)}const _Ue=/<[a-z]+((?:\s+[^=>'"\/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)|\s+[^=>'"\/]+)*\s*)>/im,dUe=/([^\s=]+)(?:=(?:(?:("|')([\s\S]*?)\2)|(?:([^>\s]+?)(?:\s|>|$))))?/gim;function pG(e){const[,r]=e.match(_Ue),n=[];let i;for(;i=dUe.exec(r);){const[a,o,u,c,b]=i,h=c||b,d=i.index;let g;if(!h)g=!0;else{let D=d+o.length;u&&(D+=2),g=[{type:"Text",data:h,start:D,end:D+h.length}]}n.push({type:"Attribute",name:o,value:g,start:d,end:d+a.length})}return n}const{builders:{group:C9,hardline:pp,softline:fUe,indent:_G,dedent:hUe,literalline:mUe},utils:{removeLines:yUe}}=t_,gUe=new Set(["Script","Style","Identifier","MemberExpression","CallExpression","ArrowFunctionExpression"]),bUe=new Set(["start","end","type"]);function vUe(e,r){return Object.keys(e).filter(n=>!r.has(n)&&!gUe.has(e.type)&&!bUe.has(n))}function xUe(e,r){var n,i,a,o,u,c,b,h,d,g,D;const E=e.getNode(),C=r;if(!C.locStart||!C.locEnd||!C.originalText)throw new Error("Missing required options");if(_9(E))return aUe(E),E.module&&(E.module.type="Script",E.module.attributes=pG(gT(E.module,C))),E.instance&&(E.instance.type="Script",E.instance.attributes=pG(gT(E.instance,C))),E.css&&(E.css.type="Style",E.css.content.type="StyleProgram"),null;const S=e.getParentNode(),P=()=>{var L;return S.expression?_p(S,(L=C.svelteStrictMode)!==null&&L!==void 0?L:!1,!1,!1,"expression"):void 0},N=L=>_p(S,!1,!0,!1,L);switch(S.type){case"IfBlock":case"ElseBlock":case"AwaitBlock":case"KeyBlock":N("expression");break;case"EachBlock":N("expression"),N("key");break;case"SnippetBlock":E===S.expression&&(S.expression.end=C.originalText.indexOf(")",(u=(i=(n=S.context)===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:(o=(a=S.parameters)===null||a===void 0?void 0:a[S.parameters.length-1])===null||o===void 0?void 0:o.end)!==null&&u!==void 0?u:S.expression.end)+1,S.context=null,S.parameters=null,E.isJS=!0,E.asFunction=!0);break;case"Element":_p(S,(c=C.svelteStrictMode)!==null&&c!==void 0?c:!1,!1,!1,"tag");break;case"MustacheTag":_p(S,rUe(e,C),!1,!1,"expression");break;case"RawMustacheTag":_p(S,!1,!1,!1,"expression");break;case"Spread":_p(S,!1,!1,!1,"expression");break;case"ConstTag":_p(S,!1,!1,!0,"expression");break;case"RenderTag":E===S.expression&&(("argument"in S||"arguments"in S)&&(S.expression.end=C.originalText.indexOf(")",(D=(h=(b=S.argument)===null||b===void 0?void 0:b.end)!==null&&h!==void 0?h:(g=(d=S.arguments)===null||d===void 0?void 0:d[S.arguments.length-1])===null||g===void 0?void 0:g.end)!==null&&D!==void 0?D:S.expression.end)+1,S.argument=null,S.arguments=null),_p(S,!1,!1,!1,"expression"));break;case"EventHandler":case"Binding":case"Class":case"Let":case"Transition":case"Action":case"Animation":case"InlineComponent":P();break}if(E.isJS)return L=>yT(this,void 0,void 0,function*(){try{const U={parser:"svelteExpressionParser",singleQuote:E.forceSingleQuote?!0:C.singleQuote,_svelte_asFunction:E.asFunction},J=gT(E,C,!0);let z=yield L(E.asFunction?CUe(J):DUe(J),U);if(E.forceSingleLine&&(z=yUe(z)),E.removeParentheses&&(z=$qe(z)),E.asFunction)if(Array.isArray(z)&&typeof z[0]=="string")z[0]=z[0].replace("function ",""),z.splice(-1,1);else throw new Error("Prettier AST changed, asFunction logic needs to change");return z}catch{return gT(E,C,!0)}});const _=(L,U,J)=>(z,Y)=>yT(this,void 0,void 0,function*(){return EUe(L,C.originalText,e,j=>TUe(j,U,z,C),Y,J,C)}),k=L=>_("script",Hqe(E)?"typescript":Vqe(E)?"json":"babel-ts",L),M=L=>_("style",Wqe(E)?"less":Kqe(E)?"scss":"css",L),I=()=>_("template","pug",!1);switch(E.type){case"Script":return k(!0);case"Style":return M(!0);case"Element":{if(E.name==="script")return k(!1);if(E.name==="style")return M(!1);if(Gqe(E))return I()}}return null}function DUe(e){return`(${e}
280
280
  )`}function CUe(e){return`function ${e} {}`}function dG(e){if(!e)return"";const r=/^[\t\f\r ]*\n/,n=/\n[\t\f\r ]*$/;return[mUe,e.replace(r,"").replace(n,""),pp]}function SUe(e){const r=g9(A1,e);return r?GK(r):""}function TUe(e,r,n,i){return yT(this,void 0,void 0,function*(){try{const a=yield n(e,{parser:r});if(r==="pug"&&typeof a=="string"){const u=i.useTabs?" ":" ".repeat(i.pugTabWidth&&i.pugTabWidth>0?i.pugTabWidth:i.tabWidth),c=a.split(`
281
281
  `).map(b=>b&&u+b).join(`
282
282
  `);return[pp,c]}const o=u=>i.svelteIndentScriptAndStyle?_G(u):u;return F1([a],k1),[o([pp,a]),pp]}catch(a){if(Tqe.PRETTIER_DEBUG)throw a;return console.error(a),dG(e)}})}function EUe(e,r,n,i,a,o,u){var c;return yT(this,void 0,void 0,function*(){const b=n.getNode(),h=e==="template"?aG(b,r):SUe(b),d=b.type==="Script"||b.type==="Style"?b.comments:[Uqe(n)].filter(Boolean).map(P=>({comment:P,emptyLineAfter:!1})),D=sG(b)&&!iG((c=d[d.length-1])===null||c===void 0?void 0:c.comment)&&(e!=="template"||u.plugins.some(P=>typeof P!="string"&&P.parsers&&P.parsers.pug))?h.trim()!==""?yield i(h):h===""?"":pp:dG(h),E=C9(["<",e,_G(C9([...n.map(w1(b,u,a),"attributes"),pT(u)?"":hUe(fUe)])),">"]);let C=C9([E,D,"</",e,">"]);const S=[];for(const P of d)S.push("<!--",P.comment.data,"-->"),S.push(pp),P.emptyLineAfter&&S.push(pp);return o&&u.svelteSortOrder!=="none"?[...S,C,pp]:o&&S.length?[...S,C]:C})}function _p(e,r,n,i,a){const o=e[a];!o||typeof o!="object"||(o.isJS=!0,o.forceSingleQuote=r,o.forceSingleLine=n,o.removeParentheses=i)}const fG=v8.babel;function AUe(e){return e.start}function wUe(e){return e.end}const kUe=[{name:"svelte",parsers:["svelte"],extensions:[".svelte"],vscodeLanguageIds:["svelte"]}],FUe={svelte:{hasPragma:D9,parse:e=>{try{return Object.assign(Object.assign({},W8e(e)),{__isRoot:!0})}catch(r){throw r.start!=null&&r.end!=null&&(r.loc={start:r.start,end:r.end}),r}},preprocess:(e,r)=>(e=Pqe(e),e=e.trim(),r.originalText=e,e),locStart:AUe,locEnd:wUe,astFormat:"svelte-ast"},svelteExpressionParser:Object.assign(Object.assign({},fG),{parse:(e,r)=>{const n=fG.parse(e,r);let i=n.program.body[0];return r._svelte_asFunction||(i=i.expression),Object.assign(Object.assign({},n),{program:i})}})};var PUe=Object.freeze({__proto__:null,languages:kUe,options:Iqe,parsers:FUe,printers:{"svelte-ast":{print:oUe,embed:xUe,getVisitorKeys:vUe}}});const hG={js:"babel",jsx:"babel",mjs:"babel",cjs:"babel",ts:"typescript",tsx:"typescript",css:"css",html:"html",json:"json",json5:"json5",md:"markdown",markdown:"markdown"};hG.svelte="svelte";const mG=[Zse,V_e,jme,xge,gDe,txe];mG.push(PUe),onmessage=async({data:e})=>{const{fileExtension:r,fileText:n,fileId:i}=e,a=hG[r];if(a)try{const o=await p8(n,{parser:a,plugins:mG,proseWrap:"always",singleQuote:!0,printWidth:60});postMessage({fileId:i,fileTextPrettified:o})}catch(o){console.error(o),postMessage({fileId:i,error:o.toString()})}}})();
package/dist/index.html CHANGED
@@ -20,8 +20,8 @@
20
20
  href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
21
21
  rel="stylesheet"
22
22
  />
23
- <script type="module" crossorigin src="/assets/index-HJAv0wn0.js"></script>
24
- <link rel="stylesheet" crossorigin href="/assets/index-B4YHcAhs.css">
23
+ <script type="module" crossorigin src="/assets/index-DGGHVX25.js"></script>
24
+ <link rel="stylesheet" crossorigin href="/assets/index-CpIQ8AoQ.css">
25
25
  </head>
26
26
  <body>
27
27
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vzcode",
3
- "version": "0.71.0",
3
+ "version": "0.73.0",
4
4
  "description": "Multiplayer code editor system",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -63,15 +63,15 @@
63
63
  },
64
64
  "homepage": "https://github.com/vizhub-core/vzcode#readme",
65
65
  "dependencies": {
66
- "@codemirror/autocomplete": "^6.12.0",
66
+ "@codemirror/autocomplete": "^6.13.0",
67
67
  "@codemirror/lang-css": "^6.2.1",
68
68
  "@codemirror/lang-html": "^6.4.8",
69
- "@codemirror/lang-javascript": "^6.2.1",
69
+ "@codemirror/lang-javascript": "^6.2.2",
70
70
  "@codemirror/lang-json": "^6.0.1",
71
71
  "@codemirror/lang-markdown": "^6.2.4",
72
- "@codemirror/state": "^6.4.0",
72
+ "@codemirror/state": "^6.4.1",
73
73
  "@codemirror/theme-one-dark": "^6.1.2",
74
- "@codemirror/view": "^6.24.0",
74
+ "@codemirror/view": "^6.25.1",
75
75
  "@lezer/highlight": "^1.2.0",
76
76
  "@replit/codemirror-indentation-markers": "^6.5.0",
77
77
  "@replit/codemirror-interact": "^6.3.0",
@@ -79,47 +79,47 @@
79
79
  "@replit/codemirror-vscode-keymap": "^6.0.2",
80
80
  "@teamwork/websocket-json-stream": "^2.0.0",
81
81
  "@typescript/vfs": "^1.5.0",
82
- "@uiw/codemirror-theme-abcdef": "^4.21.22",
83
- "@uiw/codemirror-theme-dracula": "^4.21.22",
84
- "@uiw/codemirror-theme-eclipse": "^4.21.22",
85
- "@uiw/codemirror-theme-github": "^4.21.22",
86
- "@uiw/codemirror-theme-material": "^4.21.22",
87
- "@uiw/codemirror-theme-nord": "^4.21.22",
88
- "@uiw/codemirror-theme-okaidia": "^4.21.22",
89
- "@uiw/codemirror-theme-xcode": "^4.21.22",
90
- "@uiw/codemirror-themes": "^4.21.22",
82
+ "@uiw/codemirror-theme-abcdef": "^4.21.24",
83
+ "@uiw/codemirror-theme-dracula": "^4.21.24",
84
+ "@uiw/codemirror-theme-eclipse": "^4.21.24",
85
+ "@uiw/codemirror-theme-github": "^4.21.24",
86
+ "@uiw/codemirror-theme-material": "^4.21.24",
87
+ "@uiw/codemirror-theme-nord": "^4.21.24",
88
+ "@uiw/codemirror-theme-okaidia": "^4.21.24",
89
+ "@uiw/codemirror-theme-xcode": "^4.21.24",
90
+ "@uiw/codemirror-themes": "^4.21.24",
91
91
  "body-parser": "^1.20.2",
92
92
  "codemirror": "^6.0.1",
93
93
  "codemirror-ot": "^4.2.0",
94
94
  "color-hash": "^2.0.2",
95
95
  "d3-array": "^3.2.4",
96
96
  "diff-match-patch": "^1.0.5",
97
- "dotenv": "^16.4.4",
98
- "express": "^4.18.2",
97
+ "dotenv": "^16.4.5",
98
+ "express": "^4.18.3",
99
99
  "ignore": "^5.3.1",
100
100
  "json0-ot-diff": "^1.1.2",
101
101
  "ngrok": "^4.3.3",
102
- "open": "^10.0.3",
103
- "openai": "^4.28.0",
104
- "prettier-plugin-svelte": "^3.2.1",
102
+ "open": "^10.1.0",
103
+ "openai": "^4.28.4",
104
+ "prettier-plugin-svelte": "^3.2.2",
105
105
  "react": "^18.2.0",
106
106
  "react-bootstrap": "^2.10.1",
107
107
  "react-dom": "^18.2.0",
108
- "react-router-dom": "^6.22.1",
108
+ "react-router-dom": "^6.22.3",
109
109
  "sharedb": "^4.1.2",
110
110
  "sharedb-client-browser": "^4.4.0",
111
- "vizhub-ui": "^3.20.0",
111
+ "vizhub-ui": "^3.21.0",
112
112
  "ws": "^8.16.0"
113
113
  },
114
114
  "devDependencies": {
115
- "@types/react": "^18.2.56",
116
- "@types/react-dom": "^18.2.19",
115
+ "@types/react": "^18.2.64",
116
+ "@types/react-dom": "^18.2.21",
117
117
  "@vitejs/plugin-react": "^4.2.1",
118
118
  "concurrently": "^8.2.2",
119
119
  "prettier": "^3.2.5",
120
- "sass": "^1.71.0",
121
- "typescript": "^5.3.3",
122
- "vite": "^5.1.3",
123
- "vitest": "^1.3.0"
120
+ "sass": "^1.71.1",
121
+ "typescript": "^5.4.2",
122
+ "vite": "^5.1.5",
123
+ "vitest": "^1.3.1"
124
124
  }
125
125
  }
@@ -61,6 +61,7 @@ function App() {
61
61
  localPresence,
62
62
  docPresence,
63
63
  submitOperation,
64
+ connected,
64
65
  } = useShareDB({
65
66
  connection,
66
67
  });
@@ -87,6 +88,7 @@ function App() {
87
88
  prettierWorker={prettierWorker}
88
89
  typeScriptWorker={typeScriptWorker}
89
90
  initialUsername={initialUsername}
91
+ connected={connected}
90
92
  >
91
93
  <div className="app">
92
94
  <VZLeft />
@@ -1,3 +1,9 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');
2
+ @import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@200..900&display=swap');
3
+ @import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap');
4
+ @import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');
5
+ @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');
6
+ @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap');
1
7
  :root {
2
8
  // --vzcode-font-family: ui-monospace, SFMono-Regular,
3
9
  // 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace !important;
@@ -28,7 +28,18 @@ export const useShareDB = ({
28
28
  const [content, setContent] =
29
29
  useState<VZCodeContent | null>(null);
30
30
 
31
+ const [connected, setConnected] =
32
+ useState<boolean>(false);
31
33
  useEffect(() => {
34
+ // Listen for connection state changes
35
+ connection.on('connected', () => {
36
+ setConnected(true);
37
+ });
38
+
39
+ connection.on('disconnected', () => {
40
+ setConnected(false);
41
+ });
42
+
32
43
  // Since there is only ever a single document,
33
44
  // these things are pretty arbitrary.
34
45
  // * `collection` - the ShareDB collection to use
@@ -106,5 +117,6 @@ export const useShareDB = ({
106
117
  localPresence,
107
118
  docPresence,
108
119
  submitOperation,
120
+ connected,
109
121
  };
110
122
  };
@@ -43,4 +43,8 @@
43
43
  background-color: #0077cc;
44
44
  color: white;
45
45
  }
46
+
47
+ .cm-line {
48
+ font-family: var(--vzcode-font-family);
49
+ }
46
50
  }
@@ -0,0 +1,8 @@
1
+ export const fonts = [
2
+ 'Roboto Mono',
3
+ 'Inconsolata',
4
+ 'Source Code Pro',
5
+ 'Ubuntu Mono',
6
+ 'JetBrains Mono',
7
+ 'Fira Code',
8
+ ];
@@ -55,6 +55,11 @@ export type VZCodeContextValue = {
55
55
  createFile: (fileName: string) => void;
56
56
  renameFile: (fileId: string, fileName: string) => void;
57
57
  deleteFile: (fileId: string) => void;
58
+ renameDirectory: (
59
+ directoryId: string,
60
+ directoryOldName: string,
61
+ directoryName: string,
62
+ ) => void;
58
63
  deleteDirectory: (directoryId: string) => void;
59
64
 
60
65
  activeFileId: string | null;
@@ -101,6 +106,8 @@ export type VZCodeContextValue = {
101
106
  null | (() => void)
102
107
  >;
103
108
  runCodeRef: React.MutableRefObject<null | (() => void)>;
109
+
110
+ connected: boolean;
104
111
  };
105
112
 
106
113
  export const VZCodeProvider = ({
@@ -115,6 +122,7 @@ export const VZCodeProvider = ({
115
122
  children,
116
123
  codeError = null,
117
124
  enableManualPretter = true,
125
+ connected,
118
126
  }: {
119
127
  content: VZCodeContent;
120
128
  shareDBDoc: ShareDBDoc<VZCodeContent>;
@@ -127,6 +135,7 @@ export const VZCodeProvider = ({
127
135
  children: React.ReactNode;
128
136
  codeError?: string | null;
129
137
  enableManualPretter?: boolean;
138
+ connected: boolean;
130
139
  }) => {
131
140
  // Auto-run Pretter after local changes.
132
141
  const {
@@ -223,6 +232,7 @@ export const VZCodeProvider = ({
223
232
  createFile,
224
233
  renameFile,
225
234
  deleteFile,
235
+ renameDirectory,
226
236
  deleteDirectory,
227
237
  } = useFileCRUD({
228
238
  submitOperation,
@@ -277,6 +287,7 @@ export const VZCodeProvider = ({
277
287
  createFile,
278
288
  renameFile,
279
289
  deleteFile,
290
+ renameDirectory,
280
291
  deleteDirectory,
281
292
 
282
293
  activeFileId,
@@ -315,6 +326,8 @@ export const VZCodeProvider = ({
315
326
  handleCreateFileClick,
316
327
  runPrettierRef,
317
328
  runCodeRef,
329
+
330
+ connected,
318
331
  };
319
332
 
320
333
  return (
@@ -1,7 +1,16 @@
1
- import { useCallback, useContext, useRef } from 'react';
1
+ import React, {
2
+ useCallback,
3
+ useContext,
4
+ useEffect,
5
+ useRef,
6
+ useState,
7
+ } from 'react';
2
8
  import { Button, Modal, Form } from './bootstrap';
3
- import { themes } from './themes';
9
+ import { ThemeLabel, themes } from './themes';
4
10
  import { VZCodeContext } from './VZCodeContext';
11
+ import { fonts } from './Fonts/fonts';
12
+
13
+ const fontSizes = ['16px', '18px', '20px', '24px'];
5
14
 
6
15
  export const VZSettings = ({
7
16
  enableUsernameField = true,
@@ -18,11 +27,51 @@ export const VZSettings = ({
18
27
  setUsername,
19
28
  } = useContext(VZCodeContext);
20
29
 
21
- const handleThemeChange = useCallback((event) => {
22
- const selectedValue = event.target.value;
23
- console.log(selectedValue);
24
- setTheme(selectedValue);
25
- }, []);
30
+ const handleThemeChange = useCallback(
31
+ (event: React.ChangeEvent<HTMLSelectElement>) => {
32
+ setTheme(event.target.value as ThemeLabel);
33
+ },
34
+ [],
35
+ );
36
+
37
+ // Track selected font and font size.
38
+ // TODO store these in local storage
39
+ const [selectedFont, setSelectedFont] =
40
+ useState('Roboto Mono');
41
+ const [selectedFontSize, setSelectedFontSize] =
42
+ useState('16px');
43
+
44
+ // Called when the user selects a different font
45
+ const handleFontChange = useCallback(
46
+ (event: React.ChangeEvent<HTMLSelectElement>) => {
47
+ setSelectedFont(event.target.value);
48
+ },
49
+ [],
50
+ );
51
+
52
+ // Called when the user selects a different font size
53
+ const handleFontSizeChange = (
54
+ event: React.ChangeEvent<HTMLSelectElement>,
55
+ ) => {
56
+ setSelectedFontSize(event.target.value);
57
+ };
58
+
59
+ useEffect(() => {
60
+ document.body.style.setProperty(
61
+ '--vzcode-font-family',
62
+ selectedFont,
63
+ );
64
+ }, [selectedFont]);
65
+
66
+ useEffect(() => {
67
+ // const fontSize = event.target.value;
68
+ // const root = document.documentElement;
69
+ // root.style.setProperty('--vzcode-font-size', fontSize);
70
+ document.body.style.setProperty(
71
+ '--vzcode-font-size',
72
+ selectedFontSize,
73
+ );
74
+ }, [selectedFontSize]);
26
75
 
27
76
  const usernameRef = useRef<HTMLInputElement>(null);
28
77
 
@@ -77,6 +126,46 @@ export const VZSettings = ({
77
126
  Select a color theme for the editor
78
127
  </Form.Text>
79
128
  </Form.Group>
129
+
130
+ <Form.Group className="mb-3" controlId="formFork">
131
+ <Form.Label>Font</Form.Label>
132
+
133
+ <select
134
+ className="form-select"
135
+ onChange={handleFontChange}
136
+ value={selectedFont}
137
+ >
138
+ {fonts.map((font) => (
139
+ <option key={font} value={font}>
140
+ {font}
141
+ </option>
142
+ ))}
143
+ </select>
144
+
145
+ <Form.Text className="text-muted">
146
+ Select font for the editor
147
+ </Form.Text>
148
+ </Form.Group>
149
+
150
+ <Form.Group className="mb-3" controlId="formFork">
151
+ <Form.Label>Font Size</Form.Label>
152
+
153
+ <select
154
+ className="form-select"
155
+ onChange={handleFontSizeChange}
156
+ value={selectedFontSize}
157
+ >
158
+ {fontSizes.map((size) => (
159
+ <option key={size} value={size}>
160
+ {size}
161
+ </option>
162
+ ))}
163
+ </select>
164
+
165
+ <Form.Text className="text-muted">
166
+ Select a font size for the editor
167
+ </Form.Text>
168
+ </Form.Group>
80
169
  </Modal.Body>
81
170
  <Modal.Footer>
82
171
  <Button variant="primary" onClick={closeSettings}>
@@ -14,6 +14,7 @@ export const DirectoryListing = ({
14
14
  children,
15
15
  renameFile,
16
16
  deleteFile,
17
+ renameDirectory,
17
18
  deleteDirectory,
18
19
  handleFileClick,
19
20
  handleFileDoubleClick,
@@ -26,6 +27,11 @@ export const DirectoryListing = ({
26
27
  children: Array<FileTree | FileTreeFile>;
27
28
  renameFile: (fileId: string, newName: string) => void;
28
29
  deleteFile: (fileId: string) => void;
30
+ renameDirectory: (
31
+ path: FileTreePath,
32
+ oldName: string,
33
+ newName: string,
34
+ ) => void;
29
35
  deleteDirectory: (path: FileTreePath) => void;
30
36
  handleFileClick: (fileId: string) => void;
31
37
  handleFileDoubleClick: (fileId: string) => void;
@@ -41,10 +47,12 @@ export const DirectoryListing = ({
41
47
  deleteDirectory(path);
42
48
  }, [deleteDirectory, path]);
43
49
 
44
- const handleRenameClick = useCallback(() => {
45
- // https://github.com/vizhub-core/vzcode/issues/103
46
- console.log('TODO handleRenameDirectoryClick');
47
- }, []);
50
+ const handleRenameClick = useCallback(
51
+ (newName: string) => {
52
+ renameDirectory(path, name, newName);
53
+ },
54
+ [renameDirectory, path, name],
55
+ );
48
56
 
49
57
  const isOpen = useMemo(
50
58
  () => isDirectoryOpen(path),
@@ -81,6 +89,7 @@ export const DirectoryListing = ({
81
89
  key={fileId || path}
82
90
  renameFile={renameFile}
83
91
  deleteFile={deleteFile}
92
+ renameDirectory={renameDirectory}
84
93
  deleteDirectory={deleteDirectory}
85
94
  handleFileClick={handleFileClick}
86
95
  handleFileDoubleClick={
@@ -13,7 +13,7 @@ import { DeleteConfirmationModal } from './DeleteConfirmationModal';
13
13
 
14
14
  // TODO support renaming directories
15
15
  // See https://github.com/vizhub-core/vzcode/issues/103
16
- const enableRenameDirectory = false;
16
+ const enableRenameDirectory = true;
17
17
 
18
18
  // A file or directory in the sidebar.
19
19
  export const Item = ({
@@ -25,7 +25,9 @@ export const Item = ({
25
25
  handleDeleteClick,
26
26
  isDirectory = false,
27
27
  isActive = false,
28
- renameFileTooltipText = 'Rename File',
28
+ renameFileTooltipText = isDirectory
29
+ ? 'Rename Directory'
30
+ : 'Rename File',
29
31
  deleteFileTooltipText = isDirectory
30
32
  ? 'Delete Directory'
31
33
  : 'Delete File',
@@ -13,6 +13,7 @@ export const Listing = ({
13
13
  entity,
14
14
  renameFile,
15
15
  deleteFile,
16
+ renameDirectory,
16
17
  deleteDirectory,
17
18
  handleFileClick,
18
19
  handleFileDoubleClick,
@@ -23,6 +24,11 @@ export const Listing = ({
23
24
  entity: FileTree | FileTreeFile;
24
25
  renameFile: (fileId: FileId, newName: string) => void;
25
26
  deleteFile: (fileId: FileId) => void;
27
+ renameDirectory: (
28
+ path: FileTreePath,
29
+ oldName: string,
30
+ newName: string,
31
+ ) => void;
26
32
  deleteDirectory: (path: FileTreePath) => void;
27
33
  handleFileClick: (fileId: FileId) => void;
28
34
  handleFileDoubleClick: (fileId: FileId) => void;
@@ -49,6 +55,7 @@ export const Listing = ({
49
55
  children={children}
50
56
  renameFile={renameFile}
51
57
  deleteFile={deleteFile}
58
+ renameDirectory={renameDirectory}
52
59
  deleteDirectory={deleteDirectory}
53
60
  handleFileClick={handleFileClick}
54
61
  handleFileDoubleClick={handleFileDoubleClick}
@@ -1,4 +1,9 @@
1
- import { useCallback, useContext, useMemo } from 'react';
1
+ import {
2
+ useCallback,
3
+ useContext,
4
+ useEffect,
5
+ useMemo,
6
+ } from 'react';
2
7
  import {
3
8
  FileId,
4
9
  FileTree,
@@ -17,7 +22,7 @@ import './styles.scss';
17
22
  // TODO turn this UI back on when we are actually detecting
18
23
  // the connection status.
19
24
  // See https://github.com/vizhub-core/vzcode/issues/456
20
- const enableConnectionStatus = false;
25
+ const enableConnectionStatus = true;
21
26
 
22
27
  export const VZSidebar = ({
23
28
  createFileTooltipText = 'New File',
@@ -32,6 +37,7 @@ export const VZSidebar = ({
32
37
  files,
33
38
  renameFile,
34
39
  deleteFile,
40
+ renameDirectory,
35
41
  deleteDirectory,
36
42
  activeFileId,
37
43
  openTab,
@@ -39,6 +45,7 @@ export const VZSidebar = ({
39
45
  isDirectoryOpen,
40
46
  toggleDirectory,
41
47
  handleOpenCreateFileModal,
48
+ connected,
42
49
  } = useContext(VZCodeContext);
43
50
 
44
51
  const fileTree = useMemo(
@@ -150,6 +157,7 @@ export const VZSidebar = ({
150
157
  entity={entity}
151
158
  renameFile={renameFile}
152
159
  deleteFile={deleteFile}
160
+ renameDirectory={renameDirectory}
153
161
  deleteDirectory={deleteDirectory}
154
162
  handleFileClick={handleFileClick}
155
163
  handleFileDoubleClick={
@@ -174,10 +182,13 @@ export const VZSidebar = ({
174
182
 
175
183
  {enableConnectionStatus && (
176
184
  <div className="connection-status">
177
- Connection Status
185
+ {connected ? 'Connected' : 'Connection Lost'}
178
186
  <div className="connection">
179
- Saved
180
- <div className="saved" />
187
+ <div
188
+ className={`connection-status-indicator ${
189
+ connected ? 'connected' : 'disconnected'
190
+ }`}
191
+ />
181
192
  </div>
182
193
  </div>
183
194
  )}