@juki-team/base-ui 1.5.15 → 1.5.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/ArrowForwardIcon-BIC54sbk.js +1 -0
- package/dist/esm/{BarChart-B6teyAwl.js → BarChart-54h6GU3p.js} +1 -1
- package/dist/esm/{CartesianChart-BZZYJ31q.js → CartesianChart-cNl_tqN9.js} +1 -1
- package/dist/esm/{ChangePasswordModal-wjB2d2a0.js → ChangePasswordModal-DGIG264-.js} +1 -1
- package/dist/esm/{CodeEditor--mRrq7Xc.js → CodeEditor-C5-1AgZR.js} +1 -1
- package/dist/esm/{CodeViewer-C2keyN4-.js → CodeViewer-CQrzGpJT.js} +1 -1
- package/dist/esm/{Collapse-C_rZY9aE.js → Collapse-Cx9QTKZD.js} +1 -1
- package/dist/esm/{DataGrid-DbFP5mTw.js → DataGrid-Bu-7Atkf.js} +1 -1
- package/dist/esm/DataViewer-Cv0iOPJ_.js +1 -0
- package/dist/esm/{DrawerView-BLwtJxwY.js → DrawerView-Cbw3l2O7.js} +1 -1
- package/dist/esm/{ExcalidrawButton-CrNTOZTX.js → ExcalidrawButton-zJFah1nC.js} +1 -1
- package/dist/esm/{GraphvizViewer-beaBRsJd.js → GraphvizViewer-DsTGulG0.js} +1 -1
- package/dist/esm/{ImageLoaderCropper-_ZIo2zEm.js → ImageLoaderCropper-Bk1LxSbD.js} +1 -1
- package/dist/esm/{InputCellPhoneNumber-CusvoWas.js → InputCellPhoneNumber-BaFBGcAe.js} +1 -1
- package/dist/esm/{InputColor-ADhkNitB.js → InputColor-DhUlWGSD.js} +1 -1
- package/dist/esm/{LineChart-DUg6yaTg.js → LineChart-BQ1UY4l8.js} +1 -1
- package/dist/esm/{LoaderLayer-Csc8unUJ.js → LoaderLayer-aKmuHFys.js} +1 -1
- package/dist/esm/{MdMath-Dstso3EJ.js → MdMath-DvH_O_A3.js} +1 -1
- package/dist/esm/{MdMathEditor-BMYIOhto.js → MdMathEditor-4-bjr11C.js} +1 -1
- package/dist/esm/{Popover-DRm9Iqcj.js → Popover-C0pozkRR.js} +1 -1
- package/dist/esm/ReplyIcon-DFPc1kie.js +1 -0
- package/dist/esm/{SettingsIcon-Cd0qgB0A.js → SettingsIcon-P_1rE3U0.js} +1 -1
- package/dist/esm/{SlideDeck-C0Py_6HO.js → SlideDeck-0cxhxG3b.js} +1 -1
- package/dist/esm/{TableEyeIcon-CYXh-eSU.js → TableEyeIcon-5qDbI7lU.js} +1 -1
- package/dist/esm/{TableOfContents-GPaHLa0x.js → TableOfContents-DG7lfEl8.js} +1 -1
- package/dist/esm/{Tooltip-DZbA_43G.js → Tooltip-OI-qyixa.js} +1 -1
- package/dist/esm/{UserCodeEditor-D_rQzIU2.js → UserCodeEditor-XI5CMxYI.js} +2 -2
- package/dist/esm/{VirtualizedRowsFixed-BgL_awYQ.js → VirtualizedRowsFixed-DH6WrMq1.js} +1 -1
- package/dist/esm/{WorksheetAsSlides-B8zp1Rak.js → WorksheetAsSlides-vK1Nqrlr.js} +1 -1
- package/dist/esm/{WorksheetBodies-Cr9jJtnr.js → WorksheetBodies-AupmhX--.js} +1 -1
- package/dist/esm/{WorksheetContents-Y4b_IwYP.js → WorksheetContents-RcU2Wigz.js} +1 -1
- package/dist/esm/{WorksheetEditor-BoecibGe.js → WorksheetEditor-BExsBWi8.js} +1 -1
- package/dist/esm/WorksheetNode-BTU0R61c.js +1 -0
- package/dist/esm/{WorksheetViewer-BkyLzOi4.js → WorksheetViewer-Bn_SoOic.js} +1 -1
- package/dist/esm/{abnfDiagram-WEYOIA3C-C_CVppQA.js → abnfDiagram-WEYOIA3C-Dpw6XMB5.js} +1 -1
- package/dist/esm/{arc-vEmnBEcc.js → arc-CVDK40Ip.js} +1 -1
- package/dist/esm/{architectureDiagram-ZHVYKT53-CCcP7rrg.js → architectureDiagram-ZHVYKT53-CwRCJS-f.js} +1 -1
- package/dist/esm/{blockDiagram-RJAE7QA3-DU8sn8Km.js → blockDiagram-RJAE7QA3-BsveJL2h.js} +1 -1
- package/dist/esm/{c4Diagram-XDPPPE54-DQFPX695.js → c4Diagram-XDPPPE54-DT_YwSdM.js} +1 -1
- package/dist/esm/channel-DfU2WyO4.js +1 -0
- package/dist/esm/{chunk-2E7WHVMD-p2GM0eBD.js → chunk-2E7WHVMD-CDFgC3vV.js} +1 -1
- package/dist/esm/{chunk-2Q5K7J3B-Cy8SGmP2.js → chunk-2Q5K7J3B-kc9wbXRi.js} +1 -1
- package/dist/esm/{chunk-4EMNKR2T-CyLGLodZ.js → chunk-4EMNKR2T-BOCYiV20.js} +1 -1
- package/dist/esm/{chunk-55XCU76K-BN8xVJCh.js → chunk-55XCU76K-B9fq0Aas.js} +1 -1
- package/dist/esm/{chunk-5VM5RSS4-D3PGx3gp.js → chunk-5VM5RSS4-BiSpRiw9.js} +1 -1
- package/dist/esm/{chunk-JWPE2WC7-BJAR6xMq.js → chunk-JWPE2WC7-fUi3mFpq.js} +1 -1
- package/dist/esm/{chunk-NQOKRVIF-fUehRCXZ.js → chunk-NQOKRVIF-9yhnn9l0.js} +1 -1
- package/dist/esm/{chunk-VQ5W62QI-mHHsR0s0.js → chunk-VQ5W62QI-k74sEYFL.js} +1 -1
- package/dist/esm/{chunk-XXDRQBXY-DLLBlZjr.js → chunk-XXDRQBXY-DJJHL2aw.js} +1 -1
- package/dist/esm/{chunk-ZCHMQSOR-t517tTkb.js → chunk-ZCHMQSOR-DZxET8Hs.js} +1 -1
- package/dist/esm/{classDiagram-v2-4MYWR3UA-CrNA_w1s.js → classDiagram-v2-4MYWR3UA-Ccw8sMnD.js} +1 -1
- package/dist/esm/{commons-BLDufAOm.js → commons-Bam9oxAR.js} +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/{cose-bilkent-JH36ORCC-DTawllqu.js → cose-bilkent-JH36ORCC-iT9n9qMD.js} +1 -1
- package/dist/esm/{cynefinDiagram-WF24UDRP-DWwhOkSi.js → cynefinDiagram-WF24UDRP-COkkadSX.js} +1 -1
- package/dist/esm/{dagre-NK4GIZVX-Jm0gIaFX.js → dagre-NK4GIZVX-B2jYnU0Q.js} +1 -1
- package/dist/esm/{diagram-CBK3MWTC-CcOs3Ceh.js → diagram-CBK3MWTC-DzCzOobH.js} +1 -1
- package/dist/esm/{diagram-I5XIIV2D-BBh0FWXm.js → diagram-I5XIIV2D-ChGPyzwT.js} +1 -1
- package/dist/esm/{diagram-ODIL2UCW-BlztNr6r.js → diagram-ODIL2UCW-_jTs4ZGf.js} +1 -1
- package/dist/esm/{diagram-PFBEJUXE-DtRoe0ng.js → diagram-PFBEJUXE-C66lVsSz.js} +1 -1
- package/dist/esm/{diagram-RJA3I4VV-LdjGFjBw.js → diagram-RJA3I4VV-QELSA6fF.js} +1 -1
- package/dist/esm/{diagram-TYUNFSNR-D8WXXh7g.js → diagram-TYUNFSNR-Be-cdxPq.js} +1 -1
- package/dist/esm/{ebnfDiagram-V4P3TTPT-DESDKr7D.js → ebnfDiagram-V4P3TTPT-Cr1EANnv.js} +1 -1
- package/dist/esm/{elk-QONTBCTQ-DDBz4veG.js → elk-QONTBCTQ-CqfCbAWo.js} +1 -1
- package/dist/esm/{erDiagram-KYQIGQAA-CBg-NMBs.js → erDiagram-KYQIGQAA-DMgweTFG.js} +1 -1
- package/dist/esm/flowDiagram-IUGLLWBU-B4pY13UK.js +1 -0
- package/dist/esm/{ganttDiagram-R7GPNTJY-BKQtPa2l.js → ganttDiagram-R7GPNTJY-YkRR1QZl.js} +1 -1
- package/dist/esm/{gitGraphDiagram-PDYL7XHY-SgW1IIil.js → gitGraphDiagram-PDYL7XHY-BuhZy85T.js} +1 -1
- package/dist/esm/helpers.js +1 -1
- package/dist/esm/{index-CEgC-P3H.js → index-CTKRTL8i.js} +1 -1
- package/dist/esm/{index-D954khxt.js → index-DU7OAICx.js} +1 -1
- package/dist/esm/{index-yFCV1i1-.js → index-DWLuqDsD.js} +1 -1
- package/dist/esm/{index-3QSNRp1k.js → index-c3o5xJQl.js} +1 -1
- package/dist/esm/index-w_leOmyv.js +1 -0
- package/dist/esm/{infoDiagram-MVDRKAX5-DfklDIw_.js → infoDiagram-MVDRKAX5-CfqZ5lu9.js} +1 -1
- package/dist/esm/{ishikawaDiagram-HPEHV2GE-BgFDqFFr.js → ishikawaDiagram-HPEHV2GE-fwZw1vDt.js} +1 -1
- package/dist/esm/{journeyDiagram-BOSHW7O7-DMgZlI3B.js → journeyDiagram-BOSHW7O7-CJ0qr25S.js} +1 -1
- package/dist/esm/{kanban-definition-FNSA4HC5-6nGtZdla.js → kanban-definition-FNSA4HC5-D467uQkY.js} +1 -1
- package/dist/esm/main.js +1 -1
- package/dist/esm/{mermaid.core-VF3HuzPL.js → mermaid.core-QEjDbduh.js} +2 -2
- package/dist/esm/{mindmap-definition-6OY57UG3-CldUD6qU.js → mindmap-definition-6OY57UG3-BLQmSwVy.js} +1 -1
- package/dist/esm/{pegDiagram-ECIUJNBX-CxOzmAR6.js → pegDiagram-ECIUJNBX-BD9B5ipu.js} +1 -1
- package/dist/esm/{pieDiagram-GNMPY74T-CVzFNxbL.js → pieDiagram-GNMPY74T-ALgTthPz.js} +1 -1
- package/dist/esm/{quadrantDiagram-D57K4MC3-zu8PK3sn.js → quadrantDiagram-D57K4MC3-DvM56mui.js} +1 -1
- package/dist/esm/{railroadDiagram-Y72NRBL7-32O5vSNO.js → railroadDiagram-Y72NRBL7-Bbmv8kBV.js} +1 -1
- package/dist/esm/{requirementDiagram-EQYSW5RA-y8y1LAQQ.js → requirementDiagram-EQYSW5RA-B2-FtMv8.js} +1 -1
- package/dist/esm/{sankeyDiagram-SY24JHO5-B6RN54HY.js → sankeyDiagram-SY24JHO5-a4Tjq4bh.js} +1 -1
- package/dist/esm/{sequenceDiagram-BLEHNHQU-x0406cvr.js → sequenceDiagram-BLEHNHQU-D51n1e3_.js} +1 -1
- package/dist/esm/server.js +1 -1
- package/dist/esm/settings-Cd8fftVp.js +1 -0
- package/dist/esm/settings.js +1 -1
- package/dist/esm/{sizeCapture-INFHLROL--wG_Awhp.js → sizeCapture-INFHLROL-EvtR_ZF3.js} +1 -1
- package/dist/esm/{stateDiagram-v2-A6IESKWZ-BO6rHKAj.js → stateDiagram-v2-A6IESKWZ-Dy_vLRVL.js} +1 -1
- package/dist/esm/{swimlanes-B3ENRKFQ-Bn5D5Wx7.js → swimlanes-B3ENRKFQ-0pqT2-Jw.js} +1 -1
- package/dist/esm/swimlanesDiagram-AYQRV4AK-COayinaD.js +1 -0
- package/dist/esm/{timeline-definition-JXYKGLGB-BEJjWLZB.js → timeline-definition-JXYKGLGB-DFhOynr-.js} +1 -1
- package/dist/esm/{types-B-kh3Oeb.js → types-C6dLWyzP.js} +1 -1
- package/dist/esm/{usecaseDiagram-WPOLBNNX-RyH7DcwX.js → usecaseDiagram-WPOLBNNX-MTVBbHK8.js} +1 -1
- package/dist/esm/{vennDiagram-Q3Y3IDCW-CxTrhG-i.js → vennDiagram-Q3Y3IDCW-CgaIfPfv.js} +1 -1
- package/dist/esm/{wardleyDiagram-IVAIDKWA-pBsrgWov.js → wardleyDiagram-IVAIDKWA-CEQzSAI4.js} +1 -1
- package/dist/esm/websocket-BppBoZUJ.js +1 -0
- package/dist/esm/{xychartDiagram-4URNHDU4-CA9STbh6.js → xychartDiagram-4URNHDU4-BQJJ7mH2.js} +1 -1
- package/dist/module-types/src/components/helpers/websocket.d.ts +2 -0
- package/dist/module-types/src/components/hooks/useSubmissionsJudging.d.ts +12 -0
- package/dist/module-types/src/components/organisms/SubmitView/commons/SubmissionListenerVerdict.d.ts +6 -1
- package/dist/module-types/src/components/organisms/SubmitView/commons/SubmissionVerdict.d.ts +4 -3
- package/dist/module-types/src/hooks/index.d.ts +1 -0
- package/dist/module-types/src/stores/submissionsLive/useSubmissionsLiveStore.d.ts +26 -0
- package/dist/module-types/src/stores/websocket/topicChannels.d.ts +2 -0
- package/package.json +2 -2
- package/dist/esm/ArrowForwardIcon-Bd0B_Kwe.js +0 -1
- package/dist/esm/DataViewer-lFoDNwIZ.js +0 -1
- package/dist/esm/ReplyIcon-BAIEk00m.js +0 -1
- package/dist/esm/WorksheetNode-DTyHDssN.js +0 -1
- package/dist/esm/channel-5x2nMoMO.js +0 -1
- package/dist/esm/flowDiagram-IUGLLWBU-BytjhPBX.js +0 -1
- package/dist/esm/index-38k9tHSo.js +0 -1
- package/dist/esm/settings-6x4qNkNZ.js +0 -1
- package/dist/esm/swimlanesDiagram-AYQRV4AK-Ba9zNATm.js +0 -1
- package/dist/esm/websocket-D79arGLt.js +0 -1
package/dist/esm/{xychartDiagram-4URNHDU4-CA9STbh6.js → xychartDiagram-4URNHDU4-BQJJ7mH2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as t,g as i,x as e,v as s,a,b as n,_ as o,l as h,T as r,d as l,C as c,O as g,j as u,Q as x,R as d,a7 as p,a8 as f}from"./mermaid.core-VF3HuzPL.js";import{b as m}from"./band-D2afako6.js";import{l as y}from"./linear-CIPQsvV7.js";import{l as b}from"./string-DPJhNSkw.js";import"./index-38k9tHSo.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-BLDufAOm.js";import"./settings-6x4qNkNZ.js";import"./constants.js";import"./LoaderLayer-Csc8unUJ.js";import"./websocket-D79arGLt.js";import"./index-3QSNRp1k.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"@ably/spaces/dist/mjs/react";import"./init-DLRA0X12.js";import"./ordinal-zwWoQKz9.js";import"./defaultLocale-HOdfsG1x.js";var w=function(){var t=o(function(t,i,e,s){for(e=e||{},s=t.length;s--;e[t[s]]=i);return e},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],n=[1,6],h=[1,7],r=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],c=[1,26],g=[1,28],u=[1,29],x=[1,30],d=[1,31],p=[1,32],f=[1,33],m=[1,34],y=[1,35],b=[1,36],w=[1,37],S=[1,43],A=[1,42],C=[1,47],k=[1,50],R=[1,10,12,14,16,18,19,21,23,36,37,38],T=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],_=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],D=[1,65],L=[26,28],P={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:o(function(t,i,e,s,a,n,o){var h=n.length-1;switch(a){case 5:s.setOrientation(n[h]);break;case 9:s.setDiagramTitle(n[h].text.trim());break;case 12:s.setLineData({text:"",type:"text"},n[h]);break;case 13:s.setLineData(n[h-1],n[h]);break;case 14:s.setBarData({text:"",type:"text"},n[h]);break;case 15:s.setBarData(n[h-1],n[h]);break;case 16:this.$=n[h].trim(),s.setAccTitle(this.$);break;case 17:case 18:this.$=n[h].trim(),s.setAccDescription(this.$);break;case 19:case 29:this.$=n[h-1];break;case 20:case 30:this.$=[n[h-2],...n[h]];break;case 21:case 31:this.$=[n[h]];break;case 22:this.$={value:Number(n[h-1]),label:n[h]};break;case 23:this.$={value:Number(n[h]),label:""};break;case 24:s.setXAxisTitle(n[h]);break;case 25:s.setXAxisTitle(n[h-1]);break;case 26:s.setXAxisTitle({type:"text",text:""});break;case 27:s.setXAxisBand(n[h]);break;case 28:s.setXAxisRangeData(Number(n[h-2]),Number(n[h]));break;case 32:s.setYAxisTitle(n[h]);break;case 33:s.setYAxisTitle(n[h-1]);break;case 34:s.setYAxisTitle({type:"text",text:""});break;case 35:s.setYAxisRangeData(Number(n[h-2]),Number(n[h]));break;case 39:case 40:this.$={text:n[h],type:"text"};break;case 41:this.$={text:n[h],type:"markdown"};break;case 42:this.$=n[h];break;case 43:this.$=n[h-1]+""+n[h]}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,36:a,37:n,38:h}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,36:a,37:n,38:h}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:n,38:h}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(r,[2,36]),t(r,[2,37]),t(r,[2,38]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,36:a,37:n,38:h}),{1:[2,3]},t(r,[2,5]),t(i,[2,7],{4:22,36:a,37:n,38:h}),{11:23,30:l,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{11:39,13:38,24:S,29:A,30:l,31:40,32:41,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{11:45,15:44,29:C,30:l,35:46,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{11:49,17:48,24:k,30:l,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{11:52,17:51,24:k,30:l,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{20:[1,53]},{22:[1,54]},t(R,[2,18]),{1:[2,2]},t(R,[2,8]),t(R,[2,9]),t(T,[2,39],{41:55,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w}),t(T,[2,40]),t(T,[2,41]),t(_,[2,42]),t(_,[2,44]),t(_,[2,45]),t(_,[2,46]),t(_,[2,47]),t(_,[2,48]),t(_,[2,49]),t(_,[2,50]),t(_,[2,51]),t(_,[2,52]),t(_,[2,53]),t(R,[2,10]),t(R,[2,24],{32:41,31:56,24:S,29:A}),t(R,[2,26]),t(R,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},t(R,[2,11]),t(R,[2,32],{35:60,29:C}),t(R,[2,34]),{33:[1,61]},t(R,[2,12]),{17:62,24:k},{25:63,27:64,29:D},t(R,[2,14]),{17:66,24:k},t(R,[2,16]),t(R,[2,17]),t(_,[2,43]),t(R,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(R,[2,33]),{29:[1,70]},t(R,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(L,[2,23],{30:[1,73]}),t(R,[2,15]),t(R,[2,28]),t(R,[2,29]),{11:59,30:l,34:74,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},t(R,[2,35]),t(R,[2,19]),{25:75,27:64,29:D},t(L,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:o(function(t,i){if(!i.recoverable){var e=new Error(t);throw e.hash=i,e}this.trace(t)},"parseError"),parse:o(function(t){var i=this,e=[0],s=[],a=[null],n=[],h=this.table,r="",l=0,c=0,g=n.slice.call(arguments,1),u=Object.create(this.lexer),x={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(x.yy[d]=this.yy[d]);u.setInput(t,x.yy),x.yy.lexer=u,x.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;n.push(p);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||u.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof x.yy.parseError?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){e.length=e.length-2*t,a.length=a.length-t,n.length=n.length-t},"popStack"),o(m,"lex");for(var y,b,w,S,A,C,k,R,T={};;){if(b=e[e.length-1],this.defaultActions[b]?w=this.defaultActions[b]:(null==y&&(y=m()),w=h[b]&&h[b][y]),void 0===w||!w.length||!w[0]){var _="";for(A in R=[],h[b])this.terminals_[A]&&A>2&&R.push("'"+this.terminals_[A]+"'");_=u.showPosition?"Parse error on line "+(l+1)+":\n"+u.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(_,{text:u.match,token:this.terminals_[y]||y,line:u.yylineno,loc:p,expected:R})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+y);switch(w[0]){case 1:e.push(y),a.push(u.yytext),n.push(u.yylloc),e.push(w[1]),y=null,c=u.yyleng,r=u.yytext,l=u.yylineno,p=u.yylloc;break;case 2:if(C=this.productions_[w[1]][1],T.$=a[a.length-C],T._$={first_line:n[n.length-(C||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(C||1)].first_column,last_column:n[n.length-1].last_column},f&&(T._$.range=[n[n.length-(C||1)].range[0],n[n.length-1].range[1]]),void 0!==(S=this.performAction.apply(T,[r,c,l,x.yy,w[1],a,n].concat(g))))return S;C&&(e=e.slice(0,-1*C*2),a=a.slice(0,-1*C),n=n.slice(0,-1*C)),e.push(this.productions_[w[1]][0]),a.push(T.$),n.push(T._$),k=h[e[e.length-2]][e[e.length-1]],e.push(k);break;case 3:return!0}}return!0},"parse")},v=function(){return{EOF:1,parseError:o(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:o(function(t,i){return this.yy=i||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var i=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===s.length?this.yylloc.first_column:0)+s[s.length-e.length].length-e[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:o(function(t,i){var e,s,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var n in a)this[n]=a[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,i,e,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),n=0;n<a.length;n++)if((e=this._input.match(this.rules[a[n]]))&&(!i||e[0].length>i[0].length)){if(i=e,s=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,a[n])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,a[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,i,e,s){switch(e){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),36;case 4:return 36;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}}();function E(){this.yy={}}return P.lexer=v,o(E,"Parser"),E.prototype=P,P.Parser=E,new E}();w.parser=w;var S=w;function A(t){return"bar"===t.type}function C(t){return"band"===t.type}function k(t){return"linear"===t.type}o(A,"isBarPlot"),o(C,"isBandAxisData"),o(k,"isLinearAxisData");var R=class{constructor(t){this.parentGroup=t}static{o(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};const e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i),a=s.node()?.getScreenCTM?.(),n=o(t=>t&&t>0?t:1,"toScale"),h=n(a?.a),r=n(a?.d);for(const a of t){const t=f(s,1,a),n=t?t.width/h:a.length*i,o=t?t.height/r:i;e.width=Math.max(e.width,n),e.height=Math.max(e.height,o)}return s.remove(),e}},T=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{o(this,"BaseAxis")}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=.2*t.width;this.outerPadding=Math.min(e.width/2,s);let a=e.height;"bottom"===this.axisPosition&&0!==this.normalizedLabelRotationInRad&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*e.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*e.height))),a+=2*this.axisConfig.labelPadding,this.labelTextHeight=e.height,a<=i&&(i-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=.2*t.height;this.outerPadding=Math.min(e.height/2,s);const a=e.width+2*this.axisConfig.labelPadding;a<=i&&(i-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){const i=this.normalizedLabelRotationInRad;return 0===i?0:Math.sin(i)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:180*this.normalizedLabelRotationInRad/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},_=class extends T{static{o(this,"BandAxis")}constructor(t,i,e,s,a){super(t,s,a,i),this.categories=e,this.scale=m().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=m().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),h.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},D=class extends T{static{o(this,"LinearAxis")}constructor(t,i,e,s,a){super(t,s,a,i),this.domain=e,this.scale=y().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=y().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function L(t,i,e,s){const a=new R(s);return C(t)?new _(i,e,t.categories,t.title,a):new D(i,e,[t.min,t.max],t.title,a)}o(L,"getAxis");var P=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.titleWidth=0,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{o(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return s<=t.height&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.titleWidth=i.width,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}alignTo(t,i){const e=Math.min(this.titleWidth,this.chartConfig.width)/2,s=Math.min(Math.max((t+i)/2,e),this.chartConfig.width-e);this.boundingRect.x=s-e,this.boundingRect.width=2*e}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function v(t,i,e,s){const a=new R(s);return new P(a,t,i,e)}o(v,"getChartTitleComponent");function E(t){return{fontSize:t,markerSize:.75*t,markerSpacing:.35*t,itemSpacing:.5*t}}o(E,"getLegendLayout");var M=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{o(this,"ChartLegend")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(t=>t.title):[],0===this.visiblePlots.length)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};const{fontSize:i,markerSize:e,markerSpacing:s,itemSpacing:a}=E(this.chartConfig.legendFontSize),n=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(t=>t.title),i),o=2*this.chartConfig.legendPadding+e+s+n.width,h=2*this.chartConfig.legendPadding+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;return o<=t.width&&h<=t.height?(this.boundingRect.width=o,this.boundingRect.height=h):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(0===this.visiblePlots.length)return[];const{fontSize:t,markerSize:i,markerSpacing:e,itemSpacing:s}=E(this.chartConfig.legendFontSize),a=t+s,n=this.boundingRect.x+this.chartConfig.legendPadding,o=this.boundingRect.y+this.chartConfig.legendPadding,h=[],r=[];for(const[t,e]of this.visiblePlots.entries())if(A(e))h.push({x:n,y:o+t*a,width:i,height:i,fill:e.fill,strokeFill:e.fill,strokeWidth:0});else{const s=o+t*a+i/2;r.push({path:`M ${n},${s} L ${n+i},${s}`,strokeFill:e.strokeFill,strokeWidth:e.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:h},{groupTexts:["legend","markers"],type:"path",data:r},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((s,h)=>({text:s.title,x:n+i+e,y:o+h*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:t,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function z(t,i,e,s){const a=new R(s);return new M(a,t,i,e)}o(z,"getChartLegendComponent");var I=class{constructor(t,i,e,s,a){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=a}static{o(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);let i;if(i="horizontal"===this.orientation?b().y(t=>t[0]).x(t=>t[1])(t):b().x(t=>t[0]).y(t=>t[1])(t),!i)return[];const e=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const i=10,s=12,a=[];for(const[e,[n,o]]of t.entries()){const t=this.plotData.pointLabels[e];t&&("horizontal"===this.orientation?a.push({x:o+i,y:n,text:t,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:s,rotation:0}):a.push({x:n,y:o-i,text:t,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:s,rotation:0}))}a.length>0&&e.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:a})}return e}},B=class{constructor(t,i,e,s,a,n){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=a,this.plotIndex=n}static{o(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),e=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-e,height:i,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:t[0]-e,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},$=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}static{o(this,"BasePlot")}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const s=new I(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new B(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}}return t}};function W(t,i,e){return new $(t,i,e)}o(W,"getPlotComponent");var F,O=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:v(t,i,e,s),plot:W(t,i,e),legend:z(t,i,e,s),xAxis:L(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:L(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}static{o(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,a={width:0,height:0},n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),h=this.componentStore.plot.calculateSpace({width:n,height:o});t-=h.width,i-=h.height,h=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=h.height,i-=h.height,this.componentStore.xAxis.setAxisPosition("bottom"),h=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=h.height,this.componentStore.yAxis.setAxisPosition("left"),h=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=h.width,t-=h.width,a=this.componentStore.legend.calculateSpace({width:t,height:o}),t-=a.width,t>0&&(n+=t,t=0),i>0&&(o+=i,i=0),this.componentStore.plot.calculateSpace({width:n,height:o}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.title.alignTo(e,e+n),this.componentStore.legend.setBoundingBoxXY({x:e+n,y:s+Math.max((o-a.height)/2,0)}),this.componentStore.xAxis.setRange([e,e+n]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+o}),this.componentStore.yAxis.setRange([s,s+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(t=>A(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,a=0,n={width:0,height:0},o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),h=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),r=this.componentStore.plot.calculateSpace({width:o,height:h});t-=r.width,i-=r.height,r=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=r.height,i-=r.height,this.componentStore.xAxis.setAxisPosition("left"),r=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=r.width,s=r.width,this.componentStore.yAxis.setAxisPosition("top"),r=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=r.height,a=e+r.height,n=this.componentStore.legend.calculateSpace({width:t,height:h}),t-=n.width,t>0&&(o+=t,t=0),i>0&&(h+=i,i=0),this.componentStore.plot.calculateSpace({width:o,height:h}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.title.alignTo(s,s+o),this.componentStore.legend.setBoundingBoxXY({x:s+o,y:a+Math.max((h-n.height)/2,0)}),this.componentStore.yAxis.setRange([s,s+o]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([a,a+h]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(t=>A(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},X=class{static{o(this,"XYChartBuilder")}static build(t,i,e,s){return new O(t,i,e,s).getDrawableElement()}},N=0,V=K(),Y=Q(),j=Z(),H=Y.plotColorPalette.split(",").map(t=>t.trim()),U=!1,G=!1;function Q(){const t=p(),i=g();return x(t.xyChart,i.themeVariables.xyChart)}function K(){const t=g();return x(d.xyChart,t.xyChart)}function Z(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function q(t){const i=g();return u(t.trim(),i)}function J(t){F=t}function tt(t){V.chartOrientation="horizontal"===t?"horizontal":"vertical"}function it(t){j.xAxis.title=q(t.text)}function et(t,i){j.xAxis={type:"linear",title:j.xAxis.title,min:t,max:i},U=!0}function st(t){j.xAxis={type:"band",title:j.xAxis.title,categories:t.map(t=>q(t.text))},U=!0}function at(t){j.yAxis.title=q(t.text)}function nt(t,i){j.yAxis={type:"linear",title:j.yAxis.title,min:t,max:i},G=!0}function ot(t){const i=Math.min(...t),e=Math.max(...t),s=k(j.yAxis)?j.yAxis.min:1/0,a=k(j.yAxis)?j.yAxis.max:-1/0;j.yAxis={type:"linear",title:j.yAxis.title,min:Math.min(s,i),max:Math.max(a,e)}}function ht(t){let i=[];if(0===t.length)return i;if(!U){const i=k(j.xAxis)?j.xAxis.min:1/0,e=k(j.xAxis)?j.xAxis.max:-1/0;et(Math.min(i,1),Math.max(e,t.length))}if(C(j.xAxis)&&t.length>j.xAxis.categories.length&&(t=t.slice(0,j.xAxis.categories.length)),G||ot(t),C(j.xAxis)&&(i=j.xAxis.categories.map((i,e)=>[i,t[e]])),k(j.xAxis)){const e=j.xAxis.min,s=j.xAxis.max;if(1===t.length)i=[[`${e}`,t[0]]];else{const a=(s-e)/(t.length-1);i=t.map((t,i)=>[`${e+i*a}`,t])}}return i}function rt(t){return H[0===t?0:t%H.length]}function lt(t,i){const e=i.map(t=>t.value),s=i.map(t=>t.label?q(t.label):""),a=ht(e),n=s.some(t=>""!==t);j.plots.push({type:"line",title:q(t.text),strokeFill:rt(N),strokeWidth:2,data:a,...n?{pointLabels:s}:{}}),N++}function ct(t,i){const e=ht(i.map(t=>t.value));j.plots.push({type:"bar",title:q(t.text),fill:rt(N),data:e}),N++}function gt(){if(0===j.plots.length)throw Error("No Plot to render, please provide a plot with some data");return j.title=e(),X.build(V,j,Y,F)}function ut(){return Y}function xt(){return V}function dt(){return j}o(Q,"getChartDefaultThemeConfig"),o(K,"getChartDefaultConfig"),o(Z,"getChartDefaultData"),o(q,"textSanitizer"),o(J,"setTmpSVGG"),o(tt,"setOrientation"),o(it,"setXAxisTitle"),o(et,"setXAxisRangeData"),o(st,"setXAxisBand"),o(at,"setYAxisTitle"),o(nt,"setYAxisRangeData"),o(ot,"setYAxisRangeFromPlotData"),o(ht,"transformDataWithoutCategory"),o(rt,"getPlotColorFromPalette"),o(lt,"setLineData"),o(ct,"setBarData"),o(gt,"getDrawableElem"),o(ut,"getChartThemeConfig"),o(xt,"getChartConfig"),o(dt,"getXYChartData");var pt={parser:S,db:{getDrawableElem:gt,clear:o(function(){c(),N=0,V=K(),j={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},Y=Q(),H=Y.plotColorPalette.split(",").map(t=>t.trim()),U=!1,G=!1},"clear"),setAccTitle:n,getAccTitle:a,setDiagramTitle:s,getDiagramTitle:e,getAccDescription:i,setAccDescription:t,setOrientation:tt,setXAxisTitle:it,setXAxisRangeData:et,setXAxisBand:st,setYAxisTitle:at,setYAxisRangeData:nt,setLineData:lt,setBarData:ct,setTmpSVGG:J,getChartThemeConfig:ut,getChartConfig:xt,getXYChartData:dt},renderer:{draw:o((t,i,e,s)=>{const a=s.db,n=a.getChartThemeConfig(),c=a.getChartConfig(),g=a.getXYChartData().plots[0].data.map(t=>t[1]);function u(t){return"top"===t?"text-before-edge":"middle"}function x(t){return"left"===t?"start":"right"===t?"end":"middle"}function d(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}o(u,"getDominantBaseLine"),o(x,"getTextAnchor"),o(d,"getTextTransformation"),h.debug("Rendering xychart chart\n"+t);const p=r(i),f=p.append("g").attr("class","main"),m=f.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");l(p,c.height,c.width,!0),p.attr("viewBox",`0 0 ${c.width} ${c.height}`),m.attr("fill",n.backgroundColor),a.setTmpSVGG(p.append("g").attr("class","mermaid-tmp-group"));const y=a.getDrawableElem(),b={};function w(t){let i=f,e="";for(const[s]of t.entries()){let a=f;s>0&&b[e]&&(a=b[e]),e+=t[s],i=b[e],i||(i=b[e]=a.append("g").attr("class",t[s]))}return i}o(w,"getGroup");for(const t of y){if(0===t.data.length)continue;const i=w(t.groupTexts);switch(t.type){case"rect":if(i.selectAll("rect").data(t.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),c.showDataLabel){const e=c.showDataLabelOutsideBar;if("horizontal"===c.chartOrientation){let s=function(t,i){const{data:e,label:s}=t;return i*s.length*a<=e.width-h};o(s,"fitsHorizontally");const a=.7,h=10,r=t.data.map((t,i)=>({data:t,label:g[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),l=r.map(t=>{const{data:i}=t;let e=.7*i.height;for(;!s(t,e)&&e>0;)e-=1;return e}),c=Math.floor(Math.min(...l)),u=o(t=>e?t.data.x+t.data.width+h:t.data.x+t.data.width-h,"determineLabelXPosition");i.selectAll("text").data(r).enter().append("text").attr("x",u).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor",e?"start":"end").attr("dominant-baseline","middle").attr("fill",n.dataLabelColor).attr("font-size",`${c}px`).text(t=>t.label)}else{let s=function(t,i,e){const{data:s,label:a}=t,n=i*a.length*.7,o=s.x+s.width/2,h=o+n/2,r=o-n/2>=s.x&&h<=s.x+s.width,l=s.y+e+i<=s.y+s.height;return r&&l};o(s,"fitsInBar");const a=10,h=t.data.map((t,i)=>({data:t,label:g[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),r=h.map(t=>{const{data:i,label:e}=t;let n=i.width/(.7*e.length);for(;!s(t,n,a)&&n>0;)n-=1;return n}),l=Math.floor(Math.min(...r)),c=o(t=>e?t.data.y-a:t.data.y+a,"determineLabelYPosition");i.selectAll("text").data(h).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",c).attr("text-anchor","middle").attr("dominant-baseline",e?"auto":"hanging").attr("fill",n.dataLabelColor).attr("font-size",`${l}px`).text(t=>t.label)}}break;case"text":i.selectAll("text").data(t.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>u(t.verticalPos)).attr("text-anchor",t=>x(t.horizontalPos)).attr("transform",t=>d(t)).text(t=>t.text);break;case"path":i.selectAll("path").data(t.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}};export{pt as diagram};
|
|
1
|
+
import{s as t,g as i,x as e,v as s,a,b as n,_ as o,l as h,T as r,d as l,C as c,O as g,j as u,Q as x,R as d,a7 as p,a8 as f}from"./mermaid.core-QEjDbduh.js";import{b as m}from"./band-D2afako6.js";import{l as y}from"./linear-CIPQsvV7.js";import{l as b}from"./string-DPJhNSkw.js";import"./index-w_leOmyv.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-Bam9oxAR.js";import"./settings-Cd8fftVp.js";import"./constants.js";import"./LoaderLayer-aKmuHFys.js";import"./websocket-BppBoZUJ.js";import"./index-c3o5xJQl.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"@ably/spaces/dist/mjs/react";import"./init-DLRA0X12.js";import"./ordinal-zwWoQKz9.js";import"./defaultLocale-HOdfsG1x.js";var w=function(){var t=o(function(t,i,e,s){for(e=e||{},s=t.length;s--;e[t[s]]=i);return e},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],n=[1,6],h=[1,7],r=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],c=[1,26],g=[1,28],u=[1,29],x=[1,30],d=[1,31],p=[1,32],f=[1,33],m=[1,34],y=[1,35],b=[1,36],w=[1,37],S=[1,43],A=[1,42],C=[1,47],k=[1,50],R=[1,10,12,14,16,18,19,21,23,36,37,38],T=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],_=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],D=[1,65],L=[26,28],P={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:o(function(t,i,e,s,a,n,o){var h=n.length-1;switch(a){case 5:s.setOrientation(n[h]);break;case 9:s.setDiagramTitle(n[h].text.trim());break;case 12:s.setLineData({text:"",type:"text"},n[h]);break;case 13:s.setLineData(n[h-1],n[h]);break;case 14:s.setBarData({text:"",type:"text"},n[h]);break;case 15:s.setBarData(n[h-1],n[h]);break;case 16:this.$=n[h].trim(),s.setAccTitle(this.$);break;case 17:case 18:this.$=n[h].trim(),s.setAccDescription(this.$);break;case 19:case 29:this.$=n[h-1];break;case 20:case 30:this.$=[n[h-2],...n[h]];break;case 21:case 31:this.$=[n[h]];break;case 22:this.$={value:Number(n[h-1]),label:n[h]};break;case 23:this.$={value:Number(n[h]),label:""};break;case 24:s.setXAxisTitle(n[h]);break;case 25:s.setXAxisTitle(n[h-1]);break;case 26:s.setXAxisTitle({type:"text",text:""});break;case 27:s.setXAxisBand(n[h]);break;case 28:s.setXAxisRangeData(Number(n[h-2]),Number(n[h]));break;case 32:s.setYAxisTitle(n[h]);break;case 33:s.setYAxisTitle(n[h-1]);break;case 34:s.setYAxisTitle({type:"text",text:""});break;case 35:s.setYAxisRangeData(Number(n[h-2]),Number(n[h]));break;case 39:case 40:this.$={text:n[h],type:"text"};break;case 41:this.$={text:n[h],type:"markdown"};break;case 42:this.$=n[h];break;case 43:this.$=n[h-1]+""+n[h]}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,36:a,37:n,38:h}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,36:a,37:n,38:h}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:n,38:h}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(r,[2,36]),t(r,[2,37]),t(r,[2,38]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,36:a,37:n,38:h}),{1:[2,3]},t(r,[2,5]),t(i,[2,7],{4:22,36:a,37:n,38:h}),{11:23,30:l,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{11:39,13:38,24:S,29:A,30:l,31:40,32:41,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{11:45,15:44,29:C,30:l,35:46,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{11:49,17:48,24:k,30:l,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{11:52,17:51,24:k,30:l,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},{20:[1,53]},{22:[1,54]},t(R,[2,18]),{1:[2,2]},t(R,[2,8]),t(R,[2,9]),t(T,[2,39],{41:55,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w}),t(T,[2,40]),t(T,[2,41]),t(_,[2,42]),t(_,[2,44]),t(_,[2,45]),t(_,[2,46]),t(_,[2,47]),t(_,[2,48]),t(_,[2,49]),t(_,[2,50]),t(_,[2,51]),t(_,[2,52]),t(_,[2,53]),t(R,[2,10]),t(R,[2,24],{32:41,31:56,24:S,29:A}),t(R,[2,26]),t(R,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},t(R,[2,11]),t(R,[2,32],{35:60,29:C}),t(R,[2,34]),{33:[1,61]},t(R,[2,12]),{17:62,24:k},{25:63,27:64,29:D},t(R,[2,14]),{17:66,24:k},t(R,[2,16]),t(R,[2,17]),t(_,[2,43]),t(R,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(R,[2,33]),{29:[1,70]},t(R,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(L,[2,23],{30:[1,73]}),t(R,[2,15]),t(R,[2,28]),t(R,[2,29]),{11:59,30:l,34:74,39:24,40:c,41:27,42:g,43:u,44:x,45:d,46:p,47:f,48:m,49:y,50:b,51:w},t(R,[2,35]),t(R,[2,19]),{25:75,27:64,29:D},t(L,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:o(function(t,i){if(!i.recoverable){var e=new Error(t);throw e.hash=i,e}this.trace(t)},"parseError"),parse:o(function(t){var i=this,e=[0],s=[],a=[null],n=[],h=this.table,r="",l=0,c=0,g=n.slice.call(arguments,1),u=Object.create(this.lexer),x={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(x.yy[d]=this.yy[d]);u.setInput(t,x.yy),x.yy.lexer=u,x.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;n.push(p);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||u.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof x.yy.parseError?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){e.length=e.length-2*t,a.length=a.length-t,n.length=n.length-t},"popStack"),o(m,"lex");for(var y,b,w,S,A,C,k,R,T={};;){if(b=e[e.length-1],this.defaultActions[b]?w=this.defaultActions[b]:(null==y&&(y=m()),w=h[b]&&h[b][y]),void 0===w||!w.length||!w[0]){var _="";for(A in R=[],h[b])this.terminals_[A]&&A>2&&R.push("'"+this.terminals_[A]+"'");_=u.showPosition?"Parse error on line "+(l+1)+":\n"+u.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(_,{text:u.match,token:this.terminals_[y]||y,line:u.yylineno,loc:p,expected:R})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+y);switch(w[0]){case 1:e.push(y),a.push(u.yytext),n.push(u.yylloc),e.push(w[1]),y=null,c=u.yyleng,r=u.yytext,l=u.yylineno,p=u.yylloc;break;case 2:if(C=this.productions_[w[1]][1],T.$=a[a.length-C],T._$={first_line:n[n.length-(C||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(C||1)].first_column,last_column:n[n.length-1].last_column},f&&(T._$.range=[n[n.length-(C||1)].range[0],n[n.length-1].range[1]]),void 0!==(S=this.performAction.apply(T,[r,c,l,x.yy,w[1],a,n].concat(g))))return S;C&&(e=e.slice(0,-1*C*2),a=a.slice(0,-1*C),n=n.slice(0,-1*C)),e.push(this.productions_[w[1]][0]),a.push(T.$),n.push(T._$),k=h[e[e.length-2]][e[e.length-1]],e.push(k);break;case 3:return!0}}return!0},"parse")},v=function(){return{EOF:1,parseError:o(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:o(function(t,i){return this.yy=i||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var i=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===s.length?this.yylloc.first_column:0)+s[s.length-e.length].length-e[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:o(function(t,i){var e,s,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var n in a)this[n]=a[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,i,e,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),n=0;n<a.length;n++)if((e=this._input.match(this.rules[a[n]]))&&(!i||e[0].length>i[0].length)){if(i=e,s=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,a[n])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,a[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,i,e,s){switch(e){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),36;case 4:return 36;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}}();function E(){this.yy={}}return P.lexer=v,o(E,"Parser"),E.prototype=P,P.Parser=E,new E}();w.parser=w;var S=w;function A(t){return"bar"===t.type}function C(t){return"band"===t.type}function k(t){return"linear"===t.type}o(A,"isBarPlot"),o(C,"isBandAxisData"),o(k,"isLinearAxisData");var R=class{constructor(t){this.parentGroup=t}static{o(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};const e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i),a=s.node()?.getScreenCTM?.(),n=o(t=>t&&t>0?t:1,"toScale"),h=n(a?.a),r=n(a?.d);for(const a of t){const t=f(s,1,a),n=t?t.width/h:a.length*i,o=t?t.height/r:i;e.width=Math.max(e.width,n),e.height=Math.max(e.height,o)}return s.remove(),e}},T=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{o(this,"BaseAxis")}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=.2*t.width;this.outerPadding=Math.min(e.width/2,s);let a=e.height;"bottom"===this.axisPosition&&0!==this.normalizedLabelRotationInRad&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*e.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*e.height))),a+=2*this.axisConfig.labelPadding,this.labelTextHeight=e.height,a<=i&&(i-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=.2*t.height;this.outerPadding=Math.min(e.height/2,s);const a=e.width+2*this.axisConfig.labelPadding;a<=i&&(i-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){const i=this.normalizedLabelRotationInRad;return 0===i?0:Math.sin(i)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:180*this.normalizedLabelRotationInRad/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},_=class extends T{static{o(this,"BandAxis")}constructor(t,i,e,s,a){super(t,s,a,i),this.categories=e,this.scale=m().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=m().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),h.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},D=class extends T{static{o(this,"LinearAxis")}constructor(t,i,e,s,a){super(t,s,a,i),this.domain=e,this.scale=y().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=y().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function L(t,i,e,s){const a=new R(s);return C(t)?new _(i,e,t.categories,t.title,a):new D(i,e,[t.min,t.max],t.title,a)}o(L,"getAxis");var P=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.titleWidth=0,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{o(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return s<=t.height&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.titleWidth=i.width,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}alignTo(t,i){const e=Math.min(this.titleWidth,this.chartConfig.width)/2,s=Math.min(Math.max((t+i)/2,e),this.chartConfig.width-e);this.boundingRect.x=s-e,this.boundingRect.width=2*e}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function v(t,i,e,s){const a=new R(s);return new P(a,t,i,e)}o(v,"getChartTitleComponent");function E(t){return{fontSize:t,markerSize:.75*t,markerSpacing:.35*t,itemSpacing:.5*t}}o(E,"getLegendLayout");var M=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{o(this,"ChartLegend")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(t=>t.title):[],0===this.visiblePlots.length)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};const{fontSize:i,markerSize:e,markerSpacing:s,itemSpacing:a}=E(this.chartConfig.legendFontSize),n=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(t=>t.title),i),o=2*this.chartConfig.legendPadding+e+s+n.width,h=2*this.chartConfig.legendPadding+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;return o<=t.width&&h<=t.height?(this.boundingRect.width=o,this.boundingRect.height=h):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(0===this.visiblePlots.length)return[];const{fontSize:t,markerSize:i,markerSpacing:e,itemSpacing:s}=E(this.chartConfig.legendFontSize),a=t+s,n=this.boundingRect.x+this.chartConfig.legendPadding,o=this.boundingRect.y+this.chartConfig.legendPadding,h=[],r=[];for(const[t,e]of this.visiblePlots.entries())if(A(e))h.push({x:n,y:o+t*a,width:i,height:i,fill:e.fill,strokeFill:e.fill,strokeWidth:0});else{const s=o+t*a+i/2;r.push({path:`M ${n},${s} L ${n+i},${s}`,strokeFill:e.strokeFill,strokeWidth:e.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:h},{groupTexts:["legend","markers"],type:"path",data:r},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((s,h)=>({text:s.title,x:n+i+e,y:o+h*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:t,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function z(t,i,e,s){const a=new R(s);return new M(a,t,i,e)}o(z,"getChartLegendComponent");var I=class{constructor(t,i,e,s,a){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=a}static{o(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);let i;if(i="horizontal"===this.orientation?b().y(t=>t[0]).x(t=>t[1])(t):b().x(t=>t[0]).y(t=>t[1])(t),!i)return[];const e=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const i=10,s=12,a=[];for(const[e,[n,o]]of t.entries()){const t=this.plotData.pointLabels[e];t&&("horizontal"===this.orientation?a.push({x:o+i,y:n,text:t,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:s,rotation:0}):a.push({x:n,y:o-i,text:t,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:s,rotation:0}))}a.length>0&&e.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:a})}return e}},B=class{constructor(t,i,e,s,a,n){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=a,this.plotIndex=n}static{o(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),e=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-e,height:i,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:t[0]-e,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},$=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}static{o(this,"BasePlot")}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const s=new I(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new B(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}}return t}};function W(t,i,e){return new $(t,i,e)}o(W,"getPlotComponent");var F,O=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:v(t,i,e,s),plot:W(t,i,e),legend:z(t,i,e,s),xAxis:L(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:L(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}static{o(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,a={width:0,height:0},n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),h=this.componentStore.plot.calculateSpace({width:n,height:o});t-=h.width,i-=h.height,h=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=h.height,i-=h.height,this.componentStore.xAxis.setAxisPosition("bottom"),h=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=h.height,this.componentStore.yAxis.setAxisPosition("left"),h=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=h.width,t-=h.width,a=this.componentStore.legend.calculateSpace({width:t,height:o}),t-=a.width,t>0&&(n+=t,t=0),i>0&&(o+=i,i=0),this.componentStore.plot.calculateSpace({width:n,height:o}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.title.alignTo(e,e+n),this.componentStore.legend.setBoundingBoxXY({x:e+n,y:s+Math.max((o-a.height)/2,0)}),this.componentStore.xAxis.setRange([e,e+n]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+o}),this.componentStore.yAxis.setRange([s,s+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(t=>A(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,a=0,n={width:0,height:0},o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),h=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),r=this.componentStore.plot.calculateSpace({width:o,height:h});t-=r.width,i-=r.height,r=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=r.height,i-=r.height,this.componentStore.xAxis.setAxisPosition("left"),r=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=r.width,s=r.width,this.componentStore.yAxis.setAxisPosition("top"),r=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=r.height,a=e+r.height,n=this.componentStore.legend.calculateSpace({width:t,height:h}),t-=n.width,t>0&&(o+=t,t=0),i>0&&(h+=i,i=0),this.componentStore.plot.calculateSpace({width:o,height:h}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.title.alignTo(s,s+o),this.componentStore.legend.setBoundingBoxXY({x:s+o,y:a+Math.max((h-n.height)/2,0)}),this.componentStore.yAxis.setRange([s,s+o]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([a,a+h]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(t=>A(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},X=class{static{o(this,"XYChartBuilder")}static build(t,i,e,s){return new O(t,i,e,s).getDrawableElement()}},N=0,V=K(),Y=Q(),j=Z(),H=Y.plotColorPalette.split(",").map(t=>t.trim()),U=!1,G=!1;function Q(){const t=p(),i=g();return x(t.xyChart,i.themeVariables.xyChart)}function K(){const t=g();return x(d.xyChart,t.xyChart)}function Z(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function q(t){const i=g();return u(t.trim(),i)}function J(t){F=t}function tt(t){V.chartOrientation="horizontal"===t?"horizontal":"vertical"}function it(t){j.xAxis.title=q(t.text)}function et(t,i){j.xAxis={type:"linear",title:j.xAxis.title,min:t,max:i},U=!0}function st(t){j.xAxis={type:"band",title:j.xAxis.title,categories:t.map(t=>q(t.text))},U=!0}function at(t){j.yAxis.title=q(t.text)}function nt(t,i){j.yAxis={type:"linear",title:j.yAxis.title,min:t,max:i},G=!0}function ot(t){const i=Math.min(...t),e=Math.max(...t),s=k(j.yAxis)?j.yAxis.min:1/0,a=k(j.yAxis)?j.yAxis.max:-1/0;j.yAxis={type:"linear",title:j.yAxis.title,min:Math.min(s,i),max:Math.max(a,e)}}function ht(t){let i=[];if(0===t.length)return i;if(!U){const i=k(j.xAxis)?j.xAxis.min:1/0,e=k(j.xAxis)?j.xAxis.max:-1/0;et(Math.min(i,1),Math.max(e,t.length))}if(C(j.xAxis)&&t.length>j.xAxis.categories.length&&(t=t.slice(0,j.xAxis.categories.length)),G||ot(t),C(j.xAxis)&&(i=j.xAxis.categories.map((i,e)=>[i,t[e]])),k(j.xAxis)){const e=j.xAxis.min,s=j.xAxis.max;if(1===t.length)i=[[`${e}`,t[0]]];else{const a=(s-e)/(t.length-1);i=t.map((t,i)=>[`${e+i*a}`,t])}}return i}function rt(t){return H[0===t?0:t%H.length]}function lt(t,i){const e=i.map(t=>t.value),s=i.map(t=>t.label?q(t.label):""),a=ht(e),n=s.some(t=>""!==t);j.plots.push({type:"line",title:q(t.text),strokeFill:rt(N),strokeWidth:2,data:a,...n?{pointLabels:s}:{}}),N++}function ct(t,i){const e=ht(i.map(t=>t.value));j.plots.push({type:"bar",title:q(t.text),fill:rt(N),data:e}),N++}function gt(){if(0===j.plots.length)throw Error("No Plot to render, please provide a plot with some data");return j.title=e(),X.build(V,j,Y,F)}function ut(){return Y}function xt(){return V}function dt(){return j}o(Q,"getChartDefaultThemeConfig"),o(K,"getChartDefaultConfig"),o(Z,"getChartDefaultData"),o(q,"textSanitizer"),o(J,"setTmpSVGG"),o(tt,"setOrientation"),o(it,"setXAxisTitle"),o(et,"setXAxisRangeData"),o(st,"setXAxisBand"),o(at,"setYAxisTitle"),o(nt,"setYAxisRangeData"),o(ot,"setYAxisRangeFromPlotData"),o(ht,"transformDataWithoutCategory"),o(rt,"getPlotColorFromPalette"),o(lt,"setLineData"),o(ct,"setBarData"),o(gt,"getDrawableElem"),o(ut,"getChartThemeConfig"),o(xt,"getChartConfig"),o(dt,"getXYChartData");var pt={parser:S,db:{getDrawableElem:gt,clear:o(function(){c(),N=0,V=K(),j={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},Y=Q(),H=Y.plotColorPalette.split(",").map(t=>t.trim()),U=!1,G=!1},"clear"),setAccTitle:n,getAccTitle:a,setDiagramTitle:s,getDiagramTitle:e,getAccDescription:i,setAccDescription:t,setOrientation:tt,setXAxisTitle:it,setXAxisRangeData:et,setXAxisBand:st,setYAxisTitle:at,setYAxisRangeData:nt,setLineData:lt,setBarData:ct,setTmpSVGG:J,getChartThemeConfig:ut,getChartConfig:xt,getXYChartData:dt},renderer:{draw:o((t,i,e,s)=>{const a=s.db,n=a.getChartThemeConfig(),c=a.getChartConfig(),g=a.getXYChartData().plots[0].data.map(t=>t[1]);function u(t){return"top"===t?"text-before-edge":"middle"}function x(t){return"left"===t?"start":"right"===t?"end":"middle"}function d(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}o(u,"getDominantBaseLine"),o(x,"getTextAnchor"),o(d,"getTextTransformation"),h.debug("Rendering xychart chart\n"+t);const p=r(i),f=p.append("g").attr("class","main"),m=f.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");l(p,c.height,c.width,!0),p.attr("viewBox",`0 0 ${c.width} ${c.height}`),m.attr("fill",n.backgroundColor),a.setTmpSVGG(p.append("g").attr("class","mermaid-tmp-group"));const y=a.getDrawableElem(),b={};function w(t){let i=f,e="";for(const[s]of t.entries()){let a=f;s>0&&b[e]&&(a=b[e]),e+=t[s],i=b[e],i||(i=b[e]=a.append("g").attr("class",t[s]))}return i}o(w,"getGroup");for(const t of y){if(0===t.data.length)continue;const i=w(t.groupTexts);switch(t.type){case"rect":if(i.selectAll("rect").data(t.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),c.showDataLabel){const e=c.showDataLabelOutsideBar;if("horizontal"===c.chartOrientation){let s=function(t,i){const{data:e,label:s}=t;return i*s.length*a<=e.width-h};o(s,"fitsHorizontally");const a=.7,h=10,r=t.data.map((t,i)=>({data:t,label:g[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),l=r.map(t=>{const{data:i}=t;let e=.7*i.height;for(;!s(t,e)&&e>0;)e-=1;return e}),c=Math.floor(Math.min(...l)),u=o(t=>e?t.data.x+t.data.width+h:t.data.x+t.data.width-h,"determineLabelXPosition");i.selectAll("text").data(r).enter().append("text").attr("x",u).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor",e?"start":"end").attr("dominant-baseline","middle").attr("fill",n.dataLabelColor).attr("font-size",`${c}px`).text(t=>t.label)}else{let s=function(t,i,e){const{data:s,label:a}=t,n=i*a.length*.7,o=s.x+s.width/2,h=o+n/2,r=o-n/2>=s.x&&h<=s.x+s.width,l=s.y+e+i<=s.y+s.height;return r&&l};o(s,"fitsInBar");const a=10,h=t.data.map((t,i)=>({data:t,label:g[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),r=h.map(t=>{const{data:i,label:e}=t;let n=i.width/(.7*e.length);for(;!s(t,n,a)&&n>0;)n-=1;return n}),l=Math.floor(Math.min(...r)),c=o(t=>e?t.data.y-a:t.data.y+a,"determineLabelYPosition");i.selectAll("text").data(h).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",c).attr("text-anchor","middle").attr("dominant-baseline",e?"auto":"hanging").attr("fill",n.dataLabelColor).attr("font-size",`${l}px`).text(t=>t.label)}}break;case"text":i.selectAll("text").data(t.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>u(t.verticalPos)).attr("text-anchor",t=>x(t.horizontalPos)).attr("transform",t=>d(t)).text(t=>t.text);break;case"path":i.selectAll("path").data(t.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}};export{pt as diagram};
|
|
@@ -29,5 +29,7 @@ export declare function getKeyWebSocketEventDto(event: WebSocketSubscribeEventDt
|
|
|
29
29
|
length: 24;
|
|
30
30
|
}}|${string}-${string}` | `USER_NOTIFICATION_CONTEST_CLARIFICATION-${string & {
|
|
31
31
|
length: 24;
|
|
32
|
+
}}|${string}-${string}` | `SUBMISSION_JUDGING-${string & {
|
|
33
|
+
length: 24;
|
|
32
34
|
}}|${string}-${string}`;
|
|
33
35
|
export declare function getUnsubscribeEvent(event: WebSocketSubscribeEventDto): WebSocketUnsubscribeEventDto;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SubmissionsJudgingScope } from '@juki-team/commons';
|
|
2
|
+
/**
|
|
3
|
+
* One shared, debounced revalidation of the submissions lists: several submissions finishing at the same time
|
|
4
|
+
* (every cell of a table) produce one refetch instead of one per cell.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useRevalidateSubmissions: () => () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to the judging start/end of the submissions of a table (one channel per table): the cells on screen attach
|
|
9
|
+
* the case by case channel only while their submission is being judged, also when it is rejudged from another screen.
|
|
10
|
+
* The scope is a problem, a contest or a user: the channel and who can use it are decided by commons and the API.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useSubmissionsJudging: (scope: SubmissionsJudgingScope) => void;
|
package/dist/module-types/src/components/organisms/SubmitView/commons/SubmissionListenerVerdict.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import { type SubmissionSummaryListResponseDto } from '@juki-team/commons';
|
|
|
2
2
|
interface SubmissionListenerVerdictProps {
|
|
3
3
|
submit: SubmissionSummaryListResponseDto;
|
|
4
4
|
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Keep the channel of the submission attached even if it is not being judged. Tables don't need it: they learn about
|
|
7
|
+
* a rejudge from `useSubmissionsJudging`. For a view of one submission, without a table channel.
|
|
8
|
+
*/
|
|
9
|
+
alwaysListen?: boolean;
|
|
5
10
|
}
|
|
6
|
-
export declare const SubmissionListenerVerdict: ({ submit, className }: SubmissionListenerVerdictProps) => import("react").JSX.Element;
|
|
11
|
+
export declare const SubmissionListenerVerdict: ({ submit, className, alwaysListen }: SubmissionListenerVerdictProps) => import("react").JSX.Element;
|
|
7
12
|
export {};
|
package/dist/module-types/src/components/organisms/SubmitView/commons/SubmissionVerdict.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ProblemVerdict, type SubmissionDataResponseDto, SubmissionRunStatus
|
|
1
|
+
import { ProblemVerdict, type SubmissionDataResponseDto, SubmissionRunStatus } from '@juki-team/commons';
|
|
2
|
+
import type { LiveSubmissionData } from '../../../../stores/submissionsLive/useSubmissionsLiveStore';
|
|
2
3
|
export interface SubmissionVerdictProps {
|
|
3
4
|
verdict: ProblemVerdict;
|
|
4
5
|
points?: number;
|
|
5
6
|
status?: SubmissionRunStatus;
|
|
6
7
|
submitId: string;
|
|
7
|
-
submissionData?:
|
|
8
|
+
submissionData?: LiveSubmissionData;
|
|
8
9
|
processedCases?: SubmissionDataResponseDto['processedCases'];
|
|
9
10
|
shortLabel?: boolean;
|
|
10
11
|
className?: string;
|
|
11
12
|
}
|
|
12
|
-
export declare const SubmissionVerdict: (props: SubmissionVerdictProps) => import("react").JSX.Element
|
|
13
|
+
export declare const SubmissionVerdict: import("react").MemoExoticComponent<(props: SubmissionVerdictProps) => import("react").JSX.Element>;
|
|
@@ -7,6 +7,7 @@ export * from '../components/hooks/useDataViewerRequester';
|
|
|
7
7
|
export * from '../components/hooks/useDebounceEffect';
|
|
8
8
|
export * from '../components/hooks/useEntityDiff';
|
|
9
9
|
export * from '../components/hooks/useFetcher';
|
|
10
|
+
export * from '../components/hooks/useSubmissionsJudging';
|
|
10
11
|
export * from '../components/hooks/useFocusTrap';
|
|
11
12
|
export * from '../components/hooks/useHandleState';
|
|
12
13
|
export * from '../components/hooks/useHash';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ProblemVerdict, SubmissionRunStatus, type TestInfo } from '@juki-team/commons';
|
|
2
|
+
export interface LiveSubmissionData {
|
|
3
|
+
status: SubmissionRunStatus;
|
|
4
|
+
verdict: ProblemVerdict;
|
|
5
|
+
points: number;
|
|
6
|
+
testInfo?: TestInfo;
|
|
7
|
+
createdAt: number;
|
|
8
|
+
}
|
|
9
|
+
export interface LiveSubmission {
|
|
10
|
+
judging: boolean;
|
|
11
|
+
data: LiveSubmissionData;
|
|
12
|
+
/** when the last accepted message arrived (client clock) */
|
|
13
|
+
receivedAt: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const isTerminalStatus: (status: SubmissionRunStatus) => status is SubmissionRunStatus.FAILED | SubmissionRunStatus.COMPLETED;
|
|
16
|
+
interface SubmissionsLiveState {
|
|
17
|
+
entries: Record<string, LiveSubmission>;
|
|
18
|
+
apply: (submitId: string, data: LiveSubmissionData) => void;
|
|
19
|
+
remove: (submitId: string) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Live state of the submissions by submitId, fed by the websocket messages. It lives outside the cells so it survives
|
|
23
|
+
* their unmounts (virtualized rows while scrolling, changing tabs) and is shared by every cell of a submission.
|
|
24
|
+
*/
|
|
25
|
+
export declare const useSubmissionsLiveStore: import("zustand").UseBoundStore<import("zustand").StoreApi<SubmissionsLiveState>>;
|
|
26
|
+
export {};
|
|
@@ -10,6 +10,7 @@ import type Ably from 'ably';
|
|
|
10
10
|
* - private channels of the token (`session:{id}`, `user:{id}`): always
|
|
11
11
|
* - topic channels needed by the active subscriptions (`getChannelOfWebSocketSubscribeEvent`): while they are used
|
|
12
12
|
* - role channels of the contest being viewed (`contest:{key}:{role}` granted in the token): while it is viewed
|
|
13
|
+
* - problem being viewed (`problem:{key}:{role}`): its token param is requested while it is viewed
|
|
13
14
|
* - organization presence (`presence:organization:{id}`): this tab enters the presence of its organization (`presence` only, it
|
|
14
15
|
* does not receive the others); the administrators watching a organization also receive it (`presence-subscribe`)
|
|
15
16
|
*
|
|
@@ -21,6 +22,7 @@ type Dispatch = (key: string, data: WebSocketResponseEventDto) => void;
|
|
|
21
22
|
*/
|
|
22
23
|
export declare const getTopicChannelsAuthParams: () => {
|
|
23
24
|
contestKey?: string;
|
|
25
|
+
problemKey?: string;
|
|
24
26
|
presenceCompanyKey?: string;
|
|
25
27
|
};
|
|
26
28
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juki-team/base-ui",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.16",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/juki-team/base-ui"
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@floating-ui/react": "^0.27.20",
|
|
92
92
|
"@handsontable/react-wrapper": "^18.1.2",
|
|
93
93
|
"@hookform/resolvers": "^6.0.2",
|
|
94
|
-
"@juki-team/commons": "0.1.
|
|
94
|
+
"@juki-team/commons": "0.1.47",
|
|
95
95
|
"@mdx-js/mdx": "^3.1.1",
|
|
96
96
|
"@milkdown/components": "^7.23.0",
|
|
97
97
|
"@milkdown/core": "^7.23.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import"./settings-6x4qNkNZ.js";import"react";import"./enums.js";import"./constants.js";import{r as o}from"./LoaderLayer-Csc8unUJ.js";const t=({color:o})=>r("path",{d:"m12 20-1.425-1.4 5.6-5.6H4v-2h12.175l-5.6-5.6L12 4l8 8Z",fill:o}),s=r=>o(r,t,"arrow-forward");export{s as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{ad as i,a9 as r,ae as s,af as n,ag as o,ah as l,ai as d,aj as c,ak as h,al as p,am as m,an as u,ao as g,ap as f,aq as y,ar as w,as as v,at as b,au as k,av as x,aw as N,ax as R,ay as j,az as S,aA as D,S as C,w as F,b as O,P as z,i as I,c as T,aB as P,aC as L,aD as E,aE as V,aF as M,aG as W,aH as H,aI as A,aJ as K,aK as B}from"./settings-6x4qNkNZ.js";import{memo as $,useRef as J,useState as Q,useMemo as Y,useCallback as q,useEffect as G,useId as U,Children as _}from"react";import{SCROLL_WIDTH as X,EMPTY_ARRAY as Z}from"./constants.js";import{K as ee,N as te,B as ae,T as ie,O as re,w as se,Q as ne,a as oe,l as le,R as de,f as ce,S as he,p as pe,U as me,V as ue,X as ge,Y as fe,J as ye,e as we}from"./index-38k9tHSo.js";import{c as ve,i as be,f as ke}from"./commons-BLDufAOm.js";import{r as xe,H as Ne,B as Re,f as je,D as Se}from"./websocket-D79arGLt.js";import{TriggerAction as De}from"./enums.js";import{e as Ce,S as Fe,R as Oe,f as ze,g as Ie,L as Te}from"./LoaderLayer-Csc8unUJ.js";import{motion as Pe,LayoutGroup as Le}from"motion/react";import"react-dom";import{u as Ee}from"./index-CKBtKrj5.js";import{A as Ve,S as Me}from"./index-D954khxt.js";import{F as We,T as He,C as Ae,M as Ke}from"./TableEyeIcon-CYXh-eSU.js";import"swr";import"./index-3QSNRp1k.js";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"@ably/spaces/dist/mjs/react";const Be=[["top","topLeft","top","topRight"],["upper","upperLeft","upper","upperRight"],["center","centerLeft","center","centerRight"],["lower","lowerLeft","lower","lowerRight"],["bottom","bottomLeft","bottom","bottomRight"]],$e=$(a=>{const{cardWidth:i,index:r,data:s,sections:n,fake:o,getRecordStyle:l,getRecordClassName:d,onRecordClick:c,onRecordHover:h}=a;if(o)return e("div",{className:"jk-list-card",style:{width:i,opacity:0}});const p=s[r],m=({index:t,Field:a})=>e("div",{children:p&&e(a,{record:p,columnIndex:t,recordIndex:r,isCard:!0})},t);return e("div",{className:ve("jk-list-card jk-br",d?.({data:s,index:r,isCard:!0,isStickySection:!1})||""),style:{...l?.({data:s,index:r,isCard:!0,isStickySection:!1})||{},width:i},onClick:c?()=>c({data:s,index:r,isCard:!0}):void 0,onMouseEnter:h?()=>h({data:s,index:r,isCard:!0}):void 0,children:Be.map(([a,i,r,s])=>{const o=n[i],l=n[r],d=n[s];return o?.length||l?.length||d?.length?t("div",{className:ve(`${a}-container`,{"no-middle":"top"===a||!l?.length}),children:[e("div",{className:`${i.replace(/([A-Z])/g,"-$1").toLowerCase()} jk-col stretch`,children:o?.map(m)}),e("div",{className:`${a} jk-col stretch`,children:l?.map(m)}),e("div",{className:`${s.replace(/([A-Z])/g,"-$1").toLowerCase()} jk-col stretch`,children:d?.map(m)})]},a):null})})}),Je=t=>{const{headers:a,data:i,cardHeight:r,cardWidth:s,rowWidth:n,getRecordStyle:o,onRecordClick:l,onRecordHover:d,getRecordClassName:c,expandedCards:h}=t,p=J(null),[m,u]=Q(!1),[g,f]=Q(!1),y=Y(()=>(e=>{const t={};for(const a of e){const e=a.cardPosition||"center";(t[e]??(t[e]=[])).push(a)}return t})(a),[a]),w=Math.max(Math.floor((n-16)/(s+16)),1),v=Ee({count:Math.ceil(i.length/w),getScrollElement:q(()=>p.current,[]),estimateSize:q(()=>r+40,[r]),overscan:2});let b=Math.min(s,n-16-16);return h&&(b=(n-16*(w+1))/w),e("div",{ref:p,className:ve("jk-list-card-rows-container",{"scroll-on-top":!m,"scroll-on-bottom":!g}),onScroll:({currentTarget:e})=>{const t=e.scrollTop||0;f(!!(e.scrollHeight-e.clientHeight-t)),u(!!t)},children:e("div",{className:"jk-list-card-rows-box",style:{height:`${v.getTotalSize()}px`,zIndex:0},children:v.getVirtualItems().map(t=>e("div",{style:{height:`${t.size}px`,transform:`translateY(${t.start}px)`},className:"jk-row jk-list-card-row",children:Array.from({length:w},(a,r)=>{const s=t.index*w+r;return e($e,{fake:s>=i.length,cardWidth:b,sections:y,data:i,index:s,getRecordClassName:c,getRecordStyle:o,onRecordClick:l,onRecordHover:d},s)})},t.index))})})},Qe=e=>e.minWidth||100,Ye=e=>`var(--jk-col-w-${e})`,qe=e=>`var(--jk-col-l-${e})`,Ge="var(--jk-table-w)",Ue=(e,t)=>{const a=[];let i=0,r=0;return t.forEach((t,s)=>{a.push(i),i+=t,e[s]?.sticky&&(r+=t)}),{widths:t,lefts:a,total:i,stickyWidth:r}},_e=e=>[["--jk-table-w",`${e.total}px`],...e.widths.map((e,t)=>[`--jk-col-w-${t}`,`${e}px`]),...e.lefts.map((e,t)=>[`--jk-col-l-${t}`,`${e}px`])],Xe="text",Ze="text-auto",et="select",tt="select-auto",at="date",it="date-auto",rt="date-range",st="date-range-auto",nt=e=>!("object"!=typeof e||!e?.compareFn),ot=e=>!0===e,lt=e=>!e?.hasOwnProperty("callbackFn")&&e?.type===Xe,dt=e=>!!e?.hasOwnProperty("callbackFn")&&e?.type===Xe,ct=e=>e?.type===Ze,ht=e=>!e?.hasOwnProperty("callbackFn")&&e?.type===et,pt=e=>!!e?.hasOwnProperty("callbackFn")&&e?.type===et,mt=e=>e?.type===tt,ut=e=>!e?.hasOwnProperty("callbackFn")&&e?.type===at,gt=e=>!!e?.hasOwnProperty("callbackFn")&&e?.type===at,ft=e=>!e?.hasOwnProperty("callbackFn")&&e?.type===it,yt=e=>!e?.hasOwnProperty("callbackFn")&&e?.type===rt,wt=e=>!!e?.hasOwnProperty("callbackFn")&&e?.type===rt,vt=e=>!e?.hasOwnProperty("callbackFn")&&e?.type===st,bt=e=>e?.type===Xe,kt=e=>e?.type===et,xt=e=>e?.type===at,Nt=e=>e?.type===rt,Rt=({header:t,columnIndex:a,className:i})=>"string"==typeof t.head?e(ee,{text:t.head,className:i}):t.head?xe(t.head,{header:t,data:[]}):e(ee,{text:a,className:i}),jt=e=>t=>({year:!!e&&p(t,e),month:!!e&&h(t,e),day:!!e&&c(t,e),hours:!!e&&d(t,e),minutes:!!e&&l(t,e),seconds:!!e&&o(t,e),milliseconds:!!e&&n(t,e)}),St=(e,t)=>a=>({year:!!e&&!!t&&(p(a,e)||p(a,t)||m(a,{start:e,end:t})),month:!!e&&!!t&&(h(a,e)||h(a,t)||m(a,{start:e,end:t})),day:!!e&&!!t&&(c(a,e)||c(a,t)||m(a,{start:e,end:t})),hours:!!e&&!!t&&(d(a,e)||d(a,t)||m(a,{start:e,end:t})),minutes:!!e&&!!t&&(l(a,e)||l(a,t)||m(a,{start:e,end:t})),seconds:!!e&&!!t&&(o(a,e)||o(a,t)||m(a,{start:e,end:t})),milliseconds:!!e&&!!t&&(n(a,e)||n(a,t)||m(a,{start:e,end:t}))}),Dt=e=>t=>({year:!!e&&D(t,e),month:!!e&&S(t,e),day:!!e&&j(t,e),hours:!!e&&R(t,e),minutes:!!e&&N(t,e),seconds:!!e&&x(t,e),milliseconds:!!e&&k(t,e)}),Ct=(e,t)=>a=>{const i=e(a),r=t(a);return{year:i.year||r.year,month:i.month||r.month,day:i.day||r.day,hours:i.hours||r.hours,minutes:i.minutes||r.minutes,seconds:i.seconds||r.seconds,milliseconds:i.milliseconds||r.milliseconds}},Ft=e=>t=>({year:!!e&&b(t,e),month:!!e&&v(t,e),day:!!e&&w(t,e),hours:!!e&&y(t,e),minutes:!!e&&f(t,e),seconds:!!e&&g(t,e),milliseconds:!!e&&u(t,e)}),Ot=e=>{let t=!1;const a={};return e.forEach(({index:e,filter:i})=>{if(bt(i))i.getFilter?.()&&(a[e]=i.getFilter(),t=!0);else if(kt(i))i.getFilter?.()?.length&&(a[e]=i.getFilter(),t=!0);else if(xt(i))(i.getFilter?.()?s(i.getFilter?.()):void 0)&&(a[e]=i.getFilter(),t=!0);else if(Nt(i)){const r=i.getFilter?.();(r?.[0]?s(r?.[0]):void 0)&&(r?.[1]?s(r?.[1]):void 0)&&(a[e]=r,t=!0)}}),{filtered:t,values:a}},zt=e=>e?e+".page":"page",It=e=>e?e+".pageSize":"pageSize",Tt=e=>e?e+".sort":"sort",Pt=e=>e?e+".filter":"filter",Lt=e=>e?e+".viewMode":"viewMode",Et=e=>e?e+".showFilterDrawer":"showFilterDrawer",Vt=e=>e?e+".visibles":"visibles",Mt=new Map;function Wt(e,t){const a=`${e}-${t}`;if(Mt.has(a))return Mt.get(a);if("undefined"!=typeof document){const i=(Wt.canvas||(Wt.canvas=document.createElement("canvas"))).getContext("2d");if(i){i.font=t;const r=i.measureText(e).width;return Mt.set(a,r),r}}return 0}const Ht="year-month-day-hours-minutes-seconds",At=e=>!!Object.values(e).filter(e=>!!e&&(!Array.isArray(e)||e.length)).length,Kt=(e,t,a,i)=>()=>{const r={...t.current};r[e]="",At(r)?a(JSON.stringify(r)):i()},Bt=(e,t,a,i,r)=>{const s={...a.current};JSON.stringify(s[e])!==JSON.stringify(t)&&(s[e]=t,At(s)?i(JSON.stringify(s)):r())},$t=a=>{const{onFilter:i,onReset:r,isDisabled:m,columnIndex:u,initialSelectedDate:g,pickerType:f,visible:y,baseDate:w}=a,[v,b]=Q(g),k=J(null);return G(()=>{y&&k.current?.focus()},[y]),t("div",{className:"jk-col gap jk-table-head-cell-filter-date jk-pg-sm",children:[e(te,{type:f,date:v,onDatePick:e=>b(e),onDateClean:()=>b(null),inline:!0,isDisabled:m,isSelected:e=>({year:!!v&&p(e,v),month:!!v&&h(e,v),date:!!v&&c(e,v),hours:!!v&&d(e,v),minutes:!!v&&l(e,v),seconds:!!v&&o(e,v),milliseconds:!!v&&n(e,v)}),baseDate:w,twoLines:"year-month-day-hours-minutes-seconds-milliseconds"===f||"year-month-day-hours-minutes-seconds"===f||"year-month-day-hours-minutes"===f||"year-month-day-hours"===f}),t("div",{className:"jk-row right gap buttons wh-100",children:[e(ae,{size:"tiny",type:"secondary",onClick:r,disabled:!s(g),children:e(ie,{className:"tt-se",children:"reset"})}),e(ae,{size:"tiny",onClick:()=>v&&i({columnIndex:u,selectedDate:v}),disabled:!s(v),ref:k,children:e(ie,{className:"tt-se",children:"filter"})})]})]})},Jt=a=>{const{onFilter:i,onReset:r,isDisabled:n,columnIndex:o,initialStartSelectedDate:l,initialEndSelectedDate:d,pickerType:c,visible:h,baseStartDate:p,baseEndDate:m}=a,[u,g]=Q(l),[f,y]=Q(d),w=J(null);return G(()=>{h&&w.current?.focus()},[h]),t("div",{className:"jk-col gap jk-table-head-cell-filter-date-range jk-pg-sm",children:[t("div",{className:"jk-row gap date-range nowrap",children:[t("div",{children:[t("div",{className:"jk-row center fw-bd",children:[e(ie,{className:"tt-se",children:"from"})," :"]}),e(te,{type:c,date:u,onDatePick:g,onDateClean:()=>g(null),inline:!0,isDisabled:Ct(n,Ft(f)),isSelected:Ct(jt(u),St(u,f)),baseDate:p,twoLines:"year-month-day-hours-minutes-seconds-milliseconds"===c||"year-month-day-hours-minutes-seconds"===c||"year-month-day-hours-minutes"===c||"year-month-day-hours"===c})]}),t("div",{children:[t("div",{className:"jk-row center fw-bd",children:[e(ie,{className:"tt-se",children:"to"})," :"]}),e(te,{type:c,date:f,onDatePick:y,onDateClean:()=>y(null),inline:!0,isDisabled:Ct(n,Dt(u)),isSelected:Ct(jt(f),St(u,f)),baseDate:m,twoLines:"year-month-day-hours-minutes-seconds-milliseconds"===c||"year-month-day-hours-minutes-seconds"===c||"year-month-day-hours-minutes"===c||"year-month-day-hours"===c})]})]}),t("div",{className:"jk-row gap right buttons wh-100",children:[e(ae,{size:"tiny",type:"secondary",onClick:r,disabled:!(l&&d&&s(l)&&s(d)),children:e(ie,{className:"tt-se",children:"reset"})}),e(ae,{size:"tiny",onClick:()=>u&&f&&s(u)&&s(f)&&i({columnIndex:o,startSelectedDate:u,endSelectedDate:f}),disabled:!(u&&f&&s(u)&&s(f)),ref:w,children:e(ie,{className:"tt-se",children:"filter"})})]})]})},Qt=a=>{const{onFilter:i,onReset:r,columnIndex:s,options:n,initialSelectedOptions:o,visible:l}=a,[d,c]=Q(o),h=J(null);return G(()=>{l&&h.current?.focus(),c(o)},[o,l]),t("div",{className:"jk-col gap stretch jk-table-head-cell-filter-select jk-pg-sm",children:[e("div",{className:"checkbox-list",children:e(re,{options:n.map(t=>({...t,label:"string"==typeof t.label?e(ie,{className:"tt-se",children:t.label}):t.label})),selectedOptions:d,onSelectOptions:c})}),t("div",{className:"jk-row right gap",children:[e(ae,{size:"tiny",type:"secondary",onClick:r,disabled:!o.length,children:e(ie,{className:"tt-se",children:"reset"})}),e(ae,{size:"tiny",onClick:()=>i({columnIndex:s,selectedOptions:d}),disabled:JSON.stringify(o.map(({value:e})=>e))===JSON.stringify(d.map(({value:e})=>e)),ref:h,children:e(ie,{className:"tt-se",children:"filter"})})]})]})},Yt=a=>{const{onFilter:i,onReset:r,columnIndex:s,initialText:n,visible:o}=a,[l,d]=Q(n),c=J(null);return G(()=>{o&&c.current?.focus()},[o]),t("div",{className:"jk-col gap stretch jk-table-head-cell-filter-text jk-pg-sm",onKeyDown:e=>{"Enter"===e.code&&(e.preventDefault(),i({columnIndex:s,text:l}))},children:[e(se,{onChange:e=>d(e),value:l,expand:!0,autoFocus:!0,ref:c}),t("div",{className:"jk-row right gap",children:[e(ae,{size:"tiny",type:"secondary",onClick:r,disabled:""===n,children:e(ie,{className:"tt-se",children:"reset"})}),e(ae,{size:"tiny",onClick:()=>i({columnIndex:s,text:l}),disabled:n===l,children:e(ie,{className:"tt-se",children:"filter"})})]})]})},qt=({filter:t,columnIndex:a})=>{const[i,r]=Q(!1),n=bt(t)?!!t.getFilter():kt(t)?!!t.getFilter().length:xt(t)?!!(t.getFilter()?s(t.getFilter()):void 0):!!Nt(t)&&(!!(t.getFilter()?.[0]?s(t.getFilter()?.[0]):void 0)&&!!(t.getFilter()?.[1]?s(t.getFilter()?.[1]):void 0));return e(ne,{popoverClassName:"bc-sf-hi jk-br-ie elevation-1",onOpenChange:r,content:({isOpen:i})=>{const s=()=>{t?.onReset(),r(!1)};return bt(t)?e(Yt,{columnIndex:a,initialText:t.getFilter(),onFilter:e=>{t.onFilter(e),r(!1)},onReset:s,visible:i}):kt(t)?e(Qt,{visible:i,columnIndex:a,options:t.options,initialSelectedOptions:t.getFilter(),onFilter:e=>{t.onFilter(e),r(!1)},onReset:s}):xt(t)?e($t,{visible:i,pickerType:t.pickerType,columnIndex:a,isDisabled:t.isDisabled,initialSelectedDate:t.getFilter(),onFilter:e=>{t.onFilter(e),r(!1)},onReset:s,baseDate:t.baseDate}):Nt(t)?e(Jt,{visible:i,pickerType:t.pickerType,columnIndex:a,isDisabled:t.isDisabled,initialStartSelectedDate:t.getFilter()[0],initialEndSelectedDate:t.getFilter()[1],onFilter:e=>{t.onFilter(e),r(!1)},onReset:s,baseStartDate:t.baseStartDate,baseEndDate:t.baseEndDate}):e("div",{children:"FILTER"})},placement:"bottom",triggerOn:De.CLICK,offset:4,children:e("div",{className:ve("tool jk-row jk-br-ie",{"bc-at-lt cr-at-it active":n,"cr-hd":!n,visible:i}),children:e(We,{size:"small"})})})},Gt=a=>{const{header:i,width:r,left:s,position:n,onResizeStart:o,loading:l,withTools:d,withRightBorder:c,borderTopLeftRadius:h,borderTopRightRadius:p,borderBottomLeftRadius:m,borderBottomRightRadius:u}=a,{index:g,filter:f,sort:y,sticky:w,headClassName:v}=i,{onSort:b,getOrder:k}=y||{},x=k?.();return e("div",{style:{width:r,minWidth:r,left:w?s:void 0,top:0,zIndex:w?3:2,borderTopLeftRadius:h?"var(--border-radius-inline)":void 0,borderTopRightRadius:p?"var(--border-radius-inline)":void 0,borderBottomLeftRadius:m?"var(--border-radius-inline)":void 0,borderBottomRightRadius:u?"var(--border-radius-inline)":void 0},className:ve({"with-right-border":c},"sticky jk-table-row-head"),"data-testid":g+"_head",children:t("div",{className:ve("jk-row nowrap jk-table-head-cell jk-pg-sm",{"with-sort":!!y,"with-filter":!!f?.onFilter,sticky:!!w}),style:{width:r,...i.style},children:[e("div",{className:"jk-table-head-field flex-1 ht-100",children:Rt({header:i,columnIndex:g,className:v})}),d&&t("div",{className:"jk-row jk-table-head-tools",children:[y&&e("div",{className:ve("tool jk-row jk-br-ie",{"bc-at-lt cr-at-it active":!!x,"cr-hd":!x}),onClick:()=>b({columnIndex:g}),children:x?e(x>0?Ve:Ce,{size:"small"}):e(Me,{up:!0,down:!0,size:"small"})}),f?.onFilter&&e(qt,{columnIndex:g,filter:f,disabled:l})]}),d&&o&&e("div",{className:"jk-table-head-drag",onMouseDown:e=>{e.preventDefault(),o(n,e.clientX)},onClick:e=>{e.preventDefault(),e.stopPropagation()},children:e("div",{})})]})})},Ut=$(a=>{const{columns:i,topHeaders:r,rightBorders:s,loading:n,gap:o,hasScrollTop:l,onResizeStart:d}=a,c=!!s.length;return t("div",{className:"jk-table-head-container",style:{paddingBottom:o},children:[c&&e("div",{className:ve("jk-table-head",{"elevation-1":l}),style:{width:Ge},children:r.map(({header:t,positions:a},i)=>e(Gt,{header:t,width:1===a.length?Ye(a[0]):`calc(${a.map(Ye).join(" + ")})`,left:qe(a[0]),position:a[0],loading:n,withTools:!1,withRightBorder:!(""===t.head&&""===r[i+1]?.header.head)&&i!==r.length-1,borderTopLeftRadius:0===i,borderTopRightRadius:i===r.length-1},t.headIndex))}),e("div",{className:ve("jk-table-head jk-br-ie",{"elevation-1":l}),style:{width:Ge},children:i.map((t,a)=>e(Gt,{header:t,width:Ye(a),left:qe(a),position:a,onResizeStart:d,loading:n,withTools:!0,withRightBorder:!1,borderTopLeftRadius:!c&&0===a,borderTopRightRadius:!c&&a===r.length-1,borderBottomLeftRadius:0===a,borderBottomRightRadius:a===i.length-1},t.headIndex))})]})});const _t=$(function(t){const{data:a,index:i,rowKey:r,start:s,size:n,gap:o,columns:l,rightBorders:d,getRecordStyle:c,getRecordClassName:h,onRecordClick:p,onRecordHover:m,animate:u}=t,g=a[i],f={...c?.({data:a,index:i,isCard:!1,isStickySection:!1})||{},position:"absolute",top:s+o,left:0,width:Ge,height:n-2*o+"px"},y=ve("jk-table-row",h?.({data:a,index:i,isCard:!1,isStickySection:!0})||""),w=p?()=>p({data:a,index:i,isCard:!1}):void 0,v=m?()=>m({data:a,index:i,isCard:!1}):void 0,b=l.map(({Field:t,index:a,sticky:s},n)=>e("div",{style:{width:Ye(n),minWidth:Ye(n),left:s?qe(n):void 0},className:ve({sticky:!!s,"with-right-border":d.has(n)},"jk-table-row-field bc-sf-md"),"data-testid":r+"_"+a,children:g&&e(t,{record:g,columnIndex:a,recordIndex:i,isCard:!1})},a));return u?e(Pe.div,{"jk-data-virtual-row-key":r,layoutId:String(r),layoutDependency:a,style:f,className:y,onClick:w,onMouseEnter:v,children:b}):e("div",{"jk-data-virtual-row-key":r,style:f,className:y,onClick:w,onMouseEnter:v,children:b})}),Xt={top:!1,bottom:!1,left:!1,right:!1};const Zt=a=>{const{data:i,headers:r,rowHeight:s,getRecordStyle:n,getRecordClassName:o,getRecordKey:l,onRecordClick:d,onRecordHover:c,gap:h,loading:p,availableWidth:m,groups:u,virtualizerOverscan:g,focusRowKey:f}=a,y=J(null),w=U(),v=!!l,b=oe(i),k=oe(l),x=Ee({count:i.length,estimateSize:q(()=>s+2*h,[s,h]),overscan:g,getScrollElement:q(()=>y.current,[]),getItemKey:q(e=>{const t=k.current;return t?t({data:b.current,index:e}):e},[b,k])}),N=Y(()=>r.filter(e=>e.visible?.getVisible?.()),[r]);G(()=>{const e=k.current;if(!f||!e)return;const t=b.current.findIndex((t,a)=>e({data:b.current,index:a})===f);t<0||x.scrollToIndex(t,{align:"center",behavior:"smooth"})},[b,f,k,x]);const R=x.getTotalSize(),j=x.getVirtualItems(),{topHeaders:S,rightBorders:D}=Y(()=>{const e=new Map(u.map(e=>[e.value,e])),t=[],a=[];return N.forEach((i,r)=>{var s;const n=void 0!==i.group?e.get(i.group):void 0,o=t[t.length-1];n?(o?.header.group===n.value?(o.positions.push(r),(s=o.header).sticky&&(s.sticky=i.sticky)):(a.length&&""!==o?.header.head||a.push(r-1),a.push(r),t.push({header:{...i,head:n.label,style:n.style},positions:[r]})),a[a.length-1]=r):t.push({header:{...i,head:"",style:{}},positions:[r]})}),{topHeaders:t,rightBorders:a}},[u,N]),[C,F]=Q({}),O=Y(()=>((e,t,a)=>{const i=e.reduce((e,t)=>e+Qe(t),0),r=t>i?t-i:0,s=e.map(e=>{const t=a[e.index];if(void 0!==t)return t;const s=Qe(e);return Math.floor(s+(i?r*(s/i):0))});return Ue(e,s)})(N,m,C),[N,m,C]),z=Y(()=>(e=>Object.fromEntries(_e(e)))(O),[O]),I=O.total,T=O.stickyWidth,P=oe(O),L=oe(N),E=q((e,t)=>{const a=y.current,i=L.current[e];if(!a||!i)return;const r=P.current,s=L.current,n=Qe(i);let o=r;const l=i=>{const l=Math.max((r.widths[e]??n)+i.clientX-t,n);l!==o.widths[e]&&(o=((e,t,a,i)=>{const r=[...e.widths];return r[a]=i,Ue(t,r)})(r,s,e,l),((e,t)=>{for(const[a,i]of _e(t))e.style.setProperty(a,i)})(a,o))},d=()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",d),o!==r&&F(t=>({...t,[i.index]:o.widths[e]}))};window.addEventListener("mousemove",l),window.addEventListener("mouseup",d)},[P,L]),V=Y(()=>new Set(D),[D]),{top:M,bottom:W,left:H,right:A}=function(e,t){const[a,i]=Q(Xt);return G(()=>{const t=e.current;if(!t)return;let a=0;const r=()=>{a=0;const{scrollTop:e,scrollLeft:r,clientHeight:s,clientWidth:n,scrollHeight:o,scrollWidth:l}=t,d={top:e>0,bottom:e+s<o-1,left:r>0,right:l-n-r>1};i(e=>e.top===d.top&&e.bottom===d.bottom&&e.left===d.left&&e.right===d.right?e:d)},s=()=>{a||(a=requestAnimationFrame(r))};s(),t.addEventListener("scroll",s,{passive:!0});const n="undefined"!=typeof ResizeObserver?new ResizeObserver(s):null;return n?.observe(t),()=>{t.removeEventListener("scroll",s),n?.disconnect(),a&&cancelAnimationFrame(a)}},[e,...t]),a}(y,[R,I]),K=M||W;return t("div",{ref:y,style:{...z,height:"100%",overflow:"scroll"},className:"jk-table-rows-container",children:[e(Ut,{columns:N,topHeaders:S,rightBorders:D,loading:p,gap:h,hasScrollTop:M,onResizeStart:E}),H&&e("div",{className:"expand-absolute pe-ne",style:{width:T,zIndex:3,background:"transparent",boxShadow:"0 0px 4px 0 var(--cr-ht), 0 0px 4px 1px var(--cr-ht)"}}),A&&e("div",{className:"expand-absolute pe-ne",style:{width:K?16:2,left:"unset",right:K?-8:-1,zIndex:3,background:"transparent",boxShadow:"0 0px 4px 0 var(--cr-ht), 0 0px 4px 1px var(--cr-ht)"}}),W&&e("div",{className:"expand-absolute pe-ne",style:{height:1,top:"unset",bottom:-1,zIndex:3,background:"transparent",boxShadow:"0 0px 4px 0 var(--cr-ht), 0 0px 4px 1px var(--cr-ht)"}}),t("div",{className:"jk-table-rows-box",style:{height:R},children:[!i.length&&e("div",{style:{position:"absolute",top:0,left:0,width:I,height:"1px",transform:"translateY(0px)"},className:"jk-table-row",children:N.map(({index:t,sticky:a},i)=>e("div",{style:{width:Ye(i),minWidth:Ye(i)},className:ve({sticky:!!a})},t))}),e(Le,{id:w,children:j.map(t=>e(_t,{rowKey:t.key,data:i,index:t.index,start:t.start,size:t.size,gap:h,columns:N,rightBorders:V,getRecordStyle:n,getRecordClassName:o,onRecordClick:d,onRecordHover:c,animate:v},t.key))})]})]})},ea=t=>{const{headers:a,viewContainerWidth:i,rowHeight:r,loading:s,data:n,getRecordKey:o,getRecordStyle:l,getRecordClassName:d,onRecordClick:c,onRecordHover:h,groups:p,virtualizerOverscan:m,focusRowKey:u}=t;return e(Zt,{data:n,headers:a,rowHeight:r,getRecordKey:o,getRecordClassName:d,getRecordStyle:l,onRecordClick:c,onRecordHover:h,gap:4,loading:s,availableWidth:Math.max((i||0)-X,0),groups:p,virtualizerOverscan:m,focusRowKey:u})},ta=({header:a,columnIndex:i,onSort:r,order:s})=>t("div",{className:"jk-row space-between",children:[e("div",{className:"jk-row gap",children:e("div",{className:"fw-bd",children:Rt({header:a,columnIndex:i})})}),r?t("div",{className:ve("jk-row nowrap jk-tag tx-s cr-pr",{"bc-at-lt cr-at-it":!!s,"bc-ht-lt":!s}),onClick:()=>r({columnIndex:i}),children:[e(ie,{className:"tt-se",children:"sort"})," ",e(0===s?Me:s>0?Ve:Ce,{})]}):e("div",{})]}),aa=i=>{const{headers:r,isOpen:n,onClose:o,onFilter:l,onResetFilters:d}=i,[c,h]=Q({}),[p,m]=Q({}),[u,g]=Q(!1),f=e=>Object.values(e).map(e=>Array.isArray(e)?e.map(e=>e?.value||e):e);G(()=>{if(!n)return;const{filtered:e,values:t}=Ot(r);h(f(t)),m(t),g(e)},[r,n]);const y=le(e=>e.i18n.t);return e(de,{isOpen:n,onClose:o,closeWhenKeyEscape:!0,closeWhenClickOutside:!0,children:t("div",{className:"jk-drawer-filters jk-col nowrap extend stretch",children:[t("div",{className:"jk-row left gap title cr-tx-ht jk-pg-sm",children:[e("div",{className:ve({active:!0},"jk-row"),children:e(We,{})}),e(ie,{children:"order and filters"})]}),e("div",{className:"jk-col top nowrap stretch space-between filter-drawer-columns flex-1",children:r.map((i,r)=>{const{index:n,filter:o,sort:{onSort:l,getOrder:d=()=>0}={}}=i;let c=null;if(bt(o))c=e(se,{onChange:e=>m(t=>({...t,[n]:e})),value:p[n]||"",expand:!0,placeholder:Ne(y("search..."))});else if(kt(o))c=e(re,{options:o.options,selectedOptions:p[n]||[],onSelectOptions:e=>m(t=>({...t,[n]:e}))});else if(xt(o))c=e(te,{type:o.pickerType,date:(p[n]?s(p[n]):void 0)?p[n]:null,onDatePick:e=>m(t=>({...t,[n]:e})),onDateClean:()=>m(e=>({...e,[n]:""})),isDisabled:o.isDisabled,isSelected:jt(p[n]),baseDate:o.baseDate,twoLines:"year-month-day-hours-minutes-seconds-milliseconds"===o.pickerType||"year-month-day-hours-minutes-seconds"===o.pickerType||"year-month-day-hours-minutes"===o.pickerType||"year-month-day-hours"===o.pickerType});else if(Nt(o)){const[i,r]=Array.isArray(p?.[n])?p?.[n]:[null,null];c=t(a,{children:[t("div",{children:[t("div",{className:"jk-row left fw-bd",children:[e(ie,{className:"tt-se",children:"from"})," :"]}),e(te,{type:o.pickerType,date:i,onDatePick:e=>{r&&s(r)?m(t=>({...t,[n]:[e,r]})):m(t=>({...t,[n]:[e,e]}))},onDateClean:()=>m(e=>({...e,[n]:""})),isDisabled:Ct(o.isDisabled,Ft(r)),isSelected:Ct(jt(i),St(i,r)),baseDate:o.baseStartDate,twoLines:"year-month-day-hours-minutes-seconds-milliseconds"===o.pickerType||"year-month-day-hours-minutes-seconds"===o.pickerType||"year-month-day-hours-minutes"===o.pickerType||"year-month-day-hours"===o.pickerType})]}),t("div",{children:[t("div",{className:"jk-row left fw-bd",children:[e(ie,{className:"tt-se",children:"to"})," :"]}),e(te,{type:o.pickerType,date:r,onDatePick:e=>{i&&s(i)?m(t=>({...t,[n]:[i,e]})):m(t=>({...t,[n]:[e,e]}))},onDateClean:()=>m(e=>({...e,[n]:""})),isDisabled:Ct(o.isDisabled,Dt(i)),isSelected:Ct(jt(r),St(i,r)),baseDate:o.baseEndDate,twoLines:"year-month-day-hours-minutes-seconds-milliseconds"===o.pickerType||"year-month-day-hours-minutes-seconds"===o.pickerType||"year-month-day-hours-minutes"===o.pickerType||"year-month-day-hours"===o.pickerType})]})]})}return t("div",{className:"jk-col gap stretch jk-pg-sm-trl jk-pg-b",style:r?{borderTop:"1px solid var(--cr-ht)"}:{},children:[e(ta,{header:i,columnIndex:n,onSort:l,order:d()}),c]},n)})}),t("div",{className:"jk-row-col space-between gap block jk-pg-sm filter-drawer-buttons",children:[e(ae,{type:"secondary",size:"small",onClick:()=>{d(),o()},disabled:!u,children:e(ie,{className:"tt-se",children:"reset all filters"})}),e(ae,{size:"small",onClick:()=>{l(p),o()},disabled:JSON.stringify(f(p))===JSON.stringify(c),children:e(ie,{className:"tt-se",children:"apply filters"})})]})]})})},ia=e=>ve({"bc-at-lt cr-at-it":e,"bc-sf-md":!e,active:e},"jk-row jk-data-viewer-tools-filter jk-br-ie cr-pr jk-row nowrap"),ra=({Icon:a,active:i,onClick:r,tooltipContent:s,className:n="",children:o,rotate:l,disabled:d=!1})=>t("div",{"data-tooltip-id":"jk-tooltip","data-tooltip-content":s,className:ve(ia(!!i),n,{disabled:d}),onClick:r,children:[e(a,{className:"jk-br-ie",size:"small",rotate:l}),o]}),sa=$(i=>{const{extraNodes:r,setViewMode:s,headers:n,toolbarRef:o,viewMode:l,dataLength:d,rowsView:c,cardsView:h,loading:p,initializing:m,onReload:u,onAllFilters:g,pagination:f,extraNodesFloating:y,showFilterDrawerKey:w,filterKey:v,filters:b,downloads:k,requestProps:x}=i,{filtered:N,values:R}=Ot(n),[j,S]=Q(!1),D=ce(e=>e.viewPort.isSmallScreen),{notifyResponse:z}=he(),I=pe(e=>e.searchParams.get(w)),T=J(void 0),[P,L]=me(w,"open"===I?"open":"close"),E=q(e=>{L(e?"open":"close")},[L]),V=!(D&&(!c||!h)),M=!!n.filter(e=>e.filter||e.sort).length;G(()=>{p?T.current?.(C.LOADING):T.current?.(C.NONE)},[p]);const W="open"===P,[H,A]=Q(W);W&&!H&&A(!0);new URL(be()&&window.location?.href||"").searchParams.set(v,JSON.stringify(b));const K=n.filter(e=>e.visible?.getVisible()).length;return t("div",{className:ve("jk-data-viewer-toolbar with-vertical-scroll pn-re jk-row space-between nowrap jk-br-ie jk-pg-xsm-rl",l.toLowerCase()),ref:o,children:[H&&e(aa,{isOpen:W,headers:n,onClose:()=>E(!1),onFilter:e=>g(e),onResetFilters:()=>g({})}),!D&&e("div",{className:"jk-table-view-extra-nodes jk-row left gap",children:r.map(Re)}),t("div",{className:"jk-table-view-tools jk-br-ie jk-pg-xsm-tb jk-row-col gap stretch",children:[t("div",{className:"jk-row nowrap gap",children:[u&&e(ra,{Icon:p?Fe:Oe,tooltipContent:p?"reloading data":"reload data",active:p,onClick:u,className:"jk-input-select"},"reload-button-icon"),f.withPagination&&e(ue,{dataLength:d,loading:p,initializing:m,pageSizeOptions:D?[20]:f.pageSizeOptions,total:f.total,page:f.page,pageSize:f.pageSize,jumpToPage:f.jumpToPage,onPageSizeChange:f.onPageSizeChange,isOnToolbar:!0},"first-row-pagination")]}),t("div",{className:"jk-row nowrap gap",children:[M&&e(ra,{Icon:We,tooltipContent:"open filters",onClick:()=>E(!0),active:N,className:"jk-input-select",children:!!Object.values(R).length&&t(a,{children:[" ",e("span",{className:"bc-ht-lt jk-br-ie",style:{lineHeight:1,padding:"0 4px"},children:Object.values(R).length})," "]})}),!!k.length&&e(ge,{options:k,onChange:async({value:e})=>{S(!0);const t=k.find(t=>e===t.value),a=t?.getUrl(x)??"",i=t?.getFilename(x)??"",r=F(await je(a));r.success&&(await ke(r.content.urlExportedFile,i),z(r)),S(!1)},selectedOption:{value:""},style:{width:"auto"},children:e(ra,{Icon:j?Fe:ze,tooltipContent:j?"downloading":"download",className:"jk-input-select",onClick:j?e=>e.stopPropagation():void 0})}),e(fe,{options:n.map(e=>({label:Rt({header:e,columnIndex:e.index}),value:e.index})),selectedOptions:n.filter(({visible:e})=>e?.getVisible?.()).map(({index:e})=>({value:e})),containerWidth:"child",onChange:(e,t)=>{const a=n.find(e=>e.index===t?.value);a?.visible.onToggle()},className:"bc-sf-md",children:e(ra,{Icon:He,tooltipContent:"visibility of columns",className:"jk-input-select",active:K!==n.length,children:t(a,{children:[" ",t("span",{className:"bc-ht-lt jk-br-ie ws-np",style:{lineHeight:1,padding:"0 4px"},children:[K," / ",n.length]})," "]})})}),V&&(c||h)&&t(a,{children:[e("div",{className:"jk-divider horizontal"}),t("div",{className:ve("jk-row nowrap jk-table-view-tools-view-mode",{rowsView:c,cardsView:h}),children:[c&&e(ra,{Icon:Ae,tooltipContent:"list view",className:"rows",active:l===O.ROWS,onClick:()=>s(O.ROWS,!0),rotate:90}),h&&e(ra,{Icon:Ie,tooltipContent:"cards view","data-tooltip-place":"top-end",className:"cards",active:l===O.CARDS,onClick:()=>s(O.CARDS,!0)})]})]}),!!r.length&&D&&!y&&t(a,{children:[e("div",{className:"jk-divider horizontal"}),e("div",{children:e(ne,{popoverClassName:"bc-sf-hi jk-br-ie elevation-1",content:e("div",{className:"jk-pg-sm jk-col stretch gap",children:r.map(Re)}),triggerOn:De.CLICK,placement:"bottom",children:e("div",{className:"jk-row",children:e(Ke,{})})})})]})]})]})]})}),na=a=>{const{viewPortSize:i,cards:{height:r=300,width:s=256,expanded:n=!1}={height:300,width:256,expanded:!1},cardsView:o,data:l,extraNodes:d,headers:c,loading:h,initializing:p,onAllFilters:m,onReload:u,rows:{height:g=56}={height:56},rowsView:f,viewMode:y,setViewMode:w,getRecordKey:v,pagination:b,getRecordStyle:k,getRecordClassName:x,onRecordClick:N,onRecordHover:R,extraNodesFloating:j=!1,showFilterDrawerKey:S,filterKey:D,filters:C,groups:F,downloads:z,requestProps:I,virtualizerOverscan:T,focusRowKey:P}=a,{width:L,ref:E}=ye(),V=J(null),{height:M=0}=ye({targetRef:V}),W="sm"===i;return t("div",{className:"jk-data-viewer-content jk-br-ie",style:{"--jk-table-toolbar-height":M+"px",position:"relative"},children:[e(sa,{setViewMode:w,extraNodes:d,headers:c,toolbarRef:V,dataLength:l.length,viewMode:y,rowsView:f,cardsView:o,loading:h,initializing:p,onReload:u,onAllFilters:m,pagination:b,extraNodesFloating:j,showFilterDrawerKey:S,filterKey:D,filters:C,downloads:z,requestProps:I}),j&&W&&e("div",{className:"jk-col gap nowrap",style:{position:"absolute",bottom:"var(--pad-t)",right:"var(--pad-t)",zIndex:1},children:_.toArray(d.map((e,t)=>Re(e,t)))}),t("div",{className:ve("jk-view-container",y.toLowerCase()),ref:E,children:[l.length>0&&h&&e(Te,{}),t("div",{className:ve("jk-data-viewer-body",y.toLowerCase()),style:{width:L||0},children:[0===l.length&&h&&e("div",{className:"jk-row center expand-absolute pe-ne",style:{height:"100%"},children:t("div",{className:"jk-row",style:{alignItems:"baseline"},children:[e(ie,{className:"tt-se",children:"loading data"})," ",e("div",{className:"dot-flashing"})]})}),y===O.ROWS?e(ea,{headers:c,viewContainerWidth:L||0,rowHeight:g,data:l,loading:h,getRecordKey:v,getRecordStyle:k,getRecordClassName:x,onRecordClick:N,onRecordHover:R,groups:F,virtualizerOverscan:T,focusRowKey:P}):e(Je,{headers:c,data:l,cardHeight:r,cardWidth:s,rowWidth:(L||0)-X,getRecordClassName:x,getRecordStyle:k,onRecordClick:N,onRecordHover:R,expandedCards:n})]})]})]})},oa=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function la(t){const{cards:a,cardsView:u=!0,className:g="",data:f,extraNodes:y,headers:w,initialViewMode:v,name:b="",requestRef:k,rows:x,rowsView:N=!0,totalData:R,pageSizeOptions:j,getRecordKey:S,getPageQueryParam:D=zt,getPageSizeQueryParam:F=It,getSortQueryParam:$=Tt,getFilterQueryParam:U=Pt,getViewModeQueryParam:_=Lt,getShowFilterDrawerQueryParam:X=Et,getVisiblesQueryParam:ee=Vt,getRecordStyle:te,getRecordClassName:ae,onRecordClick:ie,onRecordHover:re,extraNodesFloating:se,setLoaderStatusRef:ne,setDataTableRef:de,initializing:he=!1,downloads:ue,groups:ge,deps:fe=[],virtualizerOverscan:ye=4,focusRowKey:be}=t,ke=ce(e=>e.viewPort.screen),xe=we(e=>e.user.settings[z.DATA_VIEW_MODE]),Ne=le(e=>e.i18n.t),Re=D(b),je=F(b),De=$(b),Ce=U(b),Fe=_(b),Oe=X(b),ze=ee(b),Ie=pe(e=>e.searchParams.get(De)),Te=pe(e=>e.searchParams.get(ze)),Pe=pe(e=>e.searchParams.get(Ce)),Le=pe(e=>e.searchParams.get(Re)),Ee=pe(e=>e.searchParams.get(je)),Ve=pe(e=>e.searchParams.get(Fe)),Me=!!j,[We,He]=Q(C.LOADING),Ae=We===C.LOADING||he,Ke=Ie,[Be,$e,Je]=me(De,Ke),Qe=oe(Be),[Ye,qe]=me(ze,Te,r(w.map(({index:e})=>e))),Ge=Pe||"",[Ue,_e,bt]=me(Ce,I(Ge)?Ge:null),kt=Y(()=>{const e=I(Ue)?JSON.parse(Ue):{},t={};for(const a of w)t[a.index]=e[a.index];return t},[Ue,w]),xt=oe(kt),Nt=JSON.stringify(j??[25,50,100]),Rt=Y(()=>JSON.parse(Nt),[Nt]),[jt,St]=me(Re,Le),Dt=+jt||1,[Ct,Ft]=me(je,Ee),Ot=+Ct||Rt[0],Mt=Y(()=>{const e={},t=w.find(({index:e})=>e===Be||"-"+e===Be);return t?.sort&&(e[t.index]=t.index===Be?1:-1),JSON.stringify({sort:e,filter:kt,pagination:Me?{page:Dt,pageSize:Ot}:{page:0,pageSize:0}})},[kt,w,Dt,Ot,Be,Me]),$t=Y(()=>JSON.parse(Mt),[Mt]),Jt=JSON.stringify(fe),Qt=oe(k),Yt=q(()=>Qt.current?.($t),[Qt,$t]);G(()=>{Yt()},[Yt,Jt]);const qt=Y(()=>((e,t,a,r)=>{let u=[...e];for(const e of t){const t=e.index;if(a[t]){const r=e.index;if(dt(e?.filter))u=u.filter(e.filter.callbackFn({columnIndex:e.index,text:a[t]}));else if(ct(e?.filter)){const i=new RegExp(oa(a[t]),"i");u=u.filter(t=>{if(ct(e?.filter)){const a=e.filter.getValue?e.filter.getValue({record:t}):r in t?t[r]:null;return"string"==typeof a&&i.test(a)}return!1})}else if(pt(e?.filter)){const r=i(a[t]).map(t=>{if(pt(e?.filter))return e.filter.options.find(({value:e})=>e===t)}).filter(Boolean);u=u.filter(e.filter.callbackFn({columnIndex:e.index,selectedOptions:r}))}else if(mt(e?.filter)){const s=i(a[t]).map(t=>{if(mt(e?.filter))return e.filter.options.find(({value:e})=>e===t)}).filter(Boolean);u=u.filter(t=>{if(mt(e?.filter)){const a=e.filter.getValue?e.filter.getValue({record:t}):r in t?t[r]:null;return!!s.find(e=>e.value===a)}return!1})}else if(gt(e?.filter))u=u.filter(e.filter.callbackFn({columnIndex:e.index,selectedDate:new Date(+a[t])}));else if(ft(e?.filter)){const{showYears:i,showMonths:m,showDays:g,showHours:f,showMinutes:y,showSeconds:w,showMilliseconds:v}=Se(e.filter.pickerType||Ht);if(a[t]&&(new Date(+a[t])?s(new Date(+a[t])):void 0)){const b=new Date(+a[t]);u=u.filter(t=>{if(ft(e?.filter)){const a=e.filter.getValue?e.filter.getValue({record:t}):r in t?t[r]:null;if(a instanceof Date&&s(a)){if(v)return n(b,a);if(w)return o(b,a);if(y)return l(b,a);if(f)return d(b,a);if(g)return c(b,a);if(m)return h(b,a);if(i)return p(b,a)}else T("datum no filtered",{datum:t,searchDate:b,index:e.index,head:e})}return!0})}else T("data no filtered, filter not a valid time date",{search:a[t],searchFilter:a})}else if(wt(e?.filter)){const[r,n]=i(a[t]);r&&s(new Date(+r))&&n&&s(new Date(+n))?u=u.filter(e.filter.callbackFn({columnIndex:e.index,startSelectedDate:new Date(+r),endSelectedDate:new Date(+n)})):T("data no filtered, filter not a valid range times date",{search:a[t],searchFilter:a})}else if(vt(e?.filter)){const[n,o]=i(a[t]);if(n&&s(new Date(+n))&&o&&s(new Date(+o))){const t=new Date(+n),a=new Date(+o),{showMonths:i,showDays:l,showHours:d,showMinutes:c,showSeconds:h,showMilliseconds:p}=Se(e.filter.pickerType||Ht);u=u.filter(n=>{if(vt(e?.filter)){const o=e.filter.getValue?e.filter.getValue({record:n}):r in n?n[r]:null;if(o instanceof Date&&s(o)){let e=t.getFullYear()<=o.getFullYear()&&o.getFullYear()<=a.getFullYear();return i&&(e=e&&m(o,{start:L(t),end:P(a)})),l&&(e=e&&m(o,{start:V(t),end:E(a)})),d&&(e=e&&m(o,{start:W(t),end:M(a)})),c&&(e=e&&m(o,{start:A(t),end:H(a)})),h&&(e=e&&m(o,{start:B(t),end:K(a)})),p&&(e=m(o,{start:t,end:a})),e}T("datum no filtered",{datum:n,startSelectedDate:t,endSelectedDate:a,index:e.index,head:e})}return!0})}else T("data no filtered, filter not a valid range times date",{search:a[t],searchFilter:a})}}}const g=u.length!==e.length;let f=!1;for(const e of i(r)){const a=t.find(({index:t})=>t===e||"-"+t===e);a?.sort&&nt(a?.sort)&&(a.index===e?(u.sort(a.sort.compareFn({columnIndex:a.index})),f=!0):"-"+a.index===e&&(u.sort((e,t)=>nt(a?.sort)?-1*a.sort.compareFn({columnIndex:a.index})(e,t):0),f=!0))}return g||f?u:e})(f,w,kt,Be),[f,w,kt,Be]),Gt=oe(de);G(()=>{Gt.current?.(qt)},[qt,Gt]);const Ut=oe(ne);G(()=>{Ut.current?.(e=>{He("function"==typeof e?t=>e(t):e)})},[Ut]);const _t=Y(()=>((e,t,a,n,o,l,d,c,h,p)=>(e=>{let t=0;const a=[...e];return e.forEach((e,i)=>{e.visible?.getVisible()&&(a[i]={...e,accumulatedWidth:t},t+=e.width)}),a})(e.map(({sort:e,filter:m,...u},g)=>{const f=()=>i(t).includes(u.index),y={...u,minWidth:u.minWidth??0,width:0,accumulatedWidth:0,headIndex:g,visible:{getVisible:f,onToggle(){const e=f();l(r(e?i(t).filter(e=>e!==u.index):[...i(t),u.index]))}}},w=u.index;let v=m?28:0;if(e){v+=28;const t=u.index,a="-"+u.index,r=()=>i(o.current).includes(t)?1:i(o.current).includes(a)?-1:0;y.sort={getOrder:r,onSort:()=>{const e=1===r()?a:-1===r()?"":t;e?d(e):c()},online:ot(e)}}m?.type===Xe||m?.type===Ze?y.filter={type:Xe,onFilter:({text:e})=>Bt(w,e,n,h,p),onReset:Kt(w,n,h,p),getFilter:()=>n.current[w]||"",online:lt(m)}:m?.type===et||m?.type===tt?y.filter={type:et,onFilter:({selectedOptions:e})=>{Bt(w,r(e.filter(({value:e})=>!!m.options.find(t=>t.value===e)).map(({value:e})=>e)),n,h,p)},onReset:Kt(w,n,h,p),options:m.options,getFilter:()=>n.current[w]?i(n.current[w]).map(e=>({value:e,label:""})):[],online:ht(m)}:m?.type===at||m?.type===it?y.filter={type:at,pickerType:m.pickerType||Ht,onFilter:({selectedDate:e})=>Bt(w,e.getTime()+"",n,h,p),isDisabled:m.isDisabled||(()=>({})),onReset:Kt(w,n,h,p),getFilter:()=>n.current[w]&&s(new Date(+n.current[w]))?new Date(+n.current[w]):null,baseDate:m.baseDate||new Date,online:ut(m)}:m?.type!==rt&&m?.type!==st||(y.filter={type:rt,pickerType:m.pickerType||Ht,onFilter:({startSelectedDate:e,endSelectedDate:t})=>Bt(w,r([e.getTime()+"",t.getTime()+""]),n,h,p),onReset:Kt(w,n,h,p),isDisabled:m.isDisabled||(()=>({})),getFilter:()=>{const[e,t]=n.current[w]?i(n.current[w]):[];return[e&&s(new Date(+e))?new Date(+e):null,t&&s(new Date(+t))?new Date(+t):null]},baseStartDate:m.baseStartDate||new Date,baseEndDate:m.baseEndDate||new Date,online:yt(m)});const b=u.head||u.index;if("string"==typeof b){const e=Math.ceil(Wt(a(b.toUpperCase()),"400 14px / 14px Inter, sans-serif"))+4;y.minWidth=Math.max(u.minWidth||0,v+e+16+4)}return y})))(w,Ye,Ne,xt,Qe,qe,$e,Je,_e,bt),[bt,Je,w,_e,$e,Ne,xt,Qe,qe,Ye,Be,Ue]),Xt=q(e=>{const t={...kt};w.forEach(({filter:a,index:i})=>{const n=e[i];if(a?.type===Xe||a?.type===Ze)t[i]=n;else if(a?.type===et||a?.type===tt)t[i]=r((e[i]||[]).filter(({value:e})=>!!a.options.find(t=>t.value===e)).map(({value:e})=>e));else if(a?.type===at||a?.type===it)e[i]instanceof Date?t[i]=e[i].getTime()+"":t[i]="";else if(a?.type===rt||a?.type===st){const[a,n]=e[i]?e[i]:[null,null];s(a)&&s(n)?t[i]=r([a.getTime()+"",n.getTime()+""]):t[i]=""}}),At(t)?_e(JSON.stringify(t)):bt()},[bt,w,kt,_e]),Zt=v||(xe===O.CARDS?O.CARDS:O.ROWS),[ea,ta]=me(Fe,Ve?Ve.toUpperCase()===O.CARDS?O.CARDS:O.ROWS:Zt);G(()=>{!u&&N?ta(O.ROWS):!N&&u&&ta(O.CARDS)},[u,N,ta]);const aa=J("");G(()=>{aa.current!==ke&&u&&"sm"===ke&&ta(O.CARDS),aa.current=ke},[ke,u,N,ta]);const ia=R??f.length,ra=Y(()=>({withPagination:Me,total:ia,pageSizeOptions:Rt,page:Dt,pageSize:Ot,jumpToPage:St,onPageSizeChange:Ft}),[Me,ia,Rt,Dt,Ot,St,Ft]),sa=Y(()=>(y||[]).filter(Boolean),[y]);return e("div",{className:ve(g,"jk-data-viewer-layout ht-100",{"with-pagination":Me}),children:e(na,{viewPortSize:ke,cards:a,data:qt,extraNodes:sa,extraNodesFloating:se,headers:_t,groups:ge||Z,loading:We===C.LOADING,initializing:Ae,onAllFilters:Xt,onReload:Qt.current?Yt:null,rows:x,showFilterDrawerKey:Oe,rowsView:N,cardsView:u,setViewMode:ta,viewMode:ea,getRecordKey:S,getRecordStyle:te,getRecordClassName:ae,onRecordClick:ie,onRecordHover:re,pagination:ra,filterKey:Ce,filters:kt,downloads:ue??Z,requestProps:$t,virtualizerOverscan:ye,focusRowKey:be})})}export{la as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import"./settings-6x4qNkNZ.js";import"react";import"./enums.js";import"./constants.js";import{r as t}from"./LoaderLayer-Csc8unUJ.js";const o=({color:t})=>r("path",{d:"M19 19v-4q0-1.25-.875-2.125T16 12H6.8l3.6 3.6L9 17l-6-6 6-6 1.4 1.4L6.8 10H16q2.075 0 3.538 1.462Q21 12.925 21 15v4Z",fill:t}),s=r=>t(r,o,"reply");export{s as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as s}from"react/jsx-runtime";import{W as n,h as l,y as a,aL as i,I as o,aM as c,S as r,w as d,i as h,j as p,k as m,Q as u,v as g,l as k,F as b,G as v,R as w,C,m as N}from"./settings-6x4qNkNZ.js";import{useState as y,useEffect as j,useRef as f,Children as S,Fragment as x}from"react";import{L as O,Q as I,B as P,g as L,T as A,_ as z,q as R,M as T,$ as _,w as E,Y as K,a0 as D,a1 as M,S as V,p as B,a2 as J,a as Q,a3 as U,a4 as G,f as F,t as Z,r as q,a5 as H,a6 as $,a7 as W,a8 as X,a9 as Y,aa as ee,D as te}from"./index-38k9tHSo.js";import{c as se}from"./commons-BLDufAOm.js";import{QueryParamKey as ne}from"./enums.js";import{EMPTY_JK_MD_SHEET as le,EMPTY_CODE_EDITOR_SHEET as ae,EMPTY_GRAPH_SHEET as ie,EMPTY_LIST_SHEET as oe,EMPTY_QUIZ_PROBLEM_SHEET as ce,EMPTY_QUIZ_OPTIONS_SHEET as re,WORKSHEET_CODE_EDITOR_MIN_HEIGHT as de,DEFAULT_GRAPH as he}from"./constants.js";import{P as pe,D as me,e as ue,h as ge,C as ke,i as be,b as ve,j as we,S as Ce,k as Ne,A as ye,l as je}from"./LoaderLayer-Csc8unUJ.js";import"motion/react";import"react-dom";import"swr";import{S as fe,A as Se}from"./SettingsIcon-Cd0qgB0A.js";import{A as xe,S as Oe}from"./index-D954khxt.js";import{j as Ie}from"./index-3QSNRp1k.js";import{a as Pe}from"./websocket-D79arGLt.js";import{g as Le}from"./worksheet-CQgex79V.js";import{A as Ae}from"./ArrowForwardIcon-Bd0B_Kwe.js";const ze=s=>{const{index:a,setSheet:i,mdSheet:o,codeEditorSheet:c,graphSheet:r,listSheet:d,quizProblemSheet:h,pageDivider:p,compacted:m,quizOptionsSheetType:u,floatToolbarPlacement:g}=s,k=[];if(o){const e=()=>{i(e=>{const t=[...e];return t.splice(a+1,0,le()),t})};k.push({...O("tiny")[n.JK_MD],onClick:e})}if(c){const e=()=>{i(e=>{const t=[...e];return t.splice(a+1,0,ae()),t})};k.push({...O("tiny")[n.CODE_EDITOR],onClick:e})}if(r){const e=()=>{i(e=>{const t=[...e];return t.splice(a+1,0,ie()),t})};k.push({...O("tiny")[n.GRAPH],onClick:e})}if(d){const e=()=>{i(e=>{const t=[...e];return t.splice(a+1,0,oe()),t})};k.push({...O("tiny")[n.LIST],onClick:e})}if(h){const e=()=>{i(e=>{const t=[...e];return t.splice(a+1,0,ce()),t})};k.push({...O("tiny")[n.QUIZ_PROBLEM],onClick:e})}if(u){const e=()=>{i(e=>{const t=[...e];return t.splice(a+1,0,re()),t})};k.push({...O("tiny")[n.QUIZ_OPTIONS],onClick:e})}if(p){const e=()=>{i(e=>{const t=[...e];return t.splice(a+1,0,l()),t})};k.push({...O("tiny")[n.NEW_PAGE],onClick:e})}return e("div",{className:"jk-row gap",children:[m&&t(I,{content:t("div",{className:"jk-col gap",children:k.map(({icon:e,onClick:s,label:n},l)=>t(L,{icon:e,size:"tiny",expand:!0,onClick:s,children:t(A,{children:n})},l))}),offset:8,placement:g,children:t(P,{icon:t(pe,{}),size:"small"})}),!m&&k.map(({icon:e,label:s,onClick:n},l)=>t(P,{size:"small",icon:e,onClick:n,children:s},l))]})},Re=({content:e})=>!!e.title&&t(z,{source:e.title}),Te=s=>{const{isOpen:n,onClose:l,content:i,setContent:o,isValid:c}=s,[r,d]=R(n&&a(i)?JSON.stringify(i,null,2):"");return t(T,{isOpen:n,onClose:l,children:e("div",{className:"jk-col gap jk-pg stretch",children:[t(_,{className:"wh-100",size:"auto",value:r,onChange:d}),e("div",{className:"jk-row-col gap right",children:[t(P,{onClick:l,type:"secondary",children:t(A,{className:"tt-se",children:"close"})}),t(P,{disabled:!c(r),onClick:()=>{if(c(r)){const e=JSON.parse(r);o(e),l()}},children:t(A,{className:"tt-se",children:"save"})})]})]})})},_e=({index:e,length:s,onChange:n})=>{const l=[];return 0!==e&&l.push({icon:t(xe,{}),size:"tiny",label:t(A,{className:"tt-se",children:"move up"}),onClick:()=>{n(t=>{const s=[...t],n=s[e-1];return s[e]&&n&&([s[e],s[e-1]]=[n,s[e]]),s})},disabled:0===e}),l.push({icon:t(me,{}),size:"tiny",label:t(A,{className:"tt-se",children:"remove"}),onClick:()=>{n(t=>t.filter((t,s)=>s!==e))}}),e!==s-1&&l.push({icon:t(ue,{}),size:"tiny",label:t(A,{className:"tt-se",children:"move down"}),onClick:()=>{n(t=>{const s=[...t],n=s[e+1];return s[e]&&n&&([s[e],s[e+1]]=[n,s[e]]),s})},disabled:e===s-1}),l},Ee=s=>{const{type:n,edit:l,index:a,sheetLength:i,setSheet:o,setModal:c,onSaveEdit:r,onCancel:d}=s;return[{children:e("div",{className:"bc-at-lt cr-at-it jk-pg-xsm jk-row gap nowrap jk-br-ie tx-t ws-np",style:{opacity:.6},children:[O("tiny")[n].icon,O("tiny")[n].label]})},...r&&d?l?[{icon:t(be,{size:"small"}),children:e("div",{className:" jk-col gap stretch",children:[t(P,{size:"small",icon:t(ge,{}),onClick:r,children:t(A,{className:"tt-se",children:"save"})}),t(P,{size:"small",type:"secondary",icon:t(ke,{}),onClick:d,children:t(A,{className:"tt-se",children:"cancel"})})]}),placement:"left-start"}]:[{icon:t(ve,{size:"small"}),children:void 0,onClick:r,"data-tooltip-id":"jk-tooltip","data-tooltip-content":"edit","data-tooltip-place":"left",placement:"left-start"}]:[],{icon:t(Oe,{className:"cr-we",up:!0,down:!0}),size:"tiny",buttons:_e({index:a,length:i,onChange:e=>o?.(t=>e(t))}),placement:"left-start"},{icon:t(fe,{}),onClick:()=>c(!0),size:"tiny","data-tooltip-id":"jk-tooltip","data-tooltip-content":"view settings","data-tooltip-place":"left"}]},Ke=({content:s,setContent:n,isSolvable:l})=>e("div",{className:"jk-col gap stretch left jk-pg-sm br-ht jk-br-ie wh-100",children:[t(E,{label:t(A,{className:"tt-se",children:"title"}),labelPlacement:"top",value:s.title,onChange:e=>n(t=>({...t,title:e})),expand:!0}),l&&t(E,{type:"number",label:t(A,{className:"tt-se",children:"points"}),labelPlacement:"top",value:s.points,onChange:e=>n(t=>({...t,points:e})),expand:!0}),e("div",{className:"jk-row gap wh-100",children:[e("div",{className:"flex-1",children:[t(A,{className:"fw-bd tt-se",children:"languages"}),":",t(K,{options:i.map(e=>({value:e,label:o[e].label})),selectedOptions:s.languages?.map(e=>({value:e})),onChange:e=>n(t=>({...t,languages:e.map(e=>e.value)})),expand:!0})]}),e("div",{children:[e("div",{className:"jk-row gap space-between",children:[e("div",{children:[t(A,{className:"fw-bd tt-se",children:"height"}),":"]}),t(D,{checked:0===s.height,label:t(A,{children:"auto"}),onChange:e=>n(t=>({...t,height:e?0:de}))})]}),0!==s.height&&e("div",{className:"jk-row",children:[t(E,{type:"number",value:s.height,onChange:e=>n(t=>({...t,height:Math.abs(e)})),size:"auto"}),t(A,{children:"px"})]})]})]}),t("div",{style:{height:de},className:"jk-row wh-100",children:t(M,{storeKey:s.id+"_edit",initialFiles:s.files,onTestCasesChange:e=>n(t=>({...t,testCases:e})),onFilesChange:e=>n(t=>({...t,files:e})),initialTestCases:s.testCases,languages:s.languages.map(e=>({value:e,label:o[e]?.label||e})),enableAddSampleCases:!0})})]}),De=l=>{const{content:a,worksheetKey:i,chunkId:h,userResults:p,readOnly:m,isSolvable:u}=l,{notifyResponse:g}=V(),k=B(e=>e.searchParams),[b,v]=y(0),w=p?.data?.submissions[n.CODE_EDITOR]?.[h]??[];j(()=>{v(0)},[p?.data?.user.nickname]);const C=w.length,N=C-b-1,x=w[N]?.files??a.files,O=f(void 0),I=async(e,t)=>{O.current?.(r.LOADING),v(0);const s={type:n.CODE_EDITOR,id:a.id,files:e,testCases:t},l=k.get(ne.ASSIGNMENT),{url:o,...c}=Ie.API_V2.worksheet.submitCodeEditor({params:{worksheetKey:i,secondaryKey:l??""},body:s}),h=d(await Pe(o,c));await(p?.mutate?.()),g(h,O.current)};return t("div",{className:"jk-col stretch flex-1 gap",children:t("div",{style:{height:Le(a.height,""),minWidth:200,width:"100%"},className:"jk-row",children:t(M,{withoutRunCodeButton:m,readOnly:m,initialFiles:x,initialTestCases:w[N]?.testCases??a.testCases,languages:a.languages.map(e=>({value:e,label:o[e]?.label||e})),storeKey:a.id+"_view",enableAddCustomSampleCases:!0,onCodeRunStatusChange:(e,{files:t,testCases:s})=>{e===c.COMPLETED&&u&&I(t,s)},centerButtons:({runner:{testCases:n}={testCases:{}},getFiles:l})=>{const a=[];return!m&&u&&a.push(t(L,{size:"tiny",onClick:()=>I(l(),n),setLoaderStatusRef:e=>O.current=e,children:t(A,{className:"tt-se",children:"save"})},"save")),a.push(e("div",{className:"jk-row bc-ht-lt jk-br-ie",children:[t("div",{className:se("clickable br-50-pc jk-row",{"cr-ht":0===C}),onClick:C?()=>v(e=>(e+1)%C):void 0,children:t(we,{})}),p?.isLoading?t(Ce,{}):e(s,{children:[N+1," / ",C,t(A,{children:"v."})]}),t("div",{className:se("clickable br-50-pc jk-row",{"cr-ht":0===C}),onClick:C?()=>v(e=>(e-1+C)%C):void 0,children:t(Ne,{})})]},"buttons")),t("div",{className:"jk-row gap",children:S.toArray(a)})}})})})},Me=s=>{const{content:l,setContent:a,index:i,chunkId:o,sheetLength:c,setSheet:r,worksheetKey:d,isSolvable:m,userResults:u,readOnly:g}=s,[k,b]=y(!1),v=f(null);return e("div",{ref:v,className:"jk-row top left nowrap stretch jk-br-ie pn-re wh-100",children:[a&&t(Te,{isOpen:k,onClose:()=>b(!1),content:l,setContent:a,isValid:e=>h(e)&&p(JSON.parse(e))}),a?t(Ke,{content:l,setContent:a,isSolvable:m}):e("div",{className:"jk-col stretch gap nowrap code-editor-sheet-section-view wh-100",children:[t(Re,{content:l}),t(De,{content:l,worksheetKey:d,chunkId:o,userResults:u,readOnly:g,isSolvable:m})]}),r&&t(J,{actionButtons:Ee({type:n.CODE_EDITOR,edit:!0,setModal:b,index:i,sheetLength:c,setSheet:r}),placement:"right-end",outer:!0})]})},Ve=(e,t,s)=>{const n=Q(s);j(()=>{const s=s=>{t&&e.current&&!e.current.contains(s.target)&&n.current()};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[t])},Be=({content:s,setContent:n})=>{const[l,a]=y(0);return e("div",{className:"jk-col stretch left wh-100 jk-pg-sm br-ht jk-br-ie",children:[t(E,{label:t(A,{className:"tt-se",children:"title"}),labelPlacement:"top",value:s.title,onChange:e=>n(t=>({...t,title:e})),expand:!0}),s.dots?.[l]&&t(U,{value:s.dots[l],onSave:e=>{const t=[...s.dots];t.splice(l,1,e),n({...s,dots:t})}}),e("div",{className:"jk-row gap center",children:[t(P,{icon:t(ye,{}),disabled:0===l,onClick:()=>a((l-1+s.dots.length)%s.dots.length),size:"small"}),new Array(s.dots.length).fill(1).map((e,s)=>t("div",{className:se("jk-tag clickable",{"bc-sf-hi":s!==l}),onClick:()=>a(s),children:s+1},s)),t(P,{icon:t(Ae,{}),disabled:l>=s.dots.length-1,onClick:()=>a((l+1)%s.dots.length),size:"small"})]}),e("div",{className:"jk-row gap nowrap",children:[t(P,{icon:t(ye,{}),onClick:()=>{const e=[...s.dots];e.splice(l,0,he),n({...s,dots:e})},size:"small",children:t(Se,{})}),t(P,{icon:t(me,{}),onClick:()=>{const e=[...s.dots];e.splice(l,1),n({...s,dots:e})},size:"small",type:"secondary"}),t(P,{icon:t(Se,{}),onClick:()=>{const e=[...s.dots];e.splice(l+1,0,he),n({...s,dots:e}),a(l+1)},size:"small",children:t(Ae,{})})]})]})},Je=({content:s,setSheet:n})=>{const[l,a]=y(0);return j(()=>{s.dots.length||n?.(e=>({...e,dots:['digraaph graph_name {\n bgcolor="transparent"\n a -> b;\n b -> c;\n a -> d;\n d -> c;\n a -> c;\n}']}))},[l,n,s.dots.length]),e("div",{className:"jk-col gap",children:[t("div",{className:"br-hl jk-br-ie bc-sf-md",children:s.dots?.[l]&&t(G,{dot:s.dots[l]})}),e("div",{className:"jk-row gap center",children:[t(P,{icon:t(ye,{}),disabled:0===l,onClick:()=>a((l-1+s.dots.length)%s.dots.length),size:"small"}),new Array(s.dots.length).fill(1).map((e,s)=>t("div",{className:se("jk-tag clickable",{"bc-sf-hi":s!==l}),onClick:()=>a(s),children:s+1},s)),t(P,{icon:t(Ae,{}),disabled:l>=s.dots.length-1,onClick:()=>a((l+1)%s.dots.length),size:"small"})]})]})},Qe=s=>{const{content:l,setContent:a,index:i,sheetLength:o,setSheet:c}=s,[r,d]=y(!1),[p,m]=y(!1),[u,g]=R(l),k=f(null),b=()=>{d(!r),a?.(u)};Ve(k,r,b);const v=a?g:void 0;return e("div",{ref:k,className:"jk-row top left nowrap stretch jk-br-ie pn-re wh-100",onDoubleClick:()=>d(!0),children:[v&&t(Te,{isOpen:p,onClose:()=>m(!1),content:u,setContent:v,isValid:e=>h(e)}),v&&r?t(Be,{content:u,setContent:v}):e("div",{className:"jk-col stretch gap nowrap graph-sheet-section-view wh-100",children:[t(Re,{content:u}),t(Je,{content:u})]}),c&&t(J,{actionButtons:Ee({type:n.GRAPH,edit:r,setModal:m,index:i,sheetLength:o,setSheet:c,onSaveEdit:b,onCancel:()=>{d(!1),g(l)}}),placement:"right-end",outer:!0})]})},Ue=s=>{const{isResolved:n,submitted:l,points:a,userPoints:i,children:o,childrenTop:c}=s,r=F(e=>e.viewPort.isSmallScreen);return t("div",{style:r?void 0:{position:"absolute",top:0,right:"calc(var(--pad-sm) * -1)",height:"100%",width:0},children:e("div",{className:"jk-pg-sm jk-col gap stretch space-between result-header sticky-top",children:[c,!!a&&e("div",{className:se("jk-row center jk-tag tx-s ws-np",{"bc-ss cr-we":n,"bc-sf-hi":!l,"bc-wg cr-we":i>0&&!n&&l,"bc-er cr-we":0===i&&!n&&l}),children:[(+i||0).toFixed(2)," ",t(A,{children:1===i?"pt":"pts"}),t("div",{className:"jk-divider tiny",style:{height:1}}),a," ",t(A,{children:1===a?"pt":"pts"})]}),t("div",{className:"jk-row gap",children:o})]})})},Ge=s=>{const{points:n,submissions:l,children:a,selectedIndex:i,setSelectedIndex:o}=s,c=l.at(i);return t(Ue,{submitted:!!c,points:n,userPoints:c?.points??0,isResolved:!!c?.isCompleted,childrenTop:e("div",{className:"jk-row tx-s",children:[t("div",{className:"jk-row jk-br-ie hoverable",onClick:()=>{o(e=>(e-1+l.length)%l.length)},children:"←"}),e("div",{className:"jk-row",children:[i+1," (",t("div",{className:"jk-row jk-br-ie hoverable",onClick:()=>{o(l.length-1)},children:l.length}),")"]}),t("div",{className:"jk-row jk-br-ie hoverable",onClick:()=>{o(e=>(e+1)%l.length)},children:"→"})]}),children:a})},Fe=({content:s,setContent:n,isSolvable:l})=>e("div",{className:"jk-col left gap wh-100 jk-pg-sm tx-s",children:[t(E,{label:t(A,{className:"tt-se",children:"title"}),labelPlacement:"left",value:s.title,onChange:e=>n(t=>({...t,title:e})),expand:!0}),l&&t("div",{className:"jk-row extend left",children:t(E,{label:t(A,{className:"tt-se tx-s",children:"points"}),type:"number",value:s.points,onChange:e=>n(t=>({...t,points:e}))})}),t("div",{className:"flex-1 jk-md-math-editor-expanded wh-100",children:t(Z,{informationButton:!0,value:s.content,onChange:e=>n(t=>({...t,content:e})),enableTextPlain:!0,enableIA:!0,enableImageUpload:!0})})]}),Ze=s=>{const{content:l,setContent:a,index:i,chunkId:o,sheetLength:c,setSheet:p,worksheetKey:u,isSolvable:g,readOnly:k,userResults:b}=s,{notifyResponse:v}=V(),w=!0,[C,N]=y(!1),j=f(null),S=(b?.data?.submissions[n.JK_MD]?.[o]??[]).at(-1),x=l.content.trim();return e("div",{ref:j,className:"jk-row top left nowrap stretch jk-br-ie pn-re wh-100 jk-md-sheet-section",children:[a&&t(Te,{isOpen:C,onClose:()=>N(!1),content:l,setContent:a,isValid:e=>h(e)&&m(JSON.parse(e))}),a?t(Fe,{content:l,setContent:a,isSolvable:!!g}):e("div",{className:"jk-col gap stretch jk-md-sheet-section-view wh-100 pn-re",children:[g&&!p&&x&&t(Ue,{submitted:!!S,points:l.points,userPoints:S?.points??0,isResolved:!!S?.isCompleted,children:!k&&t(L,{type:"secondary",expand:!0,size:"small","data-tooltip-id":"jk-tooltip","data-tooltip-content":S?.read?"mark as unread":"mark as read",onClick:async e=>{e(r.LOADING);const t={type:n.JK_MD,id:l.id,read:!S?.read},{url:s,...a}=Ie.API_V2.worksheet.submitJkMd({params:{worksheetKey:u},body:t}),i=d(await Pe(s,a));await(b?.mutate?.()),v(i,e)},icon:t(D,{checked:!!S?.read,onChange:()=>null}),children:t(A,{className:"tt-se",children:S?.read?"_read":"unread"})})}),e("div",{className:"jk-pg-rl wh-100 bc-sf-md",children:[t(Re,{content:l}),!!x&&t(z,{source:x})]})]}),p&&t(J,{actionButtons:Ee({type:n.JK_MD,edit:w,setModal:N,index:i,sheetLength:c,setSheet:p}),placement:"right-end",outer:!0})]})},qe=({content:n,setContent:l,isSolvable:a})=>e("div",{className:"jk-col gap stretch left jk-pg-sm wh-100 br-ht jk-br-ie",children:[e("div",{className:"jk-row-col gap tx-s",children:[e("div",{className:"jk-col",children:[t(A,{className:"fw-bd tt-se",children:"options"}),t(q,{size:"small",checked:n.multiple,onChange:e=>l(t=>({...t,multiple:e,options:t.options.map(e=>({...e,correct:!1}))})),leftLabel:t(A,{className:se("tt-se",{"fw-bd":!n.multiple}),children:"single"}),rightLabel:t(A,{className:se("tt-se",{"fw-bd":n.multiple}),children:"multiple"})})]}),a&&e(s,{children:[t("div",{className:"jk-row left",style:{width:64},children:t(E,{label:t(A,{className:"tt-se",children:"points"}),labelPlacement:"top",type:"number",expand:!0,value:n.points,onChange:e=>l(t=>({...t,points:e}))})}),e("div",{className:"jk-col",children:[t(A,{className:"fw-bd tt-se",children:"scoring mode"}),t(q,{size:"small",checked:n.scoringMode===u.TOTAL,onChange:e=>l(t=>({...t,scoringMode:e?u.TOTAL:u.PARTIAL})),leftLabel:t(A,{className:se("tt-se",{"fw-bd":"PARTIAL"===n.scoringMode}),children:"partial"}),rightLabel:t(A,{className:se("tt-se",{"fw-bd":"TOTAL"===n.scoringMode}),children:"total"})})]})]})]}),t(E,{label:t(A,{className:"tt-se",children:"title"}),labelPlacement:"top",value:n.title,onChange:e=>l(t=>({...t,title:e})),expand:!0}),e("div",{className:"jk-col stretch",children:[t(A,{className:"tt-se fw-bd",children:"description"}),t(Z,{value:n.description,onChange:e=>l(t=>({...t,description:e})),enableTextPlain:!0,enableIA:!0,enableImageUpload:!0})]}),e("div",{className:"jk-col stretch left gap",children:[t(A,{className:"tt-se cr-tx-ht-lt",children:"select the correct options"}),n.options.map((s,a)=>e("div",{className:"jk-row gap nowrap extend",children:[n.multiple?t(D,{checked:s.correct,onChange:e=>{l(t=>{const s=[...t.options];return s[a]&&(s[a]={...s[a],correct:e}),{...t,options:s}})}}):t(H,{name:n.id,checked:s.correct,onChange:e=>{l(t=>{const s=[...t.options].map(e=>({...e,correct:!1}));return s[a]&&(s[a]={...s[a],correct:e}),{...t,options:s}})}}),t(Z,{className:"wh-100",value:s.label,onChange:e=>{l(t=>{const s=[...t.options];return s[a]&&(s[a]={...s[a],label:e}),{...t,options:s}})},enableTextPlain:!0,enableIA:!0,enableImageUpload:!0})]},`${a}`)),e(P,{type:"secondary",className:"jk-row gap",onClick:()=>l(e=>({...e,options:[...e.options,{label:"",correct:!1,id:g()}]})),children:[t(Se,{})," ",t(A,{className:"tt-se",children:"add option"})]})]})]}),He=s=>{const{content:n,checkedOptions:l,setCheckedOptions:a,readOnly:i}=s;return e("div",{className:"bc-sf-md jk-br-ie jk-pg jk-col stretch gap wh-100",children:[t(z,{source:n.description,className:"bc-ht-lt jk-pg-xsm jk-br-ie"}),t(A,{className:"tt-se fw-bd cr-tx-ht",children:n.multiple?"select one or more options":"select one option"}),t("div",{className:"jk-col stretch left gap",children:n.options.map(s=>e("div",{className:se("jk-row gap nowrap extend left jk-br-ie option jk-br-ie jk-pg-xsm-rl",{"bc-ht-lt":l.includes(s.id)}),onClick:i?void 0:()=>{n.multiple?l.includes(s.id)?a(l.filter(e=>e!==s.id)):a([...l,s.id]):a([s.id])},children:[n.multiple?t(D,{checked:l.includes(s.id),onChange:()=>null,className:se({"bc-ss-lt jk-br-ie":s.correct})}):t(H,{checked:l.includes(s.id),onChange:()=>null,className:se({"bc-ss-lt br-50-pc":s.correct})}),t("div",{children:t(z,{source:s.label})})]},s.id))})]})},$e=s=>{const{content:l,setContent:a,index:i,chunkId:o,sheetLength:c,setSheet:p,worksheetKey:m,isSolvable:u,userResults:g,readOnly:b}=s,{notifyResponse:v}=V(),[w,C]=y(!1),[N,j]=y(!1),[S,x]=R(l),O=a?x:void 0,I=f(null),P=()=>{C(!w),a?.(S)};Ve(I,w,P);const z=g?.data?.submissions[n.QUIZ_OPTIONS]?.[o]??[],[T,_]=R(z.length-1),E=z.at(T),[K,D]=R(E?.checkedOptions??[]);return e("div",{ref:I,className:"jk-row top left nowrap stretch jk-br-ie pn-re wh-100",onDoubleClick:()=>C(!0),children:[O&&t(Te,{isOpen:N,onClose:()=>j(!1),content:S,setContent:O,isValid:e=>h(e)&&k(JSON.parse(e))}),O&&w?t(qe,{content:S,setContent:O,isSolvable:u}):e("div",{className:"jk-col stretch gap quiz-options-sheet-section-view wh-100 pn-re",children:[u&&!p&&t(Ge,{submissions:z,points:S.points,selectedIndex:T,setSelectedIndex:_,children:!b&&t(L,{type:"secondary",size:"small",expand:!0,onClick:async e=>{e(r.LOADING);const t={type:n.QUIZ_OPTIONS,id:S.id,checkedOptions:K},{url:s,...l}=Ie.API_V2.worksheet.submitQuizOptions({params:{worksheetKey:m},body:t}),a=d(await Pe(s,l));await(g?.mutate?.()),v(a,e)},children:t(A,{className:"tt-se",children:"save"})})}),t(Re,{content:S}),t(He,{content:S,checkedOptions:K,setCheckedOptions:D,readOnly:b})]}),p&&t(J,{actionButtons:Ee({type:n.QUIZ_OPTIONS,edit:w,setModal:j,index:i,sheetLength:c,setSheet:p,onSaveEdit:P,onCancel:()=>{C(!1),x(l)}}),placement:"right-end",outer:!0})]})},We=({problemKey:s})=>t("div",{style:{},children:t($,{url:Ie.API_V2.problem.getSummary({params:{key:s}}).url,errorView:t(W,{children:t(A,{className:"tt-se",children:"problem not found"})}),children:({data:s})=>e("div",{className:"jk-col",children:[t("div",{className:"fw-bd",children:s.content.name}),t("div",{className:"jk-tag bc-io",children:s.content.judge.key}),e("div",{children:[t(A,{className:"tt-se fw-bd",children:"type"}),": ",b[s.content.settings.type].label]}),e("div",{children:[t(A,{className:"tt-se fw-bd",children:"scoring mode"}),": ",v[s.content.settings.scoringMode].label]})]})})}),Xe=({content:s,setContent:n,isSolvable:l})=>t("div",{className:"jk-col stretch left",children:e("div",{className:"jk-col gap stretch flex-1",style:{width:"100%"},children:[t(E,{label:t(A,{className:"tt-se",children:"title"}),labelPlacement:"top",value:s.title,onChange:e=>n(t=>({...t,title:e})),expand:!0}),l&&t(E,{type:"number",label:t(A,{className:"tt-se",children:"points"}),labelPlacement:"top",value:s.points,onChange:e=>n(t=>({...t,points:e})),expand:!0}),e("div",{className:"flex-1",children:[t(A,{className:"fw-bd tt-se",children:"languages"}),":",t(K,{options:w.map(e=>({value:e,label:o[e]?.label??e})),selectedOptions:s.languages?.map(e=>({value:e})),onChange:e=>n(t=>({...t,languages:e.map(e=>e.value)})),expand:!0})]}),t("div",{children:s.problemKey?t(We,{problemKey:s.problemKey}):t(A,{className:"tt-se",children:"please select a problem"})}),e("div",{className:"jk-row gap left",children:[e("div",{children:[t(A,{className:"fw-bd tt-se",children:"height"}),":"]}),t(D,{checked:0===s.height,label:t(A,{children:"auto"}),onChange:e=>n(t=>({...t,height:e?0:de}))}),t(E,{disabled:0===s.height,type:"number",value:s.height,onChange:e=>n(t=>({...t,height:Math.abs(e)})),size:"auto"}),t(A,{children:"px"})]}),t(X,{onSelect:e=>{n(t=>({...t,problemKey:e.key,problemJudge:e.judge.key}))}})]})}),Ye=({content:e,worksheetKey:s})=>{const{notifyResponse:l}=V(),a=!Number.isNaN(+e.height)&&+e.height>0;return t("div",{className:"jk-col nowrap gap wh-100",style:{maxHeight:a?`calc(${+e.height}px + var(--gap))`:"calc(var(--100VH) - 300px)",height:a?`calc(${+e.height}px + var(--gap))`:"calc(var(--100VH) * 0.6)"},children:t("div",{className:"jk-col nowrap stretch flex-1 gap wh-100",style:{height:"100%"},children:t($,{url:e.problemKey?Ie.API_V2.problem.getData({params:{key:e.problemKey}}).url:null,children:({data:a})=>t(Y,{problem:a.content,infoPlacement:"name",codeEditorStoreKey:`${s}/${e.id}`,codeEditorCenterButtons:({getCurrentFile:a})=>[t(ee,{children:t(L,{size:"small",onClick:async t=>{const{source:i="",language:o=C.TEXT}=a()||{};t(r.LOADING);const c={id:e.id,type:n.QUIZ_PROBLEM,language:o,source:i},{url:h,...p}=Ie.API_V2.worksheet.submitQuizProblem({params:{worksheetKey:s},body:c}),m=d(await Pe(h,p));l(m,t)},children:t(A,{className:"tt-se",children:"submit"})})},"submit")]})})})})},et=l=>{const{content:a,setContent:i,index:o,chunkId:c,sheetLength:r,setSheet:d,worksheetKey:p,isSolvable:m,userResults:u}=l,[g,k]=y(!1),[b,v]=y(!1),[w,C]=R(a),j=f(null),S=()=>{k(!g),i?.(w)};Ve(j,g,S);const x=i?C:void 0,O=(u?.data?.submissions[n.QUIZ_PROBLEM]?.[c]??[]).at(-1);return e("div",{className:"jk-row top left nowrap stretch jk-br-ie pn-re wh-100",onDoubleClick:()=>k(!0),children:[x&&t(Te,{isOpen:b,onClose:()=>v(!1),content:w,setContent:x,isValid:e=>h(e)&&N(JSON.parse(e))}),x&&g?t(Xe,{content:w,setContent:x,isSolvable:m}):e("div",{className:"jk-col gap stretch center quiz-problem-sheet-section-view wh-100 pn-re",children:[m&&!d&&t(Ue,{submitted:!!O,points:w.points,userPoints:O?.points??0,isResolved:!!O?.isCompleted,children:!!O?.isCompleted&&e(s,{children:[t(je,{size:"tiny"})," ",t(A,{className:"tt-se",children:"resolved"})]})}),t(Re,{content:w}),w.problemKey?t(Ye,{content:w,worksheetKey:p}):t("div",{className:"jk-row center",children:t(A,{className:"tt-se cr-er",children:"problem not selected"})})]}),d&&t(J,{actionButtons:Ee({type:n.QUIZ_PROBLEM,edit:g,setModal:v,index:o,sheetLength:r,setSheet:d,onSaveEdit:S,onCancel:()=>{k(!1),C(a)}}),placement:"right-end",outer:!0})]})},tt=l=>{const{sheet:a,setSheet:i,userResults:o,readOnly:c,isSolvable:r,worksheetKey:d,asSlides:h,index:p,length:m}=l,u=a[p];if(!u)return null;const g=i?e=>{i(t=>{const s=[...t];if(s[p]){const t="function"==typeof e?e(s[p]):e;s.splice(p,1,structuredClone(t))}return s})}:void 0,k=a[p+1]?.type===n.JK_MD,b={content:u,setContent:h?void 0:g,index:p,chunkId:u.id,sheetLength:a.length,setSheet:h?void 0:i,worksheetKey:d,isSolvable:r,userResults:o,readOnly:c};return h&&u.type===n.JK_MD?e(s,{children:[t(te,{name:"WorksheetNode"}),t(z,{source:u.content.trim(),flatView:!0})]}):e(x,{children:[e("div",{id:u.id,className:se("jk-row nowrap stretch top gap pn-re jk-br-ie wh-100",`${u.type}-chunk`,{editing:!!i,"next-jkmd":k}),children:[u.type===n.JK_MD&&t(Ze,{...b}),u.type===n.CODE_EDITOR&&t(Me,{...b}),u.type===n.GRAPH&&t(Qe,{...b}),u.type===n.QUIZ_PROBLEM&&t(et,{...b}),u.type===n.QUIZ_OPTIONS&&t($e,{...b})]}),i&&!h&&t("div",{className:"jk-row gap extend nowrap center jk-divider tiny editing",style:{height:0},children:t(ze,{index:p,setSheet:i,mdSheet:!0,codeEditorSheet:!0,graphSheet:!0,quizProblemSheet:!0,quizOptionsSheetType:!0,pageDivider:!0,compacted:!0,floatToolbarPlacement:p===m-1?"top":"bottom"})})]},u.id)};export{ze as A,Te as E,tt as W};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as r,K as a}from"./mermaid.core-VF3HuzPL.js";const o=(o,s)=>r.lang.round(a.parse(o)[s]);export{o as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as r}from"./chunk-NQOKRVIF-fUehRCXZ.js";export{c as createFlowDiagram}from"./chunk-NQOKRVIF-fUehRCXZ.js";import"./mermaid.core-VF3HuzPL.js";import"./chunk-5VM5RSS4-D3PGx3gp.js";import"./chunk-XXDRQBXY-DLLBlZjr.js";import"./chunk-VQ5W62QI-mHHsR0s0.js";import"./chunk-55XCU76K-BN8xVJCh.js";import"./channel-5x2nMoMO.js";import"./index-38k9tHSo.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-BLDufAOm.js";import"./settings-6x4qNkNZ.js";import"./constants.js";import"./LoaderLayer-Csc8unUJ.js";import"./websocket-D79arGLt.js";import"./index-3QSNRp1k.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"@ably/spaces/dist/mjs/react";import"./string-DPJhNSkw.js";export{r as diagram};
|