@juki-team/base-ui 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -7
- package/dist/esm/{BarChart-DGvfKEbJ.js → BarChart-ilBguU5i.js} +1 -1
- package/dist/esm/{CartesianChart-BLpd_e8l.js → CartesianChart-B4Big96I.js} +1 -1
- package/dist/esm/{ChangePasswordModal-8aYa6mTN.js → ChangePasswordModal-B1Ahfv-S.js} +1 -1
- package/dist/esm/{CodeEditor-BKMFVmPO.js → CodeEditor-Co_-jMMN.js} +1 -1
- package/dist/esm/{CodeViewer-DqO18gks.js → CodeViewer-j4tlytYb.js} +1 -1
- package/dist/esm/{Collapse-DMLYcciz.js → Collapse-B_Oe1-5C.js} +1 -1
- package/dist/esm/{DataGrid-C-Gco96b.js → DataGrid-B0Av-VN8.js} +1 -1
- package/dist/esm/{DataViewer-DIROui4g.js → DataViewer-jViuraZ_.js} +1 -1
- package/dist/esm/{DrawerView-Be_ckf6D.js → DrawerView-BoMapmAb.js} +1 -1
- package/dist/esm/{ExcalidrawButton-DWRJMohJ.js → ExcalidrawButton-DRR-2JvH.js} +1 -1
- package/dist/esm/{GraphvizViewer-DUIJSiDq.js → GraphvizViewer-DEJDUNWF.js} +1 -1
- package/dist/esm/{ImageLoaderCropper-O3UDeKd5.js → ImageLoaderCropper-CeYhv904.js} +1 -1
- package/dist/esm/{InputCellPhoneNumber-ByG_R6dr.js → InputCellPhoneNumber-C7hpcqFZ.js} +1 -1
- package/dist/esm/{InputColor-C_JNgwYl.js → InputColor-BhVac99k.js} +1 -1
- package/dist/esm/{LineChart-BkCo4cnj.js → LineChart-_gtzHQbx.js} +1 -1
- package/dist/esm/{MdMath-C38RmN3O.js → MdMath-BtS290JE.js} +1 -1
- package/dist/esm/{MdMathEditor-C7surRiM.js → MdMathEditor-B41-_-_8.js} +2 -2
- package/dist/esm/{Popover-BaP7hJ0J.js → Popover-BGWBnVdT.js} +1 -1
- package/dist/esm/{SlideDeck-CpWGHFVE.js → SlideDeck-NtKwXHq5.js} +1 -1
- package/dist/esm/{TableOfContents-888D-B0V.js → TableOfContents-DBBkdhlJ.js} +1 -1
- package/dist/esm/{Tooltip-CNWDFJKv.js → Tooltip-DaBTZZ8j.js} +1 -1
- package/dist/esm/{UserCodeEditor-C0MyUL5-.js → UserCodeEditor-DdyfLlQs.js} +2 -2
- package/dist/esm/{VirtualizedRowsFixed-CYPaWB5L.js → VirtualizedRowsFixed-BAjhFO3R.js} +1 -1
- package/dist/esm/{WorksheetAsSlides-BNOZBoQY.js → WorksheetAsSlides-B5FB6vVz.js} +1 -1
- package/dist/esm/{WorksheetBodies-CHTN-wn9.js → WorksheetBodies-2hrTre13.js} +1 -1
- package/dist/esm/{WorksheetContents-IN63vuWT.js → WorksheetContents-CdM17xrm.js} +1 -1
- package/dist/esm/{WorksheetEditor-Hs_sWk7j.js → WorksheetEditor-HdlEcmnN.js} +1 -1
- package/dist/esm/{WorksheetNode-DGuKOPTt.js → WorksheetNode-C-TrJMCB.js} +1 -1
- package/dist/esm/{WorksheetViewer-Bt_jqHdh.js → WorksheetViewer-D0Co4NMK.js} +1 -1
- package/dist/esm/{architecture-YZFGNWBL-BExtdnEH.js → architecture-YZFGNWBL-Pv0ede3r.js} +1 -1
- package/dist/esm/{architectureDiagram-Q4EWVU46-CUhUPzlC.js → architectureDiagram-Q4EWVU46-Qs_XxOCt.js} +1 -1
- package/dist/esm/{blockDiagram-DXYQGD6D-DwW8YrKx.js → blockDiagram-DXYQGD6D-CG7oWqi7.js} +1 -1
- package/dist/esm/{c4Diagram-AHTNJAMY-DUUpakLg.js → c4Diagram-AHTNJAMY-DyGWi7Su.js} +1 -1
- package/dist/esm/channel-DjjqTXV9.js +1 -0
- package/dist/esm/{chunk-4BX2VUAB-BwFNstmG.js → chunk-4BX2VUAB-7TA7AVyu.js} +1 -1
- package/dist/esm/{chunk-4TB4RGXK-DV5sTBnv.js → chunk-4TB4RGXK-ChheKyYi.js} +1 -1
- package/dist/esm/{chunk-55IACEB6-BPJEY6mM.js → chunk-55IACEB6-BpHVIT0b.js} +1 -1
- package/dist/esm/{chunk-EDXVE4YY-9L7nz82K.js → chunk-EDXVE4YY-DQ25JIov.js} +1 -1
- package/dist/esm/{chunk-FMBD7UC4-BZMcHvFk.js → chunk-FMBD7UC4-DVZBlcm4.js} +1 -1
- package/dist/esm/{chunk-OYMX7WX6-COWCWylB.js → chunk-OYMX7WX6-BgiA8Wjh.js} +1 -1
- package/dist/esm/{chunk-QZHKN3VN-D2pIW1ss.js → chunk-QZHKN3VN-Cq1a-aN-.js} +1 -1
- package/dist/esm/{chunk-YZCP3GAM-D9GadUwL.js → chunk-YZCP3GAM-BDqtM1Ka.js} +1 -1
- package/dist/esm/{classDiagram-6PBFFD2Q-Cr8ipQ5w.js → classDiagram-6PBFFD2Q-D-xRfeAV.js} +1 -1
- package/dist/esm/{classDiagram-v2-HSJHXN6E-Cr8ipQ5w.js → classDiagram-v2-HSJHXN6E-D-xRfeAV.js} +1 -1
- package/dist/esm/clone-DCVnqO4M.js +1 -0
- package/dist/esm/{cose-bilkent-S5V4N54A-Dg1f2q8q.js → cose-bilkent-S5V4N54A-uYVAtvEb.js} +1 -1
- package/dist/esm/{dagre-KV5264BT-Drwedjf_.js → dagre-KV5264BT-CmDBeo-P.js} +1 -1
- package/dist/esm/{diagram-5BDNPKRD-BUvinU3I.js → diagram-5BDNPKRD-DVvj2_2u.js} +1 -1
- package/dist/esm/{diagram-G4DWMVQ6-D60Wox58.js → diagram-G4DWMVQ6-DYpFO01Z.js} +1 -1
- package/dist/esm/{diagram-MMDJMWI5-C60GB5LZ.js → diagram-MMDJMWI5-CDbT7cky.js} +1 -1
- package/dist/esm/{diagram-TYMM5635-CMF-zVic.js → diagram-TYMM5635-QWJ6iFCJ.js} +1 -1
- package/dist/esm/{erDiagram-SMLLAGMA-BmCfxmBR.js → erDiagram-SMLLAGMA-BaIhydf3.js} +1 -1
- package/dist/esm/{flowDiagram-DWJPFMVM-CVOjnh-h.js → flowDiagram-DWJPFMVM--s6o35x5.js} +1 -1
- package/dist/esm/{ganttDiagram-T4ZO3ILL-Cay-LcBr.js → ganttDiagram-T4ZO3ILL-CE7k2fwu.js} +1 -1
- package/dist/esm/{gitGraph-7Q5UKJZL-BIhofRTU.js → gitGraph-7Q5UKJZL-Dw9SBp3L.js} +1 -1
- package/dist/esm/{gitGraphDiagram-UUTBAWPF-BN1EkaA3.js → gitGraphDiagram-UUTBAWPF-VFFCKAr8.js} +1 -1
- package/dist/esm/{graph-XFLEVMvo.js → graph-C49NoLzy.js} +1 -1
- package/dist/esm/helpers.js +1 -1
- package/dist/esm/index-CP5vpK1A.js +1 -0
- package/dist/esm/{index-D4D24Np7.js → index-DmCvSgoi.js} +1 -1
- package/dist/esm/{info-OMHHGYJF-DMKJgJ3s.js → info-OMHHGYJF-uLTg2g1k.js} +1 -1
- package/dist/esm/{infoDiagram-42DDH7IO-kAZbkK9S.js → infoDiagram-42DDH7IO-DfB27x0W.js} +1 -1
- package/dist/esm/{ishikawaDiagram-UXIWVN3A-MtQmxrIE.js → ishikawaDiagram-UXIWVN3A-hkiElo3Y.js} +1 -1
- package/dist/esm/{journeyDiagram-VCZTEJTY-BuKFXeHL.js → journeyDiagram-VCZTEJTY-svJ9aZB7.js} +1 -1
- package/dist/esm/{kanban-definition-6JOO6SKY-pGcXhhi7.js → kanban-definition-6JOO6SKY-aCGgjGQa.js} +1 -1
- package/dist/esm/{layout-D9uGd7GO.js → layout-Dn6BZDTj.js} +1 -1
- package/dist/esm/main.js +1 -1
- package/dist/esm/{mermaid-parser.core-Crc-QLCi.js → mermaid-parser.core-KtTYbDqg.js} +1 -1
- package/dist/esm/{mermaid.core-C2hrg85i.js → mermaid.core-Crnpnced.js} +1 -1
- package/dist/esm/{mindmap-definition-QFDTVHPH-CtfxHH9N.js → mindmap-definition-QFDTVHPH-D0c-OxXp.js} +1 -1
- package/dist/esm/{packet-4T2RLAQJ-BD2Ad6jE.js → packet-4T2RLAQJ-FrKYDPbn.js} +1 -1
- package/dist/esm/{pie-ZZUOXDRM-Bf017PqT.js → pie-ZZUOXDRM-obOGHjHy.js} +1 -1
- package/dist/esm/{pieDiagram-DEJITSTG-ChBbMYd8.js → pieDiagram-DEJITSTG-Ago1dmgK.js} +1 -1
- package/dist/esm/{quadrantDiagram-34T5L4WZ-BNmMB-pp.js → quadrantDiagram-34T5L4WZ-f7CWEYhG.js} +1 -1
- package/dist/esm/{radar-PYXPWWZC-DvvZel7z.js → radar-PYXPWWZC-BEcFMluC.js} +1 -1
- package/dist/esm/{requirementDiagram-MS252O5E-B1RjmS2l.js → requirementDiagram-MS252O5E-B_KOoVtP.js} +1 -1
- package/dist/esm/{sankeyDiagram-XADWPNL6-DSuRDDHI.js → sankeyDiagram-XADWPNL6-BpENeDG-.js} +1 -1
- package/dist/esm/{sequenceDiagram-FGHM5R23-ByfYuCTD.js → sequenceDiagram-FGHM5R23-DjCr8k36.js} +1 -1
- package/dist/esm/{stateDiagram-FHFEXIEX-CMjgjvak.js → stateDiagram-FHFEXIEX-B0Hp6EQN.js} +1 -1
- package/dist/esm/{stateDiagram-v2-QKLJ7IA2-htYMk5r5.js → stateDiagram-v2-QKLJ7IA2-DDbvXv_Y.js} +1 -1
- package/dist/esm/{timeline-definition-GMOUNBTQ-COFLk0ve.js → timeline-definition-GMOUNBTQ-nYM0ar6p.js} +1 -1
- package/dist/esm/{treeView-SZITEDCU-Ck6yPSxL.js → treeView-SZITEDCU-BNkk4mhj.js} +1 -1
- package/dist/esm/{treemap-W4RFUUIX-ErJXCLFJ.js → treemap-W4RFUUIX-DWvE4iLu.js} +1 -1
- package/dist/esm/{types-rkDjePoL.js → types-JRcv-6PR.js} +1 -1
- package/dist/esm/{vennDiagram-DHZGUBPP-xxvi147V.js → vennDiagram-DHZGUBPP-CQ4yw6a2.js} +1 -1
- package/dist/esm/{wardley-RL74JXVD-B3jC7s0b.js → wardley-RL74JXVD-BYbSDrTb.js} +1 -1
- package/dist/esm/{wardleyDiagram-NUSXRM2D-CIYzWE9T.js → wardleyDiagram-NUSXRM2D-ChuA4cDu.js} +1 -1
- package/dist/esm/{websocket-CxbYBjHT.js → websocket-C4PinjUD.js} +1 -1
- package/dist/esm/{xychartDiagram-5P7HB3ND-CHfEshBW.js → xychartDiagram-5P7HB3ND-C_GW0EwI.js} +1 -1
- package/dist/module-types/src/components/molecules/TabsInline/TabsInlineButton.d.ts +1 -1
- package/dist/module-types/src/components/molecules/TabsInline/TabsInlineButtonLoader.d.ts +1 -1
- package/dist/module-types/src/components/molecules/TabsInline/utils.d.ts +3 -0
- package/package.json +2 -2
- package/src/styles/components/atoms/_tabs-inline.scss +7 -0
- package/dist/esm/channel-a8NrvAcc.js +0 -1
- package/dist/esm/clone-1ULLnhdV.js +0 -1
- package/dist/esm/index-EPJhFLhN.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as t,t as n,s as e,g as i,b as s,a as r,_ as o,c as a,A as c,d as l,Y as h,z as u,k as f}from"./mermaid.core-C2hrg85i.js";import{o as y}from"./ordinal-zwWoQKz9.js";import"./index-EPJhFLhN.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-B_OozOv-.js";import"./settings-BIQ7IqJl.js";import"./constants.js";import"./LoaderLayer-D9O7WqFD.js";import"./websocket-CxbYBjHT.js";import"./index-CODLgwqm.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./purify.es-DBOWJxv3.js";import"./string-LeDn2fkG.js";import"./memoize-CPUrcYQl.js";import"./init-DLRA0X12.js";var p=function(t){for(var n=t.length/6|0,e=new Array(n),i=0;i<n;)e[i]="#"+t.slice(6*i,6*++i);return e}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function d(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e<s||void 0===e&&s>=s)&&(e=s)}return e}function g(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e>s||void 0===e&&s>=s)&&(e=s)}return e}function _(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let i=-1;for(let s of t)(s=+n(s,++i,t))&&(e+=s)}return e}function m(t){return t.target.depth}function x(t,n){return t.sourceLinks.length?t.depth:n-1}function k(t){return function(){return t}}function v(t,n){return w(t.source,n.source)||t.index-n.index}function b(t,n){return w(t.target,n.target)||t.index-n.index}function w(t,n){return t.y0-n.y0}function S(t){return t.value}function L(t){return t.index}function E(t){return t.nodes}function A(t){return t.links}function M(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function j({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}function I(){let t,n,e,i=0,s=0,r=1,o=1,a=24,c=8,l=L,h=x,u=E,f=A,y=6;function p(){const p={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[n,e]of t.entries())e.index=n,e.sourceLinks=[],e.targetLinks=[];const i=new Map(t.map((n,e)=>[l(n,e,t),n]));for(const[t,e]of n.entries()){e.index=t;let{source:n,target:s}=e;"object"!=typeof n&&(n=e.source=M(i,n)),"object"!=typeof s&&(s=e.target=M(i,s)),n.sourceLinks.push(e),s.targetLinks.push(e)}if(null!=e)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(e),i.sort(e)}(p),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(_(n.sourceLinks,S),_(n.targetLinks,S)):n.fixedValue}(p),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.depth=s;for(const{target:n}of t.sourceLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(p),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.height=s;for(const{source:n}of t.targetLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(p),function(e){const l=function({nodes:t}){const e=d(t,t=>t.depth)+1,s=(r-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*s,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(c,(o-s)/(d(l,t=>t.length)-1)),function(n){const e=g(n,n=>(o-s-(n.length-1)*t)/_(n,S));for(const i of n){let n=s;for(const s of i){s.y0=n,s.y1=n+s.value*e,n=s.y1+t;for(const t of s.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}C(i)}}(l);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);I(l,n,e),m(l,n,e)}}(p),j(p),p}function m(t,e,i){for(let s=1,r=t.length;s<r;++s){const r=t[s];for(const t of r){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=D(e,t)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,O(t)}void 0===n&&r.sort(w),T(r,i)}}function I(t,e,i){for(let s=t.length-2;s>=0;--s){const r=t[s];for(const t of r){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=$(t,e)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,O(t)}void 0===n&&r.sort(w),T(r,i)}}function T(n,e){const i=n.length>>1,r=n[i];P(n,r.y0-t,i-1,e),N(n,r.y1+t,i+1,e),P(n,o,n.length-1,e),N(n,s,0,e)}function N(n,e,i,s){for(;i<n.length;++i){const r=n[i],o=(e-r.y0)*s;o>1e-6&&(r.y0+=o,r.y1+=o),e=r.y1+t}}function P(n,e,i,s){for(;i>=0;--i){const r=n[i],o=(r.y1-e)*s;o>1e-6&&(r.y0-=o,r.y1-=o),e=r.y0-t}}function O({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(b);for(const{target:{targetLinks:n}}of t)n.sort(v)}}function C(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(b),e.sort(v)}function D(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:s,width:r}of n.sourceLinks){if(s===e)break;i+=r+t}for(const{source:t,width:s}of e.targetLinks){if(t===n)break;i-=s}return i}function $(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:s,width:r}of e.targetLinks){if(s===n)break;i+=r+t}for(const{target:t,width:s}of n.sourceLinks){if(t===e)break;i-=s}return i}return p.update=function(t){return j(t),t},p.nodeId=function(t){return arguments.length?(l="function"==typeof t?t:k(t),p):l},p.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:k(t),p):h},p.nodeSort=function(t){return arguments.length?(n=t,p):n},p.nodeWidth=function(t){return arguments.length?(a=+t,p):a},p.nodePadding=function(n){return arguments.length?(c=t=+n,p):c},p.nodes=function(t){return arguments.length?(u="function"==typeof t?t:k(t),p):u},p.links=function(t){return arguments.length?(f="function"==typeof t?t:k(t),p):f},p.linkSort=function(t){return arguments.length?(e=t,p):e},p.size=function(t){return arguments.length?(i=s=0,r=+t[0],o=+t[1],p):[r-i,o-s]},p.extent=function(t){return arguments.length?(i=+t[0][0],r=+t[1][0],s=+t[0][1],o=+t[1][1],p):[[i,s],[r,o]]},p.iterations=function(t){return arguments.length?(y=+t,p):y},p}var T=Math.PI,N=2*T,P=1e-6,O=N-P;function C(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function D(){return new C}function $(t){return function(){return t}}function z(t){return t[0]}function F(t){return t[1]}C.prototype=D.prototype={constructor:C,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,s,r){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+s)+","+(this._y1=+r)},arcTo:function(t,n,e,i,s){t=+t,n=+n,e=+e,i=+i,s=+s;var r=this._x1,o=this._y1,a=e-t,c=i-n,l=r-t,h=o-n,u=l*l+h*h;if(s<0)throw new Error("negative radius: "+s);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>P)if(Math.abs(h*a-c*l)>P&&s){var f=e-r,y=i-o,p=a*a+c*c,d=f*f+y*y,g=Math.sqrt(p),_=Math.sqrt(u),m=s*Math.tan((T-Math.acos((p+u-d)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>P&&(this._+="L"+(t+x*l)+","+(n+x*h)),this._+="A"+s+","+s+",0,0,"+ +(h*f>l*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,s,r){t=+t,n=+n,r=!!r;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),c=t+o,l=n+a,h=1^r,u=r?i-s:s-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>P||Math.abs(this._y1-l)>P)&&(this._+="L"+c+","+l),e&&(u<0&&(u=u%N+N),u>O?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=c)+","+(this._y1=l):u>P&&(this._+="A"+e+","+e+",0,"+ +(u>=T)+","+h+","+(this._x1=t+e*Math.cos(s))+","+(this._y1=n+e*Math.sin(s))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var U=Array.prototype.slice;function W(t){return t.source}function G(t){return t.target}function q(t,n,e,i,s){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,s,i,s)}function V(){return function(t){var n=W,e=G,i=z,s=F,r=null;function o(){var o,a=U.call(arguments),c=n.apply(this,a),l=e.apply(this,a);if(r||(r=o=D()),t(r,+i.apply(this,(a[0]=c,a)),+s.apply(this,a),+i.apply(this,(a[0]=l,a)),+s.apply(this,a)),o)return r=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:$(+t),o):i},o.y=function(t){return arguments.length?(s="function"==typeof t?t:$(+t),o):s},o.context=function(t){return arguments.length?(r=null==t?null:t,o):r},o}(q)}function X(t){return[t.source.x1,t.y0]}function Y(t){return[t.target.x0,t.y1]}var Q=function(){var t=o(function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},"o"),n=[1,9],e=[1,10],i=[1,5,10,12],s={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:o(function(t,n,e,i,s,r,o){var a=r.length-1;switch(s){case 7:const t=i.findOrCreateNode(r[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(r[a-2].trim().replaceAll('""','"')),e=parseFloat(r[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=r[a];break;case 10:this.$=r[a-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:o(function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},"parseError"),parse:o(function(t){var n=this,e=[0],i=[],s=[null],r=[],a=this.table,c="",l=0,h=0,u=r.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(y.yy[p]=this.yy[p]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var d=f.yylloc;r.push(d);var g=f.options&&f.options.ranges;function _(){var t;return"number"!=typeof(t=i.pop()||f.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){e.length=e.length-2*t,s.length=s.length-t,r.length=r.length-t},"popStack"),o(_,"lex");for(var m,x,k,v,b,w,S,L,E={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(b in L=[],a[x])this.terminals_[b]&&b>2&&L.push("'"+this.terminals_[b]+"'");A=f.showPosition?"Parse error on line "+(l+1)+":\n"+f.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:d,expected:L})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),s.push(f.yytext),r.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,c=f.yytext,l=f.yylineno,d=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],E.$=s[s.length-w],E._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[c,h,l,y.yy,k[1],s,r].concat(u))))return v;w&&(e=e.slice(0,-1*w*2),s=s.slice(0,-1*w),r=r.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),s.push(E.$),r.push(E._$),S=a[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0},"parse")},r=function(){return{EOF:1,parseError:o(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:o(function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=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),e.length-1&&(this.yylineno-=e.length-1);var s=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:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:o(function(t,n){var e,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((e=this._input.match(this.rules[s[r]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,s[r])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,n,e,i){switch(e){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=r,o(a,"Parser"),a.prototype=s,s.Parser=a,new a}();Q.parser=Q;var R=Q,B=[],K=[],Z=new Map,J=o(()=>{B=[],K=[],Z=new Map,u()},"clear"),H=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}static{o(this,"SankeyLink")}},tt=o((t,n,e)=>{B.push(new H(t,n,e))},"addLink"),nt=class{constructor(t){this.ID=t}static{o(this,"SankeyNode")}},et=o(t=>{t=f.sanitizeText(t,a());let n=Z.get(t);return void 0===n&&(n=new nt(t),Z.set(t,n),K.push(n)),n},"findOrCreateNode"),it=o(()=>K,"getNodes"),st=o(()=>B,"getLinks"),rt=o(()=>({nodes:K.map(t=>({id:t.ID})),links:B.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ot={nodesMap:Z,getConfig:o(()=>a().sankey,"getConfig"),getNodes:it,getLinks:st,getGraph:rt,addLink:tt,findOrCreateNode:et,getAccTitle:r,setAccTitle:s,getAccDescription:i,setAccDescription:e,getDiagramTitle:n,setDiagramTitle:t,clear:J},at=class t{static{o(this,"Uid")}static{this.count=0}static next(n){return new t(n+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},ct={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?g(t.sourceLinks,m)-1:0},justify:x},lt=o(function(t,n,e,i){const{securityLevel:s,sankey:r}=a(),u=c.sankey;let f;"sandbox"===s&&(f=l("#i"+n));const d=l("sandbox"===s?f.nodes()[0].contentDocument.body:"body"),g="sandbox"===s?d.select(`[id="${n}"]`):l(`[id="${n}"]`),_=r?.width??u.width,m=r?.height??u.width,x=r?.useMaxWidth??u.useMaxWidth,k=r?.nodeAlignment??u.nodeAlignment,v=r?.prefix??u.prefix,b=r?.suffix??u.suffix,w=r?.showValues??u.showValues,S=i.db.getGraph(),L=ct[k];I().nodeId(t=>t.id).nodeWidth(10).nodePadding(10+(w?15:0)).nodeAlign(L).extent([[0,0],[_,m]])(S);const E=y(p);g.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=at.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>E(t.id));const A=o(({id:t,value:n})=>w?`${t}\n${v}${Math.round(100*n)/100}${b}`:t,"getText");g.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(S.nodes).join("text").attr("x",t=>t.x0<_/2?t.x1+6:t.x0-6).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",t=>t.x0<_/2?"start":"end").text(A);const M=g.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),j=r?.linkColor??"gradient";if("gradient"===j){const t=M.append("linearGradient").attr("id",t=>(t.uid=at.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>E(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>E(t.target.id))}let T;switch(j){case"gradient":T=o(t=>t.uid,"coloring");break;case"source":T=o(t=>E(t.source.id),"coloring");break;case"target":T=o(t=>E(t.target.id),"coloring");break;default:T=j}M.append("path").attr("d",V().source(X).target(Y)).attr("stroke",T).attr("stroke-width",t=>Math.max(1,t.width)),h(void 0,g,0,x)},"draw"),ht={draw:lt},ut=o(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),ft=o(t=>`.label {\n font-family: ${t.fontFamily};\n }`,"getStyles"),yt=R.parse.bind(R);R.parse=t=>yt(ut(t));var pt={styles:ft,parser:R,db:ot,renderer:ht};export{pt as diagram};
|
|
1
|
+
import{q as t,t as n,s as e,g as i,b as s,a as r,_ as o,c as a,A as c,d as l,Y as h,z as u,k as f}from"./mermaid.core-Crnpnced.js";import{o as y}from"./ordinal-zwWoQKz9.js";import"./index-CP5vpK1A.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-B_OozOv-.js";import"./settings-BIQ7IqJl.js";import"./constants.js";import"./LoaderLayer-D9O7WqFD.js";import"./websocket-C4PinjUD.js";import"./index-CODLgwqm.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./purify.es-DBOWJxv3.js";import"./string-LeDn2fkG.js";import"./memoize-CPUrcYQl.js";import"./init-DLRA0X12.js";var p=function(t){for(var n=t.length/6|0,e=new Array(n),i=0;i<n;)e[i]="#"+t.slice(6*i,6*++i);return e}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function d(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e<s||void 0===e&&s>=s)&&(e=s)}return e}function g(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let s of t)null!=(s=n(s,++i,t))&&(e>s||void 0===e&&s>=s)&&(e=s)}return e}function _(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let i=-1;for(let s of t)(s=+n(s,++i,t))&&(e+=s)}return e}function m(t){return t.target.depth}function x(t,n){return t.sourceLinks.length?t.depth:n-1}function k(t){return function(){return t}}function v(t,n){return w(t.source,n.source)||t.index-n.index}function b(t,n){return w(t.target,n.target)||t.index-n.index}function w(t,n){return t.y0-n.y0}function S(t){return t.value}function L(t){return t.index}function E(t){return t.nodes}function A(t){return t.links}function M(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function j({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}function I(){let t,n,e,i=0,s=0,r=1,o=1,a=24,c=8,l=L,h=x,u=E,f=A,y=6;function p(){const p={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[n,e]of t.entries())e.index=n,e.sourceLinks=[],e.targetLinks=[];const i=new Map(t.map((n,e)=>[l(n,e,t),n]));for(const[t,e]of n.entries()){e.index=t;let{source:n,target:s}=e;"object"!=typeof n&&(n=e.source=M(i,n)),"object"!=typeof s&&(s=e.target=M(i,s)),n.sourceLinks.push(e),s.targetLinks.push(e)}if(null!=e)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(e),i.sort(e)}(p),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(_(n.sourceLinks,S),_(n.targetLinks,S)):n.fixedValue}(p),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.depth=s;for(const{target:n}of t.sourceLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(p),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,s=0;for(;e.size;){for(const t of e){t.height=s;for(const{source:n}of t.targetLinks)i.add(n)}if(++s>n)throw new Error("circular link");e=i,i=new Set}}(p),function(e){const l=function({nodes:t}){const e=d(t,t=>t.depth)+1,s=(r-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*s,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(c,(o-s)/(d(l,t=>t.length)-1)),function(n){const e=g(n,n=>(o-s-(n.length-1)*t)/_(n,S));for(const i of n){let n=s;for(const s of i){s.y0=n,s.y1=n+s.value*e,n=s.y1+t;for(const t of s.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}C(i)}}(l);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);I(l,n,e),m(l,n,e)}}(p),j(p),p}function m(t,e,i){for(let s=1,r=t.length;s<r;++s){const r=t[s];for(const t of r){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=D(e,t)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,O(t)}void 0===n&&r.sort(w),T(r,i)}}function I(t,e,i){for(let s=t.length-2;s>=0;--s){const r=t[s];for(const t of r){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=$(t,e)*r,i+=r}if(!(i>0))continue;let s=(n/i-t.y0)*e;t.y0+=s,t.y1+=s,O(t)}void 0===n&&r.sort(w),T(r,i)}}function T(n,e){const i=n.length>>1,r=n[i];P(n,r.y0-t,i-1,e),N(n,r.y1+t,i+1,e),P(n,o,n.length-1,e),N(n,s,0,e)}function N(n,e,i,s){for(;i<n.length;++i){const r=n[i],o=(e-r.y0)*s;o>1e-6&&(r.y0+=o,r.y1+=o),e=r.y1+t}}function P(n,e,i,s){for(;i>=0;--i){const r=n[i],o=(r.y1-e)*s;o>1e-6&&(r.y0-=o,r.y1-=o),e=r.y0-t}}function O({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(b);for(const{target:{targetLinks:n}}of t)n.sort(v)}}function C(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(b),e.sort(v)}function D(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:s,width:r}of n.sourceLinks){if(s===e)break;i+=r+t}for(const{source:t,width:s}of e.targetLinks){if(t===n)break;i-=s}return i}function $(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:s,width:r}of e.targetLinks){if(s===n)break;i+=r+t}for(const{target:t,width:s}of n.sourceLinks){if(t===e)break;i-=s}return i}return p.update=function(t){return j(t),t},p.nodeId=function(t){return arguments.length?(l="function"==typeof t?t:k(t),p):l},p.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:k(t),p):h},p.nodeSort=function(t){return arguments.length?(n=t,p):n},p.nodeWidth=function(t){return arguments.length?(a=+t,p):a},p.nodePadding=function(n){return arguments.length?(c=t=+n,p):c},p.nodes=function(t){return arguments.length?(u="function"==typeof t?t:k(t),p):u},p.links=function(t){return arguments.length?(f="function"==typeof t?t:k(t),p):f},p.linkSort=function(t){return arguments.length?(e=t,p):e},p.size=function(t){return arguments.length?(i=s=0,r=+t[0],o=+t[1],p):[r-i,o-s]},p.extent=function(t){return arguments.length?(i=+t[0][0],r=+t[1][0],s=+t[0][1],o=+t[1][1],p):[[i,s],[r,o]]},p.iterations=function(t){return arguments.length?(y=+t,p):y},p}var T=Math.PI,N=2*T,P=1e-6,O=N-P;function C(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function D(){return new C}function $(t){return function(){return t}}function z(t){return t[0]}function F(t){return t[1]}C.prototype=D.prototype={constructor:C,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,s,r){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+s)+","+(this._y1=+r)},arcTo:function(t,n,e,i,s){t=+t,n=+n,e=+e,i=+i,s=+s;var r=this._x1,o=this._y1,a=e-t,c=i-n,l=r-t,h=o-n,u=l*l+h*h;if(s<0)throw new Error("negative radius: "+s);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>P)if(Math.abs(h*a-c*l)>P&&s){var f=e-r,y=i-o,p=a*a+c*c,d=f*f+y*y,g=Math.sqrt(p),_=Math.sqrt(u),m=s*Math.tan((T-Math.acos((p+u-d)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>P&&(this._+="L"+(t+x*l)+","+(n+x*h)),this._+="A"+s+","+s+",0,0,"+ +(h*f>l*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,s,r){t=+t,n=+n,r=!!r;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),c=t+o,l=n+a,h=1^r,u=r?i-s:s-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>P||Math.abs(this._y1-l)>P)&&(this._+="L"+c+","+l),e&&(u<0&&(u=u%N+N),u>O?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=c)+","+(this._y1=l):u>P&&(this._+="A"+e+","+e+",0,"+ +(u>=T)+","+h+","+(this._x1=t+e*Math.cos(s))+","+(this._y1=n+e*Math.sin(s))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var U=Array.prototype.slice;function W(t){return t.source}function G(t){return t.target}function q(t,n,e,i,s){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,s,i,s)}function V(){return function(t){var n=W,e=G,i=z,s=F,r=null;function o(){var o,a=U.call(arguments),c=n.apply(this,a),l=e.apply(this,a);if(r||(r=o=D()),t(r,+i.apply(this,(a[0]=c,a)),+s.apply(this,a),+i.apply(this,(a[0]=l,a)),+s.apply(this,a)),o)return r=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:$(+t),o):i},o.y=function(t){return arguments.length?(s="function"==typeof t?t:$(+t),o):s},o.context=function(t){return arguments.length?(r=null==t?null:t,o):r},o}(q)}function X(t){return[t.source.x1,t.y0]}function Y(t){return[t.target.x0,t.y1]}var Q=function(){var t=o(function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},"o"),n=[1,9],e=[1,10],i=[1,5,10,12],s={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:o(function(t,n,e,i,s,r,o){var a=r.length-1;switch(s){case 7:const t=i.findOrCreateNode(r[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(r[a-2].trim().replaceAll('""','"')),e=parseFloat(r[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=r[a];break;case 10:this.$=r[a-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:o(function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},"parseError"),parse:o(function(t){var n=this,e=[0],i=[],s=[null],r=[],a=this.table,c="",l=0,h=0,u=r.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(y.yy[p]=this.yy[p]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var d=f.yylloc;r.push(d);var g=f.options&&f.options.ranges;function _(){var t;return"number"!=typeof(t=i.pop()||f.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){e.length=e.length-2*t,s.length=s.length-t,r.length=r.length-t},"popStack"),o(_,"lex");for(var m,x,k,v,b,w,S,L,E={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(b in L=[],a[x])this.terminals_[b]&&b>2&&L.push("'"+this.terminals_[b]+"'");A=f.showPosition?"Parse error on line "+(l+1)+":\n"+f.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:d,expected:L})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),s.push(f.yytext),r.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,c=f.yytext,l=f.yylineno,d=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],E.$=s[s.length-w],E._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[c,h,l,y.yy,k[1],s,r].concat(u))))return v;w&&(e=e.slice(0,-1*w*2),s=s.slice(0,-1*w),r=r.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),s.push(E.$),r.push(E._$),S=a[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0},"parse")},r=function(){return{EOF:1,parseError:o(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:o(function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=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),e.length-1&&(this.yylineno-=e.length-1);var s=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:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:o(function(t,n){var e,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((e=this._input.match(this.rules[s[r]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,s[r])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,n,e,i){switch(e){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=r,o(a,"Parser"),a.prototype=s,s.Parser=a,new a}();Q.parser=Q;var R=Q,B=[],K=[],Z=new Map,J=o(()=>{B=[],K=[],Z=new Map,u()},"clear"),H=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}static{o(this,"SankeyLink")}},tt=o((t,n,e)=>{B.push(new H(t,n,e))},"addLink"),nt=class{constructor(t){this.ID=t}static{o(this,"SankeyNode")}},et=o(t=>{t=f.sanitizeText(t,a());let n=Z.get(t);return void 0===n&&(n=new nt(t),Z.set(t,n),K.push(n)),n},"findOrCreateNode"),it=o(()=>K,"getNodes"),st=o(()=>B,"getLinks"),rt=o(()=>({nodes:K.map(t=>({id:t.ID})),links:B.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ot={nodesMap:Z,getConfig:o(()=>a().sankey,"getConfig"),getNodes:it,getLinks:st,getGraph:rt,addLink:tt,findOrCreateNode:et,getAccTitle:r,setAccTitle:s,getAccDescription:i,setAccDescription:e,getDiagramTitle:n,setDiagramTitle:t,clear:J},at=class t{static{o(this,"Uid")}static{this.count=0}static next(n){return new t(n+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},ct={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?g(t.sourceLinks,m)-1:0},justify:x},lt=o(function(t,n,e,i){const{securityLevel:s,sankey:r}=a(),u=c.sankey;let f;"sandbox"===s&&(f=l("#i"+n));const d=l("sandbox"===s?f.nodes()[0].contentDocument.body:"body"),g="sandbox"===s?d.select(`[id="${n}"]`):l(`[id="${n}"]`),_=r?.width??u.width,m=r?.height??u.width,x=r?.useMaxWidth??u.useMaxWidth,k=r?.nodeAlignment??u.nodeAlignment,v=r?.prefix??u.prefix,b=r?.suffix??u.suffix,w=r?.showValues??u.showValues,S=i.db.getGraph(),L=ct[k];I().nodeId(t=>t.id).nodeWidth(10).nodePadding(10+(w?15:0)).nodeAlign(L).extent([[0,0],[_,m]])(S);const E=y(p);g.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=at.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>E(t.id));const A=o(({id:t,value:n})=>w?`${t}\n${v}${Math.round(100*n)/100}${b}`:t,"getText");g.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(S.nodes).join("text").attr("x",t=>t.x0<_/2?t.x1+6:t.x0-6).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",t=>t.x0<_/2?"start":"end").text(A);const M=g.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),j=r?.linkColor??"gradient";if("gradient"===j){const t=M.append("linearGradient").attr("id",t=>(t.uid=at.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>E(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>E(t.target.id))}let T;switch(j){case"gradient":T=o(t=>t.uid,"coloring");break;case"source":T=o(t=>E(t.source.id),"coloring");break;case"target":T=o(t=>E(t.target.id),"coloring");break;default:T=j}M.append("path").attr("d",V().source(X).target(Y)).attr("stroke",T).attr("stroke-width",t=>Math.max(1,t.width)),h(void 0,g,0,x)},"draw"),ht={draw:lt},ut=o(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),ft=o(t=>`.label {\n font-family: ${t.fontFamily};\n }`,"getStyles"),yt=R.parse.bind(R);R.parse=t=>yt(ut(t));var pt={styles:ft,parser:R,db:ot,renderer:ht};export{pt as diagram};
|