orbitchat 1.0.0 → 1.0.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.
Files changed (45) hide show
  1. package/dist/assets/{api-m_QXEYxU.js → api-DCH8N6ZB.js} +1 -1
  2. package/dist/assets/api-DLeQlF7m.js +2 -0
  3. package/dist/assets/{arc-hH97QygY-EgRQ19vy.js → arc-hH97QygY-dZqky0-H.js} +1 -1
  4. package/dist/assets/{blockDiagram-c4efeb88-CLLcV2XJ-BlzQog67.js → blockDiagram-c4efeb88-CLLcV2XJ-B1bEQNNX.js} +1 -1
  5. package/dist/assets/{c4Diagram-c83219d4-Bq976NrW-DIPXTaap.js → c4Diagram-c83219d4-Bq976NrW-iGSfrlMN.js} +1 -1
  6. package/dist/assets/channel-CSC8iKVS-BN5SWoeh.js +1 -0
  7. package/dist/assets/{classDiagram-beda092f-7G8Y9ObP-CrnhVq3q.js → classDiagram-beda092f-7G8Y9ObP-wikIifoU.js} +1 -1
  8. package/dist/assets/{classDiagram-v2-2358418a-CYz_KHej-BnPcDcYV.js → classDiagram-v2-2358418a-CYz_KHej-DumlwFi8.js} +1 -1
  9. package/dist/assets/clone-vCPXKFeo-hZBJf3C4.js +1 -0
  10. package/dist/assets/{createText-1719965b-Cbn6MBZp-zrb_KsAx.js → createText-1719965b-Cbn6MBZp-zoEnAAP_.js} +1 -1
  11. package/dist/assets/{edges-96097737-XAH6P1yX-hj5ay2ub.js → edges-96097737-XAH6P1yX-C5S8p_6I.js} +1 -1
  12. package/dist/assets/{erDiagram-0228fc6a-Bj5SeSQq-SNOEiwxn.js → erDiagram-0228fc6a-Bj5SeSQq-Cz7B_MUc.js} +1 -1
  13. package/dist/assets/{flowDb-c6c81e3f-CaVKc_SB-DeOFQ2aw.js → flowDb-c6c81e3f-CaVKc_SB-BXfU34nE.js} +1 -1
  14. package/dist/assets/{flowDiagram-50d868cf-BcT1Qv7E-CI_0iUc_.js → flowDiagram-50d868cf-BcT1Qv7E-D7bfrRNB.js} +1 -1
  15. package/dist/assets/flowDiagram-v2-4f6560a1-B0fti9Da-CKmVJd1B.js +1 -0
  16. package/dist/assets/{flowchart-elk-definition-6af322e1-CIF5zs_e-CA7galDX.js → flowchart-elk-definition-6af322e1-CIF5zs_e-DgeWnom2.js} +1 -1
  17. package/dist/assets/{ganttDiagram-a2739b55-wX4z0bcl-BV5WSU0F.js → ganttDiagram-a2739b55-wX4z0bcl-VDOlyWA_.js} +1 -1
  18. package/dist/assets/{gitGraphDiagram-82fe8481-BTMrrqSM-BAXm_J1X.js → gitGraphDiagram-82fe8481-BTMrrqSM-DVV8ZkDT.js} +1 -1
  19. package/dist/assets/{graph-Bc6U-Oet-BbypjADy.js → graph-Bc6U-Oet-CBlVz78v.js} +1 -1
  20. package/dist/assets/{index-5325376f-DCLsNwAa-BxOfAZRl.js → index-5325376f-DCLsNwAa-HT7P8_2b.js} +1 -1
  21. package/dist/assets/index-Cdetzrl0.css +1 -0
  22. package/dist/assets/{index-BKRCw_DF.js → index-DzCUtfv9.js} +134 -134
  23. package/dist/assets/{infoDiagram-8eee0895-CGdieI3d-CeI4A8me.js → infoDiagram-8eee0895-CGdieI3d-DZtIi2W2.js} +1 -1
  24. package/dist/assets/{journeyDiagram-c64418c1-D741T7Vx-D7bBbz5a.js → journeyDiagram-c64418c1-D741T7Vx-BUZGH6By.js} +1 -1
  25. package/dist/assets/{layout-BtHnec7v-DPk8SWBY.js → layout-BtHnec7v-LE2NCFha.js} +1 -1
  26. package/dist/assets/{mindmap-definition-8da855dc-DYXCEYTW-C9VeqS3S.js → mindmap-definition-8da855dc-DYXCEYTW-BE2mnn9o.js} +1 -1
  27. package/dist/assets/{pieDiagram-a8764435-56nwm0bs-OTliuzET.js → pieDiagram-a8764435-56nwm0bs-Ch2lhawL.js} +1 -1
  28. package/dist/assets/{quadrantDiagram-1e28029f-BPDrTwrc-BeDUiVSw.js → quadrantDiagram-1e28029f-BPDrTwrc-Eqk_oMCk.js} +1 -1
  29. package/dist/assets/{requirementDiagram-08caed73-ErOyM087-fZE1bidE.js → requirementDiagram-08caed73-ErOyM087-CN1HubTX.js} +1 -1
  30. package/dist/assets/{sankeyDiagram-a04cb91d-Dr_h6k2R-DV92AQzo.js → sankeyDiagram-a04cb91d-Dr_h6k2R-DIIBT6nS.js} +1 -1
  31. package/dist/assets/{sequenceDiagram-c5b8d532-wtK0ihCE-CMdlx77G.js → sequenceDiagram-c5b8d532-wtK0ihCE-DFlnm--q.js} +1 -1
  32. package/dist/assets/{stateDiagram-1ecb1508-D6rDYnWS-BXgBNGIv.js → stateDiagram-1ecb1508-D6rDYnWS-CZRI7OSK.js} +1 -1
  33. package/dist/assets/{stateDiagram-v2-c2b004d7-K0flL3uN-DMmV3VwJ.js → stateDiagram-v2-c2b004d7-K0flL3uN-WfEYk-6K.js} +1 -1
  34. package/dist/assets/{styles-b4e223ce-CPkoRhK8-B88f_9TS.js → styles-b4e223ce-CPkoRhK8-rLSbmLeN.js} +1 -1
  35. package/dist/assets/{styles-ca3715f6-FCD4s0nN-BJNUoxcm.js → styles-ca3715f6-FCD4s0nN-DCz0bdQK.js} +1 -1
  36. package/dist/assets/{styles-d45a18b0-7fTS_K4G-BSFqTrx5.js → styles-d45a18b0-7fTS_K4G-DP5TF55-.js} +1 -1
  37. package/dist/assets/{svgDrawCommon-b86b1483-C9ebAubK-DzwEtGVK.js → svgDrawCommon-b86b1483-C9ebAubK-DYzWlNRg.js} +1 -1
  38. package/dist/assets/{timeline-definition-faaaa080-C-TPmIif-CPB6N7Tu.js → timeline-definition-faaaa080-C-TPmIif-wQ4JP4a4.js} +1 -1
  39. package/dist/assets/{xychartDiagram-f5964ef8-Dy6Sev6Z-UG5jLwgB.js → xychartDiagram-f5964ef8-Dy6Sev6Z-BH71JGM2.js} +1 -1
  40. package/dist/index.html +2 -2
  41. package/package.json +4 -4
  42. package/dist/assets/channel-CSC8iKVS-o3Tgkjx3.js +0 -1
  43. package/dist/assets/clone-vCPXKFeo-DdQ4WIiO.js +0 -1
  44. package/dist/assets/flowDiagram-v2-4f6560a1-B0fti9Da-D8Np9r9b.js +0 -1
  45. package/dist/assets/index-BbD-jy76.css +0 -1
