@marimo-team/frontend 0.25.2-dev0 → 0.25.2-dev10

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 (133) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-DJ5jwKfp.js → ConnectedDataExplorerComponent-BFDHLGyp.js} +1 -1
  2. package/dist/assets/{ErrorBoundary-BeE1cdgM.js → ErrorBoundary-CtGZ1MAN.js} +2 -2
  3. package/dist/assets/{LazyAnyLanguageCodeMirror-B_IYTCX5.js → LazyAnyLanguageCodeMirror-CaEYnB8x.js} +2 -2
  4. package/dist/assets/{RunButton-C2kFUhyO.js → RunButton-YN1KKz4a.js} +1 -1
  5. package/dist/assets/{abnfDiagram-VCTEODGH-CSPJSGaM.js → abnfDiagram-VCTEODGH-CqPJWAgx.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-BFgdVPaN.js → add-cell-with-ai-Dceg80EG.js} +1 -1
  7. package/dist/assets/{agent-panel-Dh7yWh9P.js → agent-panel-CEG8eS3F.js} +1 -1
  8. package/dist/assets/{ai-model-dropdown-DJ2elMLM.js → ai-model-dropdown-SOxGsjRY.js} +1 -1
  9. package/dist/assets/{alert-dialog-CeE3i3Qa.js → alert-dialog-BsB0FYEL.js} +1 -1
  10. package/dist/assets/{any-language-editor-Cj_HzlZY.js → any-language-editor-b9spizfh.js} +1 -1
  11. package/dist/assets/{app-config-button-DBCTefOX.js → app-config-button-CTTg_TIX.js} +1 -1
  12. package/dist/assets/{architectureDiagram-5GKGNRK7-7iukRoC9.js → architectureDiagram-5GKGNRK7-DXjBUUE6.js} +1 -1
  13. package/dist/assets/{blockDiagram-I7D4REHJ-cuhpQB60.js → blockDiagram-I7D4REHJ-DS6I1u-N.js} +1 -1
  14. package/dist/assets/{button-BoklZTGL.js → button-qFeU84ax.js} +1 -1
  15. package/dist/assets/{cache-panel-C0oB1kE2.js → cache-panel-Ct9EFgP7.js} +1 -1
  16. package/dist/assets/{capabilities-Bj3s1hGN.js → capabilities-BqUNf14U.js} +1 -1
  17. package/dist/assets/{cells-CzugpTQu.js → cells-CU9huD49.js} +1 -1
  18. package/dist/assets/{chat-display-DevO4F8W.js → chat-display-DWPnai8M.js} +1 -1
  19. package/dist/assets/{chat-panel-BGw0bqDk.js → chat-panel-DGnu6v96.js} +1 -1
  20. package/dist/assets/{chat-ui-CZZFGlZi.js → chat-ui-BqLN7iW4.js} +1 -1
  21. package/dist/assets/{chunk-IMKFNOWR-BIILwBhp.js → chunk-IMKFNOWR-s8kQsL8K.js} +1 -1
  22. package/dist/assets/{chunk-SHT3W25Y-BtLGdeDB.js → chunk-SHT3W25Y-CM7-8w1-.js} +1 -1
  23. package/dist/assets/{chunk-SVP7TREG-B0UfxhUP.js → chunk-SVP7TREG-BErtDMhh.js} +1 -1
  24. package/dist/assets/{chunk-TICWLB2K-BP7vel_P.js → chunk-TICWLB2K-CGVR3aYq.js} +1 -1
  25. package/dist/assets/{circle-CeQt3rdW.js → circle-CzTMKZwz.js} +1 -1
  26. package/dist/assets/{classDiagram-ZZMXUADV-CoNXKNMZ.js → classDiagram-ZZMXUADV-isldMhyu.js} +1 -1
  27. package/dist/assets/{classDiagram-v2-VYDZK3BY-CoNXKNMZ.js → classDiagram-v2-VYDZK3BY-isldMhyu.js} +1 -1
  28. package/dist/assets/{code-visibility-BFNYI7hr.js → code-visibility-BGq9NyQN.js} +1 -1
  29. package/dist/assets/{command-palette-DN4JoOLD.js → command-palette-CyBHUvlK.js} +1 -1
  30. package/dist/assets/{common-DUCPhoyP.js → common-CdJQaC_v.js} +1 -1
  31. package/dist/assets/{components-CK7CeYlo.js → components-DsJLlugL.js} +1 -1
  32. package/dist/assets/{components-DAmFBASm.js → components-zfCkpDjF.js} +1 -1
  33. package/dist/assets/{config-B4VJJibu.js → config-2Nts63h2.js} +1 -1
  34. package/dist/assets/{config-BxZgoFvi.js → config-BdH5RvM0.js} +1 -1
  35. package/dist/assets/{config-DpGPGznL.js → config-D7CP5wR5.js} +1 -1
  36. package/dist/assets/{copy-BhJktFeI.js → copy-B--GzTEX.js} +1 -1
  37. package/dist/assets/{copy-icon-DFhUGBjO.js → copy-icon-DQuttmjH.js} +1 -1
  38. package/dist/assets/{createReducer-BPvK7C_R.js → createReducer-CI8rlZE9.js} +1 -1
  39. package/dist/assets/{cynefinDiagram-5FMLGOSQ-BARZRQBb.js → cynefinDiagram-5FMLGOSQ-B7iZDq2a.js} +1 -1
  40. package/dist/assets/{dagre-DVyyr7Cb.js → dagre-DkKsNZNe.js} +1 -1
  41. package/dist/assets/{dagre-GXQ25YYZ-79s0lOP0.js → dagre-GXQ25YYZ-CLT8-BB_.js} +1 -1
  42. package/dist/assets/{data-grid-overlay-editor-DPfnIudL.js → data-grid-overlay-editor-Bt4aaHfB.js} +1 -1
  43. package/dist/assets/{dependency-graph-panel-BN4CLayU.js → dependency-graph-panel-DPFdz5rd.js} +1 -1
  44. package/dist/assets/{diagram-S7CK7UJ4-BCviGhvd.js → diagram-S7CK7UJ4-SuzEYncV.js} +1 -1
  45. package/dist/assets/{diagram-UQ7AKVKN-Ds-BT46T.js → diagram-UQ7AKVKN-cuBTTzq8.js} +1 -1
  46. package/dist/assets/{diagram-VX7I27RA-BtL2eh0t.js → diagram-VX7I27RA-h6SkZKIl.js} +1 -1
  47. package/dist/assets/{diagram-Z3DM3KII-C6SmbLBS.js → diagram-Z3DM3KII-C-Vebae0.js} +1 -1
  48. package/dist/assets/{dist-CyYN7zJg.js → dist-DFI04FfI.js} +1 -1
  49. package/dist/assets/{documentation-panel-CzRbXV5u.js → documentation-panel-YTTKKIe_.js} +1 -1
  50. package/dist/assets/{dropdown-menu-VuyoeQOD.js → dropdown-menu-Crx6knLg.js} +1 -1
  51. package/dist/assets/{ebnfDiagram-PWID7BFC-D_JU4cMQ.js → ebnfDiagram-PWID7BFC-Bm_qbW1t.js} +1 -1
  52. package/dist/assets/{edit-page-jGNYBqQo.js → edit-page-CWbb1Sdk.js} +45 -45
  53. package/dist/assets/{erDiagram-RLTQ6QDP-Z9MJ6X-r.js → erDiagram-RLTQ6QDP-Dwwt91bq.js} +1 -1
  54. package/dist/assets/{error-entries-CDSsy76p.js → error-entries-DvgFKvod.js} +1 -1
  55. package/dist/assets/{error-panel-ABvjFG3p.js → error-panel-D1XBOiHc.js} +1 -1
  56. package/dist/assets/{feedback-button-CZhLiwkO.js → feedback-button-CXjDdARJ.js} +1 -1
  57. package/dist/assets/{file-explorer-panel-DTiEpmVE.js → file-explorer-panel-BKJMBA3O.js} +1 -1
  58. package/dist/assets/{file-name-input-C1C8xrjA.js → file-name-input-Bd3Q-WUK.js} +1 -1
  59. package/dist/assets/{filename-fxG7K_MU.js → filename-rhW-R6K2.js} +1 -1
  60. package/dist/assets/{flowDiagram-HODETNUW-ncLciK2K.js → flowDiagram-HODETNUW-CqLwY5NX.js} +1 -1
  61. package/dist/assets/{fullscreen-BmzAqMKq.js → fullscreen-3wS6IaIC.js} +1 -1
  62. package/dist/assets/{gallery-page-Moi4ZdJ0.js → gallery-page-CrkxyZTA.js} +1 -1
  63. package/dist/assets/{glide-data-editor-CbsCWu-K.js → glide-data-editor-B5WqL5gm.js} +4 -4
  64. package/dist/assets/{graphlib-3maKwbRO.js → graphlib-6Yb0YQgW.js} +1 -1
  65. package/dist/assets/has-B4C7ywdy.js +1 -0
  66. package/dist/assets/{home-page-UAgVOkCZ.js → home-page-BNKKAvoF.js} +1 -1
  67. package/dist/assets/{index-DafnX1Xx.js → index-C9FPQNuH.js} +8 -8
  68. package/dist/assets/{infoDiagram-27XIBGKW-Dk8U81nJ.js → infoDiagram-27XIBGKW-dRXMROiS.js} +1 -1
  69. package/dist/assets/{input-BDakodZ2.js → input-D4bMj5Nb.js} +1 -1
  70. package/dist/assets/{ishikawaDiagram-5VMMS53U-CzHQlMUQ.js → ishikawaDiagram-5VMMS53U-CvBCDJJe.js} +1 -1
  71. package/dist/assets/{kanban-definition-UXKFOSKX-CVyVYiI6.js → kanban-definition-UXKFOSKX-fIKpyolW.js} +1 -1
  72. package/dist/assets/{logs-panel-Bz5ysVX4.js → logs-panel-adAvx6o3.js} +1 -1
  73. package/dist/assets/{menu-items-BBdeXCvU.js → menu-items-D-vbZmqL.js} +1 -1
  74. package/dist/assets/{mermaid-D_jPUVqz.js → mermaid-DpSqZGNM.js} +4 -4
  75. package/dist/assets/{mindmap-definition-YA3MSWOX-D5t6Aq5Z.js → mindmap-definition-YA3MSWOX-B95LGKLt.js} +1 -1
  76. package/dist/assets/{number-overlay-editor-FAD8sjFU.js → number-overlay-editor-Bs5xzKX-.js} +1 -1
  77. package/dist/assets/{numbers-DsgsDslU.js → numbers-DyJNv6Vk.js} +1 -1
  78. package/dist/assets/{outline-panel-85oiQ0XX.js → outline-panel-B9u6Wgol.js} +1 -1
  79. package/dist/assets/{packages-panel-ClKIaP5S.js → packages-panel-D-g71io7.js} +1 -1
  80. package/dist/assets/{panels-B48zp96D.js → panels-C5xQNcZv.js} +3 -3
  81. package/dist/assets/{pegDiagram-XKGWAZYB-BTkTm4ej.js → pegDiagram-XKGWAZYB-CMaSc5Ln.js} +1 -1
  82. package/dist/assets/{pieDiagram-E7YTZNPT-Bq6X88M1.js → pieDiagram-E7YTZNPT-CZY0tLgh.js} +1 -1
  83. package/dist/assets/{process-output-Cg2ta3vY.js → process-output-CpF79y4D.js} +1 -1
  84. package/dist/assets/{railroadDiagram-O6MQD6OU-fv8HXW_g.js → railroadDiagram-O6MQD6OU-BSMijs6s.js} +1 -1
  85. package/dist/assets/{requirementDiagram-BXWQKSXE-DDOOMUfC.js → requirementDiagram-BXWQKSXE-DjzkUUZk.js} +1 -1
  86. package/dist/assets/{reveal-component-CR43gpTZ.js → reveal-component-ZyDayfDQ.js} +1 -1
  87. package/dist/assets/{run-page-NR_KFWk8.js → run-page-Ba_64fL5.js} +1 -1
  88. package/dist/assets/{scratchpad-panel-DHc-oVb1.js → scratchpad-panel-7bxRkpPb.js} +1 -1
  89. package/dist/assets/{scroll-to-bottom-button-BSCkDXet.js → scroll-to-bottom-button-BLNi0TGS.js} +1 -1
  90. package/dist/assets/{secrets-panel-C-65ZjnM.js → secrets-panel-DmKgIV5x.js} +1 -1
  91. package/dist/assets/{select-BplWpfFo.js → select-CWHHoM53.js} +1 -1
  92. package/dist/assets/{sequenceDiagram-WJ2MYXX4-DdpBhQaS.js → sequenceDiagram-WJ2MYXX4-Dp7JdkJ6.js} +1 -1
  93. package/dist/assets/{session-panel-DiwQqIbt.js → session-panel-D9qVJogC.js} +1 -1
  94. package/dist/assets/{session-DXKMv4Bs.js → session-ztCnZJHI.js} +1 -1
  95. package/dist/assets/{snippets-panel-BLmXrneD.js → snippets-panel-QdZvjlBm.js} +1 -1
  96. package/dist/assets/{state-Ozzur_f2.js → state-0NZOvqJz.js} +1 -1
  97. package/dist/assets/{stateDiagram-D77RDMKH-D3p19fac.js → stateDiagram-D77RDMKH-CR5QDK_-.js} +1 -1
  98. package/dist/assets/{stateDiagram-v2-MP3YSRHH-CplsDaDl.js → stateDiagram-v2-MP3YSRHH-BmMYN-vz.js} +1 -1
  99. package/dist/assets/{strings-BHZPE0Mc.js → strings-LjhpYwmx.js} +1 -1
  100. package/dist/assets/{swimlanes-42K2YHIH-CLxCSvU4.js → swimlanes-42K2YHIH-By_1jYHM.js} +1 -1
  101. package/dist/assets/{swimlanesDiagram-VR7AAH4N-DPoIFx8T.js → swimlanesDiagram-VR7AAH4N-DjMyvNFc.js} +1 -1
  102. package/dist/assets/{swiper-component-rqJChT_P.js → swiper-component-Cbtej5b-.js} +1 -1
  103. package/dist/assets/{terminal-CY4h1UmO.js → terminal-Ri8br8XX.js} +1 -1
  104. package/dist/assets/{timeline-definition-24CTP7MA-Cw2PY--x.js → timeline-definition-24CTP7MA-BjNxu6yh.js} +1 -1
  105. package/dist/assets/{toast-KNfsFUiB.js → toast-DXkezxWI.js} +1 -1
  106. package/dist/assets/{tooltip-PLkI_UfK.js → tooltip-BQ9qHrrN.js} +1 -1
  107. package/dist/assets/{tooltip-DR2Z2N4w.js → tooltip-CamoSiGF.js} +1 -1
  108. package/dist/assets/{tracing-Q8NAdlrA.js → tracing-BxMH9HGb.js} +1 -1
  109. package/dist/assets/{tracing-panel-Ci4kY4dr.js → tracing-panel-EeL3md5x.js} +2 -2
  110. package/dist/assets/{use-restore-focus-B98SEiGc.js → use-restore-focus-D0UtBPD6.js} +1 -1
  111. package/dist/assets/{useCellActionButton-DpYtVfFe.js → useCellActionButton-Di4NkDbT.js} +1 -1
  112. package/dist/assets/{useEventListener-BdZUApHd.js → useEventListener-CUPWI_1X.js} +1 -1
  113. package/dist/assets/{useInterval-ChchS0Rl.js → useInterval-DluQa5sq.js} +1 -1
  114. package/dist/assets/{useTheme-DcnXlv0_.js → useTheme-CnWB5G1X.js} +1 -1
  115. package/dist/assets/{vega-component-BpoSew4K.js → vega-component-DGTXJwmx.js} +1 -1
  116. package/dist/assets/{vega-embed-container-BOJG8mCA.js → vega-embed-container-Din5FYpB.js} +1 -1
  117. package/dist/assets/{vennDiagram-4TSXK5OY-D8bN6lVl.js → vennDiagram-4TSXK5OY-BR66J2hx.js} +1 -1
  118. package/dist/assets/{wardleyDiagram-VM6X3IG4-CbZdo0SA.js → wardleyDiagram-VM6X3IG4-Kg0-lASD.js} +1 -1
  119. package/dist/assets/{write-secret-modal-BiG2tahJ.js → write-secret-modal-wFgr-1dA.js} +1 -1
  120. package/dist/assets/{xychartDiagram-S5SC5T6Z-DUUQ9tau.js → xychartDiagram-S5SC5T6Z-BSXFWSRW.js} +1 -1
  121. package/dist/assets/{youtube-A9VT7NHb.js → youtube-Ck_NlGi9.js} +1 -1
  122. package/dist/index.html +31 -31
  123. package/package.json +7 -7
  124. package/src/components/data-table/range-focus/__tests__/atoms.test.ts +11 -11
  125. package/src/components/editor/actions/__tests__/useSetOutputsExpanded.test.ts +42 -0
  126. package/src/components/editor/actions/useNotebookActions.tsx +20 -0
  127. package/src/components/editor/actions/useSetOutputsExpanded.ts +67 -0
  128. package/src/components/tracing/tracing.test.tsx +30 -30
  129. package/src/core/edit-app.tsx +16 -0
  130. package/src/core/hotkeys/hotkeys.ts +12 -0
  131. package/src/plugins/impl/FileBrowserPlugin.tsx +45 -15
  132. package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +85 -2
  133. package/dist/assets/has-cJsIKK9t.js +0 -1
