@zenuml/core 3.7.0 → 3.7.1

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.
@@ -33594,7 +33594,11 @@ class HO {
33594
33594
  K(this, "_theme");
33595
33595
  K(this, "store");
33596
33596
  K(this, "app");
33597
- this.el = e, this.store = Hf(o3()), this.app = Ii(n ? u0 : Q3), this.app.component("Comment", zi), this.app.component("Block", DO), this.app.use(this.store), this.app.mount(this.el);
33597
+ this.el = e, this.store = Hf(o3()), this.app = Ii(n ? u0 : Q3), this.app.component("Comment", zi), this.app.component("Block", DO), this.app.use(this.store), this.app.mount(this.el), this.addPortalRootElement();
33598
+ }
33599
+ addPortalRootElement() {
33600
+ const e = document.createElement("div");
33601
+ e.id = "headlessui-portal-root", e.className = "zenuml", e.append(document.createElement("div")), document.body.append(e);
33598
33602
  }
33599
33603
  async render(e, n) {
33600
33604
  return $O.debug("rendering", e, n), this._code = e || this._code, this._theme = (n == null ? void 0 : n.theme) || this._theme, this.store.state.stickyOffset = (n == null ? void 0 : n.stickyOffset) || 0, this.store.state.theme = this._theme || "default", await this.store.dispatch("updateCode", { code: this._code }), Promise.resolve(this);
package/dist/zenuml.js CHANGED
@@ -596,5 +596,5 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Hn=N,nt=se);const Lt={
596
596
  </code>
597
597
  `:`<code>${t}</code>`}};pe.setOptions({highlight:function(t,e){if(!e)return Jr.highlightAuto(t).value;const n=Jr.getLanguage(e)?e:"plaintext";return Jr.highlight(n,t).value},breaks:!0}),pe.use({renderer:oS});const lS={name:"comment",props:["comment","commentObj"],computed:{markedComment(){var t,e;return((t=this.commentObj)==null?void 0:t.text)&&pe.parse((e=this.commentObj)==null?void 0:e.text)||this.comment&&pe.parse(this.comment)},textStyle(){var t;return(t=this.commentObj)==null?void 0:t.textStyle},classNames(){var t;return(t=this.commentObj)==null?void 0:t.classNames}}},aS={class:"comments text-skin-comment min-w-[100px] flex justify-around text-left text-sm opacity-50 hover:opacity-100"},cS=["innerHTML"];function uS(t,e,n,r,s,i){return R(),W("div",aS,[w("div",{innerHTML:i.markedComment,class:Ce(i.classNames),style:_e(i.textStyle)},null,14,cS)])}const qi=Fe(lS,[["render",uS],["__scopeId","data-v-ab994f03"]]),eI="",hS={props:["collapsed"],emits:["click"]},fS={class:"collapsible-header"},dS=[Br('<g id="SVGRepo_bgCarrier" stroke-width="0" data-v-1bb203db></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" data-v-1bb203db></g><g id="SVGRepo_iconCarrier" data-v-1bb203db><line x1="13" y1="2" x2="13" y2="10" data-v-1bb203db></line><polyline points="9 7 13 11 17 7" data-v-1bb203db></polyline><line x1="13" y1="23" x2="13" y2="15" data-v-1bb203db></line><polyline points="9 19 13 15 17 19" data-v-1bb203db></polyline></g>',3)],pS=[Br('<g id="SVGRepo_bgCarrier" stroke-width="0" data-v-1bb203db></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" data-v-1bb203db></g><g id="SVGRepo_iconCarrier" data-v-1bb203db><line x1="13" y1="1" x2="13" y2="9" data-v-1bb203db></line><polyline points="9 5 13 1 17 5" data-v-1bb203db></polyline><line x1="13" y1="13" x2="13" y2="13" data-v-1bb203db></line><line x1="13" y1="24" x2="13" y2="17" data-v-1bb203db></line><polyline points="9 20 13 24 17 20" data-v-1bb203db></polyline></g>',3)];function gS(t,e,n,r,s,i){return R(),W("div",fS,[(R(),W("svg",{width:"20px",height:"20px",class:Ce([{hidden:n.collapsed,expanded:!n.collapsed},"collapse-button cursor-pointer"]),onClick:e[0]||(e[0]=o=>t.$emit("click",o)),viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"miter"},dS,2)),(R(),W("svg",{width:"20px",height:"20px",class:Ce([{hidden:!n.collapsed},"cursor-pointer"]),onClick:e[1]||(e[1]=o=>t.$emit("click",o)),viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"miter"},pS,2))])}const mS=Fe(hS,[["render",gS],["__scopeId","data-v-1bb203db"]]),rI="",sI="",xS={name:"occurrence",props:["context","selfCallIndent","participant","rtl","number"],data:function(){return{center:0,collapsed:!1}},computed:{...Jt(["centerOf","messageLayerLeft"]),...Qt(["code"]),computedCenter:function(){try{return this.centerOf(this.participant)}catch(t){return console.error(t),0}},hasAnyStatementsExceptReturn:function(){var r;let t=this.context.braceBlock();if(!t)return!1;let e=((r=t.block())==null?void 0:r.stat())||[],n=e.length;return n>1||n==1&&e[0].ret()==null}},methods:{toggle(t){this.collapsed=!this.collapsed,Hc.$emit("participant_set_top")}},components:{CollapseButton:mS},watch:{context(t){this.collapsed&&(this.collapsed=!1)}}},LS=["data-belongs-to","data-x-offset","data-debug-center-of"];function _S(t,e,n,r,s,i){const o=xe("collapse-button"),l=xe("block");return R(),W("div",{class:Ce(["occurrence shadow-occurrence border-skin-occurrence bg-skin-occurrence rounded-sm border-2 relative left-full",{"right-to-left":n.rtl}]),"data-el-type":"occurrence","data-belongs-to":n.participant,"data-x-offset":t.center,"data-debug-center-of":i.computedCenter},[i.hasAnyStatementsExceptReturn?(R(),Ue(o,{key:0,collapsed:t.collapsed,onClick:this.toggle},null,8,["collapsed","onClick"])):ye("",!0),this.context.braceBlock()?(R(),Ue(l,{key:1,context:n.context.braceBlock().block(),selfCallIndent:n.selfCallIndent,number:n.number,collapsed:t.collapsed},null,8,["context","selfCallIndent","number","collapsed"])):ye("",!0)],10,LS)}const h4=Fe(xS,[["render",_S],["__scopeId","data-v-754aa20b"]]);class Us{constructor(e,n,r,s){K(this,"start");K(this,"stop");this.start={line:e,col:n},this.stop={line:r,col:s}}static from(e){const n=e.start,r=e.stop;return new Us(n.line,n.column,r.line,r.column+r.text.length)}}const f4=js.child({name:"Creation"}),yS={name:"creation",props:["context","comment","selfCallIndent","number"],computed:{...Jt(["cursor","onElementClick","distance"]),...Qt(["numbering"]),from(){return this.context.Origin()},creation(){return this.context.creation()},interactionWidth(){let t=Math.abs(this.distance(this.to,this.from)),e=this.selfCallIndent||0;return t+(this.rightToLeft?e:-e)},rightToLeft(){return this.distance(this.to,this.from)<0},signature(){return this.creation.SignatureText()},assignee(){function t(s){return s&&s.getFormattedText()||""}let e=this.creation.creationBody().assignment();if(!e)return"";let n=t(e.assignee());const r=t(e.type());return n+(r?":"+r:"")},to(){return this.creation.Owner()},isCurrent(){return this.creation.isCurrent(this.cursor)},isInitedFromOccurrence:function(){return this.creation.isInitedFromOccurrence(this.from)}},mounted(){this.layoutMessageContainer(),f4.log(`mounted for ${this.to}`)},updated(){this.layoutMessageContainer(),f4.debug(`mounted for ${this.to}`)},methods:{layoutMessageContainer(){(()=>{if(!this.$refs.participantPlaceHolder||!this.$refs.messageContainer)return;const e=this.$refs.participantPlaceHolder.offsetWidth/2;this.$refs.messageContainer.style.width=`calc(100% + ${e+6}px`,this.rightToLeft&&(this.$refs.messageContainer.style.transform=`translateX( ${-(e+6)}px`)})()},onClick(){this.onElementClick(Us.from(this.context))}},components:{Participant:Bd,Comment:qi,Occurrence:h4,Message:Di}},CS=["data-signature"],bS=["data-to"],vS={ref:"participantPlaceHolder",class:"invisible right-0 flex flex-col justify-center flex-shrink-0"};function ES(t,e,n,r,s,i){var u;const o=xe("comment"),l=xe("message"),a=xe("participant"),c=xe("occurrence");return R(),W("div",{class:Ce(["interaction creation sync text-center transform",{"right-to-left":i.rightToLeft,"-translate-x-full":i.rightToLeft,highlight:i.isCurrent,"inited-from-occurrence":i.isInitedFromOccurrence}]),onClick:e[0]||(e[0]=fi((...h)=>i.onClick&&i.onClick(...h),["stop"])),"data-signature":i.signature,style:_e({width:i.interactionWidth+"px"})},[n.comment?(R(),Ue(o,{key:0,comment:n.comment},null,8,["comment"])):ye("",!0),w("div",{ref:"messageContainer",class:Ce(["message-container pointer-events-none flex items-center h-10 relative",{"flex-row-reverse":i.rightToLeft}]),"data-type":"creation","data-to":i.to},[Z(l,{ref:"messageEl",class:"invocation w-full transform -translate-y-1/2 pointer-events-auto",content:i.signature,rtl:i.rightToLeft,type:"creation",number:n.number},null,8,["content","rtl","number"]),w("div",vS,[Z(a,{entity:{name:i.to}},null,8,["entity"])],512)],10,bS),Z(c,{context:i.creation,class:"pointer-events-auto",participant:i.to,number:n.number},null,8,["context","participant","number"]),i.assignee?(R(),Ue(l,{key:1,class:"return transform -translate-y-full pointer-events-auto",content:i.assignee,rtl:!i.rightToLeft,type:"return",number:`${n.number}.${(((u=i.creation.braceBlock())==null?void 0:u.block().stat().length)||0)+1}`},null,8,["content","rtl","number"])):ye("",!0)],14,CS)}const wS=Fe(yS,[["render",ES]]),TS={name:"self-invocation",props:["content","assignee","number"],computed:{...Qt(["numbering"])}},AS={class:"message self text-sm flex items-start flex-col",style:{"border-width":"0"}},SS={class:"name group px-px hover:text-skin-message-hover hover:bg-skin-message-hover relative min-h-[1em]"},kS={key:0,class:"absolute right-[100%] top-0 pr-1 group-hover:hidden text-gray-500"},RS={key:1},OS=w("svg",{class:"arrow text-skin-message-arrow",width:"30",height:"24"},[w("polyline",{class:"line stroke-current fill-none stroke-2",points:"0,2 28,2 28,15 14,15"}),w("polyline",{class:"head stroke-current fill-current stroke-2",points:"18,9 8,15 18,21"})],-1);function IS(t,e,n,r,s,i){return R(),W("div",AS,[w("label",SS,[t.numbering?(R(),W("div",kS,$e(n.number),1)):ye("",!0),n.assignee?(R(),W("span",RS,$e(n.assignee)+" = ",1)):ye("",!0),mn(" "+$e(n.content),1)]),OS])}const NS=Fe(TS,[["render",IS]]),iI="",PS={name:"interaction",props:["context","selfCallIndent","commentObj","number"],computed:{...Jt(["participants","distance2","cursor","onElementClick"]),hasComment(){var t;return((t=this.commentObj)==null?void 0:t.text)!==""},textStyle(){var t;return(t=this.commentObj)==null?void 0:t.textStyle},classNames(){var t;return(t=this.commentObj)==null?void 0:t.classNames},message:function(){var t;return(t=this.context)==null?void 0:t.message()},providedFrom:function(){var t,e;return(e=(t=this.context)==null?void 0:t.message())==null?void 0:e.ProvidedFrom()},from:function(){return this.providedFrom||this.origin},outOfBand:function(){return!!this.providedFrom&&this.providedFrom!==this.origin},assignee:function(){var e;let t=(e=this.message)==null?void 0:e.Assignment();return t?t.getText():""},signature:function(){var t;return(t=this.message)==null?void 0:t.SignatureText()},translateX:function(){if(!this.rightToLeft&&!this.outOfBand)return 0;const e=this.rightToLeft?this.to:this.providedFrom,n=this.distance2(this.origin,e),r=this.selfCallIndent||0;return n+0-r},rightToLeft:function(){return this.distance2(this.from,this.to)<0},isCurrent:function(){var t;return(t=this.message)==null?void 0:t.isCurrent(this.cursor)},showStarter(){return this.participants.Starter().name!=="_STARTER_"},isRootBlock(){var t,e;return((e=(t=this.context)==null?void 0:t.parentCtx)==null?void 0:e.parentCtx)instanceof MC},origin:function(){var t;return(t=this.context)==null?void 0:t.Origin()},passOnOffset:function(){return this.isSelf?(this.selfCallIndent||0)+6:0},interactionWidth:function(){if(this.context&&this.isSelf)return 0;let t=this.outOfBand?0:this.selfCallIndent||0;return Math.abs(this.distance2(this.from,this.to)-t)},to:function(){var t,e;return(e=(t=this.context)==null?void 0:t.message())==null?void 0:e.Owner()},isSelf:function(){return!this.to||this.to===this.from},invocation:function(){return this.isSelf?"SelfInvocation":"Message"},isInitedFromOccurrence:function(){var t;return(t=this.message)==null?void 0:t.isInitedFromOccurrence(this.from)}},methods:{onClick(){this.onElementClick(Us.from(this.context))}},components:{Message:Di,SelfInvocation:NS,Comment:qi,Occurrence:h4}},MS=["data-to","data-signature"];function FS(t,e,n,r,s,i){var c;const o=xe("comment"),l=xe("occurrence"),a=xe("message");return R(),W("div",{class:Ce(["interaction sync inline-block",{highlight:i.isCurrent,self:i.isSelf,"inited-from-occurrence":i.isInitedFromOccurrence}]),onClick:e[0]||(e[0]=fi((...u)=>i.onClick&&i.onClick(...u),["stop"])),"data-to":i.to,"data-type":"interaction","data-signature":i.signature,style:_e({width:!i.isSelf&&i.interactionWidth+"px",transform:"translateX("+i.translateX+"px)"})},[i.showStarter&&i.isRootBlock||i.outOfBand?(R(),W("div",{key:0,class:Ce(["occurrence source border-2",{"right-to-left":i.rightToLeft}])},null,2)):ye("",!0),i.hasComment?(R(),Ue(o,{key:1,commentObj:n.commentObj},null,8,["commentObj"])):ye("",!0),(R(),Ue(oi(i.invocation),{class:"text-center",textStyle:i.textStyle,classNames:i.classNames,content:i.signature,assignee:i.assignee,rtl:i.rightToLeft,type:"sync",number:n.number},null,8,["textStyle","classNames","content","assignee","rtl","number"])),Z(l,{context:i.message,participant:i.to,selfCallIndent:i.passOnOffset,rtl:i.rightToLeft,number:`${n.number}`},null,8,["context","participant","selfCallIndent","rtl","number"]),i.assignee&&!i.isSelf?(R(),Ue(a,{key:2,class:"return transform -translate-y-full",content:i.assignee,rtl:!i.rightToLeft,type:"return",number:`${n.number}.${(((c=i.message.braceBlock())==null?void 0:c.block().stat().length)||0)+1}`},null,8,["content","rtl","number"])):ye("",!0)],14,MS)}const DS=Fe(PS,[["render",FS],["__scopeId","data-v-721d3821"]]),oI="",$S={name:"self-invocation-async",props:["content","number"],computed:{...Qt(["numbering"])}},BS=t=>(Sr("data-v-fbc5fa7e"),t=t(),kr(),t),US={class:"message self flex items-start flex-col",style:{"border-width":"0"}},HS={class:"name group px-px hover:text-skin-message-hover hover:bg-skin-message-hover min-h-[1em]"},VS={key:0,class:"absolute right-[100%] top-0 pr-1 group-hover:hidden text-gray-500"},jS=BS(()=>w("svg",{class:"arrow text-skin-message-arrow",width:"34",height:"34"},[w("polyline",{class:"stroke-current stroke-2 fill-none",points:"0,2 28,2 28,25 1,25"}),w("polyline",{class:"head stroke-current stroke-2 fill-none",points:"11,19 1,25 11,31"})],-1));function GS(t,e,n,r,s,i){return R(),W("div",US,[w("label",HS,[t.numbering?(R(),W("div",VS,$e(n.number),1)):ye("",!0),mn(" "+$e(n.content),1)]),jS])}const zS=Fe($S,[["render",GS],["__scopeId","data-v-fbc5fa7e"]]),lI="";function T0(t){return t==null}const WS={name:"interaction-async",props:["context","comment","selfCallIndent","number"],computed:{...Jt(["distance","cursor","onElementClick"]),from:function(){return this.context.Origin()},asyncMessage:function(){var t;return(t=this.context)==null?void 0:t.asyncMessage()},interactionWidth:function(){var t;return this.isSelf?10*(((t=this.signature)==null?void 0:t.length)||0)+100:Math.abs(this.distance(this.target,this.source))},translateX:function(){return this.rightToLeft?this.distance(this.target,this.from):this.distance(this.source,this.from)},rightToLeft:function(){return this.distance(this.target,this.source)<0},signature:function(){var t,e;return(e=(t=this.asyncMessage)==null?void 0:t.content())==null?void 0:e.getFormattedText()},source:function(){var t,e;return((e=(t=this.asyncMessage)==null?void 0:t.from())==null?void 0:e.getFormattedText())||this.from},target:function(){var t,e;return(e=(t=this.asyncMessage)==null?void 0:t.to())==null?void 0:e.getFormattedText()},isCurrent:function(){const t=this.asyncMessage.start.start,e=this.asyncMessage.stop.stop+1;return T0(this.cursor)||T0(t)||T0(e)?!1:this.cursor>=t&&this.cursor<=e},isSelf:function(){return this.source===this.target},invocation:function(){return this.isSelf?"SelfInvocationAsync":"Message"}},methods:{onClick(){this.onElementClick(Us.from(this.context))}},components:{Comment:qi,SelfInvocationAsync:zS,Message:Di}},qS=["data-signature"];function ZS(t,e,n,r,s,i){const o=xe("comment");return R(),W("div",{class:Ce(["interaction async",{"right-to-left":i.rightToLeft,highlight:i.isCurrent,"self-invocation":i.isSelf}]),onClick:e[0]||(e[0]=fi((...l)=>i.onClick&&i.onClick(...l),["stop"])),"data-signature":i.signature,style:_e({width:i.interactionWidth+"px",transform:"translateX("+i.translateX+"px)"})},[n.comment?(R(),Ue(o,{key:0,comment:n.comment},null,8,["comment"])):ye("",!0),(R(),Ue(oi(i.invocation),{content:i.signature,rtl:i.rightToLeft,type:"async",number:n.number},null,8,["content","rtl","number"]))],14,qS)}const KS=Fe(WS,[["render",ZS],["__scopeId","data-v-40bff5d3"]]),aI="",YS={props:["label","collapsed"],emits:["click"]},XS={class:"collapsible-header"},QS={class:"mb-0"},JS=[Br('<g id="SVGRepo_bgCarrier" stroke-width="0" data-v-7aac25db></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" data-v-7aac25db></g><g id="SVGRepo_iconCarrier" data-v-7aac25db><line x1="14" y1="10" x2="21" y2="3" data-v-7aac25db></line><polyline points="20 10 14 10 14 4" data-v-7aac25db></polyline><line x1="3" y1="21" x2="10" y2="14" data-v-7aac25db></line><polyline points="4 14 10 14 10 20" data-v-7aac25db></polyline></g>',3)],ek=[Br('<g id="SVGRepo_bgCarrier" stroke-width="0" data-v-7aac25db></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" data-v-7aac25db></g><g id="SVGRepo_iconCarrier" data-v-7aac25db><title data-v-7aac25db></title> <g id="Complete" data-v-7aac25db><g id="expand" data-v-7aac25db><g data-v-7aac25db><polyline data-name="Right" fill="none" id="Right-2" points="3 17.3 3 21 6.7 21" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1" data-v-7aac25db></polyline> <line fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1" x1="10" x2="3.8" y1="14" y2="20.2" data-v-7aac25db></line> <line fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1" x1="14" x2="20.2" y1="10" y2="3.8" data-v-7aac25db></line> <polyline data-name="Right" fill="none" id="Right-3" points="21 6.7 21 3 17.3 3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1" data-v-7aac25db></polyline></g></g></g></g>',3)];function tk(t,e,n,r,s,i){return R(),W("div",XS,[w("label",QS,$e(n.label),1),(R(),W("svg",{class:Ce(["w-4 h-4 collapse-button cursor-pointer",{hidden:n.collapsed,expanded:!n.collapsed}]),onClick:e[0]||(e[0]=o=>t.$emit("click",o)),viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"miter"},JS,2)),(R(),W("svg",{class:Ce(["w-4 h-4 cursor-pointer",{hidden:!n.collapsed}]),viewBox:"0 0 24 24",onClick:e[1]||(e[1]=o=>t.$emit("click",o)),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},ek,2))])}const nk=Fe(YS,[["render",tk],["__scopeId","data-v-7aac25db"]]),Zi={computed:{...Jt(["coordinates"]),offsetX:function(){const t=this.coordinates.orderedParticipantNames(),n=new zc(t).getFrame(this.context),r=qc(n),s=[this.context.Origin(),...Fs(this.context).Names()],i=t.find(l=>s.includes(l));let o=Dn.half(Jn,i);return console.debug(`left participant: ${i} ${o}`),this.coordinates.distance(i,this.from)+r.left+o},fragmentStyle:function(){return{transform:"translateX("+(this.offsetX+1)*-1+"px)",width:jd(this.context,this.coordinates)+"px"}}},data:function(){return{collapsed:!1}},methods:{toggle(t){this.collapsed=!this.collapsed,Hc.$emit("participant_set_top")}},components:{CollapseButton:nk},watch:{context(t){this.collapsed&&(this.collapsed=!1)}}},rk=t=>{let e={loop:"FragmentLoop",alt:"FragmentAlt",par:"FragmentPar",opt:"FragmentOpt",tcf:"FragmentTryCatchFinally",creation:"Creation",message:"Interaction",asyncMessage:"InteractionAsync",divider:"Divider",ret:"Return"},n=Object.keys(e).find(r=>t[r]()!==null)||"";return e[n]},Ki=t=>t&&t.stat()?t.stat().filter(e=>rk(e)!=="Divider").length:0,d4=(t,e)=>{if(t){const n=t.split(".");return n[n.length-1]=Number(n[n.length-1])+e,n.join(".")}else return String(e)},hI="",sk={name:"fragment-alt",props:["context","comment","selfCallIndent","commentObj","number"],mixins:[Zi],computed:{...Qt(["numbering"]),from:function(){return this.context.Origin()},alt:function(){return this.context.alt()},blockInIfBlock:function(){var t,e,n;return(n=(e=(t=this.alt)==null?void 0:t.ifBlock())==null?void 0:e.braceBlock())==null?void 0:n.block()},condition:function(){var t;return this.conditionFromIfElseBlock((t=this.alt)==null?void 0:t.ifBlock())},elseBlock:function(){var t,e,n;return(n=(e=(t=this.alt)==null?void 0:t.elseBlock())==null?void 0:e.braceBlock())==null?void 0:n.block()},blockLengthAcc(){var e;const t=[Ki(this.blockInIfBlock)];return(e=this.alt)!=null&&e.elseIfBlock()&&this.alt.elseIfBlock().forEach(n=>{t.push(t[t.length-1]+Ki(this.blockInElseIfBlock(n)))}),t}},methods:{conditionFromIfElseBlock(t){var e,n;return(n=(e=t==null?void 0:t.parExpr())==null?void 0:e.condition())==null?void 0:n.getFormattedText()},blockInElseIfBlock(t){var e;return(e=t==null?void 0:t.braceBlock())==null?void 0:e.block()},increaseNumber:d4,blockLength:Ki}},p4=t=>(Sr("data-v-6695386a"),t=t(),kr(),t),ik={class:"segment"},ok={class:"header bg-skin-fragment-header text-skin-fragment-header text-base leading-4 rounded-t relative"},lk={key:0,class:"absolute right-[100%] top-0 pr-1 group-hover:hidden text-gray-500 text-sm font-thin leading-6"},ak={class:"name font-semibold p-1 border-b text-sm"},ck={class:"p-0"},uk={class:"segment"},hk={class:"text-skin-fragment flex"},fk={class:"condition px-1 text-sm inline-block"},dk=p4(()=>w("label",{class:"else-if hidden"},"else if",-1)),pk={class:"condition px-1"},gk={key:0,class:"segment mt-2 border-t border-solid"},mk=p4(()=>w("div",{class:"text-skin-fragment"},[w("label",{class:"p-1"},"[else]")],-1));function xk(t,e,n,r,s,i){const o=xe("comment"),l=xe("collapse-button"),a=xe("block");return R(),W("div",{class:"fragment alt border-skin-fragment rounded",style:_e(t.fragmentStyle)},[w("div",ik,[n.comment?(R(),Ue(o,{key:0,comment:n.comment,commentObj:n.commentObj},null,8,["comment","commentObj"])):ye("",!0),w("div",ok,[t.numbering?(R(),W("div",lk,$e(n.number),1)):ye("",!0),w("div",ak,[w("label",ck,[Z(l,{label:"Alt",collapsed:t.collapsed,onClick:this.toggle,style:_e(n.commentObj.textStyle),class:Ce(n.commentObj.classNames)},null,8,["collapsed","onClick","style","class"])])])])]),w("div",{class:Ce({hidden:t.collapsed})},[w("div",uk,[w("div",hk,[w("label",fk,"["+$e(i.condition)+"]",1)]),i.blockInIfBlock?(R(),Ue(a,{key:0,style:_e({paddingLeft:`${t.offsetX}px`}),context:i.blockInIfBlock,selfCallIndent:n.selfCallIndent,number:`${n.number}.1`,incremental:""},null,8,["style","context","selfCallIndent","number"])):ye("",!0)]),(R(!0),W(Be,null,An(i.alt.elseIfBlock(),(c,u)=>(R(),W("div",{key:u+500,class:"segment mt-2 border-t border-solid"},[(R(),W("div",{class:"text-skin-fragment",key:u+1e3},[dk,w("label",pk,"["+$e(i.conditionFromIfElseBlock(c))+"]",1)])),(R(),Ue(a,{style:_e({paddingLeft:`${t.offsetX}px`}),context:i.blockInElseIfBlock(c),selfCallIndent:n.selfCallIndent,key:u+2e3,number:`${n.number}.${i.blockLengthAcc[u]+1}`,incremental:""},null,8,["style","context","selfCallIndent","number"]))]))),128)),i.elseBlock?(R(),W("div",gk,[mk,Z(a,{style:_e({paddingLeft:`${t.offsetX}px`}),context:i.elseBlock,selfCallIndent:n.selfCallIndent,number:`${n.number}.${i.blockLengthAcc[i.blockLengthAcc.length-1]+1}`,incremental:""},null,8,["style","context","selfCallIndent","number"])])):ye("",!0)],2)],4)}const Lk=Fe(sk,[["render",xk],["__scopeId","data-v-6695386a"]]),fI="",dI="",_k={name:"fragment-par",props:["context","comment","commentObj","selfCallIndent","number"],mixins:[Zi],computed:{...Qt(["numbering"]),from:function(){return this.context.Origin()},par:function(){return this.context.par()}}},yk={class:"header bg-skin-fragment-header text-skin-fragment-header text-base leading-4 rounded-t relative"},Ck={key:0,class:"absolute right-[100%] top-0 pr-1 group-hover:hidden text-gray-500 text-sm font-thin leading-6"},bk={class:"name font-semibold p-1 border-b"};function vk(t,e,n,r,s,i){const o=xe("comment"),l=xe("collapse-button"),a=xe("block");return R(),W("div",{class:"fragment par border-skin-fragment rounded",style:_e(t.fragmentStyle)},[n.comment?(R(),Ue(o,{key:0,comment:n.comment,commentObj:n.commentObj},null,8,["comment","commentObj"])):ye("",!0),w("div",yk,[t.numbering?(R(),W("div",Ck,$e(n.number),1)):ye("",!0),w("div",bk,[Z(l,{label:"Par",collapsed:t.collapsed,onClick:this.toggle,style:_e(n.commentObj.textStyle),class:Ce(n.commentObj.classNames)},null,8,["collapsed","onClick","style","class"])])]),Z(a,{class:Ce({hidden:t.collapsed}),style:_e({paddingLeft:`${t.offsetX}px`}),context:i.par.braceBlock().block(),selfCallIndent:n.selfCallIndent,number:n.number},null,8,["class","style","context","selfCallIndent","number"])],4)}const Ek=Fe(_k,[["render",vk],["__scopeId","data-v-a45081df"]]),pI="",wk={name:"fragment-loop",props:["context","comment","commentObj","selfCallIndent","number"],mixins:[Zi],computed:{...Qt(["numbering"]),from:function(){return this.context.Origin()},loop:function(){return this.context.loop()},blockInLoop:function(){var t,e;return(e=(t=this.loop)==null?void 0:t.braceBlock())==null?void 0:e.block()},condition:function(){var t,e,n;return(n=(e=(t=this.loop)==null?void 0:t.parExpr())==null?void 0:e.condition())==null?void 0:n.getFormattedText()}}},Tk={class:"header text-skin-fragment-header bg-skin-fragment-header text-base leading-4 relative"},Ak={key:0,class:"absolute right-[100%] top-0 pr-1 group-hover:hidden text-gray-500 text-sm font-thin leading-6"},Sk={class:"name font-semibold p-1 border-b"},kk={class:"segment"},Rk={class:"text-skin-fragment"},Ok={class:"condition p-1"};function Ik(t,e,n,r,s,i){const o=xe("comment"),l=xe("collapse-button"),a=xe("block");return R(),W("div",{class:"fragment loop border-skin-fragment rounded",style:_e(t.fragmentStyle)},[n.comment?(R(),Ue(o,{key:0,comment:n.comment,commentObj:n.commentObj},null,8,["comment","commentObj"])):ye("",!0),w("div",Tk,[t.numbering?(R(),W("div",Ak,$e(n.number),1)):ye("",!0),w("div",Sk,[Z(l,{label:"Loop",collapsed:t.collapsed,onClick:this.toggle,style:_e(n.commentObj.textStyle),class:Ce(n.commentObj.classNames)},null,8,["collapsed","onClick","style","class"])])]),w("div",{class:Ce({hidden:t.collapsed})},[w("div",kk,[w("div",Rk,[w("label",Ok,"["+$e(i.condition)+"]",1)]),Z(a,{style:_e({paddingLeft:`${t.offsetX}px`}),context:i.blockInLoop,selfCallIndent:n.selfCallIndent,number:n.number},null,8,["style","context","selfCallIndent","number"])])],2)],4)}const Nk=Fe(wk,[["render",Ik],["__scopeId","data-v-5d95d843"]]),gI="",Pk={name:"fragment-opt",props:["context","comment","commentObj","selfCallIndent","number"],mixins:[Zi],computed:{...Qt(["numbering"]),from:function(){return this.context.Origin()},opt:function(){return this.context.opt()}}},Mk={class:"header bg-skin-fragment-header text-skin-fragment-header text-base leading-4 relative"},Fk={key:0,class:"absolute right-[100%] top-0 pr-1 group-hover:hidden text-gray-500 text-sm font-thin leading-6"},Dk={class:"name font-semibold p-1 border-b"};function $k(t,e,n,r,s,i){const o=xe("comment"),l=xe("collapse-button"),a=xe("block");return R(),W("div",{class:"fragment opt border-skin-fragment rounded",style:_e(t.fragmentStyle)},[n.comment?(R(),Ue(o,{key:0,comment:n.comment,commentObj:n.commentObj},null,8,["comment","commentObj"])):ye("",!0),w("div",Mk,[t.numbering?(R(),W("div",Fk,$e(n.number),1)):ye("",!0),w("div",Dk,[Z(l,{label:"Opt",collapsed:t.collapsed,onClick:this.toggle,style:_e(n.commentObj.textStyle),class:Ce(n.commentObj.classNames)},null,8,["collapsed","onClick","style","class"])])]),Z(a,{class:Ce({hidden:t.collapsed}),style:_e({paddingLeft:`${t.offsetX}px`}),context:i.opt.braceBlock().block(),selfCallIndent:n.selfCallIndent,number:n.number},null,8,["class","style","context","selfCallIndent","number"])],4)}const Bk=Fe(Pk,[["render",$k],["__scopeId","data-v-5a3911c0"]]),mI="",Uk={name:"fragment-tcf",props:["context","comment","commentObj","selfCallIndent","number"],mixins:[Zi],computed:{...Qt(["numbering"]),from:function(){return this.context.Origin()},tcf:function(){return this.context.tcf()},blockInTryBlock:function(){var t,e,n;return(n=(e=(t=this.tcf)==null?void 0:t.tryBlock())==null?void 0:e.braceBlock())==null?void 0:n.block()},finallyBlock:function(){var t,e,n;return(n=(e=(t=this.tcf)==null?void 0:t.finallyBlock())==null?void 0:e.braceBlock())==null?void 0:n.block()},blockLengthAcc(){var e;const t=[Ki(this.blockInTryBlock)];return(e=this.tcf)!=null&&e.catchBlock()&&this.tcf.catchBlock().forEach(n=>{t.push(t[t.length-1]+Ki(this.blockInCatchBlock(n)))}),t}},methods:{exception(t){var e;return(e=t==null?void 0:t.invocation())==null?void 0:e.parameters().getText()},blockInCatchBlock(t){var e;return(e=t==null?void 0:t.braceBlock())==null?void 0:e.block()}}},g4=t=>(Sr("data-v-a74d5015"),t=t(),kr(),t),Hk={class:"segment"},Vk={class:"header bg-skin-fragment-header text-skin-fragment-header text-base leading-4 rounded-t relative"},jk={key:0,class:"absolute right-[100%] top-0 pr-1 group-hover:hidden text-gray-500 text-sm font-thin leading-6"},Gk={class:"name font-semibold p-1 border-b text-sm"},zk={class:"segment"},Wk=g4(()=>w("label",{class:"keyword catch p-1"},"catch",-1)),qk={class:"exception p-1"},Zk={key:0,class:"segment mt-2 border-t border-solid"},Kk=g4(()=>w("div",{class:"header flex text-skin-fragment finally"},[w("label",{class:"keyword finally px-1 inline-block text-sm"},"finally")],-1));function Yk(t,e,n,r,s,i){const o=xe("comment"),l=xe("collapse-button"),a=xe("block");return R(),W("div",{class:"fragment tcf border-skin-fragment rounded",style:_e(t.fragmentStyle)},[w("div",Hk,[n.comment?(R(),Ue(o,{key:0,comment:n.comment,commentObj:n.commentObj},null,8,["comment","commentObj"])):ye("",!0),w("div",Vk,[t.numbering?(R(),W("div",jk,$e(n.number),1)):ye("",!0),w("div",Gk,[Z(l,{label:"Try",collapsed:t.collapsed,onClick:this.toggle},null,8,["collapsed","onClick"])])])]),w("div",{class:Ce({hidden:t.collapsed})},[w("div",zk,[i.blockInTryBlock?(R(),Ue(a,{key:0,style:_e({paddingLeft:`${t.offsetX}px`}),context:i.blockInTryBlock,selfCallIndent:n.selfCallIndent,number:`${n.number}.1`,incremental:""},null,8,["style","context","selfCallIndent","number"])):ye("",!0)]),(R(!0),W(Be,null,An(i.tcf.catchBlock(),(c,u)=>(R(),W("div",{key:u+500,class:"segment text-sm mt-2 border-t border-solid"},[(R(),W("div",{class:"header inline-block",key:u+1e3},[Wk,w("label",qk,$e(i.exception(c)),1)])),(R(),Ue(a,{style:_e({paddingLeft:`${t.offsetX}px`}),context:i.blockInCatchBlock(c),selfCallIndent:n.selfCallIndent,key:u+2e3,number:`${n.number}.${i.blockLengthAcc[u]+1}`,incremental:""},null,8,["style","context","selfCallIndent","number"]))]))),128)),i.finallyBlock?(R(),W("div",Zk,[Kk,Z(a,{style:_e({paddingLeft:`${t.offsetX}px`}),context:i.finallyBlock,selfCallIndent:n.selfCallIndent,number:`${n.number}.${i.blockLengthAcc[i.blockLengthAcc.length-1]+1}`,incremental:""},null,8,["style","context","selfCallIndent","number"])])):ye("",!0)],2)],4)}const Xk=Fe(Uk,[["render",Yk],["__scopeId","data-v-a74d5015"]]),Qk={name:"return",props:["context","comment","number"],computed:{...Jt(["distance","cursor","onElementClick","participants"]),from:function(){return this.context.Origin()},asyncMessage:function(){var t;return(t=this.context)==null?void 0:t.ret().asyncMessage()},width:function(){return this.isSelf?Jn(this.signature,mr.MessageContent):Math.abs(this.distance(this.target,this.source))},left:function(){return this.rightToLeft?this.distance(this.target,this.from)+2:this.distance(this.source,this.from)+2},rightToLeft:function(){return this.distance(this.target,this.source)<0},signature:function(){var t,e,n,r,s;return((e=(t=this.asyncMessage)==null?void 0:t.content())==null?void 0:e.getFormattedText())||((s=(r=(n=this.context)==null?void 0:n.ret())==null?void 0:r.expr())==null?void 0:s.getFormattedText())},source:function(){var t,e;return((e=(t=this.asyncMessage)==null?void 0:t.from())==null?void 0:e.getFormattedText())||this.from},target:function(){var t,e,n,r;return((e=(t=this.asyncMessage)==null?void 0:t.to())==null?void 0:e.getFormattedText())||((r=(n=this.context)==null?void 0:n.ret())==null?void 0:r.ReturnTo())},isCurrent:function(){return!1},isSelf:function(){return this.source===this.target},isReturnToStart(){return this.target===this.participants.Starter().name}},methods:{onClick(){this.onElementClick(Us.from(this.context))}},components:{Comment:qi,Message:Di}},Jk=["data-signature"],eR={key:1,class:"flex items-center"},tR=w("svg",{class:"w-3 h-3 flex-shrink-0 fill-current m-1",viewBox:"0 0 512 512"},[w("path",{class:"cls-1",d:"M256 0C114.84 0 0 114.84 0 256s114.84 256 256 256 256-114.84 256-256S397.16 0 256 0Zm0 469.33c-117.63 0-213.33-95.7-213.33-213.33S138.37 42.67 256 42.67 469.33 138.37 469.33 256 373.63 469.33 256 469.33Z"}),w("path",{class:"cls-1",d:"M288 192h-87.16l27.58-27.58a21.33 21.33 0 1 0-30.17-30.17l-64 64a21.33 21.33 0 0 0 0 30.17l64 64a21.33 21.33 0 0 0 30.17-30.17l-27.58-27.58H288a53.33 53.33 0 0 1 0 106.67h-32a21.33 21.33 0 0 0 0 42.66h32a96 96 0 0 0 0-192Z"})],-1),nR={class:"name text-sm"};function rR(t,e,n,r,s,i){const o=xe("comment"),l=xe("Message");return R(),W("div",{class:Ce(["interaction return relative",{"right-to-left":i.rightToLeft,highlight:i.isCurrent,"return-to-start":i.isReturnToStart}]),onClick:e[0]||(e[0]=fi((...a)=>i.onClick&&i.onClick(...a),["stop"])),"data-signature":i.signature,style:_e({width:i.width+"px",left:i.left+"px"})},[n.comment?(R(),Ue(o,{key:0,comment:n.comment},null,8,["comment"])):ye("",!0),i.isSelf?(R(),W("div",eR,[tR,w("span",nR,$e(i.signature),1)])):ye("",!0),i.isSelf?ye("",!0):(R(),Ue(l,{key:2,content:i.signature,rtl:i.rightToLeft,type:"return",number:n.number},null,8,["content","rtl","number"]))],14,Jk)}const sR=Fe(Qk,[["render",rR]]),iR=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],oR=["italic","oblique"],lR=["bold","bolder","lighter"],aR=["underline","overline","line-through"],A0=t=>{const e={},n=[];return t.forEach(r=>{switch(!0){case iR.includes(r):e.color=r;break;case oR.includes(r):e.fontStyle=r;break;case lR.includes(r):e.fontWeight=r;break;case aR.includes(r):e.textDecoration=r;break;default:n.push(r)}}),{textStyle:e,classNames:n}},xI="",cR={name:"divider",props:["context"],computed:{...Jt(["participants","centerOf"]),width(){let t=this.participants.Names().pop();return this.centerOf(t)+10},from:function(){return this.context.Origin()},centerOfFrom(){return this.centerOf(this.from)},note:function(){return this.context.divider().Note()},messageStyle(){if(this.note.trim().indexOf("[")===0&&this.note.indexOf("]")!==-1){const t=this.note.indexOf("["),e=this.note.indexOf("]"),[n,r]=[this.note.slice(t+1,e),this.note.slice(e+1)];return{style:A0(n.split(",").map(s=>s.trim())),note:r}}return{style:A0([]),note:this.note}}}},m4=t=>(Sr("data-v-49358971"),t=t(),kr(),t),uR=m4(()=>w("div",{class:"left bg-skin-divider"},null,-1)),hR=m4(()=>w("div",{class:"right bg-skin-divider"},null,-1));function fR(t,e,n,r,s,i){return R(),W("div",{class:"divider",style:_e({width:i.width+"px",transform:"translateX("+(-1*i.centerOfFrom+10)+"px)"})},[uR,w("div",{class:Ce(["name",i.messageStyle.style.classNames]),style:_e(i.messageStyle.style.textStyle)},$e(i.messageStyle.note),7),hR],4)}const dR=Fe(cR,[["render",fR],["__scopeId","data-v-49358971"]]);function x4(t){const e=t.indexOf("["),n=t.indexOf("]",e);return e!==-1&&n!==-1&&t.trim().indexOf("[")===0?[t.slice(e+1,n),t.slice(n+1)]:["",t]}class pR{constructor(e){K(this,"text");K(this,"textStyle",{});K(this,"classNames",[]);const n=e.split(`
598
598
  `),r=n.reduce((o,l)=>{const[a]=x4(l);return a&&(o=[...o,...a.split(",").map(c=>c.trim())]),o},[]),{textStyle:s,classNames:i}=A0(r);this.textStyle=s,this.classNames=i,this.text=n.reduce((o,l)=>{const[,a]=x4(l);return o&&a?`${o}
599
- ${a}`:o||a},"").trimEnd()}}const gR={name:"statement",props:["context","selfCallIndent","number","collapsed"],computed:{comment:function(){return this.context.getComment()?this.context.getComment():""},commentObj:function(){return new pR(this.comment)},subStatement:function(){let t=this,e={loop:"FragmentLoop",alt:"FragmentAlt",par:"FragmentPar",opt:"FragmentOpt",tcf:"FragmentTryCatchFinally",creation:"Creation",message:"Interaction",asyncMessage:"InteractionAsync",divider:"Divider",ret:"Return"},n=Object.keys(e).find(r=>t.context[r]()!==null);return e[n]},collapsedCheck:function(){return this.collapsed&&this.subStatement!="Return"}},components:{Creation:wS,Interaction:DS,InteractionAsync:KS,FragmentAlt:Lk,FragmentPar:Ek,FragmentOpt:Bk,FragmentTryCatchFinally:Xk,FragmentLoop:Nk,Divider:dR,Return:sR}};function mR(t,e,n,r,s,i){return R(),Ue(oi(i.subStatement),{class:Ce(["text-left text-sm text-skin-message",{hidden:i.collapsedCheck}]),context:n.context,comment:i.comment,commentObj:i.commentObj,selfCallIndent:n.selfCallIndent,number:n.number},null,8,["class","context","comment","commentObj","selfCallIndent","number"])}const xR=Fe(gR,[["render",mR]]),LR={class:"block"},_R=lt({__name:"Block",props:{context:null,selfCallIndent:null,number:null,incremental:{type:Boolean},collapsed:{type:Boolean}},setup(t){const e=t,n=fe(()=>{var s;return((s=e.context)==null?void 0:s.stat())||[]}),r=s=>e.number?e.incremental?d4(e.number,s):`${e.number}.${s+1}`:String(s+1);return(s,i)=>(R(),W("div",LR,[(R(!0),W(Be,null,An(At(n),(o,l)=>(R(),W("div",{class:"statement-container mt-1",key:l},[Z(xR,{context:o,collapsed:t.collapsed,selfCallIndent:t.selfCallIndent,number:r(l)},null,8,["context","collapsed","selfCallIndent","number"])]))),128))]))}}),yR=js.child({name:"core"});class CR{constructor(e,n=!1){K(this,"el");K(this,"_code");K(this,"_theme");K(this,"store");K(this,"app");this.el=e,this.store=S2(kd()),this.app=mi(n?Zc:D3),this.app.component("Comment",qi),this.app.component("Block",_R),this.app.use(this.store),this.app.mount(this.el)}async render(e,n){return yR.debug("rendering",e,n),this._code=e||this._code,this._theme=(n==null?void 0:n.theme)||this._theme,this.store.state.stickyOffset=(n==null?void 0:n.stickyOffset)||0,this.store.state.theme=this._theme||"default",await this.store.dispatch("updateCode",{code:this._code}),Promise.resolve(this)}get code(){return this._code}get theme(){return this._theme}async getPng(){return this.el.children[0].__vue__.toPng()}}const bR={createApp:mi,createStore:S2,Store:kd,SeqDiagram:Zc,DiagramFrame:D3};zt.VueSequence=bR,zt.default=CR,Object.defineProperties(zt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
599
+ ${a}`:o||a},"").trimEnd()}}const gR={name:"statement",props:["context","selfCallIndent","number","collapsed"],computed:{comment:function(){return this.context.getComment()?this.context.getComment():""},commentObj:function(){return new pR(this.comment)},subStatement:function(){let t=this,e={loop:"FragmentLoop",alt:"FragmentAlt",par:"FragmentPar",opt:"FragmentOpt",tcf:"FragmentTryCatchFinally",creation:"Creation",message:"Interaction",asyncMessage:"InteractionAsync",divider:"Divider",ret:"Return"},n=Object.keys(e).find(r=>t.context[r]()!==null);return e[n]},collapsedCheck:function(){return this.collapsed&&this.subStatement!="Return"}},components:{Creation:wS,Interaction:DS,InteractionAsync:KS,FragmentAlt:Lk,FragmentPar:Ek,FragmentOpt:Bk,FragmentTryCatchFinally:Xk,FragmentLoop:Nk,Divider:dR,Return:sR}};function mR(t,e,n,r,s,i){return R(),Ue(oi(i.subStatement),{class:Ce(["text-left text-sm text-skin-message",{hidden:i.collapsedCheck}]),context:n.context,comment:i.comment,commentObj:i.commentObj,selfCallIndent:n.selfCallIndent,number:n.number},null,8,["class","context","comment","commentObj","selfCallIndent","number"])}const xR=Fe(gR,[["render",mR]]),LR={class:"block"},_R=lt({__name:"Block",props:{context:null,selfCallIndent:null,number:null,incremental:{type:Boolean},collapsed:{type:Boolean}},setup(t){const e=t,n=fe(()=>{var s;return((s=e.context)==null?void 0:s.stat())||[]}),r=s=>e.number?e.incremental?d4(e.number,s):`${e.number}.${s+1}`:String(s+1);return(s,i)=>(R(),W("div",LR,[(R(!0),W(Be,null,An(At(n),(o,l)=>(R(),W("div",{class:"statement-container mt-1",key:l},[Z(xR,{context:o,collapsed:t.collapsed,selfCallIndent:t.selfCallIndent,number:r(l)},null,8,["context","collapsed","selfCallIndent","number"])]))),128))]))}}),yR=js.child({name:"core"});class CR{constructor(e,n=!1){K(this,"el");K(this,"_code");K(this,"_theme");K(this,"store");K(this,"app");this.el=e,this.store=S2(kd()),this.app=mi(n?Zc:D3),this.app.component("Comment",qi),this.app.component("Block",_R),this.app.use(this.store),this.app.mount(this.el),this.addPortalRootElement()}addPortalRootElement(){const e=document.createElement("div");e.id="headlessui-portal-root",e.className="zenuml",e.append(document.createElement("div")),document.body.append(e)}async render(e,n){return yR.debug("rendering",e,n),this._code=e||this._code,this._theme=(n==null?void 0:n.theme)||this._theme,this.store.state.stickyOffset=(n==null?void 0:n.stickyOffset)||0,this.store.state.theme=this._theme||"default",await this.store.dispatch("updateCode",{code:this._code}),Promise.resolve(this)}get code(){return this._code}get theme(){return this._theme}async getPng(){return this.el.children[0].__vue__.toPng()}}const bR={createApp:mi,createStore:S2,Store:kd,SeqDiagram:Zc,DiagramFrame:D3};zt.VueSequence=bR,zt.default=CR,Object.defineProperties(zt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
600
600
  //# sourceMappingURL=zenuml.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenuml/core",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "repository": {