@@ -1,2 +1,2 @@
1
- import{_ as P}from"./index-BKRCw_DF.js";var F=Object.defineProperty,b=(o,t,e)=>t in o?F(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,m=(o,t,e)=>b(o,typeof t!="symbol"?t+"":t,e);let v=null,E=null;typeof window>"u"&&Promise.all([P(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).catch(()=>null),P(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).catch(()=>null)]).then(([o,t])=>{var e,r;(e=o==null?void 0:o.default)!=null&&e.Agent?v=new o.default.Agent({keepAlive:!0}):o!=null&&o.Agent&&(v=new o.Agent({keepAlive:!0})),(r=t==null?void 0:t.default)!=null&&r.Agent?E=new t.default.Agent({keepAlive:!0}):t!=null&&t.Agent&&(E=new t.Agent({keepAlive:!0}))}).catch(o=>{console.warn("Failed to initialize HTTP agents:",o.message)});class C{constructor(t){if(m(this,"apiUrl"),m(this,"apiKey"),m(this,"sessionId"),!t.apiUrl||typeof t.apiUrl!="string")throw new Error("API URL must be a valid string");if(t.apiKey!==void 0&&t.apiKey!==null&&typeof t.apiKey!="string")throw new Error("API key must be a valid string or null");if(t.sessionId!==void 0&&t.sessionId!==null&&typeof t.sessionId!="string")throw new Error("Session ID must be a valid string or null");this.apiUrl=t.apiUrl,this.apiKey=t.apiKey??null,this.sessionId=t.sessionId??null}setSessionId(t){if(t!==null&&typeof t!="string")throw new Error("Session ID must be a valid string or null");this.sessionId=t}getSessionId(){return this.sessionId}async validateApiKey(){var t;if(!this.apiKey)throw new Error("API key is required for validation");try{const e=await fetch(`${this.apiUrl}/admin/api-keys/${this.apiKey}/status`,{...this.getFetchOptions({method:"GET"})}).catch(s=>{throw s.name==="TypeError"&&s.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):s});if(!e.ok){let s="";try{s=await e.text()}catch{s=`HTTP ${e.status}`}let i,n;try{const a=JSON.parse(s);i=a.detail||a.message||s}catch{i=s||`HTTP ${e.status}`}switch(e.status){case 401:n="API key is invalid or expired";break;case 403:n="Access denied: API key does not have required permissions";break;case 404:n="API key not found";break;case 503:n="API key management is not available in inference-only mode";break;default:n=`Failed to validate API key: ${i}`;break}throw new Error(n)}const r=await e.json();if(!r.exists){const s="API key does not exist";throw new Error(s)}if(!r.active){const s="API key is inactive";throw new Error(s)}return r}catch(e){let r;throw e instanceof Error&&e.message?e.message.includes("API key")||e.message.includes("Access denied")||e.message.includes("invalid")||e.message.includes("expired")||e.message.includes("inactive")||e.message.includes("not found")||e.message.includes("Could not connect")?r=e.message:r=`API key validation failed: ${e.message}`:e.name==="TypeError"&&(t=e.message)!=null&&t.includes("Failed to fetch")?r="Could not connect to the server. Please check if the server is running.":r="API key validation failed. Please check your API key and try again.",console.warn(`[ApiClient] ${r}`),new Error(r)}}async getAdapterInfo(){var t;if(!this.apiKey)throw new Error("API key is required to get adapter information");try{const e=await fetch(`${this.apiUrl}/admin/api-keys/info`,{...this.getFetchOptions({method:"GET"})}).catch(r=>{throw r.name==="TypeError"&&r.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):r});if(!e.ok){let r="";try{r=await e.text()}catch{r=`HTTP ${e.status}`}let s,i;try{const n=JSON.parse(r);s=n.detail||n.message||r}catch{s=r||`HTTP ${e.status}`}switch(e.status){case 401:i="API key is invalid, disabled, or has no associated adapter";break;case 404:i="Adapter configuration not found";break;case 503:i="Service is not available";break;default:i=`Failed to get adapter info: ${s}`;break}throw new Error(i)}return await e.json()}catch(e){let r;throw e instanceof Error&&e.message?e.message.includes("API key")||e.message.includes("Adapter")||e.message.includes("invalid")||e.message.includes("disabled")||e.message.includes("not found")||e.message.includes("Could not connect")?r=e.message:r=`Failed to get adapter info: ${e.message}`:e.name==="TypeError"&&(t=e.message)!=null&&t.includes("Failed to fetch")?r="Could not connect to the server. Please check if the server is running.":r="Failed to get adapter information. Please try again.",console.warn(`[ApiClient] ${r}`),new Error(r)}}getFetchOptions(t={}){const e={};if(typeof window>"u"){const s=this.apiUrl.startsWith("https:")?E:v;s&&(e.agent=s)}else e.headers={Connection:"keep-alive"};const r={"X-Request-ID":Date.now().toString(36)+Math.random().toString(36).substring(2)};if(e.headers&&Object.assign(r,e.headers),t.headers){const s=t.headers;for(const[i,n]of Object.entries(s))(i.toLowerCase()!=="x-api-key"||!this.apiKey)&&(r[i]=n)}return this.apiKey&&(r["X-API-Key"]=this.apiKey),this.sessionId&&(r["X-Session-ID"]=this.sessionId),{...t,...e,headers:r}}createChatRequest(t,e=!0,r){const s={messages:[{role:"user",content:t}],stream:e};return r&&r.length>0&&(s.file_ids=r),s}async*streamChat(t,e=!0,r){var s,i;try{const n=new AbortController,a=setTimeout(()=>n.abort(),6e4),c=await fetch(`${this.apiUrl}/v1/chat`,{...this.getFetchOptions({method:"POST",headers:{"Content-Type":"application/json",Accept:e?"text/event-stream":"application/json"},body:JSON.stringify(this.createChatRequest(t,e,r))}),signal:n.signal});if(clearTimeout(a),!c.ok){const h=await c.text();throw new Error(`Network response was not ok: ${c.status} ${h}`)}if(!e){const h=await c.json();h.response&&(yield{text:h.response,done:!0});return}const w=(s=c.body)==null?void 0:s.getReader();if(!w)throw new Error("No reader available");const I=new TextDecoder;let l="",p=!1;try{for(;;){const{done:h,value:$}=await w.read();if(h)break;const T=I.decode($,{stream:!0});l+=T;let f=0,y;for(;(y=l.indexOf(`
1
+ import{_ as P}from"./index-DzCUtfv9.js";var F=Object.defineProperty,b=(o,t,e)=>t in o?F(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,m=(o,t,e)=>b(o,typeof t!="symbol"?t+"":t,e);let v=null,E=null;typeof window>"u"&&Promise.all([P(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).catch(()=>null),P(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).catch(()=>null)]).then(([o,t])=>{var e,r;(e=o==null?void 0:o.default)!=null&&e.Agent?v=new o.default.Agent({keepAlive:!0}):o!=null&&o.Agent&&(v=new o.Agent({keepAlive:!0})),(r=t==null?void 0:t.default)!=null&&r.Agent?E=new t.default.Agent({keepAlive:!0}):t!=null&&t.Agent&&(E=new t.Agent({keepAlive:!0}))}).catch(o=>{console.warn("Failed to initialize HTTP agents:",o.message)});class C{constructor(t){if(m(this,"apiUrl"),m(this,"apiKey"),m(this,"sessionId"),!t.apiUrl||typeof t.apiUrl!="string")throw new Error("API URL must be a valid string");if(t.apiKey!==void 0&&t.apiKey!==null&&typeof t.apiKey!="string")throw new Error("API key must be a valid string or null");if(t.sessionId!==void 0&&t.sessionId!==null&&typeof t.sessionId!="string")throw new Error("Session ID must be a valid string or null");this.apiUrl=t.apiUrl,this.apiKey=t.apiKey??null,this.sessionId=t.sessionId??null}setSessionId(t){if(t!==null&&typeof t!="string")throw new Error("Session ID must be a valid string or null");this.sessionId=t}getSessionId(){return this.sessionId}async validateApiKey(){var t;if(!this.apiKey)throw new Error("API key is required for validation");try{const e=await fetch(`${this.apiUrl}/admin/api-keys/${this.apiKey}/status`,{...this.getFetchOptions({method:"GET"})}).catch(s=>{throw s.name==="TypeError"&&s.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):s});if(!e.ok){let s="";try{s=await e.text()}catch{s=`HTTP ${e.status}`}let i,n;try{const a=JSON.parse(s);i=a.detail||a.message||s}catch{i=s||`HTTP ${e.status}`}switch(e.status){case 401:n="API key is invalid or expired";break;case 403:n="Access denied: API key does not have required permissions";break;case 404:n="API key not found";break;case 503:n="API key management is not available in inference-only mode";break;default:n=`Failed to validate API key: ${i}`;break}throw new Error(n)}const r=await e.json();if(!r.exists){const s="API key does not exist";throw new Error(s)}if(!r.active){const s="API key is inactive";throw new Error(s)}return r}catch(e){let r;throw e instanceof Error&&e.message?e.message.includes("API key")||e.message.includes("Access denied")||e.message.includes("invalid")||e.message.includes("expired")||e.message.includes("inactive")||e.message.includes("not found")||e.message.includes("Could not connect")?r=e.message:r=`API key validation failed: ${e.message}`:e.name==="TypeError"&&(t=e.message)!=null&&t.includes("Failed to fetch")?r="Could not connect to the server. Please check if the server is running.":r="API key validation failed. Please check your API key and try again.",console.warn(`[ApiClient] ${r}`),new Error(r)}}async getAdapterInfo(){var t;if(!this.apiKey)throw new Error("API key is required to get adapter information");try{const e=await fetch(`${this.apiUrl}/admin/api-keys/info`,{...this.getFetchOptions({method:"GET"})}).catch(r=>{throw r.name==="TypeError"&&r.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):r});if(!e.ok){let r="";try{r=await e.text()}catch{r=`HTTP ${e.status}`}let s,i;try{const n=JSON.parse(r);s=n.detail||n.message||r}catch{s=r||`HTTP ${e.status}`}switch(e.status){case 401:i="API key is invalid, disabled, or has no associated adapter";break;case 404:i="Adapter configuration not found";break;case 503:i="Service is not available";break;default:i=`Failed to get adapter info: ${s}`;break}throw new Error(i)}return await e.json()}catch(e){let r;throw e instanceof Error&&e.message?e.message.includes("API key")||e.message.includes("Adapter")||e.message.includes("invalid")||e.message.includes("disabled")||e.message.includes("not found")||e.message.includes("Could not connect")?r=e.message:r=`Failed to get adapter info: ${e.message}`:e.name==="TypeError"&&(t=e.message)!=null&&t.includes("Failed to fetch")?r="Could not connect to the server. Please check if the server is running.":r="Failed to get adapter information. Please try again.",console.warn(`[ApiClient] ${r}`),new Error(r)}}getFetchOptions(t={}){const e={};if(typeof window>"u"){const s=this.apiUrl.startsWith("https:")?E:v;s&&(e.agent=s)}else e.headers={Connection:"keep-alive"};const r={"X-Request-ID":Date.now().toString(36)+Math.random().toString(36).substring(2)};if(e.headers&&Object.assign(r,e.headers),t.headers){const s=t.headers;for(const[i,n]of Object.entries(s))(i.toLowerCase()!=="x-api-key"||!this.apiKey)&&(r[i]=n)}return this.apiKey&&(r["X-API-Key"]=this.apiKey),this.sessionId&&(r["X-Session-ID"]=this.sessionId),{...t,...e,headers:r}}createChatRequest(t,e=!0,r){const s={messages:[{role:"user",content:t}],stream:e};return r&&r.length>0&&(s.file_ids=r),s}async*streamChat(t,e=!0,r){var s,i;try{const n=new AbortController,a=setTimeout(()=>n.abort(),6e4),c=await fetch(`${this.apiUrl}/v1/chat`,{...this.getFetchOptions({method:"POST",headers:{"Content-Type":"application/json",Accept:e?"text/event-stream":"application/json"},body:JSON.stringify(this.createChatRequest(t,e,r))}),signal:n.signal});if(clearTimeout(a),!c.ok){const h=await c.text();throw new Error(`Network response was not ok: ${c.status} ${h}`)}if(!e){const h=await c.json();h.response&&(yield{text:h.response,done:!0});return}const w=(s=c.body)==null?void 0:s.getReader();if(!w)throw new Error("No reader available");const I=new TextDecoder;let l="",p=!1;try{for(;;){const{done:h,value:$}=await w.read();if(h)break;const T=I.decode($,{stream:!0});l+=T;let f=0,y;for(;(y=l.indexOf(`
2
2
  `,f))!==-1;){const u=l.slice(f,y).trim();if(f=y+1,u&&u.startsWith("data: ")){const g=u.slice(6).trim();if(!g||g==="[DONE]"){yield{text:"",done:!0};return}try{const d=JSON.parse(g);if(d.error){const A=`Server error: ${((i=d.error)==null?void 0:i.message)||d.error||"Unknown server error"}`;throw console.warn(`[ApiClient] ${A}`),new Error(A)}if(d.response&&(p=!0,yield{text:d.response,done:d.done||!1}),d.done){yield{text:"",done:!0};return}}catch{console.warn("[ApiClient] Unable to parse server response. This may be a temporary issue.")}}else u&&(p=!0,yield{text:u,done:!1})}l=l.slice(f),l.length>1e6&&(console.warn("Buffer too large, truncating..."),l=l.slice(-5e5))}p&&(yield{text:"",done:!0})}finally{w.releaseLock()}}catch(n){throw n.name==="AbortError"?new Error("Connection timed out. Please check if the server is running."):n.name==="TypeError"&&n.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):n}}async clearConversationHistory(t){const e=t||this.sessionId;if(!e)throw new Error("No session ID provided and no current session available");if(!this.apiKey)throw new Error("API key is required for clearing conversation history");const r={"Content-Type":"application/json","X-Session-ID":e,"X-API-Key":this.apiKey};try{const s=await fetch(`${this.apiUrl}/admin/chat-history/${e}`,{...this.getFetchOptions({method:"DELETE",headers:r})});if(!s.ok){const i=await s.text();throw new Error(`Failed to clear conversation history: ${s.status} ${i}`)}return await s.json()}catch(s){throw s.name==="TypeError"&&s.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):s}}async deleteConversationWithFiles(t,e){const r=t||this.sessionId;if(!r)throw new Error("No session ID provided and no current session available");if(!this.apiKey)throw new Error("API key is required for deleting conversation");const s={"Content-Type":"application/json","X-Session-ID":r,"X-API-Key":this.apiKey},i=e&&e.length>0?`?file_ids=${e.join(",")}`:"",n=`${this.apiUrl}/admin/conversations/${r}${i}`;try{const a=await fetch(n,{...this.getFetchOptions({method:"DELETE",headers:s})});if(!a.ok){const c=await a.text();throw new Error(`Failed to delete conversation: ${a.status} ${c}`)}return await a.json()}catch(a){throw a.name==="TypeError"&&a.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):a}}async uploadFile(t){if(!this.apiKey)throw new Error("API key is required for file upload");const e=new FormData;e.append("file",t);try{const r=await fetch(`${this.apiUrl}/api/files/upload`,{...this.getFetchOptions({method:"POST",body:e})});if(!r.ok){const s=await r.text();throw new Error(`Failed to upload file: ${r.status} ${s}`)}return await r.json()}catch(r){throw r.name==="TypeError"&&r.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):r}}async listFiles(){if(!this.apiKey)throw new Error("API key is required for listing files");try{const t=await fetch(`${this.apiUrl}/api/files`,{...this.getFetchOptions({method:"GET"})});if(!t.ok){const e=await t.text();throw new Error(`Failed to list files: ${t.status} ${e}`)}return await t.json()}catch(t){throw t.name==="TypeError"&&t.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):t}}async getFileInfo(t){if(!this.apiKey)throw new Error("API key is required for getting file info");try{const e=await fetch(`${this.apiUrl}/api/files/${t}`,{...this.getFetchOptions({method:"GET"})});if(!e.ok){const r=await e.text();throw new Error(`Failed to get file info: ${e.status} ${r}`)}return await e.json()}catch(e){throw e.name==="TypeError"&&e.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):e}}async queryFile(t,e,r=10){if(!this.apiKey)throw new Error("API key is required for querying files");try{const s=await fetch(`${this.apiUrl}/api/files/${t}/query`,{...this.getFetchOptions({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,max_results:r})})});if(!s.ok){const i=await s.text();throw new Error(`Failed to query file: ${s.status} ${i}`)}return await s.json()}catch(s){throw s.name==="TypeError"&&s.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):s}}async deleteFile(t){if(!this.apiKey)throw new Error("API key is required for deleting files");const e=`${this.apiUrl}/api/files/${t}`,r=this.getFetchOptions({method:"DELETE"});try{const s=await fetch(e,r);if(!s.ok){const i=await s.text();let n;try{const a=JSON.parse(i);n=a.detail||a.message||`Failed to delete file (HTTP ${s.status})`}catch{n=`Failed to delete file (HTTP ${s.status})`}throw console.warn(`[ApiClient] ${n}`),new Error(n)}return await s.json()}catch(s){let i;throw s.name==="TypeError"&&s.message.includes("Failed to fetch")?i="Could not connect to the server. Please check if the server is running.":s.message&&!s.message.includes("Failed to delete file")?i=s.message:i="Failed to delete file. Please try again.",console.warn(`[ApiClient] ${i}`),new Error(i)}}}let k=null;const x=(o,t=null,e=null)=>{k=new C({apiUrl:o,apiKey:t,sessionId:e})};async function*K(o,t=!0,e){if(!k)throw new Error("API not configured. Please call configureApi() with your server URL before using any API functions.");yield*k.streamChat(o,t,e)}export{C as ApiClient,x as configureApi,K as streamChat};
@@ -0,0 +1,2 @@
1
+ import{_ as P}from"./index-DzCUtfv9.js";var F=Object.defineProperty,b=(o,t,e)=>t in o?F(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,m=(o,t,e)=>b(o,typeof t!="symbol"?t+"":t,e);let v=null,E=null;typeof window>"u"&&Promise.all([P(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).catch(()=>null),P(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).catch(()=>null)]).then(([o,t])=>{var e,r;(e=o==null?void 0:o.default)!=null&&e.Agent?v=new o.default.Agent({keepAlive:!0}):o!=null&&o.Agent&&(v=new o.Agent({keepAlive:!0})),(r=t==null?void 0:t.default)!=null&&r.Agent?E=new t.default.Agent({keepAlive:!0}):t!=null&&t.Agent&&(E=new t.Agent({keepAlive:!0}))}).catch(o=>{console.warn("Failed to initialize HTTP agents:",o.message)});class C{constructor(t){if(m(this,"apiUrl"),m(this,"apiKey"),m(this,"sessionId"),!t.apiUrl||typeof t.apiUrl!="string")throw new Error("API URL must be a valid string");if(t.apiKey!==void 0&&t.apiKey!==null&&typeof t.apiKey!="string")throw new Error("API key must be a valid string or null");if(t.sessionId!==void 0&&t.sessionId!==null&&typeof t.sessionId!="string")throw new Error("Session ID must be a valid string or null");this.apiUrl=t.apiUrl,this.apiKey=t.apiKey??null,this.sessionId=t.sessionId??null}setSessionId(t){if(t!==null&&typeof t!="string")throw new Error("Session ID must be a valid string or null");this.sessionId=t}getSessionId(){return this.sessionId}async validateApiKey(){var t;if(!this.apiKey)throw new Error("API key is required for validation");try{const e=await fetch(`${this.apiUrl}/admin/api-keys/${this.apiKey}/status`,{...this.getFetchOptions({method:"GET"})}).catch(s=>{throw s.name==="TypeError"&&s.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):s});if(!e.ok){let s="";try{s=await e.text()}catch{s=`HTTP ${e.status}`}let i,n;try{const a=JSON.parse(s);i=a.detail||a.message||s}catch{i=s||`HTTP ${e.status}`}switch(e.status){case 401:n="API key is invalid or expired";break;case 403:n="Access denied: API key does not have required permissions";break;case 404:n="API key not found";break;case 503:n="API key management is not available in inference-only mode";break;default:n=`Failed to validate API key: ${i}`;break}throw new Error(n)}const r=await e.json();if(!r.exists){const s="API key does not exist";throw new Error(s)}if(!r.active){const s="API key is inactive";throw new Error(s)}return r}catch(e){let r;throw e instanceof Error&&e.message?e.message.includes("API key")||e.message.includes("Access denied")||e.message.includes("invalid")||e.message.includes("expired")||e.message.includes("inactive")||e.message.includes("not found")||e.message.includes("Could not connect")?r=e.message:r=`API key validation failed: ${e.message}`:e.name==="TypeError"&&(t=e.message)!=null&&t.includes("Failed to fetch")?r="Could not connect to the server. Please check if the server is running.":r="API key validation failed. Please check your API key and try again.",console.warn(`[ApiClient] ${r}`),new Error(r)}}async getAdapterInfo(){var t;if(!this.apiKey)throw new Error("API key is required to get adapter information");try{const e=await fetch(`${this.apiUrl}/admin/api-keys/info`,{...this.getFetchOptions({method:"GET"})}).catch(r=>{throw r.name==="TypeError"&&r.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):r});if(!e.ok){let r="";try{r=await e.text()}catch{r=`HTTP ${e.status}`}let s,i;try{const n=JSON.parse(r);s=n.detail||n.message||r}catch{s=r||`HTTP ${e.status}`}switch(e.status){case 401:i="API key is invalid, disabled, or has no associated adapter";break;case 404:i="Adapter configuration not found";break;case 503:i="Service is not available";break;default:i=`Failed to get adapter info: ${s}`;break}throw new Error(i)}return await e.json()}catch(e){let r;throw e instanceof Error&&e.message?e.message.includes("API key")||e.message.includes("Adapter")||e.message.includes("invalid")||e.message.includes("disabled")||e.message.includes("not found")||e.message.includes("Could not connect")?r=e.message:r=`Failed to get adapter info: ${e.message}`:e.name==="TypeError"&&(t=e.message)!=null&&t.includes("Failed to fetch")?r="Could not connect to the server. Please check if the server is running.":r="Failed to get adapter information. Please try again.",console.warn(`[ApiClient] ${r}`),new Error(r)}}getFetchOptions(t={}){const e={};if(typeof window>"u"){const s=this.apiUrl.startsWith("https:")?E:v;s&&(e.agent=s)}else e.headers={Connection:"keep-alive"};const r={"X-Request-ID":Date.now().toString(36)+Math.random().toString(36).substring(2)};if(e.headers&&Object.assign(r,e.headers),t.headers){const s=t.headers;for(const[i,n]of Object.entries(s))(i.toLowerCase()!=="x-api-key"||!this.apiKey)&&(r[i]=n)}return this.apiKey&&(r["X-API-Key"]=this.apiKey),this.sessionId&&(r["X-Session-ID"]=this.sessionId),{...t,...e,headers:r}}createChatRequest(t,e=!0,r){const s={messages:[{role:"user",content:t}],stream:e};return r&&r.length>0&&(s.file_ids=r),s}async*streamChat(t,e=!0,r){var s,i;try{const n=new AbortController,a=setTimeout(()=>n.abort(),6e4),c=await fetch(`${this.apiUrl}/v1/chat`,{...this.getFetchOptions({method:"POST",headers:{"Content-Type":"application/json",Accept:e?"text/event-stream":"application/json"},body:JSON.stringify(this.createChatRequest(t,e,r))}),signal:n.signal});if(clearTimeout(a),!c.ok){const h=await c.text();throw new Error(`Network response was not ok: ${c.status} ${h}`)}if(!e){const h=await c.json();h.response&&(yield{text:h.response,done:!0});return}const w=(s=c.body)==null?void 0:s.getReader();if(!w)throw new Error("No reader available");const I=new TextDecoder;let l="",p=!1;try{for(;;){const{done:h,value:$}=await w.read();if(h)break;const T=I.decode($,{stream:!0});l+=T;let f=0,y;for(;(y=l.indexOf(`
2
+ `,f))!==-1;){const u=l.slice(f,y).trim();if(f=y+1,u&&u.startsWith("data: ")){const g=u.slice(6).trim();if(!g||g==="[DONE]"){yield{text:"",done:!0};return}try{const d=JSON.parse(g);if(d.error){const A=`Server error: ${((i=d.error)==null?void 0:i.message)||d.error||"Unknown server error"}`;throw console.warn(`[ApiClient] ${A}`),new Error(A)}if(d.response&&(p=!0,yield{text:d.response,done:d.done||!1}),d.done){yield{text:"",done:!0};return}}catch{console.warn("[ApiClient] Unable to parse server response. This may be a temporary issue.")}}else u&&(p=!0,yield{text:u,done:!1})}l=l.slice(f),l.length>1e6&&(console.warn("Buffer too large, truncating..."),l=l.slice(-5e5))}p&&(yield{text:"",done:!0})}finally{w.releaseLock()}}catch(n){throw n.name==="AbortError"?new Error("Connection timed out. Please check if the server is running."):n.name==="TypeError"&&n.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):n}}async clearConversationHistory(t){const e=t||this.sessionId;if(!e)throw new Error("No session ID provided and no current session available");if(!this.apiKey)throw new Error("API key is required for clearing conversation history");const r={"Content-Type":"application/json","X-Session-ID":e,"X-API-Key":this.apiKey};try{const s=await fetch(`${this.apiUrl}/admin/chat-history/${e}`,{...this.getFetchOptions({method:"DELETE",headers:r})});if(!s.ok){const i=await s.text();throw new Error(`Failed to clear conversation history: ${s.status} ${i}`)}return await s.json()}catch(s){throw s.name==="TypeError"&&s.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):s}}async deleteConversationWithFiles(t,e){const r=t||this.sessionId;if(!r)throw new Error("No session ID provided and no current session available");if(!this.apiKey)throw new Error("API key is required for deleting conversation");const s={"Content-Type":"application/json","X-Session-ID":r,"X-API-Key":this.apiKey},i=e&&e.length>0?`?file_ids=${e.join(",")}`:"",n=`${this.apiUrl}/admin/conversations/${r}${i}`;try{const a=await fetch(n,{...this.getFetchOptions({method:"DELETE",headers:s})});if(!a.ok){const c=await a.text();throw new Error(`Failed to delete conversation: ${a.status} ${c}`)}return await a.json()}catch(a){throw a.name==="TypeError"&&a.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):a}}async uploadFile(t){if(!this.apiKey)throw new Error("API key is required for file upload");const e=new FormData;e.append("file",t);try{const r=await fetch(`${this.apiUrl}/api/files/upload`,{...this.getFetchOptions({method:"POST",body:e})});if(!r.ok){const s=await r.text();throw new Error(`Failed to upload file: ${r.status} ${s}`)}return await r.json()}catch(r){throw r.name==="TypeError"&&r.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):r}}async listFiles(){if(!this.apiKey)throw new Error("API key is required for listing files");try{const t=await fetch(`${this.apiUrl}/api/files`,{...this.getFetchOptions({method:"GET"})});if(!t.ok){const e=await t.text();throw new Error(`Failed to list files: ${t.status} ${e}`)}return await t.json()}catch(t){throw t.name==="TypeError"&&t.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):t}}async getFileInfo(t){if(!this.apiKey)throw new Error("API key is required for getting file info");try{const e=await fetch(`${this.apiUrl}/api/files/${t}`,{...this.getFetchOptions({method:"GET"})});if(!e.ok){const r=await e.text();throw new Error(`Failed to get file info: ${e.status} ${r}`)}return await e.json()}catch(e){throw e.name==="TypeError"&&e.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):e}}async queryFile(t,e,r=10){if(!this.apiKey)throw new Error("API key is required for querying files");try{const s=await fetch(`${this.apiUrl}/api/files/${t}/query`,{...this.getFetchOptions({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,max_results:r})})});if(!s.ok){const i=await s.text();throw new Error(`Failed to query file: ${s.status} ${i}`)}return await s.json()}catch(s){throw s.name==="TypeError"&&s.message.includes("Failed to fetch")?new Error("Could not connect to the server. Please check if the server is running."):s}}async deleteFile(t){if(!this.apiKey)throw new Error("API key is required for deleting files");const e=`${this.apiUrl}/api/files/${t}`,r=this.getFetchOptions({method:"DELETE"});try{const s=await fetch(e,r);if(!s.ok){const i=await s.text();let n;try{const a=JSON.parse(i);n=a.detail||a.message||`Failed to delete file (HTTP ${s.status})`}catch{n=`Failed to delete file (HTTP ${s.status})`}throw console.warn(`[ApiClient] ${n}`),new Error(n)}return await s.json()}catch(s){let i;throw s.name==="TypeError"&&s.message.includes("Failed to fetch")?i="Could not connect to the server. Please check if the server is running.":s.message&&!s.message.includes("Failed to delete file")?i=s.message:i="Failed to delete file. Please try again.",console.warn(`[ApiClient] ${i}`),new Error(i)}}}let k=null;const x=(o,t=null,e=null)=>{k=new C({apiUrl:o,apiKey:t,sessionId:e})};async function*K(o,t=!0,e){if(!k)throw new Error("API not configured. Please call configureApi() with your server URL before using any API functions.");yield*k.streamChat(o,t,e)}export{C as ApiClient,x as configureApi,K as streamChat};
@@ -1 +1 @@
1
- import{aP as sn,aQ as an,aR as I,aS as _,ag as Z,aT as un,aU as l,ai as on,aV as $,aW as q,aX as cn,aY as e,aZ as en,a_ as rn,a$ as yn}from"./index-BKRCw_DF.js";function fn(s){return s.innerRadius}function ln(s){return s.outerRadius}function gn(s){return s.startAngle}function mn(s){return s.endAngle}function pn(s){return s&&s.padAngle}function xn(s,v,B,D,R,d,O,a){var K=B-s,r=D-v,n=O-R,m=a-d,u=m*K-n*r;if(!(u*u<l))return u=(n*(v-d)-m*(s-R))/u,[s+u*K,v+u*r]}function F(s,v,B,D,R,d,O){var a=s-B,K=v-D,r=(O?d:-d)/$(a*a+K*K),n=r*K,m=-r*a,u=s+n,i=v+m,y=B+n,f=D+m,Q=(u+y)/2,o=(i+f)/2,p=y-u,g=f-i,T=p*p+g*g,A=R-d,E=u*f-y*i,P=(g<0?-1:1)*$(en(0,A*A*T-E*E)),S=(E*g-p*P)/T,V=(-E*p-g*P)/T,X=(E*g+p*P)/T,x=(-E*p+g*P)/T,h=S-Q,t=V-o,c=X-Q,U=x-o;return h*h+t*t>c*c+U*U&&(S=X,V=x),{cx:S,cy:V,x01:-n,y01:-m,x11:S*(R/A-1),y11:V*(R/A-1)}}function vn(){var s=fn,v=ln,B=Z(0),D=null,R=gn,d=mn,O=pn,a=null,K=sn(r);function r(){var n,m,u=+s.apply(this,arguments),i=+v.apply(this,arguments),y=R.apply(this,arguments)-un,f=d.apply(this,arguments)-un,Q=cn(f-y),o=f>y;if(a||(a=n=K()),i<u&&(m=i,i=u,u=m),!(i>l))a.moveTo(0,0);else if(Q>on-l)a.moveTo(i*I(y),i*_(y)),a.arc(0,0,i,y,f,!o),u>l&&(a.moveTo(u*I(f),u*_(f)),a.arc(0,0,u,f,y,o));else{var p=y,g=f,T=y,A=f,E=Q,P=Q,S=O.apply(this,arguments)/2,V=S>l&&(D?+D.apply(this,arguments):$(u*u+i*i)),X=q(cn(i-u)/2,+B.apply(this,arguments)),x=X,h=X,t,c;if(V>l){var U=rn(V/u*_(S)),b=rn(V/i*_(S));(E-=U*2)>l?(U*=o?1:-1,T+=U,A-=U):(E=0,T=A=(y+f)/2),(P-=b*2)>l?(b*=o?1:-1,p+=b,g-=b):(P=0,p=g=(y+f)/2)}var L=i*I(p),Y=i*_(p),k=u*I(A),C=u*_(A);if(X>l){var M=i*I(g),N=i*_(g),G=u*I(T),H=u*_(T),W;if(Q<an)if(W=xn(L,Y,G,H,M,N,k,C)){var J=L-W[0],j=Y-W[1],w=M-W[0],z=N-W[1],nn=1/_(yn((J*w+j*z)/($(J*J+j*j)*$(w*w+z*z)))/2),tn=$(W[0]*W[0]+W[1]*W[1]);x=q(X,(u-tn)/(nn-1)),h=q(X,(i-tn)/(nn+1))}else x=h=0}P>l?h>l?(t=F(G,H,L,Y,i,h,o),c=F(M,N,k,C,i,h,o),a.moveTo(t.cx+t.x01,t.cy+t.y01),h<X?a.arc(t.cx,t.cy,h,e(t.y01,t.x01),e(c.y01,c.x01),!o):(a.arc(t.cx,t.cy,h,e(t.y01,t.x01),e(t.y11,t.x11),!o),a.arc(0,0,i,e(t.cy+t.y11,t.cx+t.x11),e(c.cy+c.y11,c.cx+c.x11),!o),a.arc(c.cx,c.cy,h,e(c.y11,c.x11),e(c.y01,c.x01),!o))):(a.moveTo(L,Y),a.arc(0,0,i,p,g,!o)):a.moveTo(L,Y),!(u>l)||!(E>l)?a.lineTo(k,C):x>l?(t=F(k,C,M,N,u,-x,o),c=F(L,Y,G,H,u,-x,o),a.lineTo(t.cx+t.x01,t.cy+t.y01),x<X?a.arc(t.cx,t.cy,x,e(t.y01,t.x01),e(c.y01,c.x01),!o):(a.arc(t.cx,t.cy,x,e(t.y01,t.x01),e(t.y11,t.x11),!o),a.arc(0,0,u,e(t.cy+t.y11,t.cx+t.x11),e(c.cy+c.y11,c.cx+c.x11),o),a.arc(c.cx,c.cy,x,e(c.y11,c.x11),e(c.y01,c.x01),!o))):a.arc(0,0,u,A,T,o)}if(a.closePath(),n)return a=null,n+""||null}return r.centroid=function(){var n=(+s.apply(this,arguments)+ +v.apply(this,arguments))/2,m=(+R.apply(this,arguments)+ +d.apply(this,arguments))/2-an/2;return[I(m)*n,_(m)*n]},r.innerRadius=function(n){return arguments.length?(s=typeof n=="function"?n:Z(+n),r):s},r.outerRadius=function(n){return arguments.length?(v=typeof n=="function"?n:Z(+n),r):v},r.cornerRadius=function(n){return arguments.length?(B=typeof n=="function"?n:Z(+n),r):B},r.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:Z(+n),r):D},r.startAngle=function(n){return arguments.length?(R=typeof n=="function"?n:Z(+n),r):R},r.endAngle=function(n){return arguments.length?(d=typeof n=="function"?n:Z(+n),r):d},r.padAngle=function(n){return arguments.length?(O=typeof n=="function"?n:Z(+n),r):O},r.context=function(n){return arguments.length?(a=n??null,r):a},r}export{vn as h};
1
+ import{aP as sn,aQ as an,aR as I,aS as _,ag as Z,aT as un,aU as l,ai as on,aV as $,aW as q,aX as cn,aY as e,aZ as en,a_ as rn,a$ as yn}from"./index-DzCUtfv9.js";function fn(s){return s.innerRadius}function ln(s){return s.outerRadius}function gn(s){return s.startAngle}function mn(s){return s.endAngle}function pn(s){return s&&s.padAngle}function xn(s,v,B,D,R,d,O,a){var K=B-s,r=D-v,n=O-R,m=a-d,u=m*K-n*r;if(!(u*u<l))return u=(n*(v-d)-m*(s-R))/u,[s+u*K,v+u*r]}function F(s,v,B,D,R,d,O){var a=s-B,K=v-D,r=(O?d:-d)/$(a*a+K*K),n=r*K,m=-r*a,u=s+n,i=v+m,y=B+n,f=D+m,Q=(u+y)/2,o=(i+f)/2,p=y-u,g=f-i,T=p*p+g*g,A=R-d,E=u*f-y*i,P=(g<0?-1:1)*$(en(0,A*A*T-E*E)),S=(E*g-p*P)/T,V=(-E*p-g*P)/T,X=(E*g+p*P)/T,x=(-E*p+g*P)/T,h=S-Q,t=V-o,c=X-Q,U=x-o;return h*h+t*t>c*c+U*U&&(S=X,V=x),{cx:S,cy:V,x01:-n,y01:-m,x11:S*(R/A-1),y11:V*(R/A-1)}}function vn(){var s=fn,v=ln,B=Z(0),D=null,R=gn,d=mn,O=pn,a=null,K=sn(r);function r(){var n,m,u=+s.apply(this,arguments),i=+v.apply(this,arguments),y=R.apply(this,arguments)-un,f=d.apply(this,arguments)-un,Q=cn(f-y),o=f>y;if(a||(a=n=K()),i<u&&(m=i,i=u,u=m),!(i>l))a.moveTo(0,0);else if(Q>on-l)a.moveTo(i*I(y),i*_(y)),a.arc(0,0,i,y,f,!o),u>l&&(a.moveTo(u*I(f),u*_(f)),a.arc(0,0,u,f,y,o));else{var p=y,g=f,T=y,A=f,E=Q,P=Q,S=O.apply(this,arguments)/2,V=S>l&&(D?+D.apply(this,arguments):$(u*u+i*i)),X=q(cn(i-u)/2,+B.apply(this,arguments)),x=X,h=X,t,c;if(V>l){var U=rn(V/u*_(S)),b=rn(V/i*_(S));(E-=U*2)>l?(U*=o?1:-1,T+=U,A-=U):(E=0,T=A=(y+f)/2),(P-=b*2)>l?(b*=o?1:-1,p+=b,g-=b):(P=0,p=g=(y+f)/2)}var L=i*I(p),Y=i*_(p),k=u*I(A),C=u*_(A);if(X>l){var M=i*I(g),N=i*_(g),G=u*I(T),H=u*_(T),W;if(Q<an)if(W=xn(L,Y,G,H,M,N,k,C)){var J=L-W[0],j=Y-W[1],w=M-W[0],z=N-W[1],nn=1/_(yn((J*w+j*z)/($(J*J+j*j)*$(w*w+z*z)))/2),tn=$(W[0]*W[0]+W[1]*W[1]);x=q(X,(u-tn)/(nn-1)),h=q(X,(i-tn)/(nn+1))}else x=h=0}P>l?h>l?(t=F(G,H,L,Y,i,h,o),c=F(M,N,k,C,i,h,o),a.moveTo(t.cx+t.x01,t.cy+t.y01),h<X?a.arc(t.cx,t.cy,h,e(t.y01,t.x01),e(c.y01,c.x01),!o):(a.arc(t.cx,t.cy,h,e(t.y01,t.x01),e(t.y11,t.x11),!o),a.arc(0,0,i,e(t.cy+t.y11,t.cx+t.x11),e(c.cy+c.y11,c.cx+c.x11),!o),a.arc(c.cx,c.cy,h,e(c.y11,c.x11),e(c.y01,c.x01),!o))):(a.moveTo(L,Y),a.arc(0,0,i,p,g,!o)):a.moveTo(L,Y),!(u>l)||!(E>l)?a.lineTo(k,C):x>l?(t=F(k,C,M,N,u,-x,o),c=F(L,Y,G,H,u,-x,o),a.lineTo(t.cx+t.x01,t.cy+t.y01),x<X?a.arc(t.cx,t.cy,x,e(t.y01,t.x01),e(c.y01,c.x01),!o):(a.arc(t.cx,t.cy,x,e(t.y01,t.x01),e(t.y11,t.x11),!o),a.arc(0,0,u,e(t.cy+t.y11,t.cx+t.x11),e(c.cy+c.y11,c.cx+c.x11),o),a.arc(c.cx,c.cy,x,e(c.y11,c.x11),e(c.y01,c.x01),!o))):a.arc(0,0,u,A,T,o)}if(a.closePath(),n)return a=null,n+""||null}return r.centroid=function(){var n=(+s.apply(this,arguments)+ +v.apply(this,arguments))/2,m=(+R.apply(this,arguments)+ +d.apply(this,arguments))/2-an/2;return[I(m)*n,_(m)*n]},r.innerRadius=function(n){return arguments.length?(s=typeof n=="function"?n:Z(+n),r):s},r.outerRadius=function(n){return arguments.length?(v=typeof n=="function"?n:Z(+n),r):v},r.cornerRadius=function(n){return arguments.length?(B=typeof n=="function"?n:Z(+n),r):B},r.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:Z(+n),r):D},r.startAngle=function(n){return arguments.length?(R=typeof n=="function"?n:Z(+n),r):R},r.endAngle=function(n){return arguments.length?(d=typeof n=="function"?n:Z(+n),r):d},r.padAngle=function(n){return arguments.length?(O=typeof n=="function"?n:Z(+n),r):O},r.context=function(n){return arguments.length?(a=n??null,r):a},r}export{vn as h};
@@ -1,4 +1,4 @@
1
- import{ak as se,d as me,P as q,c as _e,O as f,ae as ke,n as Ee,U as De,X as ge,v as we}from"./index-BKRCw_DF.js";import{a as ve}from"./clone-vCPXKFeo-DdQ4WIiO.js";import{c as Ne,g as $e,x as Te,d as Oe,h as de,p as Ie}from"./edges-96097737-XAH6P1yX-hj5ay2ub.js";import{K as Ae}from"./graph-Bc6U-Oet-BbypjADy.js";import{t as Ce}from"./channel-CSC8iKVS-o3Tgkjx3.js";import{r as ze}from"./Tableau10-D7jGxypv-Cyu9clx1.js";import"./createText-1719965b-Cbn6MBZp-zrb_KsAx.js";var oe,ae,ee=function(){var e=function(m,s,r,l){for(r=r||{},l=m.length;l--;r[m[l]]=s);return r},o=[1,7],h=[1,13],c=[1,14],n=[1,15],g=[1,19],a=[1,16],y=[1,17],b=[1,18],d=[8,30],x=[8,21,28,29,30,31,32,40,44,47],_=[1,23],T=[1,24],k=[8,15,16,21,28,29,30,31,32,40,44,47],v=[8,15,16,21,27,28,29,30,31,32,40,44,47],L=[1,49],D={trace:function(){},yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:function(m,s,r,l,p,t,u){var i=t.length-1;switch(p){case 4:l.getLogger().debug("Rule: separator (NL) ");break;case 5:l.getLogger().debug("Rule: separator (Space) ");break;case 6:l.getLogger().debug("Rule: separator (EOF) ");break;case 7:l.getLogger().debug("Rule: hierarchy: ",t[i-1]),l.setHierarchy(t[i-1]);break;case 8:l.getLogger().debug("Stop NL ");break;case 9:l.getLogger().debug("Stop EOF ");break;case 10:l.getLogger().debug("Stop NL2 ");break;case 11:l.getLogger().debug("Stop EOF2 ");break;case 12:l.getLogger().debug("Rule: statement: ",t[i]),typeof t[i].length=="number"?this.$=t[i]:this.$=[t[i]];break;case 13:l.getLogger().debug("Rule: statement #2: ",t[i-1]),this.$=[t[i-1]].concat(t[i]);break;case 14:l.getLogger().debug("Rule: link: ",t[i],m),this.$={edgeTypeStr:t[i],label:""};break;case 15:l.getLogger().debug("Rule: LABEL link: ",t[i-3],t[i-1],t[i]),this.$={edgeTypeStr:t[i],label:t[i-1]};break;case 18:const O=parseInt(t[i]),B=l.generateId();this.$={id:B,type:"space",label:"",width:O,children:[]};break;case 23:l.getLogger().debug("Rule: (nodeStatement link node) ",t[i-2],t[i-1],t[i]," typestr: ",t[i-1].edgeTypeStr);const X=l.edgeStrToEdgeData(t[i-1].edgeTypeStr);this.$=[{id:t[i-2].id,label:t[i-2].label,type:t[i-2].type,directions:t[i-2].directions},{id:t[i-2].id+"-"+t[i].id,start:t[i-2].id,end:t[i].id,label:t[i-1].label,type:"edge",directions:t[i].directions,arrowTypeEnd:X,arrowTypeStart:"arrow_open"},{id:t[i].id,label:t[i].label,type:l.typeStr2Type(t[i].typeStr),directions:t[i].directions}];break;case 24:l.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[i-1],t[i]),this.$={id:t[i-1].id,label:t[i-1].label,type:l.typeStr2Type(t[i-1].typeStr),directions:t[i-1].directions,widthInColumns:parseInt(t[i],10)};break;case 25:l.getLogger().debug("Rule: nodeStatement (node) ",t[i]),this.$={id:t[i].id,label:t[i].label,type:l.typeStr2Type(t[i].typeStr),directions:t[i].directions,widthInColumns:1};break;case 26:l.getLogger().debug("APA123",this?this:"na"),l.getLogger().debug("COLUMNS: ",t[i]),this.$={type:"column-setting",columns:t[i]==="auto"?-1:parseInt(t[i])};break;case 27:l.getLogger().debug("Rule: id-block statement : ",t[i-2],t[i-1]),l.generateId(),this.$={...t[i-2],type:"composite",children:t[i-1]};break;case 28:l.getLogger().debug("Rule: blockStatement : ",t[i-2],t[i-1],t[i]);const C=l.generateId();this.$={id:C,type:"composite",label:"",children:t[i-1]};break;case 29:l.getLogger().debug("Rule: node (NODE_ID separator): ",t[i]),this.$={id:t[i]};break;case 30:l.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[i-1],t[i]),this.$={id:t[i-1],label:t[i].label,typeStr:t[i].typeStr,directions:t[i].directions};break;case 31:l.getLogger().debug("Rule: dirList: ",t[i]),this.$=[t[i]];break;case 32:l.getLogger().debug("Rule: dirList: ",t[i-1],t[i]),this.$=[t[i-1]].concat(t[i]);break;case 33:l.getLogger().debug("Rule: nodeShapeNLabel: ",t[i-2],t[i-1],t[i]),this.$={typeStr:t[i-2]+t[i],label:t[i-1]};break;case 34:l.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[i-3],t[i-2]," #3:",t[i-1],t[i]),this.$={typeStr:t[i-3]+t[i],label:t[i-2],directions:t[i-1]};break;case 35:case 36:this.$={type:"classDef",id:t[i-1].trim(),css:t[i].trim()};break;case 37:this.$={type:"applyClass",id:t[i-1].trim(),styleClass:t[i].trim()};break;case 38:this.$={type:"applyStyles",id:t[i-1].trim(),stylesStr:t[i].trim()};break}},table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:h,29:c,31:n,32:g,40:a,44:y,47:b},{8:[1,20]},e(d,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:o,28:h,29:c,31:n,32:g,40:a,44:y,47:b}),e(x,[2,16],{14:22,15:_,16:T}),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),e(x,[2,21]),e(x,[2,22]),e(k,[2,25],{27:[1,25]}),e(x,[2,26]),{19:26,26:12,32:g},{11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:h,29:c,31:n,32:g,40:a,44:y,47:b},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(v,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(d,[2,13]),{26:35,32:g},{32:[2,14]},{17:[1,36]},e(k,[2,24]),{11:37,13:4,14:22,15:_,16:T,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:h,29:c,31:n,32:g,40:a,44:y,47:b},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(v,[2,30]),{18:[1,43]},{18:[1,44]},e(k,[2,23]),{18:[1,45]},{30:[1,46]},e(x,[2,28]),e(x,[2,35]),e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{37:[1,47]},{34:48,35:L},{15:[1,50]},e(x,[2,27]),e(v,[2,33]),{39:[1,51]},{34:52,35:L,39:[2,31]},{32:[2,15]},e(v,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:function(m,s){if(s.recoverable)this.trace(m);else{var r=new Error(m);throw r.hash=s,r}},parse:function(m){var s=this,r=[0],l=[],p=[null],t=[],u=this.table,i="",O=0,B=0,X=2,C=1,P=t.slice.call(arguments,1),E=Object.create(this.lexer),F={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(F.yy[J]=this.yy[J]);E.setInput(m,F.yy),F.yy.lexer=E,F.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var V=E.yylloc;t.push(V);var Le=E.options&&E.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Se(){var R;return R=l.pop()||E.lex()||C,typeof R!="number"&&(R instanceof Array&&(l=R,R=l.pop()),R=s.symbols_[R]||R),R}for(var N,Y,I,Z,K={},j,z,le,H;;){if(Y=r[r.length-1],this.defaultActions[Y]?I=this.defaultActions[Y]:((N===null||typeof N>"u")&&(N=Se()),I=u[Y]&&u[Y][N]),typeof I>"u"||!I.length||!I[0]){var Q="";H=[];for(j in u[Y])this.terminals_[j]&&j>X&&H.push("'"+this.terminals_[j]+"'");E.showPosition?Q="Parse error on line "+(O+1)+`:
1
+ import{ak as se,d as me,P as q,c as _e,O as f,ae as ke,n as Ee,U as De,X as ge,v as we}from"./index-DzCUtfv9.js";import{a as ve}from"./clone-vCPXKFeo-hZBJf3C4.js";import{c as Ne,g as $e,x as Te,d as Oe,h as de,p as Ie}from"./edges-96097737-XAH6P1yX-C5S8p_6I.js";import{K as Ae}from"./graph-Bc6U-Oet-CBlVz78v.js";import{t as Ce}from"./channel-CSC8iKVS-BN5SWoeh.js";import{r as ze}from"./Tableau10-D7jGxypv-Cyu9clx1.js";import"./createText-1719965b-Cbn6MBZp-zoEnAAP_.js";var oe,ae,ee=function(){var e=function(m,s,r,l){for(r=r||{},l=m.length;l--;r[m[l]]=s);return r},o=[1,7],h=[1,13],c=[1,14],n=[1,15],g=[1,19],a=[1,16],y=[1,17],b=[1,18],d=[8,30],x=[8,21,28,29,30,31,32,40,44,47],_=[1,23],T=[1,24],k=[8,15,16,21,28,29,30,31,32,40,44,47],v=[8,15,16,21,27,28,29,30,31,32,40,44,47],L=[1,49],D={trace:function(){},yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:function(m,s,r,l,p,t,u){var i=t.length-1;switch(p){case 4:l.getLogger().debug("Rule: separator (NL) ");break;case 5:l.getLogger().debug("Rule: separator (Space) ");break;case 6:l.getLogger().debug("Rule: separator (EOF) ");break;case 7:l.getLogger().debug("Rule: hierarchy: ",t[i-1]),l.setHierarchy(t[i-1]);break;case 8:l.getLogger().debug("Stop NL ");break;case 9:l.getLogger().debug("Stop EOF ");break;case 10:l.getLogger().debug("Stop NL2 ");break;case 11:l.getLogger().debug("Stop EOF2 ");break;case 12:l.getLogger().debug("Rule: statement: ",t[i]),typeof t[i].length=="number"?this.$=t[i]:this.$=[t[i]];break;case 13:l.getLogger().debug("Rule: statement #2: ",t[i-1]),this.$=[t[i-1]].concat(t[i]);break;case 14:l.getLogger().debug("Rule: link: ",t[i],m),this.$={edgeTypeStr:t[i],label:""};break;case 15:l.getLogger().debug("Rule: LABEL link: ",t[i-3],t[i-1],t[i]),this.$={edgeTypeStr:t[i],label:t[i-1]};break;case 18:const O=parseInt(t[i]),B=l.generateId();this.$={id:B,type:"space",label:"",width:O,children:[]};break;case 23:l.getLogger().debug("Rule: (nodeStatement link node) ",t[i-2],t[i-1],t[i]," typestr: ",t[i-1].edgeTypeStr);const X=l.edgeStrToEdgeData(t[i-1].edgeTypeStr);this.$=[{id:t[i-2].id,label:t[i-2].label,type:t[i-2].type,directions:t[i-2].directions},{id:t[i-2].id+"-"+t[i].id,start:t[i-2].id,end:t[i].id,label:t[i-1].label,type:"edge",directions:t[i].directions,arrowTypeEnd:X,arrowTypeStart:"arrow_open"},{id:t[i].id,label:t[i].label,type:l.typeStr2Type(t[i].typeStr),directions:t[i].directions}];break;case 24:l.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[i-1],t[i]),this.$={id:t[i-1].id,label:t[i-1].label,type:l.typeStr2Type(t[i-1].typeStr),directions:t[i-1].directions,widthInColumns:parseInt(t[i],10)};break;case 25:l.getLogger().debug("Rule: nodeStatement (node) ",t[i]),this.$={id:t[i].id,label:t[i].label,type:l.typeStr2Type(t[i].typeStr),directions:t[i].directions,widthInColumns:1};break;case 26:l.getLogger().debug("APA123",this?this:"na"),l.getLogger().debug("COLUMNS: ",t[i]),this.$={type:"column-setting",columns:t[i]==="auto"?-1:parseInt(t[i])};break;case 27:l.getLogger().debug("Rule: id-block statement : ",t[i-2],t[i-1]),l.generateId(),this.$={...t[i-2],type:"composite",children:t[i-1]};break;case 28:l.getLogger().debug("Rule: blockStatement : ",t[i-2],t[i-1],t[i]);const C=l.generateId();this.$={id:C,type:"composite",label:"",children:t[i-1]};break;case 29:l.getLogger().debug("Rule: node (NODE_ID separator): ",t[i]),this.$={id:t[i]};break;case 30:l.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[i-1],t[i]),this.$={id:t[i-1],label:t[i].label,typeStr:t[i].typeStr,directions:t[i].directions};break;case 31:l.getLogger().debug("Rule: dirList: ",t[i]),this.$=[t[i]];break;case 32:l.getLogger().debug("Rule: dirList: ",t[i-1],t[i]),this.$=[t[i-1]].concat(t[i]);break;case 33:l.getLogger().debug("Rule: nodeShapeNLabel: ",t[i-2],t[i-1],t[i]),this.$={typeStr:t[i-2]+t[i],label:t[i-1]};break;case 34:l.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[i-3],t[i-2]," #3:",t[i-1],t[i]),this.$={typeStr:t[i-3]+t[i],label:t[i-2],directions:t[i-1]};break;case 35:case 36:this.$={type:"classDef",id:t[i-1].trim(),css:t[i].trim()};break;case 37:this.$={type:"applyClass",id:t[i-1].trim(),styleClass:t[i].trim()};break;case 38:this.$={type:"applyStyles",id:t[i-1].trim(),stylesStr:t[i].trim()};break}},table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:h,29:c,31:n,32:g,40:a,44:y,47:b},{8:[1,20]},e(d,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:o,28:h,29:c,31:n,32:g,40:a,44:y,47:b}),e(x,[2,16],{14:22,15:_,16:T}),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),e(x,[2,21]),e(x,[2,22]),e(k,[2,25],{27:[1,25]}),e(x,[2,26]),{19:26,26:12,32:g},{11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:h,29:c,31:n,32:g,40:a,44:y,47:b},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(v,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(d,[2,13]),{26:35,32:g},{32:[2,14]},{17:[1,36]},e(k,[2,24]),{11:37,13:4,14:22,15:_,16:T,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:h,29:c,31:n,32:g,40:a,44:y,47:b},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(v,[2,30]),{18:[1,43]},{18:[1,44]},e(k,[2,23]),{18:[1,45]},{30:[1,46]},e(x,[2,28]),e(x,[2,35]),e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{37:[1,47]},{34:48,35:L},{15:[1,50]},e(x,[2,27]),e(v,[2,33]),{39:[1,51]},{34:52,35:L,39:[2,31]},{32:[2,15]},e(v,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:function(m,s){if(s.recoverable)this.trace(m);else{var r=new Error(m);throw r.hash=s,r}},parse:function(m){var s=this,r=[0],l=[],p=[null],t=[],u=this.table,i="",O=0,B=0,X=2,C=1,P=t.slice.call(arguments,1),E=Object.create(this.lexer),F={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(F.yy[J]=this.yy[J]);E.setInput(m,F.yy),F.yy.lexer=E,F.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var V=E.yylloc;t.push(V);var Le=E.options&&E.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Se(){var R;return R=l.pop()||E.lex()||C,typeof R!="number"&&(R instanceof Array&&(l=R,R=l.pop()),R=s.symbols_[R]||R),R}for(var N,Y,I,Z,K={},j,z,le,H;;){if(Y=r[r.length-1],this.defaultActions[Y]?I=this.defaultActions[Y]:((N===null||typeof N>"u")&&(N=Se()),I=u[Y]&&u[Y][N]),typeof I>"u"||!I.length||!I[0]){var Q="";H=[];for(j in u[Y])this.terminals_[j]&&j>X&&H.push("'"+this.terminals_[j]+"'");E.showPosition?Q="Parse error on line "+(O+1)+`:
2
2
  `+E.showPosition()+`
3
3
  Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":Q="Parse error on line "+(O+1)+": Unexpected "+(N==C?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(Q,{text:E.match,token:this.terminals_[N]||N,line:E.yylineno,loc:V,expected:H})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Y+", token: "+N);switch(I[0]){case 1:r.push(N),p.push(E.yytext),t.push(E.yylloc),r.push(I[1]),N=null,B=E.yyleng,i=E.yytext,O=E.yylineno,V=E.yylloc;break;case 2:if(z=this.productions_[I[1]][1],K.$=p[p.length-z],K._$={first_line:t[t.length-(z||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(z||1)].first_column,last_column:t[t.length-1].last_column},Le&&(K._$.range=[t[t.length-(z||1)].range[0],t[t.length-1].range[1]]),Z=this.performAction.apply(K,[i,B,O,F.yy,I[1],p,t].concat(P)),typeof Z<"u")return Z;z&&(r=r.slice(0,-1*z*2),p=p.slice(0,-1*z),t=t.slice(0,-1*z)),r.push(this.productions_[I[1]][0]),p.push(K.$),t.push(K._$),le=u[r[r.length-2]][r[r.length-1]],r.push(le);break;case 3:return!0}}return!0}},A=function(){var m={EOF:1,parseError:function(s,r){if(this.yy.parser)this.yy.parser.parseError(s,r);else throw new Error(s)},setInput:function(s,r){return this.yy=r||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var r=s.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},unput:function(s){var r=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var t=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[t[0],t[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(s){this.unput(this.match.slice(s))},pastInput:function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var s=this.pastInput(),r=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{X as wt,o as Oe,s as ke,i as Te,a as ve,P as jt,O as re,c as we,N as Re,y as kt,M as he,e as De,k as Ne,U as Ht,A as le}from"./index-BKRCw_DF.js";import{l as Pe,p as je}from"./svgDrawCommon-b86b1483-C9ebAubK-DzwEtGVK.js";var Yt=function(){var e=function(F,g,x,b){for(x=x||{},b=F.length;b--;x[F[b]]=g);return x},t=[1,24],r=[1,25],o=[1,26],l=[1,27],n=[1,28],i=[1,63],s=[1,64],a=[1,65],d=[1,66],u=[1,67],p=[1,68],f=[1,69],m=[1,29],T=[1,30],v=[1,31],P=[1,32],U=[1,33],Y=[1,34],V=[1,35],q=[1,36],H=[1,37],G=[1,38],K=[1,39],J=[1,40],Z=[1,41],tt=[1,42],et=[1,43],nt=[1,44],at=[1,45],it=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],dt=[1,54],pt=[1,55],ut=[1,56],yt=[1,57],ft=[1,58],bt=[1,59],gt=[1,60],Ct=[14,42],Ft=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Tt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],E=[1,82],A=[1,83],S=[1,84],C=[1,85],O=[12,14,42],ne=[12,14,33,42],Dt=[12,14,33,42,76,77,79,80],mt=[12,33],Xt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Wt={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:function(F,g,x,b,k,h,D){var y=h.length-1;switch(k){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[y-3]);break;case 19:b.setTitle(h[y].substring(6)),this.$=h[y].substring(6);break;case 20:b.setAccDescription(h[y].substring(15)),this.$=h[y].substring(15);break;case 21:this.$=h[y].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[y].trim(),b.setAccDescription(this.$);break;case 28:case 29:h[y].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[y]),this.$=h[y];break;case 30:b.addPersonOrSystemBoundary(...h[y]),this.$=h[y];break;case 31:h[y].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[y]),this.$=h[y];break;case 32:b.addDeploymentNode("node",...h[y]),this.$=h[y];break;case 33:b.addDeploymentNode("nodeL",...h[y]),this.$=h[y];break;case 34:b.addDeploymentNode("nodeR",...h[y]),this.$=h[y];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[y]),this.$=h[y];break;case 40:b.addPersonOrSystem("external_person",...h[y]),this.$=h[y];break;case 41:b.addPersonOrSystem("system",...h[y]),this.$=h[y];break;case 42:b.addPersonOrSystem("system_db",...h[y]),this.$=h[y];break;case 43:b.addPersonOrSystem("system_queue",...h[y]),this.$=h[y];break;case 44:b.addPersonOrSystem("external_system",...h[y]),this.$=h[y];break;case 45:b.addPersonOrSystem("external_system_db",...h[y]),this.$=h[y];break;case 46:b.addPersonOrSystem("external_system_queue",...h[y]),this.$=h[y];break;case 47:b.addContainer("container",...h[y]),this.$=h[y];break;case 48:b.addContainer("container_db",...h[y]),this.$=h[y];break;case 49:b.addContainer("container_queue",...h[y]),this.$=h[y];break;case 50:b.addContainer("external_container",...h[y]),this.$=h[y];break;case 51:b.addContainer("external_container_db",...h[y]),this.$=h[y];break;case 52:b.addContainer("external_container_queue",...h[y]),this.$=h[y];break;case 53:b.addComponent("component",...h[y]),this.$=h[y];break;case 54:b.addComponent("component_db",...h[y]),this.$=h[y];break;case 55:b.addComponent("component_queue",...h[y]),this.$=h[y];break;case 56:b.addComponent("external_component",...h[y]),this.$=h[y];break;case 57:b.addComponent("external_component_db",...h[y]),this.$=h[y];break;case 58:b.addComponent("external_component_queue",...h[y]),this.$=h[y];break;case 60:b.addRel("rel",...h[y]),this.$=h[y];break;case 61:b.addRel("birel",...h[y]),this.$=h[y];break;case 62:b.addRel("rel_u",...h[y]),this.$=h[y];break;case 63:b.addRel("rel_d",...h[y]),this.$=h[y];break;case 64:b.addRel("rel_l",...h[y]),this.$=h[y];break;case 65:b.addRel("rel_r",...h[y]),this.$=h[y];break;case 66:b.addRel("rel_b",...h[y]),this.$=h[y];break;case 67:h[y].splice(0,1),b.addRel("rel",...h[y]),this.$=h[y];break;case 68:b.updateElStyle("update_el_style",...h[y]),this.$=h[y];break;case 69:b.updateRelStyle("update_rel_style",...h[y]),this.$=h[y];break;case 70:b.updateLayoutConfig("update_layout_config",...h[y]),this.$=h[y];break;case 71:this.$=[h[y]];break;case 72:h[y].unshift(h[y-1]),this.$=h[y];break;case 73:case 75:this.$=h[y].trim();break;case 74:let Et={};Et[h[y-1].trim()]=h[y].trim(),this.$=Et;break;case 76:this.$="";break}},table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{13:70,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{13:71,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{13:72,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{13:73,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:i,36:s,37:a,38:d,39:u,40:p,41:f,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt}),e(Ct,[2,14]),e(Ft,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Tt,[2,19]),e(Tt,[2,20]),{25:[1,78]},{27:[1,79]},e(Tt,[2,23]),{35:80,75:81,76:E,77:A,79:S,80:C},{35:86,75:81,76:E,77:A,79:S,80:C},{35:87,75:81,76:E,77:A,79:S,80:C},{35:88,75:81,76:E,77:A,79:S,80:C},{35:89,75:81,76:E,77:A,79:S,80:C},{35:90,75:81,76:E,77:A,79:S,80:C},{35:91,75:81,76:E,77:A,79:S,80:C},{35:92,75:81,76:E,77:A,79:S,80:C},{35:93,75:81,76:E,77:A,79:S,80:C},{35:94,75:81,76:E,77:A,79:S,80:C},{35:95,75:81,76:E,77:A,79:S,80:C},{35:96,75:81,76:E,77:A,79:S,80:C},{35:97,75:81,76:E,77:A,79:S,80:C},{35:98,75:81,76:E,77:A,79:S,80:C},{35:99,75:81,76:E,77:A,79:S,80:C},{35:100,75:81,76:E,77:A,79:S,80:C},{35:101,75:81,76:E,77:A,79:S,80:C},{35:102,75:81,76:E,77:A,79:S,80:C},{35:103,75:81,76:E,77:A,79:S,80:C},{35:104,75:81,76:E,77:A,79:S,80:C},e(O,[2,59]),{35:105,75:81,76:E,77:A,79:S,80:C},{35:106,75:81,76:E,77:A,79:S,80:C},{35:107,75:81,76:E,77:A,79:S,80:C},{35:108,75:81,76:E,77:A,79:S,80:C},{35:109,75:81,76:E,77:A,79:S,80:C},{35:110,75:81,76:E,77:A,79:S,80:C},{35:111,75:81,76:E,77:A,79:S,80:C},{35:112,75:81,76:E,77:A,79:S,80:C},{35:113,75:81,76:E,77:A,79:S,80:C},{35:114,75:81,76:E,77:A,79:S,80:C},{35:115,75:81,76:E,77:A,79:S,80:C},{20:116,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{12:[1,118],33:[1,117]},{35:119,75:81,76:E,77:A,79:S,80:C},{35:120,75:81,76:E,77:A,79:S,80:C},{35:121,75:81,76:E,77:A,79:S,80:C},{35:122,75:81,76:E,77:A,79:S,80:C},{35:123,75:81,76:E,77:A,79:S,80:C},{35:124,75:81,76:E,77:A,79:S,80:C},{35:125,75:81,76:E,77:A,79:S,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Ft,[2,17],{21:22,19:130,22:t,23:r,24:o,26:l,28:n}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:r,24:o,26:l,28:n,34:i,36:s,37:a,38:d,39:u,40:p,41:f,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt}),e(Tt,[2,21]),e(Tt,[2,22]),e(O,[2,39]),e(ne,[2,71],{75:81,35:132,76:E,77:A,79:S,80:C}),e(Dt,[2,73]),{78:[1,133]},e(Dt,[2,75]),e(Dt,[2,76]),e(O,[2,40]),e(O,[2,41]),e(O,[2,42]),e(O,[2,43]),e(O,[2,44]),e(O,[2,45]),e(O,[2,46]),e(O,[2,47]),e(O,[2,48]),e(O,[2,49]),e(O,[2,50]),e(O,[2,51]),e(O,[2,52]),e(O,[2,53]),e(O,[2,54]),e(O,[2,55]),e(O,[2,56]),e(O,[2,57]),e(O,[2,58]),e(O,[2,60]),e(O,[2,61]),e(O,[2,62]),e(O,[2,63]),e(O,[2,64]),e(O,[2,65]),e(O,[2,66]),e(O,[2,67]),e(O,[2,68]),e(O,[2,69]),e(O,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(mt,[2,28]),e(mt,[2,29]),e(mt,[2,30]),e(mt,[2,31]),e(mt,[2,32]),e(mt,[2,33]),e(mt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Ft,[2,18]),e(Ct,[2,38]),e(ne,[2,72]),e(Dt,[2,74]),e(O,[2,24]),e(O,[2,35]),e(Xt,[2,25]),e(Xt,[2,26],{12:[1,138]}),e(Xt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:function(F,g){if(g.recoverable)this.trace(F);else{var x=new Error(F);throw x.hash=g,x}},parse:function(F){var g=this,x=[0],b=[],k=[null],h=[],D=this.table,y="",Et=0,ae=0,Ee=2,ie=1,Ae=h.slice.call(arguments,1),w=Object.create(this.lexer),At={yy:{}};for(var Qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Qt)&&(At.yy[Qt]=this.yy[Qt]);w.setInput(F,At.yy),At.yy.lexer=w,At.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var $t=w.yylloc;h.push($t);var Se=w.options&&w.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(){var Q;return Q=b.pop()||w.lex()||ie,typeof Q!="number"&&(Q instanceof Array&&(b=Q,Q=b.pop()),Q=g.symbols_[Q]||Q),Q}for(var N,St,j,Vt,Ot={},Nt,z,se,Pt;;){if(St=x[x.length-1],this.defaultActions[St]?j=this.defaultActions[St]:((N===null||typeof N>"u")&&(N=Ce()),j=D[St]&&D[St][N]),typeof j>"u"||!j.length||!j[0]){var qt="";Pt=[];for(Nt in D[St])this.terminals_[Nt]&&Nt>Ee&&Pt.push("'"+this.terminals_[Nt]+"'");w.showPosition?qt="Parse error on line "+(Et+1)+`:
1
+ import{X as wt,o as Oe,s as ke,i as Te,a as ve,P as jt,O as re,c as we,N as Re,y as kt,M as he,e as De,k as Ne,U as Ht,A as le}from"./index-DzCUtfv9.js";import{l as Pe,p as je}from"./svgDrawCommon-b86b1483-C9ebAubK-DYzWlNRg.js";var Yt=function(){var e=function(F,g,x,b){for(x=x||{},b=F.length;b--;x[F[b]]=g);return x},t=[1,24],r=[1,25],o=[1,26],l=[1,27],n=[1,28],i=[1,63],s=[1,64],a=[1,65],d=[1,66],u=[1,67],p=[1,68],f=[1,69],m=[1,29],T=[1,30],v=[1,31],P=[1,32],U=[1,33],Y=[1,34],V=[1,35],q=[1,36],H=[1,37],G=[1,38],K=[1,39],J=[1,40],Z=[1,41],tt=[1,42],et=[1,43],nt=[1,44],at=[1,45],it=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],dt=[1,54],pt=[1,55],ut=[1,56],yt=[1,57],ft=[1,58],bt=[1,59],gt=[1,60],Ct=[14,42],Ft=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Tt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],E=[1,82],A=[1,83],S=[1,84],C=[1,85],O=[12,14,42],ne=[12,14,33,42],Dt=[12,14,33,42,76,77,79,80],mt=[12,33],Xt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Wt={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:function(F,g,x,b,k,h,D){var y=h.length-1;switch(k){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[y-3]);break;case 19:b.setTitle(h[y].substring(6)),this.$=h[y].substring(6);break;case 20:b.setAccDescription(h[y].substring(15)),this.$=h[y].substring(15);break;case 21:this.$=h[y].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[y].trim(),b.setAccDescription(this.$);break;case 28:case 29:h[y].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[y]),this.$=h[y];break;case 30:b.addPersonOrSystemBoundary(...h[y]),this.$=h[y];break;case 31:h[y].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[y]),this.$=h[y];break;case 32:b.addDeploymentNode("node",...h[y]),this.$=h[y];break;case 33:b.addDeploymentNode("nodeL",...h[y]),this.$=h[y];break;case 34:b.addDeploymentNode("nodeR",...h[y]),this.$=h[y];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[y]),this.$=h[y];break;case 40:b.addPersonOrSystem("external_person",...h[y]),this.$=h[y];break;case 41:b.addPersonOrSystem("system",...h[y]),this.$=h[y];break;case 42:b.addPersonOrSystem("system_db",...h[y]),this.$=h[y];break;case 43:b.addPersonOrSystem("system_queue",...h[y]),this.$=h[y];break;case 44:b.addPersonOrSystem("external_system",...h[y]),this.$=h[y];break;case 45:b.addPersonOrSystem("external_system_db",...h[y]),this.$=h[y];break;case 46:b.addPersonOrSystem("external_system_queue",...h[y]),this.$=h[y];break;case 47:b.addContainer("container",...h[y]),this.$=h[y];break;case 48:b.addContainer("container_db",...h[y]),this.$=h[y];break;case 49:b.addContainer("container_queue",...h[y]),this.$=h[y];break;case 50:b.addContainer("external_container",...h[y]),this.$=h[y];break;case 51:b.addContainer("external_container_db",...h[y]),this.$=h[y];break;case 52:b.addContainer("external_container_queue",...h[y]),this.$=h[y];break;case 53:b.addComponent("component",...h[y]),this.$=h[y];break;case 54:b.addComponent("component_db",...h[y]),this.$=h[y];break;case 55:b.addComponent("component_queue",...h[y]),this.$=h[y];break;case 56:b.addComponent("external_component",...h[y]),this.$=h[y];break;case 57:b.addComponent("external_component_db",...h[y]),this.$=h[y];break;case 58:b.addComponent("external_component_queue",...h[y]),this.$=h[y];break;case 60:b.addRel("rel",...h[y]),this.$=h[y];break;case 61:b.addRel("birel",...h[y]),this.$=h[y];break;case 62:b.addRel("rel_u",...h[y]),this.$=h[y];break;case 63:b.addRel("rel_d",...h[y]),this.$=h[y];break;case 64:b.addRel("rel_l",...h[y]),this.$=h[y];break;case 65:b.addRel("rel_r",...h[y]),this.$=h[y];break;case 66:b.addRel("rel_b",...h[y]),this.$=h[y];break;case 67:h[y].splice(0,1),b.addRel("rel",...h[y]),this.$=h[y];break;case 68:b.updateElStyle("update_el_style",...h[y]),this.$=h[y];break;case 69:b.updateRelStyle("update_rel_style",...h[y]),this.$=h[y];break;case 70:b.updateLayoutConfig("update_layout_config",...h[y]),this.$=h[y];break;case 71:this.$=[h[y]];break;case 72:h[y].unshift(h[y-1]),this.$=h[y];break;case 73:case 75:this.$=h[y].trim();break;case 74:let Et={};Et[h[y-1].trim()]=h[y].trim(),this.$=Et;break;case 76:this.$="";break}},table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{13:70,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{13:71,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{13:72,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{13:73,19:20,20:21,21:22,22:t,23:r,24:o,26:l,28:n,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:i,36:s,37:a,38:d,39:u,40:p,41:f,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt}),e(Ct,[2,14]),e(Ft,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Tt,[2,19]),e(Tt,[2,20]),{25:[1,78]},{27:[1,79]},e(Tt,[2,23]),{35:80,75:81,76:E,77:A,79:S,80:C},{35:86,75:81,76:E,77:A,79:S,80:C},{35:87,75:81,76:E,77:A,79:S,80:C},{35:88,75:81,76:E,77:A,79:S,80:C},{35:89,75:81,76:E,77:A,79:S,80:C},{35:90,75:81,76:E,77:A,79:S,80:C},{35:91,75:81,76:E,77:A,79:S,80:C},{35:92,75:81,76:E,77:A,79:S,80:C},{35:93,75:81,76:E,77:A,79:S,80:C},{35:94,75:81,76:E,77:A,79:S,80:C},{35:95,75:81,76:E,77:A,79:S,80:C},{35:96,75:81,76:E,77:A,79:S,80:C},{35:97,75:81,76:E,77:A,79:S,80:C},{35:98,75:81,76:E,77:A,79:S,80:C},{35:99,75:81,76:E,77:A,79:S,80:C},{35:100,75:81,76:E,77:A,79:S,80:C},{35:101,75:81,76:E,77:A,79:S,80:C},{35:102,75:81,76:E,77:A,79:S,80:C},{35:103,75:81,76:E,77:A,79:S,80:C},{35:104,75:81,76:E,77:A,79:S,80:C},e(O,[2,59]),{35:105,75:81,76:E,77:A,79:S,80:C},{35:106,75:81,76:E,77:A,79:S,80:C},{35:107,75:81,76:E,77:A,79:S,80:C},{35:108,75:81,76:E,77:A,79:S,80:C},{35:109,75:81,76:E,77:A,79:S,80:C},{35:110,75:81,76:E,77:A,79:S,80:C},{35:111,75:81,76:E,77:A,79:S,80:C},{35:112,75:81,76:E,77:A,79:S,80:C},{35:113,75:81,76:E,77:A,79:S,80:C},{35:114,75:81,76:E,77:A,79:S,80:C},{35:115,75:81,76:E,77:A,79:S,80:C},{20:116,29:49,30:61,32:62,34:i,36:s,37:a,38:d,39:u,40:p,41:f,43:23,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt},{12:[1,118],33:[1,117]},{35:119,75:81,76:E,77:A,79:S,80:C},{35:120,75:81,76:E,77:A,79:S,80:C},{35:121,75:81,76:E,77:A,79:S,80:C},{35:122,75:81,76:E,77:A,79:S,80:C},{35:123,75:81,76:E,77:A,79:S,80:C},{35:124,75:81,76:E,77:A,79:S,80:C},{35:125,75:81,76:E,77:A,79:S,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Ft,[2,17],{21:22,19:130,22:t,23:r,24:o,26:l,28:n}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:r,24:o,26:l,28:n,34:i,36:s,37:a,38:d,39:u,40:p,41:f,44:m,45:T,46:v,47:P,48:U,49:Y,50:V,51:q,52:H,53:G,54:K,55:J,56:Z,57:tt,58:et,59:nt,60:at,61:it,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:dt,69:pt,70:ut,71:yt,72:ft,73:bt,74:gt}),e(Tt,[2,21]),e(Tt,[2,22]),e(O,[2,39]),e(ne,[2,71],{75:81,35:132,76:E,77:A,79:S,80:C}),e(Dt,[2,73]),{78:[1,133]},e(Dt,[2,75]),e(Dt,[2,76]),e(O,[2,40]),e(O,[2,41]),e(O,[2,42]),e(O,[2,43]),e(O,[2,44]),e(O,[2,45]),e(O,[2,46]),e(O,[2,47]),e(O,[2,48]),e(O,[2,49]),e(O,[2,50]),e(O,[2,51]),e(O,[2,52]),e(O,[2,53]),e(O,[2,54]),e(O,[2,55]),e(O,[2,56]),e(O,[2,57]),e(O,[2,58]),e(O,[2,60]),e(O,[2,61]),e(O,[2,62]),e(O,[2,63]),e(O,[2,64]),e(O,[2,65]),e(O,[2,66]),e(O,[2,67]),e(O,[2,68]),e(O,[2,69]),e(O,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(mt,[2,28]),e(mt,[2,29]),e(mt,[2,30]),e(mt,[2,31]),e(mt,[2,32]),e(mt,[2,33]),e(mt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Ft,[2,18]),e(Ct,[2,38]),e(ne,[2,72]),e(Dt,[2,74]),e(O,[2,24]),e(O,[2,35]),e(Xt,[2,25]),e(Xt,[2,26],{12:[1,138]}),e(Xt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:function(F,g){if(g.recoverable)this.trace(F);else{var x=new Error(F);throw x.hash=g,x}},parse:function(F){var g=this,x=[0],b=[],k=[null],h=[],D=this.table,y="",Et=0,ae=0,Ee=2,ie=1,Ae=h.slice.call(arguments,1),w=Object.create(this.lexer),At={yy:{}};for(var Qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Qt)&&(At.yy[Qt]=this.yy[Qt]);w.setInput(F,At.yy),At.yy.lexer=w,At.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var $t=w.yylloc;h.push($t);var Se=w.options&&w.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(){var Q;return Q=b.pop()||w.lex()||ie,typeof Q!="number"&&(Q instanceof Array&&(b=Q,Q=b.pop()),Q=g.symbols_[Q]||Q),Q}for(var N,St,j,Vt,Ot={},Nt,z,se,Pt;;){if(St=x[x.length-1],this.defaultActions[St]?j=this.defaultActions[St]:((N===null||typeof N>"u")&&(N=Ce()),j=D[St]&&D[St][N]),typeof j>"u"||!j.length||!j[0]){var qt="";Pt=[];for(Nt in D[St])this.terminals_[Nt]&&Nt>Ee&&Pt.push("'"+this.terminals_[Nt]+"'");w.showPosition?qt="Parse error on line "+(Et+1)+`:
2
2
  `+w.showPosition()+`
3
3
  Expecting `+Pt.join(", ")+", got '"+(this.terminals_[N]||N)+"'":qt="Parse error on line "+(Et+1)+": Unexpected "+(N==ie?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(qt,{text:w.match,token:this.terminals_[N]||N,line:w.yylineno,loc:$t,expected:Pt})}if(j[0]instanceof Array&&j.length>1)throw new Error("Parse Error: multiple actions possible at state: "+St+", token: "+N);switch(j[0]){case 1:x.push(N),k.push(w.yytext),h.push(w.yylloc),x.push(j[1]),N=null,ae=w.yyleng,y=w.yytext,Et=w.yylineno,$t=w.yylloc;break;case 2:if(z=this.productions_[j[1]][1],Ot.$=k[k.length-z],Ot._$={first_line:h[h.length-(z||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(z||1)].first_column,last_column:h[h.length-1].last_column},Se&&(Ot._$.range=[h[h.length-(z||1)].range[0],h[h.length-1].range[1]]),Vt=this.performAction.apply(Ot,[y,ae,Et,At.yy,j[1],k,h].concat(Ae)),typeof Vt<"u")return Vt;z&&(x=x.slice(0,-1*z*2),k=k.slice(0,-1*z),h=h.slice(0,-1*z)),x.push(this.productions_[j[1]][0]),k.push(Ot.$),h.push(Ot._$),se=D[x[x.length-2]][x[x.length-1]],x.push(se);break;case 3:return!0}}return!0}},me=function(){var F={EOF:1,parseError:function(g,x){if(this.yy.parser)this.yy.parser.parseError(g,x);else throw new Error(g)},setInput:function(g,x){return this.yy=x||this.yy||{},this._input=g,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var x=g.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},unput:function(g){var x=g.length,b=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===k.length?this.yylloc.first_column:0)+k[k.length-b.length].length-b[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(g){this.unput(this.match.slice(g))},pastInput:function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var g=this.pastInput(),x=new Array(g.length+1).join("-");return g+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{b0 as t,b1 as a}from"./index-DzCUtfv9.js";const n=(o,r)=>t.lang.round(a.parse(o)[r]);export{n as t};
@@ -1,2 +1,2 @@
1
- import{Y,K as M,z as C}from"./styles-b4e223ce-CPkoRhK8-B88f_9TS.js";import{X as H,O as f,P as B,c as X,b as D,p as J,r as T,q as P}from"./index-BKRCw_DF.js";import{K as R}from"./graph-Bc6U-Oet-BbypjADy.js";import{A as W}from"./layout-BtHnec7v-DPk8SWBY.js";let O=0;const Z=function(n,a,t,s,l){const c=function(i){switch(i){case l.db.relationType.AGGREGATION:return"aggregation";case l.db.relationType.EXTENSION:return"extension";case l.db.relationType.COMPOSITION:return"composition";case l.db.relationType.DEPENDENCY:return"dependency";case l.db.relationType.LOLLIPOP:return"lollipop"}};a.points=a.points.filter(i=>!Number.isNaN(i.y));const o=a.points,g=D().x(function(i){return i.x}).y(function(i){return i.y}).curve(J),d=n.append("path").attr("d",g(o)).attr("id","edge"+O).attr("class","relation");let r="";s.arrowMarkerAbsolute&&(r=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,r=r.replace(/\(/g,"\\("),r=r.replace(/\)/g,"\\)")),t.relation.lineType==1&&d.attr("class","relation dashed-line"),t.relation.lineType==10&&d.attr("class","relation dotted-line"),t.relation.type1!=="none"&&d.attr("marker-start","url("+r+"#"+c(t.relation.type1)+"Start)"),t.relation.type2!=="none"&&d.attr("marker-end","url("+r+"#"+c(t.relation.type2)+"End)");let y,p;const x=a.points.length;let m=T.calcLabelPosition(a.points);y=m.x,p=m.y;let b,w,e,h;if(x%2!==0&&x>1){let i=T.calcCardinalityPosition(t.relation.type1!=="none",a.points,a.points[0]),u=T.calcCardinalityPosition(t.relation.type2!=="none",a.points,a.points[x-1]);f.debug("cardinality_1_point "+JSON.stringify(i)),f.debug("cardinality_2_point "+JSON.stringify(u)),b=i.x,w=i.y,e=u.x,h=u.y}if(t.title!==void 0){const i=n.append("g").attr("class","classLabel"),u=i.append("text").attr("class","label").attr("x",y).attr("y",p).attr("fill","red").attr("text-anchor","middle").text(t.title);window.label=u;const E=u.node().getBBox();i.insert("rect",":first-child").attr("class","box").attr("x",E.x-s.padding/2).attr("y",E.y-s.padding/2).attr("width",E.width+s.padding).attr("height",E.height+s.padding)}f.info("Rendering relation "+JSON.stringify(t)),t.relationTitle1!==void 0&&t.relationTitle1!=="none"&&n.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",b).attr("y",w).attr("fill","black").attr("font-size","6").text(t.relationTitle1),t.relationTitle2!==void 0&&t.relationTitle2!=="none"&&n.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",e).attr("y",h).attr("fill","black").attr("font-size","6").text(t.relationTitle2),O++},$=function(n,a,t,s){f.debug("Rendering class ",a,t);const l=a.id,c={id:l,label:a.id,width:0,height:0},o=n.append("g").attr("id",s.db.lookUpDomId(l)).attr("class","classGroup");let g;a.link?g=o.append("svg:a").attr("xlink:href",a.link).attr("target",a.linkTarget).append("text").attr("y",t.textHeight+t.padding).attr("x",0):g=o.append("text").attr("y",t.textHeight+t.padding).attr("x",0);let d=!0;a.annotations.forEach(function(i){const u=g.append("tspan").text("«"+i+"»");d||u.attr("dy",t.textHeight),d=!1});let r=A(a);const y=g.append("tspan").text(r).attr("class","title");d||y.attr("dy",t.textHeight);const p=g.node().getBBox().height;let x,m,b;if(a.members.length>0){x=o.append("line").attr("x1",0).attr("y1",t.padding+p+t.dividerMargin/2).attr("y2",t.padding+p+t.dividerMargin/2);const i=o.append("text").attr("x",t.padding).attr("y",p+t.dividerMargin+t.textHeight).attr("fill","white").attr("class","classText");d=!0,a.members.forEach(function(u){S(i,u,d,t),d=!1}),m=i.node().getBBox()}if(a.methods.length>0){b=o.append("line").attr("x1",0).attr("y1",t.padding+p+t.dividerMargin+m.height).attr("y2",t.padding+p+t.dividerMargin+m.height);const i=o.append("text").attr("x",t.padding).attr("y",p+2*t.dividerMargin+m.height+t.textHeight).attr("fill","white").attr("class","classText");d=!0,a.methods.forEach(function(u){S(i,u,d,t),d=!1})}const w=o.node().getBBox();var e=" ";a.cssClasses.length>0&&(e=e+a.cssClasses.join(" "));const h=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",w.width+2*t.padding).attr("height",w.height+t.padding+.5*t.dividerMargin).attr("class",e).node().getBBox().width;return g.node().childNodes.forEach(function(i){i.setAttribute("x",(h-i.getBBox().width)/2)}),a.tooltip&&g.insert("title").text(a.tooltip),x&&x.attr("x2",h),b&&b.attr("x2",h),c.width=h,c.height=w.height+t.padding+.5*t.dividerMargin,c},A=function(n){let a=n.id;return n.type&&(a+="<"+P(n.type)+">"),a},G=function(n,a,t,s){f.debug("Rendering note ",a,t);const l=a.id,c={id:l,text:a.text,width:0,height:0},o=n.append("g").attr("id",l).attr("class","classGroup");let g=o.append("text").attr("y",t.textHeight+t.padding).attr("x",0);const d=JSON.parse(`"${a.text}"`).split(`
1
+ import{Y,K as M,z as C}from"./styles-b4e223ce-CPkoRhK8-rLSbmLeN.js";import{X as H,O as f,P as B,c as X,b as D,p as J,r as T,q as P}from"./index-DzCUtfv9.js";import{K as R}from"./graph-Bc6U-Oet-CBlVz78v.js";import{A as W}from"./layout-BtHnec7v-LE2NCFha.js";let O=0;const Z=function(n,a,t,s,l){const c=function(i){switch(i){case l.db.relationType.AGGREGATION:return"aggregation";case l.db.relationType.EXTENSION:return"extension";case l.db.relationType.COMPOSITION:return"composition";case l.db.relationType.DEPENDENCY:return"dependency";case l.db.relationType.LOLLIPOP:return"lollipop"}};a.points=a.points.filter(i=>!Number.isNaN(i.y));const o=a.points,g=D().x(function(i){return i.x}).y(function(i){return i.y}).curve(J),d=n.append("path").attr("d",g(o)).attr("id","edge"+O).attr("class","relation");let r="";s.arrowMarkerAbsolute&&(r=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,r=r.replace(/\(/g,"\\("),r=r.replace(/\)/g,"\\)")),t.relation.lineType==1&&d.attr("class","relation dashed-line"),t.relation.lineType==10&&d.attr("class","relation dotted-line"),t.relation.type1!=="none"&&d.attr("marker-start","url("+r+"#"+c(t.relation.type1)+"Start)"),t.relation.type2!=="none"&&d.attr("marker-end","url("+r+"#"+c(t.relation.type2)+"End)");let y,p;const x=a.points.length;let m=T.calcLabelPosition(a.points);y=m.x,p=m.y;let b,w,e,h;if(x%2!==0&&x>1){let i=T.calcCardinalityPosition(t.relation.type1!=="none",a.points,a.points[0]),u=T.calcCardinalityPosition(t.relation.type2!=="none",a.points,a.points[x-1]);f.debug("cardinality_1_point "+JSON.stringify(i)),f.debug("cardinality_2_point "+JSON.stringify(u)),b=i.x,w=i.y,e=u.x,h=u.y}if(t.title!==void 0){const i=n.append("g").attr("class","classLabel"),u=i.append("text").attr("class","label").attr("x",y).attr("y",p).attr("fill","red").attr("text-anchor","middle").text(t.title);window.label=u;const E=u.node().getBBox();i.insert("rect",":first-child").attr("class","box").attr("x",E.x-s.padding/2).attr("y",E.y-s.padding/2).attr("width",E.width+s.padding).attr("height",E.height+s.padding)}f.info("Rendering relation "+JSON.stringify(t)),t.relationTitle1!==void 0&&t.relationTitle1!=="none"&&n.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",b).attr("y",w).attr("fill","black").attr("font-size","6").text(t.relationTitle1),t.relationTitle2!==void 0&&t.relationTitle2!=="none"&&n.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",e).attr("y",h).attr("fill","black").attr("font-size","6").text(t.relationTitle2),O++},$=function(n,a,t,s){f.debug("Rendering class ",a,t);const l=a.id,c={id:l,label:a.id,width:0,height:0},o=n.append("g").attr("id",s.db.lookUpDomId(l)).attr("class","classGroup");let g;a.link?g=o.append("svg:a").attr("xlink:href",a.link).attr("target",a.linkTarget).append("text").attr("y",t.textHeight+t.padding).attr("x",0):g=o.append("text").attr("y",t.textHeight+t.padding).attr("x",0);let d=!0;a.annotations.forEach(function(i){const u=g.append("tspan").text("«"+i+"»");d||u.attr("dy",t.textHeight),d=!1});let r=A(a);const y=g.append("tspan").text(r).attr("class","title");d||y.attr("dy",t.textHeight);const p=g.node().getBBox().height;let x,m,b;if(a.members.length>0){x=o.append("line").attr("x1",0).attr("y1",t.padding+p+t.dividerMargin/2).attr("y2",t.padding+p+t.dividerMargin/2);const i=o.append("text").attr("x",t.padding).attr("y",p+t.dividerMargin+t.textHeight).attr("fill","white").attr("class","classText");d=!0,a.members.forEach(function(u){S(i,u,d,t),d=!1}),m=i.node().getBBox()}if(a.methods.length>0){b=o.append("line").attr("x1",0).attr("y1",t.padding+p+t.dividerMargin+m.height).attr("y2",t.padding+p+t.dividerMargin+m.height);const i=o.append("text").attr("x",t.padding).attr("y",p+2*t.dividerMargin+m.height+t.textHeight).attr("fill","white").attr("class","classText");d=!0,a.methods.forEach(function(u){S(i,u,d,t),d=!1})}const w=o.node().getBBox();var e=" ";a.cssClasses.length>0&&(e=e+a.cssClasses.join(" "));const h=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",w.width+2*t.padding).attr("height",w.height+t.padding+.5*t.dividerMargin).attr("class",e).node().getBBox().width;return g.node().childNodes.forEach(function(i){i.setAttribute("x",(h-i.getBBox().width)/2)}),a.tooltip&&g.insert("title").text(a.tooltip),x&&x.attr("x2",h),b&&b.attr("x2",h),c.width=h,c.height=w.height+t.padding+.5*t.dividerMargin,c},A=function(n){let a=n.id;return n.type&&(a+="<"+P(n.type)+">"),a},G=function(n,a,t,s){f.debug("Rendering note ",a,t);const l=a.id,c={id:l,text:a.text,width:0,height:0},o=n.append("g").attr("id",l).attr("class","classGroup");let g=o.append("text").attr("y",t.textHeight+t.padding).attr("x",0);const d=JSON.parse(`"${a.text}"`).split(`
2
2
  `);d.forEach(function(p){f.debug(`Adding line: ${p}`),g.append("tspan").text(p).attr("class","title").attr("dy",t.textHeight)});const r=o.node().getBBox(),y=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",r.width+2*t.padding).attr("height",r.height+d.length*t.textHeight+t.padding+.5*t.dividerMargin).node().getBBox().width;return g.node().childNodes.forEach(function(p){p.setAttribute("x",(y-p.getBBox().width)/2)}),c.width=y,c.height=r.height+d.length*t.textHeight+t.padding+.5*t.dividerMargin,c},S=function(n,a,t,s){const{displayText:l,cssStyle:c}=a.getDisplayDetails(),o=n.append("tspan").attr("x",s.padding).text(l);c!==""&&o.attr("style",a.cssStyle),t||o.attr("dy",s.textHeight)},v={getClassTitleString:A,drawClass:$,drawEdge:Z,drawNote:G};let N={};const L=20,k=function(n){const a=Object.entries(N).find(t=>t[1].label===n);if(a)return a[0]},I=function(n){n.append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),n.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),n.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),n.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},z=function(n,a,t,s){const l=H().class;N={},f.info("Rendering diagram "+n);const c=H().securityLevel;let o;c==="sandbox"&&(o=B("#i"+a));const g=c==="sandbox"?B(o.nodes()[0].contentDocument.body):B("body"),d=g.select(`[id='${a}']`);I(d);const r=new R({multigraph:!0});r.setGraph({isMultiGraph:!0}),r.setDefaultEdgeLabel(function(){return{}});const y=s.db.getClasses(),p=Object.keys(y);for(const e of p){const h=y[e],i=v.drawClass(d,h,l,s);N[i.id]=i,r.setNode(i.id,i),f.info("Org height: "+i.height)}s.db.getRelations().forEach(function(e){f.info("tjoho"+k(e.id1)+k(e.id2)+JSON.stringify(e)),r.setEdge(k(e.id1),k(e.id2),{relation:e},e.title||"DEFAULT")}),s.db.getNotes().forEach(function(e){f.debug(`Adding note: ${JSON.stringify(e)}`);const h=v.drawNote(d,e,l,s);N[h.id]=h,r.setNode(h.id,h),e.class&&e.class in y&&r.setEdge(e.id,k(e.class),{relation:{id1:e.id,id2:e.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")}),W(r),r.nodes().forEach(function(e){e!==void 0&&r.node(e)!==void 0&&(f.debug("Node "+e+": "+JSON.stringify(r.node(e))),g.select("#"+(s.db.lookUpDomId(e)||e)).attr("transform","translate("+(r.node(e).x-r.node(e).width/2)+","+(r.node(e).y-r.node(e).height/2)+" )"))}),r.edges().forEach(function(e){e!==void 0&&r.edge(e)!==void 0&&(f.debug("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(r.edge(e))),v.drawEdge(d,r.edge(e),r.edge(e).relation,l,s))});const x=d.node().getBBox(),m=x.width+L*2,b=x.height+L*2;X(d,b,m,l.useMaxWidth);const w=`${x.x-L} ${x.y-L} ${m} ${b}`;f.debug(`viewBox ${w}`),d.attr("viewBox",w)},U={draw:z},V={parser:C,db:M,renderer:U,styles:Y,init:n=>{n.class||(n.class={}),n.class.arrowMarkerAbsolute=n.arrowMarkerAbsolute,M.clear()}};export{V as diagram};
@@ -1,2 +1,2 @@
1
- import{Y as M,K as L,z as P}from"./styles-b4e223ce-CPkoRhK8-B88f_9TS.js";import{O as c,X as d,P as w,r as _,Q as B,U as E,v as D,h as A,j as C}from"./index-BKRCw_DF.js";import{K}from"./graph-Bc6U-Oet-BbypjADy.js";import{b as O}from"./index-5325376f-DCLsNwAa-BxOfAZRl.js";import"./layout-BtHnec7v-DPk8SWBY.js";import"./clone-vCPXKFeo-DdQ4WIiO.js";import"./edges-96097737-XAH6P1yX-hj5ay2ub.js";import"./createText-1719965b-Cbn6MBZp-zrb_KsAx.js";const k=a=>E.sanitizeText(a,d());let x={dividerMargin:10,padding:5,textHeight:10,curve:void 0};const R=function(a,t,b,i){const e=Object.keys(a);c.info("keys:",e),c.info(a),e.forEach(function(s){var l,r;const o=a[s],n={shape:"rect",id:o.id,domId:o.domId,labelText:k(o.id),labelStyle:"",style:"fill: none; stroke: black",padding:((l=d().flowchart)==null?void 0:l.padding)??((r=d().class)==null?void 0:r.padding)};t.setNode(o.id,n),I(o.classes,t,b,i,o.id),c.info("setNode",n)})},I=function(a,t,b,i,e){const s=Object.keys(a);c.info("keys:",s),c.info(a),s.filter(l=>a[l].parent==e).forEach(function(l){var r,o;const n=a[l],g=n.cssClasses.join(" "),y=D(n.styles),u=n.label??n.id,p=0,f={labelStyle:y.labelStyle,shape:"class_box",labelText:k(u),classData:n,rx:p,ry:p,class:g,style:y.style,id:n.id,domId:n.domId,tooltip:i.db.getTooltip(n.id,e)||"",haveCallback:n.haveCallback,link:n.link,width:n.type==="group"?500:void 0,type:n.type,padding:((r=d().flowchart)==null?void 0:r.padding)??((o=d().class)==null?void 0:o.padding)};t.setNode(n.id,f),e&&t.setParent(n.id,e),c.info("setNode",f)})},z=function(a,t,b,i){c.info(a),a.forEach(function(e,s){var l,r;const o=e,n="",g={labelStyle:"",style:""},y=o.text,u=0,p={labelStyle:g.labelStyle,shape:"note",labelText:k(y),noteData:o,rx:u,ry:u,class:n,style:g.style,id:o.id,domId:o.id,tooltip:"",type:"note",padding:((l=d().flowchart)==null?void 0:l.padding)??((r=d().class)==null?void 0:r.padding)};if(t.setNode(o.id,p),c.info("setNode",p),!o.class||!(o.class in i))return;const f=b+s,m={id:`edgeNote${f}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:A(x.curve,C)};t.setEdge(o.id,o.class,m,f)})},H=function(a,t){const b=d().flowchart;let i=0;a.forEach(function(e){var s;i++;const l={classes:"relation",pattern:e.relation.lineType==1?"dashed":"solid",id:`id_${e.id1}_${e.id2}_${i}`,arrowhead:e.type==="arrow_open"?"none":"normal",startLabelRight:e.relationTitle1==="none"?"":e.relationTitle1,endLabelLeft:e.relationTitle2==="none"?"":e.relationTitle2,arrowTypeStart:N(e.relation.type1),arrowTypeEnd:N(e.relation.type2),style:"fill:none",labelStyle:"",curve:A(b==null?void 0:b.curve,C)};if(c.info(l,e),e.style!==void 0){const r=D(e.style);l.style=r.style,l.labelStyle=r.labelStyle}e.text=e.title,e.text===void 0?e.style!==void 0&&(l.arrowheadStyle="fill: #333"):(l.arrowheadStyle="fill: #333",l.labelpos="c",((s=d().flowchart)==null?void 0:s.htmlLabels)??d().htmlLabels?(l.labelType="html",l.label='<span class="edgeLabel">'+e.text+"</span>"):(l.labelType="text",l.label=e.text.replace(E.lineBreakRegex,`
1
+ import{Y as M,K as L,z as P}from"./styles-b4e223ce-CPkoRhK8-rLSbmLeN.js";import{O as c,X as d,P as w,r as _,Q as B,U as E,v as D,h as A,j as C}from"./index-DzCUtfv9.js";import{K}from"./graph-Bc6U-Oet-CBlVz78v.js";import{b as O}from"./index-5325376f-DCLsNwAa-HT7P8_2b.js";import"./layout-BtHnec7v-LE2NCFha.js";import"./clone-vCPXKFeo-hZBJf3C4.js";import"./edges-96097737-XAH6P1yX-C5S8p_6I.js";import"./createText-1719965b-Cbn6MBZp-zoEnAAP_.js";const k=a=>E.sanitizeText(a,d());let x={dividerMargin:10,padding:5,textHeight:10,curve:void 0};const R=function(a,t,b,i){const e=Object.keys(a);c.info("keys:",e),c.info(a),e.forEach(function(s){var l,r;const o=a[s],n={shape:"rect",id:o.id,domId:o.domId,labelText:k(o.id),labelStyle:"",style:"fill: none; stroke: black",padding:((l=d().flowchart)==null?void 0:l.padding)??((r=d().class)==null?void 0:r.padding)};t.setNode(o.id,n),I(o.classes,t,b,i,o.id),c.info("setNode",n)})},I=function(a,t,b,i,e){const s=Object.keys(a);c.info("keys:",s),c.info(a),s.filter(l=>a[l].parent==e).forEach(function(l){var r,o;const n=a[l],g=n.cssClasses.join(" "),y=D(n.styles),u=n.label??n.id,p=0,f={labelStyle:y.labelStyle,shape:"class_box",labelText:k(u),classData:n,rx:p,ry:p,class:g,style:y.style,id:n.id,domId:n.domId,tooltip:i.db.getTooltip(n.id,e)||"",haveCallback:n.haveCallback,link:n.link,width:n.type==="group"?500:void 0,type:n.type,padding:((r=d().flowchart)==null?void 0:r.padding)??((o=d().class)==null?void 0:o.padding)};t.setNode(n.id,f),e&&t.setParent(n.id,e),c.info("setNode",f)})},z=function(a,t,b,i){c.info(a),a.forEach(function(e,s){var l,r;const o=e,n="",g={labelStyle:"",style:""},y=o.text,u=0,p={labelStyle:g.labelStyle,shape:"note",labelText:k(y),noteData:o,rx:u,ry:u,class:n,style:g.style,id:o.id,domId:o.id,tooltip:"",type:"note",padding:((l=d().flowchart)==null?void 0:l.padding)??((r=d().class)==null?void 0:r.padding)};if(t.setNode(o.id,p),c.info("setNode",p),!o.class||!(o.class in i))return;const f=b+s,m={id:`edgeNote${f}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:A(x.curve,C)};t.setEdge(o.id,o.class,m,f)})},H=function(a,t){const b=d().flowchart;let i=0;a.forEach(function(e){var s;i++;const l={classes:"relation",pattern:e.relation.lineType==1?"dashed":"solid",id:`id_${e.id1}_${e.id2}_${i}`,arrowhead:e.type==="arrow_open"?"none":"normal",startLabelRight:e.relationTitle1==="none"?"":e.relationTitle1,endLabelLeft:e.relationTitle2==="none"?"":e.relationTitle2,arrowTypeStart:N(e.relation.type1),arrowTypeEnd:N(e.relation.type2),style:"fill:none",labelStyle:"",curve:A(b==null?void 0:b.curve,C)};if(c.info(l,e),e.style!==void 0){const r=D(e.style);l.style=r.style,l.labelStyle=r.labelStyle}e.text=e.title,e.text===void 0?e.style!==void 0&&(l.arrowheadStyle="fill: #333"):(l.arrowheadStyle="fill: #333",l.labelpos="c",((s=d().flowchart)==null?void 0:s.htmlLabels)??d().htmlLabels?(l.labelType="html",l.label='<span class="edgeLabel">'+e.text+"</span>"):(l.labelType="text",l.label=e.text.replace(E.lineBreakRegex,`
2
2
  `),e.style===void 0&&(l.style=l.style||"stroke: #333; stroke-width: 1.5px;fill:none"),l.labelStyle=l.labelStyle.replace("color:","fill:"))),t.setEdge(e.id1,e.id2,l,i)})},Q=function(a){x={...x,...a}},U=async function(a,t,b,i){c.info("Drawing class - ",t);const e=d().flowchart??d().class,s=d().securityLevel;c.info("config:",e);const l=(e==null?void 0:e.nodeSpacing)??50,r=(e==null?void 0:e.rankSpacing)??50,o=new K({multigraph:!0,compound:!0}).setGraph({rankdir:i.db.getDirection(),nodesep:l,ranksep:r,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=i.db.getNamespaces(),g=i.db.getClasses(),y=i.db.getRelations(),u=i.db.getNotes();c.info(y),R(n,o,t,i),I(g,o,t,i),H(y,o),z(u,o,y.length+1,g);let p;s==="sandbox"&&(p=w("#i"+t));const f=s==="sandbox"?w(p.nodes()[0].contentDocument.body):w("body"),m=f.select(`[id="${t}"]`),$=f.select("#"+t+" g");if(await O($,o,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",t),_.insertTitle(m,"classTitleText",(e==null?void 0:e.titleTopMargin)??5,i.db.getDiagramTitle()),B(o,m,e==null?void 0:e.diagramPadding,e==null?void 0:e.useMaxWidth),!(e!=null&&e.htmlLabels)){const T=s==="sandbox"?p.nodes()[0].contentDocument:document,j=T.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const v of j){const S=v.getBBox(),h=T.createElementNS("http://www.w3.org/2000/svg","rect");h.setAttribute("rx",0),h.setAttribute("ry",0),h.setAttribute("width",S.width),h.setAttribute("height",S.height),v.insertBefore(h,v.firstChild)}}};function N(a){let t;switch(a){case 0:t="aggregation";break;case 1:t="extension";break;case 2:t="composition";break;case 3:t="dependency";break;case 4:t="lollipop";break;default:t="none"}return t}const W={setConf:Q,draw:U},ee={parser:P,db:L,renderer:W,styles:M,init:a=>{a.class||(a.class={}),a.class.arrowMarkerAbsolute=a.arrowMarkerAbsolute,L.clear()}};export{ee as diagram};
@@ -0,0 +1 @@
1
+ import{U as o}from"./graph-Bc6U-Oet-CBlVz78v.js";var t=4;function n(r){return o(r,t)}export{n as a};