@@ -1,4 +1,4 @@
1
- import{g as e,p as t}from"./chunk-75Z2AOVW-BzzYECN7.js";import{u as n}from"./src-BpnPuKEN.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as i}from"./src-Cyu5G-Tr.js";import{A as a,F as o,G as s,H as c,K as l,O as u,U as d,a as f,b as p,c as m,i as h,r as g,s as _,v,w as y,x as b,y as x,z as S}from"./chunk-DU6HZSFF-BlpgvKzl.js";import{t as C}from"./dist-CeoU7cfW.js";import{a as w,i as T}from"./mermaid-D_jPUVqz.js";import{a as E,c as D,i as O,n as k,r as A,s as j}from"./chunk-F27PBJKO-BVIgLGPF.js";import{t as M}from"./chunk-2Q5K7J3B-C1jixKkw.js";var N=C(),P=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],L=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1))}},`anonymous`),table:[{3:1,4:t,5:n,6:i},{1:[3]},{3:5,4:t,5:n,6:i},{3:6,4:t,5:n,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),e(I,[2,6]),e(I,[2,16]),e(ve,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(ye,a,{7:120}),e(ye,a,{7:121}),e(ye,a,{7:122}),e(be,a,{41:123,7:124}),e(xe,a,{43:125,7:126}),e(xe,a,{7:126,43:127}),e(Se,a,{46:128,7:129}),e(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(Ce,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ve,[2,11]),{13:186,51:D,53:O,54:k},e(ve,[2,13]),e(ve,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ve,[2,12]),e(be,a,{7:124,41:201}),e(xe,a,{7:126,43:202}),e(Se,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(Ce,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,p as t}from"./chunk-75Z2AOVW-BzzYECN7.js";import{u as n}from"./src-BpnPuKEN.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as i}from"./src-Cyu5G-Tr.js";import{A as a,F as o,G as s,H as c,K as l,O as u,U as d,a as f,b as p,c as m,i as h,r as g,s as _,v,w as y,x as b,y as x,z as S}from"./chunk-DU6HZSFF-BlpgvKzl.js";import{t as C}from"./dist-CeoU7cfW.js";import{a as w,i as T}from"./mermaid-DpSqZGNM.js";import{a as E,c as D,i as O,n as k,r as A,s as j}from"./chunk-F27PBJKO-BVIgLGPF.js";import{t as M}from"./chunk-2Q5K7J3B-C1jixKkw.js";var N=C(),P=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],L=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1))}},`anonymous`),table:[{3:1,4:t,5:n,6:i},{1:[3]},{3:5,4:t,5:n,6:i},{3:6,4:t,5:n,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),e(I,[2,6]),e(I,[2,16]),e(ve,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(ye,a,{7:120}),e(ye,a,{7:121}),e(ye,a,{7:122}),e(be,a,{41:123,7:124}),e(xe,a,{43:125,7:126}),e(xe,a,{7:126,43:127}),e(Se,a,{46:128,7:129}),e(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(Ce,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ve,[2,11]),{13:186,51:D,53:O,54:k},e(ve,[2,13]),e(ve,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ve,[2,12]),e(be,a,{7:124,41:201}),e(xe,a,{7:126,43:202}),e(Se,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(Ce,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),a.push(h.yytext),o.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};we.lexer=(function(){return{EOF:1,parseError:r(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:r(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:r(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},`input`),unput:r(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:r(function(){return this._more=!0,this},`more`),reject:r(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},`reject`),less:r(function(e){this.unput(this.match.slice(e))},`less`),pastInput:r(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:r(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:r(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,u as i}from"./useEvent-Dc9HkKI2.js";import{t as a}from"./react-CUdNIagt.js";import{$r as o,Ai as s,Bi as c,Bt as l,Cn as u,D as d,Gn as f,Ha as p,Hi as m,Ii as h,Ji as g,Ki as _,Kn as v,Li as y,M as b,Mi as x,P as S,Qr as C,Ri as w,Rn as T,Rt as E,Ui as D,Wa as O,Wi as k,Xi as A,Yi as j,Zi as M,_n as ee,c as N,fn as P,gn as F,i as I,jn as L,qi as R,qn as z,ro as te,ti as ne,to as B,yr as V,yt as H,zi as U}from"./cells-CzugpTQu.js";import{t as W}from"./compiler-runtime-BQ9S8nyo.js";import{s as re}from"./config-BxZgoFvi.js";import{O as G}from"./config-DpGPGznL.js";import{t as K}from"./ErrorBoundary-BeE1cdgM.js";import{t as ie}from"./cn-ldLVeaqm.js";import{t as q}from"./jsx-runtime-B74pBk57.js";import{r as ae}from"./config-B4VJJibu.js";import{t as oe}from"./tooltip-DR2Z2N4w.js";import{r as se,t as ce}from"./button-BoklZTGL.js";import{t as le}from"./createLucideIcon-rHn2EdoM.js";import{i as J}from"./paths-CzfpItSz.js";import{r as ue}from"./useNumberFormatter-C4-_TnkF.js";import{R as de,j as fe}from"./RunButton-C2kFUhyO.js";import{a as pe}from"./input-BDakodZ2.js";import{t as me}from"./copy-icon-DFhUGBjO.js";import{l as he}from"./arrays-BqUx5USx.js";import{i as ge}from"./strings-BHZPE0Mc.js";import{r as _e}from"./requests-yTHMxhVa.js";import{t as ve}from"./context-BFOBKCJB.js";import{n as ye}from"./useAsyncData-DucTwMkf.js";import{$t as be,An as xe,E as Se,Jt as Ce,Mn as we,Nn as Te,O as Ee,On as De,Qt as Oe,Sn as ke,Xt as Ae,Yt as je,Zt as Me,_n as Ne,b as Pe,bn as Fe,g as Ie,in as Le,jn as Re,kn as ze,la as Be,nn as Ve,nr as He,vn as Ue,xn as We,yn as Ge}from"./index-DafnX1Xx.js";import{t as Ke}from"./empty-state-CzxjZqGW.js";import{n as qe,t as Je}from"./common-DUCPhoyP.js";import{a as Ye,i as Xe,n as Ze,o as Qe,r as $e,s as et,t as tt}from"./components-CK7CeYlo.js";var nt=le(`square-equal`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 10h10`,key:`1101jm`}],[`path`,{d:`M7 14h10`,key:`1mhdw3`}]]),Y=W(),X=e(a(),1),Z=q(),rt=1;function it(e){return 1.75+e*rt}function at(e){return 3+e*rt}function ot(e){return 3.25+e*rt}var Q={engineEmpty:.75,engine:.75,database:1,tableLoading:2.75,tableSchemaless:2,columnLocal:1.25,columnPreview:2.5};function $(e){return{paddingLeft:`${e}rem`}}var st=n(e=>{let t=e(w),n=e(ne),r=e(I);return he(t,e=>{if(!e.variable_name)return-1;let t=Object.values(n).find(t=>t.name===e.variable_name);if(!t)return 0;let i=r.inOrderIds.indexOf(t.declaredBy[0]);return i===-1?0:i})}),ct=G(`marimo:datasources:hideEmpty`,!1,C,{getOnInit:!0});function lt(e){let t=!1,n=[];for(let r of e){if(!k(r)||!m(r)){n.push(r);continue}let e=r.child_schemas??[],i=lt(e);if(r.tables.length===0&&i.length===0){t=!0;continue}if(i===e){n.push(r);continue}t=!0,n.push({...r,child_schemas:i})}return t?n:e}function ut(e){let t=!1,n=[];for(let r of e){if(D(r)&&r.schemas.length===0){t=!0;continue}if(r.schemas.length===0){n.push(r);continue}let e=lt(r.schemas);if(e.length===0){t=!0;continue}if(e===r.schemas){n.push(r);continue}t=!0,n.push({...r,schemas:e})}return t?n:e}var dt=()=>{let e=(0,Y.c)(42),[n,a]=X.useState(``),[o,s]=t(ct),c=i(y),l=r(st),d=r(x),f;bb0:{if(!o){f=d;break bb0}let t,n;e[0]===d?(t=e[1],n=e[2]):(t=!1,n=d.map(e=>{let n=ut(e.databases);return n===e.databases?e:(t=!0,{...e,databases:n})}),e[0]=d,e[1]=t,e[2]=n),f=t?n:d}let p=f;if(l.length===0&&p.length===0){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Ke,{title:`No tables found`,description:`Any datasets/dataframes in the global scope will be shown here.`,action:(0,Z.jsx)(Qe,{group:`database`,label:`Add database or catalog`,variant:`outline`,size:`sm`}),icon:(0,Z.jsx)(J,{})}),e[3]=t):t=e[3],t}let m;e[4]===n?m=e[5]:(m=n.trim(),e[4]=n,e[5]=m);let h=!!m,g;e[6]===c?g=e[7]:(g=e=>{c(e.length>0),a(e)},e[6]=c,e[7]=g);let _;e[8]!==n||e[9]!==g?(_=(0,Z.jsx)(F,{placeholder:`Search tables...`,className:`h-6 m-1`,value:n,onValueChange:g,rootClassName:`flex-1 border-r border-b-0`}),e[8]=n,e[9]=g,e[10]=_):_=e[10];let v;e[11]===h?v=e[12]:(v=h&&(0,Z.jsx)(`button`,{type:`button`,className:`float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,onClick:()=>a(``),children:(0,Z.jsx)(ue,{className:`h-4 w-4`})}),e[11]=h,e[12]=v);let b=!o,S;e[13]!==o||e[14]!==s?(S=()=>s(!o),e[13]=o,e[14]=s,e[15]=S):S=e[15];let C;e[16]!==b||e[17]!==S?(C=(0,Z.jsx)(Le,{"data-testid":`datasources-hide-empty-button`,isVisible:b,onToggle:S,showTooltip:`Show empty schemas and databases`,hideTooltip:`Hide empty schemas and databases`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[16]=b,e[17]=S,e[18]=C):C=e[18];let w;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Qe,{group:`database`,label:`Add database or catalog`,compact:!0,variant:`ghost`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[19]=w):w=e[19];let T;e[20]!==_||e[21]!==v||e[22]!==C?(T=(0,Z.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[_,v,C,w]}),e[20]=_,e[21]=v,e[22]=C,e[23]=T):T=e[23];let E;if(e[24]!==p||e[25]!==n){let t;e[27]===n?t=e[28]:(t=e=>(0,Z.jsx)(ft,{connection:e,hasChildren:e.databases.length>0,children:e.databases.map(t=>(0,Z.jsx)(gt,{connection:e,database:t,searchValue:n},t.name))},e.name),e[27]=n,e[28]=t),E=p.map(t),e[24]=p,e[25]=n,e[26]=E}else E=e[26];let D;e[29]!==p.length||e[30]!==l.length?(D=p.length>0&&l.length>0&&(0,Z.jsxs)(je,{className:`pr-2`,style:$(Q.engine),children:[(0,Z.jsx)(Ee,{className:`h-4 w-4 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`text-xs`,children:`Python`})]}),e[29]=p.length,e[30]=l.length,e[31]=D):D=e[31];let O;e[32]!==n||e[33]!==l?(O=l.length>0&&(0,Z.jsx)(bt,{tables:l,searchValue:n}),e[32]=n,e[33]=l,e[34]=O):O=e[34];let k;e[35]!==E||e[36]!==D||e[37]!==O?(k=(0,Z.jsxs)(u,{className:`flex flex-col`,children:[E,D,O]}),e[35]=E,e[36]=D,e[37]=O,e[38]=k):k=e[38];let A;return e[39]!==k||e[40]!==T?(A=(0,Z.jsxs)(P,{className:`border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden`,shouldFilter:!1,children:[T,k]}),e[39]=k,e[40]=T,e[41]=A):A=e[41],A},ft=e=>{let t=(0,Y.c)(26),{connection:n,children:r,hasChildren:i}=e,a=n.name===M,o=a?`In-Memory`:n.name,{previewDataSourceConnection:c}=_e(),l;t[0]!==n.name||t[1]!==c?(l=async()=>{await c({engine:n.name})},t[0]=n.name,t[1]=c,t[2]=l):l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=$(Q.engine),t[3]=d):d=t[3];let f;t[4]===n.dialect?f=t[5]:(f=(0,Z.jsx)(L,{className:`h-4 w-4 text-muted-foreground`,name:n.dialect}),t[4]=n.dialect,t[5]=f);let p;t[6]===n.dialect?p=t[7]:(p=s(n.dialect),t[6]=n.dialect,t[7]=p);let m;t[8]===p?m=t[9]:(m=(0,Z.jsx)(`span`,{className:`text-xs`,children:p}),t[8]=p,t[9]=m);let h=o,g;t[10]===h?g=t[11]:(g=(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,(0,Z.jsx)(et,{variableName:h}),`)`]}),t[10]=h,t[11]=g);let _;t[12]!==u||t[13]!==a?(_=!a&&(0,Z.jsx)(Ve,{onClick:u,tooltip:`Refresh connection`,className:`ml-auto h-4 p-0`,iconClassName:`h-3.5 w-3.5`}),t[12]=u,t[13]=a,t[14]=_):_=t[14];let v;t[15]!==f||t[16]!==m||t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(je,{className:`pr-2`,style:d,children:[f,m,g,_]}),t[15]=f,t[16]=m,t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==r||t[21]!==i?(y=i?r:(0,Z.jsx)(Ae,{content:`No databases available`,style:$(Q.engineEmpty)}),t[20]=r,t[21]=i,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==v?(b=(0,Z.jsxs)(Z.Fragment,{children:[v,y]}),t[23]=y,t[24]=v,t[25]=b):b=t[25],b},pt=X.createContext(null);function mt(){let e=X.useContext(pt);if(e==null)throw Error(`useDataSourceTree must be used within a DataSourceTreeContext.Provider`);return e}function ht(e,{schema:t,schemaPath:n}){return{engine:e.engineName,database:e.databaseName,schema:t,schemaPath:n,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,dialect:e.dialect}}var gt=e=>{let t=(0,Y.c)(21),{connection:n,database:r,searchValue:i}=e,a;t[0]!==n.default_database||t[1]!==n.default_schema||t[2]!==n.dialect||t[3]!==n.name||t[4]!==r.name||t[5]!==i?(a={engineName:n.name,databaseName:r.name,dialect:n.dialect,defaultSchema:n.default_schema,defaultDatabase:n.default_database,searchValue:i},t[0]=n.default_database,t[1]=n.default_schema,t[2]=n.dialect,t[3]=n.name,t[4]=r.name,t[5]=i,t[6]=a):a=t[6];let o=a,s=n.name,c=r.schemas,l;t[7]===r?l=t[8]:(l=D(r),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[9]=u):u=t[9];let d;t[10]!==r.schemas||t[11]!==l?(d=(0,Z.jsx)(vt,{schemas:c,schemasResolved:l,schemaPath:u,depth:0}),t[10]=r.schemas,t[11]=l,t[12]=d):d=t[12];let f;t[13]!==d||t[14]!==o?(f=(0,Z.jsx)(pt.Provider,{value:o,children:d}),t[13]=d,t[14]=o,t[15]=f):f=t[15];let p;return t[16]!==n.name||t[17]!==r||t[18]!==i||t[19]!==f?(p=(0,Z.jsx)(_t,{engineName:s,database:r,searchValue:i,children:f}),t[16]=n.name,t[17]=r,t[18]=i,t[19]=f,t[20]=p):p=t[20],p},_t=e=>{let t=(0,Y.c)(29),{searchValue:n,engineName:r,database:i,children:a}=e,o;t[0]!==i||t[1]!==n?(o=g(i,n),t[0]=i,t[1]=n,t[2]=o):o=t[2];let s=o,[c,l]=X.useState(s),[u,d]=X.useState(!1),[f,p]=X.useState(n),[m,h]=X.useState(s);(f!==n||m!==s)&&(p(n),h(s),l(s));let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=$(Q.database),t[3]=_):_=t[3];let v;t[4]!==c||t[5]!==u?(v=()=>{l(!c),d(!u)},t[4]=c,t[5]=u,t[6]=v):v=t[6];let y=`${r}:${i.name}`,b;t[7]===c?b=t[8]:(b=(0,Z.jsx)(be,{isExpanded:c}),t[7]=c,t[8]=b);let x=u&&c?`text-foreground`:`text-muted-foreground`,S;t[9]===x?S=t[10]:(S=ie(`h-4 w-4`,x),t[9]=x,t[10]=S);let C;t[11]===S?C=t[12]:(C=(0,Z.jsx)(J,{className:S}),t[11]=S,t[12]=C);let w=u&&c&&`font-semibold`,T;t[13]===w?T=t[14]:(T=ie(w),t[13]=w,t[14]=T);let E;t[15]===i.name?E=t[16]:(E=i.name===``?(0,Z.jsx)(`i`,{children:`Not connected`}):i.name,t[15]=i.name,t[16]=E);let D;t[17]!==T||t[18]!==E?(D=(0,Z.jsx)(`span`,{className:T,children:E}),t[17]=T,t[18]=E,t[19]=D):D=t[19];let O;t[20]!==D||t[21]!==v||t[22]!==y||t[23]!==b||t[24]!==C?(O=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:_,onSelect:v,value:y,children:[b,C,D]}),t[20]=D,t[21]=v,t[22]=y,t[23]=b,t[24]=C,t[25]=O):O=t[25];let k=c&&a,A;return t[26]!==O||t[27]!==k?(A=(0,Z.jsxs)(Z.Fragment,{children:[O,k]}),t[26]=O,t[27]=k,t[28]=A):A=t[28],A},vt=e=>{let{schemas:t,schemasResolved:n,depth:r}=e,i=mt(),{engineName:a,databaseName:o,searchValue:s}=i,{addSchemaList:c}=h(),l=Se(e.schemaPath),[u,d]=X.useState(!1),{isPending:p,error:m}=ye(async()=>{if(!n&&a){d(!0);try{let e=await f.request({engine:a,database:o,schemaPath:l});c({schemas:e.schemas??[],sqlSchemaContext:{engine:a,database:o,schemaPath:l}})}finally{d(!1)}}},[n,a,o,l]),g=$(it(r));return p||u?(0,Z.jsx)(Oe,{message:`Loading schemas...`,style:g}):m?(0,Z.jsx)(Me,{error:m,style:g}):t.length===0?(0,Z.jsx)(Ae,{content:`No schemas available`,style:g}):(0,Z.jsx)(Z.Fragment,{children:t.map(e=>_(e.name)?(0,Z.jsx)(bt,{tables:e.tables,tablesResolved:k(e),searchValue:s,sqlTableContext:ht(i,{schema:e.name,schemaPath:l})},e.name):(0,Z.jsx)(yt,{schema:e,schemaPath:[...l,e.name],depth:r},e.name))})},yt=e=>{let t=(0,Y.c)(41),{schema:n,schemaPath:r,depth:i}=e,a=mt(),{databaseName:o,searchValue:s}=a,c;t[0]!==n||t[1]!==s?(c=R(n,s),t[0]=n,t[1]=s,t[2]=c):c=t[2];let l=c,[u,d]=X.useState(l),[f,p]=X.useState(!1),[h,g]=X.useState(s),[_,v]=X.useState(l),y;t[3]===r?y=t[4]:(y=r.join(`.`),t[3]=r,t[4]=y);let b=`${o}:${y}`,x;t[5]===n.child_schemas?x=t[6]:(x=n.child_schemas??[],t[5]=n.child_schemas,t[6]=x);let S=x;(h!==s||_!==l)&&(g(s),v(l),d(l));let C;t[7]===i?C=t[8]:(C=$(it(i)),t[7]=i,t[8]=C);let w;t[9]!==u||t[10]!==f?(w=()=>{d(!u),p(!f)},t[9]=u,t[10]=f,t[11]=w):w=t[11];let T;t[12]===u?T=t[13]:(T=(0,Z.jsx)(be,{isExpanded:u}),t[12]=u,t[13]=T);let E=f&&u&&`text-foreground`,D;t[14]===E?D=t[15]:(D=ie(`h-4 w-4 text-muted-foreground`,E),t[14]=E,t[15]=D);let O;t[16]===D?O=t[17]:(O=(0,Z.jsx)(B,{className:D}),t[16]=D,t[17]=O);let A=f&&u&&`font-semibold`,j;t[18]===A?j=t[19]:(j=ie(A),t[18]=A,t[19]=j);let M;t[20]!==n.name||t[21]!==j?(M=(0,Z.jsx)(`span`,{className:j,children:n.name}),t[20]=n.name,t[21]=j,t[22]=M):M=t[22];let N;t[23]!==M||t[24]!==C||t[25]!==w||t[26]!==T||t[27]!==O||t[28]!==b?(N=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:C,onSelect:w,value:b,children:[T,O,M]}),t[23]=M,t[24]=C,t[25]=w,t[26]=T,t[27]=O,t[28]=b,t[29]=N):N=t[29];let P;t[30]!==S||t[31]!==i||t[32]!==u||t[33]!==n||t[34]!==r||t[35]!==s||t[36]!==a?(P=u&&(0,Z.jsxs)(Z.Fragment,{children:[(S.length>0||!m(n))&&(0,Z.jsx)(vt,{schemas:S,schemasResolved:m(n),schemaPath:r,depth:i+1}),(0,Z.jsx)(bt,{tables:n.tables,tablesResolved:k(n),searchValue:s,tableIndentRem:at(i),columnIndentRem:ot(i),sqlTableContext:ht(a,{schema:n.name,schemaPath:r})})]}),t[30]=S,t[31]=i,t[32]=u,t[33]=n,t[34]=r,t[35]=s,t[36]=a,t[37]=P):P=t[37];let F;return t[38]!==N||t[39]!==P?(F=(0,Z.jsxs)(Z.Fragment,{children:[N,P]}),t[38]=N,t[39]=P,t[40]=F):F=t[40],F},bt=e=>{let t=(0,Y.c)(31),{tables:n,sqlTableContext:r,searchValue:i,tablesResolved:a,tableIndentRem:o,columnIndentRem:s}=e,c=a===void 0||a,{addTableList:l}=h(),[u,d]=X.useState(!1),f;t[0]!==l||t[1]!==r||t[2]!==c?(f=async()=>{if(!c&&r){d(!0);let{engine:e,database:t,schema:n,schemaPath:i}=r,a=await z.request({engine:e,database:t,schema:n,schemaPath:i??[]});if(!a?.tables)throw d(!1),Error(`No tables available`);l({tables:a.tables,sqlTableContext:r}),d(!1)}},t[0]=l,t[1]=r,t[2]=c,t[3]=f):f=t[3];let p;t[4]!==r||t[5]!==c?(p=[c,r],t[4]=r,t[5]=c,t[6]=p):p=t[6];let{isPending:m,error:g}=ye(f,p),_=o??Q.tableLoading,v;t[7]===_?v=t[8]:(v=$(_),t[7]=_,t[8]=v);let y=v;if(m||u){let e;return t[9]===y?e=t[10]:(e=(0,Z.jsx)(Oe,{message:`Loading tables...`,style:y}),t[9]=y,t[10]=e),e}if(g){let e;return t[11]!==g||t[12]!==y?(e=(0,Z.jsx)(Me,{error:g,style:y}),t[11]=g,t[12]=y,t[13]=e):e=t[13],e}if(n.length===0){let e;return t[14]===y?e=t[15]:(e=(0,Z.jsx)(Ae,{content:`No tables found`,style:y}),t[14]=y,t[15]=e),e}let b;if(t[16]!==s||t[17]!==i||t[18]!==r||t[19]!==o||t[20]!==n){let e;t[22]===i?e=t[23]:(e=e=>!i||e.name.toLowerCase().includes(i.toLowerCase()),t[22]=i,t[23]=e);let a=n.filter(e),c;t[24]!==s||t[25]!==i||t[26]!==r||t[27]!==o?(c=e=>(0,Z.jsx)(xt,{table:e,sqlTableContext:r,isSearching:!!i,tableIndentRem:o,columnIndentRem:s},e.name),t[24]=s,t[25]=i,t[26]=r,t[27]=o,t[28]=c):c=t[28],b=a.map(c),t[16]=s,t[17]=i,t[18]=r,t[19]=o,t[20]=n,t[21]=b}else b=t[21];let x;return t[29]===b?x=t[30]:(x=(0,Z.jsx)(Z.Fragment,{children:b}),t[29]=b,t[30]=x),x},xt=e=>{let t=(0,Y.c)(69),{table:n,sqlTableContext:i,isSearching:a,tableIndentRem:o,columnIndentRem:s}=e,{addTable:c}=h(),[u,f]=X.useState(!1),p=n.columns.length>0,m;t[0]!==c||t[1]!==u||t[2]!==i||t[3]!==n.name||t[4]!==p?(m=async()=>{if(u&&!p&&i){let{engine:e,database:t,schema:r,schemaPath:a}=i,o=await v.request({engine:e,database:t,schema:r,tableName:n.name,schemaPath:a??[]});if(!o?.table)throw Error(`No table details available`);c({table:o.table,sqlTableContext:i})}},t[0]=c,t[1]=u,t[2]=i,t[3]=n.name,t[4]=p,t[5]=m):m=t[5];let g;t[6]!==u||t[7]!==p?(g=[u,p],t[6]=u,t[7]=p,t[8]=g):g=t[8];let{isFetching:_,isPending:y,error:b}=ye(m,g),x=r(re),S=E(),{createNewCell:C}=d(),w=Pe(),T;t[9]!==w||t[10]!==x||t[11]!==C||t[12]!==S||t[13]!==i||t[14]!==n?(T=()=>{l({autoInstantiate:x,createNewCell:C,fromCellId:S}),w((()=>{if(n.source_type===`catalog`){let e=i?.database?[i.database,...i.schemaPath??[],n.name].join(`.`):n.name;return`${n.engine}.load_table("${e}")`}if(i)return j({table:n,columnName:`*`,sqlTableContext:i});switch(n.source_type){case`local`:return`mo.ui.table(${n.name})`;case`duckdb`:case`connection`:return j({table:n,columnName:`*`,sqlTableContext:i});default:return ge(n.source_type),``}})())},t[9]=w,t[10]=x,t[11]=C,t[12]=S,t[13]=i,t[14]=n,t[15]=T):T=t[15];let D=T,k;t[16]!==n.num_columns||t[17]!==n.num_rows?(k=()=>{let e=[];return n.num_rows!=null&&e.push(`${n.num_rows} rows`),n.num_columns!=null&&e.push(`${n.num_columns} columns`),e.length===0?null:(0,Z.jsx)(`div`,{className:`flex flex-row gap-2 items-center pl-6 group-hover:hidden`,children:(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.join(`, `)})})},t[16]=n.num_columns,t[17]=n.num_rows,t[18]=k):k=t[18];let M=k,N;t[19]!==s||t[20]!==b||t[21]!==_||t[22]!==y||t[23]!==i||t[24]!==n?(N=()=>{let e=$(s??Q.tableLoading);if(y||_)return(0,Z.jsx)(Oe,{message:`Loading columns...`,style:e});if(b)return(0,Z.jsx)(Me,{error:b,style:e});let t=n.columns;return t.length===0?(0,Z.jsx)(Ae,{content:`No columns found`,style:e}):t.map(e=>(0,Z.jsx)(St,{table:n,column:e,sqlTableContext:i,columnIndentRem:s},e.name))},t[19]=s,t[20]=b,t[21]=_,t[22]=y,t[23]=i,t[24]=n,t[25]=N):N=t[25];let P=N,F;t[26]!==u||t[27]!==a||t[28]!==n.source_type||t[29]!==n.type?(F=()=>{if(n.source_type===`local`)return;let e=n.type===`table`?O:te;return(0,Z.jsx)(e,{className:`h-3 w-3`,strokeWidth:u||a?2.5:void 0})},t[26]=u,t[27]=a,t[28]=n.source_type,t[29]=n.type,t[30]=F):F=t[30];let I=F,L;t[31]!==i||t[32]!==n.name?(L=A(i,n.name),t[31]=i,t[32]=n.name,t[33]=L):L=t[33];let R=L,z=o??(i?Q.tableSchemaless:0),ne=(u||a)&&`font-semibold`,B;t[34]===ne?B=t[35]:(B=ie(`rounded-none group h-8 cursor-pointer`,ne),t[34]=ne,t[35]=B);let V;t[36]===z?V=t[37]:(V=$(z),t[36]=z,t[37]=V);let H;t[38]===u?H=t[39]:(H=()=>f(!u),t[38]=u,t[39]=H);let U;t[40]===I?U=t[41]:(U=I(),t[40]=I,t[41]=U);let W;t[42]===n.name?W=t[43]:(W=(0,Z.jsx)(`span`,{className:`text-sm`,children:n.name}),t[42]=n.name,t[43]=W);let G;t[44]!==U||t[45]!==W?(G=(0,Z.jsxs)(`div`,{className:`flex gap-2 items-center flex-1 pl-1`,children:[U,W]}),t[44]=U,t[45]=W,t[46]=G):G=t[46];let K;t[47]===M?K=t[48]:(K=M(),t[47]=M,t[48]=K);let q;t[49]===D?q=t[50]:(q=se.stopPropagation(()=>D()),t[49]=D,t[50]=q);let ae;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(Be,{className:`h-3 w-3`}),t[51]=ae):ae=t[51];let le;t[52]===q?le=t[53]:(le=(0,Z.jsx)(oe,{content:`Add table to notebook`,delayDuration:400,children:(0,Z.jsx)(ce,{className:`group-hover:inline-flex hidden`,variant:`text`,size:`icon`,onClick:q,children:ae})}),t[52]=q,t[53]=le);let J;t[54]!==u||t[55]!==V||t[56]!==H||t[57]!==G||t[58]!==K||t[59]!==le||t[60]!==B||t[61]!==R?(J=(0,Z.jsxs)(ee,{className:B,style:V,value:R,"aria-selected":u,forceMount:!0,onSelect:H,children:[G,K,le]}),t[54]=u,t[55]=V,t[56]=H,t[57]=G,t[58]=K,t[59]=le,t[60]=B,t[61]=R,t[62]=J):J=t[62];let ue;t[63]!==u||t[64]!==P?(ue=u&&P(),t[63]=u,t[64]=P,t[65]=ue):ue=t[65];let de;return t[66]!==J||t[67]!==ue?(de=(0,Z.jsxs)(Z.Fragment,{children:[J,ue]}),t[66]=J,t[67]=ue,t[68]=de):de=t[68],de},St=e=>{let t=(0,Y.c)(51),{table:n,column:a,sqlTableContext:o,columnIndentRem:s}=e,[l,u]=X.useState(!1),d=r(y),f=i(U);d&&l&&u(!1),f(l?e=>new Set([...e,`${n.name}:${a.name}`]):e=>(e.delete(`${n.name}:${a.name}`),new Set(e)));let p=Pe(),{columnsPreviews:m}=c(),h;t[0]!==a.name||t[1]!==n.primary_keys?(h=n.primary_keys?.includes(a.name)||!1,t[0]=a.name,t[1]=n.primary_keys,t[2]=h):h=t[2];let g=h,_;t[3]!==a.name||t[4]!==n.indexes?(_=n.indexes?.includes(a.name)||!1,t[3]=a.name,t[4]=n.indexes,t[5]=_):_=t[5];let v=_,b;t[6]===p?b=t[7]:(b=e=>{p(e)},t[6]=p,t[7]=b);let x=b,S=Ct,C=l?`font-semibold`:``,w;t[8]!==a.name||t[9]!==C?(w=(0,Z.jsx)(`span`,{className:C,children:a.name}),t[8]=a.name,t[9]=C,t[10]=w):w=t[10];let T=w,E=`${n.name}.${a.name}`,D=`${n.name}.${a.name}`,O;t[11]===l?O=t[12]:(O=()=>u(!l),t[11]=l,t[12]=O);let k;t[13]!==s||t[14]!==o?(k=s??(o?ot(0):Q.columnLocal),t[13]=s,t[14]=o,t[15]=k):k=t[15];let A;t[16]===k?A=t[17]:(A=$(k),t[16]=k,t[17]=A);let j;t[18]!==a.type||t[19]!==T?(j=(0,Z.jsx)(Ce,{columnName:T,dataType:a.type}),t[18]=a.type,t[19]=T,t[20]=j):j=t[20];let M;t[21]===g?M=t[22]:(M=g&&S({tooltipContent:`Primary key`,content:`PK`}),t[21]=g,t[22]=M);let N;t[23]===v?N=t[24]:(N=v&&S({tooltipContent:`Indexed`,content:`IDX`}),t[23]=v,t[24]=N);let P;t[25]!==A||t[26]!==j||t[27]!==M||t[28]!==N?(P=(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2 items-center flex-1`,style:A,children:[j,M,N]}),t[25]=A,t[26]=j,t[27]=M,t[28]=N,t[29]=P):P=t[29];let F;t[30]===a.name?F=t[31]:(F=(0,Z.jsx)(oe,{content:`Copy column name`,delayDuration:400,children:(0,Z.jsx)(ce,{variant:`text`,size:`icon`,className:`group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(me,{tooltip:!1,value:a.name,className:`h-3 w-3`})})}),t[30]=a.name,t[31]=F);let I;t[32]===a.external_type?I=t[33]:(I=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a.external_type}),t[32]=a.external_type,t[33]=I);let L;t[34]!==P||t[35]!==F||t[36]!==I||t[37]!==E||t[38]!==D||t[39]!==O?(L=(0,Z.jsxs)(ee,{className:`rounded-none py-1 group cursor-pointer`,value:D,onSelect:O,children:[P,F,I]},E),t[34]=P,t[35]=F,t[36]=I,t[37]=E,t[38]=D,t[39]=O,t[40]=L):L=t[40];let R;t[41]!==a||t[42]!==m||t[43]!==x||t[44]!==l||t[45]!==o||t[46]!==n?(R=l&&(0,Z.jsx)(`div`,{className:`pr-2 py-2 bg-(--slate-1) shadow-inner border-b`,style:$(Q.columnPreview),children:(0,Z.jsx)(K,{children:(0,Z.jsx)(Ie,{table:n,column:a,onAddColumnChart:x,preview:m.get(o?`${o.database}.${o.schema}.${n.name}:${a.name}`:`${n.name}:${a.name}`),sqlTableContext:o})})}),t[41]=a,t[42]=m,t[43]=x,t[44]=l,t[45]=o,t[46]=n,t[47]=R):R=t[47];let z;return t[48]!==L||t[49]!==R?(z=(0,Z.jsxs)(Z.Fragment,{children:[L,R]}),t[48]=L,t[49]=R,t[50]=z):z=t[50],z};function Ct(e){let{tooltipContent:t,content:n}=e;return(0,Z.jsx)(oe,{content:t,delayDuration:100,children:(0,Z.jsx)(`span`,{className:`text-xs text-black bg-gray-100 dark:invert rounded px-1`,children:n})})}function wt(e){return e}var Tt={name:`name`,type:`type-value`,defs:`defs-refs`},Et=[wt({id:Tt.name,accessorFn:e=>[e.name,e.declaredBy],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(De,{header:`Name`,column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsx)(Je,{name:t,declaredBy:n})}}),wt({id:Tt.type,accessorFn:e=>[e.dataType,e.value],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(De,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Type`}),(0,Z.jsx)(`span`,{children:`Value`})]}),column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsxs)(`div`,{className:`max-w-[150px]`,children:[(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs`,children:t}),(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap`,title:n??``,children:n})]})}}),wt({id:Tt.defs,accessorFn:e=>[e.declaredBy,e.usedBy,e.name,e.declaredByNames,e.usedByNames],enableSorting:!0,sortingFn:`basic`,header:({column:e})=>(0,Z.jsx)(De,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Declared By`}),(0,Z.jsx)(`span`,{children:`Used By`})]}),column:e}),cell:({getValue:e})=>{let[t,n,r]=e(),i=e=>{let t=N(e);t&&V(t,r)};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 py-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-center`,children:[(0,Z.jsx)(`span`,{title:`Declared by`,children:(0,Z.jsx)(nt,{className:`w-3.5 h-3.5 text-muted-foreground`})}),t.length===1?(0,Z.jsx)(He,{variant:`focus`,cellId:t[0],skipScroll:!0,onClick:()=>i(t[0])}):(0,Z.jsx)(`div`,{className:`text-destructive flex flex-row gap-2`,children:t.slice(0,3).map((e,n)=>(0,Z.jsxs)(`span`,{className:`flex`,children:[(0,Z.jsx)(He,{variant:`focus`,cellId:e,skipScroll:!0,className:`whitespace-nowrap text-destructive`,onClick:()=>i(e)},e),n<t.length-1&&`, `]},e))})]}),(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-baseline`,children:[(0,Z.jsx)(`span`,{title:`Used by`,children:(0,Z.jsx)(de,{className:`w-3.5 h-3.5 text-muted-foreground`})}),(0,Z.jsx)(qe,{maxCount:3,cellIds:n,skipScroll:!0,onClick:i})]})]})}})];function Dt({variables:e,sort:t,cellIdToIndex:n}){t||={id:Tt.defs,desc:!1};let r=[];switch(t.id){case Tt.name:r=he(e,e=>e.name);break;case Tt.type:r=he(e,e=>e.dataType);break;case Tt.defs:r=he(e,e=>n.get(e.declaredBy[0]))}return t.desc?r.toReversed():r}var Ot=(0,X.memo)(({className:e,cellIds:t,variables:n})=>{let[r,i]=X.useState([]),[a,o]=X.useState(``),s=S(),{locale:c}=ve(),l=(0,X.useMemo)(()=>{let e=e=>{let n=s[e];return T(n)?`cell-${t.indexOf(e)}`:n??`cell-${t.indexOf(e)}`};return Object.values(n).map(t=>({...t,declaredByNames:t.declaredBy.map(e),usedByNames:t.usedBy.map(e)}))},[n,s,t]),u=(0,X.useMemo)(()=>{let e=new Map;return t.forEach((t,n)=>e.set(t,n)),Dt({variables:l,sort:r[0],cellIdToIndex:e})},[l,r,t]),d=xe({data:u,columns:Et,getCoreRowModel:Re(),onGlobalFilterChange:o,getFilteredRowModel:we(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter(e){return e.columnDef.enableGlobalFilter??!0},globalFilterFn:`auto`,manualSorting:!0,locale:c,onSortingChange:i,getSortedRowModel:Te(),state:{sorting:r,globalFilter:a}});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pe,{className:`w-full`,placeholder:`Search`,value:a,onChange:e=>o(e.target.value)}),(0,Z.jsxs)(Ne,{className:ie(`w-full text-sm flex-1 border-separate border-spacing-0`,e),children:[(0,Z.jsx)(We,{children:(0,Z.jsx)(ke,{className:`whitespace-nowrap text-xs`,children:d.getFlatHeaders().map(e=>(0,Z.jsx)(Fe,{className:`sticky top-0 bg-background border-b`,children:ze(e.column.columnDef.header,e.getContext())},e.id))})}),(0,Z.jsx)(Ue,{children:d.getRowModel().rows.map(e=>(0,Z.jsx)(ke,{className:`hover:bg-accent`,children:e.getVisibleCells().map(e=>(0,Z.jsx)(Ge,{className:`border-b`,children:ze(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]})]})});Ot.displayName=`VariableTable`;var kt=()=>{let e=(0,Y.c)(30),n=o(),i=b(),a=r(w),s=r(x),c=H(`database`),[l,u]=t(fe),d=a.length+s.length,f;e[0]!==d||e[1]!==l.hasUserInteracted||e[2]!==l.openSections?(f=!l.hasUserInteracted&&d>0?[...new Set([...l.openSections,`datasources`])]:l.openSections,e[0]=d,e[1]=l.hasUserInteracted,e[2]=l.openSections,e[3]=f):f=e[3];let m=f,h;e[4]===u?h=e[5]:(h=e=>{u({openSections:e,hasUserInteracted:!0})},e[4]=u,e[5]=h);let g=h,_;e[6]===m?_=e[7]:(_=m.includes(`datasources`),e[6]=m,e[7]=_);let v=!_&&d>0,y=c.length>0,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(J,{className:`w-4 h-4`}),e[8]=S):S=e[8];let C;e[9]!==d||e[10]!==v?(C=v&&(0,Z.jsx)(Ye,{children:d}),e[9]=d,e[10]=v,e[11]=C):C=e[11];let T;e[12]!==c.length||e[13]!==y?(T=y&&(0,Z.jsx)(tt,{count:c.length,type:`database`}),e[12]=c.length,e[13]=y,e[14]=T):T=e[14];let E;e[15]!==C||e[16]!==T?(E=(0,Z.jsxs)(Xe,{children:[S,`Data sources`,C,T]}),e[15]=C,e[16]=T,e[17]=E):E=e[17];let D;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(Ze,{children:(0,Z.jsx)(dt,{})}),e[18]=D):D=e[18];let O;e[19]===E?O=e[20]:(O=(0,Z.jsxs)($e,{value:`datasources`,children:[E,D]}),e[19]=E,e[20]=O);let k;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsxs)(Xe,{children:[(0,Z.jsx)(p,{className:`w-4 h-4`}),`Variables`]}),e[21]=k):k=e[21];let A;e[22]!==i||e[23]!==n?(A=(0,Z.jsxs)($e,{value:`variables`,lastItem:!0,children:[k,(0,Z.jsx)(Ze,{children:Object.keys(n).length===0?(0,Z.jsx)(`div`,{className:`px-3 py-4 text-sm text-muted-foreground`,children:`No variables defined`}):(0,Z.jsx)(Ot,{cellIds:i.inOrderIds,variables:n})})]}),e[22]=i,e[23]=n,e[24]=A):A=e[24];let j;return e[25]!==g||e[26]!==m||e[27]!==A||e[28]!==O?(j=(0,Z.jsxs)(ae,{type:`multiple`,value:m,onValueChange:g,className:`flex flex-col h-full overflow-auto`,children:[O,A]}),e[25]=g,e[26]=m,e[27]=A,e[28]=O,e[29]=j):j=e[29],j};export{kt as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,u as i}from"./useEvent-Dc9HkKI2.js";import{t as a}from"./react-CUdNIagt.js";import{$r as o,Ai as s,Bi as c,Bt as l,Cn as u,D as d,Gn as f,Ha as p,Hi as m,Ii as h,Ji as g,Ki as _,Kn as v,Li as y,M as b,Mi as x,P as S,Qr as C,Ri as w,Rn as T,Rt as E,Ui as D,Wa as O,Wi as k,Xi as A,Yi as j,Zi as M,_n as ee,c as N,fn as P,gn as F,i as I,jn as L,qi as R,qn as z,ro as te,ti as ne,to as B,yr as V,yt as H,zi as U}from"./cells-CU9huD49.js";import{t as W}from"./compiler-runtime-BQ9S8nyo.js";import{s as re}from"./config-BdH5RvM0.js";import{O as G}from"./config-D7CP5wR5.js";import{t as K}from"./ErrorBoundary-CtGZ1MAN.js";import{t as ie}from"./cn-ldLVeaqm.js";import{t as q}from"./jsx-runtime-B74pBk57.js";import{r as ae}from"./config-2Nts63h2.js";import{t as oe}from"./tooltip-CamoSiGF.js";import{r as se,t as ce}from"./button-qFeU84ax.js";import{t as le}from"./createLucideIcon-rHn2EdoM.js";import{i as J}from"./paths-CzfpItSz.js";import{r as ue}from"./useNumberFormatter-C4-_TnkF.js";import{R as de,j as fe}from"./RunButton-YN1KKz4a.js";import{a as pe}from"./input-D4bMj5Nb.js";import{t as me}from"./copy-icon-DQuttmjH.js";import{l as he}from"./arrays-BqUx5USx.js";import{i as ge}from"./strings-LjhpYwmx.js";import{r as _e}from"./requests-yTHMxhVa.js";import{t as ve}from"./context-BFOBKCJB.js";import{n as ye}from"./useAsyncData-DucTwMkf.js";import{$t as be,An as xe,E as Se,Jt as Ce,Mn as we,Nn as Te,O as Ee,On as De,Qt as Oe,Sn as ke,Xt as Ae,Yt as je,Zt as Me,_n as Ne,b as Pe,bn as Fe,g as Ie,in as Le,jn as Re,kn as ze,la as Be,nn as Ve,nr as He,vn as Ue,xn as We,yn as Ge}from"./index-C9FPQNuH.js";import{t as Ke}from"./empty-state-CzxjZqGW.js";import{n as qe,t as Je}from"./common-CdJQaC_v.js";import{a as Ye,i as Xe,n as Ze,o as Qe,r as $e,s as et,t as tt}from"./components-DsJLlugL.js";var nt=le(`square-equal`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 10h10`,key:`1101jm`}],[`path`,{d:`M7 14h10`,key:`1mhdw3`}]]),Y=W(),X=e(a(),1),Z=q(),rt=1;function it(e){return 1.75+e*rt}function at(e){return 3+e*rt}function ot(e){return 3.25+e*rt}var Q={engineEmpty:.75,engine:.75,database:1,tableLoading:2.75,tableSchemaless:2,columnLocal:1.25,columnPreview:2.5};function $(e){return{paddingLeft:`${e}rem`}}var st=n(e=>{let t=e(w),n=e(ne),r=e(I);return he(t,e=>{if(!e.variable_name)return-1;let t=Object.values(n).find(t=>t.name===e.variable_name);if(!t)return 0;let i=r.inOrderIds.indexOf(t.declaredBy[0]);return i===-1?0:i})}),ct=G(`marimo:datasources:hideEmpty`,!1,C,{getOnInit:!0});function lt(e){let t=!1,n=[];for(let r of e){if(!k(r)||!m(r)){n.push(r);continue}let e=r.child_schemas??[],i=lt(e);if(r.tables.length===0&&i.length===0){t=!0;continue}if(i===e){n.push(r);continue}t=!0,n.push({...r,child_schemas:i})}return t?n:e}function ut(e){let t=!1,n=[];for(let r of e){if(D(r)&&r.schemas.length===0){t=!0;continue}if(r.schemas.length===0){n.push(r);continue}let e=lt(r.schemas);if(e.length===0){t=!0;continue}if(e===r.schemas){n.push(r);continue}t=!0,n.push({...r,schemas:e})}return t?n:e}var dt=()=>{let e=(0,Y.c)(42),[n,a]=X.useState(``),[o,s]=t(ct),c=i(y),l=r(st),d=r(x),f;bb0:{if(!o){f=d;break bb0}let t,n;e[0]===d?(t=e[1],n=e[2]):(t=!1,n=d.map(e=>{let n=ut(e.databases);return n===e.databases?e:(t=!0,{...e,databases:n})}),e[0]=d,e[1]=t,e[2]=n),f=t?n:d}let p=f;if(l.length===0&&p.length===0){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Ke,{title:`No tables found`,description:`Any datasets/dataframes in the global scope will be shown here.`,action:(0,Z.jsx)(Qe,{group:`database`,label:`Add database or catalog`,variant:`outline`,size:`sm`}),icon:(0,Z.jsx)(J,{})}),e[3]=t):t=e[3],t}let m;e[4]===n?m=e[5]:(m=n.trim(),e[4]=n,e[5]=m);let h=!!m,g;e[6]===c?g=e[7]:(g=e=>{c(e.length>0),a(e)},e[6]=c,e[7]=g);let _;e[8]!==n||e[9]!==g?(_=(0,Z.jsx)(F,{placeholder:`Search tables...`,className:`h-6 m-1`,value:n,onValueChange:g,rootClassName:`flex-1 border-r border-b-0`}),e[8]=n,e[9]=g,e[10]=_):_=e[10];let v;e[11]===h?v=e[12]:(v=h&&(0,Z.jsx)(`button`,{type:`button`,className:`float-right border-b px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,onClick:()=>a(``),children:(0,Z.jsx)(ue,{className:`h-4 w-4`})}),e[11]=h,e[12]=v);let b=!o,S;e[13]!==o||e[14]!==s?(S=()=>s(!o),e[13]=o,e[14]=s,e[15]=S):S=e[15];let C;e[16]!==b||e[17]!==S?(C=(0,Z.jsx)(Le,{"data-testid":`datasources-hide-empty-button`,isVisible:b,onToggle:S,showTooltip:`Show empty schemas and databases`,hideTooltip:`Hide empty schemas and databases`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[16]=b,e[17]=S,e[18]=C):C=e[18];let w;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Qe,{group:`database`,label:`Add database or catalog`,compact:!0,variant:`ghost`,size:`sm`,className:`px-2 rounded-none focus-visible:outline-hidden`}),e[19]=w):w=e[19];let T;e[20]!==_||e[21]!==v||e[22]!==C?(T=(0,Z.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[_,v,C,w]}),e[20]=_,e[21]=v,e[22]=C,e[23]=T):T=e[23];let E;if(e[24]!==p||e[25]!==n){let t;e[27]===n?t=e[28]:(t=e=>(0,Z.jsx)(ft,{connection:e,hasChildren:e.databases.length>0,children:e.databases.map(t=>(0,Z.jsx)(gt,{connection:e,database:t,searchValue:n},t.name))},e.name),e[27]=n,e[28]=t),E=p.map(t),e[24]=p,e[25]=n,e[26]=E}else E=e[26];let D;e[29]!==p.length||e[30]!==l.length?(D=p.length>0&&l.length>0&&(0,Z.jsxs)(je,{className:`pr-2`,style:$(Q.engine),children:[(0,Z.jsx)(Ee,{className:`h-4 w-4 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`text-xs`,children:`Python`})]}),e[29]=p.length,e[30]=l.length,e[31]=D):D=e[31];let O;e[32]!==n||e[33]!==l?(O=l.length>0&&(0,Z.jsx)(bt,{tables:l,searchValue:n}),e[32]=n,e[33]=l,e[34]=O):O=e[34];let k;e[35]!==E||e[36]!==D||e[37]!==O?(k=(0,Z.jsxs)(u,{className:`flex flex-col`,children:[E,D,O]}),e[35]=E,e[36]=D,e[37]=O,e[38]=k):k=e[38];let A;return e[39]!==k||e[40]!==T?(A=(0,Z.jsxs)(P,{className:`border-b bg-background rounded-none h-full pb-10 overflow-auto outline-hidden`,shouldFilter:!1,children:[T,k]}),e[39]=k,e[40]=T,e[41]=A):A=e[41],A},ft=e=>{let t=(0,Y.c)(26),{connection:n,children:r,hasChildren:i}=e,a=n.name===M,o=a?`In-Memory`:n.name,{previewDataSourceConnection:c}=_e(),l;t[0]!==n.name||t[1]!==c?(l=async()=>{await c({engine:n.name})},t[0]=n.name,t[1]=c,t[2]=l):l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=$(Q.engine),t[3]=d):d=t[3];let f;t[4]===n.dialect?f=t[5]:(f=(0,Z.jsx)(L,{className:`h-4 w-4 text-muted-foreground`,name:n.dialect}),t[4]=n.dialect,t[5]=f);let p;t[6]===n.dialect?p=t[7]:(p=s(n.dialect),t[6]=n.dialect,t[7]=p);let m;t[8]===p?m=t[9]:(m=(0,Z.jsx)(`span`,{className:`text-xs`,children:p}),t[8]=p,t[9]=m);let h=o,g;t[10]===h?g=t[11]:(g=(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,(0,Z.jsx)(et,{variableName:h}),`)`]}),t[10]=h,t[11]=g);let _;t[12]!==u||t[13]!==a?(_=!a&&(0,Z.jsx)(Ve,{onClick:u,tooltip:`Refresh connection`,className:`ml-auto h-4 p-0`,iconClassName:`h-3.5 w-3.5`}),t[12]=u,t[13]=a,t[14]=_):_=t[14];let v;t[15]!==f||t[16]!==m||t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(je,{className:`pr-2`,style:d,children:[f,m,g,_]}),t[15]=f,t[16]=m,t[17]=g,t[18]=_,t[19]=v):v=t[19];let y;t[20]!==r||t[21]!==i?(y=i?r:(0,Z.jsx)(Ae,{content:`No databases available`,style:$(Q.engineEmpty)}),t[20]=r,t[21]=i,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==v?(b=(0,Z.jsxs)(Z.Fragment,{children:[v,y]}),t[23]=y,t[24]=v,t[25]=b):b=t[25],b},pt=X.createContext(null);function mt(){let e=X.useContext(pt);if(e==null)throw Error(`useDataSourceTree must be used within a DataSourceTreeContext.Provider`);return e}function ht(e,{schema:t,schemaPath:n}){return{engine:e.engineName,database:e.databaseName,schema:t,schemaPath:n,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,dialect:e.dialect}}var gt=e=>{let t=(0,Y.c)(21),{connection:n,database:r,searchValue:i}=e,a;t[0]!==n.default_database||t[1]!==n.default_schema||t[2]!==n.dialect||t[3]!==n.name||t[4]!==r.name||t[5]!==i?(a={engineName:n.name,databaseName:r.name,dialect:n.dialect,defaultSchema:n.default_schema,defaultDatabase:n.default_database,searchValue:i},t[0]=n.default_database,t[1]=n.default_schema,t[2]=n.dialect,t[3]=n.name,t[4]=r.name,t[5]=i,t[6]=a):a=t[6];let o=a,s=n.name,c=r.schemas,l;t[7]===r?l=t[8]:(l=D(r),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[9]=u):u=t[9];let d;t[10]!==r.schemas||t[11]!==l?(d=(0,Z.jsx)(vt,{schemas:c,schemasResolved:l,schemaPath:u,depth:0}),t[10]=r.schemas,t[11]=l,t[12]=d):d=t[12];let f;t[13]!==d||t[14]!==o?(f=(0,Z.jsx)(pt.Provider,{value:o,children:d}),t[13]=d,t[14]=o,t[15]=f):f=t[15];let p;return t[16]!==n.name||t[17]!==r||t[18]!==i||t[19]!==f?(p=(0,Z.jsx)(_t,{engineName:s,database:r,searchValue:i,children:f}),t[16]=n.name,t[17]=r,t[18]=i,t[19]=f,t[20]=p):p=t[20],p},_t=e=>{let t=(0,Y.c)(29),{searchValue:n,engineName:r,database:i,children:a}=e,o;t[0]!==i||t[1]!==n?(o=g(i,n),t[0]=i,t[1]=n,t[2]=o):o=t[2];let s=o,[c,l]=X.useState(s),[u,d]=X.useState(!1),[f,p]=X.useState(n),[m,h]=X.useState(s);(f!==n||m!==s)&&(p(n),h(s),l(s));let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=$(Q.database),t[3]=_):_=t[3];let v;t[4]!==c||t[5]!==u?(v=()=>{l(!c),d(!u)},t[4]=c,t[5]=u,t[6]=v):v=t[6];let y=`${r}:${i.name}`,b;t[7]===c?b=t[8]:(b=(0,Z.jsx)(be,{isExpanded:c}),t[7]=c,t[8]=b);let x=u&&c?`text-foreground`:`text-muted-foreground`,S;t[9]===x?S=t[10]:(S=ie(`h-4 w-4`,x),t[9]=x,t[10]=S);let C;t[11]===S?C=t[12]:(C=(0,Z.jsx)(J,{className:S}),t[11]=S,t[12]=C);let w=u&&c&&`font-semibold`,T;t[13]===w?T=t[14]:(T=ie(w),t[13]=w,t[14]=T);let E;t[15]===i.name?E=t[16]:(E=i.name===``?(0,Z.jsx)(`i`,{children:`Not connected`}):i.name,t[15]=i.name,t[16]=E);let D;t[17]!==T||t[18]!==E?(D=(0,Z.jsx)(`span`,{className:T,children:E}),t[17]=T,t[18]=E,t[19]=D):D=t[19];let O;t[20]!==D||t[21]!==v||t[22]!==y||t[23]!==b||t[24]!==C?(O=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:_,onSelect:v,value:y,children:[b,C,D]}),t[20]=D,t[21]=v,t[22]=y,t[23]=b,t[24]=C,t[25]=O):O=t[25];let k=c&&a,A;return t[26]!==O||t[27]!==k?(A=(0,Z.jsxs)(Z.Fragment,{children:[O,k]}),t[26]=O,t[27]=k,t[28]=A):A=t[28],A},vt=e=>{let{schemas:t,schemasResolved:n,depth:r}=e,i=mt(),{engineName:a,databaseName:o,searchValue:s}=i,{addSchemaList:c}=h(),l=Se(e.schemaPath),[u,d]=X.useState(!1),{isPending:p,error:m}=ye(async()=>{if(!n&&a){d(!0);try{let e=await f.request({engine:a,database:o,schemaPath:l});c({schemas:e.schemas??[],sqlSchemaContext:{engine:a,database:o,schemaPath:l}})}finally{d(!1)}}},[n,a,o,l]),g=$(it(r));return p||u?(0,Z.jsx)(Oe,{message:`Loading schemas...`,style:g}):m?(0,Z.jsx)(Me,{error:m,style:g}):t.length===0?(0,Z.jsx)(Ae,{content:`No schemas available`,style:g}):(0,Z.jsx)(Z.Fragment,{children:t.map(e=>_(e.name)?(0,Z.jsx)(bt,{tables:e.tables,tablesResolved:k(e),searchValue:s,sqlTableContext:ht(i,{schema:e.name,schemaPath:l})},e.name):(0,Z.jsx)(yt,{schema:e,schemaPath:[...l,e.name],depth:r},e.name))})},yt=e=>{let t=(0,Y.c)(41),{schema:n,schemaPath:r,depth:i}=e,a=mt(),{databaseName:o,searchValue:s}=a,c;t[0]!==n||t[1]!==s?(c=R(n,s),t[0]=n,t[1]=s,t[2]=c):c=t[2];let l=c,[u,d]=X.useState(l),[f,p]=X.useState(!1),[h,g]=X.useState(s),[_,v]=X.useState(l),y;t[3]===r?y=t[4]:(y=r.join(`.`),t[3]=r,t[4]=y);let b=`${o}:${y}`,x;t[5]===n.child_schemas?x=t[6]:(x=n.child_schemas??[],t[5]=n.child_schemas,t[6]=x);let S=x;(h!==s||_!==l)&&(g(s),v(l),d(l));let C;t[7]===i?C=t[8]:(C=$(it(i)),t[7]=i,t[8]=C);let w;t[9]!==u||t[10]!==f?(w=()=>{d(!u),p(!f)},t[9]=u,t[10]=f,t[11]=w):w=t[11];let T;t[12]===u?T=t[13]:(T=(0,Z.jsx)(be,{isExpanded:u}),t[12]=u,t[13]=T);let E=f&&u&&`text-foreground`,D;t[14]===E?D=t[15]:(D=ie(`h-4 w-4 text-muted-foreground`,E),t[14]=E,t[15]=D);let O;t[16]===D?O=t[17]:(O=(0,Z.jsx)(B,{className:D}),t[16]=D,t[17]=O);let A=f&&u&&`font-semibold`,j;t[18]===A?j=t[19]:(j=ie(A),t[18]=A,t[19]=j);let M;t[20]!==n.name||t[21]!==j?(M=(0,Z.jsx)(`span`,{className:j,children:n.name}),t[20]=n.name,t[21]=j,t[22]=M):M=t[22];let N;t[23]!==M||t[24]!==C||t[25]!==w||t[26]!==T||t[27]!==O||t[28]!==b?(N=(0,Z.jsxs)(ee,{className:`text-sm flex flex-row gap-1 items-center cursor-pointer rounded-none`,style:C,onSelect:w,value:b,children:[T,O,M]}),t[23]=M,t[24]=C,t[25]=w,t[26]=T,t[27]=O,t[28]=b,t[29]=N):N=t[29];let P;t[30]!==S||t[31]!==i||t[32]!==u||t[33]!==n||t[34]!==r||t[35]!==s||t[36]!==a?(P=u&&(0,Z.jsxs)(Z.Fragment,{children:[(S.length>0||!m(n))&&(0,Z.jsx)(vt,{schemas:S,schemasResolved:m(n),schemaPath:r,depth:i+1}),(0,Z.jsx)(bt,{tables:n.tables,tablesResolved:k(n),searchValue:s,tableIndentRem:at(i),columnIndentRem:ot(i),sqlTableContext:ht(a,{schema:n.name,schemaPath:r})})]}),t[30]=S,t[31]=i,t[32]=u,t[33]=n,t[34]=r,t[35]=s,t[36]=a,t[37]=P):P=t[37];let F;return t[38]!==N||t[39]!==P?(F=(0,Z.jsxs)(Z.Fragment,{children:[N,P]}),t[38]=N,t[39]=P,t[40]=F):F=t[40],F},bt=e=>{let t=(0,Y.c)(31),{tables:n,sqlTableContext:r,searchValue:i,tablesResolved:a,tableIndentRem:o,columnIndentRem:s}=e,c=a===void 0||a,{addTableList:l}=h(),[u,d]=X.useState(!1),f;t[0]!==l||t[1]!==r||t[2]!==c?(f=async()=>{if(!c&&r){d(!0);let{engine:e,database:t,schema:n,schemaPath:i}=r,a=await z.request({engine:e,database:t,schema:n,schemaPath:i??[]});if(!a?.tables)throw d(!1),Error(`No tables available`);l({tables:a.tables,sqlTableContext:r}),d(!1)}},t[0]=l,t[1]=r,t[2]=c,t[3]=f):f=t[3];let p;t[4]!==r||t[5]!==c?(p=[c,r],t[4]=r,t[5]=c,t[6]=p):p=t[6];let{isPending:m,error:g}=ye(f,p),_=o??Q.tableLoading,v;t[7]===_?v=t[8]:(v=$(_),t[7]=_,t[8]=v);let y=v;if(m||u){let e;return t[9]===y?e=t[10]:(e=(0,Z.jsx)(Oe,{message:`Loading tables...`,style:y}),t[9]=y,t[10]=e),e}if(g){let e;return t[11]!==g||t[12]!==y?(e=(0,Z.jsx)(Me,{error:g,style:y}),t[11]=g,t[12]=y,t[13]=e):e=t[13],e}if(n.length===0){let e;return t[14]===y?e=t[15]:(e=(0,Z.jsx)(Ae,{content:`No tables found`,style:y}),t[14]=y,t[15]=e),e}let b;if(t[16]!==s||t[17]!==i||t[18]!==r||t[19]!==o||t[20]!==n){let e;t[22]===i?e=t[23]:(e=e=>!i||e.name.toLowerCase().includes(i.toLowerCase()),t[22]=i,t[23]=e);let a=n.filter(e),c;t[24]!==s||t[25]!==i||t[26]!==r||t[27]!==o?(c=e=>(0,Z.jsx)(xt,{table:e,sqlTableContext:r,isSearching:!!i,tableIndentRem:o,columnIndentRem:s},e.name),t[24]=s,t[25]=i,t[26]=r,t[27]=o,t[28]=c):c=t[28],b=a.map(c),t[16]=s,t[17]=i,t[18]=r,t[19]=o,t[20]=n,t[21]=b}else b=t[21];let x;return t[29]===b?x=t[30]:(x=(0,Z.jsx)(Z.Fragment,{children:b}),t[29]=b,t[30]=x),x},xt=e=>{let t=(0,Y.c)(69),{table:n,sqlTableContext:i,isSearching:a,tableIndentRem:o,columnIndentRem:s}=e,{addTable:c}=h(),[u,f]=X.useState(!1),p=n.columns.length>0,m;t[0]!==c||t[1]!==u||t[2]!==i||t[3]!==n.name||t[4]!==p?(m=async()=>{if(u&&!p&&i){let{engine:e,database:t,schema:r,schemaPath:a}=i,o=await v.request({engine:e,database:t,schema:r,tableName:n.name,schemaPath:a??[]});if(!o?.table)throw Error(`No table details available`);c({table:o.table,sqlTableContext:i})}},t[0]=c,t[1]=u,t[2]=i,t[3]=n.name,t[4]=p,t[5]=m):m=t[5];let g;t[6]!==u||t[7]!==p?(g=[u,p],t[6]=u,t[7]=p,t[8]=g):g=t[8];let{isFetching:_,isPending:y,error:b}=ye(m,g),x=r(re),S=E(),{createNewCell:C}=d(),w=Pe(),T;t[9]!==w||t[10]!==x||t[11]!==C||t[12]!==S||t[13]!==i||t[14]!==n?(T=()=>{l({autoInstantiate:x,createNewCell:C,fromCellId:S}),w((()=>{if(n.source_type===`catalog`){let e=i?.database?[i.database,...i.schemaPath??[],n.name].join(`.`):n.name;return`${n.engine}.load_table("${e}")`}if(i)return j({table:n,columnName:`*`,sqlTableContext:i});switch(n.source_type){case`local`:return`mo.ui.table(${n.name})`;case`duckdb`:case`connection`:return j({table:n,columnName:`*`,sqlTableContext:i});default:return ge(n.source_type),``}})())},t[9]=w,t[10]=x,t[11]=C,t[12]=S,t[13]=i,t[14]=n,t[15]=T):T=t[15];let D=T,k;t[16]!==n.num_columns||t[17]!==n.num_rows?(k=()=>{let e=[];return n.num_rows!=null&&e.push(`${n.num_rows} rows`),n.num_columns!=null&&e.push(`${n.num_columns} columns`),e.length===0?null:(0,Z.jsx)(`div`,{className:`flex flex-row gap-2 items-center pl-6 group-hover:hidden`,children:(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.join(`, `)})})},t[16]=n.num_columns,t[17]=n.num_rows,t[18]=k):k=t[18];let M=k,N;t[19]!==s||t[20]!==b||t[21]!==_||t[22]!==y||t[23]!==i||t[24]!==n?(N=()=>{let e=$(s??Q.tableLoading);if(y||_)return(0,Z.jsx)(Oe,{message:`Loading columns...`,style:e});if(b)return(0,Z.jsx)(Me,{error:b,style:e});let t=n.columns;return t.length===0?(0,Z.jsx)(Ae,{content:`No columns found`,style:e}):t.map(e=>(0,Z.jsx)(St,{table:n,column:e,sqlTableContext:i,columnIndentRem:s},e.name))},t[19]=s,t[20]=b,t[21]=_,t[22]=y,t[23]=i,t[24]=n,t[25]=N):N=t[25];let P=N,F;t[26]!==u||t[27]!==a||t[28]!==n.source_type||t[29]!==n.type?(F=()=>{if(n.source_type===`local`)return;let e=n.type===`table`?O:te;return(0,Z.jsx)(e,{className:`h-3 w-3`,strokeWidth:u||a?2.5:void 0})},t[26]=u,t[27]=a,t[28]=n.source_type,t[29]=n.type,t[30]=F):F=t[30];let I=F,L;t[31]!==i||t[32]!==n.name?(L=A(i,n.name),t[31]=i,t[32]=n.name,t[33]=L):L=t[33];let R=L,z=o??(i?Q.tableSchemaless:0),ne=(u||a)&&`font-semibold`,B;t[34]===ne?B=t[35]:(B=ie(`rounded-none group h-8 cursor-pointer`,ne),t[34]=ne,t[35]=B);let V;t[36]===z?V=t[37]:(V=$(z),t[36]=z,t[37]=V);let H;t[38]===u?H=t[39]:(H=()=>f(!u),t[38]=u,t[39]=H);let U;t[40]===I?U=t[41]:(U=I(),t[40]=I,t[41]=U);let W;t[42]===n.name?W=t[43]:(W=(0,Z.jsx)(`span`,{className:`text-sm`,children:n.name}),t[42]=n.name,t[43]=W);let G;t[44]!==U||t[45]!==W?(G=(0,Z.jsxs)(`div`,{className:`flex gap-2 items-center flex-1 pl-1`,children:[U,W]}),t[44]=U,t[45]=W,t[46]=G):G=t[46];let K;t[47]===M?K=t[48]:(K=M(),t[47]=M,t[48]=K);let q;t[49]===D?q=t[50]:(q=se.stopPropagation(()=>D()),t[49]=D,t[50]=q);let ae;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(Be,{className:`h-3 w-3`}),t[51]=ae):ae=t[51];let le;t[52]===q?le=t[53]:(le=(0,Z.jsx)(oe,{content:`Add table to notebook`,delayDuration:400,children:(0,Z.jsx)(ce,{className:`group-hover:inline-flex hidden`,variant:`text`,size:`icon`,onClick:q,children:ae})}),t[52]=q,t[53]=le);let J;t[54]!==u||t[55]!==V||t[56]!==H||t[57]!==G||t[58]!==K||t[59]!==le||t[60]!==B||t[61]!==R?(J=(0,Z.jsxs)(ee,{className:B,style:V,value:R,"aria-selected":u,forceMount:!0,onSelect:H,children:[G,K,le]}),t[54]=u,t[55]=V,t[56]=H,t[57]=G,t[58]=K,t[59]=le,t[60]=B,t[61]=R,t[62]=J):J=t[62];let ue;t[63]!==u||t[64]!==P?(ue=u&&P(),t[63]=u,t[64]=P,t[65]=ue):ue=t[65];let de;return t[66]!==J||t[67]!==ue?(de=(0,Z.jsxs)(Z.Fragment,{children:[J,ue]}),t[66]=J,t[67]=ue,t[68]=de):de=t[68],de},St=e=>{let t=(0,Y.c)(51),{table:n,column:a,sqlTableContext:o,columnIndentRem:s}=e,[l,u]=X.useState(!1),d=r(y),f=i(U);d&&l&&u(!1),f(l?e=>new Set([...e,`${n.name}:${a.name}`]):e=>(e.delete(`${n.name}:${a.name}`),new Set(e)));let p=Pe(),{columnsPreviews:m}=c(),h;t[0]!==a.name||t[1]!==n.primary_keys?(h=n.primary_keys?.includes(a.name)||!1,t[0]=a.name,t[1]=n.primary_keys,t[2]=h):h=t[2];let g=h,_;t[3]!==a.name||t[4]!==n.indexes?(_=n.indexes?.includes(a.name)||!1,t[3]=a.name,t[4]=n.indexes,t[5]=_):_=t[5];let v=_,b;t[6]===p?b=t[7]:(b=e=>{p(e)},t[6]=p,t[7]=b);let x=b,S=Ct,C=l?`font-semibold`:``,w;t[8]!==a.name||t[9]!==C?(w=(0,Z.jsx)(`span`,{className:C,children:a.name}),t[8]=a.name,t[9]=C,t[10]=w):w=t[10];let T=w,E=`${n.name}.${a.name}`,D=`${n.name}.${a.name}`,O;t[11]===l?O=t[12]:(O=()=>u(!l),t[11]=l,t[12]=O);let k;t[13]!==s||t[14]!==o?(k=s??(o?ot(0):Q.columnLocal),t[13]=s,t[14]=o,t[15]=k):k=t[15];let A;t[16]===k?A=t[17]:(A=$(k),t[16]=k,t[17]=A);let j;t[18]!==a.type||t[19]!==T?(j=(0,Z.jsx)(Ce,{columnName:T,dataType:a.type}),t[18]=a.type,t[19]=T,t[20]=j):j=t[20];let M;t[21]===g?M=t[22]:(M=g&&S({tooltipContent:`Primary key`,content:`PK`}),t[21]=g,t[22]=M);let N;t[23]===v?N=t[24]:(N=v&&S({tooltipContent:`Indexed`,content:`IDX`}),t[23]=v,t[24]=N);let P;t[25]!==A||t[26]!==j||t[27]!==M||t[28]!==N?(P=(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2 items-center flex-1`,style:A,children:[j,M,N]}),t[25]=A,t[26]=j,t[27]=M,t[28]=N,t[29]=P):P=t[29];let F;t[30]===a.name?F=t[31]:(F=(0,Z.jsx)(oe,{content:`Copy column name`,delayDuration:400,children:(0,Z.jsx)(ce,{variant:`text`,size:`icon`,className:`group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(me,{tooltip:!1,value:a.name,className:`h-3 w-3`})})}),t[30]=a.name,t[31]=F);let I;t[32]===a.external_type?I=t[33]:(I=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a.external_type}),t[32]=a.external_type,t[33]=I);let L;t[34]!==P||t[35]!==F||t[36]!==I||t[37]!==E||t[38]!==D||t[39]!==O?(L=(0,Z.jsxs)(ee,{className:`rounded-none py-1 group cursor-pointer`,value:D,onSelect:O,children:[P,F,I]},E),t[34]=P,t[35]=F,t[36]=I,t[37]=E,t[38]=D,t[39]=O,t[40]=L):L=t[40];let R;t[41]!==a||t[42]!==m||t[43]!==x||t[44]!==l||t[45]!==o||t[46]!==n?(R=l&&(0,Z.jsx)(`div`,{className:`pr-2 py-2 bg-(--slate-1) shadow-inner border-b`,style:$(Q.columnPreview),children:(0,Z.jsx)(K,{children:(0,Z.jsx)(Ie,{table:n,column:a,onAddColumnChart:x,preview:m.get(o?`${o.database}.${o.schema}.${n.name}:${a.name}`:`${n.name}:${a.name}`),sqlTableContext:o})})}),t[41]=a,t[42]=m,t[43]=x,t[44]=l,t[45]=o,t[46]=n,t[47]=R):R=t[47];let z;return t[48]!==L||t[49]!==R?(z=(0,Z.jsxs)(Z.Fragment,{children:[L,R]}),t[48]=L,t[49]=R,t[50]=z):z=t[50],z};function Ct(e){let{tooltipContent:t,content:n}=e;return(0,Z.jsx)(oe,{content:t,delayDuration:100,children:(0,Z.jsx)(`span`,{className:`text-xs text-black bg-gray-100 dark:invert rounded px-1`,children:n})})}function wt(e){return e}var Tt={name:`name`,type:`type-value`,defs:`defs-refs`},Et=[wt({id:Tt.name,accessorFn:e=>[e.name,e.declaredBy],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(De,{header:`Name`,column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsx)(Je,{name:t,declaredBy:n})}}),wt({id:Tt.type,accessorFn:e=>[e.dataType,e.value],enableSorting:!0,sortingFn:`alphanumeric`,header:({column:e})=>(0,Z.jsx)(De,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Type`}),(0,Z.jsx)(`span`,{children:`Value`})]}),column:e}),cell:({getValue:e})=>{let[t,n]=e();return(0,Z.jsxs)(`div`,{className:`max-w-[150px]`,children:[(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs`,children:t}),(0,Z.jsx)(`div`,{className:`text-ellipsis overflow-hidden whitespace-nowrap`,title:n??``,children:n})]})}}),wt({id:Tt.defs,accessorFn:e=>[e.declaredBy,e.usedBy,e.name,e.declaredByNames,e.usedByNames],enableSorting:!0,sortingFn:`basic`,header:({column:e})=>(0,Z.jsx)(De,{header:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:`Declared By`}),(0,Z.jsx)(`span`,{children:`Used By`})]}),column:e}),cell:({getValue:e})=>{let[t,n,r]=e(),i=e=>{let t=N(e);t&&V(t,r)};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 py-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-center`,children:[(0,Z.jsx)(`span`,{title:`Declared by`,children:(0,Z.jsx)(nt,{className:`w-3.5 h-3.5 text-muted-foreground`})}),t.length===1?(0,Z.jsx)(He,{variant:`focus`,cellId:t[0],skipScroll:!0,onClick:()=>i(t[0])}):(0,Z.jsx)(`div`,{className:`text-destructive flex flex-row gap-2`,children:t.slice(0,3).map((e,n)=>(0,Z.jsxs)(`span`,{className:`flex`,children:[(0,Z.jsx)(He,{variant:`focus`,cellId:e,skipScroll:!0,className:`whitespace-nowrap text-destructive`,onClick:()=>i(e)},e),n<t.length-1&&`, `]},e))})]}),(0,Z.jsxs)(`div`,{className:`flex flex-row overflow-auto gap-2 items-baseline`,children:[(0,Z.jsx)(`span`,{title:`Used by`,children:(0,Z.jsx)(de,{className:`w-3.5 h-3.5 text-muted-foreground`})}),(0,Z.jsx)(qe,{maxCount:3,cellIds:n,skipScroll:!0,onClick:i})]})]})}})];function Dt({variables:e,sort:t,cellIdToIndex:n}){t||={id:Tt.defs,desc:!1};let r=[];switch(t.id){case Tt.name:r=he(e,e=>e.name);break;case Tt.type:r=he(e,e=>e.dataType);break;case Tt.defs:r=he(e,e=>n.get(e.declaredBy[0]))}return t.desc?r.toReversed():r}var Ot=(0,X.memo)(({className:e,cellIds:t,variables:n})=>{let[r,i]=X.useState([]),[a,o]=X.useState(``),s=S(),{locale:c}=ve(),l=(0,X.useMemo)(()=>{let e=e=>{let n=s[e];return T(n)?`cell-${t.indexOf(e)}`:n??`cell-${t.indexOf(e)}`};return Object.values(n).map(t=>({...t,declaredByNames:t.declaredBy.map(e),usedByNames:t.usedBy.map(e)}))},[n,s,t]),u=(0,X.useMemo)(()=>{let e=new Map;return t.forEach((t,n)=>e.set(t,n)),Dt({variables:l,sort:r[0],cellIdToIndex:e})},[l,r,t]),d=xe({data:u,columns:Et,getCoreRowModel:Re(),onGlobalFilterChange:o,getFilteredRowModel:we(),enableFilters:!0,enableGlobalFilter:!0,enableColumnPinning:!1,getColumnCanGlobalFilter(e){return e.columnDef.enableGlobalFilter??!0},globalFilterFn:`auto`,manualSorting:!0,locale:c,onSortingChange:i,getSortedRowModel:Te(),state:{sorting:r,globalFilter:a}});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pe,{className:`w-full`,placeholder:`Search`,value:a,onChange:e=>o(e.target.value)}),(0,Z.jsxs)(Ne,{className:ie(`w-full text-sm flex-1 border-separate border-spacing-0`,e),children:[(0,Z.jsx)(We,{children:(0,Z.jsx)(ke,{className:`whitespace-nowrap text-xs`,children:d.getFlatHeaders().map(e=>(0,Z.jsx)(Fe,{className:`sticky top-0 bg-background border-b`,children:ze(e.column.columnDef.header,e.getContext())},e.id))})}),(0,Z.jsx)(Ue,{children:d.getRowModel().rows.map(e=>(0,Z.jsx)(ke,{className:`hover:bg-accent`,children:e.getVisibleCells().map(e=>(0,Z.jsx)(Ge,{className:`border-b`,children:ze(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]})]})});Ot.displayName=`VariableTable`;var kt=()=>{let e=(0,Y.c)(30),n=o(),i=b(),a=r(w),s=r(x),c=H(`database`),[l,u]=t(fe),d=a.length+s.length,f;e[0]!==d||e[1]!==l.hasUserInteracted||e[2]!==l.openSections?(f=!l.hasUserInteracted&&d>0?[...new Set([...l.openSections,`datasources`])]:l.openSections,e[0]=d,e[1]=l.hasUserInteracted,e[2]=l.openSections,e[3]=f):f=e[3];let m=f,h;e[4]===u?h=e[5]:(h=e=>{u({openSections:e,hasUserInteracted:!0})},e[4]=u,e[5]=h);let g=h,_;e[6]===m?_=e[7]:(_=m.includes(`datasources`),e[6]=m,e[7]=_);let v=!_&&d>0,y=c.length>0,S;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(J,{className:`w-4 h-4`}),e[8]=S):S=e[8];let C;e[9]!==d||e[10]!==v?(C=v&&(0,Z.jsx)(Ye,{children:d}),e[9]=d,e[10]=v,e[11]=C):C=e[11];let T;e[12]!==c.length||e[13]!==y?(T=y&&(0,Z.jsx)(tt,{count:c.length,type:`database`}),e[12]=c.length,e[13]=y,e[14]=T):T=e[14];let E;e[15]!==C||e[16]!==T?(E=(0,Z.jsxs)(Xe,{children:[S,`Data sources`,C,T]}),e[15]=C,e[16]=T,e[17]=E):E=e[17];let D;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(Ze,{children:(0,Z.jsx)(dt,{})}),e[18]=D):D=e[18];let O;e[19]===E?O=e[20]:(O=(0,Z.jsxs)($e,{value:`datasources`,children:[E,D]}),e[19]=E,e[20]=O);let k;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsxs)(Xe,{children:[(0,Z.jsx)(p,{className:`w-4 h-4`}),`Variables`]}),e[21]=k):k=e[21];let A;e[22]!==i||e[23]!==n?(A=(0,Z.jsxs)($e,{value:`variables`,lastItem:!0,children:[k,(0,Z.jsx)(Ze,{children:Object.keys(n).length===0?(0,Z.jsx)(`div`,{className:`px-3 py-4 text-sm text-muted-foreground`,children:`No variables defined`}):(0,Z.jsx)(Ot,{cellIds:i.inOrderIds,variables:n})})]}),e[22]=i,e[23]=n,e[24]=A):A=e[24];let j;return e[25]!==g||e[26]!==m||e[27]!==A||e[28]!==O?(j=(0,Z.jsxs)(ae,{type:`multiple`,value:m,onValueChange:g,className:`flex flex-col h-full overflow-auto`,children:[O,A]}),e[25]=g,e[26]=m,e[27]=A,e[28]=O,e[29]=j):j=e[29],j};export{kt as default};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,r}from"./useEvent-Dc9HkKI2.js";import{t as i}from"./compiler-runtime-BQ9S8nyo.js";import{g as a}from"./useEventListener-BdZUApHd.js";import{t as o}from"./invariant-Ci2dTZ72.js";import{i as s,t as c}from"./utils-B4K466FK.js";function l(e,t){if(e==null)throw Error(t||`Expected value but got ${e}`)}var u=i();function d(){let e=r.get(h);return l(e,`internal-error: initial mode not found`),o(e!==`present`,`internal-error: initial mode cannot be 'present'`),e}function f(e){return e===`read`||e===`home`||e===`gallery`?e:e===`edit`?`present`:`edit`}async function p(e){let t=r.get(m);if(t.mode!==`edit`){await e();return}r.set(m,{...t,mode:`present`});try{await new Promise(e=>setTimeout(e,100)),await new Promise(e=>requestAnimationFrame(e)),await new Promise(e=>requestAnimationFrame(e)),await e()}finally{r.set(m,t)}}var m=t({mode:c()?`read`:`not-set`,cellAnchor:null}),h=t(void 0);function g(){let e=r.get(h);return e!==`home`&&e!==`gallery`}var _=t(!1);function v(){let e=(0,u.c)(1),{mode:t}=n(m),r=n(_),i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=new URLSearchParams(window.location.search).get(s.kiosk),e[0]=i):i=e[0],t!==`read`&&!r&&i!==`true`}var y=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toBig=e.shrSL=e.shrSH=e.rotrSL=e.rotrSH=e.rotrBL=e.rotrBH=e.rotr32L=e.rotr32H=e.rotlSL=e.rotlSH=e.rotlBL=e.rotlBH=e.add5L=e.add5H=e.add4L=e.add4H=e.add3L=e.add3H=void 0,e.add=v,e.fromBig=r,e.split=i;var t=BigInt(2**32-1),n=BigInt(32);function r(e,r=!1){return r?{h:Number(e&t),l:Number(e>>n&t)}:{h:Number(e>>n&t)|0,l:Number(e&t)|0}}function i(e,t=!1){let n=e.length,i=new Uint32Array(n),a=new Uint32Array(n);for(let o=0;o<n;o++){let{h:n,l:s}=r(e[o],t);[i[o],a[o]]=[n,s]}return[i,a]}var a=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);e.toBig=a;var o=(e,t,n)=>e>>>n;e.shrSH=o;var s=(e,t,n)=>e<<32-n|t>>>n;e.shrSL=s;var c=(e,t,n)=>e>>>n|t<<32-n;e.rotrSH=c;var l=(e,t,n)=>e<<32-n|t>>>n;e.rotrSL=l;var u=(e,t,n)=>e<<64-n|t>>>n-32;e.rotrBH=u;var d=(e,t,n)=>e>>>n-32|t<<64-n;e.rotrBL=d;var f=(e,t)=>t;e.rotr32H=f;var p=(e,t)=>e;e.rotr32L=p;var m=(e,t,n)=>e<<n|t>>>32-n;e.rotlSH=m;var h=(e,t,n)=>t<<n|e>>>32-n;e.rotlSL=h;var g=(e,t,n)=>t<<n-32|e>>>64-n;e.rotlBH=g;var _=(e,t,n)=>e<<n-32|t>>>64-n;e.rotlBL=_;function v(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var y=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);e.add3L=y;var b=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;e.add3H=b;var x=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);e.add4L=x;var S=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0;e.add4H=S;var C=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0);e.add5L=C;var w=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;e.add5H=w,e.default={fromBig:r,split:i,toBig:a,shrSH:o,shrSL:s,rotrSH:c,rotrSL:l,rotrBH:u,rotrBL:d,rotr32H:f,rotr32L:p,rotlSH:m,rotlSL:h,rotlBH:g,rotlBL:_,add:v,add3L:y,add3H:b,add4L:x,add4H:S,add5H:w,add5L:C}})),b=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0})),x=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=n,e.anumber=r,e.abytes=i,e.ahash=a,e.aexists=o,e.aoutput=s,e.u8=c,e.u32=l,e.clean=u,e.createView=d,e.rotr=f,e.rotl=p,e.byteSwap=m,e.byteSwap32=h,e.bytesToHex=v,e.hexToBytes=S,e.asyncLoop=C,e.utf8ToBytes=w,e.bytesToUtf8=T,e.toBytes=E,e.kdfInputToBytes=D,e.concatBytes=O,e.checkOpts=k,e.createHasher=A,e.createOptHasher=j,e.createXOFer=M,e.randomBytes=N;var t=b();function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function i(e,...t){if(!n(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function a(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);r(e.outputLen),r(e.blockLen)}function o(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function s(e,t){i(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function c(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function l(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function u(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function d(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function f(e,t){return e<<32-t|e>>>t}function p(e,t){return e<<t|e>>>32-t>>>0}e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function m(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}e.swap8IfBE=e.isLE?e=>e:e=>m(e),e.byteSwapIfBE=e.swap8IfBE;function h(e){for(let t=0;t<e.length;t++)e[t]=m(e[t]);return e}e.swap32IfBE=e.isLE?e=>e:h;var g=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,_=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function v(e){if(i(e),g)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=_[e[n]];return t}var y={_0:48,_9:57,A:65,F:70,a:97,f:102};function x(e){if(e>=y._0&&e<=y._9)return e-y._0;if(e>=y.A&&e<=y.F)return e-(y.A-10);if(e>=y.a&&e<=y.f)return e-(y.a-10)}function S(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(g)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=x(e.charCodeAt(i)),a=x(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}e.nextTick=async()=>{};async function C(t,n,r){let i=Date.now();for(let a=0;a<t;a++){r(a);let t=Date.now()-i;t>=0&&t<n||(await(0,e.nextTick)(),i+=t)}}function w(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function T(e){return new TextDecoder().decode(e)}function E(e){return typeof e==`string`&&(e=w(e)),i(e),e}function D(e){return typeof e==`string`&&(e=w(e)),i(e),e}function O(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];i(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function k(e,t){if(t!==void 0&&{}.toString.call(t)!==`[object Object]`)throw Error(`options should be object or undefined`);return Object.assign(e,t)}e.Hash=class{};function A(e){let t=t=>e().update(E(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function j(e){let t=(t,n)=>e(n).update(E(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function M(e){let t=(t,n)=>e(n).update(E(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}e.wrapConstructor=A,e.wrapConstructorWithOpts=j,e.wrapXOFConstructorWithOpts=M;function N(e=32){if(t.crypto&&typeof t.crypto.getRandomValues==`function`)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&typeof t.crypto.randomBytes==`function`)return Uint8Array.from(t.crypto.randomBytes(e));throw Error(`crypto.getRandomValues must be defined`)}})),S=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=void 0,e.keccakP=_;var t=y(),n=x(),r=BigInt(0),i=BigInt(1),a=BigInt(2),o=BigInt(7),s=BigInt(256),c=BigInt(113),l=[],u=[],d=[];for(let e=0,t=i,n=1,f=0;e<24;e++){[n,f]=[f,(2*n+3*f)%5],l.push(2*(5*f+n)),u.push((e+1)*(e+2)/2%64);let p=r;for(let e=0;e<7;e++)t=(t<<i^(t>>o)*c)%s,t&a&&(p^=i<<(i<<BigInt(e))-i);d.push(p)}var f=(0,t.split)(d,!0),p=f[0],m=f[1],h=(e,n,r)=>r>32?(0,t.rotlBH)(e,n,r):(0,t.rotlSH)(e,n,r),g=(e,n,r)=>r>32?(0,t.rotlBL)(e,n,r):(0,t.rotlSL)(e,n,r);function _(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,a=r[i],o=r[i+1],s=h(a,o,1)^r[n],c=g(a,o,1)^r[n+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=u[n],a=h(t,i,r),o=g(t,i,r),s=l[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=p[n],e[1]^=m[n]}(0,n.clean)(r)}var v=class e extends n.Hash{constructor(e,t,r,i=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=a,(0,n.anumber)(r),!(0<e&&e<200))throw Error(`only keccak-f1600 function is supported`);this.state=new Uint8Array(200),this.state32=(0,n.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,n.swap32IfBE)(this.state32),_(this.state32,this.rounds),(0,n.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(e){(0,n.aexists)(this),e=(0,n.toBytes)(e),(0,n.abytes)(e);let{blockLen:t,state:r}=this,i=e.length;for(let n=0;n<i;){let a=Math.min(t-this.pos,i-n);for(let t=0;t<a;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){(0,n.aexists)(this,!1),(0,n.abytes)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let a=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not possible for this instance`);return this.writeInto(e)}xof(e){return(0,n.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.aoutput)(e,this),this.finished)throw Error(`digest() was already called`);return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,n.clean)(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}};e.Keccak=v;var b=(e,t,r)=>(0,n.createHasher)(()=>new v(t,e,r));e.sha3_224=b(6,144,28),e.sha3_256=b(6,136,32),e.sha3_384=b(6,104,48),e.sha3_512=b(6,72,64),e.keccak_224=b(1,144,28),e.keccak_256=b(1,136,32),e.keccak_384=b(1,104,48),e.keccak_512=b(1,72,64);var S=(e,t,r)=>(0,n.createXOFer)((n={})=>new v(t,e,n.dkLen===void 0?r:n.dkLen,!0));e.shake128=S(31,168,16),e.shake256=S(31,136,32)})),C=e(((e,t)=>{var{sha3_512:n}=S(),r=24,i=32,a=(e=4,t=Math.random)=>{let n=``;for(;n.length<e;)n+=Math.floor(t()*36).toString(36);return n};function o(e){let t=0n;for(let n of e.values()){let e=BigInt(n);t=(t<<8n)+e}return t}var s=(e=``)=>o(n(e)).toString(36).slice(1),c=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),l=e=>c[Math.floor(e()*c.length)],u=({globalObj:e=typeof global<`u`?global:typeof window<`u`?window:{},random:t=Math.random}={})=>{let n=Object.keys(e).toString();return s(n.length?n+a(i,t):a(i,t)).substring(0,i)},d=e=>()=>e++,f=476782367,p=({random:e=Math.random,counter:t=d(Math.floor(e()*f)),length:n=r,fingerprint:i=u({random:e})}={})=>function(){let r=l(e),o=Date.now().toString(36),c=t().toString(36);return`${r+s(`${o+a(n,e)+c+i}`).substring(1,n)}`},m=p(),h=(e,{minLength:t=2,maxLength:n=i}={})=>{let r=e.length,a=/^[0-9a-z]+$/;try{if(typeof e==`string`&&r>=t&&r<=n&&a.test(e))return!0}finally{}return!1};t.exports.getConstants=()=>({defaultLength:r,bigLength:i}),t.exports.init=p,t.exports.createId=m,t.exports.bufToBigInt=o,t.exports.createCounter=d,t.exports.createFingerprint=u,t.exports.isCuid=h})),w=e(((e,t)=>{var{createId:n,init:r,getConstants:i,isCuid:a}=C();t.exports.createId=n,t.exports.init=r,t.exports.getConstants=i,t.exports.isCuid=a}));function T(e){return new URL(e,document.baseURI)}function E(e){let t=new URL(window.location.href);e(t.searchParams),window.history.replaceState({},``,t.toString())}function D(e,t){if(typeof window>`u`)return!1;let n=new URLSearchParams(window.location.search);return t===void 0?n.has(e):n.get(e)===t}function O(){let e=`__new__${N()}`;return T(`?file=${encodeURIComponent(e)}`).toString()}var k=/^(https?:\/\/\S+)$/;function A(e){return typeof e==`string`&&k.test(e)}function j({href:e,queryParams:t,keys:n}){let r=typeof t==`string`?new URLSearchParams(t):t;if(r.size===0||e.startsWith(`http://`)||e.startsWith(`https://`))return e;let i=e.startsWith(`#`),a=i&&e.includes(`?`);if(i&&!a){let t=n?[...r.entries()].filter(([e])=>n.includes(e)):[...r.entries()],i=new URLSearchParams;for(let[e,n]of t)i.set(e,n);let a=i.toString();return a?`/?${a}${e}`:e}let o=e,s=``,c=new URLSearchParams,l=+!!i,u=e.indexOf(`#`,l);u!==-1&&(s=e.slice(u),o=e.slice(0,u));let d=o.indexOf(`?`);d!==-1&&(c=new URLSearchParams(o.slice(d+1)),o=o.slice(0,d));let f=new URLSearchParams(c),p=n?[...r.entries()].filter(([e])=>n.includes(e)):[...r.entries()];for(let[e,t]of p)f.set(e,t);let m=f.toString();return m?`${o}?${m}${s}`:e}var M=(0,w().init)({length:6});function N(){return`s_${M()}`}function P(e){return e?/^s_[\da-z]{6}$/.test(e):!1}var F=null;function I(){let e=r.get(h)===`edit`,t=new URL(window.location.href).searchParams.get(s.sessionId),n=P(t)?t:null;return E(t=>{if(!e){t.delete(s.sessionId),t.delete(s.kiosk);return}t.has(s.kiosk)||t.delete(s.sessionId)}),n===null?(a.debug(`Starting a new session`,{sessionId:t}),N()):e?(a.debug(`Connecting to existing session`,{sessionId:n}),n):(a.debug(`Ignoring session_id from URL outside the editor`,{sessionId:n}),N())}function L(){return F===null&&(F=I()),F}export{m as _,A as a,T as c,h as d,g as f,v as g,f as h,D as i,w as l,p as m,P as n,O as o,_ as p,j as r,E as s,L as t,d as u,l as v};
1
+ import{t as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,r}from"./useEvent-Dc9HkKI2.js";import{t as i}from"./compiler-runtime-BQ9S8nyo.js";import{g as a}from"./useEventListener-CUPWI_1X.js";import{t as o}from"./invariant-Ci2dTZ72.js";import{i as s,t as c}from"./utils-B4K466FK.js";function l(e,t){if(e==null)throw Error(t||`Expected value but got ${e}`)}var u=i();function d(){let e=r.get(h);return l(e,`internal-error: initial mode not found`),o(e!==`present`,`internal-error: initial mode cannot be 'present'`),e}function f(e){return e===`read`||e===`home`||e===`gallery`?e:e===`edit`?`present`:`edit`}async function p(e){let t=r.get(m);if(t.mode!==`edit`){await e();return}r.set(m,{...t,mode:`present`});try{await new Promise(e=>setTimeout(e,100)),await new Promise(e=>requestAnimationFrame(e)),await new Promise(e=>requestAnimationFrame(e)),await e()}finally{r.set(m,t)}}var m=t({mode:c()?`read`:`not-set`,cellAnchor:null}),h=t(void 0);function g(){let e=r.get(h);return e!==`home`&&e!==`gallery`}var _=t(!1);function v(){let e=(0,u.c)(1),{mode:t}=n(m),r=n(_),i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=new URLSearchParams(window.location.search).get(s.kiosk),e[0]=i):i=e[0],t!==`read`&&!r&&i!==`true`}var y=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toBig=e.shrSL=e.shrSH=e.rotrSL=e.rotrSH=e.rotrBL=e.rotrBH=e.rotr32L=e.rotr32H=e.rotlSL=e.rotlSH=e.rotlBL=e.rotlBH=e.add5L=e.add5H=e.add4L=e.add4H=e.add3L=e.add3H=void 0,e.add=v,e.fromBig=r,e.split=i;var t=BigInt(2**32-1),n=BigInt(32);function r(e,r=!1){return r?{h:Number(e&t),l:Number(e>>n&t)}:{h:Number(e>>n&t)|0,l:Number(e&t)|0}}function i(e,t=!1){let n=e.length,i=new Uint32Array(n),a=new Uint32Array(n);for(let o=0;o<n;o++){let{h:n,l:s}=r(e[o],t);[i[o],a[o]]=[n,s]}return[i,a]}var a=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);e.toBig=a;var o=(e,t,n)=>e>>>n;e.shrSH=o;var s=(e,t,n)=>e<<32-n|t>>>n;e.shrSL=s;var c=(e,t,n)=>e>>>n|t<<32-n;e.rotrSH=c;var l=(e,t,n)=>e<<32-n|t>>>n;e.rotrSL=l;var u=(e,t,n)=>e<<64-n|t>>>n-32;e.rotrBH=u;var d=(e,t,n)=>e>>>n-32|t<<64-n;e.rotrBL=d;var f=(e,t)=>t;e.rotr32H=f;var p=(e,t)=>e;e.rotr32L=p;var m=(e,t,n)=>e<<n|t>>>32-n;e.rotlSH=m;var h=(e,t,n)=>t<<n|e>>>32-n;e.rotlSL=h;var g=(e,t,n)=>t<<n-32|e>>>64-n;e.rotlBH=g;var _=(e,t,n)=>e<<n-32|t>>>64-n;e.rotlBL=_;function v(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var y=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);e.add3L=y;var b=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;e.add3H=b;var x=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);e.add4L=x;var S=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0;e.add4H=S;var C=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0);e.add5L=C;var w=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;e.add5H=w,e.default={fromBig:r,split:i,toBig:a,shrSH:o,shrSL:s,rotrSH:c,rotrSL:l,rotrBH:u,rotrBL:d,rotr32H:f,rotr32L:p,rotlSH:m,rotlSL:h,rotlBH:g,rotlBL:_,add:v,add3L:y,add3H:b,add4L:x,add4H:S,add5H:w,add5L:C}})),b=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0})),x=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=n,e.anumber=r,e.abytes=i,e.ahash=a,e.aexists=o,e.aoutput=s,e.u8=c,e.u32=l,e.clean=u,e.createView=d,e.rotr=f,e.rotl=p,e.byteSwap=m,e.byteSwap32=h,e.bytesToHex=v,e.hexToBytes=S,e.asyncLoop=C,e.utf8ToBytes=w,e.bytesToUtf8=T,e.toBytes=E,e.kdfInputToBytes=D,e.concatBytes=O,e.checkOpts=k,e.createHasher=A,e.createOptHasher=j,e.createXOFer=M,e.randomBytes=N;var t=b();function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function i(e,...t){if(!n(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function a(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);r(e.outputLen),r(e.blockLen)}function o(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function s(e,t){i(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function c(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function l(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function u(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function d(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function f(e,t){return e<<32-t|e>>>t}function p(e,t){return e<<t|e>>>32-t>>>0}e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function m(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}e.swap8IfBE=e.isLE?e=>e:e=>m(e),e.byteSwapIfBE=e.swap8IfBE;function h(e){for(let t=0;t<e.length;t++)e[t]=m(e[t]);return e}e.swap32IfBE=e.isLE?e=>e:h;var g=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,_=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function v(e){if(i(e),g)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=_[e[n]];return t}var y={_0:48,_9:57,A:65,F:70,a:97,f:102};function x(e){if(e>=y._0&&e<=y._9)return e-y._0;if(e>=y.A&&e<=y.F)return e-(y.A-10);if(e>=y.a&&e<=y.f)return e-(y.a-10)}function S(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(g)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=x(e.charCodeAt(i)),a=x(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}e.nextTick=async()=>{};async function C(t,n,r){let i=Date.now();for(let a=0;a<t;a++){r(a);let t=Date.now()-i;t>=0&&t<n||(await(0,e.nextTick)(),i+=t)}}function w(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function T(e){return new TextDecoder().decode(e)}function E(e){return typeof e==`string`&&(e=w(e)),i(e),e}function D(e){return typeof e==`string`&&(e=w(e)),i(e),e}function O(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];i(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function k(e,t){if(t!==void 0&&{}.toString.call(t)!==`[object Object]`)throw Error(`options should be object or undefined`);return Object.assign(e,t)}e.Hash=class{};function A(e){let t=t=>e().update(E(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function j(e){let t=(t,n)=>e(n).update(E(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function M(e){let t=(t,n)=>e(n).update(E(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}e.wrapConstructor=A,e.wrapConstructorWithOpts=j,e.wrapXOFConstructorWithOpts=M;function N(e=32){if(t.crypto&&typeof t.crypto.getRandomValues==`function`)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&typeof t.crypto.randomBytes==`function`)return Uint8Array.from(t.crypto.randomBytes(e));throw Error(`crypto.getRandomValues must be defined`)}})),S=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=void 0,e.keccakP=_;var t=y(),n=x(),r=BigInt(0),i=BigInt(1),a=BigInt(2),o=BigInt(7),s=BigInt(256),c=BigInt(113),l=[],u=[],d=[];for(let e=0,t=i,n=1,f=0;e<24;e++){[n,f]=[f,(2*n+3*f)%5],l.push(2*(5*f+n)),u.push((e+1)*(e+2)/2%64);let p=r;for(let e=0;e<7;e++)t=(t<<i^(t>>o)*c)%s,t&a&&(p^=i<<(i<<BigInt(e))-i);d.push(p)}var f=(0,t.split)(d,!0),p=f[0],m=f[1],h=(e,n,r)=>r>32?(0,t.rotlBH)(e,n,r):(0,t.rotlSH)(e,n,r),g=(e,n,r)=>r>32?(0,t.rotlBL)(e,n,r):(0,t.rotlSL)(e,n,r);function _(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,a=r[i],o=r[i+1],s=h(a,o,1)^r[n],c=g(a,o,1)^r[n+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=u[n],a=h(t,i,r),o=g(t,i,r),s=l[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=p[n],e[1]^=m[n]}(0,n.clean)(r)}var v=class e extends n.Hash{constructor(e,t,r,i=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=a,(0,n.anumber)(r),!(0<e&&e<200))throw Error(`only keccak-f1600 function is supported`);this.state=new Uint8Array(200),this.state32=(0,n.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,n.swap32IfBE)(this.state32),_(this.state32,this.rounds),(0,n.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(e){(0,n.aexists)(this),e=(0,n.toBytes)(e),(0,n.abytes)(e);let{blockLen:t,state:r}=this,i=e.length;for(let n=0;n<i;){let a=Math.min(t-this.pos,i-n);for(let t=0;t<a;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){(0,n.aexists)(this,!1),(0,n.abytes)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let a=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+a),n),this.posOut+=a,n+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not possible for this instance`);return this.writeInto(e)}xof(e){return(0,n.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.aoutput)(e,this),this.finished)throw Error(`digest() was already called`);return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,n.clean)(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}};e.Keccak=v;var b=(e,t,r)=>(0,n.createHasher)(()=>new v(t,e,r));e.sha3_224=b(6,144,28),e.sha3_256=b(6,136,32),e.sha3_384=b(6,104,48),e.sha3_512=b(6,72,64),e.keccak_224=b(1,144,28),e.keccak_256=b(1,136,32),e.keccak_384=b(1,104,48),e.keccak_512=b(1,72,64);var S=(e,t,r)=>(0,n.createXOFer)((n={})=>new v(t,e,n.dkLen===void 0?r:n.dkLen,!0));e.shake128=S(31,168,16),e.shake256=S(31,136,32)})),C=e(((e,t)=>{var{sha3_512:n}=S(),r=24,i=32,a=(e=4,t=Math.random)=>{let n=``;for(;n.length<e;)n+=Math.floor(t()*36).toString(36);return n};function o(e){let t=0n;for(let n of e.values()){let e=BigInt(n);t=(t<<8n)+e}return t}var s=(e=``)=>o(n(e)).toString(36).slice(1),c=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),l=e=>c[Math.floor(e()*c.length)],u=({globalObj:e=typeof global<`u`?global:typeof window<`u`?window:{},random:t=Math.random}={})=>{let n=Object.keys(e).toString();return s(n.length?n+a(i,t):a(i,t)).substring(0,i)},d=e=>()=>e++,f=476782367,p=({random:e=Math.random,counter:t=d(Math.floor(e()*f)),length:n=r,fingerprint:i=u({random:e})}={})=>function(){let r=l(e),o=Date.now().toString(36),c=t().toString(36);return`${r+s(`${o+a(n,e)+c+i}`).substring(1,n)}`},m=p(),h=(e,{minLength:t=2,maxLength:n=i}={})=>{let r=e.length,a=/^[0-9a-z]+$/;try{if(typeof e==`string`&&r>=t&&r<=n&&a.test(e))return!0}finally{}return!1};t.exports.getConstants=()=>({defaultLength:r,bigLength:i}),t.exports.init=p,t.exports.createId=m,t.exports.bufToBigInt=o,t.exports.createCounter=d,t.exports.createFingerprint=u,t.exports.isCuid=h})),w=e(((e,t)=>{var{createId:n,init:r,getConstants:i,isCuid:a}=C();t.exports.createId=n,t.exports.init=r,t.exports.getConstants=i,t.exports.isCuid=a}));function T(e){return new URL(e,document.baseURI)}function E(e){let t=new URL(window.location.href);e(t.searchParams),window.history.replaceState({},``,t.toString())}function D(e,t){if(typeof window>`u`)return!1;let n=new URLSearchParams(window.location.search);return t===void 0?n.has(e):n.get(e)===t}function O(){let e=`__new__${N()}`;return T(`?file=${encodeURIComponent(e)}`).toString()}var k=/^(https?:\/\/\S+)$/;function A(e){return typeof e==`string`&&k.test(e)}function j({href:e,queryParams:t,keys:n}){let r=typeof t==`string`?new URLSearchParams(t):t;if(r.size===0||e.startsWith(`http://`)||e.startsWith(`https://`))return e;let i=e.startsWith(`#`),a=i&&e.includes(`?`);if(i&&!a){let t=n?[...r.entries()].filter(([e])=>n.includes(e)):[...r.entries()],i=new URLSearchParams;for(let[e,n]of t)i.set(e,n);let a=i.toString();return a?`/?${a}${e}`:e}let o=e,s=``,c=new URLSearchParams,l=+!!i,u=e.indexOf(`#`,l);u!==-1&&(s=e.slice(u),o=e.slice(0,u));let d=o.indexOf(`?`);d!==-1&&(c=new URLSearchParams(o.slice(d+1)),o=o.slice(0,d));let f=new URLSearchParams(c),p=n?[...r.entries()].filter(([e])=>n.includes(e)):[...r.entries()];for(let[e,t]of p)f.set(e,t);let m=f.toString();return m?`${o}?${m}${s}`:e}var M=(0,w().init)({length:6});function N(){return`s_${M()}`}function P(e){return e?/^s_[\da-z]{6}$/.test(e):!1}var F=null;function I(){let e=r.get(h)===`edit`,t=new URL(window.location.href).searchParams.get(s.sessionId),n=P(t)?t:null;return E(t=>{if(!e){t.delete(s.sessionId),t.delete(s.kiosk);return}t.has(s.kiosk)||t.delete(s.sessionId)}),n===null?(a.debug(`Starting a new session`,{sessionId:t}),N()):e?(a.debug(`Connecting to existing session`,{sessionId:n}),n):(a.debug(`Ignoring session_id from URL outside the editor`,{sessionId:n}),N())}function L(){return F===null&&(F=I()),F}export{m as _,A as a,T as c,h as d,g as f,v as g,f as h,D as i,w as l,p as m,P as n,O as o,_ as p,j as r,E as s,L as t,d as u,l as v};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CUdNIagt.js";import{Cn as n,D as r,Rt as i,_n as a,fn as o,gn as s,mn as c}from"./cells-CzugpTQu.js";import{t as l}from"./compiler-runtime-BQ9S8nyo.js";import{n as u}from"./useEventListener-BdZUApHd.js";import{r as d}from"./utils-B4K466FK.js";import{t as f}from"./cn-ldLVeaqm.js";import{t as p}from"./jsx-runtime-B74pBk57.js";import{t as m}from"./tooltip-DR2Z2N4w.js";import{t as h}from"./button-BoklZTGL.js";import{m as g}from"./panels-B48zp96D.js";import{n as _,t as v}from"./LazyAnyLanguageCodeMirror-B_IYTCX5.js";import{r as y}from"./useNumberFormatter-C4-_TnkF.js";import{b}from"./write-secret-modal-BiG2tahJ.js";import{t as x}from"./plus-gbN72xHe.js";import{Gt as S,Kt as C,Wt as w,Xt as T,qt as E}from"./input-BDakodZ2.js";import{st as D}from"./dist-BczecT6V.js";import{r as O}from"./requests-yTHMxhVa.js";import{r as k}from"./useTheme-DcnXlv0_.js";import{n as A}from"./useAsyncData-DucTwMkf.js";import{Ei as j,Hn as M,Qr as N,gn as P,hn as F,mn as I}from"./index-DafnX1Xx.js";import{t as L}from"./empty-state-CzxjZqGW.js";import{n as R,r as z}from"./panel-context-BPaQeOuV.js";import{i as B}from"./edit-page-jGNYBqQo.js";var V=e(t(),1),H=l(),U=p(),W=u,G=e=>{let t=(0,H.c)(6),{children:n}=e,{openModal:r,closeModal:i}=b(),a;t[0]!==i||t[1]!==r?(a=()=>r((0,U.jsx)(K,{onClose:i})),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;return t[3]!==n||t[4]!==a?(o=(0,U.jsx)(W,{onClick:a,children:n}),t[3]=n,t[4]=a,t[5]=o):o=t[5],o},K=e=>{let t=(0,H.c)(4),{onClose:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,U.jsx)(T,{children:`Contribute a Snippet`}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsxs)(E,{children:[r,(0,U.jsxs)(S,{children:[`Have a useful snippet you want to share with the community? Make a pull request`,` `,(0,U.jsx)(`a`,{href:d.githubPage,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`on GitHub`}),`.`]})]}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,U.jsxs)(w,{className:`max-w-md`,children:[i,(0,U.jsx)(C,{children:(0,U.jsx)(h,{"data-testid":`snippet-close-button`,variant:`default`,onClick:n,children:`Close`})})]}),t[2]=n,t[3]=a),a},q=[D.lineWrapping],J=()=>{let e=(0,H.c)(24),{readSnippets:t}=O(),[n,r]=V.useState(),i=R(),a=z(),l;e[0]===t?l=e[1]:(l=()=>t(),e[0]=t,e[1]=l);let u;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],e[2]=u):u=e[2];let{data:d,error:p,isPending:m}=A(l,u);if(p){let t;return e[3]===p?t=e[4]:(t=(0,U.jsx)(M,{error:p}),e[3]=p,e[4]=t),t}if(m||!d){let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(N,{size:`medium`,centered:!0}),e[5]=t):t=e[5],t}let h=i===`vertical`,g;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,U.jsx)(s,{placeholder:`Search snippets...`,className:`h-6 m-1`,rootClassName:`flex-1 border-r`}),e[6]=g):g=e[6];let _,v;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,U.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[g,(0,U.jsx)(G,{children:(0,U.jsx)(`button`,{className:`float-right px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,children:(0,U.jsx)(x,{className:`h-4 w-4`})})})]}),v=(0,U.jsx)(c,{children:`No results`}),e[7]=_,e[8]=v):(_=e[7],v=e[8]);let y;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>r(e),e[9]=y):y=e[9];let b;e[10]===d.snippets?b=e[11]:(b=(0,U.jsx)(I,{defaultSize:40,minSize:20,maxSize:70,children:(0,U.jsxs)(o,{className:`h-full rounded-none`,children:[_,v,(0,U.jsx)(X,{onSelect:y,snippets:d.snippets})]})}),e[10]=d.snippets,e[11]=b);let S=h?`h-1`:`w-1`,C;e[12]===S?C=e[13]:(C=f(`bg-border hover:bg-primary/50 transition-colors`,S),e[12]=S,e[13]=C);let w;e[14]===C?w=e[15]:(w=(0,U.jsx)(P,{className:C}),e[14]=C,e[15]=w);let T;e[16]===n?T=e[17]:(T=(0,U.jsx)(I,{defaultSize:60,minSize:20,children:(0,U.jsx)(V.Suspense,{children:(0,U.jsx)(`div`,{className:`h-full snippet-viewer flex flex-col overflow-hidden`,children:n?(0,U.jsx)(Y,{snippet:n,onClose:()=>r(void 0)},n.title):(0,U.jsx)(L,{title:``,description:`Click on a snippet to view its content.`})})})}),e[16]=n,e[17]=T);let E;return e[18]!==i||e[19]!==a||e[20]!==T||e[21]!==b||e[22]!==w?(E=(0,U.jsx)(`div`,{className:`flex-1 overflow-hidden h-full`,children:(0,U.jsxs)(F,{direction:i,className:`h-full`,children:[b,w,T]},a)}),e[18]=i,e[19]=a,e[20]=T,e[21]=b,e[22]=w,e[23]=E):E=e[23],E},Y=e=>{let t=(0,H.c)(33),{snippet:n,onClose:a}=e,{theme:o}=k(),{createNewCell:s}=r(),c=i(),l;t[0]!==s||t[1]!==c||t[2]!==n.sections?(l=()=>{for(let e of n.sections.toReversed())e.code&&s({code:e.code,before:!1,cellId:c??`__end__`,skipIfCodeExists:!0})},t[0]=s,t[1]=c,t[2]=n.sections,t[3]=l):l=t[3];let u=l,d;t[4]!==s||t[5]!==c?(d=e=>{s({code:e,before:!1,cellId:c??`__end__`})},t[4]=s,t[5]=c,t[6]=d):d=t[6];let f=d,p;t[7]===n.title?p=t[8]:(p=(0,U.jsx)(`span`,{children:n.title}),t[7]=n.title,t[8]=p);let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,U.jsx)(y,{className:`h-4 w-4`}),t[9]=b):b=t[9];let x;t[10]===a?x=t[11]:(x=(0,U.jsx)(h,{size:`sm`,variant:`ghost`,onClick:a,className:`h-6 w-6 p-0 hover:bg-muted-foreground/10`,children:b}),t[10]=a,t[11]=x);let S;t[12]!==p||t[13]!==x?(S=(0,U.jsxs)(`div`,{className:`text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center`,children:[p,x]}),t[12]=p,t[13]=x,t[14]=S):S=t[14];let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,U.jsx)(_,{className:`ml-2 h-4 w-4`}),t[15]=C):C=t[15];let w;t[16]===u?w=t[17]:(w=(0,U.jsx)(`div`,{className:`flex justify-end`,children:(0,U.jsx)(B,{children:(0,U.jsxs)(h,{className:`float-right`,size:`xs`,variant:`outline`,onClick:u,children:[`Insert snippet`,C]})})}),t[16]=u,t[17]=w);let T;if(t[18]!==f||t[19]!==n.sections||t[20]!==n.title||t[21]!==o){let e;t[23]!==f||t[24]!==n.title||t[25]!==o?(e=e=>{let{code:t,html:r,id:i}=e;if(r)return(0,U.jsx)(`div`,{children:j({html:r})},`${n.title}-${i}`);if(!t)return null;let{language:a,code:s}=g(t);return(0,U.jsxs)(`div`,{className:`relative hover-actions-parent pr-2`,children:[(0,U.jsx)(B,{children:(0,U.jsx)(m,{content:`Insert snippet`,children:(0,U.jsx)(h,{className:`absolute -top-2 -right-1 z-10 hover-action px-2 bg-background`,size:`sm`,variant:`outline`,onClick:()=>{f(t)},children:(0,U.jsx)(_,{className:`h-5 w-5`})})})}),(0,U.jsx)(V.Suspense,{children:(0,U.jsx)(v,{theme:o===`dark`?`dark`:`light`,language:a,className:`cm border rounded overflow-hidden`,extensions:q,value:s,readOnly:!0},`${n.title}-${i}`)})]},`${n.title}-${i}`)},t[23]=f,t[24]=n.title,t[25]=o,t[26]=e):e=t[26],T=n.sections.map(e),t[18]=f,t[19]=n.sections,t[20]=n.title,t[21]=o,t[22]=T}else T=t[22];let E;t[27]!==w||t[28]!==T?(E=(0,U.jsxs)(`div`,{className:`px-2 py-2 space-y-4 overflow-auto flex-1`,children:[w,T]}),t[27]=w,t[28]=T,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==S?(D=(0,U.jsxs)(U.Fragment,{children:[S,E]}),t[30]=E,t[31]=S,t[32]=D):D=t[32],D},X=e=>{let t=(0,H.c)(7),{snippets:r,onSelect:i}=e,o;if(t[0]!==i||t[1]!==r){let e;t[3]===i?e=t[4]:(e=e=>(0,U.jsx)(a,{className:`rounded-none`,onSelect:()=>i(e),children:(0,U.jsx)(`div`,{className:`flex flex-row gap-2 items-center`,children:(0,U.jsx)(`span`,{className:`mt-1 text-accent-foreground`,children:e.title})})},e.title),t[3]=i,t[4]=e),o=r.map(e),t[0]=i,t[1]=r,t[2]=o}else o=t[2];let s;return t[5]===o?s=t[6]:(s=(0,U.jsx)(n,{className:`flex flex-col overflow-auto`,children:o}),t[5]=o,t[6]=s),s};export{J as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CUdNIagt.js";import{Cn as n,D as r,Rt as i,_n as a,fn as o,gn as s,mn as c}from"./cells-CU9huD49.js";import{t as l}from"./compiler-runtime-BQ9S8nyo.js";import{n as u}from"./useEventListener-CUPWI_1X.js";import{r as d}from"./utils-B4K466FK.js";import{t as f}from"./cn-ldLVeaqm.js";import{t as p}from"./jsx-runtime-B74pBk57.js";import{t as m}from"./tooltip-CamoSiGF.js";import{t as h}from"./button-qFeU84ax.js";import{m as g}from"./panels-C5xQNcZv.js";import{n as _,t as v}from"./LazyAnyLanguageCodeMirror-CaEYnB8x.js";import{r as y}from"./useNumberFormatter-C4-_TnkF.js";import{b}from"./write-secret-modal-wFgr-1dA.js";import{t as x}from"./plus-gbN72xHe.js";import{Gt as S,Kt as C,Wt as w,Xt as T,qt as E}from"./input-D4bMj5Nb.js";import{st as D}from"./dist-BczecT6V.js";import{r as O}from"./requests-yTHMxhVa.js";import{r as k}from"./useTheme-CnWB5G1X.js";import{n as A}from"./useAsyncData-DucTwMkf.js";import{Ei as j,Hn as M,Qr as N,gn as P,hn as F,mn as I}from"./index-C9FPQNuH.js";import{t as L}from"./empty-state-CzxjZqGW.js";import{n as R,r as z}from"./panel-context-BPaQeOuV.js";import{i as B}from"./edit-page-CWbb1Sdk.js";var V=e(t(),1),H=l(),U=p(),W=u,G=e=>{let t=(0,H.c)(6),{children:n}=e,{openModal:r,closeModal:i}=b(),a;t[0]!==i||t[1]!==r?(a=()=>r((0,U.jsx)(K,{onClose:i})),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;return t[3]!==n||t[4]!==a?(o=(0,U.jsx)(W,{onClick:a,children:n}),t[3]=n,t[4]=a,t[5]=o):o=t[5],o},K=e=>{let t=(0,H.c)(4),{onClose:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,U.jsx)(T,{children:`Contribute a Snippet`}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsxs)(E,{children:[r,(0,U.jsxs)(S,{children:[`Have a useful snippet you want to share with the community? Make a pull request`,` `,(0,U.jsx)(`a`,{href:d.githubPage,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`on GitHub`}),`.`]})]}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,U.jsxs)(w,{className:`max-w-md`,children:[i,(0,U.jsx)(C,{children:(0,U.jsx)(h,{"data-testid":`snippet-close-button`,variant:`default`,onClick:n,children:`Close`})})]}),t[2]=n,t[3]=a),a},q=[D.lineWrapping],J=()=>{let e=(0,H.c)(24),{readSnippets:t}=O(),[n,r]=V.useState(),i=R(),a=z(),l;e[0]===t?l=e[1]:(l=()=>t(),e[0]=t,e[1]=l);let u;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],e[2]=u):u=e[2];let{data:d,error:p,isPending:m}=A(l,u);if(p){let t;return e[3]===p?t=e[4]:(t=(0,U.jsx)(M,{error:p}),e[3]=p,e[4]=t),t}if(m||!d){let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(N,{size:`medium`,centered:!0}),e[5]=t):t=e[5],t}let h=i===`vertical`,g;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,U.jsx)(s,{placeholder:`Search snippets...`,className:`h-6 m-1`,rootClassName:`flex-1 border-r`}),e[6]=g):g=e[6];let _,v;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,U.jsxs)(`div`,{className:`flex items-center w-full border-b`,children:[g,(0,U.jsx)(G,{children:(0,U.jsx)(`button`,{className:`float-right px-2 m-0 h-full hover:bg-accent hover:text-accent-foreground`,children:(0,U.jsx)(x,{className:`h-4 w-4`})})})]}),v=(0,U.jsx)(c,{children:`No results`}),e[7]=_,e[8]=v):(_=e[7],v=e[8]);let y;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>r(e),e[9]=y):y=e[9];let b;e[10]===d.snippets?b=e[11]:(b=(0,U.jsx)(I,{defaultSize:40,minSize:20,maxSize:70,children:(0,U.jsxs)(o,{className:`h-full rounded-none`,children:[_,v,(0,U.jsx)(X,{onSelect:y,snippets:d.snippets})]})}),e[10]=d.snippets,e[11]=b);let S=h?`h-1`:`w-1`,C;e[12]===S?C=e[13]:(C=f(`bg-border hover:bg-primary/50 transition-colors`,S),e[12]=S,e[13]=C);let w;e[14]===C?w=e[15]:(w=(0,U.jsx)(P,{className:C}),e[14]=C,e[15]=w);let T;e[16]===n?T=e[17]:(T=(0,U.jsx)(I,{defaultSize:60,minSize:20,children:(0,U.jsx)(V.Suspense,{children:(0,U.jsx)(`div`,{className:`h-full snippet-viewer flex flex-col overflow-hidden`,children:n?(0,U.jsx)(Y,{snippet:n,onClose:()=>r(void 0)},n.title):(0,U.jsx)(L,{title:``,description:`Click on a snippet to view its content.`})})})}),e[16]=n,e[17]=T);let E;return e[18]!==i||e[19]!==a||e[20]!==T||e[21]!==b||e[22]!==w?(E=(0,U.jsx)(`div`,{className:`flex-1 overflow-hidden h-full`,children:(0,U.jsxs)(F,{direction:i,className:`h-full`,children:[b,w,T]},a)}),e[18]=i,e[19]=a,e[20]=T,e[21]=b,e[22]=w,e[23]=E):E=e[23],E},Y=e=>{let t=(0,H.c)(33),{snippet:n,onClose:a}=e,{theme:o}=k(),{createNewCell:s}=r(),c=i(),l;t[0]!==s||t[1]!==c||t[2]!==n.sections?(l=()=>{for(let e of n.sections.toReversed())e.code&&s({code:e.code,before:!1,cellId:c??`__end__`,skipIfCodeExists:!0})},t[0]=s,t[1]=c,t[2]=n.sections,t[3]=l):l=t[3];let u=l,d;t[4]!==s||t[5]!==c?(d=e=>{s({code:e,before:!1,cellId:c??`__end__`})},t[4]=s,t[5]=c,t[6]=d):d=t[6];let f=d,p;t[7]===n.title?p=t[8]:(p=(0,U.jsx)(`span`,{children:n.title}),t[7]=n.title,t[8]=p);let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,U.jsx)(y,{className:`h-4 w-4`}),t[9]=b):b=t[9];let x;t[10]===a?x=t[11]:(x=(0,U.jsx)(h,{size:`sm`,variant:`ghost`,onClick:a,className:`h-6 w-6 p-0 hover:bg-muted-foreground/10`,children:b}),t[10]=a,t[11]=x);let S;t[12]!==p||t[13]!==x?(S=(0,U.jsxs)(`div`,{className:`text-sm font-semibold bg-muted border-y px-2 py-1 flex justify-between items-center`,children:[p,x]}),t[12]=p,t[13]=x,t[14]=S):S=t[14];let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,U.jsx)(_,{className:`ml-2 h-4 w-4`}),t[15]=C):C=t[15];let w;t[16]===u?w=t[17]:(w=(0,U.jsx)(`div`,{className:`flex justify-end`,children:(0,U.jsx)(B,{children:(0,U.jsxs)(h,{className:`float-right`,size:`xs`,variant:`outline`,onClick:u,children:[`Insert snippet`,C]})})}),t[16]=u,t[17]=w);let T;if(t[18]!==f||t[19]!==n.sections||t[20]!==n.title||t[21]!==o){let e;t[23]!==f||t[24]!==n.title||t[25]!==o?(e=e=>{let{code:t,html:r,id:i}=e;if(r)return(0,U.jsx)(`div`,{children:j({html:r})},`${n.title}-${i}`);if(!t)return null;let{language:a,code:s}=g(t);return(0,U.jsxs)(`div`,{className:`relative hover-actions-parent pr-2`,children:[(0,U.jsx)(B,{children:(0,U.jsx)(m,{content:`Insert snippet`,children:(0,U.jsx)(h,{className:`absolute -top-2 -right-1 z-10 hover-action px-2 bg-background`,size:`sm`,variant:`outline`,onClick:()=>{f(t)},children:(0,U.jsx)(_,{className:`h-5 w-5`})})})}),(0,U.jsx)(V.Suspense,{children:(0,U.jsx)(v,{theme:o===`dark`?`dark`:`light`,language:a,className:`cm border rounded overflow-hidden`,extensions:q,value:s,readOnly:!0},`${n.title}-${i}`)})]},`${n.title}-${i}`)},t[23]=f,t[24]=n.title,t[25]=o,t[26]=e):e=t[26],T=n.sections.map(e),t[18]=f,t[19]=n.sections,t[20]=n.title,t[21]=o,t[22]=T}else T=t[22];let E;t[27]!==w||t[28]!==T?(E=(0,U.jsxs)(`div`,{className:`px-2 py-2 space-y-4 overflow-auto flex-1`,children:[w,T]}),t[27]=w,t[28]=T,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==S?(D=(0,U.jsxs)(U.Fragment,{children:[S,E]}),t[30]=E,t[31]=S,t[32]=D):D=t[32],D},X=e=>{let t=(0,H.c)(7),{snippets:r,onSelect:i}=e,o;if(t[0]!==i||t[1]!==r){let e;t[3]===i?e=t[4]:(e=e=>(0,U.jsx)(a,{className:`rounded-none`,onSelect:()=>i(e),children:(0,U.jsx)(`div`,{className:`flex flex-row gap-2 items-center`,children:(0,U.jsx)(`span`,{className:`mt-1 text-accent-foreground`,children:e.title})})},e.title),t[3]=i,t[4]=e),o=r.map(e),t[0]=i,t[1]=r,t[2]=o}else o=t[2];let s;return t[5]===o?s=t[6]:(s=(0,U.jsx)(n,{className:`flex flex-col overflow-auto`,children:o}),t[5]=o,t[6]=s),s};export{J as default};
@@ -1 +1 @@
1
- import{l as e}from"./useEvent-Dc9HkKI2.js";import{t}from"./createReducer-BPvK7C_R.js";import{t as n}from"./uuid-k9DpjH68.js";function r(){return{pendingCommands:[],isReady:!1}}var{reducer:i,createActions:a,valueAtom:o,useActions:s}=t(r,{addCommand:(e,t)=>{let r={id:n(),text:t,timestamp:Date.now()};return{...e,pendingCommands:[...e.pendingCommands,r]}},removeCommand:(e,t)=>({...e,pendingCommands:e.pendingCommands.filter(e=>e.id!==t)}),setReady:(e,t)=>({...e,isReady:t}),clearCommands:e=>({...e,pendingCommands:[]})}),c=()=>e(o);function l(){return s()}export{c as n,l as t};
1
+ import{l as e}from"./useEvent-Dc9HkKI2.js";import{t}from"./createReducer-CI8rlZE9.js";import{t as n}from"./uuid-k9DpjH68.js";function r(){return{pendingCommands:[],isReady:!1}}var{reducer:i,createActions:a,valueAtom:o,useActions:s}=t(r,{addCommand:(e,t)=>{let r={id:n(),text:t,timestamp:Date.now()};return{...e,pendingCommands:[...e.pendingCommands,r]}},removeCommand:(e,t)=>({...e,pendingCommands:e.pendingCommands.filter(e=>e.id!==t)}),setReady:(e,t)=>({...e,isReady:t}),clearCommands:e=>({...e,pendingCommands:[]})}),c=()=>e(o);function l(){return s()}export{c as n,l as t};
@@ -1 +1 @@
1
- import{t as e}from"./dagre-DVyyr7Cb.js";import{t}from"./graphlib-3maKwbRO.js";import{_ as n,v as r}from"./step-CriubqJO.js";import{g as i}from"./chunk-75Z2AOVW-BzzYECN7.js";import{u as a}from"./src-BpnPuKEN.js";import{n as o}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as s}from"./src-Cyu5G-Tr.js";import{O as c,c as l,s as u,x as d}from"./chunk-DU6HZSFF-BlpgvKzl.js";import"./chunk-P2QGCYS3-_SeE0QXb.js";import"./chunk-PWAF6VOD-BZoBqp8x.js";import"./chunk-GMAD6QVW-hv6IsAru.js";import"./chunk-4HAMMTFA-C6Tl7kEY.js";import"./chunk-GVQU2GXP-Duv4ZYb-.js";import"./chunk-L3NEJ4N5-B2hafvRU.js";import"./chunk-OSK3NFVY-SNGRdtNA.js";import"./mermaid-D_jPUVqz.js";import"./chunk-F27PBJKO-BVIgLGPF.js";import"./chunk-XXDRQBXY-BwqwIlJV.js";import"./chunk-POPQ4Y6H-BB5NNJFE.js";import{i as f,n as p,t as m}from"./chunk-IMKFNOWR-BIILwBhp.js";var h=o(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,d().state.sizeUnit).attr(`cx`,d().state.padding+d().state.sizeUnit).attr(`cy`,d().state.padding+d().state.sizeUnit),`drawStartState`),g=o(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,d().state.textHeight).attr(`class`,`divider`).attr(`x2`,d().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=o((e,t)=>{let n=e.append(`text`).attr(`x`,2*d().state.padding).attr(`y`,d().state.textHeight+2*d().state.padding).attr(`font-size`,d().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,d().state.padding).attr(`y`,d().state.padding).attr(`width`,r.width+2*d().state.padding).attr(`height`,r.height+2*d().state.padding).attr(`rx`,d().state.radius),n},`drawSimpleState`),v=o((e,t)=>{let n=o(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*d().state.padding).text(t);n||r.attr(`dy`,d().state.textHeight)},`addTspan`),r=e.append(`text`).attr(`x`,2*d().state.padding).attr(`y`,d().state.textHeight+1.3*d().state.padding).attr(`font-size`,d().state.fontSize).attr(`class`,`state-title`).text(t.descriptions[0]).node().getBBox(),i=r.height,a=e.append(`text`).attr(`x`,d().state.padding).attr(`y`,i+d().state.padding*.4+d().state.dividerMargin+d().state.textHeight).attr(`class`,`state-description`),s=!0,c=!0;t.descriptions.forEach(function(e){s||(n(a,e,c),c=!1),s=!1});let l=e.append(`line`).attr(`x1`,d().state.padding).attr(`y1`,d().state.padding+i+d().state.dividerMargin/2).attr(`y2`,d().state.padding+i+d().state.dividerMargin/2).attr(`class`,`descr-divider`),u=a.node().getBBox(),f=Math.max(u.width,r.width);return l.attr(`x2`,f+3*d().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,d().state.padding).attr(`y`,d().state.padding).attr(`width`,f+2*d().state.padding).attr(`height`,u.height+i+2*d().state.padding).attr(`rx`,d().state.radius),e},`drawDescrState`),y=o((e,t,n)=>{let r=d().state.padding,i=2*d().state.padding,a=e.node().getBBox(),o=a.width,s=a.x,c=e.append(`text`).attr(`x`,0).attr(`y`,d().state.titleShift).attr(`font-size`,d().state.fontSize).attr(`class`,`state-title`).text(t.id),l=c.node().getBBox().width+i,u=Math.max(l,o);u===o&&(u+=i);let f,p=e.node().getBBox();t.doc,f=s-r,l>o&&(f=(o-u)/2+r),Math.abs(s-p.x)<r&&l>o&&(f=s-(l-o)/2);let m=1-d().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,u).attr(`height`,p.height+d().state.textHeight+d().state.titleShift+1).attr(`rx`,`0`),c.attr(`x`,f+r),l<=o&&c.attr(`x`,s+(u-i)/2-l/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,d().state.titleShift-d().state.textHeight-d().state.padding).attr(`width`,u).attr(`height`,d().state.textHeight*3).attr(`rx`,d().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,d().state.titleShift-d().state.textHeight-d().state.padding).attr(`width`,u).attr(`height`,p.height+3+2*d().state.textHeight).attr(`rx`,d().state.radius),e},`addTitleAndBox`),b=o(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,d().state.sizeUnit+d().state.miniPadding).attr(`cx`,d().state.padding+d().state.sizeUnit+d().state.miniPadding).attr(`cy`,d().state.padding+d().state.sizeUnit+d().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,d().state.sizeUnit).attr(`cx`,d().state.padding+d().state.sizeUnit+2).attr(`cy`,d().state.padding+d().state.sizeUnit+2)),`drawEndState`),x=o((e,t)=>{let n=d().state.forkWidth,r=d().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,d().state.padding).attr(`y`,d().state.padding)},`drawForkJoinState`),S=o((e,t,n,r)=>{let i=0,a=r.append(`text`);a.style(`text-anchor`,`start`),a.attr(`class`,`noteText`);let o=e.replace(/\r\n/g,`<br/>`);o=o.replace(/\n/g,`<br/>`);let s=o.split(u.lineBreakRegex),c=1.25*d().state.noteMargin;for(let e of s){let r=e.trim();if(r.length>0){let e=a.append(`tspan`);if(e.text(r),c===0){let t=e.node().getBBox();c+=t.height}i+=c,e.attr(`x`,t+d().state.noteMargin),e.attr(`y`,n+i+1.25*d().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},`_drawLongText`),C=o((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,d().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*d().state.noteMargin),n.attr(`width`,r+d().state.noteMargin*2),n},`drawNote`),w=o(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type==="default"&&t.descriptions.length===0&&_(i,t),t.type==="default"&&t.descriptions.length>0&&v(i,t);let a=i.node().getBBox();return r.width=a.width+2*d().state.padding,r.height=a.height+2*d().state.padding,r},`drawState`),T=0,E=o(function(e,t,a){let l=o(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);t.points=t.points.filter(e=>!Number.isNaN(e.y));let f=t.points,p=r().x(function(e){return e.x}).y(function(e){return e.y}).curve(n),h=e.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(d().state.arrowMarkerAbsolute&&(g=c(!0)),h.attr(`marker-end`,`url(`+g+`#`+l(m.relationType.DEPENDENCY)+`End)`),a.title!==void 0){let n=e.append(`g`).attr(`class`,`stateLabel`),{x:r,y:o}=i.calcLabelPosition(t.points),c=u.getRows(a.title),l=0,f=[],p=0,m=0;for(let e=0;e<=c.length;e++){let t=n.append(`text`).attr(`text-anchor`,`middle`).text(c[e]).attr(`x`,r).attr(`y`,o+l),i=t.node().getBBox();p=Math.max(p,i.width),m=Math.min(m,i.x),s.info(i.x,r,o+l),l===0&&(l=t.node().getBBox().height,s.info(`Title height`,l,o)),f.push(t)}let h=l*c.length;if(c.length>1){let e=(c.length-1)*l*.5;f.forEach((t,n)=>t.attr(`y`,o+n*l-e)),h=l*c.length}let g=n.node().getBBox();n.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-d().state.padding/2).attr(`y`,o-h/2-d().state.padding/2-3.5).attr(`width`,p+d().state.padding).attr(`height`,h+d().state.padding),s.info(g)}T++},`drawEdge`),D,O={},k=o(function(){},`setConf`),A=o(function(e){e.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 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=o(function(e,t,n,r){D=d().state;let i=d().securityLevel,o;i===`sandbox`&&(o=a(`#i`+t));let c=a(i===`sandbox`?o.nodes()[0].contentDocument.body:`body`),u=i===`sandbox`?o.nodes()[0].contentDocument:document;s.debug(`Rendering diagram `+e);let f=c.select(`[id='${t}']`);A(f),N(r.db.getRootDoc(),f.append(`g`).attr(`id`,t+`-root`),void 0,!1,c,u,r);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2,_=h*1.75;l(f,g,_,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=o(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=o((n,r,i,a,o,c,l)=>{let d=new t({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<n.length;f++)if(n[f].stmt===`relation`){p=!1;break}i?d.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):d.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),d.setDefaultEdgeLabel(function(){return{}});let m=l.db.getStates(),h=l.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];i&&(t.parentId=i);let n;if(t.doc){let e=r.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);n=N(t.doc,e,t.id,!a,o,c,l);{e=y(e,t,a);let r=e.node().getBBox();n.width=r.width,n.height=r.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else n=w(r,t,d);if(t.note){let e=w(r,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},d);t.note.position===`left of`?(d.setNode(n.id+`-note`,e),d.setNode(n.id,n)):(d.setNode(n.id,n),d.setNode(n.id+`-note`,e)),d.setParent(n.id,n.id+`-group`),d.setParent(n.id+`-note`,n.id+`-group`)}else d.setNode(n.id,n)}s.debug(`Count=`,d.nodeCount(),d);let _=0;h.forEach(function(e){_++,s.debug(`Setting edge`,e),d.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*u.getRows(e.title).length,labelpos:`c`},`id`+_)}),e(d),s.debug(`Graph after layout`,d.nodes());let v=r.node();d.nodes().forEach(function(e){e!==void 0&&d.node(e)!==void 0?(s.warn(`Node `+e+`: `+JSON.stringify(d.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(d.node(e).x-d.node(e).width/2)+`,`+(d.node(e).y+(O[e]?O[e].y:0)-d.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,d.node(e).x-d.node(e).width/2),c.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):s.debug(`No Node `+e+`: `+JSON.stringify(d.node(e)))});let b=v.getBBox();d.edges().forEach(function(e){e!==void 0&&d.edge(e)!==void 0&&(s.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(d.edge(e))),E(r,d.edge(e),d.edge(e).relation))}),b=v.getBBox();let x={id:i||`root`,label:i||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,s.debug(`Doc rendered`,x,d),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:o(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
1
+ import{t as e}from"./dagre-DkKsNZNe.js";import{t}from"./graphlib-6Yb0YQgW.js";import{_ as n,v as r}from"./step-CriubqJO.js";import{g as i}from"./chunk-75Z2AOVW-BzzYECN7.js";import{u as a}from"./src-BpnPuKEN.js";import{n as o}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as s}from"./src-Cyu5G-Tr.js";import{O as c,c as l,s as u,x as d}from"./chunk-DU6HZSFF-BlpgvKzl.js";import"./chunk-P2QGCYS3-_SeE0QXb.js";import"./chunk-PWAF6VOD-BZoBqp8x.js";import"./chunk-GMAD6QVW-hv6IsAru.js";import"./chunk-4HAMMTFA-C6Tl7kEY.js";import"./chunk-GVQU2GXP-Duv4ZYb-.js";import"./chunk-L3NEJ4N5-B2hafvRU.js";import"./chunk-OSK3NFVY-SNGRdtNA.js";import"./mermaid-DpSqZGNM.js";import"./chunk-F27PBJKO-BVIgLGPF.js";import"./chunk-XXDRQBXY-BwqwIlJV.js";import"./chunk-POPQ4Y6H-BB5NNJFE.js";import{i as f,n as p,t as m}from"./chunk-IMKFNOWR-s8kQsL8K.js";var h=o(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,d().state.sizeUnit).attr(`cx`,d().state.padding+d().state.sizeUnit).attr(`cy`,d().state.padding+d().state.sizeUnit),`drawStartState`),g=o(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,d().state.textHeight).attr(`class`,`divider`).attr(`x2`,d().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=o((e,t)=>{let n=e.append(`text`).attr(`x`,2*d().state.padding).attr(`y`,d().state.textHeight+2*d().state.padding).attr(`font-size`,d().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,d().state.padding).attr(`y`,d().state.padding).attr(`width`,r.width+2*d().state.padding).attr(`height`,r.height+2*d().state.padding).attr(`rx`,d().state.radius),n},`drawSimpleState`),v=o((e,t)=>{let n=o(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*d().state.padding).text(t);n||r.attr(`dy`,d().state.textHeight)},`addTspan`),r=e.append(`text`).attr(`x`,2*d().state.padding).attr(`y`,d().state.textHeight+1.3*d().state.padding).attr(`font-size`,d().state.fontSize).attr(`class`,`state-title`).text(t.descriptions[0]).node().getBBox(),i=r.height,a=e.append(`text`).attr(`x`,d().state.padding).attr(`y`,i+d().state.padding*.4+d().state.dividerMargin+d().state.textHeight).attr(`class`,`state-description`),s=!0,c=!0;t.descriptions.forEach(function(e){s||(n(a,e,c),c=!1),s=!1});let l=e.append(`line`).attr(`x1`,d().state.padding).attr(`y1`,d().state.padding+i+d().state.dividerMargin/2).attr(`y2`,d().state.padding+i+d().state.dividerMargin/2).attr(`class`,`descr-divider`),u=a.node().getBBox(),f=Math.max(u.width,r.width);return l.attr(`x2`,f+3*d().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,d().state.padding).attr(`y`,d().state.padding).attr(`width`,f+2*d().state.padding).attr(`height`,u.height+i+2*d().state.padding).attr(`rx`,d().state.radius),e},`drawDescrState`),y=o((e,t,n)=>{let r=d().state.padding,i=2*d().state.padding,a=e.node().getBBox(),o=a.width,s=a.x,c=e.append(`text`).attr(`x`,0).attr(`y`,d().state.titleShift).attr(`font-size`,d().state.fontSize).attr(`class`,`state-title`).text(t.id),l=c.node().getBBox().width+i,u=Math.max(l,o);u===o&&(u+=i);let f,p=e.node().getBBox();t.doc,f=s-r,l>o&&(f=(o-u)/2+r),Math.abs(s-p.x)<r&&l>o&&(f=s-(l-o)/2);let m=1-d().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,u).attr(`height`,p.height+d().state.textHeight+d().state.titleShift+1).attr(`rx`,`0`),c.attr(`x`,f+r),l<=o&&c.attr(`x`,s+(u-i)/2-l/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,d().state.titleShift-d().state.textHeight-d().state.padding).attr(`width`,u).attr(`height`,d().state.textHeight*3).attr(`rx`,d().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,d().state.titleShift-d().state.textHeight-d().state.padding).attr(`width`,u).attr(`height`,p.height+3+2*d().state.textHeight).attr(`rx`,d().state.radius),e},`addTitleAndBox`),b=o(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,d().state.sizeUnit+d().state.miniPadding).attr(`cx`,d().state.padding+d().state.sizeUnit+d().state.miniPadding).attr(`cy`,d().state.padding+d().state.sizeUnit+d().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,d().state.sizeUnit).attr(`cx`,d().state.padding+d().state.sizeUnit+2).attr(`cy`,d().state.padding+d().state.sizeUnit+2)),`drawEndState`),x=o((e,t)=>{let n=d().state.forkWidth,r=d().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,d().state.padding).attr(`y`,d().state.padding)},`drawForkJoinState`),S=o((e,t,n,r)=>{let i=0,a=r.append(`text`);a.style(`text-anchor`,`start`),a.attr(`class`,`noteText`);let o=e.replace(/\r\n/g,`<br/>`);o=o.replace(/\n/g,`<br/>`);let s=o.split(u.lineBreakRegex),c=1.25*d().state.noteMargin;for(let e of s){let r=e.trim();if(r.length>0){let e=a.append(`tspan`);if(e.text(r),c===0){let t=e.node().getBBox();c+=t.height}i+=c,e.attr(`x`,t+d().state.noteMargin),e.attr(`y`,n+i+1.25*d().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},`_drawLongText`),C=o((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,d().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*d().state.noteMargin),n.attr(`width`,r+d().state.noteMargin*2),n},`drawNote`),w=o(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type==="default"&&t.descriptions.length===0&&_(i,t),t.type==="default"&&t.descriptions.length>0&&v(i,t);let a=i.node().getBBox();return r.width=a.width+2*d().state.padding,r.height=a.height+2*d().state.padding,r},`drawState`),T=0,E=o(function(e,t,a){let l=o(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);t.points=t.points.filter(e=>!Number.isNaN(e.y));let f=t.points,p=r().x(function(e){return e.x}).y(function(e){return e.y}).curve(n),h=e.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(d().state.arrowMarkerAbsolute&&(g=c(!0)),h.attr(`marker-end`,`url(`+g+`#`+l(m.relationType.DEPENDENCY)+`End)`),a.title!==void 0){let n=e.append(`g`).attr(`class`,`stateLabel`),{x:r,y:o}=i.calcLabelPosition(t.points),c=u.getRows(a.title),l=0,f=[],p=0,m=0;for(let e=0;e<=c.length;e++){let t=n.append(`text`).attr(`text-anchor`,`middle`).text(c[e]).attr(`x`,r).attr(`y`,o+l),i=t.node().getBBox();p=Math.max(p,i.width),m=Math.min(m,i.x),s.info(i.x,r,o+l),l===0&&(l=t.node().getBBox().height,s.info(`Title height`,l,o)),f.push(t)}let h=l*c.length;if(c.length>1){let e=(c.length-1)*l*.5;f.forEach((t,n)=>t.attr(`y`,o+n*l-e)),h=l*c.length}let g=n.node().getBBox();n.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-d().state.padding/2).attr(`y`,o-h/2-d().state.padding/2-3.5).attr(`width`,p+d().state.padding).attr(`height`,h+d().state.padding),s.info(g)}T++},`drawEdge`),D,O={},k=o(function(){},`setConf`),A=o(function(e){e.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 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=o(function(e,t,n,r){D=d().state;let i=d().securityLevel,o;i===`sandbox`&&(o=a(`#i`+t));let c=a(i===`sandbox`?o.nodes()[0].contentDocument.body:`body`),u=i===`sandbox`?o.nodes()[0].contentDocument:document;s.debug(`Rendering diagram `+e);let f=c.select(`[id='${t}']`);A(f),N(r.db.getRootDoc(),f.append(`g`).attr(`id`,t+`-root`),void 0,!1,c,u,r);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2,_=h*1.75;l(f,g,_,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=o(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=o((n,r,i,a,o,c,l)=>{let d=new t({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<n.length;f++)if(n[f].stmt===`relation`){p=!1;break}i?d.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):d.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),d.setDefaultEdgeLabel(function(){return{}});let m=l.db.getStates(),h=l.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];i&&(t.parentId=i);let n;if(t.doc){let e=r.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);n=N(t.doc,e,t.id,!a,o,c,l);{e=y(e,t,a);let r=e.node().getBBox();n.width=r.width,n.height=r.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else n=w(r,t,d);if(t.note){let e=w(r,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},d);t.note.position===`left of`?(d.setNode(n.id+`-note`,e),d.setNode(n.id,n)):(d.setNode(n.id,n),d.setNode(n.id+`-note`,e)),d.setParent(n.id,n.id+`-group`),d.setParent(n.id+`-note`,n.id+`-group`)}else d.setNode(n.id,n)}s.debug(`Count=`,d.nodeCount(),d);let _=0;h.forEach(function(e){_++,s.debug(`Setting edge`,e),d.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*u.getRows(e.title).length,labelpos:`c`},`id`+_)}),e(d),s.debug(`Graph after layout`,d.nodes());let v=r.node();d.nodes().forEach(function(e){e!==void 0&&d.node(e)!==void 0?(s.warn(`Node `+e+`: `+JSON.stringify(d.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(d.node(e).x-d.node(e).width/2)+`,`+(d.node(e).y+(O[e]?O[e].y:0)-d.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,d.node(e).x-d.node(e).width/2),c.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):s.debug(`No Node `+e+`: `+JSON.stringify(d.node(e)))});let b=v.getBBox();d.edges().forEach(function(e){e!==void 0&&d.edge(e)!==void 0&&(s.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(d.edge(e))),E(r,d.edge(e),d.edge(e).relation))}),b=v.getBBox();let x={id:i||`root`,label:i||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,s.debug(`Doc rendered`,x,d),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:o(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
@@ -1 +1 @@
1
- import"./chunk-75Z2AOVW-BzzYECN7.js";import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-Cyu5G-Tr.js";import"./chunk-DU6HZSFF-BlpgvKzl.js";import"./chunk-P2QGCYS3-_SeE0QXb.js";import"./chunk-PWAF6VOD-BZoBqp8x.js";import"./chunk-GMAD6QVW-hv6IsAru.js";import"./chunk-4HAMMTFA-C6Tl7kEY.js";import"./chunk-GVQU2GXP-Duv4ZYb-.js";import"./chunk-L3NEJ4N5-B2hafvRU.js";import"./chunk-OSK3NFVY-SNGRdtNA.js";import"./mermaid-D_jPUVqz.js";import"./chunk-F27PBJKO-BVIgLGPF.js";import"./chunk-XXDRQBXY-BwqwIlJV.js";import"./chunk-POPQ4Y6H-BB5NNJFE.js";import{i as t,n,r,t as i}from"./chunk-IMKFNOWR-BIILwBhp.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
1
+ import"./chunk-75Z2AOVW-BzzYECN7.js";import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-Cyu5G-Tr.js";import"./chunk-DU6HZSFF-BlpgvKzl.js";import"./chunk-P2QGCYS3-_SeE0QXb.js";import"./chunk-PWAF6VOD-BZoBqp8x.js";import"./chunk-GMAD6QVW-hv6IsAru.js";import"./chunk-4HAMMTFA-C6Tl7kEY.js";import"./chunk-GVQU2GXP-Duv4ZYb-.js";import"./chunk-L3NEJ4N5-B2hafvRU.js";import"./chunk-OSK3NFVY-SNGRdtNA.js";import"./mermaid-DpSqZGNM.js";import"./chunk-F27PBJKO-BVIgLGPF.js";import"./chunk-XXDRQBXY-BwqwIlJV.js";import"./chunk-POPQ4Y6H-BB5NNJFE.js";import{i as t,n,r,t as i}from"./chunk-IMKFNOWR-s8kQsL8K.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1,2 +1,2 @@
1
- import{g as e}from"./useEventListener-BdZUApHd.js";import{t}from"./invariant-Ci2dTZ72.js";function n(e){t(!1,`Unexpected object: ${e}`)}function r(t){return e.warn(`Unexpected object: ${JSON.stringify(t)}`),t}function i(e){return e?e.charAt(0).toUpperCase()+e.slice(1):``}function a(t){if(!t)return``;if(typeof t!=`string`)throw e.error(t),TypeError(`Expected string, got ${typeof t}`);return/[A-Za-z]/.test(t)?t.replaceAll(/([\da-z])([A-Z])/g,`$1 $2`).replaceAll(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`).replaceAll(/[\s_-]+/g,` `).trim().split(` `).map(i).join(` `):t}var o={startCase:a,htmlEscape:e=>e&&e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`).replaceAll(`'`,`&#039;`).replaceAll(`
1
+ import{g as e}from"./useEventListener-CUPWI_1X.js";import{t}from"./invariant-Ci2dTZ72.js";function n(e){t(!1,`Unexpected object: ${e}`)}function r(t){return e.warn(`Unexpected object: ${JSON.stringify(t)}`),t}function i(e){return e?e.charAt(0).toUpperCase()+e.slice(1):``}function a(t){if(!t)return``;if(typeof t!=`string`)throw e.error(t),TypeError(`Expected string, got ${typeof t}`);return/[A-Za-z]/.test(t)?t.replaceAll(/([\da-z])([A-Z])/g,`$1 $2`).replaceAll(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`).replaceAll(/[\s_-]+/g,` `).trim().split(` `).map(i).join(` `):t}var o={startCase:a,htmlEscape:e=>e&&e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`).replaceAll(`'`,`&#039;`).replaceAll(`
2
2
  `,` `),withTrailingSlash(e){return e.endsWith(`/`)?e:`${e}/`},withoutTrailingSlash(e){return e.endsWith(`/`)?e.slice(0,-1):e},withoutLeadingSlash(e){return e.startsWith(`/`)?e.slice(1):e},asString:e=>{if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}};export{r as i,i as n,n as r,o as t};