Files
mermaid-live-editor/beta/_app/pages/edit.svelte-e892cda5.js
T

2 lines
36 KiB
JavaScript

var e;import{S as t,i as a,s as n,e as s,c as i,a as o,d as r,b as l,f as c,G as h,H as d,I as u,z as f,J as m,K as g,k as p,t as v,n as $,g as w,F as b,L as x,M as y,N as E,O as k,P as I,Q as D,h as C,R as O,T,U as S,v as A,B as M,r as V,u as N,V as _,D as R,E as L,j as P,m as B,o as U,W as G,w as H,X as j,Y,Z as z,_ as J,$ as q,a0 as F,a1 as K,a2 as W,a3 as Z,C as X,a4 as Q,a5 as ee,a6 as te,l as ae,a7 as ne,a8 as se}from"../chunks/vendor-d6e43078.js";import{c as ie,a as oe,u as re,g as le,V as ce,b as he,e as de,i as ue,s as fe,d as me}from"../chunks/util-5eb94eb8.js";import{b as ge}from"../chunks/paths-45dac81d.js";import"../chunks/preload-helper-9f12a5fd.js";function pe(e){let t;return{c(){t=s("div"),this.h()},l(e){t=i(e,"DIV",{id:!0,class:!0}),o(t).forEach(r),this.h()},h(){l(t,"id","editor"),l(t,"class","overflow-hidden")},m(a,n){c(a,t,n),e[9](t)},p:h,i:h,o:h,d(a){a&&r(t),e[9](null)}}}function ve(e,t,a){let n;d(e,ie,(e=>a(8,n=e)));var s=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(s,i){function o(e){try{l(n.next(e))}catch(t){i(t)}}function r(e){try{l(n.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,r)}l((n=n.apply(e,t||[])).next())}))};let i,o,r=null,{text:l}=t,{language:c}=t,{editorOptions:h={value:l,language:c,scrollBeyondLastLine:!1,minimap:{enabled:!1},theme:"myCoolTheme",overviewRulerLanes:0}}=t,{errorMarkers:g=[]}=t,p=l;const v=u();return f((()=>s(void 0,void 0,void 0,(function*(){try{a(6,o=monaco)}catch(t){yield s(void 0,void 0,void 0,(function*(){let e=0;for(;e++<10;)try{return void a(6,o=monaco)}catch(t){yield new Promise((e=>setTimeout(e,500)))}alert("Loading Monaco Editor failed. Please try refreshing the page.")}))}var e;(e=o).languages.register({id:"mermaid"}),e.languages.setMonarchTokensProvider("mermaid",{typeKeywords:["graph","stateDiagram","sequenceDiagram","classDiagram","pie","erDiagram","flowchart","gantt","gitGraph","journey"],keywords:["patricipant","as"],arrows:["---","===","--\x3e","==>","->>","->"],tokenizer:{root:[[/[{}]/,"delimiter.bracket"],[/[a-z_$][\w$]*/,{cases:{"@typeKeywords":"keyword","@keywords":"keyword"}}],[/[-=>ox]+/,{cases:{"@arrows":"transition"}}],[/[[{(}]+.+?[)\]}]+/,"string"],[/".*"/,"string"]]},whitespace:[[/[ \t\r\n]+/,"white"],[/%%.*$/,"comment"]]}),e.editor.defineTheme("myCoolTheme",{base:"vs",inherit:!1,rules:[{token:"keyword",foreground:"880000",fontStyle:"bold"},{token:"custom-error",foreground:"ff0000",fontStyle:"bold"},{token:"string",foreground:"AA8500"},{token:"transition",foreground:"008800",fontStyle:"bold"},{token:"delimiter.bracket",foreground:"000000",fontStyle:"bold"}]}),e.languages.registerCompletionItemProvider("mermaid",{provideCompletionItems:()=>({suggestions:[{label:"simpleText",kind:e.languages.CompletionItemKind.Text,insertText:"simpleText"},{label:"testing",kind:e.languages.CompletionItemKind.Keyword,insertText:"testing(${1:condition})",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"ifelse",kind:e.languages.CompletionItemKind.Snippet,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"If-Else Statement"}]})}),a(5,i=o.editor.create(r,h)),i.onDidChangeModelContent((()=>{a(1,l=i.getValue()),v("update",{text:l})}));return new ResizeObserver((e=>{i.layout({height:e[0].contentRect.height,width:e[0].contentRect.width})})).observe(r.parentElement),()=>{i.dispose()}})))),e.$$set=e=>{"text"in e&&a(1,l=e.text),"language"in e&&a(2,c=e.language),"editorOptions"in e&&a(3,h=e.editorOptions),"errorMarkers"in e&&a(4,g=e.errorMarkers)},e.$$.update=()=>{100&e.$$.dirty&&(null==o||o.editor.setModelLanguage(i.getModel(),c)),498&e.$$.dirty&&(l!==p&&(n.updateEditor&&(null==i||i.setValue(l)),a(7,p=l)),null==o||o.editor.setModelMarkers(i.getModel(),"test",g))},[r,l,c,h,g,i,o,p,n,function(e){m[e?"unshift":"push"]((()=>{r=e,a(0,r)}))}]}class $e extends t{constructor(e){super(),a(this,e,ve,pe,n,{text:1,language:2,editorOptions:3,errorMarkers:4})}}function we(e,t,a){const n=e.slice();return n[1]=t[a].title,n[2]=t[a].href,n[3]=t[a].icon,n}function be(e){let t,a,n,d,u,f=e[1]+"",m=e[3]&&function(e){let t;return{c(){t=s("i"),this.h()},l(e){t=i(e,"I",{class:!0}),o(t).forEach(r),this.h()},h(){l(t,"class",e[3])},m(e,a){c(e,t,a)},p:h,d(e){e&&r(t)}}}(e);return{c(){t=s("li"),a=s("a"),m&&m.c(),n=p(),d=v(f),u=p(),this.h()},l(e){t=i(e,"LI",{});var s=o(t);a=i(s,"A",{class:!0,target:!0,href:!0});var l=o(a);m&&m.l(l),n=$(l),d=w(l,f),l.forEach(r),u=$(s),s.forEach(r),this.h()},h(){l(a,"class","nav-btn"),l(a,"target","_blank"),l(a,"href",e[2])},m(e,s){c(e,t,s),b(t,a),m&&m.m(a,null),b(a,n),b(a,d),b(t,u)},p(e,t){e[3]&&m.p(e,t)},d(e){e&&r(t),m&&m.d()}}}function xe(e){let t,a,n,d,u,f,m,E,k,I,D,C,O,T,S,A,M,V,N,_,R=e[0],L=[];for(let s=0;s<R.length;s+=1)L[s]=be(we(e,R,s));return{c(){t=s("header"),a=s("div"),n=s("a"),d=v("Mermaid"),u=s("span"),f=v("v"),m=v(g),E=v(" Live Editor"),k=p(),I=s("label"),D=x("svg"),C=x("title"),O=v("Menu"),T=x("path"),S=p(),A=s("input"),M=p(),V=s("div"),N=s("nav"),_=s("ul");for(let e=0;e<L.length;e+=1)L[e].c();this.h()},l(e){t=i(e,"HEADER",{class:!0});var s=o(t);a=i(s,"DIV",{class:!0});var l=o(a);n=i(l,"A",{href:!0});var c=o(n);d=w(c,"Mermaid"),u=i(c,"SPAN",{class:!0});var h=o(u);f=w(h,"v"),m=w(h,g),h.forEach(r),E=w(c," Live Editor"),c.forEach(r),l.forEach(r),k=$(s),I=i(s,"LABEL",{for:!0,class:!0});var p=o(I);D=i(p,"svg",{class:!0,xmlns:!0,width:!0,height:!0,viewBox:!0},1);var v=o(D);C=i(v,"title",{},1);var b=o(C);O=w(b,"Menu"),b.forEach(r),T=i(v,"path",{d:!0},1),o(T).forEach(r),v.forEach(r),p.forEach(r),S=$(s),A=i(s,"INPUT",{class:!0,type:!0,id:!0}),M=$(s),V=i(s,"DIV",{class:!0,id:!0});var x=o(V);N=i(x,"NAV",{});var y=o(N);_=i(y,"UL",{class:!0});var R=o(_);for(let t=0;t<L.length;t+=1)L[t].l(R);R.forEach(r),y.forEach(r),x.forEach(r),s.forEach(r),this.h()},h(){l(u,"class","text-xs font-thin"),l(n,"href","/"),l(a,"class","flex-1 flex justify-between items-center"),l(T,"d","M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"),l(D,"class","fill-current "),l(D,"xmlns","http://www.w3.org/2000/svg"),l(D,"width","20"),l(D,"height","20"),l(D,"viewBox","0 0 20 20"),l(I,"for","menu-toggle"),l(I,"class","pointer-cursor lg:hidden block"),l(A,"class","hidden svelte-qevfgi"),l(A,"type","checkbox"),l(A,"id","menu-toggle"),l(_,"class","lg:flex items-center justify-between text-base pt-4 lg:pt-0"),l(V,"class","hidden lg:flex lg:items-center lg:w-auto w-full svelte-qevfgi"),l(V,"id","menu"),l(t,"class","p-2 bg-indigo-400 text-white font-bold flex flex-wrap items-center svelte-qevfgi")},m(e,s){c(e,t,s),b(t,a),b(a,n),b(n,d),b(n,u),b(u,f),b(u,m),b(n,E),b(t,k),b(t,I),b(I,D),b(D,C),b(C,O),b(D,T),b(t,S),b(t,A),b(t,M),b(t,V),b(V,N),b(N,_);for(let t=0;t<L.length;t+=1)L[t].m(_,null)},p(e,[t]){if(1&t){let a;for(R=e[0],a=0;a<R.length;a+=1){const n=we(e,R,a);L[a]?L[a].p(n,t):(L[a]=be(n),L[a].c(),L[a].m(_,null))}for(;a<L.length;a+=1)L[a].d(1);L.length=R.length}},i:h,o:h,d(e){e&&r(t),y(L,e)}}}function ye(e){return[[{title:"Documentation",href:"https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted"},{title:"Tutorial",href:"https://github.com/mermaid-js/mermaid/blob/develop/docs/Tutorials.md"},{title:"Mermaid",href:"https://github.com/mermaid-js/mermaid"},{title:"CLI",href:"https://github.com/mermaid-js/mermaid-cli"},{title:"",href:"https://github.com/mermaid-js/mermaid-live-editor",icon:"fab fa-github fa-lg"}]]}null==(e=oe)||e.track("version",{mermaidVersion:g});class Ee extends t{constructor(e){super(),a(this,e,ye,xe,n,{})}}function ke(e,t,a){const n=e.slice();return n[10]=t[a],n}function Ie(e){let t;return{c(){t=s("i"),this.h()},l(e){t=i(e,"I",{class:!0}),o(t).forEach(r),this.h()},h(){l(t,"class","fas fa-chevron-right icon svelte-1qkpo3v"),E(t,"isOpen",e[0])},m(e,a){c(e,t,a)},p(e,a){1&a&&E(t,"isOpen",e[0])},d(e){e&&r(t)}}}function De(e){let t,a,n,h=e[2],d=[];for(let s=0;s<h.length;s+=1)d[s]=Ce(ke(e,h,s));return{c(){t=s("ul");for(let e=0;e<d.length;e+=1)d[e].c();this.h()},l(e){t=i(e,"UL",{class:!0});var a=o(t);for(let t=0;t<d.length;t+=1)d[t].l(a);a.forEach(r),this.h()},h(){l(t,"class","flex flex-wrap flex-row")},m(e,a){c(e,t,a);for(let n=0;n<d.length;n+=1)d[n].m(t,null);n=!0},p(e,a){if(52&a){let n;for(h=e[2],n=0;n<h.length;n+=1){const s=ke(e,h,n);d[n]?d[n].p(s,a):(d[n]=Ce(s),d[n].c(),d[n].m(t,null))}for(;n<d.length;n+=1)d[n].d(1);d.length=h.length}},i(e){n||(O((()=>{a||(a=T(t,S,{},!0)),a.run(1)})),n=!0)},o(e){a||(a=T(t,S,{},!1)),a.run(0),n=!1},d(e){e&&r(t),y(d,e),e&&a&&a.end()}}}function Ce(e){let t,a,n,h,d,u,f,m,g,x,y=e[10].title+"";function E(){return e[7](e[10])}return{c(){t=s("li"),a=s("div"),n=s("i"),d=p(),u=v(y),m=p(),this.h()},l(e){t=i(e,"LI",{class:!0});var s=o(t);a=i(s,"DIV",{class:!0});var l=o(a);n=i(l,"I",{class:!0}),o(n).forEach(r),d=$(l),u=w(l,y),l.forEach(r),m=$(s),s.forEach(r),this.h()},h(){l(n,"class",h=k(e[10].icon)+" svelte-1qkpo3v"),l(a,"class",f="text cursor-pointer font-semibold min-w-16 w-auto px-2 py-1 -mb-4 rounded-t block leading-normal "+(e[4]===e[10].id?"text-indigo-500 bg-white border-white":"text-white bg-indigo-500 border-indigo-500 hover:bg-indigo-600")),l(t,"class","mr-2 last:mr-0 w-28 h-6 flex-auto text-center")},m(e,s){c(e,t,s),b(t,a),b(a,n),b(a,d),b(a,u),b(t,m),g||(x=I(a,"click",D(E)),g=!0)},p(t,s){e=t,4&s&&h!==(h=k(e[10].icon)+" svelte-1qkpo3v")&&l(n,"class",h),4&s&&y!==(y=e[10].title+"")&&C(u,y),20&s&&f!==(f="text cursor-pointer font-semibold min-w-16 w-auto px-2 py-1 -mb-4 rounded-t block leading-normal "+(e[4]===e[10].id?"text-indigo-500 bg-white border-white":"text-white bg-indigo-500 border-indigo-500 hover:bg-indigo-600"))&&l(a,"class",f)},d(e){e&&r(t),g=!1,x()}}}function Oe(e){let t,a,n,h,d,u,f,m,g=e[1]&&Ie(e),x=e[0]&&e[2]&&De(e);return{c(){t=s("div"),a=s("span"),g&&g.c(),n=p(),h=v(e[3]),d=p(),x&&x.c(),this.h()},l(s){t=i(s,"DIV",{class:!0});var l=o(t);a=i(l,"SPAN",{class:!0});var c=o(a);g&&g.l(c),n=$(c),h=w(c,e[3]),c.forEach(r),d=$(l),x&&x.l(l),l.forEach(r),this.h()},h(){l(a,"class","text-white mr-2 font-semibold"),l(t,"class","flex cursor-default")},m(s,i){c(s,t,i),b(t,a),g&&g.m(a,null),b(a,n),b(a,h),b(t,d),x&&x.m(t,null),u=!0,f||(m=I(a,"click",D(e[6])),f=!0)},p(e,[s]){e[1]?g?g.p(e,s):(g=Ie(e),g.c(),g.m(a,n)):g&&(g.d(1),g=null),(!u||8&s)&&C(h,e[3]),e[0]&&e[2]?x?(x.p(e,s),5&s&&A(x,1)):(x=De(e),x.c(),A(x,1),x.m(t,null)):x&&(M(),V(x,1,1,(()=>{x=null})),N())},i(e){u||(A(x),u=!0)},o(e){V(x),u=!1},d(e){e&&r(t),g&&g.d(),x&&x.d(),f=!1,m()}}}function Te(e,t,a){var n;let{isCloseable:s=!0}=t,{tabs:i=[]}=t,{title:o}=t,{isOpen:r=!1}=t,l=null===(n=i[0])||void 0===n?void 0:n.id;const c=u(),h=e=>{a(4,l=e.id),c("select",e)};return e.$$set=e=>{"isCloseable"in e&&a(1,s=e.isCloseable),"tabs"in e&&a(2,i=e.tabs),"title"in e&&a(3,o=e.title),"isOpen"in e&&a(0,r=e.isOpen)},[r,s,i,o,l,h,()=>a(0,r=!r),e=>h(e)]}class Se extends t{constructor(e){super(),a(this,e,Te,Oe,n,{isCloseable:1,tabs:2,title:3,isOpen:0})}}const Ae=e=>({}),Me=e=>({});function Ve(e){let t,a,n;const h=e[5].default,d=R(h,e,e[4],null);return{c(){t=s("div"),d&&d.c(),this.h()},l(e){t=i(e,"DIV",{class:!0});var a=o(t);d&&d.l(a),a.forEach(r),this.h()},h(){l(t,"class","flex-grow overflow-auto")},m(e,a){c(e,t,a),d&&d.m(t,null),n=!0},p(e,t){d&&d.p&&(!n||16&t)&&L(d,h,e,e[4],t,null,null)},i(e){n||(A(d,e),O((()=>{a||(a=T(t,j,{},!0)),a.run(1)})),n=!0)},o(e){V(d,e),a||(a=T(t,j,{},!1)),a.run(0),n=!1},d(e){e&&r(t),d&&d.d(e),e&&a&&a.end()}}}function Ne(e){let t,a,n,h,d,u,f,g,v,w,x;function y(t){e[6](t)}let E={tabs:e[2],title:e[3],isCloseable:e[1]};void 0!==e[0]&&(E.isOpen=e[0]),h=new Se({props:E}),m.push((()=>_(h,"isOpen",y))),h.$on("select",e[7]);const k=e[5].actions,D=R(k,e,e[4],Me);let C=e[0]&&Ve(e);return{c(){t=s("div"),a=s("div"),n=s("div"),P(h.$$.fragment),u=p(),f=s("div"),D&&D.c(),g=p(),C&&C.c(),this.h()},l(e){t=i(e,"DIV",{class:!0});var s=o(t);a=i(s,"DIV",{class:!0});var l=o(a);n=i(l,"DIV",{class:!0});var c=o(n);B(h.$$.fragment,c),u=$(c),f=i(c,"DIV",{class:!0});var d=o(f);D&&D.l(d),d.forEach(r),c.forEach(r),l.forEach(r),g=$(s),C&&C.l(s),s.forEach(r),this.h()},h(){l(f,"class","flex gap-x-4 items-center text-white"),l(n,"class","flex justify-between"),l(a,"class","bg-indigo-400 border-gray-400 p-2 flex-none"),l(t,"class","bg-white rounded overflow-hidden shadow m-2 flex-grow flex flex-col")},m(s,i){c(s,t,i),b(t,a),b(a,n),U(h,n,null),b(n,u),b(n,f),D&&D.m(f,null),b(t,g),C&&C.m(t,null),v=!0,w||(x=I(a,"click",e[8]),w=!0)},p(e,[a]){const n={};4&a&&(n.tabs=e[2]),8&a&&(n.title=e[3]),2&a&&(n.isCloseable=e[1]),!d&&1&a&&(d=!0,n.isOpen=e[0],G((()=>d=!1))),h.$set(n),D&&D.p&&(!v||16&a)&&L(D,k,e,e[4],a,Ae,Me),e[0]?C?(C.p(e,a),1&a&&A(C,1)):(C=Ve(e),C.c(),A(C,1),C.m(t,null)):C&&(M(),V(C,1,1,(()=>{C=null})),N())},i(e){v||(A(h.$$.fragment,e),A(D,e),A(C),v=!0)},o(e){V(h.$$.fragment,e),V(D,e),V(C),v=!1},d(e){e&&r(t),H(h),D&&D.d(e),C&&C.d(),w=!1,x()}}}function _e(e,t,a){let{$$slots:n={},$$scope:s}=t,{isCloseable:i=!0}=t,{isOpen:o=!0}=t,{tabs:r=[]}=t,{title:l}=t;return e.$$set=e=>{"isCloseable"in e&&a(1,i=e.isCloseable),"isOpen"in e&&a(0,o=e.isOpen),"tabs"in e&&a(2,r=e.tabs),"title"in e&&a(3,l=e.title),"$$scope"in e&&a(4,s=e.$$scope)},e.$$.update=()=>{3&e.$$.dirty&&a(0,o=!i||o)},[o,i,r,l,s,n,function(e){o=e,a(0,o),a(1,i)},function(t){Y(e,t)},()=>a(0,o=!o)]}class Re extends t{constructor(e){super(),a(this,e,_e,Ne,n,{isCloseable:1,isOpen:0,tabs:2,title:3})}}function Le(e,t,a){const n=e.slice();return n[3]=t[a],n}function Pe(e){let t,a,n,h,d=e[3]+"";function u(){return e[2](e[3])}return{c(){t=s("button"),a=v(d),this.h()},l(e){t=i(e,"BUTTON",{class:!0});var n=o(t);a=w(n,d),n.forEach(r),this.h()},h(){l(t,"class","action-btn")},m(e,s){c(e,t,s),b(t,a),n||(h=I(t,"click",u),n=!0)},p(t,a){e=t},d(e){e&&r(t),n=!1,h()}}}function Be(e){let t,a=Object.keys(e[0]),n=[];for(let s=0;s<a.length;s+=1)n[s]=Pe(Le(e,a,s));return{c(){t=s("div");for(let e=0;e<n.length;e+=1)n[e].c();this.h()},l(e){t=i(e,"DIV",{class:!0});var a=o(t);for(let t=0;t<n.length;t+=1)n[t].l(a);a.forEach(r),this.h()},h(){l(t,"class","flex gap-2 flex-wrap p-2")},m(e,a){c(e,t,a);for(let s=0;s<n.length;s+=1)n[s].m(t,null)},p(e,s){if(3&s){let i;for(a=Object.keys(e[0]),i=0;i<a.length;i+=1){const o=Le(e,a,i);n[i]?n[i].p(o,s):(n[i]=Pe(o),n[i].c(),n[i].m(t,null))}for(;i<n.length;i+=1)n[i].d(1);n.length=a.length}},d(e){e&&r(t),y(n,e)}}}function Ue(e){let t,a;return t=new Re({props:{title:"Sample Diagrams",isOpen:!1,$$slots:{default:[Be]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){B(t.$$.fragment,e)},m(e,n){U(t,e,n),a=!0},p(e,[a]){const n={};64&a&&(n.$$scope={dirty:a,ctx:e}),t.$set(n)},i(e){a||(A(t.$$.fragment,e),a=!0)},o(e){V(t.$$.fragment,e),a=!1},d(e){H(t,e)}}}function Ge(e){const t={"Flow Chart":"graph TD\n A[Christmas] --\x3e|Get money| B(Go shopping)\n B --\x3e C{Let me think}\n C --\x3e|One| D[Laptop]\n C --\x3e|Two| E[iPhone]\n C --\x3e|Three| F[fa:fa-car Car]","Sequence Diagram":"sequenceDiagram\n Alice->>+John: Hello John, how are you?\n Alice->>+John: John, can you hear me?\n John--\x3e>-Alice: Hi Alice, I can hear you!\n John--\x3e>-Alice: I feel great!\n ","Class Diagram":"classDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }\n ","State Diagram":"stateDiagram-v2\n [*] --\x3e Still\n Still --\x3e [*]\n Still --\x3e Moving\n Moving --\x3e Still\n Moving --\x3e Crash\n Crash --\x3e [*]\n ","Gantt Chart":"gantt\n title A Gantt Diagram\n dateFormat YYYY-MM-DD\n section Section\n A task :a1, 2014-01-01, 30d\n Another task :after a1 , 20d\n section Another\n Task in sec :2014-01-12 , 12d\n another task : 24d\n ","Pie Chart":'pie title Pets adopted by volunteers\n "Dogs" : 386\n "Cats" : 85\n "Rats" : 15\n ',"ER Diagram":'erDiagram\n CUSTOMER }|..|{ DELIVERY-ADDRESS : has\n CUSTOMER ||--o{ ORDER : places\n CUSTOMER ||--o{ INVOICE : "liable for"\n DELIVERY-ADDRESS ||--o{ ORDER : receives\n INVOICE ||--|{ ORDER : covers\n ORDER ||--|{ ORDER-ITEM : includes\n PRODUCT-CATEGORY ||--|{ PRODUCT : contains\n PRODUCT ||--o{ ORDER-ITEM : "ordered in"\n ',"Git Graph":'gitGraph:\noptions\n{\n "nodeSpacing": 150,\n "nodeRadius": 10\n}\nend\ncommit\nbranch newbranch\ncheckout newbranch\ncommit\ncommit\ncheckout master\ncommit\ncommit\nmerge newbranch\n\n ',"User Journey":" journey\n title My working day\n section Go to work\n Make tea: 5: Me\n Go upstairs: 3: Me\n Do work: 1: Me, Cat\n section Go home\n Go downstairs: 5: Me\n Sit down: 3: Me\n "},a=e=>{re(t[e],!0,!0)};return[t,a,e=>a(e)]}class He extends t{constructor(e){super(),a(this,e,Ge,Ue,n,{})}}function je(e){let t,a,n;return{c(){t=s("input"),this.h()},l(e){t=i(e,"INPUT",{id:!0,type:!0,min:!0,max:!0}),this.h()},h(){l(t,"id","height"),l(t,"type","number"),l(t,"min","3"),l(t,"max","10000")},m(s,i){c(s,t,i),J(t,e[4]),a||(n=I(t,"input",e[14]),a=!0)},p(e,a){16&a&&q(t.value)!==e[4]&&J(t,e[4])},d(e){e&&r(t),a=!1,n()}}}function Ye(e){let t,a,n,d,u,f,m,g,x,y,E,k,D,C,O,T,S,A,M,V,N,_,R,L,P,B,U,G,H,j,Y,z,J,q,K,W,Z,X,Q,ee,te,ae,ne,se,ie,oe=e[5](),re=oe&&function(e){let t,a,n,d,u;return{c(){t=s("button"),a=s("i"),n=v(" Copy Image to clipboard"),this.h()},l(e){t=i(e,"BUTTON",{class:!0});var s=o(t);a=i(s,"I",{class:!0}),o(a).forEach(r),n=w(s," Copy Image to clipboard"),s.forEach(r),this.h()},h(){l(a,"class","far fa-copy"),l(t,"class","action-btn w-full")},m(s,i){c(s,t,i),b(t,a),b(t,n),d||(u=I(t,"click",e[6]),d=!0)},p:h,d(e){e&&r(t),d=!1,u()}}}(e),le="auto"!==e[3]&&je(e);return{c(){t=s("div"),re&&re.c(),a=p(),n=s("button"),d=s("i"),u=v(" PNG"),f=p(),m=s("button"),g=s("i"),x=v(" SVG"),y=p(),E=s("button"),k=s("a"),D=s("i"),C=v(" PNG"),O=p(),T=s("button"),S=s("a"),A=s("i"),M=v(" SVG"),V=p(),N=s("div"),_=v("PNG size\n\t\t\t"),R=s("input"),L=p(),P=s("label"),B=v("Auto"),U=p(),G=s("input"),H=p(),j=s("label"),Y=v("Width"),z=p(),J=s("input"),q=p(),K=s("label"),W=v("Height"),Z=p(),le&&le.c(),X=p(),Q=s("div"),ee=s("label"),te=v("Copy Markdown"),ae=p(),ne=s("input"),this.h()},l(e){t=i(e,"DIV",{class:!0});var s=o(t);re&&re.l(s),a=$(s),n=i(s,"BUTTON",{class:!0});var l=o(n);d=i(l,"I",{class:!0}),o(d).forEach(r),u=w(l," PNG"),l.forEach(r),f=$(s),m=i(s,"BUTTON",{class:!0});var c=o(m);g=i(c,"I",{class:!0}),o(g).forEach(r),x=w(c," SVG"),c.forEach(r),y=$(s),E=i(s,"BUTTON",{class:!0});var h=o(E);k=i(h,"A",{target:!0,href:!0});var p=o(k);D=i(p,"I",{class:!0}),o(D).forEach(r),C=w(p," PNG"),p.forEach(r),h.forEach(r),O=$(s),T=i(s,"BUTTON",{class:!0});var v=o(T);S=i(v,"A",{target:!0,href:!0});var b=o(S);A=i(b,"I",{class:!0}),o(A).forEach(r),M=w(b," SVG"),b.forEach(r),v.forEach(r),V=$(s),N=i(s,"DIV",{class:!0});var I=o(N);_=w(I,"PNG size\n\t\t\t"),R=i(I,"INPUT",{type:!0,value:!0,id:!0}),L=$(I),P=i(I,"LABEL",{for:!0});var F=o(P);B=w(F,"Auto"),F.forEach(r),U=$(I),G=i(I,"INPUT",{type:!0,value:!0,id:!0}),H=$(I),j=i(I,"LABEL",{for:!0});var se=o(j);Y=w(se,"Width"),se.forEach(r),z=$(I),J=i(I,"INPUT",{type:!0,value:!0,id:!0}),q=$(I),K=i(I,"LABEL",{for:!0});var ie=o(K);W=w(ie,"Height"),ie.forEach(r),Z=$(I),le&&le.l(I),I.forEach(r),X=$(s),Q=i(s,"DIV",{class:!0});var oe=o(Q);ee=i(oe,"LABEL",{for:!0});var ce=o(ee);te=w(ce,"Copy Markdown"),ce.forEach(r),ae=$(oe),ne=i(oe,"INPUT",{class:!0,id:!0,type:!0,value:!0}),oe.forEach(r),s.forEach(r),this.h()},h(){l(d,"class","fas fa-download"),l(n,"class","action-btn flex-auto"),l(g,"class","fas fa-download"),l(m,"class","action-btn flex-auto"),l(D,"class","fas fa-external-link-alt"),l(k,"target","_blank"),l(k,"href",e[0]),l(E,"class","action-btn flex-auto"),l(A,"class","fas fa-external-link-alt"),l(S,"target","_blank"),l(S,"href",e[1]),l(T,"class","action-btn flex-auto"),l(R,"type","radio"),R.__value="auto",R.value=R.__value,l(R,"id","autosize"),e[11][0].push(R),l(P,"for","autosize"),l(G,"type","radio"),G.__value="width",G.value=G.__value,l(G,"id","width-active"),e[11][0].push(G),l(j,"for","width"),l(J,"type","radio"),J.__value="height",J.value=J.__value,l(J,"id","height-active"),e[11][0].push(J),l(K,"for","height"),l(N,"class","flex gap-2 items-center"),l(ee,"for","markdown"),l(ne,"class","flex-1"),l(ne,"id","markdown"),l(ne,"type","text"),ne.value=e[2],l(Q,"class","w-full flex gap-2 items-center"),l(t,"class","flex flex-wrap gap-2 m-2")},m(s,i){c(s,t,i),re&&re.m(t,null),b(t,a),b(t,n),b(n,d),b(n,u),b(t,f),b(t,m),b(m,g),b(m,x),b(t,y),b(t,E),b(E,k),b(k,D),b(k,C),b(t,O),b(t,T),b(T,S),b(S,A),b(S,M),b(t,V),b(t,N),b(N,_),b(N,R),R.checked=R.__value===e[3],b(N,L),b(N,P),b(P,B),b(N,U),b(N,G),G.checked=G.__value===e[3],b(N,H),b(N,j),b(j,Y),b(N,z),b(N,J),J.checked=J.__value===e[3],b(N,q),b(N,K),b(K,W),b(N,Z),le&&le.m(N,null),b(t,X),b(t,Q),b(Q,ee),b(ee,te),b(Q,ae),b(Q,ne),se||(ie=[I(n,"click",e[7]),I(m,"click",e[8]),I(R,"change",e[10]),I(G,"change",e[12]),I(J,"change",e[13]),I(ne,"click",e[9])],se=!0)},p(e,t){oe&&re.p(e,t),1&t&&l(k,"href",e[0]),2&t&&l(S,"href",e[1]),8&t&&(R.checked=R.__value===e[3]),8&t&&(G.checked=G.__value===e[3]),8&t&&(J.checked=J.__value===e[3]),"auto"!==e[3]?le?le.p(e,t):(le=je(e),le.c(),le.m(N,null)):le&&(le.d(1),le=null),4&t&&ne.value!==e[2]&&(ne.value=e[2])},d(a){a&&r(t),re&&re.d(),e[11][0].splice(e[11][0].indexOf(R),1),e[11][0].splice(e[11][0].indexOf(G),1),e[11][0].splice(e[11][0].indexOf(J),1),le&&le.d(),se=!1,F(ie)}}}function ze(e){let t,a;return t=new Re({props:{title:"Actions",isOpen:!1,$$slots:{default:[Ye]},$$scope:{ctx:e}}}),{c(){P(t.$$.fragment)},l(e){B(t.$$.fragment,e)},m(e,n){U(t,e,n),a=!0},p(e,[a]){const n={};1048607&a&&(n.$$scope={dirty:a,ctx:e}),t.$set(n)},i(e){a||(A(t.$$.fragment,e),a=!0)},o(e){V(t.$$.fragment,e),a=!1},d(e){H(t,e)}}}function Je(e,t,a){const n=(e,t,a)=>{null==e||e.setAttribute("height",`${a}px`),null==e||e.setAttribute("width",`${t}px`),e||(e=document.querySelector("#container svg"));const n=e.outerHTML.replaceAll("<br>","<br/>");return z(n)},s=(e,t)=>{const a=document.createElement("canvas"),s=document.querySelector("#container svg"),i=s.getBoundingClientRect();if(a.width=i.width,a.height=i.height,"width"===d){const e=i.height/i.width;a.width=u,a.height=u*e}else if("height"===d){const e=i.width/i.height;a.width=u*e,a.height=u}const o=a.getContext("2d");o.fillStyle="white",o.fillRect(0,0,a.width,a.height);const r=new Image;r.onload=t(o,r),r.src=`data:image/svg+xml;base64,${n(s,a.width,a.height)}`,e.stopPropagation(),e.preventDefault()},i=(e,t)=>{const a=document.createElement("a");a.download=e,a.href=t,a.click(),a.remove()},o=(e,t)=>()=>{const{canvas:a}=e;e.drawImage(t,0,0,a.width,a.height),i(`mermaid-diagram-${K().format("YYYYMMDDHHmmss")}.png`,a.toDataURL("image/png").replace("image/png","image/octet-stream"))},r=(e,t)=>()=>{const{canvas:a}=e;e.drawImage(t,0,0,a.width,a.height),a.toBlob((e=>{try{navigator.clipboard.write([new ClipboardItem({[e.type]:e})])}catch(t){console.error(t)}}))};let l,c,h,d="auto",u=1080;ie.subscribe((e=>{const t=JSON.parse(JSON.stringify(e));"string"==typeof t.mermaid&&(t.mermaid=JSON.parse(t.mermaid));const n=z(JSON.stringify(t),!0);a(0,l=`https://mermaid.ink/img/${n}`),a(1,c=`https://mermaid.ink/svg/${n}`),a(2,h=`[![](${l})](${window.location.protocol}//${window.location.host}${window.location.pathname}#${window.location.hash})`)}));return[l,c,h,d,u,()=>Object.prototype.hasOwnProperty.call(window,"ClipboardItem"),e=>{s(e,r)},e=>{s(e,o)},()=>{i(`mermaid-diagram-${K().format("YYYYMMDDHHmmss")}.svg`,`data:image/svg+xml;base64,${n()}`)},e=>{e.target.select(),document.execCommand("Copy")},function(){d=this.__value,a(3,d)},[[]],function(){d=this.__value,a(3,d)},function(){d=this.__value,a(3,d)},function(){u=q(this.value),a(4,u)}]}class qe extends t{constructor(e){super(),a(this,e,Je,ze,n,{})}}const Fe=W(X(!0),Z(),"autoHistoryMode"),Ke=W(X([]),Z(),"autoHistoryStore"),We=W(X([]),Z(),"manualHistoryStore"),Ze=Q([Fe,Ke,We],(([e,t,a],n)=>{n(e?t:a)}));function Xe(e,t,a){const n=e.slice();return n[14]=t[a].state,n[15]=t[a].time,n[16]=t[a].name,n}function Qe(e){let t,a,n,d,u,f;return{c(){t=s("div"),a=v("No items in History"),n=s("br"),d=v("\n\t\t\t\tClick the Save button to save current state and restore it later."),u=s("br"),f=v("\n\t\t\t\tTimeline will automatically be saved every minute."),this.h()},l(e){t=i(e,"DIV",{class:!0});var s=o(t);a=w(s,"No items in History"),n=i(s,"BR",{}),d=w(s,"\n\t\t\t\tClick the Save button to save current state and restore it later."),u=i(s,"BR",{}),f=w(s,"\n\t\t\t\tTimeline will automatically be saved every minute."),s.forEach(r),this.h()},h(){l(t,"class","m-2 text-gray-600")},m(e,s){c(e,t,s),b(t,a),b(t,n),b(t,d),b(t,u),b(t,f)},p:h,d(e){e&&r(t)}}}function et(e){let t,a=e[1],n=[];for(let s=0;s<a.length;s+=1)n[s]=tt(Xe(e,a,s));return{c(){for(let e=0;e<n.length;e+=1)n[e].c();t=ae()},l(e){for(let t=0;t<n.length;t+=1)n[t].l(e);t=ae()},m(e,a){for(let t=0;t<n.length;t+=1)n[t].m(e,a);c(e,t,a)},p(e,s){if(226&s){let i;for(a=e[1],i=0;i<a.length;i+=1){const o=Xe(e,a,i);n[i]?n[i].p(o,s):(n[i]=tt(o),n[i].c(),n[i].m(t.parentNode,t))}for(;i<n.length;i+=1)n[i].d(1);n.length=a.length}},d(e){y(n,e),e&&r(t)}}}function tt(e){let t,a,n,h,d,u,f,m,g,x,y,E,k,D,O,T,S,A,M,V,N,_=e[16]+"",R=e[7](e[15])+"";function L(){return e[10](e[14])}function P(){return e[11](e[15])}return{c(){t=s("li"),a=s("div"),n=s("div"),h=s("div"),d=s("span"),u=v(_),f=p(),m=s("span"),g=v(R),x=p(),y=s("div"),E=s("button"),k=s("i"),D=v(" Restore"),O=p(),T=s("button"),S=s("i"),A=v(" Delete"),M=p(),this.h()},l(e){t=i(e,"LI",{class:!0});var s=o(t);a=i(s,"DIV",{class:!0});var l=o(a);n=i(l,"DIV",{class:!0});var c=o(n);h=i(c,"DIV",{class:!0});var p=o(h);d=i(p,"SPAN",{});var v=o(d);u=w(v,_),v.forEach(r),f=$(p),m=i(p,"SPAN",{class:!0});var b=o(m);g=w(b,R),b.forEach(r),p.forEach(r),c.forEach(r),x=$(l),y=i(l,"DIV",{class:!0});var I=o(y);E=i(I,"BUTTON",{class:!0});var C=o(E);k=i(C,"I",{class:!0}),o(k).forEach(r),D=w(C," Restore"),C.forEach(r),O=$(I),T=i(I,"BUTTON",{class:!0});var V=o(T);S=i(V,"I",{class:!0}),o(S).forEach(r),A=w(V," Delete"),V.forEach(r),I.forEach(r),l.forEach(r),M=$(s),s.forEach(r),this.h()},h(){l(m,"class","text-gray-400 text-sm"),l(h,"class","flex flex-col"),l(n,"class","flex-1"),l(k,"class","fas fa-undo"),l(E,"class","rounded px-2 w-24 bg-green-200 hover:bg-green-300"),l(S,"class","fas fa-trash-alt"),l(T,"class","rounded px-2 w-24 bg-red-200 hover:bg-red-300"),l(y,"class","flex gap-2 content-center"),l(a,"class","flex"),l(t,"class","rounded p-2 shadow flex-col")},m(e,s){c(e,t,s),b(t,a),b(a,n),b(n,h),b(h,d),b(d,u),b(h,f),b(h,m),b(m,g),b(a,x),b(a,y),b(y,E),b(E,k),b(E,D),b(y,O),b(y,T),b(T,S),b(T,A),b(t,M),V||(N=[I(E,"click",L),I(T,"click",P)],V=!0)},p(t,a){e=t,2&a&&_!==(_=e[16]+"")&&C(u,_),2&a&&R!==(R=e[7](e[15])+"")&&C(g,R)},d(e){e&&r(t),V=!1,F(N)}}}function at(e){let t;function a(e,t){return e[1].length>0?et:Qe}let n=a(e),h=n(e);return{c(){t=s("ul"),h.c(),this.h()},l(e){t=i(e,"UL",{class:!0,id:!0});var a=o(t);h.l(a),a.forEach(r),this.h()},h(){l(t,"class","p-2 space-y-2 overflow-auto h-56"),l(t,"id","historyList")},m(e,a){c(e,t,a),h.m(t,null)},p(e,s){n===(n=a(e))&&h?h.p(e,s):(h.d(1),h=n(e),h&&(h.c(),h.m(t,null)))},d(e){e&&r(t),h.d()}}}function nt(e){let t,a,n,d,u,f,m,g;return{c(){t=s("div"),a=s("button"),n=s("i"),d=p(),u=s("button"),f=s("i"),this.h()},l(e){t=i(e,"DIV",{slot:!0});var s=o(t);a=i(s,"BUTTON",{id:!0,class:!0,title:!0});var l=o(a);n=i(l,"I",{class:!0}),o(n).forEach(r),l.forEach(r),d=$(s),u=i(s,"BUTTON",{id:!0,class:!0,title:!0});var c=o(u);f=i(c,"I",{class:!0}),o(f).forEach(r),c.forEach(r),s.forEach(r),this.h()},h(){l(n,"class","far fa-save"),l(a,"id","saveHistory"),l(a,"class","btn"),l(a,"title","Save current state"),l(f,"class","fas fa-trash-alt"),l(u,"id","clearHistory"),l(u,"class","btn text-red-400"),l(u,"title","Delete all saved states"),l(t,"slot","actions")},m(s,i){c(s,t,i),b(t,a),b(a,n),b(t,d),b(t,u),b(u,f),m||(g=[I(a,"click",D(e[8])),I(u,"click",D(e[9]))],m=!0)},p:h,d(e){e&&r(t),m=!1,F(g)}}}function st(e){let t,a,n;function s(t){e[12](t)}let i={tabs:e[3],title:"History",$$slots:{actions:[nt],default:[at]},$$scope:{ctx:e}};return void 0!==e[0]&&(i.isOpen=e[0]),t=new Re({props:i}),m.push((()=>_(t,"isOpen",s))),t.$on("select",e[2]),{c(){P(t.$$.fragment)},l(e){B(t.$$.fragment,e)},m(e,a){U(t,e,a),n=!0},p(e,[n]){const s={};524290&n&&(s.$$scope={dirty:n,ctx:e}),!a&&1&n&&(a=!0,s.isOpen=e[0],G((()=>a=!1))),t.$set(s)},i(e){n||(A(t.$$.fragment,e),n=!0)},o(e){V(t.$$.fragment,e),n=!1},d(e){H(t,e)}}}function it(e,t,a){let n,s;d(e,ie,(e=>a(13,n=e))),d(e,Ze,(e=>a(1,s=e)));const i=(e=!1)=>{const t=le();var a;(e=>{const t=te(e?Ke:We);return t.length>0?JSON.stringify(t[0].state):""})(e)!==t?((a={state:n,time:Date.now(),auto:e}).name=ee(2),a.auto?Ke.update((e=>(30===e.length&&e.pop(),[a,...e]))):We.update((e=>[a,...e]))):e||alert("State already saved.")},o=e=>{var t;(e||confirm("Clear all saved items?"))&&(t=e,(te(Fe)?Ke:We).update((e=>e.filter((e=>t&&e.time!=t)))))},r=e=>{ie.set(Object.assign(Object.assign({},e),{updateEditor:!0,updateDiagram:!0}))};f((()=>{Fe.set(!1),setInterval((()=>{i(!0)}),6e4)}));let l=!0;return[l,s,e=>{Fe.set("timeline"===e.detail.id)},[{id:"saved",title:"Saved",icon:"far fa-bookmark"},{id:"timeline",title:"Timeline",icon:"fas fa-history"}],i,o,r,e=>{const t=new Date(e);return`${new Date(t).toLocaleString()} (${K(t).fromNow()})`},()=>i(),()=>o(),e=>r(e),e=>o(e),function(e){l=e,a(0,l)}]}class ot extends t{constructor(e){super(),a(this,e,it,st,n,{})}}function rt(e){let t,a,n;function s(t){e[10](t)}let i={language:e[2],errorMarkers:e[3]};return void 0!==e[1]&&(i.text=e[1]),t=new $e({props:i}),m.push((()=>_(t,"text",s))),t.$on("update",e[6]),{c(){P(t.$$.fragment)},l(e){B(t.$$.fragment,e)},m(e,a){U(t,e,a),n=!0},p(e,n){const s={};4&n&&(s.language=e[2]),8&n&&(s.errorMarkers=e[3]),!a&&2&n&&(a=!0,s.text=e[1],G((()=>a=!1))),t.$set(s)},i(e){n||(A(t.$$.fragment,e),n=!0)},o(e){V(t.$$.fragment,e),n=!1},d(e){H(t,e)}}}function lt(e){let t,a,n,d;return{c(){t=s("button"),a=s("i"),this.h()},l(e){t=i(e,"BUTTON",{class:!0,title:!0,"data-cy":!0});var n=o(t);a=i(n,"I",{class:!0}),o(a).forEach(r),n.forEach(r),this.h()},h(){l(a,"class","fas fa-sync"),l(t,"class","bg-indigo-500 hover:bg-indigo-700 rounded px-4 mx-2"),l(t,"title","Sync Diagram"),l(t,"data-cy","sync")},m(e,s){c(e,t,s),b(t,a),n||(d=I(t,"click",fe),n=!0)},p:h,d(e){e&&r(t),n=!1,d()}}}function ct(e){let t,a,n,h,d,u,f,m=!e[0].autoSync&&lt();return{c(){t=s("div"),m&&m.c(),a=p(),n=s("label"),h=s("input"),d=v("\n\t\t\t\t\t\tAuto sync"),this.h()},l(e){t=i(e,"DIV",{slot:!0});var s=o(t);m&&m.l(s),a=$(s),n=i(s,"LABEL",{for:!0,style:!0});var l=o(n);h=i(l,"INPUT",{type:!0,id:!0}),d=w(l,"\n\t\t\t\t\t\tAuto sync"),l.forEach(r),s.forEach(r),this.h()},h(){l(h,"type","checkbox"),l(h,"id","autoSync"),l(n,"for","autoSync"),ne(n,"white-space","nowrap"),ne(n,"overflow","hidden"),ne(n,"text-overflow","ellipsis"),l(t,"slot","actions")},m(s,i){c(s,t,i),m&&m.m(t,null),b(t,a),b(t,n),b(n,h),h.checked=e[0].autoSync,b(n,d),u||(f=I(h,"change",e[9]),u=!0)},p(e,n){e[0].autoSync?m&&(m.d(1),m=null):m?m.p(e,n):(m=lt(),m.c(),m.m(t,a)),1&n&&(h.checked=e[0].autoSync)},d(e){e&&r(t),m&&m.d(),u=!1,f()}}}function ht(e){let t,a,n;return a=new ce({}),{c(){t=s("div"),P(a.$$.fragment),this.h()},l(e){t=i(e,"DIV",{class:!0});var n=o(t);B(a.$$.fragment,n),n.forEach(r),this.h()},h(){l(t,"class","flex-1 overflow-auto")},m(e,s){c(e,t,s),U(a,t,null),n=!0},i(e){n||(A(a.$$.fragment,e),n=!0)},o(e){V(a.$$.fragment,e),n=!1},d(e){e&&r(t),H(a)}}}function dt(e){let t,a,n,d,u;return{c(){t=s("button"),a=s("i"),n=v(" View"),this.h()},l(e){t=i(e,"BUTTON",{slot:!0,class:!0,title:!0});var s=o(t);a=i(s,"I",{class:!0}),o(a).forEach(r),n=w(s," View"),s.forEach(r),this.h()},h(){l(a,"class","far fa-eye"),l(t,"slot","actions"),l(t,"class","btn"),l(t,"title","View diagram in new page")},m(s,i){c(s,t,i),b(t,a),b(t,n),d||(u=I(t,"click",D(e[11])),d=!0)},p:h,d(e){e&&r(t),d=!1,u()}}}function ut(e){let t,a,n,h,d,u,f,m,g,x,y,E,k,I,D,C,O,T,S,M,N,_;return a=new Ee({}),u=new Re({props:{tabs:e[5],isCloseable:!1,title:"Mermaid",$$slots:{actions:[ct],default:[rt]},$$scope:{ctx:e}}}),u.$on("select",e[4]),g=new He({}),y=new ot({}),k=new qe({}),T=new Re({props:{title:"Diagram",isCloseable:!1,$$slots:{actions:[dt],default:[ht]},$$scope:{ctx:e}}}),{c(){t=s("div"),P(a.$$.fragment),n=p(),h=s("div"),d=s("div"),P(u.$$.fragment),f=p(),m=s("div"),P(g.$$.fragment),x=p(),P(y.$$.fragment),E=p(),P(k.$$.fragment),I=p(),D=s("div"),C=p(),O=s("div"),P(T.$$.fragment),S=p(),M=s("div"),N=v("Code editing not supported on mobile. Please use a desktop browser."),this.h()},l(e){t=i(e,"DIV",{class:!0});var s=o(t);B(a.$$.fragment,s),n=$(s),h=i(s,"DIV",{class:!0});var l=o(h);d=i(l,"DIV",{class:!0,id:!0,style:!0});var c=o(d);B(u.$$.fragment,c),f=$(c),m=i(c,"DIV",{class:!0});var p=o(m);B(g.$$.fragment,p),x=$(p),B(y.$$.fragment,p),E=$(p),B(k.$$.fragment,p),p.forEach(r),c.forEach(r),I=$(l),D=i(l,"DIV",{id:!0,class:!0}),o(D).forEach(r),C=$(l),O=i(l,"DIV",{class:!0});var v=o(O);B(T.$$.fragment,v),S=$(v),M=i(v,"DIV",{class:!0});var b=o(M);N=w(b,"Code editing not supported on mobile. Please use a desktop browser."),b.forEach(r),v.forEach(r),l.forEach(r),s.forEach(r),this.h()},h(){l(m,"class","-mt-2"),l(d,"class","hidden md:flex flex-col"),l(d,"id","editorPane"),ne(d,"width","40%"),l(D,"id","resizeHandler"),l(D,"class","svelte-ub8fux"),l(M,"class","md:hidden bg-white rounded shadow p-2 mx-2"),l(O,"class","flex-1 flex flex-col overflow-hidden"),l(h,"class","flex-1 flex overflow-hidden"),l(t,"class","h-full flex flex-col overflow-hidden bg-gray-100")},m(e,s){c(e,t,s),U(a,t,null),b(t,n),b(t,h),b(h,d),U(u,d,null),b(d,f),b(d,m),U(g,m,null),b(m,x),U(y,m,null),b(m,E),U(k,m,null),b(h,I),b(h,D),b(h,C),b(h,O),U(T,O,null),b(O,S),b(O,M),b(M,N),_=!0},p(e,[t]){const a={};262159&t&&(a.$$scope={dirty:t,ctx:e}),u.$set(a);const n={};262144&t&&(n.$$scope={dirty:t,ctx:e}),T.$set(n)},i(e){_||(A(a.$$.fragment,e),A(u.$$.fragment,e),A(g.$$.fragment,e),A(y.$$.fragment,e),A(k.$$.fragment,e),A(T.$$.fragment,e),_=!0)},o(e){V(a.$$.fragment,e),V(u.$$.fragment,e),V(g.$$.fragment,e),V(y.$$.fragment,e),V(k.$$.fragment,e),V(T.$$.fragment,e),_=!1},d(e){e&&r(t),H(a),H(u),H(g),H(y),H(k),H(T)}}}function ft(e,t,a){let n,s;d(e,ie,(e=>a(0,n=e))),d(e,he,(e=>a(12,s=e)));var i=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(s,i){function o(e){try{l(n.next(e))}catch(t){i(t)}}function r(e){try{l(n.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(o,r)}l((n=n.apply(e,t||[])).next())}))};const o=window.mermaid;let r="code";const l={code:"mermaid",config:"json"};let c="",h="mermaid",u=[];ie.subscribe((e=>{e.updateEditor&&a(1,c="code"===r?e.code:e.mermaid)}));const m=()=>{window.open(`${ge}/view#${s}`,"_blank").focus()};f((()=>i(void 0,void 0,void 0,(function*(){yield ue();const e=document.getElementById("resizeHandler"),t=document.getElementById("editorPane"),a=e=>{const a=e.pageX-t.getBoundingClientRect().left;a>50&&(t.style.width=`${a}px`)},n=()=>{window.removeEventListener("mousemove",a)};e.addEventListener("mousedown",(e=>{e.preventDefault(),window.addEventListener("mousemove",a),window.addEventListener("mouseup",n)}))}))));return e.$$.update=()=>{256&e.$$.dirty&&a(2,h=l[r]),257&e.$$.dirty&&a(1,c="code"===r?n.code:n.mermaid)},[n,c,h,u,e=>{se(ie,n.updateEditor=!0,n),a(8,r=e.detail.id)},[{id:"code",title:"Code",icon:"fas fa-code"},{id:"config",title:"Config",icon:"fas fa-cogs"}],e=>{try{"code"===r?(n=e.detail.text,o.parse(n),re(n,!1)):(t=e.detail.text,JSON.parse(t),me(t,!1)),de.set(void 0),a(3,u=[])}catch(s){if(de.set(s),s.hash){const e={severity:8,startLineNumber:s.hash.loc.first_line,startColumn:s.hash.loc.first_column,endLineNumber:s.hash.loc.last_line,endColumn:s.hash.loc.last_column+1,message:s.str};u.push(e),a(3,u=u.filter((t=>t.startLineNumber>=e.startLineNumber&&t.startColumn>=e.startColumn)))}console.error(s)}var t,n},m,r,function(){n.autoSync=this.checked,ie.set(n)},function(e){c=e,a(1,c),a(8,r),a(0,n)},()=>m()]}export default class extends t{constructor(e){super(),a(this,e,ft,ut,n,{})}}