@marimo-team/frontend 0.14.14-dev11 → 0.14.14-dev12
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/assets/{ConnectedDataExplorerComponent-D7WZrIoG.js → ConnectedDataExplorerComponent-D0dBaLjq.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-AOpXII7o.js → ImageComparisonComponent-YdaNaDey.js} +1 -1
- package/dist/assets/{VegaLite-lemKF2r2.js → VegaLite-Ds-ZEbkI.js} +1 -1
- package/dist/assets/{_baseEach-Bim0SYrV.js → _baseEach-BhVT6j9U.js} +1 -1
- package/dist/assets/_baseMap-CH11fXxG.js +1 -0
- package/dist/assets/{_baseUniq-BI6GKrmn.js → _baseUniq-BtL89Ahx.js} +1 -1
- package/dist/assets/{_createAggregator-B39qVeSw.js → _createAggregator-C8TWA9aj.js} +1 -1
- package/dist/assets/{any-language-editor-BSVElZ54.js → any-language-editor-Evcpa6vO.js} +1 -1
- package/dist/assets/{architectureDiagram-SUXI7LT5-CLvpr0In.js → architectureDiagram-SUXI7LT5-D7UDXee9.js} +1 -1
- package/dist/assets/{blockDiagram-6J76NXCF-DA5whAPv.js → blockDiagram-6J76NXCF-BEtV0RkF.js} +1 -1
- package/dist/assets/{c4Diagram-6F6E4RAY-CX0aCE6a.js → c4Diagram-6F6E4RAY-oELdqqV_.js} +1 -1
- package/dist/assets/channel-D-4TSJFh.js +1 -0
- package/dist/assets/{chunk-353BL4L5-BYEw1Wz9.js → chunk-353BL4L5-DOxNhQON.js} +1 -1
- package/dist/assets/{chunk-67H74DCK-DCqAhlZK.js → chunk-67H74DCK-K4lwuUhf.js} +1 -1
- package/dist/assets/{chunk-AACKK3MU-MsfAnXNh.js → chunk-AACKK3MU-BQCFxXKB.js} +1 -1
- package/dist/assets/{chunk-BFAMUDN2-B34k-AXl.js → chunk-BFAMUDN2-Cpe2PWSb.js} +1 -1
- package/dist/assets/{chunk-E2GYISFI-gkIIkHi5.js → chunk-E2GYISFI-BIYrTp9U.js} +1 -1
- package/dist/assets/{chunk-OW32GOEJ-DOzYZSlV.js → chunk-OW32GOEJ-Datv6MeE.js} +1 -1
- package/dist/assets/{chunk-SKB7J2MH-Dt9weFg3.js → chunk-SKB7J2MH-CmycDDCw.js} +1 -1
- package/dist/assets/{chunk-SZ463SBG-DP7P613H.js → chunk-SZ463SBG-DOy4nMRF.js} +1 -1
- package/dist/assets/{circle-play-DjEQ2AAz.js → circle-play-CT_i2-Om.js} +1 -1
- package/dist/assets/classDiagram-M3E45YP4-CDeZQOhx.js +1 -0
- package/dist/assets/classDiagram-v2-YAWTLIQI-CDeZQOhx.js +1 -0
- package/dist/assets/clone-B52_-_vW.js +1 -0
- package/dist/assets/{compile-CDJ-xIfu.js → compile-TKPxo5aF.js} +1 -1
- package/dist/assets/{dagre-JOIXM2OF-DIWau12V.js → dagre-JOIXM2OF-D6oRRqvX.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-D5U0SsJ0.js → data-grid-overlay-editor-BijFG6Pz.js} +1 -1
- package/dist/assets/{diagram-5UYTHUR4-BALCZmf6.js → diagram-5UYTHUR4-BDVpEZL1.js} +1 -1
- package/dist/assets/{diagram-VMROVX33-D-WrrT1N.js → diagram-VMROVX33-Bz5hzxUF.js} +1 -1
- package/dist/assets/{diagram-ZTM2IBQH-Cccmx3jG.js → diagram-ZTM2IBQH-CVRUy3Zk.js} +1 -1
- package/dist/assets/{edit-page-Bulfs5xd.js → edit-page-DiocoNm-.js} +4 -4
- package/dist/assets/{erDiagram-3M52JZNH-VDQDFSxP.js → erDiagram-3M52JZNH-Dua1G0xE.js} +1 -1
- package/dist/assets/{flowDiagram-KYDEHFYC-DtmisApG.js → flowDiagram-KYDEHFYC-C6rcTOcZ.js} +1 -1
- package/dist/assets/{ganttDiagram-EK5VF46D-CczPI_es.js → ganttDiagram-EK5VF46D-Dnhz56cg.js} +1 -1
- package/dist/assets/{gitGraphDiagram-GW3U2K7C-Bj7yYrUM.js → gitGraphDiagram-GW3U2K7C-BwhxNCGk.js} +1 -1
- package/dist/assets/{glide-data-editor-pzhfToMd.js → glide-data-editor-BoZIE6xa.js} +4 -4
- package/dist/assets/{graph-BEFqyO18.js → graph-DS4uFQTl.js} +1 -1
- package/dist/assets/{home-page-Br6OmxCk.js → home-page-CyD4pgGI.js} +1 -1
- package/dist/assets/{index-BjkzVBO7.js → index-5B-sx3j8.js} +1 -1
- package/dist/assets/{index-CLyZb28E.js → index-61o2T9b-.js} +1 -1
- package/dist/assets/{index-BrcZZepi.js → index-7igCaZQI.js} +1 -1
- package/dist/assets/{index-C0XAgNv1.js → index-B4ATKjy5.js} +1 -1
- package/dist/assets/{index-C6NvbO5G.js → index-B98MsLyJ.js} +1 -1
- package/dist/assets/{index-C-CHLZew.js → index-BAslNTpY.js} +1 -1
- package/dist/assets/{index-Bqh23a_G.js → index-BL50Hnvo.js} +1 -1
- package/dist/assets/{index-Ddu3wzma.js → index-BX2T3HSi.js} +1 -1
- package/dist/assets/{index-CQAeNpoe.js → index-Bk2Jwznm.js} +1 -1
- package/dist/assets/{index-Dc4sdxuJ.js → index-Bnzx_XD_.js} +1 -1
- package/dist/assets/{index-L2R7RiQF.js → index-Bq6ggrTv.js} +12 -12
- package/dist/assets/{index-DCz0X3Y4.js → index-C4feBLZi.js} +1 -1
- package/dist/assets/{index-DFK72NL3.js → index-CDmkkP_w.js} +1 -1
- package/dist/assets/{index-Dp1sPfMw.js → index-CVshR3YC.js} +1 -1
- package/dist/assets/{index-BU0JLM_z.js → index-Cem4wGOX.js} +1 -1
- package/dist/assets/{index-D3sCHH3w.js → index-Cyvg-Xoi.js} +1 -1
- package/dist/assets/{index-RJoX-C-2.js → index-DRbvA3Xm.js} +1 -1
- package/dist/assets/{index-C7-lgjl6.js → index-DlmVfCE0.js} +1 -1
- package/dist/assets/{index-Bag1r9_Q.js → index-Vmv0ToTw.js} +1 -1
- package/dist/assets/{infoDiagram-LHK5PUON-CipoG6OY.js → infoDiagram-LHK5PUON-BdeERg0Z.js} +1 -1
- package/dist/assets/{journeyDiagram-EWQZEKCU-C2tn8txm.js → journeyDiagram-EWQZEKCU-BTlRdH0d.js} +1 -1
- package/dist/assets/{kanban-definition-ZSS6B67P-B4846y9O.js → kanban-definition-ZSS6B67P-Cv2zLjms.js} +1 -1
- package/dist/assets/{layout-D_Z3ihtf.js → layout-uPFqRWG0.js} +1 -1
- package/dist/assets/{linear-86MtAPU2.js → linear-BO-vuw8Q.js} +1 -1
- package/dist/assets/{links-DKWPEuaK.js → links-BKoIM2qu.js} +1 -1
- package/dist/assets/{mermaid-Cq-UCuW0.js → mermaid-DBrEGSCd.js} +4 -4
- package/dist/assets/{min-BAtxSb6f.js → min-Ci9T7dbz.js} +1 -1
- package/dist/assets/{mindmap-definition-6CBA2TL7-9eBy44n8.js → mindmap-definition-6CBA2TL7-B7rl2iGJ.js} +1 -1
- package/dist/assets/{number-overlay-editor-XghDFajJ.js → number-overlay-editor-BQjCce7C.js} +1 -1
- package/dist/assets/{pieDiagram-NIOCPIFQ-Gtp3Njrt.js → pieDiagram-NIOCPIFQ-Cnmk-4um.js} +1 -1
- package/dist/assets/{quadrantDiagram-2OG54O6I-DXAS1gs4.js → quadrantDiagram-2OG54O6I-vQ5mcHiN.js} +1 -1
- package/dist/assets/{react-plotly-BfQN4uRZ.js → react-plotly-7OGAN-Pp.js} +1 -1
- package/dist/assets/{requirementDiagram-QOLK2EJ7-Dk0REGvg.js → requirementDiagram-QOLK2EJ7-XfGbLtsf.js} +1 -1
- package/dist/assets/{run-page-BszrF35R.js → run-page-DXaOY9lF.js} +1 -1
- package/dist/assets/{sankeyDiagram-4UZDY2LN-_k_6vW9O.js → sankeyDiagram-4UZDY2LN-ChR-kQjg.js} +1 -1
- package/dist/assets/{sequenceDiagram-SKLFT4DO-0YazNIWG.js → sequenceDiagram-SKLFT4DO-BjCnB5K9.js} +1 -1
- package/dist/assets/{slides-component-882wphDJ.js → slides-component-CcPfoe4P.js} +1 -1
- package/dist/assets/{sortBy-CQZuiVVD.js → sortBy-B-_WdORX.js} +1 -1
- package/dist/assets/{stateDiagram-MI5ZYTHO-RY2z4gr3.js → stateDiagram-MI5ZYTHO-BbO8IbjU.js} +1 -1
- package/dist/assets/stateDiagram-v2-5AN5P6BG-MdgM_LxS.js +1 -0
- package/dist/assets/{storage-Cncl8Pzd.js → storage-D4gGTcje.js} +3 -3
- package/dist/assets/{terminal-CuJTVbQi.js → terminal-DNVfpX4u.js} +1 -1
- package/dist/assets/{time-C8iyMFjm.js → time-Ci7FDpbv.js} +1 -1
- package/dist/assets/{timeline-definition-MYPXXCX6-BcI6DPva.js → timeline-definition-MYPXXCX6-Duz6cP2d.js} +1 -1
- package/dist/assets/{tracing-DIFDmtKH.js → tracing-B6Krt1ZF.js} +2 -2
- package/dist/assets/{trash-Dkx8Gv5s.js → trash-luFRq7cL.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-Xpaz5ab_.js → treemap-75Q7IDZK-BADS-akf.js} +1 -1
- package/dist/assets/{vega-component-DJxpBrZ9.js → vega-component-CLT_xHWY.js} +1 -1
- package/dist/assets/{xychartDiagram-H2YORKM3-BlU-kObw.js → xychartDiagram-H2YORKM3-CVQkgHQ8.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-BDz3eVeh.js +0 -1
- package/dist/assets/channel-UfWR9q5z.js +0 -1
- package/dist/assets/classDiagram-M3E45YP4-KZC0pW0e.js +0 -1
- package/dist/assets/classDiagram-v2-YAWTLIQI-KZC0pW0e.js +0 -1
- package/dist/assets/clone-Be7NIKbK.js +0 -1
- package/dist/assets/stateDiagram-v2-5AN5P6BG-DK2Bji2L.js +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor-
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor-Evcpa6vO.js","./index-BL50Hnvo.js","./index-DRbvA3Xm.js","./index-CDmkkP_w.js","./index-C4feBLZi.js","./index-CVshR3YC.js","./index-BX2T3HSi.js","./index-DlmVfCE0.js","./index-Vmv0ToTw.js","./index-BAslNTpY.js","./index-B4ATKjy5.js","./index-Bk2Jwznm.js","./index-61o2T9b-.js","./index-B98MsLyJ.js","./apl-CXdQSnD-.js","./asciiarmor-D5V0T9Cu.js","./asterisk-B46aRdXb.js","./brainfuck-CtZaYBKt.js","./clike-BgBwzOhw.js","./cmake-DXn5xaP-.js","./cobol-stawOqaz.js","./coffeescript-BTDxI-eT.js","./commonlisp-vq6DHwts.js","./crystal-CRzZ78HM.js","./cypher-gJDei3ni.js","./d-BShv7fp-.js","./diff-UJJ5BM9S.js","./dockerfile-knGOOxt4.js","./simple-mode-C3vEBAcb.js","./dtd-DI9Herc-.js","./dylan-DkEP81N9.js","./ebnf-B-Df8AvO.js","./ecl-DPFc0Uaf.js","./eiffel-DR5c0IrL.js","./elm-DompmV0j.js","./erlang-BuqgqA5h.js","./factor-CFXhaUWb.js","./fcl-CVaBTCzQ.js","./forth-POgR1ypr.js","./fortran-DL7KluxX.js","./gas-bV0CklSb.js","./gherkin-B6X1vGSW.js","./groovy-DnIzCrpZ.js","./haskell-CLQs6EAM.js","./haxe-D25e-2l-.js","./http-BKJkqRj4.js","./idl-pcmmZuaN.js","./jinja2-DhgKlfW7.js","./julia-DjdwvFuI.js","./livescript-HO6ttBFx.js","./lua-8DXOpKDz.js","./mathematica-IIbmv7SK.js","./mbox-z_N2Mo3d.js","./mirc-DkvFAiy5.js","./modelica-DSrSSXCg.js","./mscgen-B2igx18G.js","./mumps-zvxmGV4l.js","./nginx-B4hAVlXN.js","./nsis-BvKfQ9lQ.js","./ntriples-BSwWqoLa.js","./octave-C4hdQ5Hf.js","./oz-qQq7irPq.js","./pascal-CafrKXZF.js","./perl-tdMlh9QA.js","./pig-CwGJVRC4.js","./powershell-D1ly3AHC.js","./properties-_nPj978X.js","./protobuf-B4y9do6W.js","./puppet-Bc-yJKzi.js","./q-B0kTJ4cI.js","./r-BA4EbLKE.js","./ruby-CR-u2WLS.js","./sas-Bqaci40L.js","./scheme-qjP0V5Ag.js","./shell-BLav31RL.js","./sieve-r025o_jW.js","./smalltalk-C7J3IyEP.js","./solr-78MBEUkU.js","./sparql-BRLJFz69.js","./spreadsheet-CGlWr0eM.js","./stylus-Bdo_Aemu.js","./swift-B_XXVlXX.js","./tcl-B2fODqDH.js","./textile-BuVhTOzU.js","./tiddlywiki-BgR6AEZu.js","./tiki-CI-ztowC.js","./toml-wcPdHu67.js","./troff-Ce85hlLp.js","./ttcn-BxnYHtq8.js","./turtle-BkSuIpt-.js","./vb-BHgjm0DN.js","./vbscript-Dawdd5GZ.js","./velocity-BdD_26Jv.js","./verilog-B4LBqg_1.js","./vhdl-CWWH2SUo.js","./webidl-CGwyPRYs.js","./xquery-CVDBqZPY.js","./yacas-I8QjZlxf.js","./z80-D8p3gKXp.js","./index-7igCaZQI.js","./VegaLite-Ds-ZEbkI.js","./compile-TKPxo5aF.js","./time-Ci7FDpbv.js","./timer-Bqd5yn_a.js","./linear-BO-vuw8Q.js","./init-DLRA0X12.js","./range-CtcPcB_L.js","./zoom-COrs4lFh.js","./ordinal-DDUp3AbE.js","./colors-bszWmPJw.js","./step-BwsUM5iJ.js","./arc-ZB5pDULS.js","./index-BEQfoZiP.js","./index-Cyvg-Xoi.js","./pug-BTvK5tSS.js","./javascript-BpzJj0-u.js","./home-page-CyD4pgGI.js","./links-BKoIM2qu.js","./links-C1rhMrxo.css","./circle-play-CT_i2-Om.js","./run-page-DXaOY9lF.js","./storage-D4gGTcje.js","./trash-luFRq7cL.js","./storage-De8XnUVS.css","./edit-page-DiocoNm-.js","./_createAggregator-C8TWA9aj.js","./_baseEach-BhVT6j9U.js","./loro_wasm_bg-C3hKWL9L.js","./transform-CDNfLgV5.js","./sortBy-B-_WdORX.js","./_baseMap-CH11fXxG.js","./edit-page-B7tjWZiy.css","./glide-data-editor-BoZIE6xa.js","./glide-data-editor-DcmjcDkq.css","./ConnectedDataExplorerComponent-D0dBaLjq.js","./vega-component-CLT_xHWY.js","./slides-component-CcPfoe4P.js","./slides-component-DeDT_a8V.css","./mermaid-DBrEGSCd.js","./mhchem-DFRC5yJY.js","./katex-LV4FpwlL.js"])))=>i.map(i=>d[i]);
|
2
2
|
var Pyt=Object.defineProperty;var Eyt=(bg,Mu,xg)=>Mu in bg?Pyt(bg,Mu,{enumerable:!0,configurable:!0,writable:!0,value:xg}):bg[Mu]=xg;var en=(bg,Mu,xg)=>Eyt(bg,typeof Mu!="symbol"?Mu+"":Mu,xg);let we,OH,R_,$v,To,Hd,j_,qx,yA,Yr,bA,wH,Ve,xA,D_,kH,A_,SH,Fx,_l,Gr,Ct,as,_,Xm,CH,_H,Be,ue,TH,OA,qn,xu,Qh,PH,EH,Lh,Iv,RH,jH,wA,kA,SA,DH,CA,Yd,AH,_A,M_,$a,N_,TA,Gd,Fn,Bx,cr,Qv,Lv,ai,MH,PA,Hm,zh,RIe,NH,Wx,EA,jIe,$H,$_,Ym,IH,I_,QH,LH,zH,RA,DIe,Ft,jA,VH,qH,FH,Kd,Kr,zv,AIe,DA,Vh,AA,MIe,BH,Ux,ge,He,$r,NIe,Gm,$Ie,Zi,Q_,IIe,QIe,LIe,Vv,Zx,qh,Xx,Hx,MA,zIe,VIe,L_,qv,NA,$A,Fh,Yx,z_,Jd,IA,QA,WH,Gx,V_,ef,UH,LA,Fv,ZH,XH,Fs,HH,YH,qIe,GH,KH,Bh,ss,q_,JH,eY,zA,tY,VA,FIe,BIe,WIe,Km,Jm,tf,Tl,nf,nY,rY,Bv,oY,F_,ct,Kx,qA,FA,BA,iY,B_,Wv,W_,yn,Jx,U_,aY,sY,lY,UIe,WA,Wh,UA,eO,Z_,Uv,ZIe,XIe,ZA,Fr,cY,uY,dY,XA,HA,fY,hY,_c,pY,Ou,rf,YA,mY,X_,gY,GA,KA,vY,Zv,wu,JA,Bs,yY,H_,eM,bY,xY,OY,wY,ji,kY,SY,eg,CY,_Y,tO,Y_,Xv,TY,ku,HIe,PY,EY,tM,nM,rM,RY,G_,jY,nO,DY,of,oM,rO,K_,iM,Hv,AY,aM,MY,tg,kr,Su,J_,NY,oO,Bo,Yv,Oa,sM,eT,lM,tT,Ia,Uh,ls,$Y,Zh,nT,Gv,IY,iO,cM,QY,rT,Kv,oT,LY,iT,uM,zY,Jv,aO,dM,Qo,Ws,Us,cs,Cu,Zs,Rn,Xh,sO,Hh,ng,Sr,VY,qY,FY,af,YIe,aT,GIe,Ht,BY,fM,hM,KIe,lO,WY,pM,UY,ZY,XY,Yh,mM,rg,HY,JIe,Qa,Qe,Wt,pt,yt,un,sf,YY,eQe,tQe,GY,KY,JY,gM,eG,Pl,nQe,rQe,ur,tG,nG,oa,rG,ey,cO,uO,Po,lf,dO,sT,lT,cT,oQe,vM,uT,oG,og,ty,iQe,yM,iG,aQe,ig,aG,sQe,Xs,ag,El,lQe,sG,lG,cQe,uQe,Tc,cG,bM,us,dQe,Br,uG,xM,fQe,hQe,pQe,OM,ds,fO,dG,fG,wM,kM,rr,hG,jr,dr,Ir,ny,Di,mQe,dT,hO,SM,pG,mG,cf,gQe,gG,vQe,yQe,bQe,uf,vG,xQe,CM,_M,OQe,wQe,Pc,TM,kQe,SQe,CQe,_Qe,TQe,Gh,sg,Xi,lg,pO,PQe,EQe,_u,ry,fT,yG,Ec,hT,RQe,bG,jQe,cg,xG,pT,PM,EM,RM,DQe,Rc,jc,AQe,OG,mO,oy,iy,gO,jM,DM,Hs,ug,wG,MQe,vO,Kh,AM,kG,Tu,SG,Jh,ay,mT,fs,CG,Hi,Wr,_G,NQe,bo,yO,TG,gT,ep,PG,$Qe,La,IQe,vT,EG,RG,MM,Pu,QQe,jG,sy,tp,dg,LQe,NM,DG,Cr,Eu,bO,AG,df,xO,zQe,VQe,MG,qQe,FQe,fg,yT,bT,xT,BQe,NG,WQe,UQe,ZQe,ly,XQe,$G,IG,np,QG,LG,HQe,YQe,zG,VG,hg,cy,pg,OO,qG,wO,GQe,KQe,FG,BG,uy,WG,dy,Ru,kO,wa,JQe,e6e,t6e,n6e,r6e,UG,mg,o6e,i6e,ff,$M,a6e,s6e,l6e,OT,ZG,c6e,u6e,d6e,f6e,h6e,ju,p6e,Ys,m6e,Dc,Gs,ka,g6e,hs,Rl,Ai,v6e,ia,wT,kT,XG,HG,YG,SO,y6e,CO,ST,Mi,_O,Ks,hf,GG,b6e,x6e,O6e,w6e,k6e,S6e,C6e,_6e,T6e,P6e,E6e,R6e,j6e,D6e,A6e,M6e,KG,JG,N6e,eK,$6e,IM,ps,Sa,y,I6e,TO,tK,Q6e,L6e,nK,z6e,rK,oK,QM,CT,V6e,q6e,iK,F6e,LM,PO,B6e,_T,fy,W6e,EO,RO,Jr,gn,Pe,aK,hy,zM,TT,U6e,Z6e,jl,VM,rp,py,PT,sK,pf,qM,lK,cK,uK,dK,ET,fK,X6e,H6e,hK,pK,FM,Y6e,mK,BM,gK,vK,G6e,yK,bK,xK,WM,OK,jO,K6e,my,wK,kK,RT,SK,gg,J6e,eLe,CK,tLe,nLe,rLe,mf,oLe,gy,iLe,aLe,sLe,lLe,op,cLe,uLe,dLe,_K,Du,vy,fLe,hLe,pLe,UM,ZM,yy,mLe,gLe,vLe,yLe,bLe,TK,PK,xLe,OLe,EK,wLe,kLe,RK,XM,jK,DK,jT,AK,Eo,Yt,Ac,hn,DO,MK,NK,SLe,HM,by,xy,CLe,_Le,TLe,$K,Oy,YM,IK,PLe,ELe,RLe,DT,GM,jLe,KM,DLe,Lt,ALe,MLe,JM,QK,LK,zK,eN,VK,qK,NLe,$Le,ILe,FK,BK,WK,UK,gf,QLe,tN,Qn,ZK,nN,XK,AT,MT,rN,HK,Dl,Mc,oN,iN,LLe,YK,AO,Nc,aN,Ni,co,NT,vg,$c,GK,KK,zLe,sN,JK,eJ,tJ,MO,$T,VLe,qLe,FLe,$i,nJ,NO,rJ,lN,oJ,iJ,Wo,aJ,_t,ut,sJ,yg,$O,IO,ip,cN,QO,eo,BLe,ap,uN,dN,fN,lJ,WLe,cJ,uJ,vf,hN,Jn,Ic,dJ,IT,fJ,ULe,pN,hJ,ZLe,pJ,mJ,gJ,vJ,yJ,bJ,xJ,OJ,wJ,Lo,kJ,SJ,mN,gN,CJ,vN,yN,_J,XLe,HLe,YLe,LO,GLe,bN,KLe,TJ,xN,ON,PJ,sp,JLe,e8e,wN,EJ,RJ,t8e,jJ,DJ,n8e,zO,r8e,o8e,i8e,kN,a8e,ln,yf,Uo,Zo,VO,AJ,SN,qO,wy,ky,Sy,MJ,NJ,$J,s8e,IJ,CN,QJ,LJ,zJ,l8e,FO,Qc,VJ,za,qJ,c8e,u8e,d8e,_N,lp,f8e,FJ,Lc,BO,h8e,p8e,m8e,BJ,TN,g8e,PN,v8e,y8e,WJ,b8e,mt,UJ,x8e,O8e,EN,RN,jN,w8e,k8e,Au,DN,ZJ,S8e,XJ,AN,C8e,MN,HJ,_8e,WO,T8e,P8e,YJ,GJ,E8e,R8e,j8e,Al,D8e,A8e,KJ,JJ,eee,tee,nee,NN,ree,oee,$N,iee,aee,see,QT,M8e,N8e,lee,LT,IN,$8e,I8e,QN,Q8e,LN,zN,Ml,cee,L8e,uee,z8e,V8e,q8e,UO,ZO,F8e,B8e,XO,dee,fee,bf,hee,pee,Nl,Xo,et,HO,xf,de,vr,Js,YO,GO,mee,el,Ryt=(async()=>{var PZ;function bg(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(!(t&&t.supports&&t.supports("modulepreload"))){for(const n of document.querySelectorAll('link[rel="modulepreload"]'))e(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&e(o)}).observe(document,{childList:!0,subtree:!0})}function e(n){if(n.ep)return;n.ep=!0;const r=function(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}(n);fetch(n.href,r)}})(),NM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},el=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t},uM=function(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n};var Mu,xg,xee={exports:{}},KO={};y=(xg||(xg=1,xee.exports=function(){if(Mu)return KO;Mu=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,o,i){var a=null;if(i!==void 0&&(a=""+i),o.key!==void 0&&(a=""+o.key),"key"in o)for(var s in i={},o)s!=="key"&&(i[s]=o[s]);else i=o;return o=i.ref,{$$typeof:t,type:r,key:a,ref:o!==void 0?o:null,props:i}}return KO.Fragment=e,KO.jsx=n,KO.jsxs=n,KO}()),xee.exports);const JO={},Oee=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,wee=t=>"init"in t,qN=t=>!!t.write,kee=t=>"v"in t||"e"in t,zT=t=>{if("e"in t)throw t.e;if((JO?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},VT=new WeakMap,See=t=>{var e;return qT(t)&&!!((e=VT.get(t))!=null&&e[0])},Cee=(t,e)=>{let n=VT.get(t);if(!n){n=[!0,new Set],VT.set(t,n);const r=()=>{n[0]=!1};t.then(r,r)}n[1].add(e)},qT=t=>typeof(t==null?void 0:t.then)=="function",_ee=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},FN=(t,e,n)=>{const r=n(t),o="v"in r,i=r.v;if(qT(e))for(const a of r.d.keys())_ee(t,e,n(a));r.v=e,delete r.e,o&&Object.is(i,r.v)||(++r.n,qT(i)&&(a=>{const s=VT.get(a);s!=null&&s[0]&&(s[0]=!1,s[1].forEach(l=>l()))})(i))},Tee=(t,e,n)=>{var r;const o=new Set;for(const i of((r=n.get(t))==null?void 0:r.t)||[])n.has(i)&&o.add(i);for(const i of e.p)o.add(i);return o},BN=()=>{const t={},e=new WeakMap,n=r=>{var o,i;(o=e.get(t))==null||o.forEach(a=>a(r)),(i=e.get(r))==null||i.forEach(a=>a())};return n.add=(r,o)=>{const i=r||t,a=(e.has(i)?e:e.set(i,new Set)).get(i);return a.add(o),()=>{a==null||a.delete(o),a.size||e.delete(i)}},n},Y8e=Symbol(),Pee=(t=new WeakMap,e=new WeakMap,n=new WeakMap,r=new Set,o=new Set,i=new Set,a={},s=(f,...h)=>f.read(...h),l=(f,...h)=>f.write(...h),c=(f,h)=>{var g;return(g=f.unstable_onInit)==null?void 0:g.call(f,h)},u=(f,h)=>{var g;return(g=f.onMount)==null?void 0:g.call(f,h)},...d)=>{const f=d[0]||(P=>{if((JO?"production":void 0)!=="production"&&!P)throw new Error("Atom is undefined or null");let j=t.get(P);return j||(j={d:new Map,p:new Set,n:0},t.set(P,j),c==null||c(P,T)),j}),h=d[1]||(()=>{const P=[],j=D=>{try{D()}catch(N){P.push(N)}};do{a.f&&j(a.f);const D=new Set,N=D.add.bind(D);r.forEach(E=>{var A;return(A=e.get(E))==null?void 0:A.l.forEach(N)}),r.clear(),i.forEach(N),i.clear(),o.forEach(N),o.clear(),D.forEach(j),r.size&&g()}while(r.size||i.size||o.size);if(P.length)throw new AggregateError(P)}),g=d[2]||(()=>{const P=[],j=new WeakSet,D=new WeakSet,N=Array.from(r);for(;N.length;){const E=N[N.length-1],A=f(E);if(D.has(E))N.pop();else if(j.has(E)){if(n.get(E)===A.n)P.push([E,A]);else if((JO?"production":void 0)!=="production"&&n.has(E))throw new Error("[Bug] invalidated atom exists");D.add(E),N.pop()}else{j.add(E);for(const I of Tee(E,A,e))j.has(I)||N.push(I)}}for(let E=P.length-1;E>=0;--E){const[A,I]=P[E];let L=!1;for(const F of I.d.keys())if(F!==A&&r.has(F)){L=!0;break}L&&(v(A),O(A)),n.delete(A)}}),v=d[3]||(P=>{var j;const D=f(P);if(kee(D)&&(e.has(P)&&n.get(P)!==D.n||Array.from(D.d).every(([W,U])=>v(W).n===U)))return D;D.d.clear();let N=!0;const E=()=>{e.has(P)&&(O(P),g(),h())},A=W=>{var U;if(Oee(P,W)){const G=f(W);if(!kee(G)){if(!wee(W))throw new Error("no atom init");FN(W,W.init,f)}return zT(G)}const X=v(W);try{return zT(X)}finally{D.d.set(W,X.n),See(D.v)&&_ee(P,D.v,X),(U=e.get(W))==null||U.t.add(P),N||E()}};let I,L;const F={get signal(){return I||(I=new AbortController),I.signal},get setSelf(){return(JO?"production":void 0)==="production"||qN(P)||console.warn("setSelf function cannot be used with read-only atom"),!L&&qN(P)&&(L=(...W)=>{if((JO?"production":void 0)!=="production"&&N&&console.warn("setSelf function cannot be called in sync"),!N)try{return p(P,...W)}finally{g(),h()}}),L}},Q=D.n;try{const W=s(P,A,F);return FN(P,W,f),qT(W)&&(Cee(W,()=>I==null?void 0:I.abort()),W.then(E,E)),D}catch(W){return delete D.v,D.e=W,++D.n,D}finally{N=!1,Q!==D.n&&n.get(P)===Q&&(n.set(P,D.n),r.add(P),(j=a.c)==null||j.call(a,P))}}),b=d[4]||(P=>{const j=[P];for(;j.length;){const D=j.pop(),N=f(D);for(const E of Tee(D,N,e)){const A=f(E);n.set(E,A.n),j.push(E)}}}),p=d[5]||((P,...j)=>{let D=!0;const N=A=>zT(v(A)),E=(A,...I)=>{var L;const F=f(A);try{if(Oee(P,A)){if(!wee(A))throw new Error("atom not writable");const Q=F.n,W=I[0];return FN(A,W,f),O(A),void(Q!==F.n&&(r.add(A),(L=a.c)==null||L.call(a,A),b(A)))}return p(A,...I)}finally{D||(g(),h())}};try{return l(P,N,E,...j)}finally{D=!1}}),O=d[6]||(P=>{var j;const D=f(P),N=e.get(P);if(N&&!See(D.v)){for(const[E,A]of D.d)if(!N.d.has(E)){const I=f(E);k(E).t.add(P),N.d.add(E),A!==I.n&&(r.add(E),(j=a.c)==null||j.call(a,E),b(E))}for(const E of N.d||[])if(!D.d.has(E)){N.d.delete(E);const A=S(E);A==null||A.t.delete(P)}}}),k=d[7]||(P=>{var j;const D=f(P);let N=e.get(P);if(!N){v(P);for(const E of D.d.keys())k(E).t.add(P);if(N={l:new Set,d:new Set(D.d.keys()),t:new Set},e.set(P,N),(j=a.m)==null||j.call(a,P),qN(P)){const E=()=>{let A=!0;const I=(...L)=>{try{return p(P,...L)}finally{A||(g(),h())}};try{const L=u(P,I);L&&(N.u=()=>{A=!0;try{L()}finally{A=!1}})}finally{A=!1}};o.add(E)}}return N}),S=d[8]||(P=>{var j;const D=f(P);let N=e.get(P);if(!N||N.l.size||Array.from(N.t).some(E=>{var A;return(A=e.get(E))==null?void 0:A.d.has(P)}))return N;N.u&&i.add(N.u),N=void 0,e.delete(P),(j=a.u)==null||j.call(a,P);for(const E of D.d.keys()){const A=S(E);A==null||A.t.delete(P)}}),w=[t,e,n,r,o,i,a,s,l,c,u,f,h,g,v,b,p,O,k,S],T={get:P=>zT(v(P)),set:(P,...j)=>{try{return p(P,...j)}finally{g(),h()}},sub:(P,j)=>{const D=k(P).l;return D.add(j),h(),()=>{D.delete(j),S(P),h()}}};return Object.defineProperty(T,Y8e,{value:w}),T},G8e=t=>(t.c||(t.c=BN()),t.m||(t.m=BN()),t.u||(t.u=BN()),t.f||(t.f=(()=>{const e=new Set,n=()=>{e.forEach(r=>r())};return n.add=r=>(e.add(r),()=>{e.delete(r)}),n})()),t),Eee=Cee,WN={};let K8e=0;Ct=function(t,e){const n="atom"+ ++K8e,r={toString(){return(WN?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=J8e,r.write=e7e),e&&(r.write=e),r};function J8e(t){return t(this)}function e7e(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}K_=function(){return(WN?"production":void 0)!=="production"?(()=>{let t=0;const e=G8e({}),n=new WeakMap,r=new WeakMap,o=Pee(n,r,void 0,void 0,void 0,void 0,e,void 0,(s,l,c,...u)=>t?c(s,...u):s.write(l,c,...u)),i=new Set;return e.m.add(void 0,s=>{i.add(s),n.get(s).m=r.get(s)}),e.u.add(void 0,s=>{i.delete(s),delete n.get(s).m}),Object.assign(o,{dev4_get_internal_weak_map:()=>(console.log("Deprecated: Use devstore from the devtools library"),n),dev4_get_mounted_atoms:()=>i,dev4_restore_atoms:s=>{const l={read:()=>null,write:(c,u)=>{++t;try{for(const[d,f]of s)"init"in d&&u(d,f)}finally{--t}}};o.set(l)}})})():Pee()};let ew;var Ree,jee,Dee={exports:{}},An={};function t7e(){if(Ree)return An;Ree=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator,f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function v(Q,W,U){this.props=Q,this.context=W,this.refs=g,this.updater=U||f}function b(){}function p(Q,W,U){this.props=Q,this.context=W,this.refs=g,this.updater=U||f}v.prototype.isReactComponent={},v.prototype.setState=function(Q,W){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,W,"setState")},v.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")},b.prototype=v.prototype;var O=p.prototype=new b;O.constructor=p,h(O,v.prototype),O.isPureReactComponent=!0;var k=Array.isArray,S={H:null,A:null,T:null,S:null,V:null},w=Object.prototype.hasOwnProperty;function T(Q,W,U,X,G,ae){return U=ae.ref,{$$typeof:t,type:Q,key:W,ref:U!==void 0?U:null,props:ae}}function P(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===t}var j=/\/+/g;function D(Q,W){return typeof Q=="object"&&Q!==null&&Q.key!=null?function(U){var X={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(G){return X[G]})}(""+Q.key):W.toString(36)}function N(){}function E(Q,W,U,X,G){var ae=typeof Q;ae!=="undefined"&&ae!=="boolean"||(Q=null);var ne,re,Z=!1;if(Q===null)Z=!0;else switch(ae){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(Q.$$typeof){case t:case e:Z=!0;break;case u:return E((Z=Q._init)(Q._payload),W,U,X,G)}}if(Z)return G=G(Q),Z=X===""?"."+D(Q,0):X,k(G)?(U="",Z!=null&&(U=Z.replace(j,"$&/")+"/"),E(G,W,U,"",function(Y){return Y})):G!=null&&(P(G)&&(ne=G,re=U+(G.key==null||Q&&Q.key===G.key?"":(""+G.key).replace(j,"$&/")+"/")+Z,G=T(ne.type,re,void 0,0,0,ne.props)),W.push(G)),1;Z=0;var K,oe=X===""?".":X+":";if(k(Q))for(var ie=0;ie<Q.length;ie++)Z+=E(X=Q[ie],W,U,ae=oe+D(X,ie),G);else if(typeof(ie=(K=Q)===null||typeof K!="object"?null:typeof(K=d&&K[d]||K["@@iterator"])=="function"?K:null)=="function")for(Q=ie.call(Q),ie=0;!(X=Q.next()).done;)Z+=E(X=X.value,W,U,ae=oe+D(X,ie++),G);else if(ae==="object"){if(typeof Q.then=="function")return E(function(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(N,N):(Y.status="pending",Y.then(function(le){Y.status==="pending"&&(Y.status="fulfilled",Y.value=le)},function(le){Y.status==="pending"&&(Y.status="rejected",Y.reason=le)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}(Q),W,U,X,G);throw W=String(Q),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return Z}function A(Q,W,U){if(Q==null)return Q;var X=[],G=0;return E(Q,X,"","",function(ae){return W.call(U,ae,G++)}),X}function I(Q){if(Q._status===-1){var W=Q._result;(W=W()).then(function(U){Q._status!==0&&Q._status!==-1||(Q._status=1,Q._result=U)},function(U){Q._status!==0&&Q._status!==-1||(Q._status=2,Q._result=U)}),Q._status===-1&&(Q._status=0,Q._result=W)}if(Q._status===1)return Q._result.default;throw Q._result}var L=typeof reportError=="function"?reportError:function(Q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Q=="object"&&Q!==null&&typeof Q.message=="string"?String(Q.message):String(Q),error:Q});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function")return void process.emit("uncaughtException",Q);console.error(Q)};function F(){}return An.Children={map:A,forEach:function(Q,W,U){A(Q,function(){W.apply(this,arguments)},U)},count:function(Q){var W=0;return A(Q,function(){W++}),W},toArray:function(Q){return A(Q,function(W){return W})||[]},only:function(Q){if(!P(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}},An.Component=v,An.Fragment=n,An.Profiler=o,An.PureComponent=p,An.StrictMode=r,An.Suspense=l,An.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,An.__COMPILER_RUNTIME={__proto__:null,c:function(Q){return S.H.useMemoCache(Q)}},An.cache=function(Q){return function(){return Q.apply(null,arguments)}},An.cloneElement=function(Q,W,U){if(Q==null)throw Error("The argument must be a React element, but you passed "+Q+".");var X=h({},Q.props),G=Q.key;if(W!=null)for(ae in W.ref,W.key!==void 0&&(G=""+W.key),W)!w.call(W,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&W.ref===void 0||(X[ae]=W[ae]);var ae=arguments.length-2;if(ae===1)X.children=U;else if(1<ae){for(var ne=Array(ae),re=0;re<ae;re++)ne[re]=arguments[re+2];X.children=ne}return T(Q.type,G,void 0,0,0,X)},An.createContext=function(Q){return(Q={$$typeof:a,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null}).Provider=Q,Q.Consumer={$$typeof:i,_context:Q},Q},An.createElement=function(Q,W,U){var X,G={},ae=null;if(W!=null)for(X in W.key!==void 0&&(ae=""+W.key),W)w.call(W,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(G[X]=W[X]);var ne=arguments.length-2;if(ne===1)G.children=U;else if(1<ne){for(var re=Array(ne),Z=0;Z<ne;Z++)re[Z]=arguments[Z+2];G.children=re}if(Q&&Q.defaultProps)for(X in ne=Q.defaultProps)G[X]===void 0&&(G[X]=ne[X]);return T(Q,ae,void 0,0,0,G)},An.createRef=function(){return{current:null}},An.forwardRef=function(Q){return{$$typeof:s,render:Q}},An.isValidElement=P,An.lazy=function(Q){return{$$typeof:u,_payload:{_status:-1,_result:Q},_init:I}},An.memo=function(Q,W){return{$$typeof:c,type:Q,compare:W===void 0?null:W}},An.startTransition=function(Q){var W=S.T,U={};S.T=U;try{var X=Q(),G=S.S;G!==null&&G(U,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(F,L)}catch(ae){L(ae)}finally{S.T=W}},An.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},An.use=function(Q){return S.H.use(Q)},An.useActionState=function(Q,W,U){return S.H.useActionState(Q,W,U)},An.useCallback=function(Q,W){return S.H.useCallback(Q,W)},An.useContext=function(Q){return S.H.useContext(Q)},An.useDebugValue=function(){},An.useDeferredValue=function(Q,W){return S.H.useDeferredValue(Q,W)},An.useEffect=function(Q,W,U){var X=S.H;if(typeof U=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return X.useEffect(Q,W)},An.useId=function(){return S.H.useId()},An.useImperativeHandle=function(Q,W,U){return S.H.useImperativeHandle(Q,W,U)},An.useInsertionEffect=function(Q,W){return S.H.useInsertionEffect(Q,W)},An.useLayoutEffect=function(Q,W){return S.H.useLayoutEffect(Q,W)},An.useMemo=function(Q,W){return S.H.useMemo(Q,W)},An.useOptimistic=function(Q,W){return S.H.useOptimistic(Q,W)},An.useReducer=function(Q,W,U){return S.H.useReducer(Q,W,U)},An.useRef=function(Q){return S.H.useRef(Q)},An.useState=function(Q){return S.H.useState(Q)},An.useSyncExternalStore=function(Q,W,U){return S.H.useSyncExternalStore(Q,W,U)},An.useTransition=function(){return S.H.useTransition()},An.version="19.1.0",An}Yd=function(){return jee||(jee=1,Dee.exports=t7e()),Dee.exports},_=Yd();let Og,Aee,UN;ge=el(_),Og=bg({__proto__:null,default:ge},[_]),Aee={},UN=_.createContext(void 0),gy=function(t){const e=_.useContext(UN);return(t==null?void 0:t.store)||e||(ew||(ew=K_(),(WN?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ew),globalThis.__JOTAI_DEFAULT_STORE__!==ew&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ew)},Hv=function({children:t,store:e}){const n=_.useRef(void 0);return e||n.current||(n.current=K_()),_.createElement(UN.Provider,{value:e||n.current},t)};const ZN=t=>typeof(t==null?void 0:t.then)=="function",XN=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},n7e=ge.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(XN(t),t)}),HN=new WeakMap,Mee=(t,e)=>{let n=HN.get(t);return n||(n=new Promise((r,o)=>{let i=t;const a=c=>u=>{i===c&&r(u)},s=c=>u=>{i===c&&o(u)},l=()=>{try{const c=e();ZN(c)?(HN.set(c,n),i=c,c.then(a(c),s(c)),Eee(c,l)):r(c)}catch(c){o(c)}};t.then(a(t),s(t)),Eee(t,l)}),HN.set(t,n)),n};Gr=function(t,e){const{delay:n,unstable_promiseStatus:r=!ge.use}=e||{},o=gy(e),[[i,a,s],l]=_.useReducer(u=>{const d=o.get(t);return Object.is(u[0],d)&&u[1]===o&&u[2]===t?u:[d,o,t]},void 0,()=>[o.get(t),o,t]);let c=i;if(a===o&&s===t||(l(),c=o.get(t)),_.useEffect(()=>{const u=o.sub(t,()=>{if(r)try{const d=o.get(t);ZN(d)&&XN(Mee(d,()=>o.get(t)))}catch{}typeof n!="number"?l():setTimeout(l,n)});return l(),u},[o,t,n,r]),_.useDebugValue(c),ZN(c)){const u=Mee(c,()=>o.get(t));return r&&XN(u),n7e(u)}return c},Xm=function(t,e){const n=gy(e);return _.useCallback((...r)=>{if((Aee?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...r)},[n,t])},ss=function(t,e){return[Gr(t,e),Xm(t,e)]};var Nee,$ee,Iee={exports:{}},tw={},Qee={exports:{}},Lee={};function r7e(){return $ee||($ee=1,Qee.exports=(Nee||(Nee=1,function(t){function e(Q,W){var U=Q.length;Q.push(W);e:for(;0<U;){var X=U-1>>>1,G=Q[X];if(!(0<o(G,W)))break e;Q[X]=W,Q[U]=G,U=X}}function n(Q){return Q.length===0?null:Q[0]}function r(Q){if(Q.length===0)return null;var W=Q[0],U=Q.pop();if(U!==W){Q[0]=U;e:for(var X=0,G=Q.length,ae=G>>>1;X<ae;){var ne=2*(X+1)-1,re=Q[ne],Z=ne+1,K=Q[Z];if(0>o(re,U))Z<G&&0>o(K,re)?(Q[X]=K,Q[Z]=U,X=Z):(Q[X]=re,Q[ne]=U,X=ne);else{if(!(Z<G&&0>o(K,U)))break e;Q[X]=K,Q[Z]=U,X=Z}}}return W}function o(Q,W){var U=Q.sortIndex-W.sortIndex;return U!==0?U:Q.id-W.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,h=!1,g=!1,v=!1,b=!1,p=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function S(Q){for(var W=n(c);W!==null;){if(W.callback===null)r(c);else{if(!(W.startTime<=Q))break;r(c),W.sortIndex=W.expirationTime,e(l,W)}W=n(c)}}function w(Q){if(v=!1,S(Q),!g)if(n(l)!==null)g=!0,P||(P=!0,T());else{var W=n(c);W!==null&&F(w,W.startTime-Q)}}var T,P=!1,j=-1,D=5,N=-1;function E(){return!(!b&&t.unstable_now()-N<D)}function A(){if(b=!1,P){var Q=t.unstable_now();N=Q;var W=!0;try{e:{g=!1,v&&(v=!1,O(j),j=-1),h=!0;var U=f;try{t:{for(S(Q),d=n(l);d!==null&&!(d.expirationTime>Q&&E());){var X=d.callback;if(typeof X=="function"){d.callback=null,f=d.priorityLevel;var G=X(d.expirationTime<=Q);if(Q=t.unstable_now(),typeof G=="function"){d.callback=G,S(Q),W=!0;break t}d===n(l)&&r(l),S(Q)}else r(l);d=n(l)}if(d!==null)W=!0;else{var ae=n(c);ae!==null&&F(w,ae.startTime-Q),W=!1}}break e}finally{d=null,f=U,h=!1}W=void 0}}finally{W?T():P=!1}}}if(typeof k=="function")T=function(){k(A)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,L=I.port2;I.port1.onmessage=A,T=function(){L.postMessage(null)}}else T=function(){p(A,0)};function F(Q,W){j=p(function(){Q(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Q){Q.callback=null},t.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<Q?Math.floor(1e3/Q):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_next=function(Q){switch(f){case 1:case 2:case 3:var W=3;break;default:W=f}var U=f;f=W;try{return Q()}finally{f=U}},t.unstable_requestPaint=function(){b=!0},t.unstable_runWithPriority=function(Q,W){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var U=f;f=Q;try{return W()}finally{f=U}},t.unstable_scheduleCallback=function(Q,W,U){var X=t.unstable_now();switch(U=typeof U=="object"&&U!==null&&typeof(U=U.delay)=="number"&&0<U?X+U:X,Q){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return Q={id:u++,callback:W,priorityLevel:Q,startTime:U,expirationTime:G=U+G,sortIndex:-1},U>X?(Q.sortIndex=U,e(c,Q),n(l)===null&&Q===n(c)&&(v?(O(j),j=-1):v=!0,F(w,U-X))):(Q.sortIndex=G,e(l,Q),g||h||(g=!0,P||(P=!0,T()))),Q},t.unstable_shouldYield=E,t.unstable_wrapCallback=function(Q){var W=f;return function(){var U=f;f=W;try{return Q.apply(this,arguments)}finally{f=U}}}}(Lee)),Lee)),Qee.exports}var zee,Vee,qee,Fee,YN={exports:{}},Ca={};function o7e(){if(zee)return Ca;zee=1;var t=Yd();function e(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)l+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal"),i=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(s,l){return s==="font"?"":typeof l=="string"?l==="use-credentials"?l:"":void 0}return Ca.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ca.createPortal=function(s,l){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(e(299));return function(u,d,f){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:h==null?null:""+h,children:u,containerInfo:d,implementation:f}}(s,l,null,c)},Ca.flushSync=function(s){var l=i.T,c=r.p;try{if(i.T=null,r.p=2,s)return s()}finally{i.T=l,r.p=c,r.d.f()}},Ca.preconnect=function(s,l){typeof s=="string"&&(l?l=typeof(l=l.crossOrigin)=="string"?l==="use-credentials"?l:"":void 0:l=null,r.d.C(s,l))},Ca.prefetchDNS=function(s){typeof s=="string"&&r.d.D(s)},Ca.preinit=function(s,l){if(typeof s=="string"&&l&&typeof l.as=="string"){var c=l.as,u=a(c,l.crossOrigin),d=typeof l.integrity=="string"?l.integrity:void 0,f=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;c==="style"?r.d.S(s,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:u,integrity:d,fetchPriority:f}):c==="script"&&r.d.X(s,{crossOrigin:u,integrity:d,fetchPriority:f,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},Ca.preinitModule=function(s,l){if(typeof s=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var c=a(l.as,l.crossOrigin);r.d.M(s,{crossOrigin:c,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&r.d.M(s)},Ca.preload=function(s,l){if(typeof s=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var c=l.as,u=a(c,l.crossOrigin);r.d.L(s,c,{crossOrigin:u,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},Ca.preloadModule=function(s,l){if(typeof s=="string")if(l){var c=a(l.as,l.crossOrigin);r.d.m(s,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:c,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else r.d.m(s)},Ca.requestFormReset=function(s){r.d.r(s)},Ca.unstable_batchedUpdates=function(s,l){return s(l)},Ca.useFormState=function(s,l,c){return i.H.useFormState(s,l,c)},Ca.useFormStatus=function(){return i.H.useHostTransitionStatus()},Ca.version="19.1.0",Ca}pM=function(){return Vee||(Vee=1,function t(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE=="function")try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}(),YN.exports=o7e()),YN.exports};function i7e(){if(qee)return tw;qee=1;var t=r7e(),e=Yd(),n=pM();function r(m){var x="https://react.dev/errors/"+m;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)x+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+m+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(m){return!(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)}function i(m){var x=m,C=m;if(m.alternate)for(;x.return;)x=x.return;else{m=x;do 4098&(x=m).flags&&(C=x.return),m=x.return;while(m)}return x.tag===3?C:null}function a(m){if(m.tag===13){var x=m.memoizedState;if(x===null&&(m=m.alternate)!==null&&(x=m.memoizedState),x!==null)return x.dehydrated}return null}function s(m){if(i(m)!==m)throw Error(r(188))}function l(m){var x=m.tag;if(x===5||x===26||x===27||x===6)return m;for(m=m.child;m!==null;){if((x=l(m))!==null)return x;m=m.sibling}return null}var c=Object.assign,u=Symbol.for("react.element"),d=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),p=Symbol.for("react.consumer"),O=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),N=Symbol.iterator;function E(m){return m===null||typeof m!="object"?null:typeof(m=N&&m[N]||m["@@iterator"])=="function"?m:null}var A=Symbol.for("react.client.reference");function I(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===A?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case h:return"Fragment";case v:return"Profiler";case g:return"StrictMode";case S:return"Suspense";case w:return"SuspenseList";case j:return"Activity"}if(typeof m=="object")switch(m.$$typeof){case f:return"Portal";case O:return(m.displayName||"Context")+".Provider";case p:return(m._context.displayName||"Context")+".Consumer";case k:var x=m.render;return(m=m.displayName)||(m=(m=x.displayName||x.name||"")!==""?"ForwardRef("+m+")":"ForwardRef"),m;case T:return(x=m.displayName||null)!==null?x:I(m.type)||"Memo";case P:x=m._payload,m=m._init;try{return I(m(x))}catch{}}return null}var L=Array.isArray,F=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},U=[],X=-1;function G(m){return{current:m}}function ae(m){0>X||(m.current=U[X],U[X]=null,X--)}function ne(m,x){X++,U[X]=m.current,m.current=x}var re=G(null),Z=G(null),K=G(null),oe=G(null);function ie(m,x){switch(ne(K,x),ne(Z,m),ne(re,null),x.nodeType){case 9:case 11:m=(m=x.documentElement)&&(m=m.namespaceURI)?rIe(m):0;break;default:if(m=x.tagName,x=x.namespaceURI)m=oIe(x=rIe(x),m);else switch(m){case"svg":m=1;break;case"math":m=2;break;default:m=0}}ae(re),ne(re,m)}function Y(){ae(re),ae(Z),ae(K)}function le(m){m.memoizedState!==null&&ne(oe,m);var x=re.current,C=oIe(x,m.type);x!==C&&(ne(Z,m),ne(re,C))}function me(m){Z.current===m&&(ae(re),ae(Z)),oe.current===m&&(ae(oe),S_._currentValue=W)}var ce=Object.prototype.hasOwnProperty,ve=t.unstable_scheduleCallback,ye=t.unstable_cancelCallback,_e=t.unstable_shouldYield,Se=t.unstable_requestPaint,Ae=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,nt=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,kt=t.unstable_IdlePriority,Re=t.log,ot=t.unstable_setDisableYieldValue,Me=null,We=null;function it(m){if(typeof Re=="function"&&ot(m),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(Me,m)}catch{}}var Ue=Math.clz32?Math.clz32:function(m){return m>>>=0,m===0?32:31-(gt(m)/Tt|0)|0},gt=Math.log,Tt=Math.LN2,Kt=256,Sn=4194304;function Jt(m){var x=42&m;if(x!==0)return x;switch(m&-m){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194048&m;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&m;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return m}}function sn(m,x,C){var R=m.pendingLanes;if(R===0)return 0;var $=0,V=m.suspendedLanes,J=m.pingedLanes;m=m.warmLanes;var ee=134217727&R;return ee!==0?(R=ee&~V)!==0?$=Jt(R):(J&=ee)!==0?$=Jt(J):C||(C=ee&~m)!==0&&($=Jt(C)):(ee=R&~V)!==0?$=Jt(ee):J!==0?$=Jt(J):C||(C=R&~m)!==0&&($=Jt(C)),$===0?0:x!==0&&x!==$&&(x&V)===0&&((V=$&-$)>=(C=x&-x)||V===32&&4194048&C)?x:$}function jn(m,x){return(m.pendingLanes&~(m.suspendedLanes&~m.pingedLanes)&x)===0}function Zr(m,x){switch(m){case 1:case 2:case 4:case 8:case 64:return x+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return x+5e3;default:return-1}}function Nr(){var m=Kt;return!(4194048&(Kt<<=1))&&(Kt=256),m}function go(){var m=Sn;return!(62914560&(Sn<<=1))&&(Sn=4194304),m}function Pi(m){for(var x=[],C=0;31>C;C++)x.push(m);return x}function Xr(m,x){m.pendingLanes|=x,x!==268435456&&(m.suspendedLanes=0,m.pingedLanes=0,m.warmLanes=0)}function at(m,x,C){m.pendingLanes|=x,m.suspendedLanes&=~x;var R=31-Ue(x);m.entangledLanes|=x,m.entanglements[R]=1073741824|m.entanglements[R]|4194090&C}function Ne(m,x){var C=m.entangledLanes|=x;for(m=m.entanglements;C;){var R=31-Ue(C),$=1<<R;$&x|m[R]&x&&(m[R]|=x),C&=~$}}function vt(m){switch(m){case 2:m=1;break;case 8:m=4;break;case 32:m=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:m=128;break;case 268435456:m=134217728;break;default:m=0}return m}function Mt(m){return 2<(m&=-m)?8<m?134217727&m?32:268435456:8:2}function Dt(){var m=Q.p;return m!==0?m:(m=window.event)===void 0?32:kIe(m.type)}var vn=Math.random().toString(36).slice(2),zt="__reactFiber$"+vn,Dn="__reactProps$"+vn,dn="__reactContainer$"+vn,bn="__reactEvents$"+vn,sr="__reactListeners$"+vn,wn="__reactHandles$"+vn,Co="__reactResources$"+vn,se="__reactMarker$"+vn;function St(m){delete m[zt],delete m[Dn],delete m[bn],delete m[sr],delete m[wn]}function Ge(m){var x=m[zt];if(x)return x;for(var C=m.parentNode;C;){if(x=C[dn]||C[zt]){if(C=x.alternate,x.child!==null||C!==null&&C.child!==null)for(m=lIe(m);m!==null;){if(C=m[zt])return C;m=lIe(m)}return x}C=(m=C).parentNode}return null}function qt(m){if(m=m[zt]||m[dn]){var x=m.tag;if(x===5||x===6||x===13||x===26||x===27||x===3)return m}return null}function Pt(m){var x=m.tag;if(x===5||x===26||x===27||x===6)return m.stateNode;throw Error(r(33))}function xr(m){var x=m[Co];return x||(x=m[Co]={hoistableStyles:new Map,hoistableScripts:new Map}),x}function Or(m){m[se]=!0}var Vn=new Set,nn={};function gc(m,x){mi(m,x),mi(m+"Capture",x)}function mi(m,x){for(nn[m]=x,m=0;m<x.length;m++)Vn.add(x[m])}var tr,gv,vv=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Cm={},sx={};function yv(m,x,C){if($=x,ce.call(sx,$)||!ce.call(Cm,$)&&(vv.test($)?sx[$]=!0:(Cm[$]=!0,0)))if(C===null)m.removeAttribute(x);else{switch(typeof C){case"undefined":case"function":case"symbol":return void m.removeAttribute(x);case"boolean":var R=x.toLowerCase().slice(0,5);if(R!=="data-"&&R!=="aria-")return void m.removeAttribute(x)}m.setAttribute(x,""+C)}var $}function pu(m,x,C){if(C===null)m.removeAttribute(x);else{switch(typeof C){case"undefined":case"function":case"symbol":case"boolean":return void m.removeAttribute(x)}m.setAttribute(x,""+C)}}function mu(m,x,C,R){if(R===null)m.removeAttribute(C);else{switch(typeof R){case"undefined":case"function":case"symbol":case"boolean":return void m.removeAttribute(C)}m.setAttributeNS(x,C,""+R)}}function qd(m){if(tr===void 0)try{throw Error()}catch(C){var x=C.stack.trim().match(/\n( *(at )?)/);tr=x&&x[1]||"",gv=-1<C.stack.indexOf(`
|
3
3
|
at`)?" (<anonymous>)":-1<C.stack.indexOf("@")?"@unknown:0:0":""}return`
|
4
4
|
`+tr+m+gv}var _m=!1;function lx(m,x){if(!m||_m)return"";_m=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var R={DetermineComponentFrameRoot:function(){try{if(x){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(rt){var Je=rt}Reflect.construct(m,[],ze)}else{try{ze.call()}catch(rt){Je=rt}m.call(ze.prototype)}}else{try{throw Error()}catch(rt){Je=rt}(ze=m())&&typeof ze.catch=="function"&&ze.catch(function(){})}}catch(rt){if(rt&&Je&&typeof rt.stack=="string")return[rt.stack,Je.stack]}return[null,null]}};R.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var $=Object.getOwnPropertyDescriptor(R.DetermineComponentFrameRoot,"name");$&&$.configurable&&Object.defineProperty(R.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var V=R.DetermineComponentFrameRoot(),J=V[0],ee=V[1];if(J&&ee){var he=J.split(`
|
@@ -214,7 +214,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
214
214
|
| # alternate
|
215
215
|
(?:\\x07) # BEL (what xterm did)
|
216
216
|
)
|
217
|
-
`]))));let i=this._buffer.match(this._osc_regex);return i===null?(t.kind=ao.ESC,t.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),t):(t.kind=ao.OSCURL,t.url=i[1],t.text=i[2],o=i[0].length,this._buffer=this._buffer.slice(o),t)}if(r=="(")return t.kind=ao.Unknown,this._buffer=this._buffer.slice(3),t}}ansi_to_html(t){this.append_buffer(t);for(var e=[];;){var n=this.get_next_packet();if(n.kind==ao.EOS||n.kind==ao.Incomplete)break;n.kind!=ao.ESC&&n.kind!=ao.Unknown&&(n.kind==ao.Text?e.push(this.transform_to_html(this.with_state(n))):n.kind==ao.SGR?this.process_ansi(n):n.kind==ao.OSCURL&&e.push(this.process_hyperlink(n)))}return e.join("")}with_state(t){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:t.text}}process_ansi(t){let e=t.text.split(";");for(;e.length>0;){let n=e.shift(),r=parseInt(n,10);if(isNaN(r)||r===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(r===1)this.bold=!0;else if(r===2)this.faint=!0;else if(r===3)this.italic=!0;else if(r===4)this.underline=!0;else if(r===21)this.bold=!1;else if(r===22)this.faint=!1,this.bold=!1;else if(r===23)this.italic=!1;else if(r===24)this.underline=!1;else if(r===39)this.fg=null;else if(r===49)this.bg=null;else if(r>=30&&r<38)this.fg=this.ansi_colors[0][r-30];else if(r>=40&&r<48)this.bg=this.ansi_colors[0][r-40];else if(r>=90&&r<98)this.fg=this.ansi_colors[1][r-90];else if(r>=100&&r<108)this.bg=this.ansi_colors[1][r-100];else if((r===38||r===48)&&e.length>0){let o=r===38,i=e.shift();if(i==="5"&&e.length>0){let a=parseInt(e.shift(),10);a>=0&&a<=255&&(o?this.fg=this.palette_256[a]:this.bg=this.palette_256[a])}if(i==="2"&&e.length>2){let a=parseInt(e.shift(),10),s=parseInt(e.shift(),10),l=parseInt(e.shift(),10);if(a>=0&&a<=255&&s>=0&&s<=255&&l>=0&&l<=255){let c={rgb:[a,s,l],class_name:"truecolor"};o?this.fg=c:this.bg=c}}}}}transform_to_html(t){let e=t.text;if(e.length===0||(e=this.escape_txt_for_html(e),!(t.bold||t.italic||t.faint||t.underline||t.fg!==null||t.bg!==null)))return e;let n=[],r=[],o=t.fg,i=t.bg;t.bold&&n.push(this._boldStyle),t.faint&&n.push(this._faintStyle),t.italic&&n.push(this._italicStyle),t.underline&&n.push(this._underlineStyle),this._use_classes?(o&&(o.class_name!=="truecolor"?r.push(`${o.class_name}-fg`):n.push(`color:rgb(${o.rgb.join(",")})`)),i&&(i.class_name!=="truecolor"?r.push(`${i.class_name}-bg`):n.push(`background-color:rgb(${i.rgb.join(",")})`))):(o&&n.push(`color:rgb(${o.rgb.join(",")})`),i&&n.push(`background-color:rgb(${i.rgb})`));let a="",s="";return r.length&&(a=` class="${r.join(" ")}"`),n.length&&(s=` style="${n.join(";")}"`),`<span${s}${a}>${e}</span>`}process_hyperlink(t){let e=t.url.split(":");return e.length<1?"":this._url_allowlist[e[0]]?`<a href="${this.escape_txt_for_html(t.url)}">${this.escape_txt_for_html(t.text)}</a>`:""}};function o1e(t,...e){let n=t.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(n)}const JGe=new KY,eKe=t=>{const e=ue.c(13),{text:n,channel:r,wrapText:o}=t,i=r==="stdout"||r==="stderr";let a;e[0]!==o?(a=h=>y.jsx("span",{className:o?"whitespace-pre-wrap break-words":"whitespace-pre",dangerouslySetInnerHTML:{__html:JGe.ansi_to_html(h)}}),e[0]=o,e[1]=a):a=e[1];const s=a,l=!i&&(o?"whitespace-pre-wrap break-words":"whitespace-pre"),c=r==="output"&&"font-prose";let u,d,f;return e[2]!==r||e[3]!==l||e[4]!==c?(u=we(l,c,r),e[2]=r,e[3]=l,e[4]=c,e[5]=u):u=e[5],e[6]!==s||e[7]!==i||e[8]!==n?(d=i?s(n):n,e[6]=s,e[7]=i,e[8]=n,e[9]=d):d=e[9],e[10]!==u||e[11]!==d?(f=y.jsx("span",{className:u,children:d}),e[10]=u,e[11]=d,e[12]=f):f=e[12],f},i1e={};pG=function(t){return t==null||t.data==null||t.data===""},SN=_.lazy(()=>Be(()=>import("./any-language-editor-BSVElZ54.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url));var s9="rovingFocusGroup.onEntryFocus",tKe={bubbles:!1,cancelable:!0},OS="RovingFocusGroup",[l9,a1e,nKe]=Lp(OS),[rKe,X1]=Wo(OS,[nKe]),[oKe,iKe]=rKe(OS),s1e=_.forwardRef((t,e)=>y.jsx(l9.Provider,{scope:t.__scopeRovingFocusGroup,children:y.jsx(l9.Slot,{scope:t.__scopeRovingFocusGroup,children:y.jsx(aKe,{...t,ref:e})})}));s1e.displayName=OS;var aKe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=_.useRef(null),h=ln(e,f),g=yf(i),[v,b]=Ao({prop:a,defaultProp:s??null,onChange:l,caller:OS}),[p,O]=_.useState(!1),k=Lo(c),S=a1e(n),w=_.useRef(!1),[T,P]=_.useState(0);return _.useEffect(()=>{const j=f.current;if(j)return j.addEventListener(s9,k),()=>j.removeEventListener(s9,k)},[k]),y.jsx(oKe,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:_.useCallback(j=>b(j),[b]),onItemShiftTab:_.useCallback(()=>O(!0),[]),onFocusableItemAdd:_.useCallback(()=>P(j=>j+1),[]),onFocusableItemRemove:_.useCallback(()=>P(j=>j-1),[]),children:y.jsx(_t.div,{tabIndex:p||T===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:ut(t.onMouseDown,()=>{w.current=!0}),onFocus:ut(t.onFocus,j=>{const D=!w.current;if(j.target===j.currentTarget&&D&&!p){const N=new CustomEvent(s9,tKe);if(j.currentTarget.dispatchEvent(N),!N.defaultPrevented){const E=S().filter(A=>A.focusable);u1e([E.find(A=>A.active),E.find(A=>A.id===v),...E].filter(Boolean).map(A=>A.ref.current),u)}}w.current=!1}),onBlur:ut(t.onBlur,()=>O(!1))})})}),l1e="RovingFocusGroupItem",c1e=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:a,...s}=t,l=Do(),c=i||l,u=iKe(l1e,n),d=u.currentTabStopId===c,f=a1e(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=u;return _.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),y.jsx(l9.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:y.jsx(_t.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:e,onMouseDown:ut(t.onMouseDown,b=>{r?u.onItemFocus(c):b.preventDefault()}),onFocus:ut(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:ut(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey)return void u.onItemShiftTab();if(b.target!==b.currentTarget)return;const p=function(O,k,S){const w=function(T,P){return P!=="rtl"?T:T==="ArrowLeft"?"ArrowRight":T==="ArrowRight"?"ArrowLeft":T}(O.key,S);return k==="vertical"&&["ArrowLeft","ArrowRight"].includes(w)||k==="horizontal"&&["ArrowUp","ArrowDown"].includes(w)?void 0:sKe[w]}(b,u.orientation,u.dir);if(p!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let O=f().filter(k=>k.focusable).map(k=>k.ref.current);if(p==="last")O.reverse();else if(p==="prev"||p==="next"){p==="prev"&&O.reverse();const k=O.indexOf(b.currentTarget);O=u.loop?function(S,w){return S.map((T,P)=>S[(w+P)%S.length])}(O,k+1):O.slice(k+1)}setTimeout(()=>u1e(O))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:v!=null}):a})})});c1e.displayName=l1e;var sKe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function u1e(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}var c9=s1e,u9=c1e,X3="Tabs",[lKe,Ayt]=Wo(X3,[X1]),d1e=X1(),[cKe,d9]=lKe(X3),f1e=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=t,u=yf(s),[d,f]=Ao({prop:r,onChange:o,defaultProp:i??"",caller:X3});return y.jsx(cKe,{scope:n,baseId:Do(),value:d,onValueChange:f,orientation:a,dir:u,activationMode:l,children:y.jsx(_t.div,{dir:u,"data-orientation":a,...c,ref:e})})});f1e.displayName=X3;var h1e="TabsList",p1e=_.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,i=d9(h1e,n),a=d1e(n);return y.jsx(c9,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:y.jsx(_t.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:e})})});p1e.displayName=h1e;var m1e="TabsTrigger",g1e=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=t,a=d9(m1e,n),s=d1e(n),l=b1e(a.baseId,r),c=x1e(a.baseId,r),u=r===a.value;return y.jsx(u9,{asChild:!0,...s,focusable:!o,active:u,children:y.jsx(_t.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:e,onMouseDown:ut(t.onMouseDown,d=>{o||d.button!==0||d.ctrlKey!==!1?d.preventDefault():a.onValueChange(r)}),onKeyDown:ut(t.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:ut(t.onFocus,()=>{const d=a.activationMode!=="manual";u||o||!d||a.onValueChange(r)})})})});g1e.displayName=m1e;var v1e="TabsContent",y1e=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=t,s=d9(v1e,n),l=b1e(s.baseId,r),c=x1e(s.baseId,r),u=r===s.value,d=_.useRef(u);return _.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),y.jsx(Uo,{present:o||u,children:({present:f})=>y.jsx(_t.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});function b1e(t,e){return`${t}-trigger-${e}`}function x1e(t,e){return`${t}-content-${e}`}y1e.displayName=v1e;var O1e=p1e,w1e=g1e,k1e=y1e;sg=f1e,Kh=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("inline-flex max-h-14 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(O1e,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),Kh.displayName=O1e.displayName,Hs=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(w1e,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),Hs.displayName=w1e.displayName;const ec=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(k1e,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});ec.displayName=k1e.displayName;var H3="Popover",[S1e,Myt]=Wo(H3,[Ap]),wS=Ap(),[uKe,Hp]=S1e(H3),C1e=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=t,s=wS(e),l=_.useRef(null),[c,u]=_.useState(!1),[d,f]=Ao({prop:r,defaultProp:o??!1,onChange:i,caller:H3});return y.jsx(ek,{...s,children:y.jsx(uKe,{scope:e,contentId:Do(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:a,children:n})})};C1e.displayName=H3;let f9;f9="PopoverAnchor",HM=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Hp(f9,n),i=wS(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return _.useEffect(()=>(a(),()=>s()),[a,s]),y.jsx(tk,{...i,...r,ref:e})}),HM.displayName=f9;var _1e="PopoverTrigger",T1e=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Hp(_1e,n),i=wS(n),a=ln(e,o.triggerRef),s=y.jsx(_t.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":D1e(o.open),...r,ref:a,onClick:ut(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:y.jsx(tk,{asChild:!0,...i,children:s})});T1e.displayName=_1e;var h9="PopoverPortal",[dKe,fKe]=S1e(h9,{forceMount:void 0}),P1e=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,i=Hp(h9,e);return y.jsx(dKe,{scope:e,forceMount:n,children:y.jsx(Uo,{present:n||i.open,children:y.jsx(zg,{asChild:!0,container:o,children:r})})})};P1e.displayName=h9;var H1="PopoverContent",E1e=_.forwardRef((t,e)=>{const n=fKe(H1,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,i=Hp(H1,t.__scopePopover);return y.jsx(Uo,{present:r||i.open,children:i.modal?y.jsx(pKe,{...o,ref:e}):y.jsx(mKe,{...o,ref:e})})});E1e.displayName=H1;var hKe=pp("PopoverContent.RemoveScroll"),pKe=_.forwardRef((t,e)=>{const n=Hp(H1,t.__scopePopover),r=_.useRef(null),o=ln(e,r),i=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return WR(a)},[]),y.jsx(Mk,{as:hKe,allowPinchZoom:!0,children:y.jsx(R1e,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ut(t.onCloseAutoFocus,a=>{var s;a.preventDefault(),i.current||((s=n.triggerRef.current)==null||s.focus())}),onPointerDownOutside:ut(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ut(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),mKe=_.forwardRef((t,e)=>{const n=Hp(H1,t.__scopePopover),r=_.useRef(!1),o=_.useRef(!1);return y.jsx(R1e,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||((s=n.triggerRef.current)==null||s.focus()),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),R1e=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=t,f=Hp(H1,n),h=wS(n);return IR(),y.jsx(Ak,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:y.jsx(Rp,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:y.jsx(DE,{"data-state":D1e(f.open),role:"dialog",id:f.contentId,...h,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),j1e="PopoverClose",p9=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Hp(j1e,n);return y.jsx(_t.button,{type:"button",...r,ref:e,onClick:ut(t.onClick,()=>o.onOpenChange(!1))})});p9.displayName=j1e;var gKe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=wS(n);return y.jsx(AE,{...o,...r,ref:e})});function D1e(t){return t?"open":"closed"}gKe.displayName="PopoverArrow";var vKe=C1e,yKe=T1e,bKe=P1e,A1e=E1e,xKe=p9;const m9={},kS={};function SS(t,e){try{const n=(m9[t]||(m9[t]=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format))(e).split("GMT")[1]||"";return n in kS?kS[n]:M1e(n,n.split(":"))}catch{if(t in kS)return kS[t];const n=t==null?void 0:t.match(OKe);return n?M1e(t,n.slice(1)):NaN}}const OKe=/([+-]\d\d):?(\d\d)?/;function M1e(t,e){const n=+e[0],r=+(e[1]||0);return kS[t]=n>0?60*n+r:60*n-r}class yd extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(SS(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),$1e(this),g9(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new yd(...n,e):new yd(Date.now(),e)}withTimeZone(e){return new yd(+this,e)}getTimezoneOffset(){return-SS(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),g9(this),+this}[Symbol.for("constructDateFrom")](e){return new yd(+new Date(e),this.timeZone)}}const N1e=/^(get|set)(?!UTC)/;function g9(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function $1e(t){const e=SS(t.timeZone,t),n=new Date(+t);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+t).getTimezoneOffset(),o=r- -new Date(+n).getTimezoneOffset(),i=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();o&&i&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+o);const a=r-e;a&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+a);const s=SS(t.timeZone,t),l=-new Date(+t).getTimezoneOffset()-s-a;if(s!==e&&l){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+l);const c=s-SS(t.timeZone,t);c&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+c),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c))}}Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!N1e.test(t))return;const e=t.replace(N1e,"$1UTC");yd.prototype[e]&&(t.startsWith("get")?yd.prototype[t]=function(){return this.internal[e]()}:(yd.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),function(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),$1e(n)}(this),+this},yd.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),g9(this),+this}))});class Y1 extends yd{static tz(e,...n){return n.length?new Y1(...n,e):new Y1(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),o=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,r,o]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${e} GMT${n}${r}${o} (${function(i,a){return new Intl.DateTimeFormat("en-GB",{timeZone:i,timeZoneName:"long"}).format(a).slice(12)}(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new Y1(+this,e)}[Symbol.for("constructDateFrom")](e){return new Y1(+new Date(e),this.timeZone)}}let v9,y9;v9=6048e5,L6e=43200,Q6e=1440,y9=Symbol.for("constructDateFrom"),hf=function(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&y9 in t?t[y9](e):t instanceof Date?new t.constructor(e):new Date(e)},Ks=function(t,e){return hf(e||t,t)};let wKe={};TO=function(){return wKe};function CS(t,e){var s,l,c,u;const n=TO(),r=(e==null?void 0:e.weekStartsOn)??((l=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ks(t,e==null?void 0:e.in),i=o.getDay(),a=(i<r?7:0)+i-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function Y3(t,e){return CS(t,{...e,weekStartsOn:1})}function I1e(t,e){const n=Ks(t,e==null?void 0:e.in),r=n.getFullYear(),o=hf(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=Y3(o),a=hf(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const s=Y3(a);return n.getTime()>=i.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}$M=function(t){const e=Ks(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n},GG=function(t,...e){const n=hf.bind(null,e.find(r=>typeof r=="object"));return e.map(n)};function Q1e(t,e){const n=Ks(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}MH=function(t){return!(!((e=t)instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")&&typeof t!="number"||isNaN(+Ks(t)));var e};const kKe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function b9(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const SKe={date:b9({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:b9({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:b9({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},CKe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function _S(t){return(e,n)=>{let r;if((n!=null&&n.context?String(n.context):"standalone")==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,i=n!=null&&n.width?String(n.width):o;r=t.formattingValues[i]||t.formattingValues[o]}else{const o=t.defaultWidth,i=n!=null&&n.width?String(n.width):t.defaultWidth;r=t.values[i]||t.values[o]}return r[t.argumentCallback?t.argumentCallback(e):e]}}const _Ke={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:_S({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:_S({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:_S({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:_S({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:_S({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function TS(t){return(e,n={})=>{const r=n.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(o);if(!i)return null;const a=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(s)?function(u,d){for(let f=0;f<u.length;f++)if(d(u[f]))return f}(s,u=>u.test(a)):function(u,d){for(const f in u)if(Object.prototype.hasOwnProperty.call(u,f)&&d(u[f]))return f}(s,u=>u.test(a));let c;return c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:e.slice(a.length)}}}const TKe={ordinalNumber:(PS={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(PS.matchPattern);if(!n)return null;const r=n[0],o=t.match(PS.parsePattern);if(!o)return null;let i=PS.valueCallback?PS.valueCallback(o[0]):o[0];return i=e.valueCallback?e.valueCallback(i):i,{value:i,rest:t.slice(r.length)}}),era:TS({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:TS({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:TS({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:TS({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:TS({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var PS;tK={code:"en-US",formatDistance:(t,e,n)=>{let r;const o=kKe[t];return r=typeof o=="string"?o:e===1?o.one:o.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:SKe,formatRelative:(t,e,n,r)=>CKe[t],localize:_Ke,match:TKe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PKe(t,e){const n=Ks(t,e==null?void 0:e.in);return function(o,i){const[a,s]=GG(0,o,i),l=Q1e(a),c=Q1e(s),u=+l-$M(l),d=+c-$M(c);return Math.round((u-d)/864e5)}(n,function(o,i){const a=Ks(o,i==null?void 0:i.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}(n))+1}function EKe(t,e){const n=Ks(t,e==null?void 0:e.in),r=+Y3(n)-+function(o,i){const a=I1e(o,i),s=hf(o,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),Y3(s)}(n);return Math.round(r/v9)+1}function L1e(t,e){var u,d,f,h;const n=Ks(t,e==null?void 0:e.in),r=n.getFullYear(),o=TO(),i=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,a=hf((e==null?void 0:e.in)||t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const s=CS(a,e),l=hf((e==null?void 0:e.in)||t,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=CS(l,e);return+n>=+s?r+1:+n>=+c?r:r-1}function RKe(t,e){const n=Ks(t,e==null?void 0:e.in),r=+CS(n,e)-+function(o,i){var u,d,f,h;const a=TO(),s=(i==null?void 0:i.firstWeekContainsDate)??((d=(u=i==null?void 0:i.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((h=(f=a.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,l=L1e(o,i),c=hf((i==null?void 0:i.in)||o,0);return c.setFullYear(l,0,s),c.setHours(0,0,0,0),CS(c,i)}(n,e);return Math.round(r/v9)+1}function Lr(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const Yp={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Lr(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Lr(n+1,2)},d:(t,e)=>Lr(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h:(t,e)=>Lr(t.getHours()%12||12,e.length),H:(t,e)=>Lr(t.getHours(),e.length),m:(t,e)=>Lr(t.getMinutes(),e.length),s:(t,e)=>Lr(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return Lr(Math.trunc(r*Math.pow(10,n-3)),e.length)}},jKe="midnight",DKe="noon",AKe="morning",MKe="afternoon",NKe="evening",$Ke="night",z1e={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Yp.y(t,e)},Y:function(t,e,n,r){const o=L1e(t,r),i=o>0?o:1-o;return e==="YY"?Lr(i%100,2):e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Lr(i,e.length)},R:function(t,e){return Lr(I1e(t),e.length)},u:function(t,e){return Lr(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Lr(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Lr(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Yp.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Lr(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const o=RKe(t,r);return e==="wo"?n.ordinalNumber(o,{unit:"week"}):Lr(o,e.length)},I:function(t,e,n){const r=EKe(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Lr(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Yp.d(t,e)},D:function(t,e,n){const r=PKe(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Lr(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const o=t.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Lr(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const o=t.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Lr(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),o=r===0?7:r;switch(e){case"i":return String(o);case"ii":return Lr(o,e.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let o;switch(o=r===12?DKe:r===0?jKe:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let o;switch(o=r>=17?NKe:r>=12?MKe:r>=4?AKe:$Ke,e){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Yp.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Yp.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Lr(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Lr(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Yp.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Yp.s(t,e)},S:function(t,e){return Yp.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return q1e(r);case"XXXX":case"XX":return f0(r);default:return f0(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return q1e(r);case"xxxx":case"xx":return f0(r);default:return f0(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+V1e(r,":");default:return"GMT"+f0(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+V1e(r,":");default:return"GMT"+f0(r,":")}},t:function(t,e,n){return Lr(Math.trunc(+t/1e3),e.length)},T:function(t,e,n){return Lr(+t,e.length)}};function V1e(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+e+Lr(i,2)}function q1e(t,e){return t%60==0?(t>0?"-":"+")+Lr(Math.abs(t)/60,2):f0(t,e)}function f0(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+Lr(Math.trunc(r/60),2)+e+Lr(r%60,2)}const F1e=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},B1e=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},IKe={p:B1e,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return F1e(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",F1e(r,e)).replace("{{time}}",B1e(o,e))}},QKe=/^D+$/,LKe=/^Y+$/,zKe=["D","DD","YY","YYYY"],VKe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qKe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FKe=/^'([^]*?)'?$/,BKe=/''/g,WKe=/[a-zA-Z]/;function x9(t,e,n){var u,d,f,h;const r=TO(),o=r.locale??tK,i=r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,s=Ks(t,n==null?void 0:n.in);if(!MH(s))throw new RangeError("Invalid time value");let l=e.match(qKe).map(g=>{const v=g[0];return v==="p"||v==="P"?(0,IKe[v])(g,o.formatLong):g}).join("").match(VKe).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const v=g[0];if(v==="'")return{isToken:!1,value:UKe(g)};if(z1e[v])return{isToken:!0,value:g};if(v.match(WKe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:g}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const c={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return l.map(g=>{if(!g.isToken)return g.value;const v=g.value;return(function(b){return LKe.test(b)}(v)||function(b){return QKe.test(b)}(v))&&function(b,p,O){const k=function(S,w,T){const P=S[0]==="Y"?"years":"days of the month";return`Use \`${S.toLowerCase()}\` instead of \`${S}\` (in \`${w}\`) for formatting ${P} to the input \`${T}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(b,p,O);if(console.warn(k),zKe.includes(b))throw new RangeError(k)}(v,e,String(t)),(0,z1e[v[0]])(s,v,o.localize,c)}).join("")}function UKe(t){const e=t.match(FKe);return e?e[1].replace(BKe,"'"):t}function ZKe(t,e){if(t==null)return"";try{return e==="date"?new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}):new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch(n){return Ve.warn("Failed to parse date",n),t.toString()}}function XKe(t,e){const n=t.getUTCMilliseconds()!==0;try{if(e){const r=new Y1(t,e),o=function(i){var a;try{return((a=new Intl.DateTimeFormat("en-US",{timeZone:i,timeZoneName:"short"}).formatToParts(new Date).find(l=>l.type==="timeZoneName"))==null?void 0:a.value)??""}catch(s){return Ve.warn("Failed to get abbrev",s),i}}(e);return n?`${x9(r,"yyyy-MM-dd HH:mm:ss.SSS")} ${o}`:`${x9(r,"yyyy-MM-dd HH:mm:ss")} ${o}`}return x9(t,n?"yyyy-MM-dd HH:mm:ss.SSS":"yyyy-MM-dd HH:mm:ss")}catch(r){return Ve.warn("Failed to parse date",r),t.toISOString()}}qIe=function(t){if(t==null||t===0)return"";try{const e=new Date(t),n=new Date,r=new Date;return r.setDate(r.getDate()-1),e.toDateString()===n.toDateString()?`Today at ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"numeric"})}`:e.toDateString()===r.toDateString()?`Yesterday at ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"numeric"})}`:`${e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})} at ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"numeric"})}`}catch(e){Ve.warn("Failed to parse date",e)}return t.toString()};let G3;Vv={keyBy(t,e){const n=new Map,r=new Set;for(const o of t){const i=e(o);n.has(i)&&r.add(i),n.set(i,o)}return r.size>0&&Ve.trace(`Duplicate keys: ${[...r].join(", ")}`),n},collect:(t,e,n)=>Vv.mapValues(Vv.keyBy(t,e),n),filterMap(t,e){const n=new Map;for(const[r,o]of t)e(o,r)&&n.set(r,o);return n},mapValues(t,e){const n=new Map;for(const[r,o]of t)n.set(r,e(o,r));return n}},G3=t=>{const e=ue.c(6),{container:n,children:r}=t;let o;e:{if(!n){let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=z6({key:"mo",prepend:!0}),e[0]=l):l=e[0],o=l;break e}let s;if(e[1]!==n){let l=n.querySelector("style");l||(l=document.createElement("style"),n.append(l)),s=z6({key:"mo",prepend:!0,container:l}),e[1]=n,e[2]=s}else s=e[2];o=s}const i=o;let a;return e[3]!==i||e[4]!==r?(a=y.jsx(tWe,{value:i,children:r}),e[3]=i,e[4]=r,e[5]=a):a=e[5],a};function G1(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var K3="Checkbox",[HKe,Nyt]=Wo(K3),[YKe,O9]=HKe(K3);function GKe(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:i,form:a,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,h]=Ao({prop:n,defaultProp:o??!1,onChange:l,caller:K3}),[g,v]=_.useState(null),[b,p]=_.useState(null),O=_.useRef(!1),k=!g||!!a||!!g.closest("form"),S={checked:f,disabled:i,setChecked:h,control:g,setControl:v,name:s,form:a,value:u,hasConsumerStoppedPropagationRef:O,required:c,defaultChecked:!Gp(o)&&o,isFormControl:k,bubbleInput:b,setBubbleInput:p};return y.jsx(YKe,{scope:e,...S,children:KKe(d)?d(S):r})}var W1e="CheckboxTrigger",U1e=_.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},o)=>{const{control:i,value:a,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:g}=O9(W1e,t),v=ln(o,u),b=_.useRef(l);return _.useEffect(()=>{const p=i==null?void 0:i.form;if(p){const O=()=>d(b.current);return p.addEventListener("reset",O),()=>p.removeEventListener("reset",O)}},[i,d]),y.jsx(_t.button,{type:"button",role:"checkbox","aria-checked":Gp(l)?"mixed":l,"aria-required":c,"data-state":G1e(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:v,onKeyDown:ut(e,p=>{p.key==="Enter"&&p.preventDefault()}),onClick:ut(n,p=>{d(O=>!!Gp(O)||!O),g&&h&&(f.current=p.isPropagationStopped(),f.current||p.stopPropagation())})})});U1e.displayName=W1e;var w9=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=t;return y.jsx(GKe,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>y.jsxs(y.Fragment,{children:[y.jsx(U1e,{...d,ref:e,__scopeCheckbox:n}),f&&y.jsx(Y1e,{__scopeCheckbox:n})]})})});w9.displayName=K3;var Z1e="CheckboxIndicator",X1e=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...o}=t,i=O9(Z1e,n);return y.jsx(Uo,{present:r||Gp(i.checked)||i.checked===!0,children:y.jsx(_t.span,{"data-state":G1e(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:e,style:{pointerEvents:"none",...t.style}})})});X1e.displayName=Z1e;var H1e="CheckboxBubbleInput",Y1e=_.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:i,defaultChecked:a,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:h}=O9(H1e,t),g=ln(n,h),v=G1(i),b=Jw(r);_.useEffect(()=>{const O=f;if(!O)return;const k=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(k,"checked").set,w=!o.current;if(v!==i&&S){const T=new Event("click",{bubbles:w});O.indeterminate=Gp(i),S.call(O,!Gp(i)&&i),O.dispatchEvent(T)}},[f,v,i,o]);const p=_.useRef(!Gp(i)&&i);return y.jsx(_t.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??p.current,required:s,disabled:l,name:c,value:u,form:d,...e,tabIndex:-1,ref:g,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function KKe(t){return typeof t=="function"}function Gp(t){return t==="indeterminate"}function G1e(t){return Gp(t)?"indeterminate":t?"checked":"unchecked"}Y1e.displayName=H1e,Tl=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r),n[3]=r,n[4]=i):i=n[4],n[5]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(X1e,{className:we("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:y.jsx(rg,{className:"h-4 w-4"})}),n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==i?(s=y.jsx(w9,{ref:e,className:i,...o,children:a}),n[6]=o,n[7]=e,n[8]=i,n[9]=s):s=n[9],s}),Tl.displayName=w9.displayName;let K1e,J1e;dg=vKe,sy=yKe,K1e=ey(bKe),J1e=xKe,tp=_.forwardRef((t,e)=>{const n=ue.c(22);let r,o,i,a,s,l;n[0]!==t?({className:r,align:i,sideOffset:a,portal:s,scrollable:l,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a,n[5]=s,n[6]=l):(r=n[1],o=n[2],i=n[3],a=n[4],s=n[5],l=n[6]);const c=i===void 0?"center":i,u=a===void 0?4:a,d=s===void 0||s,f=l!==void 0&&l,h=f&&"overflow-auto";let g;n[7]!==r||n[8]!==h?(g=we("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r,h),n[7]=r,n[8]=h,n[9]=g):g=n[9];const v=f?"calc(var(--radix-popover-content-available-height) - 30px)":void 0;let b,p;n[10]!==o.style||n[11]!==v?(b={...o.style,maxHeight:v},n[10]=o.style,n[11]=v,n[12]=b):b=n[12],n[13]!==c||n[14]!==o||n[15]!==e||n[16]!==u||n[17]!==g||n[18]!==b?(p=y.jsx(lf,{children:y.jsx(A1e,{ref:e,align:c,sideOffset:u,className:g,style:b,...o})}),n[13]=c,n[14]=o,n[15]=e,n[16]=u,n[17]=g,n[18]=b,n[19]=p):p=n[19];const O=p;if(d){let k;return n[20]!==O?(k=y.jsx(K1e,{children:O}),n[20]=O,n[21]=k):k=n[21],k}return O}),tp.displayName=A1e.displayName;let J3,k9,ebe,tbe,nbe,K1,J1,rbe,obe,Kp,eb,S9,C9,Kf,ibe,tb,_9;J3=["Enter"," "],k9=["ArrowUp","PageDown","End"],ebe=["ArrowDown","PageUp","Home",...k9],tbe={ltr:[...J3,"ArrowRight"],rtl:[...J3,"ArrowLeft"]},nbe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},K1="Menu",[J1,rbe,obe]=Lp(K1),[Kp,lN]=Wo(K1,[obe,Ap,X1]),eb=Ap(),S9=X1(),[C9,Kf]=Kp(K1),[ibe,tb]=Kp(K1),_9=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=t,s=eb(e),[l,c]=_.useState(null),u=_.useRef(!1),d=Lo(i),f=yf(o);return _.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),y.jsx(ek,{...s,children:y.jsx(C9,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c,children:y.jsx(ibe,{scope:e,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})},_9.displayName=K1;var T9=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=eb(n);return y.jsx(tk,{...o,...r,ref:e})});T9.displayName="MenuAnchor";var P9="MenuPortal",[JKe,abe]=Kp(P9,{forceMount:void 0}),sbe=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=Kf(P9,e);return y.jsx(JKe,{scope:e,forceMount:n,children:y.jsx(Uo,{present:n||i.open,children:y.jsx(zg,{asChild:!0,container:o,children:r})})})};sbe.displayName=P9;var tc="MenuContent",[eJe,E9]=Kp(tc),lbe=_.forwardRef((t,e)=>{const n=abe(tc,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=Kf(tc,t.__scopeMenu),a=tb(tc,t.__scopeMenu);return y.jsx(J1.Provider,{scope:t.__scopeMenu,children:y.jsx(Uo,{present:r||i.open,children:y.jsx(J1.Slot,{scope:t.__scopeMenu,children:a.modal?y.jsx(tJe,{...o,ref:e}):y.jsx(nJe,{...o,ref:e})})})})}),tJe=_.forwardRef((t,e)=>{const n=Kf(tc,t.__scopeMenu),r=_.useRef(null),o=ln(e,r);return _.useEffect(()=>{const i=r.current;if(i)return WR(i)},[]),y.jsx(R9,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ut(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),nJe=_.forwardRef((t,e)=>{const n=Kf(tc,t.__scopeMenu);return y.jsx(R9,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),rJe=pp("MenuContent.ScrollLock"),R9=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,...v}=t,b=Kf(tc,n),p=tb(tc,n),O=eb(n),k=S9(n),S=rbe(n),[w,T]=_.useState(null),P=_.useRef(null),j=ln(e,P,b.onContentChange),D=_.useRef(0),N=_.useRef(""),E=_.useRef(0),A=_.useRef(null),I=_.useRef("right"),L=_.useRef(0),F=g?Mk:_.Fragment,Q=g?{as:rJe,allowPinchZoom:!0}:void 0,W=X=>{var oe,ie;const G=N.current+X,ae=S().filter(Y=>!Y.disabled),ne=document.activeElement,re=(oe=ae.find(Y=>Y.ref.current===ne))==null?void 0:oe.textValue,Z=function(Y,le,me){const ce=le.length>1&&Array.from(le).every(Ae=>Ae===le[0]),ve=ce?le[0]:le,ye=me?Y.indexOf(me):-1;let _e=function(Ae,je){return Ae.map((Ie,De)=>Ae[(je+De)%Ae.length])}(Y,Math.max(ye,0));ve.length===1&&(_e=_e.filter(Ae=>Ae!==me));const Se=_e.find(Ae=>Ae.toLowerCase().startsWith(ve.toLowerCase()));return Se!==me?Se:void 0}(ae.map(Y=>Y.textValue),G,re),K=(ie=ae.find(Y=>Y.textValue===Z))==null?void 0:ie.ref.current;(function Y(le){N.current=le,window.clearTimeout(D.current),le!==""&&(D.current=window.setTimeout(()=>Y(""),1e3))})(G),K&&setTimeout(()=>K.focus())};_.useEffect(()=>()=>window.clearTimeout(D.current),[]),IR();const U=_.useCallback(X=>{var G,ae;return I.current===((G=A.current)==null?void 0:G.side)&&function(ne,re){if(!re)return!1;const Z={x:ne.clientX,y:ne.clientY};return function(K,oe){const{x:ie,y:Y}=K;let le=!1;for(let me=0,ce=oe.length-1;me<oe.length;ce=me++){const ve=oe[me],ye=oe[ce],_e=ve.x,Se=ve.y,Ae=ye.x,je=ye.y;Se>Y!=je>Y&&ie<(Ae-_e)*(Y-Se)/(je-Se)+_e&&(le=!le)}return le}(Z,re)}(X,(ae=A.current)==null?void 0:ae.area)},[]);return y.jsx(eJe,{scope:n,searchRef:N,onItemEnter:_.useCallback(X=>{U(X)&&X.preventDefault()},[U]),onItemLeave:_.useCallback(X=>{var G;U(X)||((G=P.current)==null||G.focus(),T(null))},[U]),onTriggerLeave:_.useCallback(X=>{U(X)&&X.preventDefault()},[U]),pointerGraceTimerRef:E,onPointerGraceIntentChange:_.useCallback(X=>{A.current=X},[]),children:y.jsx(F,{...Q,children:y.jsx(Ak,{asChild:!0,trapped:o,onMountAutoFocus:ut(i,X=>{var G;X.preventDefault(),(G=P.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:y.jsx(Rp,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:y.jsx(c9,{asChild:!0,...k,dir:p.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:ut(l,X=>{p.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(DE,{role:"menu","aria-orientation":"vertical","data-state":_be(b.open),"data-radix-menu-content":"",dir:p.dir,...O,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:ut(v.onKeyDown,X=>{const G=X.target.closest("[data-radix-menu-content]")===X.currentTarget,ae=X.ctrlKey||X.altKey||X.metaKey,ne=X.key.length===1;G&&(X.key==="Tab"&&X.preventDefault(),!ae&&ne&&W(X.key));const re=P.current;if(X.target!==re||!ebe.includes(X.key))return;X.preventDefault();const Z=S().filter(K=>!K.disabled).map(K=>K.ref.current);k9.includes(X.key)&&Z.reverse(),function(K){const oe=document.activeElement;for(const ie of K)if(ie===oe||(ie.focus(),document.activeElement!==oe))return}(Z)}),onBlur:ut(t.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(D.current),N.current="")}),onPointerMove:ut(t.onPointerMove,RS(X=>{const G=X.target,ae=L.current!==X.clientX;if(X.currentTarget.contains(G)&&ae){const ne=X.clientX>L.current?"right":"left";I.current=ne,L.current=X.clientX}}))})})})})})})});lbe.displayName=tc;var j9=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(_t.div,{role:"group",...r,ref:e})});j9.displayName="MenuGroup";var cbe=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(_t.div,{...r,ref:e})});cbe.displayName="MenuLabel";var ej="MenuItem",ube="menu.itemSelect",tj=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,i=_.useRef(null),a=tb(ej,t.__scopeMenu),s=E9(ej,t.__scopeMenu),l=ln(e,i),c=_.useRef(!1);return y.jsx(dbe,{...o,ref:l,disabled:n,onClick:ut(t.onClick,()=>{const u=i.current;if(!n&&u){const d=new CustomEvent(ube,{bubbles:!0,cancelable:!0});u.addEventListener(ube,f=>r==null?void 0:r(f),{once:!0}),Hw(u,d),d.defaultPrevented?c.current=!1:a.onClose()}}),onPointerDown:u=>{var d;(d=t.onPointerDown)==null||d.call(t,u),c.current=!0},onPointerUp:ut(t.onPointerUp,u=>{var d;c.current||((d=u.currentTarget)==null||d.click())}),onKeyDown:ut(t.onKeyDown,u=>{const d=s.searchRef.current!=="";n||d&&u.key===" "||J3.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});tj.displayName=ej;var dbe=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,a=E9(ej,n),s=S9(n),l=_.useRef(null),c=ln(e,l),[u,d]=_.useState(!1),[f,h]=_.useState("");return _.useEffect(()=>{const g=l.current;g&&h((g.textContent??"").trim())},[i.children]),y.jsx(J1.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:y.jsx(u9,{asChild:!0,...s,focusable:!r,children:y.jsx(_t.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:ut(t.onPointerMove,RS(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),!g.defaultPrevented&&g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ut(t.onPointerLeave,RS(g=>a.onItemLeave(g))),onFocus:ut(t.onFocus,()=>d(!0)),onBlur:ut(t.onBlur,()=>d(!1))})})})}),fbe=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return y.jsx(vbe,{scope:t.__scopeMenu,checked:n,children:y.jsx(tj,{role:"menuitemcheckbox","aria-checked":nj(n)?"mixed":n,...o,ref:e,"data-state":M9(n),onSelect:ut(o.onSelect,()=>r==null?void 0:r(!!nj(n)||!n),{checkForDefaultPrevented:!1})})})});fbe.displayName="MenuCheckboxItem";var hbe="MenuRadioGroup",[oJe,iJe]=Kp(hbe,{value:void 0,onValueChange:()=>{}}),pbe=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,i=Lo(r);return y.jsx(oJe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:y.jsx(j9,{...o,ref:e})})});pbe.displayName=hbe;var mbe="MenuRadioItem",gbe=_.forwardRef((t,e)=>{const{value:n,...r}=t,o=iJe(mbe,t.__scopeMenu),i=n===o.value;return y.jsx(vbe,{scope:t.__scopeMenu,checked:i,children:y.jsx(tj,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":M9(i),onSelect:ut(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});gbe.displayName=mbe;var D9="MenuItemIndicator",[vbe,aJe]=Kp(D9,{checked:!1}),ybe=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,i=aJe(D9,n);return y.jsx(Uo,{present:r||nj(i.checked)||i.checked===!0,children:y.jsx(_t.span,{...o,ref:e,"data-state":M9(i.checked)})})});ybe.displayName=D9;var bbe=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(_t.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});bbe.displayName="MenuSeparator";var xbe=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=eb(n);return y.jsx(AE,{...o,...r,ref:e})});xbe.displayName="MenuArrow";var A9="MenuSub",[sJe,Obe]=Kp(A9),wbe=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,i=Kf(A9,e),a=eb(e),[s,l]=_.useState(null),[c,u]=_.useState(null),d=Lo(o);return _.useEffect(()=>(i.open===!1&&d(!1),()=>d(!1)),[i.open,d]),y.jsx(ek,{...a,children:y.jsx(C9,{scope:e,open:r,onOpenChange:d,content:c,onContentChange:u,children:y.jsx(sJe,{scope:e,contentId:Do(),triggerId:Do(),trigger:s,onTriggerChange:l,children:n})})})};wbe.displayName=A9;var ES="MenuSubTrigger",kbe=_.forwardRef((t,e)=>{const n=Kf(ES,t.__scopeMenu),r=tb(ES,t.__scopeMenu),o=Obe(ES,t.__scopeMenu),i=E9(ES,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},u=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),y.jsx(T9,{asChild:!0,...c,children:y.jsx(dbe,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":_be(n.open),...t,ref:Lu(e,o.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),t.disabled||d.defaultPrevented||(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ut(t.onPointerMove,RS(d=>{i.onItemEnter(d),d.defaultPrevented||t.disabled||n.open||a.current||(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ut(t.onPointerLeave,RS(d=>{var h,g;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const v=(g=n.content)==null?void 0:g.dataset.side,b=v==="right",p=b?-5:5,O=f[b?"left":"right"],k=f[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+p,y:d.clientY},{x:O,y:f.top},{x:k,y:f.top},{x:k,y:f.bottom},{x:O,y:f.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ut(t.onKeyDown,d=>{var h;const f=i.searchRef.current!=="";t.disabled||f&&d.key===" "||tbe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});kbe.displayName=ES;var Sbe="MenuSubContent",Cbe=_.forwardRef((t,e)=>{const n=abe(tc,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=Kf(tc,t.__scopeMenu),a=tb(tc,t.__scopeMenu),s=Obe(Sbe,t.__scopeMenu),l=_.useRef(null),c=ln(e,l);return y.jsx(J1.Provider,{scope:t.__scopeMenu,children:y.jsx(Uo,{present:r||i.open,children:y.jsx(J1.Slot,{scope:t.__scopeMenu,children:y.jsx(R9,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ut(t.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ut(t.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:ut(t.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=nbe[a.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),(h=s.trigger)==null||h.focus(),u.preventDefault())})})})})})});function _be(t){return t?"open":"closed"}function nj(t){return t==="indeterminate"}function M9(t){return nj(t)?"indeterminate":t?"checked":"unchecked"}function RS(t){return e=>e.pointerType==="mouse"?t(e):void 0}Cbe.displayName=Sbe;let Tbe,jS,Pbe,lJe,ua,Ebe,N9,$9;kJ=_9,aJ=T9,SJ=sbe,sJ=lbe,pJ=j9,mJ=cbe,iJ=tj,gJ=fbe,vJ=pbe,yJ=gbe,bJ=ybe,oJ=bbe,xJ=xbe,Tbe=wbe,OJ=kbe,wJ=Cbe,jS="DropdownMenu",[Pbe,lJe]=Wo(jS,[lN]),ua=lN(),[Ebe,N9]=Pbe(jS),$9=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=t,l=ua(e),c=_.useRef(null),[u,d]=Ao({prop:o,defaultProp:i??!1,onChange:a,caller:jS});return y.jsx(Ebe,{scope:e,triggerId:Do(),triggerRef:c,contentId:Do(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(f=>!f),[d]),modal:s,children:y.jsx(kJ,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},$9.displayName=jS;var Rbe="DropdownMenuTrigger",jbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=N9(Rbe,n),a=ua(n);return y.jsx(aJ,{asChild:!0,...a,children:y.jsx(_t.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Lu(e,i.triggerRef),onPointerDown:ut(t.onPointerDown,s=>{r||s.button!==0||s.ctrlKey!==!1||(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:ut(t.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});jbe.displayName=Rbe;var Dbe=t=>{const{__scopeDropdownMenu:e,...n}=t,r=ua(e);return y.jsx(SJ,{...r,...n})};Dbe.displayName="DropdownMenuPortal";var Abe="DropdownMenuContent",Mbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=N9(Abe,n),i=ua(n),a=_.useRef(!1);return y.jsx(sJ,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:e,onCloseAutoFocus:ut(t.onCloseAutoFocus,s=>{var l;a.current||((l=o.triggerRef.current)==null||l.focus()),a.current=!1,s.preventDefault()}),onInteractOutside:ut(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;o.modal&&!u||(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mbe.displayName=Abe;var Nbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(pJ,{...o,...r,ref:e})});Nbe.displayName="DropdownMenuGroup";var $be=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(mJ,{...o,...r,ref:e})});$be.displayName="DropdownMenuLabel";var Ibe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(iJ,{...o,...r,ref:e})});Ibe.displayName="DropdownMenuItem";var Qbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(gJ,{...o,...r,ref:e})});Qbe.displayName="DropdownMenuCheckboxItem";var cJe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(vJ,{...o,...r,ref:e})});cJe.displayName="DropdownMenuRadioGroup";var Lbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(yJ,{...o,...r,ref:e})});Lbe.displayName="DropdownMenuRadioItem";var zbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(bJ,{...o,...r,ref:e})});zbe.displayName="DropdownMenuItemIndicator";var Vbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(oJ,{...o,...r,ref:e})});Vbe.displayName="DropdownMenuSeparator";var uJe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(xJ,{...o,...r,ref:e})});uJe.displayName="DropdownMenuArrow";var qbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(OJ,{...o,...r,ref:e})});qbe.displayName="DropdownMenuSubTrigger";var Fbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(wJ,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Fbe.displayName="DropdownMenuSubContent";var dJe=$9,fJe=jbe,hJe=Dbe,Bbe=Mbe,pJe=Nbe,Wbe=$be,Ube=Ibe,Zbe=Qbe,Xbe=Lbe,Hbe=zbe,Ybe=Vbe,mJe=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:i}=t,a=ua(e),[s,l]=Ao({prop:r,defaultProp:i??!1,onChange:o,caller:"DropdownMenuSub"});return y.jsx(Tbe,{...a,open:s,onOpenChange:l,children:n})},Gbe=qbe,Kbe=Fbe;let DS,I9,rj;vN=Po("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",{variants:{subcontent:{true:"shadow-lg"}}}),CJ=Po("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",{variants:{inset:{true:"pl-8"}}}),DS="data-[disabled]:pointer-events-none data-[disabled]:opacity-50",I9=Po(we("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground",DS),{variants:{}}),yN=Po("absolute left-2 flex h-3.5 w-3.5 items-center justify-center",{variants:{}}),_J=Po("px-2 py-1.5 text-sm font-semibold",{variants:{inset:{true:"pl-8"}}}),gN=Po(we("menu-item relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",DS),{variants:{inset:{true:"pl-8"},variant:{default:"focus:bg-accent focus:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",danger:"focus:bg-[var(--red-5)] focus:text-[var(--red-12)] aria-selected:bg-[var(--red-5)] aria-selected:text-[var(--red-12)]",muted:"focus:bg-muted/70 focus:text-muted-foreground aria-selected:bg-muted/70 aria-selected:text-muted-foreground",success:"focus:bg-[var(--grass-3)] focus:text-[var(--grass-11)] aria-selected:bg-[var(--grass-3)] aria-selected:text-[var(--grass-11)]",disabled:"text-muted-foreground"}},defaultVariants:{variant:"default"}}),mN=Po("-mx-1 my-1 h-px bg-border last:hidden",{variants:{}}),rj=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("ml-auto text-xs tracking-widest opacity-60",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx("span",{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},rj.displayName="MenuShortcut";let Jbe;Hm=dJe,Gm=fJe,Jbe=pJe,cy=ey(hJe),hg=mJe,bO=ge.forwardRef((t,e)=>{const n=ue.c(14);let r,o,i,a,s,l,c;return n[0]!==t?({className:o,inset:i,children:r,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==o||n[6]!==i?(s=CJ({className:o,inset:i}),n[5]=o,n[6]=i,n[7]=s):s=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(Qh,{className:"ml-auto h-4 w-4"}),n[8]=l):l=n[8],n[9]!==r||n[10]!==a||n[11]!==e||n[12]!==s?(c=y.jsxs(Gbe,{ref:e,className:s,...a,children:[r,l]}),n[9]=r,n[10]=a,n[11]=e,n[12]=s,n[13]=c):c=n[13],c}),bO.displayName=Gbe.displayName,pg=ge.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we(vN({subcontent:!0}),"animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Kbe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),pg.displayName=Kbe.displayName,zh=ge.forwardRef((t,e)=>{const n=ue.c(17);let r,o,i,a;n[0]!==t?({className:r,scrollable:i,sideOffset:a,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]);const s=i===void 0||i,l=a===void 0?4:a;let c;n[5]!==r||n[6]!==s?(c=we(vN(),"animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s&&"overflow-auto",r),n[5]=r,n[6]=s,n[7]=c):c=n[7];const u=s?"calc(var(--radix-dropdown-menu-content-available-height) - 30px)":void 0;let d,f;return n[8]!==o.style||n[9]!==u?(d={...o.style,maxHeight:u},n[8]=o.style,n[9]=u,n[10]=d):d=n[10],n[11]!==o||n[12]!==e||n[13]!==l||n[14]!==c||n[15]!==d?(f=y.jsx(cy,{children:y.jsx(lf,{children:y.jsx(Bbe,{ref:e,sideOffset:l,className:c,style:d,...o})})}),n[11]=o,n[12]=e,n[13]=l,n[14]=c,n[15]=d,n[16]=f):f=n[16],f}),zh.displayName=Bbe.displayName,$r=ge.forwardRef((t,e)=>{const n=ue.c(13);let r,o,i,a,s,l;return n[0]!==t?({className:r,inset:o,variant:a,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==r||n[6]!==o||n[7]!==a?(s=gN({className:r,inset:o,variant:a}),n[5]=r,n[6]=o,n[7]=a,n[8]=s):s=n[8],n[9]!==i||n[10]!==e||n[11]!==s?(l=y.jsx(Ube,{ref:e,className:s,...i}),n[9]=i,n[10]=e,n[11]=s,n[12]=l):l=n[12],l}),$r.displayName=Ube.displayName,FJ=ge.forwardRef((t,e)=>{const n=ue.c(15);let r,o,i,a,s,l,c,u;return n[0]!==t?({className:i,children:o,checked:r,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==i?(s=I9({className:i}),n[5]=i,n[6]=s):s=n[6],n[7]===Symbol.for("react.memo_cache_sentinel")?(l=yN(),n[7]=l):l=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx("span",{className:l,children:y.jsx(Hbe,{children:y.jsx(rg,{className:"h-4 w-4"})})}),n[8]=c):c=n[8],n[9]!==r||n[10]!==o||n[11]!==a||n[12]!==e||n[13]!==s?(u=y.jsxs(Zbe,{ref:e,className:s,checked:r,...a,children:[c,o]}),n[9]=r,n[10]=o,n[11]=a,n[12]=e,n[13]=s,n[14]=u):u=n[14],u}),FJ.displayName=Zbe.displayName;const gJe=ge.forwardRef((t,e)=>{const n=ue.c(13);let r,o,i,a,s,l,c;return n[0]!==t?({className:o,children:r,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==o?(a=I9({className:o}),n[4]=o,n[5]=a):a=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(s=yN(),n[6]=s):s=n[6],n[7]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx("span",{className:s,children:y.jsx(Hbe,{children:y.jsx(BO,{className:"h-2 w-2 fill-current"})})}),n[7]=l):l=n[7],n[8]!==r||n[9]!==i||n[10]!==e||n[11]!==a?(c=y.jsxs(Xbe,{ref:e,className:a,...i,children:[l,r]}),n[8]=r,n[9]=i,n[10]=e,n[11]=a,n[12]=c):c=n[12],c});gJe.displayName=Xbe.displayName,VM=ge.forwardRef((t,e)=>{const n=ue.c(11);let r,o,i,a,s;return n[0]!==t?({className:r,inset:o,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==r||n[5]!==o?(a=_J({className:r,inset:o}),n[4]=r,n[5]=o,n[6]=a):a=n[6],n[7]!==i||n[8]!==e||n[9]!==a?(s=y.jsx(Wbe,{ref:e,className:a,...i}),n[7]=i,n[8]=e,n[9]=a,n[10]=s):s=n[10],s}),VM.displayName=Wbe.displayName,cf=ge.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=mN({className:r}),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Ybe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),cf.displayName=Ybe.displayName;const vJe=rj,bd={error:(t,e)=>({status:"error",data:e,error:t,isPending:!1,isFetching:!1}),success:t=>({status:"success",data:t,error:void 0,isPending:!1,isFetching:!1}),loading:t=>({status:"loading",data:t,error:void 0,isPending:!1,isFetching:!0}),pending:()=>({status:"pending",data:void 0,error:void 0,isPending:!0,isFetching:!0})};IIe=function(...t){Rn(t.length>0,"combineAsyncData requires at least one response");const e=()=>{t.forEach(i=>i.refetch())},n=t.find(i=>i.status==="error");if(n!=null&&n.error)return{...bd.error(n.error),refetch:e};if(t.every(i=>i.status==="success"))return{...bd.success(t.map(i=>i.data)),refetch:e};const r=t.some(i=>i.status==="loading"),o=t.every(i=>i.data!==void 0);return r&&o?{...bd.loading(t.map(i=>i.data)),refetch:e}:{...bd.pending(),refetch:e}},$a=function(t,e){const n=ue.c(17),[r,o]=_.useState(0);let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i=bd.pending(),n[0]=i):i=n[0];const[a,s]=_.useState(i);let l;n[1]!==t?(l=typeof t=="function"?{fetch:t}:t,n[1]=t,n[2]=l):l=n[2];const c=Fn(l.fetch);let u,d,f,h,g;return n[3]!==c?(u=()=>{const v=new AbortController;let b=!1;const p={previous:()=>{b=!0}};return s(yJe),c(p).then(O=>{v.signal.aborted||b||s(bd.success(O))}).catch(O=>{v.signal.aborted||s(k=>bd.error(O,k.data))}),()=>{v.abort()}},n[3]=c,n[4]=u):u=n[4],n[5]!==e||n[6]!==c||n[7]!==r?(d=[...e,r,c],n[5]=e,n[6]=c,n[7]=r,n[8]=d):d=n[8],_.useEffect(u,d),n[9]!==a?(f=v=>{let b;typeof v=="function"?(Rn(a.status==="success"||a.status==="loading","No previous state value."),b=v(a.data)):b=v,s(bd.success(b))},n[9]=a,n[10]=f):f=n[10],n[11]!==r?(h=()=>o(r+1),n[11]=r,n[12]=h):h=n[12],n[13]!==a||n[14]!==f||n[15]!==h?(g={...a,setData:f,refetch:h},n[13]=a,n[14]=f,n[15]=h,n[16]=g):g=n[16],g};function yJe(t){return t.status==="success"?bd.loading(t.data):bd.pending()}const Q9=Qe({detail:Pe()}),exe=Qe({error:Pe()});q_=function(t){if(!t)return"Unknown error";if(t instanceof Error){const e=Q9.safeParse(t.cause);return e.success?e.data.detail:function(n){const r=function(a){try{return JSON.parse(a)}catch{return a}}(n);if(!r)return n;const o=Q9.safeParse(r);if(o.success)return o.data.detail;const i=exe.safeParse(r);return i.success?i.data.error:n}(t.message)}if(typeof t=="object"){const e=Q9.safeParse(t);if(e.success)return e.data.detail;const n=exe.safeParse(t);if(n.success)return n.data.error}try{return JSON.stringify(t)}catch{return String(t)}};let txe,nxe;Hd=t=>{const e=ue.c(20),{error:n,className:r}=t,[o,i]=_.useState(!1);if(!n)return null;let a;Ve.error(n),e[0]!==n?(a=q_(n),e[0]=n,e[1]=a):a=e[1];const s=a;let l,c,u,d,f,h,g,v,b;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!0),e[2]=l):l=e[2],e[3]!==s?(c=y.jsx("span",{className:"line-clamp-4",children:s}),e[3]=s,e[4]=c):c=e[4],e[5]!==r||e[6]!==c?(u=y.jsx(Km,{kind:"danger",className:r,clickable:!0,onClick:l,children:c}),e[5]=r,e[6]=c,e[7]=u):u=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsx(HR,{children:y.jsx(YR,{className:"text-error",children:"Error"})}),e[8]=d):d=e[8],e[9]!==s?(f=y.jsx("pre",{className:"text-error text-sm p-2 font-mono overflow-auto whitespace-pre-wrap",children:s}),e[9]=s,e[10]=f):f=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsx($k,{children:y.jsx(P8,{autoFocus:!0,onClick:()=>i(!1),children:"Ok"})}),e[11]=h):h=e[11],e[12]!==f?(g=y.jsxs(Nk,{className:"max-w-[80%] max-h-[80%] overflow-hidden flex flex-col",children:[d,f,h]}),e[12]=f,e[13]=g):g=e[13],e[14]!==o||e[15]!==g?(v=y.jsx(XR,{open:o,onOpenChange:i,children:g}),e[14]=o,e[15]=g,e[16]=v):v=e[16],e[17]!==u||e[18]!==v?(b=y.jsxs(y.Fragment,{children:[u,v]}),e[17]=u,e[18]=v,e[19]=b):b=e[19],b},txe=Po("text-sm p-2 border whitespace-pre-wrap overflow-hidden",{variants:{kind:{danger:"text-error border-[var(--red-6)] shadow-mdSolid shadow-error bg-[var(--red-1)]",info:"text-primary border-[var(--blue-6)] shadow-mdSolid shadow-accent bg-[var(--blue-1)]",warn:"border-[var(--yellow-6)] bg-[var(--yellow-2)] dark:bg-[var(--yellow-4)] text-[var(--yellow-11)] dark:text-[var(--yellow-12)]"},clickable:{true:"cursor-pointer"}},compoundVariants:[{clickable:!0,kind:"danger",className:"hover:bg-[var(--red-3)]"},{clickable:!0,kind:"info",className:"hover:bg-[var(--blue-3)]"},{clickable:!0,kind:"warn",className:"hover:bg-[var(--yellow-3)]"}],defaultVariants:{kind:"info"}}),Km=t=>{const e=ue.c(14);let n,r,o,i,a,s,l;return e[0]!==t?({kind:i,clickable:o,className:r,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5]),e[6]!==r||e[7]!==o||e[8]!==i?(s=we(txe({kind:i,clickable:o}),r),e[6]=r,e[7]=o,e[8]=i,e[9]=s):s=e[9],e[10]!==n||e[11]!==a||e[12]!==s?(l=y.jsx("div",{className:s,...a,children:n}),e[10]=n,e[11]=a,e[12]=s,e[13]=l):l=e[13],l},nxe=Po("animate-spin",{variants:{centered:{true:"m-auto"},size:{small:"size-4",medium:"size-12",large:"size-20",xlarge:"size-20"}},defaultVariants:{size:"medium"}}),Ym=ge.forwardRef((t,e)=>{const n=ue.c(13);let r,o,i,a,s,l;if(n[0]!==t){const{className:c,children:u,centered:d,size:f,...h}=t;o=c,r=d,a=f,i=h,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a}else r=n[1],o=n[2],i=n[3],a=n[4];return n[5]!==r||n[6]!==o||n[7]!==a?(s=we(nxe({centered:r,size:a}),o),n[5]=r,n[6]=o,n[7]=a,n[8]=s):s=n[8],n[9]!==i||n[10]!==e||n[11]!==s?(l=y.jsx(af,{ref:e,className:s,strokeWidth:1.5,...i}),n[9]=i,n[10]=e,n[11]=s,n[12]=l):l=n[12],l}),Ym.displayName="Spinner";var L9=.999,bJe=/[\\\/_+.#"@\[\(\{&]/,xJe=/[\\\/_+.#"@\[\(\{&]/g,OJe=/[\s-]/,rxe=/[\s-]/g;function z9(t,e,n,r,o,i,a){if(i===e.length)return o===t.length?1:.99;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var l,c,u,d,f=r.charAt(i),h=n.indexOf(f,o),g=0;h>=0;)(l=z9(t,e,n,r,h+1,i+1,a))>g&&(h===o?l*=1:bJe.test(t.charAt(h-1))?(l*=.8,(u=t.slice(o,h-1).match(xJe))&&o>0&&(l*=Math.pow(L9,u.length))):OJe.test(t.charAt(h-1))?(l*=.9,(d=t.slice(o,h-1).match(rxe))&&o>0&&(l*=Math.pow(L9,d.length))):(l*=.17,o>0&&(l*=Math.pow(L9,h-o))),t.charAt(h)!==e.charAt(i)&&(l*=.9999)),(l<.1&&n.charAt(h-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(h-1)!==r.charAt(i))&&.1*(c=z9(t,e,n,r,h+1,i+2,a))>l&&(l=.1*c),l>g&&(g=l),h=n.indexOf(f,h+1);return a[s]=g,g}function oxe(t){return t.toLowerCase().replace(rxe," ")}function wJe(t,e,n){return z9(t=n&&n.length>0?t+" "+n.join(" "):t,e,oxe(t),oxe(e),0,0,{})}let nb,oj,V9,q9,ij,h0,ixe,F9,rb,B9,aj,W9,U9,axe,sxe,lxe,cxe,uxe,dxe,fxe,Xa;nb='[cmdk-group=""]',oj='[cmdk-group-items=""]',V9='[cmdk-item=""]',q9=`${V9}:not([aria-disabled="true"])`,ij="cmdk-item-select",h0="data-value",ixe=(t,e,n)=>wJe(t,e,n),F9=_.createContext(void 0),rb=()=>_.useContext(F9),B9=_.createContext(void 0),aj=()=>_.useContext(B9),W9=_.createContext(void 0),U9=_.forwardRef((t,e)=>{let n=ob(()=>{var ne,re;return{search:"",value:(re=(ne=t.value)!=null?ne:t.defaultValue)!=null?re:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=ob(()=>new Set),o=ob(()=>new Map),i=ob(()=>new Map),a=ob(()=>new Set),s=hxe(t),{label:l,children:c,value:u,onValueChange:d,filter:f,shouldFilter:h,loop:g,disablePointerSelection:v=!1,vimBindings:b=!0,...p}=t,O=Do(),k=Do(),S=Do(),w=_.useRef(null),T=CJe();p0(()=>{if(u!==void 0){let ne=u.trim();n.current.value=ne,P.emit()}},[u]),p0(()=>{T(6,I)},[]);let P=_.useMemo(()=>({subscribe:ne=>(a.current.add(ne),()=>a.current.delete(ne)),snapshot:()=>n.current,setState:(ne,re,Z)=>{var K,oe,ie,Y;if(!Object.is(n.current[ne],re)){if(n.current[ne]=re,ne==="search")A(),N(),T(1,E);else if(ne==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let le=document.getElementById(S);le?le.focus():(K=document.getElementById(O))==null||K.focus()}if(T(7,()=>{var le;n.current.selectedItemId=(le=L())==null?void 0:le.id,P.emit()}),Z||T(5,I),((oe=s.current)==null?void 0:oe.value)!==void 0){let le=re??"";return void((Y=(ie=s.current).onValueChange)==null||Y.call(ie,le))}}P.emit()}},emit:()=>{a.current.forEach(ne=>ne())}}),[]),j=_.useMemo(()=>({value:(ne,re,Z)=>{var K;re!==((K=i.current.get(ne))==null?void 0:K.value)&&(i.current.set(ne,{value:re,keywords:Z}),n.current.filtered.items.set(ne,D(re,Z)),T(2,()=>{N(),P.emit()}))},item:(ne,re)=>(r.current.add(ne),re&&(o.current.has(re)?o.current.get(re).add(ne):o.current.set(re,new Set([ne]))),T(3,()=>{A(),N(),n.current.value||E(),P.emit()}),()=>{i.current.delete(ne),r.current.delete(ne),n.current.filtered.items.delete(ne);let Z=L();T(4,()=>{A(),(Z==null?void 0:Z.getAttribute("id"))===ne&&E(),P.emit()})}),group:ne=>(o.current.has(ne)||o.current.set(ne,new Set),()=>{i.current.delete(ne),o.current.delete(ne)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:O,inputId:S,labelId:k,listInnerRef:w}),[]);function D(ne,re){var Z,K;let oe=(K=(Z=s.current)==null?void 0:Z.filter)!=null?K:ixe;return ne?oe(ne,n.current.search,re):0}function N(){if(!n.current.search||s.current.shouldFilter===!1)return;let ne=n.current.filtered.items,re=[];n.current.filtered.groups.forEach(K=>{let oe=o.current.get(K),ie=0;oe.forEach(Y=>{let le=ne.get(Y);ie=Math.max(le,ie)}),re.push([K,ie])});let Z=w.current;F().sort((K,oe)=>{var ie,Y;let le=K.getAttribute("id"),me=oe.getAttribute("id");return((ie=ne.get(me))!=null?ie:0)-((Y=ne.get(le))!=null?Y:0)}).forEach(K=>{let oe=K.closest(oj);oe?oe.appendChild(K.parentElement===oe?K:K.closest(`${oj} > *`)):Z.appendChild(K.parentElement===Z?K:K.closest(`${oj} > *`))}),re.sort((K,oe)=>oe[1]-K[1]).forEach(K=>{var oe;let ie=(oe=w.current)==null?void 0:oe.querySelector(`${nb}[${h0}="${encodeURIComponent(K[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function E(){let ne=F().find(Z=>Z.getAttribute("aria-disabled")!=="true"),re=ne==null?void 0:ne.getAttribute(h0);P.setState("value",re||void 0)}function A(){var ne,re,Z,K;if(!n.current.search||s.current.shouldFilter===!1)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let oe=0;for(let ie of r.current){let Y=D((re=(ne=i.current.get(ie))==null?void 0:ne.value)!=null?re:"",(K=(Z=i.current.get(ie))==null?void 0:Z.keywords)!=null?K:[]);n.current.filtered.items.set(ie,Y),Y>0&&oe++}for(let[ie,Y]of o.current)for(let le of Y)if(n.current.filtered.items.get(le)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=oe}function I(){var ne,re,Z;let K=L();K&&(((ne=K.parentElement)==null?void 0:ne.firstChild)===K&&((Z=(re=K.closest(nb))==null?void 0:re.querySelector('[cmdk-group-heading=""]'))==null||Z.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function L(){var ne;return(ne=w.current)==null?void 0:ne.querySelector(`${V9}[aria-selected="true"]`)}function F(){var ne;return Array.from(((ne=w.current)==null?void 0:ne.querySelectorAll(q9))||[])}function Q(ne){let re=F()[ne];re&&P.setState("value",re.getAttribute(h0))}function W(ne){var re;let Z=L(),K=F(),oe=K.findIndex(Y=>Y===Z),ie=K[oe+ne];(re=s.current)!=null&&re.loop&&(ie=oe+ne<0?K[K.length-1]:oe+ne===K.length?K[0]:K[oe+ne]),ie&&P.setState("value",ie.getAttribute(h0))}function U(ne){let re,Z=L(),K=Z==null?void 0:Z.closest(nb);for(;K&&!re;)K=ne>0?kJe(K,nb):SJe(K,nb),re=K==null?void 0:K.querySelector(q9);re?P.setState("value",re.getAttribute(h0)):W(ne)}let X=()=>Q(F().length-1),G=ne=>{ne.preventDefault(),ne.metaKey?X():ne.altKey?U(1):W(1)},ae=ne=>{ne.preventDefault(),ne.metaKey?Q(0):ne.altKey?U(-1):W(-1)};return _.createElement(_t.div,{ref:e,tabIndex:-1,...p,"cmdk-root":"",onKeyDown:ne=>{var re;(re=p.onKeyDown)==null||re.call(p,ne);let Z=ne.nativeEvent.isComposing||ne.keyCode===229;if(!ne.defaultPrevented&&!Z)switch(ne.key){case"n":case"j":b&&ne.ctrlKey&&G(ne);break;case"ArrowDown":G(ne);break;case"p":case"k":b&&ne.ctrlKey&&ae(ne);break;case"ArrowUp":ae(ne);break;case"Home":ne.preventDefault(),Q(0);break;case"End":ne.preventDefault(),X();break;case"Enter":{ne.preventDefault();let K=L();if(K){let oe=new Event(ij);K.dispatchEvent(oe)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:_Je},l),sj(t,ne=>_.createElement(B9.Provider,{value:P},_.createElement(F9.Provider,{value:j},ne))))}),axe=_.forwardRef((t,e)=>{var n,r;let o=Do(),i=_.useRef(null),a=_.useContext(W9),s=rb(),l=hxe(t),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;p0(()=>{if(!c)return s.item(o,a==null?void 0:a.id)},[c]);let u=pxe(o,i,[t.value,t.children,i],t.keywords),d=aj(),f=Jp(T=>T.value&&T.value===u.current),h=Jp(T=>!(!c&&s.filter()!==!1)||!T.search||T.filtered.items.get(o)>0);function g(){var T,P;v(),(P=(T=l.current).onSelect)==null||P.call(T,u.current)}function v(){d.setState("value",u.current,!0)}if(_.useEffect(()=>{let T=i.current;if(T&&!t.disabled)return T.addEventListener(ij,g),()=>T.removeEventListener(ij,g)},[h,t.onSelect,t.disabled]),!h)return null;let{disabled:b,value:p,onSelect:O,forceMount:k,keywords:S,...w}=t;return _.createElement(_t.div,{ref:Lu(i,e),...w,id:o,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||s.getDisablePointerSelection()?void 0:v,onClick:b?void 0:g},t.children)}),sxe=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...i}=t,a=Do(),s=_.useRef(null),l=_.useRef(null),c=Do(),u=rb(),d=Jp(h=>!(!o&&u.filter()!==!1)||!h.search||h.filtered.groups.has(a));p0(()=>u.group(a),[]),pxe(a,s,[t.value,t.heading,l]);let f=_.useMemo(()=>({id:a,forceMount:o}),[o]);return _.createElement(_t.div,{ref:Lu(s,e),...i,"cmdk-group":"",role:"presentation",hidden:!d||void 0},n&&_.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),sj(t,h=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},_.createElement(W9.Provider,{value:f},h))))}),lxe=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=_.useRef(null),i=Jp(a=>!a.search);return n||i?_.createElement(_t.div,{ref:Lu(o,e),...r,"cmdk-separator":"",role:"separator"}):null}),cxe=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,i=aj(),a=Jp(c=>c.search),s=Jp(c=>c.selectedItemId),l=rb();return _.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),_.createElement(_t.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:o?t.value:a,onChange:c=>{o||i.setState("search",c.target.value),n==null||n(c.target.value)}})}),TJ=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,i=_.useRef(null),a=_.useRef(null),s=Jp(c=>c.selectedItemId),l=rb();return _.useEffect(()=>{if(a.current&&i.current){let c,u=a.current,d=i.current,f=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let h=u.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(c),f.unobserve(u)}}},[]),_.createElement(_t.div,{ref:Lu(i,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},sj(t,c=>_.createElement("div",{ref:Lu(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),uxe=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=t;return _.createElement(uT,{open:n,onOpenChange:r},_.createElement(cO,{container:a},_.createElement(uO,{"cmdk-overlay":"",className:o}),_.createElement(dO,{"aria-label":t.label,"cmdk-dialog":"",className:i},_.createElement(U9,{ref:e,...s}))))}),dxe=_.forwardRef((t,e)=>Jp(n=>n.filtered.count===0)?_.createElement(_t.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),fxe=_.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...i}=t;return _.createElement(_t.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},sj(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),Xa=Object.assign(U9,{List:TJ,Item:axe,Input:cxe,Group:sxe,Separator:lxe,Dialog:uxe,Empty:dxe,Loading:fxe});function kJe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function SJe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function hxe(t){let e=_.useRef(t);return p0(()=>{e.current=t}),e}var p0=typeof window>"u"?_.useEffect:_.useLayoutEffect;function ob(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function Jp(t){let e=aj(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function pxe(t,e,n,r=[]){let o=_.useRef(),i=rb();return p0(()=>{var a;let s=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():o.current}})(),l=r.map(c=>c.trim());i.value(t,s,l),(a=e.current)==null||a.setAttribute(h0,s),o.current=s}),o}var CJe=()=>{let[t,e]=_.useState(),n=ob(()=>new Map);return p0(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function sj({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(function(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}(e),{ref:e.ref},n(e.props.children)):n(e)}var _Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};let Jf;Jf={startCase:t=>{if(!t)return"";if(typeof t!="string")throw Ve.error(t),new TypeError("Expected string, got "+typeof t);return/[A-Za-z]/.test(t)?oM(t):t},htmlEscape:t=>t&&t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'").replaceAll(`
|
217
|
+
`]))));let i=this._buffer.match(this._osc_regex);return i===null?(t.kind=ao.ESC,t.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),t):(t.kind=ao.OSCURL,t.url=i[1],t.text=i[2],o=i[0].length,this._buffer=this._buffer.slice(o),t)}if(r=="(")return t.kind=ao.Unknown,this._buffer=this._buffer.slice(3),t}}ansi_to_html(t){this.append_buffer(t);for(var e=[];;){var n=this.get_next_packet();if(n.kind==ao.EOS||n.kind==ao.Incomplete)break;n.kind!=ao.ESC&&n.kind!=ao.Unknown&&(n.kind==ao.Text?e.push(this.transform_to_html(this.with_state(n))):n.kind==ao.SGR?this.process_ansi(n):n.kind==ao.OSCURL&&e.push(this.process_hyperlink(n)))}return e.join("")}with_state(t){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:t.text}}process_ansi(t){let e=t.text.split(";");for(;e.length>0;){let n=e.shift(),r=parseInt(n,10);if(isNaN(r)||r===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(r===1)this.bold=!0;else if(r===2)this.faint=!0;else if(r===3)this.italic=!0;else if(r===4)this.underline=!0;else if(r===21)this.bold=!1;else if(r===22)this.faint=!1,this.bold=!1;else if(r===23)this.italic=!1;else if(r===24)this.underline=!1;else if(r===39)this.fg=null;else if(r===49)this.bg=null;else if(r>=30&&r<38)this.fg=this.ansi_colors[0][r-30];else if(r>=40&&r<48)this.bg=this.ansi_colors[0][r-40];else if(r>=90&&r<98)this.fg=this.ansi_colors[1][r-90];else if(r>=100&&r<108)this.bg=this.ansi_colors[1][r-100];else if((r===38||r===48)&&e.length>0){let o=r===38,i=e.shift();if(i==="5"&&e.length>0){let a=parseInt(e.shift(),10);a>=0&&a<=255&&(o?this.fg=this.palette_256[a]:this.bg=this.palette_256[a])}if(i==="2"&&e.length>2){let a=parseInt(e.shift(),10),s=parseInt(e.shift(),10),l=parseInt(e.shift(),10);if(a>=0&&a<=255&&s>=0&&s<=255&&l>=0&&l<=255){let c={rgb:[a,s,l],class_name:"truecolor"};o?this.fg=c:this.bg=c}}}}}transform_to_html(t){let e=t.text;if(e.length===0||(e=this.escape_txt_for_html(e),!(t.bold||t.italic||t.faint||t.underline||t.fg!==null||t.bg!==null)))return e;let n=[],r=[],o=t.fg,i=t.bg;t.bold&&n.push(this._boldStyle),t.faint&&n.push(this._faintStyle),t.italic&&n.push(this._italicStyle),t.underline&&n.push(this._underlineStyle),this._use_classes?(o&&(o.class_name!=="truecolor"?r.push(`${o.class_name}-fg`):n.push(`color:rgb(${o.rgb.join(",")})`)),i&&(i.class_name!=="truecolor"?r.push(`${i.class_name}-bg`):n.push(`background-color:rgb(${i.rgb.join(",")})`))):(o&&n.push(`color:rgb(${o.rgb.join(",")})`),i&&n.push(`background-color:rgb(${i.rgb})`));let a="",s="";return r.length&&(a=` class="${r.join(" ")}"`),n.length&&(s=` style="${n.join(";")}"`),`<span${s}${a}>${e}</span>`}process_hyperlink(t){let e=t.url.split(":");return e.length<1?"":this._url_allowlist[e[0]]?`<a href="${this.escape_txt_for_html(t.url)}">${this.escape_txt_for_html(t.text)}</a>`:""}};function o1e(t,...e){let n=t.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(n)}const JGe=new KY,eKe=t=>{const e=ue.c(13),{text:n,channel:r,wrapText:o}=t,i=r==="stdout"||r==="stderr";let a;e[0]!==o?(a=h=>y.jsx("span",{className:o?"whitespace-pre-wrap break-words":"whitespace-pre",dangerouslySetInnerHTML:{__html:JGe.ansi_to_html(h)}}),e[0]=o,e[1]=a):a=e[1];const s=a,l=!i&&(o?"whitespace-pre-wrap break-words":"whitespace-pre"),c=r==="output"&&"font-prose";let u,d,f;return e[2]!==r||e[3]!==l||e[4]!==c?(u=we(l,c,r),e[2]=r,e[3]=l,e[4]=c,e[5]=u):u=e[5],e[6]!==s||e[7]!==i||e[8]!==n?(d=i?s(n):n,e[6]=s,e[7]=i,e[8]=n,e[9]=d):d=e[9],e[10]!==u||e[11]!==d?(f=y.jsx("span",{className:u,children:d}),e[10]=u,e[11]=d,e[12]=f):f=e[12],f},i1e={};pG=function(t){return t==null||t.data==null||t.data===""},SN=_.lazy(()=>Be(()=>import("./any-language-editor-Evcpa6vO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url));var s9="rovingFocusGroup.onEntryFocus",tKe={bubbles:!1,cancelable:!0},OS="RovingFocusGroup",[l9,a1e,nKe]=Lp(OS),[rKe,X1]=Wo(OS,[nKe]),[oKe,iKe]=rKe(OS),s1e=_.forwardRef((t,e)=>y.jsx(l9.Provider,{scope:t.__scopeRovingFocusGroup,children:y.jsx(l9.Slot,{scope:t.__scopeRovingFocusGroup,children:y.jsx(aKe,{...t,ref:e})})}));s1e.displayName=OS;var aKe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=_.useRef(null),h=ln(e,f),g=yf(i),[v,b]=Ao({prop:a,defaultProp:s??null,onChange:l,caller:OS}),[p,O]=_.useState(!1),k=Lo(c),S=a1e(n),w=_.useRef(!1),[T,P]=_.useState(0);return _.useEffect(()=>{const j=f.current;if(j)return j.addEventListener(s9,k),()=>j.removeEventListener(s9,k)},[k]),y.jsx(oKe,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:_.useCallback(j=>b(j),[b]),onItemShiftTab:_.useCallback(()=>O(!0),[]),onFocusableItemAdd:_.useCallback(()=>P(j=>j+1),[]),onFocusableItemRemove:_.useCallback(()=>P(j=>j-1),[]),children:y.jsx(_t.div,{tabIndex:p||T===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:ut(t.onMouseDown,()=>{w.current=!0}),onFocus:ut(t.onFocus,j=>{const D=!w.current;if(j.target===j.currentTarget&&D&&!p){const N=new CustomEvent(s9,tKe);if(j.currentTarget.dispatchEvent(N),!N.defaultPrevented){const E=S().filter(A=>A.focusable);u1e([E.find(A=>A.active),E.find(A=>A.id===v),...E].filter(Boolean).map(A=>A.ref.current),u)}}w.current=!1}),onBlur:ut(t.onBlur,()=>O(!1))})})}),l1e="RovingFocusGroupItem",c1e=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:a,...s}=t,l=Do(),c=i||l,u=iKe(l1e,n),d=u.currentTabStopId===c,f=a1e(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=u;return _.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),y.jsx(l9.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:y.jsx(_t.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:e,onMouseDown:ut(t.onMouseDown,b=>{r?u.onItemFocus(c):b.preventDefault()}),onFocus:ut(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:ut(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey)return void u.onItemShiftTab();if(b.target!==b.currentTarget)return;const p=function(O,k,S){const w=function(T,P){return P!=="rtl"?T:T==="ArrowLeft"?"ArrowRight":T==="ArrowRight"?"ArrowLeft":T}(O.key,S);return k==="vertical"&&["ArrowLeft","ArrowRight"].includes(w)||k==="horizontal"&&["ArrowUp","ArrowDown"].includes(w)?void 0:sKe[w]}(b,u.orientation,u.dir);if(p!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let O=f().filter(k=>k.focusable).map(k=>k.ref.current);if(p==="last")O.reverse();else if(p==="prev"||p==="next"){p==="prev"&&O.reverse();const k=O.indexOf(b.currentTarget);O=u.loop?function(S,w){return S.map((T,P)=>S[(w+P)%S.length])}(O,k+1):O.slice(k+1)}setTimeout(()=>u1e(O))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:v!=null}):a})})});c1e.displayName=l1e;var sKe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function u1e(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}var c9=s1e,u9=c1e,X3="Tabs",[lKe,Ayt]=Wo(X3,[X1]),d1e=X1(),[cKe,d9]=lKe(X3),f1e=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=t,u=yf(s),[d,f]=Ao({prop:r,onChange:o,defaultProp:i??"",caller:X3});return y.jsx(cKe,{scope:n,baseId:Do(),value:d,onValueChange:f,orientation:a,dir:u,activationMode:l,children:y.jsx(_t.div,{dir:u,"data-orientation":a,...c,ref:e})})});f1e.displayName=X3;var h1e="TabsList",p1e=_.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,i=d9(h1e,n),a=d1e(n);return y.jsx(c9,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:y.jsx(_t.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:e})})});p1e.displayName=h1e;var m1e="TabsTrigger",g1e=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=t,a=d9(m1e,n),s=d1e(n),l=b1e(a.baseId,r),c=x1e(a.baseId,r),u=r===a.value;return y.jsx(u9,{asChild:!0,...s,focusable:!o,active:u,children:y.jsx(_t.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:e,onMouseDown:ut(t.onMouseDown,d=>{o||d.button!==0||d.ctrlKey!==!1?d.preventDefault():a.onValueChange(r)}),onKeyDown:ut(t.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:ut(t.onFocus,()=>{const d=a.activationMode!=="manual";u||o||!d||a.onValueChange(r)})})})});g1e.displayName=m1e;var v1e="TabsContent",y1e=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=t,s=d9(v1e,n),l=b1e(s.baseId,r),c=x1e(s.baseId,r),u=r===s.value,d=_.useRef(u);return _.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),y.jsx(Uo,{present:o||u,children:({present:f})=>y.jsx(_t.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});function b1e(t,e){return`${t}-trigger-${e}`}function x1e(t,e){return`${t}-content-${e}`}y1e.displayName=v1e;var O1e=p1e,w1e=g1e,k1e=y1e;sg=f1e,Kh=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("inline-flex max-h-14 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(O1e,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),Kh.displayName=O1e.displayName,Hs=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(w1e,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),Hs.displayName=w1e.displayName;const ec=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(k1e,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});ec.displayName=k1e.displayName;var H3="Popover",[S1e,Myt]=Wo(H3,[Ap]),wS=Ap(),[uKe,Hp]=S1e(H3),C1e=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=t,s=wS(e),l=_.useRef(null),[c,u]=_.useState(!1),[d,f]=Ao({prop:r,defaultProp:o??!1,onChange:i,caller:H3});return y.jsx(ek,{...s,children:y.jsx(uKe,{scope:e,contentId:Do(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:a,children:n})})};C1e.displayName=H3;let f9;f9="PopoverAnchor",HM=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Hp(f9,n),i=wS(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return _.useEffect(()=>(a(),()=>s()),[a,s]),y.jsx(tk,{...i,...r,ref:e})}),HM.displayName=f9;var _1e="PopoverTrigger",T1e=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Hp(_1e,n),i=wS(n),a=ln(e,o.triggerRef),s=y.jsx(_t.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":D1e(o.open),...r,ref:a,onClick:ut(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:y.jsx(tk,{asChild:!0,...i,children:s})});T1e.displayName=_1e;var h9="PopoverPortal",[dKe,fKe]=S1e(h9,{forceMount:void 0}),P1e=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,i=Hp(h9,e);return y.jsx(dKe,{scope:e,forceMount:n,children:y.jsx(Uo,{present:n||i.open,children:y.jsx(zg,{asChild:!0,container:o,children:r})})})};P1e.displayName=h9;var H1="PopoverContent",E1e=_.forwardRef((t,e)=>{const n=fKe(H1,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,i=Hp(H1,t.__scopePopover);return y.jsx(Uo,{present:r||i.open,children:i.modal?y.jsx(pKe,{...o,ref:e}):y.jsx(mKe,{...o,ref:e})})});E1e.displayName=H1;var hKe=pp("PopoverContent.RemoveScroll"),pKe=_.forwardRef((t,e)=>{const n=Hp(H1,t.__scopePopover),r=_.useRef(null),o=ln(e,r),i=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return WR(a)},[]),y.jsx(Mk,{as:hKe,allowPinchZoom:!0,children:y.jsx(R1e,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ut(t.onCloseAutoFocus,a=>{var s;a.preventDefault(),i.current||((s=n.triggerRef.current)==null||s.focus())}),onPointerDownOutside:ut(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ut(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),mKe=_.forwardRef((t,e)=>{const n=Hp(H1,t.__scopePopover),r=_.useRef(!1),o=_.useRef(!1);return y.jsx(R1e,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||((s=n.triggerRef.current)==null||s.focus()),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),R1e=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=t,f=Hp(H1,n),h=wS(n);return IR(),y.jsx(Ak,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:y.jsx(Rp,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:y.jsx(DE,{"data-state":D1e(f.open),role:"dialog",id:f.contentId,...h,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),j1e="PopoverClose",p9=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Hp(j1e,n);return y.jsx(_t.button,{type:"button",...r,ref:e,onClick:ut(t.onClick,()=>o.onOpenChange(!1))})});p9.displayName=j1e;var gKe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=wS(n);return y.jsx(AE,{...o,...r,ref:e})});function D1e(t){return t?"open":"closed"}gKe.displayName="PopoverArrow";var vKe=C1e,yKe=T1e,bKe=P1e,A1e=E1e,xKe=p9;const m9={},kS={};function SS(t,e){try{const n=(m9[t]||(m9[t]=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format))(e).split("GMT")[1]||"";return n in kS?kS[n]:M1e(n,n.split(":"))}catch{if(t in kS)return kS[t];const n=t==null?void 0:t.match(OKe);return n?M1e(t,n.slice(1)):NaN}}const OKe=/([+-]\d\d):?(\d\d)?/;function M1e(t,e){const n=+e[0],r=+(e[1]||0);return kS[t]=n>0?60*n+r:60*n-r}class yd extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(SS(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),$1e(this),g9(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new yd(...n,e):new yd(Date.now(),e)}withTimeZone(e){return new yd(+this,e)}getTimezoneOffset(){return-SS(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),g9(this),+this}[Symbol.for("constructDateFrom")](e){return new yd(+new Date(e),this.timeZone)}}const N1e=/^(get|set)(?!UTC)/;function g9(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function $1e(t){const e=SS(t.timeZone,t),n=new Date(+t);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+t).getTimezoneOffset(),o=r- -new Date(+n).getTimezoneOffset(),i=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();o&&i&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+o);const a=r-e;a&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+a);const s=SS(t.timeZone,t),l=-new Date(+t).getTimezoneOffset()-s-a;if(s!==e&&l){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+l);const c=s-SS(t.timeZone,t);c&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+c),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c))}}Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!N1e.test(t))return;const e=t.replace(N1e,"$1UTC");yd.prototype[e]&&(t.startsWith("get")?yd.prototype[t]=function(){return this.internal[e]()}:(yd.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),function(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),$1e(n)}(this),+this},yd.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),g9(this),+this}))});class Y1 extends yd{static tz(e,...n){return n.length?new Y1(...n,e):new Y1(Date.now(),e)}toISOString(){const[e,n,r]=this.tzComponents(),o=`${e}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,r,o]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${e} GMT${n}${r}${o} (${function(i,a){return new Intl.DateTimeFormat("en-GB",{timeZone:i,timeZoneName:"long"}).format(a).slice(12)}(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new Y1(+this,e)}[Symbol.for("constructDateFrom")](e){return new Y1(+new Date(e),this.timeZone)}}let v9,y9;v9=6048e5,L6e=43200,Q6e=1440,y9=Symbol.for("constructDateFrom"),hf=function(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&y9 in t?t[y9](e):t instanceof Date?new t.constructor(e):new Date(e)},Ks=function(t,e){return hf(e||t,t)};let wKe={};TO=function(){return wKe};function CS(t,e){var s,l,c,u;const n=TO(),r=(e==null?void 0:e.weekStartsOn)??((l=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ks(t,e==null?void 0:e.in),i=o.getDay(),a=(i<r?7:0)+i-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function Y3(t,e){return CS(t,{...e,weekStartsOn:1})}function I1e(t,e){const n=Ks(t,e==null?void 0:e.in),r=n.getFullYear(),o=hf(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=Y3(o),a=hf(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const s=Y3(a);return n.getTime()>=i.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}$M=function(t){const e=Ks(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n},GG=function(t,...e){const n=hf.bind(null,e.find(r=>typeof r=="object"));return e.map(n)};function Q1e(t,e){const n=Ks(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}MH=function(t){return!(!((e=t)instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")&&typeof t!="number"||isNaN(+Ks(t)));var e};const kKe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function b9(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const SKe={date:b9({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:b9({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:b9({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},CKe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function _S(t){return(e,n)=>{let r;if((n!=null&&n.context?String(n.context):"standalone")==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,i=n!=null&&n.width?String(n.width):o;r=t.formattingValues[i]||t.formattingValues[o]}else{const o=t.defaultWidth,i=n!=null&&n.width?String(n.width):t.defaultWidth;r=t.values[i]||t.values[o]}return r[t.argumentCallback?t.argumentCallback(e):e]}}const _Ke={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:_S({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:_S({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:_S({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:_S({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:_S({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function TS(t){return(e,n={})=>{const r=n.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(o);if(!i)return null;const a=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(s)?function(u,d){for(let f=0;f<u.length;f++)if(d(u[f]))return f}(s,u=>u.test(a)):function(u,d){for(const f in u)if(Object.prototype.hasOwnProperty.call(u,f)&&d(u[f]))return f}(s,u=>u.test(a));let c;return c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:e.slice(a.length)}}}const TKe={ordinalNumber:(PS={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(PS.matchPattern);if(!n)return null;const r=n[0],o=t.match(PS.parsePattern);if(!o)return null;let i=PS.valueCallback?PS.valueCallback(o[0]):o[0];return i=e.valueCallback?e.valueCallback(i):i,{value:i,rest:t.slice(r.length)}}),era:TS({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:TS({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:TS({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:TS({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:TS({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var PS;tK={code:"en-US",formatDistance:(t,e,n)=>{let r;const o=kKe[t];return r=typeof o=="string"?o:e===1?o.one:o.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:SKe,formatRelative:(t,e,n,r)=>CKe[t],localize:_Ke,match:TKe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PKe(t,e){const n=Ks(t,e==null?void 0:e.in);return function(o,i){const[a,s]=GG(0,o,i),l=Q1e(a),c=Q1e(s),u=+l-$M(l),d=+c-$M(c);return Math.round((u-d)/864e5)}(n,function(o,i){const a=Ks(o,i==null?void 0:i.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}(n))+1}function EKe(t,e){const n=Ks(t,e==null?void 0:e.in),r=+Y3(n)-+function(o,i){const a=I1e(o,i),s=hf(o,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),Y3(s)}(n);return Math.round(r/v9)+1}function L1e(t,e){var u,d,f,h;const n=Ks(t,e==null?void 0:e.in),r=n.getFullYear(),o=TO(),i=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,a=hf((e==null?void 0:e.in)||t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const s=CS(a,e),l=hf((e==null?void 0:e.in)||t,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=CS(l,e);return+n>=+s?r+1:+n>=+c?r:r-1}function RKe(t,e){const n=Ks(t,e==null?void 0:e.in),r=+CS(n,e)-+function(o,i){var u,d,f,h;const a=TO(),s=(i==null?void 0:i.firstWeekContainsDate)??((d=(u=i==null?void 0:i.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((h=(f=a.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,l=L1e(o,i),c=hf((i==null?void 0:i.in)||o,0);return c.setFullYear(l,0,s),c.setHours(0,0,0,0),CS(c,i)}(n,e);return Math.round(r/v9)+1}function Lr(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const Yp={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Lr(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Lr(n+1,2)},d:(t,e)=>Lr(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h:(t,e)=>Lr(t.getHours()%12||12,e.length),H:(t,e)=>Lr(t.getHours(),e.length),m:(t,e)=>Lr(t.getMinutes(),e.length),s:(t,e)=>Lr(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return Lr(Math.trunc(r*Math.pow(10,n-3)),e.length)}},jKe="midnight",DKe="noon",AKe="morning",MKe="afternoon",NKe="evening",$Ke="night",z1e={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Yp.y(t,e)},Y:function(t,e,n,r){const o=L1e(t,r),i=o>0?o:1-o;return e==="YY"?Lr(i%100,2):e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Lr(i,e.length)},R:function(t,e){return Lr(I1e(t),e.length)},u:function(t,e){return Lr(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Lr(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Lr(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Yp.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Lr(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const o=RKe(t,r);return e==="wo"?n.ordinalNumber(o,{unit:"week"}):Lr(o,e.length)},I:function(t,e,n){const r=EKe(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Lr(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Yp.d(t,e)},D:function(t,e,n){const r=PKe(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Lr(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const o=t.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Lr(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const o=t.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Lr(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),o=r===0?7:r;switch(e){case"i":return String(o);case"ii":return Lr(o,e.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let o;switch(o=r===12?DKe:r===0?jKe:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let o;switch(o=r>=17?NKe:r>=12?MKe:r>=4?AKe:$Ke,e){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Yp.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Yp.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Lr(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Lr(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Yp.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Yp.s(t,e)},S:function(t,e){return Yp.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return q1e(r);case"XXXX":case"XX":return f0(r);default:return f0(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return q1e(r);case"xxxx":case"xx":return f0(r);default:return f0(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+V1e(r,":");default:return"GMT"+f0(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+V1e(r,":");default:return"GMT"+f0(r,":")}},t:function(t,e,n){return Lr(Math.trunc(+t/1e3),e.length)},T:function(t,e,n){return Lr(+t,e.length)}};function V1e(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+e+Lr(i,2)}function q1e(t,e){return t%60==0?(t>0?"-":"+")+Lr(Math.abs(t)/60,2):f0(t,e)}function f0(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+Lr(Math.trunc(r/60),2)+e+Lr(r%60,2)}const F1e=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},B1e=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},IKe={p:B1e,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return F1e(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",F1e(r,e)).replace("{{time}}",B1e(o,e))}},QKe=/^D+$/,LKe=/^Y+$/,zKe=["D","DD","YY","YYYY"],VKe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qKe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FKe=/^'([^]*?)'?$/,BKe=/''/g,WKe=/[a-zA-Z]/;function x9(t,e,n){var u,d,f,h;const r=TO(),o=r.locale??tK,i=r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,s=Ks(t,n==null?void 0:n.in);if(!MH(s))throw new RangeError("Invalid time value");let l=e.match(qKe).map(g=>{const v=g[0];return v==="p"||v==="P"?(0,IKe[v])(g,o.formatLong):g}).join("").match(VKe).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const v=g[0];if(v==="'")return{isToken:!1,value:UKe(g)};if(z1e[v])return{isToken:!0,value:g};if(v.match(WKe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:g}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const c={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return l.map(g=>{if(!g.isToken)return g.value;const v=g.value;return(function(b){return LKe.test(b)}(v)||function(b){return QKe.test(b)}(v))&&function(b,p,O){const k=function(S,w,T){const P=S[0]==="Y"?"years":"days of the month";return`Use \`${S.toLowerCase()}\` instead of \`${S}\` (in \`${w}\`) for formatting ${P} to the input \`${T}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(b,p,O);if(console.warn(k),zKe.includes(b))throw new RangeError(k)}(v,e,String(t)),(0,z1e[v[0]])(s,v,o.localize,c)}).join("")}function UKe(t){const e=t.match(FKe);return e?e[1].replace(BKe,"'"):t}function ZKe(t,e){if(t==null)return"";try{return e==="date"?new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}):new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch(n){return Ve.warn("Failed to parse date",n),t.toString()}}function XKe(t,e){const n=t.getUTCMilliseconds()!==0;try{if(e){const r=new Y1(t,e),o=function(i){var a;try{return((a=new Intl.DateTimeFormat("en-US",{timeZone:i,timeZoneName:"short"}).formatToParts(new Date).find(l=>l.type==="timeZoneName"))==null?void 0:a.value)??""}catch(s){return Ve.warn("Failed to get abbrev",s),i}}(e);return n?`${x9(r,"yyyy-MM-dd HH:mm:ss.SSS")} ${o}`:`${x9(r,"yyyy-MM-dd HH:mm:ss")} ${o}`}return x9(t,n?"yyyy-MM-dd HH:mm:ss.SSS":"yyyy-MM-dd HH:mm:ss")}catch(r){return Ve.warn("Failed to parse date",r),t.toISOString()}}qIe=function(t){if(t==null||t===0)return"";try{const e=new Date(t),n=new Date,r=new Date;return r.setDate(r.getDate()-1),e.toDateString()===n.toDateString()?`Today at ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"numeric"})}`:e.toDateString()===r.toDateString()?`Yesterday at ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"numeric"})}`:`${e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})} at ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"numeric"})}`}catch(e){Ve.warn("Failed to parse date",e)}return t.toString()};let G3;Vv={keyBy(t,e){const n=new Map,r=new Set;for(const o of t){const i=e(o);n.has(i)&&r.add(i),n.set(i,o)}return r.size>0&&Ve.trace(`Duplicate keys: ${[...r].join(", ")}`),n},collect:(t,e,n)=>Vv.mapValues(Vv.keyBy(t,e),n),filterMap(t,e){const n=new Map;for(const[r,o]of t)e(o,r)&&n.set(r,o);return n},mapValues(t,e){const n=new Map;for(const[r,o]of t)n.set(r,e(o,r));return n}},G3=t=>{const e=ue.c(6),{container:n,children:r}=t;let o;e:{if(!n){let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=z6({key:"mo",prepend:!0}),e[0]=l):l=e[0],o=l;break e}let s;if(e[1]!==n){let l=n.querySelector("style");l||(l=document.createElement("style"),n.append(l)),s=z6({key:"mo",prepend:!0,container:l}),e[1]=n,e[2]=s}else s=e[2];o=s}const i=o;let a;return e[3]!==i||e[4]!==r?(a=y.jsx(tWe,{value:i,children:r}),e[3]=i,e[4]=r,e[5]=a):a=e[5],a};function G1(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var K3="Checkbox",[HKe,Nyt]=Wo(K3),[YKe,O9]=HKe(K3);function GKe(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:i,form:a,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,h]=Ao({prop:n,defaultProp:o??!1,onChange:l,caller:K3}),[g,v]=_.useState(null),[b,p]=_.useState(null),O=_.useRef(!1),k=!g||!!a||!!g.closest("form"),S={checked:f,disabled:i,setChecked:h,control:g,setControl:v,name:s,form:a,value:u,hasConsumerStoppedPropagationRef:O,required:c,defaultChecked:!Gp(o)&&o,isFormControl:k,bubbleInput:b,setBubbleInput:p};return y.jsx(YKe,{scope:e,...S,children:KKe(d)?d(S):r})}var W1e="CheckboxTrigger",U1e=_.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},o)=>{const{control:i,value:a,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:h,bubbleInput:g}=O9(W1e,t),v=ln(o,u),b=_.useRef(l);return _.useEffect(()=>{const p=i==null?void 0:i.form;if(p){const O=()=>d(b.current);return p.addEventListener("reset",O),()=>p.removeEventListener("reset",O)}},[i,d]),y.jsx(_t.button,{type:"button",role:"checkbox","aria-checked":Gp(l)?"mixed":l,"aria-required":c,"data-state":G1e(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:v,onKeyDown:ut(e,p=>{p.key==="Enter"&&p.preventDefault()}),onClick:ut(n,p=>{d(O=>!!Gp(O)||!O),g&&h&&(f.current=p.isPropagationStopped(),f.current||p.stopPropagation())})})});U1e.displayName=W1e;var w9=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=t;return y.jsx(GKe,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>y.jsxs(y.Fragment,{children:[y.jsx(U1e,{...d,ref:e,__scopeCheckbox:n}),f&&y.jsx(Y1e,{__scopeCheckbox:n})]})})});w9.displayName=K3;var Z1e="CheckboxIndicator",X1e=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...o}=t,i=O9(Z1e,n);return y.jsx(Uo,{present:r||Gp(i.checked)||i.checked===!0,children:y.jsx(_t.span,{"data-state":G1e(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:e,style:{pointerEvents:"none",...t.style}})})});X1e.displayName=Z1e;var H1e="CheckboxBubbleInput",Y1e=_.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:i,defaultChecked:a,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:h}=O9(H1e,t),g=ln(n,h),v=G1(i),b=Jw(r);_.useEffect(()=>{const O=f;if(!O)return;const k=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(k,"checked").set,w=!o.current;if(v!==i&&S){const T=new Event("click",{bubbles:w});O.indeterminate=Gp(i),S.call(O,!Gp(i)&&i),O.dispatchEvent(T)}},[f,v,i,o]);const p=_.useRef(!Gp(i)&&i);return y.jsx(_t.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??p.current,required:s,disabled:l,name:c,value:u,form:d,...e,tabIndex:-1,ref:g,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function KKe(t){return typeof t=="function"}function Gp(t){return t==="indeterminate"}function G1e(t){return Gp(t)?"indeterminate":t?"checked":"unchecked"}Y1e.displayName=H1e,Tl=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r),n[3]=r,n[4]=i):i=n[4],n[5]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(X1e,{className:we("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:y.jsx(rg,{className:"h-4 w-4"})}),n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==i?(s=y.jsx(w9,{ref:e,className:i,...o,children:a}),n[6]=o,n[7]=e,n[8]=i,n[9]=s):s=n[9],s}),Tl.displayName=w9.displayName;let K1e,J1e;dg=vKe,sy=yKe,K1e=ey(bKe),J1e=xKe,tp=_.forwardRef((t,e)=>{const n=ue.c(22);let r,o,i,a,s,l;n[0]!==t?({className:r,align:i,sideOffset:a,portal:s,scrollable:l,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a,n[5]=s,n[6]=l):(r=n[1],o=n[2],i=n[3],a=n[4],s=n[5],l=n[6]);const c=i===void 0?"center":i,u=a===void 0?4:a,d=s===void 0||s,f=l!==void 0&&l,h=f&&"overflow-auto";let g;n[7]!==r||n[8]!==h?(g=we("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r,h),n[7]=r,n[8]=h,n[9]=g):g=n[9];const v=f?"calc(var(--radix-popover-content-available-height) - 30px)":void 0;let b,p;n[10]!==o.style||n[11]!==v?(b={...o.style,maxHeight:v},n[10]=o.style,n[11]=v,n[12]=b):b=n[12],n[13]!==c||n[14]!==o||n[15]!==e||n[16]!==u||n[17]!==g||n[18]!==b?(p=y.jsx(lf,{children:y.jsx(A1e,{ref:e,align:c,sideOffset:u,className:g,style:b,...o})}),n[13]=c,n[14]=o,n[15]=e,n[16]=u,n[17]=g,n[18]=b,n[19]=p):p=n[19];const O=p;if(d){let k;return n[20]!==O?(k=y.jsx(K1e,{children:O}),n[20]=O,n[21]=k):k=n[21],k}return O}),tp.displayName=A1e.displayName;let J3,k9,ebe,tbe,nbe,K1,J1,rbe,obe,Kp,eb,S9,C9,Kf,ibe,tb,_9;J3=["Enter"," "],k9=["ArrowUp","PageDown","End"],ebe=["ArrowDown","PageUp","Home",...k9],tbe={ltr:[...J3,"ArrowRight"],rtl:[...J3,"ArrowLeft"]},nbe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},K1="Menu",[J1,rbe,obe]=Lp(K1),[Kp,lN]=Wo(K1,[obe,Ap,X1]),eb=Ap(),S9=X1(),[C9,Kf]=Kp(K1),[ibe,tb]=Kp(K1),_9=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=t,s=eb(e),[l,c]=_.useState(null),u=_.useRef(!1),d=Lo(i),f=yf(o);return _.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),y.jsx(ek,{...s,children:y.jsx(C9,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c,children:y.jsx(ibe,{scope:e,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})},_9.displayName=K1;var T9=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=eb(n);return y.jsx(tk,{...o,...r,ref:e})});T9.displayName="MenuAnchor";var P9="MenuPortal",[JKe,abe]=Kp(P9,{forceMount:void 0}),sbe=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=Kf(P9,e);return y.jsx(JKe,{scope:e,forceMount:n,children:y.jsx(Uo,{present:n||i.open,children:y.jsx(zg,{asChild:!0,container:o,children:r})})})};sbe.displayName=P9;var tc="MenuContent",[eJe,E9]=Kp(tc),lbe=_.forwardRef((t,e)=>{const n=abe(tc,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=Kf(tc,t.__scopeMenu),a=tb(tc,t.__scopeMenu);return y.jsx(J1.Provider,{scope:t.__scopeMenu,children:y.jsx(Uo,{present:r||i.open,children:y.jsx(J1.Slot,{scope:t.__scopeMenu,children:a.modal?y.jsx(tJe,{...o,ref:e}):y.jsx(nJe,{...o,ref:e})})})})}),tJe=_.forwardRef((t,e)=>{const n=Kf(tc,t.__scopeMenu),r=_.useRef(null),o=ln(e,r);return _.useEffect(()=>{const i=r.current;if(i)return WR(i)},[]),y.jsx(R9,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ut(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),nJe=_.forwardRef((t,e)=>{const n=Kf(tc,t.__scopeMenu);return y.jsx(R9,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),rJe=pp("MenuContent.ScrollLock"),R9=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,...v}=t,b=Kf(tc,n),p=tb(tc,n),O=eb(n),k=S9(n),S=rbe(n),[w,T]=_.useState(null),P=_.useRef(null),j=ln(e,P,b.onContentChange),D=_.useRef(0),N=_.useRef(""),E=_.useRef(0),A=_.useRef(null),I=_.useRef("right"),L=_.useRef(0),F=g?Mk:_.Fragment,Q=g?{as:rJe,allowPinchZoom:!0}:void 0,W=X=>{var oe,ie;const G=N.current+X,ae=S().filter(Y=>!Y.disabled),ne=document.activeElement,re=(oe=ae.find(Y=>Y.ref.current===ne))==null?void 0:oe.textValue,Z=function(Y,le,me){const ce=le.length>1&&Array.from(le).every(Ae=>Ae===le[0]),ve=ce?le[0]:le,ye=me?Y.indexOf(me):-1;let _e=function(Ae,je){return Ae.map((Ie,De)=>Ae[(je+De)%Ae.length])}(Y,Math.max(ye,0));ve.length===1&&(_e=_e.filter(Ae=>Ae!==me));const Se=_e.find(Ae=>Ae.toLowerCase().startsWith(ve.toLowerCase()));return Se!==me?Se:void 0}(ae.map(Y=>Y.textValue),G,re),K=(ie=ae.find(Y=>Y.textValue===Z))==null?void 0:ie.ref.current;(function Y(le){N.current=le,window.clearTimeout(D.current),le!==""&&(D.current=window.setTimeout(()=>Y(""),1e3))})(G),K&&setTimeout(()=>K.focus())};_.useEffect(()=>()=>window.clearTimeout(D.current),[]),IR();const U=_.useCallback(X=>{var G,ae;return I.current===((G=A.current)==null?void 0:G.side)&&function(ne,re){if(!re)return!1;const Z={x:ne.clientX,y:ne.clientY};return function(K,oe){const{x:ie,y:Y}=K;let le=!1;for(let me=0,ce=oe.length-1;me<oe.length;ce=me++){const ve=oe[me],ye=oe[ce],_e=ve.x,Se=ve.y,Ae=ye.x,je=ye.y;Se>Y!=je>Y&&ie<(Ae-_e)*(Y-Se)/(je-Se)+_e&&(le=!le)}return le}(Z,re)}(X,(ae=A.current)==null?void 0:ae.area)},[]);return y.jsx(eJe,{scope:n,searchRef:N,onItemEnter:_.useCallback(X=>{U(X)&&X.preventDefault()},[U]),onItemLeave:_.useCallback(X=>{var G;U(X)||((G=P.current)==null||G.focus(),T(null))},[U]),onTriggerLeave:_.useCallback(X=>{U(X)&&X.preventDefault()},[U]),pointerGraceTimerRef:E,onPointerGraceIntentChange:_.useCallback(X=>{A.current=X},[]),children:y.jsx(F,{...Q,children:y.jsx(Ak,{asChild:!0,trapped:o,onMountAutoFocus:ut(i,X=>{var G;X.preventDefault(),(G=P.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:y.jsx(Rp,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:y.jsx(c9,{asChild:!0,...k,dir:p.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:ut(l,X=>{p.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(DE,{role:"menu","aria-orientation":"vertical","data-state":_be(b.open),"data-radix-menu-content":"",dir:p.dir,...O,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:ut(v.onKeyDown,X=>{const G=X.target.closest("[data-radix-menu-content]")===X.currentTarget,ae=X.ctrlKey||X.altKey||X.metaKey,ne=X.key.length===1;G&&(X.key==="Tab"&&X.preventDefault(),!ae&&ne&&W(X.key));const re=P.current;if(X.target!==re||!ebe.includes(X.key))return;X.preventDefault();const Z=S().filter(K=>!K.disabled).map(K=>K.ref.current);k9.includes(X.key)&&Z.reverse(),function(K){const oe=document.activeElement;for(const ie of K)if(ie===oe||(ie.focus(),document.activeElement!==oe))return}(Z)}),onBlur:ut(t.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(D.current),N.current="")}),onPointerMove:ut(t.onPointerMove,RS(X=>{const G=X.target,ae=L.current!==X.clientX;if(X.currentTarget.contains(G)&&ae){const ne=X.clientX>L.current?"right":"left";I.current=ne,L.current=X.clientX}}))})})})})})})});lbe.displayName=tc;var j9=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(_t.div,{role:"group",...r,ref:e})});j9.displayName="MenuGroup";var cbe=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(_t.div,{...r,ref:e})});cbe.displayName="MenuLabel";var ej="MenuItem",ube="menu.itemSelect",tj=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,i=_.useRef(null),a=tb(ej,t.__scopeMenu),s=E9(ej,t.__scopeMenu),l=ln(e,i),c=_.useRef(!1);return y.jsx(dbe,{...o,ref:l,disabled:n,onClick:ut(t.onClick,()=>{const u=i.current;if(!n&&u){const d=new CustomEvent(ube,{bubbles:!0,cancelable:!0});u.addEventListener(ube,f=>r==null?void 0:r(f),{once:!0}),Hw(u,d),d.defaultPrevented?c.current=!1:a.onClose()}}),onPointerDown:u=>{var d;(d=t.onPointerDown)==null||d.call(t,u),c.current=!0},onPointerUp:ut(t.onPointerUp,u=>{var d;c.current||((d=u.currentTarget)==null||d.click())}),onKeyDown:ut(t.onKeyDown,u=>{const d=s.searchRef.current!=="";n||d&&u.key===" "||J3.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});tj.displayName=ej;var dbe=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,a=E9(ej,n),s=S9(n),l=_.useRef(null),c=ln(e,l),[u,d]=_.useState(!1),[f,h]=_.useState("");return _.useEffect(()=>{const g=l.current;g&&h((g.textContent??"").trim())},[i.children]),y.jsx(J1.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:y.jsx(u9,{asChild:!0,...s,focusable:!r,children:y.jsx(_t.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:ut(t.onPointerMove,RS(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),!g.defaultPrevented&&g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ut(t.onPointerLeave,RS(g=>a.onItemLeave(g))),onFocus:ut(t.onFocus,()=>d(!0)),onBlur:ut(t.onBlur,()=>d(!1))})})})}),fbe=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return y.jsx(vbe,{scope:t.__scopeMenu,checked:n,children:y.jsx(tj,{role:"menuitemcheckbox","aria-checked":nj(n)?"mixed":n,...o,ref:e,"data-state":M9(n),onSelect:ut(o.onSelect,()=>r==null?void 0:r(!!nj(n)||!n),{checkForDefaultPrevented:!1})})})});fbe.displayName="MenuCheckboxItem";var hbe="MenuRadioGroup",[oJe,iJe]=Kp(hbe,{value:void 0,onValueChange:()=>{}}),pbe=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,i=Lo(r);return y.jsx(oJe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:y.jsx(j9,{...o,ref:e})})});pbe.displayName=hbe;var mbe="MenuRadioItem",gbe=_.forwardRef((t,e)=>{const{value:n,...r}=t,o=iJe(mbe,t.__scopeMenu),i=n===o.value;return y.jsx(vbe,{scope:t.__scopeMenu,checked:i,children:y.jsx(tj,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":M9(i),onSelect:ut(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});gbe.displayName=mbe;var D9="MenuItemIndicator",[vbe,aJe]=Kp(D9,{checked:!1}),ybe=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,i=aJe(D9,n);return y.jsx(Uo,{present:r||nj(i.checked)||i.checked===!0,children:y.jsx(_t.span,{...o,ref:e,"data-state":M9(i.checked)})})});ybe.displayName=D9;var bbe=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(_t.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});bbe.displayName="MenuSeparator";var xbe=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=eb(n);return y.jsx(AE,{...o,...r,ref:e})});xbe.displayName="MenuArrow";var A9="MenuSub",[sJe,Obe]=Kp(A9),wbe=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,i=Kf(A9,e),a=eb(e),[s,l]=_.useState(null),[c,u]=_.useState(null),d=Lo(o);return _.useEffect(()=>(i.open===!1&&d(!1),()=>d(!1)),[i.open,d]),y.jsx(ek,{...a,children:y.jsx(C9,{scope:e,open:r,onOpenChange:d,content:c,onContentChange:u,children:y.jsx(sJe,{scope:e,contentId:Do(),triggerId:Do(),trigger:s,onTriggerChange:l,children:n})})})};wbe.displayName=A9;var ES="MenuSubTrigger",kbe=_.forwardRef((t,e)=>{const n=Kf(ES,t.__scopeMenu),r=tb(ES,t.__scopeMenu),o=Obe(ES,t.__scopeMenu),i=E9(ES,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},u=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),y.jsx(T9,{asChild:!0,...c,children:y.jsx(dbe,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":_be(n.open),...t,ref:Lu(e,o.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),t.disabled||d.defaultPrevented||(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ut(t.onPointerMove,RS(d=>{i.onItemEnter(d),d.defaultPrevented||t.disabled||n.open||a.current||(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ut(t.onPointerLeave,RS(d=>{var h,g;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const v=(g=n.content)==null?void 0:g.dataset.side,b=v==="right",p=b?-5:5,O=f[b?"left":"right"],k=f[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+p,y:d.clientY},{x:O,y:f.top},{x:k,y:f.top},{x:k,y:f.bottom},{x:O,y:f.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ut(t.onKeyDown,d=>{var h;const f=i.searchRef.current!=="";t.disabled||f&&d.key===" "||tbe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});kbe.displayName=ES;var Sbe="MenuSubContent",Cbe=_.forwardRef((t,e)=>{const n=abe(tc,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=Kf(tc,t.__scopeMenu),a=tb(tc,t.__scopeMenu),s=Obe(Sbe,t.__scopeMenu),l=_.useRef(null),c=ln(e,l);return y.jsx(J1.Provider,{scope:t.__scopeMenu,children:y.jsx(Uo,{present:r||i.open,children:y.jsx(J1.Slot,{scope:t.__scopeMenu,children:y.jsx(R9,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ut(t.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ut(t.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:ut(t.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=nbe[a.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),(h=s.trigger)==null||h.focus(),u.preventDefault())})})})})})});function _be(t){return t?"open":"closed"}function nj(t){return t==="indeterminate"}function M9(t){return nj(t)?"indeterminate":t?"checked":"unchecked"}function RS(t){return e=>e.pointerType==="mouse"?t(e):void 0}Cbe.displayName=Sbe;let Tbe,jS,Pbe,lJe,ua,Ebe,N9,$9;kJ=_9,aJ=T9,SJ=sbe,sJ=lbe,pJ=j9,mJ=cbe,iJ=tj,gJ=fbe,vJ=pbe,yJ=gbe,bJ=ybe,oJ=bbe,xJ=xbe,Tbe=wbe,OJ=kbe,wJ=Cbe,jS="DropdownMenu",[Pbe,lJe]=Wo(jS,[lN]),ua=lN(),[Ebe,N9]=Pbe(jS),$9=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=t,l=ua(e),c=_.useRef(null),[u,d]=Ao({prop:o,defaultProp:i??!1,onChange:a,caller:jS});return y.jsx(Ebe,{scope:e,triggerId:Do(),triggerRef:c,contentId:Do(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(f=>!f),[d]),modal:s,children:y.jsx(kJ,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},$9.displayName=jS;var Rbe="DropdownMenuTrigger",jbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=N9(Rbe,n),a=ua(n);return y.jsx(aJ,{asChild:!0,...a,children:y.jsx(_t.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Lu(e,i.triggerRef),onPointerDown:ut(t.onPointerDown,s=>{r||s.button!==0||s.ctrlKey!==!1||(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:ut(t.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});jbe.displayName=Rbe;var Dbe=t=>{const{__scopeDropdownMenu:e,...n}=t,r=ua(e);return y.jsx(SJ,{...r,...n})};Dbe.displayName="DropdownMenuPortal";var Abe="DropdownMenuContent",Mbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=N9(Abe,n),i=ua(n),a=_.useRef(!1);return y.jsx(sJ,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:e,onCloseAutoFocus:ut(t.onCloseAutoFocus,s=>{var l;a.current||((l=o.triggerRef.current)==null||l.focus()),a.current=!1,s.preventDefault()}),onInteractOutside:ut(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;o.modal&&!u||(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mbe.displayName=Abe;var Nbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(pJ,{...o,...r,ref:e})});Nbe.displayName="DropdownMenuGroup";var $be=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(mJ,{...o,...r,ref:e})});$be.displayName="DropdownMenuLabel";var Ibe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(iJ,{...o,...r,ref:e})});Ibe.displayName="DropdownMenuItem";var Qbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(gJ,{...o,...r,ref:e})});Qbe.displayName="DropdownMenuCheckboxItem";var cJe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(vJ,{...o,...r,ref:e})});cJe.displayName="DropdownMenuRadioGroup";var Lbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(yJ,{...o,...r,ref:e})});Lbe.displayName="DropdownMenuRadioItem";var zbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(bJ,{...o,...r,ref:e})});zbe.displayName="DropdownMenuItemIndicator";var Vbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(oJ,{...o,...r,ref:e})});Vbe.displayName="DropdownMenuSeparator";var uJe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(xJ,{...o,...r,ref:e})});uJe.displayName="DropdownMenuArrow";var qbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(OJ,{...o,...r,ref:e})});qbe.displayName="DropdownMenuSubTrigger";var Fbe=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=ua(n);return y.jsx(wJ,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Fbe.displayName="DropdownMenuSubContent";var dJe=$9,fJe=jbe,hJe=Dbe,Bbe=Mbe,pJe=Nbe,Wbe=$be,Ube=Ibe,Zbe=Qbe,Xbe=Lbe,Hbe=zbe,Ybe=Vbe,mJe=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:i}=t,a=ua(e),[s,l]=Ao({prop:r,defaultProp:i??!1,onChange:o,caller:"DropdownMenuSub"});return y.jsx(Tbe,{...a,open:s,onOpenChange:l,children:n})},Gbe=qbe,Kbe=Fbe;let DS,I9,rj;vN=Po("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",{variants:{subcontent:{true:"shadow-lg"}}}),CJ=Po("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",{variants:{inset:{true:"pl-8"}}}),DS="data-[disabled]:pointer-events-none data-[disabled]:opacity-50",I9=Po(we("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground",DS),{variants:{}}),yN=Po("absolute left-2 flex h-3.5 w-3.5 items-center justify-center",{variants:{}}),_J=Po("px-2 py-1.5 text-sm font-semibold",{variants:{inset:{true:"pl-8"}}}),gN=Po(we("menu-item relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",DS),{variants:{inset:{true:"pl-8"},variant:{default:"focus:bg-accent focus:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",danger:"focus:bg-[var(--red-5)] focus:text-[var(--red-12)] aria-selected:bg-[var(--red-5)] aria-selected:text-[var(--red-12)]",muted:"focus:bg-muted/70 focus:text-muted-foreground aria-selected:bg-muted/70 aria-selected:text-muted-foreground",success:"focus:bg-[var(--grass-3)] focus:text-[var(--grass-11)] aria-selected:bg-[var(--grass-3)] aria-selected:text-[var(--grass-11)]",disabled:"text-muted-foreground"}},defaultVariants:{variant:"default"}}),mN=Po("-mx-1 my-1 h-px bg-border last:hidden",{variants:{}}),rj=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("ml-auto text-xs tracking-widest opacity-60",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx("span",{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},rj.displayName="MenuShortcut";let Jbe;Hm=dJe,Gm=fJe,Jbe=pJe,cy=ey(hJe),hg=mJe,bO=ge.forwardRef((t,e)=>{const n=ue.c(14);let r,o,i,a,s,l,c;return n[0]!==t?({className:o,inset:i,children:r,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==o||n[6]!==i?(s=CJ({className:o,inset:i}),n[5]=o,n[6]=i,n[7]=s):s=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(Qh,{className:"ml-auto h-4 w-4"}),n[8]=l):l=n[8],n[9]!==r||n[10]!==a||n[11]!==e||n[12]!==s?(c=y.jsxs(Gbe,{ref:e,className:s,...a,children:[r,l]}),n[9]=r,n[10]=a,n[11]=e,n[12]=s,n[13]=c):c=n[13],c}),bO.displayName=Gbe.displayName,pg=ge.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we(vN({subcontent:!0}),"animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Kbe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),pg.displayName=Kbe.displayName,zh=ge.forwardRef((t,e)=>{const n=ue.c(17);let r,o,i,a;n[0]!==t?({className:r,scrollable:i,sideOffset:a,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]);const s=i===void 0||i,l=a===void 0?4:a;let c;n[5]!==r||n[6]!==s?(c=we(vN(),"animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s&&"overflow-auto",r),n[5]=r,n[6]=s,n[7]=c):c=n[7];const u=s?"calc(var(--radix-dropdown-menu-content-available-height) - 30px)":void 0;let d,f;return n[8]!==o.style||n[9]!==u?(d={...o.style,maxHeight:u},n[8]=o.style,n[9]=u,n[10]=d):d=n[10],n[11]!==o||n[12]!==e||n[13]!==l||n[14]!==c||n[15]!==d?(f=y.jsx(cy,{children:y.jsx(lf,{children:y.jsx(Bbe,{ref:e,sideOffset:l,className:c,style:d,...o})})}),n[11]=o,n[12]=e,n[13]=l,n[14]=c,n[15]=d,n[16]=f):f=n[16],f}),zh.displayName=Bbe.displayName,$r=ge.forwardRef((t,e)=>{const n=ue.c(13);let r,o,i,a,s,l;return n[0]!==t?({className:r,inset:o,variant:a,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==r||n[6]!==o||n[7]!==a?(s=gN({className:r,inset:o,variant:a}),n[5]=r,n[6]=o,n[7]=a,n[8]=s):s=n[8],n[9]!==i||n[10]!==e||n[11]!==s?(l=y.jsx(Ube,{ref:e,className:s,...i}),n[9]=i,n[10]=e,n[11]=s,n[12]=l):l=n[12],l}),$r.displayName=Ube.displayName,FJ=ge.forwardRef((t,e)=>{const n=ue.c(15);let r,o,i,a,s,l,c,u;return n[0]!==t?({className:i,children:o,checked:r,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==i?(s=I9({className:i}),n[5]=i,n[6]=s):s=n[6],n[7]===Symbol.for("react.memo_cache_sentinel")?(l=yN(),n[7]=l):l=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx("span",{className:l,children:y.jsx(Hbe,{children:y.jsx(rg,{className:"h-4 w-4"})})}),n[8]=c):c=n[8],n[9]!==r||n[10]!==o||n[11]!==a||n[12]!==e||n[13]!==s?(u=y.jsxs(Zbe,{ref:e,className:s,checked:r,...a,children:[c,o]}),n[9]=r,n[10]=o,n[11]=a,n[12]=e,n[13]=s,n[14]=u):u=n[14],u}),FJ.displayName=Zbe.displayName;const gJe=ge.forwardRef((t,e)=>{const n=ue.c(13);let r,o,i,a,s,l,c;return n[0]!==t?({className:o,children:r,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==o?(a=I9({className:o}),n[4]=o,n[5]=a):a=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(s=yN(),n[6]=s):s=n[6],n[7]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx("span",{className:s,children:y.jsx(Hbe,{children:y.jsx(BO,{className:"h-2 w-2 fill-current"})})}),n[7]=l):l=n[7],n[8]!==r||n[9]!==i||n[10]!==e||n[11]!==a?(c=y.jsxs(Xbe,{ref:e,className:a,...i,children:[l,r]}),n[8]=r,n[9]=i,n[10]=e,n[11]=a,n[12]=c):c=n[12],c});gJe.displayName=Xbe.displayName,VM=ge.forwardRef((t,e)=>{const n=ue.c(11);let r,o,i,a,s;return n[0]!==t?({className:r,inset:o,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==r||n[5]!==o?(a=_J({className:r,inset:o}),n[4]=r,n[5]=o,n[6]=a):a=n[6],n[7]!==i||n[8]!==e||n[9]!==a?(s=y.jsx(Wbe,{ref:e,className:a,...i}),n[7]=i,n[8]=e,n[9]=a,n[10]=s):s=n[10],s}),VM.displayName=Wbe.displayName,cf=ge.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=mN({className:r}),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Ybe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),cf.displayName=Ybe.displayName;const vJe=rj,bd={error:(t,e)=>({status:"error",data:e,error:t,isPending:!1,isFetching:!1}),success:t=>({status:"success",data:t,error:void 0,isPending:!1,isFetching:!1}),loading:t=>({status:"loading",data:t,error:void 0,isPending:!1,isFetching:!0}),pending:()=>({status:"pending",data:void 0,error:void 0,isPending:!0,isFetching:!0})};IIe=function(...t){Rn(t.length>0,"combineAsyncData requires at least one response");const e=()=>{t.forEach(i=>i.refetch())},n=t.find(i=>i.status==="error");if(n!=null&&n.error)return{...bd.error(n.error),refetch:e};if(t.every(i=>i.status==="success"))return{...bd.success(t.map(i=>i.data)),refetch:e};const r=t.some(i=>i.status==="loading"),o=t.every(i=>i.data!==void 0);return r&&o?{...bd.loading(t.map(i=>i.data)),refetch:e}:{...bd.pending(),refetch:e}},$a=function(t,e){const n=ue.c(17),[r,o]=_.useState(0);let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i=bd.pending(),n[0]=i):i=n[0];const[a,s]=_.useState(i);let l;n[1]!==t?(l=typeof t=="function"?{fetch:t}:t,n[1]=t,n[2]=l):l=n[2];const c=Fn(l.fetch);let u,d,f,h,g;return n[3]!==c?(u=()=>{const v=new AbortController;let b=!1;const p={previous:()=>{b=!0}};return s(yJe),c(p).then(O=>{v.signal.aborted||b||s(bd.success(O))}).catch(O=>{v.signal.aborted||s(k=>bd.error(O,k.data))}),()=>{v.abort()}},n[3]=c,n[4]=u):u=n[4],n[5]!==e||n[6]!==c||n[7]!==r?(d=[...e,r,c],n[5]=e,n[6]=c,n[7]=r,n[8]=d):d=n[8],_.useEffect(u,d),n[9]!==a?(f=v=>{let b;typeof v=="function"?(Rn(a.status==="success"||a.status==="loading","No previous state value."),b=v(a.data)):b=v,s(bd.success(b))},n[9]=a,n[10]=f):f=n[10],n[11]!==r?(h=()=>o(r+1),n[11]=r,n[12]=h):h=n[12],n[13]!==a||n[14]!==f||n[15]!==h?(g={...a,setData:f,refetch:h},n[13]=a,n[14]=f,n[15]=h,n[16]=g):g=n[16],g};function yJe(t){return t.status==="success"?bd.loading(t.data):bd.pending()}const Q9=Qe({detail:Pe()}),exe=Qe({error:Pe()});q_=function(t){if(!t)return"Unknown error";if(t instanceof Error){const e=Q9.safeParse(t.cause);return e.success?e.data.detail:function(n){const r=function(a){try{return JSON.parse(a)}catch{return a}}(n);if(!r)return n;const o=Q9.safeParse(r);if(o.success)return o.data.detail;const i=exe.safeParse(r);return i.success?i.data.error:n}(t.message)}if(typeof t=="object"){const e=Q9.safeParse(t);if(e.success)return e.data.detail;const n=exe.safeParse(t);if(n.success)return n.data.error}try{return JSON.stringify(t)}catch{return String(t)}};let txe,nxe;Hd=t=>{const e=ue.c(20),{error:n,className:r}=t,[o,i]=_.useState(!1);if(!n)return null;let a;Ve.error(n),e[0]!==n?(a=q_(n),e[0]=n,e[1]=a):a=e[1];const s=a;let l,c,u,d,f,h,g,v,b;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!0),e[2]=l):l=e[2],e[3]!==s?(c=y.jsx("span",{className:"line-clamp-4",children:s}),e[3]=s,e[4]=c):c=e[4],e[5]!==r||e[6]!==c?(u=y.jsx(Km,{kind:"danger",className:r,clickable:!0,onClick:l,children:c}),e[5]=r,e[6]=c,e[7]=u):u=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsx(HR,{children:y.jsx(YR,{className:"text-error",children:"Error"})}),e[8]=d):d=e[8],e[9]!==s?(f=y.jsx("pre",{className:"text-error text-sm p-2 font-mono overflow-auto whitespace-pre-wrap",children:s}),e[9]=s,e[10]=f):f=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsx($k,{children:y.jsx(P8,{autoFocus:!0,onClick:()=>i(!1),children:"Ok"})}),e[11]=h):h=e[11],e[12]!==f?(g=y.jsxs(Nk,{className:"max-w-[80%] max-h-[80%] overflow-hidden flex flex-col",children:[d,f,h]}),e[12]=f,e[13]=g):g=e[13],e[14]!==o||e[15]!==g?(v=y.jsx(XR,{open:o,onOpenChange:i,children:g}),e[14]=o,e[15]=g,e[16]=v):v=e[16],e[17]!==u||e[18]!==v?(b=y.jsxs(y.Fragment,{children:[u,v]}),e[17]=u,e[18]=v,e[19]=b):b=e[19],b},txe=Po("text-sm p-2 border whitespace-pre-wrap overflow-hidden",{variants:{kind:{danger:"text-error border-[var(--red-6)] shadow-mdSolid shadow-error bg-[var(--red-1)]",info:"text-primary border-[var(--blue-6)] shadow-mdSolid shadow-accent bg-[var(--blue-1)]",warn:"border-[var(--yellow-6)] bg-[var(--yellow-2)] dark:bg-[var(--yellow-4)] text-[var(--yellow-11)] dark:text-[var(--yellow-12)]"},clickable:{true:"cursor-pointer"}},compoundVariants:[{clickable:!0,kind:"danger",className:"hover:bg-[var(--red-3)]"},{clickable:!0,kind:"info",className:"hover:bg-[var(--blue-3)]"},{clickable:!0,kind:"warn",className:"hover:bg-[var(--yellow-3)]"}],defaultVariants:{kind:"info"}}),Km=t=>{const e=ue.c(14);let n,r,o,i,a,s,l;return e[0]!==t?({kind:i,clickable:o,className:r,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5]),e[6]!==r||e[7]!==o||e[8]!==i?(s=we(txe({kind:i,clickable:o}),r),e[6]=r,e[7]=o,e[8]=i,e[9]=s):s=e[9],e[10]!==n||e[11]!==a||e[12]!==s?(l=y.jsx("div",{className:s,...a,children:n}),e[10]=n,e[11]=a,e[12]=s,e[13]=l):l=e[13],l},nxe=Po("animate-spin",{variants:{centered:{true:"m-auto"},size:{small:"size-4",medium:"size-12",large:"size-20",xlarge:"size-20"}},defaultVariants:{size:"medium"}}),Ym=ge.forwardRef((t,e)=>{const n=ue.c(13);let r,o,i,a,s,l;if(n[0]!==t){const{className:c,children:u,centered:d,size:f,...h}=t;o=c,r=d,a=f,i=h,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a}else r=n[1],o=n[2],i=n[3],a=n[4];return n[5]!==r||n[6]!==o||n[7]!==a?(s=we(nxe({centered:r,size:a}),o),n[5]=r,n[6]=o,n[7]=a,n[8]=s):s=n[8],n[9]!==i||n[10]!==e||n[11]!==s?(l=y.jsx(af,{ref:e,className:s,strokeWidth:1.5,...i}),n[9]=i,n[10]=e,n[11]=s,n[12]=l):l=n[12],l}),Ym.displayName="Spinner";var L9=.999,bJe=/[\\\/_+.#"@\[\(\{&]/,xJe=/[\\\/_+.#"@\[\(\{&]/g,OJe=/[\s-]/,rxe=/[\s-]/g;function z9(t,e,n,r,o,i,a){if(i===e.length)return o===t.length?1:.99;var s=`${o},${i}`;if(a[s]!==void 0)return a[s];for(var l,c,u,d,f=r.charAt(i),h=n.indexOf(f,o),g=0;h>=0;)(l=z9(t,e,n,r,h+1,i+1,a))>g&&(h===o?l*=1:bJe.test(t.charAt(h-1))?(l*=.8,(u=t.slice(o,h-1).match(xJe))&&o>0&&(l*=Math.pow(L9,u.length))):OJe.test(t.charAt(h-1))?(l*=.9,(d=t.slice(o,h-1).match(rxe))&&o>0&&(l*=Math.pow(L9,d.length))):(l*=.17,o>0&&(l*=Math.pow(L9,h-o))),t.charAt(h)!==e.charAt(i)&&(l*=.9999)),(l<.1&&n.charAt(h-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(h-1)!==r.charAt(i))&&.1*(c=z9(t,e,n,r,h+1,i+2,a))>l&&(l=.1*c),l>g&&(g=l),h=n.indexOf(f,h+1);return a[s]=g,g}function oxe(t){return t.toLowerCase().replace(rxe," ")}function wJe(t,e,n){return z9(t=n&&n.length>0?t+" "+n.join(" "):t,e,oxe(t),oxe(e),0,0,{})}let nb,oj,V9,q9,ij,h0,ixe,F9,rb,B9,aj,W9,U9,axe,sxe,lxe,cxe,uxe,dxe,fxe,Xa;nb='[cmdk-group=""]',oj='[cmdk-group-items=""]',V9='[cmdk-item=""]',q9=`${V9}:not([aria-disabled="true"])`,ij="cmdk-item-select",h0="data-value",ixe=(t,e,n)=>wJe(t,e,n),F9=_.createContext(void 0),rb=()=>_.useContext(F9),B9=_.createContext(void 0),aj=()=>_.useContext(B9),W9=_.createContext(void 0),U9=_.forwardRef((t,e)=>{let n=ob(()=>{var ne,re;return{search:"",value:(re=(ne=t.value)!=null?ne:t.defaultValue)!=null?re:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=ob(()=>new Set),o=ob(()=>new Map),i=ob(()=>new Map),a=ob(()=>new Set),s=hxe(t),{label:l,children:c,value:u,onValueChange:d,filter:f,shouldFilter:h,loop:g,disablePointerSelection:v=!1,vimBindings:b=!0,...p}=t,O=Do(),k=Do(),S=Do(),w=_.useRef(null),T=CJe();p0(()=>{if(u!==void 0){let ne=u.trim();n.current.value=ne,P.emit()}},[u]),p0(()=>{T(6,I)},[]);let P=_.useMemo(()=>({subscribe:ne=>(a.current.add(ne),()=>a.current.delete(ne)),snapshot:()=>n.current,setState:(ne,re,Z)=>{var K,oe,ie,Y;if(!Object.is(n.current[ne],re)){if(n.current[ne]=re,ne==="search")A(),N(),T(1,E);else if(ne==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let le=document.getElementById(S);le?le.focus():(K=document.getElementById(O))==null||K.focus()}if(T(7,()=>{var le;n.current.selectedItemId=(le=L())==null?void 0:le.id,P.emit()}),Z||T(5,I),((oe=s.current)==null?void 0:oe.value)!==void 0){let le=re??"";return void((Y=(ie=s.current).onValueChange)==null||Y.call(ie,le))}}P.emit()}},emit:()=>{a.current.forEach(ne=>ne())}}),[]),j=_.useMemo(()=>({value:(ne,re,Z)=>{var K;re!==((K=i.current.get(ne))==null?void 0:K.value)&&(i.current.set(ne,{value:re,keywords:Z}),n.current.filtered.items.set(ne,D(re,Z)),T(2,()=>{N(),P.emit()}))},item:(ne,re)=>(r.current.add(ne),re&&(o.current.has(re)?o.current.get(re).add(ne):o.current.set(re,new Set([ne]))),T(3,()=>{A(),N(),n.current.value||E(),P.emit()}),()=>{i.current.delete(ne),r.current.delete(ne),n.current.filtered.items.delete(ne);let Z=L();T(4,()=>{A(),(Z==null?void 0:Z.getAttribute("id"))===ne&&E(),P.emit()})}),group:ne=>(o.current.has(ne)||o.current.set(ne,new Set),()=>{i.current.delete(ne),o.current.delete(ne)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:O,inputId:S,labelId:k,listInnerRef:w}),[]);function D(ne,re){var Z,K;let oe=(K=(Z=s.current)==null?void 0:Z.filter)!=null?K:ixe;return ne?oe(ne,n.current.search,re):0}function N(){if(!n.current.search||s.current.shouldFilter===!1)return;let ne=n.current.filtered.items,re=[];n.current.filtered.groups.forEach(K=>{let oe=o.current.get(K),ie=0;oe.forEach(Y=>{let le=ne.get(Y);ie=Math.max(le,ie)}),re.push([K,ie])});let Z=w.current;F().sort((K,oe)=>{var ie,Y;let le=K.getAttribute("id"),me=oe.getAttribute("id");return((ie=ne.get(me))!=null?ie:0)-((Y=ne.get(le))!=null?Y:0)}).forEach(K=>{let oe=K.closest(oj);oe?oe.appendChild(K.parentElement===oe?K:K.closest(`${oj} > *`)):Z.appendChild(K.parentElement===Z?K:K.closest(`${oj} > *`))}),re.sort((K,oe)=>oe[1]-K[1]).forEach(K=>{var oe;let ie=(oe=w.current)==null?void 0:oe.querySelector(`${nb}[${h0}="${encodeURIComponent(K[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function E(){let ne=F().find(Z=>Z.getAttribute("aria-disabled")!=="true"),re=ne==null?void 0:ne.getAttribute(h0);P.setState("value",re||void 0)}function A(){var ne,re,Z,K;if(!n.current.search||s.current.shouldFilter===!1)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let oe=0;for(let ie of r.current){let Y=D((re=(ne=i.current.get(ie))==null?void 0:ne.value)!=null?re:"",(K=(Z=i.current.get(ie))==null?void 0:Z.keywords)!=null?K:[]);n.current.filtered.items.set(ie,Y),Y>0&&oe++}for(let[ie,Y]of o.current)for(let le of Y)if(n.current.filtered.items.get(le)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=oe}function I(){var ne,re,Z;let K=L();K&&(((ne=K.parentElement)==null?void 0:ne.firstChild)===K&&((Z=(re=K.closest(nb))==null?void 0:re.querySelector('[cmdk-group-heading=""]'))==null||Z.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function L(){var ne;return(ne=w.current)==null?void 0:ne.querySelector(`${V9}[aria-selected="true"]`)}function F(){var ne;return Array.from(((ne=w.current)==null?void 0:ne.querySelectorAll(q9))||[])}function Q(ne){let re=F()[ne];re&&P.setState("value",re.getAttribute(h0))}function W(ne){var re;let Z=L(),K=F(),oe=K.findIndex(Y=>Y===Z),ie=K[oe+ne];(re=s.current)!=null&&re.loop&&(ie=oe+ne<0?K[K.length-1]:oe+ne===K.length?K[0]:K[oe+ne]),ie&&P.setState("value",ie.getAttribute(h0))}function U(ne){let re,Z=L(),K=Z==null?void 0:Z.closest(nb);for(;K&&!re;)K=ne>0?kJe(K,nb):SJe(K,nb),re=K==null?void 0:K.querySelector(q9);re?P.setState("value",re.getAttribute(h0)):W(ne)}let X=()=>Q(F().length-1),G=ne=>{ne.preventDefault(),ne.metaKey?X():ne.altKey?U(1):W(1)},ae=ne=>{ne.preventDefault(),ne.metaKey?Q(0):ne.altKey?U(-1):W(-1)};return _.createElement(_t.div,{ref:e,tabIndex:-1,...p,"cmdk-root":"",onKeyDown:ne=>{var re;(re=p.onKeyDown)==null||re.call(p,ne);let Z=ne.nativeEvent.isComposing||ne.keyCode===229;if(!ne.defaultPrevented&&!Z)switch(ne.key){case"n":case"j":b&&ne.ctrlKey&&G(ne);break;case"ArrowDown":G(ne);break;case"p":case"k":b&&ne.ctrlKey&&ae(ne);break;case"ArrowUp":ae(ne);break;case"Home":ne.preventDefault(),Q(0);break;case"End":ne.preventDefault(),X();break;case"Enter":{ne.preventDefault();let K=L();if(K){let oe=new Event(ij);K.dispatchEvent(oe)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:_Je},l),sj(t,ne=>_.createElement(B9.Provider,{value:P},_.createElement(F9.Provider,{value:j},ne))))}),axe=_.forwardRef((t,e)=>{var n,r;let o=Do(),i=_.useRef(null),a=_.useContext(W9),s=rb(),l=hxe(t),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;p0(()=>{if(!c)return s.item(o,a==null?void 0:a.id)},[c]);let u=pxe(o,i,[t.value,t.children,i],t.keywords),d=aj(),f=Jp(T=>T.value&&T.value===u.current),h=Jp(T=>!(!c&&s.filter()!==!1)||!T.search||T.filtered.items.get(o)>0);function g(){var T,P;v(),(P=(T=l.current).onSelect)==null||P.call(T,u.current)}function v(){d.setState("value",u.current,!0)}if(_.useEffect(()=>{let T=i.current;if(T&&!t.disabled)return T.addEventListener(ij,g),()=>T.removeEventListener(ij,g)},[h,t.onSelect,t.disabled]),!h)return null;let{disabled:b,value:p,onSelect:O,forceMount:k,keywords:S,...w}=t;return _.createElement(_t.div,{ref:Lu(i,e),...w,id:o,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||s.getDisablePointerSelection()?void 0:v,onClick:b?void 0:g},t.children)}),sxe=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...i}=t,a=Do(),s=_.useRef(null),l=_.useRef(null),c=Do(),u=rb(),d=Jp(h=>!(!o&&u.filter()!==!1)||!h.search||h.filtered.groups.has(a));p0(()=>u.group(a),[]),pxe(a,s,[t.value,t.heading,l]);let f=_.useMemo(()=>({id:a,forceMount:o}),[o]);return _.createElement(_t.div,{ref:Lu(s,e),...i,"cmdk-group":"",role:"presentation",hidden:!d||void 0},n&&_.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),sj(t,h=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},_.createElement(W9.Provider,{value:f},h))))}),lxe=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=_.useRef(null),i=Jp(a=>!a.search);return n||i?_.createElement(_t.div,{ref:Lu(o,e),...r,"cmdk-separator":"",role:"separator"}):null}),cxe=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,i=aj(),a=Jp(c=>c.search),s=Jp(c=>c.selectedItemId),l=rb();return _.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),_.createElement(_t.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:o?t.value:a,onChange:c=>{o||i.setState("search",c.target.value),n==null||n(c.target.value)}})}),TJ=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,i=_.useRef(null),a=_.useRef(null),s=Jp(c=>c.selectedItemId),l=rb();return _.useEffect(()=>{if(a.current&&i.current){let c,u=a.current,d=i.current,f=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let h=u.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(c),f.unobserve(u)}}},[]),_.createElement(_t.div,{ref:Lu(i,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},sj(t,c=>_.createElement("div",{ref:Lu(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),uxe=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...s}=t;return _.createElement(uT,{open:n,onOpenChange:r},_.createElement(cO,{container:a},_.createElement(uO,{"cmdk-overlay":"",className:o}),_.createElement(dO,{"aria-label":t.label,"cmdk-dialog":"",className:i},_.createElement(U9,{ref:e,...s}))))}),dxe=_.forwardRef((t,e)=>Jp(n=>n.filtered.count===0)?_.createElement(_t.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),fxe=_.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...i}=t;return _.createElement(_t.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},sj(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),Xa=Object.assign(U9,{List:TJ,Item:axe,Input:cxe,Group:sxe,Separator:lxe,Dialog:uxe,Empty:dxe,Loading:fxe});function kJe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function SJe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function hxe(t){let e=_.useRef(t);return p0(()=>{e.current=t}),e}var p0=typeof window>"u"?_.useEffect:_.useLayoutEffect;function ob(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function Jp(t){let e=aj(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function pxe(t,e,n,r=[]){let o=_.useRef(),i=rb();return p0(()=>{var a;let s=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():o.current}})(),l=r.map(c=>c.trim());i.value(t,s,l),(a=e.current)==null||a.setAttribute(h0,s),o.current=s}),o}var CJe=()=>{let[t,e]=_.useState(),n=ob(()=>new Map);return p0(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function sj({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(function(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}(e),{ref:e.ref},n(e.props.children)):n(e)}var _Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};let Jf;Jf={startCase:t=>{if(!t)return"";if(typeof t!="string")throw Ve.error(t),new TypeError("Expected string, got "+typeof t);return/[A-Za-z]/.test(t)?oM(t):t},htmlEscape:t=>t&&t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'").replaceAll(`
|
218
218
|
`," "),withTrailingSlash:t=>t.endsWith("/")?t:`${t}/`,withoutTrailingSlash:t=>t.endsWith("/")?t.slice(0,-1):t,withoutLeadingSlash:t=>t.startsWith("/")?t.slice(1):t},by=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Xa,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),by.displayName=Xa.displayName,B6e=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=y.jsx(jA,{className:"overflow-hidden p-0 shadow-2xl",usePortal:!0,children:y.jsx(by,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})}),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(RA,{...r,children:o}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},EO=_.forwardRef((t,e)=>{const n=ue.c(19);let r,o,i,a,s,l,c,u,d;return n[0]!==t?({className:r,icon:o,rootClassName:a,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==a?(s=we("flex items-center border-b px-3",a),n[5]=a,n[6]=s):s=n[6],n[7]!==o?(l=o===null?null:y.jsx(Jm,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),n[7]=o,n[8]=l):l=n[8],n[9]!==r?(c=we("placeholder:text-foreground-muted flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",r),n[9]=r,n[10]=c):c=n[10],n[11]!==i||n[12]!==e||n[13]!==c?(u=y.jsx(Xa.Input,{ref:e,className:c,...i}),n[11]=i,n[12]=e,n[13]=c,n[14]=u):u=n[14],n[15]!==s||n[16]!==l||n[17]!==u?(d=y.jsxs("div",{className:s,"cmdk-input-wrapper":"",children:[l,u]}),n[15]=s,n[16]=l,n[17]=u,n[18]=d):d=n[18],d}),EO.displayName=Xa.Input.displayName,PO=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("max-h-[300px] overflow-y-auto overflow-x-hidden",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Xa.List,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),PO.displayName=Xa.List.displayName,RO=_.forwardRef((t,e)=>{const n=ue.c(3);let r;return n[0]!==t||n[1]!==e?(r=y.jsx(Xa.Empty,{ref:e,className:"py-6 text-center text-sm",...t}),n[0]=t,n[1]=e,n[2]=r):r=n[2],r}),RO.displayName=Xa.Empty.displayName,iK=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Xa.Group,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),iK.displayName=Xa.Group.displayName,LM=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=mN({className:r}),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Xa.Separator,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),LM.displayName=Xa.Separator.displayName,fy=_.forwardRef((t,e)=>{const n=ue.c(16);let r,o,i,a,s,l,c;return n[0]!==t?({className:r,variant:a,inset:o,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==r||n[6]!==o||n[7]!==a?(s=we(gN({variant:a,inset:o}).replace(DS,"data-[disabled=false]:pointer-events-all data-[disabled=false]:opacity-100 data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50"),r),n[5]=r,n[6]=o,n[7]=a,n[8]=s):s=n[8],n[9]!==i.value?(l=Jf.htmlEscape(i.value),n[9]=i.value,n[10]=l):l=n[10],n[11]!==i||n[12]!==e||n[13]!==s||n[14]!==l?(c=y.jsx(Xa.Item,{ref:e,className:s,...i,value:l}),n[11]=i,n[12]=e,n[13]=s,n[14]=l,n[15]=c):c=n[15],c}),fy.displayName=Xa.Item.displayName;let mxe;W6e=rj,mxe=t=>{const e=ue.c(25);let n,r,o,i;e[0]!==t?({children:n,className:r,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]===Symbol.for("react.memo_cache_sentinel")?(i={x:0,y:0},e[4]=i):i=e[4];const[a,s]=_.useState(i);let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l={x:0,y:0},e[5]=l):l=e[5];const c=_.useRef(l),[u,d]=_.useState(!1);let f,h,g;if(e[6]!==a.x||e[7]!==a.y){f=T=>{c.current={x:T.clientX-a.x,y:T.clientY-a.y},d(!0),document.addEventListener("mousemove",S),document.addEventListener("mouseup",w)};const S=T=>{s({x:T.clientX-c.current.x,y:T.clientY-c.current.y})},w=()=>{d(!1),document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",w)};e[6]=a.x,e[7]=a.y,e[8]=f}else f=e[8];e[9]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsx(sy,{}),e[9]=h):h=e[9],e[10]!==a.x||e[11]!==a.y?(g={position:"fixed",left:a.x,top:a.y},e[10]=a.x,e[11]=a.y,e[12]=g):g=e[12];const v="flex items-center justify-center absolute top-0 left-1/2 -translate-x-1/2 "+(u?"cursor-grabbing":"cursor-grab");let b,p,O,k;return e[13]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsx(HY,{className:"h-5 w-5 mt-1 text-muted-foreground/40"}),e[13]=b):b=e[13],e[14]!==f||e[15]!==v?(p=y.jsx("div",{onMouseDown:f,className:v,children:b}),e[14]=f,e[15]=v,e[16]=p):p=e[16],e[17]!==n||e[18]!==r||e[19]!==g||e[20]!==p?(O=y.jsxs(tp,{className:r,style:g,children:[p,n]}),e[17]=n,e[18]=r,e[19]=g,e[20]=p,e[21]=O):O=e[21],e[22]!==o||e[23]!==O?(k=y.jsxs(dg,{...o,children:[h,O]}),e[22]=o,e[23]=O,e[24]=k):k=e[24],k},VO=function(t,[e,n]){return Math.min(n,Math.max(e,t))};var TJe=[" ","Enter","ArrowUp","ArrowDown"],PJe=[" ","Enter"],m0="Select",[lj,cj,EJe]=Lp(m0),[ib,$yt]=Wo(m0,[EJe,Ap]),uj=Ap(),[RJe,em]=ib(m0),[jJe,DJe]=ib(m0),gxe=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:h,form:g}=t,v=uj(e),[b,p]=_.useState(null),[O,k]=_.useState(null),[S,w]=_.useState(!1),T=yf(c),[P,j]=Ao({prop:r,defaultProp:o??!1,onChange:i,caller:m0}),[D,N]=Ao({prop:a,defaultProp:s,onChange:l,caller:m0}),E=_.useRef(null),A=!b||g||!!b.closest("form"),[I,L]=_.useState(new Set),F=Array.from(I).map(Q=>Q.props.value).join(";");return y.jsx(ek,{...v,children:y.jsxs(RJe,{required:h,scope:e,trigger:b,onTriggerChange:p,valueNode:O,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:Do(),value:D,onValueChange:N,open:P,onOpenChange:j,dir:T,triggerPointerDownPosRef:E,disabled:f,children:[y.jsx(lj.Provider,{scope:e,children:y.jsx(jJe,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(Q=>{L(W=>new Set(W).add(Q))},[]),onNativeOptionRemove:_.useCallback(Q=>{L(W=>{const U=new Set(W);return U.delete(Q),U})},[]),children:n})}),A?y.jsxs(Vxe,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:D,onChange:Q=>N(Q.target.value),disabled:f,form:g,children:[D===void 0?y.jsx("option",{value:""}):null,Array.from(I)]},F):null]})})};gxe.displayName=m0;var vxe="SelectTrigger",yxe=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,i=uj(n),a=em(vxe,n),s=a.disabled||r,l=ln(e,a.onTriggerChange),c=cj(n),u=_.useRef("touch"),[d,f,h]=Fxe(v=>{const b=c().filter(k=>!k.disabled),p=b.find(k=>k.value===a.value),O=Bxe(b,v,p);O!==void 0&&a.onValueChange(O.value)}),g=v=>{s||(a.onOpenChange(!0),h()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return y.jsx(tk,{asChild:!0,...i,children:y.jsx(_t.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":qxe(a.value)?"":void 0,...o,ref:l,onClick:ut(o.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&g(v)}),onPointerDown:ut(o.onPointerDown,v=>{u.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(g(v),v.preventDefault())}),onKeyDown:ut(o.onKeyDown,v=>{const b=d.current!=="";v.ctrlKey||v.altKey||v.metaKey||v.key.length!==1||f(v.key),b&&v.key===" "||TJe.includes(v.key)&&(g(),v.preventDefault())})})})});yxe.displayName=vxe;var bxe="SelectValue",xxe=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=t,l=em(bxe,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=ln(e,l.onValueNodeChange);return Zo(()=>{c(u)},[c,u]),y.jsx(_t.span,{...s,ref:d,style:{pointerEvents:"none"},children:qxe(l.value)?y.jsx(y.Fragment,{children:a}):i})});xxe.displayName=bxe;var Oxe=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return y.jsx(_t.span,{"aria-hidden":!0,...o,ref:e,children:r||"\u25BC"})});Oxe.displayName="SelectIcon";var wxe=t=>y.jsx(zg,{asChild:!0,...t});wxe.displayName="SelectPortal";var g0="SelectContent",kxe=_.forwardRef((t,e)=>{const n=em(g0,t.__scopeSelect),[r,o]=_.useState();if(Zo(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Lh.createPortal(y.jsx(Sxe,{scope:t.__scopeSelect,children:y.jsx(lj.Slot,{scope:t.__scopeSelect,children:y.jsx("div",{children:t.children})})}),i):null}return y.jsx(Cxe,{...t,ref:e})});kxe.displayName=g0;var Jc=10,[Sxe,tm]=ib(g0),AJe=pp("SelectContent.RemoveScroll"),Cxe=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:b,...p}=t,O=em(g0,n),[k,S]=_.useState(null),[w,T]=_.useState(null),P=ln(e,ie=>S(ie)),[j,D]=_.useState(null),[N,E]=_.useState(null),A=cj(n),[I,L]=_.useState(!1),F=_.useRef(!1);_.useEffect(()=>{if(k)return WR(k)},[k]),IR();const Q=_.useCallback(ie=>{const[Y,...le]=A().map(ve=>ve.ref.current),[me]=le.slice(-1),ce=document.activeElement;for(const ve of ie)if(ve===ce||(ve==null||ve.scrollIntoView({block:"nearest"}),ve===Y&&w&&(w.scrollTop=0),ve===me&&w&&(w.scrollTop=w.scrollHeight),ve==null||ve.focus(),document.activeElement!==ce))return},[A,w]),W=_.useCallback(()=>Q([j,k]),[Q,j,k]);_.useEffect(()=>{I&&W()},[I,W]);const{onOpenChange:U,triggerPointerDownPosRef:X}=O;_.useEffect(()=>{if(k){let ie={x:0,y:0};const Y=me=>{var ce,ve;ie={x:Math.abs(Math.round(me.pageX)-(((ce=X.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(me.pageY)-(((ve=X.current)==null?void 0:ve.y)??0))}},le=me=>{ie.x<=10&&ie.y<=10?me.preventDefault():k.contains(me.target)||U(!1),document.removeEventListener("pointermove",Y),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",le,{capture:!0})}}},[k,U,X]),_.useEffect(()=>{const ie=()=>U(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[U]);const[G,ae]=Fxe(ie=>{const Y=A().filter(ce=>!ce.disabled),le=Y.find(ce=>ce.ref.current===document.activeElement),me=Bxe(Y,ie,le);me&&setTimeout(()=>me.ref.current.focus())}),ne=_.useCallback((ie,Y,le)=>{const me=!F.current&&!le;(O.value!==void 0&&O.value===Y||me)&&(D(ie),me&&(F.current=!0))},[O.value]),re=_.useCallback(()=>k==null?void 0:k.focus(),[k]),Z=_.useCallback((ie,Y,le)=>{const me=!F.current&&!le;(O.value!==void 0&&O.value===Y||me)&&E(ie)},[O.value]),K=r==="popper"?Z9:_xe,oe=K===Z9?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:v,avoidCollisions:b}:{};return y.jsx(Sxe,{scope:n,content:k,viewport:w,onViewportChange:T,itemRefCallback:ne,selectedItem:j,onItemLeave:re,itemTextRefCallback:Z,focusSelectedItem:W,selectedItemText:N,position:r,isPositioned:I,searchRef:G,children:y.jsx(Mk,{as:AJe,allowPinchZoom:!0,children:y.jsx(Ak,{asChild:!0,trapped:O.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:ut(o,ie=>{var Y;(Y=O.trigger)==null||Y.focus({preventScroll:!0}),ie.preventDefault()}),children:y.jsx(Rp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:y.jsx(K,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:ie=>ie.preventDefault(),...p,...oe,onPlaced:()=>L(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:ut(p.onKeyDown,ie=>{const Y=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),Y||ie.key.length!==1||ae(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let le=A().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const me=ie.target,ce=le.indexOf(me);le=le.slice(ce+1)}setTimeout(()=>Q(le)),ie.preventDefault()}})})})})})})});Cxe.displayName="SelectContentImpl";var _xe=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,i=em(g0,n),a=tm(g0,n),[s,l]=_.useState(null),[c,u]=_.useState(null),d=ln(e,P=>u(P)),f=cj(n),h=_.useRef(!1),g=_.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:p,focusSelectedItem:O}=a,k=_.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&v&&b&&p){const P=i.trigger.getBoundingClientRect(),j=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),N=p.getBoundingClientRect();if(i.dir!=="rtl"){const Y=N.left-j.left,le=D.left-Y,me=P.left-le,ce=P.width+me,ve=Math.max(ce,j.width),ye=window.innerWidth-Jc,_e=VO(le,[Jc,Math.max(Jc,ye-ve)]);s.style.minWidth=ce+"px",s.style.left=_e+"px"}else{const Y=j.right-N.right,le=window.innerWidth-D.right-Y,me=window.innerWidth-P.right-le,ce=P.width+me,ve=Math.max(ce,j.width),ye=window.innerWidth-Jc,_e=VO(le,[Jc,Math.max(Jc,ye-ve)]);s.style.minWidth=ce+"px",s.style.right=_e+"px"}const E=f(),A=window.innerHeight-2*Jc,I=v.scrollHeight,L=window.getComputedStyle(c),F=parseInt(L.borderTopWidth,10),Q=parseInt(L.paddingTop,10),W=parseInt(L.borderBottomWidth,10),U=F+Q+I+parseInt(L.paddingBottom,10)+W,X=Math.min(5*b.offsetHeight,U),G=window.getComputedStyle(v),ae=parseInt(G.paddingTop,10),ne=parseInt(G.paddingBottom,10),re=P.top+P.height/2-Jc,Z=A-re,K=b.offsetHeight/2,oe=F+Q+(b.offsetTop+K),ie=U-oe;if(oe<=re){const Y=E.length>0&&b===E[E.length-1].ref.current;s.style.bottom="0px";const le=c.clientHeight-v.offsetTop-v.offsetHeight,me=oe+Math.max(Z,K+(Y?ne:0)+le+W);s.style.height=me+"px"}else{const Y=E.length>0&&b===E[0].ref.current;s.style.top="0px";const le=Math.max(re,F+v.offsetTop+(Y?ae:0)+K)+ie;s.style.height=le+"px",v.scrollTop=oe-re+v.offsetTop}s.style.margin=`${Jc}px 0`,s.style.minHeight=X+"px",s.style.maxHeight=A+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,s,c,v,b,p,i.dir,r]);Zo(()=>k(),[k]);const[S,w]=_.useState();Zo(()=>{c&&w(window.getComputedStyle(c).zIndex)},[c]);const T=_.useCallback(P=>{P&&g.current===!0&&(k(),O==null||O(),g.current=!1)},[k,O]);return y.jsx(MJe,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:y.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:y.jsx(_t.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});_xe.displayName="SelectItemAlignedPosition";var Z9=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Jc,...i}=t,a=uj(n);return y.jsx(DE,{...a,...i,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Z9.displayName="SelectPopperPosition";var[MJe,X9]=ib(g0,{}),H9="SelectViewport",Txe=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...o}=t,i=tm(H9,n),a=X9(H9,n),s=ln(e,i.onViewportChange),l=_.useRef(0);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),y.jsx(lj.Slot,{scope:n,children:y.jsx(_t.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ut(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const g=window.innerHeight-2*Jc,v=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),p=Math.max(v,b);if(p<g){const O=p+h,k=Math.min(g,O),S=O-k;d.style.height=k+"px",d.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Txe.displayName=H9;var Pxe="SelectGroup",[NJe,$Je]=ib(Pxe),Exe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Do();return y.jsx(NJe,{scope:n,id:o,children:y.jsx(_t.div,{role:"group","aria-labelledby":o,...r,ref:e})})});Exe.displayName=Pxe;var Rxe="SelectLabel",jxe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=$Je(Rxe,n);return y.jsx(_t.div,{id:o.id,...r,ref:e})});jxe.displayName=Rxe;var dj="SelectItem",[IJe,Dxe]=ib(dj),Axe=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=t,s=em(dj,n),l=tm(dj,n),c=s.value===r,[u,d]=_.useState(i??""),[f,h]=_.useState(!1),g=ln(e,O=>{var k;return(k=l.itemRefCallback)==null?void 0:k.call(l,O,r,o)}),v=Do(),b=_.useRef("touch"),p=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return y.jsx(IJe,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:_.useCallback(O=>{d(k=>k||((O==null?void 0:O.textContent)??"").trim())},[]),children:y.jsx(lj.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:y.jsx(_t.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:g,onFocus:ut(a.onFocus,()=>h(!0)),onBlur:ut(a.onBlur,()=>h(!1)),onClick:ut(a.onClick,()=>{b.current!=="mouse"&&p()}),onPointerUp:ut(a.onPointerUp,()=>{b.current==="mouse"&&p()}),onPointerDown:ut(a.onPointerDown,O=>{b.current=O.pointerType}),onPointerMove:ut(a.onPointerMove,O=>{var k;b.current=O.pointerType,o?(k=l.onItemLeave)==null||k.call(l):b.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ut(a.onPointerLeave,O=>{var k;O.currentTarget===document.activeElement&&((k=l.onItemLeave)==null||k.call(l))}),onKeyDown:ut(a.onKeyDown,O=>{var k;((k=l.searchRef)==null?void 0:k.current)!==""&&O.key===" "||(PJe.includes(O.key)&&p(),O.key===" "&&O.preventDefault())})})})})});Axe.displayName=dj;var AS="SelectItemText",Mxe=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...i}=t,a=em(AS,n),s=tm(AS,n),l=Dxe(AS,n),c=DJe(AS,n),[u,d]=_.useState(null),f=ln(e,p=>d(p),l.onItemTextChange,p=>{var O;return(O=s.itemTextRefCallback)==null?void 0:O.call(s,p,l.value,l.disabled)}),h=u==null?void 0:u.textContent,g=_.useMemo(()=>y.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=c;return Zo(()=>(v(g),()=>b(g)),[v,b,g]),y.jsxs(y.Fragment,{children:[y.jsx(_t.span,{id:l.textId,...i,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Lh.createPortal(i.children,a.valueNode):null]})});Mxe.displayName=AS;var Nxe="SelectItemIndicator",$xe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return Dxe(Nxe,n).isSelected?y.jsx(_t.span,{"aria-hidden":!0,...r,ref:e}):null});$xe.displayName=Nxe;var Y9="SelectScrollUpButton",Ixe=_.forwardRef((t,e)=>{const n=tm(Y9,t.__scopeSelect),r=X9(Y9,t.__scopeSelect),[o,i]=_.useState(!1),a=ln(e,r.onScrollButtonChange);return Zo(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?y.jsx(Lxe,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Ixe.displayName=Y9;var G9="SelectScrollDownButton",Qxe=_.forwardRef((t,e)=>{const n=tm(G9,t.__scopeSelect),r=X9(G9,t.__scopeSelect),[o,i]=_.useState(!1),a=ln(e,r.onScrollButtonChange);return Zo(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?y.jsx(Lxe,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});Qxe.displayName=G9;var Lxe=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,i=tm("SelectScrollButton",n),a=_.useRef(null),s=cj(n),l=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),Zo(()=>{var u;const c=s().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),y.jsx(_t.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:ut(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ut(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ut(o.onPointerLeave,()=>{l()})})}),zxe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return y.jsx(_t.div,{"aria-hidden":!0,...r,ref:e})});zxe.displayName="SelectSeparator";var K9="SelectArrow",QJe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=uj(n),i=em(K9,n),a=tm(K9,n);return i.open&&a.position==="popper"?y.jsx(AE,{...o,...r,ref:e}):null});QJe.displayName=K9;var Vxe=_.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const o=_.useRef(null),i=ln(r,o),a=G1(e);return _.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&c){const u=new Event("change",{bubbles:!0});c.call(s,e),s.dispatchEvent(u)}},[a,e]),y.jsx(_t.select,{...n,style:{...Vle,...n.style},ref:i,defaultValue:e})});function qxe(t){return t===""||t===void 0}function Fxe(t){const e=Lo(t),n=_.useRef(""),r=_.useRef(0),o=_.useCallback(a=>{const s=n.current+a;e(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[e]),i=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Bxe(t,e,n){const r=e.length>1&&Array.from(e).every(l=>l===e[0]),o=r?e[0]:e,i=n?t.indexOf(n):-1;let a=function(l,c){return l.map((u,d)=>l[(c+d)%l.length])}(t,Math.max(i,0));o.length===1&&(a=a.filter(l=>l!==n));const s=a.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}Vxe.displayName="SelectBubbleInput";var LJe=gxe,J9=yxe,zJe=xxe,Wxe=Oxe,VJe=wxe,Uxe=kxe,qJe=Txe,FJe=Exe,Zxe=jxe,Xxe=Axe,BJe=Mxe,WJe=$xe,UJe=Ixe,ZJe=Qxe,Hxe=zxe;let fj;fj=Po("flex h-6 w-fit mb-1 items-center justify-between rounded-sm bg-background px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",{variants:{variant:{default:"shadow-xsSolid border border-input hover:shadow-smSolid focus:border-primary focus:shadow-mdSolid disabled:hover:shadow-xsSolid",ghost:"opacity-70 hover:opacity-100 focus:opacity-100"}},defaultVariants:{variant:"default"}}),ny=_.forwardRef((t,e)=>{const n=ue.c(12);let r,o,i,a,s,l;return n[0]!==t?({className:o,children:r,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]===Symbol.for("react.memo_cache_sentinel")?(a=ai.stopPropagation(),n[4]=a):a=n[4],n[5]!==o?(s=we(fj({}),o),n[5]=o,n[6]=s):s=n[6],n[7]!==r||n[8]!==i||n[9]!==e||n[10]!==s?(l=y.jsx("select",{ref:e,onClick:a,className:s,...i,children:r}),n[7]=r,n[8]=i,n[9]=e,n[10]=s,n[11]=l):l=n[11],l}),ny.displayName="NativeSelect";let Yxe;Zs=LJe,Cu=FJe,Yxe=ey(VJe),Us=zJe,Ws=_.forwardRef((t,e)=>{const n=ue.c(21);let r,o,i,a,s,l;n[0]!==t?({className:o,children:r,onClear:i,variant:l,hideChevron:s,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a,n[5]=s,n[6]=l):(r=n[1],o=n[2],i=n[3],a=n[4],s=n[5],l=n[6]);const c=s!==void 0&&s;let u,d,f,h;return n[7]!==o||n[8]!==l?(u=we(fj({variant:l}),"mb-0",o),n[7]=o,n[8]=l,n[9]=u):u=n[9],n[10]!==c||n[11]!==i?(d=i?y.jsx("span",{onPointerDown:g=>{g.preventDefault(),g.stopPropagation(),i()},children:y.jsx(Qa,{className:"h-4 w-4 opacity-50 hover:opacity-90"})}):!c&&y.jsx(xu,{className:"h-4 w-4 opacity-50"}),n[10]=c,n[11]=i,n[12]=d):d=n[12],n[13]!==d?(f=y.jsx(Wxe,{asChild:!0,children:d}),n[13]=d,n[14]=f):f=n[14],n[15]!==r||n[16]!==a||n[17]!==e||n[18]!==u||n[19]!==f?(h=y.jsxs(J9,{ref:e,className:u,...a,children:[r,f]}),n[15]=r,n[16]=a,n[17]=e,n[18]=u,n[19]=f,n[20]=h):h=n[20],h}),Ws.displayName=J9.displayName,cs=_.forwardRef((t,e)=>{const n=ue.c(21);let r,o,i,a;n[0]!==t?({className:o,children:r,position:a,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]);const s=a===void 0?"popper":a,l=s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let c,u;n[5]!==o||n[6]!==l?(c=we("max-h-[300px] relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",l,o),n[5]=o,n[6]=l,n[7]=c):c=n[7],n[8]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(UJe,{className:"flex items-center justify-center h-[20px] bg-background text-muted-foreground cursor-default",children:y.jsx(WM,{className:"h-4 w-4"})}),n[8]=u):u=n[8];const d=s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]";let f,h,g,v;return n[9]!==d?(f=we("p-1",d),n[9]=d,n[10]=f):f=n[10],n[11]!==r||n[12]!==f?(h=y.jsx(qJe,{className:f,children:r}),n[11]=r,n[12]=f,n[13]=h):h=n[13],n[14]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsx(ZJe,{className:"flex items-center justify-center h-[20px] bg-background text-muted-foreground cursor-default",children:y.jsx(xu,{className:"h-4 w-4 opacity-50"})}),n[14]=g):g=n[14],n[15]!==s||n[16]!==i||n[17]!==e||n[18]!==c||n[19]!==h?(v=y.jsx(Yxe,{children:y.jsx(lf,{children:y.jsxs(Uxe,{ref:e,className:c,position:s,...i,children:[u,h,g]})})}),n[15]=s,n[16]=i,n[17]=e,n[18]=c,n[19]=h,n[20]=v):v=n[20],v}),cs.displayName=Uxe.displayName,sO=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("px-2 py-1.5 text-sm font-semibold",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Zxe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),sO.displayName=Zxe.displayName,Qo=_.forwardRef((t,e)=>{const n=ue.c(17);let r,o,i,a,s,l;n[0]!==t?({className:o,children:r,subtitle:a,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==o?(s=we("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground",DS,o),n[5]=o,n[6]=s):s=n[6],n[7]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(WJe,{children:y.jsx(rg,{className:"h-3 w-3"})})}),n[7]=l):l=n[7];const c=typeof r!="string"||void 0;let u,d;return n[8]!==r||n[9]!==c?(u=y.jsx(BJe,{asChild:c,className:"flex w-full flex-1",children:r}),n[8]=r,n[9]=c,n[10]=u):u=n[10],n[11]!==i||n[12]!==e||n[13]!==a||n[14]!==s||n[15]!==u?(d=y.jsxs(Xxe,{ref:e,className:s,...i,children:[l,u,a]}),n[11]=i,n[12]=e,n[13]=a,n[14]=s,n[15]=u,n[16]=d):d=n[16],d}),Qo.displayName=Xxe.displayName,of=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("-mx-1 my-1 h-px bg-muted",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(Hxe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a}),of.displayName=Hxe.displayName;const eh={number:t=>({type:"number",...t}),text:t=>({type:"text",...t}),date:t=>({type:"date",...t}),datetime:t=>({type:"datetime",...t}),time:t=>({type:"time",...t}),boolean:t=>({type:"boolean",...t}),select:t=>({type:"select",...t})};function Gxe(t,e){if(!e)return[];const n=t;if(e.operator==="is_null"||e.operator==="is_not_null")return{column_id:n,operator:e.operator};switch(e.type){case"number":{const r=[];return e.min!==void 0&&r.push({column_id:n,operator:">=",value:e.min}),e.max!==void 0&&r.push({column_id:n,operator:"<=",value:e.max}),r}case"text":return{column_id:n,operator:e.operator,value:e.text};case"datetime":{const r=[];return e.min!==void 0&&r.push({column_id:n,operator:">=",value:e.min.toISOString()}),e.max!==void 0&&r.push({column_id:n,operator:"<=",value:e.max.toISOString()}),r}case"date":{const r=[];return e.min!==void 0&&r.push({column_id:n,operator:">=",value:e.min.toISOString()}),e.max!==void 0&&r.push({column_id:n,operator:"<=",value:e.max.toISOString()}),r}case"time":{const r=[];return e.min!==void 0&&r.push({column_id:n,operator:">=",value:e.min.toISOString()}),e.max!==void 0&&r.push({column_id:n,operator:"<=",value:e.max.toISOString()}),r}case"boolean":return e.value?{column_id:n,operator:"is_true"}:e.value?[]:{column_id:n,operator:"is_false"};case"select":return{column_id:n,operator:"in",value:e.options};default:zM(e)}}function xd(t,e){if(t==null)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}let Kxe,Jxe,eOe,tOe,nOe,rOe,oOe,iOe,aOe,sOe,lOe,cOe,uOe,dOe;Kxe=["color"],JIe=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,Kxe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M0.25 1C0.25 0.585786 0.585786 0.25 1 0.25H14C14.4142 0.25 14.75 0.585786 14.75 1V14C14.75 14.4142 14.4142 14.75 14 14.75H1C0.585786 14.75 0.25 14.4142 0.25 14V1ZM1.75 1.75V13.25H13.25V1.75H1.75Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}),_.createElement("rect",{x:"7",y:"5",width:"1",height:"1",rx:".5",fill:r}),_.createElement("rect",{x:"7",y:"3",width:"1",height:"1",rx:".5",fill:r}),_.createElement("rect",{x:"7",y:"7",width:"1",height:"1",rx:".5",fill:r}),_.createElement("rect",{x:"5",y:"7",width:"1",height:"1",rx:".5",fill:r}),_.createElement("rect",{x:"3",y:"7",width:"1",height:"1",rx:".5",fill:r}),_.createElement("rect",{x:"9",y:"7",width:"1",height:"1",rx:".5",fill:r}),_.createElement("rect",{x:"11",y:"7",width:"1",height:"1",rx:".5",fill:r}),_.createElement("rect",{x:"7",y:"9",width:"1",height:"1",rx:".5",fill:r}),_.createElement("rect",{x:"7",y:"11",width:"1",height:"1",rx:".5",fill:r}))}),Jxe=["color"],$Ie=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,Jxe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M4.18179 6.18181C4.35753 6.00608 4.64245 6.00608 4.81819 6.18181L7.49999 8.86362L10.1818 6.18181C10.3575 6.00608 10.6424 6.00608 10.8182 6.18181C10.9939 6.35755 10.9939 6.64247 10.8182 6.81821L7.81819 9.81821C7.73379 9.9026 7.61934 9.95001 7.49999 9.95001C7.38064 9.95001 7.26618 9.9026 7.18179 9.81821L4.18179 6.81821C4.00605 6.64247 4.00605 6.35755 4.18179 6.18181Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),eOe=["color"],tOe=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,eOe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M12.5 3L2.5 3.00002C1.67157 3.00002 1 3.6716 1 4.50002V9.50003C1 10.3285 1.67157 11 2.5 11H7.50003C7.63264 11 7.75982 11.0527 7.85358 11.1465L10 13.2929V11.5C10 11.2239 10.2239 11 10.5 11H12.5C13.3284 11 14 10.3285 14 9.50003V4.5C14 3.67157 13.3284 3 12.5 3ZM2.49999 2.00002L12.5 2C13.8807 2 15 3.11929 15 4.5V9.50003C15 10.8807 13.8807 12 12.5 12H11V14.5C11 14.7022 10.8782 14.8845 10.6913 14.9619C10.5045 15.0393 10.2894 14.9965 10.1464 14.8536L7.29292 12H2.5C1.11929 12 0 10.8807 0 9.50003V4.50002C0 3.11931 1.11928 2.00003 2.49999 2.00002Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),nOe=["color"],HLe=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,nOe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),rOe=["color"],oOe=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,rOe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),iOe=["color"],XLe=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,iOe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),aOe=["color"],oQe=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,aOe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),sOe=["color"],YLe=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,sOe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),lOe=["color"],cOe=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,lOe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M2.05005 13.5C2.05005 13.7485 2.25152 13.95 2.50005 13.95C2.74858 13.95 2.95005 13.7485 2.95005 13.5L2.95005 1.49995C2.95005 1.25142 2.74858 1.04995 2.50005 1.04995C2.25152 1.04995 2.05005 1.25142 2.05005 1.49995L2.05005 13.5ZM8.4317 11.0681C8.60743 11.2439 8.89236 11.2439 9.06809 11.0681C9.24383 10.8924 9.24383 10.6075 9.06809 10.4317L6.58629 7.94993L14.5 7.94993C14.7485 7.94993 14.95 7.74846 14.95 7.49993C14.95 7.2514 14.7485 7.04993 14.5 7.04993L6.58629 7.04993L9.06809 4.56813C9.24383 4.39239 9.24383 4.10746 9.06809 3.93173C8.89236 3.75599 8.60743 3.75599 8.4317 3.93173L5.1817 7.18173C5.00596 7.35746 5.00596 7.64239 5.1817 7.81812L8.4317 11.0681Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),uOe=["color"],dOe=_.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,o=xd(t,uOe);return _.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),_.createElement("path",{d:"M12.95 1.50005C12.95 1.25152 12.7485 1.05005 12.5 1.05005C12.2514 1.05005 12.05 1.25152 12.05 1.50005L12.05 13.5C12.05 13.7486 12.2514 13.95 12.5 13.95C12.7485 13.95 12.95 13.7486 12.95 13.5L12.95 1.50005ZM6.5683 3.93188C6.39257 3.75614 6.10764 3.75614 5.93191 3.93188C5.75617 4.10761 5.75617 4.39254 5.93191 4.56827L8.41371 7.05007L0.499984 7.05007C0.251456 7.05007 0.0499847 7.25155 0.0499847 7.50007C0.0499846 7.7486 0.251457 7.95007 0.499984 7.95007L8.41371 7.95007L5.93191 10.4319C5.75617 10.6076 5.75617 10.8925 5.93191 11.0683C6.10764 11.244 6.39257 11.244 6.56831 11.0683L9.8183 7.81827C9.99404 7.64254 9.99404 7.35761 9.8183 7.18188L6.5683 3.93188Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const hj={boolean:dM,date:aO,time:KH,datetime:k6,temporal:k6,number:Jv,string:zY,integer:Jv,unknown:WO};function nm(t,e){return typeof t=="function"?t(e):t}function da(t,e){return n=>{e.setState(r=>({...r,[t]:nm(n,r[t])}))}}function pj(t){return t instanceof Function}function pn(t,e,n){let r,o=[];return i=>{let a;n.key&&n.debug&&(a=Date.now());const s=t(i);if(!(s.length!==o.length||s.some((u,d)=>o[d]!==u)))return r;let c;if(o=s,n.key&&n.debug&&(c=Date.now()),r=e(...s),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round(100*(Date.now()-a))/100,d=Math.round(100*(Date.now()-c))/100,f=d/16,h=(g,v)=>{for(g=String(g);g.length<v;)g=" "+g;return g};console.info(`%c\u23F1 ${h(d,5)} /${h(u,5)} ms`,`
|
219
219
|
font-size: .6rem;
|
220
220
|
font-weight: bold;
|
@@ -226,14 +226,14 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
226
226
|
`)},formatRow:i,formatValue:a}}function Xtt(t){return t}function Htt(t,e){return typeof e=="string"&&(e=t.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(n){return kwe(t,n)})}:kwe(t,e)}function kwe(t,e){var n=e.id,r=e.bbox,o=e.properties==null?{}:e.properties,i=Swe(t,e);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function Swe(t,e){var n=function(c){if(c==null)return Xtt;var u,d,f=c.scale[0],h=c.scale[1],g=c.translate[0],v=c.translate[1];return function(b,p){p||(u=d=0);var O=2,k=b.length,S=new Array(k);for(S[0]=(u+=b[0])*f+g,S[1]=(d+=b[1])*h+v;O<k;)S[O]=b[O],++O;return S}}(t.transform),r=t.arcs;function o(c,u){u.length&&u.pop();for(var d=r[c<0?~c:c],f=0,h=d.length;f<h;++f)u.push(n(d[f],f));c<0&&function(g,v){for(var b,p=g.length,O=p-v;O<--p;)b=g[O],g[O++]=g[p],g[p]=b}(u,h)}function i(c){return n(c)}function a(c){for(var u=[],d=0,f=c.length;d<f;++d)o(c[d],u);return u.length<2&&u.push(u[0]),u}function s(c){for(var u=a(c);u.length<4;)u.push(u[0]);return u}function l(c){return c.map(s)}return function c(u){var d,f=u.type;switch(f){case"GeometryCollection":return{type:f,geometries:u.geometries.map(c)};case"Point":d=i(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(i);break;case"LineString":d=a(u.arcs);break;case"MultiLineString":d=u.arcs.map(a);break;case"Polygon":d=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:f,coordinates:d}}(e)}function Ytt(t,e){var n={},r={},o={},i=[],a=-1;function s(l,c){for(var u in l){var d=l[u];delete c[d.start],delete d.start,delete d.end,d.forEach(function(f){n[f<0?~f:f]=1}),i.push(d)}}return e.forEach(function(l,c){var u,d=t.arcs[l<0?~l:l];d.length<3&&!d[1][0]&&!d[1][1]&&(u=e[++a],e[a]=l,e[c]=u)}),e.forEach(function(l){var c,u,d=function(b){var p,O=t.arcs[b<0?~b:b],k=O[0];return t.transform?(p=[0,0],O.forEach(function(S){p[0]+=S[0],p[1]+=S[1]})):p=O[O.length-1],b<0?[p,k]:[k,p]}(l),f=d[0],h=d[1];if(c=o[f])if(delete o[c.end],c.push(l),c.end=h,u=r[h]){delete r[u.start];var g=u===c?c:c.concat(u);r[g.start=c.start]=o[g.end=u.end]=g}else r[c.start]=o[c.end]=c;else if(c=r[h])if(delete r[c.start],c.unshift(l),c.start=f,u=o[f]){delete o[u.end];var v=u===c?c:u.concat(c);r[v.start=u.start]=o[v.end=c.end]=v}else r[c.start]=o[c.end]=c;else r[(c=[l]).start=f]=o[c.end=h]=c}),s(o,r),s(r,o),e.forEach(function(l){n[l<0?~l:l]||i.push([l])}),i}function Gtt(t){return Swe(t,Ktt.apply(this,arguments))}function Ktt(t,e,n){var r,o,i;if(arguments.length>1)r=function(a,s,l){var c,u=[],d=[];function f(p){var O=p<0?~p:p;(d[O]||(d[O]=[])).push({i:p,g:c})}function h(p){p.forEach(f)}function g(p){p.forEach(h)}function v(p){p.forEach(g)}function b(p){switch(c=p,p.type){case"GeometryCollection":p.geometries.forEach(b);break;case"LineString":h(p.arcs);break;case"MultiLineString":case"Polygon":g(p.arcs);break;case"MultiPolygon":v(p.arcs)}}return b(s),d.forEach(l==null?function(p){u.push(p[0].i)}:function(p){l(p[0].g,p[p.length-1].g)&&u.push(p[0].i)}),u}(0,e,n);else for(o=0,r=new Array(i=t.arcs.length);o<i;++o)r[o]=o;return{type:"MultiLineString",arcs:Ytt(t,r)}}Y_=function(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN};function Jtt(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}oY=function(t){let e,n,r;function o(i,a,s=0,l=i.length){if(s<l){if(e(a,a)!==0)return l;do{const c=s+l>>>1;n(i[c],a)<0?s=c+1:l=c}while(s<l)}return s}return t.length!==2?(e=Y_,n=(i,a)=>Y_(t(i),a),r=(i,a)=>t(i)-a):(e=t===Y_||t===Jtt?t:ent,n=t,r=t),{left:o,center:function(i,a,s=0,l=i.length){const c=o(i,a,s,l-1);return c>s&&r(i[c-1],a)>-r(i[c],a)?c-1:c},right:function(i,a,s=0,l=i.length){if(s<l){if(e(a,a)!==0)return l;do{const c=s+l>>>1;n(i[c],a)<=0?s=c+1:l=c}while(s<l)}return s}}};function ent(){return 0}const tnt=Math.sqrt(50),nnt=Math.sqrt(10),rnt=Math.sqrt(2);function Rj(t,e,n){const r=(e-t)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),a=i>=tnt?10:i>=nnt?5:i>=rnt?2:1;let s,l,c;return o<0?(c=Math.pow(10,-o)/a,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,o)*a,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?Rj(t,e,2*n):[s,l,c]}UIe=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[o,i,a]=r?Rj(e,t,n):Rj(t,e,n);if(!(i>=o))return[];const s=i-o+1,l=new Array(s);if(r)if(a<0)for(let c=0;c<s;++c)l[c]=(i-c)/-a;else for(let c=0;c<s;++c)l[c]=(i-c)*a;else if(a<0)for(let c=0;c<s;++c)l[c]=(o+c)/-a;else for(let c=0;c<s;++c)l[c]=(o+c)*a;return l},WA=function(t,e,n){return Rj(t=+t,e=+e,n=+n)[2]},L_=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),o=r?WA(e,t,n):WA(t,e,n);return(r?-1:1)*(o<0?1/-o:o)};function jj(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function cb(t){return(t=jj(Math.abs(t)))?t[1]:NaN}var Cwe,ont=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;Xv=function(t){if(!(e=ont.exec(t)))throw new Error("invalid format: "+t);var e;return new Cz({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})};function Cz(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}function _we(t,e){var n=jj(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}Xv.prototype=Cz.prototype,Cz.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,0|this.width))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Twe={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>_we(100*t,e),r:_we,s:function(t,e){var n=jj(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(Cwe=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+jj(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Pwe(t){return t}let _z,Tz,Pz;Tz=Array.prototype.map,Pz=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Ewe(t){var e,n,r=t.grouping===void 0||t.thousands===void 0?Pwe:(e=Tz.call(t.grouping,Number),n=t.thousands+"",function(f,h){for(var g=f.length,v=[],b=0,p=e[0],O=0;g>0&&p>0&&(O+p+1>h&&(p=Math.max(1,h-O)),v.push(f.substring(g-=p,g+p)),!((O+=p+1)>h));)p=e[b=(b+1)%e.length];return v.reverse().join(n)}),o=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",a=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?Pwe:function(f){return function(h){return h.replace(/[0-9]/g,function(g){return f[+g]})}}(Tz.call(t.numerals,String)),l=t.percent===void 0?"%":t.percent+"",c=t.minus===void 0?"\u2212":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function d(f){var h=(f=Xv(f)).fill,g=f.align,v=f.sign,b=f.symbol,p=f.zero,O=f.width,k=f.comma,S=f.precision,w=f.trim,T=f.type;T==="n"?(k=!0,T="g"):Twe[T]||(S===void 0&&(S=12),w=!0,T="g"),(p||h==="0"&&g==="=")&&(p=!0,h="0",g="=");var P=b==="$"?o:b==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",j=b==="$"?i:/[%p]/.test(T)?l:"",D=Twe[T],N=/[defgprs%]/.test(T);function E(A){var I,L,F,Q=P,W=j;if(T==="c")W=D(A)+W,A="";else{var U=(A=+A)<0||1/A<0;if(A=isNaN(A)?u:D(Math.abs(A),S),w&&(A=function(ae){e:for(var ne,re=ae.length,Z=1,K=-1;Z<re;++Z)switch(ae[Z]){case".":K=ne=Z;break;case"0":K===0&&(K=Z),ne=Z;break;default:if(!+ae[Z])break e;K>0&&(K=0)}return K>0?ae.slice(0,K)+ae.slice(ne+1):ae}(A)),U&&+A==0&&v!=="+"&&(U=!1),Q=(U?v==="("?v:c:v==="-"||v==="("?"":v)+Q,W=(T==="s"?Pz[8+Cwe/3]:"")+W+(U&&v==="("?")":""),N){for(I=-1,L=A.length;++I<L;)if(48>(F=A.charCodeAt(I))||F>57){W=(F===46?a+A.slice(I+1):A.slice(I))+W,A=A.slice(0,I);break}}}k&&!p&&(A=r(A,1/0));var X=Q.length+A.length+W.length,G=X<O?new Array(O-X+1).join(h):"";switch(k&&p&&(A=r(G+A,G.length?O-W.length:1/0),G=""),g){case"<":A=Q+A+W+G;break;case"=":A=Q+G+A+W;break;case"^":A=G.slice(0,X=G.length>>1)+Q+A+W+G.slice(X);break;default:A=G+Q+A+W}return s(A)}return S=S===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S)),E.toString=function(){return f+""},E}return{format:d,formatPrefix:function(f,h){var g=d(((f=Xv(f)).type="f",f)),v=3*Math.max(-8,Math.min(8,Math.floor(cb(h)/3))),b=Math.pow(10,-v),p=Pz[8+v/3];return function(O){return g(b*O)+p}}}}TY=function(t){return Math.max(0,-cb(Math.abs(t)))},sY=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(cb(e)/3)))-cb(Math.abs(t)))},aY=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,cb(e)-cb(t))+1},_z=Ewe({thousands:",",grouping:[3],currency:["$",""]}),mee=_z.format,lY=_z.formatPrefix;const Ez=new Date,Rz=new Date;function zi(t,e,n,r){function o(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(t(i=new Date(+i)),i),o.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),o.round=i=>{const a=o(i),s=o.ceil(i);return i-a<s-i?a:s},o.offset=(i,a)=>(e(i=new Date(+i),a==null?1:Math.floor(a)),i),o.range=(i,a,s)=>{const l=[];if(i=o.ceil(i),s=s==null?1:Math.floor(s),!(i<a&&s>0))return l;let c;do l.push(c=new Date(+i)),e(i,s),t(i);while(c<i&&i<a);return l},o.filter=i=>zi(a=>{if(a>=a)for(;t(a),!i(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!i(a););else for(;--s>=0;)for(;e(a,1),!i(a););}),n&&(o.count=(i,a)=>(Ez.setTime(+i),Rz.setTime(+a),t(Ez),t(Rz),Math.floor(n(Ez,Rz))),o.every=i=>(i=Math.floor(i),isFinite(i)&&i>0?i>1?o.filter(r?a=>r(a)%i===0:a=>o.count(0,a)%i===0):o:null)),o}qv=zi(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t),qv.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?zi(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):qv:null),qv.range,Zx=1e3,qh=6e4,Xx=36e5,Hx=864e5,MA=6048e5,zIe=2592e6,VIe=31536e6,F_=zi(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Zx)},(t,e)=>(e-t)/Zx,t=>t.getUTCSeconds()),F_.range,NA=zi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Zx)},(t,e)=>{t.setTime(+t+e*qh)},(t,e)=>(e-t)/qh,t=>t.getMinutes()),NA.range,IA=zi(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*qh)},(t,e)=>(e-t)/qh,t=>t.getUTCMinutes()),IA.range,$A=zi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Zx-t.getMinutes()*qh)},(t,e)=>{t.setTime(+t+e*Xx)},(t,e)=>(e-t)/Xx,t=>t.getHours()),$A.range,QA=zi(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Xx)},(t,e)=>(e-t)/Xx,t=>t.getUTCHours()),QA.range,Fh=zi(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*qh)/Hx,t=>t.getDate()-1),Fh.range,np=zi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Hx,t=>t.getUTCDate()-1),np.range,WH=zi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Hx,t=>Math.floor(t/Hx));function b0(t){return zi(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+7*n)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*qh)/MA)}WH.range,Yx=b0(0),tO=b0(1),_Y=b0(2),CY=b0(3),eg=b0(4),SY=b0(5),kY=b0(6);function x0(t){return zi(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+7*n)},(e,n)=>(n-e)/MA)}Yx.range,tO.range,_Y.range,CY.range,eg.range,SY.range,kY.range;let qS,Rwe,jwe,O0,Dwe,Awe;Gx=x0(0),qS=x0(1),Rwe=x0(2),jwe=x0(3),O0=x0(4),Dwe=x0(5),Awe=x0(6),Gx.range,qS.range,Rwe.range,jwe.range,O0.range,Dwe.range,Awe.range,z_=zi(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear()),t=>t.getMonth()),z_.range,V_=zi(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear()),t=>t.getUTCMonth()),V_.range,Jd=zi(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear()),Jd.every=t=>isFinite(t=Math.floor(t))&&t>0?zi(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)}):null,Jd.range,ef=zi(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear()),ef.every=t=>isFinite(t=Math.floor(t))&&t>0?zi(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null,ef.range;let Dj;ia="year",hs="quarter",ka="month",Ai="week",ps="date",Sa="day",ju="dayofyear",Ys="hours",Gs="minutes",Rl="seconds",Dc="milliseconds",$G=[ia,hs,ka,Ai,ps,Sa,ju,Ys,Gs,Rl,Dc],Dj=$G.reduce((t,e,n)=>(t[e]=1+n,t),{}),MG=function(t){const e=dy(t).slice(),n={};return e.length||wa("Missing time unit."),e.forEach(r=>{Ru(Dj,r)?n[r]=1:wa(`Invalid time unit: ${r}.`)}),(n[Ai]||n[Sa]?1:0)+(n[hs]||n[ka]||n[ps]?1:0)+(n[ju]?1:0)>1&&wa(`Incompatible time units: ${t}`),e.sort((r,o)=>Dj[r]-Dj[o]),e};const int={[ia]:"%Y ",[hs]:"Q%q ",[ka]:"%b ",[ps]:"%d ",[Ai]:"W%U ",[Sa]:"%a ",[ju]:"%j ",[Ys]:"%H:00",[Gs]:"00:%M",[Rl]:":%S",[Dc]:".%L",[`${ia}-${ka}`]:"%Y-%m ",[`${ia}-${ka}-${ps}`]:"%Y-%m-%d ",[`${Ys}-${Gs}`]:"%H:%M"};_6e=function(t,e){const n=mg({},int,e),r=MG(t),o=r.length;let i,a,s="",l=0;for(l=0;l<o;)for(i=r.length;i>l;--i)if(a=r.slice(l,i).join("-"),n[a]!=null){s+=n[a],l=i;break}return s.trim()};const w0=new Date;function jz(t){return w0.setFullYear(t),w0.setMonth(0),w0.setDate(1),w0.setHours(0,0,0,0),w0}O6e=function(t){return Mwe(new Date(t))},k6e=function(t){return Dz(new Date(t))};function Mwe(t){return Fh.count(jz(t.getFullYear())-1,t)}function Dz(t){return Yx.count(jz(t.getFullYear())-1,t)}function Az(t){return jz(t).getDay()}function ant(t,e,n,r,o,i,a){if(0<=t&&t<100){const s=new Date(-1,e,n,r,o,i,a);return s.setFullYear(t),s}return new Date(t,e,n,r,o,i,a)}x6e=function(t){return Nwe(new Date(t))},w6e=function(t){return Mz(new Date(t))};function Nwe(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return np.count(e-1,t)}function Mz(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return Gx.count(e-1,t)}function Nz(t){return w0.setTime(Date.UTC(t,0,1)),w0.getUTCDay()}function snt(t,e,n,r,o,i,a){if(0<=t&&t<100){const s=new Date(Date.UTC(-1,e,n,r,o,i,a));return s.setUTCFullYear(n.y),s}return new Date(Date.UTC(t,e,n,r,o,i,a))}function $we(t,e,n,r,o){const i=e||1,a=fg(t),s=(p,O,k)=>function(S,w,T,P){const j=T<=1?S:P?(D,N)=>P+T*Math.floor((S(D,N)-P)/T):(D,N)=>T*Math.floor(S(D,N)/T);return w?(D,N)=>w(j(D,N),N):j}(n[k=k||p],r[k],p===a&&i,O),l=new Date,c=QG(t),u=c[ia]?s(ia):WG(2012),d=c[ka]?s(ka):c[hs]?s(hs):ly,f=c[Ai]&&c[Sa]?s(Sa,1,Ai+Sa):c[Ai]?s(Ai,1):c[Sa]?s(Sa,1):c[ps]?s(ps,1):c[ju]?s(ju,1):zG,h=c[Ys]?s(Ys):ly,g=c[Gs]?s(Gs):ly,v=c[Rl]?s(Rl):ly,b=c[Dc]?s(Dc):ly;return function(p){l.setTime(+p);const O=u(l);return o(O,d(l),f(l,O),h(l),g(l),v(l),b(l))}}function ub(t,e,n){return e+7*t-(n+6)%7}const lnt={[ia]:t=>t.getFullYear(),[hs]:t=>Math.floor(t.getMonth()/3),[ka]:t=>t.getMonth(),[ps]:t=>t.getDate(),[Ys]:t=>t.getHours(),[Gs]:t=>t.getMinutes(),[Rl]:t=>t.getSeconds(),[Dc]:t=>t.getMilliseconds(),[ju]:t=>Mwe(t),[Ai]:t=>Dz(t),[Ai+Sa]:(t,e)=>ub(Dz(t),t.getDay(),Az(e)),[Sa]:(t,e)=>ub(1,t.getDay(),Az(e))},cnt={[hs]:t=>3*t,[Ai]:(t,e)=>ub(t,0,Az(e))};FQe=function(t,e){return $we(t,e||1,lnt,cnt,ant)};const unt={[ia]:t=>t.getUTCFullYear(),[hs]:t=>Math.floor(t.getUTCMonth()/3),[ka]:t=>t.getUTCMonth(),[ps]:t=>t.getUTCDate(),[Ys]:t=>t.getUTCHours(),[Gs]:t=>t.getUTCMinutes(),[Rl]:t=>t.getUTCSeconds(),[Dc]:t=>t.getUTCMilliseconds(),[ju]:t=>Nwe(t),[Ai]:t=>Mz(t),[Sa]:(t,e)=>ub(1,t.getUTCDay(),Nz(e)),[Ai+Sa]:(t,e)=>ub(Mz(t),t.getUTCDay(),Nz(e))},dnt={[hs]:t=>3*t,[Ai]:(t,e)=>ub(t,0,Nz(e))};qQe=function(t,e){return $we(t,e||1,unt,dnt,snt)};const fnt={[ia]:Jd,[hs]:z_.every(3),[ka]:z_,[Ai]:Yx,[ps]:Fh,[Sa]:Fh,[ju]:Fh,[Ys]:$A,[Gs]:NA,[Rl]:F_,[Dc]:qv},hnt={[ia]:ef,[hs]:V_.every(3),[ka]:V_,[Ai]:Gx,[ps]:np,[Sa]:np,[ju]:np,[Ys]:QA,[Gs]:IA,[Rl]:F_,[Dc]:qv};bT=function(t){return fnt[t]},yT=function(t){return hnt[t]};function Iwe(t,e,n){return t?t.offset(e,n):void 0}P6e=function(t,e,n){return Iwe(bT(t),e,n)},R6e=function(t,e,n){return Iwe(yT(t),e,n)};function Qwe(t,e,n,r){return t?t.range(e,n,r):void 0}T6e=function(t,e,n,r){return Qwe(bT(t),e,n,r)},E6e=function(t,e,n,r){return Qwe(yT(t),e,n,r)};const pnt=1e3,mnt=6e4,gnt=36e5,vnt=864e5,ynt=2592e6,$z=31536e6,Lwe=[ia,ka,ps,Ys,Gs,Rl,Dc],FS=Lwe.slice(0,-1),BS=FS.slice(0,-1),WS=BS.slice(0,-1),bnt=WS.slice(0,-1),zwe=[ia,ka],Vwe=[ia],US=[[FS,1,pnt],[FS,5,5e3],[FS,15,15e3],[FS,30,3e4],[BS,1,mnt],[BS,5,3e5],[BS,15,9e5],[BS,30,18e5],[WS,1,gnt],[WS,3,108e5],[WS,6,216e5],[WS,12,432e5],[bnt,1,vnt],[[ia,Ai],1,6048e5],[zwe,1,ynt],[zwe,3,7776e6],[Vwe,1,$z]];VQe=function(t){const e=t.extent,n=t.maxbins||40,r=Math.abs(NG(e))/n;let o,i,a=oY(s=>s[2]).right(US,r);return a===US.length?(o=Vwe,i=L_(e[0]/$z,e[1]/$z,n)):a?(a=US[r/US[a-1][2]<US[a][2]/r?a-1:a],o=a[0],i=a[1]):(o=Lwe,i=Math.max(L_(e[0],e[1],n),1)),{units:o,step:i}};function Iz(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Qz(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ZS(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function qwe(t){var e=t.dateTime,n=t.date,r=t.time,o=t.periods,i=t.days,a=t.shortDays,s=t.months,l=t.shortMonths,c=HS(o),u=YS(o),d=HS(i),f=YS(i),h=HS(a),g=YS(a),v=HS(s),b=YS(s),p=HS(l),O=YS(l),k={a:function(D){return a[D.getDay()]},A:function(D){return i[D.getDay()]},b:function(D){return l[D.getMonth()]},B:function(D){return s[D.getMonth()]},c:null,d:Gwe,e:Gwe,f:znt,g:Ynt,G:Knt,H:Int,I:Qnt,j:Lnt,L:Kwe,m:Vnt,M:qnt,p:function(D){return o[+(D.getHours()>=12)]},q:function(D){return 1+~~(D.getMonth()/3)},Q:oke,s:ike,S:Fnt,u:Bnt,U:Wnt,V:Unt,w:Znt,W:Xnt,x:null,X:null,y:Hnt,Y:Gnt,Z:Jnt,"%":rke},S={a:function(D){return a[D.getUTCDay()]},A:function(D){return i[D.getUTCDay()]},b:function(D){return l[D.getUTCMonth()]},B:function(D){return s[D.getUTCMonth()]},c:null,d:eke,e:eke,f:rrt,g:hrt,G:mrt,H:ert,I:trt,j:nrt,L:tke,m:ort,M:irt,p:function(D){return o[+(D.getUTCHours()>=12)]},q:function(D){return 1+~~(D.getUTCMonth()/3)},Q:oke,s:ike,S:art,u:srt,U:lrt,V:crt,w:urt,W:drt,x:null,X:null,y:frt,Y:prt,Z:grt,"%":rke},w={a:function(D,N,E){var A=h.exec(N.slice(E));return A?(D.w=g.get(A[0].toLowerCase()),E+A[0].length):-1},A:function(D,N,E){var A=d.exec(N.slice(E));return A?(D.w=f.get(A[0].toLowerCase()),E+A[0].length):-1},b:function(D,N,E){var A=p.exec(N.slice(E));return A?(D.m=O.get(A[0].toLowerCase()),E+A[0].length):-1},B:function(D,N,E){var A=v.exec(N.slice(E));return A?(D.m=b.get(A[0].toLowerCase()),E+A[0].length):-1},c:function(D,N,E){return j(D,e,N,E)},d:Hwe,e:Hwe,f:Ant,g:Xwe,G:Zwe,H:Ywe,I:Ywe,j:Ent,L:Dnt,m:Pnt,M:Rnt,p:function(D,N,E){var A=c.exec(N.slice(E));return A?(D.p=u.get(A[0].toLowerCase()),E+A[0].length):-1},q:Tnt,Q:Nnt,s:$nt,S:jnt,u:wnt,U:knt,V:Snt,w:Ont,W:Cnt,x:function(D,N,E){return j(D,n,N,E)},X:function(D,N,E){return j(D,r,N,E)},y:Xwe,Y:Zwe,Z:_nt,"%":Mnt};function T(D,N){return function(E){var A,I,L,F=[],Q=-1,W=0,U=D.length;for(E instanceof Date||(E=new Date(+E));++Q<U;)D.charCodeAt(Q)===37&&(F.push(D.slice(W,Q)),(I=Lz[A=D.charAt(++Q)])!=null?A=D.charAt(++Q):I=A==="e"?" ":"0",(L=N[A])&&(A=L(E,I)),F.push(A),W=Q+1);return F.push(D.slice(W,Q)),F.join("")}}function P(D,N){return function(E){var A,I,L=ZS(1900,void 0,1);if(j(L,D,E+="",0)!=E.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(1e3*L.s+("L"in L?L.L:0));if(N&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+12*L.p),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(I=(A=Qz(ZS(L.y,0,1))).getUTCDay(),A=I>4||I===0?qS.ceil(A):qS(A),A=np.offset(A,7*(L.V-1)),L.y=A.getUTCFullYear(),L.m=A.getUTCMonth(),L.d=A.getUTCDate()+(L.w+6)%7):(I=(A=Iz(ZS(L.y,0,1))).getDay(),A=I>4||I===0?tO.ceil(A):tO(A),A=Fh.offset(A,7*(L.V-1)),L.y=A.getFullYear(),L.m=A.getMonth(),L.d=A.getDate()+(L.w+6)%7)}else("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),I="Z"in L?Qz(ZS(L.y,0,1)).getUTCDay():Iz(ZS(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+7*L.W-(I+5)%7:L.w+7*L.U-(I+6)%7);return"Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,Qz(L)):Iz(L)}}function j(D,N,E,A){for(var I,L,F=0,Q=N.length,W=E.length;F<Q;){if(A>=W)return-1;if((I=N.charCodeAt(F++))===37){if(I=N.charAt(F++),!(L=w[I in Lz?N.charAt(F++):I])||(A=L(D,E,A))<0)return-1}else if(I!=E.charCodeAt(A++))return-1}return A}return k.x=T(n,k),k.X=T(r,k),k.c=T(e,k),S.x=T(n,S),S.X=T(r,S),S.c=T(e,S),{format:function(D){var N=T(D+="",k);return N.toString=function(){return D},N},parse:function(D){var N=P(D+="",!1);return N.toString=function(){return D},N},utcFormat:function(D){var N=T(D+="",S);return N.toString=function(){return D},N},utcParse:function(D){var N=P(D+="",!0);return N.toString=function(){return D},N}}}let XS,Fwe,Bwe,Lz,Vi,Wwe,Uwe;Lz={"-":"",_:" ",0:"0"},Vi=/^\s*\d+/,Wwe=/^%/,Uwe=/[\\^$*+?|[\]().{}]/g;function yr(t,e,n){var r=t<0?"-":"",o=(r?-t:t)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(e)+o:o)}function xnt(t){return t.replace(Uwe,"\\$&")}function HS(t){return new RegExp("^(?:"+t.map(xnt).join("|")+")","i")}function YS(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Ont(t,e,n){var r=Vi.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function wnt(t,e,n){var r=Vi.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function knt(t,e,n){var r=Vi.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Snt(t,e,n){var r=Vi.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Cnt(t,e,n){var r=Vi.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Zwe(t,e,n){var r=Vi.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Xwe(t,e,n){var r=Vi.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function _nt(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Tnt(t,e,n){var r=Vi.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Pnt(t,e,n){var r=Vi.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Hwe(t,e,n){var r=Vi.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Ent(t,e,n){var r=Vi.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ywe(t,e,n){var r=Vi.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Rnt(t,e,n){var r=Vi.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function jnt(t,e,n){var r=Vi.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Dnt(t,e,n){var r=Vi.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Ant(t,e,n){var r=Vi.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Mnt(t,e,n){var r=Wwe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Nnt(t,e,n){var r=Vi.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function $nt(t,e,n){var r=Vi.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Gwe(t,e){return yr(t.getDate(),e,2)}function Int(t,e){return yr(t.getHours(),e,2)}function Qnt(t,e){return yr(t.getHours()%12||12,e,2)}function Lnt(t,e){return yr(1+Fh.count(Jd(t),t),e,3)}function Kwe(t,e){return yr(t.getMilliseconds(),e,3)}function znt(t,e){return Kwe(t,e)+"000"}function Vnt(t,e){return yr(t.getMonth()+1,e,2)}function qnt(t,e){return yr(t.getMinutes(),e,2)}function Fnt(t,e){return yr(t.getSeconds(),e,2)}function Bnt(t){var e=t.getDay();return e===0?7:e}function Wnt(t,e){return yr(Yx.count(Jd(t)-1,t),e,2)}function Jwe(t){var e=t.getDay();return e>=4||e===0?eg(t):eg.ceil(t)}function Unt(t,e){return t=Jwe(t),yr(eg.count(Jd(t),t)+(Jd(t).getDay()===4),e,2)}function Znt(t){return t.getDay()}function Xnt(t,e){return yr(tO.count(Jd(t)-1,t),e,2)}function Hnt(t,e){return yr(t.getFullYear()%100,e,2)}function Ynt(t,e){return yr((t=Jwe(t)).getFullYear()%100,e,2)}function Gnt(t,e){return yr(t.getFullYear()%1e4,e,4)}function Knt(t,e){var n=t.getDay();return yr((t=n>=4||n===0?eg(t):eg.ceil(t)).getFullYear()%1e4,e,4)}function Jnt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+yr(e/60|0,"0",2)+yr(e%60,"0",2)}function eke(t,e){return yr(t.getUTCDate(),e,2)}function ert(t,e){return yr(t.getUTCHours(),e,2)}function trt(t,e){return yr(t.getUTCHours()%12||12,e,2)}function nrt(t,e){return yr(1+np.count(ef(t),t),e,3)}function tke(t,e){return yr(t.getUTCMilliseconds(),e,3)}function rrt(t,e){return tke(t,e)+"000"}function ort(t,e){return yr(t.getUTCMonth()+1,e,2)}function irt(t,e){return yr(t.getUTCMinutes(),e,2)}function art(t,e){return yr(t.getUTCSeconds(),e,2)}function srt(t){var e=t.getUTCDay();return e===0?7:e}function lrt(t,e){return yr(Gx.count(ef(t)-1,t),e,2)}function nke(t){var e=t.getUTCDay();return e>=4||e===0?O0(t):O0.ceil(t)}function crt(t,e){return t=nke(t),yr(O0.count(ef(t),t)+(ef(t).getUTCDay()===4),e,2)}function urt(t){return t.getUTCDay()}function drt(t,e){return yr(qS.count(ef(t)-1,t),e,2)}function frt(t,e){return yr(t.getUTCFullYear()%100,e,2)}function hrt(t,e){return yr((t=nke(t)).getUTCFullYear()%100,e,2)}function prt(t,e){return yr(t.getUTCFullYear()%1e4,e,4)}function mrt(t,e){var n=t.getUTCDay();return yr((t=n>=4||n===0?O0(t):O0.ceil(t)).getUTCFullYear()%1e4,e,4)}function grt(){return"+0000"}function rke(){return"%"}function oke(t){return+t}function ike(t){return Math.floor(+t/1e3)}function GS(t){const e={};return n=>e[n]||(e[n]=t(n))}function ake(t){const e=GS(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(r){const o=Xv(r||",");if(o.precision==null){switch(o.precision=12,o.type){case"%":o.precision-=2;break;case"e":o.precision-=1}return i=e(o),a=e(".1f")(1)[1],s=>{const l=i(s),c=l.indexOf(a);if(c<0)return l;let u=function(f,h){let g,v=f.lastIndexOf("e");if(v>0)return v;for(v=f.length;--v>h;)if(g=f.charCodeAt(v),g>=48&&g<=57)return v+1}(l,c);const d=u<l.length?l.slice(u):"";for(;--u>c;)if(l[u]!=="0"){++u;break}return l.slice(0,u)+d}}return e(o);var i,a},formatSpan(r,o,i,a){a=Xv(a??",f");const s=L_(r,o,i),l=Math.max(Math.abs(r),Math.abs(o));let c;if(a.precision==null)switch(a.type){case"s":return isNaN(c=sY(s,l))||(a.precision=c),n(a,l);case"":case"e":case"g":case"p":case"r":isNaN(c=aY(s,l))||(a.precision=c-(a.type==="e"));break;case"f":case"%":isNaN(c=TY(s))||(a.precision=c-2*(a.type==="%"))}return e(a)}}}let zz,Vz;function ske(){return zz=ake({format:mee,formatPrefix:lY})}function lke(t){return ake(Ewe(t))}kT=function(t){return arguments.length?zz=lke(t):zz};function cke(t,e,n){Uv(n=n||{})||wa(`Invalid time multi-format specifier: ${n}`);const r=e(Rl),o=e(Gs),i=e(Ys),a=e(ps),s=e(Ai),l=e(ka),c=e(hs),u=e(ia),d=t(n[Dc]||".%L"),f=t(n[Rl]||":%S"),h=t(n[Gs]||"%I:%M"),g=t(n[Ys]||"%I %p"),v=t(n[ps]||n[Sa]||"%a %d"),b=t(n[Ai]||"%b %d"),p=t(n[ka]||"%B"),O=t(n[hs]||"%B"),k=t(n[ia]||"%Y");return S=>(r(S)<S?d:o(S)<S?f:i(S)<S?h:a(S)<S?g:l(S)<S?s(S)<S?v:b:u(S)<S?c(S)<S?p:O:k)(S)}function uke(t){const e=GS(t.format),n=GS(t.utcFormat);return{timeFormat:r=>Z_(r)?e(r):cke(e,bT,r),utcFormat:r=>Z_(r)?n(r):cke(n,yT,r),timeParse:GS(t.parse),utcParse:GS(t.utcParse)}}function dke(){return Vz=uke({format:UH,parse:Fwe,utcFormat:IG,utcParse:Bwe})}function fke(t){return uke(qwe(t))}CO=function(t){return arguments.length?Vz=fke(t):Vz},function(t){XS=qwe(t),UH=XS.format,Fwe=XS.parse,IG=XS.utcFormat,Bwe=XS.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),ske(),dke();const qz=(t,e)=>mg({},t,e);$6e=function(t,e){const n=t?lke(t):kT(),r=e?fke(e):CO();return qz(n,r)},FG=function(t,e){const n=arguments.length;return n&&n!==2&&wa("defaultLocale expects either zero or two arguments."),n?qz(kT(t),CO(e)):qz(kT(),CO())},y6e=function(){return ske(),dke(),FG()};const vrt=/^(data:|([A-Za-z]+:)?\/\/)/,yrt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,brt=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,xrt="file://";async function Ort(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function wrt(t,e){e=mg({},this.options,e);const n=this.fileAccess,r={href:null};let o,i,a;const s=yrt.test(t.replace(brt,""));t!=null&&typeof t=="string"&&s||wa("Sanitize failure, invalid URI: "+OT(t));const l=vrt.test(t);return(a=e.baseURL)&&!l&&(t.startsWith("/")||a.endsWith("/")||(t="/"+t),t=a+t),i=(o=t.startsWith(xrt))||e.mode==="file"||e.mode!=="http"&&!l&&n,o?t=t.slice(7):t.startsWith("//")&&(e.defaultProtocol==="file"?(t=t.slice(2),i=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!i}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),e.context==="image"&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function krt(t){return t?e=>new Promise((n,r)=>{t.readFile(e,(o,i)=>{o?r(o):n(i)})}):Srt}async function Srt(){wa("No file system access.")}function Crt(t){return t?async function(e,n){const r=mg({},this.options.http,n),o=n&&n.response,i=await t(e,r);return i.ok?uy(i[o])?i[o]():i.text():wa(i.status+""+i.statusText)}:_rt}async function _rt(){wa("No HTTP fetch method available.")}let hke,Fz,KS,pke;hke=t=>t!=null&&t==t,Fz=t=>!(Number.isNaN(+t)||t instanceof Date),ST={boolean:JG,integer:xO,number:xO,date:eK,string:KG,unknown:kO},KS=[t=>t==="true"||t==="false"||t===!0||t===!1,t=>Fz(t)&&Number.isInteger(+t),Fz,t=>!Number.isNaN(Date.parse(t))],pke=["boolean","integer","number","date"],XG=function(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=KS.length,o=KS.map((i,a)=>a+1);for(let i,a,s=0,l=0;s<n;++s)for(a=e?t[s][e]:t[s],i=0;i<r;++i)if(o[i]&&hke(a)&&!KS[i](a)&&(o[i]=0,++l,l===KS.length))return"string";return pke[o.reduce((i,a)=>i===0?a:i,0)-1]},HG=function(t,e){return e.reduce((n,r)=>(n[r]=XG(t,r),n),{})};function mke(t){const e=function(n,r){const o={delimiter:t};return Bz(n,r?mg(r,o):o)};return e.responseType="text",e}function Bz(t,e){return e.header&&(t=e.header.map(OT).join(e.delimiter)+`
|
227
227
|
`+t),Ztt(e.delimiter).parse(t+"")}function Wz(t,e){const n=e&&e.property?xT(e.property):kO;return Uv(t)&&!function(r){return!(typeof Buffer!="function"||!uy(Buffer.isBuffer))&&Buffer.isBuffer(r)}(t)?function(r,o){return!eO(r)&&YG(r)&&(r=[...r]),o&&o.copy?JSON.parse(JSON.stringify(r)):r}(n(t),e):n(JSON.parse(t))}Bz.responseType="text",Wz.responseType="json";const Trt={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function gke(t,e){let n,r,o,i;return t=Wz(t,e),e&&e.feature?(n=Htt,o=e.feature):e&&e.mesh?(n=Gtt,o=e.mesh,i=Trt[e.filter]):wa("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[o])?n(t,r,i):wa("Invalid TopoJSON object: "+o),r&&r.features||[r]}gke.responseType="json",wT={dsv:Bz,csv:mke(","),tsv:mke(" "),json:Wz,topojson:gke},N_=function(t,e){return arguments.length>1?(wT[t]=e,this):Ru(wT,t)?wT[t]:null},r6e=function(t){const e=N_(t);return e&&e.responseType||"text"},UG=function(t,e,n,r){const o=N_((e=e||{}).type||"json");return o||wa("Unknown data format type: "+e.type),t=o(t,e),e.parse&&function(i,a,s,l){if(!i.length)return;const c=CO();s=s||c.timeParse,l=l||c.utcParse;let u,d,f,h,g,v,b=i.columns||Object.keys(i[0]);a==="auto"&&(a=HG(i,b)),b=Object.keys(a);const p=b.map(O=>{const k=a[O];let S,w;if(k&&(k.startsWith("date:")||k.startsWith("utc:")))return S=k.split(/:(.+)?/,2),w=S[1],(w[0]==="'"&&w[w.length-1]==="'"||w[0]==='"'&&w[w.length-1]==='"')&&(w=w.slice(1,-1)),(S[0]==="utc"?l:s)(w);if(!ST[k])throw Error("Illegal format pattern: "+O+":"+k);return ST[k]});for(f=0,g=i.length,v=b.length;f<g;++f)for(u=i[f],h=0;h<v;++h)d=b[h],u[d]=p[h](u[d])}(t,e.parse,n,r),Ru(t,"columns")&&delete t.columns,t},BG=function(t,e){return n=>({options:n||{},sanitize:wrt,load:Ort,fileAccess:!1,file:krt(e),http:Crt(t)})}(typeof fetch<"u"&&fetch,null);function vke(t,e){return UG(t,e)}function Prt(){return BG()}const nu=ST;function yke(){const t=function(n){return{...n,async load(r,o){return r.endsWith(".arrow")?wz(await bke(r),{useProxy:!1}).toArray():n.load(r,o)}}}(Prt()),e=n=>JSON.stringify(n);return{load:VS(t.load.bind(t),e),sanitize:VS(t.sanitize.bind(t),e),http:VS(t.http.bind(t),e),file:VS(t.file.bind(t),e)}}const bke=VS(t=>fetch(t).then(e=>e.arrayBuffer()),t=>t),Ert=({numBars:t,maxHeight:e,seed:n})=>{const r=[];let o=(i=>{let a=0;for(let s=0;s<i.length;s++)a=(a<<5)-a+i.charCodeAt(s),a=Math.trunc(a);return a})(n);for(let i=0;i<t;i++){o=(9301*o+49297)%233280;const a=o/233280,s=Math.abs(Math.floor(a*e));r.push(s)}return r},Rrt=t=>{const e=ue.c(11),{seed:n,width:r,height:o}=t,i=r/9,a=o-15;let s;if(e[0]!==i||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==r){const l=Ert({numBars:9,maxHeight:a,seed:n});let c,u;e[6]!==o||e[7]!==r?(c={width:r,height:o},e[6]=o,e[7]=r,e[8]=c):c=e[8],e[9]!==i?(u=(d,f)=>y.jsx("div",{className:"bg-[var(--slate-5)] animate-pulse",style:{width:i-2,height:d}},f),e[9]=i,e[10]=u):u=e[10],s=y.jsx("div",{className:"flex items-end gap-[1px] pb-2",style:c,children:l.map(u)}),e[0]=i,e[1]=o,e[2]=n,e[3]=a,e[4]=r,e[5]=s}else s=e[5];return s};function xke(t={}){const{threshold:e=1,root:n=null,rootMargin:r="0px"}=t,[o,i]=_.useState(null),a=_.useRef(null);return[_.useCallback(l=>{if(a.current&&(a.current.disconnect(),a.current=null),(l==null?void 0:l.nodeType)===Node.ELEMENT_NODE){const c=new IntersectionObserver(([u])=>{i(u)},{threshold:e,root:n,rootMargin:r});c.observe(l),a.current=c}},[e,n,r]),o]}let Uz,ih,Zz;$_=t=>{const e=ue.c(13),{milliseconds:n,children:r,fallback:o,visibility:i,threshold:a,rootMargin:s}=t,l=i!==void 0&&i,c=a===void 0?0:a,u=s===void 0?"0px":s,[d,f]=_.useState(!1),[h,g]=_.useState(!1);let v;e[0]!==u||e[1]!==c?(v={threshold:c,root:null,rootMargin:u},e[0]=u,e[1]=c,e[2]=v):v=e[2];const[b,p]=xke(v);let O;e[3]!==(p==null?void 0:p.isIntersecting)?(O=()=>{p!=null&&p.isIntersecting&&g(!0)},e[3]=p==null?void 0:p.isIntersecting,e[4]=O):O=e[4];const k=p==null?void 0:p.isIntersecting;let S,w,T;e[5]!==k?(S=[k],e[5]=k,e[6]=S):S=e[6],_.useEffect(O,S),e[7]!==n?(w=()=>{const N=setTimeout(()=>{f(!0)},n);return()=>{clearTimeout(N)}},T=[n],e[7]=n,e[8]=w,e[9]=T):(w=e[8],T=e[9]),_.useEffect(w,T);const P=l?b:null,j=!(l&&!h)&&d?r:o;let D;return e[10]!==P||e[11]!==j?(D=y.jsx("div",{ref:P,children:j}),e[10]=P,e[11]=j,e[12]=D):D=e[12],D},Uz="#8b8d98",ih="#027864",Zz="#cc4e00";class jrt{constructor(e,n=!1){this.config=e,this.lazy=n,this.initialHealthyCheck=new Xw;try{new URL(this.config.url)}catch(r){throw new Error(`Invalid runtime URL: ${this.config.url}. ${r instanceof Error?r.message:"Unknown error"}`)}this.lazy||this.init()}get httpURL(){return new URL(this.config.url)}get isSameOrigin(){return this.httpURL.origin===window.location.origin}formatHttpURL(e,n,r=!0){e||(e="");const o=this.httpURL,i=new URLSearchParams(window.location.search);if(n)for(const[s,l]of n.entries())o.searchParams.set(s,l);for(const[s,l]of i.entries())r&&!Object.values(Pl).includes(s)||o.searchParams.set(s,l);const a=o.pathname.replace(/\/$/,"");return o.pathname=`${a}/${e.replace(/^\//,"")}`,o.hash="",o}formatWsURL(e,n){return function(r){if(!r.startsWith("http")){Ve.warn(`URL must start with http: ${r}`);const o=new URL(r);return o.protocol="ws",o}return new URL(r.replace(/^http/,"ws"))}(this.formatHttpURL(e,n,!1).toString())}getWsURL(e){const n=new URL(this.config.url),r=new URLSearchParams(n.search);return new URLSearchParams(window.location.search).forEach((o,i)=>{r.has(i)||r.set(i,o)}),r.set(Pl.sessionId,e),this.formatWsURL("/ws",r)}getWsSyncURL(e){const n=new URL(this.config.url),r=new URLSearchParams(n.search);return new URLSearchParams(window.location.search).forEach((o,i)=>{r.has(i)||r.set(i,o)}),r.set(Pl.sessionId,e),this.formatWsURL("/ws_sync",r)}getTerminalWsURL(){return this.formatWsURL("/terminal/ws")}getLSPURL(e){if(e==="copilot"){const n=this.formatWsURL(`/lsp/${e}`);return n.search="",n}return this.formatWsURL(`/lsp/${e}`)}getAiURL(e){return this.formatHttpURL(`/api/ai/${e}`)}healthURL(){return this.formatHttpURL("/health")}async isHealthy(){if(Vh())return!0;try{const e=await fetch(this.healthURL().toString());return e.redirected&&(this.config.url=e.url.replace(/\/health$/,"")),e.ok}catch{return!1}}async init(e){let n=0;for(;!await this.isHealthy();){if(n>=25)return Ve.error("Failed to connect after 25 retries"),void this.initialHealthyCheck.reject(new Error("Failed to connect after 25 retries"));if(!(e!=null&&e.disableRetryDelay)){const r=Math.min(100*1.2**n,2e3);await new Promise(o=>setTimeout(o,r))}n++}this.initialHealthyCheck.resolve()}async waitForHealthy(){return this.initialHealthyCheck.promise}headers(){const e={"Marimo-Session-Id":$H(),"Marimo-Server-Token":this.config.serverToken??"","x-runtime-url":this.httpURL.toString()};return this.config.authToken&&(e.Authorization=`Bearer ${this.config.authToken}`),e}}const Oke={url:function(){const t=new URL(document.baseURI);return t.search="",t.hash="",t.toString()}()},Xz=Ct(Oke),wke=Ct(t=>{const e=t(Xz);return new jrt(e)});wY=function(){return Gr(wke)},ay=function(){return Ht.get(wke)},_A=function(t){return t.startsWith("http")?new URL(t):new URL(t,ay().httpURL.toString())},TA=function(t){return(e=t,e!=null&&e.schema&&Array.isArray(e.schema.fields)&&typeof e.toArray=="function"?t:function(n){return wz(n,{useProxy:!0})}(t)).toArray();var e},TA.responseType="arrayBuffer";const kke=nu.integer,Ske=nu.number,Drt=nu.date,Art=nu.boolean,Cke=()=>(nu.integer=t=>{if(t==="")return"";if(t==="-inf"||t==="inf")return t;function e(o){const i=kke(o);return Number.isNaN(i)?o:i}const n=Number.parseInt(t);if(!(typeof(r=n)=="number"||Ou(r)&&bf(r)=="[object Number]"))return"";if(!(Math.abs(n)>Number.MAX_SAFE_INTEGER))return e(t);try{return BigInt(t)}catch{return e(t)}var r},nu.number=t=>{if(t==="-inf"||t==="inf")return t;const e=Ske(t);return Number.isNaN(e)?t:e},()=>{nu.integer=kke,nu.number=Ske}),_ke=()=>(nu.date=t=>{if(t==="")return"";if(t==null)return null;if(!/^\d{4}-\d{2}-\d{2}(T[\d.:]+(Z|[+-]\d{2}:?\d{2})?)?$/.test(t))return t;try{const e=new Date(t);return Number.isNaN(e.getTime())?t:e}catch{return Ve.warn(`Failed to parse date: ${t}`),t}},()=>{nu.date=Drt});nu.boolean=t=>t==="True"||t!=="False"&&Art(t);const Tke=yke();M_=async function(t,e,n={}){const{handleBigIntAndNumberLike:r=!1,replacePeriod:o=!1}=n;if(t.endsWith(".arrow")||(e==null?void 0:e.type)==="arrow")return wz(await bke(t),{useProxy:!0,useDate:!0,useBigInt:r}).toArray();const i=[_ke];r&&i.push(Cke);let a=[];try{let s=await Tke.load(t);if(!e){if(typeof s=="string")try{JSON.parse(s),e={type:"json"}}catch{e={type:"csv",parse:"auto"}}typeof s=="object"&&(e={type:"json"})}const l=(e==null?void 0:e.type)==="csv";l&&typeof s=="string"&&(s=function(u){return u!=null&&u.includes(",")?Eke(u,d=>{const f=new Set;return d.map(h=>{const g=function(v,b){let p=v,O=1;for(;b.has(p);)p=`${v}${Mrt.repeat(O)}`,O++;return p}(h,f);return f.add(g),g})}):u}(s)),l&&typeof s=="string"&&o&&(s=function(u){const d="\u2024";return u!=null&&u.includes(".")?Eke(u,f=>f.map(h=>h.replaceAll(".",d))):u}(s));let c=(e==null?void 0:e.parse)||"auto";return typeof c=="object"&&(c=cr.mapValues(c,u=>u==="time"?"string":u==="datetime"?"date":u)),a=i.map(u=>u()),vke(s,l?{...e,parse:c}:e)}finally{a.forEach(s=>s())}};function Pke(t,e=!0){const n=[_ke];e&&n.push(Cke);const r=n.map(i=>i()),o=vke(t,{type:"csv",parse:"auto"});return r.forEach(i=>i()),o}function Eke(t,e){const n=t.split(`
|
228
228
|
`),r=e(n[0].split(","));return n[0]=r.join(","),n.join(`
|
229
|
-
`)}const Mrt="\u200B";var Rke;N_("arrow",TA);class db{constructor(e,n,r,o,i){if(this.data=e,this.fieldTypes=n,this.stats=r,this.binValues=o,this.opts=i,this.columnStats=new Map,this.columnBinValues=new Map,this.dataSpec=void 0,this.sourceName=void 0,typeof this.data=="string")if(this.data.startsWith("./@file")||this.data.startsWith("/@file"))this.dataSpec={url:_A(this.data).href},this.sourceName="source_0";else if((s=this.data).startsWith("data:")&&s.includes(";base64,")){this.sourceName="data_0";const l=function(u){return u.split(",")[1]}(this.data),c=v6(l);c.startsWith("ARROW1")?this.dataSpec={values:(a=c,Uint8Array.from(a,u=>u.charCodeAt(0))),format:{type:"arrow"}}:this.parseCsv(c)}else this.parseCsv(this.data),this.sourceName="data_0";else this.dataSpec={values:this.data},this.sourceName="source_0";var a,s;this.columnBinValues=new Map(Object.entries(o)),this.columnStats=new Map(Object.entries(r))}getColumnStats(e){return this.columnStats.get(e)}getHeaderSummary(e){return{stats:this.columnStats.get(e),type:this.fieldTypes[e],spec:this.opts.includeCharts?this.getVegaSpec(e):void 0}}parseCsv(e){this.dataSpec={values:Pke(e)}}getVegaSpec(e){if(!this.data)return null;const n=this.opts.usePreComputedValues,r=this.columnBinValues.get(e),o=r&&r.length>0,i={data:o&&n?{values:r}:this.dataSpec,background:"transparent",config:{view:{stroke:"transparent"},axis:{domain:!1}},height:100},a=this.fieldTypes[e];e=(e=(e=e.replaceAll(".","\\.")).replaceAll("[","\\[").replaceAll("]","\\]")).replaceAll(":","\\:");const s=this.getScale();switch(a){case"date":case"datetime":case"time":{const l=a==="date"?"%Y-%m-%d":a==="time"?"%H:%M:%S":"%Y-%m-%dT%H:%M:%S";return{...i,layer:[{mark:{type:"bar",color:ih},encoding:{x:{field:e,type:"temporal",axis:null,bin:!0,scale:s},y:{aggregate:"count",type:"quantitative",axis:null},color:{condition:{test:`datum["bin_maxbins_10_${e}_range"] === "null"`,value:Zz},value:ih}}},{mark:{type:"bar",opacity:0},encoding:{x:{field:e,type:"temporal",axis:null,bin:!0,scale:s},y:{aggregate:"max",type:"quantitative",axis:null},tooltip:[{field:`bin_maxbins_10_${e}`,type:"temporal",format:l,bin:{binned:!0},title:`${e} (start)`},{field:`bin_maxbins_10_${e}_end`,type:"temporal",format:l,bin:{binned:!0},title:`${e} (end)`},{aggregate:"count",type:"quantitative",title:"Count",format:",d"}],color:{condition:{test:`datum["bin_maxbins_10_${e}_range"] === "null"`,value:Zz},value:ih}}}]}}case"integer":case"number":{const l=a==="integer"?",d":".2f";if(!n||!o)return function(u,d,f){return{...f,layer:[{mark:{type:"bar",color:ih},encoding:{x:{field:u,type:"quantitative",bin:!0},y:{aggregate:"count",type:"quantitative",axis:null}}},{mark:{type:"bar",opacity:0},encoding:{x:{field:u,type:"quantitative",bin:!0,axis:{title:null,labelFontSize:8.5,labelOpacity:.5,labelExpr:"(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : format(datum.value, '.2~f')"}},y:{aggregate:"max",type:"quantitative",axis:null},tooltip:[{field:u,type:"quantitative",bin:!0,title:u,format:d},{aggregate:"count",type:"quantitative",title:"Count",format:",d"}]}}]}}(e,l,i);const c=this.columnStats.get(e);return{...i,layer:[{mark:{type:"bar",color:ih,stroke:ih,strokeWidth:0},params:[{name:"hover",select:{type:"point",on:"mouseover"}}],encoding:{x:{field:"bin_start",type:"quantitative",bin:{binned:!0,step:2}},x2:{field:"bin_end",axis:null},y:{field:"count",type:"quantitative",axis:null},strokeWidth:{condition:{param:"hover",empty:!1,value:.5},value:0}}},{mark:{type:"bar",opacity:0},encoding:{x:{field:"bin_start",type:"quantitative",bin:{binned:!0,step:2},axis:{title:null,labelFontSize:8.5,labelOpacity:.5,labelExpr:"(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : format(datum.value, '.2~f')",values:[c==null?void 0:c.min,c==null?void 0:c.p25,c==null?void 0:c.median,c==null?void 0:c.p75,c==null?void 0:c.p95,c==null?void 0:c.max].filter(u=>u!==void 0)}},x2:{field:"bin_end"},y:{aggregate:"max",type:"quantitative",axis:null},tooltip:[{field:"bin_range",type:"nominal",title:e},{field:"count",type:"quantitative",title:"Count",format:",d"}]},transform:[{calculate:`format(datum.bin_start, '${l}') + ' - ' + format(datum.bin_end, '${l}')`,as:"bin_range"}]}]}}case"boolean":return{...i,mark:{type:"bar",color:ih},encoding:{y:{field:e,type:"nominal",axis:{labelExpr:"datum.label === 'true' || datum.label === 'True' ? 'True' : 'False'",tickWidth:0,title:null,labelColor:Uz}},x:{aggregate:"count",type:"quantitative",axis:null,scale:{type:"linear"}},tooltip:[{field:e,type:"nominal",title:"Value"},{aggregate:"count",type:"quantitative",title:"Count",format:",d"}]},layer:[{mark:{type:"bar",color:ih,height:20}},{mark:{type:"text",align:"left",baseline:"middle",dx:3,color:Uz},encoding:{text:{aggregate:"count",type:"quantitative"}}}]};case"unknown":case"string":return null;default:return us(a),null}}getScale(){return{align:0,paddingInner:0,paddingOuter:{expr:`length(data('${this.sourceName}')) == 2 ? 1 : length(data('${this.sourceName}')) == 3 ? 0.5 : length(data('${this.sourceName}')) == 4 ? 0 : 0`}}}}Rke=db,db.EMPTY=new Rke([],{},{},{},{includeCharts:!1,usePreComputedValues:!1});const jke=t=>{const e=ue.c(20),{date:n,type:r,children:o}=t;if(!n||Number.isNaN(new Date(n).getTime()))return o;let i,a,s,l,c,u;if(e[0]!==n||e[1]!==r){const g=new Date(n),v=function(b){const p=new Intl.RelativeTimeFormat("en",{numeric:"auto"}),O=(new Date().getTime()-b.getTime())/1e3,k=[[60,1,"second"],[60,60,"minute"],[24,3600,"hour"],[365,86400,"day"],[Number.POSITIVE_INFINITY,31536e3,"year"]];for(const[S,w,T]of k){const P=O/w;if(P<S){const j=-Number(P.toFixed(1));return p.format(j,T)}}return p.format(0,"second")}(g);s="min-w-[240px] p-1 text-sm",e[6]!==v?(l=y.jsx("div",{className:"text-muted-foreground mb-2",children:v}),e[6]=v,e[7]=l):l=e[7],i="space-y-1",a=r==="datetime"?Object.entries(function(b){const p=Intl.DateTimeFormat().resolvedOptions().timeZone;return b.getUTCMilliseconds()!==0?{UTC:new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}).format(b),[p]:new Intl.DateTimeFormat("en-US",{timeZone:p,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}).format(b)}:{UTC:new Intl.DateTimeFormat("en-US",{timeZone:"UTC",dateStyle:"long",timeStyle:"medium"}).format(b),[p]:new Intl.DateTimeFormat("en-US",{timeZone:p,dateStyle:"long",timeStyle:"medium"}).format(b)}}(g)).map(Nrt):y.jsx("span",{children:g.toLocaleDateString("en-US",{timeZone:"UTC",dateStyle:"long"})}),e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=s,e[5]=l}else i=e[2],a=e[3],s=e[4],l=e[5];e[8]!==i||e[9]!==a?(c=y.jsx("div",{className:i,children:a}),e[8]=i,e[9]=a,e[10]=c):c=e[10],e[11]!==s||e[12]!==l||e[13]!==c?(u=y.jsxs("div",{className:s,children:[l,c]}),e[11]=s,e[12]=l,e[13]=c,e[14]=u):u=e[14];const d=u;let f,h;return e[15]!==o?(f=y.jsx("span",{children:o}),e[15]=o,e[16]=f):f=e[16],e[17]!==d||e[18]!==f?(h=y.jsx(qn,{content:d,delayDuration:200,children:f}),e[17]=d,e[18]=f,e[19]=h):h=e[19],h};function Nrt(t){const[e,n]=t;return y.jsxs("div",{className:"grid grid-cols-[fit-content(40px),1fr] gap-4 items-center justify-items-end",children:[y.jsx("span",{className:"bg-muted rounded-md py-1 px-2 w-fit ml-auto",children:e}),y.jsx("span",{children:n})]},e)}const Dke=ge.createContext(db.EMPTY),$rt=ge.lazy(()=>Be(()=>import("./index-BrcZZepi.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107,108,109,110,111,112,113]),import.meta.url).then(t=>({default:t.VegaLite}))),Irt=yke(),Qrt=t=>{const e=ue.c(24),{columnId:n}=t,r=ge.use(Dke),{theme:o}=as();let i;e[0]!==r||e[1]!==n?(i=r.getHeaderSummary(n),e[0]=r,e[1]=n,e[2]=i):i=e[2];const{spec:a,type:s,stats:l}=i;let c=null;if(a){let b;e[3]!==n?(b=y.jsx(Rrt,{seed:n,width:80,height:40}),e[3]=n,e[4]=b):b=e[4];const p=b;let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O={minWidth:"unset",maxHeight:"40px"},e[5]=O):O=e[5];const k=o==="dark"?"dark":"vox";let S,w,T;e[6]!==a||e[7]!==k?(S=y.jsx($rt,{spec:a,width:70,height:30,loader:Irt,style:O,actions:!1,theme:k}),e[6]=a,e[7]=k,e[8]=S):S=e[8],e[9]!==p||e[10]!==S?(w=y.jsx(_.Suspense,{fallback:p,children:S}),e[9]=p,e[10]=S,e[11]=w):w=e[11],e[12]!==p||e[13]!==w?(T=y.jsx($_,{milliseconds:200,visibility:!0,rootMargin:"200px",fallback:p,children:w}),e[12]=p,e[13]=w,e[14]=T):T=e[14],c=T}const u=Lrt;let d;e[15]!==a||e[16]!==l||e[17]!==s?(d=()=>{if(!l)return null;switch(s){case"date":case"datetime":return a?y.jsxs("div",{className:"flex justify-between w-full px-2 whitespace-pre",children:[y.jsx("span",{children:u(l.min,s)}),l.min===l.max?null:y.jsxs("span",{children:["-",u(l.max,s)]})]}):y.jsxs("div",{className:"flex flex-col whitespace-pre",children:[y.jsxs("span",{children:["min: ",u(l.min,s)]}),y.jsxs("span",{children:["max: ",u(l.max,s)]}),y.jsxs("span",{children:["unique: ",th(l.unique)]})]});case"integer":case"number":return a?null:y.jsxs("div",{className:"flex flex-col whitespace-pre",children:[y.jsxs("span",{children:["min:"," ",typeof l.min=="number"?nh(l.min,{shouldRound:!0}):l.min]}),y.jsxs("span",{children:["max:"," ",typeof l.max=="number"?nh(l.max,{shouldRound:!0}):l.max]}),y.jsxs("span",{children:["unique: ",th(l.unique)]})]});case"boolean":return a?null:y.jsxs("div",{className:"flex flex-col whitespace-pre",children:[y.jsxs("span",{children:["true: ",th(l.true)]}),y.jsxs("span",{children:["false: ",th(l.false)]})]});case"time":return null;case"string":return y.jsx("div",{className:"flex flex-col whitespace-pre",children:y.jsxs("span",{children:["unique: ",th(l.unique)]})});case"unknown":return y.jsx("div",{className:"flex flex-col whitespace-pre",children:y.jsxs("span",{children:["nulls: ",th(l.nulls)]})});default:return us(s),null}},e[15]=a,e[16]=l,e[17]=s,e[18]=d):d=e[18];const f=d,h=c;let g,v;return e[19]!==f?(g=f(),e[19]=f,e[20]=g):g=e[20],e[21]!==c||e[22]!==g?(v=y.jsxs("div",{className:"flex flex-col items-center text-xs text-muted-foreground align-end",children:[h,g]}),e[21]=c,e[22]=g,e[23]=v):v=e[23],v};function Lrt(t,e){return y.jsx(jke,{date:t,type:e,children:ZKe(t,e)})}const zrt=t=>{const e=ue.c(6),{value:n}=t;let r;e[0]!==n.data||e[1]!==n.mimetype?(r={channel:"output",data:n.data,mimetype:n.mimetype,timestamp:0},e[0]=n.data,e[1]=n.mimetype,e[2]=r):r=e[2];const o=r;let i,a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=we("flex items-center space-x-2"),e[3]=i):i=e[3],e[4]!==o?(a=y.jsx("div",{className:i,children:y.jsx(ng,{message:o})}),e[4]=o,e[5]=a):a=e[5],a};function Hz(t){return typeof t=="object"&&t!==null&&"mimetype"in t&&"data"in t}const Ake=/(https?:\/\/\S+)/,Vrt=/\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i,Mke=/^data:image\//i,qrt=["avatars.githubusercontent.com"],Frt=t=>{const e=ue.c(14),{url:n}=t,[r,o]=_.useState(!1),[i,a]=_.useState(!1);if(r){let g;return e[0]!==n?(g=y.jsx($ke,{url:n}),e[0]=n,e[1]=g):g=e[1],g}let s,l,c,u,d,f,h;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=()=>a(!0),l=()=>a(!1),e[2]=s,e[3]=l):(s=e[2],l=e[3]),e[4]===Symbol.for("react.memo_cache_sentinel")?(c=()=>o(!0),e[4]=c):c=e[4],e[5]!==n?(u=y.jsx(sy,{asChild:!0,children:y.jsx("div",{className:"flex max-h-[80px] overflow-hidden cursor-pointer",onMouseEnter:s,onMouseLeave:l,children:y.jsx("img",{src:n,alt:"URL preview",className:"object-contain rounded max-h-[80px]",onError:c})})}),e[5]=n,e[6]=u):u=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),e[7]=d):d=e[7],e[8]!==n?(f=y.jsx(tp,{className:"z-50 p-2 bg-popover rounded-md shadow-lg border w-fit",align:"start",side:"right",children:y.jsx("img",{src:n,alt:"URL preview",className:"object-contain max-h-[500px] rounded",onError:d})}),e[8]=n,e[9]=f):f=e[9],e[10]!==i||e[11]!==u||e[12]!==f?(h=y.jsxs(dg,{open:i,onOpenChange:a,children:[u,f]}),e[10]=i,e[11]=u,e[12]=f,e[13]=h):h=e[13],h},Nke=({parts:t})=>t.map((e,n)=>e.type==="url"?y.jsx($ke,{url:e.url},n):e.type==="image"?y.jsx(Frt,{url:e.url},n):e.value),$ke=t=>{const e=ue.c(3),{url:n}=t;let r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ai.stopPropagation(),e[0]=r):r=e[0],e[1]!==n?(o=y.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",onClick:r,className:"text-link hover:underline",children:n}),e[1]=n,e[2]=o):o=e[2],o};function Ike(t){return typeof t=="string"?["string","string"]:typeof t=="number"?["number","number"]:t instanceof Date?["datetime","datetime"]:typeof t=="boolean"?["boolean","boolean"]:["unknown","object"]}function Aj(t){if(t.length===0)return[];if(typeof t[0]!="object")return[];const e={};return function(n,r){if(n.length<=r)return n;const o=[],i=n.length/r;for(let s=0;s<r-1;s++){const l=Math.floor(s*i);o.push(n[l])}const a=n.at(-1);return o.push(a),o}(t,10).forEach(n=>{typeof n=="object"&&n!==null&&Object.entries(n).forEach(([r,o])=>{e[r]||(e[r]=Ike(o)),o!=null&&(e[r]=Ike(o))})}),cr.entries(e)}const JS="__m_column__";function Qke({rowHeaders:t,selection:e,fieldTypes:n,chartSpecModel:r,textJustifyColumns:o,wrappedColumns:i,showDataTypes:a,calculateTopKRows:s}){const l=new Set(t.map(([g])=>g)),c=Vv.keyBy(n,g=>g[0]),u=g=>{var p,O;const v=(p=c.get(g))==null?void 0:p[1],b=l.has(g);if(b||!v){const k=(O=t.find(([S])=>S===g))==null?void 0:O[1];return{rowHeader:b,dtype:k==null?void 0:k[1],dataType:k==null?void 0:k[0]}}return{rowHeader:b,filterType:Brt(v[0]),dtype:v[1],dataType:v[0]}},d=[...l,...n.map(([g])=>g)],f=d.indexOf(IS);f!==-1&&d.splice(f,1);const h=d.map((g,v)=>({id:g||`${JS}${v}`,accessorFn:b=>b[g],header:({column:b})=>{var T;const p=r==null?void 0:r.getColumnStats(g),O=(T=b.columnDef.meta)==null?void 0:T.dtype,k=a&&O?y.jsxs("div",{className:"flex flex-row gap-1",children:[y.jsx("span",{className:"text-xs text-muted-foreground",children:O}),p&&typeof p.nulls=="number"&&p.nulls>0&&y.jsxs("span",{className:"text-xs text-muted-foreground",children:["(nulls: ",p.nulls,")"]})]}):null,S=y.jsxs("div",{className:"flex flex-col",children:[y.jsx("span",{className:"font-bold",children:g===""?" ":g}),k]}),w=y.jsx(ree,{header:S,column:b,calculateTopKRows:s});return l.has(g)?w:y.jsxs("div",{className:"flex flex-col h-full pt-0.5 pb-3 justify-between items-start",children:[w,y.jsx(Qrt,{columnId:g})]})},cell:({column:b,renderValue:p,getValue:O,cell:k})=>{var D;const S=o==null?void 0:o[g],w=i==null?void 0:i.includes(g),T=((D=k==null?void 0:k.getIsSelected)==null?void 0:D.call(k))||!1,P=function(N,E,A,I){return we(A&&"cursor-pointer",I&&"relative before:absolute before:inset-0 before:bg-[var(--blue-3)] before:rounded before:-z-10 before:mx-[-4px] before:my-[-2px]","w-full","text-left","truncate",N==="center"&&"text-center",N==="right"&&"text-right",E&&"whitespace-pre-wrap min-w-[200px] break-words")}(S,w,(e==="single-cell"||e==="multi-cell")&&!T,T),j=qke(b,p,O,function(){var N;e!=="single-cell"&&e!=="multi-cell"||((N=k.toggleSelected)==null||N.call(k))},P);return l.has(g)?y.jsx("b",{children:j}):j},filterFn:void 0,enableSorting:!!g,meta:u(g)}));return e!=="single"&&e!=="multi"||h.unshift({id:"__select__",maxSize:40,header:({table:g})=>e==="multi"?y.jsx(Tl,{"data-testid":"select-all-checkbox",checked:g.getIsAllPageRowsSelected(),onCheckedChange:v=>g.toggleAllPageRowsSelected(!!v),"aria-label":"Select all",className:"mx-1.5 my-4"}):null,cell:({row:g})=>y.jsx(Tl,{"data-testid":"select-row-checkbox",checked:g.getIsSelected(),onCheckedChange:v=>g.toggleSelected(!!v),"aria-label":"Select row",className:"mx-2",onMouseDown:v=>{v.stopPropagation()}}),enableSorting:!1,enableHiding:!1}),h}const Lke=({cellStyles:t,selectCell:e,rawStringValue:n,contentClassName:r,buttonText:o,children:i})=>y.jsx(G3,{container:null,children:y.jsxs(dg,{children:[y.jsx(sy,{className:we(t,"w-fit outline-none"),onClick:e,onMouseDown:a=>{a.stopPropagation()},children:y.jsx("span",{className:"cursor-pointer hover:text-link",title:n,children:n})}),y.jsxs(tp,{className:r,align:"start",alignOffset:10,children:[y.jsx(p9,{className:"absolute top-2 right-2",children:y.jsx(Ft,{variant:"link",size:"xs",children:o??"Close"})}),i]})]})});function Brt(t){if(t!==void 0)switch(t){case"string":return"text";case"number":case"integer":return"number";case"date":return"date";case"datetime":return"datetime";case"time":return"time";case"boolean":return"boolean";default:return}}function zke(t){if(t==null)return"";try{return JSON.stringify(t)}catch{return String(t)}}function Vke(t,e,n){const r=e==="date"?"date":"datetime",o=function(i){var s;if(!i)return;const a=/^datetime(?:64)?\[[^,]+,([^,]+)]$/.exec(i);return(s=a==null?void 0:a[1])==null?void 0:s.trim()}(n);return y.jsx(jke,{date:t,type:r,children:XKe(t,o)})}function qke(t,e,n,r,o){var u,d,f;const i=n(),a=(u=t.getColumnFormatting)==null?void 0:u.call(t),s=(d=t.columnDef.meta)==null?void 0:d.dataType,l=(f=t.columnDef.meta)==null?void 0:f.dtype;if(s==="datetime"&&typeof i=="string")try{return Vke(new Date(i),s,l)}catch(h){Ve.error("Error parsing datetime, fallback to string",h)}if(i instanceof Date)return Vke(i,s,l);if(typeof i=="string"){const h=String(a?t.applyColumnFormatting(i):e()),g=function(v){return Mke.test(v)?[{type:"image",url:v}]:v.split(Ake).filter(b=>b.trim()!=="").map(b=>Ake.test(b)?Vrt.test(b)||Mke.test(b)||qrt.some(p=>b.includes(p))?{type:"image",url:b}:{type:"url",url:b}:{type:"text",value:b})}(h);return g.some(v=>v.type!=="text")||h.length<50?y.jsx("div",{onClick:r,className:o,children:y.jsx(Nke,{parts:g})}):y.jsx(Lke,{cellStyles:o,selectCell:r,rawStringValue:h,contentClassName:"max-h-64 overflow-auto whitespace-pre-wrap break-words text-sm",buttonText:"X",children:y.jsx(Nke,{parts:g})})}if(a)return y.jsx("div",{onClick:r,className:o,children:t.applyColumnFormatting(i)});if(function(h){return h==null||typeof h!="object"}(i)){const h=e();return y.jsx("div",{onClick:r,className:o,children:h==null?"":String(h)})}const c=function(h){if(Hz(h))return[h];if(typeof h=="object"&&h!==null&&("_serialized_mime_bundle"in h||"serialized_mime_bundle"in h)){const g=h,v=g._serialized_mime_bundle||g.serialized_mime_bundle;if(Hz(v))return[v]}if(Array.isArray(h)&&h.every(Hz))return h.map(g=>g)}(i);if(c)return y.jsx("div",{onClick:r,className:o,children:c.map((h,g)=>y.jsx(zrt,{value:h},g))});if(Array.isArray(i)||typeof i=="object"){const h=zke(i);return y.jsx(Lke,{cellStyles:o,selectCell:r,rawStringValue:h,children:y.jsx(_k,{data:i,format:"tree",className:"max-h-64"})})}return y.jsx("div",{onClick:r,className:o,children:zke(i)})}async function Fke(t){return Array.isArray(t)?t:t.startsWith("{")||t.startsWith("[")?bM(t):t=await M_(t,{type:"json"},{handleBigIntAndNumberLike:!0})}function Yz(t){if(t&&typeof t=="object"&&IS in t)return String(t[IS])}function Bke(t){return Yz(t)??t.id}const Wrt={getInitialState:t=>({...t,cellSelection:[]}),getDefaultOptions:t=>({onCellSelectionChange:da("cellSelection",t),enableCellSelection:!1}),createTable:t=>{t.setCellSelection=e=>{var n,r;t.setState(o=>({...o,cellSelection:Zi.asUpdater(e)(o.cellSelection)})),(r=(n=t.options).onCellSelectionChange)==null||r.call(n,e)},t.resetCellSelection=e=>{t.setCellSelection&&t.setCellSelection(()=>e??[])}},createCell:(t,e,n,r)=>{t.getIsSelected=()=>(r.getState().cellSelection??[]).some(o=>o.rowId===Bke(n)&&o.columnName===e.id),t.toggleSelected=o=>{var c;if(!r.setCellSelection)return;const i=e.id,a=((c=t.getIsSelected)==null?void 0:c.call(t))||!1,s=o===void 0?!a:o,l=Bke(n);s&&!a?r.options.enableMultiCellSelection?r.setCellSelection(u=>[{rowId:l,columnName:i},...u]):r.setCellSelection(u=>[{rowId:l,columnName:i}]):a&&!s&&(r.options.enableMultiCellSelection?r.setCellSelection(u=>u.filter(d=>!(d.rowId===l&&d.columnName===i))):r.setCellSelection(u=>[]))}}};let Wke,Uke,Zke,Xke,Hke;Wke={getInitialState:t=>({...t,cellStyling:{}}),createCell:(t,e,n,r)=>{t.getUserStyling=()=>{var a;const o=r.getState().cellStyling,i=function(s){return Yz(s)??s.id}(n);return((a=o==null?void 0:o[i])==null?void 0:a[e.id])||{}}}},Uke={getInitialState:t=>({columnWrapping:{},...t}),getDefaultOptions:t=>({enableColumnWrapping:!0,onColumnWrappingChange:da("columnWrapping",t)}),createColumn:(t,e)=>{t.getColumnWrapping=()=>e.getState().columnWrapping[t.id]||"nowrap",t.getCanWrap=()=>e.options.enableColumnWrapping??!1,t.toggleColumnWrapping=n=>{var r,o;(o=(r=e.options).onColumnWrappingChange)==null||o.call(r,i=>{const a=i[t.id]||"nowrap";return n?{...i,[t.id]:n}:{...i,[t.id]:a==="nowrap"?"wrap":"nowrap"}})}}},Zke={getDefaultOptions:t=>({enableCopyColumn:!0}),createColumn:(t,e)=>{t.getCanCopy=()=>e.options.enableCopyColumn??!1}},Xke=Po("inline-flex items-center border rounded-full px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary hover:bg-primary/60 border-transparent text-primary-foreground",defaultOutline:"bg-[var(--blue-2)] border-[var(--blue-8)] text-[var(--blue-11)]",secondary:"bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground",destructive:"bg-[var(--red-2)] border-[var(--red-6)] text-[var(--red-9)] hover:bg-[var(--red-3)]",success:"bg-[var(--grass-2)] border-[var(--grass-5)] text-[var(--grass-9)] hover:bg-[var(--grass-3)]",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),aM=t=>{const e=ue.c(10);let n,r,o,i,a;return e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==n||e[5]!==o?(i=we(Xke({variant:o}),n),e[4]=n,e[5]=o,e[6]=i):i=e[6],e[7]!==r||e[8]!==i?(a=y.jsx("div",{className:i,...r}),e[7]=r,e[8]=i,e[9]=a):a=e[9],a},Hke=({filters:t,table:e})=>!t||t.length===0?null:y.jsx("div",{className:"flex flex-wrap gap-2 px-1",children:t.map(function(n){const r=function(o){var i,a,s,l;if("type"in o){if(o.operator==="is_null")return"is null";if(o.operator==="is_not_null")return"is not null";if(o.type==="number")return Mj(o.min,o.max);if(o.type==="date")return Mj((i=o.min)==null?void 0:i.toISOString(),(a=o.max)==null?void 0:a.toISOString());if(o.type==="time"){const c=new Intl.DateTimeFormat("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"});return Mj(o.min?c.format(o.min):void 0,o.max?c.format(o.max):void 0)}return o.type==="datetime"?Mj((s=o.min)==null?void 0:s.toISOString(),(l=o.max)==null?void 0:l.toISOString()):o.type==="boolean"?"is "+(o.value?"True":"False"):o.type==="select"?`is in [${o.options.map(u=>dz({value:u})).join(", ")}]`:o.type==="text"?`contains "${o.text}"`:void us(o)}}(n.value);return r?y.jsxs(aM,{variant:"secondary",className:"dark:invert",children:[n.id," ",r," ",y.jsx("span",{className:"cursor-pointer opacity-60 hover:opacity-100 pl-1 py-[2px]",onClick:()=>{e.setColumnFilters(o=>o.filter(i=>i.id!==n.id))},children:y.jsx(Qa,{className:"w-3.5 h-3.5"})})]},n.id):null})});function Mj(t,e){if(t!==void 0||e!==void 0)return t===e?`== ${t}`:t===void 0?`<= ${e}`:e===void 0?`>= ${t}`:`${t} - ${e}`}const Urt={getInitialState:t=>({...t,focusedRowIdx:-1}),getDefaultOptions:t=>({enableFocusRow:!0,onFocusRowChange:da("focusedRowIdx",t)}),createRow:(t,e)=>{t.focusRow=n=>{var r,o;(o=(r=e.options).onFocusRowChange)==null||o.call(r,n)},t.getFocusedRowIdx=()=>e.getState().focusedRowIdx}},Zrt=(t,e)=>t===e;function Yke(t,e=Zrt){const[n,r]=_.useState(t),o=_.useRef(t);return e(o.current,t)||(r(t),o.current=t),[n,r]}function Gke(t){return t&&t.length!==0?t.includes($S)?t:[$S,...t]:[]}const Kke=new WeakMap,Xrt=t=>{let e=Kke.get(t);return e||(e=new WeakSet,Kke.set(t,e)),e},e2=Symbol("scope"),Jke={};function Hrt({atomSet:t=new Set,atomFamilySet:e=new Set,parentStore:n,scopeName:r}){const o=e2 in n?n[e2]:void 0,i=new WeakMap,a=new WeakMap,s=new WeakMap,l={getAtom:u,cleanup(){},prepareWriteAtom(v,b,p,O){if(b.read===Gz&&Nj(b)&&Nj(v)&&b.write!==eSe&&l!==p){const{write:k}=b;return v.write=g(b.write.bind(b),p,O),()=>{v.write=k}}}};for(const v of t)i.set(v,[h(v,l),l]);const c=new Set;for(const v of e){for(const p of v.getParams()){const O=v(p);i.has(O)||i.set(O,[h(O,l),l])}const b=v.unstable_listen(p=>{p.type!=="CREATE"||i.has(p.atom)?t.has(p.atom)||i.delete(p.atom):i.set(p.atom,[h(p.atom,l),l])});c.add(b)}function u(v,b){var p,O;if(i.has(v))return i.get(v);if(b===l)return a.has(v)||a.set(v,[h(v,b),b]),a.get(v);const k=b??Jke;if(o){if((p=s.get(k))==null||!p.has(v)){const[S,w]=o.getAtom(v,b);d(f(S,v,w),v,b,w)}return s.get(k).get(v)}return(O=s.get(k))!=null&&O.has(v)||d(f(v,v),v),s.get(k).get(v)}function d(v,b,p,O){const k=p??Jke;s.has(k)||s.set(k,new WeakMap),s.get(k).set(b,[v,O].filter(Boolean))}function f(v,b,p){return b.read!==Gz?h(b,p):v}function h(v,b){const p=Object.create(Object.getPrototypeOf(v),Object.getOwnPropertyDescriptors(v));return p.originalAtom=v,p.read!==Gz&&(p.read=function(O,k){return function(S,w){return O(function(T){const[P]=u(T,k);return S(P)},w)}}(v.read.bind(v),b)),Nj(p)&&Nj(v)&&p.write!==eSe&&(p.write=g(v.write.bind(v),b)),p}function g(v,b,p=b){return function(O,k,...S){return v(function(w){const[T]=u(w,b);return O(T)},function(w,...T){const[P]=u(w,b),j=l.prepareWriteAtom(P,w,b,p);try{return k(P,...T)}finally{j==null||j()}},...S)}}return l.cleanup=function(...v){return function(){for(const b of v)b()}}(l.cleanup,...Array.from(c)),function(v,b){const p={...v,get(O,...k){const[S]=b.getAtom(O);return v.get(S,...k)},set(O,...k){const[S,w]=b.getAtom(O),T=b.prepareWriteAtom(S,O,w,b);try{return v.set(S,...k)}finally{T==null||T()}},sub(O,...k){const[S]=b.getAtom(O);return v.sub(S,...k)},[e2]:b};return Object.assign(Object.create(Yrt.prototype),p)}(n,l)}function Nj(t){return"write"in t}const{read:Gz,write:eSe}=Ct(null);function Yrt(){}VJ=function({atoms:t=[],atomFamilies:e,children:n,debugName:r}){const o=gy(),i=Array.from(t,h=>Array.isArray(h)?h[0]:h),a=new Set(i),s=new Set(e);function l(){return{scopedStore:Hrt({atomSet:a,atomFamilySet:s,parentStore:o,scopeName:r}),hasChanged:h=>o!==h.parentStore||!tSe(a,h.atomSet)||!tSe(s,h.atomFamilySet)}}const[c,u]=_.useState(l),{hasChanged:d,scopedStore:f}=c;return d({atomSet:a,atomFamilySet:s,parentStore:o})&&(f[e2].cleanup(),u(l)),function(h,g){const v=gy(g),b=Xrt(v);for(const[p,O]of h)(!b.has(p)||g!=null&&g.dangerouslyForceHydrate)&&(b.add(p),v.set(p,O))}(Array.from(t).filter(Array.isArray),{store:f}),_.useEffect(()=>f[e2].cleanup,[f]),_.createElement(Hv,{store:f},n)};function tSe(t,e){return t===e||t.size===e.size&&Array.from(t).every(e.has.bind(e))}const Grt=t=>{const e=ue.c(3),{children:n}=t;let r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=[v0],e[0]=r):r=e[0],e[1]!==n?(o=y.jsx(VJ,{atoms:r,children:n}),e[1]=n,e[2]=o):o=e[2],o},Krt=t=>{const e=ue.c(22),{hidden:n,value:r,handleSearch:o,onHide:i,reloading:a}=t,[s,l]=_.useState(r),c=function(j,D){const[N,E]=_.useState(j);return _.useEffect(()=>{const A=setTimeout(()=>{E(j)},D);return()=>{clearTimeout(A)}},[j,D]),N}(s,500),u=Fn(o),d=ge.useRef(null);let f,h,g,v;e[0]!==c||e[1]!==u?(f=()=>{u(c)},h=[c,u],e[0]=c,e[1]=u,e[2]=f,e[3]=h):(f=e[2],h=e[3]),_.useEffect(f,h),e[4]!==n?(g=()=>{var j;n?l(""):(j=d.current)==null||j.focus()},v=[n],e[4]=n,e[5]=g,e[6]=v):(g=e[5],v=e[6]),_.useEffect(g,v);const b=n&&"h-0 border-none opacity-0";let p,O,k,S,w,T,P;return e[7]!==b?(p=we("flex items-center space-x-2 h-8 px-2 border-b transition-all overflow-hidden duration-300 opacity-100",b),e[7]=b,e[8]=p):p=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(Jm,{className:"w-4 h-4 text-muted-foreground"}),e[9]=O):O=e[9],e[10]!==i?(k=j=>{j.key==="Escape"&&i()},e[10]=i,e[11]=k):k=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(S=j=>l(j.target.value),e[12]=S):S=e[12],e[13]!==s||e[14]!==k?(w=y.jsx("input",{type:"text",ref:d,className:"w-full h-full border-none bg-transparent focus:outline-none text-sm",value:s,onKeyDown:k,onChange:S,placeholder:"Search"}),e[13]=s,e[14]=k,e[15]=w):w=e[15],e[16]!==a?(T=a&&y.jsx(Ym,{size:"small"}),e[16]=a,e[17]=T):T=e[17],e[18]!==w||e[19]!==T||e[20]!==p?(P=y.jsxs("div",{className:p,children:[O,w,T]}),e[18]=w,e[19]=T,e[20]=p,e[21]=P):P=e[21],P},Jrt=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)})();function cm(t){const e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n]);return e}let t2=null;function nSe(t={}){return t2||(t.includeStyleProperties?(t2=t.includeStyleProperties,t2):(t2=cm(window.getComputedStyle(document.documentElement)),t2))}function $j(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function rSe(t,e={}){const n=e.width||function(o){const i=$j(o,"border-left-width"),a=$j(o,"border-right-width");return o.clientWidth+i+a}(t),r=e.height||function(o){const i=$j(o,"border-top-width"),a=$j(o,"border-bottom-width");return o.clientHeight+i+a}(t);return{width:n,height:r}}const fl=16384;function Ij(t){return new Promise((e,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>e(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function eot(t,e,n){const r="http://www.w3.org/2000/svg",o=document.createElementNS(r,"svg"),i=document.createElementNS(r,"foreignObject");return o.setAttribute("width",`${e}`),o.setAttribute("height",`${n}`),o.setAttribute("viewBox",`0 0 ${e} ${n}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),o.appendChild(i),i.appendChild(t),async function(a){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(a)).then(encodeURIComponent).then(s=>`data:image/svg+xml;charset=utf-8,${s}`)}(o)}const Es=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n!==null&&(n.constructor.name===e.name||Es(n,e))};function tot(t,e,n,r){const o=`.${t}:${e}`,i=n.cssText?function(a){const s=a.getPropertyValue("content");return`${a.cssText} content: '${s.replace(/'|"/g,"")}';`}(n):function(a,s){return nSe(s).map(l=>`${l}: ${a.getPropertyValue(l)}${a.getPropertyPriority(l)?" !important":""};`).join(" ")}(n,r);return document.createTextNode(`${o}{${i}}`)}function oSe(t,e,n,r){const o=window.getComputedStyle(t,n),i=o.getPropertyValue("content");if(i===""||i==="none")return;const a=Jrt();try{e.className=`${e.className} ${a}`}catch{return}const s=document.createElement("style");s.appendChild(tot(a,n,o,r)),e.appendChild(s)}const iSe="application/font-woff",aSe="image/jpeg",not={woff:iSe,woff2:iSe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:aSe,jpeg:aSe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Kz(t){const e=function(n){const r=/\.([^./]*?)$/g.exec(n);return r?r[1]:""}(t).toLowerCase();return not[e]||""}function Jz(t){return t.search(/^(data:)/)!==-1}async function sSe(t,e,n){const r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const o=await r.blob();return new Promise((i,a)=>{const s=new FileReader;s.onerror=a,s.onloadend=()=>{try{i(n({res:r,result:s.result}))}catch(l){a(l)}},s.readAsDataURL(o)})}const eV={};async function tV(t,e,n){const r=function(i,a,s){let l=i.replace(/\?.*/,"");return s&&(l=i),/ttf|otf|eot|woff2?/i.test(l)&&(l=l.replace(/.*\//,"")),a?`[${a}]${l}`:l}(t,e,n.includeQueryParams);if(eV[r]!=null)return eV[r];let o;n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());try{const i=await sSe(t,n.fetchRequestInit,({res:a,result:s})=>(e||(e=a.headers.get("Content-Type")||""),function(l){return l.split(/,/)[1]}(s)));o=function(a,s){return`data:${s};base64,${a}`}(i,e)}catch(i){o=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;i&&(a=typeof i=="string"?i:i.message),a&&console.warn(a)}return eV[r]=o,o}async function rot(t,e){return Es(t,HTMLCanvasElement)?async function(n){const r=n.toDataURL();return r==="data:,"?n.cloneNode(!1):Ij(r)}(t):Es(t,HTMLVideoElement)?async function(n,r){if(n.currentSrc){const a=document.createElement("canvas"),s=a.getContext("2d");return a.width=n.clientWidth,a.height=n.clientHeight,s==null||s.drawImage(n,0,0,a.width,a.height),Ij(a.toDataURL())}const o=n.poster,i=Kz(o);return Ij(await tV(o,i,r))}(t,e):Es(t,HTMLIFrameElement)?async function(n,r){var o;try{if(!((o=n==null?void 0:n.contentDocument)===null||o===void 0)&&o.body)return await Qj(n.contentDocument.body,r,!0)}catch{}return n.cloneNode(!1)}(t,e):t.cloneNode(lSe(t))}const oot=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",lSe=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";function iot(t,e,n){return Es(e,Element)&&(function(r,o,i){const a=o.style;if(!a)return;const s=window.getComputedStyle(r);s.cssText?(a.cssText=s.cssText,a.transformOrigin=s.transformOrigin):nSe(i).forEach(l=>{let c=s.getPropertyValue(l);l==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),Es(r,HTMLIFrameElement)&&l==="display"&&c==="inline"&&(c="block"),l==="d"&&o.getAttribute("d")&&(c=`path(${o.getAttribute("d")})`),a.setProperty(l,c,s.getPropertyPriority(l))})}(t,e,n),function(r,o,i){oSe(r,o,":before",i),oSe(r,o,":after",i)}(t,e,n),function(r,o){Es(r,HTMLTextAreaElement)&&(o.innerHTML=r.value),Es(r,HTMLInputElement)&&o.setAttribute("value",r.value)}(t,e),function(r,o){if(Es(r,HTMLSelectElement)){const i=o,a=Array.from(i.children).find(s=>r.value===s.getAttribute("value"));a&&a.setAttribute("selected","")}}(t,e)),e}async function Qj(t,e,n){return n||!e.filter||e.filter(t)?Promise.resolve(t).then(r=>rot(r,e)).then(r=>async function(o,i,a){var s,l;if(lSe(i))return i;let c=[];return c=oot(o)&&o.assignedNodes?cm(o.assignedNodes()):Es(o,HTMLIFrameElement)&&(!((s=o.contentDocument)===null||s===void 0)&&s.body)?cm(o.contentDocument.body.childNodes):cm(((l=o.shadowRoot)!==null&&l!==void 0?l:o).childNodes),c.length===0||Es(o,HTMLVideoElement)||await c.reduce((u,d)=>u.then(()=>Qj(d,a)).then(f=>{f&&i.appendChild(f)}),Promise.resolve()),i}(t,r,e)).then(r=>iot(t,r,e)).then(r=>async function(o,i){const a=o.querySelectorAll?o.querySelectorAll("use"):[];if(a.length===0)return o;const s={};for(let c=0;c<a.length;c++){const u=a[c].getAttribute("xlink:href");if(u){const d=o.querySelector(u),f=document.querySelector(u);d||!f||s[u]||(s[u]=await Qj(f,i,!0))}}const l=Object.values(s);if(l.length){const c="http://www.w3.org/1999/xhtml",u=document.createElementNS(c,"svg");u.setAttribute("xmlns",c),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const d=document.createElementNS(c,"defs");u.appendChild(d);for(let f=0;f<l.length;f++)d.appendChild(l[f]);o.appendChild(u)}return o}(r,e)):null}const cSe=/url\((['"]?)([^'"]+?)\1\)/g,aot=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,sot=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;async function lot(t,e,n,r,o){try{const i=n?function(l,c){if(l.match(/^[a-z]+:\/\//i))return l;if(l.match(/^\/\//))return window.location.protocol+l;if(l.match(/^[a-z]+:/i))return l;const u=document.implementation.createHTMLDocument(),d=u.createElement("base"),f=u.createElement("a");return u.head.appendChild(d),u.body.appendChild(f),c&&(d.href=c),f.href=l,f.href}(e,n):e,a=Kz(e);let s;return o||(s=await tV(i,a,r)),t.replace(function(l){const c=l.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${c})(['"]?\\))`,"g")}(e),`$1${s}$3`)}catch{}return t}function uSe(t){return t.search(cSe)!==-1}async function dSe(t,e,n){if(!uSe(t))return t;const r=function(i,{preferredFontFormat:a}){return a?i.replace(sot,s=>{for(;;){const[l,,c]=aot.exec(s)||[];if(!c)return"";if(c===a)return`src: ${l};`}}):i}(t,n);return function(i){const a=[];return i.replace(cSe,(s,l,c)=>(a.push(c),s)),a.filter(s=>!Jz(s))}(r).reduce((i,a)=>i.then(s=>lot(s,a,e,n)),Promise.resolve(r))}async function fb(t,e,n){var r;const o=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(o){const i=await dSe(o,null,n);return e.style.setProperty(t,i,e.style.getPropertyPriority(t)),!0}return!1}async function fSe(t,e){Es(t,Element)&&(await async function(n,r){await fb("background",n,r)||await fb("background-image",n,r),await fb("mask",n,r)||await fb("-webkit-mask",n,r)||await fb("mask-image",n,r)||await fb("-webkit-mask-image",n,r)}(t,e),await async function(n,r){const o=Es(n,HTMLImageElement);if((!o||Jz(n.src))&&(!Es(n,SVGImageElement)||Jz(n.href.baseVal)))return;const i=o?n.src:n.href.baseVal,a=await tV(i,Kz(i),r);await new Promise((s,l)=>{n.onload=s,n.onerror=r.onImageErrorHandler?(...u)=>{try{s(r.onImageErrorHandler(...u))}catch(d){l(d)}}:l;const c=n;c.decode&&(c.decode=s),c.loading==="lazy"&&(c.loading="eager"),o?(n.srcset="",n.src=a):n.href.baseVal=a})}(t,e),await async function(n,r){const o=cm(n.childNodes).map(i=>fSe(i,r));await Promise.all(o).then(()=>n)}(t,e))}const hSe={};async function pSe(t){let e=hSe[t];if(e!=null)return e;const n=await fetch(t);return e={url:t,cssText:await n.text()},hSe[t]=e,e}async function mSe(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,t.url).href),sSe(a,e.fetchRequestInit,({result:s})=>(n=n.replace(i,`url(${s})`),[i,s]))});return Promise.all(o).then(()=>n)}function gSe(t){if(t==null)return[];const e=[];let n=t.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const a=r.exec(n);if(a===null)break;e.push(a[0])}n=n.replace(r,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let a=o.exec(n);if(a===null){if(a=i.exec(n),a===null)break;o.lastIndex=i.lastIndex}else i.lastIndex=o.lastIndex;e.push(a[0])}return e}async function cot(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=cm(t.ownerDocument.styleSheets),r=await async function(o,i){const a=[],s=[];return o.forEach(l=>{if("cssRules"in l)try{cm(l.cssRules||[]).forEach((c,u)=>{if(c.type===CSSRule.IMPORT_RULE){let d=u+1;const f=pSe(c.href).then(h=>mSe(h,i)).then(h=>gSe(h).forEach(g=>{try{l.insertRule(g,g.startsWith("@import")?d+=1:l.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:g,error:v})}})).catch(h=>{console.error("Error loading remote css",h.toString())});s.push(f)}})}catch(c){const u=o.find(d=>d.href==null)||document.styleSheets[0];l.href!=null&&s.push(pSe(l.href).then(d=>mSe(d,i)).then(d=>gSe(d).forEach(f=>{u.insertRule(f,u.cssRules.length)})).catch(d=>{console.error("Error loading remote stylesheet",d)})),console.error("Error inlining remote css file",c)}}),Promise.all(s).then(()=>(o.forEach(l=>{if("cssRules"in l)try{cm(l.cssRules||[]).forEach(c=>{a.push(c)})}catch(c){console.error(`Error while reading CSS rules from ${l.href}`,c)}}),a))}(n,e);return function(o){return o.filter(i=>i.type===CSSRule.FONT_FACE_RULE).filter(i=>uSe(i.style.getPropertyValue("src")))}(r)}function vSe(t){return t.trim().replace(/["']/g,"")}async function uot(t,e){const n=await cot(t,e),r=function(o){const i=new Set;return function a(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(l=>{i.add(vSe(l))}),Array.from(s.children).forEach(l=>{l instanceof HTMLElement&&a(l)})}(o),i}(t);return(await Promise.all(n.filter(o=>r.has(vSe(o.style.fontFamily))).map(o=>{const i=o.parentStyleSheet?o.parentStyleSheet.href:null;return dSe(o.cssText,i,e)}))).join(`
|
229
|
+
`)}const Mrt="\u200B";var Rke;N_("arrow",TA);class db{constructor(e,n,r,o,i){if(this.data=e,this.fieldTypes=n,this.stats=r,this.binValues=o,this.opts=i,this.columnStats=new Map,this.columnBinValues=new Map,this.dataSpec=void 0,this.sourceName=void 0,typeof this.data=="string")if(this.data.startsWith("./@file")||this.data.startsWith("/@file"))this.dataSpec={url:_A(this.data).href},this.sourceName="source_0";else if((s=this.data).startsWith("data:")&&s.includes(";base64,")){this.sourceName="data_0";const l=function(u){return u.split(",")[1]}(this.data),c=v6(l);c.startsWith("ARROW1")?this.dataSpec={values:(a=c,Uint8Array.from(a,u=>u.charCodeAt(0))),format:{type:"arrow"}}:this.parseCsv(c)}else this.parseCsv(this.data),this.sourceName="data_0";else this.dataSpec={values:this.data},this.sourceName="source_0";var a,s;this.columnBinValues=new Map(Object.entries(o)),this.columnStats=new Map(Object.entries(r))}getColumnStats(e){return this.columnStats.get(e)}getHeaderSummary(e){return{stats:this.columnStats.get(e),type:this.fieldTypes[e],spec:this.opts.includeCharts?this.getVegaSpec(e):void 0}}parseCsv(e){this.dataSpec={values:Pke(e)}}getVegaSpec(e){if(!this.data)return null;const n=this.opts.usePreComputedValues,r=this.columnBinValues.get(e),o=r&&r.length>0,i={data:o&&n?{values:r}:this.dataSpec,background:"transparent",config:{view:{stroke:"transparent"},axis:{domain:!1}},height:100},a=this.fieldTypes[e];e=(e=(e=e.replaceAll(".","\\.")).replaceAll("[","\\[").replaceAll("]","\\]")).replaceAll(":","\\:");const s=this.getScale();switch(a){case"date":case"datetime":case"time":{const l=a==="date"?"%Y-%m-%d":a==="time"?"%H:%M:%S":"%Y-%m-%dT%H:%M:%S";return{...i,layer:[{mark:{type:"bar",color:ih},encoding:{x:{field:e,type:"temporal",axis:null,bin:!0,scale:s},y:{aggregate:"count",type:"quantitative",axis:null},color:{condition:{test:`datum["bin_maxbins_10_${e}_range"] === "null"`,value:Zz},value:ih}}},{mark:{type:"bar",opacity:0},encoding:{x:{field:e,type:"temporal",axis:null,bin:!0,scale:s},y:{aggregate:"max",type:"quantitative",axis:null},tooltip:[{field:`bin_maxbins_10_${e}`,type:"temporal",format:l,bin:{binned:!0},title:`${e} (start)`},{field:`bin_maxbins_10_${e}_end`,type:"temporal",format:l,bin:{binned:!0},title:`${e} (end)`},{aggregate:"count",type:"quantitative",title:"Count",format:",d"}],color:{condition:{test:`datum["bin_maxbins_10_${e}_range"] === "null"`,value:Zz},value:ih}}}]}}case"integer":case"number":{const l=a==="integer"?",d":".2f";if(!n||!o)return function(u,d,f){return{...f,layer:[{mark:{type:"bar",color:ih},encoding:{x:{field:u,type:"quantitative",bin:!0},y:{aggregate:"count",type:"quantitative",axis:null}}},{mark:{type:"bar",opacity:0},encoding:{x:{field:u,type:"quantitative",bin:!0,axis:{title:null,labelFontSize:8.5,labelOpacity:.5,labelExpr:"(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : format(datum.value, '.2~f')"}},y:{aggregate:"max",type:"quantitative",axis:null},tooltip:[{field:u,type:"quantitative",bin:!0,title:u,format:d},{aggregate:"count",type:"quantitative",title:"Count",format:",d"}]}}]}}(e,l,i);const c=this.columnStats.get(e);return{...i,layer:[{mark:{type:"bar",color:ih,stroke:ih,strokeWidth:0},params:[{name:"hover",select:{type:"point",on:"mouseover"}}],encoding:{x:{field:"bin_start",type:"quantitative",bin:{binned:!0,step:2}},x2:{field:"bin_end",axis:null},y:{field:"count",type:"quantitative",axis:null},strokeWidth:{condition:{param:"hover",empty:!1,value:.5},value:0}}},{mark:{type:"bar",opacity:0},encoding:{x:{field:"bin_start",type:"quantitative",bin:{binned:!0,step:2},axis:{title:null,labelFontSize:8.5,labelOpacity:.5,labelExpr:"(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : format(datum.value, '.2~f')",values:[c==null?void 0:c.min,c==null?void 0:c.p25,c==null?void 0:c.median,c==null?void 0:c.p75,c==null?void 0:c.p95,c==null?void 0:c.max].filter(u=>u!==void 0)}},x2:{field:"bin_end"},y:{aggregate:"max",type:"quantitative",axis:null},tooltip:[{field:"bin_range",type:"nominal",title:e},{field:"count",type:"quantitative",title:"Count",format:",d"}]},transform:[{calculate:`format(datum.bin_start, '${l}') + ' - ' + format(datum.bin_end, '${l}')`,as:"bin_range"}]}]}}case"boolean":return{...i,mark:{type:"bar",color:ih},encoding:{y:{field:e,type:"nominal",axis:{labelExpr:"datum.label === 'true' || datum.label === 'True' ? 'True' : 'False'",tickWidth:0,title:null,labelColor:Uz}},x:{aggregate:"count",type:"quantitative",axis:null,scale:{type:"linear"}},tooltip:[{field:e,type:"nominal",title:"Value"},{aggregate:"count",type:"quantitative",title:"Count",format:",d"}]},layer:[{mark:{type:"bar",color:ih,height:20}},{mark:{type:"text",align:"left",baseline:"middle",dx:3,color:Uz},encoding:{text:{aggregate:"count",type:"quantitative"}}}]};case"unknown":case"string":return null;default:return us(a),null}}getScale(){return{align:0,paddingInner:0,paddingOuter:{expr:`length(data('${this.sourceName}')) == 2 ? 1 : length(data('${this.sourceName}')) == 3 ? 0.5 : length(data('${this.sourceName}')) == 4 ? 0 : 0`}}}}Rke=db,db.EMPTY=new Rke([],{},{},{},{includeCharts:!1,usePreComputedValues:!1});const jke=t=>{const e=ue.c(20),{date:n,type:r,children:o}=t;if(!n||Number.isNaN(new Date(n).getTime()))return o;let i,a,s,l,c,u;if(e[0]!==n||e[1]!==r){const g=new Date(n),v=function(b){const p=new Intl.RelativeTimeFormat("en",{numeric:"auto"}),O=(new Date().getTime()-b.getTime())/1e3,k=[[60,1,"second"],[60,60,"minute"],[24,3600,"hour"],[365,86400,"day"],[Number.POSITIVE_INFINITY,31536e3,"year"]];for(const[S,w,T]of k){const P=O/w;if(P<S){const j=-Number(P.toFixed(1));return p.format(j,T)}}return p.format(0,"second")}(g);s="min-w-[240px] p-1 text-sm",e[6]!==v?(l=y.jsx("div",{className:"text-muted-foreground mb-2",children:v}),e[6]=v,e[7]=l):l=e[7],i="space-y-1",a=r==="datetime"?Object.entries(function(b){const p=Intl.DateTimeFormat().resolvedOptions().timeZone;return b.getUTCMilliseconds()!==0?{UTC:new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}).format(b),[p]:new Intl.DateTimeFormat("en-US",{timeZone:p,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}).format(b)}:{UTC:new Intl.DateTimeFormat("en-US",{timeZone:"UTC",dateStyle:"long",timeStyle:"medium"}).format(b),[p]:new Intl.DateTimeFormat("en-US",{timeZone:p,dateStyle:"long",timeStyle:"medium"}).format(b)}}(g)).map(Nrt):y.jsx("span",{children:g.toLocaleDateString("en-US",{timeZone:"UTC",dateStyle:"long"})}),e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=s,e[5]=l}else i=e[2],a=e[3],s=e[4],l=e[5];e[8]!==i||e[9]!==a?(c=y.jsx("div",{className:i,children:a}),e[8]=i,e[9]=a,e[10]=c):c=e[10],e[11]!==s||e[12]!==l||e[13]!==c?(u=y.jsxs("div",{className:s,children:[l,c]}),e[11]=s,e[12]=l,e[13]=c,e[14]=u):u=e[14];const d=u;let f,h;return e[15]!==o?(f=y.jsx("span",{children:o}),e[15]=o,e[16]=f):f=e[16],e[17]!==d||e[18]!==f?(h=y.jsx(qn,{content:d,delayDuration:200,children:f}),e[17]=d,e[18]=f,e[19]=h):h=e[19],h};function Nrt(t){const[e,n]=t;return y.jsxs("div",{className:"grid grid-cols-[fit-content(40px),1fr] gap-4 items-center justify-items-end",children:[y.jsx("span",{className:"bg-muted rounded-md py-1 px-2 w-fit ml-auto",children:e}),y.jsx("span",{children:n})]},e)}const Dke=ge.createContext(db.EMPTY),$rt=ge.lazy(()=>Be(()=>import("./index-7igCaZQI.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107,108,109,110,111,112,113]),import.meta.url).then(t=>({default:t.VegaLite}))),Irt=yke(),Qrt=t=>{const e=ue.c(24),{columnId:n}=t,r=ge.use(Dke),{theme:o}=as();let i;e[0]!==r||e[1]!==n?(i=r.getHeaderSummary(n),e[0]=r,e[1]=n,e[2]=i):i=e[2];const{spec:a,type:s,stats:l}=i;let c=null;if(a){let b;e[3]!==n?(b=y.jsx(Rrt,{seed:n,width:80,height:40}),e[3]=n,e[4]=b):b=e[4];const p=b;let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O={minWidth:"unset",maxHeight:"40px"},e[5]=O):O=e[5];const k=o==="dark"?"dark":"vox";let S,w,T;e[6]!==a||e[7]!==k?(S=y.jsx($rt,{spec:a,width:70,height:30,loader:Irt,style:O,actions:!1,theme:k}),e[6]=a,e[7]=k,e[8]=S):S=e[8],e[9]!==p||e[10]!==S?(w=y.jsx(_.Suspense,{fallback:p,children:S}),e[9]=p,e[10]=S,e[11]=w):w=e[11],e[12]!==p||e[13]!==w?(T=y.jsx($_,{milliseconds:200,visibility:!0,rootMargin:"200px",fallback:p,children:w}),e[12]=p,e[13]=w,e[14]=T):T=e[14],c=T}const u=Lrt;let d;e[15]!==a||e[16]!==l||e[17]!==s?(d=()=>{if(!l)return null;switch(s){case"date":case"datetime":return a?y.jsxs("div",{className:"flex justify-between w-full px-2 whitespace-pre",children:[y.jsx("span",{children:u(l.min,s)}),l.min===l.max?null:y.jsxs("span",{children:["-",u(l.max,s)]})]}):y.jsxs("div",{className:"flex flex-col whitespace-pre",children:[y.jsxs("span",{children:["min: ",u(l.min,s)]}),y.jsxs("span",{children:["max: ",u(l.max,s)]}),y.jsxs("span",{children:["unique: ",th(l.unique)]})]});case"integer":case"number":return a?null:y.jsxs("div",{className:"flex flex-col whitespace-pre",children:[y.jsxs("span",{children:["min:"," ",typeof l.min=="number"?nh(l.min,{shouldRound:!0}):l.min]}),y.jsxs("span",{children:["max:"," ",typeof l.max=="number"?nh(l.max,{shouldRound:!0}):l.max]}),y.jsxs("span",{children:["unique: ",th(l.unique)]})]});case"boolean":return a?null:y.jsxs("div",{className:"flex flex-col whitespace-pre",children:[y.jsxs("span",{children:["true: ",th(l.true)]}),y.jsxs("span",{children:["false: ",th(l.false)]})]});case"time":return null;case"string":return y.jsx("div",{className:"flex flex-col whitespace-pre",children:y.jsxs("span",{children:["unique: ",th(l.unique)]})});case"unknown":return y.jsx("div",{className:"flex flex-col whitespace-pre",children:y.jsxs("span",{children:["nulls: ",th(l.nulls)]})});default:return us(s),null}},e[15]=a,e[16]=l,e[17]=s,e[18]=d):d=e[18];const f=d,h=c;let g,v;return e[19]!==f?(g=f(),e[19]=f,e[20]=g):g=e[20],e[21]!==c||e[22]!==g?(v=y.jsxs("div",{className:"flex flex-col items-center text-xs text-muted-foreground align-end",children:[h,g]}),e[21]=c,e[22]=g,e[23]=v):v=e[23],v};function Lrt(t,e){return y.jsx(jke,{date:t,type:e,children:ZKe(t,e)})}const zrt=t=>{const e=ue.c(6),{value:n}=t;let r;e[0]!==n.data||e[1]!==n.mimetype?(r={channel:"output",data:n.data,mimetype:n.mimetype,timestamp:0},e[0]=n.data,e[1]=n.mimetype,e[2]=r):r=e[2];const o=r;let i,a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=we("flex items-center space-x-2"),e[3]=i):i=e[3],e[4]!==o?(a=y.jsx("div",{className:i,children:y.jsx(ng,{message:o})}),e[4]=o,e[5]=a):a=e[5],a};function Hz(t){return typeof t=="object"&&t!==null&&"mimetype"in t&&"data"in t}const Ake=/(https?:\/\/\S+)/,Vrt=/\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i,Mke=/^data:image\//i,qrt=["avatars.githubusercontent.com"],Frt=t=>{const e=ue.c(14),{url:n}=t,[r,o]=_.useState(!1),[i,a]=_.useState(!1);if(r){let g;return e[0]!==n?(g=y.jsx($ke,{url:n}),e[0]=n,e[1]=g):g=e[1],g}let s,l,c,u,d,f,h;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=()=>a(!0),l=()=>a(!1),e[2]=s,e[3]=l):(s=e[2],l=e[3]),e[4]===Symbol.for("react.memo_cache_sentinel")?(c=()=>o(!0),e[4]=c):c=e[4],e[5]!==n?(u=y.jsx(sy,{asChild:!0,children:y.jsx("div",{className:"flex max-h-[80px] overflow-hidden cursor-pointer",onMouseEnter:s,onMouseLeave:l,children:y.jsx("img",{src:n,alt:"URL preview",className:"object-contain rounded max-h-[80px]",onError:c})})}),e[5]=n,e[6]=u):u=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),e[7]=d):d=e[7],e[8]!==n?(f=y.jsx(tp,{className:"z-50 p-2 bg-popover rounded-md shadow-lg border w-fit",align:"start",side:"right",children:y.jsx("img",{src:n,alt:"URL preview",className:"object-contain max-h-[500px] rounded",onError:d})}),e[8]=n,e[9]=f):f=e[9],e[10]!==i||e[11]!==u||e[12]!==f?(h=y.jsxs(dg,{open:i,onOpenChange:a,children:[u,f]}),e[10]=i,e[11]=u,e[12]=f,e[13]=h):h=e[13],h},Nke=({parts:t})=>t.map((e,n)=>e.type==="url"?y.jsx($ke,{url:e.url},n):e.type==="image"?y.jsx(Frt,{url:e.url},n):e.value),$ke=t=>{const e=ue.c(3),{url:n}=t;let r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ai.stopPropagation(),e[0]=r):r=e[0],e[1]!==n?(o=y.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",onClick:r,className:"text-link hover:underline",children:n}),e[1]=n,e[2]=o):o=e[2],o};function Ike(t){return typeof t=="string"?["string","string"]:typeof t=="number"?["number","number"]:t instanceof Date?["datetime","datetime"]:typeof t=="boolean"?["boolean","boolean"]:["unknown","object"]}function Aj(t){if(t.length===0)return[];if(typeof t[0]!="object")return[];const e={};return function(n,r){if(n.length<=r)return n;const o=[],i=n.length/r;for(let s=0;s<r-1;s++){const l=Math.floor(s*i);o.push(n[l])}const a=n.at(-1);return o.push(a),o}(t,10).forEach(n=>{typeof n=="object"&&n!==null&&Object.entries(n).forEach(([r,o])=>{e[r]||(e[r]=Ike(o)),o!=null&&(e[r]=Ike(o))})}),cr.entries(e)}const JS="__m_column__";function Qke({rowHeaders:t,selection:e,fieldTypes:n,chartSpecModel:r,textJustifyColumns:o,wrappedColumns:i,showDataTypes:a,calculateTopKRows:s}){const l=new Set(t.map(([g])=>g)),c=Vv.keyBy(n,g=>g[0]),u=g=>{var p,O;const v=(p=c.get(g))==null?void 0:p[1],b=l.has(g);if(b||!v){const k=(O=t.find(([S])=>S===g))==null?void 0:O[1];return{rowHeader:b,dtype:k==null?void 0:k[1],dataType:k==null?void 0:k[0]}}return{rowHeader:b,filterType:Brt(v[0]),dtype:v[1],dataType:v[0]}},d=[...l,...n.map(([g])=>g)],f=d.indexOf(IS);f!==-1&&d.splice(f,1);const h=d.map((g,v)=>({id:g||`${JS}${v}`,accessorFn:b=>b[g],header:({column:b})=>{var T;const p=r==null?void 0:r.getColumnStats(g),O=(T=b.columnDef.meta)==null?void 0:T.dtype,k=a&&O?y.jsxs("div",{className:"flex flex-row gap-1",children:[y.jsx("span",{className:"text-xs text-muted-foreground",children:O}),p&&typeof p.nulls=="number"&&p.nulls>0&&y.jsxs("span",{className:"text-xs text-muted-foreground",children:["(nulls: ",p.nulls,")"]})]}):null,S=y.jsxs("div",{className:"flex flex-col",children:[y.jsx("span",{className:"font-bold",children:g===""?" ":g}),k]}),w=y.jsx(ree,{header:S,column:b,calculateTopKRows:s});return l.has(g)?w:y.jsxs("div",{className:"flex flex-col h-full pt-0.5 pb-3 justify-between items-start",children:[w,y.jsx(Qrt,{columnId:g})]})},cell:({column:b,renderValue:p,getValue:O,cell:k})=>{var D;const S=o==null?void 0:o[g],w=i==null?void 0:i.includes(g),T=((D=k==null?void 0:k.getIsSelected)==null?void 0:D.call(k))||!1,P=function(N,E,A,I){return we(A&&"cursor-pointer",I&&"relative before:absolute before:inset-0 before:bg-[var(--blue-3)] before:rounded before:-z-10 before:mx-[-4px] before:my-[-2px]","w-full","text-left","truncate",N==="center"&&"text-center",N==="right"&&"text-right",E&&"whitespace-pre-wrap min-w-[200px] break-words")}(S,w,(e==="single-cell"||e==="multi-cell")&&!T,T),j=qke(b,p,O,function(){var N;e!=="single-cell"&&e!=="multi-cell"||((N=k.toggleSelected)==null||N.call(k))},P);return l.has(g)?y.jsx("b",{children:j}):j},filterFn:void 0,enableSorting:!!g,meta:u(g)}));return e!=="single"&&e!=="multi"||h.unshift({id:"__select__",maxSize:40,header:({table:g})=>e==="multi"?y.jsx(Tl,{"data-testid":"select-all-checkbox",checked:g.getIsAllPageRowsSelected(),onCheckedChange:v=>g.toggleAllPageRowsSelected(!!v),"aria-label":"Select all",className:"mx-1.5 my-4"}):null,cell:({row:g})=>y.jsx(Tl,{"data-testid":"select-row-checkbox",checked:g.getIsSelected(),onCheckedChange:v=>g.toggleSelected(!!v),"aria-label":"Select row",className:"mx-2",onMouseDown:v=>{v.stopPropagation()}}),enableSorting:!1,enableHiding:!1}),h}const Lke=({cellStyles:t,selectCell:e,rawStringValue:n,contentClassName:r,buttonText:o,children:i})=>y.jsx(G3,{container:null,children:y.jsxs(dg,{children:[y.jsx(sy,{className:we(t,"w-fit outline-none"),onClick:e,onMouseDown:a=>{a.stopPropagation()},children:y.jsx("span",{className:"cursor-pointer hover:text-link",title:n,children:n})}),y.jsxs(tp,{className:r,align:"start",alignOffset:10,children:[y.jsx(p9,{className:"absolute top-2 right-2",children:y.jsx(Ft,{variant:"link",size:"xs",children:o??"Close"})}),i]})]})});function Brt(t){if(t!==void 0)switch(t){case"string":return"text";case"number":case"integer":return"number";case"date":return"date";case"datetime":return"datetime";case"time":return"time";case"boolean":return"boolean";default:return}}function zke(t){if(t==null)return"";try{return JSON.stringify(t)}catch{return String(t)}}function Vke(t,e,n){const r=e==="date"?"date":"datetime",o=function(i){var s;if(!i)return;const a=/^datetime(?:64)?\[[^,]+,([^,]+)]$/.exec(i);return(s=a==null?void 0:a[1])==null?void 0:s.trim()}(n);return y.jsx(jke,{date:t,type:r,children:XKe(t,o)})}function qke(t,e,n,r,o){var u,d,f;const i=n(),a=(u=t.getColumnFormatting)==null?void 0:u.call(t),s=(d=t.columnDef.meta)==null?void 0:d.dataType,l=(f=t.columnDef.meta)==null?void 0:f.dtype;if(s==="datetime"&&typeof i=="string")try{return Vke(new Date(i),s,l)}catch(h){Ve.error("Error parsing datetime, fallback to string",h)}if(i instanceof Date)return Vke(i,s,l);if(typeof i=="string"){const h=String(a?t.applyColumnFormatting(i):e()),g=function(v){return Mke.test(v)?[{type:"image",url:v}]:v.split(Ake).filter(b=>b.trim()!=="").map(b=>Ake.test(b)?Vrt.test(b)||Mke.test(b)||qrt.some(p=>b.includes(p))?{type:"image",url:b}:{type:"url",url:b}:{type:"text",value:b})}(h);return g.some(v=>v.type!=="text")||h.length<50?y.jsx("div",{onClick:r,className:o,children:y.jsx(Nke,{parts:g})}):y.jsx(Lke,{cellStyles:o,selectCell:r,rawStringValue:h,contentClassName:"max-h-64 overflow-auto whitespace-pre-wrap break-words text-sm",buttonText:"X",children:y.jsx(Nke,{parts:g})})}if(a)return y.jsx("div",{onClick:r,className:o,children:t.applyColumnFormatting(i)});if(function(h){return h==null||typeof h!="object"}(i)){const h=e();return y.jsx("div",{onClick:r,className:o,children:h==null?"":String(h)})}const c=function(h){if(Hz(h))return[h];if(typeof h=="object"&&h!==null&&("_serialized_mime_bundle"in h||"serialized_mime_bundle"in h)){const g=h,v=g._serialized_mime_bundle||g.serialized_mime_bundle;if(Hz(v))return[v]}if(Array.isArray(h)&&h.every(Hz))return h.map(g=>g)}(i);if(c)return y.jsx("div",{onClick:r,className:o,children:c.map((h,g)=>y.jsx(zrt,{value:h},g))});if(Array.isArray(i)||typeof i=="object"){const h=zke(i);return y.jsx(Lke,{cellStyles:o,selectCell:r,rawStringValue:h,children:y.jsx(_k,{data:i,format:"tree",className:"max-h-64"})})}return y.jsx("div",{onClick:r,className:o,children:zke(i)})}async function Fke(t){return Array.isArray(t)?t:t.startsWith("{")||t.startsWith("[")?bM(t):t=await M_(t,{type:"json"},{handleBigIntAndNumberLike:!0})}function Yz(t){if(t&&typeof t=="object"&&IS in t)return String(t[IS])}function Bke(t){return Yz(t)??t.id}const Wrt={getInitialState:t=>({...t,cellSelection:[]}),getDefaultOptions:t=>({onCellSelectionChange:da("cellSelection",t),enableCellSelection:!1}),createTable:t=>{t.setCellSelection=e=>{var n,r;t.setState(o=>({...o,cellSelection:Zi.asUpdater(e)(o.cellSelection)})),(r=(n=t.options).onCellSelectionChange)==null||r.call(n,e)},t.resetCellSelection=e=>{t.setCellSelection&&t.setCellSelection(()=>e??[])}},createCell:(t,e,n,r)=>{t.getIsSelected=()=>(r.getState().cellSelection??[]).some(o=>o.rowId===Bke(n)&&o.columnName===e.id),t.toggleSelected=o=>{var c;if(!r.setCellSelection)return;const i=e.id,a=((c=t.getIsSelected)==null?void 0:c.call(t))||!1,s=o===void 0?!a:o,l=Bke(n);s&&!a?r.options.enableMultiCellSelection?r.setCellSelection(u=>[{rowId:l,columnName:i},...u]):r.setCellSelection(u=>[{rowId:l,columnName:i}]):a&&!s&&(r.options.enableMultiCellSelection?r.setCellSelection(u=>u.filter(d=>!(d.rowId===l&&d.columnName===i))):r.setCellSelection(u=>[]))}}};let Wke,Uke,Zke,Xke,Hke;Wke={getInitialState:t=>({...t,cellStyling:{}}),createCell:(t,e,n,r)=>{t.getUserStyling=()=>{var a;const o=r.getState().cellStyling,i=function(s){return Yz(s)??s.id}(n);return((a=o==null?void 0:o[i])==null?void 0:a[e.id])||{}}}},Uke={getInitialState:t=>({columnWrapping:{},...t}),getDefaultOptions:t=>({enableColumnWrapping:!0,onColumnWrappingChange:da("columnWrapping",t)}),createColumn:(t,e)=>{t.getColumnWrapping=()=>e.getState().columnWrapping[t.id]||"nowrap",t.getCanWrap=()=>e.options.enableColumnWrapping??!1,t.toggleColumnWrapping=n=>{var r,o;(o=(r=e.options).onColumnWrappingChange)==null||o.call(r,i=>{const a=i[t.id]||"nowrap";return n?{...i,[t.id]:n}:{...i,[t.id]:a==="nowrap"?"wrap":"nowrap"}})}}},Zke={getDefaultOptions:t=>({enableCopyColumn:!0}),createColumn:(t,e)=>{t.getCanCopy=()=>e.options.enableCopyColumn??!1}},Xke=Po("inline-flex items-center border rounded-full px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary hover:bg-primary/60 border-transparent text-primary-foreground",defaultOutline:"bg-[var(--blue-2)] border-[var(--blue-8)] text-[var(--blue-11)]",secondary:"bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground",destructive:"bg-[var(--red-2)] border-[var(--red-6)] text-[var(--red-9)] hover:bg-[var(--red-3)]",success:"bg-[var(--grass-2)] border-[var(--grass-5)] text-[var(--grass-9)] hover:bg-[var(--grass-3)]",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),aM=t=>{const e=ue.c(10);let n,r,o,i,a;return e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==n||e[5]!==o?(i=we(Xke({variant:o}),n),e[4]=n,e[5]=o,e[6]=i):i=e[6],e[7]!==r||e[8]!==i?(a=y.jsx("div",{className:i,...r}),e[7]=r,e[8]=i,e[9]=a):a=e[9],a},Hke=({filters:t,table:e})=>!t||t.length===0?null:y.jsx("div",{className:"flex flex-wrap gap-2 px-1",children:t.map(function(n){const r=function(o){var i,a,s,l;if("type"in o){if(o.operator==="is_null")return"is null";if(o.operator==="is_not_null")return"is not null";if(o.type==="number")return Mj(o.min,o.max);if(o.type==="date")return Mj((i=o.min)==null?void 0:i.toISOString(),(a=o.max)==null?void 0:a.toISOString());if(o.type==="time"){const c=new Intl.DateTimeFormat("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"});return Mj(o.min?c.format(o.min):void 0,o.max?c.format(o.max):void 0)}return o.type==="datetime"?Mj((s=o.min)==null?void 0:s.toISOString(),(l=o.max)==null?void 0:l.toISOString()):o.type==="boolean"?"is "+(o.value?"True":"False"):o.type==="select"?`is in [${o.options.map(u=>dz({value:u})).join(", ")}]`:o.type==="text"?`contains "${o.text}"`:void us(o)}}(n.value);return r?y.jsxs(aM,{variant:"secondary",className:"dark:invert",children:[n.id," ",r," ",y.jsx("span",{className:"cursor-pointer opacity-60 hover:opacity-100 pl-1 py-[2px]",onClick:()=>{e.setColumnFilters(o=>o.filter(i=>i.id!==n.id))},children:y.jsx(Qa,{className:"w-3.5 h-3.5"})})]},n.id):null})});function Mj(t,e){if(t!==void 0||e!==void 0)return t===e?`== ${t}`:t===void 0?`<= ${e}`:e===void 0?`>= ${t}`:`${t} - ${e}`}const Urt={getInitialState:t=>({...t,focusedRowIdx:-1}),getDefaultOptions:t=>({enableFocusRow:!0,onFocusRowChange:da("focusedRowIdx",t)}),createRow:(t,e)=>{t.focusRow=n=>{var r,o;(o=(r=e.options).onFocusRowChange)==null||o.call(r,n)},t.getFocusedRowIdx=()=>e.getState().focusedRowIdx}},Zrt=(t,e)=>t===e;function Yke(t,e=Zrt){const[n,r]=_.useState(t),o=_.useRef(t);return e(o.current,t)||(r(t),o.current=t),[n,r]}function Gke(t){return t&&t.length!==0?t.includes($S)?t:[$S,...t]:[]}const Kke=new WeakMap,Xrt=t=>{let e=Kke.get(t);return e||(e=new WeakSet,Kke.set(t,e)),e},e2=Symbol("scope"),Jke={};function Hrt({atomSet:t=new Set,atomFamilySet:e=new Set,parentStore:n,scopeName:r}){const o=e2 in n?n[e2]:void 0,i=new WeakMap,a=new WeakMap,s=new WeakMap,l={getAtom:u,cleanup(){},prepareWriteAtom(v,b,p,O){if(b.read===Gz&&Nj(b)&&Nj(v)&&b.write!==eSe&&l!==p){const{write:k}=b;return v.write=g(b.write.bind(b),p,O),()=>{v.write=k}}}};for(const v of t)i.set(v,[h(v,l),l]);const c=new Set;for(const v of e){for(const p of v.getParams()){const O=v(p);i.has(O)||i.set(O,[h(O,l),l])}const b=v.unstable_listen(p=>{p.type!=="CREATE"||i.has(p.atom)?t.has(p.atom)||i.delete(p.atom):i.set(p.atom,[h(p.atom,l),l])});c.add(b)}function u(v,b){var p,O;if(i.has(v))return i.get(v);if(b===l)return a.has(v)||a.set(v,[h(v,b),b]),a.get(v);const k=b??Jke;if(o){if((p=s.get(k))==null||!p.has(v)){const[S,w]=o.getAtom(v,b);d(f(S,v,w),v,b,w)}return s.get(k).get(v)}return(O=s.get(k))!=null&&O.has(v)||d(f(v,v),v),s.get(k).get(v)}function d(v,b,p,O){const k=p??Jke;s.has(k)||s.set(k,new WeakMap),s.get(k).set(b,[v,O].filter(Boolean))}function f(v,b,p){return b.read!==Gz?h(b,p):v}function h(v,b){const p=Object.create(Object.getPrototypeOf(v),Object.getOwnPropertyDescriptors(v));return p.originalAtom=v,p.read!==Gz&&(p.read=function(O,k){return function(S,w){return O(function(T){const[P]=u(T,k);return S(P)},w)}}(v.read.bind(v),b)),Nj(p)&&Nj(v)&&p.write!==eSe&&(p.write=g(v.write.bind(v),b)),p}function g(v,b,p=b){return function(O,k,...S){return v(function(w){const[T]=u(w,b);return O(T)},function(w,...T){const[P]=u(w,b),j=l.prepareWriteAtom(P,w,b,p);try{return k(P,...T)}finally{j==null||j()}},...S)}}return l.cleanup=function(...v){return function(){for(const b of v)b()}}(l.cleanup,...Array.from(c)),function(v,b){const p={...v,get(O,...k){const[S]=b.getAtom(O);return v.get(S,...k)},set(O,...k){const[S,w]=b.getAtom(O),T=b.prepareWriteAtom(S,O,w,b);try{return v.set(S,...k)}finally{T==null||T()}},sub(O,...k){const[S]=b.getAtom(O);return v.sub(S,...k)},[e2]:b};return Object.assign(Object.create(Yrt.prototype),p)}(n,l)}function Nj(t){return"write"in t}const{read:Gz,write:eSe}=Ct(null);function Yrt(){}VJ=function({atoms:t=[],atomFamilies:e,children:n,debugName:r}){const o=gy(),i=Array.from(t,h=>Array.isArray(h)?h[0]:h),a=new Set(i),s=new Set(e);function l(){return{scopedStore:Hrt({atomSet:a,atomFamilySet:s,parentStore:o,scopeName:r}),hasChanged:h=>o!==h.parentStore||!tSe(a,h.atomSet)||!tSe(s,h.atomFamilySet)}}const[c,u]=_.useState(l),{hasChanged:d,scopedStore:f}=c;return d({atomSet:a,atomFamilySet:s,parentStore:o})&&(f[e2].cleanup(),u(l)),function(h,g){const v=gy(g),b=Xrt(v);for(const[p,O]of h)(!b.has(p)||g!=null&&g.dangerouslyForceHydrate)&&(b.add(p),v.set(p,O))}(Array.from(t).filter(Array.isArray),{store:f}),_.useEffect(()=>f[e2].cleanup,[f]),_.createElement(Hv,{store:f},n)};function tSe(t,e){return t===e||t.size===e.size&&Array.from(t).every(e.has.bind(e))}const Grt=t=>{const e=ue.c(3),{children:n}=t;let r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=[v0],e[0]=r):r=e[0],e[1]!==n?(o=y.jsx(VJ,{atoms:r,children:n}),e[1]=n,e[2]=o):o=e[2],o},Krt=t=>{const e=ue.c(22),{hidden:n,value:r,handleSearch:o,onHide:i,reloading:a}=t,[s,l]=_.useState(r),c=function(j,D){const[N,E]=_.useState(j);return _.useEffect(()=>{const A=setTimeout(()=>{E(j)},D);return()=>{clearTimeout(A)}},[j,D]),N}(s,500),u=Fn(o),d=ge.useRef(null);let f,h,g,v;e[0]!==c||e[1]!==u?(f=()=>{u(c)},h=[c,u],e[0]=c,e[1]=u,e[2]=f,e[3]=h):(f=e[2],h=e[3]),_.useEffect(f,h),e[4]!==n?(g=()=>{var j;n?l(""):(j=d.current)==null||j.focus()},v=[n],e[4]=n,e[5]=g,e[6]=v):(g=e[5],v=e[6]),_.useEffect(g,v);const b=n&&"h-0 border-none opacity-0";let p,O,k,S,w,T,P;return e[7]!==b?(p=we("flex items-center space-x-2 h-8 px-2 border-b transition-all overflow-hidden duration-300 opacity-100",b),e[7]=b,e[8]=p):p=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(Jm,{className:"w-4 h-4 text-muted-foreground"}),e[9]=O):O=e[9],e[10]!==i?(k=j=>{j.key==="Escape"&&i()},e[10]=i,e[11]=k):k=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(S=j=>l(j.target.value),e[12]=S):S=e[12],e[13]!==s||e[14]!==k?(w=y.jsx("input",{type:"text",ref:d,className:"w-full h-full border-none bg-transparent focus:outline-none text-sm",value:s,onKeyDown:k,onChange:S,placeholder:"Search"}),e[13]=s,e[14]=k,e[15]=w):w=e[15],e[16]!==a?(T=a&&y.jsx(Ym,{size:"small"}),e[16]=a,e[17]=T):T=e[17],e[18]!==w||e[19]!==T||e[20]!==p?(P=y.jsxs("div",{className:p,children:[O,w,T]}),e[18]=w,e[19]=T,e[20]=p,e[21]=P):P=e[21],P},Jrt=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)})();function cm(t){const e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n]);return e}let t2=null;function nSe(t={}){return t2||(t.includeStyleProperties?(t2=t.includeStyleProperties,t2):(t2=cm(window.getComputedStyle(document.documentElement)),t2))}function $j(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function rSe(t,e={}){const n=e.width||function(o){const i=$j(o,"border-left-width"),a=$j(o,"border-right-width");return o.clientWidth+i+a}(t),r=e.height||function(o){const i=$j(o,"border-top-width"),a=$j(o,"border-bottom-width");return o.clientHeight+i+a}(t);return{width:n,height:r}}const fl=16384;function Ij(t){return new Promise((e,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>e(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function eot(t,e,n){const r="http://www.w3.org/2000/svg",o=document.createElementNS(r,"svg"),i=document.createElementNS(r,"foreignObject");return o.setAttribute("width",`${e}`),o.setAttribute("height",`${n}`),o.setAttribute("viewBox",`0 0 ${e} ${n}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),o.appendChild(i),i.appendChild(t),async function(a){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(a)).then(encodeURIComponent).then(s=>`data:image/svg+xml;charset=utf-8,${s}`)}(o)}const Es=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n!==null&&(n.constructor.name===e.name||Es(n,e))};function tot(t,e,n,r){const o=`.${t}:${e}`,i=n.cssText?function(a){const s=a.getPropertyValue("content");return`${a.cssText} content: '${s.replace(/'|"/g,"")}';`}(n):function(a,s){return nSe(s).map(l=>`${l}: ${a.getPropertyValue(l)}${a.getPropertyPriority(l)?" !important":""};`).join(" ")}(n,r);return document.createTextNode(`${o}{${i}}`)}function oSe(t,e,n,r){const o=window.getComputedStyle(t,n),i=o.getPropertyValue("content");if(i===""||i==="none")return;const a=Jrt();try{e.className=`${e.className} ${a}`}catch{return}const s=document.createElement("style");s.appendChild(tot(a,n,o,r)),e.appendChild(s)}const iSe="application/font-woff",aSe="image/jpeg",not={woff:iSe,woff2:iSe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:aSe,jpeg:aSe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Kz(t){const e=function(n){const r=/\.([^./]*?)$/g.exec(n);return r?r[1]:""}(t).toLowerCase();return not[e]||""}function Jz(t){return t.search(/^(data:)/)!==-1}async function sSe(t,e,n){const r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const o=await r.blob();return new Promise((i,a)=>{const s=new FileReader;s.onerror=a,s.onloadend=()=>{try{i(n({res:r,result:s.result}))}catch(l){a(l)}},s.readAsDataURL(o)})}const eV={};async function tV(t,e,n){const r=function(i,a,s){let l=i.replace(/\?.*/,"");return s&&(l=i),/ttf|otf|eot|woff2?/i.test(l)&&(l=l.replace(/.*\//,"")),a?`[${a}]${l}`:l}(t,e,n.includeQueryParams);if(eV[r]!=null)return eV[r];let o;n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());try{const i=await sSe(t,n.fetchRequestInit,({res:a,result:s})=>(e||(e=a.headers.get("Content-Type")||""),function(l){return l.split(/,/)[1]}(s)));o=function(a,s){return`data:${s};base64,${a}`}(i,e)}catch(i){o=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;i&&(a=typeof i=="string"?i:i.message),a&&console.warn(a)}return eV[r]=o,o}async function rot(t,e){return Es(t,HTMLCanvasElement)?async function(n){const r=n.toDataURL();return r==="data:,"?n.cloneNode(!1):Ij(r)}(t):Es(t,HTMLVideoElement)?async function(n,r){if(n.currentSrc){const a=document.createElement("canvas"),s=a.getContext("2d");return a.width=n.clientWidth,a.height=n.clientHeight,s==null||s.drawImage(n,0,0,a.width,a.height),Ij(a.toDataURL())}const o=n.poster,i=Kz(o);return Ij(await tV(o,i,r))}(t,e):Es(t,HTMLIFrameElement)?async function(n,r){var o;try{if(!((o=n==null?void 0:n.contentDocument)===null||o===void 0)&&o.body)return await Qj(n.contentDocument.body,r,!0)}catch{}return n.cloneNode(!1)}(t,e):t.cloneNode(lSe(t))}const oot=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",lSe=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";function iot(t,e,n){return Es(e,Element)&&(function(r,o,i){const a=o.style;if(!a)return;const s=window.getComputedStyle(r);s.cssText?(a.cssText=s.cssText,a.transformOrigin=s.transformOrigin):nSe(i).forEach(l=>{let c=s.getPropertyValue(l);l==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),Es(r,HTMLIFrameElement)&&l==="display"&&c==="inline"&&(c="block"),l==="d"&&o.getAttribute("d")&&(c=`path(${o.getAttribute("d")})`),a.setProperty(l,c,s.getPropertyPriority(l))})}(t,e,n),function(r,o,i){oSe(r,o,":before",i),oSe(r,o,":after",i)}(t,e,n),function(r,o){Es(r,HTMLTextAreaElement)&&(o.innerHTML=r.value),Es(r,HTMLInputElement)&&o.setAttribute("value",r.value)}(t,e),function(r,o){if(Es(r,HTMLSelectElement)){const i=o,a=Array.from(i.children).find(s=>r.value===s.getAttribute("value"));a&&a.setAttribute("selected","")}}(t,e)),e}async function Qj(t,e,n){return n||!e.filter||e.filter(t)?Promise.resolve(t).then(r=>rot(r,e)).then(r=>async function(o,i,a){var s,l;if(lSe(i))return i;let c=[];return c=oot(o)&&o.assignedNodes?cm(o.assignedNodes()):Es(o,HTMLIFrameElement)&&(!((s=o.contentDocument)===null||s===void 0)&&s.body)?cm(o.contentDocument.body.childNodes):cm(((l=o.shadowRoot)!==null&&l!==void 0?l:o).childNodes),c.length===0||Es(o,HTMLVideoElement)||await c.reduce((u,d)=>u.then(()=>Qj(d,a)).then(f=>{f&&i.appendChild(f)}),Promise.resolve()),i}(t,r,e)).then(r=>iot(t,r,e)).then(r=>async function(o,i){const a=o.querySelectorAll?o.querySelectorAll("use"):[];if(a.length===0)return o;const s={};for(let c=0;c<a.length;c++){const u=a[c].getAttribute("xlink:href");if(u){const d=o.querySelector(u),f=document.querySelector(u);d||!f||s[u]||(s[u]=await Qj(f,i,!0))}}const l=Object.values(s);if(l.length){const c="http://www.w3.org/1999/xhtml",u=document.createElementNS(c,"svg");u.setAttribute("xmlns",c),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const d=document.createElementNS(c,"defs");u.appendChild(d);for(let f=0;f<l.length;f++)d.appendChild(l[f]);o.appendChild(u)}return o}(r,e)):null}const cSe=/url\((['"]?)([^'"]+?)\1\)/g,aot=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,sot=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;async function lot(t,e,n,r,o){try{const i=n?function(l,c){if(l.match(/^[a-z]+:\/\//i))return l;if(l.match(/^\/\//))return window.location.protocol+l;if(l.match(/^[a-z]+:/i))return l;const u=document.implementation.createHTMLDocument(),d=u.createElement("base"),f=u.createElement("a");return u.head.appendChild(d),u.body.appendChild(f),c&&(d.href=c),f.href=l,f.href}(e,n):e,a=Kz(e);let s;return o||(s=await tV(i,a,r)),t.replace(function(l){const c=l.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${c})(['"]?\\))`,"g")}(e),`$1${s}$3`)}catch{}return t}function uSe(t){return t.search(cSe)!==-1}async function dSe(t,e,n){if(!uSe(t))return t;const r=function(i,{preferredFontFormat:a}){return a?i.replace(sot,s=>{for(;;){const[l,,c]=aot.exec(s)||[];if(!c)return"";if(c===a)return`src: ${l};`}}):i}(t,n);return function(i){const a=[];return i.replace(cSe,(s,l,c)=>(a.push(c),s)),a.filter(s=>!Jz(s))}(r).reduce((i,a)=>i.then(s=>lot(s,a,e,n)),Promise.resolve(r))}async function fb(t,e,n){var r;const o=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(o){const i=await dSe(o,null,n);return e.style.setProperty(t,i,e.style.getPropertyPriority(t)),!0}return!1}async function fSe(t,e){Es(t,Element)&&(await async function(n,r){await fb("background",n,r)||await fb("background-image",n,r),await fb("mask",n,r)||await fb("-webkit-mask",n,r)||await fb("mask-image",n,r)||await fb("-webkit-mask-image",n,r)}(t,e),await async function(n,r){const o=Es(n,HTMLImageElement);if((!o||Jz(n.src))&&(!Es(n,SVGImageElement)||Jz(n.href.baseVal)))return;const i=o?n.src:n.href.baseVal,a=await tV(i,Kz(i),r);await new Promise((s,l)=>{n.onload=s,n.onerror=r.onImageErrorHandler?(...u)=>{try{s(r.onImageErrorHandler(...u))}catch(d){l(d)}}:l;const c=n;c.decode&&(c.decode=s),c.loading==="lazy"&&(c.loading="eager"),o?(n.srcset="",n.src=a):n.href.baseVal=a})}(t,e),await async function(n,r){const o=cm(n.childNodes).map(i=>fSe(i,r));await Promise.all(o).then(()=>n)}(t,e))}const hSe={};async function pSe(t){let e=hSe[t];if(e!=null)return e;const n=await fetch(t);return e={url:t,cssText:await n.text()},hSe[t]=e,e}async function mSe(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,t.url).href),sSe(a,e.fetchRequestInit,({result:s})=>(n=n.replace(i,`url(${s})`),[i,s]))});return Promise.all(o).then(()=>n)}function gSe(t){if(t==null)return[];const e=[];let n=t.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const a=r.exec(n);if(a===null)break;e.push(a[0])}n=n.replace(r,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let a=o.exec(n);if(a===null){if(a=i.exec(n),a===null)break;o.lastIndex=i.lastIndex}else i.lastIndex=o.lastIndex;e.push(a[0])}return e}async function cot(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=cm(t.ownerDocument.styleSheets),r=await async function(o,i){const a=[],s=[];return o.forEach(l=>{if("cssRules"in l)try{cm(l.cssRules||[]).forEach((c,u)=>{if(c.type===CSSRule.IMPORT_RULE){let d=u+1;const f=pSe(c.href).then(h=>mSe(h,i)).then(h=>gSe(h).forEach(g=>{try{l.insertRule(g,g.startsWith("@import")?d+=1:l.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:g,error:v})}})).catch(h=>{console.error("Error loading remote css",h.toString())});s.push(f)}})}catch(c){const u=o.find(d=>d.href==null)||document.styleSheets[0];l.href!=null&&s.push(pSe(l.href).then(d=>mSe(d,i)).then(d=>gSe(d).forEach(f=>{u.insertRule(f,u.cssRules.length)})).catch(d=>{console.error("Error loading remote stylesheet",d)})),console.error("Error inlining remote css file",c)}}),Promise.all(s).then(()=>(o.forEach(l=>{if("cssRules"in l)try{cm(l.cssRules||[]).forEach(c=>{a.push(c)})}catch(c){console.error(`Error while reading CSS rules from ${l.href}`,c)}}),a))}(n,e);return function(o){return o.filter(i=>i.type===CSSRule.FONT_FACE_RULE).filter(i=>uSe(i.style.getPropertyValue("src")))}(r)}function vSe(t){return t.trim().replace(/["']/g,"")}async function uot(t,e){const n=await cot(t,e),r=function(o){const i=new Set;return function a(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(l=>{i.add(vSe(l))}),Array.from(s.children).forEach(l=>{l instanceof HTMLElement&&a(l)})}(o),i}(t);return(await Promise.all(n.filter(o=>r.has(vSe(o.style.fontFamily))).map(o=>{const i=o.parentStyleSheet?o.parentStyleSheet.href:null;return dSe(o.cssText,i,e)}))).join(`
|
230
230
|
`)}async function dot(t,e={}){const{width:n,height:r}=rSe(t,e),o=await Qj(t,e,!0);return await async function(i,a){const s=a.fontEmbedCSS!=null?a.fontEmbedCSS:a.skipFonts?null:await uot(i,a);if(s){const l=document.createElement("style"),c=document.createTextNode(s);l.appendChild(c),i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l)}}(o,e),await fSe(o,e),function(i,a){const{style:s}=i;a.backgroundColor&&(s.backgroundColor=a.backgroundColor),a.width&&(s.width=`${a.width}px`),a.height&&(s.height=`${a.height}px`);const l=a.style;l!=null&&Object.keys(l).forEach(c=>{s[c]=l[c]})}(o,e),await eot(o,n,r)}async function fot(t,e={}){const{width:n,height:r}=rSe(t,e),o=await dot(t,e),i=await Ij(o),a=document.createElement("canvas"),s=a.getContext("2d"),l=e.pixelRatio||function(){let d,f;try{f=process}catch{}const h=f&&f.env?f.env.devicePixelRatio:null;return h&&(d=parseInt(h,10),Number.isNaN(d)&&(d=1)),d||window.devicePixelRatio||1}(),c=e.canvasWidth||n,u=e.canvasHeight||r;return a.width=c*l,a.height=u*l,e.skipAutoScale||function(d){(d.width>fl||d.height>fl)&&(d.width>fl&&d.height>fl?d.width>d.height?(d.height*=fl/d.width,d.width=fl):(d.width*=fl/d.height,d.height=fl):d.width>fl?(d.height*=fl/d.width,d.width=fl):(d.width*=fl/d.height,d.height=fl))}(a),a.style.width=`${c}`,a.style.height=`${u}`,e.backgroundColor&&(s.fillStyle=e.backgroundColor,s.fillRect(0,0,a.width,a.height)),s.drawImage(i,0,0,a.width,a.height),a}ig={toMarkdown:t=>ig.replace(t,"md"),toHTML:t=>ig.replace(t,"html"),toPNG:t=>ig.replace(t,"png"),toPY:t=>ig.replace(t,"py"),withoutExtension:t=>{const e=t.split(".");return e.length===1?t:e.slice(0,-1).join(".")},replace:(t,e)=>t.endsWith(`.${e}`)?t:`${ig.withoutExtension(t)}.${e}`},gQe=async function(t,e){const n=document.getElementById("App"),r=(n==null?void 0:n.scrollTop)??0;document.body.classList.add("printing");try{const o=await async function(i,a={}){return(await fot(i,a)).toDataURL()}(t);ZO(o,ig.toPNG(e))}catch{Kr({title:"Error",description:"Failed to download as PNG.",variant:"danger"})}finally{document.body.classList.remove("printing"),requestAnimationFrame(()=>{n==null||n.scrollTo(0,r)})}},ZO=function(t,e){const n=document.createElement("a");n.href=t,n.download=e,n.click(),n.remove()},AIe=function(t,e){const n=URL.createObjectURL(t);ZO(n,e),URL.revokeObjectURL(n)};const hot=[{label:"CSV",format:"csv",icon:ck},{label:"JSON",format:"json",icon:WO},{label:"Parquet",format:"parquet",icon:pce}],pot=[{label:"TSV",format:"tsv",description:"Best for Excel and Google Sheets",icon:ck},{label:"JSON",format:"json",description:"Raw JSON data",icon:WO},{label:"CSV",format:"csv",description:"Comma-separated values",icon:ck}],mot=t=>{const e=ue.c(17);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsxs(Ft,{"data-testid":"download-as-button",size:"xs",variant:"link",children:["Download ",y.jsx(xu,{className:"w-3 h-3 ml-1"})]}),e[0]=n):n=e[0];const r=n;let o;e[1]!==t?(o=v=>t.downloadAs({format:v}).catch(got),e[1]=t,e[2]=o):o=e[2];const i=o;let a;e[3]!==i?(a=async v=>{let b;e:switch(v){case"tsv":{const O=await i("json");b=function(k){if(k.length===0)return"";const S=Object.keys(k[0]),w=k.map(T=>S.map(P=>T[P]).join(" "));return`${S.join(" ")}
|
231
231
|
${w.join(`
|
232
232
|
`)}`}(await ySe(O));break e}case"json":{const O=await i("json"),k=await ySe(O);b=JSON.stringify(k,null,2);break e}case"csv":{b=await(p=await i("csv"),fetch(p).then(k=>{if(!k.ok)throw new Error(k.statusText);return k.text()}));break e}default:return void us(v)}var p;await Kd(b),Kr({title:"Copied to clipboard"})},e[3]=i,e[4]=a):a=e[4];const s=a;let l,c,u,d,f,h,g;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(Gm,{asChild:!0,children:r}),e[5]=l):l=e[5],e[6]!==i?(c=hot.map(v=>y.jsxs($r,{onSelect:async()=>{ZO(await i(v.format),`download.${v.format}`)},children:[y.jsx(v.icon,{className:"mo-dropdown-icon"}),v.label]},v.label)),e[6]=i,e[7]=c):c=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(cf,{}),e[8]=u):u=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsxs(bO,{children:[y.jsx(wce,{className:"mo-dropdown-icon"}),"Copy to clipboard"]}),e[9]=d):d=e[9],e[10]!==s?(f=pot.map(v=>y.jsxs($r,{onSelect:()=>s(v.format),children:[y.jsx(v.icon,{className:"mo-dropdown-icon"}),y.jsxs("div",{className:"flex flex-col",children:[y.jsx("span",{children:v.label}),y.jsx("span",{className:"text-xs text-muted-foreground",children:v.description})]})]},v.label)),e[10]=s,e[11]=f):f=e[11],e[12]!==f?(h=y.jsxs(hg,{children:[d,y.jsx(pg,{children:f})]}),e[12]=f,e[13]=h):h=e[13],e[14]!==c||e[15]!==h?(g=y.jsxs(Hm,{modal:!1,children:[l,y.jsxs(zh,{side:"bottom",className:"no-print",children:[c,u,h]})]}),e[14]=c,e[15]=h,e[16]=g):g=e[16],g};function ySe(t){return fetch(t).then(e=>{if(!e.ok)throw new Error(e.statusText);return e.json()})}function got(t){throw Kr({title:"Failed to download",description:"message"in t?t.message:String(t)}),t}class nV{constructor(e,n){this.singular=e,this._plural=n}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}}class n2{constructor(e){this.words=e}static of(...e){return new n2(e.map(n=>typeof n=="string"?new nV(n):n))}join(e,n){return this.words.map(r=>r.pluralize(n)).join(e)}}const vot=({table:t,selection:e,onSelectAllRowsChange:n,totalColumns:r,tableLoading:o,showPageSizeSelector:i})=>{const a=Math.min(t.getState().pagination.pageIndex+1,t.getPageCount()),s=t.getPageCount(),l=t.getState().pagination.pageSize,c=d=>{o||d()},u=[...new Set([5,10,25,50,100,l])].sort((d,f)=>d-f);return y.jsxs("div",{className:"flex flex-1 items-center justify-between px-2",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:"text-sm text-muted-foreground",children:(()=>{const{rowSelection:d,cellSelection:f}=t.getState();let h=Object.keys(d).length,g=t.getIsAllPageRowsSelected();const v=t.getRowCount();let b=h===v;const p=e==="single-cell"||e==="multi-cell";if(p&&(h=f.length,g=!1,b=!1),g&&!b)return y.jsxs(y.Fragment,{children:[y.jsxs("span",{children:[hb(h)," selected"]}),y.jsxs(Ft,{size:"xs","data-testid":"select-all-button",variant:"link",className:"h-4",onMouseDown:ai.preventFocus,onClick:()=>{n?n(!0):t.toggleAllRowsSelected(!0)},children:["Select all ",hb(v)]})]});if(h)return y.jsxs(y.Fragment,{children:[y.jsxs("span",{children:[hb(h)," selected"]}),y.jsx(Ft,{size:"xs","data-testid":"clear-selection-button",variant:"link",className:"h-4",onMouseDown:ai.preventFocus,onClick:()=>{p?t.resetCellSelection&&t.resetCellSelection():n?n(!1):t.toggleAllRowsSelected(!1)},children:"Clear selection"})]});const O=rV(v,r);return y.jsx("span",{children:O})})()}),i&&y.jsxs("div",{className:"flex items-center gap-1 text-xs whitespace-nowrap mr-1",children:[y.jsxs(Zs,{value:l.toString(),onValueChange:d=>t.setPageSize(Number(d)),children:[y.jsx(Ws,{className:"w-11 h-[18px] !shadow-none !hover:shadow-none !ring-0 border-border text-xs p-1",children:y.jsx(Us,{})}),y.jsx(cs,{children:y.jsxs(Cu,{children:[y.jsx(sO,{children:"Rows per page"}),[...u].map(d=>{const f=d.toString();return y.jsx(Qo,{value:f,children:f},d)})]})})]}),y.jsx("span",{children:"/ page"})]})]}),y.jsxs("div",{className:"flex items-end space-x-2",children:[y.jsxs(Ft,{size:"xs",variant:"outline","data-testid":"first-page-button",className:"hidden h-6 w-6 p-0 lg:flex",onClick:()=>c(()=>t.setPageIndex(0)),onMouseDown:ai.preventFocus,disabled:!t.getCanPreviousPage(),children:[y.jsx("span",{className:"sr-only",children:"Go to first page"}),y.jsx(C6,{className:"h-4 w-4"})]}),y.jsxs(Ft,{size:"xs",variant:"outline","data-testid":"previous-page-button",className:"h-6 w-6 p-0",onClick:()=>c(()=>t.previousPage()),onMouseDown:ai.preventFocus,disabled:!t.getCanPreviousPage(),children:[y.jsx("span",{className:"sr-only",children:"Go to previous page"}),y.jsx(ty,{className:"h-4 w-4"})]}),y.jsxs("div",{className:"flex items-center justify-center text-xs font-medium gap-1",children:[y.jsx("span",{children:"Page"}),y.jsx(yot,{currentPage:a,totalPages:s,onPageChange:d=>c(()=>t.setPageIndex(d))}),y.jsxs("span",{className:"flex-shrink-0",children:["of ",hb(s)]})]}),y.jsxs(Ft,{size:"xs",variant:"outline","data-testid":"next-page-button",className:"h-6 w-6 p-0",onClick:()=>c(()=>t.nextPage()),onMouseDown:ai.preventFocus,disabled:!t.getCanNextPage(),children:[y.jsx("span",{className:"sr-only",children:"Go to next page"}),y.jsx(Qh,{className:"h-4 w-4"})]}),y.jsxs(Ft,{size:"xs",variant:"outline","data-testid":"last-page-button",className:"hidden h-6 w-6 p-0 lg:flex",onClick:()=>c(()=>t.setPageIndex(t.getPageCount()-1)),onMouseDown:ai.preventFocus,disabled:!t.getCanNextPage(),children:[y.jsx("span",{className:"sr-only",children:"Go to last page"}),y.jsx(_6,{className:"h-4 w-4"})]})]})]})};function hb(t){return new Intl.NumberFormat().format(t)}const yot=({currentPage:t,totalPages:e,onPageChange:n})=>{const r=i=>y.jsx("option",{value:i+1,children:i+1},i),o=i=>y.jsx("option",{disabled:!0,value:`__${i}__`,children:"..."},`__${i}__`);return y.jsx("select",{className:"cursor-pointer border rounded",value:t,"data-testid":"page-select",onChange:i=>n(Number(i.target.value)-1),children:(()=>{if(e<=100)return iO(e).map(u=>r(u));const i=Math.floor(e/2),a=iO(10).map(u=>r(u)),s=iO(10).map(u=>r(i-5+u)),l=iO(10).map(u=>r(e-10+u)),c=[...a,o(1),...s,o(2),...l];return t>10&&t<=i-5&&c.splice(10,1,o(1),r(t-1),o(11)),t>i+5&&t<=e-10&&c.splice(-11,1,o(2),r(t-1),o(22)),c})()})};function bSe(t){return`${hb(t)} ${new nV("row").pluralize(t)}`}let rV,xSe,oV;rV=(t,e)=>[t==="too_many"?"Unknown":bSe(t),`${hb(e)} ${new nV("column").pluralize(e)}`].join(", "),xSe=({enableSearch:t,onSearchQueryChange:e,isSearchEnabled:n,setIsSearchEnabled:r,pagination:o,totalColumns:i,selection:a,onRowSelectionChange:s,table:l,downloadAs:c,getRowIds:u,toggleDisplayHeader:d,showChartBuilder:f,showColumnExplorer:h,showPageSizeSelector:g,togglePanel:v,isPanelOpen:b,tableLoading:p})=>y.jsxs("div",{className:"flex items-center flex-shrink-0 pt-1",children:[e&&t&&y.jsx(qn,{content:"Search",children:y.jsx(Ft,{variant:"text",size:"xs",className:"mb-0",onClick:()=>r(!n),children:y.jsx(Jm,{className:"w-4 h-4 text-muted-foreground"})})}),f&&y.jsx(qn,{content:"Chart builder",children:y.jsx(Ft,{variant:"text",size:"xs",className:"mb-0",onClick:d,children:y.jsx(Oce,{className:"w-4 h-4 text-muted-foreground"})})}),v&&b!==void 0&&y.jsxs(y.Fragment,{children:[y.jsx(qn,{content:"Toggle row viewer",children:y.jsx(Ft,{variant:"text",size:"xs",onClick:()=>v("row-viewer"),children:y.jsx(zce,{className:we("w-4 h-4 text-muted-foreground",b("row-viewer")&&"text-primary")})})}),h&&y.jsx(qn,{content:"Toggle column explorer",children:y.jsx(Ft,{variant:"text",size:"xs",onClick:()=>v("column-explorer"),children:y.jsx(vce,{className:we("w-4 h-4 text-muted-foreground",b("column-explorer")&&"text-primary")})})})]}),o&&y.jsx(vot,{totalColumns:i,selection:a,onSelectAllRowsChange:O=>{if(!s)return;if(!O)return void s({});const k=()=>{const S=Array.from({length:l.getRowCount()},(w,T)=>[T,!0]);s(Object.fromEntries(S))};u?u({}).then(S=>{S.error?Kr({title:"Not available",description:S.error,variant:"danger"}):S.all_rows?k():s(Object.fromEntries(S.row_ids.map(w=>[w,!0])))}):k()},table:l,tableLoading:p,showPageSizeSelector:g}),y.jsx("div",{className:"ml-auto",children:c&&y.jsx(mot,{downloadAs:c})})]}),oV=_.memo(({wrapperClassName:t,className:e,columns:n,data:r,selection:o,totalColumns:i,totalRows:a,manualSorting:s=!1,sorting:l,setSorting:c,rowSelection:u,cellSelection:d,cellStyling:f,paginationState:h,setPaginationState:g,downloadAs:v,manualPagination:b=!1,pagination:p=!1,onRowSelectionChange:O,onCellSelectionChange:k,getRowIds:S,enableSearch:w=!1,searchQuery:T,onSearchQueryChange:P,showFilters:j=!1,filters:D,onFiltersChange:N,reloading:E,freezeColumnsLeft:A,freezeColumnsRight:I,toggleDisplayHeader:L,showChartBuilder:F,showPageSizeSelector:Q,showColumnExplorer:W,togglePanel:U,isPanelOpen:X,viewedRowIdx:G,onViewedRowChange:ae})=>{const[ne,re]=ge.useState(!1),[Z,K]=ge.useState(!1),{columnPinning:oe,setColumnPinning:ie}=function(ce,ve){const[ye,_e]=Yke({left:Gke(ce),right:ve},mf);return{columnPinning:ye,setColumnPinning:Se=>{_e(Ae=>{const je=typeof Se=="function"?Se(Ae):Se;return{left:Gke(je.left),right:je.right}})}}}(A,I);function Y(ce,ve){return h?ve+(b?h.pageIndex*h.pageSize:0):ve}ge.useEffect(()=>{let ce;return E?ce=setTimeout(()=>{K(!0)},300):K(!1),()=>{ce&&clearTimeout(ce)}},[E]);const le=JJ({_features:[wOe,Uke,fet,Wrt,Wke,Zke,Urt],data:r,columns:n,getCoreRowModel:nee(),rowCount:a==="too_many"?void 0:a,...g?{onPaginationChange:g,getRowId:(ce,ve)=>{const ye=Yz(ce);if(ye)return ye;const _e=Y(0,ve);return String(_e)}}:{},manualPagination:b,getPaginationRowModel:ce=>pn(()=>[ce.getState().pagination,ce.getPrePaginationRowModel(),ce.options.paginateExpandedRows?void 0:ce.getState().expanded],(ve,ye)=>{if(!ye.rows.length)return ye;const{pageSize:_e,pageIndex:Se}=ve;let{rows:Ae,flatRows:je,rowsById:Ie}=ye;const De=_e*Se,nt=De+_e;let Fe;Ae=Ae.slice(De,nt),Fe=ce.options.paginateExpandedRows?{rows:Ae,flatRows:je,rowsById:Ie}:function(Re){const ot=[],Me=We=>{var it;ot.push(We),(it=We.subRows)!=null&&it.length&&We.getIsExpanded()&&We.subRows.forEach(Me)};return Re.rows.forEach(Me),{rows:ot,flatRows:Re.flatRows,rowsById:Re.rowsById}}({rows:Ae,flatRows:je,rowsById:Ie}),Fe.flatRows=[];const kt=Re=>{Fe.flatRows.push(Re),Re.subRows.length&&Re.subRows.forEach(kt)};return Fe.rows.forEach(kt),Fe},mn(ce.options,"debugTable")),...c?{onSortingChange:c}:{},manualSorting:s,getSortedRowModel:eee(),manualFiltering:!0,enableColumnFilters:j,getFilteredRowModel:tee(),onColumnFiltersChange:N,onRowSelectionChange:O,onCellSelectionChange:k,enableCellSelection:o==="single-cell"||o==="multi-cell",enableMultiCellSelection:o==="multi-cell",onColumnPinningChange:ie,enableFocusRow:!0,onFocusRowChange:ae,state:{...l?{sorting:l}:{},columnFilters:D,...h?{pagination:h}:p&&!h?{}:{pagination:{pageIndex:0,pageSize:r.length}},rowSelection:u,cellSelection:d,cellStyling:f,columnPinning:oe}}),me=(X==null?void 0:X("row-viewer"))??!1;return y.jsxs("div",{className:we(t,"flex flex-col space-y-1"),children:[y.jsx(Hke,{filters:D,table:le}),y.jsxs("div",{className:we(e||"rounded-md border overflow-hidden"),children:[P&&w&&y.jsx(Krt,{value:T||"",onHide:()=>re(!1),handleSearch:P,hidden:!ne,reloading:E}),y.jsxs(iy,{className:"relative",children:[Z&&y.jsx("div",{className:"absolute top-0 left-0 h-[3px] w-1/2 bg-primary animate-slide"}),Qet(le),y.jsx(Grt,{children:y.jsx(Let,{table:le,columns:n,rowViewerPanelOpen:me,getRowIndex:Y,viewedRowIdx:G})})]})]}),y.jsx(xSe,{enableSearch:w,totalColumns:i,onSearchQueryChange:P,isSearchEnabled:ne,setIsSearchEnabled:re,pagination:p,selection:o,onRowSelectionChange:O,table:le,downloadAs:v,getRowIds:S,toggleDisplayHeader:L,showChartBuilder:F,showPageSizeSelector:Q,showColumnExplorer:W,togglePanel:U,isPanelOpen:X,tableLoading:E})]})}),uee=({contents:t})=>{const e=_.useMemo(()=>Pke(t),[t]),[n,r]=_.useState({pageIndex:0,pageSize:25}),o=_.useMemo(()=>Aj(e),[e]),i=_.useMemo(()=>Qke({rowHeaders:Lc.EMPTY,selection:null,fieldTypes:o}),[o]);return y.jsx(oV,{data:e,totalRows:e.length,columns:i,totalColumns:i.length,manualPagination:!1,paginationState:n,setPaginationState:r,wrapperClassName:"h-full justify-between pb-1 px-1",pagination:!0,className:"rounded-none border-b flex overflow-hidden",rowSelection:cr.EMPTY})},L8e=t=>{const e=ue.c(5),{mime:n,base64:r}=t;let o,i;return e[0]!==r||e[1]!==n?(o=UO(r,n),e[0]=r,e[1]=n,e[2]=o):o=e[2],e[3]!==o?(i=y.jsx("img",{src:o,alt:"Preview"}),e[3]=o,e[4]=i):i=e[4],i},z8e=t=>{const e=ue.c(5),{mime:n,base64:r}=t;let o,i;return e[0]!==r||e[1]!==n?(o=UO(r,n),e[0]=r,e[1]=n,e[2]=o):o=e[2],e[3]!==o?(i=y.jsx("audio",{controls:!0,src:o}),e[3]=o,e[4]=i):i=e[4],i},V8e=t=>{const e=ue.c(5),{mime:n,base64:r}=t;let o,i;return e[0]!==r||e[1]!==n?(o=UO(r,n),e[0]=r,e[1]=n,e[2]=o):o=e[2],e[3]!==o?(i=y.jsx("video",{controls:!0,src:o}),e[3]=o,e[4]=i):i=e[4],i},q8e=t=>{const e=ue.c(5),{mime:n,base64:r}=t;let o,i;return e[0]!==r||e[1]!==n?(o=UO(r,n),e[0]=r,e[1]=n,e[2]=o):o=e[2],e[3]!==o?(i=y.jsx("iframe",{src:o,title:"PDF Viewer",className:"w-full h-full"}),e[3]=o,e[4]=i):i=e[4],i},lg=t=>{const e=ue.c(5);let n,r;return e[0]!==t.className?(n=_u(t.className,"rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground block whitespace-nowrap"),e[0]=t.className,e[1]=n):n=e[1],e[2]!==t.children||e[3]!==n?(r=y.jsx("kbd",{className:n,children:t.children}),e[2]=t.children,e[3]=n,e[4]=r):r=e[4],r};const OSe="item",bot=t=>{var oe;const e=ue.c(53),{onRefactorWithAI:n,traceback:r}=t;let o;e[0]!==r?(o=Br({html:r,additionalReplacements:[xot,Oot]}),e[0]=r,e[1]=o):o=e[1];const i=o,[a,s]=_.useState(!0),l=function(ie){var me;const Y=document.createElement("div");Y.innerHTML=ie;const le=(me=Y.textContent)==null?void 0:me.split(`
|
233
233
|
`).filter(Boolean);return(le==null?void 0:le.at(-1))||""}(r),c=Gr(pK);let u;e[2]!==r?(u=(oe=Xse(r))==null?void 0:oe.at(0),e[2]=r,e[3]=u):u=e[3];const d=u,f=()=>{n==null||n({prompt:`My code gives the following error:
|
234
234
|
|
235
235
|
${l}`})},[h,g]=l.split(":",2),v=a?OSe:"";let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=()=>s(kot),e[4]=b):b=e[4];const p=a?"rotate-180":"rotate-0";let O,k;e[5]!==p?(O=we("h-4 w-4 text-muted-foreground transition-transform duration-200 flex-shrink-0",p),e[5]=p,e[6]=O):O=e[6],e[7]!==O?(k=y.jsx(xu,{className:O}),e[7]=O,e[8]=k):k=e[8];const S=h||"Error";let w,T,P,j,D,N,E,A,I;e[9]!==S?(w=y.jsxs("span",{className:"text-destructive",children:[S,":"]}),e[9]=S,e[10]=w):w=e[10],e[11]!==g||e[12]!==w?(T=y.jsxs("div",{className:"text-sm inline font-mono",children:[w," ",g]}),e[11]=g,e[12]=w,e[13]=T):T=e[13],e[14]!==T||e[15]!==k?(P=y.jsxs("div",{className:"flex gap-2 h-10 px-2 hover:bg-muted rounded-sm select-none items-center cursor-pointer transition-all",onClick:b,children:[k,T]}),e[14]=T,e[15]=k,e[16]=P):P=e[16],e[17]!==i?(j=y.jsx(wy,{className:"text-muted-foreground px-4 pt-2 text-xs overflow-auto",children:i}),e[17]=i,e[18]=j):j=e[18],e[19]!==P||e[20]!==j?(D=y.jsxs(ky,{value:OSe,className:"border-none",children:[P,j]}),e[19]=P,e[20]=j,e[21]=D):D=e[21],e[22]!==D||e[23]!==v?(N=y.jsx(Sy,{type:"single",collapsible:!0,value:v,children:D}),e[22]=D,e[23]=v,e[24]=N):N=e[24],e[25]!==c||e[26]!==f||e[27]!==n?(E=n&&c&&y.jsxs(Ft,{size:"xs",variant:"outline",onClick:f,children:[y.jsx(mce,{className:"h-3 w-3 mr-2"}),"Fix with AI"]}),e[25]=c,e[26]=f,e[27]=n,e[28]=E):E=e[28],e[29]!==d?(A=d&&!Vh()&&y.jsx(qn,{content:"Attach pdb to the exception point.",children:y.jsxs(Ft,{size:"xs",variant:"outline",onClick:()=>{ZSe({cellId:d.cellId})},children:[y.jsx(w6,{className:"h-3 w-3 mr-2"}),"Launch debugger"]})}),e[29]=d,e[30]=A):A=e[30],e[31]===Symbol.for("react.memo_cache_sentinel")?(I=y.jsx(Gm,{asChild:!0,children:y.jsxs(Ft,{size:"xs",variant:"text",children:["Get help",y.jsx(xu,{className:"h-3 w-3 ml-1"})]})}),e[31]=I):I=e[31];const L=`https://www.google.com/search?q=${encodeURIComponent(l)}`;let F,Q,W,U,X,G,ae,ne,re,Z,K;return e[32]===Symbol.for("react.memo_cache_sentinel")?(F=y.jsx(Jm,{className:"h-4 w-4 mr-2"}),e[32]=F):F=e[32],e[33]===Symbol.for("react.memo_cache_sentinel")?(Q=y.jsx(zA,{className:"h-3 w-3 ml-auto"}),e[33]=Q):Q=e[33],e[34]!==L?(W=y.jsx($r,{asChild:!0,children:y.jsxs("a",{target:"_blank",href:L,rel:"noreferrer",children:[F,"Search on Google",Q]})}),e[34]=L,e[35]=W):W=e[35],e[36]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx(Qce,{className:"h-4 w-4 mr-2"}),e[36]=U):U=e[36],e[37]===Symbol.for("react.memo_cache_sentinel")?(X=y.jsx($r,{asChild:!0,children:y.jsxs("a",{target:"_blank",href:"https://marimo.io/discord?ref=notebook",rel:"noopener",children:[U,"Ask in Discord",y.jsx(zA,{className:"h-3 w-3 ml-auto"})]})}),e[37]=X):X=e[37],e[38]!==r?(G=()=>{const ie=document.createElement("div");ie.innerHTML=r,Kd(ie.textContent||"")},e[38]=r,e[39]=G):G=e[39],e[40]===Symbol.for("react.memo_cache_sentinel")?(ae=y.jsx(zv,{className:"h-4 w-4 mr-2"}),e[40]=ae):ae=e[40],e[41]!==G?(ne=y.jsxs($r,{onClick:G,children:[ae,"Copy to clipboard"]}),e[41]=G,e[42]=ne):ne=e[42],e[43]!==W||e[44]!==ne?(re=y.jsxs(Hm,{children:[I,y.jsxs(zh,{align:"end",className:"w-56",children:[W,X,ne]})]}),e[43]=W,e[44]=ne,e[45]=re):re=e[45],e[46]!==E||e[47]!==A||e[48]!==re?(Z=y.jsxs("div",{className:"flex gap-2",children:[E,A,re]}),e[46]=E,e[47]=A,e[48]=re,e[49]=Z):Z=e[49],e[50]!==N||e[51]!==Z?(K=y.jsxs("div",{className:"flex flex-col gap-2 min-w-full w-fit",children:[N,Z]}),e[50]=N,e[51]=Z,e[52]=K):K=e[52],K},xot=t=>{const e=Zse(t);if(e){const n=y.jsx(wot,{});return y.jsx("span",{className:"nb",children:y.jsxs("span",{className:"inline-flex items-center",children:[y.jsx(e1e,{cellId:e.cellId,lineNumber:e.lineNumber}),!Vh()&&y.jsx(qn,{content:n,children:y.jsx("button",{type:"button",className:"ml-1 p-1 rounded-sm hover:bg-muted transition-all inline",children:y.jsx(w6,{onClick:()=>{const r=hK(e.cellId);r&&function(o,i){const{state:a}=o,s=a.doc;if(i<=0||i>s.lines)return Ve.warn(`Invalid line number: ${i}. Document has ${s.lines} lines.`),!1;const l=s.line(i);if(l.text.includes("breakpoint()"))return!0;const c=l.text.match(/^(\s*)/),u=`${c?c[1]:""}breakpoint()
|
236
|
-
`,d=l.from;o.dispatch({changes:{from:d,to:d,insert:u},selection:{anchor:d+u.length-1,head:d+u.length-1},scrollIntoView:!0,effects:[mt.scrollIntoView(d,{y:"center"})]}),o.focus()}(r,e.lineNumber)},className:"h-3 w-3"})})})]})})}},Oot=t=>{var e;if(t instanceof ol.Text&&((e=t.nodeValue)!=null&&e.includes("File"))&&t.next instanceof ol.Element&&Use(t.next))return y.jsx(y.Fragment,{children:t.nodeValue.replace("File","Cell")})},wot=()=>{const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsxs(y.Fragment,{children:["Insert a ",y.jsx(lg,{className:"inline",children:"breakpoint()"})," at this line"]}),t[0]=e):e=t[0],e};function kot(t){return!t}function Sot(t){switch(t){case"text/html":return"\u{1F310}";case"text/plain":return"\u{1F4C4}";case"application/json":case"application/vnd.marimo+mimebundle":return"\u{1F4E6}";case"image/png":case"image/tiff":case"image/avif":case"image/bmp":case"image/gif":case"image/jpeg":return"\u{1F5BC}\uFE0F";case"image/svg+xml":return"\u{1F3A8}";case"video/mp4":case"video/mpeg":return"\u{1F3A5}";case"application/vnd.marimo+error":return"\u{1F6A8}";case"application/vnd.marimo+traceback":return"\u{1F40D}";case"text/csv":case"application/vnd.vegalite.v5+json":case"application/vnd.vega.v5+json":return"\u{1F4CA}";case"text/markdown":return"\u{1F4DD}";default:return"\u2753"}}let wSe;wSe=ge.lazy(()=>Be(()=>import("./index-BrcZZepi.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107,108,109,110,111,112,113]),import.meta.url).then(t=>({default:t.VegaLite}))),ng=_.memo(t=>{const e=ue.c(40),{message:n,onRefactorWithAI:r,cellId:o,wrapText:i}=t,{theme:a}=as();let s;e:{const f=n.data;switch(n.mimetype){case"application/json":case"application/vnd.marimo+mimebundle":case"application/vnd.vegalite.v5+json":case"application/vnd.vega.v5+json":{let h;e[0]!==f?(h=typeof f=="string"?JSON.parse(f):f,e[0]=f,e[1]=h):h=e[1],s=h;break e}default:s=void 0}}const l=s,{channel:c,data:u,mimetype:d}=n;if(u==null)return null;switch(d){case"text/html":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[2]!==c||e[3]!==u?(f=y.jsx(BE,{className:c,html:u}),e[2]=c,e[3]=u,e[4]=f):f=e[4],f}case"text/plain":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[5]!==c||e[6]!==u||e[7]!==i?(f=y.jsx(eKe,{channel:c,text:u,wrapText:i}),e[5]=c,e[6]=u,e[7]=i,e[8]=f):f=e[8],f}case"application/json":{let f;return e[9]!==c||e[10]!==l?(f=y.jsx(_k,{className:c,data:l,format:"auto"}),e[9]=c,e[10]=l,e[11]=f):f=e[11],f}case"image/png":case"image/tiff":case"image/avif":case"image/bmp":case"image/gif":case"image/jpeg":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[12]!==c||e[13]!==u?(f=y.jsx(eue,{className:c,src:u,alt:""}),e[12]=c,e[13]=u,e[14]=f):f=e[14],f}case"image/svg+xml":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[15]!==u?(f=Br({html:u}),e[15]=u,e[16]=f):f=e[16],f}case"video/mp4":case"video/mpeg":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[17]!==c||e[18]!==u?(f=y.jsx(Cfe,{className:c,src:u}),e[17]=c,e[18]=u,e[19]=f):f=e[19],f}case"application/vnd.marimo+error":{let f;return Rn(Array.isArray(u),"Expected array data"),e[20]!==o||e[21]!==u?(f=y.jsx(cee,{cellId:o,errors:u}),e[20]=o,e[21]=u,e[22]=f):f=e[22],f}case"application/vnd.marimo+traceback":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[23]!==o||e[24]!==u||e[25]!==r?(f=y.jsx(bot,{onRefactorWithAI:r,traceback:u,cellId:o}),e[23]=o,e[24]=u,e[25]=r,e[26]=f):f=e[26],f}case"text/csv":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[27]!==u?(f=y.jsx(uee,{contents:u}),e[27]=u,e[28]=f):f=e[28],f}case"text/latex":case"text/markdown":{Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`);const f=a==="dark"?"dark":"light";let h;return e[29]!==u||e[30]!==f?(h=y.jsx(SN,{theme:f,value:u,readOnly:!0,editable:!1,language:"markdown"}),e[29]=u,e[30]=f,e[31]=h):h=e[31],h}case"application/vnd.vegalite.v5+json":case"application/vnd.vega.v5+json":{const f=l,h=a==="dark"?"dark":void 0;let g;return e[32]!==f||e[33]!==h?(g=y.jsx(wSe,{spec:f,theme:h}),e[32]=f,e[33]=h,e[34]=g):g=e[34],g}case"application/vnd.marimo+mimebundle":{const f=l;let h;return e[35]!==c||e[36]!==f?(h=y.jsx(kSe,{channel:c,data:f}),e[35]=c,e[36]=f,e[37]=h):h=e[37],h}default:{let f;return us(d),e[38]!==d?(f=y.jsxs("div",{className:"text-destructive",children:["Unsupported mimetype: ",d]}),e[38]=d,e[39]=f):f=e[39],f}}}),ng.displayName="OutputRenderer";const kSe=_.memo(t=>{const e=ue.c(35),{data:n,channel:r,cellId:o}=t,i=Array.isArray(n)?n[0]:n;let a;e[0]!==i?(a=cr.keys(i),e[0]=i,e[1]=a):a=e[1];const s=a[0];if(!s)return null;if(Object.keys(i).length===1){const O=i[s];let k,S;return e[2]!==r||e[3]!==s||e[4]!==O?(k={channel:r,data:O,mimetype:s},e[2]=r,e[3]=s,e[4]=O,e[5]=k):k=e[5],e[6]!==o||e[7]!==k?(S=y.jsx(ng,{cellId:o,message:k}),e[6]=o,e[7]=k,e[8]=S):S=e[8],S}let l,c,u,d,f,h,g,v,b,p;if(e[9]!==o||e[10]!==r||e[11]!==s||e[12]!==i){const O=cr.entries(i);let k;O.sort(Cot),l=sg,h=s,g="vertical",d="flex",f=y.jsx(Kh,{className:"self-start max-h-none flex flex-col gap-2 mr-4 flex-shrink-0",children:O.map(_ot)}),c="flex-1",e[20]!==o||e[21]!==r?(k=S=>{const[w,T]=S;return y.jsx(ec,{value:w,children:y.jsx(Bh,{children:y.jsx(ng,{cellId:o,message:{channel:r,data:T,mimetype:w}})})},w)},e[20]=o,e[21]=r,e[22]=k):k=e[22],u=O.map(k),e[9]=o,e[10]=r,e[11]=s,e[12]=i,e[13]=l,e[14]=c,e[15]=u,e[16]=d,e[17]=f,e[18]=h,e[19]=g}else l=e[13],c=e[14],u=e[15],d=e[16],f=e[17],h=e[18],g=e[19];return e[23]!==c||e[24]!==u?(v=y.jsx("div",{className:c,children:u}),e[23]=c,e[24]=u,e[25]=v):v=e[25],e[26]!==d||e[27]!==f||e[28]!==v?(b=y.jsxs("div",{className:d,children:[f,v]}),e[26]=d,e[27]=f,e[28]=v,e[29]=b):b=e[29],e[30]!==l||e[31]!==h||e[32]!==g||e[33]!==b?(p=y.jsx(l,{defaultValue:h,orientation:g,children:b}),e[30]=l,e[31]=h,e[32]=g,e[33]=b,e[34]=p):p=e[34],p});kSe.displayName="MimeBundleOutputRenderer",XY=ge.memo(t=>{const e=ue.c(17),{output:n,cellId:r,stale:o,loading:i,allowExpand:a,forceExpand:s,className:l}=t;if(n===null||n.channel==="output"&&n.data==="")return null;const c=o?"This output is stale":void 0,u=a?CSe:SSe;let d;e[0]!==r?(d=dK.create(r),e[0]=r,e[1]=d):d=e[1];const f=o&&"marimo-output-stale",h=i&&"marimo-output-loading";let g,v,b;return e[2]!==l||e[3]!==f||e[4]!==h?(g=we(f,h,l),e[2]=l,e[3]=f,e[4]=h,e[5]=g):g=e[5],e[6]!==r||e[7]!==n?(v=y.jsx(ng,{cellId:r,message:n}),e[6]=r,e[7]=n,e[8]=v):v=e[8],e[9]!==u||e[10]!==r||e[11]!==s||e[12]!==d||e[13]!==g||e[14]!==v||e[15]!==c?(b=y.jsx(Bh,{children:y.jsx(u,{title:c,cellId:r,forceExpand:s,id:d,className:g,children:v})}),e[9]=u,e[10]=r,e[11]=s,e[12]=d,e[13]=g,e[14]=v,e[15]=c,e[16]=b):b=e[16],b}),XY.displayName="OutputArea";const SSe=ge.forwardRef((t,e)=>{const n=ue.c(3);let r;return n[0]!==t||n[1]!==e?(r=y.jsx("div",{ref:e,...t}),n[0]=t,n[1]=e,n[2]=r):r=n[2],r});SSe.displayName="Div";const CSe=ge.memo(t=>{const e=ue.c(33);let n,r,o,i;e[0]!==t?({cellId:n,children:r,forceExpand:o,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=_.useRef(null),[s,l]=function(P){const[j,D]=_.useState(i1e[P]??!1);return[j,N=>{D(N),i1e[P]=N}]}(n),[c,u]=_.useState(!1);let d,f,h,g,v,b,p,O,k,S,w,T;return e[5]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{if(!a.current)return;const P=a.current,j=new ResizeObserver(()=>{u(P.scrollHeight>P.clientHeight)});return j.observe(P),()=>{j.disconnect()}},e[5]=d):d=e[5],e[6]!==i.id?(f=[i.id],e[6]=i.id,e[7]=f):f=e[7],_.useEffect(d,f),e[8]===Symbol.for("react.memo_cache_sentinel")?(h=async()=>{var P;await((P=a.current)==null?void 0:P.requestFullscreen())},e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsx(qn,{content:"Fullscreen",side:"left",children:y.jsx(Ft,{"data-testid":"fullscreen-output-button",className:"hover-action hover:bg-muted p-1 hover:border-border border border-transparent",onClick:h,onMouseDown:ai.preventFocus,size:"xs",variant:"text",children:y.jsx(Pce,{className:"size-4",strokeWidth:1.25})})}),e[9]=g):g=e[9],e[10]!==o||e[11]!==s||e[12]!==c||e[13]!==l?(v=(c||s)&&!o&&y.jsx(Ft,{"data-testid":"expand-output-button",className:we("hover:border-border border border-transparent hover:bg-muted",!s&&"hover-action"),onClick:()=>l(!s),size:"xs",variant:"text",children:s?y.jsx(qn,{content:"Collapse output",side:"left",children:y.jsx(rY,{className:"h-4 w-4"})}):y.jsx(qn,{content:"Expand output",side:"left",children:y.jsx(FO,{className:"h-4 w-4"})})}),e[10]=o,e[11]=s,e[12]=c,e[13]=l,e[14]=v):v=e[14],e[15]!==v?(b=y.jsx("div",{className:"relative print:hidden",children:y.jsxs("div",{className:"absolute -right-9 top-1 z-[1] flex flex-col gap-1",children:[g,v]})}),e[15]=v,e[16]=b):b=e[16],e[17]!==i.className?(p=we("relative fullscreen:bg-background fullscreen:flex fullscreen:items-center fullscreen:justify-center","fullscreen:[align-items:safe_center]",i.className),e[17]=i.className,e[18]=p):p=e[18],e[19]!==o||e[20]!==s?(O=s||o?{maxHeight:"none"}:void 0,e[19]=o,e[20]=s,e[21]=O):O=e[21],e[22]!==r||e[23]!==i||e[24]!==p||e[25]!==O?(k=y.jsx("div",{...i,"data-cell-role":"output",className:p,ref:a,style:O,children:r}),e[22]=r,e[23]=i,e[24]=p,e[25]=O,e[26]=k):k=e[26],e[27]!==b||e[28]!==k?(S=y.jsxs("div",{children:[b,k]}),e[27]=b,e[28]=k,e[29]=S):S=e[29],e[30]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsx("div",{className:"increase-pointer-area-x contents print:hidden"}),e[30]=w):w=e[30],e[31]!==S?(T=y.jsxs(y.Fragment,{children:[S,w]}),e[31]=S,e[32]=T):T=e[32],T});function Cot(t,e){const[n]=t;return n==="text/html"?-1:0}function _ot(t){const[e]=t;return y.jsx(Hs,{value:e,className:"flex items-center space-x-2",children:y.jsx(qn,{delayDuration:200,content:e,side:"right",children:y.jsx("span",{children:Sot(e)})})},e)}I_=function(){return(window==null?void 0:window.__MARIMO_STATIC__)!==void 0};function _Se(){return Rn(window.__MARIMO_STATIC__!==void 0,"Not a static notebook"),window.__MARIMO_STATIC__.files}WY=function(){try{window.location.reload()}catch(t){Ve.error("Failed to reload page",t),Kr({title:"Failed to reload page",description:"Please refresh the page manually."})}},aT=function(){const t=Ht.get(iV);return VA(t,"internal-error: initial mode not found"),Rn(t!=="present","internal-error: initial mode cannot be 'present'"),t},z6e=function(t){return t==="read"?"read":t==="edit"?"present":"edit"},CSe.displayName="ExpandableOutput";let iV,TSe,PSe;nG=Ct({mode:"not-set",cellAnchor:null}),iV=Ct(void 0),lQe=Ct(!1),TSe={"Content-Type":"application/json"},PSe=/\{[^{}]+\}/g;class Tot extends Request{constructor(e,n){super(e,n);for(const r in n)r in this||(this[r]=n[r])}}function Pot(t){let{baseUrl:e="",fetch:n=globalThis.fetch,querySerializer:r,bodySerializer:o,headers:i,...a}={...t};e.endsWith("/")&&(e=e.substring(0,e.length-1)),i=DSe(TSe,i);const s=[];async function l(c,u){const{fetch:d=n,headers:f,params:h={},parseAs:g="json",querySerializer:v,bodySerializer:b=o??Eot,...p}=u||{};let O=typeof r=="function"?r:jSe(r);v&&(O=typeof v=="function"?v:jSe({...typeof r=="object"?r:{},...v}));const k={redirect:"follow",...a,...p,headers:DSe(i,f,h.header)};k.body&&(k.body=b(k.body)),k.body instanceof FormData&&k.headers.delete("Content-Type");let S=new Tot(function(j,D){var A;let N=`${D.baseUrl}${j}`;(A=D.params)!=null&&A.path&&(N=function(I,L){let F=I;for(const Q of I.match(PSe)??[]){let W=Q.substring(1,Q.length-1),U=!1,X="simple";if(W.endsWith("*")&&(U=!0,W=W.substring(0,W.length-1)),W.startsWith(".")?(X="label",W=W.substring(1)):W.startsWith(";")&&(X="matrix",W=W.substring(1)),!L||L[W]===void 0||L[W]===null)continue;const G=L[W];Array.isArray(G)?F=F.replace(Q,RSe(W,G,{style:X,explode:U})):F=typeof G!="object"?X!=="matrix"?F.replace(Q,X==="label"?`.${G}`:G):F.replace(Q,`;${Lj(W,G)}`):F.replace(Q,ESe(W,G,{style:X,explode:U}))}return F}(N,D.params.path));let E=D.querySerializer(D.params.query??{});return E.startsWith("?")&&(E=E.substring(1)),E&&(N+=`?${E}`),N}(c,{baseUrl:e,params:h,querySerializer:O}),k);const w={baseUrl:e,fetch:d,parseAs:g,querySerializer:O,bodySerializer:b};for(const j of s)if(j&&typeof j=="object"&&typeof j.onRequest=="function"){S.schemaPath=c,S.params=h;const D=await j.onRequest(S,w);if(D){if(!(D instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");S=D}}let T=await d(S);for(let j=s.length-1;j>=0;j--){const D=s[j];if(D&&typeof D=="object"&&typeof D.onResponse=="function"){const N=await D.onResponse(T,w);if(N){if(!(N instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");T=N}}}if(T.status===204||T.headers.get("Content-Length")==="0")return T.ok?{data:{},response:T}:{error:{},response:T};if(T.ok)return g==="stream"?{data:T.body,response:T}:{data:await T[g](),response:T};let P=await T.text();try{P=JSON.parse(P)}catch{}return{error:P,response:T}}return{GET:async(c,u)=>l(c,{...u,method:"GET"}),PUT:async(c,u)=>l(c,{...u,method:"PUT"}),POST:async(c,u)=>l(c,{...u,method:"POST"}),DELETE:async(c,u)=>l(c,{...u,method:"DELETE"}),OPTIONS:async(c,u)=>l(c,{...u,method:"OPTIONS"}),HEAD:async(c,u)=>l(c,{...u,method:"HEAD"}),PATCH:async(c,u)=>l(c,{...u,method:"PATCH"}),TRACE:async(c,u)=>l(c,{...u,method:"TRACE"}),use(...c){for(const u of c)if(u){if(typeof u!="object"||!("onRequest"in u)&&!("onResponse"in u))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");s.push(u)}},eject(...c){for(const u of c){const d=s.indexOf(u);d!==-1&&s.splice(d,1)}}}}function Lj(t,e,n){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${(n==null?void 0:n.allowReserved)===!0?e:encodeURIComponent(e)}`}function ESe(t,e,n){if(!e||typeof e!="object")return"";const r=[],o={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const s in e)r.push(s,n.allowReserved===!0?e[s]:encodeURIComponent(e[s]));const a=r.join(",");switch(n.style){case"form":return`${t}=${a}`;case"label":return`.${a}`;case"matrix":return`;${t}=${a}`;default:return a}}for(const a in e){const s=n.style==="deepObject"?`${t}[${a}]`:a;r.push(Lj(s,e[a],n))}const i=r.join(o);return n.style==="label"||n.style==="matrix"?`${o}${i}`:i}function RSe(t,e,n){if(!Array.isArray(e))return"";if(n.explode===!1){const i={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",a=(n.allowReserved===!0?e:e.map(s=>encodeURIComponent(s))).join(i);switch(n.style){case"simple":return a;case"label":return`.${a}`;case"matrix":return`;${t}=${a}`;default:return`${t}=${a}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",o=[];for(const i of e)n.style==="simple"||n.style==="label"?o.push(n.allowReserved===!0?i:encodeURIComponent(i)):o.push(Lj(t,i,n));return n.style==="label"||n.style==="matrix"?`${r}${o.join(r)}`:o.join(r)}function jSe(t){return function(e){const n=[];if(e&&typeof e=="object")for(const r in e){const o=e[r];o!=null&&(Array.isArray(o)?n.push(RSe(r,o,{style:"form",explode:!0,...t==null?void 0:t.array,allowReserved:(t==null?void 0:t.allowReserved)||!1})):typeof o!="object"?n.push(Lj(r,o,t)):n.push(ESe(r,o,{style:"deepObject",explode:!0,...t==null?void 0:t.object,allowReserved:(t==null?void 0:t.allowReserved)||!1})))}return n.join("&")}}function Eot(t){return JSON.stringify(t)}function DSe(...t){const e=new Headers;for(const n of t){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[o,i]of r)if(i===null)e.delete(o);else if(Array.isArray(i))for(const a of i)e.append(o,a);else i!==void 0&&e.set(o,i)}return e}function ASe(){const t=ay().httpURL;return t.search="",t.hash="",t.toString()}lO={post(t,e,n={}){const r=`${Jf.withTrailingSlash(n.baseUrl??ASe())}api${t}`;return fetch(r,{method:"POST",headers:{"Content-Type":"application/json",...lO.headers(),...n.headers},body:JSON.stringify(e)}).then(async o=>{var a;const i=(a=o.headers.get("Content-Type"))==null?void 0:a.startsWith("application/json");if(!o.ok){const s=i?await o.json():await o.text();throw new Error(o.statusText,{cause:s})}return i?o.json():o.text()}).catch(o=>{throw Ve.error(`Error requesting ${r}`,o),o})},get(t,e={}){const n=`${Jf.withTrailingSlash(e.baseUrl??ASe())}api${t}`;return fetch(n,{method:"GET",headers:{...lO.headers(),...e.headers}}).then(r=>{var o;if(!r.ok)throw new Error(r.statusText);return(o=r.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?r.json():null}).catch(r=>{throw Ve.error(`Error requesting ${n}`,r),r})},headers:()=>ay().headers(),handleResponse:t=>t.error?Promise.reject(t.error):Promise.resolve(t.data),handleResponseReturnNull:t=>t.error?Promise.reject(t.error):Promise.resolve(null)};function Rot(t){const e=Pot({baseUrl:t.httpURL.toString()});return e.use({onRequest:n=>{const r=t.headers();for(const[o,i]of Object.entries(r))n.headers.set(o,i);return n}}),e}var MSe,NSe={exports:{}},aV=(MSe||(MSe=1,function(t){var e=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(l,c){if(!i[l]){i[l]={};for(var u=0;u<l.length;u++)i[l][l.charAt(u)]=u}return i[l][c]}var s={compressToBase64:function(l){if(l==null)return"";var c=s._compress(l,6,function(u){return r.charAt(u)});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:s._decompress(l.length,32,function(c){return a(r,l.charAt(c))})},compressToUTF16:function(l){return l==null?"":s._compress(l,15,function(c){return n(c+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:s._decompress(l.length,16384,function(c){return l.charCodeAt(c)-32})},compressToUint8Array:function(l){for(var c=s.compress(l),u=new Uint8Array(2*c.length),d=0,f=c.length;d<f;d++){var h=c.charCodeAt(d);u[2*d]=h>>>8,u[2*d+1]=h%256}return u},decompressFromUint8Array:function(l){if(l==null)return s.decompress(l);for(var c=new Array(l.length/2),u=0,d=c.length;u<d;u++)c[u]=256*l[2*u]+l[2*u+1];var f=[];return c.forEach(function(h){f.push(n(h))}),s.decompress(f.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":s._compress(l,6,function(c){return o.charAt(c)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),s._decompress(l.length,32,function(c){return a(o,l.charAt(c))}))},compress:function(l){return s._compress(l,16,function(c){return n(c)})},_compress:function(l,c,u){if(l==null)return"";var d,f,h,g={},v={},b="",p="",O="",k=2,S=3,w=2,T=[],P=0,j=0;for(h=0;h<l.length;h+=1)if(b=l.charAt(h),Object.prototype.hasOwnProperty.call(g,b)||(g[b]=S++,v[b]=!0),p=O+b,Object.prototype.hasOwnProperty.call(g,p))O=p;else{if(Object.prototype.hasOwnProperty.call(v,O)){if(O.charCodeAt(0)<256){for(d=0;d<w;d++)P<<=1,j==c-1?(j=0,T.push(u(P)),P=0):j++;for(f=O.charCodeAt(0),d=0;d<8;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1}else{for(f=1,d=0;d<w;d++)P=P<<1|f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f=0;for(f=O.charCodeAt(0),d=0;d<16;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1}--k==0&&(k=Math.pow(2,w),w++),delete v[O]}else for(f=g[O],d=0;d<w;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1;--k==0&&(k=Math.pow(2,w),w++),g[p]=S++,O=String(b)}if(O!==""){if(Object.prototype.hasOwnProperty.call(v,O)){if(O.charCodeAt(0)<256){for(d=0;d<w;d++)P<<=1,j==c-1?(j=0,T.push(u(P)),P=0):j++;for(f=O.charCodeAt(0),d=0;d<8;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1}else{for(f=1,d=0;d<w;d++)P=P<<1|f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f=0;for(f=O.charCodeAt(0),d=0;d<16;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1}--k==0&&(k=Math.pow(2,w),w++),delete v[O]}else for(f=g[O],d=0;d<w;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1;--k==0&&(k=Math.pow(2,w),w++)}for(f=2,d=0;d<w;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1;for(;;){if(P<<=1,j==c-1){T.push(u(P));break}j++}return T.join("")},decompress:function(l){return l==null?"":l==""?null:s._decompress(l.length,32768,function(c){return l.charCodeAt(c)})},_decompress:function(l,c,u){var d,f,h,g,v,b,p,O=[],k=4,S=4,w=3,T="",P=[],j={val:u(0),position:c,index:1};for(d=0;d<3;d+=1)O[d]=d;for(h=0,v=Math.pow(2,2),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;switch(h){case 0:for(h=0,v=Math.pow(2,8),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;p=n(h);break;case 1:for(h=0,v=Math.pow(2,16),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;p=n(h);break;case 2:return""}for(O[3]=p,f=p,P.push(p);;){if(j.index>l)return"";for(h=0,v=Math.pow(2,w),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;switch(p=h){case 0:for(h=0,v=Math.pow(2,8),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;O[S++]=n(h),p=S-1,k--;break;case 1:for(h=0,v=Math.pow(2,16),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;O[S++]=n(h),p=S-1,k--;break;case 2:return P.join("")}if(k==0&&(k=Math.pow(2,w),w++),O[p])T=O[p];else{if(p!==S)return null;T=f+f.charAt(0)}P.push(T),O[S++]=f+T.charAt(0),f=T,--k==0&&(k=Math.pow(2,w),w++)}}};return s}();t!=null?t.exports=e:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e})}(NSe)),NSe.exports);zH=function(t){const{code:e,baseUrl:n="https://marimo.app"}=t,r=new URL(n);if(e){const o=aV.compressToEncodedURIComponent(e);r.hash=`#code/${o}`}return r.href};let sV,lV,$Se,ISe,QSe,LSe,zSe;eG=Ct("Initializing..."),YIe=Ct(t=>{const e=t(ur),n=Object.values(e.cellRuntime);return!!n.some(r=>!pG(r.output))||n.every(r=>r.status==="idle")}),sV="marimo:file",lV=new uK(null),$Se={saveFile(t){lV.set(sV,t)},readFile:()=>lV.get(sV)},ISe={saveFile(t){My.setCodeForHash(aV.compressToEncodedURIComponent(t))},readFile(){const t=My.getCodeFromHash()||My.getCodeFromSearchParam();return t?aV.decompressFromEncodedURIComponent(t):null}},QSe={saveFile(t){},readFile(){const t=document.querySelector("marimo-code");return t?decodeURIComponent(t.textContent||"").trim():null}},LSe={saveFile(t){},readFile(){if(window.location.hostname!=="marimo.app")return null;const t=new URL("files/wasm-intro.py",document.baseURI);return fetch(t.toString()).then(e=>e.ok?e.text():null).catch(()=>null)}},zSe={saveFile(t){},readFile:()=>["import marimo","app = marimo.App()","","@app.cell","def __():"," return","",'if __name__ == "__main__":'," app.run()"].join(`
|
236
|
+
`,d=l.from;o.dispatch({changes:{from:d,to:d,insert:u},selection:{anchor:d+u.length-1,head:d+u.length-1},scrollIntoView:!0,effects:[mt.scrollIntoView(d,{y:"center"})]}),o.focus()}(r,e.lineNumber)},className:"h-3 w-3"})})})]})})}},Oot=t=>{var e;if(t instanceof ol.Text&&((e=t.nodeValue)!=null&&e.includes("File"))&&t.next instanceof ol.Element&&Use(t.next))return y.jsx(y.Fragment,{children:t.nodeValue.replace("File","Cell")})},wot=()=>{const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsxs(y.Fragment,{children:["Insert a ",y.jsx(lg,{className:"inline",children:"breakpoint()"})," at this line"]}),t[0]=e):e=t[0],e};function kot(t){return!t}function Sot(t){switch(t){case"text/html":return"\u{1F310}";case"text/plain":return"\u{1F4C4}";case"application/json":case"application/vnd.marimo+mimebundle":return"\u{1F4E6}";case"image/png":case"image/tiff":case"image/avif":case"image/bmp":case"image/gif":case"image/jpeg":return"\u{1F5BC}\uFE0F";case"image/svg+xml":return"\u{1F3A8}";case"video/mp4":case"video/mpeg":return"\u{1F3A5}";case"application/vnd.marimo+error":return"\u{1F6A8}";case"application/vnd.marimo+traceback":return"\u{1F40D}";case"text/csv":case"application/vnd.vegalite.v5+json":case"application/vnd.vega.v5+json":return"\u{1F4CA}";case"text/markdown":return"\u{1F4DD}";default:return"\u2753"}}let wSe;wSe=ge.lazy(()=>Be(()=>import("./index-7igCaZQI.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107,108,109,110,111,112,113]),import.meta.url).then(t=>({default:t.VegaLite}))),ng=_.memo(t=>{const e=ue.c(40),{message:n,onRefactorWithAI:r,cellId:o,wrapText:i}=t,{theme:a}=as();let s;e:{const f=n.data;switch(n.mimetype){case"application/json":case"application/vnd.marimo+mimebundle":case"application/vnd.vegalite.v5+json":case"application/vnd.vega.v5+json":{let h;e[0]!==f?(h=typeof f=="string"?JSON.parse(f):f,e[0]=f,e[1]=h):h=e[1],s=h;break e}default:s=void 0}}const l=s,{channel:c,data:u,mimetype:d}=n;if(u==null)return null;switch(d){case"text/html":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[2]!==c||e[3]!==u?(f=y.jsx(BE,{className:c,html:u}),e[2]=c,e[3]=u,e[4]=f):f=e[4],f}case"text/plain":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[5]!==c||e[6]!==u||e[7]!==i?(f=y.jsx(eKe,{channel:c,text:u,wrapText:i}),e[5]=c,e[6]=u,e[7]=i,e[8]=f):f=e[8],f}case"application/json":{let f;return e[9]!==c||e[10]!==l?(f=y.jsx(_k,{className:c,data:l,format:"auto"}),e[9]=c,e[10]=l,e[11]=f):f=e[11],f}case"image/png":case"image/tiff":case"image/avif":case"image/bmp":case"image/gif":case"image/jpeg":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[12]!==c||e[13]!==u?(f=y.jsx(eue,{className:c,src:u,alt:""}),e[12]=c,e[13]=u,e[14]=f):f=e[14],f}case"image/svg+xml":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[15]!==u?(f=Br({html:u}),e[15]=u,e[16]=f):f=e[16],f}case"video/mp4":case"video/mpeg":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[17]!==c||e[18]!==u?(f=y.jsx(Cfe,{className:c,src:u}),e[17]=c,e[18]=u,e[19]=f):f=e[19],f}case"application/vnd.marimo+error":{let f;return Rn(Array.isArray(u),"Expected array data"),e[20]!==o||e[21]!==u?(f=y.jsx(cee,{cellId:o,errors:u}),e[20]=o,e[21]=u,e[22]=f):f=e[22],f}case"application/vnd.marimo+traceback":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[23]!==o||e[24]!==u||e[25]!==r?(f=y.jsx(bot,{onRefactorWithAI:r,traceback:u,cellId:o}),e[23]=o,e[24]=u,e[25]=r,e[26]=f):f=e[26],f}case"text/csv":{let f;return Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`),e[27]!==u?(f=y.jsx(uee,{contents:u}),e[27]=u,e[28]=f):f=e[28],f}case"text/latex":case"text/markdown":{Rn(typeof u=="string",`Expected string data for mime=${d}. Got ${typeof u}`);const f=a==="dark"?"dark":"light";let h;return e[29]!==u||e[30]!==f?(h=y.jsx(SN,{theme:f,value:u,readOnly:!0,editable:!1,language:"markdown"}),e[29]=u,e[30]=f,e[31]=h):h=e[31],h}case"application/vnd.vegalite.v5+json":case"application/vnd.vega.v5+json":{const f=l,h=a==="dark"?"dark":void 0;let g;return e[32]!==f||e[33]!==h?(g=y.jsx(wSe,{spec:f,theme:h}),e[32]=f,e[33]=h,e[34]=g):g=e[34],g}case"application/vnd.marimo+mimebundle":{const f=l;let h;return e[35]!==c||e[36]!==f?(h=y.jsx(kSe,{channel:c,data:f}),e[35]=c,e[36]=f,e[37]=h):h=e[37],h}default:{let f;return us(d),e[38]!==d?(f=y.jsxs("div",{className:"text-destructive",children:["Unsupported mimetype: ",d]}),e[38]=d,e[39]=f):f=e[39],f}}}),ng.displayName="OutputRenderer";const kSe=_.memo(t=>{const e=ue.c(35),{data:n,channel:r,cellId:o}=t,i=Array.isArray(n)?n[0]:n;let a;e[0]!==i?(a=cr.keys(i),e[0]=i,e[1]=a):a=e[1];const s=a[0];if(!s)return null;if(Object.keys(i).length===1){const O=i[s];let k,S;return e[2]!==r||e[3]!==s||e[4]!==O?(k={channel:r,data:O,mimetype:s},e[2]=r,e[3]=s,e[4]=O,e[5]=k):k=e[5],e[6]!==o||e[7]!==k?(S=y.jsx(ng,{cellId:o,message:k}),e[6]=o,e[7]=k,e[8]=S):S=e[8],S}let l,c,u,d,f,h,g,v,b,p;if(e[9]!==o||e[10]!==r||e[11]!==s||e[12]!==i){const O=cr.entries(i);let k;O.sort(Cot),l=sg,h=s,g="vertical",d="flex",f=y.jsx(Kh,{className:"self-start max-h-none flex flex-col gap-2 mr-4 flex-shrink-0",children:O.map(_ot)}),c="flex-1",e[20]!==o||e[21]!==r?(k=S=>{const[w,T]=S;return y.jsx(ec,{value:w,children:y.jsx(Bh,{children:y.jsx(ng,{cellId:o,message:{channel:r,data:T,mimetype:w}})})},w)},e[20]=o,e[21]=r,e[22]=k):k=e[22],u=O.map(k),e[9]=o,e[10]=r,e[11]=s,e[12]=i,e[13]=l,e[14]=c,e[15]=u,e[16]=d,e[17]=f,e[18]=h,e[19]=g}else l=e[13],c=e[14],u=e[15],d=e[16],f=e[17],h=e[18],g=e[19];return e[23]!==c||e[24]!==u?(v=y.jsx("div",{className:c,children:u}),e[23]=c,e[24]=u,e[25]=v):v=e[25],e[26]!==d||e[27]!==f||e[28]!==v?(b=y.jsxs("div",{className:d,children:[f,v]}),e[26]=d,e[27]=f,e[28]=v,e[29]=b):b=e[29],e[30]!==l||e[31]!==h||e[32]!==g||e[33]!==b?(p=y.jsx(l,{defaultValue:h,orientation:g,children:b}),e[30]=l,e[31]=h,e[32]=g,e[33]=b,e[34]=p):p=e[34],p});kSe.displayName="MimeBundleOutputRenderer",XY=ge.memo(t=>{const e=ue.c(17),{output:n,cellId:r,stale:o,loading:i,allowExpand:a,forceExpand:s,className:l}=t;if(n===null||n.channel==="output"&&n.data==="")return null;const c=o?"This output is stale":void 0,u=a?CSe:SSe;let d;e[0]!==r?(d=dK.create(r),e[0]=r,e[1]=d):d=e[1];const f=o&&"marimo-output-stale",h=i&&"marimo-output-loading";let g,v,b;return e[2]!==l||e[3]!==f||e[4]!==h?(g=we(f,h,l),e[2]=l,e[3]=f,e[4]=h,e[5]=g):g=e[5],e[6]!==r||e[7]!==n?(v=y.jsx(ng,{cellId:r,message:n}),e[6]=r,e[7]=n,e[8]=v):v=e[8],e[9]!==u||e[10]!==r||e[11]!==s||e[12]!==d||e[13]!==g||e[14]!==v||e[15]!==c?(b=y.jsx(Bh,{children:y.jsx(u,{title:c,cellId:r,forceExpand:s,id:d,className:g,children:v})}),e[9]=u,e[10]=r,e[11]=s,e[12]=d,e[13]=g,e[14]=v,e[15]=c,e[16]=b):b=e[16],b}),XY.displayName="OutputArea";const SSe=ge.forwardRef((t,e)=>{const n=ue.c(3);let r;return n[0]!==t||n[1]!==e?(r=y.jsx("div",{ref:e,...t}),n[0]=t,n[1]=e,n[2]=r):r=n[2],r});SSe.displayName="Div";const CSe=ge.memo(t=>{const e=ue.c(33);let n,r,o,i;e[0]!==t?({cellId:n,children:r,forceExpand:o,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=_.useRef(null),[s,l]=function(P){const[j,D]=_.useState(i1e[P]??!1);return[j,N=>{D(N),i1e[P]=N}]}(n),[c,u]=_.useState(!1);let d,f,h,g,v,b,p,O,k,S,w,T;return e[5]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{if(!a.current)return;const P=a.current,j=new ResizeObserver(()=>{u(P.scrollHeight>P.clientHeight)});return j.observe(P),()=>{j.disconnect()}},e[5]=d):d=e[5],e[6]!==i.id?(f=[i.id],e[6]=i.id,e[7]=f):f=e[7],_.useEffect(d,f),e[8]===Symbol.for("react.memo_cache_sentinel")?(h=async()=>{var P;await((P=a.current)==null?void 0:P.requestFullscreen())},e[8]=h):h=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsx(qn,{content:"Fullscreen",side:"left",children:y.jsx(Ft,{"data-testid":"fullscreen-output-button",className:"hover-action hover:bg-muted p-1 hover:border-border border border-transparent",onClick:h,onMouseDown:ai.preventFocus,size:"xs",variant:"text",children:y.jsx(Pce,{className:"size-4",strokeWidth:1.25})})}),e[9]=g):g=e[9],e[10]!==o||e[11]!==s||e[12]!==c||e[13]!==l?(v=(c||s)&&!o&&y.jsx(Ft,{"data-testid":"expand-output-button",className:we("hover:border-border border border-transparent hover:bg-muted",!s&&"hover-action"),onClick:()=>l(!s),size:"xs",variant:"text",children:s?y.jsx(qn,{content:"Collapse output",side:"left",children:y.jsx(rY,{className:"h-4 w-4"})}):y.jsx(qn,{content:"Expand output",side:"left",children:y.jsx(FO,{className:"h-4 w-4"})})}),e[10]=o,e[11]=s,e[12]=c,e[13]=l,e[14]=v):v=e[14],e[15]!==v?(b=y.jsx("div",{className:"relative print:hidden",children:y.jsxs("div",{className:"absolute -right-9 top-1 z-[1] flex flex-col gap-1",children:[g,v]})}),e[15]=v,e[16]=b):b=e[16],e[17]!==i.className?(p=we("relative fullscreen:bg-background fullscreen:flex fullscreen:items-center fullscreen:justify-center","fullscreen:[align-items:safe_center]",i.className),e[17]=i.className,e[18]=p):p=e[18],e[19]!==o||e[20]!==s?(O=s||o?{maxHeight:"none"}:void 0,e[19]=o,e[20]=s,e[21]=O):O=e[21],e[22]!==r||e[23]!==i||e[24]!==p||e[25]!==O?(k=y.jsx("div",{...i,"data-cell-role":"output",className:p,ref:a,style:O,children:r}),e[22]=r,e[23]=i,e[24]=p,e[25]=O,e[26]=k):k=e[26],e[27]!==b||e[28]!==k?(S=y.jsxs("div",{children:[b,k]}),e[27]=b,e[28]=k,e[29]=S):S=e[29],e[30]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsx("div",{className:"increase-pointer-area-x contents print:hidden"}),e[30]=w):w=e[30],e[31]!==S?(T=y.jsxs(y.Fragment,{children:[S,w]}),e[31]=S,e[32]=T):T=e[32],T});function Cot(t,e){const[n]=t;return n==="text/html"?-1:0}function _ot(t){const[e]=t;return y.jsx(Hs,{value:e,className:"flex items-center space-x-2",children:y.jsx(qn,{delayDuration:200,content:e,side:"right",children:y.jsx("span",{children:Sot(e)})})},e)}I_=function(){return(window==null?void 0:window.__MARIMO_STATIC__)!==void 0};function _Se(){return Rn(window.__MARIMO_STATIC__!==void 0,"Not a static notebook"),window.__MARIMO_STATIC__.files}WY=function(){try{window.location.reload()}catch(t){Ve.error("Failed to reload page",t),Kr({title:"Failed to reload page",description:"Please refresh the page manually."})}},aT=function(){const t=Ht.get(iV);return VA(t,"internal-error: initial mode not found"),Rn(t!=="present","internal-error: initial mode cannot be 'present'"),t},z6e=function(t){return t==="read"?"read":t==="edit"?"present":"edit"},CSe.displayName="ExpandableOutput";let iV,TSe,PSe;nG=Ct({mode:"not-set",cellAnchor:null}),iV=Ct(void 0),lQe=Ct(!1),TSe={"Content-Type":"application/json"},PSe=/\{[^{}]+\}/g;class Tot extends Request{constructor(e,n){super(e,n);for(const r in n)r in this||(this[r]=n[r])}}function Pot(t){let{baseUrl:e="",fetch:n=globalThis.fetch,querySerializer:r,bodySerializer:o,headers:i,...a}={...t};e.endsWith("/")&&(e=e.substring(0,e.length-1)),i=DSe(TSe,i);const s=[];async function l(c,u){const{fetch:d=n,headers:f,params:h={},parseAs:g="json",querySerializer:v,bodySerializer:b=o??Eot,...p}=u||{};let O=typeof r=="function"?r:jSe(r);v&&(O=typeof v=="function"?v:jSe({...typeof r=="object"?r:{},...v}));const k={redirect:"follow",...a,...p,headers:DSe(i,f,h.header)};k.body&&(k.body=b(k.body)),k.body instanceof FormData&&k.headers.delete("Content-Type");let S=new Tot(function(j,D){var A;let N=`${D.baseUrl}${j}`;(A=D.params)!=null&&A.path&&(N=function(I,L){let F=I;for(const Q of I.match(PSe)??[]){let W=Q.substring(1,Q.length-1),U=!1,X="simple";if(W.endsWith("*")&&(U=!0,W=W.substring(0,W.length-1)),W.startsWith(".")?(X="label",W=W.substring(1)):W.startsWith(";")&&(X="matrix",W=W.substring(1)),!L||L[W]===void 0||L[W]===null)continue;const G=L[W];Array.isArray(G)?F=F.replace(Q,RSe(W,G,{style:X,explode:U})):F=typeof G!="object"?X!=="matrix"?F.replace(Q,X==="label"?`.${G}`:G):F.replace(Q,`;${Lj(W,G)}`):F.replace(Q,ESe(W,G,{style:X,explode:U}))}return F}(N,D.params.path));let E=D.querySerializer(D.params.query??{});return E.startsWith("?")&&(E=E.substring(1)),E&&(N+=`?${E}`),N}(c,{baseUrl:e,params:h,querySerializer:O}),k);const w={baseUrl:e,fetch:d,parseAs:g,querySerializer:O,bodySerializer:b};for(const j of s)if(j&&typeof j=="object"&&typeof j.onRequest=="function"){S.schemaPath=c,S.params=h;const D=await j.onRequest(S,w);if(D){if(!(D instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");S=D}}let T=await d(S);for(let j=s.length-1;j>=0;j--){const D=s[j];if(D&&typeof D=="object"&&typeof D.onResponse=="function"){const N=await D.onResponse(T,w);if(N){if(!(N instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");T=N}}}if(T.status===204||T.headers.get("Content-Length")==="0")return T.ok?{data:{},response:T}:{error:{},response:T};if(T.ok)return g==="stream"?{data:T.body,response:T}:{data:await T[g](),response:T};let P=await T.text();try{P=JSON.parse(P)}catch{}return{error:P,response:T}}return{GET:async(c,u)=>l(c,{...u,method:"GET"}),PUT:async(c,u)=>l(c,{...u,method:"PUT"}),POST:async(c,u)=>l(c,{...u,method:"POST"}),DELETE:async(c,u)=>l(c,{...u,method:"DELETE"}),OPTIONS:async(c,u)=>l(c,{...u,method:"OPTIONS"}),HEAD:async(c,u)=>l(c,{...u,method:"HEAD"}),PATCH:async(c,u)=>l(c,{...u,method:"PATCH"}),TRACE:async(c,u)=>l(c,{...u,method:"TRACE"}),use(...c){for(const u of c)if(u){if(typeof u!="object"||!("onRequest"in u)&&!("onResponse"in u))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");s.push(u)}},eject(...c){for(const u of c){const d=s.indexOf(u);d!==-1&&s.splice(d,1)}}}}function Lj(t,e,n){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${(n==null?void 0:n.allowReserved)===!0?e:encodeURIComponent(e)}`}function ESe(t,e,n){if(!e||typeof e!="object")return"";const r=[],o={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const s in e)r.push(s,n.allowReserved===!0?e[s]:encodeURIComponent(e[s]));const a=r.join(",");switch(n.style){case"form":return`${t}=${a}`;case"label":return`.${a}`;case"matrix":return`;${t}=${a}`;default:return a}}for(const a in e){const s=n.style==="deepObject"?`${t}[${a}]`:a;r.push(Lj(s,e[a],n))}const i=r.join(o);return n.style==="label"||n.style==="matrix"?`${o}${i}`:i}function RSe(t,e,n){if(!Array.isArray(e))return"";if(n.explode===!1){const i={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",a=(n.allowReserved===!0?e:e.map(s=>encodeURIComponent(s))).join(i);switch(n.style){case"simple":return a;case"label":return`.${a}`;case"matrix":return`;${t}=${a}`;default:return`${t}=${a}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",o=[];for(const i of e)n.style==="simple"||n.style==="label"?o.push(n.allowReserved===!0?i:encodeURIComponent(i)):o.push(Lj(t,i,n));return n.style==="label"||n.style==="matrix"?`${r}${o.join(r)}`:o.join(r)}function jSe(t){return function(e){const n=[];if(e&&typeof e=="object")for(const r in e){const o=e[r];o!=null&&(Array.isArray(o)?n.push(RSe(r,o,{style:"form",explode:!0,...t==null?void 0:t.array,allowReserved:(t==null?void 0:t.allowReserved)||!1})):typeof o!="object"?n.push(Lj(r,o,t)):n.push(ESe(r,o,{style:"deepObject",explode:!0,...t==null?void 0:t.object,allowReserved:(t==null?void 0:t.allowReserved)||!1})))}return n.join("&")}}function Eot(t){return JSON.stringify(t)}function DSe(...t){const e=new Headers;for(const n of t){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[o,i]of r)if(i===null)e.delete(o);else if(Array.isArray(i))for(const a of i)e.append(o,a);else i!==void 0&&e.set(o,i)}return e}function ASe(){const t=ay().httpURL;return t.search="",t.hash="",t.toString()}lO={post(t,e,n={}){const r=`${Jf.withTrailingSlash(n.baseUrl??ASe())}api${t}`;return fetch(r,{method:"POST",headers:{"Content-Type":"application/json",...lO.headers(),...n.headers},body:JSON.stringify(e)}).then(async o=>{var a;const i=(a=o.headers.get("Content-Type"))==null?void 0:a.startsWith("application/json");if(!o.ok){const s=i?await o.json():await o.text();throw new Error(o.statusText,{cause:s})}return i?o.json():o.text()}).catch(o=>{throw Ve.error(`Error requesting ${r}`,o),o})},get(t,e={}){const n=`${Jf.withTrailingSlash(e.baseUrl??ASe())}api${t}`;return fetch(n,{method:"GET",headers:{...lO.headers(),...e.headers}}).then(r=>{var o;if(!r.ok)throw new Error(r.statusText);return(o=r.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?r.json():null}).catch(r=>{throw Ve.error(`Error requesting ${n}`,r),r})},headers:()=>ay().headers(),handleResponse:t=>t.error?Promise.reject(t.error):Promise.resolve(t.data),handleResponseReturnNull:t=>t.error?Promise.reject(t.error):Promise.resolve(null)};function Rot(t){const e=Pot({baseUrl:t.httpURL.toString()});return e.use({onRequest:n=>{const r=t.headers();for(const[o,i]of Object.entries(r))n.headers.set(o,i);return n}}),e}var MSe,NSe={exports:{}},aV=(MSe||(MSe=1,function(t){var e=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(l,c){if(!i[l]){i[l]={};for(var u=0;u<l.length;u++)i[l][l.charAt(u)]=u}return i[l][c]}var s={compressToBase64:function(l){if(l==null)return"";var c=s._compress(l,6,function(u){return r.charAt(u)});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:s._decompress(l.length,32,function(c){return a(r,l.charAt(c))})},compressToUTF16:function(l){return l==null?"":s._compress(l,15,function(c){return n(c+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:s._decompress(l.length,16384,function(c){return l.charCodeAt(c)-32})},compressToUint8Array:function(l){for(var c=s.compress(l),u=new Uint8Array(2*c.length),d=0,f=c.length;d<f;d++){var h=c.charCodeAt(d);u[2*d]=h>>>8,u[2*d+1]=h%256}return u},decompressFromUint8Array:function(l){if(l==null)return s.decompress(l);for(var c=new Array(l.length/2),u=0,d=c.length;u<d;u++)c[u]=256*l[2*u]+l[2*u+1];var f=[];return c.forEach(function(h){f.push(n(h))}),s.decompress(f.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":s._compress(l,6,function(c){return o.charAt(c)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),s._decompress(l.length,32,function(c){return a(o,l.charAt(c))}))},compress:function(l){return s._compress(l,16,function(c){return n(c)})},_compress:function(l,c,u){if(l==null)return"";var d,f,h,g={},v={},b="",p="",O="",k=2,S=3,w=2,T=[],P=0,j=0;for(h=0;h<l.length;h+=1)if(b=l.charAt(h),Object.prototype.hasOwnProperty.call(g,b)||(g[b]=S++,v[b]=!0),p=O+b,Object.prototype.hasOwnProperty.call(g,p))O=p;else{if(Object.prototype.hasOwnProperty.call(v,O)){if(O.charCodeAt(0)<256){for(d=0;d<w;d++)P<<=1,j==c-1?(j=0,T.push(u(P)),P=0):j++;for(f=O.charCodeAt(0),d=0;d<8;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1}else{for(f=1,d=0;d<w;d++)P=P<<1|f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f=0;for(f=O.charCodeAt(0),d=0;d<16;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1}--k==0&&(k=Math.pow(2,w),w++),delete v[O]}else for(f=g[O],d=0;d<w;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1;--k==0&&(k=Math.pow(2,w),w++),g[p]=S++,O=String(b)}if(O!==""){if(Object.prototype.hasOwnProperty.call(v,O)){if(O.charCodeAt(0)<256){for(d=0;d<w;d++)P<<=1,j==c-1?(j=0,T.push(u(P)),P=0):j++;for(f=O.charCodeAt(0),d=0;d<8;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1}else{for(f=1,d=0;d<w;d++)P=P<<1|f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f=0;for(f=O.charCodeAt(0),d=0;d<16;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1}--k==0&&(k=Math.pow(2,w),w++),delete v[O]}else for(f=g[O],d=0;d<w;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1;--k==0&&(k=Math.pow(2,w),w++)}for(f=2,d=0;d<w;d++)P=P<<1|1&f,j==c-1?(j=0,T.push(u(P)),P=0):j++,f>>=1;for(;;){if(P<<=1,j==c-1){T.push(u(P));break}j++}return T.join("")},decompress:function(l){return l==null?"":l==""?null:s._decompress(l.length,32768,function(c){return l.charCodeAt(c)})},_decompress:function(l,c,u){var d,f,h,g,v,b,p,O=[],k=4,S=4,w=3,T="",P=[],j={val:u(0),position:c,index:1};for(d=0;d<3;d+=1)O[d]=d;for(h=0,v=Math.pow(2,2),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;switch(h){case 0:for(h=0,v=Math.pow(2,8),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;p=n(h);break;case 1:for(h=0,v=Math.pow(2,16),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;p=n(h);break;case 2:return""}for(O[3]=p,f=p,P.push(p);;){if(j.index>l)return"";for(h=0,v=Math.pow(2,w),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;switch(p=h){case 0:for(h=0,v=Math.pow(2,8),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;O[S++]=n(h),p=S-1,k--;break;case 1:for(h=0,v=Math.pow(2,16),b=1;b!=v;)g=j.val&j.position,j.position>>=1,j.position==0&&(j.position=c,j.val=u(j.index++)),h|=(g>0?1:0)*b,b<<=1;O[S++]=n(h),p=S-1,k--;break;case 2:return P.join("")}if(k==0&&(k=Math.pow(2,w),w++),O[p])T=O[p];else{if(p!==S)return null;T=f+f.charAt(0)}P.push(T),O[S++]=f+T.charAt(0),f=T,--k==0&&(k=Math.pow(2,w),w++)}}};return s}();t!=null?t.exports=e:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e})}(NSe)),NSe.exports);zH=function(t){const{code:e,baseUrl:n="https://marimo.app"}=t,r=new URL(n);if(e){const o=aV.compressToEncodedURIComponent(e);r.hash=`#code/${o}`}return r.href};let sV,lV,$Se,ISe,QSe,LSe,zSe;eG=Ct("Initializing..."),YIe=Ct(t=>{const e=t(ur),n=Object.values(e.cellRuntime);return!!n.some(r=>!pG(r.output))||n.every(r=>r.status==="idle")}),sV="marimo:file",lV=new uK(null),$Se={saveFile(t){lV.set(sV,t)},readFile:()=>lV.get(sV)},ISe={saveFile(t){My.setCodeForHash(aV.compressToEncodedURIComponent(t))},readFile(){const t=My.getCodeFromHash()||My.getCodeFromSearchParam();return t?aV.decompressFromEncodedURIComponent(t):null}},QSe={saveFile(t){},readFile(){const t=document.querySelector("marimo-code");return t?decodeURIComponent(t.textContent||"").trim():null}},LSe={saveFile(t){},readFile(){if(window.location.hostname!=="marimo.app")return null;const t=new URL("files/wasm-intro.py",document.baseURI);return fetch(t.toString()).then(e=>e.ok?e.text():null).catch(()=>null)}},zSe={saveFile(t){},readFile:()=>["import marimo","app = marimo.App()","","@app.cell","def __():"," return","",'if __name__ == "__main__":'," app.run()"].join(`
|
237
237
|
`)};class VSe{constructor(e){this.stores=e}insert(e,n){this.stores.splice(e,0,n)}saveFile(e){this.stores.forEach(n=>n.saveFile(e))}readFile(){for(const e of this.stores){const n=e.readFile();if(n)return n}return null}}const zj=new VSe([QSe,ISe]),cV=new VSe([$Se,LSe,zSe]);gM=class{static get INSTANCE(){const t="_marimo_private_PyodideBridge";return window[t]||(window[t]=new gM),window[t]}getSaveWorker(){return aT()==="read"?(Ve.debug("Skipping SaveWorker in read-mode"),{readFile:Ii,readNotebook:Ii,saveNotebook:Ii}):ele(new Worker(new URL(""+new URL("save-worker-B8gk1S9x.js",import.meta.url).href,import.meta.url),{type:"module",name:XM()})).proxy.request}constructor(){if(this.rpc=void 0,this.saveRpc=void 0,this.interruptBuffer=void 0,this.messageConsumer=void 0,this.initialized=new Xw,this.sendRename=async({filename:e})=>(e===null||(My.setFilename(e),await this.rpc.proxy.request.bridge({functionName:"rename_file",payload:e})),null),this.sendSave=async e=>{if(!this.saveRpc)return Ve.warn("Save RPC not initialized"),null;await this.saveRpc.saveNotebook(e);const n=await this.readCode();return n.contents&&(zj.saveFile(n.contents),cV.saveFile(n.contents)),this.rpc.proxy.request.saveNotebook(e).catch(r=>{Ve.error(r)}),null},this.sendCopy=async()=>{Ii()},this.sendStdin=async e=>(await this.rpc.proxy.request.bridge({functionName:"put_input",payload:e.text}),null),this.sendPdb=async()=>{Ii()},this.sendRun=async e=>(await this.rpc.proxy.request.loadPackages(e.codes.join(`
|
238
238
|
`)),await this.putControlRequest(e),null),this.sendRunScratchpad=async e=>(await this.rpc.proxy.request.loadPackages(e.code),await this.putControlRequest(e),null),this.sendInterrupt=async()=>(this.interruptBuffer!==void 0&&(this.interruptBuffer[0]=2),null),this.sendShutdown=async()=>(window.close(),null),this.sendFormat=async e=>await this.rpc.proxy.request.bridge({functionName:"format",payload:e}),this.sendDeleteCell=async e=>(await this.putControlRequest(e),null),this.sendInstallMissingPackages=async e=>(this.putControlRequest(e),null),this.sendCodeCompletionRequest=async e=>(Ht.get(RH)||await this.rpc.proxy.request.bridge({functionName:"code_complete",payload:e}),null),this.saveUserConfig=async e=>(await this.rpc.proxy.request.bridge({functionName:"save_user_config",payload:e}),lO.post("/kernel/save_user_config",e,{baseUrl:"/"}).catch(n=>(Ve.error(n),null))),this.saveAppConfig=async e=>(await this.rpc.proxy.request.bridge({functionName:"save_app_config",payload:e}),null),this.saveCellConfig=async e=>(await this.putControlRequest(e),null),this.sendRestart=async()=>{const e=await this.readCode();return e.contents&&(zj.saveFile(e.contents),cV.saveFile(e.contents)),WY(),null},this.readCode=async()=>this.saveRpc?{contents:await this.saveRpc.readNotebook()}:(Ve.warn("Save RPC not initialized"),{contents:""}),this.readSnippets=async()=>await this.rpc.proxy.request.bridge({functionName:"read_snippets",payload:void 0}),this.openFile=async({path:e})=>{const n=zH({code:null,baseUrl:window.location.origin});return window.open(n,"_blank"),null},this.sendListFiles=async e=>await this.rpc.proxy.request.bridge({functionName:"list_files",payload:e}),this.sendComponentValues=async e=>(await this.putControlRequest({...e,token:CM()}),null),this.sendInstantiate=async e=>null,this.sendFunctionRequest=async e=>(await this.putControlRequest(e),null),this.sendCreateFileOrFolder=async e=>await this.rpc.proxy.request.bridge({functionName:"create_file_or_directory",payload:e}),this.sendDeleteFileOrFolder=async e=>await this.rpc.proxy.request.bridge({functionName:"delete_file_or_directory",payload:e}),this.sendRenameFileOrFolder=async e=>await this.rpc.proxy.request.bridge({functionName:"move_file_or_directory",payload:e}),this.sendUpdateFile=async e=>await this.rpc.proxy.request.bridge({functionName:"update_file",payload:e}),this.sendFileDetails=async e=>await this.rpc.proxy.request.bridge({functionName:"file_details",payload:e}),this.exportAsHTML=async e=>await this.rpc.proxy.request.bridge({functionName:"export_html",payload:e}),this.exportAsMarkdown=async e=>await this.rpc.proxy.request.bridge({functionName:"export_markdown",payload:e}),this.previewDatasetColumn=async e=>(await this.putControlRequest(e),null),this.previewSQLTable=async e=>(await this.putControlRequest(e),null),this.previewSQLTableList=async e=>(await this.putControlRequest(e),null),this.previewDataSourceConnection=async e=>(await this.putControlRequest(e),null),this.sendModelValue=async e=>(await this.putControlRequest(e),null),this.syncCellIds=()=>Promise.resolve(null),this.getUsageStats=Ii,this.openTutorial=Ii,this.getRecentFiles=Ii,this.getWorkspaceFiles=Ii,this.getRunningNotebooks=Ii,this.shutdownSession=Ii,this.autoExportAsHTML=Ii,this.autoExportAsMarkdown=Ii,this.autoExportAsIPYNB=Ii,this.addPackage=async e=>this.rpc.proxy.request.addPackage(e),this.removePackage=async e=>this.rpc.proxy.request.removePackage(e),this.getPackageList=async()=>await this.rpc.proxy.request.listPackages(),this.getDependencyTree=async()=>({tree:void 0}),this.listSecretKeys=async e=>(await this.putControlRequest(e),null),this.writeSecret=async e=>(await this.putControlRequest(e),null),this.invokeAiTool=Ii,!Vh())return;const t=new Worker(new URL(""+new URL("worker-Ch6cKXnI.js",import.meta.url).href,import.meta.url),{type:"module",name:XM()});this.rpc=ele(t),this.rpc.addMessageListener("ready",()=>{this.startSession()}),this.rpc.addMessageListener("initialized",()=>{this.saveRpc=this.getSaveWorker(),this.setInterruptBuffer(),this.initialized.resolve()}),this.rpc.addMessageListener("initializingMessage",({message:e})=>{Ht.set(eG,e)}),this.rpc.addMessageListener("initializedError",({error:e})=>{this.initialized.status==="resolved"&&(Ve.error(e),Kr({title:"Error initializing",description:e,variant:"danger"})),this.initialized.reject(new Error(e))}),this.rpc.addMessageListener("kernelMessage",({message:e})=>{var n;(n=this.messageConsumer)==null||n.call(this,e)})}async startSession(){const t=await zj.readFile(),e=await cV.readFile(),n=My.getFilename(),r=Ht.get(vy),o={},i=new URLSearchParams(window.location.search);for(const a of i.keys()){const s=i.getAll(a);o[a]=s.length===1?s[0]:s}await this.rpc.proxy.request.startSession({queryParameters:o,code:t||e||"",filename:n,userConfig:{...r,runtime:{...r.runtime,auto_instantiate:aT()==="read"||r.runtime.auto_instantiate}}})}setInterruptBuffer(){crossOriginIsolated?(this.interruptBuffer=new Uint8Array(new SharedArrayBuffer(1)),this.rpc.proxy.request.setInterruptBuffer(this.interruptBuffer)):Ve.warn("Not running in a secure context; interrupts are not available.")}consumeMessages(t){this.messageConsumer=t,this.rpc.proxy.send.consumerReady({})}async putControlRequest(t){await this.rpc.proxy.request.bridge({functionName:"put_control_request",payload:t})}},xQe=class{constructor(t){this.bridge=t,this.CONNECTING=WebSocket.CONNECTING,this.OPEN=WebSocket.OPEN,this.CLOSING=WebSocket.CLOSING,this.CLOSED=WebSocket.CLOSED,this.binaryType="blob",this.bufferedAmount=0,this.extensions="",this.protocol="",this.url="",this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this.openSubscriptions=new Set,this.closeSubscriptions=new Set,this.messageSubscriptions=new Set,this.errorSubscriptions=new Set,this.dispatchEvent=Ii,this.reconnect=Ii,this.send=Ii,this.readyState=WebSocket.OPEN,this.retryCount=0,this.shouldReconnect=!1}consumeMessages(){this.bridge.consumeMessages(t=>{this.messageSubscriptions.forEach(e=>{e({data:t})})})}addEventListener(t,e,n){switch(t){case"open":this.openSubscriptions.add(e),e();break;case"close":this.closeSubscriptions.add(e);break;case"message":this.messageSubscriptions.add(e),this.consumeMessages();break;case"error":this.errorSubscriptions.add(e)}}removeEventListener(t,e,n){switch(t){case"open":this.openSubscriptions.delete(e);break;case"close":this.closeSubscriptions.delete(e);break;case"message":this.messageSubscriptions.delete(e);break;case"error":this.errorSubscriptions.delete(e)}}close(){}};const{handleResponse:Ko,handleResponseReturnNull:Pr}=lO;let qSe,FSe,BSe,WSe,USe,uV,ZSe,pb;({sendComponentValues:jIe,sendModelValue:qSe,sendRename:FSe,sendRestart:eLe,syncCellIds:y8e,sendSave:sLe,sendCopy:J6e,sendStdin:c8e,sendFormat:BSe,sendInterrupt:DLe,sendShutdown:LQe,sendRun:qM,sendRunScratchpad:D8e,sendInstantiate:kQe,sendDeleteCell:H6e,sendCodeCompletionRequest:WSe,saveUserConfig:bG,saveAppConfig:EQe,saveCellConfig:K6e,sendFunctionRequest:USe,sendInstallMissingPackages:f8e,readCode:wLe,readSnippets:A8e,previewDatasetColumn:uV,previewSQLTable:wQe,previewSQLTableList:OQe,previewDataSourceConnection:M8e,openFile:HJ,getUsageStats:o8e,sendPdb:ZSe,sendListFiles:SLe,sendCreateFileOrFolder:XJ,sendDeleteFileOrFolder:S8e,sendRenameFileOrFolder:B8e,sendUpdateFile:F8e,sendFileDetails:$Qe,openTutorial:NIe,getRecentFiles:QIe,getWorkspaceFiles:WIe,getRunningNotebooks:LIe,shutdownSession:FIe,exportAsHTML:aQe,exportAsMarkdown:kLe,autoExportAsHTML:_Le,autoExportAsMarkdown:CLe,autoExportAsIPYNB:TLe,addPackage:OG,removePackage:R8e,getPackageList:AQe,getDependencyTree:P8e,listSecretKeys:SQe,writeSecret:Z6e,invokeAiTool:s8e}=function(t){const e={sendComponentValues:"Failed update value",sendModelValue:"Failed to update model value",sendInstantiate:"Failed to instantiate",sendFunctionRequest:"Failed to send function request",sendRestart:"Failed to restart",syncCellIds:"Failed to sync cell IDs",sendRun:"Failed to run",sendRunScratchpad:"Failed to run scratchpad",sendRename:"Failed to rename",sendSave:"Failed to save",sendCopy:"Failed to copy",sendInterrupt:"Failed to interrupt",sendShutdown:"Failed to shutdown",sendFormat:"Failed to format",sendDeleteCell:"Failed to delete cell",sendCodeCompletionRequest:"Failed to complete code",saveUserConfig:"Failed to save user config",saveAppConfig:"Failed to save app config",saveCellConfig:"Failed to save cell config",sendStdin:"Failed to send stdin",readCode:"Failed to read code",readSnippets:"Failed to fetch snippets",previewDatasetColumn:"Failed to fetch data sources",previewSQLTable:"Failed to fetch SQL table",previewSQLTableList:"Failed to fetch SQL table list",previewDataSourceConnection:"Failed to preview data source connection",openFile:"Failed to open file",getUsageStats:"",sendListFiles:"Failed to list files",sendPdb:"Failed to start debug session",sendCreateFileOrFolder:"Failed to create file or folder",sendDeleteFileOrFolder:"Failed to delete file or folder",sendRenameFileOrFolder:"Failed to rename file or folder",sendUpdateFile:"Failed to update file",sendFileDetails:"Failed to get file details",openTutorial:"Failed to open tutorial",sendInstallMissingPackages:"Failed to install missing packages",getRecentFiles:"Failed to get recent files",getWorkspaceFiles:"Failed to get workspace files",getRunningNotebooks:"Failed to get running notebooks",shutdownSession:"Failed to shutdown session",exportAsHTML:"Failed to export HTML",exportAsMarkdown:"Failed to export Markdown",autoExportAsHTML:"",autoExportAsMarkdown:"",autoExportAsIPYNB:"",addPackage:"Failed to add package",removePackage:"Failed to remove package",getPackageList:"Failed to get package list",getDependencyTree:"Failed to get dependency tree",listSecretKeys:"Failed to fetch secrets",writeSecret:"Failed to write secret",invokeAiTool:"Failed to invoke AI tool"},n={};for(const[r,o]of Object.entries(t)){const i=r;n[i]=async(...a)=>{try{return await o(...a)}catch(s){const l=e[i],c=q_(s);throw l&&Kr({title:l,description:c,variant:"danger"}),Ve.error(`Failed to handle request: ${r}`,s),s}}}return n}(Vh()?gM.INSTANCE:I_()?function(){const t=()=>{throw new Error("Unreachable. Expected to be in run mode")};return{sendComponentValues:async()=>(Kr({title:"Static notebook",description:"This notebook is not connected to a kernel. Any interactive elements will not work."}),Ve.log("Updating UI elements is not supported in static mode"),null),sendModelValue:async()=>(Ve.log("Updating model values is not supported in static mode"),null),sendInstantiate:async()=>(Ve.log("Viewing as static notebook"),null),sendFunctionRequest:async()=>(Kr({title:"Static notebook",description:"This notebook is not connected to a kernel. Any interactive elements will not work."}),Ve.log("Function requests are not supported in static mode"),null),sendRestart:t,syncCellIds:t,sendRun:t,sendRunScratchpad:t,sendRename:t,sendSave:t,sendCopy:t,sendInterrupt:t,sendShutdown:t,sendFormat:t,sendDeleteCell:t,sendCodeCompletionRequest:t,saveUserConfig:t,saveAppConfig:t,saveCellConfig:t,sendStdin:t,readCode:t,readSnippets:t,previewDatasetColumn:t,previewSQLTable:t,previewSQLTableList:t,previewDataSourceConnection:t,openFile:t,getUsageStats:t,sendListFiles:t,sendPdb:t,sendCreateFileOrFolder:t,sendDeleteFileOrFolder:t,sendRenameFileOrFolder:t,sendUpdateFile:t,sendFileDetails:t,openTutorial:t,sendInstallMissingPackages:t,getRecentFiles:t,getWorkspaceFiles:t,getRunningNotebooks:t,shutdownSession:t,exportAsHTML:t,exportAsMarkdown:t,autoExportAsHTML:t,autoExportAsMarkdown:t,autoExportAsIPYNB:t,addPackage:t,removePackage:t,getPackageList:t,getDependencyTree:t,listSecretKeys:t,writeSecret:t,invokeAiTool:t}}():function(){const t=bne(()=>Rot(ay()));return{sendComponentValues:e=>t().POST("/api/kernel/set_ui_element_value",{body:e}).then(Pr),sendModelValue:e=>t().POST("/api/kernel/set_model_value",{body:e}).then(Pr),sendRestart:()=>t().POST("/api/kernel/restart_session").then(Pr),syncCellIds:async e=>(await ji(),t().POST("/api/kernel/sync/cell_ids",{body:e}).then(Pr)),sendRename:e=>t().POST("/api/kernel/rename",{body:e}).then(Pr),sendSave:e=>t().POST("/api/kernel/save",{body:e,parseAs:"text"}).then(Pr),sendCopy:e=>t().POST("/api/kernel/copy",{body:e,parseAs:"text"}).then(Pr),sendFormat:e=>t().POST("/api/kernel/format",{body:e}).then(Ko),sendInterrupt:()=>t().POST("/api/kernel/interrupt").then(Pr),sendShutdown:()=>t().POST("/api/kernel/shutdown").then(Pr),sendRun:async e=>Ht.get(_K)?t().POST("/api/kernel/run",{body:e}).then(Pr):null,sendRunScratchpad:async e=>(await ji(),t().POST("/api/kernel/scratchpad/run",{body:e}).then(Pr)),sendInstantiate:async e=>(await ji(),t().POST("/api/kernel/instantiate",{body:e}).then(Pr)),sendDeleteCell:e=>t().POST("/api/kernel/delete",{body:e}).then(Pr),sendCodeCompletionRequest:async e=>(await ji(),t().POST("/api/kernel/code_autocomplete",{body:e}).then(Pr)),saveUserConfig:e=>t().POST("/api/kernel/save_user_config",{body:e}).then(Pr),saveAppConfig:e=>t().POST("/api/kernel/save_app_config",{body:e,parseAs:"text"}).then(Pr),saveCellConfig:e=>t().POST("/api/kernel/set_cell_config",{body:e}).then(Pr),sendFunctionRequest:e=>t().POST("/api/kernel/function_call",{body:e}).then(Pr),sendStdin:e=>t().POST("/api/kernel/stdin",{body:e}).then(Pr),sendInstallMissingPackages:e=>t().POST("/api/kernel/install_missing_packages",{body:e}).then(Pr),readCode:async()=>(await ji(),t().POST("/api/kernel/read_code").then(Ko)),readSnippets:async()=>(await ji(),t().GET("/api/documentation/snippets").then(Ko)),previewDatasetColumn:e=>t().POST("/api/datasources/preview_column",{body:e}).then(Pr),previewSQLTable:e=>t().POST("/api/datasources/preview_sql_table",{body:e}).then(Pr),previewSQLTableList:e=>t().POST("/api/datasources/preview_sql_table_list",{body:e}).then(Pr),previewDataSourceConnection:e=>t().POST("/api/datasources/preview_datasource_connection",{body:e}).then(Pr),openFile:async e=>(await ji(),await t().POST("/api/files/open",{body:e}).then(Pr),null),getUsageStats:async()=>(await ji(),t().GET("/api/usage").then(Ko)),sendPdb:e=>t().POST("/api/kernel/pdb/pm",{body:e}).then(Pr),sendListFiles:async e=>(await ji(),t().POST("/api/files/list_files",{body:e}).then(Ko)),sendCreateFileOrFolder:async e=>(await ji(),t().POST("/api/files/create",{body:e}).then(Ko)),sendDeleteFileOrFolder:async e=>(await ji(),t().POST("/api/files/delete",{body:e}).then(Ko)),sendRenameFileOrFolder:async e=>(await ji(),t().POST("/api/files/move",{body:e}).then(Ko)),sendUpdateFile:async e=>(await ji(),t().POST("/api/files/update",{body:e}).then(Ko)),sendFileDetails:async e=>(await ji(),t().POST("/api/files/file_details",{body:e}).then(Ko)),openTutorial:e=>t().POST("/api/home/tutorial/open",{body:e}).then(Ko),getRecentFiles:()=>t().POST("/api/home/recent_files").then(Ko),getWorkspaceFiles:e=>t().POST("/api/home/workspace_files",{body:e}).then(Ko),getRunningNotebooks:()=>t().POST("/api/home/running_notebooks").then(Ko),shutdownSession:e=>t().POST("/api/home/shutdown_session",{body:e}).then(Ko),exportAsHTML:async e=>t().POST("/api/export/html",{body:e,parseAs:"text"}).then(Ko),exportAsMarkdown:async e=>t().POST("/api/export/markdown",{body:e,parseAs:"text"}).then(Ko),autoExportAsHTML:async e=>t().POST("/api/export/auto_export/html",{body:e}).then(Pr),autoExportAsMarkdown:async e=>t().POST("/api/export/auto_export/markdown",{body:e}).then(Pr),autoExportAsIPYNB:async e=>t().POST("/api/export/auto_export/ipynb",{body:e}).then(Pr),addPackage:e=>t().POST("/api/packages/add",{body:e}).then(Ko),removePackage:e=>t().POST("/api/packages/remove",{body:e}).then(Ko),getPackageList:async()=>(await ji(),t().GET("/api/packages/list").then(Ko)),getDependencyTree:async()=>(await ji(),t().GET("/api/packages/tree").then(Ko)),listSecretKeys:async e=>(await ji(),t().POST("/api/secrets/keys",{body:e}).then(Pr)),writeSecret:async e=>t().POST("/api/secrets/create",{body:e}).then(Pr),invokeAiTool:async e=>t().POST("/api/ai/invoke_tool",{body:e}).then(Ko)}}())),bo=Lt.define({combine:t=>t[0]}),yO=Lt.define({combine:t=>t[0]}),pb=hn.define(),BM=async function(t){const e=cr.mapValues(t,r=>pf(r)),n=await BSe({codes:e,lineLength:fT().formatting.line_length});for(const[r,o]of cr.entries(n.codes)){const i=r,a=e[i],s=t[i];s&&o!==a&&(s.state.facet(bo).updateCellCode({cellId:i,code:o,formattingChange:!0}),L5(s,o))}},lLe=function(){return BM(function({cellHandles:t}){const e={};for(const[n,r]of cr.entries(t))r.current&&(e[n]=r.current.editorView);return e}(gG()))};class Vj{static create(e,n,r,o,i){return new Vj(e,n,r,o+(o<<8)+e+(n<<4)|0,i,[],[])}constructor(e,n,r,o,i,a,s){this.type=e,this.value=n,this.from=r,this.hash=o,this.end=i,this.children=a,this.positions=s,this.hashProp=[[yn.contextHash,o]]}addChild(e,n){e.prop(yn.contextHash)!=this.hash&&(e=new Hn(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(n)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new Hn(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(o,i,a)=>new Hn(Oi.none,o,i,a,this.hashProp)})}}var Et;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(Et||(Et={}));class jot{constructor(e,n){this.start=e,this.content=n,this.marks=[],this.parsers=[]}}class Dot{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return r2(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,n=0,r=0){for(let o=n;o<e;o++)r+=this.text.charCodeAt(o)==9?4-r%4:1;return r}findColumn(e){let n=0;for(let r=0;n<this.text.length&&r<e;n++)r+=this.text.charCodeAt(n)==9?4-r%4:1;return n}scrub(){if(!this.baseIndent)return this.text;let e="";for(let n=0;n<this.basePos;n++)e+=" ";return e+this.text.slice(this.basePos)}}function XSe(t,e,n){if(n.pos==n.text.length||t!=e.block&&n.indent>=e.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(t.type==Et.OrderedList?hV:fV)(n,e,!1);return r>0&&(t.type!=Et.BulletList||dV(n,e,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==t.value}const HSe={[Et.Blockquote]:(t,e,n)=>n.next==62&&(n.markers.push(ir(Et.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(ic(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0),[Et.ListItem]:(t,e,n)=>!(n.indent<n.baseIndent+t.value&&n.next>-1)&&(n.moveBaseColumn(n.baseIndent+t.value),!0),[Et.OrderedList]:XSe,[Et.BulletList]:XSe,[Et.Document]:()=>!0};function ic(t){return t==32||t==9||t==10||t==13}function r2(t,e=0){for(;e<t.length&&ic(t.charCodeAt(e));)e++;return e}function YSe(t,e,n){for(;e>n&&ic(t.charCodeAt(e-1));)e--;return e}function GSe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let n=e;n<t.text.length;n++)if(t.text.charCodeAt(n)==96)return-1}return e}function KSe(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function dV(t,e,n){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let r=1;for(let o=t.pos+1;o<t.text.length;o++){let i=t.text.charCodeAt(o);if(i==t.next)r++;else if(!ic(i))return-1}return n&&t.next==45&&t2e(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(a2e.SetextHeading)>-1||r<3?-1:1}function JSe(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function fV(t,e,n){return t.next!=45&&t.next!=43&&t.next!=42||t.pos!=t.text.length-1&&!ic(t.text.charCodeAt(t.pos+1))||!(!n||JSe(e,Et.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?-1:1}function hV(t,e,n){let r=t.pos,o=t.next;for(;o>=48&&o<=57;){if(r++,r==t.text.length)return-1;o=t.text.charCodeAt(r)}return r==t.pos||r>t.pos+9||o!=46&&o!=41||r<t.text.length-1&&!ic(t.text.charCodeAt(r+1))||n&&!JSe(e,Et.OrderedList)&&(t.skipSpace(r+1)==t.text.length||r>t.pos+1||t.next!=49)?-1:r+1-t.pos}function e2e(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let n=e-t.pos;return n>6?-1:n}function t2e(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let n=e;for(;e<t.text.length&&ic(t.text.charCodeAt(e));)e++;return e==t.text.length?n:-1}const pV=/^[ \t]*$/,n2e=/-->/,r2e=/\?>/,mV=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,n2e],[/^\s*<\?/,r2e],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,pV],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,pV]];function o2e(t,e,n){if(t.next!=60)return-1;let r=t.text.slice(t.pos);for(let o=0,i=mV.length-(n?1:0);o<i;o++)if(mV[o][0].test(r))return o;return-1}function i2e(t,e){let n=t.countIndent(e,t.pos,t.indent),r=t.countIndent(t.skipSpace(e),e,n);return r>=n+5?n+1:r}function k0(t,e,n){let r=t.length-1;r>=0&&t[r].to==e&&t[r].type==Et.CodeText?t[r].to=n:t.push(ir(Et.CodeText,e,n))}const qj={LinkReference:void 0,IndentedCode(t,e){let n=e.baseIndent+4;if(e.indent<n)return!1;let r=e.findColumn(n),o=t.lineStart+r,i=t.lineStart+e.text.length,a=[],s=[];for(k0(a,o,i);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){k0(s,t.lineStart-1,t.lineStart);for(let l of e.markers)s.push(l)}else{if(e.indent<n)break;{if(s.length){for(let c of s)c.type==Et.CodeText?k0(a,c.from,c.to):a.push(c);s=[]}k0(a,t.lineStart-1,t.lineStart);for(let c of e.markers)a.push(c);i=t.lineStart+e.text.length;let l=t.lineStart+e.findColumn(e.baseIndent+4);l<i&&k0(a,l,i)}}return s.length&&(s=s.filter(l=>l.type!=Et.CodeText),s.length&&(e.markers=s.concat(e.markers))),t.addNode(t.buffer.writeElements(a,-o).finish(Et.CodeBlock,i-o),o),!0},FencedCode(t,e){let n=GSe(e);if(n<0)return!1;let r=t.lineStart+e.pos,o=e.next,i=n-e.pos,a=e.skipSpace(n),s=YSe(e.text,e.text.length,a),l=[ir(Et.CodeMark,r,r+i)];a<s&&l.push(ir(Et.CodeInfo,t.lineStart+a,t.lineStart+s));for(let c=!0;t.nextLine()&&e.depth>=t.stack.length;c=!1){let u=e.pos;if(e.indent-e.baseIndent<4)for(;u<e.text.length&&e.text.charCodeAt(u)==o;)u++;if(u-e.pos>=i&&e.skipSpace(u)==e.text.length){for(let d of e.markers)l.push(d);l.push(ir(Et.CodeMark,t.lineStart+e.pos,t.lineStart+u)),t.nextLine();break}{c||k0(l,t.lineStart-1,t.lineStart);for(let h of e.markers)l.push(h);let d=t.lineStart+e.basePos,f=t.lineStart+e.text.length;d<f&&k0(l,d,f)}}return t.addNode(t.buffer.writeElements(l,-r).finish(Et.FencedCode,t.prevLineEnd()-r),r),!0},Blockquote(t,e){let n=KSe(e);return!(n<0)&&(t.startContext(Et.Blockquote,e.pos),t.addNode(Et.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+n),null)},HorizontalRule(t,e){if(dV(e,t,!1)<0)return!1;let n=t.lineStart+e.pos;return t.nextLine(),t.addNode(Et.HorizontalRule,n),!0},BulletList(t,e){let n=fV(e,t,!1);if(n<0)return!1;t.block.type!=Et.BulletList&&t.startContext(Et.BulletList,e.basePos,e.next);let r=i2e(e,e.pos+1);return t.startContext(Et.ListItem,e.basePos,r-e.baseIndent),t.addNode(Et.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},OrderedList(t,e){let n=hV(e,t,!1);if(n<0)return!1;t.block.type!=Et.OrderedList&&t.startContext(Et.OrderedList,e.basePos,e.text.charCodeAt(e.pos+n-1));let r=i2e(e,e.pos+n);return t.startContext(Et.ListItem,e.basePos,r-e.baseIndent),t.addNode(Et.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},ATXHeading(t,e){let n=e2e(e);if(n<0)return!1;let r=e.pos,o=t.lineStart+r,i=YSe(e.text,e.text.length,r),a=i;for(;a>r&&e.text.charCodeAt(a-1)==e.next;)a--;a!=i&&a!=r&&ic(e.text.charCodeAt(a-1))||(a=e.text.length);let s=t.buffer.write(Et.HeaderMark,0,n).writeElements(t.parser.parseInline(e.text.slice(r+n+1,a),o+n+1),-o);a<e.text.length&&s.write(Et.HeaderMark,a-r,i-r);let l=s.finish(Et.ATXHeading1-1+n,e.text.length-r);return t.nextLine(),t.addNode(l,o),!0},HTMLBlock(t,e){let n=o2e(e,0,!1);if(n<0)return!1;let r=t.lineStart+e.pos,o=mV[n][1],i=[],a=o!=pV;for(;!o.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){a=!1;break}for(let c of e.markers)i.push(c)}a&&t.nextLine();let s=o==n2e?Et.CommentBlock:o==r2e?Et.ProcessingInstructionBlock:Et.HTMLBlock,l=t.prevLineEnd();return t.addNode(t.buffer.writeElements(i,-r).finish(s,l-r),r),!0},SetextHeading:void 0};class Aot{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,n,r){if(this.stage==-1)return!1;let o=r.content+`
|
239
239
|
`+n.scrub(),i=this.advance(o);return i>-1&&i<o.length&&this.complete(e,r,i)}finish(e,n){return(this.stage==2||this.stage==3)&&r2(n.content,this.pos)==n.content.length&&this.complete(e,n,n.content.length)}complete(e,n,r){return e.addLeafElement(n,ir(Et.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(m2e(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(ir(Et.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else{if(this.stage!=1){if(this.stage==2){let n=r2(e,this.pos),r=0;if(n>this.pos){let o=p2e(e,n,this.start);if(o){let i=gV(e,o.to-this.start);i>0&&(this.nextStage(o),r=i)}}return r||(r=gV(e,this.pos)),r>0&&r<e.length?r:-1}return gV(e,this.pos)}if(!this.nextStage(h2e(e,r2(e,this.pos),this.start)))return-1}}}}function gV(t,e){for(;e<t.length;e++){let n=t.charCodeAt(e);if(n==10)break;if(!ic(n))return-1}return e}class Mot{nextLine(e,n,r){let o=n.depth<e.stack.length?-1:t2e(n),i=n.next;if(o<0)return!1;let a=ir(Et.HeaderMark,e.lineStart+n.pos,e.lineStart+o);return e.nextLine(),e.addLeafElement(r,ir(i==61?Et.SetextHeading1:Et.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),a])),!0}finish(){return!1}}const a2e={LinkReference:(t,e)=>e.content.charCodeAt(0)==91?new Aot(e):null,SetextHeading:()=>new Mot},Not=[(t,e)=>e2e(e)>=0,(t,e)=>GSe(e)>=0,(t,e)=>KSe(e)>=0,(t,e)=>fV(e,t,!0)>=0,(t,e)=>hV(e,t,!0)>=0,(t,e)=>dV(e,t,!0)>=0,(t,e)=>o2e(e,0,!0)>=0],$ot={text:"",end:0};class Iot{constructor(e,n,r,o){this.parser=e,this.input=n,this.ranges=o,this.line=new Dot,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=o[o.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=o[0].from,this.block=Vj.create(Et.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new qot(r,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let o=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!o||e.markers[r].from<o.end);){let i=e.markers[r++];this.addNode(i.type,i.from,i.to)}if(!o)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let o=r(this,e);if(o!=0){if(o==1)return null;e.forward();continue e}}break}let n=new jot(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let o=r(this,n);o&&n.parsers.push(o)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,n))break e}for(let r of n.parsers)if(r.nextLine(this,e,n))return null;n.content+=`
|
@@ -254,7 +254,7 @@ ${l}`})},[h,g]=l.split(":",2),v=a?OSe:"";let b;e[4]===Symbol.for("react.memo_cac
|
|
254
254
|
}
|
255
255
|
}`,{label:"class",detail:"definition",type:"keyword"}),To('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),To('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],RV=Wj.concat([To("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),To("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),To("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),jV=new D_,DV=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function c2(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const zit=["FunctionDeclaration"],Vit={FunctionDeclaration:c2("function"),ClassDeclaration:c2("class"),ClassExpression:()=>!0,EnumDeclaration:c2("constant"),TypeAliasDeclaration:c2("type"),NamespaceDeclaration:c2("namespace"),VariableDefinition(t,e){t.matchContext(zit)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function X2e(t,e){let n=jV.get(e);if(n)return n;let r=[],o=!0;function i(a,s){let l=t.sliceString(a.from,a.to);r.push({label:l,type:s})}return e.cursor(Yr.IncludeAnonymous).iterate(a=>{if(o)o=!1;else if(a.name){let s=Vit[a.name];if(s&&s(a,i)||DV.has(a.name))return!1}else if(a.to-a.from>8192){for(let s of X2e(t,a.node))r.push(s);return!1}}),jV.set(e,r),r}const Uj=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,AV=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function H2e(t){let e=vr(t.state).resolveInner(t.pos,-1);if(AV.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&Uj.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let o=e;o;o=o.parent)DV.has(o.name)&&(r=r.concat(X2e(t.state.doc,o)));return{options:r,from:n?e.from:t.pos,validFor:Uj}}function MV(t,e,n){var r;let o=[];for(;;){let i,a=e.firstChild;if((a==null?void 0:a.name)=="VariableName")return o.push(t(a)),{path:o.reverse(),name:n};if((a==null?void 0:a.name)!="MemberExpression"||((r=i=a.lastChild)===null||r===void 0?void 0:r.name)!="PropertyName")return null;o.push(t(i)),e=a}}function Y2e(t){let e=r=>t.state.doc.sliceString(r.from,r.to),n=vr(t.state).resolveInner(t.pos,-1);return n.name=="PropertyName"?MV(e,n.parent,e(n)):n.name!="."&&n.name!="?."||n.parent.name!="MemberExpression"?AV.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&Uj.test(e(n))?{path:[],name:e(n)}:n.name=="MemberExpression"?MV(e,n,""):t.explicit?{path:[],name:""}:null:MV(e,n.parent,"")}let NV,Zj,Xj;Js=Hh.define({name:"javascript",parser:iY.configure({props:[ff.add({IfStatement:my({except:/^\s*({|else\b)/}),TryStatement:my({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:OH,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:HO({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":my({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),Pu.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Oy,BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),NV={test:t=>/^JSX/.test(t.name),facet:rE({commentTokens:{block:{open:"{/*",close:"*/}"}}})},B_=Js.configure({dialect:"ts"},"typescript"),Zj=Js.configure({dialect:"jsx",props:[mQ.add(t=>t.isTop?[NV]:void 0)]}),Xj=Js.configure({dialect:"jsx ts",props:[mQ.add(t=>t.isTop?[NV]:void 0)]},"typescript");let G2e=t=>({label:t,type:"keyword"});const K2e="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(G2e),qit=K2e.concat(["declare","implements","private","protected","public"].map(G2e));qA=function(t={}){let e=t.jsx?t.typescript?Xj:Zj:t.typescript?B_:Js,n=t.typescript?RV.concat(qit):Wj.concat(K2e);return new ku(e,[Js.data.of({autocomplete:j_(AV,qx(n))}),Js.data.of({autocomplete:H2e}),t.jsx?eCe:[]])};function J2e(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const Fit=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),eCe=mt.inputHandler.of((t,e,n,r,o)=>{if((Fit?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Js.isActiveAt(t.state,e,-1))return!1;let i=o(),{state:a}=i,s=a.changeByRange(l=>{var c;let u,{head:d}=l,f=vr(a).resolveInner(d-1,-1);if(f.name=="JSXStartTag"&&(f=f.parent),!(a.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:l,changes:{from:d,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,g=h.parent;if(g&&h.from==d-2&&((u=J2e(a.doc,g.firstChild,d))||((c=g.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let v=`${u}>`;return{range:et.cursor(d+v.length,-1),changes:{from:d,insert:v}}}}else if(r==">"){let h=function(g){for(;;){if(g.name=="JSXOpenTag"||g.name=="JSXSelfClosingTag"||g.name=="JSXFragmentTag")return g;if(g.name=="JSXEscape"||!g.parent)return null;g=g.parent}}(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(d,d+2))&&(u=J2e(a.doc,h,d)))return{range:l,changes:{from:d,insert:`</${u}>`}}}}return{range:l}});return!s.changes.empty&&(t.dispatch([i,a.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function tCe(t,e,n,r){return n.line(t+r.line).from+e+(t==1?r.col-1:-1)}function Bit(t,e,n){let r=tCe(t.line,t.column,e,n),o={from:r,to:t.endLine!=null&&t.endColumn!=1?tCe(t.endLine,t.endColumn,e,n):r,message:t.message,source:t.ruleId?"eslint:"+t.ruleId:"eslint",severity:t.severity==1?"warning":"error"};if(t.fix){let{range:i,text:a}=t.fix,s=i[0]+n.pos-r,l=i[1]+n.pos-r;o.actions=[{name:"fix",apply(c,u){c.dispatch({changes:{from:u+s,to:u+l,insert:a},scrollIntoView:!0})}}]}return o}const Hj=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:eCe,completionPath:Y2e,esLint:function(t,e){return e||(e={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},t.getRules().forEach((n,r)=>{var o;!((o=n.meta.docs)===null||o===void 0)&&o.recommended&&(e.rules[r]=2)})),n=>{let{state:r}=n,o=[];for(let{from:i,to:a}of Js.findRegions(r)){let s=r.doc.lineAt(i),l={line:s.number-1,col:i-s.from,pos:i};for(let c of t.verify(r.sliceDoc(i,a),e))o.push(Bit(c,r.doc,l))}return o}},javascript:qA,javascriptLanguage:Js,jsxLanguage:Zj,localCompletionSource:H2e,scopeCompletionSource:function(t){let e=new Map;return n=>{let r=Y2e(n);if(!r)return null;let o=t;for(let a of r.path)if(o=o[a],!o)return null;let i=e.get(o);return i||e.set(o,i=function(a,s){let l=[],c=new Set;for(let u=0;;u++){for(let f of(Object.getOwnPropertyNames||Object.keys)(a)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(f)||c.has(f))continue;let h;c.add(f);try{h=a[f]}catch{continue}l.push({label:f,type:typeof h=="function"?/^[A-Z]/.test(f)?"class":s?"function":"method":s?"variable":"property",boost:-u})}let d=Object.getPrototypeOf(a);if(!d)return l;a=d}}(o,!r.path.length)),{from:n.pos-r.name.length,options:i,validFor:Uj}}},snippets:Wj,tsxLanguage:Xj,typescriptLanguage:B_,typescriptSnippets:RV},Symbol.toStringTag,{value:"Module"})),u2=["_blank","_self","_top","_parent"],$V=["ascii","utf-8","utf-16","latin1","latin1"],IV=["get","post","put","delete"],QV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],hl=["true","false"],rn={},Wit={a:{attrs:{href:null,ping:null,type:null,media:null,target:u2,hreflang:null}},abbr:rn,address:rn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:rn,aside:rn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:rn,base:{attrs:{href:null,target:u2}},bdi:rn,bdo:rn,blockquote:{attrs:{cite:null}},body:rn,br:rn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:QV,formmethod:IV,formnovalidate:["novalidate"],formtarget:u2,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:rn,center:rn,cite:rn,code:rn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:rn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:rn,div:rn,dl:rn,dt:rn,em:rn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:rn,figure:rn,footer:rn,form:{attrs:{action:null,name:null,"accept-charset":$V,autocomplete:["on","off"],enctype:QV,method:IV,novalidate:["novalidate"],target:u2}},h1:rn,h2:rn,h3:rn,h4:rn,h5:rn,h6:rn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:rn,hgroup:rn,hr:rn,html:{attrs:{manifest:null}},i:rn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:QV,formmethod:IV,formnovalidate:["novalidate"],formtarget:u2,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:rn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:rn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:rn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:$V,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:rn,noscript:rn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:rn,param:{attrs:{name:null,value:null}},pre:rn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:rn,rt:rn,ruby:rn,samp:rn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:$V}},section:rn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:rn,source:{attrs:{src:null,type:null,media:null}},span:rn,strong:rn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:rn,summary:rn,sup:rn,table:rn,tbody:rn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:rn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:rn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:rn,time:{attrs:{datetime:null}},title:rn,tr:rn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:rn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:rn},nCe={accesskey:null,class:null,contenteditable:hl,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:hl,autocorrect:hl,autocapitalize:hl,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":hl,"aria-autocomplete":["inline","list","both","none"],"aria-busy":hl,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":hl,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":hl,"aria-hidden":hl,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":hl,"aria-multiselectable":hl,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":hl,"aria-relevant":null,"aria-required":hl,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},rCe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of rCe)nCe[t]=null;let d2=class{constructor(t,e){this.tags=Object.assign(Object.assign({},Wit),t),this.globalAttrs=Object.assign(Object.assign({},nCe),e),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};function vb(t,e,n=t.length){if(!e)return"";let r=e.firstChild,o=r&&r.getChild("TagName");return o?t.sliceString(o.from,Math.min(o.to,n)):""}function yb(t,e=!1){for(;t;t=t.parent)if(t.name=="Element"){if(!e)return t;e=!1}return null}function oCe(t,e,n){let r=n.tags[vb(t,yb(e))];return(r==null?void 0:r.children)||n.allTags}function LV(t,e){let n=[];for(let r=yb(e);r&&!r.type.isTop;r=yb(r.parent)){let o=vb(t,r);if(o&&r.lastChild.name=="CloseTag")break;o&&n.indexOf(o)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(o)}return n}d2.default=new d2;const iCe=/^[:\-\.\w\u00b7-\uffff]*$/;function aCe(t,e,n,r,o){let i=/\s*>/.test(t.sliceDoc(o,o+5))?"":">",a=yb(n,!0);return{from:r,to:o,options:oCe(t.doc,a,e).map(s=>({label:s,type:"type"})).concat(LV(t.doc,n).map((s,l)=>({label:"/"+s,apply:"/"+s+i,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function sCe(t,e,n,r){let o=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:LV(t.doc,e).map((i,a)=>({label:i,apply:i+o,type:"type",boost:99-a})),validFor:iCe}}function lCe(t,e){let{state:n,pos:r}=e,o=vr(n).resolveInner(r,-1),i=o.resolve(r);for(let a,s=r;i==o&&(a=o.childBefore(s));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;i=o=a,s=l.from}return o.name=="TagName"?o.parent&&/CloseTag$/.test(o.parent.name)?sCe(n,o,o.from,r):aCe(n,t,o,o.from,r):o.name=="StartTag"?aCe(n,t,o,r,r):o.name=="StartCloseTag"||o.name=="IncompleteCloseTag"?sCe(n,o,r,r):o.name=="OpenTag"||o.name=="SelfClosingTag"||o.name=="AttributeName"?function(a,s,l,c,u){let d=yb(l),f=d?s.tags[vb(a.doc,d)]:null,h=f&&f.attrs?Object.keys(f.attrs):[];return{from:c,to:u,options:(f&&f.globalAttrs===!1?h:h.length?h.concat(s.globalAttrNames):s.globalAttrNames).map(g=>({label:g,type:"property"})),validFor:iCe}}(n,t,o,o.name=="AttributeName"?o.from:r,r):o.name=="Is"||o.name=="AttributeValue"||o.name=="UnquotedAttributeValue"?function(a,s,l,c,u){var d;let f,h=(d=l.parent)===null||d===void 0?void 0:d.getChild("AttributeName"),g=[];if(h){let v=a.sliceDoc(h.from,h.to),b=s.globalAttrs[v];if(!b){let p=yb(l),O=p?s.tags[vb(a.doc,p)]:null;b=(O==null?void 0:O.attrs)&&O.attrs[v]}if(b){let p=a.sliceDoc(c,u).toLowerCase(),O='"',k='"';/^['"]/.test(p)?(f=p[0]=='"'?/^[^"]*$/:/^[^']*$/,O="",k=a.sliceDoc(u,u+1)==p[0]?"":p[0],p=p.slice(1),c++):f=/^[^\s<>='"]*$/;for(let S of b)g.push({label:S,apply:O+S+k,type:"constant"})}}return{from:c,to:u,options:g,validFor:f}}(n,t,o,o.name=="Is"?r:o.from,r):!e.explicit||i.name!="Element"&&i.name!="Text"&&i.name!="Document"?null:function(a,s,l,c){let u=[],d=0;for(let f of oCe(a.doc,l,s))u.push({label:"<"+f,type:"type"});for(let f of LV(a.doc,l))u.push({label:"</"+f+">",type:"type",boost:99-d++});return{from:c,to:c,options:u,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(n,t,o,r)}BA=function(t){return lCe(d2.default,t)};function cCe(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new d2(e,n):d2.default;return o=>lCe(r,o)}const Uit=Js.parser.configure({top:"SingleExpression"}),uCe=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:B_.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:Zj.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:Xj.parser},{tag:"script",attrs:t=>/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type),parser:Uit},{tag:"script",attrs:t=>!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type),parser:Js.parser},{tag:"style",attrs:t=>(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type)),parser:Wv.parser}],dCe=[{name:"style",parser:Wv.parser.configure({top:"Styles"})}].concat(rCe.map(t=>({name:t,parser:Js.parser}))),zV=Hh.define({name:"html",parser:vit.configure({props:[ff.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag":t=>t.column(t.node.from)+t.unit,Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e,n=null;for(let r=t.node;;){let o=r.lastChild;if(!o||o.name!="Element"||o.to!=r.to)break;n=r=o}return n&&(!(e=n.lastChild)||e.name!="CloseTag"&&e.name!="SelfClosingTag")?t.lineIndent(n.from)+t.unit:null}}),Pu.add({Element(t){let e=t.firstChild,n=t.lastChild;return e&&e.name=="OpenTag"?{from:e.to,to:n.name=="CloseTag"?n.from:t.to}:null}}),yA.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),f2=zV.configure({wrap:N2e(uCe,dCe)});xN=function(t={}){let e,n="";t.matchClosingTags===!1&&(n="noMatch"),t.selfClosingTags===!0&&(n=(n?n+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(e=N2e((t.nestedLanguages||[]).concat(uCe),(t.nestedAttributes||[]).concat(dCe)));let r=e?zV.configure({wrap:e,dialect:n}):n?f2.configure({dialect:n}):f2;return new ku(r,[f2.data.of({autocomplete:cCe(t)}),t.autoCloseTags!==!1?hCe:[],qA().support,FA().support])};const fCe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),hCe=mt.inputHandler.of((t,e,n,r,o)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!f2.isActiveAt(t.state,e,-1))return!1;let i=o(),{state:a}=i,s=a.changeByRange(l=>{var c,u,d;let f,h=a.doc.sliceString(l.from-1,l.to)==r,{head:g}=l,v=vr(a).resolveInner(g,-1);if(h&&r==">"&&v.name=="EndTag"){let b=v.parent;if(((u=(c=b.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(f=vb(a.doc,b.parent,g))&&!fCe.has(f))return{range:l,changes:{from:g,to:g+(a.doc.sliceString(g,g+1)===">"?1:0),insert:`</${f}>`}}}else if(h&&r=="/"&&v.name=="IncompleteCloseTag"){let b=v.parent;if(v.from==g-2&&((d=b.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(f=vb(a.doc,b,g))&&!fCe.has(f)){let p=g+(a.doc.sliceString(g,g+1)===">"?1:0),O=`${f}>`;return{range:et.cursor(g+O.length,-1),changes:{from:g,to:p,insert:O}}}}return{range:l}});return!s.changes.empty&&(t.dispatch([i,a.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Zit=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:hCe,html:xN,htmlCompletionSource:BA,htmlCompletionSourceWith:cCe,htmlLanguage:f2,htmlPlain:zV},Symbol.toStringTag,{value:"Module"})),pCe=rE({commentTokens:{block:{open:"<!--",close:"-->"}}}),mCe=new yn,gCe=Bot.configure({props:[Pu.add(t=>!t.is("Block")||t.is("Document")||VV(t)!=null||function(e){return e.name=="OrderedList"||e.name=="BulletList"}(t)?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),mCe.add(VV),ff.add({Document:()=>null}),_p.add({Document:pCe})]});function VV(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Xit(t,e){let n=t;for(;;){let r,o=n.nextSibling;if(!o||(r=VV(o.type))!=null&&r<=e)break;n=o}return n.to}const Hit=bQ.of((t,e,n)=>{for(let r=vr(t).resolveInner(n,-1);r&&!(r.from<e);r=r.parent){let o=r.type.prop(mCe);if(o==null)continue;let i=Xit(r,o);if(i>n)return{from:n,to:i}}return null});function qV(t){return new bs(pCe,t,[Hit],"markdown")}let FV;FV=qV(gCe),Zv=qV(gCe.configure([Jot,tit,eit,nit,{props:[Pu.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));class BV{constructor(e,n,r,o,i,a,s){this.node=e,this.from=n,this.to=r,this.spaceBefore=o,this.spaceAfter=i,this.type=a,this.item=s}blank(e,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}for(let o=this.to-this.from-r.length-this.spaceAfter.length;o>0;o--)r+=" ";return r+(n?this.spaceAfter:"")}marker(e,n){let r=this.node.name=="OrderedList"?String(+yCe(this.item,e)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function vCe(t,e){let n=[],r=[];for(let o=t;o;o=o.parent){if(o.name=="FencedCode")return r;o.name!="ListItem"&&o.name!="Blockquote"||n.push(o)}for(let o=n.length-1;o>=0;o--){let i,a=n[o],s=e.lineAt(a.from),l=a.from-s.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(s.text.slice(l))))r.push(new BV(a,l,l+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(s.text.slice(l)))){let c=i[3],u=i[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),r.push(new BV(a.parent,l,l+u,i[1],c,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(s.text.slice(l)))){let c=i[4],u=i[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let d=i[2];i[3]&&(d+=i[3].replace(/[xX]/," ")),r.push(new BV(a.parent,l,l+u,i[1],c,d,a))}}return r}function yCe(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function WV(t,e,n,r=0){for(let o=-1,i=t;;){if(i.name=="ListItem"){let s=yCe(i,e),l=+s[2];if(o>=0){if(l!=o+1)return;n.push({from:i.from+s[1].length,to:i.from+s[0].length,insert:String(o+2+r)})}o=l}let a=i.nextSibling;if(!a)break;i=a}}function UV(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(gf)!=" ")return t;let r="";for(let o=zc(t,4,n);o>0;)o>=4?(r+=" ",o-=4):(r+=" ",o--);return r+t.slice(n)}const bCe=({state:t,dispatch:e})=>{let n=vr(t),{doc:r}=t,o=null,i=t.changeByRange(a=>{if(!a.empty||!Zv.isActiveAt(t,a.from,-1)&&!Zv.isActiveAt(t,a.from,1))return o={range:a};let s=a.from,l=r.lineAt(s),c=vCe(n.resolveInner(s,-1),r);for(;c.length&&c[c.length-1].from>s-l.from;)c.pop();if(!c.length)return o={range:a};let u=c[c.length-1];if(u.to-u.spaceAfter.length>s-l.from)return o={range:a};let d=s>=u.to-u.spaceAfter.length&&!/\S/.test(l.text.slice(u.to));if(u.item&&d){let b=u.node.firstChild,p=u.node.getChild("ListItem","ListItem");if(b.to>=s||p&&p.to<s||l.from>0&&!/[^\s>]/.test(r.lineAt(l.from-1).text)){let O,k=c.length>1?c[c.length-2]:null,S="";k&&k.item?(O=l.from+k.from,S=k.marker(r,1)):O=l.from+(k?k.to:0);let w=[{from:O,to:s,insert:S}];return u.node.name=="OrderedList"&&WV(u.item,r,w,-2),k&&k.node.name=="OrderedList"&&WV(k.item,r,w),{range:et.cursor(O+S.length),changes:w}}{let O=OCe(c,t,l);return{range:et.cursor(s+O.length+1),changes:{from:l.from,insert:O+t.lineBreak}}}}if(u.node.name=="Blockquote"&&d&&l.from){let b=r.lineAt(l.from-1),p=/>\s*$/.exec(b.text);if(p&&p.index==u.from){let O=t.changes([{from:b.from+p.index,to:b.to},{from:l.from+u.from,to:l.to}]);return{range:a.map(O),changes:O}}}let f=[];u.node.name=="OrderedList"&&WV(u.item,r,f);let h=u.item&&u.item.from<l.from,g="";if(!h||/^[\s\d.)\-+*>]*/.exec(l.text)[0].length>=u.to)for(let b=0,p=c.length-1;b<=p;b++)g+=b!=p||h?c[b].blank(b<p?zc(l.text,4,c[b+1].from)-g.length:null):c[b].marker(r,1);let v=s;for(;v>l.from&&/\s/.test(l.text.charAt(v-l.from-1));)v--;return g=UV(g,t),function(b,p){if(b.name!="OrderedList"&&b.name!="BulletList")return!1;let O=b.firstChild,k=b.getChild("ListItem","ListItem");if(!k)return!1;let S=p.lineAt(O.to),w=p.lineAt(k.from),T=/^[\s>]*$/.test(S.text);return S.number+(T?0:1)<w.number}(u.node,t.doc)&&(g=OCe(c,t,l)+t.lineBreak+g),f.push({from:v,to:s,insert:t.lineBreak+g}),{range:et.cursor(v+g.length+1),changes:f}});return!o&&(e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)};function xCe(t){return t.name=="QuoteMark"||t.name=="ListMark"}function OCe(t,e,n){let r="";for(let o=0,i=t.length-2;o<=i;o++)r+=t[o].blank(o<i?zc(n.text,4,t[o+1].from)-r.length:null,o<i);return UV(r,e)}const wCe=({state:t,dispatch:e})=>{let n=vr(t),r=null,o=t.changeByRange(i=>{let a=i.from,{doc:s}=t;if(i.empty&&Zv.isActiveAt(t,i.from)){let l=s.lineAt(a),c=vCe(function(u,d){let f=u.resolveInner(d,-1),h=d;xCe(f)&&(h=f.from,f=f.parent);for(let g;g=f.childBefore(h);)if(xCe(g))h=g.from;else{if(g.name!="OrderedList"&&g.name!="BulletList")break;f=g.lastChild,h=f.to}return f}(n,a),s);if(c.length){let u=c[c.length-1],d=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(a-l.from>d&&!/\S/.test(l.text.slice(d,a-l.from)))return{range:et.cursor(l.from+d),changes:{from:l.from+d,to:a}};if(a-l.from==d&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let f=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let h=u.blank(zc(l.text,4,u.to)-zc(l.text,4,u.from));return f==l.from&&(h=UV(h,t)),{range:et.cursor(f+h.length),changes:{from:f,to:l.from+u.to,insert:h}}}if(f<a)return{range:et.cursor(f),changes:{from:f,to:a}}}}}return r={range:i}});return!r&&(e(t.update(o,{scrollIntoView:!0,userEvent:"delete"})),!0)},kCe=[{key:"Enter",run:bCe},{key:"Backspace",run:wCe}],SCe=xN({matchClosingTags:!1});U_=function(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:o}=FV,completeHTMLTags:i=!0,htmlTagLanguage:a=SCe}=t;if(!(o instanceof Fj))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let s,l=t.extensions?[t.extensions]:[],c=[a.support];n instanceof ku?(c.push(n.support),s=n.language):n&&(s=n);let u=e||s?function(f,h){return g=>{if(g&&f){let v=null;if(g=/\S*/.exec(g)[0],v=typeof f=="function"?f(g):He.matchLanguageName(f,g,!0),v instanceof He)return v.support?v.support.language.parser:Ng.getSkippingParser(v.load());if(v)return v.parser}return h?h.parser:null}}(e,s):void 0;l.push(function(f){let{codeParser:h,htmlParser:g}=f;return{wrap:XO((b,p)=>{let O=b.type.id;if(!h||O!=Et.CodeBlock&&O!=Et.FencedCode){if(g&&(O==Et.HTMLBlock||O==Et.HTMLTag||O==Et.CommentBlock))return{parser:g,overlay:Wot(b.node,b.from,b.to)}}else{let k="";if(O==Et.FencedCode){let w=b.node.getChild(Et.CodeInfo);w&&(k=p.read(w.from,w.to))}let S=h(k);if(S)return{parser:S,overlay:w=>w.type.id==Et.CodeText}}return null})}}({codeParser:u,htmlParser:a.language.parser})),r&&c.push(La.high(Hi.of(kCe)));let d=qV(o.configure(l));return i&&c.push(d.data.of({autocomplete:Yit})),new ku(d,c)};function Yit(t){let{state:e,pos:n}=t,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!r)return null;let o=vr(e).resolveInner(n,-1);for(;o&&!o.type.isTop;){if(o.name=="CodeBlock"||o.name=="FencedCode"||o.name=="ProcessingInstructionBlock"||o.name=="CommentBlock"||o.name=="Link"||o.name=="Image")return null;o=o.parent}return{from:n-r[0].length,to:n,options:Git(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let ZV=null;function Git(){if(ZV)return ZV;let t=BA(new NT(Qn.create({extensions:SCe}),0,!0));return ZV=t?t.options:[]}const Kit=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:FV,deleteMarkupBackward:wCe,insertNewlineContinueMarkup:bCe,markdown:U_,markdownKeymap:kCe,markdownLanguage:Zv},Symbol.toStringTag,{value:"Module"})),CCe=new D_,_Ce=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function Yj(t){return(e,n,r)=>{if(r)return!1;let o=e.node.getChild("VariableName");return o&&n(o,t),!0}}const Jit={FunctionDefinition:Yj("function"),ClassDefinition:Yj("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:o}=t,i=((n=o.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=o.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((r=a.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(a,i?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name!="VariableName"||n&&/\*|AssignOp/.test(n.name)||e(r,"variable"),n=r},CapturePattern:Yj("variable"),AsPattern:Yj("variable"),__proto__:null};function TCe(t,e){let n=CCe.get(e);if(n)return n;let r=[],o=!0;function i(a,s){let l=t.sliceString(a.from,a.to);r.push({label:l,type:s})}return e.cursor(Yr.IncludeAnonymous).iterate(a=>{if(a.name){let s=Jit[a.name];if(s&&s(a,i,o)||!o&&_Ce.has(a.name))return!1;o=!1}else if(a.to-a.from>8192){for(let s of TCe(t,a.node))r.push(s);return!1}}),CCe.set(e,r),r}const PCe=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,ECe=["String","FormatString","Comment","PropertyName"];function XV(t){let e=vr(t.state).resolveInner(t.pos,-1);if(ECe.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&PCe.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let o=e;o;o=o.parent)_Ce.has(o.name)&&(r=r.concat(TCe(t.state.doc,o)));return{options:r,from:n?e.from:t.pos,validFor:PCe}}const eat=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),tat=[To("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),To("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),To("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),To("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),To(`if \${}:
|
256
256
|
|
257
|
-
`,{label:"if",detail:"block",type:"keyword"}),To("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),To("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),To("import ${module}",{label:"import",detail:"statement",type:"keyword"}),To("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],HV=j_(ECe,qx(eat.concat(tat)));function YV(t){let{node:e,pos:n}=t,r=t.lineIndent(n,-1),o=null;for(;;){let i=e.childBefore(n);if(!i)break;if(i.name=="Comment")n=i.from;else if(i.name=="Body"||i.name=="MatchBody")t.baseIndentFor(i)+t.unit<=r&&(o=i),e=i;else if(i.name=="MatchClause")e=i;else{if(!i.type.is("Statement"))break;e=i}}return o}function GV(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),o=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.to<o+100&&!/\S/.test(t.state.sliceDoc(o,t.node.to))&&t.lineIndent(t.pos,-1)<=n||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>n?null:n+t.unit}const S0=Hh.define({name:"python",parser:GL.configure({props:[ff.add({Body:t=>{var e;return(e=GV(t,/^\s*(#|$)/.test(t.textAfter)&&YV(t)||t.node))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;return(e=GV(t,YV(t)||t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":HO({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":HO({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":HO({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let n=YV(t);return(e=n&&GV(t,n))!==null&&e!==void 0?e:t.continue()}}),Pu.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Oy,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)}),"String FormatString":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});X_=function(){return new ku(S0,[S0.data.of({autocomplete:XV}),S0.data.of({autocomplete:HV})])};const nat=Object.freeze(Object.defineProperty({__proto__:null,globalCompletion:HV,localCompletionSource:XV,python:X_,pythonLanguage:S0},Symbol.toStringTag,{value:"Module"}));function ft(t){return new ku(W_.define(t))}function um(t){return Be(()=>Promise.resolve().then(()=>zPe),void 0,import.meta.url).then(e=>e.sql({dialect:e[t]}))}vY=[He.of({name:"C",extensions:["c","h","ino"],load:()=>Be(()=>import("./index-Bag1r9_Q.js"),[],import.meta.url).then(t=>t.cpp())}),He.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:()=>Be(()=>import("./index-Bag1r9_Q.js"),[],import.meta.url).then(t=>t.cpp())}),He.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:()=>um("Cassandra")}),He.of({name:"CSS",extensions:["css"],load:()=>Be(()=>Promise.resolve().then(()=>Mit),void 0,import.meta.url).then(t=>t.css())}),He.of({name:"Go",extensions:["go"],load:()=>Be(()=>import("./index-BjkzVBO7.js"),[],import.meta.url).then(t=>t.go())}),He.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:()=>Be(()=>Promise.resolve().then(()=>Zit),void 0,import.meta.url).then(t=>t.html())}),He.of({name:"Java",extensions:["java"],load:()=>Be(()=>import("./index-Ddu3wzma.js"),[],import.meta.url).then(t=>t.java())}),He.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:()=>Be(()=>Promise.resolve().then(()=>Hj),void 0,import.meta.url).then(t=>t.javascript())}),He.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:()=>Be(()=>import("./index-DCz0X3Y4.js"),[],import.meta.url).then(t=>t.json())}),He.of({name:"JSX",extensions:["jsx"],load:()=>Be(()=>Promise.resolve().then(()=>Hj),void 0,import.meta.url).then(t=>t.javascript({jsx:!0}))}),He.of({name:"LESS",extensions:["less"],load:()=>Be(()=>import("./index-RJoX-C-2.js"),[],import.meta.url).then(t=>t.less())}),He.of({name:"Liquid",extensions:["liquid"],load:()=>Be(()=>import("./index-C0XAgNv1.js"),[],import.meta.url).then(t=>t.liquid())}),He.of({name:"MariaDB SQL",load:()=>um("MariaSQL")}),He.of({name:"Markdown",extensions:["md","markdown","mkd"],load:()=>Be(()=>Promise.resolve().then(()=>Kit),void 0,import.meta.url).then(t=>t.markdown())}),He.of({name:"MS SQL",load:()=>um("MSSQL")}),He.of({name:"MySQL",load:()=>um("MySQL")}),He.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:()=>Be(()=>import("./index-C-CHLZew.js"),[],import.meta.url).then(t=>t.php())}),He.of({name:"PLSQL",extensions:["pls"],load:()=>um("PLSQL")}),He.of({name:"PostgreSQL",load:()=>um("PostgreSQL")}),He.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:()=>Be(()=>Promise.resolve().then(()=>nat),void 0,import.meta.url).then(t=>t.python())}),He.of({name:"Rust",extensions:["rs"],load:()=>Be(()=>import("./index-C7-lgjl6.js"),[],import.meta.url).then(t=>t.rust())}),He.of({name:"Sass",extensions:["sass"],load:()=>Be(()=>import("./index-DFK72NL3.js"),[],import.meta.url).then(t=>t.sass({indented:!0}))}),He.of({name:"SCSS",extensions:["scss"],load:()=>Be(()=>import("./index-DFK72NL3.js"),[],import.meta.url).then(t=>t.sass())}),He.of({name:"SQL",extensions:["sql"],load:()=>um("StandardSQL")}),He.of({name:"SQLite",load:()=>um("SQLite")}),He.of({name:"TSX",extensions:["tsx"],load:()=>Be(()=>Promise.resolve().then(()=>Hj),void 0,import.meta.url).then(t=>t.javascript({jsx:!0,typescript:!0}))}),He.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:()=>Be(()=>Promise.resolve().then(()=>Hj),void 0,import.meta.url).then(t=>t.javascript({typescript:!0}))}),He.of({name:"WebAssembly",extensions:["wat","wast"],load:()=>Be(()=>import("./index-CQAeNpoe.js"),[],import.meta.url).then(t=>t.wast())}),He.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:()=>Be(()=>import("./index-Dp1sPfMw.js"),[],import.meta.url).then(t=>t.xml())}),He.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:()=>Be(()=>import("./index-Dc4sdxuJ.js"),[],import.meta.url).then(t=>t.yaml())}),He.of({name:"APL",extensions:["dyalog","apl"],load:()=>Be(()=>import("./apl-CXdQSnD-.js"),[],import.meta.url).then(t=>ft(t.apl))}),He.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:()=>Be(()=>import("./asciiarmor-D5V0T9Cu.js"),[],import.meta.url).then(t=>ft(t.asciiArmor))}),He.of({name:"ASN.1",extensions:["asn","asn1"],load:()=>Be(()=>import("./asn1-DWPaVWf6.js"),[],import.meta.url).then(t=>ft(t.asn1({})))}),He.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:()=>Be(()=>import("./asterisk-B46aRdXb.js"),[],import.meta.url).then(t=>ft(t.asterisk))}),He.of({name:"Brainfuck",extensions:["b","bf"],load:()=>Be(()=>import("./brainfuck-CtZaYBKt.js"),[],import.meta.url).then(t=>ft(t.brainfuck))}),He.of({name:"Cobol",extensions:["cob","cpy"],load:()=>Be(()=>import("./cobol-stawOqaz.js"),[],import.meta.url).then(t=>ft(t.cobol))}),He.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.csharp))}),He.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:()=>Be(()=>import("./clojure-DiuoqK-z.js"),[],import.meta.url).then(t=>ft(t.clojure))}),He.of({name:"ClojureScript",extensions:["cljs"],load:()=>Be(()=>import("./clojure-DiuoqK-z.js"),[],import.meta.url).then(t=>ft(t.clojure))}),He.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:()=>Be(()=>import("./css-ZjFoif2m.js"),[],import.meta.url).then(t=>ft(t.gss))}),He.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:()=>Be(()=>import("./cmake-DXn5xaP-.js"),[],import.meta.url).then(t=>ft(t.cmake))}),He.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:()=>Be(()=>import("./coffeescript-BTDxI-eT.js"),[],import.meta.url).then(t=>ft(t.coffeeScript))}),He.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:()=>Be(()=>import("./commonlisp-vq6DHwts.js"),[],import.meta.url).then(t=>ft(t.commonLisp))}),He.of({name:"Cypher",extensions:["cyp","cypher"],load:()=>Be(()=>import("./cypher-gJDei3ni.js"),[],import.meta.url).then(t=>ft(t.cypher))}),He.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:()=>Be(()=>import("./python-DD-Q2bae.js"),[],import.meta.url).then(t=>ft(t.cython))}),He.of({name:"Crystal",extensions:["cr"],load:()=>Be(()=>import("./crystal-CRzZ78HM.js"),[],import.meta.url).then(t=>ft(t.crystal))}),He.of({name:"D",extensions:["d"],load:()=>Be(()=>import("./d-BShv7fp-.js"),[],import.meta.url).then(t=>ft(t.d))}),He.of({name:"Dart",extensions:["dart"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.dart))}),He.of({name:"diff",extensions:["diff","patch"],load:()=>Be(()=>import("./diff-UJJ5BM9S.js"),[],import.meta.url).then(t=>ft(t.diff))}),He.of({name:"Dockerfile",filename:/^Dockerfile$/,load:()=>Be(()=>import("./dockerfile-knGOOxt4.js"),__vite__mapDeps([27,28]),import.meta.url).then(t=>ft(t.dockerFile))}),He.of({name:"DTD",extensions:["dtd"],load:()=>Be(()=>import("./dtd-DI9Herc-.js"),[],import.meta.url).then(t=>ft(t.dtd))}),He.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:()=>Be(()=>import("./dylan-DkEP81N9.js"),[],import.meta.url).then(t=>ft(t.dylan))}),He.of({name:"EBNF",load:()=>Be(()=>import("./ebnf-B-Df8AvO.js"),[],import.meta.url).then(t=>ft(t.ebnf))}),He.of({name:"ECL",extensions:["ecl"],load:()=>Be(()=>import("./ecl-DPFc0Uaf.js"),[],import.meta.url).then(t=>ft(t.ecl))}),He.of({name:"edn",extensions:["edn"],load:()=>Be(()=>import("./clojure-DiuoqK-z.js"),[],import.meta.url).then(t=>ft(t.clojure))}),He.of({name:"Eiffel",extensions:["e"],load:()=>Be(()=>import("./eiffel-DR5c0IrL.js"),[],import.meta.url).then(t=>ft(t.eiffel))}),He.of({name:"Elm",extensions:["elm"],load:()=>Be(()=>import("./elm-DompmV0j.js"),[],import.meta.url).then(t=>ft(t.elm))}),He.of({name:"Erlang",extensions:["erl"],load:()=>Be(()=>import("./erlang-BuqgqA5h.js"),[],import.meta.url).then(t=>ft(t.erlang))}),He.of({name:"Esper",load:()=>Be(()=>import("./sql-B3SPsWL6.js"),[],import.meta.url).then(t=>ft(t.esper))}),He.of({name:"Factor",extensions:["factor"],load:()=>Be(()=>import("./factor-CFXhaUWb.js"),__vite__mapDeps([36,28]),import.meta.url).then(t=>ft(t.factor))}),He.of({name:"FCL",load:()=>Be(()=>import("./fcl-CVaBTCzQ.js"),[],import.meta.url).then(t=>ft(t.fcl))}),He.of({name:"Forth",extensions:["forth","fth","4th"],load:()=>Be(()=>import("./forth-POgR1ypr.js"),[],import.meta.url).then(t=>ft(t.forth))}),He.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:()=>Be(()=>import("./fortran-DL7KluxX.js"),[],import.meta.url).then(t=>ft(t.fortran))}),He.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:()=>Be(()=>import("./mllike-3c2dg9RT.js"),[],import.meta.url).then(t=>ft(t.fSharp))}),He.of({name:"Gas",extensions:["s"],load:()=>Be(()=>import("./gas-bV0CklSb.js"),[],import.meta.url).then(t=>ft(t.gas))}),He.of({name:"Gherkin",extensions:["feature"],load:()=>Be(()=>import("./gherkin-B6X1vGSW.js"),[],import.meta.url).then(t=>ft(t.gherkin))}),He.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:()=>Be(()=>import("./groovy-DnIzCrpZ.js"),[],import.meta.url).then(t=>ft(t.groovy))}),He.of({name:"Haskell",extensions:["hs"],load:()=>Be(()=>import("./haskell-CLQs6EAM.js"),[],import.meta.url).then(t=>ft(t.haskell))}),He.of({name:"Haxe",extensions:["hx"],load:()=>Be(()=>import("./haxe-D25e-2l-.js"),[],import.meta.url).then(t=>ft(t.haxe))}),He.of({name:"HXML",extensions:["hxml"],load:()=>Be(()=>import("./haxe-D25e-2l-.js"),[],import.meta.url).then(t=>ft(t.hxml))}),He.of({name:"HTTP",load:()=>Be(()=>import("./http-BKJkqRj4.js"),[],import.meta.url).then(t=>ft(t.http))}),He.of({name:"IDL",extensions:["pro"],load:()=>Be(()=>import("./idl-pcmmZuaN.js"),[],import.meta.url).then(t=>ft(t.idl))}),He.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:()=>Be(()=>import("./javascript-BpzJj0-u.js"),[],import.meta.url).then(t=>ft(t.jsonld))}),He.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load:()=>Be(()=>import("./jinja2-DhgKlfW7.js"),[],import.meta.url).then(t=>ft(t.jinja2))}),He.of({name:"Julia",extensions:["jl"],load:()=>Be(()=>import("./julia-DjdwvFuI.js"),[],import.meta.url).then(t=>ft(t.julia))}),He.of({name:"Kotlin",extensions:["kt","kts"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.kotlin))}),He.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:()=>Be(()=>import("./livescript-HO6ttBFx.js"),[],import.meta.url).then(t=>ft(t.liveScript))}),He.of({name:"Lua",extensions:["lua"],load:()=>Be(()=>import("./lua-8DXOpKDz.js"),[],import.meta.url).then(t=>ft(t.lua))}),He.of({name:"mIRC",extensions:["mrc"],load:()=>Be(()=>import("./mirc-DkvFAiy5.js"),[],import.meta.url).then(t=>ft(t.mirc))}),He.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:()=>Be(()=>import("./mathematica-IIbmv7SK.js"),[],import.meta.url).then(t=>ft(t.mathematica))}),He.of({name:"Modelica",extensions:["mo"],load:()=>Be(()=>import("./modelica-DSrSSXCg.js"),[],import.meta.url).then(t=>ft(t.modelica))}),He.of({name:"MUMPS",extensions:["mps"],load:()=>Be(()=>import("./mumps-zvxmGV4l.js"),[],import.meta.url).then(t=>ft(t.mumps))}),He.of({name:"Mbox",extensions:["mbox"],load:()=>Be(()=>import("./mbox-z_N2Mo3d.js"),[],import.meta.url).then(t=>ft(t.mbox))}),He.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:()=>Be(()=>import("./nginx-B4hAVlXN.js"),[],import.meta.url).then(t=>ft(t.nginx))}),He.of({name:"NSIS",extensions:["nsh","nsi"],load:()=>Be(()=>import("./nsis-BvKfQ9lQ.js"),__vite__mapDeps([58,28]),import.meta.url).then(t=>ft(t.nsis))}),He.of({name:"NTriples",extensions:["nt","nq"],load:()=>Be(()=>import("./ntriples-BSwWqoLa.js"),[],import.meta.url).then(t=>ft(t.ntriples))}),He.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.objectiveC))}),He.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.objectiveCpp))}),He.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:()=>Be(()=>import("./mllike-3c2dg9RT.js"),[],import.meta.url).then(t=>ft(t.oCaml))}),He.of({name:"Octave",extensions:["m"],load:()=>Be(()=>import("./octave-C4hdQ5Hf.js"),[],import.meta.url).then(t=>ft(t.octave))}),He.of({name:"Oz",extensions:["oz"],load:()=>Be(()=>import("./oz-qQq7irPq.js"),[],import.meta.url).then(t=>ft(t.oz))}),He.of({name:"Pascal",extensions:["p","pas"],load:()=>Be(()=>import("./pascal-CafrKXZF.js"),[],import.meta.url).then(t=>ft(t.pascal))}),He.of({name:"Perl",extensions:["pl","pm"],load:()=>Be(()=>import("./perl-tdMlh9QA.js"),[],import.meta.url).then(t=>ft(t.perl))}),He.of({name:"Pig",extensions:["pig"],load:()=>Be(()=>import("./pig-CwGJVRC4.js"),[],import.meta.url).then(t=>ft(t.pig))}),He.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:()=>Be(()=>import("./powershell-D1ly3AHC.js"),[],import.meta.url).then(t=>ft(t.powerShell))}),He.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:()=>Be(()=>import("./properties-_nPj978X.js"),[],import.meta.url).then(t=>ft(t.properties))}),He.of({name:"ProtoBuf",extensions:["proto"],load:()=>Be(()=>import("./protobuf-B4y9do6W.js"),[],import.meta.url).then(t=>ft(t.protobuf))}),He.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:()=>Be(()=>import("./pug-BTvK5tSS.js"),__vite__mapDeps([114,115]),import.meta.url).then(t=>ft(t.pug))}),He.of({name:"Puppet",extensions:["pp"],load:()=>Be(()=>import("./puppet-Bc-yJKzi.js"),[],import.meta.url).then(t=>ft(t.puppet))}),He.of({name:"Q",extensions:["q"],load:()=>Be(()=>import("./q-B0kTJ4cI.js"),[],import.meta.url).then(t=>ft(t.q))}),He.of({name:"R",alias:["rscript"],extensions:["r","R"],load:()=>Be(()=>import("./r-BA4EbLKE.js"),[],import.meta.url).then(t=>ft(t.r))}),He.of({name:"RPM Changes",load:()=>Be(()=>import("./rpm-DI_rRufH.js"),[],import.meta.url).then(t=>ft(t.rpmChanges))}),He.of({name:"RPM Spec",extensions:["spec"],load:()=>Be(()=>import("./rpm-DI_rRufH.js"),[],import.meta.url).then(t=>ft(t.rpmSpec))}),He.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:()=>Be(()=>import("./ruby-CR-u2WLS.js"),[],import.meta.url).then(t=>ft(t.ruby))}),He.of({name:"SAS",extensions:["sas"],load:()=>Be(()=>import("./sas-Bqaci40L.js"),[],import.meta.url).then(t=>ft(t.sas))}),He.of({name:"Scala",extensions:["scala"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.scala))}),He.of({name:"Scheme",extensions:["scm","ss"],load:()=>Be(()=>import("./scheme-qjP0V5Ag.js"),[],import.meta.url).then(t=>ft(t.scheme))}),He.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:()=>Be(()=>import("./shell-BLav31RL.js"),[],import.meta.url).then(t=>ft(t.shell))}),He.of({name:"Sieve",extensions:["siv","sieve"],load:()=>Be(()=>import("./sieve-r025o_jW.js"),[],import.meta.url).then(t=>ft(t.sieve))}),He.of({name:"Smalltalk",extensions:["st"],load:()=>Be(()=>import("./smalltalk-C7J3IyEP.js"),[],import.meta.url).then(t=>ft(t.smalltalk))}),He.of({name:"Solr",load:()=>Be(()=>import("./solr-78MBEUkU.js"),[],import.meta.url).then(t=>ft(t.solr))}),He.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:()=>Be(()=>import("./mllike-3c2dg9RT.js"),[],import.meta.url).then(t=>ft(t.sml))}),He.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:()=>Be(()=>import("./sparql-BRLJFz69.js"),[],import.meta.url).then(t=>ft(t.sparql))}),He.of({name:"Spreadsheet",alias:["excel","formula"],load:()=>Be(()=>import("./spreadsheet-CGlWr0eM.js"),[],import.meta.url).then(t=>ft(t.spreadsheet))}),He.of({name:"Squirrel",extensions:["nut"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.squirrel))}),He.of({name:"Stylus",extensions:["styl"],load:()=>Be(()=>import("./stylus-Bdo_Aemu.js"),[],import.meta.url).then(t=>ft(t.stylus))}),He.of({name:"Swift",extensions:["swift"],load:()=>Be(()=>import("./swift-B_XXVlXX.js"),[],import.meta.url).then(t=>ft(t.swift))}),He.of({name:"sTeX",load:()=>Be(()=>Promise.resolve().then(()=>JV),void 0,import.meta.url).then(t=>ft(t.stex))}),He.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:()=>Be(()=>Promise.resolve().then(()=>JV),void 0,import.meta.url).then(t=>ft(t.stex))}),He.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:()=>Be(()=>import("./verilog-B4LBqg_1.js"),[],import.meta.url).then(t=>ft(t.verilog))}),He.of({name:"Tcl",extensions:["tcl"],load:()=>Be(()=>import("./tcl-B2fODqDH.js"),[],import.meta.url).then(t=>ft(t.tcl))}),He.of({name:"Textile",extensions:["textile"],load:()=>Be(()=>import("./textile-BuVhTOzU.js"),[],import.meta.url).then(t=>ft(t.textile))}),He.of({name:"TiddlyWiki",load:()=>Be(()=>import("./tiddlywiki-BgR6AEZu.js"),[],import.meta.url).then(t=>ft(t.tiddlyWiki))}),He.of({name:"Tiki wiki",load:()=>Be(()=>import("./tiki-CI-ztowC.js"),[],import.meta.url).then(t=>ft(t.tiki))}),He.of({name:"TOML",extensions:["toml"],load:()=>Be(()=>import("./toml-wcPdHu67.js"),[],import.meta.url).then(t=>ft(t.toml))}),He.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:()=>Be(()=>import("./troff-Ce85hlLp.js"),[],import.meta.url).then(t=>ft(t.troff))}),He.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:()=>Be(()=>import("./ttcn-BxnYHtq8.js"),[],import.meta.url).then(t=>ft(t.ttcn))}),He.of({name:"TTCN_CFG",extensions:["cfg"],load:()=>Be(()=>import("./ttcn-cfg-CKJxb-l2.js"),[],import.meta.url).then(t=>ft(t.ttcnCfg))}),He.of({name:"Turtle",extensions:["ttl"],load:()=>Be(()=>import("./turtle-BkSuIpt-.js"),[],import.meta.url).then(t=>ft(t.turtle))}),He.of({name:"Web IDL",extensions:["webidl"],load:()=>Be(()=>import("./webidl-CGwyPRYs.js"),[],import.meta.url).then(t=>ft(t.webIDL))}),He.of({name:"VB.NET",extensions:["vb"],load:()=>Be(()=>import("./vb-BHgjm0DN.js"),[],import.meta.url).then(t=>ft(t.vb))}),He.of({name:"VBScript",extensions:["vbs"],load:()=>Be(()=>import("./vbscript-Dawdd5GZ.js"),[],import.meta.url).then(t=>ft(t.vbScript))}),He.of({name:"Velocity",extensions:["vtl"],load:()=>Be(()=>import("./velocity-BdD_26Jv.js"),[],import.meta.url).then(t=>ft(t.velocity))}),He.of({name:"Verilog",extensions:["v"],load:()=>Be(()=>import("./verilog-B4LBqg_1.js"),[],import.meta.url).then(t=>ft(t.verilog))}),He.of({name:"VHDL",extensions:["vhd","vhdl"],load:()=>Be(()=>import("./vhdl-CWWH2SUo.js"),[],import.meta.url).then(t=>ft(t.vhdl))}),He.of({name:"XQuery",extensions:["xy","xquery"],load:()=>Be(()=>import("./xquery-CVDBqZPY.js"),[],import.meta.url).then(t=>ft(t.xQuery))}),He.of({name:"Yacas",extensions:["ys"],load:()=>Be(()=>import("./yacas-I8QjZlxf.js"),[],import.meta.url).then(t=>ft(t.yacas))}),He.of({name:"Z80",extensions:["z80"],load:()=>Be(()=>import("./z80-D8p3gKXp.js"),[],import.meta.url).then(t=>ft(t.z80))}),He.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:()=>Be(()=>import("./mscgen-B2igx18G.js"),[],import.meta.url).then(t=>ft(t.mscgen))}),He.of({name:"X\xF9",extensions:["xu"],load:()=>Be(()=>import("./mscgen-B2igx18G.js"),[],import.meta.url).then(t=>ft(t.xu))}),He.of({name:"MsGenny",extensions:["msgenny"],load:()=>Be(()=>import("./mscgen-B2igx18G.js"),[],import.meta.url).then(t=>ft(t.msgenny))}),He.of({name:"Vue",extensions:["vue"],load:()=>Be(()=>import("./index-CLyZb28E.js"),[],import.meta.url).then(t=>t.vue())}),He.of({name:"Angular Template",load:()=>Be(()=>import("./index-C6NvbO5G.js"),[],import.meta.url).then(t=>t.angular())})];function RCe(t){function e(c,u){c.cmdState.push(u)}function n(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function r(c,u,d){return function(){this.name=c,this.bracketNo=0,this.style=u,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var o={};function i(c,u){c.f=u}function a(c,u){var d;if(c.match(/^\\[a-zA-Z@\xc0-\u1fff\u2060-\uffff]+/)){var f=c.current().slice(1);return e(u,d=new(d=o.hasOwnProperty(f)?o[f]:o.DEFAULT)),i(u,l),d.style}if(c.match(/^\\[$&%#{}_]/)||c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return i(u,function(g,v){return s(g,v,"\\]")}),"keyword";if(c.match("\\("))return i(u,function(g,v){return s(g,v,"\\)")}),"keyword";if(c.match("$$"))return i(u,function(g,v){return s(g,v,"$$")}),"keyword";if(c.match("$"))return i(u,function(g,v){return s(g,v,"$")}),"keyword";var h=c.next();return h=="%"?(c.skipToEnd(),"comment"):h=="}"||h=="]"?(d=n(u))?(d.closeBracket(h),i(u,l),"bracket"):"error":h=="{"||h=="["?(e(u,d=new(d=o.DEFAULT)),"bracket"):/\d/.test(h)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=function(g){for(var v=g.cmdState,b=v.length-1;b>=0;b--){var p=v[b];if(p.name!="DEFAULT")return p}return{styleIdentifier:function(){return null}}}(u),d.name=="begin"&&(d.argument=c.current()),d.styleIdentifier())}function s(c,u,d){if(c.eatSpace())return null;if(d&&c.match(d))return i(u,a),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variableName.special";if(c.match(/^\\[$&%#{}_]/)||c.match(/^\\[,;!\/]/)||c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var f=c.next();return f=="{"||f=="}"||f=="["||f=="]"||f=="("||f==")"?"bracket":f=="%"?(c.skipToEnd(),"comment"):"error"}function l(c,u){var d=c.peek();return d=="{"||d=="["?(n(u).openBracket(d),c.eat(d),i(u,a),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(i(u,a),function(f){var h=f.cmdState.pop();h&&h.closeBracket()}(u),a(c,u))}return o.importmodule=r("importmodule","tag",["string","builtin"]),o.documentclass=r("documentclass","tag",["","atom"]),o.usepackage=r("usepackage","tag",["atom"]),o.begin=r("begin","tag",["atom"]),o.end=r("end","tag",["atom"]),o.label=r("label","tag",["atom"]),o.ref=r("ref","tag",["atom"]),o.eqref=r("eqref","tag",["atom"]),o.cite=r("cite","tag",["atom"]),o.bibitem=r("bibitem","tag",["atom"]),o.Bibitem=r("Bibitem","tag",["atom"]),o.RBibitem=r("RBibitem","tag",["atom"]),o.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{name:"stex",startState:function(){return{cmdState:[],f:t?function(c,u){return s(c,u)}:a}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,u){return u.f(c,u)},blankLine:function(c){c.f=a,c.cmdState.length=0},languageData:{commentTokens:{line:"%"}}}}let KV,JV,eq,jCe,DCe,ACe,MCe,Gj,tq,nq,NCe,rq,$Ce;gY=RCe(!1),KV=RCe(!0),JV=Object.freeze(Object.defineProperty({__proto__:null,stex:gY,stexMath:KV},Symbol.toStringTag,{value:"Module"})),eq=new WeakMap,jCe=/(\n|\r\n?|\u2028|\u2029)/g,DCe=/^\s*/,ACe=/\S/,MCe=Array.prototype.slice,Gj=48,tq=57,nq=97,NCe=102,rq=65,$Ce=70,TT=function(t){if(typeof t=="string")return LCe([t])[0];if(typeof t=="function")return function(){const r=MCe.call(arguments);return r[0]=QCe(r[0]),t.apply(this,r)};const e=QCe(t);let n=ICe(e,0);for(let r=1;r<e.length;r++)n+=arguments[r]+ICe(e,r);return n};function ICe(t,e){const n=t[e];if(n===void 0)throw new TypeError(`invalid cooked string at index ${e}`);return n}function QCe(t){const e=eq.get(t);if(e)return e;const n=LCe(t.raw),r=n.map(oat);return Object.defineProperty(r,"raw",{value:Object.freeze(n)}),Object.freeze(r),eq.set(t,r),r}function LCe(t){const e=t.map(o=>o.split(jCe));let n;for(let o=0;o<e.length;o++){const i=e[o],a=o===0,s=o+1===e.length;if(a){if(i.length===1||i[0].length>0)throw new Error("invalid content on opening line");i[1]=""}if(s){if(i.length===1||ACe.test(i[i.length-1]))throw new Error("invalid content on closing line");i[i.length-2]="",i[i.length-1]=""}for(let l=2;l<i.length;l+=2){const c=i[l],u=l+1===i.length&&!s,d=DCe.exec(c)[0];u||d.length!==c.length?n=rat(d,n):i[l]=""}}const r=n?n.length:0;return e.map(o=>{let i=o[0];for(let a=1;a<o.length;a+=2)i+=o[a]+o[a+1].slice(r);return i})}function rat(t,e){if(e===void 0||t===e)return t;let n=0;for(const r=Math.min(t.length,e.length);n<r&&t[n]===e[n];n++);return t.slice(0,n)}function oat(t){let e="",n=0,r=0;for(;(r=t.indexOf("\\",r))>-1;){if(e+=t.slice(n,r),++r===t.length)return;const o=t[r++];switch(o){case"b":e+="\b";break;case"t":e+=" ";break;case"n":e+=`
|
257
|
+
`,{label:"if",detail:"block",type:"keyword"}),To("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),To("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),To("import ${module}",{label:"import",detail:"statement",type:"keyword"}),To("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],HV=j_(ECe,qx(eat.concat(tat)));function YV(t){let{node:e,pos:n}=t,r=t.lineIndent(n,-1),o=null;for(;;){let i=e.childBefore(n);if(!i)break;if(i.name=="Comment")n=i.from;else if(i.name=="Body"||i.name=="MatchBody")t.baseIndentFor(i)+t.unit<=r&&(o=i),e=i;else if(i.name=="MatchClause")e=i;else{if(!i.type.is("Statement"))break;e=i}}return o}function GV(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),o=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.to<o+100&&!/\S/.test(t.state.sliceDoc(o,t.node.to))&&t.lineIndent(t.pos,-1)<=n||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>n?null:n+t.unit}const S0=Hh.define({name:"python",parser:GL.configure({props:[ff.add({Body:t=>{var e;return(e=GV(t,/^\s*(#|$)/.test(t.textAfter)&&YV(t)||t.node))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;return(e=GV(t,YV(t)||t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":HO({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":HO({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":HO({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let n=YV(t);return(e=n&&GV(t,n))!==null&&e!==void 0?e:t.continue()}}),Pu.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":Oy,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)}),"String FormatString":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});X_=function(){return new ku(S0,[S0.data.of({autocomplete:XV}),S0.data.of({autocomplete:HV})])};const nat=Object.freeze(Object.defineProperty({__proto__:null,globalCompletion:HV,localCompletionSource:XV,python:X_,pythonLanguage:S0},Symbol.toStringTag,{value:"Module"}));function ft(t){return new ku(W_.define(t))}function um(t){return Be(()=>Promise.resolve().then(()=>zPe),void 0,import.meta.url).then(e=>e.sql({dialect:e[t]}))}vY=[He.of({name:"C",extensions:["c","h","ino"],load:()=>Be(()=>import("./index-Vmv0ToTw.js"),[],import.meta.url).then(t=>t.cpp())}),He.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:()=>Be(()=>import("./index-Vmv0ToTw.js"),[],import.meta.url).then(t=>t.cpp())}),He.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:()=>um("Cassandra")}),He.of({name:"CSS",extensions:["css"],load:()=>Be(()=>Promise.resolve().then(()=>Mit),void 0,import.meta.url).then(t=>t.css())}),He.of({name:"Go",extensions:["go"],load:()=>Be(()=>import("./index-5B-sx3j8.js"),[],import.meta.url).then(t=>t.go())}),He.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:()=>Be(()=>Promise.resolve().then(()=>Zit),void 0,import.meta.url).then(t=>t.html())}),He.of({name:"Java",extensions:["java"],load:()=>Be(()=>import("./index-BX2T3HSi.js"),[],import.meta.url).then(t=>t.java())}),He.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:()=>Be(()=>Promise.resolve().then(()=>Hj),void 0,import.meta.url).then(t=>t.javascript())}),He.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:()=>Be(()=>import("./index-C4feBLZi.js"),[],import.meta.url).then(t=>t.json())}),He.of({name:"JSX",extensions:["jsx"],load:()=>Be(()=>Promise.resolve().then(()=>Hj),void 0,import.meta.url).then(t=>t.javascript({jsx:!0}))}),He.of({name:"LESS",extensions:["less"],load:()=>Be(()=>import("./index-DRbvA3Xm.js"),[],import.meta.url).then(t=>t.less())}),He.of({name:"Liquid",extensions:["liquid"],load:()=>Be(()=>import("./index-B4ATKjy5.js"),[],import.meta.url).then(t=>t.liquid())}),He.of({name:"MariaDB SQL",load:()=>um("MariaSQL")}),He.of({name:"Markdown",extensions:["md","markdown","mkd"],load:()=>Be(()=>Promise.resolve().then(()=>Kit),void 0,import.meta.url).then(t=>t.markdown())}),He.of({name:"MS SQL",load:()=>um("MSSQL")}),He.of({name:"MySQL",load:()=>um("MySQL")}),He.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:()=>Be(()=>import("./index-BAslNTpY.js"),[],import.meta.url).then(t=>t.php())}),He.of({name:"PLSQL",extensions:["pls"],load:()=>um("PLSQL")}),He.of({name:"PostgreSQL",load:()=>um("PostgreSQL")}),He.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:()=>Be(()=>Promise.resolve().then(()=>nat),void 0,import.meta.url).then(t=>t.python())}),He.of({name:"Rust",extensions:["rs"],load:()=>Be(()=>import("./index-DlmVfCE0.js"),[],import.meta.url).then(t=>t.rust())}),He.of({name:"Sass",extensions:["sass"],load:()=>Be(()=>import("./index-CDmkkP_w.js"),[],import.meta.url).then(t=>t.sass({indented:!0}))}),He.of({name:"SCSS",extensions:["scss"],load:()=>Be(()=>import("./index-CDmkkP_w.js"),[],import.meta.url).then(t=>t.sass())}),He.of({name:"SQL",extensions:["sql"],load:()=>um("StandardSQL")}),He.of({name:"SQLite",load:()=>um("SQLite")}),He.of({name:"TSX",extensions:["tsx"],load:()=>Be(()=>Promise.resolve().then(()=>Hj),void 0,import.meta.url).then(t=>t.javascript({jsx:!0,typescript:!0}))}),He.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:()=>Be(()=>Promise.resolve().then(()=>Hj),void 0,import.meta.url).then(t=>t.javascript({typescript:!0}))}),He.of({name:"WebAssembly",extensions:["wat","wast"],load:()=>Be(()=>import("./index-Bk2Jwznm.js"),[],import.meta.url).then(t=>t.wast())}),He.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:()=>Be(()=>import("./index-CVshR3YC.js"),[],import.meta.url).then(t=>t.xml())}),He.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:()=>Be(()=>import("./index-Bnzx_XD_.js"),[],import.meta.url).then(t=>t.yaml())}),He.of({name:"APL",extensions:["dyalog","apl"],load:()=>Be(()=>import("./apl-CXdQSnD-.js"),[],import.meta.url).then(t=>ft(t.apl))}),He.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:()=>Be(()=>import("./asciiarmor-D5V0T9Cu.js"),[],import.meta.url).then(t=>ft(t.asciiArmor))}),He.of({name:"ASN.1",extensions:["asn","asn1"],load:()=>Be(()=>import("./asn1-DWPaVWf6.js"),[],import.meta.url).then(t=>ft(t.asn1({})))}),He.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:()=>Be(()=>import("./asterisk-B46aRdXb.js"),[],import.meta.url).then(t=>ft(t.asterisk))}),He.of({name:"Brainfuck",extensions:["b","bf"],load:()=>Be(()=>import("./brainfuck-CtZaYBKt.js"),[],import.meta.url).then(t=>ft(t.brainfuck))}),He.of({name:"Cobol",extensions:["cob","cpy"],load:()=>Be(()=>import("./cobol-stawOqaz.js"),[],import.meta.url).then(t=>ft(t.cobol))}),He.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.csharp))}),He.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:()=>Be(()=>import("./clojure-DiuoqK-z.js"),[],import.meta.url).then(t=>ft(t.clojure))}),He.of({name:"ClojureScript",extensions:["cljs"],load:()=>Be(()=>import("./clojure-DiuoqK-z.js"),[],import.meta.url).then(t=>ft(t.clojure))}),He.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:()=>Be(()=>import("./css-ZjFoif2m.js"),[],import.meta.url).then(t=>ft(t.gss))}),He.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:()=>Be(()=>import("./cmake-DXn5xaP-.js"),[],import.meta.url).then(t=>ft(t.cmake))}),He.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:()=>Be(()=>import("./coffeescript-BTDxI-eT.js"),[],import.meta.url).then(t=>ft(t.coffeeScript))}),He.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:()=>Be(()=>import("./commonlisp-vq6DHwts.js"),[],import.meta.url).then(t=>ft(t.commonLisp))}),He.of({name:"Cypher",extensions:["cyp","cypher"],load:()=>Be(()=>import("./cypher-gJDei3ni.js"),[],import.meta.url).then(t=>ft(t.cypher))}),He.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:()=>Be(()=>import("./python-DD-Q2bae.js"),[],import.meta.url).then(t=>ft(t.cython))}),He.of({name:"Crystal",extensions:["cr"],load:()=>Be(()=>import("./crystal-CRzZ78HM.js"),[],import.meta.url).then(t=>ft(t.crystal))}),He.of({name:"D",extensions:["d"],load:()=>Be(()=>import("./d-BShv7fp-.js"),[],import.meta.url).then(t=>ft(t.d))}),He.of({name:"Dart",extensions:["dart"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.dart))}),He.of({name:"diff",extensions:["diff","patch"],load:()=>Be(()=>import("./diff-UJJ5BM9S.js"),[],import.meta.url).then(t=>ft(t.diff))}),He.of({name:"Dockerfile",filename:/^Dockerfile$/,load:()=>Be(()=>import("./dockerfile-knGOOxt4.js"),__vite__mapDeps([27,28]),import.meta.url).then(t=>ft(t.dockerFile))}),He.of({name:"DTD",extensions:["dtd"],load:()=>Be(()=>import("./dtd-DI9Herc-.js"),[],import.meta.url).then(t=>ft(t.dtd))}),He.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:()=>Be(()=>import("./dylan-DkEP81N9.js"),[],import.meta.url).then(t=>ft(t.dylan))}),He.of({name:"EBNF",load:()=>Be(()=>import("./ebnf-B-Df8AvO.js"),[],import.meta.url).then(t=>ft(t.ebnf))}),He.of({name:"ECL",extensions:["ecl"],load:()=>Be(()=>import("./ecl-DPFc0Uaf.js"),[],import.meta.url).then(t=>ft(t.ecl))}),He.of({name:"edn",extensions:["edn"],load:()=>Be(()=>import("./clojure-DiuoqK-z.js"),[],import.meta.url).then(t=>ft(t.clojure))}),He.of({name:"Eiffel",extensions:["e"],load:()=>Be(()=>import("./eiffel-DR5c0IrL.js"),[],import.meta.url).then(t=>ft(t.eiffel))}),He.of({name:"Elm",extensions:["elm"],load:()=>Be(()=>import("./elm-DompmV0j.js"),[],import.meta.url).then(t=>ft(t.elm))}),He.of({name:"Erlang",extensions:["erl"],load:()=>Be(()=>import("./erlang-BuqgqA5h.js"),[],import.meta.url).then(t=>ft(t.erlang))}),He.of({name:"Esper",load:()=>Be(()=>import("./sql-B3SPsWL6.js"),[],import.meta.url).then(t=>ft(t.esper))}),He.of({name:"Factor",extensions:["factor"],load:()=>Be(()=>import("./factor-CFXhaUWb.js"),__vite__mapDeps([36,28]),import.meta.url).then(t=>ft(t.factor))}),He.of({name:"FCL",load:()=>Be(()=>import("./fcl-CVaBTCzQ.js"),[],import.meta.url).then(t=>ft(t.fcl))}),He.of({name:"Forth",extensions:["forth","fth","4th"],load:()=>Be(()=>import("./forth-POgR1ypr.js"),[],import.meta.url).then(t=>ft(t.forth))}),He.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:()=>Be(()=>import("./fortran-DL7KluxX.js"),[],import.meta.url).then(t=>ft(t.fortran))}),He.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:()=>Be(()=>import("./mllike-3c2dg9RT.js"),[],import.meta.url).then(t=>ft(t.fSharp))}),He.of({name:"Gas",extensions:["s"],load:()=>Be(()=>import("./gas-bV0CklSb.js"),[],import.meta.url).then(t=>ft(t.gas))}),He.of({name:"Gherkin",extensions:["feature"],load:()=>Be(()=>import("./gherkin-B6X1vGSW.js"),[],import.meta.url).then(t=>ft(t.gherkin))}),He.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:()=>Be(()=>import("./groovy-DnIzCrpZ.js"),[],import.meta.url).then(t=>ft(t.groovy))}),He.of({name:"Haskell",extensions:["hs"],load:()=>Be(()=>import("./haskell-CLQs6EAM.js"),[],import.meta.url).then(t=>ft(t.haskell))}),He.of({name:"Haxe",extensions:["hx"],load:()=>Be(()=>import("./haxe-D25e-2l-.js"),[],import.meta.url).then(t=>ft(t.haxe))}),He.of({name:"HXML",extensions:["hxml"],load:()=>Be(()=>import("./haxe-D25e-2l-.js"),[],import.meta.url).then(t=>ft(t.hxml))}),He.of({name:"HTTP",load:()=>Be(()=>import("./http-BKJkqRj4.js"),[],import.meta.url).then(t=>ft(t.http))}),He.of({name:"IDL",extensions:["pro"],load:()=>Be(()=>import("./idl-pcmmZuaN.js"),[],import.meta.url).then(t=>ft(t.idl))}),He.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:()=>Be(()=>import("./javascript-BpzJj0-u.js"),[],import.meta.url).then(t=>ft(t.jsonld))}),He.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load:()=>Be(()=>import("./jinja2-DhgKlfW7.js"),[],import.meta.url).then(t=>ft(t.jinja2))}),He.of({name:"Julia",extensions:["jl"],load:()=>Be(()=>import("./julia-DjdwvFuI.js"),[],import.meta.url).then(t=>ft(t.julia))}),He.of({name:"Kotlin",extensions:["kt","kts"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.kotlin))}),He.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:()=>Be(()=>import("./livescript-HO6ttBFx.js"),[],import.meta.url).then(t=>ft(t.liveScript))}),He.of({name:"Lua",extensions:["lua"],load:()=>Be(()=>import("./lua-8DXOpKDz.js"),[],import.meta.url).then(t=>ft(t.lua))}),He.of({name:"mIRC",extensions:["mrc"],load:()=>Be(()=>import("./mirc-DkvFAiy5.js"),[],import.meta.url).then(t=>ft(t.mirc))}),He.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:()=>Be(()=>import("./mathematica-IIbmv7SK.js"),[],import.meta.url).then(t=>ft(t.mathematica))}),He.of({name:"Modelica",extensions:["mo"],load:()=>Be(()=>import("./modelica-DSrSSXCg.js"),[],import.meta.url).then(t=>ft(t.modelica))}),He.of({name:"MUMPS",extensions:["mps"],load:()=>Be(()=>import("./mumps-zvxmGV4l.js"),[],import.meta.url).then(t=>ft(t.mumps))}),He.of({name:"Mbox",extensions:["mbox"],load:()=>Be(()=>import("./mbox-z_N2Mo3d.js"),[],import.meta.url).then(t=>ft(t.mbox))}),He.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:()=>Be(()=>import("./nginx-B4hAVlXN.js"),[],import.meta.url).then(t=>ft(t.nginx))}),He.of({name:"NSIS",extensions:["nsh","nsi"],load:()=>Be(()=>import("./nsis-BvKfQ9lQ.js"),__vite__mapDeps([58,28]),import.meta.url).then(t=>ft(t.nsis))}),He.of({name:"NTriples",extensions:["nt","nq"],load:()=>Be(()=>import("./ntriples-BSwWqoLa.js"),[],import.meta.url).then(t=>ft(t.ntriples))}),He.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.objectiveC))}),He.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.objectiveCpp))}),He.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:()=>Be(()=>import("./mllike-3c2dg9RT.js"),[],import.meta.url).then(t=>ft(t.oCaml))}),He.of({name:"Octave",extensions:["m"],load:()=>Be(()=>import("./octave-C4hdQ5Hf.js"),[],import.meta.url).then(t=>ft(t.octave))}),He.of({name:"Oz",extensions:["oz"],load:()=>Be(()=>import("./oz-qQq7irPq.js"),[],import.meta.url).then(t=>ft(t.oz))}),He.of({name:"Pascal",extensions:["p","pas"],load:()=>Be(()=>import("./pascal-CafrKXZF.js"),[],import.meta.url).then(t=>ft(t.pascal))}),He.of({name:"Perl",extensions:["pl","pm"],load:()=>Be(()=>import("./perl-tdMlh9QA.js"),[],import.meta.url).then(t=>ft(t.perl))}),He.of({name:"Pig",extensions:["pig"],load:()=>Be(()=>import("./pig-CwGJVRC4.js"),[],import.meta.url).then(t=>ft(t.pig))}),He.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:()=>Be(()=>import("./powershell-D1ly3AHC.js"),[],import.meta.url).then(t=>ft(t.powerShell))}),He.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:()=>Be(()=>import("./properties-_nPj978X.js"),[],import.meta.url).then(t=>ft(t.properties))}),He.of({name:"ProtoBuf",extensions:["proto"],load:()=>Be(()=>import("./protobuf-B4y9do6W.js"),[],import.meta.url).then(t=>ft(t.protobuf))}),He.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:()=>Be(()=>import("./pug-BTvK5tSS.js"),__vite__mapDeps([114,115]),import.meta.url).then(t=>ft(t.pug))}),He.of({name:"Puppet",extensions:["pp"],load:()=>Be(()=>import("./puppet-Bc-yJKzi.js"),[],import.meta.url).then(t=>ft(t.puppet))}),He.of({name:"Q",extensions:["q"],load:()=>Be(()=>import("./q-B0kTJ4cI.js"),[],import.meta.url).then(t=>ft(t.q))}),He.of({name:"R",alias:["rscript"],extensions:["r","R"],load:()=>Be(()=>import("./r-BA4EbLKE.js"),[],import.meta.url).then(t=>ft(t.r))}),He.of({name:"RPM Changes",load:()=>Be(()=>import("./rpm-DI_rRufH.js"),[],import.meta.url).then(t=>ft(t.rpmChanges))}),He.of({name:"RPM Spec",extensions:["spec"],load:()=>Be(()=>import("./rpm-DI_rRufH.js"),[],import.meta.url).then(t=>ft(t.rpmSpec))}),He.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:()=>Be(()=>import("./ruby-CR-u2WLS.js"),[],import.meta.url).then(t=>ft(t.ruby))}),He.of({name:"SAS",extensions:["sas"],load:()=>Be(()=>import("./sas-Bqaci40L.js"),[],import.meta.url).then(t=>ft(t.sas))}),He.of({name:"Scala",extensions:["scala"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.scala))}),He.of({name:"Scheme",extensions:["scm","ss"],load:()=>Be(()=>import("./scheme-qjP0V5Ag.js"),[],import.meta.url).then(t=>ft(t.scheme))}),He.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:()=>Be(()=>import("./shell-BLav31RL.js"),[],import.meta.url).then(t=>ft(t.shell))}),He.of({name:"Sieve",extensions:["siv","sieve"],load:()=>Be(()=>import("./sieve-r025o_jW.js"),[],import.meta.url).then(t=>ft(t.sieve))}),He.of({name:"Smalltalk",extensions:["st"],load:()=>Be(()=>import("./smalltalk-C7J3IyEP.js"),[],import.meta.url).then(t=>ft(t.smalltalk))}),He.of({name:"Solr",load:()=>Be(()=>import("./solr-78MBEUkU.js"),[],import.meta.url).then(t=>ft(t.solr))}),He.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:()=>Be(()=>import("./mllike-3c2dg9RT.js"),[],import.meta.url).then(t=>ft(t.sml))}),He.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:()=>Be(()=>import("./sparql-BRLJFz69.js"),[],import.meta.url).then(t=>ft(t.sparql))}),He.of({name:"Spreadsheet",alias:["excel","formula"],load:()=>Be(()=>import("./spreadsheet-CGlWr0eM.js"),[],import.meta.url).then(t=>ft(t.spreadsheet))}),He.of({name:"Squirrel",extensions:["nut"],load:()=>Be(()=>import("./clike-BgBwzOhw.js"),[],import.meta.url).then(t=>ft(t.squirrel))}),He.of({name:"Stylus",extensions:["styl"],load:()=>Be(()=>import("./stylus-Bdo_Aemu.js"),[],import.meta.url).then(t=>ft(t.stylus))}),He.of({name:"Swift",extensions:["swift"],load:()=>Be(()=>import("./swift-B_XXVlXX.js"),[],import.meta.url).then(t=>ft(t.swift))}),He.of({name:"sTeX",load:()=>Be(()=>Promise.resolve().then(()=>JV),void 0,import.meta.url).then(t=>ft(t.stex))}),He.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:()=>Be(()=>Promise.resolve().then(()=>JV),void 0,import.meta.url).then(t=>ft(t.stex))}),He.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:()=>Be(()=>import("./verilog-B4LBqg_1.js"),[],import.meta.url).then(t=>ft(t.verilog))}),He.of({name:"Tcl",extensions:["tcl"],load:()=>Be(()=>import("./tcl-B2fODqDH.js"),[],import.meta.url).then(t=>ft(t.tcl))}),He.of({name:"Textile",extensions:["textile"],load:()=>Be(()=>import("./textile-BuVhTOzU.js"),[],import.meta.url).then(t=>ft(t.textile))}),He.of({name:"TiddlyWiki",load:()=>Be(()=>import("./tiddlywiki-BgR6AEZu.js"),[],import.meta.url).then(t=>ft(t.tiddlyWiki))}),He.of({name:"Tiki wiki",load:()=>Be(()=>import("./tiki-CI-ztowC.js"),[],import.meta.url).then(t=>ft(t.tiki))}),He.of({name:"TOML",extensions:["toml"],load:()=>Be(()=>import("./toml-wcPdHu67.js"),[],import.meta.url).then(t=>ft(t.toml))}),He.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:()=>Be(()=>import("./troff-Ce85hlLp.js"),[],import.meta.url).then(t=>ft(t.troff))}),He.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:()=>Be(()=>import("./ttcn-BxnYHtq8.js"),[],import.meta.url).then(t=>ft(t.ttcn))}),He.of({name:"TTCN_CFG",extensions:["cfg"],load:()=>Be(()=>import("./ttcn-cfg-CKJxb-l2.js"),[],import.meta.url).then(t=>ft(t.ttcnCfg))}),He.of({name:"Turtle",extensions:["ttl"],load:()=>Be(()=>import("./turtle-BkSuIpt-.js"),[],import.meta.url).then(t=>ft(t.turtle))}),He.of({name:"Web IDL",extensions:["webidl"],load:()=>Be(()=>import("./webidl-CGwyPRYs.js"),[],import.meta.url).then(t=>ft(t.webIDL))}),He.of({name:"VB.NET",extensions:["vb"],load:()=>Be(()=>import("./vb-BHgjm0DN.js"),[],import.meta.url).then(t=>ft(t.vb))}),He.of({name:"VBScript",extensions:["vbs"],load:()=>Be(()=>import("./vbscript-Dawdd5GZ.js"),[],import.meta.url).then(t=>ft(t.vbScript))}),He.of({name:"Velocity",extensions:["vtl"],load:()=>Be(()=>import("./velocity-BdD_26Jv.js"),[],import.meta.url).then(t=>ft(t.velocity))}),He.of({name:"Verilog",extensions:["v"],load:()=>Be(()=>import("./verilog-B4LBqg_1.js"),[],import.meta.url).then(t=>ft(t.verilog))}),He.of({name:"VHDL",extensions:["vhd","vhdl"],load:()=>Be(()=>import("./vhdl-CWWH2SUo.js"),[],import.meta.url).then(t=>ft(t.vhdl))}),He.of({name:"XQuery",extensions:["xy","xquery"],load:()=>Be(()=>import("./xquery-CVDBqZPY.js"),[],import.meta.url).then(t=>ft(t.xQuery))}),He.of({name:"Yacas",extensions:["ys"],load:()=>Be(()=>import("./yacas-I8QjZlxf.js"),[],import.meta.url).then(t=>ft(t.yacas))}),He.of({name:"Z80",extensions:["z80"],load:()=>Be(()=>import("./z80-D8p3gKXp.js"),[],import.meta.url).then(t=>ft(t.z80))}),He.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:()=>Be(()=>import("./mscgen-B2igx18G.js"),[],import.meta.url).then(t=>ft(t.mscgen))}),He.of({name:"X\xF9",extensions:["xu"],load:()=>Be(()=>import("./mscgen-B2igx18G.js"),[],import.meta.url).then(t=>ft(t.xu))}),He.of({name:"MsGenny",extensions:["msgenny"],load:()=>Be(()=>import("./mscgen-B2igx18G.js"),[],import.meta.url).then(t=>ft(t.msgenny))}),He.of({name:"Vue",extensions:["vue"],load:()=>Be(()=>import("./index-61o2T9b-.js"),[],import.meta.url).then(t=>t.vue())}),He.of({name:"Angular Template",load:()=>Be(()=>import("./index-B98MsLyJ.js"),[],import.meta.url).then(t=>t.angular())})];function RCe(t){function e(c,u){c.cmdState.push(u)}function n(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function r(c,u,d){return function(){this.name=c,this.bracketNo=0,this.style=u,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var o={};function i(c,u){c.f=u}function a(c,u){var d;if(c.match(/^\\[a-zA-Z@\xc0-\u1fff\u2060-\uffff]+/)){var f=c.current().slice(1);return e(u,d=new(d=o.hasOwnProperty(f)?o[f]:o.DEFAULT)),i(u,l),d.style}if(c.match(/^\\[$&%#{}_]/)||c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return i(u,function(g,v){return s(g,v,"\\]")}),"keyword";if(c.match("\\("))return i(u,function(g,v){return s(g,v,"\\)")}),"keyword";if(c.match("$$"))return i(u,function(g,v){return s(g,v,"$$")}),"keyword";if(c.match("$"))return i(u,function(g,v){return s(g,v,"$")}),"keyword";var h=c.next();return h=="%"?(c.skipToEnd(),"comment"):h=="}"||h=="]"?(d=n(u))?(d.closeBracket(h),i(u,l),"bracket"):"error":h=="{"||h=="["?(e(u,d=new(d=o.DEFAULT)),"bracket"):/\d/.test(h)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=function(g){for(var v=g.cmdState,b=v.length-1;b>=0;b--){var p=v[b];if(p.name!="DEFAULT")return p}return{styleIdentifier:function(){return null}}}(u),d.name=="begin"&&(d.argument=c.current()),d.styleIdentifier())}function s(c,u,d){if(c.eatSpace())return null;if(d&&c.match(d))return i(u,a),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variableName.special";if(c.match(/^\\[$&%#{}_]/)||c.match(/^\\[,;!\/]/)||c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var f=c.next();return f=="{"||f=="}"||f=="["||f=="]"||f=="("||f==")"?"bracket":f=="%"?(c.skipToEnd(),"comment"):"error"}function l(c,u){var d=c.peek();return d=="{"||d=="["?(n(u).openBracket(d),c.eat(d),i(u,a),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(i(u,a),function(f){var h=f.cmdState.pop();h&&h.closeBracket()}(u),a(c,u))}return o.importmodule=r("importmodule","tag",["string","builtin"]),o.documentclass=r("documentclass","tag",["","atom"]),o.usepackage=r("usepackage","tag",["atom"]),o.begin=r("begin","tag",["atom"]),o.end=r("end","tag",["atom"]),o.label=r("label","tag",["atom"]),o.ref=r("ref","tag",["atom"]),o.eqref=r("eqref","tag",["atom"]),o.cite=r("cite","tag",["atom"]),o.bibitem=r("bibitem","tag",["atom"]),o.Bibitem=r("Bibitem","tag",["atom"]),o.RBibitem=r("RBibitem","tag",["atom"]),o.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{name:"stex",startState:function(){return{cmdState:[],f:t?function(c,u){return s(c,u)}:a}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,u){return u.f(c,u)},blankLine:function(c){c.f=a,c.cmdState.length=0},languageData:{commentTokens:{line:"%"}}}}let KV,JV,eq,jCe,DCe,ACe,MCe,Gj,tq,nq,NCe,rq,$Ce;gY=RCe(!1),KV=RCe(!0),JV=Object.freeze(Object.defineProperty({__proto__:null,stex:gY,stexMath:KV},Symbol.toStringTag,{value:"Module"})),eq=new WeakMap,jCe=/(\n|\r\n?|\u2028|\u2029)/g,DCe=/^\s*/,ACe=/\S/,MCe=Array.prototype.slice,Gj=48,tq=57,nq=97,NCe=102,rq=65,$Ce=70,TT=function(t){if(typeof t=="string")return LCe([t])[0];if(typeof t=="function")return function(){const r=MCe.call(arguments);return r[0]=QCe(r[0]),t.apply(this,r)};const e=QCe(t);let n=ICe(e,0);for(let r=1;r<e.length;r++)n+=arguments[r]+ICe(e,r);return n};function ICe(t,e){const n=t[e];if(n===void 0)throw new TypeError(`invalid cooked string at index ${e}`);return n}function QCe(t){const e=eq.get(t);if(e)return e;const n=LCe(t.raw),r=n.map(oat);return Object.defineProperty(r,"raw",{value:Object.freeze(n)}),Object.freeze(r),eq.set(t,r),r}function LCe(t){const e=t.map(o=>o.split(jCe));let n;for(let o=0;o<e.length;o++){const i=e[o],a=o===0,s=o+1===e.length;if(a){if(i.length===1||i[0].length>0)throw new Error("invalid content on opening line");i[1]=""}if(s){if(i.length===1||ACe.test(i[i.length-1]))throw new Error("invalid content on closing line");i[i.length-2]="",i[i.length-1]=""}for(let l=2;l<i.length;l+=2){const c=i[l],u=l+1===i.length&&!s,d=DCe.exec(c)[0];u||d.length!==c.length?n=rat(d,n):i[l]=""}}const r=n?n.length:0;return e.map(o=>{let i=o[0];for(let a=1;a<o.length;a+=2)i+=o[a]+o[a+1].slice(r);return i})}function rat(t,e){if(e===void 0||t===e)return t;let n=0;for(const r=Math.min(t.length,e.length);n<r&&t[n]===e[n];n++);return t.slice(0,n)}function oat(t){let e="",n=0,r=0;for(;(r=t.indexOf("\\",r))>-1;){if(e+=t.slice(n,r),++r===t.length)return;const o=t[r++];switch(o){case"b":e+="\b";break;case"t":e+=" ";break;case"n":e+=`
|
258
258
|
`;break;case"v":e+="\v";break;case"f":e+="\f";break;case"r":e+="\r";break;case"\r":r<t.length&&t[r]===`
|
259
259
|
`&&++r;case`
|
260
260
|
`:case"\u2028":case"\u2029":break;case"0":if(zCe(t,r))return;e+="\0";break;case"x":{const i=oq(t,r,r+2);if(i===-1)return;r+=2,e+=String.fromCharCode(i);break}case"u":{let i;if(r<t.length&&t[r]==="{"){const a=t.indexOf("}",++r);if(a===-1)return;i=oq(t,r,a),r=a+1}else i=oq(t,r,r+4),r+=4;if(i===-1||i>1114111)return;e+=String.fromCodePoint(i);break}default:if(zCe(o,0))return;e+=o}n=r}return e+t.slice(n)}function zCe(t,e){const n=t.charCodeAt(e);return n>=Gj&&n<=tq}function oq(t,e,n){if(n>=t.length)return-1;let r=0;for(;e<n;e++){const o=iat(t.charCodeAt(e));if(o===-1)return-1;r=16*r+o}return r}function iat(t){return t>=Gj&&t<=tq?t-Gj:t>=nq&&t<=NCe?t-nq+10:t>=rq&&t<=$Ce?t-rq+10:-1}function aat(t,e){return{get:()=>e.get(t),sub:n=>e.sub(t,()=>n(e.get(t)))}}QM=function(t){return t?t.state.field($c).type:"python"},bK=function(t,e,n={}){return!(!n.force&&!function(r,o){return!(!r||QM(r)===o)&&(r.state.doc.toString().trim()===""||au[o].isSupported(pf(r)))}(t,e))&&(yK(t,{language:e}),e)};function sat(t){return Hi.of([{key:t.getHotkey("cell.format").key,preventDefault:!0,run:e=>{const n=e.state.facet(yO);return BM({[n]:e}),!0}},{key:t.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:e=>{const n=QM(e);if(n!=="markdown"&&n!=="python")return!1;const r=bK(e,n==="python"?"markdown":"python",{force:!0});return r==="markdown"&&e.state.facet(bo).afterToggleMarkdown(),r!==!1}}])}$Le=function(){return mt.updateListener.of(t=>{if(t.view.hasFocus&&t.heightChanged&&t.docChanged){if(t.transactions.some(r=>r.effects.some(o=>o.is(pb))))return;const n=t.view.dom.getElementsByClassName("cm-activeLine cm-line");if(n.length===1){const r=n[0],o=document.getElementById("App");Rn(o,"App not found"),function(i,{offset:a,body:s=window}){const l=a==null?void 0:a.top,c=a==null?void 0:a.bottom,u=i.getBoundingClientRect();u.top<l?s.scrollBy({top:u.top-l,behavior:"smooth"}):u.bottom>window.innerHeight-c&&s.scrollBy({top:u.bottom-window.innerHeight+c,behavior:"smooth"})}(r,{offset:{top:30,bottom:150},body:o})}}})};const VCe=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class bb{constructor(e,n,r=0,o=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,o),this.bufferStart=r,this.normalize=i?s=>i(VCe(s)):VCe,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return gs(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=K$(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Vu(e);let o=this.normalize(n);if(o.length)for(let i=0,a=r;;i++){let s=o.charCodeAt(i),l=this.match(s,a,this.bufferPos+this.bufferStart);if(i==o.length-1){if(l)return this.value=l,this;break}a==r&&i<n.length&&n.charCodeAt(i)==s&&a++}}}match(e,n,r){let o=null;for(let i=0;i<this.matches.length;i+=2){let a=this.matches[i],s=!1;this.query.charCodeAt(a)==e&&(a==this.query.length-1?o={from:this.matches[i+1],to:r}:(this.matches[i]++,s=!0)),s||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?o={from:n,to:r}:this.matches.push(1,n)),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}typeof Symbol<"u"&&(bb.prototype[Symbol.iterator]=function(){return this});const qCe={from:-1,to:-1,match:/.*/.exec("")},iq="gm"+(/x/.unicode==null?"":"u");class aq{constructor(e,n,r,o=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=qCe,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new FCe(e,n,r,o,i);this.re=new RegExp(n,iq+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let a=e.lineAt(o);this.curLineStart=a.from,this.matchPos=Kj(e,o),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,o=r+n[0].length;if(this.matchPos=Kj(this.text,o+(r==o?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<o||r>this.value.to)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,match:n},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const sq=new WeakMap;class xb{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let o=sq.get(e);if(!o||o.from>=r||o.to<=n){let s=new xb(n,e.sliceString(n,r));return sq.set(e,s),s}if(o.from==n&&o.to==r)return o;let{text:i,from:a}=o;return a>n&&(i=e.sliceString(n,a)+i,a=n),o.to<r&&(i+=e.sliceString(o.to,r)),sq.set(e,new xb(a,i)),new xb(n,i.slice(n-a,r-a))}}class FCe{constructor(e,n,r,o,i){this.text=e,this.to=i,this.done=!1,this.value=qCe,this.matchPos=Kj(e,o),this.re=new RegExp(n,iq+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=xb.get(e,o,this.chunkEnd(o+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,o=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,match:n},this.matchPos=Kj(this.text,o+(r==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=xb.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Kj(t,e){if(e>=t.length)return e;let n,r=t.lineAt(e);for(;e<r.to&&(n=r.text.charCodeAt(e-r.from))>=56320&&n<57344;)e++;return e}function lq(t){let e=to("input",{class:"cm-textfield",name:"line",value:String(t.state.doc.lineAt(t.state.selection.main.head).number)});function n(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!r)return;let{state:o}=t,i=o.doc.lineAt(o.selection.main.head),[,a,s,l,c]=r,u=l?+l.slice(1):0,d=s?+s:i.number;if(s&&c){let g=d/100;a&&(g=g*(a=="-"?-1:1)+i.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else s&&a&&(d=d*(a=="-"?-1:1)+i.number);let f=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),h=et.cursor(f.from+Math.max(0,Math.min(u,f.length)));t.dispatch({effects:[h2.of(!1),mt.scrollIntoView(h.from,{y:"center"})],selection:h}),t.focus()}return{dom:to("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),t.dispatch({effects:h2.of(!1)}),t.focus()):r.keyCode==13&&(r.preventDefault(),n())},onsubmit:r=>{r.preventDefault(),n()}},to("label",t.state.phrase("Go to line"),": ",e)," ",to("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),to("button",{name:"close",onclick:()=>{t.dispatch({effects:h2.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["\xD7"]))}}typeof Symbol<"u"&&(aq.prototype[Symbol.iterator]=FCe.prototype[Symbol.iterator]=function(){return this});const h2=hn.define(),BCe=Eo.define({create:()=>!0,update(t,e){for(let n of e.effects)n.is(h2)&&(t=n.value);return t},provide:t=>kp.from(t,e=>e?lq:null)}),lat=mt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),cat={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},uat=Lt.define({combine:t=>Dl(t,cat,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})});GK=function(t){return[pat,hat]};const dat=Yt.mark({class:"cm-selectionMatch"}),fat=Yt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function WCe(t,e,n,r){return!(n!=0&&t(e.sliceDoc(n-1,n))==jo.Word||r!=e.doc.length&&t(e.sliceDoc(r,r+1))==jo.Word)}const hat=Wr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(uat),{state:n}=t,r=n.selection;if(r.ranges.length>1)return Yt.none;let o,i=r.main,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return Yt.none;let l=n.wordAt(i.head);if(!l)return Yt.none;a=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return Yt.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!WCe(a,n,i.from,i.to)||!function(c,u,d,f){return c(u.sliceDoc(d,d+1))==jo.Word&&c(u.sliceDoc(f-1,f))==jo.Word}(a,n,i.from,i.to))return Yt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return Yt.none}let s=[];for(let l of t.visibleRanges){let c=new bb(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:d}=c.value;if((!a||WCe(a,n,u,d))&&(i.empty&&u<=i.from&&d>=i.to?s.push(fat.range(u,d)):(u>=i.to||d<=i.from)&&s.push(dat.range(u,d)),s.length>e.maxMatches))return Yt.none}}return Yt.set(s)}},{decorations:t=>t.decorations}),pat=mt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});let C0;KK=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return(({state:i,dispatch:a})=>{let{selection:s}=i,l=et.create(s.ranges.map(c=>i.wordAt(c.head)||et.cursor(c.head)),s.mainIndex);return!l.eq(s)&&(a(i.update({selection:l})),!0)})({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=r))return!1;let o=function(i,a){let{main:s,ranges:l}=i.selection,c=i.wordAt(s.head),u=c&&c.from==s.from&&c.to==s.to;for(let d=!1,f=new bb(i.doc,a,l[l.length-1].to);;){if(f.next(),!f.done){if(d&&l.some(h=>h.from==f.value.from))continue;if(u){let h=i.wordAt(f.value.from);if(!h||h.from!=f.value.from||h.to!=f.value.to)continue}return f.value}if(d)return null;f=new bb(i.doc,a,0,Math.max(0,l[l.length-1].from-1)),d=!0}}(t,r);return!!o&&(e(t.update({selection:t.selection.addRange(et.range(o.from,o.to),!1),effects:mt.scrollIntoView(o.to)})),!0)},C0=Lt.define({combine:t=>Dl(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new kat(e),scrollToMatch:e=>mt.scrollIntoView(e)})}),jT=class{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,iq),!0}catch{return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(e,n)=>n=="n"?`
|
@@ -435,14 +435,14 @@ ${n.sqlString}
|
|
435
435
|
`)+Llt(l)+c,s.length+1]}isSupported(t){return t.trim()===""||!!t.includes("mo.sql")&&!(t.split("mo.sql").length>2)&&WPe(t)!==null}extractCommentLines(t){const e=t.split(`
|
436
436
|
`),n=[];for(const r of e){if(!r.startsWith("#"))break;n.push(r)}return n}getExtension(){const t=YF(H0);return[Jx({dialect:H0}),_1({defaultKeymap:!1,activateOnTyping:!0,override:[e=>{const n=e.state.field(ap),r=n.engine,o=zlt.getCompletionSource(r);return o?GF(o)(e):null},nst,e=>e.matchBefore(/\.\w*/)?null:t(e)]})]}},LO.fromQuery=t=>`_df = mo.sql(f"""${t.trim()}""")`;const zlt=new class{constructor(){this.cache=new OPe(10)}getCompletionSource(t){const e=Ht.get(RN).get(t);if(!e)return null;const n=Ht.get(EN),r={};for(const a of n){const s=a.columns.map(l=>l.name);r[a.name]=s}const o=[e,r];let i=this.cache.get(o);if(!i){const a={},s={},l={dialect:qlt(e),schema:a,defaultSchema:e.default_schema??void 0,defaultTable:Vlt(e)},c=e.databases.find(d=>d.name===e.default_database||e.databases.length===1),u=c??e.databases[0];if((u==null?void 0:u.schemas.some(d=>QT(d.name)))??!1){const d={};for(const f of e.databases){const h=f.name===(c==null?void 0:c.name);for(const g of f.schemas)for(const v of g.tables){const b=v.columns.map(p=>p.name);h?d[v.name]=b:(d[f.name]=d[f.name]||{},d[f.name][v.name]=b)}}return i={...l,schema:d,defaultSchema:c==null?void 0:c.name},i}for(const d of(c==null?void 0:c.schemas)??[]){a[d.name]={};for(const f of d.tables){const h=f.columns.map(g=>g.name);a[d.name][f.name]=h}}for(const d of e.databases)if(d.name!==(c==null?void 0:c.name)){s[d.name]={};for(const f of d.schemas){s[d.name][f.name]={};for(const h of f.tables){const g=h.columns.map(v=>v.name);s[d.name][f.name][h.name]=g}}}i={...l,schema:{...s,...a,...r},defaultSchema:e.default_schema??void 0},this.cache.set(o,i)}return i}};function Vlt(t){if(t.databases.length!==1)return;const e=t.databases[0];if(e.schemas.length!==1)return;const n=e.schemas[0];return n.tables.length===1?n.tables[0].name:void 0}function qlt(t){switch(t.dialect){case"postgresql":case"postgres":return GA;case"mysql":return KA;case"sqlite":return nB;case"mssql":case"sqlserver":return tB;default:return}}function Flt(t,e){if(t.name==="String"){const n=e.slice(t.from,t.to);return n.startsWith('"""')||n.startsWith("'''")?I5(n.slice(3,-3)):I5(n.slice(1,-1))}if(t.name==="FormatString"){const n=e.slice(t.from,t.to);return n.startsWith('f"""')||n.startsWith("f'''")?I5(n.slice(4,-3)):I5(n.slice(2,-1))}return null}function WPe(t){try{const e=GL.parse(t).cursor();e.name==="Script"&&e.next();const n=function(c){do{if(c.name==="AssignStatement")return c.node;if(c.name!=="Comment")return null}while(c.next());return null}(e);if(!n||t.slice(n.to).trim().length>0)return null;let r,o,i=null,a=null,s=0;const l=n.cursor();if(l.firstChild(),l.name==="VariableName"&&(i=t.slice(l.from,l.to)),!i)return null;for(;l.next();)if(l.name==="CallExpression"){const c=l.node.cursor();let u=!1;if(c.firstChild(),c.name==="MemberExpression"&&(u=t.slice(c.from,c.to)==="mo.sql"),!u)return null;for(;c.next();)if(c.name==="ArgList"){const d=c.node.cursor(),{args:f,kwargs:h}=$lt(d,t);f.length===1&&(a=Flt(f[0],t),s=f[0].from+Blt(t.slice(f[0].from,f[0].to)));for(const{key:g,value:v}of h)switch(g){case"engine":r=v;break;case"output":o=v==="True"}if(a==="")return{dfName:i,sqlString:"",engine:r,output:o,startPosition:s};break}}return i&&a?{dfName:i,sqlString:a,engine:r,output:o,startPosition:s}:null}catch(e){return Ve.warn("Failed to parse SQL statement",{error:e}),null}}function Blt(t){return t===""?0:t.startsWith('f"""')||t.startsWith("f'''")?4:t.startsWith('"""')||t.startsWith("'''")?3:t.startsWith("f'")||t.startsWith('f"')?2:t.startsWith("'")||t.startsWith('"')?1:0}function I5(t){try{return TT(`
|
437
437
|
${t}
|
438
|
-
`).trim()}catch{return t}}const au={get python(){return new Olt},get markdown(){return new dT},get sql(){return new LO}};iM=function(t){_.useEffect(t,[])};const Wlt=()=>{const t=ue.c(2);let e,n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsxs("section",{className:"flex flex-col gap-0.5",children:[y.jsxs("header",{className:"flex items-center gap-1",children:[y.jsx("code",{className:"text-xs px-1 py-0.5 bg-[var(--slate-2)] rounded",children:"r"}),y.jsx("span",{className:"font-semibold",children:"Raw String"})]}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),y.jsx("pre",{className:"text-xs bg-[var(--slate-2)] p-2 rounded",children:"\\alpha \\beta"})]}),t[0]=e):e=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsxs("div",{className:"flex flex-col gap-3.5",children:[e,y.jsxs("section",{className:"flex flex-col gap-0.5",children:[y.jsxs("header",{className:"flex items-center gap-1",children:[y.jsx("code",{className:"text-xs px-1 py-0.5 bg-[var(--slate-2)] rounded",children:"f"}),y.jsx("span",{className:"font-semibold",children:"Format String"})]}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),y.jsxs("pre",{className:"text-xs bg-[var(--slate-2)] p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),t[1]=n):n=t[1],n};DN=function(t){switch(t){case"duckdb":return"DuckDB";case"motherduck":return"MotherDuck";case"sqlite":return"SQLite";case"postgres":case"postgresql":return"PostgreSQL";case"mysql":return"MySQL";case"mariadb":return"MariaDB";case"mssql":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";default:return t}};function UPe(t){const[e,n]=t.split(" ");return n?`${DN(e)} ${n}`:DN(t)}let ZPe,oB,XPe;ZPe=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,oB=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,XPe={sqlite:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",duckdb:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",motherduck:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMotherDuck%3c/title%3e%3cg%20transform='scale(0.85)%20translate(0,%202)'%3e%3cpath%20fill='%23ff9538'%20d='M1.71%2015.86s7.45%205.32%207.89%205.59c.44.27%201.08.33%201.64.11.56-.22.98-.71%201.11-1.21s1.85-9.49%201.85-9.49c.02-.12.07-.48-.13-.83-.27-.47-.86-.71-1.38-.57-.42.12-.64.44-.7.55-.09.17-.26.45-.57.7-.24.19-.47.3-.58.34-.96.38-2.02.06-2.61-.72-.38-.48-1.04-.67-1.64-.43-.6.24-.94.84-.89%201.45.11.98-.44%201.94-1.4%202.32-.51.21-1.06.21-1.54.05-.12-.03-.51-.12-.89.09-.48.26-.74.84-.61%201.37.09.39.38.62.48.69z'%20/%3e%3cpath%20fill='%23ff9538'%20d='M14.12%204.21s2.65%208.76%202.83%209.24c.19.48.66.92%201.23%201.09.58.16%201.21.03%201.62-.28.41-.31%207.25-6.39%207.25-6.39.09-.08.35-.34.4-.74.07-.53-.25-1.09-.75-1.29-.4-.16-.78-.04-.89%200-.18.08-.48.2-.88.2-.3.01-.55-.05-.67-.08-.99-.28-1.64-1.18-1.63-2.16-.01-.61-.42-1.17-1.04-1.35-.62-.18-1.26.09-1.59.6-.51.84-1.53%201.27-2.52.99-.53-.15-.96-.48-1.25-.91-.07-.09-.33-.4-.76-.48-.54-.09-1.1.22-1.32.71-.16.37-.08.72-.04.84z'%20/%3e%3c/g%3e%3c/svg%3e",postgres:oB,postgresql:oB,mysql:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMySQL%3c/title%3e%3cpath%20d='M16.405%205.501c-.115%200-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77%2018.695h-.927a50.854%2050.854%200%2000-.27-4.41h-.008l-1.41%204.41H2.45l-1.4-4.41h-.01a72.892%2072.892%200%2000-.195%204.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335%204.064h.008l1.347-4.064h1.095c.242%202.015.384%203.86.428%205.53zm4.017-4.08c-.378%202.045-.876%203.533-1.492%204.46-.482.716-1.01%201.073-1.583%201.073-.153%200-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268%200%20.483-.075.647-.222.197-.18.295-.382.295-.605%200-.155-.077-.47-.23-.944L6.23%2014.615h.91l.727%202.36c.164.536.233.91.205%201.123.4-1.064.678-2.227.835-3.483zm12.325%204.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253%200-1.83-.718-2.746-2.155-2.746-.704%200-1.254.232-1.65.697-.43.508-.646%201.256-.646%202.245%200%20.972.19%201.686.574%202.14.35.41.877.615%201.583.615.264%200%20.506-.033.725-.098l1.325.772.36-.622zM15.5%2017.588c-.225-.36-.337-.94-.337-1.736%200-1.393.424-2.09%201.27-2.09.443%200%20.77.167.977.5.224.362.336.936.336%201.723%200%201.404-.424%202.108-1.27%202.108-.445%200-.77-.167-.978-.5zm-1.658-.425c0%20.47-.172.856-.516%201.156-.344.3-.803.45-1.384.45-.543%200-1.064-.172-1.573-.515l.237-.476c.438.22.833.328%201.19.328.332%200%20.593-.073.783-.22a.754.754%200%2000.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177%200-.45.157-.81.47-1.085.315-.278.72-.415%201.22-.415.512%200%20.98.136%201.4.41l-.213.476a2.726%202.726%200%2000-1.064-.23c-.283%200-.502.068-.654.206a.685.685%200%2000-.248.524c0%20.328.234.61.666.85.393.215%201.187.67%201.187.67.433.305.648.63.648%201.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223%203.223%200%2000-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867%208.867%200%2000-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69%2017.69%200%2001-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422%201.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146%201.693.194%202.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445%203.445%200%2001-.35-.4%208.76%208.76%200%2001-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188%201.01-.027.007-.014%200-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478%202.478%200%2001-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953%205.953%200%20012.085%202.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z'/%3e%3c/svg%3e",snowflake:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSnowflake%3c/title%3e%3cpath%20d='M24%203.459c0%20.646-.418%201.18-1.141%201.18-.723%200-1.142-.534-1.142-1.18%200-.647.419-1.18%201.142-1.18.723%200%201.141.533%201.141%201.18zm-.228%200c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0%20.533.38.952.913.952.57%200%20.913-.419.913-.951zm-1.37-.533h.495c.266%200%20.456.152.456.38%200%20.153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114%200%20.152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602%2012.4c.038-.151.076-.304.076-.456%200-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153%201.56.532%201.94l2.701%201.56-2.701%201.56c-.685.38-.913%201.256-.533%201.94.38.685%201.256.914%201.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332%202.626c-.266-.038-.57.038-.837.19l-4.832%202.777c-.685.38-.913%201.256-.532%201.94.38.686%201.255.914%201.94.533l2.701-1.56v3.12c0%20.8.647%201.408%201.446%201.408.799%200%201.407-.647%201.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701%201.56V1.975c0-.799-.647-1.408-1.446-1.408-.799%200-1.446.609-1.446%201.408V7.53c0%20.76.609%201.37%201.332%201.407zM3.265%205.97l4.832%202.777c.266.152.533.19.837.19.723-.038%201.331-.684%201.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799%200-1.446.647-1.446%201.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19%201.521.494%201.902zm9.093%206.011a.412.412%200%2000-.114-.266l-.57-.571a.346.346%200%2000-.267-.114.412.412%200%2000-.266.114l-.571.57a.411.411%200%2000-.114.267c0%20.076.038.19.114.267l.57.57a.345.345%200%2000.267.114c.076%200%20.19-.038.266-.114l.571-.57a.412.412%200%2000.114-.267zm1.598.533L11.94%2014.53c-.039.038-.153.114-.229.114h-.608a.411.411%200%2001-.267-.114L8.82%2012.514a.408.408%200%2001-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41%200%2001.267-.114h.608a.41.41%200%2001.267.114l2.016%202.016a.347.347%200%2001.114.267v.608c-.076.077-.114.19-.19.229zm5.593%205.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332%201.408v5.554c0%20.8.647%201.408%201.408%201.408.799%200%201.446-.647%201.446-1.408v-3.12l2.7%201.56c.686.38%201.561.152%201.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701%201.56%202.7%201.56c.686.38.914%201.256.533%201.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644%201.644%200%2001-.647-.798c-.037-.153-.076-.305-.076-.457%200-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38%201.56-.152%201.94.533.457.609.19%201.484-.494%201.864'/%3e%3c/svg%3e",databricks:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDatabricks%3c/title%3e%3cpath%20d='M.95%2014.184L12%2020.403l9.919-5.55v2.21L12%2022.662l-10.484-5.96-.565.308v.77L12%2024l11.05-6.218v-4.317l-.515-.309L12%2019.118l-9.867-5.653v-2.21L12%2016.805l11.05-6.218V6.32l-.515-.308L12%2011.974%202.647%206.681%2012%201.388l7.76%204.368.668-.411v-.566L12%200%20.95%206.27v.72L12%2013.207l9.919-5.55v2.26L12%2015.52%201.516%209.56l-.565.308Z'/%3e%3c/svg%3e",clickhouse:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClickHouse%3c/title%3e%3cpath%20d='M21.333%2010H24v4h-2.667ZM16%201.335h2.667v21.33H16Zm-5.333%200h2.666v21.33h-2.666ZM0%2022.665V1.335h2.667v21.33zm5.333-21.33H8v21.33H5.333Z'/%3e%3c/svg%3e",timeplus:"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c!--%20Generated%20by%20Pixelmator%20Pro%203.6.17%20--%3e%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Option2SymbolB'%3e%3cg%20id='Layer1-2'%3e%3cg%20id='Group'%20opacity='0.4'%3e%3cpath%20id='Path'%20fill='%23d53c97'%20stroke='none'%20d='M%2017.016802%2012.188573%20C%2017.016802%209.607646%2015.86018%207.293022%2014.039526%205.731081%20C%2013.942595%205.70038%2013.844628%205.671406%2013.745972%205.645189%20C%2013.131133%205.809095%2012.54265%206.059378%2011.998103%206.388559%20C%2013.964327%207.575191%2015.281006%209.730104%2015.281006%2012.188573%20C%2015.279476%2014.563734%2014.033739%2016.764488%2011.998103%2017.988243%20C%2012.542634%2018.317537%2013.131119%2018.567936%2013.745972%2018.731958%20C%2013.844628%2018.705742%2013.942595%2018.67642%2014.039526%2018.645721%20C%2015.86018%2017.084126%2017.016802%2014.769501%2017.016802%2012.188573%20Z'/%3e%3cpath%20id='path1'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.897406%205.609659%20L%2013.894991%205.60759%20C%2013.844973%205.619663%2013.7953%205.631737%2013.745972%205.645189%20C%2013.79599%205.631737%2013.847043%205.622078%2013.897406%205.609659%20Z'/%3e%3cpath%20id='path2'%20fill='%23d53c97'%20stroke='none'%20d='M%201.735796%2012.188573%20C%201.735796%209.164728%203.728925%206.59622%206.470945%205.729357%20C%207.554634%204.797861%208.856011%204.155121%2010.254373%203.860756%20C%209.680216%203.740549%209.095179%203.679977%208.508574%203.68%20C%203.816888%203.68%20-0%207.496887%20-0%2012.188573%20C%20-0%2016.880259%203.816888%2020.697147%208.508574%2020.697147%20C%209.0952%2020.697229%209.680255%2020.636539%2010.254373%2020.516048%20C%208.855971%2020.221794%207.554568%2019.579041%206.470945%2018.647446%20C%203.728925%2017.780582%201.735796%2015.213453%201.735796%2012.188573%20Z'/%3e%3cpath%20id='path3'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.745972%2018.731958%20C%2013.7953%2018.745068%2013.844973%2018.757484%2013.894991%2018.769558%20C%2013.894991%2018.769558%2013.896715%2018.769558%2013.897406%2018.767488%20C%2013.847043%2018.754379%2013.79599%2018.745411%2013.745972%2018.731958%20Z'/%3e%3c/g%3e%3cpath%20id='path4'%20fill='%23ff3b65'%20stroke='none'%20d='M%2020.508402%2012.188573%20C%2020.508402%209.606611%2019.351088%207.290262%2017.5294%205.729357%20C%2016.301817%205.342468%2014.989366%205.313629%2013.745972%205.646223%20C%2016.636665%206.418224%2018.772606%209.058484%2018.772606%2012.189609%20C%2018.772606%2015.320732%2016.636665%2017.960991%2013.745972%2018.731958%20C%2014.98947%2019.064316%2016.301983%2019.034998%2017.5294%2018.647446%20C%2019.419907%2017.034296%2020.508638%2014.673781%2020.508402%2012.188573%20Z'/%3e%3cpath%20id='path5'%20fill='%23ff3b65'%20stroke='none'%20d='M%209.962543%2018.647446%20C%207.220525%2017.780582%205.227395%2015.213453%205.227395%2012.188573%20C%205.227395%209.163693%207.220525%206.59622%209.962543%205.729357%20C%2011.046233%204.797861%2012.34761%204.155121%2013.745972%203.860756%20C%2013.171818%203.74053%2012.586779%203.679956%2012.000173%203.68%20C%207.308832%203.68%203.491599%207.496887%203.491599%2012.188573%20C%203.491599%2016.880259%207.308487%2020.697147%2012.000173%2020.697147%20C%2012.586799%2020.697247%2013.171857%2020.636557%2013.745972%2020.516048%20C%2012.34757%2020.221794%2011.046167%2019.579041%209.962543%2018.647446%20Z'/%3e%3cpath%20id='path6'%20fill='%23383838'%20stroke='none'%20d='M%2015.491772%203.68%20C%2010.800431%203.68%206.983198%207.496887%206.983198%2012.188573%20C%206.983198%2016.880259%2010.800086%2020.697147%2015.491772%2020.697147%20C%2020.183456%2020.697147%2024%2016.880259%2024%2012.188573%20C%2024%207.496887%2020.183456%203.68%2015.491772%203.68%20Z%20M%2022.264549%2012.188573%20C%2022.264549%2015.923018%2019.226215%2018.961351%2015.491772%2018.961351%20C%2011.757326%2018.961351%208.718994%2015.923018%208.718994%2012.188573%20C%208.718994%208.454128%2011.757326%205.415796%2015.491772%205.415796%20C%2019.226215%205.415796%2022.264549%208.454128%2022.264549%2012.188573%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",bigquery:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20BigQuery%3c/title%3e%3cpath%20d='M5.676%2010.595h2.052v5.244a5.892%205.892%200%200%201-2.052-2.088v-3.156zm18.179%2010.836a.504.504%200%200%201%200%20.708l-1.716%201.716a.504.504%200%200%201-.708%200l-4.248-4.248a.206.206%200%200%201-.007-.007c-.02-.02-.028-.045-.043-.066a10.736%2010.736%200%200%201-6.334%202.065C4.835%2021.599%200%2016.764%200%2010.799S4.835%200%2010.8%200s10.799%204.835%2010.799%2010.8c0%202.369-.772%204.553-2.066%206.333.025.017.052.028.074.05l4.248%204.248zm-5.028-10.632a8.015%208.015%200%201%200-8.028%208.028h.024a8.016%208.016%200%200%200%208.004-8.028zm-4.86%204.98a6.002%206.002%200%200%200%202.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08%201.332.072.4.025.8.025%201.2%200V7.692H9.468v9.035z'/%3e%3c/svg%3e",trino:""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,iceberg:ZPe,datafusion:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGcElEQVR4nNxZa2wcVxU+99557M6+vLazj6xjO6+maWVTl0YpLU1DU9KARNqooQhFVYJUqUWgiocqIVRESPlRoEhIqYoqgSiCItqQPkAEKUWQtlGSJtAY00R5mTjZTfze94x3HvdedMdZnKgS6s7O2kk/a7R3xvY933fOd874yhhucCyYAIWA9IOH2r+35/HUnjU96sBC8fAERQLpj0+mXjdeXM6rzy/no88uK6zolHu97EX8p/f/IWHAv38i9bsH+kIPo/ozhAJBgpR9J419je437xb62Zc7n/tcf+gRsebADYQAxLW2N/ApL/vNq4AdA7Ht2/piT4q15fAp1wEYAGEALYA18TzT1TXQ09O75qPuKbWS8NW4Lan27/pM4gWrBIgFnaIDvKZIpPPKt+nlgpMTi0q5PKqoqvZR950XAREZaz/fmHmFOFijwGHkDDu5PKGs1SlQ5gAAQ+S9U9Y/xM+Wy+WxRvaeFwE770z+OBNQbmYWwPlp63BPh3q7XQaCxAi50gP7Tldf87J3ywVszEQ2bumOf5WZAAajeWoDJjYOMM5BCECEw9miefxwduaol/1b2sQdCon/8BOZX3ETYWYiODFhvrNUC6ylFgJqzl27DxV+xD3GaGkFnl6deS4G8mJqAmRrtaGkoqxiJnazPpt9gPNVa3DvqfKrXmO0rAJ3RSLrHojHd4jMMwvBSMn+d1pSVrv37oXdz50Hx79JOXgtQGsqIAEiT8V7djtVzEiQ4w+K+t9uCmn3uNmX5rL/l8ullw5c1g80E6slFXgkuuixJVKw3y5jxEzExnV7pB3k7rr3hZDBiZl3njk+9u1mY/legSgm0cfiXbtcTziYHJmovNEXC99PZzAV41KMzaLtXGBVmaQltWfCdPLNxPNdwFdii58KYykhXM2AO5MGvTSAgw9aLnUx8zlomCxTKdeHdP14s/F8tdAiIie2RpPfAPcPNYAjRumNOwLRLZwL2rPgHAGnCF6aHPuJ5869Cr5WYFs0/S0ZkTDns9SK1BltI/JicYcEcXAX8L5R+vOblanf+hHTNwFtWGr7QiT9BAPklnWoVt5/qxrZILQI7wvyjHPrjKkfeL0y9QID76Pzavhmoa3RzNdkLMcYEKCA4aJtncjIgVs4oFnbCCGASDtRVrw3Uz7sV1xfBKiAlc2RJV+vkz9vWYMZWesTa1ER5vYEgot27YPvjJ/dXGBOwY+44JeAdaHkQxpRU9QVQGDIrPz1FjV+f/3eFcaRFcdKosicsh8x6/ClBzaEu7YLoqJNDUonVKR0UCTuRT9w9wshpAzb+qmcY2b9iFlH0xVow0r81sCiz9azfdCY3rNWSzw8a5/ZZ2ItPv9UmfiFP7Tn0HQFPhlMbuKIyOKkhThjNc4rBCtRJl5jrvO5W4mSY+beMib/4A/tOTQtYCCY2kTdszmHE7X8/tWBTtf7s7S528IYELxcuviMycWZzF80baHVgdT6/00fu3oso7Tdwa5Ypt7Aw5Zx7M1K7pf+UL4WTVWgQwqnQ5LWLexTpfblEFaT7Jrsc3GMLDw7+a9tFDj1j/YcmqpAWkn06yhERaYP6ZdeHtC6tl6deYPx4q7xY5+/YFfP+kf5WniqQELp6J6hNaNdia8s4TCojkmrjOYVHGin7qsLQdYqvb976uijk455yX/ac/AkYNLKZx9Nb/kNQkAsLJNBW9+/Uk3eJzI/ZlUG36qcfv6MXf3nmtjtO/ZO/v27/tOeA/L6iyu0pfdu7/riATF93s0fffq+toGdM5zmJ+ziuRgJpWSEgy/mXlk/Zk2f8ZfytfDcxOeM828XHH04TAIJjOTgDAlIiPNEmgQTw9Xh146UBn/aavLgVUAmkLk5IkdXFh09l62NHloaWblZjFGMONjMrsTUjqV5qzjuP90Pw9MUmrKms/2x276U0pbcO2Hlh9qUzj6GMJiclk/q5/b+Ovfqg+P29LD/dD+MhnsgSMLhnlDvPQVrOrcmfufjF2cuvI0BqVlj5GDBKmQZsJbMe9+BAZP1yU3fF+tloVV3LzSfhtEbXrWhO7Ri3ULz8PwmzoRXfTqr/+ddf+k0Dk8CEGBMOWccmC8H82bgSUAmfNO6S/q5Bc8+eBUQDXWtz1VP36gCMC4xnfPrZFw2/I9uLZi6u2aXs7ZdGWkNpcbQcAU0LX2XYYxeF/YBLwIYs0twndjnY4H/BgAA//95CrBYRwImwgAAAABJRU5ErkJggg==",pyspark:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eApache%20Spark%3c/title%3e%3cpath%20d='M10.812%200c-.425.013-.845.215-1.196.605a3.593%203.593%200%2000-.493.722c-.355.667-.425%201.415-.556%202.143a551.9%20551.9%200%2000-.726%204.087c-.027.16-.096.227-.244.273C5.83%208.386%204.06%208.94%202.3%209.514c-.387.125-.773.289-1.114.506-1.042.665-1.196%201.753-.415%202.71.346.422.79.715%201.284.936%201.1.49%202.202.976%203.3%201.47.019.01.036.013.053.019h-.004l1.306.535c0%20.023.002.045%200%20.073-.2%202.03-.39%204.063-.58%206.095-.04.419-.012.831.134%201.23.317.87%201.065%201.148%201.881.701.372-.204.666-.497.937-.818%201.372-1.623%202.746-3.244%204.113-4.872.111-.133.205-.15.363-.098.349.117.697.231%201.045.347h.001c.02.012.045.02.073.03l.142.042c1.248.416%202.68.775%203.929%201.19.4.132.622.164%201.045.098.311-.048.592-.062.828-.236.602-.33.995-.957.988-1.682-.005-.427-.154-.813-.35-1.186-.82-1.556-1.637-3.113-2.461-4.666-.078-.148-.076-.243.037-.375%201.381-1.615%202.756-3.236%204.133-4.855.272-.32.513-.658.653-1.058.308-.878-.09-1.57-1-1.741a2.783%202.783%200%2000-1.235.069c-1.974.521-3.947%201.041-5.918%201.57-.175.047-.26.015-.355-.144a353.08%20353.08%200%2000-2.421-4.018%204.61%204.61%200%2000-.652-.849c-.371-.37-.802-.549-1.227-.536zm.172%203.703a.592.592%200%2001.189.211c.87%201.446%201.742%202.89%202.609%204.338.07.118.135.16.277.121%201.525-.41%203.052-.813%204.579-1.217.367-.098.735-.193%201.103-.289a.399.399%200%2001-.1.2c-1.259%201.48-2.516%202.962-3.779%204.438-.11.13-.12.22-.04.37.937%201.803%201.768%203.309%202.498%204.76l-3.696-1.019c-.538-.18-1.077-.358-1.615-.539-.163-.055-.25-.03-.36.1-1.248%201.488-2.504%202.97-3.759%204.454a.398.398%200%2001-.18.132c.035-.378.068-.757.104-1.136.149-1.572.297-3.144.451-4.716-.03-.318.117-.405-.322-.545-1.493-.593-3.346-1.321-4.816-1.905a.595.595%200%2001.24-.134c1.797-.57%203.595-1.14%205.394-1.705.127-.04.199-.092.211-.233.013-.148.05-.294.076-.441.241-1.363.483-2.726.726-4.088.068-.386.14-.771.21-1.157z'/%3e%3c/svg%3e",redshift:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmazon%20Redshift%3c/title%3e%3cpath%20d='M16.639%209.932a.822.822%200%200%201-.822-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.823.82m-2.086%204.994a.823.823%200%200%201-.822-.822.822.822%200%200%201%201.645%200%20.822.822%200%200%201-.823.822m-5.004-.833a.822.822%200%201%201%20.002-1.644.822.822%200%200%201-.002%201.644m-2.083%204.578a.823.823%200%200%201-.823-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.822.82m9.173-11.236a1.68%201.68%200%200%200-1.68%201.676c0%20.566.285%201.066.718%201.37l-.782%201.982a1.674%201.674%200%200%200-1.923%201.104l-1.753-.398a1.675%201.675%200%200%200-3.348.103c0%20.432.169.823.438%201.12l-.764%201.79c-.028-.001-.053-.008-.08-.008a1.68%201.68%200%200%200-1.68%201.676%201.68%201.68%200%200%200%203.36%200c0-.593-.312-1.112-.778-1.41l.674-1.579c.161.052.33.088.508.088.661%200%201.228-.386%201.502-.94l1.856.42a1.68%201.68%200%200%200%203.327-.325c0-.5-.224-.943-.574-1.25l.822-2.083c.053.005.104.016.157.016a1.68%201.68%200%200%200%201.68-1.676%201.68%201.68%200%200%200-1.68-1.676M12%2023.145c-4.17%200-7.286-1.252-7.286-2.37V4.79C6.14%205.938%209.131%206.547%2012%206.547c2.869%200%205.86-.609%207.286-1.756v15.983c0%201.12-3.116%202.37-7.286%202.37M12%20.856c4.293%200%207.286%201.274%207.286%202.419%200%201.143-2.993%202.418-7.286%202.418-4.293%200-7.286-1.275-7.286-2.418C4.714%202.129%207.707.855%2012%20.855m8.143%202.419C20.143%201.147%2015.947%200%2012%200%208.052%200%203.857%201.147%203.857%203.274l.002.01h-.002v17.49C3.857%2022.87%208.052%2024%2012%2024c3.947%200%208.143-1.13%208.143-3.226V3.284h-.002l.002-.01'/%3e%3c/svg%3e"},sK=t=>{const e=ue.c(11),{name:n,className:r}=t,o=n.toLowerCase(),i=XPe[o];if(!i){let l,c;return e[0]!==r?(l=we("mt-0.5",r),e[0]=r,e[1]=l):l=e[1],e[2]!==l?(c=y.jsx(Wx,{className:l}),e[2]=l,e[3]=c):c=e[3],c}let a,s;return e[4]!==r||e[5]!==i?(a=we("invert-[.5] dark:invert-[.7]",r,i.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),e[4]=r,e[5]=i,e[6]=a):a=e[6],e[7]!==n||e[8]!==a||e[9]!==i?(s=y.jsx("img",{src:i,alt:n,className:a}),e[7]=n,e[8]=a,e[9]=i,e[10]=s):s=e[10],s},qG=function(){const t=ue.c(2),[e,n]=_.useState(0);let r;return t[0]!==e?(r=()=>{n(e+1)},t[0]=e,t[1]=r):r=t[1],r};const Ult=t=>{const e=ue.c(27),{selectedEngine:n,onChange:r}=t,o=Gr(RN),i=[],a=[];for(const[N,E]of o.entries())jN.has(N)?i.push(E):a.push(E);const s=qG(),l=n&&!o.has(n);let c;e[0]!==o||e[1]!==r||e[2]!==s?(c=N=>{if(N===HPe)return void window.open(YPe,"_blank");const E=o.get(N);E&&(s(),r(E.name),qPe(E.name))},e[0]=o,e[1]=r,e[2]=s,e[3]=c):c=e[3];const u=c,d=Hlt,f=Zs;let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsx(Ws,{className:"text-xs border-border !shadow-none !ring-0 h-4.5 px-1.5",children:y.jsx(Us,{placeholder:"Select an engine"})}),e[4]=h):h=e[4];const g=cs,v=Cu;let b,p;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsx(sO,{children:"Database connections"}),e[5]=b):b=e[5],e[6]!==l||e[7]!==n?(p=l&&y.jsx(Qo,{value:n,children:y.jsxs("div",{className:"flex items-center gap-1 opacity-50",children:[y.jsx(TN,{className:"h-3 w-3"}),y.jsx("span",{className:"truncate",children:UPe(n)})]})},n),e[6]=l,e[7]=n,e[8]=p):p=e[8];const O=d(a),k=a.length>0&&y.jsx(of,{}),S=d(i);let w,T,P,j,D;return e[9]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsx(of,{}),e[9]=w):w=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx(Qo,{className:"text-muted-foreground",value:HPe,children:y.jsxs("a",{className:"flex items-center gap-1",href:YPe,target:"_blank",rel:"noreferrer",children:[y.jsx(PA,{className:"h-3 w-3"}),y.jsx("span",{children:"How to add a database connection"})]})}),e[10]=T):T=e[10],e[11]!==v||e[12]!==b||e[13]!==p||e[14]!==O||e[15]!==k||e[16]!==S?(P=y.jsxs(v,{children:[b,p,O,k,S,w,T]}),e[11]=v,e[12]=b,e[13]=p,e[14]=O,e[15]=k,e[16]=S,e[17]=P):P=e[17],e[18]!==g||e[19]!==P?(j=y.jsx(g,{children:P}),e[18]=g,e[19]=P,e[20]=j):j=e[20],e[21]!==f||e[22]!==u||e[23]!==n||e[24]!==j||e[25]!==h?(D=y.jsx("div",{className:"flex flex-row gap-1 items-center",children:y.jsxs(f,{value:n,onValueChange:u,children:[h,j]})}),e[21]=f,e[22]=u,e[23]=n,e[24]=j,e[25]=h,e[26]=D):D=e[26],D},HPe="__help__",YPe="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";function Zlt(t){return t.source!=="iceberg"}function Xlt(t){return y.jsx(Qo,{value:t.name,children:y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(sK,{className:"h-3 w-3",name:t.dialect}),y.jsx("span",{className:"truncate",children:UPe(t.display_name)})]})},t.name)}function Hlt(t){return(t=t.filter(Zlt)).map(Xlt)}let iB,GPe,Q5;iB=()=>{const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx("div",{className:"h-4 border-r border-border"}),t[0]=e):e=t[0],e},GPe=t=>{const e=ue.c(86),{view:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={minWidth:50},e[0]=r):r=e[0];const{spanProps:o,inputProps:i}=function(v){const b=ue.c(15),{minWidth:p,padding:O}=v,k=p===void 0?70:p,S=O===void 0?15:O,[w,T]=_.useState(50),P=_.useRef(null),j=_.useRef(null);let D;b[0]!==S?(D=ae=>{if(j.current&&P.current){const ne=j.current;ne.style.fontSize=window.getComputedStyle(P.current).fontSize,ne.style.fontFamily=window.getComputedStyle(P.current).fontFamily,ne.textContent=ae;const re=ne.offsetWidth;T(re+S)}},b[0]=S,b[1]=D):D=b[1];const N=D;let E,A;b[2]!==N?(E=()=>{var ae;N(((ae=P.current)==null?void 0:ae.value)??"")},b[2]=N,b[3]=E):E=b[3],iM(E),b[4]!==N?(A=ae=>{N(ae.target.value)},b[4]=N,b[5]=A):A=b[5];const I=`${w}px`,L=`${k}px`;let F,Q;b[6]!==I||b[7]!==L?(F={width:I,minWidth:L},b[6]=I,b[7]=L,b[8]=F):F=b[8],b[9]!==A||b[10]!==F?(Q={ref:P,type:"text",onChange:A,style:F},b[9]=A,b[10]=F,b[11]=Q):Q=b[11];const W=Q;let U;b[12]===Symbol.for("react.memo_cache_sentinel")?(U={ref:j,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},b[12]=U):U=b[12];const X=U;let G;return b[13]!==W?(G={inputProps:W,spanProps:X},b[13]=W,b[14]=G):G=b[14],G}(r);let a;e[1]!==n.state?(a=n.state.field($c),e[1]=n.state,e[2]=a):a=e[2];const s=a;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx("div",{}),e[3]=l):l=e[3];let c,u=l,d=!1;e[4]!==n?(c=v=>{n.dispatch({effects:dN.of(v),changes:{from:0,to:n.state.doc.length,insert:n.state.doc.toString()}})},e[4]=n,e[5]=c):c=e[5];const f=c;if(s instanceof LO){let v;e[6]!==n.state?(v=n.state.field(ap),e[6]=n.state,e[7]=v):v=e[7];const b=v;let p;d=!0,e[8]!==f?(p=ne=>{const re=GY(ne.currentTarget.value,!1);ne.currentTarget.value=re,f({dataframeName:re})},e[8]=f,e[9]=p):p=e[9];const O=p;let k,S,w,T,P,j,D,N,E,A,I,L,F;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsx("span",{className:"select-none",children:"Output variable: "}),e[10]=k):k=e[10],e[11]!==i?(S=ne=>{var re;(re=i.onChange)==null||re.call(i,ne)},e[11]=i,e[12]=S):S=e[12],e[13]!==O?(w=ne=>{ne.key==="Enter"&&ne.shiftKey&&O(ne)},e[13]=O,e[14]=w):w=e[14],e[15]!==i||e[16]!==b.dataframeName||e[17]!==O||e[18]!==S||e[19]!==w?(T=y.jsx("input",{...i,defaultValue:b.dataframeName,onChange:S,onBlur:O,onKeyDown:w,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),e[15]=i,e[16]=b.dataframeName,e[17]=O,e[18]=S,e[19]=w,e[20]=T):T=e[20],e[21]!==o?(P=y.jsx("span",{...o}),e[21]=o,e[22]=P):P=e[22],e[23]!==T||e[24]!==P?(j=y.jsxs("label",{className:"flex gap-2 items-center",children:[k,T,P]}),e[23]=T,e[24]=P,e[25]=j):j=e[25],e[26]!==f?(D=ne=>{f({engine:ne})},e[26]=f,e[27]=D):D=e[27],e[28]!==b.engine||e[29]!==D?(N=y.jsx(Ult,{selectedEngine:b.engine,onChange:D}),e[28]=b.engine,e[29]=D,e[30]=N):N=e[30],e[31]!==n?(E=async()=>{await async function(ne){const{formatDialect:re,duckdb:Z}=await Be(async()=>{const{formatDialect:ve,duckdb:ye}=await import("./index-BU0JLM_z.js");return{formatDialect:ve,duckdb:ye}},[],import.meta.url),K=ne.state.field($c),oe=Pp(ne.state);if(K.type!=="sql")return void Ve.error("Language adapter is not SQL");const ie=re(ne.state.doc.toString(),{dialect:Z,tabWidth:oe,useTabs:!1}),Y=K.transformIn(ie)[0],le=ne.state.facet(bo),me=ne.state.facet(YQ);le.updateCellCode({cellId:me,code:Y,formattingChange:!0});const ce=ne.state.doc;ce.toString()!==ie&&ne.dispatch({changes:{from:0,to:ce.length,insert:ie},effects:[pb.of(!0)]})}(n)},e[31]=n,e[32]=E):E=e[32],e[33]===Symbol.for("react.memo_cache_sentinel")?(A=y.jsx(LN,{className:"h-3 w-3"}),e[33]=A):A=e[33],e[34]!==E?(I=y.jsx(qn,{content:"Format SQL",children:y.jsx(Ft,{variant:"text",size:"icon",onClick:E,children:A})}),e[34]=E,e[35]=I):I=e[35],e[36]===Symbol.for("react.memo_cache_sentinel")?(L=y.jsx(iB,{}),e[36]=L):L=e[36],e[37]!==f?(F=ne=>{f({showOutput:!ne.target.checked})},e[37]=f,e[38]=F):F=e[38];const Q=!b.showOutput;let W,U,X,G,ae;e[39]!==F||e[40]!==Q?(W=y.jsx("input",{type:"checkbox",onChange:F,checked:Q}),e[39]=F,e[40]=Q,e[41]=W):W=e[41],e[42]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx("span",{className:"select-none",children:"Hide output"}),e[42]=U):U=e[42],e[43]!==W?(X=y.jsxs("label",{className:"flex items-center gap-2",children:[W,U]}),e[43]=W,e[44]=X):X=e[44],e[45]!==I||e[46]!==X?(G=y.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[I,L,X]}),e[45]=I,e[46]=X,e[47]=G):G=e[47],e[48]!==j||e[49]!==N||e[50]!==G?(ae=y.jsxs("div",{className:"flex flex-1 gap-2 relative items-center",children:[j,N,G]}),e[48]=j,e[49]=N,e[50]=G,e[51]=ae):ae=e[51],u=ae}if(s instanceof dT){let v,b,p,O,k,S,w,T,P,j,D,N,E;if(d=!0,e[52]!==f||e[53]!==n.state){const A=n.state.field(ap),{quotePrefix:I}=A;let L=I;L===void 0&&(L="r",f({quotePrefix:L}));const F=(W,U)=>{if(typeof U!="boolean")return;const X=function({currentQuotePrefix:G,checked:ae,prefix:ne}){let re=G;return ae?G===""?re=ne:G!=="rf"&&ne!==G&&(re="rf"):G===ne?re="":G==="rf"&&(re=ne==="r"?"f":"r"),re}({currentQuotePrefix:L,checked:U,prefix:W});f({quotePrefix:X})};let Q;b="flex flex-row w-full justify-end gap-1.5 items-center",e[63]===Symbol.for("react.memo_cache_sentinel")?(Q=y.jsx("span",{children:"r"}),e[63]=Q):Q=e[63],p=y.jsxs("div",{className:"flex items-center gap-1.5",children:[Q,y.jsx(Tl,{"aria-label":"Toggle raw string",className:"w-3 h-3",checked:L.includes("r"),onCheckedChange:W=>{F("r",W)}})]}),T="flex items-center gap-1.5",e[64]===Symbol.for("react.memo_cache_sentinel")?(P=y.jsx("span",{children:"f"}),e[64]=P):P=e[64],v=Tl,k="Toggle f-string",S="w-3 h-3",w=L.includes("f"),O=W=>{F("f",W)},e[52]=f,e[53]=n.state,e[54]=v,e[55]=b,e[56]=p,e[57]=O,e[58]=k,e[59]=S,e[60]=w,e[61]=T,e[62]=P}else v=e[54],b=e[55],p=e[56],O=e[57],k=e[58],S=e[59],w=e[60],T=e[61],P=e[62];e[65]!==v||e[66]!==O||e[67]!==k||e[68]!==S||e[69]!==w?(j=y.jsx(v,{"aria-label":k,className:S,checked:w,onCheckedChange:O}),e[65]=v,e[66]=O,e[67]=k,e[68]=S,e[69]=w,e[70]=j):j=e[70],e[71]!==j||e[72]!==T||e[73]!==P?(D=y.jsxs("div",{className:T,children:[P,j]}),e[71]=j,e[72]=T,e[73]=P,e[74]=D):D=e[74],e[75]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx(qn,{content:y.jsx(Wlt,{}),children:y.jsx(sk,{className:"w-3 h-3"})}),e[75]=N):N=e[75],e[76]!==b||e[77]!==p||e[78]!==D?(E=y.jsxs("div",{className:b,children:[p,D,N]}),e[76]=b,e[77]=p,e[78]=D,e[79]=E):E=e[79],u=E}let h,g;return e[80]!==d?(h=d&&y.jsx(iB,{}),e[80]=d,e[81]=h):h=e[81],e[82]!==u||e[83]!==s.type||e[84]!==h?(g=y.jsx(za,{children:y.jsxs("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[u,h,s.type]})}),e[82]=u,e[83]=s.type,e[84]=h,e[85]=g):g=e[85],g},Q5=new vg,uN=hn.define(),$c=Eo.define({create:()=>au.python,update(t,e){for(const n of e.effects)if(n.is(uN))return n.value;return t},provide:t=>kp.from(t,e=>e.type==="python"?null:n=>function(r,o){const i=document.createElement("div");let a;return{dom:i,mount(){a=GN.createRoot(i),a.render(y.jsx(Hv,{store:Ht,children:y.jsx(o,{view:r})}))},update(){a==null||a.render(y.jsx(Hv,{store:Ht,children:y.jsx(o,{view:r})}))},destroy(){a==null||a.unmount()}}}(n,GPe))});function Ylt(){const t=Object.values(au),e=(n,r)=>{const o=t[r%t.length];return o.isSupported(n)?o:e(n,r+1)};return[Hi.of([{key:"F4",preventDefault:!0,run:n=>{const r=n.state.field($c),o=t.findIndex(s=>s.type===r.type),i=n.state.doc.toString(),a=e(i,o+1);return r!==a&&(KPe({view:n,nextLanguage:a,opts:{keepCodeAsIs:!1}}),!0)}}])]}function KPe({view:t,nextLanguage:e,opts:n}){const r=t.state.field($c),o=t.state.doc.toString(),i=t.state.facet(Yse),a=t.state.facet(Gse),s=t.state.facet(HQ),l=t.state.facet(YQ),c=t.state.facet(Kse);let u,d=t.state.field(ap),f=t.state.selection.main.head;if(n.keepCodeAsIs)u=o,r.type!==e.type&&(d={...e.defaultMetadata});else{const[h,g]=r.transformOut(o,d),[v,b,p]=e.transformIn(h);f+=g,f-=b,f=ag(f,0,v.length),u=v,d=p}t.dispatch({effects:[uN.of(e),fN.of(d),Q5.reconfigure(e.getExtension(l,i,a,s,c)),tN.reconfigure([]),pb.of(!0)],changes:n.keepCodeAsIs?void 0:{from:0,to:t.state.doc.length,insert:u},selection:n.keepCodeAsIs?void 0:et.cursor(f)}),t.dispatch({effects:[tN.reconfigure([AT()])]})}QLe=function(t){const{placeholderType:e,completionConfig:n,hotkeys:r,cellId:o,lspConfig:i}=t;return[Ylt(),Q5.of(au.python.getExtension(o,n,r,e,i)),$c,ap]},BLe=function(t){return function(e){return e?au.markdown.isSupported(e)?au.markdown:au.sql.isSupported(e)?au.sql:au.python:au.python}(pf({state:t}).trim())},yK=function(t,e){t.state.field($c).type!==e.language&&KPe({view:t,nextLanguage:au[e.language],opts:{keepCodeAsIs:e.keepCodeAsIs??!1}})},t8e=function(t,{completionConfig:e,hotkeysProvider:n,lspConfig:r}){const o=t.state.field($c),i=t.state.facet(HQ),a=t.state.facet(YQ);return Q5.reconfigure(o.getExtension(a,e,n,i,r))},pf=function(t,e,n){const r=t.state.field($c),o=t.state.field(ap),i=t.state.doc.toString();return e!==void 0?r.transformOut(i.slice(e,n),o)[0]:r.transformOut(i,o)[0]};function L5(t,e){const n=t.state.field($c),[r]=n.transformIn(e),o=t.state.doc;return o.toString()===r||t.dispatch({changes:{from:0,to:o.length,insert:r}}),r}const Glt=["marimo-carousel","marimo-tabs","marimo-accordion"];aG=function(t){const e=t.id;if(e)return{id:e};const n=t.textContent;return{path:`//${t.tagName}[contains(., "${n}")]`}};function JPe(t){if(t==null||t.mimetype!=="text/html"||t.data==null)return null;try{return Rn(typeof t.data=="string","expected string"),function(e){const n=[],r=new DOMParser().parseFromString(e,"text/html").querySelectorAll("h1, h2, h3");for(const o of Array.from(r)){const i=o.textContent;if(Glt.some(s=>o.closest(s))||!i)continue;const a=Number.parseInt(o.tagName[1],10);n.push({name:i,level:a,by:aG(o)})}return{items:n}}(t.data)}catch{return Ve.error("Failed to parse outline"),null}}u8e=function(t){return t!=null&&t.items.some(e=>e.level<=3)};function eEe(t,e){const n=a=>a.items.length===0?7:Math.min(...a.items.map(s=>s.level)),r=e[t];if(r==null||r.items.length===0)return Ve.warn("Failed to find a starting outline"),null;const o=n(r);let i=t+1;for(;i<e.length;){const a=e[i];if(a&&n(a)<=o)return[t,i-1];i++}return[t,e.length-1]}SM=function(t){return t==="application/vnd.marimo+error"||t==="application/vnd.marimo+traceback"};const Klt={markdown:!0,inline_ai_tooltip:!1,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1};RT=function(t){var e;return((e=fT().experimental)==null?void 0:e[t])??Klt[t]},function(t,e){if(typeof window>"u")return;const n=`__marimo__${e}`;window[n]&&Ve.warn(`Overwriting existing debug object ${n}`),window[n]=t}(function(t,e){const n=fT();n.experimental=n.experimental??{},n.experimental[t]=e,bG({config:n})},"setFeatureFlag"),WLe=Q_("marimo:rtc:username",""),lJ=bne(()=>RT("rtc_v2")),NO=class{static fromMilliseconds(t){return t==null?null:new NO(t)}static fromSeconds(t){return t==null?null:new NO(1e3*t)}static now(){return new NO(Date.now())}constructor(t){this.ms=t}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}};function tEe(t){const e=[...t];if(e.length===0)return e;const n=e[e.length-1];if(n.mimetype!=="text/plain")return e;const r=/\r[^\n]/g;let o=n.data;Rn(typeof o=="string","expected string");let i=o.search(r);for(;i>-1;){let a=-1;for(let u=i-1;u>=0;u--)if(o.at(u)===`
|
438
|
+
`).trim()}catch{return t}}const au={get python(){return new Olt},get markdown(){return new dT},get sql(){return new LO}};iM=function(t){_.useEffect(t,[])};const Wlt=()=>{const t=ue.c(2);let e,n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsxs("section",{className:"flex flex-col gap-0.5",children:[y.jsxs("header",{className:"flex items-center gap-1",children:[y.jsx("code",{className:"text-xs px-1 py-0.5 bg-[var(--slate-2)] rounded",children:"r"}),y.jsx("span",{className:"font-semibold",children:"Raw String"})]}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),y.jsx("pre",{className:"text-xs bg-[var(--slate-2)] p-2 rounded",children:"\\alpha \\beta"})]}),t[0]=e):e=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsxs("div",{className:"flex flex-col gap-3.5",children:[e,y.jsxs("section",{className:"flex flex-col gap-0.5",children:[y.jsxs("header",{className:"flex items-center gap-1",children:[y.jsx("code",{className:"text-xs px-1 py-0.5 bg-[var(--slate-2)] rounded",children:"f"}),y.jsx("span",{className:"font-semibold",children:"Format String"})]}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),y.jsxs("pre",{className:"text-xs bg-[var(--slate-2)] p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),t[1]=n):n=t[1],n};DN=function(t){switch(t){case"duckdb":return"DuckDB";case"motherduck":return"MotherDuck";case"sqlite":return"SQLite";case"postgres":case"postgresql":return"PostgreSQL";case"mysql":return"MySQL";case"mariadb":return"MariaDB";case"mssql":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";default:return t}};function UPe(t){const[e,n]=t.split(" ");return n?`${DN(e)} ${n}`:DN(t)}let ZPe,oB,XPe;ZPe=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,oB=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,XPe={sqlite:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",duckdb:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",motherduck:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMotherDuck%3c/title%3e%3cg%20transform='scale(0.85)%20translate(0,%202)'%3e%3cpath%20fill='%23ff9538'%20d='M1.71%2015.86s7.45%205.32%207.89%205.59c.44.27%201.08.33%201.64.11.56-.22.98-.71%201.11-1.21s1.85-9.49%201.85-9.49c.02-.12.07-.48-.13-.83-.27-.47-.86-.71-1.38-.57-.42.12-.64.44-.7.55-.09.17-.26.45-.57.7-.24.19-.47.3-.58.34-.96.38-2.02.06-2.61-.72-.38-.48-1.04-.67-1.64-.43-.6.24-.94.84-.89%201.45.11.98-.44%201.94-1.4%202.32-.51.21-1.06.21-1.54.05-.12-.03-.51-.12-.89.09-.48.26-.74.84-.61%201.37.09.39.38.62.48.69z'%20/%3e%3cpath%20fill='%23ff9538'%20d='M14.12%204.21s2.65%208.76%202.83%209.24c.19.48.66.92%201.23%201.09.58.16%201.21.03%201.62-.28.41-.31%207.25-6.39%207.25-6.39.09-.08.35-.34.4-.74.07-.53-.25-1.09-.75-1.29-.4-.16-.78-.04-.89%200-.18.08-.48.2-.88.2-.3.01-.55-.05-.67-.08-.99-.28-1.64-1.18-1.63-2.16-.01-.61-.42-1.17-1.04-1.35-.62-.18-1.26.09-1.59.6-.51.84-1.53%201.27-2.52.99-.53-.15-.96-.48-1.25-.91-.07-.09-.33-.4-.76-.48-.54-.09-1.1.22-1.32.71-.16.37-.08.72-.04.84z'%20/%3e%3c/g%3e%3c/svg%3e",postgres:oB,postgresql:oB,mysql:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMySQL%3c/title%3e%3cpath%20d='M16.405%205.501c-.115%200-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77%2018.695h-.927a50.854%2050.854%200%2000-.27-4.41h-.008l-1.41%204.41H2.45l-1.4-4.41h-.01a72.892%2072.892%200%2000-.195%204.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335%204.064h.008l1.347-4.064h1.095c.242%202.015.384%203.86.428%205.53zm4.017-4.08c-.378%202.045-.876%203.533-1.492%204.46-.482.716-1.01%201.073-1.583%201.073-.153%200-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268%200%20.483-.075.647-.222.197-.18.295-.382.295-.605%200-.155-.077-.47-.23-.944L6.23%2014.615h.91l.727%202.36c.164.536.233.91.205%201.123.4-1.064.678-2.227.835-3.483zm12.325%204.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253%200-1.83-.718-2.746-2.155-2.746-.704%200-1.254.232-1.65.697-.43.508-.646%201.256-.646%202.245%200%20.972.19%201.686.574%202.14.35.41.877.615%201.583.615.264%200%20.506-.033.725-.098l1.325.772.36-.622zM15.5%2017.588c-.225-.36-.337-.94-.337-1.736%200-1.393.424-2.09%201.27-2.09.443%200%20.77.167.977.5.224.362.336.936.336%201.723%200%201.404-.424%202.108-1.27%202.108-.445%200-.77-.167-.978-.5zm-1.658-.425c0%20.47-.172.856-.516%201.156-.344.3-.803.45-1.384.45-.543%200-1.064-.172-1.573-.515l.237-.476c.438.22.833.328%201.19.328.332%200%20.593-.073.783-.22a.754.754%200%2000.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177%200-.45.157-.81.47-1.085.315-.278.72-.415%201.22-.415.512%200%20.98.136%201.4.41l-.213.476a2.726%202.726%200%2000-1.064-.23c-.283%200-.502.068-.654.206a.685.685%200%2000-.248.524c0%20.328.234.61.666.85.393.215%201.187.67%201.187.67.433.305.648.63.648%201.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223%203.223%200%2000-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867%208.867%200%2000-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69%2017.69%200%2001-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422%201.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146%201.693.194%202.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445%203.445%200%2001-.35-.4%208.76%208.76%200%2001-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188%201.01-.027.007-.014%200-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478%202.478%200%2001-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953%205.953%200%20012.085%202.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z'/%3e%3c/svg%3e",snowflake:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSnowflake%3c/title%3e%3cpath%20d='M24%203.459c0%20.646-.418%201.18-1.141%201.18-.723%200-1.142-.534-1.142-1.18%200-.647.419-1.18%201.142-1.18.723%200%201.141.533%201.141%201.18zm-.228%200c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0%20.533.38.952.913.952.57%200%20.913-.419.913-.951zm-1.37-.533h.495c.266%200%20.456.152.456.38%200%20.153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114%200%20.152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602%2012.4c.038-.151.076-.304.076-.456%200-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153%201.56.532%201.94l2.701%201.56-2.701%201.56c-.685.38-.913%201.256-.533%201.94.38.685%201.256.914%201.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332%202.626c-.266-.038-.57.038-.837.19l-4.832%202.777c-.685.38-.913%201.256-.532%201.94.38.686%201.255.914%201.94.533l2.701-1.56v3.12c0%20.8.647%201.408%201.446%201.408.799%200%201.407-.647%201.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701%201.56V1.975c0-.799-.647-1.408-1.446-1.408-.799%200-1.446.609-1.446%201.408V7.53c0%20.76.609%201.37%201.332%201.407zM3.265%205.97l4.832%202.777c.266.152.533.19.837.19.723-.038%201.331-.684%201.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799%200-1.446.647-1.446%201.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19%201.521.494%201.902zm9.093%206.011a.412.412%200%2000-.114-.266l-.57-.571a.346.346%200%2000-.267-.114.412.412%200%2000-.266.114l-.571.57a.411.411%200%2000-.114.267c0%20.076.038.19.114.267l.57.57a.345.345%200%2000.267.114c.076%200%20.19-.038.266-.114l.571-.57a.412.412%200%2000.114-.267zm1.598.533L11.94%2014.53c-.039.038-.153.114-.229.114h-.608a.411.411%200%2001-.267-.114L8.82%2012.514a.408.408%200%2001-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41%200%2001.267-.114h.608a.41.41%200%2001.267.114l2.016%202.016a.347.347%200%2001.114.267v.608c-.076.077-.114.19-.19.229zm5.593%205.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332%201.408v5.554c0%20.8.647%201.408%201.408%201.408.799%200%201.446-.647%201.446-1.408v-3.12l2.7%201.56c.686.38%201.561.152%201.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701%201.56%202.7%201.56c.686.38.914%201.256.533%201.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644%201.644%200%2001-.647-.798c-.037-.153-.076-.305-.076-.457%200-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38%201.56-.152%201.94.533.457.609.19%201.484-.494%201.864'/%3e%3c/svg%3e",databricks:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDatabricks%3c/title%3e%3cpath%20d='M.95%2014.184L12%2020.403l9.919-5.55v2.21L12%2022.662l-10.484-5.96-.565.308v.77L12%2024l11.05-6.218v-4.317l-.515-.309L12%2019.118l-9.867-5.653v-2.21L12%2016.805l11.05-6.218V6.32l-.515-.308L12%2011.974%202.647%206.681%2012%201.388l7.76%204.368.668-.411v-.566L12%200%20.95%206.27v.72L12%2013.207l9.919-5.55v2.26L12%2015.52%201.516%209.56l-.565.308Z'/%3e%3c/svg%3e",clickhouse:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClickHouse%3c/title%3e%3cpath%20d='M21.333%2010H24v4h-2.667ZM16%201.335h2.667v21.33H16Zm-5.333%200h2.666v21.33h-2.666ZM0%2022.665V1.335h2.667v21.33zm5.333-21.33H8v21.33H5.333Z'/%3e%3c/svg%3e",timeplus:"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c!--%20Generated%20by%20Pixelmator%20Pro%203.6.17%20--%3e%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Option2SymbolB'%3e%3cg%20id='Layer1-2'%3e%3cg%20id='Group'%20opacity='0.4'%3e%3cpath%20id='Path'%20fill='%23d53c97'%20stroke='none'%20d='M%2017.016802%2012.188573%20C%2017.016802%209.607646%2015.86018%207.293022%2014.039526%205.731081%20C%2013.942595%205.70038%2013.844628%205.671406%2013.745972%205.645189%20C%2013.131133%205.809095%2012.54265%206.059378%2011.998103%206.388559%20C%2013.964327%207.575191%2015.281006%209.730104%2015.281006%2012.188573%20C%2015.279476%2014.563734%2014.033739%2016.764488%2011.998103%2017.988243%20C%2012.542634%2018.317537%2013.131119%2018.567936%2013.745972%2018.731958%20C%2013.844628%2018.705742%2013.942595%2018.67642%2014.039526%2018.645721%20C%2015.86018%2017.084126%2017.016802%2014.769501%2017.016802%2012.188573%20Z'/%3e%3cpath%20id='path1'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.897406%205.609659%20L%2013.894991%205.60759%20C%2013.844973%205.619663%2013.7953%205.631737%2013.745972%205.645189%20C%2013.79599%205.631737%2013.847043%205.622078%2013.897406%205.609659%20Z'/%3e%3cpath%20id='path2'%20fill='%23d53c97'%20stroke='none'%20d='M%201.735796%2012.188573%20C%201.735796%209.164728%203.728925%206.59622%206.470945%205.729357%20C%207.554634%204.797861%208.856011%204.155121%2010.254373%203.860756%20C%209.680216%203.740549%209.095179%203.679977%208.508574%203.68%20C%203.816888%203.68%20-0%207.496887%20-0%2012.188573%20C%20-0%2016.880259%203.816888%2020.697147%208.508574%2020.697147%20C%209.0952%2020.697229%209.680255%2020.636539%2010.254373%2020.516048%20C%208.855971%2020.221794%207.554568%2019.579041%206.470945%2018.647446%20C%203.728925%2017.780582%201.735796%2015.213453%201.735796%2012.188573%20Z'/%3e%3cpath%20id='path3'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.745972%2018.731958%20C%2013.7953%2018.745068%2013.844973%2018.757484%2013.894991%2018.769558%20C%2013.894991%2018.769558%2013.896715%2018.769558%2013.897406%2018.767488%20C%2013.847043%2018.754379%2013.79599%2018.745411%2013.745972%2018.731958%20Z'/%3e%3c/g%3e%3cpath%20id='path4'%20fill='%23ff3b65'%20stroke='none'%20d='M%2020.508402%2012.188573%20C%2020.508402%209.606611%2019.351088%207.290262%2017.5294%205.729357%20C%2016.301817%205.342468%2014.989366%205.313629%2013.745972%205.646223%20C%2016.636665%206.418224%2018.772606%209.058484%2018.772606%2012.189609%20C%2018.772606%2015.320732%2016.636665%2017.960991%2013.745972%2018.731958%20C%2014.98947%2019.064316%2016.301983%2019.034998%2017.5294%2018.647446%20C%2019.419907%2017.034296%2020.508638%2014.673781%2020.508402%2012.188573%20Z'/%3e%3cpath%20id='path5'%20fill='%23ff3b65'%20stroke='none'%20d='M%209.962543%2018.647446%20C%207.220525%2017.780582%205.227395%2015.213453%205.227395%2012.188573%20C%205.227395%209.163693%207.220525%206.59622%209.962543%205.729357%20C%2011.046233%204.797861%2012.34761%204.155121%2013.745972%203.860756%20C%2013.171818%203.74053%2012.586779%203.679956%2012.000173%203.68%20C%207.308832%203.68%203.491599%207.496887%203.491599%2012.188573%20C%203.491599%2016.880259%207.308487%2020.697147%2012.000173%2020.697147%20C%2012.586799%2020.697247%2013.171857%2020.636557%2013.745972%2020.516048%20C%2012.34757%2020.221794%2011.046167%2019.579041%209.962543%2018.647446%20Z'/%3e%3cpath%20id='path6'%20fill='%23383838'%20stroke='none'%20d='M%2015.491772%203.68%20C%2010.800431%203.68%206.983198%207.496887%206.983198%2012.188573%20C%206.983198%2016.880259%2010.800086%2020.697147%2015.491772%2020.697147%20C%2020.183456%2020.697147%2024%2016.880259%2024%2012.188573%20C%2024%207.496887%2020.183456%203.68%2015.491772%203.68%20Z%20M%2022.264549%2012.188573%20C%2022.264549%2015.923018%2019.226215%2018.961351%2015.491772%2018.961351%20C%2011.757326%2018.961351%208.718994%2015.923018%208.718994%2012.188573%20C%208.718994%208.454128%2011.757326%205.415796%2015.491772%205.415796%20C%2019.226215%205.415796%2022.264549%208.454128%2022.264549%2012.188573%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",bigquery:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20BigQuery%3c/title%3e%3cpath%20d='M5.676%2010.595h2.052v5.244a5.892%205.892%200%200%201-2.052-2.088v-3.156zm18.179%2010.836a.504.504%200%200%201%200%20.708l-1.716%201.716a.504.504%200%200%201-.708%200l-4.248-4.248a.206.206%200%200%201-.007-.007c-.02-.02-.028-.045-.043-.066a10.736%2010.736%200%200%201-6.334%202.065C4.835%2021.599%200%2016.764%200%2010.799S4.835%200%2010.8%200s10.799%204.835%2010.799%2010.8c0%202.369-.772%204.553-2.066%206.333.025.017.052.028.074.05l4.248%204.248zm-5.028-10.632a8.015%208.015%200%201%200-8.028%208.028h.024a8.016%208.016%200%200%200%208.004-8.028zm-4.86%204.98a6.002%206.002%200%200%200%202.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08%201.332.072.4.025.8.025%201.2%200V7.692H9.468v9.035z'/%3e%3c/svg%3e",trino:""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,iceberg:ZPe,datafusion:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGcElEQVR4nNxZa2wcVxU+99557M6+vLazj6xjO6+maWVTl0YpLU1DU9KARNqooQhFVYJUqUWgiocqIVRESPlRoEhIqYoqgSiCItqQPkAEKUWQtlGSJtAY00R5mTjZTfze94x3HvdedMdZnKgS6s7O2kk/a7R3xvY933fOd874yhhucCyYAIWA9IOH2r+35/HUnjU96sBC8fAERQLpj0+mXjdeXM6rzy/no88uK6zolHu97EX8p/f/IWHAv38i9bsH+kIPo/ozhAJBgpR9J419je437xb62Zc7n/tcf+gRsebADYQAxLW2N/ApL/vNq4AdA7Ht2/piT4q15fAp1wEYAGEALYA18TzT1TXQ09O75qPuKbWS8NW4Lan27/pM4gWrBIgFnaIDvKZIpPPKt+nlgpMTi0q5PKqoqvZR950XAREZaz/fmHmFOFijwGHkDDu5PKGs1SlQ5gAAQ+S9U9Y/xM+Wy+WxRvaeFwE770z+OBNQbmYWwPlp63BPh3q7XQaCxAi50gP7Tldf87J3ywVszEQ2bumOf5WZAAajeWoDJjYOMM5BCECEw9miefxwduaol/1b2sQdCon/8BOZX3ETYWYiODFhvrNUC6ylFgJqzl27DxV+xD3GaGkFnl6deS4G8mJqAmRrtaGkoqxiJnazPpt9gPNVa3DvqfKrXmO0rAJ3RSLrHojHd4jMMwvBSMn+d1pSVrv37oXdz50Hx79JOXgtQGsqIAEiT8V7djtVzEiQ4w+K+t9uCmn3uNmX5rL/l8ullw5c1g80E6slFXgkuuixJVKw3y5jxEzExnV7pB3k7rr3hZDBiZl3njk+9u1mY/legSgm0cfiXbtcTziYHJmovNEXC99PZzAV41KMzaLtXGBVmaQltWfCdPLNxPNdwFdii58KYykhXM2AO5MGvTSAgw9aLnUx8zlomCxTKdeHdP14s/F8tdAiIie2RpPfAPcPNYAjRumNOwLRLZwL2rPgHAGnCF6aHPuJ5869Cr5WYFs0/S0ZkTDns9SK1BltI/JicYcEcXAX8L5R+vOblanf+hHTNwFtWGr7QiT9BAPklnWoVt5/qxrZILQI7wvyjHPrjKkfeL0y9QID76Pzavhmoa3RzNdkLMcYEKCA4aJtncjIgVs4oFnbCCGASDtRVrw3Uz7sV1xfBKiAlc2RJV+vkz9vWYMZWesTa1ER5vYEgot27YPvjJ/dXGBOwY+44JeAdaHkQxpRU9QVQGDIrPz1FjV+f/3eFcaRFcdKosicsh8x6/ClBzaEu7YLoqJNDUonVKR0UCTuRT9w9wshpAzb+qmcY2b9iFlH0xVow0r81sCiz9azfdCY3rNWSzw8a5/ZZ2ItPv9UmfiFP7Tn0HQFPhlMbuKIyOKkhThjNc4rBCtRJl5jrvO5W4mSY+beMib/4A/tOTQtYCCY2kTdszmHE7X8/tWBTtf7s7S528IYELxcuviMycWZzF80baHVgdT6/00fu3oso7Tdwa5Ypt7Aw5Zx7M1K7pf+UL4WTVWgQwqnQ5LWLexTpfblEFaT7Jrsc3GMLDw7+a9tFDj1j/YcmqpAWkn06yhERaYP6ZdeHtC6tl6deYPx4q7xY5+/YFfP+kf5WniqQELp6J6hNaNdia8s4TCojkmrjOYVHGin7qsLQdYqvb976uijk455yX/ac/AkYNLKZx9Nb/kNQkAsLJNBW9+/Uk3eJzI/ZlUG36qcfv6MXf3nmtjtO/ZO/v27/tOeA/L6iyu0pfdu7/riATF93s0fffq+toGdM5zmJ+ziuRgJpWSEgy/mXlk/Zk2f8ZfytfDcxOeM828XHH04TAIJjOTgDAlIiPNEmgQTw9Xh146UBn/aavLgVUAmkLk5IkdXFh09l62NHloaWblZjFGMONjMrsTUjqV5qzjuP90Pw9MUmrKms/2x276U0pbcO2Hlh9qUzj6GMJiclk/q5/b+Ovfqg+P29LD/dD+MhnsgSMLhnlDvPQVrOrcmfufjF2cuvI0BqVlj5GDBKmQZsJbMe9+BAZP1yU3fF+tloVV3LzSfhtEbXrWhO7Ri3ULz8PwmzoRXfTqr/+ddf+k0Dk8CEGBMOWccmC8H82bgSUAmfNO6S/q5Bc8+eBUQDXWtz1VP36gCMC4xnfPrZFw2/I9uLZi6u2aXs7ZdGWkNpcbQcAU0LX2XYYxeF/YBLwIYs0twndjnY4H/BgAA//95CrBYRwImwgAAAABJRU5ErkJggg==",pyspark:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eApache%20Spark%3c/title%3e%3cpath%20d='M10.812%200c-.425.013-.845.215-1.196.605a3.593%203.593%200%2000-.493.722c-.355.667-.425%201.415-.556%202.143a551.9%20551.9%200%2000-.726%204.087c-.027.16-.096.227-.244.273C5.83%208.386%204.06%208.94%202.3%209.514c-.387.125-.773.289-1.114.506-1.042.665-1.196%201.753-.415%202.71.346.422.79.715%201.284.936%201.1.49%202.202.976%203.3%201.47.019.01.036.013.053.019h-.004l1.306.535c0%20.023.002.045%200%20.073-.2%202.03-.39%204.063-.58%206.095-.04.419-.012.831.134%201.23.317.87%201.065%201.148%201.881.701.372-.204.666-.497.937-.818%201.372-1.623%202.746-3.244%204.113-4.872.111-.133.205-.15.363-.098.349.117.697.231%201.045.347h.001c.02.012.045.02.073.03l.142.042c1.248.416%202.68.775%203.929%201.19.4.132.622.164%201.045.098.311-.048.592-.062.828-.236.602-.33.995-.957.988-1.682-.005-.427-.154-.813-.35-1.186-.82-1.556-1.637-3.113-2.461-4.666-.078-.148-.076-.243.037-.375%201.381-1.615%202.756-3.236%204.133-4.855.272-.32.513-.658.653-1.058.308-.878-.09-1.57-1-1.741a2.783%202.783%200%2000-1.235.069c-1.974.521-3.947%201.041-5.918%201.57-.175.047-.26.015-.355-.144a353.08%20353.08%200%2000-2.421-4.018%204.61%204.61%200%2000-.652-.849c-.371-.37-.802-.549-1.227-.536zm.172%203.703a.592.592%200%2001.189.211c.87%201.446%201.742%202.89%202.609%204.338.07.118.135.16.277.121%201.525-.41%203.052-.813%204.579-1.217.367-.098.735-.193%201.103-.289a.399.399%200%2001-.1.2c-1.259%201.48-2.516%202.962-3.779%204.438-.11.13-.12.22-.04.37.937%201.803%201.768%203.309%202.498%204.76l-3.696-1.019c-.538-.18-1.077-.358-1.615-.539-.163-.055-.25-.03-.36.1-1.248%201.488-2.504%202.97-3.759%204.454a.398.398%200%2001-.18.132c.035-.378.068-.757.104-1.136.149-1.572.297-3.144.451-4.716-.03-.318.117-.405-.322-.545-1.493-.593-3.346-1.321-4.816-1.905a.595.595%200%2001.24-.134c1.797-.57%203.595-1.14%205.394-1.705.127-.04.199-.092.211-.233.013-.148.05-.294.076-.441.241-1.363.483-2.726.726-4.088.068-.386.14-.771.21-1.157z'/%3e%3c/svg%3e",redshift:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmazon%20Redshift%3c/title%3e%3cpath%20d='M16.639%209.932a.822.822%200%200%201-.822-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.823.82m-2.086%204.994a.823.823%200%200%201-.822-.822.822.822%200%200%201%201.645%200%20.822.822%200%200%201-.823.822m-5.004-.833a.822.822%200%201%201%20.002-1.644.822.822%200%200%201-.002%201.644m-2.083%204.578a.823.823%200%200%201-.823-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.822.82m9.173-11.236a1.68%201.68%200%200%200-1.68%201.676c0%20.566.285%201.066.718%201.37l-.782%201.982a1.674%201.674%200%200%200-1.923%201.104l-1.753-.398a1.675%201.675%200%200%200-3.348.103c0%20.432.169.823.438%201.12l-.764%201.79c-.028-.001-.053-.008-.08-.008a1.68%201.68%200%200%200-1.68%201.676%201.68%201.68%200%200%200%203.36%200c0-.593-.312-1.112-.778-1.41l.674-1.579c.161.052.33.088.508.088.661%200%201.228-.386%201.502-.94l1.856.42a1.68%201.68%200%200%200%203.327-.325c0-.5-.224-.943-.574-1.25l.822-2.083c.053.005.104.016.157.016a1.68%201.68%200%200%200%201.68-1.676%201.68%201.68%200%200%200-1.68-1.676M12%2023.145c-4.17%200-7.286-1.252-7.286-2.37V4.79C6.14%205.938%209.131%206.547%2012%206.547c2.869%200%205.86-.609%207.286-1.756v15.983c0%201.12-3.116%202.37-7.286%202.37M12%20.856c4.293%200%207.286%201.274%207.286%202.419%200%201.143-2.993%202.418-7.286%202.418-4.293%200-7.286-1.275-7.286-2.418C4.714%202.129%207.707.855%2012%20.855m8.143%202.419C20.143%201.147%2015.947%200%2012%200%208.052%200%203.857%201.147%203.857%203.274l.002.01h-.002v17.49C3.857%2022.87%208.052%2024%2012%2024c3.947%200%208.143-1.13%208.143-3.226V3.284h-.002l.002-.01'/%3e%3c/svg%3e"},sK=t=>{const e=ue.c(11),{name:n,className:r}=t,o=n.toLowerCase(),i=XPe[o];if(!i){let l,c;return e[0]!==r?(l=we("mt-0.5",r),e[0]=r,e[1]=l):l=e[1],e[2]!==l?(c=y.jsx(Wx,{className:l}),e[2]=l,e[3]=c):c=e[3],c}let a,s;return e[4]!==r||e[5]!==i?(a=we("invert-[.5] dark:invert-[.7]",r,i.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),e[4]=r,e[5]=i,e[6]=a):a=e[6],e[7]!==n||e[8]!==a||e[9]!==i?(s=y.jsx("img",{src:i,alt:n,className:a}),e[7]=n,e[8]=a,e[9]=i,e[10]=s):s=e[10],s},qG=function(){const t=ue.c(2),[e,n]=_.useState(0);let r;return t[0]!==e?(r=()=>{n(e+1)},t[0]=e,t[1]=r):r=t[1],r};const Ult=t=>{const e=ue.c(27),{selectedEngine:n,onChange:r}=t,o=Gr(RN),i=[],a=[];for(const[N,E]of o.entries())jN.has(N)?i.push(E):a.push(E);const s=qG(),l=n&&!o.has(n);let c;e[0]!==o||e[1]!==r||e[2]!==s?(c=N=>{if(N===HPe)return void window.open(YPe,"_blank");const E=o.get(N);E&&(s(),r(E.name),qPe(E.name))},e[0]=o,e[1]=r,e[2]=s,e[3]=c):c=e[3];const u=c,d=Hlt,f=Zs;let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsx(Ws,{className:"text-xs border-border !shadow-none !ring-0 h-4.5 px-1.5",children:y.jsx(Us,{placeholder:"Select an engine"})}),e[4]=h):h=e[4];const g=cs,v=Cu;let b,p;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsx(sO,{children:"Database connections"}),e[5]=b):b=e[5],e[6]!==l||e[7]!==n?(p=l&&y.jsx(Qo,{value:n,children:y.jsxs("div",{className:"flex items-center gap-1 opacity-50",children:[y.jsx(TN,{className:"h-3 w-3"}),y.jsx("span",{className:"truncate",children:UPe(n)})]})},n),e[6]=l,e[7]=n,e[8]=p):p=e[8];const O=d(a),k=a.length>0&&y.jsx(of,{}),S=d(i);let w,T,P,j,D;return e[9]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsx(of,{}),e[9]=w):w=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx(Qo,{className:"text-muted-foreground",value:HPe,children:y.jsxs("a",{className:"flex items-center gap-1",href:YPe,target:"_blank",rel:"noreferrer",children:[y.jsx(PA,{className:"h-3 w-3"}),y.jsx("span",{children:"How to add a database connection"})]})}),e[10]=T):T=e[10],e[11]!==v||e[12]!==b||e[13]!==p||e[14]!==O||e[15]!==k||e[16]!==S?(P=y.jsxs(v,{children:[b,p,O,k,S,w,T]}),e[11]=v,e[12]=b,e[13]=p,e[14]=O,e[15]=k,e[16]=S,e[17]=P):P=e[17],e[18]!==g||e[19]!==P?(j=y.jsx(g,{children:P}),e[18]=g,e[19]=P,e[20]=j):j=e[20],e[21]!==f||e[22]!==u||e[23]!==n||e[24]!==j||e[25]!==h?(D=y.jsx("div",{className:"flex flex-row gap-1 items-center",children:y.jsxs(f,{value:n,onValueChange:u,children:[h,j]})}),e[21]=f,e[22]=u,e[23]=n,e[24]=j,e[25]=h,e[26]=D):D=e[26],D},HPe="__help__",YPe="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";function Zlt(t){return t.source!=="iceberg"}function Xlt(t){return y.jsx(Qo,{value:t.name,children:y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(sK,{className:"h-3 w-3",name:t.dialect}),y.jsx("span",{className:"truncate",children:UPe(t.display_name)})]})},t.name)}function Hlt(t){return(t=t.filter(Zlt)).map(Xlt)}let iB,GPe,Q5;iB=()=>{const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx("div",{className:"h-4 border-r border-border"}),t[0]=e):e=t[0],e},GPe=t=>{const e=ue.c(86),{view:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={minWidth:50},e[0]=r):r=e[0];const{spanProps:o,inputProps:i}=function(v){const b=ue.c(15),{minWidth:p,padding:O}=v,k=p===void 0?70:p,S=O===void 0?15:O,[w,T]=_.useState(50),P=_.useRef(null),j=_.useRef(null);let D;b[0]!==S?(D=ae=>{if(j.current&&P.current){const ne=j.current;ne.style.fontSize=window.getComputedStyle(P.current).fontSize,ne.style.fontFamily=window.getComputedStyle(P.current).fontFamily,ne.textContent=ae;const re=ne.offsetWidth;T(re+S)}},b[0]=S,b[1]=D):D=b[1];const N=D;let E,A;b[2]!==N?(E=()=>{var ae;N(((ae=P.current)==null?void 0:ae.value)??"")},b[2]=N,b[3]=E):E=b[3],iM(E),b[4]!==N?(A=ae=>{N(ae.target.value)},b[4]=N,b[5]=A):A=b[5];const I=`${w}px`,L=`${k}px`;let F,Q;b[6]!==I||b[7]!==L?(F={width:I,minWidth:L},b[6]=I,b[7]=L,b[8]=F):F=b[8],b[9]!==A||b[10]!==F?(Q={ref:P,type:"text",onChange:A,style:F},b[9]=A,b[10]=F,b[11]=Q):Q=b[11];const W=Q;let U;b[12]===Symbol.for("react.memo_cache_sentinel")?(U={ref:j,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},b[12]=U):U=b[12];const X=U;let G;return b[13]!==W?(G={inputProps:W,spanProps:X},b[13]=W,b[14]=G):G=b[14],G}(r);let a;e[1]!==n.state?(a=n.state.field($c),e[1]=n.state,e[2]=a):a=e[2];const s=a;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx("div",{}),e[3]=l):l=e[3];let c,u=l,d=!1;e[4]!==n?(c=v=>{n.dispatch({effects:dN.of(v),changes:{from:0,to:n.state.doc.length,insert:n.state.doc.toString()}})},e[4]=n,e[5]=c):c=e[5];const f=c;if(s instanceof LO){let v;e[6]!==n.state?(v=n.state.field(ap),e[6]=n.state,e[7]=v):v=e[7];const b=v;let p;d=!0,e[8]!==f?(p=ne=>{const re=GY(ne.currentTarget.value,!1);ne.currentTarget.value=re,f({dataframeName:re})},e[8]=f,e[9]=p):p=e[9];const O=p;let k,S,w,T,P,j,D,N,E,A,I,L,F;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsx("span",{className:"select-none",children:"Output variable: "}),e[10]=k):k=e[10],e[11]!==i?(S=ne=>{var re;(re=i.onChange)==null||re.call(i,ne)},e[11]=i,e[12]=S):S=e[12],e[13]!==O?(w=ne=>{ne.key==="Enter"&&ne.shiftKey&&O(ne)},e[13]=O,e[14]=w):w=e[14],e[15]!==i||e[16]!==b.dataframeName||e[17]!==O||e[18]!==S||e[19]!==w?(T=y.jsx("input",{...i,defaultValue:b.dataframeName,onChange:S,onBlur:O,onKeyDown:w,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),e[15]=i,e[16]=b.dataframeName,e[17]=O,e[18]=S,e[19]=w,e[20]=T):T=e[20],e[21]!==o?(P=y.jsx("span",{...o}),e[21]=o,e[22]=P):P=e[22],e[23]!==T||e[24]!==P?(j=y.jsxs("label",{className:"flex gap-2 items-center",children:[k,T,P]}),e[23]=T,e[24]=P,e[25]=j):j=e[25],e[26]!==f?(D=ne=>{f({engine:ne})},e[26]=f,e[27]=D):D=e[27],e[28]!==b.engine||e[29]!==D?(N=y.jsx(Ult,{selectedEngine:b.engine,onChange:D}),e[28]=b.engine,e[29]=D,e[30]=N):N=e[30],e[31]!==n?(E=async()=>{await async function(ne){const{formatDialect:re,duckdb:Z}=await Be(async()=>{const{formatDialect:ve,duckdb:ye}=await import("./index-Cem4wGOX.js");return{formatDialect:ve,duckdb:ye}},[],import.meta.url),K=ne.state.field($c),oe=Pp(ne.state);if(K.type!=="sql")return void Ve.error("Language adapter is not SQL");const ie=re(ne.state.doc.toString(),{dialect:Z,tabWidth:oe,useTabs:!1}),Y=K.transformIn(ie)[0],le=ne.state.facet(bo),me=ne.state.facet(YQ);le.updateCellCode({cellId:me,code:Y,formattingChange:!0});const ce=ne.state.doc;ce.toString()!==ie&&ne.dispatch({changes:{from:0,to:ce.length,insert:ie},effects:[pb.of(!0)]})}(n)},e[31]=n,e[32]=E):E=e[32],e[33]===Symbol.for("react.memo_cache_sentinel")?(A=y.jsx(LN,{className:"h-3 w-3"}),e[33]=A):A=e[33],e[34]!==E?(I=y.jsx(qn,{content:"Format SQL",children:y.jsx(Ft,{variant:"text",size:"icon",onClick:E,children:A})}),e[34]=E,e[35]=I):I=e[35],e[36]===Symbol.for("react.memo_cache_sentinel")?(L=y.jsx(iB,{}),e[36]=L):L=e[36],e[37]!==f?(F=ne=>{f({showOutput:!ne.target.checked})},e[37]=f,e[38]=F):F=e[38];const Q=!b.showOutput;let W,U,X,G,ae;e[39]!==F||e[40]!==Q?(W=y.jsx("input",{type:"checkbox",onChange:F,checked:Q}),e[39]=F,e[40]=Q,e[41]=W):W=e[41],e[42]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx("span",{className:"select-none",children:"Hide output"}),e[42]=U):U=e[42],e[43]!==W?(X=y.jsxs("label",{className:"flex items-center gap-2",children:[W,U]}),e[43]=W,e[44]=X):X=e[44],e[45]!==I||e[46]!==X?(G=y.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[I,L,X]}),e[45]=I,e[46]=X,e[47]=G):G=e[47],e[48]!==j||e[49]!==N||e[50]!==G?(ae=y.jsxs("div",{className:"flex flex-1 gap-2 relative items-center",children:[j,N,G]}),e[48]=j,e[49]=N,e[50]=G,e[51]=ae):ae=e[51],u=ae}if(s instanceof dT){let v,b,p,O,k,S,w,T,P,j,D,N,E;if(d=!0,e[52]!==f||e[53]!==n.state){const A=n.state.field(ap),{quotePrefix:I}=A;let L=I;L===void 0&&(L="r",f({quotePrefix:L}));const F=(W,U)=>{if(typeof U!="boolean")return;const X=function({currentQuotePrefix:G,checked:ae,prefix:ne}){let re=G;return ae?G===""?re=ne:G!=="rf"&&ne!==G&&(re="rf"):G===ne?re="":G==="rf"&&(re=ne==="r"?"f":"r"),re}({currentQuotePrefix:L,checked:U,prefix:W});f({quotePrefix:X})};let Q;b="flex flex-row w-full justify-end gap-1.5 items-center",e[63]===Symbol.for("react.memo_cache_sentinel")?(Q=y.jsx("span",{children:"r"}),e[63]=Q):Q=e[63],p=y.jsxs("div",{className:"flex items-center gap-1.5",children:[Q,y.jsx(Tl,{"aria-label":"Toggle raw string",className:"w-3 h-3",checked:L.includes("r"),onCheckedChange:W=>{F("r",W)}})]}),T="flex items-center gap-1.5",e[64]===Symbol.for("react.memo_cache_sentinel")?(P=y.jsx("span",{children:"f"}),e[64]=P):P=e[64],v=Tl,k="Toggle f-string",S="w-3 h-3",w=L.includes("f"),O=W=>{F("f",W)},e[52]=f,e[53]=n.state,e[54]=v,e[55]=b,e[56]=p,e[57]=O,e[58]=k,e[59]=S,e[60]=w,e[61]=T,e[62]=P}else v=e[54],b=e[55],p=e[56],O=e[57],k=e[58],S=e[59],w=e[60],T=e[61],P=e[62];e[65]!==v||e[66]!==O||e[67]!==k||e[68]!==S||e[69]!==w?(j=y.jsx(v,{"aria-label":k,className:S,checked:w,onCheckedChange:O}),e[65]=v,e[66]=O,e[67]=k,e[68]=S,e[69]=w,e[70]=j):j=e[70],e[71]!==j||e[72]!==T||e[73]!==P?(D=y.jsxs("div",{className:T,children:[P,j]}),e[71]=j,e[72]=T,e[73]=P,e[74]=D):D=e[74],e[75]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx(qn,{content:y.jsx(Wlt,{}),children:y.jsx(sk,{className:"w-3 h-3"})}),e[75]=N):N=e[75],e[76]!==b||e[77]!==p||e[78]!==D?(E=y.jsxs("div",{className:b,children:[p,D,N]}),e[76]=b,e[77]=p,e[78]=D,e[79]=E):E=e[79],u=E}let h,g;return e[80]!==d?(h=d&&y.jsx(iB,{}),e[80]=d,e[81]=h):h=e[81],e[82]!==u||e[83]!==s.type||e[84]!==h?(g=y.jsx(za,{children:y.jsxs("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[u,h,s.type]})}),e[82]=u,e[83]=s.type,e[84]=h,e[85]=g):g=e[85],g},Q5=new vg,uN=hn.define(),$c=Eo.define({create:()=>au.python,update(t,e){for(const n of e.effects)if(n.is(uN))return n.value;return t},provide:t=>kp.from(t,e=>e.type==="python"?null:n=>function(r,o){const i=document.createElement("div");let a;return{dom:i,mount(){a=GN.createRoot(i),a.render(y.jsx(Hv,{store:Ht,children:y.jsx(o,{view:r})}))},update(){a==null||a.render(y.jsx(Hv,{store:Ht,children:y.jsx(o,{view:r})}))},destroy(){a==null||a.unmount()}}}(n,GPe))});function Ylt(){const t=Object.values(au),e=(n,r)=>{const o=t[r%t.length];return o.isSupported(n)?o:e(n,r+1)};return[Hi.of([{key:"F4",preventDefault:!0,run:n=>{const r=n.state.field($c),o=t.findIndex(s=>s.type===r.type),i=n.state.doc.toString(),a=e(i,o+1);return r!==a&&(KPe({view:n,nextLanguage:a,opts:{keepCodeAsIs:!1}}),!0)}}])]}function KPe({view:t,nextLanguage:e,opts:n}){const r=t.state.field($c),o=t.state.doc.toString(),i=t.state.facet(Yse),a=t.state.facet(Gse),s=t.state.facet(HQ),l=t.state.facet(YQ),c=t.state.facet(Kse);let u,d=t.state.field(ap),f=t.state.selection.main.head;if(n.keepCodeAsIs)u=o,r.type!==e.type&&(d={...e.defaultMetadata});else{const[h,g]=r.transformOut(o,d),[v,b,p]=e.transformIn(h);f+=g,f-=b,f=ag(f,0,v.length),u=v,d=p}t.dispatch({effects:[uN.of(e),fN.of(d),Q5.reconfigure(e.getExtension(l,i,a,s,c)),tN.reconfigure([]),pb.of(!0)],changes:n.keepCodeAsIs?void 0:{from:0,to:t.state.doc.length,insert:u},selection:n.keepCodeAsIs?void 0:et.cursor(f)}),t.dispatch({effects:[tN.reconfigure([AT()])]})}QLe=function(t){const{placeholderType:e,completionConfig:n,hotkeys:r,cellId:o,lspConfig:i}=t;return[Ylt(),Q5.of(au.python.getExtension(o,n,r,e,i)),$c,ap]},BLe=function(t){return function(e){return e?au.markdown.isSupported(e)?au.markdown:au.sql.isSupported(e)?au.sql:au.python:au.python}(pf({state:t}).trim())},yK=function(t,e){t.state.field($c).type!==e.language&&KPe({view:t,nextLanguage:au[e.language],opts:{keepCodeAsIs:e.keepCodeAsIs??!1}})},t8e=function(t,{completionConfig:e,hotkeysProvider:n,lspConfig:r}){const o=t.state.field($c),i=t.state.facet(HQ),a=t.state.facet(YQ);return Q5.reconfigure(o.getExtension(a,e,n,i,r))},pf=function(t,e,n){const r=t.state.field($c),o=t.state.field(ap),i=t.state.doc.toString();return e!==void 0?r.transformOut(i.slice(e,n),o)[0]:r.transformOut(i,o)[0]};function L5(t,e){const n=t.state.field($c),[r]=n.transformIn(e),o=t.state.doc;return o.toString()===r||t.dispatch({changes:{from:0,to:o.length,insert:r}}),r}const Glt=["marimo-carousel","marimo-tabs","marimo-accordion"];aG=function(t){const e=t.id;if(e)return{id:e};const n=t.textContent;return{path:`//${t.tagName}[contains(., "${n}")]`}};function JPe(t){if(t==null||t.mimetype!=="text/html"||t.data==null)return null;try{return Rn(typeof t.data=="string","expected string"),function(e){const n=[],r=new DOMParser().parseFromString(e,"text/html").querySelectorAll("h1, h2, h3");for(const o of Array.from(r)){const i=o.textContent;if(Glt.some(s=>o.closest(s))||!i)continue;const a=Number.parseInt(o.tagName[1],10);n.push({name:i,level:a,by:aG(o)})}return{items:n}}(t.data)}catch{return Ve.error("Failed to parse outline"),null}}u8e=function(t){return t!=null&&t.items.some(e=>e.level<=3)};function eEe(t,e){const n=a=>a.items.length===0?7:Math.min(...a.items.map(s=>s.level)),r=e[t];if(r==null||r.items.length===0)return Ve.warn("Failed to find a starting outline"),null;const o=n(r);let i=t+1;for(;i<e.length;){const a=e[i];if(a&&n(a)<=o)return[t,i-1];i++}return[t,e.length-1]}SM=function(t){return t==="application/vnd.marimo+error"||t==="application/vnd.marimo+traceback"};const Klt={markdown:!0,inline_ai_tooltip:!1,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1};RT=function(t){var e;return((e=fT().experimental)==null?void 0:e[t])??Klt[t]},function(t,e){if(typeof window>"u")return;const n=`__marimo__${e}`;window[n]&&Ve.warn(`Overwriting existing debug object ${n}`),window[n]=t}(function(t,e){const n=fT();n.experimental=n.experimental??{},n.experimental[t]=e,bG({config:n})},"setFeatureFlag"),WLe=Q_("marimo:rtc:username",""),lJ=bne(()=>RT("rtc_v2")),NO=class{static fromMilliseconds(t){return t==null?null:new NO(t)}static fromSeconds(t){return t==null?null:new NO(1e3*t)}static now(){return new NO(Date.now())}constructor(t){this.ms=t}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}};function tEe(t){const e=[...t];if(e.length===0)return e;const n=e[e.length-1];if(n.mimetype!=="text/plain")return e;const r=/\r[^\n]/g;let o=n.data;Rn(typeof o=="string","expected string");let i=o.search(r);for(;i>-1;){let a=-1;for(let u=i-1;u>=0;u--)if(o.at(u)===`
|
439
439
|
`){a=u;break}const s=o.slice(i+1),l=o.slice(0,a+1),c=o.slice(a+1,i);o=c.length<=s.length?l+s:l+s+c.slice(s.length),i=o.search(r)}return e[e.length-1]={...n,data:o},e}function nEe(t,e){let n,r=0;for(n=t.length-1;n>=0&&r<e;n--){const s=t[n];s.mimetype==="text/plain"?(Rn(typeof s.data=="string","expected string"),r+=s.data.split(`
|
440
440
|
`).length):r++}if(r<e)return t;const o=n+1,i={channel:"stderr",mimetype:"text/html",data:`<pre>Streaming output truncated to last ${e} lines.
|
441
441
|
</pre>`,timestamp:-1},a=t[o];if(a.mimetype==="text/plain"){Rn(typeof a.data=="string","expected string");const s=a.data.split(`
|
442
442
|
`),l=e-(r-s.length);return[i,{...a,data:s.slice(-l).join(`
|
443
443
|
`)},...t.slice(o+1)]}return[i,...t.slice(o+1)]}function Jlt(t,e){const n={...t};switch(e.status){case"queued":n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1;break;case"running":n.interrupted=!1,t.stopped&&(n.output=null),n.status==="queued"&&(n.consoleOutputs=[]),n.stopped=!1,n.runStartTimestamp=e.timestamp,n.lastRunStartTimestamp=e.timestamp;break;case"idle":t.runStartTimestamp&&(n.runElapsedTimeMs=NO.fromSeconds(e.timestamp-t.runStartTimestamp).toMilliseconds(),n.runStartTimestamp=null,n.staleInputs=!1),!t.lastRunStartTimestamp&&e.timestamp&&(n.lastRunStartTimestamp=e.timestamp),n.debuggerActive=!1;break;case null:case"disabled-transitively":case void 0:break;default:us(e.status)}n.output=e.output??n.output,n.staleInputs=e.stale_inputs??n.staleInputs,n.status=e.status??n.status,n.serialization=e.serialization;let r=!1;e.output!=null&&e.output.mimetype==="application/vnd.marimo+error"&&(n.status!=="queued"&&n.status!=="running"||(n.status="idle"),Rn(Array.isArray(e.output.data),"Expected error output data to be an array"),e.output.data.some(a=>a.type==="interruption")?(n.interrupted=!0,r=!0):e.output.data.some(a=>a.type.includes("ancestor"))?n.stopped=!0:n.errored=!0);let o=t.consoleOutputs;r&&(n.debuggerActive=!1,o=o.map(a=>a.channel==="stdin"?{...a,response:a.response??""}:a)),e.console!==null&&(o=Array.isArray(e.console)?e.console:function(a,s=5e3){const l=[...a];if(l.length<2)return nEe(tEe(l),s);const c=l[l.length-1],u=l[l.length-2];return function(d,f){const h=d.mimetype==="text/plain"&&f.mimetype==="text/plain";if(!h)return!1;const g=d.channel===f.channel,v=d.channel!=="stdin";return h&&g&&v}(c,u)&&(Rn(typeof c.data=="string","expected string"),Rn(typeof u.data=="string","expected string"),u.data+=c.data,l.pop()),nEe(tEe(l),s)}([...o,e.console].filter(Boolean))),n.consoleOutputs=o,n.outline=JPe(n.output);const i=[e.console].flat().filter(Boolean).filter(a=>a.channel==="pdb");return i.length>0&&i.some(a=>a.data==="start")&&(n.debuggerActive=!0),n}ZY=function(t){return t==="running"||t==="queued"},mQe=function(t,e){const{status:n,output:r,runStartTimestamp:o,interrupted:i,staleInputs:a}=t;if(i)return!1;if(e)return!0;const s=ZY(n),l=n==="running"&&r!==null&&o!==null&&r.timestamp>o;return!(!s||l)||a};let rEe=!1;function ect(t){var r;const e=[],n=[t.console].filter(Boolean).flat();for(const o of n)if(o.mimetype==="text/plain"){Rn(typeof o.data=="string","expected string");const i=o.channel==="stderr"||o.channel==="marimo-error";switch(o.channel){case"stdout":case"stderr":case"marimo-error":e.push({timestamp:o.timestamp||Date.now(),level:i?"stderr":"stdout",message:o.data,cellId:t.cell_id})}}if(e.forEach(oEe.log),n.length===0&&SM((r=t.output)==null?void 0:r.mimetype)&&Array.isArray(t.output.data)){t.output.data.forEach(i=>{oEe.log({level:"stderr",cellId:t.cell_id,timestamp:t.timestamp,message:JSON.stringify(i)})});const o=t.output.data.some(i=>i.type==="internal");!rEe&&o&&(rEe=!0,Kr({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-[var(--red-10)] py-2 pl-3 [&>*]:flex [&>*]:gap-3"}))}return e}const oEe={log:t=>{const e=t.level==="stdout"?"gray":t.level==="stderr"?"red":"orange",n=t.level.toUpperCase();console.log(`%c[${n}]`,`color:${e}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${CH(t.timestamp)}]`,`(${t.cellId}) ${t.message}`)}};CH=function(t){try{return function(n,r){return Ks(1e3*n,r==null?void 0:r.in)}(t).toLocaleTimeString("en-US",{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},e8e=function(t,e){var r,o;const n=(o=(r=t.get(ur).cellHandles[e])==null?void 0:r.current)==null?void 0:o.editorView;n?n.focus():Ve.warn(`[CellFocusManager] focusCellEditor: element not found: ${e}`)},JLe=function(t){const e=document.getElementById(Xs.create(t));e?aB(e):Ve.warn(`[CellFocusManager] focusCell: element not found: ${t}`)},CG=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function aB(t){try{t.focus()}catch{Ve.warn("[CellFocusManager] element may not be focusable",t)}}fJ=function(t,e){const{retries:n,delay:r,initialDelay:o=0}=e;let i=0;const a=()=>{if(i<n){try{if(t())return}catch(s){Ve.error(`Error executing function on attempt ${i+1}, retrying`,{error:s})}i++,setTimeout(a,r)}};o>0?setTimeout(a,o):a()};function X2({cellId:t,cell:e,isCodeHidden:n,codeFocus:r,variableName:o}){var a;if(!e)return;const i=document.getElementById(Xs.create(t));if(i)if(CG())aB(i);else{if(n)aB(i);else{const s=(a=e.current)==null?void 0:a.editorView;if(!s)return void Ve.warn("scrollCellIntoView: editor not found",t);if(s.hasFocus)return;if(fJ(()=>(s.focus(),s.hasFocus),{retries:5,delay:20}),r==="top")s.dispatch({selection:{anchor:0,head:0}});else if(r==="bottom"){const l=s.state.doc.line(s.state.doc.lines);s.dispatch({selection:{anchor:l.from,head:l.from}})}}i.scrollIntoView({behavior:"smooth",block:"nearest"})}else Ve.warn("scrollCellIntoView: element not found")}dQe=function(t){const e=document.getElementById(Xs.create(t));e?(e.classList.add("focus-outline"),setTimeout(()=>{e.classList.remove("focus-outline")},2e3),e.scrollIntoView({behavior:"smooth",block:"center"})):Ve.warn("scrollCellIntoView: element not found")},Pc=function({id:t,name:e=ET,code:n="",lastCodeRun:r=null,lastExecutionTime:o=null,edited:i=!1,config:a,serializedEditorState:s=null}){return{id:t,config:a||{hide_code:!1,disabled:!1,column:null},name:e,code:n,edited:i,lastCodeRun:r,lastExecutionTime:o,serializedEditorState:s}};function tct(t){return{hide_code:!1,disabled:!1,column:null,...t}}function su(t){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...t}}Al="__scratch__",Qc="setup";function iEe(t){return{...t,cellData:{[Al]:Pc({id:Al,config:{column:0,hide_code:!1,disabled:!1}}),...t.cellData},cellRuntime:{[Al]:su(),...t.cellRuntime},cellHandles:{[Al]:_.createRef(),...t.cellHandles}}}let aEe;({useActions:aEe,valueAtom:ur}=Xh(function(){return iEe({cellIds:gE.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})},{createNewCell:(t,e)=>{var g;const{cellId:n,before:r,code:o,lastCodeRun:i=null,lastExecutionTime:a=null,autoFocus:s=!0,skipIfCodeExists:l=!1,hideCode:c=!1}=e;let u,d;if(l){for(const v of t.cellIds.inOrderIds)if(((g=t.cellData[v])==null?void 0:g.code)===o)return t}if(n==="__end__"){const v=t.cellIds.atOrThrow(0);u=v.id,d=v.length}else if(typeof n=="string"){const v=t.cellIds.findWithId(n);u=v.id,d=v.topLevelIds.indexOf(n)}else{if(n.type!=="__end__")throw new Error("Invalid cellId");{const v=t.cellIds.get(n.columnId)||t.cellIds.atOrThrow(0);u=v.id,d=v.length}}const f=e.newCellId||ms.create(),h=r?d:d+1;return{...t,cellIds:t.cellIds.insertId(f,u,h),cellData:{...t.cellData,[f]:Pc({id:f,code:o,lastCodeRun:i,config:tct({hide_code:c}),lastExecutionTime:a,edited:!!o&&o!==i})},cellRuntime:{...t.cellRuntime,[f]:su()},cellHandles:{...t.cellHandles,[f]:_.createRef()},scrollKey:s?f:null,untouchedNewCells:c?new Set([...t.untouchedNewCells,f]):t.untouchedNewCells}},moveCell:(t,e)=>{const{cellId:n,before:r,direction:o}=e;if(r!==void 0&&o!==void 0&&Ve.warn("Both before and direction specified for moveCell. Ignoring one."),o){const s=t.cellIds.findWithId(n),l=t.cellIds.indexOf(s),c=o==="left"?l-1:l+1,u=t.cellIds.at(c);return u?{...t,cellIds:t.cellIds.moveAcrossColumns(s.id,n,u.id,void 0),scrollKey:n}:t}const i=t.cellIds.findWithId(n),a=i.indexOfOrThrow(n);return r&&a===0?{...t,cellIds:t.cellIds.moveWithinColumn(i.id,a,0),scrollKey:n}:r||a!==i.length-1?r?{...t,cellIds:t.cellIds.moveWithinColumn(i.id,a,a-1),scrollKey:n}:{...t,cellIds:t.cellIds.moveWithinColumn(i.id,a,a+1),scrollKey:n}:{...t,cellIds:t.cellIds.moveWithinColumn(i.id,a,i.length-1),scrollKey:n}},dropCellOverCell:(t,e)=>{const{cellId:n,overCellId:r}=e,o=t.cellIds.findWithId(n),i=t.cellIds.findWithId(r),a=o.indexOfOrThrow(n),s=i.indexOfOrThrow(r);return o.id===i.id?a===s?t:{...t,cellIds:t.cellIds.moveWithinColumn(o.id,a,s),scrollKey:null}:{...t,cellIds:t.cellIds.moveAcrossColumns(o.id,n,i.id,r),scrollKey:null}},dropCellOverColumn:(t,e)=>{const{cellId:n,columnId:r}=e,o=t.cellIds.findWithId(n);return{...t,cellIds:t.cellIds.moveAcrossColumns(o.id,n,r,void 0)}},dropOverNewColumn:(t,e)=>{const{cellId:n}=e;return{...t,cellIds:t.cellIds.moveToNewColumn(n)}},moveColumn:(t,e)=>e.column===e.overColumn?t:{...t,cellIds:t.cellIds.moveColumn(e.column,e.overColumn)},focusCell:(t,e)=>{const n=t.cellIds.findWithId(e.cellId);if(n.length===0)return t;const{cellId:r,where:o}=e,i=n.indexOfOrThrow(r);let a;a=o==="before"?ag(i-1,0,n.length-1):o==="after"?ag(i+1,0,n.length-1):i;const s=n.atOrThrow(a);return X2({cellId:s,cell:t.cellHandles[s],isCodeHidden:H2(t,s),codeFocus:o==="after"?"top":"bottom",variableName:void 0}),t},focusTopCell:t=>{const e=t.cellIds.getColumns().at(0);if(e===void 0||e.length===0)return t;const n=e.first();return X2({cellId:n,cell:t.cellHandles[n],isCodeHidden:H2(t,n),codeFocus:void 0,variableName:void 0}),function(){const r=document.getElementById("App");r==null||r.scrollTo({top:0,behavior:"smooth"})}(),t},focusBottomCell:t=>{const e=t.cellIds.getColumns().at(-1);if(e===void 0||e.length===0)return t;const n=e.last();return X2({cellId:n,cell:t.cellHandles[n],isCodeHidden:H2(t,n),codeFocus:void 0,variableName:void 0}),function(){const r=document.getElementById("App");r==null||r.scrollTo({top:r.scrollHeight,behavior:"smooth"})}(),t},sendToTop:(t,e)=>{const n=t.cellIds.findWithId(e.cellId);if(n.length===0)return t;const{cellId:r,scroll:o=!0}=e,i=n.indexOfOrThrow(r);return i===0?t:{...t,cellIds:t.cellIds.moveWithinColumn(n.id,i,0),scrollKey:o?r:null}},sendToBottom:(t,e)=>{const n=t.cellIds.findWithId(e.cellId);if(n.length===0)return t;const{cellId:r,scroll:o=!0}=e,i=n.indexOfOrThrow(r),a=n.length-1;return i===a?t:{...t,cellIds:t.cellIds.moveWithinColumn(n.id,i,a),scrollKey:o?r:null}},addColumn:(t,e)=>{const n=ms.create();return{...t,cellIds:t.cellIds.addColumn(e.columnId,[n]),cellData:{...t.cellData,[n]:Pc({id:n})},cellRuntime:{...t.cellRuntime,[n]:su()},cellHandles:{...t.cellHandles,[n]:_.createRef()},scrollKey:n}},addColumnBreakpoint:(t,e)=>{const{cellId:n}=e;return t.cellIds.getColumns()[0].inOrderIds[0]===n?t:{...t,cellIds:t.cellIds.insertBreakpoint(n)}},deleteColumn:(t,e)=>{const{columnId:n}=e;return{...t,cellIds:t.cellIds.delete(n)}},mergeAllColumns:t=>({...t,cellIds:t.cellIds.mergeAllColumns()}),compactColumns:t=>({...t,cellIds:t.cellIds.compact()}),deleteCell:(t,e)=>{var c;const n=e.cellId;if(t.cellIds.hasOnlyOneId())return t;const r=t.cellIds.findWithId(n),o=r.indexOfOrThrow(n),i=o===0?1:o-1;let a=null;r.length>1&&(a=r.atOrThrow(i));const s=(c=t.cellHandles[n].current)==null?void 0:c.editorView,l=s==null?void 0:s.state.toJSON({history:jJ});return l.doc=t.cellData[n].code,{...t,cellIds:t.cellIds.deleteById(n),history:[...t.history,{name:t.cellData[n].name,serializedEditorState:l,column:r.id,index:o,isSetupCell:n===Qc}],scrollKey:a}},undoDeleteCell:t=>{if(t.history.length===0)return t;const e=t.history[t.history.length-1],{name:n,serializedEditorState:r={doc:""},column:o,index:i,isSetupCell:a}=e,s=a?Qc:ms.create(),l=Pc({id:s,name:n,code:r.doc,edited:r.doc.trim().length>0,serializedEditorState:r});return{...t,cellIds:t.cellIds.insertId(s,o,i),cellData:{...t.cellData,[s]:l},cellRuntime:{...t.cellRuntime,[s]:su()},cellHandles:{...t.cellHandles,[s]:_.createRef()},history:t.history.slice(0,-1)}},clearSerializedEditorState:(t,e)=>{const{cellId:n}=e;return zb({state:t,cellId:n,cellReducer:r=>({...r,serializedEditorState:null})})},updateCellCode:(t,e)=>{const{cellId:n,code:r,formattingChange:o}=e;return t.cellData[n]?zb({state:t,cellId:n,cellReducer:i=>o?{...i,code:r,lastCodeRun:i.edited?i.lastCodeRun:r}:{...i,code:r,edited:r.trim()!==i.lastCodeRun}}):t},updateCellName:(t,e)=>{const{cellId:n,name:r}=e;return zb({state:t,cellId:n,cellReducer:o=>({...o,name:r})})},updateCellConfig:(t,e)=>{const{cellId:n,config:r}=e;return zb({state:t,cellId:n,cellReducer:o=>({...o,config:{...o.config,...r}})})},prepareForRun:(t,e)=>zb({state:Y2({state:t,cellId:e.cellId,cellReducer:n=>function(r){const o={...r};return r.status!=="disabled-transitively"&&(o.status="queued"),o.interrupted=!1,o.errored=!1,o.runElapsedTimeMs=null,o.debuggerActive=!1,o}(n)}),cellId:e.cellId,cellReducer:n=>({...n,edited:!1,lastCodeRun:n.code.trim()})}),handleCellMessage:(t,e)=>{const n=Y2({state:t,cellId:e.cell_id,cellReducer:r=>Jlt(r,e)});return{...n,cellLogs:[...n.cellLogs,...ect(e)]}},setCellIds:(t,e)=>{if(mf(t.cellIds.inOrderIds,e.cellIds))return t;const n={...t.cellData},r={...t.cellRuntime},o={...t.cellHandles};for(const i of e.cellIds)i in t.cellData||(n[i]=Pc({id:i})),i in t.cellRuntime||(r[i]=su()),i in t.cellHandles||(o[i]=_.createRef());return{...t,cellIds:gE.fromWithPreviousShape(e.cellIds,t.cellIds),cellData:n,cellRuntime:r,cellHandles:o}},setCellCodes:(t,e)=>{Rn(e.codes.length===e.ids.length,"Expected codes and ids to have the same length");let n={...t};const r=({cell:o,code:i,cellId:a})=>{if(!o)return Pc({id:a,code:i,lastCodeRun:e.codeIsStale?null:i,edited:e.codeIsStale&&i.trim().length>0});const s=e.codeIsStale?o.lastCodeRun:i,l=s?s.trim()!==i.trim():!!i;if(o.code.trim()===i.trim())return{...o,code:i,edited:l,lastCodeRun:s};if(!lJ()){const c=n.cellHandles[a].current;c!=null&&c.editorViewOrNull&&L5(c.editorViewOrNull,i)}return{...o,code:i,edited:l,lastCodeRun:s}};for(const[o,i]of M9e(e.ids,e.codes))o!==void 0&&i!==void 0&&(n={...n,cellData:{...n.cellData,[o]:r({cell:n.cellData[o],code:i,cellId:o})}});return n},setStdinResponse:(t,e)=>{const{cellId:n,response:r,outputIndex:o}=e;return Y2({state:t,cellId:n,cellReducer:i=>{const a=[...i.consoleOutputs],s=a[o];return s.channel!=="stdin"?(Ve.warn("Expected stdin output"),i):(a[o]={channel:"stdin",mimetype:s.mimetype,data:s.data,timestamp:s.timestamp,response:r},{...i,interrupted:!1,consoleOutputs:a})}})},setCells:(t,e)=>{const n=Object.fromEntries(e.map(o=>[o.id,o])),r=Object.fromEntries(e.map(o=>[o.id,su()]));return iEe({...t,cellIds:gE.fromIdsAndColumns(e.map(o=>[o.id,o.config.column])),cellData:n,cellRuntime:r,cellHandles:Object.fromEntries(e.map(o=>[o.id,_.createRef()]))})},moveToNextCell:(t,e)=>{const{cellId:n,before:r,noCreate:o=!1}=e;if(n===Al)return t;const i=t.cellIds.findWithId(n),a=i.indexOfOrThrow(n),s=r?a-1:a+1,l=s===i.length,c=s===-1;if(l&&!o){const u=ms.create();return{...t,cellIds:t.cellIds.insertId(u,i.id,s),cellData:{...t.cellData,[u]:Pc({id:u})},cellRuntime:{...t.cellRuntime,[u]:su()},cellHandles:{...t.cellHandles,[u]:_.createRef()},scrollKey:u}}if(c&&!o){const u=ms.create();return{...t,cellIds:t.cellIds.insertId(u,i.id,0),cellData:{...t.cellData,[u]:Pc({id:u})},cellRuntime:{...t.cellRuntime,[u]:su()},cellHandles:{...t.cellHandles,[u]:_.createRef()},scrollKey:u}}if((l||c)&&o)return t;if(s>=0&&s<i.length){const u=i.atOrThrow(s);X2({cellId:u,cell:t.cellHandles[u],isCodeHidden:H2(t,u),codeFocus:r?"bottom":"top",variableName:void 0})}return t},markTouched:(t,e)=>{const{cellId:n}=e;if(t.untouchedNewCells.has(n)){const r=new Set(t.untouchedNewCells);return r.delete(n),{...t,untouchedNewCells:r}}return t},scrollToTarget:t=>{const e=t.scrollKey;if(e===null)return t;const n=t.cellIds.findWithId(e),r=n.indexOfOrThrow(e),o=r===n.length-1?n.last():n.atOrThrow(r);return X2({cellId:o,cell:t.cellHandles[o],isCodeHidden:H2(t,o),codeFocus:void 0,variableName:void 0}),{...t,scrollKey:null}},foldAll:t=>{const e=Object.values(t.cellHandles).map(n=>{var r;return(r=n.current)==null?void 0:r.editorView});return Wqe(e),t},unfoldAll:t=>{const e=Object.values(t.cellHandles).map(n=>{var r;return(r=n.current)==null?void 0:r.editorView});return Uqe(e),t},clearLogs:t=>({...t,cellLogs:[]}),collapseCell:(t,e)=>{const{cellId:n}=e,r=t.cellIds.findWithId(n),o=r.topLevelIds.map(s=>t.cellRuntime[s].outline),i=eEe(r.indexOfOrThrow(n),o);if(!i)return t;const a=r.atOrThrow(i[1]);return{...t,cellIds:t.cellIds.transformWithCellId(n,s=>s.collapse(n,a)),scrollKey:n}},expandCell:(t,e)=>{const{cellId:n}=e;return{...t,cellIds:t.cellIds.transformWithCellId(n,r=>r.expand(n)),scrollKey:n}},collapseAllCells:t=>({...t,cellIds:t.cellIds.transformAll(e=>{const n=e.topLevelIds.map(s=>t.cellRuntime[s].outline),r=[],o=[];let i=[...e.nodes].length-1;for(;i>=0;){const s=eEe(i,n);if(s){const l=i;let c=s[1];const u=r.find(h=>h.start<=c&&h.end===c);u&&(c=u.start),r.push({start:l,end:c});const d=e.atOrThrow(l),f=e.atOrThrow(c);o.push({id:d,until:f})}else o.push(null);i--}const a=o.reverse();return e.collapseAll(a)})}),expandAllCells:t=>({...t,cellIds:t.cellIds.transformAll(e=>e.expandAll())}),showCellIfHidden:(t,e)=>{const{cellId:n}=e,r=t.cellIds.findWithId(n),o=r,i=r.findAndExpandDeep(n);return i.equals(o)?t:{...t,cellIds:t.cellIds.transformWithCellId(n,()=>i)}},splitCell:(t,e)=>{var u;const{cellId:n}=e,r=t.cellIds.findWithId(n),o=r.indexOfOrThrow(n),i=t.cellData[n],a=t.cellHandles[n].current;if((a==null?void 0:a.editorView)==null)return t;const{beforeCursorCode:s,afterCursorCode:l}=function(d){const f=d.state.selection.main.head,h=d.state.doc.toString(),g=h.length>0&&h[f-1]===`
|
444
444
|
`,v=h.length>0&&h[f]===`
|
445
|
-
`?f+1:f;return{beforeCursorCode:pf(d,0,g?f-1:f),afterCursorCode:pf(d,v)}}(a.editorView);L5(a.editorView,s);const c=ms.create();return{...t,cellIds:t.cellIds.insertId(c,r.id,o+1),cellData:{...t.cellData,[n]:{...i,code:s,edited:!!s&&s.trim()!==((u=i.lastCodeRun)==null?void 0:u.trim())},[c]:Pc({id:c,code:l,edited:!!l})},cellRuntime:{...t.cellRuntime,[n]:{...t.cellRuntime[n],output:null,consoleOutputs:[]},[c]:su()},cellHandles:{...t.cellHandles,[c]:_.createRef()},scrollKey:c}},undoSplitCell:(t,e)=>{var a;const{cellId:n,snapshot:r}=e,o=t.cellData[n],i=t.cellHandles[n].current;return(i==null?void 0:i.editorView)==null?t:(L5(i.editorView,r),{...t,cellIds:t.cellIds.transformWithCellId(n,s=>{const l=s.indexOfOrThrow(n)+1;return s.deleteAtIndex(l)}),cellData:{...t.cellData,[n]:{...o,code:r,edited:!!r&&(r==null?void 0:r.trim())!==((a=o.lastCodeRun)==null?void 0:a.trim())}},cellRuntime:{...t.cellRuntime,[n]:{...t.cellRuntime[n],output:null,consoleOutputs:[]}},cellHandles:{...t.cellHandles}})},clearCellOutput:(t,e)=>{const{cellId:n}=e;return Y2({state:t,cellId:n,cellReducer:r=>({...r,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(t,e)=>{const{cellId:n}=e;return Y2({state:t,cellId:n,cellReducer:r=>({...r,consoleOutputs:r.consoleOutputs.filter(o=>o.channel==="stdin"&&o.response==null)})})},clearAllCellOutputs:t=>{const e={...t.cellRuntime};for(const n of t.cellIds.inOrderIds)e[n]={...e[n],output:null,consoleOutputs:[]};return{...t,cellRuntime:e}},upsertSetupCell:(t,e)=>{const{code:n}=e;return Qc in t.cellData?zb({state:t,cellId:Qc,cellReducer:r=>{var o;return{...r,code:n,edited:n.trim()!==((o=r.lastCodeRun)==null?void 0:o.trim())}}}):{...t,cellIds:t.cellIds.insertId(Qc,t.cellIds.atOrThrow(0).id,0),cellData:{...t.cellData,[Qc]:Pc({id:Qc,name:Qc,code:n,edited:!!n})},cellRuntime:{...t.cellRuntime,[Qc]:su()},cellHandles:{...t.cellHandles,[Qc]:_.createRef()}}}}));function H2(t,e){return t.cellData[e].config.hide_code&&!t.untouchedNewCells.has(e)}function Y2({state:t,cellId:e,cellReducer:n}){return e in t.cellRuntime?{...t,cellRuntime:{...t.cellRuntime,[e]:n(t.cellRuntime[e])}}:(Ve.warn(`Cell ${e} not found in state`),t)}function zb({state:t,cellId:e,cellReducer:n}){return e in t.cellData?{...t,cellData:{...t.cellData,[e]:n(t.cellData[e])}}:(Ve.warn(`Cell ${e} not found in state`),t)}iLe=function(t){const e=t.cellData,n={column:null};return t.cellIds.getColumns().length>1?t.cellIds.getColumns().flatMap((r,o)=>r.inOrderIds.map((i,a)=>{const s={...n};return a===0&&(s.column=o),{...e[i].config,...s}})):t.cellIds.getColumns().flatMap(r=>r.inOrderIds.map(o=>({...e[o].config,...n})))};let sB,sEe,lEe;wN=Ct(t=>t(ur).cellIds),X6e=Ct(t=>t(wN).hasOnlyOneId()),nLe=Ct(t=>EK(t(ur)).length>0),rLe=Ct(t=>oK(t(ur)).length>0),xLe=Ct(t=>t(ur).history.length>0),cLe=Ct(t=>rK(t(ur)).length>0),sB=Ct(t=>{const{cellIds:e,cellRuntime:n,cellData:r}=t(ur);return e.inOrderIds.map(i=>{var l;const a=n[i],{name:s}=r[i];if(SM((l=a.output)==null?void 0:l.mimetype)){Rn(Array.isArray(a.output.data),"Expected array data");const c=a.output.data.filter(u=>!u.type.includes("ancestor"));if(c.length>0)return{output:{...a.output,data:c},cellId:i,cellName:s}}return null}).filter(Boolean)}),sQe=Ct(t=>{const{cellIds:e,cellRuntime:n}=t(ur);return function(r){return{items:r.filter(Boolean).flatMap(o=>o.items)}}(e.inOrderIds.map(r=>n[r].outline))}),i8e=Ct(t=>t(sB).length),sEe=function(t,e=mf){let n=_ne;return Ct(r=>{const o=r(t);return n!==_ne&&e(n,o)||(n=o),n})}(Ct(t=>{const{cellIds:e,cellData:n}=t(ur);return cr.fromEntries(e.inOrderIds.map(r=>{var o;return[r,(o=n[r])==null?void 0:o.name]}))})),yQe=()=>Gr(ur),_H=()=>Gr(wN),KJ=()=>Gr(sEe),nQe=()=>Gr(sB),T8e=()=>Gr(ur).cellLogs,gG=()=>Ht.get(ur),tQe=()=>{const{cellIds:t,cellData:e}=Ht.get(ur);return t.inOrderIds.map(n=>{var r;return(r=e[n])==null?void 0:r.name}).filter(Boolean)},lEe=(Ds=function(t,e,n=Object.is){return((r,o,i,a)=>{const s=UQ(()=>new WeakMap,$qe,o),l=UQ(()=>new WeakMap,s,i);return UQ(r,l,a)})(()=>{const r=Symbol(),o=Ct(i=>{const a=i(o);return(([s,l])=>{if(l===r)return e(s);const c=e(s,l);return n(l,c)?l:c})([i(t),a])});return o.init=r,o},t,e,n)}(ur,t=>t.cellIds.inOrderIds.map(e=>t.cellData[e])),((t,e,n)=>{const r=Gae(()=>new WeakMap,Iqe,e);return Gae(t,r,n)})(()=>{const t=new WeakMap,e=(o,i)=>{let a=t.get(o);if(a)return a;const s=i&&t.get(i),l=[],c=[];return o.forEach((u,d)=>{const f=d;c[d]=f;const h=s&&s.atomList[s.keyList.indexOf(f)];if(h)return void(l[d]=h);const g=v=>{const b=v(n),p=v(Ds),O=e(p,b==null?void 0:b.arr).keyList.indexOf(f);if(O<0||O>=p.length){const k=o[e(o).keyList.indexOf(f)];if(k)return k;throw new Error("splitAtom: index out of bounds for read")}return p[O]};l[d]=Kae(Ds)?Ct(g,(v,b,p)=>{const O=v(n),k=v(Ds),S=e(k,O==null?void 0:O.arr).keyList.indexOf(f);if(S<0||S>=k.length)throw new Error("splitAtom: index out of bounds for write");const w=(T=>typeof T=="function")(p)?p(k[S]):p;Object.is(k[S],w)||b(Ds,[...k.slice(0,S),w,...k.slice(S+1)])}):Ct(g)}),a=s&&s.keyList.length===c.length&&s.keyList.every((u,d)=>u===c[d])?s:{arr:o,atomList:l,keyList:c},t.set(o,a),a},n=Ct(o=>{const i=o(n),a=o(Ds);return e(a,i==null?void 0:i.arr)});(qw?"production":void 0)!=="production"&&(n.debugPrivate=!0),n.init=void 0;const r=Kae(Ds)?Ct(o=>o(n).atomList,(o,i,a)=>{switch(a.type){case"remove":{const s=o(r).indexOf(a.atom);if(s>=0){const l=o(Ds);i(Ds,[...l.slice(0,s),...l.slice(s+1)])}break}case"insert":{const s=a.before?o(r).indexOf(a.before):o(r).length;if(s>=0){const l=o(Ds);i(Ds,[...l.slice(0,s),a.value,...l.slice(s)])}break}case"move":{const s=o(r).indexOf(a.atom),l=a.before?o(r).indexOf(a.before):o(r).length;if(s>=0&&l>=0){const c=o(Ds);i(Ds,s<l?[...c.slice(0,s),...c.slice(s+1,l),c[s],...c.slice(l)]:[...c.slice(0,l),c[s],...c.slice(l,s),...c.slice(s+1)])}break}}}):Ct(o=>o(n).atomList);return r},Ds,Qqe));var Ds;O8e=()=>ss(lEe),RH=Ct(t=>{return e=t(ur),Object.values(e.cellRuntime).some(n=>n.status==="running");var e}),a8e=Ct(t=>{return e=t(ur),Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length;var e}),b8e=Ct(t=>t(ur).cellIds.colLength),n8e=Ct(t=>t(ur).cellIds.idLength>0),g8e=Ct(t=>t(ur).cellIds.getColumnIds()),AK=()=>{const{cellIds:t,cellHandles:e}=Ht.get(ur);return t.inOrderIds.map(n=>{var r,o;return(o=(r=e[n])==null?void 0:r.current)==null?void 0:o.editorView}).filter(Boolean)},hK=t=>{var n;const{cellHandles:e}=Ht.get(ur);return(n=e[t].current)==null?void 0:n.editorView},bQe=function(t){const{cellIds:e,cellData:n,cellRuntime:r}=t;return e.getColumns().flatMap(o=>o.topLevelIds.map(i=>({...n[i],...r[i]})))},d8e=function(t){return Ct(e=>e(ur).untouchedNewCells.has(t))};function nct(t){const e=Ct(n=>{const r=n(ur).cellRuntime[t];if(!r||r.status!=="idle")return;const o=r.consoleOutputs;if(!o||o.length===0)return;const i=o.find(a=>a.mimetype==="application/vnd.marimo+traceback");if(i)return i.data});return Ct(n=>{const r=n(e);if(r)return Xse(r)})}Iv=function(){return aEe()};let mm=function(t){return t.INSERT="insert",t.DELETE="delete",t.SUBSTITUTE="substitute",t.MATCH="match",t}({});function rct(t,e,n){const r=[];let o=0;for(const i of e)switch(i.type){case mm.MATCH:r.push(t[o]),o++;break;case mm.DELETE:o++;break;case mm.INSERT:r.push(n);break;case mm.SUBSTITUTE:r.push(n),o++}return r}function oct(t,e,n,r){const o=function(i,a,s){const l=i.length,c=a.length,u=Array.from({length:l+1},()=>Array.from({length:c+1}).fill(0));for(let g=0;g<=l;g++)u[g][0]=g;for(let g=0;g<=c;g++)u[0][g]=g;for(let g=1;g<=l;g++)for(let v=1;v<=c;v++)u[g][v]=s(i[g-1],a[v-1])?u[g-1][v-1]:1+Math.min(u[g-1][v],u[g][v-1],u[g-1][v-1]);const d=[];let f=l,h=c;for(;f>0||h>0;)f>0&&h>0&&s(i[f-1],a[h-1])?(d.unshift({type:mm.MATCH,position:f-1}),f--,h--):f>0&&h>0&&u[f][h]===u[f-1][h-1]+1?(d.unshift({type:mm.SUBSTITUTE,position:f-1}),f--,h--):f>0&&u[f][h]===u[f-1][h]+1?(d.unshift({type:mm.DELETE,position:f-1}),f--):h>0&&u[f][h]===u[f][h-1]+1&&(d.unshift({type:mm.INSERT,position:f}),h--);return{distance:u[l][c],operations:d}}(t,e,n);return{merged:rct(t,o.operations,r),edits:o}}function cEe(){return{id:ms.create(),name:"",code:"",code_hash:null,config:{column:null,disabled:!1,hide_code:!1}}}function uEe(){return{id:ms.create(),code_hash:null,console:[],outputs:[]}}function ict(t,e){var n,r,o;return{id:t,name:e.name??"",code:e.code??"",edited:!1,lastCodeRun:null,lastExecutionTime:null,config:{column:((n=e.config)==null?void 0:n.column)??null,disabled:((r=e.config)==null?void 0:r.disabled)??!1,hide_code:((o=e.config)==null?void 0:o.hide_code)??!1},serializedEditorState:null}}function act(t){const e=su();if(!t)return e;const n=t.outputs||[],r=n.find(i=>i.type==="data")||n.find(i=>i.type==="error")||n[0];if(r){if(r.type==="error")e.output={channel:"marimo-error",data:[{type:"unknown",msg:r.evalue}],mimetype:"application/vnd.marimo+error",timestamp:0};else if(r.type==="data"){const i=Object.keys(r.data)[0],a=Object.values(r.data)[0];e.output={channel:"output",data:a,mimetype:i,timestamp:0}}}const o=t.console||[];return{...e,outline:e.output?JPe(e.output):null,consoleOutputs:o.map(i=>i.type==="streamMedia"?{channel:"media",data:i.data,mimetype:i.mimetype,timestamp:0}:{channel:i.name==="stderr"?"stderr":"stdout",data:i.text,mimetype:"text/plain",timestamp:0})}}function sct(t,e){const{cellIds:n,sessionCellData:r,notebookCellData:o}=function(s,l){const c=new Map,u=new Map;if(!s&&!l)return{cellIds:[],sessionCellData:c,notebookCellData:u};if(!s){const g=(l==null?void 0:l.cells.map(v=>v.id??ms.create()))||[];return{cellIds:g,sessionCellData:new Map(g.map((v,b)=>[v,null])),notebookCellData:new Map(g.map((v,b)=>[v,(l==null?void 0:l.cells[b])||cEe()]))}}if(!l){const g=s.cells.map(v=>v.id??ms.create());return{cellIds:g,sessionCellData:new Map(g.map((v,b)=>[v,s.cells[b]])),notebookCellData:new Map(g.map(v=>[v,cEe()]))}}const{merged:d,edits:f}=oct(s.cells,l.cells,(g,v)=>{const b=g.code_hash;return b?v.code_hash===b:g.id===v.id},uEe());f.distance>0&&Ve.warn("Session and notebook have different cells, attempted merge.");const h=[];for(let g=0;g<l.cells.length;g++){const v=l.cells[g];if(v){const b=v.id??ms.create();h.push(b);const p=d[g]||uEe();p.id=b,c.set(b,p),u.set(b,v)}else Ve.warn("Merged notebook cell is null at index",g)}return{cellIds:h,sessionCellData:c,notebookCellData:u}}(t,e);if(n.length===0)return Ve.warn("Session and notebook must have at least one cell"),null;const i={},a={};for(const s of n){const l=r.get(s),c=o.get(s);c&&(i[s]=ict(s,c)),a[s]=act(l)}return{cellIds:gE.from([n]),cellData:i,cellRuntime:a,cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set}}const dEe=Object.freeze({left:0,top:0,width:16,height:16}),z5=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),G2=Object.freeze({...dEe,...z5}),lB=Object.freeze({...G2,body:"",hidden:!1}),lct=Object.freeze({width:null,height:null}),fEe=Object.freeze({...lct,...z5}),cct=/[\s,]+/,hEe={...fEe,preserveAspectRatio:""};function pEe(t){const e={...hEe},n=(r,o)=>t.getAttribute(r)||o;return e.width=n("width",null),e.height=n("height",null),e.rotate=function(r,o=0){const i=r.replace(/^-?[0-9.]*/,"");function a(s){for(;s<0;)s+=4;return s%4}if(i===""){const s=parseInt(r);return isNaN(s)?0:a(s)}if(i!==r){let s=0;switch(i){case"%":s=25;break;case"deg":s=90}if(s){let l=parseFloat(r.slice(0,r.length-i.length));return isNaN(l)?0:(l/=s,l%1==0?a(l):0)}}return o}(n("rotate","")),function(r,o){o.split(cct).forEach(i=>{switch(i.trim()){case"horizontal":r.hFlip=!0;break;case"vertical":r.vFlip=!0}})}(e,n("flip","")),e.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),e}const mEe=/^[a-z0-9]+(-[a-z0-9]+)*$/,K2=(t,e,n,r="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const s=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:r,prefix:l,name:s};return e&&!V5(c)?null:c}const i=o[0],a=i.split("-");if(a.length>1){const s={provider:r,prefix:a.shift(),name:a.join("-")};return e&&!V5(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:i};return e&&!V5(s,n)?null:s}return null},V5=(t,e)=>!!t&&!(!(e&&t.prefix===""||t.prefix)||!t.name);function gEe(t,e){const n=function(r,o){const i={};!r.hFlip!=!o.hFlip&&(i.hFlip=!0),!r.vFlip!=!o.vFlip&&(i.vFlip=!0);const a=((r.rotate||0)+(o.rotate||0))%4;return a&&(i.rotate=a),i}(t,e);for(const r in lB)r in z5?r in t&&!(r in n)&&(n[r]=z5[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function uct(t,e,n){const r=t.icons,o=t.aliases||Object.create(null);let i={};function a(s){i=gEe(r[s]||o[s],i)}return a(e),n.forEach(a),gEe(t,i)}function vEe(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const r=function(o){const i=o.icons,a=o.aliases||Object.create(null),s=Object.create(null);return Object.keys(i).concat(Object.keys(a)).forEach(function l(c){if(i[c])return s[c]=[];if(!(c in s)){s[c]=null;const u=a[c]&&a[c].parent,d=u&&l(u);d&&(s[c]=[u].concat(d))}return s[c]}),s}(t);for(const o in r){const i=r[o];i&&(e(o,uct(t,o,i)),n.push(o))}return n}const dct={provider:"",aliases:{},not_found:{},...dEe};function cB(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function yEe(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!cB(t,dct))return null;const n=e.icons;for(const o in n){const i=n[o];if(!o||typeof i.body!="string"||!cB(i,lB))return null}const r=e.aliases||Object.create(null);for(const o in r){const i=r[o],a=i.parent;if(!o||typeof a!="string"||!n[a]&&!r[a]||!cB(i,lB))return null}return e}const q5=Object.create(null);function yh(t,e){const n=q5[t]||(q5[t]=Object.create(null));return n[e]||(n[e]=function(r,o){return{provider:r,prefix:o,icons:Object.create(null),missing:new Set}}(t,e))}function bEe(t,e){return yEe(e)?vEe(e,(n,r)=>{r?t.icons[n]=r:t.missing.add(n)}):[]}function fct(t,e){let n=[];return(typeof t=="string"?[t]:Object.keys(q5)).forEach(r=>{(typeof r=="string"&&typeof e=="string"?[e]:Object.keys(q5[r]||{})).forEach(o=>{const i=yh(r,o);n=n.concat(Object.keys(i.icons).map(a=>(r!==""?"@"+r+":":"")+o+":"+a))})}),n}let J2=!1;function xEe(t){return typeof t=="boolean"&&(J2=t),J2}function eC(t){const e=typeof t=="string"?K2(t,!0,J2):t;if(e){const n=yh(e.provider,e.prefix),r=e.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function OEe(t,e){const n=K2(t,!0,J2);if(!n)return!1;const r=yh(n.provider,n.prefix);return e?function(o,i,a){try{if(typeof a.body=="string")return o.icons[i]={...a},!0}catch{}return!1}(r,n.name,e):(r.missing.add(n.name),!0)}function wEe(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),J2&&!e&&!t.prefix){let r=!1;return yEe(t)&&(t.prefix="",vEe(t,(o,i)=>{OEe(o,i)&&(r=!0)})),r}const n=t.prefix;return V5({prefix:n,name:"a"})?!!bEe(yh(e,n),t):!1}function kEe(t){return!!eC(t)}function hct(t){const e=eC(t);return e&&{...G2,...e}}function SEe(t,e){t.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==e))})}let pct=0;const uB=Object.create(null);function CEe(t,e){uB[t]=e}function dB(t){return uB[t]||uB[""]}var mct={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function gct(t,e,n,r){const o=t.resources.length,i=t.random?Math.floor(Math.random()*o):t.index;let a;if(t.random){let S=t.resources.slice(0);for(a=[];S.length>1;){const w=Math.floor(Math.random()*S.length);a.push(S[w]),S=S.slice(0,w).concat(S.slice(w+1))}a=a.concat(S)}else a=t.resources.slice(i).concat(t.resources.slice(0,i));const s=Date.now();let l,c="pending",u=0,d=null,f=[],h=[];function g(){d&&(clearTimeout(d),d=null)}function v(){c==="pending"&&(c="aborted"),g(),f.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),f=[]}function b(S,w){w&&(h=[]),typeof S=="function"&&h.push(S)}function p(){c="failed",h.forEach(S=>{S(void 0,l)})}function O(){f.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),f=[]}function k(){if(c!=="pending")return;g();const S=a.shift();if(S===void 0)return f.length?void(d=setTimeout(()=>{g(),c==="pending"&&(O(),p())},t.timeout)):void p();const w={status:"pending",resource:S,callback:(T,P)=>{(function(j,D,N){const E=D!=="success";switch(f=f.filter(A=>A!==j),c){case"pending":break;case"failed":if(E||!t.dataAfterTimeout)return;break;default:return}if(D==="abort")return l=N,void p();if(E)return l=N,void(f.length||(a.length?k():p()));if(g(),O(),!t.random){const A=t.resources.indexOf(j.resource);A!==-1&&A!==t.index&&(t.index=A)}c="completed",h.forEach(A=>{A(N)})})(w,T,P)}};f.push(w),u++,d=setTimeout(k,t.rotate),n(S,e,w.callback)}return typeof r=="function"&&h.push(r),setTimeout(k),function(){return{startTime:s,payload:e,status:c,queriesSent:u,queriesPending:f.length,subscribe:b,abort:v}}}function _Ee(t){const e={...mct,...t};let n=[];function r(){n=n.filter(i=>i().status==="pending")}return{query:function(i,a,s){const l=gct(e,i,a,(c,u)=>{r(),s&&s(c,u)});return n.push(l),l},find:function(i){return n.find(a=>i(a))||null},setIndex:i=>{e.index=i},getIndex:()=>e.index,cleanup:r}}function fB(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const F5=Object.create(null),B5=["https://api.simplesvg.com","https://api.unisvg.com"],hB=[];for(;B5.length>0;)B5.length===1||Math.random()>.5?hB.push(B5.shift()):hB.push(B5.pop());function TEe(t,e){const n=fB(e);return n!==null&&(F5[t]=n,!0)}function W5(t){return F5[t]}function vct(){return Object.keys(F5)}function PEe(){}F5[""]=fB({resources:["https://api.iconify.design"].concat(hB)});const pB=Object.create(null);function EEe(t,e,n){let r,o;if(typeof t=="string"){const i=dB(t);if(!i)return n(void 0,424),PEe;o=i.send;const a=function(s){if(!pB[s]){const l=W5(s);if(!l)return;const c={config:l,redundancy:_Ee(l)};pB[s]=c}return pB[s]}(t);a&&(r=a.redundancy)}else{const i=fB(t);if(i){r=_Ee(i);const a=dB(t.resources?t.resources[0]:"");a&&(o=a.send)}}return r&&o?r.query(e,o,n)().abort:(n(void 0,424),PEe)}function REe(){}function yct(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let r=!1;const o=e.provider,i=e.prefix;n.forEach(a=>{const s=a.icons,l=s.pending.length;s.pending=s.pending.filter(c=>{if(c.prefix!==i)return!0;const u=c.name;if(e.icons[u])s.loaded.push({provider:o,prefix:i,name:u});else{if(!e.missing.has(u))return r=!0,!0;s.missing.push({provider:o,prefix:i,name:u})}return!1}),s.pending.length!==l&&(r||SEe([e],a.id),a.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),a.abort))})}))}(t)}))}function tC(t,e,n){function r(){const o=t.pendingIcons;e.forEach(i=>{o&&o.delete(i),t.icons[i]||t.missing.add(i)})}if(n&&typeof n=="object")try{if(!bEe(t,n).length)return void r()}catch(o){console.error(o)}r(),yct(t)}function jEe(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function bct(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:r}=t,o=t.iconsToLoad;if(delete t.iconsToLoad,!o||!o.length)return;const i=t.loadIcon;if(t.loadIcons&&(o.length>1||!i))return void jEe(t.loadIcons(o,r,n),c=>{tC(t,o,c)});if(i)return void o.forEach(c=>{jEe(i(c,r,n),u=>{tC(t,[c],u?{prefix:r,icons:{[c]:u}}:null)})});const{valid:a,invalid:s}=function(c){const u=[],d=[];return c.forEach(f=>{(f.match(mEe)?u:d).push(f)}),{valid:u,invalid:d}}(o);if(s.length&&tC(t,s,null),!a.length)return;const l=r.match(mEe)?dB(n):null;if(!l)return void tC(t,a,null);l.prepare(n,r,a).forEach(c=>{EEe(n,c,u=>{tC(t,c.icons,u)})})}))}const mB=(t,e)=>{const n=function(l,c=!0,u=!1){const d=[];return l.forEach(f=>{const h=typeof f=="string"?K2(f,c,u):f;h&&d.push(h)}),d}(t,!0,xEe()),r=function(l){const c={loaded:[],missing:[],pending:[]},u=Object.create(null);l.sort((f,h)=>f.provider!==h.provider?f.provider.localeCompare(h.provider):f.prefix!==h.prefix?f.prefix.localeCompare(h.prefix):f.name.localeCompare(h.name));let d={provider:"",prefix:"",name:""};return l.forEach(f=>{if(d.name===f.name&&d.prefix===f.prefix&&d.provider===f.provider)return;d=f;const h=f.provider,g=f.prefix,v=f.name,b=u[h]||(u[h]=Object.create(null)),p=b[g]||(b[g]=yh(h,g));let O;O=v in p.icons?c.loaded:g===""||p.missing.has(v)?c.missing:c.pending;const k={provider:h,prefix:g,name:v};O.push(k)}),c}(n);if(!r.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(r.loaded,r.missing,r.pending,REe)}),()=>{l=!1}}const o=Object.create(null),i=[];let a,s;return r.pending.forEach(l=>{const{provider:c,prefix:u}=l;if(u===s&&c===a)return;a=c,s=u,i.push(yh(c,u));const d=o[c]||(o[c]=Object.create(null));d[u]||(d[u]=[])}),r.pending.forEach(l=>{const{provider:c,prefix:u,name:d}=l,f=yh(c,u),h=f.pendingIcons||(f.pendingIcons=new Set);h.has(d)||(h.add(d),o[c][u].push(d))}),i.forEach(l=>{const c=o[l.provider][l.prefix];c.length&&bct(l,c)}),e?function(l,c,u){const d=pct++,f=SEe.bind(null,u,d);if(!c.pending.length)return f;const h={id:d,icons:c,callback:l,abort:f};return u.forEach(g=>{(g.loaderCallbacks||(g.loaderCallbacks=[])).push(h)}),f}(e,r,i):REe},xct=t=>new Promise((e,n)=>{const r=typeof t=="string"?K2(t,!0):t;r?mB([r||t],o=>{if(o.length&&r){const i=eC(r);if(i)return void e({...G2,...i})}n(t)}):n(t)});function DEe(t){try{const e=typeof t=="string"?JSON.parse(t):t;if(typeof e.body=="string")return{...e}}catch{}}let AEe=!1;try{AEe=navigator.vendor.indexOf("Apple")===0}catch{}const Oct=/(-?[0-9.]*[0-9]+[0-9.]*)/g,wct=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function gB(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const r=t.split(Oct);if(r===null||!r.length)return t;const o=[];let i=r.shift(),a=wct.test(i);for(;;){if(a){const s=parseFloat(i);isNaN(s)?o.push(i):o.push(Math.ceil(s*e*n)/n)}else o.push(i);if(i=r.shift(),i===void 0)return o.join("");a=!a}}function MEe(t,e){const n={...G2,...t},r={...fEe,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach(v=>{const b=[],p=v.hFlip,O=v.vFlip;let k,S=v.rotate;switch(p?O?S+=2:(b.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),b.push("scale(-1 1)"),o.top=o.left=0):O&&(b.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),b.push("scale(1 -1)"),o.top=o.left=0),S<0&&(S-=4*Math.floor(S/4)),S%=4,S){case 1:k=o.height/2+o.top,b.unshift("rotate(90 "+k.toString()+" "+k.toString()+")");break;case 2:b.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:k=o.width/2+o.left,b.unshift("rotate(-90 "+k.toString()+" "+k.toString()+")")}S%2==1&&(o.left!==o.top&&(k=o.left,o.left=o.top,o.top=k),o.width!==o.height&&(k=o.width,o.width=o.height,o.height=k)),b.length&&(i=function(w,T,P){const j=function(D,N="defs"){let E="";const A=D.indexOf("<"+N);for(;A>=0;){const I=D.indexOf(">",A),L=D.indexOf("</"+N);if(I===-1||L===-1)break;const F=D.indexOf(">",L);if(F===-1)break;E+=D.slice(I+1,L).trim(),D=D.slice(0,A).trim()+D.slice(F+1)}return{defs:E,content:D}}(w);return function(D,N){return D?"<defs>"+D+"</defs>"+N:N}(j.defs,T+j.content+P)}(i,'<g transform="'+b.join(" ")+'">',"</g>"))});const a=r.width,s=r.height,l=o.width,c=o.height;let u,d;a===null?(d=s===null?"1em":s==="auto"?c:s,u=gB(d,l/c)):(u=a==="auto"?l:a,d=s===null?gB(u,c/l):s==="auto"?c:s);const f={},h=(v,b)=>{(p=>p==="unset"||p==="undefined"||p==="none")(b)||(f[v]=b.toString())};h("width",u),h("height",d);const g=[o.left,o.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:i}}function vB(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in e)n+=" "+r+'="'+e[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function NEe(t){return'url("'+function(e){return"data:image/svg+xml,"+function(n){return n.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(t)+'")'}let U5=(()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}})();function kct(t){U5=t}function Sct(){return U5}const Cct={prepare:(t,e,n)=>{const r=[],o=function(l,c){const u=W5(l);if(!u)return 0;let d;if(u.maxURL){let f=0;u.resources.forEach(g=>{f=Math.max(f,g.length)});const h=c+".json?icons=";d=u.maxURL-f-u.path.length-h.length}else d=0;return d}(t,e),i="icons";let a={type:i,provider:t,prefix:e,icons:[]},s=0;return n.forEach((l,c)=>{s+=l.length+1,s>=o&&c>0&&(r.push(a),a={type:i,provider:t,prefix:e,icons:[]},s=l.length),a.icons.push(l)}),r.push(a),r},send:(t,e,n)=>{if(!U5)return void n("abort",424);let r=function(i){if(typeof i=="string"){const a=W5(i);if(a)return a.path}return"/"}(e.provider);switch(e.type){case"icons":{const i=e.prefix,a=e.icons.join(",");r+=i+".json?"+new URLSearchParams({icons:a}).toString();break}case"custom":{const i=e.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:return void n("abort",400)}let o=503;U5(t+r).then(i=>{const a=i.status;if(a===200)return o=501,i.json();setTimeout(()=>{n(function(s){return s===404}(a)?"abort":"next",a)})}).then(i=>{setTimeout(typeof i=="object"&&i!==null?()=>{n("success",i)}:()=>{i===404?n("abort",i):n("next",o)})}).catch(()=>{n("next",o)})}};function _ct(t,e,n){yh(n||"",e).loadIcons=t}function Tct(t,e,n){yh(n||"",e).loadIcon=t}const yB="data-style";let $Ee="";function Pct(t){$Ee=t}function IEe(t,e){let n=Array.from(t.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(yB));n||(n=document.createElement("style"),n.setAttribute(yB,yB),t.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block;margin:auto}"+$Ee}function QEe(){let t;CEe("",Cct),xEe(!0);try{t=window}catch{}if(t){if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!wEe(r))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(const n in e){const r="IconifyProviders["+n+"] is invalid.";try{const o=e[n];if(typeof o!="object"||!o||o.resources===void 0)continue;TEe(n,o)||console.error(r)}catch{console.error(r)}}}}return{enableCache:e=>{},disableCache:e=>{},iconLoaded:kEe,iconExists:kEe,getIcon:hct,listIcons:fct,addIcon:OEe,addCollection:wEe,calculateSize:gB,buildIcon:MEe,iconToHTML:vB,svgToURL:NEe,loadIcons:mB,loadIcon:xct,addAPIProvider:TEe,setCustomIconLoader:Tct,setCustomIconsLoader:_ct,appendCustomStyle:Pct,_api:{getAPIConfig:W5,setAPIModule:CEe,sendAPIQuery:EEe,setFetch:kct,getFetch:Sct,listAPIProviders:vct}}}const bB={"background-color":"currentColor"},LEe={"background-color":"transparent"},zEe={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},VEe={"-webkit-mask":bB,mask:bB,background:LEe};for(const t in VEe){const e=VEe[t];for(const n in zEe)e[t+"-"+n]=zEe[n]}function qEe(t){return t?t+(t.match(/^[-0-9.]+$/)?"px":""):"inherit"}let nC;function Ect(t){return nC===void 0&&function(){try{nC=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{nC=null}}(),nC?nC.createHTML(t):t}function xB(t){return Array.from(t.childNodes).find(e=>{const n=e.tagName&&e.tagName.toUpperCase();return n==="SPAN"||n==="SVG"})}function FEe(t,e){const n=e.icon.data,r=e.customisations,o=MEe(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const i=e.renderedMode;let a;i==="svg"?a=function(l){const c=document.createElement("span"),u=l.attributes;let d="";u.width||(d="width: inherit;"),u.height||(d+="height: inherit;"),d&&(u.style=d);const f=vB(l.body,u);return c.innerHTML=Ect(f),c.firstChild}(o):a=function(l,c,u){const d=document.createElement("span");let f=l.body;f.indexOf("<a")!==-1&&(f+="<!-- "+Date.now()+" -->");const h=l.attributes,g=NEe(vB(f,{...h,width:c.width+"",height:c.height+""})),v=d.style,b={"--svg":g,width:qEe(h.width),height:qEe(h.height),...u?bB:LEe};for(const p in b)v.setProperty(p,b[p]);return d}(o,{...G2,...n},i==="mask");const s=xB(t);s?a.tagName==="SPAN"&&s.tagName===a.tagName?s.setAttribute("style",a.getAttribute("style")):t.replaceChild(a,s):t.appendChild(a)}function BEe(t,e,n){return{rendered:!1,inline:e,icon:t,lastRender:n&&(n.rendered?n:n.lastRender)}}const Rct=function(t="iconify-icon"){let e,n;try{e=window.customElements,n=window.HTMLElement}catch{return}if(!e||!n)return;const r=e.get(t);if(r)return r;const o=["icon","mode","inline","noobserver","width","height","rotate","flip"],i=class extends n{constructor(){super();en(this,"_shadowRoot");en(this,"_initialised",!1);en(this,"_state");en(this,"_checkQueued",!1);en(this,"_connected",!1);en(this,"_observer",null);en(this,"_visible",!0);const l=this._shadowRoot=this.attachShadow({mode:"open"}),c=this.hasAttribute("inline");IEe(l,c),this._state=BEe({value:""},c),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(l){switch(l){case"inline":{const c=this.hasAttribute("inline"),u=this._state;c!==u.inline&&(u.inline=c,IEe(this._shadowRoot,c));break}case"noobserver":this.hasAttribute("noobserver")?this.startObserver():this.stopObserver();break;default:this._queueCheck()}}get icon(){const l=this.getAttribute("icon");if(l&&l.slice(0,1)==="{")try{return JSON.parse(l)}catch{}return l}set icon(l){typeof l=="object"&&(l=JSON.stringify(l)),this.setAttribute("icon",l)}get inline(){return this.hasAttribute("inline")}set inline(l){l?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(l){l?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const l=this._state;if(l.rendered){const c=this._shadowRoot;if(l.renderedMode==="svg")try{return void c.lastChild.setCurrentTime(0)}catch{}FEe(c,l)}}get status(){const l=this._state;return l.rendered?"rendered":l.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const l=this._state,c=this.getAttribute("icon");if(c!==l.icon.value)return void this._iconChanged(c);if(!l.rendered||!this._visible)return;const u=this.getAttribute("mode"),d=pEe(this);l.attrMode===u&&!function(f,h){for(const g in hEe)if(f[g]!==h[g])return!0;return!1}(l.customisations,d)&&xB(this._shadowRoot)||this._renderIcon(l.icon,d,u)}_iconChanged(l){const c=function(u,d){if(typeof u=="object")return{data:DEe(u),value:u};if(typeof u!="string")return{value:u};if(u.includes("{")){const v=DEe(u);if(v)return{data:v,value:u}}const f=K2(u,!0,!0);if(!f)return{value:u};const h=eC(f);if(h!==void 0||!f.prefix)return{value:u,name:f,data:h};const g=mB([f],()=>d(u,f,eC(f)));return{value:u,name:f,loading:g}}(l,(u,d,f)=>{const h=this._state;if(h.rendered||this.getAttribute("icon")!==u)return;const g={value:u,name:d,data:f};g.data?this._gotIconData(g):h.icon=g});c.data?this._gotIconData(c):this._state=BEe(c,this._state.inline,this._state)}_forceRender(){if(!this._visible){const l=xB(this._shadowRoot);return void(l&&this._shadowRoot.removeChild(l))}this._queueCheck()}_gotIconData(l){this._checkQueued=!1,this._renderIcon(l,pEe(this),this.getAttribute("mode"))}_renderIcon(l,c,u){const d=function(h,g){switch(g){case"svg":case"bg":case"mask":return g}return g==="style"||!AEe&&h.indexOf("<a")!==-1?h.indexOf("currentColor")===-1?"bg":"mask":"svg"}(l.data.body,u),f=this._state.inline;FEe(this._shadowRoot,this._state={rendered:!0,icon:l,inline:f,customisations:c,attrMode:u,renderedMode:d})}startObserver(){if(!this._observer&&!this.hasAttribute("noobserver"))try{this._observer=new IntersectionObserver(l=>{const c=l.some(u=>u.isIntersecting);c!==this._visible&&(this._visible=c,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};o.forEach(s=>{s in i.prototype||Object.defineProperty(i.prototype,s,{get:function(){return this.getAttribute(s)},set:function(l){l!==null?this.setAttribute(s,l):this.removeAttribute(s)}})});const a=QEe();for(const s in a)i[s]=i.prototype[s]=a[s];return e.define(t,i),i}()||QEe(),{enableCache:Iyt,disableCache:Qyt,iconLoaded:Lyt,iconExists:zyt,getIcon:Vyt,listIcons:qyt,addIcon:Fyt,addCollection:Byt,calculateSize:Wyt,buildIcon:Uyt,iconToHTML:Zyt,svgToURL:Xyt,loadIcons:Hyt,loadIcon:Yyt,setCustomIconLoader:Gyt,setCustomIconsLoader:Kyt,addAPIProvider:Jyt,_api:e1t}=Rct,OB=_.createContext(null),jct=t=>{const{controller:e}=_.useContext(OB),n=ge.useRef(Symbol("fill"));return _.useEffect(()=>(e.mount({name:t.name,ref:n.current,children:t.children}),()=>{e.unmount({name:t.name,ref:n.current})}),[]),_.useEffect(()=>{e.update({name:t.name,ref:n.current,children:t.children})}),null};var Dct=Object.defineProperty,WEe=(t,e,n)=>(((r,o,i)=>{o in r?Dct(r,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[o]=i})(t,typeof e!="symbol"?e+"":e,n),n);const UEe=console;class Act{constructor(e){WEe(this,"_bus"),WEe(this,"_db"),this._bus=e,this.handleFillMount=this.handleFillMount.bind(this),this.handleFillUpdated=this.handleFillUpdated.bind(this),this.handleFillUnmount=this.handleFillUnmount.bind(this),this._db={byName:new Map,byFill:new Map}}mount(){this._bus.on("fill-mount",this.handleFillMount),this._bus.on("fill-updated",this.handleFillUpdated),this._bus.on("fill-unmount",this.handleFillUnmount)}unmount(){this._bus.off("fill-mount",this.handleFillMount),this._bus.off("fill-updated",this.handleFillUpdated),this._bus.off("fill-unmount",this.handleFillUnmount)}handleFillMount({fill:e}){const n=_.Children.toArray(e.children),r=e.name,o={fill:e,children:n,name:r},i=this._db.byName.get(r);i?(i.components.push(o),i.listeners.forEach(a=>a([...i.components]))):this._db.byName.set(r,{listeners:[],components:[o]}),this._db.byFill.set(e.ref,o)}handleFillUpdated({fill:e}){const n=this._db.byFill.get(e.ref),r=_.Children.toArray(e.children);if(n){n.children=r;const o=this._db.byName.get(n.name);if(!o)throw new Error("registration was expected to be defined");o.listeners.forEach(i=>i([...o.components]))}else UEe.error("[handleFillUpdated] component was expected to be defined")}handleFillUnmount({fill:e}){const n=this._db.byFill.get(e.ref);if(!n)return void UEe.error("[handleFillUnmount] component was expected to be defined");const r=n.name,o=this._db.byName.get(r);if(!o)throw new Error("registration was expected to be defined");const i=o.components;o.components=i.filter(a=>a!==n),this._db.byFill.delete(e.ref),o.listeners.length===0&&o.components.length===0?this._db.byName.delete(r):o.listeners.forEach(a=>a([...o.components]))}onComponentsChange(e,n){const r=this._db.byName.get(e);r?(r.listeners.push(n),n(r.components)):(this._db.byName.set(e,{listeners:[n],components:[]}),n([]))}getFillsByName(e){const n=this._db.byName.get(e);return n?n.components.map(r=>r.fill):[]}getChildrenByName(e){const n=this._db.byName.get(e);return n?n.components.map(r=>r.children).reduce((r,o)=>r.concat(o),[]):[]}removeOnComponentsChange(e,n){const r=this._db.byName.get(e);if(!r)throw new Error("expected registration to be defined");const o=r.listeners;o.splice(o.indexOf(n),1)}}var Mct=Object.defineProperty,Nct=(t,e,n)=>(((r,o,i)=>{o in r?Mct(r,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[o]=i})(t,e+"",n),n);class ZEe{constructor(){Nct(this,"bus",function(e){return{all:e=e||new Map,on:function(n,r){var o=e.get(n);o?o.push(r):e.set(n,[r])},off:function(n,r){var o=e.get(n);o&&(r?o.splice(o.indexOf(r)>>>0,1):e.set(n,[]))},emit:function(n,r){var o=e.get(n);o&&o.slice().map(function(i){i(r)}),(o=e.get("*"))&&o.slice().map(function(i){i(n,r)})}}}())}mount(e){this.bus.emit("fill-mount",{fill:e})}unmount(e){this.bus.emit("fill-unmount",{fill:e})}update(e){this.bus.emit("fill-updated",{fill:e})}}const XEe=({controller:t,children:e})=>{const[n]=ge.useState(()=>{const r=function(o){const i=o||new ZEe;return{controller:i,manager:new Act(i.bus)}}(t);return r.manager.mount(),r});return ge.useEffect(()=>()=>{n.manager.unmount()},[]),ge.createElement(OB.Provider,{value:n},e)};hM=function(t,e){const[n,r]=_.useState([]),{manager:o}=_.useContext(OB);return _.useEffect(()=>(o.onComponentsChange(t,r),()=>{o.removeOnComponentsChange(t,r)}),[t]),n.flatMap((i,a)=>{const{children:s}=i;return s.map((l,c)=>{if(typeof l=="number"||typeof l=="string")throw new Error("Only element children will work here");return ge.cloneElement(l,{key:a.toString()+c.toString(),...e})})})};let HEe,wB;oG=t=>{const e=hM(t.name,t.childProps);if(typeof t.children=="function"){const n=t.children(e);if(ge.isValidElement(n)||n===null)return n;throw new Error("Slot rendered with function must return a valid React Element.")}return e},HEe=()=>(ue.c(1),null),wB=_.memo(t=>{const e=ue.c(3),{children:n}=t,{theme:r}=as();let o,i;return e[0]!==r?(o=()=>(document.body.classList.add(r,`${r}-theme`),()=>{document.body.classList.remove(r,`${r}-theme`)}),i=[r],e[0]=r,e[1]=o,e[2]=i):(o=e[1],i=e[2]),_.useLayoutEffect(o,i),n}),wB.displayName="ThemeProvider";const $ct=t=>{const e=ue.c(3),{variables:n,children:r}=t;let o;return e[0]!==r||e[1]!==n?(o=y.jsx("div",{className:"contents",style:n,children:r}),e[0]=r,e[1]=n,e[2]=o):o=e[2],o},kB=t=>{let e=null;const n=async()=>(e||(e=t()),e),r=ge.lazy(()=>n());return{preload:n,Component:r}};var SB="ToastProvider",[CB,Ict,Qct]=Lp("Toast"),[YEe,t1t]=Wo("Toast",[Qct]),[Lct,Z5]=YEe(SB),GEe=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:a}=t,[s,l]=_.useState(null),[c,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${SB}\`. Expected non-empty \`string\`.`),y.jsx(CB.Provider,{scope:e,children:y.jsx(Lct,{scope:e,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:_.useCallback(()=>u(h=>h+1),[]),onToastRemove:_.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:a})})};GEe.displayName=SB;var KEe="ToastViewport",zct=["F8"],_B="toast.viewportPause",TB="toast.viewportResume",JEe=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=zct,label:o="Notifications ({hotkey})",...i}=t,a=Z5(KEe,n),s=Ict(n),l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=ln(e,d,a.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=a.toastCount>0;_.useEffect(()=>{const b=p=>{var k;r.length!==0&&r.every(S=>p[S]||p.code===S)&&((k=d.current)==null||k.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),_.useEffect(()=>{const b=l.current,p=d.current;if(g&&b&&p){const O=()=>{if(!a.isClosePausedRef.current){const T=new CustomEvent(_B);p.dispatchEvent(T),a.isClosePausedRef.current=!0}},k=()=>{if(a.isClosePausedRef.current){const T=new CustomEvent(TB);p.dispatchEvent(T),a.isClosePausedRef.current=!1}},S=T=>{!b.contains(T.relatedTarget)&&k()},w=()=>{b.contains(document.activeElement)||k()};return b.addEventListener("focusin",O),b.addEventListener("focusout",S),b.addEventListener("pointermove",O),b.addEventListener("pointerleave",w),window.addEventListener("blur",O),window.addEventListener("focus",k),()=>{b.removeEventListener("focusin",O),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",O),b.removeEventListener("pointerleave",w),window.removeEventListener("blur",O),window.removeEventListener("focus",k)}}},[g,a.isClosePausedRef]);const v=_.useCallback(({tabbingDirection:b})=>{const p=s().map(O=>{const k=O.ref.current,S=[k,...Wct(k)];return b==="forwards"?S:S.reverse()});return(b==="forwards"?p.reverse():p).flat()},[s]);return _.useEffect(()=>{const b=d.current;if(b){const p=O=>{var S,w,T;const k=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!k){const P=document.activeElement,j=O.shiftKey;if(O.target===b&&j)return void((S=c.current)==null?void 0:S.focus());const D=v({tabbingDirection:j?"backwards":"forwards"}),N=D.findIndex(E=>E===P);RB(D.slice(N+1))?O.preventDefault():j?(w=c.current)==null||w.focus():(T=u.current)==null||T.focus()}};return b.addEventListener("keydown",p),()=>b.removeEventListener("keydown",p)}},[s,v]),y.jsxs(sle,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&y.jsx(PB,{ref:c,onFocusFromOutsideViewport:()=>{RB(v({tabbingDirection:"forwards"}))}}),y.jsx(CB.Slot,{scope:n,children:y.jsx(_t.ol,{tabIndex:-1,...i,ref:f})}),g&&y.jsx(PB,{ref:u,onFocusFromOutsideViewport:()=>{RB(v({tabbingDirection:"backwards"}))}})]})});JEe.displayName=KEe;var eRe="ToastFocusProxy",PB=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=t,i=Z5(eRe,n);return y.jsx(NE,{"aria-hidden":!0,tabIndex:0,...o,ref:e,style:{position:"fixed"},onFocus:a=>{var l;const s=a.relatedTarget;!((l=i.viewport)!=null&&l.contains(s))&&r()}})});PB.displayName=eRe;var rC="Toast",tRe=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...a}=t,[s,l]=Ao({prop:r,defaultProp:o??!0,onChange:i,caller:rC});return y.jsx(Uo,{present:n||s,children:y.jsx(Fct,{open:s,...a,ref:e,onClose:()=>l(!1),onPause:Lo(t.onPause),onResume:Lo(t.onResume),onSwipeStart:ut(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ut(t.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:ut(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ut(t.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});tRe.displayName=rC;var[Vct,qct]=YEe(rC,{onClose(){}}),Fct=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...g}=t,v=Z5(rC,n),[b,p]=_.useState(null),O=ln(e,L=>p(L)),k=_.useRef(null),S=_.useRef(null),w=o||v.duration,T=_.useRef(0),P=_.useRef(w),j=_.useRef(0),{onToastAdd:D,onToastRemove:N}=v,E=Lo(()=>{var F;(b==null?void 0:b.contains(document.activeElement))&&((F=v.viewport)==null||F.focus()),a()}),A=_.useCallback(L=>{L&&L!==1/0&&(window.clearTimeout(j.current),T.current=new Date().getTime(),j.current=window.setTimeout(E,L))},[E]);_.useEffect(()=>{const L=v.viewport;if(L){const F=()=>{A(P.current),c==null||c()},Q=()=>{const W=new Date().getTime()-T.current;P.current=P.current-W,window.clearTimeout(j.current),l==null||l()};return L.addEventListener(_B,Q),L.addEventListener(TB,F),()=>{L.removeEventListener(_B,Q),L.removeEventListener(TB,F)}}},[v.viewport,w,l,c,A]),_.useEffect(()=>{i&&!v.isClosePausedRef.current&&A(w)},[i,w,v.isClosePausedRef,A]),_.useEffect(()=>(D(),()=>N()),[D,N]);const I=_.useMemo(()=>b?lRe(b):null,[b]);return v.viewport?y.jsxs(y.Fragment,{children:[I&&y.jsx(Bct,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),y.jsx(Vct,{scope:n,onClose:E,children:Lh.createPortal(y.jsx(CB.ItemSlot,{scope:n,children:y.jsx(ale,{asChild:!0,onEscapeKeyDown:ut(s,()=>{v.isFocusedToastEscapeKeyDownRef.current||E(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:y.jsx(_t.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection,...g,ref:O,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ut(t.onKeyDown,L=>{L.key==="Escape"&&(s==null||s(L.nativeEvent),L.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,E()))}),onPointerDown:ut(t.onPointerDown,L=>{L.button===0&&(k.current={x:L.clientX,y:L.clientY})}),onPointerMove:ut(t.onPointerMove,L=>{if(!k.current)return;const F=L.clientX-k.current.x,Q=L.clientY-k.current.y,W=!!S.current,U=["left","right"].includes(v.swipeDirection),X=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,G=U?X(0,F):0,ae=U?0:X(0,Q),ne=L.pointerType==="touch"?10:2,re={x:G,y:ae},Z={originalEvent:L,delta:re};W?(S.current=re,X5("toast.swipeMove",d,Z,{discrete:!1})):cRe(re,v.swipeDirection,ne)?(S.current=re,X5("toast.swipeStart",u,Z,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(F)>ne||Math.abs(Q)>ne)&&(k.current=null)}),onPointerUp:ut(t.onPointerUp,L=>{const F=S.current,Q=L.target;if(Q.hasPointerCapture(L.pointerId)&&Q.releasePointerCapture(L.pointerId),S.current=null,k.current=null,F){const W=L.currentTarget,U={originalEvent:L,delta:F};cRe(F,v.swipeDirection,v.swipeThreshold)?X5("toast.swipeEnd",h,U,{discrete:!0}):X5("toast.swipeCancel",f,U,{discrete:!0}),W.addEventListener("click",X=>X.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),Bct=t=>{const{__scopeToast:e,children:n,...r}=t,o=Z5(rC,e),[i,a]=_.useState(!1),[s,l]=_.useState(!1);return function(c=()=>{}){const u=Lo(c);Zo(()=>{let d=0,f=0;return d=window.requestAnimationFrame(()=>f=window.requestAnimationFrame(u)),()=>{window.cancelAnimationFrame(d),window.cancelAnimationFrame(f)}},[u])}(()=>a(!0)),_.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:y.jsx(zg,{asChild:!0,children:y.jsx(NE,{...r,children:i&&y.jsxs(y.Fragment,{children:[o.label," ",n]})})})},nRe=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(_t.div,{...r,ref:e})});nRe.displayName="ToastTitle";var rRe=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(_t.div,{...r,ref:e})});rRe.displayName="ToastDescription";var oRe="ToastAction",iRe=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?y.jsx(sRe,{altText:n,asChild:!0,children:y.jsx(EB,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${oRe}\`. Expected non-empty \`string\`.`),null)});iRe.displayName=oRe;var aRe="ToastClose",EB=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,o=qct(aRe,n);return y.jsx(sRe,{asChild:!0,children:y.jsx(_t.button,{type:"button",...r,ref:e,onClick:ut(t.onClick,o.onClose)})})});EB.displayName=aRe;var sRe=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...o}=t;return y.jsx(_t.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:e})});function lRe(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),function(r){return r.nodeType===r.ELEMENT_NODE}(n)){const r=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!r)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&e.push(i)}else e.push(...lRe(n))}}),e}function X5(t,e,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?Hw(o,i):o.dispatchEvent(i)}var cRe=(t,e,n=0)=>{const r=Math.abs(t.x),o=Math.abs(t.y),i=r>o;return e==="left"||e==="right"?i&&r>n:!i&&o>n};function Wct(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function RB(t){const e=document.activeElement;return t.some(n=>n===e||(n.focus(),document.activeElement!==e))}var uRe=JEe,dRe=tRe,fRe=nRe,hRe=rRe,pRe=iRe,mRe=EB;const Uct=GEe,gRe=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:w-fit md:max-w-[420px]",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(uRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});gRe.displayName=uRe.displayName;const Zct=Po("data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full",{variants:{variant:{default:"bg-background border",danger:"group destructive text-error border-destructive bg-[var(--red-1)] shadow-mdSolid shadow-error"}},defaultVariants:{variant:"default"}}),vRe=_.forwardRef((t,e)=>{const n=ue.c(11);let r,o,i;n[0]!==t?({className:r,variant:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const a=i||"default";let s,l;return n[4]!==r||n[5]!==a?(s=we(Zct({variant:a}),"print:hidden",r),n[4]=r,n[5]=a,n[6]=s):s=n[6],n[7]!==o||n[8]!==e||n[9]!==s?(l=y.jsx(dRe,{ref:e,className:s,...o}),n[7]=o,n[8]=e,n[9]=s,n[10]=l):l=n[10],l});vRe.displayName=dRe.displayName;const Xct=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-destructive/30 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(pRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});Xct.displayName=pRe.displayName;const yRe=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-500 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",r),n[3]=r,n[4]=i):i=n[4],n[5]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(Qa,{className:"h-4 w-4"}),n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==i?(s=y.jsx(mRe,{ref:e,className:i,"toast-close":"",...o,children:a}),n[6]=o,n[7]=e,n[8]=i,n[9]=s):s=n[9],s});yRe.displayName=mRe.displayName;const bRe=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("text-sm font-semibold",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(fRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});bRe.displayName=fRe.displayName;const xRe=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("text-sm opacity-90",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(hRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});xRe.displayName=hRe.displayName;const Hct=()=>{const t=ue.c(5),{toasts:e}=function(){const i=ue.c(5),[a,s]=_.useState(FE);let l,c,u;return i[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>(M6.add(s),()=>{M6.delete(s)}),i[0]=l):l=i[0],i[1]!==a?(c=[a],i[1]=a,i[2]=c):c=i[2],_.useEffect(l,c),i[3]!==a?(u={...a,dismiss:rBe},i[3]=a,i[4]=u):u=i[4],u}();let n,r,o;return t[0]!==e?(n=e.map(Yct),t[0]=e,t[1]=n):n=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(r=y.jsx(gRe,{}),t[2]=r):r=t[2],t[3]!==n?(o=y.jsxs(Uct,{children:[n,r]}),t[3]=n,t[4]=o):o=t[4],o};function Yct(t){const{id:e,title:n,description:r,action:o,...i}=t;return y.jsxs(vRe,{...i,children:[y.jsxs("div",{className:"grid gap-1",children:[n&&y.jsx(bRe,{children:n}),r&&y.jsx(xRe,{children:r})]}),o,y.jsx(yRe,{})]},e)}let Vb,jB,DB,AB;Vb=new ZEe,og={SIDEBAR:"sidebar",CONTEXT_AWARE_PANEL:"context-aware-panel"},jB=kB(()=>Be(()=>import("./home-page-Br6OmxCk.js"),__vite__mapDeps([116,117,113,118,119]),import.meta.url)),DB=kB(()=>Be(()=>import("./run-page-BszrF35R.js"),__vite__mapDeps([120,121,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,122,123]),import.meta.url)),AB=kB(()=>Be(()=>import("./edit-page-Bulfs5xd.js").then(async t=>(await t.__tla,t)).then(t=>t.e),__vite__mapDeps([124,117,113,118,121,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,122,123,125,126,127,128,103,107,129,130,131]),import.meta.url));const ORe=_.memo(()=>{const t=ue.c(12),[e]=sG(),[n]=fG();let r;t[0]!==e.display.code_editor_font_size?(r=function(u){return u/16+"rem"}(e.display.code_editor_font_size),t[0]=e.display.code_editor_font_size,t[1]=r):r=t[1];const o=r;let i;t[2]!==n||t[3]!==e?(i=()=>{const u=aT();return u==="home"?y.jsx(jB.Component,{}):u==="read"?y.jsx(DB.Component,{appConfig:n}):y.jsx(AB.Component,{userConfig:e,appConfig:n})},t[2]=n,t[3]=e,t[4]=i):i=t[4];const a=i;let s,l,c;return t[5]!==o?(s={"--marimo-code-editor-font-size":o},t[5]=o,t[6]=s):s=t[6],t[7]!==a?(l=a(),t[7]=a,t[8]=l):l=t[8],t[9]!==s||t[10]!==l?(c=y.jsx(wRe,{children:y.jsx($ct,{variables:s,children:l})}),t[9]=s,t[10]=l,t[11]=c):c=t[11],c});ORe.displayName="MarimoApp";const wRe=_.memo(t=>{const e=ue.c(4),{children:n}=t;let r,o,i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=y.jsx(Hct,{}),o=y.jsx(HEe,{}),e[0]=r,e[1]=o):(r=e[0],o=e[1]),e[2]!==n?(i=y.jsx(Bh,{children:y.jsx(_.Suspense,{children:y.jsx(za,{children:y.jsx(XEe,{controller:Vb,children:y.jsxs(vGe,{children:[n,r,o]})})})})}),e[2]=n,e[3]=i):i=e[3],i});function Gct(t){return t.endsWith(".csv")?"text/csv":t.endsWith(".json")?"application/json":t.endsWith(".txt")?"text/plain":"application/octet-stream"}function kRe(t){return t.startsWith(".")?t.slice(1):t}wRe.displayName="Providers";const Kct=typeof window<"u"&&window.parent!==window;function Jct(){new URLSearchParams(window.location.search).has(Pl.vscode)&&Kct&&!Vh()&&(Ve.log("[vscode] Registering VS Code bindings"),document.addEventListener("keydown",t=>{var e,n;if((t.ctrlKey||t.metaKey)&&t.key==="c"){const r=((e=window.getSelection())==null?void 0:e.toString())??"";return Ve.log("[vscode] Sending copy",r),void ip({command:"copy",text:r})}if((t.ctrlKey||t.metaKey)&&t.key==="x"){const r=((n=window.getSelection())==null?void 0:n.toString())??"";return cg()&&document.execCommand("insertText",!1,""),Ve.log("[vscode] Sending cut",r),void ip({command:"cut",text:r})}if((t.ctrlKey||t.metaKey)&&t.key==="v")return Ve.log("[vscode] Sending paste"),void ip({command:"paste"})}),window.addEventListener("copy",()=>{var t;ip({command:"copy",text:((t=window.getSelection())==null?void 0:t.toString())??""})}),window.addEventListener("cut",()=>{var e;const t=((e=window.getSelection())==null?void 0:e.toString())??"";cg()&&document.execCommand("insertText",!1,""),ip({command:"cut",text:t})}),window.addEventListener("message",async t=>{try{const e=t.data,n=cg();if(e.command==="paste"){if(Ve.log(`[vscode] Received paste mac=${n}`,e),n){const r=document.activeElement;if(!r)return Ve.warn("[vscode] No active element to paste into"),void document.execCommand("insertText",!1,e.text);const o=new DataTransfer;o.setData("text/plain",e.text),r.dispatchEvent(new ClipboardEvent("paste",{clipboardData:o}))}else Ve.log("[vscode] Not pasting on mac");return}}catch(e){Ve.error("Error in paste message handler",e)}}),document.addEventListener("click",t=>{const e=t.target;if(e.tagName!=="A")return;const n=e.getAttribute("href");n&&(n.startsWith("http://")||n.startsWith("https://"))&&(t.preventDefault(),ip({command:"external_link",url:n}))}),document.addEventListener("contextmenu",t=>{t.preventDefault(),ip({command:"context_menu"})}))}ip=function(t){var e;(e=window.parent)==null||e.postMessage(t,"*")};var Y0="NavigationMenu",[MB,SRe,eut]=Lp(Y0),[NB,tut,nut]=Lp(Y0),[$B,n1t]=Wo(Y0,[eut,nut]),[rut,cc]=$B(Y0),[out,iut]=$B(Y0),CRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,delayDuration:a=200,skipDelayDuration:s=300,orientation:l="horizontal",dir:c,...u}=t,[d,f]=_.useState(null),h=ln(e,D=>f(D)),g=yf(c),v=_.useRef(0),b=_.useRef(0),p=_.useRef(0),[O,k]=_.useState(!0),[S,w]=Ao({prop:r,onChange:D=>{const N=s>0;D!==""?(window.clearTimeout(p.current),N&&k(!1)):(window.clearTimeout(p.current),p.current=window.setTimeout(()=>k(!0),s)),o==null||o(D)},defaultProp:i??"",caller:Y0}),T=_.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>w(""),150)},[w]),P=_.useCallback(D=>{window.clearTimeout(b.current),w(D)},[w]),j=_.useCallback(D=>{S===D?window.clearTimeout(b.current):v.current=window.setTimeout(()=>{window.clearTimeout(b.current),w(D)},a)},[S,w,a]);return _.useEffect(()=>()=>{window.clearTimeout(v.current),window.clearTimeout(b.current),window.clearTimeout(p.current)},[]),y.jsx(_Re,{scope:n,isRootMenu:!0,value:S,dir:g,orientation:l,rootNavigationMenu:d,onTriggerEnter:D=>{window.clearTimeout(v.current),O?j(D):P(D)},onTriggerLeave:()=>{window.clearTimeout(v.current),T()},onContentEnter:()=>window.clearTimeout(b.current),onContentLeave:T,onItemSelect:D=>{w(N=>N===D?"":D)},onItemDismiss:()=>w(""),children:y.jsx(_t.nav,{"aria-label":"Main","data-orientation":l,dir:g,...u,ref:h})})});CRe.displayName=Y0;var IB="NavigationMenuSub",aut=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",...s}=t,l=cc(IB,n),[c,u]=Ao({prop:r,onChange:o,defaultProp:i??"",caller:IB});return y.jsx(_Re,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:a,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>u(d),onItemSelect:d=>u(d),onItemDismiss:()=>u(""),children:y.jsx(_t.div,{"data-orientation":a,...s,ref:e})})});aut.displayName=IB;var _Re=t=>{const{scope:e,isRootMenu:n,rootNavigationMenu:r,dir:o,orientation:i,children:a,value:s,onItemSelect:l,onItemDismiss:c,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:h}=t,[g,v]=_.useState(null),[b,p]=_.useState(new Map),[O,k]=_.useState(null);return y.jsx(rut,{scope:e,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:G1(s),baseId:Do(),dir:o,orientation:i,viewport:g,onViewportChange:v,indicatorTrack:O,onIndicatorTrackChange:k,onTriggerEnter:Lo(u),onTriggerLeave:Lo(d),onContentEnter:Lo(f),onContentLeave:Lo(h),onItemSelect:Lo(l),onItemDismiss:Lo(c),onViewportContentChange:_.useCallback((S,w)=>{p(T=>(T.set(S,w),new Map(T)))},[]),onViewportContentRemove:_.useCallback(S=>{p(w=>w.has(S)?(w.delete(S),new Map(w)):w)},[]),children:y.jsx(MB.Provider,{scope:e,children:y.jsx(out,{scope:e,items:b,children:a})})})},TRe="NavigationMenuList",PRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,o=cc(TRe,n),i=y.jsx(_t.ul,{"data-orientation":o.orientation,...r,ref:e});return y.jsx(_t.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange,children:y.jsx(MB.Slot,{scope:n,children:o.isRootMenu?y.jsx(LRe,{asChild:!0,children:i}):i})})});PRe.displayName=TRe;var ERe="NavigationMenuItem",[sut,RRe]=$B(ERe),jRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,...o}=t,i=Do(),a=r||i||"LEGACY_REACT_AUTO_VALUE",s=_.useRef(null),l=_.useRef(null),c=_.useRef(null),u=_.useRef(()=>{}),d=_.useRef(!1),f=_.useCallback((g="start")=>{if(s.current){u.current();const v=VB(s.current);v.length&&qB(g==="start"?v:v.reverse())}},[]),h=_.useCallback(()=>{if(s.current){const g=VB(s.current);g.length&&(u.current=function(v){return v.forEach(b=>{b.dataset.tabindex=b.getAttribute("tabindex")||"",b.setAttribute("tabindex","-1")}),()=>{v.forEach(b=>{const p=b.dataset.tabindex;b.setAttribute("tabindex",p)})}}(g))}},[]);return y.jsx(sut,{scope:n,value:a,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:h,onContentFocusOutside:h,children:y.jsx(_t.li,{...o,ref:e})})});jRe.displayName=ERe;var QB="NavigationMenuTrigger",DRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,disabled:r,...o}=t,i=cc(QB,t.__scopeNavigationMenu),a=RRe(QB,t.__scopeNavigationMenu),s=_.useRef(null),l=ln(s,a.triggerRef,e),c=qRe(i.baseId,a.value),u=FRe(i.baseId,a.value),d=_.useRef(!1),f=_.useRef(!1),h=a.value===i.value;return y.jsxs(y.Fragment,{children:[y.jsx(MB.ItemSlot,{scope:n,value:a.value,children:y.jsx(VRe,{asChild:!0,children:y.jsx(_t.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":BB(h),"aria-expanded":h,"aria-controls":u,...o,ref:l,onPointerEnter:ut(t.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:ut(t.onPointerMove,Y5(()=>{r||f.current||a.wasEscapeCloseRef.current||d.current||(i.onTriggerEnter(a.value),d.current=!0)})),onPointerLeave:ut(t.onPointerLeave,Y5(()=>{r||(i.onTriggerLeave(),d.current=!1)})),onClick:ut(t.onClick,()=>{i.onItemSelect(a.value),f.current=h}),onKeyDown:ut(t.onKeyDown,g=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];h&&g.key===v&&(a.onEntryKeyDown(),g.preventDefault())})})})}),h&&y.jsxs(y.Fragment,{children:[y.jsx(h6,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:g=>{const v=a.contentRef.current,b=g.relatedTarget,p=b===s.current,O=v==null?void 0:v.contains(b);!p&&O||a.onFocusProxyEnter(p?"start":"end")}}),i.viewport&&y.jsx("span",{"aria-owns":u})]})]})});DRe.displayName=QB;var ARe="navigationMenu.linkSelect",MRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,active:r,onSelect:o,...i}=t;return y.jsx(VRe,{asChild:!0,children:y.jsx(_t.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:e,onClick:ut(t.onClick,a=>{const s=a.target,l=new CustomEvent(ARe,{bubbles:!0,cancelable:!0});s.addEventListener(ARe,c=>o==null?void 0:o(c),{once:!0}),Hw(s,l),!l.defaultPrevented&&!a.metaKey&&Hw(s,new CustomEvent(H5,{bubbles:!0,cancelable:!0}))},{checkForDefaultPrevented:!1})})})});MRe.displayName="NavigationMenuLink";var LB="NavigationMenuIndicator",NRe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=cc(LB,t.__scopeNavigationMenu),i=!!o.value;return o.indicatorTrack?oO.createPortal(y.jsx(Uo,{present:n||i,children:y.jsx(lut,{...r,ref:e})}),o.indicatorTrack):null});NRe.displayName=LB;var lut=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,o=cc(LB,n),i=SRe(n),[a,s]=_.useState(null),[l,c]=_.useState(null),u=o.orientation==="horizontal",d=!!o.value;_.useEffect(()=>{var v;const h=i(),g=(v=h.find(b=>b.value===o.value))==null?void 0:v.ref.current;g&&s(g)},[i,o.value]);const f=()=>{a&&c({size:u?a.offsetWidth:a.offsetHeight,offset:u?a.offsetLeft:a.offsetTop})};return FB(a,f),FB(o.indicatorTrack,f),l?y.jsx(_t.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":o.orientation,...r,ref:e,style:{position:"absolute",...u?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}}):null}),qb="NavigationMenuContent",$Re=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=cc(qb,t.__scopeNavigationMenu),i=RRe(qb,t.__scopeNavigationMenu),a=ln(i.contentRef,e),s=i.value===o.value,l={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return o.viewport?y.jsx(cut,{forceMount:n,...l,ref:a}):y.jsx(Uo,{present:n||s,children:y.jsx(IRe,{"data-state":BB(s),...l,ref:a,onPointerEnter:ut(t.onPointerEnter,o.onContentEnter),onPointerLeave:ut(t.onPointerLeave,Y5(o.onContentLeave)),style:{pointerEvents:!s&&o.isRootMenu?"none":void 0,...l.style}})})});$Re.displayName=qb;var cut=_.forwardRef((t,e)=>{const n=cc(qb,t.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:o}=n;return Zo(()=>{r(t.value,{ref:e,...t})},[t,e,r]),Zo(()=>()=>o(t.value),[t.value,o]),null}),H5="navigationMenu.rootContentDismiss",IRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:o,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:s,onContentFocusOutside:l,...c}=t,u=cc(qb,n),d=_.useRef(null),f=ln(d,e),h=qRe(u.baseId,r),g=FRe(u.baseId,r),v=SRe(n),b=_.useRef(null),{onItemDismiss:p}=u;_.useEffect(()=>{const k=d.current;if(u.isRootMenu&&k){const S=()=>{var w;p(),s(),k.contains(document.activeElement)&&((w=o.current)==null||w.focus())};return k.addEventListener(H5,S),()=>k.removeEventListener(H5,S)}},[u.isRootMenu,t.value,o,p,s]);const O=_.useMemo(()=>{const k=v().map(D=>D.value);u.dir==="rtl"&&k.reverse();const S=k.indexOf(u.value),w=k.indexOf(u.previousValue),T=r===u.value,P=w===k.indexOf(r);if(!T&&!P)return b.current;const j=(()=>{if(S!==w){if(T&&w!==-1)return S>w?"from-end":"from-start";if(P&&S!==-1)return S>w?"to-start":"to-end"}return null})();return b.current=j,j},[u.previousValue,u.value,u.dir,v,r]);return y.jsx(LRe,{asChild:!0,children:y.jsx(Rp,{id:g,"aria-labelledby":h,"data-motion":O,"data-orientation":u.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var S;const k=new Event(H5,{bubbles:!0,cancelable:!0});(S=d.current)==null||S.dispatchEvent(k)},onFocusOutside:ut(t.onFocusOutside,k=>{var w;l();const S=k.target;(w=u.rootNavigationMenu)!=null&&w.contains(S)&&k.preventDefault()}),onPointerDownOutside:ut(t.onPointerDownOutside,k=>{var P;const S=k.target,w=v().some(j=>{var D;return(D=j.ref.current)==null?void 0:D.contains(S)}),T=u.isRootMenu&&((P=u.viewport)==null?void 0:P.contains(S));(w||T||!u.isRootMenu)&&k.preventDefault()}),onKeyDown:ut(t.onKeyDown,k=>{var w;const S=k.altKey||k.ctrlKey||k.metaKey;if(k.key==="Tab"&&!S){const T=VB(k.currentTarget),P=document.activeElement,j=T.findIndex(D=>D===P);qB(k.shiftKey?T.slice(0,j).reverse():T.slice(j+1,T.length))?k.preventDefault():(w=i.current)==null||w.focus()}}),onEscapeKeyDown:ut(t.onEscapeKeyDown,k=>{a.current=!0})})})}),zB="NavigationMenuViewport",QRe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=cc(zB,t.__scopeNavigationMenu),i=!!o.value;return y.jsx(Uo,{present:n||i,children:y.jsx(uut,{...r,ref:e})})});QRe.displayName=zB;var uut=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,children:r,...o}=t,i=cc(zB,n),a=ln(e,i.onViewportChange),s=iut(qb,t.__scopeNavigationMenu),[l,c]=_.useState(null),[u,d]=_.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,h=l?(l==null?void 0:l.height)+"px":void 0,g=!!i.value,v=g?i.value:i.previousValue;return FB(u,()=>{u&&c({width:u.offsetWidth,height:u.offsetHeight})}),y.jsx(_t.div,{"data-state":BB(g),"data-orientation":i.orientation,...o,ref:a,style:{pointerEvents:!g&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":h,...o.style},onPointerEnter:ut(t.onPointerEnter,i.onContentEnter),onPointerLeave:ut(t.onPointerLeave,Y5(i.onContentLeave)),children:Array.from(s.items).map(([b,{ref:p,forceMount:O,...k}])=>{const S=v===b;return y.jsx(Uo,{present:O||S,children:y.jsx(IRe,{...k,ref:Lu(p,w=>{S&&w&&d(w)})})},b)})})}),LRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,o=cc("FocusGroup",n);return y.jsx(NB.Provider,{scope:n,children:y.jsx(NB.Slot,{scope:n,children:y.jsx(_t.div,{dir:o.dir,...r,ref:e})})})}),zRe=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],VRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,o=tut(n),i=cc("FocusGroupItem",n);return y.jsx(NB.ItemSlot,{scope:n,children:y.jsx(_t.button,{...r,ref:e,onKeyDown:ut(t.onKeyDown,a=>{if(["Home","End",...zRe].includes(a.key)){let s=o().map(l=>l.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&s.reverse(),zRe.includes(a.key)){const l=s.indexOf(a.currentTarget);s=s.slice(l+1)}setTimeout(()=>qB(s)),a.preventDefault()}})})})});function VB(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function qB(t){const e=document.activeElement;return t.some(n=>n===e||(n.focus(),document.activeElement!==e))}function FB(t,e){const n=Lo(e);Zo(()=>{let r=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(r),o.unobserve(t)}}},[t,n])}function BB(t){return t?"open":"closed"}function qRe(t,e){return`${t}-trigger-${e}`}function FRe(t,e){return`${t}-content-${e}`}function Y5(t){return e=>e.pointerType==="mouse"?t(e):void 0}var BRe=CRe,WRe=PRe,dut=jRe,URe=DRe,fut=MRe,ZRe=NRe,XRe=$Re,HRe=QRe;const YRe=_.forwardRef((t,e)=>{const n=ue.c(16);let r,o,i,a;n[0]!==t?({className:o,children:r,orientation:i,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]);const s=i==="horizontal"&&"max-w-max flex-1 items-center justify-center",l=i==="vertical"&&"";let c,u,d;return n[5]!==o||n[6]!==s||n[7]!==l?(c=we(s,l,"relative z-10",o),n[5]=o,n[6]=s,n[7]=l,n[8]=c):c=n[8],n[9]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(JRe,{}),n[9]=u):u=n[9],n[10]!==r||n[11]!==i||n[12]!==a||n[13]!==e||n[14]!==c?(d=y.jsxs(BRe,{ref:e,className:c,orientation:i,...a,children:[r,u]}),n[10]=r,n[11]=i,n[12]=a,n[13]=e,n[14]=c,n[15]=d):d=n[15],d});YRe.displayName=BRe.displayName;const hut=Po("group flex list-none gap-1",{variants:{orientation:{horizontal:"flex items-center",vertical:"flex flex-col"}},defaultVariants:{orientation:"horizontal"}}),G5=_.forwardRef((t,e)=>{const n=ue.c(11);let r,o,i,a,s;return n[0]!==t?({className:r,orientation:o,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==r||n[5]!==o?(a=we(hut({orientation:o}),r),n[4]=r,n[5]=o,n[6]=a):a=n[6],n[7]!==i||n[8]!==e||n[9]!==a?(s=y.jsx(WRe,{ref:e,className:a,...i}),n[7]=i,n[8]=e,n[9]=a,n[10]=s):s=n[10],s});G5.displayName=WRe.displayName;const WB=dut,UB=Po("group inline-flex rounded-md bg-background px-4 py-2 text-lg font-medium text-[var(--slate-12)] transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50",{variants:{orientation:{horizontal:"w-max items-center justify-center",vertical:"w-full"}},defaultVariants:{orientation:"horizontal"}}),GRe=_.forwardRef((t,e)=>{const n=ue.c(12);let r,o,i,a,s,l;return n[0]!==t?({className:o,children:r,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==o?(a=we(UB(),"group",o),n[4]=o,n[5]=a):a=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsx(oOe,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"}),n[6]=s):s=n[6],n[7]!==r||n[8]!==i||n[9]!==e||n[10]!==a?(l=y.jsxs(URe,{ref:e,className:a,...i,children:[r," ",s]}),n[7]=r,n[8]=i,n[9]=e,n[10]=a,n[11]=l):l=n[11],l});GRe.displayName=URe.displayName;const KRe=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(XRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});KRe.displayName=XRe.displayName;const ZB=fut,JRe=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]===Symbol.for("react.memo_cache_sentinel")?(i=we("absolute left-0 top-full flex justify-center"),n[3]=i):i=n[3],n[4]!==r?(a=we("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",r),n[4]=r,n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==a?(s=y.jsx("div",{className:i,children:y.jsx(HRe,{className:a,ref:e,...o})}),n[6]=o,n[7]=e,n[8]=a,n[9]=s):s=n[9],s});JRe.displayName=HRe.displayName;const put=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",r),n[3]=r,n[4]=i):i=n[4],n[5]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"}),n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==i?(s=y.jsx(ZRe,{ref:e,className:i,...o,children:a}),n[6]=o,n[7]=e,n[8]=i,n[9]=s):s=n[9],s});put.displayName=ZRe.displayName;const mut=t=>{const e=ue.c(13),{items:n,orientation:r}=t,o=gut,i=vut;let a;e[0]!==r?(a=d=>"items"in d?r==="horizontal"?y.jsxs(WB,{children:[y.jsx(GRe,{children:Br({html:d.label})}),y.jsx(KRe,{children:y.jsx(G5,{children:y.jsx("ul",{className:"grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px] ",children:d.items.map(f=>y.jsx(e3e,{label:f.label,href:f.href,target:i(f.href),children:f.description&&Br({html:f.description})},f.label))})})})]},d.label):y.jsxs(WB,{children:[y.jsx("div",{className:"inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-base font-medium text-muted-foreground/80 tracking-wide font-semibold",children:Br({html:d.label})}),y.jsx(G5,{className:"ml-4 auto-collapse-nav",orientation:r,children:d.items.map(f=>y.jsx(ge.Fragment,{children:o(y.jsx(ZB,{href:f.href,target:i(f.href),className:UB({orientation:r}),children:Br({html:f.label})},f.label),f.description)},f.label))})]},d.label):y.jsx(WB,{children:y.jsx(ZB,{href:d.href,target:i(d.href),className:UB({orientation:r}),children:Br({html:d.label})})},d.label),e[0]=r,e[1]=a):a=e[1];const s=a;let l,c,u;if(e[2]!==n||e[3]!==s){let d;e[5]!==s?(d=f=>s(f),e[5]=s,e[6]=d):d=e[6],l=n.map(d),e[2]=n,e[3]=s,e[4]=l}else l=e[4];return e[7]!==r||e[8]!==l?(c=y.jsx(G5,{className:"auto-collapse-nav",orientation:r,children:l}),e[7]=r,e[8]=l,e[9]=c):c=e[9],e[10]!==r||e[11]!==c?(u=y.jsx(YRe,{orientation:r,children:c}),e[10]=r,e[11]=c,e[12]=u):u=e[12],u},e3e=ge.forwardRef((t,e)=>{const n=ue.c(19);let r,o,i,a,s,l,c,u,d;return n[0]!==t?({className:o,label:i,children:r,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==o?(s=we("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",o),n[5]=o,n[6]=s):s=n[6],n[7]!==i?(l=Br({html:i}),n[7]=i,n[8]=l):l=n[8],n[9]!==l?(c=y.jsx("div",{className:"text-base font-medium leading-none",children:l}),n[9]=l,n[10]=c):c=n[10],n[11]!==r?(u=r&&y.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:r}),n[11]=r,n[12]=u):u=n[12],n[13]!==a||n[14]!==e||n[15]!==s||n[16]!==c||n[17]!==u?(d=y.jsx("li",{children:y.jsx(ZB,{asChild:!0,children:y.jsxs("a",{ref:e,className:s,...a,children:[c,u]})})}),n[13]=a,n[14]=e,n[15]=s,n[16]=c,n[17]=u,n[18]=d):d=n[18],d});function gut(t,e){return e?y.jsx(qn,{delayDuration:200,content:Br({html:e}),children:t}):t}function vut(t){return t.startsWith("http")?"_blank":"_self"}e3e.displayName="ListItem",uG=new _M("function-call-result",async(t,e)=>{await USe({functionCallId:t,...e})});function yut(t,e){return t===e||t!=null&&e!=null&&(Array.isArray(t)&&Array.isArray(e)?$K(t,e):typeof t=="object"&&typeof e=="object"&&function(n,r){return Object.keys(n).length===Object.keys(r).length&&cr.keys(n).every(o=>n[o]===r[o])}(t,e))}function XB(t,e){window!=null&&window.customElements?window.customElements.get(t)?Ve.warn(`Custom element ${t} already defined`):window.customElements.define(t,e):Ve.warn("Custom elements not supported")}const but=t=>{const e=ue.c(16),{error:n,badData:r,shadowRoot:o}=t;if(n instanceof Nu){let a,s,l,c,u,d,f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(Lv,{children:"Bad Data"}),e[0]=a):a=e[0],e[1]!==n.issues?(s=n.issues.map(xut),e[1]=n.issues,e[2]=s):s=e[2],e[3]!==s?(l=y.jsx("div",{className:"text-md prose dark:prose-invert",children:y.jsx("ul",{children:s})}),e[3]=s,e[4]=l):l=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(WL,{className:"py-2 text-[0.84375rem]",children:"View Data:"}),e[5]=c):c=e[5],e[6]!==r?(u=y.jsx(_k,{data:r}),e[6]=r,e[7]=u):u=e[7],e[8]!==o||e[9]!==u?(d=y.jsx(VL,{type:"single",collapsible:!0,children:y.jsxs(FL,{value:"item-1",className:"text-muted-foreground border-muted-foreground-20",children:[c,y.jsx(UL,{className:"text-[0.84375rem]",children:y.jsx(G3,{container:o,children:u})})]})}),e[8]=o,e[9]=u,e[10]=d):d=e[10],e[11]!==l||e[12]!==d?(f=y.jsxs(Qv,{variant:"destructive",children:[a,l,d]}),e[11]=l,e[12]=d,e[13]=f):f=e[13],f}let i;return e[14]!==n.message?(i=y.jsx("div",{children:n.message}),e[14]=n.message,e[15]=i):i=e[15],i};function xut(t){const e=t.path.join(".");return y.jsxs("li",{children:[y.jsx("span",{className:"font-bold",children:e}),": ",t.message]},e)}const Out=ge.forwardRef(function({hostElement:t,plugin:e,children:n,getInitialValue:r},o){const[i,a]=_.useState(n),[s,l]=_.useState(r()),{theme:c}=as(),[u,d]=_.useState(()=>e.validator.safeParse(B$(t)));_.useImperativeHandle(o,()=>({reset:()=>{l(r()),d(e.validator.safeParse(B$(t)))},setChildren:g=>{a(g)}})),Wh(t,y6.TYPE,g=>{g.detail.element===t&&l(g.detail.value)}),_.useEffect(()=>{const g=new MutationObserver(v=>{v.some(b=>{var p;return b.type==="attributes"&&((p=b.attributeName)==null?void 0:p.startsWith("data-"))})&&d(e.validator.safeParse(B$(t)))});return g.observe(t,{attributes:!0}),()=>{g.disconnect()}},[t,e.validator]);const f=Fn(g=>{l(v=>{const b=Zi.asUpdater(g)(v);return yut(b,v)||t.dispatchEvent(Jle(b,t)),b})}),h=_.useMemo(()=>{if(!e.functions)return{};const g={};for(const[v,b]of cr.entries(e.functions)){const{input:p,output:O}=b;g[v]=async(...k)=>{Rn(k.length<=1,`Plugin functions only supports a single argument. Called ${v}`);const S=YB(t);Rn(S,"Object ID should exist");const w=await uG.request({args:i3e(p,k[0]),functionName:v,namespace:S});if(w.status.code!=="ok")throw Ve.error(w.status),new Error(w.status.message||"Unknown error");return i3e(O,w.return_value)}}return g},[e.functions,t]);return u.success?y.jsx(lf,{children:y.jsx("div",{className:`contents ${c}`,children:y.jsx(_.Suspense,{fallback:y.jsx("div",{}),children:e.render({setValue:f,value:s,data:u.data,children:i,host:t,functions:h})})})}):function(g,v,b){return y.jsx(but,{error:g,badData:v,shadowRoot:b})}(u.error,cr.mapValues(t.dataset,g=>typeof g=="string"?cP(g):g),t.shadowRoot)}),HB=new Map,t3e="__custom_marimo_element__";function n3e(t){const e=class extends HTMLElement{constructor(){super(),this.observer=void 0,this.root=void 0,this.mounted=!1,this.pluginRef=_.createRef(),this.__type__=t3e,this.attachShadow({mode:"open"}),this.copyStyles(),this.observer=new MutationObserver(()=>{var n;(n=this.pluginRef.current)==null||n.setChildren(this.getChildren())})}connectedCallback(){this.mounted||(Rn(this.shadowRoot,"Shadow root should exist"),this.root&&this.root.unmount(),this.root=a7e.createRoot(this.shadowRoot),this.mountReactComponent()),this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}disconnectedCallback(){var n;this.observer.disconnect(),(n=this.root)==null||n.unmount(),this.mounted&&(this.mounted=!1)}reset(){this.dispatchEvent(Jle(cP(this.dataset.initialValue),this)),this.rerender()}rerender(){var n;(n=this.pluginRef.current)==null||n.reset()}getChildren(){return Br({html:this.innerHTML})}async mountReactComponent(){this.mounted=!0,Rn(this.root,"Root must be defined"),this.root.render(y.jsx(Out,{hostElement:this,plugin:t,ref:this.pluginRef,getInitialValue:()=>Dne(this,zE.INSTANCE),children:this.getChildren()}))}async copyStyles(){const n=this.shadowRoot;if(Rn(n,"Shadow root should exist"),!this.isAdoptedStyleSheetsSupported())return Ve.warn("adoptedStyleSheets not supported, copying stylesheets in a less performance way. Please consider upgrading your browser."),void this.copyStylesFallback();const r=Array.from(document.styleSheets).filter(o=>!!(o.ownerNode instanceof HTMLElement&&o.ownerNode.dataset.viteDevId)||r3e(o));for(const o of r){const i=o.href??(o.ownerNode instanceof HTMLElement?o.ownerNode.dataset.viteDevId:void 0)??o.title;if(i&&!HB.has(i)){const a=new CSSStyleSheet;try{a.replaceSync(Array.from(o.cssRules).map(s=>s.cssText.includes("@import")?"":s.cssText).join(`
|
445
|
+
`?f+1:f;return{beforeCursorCode:pf(d,0,g?f-1:f),afterCursorCode:pf(d,v)}}(a.editorView);L5(a.editorView,s);const c=ms.create();return{...t,cellIds:t.cellIds.insertId(c,r.id,o+1),cellData:{...t.cellData,[n]:{...i,code:s,edited:!!s&&s.trim()!==((u=i.lastCodeRun)==null?void 0:u.trim())},[c]:Pc({id:c,code:l,edited:!!l})},cellRuntime:{...t.cellRuntime,[n]:{...t.cellRuntime[n],output:null,consoleOutputs:[]},[c]:su()},cellHandles:{...t.cellHandles,[c]:_.createRef()},scrollKey:c}},undoSplitCell:(t,e)=>{var a;const{cellId:n,snapshot:r}=e,o=t.cellData[n],i=t.cellHandles[n].current;return(i==null?void 0:i.editorView)==null?t:(L5(i.editorView,r),{...t,cellIds:t.cellIds.transformWithCellId(n,s=>{const l=s.indexOfOrThrow(n)+1;return s.deleteAtIndex(l)}),cellData:{...t.cellData,[n]:{...o,code:r,edited:!!r&&(r==null?void 0:r.trim())!==((a=o.lastCodeRun)==null?void 0:a.trim())}},cellRuntime:{...t.cellRuntime,[n]:{...t.cellRuntime[n],output:null,consoleOutputs:[]}},cellHandles:{...t.cellHandles}})},clearCellOutput:(t,e)=>{const{cellId:n}=e;return Y2({state:t,cellId:n,cellReducer:r=>({...r,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(t,e)=>{const{cellId:n}=e;return Y2({state:t,cellId:n,cellReducer:r=>({...r,consoleOutputs:r.consoleOutputs.filter(o=>o.channel==="stdin"&&o.response==null)})})},clearAllCellOutputs:t=>{const e={...t.cellRuntime};for(const n of t.cellIds.inOrderIds)e[n]={...e[n],output:null,consoleOutputs:[]};return{...t,cellRuntime:e}},upsertSetupCell:(t,e)=>{const{code:n}=e;return Qc in t.cellData?zb({state:t,cellId:Qc,cellReducer:r=>{var o;return{...r,code:n,edited:n.trim()!==((o=r.lastCodeRun)==null?void 0:o.trim())}}}):{...t,cellIds:t.cellIds.insertId(Qc,t.cellIds.atOrThrow(0).id,0),cellData:{...t.cellData,[Qc]:Pc({id:Qc,name:Qc,code:n,edited:!!n})},cellRuntime:{...t.cellRuntime,[Qc]:su()},cellHandles:{...t.cellHandles,[Qc]:_.createRef()}}}}));function H2(t,e){return t.cellData[e].config.hide_code&&!t.untouchedNewCells.has(e)}function Y2({state:t,cellId:e,cellReducer:n}){return e in t.cellRuntime?{...t,cellRuntime:{...t.cellRuntime,[e]:n(t.cellRuntime[e])}}:(Ve.warn(`Cell ${e} not found in state`),t)}function zb({state:t,cellId:e,cellReducer:n}){return e in t.cellData?{...t,cellData:{...t.cellData,[e]:n(t.cellData[e])}}:(Ve.warn(`Cell ${e} not found in state`),t)}iLe=function(t){const e=t.cellData,n={column:null};return t.cellIds.getColumns().length>1?t.cellIds.getColumns().flatMap((r,o)=>r.inOrderIds.map((i,a)=>{const s={...n};return a===0&&(s.column=o),{...e[i].config,...s}})):t.cellIds.getColumns().flatMap(r=>r.inOrderIds.map(o=>({...e[o].config,...n})))};let sB,sEe,lEe;wN=Ct(t=>t(ur).cellIds),X6e=Ct(t=>t(wN).hasOnlyOneId()),nLe=Ct(t=>EK(t(ur)).length>0),rLe=Ct(t=>oK(t(ur)).length>0),xLe=Ct(t=>t(ur).history.length>0),cLe=Ct(t=>rK(t(ur)).length>0),sB=Ct(t=>{const{cellIds:e,cellRuntime:n,cellData:r}=t(ur);return e.inOrderIds.map(i=>{var l;const a=n[i],{name:s}=r[i];if(SM((l=a.output)==null?void 0:l.mimetype)){Rn(Array.isArray(a.output.data),"Expected array data");const c=a.output.data.filter(u=>!u.type.includes("ancestor"));if(c.length>0)return{output:{...a.output,data:c},cellId:i,cellName:s}}return null}).filter(Boolean)}),sQe=Ct(t=>{const{cellIds:e,cellRuntime:n}=t(ur);return function(r){return{items:r.filter(Boolean).flatMap(o=>o.items)}}(e.inOrderIds.map(r=>n[r].outline))}),i8e=Ct(t=>t(sB).length),sEe=function(t,e=mf){let n=_ne;return Ct(r=>{const o=r(t);return n!==_ne&&e(n,o)||(n=o),n})}(Ct(t=>{const{cellIds:e,cellData:n}=t(ur);return cr.fromEntries(e.inOrderIds.map(r=>{var o;return[r,(o=n[r])==null?void 0:o.name]}))})),yQe=()=>Gr(ur),_H=()=>Gr(wN),KJ=()=>Gr(sEe),nQe=()=>Gr(sB),T8e=()=>Gr(ur).cellLogs,gG=()=>Ht.get(ur),tQe=()=>{const{cellIds:t,cellData:e}=Ht.get(ur);return t.inOrderIds.map(n=>{var r;return(r=e[n])==null?void 0:r.name}).filter(Boolean)},lEe=(Ds=function(t,e,n=Object.is){return((r,o,i,a)=>{const s=UQ(()=>new WeakMap,$qe,o),l=UQ(()=>new WeakMap,s,i);return UQ(r,l,a)})(()=>{const r=Symbol(),o=Ct(i=>{const a=i(o);return(([s,l])=>{if(l===r)return e(s);const c=e(s,l);return n(l,c)?l:c})([i(t),a])});return o.init=r,o},t,e,n)}(ur,t=>t.cellIds.inOrderIds.map(e=>t.cellData[e])),((t,e,n)=>{const r=Gae(()=>new WeakMap,Iqe,e);return Gae(t,r,n)})(()=>{const t=new WeakMap,e=(o,i)=>{let a=t.get(o);if(a)return a;const s=i&&t.get(i),l=[],c=[];return o.forEach((u,d)=>{const f=d;c[d]=f;const h=s&&s.atomList[s.keyList.indexOf(f)];if(h)return void(l[d]=h);const g=v=>{const b=v(n),p=v(Ds),O=e(p,b==null?void 0:b.arr).keyList.indexOf(f);if(O<0||O>=p.length){const k=o[e(o).keyList.indexOf(f)];if(k)return k;throw new Error("splitAtom: index out of bounds for read")}return p[O]};l[d]=Kae(Ds)?Ct(g,(v,b,p)=>{const O=v(n),k=v(Ds),S=e(k,O==null?void 0:O.arr).keyList.indexOf(f);if(S<0||S>=k.length)throw new Error("splitAtom: index out of bounds for write");const w=(T=>typeof T=="function")(p)?p(k[S]):p;Object.is(k[S],w)||b(Ds,[...k.slice(0,S),w,...k.slice(S+1)])}):Ct(g)}),a=s&&s.keyList.length===c.length&&s.keyList.every((u,d)=>u===c[d])?s:{arr:o,atomList:l,keyList:c},t.set(o,a),a},n=Ct(o=>{const i=o(n),a=o(Ds);return e(a,i==null?void 0:i.arr)});(qw?"production":void 0)!=="production"&&(n.debugPrivate=!0),n.init=void 0;const r=Kae(Ds)?Ct(o=>o(n).atomList,(o,i,a)=>{switch(a.type){case"remove":{const s=o(r).indexOf(a.atom);if(s>=0){const l=o(Ds);i(Ds,[...l.slice(0,s),...l.slice(s+1)])}break}case"insert":{const s=a.before?o(r).indexOf(a.before):o(r).length;if(s>=0){const l=o(Ds);i(Ds,[...l.slice(0,s),a.value,...l.slice(s)])}break}case"move":{const s=o(r).indexOf(a.atom),l=a.before?o(r).indexOf(a.before):o(r).length;if(s>=0&&l>=0){const c=o(Ds);i(Ds,s<l?[...c.slice(0,s),...c.slice(s+1,l),c[s],...c.slice(l)]:[...c.slice(0,l),c[s],...c.slice(l,s),...c.slice(s+1)])}break}}}):Ct(o=>o(n).atomList);return r},Ds,Qqe));var Ds;O8e=()=>ss(lEe),RH=Ct(t=>{return e=t(ur),Object.values(e.cellRuntime).some(n=>n.status==="running");var e}),a8e=Ct(t=>{return e=t(ur),Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length;var e}),b8e=Ct(t=>t(ur).cellIds.colLength),n8e=Ct(t=>t(ur).cellIds.idLength>0),g8e=Ct(t=>t(ur).cellIds.getColumnIds()),AK=()=>{const{cellIds:t,cellHandles:e}=Ht.get(ur);return t.inOrderIds.map(n=>{var r,o;return(o=(r=e[n])==null?void 0:r.current)==null?void 0:o.editorView}).filter(Boolean)},hK=t=>{var n;const{cellHandles:e}=Ht.get(ur);return(n=e[t].current)==null?void 0:n.editorView},bQe=function(t){const{cellIds:e,cellData:n,cellRuntime:r}=t;return e.getColumns().flatMap(o=>o.topLevelIds.map(i=>({...n[i],...r[i]})))},d8e=function(t){return Ct(e=>e(ur).untouchedNewCells.has(t))};function nct(t){const e=Ct(n=>{const r=n(ur).cellRuntime[t];if(!r||r.status!=="idle")return;const o=r.consoleOutputs;if(!o||o.length===0)return;const i=o.find(a=>a.mimetype==="application/vnd.marimo+traceback");if(i)return i.data});return Ct(n=>{const r=n(e);if(r)return Xse(r)})}Iv=function(){return aEe()};let mm=function(t){return t.INSERT="insert",t.DELETE="delete",t.SUBSTITUTE="substitute",t.MATCH="match",t}({});function rct(t,e,n){const r=[];let o=0;for(const i of e)switch(i.type){case mm.MATCH:r.push(t[o]),o++;break;case mm.DELETE:o++;break;case mm.INSERT:r.push(n);break;case mm.SUBSTITUTE:r.push(n),o++}return r}function oct(t,e,n,r){const o=function(i,a,s){const l=i.length,c=a.length,u=Array.from({length:l+1},()=>Array.from({length:c+1}).fill(0));for(let g=0;g<=l;g++)u[g][0]=g;for(let g=0;g<=c;g++)u[0][g]=g;for(let g=1;g<=l;g++)for(let v=1;v<=c;v++)u[g][v]=s(i[g-1],a[v-1])?u[g-1][v-1]:1+Math.min(u[g-1][v],u[g][v-1],u[g-1][v-1]);const d=[];let f=l,h=c;for(;f>0||h>0;)f>0&&h>0&&s(i[f-1],a[h-1])?(d.unshift({type:mm.MATCH,position:f-1}),f--,h--):f>0&&h>0&&u[f][h]===u[f-1][h-1]+1?(d.unshift({type:mm.SUBSTITUTE,position:f-1}),f--,h--):f>0&&u[f][h]===u[f-1][h]+1?(d.unshift({type:mm.DELETE,position:f-1}),f--):h>0&&u[f][h]===u[f][h-1]+1&&(d.unshift({type:mm.INSERT,position:f}),h--);return{distance:u[l][c],operations:d}}(t,e,n);return{merged:rct(t,o.operations,r),edits:o}}function cEe(){return{id:ms.create(),name:"",code:"",code_hash:null,config:{column:null,disabled:!1,hide_code:!1}}}function uEe(){return{id:ms.create(),code_hash:null,console:[],outputs:[]}}function ict(t,e){var n,r,o;return{id:t,name:e.name??"",code:e.code??"",edited:!1,lastCodeRun:null,lastExecutionTime:null,config:{column:((n=e.config)==null?void 0:n.column)??null,disabled:((r=e.config)==null?void 0:r.disabled)??!1,hide_code:((o=e.config)==null?void 0:o.hide_code)??!1},serializedEditorState:null}}function act(t){const e=su();if(!t)return e;const n=t.outputs||[],r=n.find(i=>i.type==="data")||n.find(i=>i.type==="error")||n[0];if(r){if(r.type==="error")e.output={channel:"marimo-error",data:[{type:"unknown",msg:r.evalue}],mimetype:"application/vnd.marimo+error",timestamp:0};else if(r.type==="data"){const i=Object.keys(r.data)[0],a=Object.values(r.data)[0];e.output={channel:"output",data:a,mimetype:i,timestamp:0}}}const o=t.console||[];return{...e,outline:e.output?JPe(e.output):null,consoleOutputs:o.map(i=>i.type==="streamMedia"?{channel:"media",data:i.data,mimetype:i.mimetype,timestamp:0}:{channel:i.name==="stderr"?"stderr":"stdout",data:i.text,mimetype:"text/plain",timestamp:0})}}function sct(t,e){const{cellIds:n,sessionCellData:r,notebookCellData:o}=function(s,l){const c=new Map,u=new Map;if(!s&&!l)return{cellIds:[],sessionCellData:c,notebookCellData:u};if(!s){const g=(l==null?void 0:l.cells.map(v=>v.id??ms.create()))||[];return{cellIds:g,sessionCellData:new Map(g.map((v,b)=>[v,null])),notebookCellData:new Map(g.map((v,b)=>[v,(l==null?void 0:l.cells[b])||cEe()]))}}if(!l){const g=s.cells.map(v=>v.id??ms.create());return{cellIds:g,sessionCellData:new Map(g.map((v,b)=>[v,s.cells[b]])),notebookCellData:new Map(g.map(v=>[v,cEe()]))}}const{merged:d,edits:f}=oct(s.cells,l.cells,(g,v)=>{const b=g.code_hash;return b?v.code_hash===b:g.id===v.id},uEe());f.distance>0&&Ve.warn("Session and notebook have different cells, attempted merge.");const h=[];for(let g=0;g<l.cells.length;g++){const v=l.cells[g];if(v){const b=v.id??ms.create();h.push(b);const p=d[g]||uEe();p.id=b,c.set(b,p),u.set(b,v)}else Ve.warn("Merged notebook cell is null at index",g)}return{cellIds:h,sessionCellData:c,notebookCellData:u}}(t,e);if(n.length===0)return Ve.warn("Session and notebook must have at least one cell"),null;const i={},a={};for(const s of n){const l=r.get(s),c=o.get(s);c&&(i[s]=ict(s,c)),a[s]=act(l)}return{cellIds:gE.from([n]),cellData:i,cellRuntime:a,cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set}}const dEe=Object.freeze({left:0,top:0,width:16,height:16}),z5=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),G2=Object.freeze({...dEe,...z5}),lB=Object.freeze({...G2,body:"",hidden:!1}),lct=Object.freeze({width:null,height:null}),fEe=Object.freeze({...lct,...z5}),cct=/[\s,]+/,hEe={...fEe,preserveAspectRatio:""};function pEe(t){const e={...hEe},n=(r,o)=>t.getAttribute(r)||o;return e.width=n("width",null),e.height=n("height",null),e.rotate=function(r,o=0){const i=r.replace(/^-?[0-9.]*/,"");function a(s){for(;s<0;)s+=4;return s%4}if(i===""){const s=parseInt(r);return isNaN(s)?0:a(s)}if(i!==r){let s=0;switch(i){case"%":s=25;break;case"deg":s=90}if(s){let l=parseFloat(r.slice(0,r.length-i.length));return isNaN(l)?0:(l/=s,l%1==0?a(l):0)}}return o}(n("rotate","")),function(r,o){o.split(cct).forEach(i=>{switch(i.trim()){case"horizontal":r.hFlip=!0;break;case"vertical":r.vFlip=!0}})}(e,n("flip","")),e.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),e}const mEe=/^[a-z0-9]+(-[a-z0-9]+)*$/,K2=(t,e,n,r="")=>{const o=t.split(":");if(t.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const s=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:r,prefix:l,name:s};return e&&!V5(c)?null:c}const i=o[0],a=i.split("-");if(a.length>1){const s={provider:r,prefix:a.shift(),name:a.join("-")};return e&&!V5(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:i};return e&&!V5(s,n)?null:s}return null},V5=(t,e)=>!!t&&!(!(e&&t.prefix===""||t.prefix)||!t.name);function gEe(t,e){const n=function(r,o){const i={};!r.hFlip!=!o.hFlip&&(i.hFlip=!0),!r.vFlip!=!o.vFlip&&(i.vFlip=!0);const a=((r.rotate||0)+(o.rotate||0))%4;return a&&(i.rotate=a),i}(t,e);for(const r in lB)r in z5?r in t&&!(r in n)&&(n[r]=z5[r]):r in e?n[r]=e[r]:r in t&&(n[r]=t[r]);return n}function uct(t,e,n){const r=t.icons,o=t.aliases||Object.create(null);let i={};function a(s){i=gEe(r[s]||o[s],i)}return a(e),n.forEach(a),gEe(t,i)}function vEe(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(o=>{e(o,null),n.push(o)});const r=function(o){const i=o.icons,a=o.aliases||Object.create(null),s=Object.create(null);return Object.keys(i).concat(Object.keys(a)).forEach(function l(c){if(i[c])return s[c]=[];if(!(c in s)){s[c]=null;const u=a[c]&&a[c].parent,d=u&&l(u);d&&(s[c]=[u].concat(d))}return s[c]}),s}(t);for(const o in r){const i=r[o];i&&(e(o,uct(t,o,i)),n.push(o))}return n}const dct={provider:"",aliases:{},not_found:{},...dEe};function cB(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function yEe(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!cB(t,dct))return null;const n=e.icons;for(const o in n){const i=n[o];if(!o||typeof i.body!="string"||!cB(i,lB))return null}const r=e.aliases||Object.create(null);for(const o in r){const i=r[o],a=i.parent;if(!o||typeof a!="string"||!n[a]&&!r[a]||!cB(i,lB))return null}return e}const q5=Object.create(null);function yh(t,e){const n=q5[t]||(q5[t]=Object.create(null));return n[e]||(n[e]=function(r,o){return{provider:r,prefix:o,icons:Object.create(null),missing:new Set}}(t,e))}function bEe(t,e){return yEe(e)?vEe(e,(n,r)=>{r?t.icons[n]=r:t.missing.add(n)}):[]}function fct(t,e){let n=[];return(typeof t=="string"?[t]:Object.keys(q5)).forEach(r=>{(typeof r=="string"&&typeof e=="string"?[e]:Object.keys(q5[r]||{})).forEach(o=>{const i=yh(r,o);n=n.concat(Object.keys(i.icons).map(a=>(r!==""?"@"+r+":":"")+o+":"+a))})}),n}let J2=!1;function xEe(t){return typeof t=="boolean"&&(J2=t),J2}function eC(t){const e=typeof t=="string"?K2(t,!0,J2):t;if(e){const n=yh(e.provider,e.prefix),r=e.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function OEe(t,e){const n=K2(t,!0,J2);if(!n)return!1;const r=yh(n.provider,n.prefix);return e?function(o,i,a){try{if(typeof a.body=="string")return o.icons[i]={...a},!0}catch{}return!1}(r,n.name,e):(r.missing.add(n.name),!0)}function wEe(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),J2&&!e&&!t.prefix){let r=!1;return yEe(t)&&(t.prefix="",vEe(t,(o,i)=>{OEe(o,i)&&(r=!0)})),r}const n=t.prefix;return V5({prefix:n,name:"a"})?!!bEe(yh(e,n),t):!1}function kEe(t){return!!eC(t)}function hct(t){const e=eC(t);return e&&{...G2,...e}}function SEe(t,e){t.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==e))})}let pct=0;const uB=Object.create(null);function CEe(t,e){uB[t]=e}function dB(t){return uB[t]||uB[""]}var mct={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function gct(t,e,n,r){const o=t.resources.length,i=t.random?Math.floor(Math.random()*o):t.index;let a;if(t.random){let S=t.resources.slice(0);for(a=[];S.length>1;){const w=Math.floor(Math.random()*S.length);a.push(S[w]),S=S.slice(0,w).concat(S.slice(w+1))}a=a.concat(S)}else a=t.resources.slice(i).concat(t.resources.slice(0,i));const s=Date.now();let l,c="pending",u=0,d=null,f=[],h=[];function g(){d&&(clearTimeout(d),d=null)}function v(){c==="pending"&&(c="aborted"),g(),f.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),f=[]}function b(S,w){w&&(h=[]),typeof S=="function"&&h.push(S)}function p(){c="failed",h.forEach(S=>{S(void 0,l)})}function O(){f.forEach(S=>{S.status==="pending"&&(S.status="aborted")}),f=[]}function k(){if(c!=="pending")return;g();const S=a.shift();if(S===void 0)return f.length?void(d=setTimeout(()=>{g(),c==="pending"&&(O(),p())},t.timeout)):void p();const w={status:"pending",resource:S,callback:(T,P)=>{(function(j,D,N){const E=D!=="success";switch(f=f.filter(A=>A!==j),c){case"pending":break;case"failed":if(E||!t.dataAfterTimeout)return;break;default:return}if(D==="abort")return l=N,void p();if(E)return l=N,void(f.length||(a.length?k():p()));if(g(),O(),!t.random){const A=t.resources.indexOf(j.resource);A!==-1&&A!==t.index&&(t.index=A)}c="completed",h.forEach(A=>{A(N)})})(w,T,P)}};f.push(w),u++,d=setTimeout(k,t.rotate),n(S,e,w.callback)}return typeof r=="function"&&h.push(r),setTimeout(k),function(){return{startTime:s,payload:e,status:c,queriesSent:u,queriesPending:f.length,subscribe:b,abort:v}}}function _Ee(t){const e={...mct,...t};let n=[];function r(){n=n.filter(i=>i().status==="pending")}return{query:function(i,a,s){const l=gct(e,i,a,(c,u)=>{r(),s&&s(c,u)});return n.push(l),l},find:function(i){return n.find(a=>i(a))||null},setIndex:i=>{e.index=i},getIndex:()=>e.index,cleanup:r}}function fB(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const F5=Object.create(null),B5=["https://api.simplesvg.com","https://api.unisvg.com"],hB=[];for(;B5.length>0;)B5.length===1||Math.random()>.5?hB.push(B5.shift()):hB.push(B5.pop());function TEe(t,e){const n=fB(e);return n!==null&&(F5[t]=n,!0)}function W5(t){return F5[t]}function vct(){return Object.keys(F5)}function PEe(){}F5[""]=fB({resources:["https://api.iconify.design"].concat(hB)});const pB=Object.create(null);function EEe(t,e,n){let r,o;if(typeof t=="string"){const i=dB(t);if(!i)return n(void 0,424),PEe;o=i.send;const a=function(s){if(!pB[s]){const l=W5(s);if(!l)return;const c={config:l,redundancy:_Ee(l)};pB[s]=c}return pB[s]}(t);a&&(r=a.redundancy)}else{const i=fB(t);if(i){r=_Ee(i);const a=dB(t.resources?t.resources[0]:"");a&&(o=a.send)}}return r&&o?r.query(e,o,n)().abort:(n(void 0,424),PEe)}function REe(){}function yct(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let r=!1;const o=e.provider,i=e.prefix;n.forEach(a=>{const s=a.icons,l=s.pending.length;s.pending=s.pending.filter(c=>{if(c.prefix!==i)return!0;const u=c.name;if(e.icons[u])s.loaded.push({provider:o,prefix:i,name:u});else{if(!e.missing.has(u))return r=!0,!0;s.missing.push({provider:o,prefix:i,name:u})}return!1}),s.pending.length!==l&&(r||SEe([e],a.id),a.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),a.abort))})}))}(t)}))}function tC(t,e,n){function r(){const o=t.pendingIcons;e.forEach(i=>{o&&o.delete(i),t.icons[i]||t.missing.add(i)})}if(n&&typeof n=="object")try{if(!bEe(t,n).length)return void r()}catch(o){console.error(o)}r(),yct(t)}function jEe(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function bct(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:r}=t,o=t.iconsToLoad;if(delete t.iconsToLoad,!o||!o.length)return;const i=t.loadIcon;if(t.loadIcons&&(o.length>1||!i))return void jEe(t.loadIcons(o,r,n),c=>{tC(t,o,c)});if(i)return void o.forEach(c=>{jEe(i(c,r,n),u=>{tC(t,[c],u?{prefix:r,icons:{[c]:u}}:null)})});const{valid:a,invalid:s}=function(c){const u=[],d=[];return c.forEach(f=>{(f.match(mEe)?u:d).push(f)}),{valid:u,invalid:d}}(o);if(s.length&&tC(t,s,null),!a.length)return;const l=r.match(mEe)?dB(n):null;if(!l)return void tC(t,a,null);l.prepare(n,r,a).forEach(c=>{EEe(n,c,u=>{tC(t,c.icons,u)})})}))}const mB=(t,e)=>{const n=function(l,c=!0,u=!1){const d=[];return l.forEach(f=>{const h=typeof f=="string"?K2(f,c,u):f;h&&d.push(h)}),d}(t,!0,xEe()),r=function(l){const c={loaded:[],missing:[],pending:[]},u=Object.create(null);l.sort((f,h)=>f.provider!==h.provider?f.provider.localeCompare(h.provider):f.prefix!==h.prefix?f.prefix.localeCompare(h.prefix):f.name.localeCompare(h.name));let d={provider:"",prefix:"",name:""};return l.forEach(f=>{if(d.name===f.name&&d.prefix===f.prefix&&d.provider===f.provider)return;d=f;const h=f.provider,g=f.prefix,v=f.name,b=u[h]||(u[h]=Object.create(null)),p=b[g]||(b[g]=yh(h,g));let O;O=v in p.icons?c.loaded:g===""||p.missing.has(v)?c.missing:c.pending;const k={provider:h,prefix:g,name:v};O.push(k)}),c}(n);if(!r.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(r.loaded,r.missing,r.pending,REe)}),()=>{l=!1}}const o=Object.create(null),i=[];let a,s;return r.pending.forEach(l=>{const{provider:c,prefix:u}=l;if(u===s&&c===a)return;a=c,s=u,i.push(yh(c,u));const d=o[c]||(o[c]=Object.create(null));d[u]||(d[u]=[])}),r.pending.forEach(l=>{const{provider:c,prefix:u,name:d}=l,f=yh(c,u),h=f.pendingIcons||(f.pendingIcons=new Set);h.has(d)||(h.add(d),o[c][u].push(d))}),i.forEach(l=>{const c=o[l.provider][l.prefix];c.length&&bct(l,c)}),e?function(l,c,u){const d=pct++,f=SEe.bind(null,u,d);if(!c.pending.length)return f;const h={id:d,icons:c,callback:l,abort:f};return u.forEach(g=>{(g.loaderCallbacks||(g.loaderCallbacks=[])).push(h)}),f}(e,r,i):REe},xct=t=>new Promise((e,n)=>{const r=typeof t=="string"?K2(t,!0):t;r?mB([r||t],o=>{if(o.length&&r){const i=eC(r);if(i)return void e({...G2,...i})}n(t)}):n(t)});function DEe(t){try{const e=typeof t=="string"?JSON.parse(t):t;if(typeof e.body=="string")return{...e}}catch{}}let AEe=!1;try{AEe=navigator.vendor.indexOf("Apple")===0}catch{}const Oct=/(-?[0-9.]*[0-9]+[0-9.]*)/g,wct=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function gB(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const r=t.split(Oct);if(r===null||!r.length)return t;const o=[];let i=r.shift(),a=wct.test(i);for(;;){if(a){const s=parseFloat(i);isNaN(s)?o.push(i):o.push(Math.ceil(s*e*n)/n)}else o.push(i);if(i=r.shift(),i===void 0)return o.join("");a=!a}}function MEe(t,e){const n={...G2,...t},r={...fEe,...e},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach(v=>{const b=[],p=v.hFlip,O=v.vFlip;let k,S=v.rotate;switch(p?O?S+=2:(b.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),b.push("scale(-1 1)"),o.top=o.left=0):O&&(b.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),b.push("scale(1 -1)"),o.top=o.left=0),S<0&&(S-=4*Math.floor(S/4)),S%=4,S){case 1:k=o.height/2+o.top,b.unshift("rotate(90 "+k.toString()+" "+k.toString()+")");break;case 2:b.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:k=o.width/2+o.left,b.unshift("rotate(-90 "+k.toString()+" "+k.toString()+")")}S%2==1&&(o.left!==o.top&&(k=o.left,o.left=o.top,o.top=k),o.width!==o.height&&(k=o.width,o.width=o.height,o.height=k)),b.length&&(i=function(w,T,P){const j=function(D,N="defs"){let E="";const A=D.indexOf("<"+N);for(;A>=0;){const I=D.indexOf(">",A),L=D.indexOf("</"+N);if(I===-1||L===-1)break;const F=D.indexOf(">",L);if(F===-1)break;E+=D.slice(I+1,L).trim(),D=D.slice(0,A).trim()+D.slice(F+1)}return{defs:E,content:D}}(w);return function(D,N){return D?"<defs>"+D+"</defs>"+N:N}(j.defs,T+j.content+P)}(i,'<g transform="'+b.join(" ")+'">',"</g>"))});const a=r.width,s=r.height,l=o.width,c=o.height;let u,d;a===null?(d=s===null?"1em":s==="auto"?c:s,u=gB(d,l/c)):(u=a==="auto"?l:a,d=s===null?gB(u,c/l):s==="auto"?c:s);const f={},h=(v,b)=>{(p=>p==="unset"||p==="undefined"||p==="none")(b)||(f[v]=b.toString())};h("width",u),h("height",d);const g=[o.left,o.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:i}}function vB(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in e)n+=" "+r+'="'+e[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function NEe(t){return'url("'+function(e){return"data:image/svg+xml,"+function(n){return n.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(t)+'")'}let U5=(()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}})();function kct(t){U5=t}function Sct(){return U5}const Cct={prepare:(t,e,n)=>{const r=[],o=function(l,c){const u=W5(l);if(!u)return 0;let d;if(u.maxURL){let f=0;u.resources.forEach(g=>{f=Math.max(f,g.length)});const h=c+".json?icons=";d=u.maxURL-f-u.path.length-h.length}else d=0;return d}(t,e),i="icons";let a={type:i,provider:t,prefix:e,icons:[]},s=0;return n.forEach((l,c)=>{s+=l.length+1,s>=o&&c>0&&(r.push(a),a={type:i,provider:t,prefix:e,icons:[]},s=l.length),a.icons.push(l)}),r.push(a),r},send:(t,e,n)=>{if(!U5)return void n("abort",424);let r=function(i){if(typeof i=="string"){const a=W5(i);if(a)return a.path}return"/"}(e.provider);switch(e.type){case"icons":{const i=e.prefix,a=e.icons.join(",");r+=i+".json?"+new URLSearchParams({icons:a}).toString();break}case"custom":{const i=e.uri;r+=i.slice(0,1)==="/"?i.slice(1):i;break}default:return void n("abort",400)}let o=503;U5(t+r).then(i=>{const a=i.status;if(a===200)return o=501,i.json();setTimeout(()=>{n(function(s){return s===404}(a)?"abort":"next",a)})}).then(i=>{setTimeout(typeof i=="object"&&i!==null?()=>{n("success",i)}:()=>{i===404?n("abort",i):n("next",o)})}).catch(()=>{n("next",o)})}};function _ct(t,e,n){yh(n||"",e).loadIcons=t}function Tct(t,e,n){yh(n||"",e).loadIcon=t}const yB="data-style";let $Ee="";function Pct(t){$Ee=t}function IEe(t,e){let n=Array.from(t.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(yB));n||(n=document.createElement("style"),n.setAttribute(yB,yB),t.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(e?"-0.125em":"0")+"}span,svg{display:block;margin:auto}"+$Ee}function QEe(){let t;CEe("",Cct),xEe(!0);try{t=window}catch{}if(t){if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!wEe(r))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(const n in e){const r="IconifyProviders["+n+"] is invalid.";try{const o=e[n];if(typeof o!="object"||!o||o.resources===void 0)continue;TEe(n,o)||console.error(r)}catch{console.error(r)}}}}return{enableCache:e=>{},disableCache:e=>{},iconLoaded:kEe,iconExists:kEe,getIcon:hct,listIcons:fct,addIcon:OEe,addCollection:wEe,calculateSize:gB,buildIcon:MEe,iconToHTML:vB,svgToURL:NEe,loadIcons:mB,loadIcon:xct,addAPIProvider:TEe,setCustomIconLoader:Tct,setCustomIconsLoader:_ct,appendCustomStyle:Pct,_api:{getAPIConfig:W5,setAPIModule:CEe,sendAPIQuery:EEe,setFetch:kct,getFetch:Sct,listAPIProviders:vct}}}const bB={"background-color":"currentColor"},LEe={"background-color":"transparent"},zEe={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},VEe={"-webkit-mask":bB,mask:bB,background:LEe};for(const t in VEe){const e=VEe[t];for(const n in zEe)e[t+"-"+n]=zEe[n]}function qEe(t){return t?t+(t.match(/^[-0-9.]+$/)?"px":""):"inherit"}let nC;function Ect(t){return nC===void 0&&function(){try{nC=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{nC=null}}(),nC?nC.createHTML(t):t}function xB(t){return Array.from(t.childNodes).find(e=>{const n=e.tagName&&e.tagName.toUpperCase();return n==="SPAN"||n==="SVG"})}function FEe(t,e){const n=e.icon.data,r=e.customisations,o=MEe(n,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const i=e.renderedMode;let a;i==="svg"?a=function(l){const c=document.createElement("span"),u=l.attributes;let d="";u.width||(d="width: inherit;"),u.height||(d+="height: inherit;"),d&&(u.style=d);const f=vB(l.body,u);return c.innerHTML=Ect(f),c.firstChild}(o):a=function(l,c,u){const d=document.createElement("span");let f=l.body;f.indexOf("<a")!==-1&&(f+="<!-- "+Date.now()+" -->");const h=l.attributes,g=NEe(vB(f,{...h,width:c.width+"",height:c.height+""})),v=d.style,b={"--svg":g,width:qEe(h.width),height:qEe(h.height),...u?bB:LEe};for(const p in b)v.setProperty(p,b[p]);return d}(o,{...G2,...n},i==="mask");const s=xB(t);s?a.tagName==="SPAN"&&s.tagName===a.tagName?s.setAttribute("style",a.getAttribute("style")):t.replaceChild(a,s):t.appendChild(a)}function BEe(t,e,n){return{rendered:!1,inline:e,icon:t,lastRender:n&&(n.rendered?n:n.lastRender)}}const Rct=function(t="iconify-icon"){let e,n;try{e=window.customElements,n=window.HTMLElement}catch{return}if(!e||!n)return;const r=e.get(t);if(r)return r;const o=["icon","mode","inline","noobserver","width","height","rotate","flip"],i=class extends n{constructor(){super();en(this,"_shadowRoot");en(this,"_initialised",!1);en(this,"_state");en(this,"_checkQueued",!1);en(this,"_connected",!1);en(this,"_observer",null);en(this,"_visible",!0);const l=this._shadowRoot=this.attachShadow({mode:"open"}),c=this.hasAttribute("inline");IEe(l,c),this._state=BEe({value:""},c),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(l){switch(l){case"inline":{const c=this.hasAttribute("inline"),u=this._state;c!==u.inline&&(u.inline=c,IEe(this._shadowRoot,c));break}case"noobserver":this.hasAttribute("noobserver")?this.startObserver():this.stopObserver();break;default:this._queueCheck()}}get icon(){const l=this.getAttribute("icon");if(l&&l.slice(0,1)==="{")try{return JSON.parse(l)}catch{}return l}set icon(l){typeof l=="object"&&(l=JSON.stringify(l)),this.setAttribute("icon",l)}get inline(){return this.hasAttribute("inline")}set inline(l){l?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(l){l?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const l=this._state;if(l.rendered){const c=this._shadowRoot;if(l.renderedMode==="svg")try{return void c.lastChild.setCurrentTime(0)}catch{}FEe(c,l)}}get status(){const l=this._state;return l.rendered?"rendered":l.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const l=this._state,c=this.getAttribute("icon");if(c!==l.icon.value)return void this._iconChanged(c);if(!l.rendered||!this._visible)return;const u=this.getAttribute("mode"),d=pEe(this);l.attrMode===u&&!function(f,h){for(const g in hEe)if(f[g]!==h[g])return!0;return!1}(l.customisations,d)&&xB(this._shadowRoot)||this._renderIcon(l.icon,d,u)}_iconChanged(l){const c=function(u,d){if(typeof u=="object")return{data:DEe(u),value:u};if(typeof u!="string")return{value:u};if(u.includes("{")){const v=DEe(u);if(v)return{data:v,value:u}}const f=K2(u,!0,!0);if(!f)return{value:u};const h=eC(f);if(h!==void 0||!f.prefix)return{value:u,name:f,data:h};const g=mB([f],()=>d(u,f,eC(f)));return{value:u,name:f,loading:g}}(l,(u,d,f)=>{const h=this._state;if(h.rendered||this.getAttribute("icon")!==u)return;const g={value:u,name:d,data:f};g.data?this._gotIconData(g):h.icon=g});c.data?this._gotIconData(c):this._state=BEe(c,this._state.inline,this._state)}_forceRender(){if(!this._visible){const l=xB(this._shadowRoot);return void(l&&this._shadowRoot.removeChild(l))}this._queueCheck()}_gotIconData(l){this._checkQueued=!1,this._renderIcon(l,pEe(this),this.getAttribute("mode"))}_renderIcon(l,c,u){const d=function(h,g){switch(g){case"svg":case"bg":case"mask":return g}return g==="style"||!AEe&&h.indexOf("<a")!==-1?h.indexOf("currentColor")===-1?"bg":"mask":"svg"}(l.data.body,u),f=this._state.inline;FEe(this._shadowRoot,this._state={rendered:!0,icon:l,inline:f,customisations:c,attrMode:u,renderedMode:d})}startObserver(){if(!this._observer&&!this.hasAttribute("noobserver"))try{this._observer=new IntersectionObserver(l=>{const c=l.some(u=>u.isIntersecting);c!==this._visible&&(this._visible=c,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};o.forEach(s=>{s in i.prototype||Object.defineProperty(i.prototype,s,{get:function(){return this.getAttribute(s)},set:function(l){l!==null?this.setAttribute(s,l):this.removeAttribute(s)}})});const a=QEe();for(const s in a)i[s]=i.prototype[s]=a[s];return e.define(t,i),i}()||QEe(),{enableCache:Iyt,disableCache:Qyt,iconLoaded:Lyt,iconExists:zyt,getIcon:Vyt,listIcons:qyt,addIcon:Fyt,addCollection:Byt,calculateSize:Wyt,buildIcon:Uyt,iconToHTML:Zyt,svgToURL:Xyt,loadIcons:Hyt,loadIcon:Yyt,setCustomIconLoader:Gyt,setCustomIconsLoader:Kyt,addAPIProvider:Jyt,_api:e1t}=Rct,OB=_.createContext(null),jct=t=>{const{controller:e}=_.useContext(OB),n=ge.useRef(Symbol("fill"));return _.useEffect(()=>(e.mount({name:t.name,ref:n.current,children:t.children}),()=>{e.unmount({name:t.name,ref:n.current})}),[]),_.useEffect(()=>{e.update({name:t.name,ref:n.current,children:t.children})}),null};var Dct=Object.defineProperty,WEe=(t,e,n)=>(((r,o,i)=>{o in r?Dct(r,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[o]=i})(t,typeof e!="symbol"?e+"":e,n),n);const UEe=console;class Act{constructor(e){WEe(this,"_bus"),WEe(this,"_db"),this._bus=e,this.handleFillMount=this.handleFillMount.bind(this),this.handleFillUpdated=this.handleFillUpdated.bind(this),this.handleFillUnmount=this.handleFillUnmount.bind(this),this._db={byName:new Map,byFill:new Map}}mount(){this._bus.on("fill-mount",this.handleFillMount),this._bus.on("fill-updated",this.handleFillUpdated),this._bus.on("fill-unmount",this.handleFillUnmount)}unmount(){this._bus.off("fill-mount",this.handleFillMount),this._bus.off("fill-updated",this.handleFillUpdated),this._bus.off("fill-unmount",this.handleFillUnmount)}handleFillMount({fill:e}){const n=_.Children.toArray(e.children),r=e.name,o={fill:e,children:n,name:r},i=this._db.byName.get(r);i?(i.components.push(o),i.listeners.forEach(a=>a([...i.components]))):this._db.byName.set(r,{listeners:[],components:[o]}),this._db.byFill.set(e.ref,o)}handleFillUpdated({fill:e}){const n=this._db.byFill.get(e.ref),r=_.Children.toArray(e.children);if(n){n.children=r;const o=this._db.byName.get(n.name);if(!o)throw new Error("registration was expected to be defined");o.listeners.forEach(i=>i([...o.components]))}else UEe.error("[handleFillUpdated] component was expected to be defined")}handleFillUnmount({fill:e}){const n=this._db.byFill.get(e.ref);if(!n)return void UEe.error("[handleFillUnmount] component was expected to be defined");const r=n.name,o=this._db.byName.get(r);if(!o)throw new Error("registration was expected to be defined");const i=o.components;o.components=i.filter(a=>a!==n),this._db.byFill.delete(e.ref),o.listeners.length===0&&o.components.length===0?this._db.byName.delete(r):o.listeners.forEach(a=>a([...o.components]))}onComponentsChange(e,n){const r=this._db.byName.get(e);r?(r.listeners.push(n),n(r.components)):(this._db.byName.set(e,{listeners:[n],components:[]}),n([]))}getFillsByName(e){const n=this._db.byName.get(e);return n?n.components.map(r=>r.fill):[]}getChildrenByName(e){const n=this._db.byName.get(e);return n?n.components.map(r=>r.children).reduce((r,o)=>r.concat(o),[]):[]}removeOnComponentsChange(e,n){const r=this._db.byName.get(e);if(!r)throw new Error("expected registration to be defined");const o=r.listeners;o.splice(o.indexOf(n),1)}}var Mct=Object.defineProperty,Nct=(t,e,n)=>(((r,o,i)=>{o in r?Mct(r,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[o]=i})(t,e+"",n),n);class ZEe{constructor(){Nct(this,"bus",function(e){return{all:e=e||new Map,on:function(n,r){var o=e.get(n);o?o.push(r):e.set(n,[r])},off:function(n,r){var o=e.get(n);o&&(r?o.splice(o.indexOf(r)>>>0,1):e.set(n,[]))},emit:function(n,r){var o=e.get(n);o&&o.slice().map(function(i){i(r)}),(o=e.get("*"))&&o.slice().map(function(i){i(n,r)})}}}())}mount(e){this.bus.emit("fill-mount",{fill:e})}unmount(e){this.bus.emit("fill-unmount",{fill:e})}update(e){this.bus.emit("fill-updated",{fill:e})}}const XEe=({controller:t,children:e})=>{const[n]=ge.useState(()=>{const r=function(o){const i=o||new ZEe;return{controller:i,manager:new Act(i.bus)}}(t);return r.manager.mount(),r});return ge.useEffect(()=>()=>{n.manager.unmount()},[]),ge.createElement(OB.Provider,{value:n},e)};hM=function(t,e){const[n,r]=_.useState([]),{manager:o}=_.useContext(OB);return _.useEffect(()=>(o.onComponentsChange(t,r),()=>{o.removeOnComponentsChange(t,r)}),[t]),n.flatMap((i,a)=>{const{children:s}=i;return s.map((l,c)=>{if(typeof l=="number"||typeof l=="string")throw new Error("Only element children will work here");return ge.cloneElement(l,{key:a.toString()+c.toString(),...e})})})};let HEe,wB;oG=t=>{const e=hM(t.name,t.childProps);if(typeof t.children=="function"){const n=t.children(e);if(ge.isValidElement(n)||n===null)return n;throw new Error("Slot rendered with function must return a valid React Element.")}return e},HEe=()=>(ue.c(1),null),wB=_.memo(t=>{const e=ue.c(3),{children:n}=t,{theme:r}=as();let o,i;return e[0]!==r?(o=()=>(document.body.classList.add(r,`${r}-theme`),()=>{document.body.classList.remove(r,`${r}-theme`)}),i=[r],e[0]=r,e[1]=o,e[2]=i):(o=e[1],i=e[2]),_.useLayoutEffect(o,i),n}),wB.displayName="ThemeProvider";const $ct=t=>{const e=ue.c(3),{variables:n,children:r}=t;let o;return e[0]!==r||e[1]!==n?(o=y.jsx("div",{className:"contents",style:n,children:r}),e[0]=r,e[1]=n,e[2]=o):o=e[2],o},kB=t=>{let e=null;const n=async()=>(e||(e=t()),e),r=ge.lazy(()=>n());return{preload:n,Component:r}};var SB="ToastProvider",[CB,Ict,Qct]=Lp("Toast"),[YEe,t1t]=Wo("Toast",[Qct]),[Lct,Z5]=YEe(SB),GEe=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:a}=t,[s,l]=_.useState(null),[c,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${SB}\`. Expected non-empty \`string\`.`),y.jsx(CB.Provider,{scope:e,children:y.jsx(Lct,{scope:e,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:_.useCallback(()=>u(h=>h+1),[]),onToastRemove:_.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:a})})};GEe.displayName=SB;var KEe="ToastViewport",zct=["F8"],_B="toast.viewportPause",TB="toast.viewportResume",JEe=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=zct,label:o="Notifications ({hotkey})",...i}=t,a=Z5(KEe,n),s=Ict(n),l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=ln(e,d,a.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=a.toastCount>0;_.useEffect(()=>{const b=p=>{var k;r.length!==0&&r.every(S=>p[S]||p.code===S)&&((k=d.current)==null||k.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),_.useEffect(()=>{const b=l.current,p=d.current;if(g&&b&&p){const O=()=>{if(!a.isClosePausedRef.current){const T=new CustomEvent(_B);p.dispatchEvent(T),a.isClosePausedRef.current=!0}},k=()=>{if(a.isClosePausedRef.current){const T=new CustomEvent(TB);p.dispatchEvent(T),a.isClosePausedRef.current=!1}},S=T=>{!b.contains(T.relatedTarget)&&k()},w=()=>{b.contains(document.activeElement)||k()};return b.addEventListener("focusin",O),b.addEventListener("focusout",S),b.addEventListener("pointermove",O),b.addEventListener("pointerleave",w),window.addEventListener("blur",O),window.addEventListener("focus",k),()=>{b.removeEventListener("focusin",O),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",O),b.removeEventListener("pointerleave",w),window.removeEventListener("blur",O),window.removeEventListener("focus",k)}}},[g,a.isClosePausedRef]);const v=_.useCallback(({tabbingDirection:b})=>{const p=s().map(O=>{const k=O.ref.current,S=[k,...Wct(k)];return b==="forwards"?S:S.reverse()});return(b==="forwards"?p.reverse():p).flat()},[s]);return _.useEffect(()=>{const b=d.current;if(b){const p=O=>{var S,w,T;const k=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!k){const P=document.activeElement,j=O.shiftKey;if(O.target===b&&j)return void((S=c.current)==null?void 0:S.focus());const D=v({tabbingDirection:j?"backwards":"forwards"}),N=D.findIndex(E=>E===P);RB(D.slice(N+1))?O.preventDefault():j?(w=c.current)==null||w.focus():(T=u.current)==null||T.focus()}};return b.addEventListener("keydown",p),()=>b.removeEventListener("keydown",p)}},[s,v]),y.jsxs(sle,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&y.jsx(PB,{ref:c,onFocusFromOutsideViewport:()=>{RB(v({tabbingDirection:"forwards"}))}}),y.jsx(CB.Slot,{scope:n,children:y.jsx(_t.ol,{tabIndex:-1,...i,ref:f})}),g&&y.jsx(PB,{ref:u,onFocusFromOutsideViewport:()=>{RB(v({tabbingDirection:"backwards"}))}})]})});JEe.displayName=KEe;var eRe="ToastFocusProxy",PB=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=t,i=Z5(eRe,n);return y.jsx(NE,{"aria-hidden":!0,tabIndex:0,...o,ref:e,style:{position:"fixed"},onFocus:a=>{var l;const s=a.relatedTarget;!((l=i.viewport)!=null&&l.contains(s))&&r()}})});PB.displayName=eRe;var rC="Toast",tRe=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...a}=t,[s,l]=Ao({prop:r,defaultProp:o??!0,onChange:i,caller:rC});return y.jsx(Uo,{present:n||s,children:y.jsx(Fct,{open:s,...a,ref:e,onClose:()=>l(!1),onPause:Lo(t.onPause),onResume:Lo(t.onResume),onSwipeStart:ut(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ut(t.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:ut(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ut(t.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});tRe.displayName=rC;var[Vct,qct]=YEe(rC,{onClose(){}}),Fct=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...g}=t,v=Z5(rC,n),[b,p]=_.useState(null),O=ln(e,L=>p(L)),k=_.useRef(null),S=_.useRef(null),w=o||v.duration,T=_.useRef(0),P=_.useRef(w),j=_.useRef(0),{onToastAdd:D,onToastRemove:N}=v,E=Lo(()=>{var F;(b==null?void 0:b.contains(document.activeElement))&&((F=v.viewport)==null||F.focus()),a()}),A=_.useCallback(L=>{L&&L!==1/0&&(window.clearTimeout(j.current),T.current=new Date().getTime(),j.current=window.setTimeout(E,L))},[E]);_.useEffect(()=>{const L=v.viewport;if(L){const F=()=>{A(P.current),c==null||c()},Q=()=>{const W=new Date().getTime()-T.current;P.current=P.current-W,window.clearTimeout(j.current),l==null||l()};return L.addEventListener(_B,Q),L.addEventListener(TB,F),()=>{L.removeEventListener(_B,Q),L.removeEventListener(TB,F)}}},[v.viewport,w,l,c,A]),_.useEffect(()=>{i&&!v.isClosePausedRef.current&&A(w)},[i,w,v.isClosePausedRef,A]),_.useEffect(()=>(D(),()=>N()),[D,N]);const I=_.useMemo(()=>b?lRe(b):null,[b]);return v.viewport?y.jsxs(y.Fragment,{children:[I&&y.jsx(Bct,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),y.jsx(Vct,{scope:n,onClose:E,children:Lh.createPortal(y.jsx(CB.ItemSlot,{scope:n,children:y.jsx(ale,{asChild:!0,onEscapeKeyDown:ut(s,()=>{v.isFocusedToastEscapeKeyDownRef.current||E(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:y.jsx(_t.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection,...g,ref:O,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ut(t.onKeyDown,L=>{L.key==="Escape"&&(s==null||s(L.nativeEvent),L.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,E()))}),onPointerDown:ut(t.onPointerDown,L=>{L.button===0&&(k.current={x:L.clientX,y:L.clientY})}),onPointerMove:ut(t.onPointerMove,L=>{if(!k.current)return;const F=L.clientX-k.current.x,Q=L.clientY-k.current.y,W=!!S.current,U=["left","right"].includes(v.swipeDirection),X=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,G=U?X(0,F):0,ae=U?0:X(0,Q),ne=L.pointerType==="touch"?10:2,re={x:G,y:ae},Z={originalEvent:L,delta:re};W?(S.current=re,X5("toast.swipeMove",d,Z,{discrete:!1})):cRe(re,v.swipeDirection,ne)?(S.current=re,X5("toast.swipeStart",u,Z,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(F)>ne||Math.abs(Q)>ne)&&(k.current=null)}),onPointerUp:ut(t.onPointerUp,L=>{const F=S.current,Q=L.target;if(Q.hasPointerCapture(L.pointerId)&&Q.releasePointerCapture(L.pointerId),S.current=null,k.current=null,F){const W=L.currentTarget,U={originalEvent:L,delta:F};cRe(F,v.swipeDirection,v.swipeThreshold)?X5("toast.swipeEnd",h,U,{discrete:!0}):X5("toast.swipeCancel",f,U,{discrete:!0}),W.addEventListener("click",X=>X.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),Bct=t=>{const{__scopeToast:e,children:n,...r}=t,o=Z5(rC,e),[i,a]=_.useState(!1),[s,l]=_.useState(!1);return function(c=()=>{}){const u=Lo(c);Zo(()=>{let d=0,f=0;return d=window.requestAnimationFrame(()=>f=window.requestAnimationFrame(u)),()=>{window.cancelAnimationFrame(d),window.cancelAnimationFrame(f)}},[u])}(()=>a(!0)),_.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:y.jsx(zg,{asChild:!0,children:y.jsx(NE,{...r,children:i&&y.jsxs(y.Fragment,{children:[o.label," ",n]})})})},nRe=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(_t.div,{...r,ref:e})});nRe.displayName="ToastTitle";var rRe=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(_t.div,{...r,ref:e})});rRe.displayName="ToastDescription";var oRe="ToastAction",iRe=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?y.jsx(sRe,{altText:n,asChild:!0,children:y.jsx(EB,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${oRe}\`. Expected non-empty \`string\`.`),null)});iRe.displayName=oRe;var aRe="ToastClose",EB=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,o=qct(aRe,n);return y.jsx(sRe,{asChild:!0,children:y.jsx(_t.button,{type:"button",...r,ref:e,onClick:ut(t.onClick,o.onClose)})})});EB.displayName=aRe;var sRe=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...o}=t;return y.jsx(_t.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:e})});function lRe(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),function(r){return r.nodeType===r.ELEMENT_NODE}(n)){const r=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!r)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&e.push(i)}else e.push(...lRe(n))}}),e}function X5(t,e,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?Hw(o,i):o.dispatchEvent(i)}var cRe=(t,e,n=0)=>{const r=Math.abs(t.x),o=Math.abs(t.y),i=r>o;return e==="left"||e==="right"?i&&r>n:!i&&o>n};function Wct(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function RB(t){const e=document.activeElement;return t.some(n=>n===e||(n.focus(),document.activeElement!==e))}var uRe=JEe,dRe=tRe,fRe=nRe,hRe=rRe,pRe=iRe,mRe=EB;const Uct=GEe,gRe=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:w-fit md:max-w-[420px]",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(uRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});gRe.displayName=uRe.displayName;const Zct=Po("data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full",{variants:{variant:{default:"bg-background border",danger:"group destructive text-error border-destructive bg-[var(--red-1)] shadow-mdSolid shadow-error"}},defaultVariants:{variant:"default"}}),vRe=_.forwardRef((t,e)=>{const n=ue.c(11);let r,o,i;n[0]!==t?({className:r,variant:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const a=i||"default";let s,l;return n[4]!==r||n[5]!==a?(s=we(Zct({variant:a}),"print:hidden",r),n[4]=r,n[5]=a,n[6]=s):s=n[6],n[7]!==o||n[8]!==e||n[9]!==s?(l=y.jsx(dRe,{ref:e,className:s,...o}),n[7]=o,n[8]=e,n[9]=s,n[10]=l):l=n[10],l});vRe.displayName=dRe.displayName;const Xct=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-destructive/30 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(pRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});Xct.displayName=pRe.displayName;const yRe=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-500 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",r),n[3]=r,n[4]=i):i=n[4],n[5]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(Qa,{className:"h-4 w-4"}),n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==i?(s=y.jsx(mRe,{ref:e,className:i,"toast-close":"",...o,children:a}),n[6]=o,n[7]=e,n[8]=i,n[9]=s):s=n[9],s});yRe.displayName=mRe.displayName;const bRe=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("text-sm font-semibold",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(fRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});bRe.displayName=fRe.displayName;const xRe=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("text-sm opacity-90",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(hRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});xRe.displayName=hRe.displayName;const Hct=()=>{const t=ue.c(5),{toasts:e}=function(){const i=ue.c(5),[a,s]=_.useState(FE);let l,c,u;return i[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>(M6.add(s),()=>{M6.delete(s)}),i[0]=l):l=i[0],i[1]!==a?(c=[a],i[1]=a,i[2]=c):c=i[2],_.useEffect(l,c),i[3]!==a?(u={...a,dismiss:rBe},i[3]=a,i[4]=u):u=i[4],u}();let n,r,o;return t[0]!==e?(n=e.map(Yct),t[0]=e,t[1]=n):n=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(r=y.jsx(gRe,{}),t[2]=r):r=t[2],t[3]!==n?(o=y.jsxs(Uct,{children:[n,r]}),t[3]=n,t[4]=o):o=t[4],o};function Yct(t){const{id:e,title:n,description:r,action:o,...i}=t;return y.jsxs(vRe,{...i,children:[y.jsxs("div",{className:"grid gap-1",children:[n&&y.jsx(bRe,{children:n}),r&&y.jsx(xRe,{children:r})]}),o,y.jsx(yRe,{})]},e)}let Vb,jB,DB,AB;Vb=new ZEe,og={SIDEBAR:"sidebar",CONTEXT_AWARE_PANEL:"context-aware-panel"},jB=kB(()=>Be(()=>import("./home-page-CyD4pgGI.js"),__vite__mapDeps([116,117,113,118,119]),import.meta.url)),DB=kB(()=>Be(()=>import("./run-page-DXaOY9lF.js"),__vite__mapDeps([120,121,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,122,123]),import.meta.url)),AB=kB(()=>Be(()=>import("./edit-page-DiocoNm-.js").then(async t=>(await t.__tla,t)).then(t=>t.e),__vite__mapDeps([124,117,113,118,121,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,122,123,125,126,127,128,103,107,129,130,131]),import.meta.url));const ORe=_.memo(()=>{const t=ue.c(12),[e]=sG(),[n]=fG();let r;t[0]!==e.display.code_editor_font_size?(r=function(u){return u/16+"rem"}(e.display.code_editor_font_size),t[0]=e.display.code_editor_font_size,t[1]=r):r=t[1];const o=r;let i;t[2]!==n||t[3]!==e?(i=()=>{const u=aT();return u==="home"?y.jsx(jB.Component,{}):u==="read"?y.jsx(DB.Component,{appConfig:n}):y.jsx(AB.Component,{userConfig:e,appConfig:n})},t[2]=n,t[3]=e,t[4]=i):i=t[4];const a=i;let s,l,c;return t[5]!==o?(s={"--marimo-code-editor-font-size":o},t[5]=o,t[6]=s):s=t[6],t[7]!==a?(l=a(),t[7]=a,t[8]=l):l=t[8],t[9]!==s||t[10]!==l?(c=y.jsx(wRe,{children:y.jsx($ct,{variables:s,children:l})}),t[9]=s,t[10]=l,t[11]=c):c=t[11],c});ORe.displayName="MarimoApp";const wRe=_.memo(t=>{const e=ue.c(4),{children:n}=t;let r,o,i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=y.jsx(Hct,{}),o=y.jsx(HEe,{}),e[0]=r,e[1]=o):(r=e[0],o=e[1]),e[2]!==n?(i=y.jsx(Bh,{children:y.jsx(_.Suspense,{children:y.jsx(za,{children:y.jsx(XEe,{controller:Vb,children:y.jsxs(vGe,{children:[n,r,o]})})})})}),e[2]=n,e[3]=i):i=e[3],i});function Gct(t){return t.endsWith(".csv")?"text/csv":t.endsWith(".json")?"application/json":t.endsWith(".txt")?"text/plain":"application/octet-stream"}function kRe(t){return t.startsWith(".")?t.slice(1):t}wRe.displayName="Providers";const Kct=typeof window<"u"&&window.parent!==window;function Jct(){new URLSearchParams(window.location.search).has(Pl.vscode)&&Kct&&!Vh()&&(Ve.log("[vscode] Registering VS Code bindings"),document.addEventListener("keydown",t=>{var e,n;if((t.ctrlKey||t.metaKey)&&t.key==="c"){const r=((e=window.getSelection())==null?void 0:e.toString())??"";return Ve.log("[vscode] Sending copy",r),void ip({command:"copy",text:r})}if((t.ctrlKey||t.metaKey)&&t.key==="x"){const r=((n=window.getSelection())==null?void 0:n.toString())??"";return cg()&&document.execCommand("insertText",!1,""),Ve.log("[vscode] Sending cut",r),void ip({command:"cut",text:r})}if((t.ctrlKey||t.metaKey)&&t.key==="v")return Ve.log("[vscode] Sending paste"),void ip({command:"paste"})}),window.addEventListener("copy",()=>{var t;ip({command:"copy",text:((t=window.getSelection())==null?void 0:t.toString())??""})}),window.addEventListener("cut",()=>{var e;const t=((e=window.getSelection())==null?void 0:e.toString())??"";cg()&&document.execCommand("insertText",!1,""),ip({command:"cut",text:t})}),window.addEventListener("message",async t=>{try{const e=t.data,n=cg();if(e.command==="paste"){if(Ve.log(`[vscode] Received paste mac=${n}`,e),n){const r=document.activeElement;if(!r)return Ve.warn("[vscode] No active element to paste into"),void document.execCommand("insertText",!1,e.text);const o=new DataTransfer;o.setData("text/plain",e.text),r.dispatchEvent(new ClipboardEvent("paste",{clipboardData:o}))}else Ve.log("[vscode] Not pasting on mac");return}}catch(e){Ve.error("Error in paste message handler",e)}}),document.addEventListener("click",t=>{const e=t.target;if(e.tagName!=="A")return;const n=e.getAttribute("href");n&&(n.startsWith("http://")||n.startsWith("https://"))&&(t.preventDefault(),ip({command:"external_link",url:n}))}),document.addEventListener("contextmenu",t=>{t.preventDefault(),ip({command:"context_menu"})}))}ip=function(t){var e;(e=window.parent)==null||e.postMessage(t,"*")};var Y0="NavigationMenu",[MB,SRe,eut]=Lp(Y0),[NB,tut,nut]=Lp(Y0),[$B,n1t]=Wo(Y0,[eut,nut]),[rut,cc]=$B(Y0),[out,iut]=$B(Y0),CRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,delayDuration:a=200,skipDelayDuration:s=300,orientation:l="horizontal",dir:c,...u}=t,[d,f]=_.useState(null),h=ln(e,D=>f(D)),g=yf(c),v=_.useRef(0),b=_.useRef(0),p=_.useRef(0),[O,k]=_.useState(!0),[S,w]=Ao({prop:r,onChange:D=>{const N=s>0;D!==""?(window.clearTimeout(p.current),N&&k(!1)):(window.clearTimeout(p.current),p.current=window.setTimeout(()=>k(!0),s)),o==null||o(D)},defaultProp:i??"",caller:Y0}),T=_.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>w(""),150)},[w]),P=_.useCallback(D=>{window.clearTimeout(b.current),w(D)},[w]),j=_.useCallback(D=>{S===D?window.clearTimeout(b.current):v.current=window.setTimeout(()=>{window.clearTimeout(b.current),w(D)},a)},[S,w,a]);return _.useEffect(()=>()=>{window.clearTimeout(v.current),window.clearTimeout(b.current),window.clearTimeout(p.current)},[]),y.jsx(_Re,{scope:n,isRootMenu:!0,value:S,dir:g,orientation:l,rootNavigationMenu:d,onTriggerEnter:D=>{window.clearTimeout(v.current),O?j(D):P(D)},onTriggerLeave:()=>{window.clearTimeout(v.current),T()},onContentEnter:()=>window.clearTimeout(b.current),onContentLeave:T,onItemSelect:D=>{w(N=>N===D?"":D)},onItemDismiss:()=>w(""),children:y.jsx(_t.nav,{"aria-label":"Main","data-orientation":l,dir:g,...u,ref:h})})});CRe.displayName=Y0;var IB="NavigationMenuSub",aut=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",...s}=t,l=cc(IB,n),[c,u]=Ao({prop:r,onChange:o,defaultProp:i??"",caller:IB});return y.jsx(_Re,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:a,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>u(d),onItemSelect:d=>u(d),onItemDismiss:()=>u(""),children:y.jsx(_t.div,{"data-orientation":a,...s,ref:e})})});aut.displayName=IB;var _Re=t=>{const{scope:e,isRootMenu:n,rootNavigationMenu:r,dir:o,orientation:i,children:a,value:s,onItemSelect:l,onItemDismiss:c,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:h}=t,[g,v]=_.useState(null),[b,p]=_.useState(new Map),[O,k]=_.useState(null);return y.jsx(rut,{scope:e,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:G1(s),baseId:Do(),dir:o,orientation:i,viewport:g,onViewportChange:v,indicatorTrack:O,onIndicatorTrackChange:k,onTriggerEnter:Lo(u),onTriggerLeave:Lo(d),onContentEnter:Lo(f),onContentLeave:Lo(h),onItemSelect:Lo(l),onItemDismiss:Lo(c),onViewportContentChange:_.useCallback((S,w)=>{p(T=>(T.set(S,w),new Map(T)))},[]),onViewportContentRemove:_.useCallback(S=>{p(w=>w.has(S)?(w.delete(S),new Map(w)):w)},[]),children:y.jsx(MB.Provider,{scope:e,children:y.jsx(out,{scope:e,items:b,children:a})})})},TRe="NavigationMenuList",PRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,o=cc(TRe,n),i=y.jsx(_t.ul,{"data-orientation":o.orientation,...r,ref:e});return y.jsx(_t.div,{style:{position:"relative"},ref:o.onIndicatorTrackChange,children:y.jsx(MB.Slot,{scope:n,children:o.isRootMenu?y.jsx(LRe,{asChild:!0,children:i}):i})})});PRe.displayName=TRe;var ERe="NavigationMenuItem",[sut,RRe]=$B(ERe),jRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,...o}=t,i=Do(),a=r||i||"LEGACY_REACT_AUTO_VALUE",s=_.useRef(null),l=_.useRef(null),c=_.useRef(null),u=_.useRef(()=>{}),d=_.useRef(!1),f=_.useCallback((g="start")=>{if(s.current){u.current();const v=VB(s.current);v.length&&qB(g==="start"?v:v.reverse())}},[]),h=_.useCallback(()=>{if(s.current){const g=VB(s.current);g.length&&(u.current=function(v){return v.forEach(b=>{b.dataset.tabindex=b.getAttribute("tabindex")||"",b.setAttribute("tabindex","-1")}),()=>{v.forEach(b=>{const p=b.dataset.tabindex;b.setAttribute("tabindex",p)})}}(g))}},[]);return y.jsx(sut,{scope:n,value:a,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:h,onContentFocusOutside:h,children:y.jsx(_t.li,{...o,ref:e})})});jRe.displayName=ERe;var QB="NavigationMenuTrigger",DRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,disabled:r,...o}=t,i=cc(QB,t.__scopeNavigationMenu),a=RRe(QB,t.__scopeNavigationMenu),s=_.useRef(null),l=ln(s,a.triggerRef,e),c=qRe(i.baseId,a.value),u=FRe(i.baseId,a.value),d=_.useRef(!1),f=_.useRef(!1),h=a.value===i.value;return y.jsxs(y.Fragment,{children:[y.jsx(MB.ItemSlot,{scope:n,value:a.value,children:y.jsx(VRe,{asChild:!0,children:y.jsx(_t.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":BB(h),"aria-expanded":h,"aria-controls":u,...o,ref:l,onPointerEnter:ut(t.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:ut(t.onPointerMove,Y5(()=>{r||f.current||a.wasEscapeCloseRef.current||d.current||(i.onTriggerEnter(a.value),d.current=!0)})),onPointerLeave:ut(t.onPointerLeave,Y5(()=>{r||(i.onTriggerLeave(),d.current=!1)})),onClick:ut(t.onClick,()=>{i.onItemSelect(a.value),f.current=h}),onKeyDown:ut(t.onKeyDown,g=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];h&&g.key===v&&(a.onEntryKeyDown(),g.preventDefault())})})})}),h&&y.jsxs(y.Fragment,{children:[y.jsx(h6,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:g=>{const v=a.contentRef.current,b=g.relatedTarget,p=b===s.current,O=v==null?void 0:v.contains(b);!p&&O||a.onFocusProxyEnter(p?"start":"end")}}),i.viewport&&y.jsx("span",{"aria-owns":u})]})]})});DRe.displayName=QB;var ARe="navigationMenu.linkSelect",MRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,active:r,onSelect:o,...i}=t;return y.jsx(VRe,{asChild:!0,children:y.jsx(_t.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:e,onClick:ut(t.onClick,a=>{const s=a.target,l=new CustomEvent(ARe,{bubbles:!0,cancelable:!0});s.addEventListener(ARe,c=>o==null?void 0:o(c),{once:!0}),Hw(s,l),!l.defaultPrevented&&!a.metaKey&&Hw(s,new CustomEvent(H5,{bubbles:!0,cancelable:!0}))},{checkForDefaultPrevented:!1})})})});MRe.displayName="NavigationMenuLink";var LB="NavigationMenuIndicator",NRe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=cc(LB,t.__scopeNavigationMenu),i=!!o.value;return o.indicatorTrack?oO.createPortal(y.jsx(Uo,{present:n||i,children:y.jsx(lut,{...r,ref:e})}),o.indicatorTrack):null});NRe.displayName=LB;var lut=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,o=cc(LB,n),i=SRe(n),[a,s]=_.useState(null),[l,c]=_.useState(null),u=o.orientation==="horizontal",d=!!o.value;_.useEffect(()=>{var v;const h=i(),g=(v=h.find(b=>b.value===o.value))==null?void 0:v.ref.current;g&&s(g)},[i,o.value]);const f=()=>{a&&c({size:u?a.offsetWidth:a.offsetHeight,offset:u?a.offsetLeft:a.offsetTop})};return FB(a,f),FB(o.indicatorTrack,f),l?y.jsx(_t.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":o.orientation,...r,ref:e,style:{position:"absolute",...u?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}}):null}),qb="NavigationMenuContent",$Re=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=cc(qb,t.__scopeNavigationMenu),i=RRe(qb,t.__scopeNavigationMenu),a=ln(i.contentRef,e),s=i.value===o.value,l={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return o.viewport?y.jsx(cut,{forceMount:n,...l,ref:a}):y.jsx(Uo,{present:n||s,children:y.jsx(IRe,{"data-state":BB(s),...l,ref:a,onPointerEnter:ut(t.onPointerEnter,o.onContentEnter),onPointerLeave:ut(t.onPointerLeave,Y5(o.onContentLeave)),style:{pointerEvents:!s&&o.isRootMenu?"none":void 0,...l.style}})})});$Re.displayName=qb;var cut=_.forwardRef((t,e)=>{const n=cc(qb,t.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:o}=n;return Zo(()=>{r(t.value,{ref:e,...t})},[t,e,r]),Zo(()=>()=>o(t.value),[t.value,o]),null}),H5="navigationMenu.rootContentDismiss",IRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:o,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:s,onContentFocusOutside:l,...c}=t,u=cc(qb,n),d=_.useRef(null),f=ln(d,e),h=qRe(u.baseId,r),g=FRe(u.baseId,r),v=SRe(n),b=_.useRef(null),{onItemDismiss:p}=u;_.useEffect(()=>{const k=d.current;if(u.isRootMenu&&k){const S=()=>{var w;p(),s(),k.contains(document.activeElement)&&((w=o.current)==null||w.focus())};return k.addEventListener(H5,S),()=>k.removeEventListener(H5,S)}},[u.isRootMenu,t.value,o,p,s]);const O=_.useMemo(()=>{const k=v().map(D=>D.value);u.dir==="rtl"&&k.reverse();const S=k.indexOf(u.value),w=k.indexOf(u.previousValue),T=r===u.value,P=w===k.indexOf(r);if(!T&&!P)return b.current;const j=(()=>{if(S!==w){if(T&&w!==-1)return S>w?"from-end":"from-start";if(P&&S!==-1)return S>w?"to-start":"to-end"}return null})();return b.current=j,j},[u.previousValue,u.value,u.dir,v,r]);return y.jsx(LRe,{asChild:!0,children:y.jsx(Rp,{id:g,"aria-labelledby":h,"data-motion":O,"data-orientation":u.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var S;const k=new Event(H5,{bubbles:!0,cancelable:!0});(S=d.current)==null||S.dispatchEvent(k)},onFocusOutside:ut(t.onFocusOutside,k=>{var w;l();const S=k.target;(w=u.rootNavigationMenu)!=null&&w.contains(S)&&k.preventDefault()}),onPointerDownOutside:ut(t.onPointerDownOutside,k=>{var P;const S=k.target,w=v().some(j=>{var D;return(D=j.ref.current)==null?void 0:D.contains(S)}),T=u.isRootMenu&&((P=u.viewport)==null?void 0:P.contains(S));(w||T||!u.isRootMenu)&&k.preventDefault()}),onKeyDown:ut(t.onKeyDown,k=>{var w;const S=k.altKey||k.ctrlKey||k.metaKey;if(k.key==="Tab"&&!S){const T=VB(k.currentTarget),P=document.activeElement,j=T.findIndex(D=>D===P);qB(k.shiftKey?T.slice(0,j).reverse():T.slice(j+1,T.length))?k.preventDefault():(w=i.current)==null||w.focus()}}),onEscapeKeyDown:ut(t.onEscapeKeyDown,k=>{a.current=!0})})})}),zB="NavigationMenuViewport",QRe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=cc(zB,t.__scopeNavigationMenu),i=!!o.value;return y.jsx(Uo,{present:n||i,children:y.jsx(uut,{...r,ref:e})})});QRe.displayName=zB;var uut=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,children:r,...o}=t,i=cc(zB,n),a=ln(e,i.onViewportChange),s=iut(qb,t.__scopeNavigationMenu),[l,c]=_.useState(null),[u,d]=_.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,h=l?(l==null?void 0:l.height)+"px":void 0,g=!!i.value,v=g?i.value:i.previousValue;return FB(u,()=>{u&&c({width:u.offsetWidth,height:u.offsetHeight})}),y.jsx(_t.div,{"data-state":BB(g),"data-orientation":i.orientation,...o,ref:a,style:{pointerEvents:!g&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":h,...o.style},onPointerEnter:ut(t.onPointerEnter,i.onContentEnter),onPointerLeave:ut(t.onPointerLeave,Y5(i.onContentLeave)),children:Array.from(s.items).map(([b,{ref:p,forceMount:O,...k}])=>{const S=v===b;return y.jsx(Uo,{present:O||S,children:y.jsx(IRe,{...k,ref:Lu(p,w=>{S&&w&&d(w)})})},b)})})}),LRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,o=cc("FocusGroup",n);return y.jsx(NB.Provider,{scope:n,children:y.jsx(NB.Slot,{scope:n,children:y.jsx(_t.div,{dir:o.dir,...r,ref:e})})})}),zRe=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],VRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,o=tut(n),i=cc("FocusGroupItem",n);return y.jsx(NB.ItemSlot,{scope:n,children:y.jsx(_t.button,{...r,ref:e,onKeyDown:ut(t.onKeyDown,a=>{if(["Home","End",...zRe].includes(a.key)){let s=o().map(l=>l.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&s.reverse(),zRe.includes(a.key)){const l=s.indexOf(a.currentTarget);s=s.slice(l+1)}setTimeout(()=>qB(s)),a.preventDefault()}})})})});function VB(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function qB(t){const e=document.activeElement;return t.some(n=>n===e||(n.focus(),document.activeElement!==e))}function FB(t,e){const n=Lo(e);Zo(()=>{let r=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(r),o.unobserve(t)}}},[t,n])}function BB(t){return t?"open":"closed"}function qRe(t,e){return`${t}-trigger-${e}`}function FRe(t,e){return`${t}-content-${e}`}function Y5(t){return e=>e.pointerType==="mouse"?t(e):void 0}var BRe=CRe,WRe=PRe,dut=jRe,URe=DRe,fut=MRe,ZRe=NRe,XRe=$Re,HRe=QRe;const YRe=_.forwardRef((t,e)=>{const n=ue.c(16);let r,o,i,a;n[0]!==t?({className:o,children:r,orientation:i,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]);const s=i==="horizontal"&&"max-w-max flex-1 items-center justify-center",l=i==="vertical"&&"";let c,u,d;return n[5]!==o||n[6]!==s||n[7]!==l?(c=we(s,l,"relative z-10",o),n[5]=o,n[6]=s,n[7]=l,n[8]=c):c=n[8],n[9]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(JRe,{}),n[9]=u):u=n[9],n[10]!==r||n[11]!==i||n[12]!==a||n[13]!==e||n[14]!==c?(d=y.jsxs(BRe,{ref:e,className:c,orientation:i,...a,children:[r,u]}),n[10]=r,n[11]=i,n[12]=a,n[13]=e,n[14]=c,n[15]=d):d=n[15],d});YRe.displayName=BRe.displayName;const hut=Po("group flex list-none gap-1",{variants:{orientation:{horizontal:"flex items-center",vertical:"flex flex-col"}},defaultVariants:{orientation:"horizontal"}}),G5=_.forwardRef((t,e)=>{const n=ue.c(11);let r,o,i,a,s;return n[0]!==t?({className:r,orientation:o,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==r||n[5]!==o?(a=we(hut({orientation:o}),r),n[4]=r,n[5]=o,n[6]=a):a=n[6],n[7]!==i||n[8]!==e||n[9]!==a?(s=y.jsx(WRe,{ref:e,className:a,...i}),n[7]=i,n[8]=e,n[9]=a,n[10]=s):s=n[10],s});G5.displayName=WRe.displayName;const WB=dut,UB=Po("group inline-flex rounded-md bg-background px-4 py-2 text-lg font-medium text-[var(--slate-12)] transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50",{variants:{orientation:{horizontal:"w-max items-center justify-center",vertical:"w-full"}},defaultVariants:{orientation:"horizontal"}}),GRe=_.forwardRef((t,e)=>{const n=ue.c(12);let r,o,i,a,s,l;return n[0]!==t?({className:o,children:r,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==o?(a=we(UB(),"group",o),n[4]=o,n[5]=a):a=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsx(oOe,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"}),n[6]=s):s=n[6],n[7]!==r||n[8]!==i||n[9]!==e||n[10]!==a?(l=y.jsxs(URe,{ref:e,className:a,...i,children:[r," ",s]}),n[7]=r,n[8]=i,n[9]=e,n[10]=a,n[11]=l):l=n[11],l});GRe.displayName=URe.displayName;const KRe=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(XRe,{ref:e,className:i,...o}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});KRe.displayName=XRe.displayName;const ZB=fut,JRe=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]===Symbol.for("react.memo_cache_sentinel")?(i=we("absolute left-0 top-full flex justify-center"),n[3]=i):i=n[3],n[4]!==r?(a=we("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",r),n[4]=r,n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==a?(s=y.jsx("div",{className:i,children:y.jsx(HRe,{className:a,ref:e,...o})}),n[6]=o,n[7]=e,n[8]=a,n[9]=s):s=n[9],s});JRe.displayName=HRe.displayName;const put=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",r),n[3]=r,n[4]=i):i=n[4],n[5]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"}),n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==i?(s=y.jsx(ZRe,{ref:e,className:i,...o,children:a}),n[6]=o,n[7]=e,n[8]=i,n[9]=s):s=n[9],s});put.displayName=ZRe.displayName;const mut=t=>{const e=ue.c(13),{items:n,orientation:r}=t,o=gut,i=vut;let a;e[0]!==r?(a=d=>"items"in d?r==="horizontal"?y.jsxs(WB,{children:[y.jsx(GRe,{children:Br({html:d.label})}),y.jsx(KRe,{children:y.jsx(G5,{children:y.jsx("ul",{className:"grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px] ",children:d.items.map(f=>y.jsx(e3e,{label:f.label,href:f.href,target:i(f.href),children:f.description&&Br({html:f.description})},f.label))})})})]},d.label):y.jsxs(WB,{children:[y.jsx("div",{className:"inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-base font-medium text-muted-foreground/80 tracking-wide font-semibold",children:Br({html:d.label})}),y.jsx(G5,{className:"ml-4 auto-collapse-nav",orientation:r,children:d.items.map(f=>y.jsx(ge.Fragment,{children:o(y.jsx(ZB,{href:f.href,target:i(f.href),className:UB({orientation:r}),children:Br({html:f.label})},f.label),f.description)},f.label))})]},d.label):y.jsx(WB,{children:y.jsx(ZB,{href:d.href,target:i(d.href),className:UB({orientation:r}),children:Br({html:d.label})})},d.label),e[0]=r,e[1]=a):a=e[1];const s=a;let l,c,u;if(e[2]!==n||e[3]!==s){let d;e[5]!==s?(d=f=>s(f),e[5]=s,e[6]=d):d=e[6],l=n.map(d),e[2]=n,e[3]=s,e[4]=l}else l=e[4];return e[7]!==r||e[8]!==l?(c=y.jsx(G5,{className:"auto-collapse-nav",orientation:r,children:l}),e[7]=r,e[8]=l,e[9]=c):c=e[9],e[10]!==r||e[11]!==c?(u=y.jsx(YRe,{orientation:r,children:c}),e[10]=r,e[11]=c,e[12]=u):u=e[12],u},e3e=ge.forwardRef((t,e)=>{const n=ue.c(19);let r,o,i,a,s,l,c,u,d;return n[0]!==t?({className:o,label:i,children:r,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==o?(s=we("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",o),n[5]=o,n[6]=s):s=n[6],n[7]!==i?(l=Br({html:i}),n[7]=i,n[8]=l):l=n[8],n[9]!==l?(c=y.jsx("div",{className:"text-base font-medium leading-none",children:l}),n[9]=l,n[10]=c):c=n[10],n[11]!==r?(u=r&&y.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:r}),n[11]=r,n[12]=u):u=n[12],n[13]!==a||n[14]!==e||n[15]!==s||n[16]!==c||n[17]!==u?(d=y.jsx("li",{children:y.jsx(ZB,{asChild:!0,children:y.jsxs("a",{ref:e,className:s,...a,children:[c,u]})})}),n[13]=a,n[14]=e,n[15]=s,n[16]=c,n[17]=u,n[18]=d):d=n[18],d});function gut(t,e){return e?y.jsx(qn,{delayDuration:200,content:Br({html:e}),children:t}):t}function vut(t){return t.startsWith("http")?"_blank":"_self"}e3e.displayName="ListItem",uG=new _M("function-call-result",async(t,e)=>{await USe({functionCallId:t,...e})});function yut(t,e){return t===e||t!=null&&e!=null&&(Array.isArray(t)&&Array.isArray(e)?$K(t,e):typeof t=="object"&&typeof e=="object"&&function(n,r){return Object.keys(n).length===Object.keys(r).length&&cr.keys(n).every(o=>n[o]===r[o])}(t,e))}function XB(t,e){window!=null&&window.customElements?window.customElements.get(t)?Ve.warn(`Custom element ${t} already defined`):window.customElements.define(t,e):Ve.warn("Custom elements not supported")}const but=t=>{const e=ue.c(16),{error:n,badData:r,shadowRoot:o}=t;if(n instanceof Nu){let a,s,l,c,u,d,f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(Lv,{children:"Bad Data"}),e[0]=a):a=e[0],e[1]!==n.issues?(s=n.issues.map(xut),e[1]=n.issues,e[2]=s):s=e[2],e[3]!==s?(l=y.jsx("div",{className:"text-md prose dark:prose-invert",children:y.jsx("ul",{children:s})}),e[3]=s,e[4]=l):l=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(WL,{className:"py-2 text-[0.84375rem]",children:"View Data:"}),e[5]=c):c=e[5],e[6]!==r?(u=y.jsx(_k,{data:r}),e[6]=r,e[7]=u):u=e[7],e[8]!==o||e[9]!==u?(d=y.jsx(VL,{type:"single",collapsible:!0,children:y.jsxs(FL,{value:"item-1",className:"text-muted-foreground border-muted-foreground-20",children:[c,y.jsx(UL,{className:"text-[0.84375rem]",children:y.jsx(G3,{container:o,children:u})})]})}),e[8]=o,e[9]=u,e[10]=d):d=e[10],e[11]!==l||e[12]!==d?(f=y.jsxs(Qv,{variant:"destructive",children:[a,l,d]}),e[11]=l,e[12]=d,e[13]=f):f=e[13],f}let i;return e[14]!==n.message?(i=y.jsx("div",{children:n.message}),e[14]=n.message,e[15]=i):i=e[15],i};function xut(t){const e=t.path.join(".");return y.jsxs("li",{children:[y.jsx("span",{className:"font-bold",children:e}),": ",t.message]},e)}const Out=ge.forwardRef(function({hostElement:t,plugin:e,children:n,getInitialValue:r},o){const[i,a]=_.useState(n),[s,l]=_.useState(r()),{theme:c}=as(),[u,d]=_.useState(()=>e.validator.safeParse(B$(t)));_.useImperativeHandle(o,()=>({reset:()=>{l(r()),d(e.validator.safeParse(B$(t)))},setChildren:g=>{a(g)}})),Wh(t,y6.TYPE,g=>{g.detail.element===t&&l(g.detail.value)}),_.useEffect(()=>{const g=new MutationObserver(v=>{v.some(b=>{var p;return b.type==="attributes"&&((p=b.attributeName)==null?void 0:p.startsWith("data-"))})&&d(e.validator.safeParse(B$(t)))});return g.observe(t,{attributes:!0}),()=>{g.disconnect()}},[t,e.validator]);const f=Fn(g=>{l(v=>{const b=Zi.asUpdater(g)(v);return yut(b,v)||t.dispatchEvent(Jle(b,t)),b})}),h=_.useMemo(()=>{if(!e.functions)return{};const g={};for(const[v,b]of cr.entries(e.functions)){const{input:p,output:O}=b;g[v]=async(...k)=>{Rn(k.length<=1,`Plugin functions only supports a single argument. Called ${v}`);const S=YB(t);Rn(S,"Object ID should exist");const w=await uG.request({args:i3e(p,k[0]),functionName:v,namespace:S});if(w.status.code!=="ok")throw Ve.error(w.status),new Error(w.status.message||"Unknown error");return i3e(O,w.return_value)}}return g},[e.functions,t]);return u.success?y.jsx(lf,{children:y.jsx("div",{className:`contents ${c}`,children:y.jsx(_.Suspense,{fallback:y.jsx("div",{}),children:e.render({setValue:f,value:s,data:u.data,children:i,host:t,functions:h})})})}):function(g,v,b){return y.jsx(but,{error:g,badData:v,shadowRoot:b})}(u.error,cr.mapValues(t.dataset,g=>typeof g=="string"?cP(g):g),t.shadowRoot)}),HB=new Map,t3e="__custom_marimo_element__";function n3e(t){const e=class extends HTMLElement{constructor(){super(),this.observer=void 0,this.root=void 0,this.mounted=!1,this.pluginRef=_.createRef(),this.__type__=t3e,this.attachShadow({mode:"open"}),this.copyStyles(),this.observer=new MutationObserver(()=>{var n;(n=this.pluginRef.current)==null||n.setChildren(this.getChildren())})}connectedCallback(){this.mounted||(Rn(this.shadowRoot,"Shadow root should exist"),this.root&&this.root.unmount(),this.root=a7e.createRoot(this.shadowRoot),this.mountReactComponent()),this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}disconnectedCallback(){var n;this.observer.disconnect(),(n=this.root)==null||n.unmount(),this.mounted&&(this.mounted=!1)}reset(){this.dispatchEvent(Jle(cP(this.dataset.initialValue),this)),this.rerender()}rerender(){var n;(n=this.pluginRef.current)==null||n.reset()}getChildren(){return Br({html:this.innerHTML})}async mountReactComponent(){this.mounted=!0,Rn(this.root,"Root must be defined"),this.root.render(y.jsx(Out,{hostElement:this,plugin:t,ref:this.pluginRef,getInitialValue:()=>Dne(this,zE.INSTANCE),children:this.getChildren()}))}async copyStyles(){const n=this.shadowRoot;if(Rn(n,"Shadow root should exist"),!this.isAdoptedStyleSheetsSupported())return Ve.warn("adoptedStyleSheets not supported, copying stylesheets in a less performance way. Please consider upgrading your browser."),void this.copyStylesFallback();const r=Array.from(document.styleSheets).filter(o=>!!(o.ownerNode instanceof HTMLElement&&o.ownerNode.dataset.viteDevId)||r3e(o));for(const o of r){const i=o.href??(o.ownerNode instanceof HTMLElement?o.ownerNode.dataset.viteDevId:void 0)??o.title;if(i&&!HB.has(i)){const a=new CSSStyleSheet;try{a.replaceSync(Array.from(o.cssRules).map(s=>s.cssText.includes("@import")?"":s.cssText).join(`
|
446
446
|
`))}catch{}HB.set(i,a)}}if(n.adoptedStyleSheets=[...HB.values()],t.cssStyles){const o=new CSSStyleSheet;o.replaceSync(t.cssStyles.join(`
|
447
447
|
`)),n.adoptedStyleSheets=[...n.adoptedStyleSheets,o]}}copyStylesFallback(){const n=this.shadowRoot;Rn(n,"Shadow root should exist"),Ve.warn("adoptedStyleSheets not supported, copying stylesheets in a less performance way. Please consider upgrading your browser.");const r=Array.from(document.styleSheets).flatMap(o=>{if(!r3e(o))return[];const i=document.createElement("style");try{i.textContent=Array.from(o.cssRules).map(a=>a.cssText).join(`
|
448
448
|
`)}catch{return[]}return[i]});if(n.append(...r),t.cssStyles){const o=document.createElement("style");o.textContent=t.cssStyles.join(`
|
@@ -452,7 +452,7 @@ Error message: ${b3e(e)}`,cause:e}),this[k3e]=!0,this.text=t}static isInstance(t
|
|
452
452
|
Error message: ${b3e(n)}`,cause:n}),this[T3e]=!0,this.value=e}static isInstance(e){return Bb.hasMarker(e,E3e)}static wrap({value:e,cause:n}){return bee.isInstance(n)&&n.value===e?n:new bee({value:e,cause:n})}},j3e,G0={exports:{}},Qut=function(){if(j3e)return G0.exports;j3e=1;const t=typeof Buffer<"u",e=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,n=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function r(a,s,l){l==null&&s!==null&&typeof s=="object"&&(l=s,s=void 0),t&&Buffer.isBuffer(a)&&(a=a.toString()),a&&a.charCodeAt(0)===65279&&(a=a.slice(1));const c=JSON.parse(a,s);if(c===null||typeof c!="object")return c;const u=l&&l.protoAction||"error",d=l&&l.constructorAction||"error";if(u==="ignore"&&d==="ignore")return c;if(u!=="ignore"&&d!=="ignore"){if(e.test(a)===!1&&n.test(a)===!1)return c}else if(u!=="ignore"&&d==="ignore"){if(e.test(a)===!1)return c}else if(n.test(a)===!1)return c;return o(c,{protoAction:u,constructorAction:d,safe:l&&l.safe})}function o(a,{protoAction:s="error",constructorAction:l="error",safe:c}={}){let u=[a];for(;u.length;){const d=u;u=[];for(const f of d){if(s!=="ignore"&&Object.prototype.hasOwnProperty.call(f,"__proto__")){if(c===!0)return null;if(s==="error")throw new SyntaxError("Object contains forbidden prototype property");delete f.__proto__}if(l!=="ignore"&&Object.prototype.hasOwnProperty.call(f,"constructor")&&Object.prototype.hasOwnProperty.call(f.constructor,"prototype")){if(c===!0)return null;if(l==="error")throw new SyntaxError("Object contains forbidden prototype property");delete f.constructor}for(const h in f){const g=f[h];g&&typeof g=="object"&&u.push(g)}}}return a}function i(a,s,l){const c=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return r(a,s,l)}finally{Error.stackTraceLimit=c}}return G0.exports=i,G0.exports.default=i,G0.exports.parse=i,G0.exports.safeParse=function(a,s){const l=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return r(a,s,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=l}},G0.exports.scan=o,G0.exports}();const Lut=el(Qut);var JB=(({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const o=((i,a=21)=>(s=a)=>{let l="",c=0|s;for(;c--;)l+=i[Math.random()*i.length|0];return l})(n,e);if(t==null)return o;if(n.includes(r))throw new Nut({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return i=>`${t}${r}${o(i)}`})(),eW=Symbol.for("vercel.ai.validator");function zut(t){return function(n){return typeof n=="object"&&n!==null&&eW in n&&n[eW]===!0&&"validate"in n}(t)?t:(e=t,function(n){return{[eW]:!0,validate:n}}(n=>{const r=e.safeParse(n);return r.success?{success:!0,value:r.data}:{success:!1,error:r.error}}));var e}function D3e({text:t,schema:e}){try{const n=Lut.parse(t);if(e==null)return{success:!0,value:n,rawValue:n};const r=function({value:o,schema:i}){const a=zut(i);try{if(a.validate==null)return{success:!0,value:o};const s=a.validate(o);return s.success?s:{success:!1,error:R3e.wrap({value:o,cause:s.error})}}catch(s){return{success:!1,error:R3e.wrap({value:o,cause:s})}}}({value:n,schema:e});return r.success?{...r,rawValue:n}:r}catch(n){return{success:!1,error:_3e.isInstance(n)?n:new _3e({text:t,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Vut={code:"0",name:"text",parse:t=>{if(typeof t!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:t}}},qut={code:"3",name:"error",parse:t=>{if(typeof t!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:t}}},Fut={code:"4",name:"assistant_message",parse:t=>{if(!(t!=null&&typeof t=="object"&&"id"in t&&"role"in t&&"content"in t&&typeof t.id=="string"&&typeof t.role=="string"&&t.role==="assistant"&&Array.isArray(t.content)&&t.content.every(e=>e!=null&&typeof e=="object"&&"type"in e&&e.type==="text"&&"text"in e&&e.text!=null&&typeof e.text=="object"&&"value"in e.text&&typeof e.text.value=="string")))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:t}}},But={code:"5",name:"assistant_control_data",parse:t=>{if(t==null||typeof t!="object"||!("threadId"in t)||!("messageId"in t)||typeof t.threadId!="string"||typeof t.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:t.threadId,messageId:t.messageId}}}},Wut={code:"6",name:"data_message",parse:t=>{if(t==null||typeof t!="object"||!("role"in t)||!("data"in t)||typeof t.role!="string"||t.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:t}}};function Uut(t){const e=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':n=c,e.pop(),e.push(u),e.push("INSIDE_STRING");break;case"f":case"t":case"n":n=c,r=c,e.pop(),e.push(u),e.push("INSIDE_LITERAL");break;case"-":e.pop(),e.push(u),e.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=c,e.pop(),e.push(u),e.push("INSIDE_NUMBER");break;case"{":n=c,e.pop(),e.push(u),e.push("INSIDE_OBJECT_START");break;case"[":n=c,e.pop(),e.push(u),e.push("INSIDE_ARRAY_START")}}function i(l,c){switch(l){case",":e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=c,e.pop()}}function a(l,c){switch(l){case",":e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=c,e.pop()}}for(let l=0;l<t.length;l++){const c=t[l];switch(e[e.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":switch(c){case'"':e.pop(),e.push("INSIDE_OBJECT_KEY");break;case"}":n=l,e.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":c==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":c==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":c===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":i(c,l);break;case"INSIDE_STRING":switch(c){case'"':e.pop(),n=l;break;case"\\":e.push("INSIDE_STRING_ESCAPE");break;default:n=l}break;case"INSIDE_ARRAY_START":c==="]"?(n=l,e.pop()):(n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(c){case",":e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=l,e.pop();break;default:n=l}break;case"INSIDE_ARRAY_AFTER_COMMA":o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":e.pop(),n=l;break;case"INSIDE_NUMBER":switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=l;break;case"e":case"E":case"-":case".":break;case",":e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break;case"}":e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break;case"]":e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l);break;default:e.pop()}break;case"INSIDE_LITERAL":{const u=t.substring(r,l+1);"false".startsWith(u)||"true".startsWith(u)||"null".startsWith(u)?n=l:(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l));break}}}let s=t.slice(0,n+1);for(let l=e.length-1;l>=0;l--)switch(e[l]){case"INSIDE_STRING":s+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":s+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":s+="]";break;case"INSIDE_LITERAL":{const c=t.substring(r,t.length);"true".startsWith(c)?s+="true".slice(c.length):"false".startsWith(c)?s+="false".slice(c.length):"null".startsWith(c)&&(s+="null".slice(c.length))}}return s}[Vut,qut,Fut,But,Wut].map(t=>t.code);var tW=[{code:"0",name:"text",parse:t=>{if(typeof t!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:t}}},{code:"2",name:"data",parse:t=>{if(!Array.isArray(t))throw new Error('"data" parts expect an array value.');return{type:"data",value:t}}},{code:"3",name:"error",parse:t=>{if(typeof t!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:t}}},{code:"8",name:"message_annotations",parse:t=>{if(!Array.isArray(t))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:t}}},{code:"9",name:"tool_call",parse:t=>{if(t==null||typeof t!="object"||!("toolCallId"in t)||typeof t.toolCallId!="string"||!("toolName"in t)||typeof t.toolName!="string"||!("args"in t)||typeof t.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:t}}},{code:"a",name:"tool_result",parse:t=>{if(t==null||typeof t!="object"||!("toolCallId"in t)||typeof t.toolCallId!="string"||!("result"in t))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:t}}},{code:"b",name:"tool_call_streaming_start",parse:t=>{if(t==null||typeof t!="object"||!("toolCallId"in t)||typeof t.toolCallId!="string"||!("toolName"in t)||typeof t.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:t}}},{code:"c",name:"tool_call_delta",parse:t=>{if(t==null||typeof t!="object"||!("toolCallId"in t)||typeof t.toolCallId!="string"||!("argsTextDelta"in t)||typeof t.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:t}}},{code:"d",name:"finish_message",parse:t=>{if(t==null||typeof t!="object"||!("finishReason"in t)||typeof t.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const e={finishReason:t.finishReason};return"usage"in t&&t.usage!=null&&typeof t.usage=="object"&&"promptTokens"in t.usage&&"completionTokens"in t.usage&&(e.usage={promptTokens:typeof t.usage.promptTokens=="number"?t.usage.promptTokens:Number.NaN,completionTokens:typeof t.usage.completionTokens=="number"?t.usage.completionTokens:Number.NaN}),{type:"finish_message",value:e}}},{code:"e",name:"finish_step",parse:t=>{if(t==null||typeof t!="object"||!("finishReason"in t)||typeof t.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const e={finishReason:t.finishReason,isContinued:!1};return"usage"in t&&t.usage!=null&&typeof t.usage=="object"&&"promptTokens"in t.usage&&"completionTokens"in t.usage&&(e.usage={promptTokens:typeof t.usage.promptTokens=="number"?t.usage.promptTokens:Number.NaN,completionTokens:typeof t.usage.completionTokens=="number"?t.usage.completionTokens:Number.NaN}),"isContinued"in t&&typeof t.isContinued=="boolean"&&(e.isContinued=t.isContinued),{type:"finish_step",value:e}}},{code:"f",name:"start_step",parse:t=>{if(t==null||typeof t!="object"||!("messageId"in t)||typeof t.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:t.messageId}}}},{code:"g",name:"reasoning",parse:t=>{if(typeof t!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:t}}},{code:"h",name:"source",parse:t=>{if(t==null||typeof t!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:t}}},{code:"i",name:"redacted_reasoning",parse:t=>{if(t==null||typeof t!="object"||!("data"in t)||typeof t.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:t.data}}}},{code:"j",name:"reasoning_signature",parse:t=>{if(t==null||typeof t!="object"||!("signature"in t)||typeof t.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:t.signature}}}},{code:"k",name:"file",parse:t=>{if(t==null||typeof t!="object"||!("data"in t)||typeof t.data!="string"||!("mimeType"in t)||typeof t.mimeType!="string")throw new Error('"file" parts expect an object with a "data" and "mimeType" property.');return{type:"file",value:t}}}],Zut=Object.fromEntries(tW.map(t=>[t.code,t]));Object.fromEntries(tW.map(t=>[t.name,t.code]));var Xut=tW.map(t=>t.code),Hut=t=>{const e=t.indexOf(":");if(e===-1)throw new Error("Failed to parse stream string. No separator found.");const n=t.slice(0,e);if(!Xut.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=t.slice(e+1),i=JSON.parse(o);return Zut[r].parse(i)},Yut=10;function Gut(t,e){const n=new Uint8Array(e);let r=0;for(const o of t)n.set(o,r),r+=o.length;return t.length=0,n}async function A3e({stream:t,onTextPart:e,onReasoningPart:n,onReasoningSignaturePart:r,onRedactedReasoningPart:o,onSourcePart:i,onFilePart:a,onDataPart:s,onErrorPart:l,onToolCallStreamingStartPart:c,onToolCallDeltaPart:u,onToolCallPart:d,onToolResultPart:f,onMessageAnnotationsPart:h,onFinishMessagePart:g,onFinishStepPart:v,onStartStepPart:b}){const p=t.getReader(),O=new TextDecoder,k=[];let S=0;for(;;){const{value:w}=await p.read();if(w&&(k.push(w),S+=w.length,w[w.length-1]!==Yut))continue;if(k.length===0)break;const T=Gut(k,S);S=0;const P=O.decode(T,{stream:!0}).split(`
|
453
453
|
`).filter(j=>j!=="").map(Hut);for(const{type:j,value:D}of P)switch(j){case"text":await(e==null?void 0:e(D));break;case"reasoning":await(n==null?void 0:n(D));break;case"reasoning_signature":await(r==null?void 0:r(D));break;case"redacted_reasoning":await(o==null?void 0:o(D));break;case"file":await(a==null?void 0:a(D));break;case"source":await(i==null?void 0:i(D));break;case"data":await(s==null?void 0:s(D));break;case"error":await(l==null?void 0:l(D));break;case"message_annotations":await(h==null?void 0:h(D));break;case"tool_call_streaming_start":await(c==null?void 0:c(D));break;case"tool_call_delta":await(u==null?void 0:u(D));break;case"tool_call":await(d==null?void 0:d(D));break;case"tool_result":await(f==null?void 0:f(D));break;case"finish_message":await(g==null?void 0:g(D));break;case"finish_step":await(v==null?void 0:v(D));break;case"start_step":await(b==null?void 0:b(D));break;default:throw new Error(`Unknown stream part type: ${j}`)}}}async function Kut({stream:t,update:e,onToolCall:n,onFinish:r,generateId:o=JB,getCurrentDate:i=()=>new Date,lastMessage:a}){var s,l;const c=(a==null?void 0:a.role)==="assistant";let u=c?1+((l=(s=a.toolInvocations)==null?void 0:s.reduce((T,P)=>{var j;return Math.max(T,(j=P.step)!=null?j:0)},0))!=null?l:0):0;const d=c?structuredClone(a):{id:o(),createdAt:i(),role:"assistant",content:"",parts:[]};let f,h,g;function v(T,P){const j=d.parts.find(D=>D.type==="tool-invocation"&&D.toolInvocation.toolCallId===T);j!=null?j.toolInvocation=P:d.parts.push({type:"tool-invocation",toolInvocation:P})}const b=[];let p=c?a==null?void 0:a.annotations:void 0;const O={};let k={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},S="unknown";function w(){const T=[...b];p!=null&&p.length&&(d.annotations=p);const P={...structuredClone(d),revisionId:o()};e({message:P,data:T,replaceLastMessage:c})}await A3e({stream:t,onTextPart(T){f==null?(f={type:"text",text:T},d.parts.push(f)):f.text+=T,d.content+=T,w()},onReasoningPart(T){var P;g==null?(g={type:"text",text:T},h!=null&&h.details.push(g)):g.text+=T,h==null?(h={type:"reasoning",reasoning:T,details:[g]},d.parts.push(h)):h.reasoning+=T,d.reasoning=((P=d.reasoning)!=null?P:"")+T,w()},onReasoningSignaturePart(T){g!=null&&(g.signature=T.signature)},onRedactedReasoningPart(T){h==null&&(h={type:"reasoning",reasoning:"",details:[]},d.parts.push(h)),h.details.push({type:"redacted",data:T.data}),g=void 0,w()},onFilePart(T){d.parts.push({type:"file",mimeType:T.mimeType,data:T.data}),w()},onSourcePart(T){d.parts.push({type:"source",source:T}),w()},onToolCallStreamingStartPart(T){d.toolInvocations==null&&(d.toolInvocations=[]),O[T.toolCallId]={text:"",step:u,toolName:T.toolName,index:d.toolInvocations.length};const P={state:"partial-call",step:u,toolCallId:T.toolCallId,toolName:T.toolName,args:void 0};d.toolInvocations.push(P),v(T.toolCallId,P),w()},onToolCallDeltaPart(T){const P=O[T.toolCallId];P.text+=T.argsTextDelta;const{value:j}=function(N){if(N===void 0)return{value:void 0,state:"undefined-input"};let E=D3e({text:N});return E.success?{value:E.value,state:"successful-parse"}:(E=D3e({text:Uut(N)}),E.success?{value:E.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}(P.text),D={state:"partial-call",step:P.step,toolCallId:T.toolCallId,toolName:P.toolName,args:j};d.toolInvocations[P.index]=D,v(T.toolCallId,D),w()},async onToolCallPart(T){const P={state:"call",step:u,...T};if(O[T.toolCallId]!=null?d.toolInvocations[O[T.toolCallId].index]=P:(d.toolInvocations==null&&(d.toolInvocations=[]),d.toolInvocations.push(P)),v(T.toolCallId,P),w(),n){const j=await n({toolCall:T});if(j!=null){const D={state:"result",step:u,...T,result:j};d.toolInvocations[d.toolInvocations.length-1]=D,v(T.toolCallId,D),w()}}},onToolResultPart(T){const P=d.toolInvocations;if(P==null)throw new Error("tool_result must be preceded by a tool_call");const j=P.findIndex(N=>N.toolCallId===T.toolCallId);if(j===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");const D={...P[j],state:"result",...T};P[j]=D,v(T.toolCallId,D),w()},onDataPart(T){b.push(...T),w()},onMessageAnnotationsPart(T){p==null?p=[...T]:p.push(...T),w()},onFinishStepPart(T){u+=1,f=T.isContinued?f:void 0,h=void 0,g=void 0},onStartStepPart(T){c||(d.id=T.messageId),d.parts.push({type:"step-start"}),w()},onFinishMessagePart(T){S=T.finishReason,T.usage!=null&&(k=function({promptTokens:P,completionTokens:j}){return{promptTokens:P,completionTokens:j,totalTokens:P+j}}(T.usage))},onErrorPart(T){throw new Error(T)}}),r==null||r({message:d,finishReason:S,usage:k})}async function M3e({stream:t,onTextPart:e}){const n=t.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:r,value:o}=await n.read();if(r)break;await e(o)}}var Jut=()=>fetch;async function edt({api:t,body:e,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:a,onResponse:s,onUpdate:l,onFinish:c,onToolCall:u,generateId:d,fetch:f=Jut(),lastMessage:h,requestType:g="generate"}){var v,b,p;const O=g==="resume"?f(`${t}?chatId=${e.id}`,{method:"GET",headers:{"Content-Type":"application/json",...o},signal:(v=i==null?void 0:i())==null?void 0:v.signal,credentials:r}):f(t,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",...o},signal:(b=i==null?void 0:i())==null?void 0:b.signal,credentials:r}),k=await O.catch(S=>{throw a(),S});if(s)try{await s(k)}catch(S){throw S}if(!k.ok)throw a(),new Error((p=await k.text())!=null?p:"Failed to fetch the chat response.");if(!k.body)throw new Error("The response body is empty.");switch(n){case"text":return void await async function({stream:S,update:w,onFinish:T,getCurrentDate:P=()=>new Date,generateId:j=JB}){const D={type:"text",text:""},N={id:j(),createdAt:P(),role:"assistant",content:"",parts:[D]};await M3e({stream:S,onTextPart:E=>{N.content+=E,D.text+=E,w({message:{...N},data:[],replaceLastMessage:!1})}}),T==null||T(N,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"})}({stream:k.body,update:l,onFinish:c,generateId:d});case"data":return void await Kut({stream:k.body,update:l,lastMessage:h,onToolCall:u,onFinish({message:S,finishReason:w,usage:T}){c&&S!=null&&c(S,{usage:T,finishReason:w})},generateId:d});default:throw new Error(`Unknown stream protocol: ${n}`)}}var tdt=()=>fetch;function nW(t){return t==null?void 0:t.reduce((e,n)=>{var r;return Math.max(e,(r=n.step)!=null?r:0)},0)}function N3e(t){var e;return(e=t.parts)!=null?e:[...t.toolInvocations?t.toolInvocations.map(n=>({type:"tool-invocation",toolInvocation:n})):[],...t.reasoning?[{type:"reasoning",reasoning:t.reasoning,details:[{type:"text",text:t.reasoning}]}]:[],...t.content?[{type:"text",text:t.content}]:[]]}function rW(t){return t.map(e=>({...e,parts:N3e(e)}))}function oW(t,e){if(t===e)return!0;if(t==null||e==null)return!1;if(typeof t!="object"&&typeof e!="object")return t===e;if(t.constructor!==e.constructor)return!1;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(!oW(t[o],e[o]))return!1;return!0}const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o)||!oW(t[o],e[o]))return!1;return!0}async function $3e(t){if(!t)return[];if(globalThis.FileList&&t instanceof globalThis.FileList)return Promise.all(Array.from(t).map(async e=>{const{name:n,type:r}=e,o=await new Promise((i,a)=>{const s=new FileReader;s.onload=l=>{var c;i((c=l.target)==null?void 0:c.result)},s.onerror=l=>a(l),s.readAsDataURL(e)});return{name:n,contentType:r,url:o}}));if(Array.isArray(t))return t;throw new Error("Invalid attachments type")}function I3e(t){if(t.role!=="assistant")return!1;const e=t.parts.reduce((r,o,i)=>o.type==="step-start"?i:r,-1),n=t.parts.slice(e+1).filter(r=>r.type==="tool-invocation");return n.length>0&&n.every(r=>"result"in r.toolInvocation)}var Q3e=Object.prototype.hasOwnProperty;const bh=new WeakMap,gm=()=>{},Ja=gm(),iW=Object,hr=t=>t===Ja,Ed=t=>typeof t=="function",vm=(t,e)=>({...t,...e}),L3e=t=>Ed(t.then),aW={},J5={},sW="undefined",iC=typeof window!=sW,lW=typeof document!=sW,ndt=iC&&"Deno"in window,z3e=(t,e)=>{const n=bh.get(t);return[()=>!hr(e)&&t.get(e)||aW,r=>{if(!hr(e)){const o=t.get(e);e in J5||(J5[e]=o),n[5](e,vm(o,r),o||aW)}},n[6],()=>!hr(e)&&e in J5?J5[e]:!hr(e)&&t.get(e)||aW]};let cW=!0;const[uW,dW]=iC&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[gm,gm],rdt={isOnline:()=>cW,isVisible:()=>{const t=lW&&document.visibilityState;return hr(t)||t!=="hidden"}},odt={initFocus:t=>(lW&&document.addEventListener("visibilitychange",t),uW("focus",t),()=>{lW&&document.removeEventListener("visibilitychange",t),dW("focus",t)}),initReconnect:t=>{const e=()=>{cW=!0,t()},n=()=>{cW=!1};return uW("online",e),uW("offline",n),()=>{dW("online",e),dW("offline",n)}}},V3e=!ge.useId,aC=!iC||ndt,idt=t=>iC&&typeof window.requestAnimationFrame!=sW?window.requestAnimationFrame(t):setTimeout(t,1),fW=aC?_.useEffect:_.useLayoutEffect,hW=typeof navigator<"u"&&navigator.connection,q3e=!aC&&hW&&(["slow-2g","2g"].includes(hW.effectiveType)||hW.saveData),e4=new WeakMap,pW=(t,e)=>t===`[object ${e}]`;let adt=0;const mW=t=>{const e=typeof t,n=(r=t,iW.prototype.toString.call(r));var r;const o=pW(n,"Date"),i=pW(n,"RegExp"),a=pW(n,"Object");let s,l;if(iW(t)!==t||o||i)s=o?t.toJSON():e=="symbol"?t.toString():e=="string"?JSON.stringify(t):""+t;else{if(s=e4.get(t),s)return s;if(s=++adt+"~",e4.set(t,s),Array.isArray(t)){for(s="@",l=0;l<t.length;l++)s+=mW(t[l])+",";e4.set(t,s)}if(a){s="#";const c=iW.keys(t).sort();for(;!hr(l=c.pop());)hr(t[l])||(s+=l+":"+mW(t[l])+",");e4.set(t,s)}}return s},gW=t=>{if(Ed(t))try{t=t()}catch{t=""}const e=t;return[t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?mW(t):"",e]};let sdt=0;const vW=()=>++sdt;async function F3e(...t){const[e,n,r,o]=t,i=vm({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const c=i.throwOnError;if(Ed(n)){const d=n,f=[],h=e.keys();for(const g of h)!/^\$(inf|sub)\$/.test(g)&&d(e.get(g)._k)&&f.push(g);return Promise.all(f.map(u))}return u(n);async function u(d){const[f]=gW(d);if(!f)return;const[h,g]=z3e(e,f),[v,b,p,O]=bh.get(e),k=()=>{const I=v[f];return(Ed(i.revalidate)?i.revalidate(h().data,d):i.revalidate!==!1)&&(delete p[f],delete O[f],I&&I[0])?I[0](2).then(()=>h().data):h().data};if(t.length<3)return k();let S,w=r,T=!1;const P=vW();b[f]=[P,0];const j=!hr(l),D=h(),N=D.data,E=D._c,A=hr(E)?N:E;if(j&&(l=Ed(l)?l(A,N):l,g({data:l,_c:A})),Ed(w))try{w=w(A)}catch(I){S=I,T=!0}if(w&&L3e(w)){if(w=await w.catch(I=>{S=I,T=!0}),P!==b[f][0]){if(T)throw S;return w}T&&j&&(I=>typeof s=="function"?s(I):s!==!1)(S)&&(a=!0,g({data:A,_c:Ja}))}if(a&&!T)if(Ed(a)){const I=a(w,A);g({data:I,error:Ja,_c:Ja})}else g({data:w,error:Ja,_c:Ja});if(b[f][1]=vW(),Promise.resolve(k()).then(()=>{g({_c:Ja})}),!T)return w;if(c)throw S}}const B3e=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},ldt=function t(e,n){var r,o;if(e===n)return!0;if(e&&n&&(r=e.constructor)===n.constructor){if(r===Date)return e.getTime()===n.getTime();if(r===RegExp)return e.toString()===n.toString();if(r===Array){if((o=e.length)===n.length)for(;o--&&t(e[o],n[o]););return o===-1}if(!r||typeof e=="object"){for(r in o=0,e)if(Q3e.call(e,r)&&++o&&!Q3e.call(n,r)||!(r in n)||!t(e[r],n[r]))return!1;return Object.keys(n).length===o}}return e!=e&&n!=n},[W3e,cdt]=((t,e)=>{if(!bh.has(t)){const n=vm(odt,e),r=Object.create(null),o=F3e.bind(Ja,t);let i=gm;const a=Object.create(null),s=(u,d)=>{const f=a[u]||[];return a[u]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},l=(u,d,f)=>{t.set(u,d);const h=a[u];if(h)for(const g of h)g(d,f)},c=()=>{if(!bh.has(t)&&(bh.set(t,[r,Object.create(null),Object.create(null),Object.create(null),o,l,s]),!aC)){const u=n.initFocus(setTimeout.bind(Ja,B3e.bind(Ja,r,0))),d=n.initReconnect(setTimeout.bind(Ja,B3e.bind(Ja,r,1)));i=()=>{u&&u(),d&&d(),bh.delete(t)}}};return c(),[t,o,c,i]}return[t,bh.get(t)[4]]})(new Map),udt=vm({onLoadingSlow:gm,onSuccess:gm,onError:gm,onErrorRetry:(t,e,n,r,o)=>{const i=n.errorRetryCount,a=o.retryCount,s=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!hr(i)&&a>i||setTimeout(r,s,o)},onDiscarded:gm,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:q3e?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:q3e?5e3:3e3,compare:ldt,isPaused:()=>!1,cache:W3e,mutate:cdt,fallback:{}},rdt),ddt=_.createContext({}),U3e=iC&&window.__SWR_DEVTOOLS_USE__,fdt=U3e?window.__SWR_DEVTOOLS_USE__:[],hdt=fdt.concat(t=>(e,n,r)=>t(e,n&&((...i)=>{const[a]=gW(e),[,,,s]=bh.get(W3e);if(a.startsWith("$inf$"))return n(...i);const l=s[a];return hr(l)?n(...i):(delete s[a],l)}),r));U3e&&(window.__SWR_DEVTOOLS_REACT__=ge);const yW=ge.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),bW={dedupe:!0},K0=(Z3e=(t,e,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:a,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:f}=n,[h,g,v,b]=bh.get(r),[p,O]=gW(t),k=_.useRef(!1),S=_.useRef(!1),w=_.useRef(p),T=_.useRef(e),P=_.useRef(n),j=()=>P.current,D=()=>j().isVisible()&&j().isOnline(),[N,E,A,I]=z3e(r,p),L=_.useRef({}).current,F=hr(a)?hr(n.fallback)?Ja:n.fallback[p]:a,Q=(ve,ye)=>{for(const _e in L){const Se=_e;if(Se==="data"){if(!o(ve[Se],ye[Se])&&(!hr(ve[Se])||!o(K,ye[Se])))return!1}else if(ye[Se]!==ve[Se])return!1}return!0},W=_.useMemo(()=>{const ve=!!p&&!!e&&(hr(s)?!j().isPaused()&&!i&&l!==!1:s),ye=De=>{const nt=vm(De);return delete nt._k,ve?{isValidating:!0,isLoading:!0,...nt}:nt},_e=N(),Se=I(),Ae=ye(_e),je=_e===Se?Ae:ye(Se);let Ie=Ae;return[()=>{const De=ye(N());return Q(De,Ie)?(Ie.data=De.data,Ie.isLoading=De.isLoading,Ie.isValidating=De.isValidating,Ie.error=De.error,Ie):(Ie=De,De)},()=>je]},[r,p]),U=dG.useSyncExternalStore(_.useCallback(ve=>A(p,(ye,_e)=>{Q(_e,ye)||ve()}),[r,p]),W[0],W[1]),X=!k.current,G=h[p]&&h[p].length>0,ae=U.data,ne=hr(ae)?F&&L3e(F)?yW(F):F:ae,re=U.error,Z=_.useRef(ne),K=f?hr(ae)?hr(Z.current)?ne:Z.current:ae:ne,oe=!(G&&!hr(re))&&(X&&!hr(s)?s:!j().isPaused()&&(i?!hr(ne)&&l:hr(ne)||l)),ie=!!(p&&e&&X&&oe),Y=hr(U.isValidating)?ie:U.isValidating,le=hr(U.isLoading)?ie:U.isLoading,me=_.useCallback(async ve=>{const ye=T.current;if(!p||!ye||S.current||j().isPaused())return!1;let _e,Se,Ae=!0;const je=ve||{},Ie=!v[p]||!je.dedupe,De=()=>V3e?!S.current&&p===w.current&&k.current:p===w.current,nt={isValidating:!1,isLoading:!1},Fe=()=>{E(nt)},kt=()=>{const ot=v[p];ot&&ot[1]===Se&&delete v[p]},Re={isValidating:!0};hr(N().data)&&(Re.isLoading=!0);try{if(Ie&&(E(Re),n.loadingTimeout&&hr(N().data)&&setTimeout(()=>{Ae&&De()&&j().onLoadingSlow(p,n)},n.loadingTimeout),v[p]=[ye(O),vW()]),[_e,Se]=v[p],_e=await _e,Ie&&setTimeout(kt,n.dedupingInterval),!v[p]||v[p][1]!==Se)return Ie&&De()&&j().onDiscarded(p),!1;nt.error=Ja;const ot=g[p];if(!hr(ot)&&(Se<=ot[0]||Se<=ot[1]||ot[1]===0))return Fe(),Ie&&De()&&j().onDiscarded(p),!1;const Me=N().data;nt.data=o(Me,_e)?Me:_e,Ie&&De()&&j().onSuccess(_e,p,n)}catch(ot){kt();const Me=j(),{shouldRetryOnError:We}=Me;Me.isPaused()||(nt.error=ot,Ie&&De()&&(Me.onError(ot,p,Me),(We===!0||Ed(We)&&We(ot))&&(j().revalidateOnFocus&&j().revalidateOnReconnect&&!D()||Me.onErrorRetry(ot,p,Me,it=>{const Ue=h[p];Ue&&Ue[0]&&Ue[0](3,it)},{retryCount:(je.retryCount||0)+1,dedupe:!0}))))}return Ae=!1,Fe(),!0},[p,r]),ce=_.useCallback((...ve)=>F3e(r,w.current,...ve),[]);if(fW(()=>{T.current=e,P.current=n,hr(ae)||(Z.current=ae)}),fW(()=>{if(!p)return;const ve=me.bind(Ja,bW);let ye=0;j().revalidateOnFocus&&(ye=Date.now()+j().focusThrottleInterval);const _e=((Se,Ae,je)=>{const Ie=Ae[Se]||(Ae[Se]=[]);return Ie.push(je),()=>{const De=Ie.indexOf(je);De>=0&&(Ie[De]=Ie[Ie.length-1],Ie.pop())}})(p,h,(Se,Ae={})=>{if(Se==0){const je=Date.now();j().revalidateOnFocus&&je>ye&&D()&&(ye=je+j().focusThrottleInterval,ve())}else if(Se==1)j().revalidateOnReconnect&&D()&&ve();else{if(Se==2)return me();if(Se==3)return me(Ae)}});return S.current=!1,w.current=p,k.current=!0,E({_k:O}),oe&&(v[p]||(hr(ne)||aC?ve():idt(ve))),()=>{S.current=!0,_e()}},[p]),fW(()=>{let ve;function ye(){const Se=Ed(c)?c(N().data):c;Se&&ve!==-1&&(ve=setTimeout(_e,Se))}function _e(){N().error||!u&&!j().isVisible()||!d&&!j().isOnline()?ye():me(bW).then(ye)}return ye(),()=>{ve&&(clearTimeout(ve),ve=-1)}},[c,u,d,p]),_.useDebugValue(K),i&&hr(ne)&&p){if(!V3e&&aC)throw new Error("Fallback data is required when using Suspense in SSR.");T.current=e,P.current=n,S.current=!1;const ve=b[p];if(!hr(ve)){const ye=ce(ve);yW(ye)}if(!hr(re))throw re;{const ye=me(bW);hr(K)||(ye.status="fulfilled",ye.value=!0),yW(ye)}}return{mutate:ce,get data(){return L.data=!0,K},get error(){return L.error=!0,re},get isValidating(){return L.isValidating=!0,Y},get isLoading(){return L.isLoading=!0,le}}},function(...t){const e=vm(udt,_.useContext(ddt)),[n,r,o]=(c=>Ed(c[1])?[c[0],c[1],c[2]||{}]:[c[0],null,(c[1]===null?c[2]:c[1])||{}])(t),i=((c,u)=>{const d=vm(c,u);if(u){const{use:f,fallback:h}=c,{use:g,fallback:v}=u;f&&g&&(d.use=f.concat(g)),h&&v&&(d.fallback=vm(h,v))}return d})(e,o);let a=Z3e;const{use:s}=i,l=(s||[]).concat(hdt);for(let c=l.length;c--;)a=l[c](a);return a(n,r||i.fetcher||null,i)});var Z3e,xW,X3e;function pdt(){return X3e||(X3e=1,xW=function(t,e){if(typeof t!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof t}\`.`);let n,r=0;return function(...o){clearTimeout(n);const i=Date.now(),a=e-(i-r);a<=0?(r=i,t.apply(this,o)):n=setTimeout(()=>{r=Date.now(),t.apply(this,o)},a)}}),xW}const mdt=el(pdt());function t4(t,e){return e!=null?mdt(t,e):t}function gdt(t){const[e,n]=_.useState(t);return _.useEffect(()=>{oW(t,e)||n(t)},[t,e]),e}$J=function({api:t="/api/chat",id:e,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,onToolCall:i,experimental_prepareRequestBody:a,maxSteps:s=1,streamProtocol:l="data",onResponse:c,onFinish:u,onError:d,credentials:f,headers:h,body:g,generateId:v=JB,fetch:b,keepLastMessageOnError:p=!0,experimental_throttle:O}={}){const[k]=_.useState(v),S=e??k,w=typeof t=="string"?[t,S]:S,T=gdt(n??[]),P=_.useMemo(()=>rW(T),[T]),{data:j,mutate:D}=K0([w,"messages"],null,{fallbackData:P}),N=_.useRef(j||[]);_.useEffect(()=>{N.current=j||[]},[j]);const{data:E,mutate:A}=K0([w,"streamData"],null),I=_.useRef(E);_.useEffect(()=>{I.current=E},[E]);const{data:L="ready",mutate:F}=K0([w,"status"],null),{data:Q,mutate:W}=K0([w,"error"],null),U=_.useRef(null),X=_.useRef({credentials:f,headers:h,body:g});_.useEffect(()=>{X.current={credentials:f,headers:h,body:g}},[f,h,g]);const G=_.useCallback(async(ce,ve="generate")=>{var ye,_e;F("submitted"),W(void 0);const Se=rW(ce.messages),Ae=Se.length,je=nW((ye=Se[Se.length-1])==null?void 0:ye.toolInvocations);try{const De=new AbortController;U.current=De;const nt=t4(D,O),Fe=t4(A,O),kt=N.current;nt(Se,!1);const Re=o?Se:Se.map(({role:Me,content:We,experimental_attachments:it,data:Ue,annotations:gt,toolInvocations:Tt,parts:Kt})=>({role:Me,content:We,...it!==void 0&&{experimental_attachments:it},...Ue!==void 0&&{data:Ue},...gt!==void 0&&{annotations:gt},...Tt!==void 0&&{toolInvocations:Tt},...Kt!==void 0&&{parts:Kt}})),ot=I.current;await edt({api:t,body:(_e=a==null?void 0:a({id:S,messages:Se,requestData:ce.data,requestBody:ce.body}))!=null?_e:{id:S,messages:Re,data:ce.data,...X.current.body,...ce.body},streamProtocol:l,credentials:X.current.credentials,headers:{...X.current.headers,...ce.headers},abortController:()=>U.current,restoreMessagesOnFailure(){p||nt(kt,!1)},onResponse:c,onUpdate({message:Me,data:We,replaceLastMessage:it}){F("streaming"),nt([...it?Se.slice(0,Se.length-1):Se,Me],!1),We!=null&&We.length&&Fe([...ot??[],...We],!1)},onToolCall:i,onFinish:u,generateId:v,fetch:b,lastMessage:Se[Se.length-1],requestType:ve}),U.current=null,F("ready")}catch(De){if(De.name==="AbortError")return U.current=null,F("ready"),null;d&&De instanceof Error&&d(De),W(De),F("error")}const Ie=N.current;(function({originalMaxToolInvocationStep:De,originalMessageCount:nt,maxSteps:Fe,messages:kt}){var Re;const ot=kt[kt.length-1];return Fe>1&&ot!=null&&(kt.length>nt||nW(ot.toolInvocations)!==De)&&I3e(ot)&&((Re=nW(ot.toolInvocations))!=null?Re:0)<Fe})({originalMaxToolInvocationStep:je,originalMessageCount:Ae,maxSteps:s,messages:Ie})&&await G({messages:Ie})},[D,F,t,X,c,u,d,W,A,I,l,o,a,i,s,N,U,v,b,p,O,S]),ae=_.useCallback(async(ce,{data:ve,headers:ye,body:_e,experimental_attachments:Se=ce.experimental_attachments}={})=>{var Ae,je;const Ie=await $3e(Se),De=N.current.concat({...ce,id:(Ae=ce.id)!=null?Ae:v(),createdAt:(je=ce.createdAt)!=null?je:new Date,experimental_attachments:Ie.length>0?Ie:void 0,parts:N3e(ce)});return G({messages:De,headers:ye,body:_e,data:ve})},[G,v]),ne=_.useCallback(async({data:ce,headers:ve,body:ye}={})=>{const _e=N.current;if(_e.length===0)return null;const Se=_e[_e.length-1];return G({messages:Se.role==="assistant"?_e.slice(0,-1):_e,headers:ve,body:ye,data:ce})},[G]),re=_.useCallback(()=>{U.current&&(U.current.abort(),U.current=null)},[]),Z=_.useCallback(async()=>{const ce=N.current;G({messages:ce},"resume")},[G]),K=_.useCallback(ce=>{typeof ce=="function"&&(ce=ce(N.current));const ve=rW(ce);D(ve,!1),N.current=ve},[D]),oe=_.useCallback(ce=>{typeof ce=="function"&&(ce=ce(I.current)),A(ce,!1),I.current=ce},[A]),[ie,Y]=_.useState(r),le=_.useCallback(async(ce,ve={},ye)=>{var _e;if((_e=ce==null?void 0:ce.preventDefault)==null||_e.call(ce),!ie&&!ve.allowEmptySubmit)return;ye&&(X.current={...X.current,...ye});const Se=await $3e(ve.experimental_attachments),Ae={messages:N.current.concat({id:v(),createdAt:new Date,role:"user",content:ie,experimental_attachments:Se.length>0?Se:void 0,parts:[{type:"text",text:ie}]}),headers:ve.headers,body:ve.body,data:ve.data};G(Ae),Y("")},[ie,v,G]),me=_.useCallback(({toolCallId:ce,result:ve})=>{const ye=N.current;(function({messages:_e,toolCallId:Se,toolResult:Ae}){var je;const Ie=_e[_e.length-1],De=Ie.parts.find(Fe=>Fe.type==="tool-invocation"&&Fe.toolInvocation.toolCallId===Se);if(De==null)return;const nt={...De.toolInvocation,state:"result",result:Ae};De.toolInvocation=nt,Ie.toolInvocations=(je=Ie.toolInvocations)==null?void 0:je.map(Fe=>Fe.toolCallId===Se?nt:Fe)})({messages:ye,toolCallId:ce,toolResult:ve}),D([...ye.slice(0,ye.length-1),{...ye[ye.length-1]}],!1),!(L==="submitted"||L==="streaming")&&I3e(ye[ye.length-1])&&G({messages:ye})},[D,L,G]);return{messages:j??[],id:S,setMessages:K,data:E,setData:oe,error:Q,append:ae,reload:ne,stop:re,experimental_resume:Z,input:ie,setInput:Y,handleInputChange:ce=>{Y(ce.target.value)},handleSubmit:le,isLoading:L==="submitted"||L==="streaming",status:L,addToolResult:me}},dJ=function({api:t="/api/completion",id:e,initialCompletion:n="",initialInput:r="",credentials:o,headers:i,body:a,streamProtocol:s="data",fetch:l,onResponse:c,onFinish:u,onError:d,experimental_throttle:f}={}){const h=_.useId(),g=e||h,{data:v,mutate:b}=K0([t,g],null,{fallbackData:n}),{data:p=!1,mutate:O}=K0([g,"loading"],null),{data:k,mutate:S}=K0([g,"streamData"],null),[w,T]=_.useState(void 0),P=v,[j,D]=_.useState(null),N=_.useRef({credentials:o,headers:i,body:a});_.useEffect(()=>{N.current={credentials:o,headers:i,body:a}},[o,i,a]);const E=_.useCallback(async(X,G)=>async function({api:ae,prompt:ne,credentials:re,headers:Z,body:K,streamProtocol:oe="data",setCompletion:ie,setLoading:Y,setError:le,setAbortController:me,onResponse:ce,onFinish:ve,onError:ye,onData:_e,fetch:Se=tdt()}){var Ae;try{Y(!0),le(void 0);const je=new AbortController;me(je),ie("");const Ie=await Se(ae,{method:"POST",body:JSON.stringify({prompt:ne,...K}),credentials:re,headers:{"Content-Type":"application/json",...Z},signal:je.signal}).catch(nt=>{throw nt});if(ce)try{await ce(Ie)}catch(nt){throw nt}if(!Ie.ok)throw new Error((Ae=await Ie.text())!=null?Ae:"Failed to fetch the chat response.");if(!Ie.body)throw new Error("The response body is empty.");let De="";switch(oe){case"text":await M3e({stream:Ie.body,onTextPart:nt=>{De+=nt,ie(De)}});break;case"data":await A3e({stream:Ie.body,onTextPart(nt){De+=nt,ie(De)},onDataPart(nt){_e==null||_e(nt)},onErrorPart(nt){throw new Error(nt)}});break;default:throw new Error(`Unknown stream protocol: ${oe}`)}return ve&&ve(ne,De),me(null),De}catch(je){if(je.name==="AbortError")return me(null),null;je instanceof Error&&ye&&ye(je),le(je)}finally{Y(!1)}}({api:t,prompt:X,credentials:N.current.credentials,headers:{...N.current.headers,...G==null?void 0:G.headers},body:{...N.current.body,...G==null?void 0:G.body},streamProtocol:s,fetch:l,setCompletion:t4(ae=>b(ae,!1),f),onData:t4(ae=>S([...k??[],...ae??[]],!1),f),setLoading:O,setError:T,setAbortController:D,onResponse:c,onFinish:u,onError:d}),[b,O,t,N,D,c,u,d,T,k,s,l,S,f]),A=_.useCallback(()=>{j&&(j.abort(),D(null))},[j]),I=_.useCallback(X=>{b(X,!1)},[b]),L=_.useCallback(async(X,G)=>E(X,G),[E]),[F,Q]=_.useState(r),W=_.useCallback(X=>{var G;return(G=X==null?void 0:X.preventDefault)==null||G.call(X),F?L(F):void 0},[F,L]),U=_.useCallback(X=>{Q(X.target.value)},[Q]);return{completion:P,complete:L,error:w,setCompletion:I,stop:A,input:F,setInput:Q,handleInputChange:U,handleSubmit:W,isLoading:p,data:k}};let OW;OW=function(t){t===void 0&&(t={});var{crosshairCursor:e=!1}=t,n=[];t.closeBracketsKeymap!==!1&&(n=n.concat(ZK)),t.defaultKeymap!==!1&&(n=n.concat(MM)),t.searchKeymap!==!1&&(n=n.concat(wat)),t.historyKeymap!==!1&&(n=n.concat(rN)),t.foldKeymap!==!1&&(n=n.concat(XK)),t.completionKeymap!==!1&&(n=n.concat(iN)),t.lintKeymap!==!1&&(n=n.concat(ust));var r=[];return t.lineNumbers!==!1&&r.push(VK()),t.highlightActiveLineGutter!==!1&&r.push(zK()),t.highlightSpecialChars!==!1&&r.push(eN()),t.history!==!1&&r.push(AT()),t.foldGutter!==!1&&r.push(FK()),t.drawSelection!==!1&&r.push(JM()),t.dropCursor!==!1&&r.push(QK()),t.allowMultipleSelections!==!1&&r.push(Qn.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&r.push(UK()),t.syntaxHighlighting!==!1&&r.push($T(nN,{fallback:!0})),t.bracketMatching!==!1&&r.push(WK()),t.closeBrackets!==!1&&r.push(BK()),t.autocompletion!==!1&&r.push(_1()),t.rectangularSelection!==!1&&r.push(qK()),e!==!1&&r.push(function(o={}){let[i,a]=EVe[o.key||"Alt"],s=Wr.fromClass(class{constructor(l){this.view=l,this.isDown=!1}set(l){this.isDown!=l&&(this.isDown=l,this.view.update([]))}},{eventObservers:{keydown(l){this.set(l.keyCode==i||a(l))},keyup(l){l.keyCode!=i&&a(l)||this.set(!1)},mousemove(l){this.set(a(l))}}});return[s,mt.contentAttributes.of(l=>{var c;return!((c=l.plugin(s))===null||c===void 0)&&c.isDown?RVe:null})]}()),t.highlightActiveLine!==!1&&r.push(LK()),t.highlightSelectionMatches!==!1&&r.push(GK()),t.tabSize&&typeof t.tabSize=="number"&&r.push(gf.of(" ".repeat(t.tabSize))),r.concat([Hi.of(n.flat())]).filter(Boolean)},UY=function(t){t===void 0&&(t={});var e=[];t.defaultKeymap!==!1&&(e=e.concat(MM)),t.historyKeymap!==!1&&(e=e.concat(rN));var n=[];return t.highlightSpecialChars!==!1&&n.push(eN()),t.history!==!1&&n.push(AT()),t.drawSelection!==!1&&n.push(JM()),t.syntaxHighlighting!==!1&&n.push($T(nN,{fallback:!0})),n.concat([Hi.of(e.flat())]).filter(Boolean)};const H3e="#e06c75",n4="#abb2bf",wW="#7d8799",Y3e="#d19a66",G3e="#2c313a",K3e="#282c34",kW="#353a42",J3e="#528bff",vdt=[mt.theme({"&":{color:n4,backgroundColor:K3e},".cm-content":{caretColor:J3e},".cm-cursor, .cm-dropCursor":{borderLeftColor:J3e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:n4},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:K3e,color:wW,border:"none"},".cm-activeLineGutter":{backgroundColor:G3e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:kW},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:kW,borderBottomColor:kW},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:G3e,color:n4}}},{dark:!0}),$T(MO.define([{tag:de.keyword,color:"#c678dd"},{tag:[de.name,de.deleted,de.character,de.propertyName,de.macroName],color:H3e},{tag:[de.function(de.variableName),de.labelName],color:"#61afef"},{tag:[de.color,de.constant(de.name),de.standard(de.name)],color:Y3e},{tag:[de.definition(de.name),de.separator],color:n4},{tag:[de.typeName,de.className,de.number,de.changed,de.annotation,de.modifier,de.self,de.namespace],color:"#e5c07b"},{tag:[de.operator,de.operatorKeyword,de.url,de.escape,de.regexp,de.link,de.special(de.string)],color:"#56b6c2"},{tag:[de.meta,de.comment],color:wW},{tag:de.strong,fontWeight:"bold"},{tag:de.emphasis,fontStyle:"italic"},{tag:de.strikethrough,textDecoration:"line-through"},{tag:de.link,color:wW,textDecoration:"underline"},{tag:de.heading,fontWeight:"bold",color:H3e},{tag:[de.atom,de.bool,de.special(de.variableName)],color:Y3e},{tag:[de.processingInstruction,de.string,de.inserted],color:"#98c379"},{tag:de.invalid,color:"#ffffff"}]))];let eje;eje=mt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),uJ=function(t){t===void 0&&(t={});var{indentWithTab:e=!0,editable:n=!0,readOnly:r=!1,theme:o="light",placeholder:i="",basicSetup:a=!0}=t,s=[];switch(e&&s.unshift(Hi.of([HK])),a&&(typeof a=="boolean"?s.unshift(OW()):s.unshift(OW(a))),i&&s.unshift(eQ(i)),o){case"light":s.push(eje);break;case"dark":s.push(vdt);break;case"none":break;default:s.push(o)}return n===!1&&s.push(mt.editable.of(!1)),r&&s.push(Qn.readOnly.of(!0)),[...s]};class ydt{constructor(e,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class tje{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var SW=null,nje=Nc.define(),bdt=[];function xdt(t){var{value:e,selection:n,onChange:r,onStatistics:o,onCreateEditor:i,onUpdate:a,extensions:s=bdt,autoFocus:l,theme:c="light",height:u=null,minHeight:d=null,maxHeight:f=null,width:h=null,minWidth:g=null,maxWidth:v=null,placeholder:b="",editable:p=!0,readOnly:O=!1,indentWithTab:k=!0,basicSetup:S=!0,root:w,initialState:T}=t,[P,j]=_.useState(),[D,N]=_.useState(),[E,A]=_.useState(),I=_.useState(()=>({current:null}))[0],L=_.useState(()=>({current:null}))[0],F=mt.theme({"&":{height:u,minHeight:d,maxHeight:f,width:h,minWidth:g,maxWidth:v},"& .cm-scroller":{height:"100% !important"}}),Q=mt.updateListener.of(U=>{if(U.docChanged&&typeof r=="function"&&!U.transactions.some(G=>G.annotation(nje))){I.current?I.current.reset():(I.current=new ydt(()=>{if(L.current){var G=L.current;L.current=null,G()}I.current=null},200),(typeof window>"u"?new tje:(SW||(SW=new tje),SW)).add(I.current));var X=U.state.doc.toString();r(X,U)}o&&o((G=>({line:G.state.doc.lineAt(G.state.selection.main.from),lineCount:G.state.doc.lines,lineBreak:G.state.lineBreak,length:G.state.doc.length,readOnly:G.state.readOnly,tabSize:G.state.tabSize,selection:G.state.selection,selectionAsSingle:G.state.selection.asSingle().main,ranges:G.state.selection.ranges,selectionCode:G.state.sliceDoc(G.state.selection.main.from,G.state.selection.main.to),selections:G.state.selection.ranges.map(ae=>G.state.sliceDoc(ae.from,ae.to)),selectedText:G.state.selection.ranges.some(ae=>!ae.empty)}))(U))}),W=[Q,F,...uJ({theme:c,editable:p,readOnly:O,placeholder:b,indentWithTab:k,basicSetup:S})];return a&&typeof a=="function"&&W.push(mt.updateListener.of(a)),W=W.concat(s),_.useLayoutEffect(()=>{if(P&&!E){var U={doc:e,selection:n,extensions:W},X=T?Qn.fromJSON(T.json,U,T.fields):Qn.create(U);if(A(X),!D){var G=new mt({state:X,parent:P,root:w});N(G),i&&i(G,X)}}return()=>{D&&(A(void 0),N(void 0))}},[P,E]),_.useEffect(()=>{t.container&&j(t.container)},[t.container]),_.useEffect(()=>()=>{D&&(D.destroy(),N(void 0)),I.current&&(I.current.cancel(),I.current=null)},[D]),_.useEffect(()=>{l&&D&&D.focus()},[l,D]),_.useEffect(()=>{D&&D.dispatch({effects:hn.reconfigure.of(W)})},[c,s,u,d,f,h,g,v,b,p,O,k,S,r,a]),_.useEffect(()=>{if(e!==void 0){var U=D?D.state.doc.toString():"";if(D&&e!==U){var X=()=>{D&&e!==D.state.doc.toString()&&D.dispatch({changes:{from:0,to:D.state.doc.toString().length,insert:e||""},annotations:[nje.of(!0)]})};I.current&&!I.current.isDone?L.current=X:X()}}},[e,D]),{state:E,setState:A,view:D,setView:N,container:P,setContainer:j}}let rje;rje=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Fx=_.forwardRef((t,e)=>{var{className:n,value:r="",selection:o,extensions:i=[],onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:d="light",height:f,minHeight:h,maxHeight:g,width:v,minWidth:b,maxWidth:p,basicSetup:O,placeholder:k,indentWithTab:S,editable:w,readOnly:T,root:P,initialState:j}=t,D=cJ(t,rje),N=_.useRef(null),{state:E,view:A,container:I,setContainer:L}=xdt({root:P,value:r,autoFocus:u,theme:d,height:f,minHeight:h,maxHeight:g,width:v,minWidth:b,maxWidth:p,basicSetup:O,placeholder:k,indentWithTab:S,editable:w,readOnly:T,selection:o,onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:c,extensions:i,initialState:j});_.useImperativeHandle(e,()=>({editor:N.current,state:E,view:A}),[N,I,E,A]);var F=_.useCallback(W=>{N.current=W,L(W)},[L]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var Q=typeof d=="string"?"cm-theme-"+d:"cm-theme";return y.jsx("div",fO({ref:F,className:Q+(n?" "+n:"")},D))}),Fx.displayName="CodeMirror";var Odt=dJ;hJ=function({input:t}){const{datasets:e,variables:n}=function(r){const o=Ht.get(FPe),i=Ht.get(Du),a=r.match(/@([\w.]+)/g)||[],s=a.map(u=>u.slice(1)),l=[],c=[];for(const u of s){const d=o.get(u);if(d){l.push(d);continue}const f=i[u];f&&c.push(f)}return{datasets:l,variables:c}}(t);return Ve.debug("Included datasets",e),Ve.debug("Included variables",n),{includeOtherCode:kG(""),context:{schema:e.map(r=>({name:r.name,columns:r.columns.map(o=>({name:o.name,type:o.type,sampleValues:o.sample_values}))})),variables:n.map(r=>({name:r.name,valueType:r.dataType??"",previewValue:r.value}))}}};const wdt=5,kdt=4,Sdt=3;function Cdt(t,e){return m_e(t,new Set(e.keys()),Sdt,"@")}function _dt(t){return[...t.entries()].map(([e,n])=>({label:`@${e}`,displayLabel:e,detail:n.source==="memory"?"in-memory":n.source,boost:n.source_type==="local"?wdt:kdt,type:n.variable_name?"dataframe":"table",apply:`@${e}`,section:n.variable_name?"Dataframe":"Table",info:()=>{const r=document.createElement("div");r.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]"),r.style.display="flex",r.style.flexDirection="column",r.style.gap=".8rem",r.style.padding="0.5rem";const o=document.createElement("div");o.classList.add("flex","flex-col","gap-1");const i=document.createElement("div");if(i.classList.add("font-bold","text-base"),i.textContent=e,o.append(i),n.source){const s=document.createElement("div");s.classList.add("text-xs","text-muted-foreground"),s.textContent=`Source: ${n.source}`,o.append(s)}r.append(o);const a=[n.num_rows==null?void 0:`${n.num_rows} rows`,n.num_columns==null?void 0:`${n.num_columns} columns`].filter(Boolean).join(", ");if(a){const s=document.createElement("div");s.classList.add("text-xs","bg-muted","px-2","py-1","rounded"),s.textContent=a,r.append(s)}if(n.columns&&n.columns.length>0){const s=document.createElement("div");s.classList.add("overflow-auto","max-h-60");const l=document.createElement("table");l.classList.add("w-full","text-xs","border-collapse");const c=l.insertRow();c.classList.add("bg-muted");const u=c.insertCell();u.classList.add("p-2","font-medium","text-left"),u.textContent="Column";const d=c.insertCell();d.classList.add("p-2","font-medium","text-left"),d.textContent="Type";const f=n.columns.some(g=>oje(n,g)!==void 0);let h;f&&(h=c.insertCell(),h.classList.add("p-2","font-medium","text-left"),h.textContent="Metadata"),n.columns.forEach((g,v)=>{const b=l.insertRow();b.classList.add(v%2==0?"bg-background":"bg-muted/30");const p=b.insertCell();p.classList.add("p-2","font-mono"),p.textContent=g.name;const O=b.insertCell();if(O.classList.add("p-2","text-muted-foreground"),O.textContent=g.type,f){const k=b.insertCell();k.classList.add("p-2");const S=oje(n,g);S&&k.append(S)}}),s.append(l),r.append(s)}return r}}))}function oje(t,e){var o,i;const n=(o=t.primary_keys)==null?void 0:o.includes(e.name),r=(i=t.indexes)==null?void 0:i.includes(e.name);if(n||r){const a=document.createElement("span");return a.textContent=n?"PK":"IDX",a.classList.add("text-xs","px-1.5","py-0.5","rounded-full","font-medium",n?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200"),a}}let ije,aje,sje;ije=[IT(),mt.lineWrapping],aje=[Jx(),mt.lineWrapping],sje=Q_("marimo:ai-language","python"),v8e=t=>{const e=ue.c(60),{onClose:n}=t,{createNewCell:r}=Iv();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={},e[0]=o):o=e[0];const[i,a]=_.useState(o),[s,l]=ss(sje),{theme:c}=as(),u=wY(),{completion:d,input:f,stop:h,isLoading:g,setCompletion:v,setInput:b,handleSubmit:p}=Odt({api:u.getAiURL("completion").toString(),headers:u.headers(),streamProtocol:"text",experimental_throttle:100,body:{...i,language:s,code:""},onError:Tdt,onFinish:(K,oe)=>{O(oe.trimEnd())}}),O=v;let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsx(mK,{className:"size-4 text-[var(--blue-11)]"}),e[1]=k):k=e[1];const S=s==="python"?"Python":"SQL";let w,T,P,j,D,N,E,A,I,L,F,Q,W,U,X;e[2]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsx(FO,{className:"ml-1 h-3.5 w-3.5 text-muted-foreground/70"}),e[2]=w):w=e[2],e[3]!==S?(T=y.jsx(Gm,{asChild:!0,children:y.jsxs(Ft,{variant:"text",className:"ml-2",size:"xs","data-testid":"language-button",children:[S,w]})}),e[3]=S,e[4]=T):T=e[4],e[5]!==l?(P=y.jsx($r,{onClick:()=>l("python"),children:"Python"}),e[5]=l,e[6]=P):P=e[6],e[7]!==l?(j=y.jsx($r,{onClick:()=>l("sql"),children:"SQL"}),e[7]=l,e[8]=j):j=e[8],e[9]!==P||e[10]!==j?(D=y.jsxs(zh,{align:"center",children:[P,j]}),e[9]=P,e[10]=j,e[11]=D):D=e[11],e[12]!==T||e[13]!==D?(N=y.jsxs(Hm,{modal:!1,children:[T,D]}),e[12]=T,e[13]=D,e[14]=N):N=e[14],e[15]!==n||e[16]!==O?(E=()=>{O(""),n()},e[15]=n,e[16]=O,e[17]=E):E=e[17],e[18]!==b?(A=K=>{b(K),a(hJ({input:K}))},e[18]=b,e[19]=A):A=e[19],e[20]!==p||e[21]!==g?(I=()=>{g||p()},e[20]=p,e[21]=g,e[22]=I):I=e[22],e[23]!==f||e[24]!==E||e[25]!==A||e[26]!==I||e[27]!==c?(L=y.jsx(pN,{theme:c,onClose:E,value:f,onChange:A,onSubmit:I}),e[23]=f,e[24]=E,e[25]=A,e[26]=I,e[27]=c,e[28]=L):L=e[28],e[29]!==g||e[30]!==h?(F=g&&y.jsxs(Ft,{"data-testid":"stop-completion-button",variant:"text",size:"sm",className:"mb-0",onClick:h,children:[y.jsx(af,{className:"animate-spin mr-1",size:14}),"Stop"]}),e[29]=g,e[30]=h,e[31]=F):F=e[31],e[32]!==d||e[33]!==r||e[34]!==g||e[35]!==s||e[36]!==n||e[37]!==O?(Q=!g&&d&&y.jsx(Ft,{"data-testid":"accept-completion-button",variant:"text",size:"sm",className:"mb-0",disabled:g,onClick:()=>{r({cellId:"__end__",before:!1,code:s==="python"?d:LO.fromQuery(d)}),O(""),n()},children:y.jsx("span",{className:"text-[var(--grass-11)] opacity-100",children:"Accept"})}),e[32]=d,e[33]=r,e[34]=g,e[35]=s,e[36]=n,e[37]=O,e[38]=Q):Q=e[38],e[39]===Symbol.for("react.memo_cache_sentinel")?(W=y.jsx(Qa,{className:"size-4"}),e[39]=W):W=e[39],e[40]!==n?(U=y.jsx(Ft,{variant:"text",size:"sm",className:"mb-0",onClick:n,children:W}),e[40]=n,e[41]=U):U=e[41],e[42]!==N||e[43]!==L||e[44]!==F||e[45]!==Q||e[46]!==U?(X=y.jsxs("div",{className:"flex items-center px-3",children:[k,N,L,F,Q,U]}),e[42]=N,e[43]=L,e[44]=F,e[45]=Q,e[46]=U,e[47]=X):X=e[47];const G=X;let ae,ne,re,Z;return e[48]===Symbol.for("react.memo_cache_sentinel")?(ae=we("flex flex-col w-full gap-2 py-2"),e[48]=ae):ae=e[48],e[49]!==d?(ne=!d&&y.jsxs("span",{className:"text-xs text-muted-foreground px-3 flex flex-col gap-1",children:[y.jsxs("span",{children:["You can mention"," ",y.jsx("span",{className:"text-[var(--cyan-11)]",children:"@dataframe"})," or"," ",y.jsx("span",{className:"text-[var(--cyan-11)]",children:"@sql_table"})," to pull additional context such as column names."]}),y.jsx("span",{children:"Code from other cells is automatically included."})]}),e[49]=d,e[50]=ne):ne=e[50],e[51]!==d||e[52]!==s||e[53]!==O||e[54]!==c?(re=d&&y.jsx(Fx,{value:d,className:"cm border-t",onChange:O,theme:c==="dark"?"dark":"light",extensions:s==="python"?ije:aje}),e[51]=d,e[52]=s,e[53]=O,e[54]=c,e[55]=re):re=e[55],e[56]!==G||e[57]!==ne||e[58]!==re?(Z=y.jsxs("div",{className:ae,children:[G,ne,re]}),e[56]=G,e[57]=ne,e[58]=re,e[59]=Z):Z=e[59],Z},pN=t=>{const e=ue.c(28),{value:n,placeholder:r,inputRef:o,className:i,onChange:a,onSubmit:s,onClose:l,additionalCompletions:c,theme:u,maxHeight:d}=t,f=s,h=l,g=Gr(FPe),v=Gr(Du);let b;e[0]!==c||e[1]!==g||e[2]!==v?(b=F=>{const Q=[..._dt(g),...Cdt(v,g)],W=[/@([\w.]+)?/];return c&&(W.push(c.triggerCompletionRegex),Q.push(...c.completions)),function(U,X=[]){return G=>{const ae=U.map(ne=>G.matchBefore(ne)).find(Boolean);return ae?ae&&ae.from===ae.to&&!G.explicit?null:{from:ae==null?void 0:ae.from,options:[...X]}:null}}(W,Q)(F)},e[0]=c,e[1]=g,e[2]=v,e[3]=b):b=e[3];const p=Fn(b);let O,k,S,w,T,P,j,D;e[4]!==p?(k=_1({override:[p]}),e[4]=p,e[5]=k):k=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(S=UY(),e[6]=S):S=e[6],e[7]!==f?(w=La.highest(Hi.of([{preventDefault:!0,stopPropagation:!0,any:(F,Q)=>{const W=Q.metaKey||Q.ctrlKey||Q.shiftKey;if(Q.key==="Enter"&&!W)return f(Q,F.state.doc.toString()),Q.preventDefault(),Q.stopPropagation(),!0;if(Q.key==="Enter"&&Q.shiftKey){const U=F.state.selection.main.from;return F.dispatch({changes:{from:U,to:U,insert:`
|
454
454
|
`},selection:{anchor:U+1,head:U+1}}),Q.preventDefault(),Q.stopPropagation(),!0}return!1}}])),e[7]=f,e[8]=w):w=e[8],e[9]!==h?(T=Hi.of([{key:"Escape",preventDefault:!0,stopPropagation:!0,run:()=>(h(),!0)}]),e[9]=h,e[10]=T):T=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(P=Hi.of([{key:"ArrowUp",preventDefault:!0,stopPropagation:!0}]),j=Hi.of([{key:"ArrowDown",preventDefault:!0,stopPropagation:!0}]),e[11]=P,e[12]=j):(P=e[11],j=e[12]),e[13]!==k||e[14]!==w||e[15]!==T?(D=[k,mt.lineWrapping,S,w,T,P,j],e[13]=k,e[14]=w,e[15]=T,e[16]=D):D=e[16],O=D;const N=O;let E;e[17]!==i?(E=we("flex-1 font-sans overflow-auto my-1",i),e[17]=i,e[18]=E):E=e[18];const A=u==="dark"?"dark":"light",I=r||"Generate with AI";let L;return e[19]!==N||e[20]!==o||e[21]!==d||e[22]!==a||e[23]!==E||e[24]!==A||e[25]!==I||e[26]!==n?(L=y.jsx(Fx,{ref:o,className:E,width:"100%",maxHeight:d,value:n,basicSetup:!1,extensions:N,onChange:a,theme:A,placeholder:I}),e[19]=N,e[20]=o,e[21]=d,e[22]=a,e[23]=E,e[24]=A,e[25]=I,e[26]=n,e[27]=L):L=e[27],L};function Tdt(t){Kr({title:"Generate with AI failed",description:q_(t)})}const Pdt=t=>{const e=ue.c(93),[n,r]=_.useState(t.config),[o,i]=_.useState(void 0),a=_.useRef(null),s=_.useRef(null),l=_.useRef(null),c=_.useRef(null),{theme:u}=as();let d,f;e[0]!==t?(d=async()=>(await t.get_chat_history({})).messages.map(Ddt),e[0]=t,e[1]=d):d=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[2]=f):f=e[2];const{data:h}=$a(d,f);let g,v,b;e[3]!==n||e[4]!==t?(g=async(Ue,gt)=>{const Tt=JSON.parse(gt==null?void 0:gt.body);try{const Kt=await t.send_prompt({messages:Tt.messages.map(Adt),config:{max_tokens:n.max_tokens,temperature:n.temperature,top_p:n.top_p,top_k:n.top_k,frequency_penalty:n.frequency_penalty,presence_penalty:n.presence_penalty}});return new Response(Kt)}catch(Kt){const Sn=Kt.message.split("failed with exception ").pop();return new Response(Sn,{status:400})}},e[3]=n,e[4]=t,e[5]=g):g=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(v=(Ue,gt)=>{const{usage:Tt,finishReason:Kt}=gt;i(void 0),a.current&&(a.current.value=""),Ve.debug("Finished streaming message:",Ue),Ve.debug("Token usage:",Tt),Ve.debug("Finish reason:",Kt)},e[6]=v):v=e[6],e[7]!==h||e[8]!==g?(b={keepLastMessageOnError:!0,streamProtocol:"text",fetch:g,initialMessages:h,onFinish:v,onError:Mdt,onResponse:Ndt},e[7]=h,e[8]=g,e[9]=b):b=e[9];const{messages:p,setMessages:O,input:k,setInput:S,handleSubmit:w,status:T,stop:P,error:j,reload:D}=$J(b),N=T==="submitted"||T==="streaming";let E;e[10]!==p||e[11]!==t||e[12]!==O?(E=Ue=>{const gt=p.findIndex(Tt=>Tt.id===Ue);gt!==-1&&(t.delete_chat_message({index:gt}),O(Tt=>Tt.filter(Kt=>Kt.id!==Ue)))},e[10]=p,e[11]=t,e[12]=O,e[13]=E):E=e[13];const A=E,I=$dt;let L;e[14]===Symbol.for("react.memo_cache_sentinel")?(L=Ue=>{const gt=Ue.role==="assistant"?Br({html:Ue.content}):Ue.content,Tt=Ue.experimental_attachments;return y.jsxs(y.Fragment,{children:[gt,Tt&&Tt.length>0&&y.jsx("div",{className:"mt-2",children:Tt.map((Kt,Sn)=>y.jsxs("div",{className:"flex items-baseline gap-2 ",children:[I(Kt),y.jsx("a",{className:fs({variant:"text",size:"icon"}),href:Kt.url,download:Kt.name,children:y.jsx(DA,{className:"size-3"})})]},Sn))})]})},e[14]=L):L=e[14];const F=L,Q=Array.isArray(t.allowAttachments)&&t.allowAttachments.length>0||t.allowAttachments===!0;let W,U,X;e[15]===Symbol.for("react.memo_cache_sentinel")?(W=/^\/(\w+)?/,e[15]=W):W=e[15],e[16]!==t.prompts?(U=t.prompts.map(Idt),e[16]=t.prompts,e[17]=U):U=e[17],e[18]!==U?(X={triggerCompletionRegex:W,completions:U},e[18]=U,e[19]=X):X=e[19];const G=X,ae=t.prompts.length>0?"Type your message here, / for prompts":"Type your message here...";let ne,re,Z,K,oe,ie,Y,le,me,ce,ve,ye,_e,Se;if(e[20]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>{var Ue;(Ue=c.current)==null||Ue.scrollTo({top:c.current.scrollHeight,behavior:"smooth"})},e[20]=ne):ne=e[20],e[21]!==p.length?(re=[p.length,c],e[21]=p.length,e[22]=re):re=e[22],_.useEffect(ne,re),e[23]!==t.maxHeight?(Z={maxHeight:t.maxHeight},e[23]=t.maxHeight,e[24]=Z):Z=e[24],e[25]!==t||e[26]!==O?(K=()=>{O([]),t.setValue([]),t.delete_chat_history({})},e[25]=t,e[26]=O,e[27]=K):K=e[27],e[28]===Symbol.for("react.memo_cache_sentinel")?(oe=y.jsx(jO,{className:"h-3 w-3"}),e[28]=oe):oe=e[28],e[29]!==K?(ie=y.jsx("div",{className:"absolute top-0 right-0 flex justify-end z-10 border border-[var(--slate-6)] bg-inherit rounded-bl-lg",children:y.jsx(Ft,{variant:"text",size:"icon",onClick:K,children:oe})}),e[29]=K,e[30]=ie):ie=e[30],e[31]!==p.length?(Y=p.length===0&&y.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",children:[y.jsx(lK,{className:"h-12 w-12 mb-4"}),y.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No messages yet"}),y.jsx("p",{className:"text-sm",children:"Start a conversation by typing a message below."})]}),e[31]=p.length,e[32]=Y):Y=e[32],e[33]!==A||e[34]!==p){let Ue;e[36]!==A?(Ue=gt=>y.jsxs("div",{className:we("flex flex-col group gap-2",gt.role==="user"?"items-end":"items-start"),children:[y.jsx("div",{className:"max-w-[80%] p-3 rounded-lg "+(gt.role==="user"?"bg-[var(--sky-11)] text-[var(--slate-1)]":"bg-[var(--slate-4)] text-[var(--slate-12)]"),children:y.jsx("p",{className:we(gt.role==="user"&&"whitespace-pre-wrap"),children:F(gt)})}),y.jsxs("div",{className:"flex justify-end text-xs gap-2 invisible group-hover:visible",children:[y.jsx("button",{type:"button",onClick:async()=>{await Kd(gt.content),Kr({title:"Copied to clipboard"})},className:"text-xs text-[var(--slate-9)] hover:text-[var(--slate-11)]",children:y.jsx(kce,{className:"h-3 w-3"})}),y.jsx("button",{type:"button",onClick:()=>A(gt.id),className:"text-xs text-[var(--slate-9)] hover:text-[var(--slate-11)]",children:y.jsx(jO,{className:"h-3 w-3 text-[var(--red-9)]"})})]})]},gt.id),e[36]=A,e[37]=Ue):Ue=e[37],le=p.map(Ue),e[33]=A,e[34]=p,e[35]=le}else le=e[35];e[38]!==N||e[39]!==P?(me=N&&y.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[y.jsx(Ym,{size:"small"}),y.jsx(Ft,{variant:"link",size:"sm",onClick:()=>P(),className:"text-[var(--red-9)] hover:text-[var(--red-11)]",children:"Stop"})]}),e[38]=N,e[39]=P,e[40]=me):me=e[40],e[41]!==j||e[42]!==D?(ce=j&&y.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-4",children:[y.jsx(Hd,{error:j}),y.jsx(Ft,{variant:"outline",size:"sm",onClick:()=>D(),children:"Retry"})]}),e[41]=j,e[42]=D,e[43]=ce):ce=e[43],e[44]!==Y||e[45]!==le||e[46]!==me||e[47]!==ce?(ve=y.jsxs("div",{className:"flex-grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",ref:c,children:[Y,le,me,ce]}),e[44]=Y,e[45]=le,e[46]=me,e[47]=ce,e[48]=ve):ve=e[48],e[49]!==o||e[50]!==w?(ye=Ue=>{w(Ue,{experimental_attachments:o})},e[49]=o,e[50]=w,e[51]=ye):ye=e[51],e[52]!==n||e[53]!==t.showConfigurationControls?(_e=t.showConfigurationControls&&y.jsx(Edt,{config:n,onChange:r}),e[52]=n,e[53]=t.showConfigurationControls,e[54]=_e):_e=e[54],e[55]!==t.prompts||e[56]!==S?(Se=t.prompts.length>0&&y.jsx(Rdt,{prompts:t.prompts,onSelect:Ue=>{S(Ue),requestAnimationFrame(()=>{var Tt,Kt,Sn;var gt;(Kt=(Tt=l.current)==null?void 0:Tt.view)==null||Kt.focus(),gt=(Sn=l.current)==null?void 0:Sn.view,gt&>.dispatch({selection:{anchor:gt.state.doc.length,head:gt.state.doc.length}})})}}),e[55]=t.prompts,e[56]=S,e[57]=Se):Se=e[57];const Ae=t.maxHeight?t.maxHeight/2+"px":void 0;let je,Ie,De,nt,Fe,kt;e[58]===Symbol.for("react.memo_cache_sentinel")?(je=(Ue,gt)=>{var Tt;gt.trim()&&((Tt=s.current)==null||Tt.requestSubmit())},e[58]=je):je=e[58],e[59]!==k||e[60]!==G||e[61]!==ae||e[62]!==S||e[63]!==Ae||e[64]!==u?(Ie=y.jsx(pN,{className:"rounded-sm mr-2",placeholder:ae,value:k,inputRef:l,theme:u,maxHeight:Ae,onChange:S,onSubmit:je,onClose:Qdt,additionalCompletions:G}),e[59]=k,e[60]=G,e[61]=ae,e[62]=S,e[63]=Ae,e[64]=u,e[65]=Ie):Ie=e[65],e[66]!==o?(De=o&&o.length===1&&y.jsx("span",{title:o[0].name,className:"text-sm text-[var(--slate-11)] truncate flex-shrink-0 w-24",children:o[0].name}),e[66]=o,e[67]=De):De=e[67],e[68]!==o?(nt=o&&o.length>1&&y.jsxs("span",{title:[...o].map(Ldt).join(`
|
455
|
-
`),className:"text-sm text-[var(--slate-11)] truncate flex-shrink-0",children:[o.length," files"]}),e[68]=o,e[69]=nt):nt=e[69],e[70]!==o?(Fe=o&&o.length>0&&y.jsx(Ft,{type:"button",variant:"text",size:"sm",onClick:()=>{i(void 0),a.current&&(a.current.value="")},children:y.jsx(Qa,{className:"size-3"})}),e[70]=o,e[71]=Fe):Fe=e[71],e[72]!==t.allowAttachments||e[73]!==Q?(kt=Q&&y.jsxs(y.Fragment,{children:[y.jsx(Ft,{type:"button",variant:"text",size:"sm",onClick:()=>{var Ue;return(Ue=a.current)==null?void 0:Ue.click()},children:y.jsx(Vce,{className:"h-4"})}),y.jsx("input",{type:"file",ref:a,className:"hidden",multiple:!0,accept:Array.isArray(t.allowAttachments)?t.allowAttachments.join(","):void 0,onChange:Ue=>{Ue.target.files&&i(Ue.target.files)}})]}),e[72]=t.allowAttachments,e[73]=Q,e[74]=kt):kt=e[74];const Re=N||!k;let ot,Me,We,it;return e[75]===Symbol.for("react.memo_cache_sentinel")?(ot=y.jsx(NJ,{className:"h-5 w-5"}),e[75]=ot):ot=e[75],e[76]!==Re?(Me=y.jsx(Ft,{type:"submit",disabled:Re,variant:"outline",size:"sm",className:"text-[var(--slate-11)]",children:ot}),e[76]=Re,e[77]=Me):Me=e[77],e[78]!==ye||e[79]!==_e||e[80]!==Se||e[81]!==Ie||e[82]!==De||e[83]!==nt||e[84]!==Fe||e[85]!==kt||e[86]!==Me?(We=y.jsxs("form",{onSubmit:ye,ref:s,className:"flex w-full border-t border-[var(--slate-6)] px-2 py-1 items-center",children:[_e,Se,Ie,De,nt,Fe,kt,Me]}),e[78]=ye,e[79]=_e,e[80]=Se,e[81]=Ie,e[82]=De,e[83]=nt,e[84]=Fe,e[85]=kt,e[86]=Me,e[87]=We):We=e[87],e[88]!==Z||e[89]!==ie||e[90]!==ve||e[91]!==We?(it=y.jsxs("div",{className:"flex flex-col h-full bg-[var(--slate-1)] rounded-lg shadow border border-[var(--slate-6)] overflow-hidden relative",style:Z,children:[ie,ve,We]}),e[88]=Z,e[89]=ie,e[90]=ve,e[91]=We,e[92]=it):it=e[92],it},sC={max_tokens:{min:1,max:4096,description:"Maximum number of tokens to generate"},temperature:{min:0,max:2,step:.1,description:"Controls randomness (0: deterministic, 2: very random)"},top_p:{min:0,max:1,step:.1,description:"Nucleus sampling: probability mass to consider"},top_k:{min:1,max:100,description:"Top-k sampling: number of highest probability tokens to consider"},frequency_penalty:{min:-2,max:2,description:"Penalizes frequent tokens (-2: favor, 2: avoid)"},presence_penalty:{min:-2,max:2,description:"Penalizes new tokens (-2: favor, 2: avoid)"}},Edt=t=>{const e=ue.c(16),{config:n,onChange:r}=t,[o,i]=_.useState(n),[a,s]=_.useState(!1);let l;e[0]!==o||e[1]!==r?(l=(p,O)=>{const{min:k,max:S}=sC[p],w=Math.max(k,Math.min(S,O)),T={...o,[p]:w};i(T),r(T)},e[0]=o,e[1]=r,e[2]=l):l=e[2];const c=l;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=p=>{p.key==="Enter"&&(p.preventDefault(),s(!1))},e[3]=u):u=e[3];const d=u;let f,h,g,v,b;if(e[4]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(qn,{content:"Configuration",children:y.jsx(sy,{asChild:!0,children:y.jsx(Ft,{variant:"outline",size:"sm",className:"border-none shadow-initial",children:y.jsx(jG,{className:"h-3 w-3"})})})}),e[4]=f):f=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsx("h4",{className:"font-bold leading-none",children:"Configuration"}),e[5]=h):h=e[5],e[6]!==c||e[7]!==o){let p;e[9]!==c?(p=O=>{const[k,S]=O;return y.jsxs("div",{className:"grid grid-cols-3 items-center gap-1",children:[y.jsxs(nf,{htmlFor:k,className:"flex w-full justify-between col-span-3 align-end",children:[oM(k),y.jsx(qn,{delayDuration:200,side:"top",content:y.jsx("div",{className:"text-xs flex flex-col",children:sC[k].description}),children:y.jsx(PA,{className:"h-3 w-3 cursor-help text-muted-foreground hover:text-foreground"})})]}),y.jsx(Yh,{id:k,value:S,minValue:sC[k].min,maxValue:sC[k].max,step:sC[k].step??1,onChange:w=>c(k,w),onKeyDown:d,className:"col-span-3"})]},k)},e[9]=c,e[10]=p):p=e[10],g=cr.entries(o).map(p),e[6]=c,e[7]=o,e[8]=g}else g=e[8];return e[11]!==g?(v=y.jsx(tp,{className:"w-70 border",children:y.jsxs("div",{className:"grid gap-3",children:[h,g]})}),e[11]=g,e[12]=v):v=e[12],e[13]!==a||e[14]!==v?(b=y.jsxs(dg,{open:a,onOpenChange:s,children:[f,v]}),e[13]=a,e[14]=v,e[15]=b):b=e[15],b},Rdt=t=>{const e=ue.c(18),{prompts:n,onSelect:r}=t,[o,i]=_.useState(!1),[a,s]=_.useState("");let l;e[0]!==r?(l=b=>{[...b.matchAll(/{{(\w+)}}/g)].length>0?(s(b),i(!0)):r(b)},e[0]=r,e[1]=l):l=e[1];const c=l;let u,d,f,h,g,v;if(e[2]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(qn,{content:"Select a prompt",children:y.jsx(Gm,{asChild:!0,children:y.jsx(Ft,{variant:"outline",size:"sm",className:"border-none shadow-initial",children:y.jsx(tOe,{className:"h-3 w-3 mx-1"})})})}),e[2]=u):u=e[2],e[3]!==c||e[4]!==n){let b;e[6]!==c?(b=(p,O)=>y.jsx($r,{onSelect:()=>c(p),className:"whitespace-normal text-left",children:p},O),e[6]=c,e[7]=b):b=e[7],d=n.map(b),e[3]=c,e[4]=n,e[5]=d}else d=e[5];return e[8]!==d?(f=y.jsx(HM,{children:y.jsxs(Hm,{children:[u,y.jsx(zh,{side:"right",align:"end",onCloseAutoFocus:zdt,className:"w-64 max-h-96 overflow-y-auto",children:d})]})}),e[8]=d,e[9]=f):f=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>i(!1),e[10]=h):h=e[10],e[11]!==r||e[12]!==a?(g=y.jsx(tp,{side:"right",align:"end",className:"min-w-80 px-2",children:y.jsx(jdt,{prompt:a,onClose:h,onSelect:r})}),e[11]=r,e[12]=a,e[13]=g):g=e[13],e[14]!==o||e[15]!==f||e[16]!==g?(v=y.jsxs(dg,{open:o,onOpenChange:i,children:[f,g]}),e[14]=o,e[15]=f,e[16]=g,e[17]=v):v=e[17],v},jdt=t=>{const e=ue.c(32),{prompt:n,onClose:r,onSelect:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const[a,s]=_.useState(i);let l,c,u;e[1]!==n?(l=()=>{const T=[...n.matchAll(/{{(\w+)}}/g)].reduce(Vdt,{});s(T)},c=[n],e[1]=n,e[2]=l,e[3]=c):(l=e[2],c=e[3]),_.useEffect(l,c),e[4]===Symbol.for("react.memo_cache_sentinel")?(u=(T,P)=>{s(j=>({...j,[T]:P}))},e[4]=u):u=e[4];const d=u;let f;if(e[5]!==n||e[6]!==a){let T;e[8]!==a?(T=(P,j)=>a[j]||`{{${j}}}`,e[8]=a,e[9]=T):T=e[9],f=n.replaceAll(/{{(\w+)}}/g,T),e[5]=n,e[6]=a,e[7]=f}else f=e[7];const h=f;let g;e[10]!==a?(g=Object.values(a).some(qdt),e[10]=a,e[11]=g):g=e[11];const v=g;let b;e[12]!==r||e[13]!==o||e[14]!==h?(b=()=>{o(h),r()},e[12]=r,e[13]=o,e[14]=h,e[15]=b):b=e[15];const p=b;let O,k,S,w;if(e[16]!==p||e[17]!==v||e[18]!==a){let T;e[20]!==p||e[21]!==v?(T=(P,j)=>{const[D,N]=P;return y.jsxs("div",{className:"grid grid-cols-4 items-center gap-2",children:[y.jsx(nf,{htmlFor:D,className:"font-semibold text-base",children:D}),y.jsx(tf,{id:D,value:N,onChange:E=>d(D,E.target.value),rootClassName:"col-span-3 w-full",className:"m-0",placeholder:`Enter value for ${D}`,autoFocus:j===0,onKeyDown:E=>{E.key!=="Enter"||v||p()}})]},D)},e[20]=p,e[21]=v,e[22]=T):T=e[22],O=Object.entries(a).map(T),e[16]=p,e[17]=v,e[18]=a,e[19]=O}else O=e[19];return e[23]!==h?(k=y.jsx("div",{className:"grid gap-2 prose dark:prose-invert",children:y.jsx("blockquote",{className:"text-sm",children:h})}),e[23]=h,e[24]=k):k=e[24],e[25]!==p||e[26]!==v?(S=y.jsx(Ft,{onClick:p,size:"xs",disabled:v,children:"Submit"}),e[25]=p,e[26]=v,e[27]=S):S=e[27],e[28]!==S||e[29]!==O||e[30]!==k?(w=y.jsxs("div",{className:"grid gap-4",children:[O,k,S]}),e[28]=S,e[29]=O,e[30]=k,e[31]=w):w=e[31],w};function Ddt(t,e){return{id:e.toString(),role:t.role,content:t.content,experimental_attachments:t.attachments}}function Adt(t){return{role:t.role,content:t.content,attachments:t.experimental_attachments}}function Mdt(t){Ve.error("An error occurred:",t)}function Ndt(t){Ve.debug("Received HTTP response from server:",t)}function $dt(t){var e;return(e=t.contentType)!=null&&e.startsWith("image")?y.jsx("img",{src:t.url,alt:t.name||"Attachment",className:"object-contain rounded-sm",width:100,height:100}):y.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-background hover:underline",children:t.name||"Attachment"})}function Idt(t){return{label:`/${t}`,displayLabel:t,apply:t}}function Qdt(){}function Ldt(t){return t.name}function zdt(t){return t.preventDefault()}function Vdt(t,e){return t[e[1]]="",t}function qdt(t){return t==null||t.trim()===""}const Fdt=lu("marimo-chatbot").withData(Qe({prompts:Wt(Pe()).default(Lc.EMPTY),showConfigurationControls:pt(),maxHeight:yt().optional(),config:Qe({max_tokens:yt().default(100),temperature:yt().default(.5),top_p:yt().default(1),top_k:yt().default(40),frequency_penalty:yt().default(0),presence_penalty:yt().default(0)}),allowAttachments:or([pt(),Pe().array()])})).withFunctions({get_chat_history:_i.input(Qe({})).output(Qe({messages:Wt(Qe({role:un(["system","user","assistant"]),content:Pe()}))})),delete_chat_history:_i.input(Qe({})).output(fp()),delete_chat_message:_i.input(Qe({index:yt()})).output(fp()),send_prompt:_i.input(Qe({messages:Wt(Qe({role:un(["system","user","assistant"]),content:Pe(),attachments:Wt(Qe({name:Pe().optional(),contentType:Pe().optional(),url:Pe()})).optional()})),config:Qe({max_tokens:yt(),temperature:yt(),top_p:yt(),top_k:yt(),frequency_penalty:yt(),presence_penalty:yt()})})).output(Pe())}).renderer(t=>{var e;return y.jsx(za,{children:y.jsx(Pdt,{prompts:t.data.prompts,showConfigurationControls:t.data.showConfigurationControls,maxHeight:t.data.maxHeight,allowAttachments:t.data.allowAttachments,config:t.data.config,get_chat_history:t.functions.get_chat_history,delete_chat_history:t.functions.delete_chat_history,delete_chat_message:t.functions.delete_chat_message,send_prompt:t.functions.send_prompt,value:((e=t.value)==null?void 0:e.messages)||Lc.EMPTY,setValue:n=>t.setValue({messages:n})})})}),lje=t=>{const e=ue.c(14),{wrapperClassName:n,className:r,pageSize:o}=t,i=o===void 0?10:o;let a;e[0]!==n?(a=we(n,"flex flex-col space-y-2"),e[0]=n,e[1]=a):a=e[1];const s=r||"rounded-md border";let l,c,u,d,f,h;return e[2]!==s?(l=we(s),e[2]=s,e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(mO,{children:Array.from({length:1}).map(Wdt)}),e[4]=c):c=e[4],e[5]!==i?(u=y.jsxs(iy,{children:[c,y.jsx(gO,{children:Array.from({length:i}).map(Zdt)})]}),e[5]=i,e[6]=u):u=e[6],e[7]!==l||e[8]!==u?(d=y.jsx("div",{className:l,children:u}),e[7]=l,e[8]=u,e[9]=d):d=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx("div",{className:"flex align-items justify-between flex-shrink-0 h-8"}),e[10]=f):f=e[10],e[11]!==a||e[12]!==d?(h=y.jsxs("div",{className:a,children:[d,f]}),e[11]=a,e[12]=d,e[13]=h):h=e[13],h};function Bdt(t,e){return y.jsx(oy,{children:y.jsx("div",{className:"h-4 bg-[var(--slate-5)] animate-pulse rounded-md w-[70%]"})},e)}function Wdt(t,e){return y.jsx(Rc,{children:Array.from({length:8}).map(Bdt)},e)}function Udt(t,e){return y.jsx(jc,{children:y.jsx("div",{className:"h-4 bg-[var(--slate-5)] animate-pulse rounded-md w-[90%]"})},e)}function Zdt(t,e){return y.jsx(Rc,{children:Array.from({length:8}).map(Udt)},e)}const r4=["string","boolean","integer","number","date","datetime","time","unknown"];wO=function(t){return t.Insert="insert",t.Remove="remove",t.Rename="rename",t}({});function Xdt(t){return t&&Object.keys(t).length!==0?cr.mapValues(t,e=>e==="date"||e==="time"?"string":e==="datetime"?"date":e):"auto"}const Hdt=ge.lazy(()=>Be(()=>import("./glide-data-editor-pzhfToMd.js").then(async t=>(await t.__tla,t)).then(t=>t.g),__vite__mapDeps([132,122,133]),import.meta.url)),Ydt=lu("marimo-data-editor",{cssStyles:['.gdg-r17m35ur{background-color:var(--gdg-bg-header-has-focus);border:none;border-radius:9px;box-shadow:0 0 0 1px var(--gdg-border-color);color:var(--gdg-text-group-header);flex-grow:1;font:var(--gdg-header-font-style) var(--gdg-font-family);min-height:var(--r17m35ur-0);outline:none;padding:0 8px}.gdg-c1tqibwd{align-items:center;background-color:var(--gdg-bg-header);display:flex;padding:0 8px}.gdg-wmyidgi{direction:ltr;height:var(--wmyidgi-1);max-height:100%;max-width:100%;min-height:10px;min-width:10px;overflow:hidden;overflow:clip;position:relative;width:var(--wmyidgi-0)}.gdg-wmyidgi>:first-child{height:100%;left:0;position:absolute;top:0;width:100%}.gdg-seveqep{animation:gdg-search-fadein-gdg-seveqep .15s forwards;background-color:var(--gdg-bg-cell);border:1px solid var(--gdg-border-color);border-radius:6px;color:var(--gdg-text-dark);font-size:var(--gdg-editor-font-size);padding:8px;position:absolute;right:20px;top:4px}.gdg-seveqep.out{animation:gdg-search-fadeout-gdg-seveqep .15s forwards}.gdg-seveqep .gdg-search-bar-inner{display:flex}.gdg-seveqep .gdg-search-status{font-size:11px;padding-top:4px}.gdg-seveqep .gdg-search-progress{background-color:var(--gdg-text-light);bottom:0;height:4px;left:0;position:absolute}.gdg-seveqep input{background-color:var(--gdg-bg-cell);border:0;color:var(--gdg-textDark);outline:none;width:220px}.gdg-seveqep button{align-items:center;background:none;border:none;color:var(--gdg-text-medium);cursor:pointer;display:flex;height:24px;justify-content:center;outline:none;padding:0;width:24px}.gdg-seveqep button:hover{color:var(--gdg-text-dark)}.gdg-seveqep button .button-icon{height:16px;width:16px}.gdg-seveqep button:disabled{opacity:.4;pointer-events:none}@keyframes gdg-search-fadeout-gdg-seveqep{0%{transform:translate(0)}to{transform:translate(400px)}}@keyframes gdg-search-fadein-gdg-seveqep{0%{transform:translate(400px)}to{transform:translate(0)}}.gdg-d19meir1{box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;position:absolute;--overlay-top:var(--d19meir1-0);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);left:var(--d19meir1-1);max-height:calc(100vh - var(--d19meir1-4));max-width:400px;min-height:var(--d19meir1-3);min-width:var(--d19meir1-2);text-align:start;top:var(--d19meir1-0);width:-moz-max-content;width:max-content}@keyframes glide_fade_in-gdg-d19meir1{0%{opacity:0}to{opacity:100%}}.gdg-d19meir1.gdg-style{animation:glide_fade_in-gdg-d19meir1 60ms 1;background-color:var(--gdg-bg-cell);border-radius:2px;box-shadow:0 0 0 1px var(--gdg-accent-color),0 0 1px #3e415666,0 6px 12px #3e415626}.gdg-d19meir1.gdg-pad{padding:var(--d19meir1-5) 8.5px 3px}.gdg-d19meir1 .gdg-clip-region{border-radius:2px;display:flex;flex-direction:column;flex-grow:1;overflow-x:hidden;overflow-y:auto}.gdg-d19meir1 .gdg-clip-region .gdg-growing-entry{height:100%}.gdg-d19meir1 .gdg-clip-region input.gdg-input{border:0;outline:none;width:100%}.gdg-d19meir1 .gdg-clip-region textarea.gdg-input{border:0;outline:none}.gdg-i2iowwq{display:flex;height:100%}.gdg-i2iowwq .gdg-centering-container{align-items:center;display:flex;height:100%;justify-content:center}.gdg-i2iowwq .gdg-centering-container canvas,.gdg-i2iowwq .gdg-centering-container img{max-height:calc(100vh - var(--overlay-top) - 20px);-o-object-fit:contain;object-fit:contain;-webkit-user-select:none;-moz-user-select:none;user-select:none}.gdg-i2iowwq .gdg-centering-container canvas{max-width:380px}.gdg-i2iowwq .gdg-edit-icon{align-items:center;color:var(--gdg-accent-color);cursor:pointer;display:flex;height:48px;justify-content:center;position:absolute;right:0;top:12px;width:48px}.gdg-i2iowwq .gdg-edit-icon>*{height:24px;width:24px}.gdg-i2iowwq textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.gdg-u1rrojo{align-items:center;display:flex;flex-grow:1;min-height:21px}.gdg-u1rrojo .gdg-link-area{color:var(--gdg-link-color);cursor:pointer;flex-grow:1;flex-shrink:1;margin-right:8px;overflow:hidden;text-decoration:underline!important;text-overflow:ellipsis;white-space:nowrap}.gdg-u1rrojo .gdg-edit-icon{align-items:center;color:var(--gdg-accent-color);cursor:pointer;display:flex;flex-shrink:0;justify-content:center;width:32px}.gdg-u1rrojo .gdg-edit-icon>*{height:24px;width:24px}.gdg-u1rrojo textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.gdg-d4zsq0x{display:flex;flex-wrap:wrap}.gdg-d4zsq0x .doe-bubble{align-items:center;background-color:var(--gdg-bg-cell);border-radius:var(--gdg-rounding-radius,6px);box-shadow:0 0 1px #3e415666,0 1px 3px #3e415666;color:var(--gdg-text-dark);display:flex;height:24px;justify-content:center;margin:2px;padding:0 8px}.gdg-d4zsq0x .doe-bubble img{height:16px;margin-right:4px;-o-object-fit:contain;object-fit:contain}.gdg-d4zsq0x textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.gdg-b1ygi5by{display:flex;flex-wrap:wrap;margin-bottom:auto;margin-top:auto;overflow:auto}.gdg-b1ygi5by .boe-bubble{align-items:center;background-color:var(--gdg-bg-bubble);border-radius:var(--gdg-rounding-radius,calc(var(--gdg-bubble-height)/2));color:var(--gdg-text-dark);display:flex;height:var(--gdg-bubble-height);justify-content:center;margin:var(--gdg-bubble-margin);padding:0 var(--gdg-bubble-padding);white-space:nowrap}.gdg-b1ygi5by textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.gdg-n15fjm3e{color:var(--gdg-text-dark);display:flex;margin:6px 0 3px}.gdg-n15fjm3e>input{background-color:var(--gdg-bg-cell);color:var(--gdg-text-dark);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);padding:0}.gdg-m1pnx84e{align-items:flex-start;color:var(--gdg-text-dark);display:flex;justify-content:space-between;min-width:var(--m1pnx84e-0);position:relative;width:100%}.gdg-m1pnx84e .gdg-g1y0xocz{flex-shrink:1;min-width:0}.gdg-m1pnx84e .gdg-spacer{flex:1}.gdg-m1pnx84e .gdg-edit-icon{align-items:center;border-radius:6px;color:var(--gdg-accent-color);cursor:pointer;display:flex;flex-shrink:0;height:24px;justify-content:center;padding:0;position:relative;transition:all "0.125s ease";width:24px}.gdg-m1pnx84e .gdg-edit-icon>*{height:16px;width:16px}.gdg-m1pnx84e .gdg-edit-hover :hover{background-color:var(--gdg-accent-light);transition:background-color .15s}.gdg-m1pnx84e .gdg-checkmark-hover :hover{background-color:var(--gdg-accent-color);color:#fff}.gdg-m1pnx84e .gdg-md-edit-textarea{height:0;left:0;margin-top:25px;opacity:0;padding:0;position:relative;top:0;width:0}.gdg-m1pnx84e .gdg-ml-6{margin-left:6px}.gdg-izpuzkl{background-color:transparent;border:0;border-radius:0;font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);height:100%;inset:0;line-height:16px;min-width:100%;overflow:hidden;position:absolute;resize:none;white-space:pre-wrap;width:100%;-webkit-text-fill-color:var(--gdg-text-dark);color:var(--gdg-text-dark);margin:0;padding:0}.gdg-invalid .gdg-izpuzkl{text-decoration:underline;text-decoration-color:#d60606}.gdg-izpuzkl ::-moz-placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl ::placeholder{color:var(--gdg-text-light)}.gdg-s69h75o{visibility:hidden;white-space:pre-wrap;word-wrap:break-word;color:var(--gdg-text-dark);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);line-height:16px;margin:0;max-width:100%;min-width:100%;padding:0 0 2px;width:-moz-max-content;width:max-content}.gdg-g1y0xocz{margin-top:6px;position:relative}.gdg-s1dgczr6 .dvn-scroller{overflow:var(--s1dgczr6-0);transform:translateZ(0)}.gdg-s1dgczr6 .dvn-hidden{visibility:hidden}.gdg-s1dgczr6 .dvn-scroll-inner{display:flex;pointer-events:none}.gdg-s1dgczr6 .dvn-scroll-inner>*{flex-shrink:0}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-spacer{flex-grow:1}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-stack{display:flex;flex-direction:column}.gdg-s1dgczr6 .dvn-underlay>*{left:0;position:absolute;top:0}.gdg-s1dgczr6 canvas{outline:none}.gdg-s1dgczr6 canvas *{height:0}.gdg-mnuv029{word-break:break-word;-webkit-touch-callout:default;padding-top:6px}.gdg-mnuv029>*{margin:0}.gdg-mnuv029 :last-child{margin-bottom:0}.gdg-mnuv029 p img{width:100%}']}).withData(Qe({initialValue:Qe({edits:Wt(Qe({rowIdx:yt(),columnId:Pe(),value:lp()}))}),label:Pe().nullable(),data:or([Pe(),Wt(Qe({}).passthrough())]),fieldTypes:Wt(sf([hy.string(),sf([un(r4),Pe()])])).nullish(),columnSizingMode:un(["auto","fit"]).default("auto")})).withFunctions({}).renderer(t=>y.jsx(zO,{children:y.jsx(Gdt,{data:t.data.data,fieldTypes:t.data.fieldTypes,edits:t.value,onEdits:t.setValue,columnSizingMode:t.data.columnSizingMode,host:t.host})})),Gdt=t=>{const e=ue.c(30);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];const[r,o]=_.useState(n);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={},e[1]=i):i=e[1];const[a,s]=_.useState(i);let l,c;e[2]!==t.data||e[3]!==t.fieldTypes?(l=async()=>{const O=uz(t.fieldTypes??[]),k=Array.isArray(t.data)?t.data:await M_(t.data,{type:"csv",parse:Xdt(O)},{handleBigIntAndNumberLike:!0});o(k),s(uz(t.fieldTypes??Aj(k)))},c=[t.fieldTypes,t.data],e[2]=t.data,e[3]=t.fieldTypes,e[4]=l,e[5]=c):(l=e[4],c=e[5]);const{error:u}=$a(l,c);if(u){let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(Lv,{children:"Error"}),e[6]=O):O=e[6];const k=u.message||"An unknown error occurred";let S;return e[7]!==k?(S=y.jsxs(Qv,{variant:"destructive",className:"mb-2",children:[O,y.jsx("div",{className:"text-md",children:k})]}),e[7]=k,e[8]=S):S=e[8],S}if(!r){let O;return e[9]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx($_,{milliseconds:200,children:y.jsx(lje,{pageSize:10})}),e[9]=O):O=e[9],O}let d,f,h,g,v,b,p;return e[10]!==t?(d=O=>{t.onEdits(k=>({...k,edits:[...k.edits,...O]}))},e[10]=t,e[11]=d):d=e[11],e[12]!==r||e[13]!==t?(f=O=>{const k=O.flatMap((S,w)=>Object.entries(S).map(T=>{const[P,j]=T;return{rowIdx:r.length+w,columnId:P,value:j}}));t.onEdits(S=>({...S,edits:[...S.edits,...k]}))},e[12]=r,e[13]=t,e[14]=f):f=e[14],e[15]!==t?(h=O=>{t.onEdits(k=>{const S=O.map(Kdt);return{...k,edits:[...k.edits,...S]}})},g=(O,k)=>{t.onEdits(S=>({...S,edits:[...S.edits,{columnIdx:O,newName:k,type:wO.Rename}]}))},v=O=>{t.onEdits(k=>({...k,edits:[...k.edits,{columnIdx:O,type:wO.Remove}]}))},b=(O,k)=>{t.onEdits(S=>({...S,edits:[...S.edits,{columnIdx:O,newName:k,type:wO.Insert}]}))},e[15]=t,e[16]=h,e[17]=g,e[18]=v,e[19]=b):(h=e[16],g=e[17],v=e[18],b=e[19]),e[20]!==a||e[21]!==r||e[22]!==t.edits.edits||e[23]!==d||e[24]!==f||e[25]!==h||e[26]!==g||e[27]!==v||e[28]!==b?(p=y.jsx(Hdt,{data:r,setData:o,columnFields:a,setColumnFields:s,edits:t.edits.edits,onAddEdits:d,onAddRows:f,onDeleteRows:h,onRenameColumn:g,onDeleteColumn:v,onAddColumn:b}),e[20]=a,e[21]=r,e[22]=t.edits.edits,e[23]=d,e[24]=f,e[25]=h,e[26]=g,e[27]=v,e[28]=b,e[29]=p):p=e[29],p};function Kdt(t,e){return{rowIdx:t-e,type:wO.Remove}}var lC=t=>t.type==="checkbox",J0=t=>t instanceof Date,es=t=>t==null;const cje=t=>typeof t=="object";var pi=t=>!es(t)&&!Array.isArray(t)&&cje(t)&&!J0(t),uje=t=>pi(t)&&t.target?lC(t.target)?t.target.checked:t.target.value:t,dje=(t,e)=>t.has((n=>n.substring(0,n.search(/\.\d+(\.|$)/))||n)(e)),CW=typeof window<"u"&&window.HTMLElement!==void 0&&typeof document<"u";function Fi(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"&&t instanceof FileList;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else{if(CW&&(t instanceof Blob||r)||!n&&!pi(t))return t;if(e=n?[]:{},n||(o=>{const i=o.constructor&&o.constructor.prototype;return pi(i)&&i.hasOwnProperty("isPrototypeOf")})(t))for(const o in t)t.hasOwnProperty(o)&&(e[o]=Fi(t[o]));else e=t}return e}var cC=t=>Array.isArray(t)?t.filter(Boolean):[],wo=t=>t===void 0,jt=(t,e,n)=>{if(!e||!pi(t))return n;const r=cC(e.split(/[,[\].]+?/)).reduce((o,i)=>es(o)?o:o[i],t);return wo(r)||r===t?wo(t[e])?n:t[e]:r},uc=t=>typeof t=="boolean",_W=t=>/^\w*$/.test(t),fje=t=>cC(t.replace(/["|']|\]/g,"").split(/\.|\[/)),br=(t,e,n)=>{let r=-1;const o=_W(e)?[e]:fje(e),i=o.length,a=i-1;for(;++r<i;){const s=o[r];let l=n;if(r!==a){const c=t[s];l=pi(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;t[s]=l,t=t[s]}return t};const hje="blur",Jdt="focusout",eft="change",tft="onBlur",pje="onChange",mje="onSubmit",nft="onTouched",Wb="all",rft="max",oft="min",ift="maxLength",aft="minLength",gje="pattern",vje="required",sft="validate",yje=ge.createContext(null),mo=()=>ge.useContext(yje),bje=t=>{const{children:e,...n}=t;return ge.createElement(yje.Provider,{value:n},e)};var xje=(t,e,n,r=!0)=>{const o={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(o,i,{get:()=>{const a=i;return e._proxyFormState[a]!==Wb&&(e._proxyFormState[a]=!r||Wb),n&&(n[a]=!0),t[a]}});return o},ts=t=>pi(t)&&!Object.keys(t).length,Oje=(t,e,n,r)=>{n(t);const{name:o,...i}=t;return ts(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(a=>e[a]===(!r||Wb))},As=t=>Array.isArray(t)?t:[t],wje=(t,e,n)=>!t||!e||t===e||As(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function o4(t){const e=ge.useRef(t);e.current=t,ge.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}var Rd=t=>typeof t=="string",kje=(t,e,n,r,o)=>Rd(t)?(r&&e.watch.add(t),jt(n,t,o)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),jt(n,i))):(r&&(e.watchAll=!0),n);function cu(t){const e=mo(),{control:n=e.control,name:r,defaultValue:o,disabled:i,exact:a}=t||{},s=ge.useRef(r);s.current=r,o4({disabled:i,subject:n._subjects.values,next:u=>{wje(s.current,u.name,a)&&c(Fi(kje(s.current,n._names,u.values||n._formValues,!1,o)))}});const[l,c]=ge.useState(n._getWatch(r,o));return ge.useEffect(()=>n._removeUnmounted()),l}function lft(t){const e=mo(),{name:n,disabled:r,control:o=e.control,shouldUnregister:i}=t,a=dje(o._names.array,n),s=cu({control:o,name:n,defaultValue:jt(o._formValues,n,jt(o._defaultValues,n,t.defaultValue)),exact:!0}),l=function(f){const h=mo(),{control:g=h.control,disabled:v,name:b,exact:p}=f||{},[O,k]=ge.useState(g._formState),S=ge.useRef(!0),w=ge.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),T=ge.useRef(b);return T.current=b,o4({disabled:v,next:P=>S.current&&wje(T.current,P.name,p)&&Oje(P,w.current,g._updateFormState)&&k({...g._formState,...P}),subject:g._subjects.state}),ge.useEffect(()=>(S.current=!0,w.current.isValid&&g._updateValid(!0),()=>{S.current=!1}),[g]),ge.useMemo(()=>xje(O,g,w.current,!1),[O,g])}({control:o,name:n,exact:!0}),c=ge.useRef(o.register(n,{...t.rules,value:s,...uc(t.disabled)?{disabled:t.disabled}:{}})),u=ge.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!jt(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!jt(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!jt(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!jt(l.validatingFields,n)},error:{enumerable:!0,get:()=>jt(l.errors,n)}}),[l,n]),d=ge.useMemo(()=>({name:n,value:s,...uc(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:f=>c.current.onChange({target:{value:uje(f),name:n},type:eft}),onBlur:()=>c.current.onBlur({target:{value:jt(o._formValues,n),name:n},type:hje}),ref:f=>{const h=jt(o._fields,n);h&&f&&(h._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:g=>f.setCustomValidity(g),reportValidity:()=>f.reportValidity()})}}),[n,o._formValues,r,l.disabled,s,o._fields]);return ge.useEffect(()=>{const f=o._options.shouldUnregister||i,h=(g,v)=>{const b=jt(o._fields,g);b&&b._f&&(b._f.mount=v)};if(h(n,!0),f){const g=Fi(jt(o._options.defaultValues,n));br(o._defaultValues,n,g),wo(jt(o._formValues,n))&&br(o._formValues,n,g)}return!a&&o.register(n),()=>{(a?f&&!o._state.action:f)?o.unregister(n):h(n,!1)}},[n,o,a,i]),ge.useEffect(()=>{o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),ge.useMemo(()=>({field:d,formState:l,fieldState:u}),[d,l,u])}const cft=t=>t.render(lft(t));var Sje=(t,e,n,r,o)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:o||!0}}:{},ym=()=>{const t=typeof performance>"u"?Date.now():1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(16*Math.random()+t)%16|0;return(e=="x"?n:3&n|8).toString(16)})},TW=(t,e,n={})=>n.shouldFocus||wo(n.shouldFocus)?n.focusName||`${t}.${wo(n.focusIndex)?e:n.focusIndex}.`:"",uC=t=>({isOnSubmit:!t||t===mje,isOnBlur:t===tft,isOnChange:t===pje,isOnAll:t===Wb,isOnTouch:t===nft}),PW=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Ub=(t,e,n,r)=>{for(const o of n||Object.keys(t)){const i=jt(t,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],o)&&!r||a.ref&&e(a.ref,a.name)&&!r)return!0;if(Ub(s,e))break}else if(pi(s)&&Ub(s,e))break}}};var Cje=(t,e,n)=>{const r=As(jt(t,n));return br(r,"root",e[n]),br(t,n,r),t},EW=t=>t.type==="file",jd=t=>typeof t=="function",i4=t=>{if(!CW)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},a4=t=>Rd(t),RW=t=>t.type==="radio",s4=t=>t instanceof RegExp;const _je={value:!1,isValid:!1},Tje={value:!0,isValid:!0};var Pje=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!wo(t[0].attributes.value)?wo(t[0].value)||t[0].value===""?Tje:{value:t[0].value,isValid:!0}:Tje:_je}return _je};const Eje={isValid:!1,value:null};var Rje=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,Eje):Eje;function jje(t,e,n="validate"){if(a4(t)||Array.isArray(t)&&t.every(a4)||uc(t)&&!t)return{type:n,message:a4(t)?t:"",ref:e}}var Zb=t=>pi(t)&&!s4(t)?t:{value:t,message:""},jW=async(t,e,n,r,o,i)=>{const{ref:a,refs:s,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:g,name:v,valueAsNumber:b,mount:p}=t._f,O=jt(n,v);if(!p||e.has(v))return{};const k=s?s[0]:a,S=A=>{o&&k.reportValidity&&(k.setCustomValidity(uc(A)?"":A||""),k.reportValidity())},w={},T=RW(a),P=lC(a),j=T||P,D=(b||EW(a))&&wo(a.value)&&wo(O)||i4(a)&&a.value===""||O===""||Array.isArray(O)&&!O.length,N=Sje.bind(null,v,r,w),E=(A,I,L,F=ift,Q=aft)=>{const W=A?I:L;w[v]={type:A?F:Q,message:W,ref:a,...N(A?F:Q,W)}};if(i?!Array.isArray(O)||!O.length:l&&(!j&&(D||es(O))||uc(O)&&!O||P&&!Pje(s).isValid||T&&!Rje(s).isValid)){const{value:A,message:I}=a4(l)?{value:!!l,message:l}:Zb(l);if(A&&(w[v]={type:vje,message:I,ref:k,...N(vje,I)},!r))return S(I),w}if(!(D||es(d)&&es(f))){let A,I;const L=Zb(f),F=Zb(d);if(es(O)||isNaN(O)){const Q=a.valueAsDate||new Date(O),W=G=>new Date(new Date().toDateString()+" "+G),U=a.type=="time",X=a.type=="week";Rd(L.value)&&O&&(A=U?W(O)>W(L.value):X?O>L.value:Q>new Date(L.value)),Rd(F.value)&&O&&(I=U?W(O)<W(F.value):X?O<F.value:Q<new Date(F.value))}else{const Q=a.valueAsNumber||O&&+O;es(L.value)||(A=Q>L.value),es(F.value)||(I=Q<F.value)}if((A||I)&&(E(!!A,L.message,F.message,rft,oft),!r))return S(w[v].message),w}if((c||u)&&!D&&(Rd(O)||i&&Array.isArray(O))){const A=Zb(c),I=Zb(u),L=!es(A.value)&&O.length>+A.value,F=!es(I.value)&&O.length<+I.value;if((L||F)&&(E(L,A.message,I.message),!r))return S(w[v].message),w}if(h&&!D&&Rd(O)){const{value:A,message:I}=Zb(h);if(s4(A)&&!O.match(A)&&(w[v]={type:gje,message:I,ref:a,...N(gje,I)},!r))return S(I),w}if(g){if(jd(g)){const A=jje(await g(O,n),k);if(A&&(w[v]={...A,...N(sft,A.message)},!r))return S(A.message),w}else if(pi(g)){let A={};for(const I in g){if(!ts(A)&&!r)break;const L=jje(await g[I](O,n),k,I);L&&(A={...L,...N(I,L.message)},S(L.message),r&&(w[v]=A))}if(!ts(A)&&(w[v]={ref:k,...A},!r))return w}}return S(!0),w},DW=(t,e)=>[...t,...As(e)],AW=t=>Array.isArray(t)?t.map(()=>{}):void 0;function MW(t,e,n){return[...t.slice(0,e),...As(n),...t.slice(e)]}var NW=(t,e,n)=>Array.isArray(t)?(wo(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(e,1)[0]),t):[],$W=(t,e)=>[...As(e),...As(t)],IW=(t,e)=>wo(e)?[]:function(n,r){let o=0;const i=[...n];for(const a of r)i.splice(a-o,1),o++;return cC(i).length?i:[]}(t,As(e).sort((n,r)=>n-r)),QW=(t,e,n)=>{[t[e],t[n]]=[t[n],t[e]]};function Ti(t,e){const n=Array.isArray(e)?e:_W(e)?[e]:fje(e),r=n.length===1?t:function(a,s){const l=s.slice(0,-1).length;let c=0;for(;c<l;)a=wo(a)?c++:a[s[c++]];return a}(t,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(pi(r)&&ts(r)||Array.isArray(r)&&function(a){for(const s in a)if(a.hasOwnProperty(s)&&!wo(a[s]))return!1;return!0}(r))&&Ti(t,n.slice(0,-1)),t}var Dje=(t,e,n)=>(t[e]=n,t);function Aje(t){const e=mo(),{control:n=e.control,name:r,keyName:o="id",shouldUnregister:i,rules:a}=t,[s,l]=ge.useState(n._getFieldArray(r)),c=ge.useRef(n._getFieldArray(r).map(ym)),u=ge.useRef(s),d=ge.useRef(r),f=ge.useRef(!1);d.current=r,u.current=s,n._names.array.add(r),a&&n.register(r,a),o4({next:({values:g,name:v})=>{if(v===d.current||!v){const b=jt(g,d.current);Array.isArray(b)&&(l(b),c.current=b.map(ym))}},subject:n._subjects.array});const h=ge.useCallback(g=>{f.current=!0,n._updateFieldArray(r,g)},[n,r]);return ge.useEffect(()=>{if(n._state.action=!1,PW(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!uC(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(g=>{const v=jt(g.errors,r),b=jt(n._formState.errors,r);(b?!v&&b.type||v&&(b.type!==v.type||b.message!==v.message):v&&v.type)&&(v?br(n._formState.errors,r,v):Ti(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const g=jt(n._fields,r);!g||!g._f||uC(n._options.reValidateMode).isOnSubmit&&uC(n._options.mode).isOnSubmit||jW(g,n._names.disabled,n._formValues,n._options.criteriaMode===Wb,n._options.shouldUseNativeValidation,!0).then(v=>!ts(v)&&n._subjects.state.next({errors:Cje(n._formState.errors,v,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&Ub(n._fields,(g,v)=>{if(n._names.focus&&v.startsWith(n._names.focus)&&g.focus)return g.focus(),1}),n._names.focus="",n._updateValid(),f.current=!1},[s,r,n]),ge.useEffect(()=>(!jt(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||i)&&n.unregister(r)}),[r,n,o,i]),{swap:ge.useCallback((g,v)=>{const b=n._getFieldArray(r);QW(b,g,v),QW(c.current,g,v),h(b),l(b),n._updateFieldArray(r,b,QW,{argA:g,argB:v},!1)},[h,r,n]),move:ge.useCallback((g,v)=>{const b=n._getFieldArray(r);NW(b,g,v),NW(c.current,g,v),h(b),l(b),n._updateFieldArray(r,b,NW,{argA:g,argB:v},!1)},[h,r,n]),prepend:ge.useCallback((g,v)=>{const b=As(Fi(g)),p=$W(n._getFieldArray(r),b);n._names.focus=TW(r,0,v),c.current=$W(c.current,b.map(ym)),h(p),l(p),n._updateFieldArray(r,p,$W,{argA:AW(g)})},[h,r,n]),append:ge.useCallback((g,v)=>{const b=As(Fi(g)),p=DW(n._getFieldArray(r),b);n._names.focus=TW(r,p.length-1,v),c.current=DW(c.current,b.map(ym)),h(p),l(p),n._updateFieldArray(r,p,DW,{argA:AW(g)})},[h,r,n]),remove:ge.useCallback(g=>{const v=IW(n._getFieldArray(r),g);c.current=IW(c.current,g),h(v),l(v),!Array.isArray(jt(n._fields,r))&&br(n._fields,r,void 0),n._updateFieldArray(r,v,IW,{argA:g})},[h,r,n]),insert:ge.useCallback((g,v,b)=>{const p=As(Fi(v)),O=MW(n._getFieldArray(r),g,p);n._names.focus=TW(r,g,b),c.current=MW(c.current,g,p.map(ym)),h(O),l(O),n._updateFieldArray(r,O,MW,{argA:g,argB:AW(v)})},[h,r,n]),update:ge.useCallback((g,v)=>{const b=Fi(v),p=Dje(n._getFieldArray(r),g,b);c.current=[...p].map((O,k)=>O&&k!==g?c.current[k]:ym()),h(p),l([...p]),n._updateFieldArray(r,p,Dje,{argA:g,argB:b},!0,!1)},[h,r,n]),replace:ge.useCallback(g=>{const v=As(Fi(g));c.current=v.map(ym),h([...v]),l([...v]),n._updateFieldArray(r,[...v],b=>b,{},!0,!1)},[h,r,n]),fields:ge.useMemo(()=>s.map((g,v)=>({...g,[o]:c.current[v]||ym()})),[s,o])}}var LW=()=>{let t=[];return{get observers(){return t},next:e=>{for(const n of t)n.next&&n.next(e)},subscribe:e=>(t.push(e),{unsubscribe:()=>{t=t.filter(n=>n!==e)}}),unsubscribe:()=>{t=[]}}},zW=t=>es(t)||!cje(t);function bm(t,e){if(zW(t)||zW(e))return t===e;if(J0(t)&&J0(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n){const i=t[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=e[o];if(J0(i)&&J0(a)||pi(i)&&pi(a)||Array.isArray(i)&&Array.isArray(a)?!bm(i,a):i!==a)return!1}}return!0}var Mje=t=>t.type==="select-multiple",VW=t=>i4(t)&&t.isConnected,Nje=t=>{for(const e in t)if(jd(t[e]))return!0;return!1};function l4(t,e={}){const n=Array.isArray(t);if(pi(t)||n)for(const r in t)Array.isArray(t[r])||pi(t[r])&&!Nje(t[r])?(e[r]=Array.isArray(t[r])?[]:{},l4(t[r],e[r])):es(t[r])||(e[r]=!0);return e}function $je(t,e,n){const r=Array.isArray(t);if(pi(t)||r)for(const o in t)Array.isArray(t[o])||pi(t[o])&&!Nje(t[o])?wo(e)||zW(n[o])?n[o]=Array.isArray(t[o])?l4(t[o],[]):{...l4(t[o])}:$je(t[o],es(e)?{}:e[o],n[o]):n[o]=!bm(t[o],e[o]);return n}var dC=(t,e)=>$je(t,e,l4(e)),Ije=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>wo(t)?t:e?t===""?NaN:t&&+t:n&&Rd(t)?new Date(t):r?r(t):t;function qW(t){const e=t.ref;return EW(e)?e.files:RW(e)?Rje(t.refs).value:Mje(e)?[...e.selectedOptions].map(({value:n})=>n):lC(e)?Pje(t.refs).value:Ije(wo(e.value)?t.ref.value:e.value,t)}var fC=t=>wo(t)?t:s4(t)?t.source:pi(t)?s4(t.value)?t.value.source:t.value:t;const Qje="AsyncFunction";var uft=t=>!!t&&!!t.validate&&!!(jd(t.validate)&&t.validate.constructor.name===Qje||pi(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===Qje));function Lje(t,e,n){const r=jt(t,n);if(r||_W(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=jt(e,i),s=jt(t,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(s&&s.type)return{name:i,error:s};o.pop()}return{name:n}}const dft={mode:mje,reValidateMode:pje,shouldFocusError:!0};function fft(t={}){let e,n={...dft,...t},r={submitCount:0,isDirty:!1,isLoading:jd(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},o={},i=(pi(n.defaultValues)||pi(n.values))&&Fi(n.defaultValues||n.values)||{},a=n.shouldUnregister?{}:Fi(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:LW(),array:LW(),state:LW()},f=uC(n.mode),h=uC(n.reValidateMode),g=n.criteriaMode===Wb,v=async Z=>{if(!n.disabled&&(u.isValid||Z)){const K=n.resolver?ts((await S()).errors):await w(o,!0);K!==r.isValid&&d.state.next({isValid:K})}},b=(Z,K)=>{n.disabled||!u.isValidating&&!u.validatingFields||((Z||Array.from(l.mount)).forEach(oe=>{oe&&(K?br(r.validatingFields,oe,K):Ti(r.validatingFields,oe))}),d.state.next({validatingFields:r.validatingFields,isValidating:!ts(r.validatingFields)}))},p=(Z,K,oe,ie)=>{const Y=jt(o,Z);if(Y){const le=jt(a,Z,wo(oe)?jt(i,Z):oe);wo(le)||ie&&ie.defaultChecked||K?br(a,Z,K?le:qW(Y._f)):j(Z,le),s.mount&&v()}},O=(Z,K,oe,ie,Y)=>{let le=!1,me=!1;const ce={name:Z};if(!n.disabled){const ve=!!(jt(o,Z)&&jt(o,Z)._f&&jt(o,Z)._f.disabled);if(!oe||ie){u.isDirty&&(me=r.isDirty,r.isDirty=ce.isDirty=T(),le=me!==ce.isDirty);const ye=ve||bm(jt(i,Z),K);me=!(ve||!jt(r.dirtyFields,Z)),ye||ve?Ti(r.dirtyFields,Z):br(r.dirtyFields,Z,!0),ce.dirtyFields=r.dirtyFields,le=le||u.dirtyFields&&me!==!ye}if(oe){const ye=jt(r.touchedFields,Z);ye||(br(r.touchedFields,Z,oe),ce.touchedFields=r.touchedFields,le=le||u.touchedFields&&ye!==oe)}le&&Y&&d.state.next(ce)}return le?ce:{}},k=(Z,K,oe,ie)=>{const Y=jt(r.errors,Z),le=u.isValid&&uc(K)&&r.isValid!==K;if(n.delayError&&oe?(e=(me=>ce=>{clearTimeout(c),c=setTimeout(me,ce)})(()=>((me,ce)=>{br(r.errors,me,ce),d.state.next({errors:r.errors})})(Z,oe)),e(n.delayError)):(clearTimeout(c),e=null,oe?br(r.errors,Z,oe):Ti(r.errors,Z)),(oe?!bm(Y,oe):Y)||!ts(ie)||le){const me={...ie,...le&&uc(K)?{isValid:K}:{},errors:r.errors,name:Z};r={...r,...me},d.state.next(me)}},S=async Z=>{b(Z,!0);const K=await n.resolver(a,n.context,((oe,ie,Y,le)=>{const me={};for(const ce of oe){const ve=jt(ie,ce);ve&&br(me,ce,ve._f)}return{criteriaMode:Y,names:[...oe],fields:me,shouldUseNativeValidation:le}})(Z||l.mount,o,n.criteriaMode,n.shouldUseNativeValidation));return b(Z),K},w=async(Z,K,oe={valid:!0})=>{for(const ie in Z){const Y=Z[ie];if(Y){const{_f:le,...me}=Y;if(le){const ce=l.array.has(le.name),ve=Y._f&&uft(Y._f);ve&&u.validatingFields&&b([ie],!0);const ye=await jW(Y,l.disabled,a,g,n.shouldUseNativeValidation&&!K,ce);if(ve&&u.validatingFields&&b([ie]),ye[le.name]&&(oe.valid=!1,K))break;!K&&(jt(ye,le.name)?ce?Cje(r.errors,ye,le.name):br(r.errors,le.name,ye[le.name]):Ti(r.errors,le.name))}!ts(me)&&await w(me,K,oe)}}return oe.valid},T=(Z,K)=>!n.disabled&&(Z&&K&&br(a,Z,K),!bm(L(),i)),P=(Z,K,oe)=>kje(Z,l,{...s.mount?a:wo(K)?i:Rd(Z)?{[Z]:K}:K},oe,K),j=(Z,K,oe={})=>{const ie=jt(o,Z);let Y=K;if(ie){const le=ie._f;le&&(!le.disabled&&br(a,Z,Ije(K,le)),Y=i4(le.ref)&&es(K)?"":K,Mje(le.ref)?[...le.ref.options].forEach(me=>me.selected=Y.includes(me.value)):le.refs?lC(le.ref)?le.refs.length>1?le.refs.forEach(me=>(!me.defaultChecked||!me.disabled)&&(me.checked=Array.isArray(Y)?!!Y.find(ce=>ce===me.value):Y===me.value)):le.refs[0]&&(le.refs[0].checked=!!Y):le.refs.forEach(me=>me.checked=me.value===Y):EW(le.ref)?le.ref.value="":(le.ref.value=Y,le.ref.type||d.values.next({name:Z,values:{...a}})))}(oe.shouldDirty||oe.shouldTouch)&&O(Z,Y,oe.shouldTouch,oe.shouldDirty,!0),oe.shouldValidate&&I(Z)},D=(Z,K,oe)=>{for(const ie in K){const Y=K[ie],le=`${Z}.${ie}`,me=jt(o,le);(l.array.has(Z)||pi(Y)||me&&!me._f)&&!J0(Y)?D(le,Y,oe):j(le,Y,oe)}},N=(Z,K,oe={})=>{const ie=jt(o,Z),Y=l.array.has(Z),le=Fi(K);br(a,Z,le),Y?(d.array.next({name:Z,values:{...a}}),(u.isDirty||u.dirtyFields)&&oe.shouldDirty&&d.state.next({name:Z,dirtyFields:dC(i,a),isDirty:T(Z,le)})):!ie||ie._f||es(le)?j(Z,le,oe):D(Z,le,oe),PW(Z,l)&&d.state.next({...r}),d.values.next({name:s.mount?Z:void 0,values:{...a}})},E=async Z=>{s.mount=!0;const K=Z.target;let oe=K.name,ie=!0;const Y=jt(o,oe),le=me=>{ie=Number.isNaN(me)||J0(me)&&isNaN(me.getTime())||bm(me,jt(a,oe,me))};if(Y){let me,ce;const ve=K.type?qW(Y._f):uje(Z),ye=Z.type===hje||Z.type===Jdt,_e=!(Ie=>Ie.mount&&(Ie.required||Ie.min||Ie.max||Ie.maxLength||Ie.minLength||Ie.pattern||Ie.validate))(Y._f)&&!n.resolver&&!jt(r.errors,oe)&&!Y._f.deps||((Ie,De,nt,Fe,kt)=>!kt.isOnAll&&(!nt&&kt.isOnTouch?!(De||Ie):(nt?Fe.isOnBlur:kt.isOnBlur)?!Ie:!(nt?Fe.isOnChange:kt.isOnChange)||Ie))(ye,jt(r.touchedFields,oe),r.isSubmitted,h,f),Se=PW(oe,l,ye);br(a,oe,ve),ye?(Y._f.onBlur&&Y._f.onBlur(Z),e&&e(0)):Y._f.onChange&&Y._f.onChange(Z);const Ae=O(oe,ve,ye,!1),je=!ts(Ae)||Se;if(!ye&&d.values.next({name:oe,type:Z.type,values:{...a}}),_e)return u.isValid&&(n.mode==="onBlur"&&ye?v():ye||v()),je&&d.state.next({name:oe,...Se?{}:Ae});if(!ye&&Se&&d.state.next({...r}),n.resolver){const{errors:Ie}=await S([oe]);if(le(ve),ie){const De=Lje(r.errors,o,oe),nt=Lje(Ie,o,De.name||oe);me=nt.error,oe=nt.name,ce=ts(Ie)}}else b([oe],!0),me=(await jW(Y,l.disabled,a,g,n.shouldUseNativeValidation))[oe],b([oe]),le(ve),ie&&(me?ce=!1:u.isValid&&(ce=await w(o,!0)));ie&&(Y._f.deps&&I(Y._f.deps),k(oe,ce,me,Ae))}},A=(Z,K)=>{if(jt(r.errors,K)&&Z.focus)return Z.focus(),1},I=async(Z,K={})=>{let oe,ie;const Y=As(Z);if(n.resolver){const le=await(async me=>{const{errors:ce}=await S(me);if(me)for(const ve of me){const ye=jt(ce,ve);ye?br(r.errors,ve,ye):Ti(r.errors,ve)}else r.errors=ce;return ce})(wo(Z)?Z:Y);oe=ts(le),ie=Z?!Y.some(me=>jt(le,me)):oe}else Z?(ie=(await Promise.all(Y.map(async le=>{const me=jt(o,le);return await w(me&&me._f?{[le]:me}:me)}))).every(Boolean),(ie||r.isValid)&&v()):ie=oe=await w(o);return d.state.next({...!Rd(Z)||u.isValid&&oe!==r.isValid?{}:{name:Z},...n.resolver||!Z?{isValid:oe}:{},errors:r.errors}),K.shouldFocus&&!ie&&Ub(o,A,Z?Y:l.mount),ie},L=Z=>{const K={...s.mount?a:i};return wo(Z)?K:Rd(Z)?jt(K,Z):Z.map(oe=>jt(K,oe))},F=(Z,K)=>({invalid:!!jt((K||r).errors,Z),isDirty:!!jt((K||r).dirtyFields,Z),error:jt((K||r).errors,Z),isValidating:!!jt(r.validatingFields,Z),isTouched:!!jt((K||r).touchedFields,Z)}),Q=(Z,K,oe)=>{const ie=(jt(o,Z,{_f:{}})._f||{}).ref,Y=jt(r.errors,Z)||{},{ref:le,message:me,type:ce,...ve}=Y;br(r.errors,Z,{...ve,...K,ref:ie}),d.state.next({name:Z,errors:r.errors,isValid:!1}),oe&&oe.shouldFocus&&ie&&ie.focus&&ie.focus()},W=(Z,K={})=>{for(const oe of Z?As(Z):l.mount)l.mount.delete(oe),l.array.delete(oe),K.keepValue||(Ti(o,oe),Ti(a,oe)),!K.keepError&&Ti(r.errors,oe),!K.keepDirty&&Ti(r.dirtyFields,oe),!K.keepTouched&&Ti(r.touchedFields,oe),!K.keepIsValidating&&Ti(r.validatingFields,oe),!n.shouldUnregister&&!K.keepDefaultValue&&Ti(i,oe);d.values.next({values:{...a}}),d.state.next({...r,...K.keepDirty?{isDirty:T()}:{}}),!K.keepIsValid&&v()},U=({disabled:Z,name:K,field:oe,fields:ie})=>{(uc(Z)&&s.mount||Z||l.disabled.has(K))&&(Z?l.disabled.add(K):l.disabled.delete(K),O(K,qW(oe?oe._f:jt(ie,K)._f),!1,!1,!0))},X=(Z,K={})=>{let oe=jt(o,Z);const ie=uc(K.disabled)||uc(n.disabled);return br(o,Z,{...oe||{},_f:{...oe&&oe._f?oe._f:{ref:{name:Z}},name:Z,mount:!0,...K}}),l.mount.add(Z),oe?U({field:oe,disabled:uc(K.disabled)?K.disabled:n.disabled,name:Z}):p(Z,!0,K.value),{...ie?{disabled:K.disabled||n.disabled}:{},...n.progressive?{required:!!K.required,min:fC(K.min),max:fC(K.max),minLength:fC(K.minLength),maxLength:fC(K.maxLength),pattern:fC(K.pattern)}:{},name:Z,onChange:E,onBlur:E,ref:Y=>{if(Y){X(Z,K),oe=jt(o,Z);const le=wo(Y.value)&&Y.querySelectorAll&&Y.querySelectorAll("input,select,textarea")[0]||Y,me=(ve=>RW(ve)||lC(ve))(le),ce=oe._f.refs||[];if(me?ce.find(ve=>ve===le):le===oe._f.ref)return;br(o,Z,{_f:{...oe._f,...me?{refs:[...ce.filter(VW),le,...Array.isArray(jt(i,Z))?[{}]:[]],ref:{type:le.type,name:Z}}:{ref:le}}}),p(Z,!1,void 0,le)}else oe=jt(o,Z,{}),oe._f&&(oe._f.mount=!1),(n.shouldUnregister||K.shouldUnregister)&&(!dje(l.array,Z)||!s.action)&&l.unMount.add(Z)}}},G=()=>n.shouldFocusError&&Ub(o,A,l.mount),ae=(Z,K)=>async oe=>{let ie;oe&&(oe.preventDefault&&oe.preventDefault(),oe.persist&&oe.persist());let Y=Fi(a);if(l.disabled.size)for(const le of l.disabled)br(Y,le,void 0);if(d.state.next({isSubmitting:!0}),n.resolver){const{errors:le,values:me}=await S();r.errors=le,Y=me}else await w(o);if(Ti(r.errors,"root"),ts(r.errors)){d.state.next({errors:{}});try{await Z(Y,oe)}catch(le){ie=le}}else K&&await K({...r.errors},oe),G(),setTimeout(G);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ts(r.errors)&&!ie,submitCount:r.submitCount+1,errors:r.errors}),ie)throw ie},ne=(Z,K={})=>{const oe=Z?Fi(Z):i,ie=Fi(oe),Y=ts(Z),le=Y?i:ie;if(K.keepDefaultValues||(i=oe),!K.keepValues){if(K.keepDirtyValues){const me=new Set([...l.mount,...Object.keys(dC(i,a))]);for(const ce of Array.from(me))jt(r.dirtyFields,ce)?br(le,ce,jt(a,ce)):N(ce,jt(le,ce))}else{if(CW&&wo(Z))for(const me of l.mount){const ce=jt(o,me);if(ce&&ce._f){const ve=Array.isArray(ce._f.refs)?ce._f.refs[0]:ce._f.ref;if(i4(ve)){const ye=ve.closest("form");if(ye){ye.reset();break}}}}o={}}a=n.shouldUnregister?K.keepDefaultValues?Fi(i):{}:Fi(le),d.array.next({values:{...le}}),d.values.next({values:{...le}})}l={mount:K.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!K.keepIsValid||!!K.keepDirtyValues,s.watch=!!n.shouldUnregister,d.state.next({submitCount:K.keepSubmitCount?r.submitCount:0,isDirty:!Y&&(K.keepDirty?r.isDirty:!(!K.keepDefaultValues||bm(Z,i))),isSubmitted:!!K.keepIsSubmitted&&r.isSubmitted,dirtyFields:Y?{}:K.keepDirtyValues?K.keepDefaultValues&&a?dC(i,a):r.dirtyFields:K.keepDefaultValues&&Z?dC(i,Z):K.keepDirty?r.dirtyFields:{},touchedFields:K.keepTouched?r.touchedFields:{},errors:K.keepErrors?r.errors:{},isSubmitSuccessful:!!K.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1})},re=(Z,K)=>ne(jd(Z)?Z(a):Z,K);return{control:{register:X,unregister:W,getFieldState:F,handleSubmit:ae,setError:Q,_executeSchema:S,_getWatch:P,_getDirty:T,_updateValid:v,_removeUnmounted:()=>{for(const Z of l.unMount){const K=jt(o,Z);K&&(K._f.refs?K._f.refs.every(oe=>!VW(oe)):!VW(K._f.ref))&&W(Z)}l.unMount=new Set},_updateFieldArray:(Z,K=[],oe,ie,Y=!0,le=!0)=>{if(ie&&oe&&!n.disabled){if(s.action=!0,le&&Array.isArray(jt(o,Z))){const me=oe(jt(o,Z),ie.argA,ie.argB);Y&&br(o,Z,me)}if(le&&Array.isArray(jt(r.errors,Z))){const me=oe(jt(r.errors,Z),ie.argA,ie.argB);Y&&br(r.errors,Z,me),((ce,ve)=>{!cC(jt(ce,ve)).length&&Ti(ce,ve)})(r.errors,Z)}if(u.touchedFields&&le&&Array.isArray(jt(r.touchedFields,Z))){const me=oe(jt(r.touchedFields,Z),ie.argA,ie.argB);Y&&br(r.touchedFields,Z,me)}u.dirtyFields&&(r.dirtyFields=dC(i,a)),d.state.next({name:Z,isDirty:T(Z,K),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else br(a,Z,K)},_updateDisabledField:U,_getFieldArray:Z=>cC(jt(s.mount?a:i,Z,n.shouldUnregister?jt(i,Z,[]):[])),_reset:ne,_resetDefaultValues:()=>jd(n.defaultValues)&&n.defaultValues().then(Z=>{re(Z,n.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:Z=>{r={...r,...Z}},_disableForm:Z=>{uc(Z)&&(d.state.next({disabled:Z}),Ub(o,(K,oe)=>{const ie=jt(o,oe);ie&&(K.disabled=ie._f.disabled||Z,Array.isArray(ie._f.refs)&&ie._f.refs.forEach(Y=>{Y.disabled=ie._f.disabled||Z}))},0,!1))},_subjects:d,_proxyFormState:u,_setErrors:Z=>{r.errors=Z,d.state.next({errors:r.errors,isValid:!1})},get _fields(){return o},get _formValues(){return a},get _state(){return s},set _state(Z){s=Z},get _defaultValues(){return i},get _names(){return l},set _names(Z){l=Z},get _formState(){return r},set _formState(Z){r=Z},get _options(){return n},set _options(Z){n={...n,...Z}}},trigger:I,register:X,handleSubmit:ae,watch:(Z,K)=>jd(Z)?d.values.subscribe({next:oe=>Z(P(void 0,K),oe)}):P(Z,K,!0),setValue:N,getValues:L,reset:re,resetField:(Z,K={})=>{jt(o,Z)&&(wo(K.defaultValue)?N(Z,Fi(jt(i,Z))):(N(Z,K.defaultValue),br(i,Z,Fi(K.defaultValue))),K.keepTouched||Ti(r.touchedFields,Z),K.keepDirty||(Ti(r.dirtyFields,Z),r.isDirty=K.defaultValue?T(Z,Fi(jt(i,Z))):T()),K.keepError||(Ti(r.errors,Z),u.isValid&&v()),d.state.next({...r}))},clearErrors:Z=>{Z&&As(Z).forEach(K=>Ti(r.errors,K)),d.state.next({errors:Z?r.errors:{}})},unregister:W,setError:Q,setFocus:(Z,K={})=>{const oe=jt(o,Z),ie=oe&&oe._f;if(ie){const Y=ie.refs?ie.refs[0]:ie.ref;Y.focus&&(Y.focus(),K.shouldSelect&&jd(Y.select)&&Y.select())}},getFieldState:F}}kM=function(t={}){const e=ge.useRef(void 0),n=ge.useRef(void 0),[r,o]=ge.useState({isDirty:!1,isValidating:!1,isLoading:jd(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:jd(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...fft(t),formState:r});const i=e.current.control;return i._options=t,o4({subject:i._subjects.state,next:a=>{Oje(a,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),ge.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),ge.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),ge.useEffect(()=>{t.values&&!bm(t.values,n.current)?(i._reset(t.values,i._options.resetOptions),n.current=t.values,o(a=>({...a}))):i._resetDefaultValues()},[t.values,i]),ge.useEffect(()=>{t.errors&&i._setErrors(t.errors)},[t.errors,i]),ge.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),ge.useEffect(()=>{t.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[t.shouldUnregister,i]),e.current.formState=xje(r,i),e.current};const zje=(t,e,n)=>{if(t&&"reportValidity"in t){const r=jt(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},Vje=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?zje(r.ref,n,t):r.refs&&r.refs.forEach(o=>zje(o,n,t))}},hft=(t,e)=>{e.shouldUseNativeValidation&&Vje(t,e);const n={};for(const r in t){const o=jt(e.fields,r),i=Object.assign(t[r]||{},{ref:o&&o.ref});if(pft(e.names||Object.keys(t),r)){const a=Object.assign({},jt(n,r));br(a,"root",i),br(n,r,a)}else br(n,r,i)}return n},pft=(t,e)=>t.some(n=>n.startsWith(e+"."));let qje;qje=function(t,e){for(var n={};t.length;){var r=t[0],o=r.code,i=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[a]={message:s.message,type:s.code}}else n[a]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return t.push(d)})}),e){var l=n[a].types,c=l&&l[r.code];n[a]=Sje(a,e,n,o,c?[].concat(c,r.message):r.message)}t.shift()}return n},wM=function(t,e,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve(function(a,s){try{var l=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(c){return i.shouldUseNativeValidation&&Vje({},i),{errors:{},values:n.raw?r:c}})}catch(c){return s(c)}return l&&l.then?l.then(void 0,s):l}(0,function(a){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(a))return{values:{},errors:hft(qje(a.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw a}))}catch(a){return Promise.reject(a)}}};function Fje(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}EH=function(t){t===void 0&&(t={});var e=t.onResize,n=_.useRef(void 0);n.current=e;var r=t.round||Math.round,o=_.useRef(),i=_.useState({width:void 0,height:void 0}),a=i[0],s=i[1],l=_.useRef(!1);_.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var c=_.useRef({width:void 0,height:void 0}),u=function(d,f){var h=_.useRef(null),g=_.useRef(null);g.current=f;var v=_.useRef(null);_.useEffect(function(){b()});var b=_.useCallback(function(){var p=v.current,O=g.current,k=p||(O?O instanceof Element?O:O.current:null);h.current&&h.current.element===k&&h.current.subscriber===d||(h.current&&h.current.cleanup&&h.current.cleanup(),h.current={element:k,subscriber:d,cleanup:k?d(k):void 0})},[d]);return _.useEffect(function(){return function(){h.current&&h.current.cleanup&&(h.current.cleanup(),h.current=null)}},[]),_.useCallback(function(p){v.current=p,b()},[b])}(_.useCallback(function(d){return o.current&&o.current.box===t.box&&o.current.round===r||(o.current={box:t.box,round:r,instance:new ResizeObserver(function(f){var h=f[0],g=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",v=Fje(h,g,"inlineSize"),b=Fje(h,g,"blockSize"),p=v?r(v):void 0,O=b?r(b):void 0;if(c.current.width!==p||c.current.height!==O){var k={width:p,height:O};c.current.width=p,c.current.height=O,n.current?n.current(k):l.current||s(k)}})}),o.current.instance.observe(d,{box:t.box}),function(){o.current&&o.current.instance.unobserve(d)}},[t.box,r]),t.ref);return _.useMemo(function(){return{ref:u,width:a.width,height:a.height}},[u,a.width,a.height])};let FW,Xb,BW;xK=t=>{const e=ue.c(4);let n,r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx("title",{children:"Python Logo"}),r=y.jsx("path",{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]),e[2]!==t?(o=y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 448 512",...t,children:[n,r]}),e[2]=t,e[3]=o):o=e[3],o},RIe=t=>{const e=ue.c(4);let n,r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx("title",{children:"Markdown Icon"}),r=y.jsx("path",{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]),e[2]!==t?(o=y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 640 512",fill:"currentColor",...t,children:[n,r]}),e[2]=t,e[3]=o):o=e[3],o},hG=bje,I6e=()=>{const t=ue.c(4),e=mo().formState.errors;if(Object.keys(e).length===0)return null;let n,r;return t[0]!==e?(n=Object.values(e).map(mft).filter(Boolean).join(", "),t[0]=e,t[1]=n):n=t[1],t[2]!==n?(r=y.jsx("div",{className:"text-destructive p-2 rounded-md bg-red-500/10",children:n}),t[2]=n,t[3]=r):r=t[3],r},FW=_.createContext({}),rr=t=>{const e=ue.c(10);let n,r,o,i;return e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1],e[2]!==n.name?(r={name:n.name},e[2]=n.name,e[3]=r):r=e[3],e[4]!==n?(o=y.jsx(cft,{...n}),e[4]=n,e[5]=o):o=e[5],e[6]!==n.name||e[7]!==r||e[8]!==o?(i=y.jsx(FW,{value:r,children:o},n.name),e[6]=n.name,e[7]=r,e[8]=o,e[9]=i):i=e[9],i},Xb=()=>{const t=ue.c(11),e=_.use(FW),n=_.use(BW),{getFieldState:r,formState:o}=mo();let i;t[0]!==e.name||t[1]!==o||t[2]!==r?(i=r(e.name,o),t[0]=e.name,t[1]=o,t[2]=r,t[3]=i):i=t[3];const a=i;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=n,l=`${s}-form-item`,c=`${s}-form-item-description`,u=`${s}-form-item-message`;let d;return t[4]!==e.name||t[5]!==a||t[6]!==s||t[7]!==l||t[8]!==c||t[9]!==u?(d={id:s,name:e.name,formItemId:l,formDescriptionId:c,formMessageId:u,...a},t[4]=e.name,t[5]=a,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=d):d=t[10],d},BW=_.createContext({}),jr=_.forwardRef((t,e)=>{const n=ue.c(14);let r,o;n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const i=_.useId();let a,s,l,c;return n[3]!==i?(a={id:i},n[3]=i,n[4]=a):a=n[4],n[5]!==r?(s=we("flex flex-col gap-1",r),n[5]=r,n[6]=s):s=n[6],n[7]!==o||n[8]!==e||n[9]!==s?(l=y.jsx("div",{ref:e,className:s,...o}),n[7]=o,n[8]=e,n[9]=s,n[10]=l):l=n[10],n[11]!==a||n[12]!==l?(c=y.jsx(BW,{value:a,children:l}),n[11]=a,n[12]=l,n[13]=c):c=n[13],c}),jr.displayName="FormItem",dr=_.forwardRef((t,e)=>{const n=ue.c(11);let r,o;n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const{error:i,formItemId:a}=Xb();if(!o.children)return;const s=i&&"text-destructive";let l,c;return n[3]!==r||n[4]!==s?(l=we(s,r),n[3]=r,n[4]=s,n[5]=l):l=n[5],n[6]!==a||n[7]!==o||n[8]!==e||n[9]!==l?(c=y.jsx(nf,{ref:e,className:l,htmlFor:a,...o}),n[6]=a,n[7]=o,n[8]=e,n[9]=l,n[10]=c):c=n[10],c}),dr.displayName="FormLabel",Ir=_.forwardRef((t,e)=>{const n=ue.c(8);let r;n[0]!==t?({...r}=t,n[0]=t,n[1]=r):r=n[1];const{error:o,formItemId:i,formDescriptionId:a,formMessageId:s}=Xb(),l=o?`${a} ${s}`:a,c=!!o;let u;return n[2]!==i||n[3]!==r||n[4]!==e||n[5]!==l||n[6]!==c?(u=y.jsx(kN,{ref:e,id:i,"aria-describedby":l,"aria-invalid":c,...r}),n[2]=i,n[3]=r,n[4]=e,n[5]=l,n[6]=c,n[7]=u):u=n[7],u}),Ir.displayName="FormControl",Xi=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o;n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const{formDescriptionId:i}=Xb();if(!o.children)return null;let a,s;return n[3]!==r?(a=we("text-sm text-muted-foreground",r),n[3]=r,n[4]=a):a=n[4],n[5]!==i||n[6]!==o||n[7]!==e||n[8]!==a?(s=y.jsx("p",{ref:e,id:i,className:a,...o}),n[5]=i,n[6]=o,n[7]=e,n[8]=a,n[9]=s):s=n[9],s}),Xi.displayName="FormDescription",Di=_.forwardRef((t,e)=>{const n=ue.c(12);let r,o,i;n[0]!==t?({className:o,children:r,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const{error:a,formMessageId:s}=Xb(),l=a!=null&&a.message?String(a==null?void 0:a.message):r;if(!l)return null;let c,u;return n[4]!==o?(c=we("text-xs font-medium text-destructive",o),n[4]=o,n[5]=c):c=n[5],n[6]!==l||n[7]!==s||n[8]!==i||n[9]!==e||n[10]!==c?(u=y.jsx("p",{ref:e,id:s,className:c,...i,children:l}),n[6]=l,n[7]=s,n[8]=i,n[9]=e,n[10]=c,n[11]=u):u=n[11],u}),Di.displayName="FormMessage";const Bje=t=>{const e=ue.c(7),{className:n}=t,{error:r}=Xb(),o=r!=null&&r.message?String(r==null?void 0:r.message):null;if(!o)return null;let i,a,s;return e[0]!==n?(i=we("stroke-[1.8px]",n),e[0]=n,e[1]=i):i=e[1],e[2]!==i?(a=y.jsx(TN,{className:i}),e[2]=i,e[3]=a):a=e[3],e[4]!==o||e[5]!==a?(s=y.jsx(qn,{content:o,children:a}),e[4]=o,e[5]=a,e[6]=s):s=e[6],s};function mft(t){return t==null?void 0:t.message}Bje.displayName="FormMessageTooltip";function c4(t){return t.split(`
|
455
|
+
`),className:"text-sm text-[var(--slate-11)] truncate flex-shrink-0",children:[o.length," files"]}),e[68]=o,e[69]=nt):nt=e[69],e[70]!==o?(Fe=o&&o.length>0&&y.jsx(Ft,{type:"button",variant:"text",size:"sm",onClick:()=>{i(void 0),a.current&&(a.current.value="")},children:y.jsx(Qa,{className:"size-3"})}),e[70]=o,e[71]=Fe):Fe=e[71],e[72]!==t.allowAttachments||e[73]!==Q?(kt=Q&&y.jsxs(y.Fragment,{children:[y.jsx(Ft,{type:"button",variant:"text",size:"sm",onClick:()=>{var Ue;return(Ue=a.current)==null?void 0:Ue.click()},children:y.jsx(Vce,{className:"h-4"})}),y.jsx("input",{type:"file",ref:a,className:"hidden",multiple:!0,accept:Array.isArray(t.allowAttachments)?t.allowAttachments.join(","):void 0,onChange:Ue=>{Ue.target.files&&i(Ue.target.files)}})]}),e[72]=t.allowAttachments,e[73]=Q,e[74]=kt):kt=e[74];const Re=N||!k;let ot,Me,We,it;return e[75]===Symbol.for("react.memo_cache_sentinel")?(ot=y.jsx(NJ,{className:"h-5 w-5"}),e[75]=ot):ot=e[75],e[76]!==Re?(Me=y.jsx(Ft,{type:"submit",disabled:Re,variant:"outline",size:"sm",className:"text-[var(--slate-11)]",children:ot}),e[76]=Re,e[77]=Me):Me=e[77],e[78]!==ye||e[79]!==_e||e[80]!==Se||e[81]!==Ie||e[82]!==De||e[83]!==nt||e[84]!==Fe||e[85]!==kt||e[86]!==Me?(We=y.jsxs("form",{onSubmit:ye,ref:s,className:"flex w-full border-t border-[var(--slate-6)] px-2 py-1 items-center",children:[_e,Se,Ie,De,nt,Fe,kt,Me]}),e[78]=ye,e[79]=_e,e[80]=Se,e[81]=Ie,e[82]=De,e[83]=nt,e[84]=Fe,e[85]=kt,e[86]=Me,e[87]=We):We=e[87],e[88]!==Z||e[89]!==ie||e[90]!==ve||e[91]!==We?(it=y.jsxs("div",{className:"flex flex-col h-full bg-[var(--slate-1)] rounded-lg shadow border border-[var(--slate-6)] overflow-hidden relative",style:Z,children:[ie,ve,We]}),e[88]=Z,e[89]=ie,e[90]=ve,e[91]=We,e[92]=it):it=e[92],it},sC={max_tokens:{min:1,max:4096,description:"Maximum number of tokens to generate"},temperature:{min:0,max:2,step:.1,description:"Controls randomness (0: deterministic, 2: very random)"},top_p:{min:0,max:1,step:.1,description:"Nucleus sampling: probability mass to consider"},top_k:{min:1,max:100,description:"Top-k sampling: number of highest probability tokens to consider"},frequency_penalty:{min:-2,max:2,description:"Penalizes frequent tokens (-2: favor, 2: avoid)"},presence_penalty:{min:-2,max:2,description:"Penalizes new tokens (-2: favor, 2: avoid)"}},Edt=t=>{const e=ue.c(16),{config:n,onChange:r}=t,[o,i]=_.useState(n),[a,s]=_.useState(!1);let l;e[0]!==o||e[1]!==r?(l=(p,O)=>{const{min:k,max:S}=sC[p],w=Math.max(k,Math.min(S,O)),T={...o,[p]:w};i(T),r(T)},e[0]=o,e[1]=r,e[2]=l):l=e[2];const c=l;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=p=>{p.key==="Enter"&&(p.preventDefault(),s(!1))},e[3]=u):u=e[3];const d=u;let f,h,g,v,b;if(e[4]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(qn,{content:"Configuration",children:y.jsx(sy,{asChild:!0,children:y.jsx(Ft,{variant:"outline",size:"sm",className:"border-none shadow-initial",children:y.jsx(jG,{className:"h-3 w-3"})})})}),e[4]=f):f=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsx("h4",{className:"font-bold leading-none",children:"Configuration"}),e[5]=h):h=e[5],e[6]!==c||e[7]!==o){let p;e[9]!==c?(p=O=>{const[k,S]=O;return y.jsxs("div",{className:"grid grid-cols-3 items-center gap-1",children:[y.jsxs(nf,{htmlFor:k,className:"flex w-full justify-between col-span-3 align-end",children:[oM(k),y.jsx(qn,{delayDuration:200,side:"top",content:y.jsx("div",{className:"text-xs flex flex-col",children:sC[k].description}),children:y.jsx(PA,{className:"h-3 w-3 cursor-help text-muted-foreground hover:text-foreground"})})]}),y.jsx(Yh,{id:k,value:S,minValue:sC[k].min,maxValue:sC[k].max,step:sC[k].step??1,onChange:w=>c(k,w),onKeyDown:d,className:"col-span-3"})]},k)},e[9]=c,e[10]=p):p=e[10],g=cr.entries(o).map(p),e[6]=c,e[7]=o,e[8]=g}else g=e[8];return e[11]!==g?(v=y.jsx(tp,{className:"w-70 border",children:y.jsxs("div",{className:"grid gap-3",children:[h,g]})}),e[11]=g,e[12]=v):v=e[12],e[13]!==a||e[14]!==v?(b=y.jsxs(dg,{open:a,onOpenChange:s,children:[f,v]}),e[13]=a,e[14]=v,e[15]=b):b=e[15],b},Rdt=t=>{const e=ue.c(18),{prompts:n,onSelect:r}=t,[o,i]=_.useState(!1),[a,s]=_.useState("");let l;e[0]!==r?(l=b=>{[...b.matchAll(/{{(\w+)}}/g)].length>0?(s(b),i(!0)):r(b)},e[0]=r,e[1]=l):l=e[1];const c=l;let u,d,f,h,g,v;if(e[2]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(qn,{content:"Select a prompt",children:y.jsx(Gm,{asChild:!0,children:y.jsx(Ft,{variant:"outline",size:"sm",className:"border-none shadow-initial",children:y.jsx(tOe,{className:"h-3 w-3 mx-1"})})})}),e[2]=u):u=e[2],e[3]!==c||e[4]!==n){let b;e[6]!==c?(b=(p,O)=>y.jsx($r,{onSelect:()=>c(p),className:"whitespace-normal text-left",children:p},O),e[6]=c,e[7]=b):b=e[7],d=n.map(b),e[3]=c,e[4]=n,e[5]=d}else d=e[5];return e[8]!==d?(f=y.jsx(HM,{children:y.jsxs(Hm,{children:[u,y.jsx(zh,{side:"right",align:"end",onCloseAutoFocus:zdt,className:"w-64 max-h-96 overflow-y-auto",children:d})]})}),e[8]=d,e[9]=f):f=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>i(!1),e[10]=h):h=e[10],e[11]!==r||e[12]!==a?(g=y.jsx(tp,{side:"right",align:"end",className:"min-w-80 px-2",children:y.jsx(jdt,{prompt:a,onClose:h,onSelect:r})}),e[11]=r,e[12]=a,e[13]=g):g=e[13],e[14]!==o||e[15]!==f||e[16]!==g?(v=y.jsxs(dg,{open:o,onOpenChange:i,children:[f,g]}),e[14]=o,e[15]=f,e[16]=g,e[17]=v):v=e[17],v},jdt=t=>{const e=ue.c(32),{prompt:n,onClose:r,onSelect:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const[a,s]=_.useState(i);let l,c,u;e[1]!==n?(l=()=>{const T=[...n.matchAll(/{{(\w+)}}/g)].reduce(Vdt,{});s(T)},c=[n],e[1]=n,e[2]=l,e[3]=c):(l=e[2],c=e[3]),_.useEffect(l,c),e[4]===Symbol.for("react.memo_cache_sentinel")?(u=(T,P)=>{s(j=>({...j,[T]:P}))},e[4]=u):u=e[4];const d=u;let f;if(e[5]!==n||e[6]!==a){let T;e[8]!==a?(T=(P,j)=>a[j]||`{{${j}}}`,e[8]=a,e[9]=T):T=e[9],f=n.replaceAll(/{{(\w+)}}/g,T),e[5]=n,e[6]=a,e[7]=f}else f=e[7];const h=f;let g;e[10]!==a?(g=Object.values(a).some(qdt),e[10]=a,e[11]=g):g=e[11];const v=g;let b;e[12]!==r||e[13]!==o||e[14]!==h?(b=()=>{o(h),r()},e[12]=r,e[13]=o,e[14]=h,e[15]=b):b=e[15];const p=b;let O,k,S,w;if(e[16]!==p||e[17]!==v||e[18]!==a){let T;e[20]!==p||e[21]!==v?(T=(P,j)=>{const[D,N]=P;return y.jsxs("div",{className:"grid grid-cols-4 items-center gap-2",children:[y.jsx(nf,{htmlFor:D,className:"font-semibold text-base",children:D}),y.jsx(tf,{id:D,value:N,onChange:E=>d(D,E.target.value),rootClassName:"col-span-3 w-full",className:"m-0",placeholder:`Enter value for ${D}`,autoFocus:j===0,onKeyDown:E=>{E.key!=="Enter"||v||p()}})]},D)},e[20]=p,e[21]=v,e[22]=T):T=e[22],O=Object.entries(a).map(T),e[16]=p,e[17]=v,e[18]=a,e[19]=O}else O=e[19];return e[23]!==h?(k=y.jsx("div",{className:"grid gap-2 prose dark:prose-invert",children:y.jsx("blockquote",{className:"text-sm",children:h})}),e[23]=h,e[24]=k):k=e[24],e[25]!==p||e[26]!==v?(S=y.jsx(Ft,{onClick:p,size:"xs",disabled:v,children:"Submit"}),e[25]=p,e[26]=v,e[27]=S):S=e[27],e[28]!==S||e[29]!==O||e[30]!==k?(w=y.jsxs("div",{className:"grid gap-4",children:[O,k,S]}),e[28]=S,e[29]=O,e[30]=k,e[31]=w):w=e[31],w};function Ddt(t,e){return{id:e.toString(),role:t.role,content:t.content,experimental_attachments:t.attachments}}function Adt(t){return{role:t.role,content:t.content,attachments:t.experimental_attachments}}function Mdt(t){Ve.error("An error occurred:",t)}function Ndt(t){Ve.debug("Received HTTP response from server:",t)}function $dt(t){var e;return(e=t.contentType)!=null&&e.startsWith("image")?y.jsx("img",{src:t.url,alt:t.name||"Attachment",className:"object-contain rounded-sm",width:100,height:100}):y.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-background hover:underline",children:t.name||"Attachment"})}function Idt(t){return{label:`/${t}`,displayLabel:t,apply:t}}function Qdt(){}function Ldt(t){return t.name}function zdt(t){return t.preventDefault()}function Vdt(t,e){return t[e[1]]="",t}function qdt(t){return t==null||t.trim()===""}const Fdt=lu("marimo-chatbot").withData(Qe({prompts:Wt(Pe()).default(Lc.EMPTY),showConfigurationControls:pt(),maxHeight:yt().optional(),config:Qe({max_tokens:yt(),temperature:yt(),top_p:yt(),top_k:yt(),frequency_penalty:yt(),presence_penalty:yt()}),allowAttachments:or([pt(),Pe().array()])})).withFunctions({get_chat_history:_i.input(Qe({})).output(Qe({messages:Wt(Qe({role:un(["system","user","assistant"]),content:Pe()}))})),delete_chat_history:_i.input(Qe({})).output(fp()),delete_chat_message:_i.input(Qe({index:yt()})).output(fp()),send_prompt:_i.input(Qe({messages:Wt(Qe({role:un(["system","user","assistant"]),content:Pe(),attachments:Wt(Qe({name:Pe().optional(),contentType:Pe().optional(),url:Pe()})).optional()})),config:Qe({max_tokens:yt(),temperature:yt(),top_p:yt(),top_k:yt(),frequency_penalty:yt(),presence_penalty:yt()})})).output(Pe())}).renderer(t=>{var e;return y.jsx(za,{children:y.jsx(Pdt,{prompts:t.data.prompts,showConfigurationControls:t.data.showConfigurationControls,maxHeight:t.data.maxHeight,allowAttachments:t.data.allowAttachments,config:t.data.config,get_chat_history:t.functions.get_chat_history,delete_chat_history:t.functions.delete_chat_history,delete_chat_message:t.functions.delete_chat_message,send_prompt:t.functions.send_prompt,value:((e=t.value)==null?void 0:e.messages)||Lc.EMPTY,setValue:n=>t.setValue({messages:n})})})}),lje=t=>{const e=ue.c(14),{wrapperClassName:n,className:r,pageSize:o}=t,i=o===void 0?10:o;let a;e[0]!==n?(a=we(n,"flex flex-col space-y-2"),e[0]=n,e[1]=a):a=e[1];const s=r||"rounded-md border";let l,c,u,d,f,h;return e[2]!==s?(l=we(s),e[2]=s,e[3]=l):l=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(mO,{children:Array.from({length:1}).map(Wdt)}),e[4]=c):c=e[4],e[5]!==i?(u=y.jsxs(iy,{children:[c,y.jsx(gO,{children:Array.from({length:i}).map(Zdt)})]}),e[5]=i,e[6]=u):u=e[6],e[7]!==l||e[8]!==u?(d=y.jsx("div",{className:l,children:u}),e[7]=l,e[8]=u,e[9]=d):d=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx("div",{className:"flex align-items justify-between flex-shrink-0 h-8"}),e[10]=f):f=e[10],e[11]!==a||e[12]!==d?(h=y.jsxs("div",{className:a,children:[d,f]}),e[11]=a,e[12]=d,e[13]=h):h=e[13],h};function Bdt(t,e){return y.jsx(oy,{children:y.jsx("div",{className:"h-4 bg-[var(--slate-5)] animate-pulse rounded-md w-[70%]"})},e)}function Wdt(t,e){return y.jsx(Rc,{children:Array.from({length:8}).map(Bdt)},e)}function Udt(t,e){return y.jsx(jc,{children:y.jsx("div",{className:"h-4 bg-[var(--slate-5)] animate-pulse rounded-md w-[90%]"})},e)}function Zdt(t,e){return y.jsx(Rc,{children:Array.from({length:8}).map(Udt)},e)}const r4=["string","boolean","integer","number","date","datetime","time","unknown"];wO=function(t){return t.Insert="insert",t.Remove="remove",t.Rename="rename",t}({});function Xdt(t){return t&&Object.keys(t).length!==0?cr.mapValues(t,e=>e==="date"||e==="time"?"string":e==="datetime"?"date":e):"auto"}const Hdt=ge.lazy(()=>Be(()=>import("./glide-data-editor-BoZIE6xa.js").then(async t=>(await t.__tla,t)).then(t=>t.g),__vite__mapDeps([132,122,133]),import.meta.url)),Ydt=lu("marimo-data-editor",{cssStyles:['.gdg-r17m35ur{background-color:var(--gdg-bg-header-has-focus);border:none;border-radius:9px;box-shadow:0 0 0 1px var(--gdg-border-color);color:var(--gdg-text-group-header);flex-grow:1;font:var(--gdg-header-font-style) var(--gdg-font-family);min-height:var(--r17m35ur-0);outline:none;padding:0 8px}.gdg-c1tqibwd{align-items:center;background-color:var(--gdg-bg-header);display:flex;padding:0 8px}.gdg-wmyidgi{direction:ltr;height:var(--wmyidgi-1);max-height:100%;max-width:100%;min-height:10px;min-width:10px;overflow:hidden;overflow:clip;position:relative;width:var(--wmyidgi-0)}.gdg-wmyidgi>:first-child{height:100%;left:0;position:absolute;top:0;width:100%}.gdg-seveqep{animation:gdg-search-fadein-gdg-seveqep .15s forwards;background-color:var(--gdg-bg-cell);border:1px solid var(--gdg-border-color);border-radius:6px;color:var(--gdg-text-dark);font-size:var(--gdg-editor-font-size);padding:8px;position:absolute;right:20px;top:4px}.gdg-seveqep.out{animation:gdg-search-fadeout-gdg-seveqep .15s forwards}.gdg-seveqep .gdg-search-bar-inner{display:flex}.gdg-seveqep .gdg-search-status{font-size:11px;padding-top:4px}.gdg-seveqep .gdg-search-progress{background-color:var(--gdg-text-light);bottom:0;height:4px;left:0;position:absolute}.gdg-seveqep input{background-color:var(--gdg-bg-cell);border:0;color:var(--gdg-textDark);outline:none;width:220px}.gdg-seveqep button{align-items:center;background:none;border:none;color:var(--gdg-text-medium);cursor:pointer;display:flex;height:24px;justify-content:center;outline:none;padding:0;width:24px}.gdg-seveqep button:hover{color:var(--gdg-text-dark)}.gdg-seveqep button .button-icon{height:16px;width:16px}.gdg-seveqep button:disabled{opacity:.4;pointer-events:none}@keyframes gdg-search-fadeout-gdg-seveqep{0%{transform:translate(0)}to{transform:translate(400px)}}@keyframes gdg-search-fadein-gdg-seveqep{0%{transform:translate(400px)}to{transform:translate(0)}}.gdg-d19meir1{box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;position:absolute;--overlay-top:var(--d19meir1-0);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);left:var(--d19meir1-1);max-height:calc(100vh - var(--d19meir1-4));max-width:400px;min-height:var(--d19meir1-3);min-width:var(--d19meir1-2);text-align:start;top:var(--d19meir1-0);width:-moz-max-content;width:max-content}@keyframes glide_fade_in-gdg-d19meir1{0%{opacity:0}to{opacity:100%}}.gdg-d19meir1.gdg-style{animation:glide_fade_in-gdg-d19meir1 60ms 1;background-color:var(--gdg-bg-cell);border-radius:2px;box-shadow:0 0 0 1px var(--gdg-accent-color),0 0 1px #3e415666,0 6px 12px #3e415626}.gdg-d19meir1.gdg-pad{padding:var(--d19meir1-5) 8.5px 3px}.gdg-d19meir1 .gdg-clip-region{border-radius:2px;display:flex;flex-direction:column;flex-grow:1;overflow-x:hidden;overflow-y:auto}.gdg-d19meir1 .gdg-clip-region .gdg-growing-entry{height:100%}.gdg-d19meir1 .gdg-clip-region input.gdg-input{border:0;outline:none;width:100%}.gdg-d19meir1 .gdg-clip-region textarea.gdg-input{border:0;outline:none}.gdg-i2iowwq{display:flex;height:100%}.gdg-i2iowwq .gdg-centering-container{align-items:center;display:flex;height:100%;justify-content:center}.gdg-i2iowwq .gdg-centering-container canvas,.gdg-i2iowwq .gdg-centering-container img{max-height:calc(100vh - var(--overlay-top) - 20px);-o-object-fit:contain;object-fit:contain;-webkit-user-select:none;-moz-user-select:none;user-select:none}.gdg-i2iowwq .gdg-centering-container canvas{max-width:380px}.gdg-i2iowwq .gdg-edit-icon{align-items:center;color:var(--gdg-accent-color);cursor:pointer;display:flex;height:48px;justify-content:center;position:absolute;right:0;top:12px;width:48px}.gdg-i2iowwq .gdg-edit-icon>*{height:24px;width:24px}.gdg-i2iowwq textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.gdg-u1rrojo{align-items:center;display:flex;flex-grow:1;min-height:21px}.gdg-u1rrojo .gdg-link-area{color:var(--gdg-link-color);cursor:pointer;flex-grow:1;flex-shrink:1;margin-right:8px;overflow:hidden;text-decoration:underline!important;text-overflow:ellipsis;white-space:nowrap}.gdg-u1rrojo .gdg-edit-icon{align-items:center;color:var(--gdg-accent-color);cursor:pointer;display:flex;flex-shrink:0;justify-content:center;width:32px}.gdg-u1rrojo .gdg-edit-icon>*{height:24px;width:24px}.gdg-u1rrojo textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.gdg-d4zsq0x{display:flex;flex-wrap:wrap}.gdg-d4zsq0x .doe-bubble{align-items:center;background-color:var(--gdg-bg-cell);border-radius:var(--gdg-rounding-radius,6px);box-shadow:0 0 1px #3e415666,0 1px 3px #3e415666;color:var(--gdg-text-dark);display:flex;height:24px;justify-content:center;margin:2px;padding:0 8px}.gdg-d4zsq0x .doe-bubble img{height:16px;margin-right:4px;-o-object-fit:contain;object-fit:contain}.gdg-d4zsq0x textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.gdg-b1ygi5by{display:flex;flex-wrap:wrap;margin-bottom:auto;margin-top:auto;overflow:auto}.gdg-b1ygi5by .boe-bubble{align-items:center;background-color:var(--gdg-bg-bubble);border-radius:var(--gdg-rounding-radius,calc(var(--gdg-bubble-height)/2));color:var(--gdg-text-dark);display:flex;height:var(--gdg-bubble-height);justify-content:center;margin:var(--gdg-bubble-margin);padding:0 var(--gdg-bubble-padding);white-space:nowrap}.gdg-b1ygi5by textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.gdg-n15fjm3e{color:var(--gdg-text-dark);display:flex;margin:6px 0 3px}.gdg-n15fjm3e>input{background-color:var(--gdg-bg-cell);color:var(--gdg-text-dark);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);padding:0}.gdg-m1pnx84e{align-items:flex-start;color:var(--gdg-text-dark);display:flex;justify-content:space-between;min-width:var(--m1pnx84e-0);position:relative;width:100%}.gdg-m1pnx84e .gdg-g1y0xocz{flex-shrink:1;min-width:0}.gdg-m1pnx84e .gdg-spacer{flex:1}.gdg-m1pnx84e .gdg-edit-icon{align-items:center;border-radius:6px;color:var(--gdg-accent-color);cursor:pointer;display:flex;flex-shrink:0;height:24px;justify-content:center;padding:0;position:relative;transition:all "0.125s ease";width:24px}.gdg-m1pnx84e .gdg-edit-icon>*{height:16px;width:16px}.gdg-m1pnx84e .gdg-edit-hover :hover{background-color:var(--gdg-accent-light);transition:background-color .15s}.gdg-m1pnx84e .gdg-checkmark-hover :hover{background-color:var(--gdg-accent-color);color:#fff}.gdg-m1pnx84e .gdg-md-edit-textarea{height:0;left:0;margin-top:25px;opacity:0;padding:0;position:relative;top:0;width:0}.gdg-m1pnx84e .gdg-ml-6{margin-left:6px}.gdg-izpuzkl{background-color:transparent;border:0;border-radius:0;font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);height:100%;inset:0;line-height:16px;min-width:100%;overflow:hidden;position:absolute;resize:none;white-space:pre-wrap;width:100%;-webkit-text-fill-color:var(--gdg-text-dark);color:var(--gdg-text-dark);margin:0;padding:0}.gdg-invalid .gdg-izpuzkl{text-decoration:underline;text-decoration-color:#d60606}.gdg-izpuzkl ::-moz-placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl ::placeholder{color:var(--gdg-text-light)}.gdg-s69h75o{visibility:hidden;white-space:pre-wrap;word-wrap:break-word;color:var(--gdg-text-dark);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);line-height:16px;margin:0;max-width:100%;min-width:100%;padding:0 0 2px;width:-moz-max-content;width:max-content}.gdg-g1y0xocz{margin-top:6px;position:relative}.gdg-s1dgczr6 .dvn-scroller{overflow:var(--s1dgczr6-0);transform:translateZ(0)}.gdg-s1dgczr6 .dvn-hidden{visibility:hidden}.gdg-s1dgczr6 .dvn-scroll-inner{display:flex;pointer-events:none}.gdg-s1dgczr6 .dvn-scroll-inner>*{flex-shrink:0}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-spacer{flex-grow:1}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-stack{display:flex;flex-direction:column}.gdg-s1dgczr6 .dvn-underlay>*{left:0;position:absolute;top:0}.gdg-s1dgczr6 canvas{outline:none}.gdg-s1dgczr6 canvas *{height:0}.gdg-mnuv029{word-break:break-word;-webkit-touch-callout:default;padding-top:6px}.gdg-mnuv029>*{margin:0}.gdg-mnuv029 :last-child{margin-bottom:0}.gdg-mnuv029 p img{width:100%}']}).withData(Qe({initialValue:Qe({edits:Wt(Qe({rowIdx:yt(),columnId:Pe(),value:lp()}))}),label:Pe().nullable(),data:or([Pe(),Wt(Qe({}).passthrough())]),fieldTypes:Wt(sf([hy.string(),sf([un(r4),Pe()])])).nullish(),columnSizingMode:un(["auto","fit"]).default("auto")})).withFunctions({}).renderer(t=>y.jsx(zO,{children:y.jsx(Gdt,{data:t.data.data,fieldTypes:t.data.fieldTypes,edits:t.value,onEdits:t.setValue,columnSizingMode:t.data.columnSizingMode,host:t.host})})),Gdt=t=>{const e=ue.c(30);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];const[r,o]=_.useState(n);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={},e[1]=i):i=e[1];const[a,s]=_.useState(i);let l,c;e[2]!==t.data||e[3]!==t.fieldTypes?(l=async()=>{const O=uz(t.fieldTypes??[]),k=Array.isArray(t.data)?t.data:await M_(t.data,{type:"csv",parse:Xdt(O)},{handleBigIntAndNumberLike:!0});o(k),s(uz(t.fieldTypes??Aj(k)))},c=[t.fieldTypes,t.data],e[2]=t.data,e[3]=t.fieldTypes,e[4]=l,e[5]=c):(l=e[4],c=e[5]);const{error:u}=$a(l,c);if(u){let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(Lv,{children:"Error"}),e[6]=O):O=e[6];const k=u.message||"An unknown error occurred";let S;return e[7]!==k?(S=y.jsxs(Qv,{variant:"destructive",className:"mb-2",children:[O,y.jsx("div",{className:"text-md",children:k})]}),e[7]=k,e[8]=S):S=e[8],S}if(!r){let O;return e[9]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx($_,{milliseconds:200,children:y.jsx(lje,{pageSize:10})}),e[9]=O):O=e[9],O}let d,f,h,g,v,b,p;return e[10]!==t?(d=O=>{t.onEdits(k=>({...k,edits:[...k.edits,...O]}))},e[10]=t,e[11]=d):d=e[11],e[12]!==r||e[13]!==t?(f=O=>{const k=O.flatMap((S,w)=>Object.entries(S).map(T=>{const[P,j]=T;return{rowIdx:r.length+w,columnId:P,value:j}}));t.onEdits(S=>({...S,edits:[...S.edits,...k]}))},e[12]=r,e[13]=t,e[14]=f):f=e[14],e[15]!==t?(h=O=>{t.onEdits(k=>{const S=O.map(Kdt);return{...k,edits:[...k.edits,...S]}})},g=(O,k)=>{t.onEdits(S=>({...S,edits:[...S.edits,{columnIdx:O,newName:k,type:wO.Rename}]}))},v=O=>{t.onEdits(k=>({...k,edits:[...k.edits,{columnIdx:O,type:wO.Remove}]}))},b=(O,k)=>{t.onEdits(S=>({...S,edits:[...S.edits,{columnIdx:O,newName:k,type:wO.Insert}]}))},e[15]=t,e[16]=h,e[17]=g,e[18]=v,e[19]=b):(h=e[16],g=e[17],v=e[18],b=e[19]),e[20]!==a||e[21]!==r||e[22]!==t.edits.edits||e[23]!==d||e[24]!==f||e[25]!==h||e[26]!==g||e[27]!==v||e[28]!==b?(p=y.jsx(Hdt,{data:r,setData:o,columnFields:a,setColumnFields:s,edits:t.edits.edits,onAddEdits:d,onAddRows:f,onDeleteRows:h,onRenameColumn:g,onDeleteColumn:v,onAddColumn:b}),e[20]=a,e[21]=r,e[22]=t.edits.edits,e[23]=d,e[24]=f,e[25]=h,e[26]=g,e[27]=v,e[28]=b,e[29]=p):p=e[29],p};function Kdt(t,e){return{rowIdx:t-e,type:wO.Remove}}var lC=t=>t.type==="checkbox",J0=t=>t instanceof Date,es=t=>t==null;const cje=t=>typeof t=="object";var pi=t=>!es(t)&&!Array.isArray(t)&&cje(t)&&!J0(t),uje=t=>pi(t)&&t.target?lC(t.target)?t.target.checked:t.target.value:t,dje=(t,e)=>t.has((n=>n.substring(0,n.search(/\.\d+(\.|$)/))||n)(e)),CW=typeof window<"u"&&window.HTMLElement!==void 0&&typeof document<"u";function Fi(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"&&t instanceof FileList;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else{if(CW&&(t instanceof Blob||r)||!n&&!pi(t))return t;if(e=n?[]:{},n||(o=>{const i=o.constructor&&o.constructor.prototype;return pi(i)&&i.hasOwnProperty("isPrototypeOf")})(t))for(const o in t)t.hasOwnProperty(o)&&(e[o]=Fi(t[o]));else e=t}return e}var cC=t=>Array.isArray(t)?t.filter(Boolean):[],wo=t=>t===void 0,jt=(t,e,n)=>{if(!e||!pi(t))return n;const r=cC(e.split(/[,[\].]+?/)).reduce((o,i)=>es(o)?o:o[i],t);return wo(r)||r===t?wo(t[e])?n:t[e]:r},uc=t=>typeof t=="boolean",_W=t=>/^\w*$/.test(t),fje=t=>cC(t.replace(/["|']|\]/g,"").split(/\.|\[/)),br=(t,e,n)=>{let r=-1;const o=_W(e)?[e]:fje(e),i=o.length,a=i-1;for(;++r<i;){const s=o[r];let l=n;if(r!==a){const c=t[s];l=pi(c)||Array.isArray(c)?c:isNaN(+o[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;t[s]=l,t=t[s]}return t};const hje="blur",Jdt="focusout",eft="change",tft="onBlur",pje="onChange",mje="onSubmit",nft="onTouched",Wb="all",rft="max",oft="min",ift="maxLength",aft="minLength",gje="pattern",vje="required",sft="validate",yje=ge.createContext(null),mo=()=>ge.useContext(yje),bje=t=>{const{children:e,...n}=t;return ge.createElement(yje.Provider,{value:n},e)};var xje=(t,e,n,r=!0)=>{const o={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(o,i,{get:()=>{const a=i;return e._proxyFormState[a]!==Wb&&(e._proxyFormState[a]=!r||Wb),n&&(n[a]=!0),t[a]}});return o},ts=t=>pi(t)&&!Object.keys(t).length,Oje=(t,e,n,r)=>{n(t);const{name:o,...i}=t;return ts(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(a=>e[a]===(!r||Wb))},As=t=>Array.isArray(t)?t:[t],wje=(t,e,n)=>!t||!e||t===e||As(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function o4(t){const e=ge.useRef(t);e.current=t,ge.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}var Rd=t=>typeof t=="string",kje=(t,e,n,r,o)=>Rd(t)?(r&&e.watch.add(t),jt(n,t,o)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),jt(n,i))):(r&&(e.watchAll=!0),n);function cu(t){const e=mo(),{control:n=e.control,name:r,defaultValue:o,disabled:i,exact:a}=t||{},s=ge.useRef(r);s.current=r,o4({disabled:i,subject:n._subjects.values,next:u=>{wje(s.current,u.name,a)&&c(Fi(kje(s.current,n._names,u.values||n._formValues,!1,o)))}});const[l,c]=ge.useState(n._getWatch(r,o));return ge.useEffect(()=>n._removeUnmounted()),l}function lft(t){const e=mo(),{name:n,disabled:r,control:o=e.control,shouldUnregister:i}=t,a=dje(o._names.array,n),s=cu({control:o,name:n,defaultValue:jt(o._formValues,n,jt(o._defaultValues,n,t.defaultValue)),exact:!0}),l=function(f){const h=mo(),{control:g=h.control,disabled:v,name:b,exact:p}=f||{},[O,k]=ge.useState(g._formState),S=ge.useRef(!0),w=ge.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),T=ge.useRef(b);return T.current=b,o4({disabled:v,next:P=>S.current&&wje(T.current,P.name,p)&&Oje(P,w.current,g._updateFormState)&&k({...g._formState,...P}),subject:g._subjects.state}),ge.useEffect(()=>(S.current=!0,w.current.isValid&&g._updateValid(!0),()=>{S.current=!1}),[g]),ge.useMemo(()=>xje(O,g,w.current,!1),[O,g])}({control:o,name:n,exact:!0}),c=ge.useRef(o.register(n,{...t.rules,value:s,...uc(t.disabled)?{disabled:t.disabled}:{}})),u=ge.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!jt(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!jt(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!jt(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!jt(l.validatingFields,n)},error:{enumerable:!0,get:()=>jt(l.errors,n)}}),[l,n]),d=ge.useMemo(()=>({name:n,value:s,...uc(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:f=>c.current.onChange({target:{value:uje(f),name:n},type:eft}),onBlur:()=>c.current.onBlur({target:{value:jt(o._formValues,n),name:n},type:hje}),ref:f=>{const h=jt(o._fields,n);h&&f&&(h._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:g=>f.setCustomValidity(g),reportValidity:()=>f.reportValidity()})}}),[n,o._formValues,r,l.disabled,s,o._fields]);return ge.useEffect(()=>{const f=o._options.shouldUnregister||i,h=(g,v)=>{const b=jt(o._fields,g);b&&b._f&&(b._f.mount=v)};if(h(n,!0),f){const g=Fi(jt(o._options.defaultValues,n));br(o._defaultValues,n,g),wo(jt(o._formValues,n))&&br(o._formValues,n,g)}return!a&&o.register(n),()=>{(a?f&&!o._state.action:f)?o.unregister(n):h(n,!1)}},[n,o,a,i]),ge.useEffect(()=>{o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),ge.useMemo(()=>({field:d,formState:l,fieldState:u}),[d,l,u])}const cft=t=>t.render(lft(t));var Sje=(t,e,n,r,o)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:o||!0}}:{},ym=()=>{const t=typeof performance>"u"?Date.now():1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(16*Math.random()+t)%16|0;return(e=="x"?n:3&n|8).toString(16)})},TW=(t,e,n={})=>n.shouldFocus||wo(n.shouldFocus)?n.focusName||`${t}.${wo(n.focusIndex)?e:n.focusIndex}.`:"",uC=t=>({isOnSubmit:!t||t===mje,isOnBlur:t===tft,isOnChange:t===pje,isOnAll:t===Wb,isOnTouch:t===nft}),PW=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Ub=(t,e,n,r)=>{for(const o of n||Object.keys(t)){const i=jt(t,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],o)&&!r||a.ref&&e(a.ref,a.name)&&!r)return!0;if(Ub(s,e))break}else if(pi(s)&&Ub(s,e))break}}};var Cje=(t,e,n)=>{const r=As(jt(t,n));return br(r,"root",e[n]),br(t,n,r),t},EW=t=>t.type==="file",jd=t=>typeof t=="function",i4=t=>{if(!CW)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},a4=t=>Rd(t),RW=t=>t.type==="radio",s4=t=>t instanceof RegExp;const _je={value:!1,isValid:!1},Tje={value:!0,isValid:!0};var Pje=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!wo(t[0].attributes.value)?wo(t[0].value)||t[0].value===""?Tje:{value:t[0].value,isValid:!0}:Tje:_je}return _je};const Eje={isValid:!1,value:null};var Rje=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,Eje):Eje;function jje(t,e,n="validate"){if(a4(t)||Array.isArray(t)&&t.every(a4)||uc(t)&&!t)return{type:n,message:a4(t)?t:"",ref:e}}var Zb=t=>pi(t)&&!s4(t)?t:{value:t,message:""},jW=async(t,e,n,r,o,i)=>{const{ref:a,refs:s,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:g,name:v,valueAsNumber:b,mount:p}=t._f,O=jt(n,v);if(!p||e.has(v))return{};const k=s?s[0]:a,S=A=>{o&&k.reportValidity&&(k.setCustomValidity(uc(A)?"":A||""),k.reportValidity())},w={},T=RW(a),P=lC(a),j=T||P,D=(b||EW(a))&&wo(a.value)&&wo(O)||i4(a)&&a.value===""||O===""||Array.isArray(O)&&!O.length,N=Sje.bind(null,v,r,w),E=(A,I,L,F=ift,Q=aft)=>{const W=A?I:L;w[v]={type:A?F:Q,message:W,ref:a,...N(A?F:Q,W)}};if(i?!Array.isArray(O)||!O.length:l&&(!j&&(D||es(O))||uc(O)&&!O||P&&!Pje(s).isValid||T&&!Rje(s).isValid)){const{value:A,message:I}=a4(l)?{value:!!l,message:l}:Zb(l);if(A&&(w[v]={type:vje,message:I,ref:k,...N(vje,I)},!r))return S(I),w}if(!(D||es(d)&&es(f))){let A,I;const L=Zb(f),F=Zb(d);if(es(O)||isNaN(O)){const Q=a.valueAsDate||new Date(O),W=G=>new Date(new Date().toDateString()+" "+G),U=a.type=="time",X=a.type=="week";Rd(L.value)&&O&&(A=U?W(O)>W(L.value):X?O>L.value:Q>new Date(L.value)),Rd(F.value)&&O&&(I=U?W(O)<W(F.value):X?O<F.value:Q<new Date(F.value))}else{const Q=a.valueAsNumber||O&&+O;es(L.value)||(A=Q>L.value),es(F.value)||(I=Q<F.value)}if((A||I)&&(E(!!A,L.message,F.message,rft,oft),!r))return S(w[v].message),w}if((c||u)&&!D&&(Rd(O)||i&&Array.isArray(O))){const A=Zb(c),I=Zb(u),L=!es(A.value)&&O.length>+A.value,F=!es(I.value)&&O.length<+I.value;if((L||F)&&(E(L,A.message,I.message),!r))return S(w[v].message),w}if(h&&!D&&Rd(O)){const{value:A,message:I}=Zb(h);if(s4(A)&&!O.match(A)&&(w[v]={type:gje,message:I,ref:a,...N(gje,I)},!r))return S(I),w}if(g){if(jd(g)){const A=jje(await g(O,n),k);if(A&&(w[v]={...A,...N(sft,A.message)},!r))return S(A.message),w}else if(pi(g)){let A={};for(const I in g){if(!ts(A)&&!r)break;const L=jje(await g[I](O,n),k,I);L&&(A={...L,...N(I,L.message)},S(L.message),r&&(w[v]=A))}if(!ts(A)&&(w[v]={ref:k,...A},!r))return w}}return S(!0),w},DW=(t,e)=>[...t,...As(e)],AW=t=>Array.isArray(t)?t.map(()=>{}):void 0;function MW(t,e,n){return[...t.slice(0,e),...As(n),...t.slice(e)]}var NW=(t,e,n)=>Array.isArray(t)?(wo(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(e,1)[0]),t):[],$W=(t,e)=>[...As(e),...As(t)],IW=(t,e)=>wo(e)?[]:function(n,r){let o=0;const i=[...n];for(const a of r)i.splice(a-o,1),o++;return cC(i).length?i:[]}(t,As(e).sort((n,r)=>n-r)),QW=(t,e,n)=>{[t[e],t[n]]=[t[n],t[e]]};function Ti(t,e){const n=Array.isArray(e)?e:_W(e)?[e]:fje(e),r=n.length===1?t:function(a,s){const l=s.slice(0,-1).length;let c=0;for(;c<l;)a=wo(a)?c++:a[s[c++]];return a}(t,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(pi(r)&&ts(r)||Array.isArray(r)&&function(a){for(const s in a)if(a.hasOwnProperty(s)&&!wo(a[s]))return!1;return!0}(r))&&Ti(t,n.slice(0,-1)),t}var Dje=(t,e,n)=>(t[e]=n,t);function Aje(t){const e=mo(),{control:n=e.control,name:r,keyName:o="id",shouldUnregister:i,rules:a}=t,[s,l]=ge.useState(n._getFieldArray(r)),c=ge.useRef(n._getFieldArray(r).map(ym)),u=ge.useRef(s),d=ge.useRef(r),f=ge.useRef(!1);d.current=r,u.current=s,n._names.array.add(r),a&&n.register(r,a),o4({next:({values:g,name:v})=>{if(v===d.current||!v){const b=jt(g,d.current);Array.isArray(b)&&(l(b),c.current=b.map(ym))}},subject:n._subjects.array});const h=ge.useCallback(g=>{f.current=!0,n._updateFieldArray(r,g)},[n,r]);return ge.useEffect(()=>{if(n._state.action=!1,PW(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!uC(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(g=>{const v=jt(g.errors,r),b=jt(n._formState.errors,r);(b?!v&&b.type||v&&(b.type!==v.type||b.message!==v.message):v&&v.type)&&(v?br(n._formState.errors,r,v):Ti(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const g=jt(n._fields,r);!g||!g._f||uC(n._options.reValidateMode).isOnSubmit&&uC(n._options.mode).isOnSubmit||jW(g,n._names.disabled,n._formValues,n._options.criteriaMode===Wb,n._options.shouldUseNativeValidation,!0).then(v=>!ts(v)&&n._subjects.state.next({errors:Cje(n._formState.errors,v,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&Ub(n._fields,(g,v)=>{if(n._names.focus&&v.startsWith(n._names.focus)&&g.focus)return g.focus(),1}),n._names.focus="",n._updateValid(),f.current=!1},[s,r,n]),ge.useEffect(()=>(!jt(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||i)&&n.unregister(r)}),[r,n,o,i]),{swap:ge.useCallback((g,v)=>{const b=n._getFieldArray(r);QW(b,g,v),QW(c.current,g,v),h(b),l(b),n._updateFieldArray(r,b,QW,{argA:g,argB:v},!1)},[h,r,n]),move:ge.useCallback((g,v)=>{const b=n._getFieldArray(r);NW(b,g,v),NW(c.current,g,v),h(b),l(b),n._updateFieldArray(r,b,NW,{argA:g,argB:v},!1)},[h,r,n]),prepend:ge.useCallback((g,v)=>{const b=As(Fi(g)),p=$W(n._getFieldArray(r),b);n._names.focus=TW(r,0,v),c.current=$W(c.current,b.map(ym)),h(p),l(p),n._updateFieldArray(r,p,$W,{argA:AW(g)})},[h,r,n]),append:ge.useCallback((g,v)=>{const b=As(Fi(g)),p=DW(n._getFieldArray(r),b);n._names.focus=TW(r,p.length-1,v),c.current=DW(c.current,b.map(ym)),h(p),l(p),n._updateFieldArray(r,p,DW,{argA:AW(g)})},[h,r,n]),remove:ge.useCallback(g=>{const v=IW(n._getFieldArray(r),g);c.current=IW(c.current,g),h(v),l(v),!Array.isArray(jt(n._fields,r))&&br(n._fields,r,void 0),n._updateFieldArray(r,v,IW,{argA:g})},[h,r,n]),insert:ge.useCallback((g,v,b)=>{const p=As(Fi(v)),O=MW(n._getFieldArray(r),g,p);n._names.focus=TW(r,g,b),c.current=MW(c.current,g,p.map(ym)),h(O),l(O),n._updateFieldArray(r,O,MW,{argA:g,argB:AW(v)})},[h,r,n]),update:ge.useCallback((g,v)=>{const b=Fi(v),p=Dje(n._getFieldArray(r),g,b);c.current=[...p].map((O,k)=>O&&k!==g?c.current[k]:ym()),h(p),l([...p]),n._updateFieldArray(r,p,Dje,{argA:g,argB:b},!0,!1)},[h,r,n]),replace:ge.useCallback(g=>{const v=As(Fi(g));c.current=v.map(ym),h([...v]),l([...v]),n._updateFieldArray(r,[...v],b=>b,{},!0,!1)},[h,r,n]),fields:ge.useMemo(()=>s.map((g,v)=>({...g,[o]:c.current[v]||ym()})),[s,o])}}var LW=()=>{let t=[];return{get observers(){return t},next:e=>{for(const n of t)n.next&&n.next(e)},subscribe:e=>(t.push(e),{unsubscribe:()=>{t=t.filter(n=>n!==e)}}),unsubscribe:()=>{t=[]}}},zW=t=>es(t)||!cje(t);function bm(t,e){if(zW(t)||zW(e))return t===e;if(J0(t)&&J0(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n){const i=t[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=e[o];if(J0(i)&&J0(a)||pi(i)&&pi(a)||Array.isArray(i)&&Array.isArray(a)?!bm(i,a):i!==a)return!1}}return!0}var Mje=t=>t.type==="select-multiple",VW=t=>i4(t)&&t.isConnected,Nje=t=>{for(const e in t)if(jd(t[e]))return!0;return!1};function l4(t,e={}){const n=Array.isArray(t);if(pi(t)||n)for(const r in t)Array.isArray(t[r])||pi(t[r])&&!Nje(t[r])?(e[r]=Array.isArray(t[r])?[]:{},l4(t[r],e[r])):es(t[r])||(e[r]=!0);return e}function $je(t,e,n){const r=Array.isArray(t);if(pi(t)||r)for(const o in t)Array.isArray(t[o])||pi(t[o])&&!Nje(t[o])?wo(e)||zW(n[o])?n[o]=Array.isArray(t[o])?l4(t[o],[]):{...l4(t[o])}:$je(t[o],es(e)?{}:e[o],n[o]):n[o]=!bm(t[o],e[o]);return n}var dC=(t,e)=>$je(t,e,l4(e)),Ije=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>wo(t)?t:e?t===""?NaN:t&&+t:n&&Rd(t)?new Date(t):r?r(t):t;function qW(t){const e=t.ref;return EW(e)?e.files:RW(e)?Rje(t.refs).value:Mje(e)?[...e.selectedOptions].map(({value:n})=>n):lC(e)?Pje(t.refs).value:Ije(wo(e.value)?t.ref.value:e.value,t)}var fC=t=>wo(t)?t:s4(t)?t.source:pi(t)?s4(t.value)?t.value.source:t.value:t;const Qje="AsyncFunction";var uft=t=>!!t&&!!t.validate&&!!(jd(t.validate)&&t.validate.constructor.name===Qje||pi(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===Qje));function Lje(t,e,n){const r=jt(t,n);if(r||_W(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=jt(e,i),s=jt(t,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(s&&s.type)return{name:i,error:s};o.pop()}return{name:n}}const dft={mode:mje,reValidateMode:pje,shouldFocusError:!0};function fft(t={}){let e,n={...dft,...t},r={submitCount:0,isDirty:!1,isLoading:jd(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},o={},i=(pi(n.defaultValues)||pi(n.values))&&Fi(n.defaultValues||n.values)||{},a=n.shouldUnregister?{}:Fi(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:LW(),array:LW(),state:LW()},f=uC(n.mode),h=uC(n.reValidateMode),g=n.criteriaMode===Wb,v=async Z=>{if(!n.disabled&&(u.isValid||Z)){const K=n.resolver?ts((await S()).errors):await w(o,!0);K!==r.isValid&&d.state.next({isValid:K})}},b=(Z,K)=>{n.disabled||!u.isValidating&&!u.validatingFields||((Z||Array.from(l.mount)).forEach(oe=>{oe&&(K?br(r.validatingFields,oe,K):Ti(r.validatingFields,oe))}),d.state.next({validatingFields:r.validatingFields,isValidating:!ts(r.validatingFields)}))},p=(Z,K,oe,ie)=>{const Y=jt(o,Z);if(Y){const le=jt(a,Z,wo(oe)?jt(i,Z):oe);wo(le)||ie&&ie.defaultChecked||K?br(a,Z,K?le:qW(Y._f)):j(Z,le),s.mount&&v()}},O=(Z,K,oe,ie,Y)=>{let le=!1,me=!1;const ce={name:Z};if(!n.disabled){const ve=!!(jt(o,Z)&&jt(o,Z)._f&&jt(o,Z)._f.disabled);if(!oe||ie){u.isDirty&&(me=r.isDirty,r.isDirty=ce.isDirty=T(),le=me!==ce.isDirty);const ye=ve||bm(jt(i,Z),K);me=!(ve||!jt(r.dirtyFields,Z)),ye||ve?Ti(r.dirtyFields,Z):br(r.dirtyFields,Z,!0),ce.dirtyFields=r.dirtyFields,le=le||u.dirtyFields&&me!==!ye}if(oe){const ye=jt(r.touchedFields,Z);ye||(br(r.touchedFields,Z,oe),ce.touchedFields=r.touchedFields,le=le||u.touchedFields&&ye!==oe)}le&&Y&&d.state.next(ce)}return le?ce:{}},k=(Z,K,oe,ie)=>{const Y=jt(r.errors,Z),le=u.isValid&&uc(K)&&r.isValid!==K;if(n.delayError&&oe?(e=(me=>ce=>{clearTimeout(c),c=setTimeout(me,ce)})(()=>((me,ce)=>{br(r.errors,me,ce),d.state.next({errors:r.errors})})(Z,oe)),e(n.delayError)):(clearTimeout(c),e=null,oe?br(r.errors,Z,oe):Ti(r.errors,Z)),(oe?!bm(Y,oe):Y)||!ts(ie)||le){const me={...ie,...le&&uc(K)?{isValid:K}:{},errors:r.errors,name:Z};r={...r,...me},d.state.next(me)}},S=async Z=>{b(Z,!0);const K=await n.resolver(a,n.context,((oe,ie,Y,le)=>{const me={};for(const ce of oe){const ve=jt(ie,ce);ve&&br(me,ce,ve._f)}return{criteriaMode:Y,names:[...oe],fields:me,shouldUseNativeValidation:le}})(Z||l.mount,o,n.criteriaMode,n.shouldUseNativeValidation));return b(Z),K},w=async(Z,K,oe={valid:!0})=>{for(const ie in Z){const Y=Z[ie];if(Y){const{_f:le,...me}=Y;if(le){const ce=l.array.has(le.name),ve=Y._f&&uft(Y._f);ve&&u.validatingFields&&b([ie],!0);const ye=await jW(Y,l.disabled,a,g,n.shouldUseNativeValidation&&!K,ce);if(ve&&u.validatingFields&&b([ie]),ye[le.name]&&(oe.valid=!1,K))break;!K&&(jt(ye,le.name)?ce?Cje(r.errors,ye,le.name):br(r.errors,le.name,ye[le.name]):Ti(r.errors,le.name))}!ts(me)&&await w(me,K,oe)}}return oe.valid},T=(Z,K)=>!n.disabled&&(Z&&K&&br(a,Z,K),!bm(L(),i)),P=(Z,K,oe)=>kje(Z,l,{...s.mount?a:wo(K)?i:Rd(Z)?{[Z]:K}:K},oe,K),j=(Z,K,oe={})=>{const ie=jt(o,Z);let Y=K;if(ie){const le=ie._f;le&&(!le.disabled&&br(a,Z,Ije(K,le)),Y=i4(le.ref)&&es(K)?"":K,Mje(le.ref)?[...le.ref.options].forEach(me=>me.selected=Y.includes(me.value)):le.refs?lC(le.ref)?le.refs.length>1?le.refs.forEach(me=>(!me.defaultChecked||!me.disabled)&&(me.checked=Array.isArray(Y)?!!Y.find(ce=>ce===me.value):Y===me.value)):le.refs[0]&&(le.refs[0].checked=!!Y):le.refs.forEach(me=>me.checked=me.value===Y):EW(le.ref)?le.ref.value="":(le.ref.value=Y,le.ref.type||d.values.next({name:Z,values:{...a}})))}(oe.shouldDirty||oe.shouldTouch)&&O(Z,Y,oe.shouldTouch,oe.shouldDirty,!0),oe.shouldValidate&&I(Z)},D=(Z,K,oe)=>{for(const ie in K){const Y=K[ie],le=`${Z}.${ie}`,me=jt(o,le);(l.array.has(Z)||pi(Y)||me&&!me._f)&&!J0(Y)?D(le,Y,oe):j(le,Y,oe)}},N=(Z,K,oe={})=>{const ie=jt(o,Z),Y=l.array.has(Z),le=Fi(K);br(a,Z,le),Y?(d.array.next({name:Z,values:{...a}}),(u.isDirty||u.dirtyFields)&&oe.shouldDirty&&d.state.next({name:Z,dirtyFields:dC(i,a),isDirty:T(Z,le)})):!ie||ie._f||es(le)?j(Z,le,oe):D(Z,le,oe),PW(Z,l)&&d.state.next({...r}),d.values.next({name:s.mount?Z:void 0,values:{...a}})},E=async Z=>{s.mount=!0;const K=Z.target;let oe=K.name,ie=!0;const Y=jt(o,oe),le=me=>{ie=Number.isNaN(me)||J0(me)&&isNaN(me.getTime())||bm(me,jt(a,oe,me))};if(Y){let me,ce;const ve=K.type?qW(Y._f):uje(Z),ye=Z.type===hje||Z.type===Jdt,_e=!(Ie=>Ie.mount&&(Ie.required||Ie.min||Ie.max||Ie.maxLength||Ie.minLength||Ie.pattern||Ie.validate))(Y._f)&&!n.resolver&&!jt(r.errors,oe)&&!Y._f.deps||((Ie,De,nt,Fe,kt)=>!kt.isOnAll&&(!nt&&kt.isOnTouch?!(De||Ie):(nt?Fe.isOnBlur:kt.isOnBlur)?!Ie:!(nt?Fe.isOnChange:kt.isOnChange)||Ie))(ye,jt(r.touchedFields,oe),r.isSubmitted,h,f),Se=PW(oe,l,ye);br(a,oe,ve),ye?(Y._f.onBlur&&Y._f.onBlur(Z),e&&e(0)):Y._f.onChange&&Y._f.onChange(Z);const Ae=O(oe,ve,ye,!1),je=!ts(Ae)||Se;if(!ye&&d.values.next({name:oe,type:Z.type,values:{...a}}),_e)return u.isValid&&(n.mode==="onBlur"&&ye?v():ye||v()),je&&d.state.next({name:oe,...Se?{}:Ae});if(!ye&&Se&&d.state.next({...r}),n.resolver){const{errors:Ie}=await S([oe]);if(le(ve),ie){const De=Lje(r.errors,o,oe),nt=Lje(Ie,o,De.name||oe);me=nt.error,oe=nt.name,ce=ts(Ie)}}else b([oe],!0),me=(await jW(Y,l.disabled,a,g,n.shouldUseNativeValidation))[oe],b([oe]),le(ve),ie&&(me?ce=!1:u.isValid&&(ce=await w(o,!0)));ie&&(Y._f.deps&&I(Y._f.deps),k(oe,ce,me,Ae))}},A=(Z,K)=>{if(jt(r.errors,K)&&Z.focus)return Z.focus(),1},I=async(Z,K={})=>{let oe,ie;const Y=As(Z);if(n.resolver){const le=await(async me=>{const{errors:ce}=await S(me);if(me)for(const ve of me){const ye=jt(ce,ve);ye?br(r.errors,ve,ye):Ti(r.errors,ve)}else r.errors=ce;return ce})(wo(Z)?Z:Y);oe=ts(le),ie=Z?!Y.some(me=>jt(le,me)):oe}else Z?(ie=(await Promise.all(Y.map(async le=>{const me=jt(o,le);return await w(me&&me._f?{[le]:me}:me)}))).every(Boolean),(ie||r.isValid)&&v()):ie=oe=await w(o);return d.state.next({...!Rd(Z)||u.isValid&&oe!==r.isValid?{}:{name:Z},...n.resolver||!Z?{isValid:oe}:{},errors:r.errors}),K.shouldFocus&&!ie&&Ub(o,A,Z?Y:l.mount),ie},L=Z=>{const K={...s.mount?a:i};return wo(Z)?K:Rd(Z)?jt(K,Z):Z.map(oe=>jt(K,oe))},F=(Z,K)=>({invalid:!!jt((K||r).errors,Z),isDirty:!!jt((K||r).dirtyFields,Z),error:jt((K||r).errors,Z),isValidating:!!jt(r.validatingFields,Z),isTouched:!!jt((K||r).touchedFields,Z)}),Q=(Z,K,oe)=>{const ie=(jt(o,Z,{_f:{}})._f||{}).ref,Y=jt(r.errors,Z)||{},{ref:le,message:me,type:ce,...ve}=Y;br(r.errors,Z,{...ve,...K,ref:ie}),d.state.next({name:Z,errors:r.errors,isValid:!1}),oe&&oe.shouldFocus&&ie&&ie.focus&&ie.focus()},W=(Z,K={})=>{for(const oe of Z?As(Z):l.mount)l.mount.delete(oe),l.array.delete(oe),K.keepValue||(Ti(o,oe),Ti(a,oe)),!K.keepError&&Ti(r.errors,oe),!K.keepDirty&&Ti(r.dirtyFields,oe),!K.keepTouched&&Ti(r.touchedFields,oe),!K.keepIsValidating&&Ti(r.validatingFields,oe),!n.shouldUnregister&&!K.keepDefaultValue&&Ti(i,oe);d.values.next({values:{...a}}),d.state.next({...r,...K.keepDirty?{isDirty:T()}:{}}),!K.keepIsValid&&v()},U=({disabled:Z,name:K,field:oe,fields:ie})=>{(uc(Z)&&s.mount||Z||l.disabled.has(K))&&(Z?l.disabled.add(K):l.disabled.delete(K),O(K,qW(oe?oe._f:jt(ie,K)._f),!1,!1,!0))},X=(Z,K={})=>{let oe=jt(o,Z);const ie=uc(K.disabled)||uc(n.disabled);return br(o,Z,{...oe||{},_f:{...oe&&oe._f?oe._f:{ref:{name:Z}},name:Z,mount:!0,...K}}),l.mount.add(Z),oe?U({field:oe,disabled:uc(K.disabled)?K.disabled:n.disabled,name:Z}):p(Z,!0,K.value),{...ie?{disabled:K.disabled||n.disabled}:{},...n.progressive?{required:!!K.required,min:fC(K.min),max:fC(K.max),minLength:fC(K.minLength),maxLength:fC(K.maxLength),pattern:fC(K.pattern)}:{},name:Z,onChange:E,onBlur:E,ref:Y=>{if(Y){X(Z,K),oe=jt(o,Z);const le=wo(Y.value)&&Y.querySelectorAll&&Y.querySelectorAll("input,select,textarea")[0]||Y,me=(ve=>RW(ve)||lC(ve))(le),ce=oe._f.refs||[];if(me?ce.find(ve=>ve===le):le===oe._f.ref)return;br(o,Z,{_f:{...oe._f,...me?{refs:[...ce.filter(VW),le,...Array.isArray(jt(i,Z))?[{}]:[]],ref:{type:le.type,name:Z}}:{ref:le}}}),p(Z,!1,void 0,le)}else oe=jt(o,Z,{}),oe._f&&(oe._f.mount=!1),(n.shouldUnregister||K.shouldUnregister)&&(!dje(l.array,Z)||!s.action)&&l.unMount.add(Z)}}},G=()=>n.shouldFocusError&&Ub(o,A,l.mount),ae=(Z,K)=>async oe=>{let ie;oe&&(oe.preventDefault&&oe.preventDefault(),oe.persist&&oe.persist());let Y=Fi(a);if(l.disabled.size)for(const le of l.disabled)br(Y,le,void 0);if(d.state.next({isSubmitting:!0}),n.resolver){const{errors:le,values:me}=await S();r.errors=le,Y=me}else await w(o);if(Ti(r.errors,"root"),ts(r.errors)){d.state.next({errors:{}});try{await Z(Y,oe)}catch(le){ie=le}}else K&&await K({...r.errors},oe),G(),setTimeout(G);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ts(r.errors)&&!ie,submitCount:r.submitCount+1,errors:r.errors}),ie)throw ie},ne=(Z,K={})=>{const oe=Z?Fi(Z):i,ie=Fi(oe),Y=ts(Z),le=Y?i:ie;if(K.keepDefaultValues||(i=oe),!K.keepValues){if(K.keepDirtyValues){const me=new Set([...l.mount,...Object.keys(dC(i,a))]);for(const ce of Array.from(me))jt(r.dirtyFields,ce)?br(le,ce,jt(a,ce)):N(ce,jt(le,ce))}else{if(CW&&wo(Z))for(const me of l.mount){const ce=jt(o,me);if(ce&&ce._f){const ve=Array.isArray(ce._f.refs)?ce._f.refs[0]:ce._f.ref;if(i4(ve)){const ye=ve.closest("form");if(ye){ye.reset();break}}}}o={}}a=n.shouldUnregister?K.keepDefaultValues?Fi(i):{}:Fi(le),d.array.next({values:{...le}}),d.values.next({values:{...le}})}l={mount:K.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!K.keepIsValid||!!K.keepDirtyValues,s.watch=!!n.shouldUnregister,d.state.next({submitCount:K.keepSubmitCount?r.submitCount:0,isDirty:!Y&&(K.keepDirty?r.isDirty:!(!K.keepDefaultValues||bm(Z,i))),isSubmitted:!!K.keepIsSubmitted&&r.isSubmitted,dirtyFields:Y?{}:K.keepDirtyValues?K.keepDefaultValues&&a?dC(i,a):r.dirtyFields:K.keepDefaultValues&&Z?dC(i,Z):K.keepDirty?r.dirtyFields:{},touchedFields:K.keepTouched?r.touchedFields:{},errors:K.keepErrors?r.errors:{},isSubmitSuccessful:!!K.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1})},re=(Z,K)=>ne(jd(Z)?Z(a):Z,K);return{control:{register:X,unregister:W,getFieldState:F,handleSubmit:ae,setError:Q,_executeSchema:S,_getWatch:P,_getDirty:T,_updateValid:v,_removeUnmounted:()=>{for(const Z of l.unMount){const K=jt(o,Z);K&&(K._f.refs?K._f.refs.every(oe=>!VW(oe)):!VW(K._f.ref))&&W(Z)}l.unMount=new Set},_updateFieldArray:(Z,K=[],oe,ie,Y=!0,le=!0)=>{if(ie&&oe&&!n.disabled){if(s.action=!0,le&&Array.isArray(jt(o,Z))){const me=oe(jt(o,Z),ie.argA,ie.argB);Y&&br(o,Z,me)}if(le&&Array.isArray(jt(r.errors,Z))){const me=oe(jt(r.errors,Z),ie.argA,ie.argB);Y&&br(r.errors,Z,me),((ce,ve)=>{!cC(jt(ce,ve)).length&&Ti(ce,ve)})(r.errors,Z)}if(u.touchedFields&&le&&Array.isArray(jt(r.touchedFields,Z))){const me=oe(jt(r.touchedFields,Z),ie.argA,ie.argB);Y&&br(r.touchedFields,Z,me)}u.dirtyFields&&(r.dirtyFields=dC(i,a)),d.state.next({name:Z,isDirty:T(Z,K),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else br(a,Z,K)},_updateDisabledField:U,_getFieldArray:Z=>cC(jt(s.mount?a:i,Z,n.shouldUnregister?jt(i,Z,[]):[])),_reset:ne,_resetDefaultValues:()=>jd(n.defaultValues)&&n.defaultValues().then(Z=>{re(Z,n.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:Z=>{r={...r,...Z}},_disableForm:Z=>{uc(Z)&&(d.state.next({disabled:Z}),Ub(o,(K,oe)=>{const ie=jt(o,oe);ie&&(K.disabled=ie._f.disabled||Z,Array.isArray(ie._f.refs)&&ie._f.refs.forEach(Y=>{Y.disabled=ie._f.disabled||Z}))},0,!1))},_subjects:d,_proxyFormState:u,_setErrors:Z=>{r.errors=Z,d.state.next({errors:r.errors,isValid:!1})},get _fields(){return o},get _formValues(){return a},get _state(){return s},set _state(Z){s=Z},get _defaultValues(){return i},get _names(){return l},set _names(Z){l=Z},get _formState(){return r},set _formState(Z){r=Z},get _options(){return n},set _options(Z){n={...n,...Z}}},trigger:I,register:X,handleSubmit:ae,watch:(Z,K)=>jd(Z)?d.values.subscribe({next:oe=>Z(P(void 0,K),oe)}):P(Z,K,!0),setValue:N,getValues:L,reset:re,resetField:(Z,K={})=>{jt(o,Z)&&(wo(K.defaultValue)?N(Z,Fi(jt(i,Z))):(N(Z,K.defaultValue),br(i,Z,Fi(K.defaultValue))),K.keepTouched||Ti(r.touchedFields,Z),K.keepDirty||(Ti(r.dirtyFields,Z),r.isDirty=K.defaultValue?T(Z,Fi(jt(i,Z))):T()),K.keepError||(Ti(r.errors,Z),u.isValid&&v()),d.state.next({...r}))},clearErrors:Z=>{Z&&As(Z).forEach(K=>Ti(r.errors,K)),d.state.next({errors:Z?r.errors:{}})},unregister:W,setError:Q,setFocus:(Z,K={})=>{const oe=jt(o,Z),ie=oe&&oe._f;if(ie){const Y=ie.refs?ie.refs[0]:ie.ref;Y.focus&&(Y.focus(),K.shouldSelect&&jd(Y.select)&&Y.select())}},getFieldState:F}}kM=function(t={}){const e=ge.useRef(void 0),n=ge.useRef(void 0),[r,o]=ge.useState({isDirty:!1,isValidating:!1,isLoading:jd(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:jd(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...fft(t),formState:r});const i=e.current.control;return i._options=t,o4({subject:i._subjects.state,next:a=>{Oje(a,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),ge.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),ge.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),ge.useEffect(()=>{t.values&&!bm(t.values,n.current)?(i._reset(t.values,i._options.resetOptions),n.current=t.values,o(a=>({...a}))):i._resetDefaultValues()},[t.values,i]),ge.useEffect(()=>{t.errors&&i._setErrors(t.errors)},[t.errors,i]),ge.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),ge.useEffect(()=>{t.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[t.shouldUnregister,i]),e.current.formState=xje(r,i),e.current};const zje=(t,e,n)=>{if(t&&"reportValidity"in t){const r=jt(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},Vje=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?zje(r.ref,n,t):r.refs&&r.refs.forEach(o=>zje(o,n,t))}},hft=(t,e)=>{e.shouldUseNativeValidation&&Vje(t,e);const n={};for(const r in t){const o=jt(e.fields,r),i=Object.assign(t[r]||{},{ref:o&&o.ref});if(pft(e.names||Object.keys(t),r)){const a=Object.assign({},jt(n,r));br(a,"root",i),br(n,r,a)}else br(n,r,i)}return n},pft=(t,e)=>t.some(n=>n.startsWith(e+"."));let qje;qje=function(t,e){for(var n={};t.length;){var r=t[0],o=r.code,i=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[a]={message:s.message,type:s.code}}else n[a]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return t.push(d)})}),e){var l=n[a].types,c=l&&l[r.code];n[a]=Sje(a,e,n,o,c?[].concat(c,r.message):r.message)}t.shift()}return n},wM=function(t,e,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve(function(a,s){try{var l=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(c){return i.shouldUseNativeValidation&&Vje({},i),{errors:{},values:n.raw?r:c}})}catch(c){return s(c)}return l&&l.then?l.then(void 0,s):l}(0,function(a){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(a))return{values:{},errors:hft(qje(a.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw a}))}catch(a){return Promise.reject(a)}}};function Fje(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}EH=function(t){t===void 0&&(t={});var e=t.onResize,n=_.useRef(void 0);n.current=e;var r=t.round||Math.round,o=_.useRef(),i=_.useState({width:void 0,height:void 0}),a=i[0],s=i[1],l=_.useRef(!1);_.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var c=_.useRef({width:void 0,height:void 0}),u=function(d,f){var h=_.useRef(null),g=_.useRef(null);g.current=f;var v=_.useRef(null);_.useEffect(function(){b()});var b=_.useCallback(function(){var p=v.current,O=g.current,k=p||(O?O instanceof Element?O:O.current:null);h.current&&h.current.element===k&&h.current.subscriber===d||(h.current&&h.current.cleanup&&h.current.cleanup(),h.current={element:k,subscriber:d,cleanup:k?d(k):void 0})},[d]);return _.useEffect(function(){return function(){h.current&&h.current.cleanup&&(h.current.cleanup(),h.current=null)}},[]),_.useCallback(function(p){v.current=p,b()},[b])}(_.useCallback(function(d){return o.current&&o.current.box===t.box&&o.current.round===r||(o.current={box:t.box,round:r,instance:new ResizeObserver(function(f){var h=f[0],g=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",v=Fje(h,g,"inlineSize"),b=Fje(h,g,"blockSize"),p=v?r(v):void 0,O=b?r(b):void 0;if(c.current.width!==p||c.current.height!==O){var k={width:p,height:O};c.current.width=p,c.current.height=O,n.current?n.current(k):l.current||s(k)}})}),o.current.instance.observe(d,{box:t.box}),function(){o.current&&o.current.instance.unobserve(d)}},[t.box,r]),t.ref);return _.useMemo(function(){return{ref:u,width:a.width,height:a.height}},[u,a.width,a.height])};let FW,Xb,BW;xK=t=>{const e=ue.c(4);let n,r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx("title",{children:"Python Logo"}),r=y.jsx("path",{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]),e[2]!==t?(o=y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 448 512",...t,children:[n,r]}),e[2]=t,e[3]=o):o=e[3],o},RIe=t=>{const e=ue.c(4);let n,r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx("title",{children:"Markdown Icon"}),r=y.jsx("path",{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]),e[2]!==t?(o=y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 640 512",fill:"currentColor",...t,children:[n,r]}),e[2]=t,e[3]=o):o=e[3],o},hG=bje,I6e=()=>{const t=ue.c(4),e=mo().formState.errors;if(Object.keys(e).length===0)return null;let n,r;return t[0]!==e?(n=Object.values(e).map(mft).filter(Boolean).join(", "),t[0]=e,t[1]=n):n=t[1],t[2]!==n?(r=y.jsx("div",{className:"text-destructive p-2 rounded-md bg-red-500/10",children:n}),t[2]=n,t[3]=r):r=t[3],r},FW=_.createContext({}),rr=t=>{const e=ue.c(10);let n,r,o,i;return e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1],e[2]!==n.name?(r={name:n.name},e[2]=n.name,e[3]=r):r=e[3],e[4]!==n?(o=y.jsx(cft,{...n}),e[4]=n,e[5]=o):o=e[5],e[6]!==n.name||e[7]!==r||e[8]!==o?(i=y.jsx(FW,{value:r,children:o},n.name),e[6]=n.name,e[7]=r,e[8]=o,e[9]=i):i=e[9],i},Xb=()=>{const t=ue.c(11),e=_.use(FW),n=_.use(BW),{getFieldState:r,formState:o}=mo();let i;t[0]!==e.name||t[1]!==o||t[2]!==r?(i=r(e.name,o),t[0]=e.name,t[1]=o,t[2]=r,t[3]=i):i=t[3];const a=i;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=n,l=`${s}-form-item`,c=`${s}-form-item-description`,u=`${s}-form-item-message`;let d;return t[4]!==e.name||t[5]!==a||t[6]!==s||t[7]!==l||t[8]!==c||t[9]!==u?(d={id:s,name:e.name,formItemId:l,formDescriptionId:c,formMessageId:u,...a},t[4]=e.name,t[5]=a,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=d):d=t[10],d},BW=_.createContext({}),jr=_.forwardRef((t,e)=>{const n=ue.c(14);let r,o;n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const i=_.useId();let a,s,l,c;return n[3]!==i?(a={id:i},n[3]=i,n[4]=a):a=n[4],n[5]!==r?(s=we("flex flex-col gap-1",r),n[5]=r,n[6]=s):s=n[6],n[7]!==o||n[8]!==e||n[9]!==s?(l=y.jsx("div",{ref:e,className:s,...o}),n[7]=o,n[8]=e,n[9]=s,n[10]=l):l=n[10],n[11]!==a||n[12]!==l?(c=y.jsx(BW,{value:a,children:l}),n[11]=a,n[12]=l,n[13]=c):c=n[13],c}),jr.displayName="FormItem",dr=_.forwardRef((t,e)=>{const n=ue.c(11);let r,o;n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const{error:i,formItemId:a}=Xb();if(!o.children)return;const s=i&&"text-destructive";let l,c;return n[3]!==r||n[4]!==s?(l=we(s,r),n[3]=r,n[4]=s,n[5]=l):l=n[5],n[6]!==a||n[7]!==o||n[8]!==e||n[9]!==l?(c=y.jsx(nf,{ref:e,className:l,htmlFor:a,...o}),n[6]=a,n[7]=o,n[8]=e,n[9]=l,n[10]=c):c=n[10],c}),dr.displayName="FormLabel",Ir=_.forwardRef((t,e)=>{const n=ue.c(8);let r;n[0]!==t?({...r}=t,n[0]=t,n[1]=r):r=n[1];const{error:o,formItemId:i,formDescriptionId:a,formMessageId:s}=Xb(),l=o?`${a} ${s}`:a,c=!!o;let u;return n[2]!==i||n[3]!==r||n[4]!==e||n[5]!==l||n[6]!==c?(u=y.jsx(kN,{ref:e,id:i,"aria-describedby":l,"aria-invalid":c,...r}),n[2]=i,n[3]=r,n[4]=e,n[5]=l,n[6]=c,n[7]=u):u=n[7],u}),Ir.displayName="FormControl",Xi=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o;n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const{formDescriptionId:i}=Xb();if(!o.children)return null;let a,s;return n[3]!==r?(a=we("text-sm text-muted-foreground",r),n[3]=r,n[4]=a):a=n[4],n[5]!==i||n[6]!==o||n[7]!==e||n[8]!==a?(s=y.jsx("p",{ref:e,id:i,className:a,...o}),n[5]=i,n[6]=o,n[7]=e,n[8]=a,n[9]=s):s=n[9],s}),Xi.displayName="FormDescription",Di=_.forwardRef((t,e)=>{const n=ue.c(12);let r,o,i;n[0]!==t?({className:o,children:r,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const{error:a,formMessageId:s}=Xb(),l=a!=null&&a.message?String(a==null?void 0:a.message):r;if(!l)return null;let c,u;return n[4]!==o?(c=we("text-xs font-medium text-destructive",o),n[4]=o,n[5]=c):c=n[5],n[6]!==l||n[7]!==s||n[8]!==i||n[9]!==e||n[10]!==c?(u=y.jsx("p",{ref:e,id:s,className:c,...i,children:l}),n[6]=l,n[7]=s,n[8]=i,n[9]=e,n[10]=c,n[11]=u):u=n[11],u}),Di.displayName="FormMessage";const Bje=t=>{const e=ue.c(7),{className:n}=t,{error:r}=Xb(),o=r!=null&&r.message?String(r==null?void 0:r.message):null;if(!o)return null;let i,a,s;return e[0]!==n?(i=we("stroke-[1.8px]",n),e[0]=n,e[1]=i):i=e[1],e[2]!==i?(a=y.jsx(TN,{className:i}),e[2]=i,e[3]=a):a=e[3],e[4]!==o||e[5]!==a?(s=y.jsx(qn,{content:o,children:a}),e[4]=o,e[5]=a,e[6]=s):s=e[6],s};function mft(t){return t==null?void 0:t.message}Bje.displayName="FormMessageTooltip";function c4(t){return t.split(`
|
456
456
|
`).map(e=>" "+e).join(`
|
457
457
|
`)}function u4(t){return typeof t=="string"?t:t.toCode()}class gft{constructor(e){this.name=e}toCode(){return this.name}}class Dd{constructor(e,n={}){this.value=e,this.opts=n}static from(e,n={}){return new Dd(e,n)}toCode(){const{removeNull:e=!1,removeUndefined:n=!0}=this.opts;if(this.value===void 0)return n?"":"None";if(this.value===null)return e?"":"None";if(typeof this.value=="string")return`'${this.value}'`;if(typeof this.value=="boolean")return this.value?"True":"False";if(typeof this.value=="object"&&"toCode"in this.value)return this.value.toCode();if(Array.isArray(this.value))return this.value.length===0?"[]":`[
|
458
458
|
${c4(this.value.map(r=>new Dd(r,this.opts).toCode()).filter(r=>r!=="").join(`,
|
@@ -471,8 +471,8 @@ ${c4(e.map(u4).join(`,
|
|
471
471
|
# replace ${e} with your data source
|
472
472
|
${new vft(n,r).toCode()}
|
473
473
|
${n}
|
474
|
-
`.trim()}function ev(t){const e={};for(const[n,r]of Object.entries(t))r!==void 0&&(e[n]=new Dd(r));return e}const tv="__count__",d4="default",WW="yearmonthdate",Da="",xft={line:yce,bar:bce,pie:S6,scatter:xce,heatmap:ck,area:gce},Uje="mean",Oft={none:rO,count:Jv,sum:Wce,mean:dce,median:rce,min:ice,max:lce,distinct:Jv,valid:Jv,stdev:EA,stdevp:EA,variance:VE,variancep:VE,bin:Fce},wft={none:"No aggregation",count:"Count of records",sum:"Sum of values",mean:"Mean of values",median:"Median of values",min:"Minimum value",max:"Maximum value",distinct:"Count of distinct records",valid:"Count non-null records",stdev:"Standard deviation",stdevp:"Standard deviation of population",variance:"Variance",variancep:"Variance of population",bin:"Group values into bins"},kft=[d4,"accent","category10","category20","category20b","category20c","dark2","paired","pastel1","pastel2","set1","set2","set3","tableau10","tableau20","blues","greens","greys","oranges","purples","reds","bluegreen","bluepurple","goldgreen","goldorange","goldred","greenblue","orangered","purplebluegreen","purplered","redpurple","yellowgreenblue","yelloworangered","blueorange","brownbluegreen","purplegreen","pinkyellowgreen","purpleorange","redblue","redgrey","redyellowblue","redyellowgreen","spectral","rainbow","sinebow"],Sft={number:"Continuous numerical scale",string:"Discrete categorical scale (inputs treated as strings)",temporal:"Continuous temporal scale"},Cft={year:["Year","2025"],quarter:["Quarter","Q1 2025"],month:["Month","Jan 2025"],week:["Week","Jan 01, 2025"],day:["Day","Jan 01, 2025"],hours:["Hour","Jan 01, 2025 12:00"],minutes:["Minute","Jan 01, 2025 12:34"],seconds:["Second","Jan 01, 2025 12:34:56"],milliseconds:["Millisecond","Jan 01, 2025 12:34:56.789"],date:["Date","Jan 01, 2025"],dayofyear:["Day of Year","Day 1 of 2025"],yearmonth:["Year Month","Jan 2025"],yearmonthdate:["Year Month Date","Jan 01, 2025"],monthdate:["Month Date","Jan 01"]},Zje=["number","string","temporal"],Xje=["year","quarter","month","date","week","day","dayofyear","hours","minutes","seconds","milliseconds"],Hje=["yearmonth","yearmonthdate","monthdate"],_ft=[...Xje,...Hje],Yje=["ascending","descending"],Ad="none",hC="bin",Gje=[Ad,hC,"count","sum","mean","median","min","max","distinct","valid","stdev","stdevp","variance","variancep"],Kje=["none","count","distinct","valid"],ei={LINE:"line",BAR:"bar",PIE:"pie",SCATTER:"scatter",HEATMAP:"heatmap",AREA:"area"},Tft=Object.values(ei),Jje=["X","Y","Color",Ad];function f4(t){switch(t){case"number":case"integer":return"quantitative";case"string":case"boolean":case"unknown":return"nominal";case"date":case"datetime":case"time":case"temporal":return"temporal";default:return us(t),"nominal"}}function UW(t){switch(t){case"number":case"integer":return"number";case"string":case"boolean":case"unknown":return"string";case"date":case"datetime":case"time":return"temporal";default:return us(t),"string"}}function e5e(t){switch(t){case ei.PIE:return"arc";case ei.SCATTER:return"point";case ei.HEATMAP:return"rect";default:return t}}function h4(t,e,n,r){if(t===ei.HEATMAP)return n!=null&&n.maxbins?{maxbins:n==null?void 0:n.maxbins}:void 0;if(e!=="number")return;if(!(n!=null&&n.binned))return r;const o={};return n.step!==void 0&&(o.step=n.step),n.maxbins!==void 0&&(o.maxbins=n.maxbins),Object.keys(o).length===0||o}function t5e(t){var r,o;const e=(r=t.color)==null?void 0:r.range;if(e!=null&&e.length)return{range:e};const n=(o=t.color)==null?void 0:o.scheme;return n&&n!==d4?{scheme:n}:void 0}function Pft(t,e){var n,r,o,i,a;if(!((n=e.general)!=null&&n.stacking)&&ti((o=(r=e.general)==null?void 0:r.colorByColumn)==null?void 0:o.field)&&t===ei.BAR)return{field:(a=(i=e.general)==null?void 0:i.colorByColumn)==null?void 0:a.field}}function n5e(t,e,n){if(e!=="temporal"&&t!==Ad&&t!==hC)return t?e==="string"?Kje.includes(t)?t:void 0:t:n||void 0}function Eft(t){switch(t){case"integer":return",.0f";case"number":return",.2f";default:return}}function r5e(t){var l,c,u,d,f,h,g,v,b,p,O,k,S,w,T,P;const{formValues:e,xEncoding:n,yEncoding:r,colorByEncoding:o}=t;if(!e.tooltips)return;function i(j,D,N){if("aggregate"in j&&j.aggregate==="count"&&!ti(j.field))return{aggregate:"count"};if(j&&"field"in j&&ti(j.field))return j.timeUnit&&!N&&(N=j.field),{field:j.field,aggregate:j.aggregate,timeUnit:j.timeUnit,format:Eft(D),title:N,bin:j.bin}}if(e.tooltips.auto){const j=[],D=i(n,((c=(l=e.general)==null?void 0:l.xColumn)==null?void 0:c.type)||"string",(u=e.xAxis)==null?void 0:u.label);D&&j.push(D);const N=i(r,((f=(d=e.general)==null?void 0:d.yColumn)==null?void 0:f.type)||"string",(h=e.yAxis)==null?void 0:h.label);N&&j.push(N);const E=i(o||{},((v=(g=e.general)==null?void 0:g.colorByColumn)==null?void 0:v.type)||"string");return E&&j.push(E),j}const a=e.tooltips.fields??[],s=[];for(const j of a){if("field"in n&&ti(n.field)&&n.field===j.field){const N=i(n,((p=(b=e.general)==null?void 0:b.xColumn)==null?void 0:p.type)||"string",(O=e.xAxis)==null?void 0:O.label);N&&s.push(N);continue}if("field"in r&&ti(r.field)&&r.field===j.field){const N=i(r,((S=(k=e.general)==null?void 0:k.yColumn)==null?void 0:S.type)||"string",(w=e.yAxis)==null?void 0:w.label);N&&s.push(N);continue}if(o&&"field"in o&&ti(o.field)&&o.field===j.field){const N=i(o,((P=(T=e.general)==null?void 0:T.colorByColumn)==null?void 0:P.type)||"string");N&&s.push(N);continue}const D={field:j.field};s.push(D)}return s}function Rft(t,e,n,r,o){var P,j,D,N;const{xColumn:i,yColumn:a,colorByColumn:s,horizontal:l,stacking:c,title:u,facet:d}=e.general??{};if(t===ei.PIE)return function(E,A,I,L){var G,ae,ne,re;const{yColumn:F,colorByColumn:Q,title:W}=E.general??{};if(!ti(Q==null?void 0:Q.field))return"Color by column is required";if(!ti(F==null?void 0:F.field))return"Size by column is required";const U=ZW(F,(G=E.xAxis)==null?void 0:G.bin,p4((ae=E.xAxis)==null?void 0:ae.label),void 0,ei.PIE),X={field:Q.field,type:f4(Q.selectedDataType||"unknown"),scale:t5e(E),title:p4((ne=E.yAxis)==null?void 0:ne.label)};return{...i5e(ei.PIE,E,A,I,L,W),mark:{type:e5e(ei.PIE),innerRadius:(re=E.style)==null?void 0:re.innerRadius},encoding:{theta:U,color:X,tooltip:r5e({formValues:E,xEncoding:U,yEncoding:U,colorByEncoding:X})}}}(e,n,r,o);if(!ti(i==null?void 0:i.field))return"X-axis column is required";if(!ti(a==null?void 0:a.field))return"Y-axis column is required";const f="x",h="y",g=ZW(i,(P=e.xAxis)==null?void 0:P.bin,p4((j=e.xAxis)==null?void 0:j.label),s!=null&&s.field&&l?c:void 0,t);let v=Uje;(a==null?void 0:a.selectedDataType)==="string"&&(v="count");const b=ZW(a,(D=e.yAxis)==null?void 0:D.bin,p4((N=e.yAxis)==null?void 0:N.label),s!=null&&s.field&&!l?c:void 0,t,v),p=d!=null&&d.row.field?o5e(d.row,t):void 0,O=d!=null&&d.column.field?o5e(d.column,t):void 0,k=function(E,A){var W,U,X,G,ae,ne,re,Z,K;if(E===ei.PIE)return;let I;if(ti((U=(W=A.general)==null?void 0:W.colorByColumn)==null?void 0:U.field))I=(X=A.general)==null?void 0:X.colorByColumn;else{if(!ti((G=A.color)==null?void 0:G.field))return;switch((ae=A.color)==null?void 0:ae.field){case"X":I=(ne=A.general)==null?void 0:ne.xColumn;break;case"Y":I=(re=A.general)==null?void 0:re.yColumn;break;case"Color":I=(Z=A.general)==null?void 0:Z.colorByColumn;break;default:return}}if(!I||!ti(I.field)||I.field===Ad)return;if(I.field===tv)return{aggregate:"count",type:"quantitative"};const L=(K=A.color)==null?void 0:K.bin,F=I.selectedDataType||"string",Q=I==null?void 0:I.aggregate;return{field:I.field,type:f4(F),scale:t5e(A),aggregate:n5e(Q,F),bin:h4(E,F,L)}}(t,e),S=i5e(t,e,n,r,o,u),w={[f]:l?b:g,[h]:l?g:b,xOffset:Pft(t,e),color:k,tooltip:r5e({formValues:e,xEncoding:g,yEncoding:b,colorByEncoding:k}),...p&&{row:p},...O&&{column:O}},T=function(E,A){const I={};return(E==null?void 0:E.linkXAxis)===!1&&(I.x="independent"),(A==null?void 0:A.linkYAxis)===!1&&(I.y="independent"),Object.keys(I).length>0?{resolve:{axis:I}}:void 0}(d==null?void 0:d.column,d==null?void 0:d.row);return{...S,mark:{type:e5e(t)},encoding:w,...T}}function ZW(t,e,n,r,o,i){const a=t.selectedDataType||"string";return t.field===tv?{aggregate:"count",type:"quantitative",bin:h4(o,a,e),title:n===tv?void 0:n,stack:r}:{field:t.field,type:f4(t.selectedDataType||"unknown"),bin:h4(o,a,e),title:n,stack:r,aggregate:n5e(t.aggregate,a,i),sort:t.sort,timeUnit:jft(t)}}function o5e(t,e){const n={maxbins:6},r=h4(e,t.selectedDataType||"string",{maxbins:t.maxbins,binned:t.binned},n);return{field:t.field,sort:t.sort,timeUnit:Dft(t),type:f4(t.selectedDataType||"unknown"),bin:r}}function i5e(t,e,n,r,o,i){var s,l,c;let a=((s=e.style)==null?void 0:s.gridLines)??!1;return t===ei.SCATTER&&(a=!0),{$schema:"https://vega.github.io/schema/vega-lite/v5.json",background:n==="dark"?"dark":"white",title:i,data:{values:[]},height:((l=e.yAxis)==null?void 0:l.height)??o,width:((c=e.xAxis)==null?void 0:c.width)??r,config:{axis:{grid:a}}}}function ti(t){return t!==void 0&&t.trim()!==Da}function p4(t){const e=t==null?void 0:t.trim();return e===Da?void 0:e}function jft(t){if(t.selectedDataType==="temporal")return t.timeUnit??WW}function Dft(t){if(t.selectedDataType==="temporal")return t.timeUnit??WW}const a5e=_.createContext({fields:[],saveForm:Zi.NOOP,chartType:ei.LINE}),Md=()=>_.use(a5e);var s5e=["PageUp","PageDown"],l5e=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],c5e={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Hb="Slider",[XW,Aft,Mft]=Lp(Hb),[u5e,r1t]=Wo(Hb,[Mft]),[Nft,m4]=u5e(Hb),d5e=_.forwardRef((t,e)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:h=!1,form:g,...v}=t,b=_.useRef(new Set),p=_.useRef(0),O=a==="horizontal"?$ft:Ift,[k=[],S]=Ao({prop:u,defaultProp:c,onChange:P=>{var D;(D=[...b.current][p.current])==null||D.focus(),d(P)}}),w=_.useRef(k);function T(P,j,{commit:D}={commit:!1}){const N=function(I){return(String(I).split(".")[1]||"").length}(i),E=function(I,L){const F=Math.pow(10,L);return Math.round(I*F)/F}(Math.round((P-r)/i)*i+r,N),A=VO(E,[r,o]);S((I=[])=>{const L=function(F=[],Q,W){const U=[...F];return U[W]=Q,U.sort((X,G)=>X-G)}(I,A,j);if(function(F,Q){if(Q>0){const W=function(U){return U.slice(0,-1).map((X,G)=>U[G+1]-X)}(F);return Math.min(...W)>=Q}return!0}(L,l*i)){p.current=L.indexOf(A);const F=String(L)!==String(I);return F&&D&&f(L),F?L:I}return I})}return y.jsx(Nft,{scope:t.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:p,thumbs:b.current,values:k,orientation:a,form:g,children:y.jsx(XW.Provider,{scope:t.__scopeSlider,children:y.jsx(XW.Slot,{scope:t.__scopeSlider,children:y.jsx(O,{"aria-disabled":s,"data-disabled":s?"":void 0,...v,ref:e,onPointerDown:ut(v.onPointerDown,()=>{s||(w.current=k)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:function(P){const j=function(D,N){if(D.length===1)return 0;const E=D.map(I=>Math.abs(I-N)),A=Math.min(...E);return E.indexOf(A)}(k,P);T(P,j)},onSlideMove:s?void 0:function(P){T(P,p.current)},onSlideEnd:s?void 0:function(){const P=w.current[p.current];k[p.current]!==P&&f(k)},onHomeKeyDown:()=>!s&&T(r,0,{commit:!0}),onEndKeyDown:()=>!s&&T(o,k.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:j})=>{if(!s){const D=s5e.includes(P.key)||P.shiftKey&&l5e.includes(P.key)?10:1,N=p.current;T(k[N]+i*D*j,N,{commit:!0})}}})})})})});d5e.displayName=Hb;var[f5e,h5e]=u5e(Hb,{startEdge:"left",endEdge:"right",size:"width",direction:1}),$ft=_.forwardRef((t,e)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=t,[d,f]=_.useState(null),h=ln(e,k=>f(k)),g=_.useRef(void 0),v=yf(o),b=v==="ltr",p=b&&!i||!b&&i;function O(k){const S=g.current||d.getBoundingClientRect(),w=GW([0,S.width],p?[n,r]:[r,n]);return g.current=S,w(k-S.left)}return y.jsx(f5e,{scope:t.__scopeSlider,startEdge:p?"left":"right",endEdge:p?"right":"left",direction:p?1:-1,size:"width",children:y.jsx(p5e,{dir:v,"data-orientation":"horizontal",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const S=O(k.clientX);a==null||a(S)},onSlideMove:k=>{const S=O(k.clientX);s==null||s(S)},onSlideEnd:()=>{g.current=void 0,l==null||l()},onStepKeyDown:k=>{const S=c5e[p?"from-left":"from-right"].includes(k.key);c==null||c({event:k,direction:S?-1:1})}})})}),Ift=_.forwardRef((t,e)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=t,u=_.useRef(null),d=ln(e,u),f=_.useRef(void 0),h=!o;function g(v){const b=f.current||u.current.getBoundingClientRect(),p=GW([0,b.height],h?[r,n]:[n,r]);return f.current=b,p(v-b.top)}return y.jsx(f5e,{scope:t.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:y.jsx(p5e,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const b=g(v.clientY);i==null||i(b)},onSlideMove:v=>{const b=g(v.clientY);a==null||a(b)},onSlideEnd:()=>{f.current=void 0,s==null||s()},onStepKeyDown:v=>{const b=c5e[h?"from-bottom":"from-top"].includes(v.key);l==null||l({event:v,direction:b?-1:1})}})})}),p5e=_.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=t,u=m4(Hb,n);return y.jsx(_t.span,{...c,ref:e,onKeyDown:ut(t.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):s5e.concat(l5e).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:ut(t.onPointerDown,d=>{const f=d.target;f.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(f)?f.focus():r(d)}),onPointerMove:ut(t.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:ut(t.onPointerUp,d=>{const f=d.target;f.hasPointerCapture(d.pointerId)&&(f.releasePointerCapture(d.pointerId),i(d))})})}),m5e="SliderTrack",g5e=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,o=m4(m5e,n);return y.jsx(_t.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:e})});g5e.displayName=m5e;var HW="SliderRange",v5e=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,o=m4(HW,n),i=h5e(HW,n),a=ln(e,_.useRef(null)),s=o.values.length,l=o.values.map(d=>x5e(d,o.min,o.max)),c=s>1?Math.min(...l):0,u=100-Math.max(...l);return y.jsx(_t.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:a,style:{...t.style,[i.startEdge]:c+"%",[i.endEdge]:u+"%"}})});v5e.displayName=HW;var YW="SliderThumb",y5e=_.forwardRef((t,e)=>{const n=Aft(t.__scopeSlider),[r,o]=_.useState(null),i=ln(e,s=>o(s)),a=_.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return y.jsx(Qft,{...t,ref:i,index:a})}),Qft=_.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:o,...i}=t,a=m4(YW,n),s=h5e(YW,n),[l,c]=_.useState(null),u=ln(e,O=>c(O)),d=!l||a.form||!!l.closest("form"),f=Jw(l),h=a.values[r],g=h===void 0?0:x5e(h,a.min,a.max),v=function(O,k){return k>2?`Value ${O+1} of ${k}`:k===2?["Minimum","Maximum"][O]:void 0}(r,a.values.length),b=f==null?void 0:f[s.size],p=b?function(O,k,S){const w=O/2,T=GW([0,50],[0,w]);return(w-T(k)*S)*S}(b,g,s.direction):0;return _.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),y.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${g}% + ${p}px)`},children:[y.jsx(XW.ItemSlot,{scope:t.__scopeSlider,children:y.jsx(_t.span,{role:"slider","aria-label":t["aria-label"]||v,"aria-valuemin":a.min,"aria-valuenow":h,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:h===void 0?{display:"none"}:t.style,onFocus:ut(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&y.jsx(b5e,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},r)]})});y5e.displayName=YW;var b5e=_.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const o=_.useRef(null),i=ln(o,r),a=G1(e);return _.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&c){const u=new Event("input",{bubbles:!0});c.call(s,e),s.dispatchEvent(u)}},[a,e]),y.jsx(_t.input,{style:{display:"none"},...n,ref:i,defaultValue:e})});function x5e(t,e,n){return VO(100/(n-e)*(t-e),[0,100])}function GW(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}b5e.displayName="RadioBubbleInput";var g4=d5e,O5e=g5e,w5e=v5e,KW=y5e;PN=function(t){const e=ue.c(6),[n,r]=_.useState(t);let o,i,a,s,l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c=>{var u;(u=c==null?void 0:c.stopPropagation)==null||u.call(c),r(!0)},e[0]=o):o=e[0],e[1]===Symbol.for("react.memo_cache_sentinel")?(i=c=>{var u;(u=c==null?void 0:c.stopPropagation)==null||u.call(c),r(!1)},e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c=>{var u;(u=c==null?void 0:c.stopPropagation)==null||u.call(c),r(Lft)},e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(s={setTrue:o,setFalse:i,toggle:a},e[3]=s):s=e[3],e[4]!==n?(l=[n,s],e[4]=n,e[5]=l):l=e[5],l};function Lft(t){return!t}const JW=_.forwardRef((t,e)=>{const n=ue.c(25);let r,o,i;n[0]!==t?({className:r,valueMap:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const[a,s]=PN(!1);let l,c,u,d,f,h,g,v;return n[4]!==r?(l=we("relative flex touch-none select-none hover:cursor-pointer","data-[orientation=horizontal]:w-full data-[orientation=horizontal]:items-center","data-[orientation=vertical]:h-full data-[orientation=vertical]:justify-center","data-[disabled]:cursor-not-allowed",r),n[4]=r,n[5]=l):l=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(c=we("relative grow overflow-hidden rounded-full bg-slate-200 dark:bg-accent/60","data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-full","data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2"),n[6]=c):c=n[6],n[7]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(O5e,{"data-testid":"track",className:c,children:y.jsx(w5e,{"data-testid":"range",className:we("absolute bg-blue-500 dark:bg-primary","data-[orientation=horizontal]:h-full","data-[orientation=vertical]:w-full","data-[disabled]:opacity-50")})}),n[7]=u):u=n[7],n[8]!==s.setFalse||n[9]!==s.setTrue?(d=y.jsx($O,{asChild:!0,children:y.jsx(KW,{"data-testid":"thumb",className:"block h-4 w-4 rounded-full shadow-xsSolid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",onFocus:s.setTrue,onBlur:s.setFalse,onMouseEnter:s.setTrue,onMouseLeave:s.setFalse})}),n[8]=s.setFalse,n[9]=s.setTrue,n[10]=d):d=n[10],n[11]!==o.value||n[12]!==i?(f=o.value!=null&&o.value.length===1&&y.jsx(yg,{children:nh(i(o.value[0]))},o.value[0]),n[11]=o.value,n[12]=i,n[13]=f):f=n[13],n[14]!==f?(h=y.jsx(ak,{children:f}),n[14]=f,n[15]=h):h=n[15],n[16]!==a||n[17]!==d||n[18]!==h?(g=y.jsx(za,{children:y.jsxs(IO,{delayDuration:0,open:a,children:[d,h]})}),n[16]=a,n[17]=d,n[18]=h,n[19]=g):g=n[19],n[20]!==o||n[21]!==e||n[22]!==l||n[23]!==g?(v=y.jsxs(g4,{ref:e,className:l,...o,children:[u,g]}),n[20]=o,n[21]=e,n[22]=l,n[23]=g,n[24]=v):v=n[24],v});JW.displayName=g4.displayName;function k5e(t){return()=>t}function zft(t){t()}function S5e(t,e){return n=>t(e(n))}function C5e(t,e){return()=>t(e)}function eU(t){return t!==void 0}function Yb(){}function v4(t,e){return e(t),t}function Vft(t,e){return e(t)}function ko(...t){return t}function zr(t,e){return t(1,e)}function Wn(t,e){t(0,e)}function tU(t){t(2)}function Ji(t){return t(4)}function cn(t,e){return zr(t,function(n,r){return o=>n(r,o)}(e,0))}function Nd(t,e){const n=t(1,r=>{n(),e(r)});return n}function _5e(t){let e,n;return r=>o=>{e=o,n&&clearTimeout(n),n=setTimeout(()=>{r(e)},t)}}function T5e(t,e){return t===e}function So(t=T5e){let e;return n=>r=>{t(e,r)||(e=r,n(r))}}function kn(t){return e=>n=>{t(n)&&e(n)}}function Gt(t){return e=>S5e(e,t)}function $d(t){return e=>()=>{e(t)}}function xt(t,...e){const n=function(...r){return o=>r.reduceRight(Vft,o)}(...e);return(r,o)=>{switch(r){case 2:return void tU(t);case 1:return zr(t,n(o))}}}function Id(t,e){return n=>r=>{n(e=t(e,r))}}function Gb(t){return e=>n=>{t>0?t--:e(n)}}function xm(t){let e,n=null;return r=>o=>{n=o,!e&&(e=setTimeout(()=>{e=void 0,r(n)},t))}}function Zn(...t){const e=new Array(t.length);let n=0,r=null;const o=Math.pow(2,t.length)-1;return t.forEach((i,a)=>{const s=Math.pow(2,a);zr(i,l=>{const c=n;n|=s,e[a]=l,c!==o&&n===o&&r&&(r(),r=null)})}),i=>a=>{const s=()=>{i([a].concat(e))};n===o?s():r=s}}function Rt(t){let e=t;const n=ar();return(r,o)=>{switch(r){case 0:e=o;break;case 1:o(e);break;case 4:return e}return n(r,o)}}function Aa(t,e){return v4(Rt(e),n=>cn(t,n))}function ar(){const t=[];return(e,n)=>{switch(e){case 0:return void t.slice().forEach(r=>{r(n)});case 2:return void t.splice(0,t.length);case 1:return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}}}function yl(t){return v4(ar(),e=>cn(t,e))}function Mr(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:qft(),singleton:n}}const qft=()=>Symbol();function Bi(...t){const e=ar(),n=new Array(t.length);let r=0;const o=Math.pow(2,t.length)-1;return t.forEach((i,a)=>{const s=Math.pow(2,a);zr(i,l=>{n[a]=l,r|=s,r===o&&Wn(e,n)})}),function(i,a){switch(i){case 2:return void tU(e);case 1:return r===o&&a(n),zr(e,a)}}}function Pn(t,e=T5e){return xt(t,So(e))}function P5e(...t){return function(e,n){switch(e){case 2:return;case 1:return function(...r){return()=>{r.map(zft)}}(...t.map(r=>zr(r,n)))}}}var Ms=(t=>(t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t))(Ms||{});const Fft={0:"debug",3:"error",1:"log",2:"warn"},Om=Mr(()=>{const t=Rt(3);return{log:Rt((e,n,r=1)=>{var o;r>=((o=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)!=null?o:Ji(t))&&console[Fft[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,n)}),logLevel:t}},[],{singleton:!0});function nv(t,e,n){return nU(t,e,n).callbackRef}function nU(t,e,n){const r=ge.useRef(null);let o=a=>{};const i=ge.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(a=>{const s=()=>{const l=a[0].target;l.offsetParent!==null&&t(l)};n?s():requestAnimationFrame(s)}):null,[t,n]);return o=a=>{a&&e?(i==null||i.observe(a),r.current=a):(r.current&&(i==null||i.unobserve(r.current)),r.current=null)},{callbackRef:o,ref:r}}function Bft(t,e,n,r,o,i,a,s,l){const c=ge.useCallback(u=>{const d=function(O,k,S,w){const T=O.length;if(T===0)return null;const P=[];for(let j=0;j<T;j++){const D=O.item(j);if(D.dataset.index===void 0)continue;const N=parseInt(D.dataset.index),E=parseFloat(D.dataset.knownSize),A=k(D,S);if(A===0&&w("Zero-sized element, this should not happen",{child:D},Ms.ERROR),A===E)continue;const I=P[P.length-1];P.length===0||I.size!==A||I.endIndex!==N-1?P.push({endIndex:N,size:A,startIndex:N}):P[P.length-1].endIndex++}return P}(u.children,e,s?"offsetWidth":"offsetHeight",o);let f=u.parentElement;for(;!f.dataset.virtuosoScroller;)f=f.parentElement;const h=f.lastElementChild.dataset.viewportType==="window";let g;h&&(g=f.ownerDocument.defaultView);const v=a?s?a.scrollLeft:a.scrollTop:h?s?g.scrollX||g.document.documentElement.scrollLeft:g.scrollY||g.document.documentElement.scrollTop:s?f.scrollLeft:f.scrollTop,b=a?s?a.scrollWidth:a.scrollHeight:h?s?g.document.documentElement.scrollWidth:g.document.documentElement.scrollHeight:s?f.scrollWidth:f.scrollHeight,p=a?s?a.offsetWidth:a.offsetHeight:h?s?g.innerWidth:g.innerHeight:s?f.offsetWidth:f.offsetHeight;r({scrollHeight:b,scrollTop:Math.max(v,0),viewportHeight:p}),i==null||i(s?E5e("column-gap",getComputedStyle(u).columnGap,o):E5e("row-gap",getComputedStyle(u).rowGap,o)),d!==null&&t(d)},[t,e,o,i,a,r,s]);return nU(c,n,l)}function E5e(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,Ms.WARN),e==="normal"?0:parseInt(e??"0",10)}function R5e(t,e,n){const r=ge.useRef(null),o=ge.useCallback(l=>{if(l==null||!l.offsetParent)return;const c=l.getBoundingClientRect(),u=c.width;let d,f;if(e){const h=e.getBoundingClientRect(),g=c.top-h.top;f=h.height-Math.max(0,g),d=g+e.scrollTop}else{const h=a.current.ownerDocument.defaultView;f=h.innerHeight-Math.max(0,c.top),d=c.top+h.scrollY}r.current={offsetTop:d,visibleHeight:f,visibleWidth:u},t(r.current)},[t,e]),{callbackRef:i,ref:a}=nU(o,!0,n),s=ge.useCallback(()=>{o(a.current)},[o,a]);return ge.useEffect(()=>{var l;if(e){e.addEventListener("scroll",s);const c=new ResizeObserver(()=>{requestAnimationFrame(s)});return c.observe(e),()=>{e.removeEventListener("scroll",s),c.unobserve(e)}}{const c=(l=a.current)==null?void 0:l.ownerDocument.defaultView;return c==null||c.addEventListener("scroll",s),c==null||c.addEventListener("resize",s),()=>{c==null||c.removeEventListener("scroll",s),c==null||c.removeEventListener("resize",s)}}},[s,e,a]),i}const ns=Mr(()=>{const t=ar(),e=ar(),n=Rt(0),r=ar(),o=Rt(0),i=ar(),a=ar(),s=Rt(0),l=Rt(0),c=Rt(0),u=Rt(0),d=ar(),f=ar(),h=Rt(!1),g=Rt(!1),v=Rt(!1);return cn(xt(t,Gt(({scrollTop:b})=>b)),e),cn(xt(t,Gt(({scrollHeight:b})=>b)),a),cn(e,o),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:u,headerHeight:s,horizontalDirection:g,scrollBy:f,scrollContainerState:t,scrollHeight:a,scrollingInProgress:h,scrollTo:d,scrollTop:e,skipAnimationFrameInResizeObserver:v,smoothScrollTargetReached:r,statefulScrollTop:o,viewportHeight:i}},[],{singleton:!0}),pC={lvl:0};function j5e(t,e){const n=t.length;if(n===0)return[];let{index:r,value:o}=e(t[0]);const i=[];for(let a=1;a<n;a++){const{index:s,value:l}=e(t[a]);i.push({end:s-1,start:r,value:o}),r=s,o=l}return i.push({end:1/0,start:r,value:o}),i}function so(t){return t===pC}function mC(t,e){if(!so(t))return e===t.k?t.v:e<t.k?mC(t.l,e):mC(t.r,e)}function du(t,e,n="k"){if(so(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const r=du(t.r,e,n);return r[0]===-1/0?[t.k,t.v]:r}return du(t.l,e,n)}function bl(t,e,n){return so(t)?M5e(e,n,1):e===t.k?ea(t,{k:e,v:n}):e<t.k?N5e(ea(t,{l:bl(t.l,e,n)})):N5e(ea(t,{r:bl(t.r,e,n)}))}function Kb(){return pC}function y4(t,e,n){return so(t)?[]:function(r){return j5e(r,({k:o,v:i})=>({index:o,value:i}))}(oU(t,du(t,e)[0],n))}function rU(t,e){if(so(t))return pC;const{k:n,l:r,r:o}=t;if(e===n){if(so(r))return o;if(so(o))return r;{const[i,a]=A5e(r);return iU(ea(t,{k:i,l:D5e(r),v:a}))}}return iU(ea(t,e<n?{l:rU(r,e)}:{r:rU(o,e)}))}function rv(t){return so(t)?[]:[...rv(t.l),{k:t.k,v:t.v},...rv(t.r)]}function oU(t,e,n){if(so(t))return[];const{k:r,l:o,r:i,v:a}=t;let s=[];return r>e&&(s=s.concat(oU(o,e,n))),r>=e&&r<=n&&s.push({k:r,v:a}),r<=n&&(s=s.concat(oU(i,e,n))),s}function iU(t){const{l:e,lvl:n,r}=t;if(r.lvl>=n-1&&e.lvl>=n-1)return t;if(n>r.lvl+1){if(aU(e))return $5e(ea(t,{lvl:n-1}));if(!so(e)&&!so(e.r))return ea(e.r,{l:ea(e,{r:e.r.l}),lvl:n,r:ea(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(aU(t))return sU(ea(t,{lvl:n-1}));if(so(r)||so(r.l))throw new Error("Unexpected empty nodes");{const o=r.l,i=aU(o)?r.lvl-1:r.lvl;return ea(o,{l:ea(t,{lvl:n-1,r:o.l}),lvl:o.lvl+1,r:sU(ea(r,{l:o.r,lvl:i}))})}}function ea(t,e){return M5e(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function D5e(t){return so(t.r)?t.l:iU(ea(t,{r:D5e(t.r)}))}function aU(t){return so(t)||t.lvl>t.r.lvl}function A5e(t){return so(t.r)?[t.k,t.v]:A5e(t.r)}function M5e(t,e,n,r=pC,o=pC){return{k:t,l:r,lvl:n,r:o,v:e}}function N5e(t){return sU($5e(t))}function $5e(t){const{l:e}=t;return so(e)||e.lvl!==t.lvl?t:ea(e,{r:ea(t,{l:e.r})})}function sU(t){const{lvl:e,r:n}=t;return so(n)||so(n.r)||n.lvl!==e||n.r.lvl!==e?t:ea(n,{l:ea(t,{r:n.l}),lvl:e+1})}function I5e(t,e){return!(!t||t.startIndex!==e.startIndex||t.endIndex!==e.endIndex)}function gC(t,e){return!(!t||t[0]!==e[0]||t[1]!==e[1])}const lU=Mr(()=>({recalcInProgress:Rt(!1)}),[],{singleton:!0});function Q5e(t,e,n){return t[b4(t,e,n)]}function b4(t,e,n,r=0){let o=t.length-1;for(;r<=o;){const i=Math.floor((r+o)/2),a=n(t[i],e);if(a===0)return i;if(a===-1){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function wm(t,e){return Math.round(t.getBoundingClientRect()[e])}function x4(t){return!so(t.groupOffsetTree)}function cU({index:t},e){return e===t?0:e<t?-1:1}function Wft({offset:t},e){return e===t?0:e<t?-1:1}function vC(t,e,n){if(e.length===0)return 0;const{index:r,offset:o,size:i}=Q5e(e,t,cU),a=t-r,s=i*a+(a-1)*n+o;return s>0?s+n:s}function L5e(t,e){if(!x4(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function z5e(t,e,n){if(function(r){return typeof r.groupIndex<"u"}(t))return e.groupIndices[t.groupIndex]+1;{let r=L5e(t.index==="LAST"?n:t.index,e);return r=Math.max(0,r,Math.min(n,r)),r}}function Uft(t,e,n,r=0){return r>0&&(e=Math.max(e,Q5e(t,r,cU).offset)),j5e(function(o,i,a,s){const l=b4(o,i,s),c=b4(o,a,s,l);return o.slice(l,c+1)}(t,e,n,Wft),Xft)}function Zft(t,[e,n,r,o]){e.length>0&&r("received item sizes",e,Ms.DEBUG);const i=t.sizeTree;let a=i,s=0;if(n.length>0&&so(i)&&e.length===2){const f=e[0].size,h=e[1].size;a=n.reduce((g,v)=>bl(bl(g,v,f),v+1,h),a)}else[a,s]=function(f,h){let g=so(f)?0:1/0;for(const v of h){const{endIndex:b,size:p,startIndex:O}=v;if(g=Math.min(g,O),so(f)){f=bl(f,0,p);continue}const k=y4(f,O-1,b+1);if(k.some(Hft(v)))continue;let S=!1,w=!1;for(const{end:T,start:P,value:j}of k)S?(b>=P||p===j)&&(f=rU(f,P)):(w=j!==p,S=!0),T>b&&b>=P&&j!==p&&(f=bl(f,b+1,j));w&&(f=bl(f,O,p))}return[f,g]}(a,e);if(a===i)return t;const{lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d}=uU(t.offsetTree,s,a,o);return{groupIndices:n,groupOffsetTree:n.reduce((f,h)=>bl(f,h,vC(h,d,o)),Kb()),lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d,sizeTree:a}}function V5e(t,e){let n=0,r=0;for(;n<t;)n+=e[r+1]-e[r]-1,r++;return r-(n===t?0:1)}function uU(t,e,n,r){let o=t,i=0,a=0,s=0,l=0;if(e!==0){l=b4(o,e-1,cU),s=o[l].offset;const c=du(n,e-1);i=c[0],a=c[1],o.length&&o[l].size===du(n,e)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:u}of y4(n,e,1/0)){const d=c-i,f=d*a+s+d*r;o.push({index:c,offset:f,size:u}),i=c,s=f,a=u}return{lastIndex:i,lastOffset:s,lastSize:a,offsetTree:o}}function Xft(t){return{index:t.index,value:t}}function Hft(t){const{endIndex:e,size:n,startIndex:r}=t;return o=>o.start===r&&(o.end===e||o.end===1/0)&&o.value===n}const Yft={offsetHeight:"height",offsetWidth:"width"},Qd=Mr(([{log:t},{recalcInProgress:e}])=>{const n=ar(),r=ar(),o=Aa(r,0),i=ar(),a=ar(),s=Rt(0),l=Rt([]),c=Rt(void 0),u=Rt(void 0),d=Rt((w,T)=>wm(w,Yft[T])),f=Rt(void 0),h=Rt(0),g={groupIndices:[],groupOffsetTree:Kb(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Kb()},v=Aa(xt(n,Zn(l,t,h),Id(Zft,g),So()),g),b=Aa(xt(l,So(),Id((w,T)=>({current:T,prev:w.current}),{current:[],prev:[]}),Gt(({prev:w})=>w)),[]);cn(xt(l,kn(w=>w.length>0),Zn(v,h),Gt(([w,T,P])=>{const j=w.reduce((D,N,E)=>bl(D,N,vC(N,T.offsetTree,P)||E),Kb());return{...T,groupIndices:w,groupOffsetTree:j}})),v),cn(xt(r,Zn(v),kn(([w,{lastIndex:T}])=>w<T),Gt(([w,{lastIndex:T,lastSize:P}])=>[{endIndex:T,size:P,startIndex:w}])),n),cn(c,u);const p=Aa(xt(c,Gt(w=>w===void 0)),!0);cn(xt(u,kn(w=>w!==void 0&&so(Ji(v).sizeTree)),Gt(w=>[{endIndex:0,size:w,startIndex:0}])),n);const O=yl(xt(n,Zn(v),Id(({sizes:w},[T,P])=>({changed:P!==w,sizes:P}),{changed:!1,sizes:g}),Gt(w=>w.changed)));zr(xt(s,Id((w,T)=>({diff:w.prev-T,prev:T}),{diff:0,prev:0}),Gt(w=>w.diff)),w=>{const{groupIndices:T}=Ji(v);if(w>0)Wn(e,!0),Wn(i,w+V5e(w,T));else if(w<0){const P=Ji(b);P.length>0&&(w-=V5e(-w,P)),Wn(a,w)}}),zr(xt(s,Zn(t)),([w,T])=>{w<0&&T("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},Ms.ERROR)});const k=yl(i);cn(xt(i,Zn(v),Gt(([w,T])=>{const P=T.groupIndices.length>0,j=[],D=T.lastSize;if(P){const N=mC(T.sizeTree,0);let E=0,A=0;for(;E<w;){const L=T.groupIndices[A],F=T.groupIndices.length===A+1?1/0:T.groupIndices[A+1]-L-1;j.push({endIndex:L,size:N,startIndex:L}),j.push({endIndex:L+1+F-1,size:D,startIndex:L+1}),A++,E+=F+1}const I=rv(T.sizeTree);return E!==w&&I.shift(),I.reduce((L,{k:F,v:Q})=>{let W=L.ranges;return L.prevSize!==0&&(W=[...L.ranges,{endIndex:F+w-1,size:L.prevSize,startIndex:L.prevIndex}]),{prevIndex:F+w,prevSize:Q,ranges:W}},{prevIndex:w,prevSize:0,ranges:j}).ranges}return rv(T.sizeTree).reduce((N,{k:E,v:A})=>({prevIndex:E+w,prevSize:A,ranges:[...N.ranges,{endIndex:E+w-1,size:N.prevSize,startIndex:N.prevIndex}]}),{prevIndex:0,prevSize:D,ranges:[]}).ranges})),n);const S=yl(xt(a,Zn(v,h),Gt(([w,{offsetTree:T},P])=>vC(-w,T,P))));return cn(xt(a,Zn(v,h),Gt(([w,T,P])=>{if(T.groupIndices.length>0){if(so(T.sizeTree))return T;let j=Kb();const D=Ji(b);let N=0,E=0,A=0;for(;N<-w;){A=D[E];const I=D[E+1]-A-1;E++,N+=I+1}return j=rv(T.sizeTree).reduce((I,{k:L,v:F})=>bl(I,Math.max(0,L+w),F),j),N!==-w&&(j=bl(j,0,mC(T.sizeTree,A)),j=bl(j,1,du(T.sizeTree,1-w)[1])),{...T,sizeTree:j,...uU(T.offsetTree,0,j,P)}}{const j=rv(T.sizeTree).reduce((D,{k:N,v:E})=>bl(D,Math.max(0,N+w),E),Kb());return{...T,sizeTree:j,...uU(T.offsetTree,0,j,P)}}})),v),{beforeUnshiftWith:k,data:f,defaultItemSize:u,firstItemIndex:s,fixedItemSize:c,gap:h,groupIndices:l,itemSize:d,listRefresh:O,shiftWith:a,shiftWithOffset:S,sizeRanges:n,sizes:v,statefulTotalCount:o,totalCount:r,trackItemSizes:p,unshiftWith:i}},ko(Om,lU),{singleton:!0});function Gft(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const q5e=Mr(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:r,scrollTop:o}])=>{const i=ar(),a=ar(),s=yl(xt(i,Gt(Gft)));return cn(xt(s,Gt(l=>l.totalCount)),n),cn(xt(s,Gt(l=>l.groupIndices)),t),cn(xt(Bi(o,e,r),kn(([l,c])=>x4(c)),Gt(([l,c,u])=>du(c.groupOffsetTree,Math.max(l-u,0),"v")[0]),So(),Gt(l=>[l])),a),{groupCounts:i,topItemsIndexes:a}},ko(Qd,ns)),km=Mr(([{log:t}])=>{const e=Rt(!1),n=yl(xt(e,kn(r=>r),So()));return zr(e,r=>{r&&Ji(t)("props updated",{},Ms.DEBUG)}),{didMount:n,propsReady:e}},ko(Om),{singleton:!0}),Kft=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function F5e(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!Kft)&&(e.behavior="auto"),e.offset||(e.offset=0),e}const yC=Mr(([{gap:t,listRefresh:e,sizes:n,totalCount:r},{fixedFooterHeight:o,fixedHeaderHeight:i,footerHeight:a,headerHeight:s,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{const h=ar(),g=ar(),v=Rt(0);let b=null,p=null,O=null;function k(){b&&(b(),b=null),O&&(O(),O=null),p&&(clearTimeout(p),p=null),Wn(l,!1)}return cn(xt(h,Zn(n,d,r,v,s,a,f),Zn(t,i,o),Gt(([[S,w,T,P,j,D,N,E],A,I,L])=>{const F=F5e(S),{align:Q,behavior:W,offset:U}=F,X=P-1,G=z5e(F,w,X);let ae=vC(G,w.offsetTree,A)+D;Q==="end"?(ae+=I+du(w.sizeTree,G)[1]-T+L,G===X&&(ae+=N)):Q==="center"?ae+=(I+du(w.sizeTree,G)[1]-T+L)/2:ae-=j,U&&(ae+=U);const ne=re=>{k(),re?(E("retrying to scroll to",{location:S},Ms.DEBUG),Wn(h,S)):(Wn(g,!0),E("list did not change, scroll successful",{},Ms.DEBUG))};if(k(),W==="smooth"){let re=!1;O=zr(e,Z=>{re=re||Z}),b=Nd(u,()=>{ne(re)})}else b=Nd(xt(e,function(re){return Z=>{const K=setTimeout(()=>{Z(!1)},re);return oe=>{oe&&(Z(!0),clearTimeout(K))}}}(150)),ne);return p=setTimeout(()=>{k()},1200),Wn(l,!0),E("scrolling from index to",{behavior:W,index:G,top:ae},Ms.DEBUG),{behavior:W,top:ae}})),c),{scrollTargetReached:g,scrollToIndex:h,topListHeight:v}},ko(Qd,ns,Om),{singleton:!0});function dU(t,e){t==0?e():requestAnimationFrame(()=>{dU(t-1,e)})}function fU(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const bC=Mr(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:r},{scrollTargetReached:o,scrollToIndex:i},{didMount:a}])=>{const s=Rt(!0),l=Rt(0),c=Rt(!0);return cn(xt(a,Zn(l),kn(([u,d])=>!!d),$d(!1)),s),cn(xt(a,Zn(l),kn(([u,d])=>!!d),$d(!1)),c),zr(xt(Bi(e,a),Zn(s,n,t,c),kn(([[,u],d,{sizeTree:f},h,g])=>u&&(!so(f)||eU(h))&&!d&&!g),Zn(l)),([,u])=>{Nd(o,()=>{Wn(c,!0)}),dU(4,()=>{Nd(r,()=>{Wn(s,!0)}),Wn(i,u)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:s}},ko(Qd,ns,yC,km),{singleton:!0});function B5e(t,e){return Math.abs(t-e)<1.01}const xC="up",OC="down",Jft={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},wC=Mr(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:r,scrollTop:o,viewportHeight:i}])=>{const a=Rt(!1),s=Rt(!0),l=ar(),c=ar(),u=Rt(4),d=Rt(0),f=Aa(xt(P5e(xt(Pn(o),Gb(1),$d(!0)),xt(Pn(o),Gb(1),$d(!1),_5e(100))),So()),!1),h=Aa(xt(P5e(xt(n,$d(!0)),xt(n,$d(!1),_5e(200))),So()),!1);cn(xt(Bi(Pn(o),Pn(d)),Gt(([O,k])=>O<=k),So()),s),cn(xt(s,xm(50)),c);const g=yl(xt(Bi(r,Pn(i),Pn(e),Pn(t),Pn(u)),Id((O,[{scrollHeight:k,scrollTop:S},w,T,P,j])=>{const D={scrollHeight:k,scrollTop:S,viewportHeight:w};if(S+w-k>-j){let E,A;return S>O.state.scrollTop?(E="SCROLLED_DOWN",A=O.state.scrollTop-S):(E="SIZE_DECREASED",A=O.state.scrollTop-S||O.scrollTopDelta),{atBottom:!0,atBottomBecause:E,scrollTopDelta:A,state:D}}let N;return N=D.scrollHeight>O.state.scrollHeight?"SIZE_INCREASED":w<O.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":S<O.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:N,state:D}},Jft),So((O,k)=>O&&O.atBottom===k.atBottom))),v=Aa(xt(r,Id((O,{scrollHeight:k,scrollTop:S,viewportHeight:w})=>{if(B5e(O.scrollHeight,k))return{changed:!1,jump:0,scrollHeight:k,scrollTop:S};{const T=k-(S+w)<1;return O.scrollTop!==S&&T?{changed:!0,jump:O.scrollTop-S,scrollHeight:k,scrollTop:S}:{changed:!0,jump:0,scrollHeight:k,scrollTop:S}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),kn(O=>O.changed),Gt(O=>O.jump)),0);cn(xt(g,Gt(O=>O.atBottom)),a),cn(xt(a,xm(50)),l);const b=Rt(OC);cn(xt(r,Gt(({scrollTop:O})=>O),So(),Id((O,k)=>Ji(h)?{direction:O.direction,prevScrollTop:k}:{direction:k<O.prevScrollTop?xC:OC,prevScrollTop:k},{direction:OC,prevScrollTop:0}),Gt(O=>O.direction)),b),cn(xt(r,xm(50),$d("none")),b);const p=Rt(0);return cn(xt(f,kn(O=>!O),$d(0)),p),cn(xt(o,xm(100),Zn(f),kn(([O,k])=>!!k),Id(([O,k],[S])=>[k,S],[0,0]),Gt(([O,k])=>k-O)),p),{atBottomState:g,atBottomStateChange:l,atBottomThreshold:u,atTopStateChange:c,atTopThreshold:d,isAtBottom:a,isAtTop:s,isScrolling:f,lastJumpDueToItemResize:v,scrollDirection:b,scrollVelocity:p}},ko(ns)),O4="top",w4="bottom",W5e="none";function U5e(t,e,n){return typeof t=="number"?n===xC&&e===O4||n===OC&&e===w4?t:0:n===xC?e===O4?t.main:t.reverse:e===w4?t.main:t.reverse}function Z5e(t,e){var n;return typeof t=="number"?t:(n=t[e])!=null?n:0}const hU=Mr(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:r,viewportHeight:o}])=>{const i=ar(),a=Rt(0),s=Rt(0),l=Rt(0),c=Aa(xt(Bi(Pn(r),Pn(o),Pn(n),Pn(i,gC),Pn(l),Pn(a),Pn(e),Pn(t),Pn(s)),Gt(([u,d,f,[h,g],v,b,p,O,k])=>{const S=u-O,w=b+p,T=Math.max(f-S,0);let P=W5e;const j=Z5e(k,O4),D=Z5e(k,w4);return h-=O,g+=f+p,(h+=f+p)>u+w-j&&(P=xC),(g-=O)<u-T+d+D&&(P=OC),P!==W5e?[Math.max(S-f-U5e(v,O4,P)-j,0),S-T-p+d+U5e(v,w4,P)+D]:null}),kn(u=>u!=null),So(gC)),[0,0]);return{increaseViewportBy:s,listBoundary:i,overscan:l,topListHeight:a,visibleRange:c}},ko(ns),{singleton:!0}),pU={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function k4(t,e,n,r,o,i){const{lastIndex:a,lastOffset:s,lastSize:l}=o;let c=0,u=0;if(t.length>0){c=t[0].offset;const g=t[t.length-1];u=g.offset+g.size}const d=n-a,f=c,h=s+d*l+(d-1)*r-u;return{bottom:u,firstItemIndex:i,items:H5e(t,o,i),offsetBottom:h,offsetTop:c,top:f,topItems:H5e(e,o,i),topListHeight:e.reduce((g,v)=>v.size+g,0),totalCount:n}}function X5e(t,e,n,r,o,i){let a=0;if(n.groupIndices.length>0)for(const u of n.groupIndices){if(u-a>=t)break;a++}const s=t+a,l=fU(e,s),c=Array.from({length:s}).map((u,d)=>({data:i[d+l],index:d+l,offset:0,size:0}));return k4(c,[],s,o,n,r)}function H5e(t,e,n){if(t.length===0)return[];if(!x4(e))return t.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=t[0].index,o=t[t.length-1].index,i=[],a=y4(e.groupOffsetTree,r,o);let s,l=0;for(const c of t){let u;(!s||s.end<c.index)&&(s=a.shift(),l=e.groupIndices.indexOf(s.start)),u=c.index===s.start?{index:l,type:"group"}:{groupIndex:l,index:c.index-(l+1)+n},i.push({...u,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return i}const ov=Mr(([{data:t,firstItemIndex:e,gap:n,sizes:r,totalCount:o},i,{listBoundary:a,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:h},{recalcInProgress:g}])=>{const v=Rt([]),b=Rt(0),p=ar();cn(i.topItemsIndexes,v);const O=Aa(xt(Bi(h,g,Pn(l,gC),Pn(o),Pn(r),Pn(c),u,Pn(v),Pn(e),Pn(n),t),kn(([T,P,,j,,,,,,,D])=>{const N=D&&D.length!==j;return T&&!P&&!N}),Gt(([,,[T,P],j,D,N,E,A,I,L,F])=>{const Q=D,{offsetTree:W,sizeTree:U}=Q,X=Ji(b);if(j===0)return{...pU,totalCount:j};if(T===0&&P===0)return X===0?{...pU,totalCount:j}:X5e(X,N,D,I,L,F||[]);if(so(U))return X>0?null:k4(function(K,oe,ie){if(x4(oe)){const Y=L5e(K,oe);return[{index:du(oe.groupOffsetTree,Y)[0],offset:0,size:0},{data:ie==null?void 0:ie[0],index:Y,offset:0,size:0}]}return[{data:ie==null?void 0:ie[0],index:K,offset:0,size:0}]}(fU(N,j),Q,F),[],j,L,Q,I);const G=[];if(A.length>0){const K=A[0],oe=A[A.length-1];let ie=0;for(const Y of y4(U,K,oe)){const le=Y.value,me=Math.max(Y.start,K),ce=Math.min(Y.end,oe);for(let ve=me;ve<=ce;ve++)G.push({data:F==null?void 0:F[ve],index:ve,offset:ie,size:le}),ie+=le}}if(!E)return k4([],G,j,L,Q,I);const ae=A.length>0?A[A.length-1]+1:0,ne=Uft(W,T,P,ae);if(ne.length===0)return null;const re=j-1,Z=v4([],K=>{for(const oe of ne){const ie=oe.value;let Y=ie.offset,le=oe.start;const me=ie.size;if(ie.offset<T){le+=Math.floor((T-ie.offset+L)/(me+L));const ve=le-oe.start;Y+=ve*me+ve*L}le<ae&&(Y+=(ae-le)*me,le=ae);const ce=Math.min(oe.end,re);for(let ve=le;ve<=ce&&!(Y>=P);ve++)K.push({data:F==null?void 0:F[ve],index:ve,offset:Y,size:me}),Y+=me+L}});return k4(Z,G,j,L,Q,I)}),kn(T=>T!==null),So()),pU);cn(xt(t,kn(eU),Gt(T=>T==null?void 0:T.length)),o),cn(xt(O,Gt(T=>T.topListHeight)),d),cn(d,s),cn(xt(O,Gt(T=>[T.top,T.bottom])),a),cn(xt(O,Gt(T=>T.items)),p);const k=yl(xt(O,kn(({items:T})=>T.length>0),Zn(o,t),kn(([{items:T},P])=>T[T.length-1].originalIndex===P-1),Gt(([,T,P])=>[T-1,P]),So(gC),Gt(([T])=>T))),S=yl(xt(O,xm(200),kn(({items:T,topItems:P})=>T.length>0&&T[0].originalIndex===P.length),Gt(({items:T})=>T[0].index),So())),w=yl(xt(O,kn(({items:T})=>T.length>0),Gt(({items:T})=>{let P=0,j=T.length-1;for(;T[P].type==="group"&&P<j;)P++;for(;T[j].type==="group"&&j>P;)j--;return{endIndex:T[j].index,startIndex:T[P].index}}),So(I5e)));return{endReached:k,initialItemCount:b,itemsRendered:p,listState:O,rangeChanged:w,startReached:S,topItemsIndexes:v,...f}},ko(Qd,q5e,hU,bC,yC,wC,km,lU),{singleton:!0}),Y5e=Mr(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:r},{listState:o}])=>{const i=ar(),a=Aa(xt(Bi(n,t,r,e,o),Gt(([s,l,c,u,d])=>s+l+c+u+d.offsetBottom+d.bottom)),0);return cn(Pn(a),i),{totalListHeight:a,totalListHeightChanged:i}},ko(ns,ov),{singleton:!0}),eht=Mr(([{viewportHeight:t},{totalListHeight:e}])=>{const n=Rt(!1),r=Aa(xt(Bi(n,t,e),kn(([o])=>o),Gt(([,o,i])=>Math.max(0,o-i)),xm(0),So()),0);return{alignToBottom:n,paddingTopAddition:r}},ko(ns,Y5e),{singleton:!0});function G5e(t){return!!t&&(t==="smooth"?"smooth":"auto")}const tht=Mr(([{listRefresh:t,totalCount:e,fixedItemSize:n},{atBottomState:r,isAtBottom:o},{scrollToIndex:i},{scrolledToInitialItem:a},{didMount:s,propsReady:l},{log:c},{scrollingInProgress:u}])=>{const d=Rt(!1),f=ar();let h=null;function g(b){Wn(i,{align:"end",behavior:b,index:"LAST"})}function v(b){const p=Nd(r,O=>{b&&!O.atBottom&&O.notAtBottomBecause==="SIZE_INCREASED"&&!h&&(Ji(c)("scrolling to bottom due to increased size",{},Ms.DEBUG),g("auto"))});setTimeout(p,100)}return zr(xt(Bi(xt(Pn(e),Gb(1)),s),Zn(Pn(d),o,a,u),Gt(([[b,p],O,k,S,w])=>{let T=p&&S,P="auto";return T&&(P=((j,D)=>typeof j=="function"?G5e(j(D)):D&&G5e(j))(O,k||w),T=T&&!!P),{followOutputBehavior:P,shouldFollow:T,totalCount:b}}),kn(({shouldFollow:b})=>b)),({followOutputBehavior:b,totalCount:p})=>{h&&(h(),h=null),Ji(n)?requestAnimationFrame(()=>{Ji(c)("following output to ",{totalCount:p},Ms.DEBUG),g(b)}):h=Nd(t,()=>{Ji(c)("following output to ",{totalCount:p},Ms.DEBUG),g(b),h=null})}),zr(xt(Bi(Pn(d),e,l),kn(([b,,p])=>b&&p),Id(({value:b},[,p])=>({refreshed:b===p,value:p}),{refreshed:!1,value:0}),kn(({refreshed:b})=>b),Zn(d,e)),([,b])=>{Ji(a)&&v(b!==!1)}),zr(f,()=>{v(Ji(d)!==!1)}),zr(Bi(Pn(d),r),([b,p])=>{b&&!p.atBottom&&p.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&g("auto")}),{autoscrollToBottom:f,followOutput:d}},ko(Qd,wC,yC,bC,km,Om,ns)),nht=Mr(([{data:t,firstItemIndex:e,gap:n,sizes:r},{initialTopMostItemIndex:o},{initialItemCount:i,listState:a},{didMount:s}])=>(cn(xt(s,Zn(i),kn(([,l])=>l!==0),Zn(o,r,e,n,t),Gt(([[,l],c,u,d,f,h=[]])=>X5e(l,c,u,d,f,h))),a),{}),ko(Qd,bC,ov,km),{singleton:!0}),rht=Mr(([{didMount:t},{scrollTo:e},{listState:n}])=>{const r=Rt(0);return zr(xt(t,Zn(r),kn(([,o])=>o!==0),Gt(([,o])=>({top:o}))),o=>{Nd(xt(n,Gb(1),kn(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{Wn(e,o)})})}),{initialScrollTop:r}},ko(km,ns,ov),{singleton:!0}),oht=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:r,...o},viewportBottom:i,viewportTop:a})=>e<a?{...o,align:n??"start",behavior:r}:t>i?{...o,align:n??"end",behavior:r}:null,iht=Mr(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:o,headerHeight:i,scrollingInProgress:a,scrollTop:s,viewportHeight:l},{scrollToIndex:c}])=>{const u=ar();return cn(xt(u,Zn(e,l,n,i,o,r,s),Zn(t),Gt(([[d,f,h,g,v,b,p,O],k])=>{const{align:S,behavior:w,calculateViewLocation:T=oht,done:P,...j}=d,D=z5e(d,f,g-1),N=vC(D,f.offsetTree,k)+v+b,E=T({itemBottom:N+du(f.sizeTree,D)[1],itemTop:N,locationParams:{align:S,behavior:w,...j},viewportBottom:O+h-p,viewportTop:O+b});return E?P&&Nd(xt(a,kn(A=>!A),Gb(Ji(a)?1:2)),P):P&&P(),E}),kn(d=>d!==null)),c),{scrollIntoView:u}},ko(Qd,ns,yC,ov,Om),{singleton:!0}),K5e=Mr(([{scrollVelocity:t}])=>{const e=Rt(!1),n=ar(),r=Rt(!1);return cn(xt(t,Zn(r,e,n),kn(([o,i])=>!!i),Gt(([o,i,a,s])=>{const{enter:l,exit:c}=i;if(a){if(c(o,s))return!1}else if(l(o,s))return!0;return a}),So()),e),zr(xt(Bi(e,t,n),Zn(r)),([[o,i,a],s])=>{o&&s&&s.change&&s.change(i,a)}),{isSeeking:e,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:t}},ko(wC),{singleton:!0}),mU=Mr(([{scrollContainerState:t,scrollTo:e}])=>{const n=ar(),r=ar(),o=ar(),i=Rt(!1),a=Rt(void 0);return cn(xt(Bi(n,r),Gt(([{scrollHeight:s,scrollTop:l,viewportHeight:c},{offsetTop:u}])=>({scrollHeight:s,scrollTop:Math.max(0,l-u),viewportHeight:c}))),t),cn(xt(e,Zn(r),Gt(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),o),{customScrollParent:a,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:o,windowViewportRect:r}},ko(ns)),aht=Mr(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:o},{didMount:i},{useWindowScroll:a,windowScrollContainerState:s,windowViewportRect:l}])=>{const c=ar(),u=Rt(void 0),d=Rt(null),f=Rt(null);return cn(s,d),cn(l,f),zr(xt(c,Zn(e,r,a,d,f,n)),([h,g,v,b,p,O,k])=>{const S=function(w){return rv(w).map(({k:T,v:P},j,D)=>{const N=D[j+1];return{endIndex:N?N.k-1:1/0,size:P,startIndex:T}})}(g.sizeTree);b&&p!==null&&O!==null&&(v=p.scrollTop-O.offsetTop),h({ranges:S,scrollTop:v-=k})}),cn(xt(u,kn(eU),Gt(sht)),o),cn(xt(i,Zn(u),kn(([,h])=>h!==void 0),So(),Gt(([,h])=>h.ranges)),t),{getState:c,restoreStateFrom:u}},ko(Qd,ns,bC,km,mU));function sht(t){return{align:"start",index:0,offset:t.scrollTop}}const lht=Mr(([{topItemsIndexes:t}])=>{const e=Rt(0);return cn(xt(e,kn(n=>n>=0),Gt(n=>Array.from({length:n}).map((r,o)=>o))),t),{topItemCount:e}},ko(ov));function J5e(t){let e,n=!1;return()=>(n||(n=!0,e=t()),e)}const cht=J5e(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),uht=Mr(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:r},{isAtBottom:o,isScrolling:i,lastJumpDueToItemResize:a,scrollDirection:s},{listState:l},{beforeUnshiftWith:c,gap:u,shiftWithOffset:d,sizes:f},{log:h},{recalcInProgress:g}])=>{const v=yl(xt(l,Zn(a),Id(([,p,O,k],[{bottom:S,items:w,offsetBottom:T,totalCount:P},j])=>{const D=S+T;let N=0;return O===P&&p.length>0&&w.length>0&&(w[0].originalIndex===0&&p[0].originalIndex===0||(N=D-k,N!==0&&(N+=j))),[N,w,P,D]},[0,[],0,0]),kn(([p])=>p!==0),Zn(r,s,n,o,h,g),kn(([,p,O,k,,,S])=>!S&&!k&&p!==0&&O===xC),Gt(([[p],,,,,O])=>(O("Upward scrolling compensation",{amount:p},Ms.DEBUG),p))));function b(p){p>0?(Wn(e,{behavior:"auto",top:-p}),Wn(t,0)):(Wn(t,0),Wn(e,{behavior:"auto",top:-p}))}return zr(xt(v,Zn(t,i)),([p,O,k])=>{k&&cht()?Wn(t,O-p):b(-p)}),zr(xt(Bi(Aa(i,!1),t,g),kn(([p,O,k])=>!p&&!k&&O!==0),Gt(([p,O])=>O),xm(1)),b),cn(xt(d,Gt(p=>({top:-p}))),e),zr(xt(c,Zn(f,u),Gt(([p,{groupIndices:O,lastSize:k,sizeTree:S},w])=>{function T(P){return P*(k+w)}if(O.length===0)return T(p);{let P=0;const j=mC(S,0);let D=0,N=0;for(;D<p;){D++,P+=j;let E=O.length===N+1?1/0:O[N+1]-O[N]-1;D+E>p&&(P-=j,E=p-D+1),D+=E,P+=T(E),N++}return P}})),p=>{Wn(t,p),requestAnimationFrame(()=>{Wn(e,{top:p}),requestAnimationFrame(()=>{Wn(t,0),Wn(g,!1)})})}),{deviation:t}},ko(ns,wC,ov,Qd,Om,lU)),dht=Mr(([t,e,n,r,o,i,a,s,l,c])=>({...t,...e,...n,...r,...o,...i,...a,...s,...l,...c}),ko(hU,nht,km,K5e,Y5e,rht,eht,mU,iht,Om)),e4e=Mr(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:r,gap:o,groupIndices:i,itemSize:a,sizeRanges:s,sizes:l,statefulTotalCount:c,totalCount:u,trackItemSizes:d},{initialItemFinalLocationReached:f,initialTopMostItemIndex:h,scrolledToInitialItem:g},v,b,p,{listState:O,topItemsIndexes:k,...S},{scrollToIndex:w},T,{topItemCount:P},{groupCounts:j},D])=>(cn(S.rangeChanged,D.scrollSeekRangeChanged),cn(xt(D.windowViewportRect,Gt(N=>N.visibleHeight)),v.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:r,gap:o,groupCounts:j,initialItemFinalLocationReached:f,initialTopMostItemIndex:h,scrolledToInitialItem:g,sizeRanges:s,topItemCount:P,topItemsIndexes:k,totalCount:u,...p,groupIndices:i,itemSize:a,listState:O,scrollToIndex:w,statefulTotalCount:c,trackItemSizes:d,...S,...D,...v,sizes:l,...b}),ko(Qd,bC,ns,aht,tht,ov,yC,uht,lht,q5e,dht));function fht(t,e){const n={},r={};let o=0;const i=t.length;for(;o<i;)r[t[o]]=1,o+=1;for(const a in e)Object.hasOwn(r,a)||(n[a]=e[a]);return n}const S4=typeof document<"u"?ge.useLayoutEffect:ge.useEffect;function t4e(t,e,n){const r=Object.keys(e.required||{}),o=Object.keys(e.optional||{}),i=Object.keys(e.methods||{}),a=Object.keys(e.events||{}),s=ge.createContext({});function l(f,h){f.propsReady&&Wn(f.propsReady,!1);for(const g of r)Wn(f[e.required[g]],h[g]);for(const g of o)g in h&&Wn(f[e.optional[g]],h[g]);f.propsReady&&Wn(f.propsReady,!0)}function c(f){return a.reduce((h,g)=>(h[g]=function(v){let b,p;const O=()=>b==null?void 0:b();return function(k,S){switch(k){case 1:return S?p===S?void 0:(O(),p=S,b=zr(v,S),b):(O(),Yb);case 2:return O(),void(p=null)}}}(f[e.events[g]]),h),{})}const u=ge.forwardRef((f,h)=>{const{children:g,...v}=f,[b]=ge.useState(()=>v4(function(k){const S=new Map,w=({constructor:T,dependencies:P,id:j,singleton:D})=>{if(D&&S.has(j))return S.get(j);const N=T(P.map(E=>w(E)));return D&&S.set(j,N),N};return w(k)}(t),k=>{l(k,v)})),[p]=ge.useState(C5e(c,b));S4(()=>{for(const k of a)k in v&&zr(p[k],v[k]);return()=>{Object.values(p).map(tU)}},[v,p,b]),S4(()=>{l(b,v)}),ge.useImperativeHandle(h,k5e(function(k){return i.reduce((S,w)=>(S[w]=T=>{Wn(k[e.methods[w]],T)},S),{})}(b)));const O=n;return y.jsx(s.Provider,{value:b,children:n?y.jsx(O,{...fht([...r,...o,...a],v),children:g}):g})}),d=ge.version.startsWith("18")?f=>{const h=ge.useContext(s)[f],g=ge.useCallback(v=>zr(h,v),[h]);return ge.useSyncExternalStore(g,()=>Ji(h),()=>Ji(h))}:f=>{const h=ge.useContext(s)[f],[g,v]=ge.useState(C5e(Ji,h));return S4(()=>zr(h,b=>{b!==g&&v(k5e(b))}),[h,g]),g};return{Component:u,useEmitter:(f,h)=>{const g=ge.useContext(s)[f];S4(()=>zr(g,h),[h,g])},useEmitterValue:d,usePublisher:f=>{const h=ge.useContext(s);return ge.useCallback(g=>{Wn(h[f],g)},[h,f])}}}const n4e=ge.createContext(void 0),r4e=ge.createContext(void 0),o4e=typeof document<"u"?ge.useLayoutEffect:ge.useEffect;function gU(t){return"self"in t}function i4e(t,e,n,r=Yb,o,i){const a=ge.useRef(null),s=ge.useRef(null),l=ge.useRef(null),c=ge.useCallback(u=>{let d,f,h;const g=u.target;if(function(b){return"body"in b}(g)||gU(g)){const b=gU(g)?g:g.defaultView;h=i?b.scrollX:b.scrollY,d=i?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight,f=i?b.innerWidth:b.innerHeight}else h=i?g.scrollLeft:g.scrollTop,d=i?g.scrollWidth:g.scrollHeight,f=i?g.offsetWidth:g.offsetHeight;const v=()=>{t({scrollHeight:d,scrollTop:Math.max(h,0),viewportHeight:f})};u.suppressFlushSync?v():oO.flushSync(v),s.current!==null&&(h===s.current||h<=0||h===d-f)&&(s.current=null,e(!0),l.current&&(clearTimeout(l.current),l.current=null))},[t,e,i]);return ge.useEffect(()=>{const u=o||a.current;return r(o||a.current),c({suppressFlushSync:!0,target:u}),u.addEventListener("scroll",c,{passive:!0}),()=>{r(null),u.removeEventListener("scroll",c)}},[a,c,n,r,o]),{scrollByCallback:function(u){i&&(u={behavior:u.behavior,left:u.top}),a.current.scrollBy(u)},scrollerRef:a,scrollToCallback:function(u){const d=a.current;if(!d||(i?"offsetWidth"in d&&d.offsetWidth===0:"offsetHeight"in d&&d.offsetHeight===0))return;const f=u.behavior==="smooth";let h,g,v;gU(d)?(g=Math.max(wm(d.document.documentElement,i?"width":"height"),i?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight),h=i?d.innerWidth:d.innerHeight,v=i?window.scrollX:window.scrollY):(g=d[i?"scrollWidth":"scrollHeight"],h=wm(d,i?"width":"height"),v=d[i?"scrollLeft":"scrollTop"]);const b=g-h;if(u.top=Math.ceil(Math.max(Math.min(b,u.top),0)),B5e(h,g)||u.top===v)return t({scrollHeight:g,scrollTop:v,viewportHeight:h}),void(f&&e(!0));f?(s.current=u.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=null,e(!0)},1e3)):s.current=null,i&&(u={behavior:u.behavior,left:u.top}),d.scrollTo(u)}}}const vU="-webkit-sticky",a4e="sticky",yU=J5e(()=>{if(typeof document>"u")return a4e;const t=document.createElement("div");return t.style.position=vU,t.style.position===vU?vU:a4e});function bU(t){return t}const hht=Mr(()=>{const t=Rt(l=>`Item ${l}`),e=Rt(null),n=Rt(l=>`Group ${l}`),r=Rt({}),o=Rt(bU),i=Rt("div"),a=Rt(Yb),s=(l,c=null)=>Aa(xt(r,Gt(u=>u[l]),So()),c);return{components:r,computeItemKey:o,context:e,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:n,HeaderComponent:s("Header"),HeaderFooterTag:i,ItemComponent:s("Item","div"),itemContent:t,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),pht=Mr(([t,e])=>({...t,...e}),ko(e4e,hht)),mht=({height:t})=>y.jsx("div",{style:{height:t}}),ght={overflowAnchor:"none",position:yU(),zIndex:1},s4e={overflowAnchor:"none"},vht={...s4e,display:"inline-block",height:"100%"},l4e=ge.memo(function({showTopList:t=!1}){const e=En("listState"),n=dc("sizeRanges"),r=En("useWindowScroll"),o=En("customScrollParent"),i=dc("windowScrollContainerState"),a=dc("scrollContainerState"),s=o||r?i:a,l=En("itemContent"),c=En("context"),u=En("groupContent"),d=En("trackItemSizes"),f=En("itemSize"),h=En("log"),g=dc("gap"),v=En("horizontalDirection"),{callbackRef:b}=Bft(n,f,d,t?Yb:s,h,g,o,v,En("skipAnimationFrameInResizeObserver")),[p,O]=ge.useState(0);xU("deviation",L=>{p!==L&&O(L)});const k=En("EmptyPlaceholder"),S=En("ScrollSeekPlaceholder")||mht,w=En("ListComponent"),T=En("ItemComponent"),P=En("GroupComponent"),j=En("computeItemKey"),D=En("isSeeking"),N=En("groupIndices").length>0,E=En("alignToBottom"),A=En("initialItemFinalLocationReached"),I=t?{}:{boxSizing:"border-box",...v?{display:"inline-block",height:"100%",marginLeft:p!==0?p:E?"auto":0,paddingLeft:e.offsetTop,paddingRight:e.offsetBottom,whiteSpace:"nowrap"}:{marginTop:p!==0?p:E?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},...A?{}:{visibility:"hidden"}};return!t&&e.totalCount===0&&k?y.jsx(k,{...ma(k,c)}):y.jsx(w,{...ma(w,c),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:b,style:I,children:(t?e.topItems:e.items).map(L=>{const F=L.originalIndex,Q=j(F+e.firstItemIndex,L.data,c);return D?_.createElement(S,{...ma(S,c),height:L.size,index:L.index,key:Q,type:L.type||"item",...L.type==="group"?{}:{groupIndex:L.groupIndex}}):L.type==="group"?_.createElement(P,{...ma(P,c),"data-index":F,"data-item-index":L.index,"data-known-size":L.size,key:Q,style:ght},u(L.index,c)):_.createElement(T,{...ma(T,c),...Oht(T,L.data),"data-index":F,"data-item-group-index":L.groupIndex,"data-item-index":L.index,"data-known-size":L.size,key:Q,style:v?vht:s4e},N?l(L.index,L.groupIndex,L.data,c):l(L.index,L.data,c))})})}),yht={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},bht={outline:"none",overflowX:"auto",position:"relative"},C4=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:{}}),xht={position:yU(),top:0,width:"100%",zIndex:1};function ma(t,e){if(typeof t!="string")return{context:e}}function Oht(t,e){return{item:typeof t=="string"?void 0:e}}const wht=ge.memo(function(){const t=En("HeaderComponent"),e=dc("headerHeight"),n=En("HeaderFooterTag"),r=nv(ge.useMemo(()=>i=>{e(wm(i,"height"))},[e]),!0,En("skipAnimationFrameInResizeObserver")),o=En("context");return t?y.jsx(n,{ref:r,children:y.jsx(t,{...ma(t,o)})}):null}),kht=ge.memo(function(){const t=En("FooterComponent"),e=dc("footerHeight"),n=En("HeaderFooterTag"),r=nv(ge.useMemo(()=>i=>{e(wm(i,"height"))},[e]),!0,En("skipAnimationFrameInResizeObserver")),o=En("context");return t?y.jsx(n,{ref:r,children:y.jsx(t,{...ma(t,o)})}):null});function c4e({useEmitter:t,useEmitterValue:e,usePublisher:n}){return ge.memo(function({children:r,style:o,...i}){const a=n("scrollContainerState"),s=e("ScrollerComponent"),l=n("smoothScrollTargetReached"),c=e("scrollerRef"),u=e("context"),d=e("horizontalDirection")||!1,{scrollByCallback:f,scrollerRef:h,scrollToCallback:g}=i4e(a,l,s,c,void 0,d);return t("scrollTo",g),t("scrollBy",f),y.jsx(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:h,style:{...d?bht:yht,...o},tabIndex:0,...i,...ma(s,u),children:r})})}function u4e({useEmitter:t,useEmitterValue:e,usePublisher:n}){return ge.memo(function({children:r,style:o,...i}){const a=n("windowScrollContainerState"),s=e("ScrollerComponent"),l=n("smoothScrollTargetReached"),c=e("totalListHeight"),u=e("deviation"),d=e("customScrollParent"),f=e("context"),h=ge.useRef(null),g=e("scrollerRef"),{scrollByCallback:v,scrollerRef:b,scrollToCallback:p}=i4e(a,l,s,g,d);return o4e(()=>{var O;return b.current=d||((O=h.current)==null?void 0:O.ownerDocument.defaultView),()=>{b.current=null}},[b,d]),t("windowScrollTo",p),t("scrollBy",v),y.jsx(s,{ref:h,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...c!==0?{height:c+u}:{}},...i,...ma(s,f),children:r})})}const Sht=({children:t})=>{const e=ge.useContext(n4e),n=dc("viewportHeight"),r=dc("fixedItemHeight"),o=En("alignToBottom"),i=En("horizontalDirection"),a=nv(ge.useMemo(()=>S5e(n,s=>wm(s,i?"width":"height")),[n,i]),!0,En("skipAnimationFrameInResizeObserver"));return ge.useEffect(()=>{e&&(n(e.viewportHeight),r(e.itemHeight))},[e,n,r]),y.jsx("div",{"data-viewport-type":"element",ref:a,style:C4(o),children:t})},Cht=({children:t})=>{const e=ge.useContext(n4e),n=dc("windowViewportRect"),r=dc("fixedItemHeight"),o=En("customScrollParent"),i=R5e(n,o,En("skipAnimationFrameInResizeObserver")),a=En("alignToBottom");return ge.useEffect(()=>{e&&(r(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,r]),y.jsx("div",{"data-viewport-type":"window",ref:i,style:C4(a),children:t})},_ht=({children:t})=>{const e=En("TopItemListComponent")||"div",n=En("headerHeight"),r={...xht,marginTop:`${n}px`},o=En("context");return y.jsx(e,{style:r,...ma(e,o),children:t})},Tht=ge.memo(function(t){const e=En("useWindowScroll"),n=En("topItemsIndexes").length>0,r=En("customScrollParent"),o=En("context"),i=r||e?Rht:Eht,a=r||e?Cht:Sht;return y.jsxs(i,{...t,...ma(i,o),children:[n&&y.jsx(_ht,{children:y.jsx(l4e,{showTopList:!0})}),y.jsxs(a,{children:[y.jsx(wht,{}),y.jsx(l4e,{}),y.jsx(kht,{})]})]})}),{Component:Pht,useEmitter:xU,useEmitterValue:En,usePublisher:dc}=t4e(pht,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Tht),Eht=c4e({useEmitter:xU,useEmitterValue:En,usePublisher:dc}),Rht=u4e({useEmitter:xU,useEmitterValue:En,usePublisher:dc}),d4e=Pht,jht=Mr(()=>{const t=Rt(c=>y.jsxs("td",{children:["Item $",c]})),e=Rt(null),n=Rt(c=>y.jsxs("td",{colSpan:1e3,children:["Group ",c]})),r=Rt(null),o=Rt(null),i=Rt({}),a=Rt(bU),s=Rt(Yb),l=(c,u=null)=>Aa(xt(i,Gt(d=>d[c]),So()),u);return{components:i,computeItemKey:a,context:e,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:o,fixedHeaderContent:r,itemContent:t,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}});ko(e4e,jht),yU();const f4e={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Dht={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:h4e,floor:_4,max:kC,min:OU,round:p4e}=Math;function m4e(t,e,n){return Array.from({length:e-t+1}).map((r,o)=>({data:n===null?null:n[o+t],index:o+t}))}function T4(t,e){return t&&t.width===e.width&&t.height===e.height}function Aht(t,e){return t&&t.column===e.column&&t.row===e.row}const Mht=Mr(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:r},{footerHeight:o,headerHeight:i,scrollBy:a,scrollContainerState:s,scrollTo:l,scrollTop:c,smoothScrollTargetReached:u,viewportHeight:d},f,h,{didMount:g,propsReady:v},{customScrollParent:b,useWindowScroll:p,windowScrollContainerState:O,windowScrollTo:k,windowViewportRect:S},w])=>{const T=Rt(0),P=Rt(0),j=Rt(f4e),D=Rt({height:0,width:0}),N=Rt({height:0,width:0}),E=ar(),A=ar(),I=Rt(0),L=Rt(null),F=Rt({column:0,row:0}),Q=ar(),W=ar(),U=Rt(!1),X=Rt(0),G=Rt(!0),ae=Rt(!1),ne=Rt(!1);zr(xt(g,Zn(X),kn(([Y,le])=>!!le)),()=>{Wn(G,!1)}),zr(xt(Bi(g,G,N,D,X,ae),kn(([Y,le,me,ce,,ve])=>Y&&!le&&me.height!==0&&ce.height!==0&&!ve)),([,,,,Y])=>{Wn(ae,!0),dU(1,()=>{Wn(E,Y)}),Nd(xt(c),()=>{Wn(e,[0,0]),Wn(G,!0)})}),cn(xt(W,kn(Y=>Y!=null&&Y.scrollTop>0),$d(0)),P),zr(xt(g,Zn(W),kn(([,Y])=>Y!=null)),([,Y])=>{Y&&(Wn(D,Y.viewport),Wn(N,Y.item),Wn(F,Y.gap),Y.scrollTop>0&&(Wn(U,!0),Nd(xt(c,Gb(1)),le=>{Wn(U,!1)}),Wn(l,{top:Y.scrollTop})))}),cn(xt(D,Gt(({height:Y})=>Y)),d),cn(xt(Bi(Pn(D,T4),Pn(N,T4),Pn(F,(Y,le)=>Y&&Y.column===le.column&&Y.row===le.row),Pn(c)),Gt(([Y,le,me,ce])=>({gap:me,item:le,scrollTop:ce,viewport:Y}))),Q),cn(xt(Bi(Pn(T),r,Pn(F,Aht),Pn(N,T4),Pn(D,T4),Pn(L),Pn(P),Pn(U),Pn(G),Pn(X)),kn(([,,,,,,,Y])=>!Y),Gt(([Y,[le,me],ce,ve,ye,_e,Se,,Ae,je])=>{const{column:Ie,row:De}=ce,{height:nt,width:Fe}=ve,{width:kt}=ye;if(Se===0&&(Y===0||kt===0))return f4e;if(Fe===0){const Tt=fU(je,Y);return function(Kt){return{...Dht,items:Kt}}(m4e(Tt,Tt+Math.max(Se-1,0),_e))}const Re=g4e(kt,Fe,Ie);let ot,Me;Ae?le===0&&me===0&&Se>0?(ot=0,Me=Se-1):(ot=Re*_4((le+De)/(nt+De)),Me=Re*h4e((me+De)/(nt+De))-1,Me=OU(Y-1,kC(Me,Re-1)),ot=OU(Me,kC(0,ot))):(ot=0,Me=-1);const We=m4e(ot,Me,_e),{bottom:it,top:Ue}=v4e(ye,ce,ve,We),gt=h4e(Y/Re);return{bottom:it,itemHeight:nt,items:We,itemWidth:Fe,offsetBottom:gt*nt+(gt-1)*De-it,offsetTop:Ue,top:Ue}})),j),cn(xt(L,kn(Y=>Y!==null),Gt(Y=>Y.length)),T),cn(xt(Bi(D,N,j,F),kn(([Y,le,{items:me}])=>me.length>0&&le.height!==0&&Y.height!==0),Gt(([Y,le,{items:me},ce])=>{const{bottom:ve,top:ye}=v4e(Y,ce,le,me);return[ye,ve]}),So(gC)),e);const re=Rt(!1);cn(xt(c,Zn(re),Gt(([Y,le])=>le||Y!==0)),re);const Z=yl(xt(Bi(j,T),kn(([{items:Y}])=>Y.length>0),Zn(re),kn(([[Y,le],me])=>{const ce=Y.items[Y.items.length-1].index===le-1;return(me||Y.bottom>0&&Y.itemHeight>0&&Y.offsetBottom===0&&Y.items.length===le)&&ce}),Gt(([[,Y]])=>Y-1),So())),K=yl(xt(Pn(j),kn(({items:Y})=>Y.length>0&&Y[0].index===0),$d(0),So())),oe=yl(xt(Pn(j),Zn(U),kn(([{items:Y},le])=>Y.length>0&&!le),Gt(([{items:Y}])=>({endIndex:Y[Y.length-1].index,startIndex:Y[0].index})),So(I5e),xm(0)));cn(oe,h.scrollSeekRangeChanged),cn(xt(E,Zn(D,N,T,F),Gt(([Y,le,me,ce,ve])=>{const ye=F5e(Y),{align:_e,behavior:Se,offset:Ae}=ye;let je=ye.index;je==="LAST"&&(je=ce-1),je=kC(0,je,OU(ce-1,je));let Ie=wU(le,ve,me,je);return _e==="end"?Ie=p4e(Ie-le.height+me.height):_e==="center"&&(Ie=p4e(Ie-le.height/2+me.height/2)),Ae&&(Ie+=Ae),{behavior:Se,top:Ie}})),l);const ie=Aa(xt(j,Gt(Y=>Y.offsetBottom+Y.bottom)),0);return cn(xt(S,Gt(Y=>({height:Y.visibleHeight,width:Y.visibleWidth}))),D),{customScrollParent:b,data:L,deviation:I,footerHeight:o,gap:F,headerHeight:i,increaseViewportBy:t,initialItemCount:P,itemDimensions:N,overscan:n,restoreStateFrom:W,scrollBy:a,scrollContainerState:s,scrollHeight:A,scrollTo:l,scrollToIndex:E,scrollTop:c,smoothScrollTargetReached:u,totalCount:T,useWindowScroll:p,viewportDimensions:D,windowScrollContainerState:O,windowScrollTo:k,windowViewportRect:S,...h,gridState:j,horizontalDirection:ne,initialTopMostItemIndex:X,totalListHeight:ie,...f,endReached:Z,propsReady:v,rangeChanged:oe,startReached:K,stateChanged:Q,stateRestoreInProgress:U,...w}},ko(hU,ns,wC,K5e,km,mU,Om));function g4e(t,e,n){return kC(1,_4((t+n)/(_4(e)+n)))}function v4e(t,e,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{bottom:0,top:0};const i=wU(t,e,n,r[0].index);return{bottom:wU(t,e,n,r[r.length-1].index)+o,top:i}}function wU(t,e,n,r){const o=g4e(t.width,n.width,e.column),i=_4(r/o),a=i*n.height+kC(0,i-1)*e.row;return a>0?a+e.row:a}const Nht=Mr(()=>{const t=Rt(d=>`Item ${d}`),e=Rt({}),n=Rt(null),r=Rt("virtuoso-grid-item"),o=Rt("virtuoso-grid-list"),i=Rt(bU),a=Rt("div"),s=Rt(Yb),l=(d,f=null)=>Aa(xt(e,Gt(h=>h[d]),So()),f),c=Rt(!1),u=Rt(!1);return cn(Pn(u),c),{components:e,computeItemKey:i,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:l("Item","div"),itemContent:t,listClassName:o,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:u,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),$ht=Mr(([t,e])=>({...t,...e}),ko(Mht,Nht)),Iht=ge.memo(function(){const t=Io("gridState"),e=Io("listClassName"),n=Io("itemClassName"),r=Io("itemContent"),o=Io("computeItemKey"),i=Io("isSeeking"),a=fc("scrollHeight"),s=Io("ItemComponent"),l=Io("ListComponent"),c=Io("ScrollSeekPlaceholder"),u=Io("context"),d=fc("itemDimensions"),f=fc("gap"),h=Io("log"),g=Io("stateRestoreInProgress"),v=fc("reportReadyState"),b=nv(ge.useMemo(()=>p=>{const O=p.parentElement.parentElement.scrollHeight;a(O);const k=p.firstChild;if(k){const{height:S,width:w}=k.getBoundingClientRect();d({height:S,width:w})}f({column:b4e("column-gap",getComputedStyle(p).columnGap,h),row:b4e("row-gap",getComputedStyle(p).rowGap,h)})},[a,d,f,h]),!0,!1);return o4e(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),g?null:y.jsx(l,{className:e,ref:b,...ma(l,u),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(p=>{const O=o(p.index,p.data,u);return i?y.jsx(c,{...ma(c,u),height:t.itemHeight,index:p.index,width:t.itemWidth},O):_.createElement(s,{...ma(s,u),className:n,"data-index":p.index,key:O},r(p.index,p.data,u))})})}),Qht=ge.memo(function(){const t=Io("HeaderComponent"),e=fc("headerHeight"),n=Io("headerFooterTag"),r=nv(ge.useMemo(()=>i=>{e(wm(i,"height"))},[e]),!0,!1),o=Io("context");return t?y.jsx(n,{ref:r,children:y.jsx(t,{...ma(t,o)})}):null}),Lht=ge.memo(function(){const t=Io("FooterComponent"),e=fc("footerHeight"),n=Io("headerFooterTag"),r=nv(ge.useMemo(()=>i=>{e(wm(i,"height"))},[e]),!0,!1),o=Io("context");return t?y.jsx(n,{ref:r,children:y.jsx(t,{...ma(t,o)})}):null}),zht=({children:t})=>{const e=ge.useContext(r4e),n=fc("itemDimensions"),r=fc("viewportDimensions"),o=nv(ge.useMemo(()=>i=>{r(i.getBoundingClientRect())},[r]),!0,!1);return ge.useEffect(()=>{e&&(r({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,r,n]),y.jsx("div",{ref:o,style:C4(!1),children:t})},Vht=({children:t})=>{const e=ge.useContext(r4e),n=fc("windowViewportRect"),r=fc("itemDimensions"),o=Io("customScrollParent"),i=R5e(n,o,!1);return ge.useEffect(()=>{e&&(r({height:e.itemHeight,width:e.itemWidth}),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,r]),y.jsx("div",{ref:i,style:C4(!1),children:t})},qht=ge.memo(function({...t}){const e=Io("useWindowScroll"),n=Io("customScrollParent"),r=n||e?Bht:Fht,o=n||e?Vht:zht,i=Io("context");return y.jsx(r,{...t,...ma(r,i),children:y.jsxs(o,{children:[y.jsx(Qht,{}),y.jsx(Iht,{}),y.jsx(Lht,{})]})})}),{useEmitter:y4e,useEmitterValue:Io,usePublisher:fc}=t4e($ht,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},qht),Fht=c4e({useEmitter:y4e,useEmitterValue:Io,usePublisher:fc}),Bht=u4e({useEmitter:y4e,useEmitterValue:Io,usePublisher:fc});function b4e(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,Ms.WARN),e==="normal"?0:parseInt(e??"0",10)}const x4e=_.createContext({isSelected:()=>!1,onSelect:Zi.NOOP}),Jb=t=>{const e=ue.c(92);let n,r,o,i,a,s,l,c,u,d,f,h,g,v,b,p,O,k,S,w,T;e[0]!==t?({children:n,displayValue:s,className:o,placeholder:g,value:T,defaultValue:a,onValueChange:f,multiple:p,shouldFilter:O,filterFn:l,open:h,defaultOpen:i,onOpenChange:u,inputPlaceholder:k,search:b,onSearchChange:d,emptyState:S,chips:w,chipsClassName:r,keepPopoverOpenOnSelect:c,...v}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e[9]=u,e[10]=d,e[11]=f,e[12]=h,e[13]=g,e[14]=v,e[15]=b,e[16]=p,e[17]=O,e[18]=k,e[19]=S,e[20]=w,e[21]=T):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],f=e[11],h=e[12],g=e[13],v=e[14],b=e[15],p=e[16],O=e[17],k=e[18],S=e[19],w=e[20],T=e[21]);const P=p!==void 0&&p,j=O===void 0||O,D=k===void 0?"Search...":k,N=S===void 0?"Nothing found.":S,E=w!==void 0&&w,A=i??!1;let I;e[22]!==u||e[23]!==h||e[24]!==A?(I={prop:h,defaultProp:A,onChange:u},e[22]=u,e[23]=h,e[24]=A,e[25]=I):I=e[25];const[L,F]=Ao(I),Q=L!==void 0&&L;let W,U;e[26]!==f?(W=Fe=>{f==null||f(Fe)},e[26]=f,e[27]=W):W=e[27],e[28]!==a||e[29]!==W||e[30]!==T?(U={prop:T,defaultProp:a,onChange:W},e[28]=a,e[29]=W,e[30]=T,e[31]=U):U=e[31];const[X,G]=Ao(U);let ae;e[32]!==X?(ae=Fe=>Array.isArray(X)?X.includes(Fe):X===Fe,e[32]=X,e[33]=ae):ae=e[33];const ne=ae;let re;e[34]!==c||e[35]!==P||e[36]!==F||e[37]!==G||e[38]!==X?(re=Fe=>{let kt=Fe;if(P)if(Array.isArray(X))if(X.includes(kt)){const Re=X.filter(ot=>ot!==Fe);kt=Re.length>0?Re:[]}else kt=[...X,kt];else kt=[kt];else X===Fe&&(kt=null);G(kt),(c??P)||F(!1)},e[34]=c,e[35]=P,e[36]=F,e[37]=G,e[38]=X,e[39]=re):re=e[39];const Z=re;let K;e[40]!==E||e[41]!==s||e[42]!==P||e[43]!==g||e[44]!==X?(K=()=>P&&E&&g?g:X!=null?Array.isArray(X)?X.length===0?g??"--":X.length===1&&s!==void 0?s(X[0]):`${X.length} selected`:s!==void 0?s(X):g??"--":g??"--",e[40]=E,e[41]=s,e[42]=P,e[43]=g,e[44]=X,e[45]=K):K=e[45];const oe=K;let ie,Y,le,me,ce,ve,ye,_e,Se,Ae,je,Ie,De,nt;return e[46]===Symbol.for("react.memo_cache_sentinel")?(ie=we("relative"),e[46]=ie):ie=e[46],e[47]!==o?(Y=we("flex h-6 w-fit mb-1 shadow-xsSolid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-smSolid focus:outline-none focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-mdSolid disabled:cursor-not-allowed disabled:opacity-50",o),e[47]=o,e[48]=Y):Y=e[48],e[49]!==oe?(le=oe(),e[49]=oe,e[50]=le):le=e[50],e[51]===Symbol.for("react.memo_cache_sentinel")?(me=y.jsx(xu,{className:"ml-3 w-4 h-4 opacity-50"}),e[51]=me):me=e[51],e[52]!==Q||e[53]!==Y||e[54]!==le?(ce=y.jsx(sy,{asChild:!0,children:y.jsxs("div",{className:Y,"aria-expanded":Q,children:[le," ",me]})}),e[52]=Q,e[53]=Y,e[54]=le,e[55]=ce):ce=e[55],e[56]!==D||e[57]!==d||e[58]!==b?(ve=y.jsx(EO,{placeholder:D,rootClassName:"px-1 h-8",autoFocus:!0,value:b,onValueChange:d}),e[56]=D,e[57]=d,e[58]=b,e[59]=ve):ve=e[59],e[60]!==N?(ye=y.jsx(RO,{children:N}),e[60]=N,e[61]=ye):ye=e[61],e[62]!==Z||e[63]!==ne?(_e={isSelected:ne,onSelect:Z},e[62]=Z,e[63]=ne,e[64]=_e):_e=e[64],e[65]!==n||e[66]!==_e?(Se=y.jsx(x4e,{value:_e,children:n}),e[65]=n,e[66]=_e,e[67]=Se):Se=e[67],e[68]!==ye||e[69]!==Se?(Ae=y.jsxs(PO,{className:"max-h-60 py-.5",children:[ye,Se]}),e[68]=ye,e[69]=Se,e[70]=Ae):Ae=e[70],e[71]!==l||e[72]!==j||e[73]!==ve||e[74]!==Ae?(je=y.jsx(tp,{className:"w-full min-w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:y.jsxs(by,{filter:l,shouldFilter:j,children:[ve,Ae]})}),e[71]=l,e[72]=j,e[73]=ve,e[74]=Ae,e[75]=je):je=e[75],e[76]!==Q||e[77]!==F||e[78]!==ce||e[79]!==je?(Ie=y.jsxs(dg,{open:Q,onOpenChange:F,children:[ce,je]}),e[76]=Q,e[77]=F,e[78]=ce,e[79]=je,e[80]=Ie):Ie=e[80],e[81]!==E||e[82]!==r||e[83]!==s||e[84]!==Z||e[85]!==P||e[86]!==X?(De=P&&E&&y.jsx("div",{className:we("flex flex-col gap-1 items-start",r),children:Array.isArray(X)&&X.map(Fe=>Fe==null?null:y.jsxs(aM,{variant:"secondary",children:[(s==null?void 0:s(Fe))??String(Fe),y.jsx(PH,{onClick:()=>{Z(Fe)},className:"w-3 h-3 opacity-50 hover:opacity-100 ml-1 cursor-pointer"})]},String(Fe)))}),e[81]=E,e[82]=r,e[83]=s,e[84]=Z,e[85]=P,e[86]=X,e[87]=De):De=e[87],e[88]!==v||e[89]!==Ie||e[90]!==De?(nt=y.jsxs("div",{className:ie,...v,children:[Ie,De]}),e[88]=v,e[89]=Ie,e[90]=De,e[91]=nt):nt=e[91],nt},hc=ge.forwardRef((t,e)=>{const n=ue.c(17),{children:r,className:o,value:i,onSelect:a,disabled:s}=t,l=typeof i=="object"&&"value"in i?i.value:String(i),c=ge.use(x4e);let u,d,f,h;return n[0]!==o?(u=we("pl-6 m-1 py-1",o),n[0]=o,n[1]=u):u=n[1],n[2]!==c||n[3]!==a||n[4]!==i?(d=()=>{c.onSelect(i),a==null||a(i)},n[2]=c,n[3]=a,n[4]=i,n[5]=d):d=n[5],n[6]!==c||n[7]!==i?(f=c.isSelected(i)&&y.jsx(rg,{className:"absolute left-1 h-4 w-4"}),n[6]=c,n[7]=i,n[8]=f):f=n[8],n[9]!==r||n[10]!==s||n[11]!==e||n[12]!==u||n[13]!==d||n[14]!==f||n[15]!==l?(h=y.jsxs(fy,{ref:e,className:u,role:"option",value:l,disabled:s,onSelect:d,children:[f,r]}),n[9]=r,n[10]=s,n[11]=e,n[12]=u,n[13]=d,n[14]=f,n[15]=l,n[16]=h):h=n[16],h});function O4e(t,e){return e.split(/\s+/).every(n=>t.toLowerCase().includes(n.toLowerCase()))?1:0}hc.displayName="ComboboxItem";const kU="__select_all__",SU="__deselect_all__",w4e=t=>{const e=ue.c(45),{options:n,label:r,value:o,setValue:i,fullWidth:a,maxSelections:s}=t,l=_.useId(),[c,u]=_.useState("");let d;e:{if(!c){d=n;break e}let N;if(e[0]!==n||e[1]!==c){let E;e[3]!==c?(E=A=>O4e(A,c)===1,e[3]=c,e[4]=E):E=e[4],N=n.filter(E),e[0]=n,e[1]=c,e[2]=N}else N=e[2];d=N}const f=d;let h;e[5]!==s||e[6]!==i?(h=N=>{N&&N.length!==0?(N=N.filter(Wht),s!==1?(s!=null&&N.length>s&&(N=N.slice(-s)),i(N)):i([N[N.length-1]])):i([])},e[5]=s,e[6]=i,e[7]=h):h=e[7];const g=h;let v;e[8]!==n||e[9]!==i?(v=()=>{i(n)},e[8]=n,e[9]=i,e[10]=v):v=e[10];const b=v;let p;e[11]!==i?(p=()=>{i([])},e[11]=i,e[12]=p):p=e[12];const O=p;let k,S;if(e[13]!==O||e[14]!==b||e[15]!==s||e[16]!==n.length||e[17]!==o){k=[];const N=n.length>0&&o.length<n.length,E=n.length>0&&o.length>0;if(n.length>2&&s==null){const A=!N;let I;e[19]!==b||e[20]!==A?(I=y.jsx(hc,{value:kU,onSelect:b,disabled:A,children:"Select all"},kU),e[19]=b,e[20]=A,e[21]=I):I=e[21],k.push(I)}if(n.length>2){const A=!E,I=s===1?"Deselect":"Deselect all";let L,F;e[22]!==O||e[23]!==A||e[24]!==I?(L=y.jsx(hc,{value:SU,onSelect:O,disabled:A,children:I},SU),e[22]=O,e[23]=A,e[24]=I,e[25]=L):L=e[25],e[26]===Symbol.for("react.memo_cache_sentinel")?(F=y.jsx(LM,{},"_separator"),e[26]=F):F=e[26],k.push(L,F)}e[13]=O,e[14]=b,e[15]=s,e[16]=n.length,e[17]=o,e[18]=k}else k=e[18];e[27]!==k||e[28]!==f?(S=()=>{if(f.length>200)return y.jsx(d4e,{style:{height:"200px"},totalCount:f.length,overscan:50,itemContent:E=>{const A=y.jsx(hc,{value:f[E],children:f[E]},f[E]);return E===0?y.jsxs(y.Fragment,{children:[k,A]}):A}});const N=f.map(Uht);return y.jsxs(y.Fragment,{children:[k,N]})},e[27]=k,e[28]=f,e[29]=S):S=e[29];const w=S;let T,P,j,D;return e[30]!==a?(T=we({"w-full":a}),e[30]=a,e[31]=T):T=e[31],e[32]!==w?(P=w(),e[32]=w,e[33]=P):P=e[33],e[34]!==g||e[35]!==c||e[36]!==T||e[37]!==P||e[38]!==o?(j=y.jsx(Jb,{displayValue:Zht,placeholder:"Select...",multiple:!0,className:T,value:o,onValueChange:g,shouldFilter:!1,search:c,onSearchChange:u,children:P}),e[34]=g,e[35]=c,e[36]=T,e[37]=P,e[38]=o,e[39]=j):j=e[39],e[40]!==a||e[41]!==l||e[42]!==r||e[43]!==j?(D=y.jsx(Jo,{label:r,id:l,fullWidth:a,children:j}),e[40]=a,e[41]=l,e[42]=r,e[43]=j,e[44]=D):D=e[44],D};function Wht(t){return t!==kU&&t!==SU}function Uht(t){return y.jsx(hc,{value:t,children:t},t)}function Zht(t){return t}function k4e({moduleName:t,variableName:e,onAddImport:n,appStore:r=Ht}){if(e in r.get(Du))return!1;const{cellData:o,cellIds:i}=r.get(ur),a=new RegExp(`import[ ]+${t}[ ]+as[ ]+${e}`,"g");for(const s of i.inOrderIds)if(a.test(o[s].code))return!1;return n(`import ${t} as ${e}`),!0}G6e=function({autoInstantiate:t,createNewCell:e,fromCellId:n}){return k4e({moduleName:"marimo",variableName:"mo",onAddImport:r=>{const o=ms.create();e({cellId:n??"__end__",before:!1,code:r,lastCodeRun:t?r:void 0,newCellId:o,autoFocus:!1}),t&&qM({cellIds:[o],codes:[r]})}})};function S4e({autoInstantiate:t,createNewCell:e,fromCellId:n}){return k4e({moduleName:"altair",variableName:"alt",onAddImport:r=>{const o=ms.create();e({cellId:n??"__end__",before:!1,code:r,lastCodeRun:t?r:void 0,newCellId:o,autoFocus:!1}),t&&qM({cellIds:[o],codes:[r]})}})}({valueAtom:oee,useActions:PJ}=Xh(function(){return{focusedCellId:null,lastFocusedCellId:null}},{focusCell:(t,e)=>({...t,focusedCellId:e.cellId,lastFocusedCellId:e.cellId}),toggleCell:(t,e)=>t.focusedCellId===e.cellId?{...t,focusedCellId:null}:{...t,focusedCellId:e.cellId,lastFocusedCellId:e.cellId},blurCell:t=>({...t,focusedCellId:null})})),ON=Ct(t=>t(oee).lastFocusedCellId),PT=function(){return Gr(ON)},q6e=Ct(t=>{const e=t(ON);return e?e===Al?null:C4e(e,t(ur)):null}),GLe=function(t){return Ct(e=>C4e(t,e(ur)))};function C4e(t,e){var l;const{cellData:n,cellHandles:r,cellRuntime:o}=e,i=n[t],a=o[t],s=(l=r[t])==null?void 0:l.current;return!i||!s?null:{cellId:t,name:i.name,config:i.config,status:a?a.status:"idle",getEditorView:()=>s.editorView,hasOutput:(a==null?void 0:a.output)!=null,hasConsoleOutput:(a==null?void 0:a.consoleOutputs)!=null}}see=function(){const t=ue.c(4),e=Gr(FM),n=PT(),{createNewCell:r}=Iv();let o;return t[0]!==e||t[1]!==r||t[2]!==n?(o=i=>{i.includes("alt")&&S4e({autoInstantiate:e,createNewCell:r,fromCellId:n}),r({code:i,before:!1,cellId:n??"__end__"})},t[0]=e,t[1]=r,t[2]=n,t[3]=o):o=t[3],o};let _4e,T4e;_4e=[IT(),mt.lineWrapping],T4e=[Jx(),mt.lineWrapping],hO=_.memo(t=>{const e=ue.c(41),{theme:n}=as();let r,o,i,a,s,l,c,u;e[0]!==t?({code:o,className:r,initiallyHideCode:i,showHideCode:l,showCopyCode:c,insertNewCell:a,language:u,...s}=t,e[0]=t,e[1]=r,e[2]=o,e[3]=i,e[4]=a,e[5]=s,e[6]=l,e[7]=c,e[8]=u):(r=e[1],o=e[2],i=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8]);const d=l===void 0||l,f=c===void 0||c,h=u===void 0?"python":u,[g,v]=_.useState(i);let b,p,O,k,S,w;e[9]!==r?(b=we("relative hover-actions-parent w-full overflow-hidden",r),e[9]=r,e[10]=b):b=e[10],e[11]!==g||e[12]!==d?(p=d&&g&&y.jsx(DJ,{tooltip:"Show code",onClick:()=>v(!1)}),e[11]=g,e[12]=d,e[13]=p):p=e[13],e[14]!==o||e[15]!==f?(O=f&&y.jsx(P4e,{text:o}),e[14]=o,e[15]=f,e[16]=O):O=e[16],e[17]!==o||e[18]!==a?(k=a&&y.jsx(R4e,{code:o}),e[17]=o,e[18]=a,e[19]=k):k=e[19],e[20]!==g||e[21]!==d?(S=d&&!g&&y.jsx(E4e,{onClick:()=>v(!0)}),e[20]=g,e[21]=d,e[22]=S):S=e[22],e[23]!==O||e[24]!==k||e[25]!==S?(w=y.jsxs("div",{className:"absolute top-0 right-0 my-1 mx-2 z-10 hover-action flex gap-2",children:[O,k,S]}),e[23]=O,e[24]=k,e[25]=S,e[26]=w):w=e[26];const T=g&&"opacity-20 h-8 overflow-hidden";let P;e[27]!==T?(P=we("cm",T),e[27]=T,e[28]=P):P=e[28];const j=n==="dark"?"dark":"light",D=!g,N=h==="python"?_4e:T4e;let E,A;return e[29]!==o||e[30]!==s||e[31]!==P||e[32]!==j||e[33]!==D||e[34]!==N?(E=y.jsx(Fx,{...s,className:P,theme:j,height:"100%",editable:D,extensions:N,value:o,readOnly:!0}),e[29]=o,e[30]=s,e[31]=P,e[32]=j,e[33]=D,e[34]=N,e[35]=E):E=e[35],e[36]!==E||e[37]!==b||e[38]!==p||e[39]!==w?(A=y.jsxs("div",{className:b,children:[p,w,E]}),e[36]=E,e[37]=b,e[38]=p,e[39]=w,e[40]=A):A=e[40],A}),hO.displayName="ReadonlyCode";let P4e,E4e,R4e,pc,CU,P4,SC,_U,iv,av,sv,j4e,CC,_C,E4,R4,lv,cv,TU,D4e,j4,TC,PU,A4e,EU,D4;P4e=t=>{const e=ue.c(5);let n;e[0]!==t.text?(n=ai.stopPropagation(async()=>{await Kd(t.text),Kr({title:"Copied to clipboard"})}),e[0]=t.text,e[1]=n):n=e[1];const r=n;let o,i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsx(zv,{size:14,strokeWidth:1.5}),e[2]=o):o=e[2],e[3]!==r?(i=y.jsx(qn,{content:"Copy code",usePortal:!1,children:y.jsx(Ft,{onClick:r,size:"xs",className:"py-0",variant:"secondary",children:o})}),e[3]=r,e[4]=i):i=e[4],i},E4e=t=>{const e=ue.c(3);let n,r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx(vK,{size:14,strokeWidth:1.5}),e[0]=n):n=e[0],e[1]!==t.onClick?(r=y.jsx(qn,{content:"Hide code",usePortal:!1,children:y.jsx(Ft,{onClick:t.onClick,size:"xs",className:"py-0",variant:"secondary",children:n})}),e[1]=t.onClick,e[2]=r):r=e[2],r},DJ=t=>{const e=ue.c(7);let n,r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx(gK,{className:"hover-action w-5 h-5 text-muted-foreground cursor-pointer absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 opacity-80 hover:opacity-100 z-20"}),e[0]=n):n=e[0],e[1]!==t.tooltip?(r=y.jsx(qn,{usePortal:!1,content:t.tooltip,children:n}),e[1]=t.tooltip,e[2]=r):r=e[2],e[3]!==t.className||e[4]!==t.onClick||e[5]!==r?(o=y.jsx("div",{className:t.className,onClick:t.onClick,children:r}),e[3]=t.className,e[4]=t.onClick,e[5]=r,e[6]=o):o=e[6],o},R4e=t=>{const e=ue.c(6),n=see();let r;e[0]!==n||e[1]!==t.code?(r=()=>{n(t.code)},e[0]=n,e[1]=t.code,e[2]=r):r=e[2];const o=r;let i,a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(OO,{size:14,strokeWidth:1.5}),e[3]=i):i=e[3],e[4]!==o?(a=y.jsx(qn,{content:"Add code to notebook",usePortal:!1,children:y.jsx(Ft,{onClick:o,size:"xs",className:"py-0",variant:"secondary",children:i})}),e[4]=o,e[5]=a):a=e[5],a},pc=t=>{const e=ue.c(5),{text:n,tooltip:r}=t;let o,i;return e[0]!==r?(o=r&&y.jsx(qn,{content:r,children:y.jsx(sk,{className:"w-3 h-3 mt-0.5"})}),e[0]=r,e[1]=o):o=e[1],e[2]!==o||e[3]!==n?(i=y.jsxs("h2",{className:"font-semibold my-0 flex items-center gap-1",children:[n,o]}),e[2]=o,e[3]=n,e[4]=i):i=e[4],i},CU=t=>{const e=ue.c(5),{children:n,className:r}=t;let o,i;return e[0]!==r?(o=we("flex flex-col gap-2",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},P4=t=>{const e=ue.c(4),{className:n}=t;let r,o;return e[0]!==n?(r=we("my-1",n),e[0]=n,e[1]=r):r=e[1],e[2]!==r?(o=y.jsx("hr",{className:r}),e[2]=r,e[3]=o):o=e[3],o},SC=t=>{const e=ue.c(5),{children:n,className:r}=t;let o,i;return e[0]!==r?(o=we("flex flex-col gap-1.5",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx("section",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},_U=t=>{const e=ue.c(7),{Icon:n,text:r}=t;let o,i,a;return e[0]!==n?(o=y.jsx(n,{className:"w-3 h-3 mr-2"}),e[0]=n,e[1]=o):o=e[1],e[2]!==r?(i=y.jsx("span",{children:r}),e[2]=r,e[3]=i):i=e[3],e[4]!==o||e[5]!==i?(a=y.jsxs("div",{className:"flex items-center",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a},iv=t=>{const e=ue.c(5),{children:n,className:r}=t;let o,i;return e[0]!==r?(o=we("py-1",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx(qO,{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},av=t=>{const e=ue.c(3),{children:n,value:r}=t;let o;return e[0]!==n||e[1]!==r?(o=y.jsx(ky,{value:r,className:"border-none",children:n}),e[0]=n,e[1]=r,e[2]=o):o=e[2],o},sv=t=>{const e=ue.c(5),{children:n,wrapperClassName:r}=t;let o,i;return e[0]!==r?(o=we("pb-2 flex flex-col gap-2",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx(wy,{wrapperClassName:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},j4e=t=>{const e=ue.c(4),{code:n,insertNewCell:r,language:o}=t;let i;return e[0]!==n||e[1]!==r||e[2]!==o?(i=y.jsx(hO,{minHeight:"330px",maxHeight:"330px",code:n,language:o,showHideCode:!1,showCopyCode:!1,insertNewCell:r}),e[0]=n,e[1]=r,e[2]=o,e[3]=i):i=e[3],i},CC="__clear__",_C=t=>{const e=ue.c(23),{fieldName:n,columns:r,onValueChange:o,includeCountField:i}=t,a=i===void 0||i,s=mo();let l;e[0]!==n?(l=n.replace(".field",".type"),e[0]=n,e[1]=l):l=e[1];const c=l;let u;e[2]!==n?(u=n.replace(".field",".selectedDataType"),e[2]=n,e[3]=u):u=e[3];const d=u;let f;e[4]!==n||e[5]!==s||e[6]!==o||e[7]!==d||e[8]!==c?(f=()=>{s.setValue(n,Da),s.setValue(c,Da),s.setValue(d,Da),o==null||o(Da,void 0)},e[4]=n,e[5]=s,e[6]=o,e[7]=d,e[8]=c,e[9]=f):f=e[9];const h=f;let g,v;return e[10]!==h||e[11]!==r||e[12]!==n||e[13]!==s||e[14]!==a||e[15]!==o||e[16]!==d||e[17]!==c?(g=b=>{const{field:p}=b;return y.jsx(jr,{children:y.jsx(Ir,{children:y.jsxs(Zs,{...p,onValueChange:O=>{if(O===CC)return void h();if(O===tv)return s.setValue(n,O),s.setValue(c,Da),s.setValue(d,Da),void(o==null?void 0:o(n,"number"));const k=r.find(S=>S.name===O);k&&(s.setValue(n,O),s.setValue(c,k.type),s.setValue(d,UW(k.type)),o==null||o(n,k.type))},value:p.value??Da,children:[y.jsx(Ws,{className:"w-40 truncate",onClear:p.value?h:void 0,children:y.jsx(Us,{placeholder:"Select column"})}),y.jsxs(cs,{children:[p.value&&y.jsx(Qo,{value:CC,children:y.jsxs("div",{className:"flex items-center truncate",children:[y.jsx(Qa,{className:"w-3 h-3 mr-2"}),"Clear"]})}),a&&y.jsxs(y.Fragment,{children:[y.jsx(Qo,{value:tv,children:y.jsxs("div",{className:"flex items-center truncate",children:[y.jsx(rO,{className:"w-3 h-3 mr-2"}),"Count of records"]})},tv),y.jsx(of,{})]}),r.map(Xht)]})]})})})},e[10]=h,e[11]=r,e[12]=n,e[13]=s,e[14]=a,e[15]=o,e[16]=d,e[17]=c,e[18]=g):g=e[18],e[19]!==n||e[20]!==s.control||e[21]!==g?(v=y.jsx(rr,{control:s.control,name:n,render:g}),e[19]=n,e[20]=s.control,e[21]=g,e[22]=v):v=e[22],v},E4=t=>{const e=ue.c(8),{fieldName:n,label:r,options:o,defaultValue:i}=t,a=mo();let s,l;return e[0]!==i||e[1]!==r||e[2]!==o?(s=c=>{const{field:u}=c;return y.jsxs(jr,{className:"flex flex-row items-center justify-between",children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsxs(Zs,{...u,onValueChange:u.onChange,value:u.value??i,children:[y.jsx(Ws,{className:"truncate",children:y.jsx(Us,{placeholder:"Select an option"})}),y.jsx(cs,{children:y.jsx(Cu,{children:o.filter(Hht).map(Yht)})})]})})]})},e[0]=i,e[1]=r,e[2]=o,e[3]=s):s=e[3],e[4]!==n||e[5]!==a.control||e[6]!==s?(l=y.jsx(rr,{control:a.control,name:n,render:s}),e[4]=n,e[5]=a.control,e[6]=s,e[7]=l):l=e[7],l},R4=t=>{const e=ue.c(6),{fieldName:n,label:r}=t,o=mo();let i,a;return e[0]!==r?(i=s=>{const{field:l}=s;return y.jsxs(jr,{className:"flex flex-row gap-2 items-center",children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsx(d0,{...l,value:l.value??Da,onValueChange:l.onChange,className:"text-xs h-5"})})]})},e[0]=r,e[1]=i):i=e[1],e[2]!==n||e[3]!==o.control||e[4]!==i?(a=y.jsx(rr,{control:o.control,name:n,render:i}),e[2]=n,e[3]=o.control,e[4]=i,e[5]=a):a=e[5],a},lv=t=>{const e=ue.c(17);let n,r,o,i,a,s;e[0]!==t?({fieldName:r,label:a,className:n,inputClassName:o,isDisabled:i,...s}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a,e[6]=s):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5],s=e[6]);const l=mo();let c,u;return e[7]!==n||e[8]!==o||e[9]!==i||e[10]!==a||e[11]!==s?(c=d=>{const{field:f}=d;return y.jsxs(jr,{className:we("flex flex-row items-center gap-2",n),children:[y.jsx(dr,{className:"whitespace-nowrap",children:a}),y.jsx(Ir,{children:y.jsx(i9,{...f,value:f.value,onValueChange:f.onChange,"aria-label":a,className:we("w-16",o),isDisabled:i,minValue:0,...s})})]})},e[7]=n,e[8]=o,e[9]=i,e[10]=a,e[11]=s,e[12]=c):c=e[12],e[13]!==r||e[14]!==l.control||e[15]!==c?(u=y.jsx(rr,{control:l.control,name:r,render:c}),e[13]=r,e[14]=l.control,e[15]=c,e[16]=u):u=e[16],u},cv=t=>{const e=ue.c(8),{fieldName:n,label:r,className:o,defaultValue:i}=t,a=mo();let s,l;return e[0]!==o||e[1]!==i||e[2]!==r?(s=c=>{const{field:u}=c;return y.jsxs(jr,{className:we("flex flex-row items-center gap-2",o),children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsx(Tl,{checked:u.value??i??!1,onCheckedChange:u.onChange,className:"w-4 h-4"})})]})},e[0]=o,e[1]=i,e[2]=r,e[3]=s):s=e[3],e[4]!==n||e[5]!==a.control||e[6]!==s?(l=y.jsx(rr,{control:a.control,name:n,render:s}),e[4]=n,e[5]=a.control,e[6]=s,e[7]=l):l=e[7],l},TU=t=>{const e=ue.c(16),{fieldName:n,label:r,value:o,start:i,stop:a,step:s,className:l}=t,[c,u]=ge.useState(o),d=mo();let f,h,g,v;return e[0]!==o?(f=()=>{u(o)},h=[o],e[0]=o,e[1]=f,e[2]=h):(f=e[1],h=e[2]),ge.useEffect(f,h),e[3]!==l||e[4]!==n||e[5]!==d||e[6]!==c||e[7]!==r||e[8]!==i||e[9]!==s||e[10]!==a?(g=b=>{const{field:p}=b;return y.jsxs(jr,{className:we("flex flex-row items-center gap-2 w-1/2",l),children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsx(JW,{...p,id:n,className:"relative flex items-center select-none",value:[c],min:i,max:a,step:s,onValueChange:O=>{const[k]=O;u(k),p.onChange(k)},onValueCommit:O=>{const[k]=O;p.onChange(k),d.setValue(n,k)},valueMap:Ght})})]})},e[3]=l,e[4]=n,e[5]=d,e[6]=c,e[7]=r,e[8]=i,e[9]=s,e[10]=a,e[11]=g):g=e[11],e[12]!==n||e[13]!==d.control||e[14]!==g?(v=y.jsx(rr,{control:d.control,name:n,render:g}),e[12]=n,e[13]=d.control,e[14]=g,e[15]=v):v=e[15],v},D4e=t=>{const e=ue.c(21),{fieldName:n,label:r,className:o}=t,i=mo();let a;e[0]!==n||e[1]!==i?(a=i.watch(n),e[0]=n,e[1]=i,e[2]=a):a=e[2];const s=a;let l;e[3]!==s?(l=s??[],e[3]=s,e[4]=l):l=e[4];const[c,u]=ge.useState(l);let d;e[5]!==c||e[6]!==n||e[7]!==i?(d=()=>{const b=[...c,"#000000"];u(b),i.setValue(n,b)},e[5]=c,e[6]=n,e[7]=i,e[8]=d):d=e[8];const f=d;let h;e[9]!==c||e[10]!==n||e[11]!==i?(h=b=>{const p=c.filter((O,k)=>k!==b);u(p),i.setValue(n,p)},e[9]=c,e[10]=n,e[11]=i,e[12]=h):h=e[12];const g=h;let v;if(e[13]!==f||e[14]!==o||e[15]!==c||e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==g){const b=(p,O)=>{const k=[...c];k[p]=O,u(k),i.setValue(n,k)};v=y.jsx(rr,{control:i.control,name:n,render:()=>y.jsxs(jr,{className:we("flex flex-col gap-2",o),children:[y.jsx(dr,{children:r}),y.jsxs("div",{className:"flex flex-col gap-2",children:[c.map((p,O)=>y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("input",{type:"color",value:p,onChange:k=>b(O,k.target.value),className:"w-4 h-4 rounded cursor-pointer"}),y.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:p}),y.jsx(Ft,{variant:"ghost",size:"sm",onClick:()=>g(O),className:"h-4 w-4 p-0",children:y.jsx(Qa,{className:"h-2 w-2"})})]},O)),y.jsxs(Ft,{variant:"outline",size:"sm",onClick:f,className:"w-fit h-6 text-xs",children:[y.jsx(OO,{className:"h-3 w-3 mr-1"}),"Add Color"]})]})]})}),e[13]=f,e[14]=o,e[15]=c,e[16]=n,e[17]=i,e[18]=r,e[19]=g,e[20]=v}else v=e[20];return v},j4=t=>{const e=ue.c(10),{fieldName:n,label:r}=t,o=mo();let i;e[0]!==n||e[1]!==o?(i=()=>{o.setValue(n,Da)},e[0]=n,e[1]=o,e[2]=i):i=e[2];const a=i,s=Kht;let l,c;return e[3]!==a||e[4]!==r?(l=u=>{const{field:d}=u;return y.jsxs(jr,{className:"flex flex-row items-center justify-between w-full",children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsxs(Zs,{...d,onValueChange:f=>{f===CC?a():d.onChange(f)},value:d.value??WW,children:[y.jsx(Ws,{onClear:d.value?a:void 0,children:y.jsx(Us,{placeholder:"Select unit"})}),y.jsxs(cs,{className:"w-72",children:[d.value&&y.jsxs(y.Fragment,{children:[y.jsx(Qo,{value:CC,children:y.jsxs("div",{className:"flex items-center truncate",children:[y.jsx(Qa,{className:"w-3 h-3 mr-2"}),"Clear"]})}),y.jsx(of,{})]}),y.jsxs(Cu,{children:[Hje.map(s),y.jsx(of,{}),Xje.map(s)]})]})]})})]})},e[3]=a,e[4]=r,e[5]=l):l=e[5],e[6]!==n||e[7]!==o.control||e[8]!==l?(c=y.jsx(rr,{control:o.control,name:n,render:l}),e[6]=n,e[7]=o.control,e[8]=l,e[9]=c):c=e[9],c},TC=t=>{const e=ue.c(9),{fieldName:n,label:r,defaultValue:o,onValueChange:i}=t,[a,s]=ge.useState(!1),l=mo();let c,u;return e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==i?(c=d=>{const{field:f}=d;return y.jsxs(jr,{className:"flex flex-row items-center justify-between w-full",children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsxs(Zs,{...f,onValueChange:h=>{f.onChange(h),i==null||i(h)},value:f.value??o,open:a,onOpenChange:s,children:[y.jsx(Ws,{children:y.jsx(Us,{placeholder:"Select an option"})}),y.jsx(cs,{children:y.jsx(Cu,{children:Zje.map(h=>{const g=hj[h],v=h==="string"?"categorical":h;return y.jsx(Qo,{value:h,className:"flex flex-col items-start justify-center",subtitle:a&&y.jsx("span",{className:"text-xs text-muted-foreground",children:Sft[h]}),children:y.jsx(_U,{Icon:g,text:Eu(v)})},h)})})})]})})]})},e[0]=o,e[1]=a,e[2]=r,e[3]=i,e[4]=c):c=e[4],e[5]!==n||e[6]!==l.control||e[7]!==c?(u=y.jsx(rr,{control:l.control,name:n,render:c}),e[5]=n,e[6]=l.control,e[7]=c,e[8]=u):u=e[8],u},PU=t=>{const e=ue.c(12),{fieldName:n,selectedDataType:r,binFieldName:o,defaultAggregation:i}=t,a=mo(),s=r==="string"?Kje:Gje,{chartType:l}=Md(),c=l!==ei.HEATMAP,u=Jht,d=ept;let f;e[0]!==o||e[1]!==a?(f=b=>{const{value:p,previousValue:O,onChange:k}=b;p===hC?a.setValue(o,!0):O===hC&&a.setValue(o,!1),k(p)},e[0]=o,e[1]=a,e[2]=f):f=e[2];const h=f;let g,v;return e[3]!==s||e[4]!==i||e[5]!==h||e[6]!==c?(g=b=>{const{field:p}=b;return y.jsx(jr,{children:y.jsx(Ir,{children:y.jsxs(Zs,{...p,value:(p.value??i??Ad).toString(),onValueChange:O=>{h({value:O,previousValue:p.value,onChange:p.onChange})},children:[y.jsx(Ws,{variant:"ghost",children:y.jsx(Us,{})}),y.jsx(cs,{children:y.jsxs(Cu,{children:[y.jsx(sO,{children:"Aggregation"}),s.map(O=>{const k=Oft[O],S=u(wft[O]),w=d({value:O,Icon:k,subtitle:S});return O===hC?c?y.jsxs("div",{children:[y.jsx(of,{}),w]},O):null:w})]})})]})})})},e[3]=s,e[4]=i,e[5]=h,e[6]=c,e[7]=g):g=e[7],e[8]!==n||e[9]!==a.control||e[10]!==g?(v=y.jsx(rr,{control:a.control,name:n,render:g}),e[8]=n,e[9]=a.control,e[10]=g,e[11]=v):v=e[11],v},A4e=t=>{const e=ue.c(7),{fieldName:n,saveFunction:r}=t,o=mo(),{fields:i}=Md(),a=tpt;let s,l;return e[0]!==i||e[1]!==r?(s=c=>{const{field:u}=c,d=u.value,f=(d==null?void 0:d.map(npt))??[];return y.jsx(jr,{children:y.jsx(Ir,{children:y.jsx(w4e,{options:(i==null?void 0:i.map(rpt))??[],value:f,setValue:h=>{const g=(typeof h=="function"?h([]):h).map(v=>a(v,i));u.onChange(g),r()},label:null,fullWidth:!1})})})},e[0]=i,e[1]=r,e[2]=s):s=e[2],e[3]!==n||e[4]!==o.control||e[5]!==s?(l=y.jsx(rr,{control:o.control,name:n,render:s}),e[3]=n,e[4]=o.control,e[5]=s,e[6]=l):l=e[6],l},EU=t=>{const e=ue.c(5),{fieldName:n,label:r,defaultValue:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Yje.map(opt),e[0]=i):i=e[0];const a=o??"ascending";let s;return e[1]!==n||e[2]!==r||e[3]!==a?(s=y.jsx(E4,{fieldName:n,label:r,options:i,defaultValue:a}),e[1]=n,e[2]=r,e[3]=a,e[4]=s):s=e[4],s},D4=t=>{var h,g,v,b;const e=ue.c(10),{fieldName:n}=t,r=mo();let o;e[0]!==r.control?(o={control:r.control},e[0]=r.control,e[1]=o):o=e[1];const i=cu(o);if(!((g=(h=i[n])==null?void 0:h.bin)==null?void 0:g.binned))return null;const s=!Number.isNaN((b=(v=i[n])==null?void 0:v.bin)==null?void 0:b.step),l=`${n}.bin.step`;let c;e[2]!==l?(c=y.jsx(lv,{fieldName:l,label:"Bin step",inputClassName:"w-14",placeholder:"0.5"}),e[2]=l,e[3]=c):c=e[3];const u=`${n}.bin.maxbins`;let d,f;return e[4]!==s||e[5]!==u?(d=y.jsx(lv,{fieldName:u,label:"Max bins",inputClassName:"w-14",isDisabled:s,placeholder:"10"}),e[4]=s,e[5]=u,e[6]=d):d=e[6],e[7]!==c||e[8]!==d?(f=y.jsxs("div",{className:"flex flex-row justify-between",children:[c,d]}),e[7]=c,e[8]=d,e[9]=f):f=e[9],f};function Xht(t){if(t.name.trim()===Da)return null;const e=hj[t.type];return y.jsx(Qo,{value:t.name,children:y.jsxs("div",{className:"flex items-center truncate",children:[y.jsx(e,{className:"w-3 h-3 mr-2"}),t.name]})},t.name)}function Hht(t){return t.value!==Da}function Yht(t){return y.jsx(Qo,{value:t.value,children:t.display},t.value)}function Ght(t){return t}function Kht(t){const[e,n]=Cft[t];return y.jsx(Qo,{value:t,className:"flex flex-row",subtitle:y.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:n}),children:e},t)}function Jht(t){return y.jsx("span",{className:"text-xs text-muted-foreground pr-10",children:t})}function ept(t){const{value:e,Icon:n,subtitle:r}=t;return y.jsx(Qo,{value:e,className:"flex flex-col items-start justify-center",subtitle:r,children:y.jsxs("div",{className:"flex items-center",children:[y.jsx(n,{className:"w-3 h-3 mr-2"}),Eu(e)]})},e)}function tpt(t,e){const n=e.find(r=>r.name===t);return{field:t,type:(n==null?void 0:n.type)??"string"}}function npt(t){return t.field}function rpt(t){return t.name}function opt(t){return{display:y.jsx(_U,{Icon:t==="ascending"?cce:O6,text:Eu(t)}),value:t}}function uv(t){return ti(t==null?void 0:t.field)&&(t==null?void 0:t.field)!==tv}function PC(t){return(t==null?void 0:t.selectedDataType)==="number"&&uv(t)}function RU(t){return(t==null?void 0:t.selectedDataType)==="temporal"&&uv(t)}function A4(t){const e=t!=null&&t.type?UW(t.type):"string";return{inferredDataType:e,selectedDataType:(t==null?void 0:t.selectedDataType)||e}}const jU=t=>{const e=ue.c(14),{columnFieldName:n,column:r,columns:o,binFieldName:i,defaultAggregation:a}=t;let s;e[0]!==r?(s=A4(r),e[0]=r,e[1]=s):s=e[1];const{selectedDataType:l}=s;let c,u,d;return e[2]!==n||e[3]!==o?(c=y.jsx(_C,{fieldName:n,columns:o}),e[2]=n,e[3]=o,e[4]=c):c=e[4],e[5]!==i||e[6]!==r||e[7]!==n||e[8]!==a||e[9]!==l?(u=function(f){return(f==null?void 0:f.selectedDataType)!=="temporal"&&uv(f)}(r)&&y.jsx(PU,{fieldName:n.replace(".field",".aggregate"),selectedDataType:l,binFieldName:i,defaultAggregation:a}),e[5]=i,e[6]=r,e[7]=n,e[8]=a,e[9]=l,e[10]=u):u=e[10],e[11]!==c||e[12]!==u?(d=y.jsxs("div",{className:"flex flex-row justify-between",children:[c,u]}),e[11]=c,e[12]=u,e[13]=d):d=e[13],d},ipt=()=>{const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[y.jsx(af,{className:"w-10 h-10 animate-spin",strokeWidth:1}),y.jsx("span",{children:"Loading chart..."})]}),t[0]=e):e=t[0],e},apt=t=>{const e=ue.c(2),{error:n}=t;let r;return e[0]!==n?(r=y.jsx("div",{className:"flex items-center justify-center",children:y.jsx(Hd,{error:n})}),e[0]=n,e[1]=r):r=e[1],r},spt=t=>{const e=ue.c(7),{value:n,onValueChange:r}=t;let o,i,a,s,l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=fs({variant:"outline",className:"user-select-none w-full justify-between px-3"}),i=y.jsx(Us,{}),e[0]=o,e[1]=i):(o=e[0],i=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsxs(J9,{className:o,children:[i,y.jsx(Wxe,{asChild:!0,children:y.jsx(xu,{className:"h-4 w-4 opacity-50"})})]}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[a,y.jsx(cs,{children:Tft.map(upt)})]}),e[3]=s):s=e[3],e[4]!==r||e[5]!==n?(l=y.jsx(Zs,{value:n,onValueChange:r,children:s}),e[4]=r,e[5]=n,e[6]=l):l=e[6],l},lpt=t=>{const e=ue.c(10),{chartType:n}=t,r=xft[n];let o,i,a,s;return e[0]!==r?(o=y.jsx(r,{className:"w-4 h-4 mr-2"}),e[0]=r,e[1]=o):o=e[1],e[2]!==n?(i=Eu(n),e[2]=n,e[3]=i):i=e[3],e[4]!==o||e[5]!==i?(a=y.jsxs("div",{className:"flex items-center",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],e[7]!==n||e[8]!==a?(s=y.jsx(Qo,{value:n,className:"gap-2",children:a}),e[7]=n,e[8]=a,e[9]=s):s=e[9],s},M4e=()=>{var v,b,p,O,k,S,w;const t=ue.c(22),e=mo();let n;t[0]!==e.control?(n={control:e.control},t[0]=e.control,t[1]=n):n=t[1];const r=cu(n),o=Md(),i=(v=r.general)==null?void 0:v.xColumn;let a;t[2]!==i?(a=A4(i),t[2]=i,t[3]=a):a=t[3];const{inferredDataType:s}=a,l=o.chartType===ei.LINE||o.chartType===ei.BAR||o.chartType===ei.AREA;let c,u,d,f,h,g;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(pc,{text:"X-Axis"}),t[4]=c):c=t[4],t[5]!==o.fields||t[6]!==i?(u=y.jsx(jU,{columnFieldName:"general.xColumn.field",column:i,columns:o.fields,binFieldName:"xAxis.bin.binned"}),t[5]=o.fields,t[6]=i,t[7]=u):u=t[7],t[8]!==s||t[9]!==i?(d=uv(i)&&y.jsx(TC,{label:"Data Type",fieldName:"general.xColumn.selectedDataType",defaultValue:s}),t[8]=s,t[9]=i,t[10]=d):d=t[10],t[11]!==i?(f=RU(i)&&y.jsx(j4,{fieldName:"general.xColumn.timeUnit",label:"Time Resolution"}),t[11]=i,t[12]=f):f=t[12],t[13]!==l||t[14]!==((p=(b=r.general)==null?void 0:b.xColumn)==null?void 0:p.sort)||t[15]!==i?(h=uv(i)&&l&&y.jsxs(y.Fragment,{children:[y.jsx(EU,{fieldName:"general.xColumn.sort",label:"Sort",defaultValue:(k=(O=r.general)==null?void 0:O.xColumn)==null?void 0:k.sort}),PC(i)&&y.jsx(D4,{fieldName:"xAxis"})]}),t[13]=l,t[14]=(w=(S=r.general)==null?void 0:S.xColumn)==null?void 0:w.sort,t[15]=i,t[16]=h):h=t[16],t[17]!==u||t[18]!==d||t[19]!==f||t[20]!==h?(g=y.jsxs(SC,{children:[c,u,d,f,h]}),t[17]=u,t[18]=d,t[19]=f,t[20]=h,t[21]=g):g=t[21],g},N4e=()=>{var P,j;const t=ue.c(29),e=mo();let n;t[0]!==e.control?(n={control:e.control},t[0]=e.control,t[1]=n):n=t[1];const r=cu(n),o=Md(),i=(P=r.general)==null?void 0:P.yColumn,a=i==null?void 0:i.field;let s;t[2]!==a?(s=ti(a),t[2]=a,t[3]=s):s=t[3];const l=s,c=(j=r.general)==null?void 0:j.xColumn,u=c==null?void 0:c.field;let d;t[4]!==u?(d=ti(u),t[4]=u,t[5]=d):d=t[5];const f=d;let h;t[6]!==i?(h=A4(i),t[6]=i,t[7]=h):h=t[7];const{inferredDataType:g}=h;let v,b,p,O,k,S,w,T;return PC(i)?v=Uje:function(D){return(D==null?void 0:D.selectedDataType)==="string"&&uv(D)}(i)&&(v="count"),t[8]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsx(pc,{text:"Y-Axis"}),t[8]=b):b=t[8],t[9]!==o.fields||t[10]!==v||t[11]!==i?(p=y.jsx(jU,{columnFieldName:"general.yColumn.field",column:i,columns:o.fields,binFieldName:"yAxis.bin.binned",defaultAggregation:v}),t[9]=o.fields,t[10]=v,t[11]=i,t[12]=p):p=t[12],t[13]!==g||t[14]!==i?(O=uv(i)&&y.jsx(TC,{label:"Data Type",fieldName:"general.yColumn.selectedDataType",defaultValue:g}),t[13]=g,t[14]=i,t[15]=O):O=t[15],t[16]!==i?(k=RU(i)&&y.jsx(j4,{fieldName:"general.yColumn.timeUnit",label:"Time Resolution"}),t[16]=i,t[17]=k):k=t[17],t[18]!==f||t[19]!==l?(S=l&&f&&y.jsx(cv,{fieldName:"general.horizontal",label:"Invert axis"}),t[18]=f,t[19]=l,t[20]=S):S=t[20],t[21]!==i?(w=PC(i)&&y.jsx(D4,{fieldName:"yAxis"}),t[21]=i,t[22]=w):w=t[22],t[23]!==S||t[24]!==w||t[25]!==p||t[26]!==O||t[27]!==k?(T=y.jsxs(SC,{children:[b,p,O,k,S,w]}),t[23]=S,t[24]=w,t[25]=p,t[26]=O,t[27]=k,t[28]=T):T=t[28],T},$4e=()=>{var f;const t=ue.c(13),{fields:e}=Md(),n=mo();let r;t[0]!==n.control?(r={control:n.control},t[0]=n.control,t[1]=r):r=t[1];const o=cu(r),i=(f=o.general)==null?void 0:f.colorByColumn;let a;t[2]!==i?(a=PC(i),t[2]=i,t[3]=a):a=t[3];const s=a;let l,c,u,d;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(pc,{text:"Color by"}),t[4]=l):l=t[4],t[5]!==i||t[6]!==e?(c=y.jsx(jU,{columnFieldName:"general.colorByColumn.field",column:i,columns:e,binFieldName:"color.bin.binned"}),t[5]=i,t[6]=e,t[7]=c):c=t[7],t[8]!==s?(u=s&&y.jsx(D4,{fieldName:"color"}),t[8]=s,t[9]=u):u=t[9],t[10]!==c||t[11]!==u?(d=y.jsxs(SC,{children:[l,c,u]}),t[10]=c,t[11]=u,t[12]=d):d=t[12],d},cpt=()=>{var l,c;const t=ue.c(7),e=Md().fields,n=mo();let r;t[0]!==n.control?(r={control:n.control},t[0]=n.control,t[1]=r):r=t[1];const o=cu(r);let i;t[2]!==e||t[3]!==((l=o.general)==null?void 0:l.facet)?(i=u=>{var v,b;const d=(b=(v=o.general)==null?void 0:v.facet)==null?void 0:b[u],f=ti(d==null?void 0:d.field),{inferredDataType:h}=A4(d),g=u==="row"?"general.facet.row.linkYAxis":"general.facet.column.linkXAxis";return y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("div",{className:"flex flex-row justify-between",children:[y.jsx("p",{className:"font-semibold",children:Eu(u)}),y.jsx(_C,{fieldName:`general.facet.${u}.field`,columns:e})]}),f&&y.jsxs(y.Fragment,{children:[y.jsx(TC,{label:"Data Type",fieldName:`general.facet.${u}.selectedDataType`,defaultValue:h}),RU(d)&&y.jsx(j4,{fieldName:`general.facet.${u}.timeUnit`,label:"Time Resolution"}),PC(d)&&y.jsxs("div",{className:"flex flex-row justify-between",children:[y.jsx(cv,{fieldName:`general.facet.${u}.binned`,label:"Binned",defaultValue:!0}),y.jsx(lv,{fieldName:`general.facet.${u}.maxbins`,label:"Max Bins",placeholder:"6",defaultValue:6})]}),y.jsx(EU,{fieldName:`general.facet.${u}.sort`,label:"Sort"}),y.jsx(cv,{fieldName:g,label:`Link ${u==="row"?"Y":"X"} Axes`,defaultValue:!0})]})]})},t[2]=e,t[3]=(c=o.general)==null?void 0:c.facet,t[4]=i):i=t[4];const a=i;let s;return t[5]!==a?(s=y.jsxs(SC,{className:"gap-3",children:[a("row"),a("column")]}),t[5]=a,t[6]=s):s=t[6],s};function upt(t){return y.jsx(lpt,{chartType:t},t)}const dpt=()=>{var k,S;const t=ue.c(17),e=mo();let n;t[0]!==e.control?(n={control:e.control},t[0]=e.control,t[1]=n):n=t[1];const r=cu(n),o=(k=r.general)==null?void 0:k.yColumn,i=(S=r.general)==null?void 0:S.colorByColumn,a=o==null?void 0:o.field;let s;t[2]!==a?(s=ti(a),t[2]=a,t[3]=s):s=t[3];const l=s,{chartType:c}=Md();let u;t[4]!==c||t[5]!==(i==null?void 0:i.field)?(u=ti(i==null?void 0:i.field)&&(c===ei.BAR||c===ei.LINE),t[4]=c,t[5]=i==null?void 0:i.field,t[6]=u):u=t[6];const d=u;let f,h,g,v,b,p,O;return t[7]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(qn,{delayDuration:100,content:"To persist a chart, add the generated Python code to a new cell.",children:y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(vO,{className:"h-3.5 w-3.5 mb-0.5 text-muted-foreground"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Charts are not saved."})]})}),h=y.jsx(M4e,{}),g=y.jsx(N4e,{}),t[7]=f,t[8]=h,t[9]=g):(f=t[7],h=t[8],g=t[9]),t[10]!==d||t[11]!==l?(v=l&&y.jsxs(y.Fragment,{children:[y.jsx($4e,{}),d&&y.jsx("div",{className:"flex flex-row gap-2",children:y.jsx(cv,{fieldName:"general.stacking",label:"Stacked"})})]}),t[10]=d,t[11]=l,t[12]=v):v=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsx(P4,{}),p=y.jsx(DU,{}),t[13]=b,t[14]=p):(b=t[13],p=t[14]),t[15]!==v?(O=y.jsxs(y.Fragment,{children:[f,h,g,v,b,p]}),t[15]=v,t[16]=O):O=t[16],O},fpt=()=>{const t=ue.c(15),{chartType:e}=Md();let n,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx(iv,{className:"pt-0",children:y.jsx(pc,{text:"General"})}),t[0]=n):n=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(r=y.jsx(R4,{label:"Plot title",fieldName:"general.title"}),t[1]=r):r=t[1];const o=e===ei.SCATTER;let i,a,s,l,c,u,d,f,h,g,v;return t[2]!==o?(i=y.jsxs(av,{value:"general",children:[n,y.jsxs(sv,{children:[r,y.jsx(cv,{fieldName:"style.gridLines",label:"Show grid lines",defaultValue:o})]})]}),t[2]=o,t[3]=i):i=t[3],t[4]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(iv,{children:y.jsx(pc,{text:"X-Axis"})}),t[4]=a):a=t[4],t[5]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs(av,{value:"xAxis",children:[a,y.jsxs(sv,{children:[y.jsx(R4,{label:"Label",fieldName:"xAxis.label"}),y.jsx(TU,{fieldName:"xAxis.width",label:"Width",value:400,start:200,stop:800})]})]}),t[5]=s):s=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(iv,{children:y.jsx(pc,{text:"Y-Axis"})}),t[6]=l):l=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsxs(av,{value:"yAxis",children:[l,y.jsxs(sv,{children:[y.jsx(R4,{label:"Label",fieldName:"yAxis.label"}),y.jsx(TU,{fieldName:"yAxis.height",label:"Height",value:300,start:150,stop:600})]})]}),t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(iv,{children:y.jsx(pc,{text:"Color"})}),t[8]=u):u=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsx(E4,{fieldName:"color.field",label:"Field",options:Jje.map(hpt),defaultValue:Ad}),t[9]=d):d=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(E4,{fieldName:"color.scheme",label:"Color scheme",defaultValue:d4,options:kft.map(ppt)}),h=y.jsx(D4e,{fieldName:"color.range",label:"Color range"}),t[10]=f,t[11]=h):(f=t[10],h=t[11]),t[12]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsxs(av,{value:"color",children:[u,y.jsxs(sv,{children:[d,f,h,y.jsxs("p",{className:"text-xs",children:[y.jsx(sk,{className:"w-2.5 h-2.5 inline mb-1 mr-1"}),"If you are using color range, color scheme will be ignored."]})]})]}),t[12]=g):g=t[12],t[13]!==i?(v=y.jsxs(Sy,{type:"multiple",children:[i,s,c,g]}),t[13]=i,t[14]=v):v=t[14],v},DU=()=>{var f;const t=ue.c(11),{saveForm:e}=Md(),n=mo();let r;t[0]!==n.control?(r={control:n.control},t[0]=n.control,t[1]=r):r=t[1];const o=cu(r),i=(f=o.tooltips)==null?void 0:f.auto;let a,s,l,c,u,d;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(iv,{className:"pt-0",children:y.jsx(pc,{text:"Faceting",tooltip:"Repeat the chart for each unique field value"})}),t[2]=a):a=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs(av,{value:"facet",children:[a,y.jsx(sv,{children:y.jsx(cpt,{})})]}),t[3]=s):s=t[3],t[4]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(iv,{children:y.jsx(pc,{text:"Tooltips"})}),t[4]=l):l=t[4],t[5]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(cv,{fieldName:"tooltips.auto",label:"Include X, Y and Color"}),t[5]=c):c=t[5],t[6]!==i||t[7]!==e?(u=!i&&y.jsx(A4e,{fieldName:"tooltips.fields",saveFunction:e}),t[6]=i,t[7]=e,t[8]=u):u=t[8],t[9]!==u?(d=y.jsxs(Sy,{type:"multiple",children:[s,y.jsxs(av,{value:"tooltips",children:[l,y.jsxs(sv,{wrapperClassName:"flex-row justify-between",children:[c,u]})]})]}),t[9]=u,t[10]=d):d=t[10],d};function hpt(t){return{display:Eu(t),value:t}}function ppt(t){return{display:Eu(t),value:t}}const mpt=()=>{var p,O,k,S;const t=ue.c(17),e=mo();let n;t[0]!==e.control?(n={control:e.control},t[0]=e.control,t[1]=n):n=t[1];const r=cu(n),o=(O=(p=r.general)==null?void 0:p.xColumn)==null?void 0:O.field;let i;t[2]!==o?(i=ti(o),t[2]=o,t[3]=i):i=t[3];const a=i,s=(S=(k=r.general)==null?void 0:k.yColumn)==null?void 0:S.field;let l;t[4]!==s?(l=ti(s),t[4]=s,t[5]=l):l=t[5];const c=l;let u,d,f,h,g,v,b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(M4e,{}),t[6]=u):u=t[6],t[7]!==a?(d=a&&y.jsx(lv,{fieldName:"xAxis.bin.maxbins",label:"Number of boxes (max)",className:"justify-between"}),t[7]=a,t[8]=d):d=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(N4e,{}),t[9]=f):f=t[9],t[10]!==c?(h=c&&y.jsxs(y.Fragment,{children:[y.jsx(lv,{fieldName:"yAxis.bin.maxbins",label:"Number of boxes (max)",className:"justify-between"}),y.jsx($4e,{})]}),t[10]=c,t[11]=h):h=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(v=y.jsx(P4,{}),g=y.jsx(DU,{}),t[12]=g,t[13]=v):(g=t[12],v=t[13]),t[14]!==d||t[15]!==h?(b=y.jsxs(y.Fragment,{children:[u,d,f,h,v,g]}),t[14]=d,t[15]=h,t[16]=b):b=t[16],b},gpt=()=>{var S,w,T;const t=ue.c(25),e=mo(),{fields:n}=Md();let r;t[0]!==e.control?(r={control:e.control},t[0]=e.control,t[1]=r):r=t[1];const o=cu(r),i=(S=o.general)==null?void 0:S.colorByColumn;let a,s=(T=(w=o.general)==null?void 0:w.yColumn)==null?void 0:T.selectedDataType;s!==Da&&s||(s="string"),t[2]!==i?(a=i!=null&&i.type?UW(i.type):"string",t[2]=i,t[3]=a):a=t[3];const l=a;let c,u,d,f,h,g,v,b,p,O,k;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(pc,{text:"Color by"}),t[4]=c):c=t[4],t[5]!==n?(u=y.jsx(_C,{fieldName:"general.colorByColumn.field",columns:n,includeCountField:!1}),t[5]=n,t[6]=u):u=t[6],t[7]!==(i==null?void 0:i.field)||t[8]!==l?(d=ti(i==null?void 0:i.field)&&y.jsx(TC,{fieldName:"general.colorByColumn.selectedDataType",label:"Data Type",defaultValue:l}),t[7]=i==null?void 0:i.field,t[8]=l,t[9]=d):d=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(pc,{text:"Size by"}),t[10]=f):f=t[10],t[11]!==n?(h=y.jsx(_C,{fieldName:"general.yColumn.field",columns:n}),t[11]=n,t[12]=h):h=t[12],t[13]!==s?(g=y.jsx(PU,{fieldName:"general.yColumn.aggregate",selectedDataType:s,binFieldName:"yAxis.bin.binned"}),t[13]=s,t[14]=g):g=t[14],t[15]!==h||t[16]!==g?(v=y.jsxs("div",{className:"flex flex-row justify-between",children:[h,g]}),t[15]=h,t[16]=g,t[17]=v):v=t[17],t[18]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(lv,{fieldName:"style.innerRadius",label:"Donut size",className:"w-32"}),b=y.jsx(P4,{}),p=y.jsx(DU,{}),t[18]=b,t[19]=p,t[20]=O):(b=t[18],p=t[19],O=t[20]),t[21]!==u||t[22]!==d||t[23]!==v?(k=y.jsxs(y.Fragment,{children:[c,u,d,f,v,O,b,p]}),t[21]=u,t[22]=d,t[23]=v,t[24]=k):k=t[24],k},vpt=ge.lazy(()=>Be(()=>import("./index-BrcZZepi.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107,108,109,110,111,112,113]),import.meta.url).then(t=>({default:t.Vega}))),ypt=t=>{const e=ue.c(8),{baseSpec:n,data:r,height:o}=t,{theme:i}=as();if(!r){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx("div",{children:"No data"}),e[0]=c):c=e[0],c}let a;e[1]!==r||e[2]!==o||e[3]!==i?(a=c=>{if(typeof c=="string")return y.jsx(I4e,{children:c});const u=function(d,f){return{...d,data:{values:f}}}(c,r);return y.jsx(ge.Suspense,{fallback:y.jsx(bpt,{}),children:y.jsx(vpt,{spec:u,theme:i==="dark"?"dark":void 0,height:o,actions:{export:!0,source:!1,compiled:!1,editor:!0}})})},e[1]=r,e[2]=o,e[3]=i,e[4]=a):a=e[4];const s=a;let l;return e[5]!==n||e[6]!==s?(l=y.jsx("div",{className:"h-full m-auto rounded-md w-full",children:s(n)}),e[5]=n,e[6]=s,e[7]=l):l=e[7],l},bpt=()=>{const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx(I4e,{children:"Loading chart..."}),t[0]=e):e=t[0],e},I4e=t=>{const e=ue.c(3),{children:n}=t;let r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=y.jsx(S6,{className:"w-10 h-10 text-muted-foreground"}),e[0]=r):r=e[0],e[1]!==n?(o=y.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 mt-14",children:[r,y.jsx("span",{className:"text-md font-semibold text-muted-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o},AU=Qe({binned:pt().optional(),step:yt().optional(),maxbins:yt().optional()}),MU=Qe({field:Pe().optional(),type:un([...r4,Da]).optional(),selectedDataType:un([...Zje,Da]).optional(),sort:un(Yje).default("ascending").optional(),timeUnit:un(_ft).optional()}),NU=MU.extend({aggregate:un(Gje).default(Ad).optional()}),xpt=MU.extend({linkYAxis:pt().default(!0),binned:pt().default(!0),maxbins:yt().default(6)}),Opt=MU.extend({linkXAxis:pt().default(!0),binned:pt().default(!0),maxbins:yt().default(6)}),Q4e=Qe({general:Qe({title:Pe().optional(),xColumn:NU.optional(),yColumn:NU.optional(),colorByColumn:NU.optional(),facet:Qe({row:xpt,column:Opt}).optional(),horizontal:pt().optional(),stacking:pt().optional()}).optional(),xAxis:Qe({label:Pe().optional(),width:yt().optional(),bin:AU.optional()}).optional(),yAxis:Qe({label:Pe().optional(),height:yt().optional(),bin:AU.optional()}).optional(),color:Qe({field:un([...Jje,Ad]).default(Ad),scheme:Pe().default(d4).optional(),range:Wt(Pe()).optional(),domain:Wt(Pe()).optional(),bin:AU.optional()}).optional(),style:Qe({innerRadius:yt().optional(),gridLines:pt().optional()}).optional(),tooltips:Qe({auto:pt(),fields:Wt(Qe({field:Pe(),type:un(r4)}))}).default({auto:!0,fields:[]}).optional()});function L4e(){return{general:{facet:{row:{linkYAxis:!0,binned:!0,maxbins:6},column:{linkXAxis:!0,binned:!0,maxbins:6}}},color:{field:Ad,scheme:"default"},tooltips:{auto:!0,fields:[]}}}const $U="marimo:charts:v2",wpt=Qe({tabName:Pe().transform(t=>t),chartType:Pe().transform(t=>t),config:Q4e}),kpt=Wt(sf([Pe().transform(t=>t),Wt(wpt)])),IU=new ose($U,kpt,()=>[]),z4e={getItem:t=>{try{const e=IU.get(t);return new Map(e)}catch(e){return Ve.warn("Error getting chart storage",e),new Map}},setItem:(t,e)=>{IU.set(t,[...e.entries()])},removeItem:t=>{IU.remove(t)}},Spt=Q_($U,new Map,z4e);function V4e(t,e){const n=Eu(e);return t===0?`${n} Chart`:`${n} Chart ${t+1}`}const Cpt=z4e.getItem($U),EC="table",_pt=t=>{const e=ue.c(33),{cellId:n,dataTable:r,getDataUrl:o,fieldTypes:i,displayHeader:a}=t,[s,l]=ss(Spt),c=n?s.get(n)??[]:[],[u,d]=_.useState(0),[f,h]=_.useState(EC);if(!a||c.length===0&&!a)return r;const g=()=>{if(!n)return;const E=V4e(u,"bar"),A=new Map(s);A.set(n,[...c,{tabName:E,chartType:"bar",config:L4e()}]),l(A),d(u+1),h(E)},v=E=>{const{tabName:A,chartType:I,chartConfig:L}=E;if(!n)return;const F=new Map(s);F.set(n,c.map(Q=>Q.tabName===A?{...Q,chartType:I,config:L}:Q)),l(F)};let b;e[0]!==n||e[1]!==l||e[2]!==s?(b=(E,A)=>{if(!n)return;const I=s.get(n)??[],L=I.findIndex(W=>W.tabName===E);if(L===-1)return;const F=I.map(W=>W.tabName===E?{...W,chartType:A,tabName:V4e(L,A)}:W),Q=new Map(s).set(n,F);l(Q),h(F[L].tabName)},e[0]=n,e[1]=l,e[2]=s,e[3]=b):b=e[3];const p=b,O=sg,k=Kh;let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=y.jsx(Hs,{className:"text-xs",value:EC,onClick:()=>h(EC),children:"Table"}),e[4]=S):S=e[4];const w=c.map((E,A)=>y.jsxs(Hs,{className:"text-xs",value:E.tabName,onClick:()=>h(E.tabName),children:[E.tabName,y.jsx(Qa,{className:"w-3 h-3 ml-1 mt-[0.5px] hover:text-red-500 hover:font-semibold",onClick:I=>{I.stopPropagation(),(L=>{if(!n)return;const F=new Map(s);F.set(n,c.filter(Q=>Q.tabName!==L)),l(F),h(EC),d(u-1)})(E.tabName)}})]},A));let T,P,j,D,N;if(e[5]!==g?(T=y.jsx(Ft,{variant:"text",size:"icon",onClick:g,title:"Add chart",children:"+"}),e[5]=g,e[6]=T):T=e[6],e[7]!==k||e[8]!==S||e[9]!==w||e[10]!==T?(P=y.jsxs(k,{children:[S,w,T]}),e[7]=k,e[8]=S,e[9]=w,e[10]=T,e[11]=P):P=e[11],e[12]!==r?(j=y.jsx(ec,{className:"mt-1 overflow-hidden",value:EC,children:r}),e[12]=r,e[13]=j):j=e[13],e[14]!==r||e[15]!==i||e[16]!==o||e[17]!==v||e[18]!==p||e[19]!==c){let E;e[21]!==r||e[22]!==i||e[23]!==o||e[24]!==v||e[25]!==p?(E=(A,I)=>y.jsx(ec,{value:A.tabName,className:"h-[400px] mt-1",children:y.jsx(Tpt,{chartConfig:A.config,chartType:A.chartType,saveChart:L=>{v({tabName:A.tabName,chartType:A.chartType,chartConfig:L})},saveChartType:L=>{p(A.tabName,L)},getDataUrl:o,fieldTypes:i??Aj(r.props.data)})},I),e[21]=r,e[22]=i,e[23]=o,e[24]=v,e[25]=p,e[26]=E):E=e[26],D=c.map(E),e[14]=r,e[15]=i,e[16]=o,e[17]=v,e[18]=p,e[19]=c,e[20]=D}else D=e[20];return e[27]!==O||e[28]!==f||e[29]!==P||e[30]!==j||e[31]!==D?(N=y.jsxs(O,{value:f,className:"-mt-1",children:[P,j,D]}),e[27]=O,e[28]=f,e[29]=P,e[30]=j,e[31]=D,e[32]=N):N=e[32],N},q4e="X and Y columns are not set",Tpt=({chartConfig:t,chartType:e,saveChart:n,saveChartType:r,getDataUrl:o,fieldTypes:i})=>{const{theme:a}=as(),s=kM({defaultValues:t??L4e(),resolver:wM(Q4e)}),[l,c]=_.useState(e),[u,d]=_.useState(!1),{ref:f}=EH(),{data:h,isPending:g,error:v}=$a(async()=>{if(!o)return[];const w=await o({});return Array.isArray(w.data_url)?w.data_url:await M_(w.data_url,w.format==="arrow"?{type:"arrow"}:w.format==="json"?{type:"json"}:{type:"csv",parse:"auto"},{replacePeriod:!0})},[]),b=s.watch(),p=Rft(l,_.useMemo(()=>structuredClone(b),[b]),a,"container",290),O=_.useMemo(()=>g?y.jsx(ipt,{}):v?y.jsx(apt,{error:v}):y.jsx(ypt,{baseSpec:p,data:h,height:290}),[g,v,p,h]),k=!1,S=y.jsxs(y.Fragment,{children:[y.jsx(spt,{value:l,onValueChange:w=>{c(w),r(w)}}),y.jsx(Ppt,{form:s,saveChart:n,fieldTypes:i,chartType:l})]});return y.jsxs("div",{className:"flex flex-row gap-2 h-full rounded-md border pr-2",children:[y.jsxs("div",{className:"relative flex flex-col gap-2 overflow-auto px-2 py-3 scrollbar-thin transition-width duration-200 "+(u?"w-8":"w-[300px]"),children:[!u&&S,y.jsx(Ft,{variant:"outline",size:"icon",className:"border-border ml-auto",onClick:()=>d(w=>!w),title:u?"Expand sidebar":"Collapse sidebar",children:u?y.jsx(Qh,{className:"w-4 h-5"}):y.jsx(ty,{className:"w-4 h-5"})})]}),y.jsx("div",{className:"flex-1 overflow-auto h-full w-full mt-3",children:(()=>{let w=q4e;return typeof p!="string"&&(w=bft(p,"_df","_chart")),y.jsxs(sg,{defaultValue:"chart",children:[y.jsx("div",{className:"flex flex-row gap-1.5 items-center",children:y.jsxs(Kh,{children:[y.jsxs(Hs,{value:"chart",className:"h-6",children:[y.jsx(VE,{className:"text-muted-foreground mr-2 w-4 h-4"}),"Chart"]}),y.jsxs(Hs,{value:"code",className:"h-6",children:[y.jsx(xK,{className:"text-muted-foreground mr-2"}),"Python code"]}),k]})}),y.jsx(ec,{value:"chart",ref:f,children:O}),y.jsx(ec,{value:"code",children:y.jsx(j4e,{code:w,insertNewCell:w!==q4e,language:"python"})}),k]})})()})]})},Ppt=t=>{const e=ue.c(28),{form:n,saveChart:r,fieldTypes:o,chartType:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];let s,l=a;if(o){let T;e[1]!==o?(T=o.map(Ept),e[1]=o,e[2]=T):T=e[2],l=T}e[3]!==n||e[4]!==r?(s=()=>{const T=n.getValues();r(T)},e[3]=n,e[4]=r,e[5]=s):s=e[5];const c=zJ(s,300);let u,d,f,h,g,v,b,p,O,k,S,w=dpt;return i===ei.PIE?w=gpt:i===ei.HEATMAP&&(w=mpt),e[6]!==i||e[7]!==c||e[8]!==l?(u={fields:l,saveForm:c,chartType:i},e[6]=i,e[7]=c,e[8]=l,e[9]=u):u=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsxs(Hs,{value:"data",className:"w-1/2 h-6",children:[y.jsx(Wx,{className:"w-4 h-4 mr-2"}),"Data"]}),e[10]=d):d=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsxs(Kh,{className:"w-full",children:[d,y.jsxs(Hs,{value:"style",className:"w-1/2 h-6",children:[y.jsx(LN,{className:"w-4 h-4 mr-2"}),"Style"]})]}),e[11]=f):f=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsx("hr",{className:"my-2"}),e[12]=h):h=e[12],e[13]!==w?(g=y.jsxs(ec,{value:"data",children:[h,y.jsx(CU,{children:y.jsx(w,{})})]}),e[13]=w,e[14]=g):g=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(v=y.jsx("hr",{className:"my-2"}),e[15]=v):v=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsxs(ec,{value:"style",children:[v,y.jsx(CU,{children:y.jsx(fpt,{})})]}),e[16]=b):b=e[16],e[17]!==g?(p=y.jsxs(sg,{defaultValue:"data",children:[f,g,b]}),e[17]=g,e[18]=p):p=e[18],e[19]!==c||e[20]!==p?(O=y.jsx("form",{onSubmit:Rpt,onChange:c,children:p}),e[19]=c,e[20]=p,e[21]=O):O=e[21],e[22]!==n||e[23]!==O?(k=y.jsx(hG,{...n,children:O}),e[22]=n,e[23]=O,e[24]=k):k=e[24],e[25]!==k||e[26]!==u?(S=y.jsx(a5e,{value:u,children:k}),e[25]=k,e[26]=u,e[27]=S):S=e[27],S};function Ept(t){return{name:t[0],type:t[1][0]}}function Rpt(t){return t.preventDefault()}let QU,LU;N8e=t=>{const e=ue.c(4),{isExpanded:n}=t,r=n&&"rotate-90";let o,i;return e[0]!==r?(o=we("h-3 w-3 transition-transform",r),e[0]=r,e[1]=o):o=e[1],e[2]!==o?(i=y.jsx(Qh,{className:o}),e[2]=o,e[3]=i):i=e[3],i},k8e=t=>{const e=ue.c(2),{children:n}=t;let r;return e[0]!==n?(r=y.jsx("div",{className:"flex gap-1.5 items-center font-bold px-2 py-1.5 text-muted-foreground bg-[var(--slate-2)] text-sm",children:n}),e[0]=n,e[1]=r):r=e[1],r},aee=t=>{const e=ue.c(5),{content:n,className:r}=t;let o,i;return e[0]!==r?(o=we("text-sm text-muted-foreground py-1",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},iee=t=>{const e=ue.c(6),{error:n,className:r}=t;let o,i,a;return e[0]!==r?(o=we("text-sm bg-red-50 dark:bg-red-900 text-red-600 dark:text-red-50 flex items-center gap-2 p-2 h-8",r),e[0]=r,e[1]=o):o=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(Qa,{className:"h-4 w-4 mt-0.5"}),e[2]=i):i=e[2],e[3]!==n.message||e[4]!==o?(a=y.jsxs("div",{className:o,children:[i,n.message]}),e[3]=n.message,e[4]=o,e[5]=a):a=e[5],a},ZJ=t=>{const e=ue.c(6),{message:n,className:r}=t;let o,i,a;return e[0]!==r?(o=we("text-sm bg-blue-50 dark:bg-[var(--accent)] text-blue-500 dark:text-blue-50 flex items-center gap-2 p-2 h-8",r),e[0]=r,e[1]=o):o=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(af,{className:"h-4 w-4 animate-spin"}),e[2]=i):i=e[2],e[3]!==n||e[4]!==o?(a=y.jsxs("div",{className:o,children:[i,n]}),e[3]=n,e[4]=o,e[5]=a):a=e[5],a},QU=t=>{const e=ue.c(5),{children:n,className:r}=t;let o,i;return e[0]!==r?(o=we("flex flex-col gap-2 relative",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},QN=t=>{const e=ue.c(6),{columnName:n,dataType:r}=t,o=hj[r],i=function(c){switch(c){case"boolean":return"bg-[var(--orange-4)]";case"date":case"time":case"datetime":case"temporal":return"bg-[var(--grass-4)] dark:bg-[var(--grass-5)]";case"number":case"integer":return"bg-[var(--purple-4)]";case"string":return"bg-[var(--blue-4)]";case"unknown":return"bg-[var(--slate-4)] dark:bg-[var(--slate-6)]";default:return us(c),"bg-[var(--slate-4)] dark:bg-[var(--slate-6)]"}}(r),a=`w-4 h-4 p-0.5 rounded-sm stroke-card-foreground ${i}`;let s,l;return e[0]!==o||e[1]!==a?(s=y.jsx(o,{className:a}),e[0]=o,e[1]=a,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(l=y.jsxs("div",{className:"flex flex-row items-center gap-1.5",children:[s,n]}),e[3]=n,e[4]=s,e[5]=l):l=e[5],l},LU=(t,e)=>{Kr(e?{title:"Failed to add package",description:e,variant:"danger"}:{title:"Package added",description:y.jsxs("div",{children:[y.jsxs("div",{children:["The package ",y.jsx(lg,{className:"inline",children:t})," and its dependencies has been added to your environment."]}),y.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},E8e=(t,e)=>{Kr(e?{title:"Failed to upgrade package",description:e,variant:"danger"}:{title:"Package upgraded",description:y.jsxs("div",{children:[y.jsxs("div",{children:["The package ",y.jsx(lg,{className:"inline",children:t})," has been upgraded."]}),y.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},j8e=(t,e)=>{Kr(e?{title:"Failed to remove package",description:e,variant:"danger"}:{title:"Package removed",description:y.jsxs("div",{children:[y.jsxs("div",{children:["The package ",y.jsx(lg,{className:"inline",children:t})," has been removed from your environment."]}),y.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},YJ=function(){const[t,e]=_.useState(!1);return{loading:t,handleInstallPackages:async(n,r)=>{e(!0);try{for(const[o,i]of n.entries()){const a=await OG({package:i});a.success?LU(i):LU(i,a.error),o<n.length-1&&await new Promise(s=>setTimeout(s,1e3))}r==null||r()}catch(o){Ve.error(o)}finally{e(!1)}}}};let F4e,B4e;F4e=t=>{const e=ue.c(13),{packages:n,showMaxPackages:r,className:o,onInstall:i}=t,{handleInstallPackages:a}=YJ();if(!n||n.length===0)return null;let s,l,c,u;return e[0]!==a||e[1]!==i||e[2]!==n?(s=()=>{a(n,i)},e[0]=a,e[1]=i,e[2]=n,e[3]=s):s=e[3],e[4]!==o?(l=we("ml-2",o),e[4]=o,e[5]=l):l=e[5],e[6]!==n||e[7]!==r?(c=r?n.slice(0,r).join(", "):n.join(", "),e[6]=n,e[7]=r,e[8]=c):c=e[8],e[9]!==s||e[10]!==l||e[11]!==c?(u=y.jsxs(Ft,{variant:"outline",size:"xs",onClick:s,className:l,children:["Install"," ",c]}),e[9]=s,e[10]=l,e[11]=c,e[12]=u):u=e[12],u},B4e=ge.lazy(()=>Be(()=>import("./index-BrcZZepi.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107,108,109,110,111,112,113]),import.meta.url).then(t=>({default:t.VegaLite}))),Q8e=t=>{const e=ue.c(51),{table:n,column:r,preview:o,onAddColumnChart:i,sqlTableContext:a}=t,{theme:s}=as();let l;e[0]!==r.name||e[1]!==a||e[2]!==n.name||e[3]!==n.source||e[4]!==n.source_type?(l=()=>{uV({source:n.source,tableName:n.name,columnName:r.name,sourceType:n.source_type,fullyQualifiedTableName:a?`${a.database}.${a.schema}.${n.name}`:n.name})},e[0]=r.name,e[1]=a,e[2]=n.name,e[3]=n.source,e[4]=n.source_type,e[5]=l):l=e[5];const c=l;let u,d;if(e[6]!==o||e[7]!==c||e[8]!==n.source_type?(u=()=>{o||n.source_type!=="connection"&&n.source_type!=="catalog"&&c()},e[6]=o,e[7]=c,e[8]=n.source_type,e[9]=u):u=e[9],iM(u),n.source_type==="connection"){const T=r.name,P=r.external_type;let j,D,N,E;return e[10]!==r.name||e[11]!==i||e[12]!==a||e[13]!==n?(j=ai.stopPropagation(()=>{i(IN({table:n,columnName:r.name,sqlTableContext:a}))}),e[10]=r.name,e[11]=i,e[12]=a,e[13]=n,e[14]=j):j=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(D=y.jsx(LT,{className:"h-3 w-3 mr-1"}),e[15]=D):D=e[15],e[16]!==j?(N=y.jsxs(Ft,{variant:"outline",size:"xs",onClick:j,children:[D," Add SQL cell"]}),e[16]=j,e[17]=N):N=e[17],e[18]!==r.external_type||e[19]!==r.name||e[20]!==N?(E=y.jsxs("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[T," (",P,")",N]}),e[18]=r.external_type,e[19]=r.name,e[20]=N,e[21]=E):E=e[21],E}if(n.source_type==="catalog"){let T;return e[22]!==r.external_type||e[23]!==r.name?(T=y.jsxs("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[r.name," (",r.external_type,")"]}),e[22]=r.external_type,e[23]=r.name,e[24]=T):T=e[24],T}if(!o){let T;return e[25]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading..."}),e[25]=T):T=e[25],T}e[26]!==o.error||e[27]!==o.missing_packages||e[28]!==c?(d=o.error&&W4e({error:o.error,missingPackages:o.missing_packages,refetchPreview:c}),e[26]=o.error,e[27]=o.missing_packages,e[28]=c,e[29]=d):d=e[29];const f=d;let h;e[30]!==r.type||e[31]!==o.stats?(h=o.stats&&U4e(o.stats,r.type),e[30]=r.type,e[31]=o.stats,e[32]=h):h=e[32];const g=h;let v;e[33]!==o.chart_spec||e[34]!==s?(v=o.chart_spec&&Z4e(o.chart_spec,s),e[33]=o.chart_spec,e[34]=s,e[35]=v):v=e[35];const b=v;let p;e[36]!==o.chart_code||e[37]!==n.source_type?(p=o.chart_code&&n.source_type==="local"&&y.jsx(X4e,{chartCode:o.chart_code}),e[36]=o.chart_code,e[37]=n.source_type,e[38]=p):p=e[38];const O=p;let k;e[39]!==r.name||e[40]!==i||e[41]!==a||e[42]!==n?(k=n.source_type==="duckdb"&&y.jsx(qn,{content:"Add SQL cell",delayDuration:400,children:y.jsx(Ft,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-1",onClick:ai.stopPropagation(()=>{i(IN({table:n,columnName:r.name,sqlTableContext:a}))}),children:y.jsx(LT,{className:"h-3 w-3"})})}),e[39]=r.name,e[40]=i,e[41]=a,e[42]=n,e[43]=k):k=e[43];const S=k;if(!f&&!g&&!b){let T;return e[44]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx("span",{className:"text-xs text-muted-foreground",children:"No data"}),e[44]=T):T=e[44],T}let w;return e[45]!==O||e[46]!==S||e[47]!==b||e[48]!==f||e[49]!==g?(w=y.jsxs(QU,{children:[f,O,S,b,g]}),e[45]=O,e[46]=S,e[47]=b,e[48]=f,e[49]=g,e[50]=w):w=e[50],w};function W4e({error:t,missingPackages:e,refetchPreview:n}){return y.jsxs("div",{className:"text-xs text-muted-foreground p-2 border border-border rounded flex items-center justify-between",children:[y.jsx("span",{children:t}),e&&y.jsx(F4e,{packages:e,showMaxPackages:1,className:"w-32",onInstall:n})]})}function U4e(t,e){return y.jsx("div",{className:"gap-x-16 gap-y-1 grid grid-cols-2-fit border rounded p-2 empty:hidden",children:Object.entries(t).map(([n,r])=>r==null?null:y.jsxs("div",{className:"flex items-center gap-1 group",children:[y.jsx("span",{className:"text-xs min-w-[60px] capitalize",children:Alt(n,e)}),y.jsx("span",{className:"text-xs font-bold text-muted-foreground tracking-wide",children:th(r)}),y.jsx($v,{className:"h-3 w-3 invisible group-hover:visible",value:String(r)})]},n))})}const jpt=y.jsx("div",{className:"flex justify-center",children:y.jsx(Ym,{className:"size-4"})});function Z4e(t,e){return y.jsx(_.Suspense,{fallback:jpt,children:y.jsx(B4e,{spec:(n=JSON.parse(t),{...n,background:"transparent",config:{...n.config,background:"transparent"}}),width:"container",height:100,actions:!1,theme:e==="dark"?"dark":"vox"})});var n}const X4e=t=>{const e=ue.c(10),{chartCode:n}=t,r=Gr(FM),o=PT(),{createNewCell:i}=Iv();let a;e[0]!==r||e[1]!==i||e[2]!==o?(a=d=>{d.includes("alt")&&S4e({autoInstantiate:r,createNewCell:i,fromCellId:o}),i({code:d,before:!1,cellId:o??"__end__"})},e[0]=r,e[1]=i,e[2]=o,e[3]=a):a=e[3];const s=a;let l,c,u;return e[4]!==n||e[5]!==s?(l=ai.stopPropagation(()=>s(n)),e[4]=n,e[5]=s,e[6]=l):l=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(LT,{className:"h-3 w-3"}),e[7]=c):c=e[7],e[8]!==l?(u=y.jsx(qn,{content:"Add chart to notebook",delayDuration:400,children:y.jsx(Ft,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-0.5",onClick:l,children:c})}),e[8]=l,e[9]=u):u=e[9],u},Dpt=t=>{const e=ue.c(43),{previewColumn:n,fieldTypes:r,totalRows:o,totalColumns:i,tableId:a}=t,[s,l]=_.useState("");let c,u,d,f,h,g,v,b,p,O,k,S,w;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a||e[4]!==i||e[5]!==o){const T=r==null?void 0:r.filter(Npt),P=T==null?void 0:T.filter(A=>{const[I]=A;return I.toLowerCase().includes(s.toLowerCase())});let j;p="mt-5 mb-3",e[16]!==i||e[17]!==o?(j=rV(o,i),e[16]=i,e[17]=o,e[18]=j):j=e[18];const D=(T==null?void 0:T.map($pt).join(`,
|
475
|
-
`))||"";let N,E;e[19]!==D?(N=y.jsx($v,{tooltip:"Copy column names",value:D,className:"h-3 w-3 ml-1 mt-0.5"}),e[19]=D,e[20]=N):N=e[20],e[21]!==j||e[22]!==N?(O=y.jsxs("span",{className:"text-xs font-semibold ml-2 flex",children:[j,N]}),e[21]=j,e[22]=N,e[23]=O):O=e[23],u=by,g="h-5/6 bg-background",v=!1,e[24]===Symbol.for("react.memo_cache_sentinel")?(E=A=>l(A),e[24]=E):E=e[24],e[25]!==s?(b=y.jsx(EO,{placeholder:"Search columns...",value:s,onValueChange:E}),e[25]=s,e[26]=b):b=e[26],c=PO,d="max-h-full",e[27]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(RO,{children:"No results."}),e[27]=f):f=e[27],h=P==null?void 0:P.map(A=>{const[I,L]=A,[F,Q]=L;return y.jsx(Apt,{columnName:I,dataType:F,externalType:Q,previewColumn:n},`${a}-${I}`)}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=i,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=f,e[10]=h,e[11]=g,e[12]=v,e[13]=b,e[14]=p,e[15]=O}else c=e[6],u=e[7],d=e[8],f=e[9],h=e[10],g=e[11],v=e[12],b=e[13],p=e[14],O=e[15];return e[28]!==c||e[29]!==d||e[30]!==f||e[31]!==h?(k=y.jsxs(c,{className:d,children:[f,h]}),e[28]=c,e[29]=d,e[30]=f,e[31]=h,e[32]=k):k=e[32],e[33]!==u||e[34]!==g||e[35]!==v||e[36]!==b||e[37]!==k?(S=y.jsxs(u,{className:g,shouldFilter:v,children:[b,k]}),e[33]=u,e[34]=g,e[35]=v,e[36]=b,e[37]=k,e[38]=S):S=e[38],e[39]!==S||e[40]!==p||e[41]!==O?(w=y.jsxs("div",{className:p,children:[O,S]}),e[39]=S,e[40]=p,e[41]=O,e[42]=w):w=e[42],w},Apt=t=>{const e=ue.c(28),{columnName:n,dataType:r,externalType:o,previewColumn:i}=t,[a,s]=_.useState(!1),l=a?"font-semibold":"";let c;e[0]!==n||e[1]!==l?(c=y.jsx("span",{className:l,children:n}),e[0]=n,e[1]=l,e[2]=c):c=e[2];const u=c;let d,f,h,g,v,b,p,O;return e[3]!==a?(d=()=>s(!a),e[3]=a,e[4]=d):d=e[4],e[5]!==u||e[6]!==r?(f=y.jsx(QN,{columnName:u,dataType:r}),e[5]=u,e[6]=r,e[7]=f):f=e[7],e[8]!==n?(h=y.jsx(qn,{content:"Copy column name",delayDuration:400,children:y.jsx(Ft,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:y.jsx($v,{tooltip:!1,value:n,className:"h-3 w-3"})})}),e[8]=n,e[9]=h):h=e[9],e[10]!==o?(g=y.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[10]=o,e[11]=g):g=e[11],e[12]!==h||e[13]!==g?(v=y.jsxs("div",{className:"ml-auto",children:[h,g]}),e[12]=h,e[13]=g,e[14]=v):v=e[14],e[15]!==n||e[16]!==d||e[17]!==f||e[18]!==v?(b=y.jsxs(fy,{onSelect:d,className:"flex flex-row items-center gap-1.5 group w-full cursor-pointer",children:[f,v]},n),e[15]=n,e[16]=d,e[17]=f,e[18]=v,e[19]=b):b=e[19],e[20]!==n||e[21]!==r||e[22]!==a||e[23]!==i?(p=a&&y.jsx(Bh,{children:y.jsx(Mpt,{previewColumn:i,columnName:n,dataType:r})}),e[20]=n,e[21]=r,e[22]=a,e[23]=i,e[24]=p):p=e[24],e[25]!==b||e[26]!==p?(O=y.jsxs(y.Fragment,{children:[b,p]}),e[25]=b,e[26]=p,e[27]=O):O=e[27],O},Mpt=t=>{const e=ue.c(25),{previewColumn:n,columnName:r,dataType:o}=t,{theme:i}=as();let a,s;e[0]!==r||e[1]!==n?(a=async()=>await n({column:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[3]=s):s=e[3];const{data:l,error:c,isPending:u,refetch:d}=$a(a,s);if(c){let N;return e[4]!==c?(N=y.jsx(iee,{error:c}),e[4]=c,e[5]=N):N=e[5],N}if(u){let N;return e[6]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx(ZJ,{message:"Loading..."}),e[6]=N):N=e[6],N}if(!l){let N;return e[7]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx(aee,{content:"No data",className:"pl-4"}),e[7]=N):N=e[7],N}const{chart_spec:f,chart_code:h,error:g,missing_packages:v,stats:b}=l;let p;e[8]!==v||e[9]!==g||e[10]!==d?(p=g&&W4e({error:g,missingPackages:v,refetchPreview:d}),e[8]=v,e[9]=g,e[10]=d,e[11]=p):p=e[11];const O=p;let k;e[12]!==o||e[13]!==b?(k=b&&U4e(b,o),e[12]=o,e[13]=b,e[14]=k):k=e[14];const S=k;let w;e[15]!==f||e[16]!==i?(w=f&&Z4e(f,i),e[15]=f,e[16]=i,e[17]=w):w=e[17];const T=w;let P;e[18]!==h?(P=h&&y.jsx(X4e,{chartCode:h}),e[18]=h,e[19]=P):P=e[19];const j=P;let D;return e[20]!==j||e[21]!==T||e[22]!==O||e[23]!==S?(D=y.jsxs(QU,{className:"px-2 py-1",children:[O,j,T,S]}),e[20]=j,e[21]=T,e[22]=O,e[23]=S,e[24]=D):D=e[24],D};function Npt(t){const[e]=t;return e!==$S&&e!==IS&&!e.startsWith(JS)}function $pt(t){const[e]=t;return e}const H4e=Ct(null),Ipt=Ct(null),Y4e=Ct(!1),Qpt=Ct(!1),G4e=Ct(!1),K4e=Ct({});V6e=function(){return Gr(K4e)},RQe=function(t,e){const n=ue.c(13),{registerAction:r,unregisterAction:o}=function(){const h=Xm(K4e);return{registerAction:Fn((g,v)=>{h(b=>({...b,[g]:v}))}),unregisterAction:Fn(g=>{h(v=>{const{[g]:b,...p}=v;return p})})}}(),i=Gr(hT),a=e===Zi.NOOP;let s;n[0]!==e?(s=h=>e(h),n[0]=e,n[1]=s):s=n[1];const l=Fn(s);let c;n[2]!==e||n[3]!==i||n[4]!==t?(c=h=>{_T(i.getHotkey(t).key)(h)&&e(h)!==!1&&(h.preventDefault(),h.stopPropagation())},n[2]=e,n[3]=i,n[4]=t,n[5]=c):c=n[5];const u=Fn(c);let d,f;Wh(document,"keydown",u),n[6]!==a||n[7]!==l||n[8]!==r||n[9]!==t||n[10]!==o?(d=()=>{if(!a)return r(t,l),()=>o(t)},f=[l,t,a,r,o],n[6]=a,n[7]=l,n[8]=r,n[9]=t,n[10]=o,n[11]=d,n[12]=f):(d=n[11],f=n[12]),_.useEffect(d,f)};const Lpt=({rowIdx:t,setRowIdx:e,totalRows:n,fieldTypes:r,getRow:o,isSelectable:i,isRowSelected:a,handleRowSelectionChange:s})=>{const[l,c]=_.useState(""),u=_.useRef(null),d=_.useRef(null),f=n===QS,{data:h,error:g}=$a(async()=>(await o(t)).rows,[o,t,n]),v=O=>{O<0||typeof n=="number"&&O>=n||e(O)},b=()=>{s==null||s(O=>{if(a){const{[t]:k,...S}=O;return S}return{...O,[t]:!0}})};!f&&t>n&&v(n-1),function(O,k){const S=ue.c(2);let w;S[0]!==k?(w=T=>{for(const[P,j]of cr.entries(k))_T(P)(T)&&(Ve.debug("Satisfied",P,T),j(T)!==!1&&(T.preventDefault(),T.stopPropagation()))},S[0]=k,S[1]=w):w=S[1],Wh(O,"keydown",w)}(u,{ArrowLeft:O=>{if((O==null?void 0:O.target)===d.current)return!1;v(t-1)},ArrowRight:O=>{if((O==null?void 0:O.target)===d.current)return!1;v(t+1)},Space:O=>{if((O==null?void 0:O.target)===d.current)return!1;b()}});const p="h-6 w-6 p-0.5";return y.jsxs("div",{className:"flex flex-col gap-3 mt-4 focus:outline-none",ref:u,tabIndex:-1,children:[y.jsxs("div",{className:"flex flex-row gap-2 items-center mr-2",children:[i&&y.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[y.jsx(Ft,{variant:"link",size:"xs",className:"pr-0",onClick:b,children:a?"Deselect row":"Select row"}),y.jsx(pT,{shortcut:"Space"})]}),y.jsx(Ft,{variant:"outline",size:"xs",className:`${p} ml-auto`,onClick:()=>v(0),disabled:t===0,"aria-label":"Go to first row",children:y.jsx(C6,{})}),y.jsx(Ft,{variant:"outline",size:"xs",className:p,onClick:()=>v(t-1),disabled:t===0,"aria-label":"Previous row",children:y.jsx(ty,{})}),y.jsx("span",{className:"text-xs",children:f?`Row ${t+1}`:`Row ${t+1} of ${bSe(n)}`}),y.jsx(Ft,{variant:"outline",size:"xs",className:p,onClick:()=>v(t+1),disabled:!f&&t===n-1,"aria-label":"Next row",children:y.jsx(Qh,{})}),y.jsx(Ft,{variant:"outline",size:"xs",className:p,onClick:()=>{f||v(n-1)},disabled:f||t===n-1,"aria-label":"Go to last row",children:y.jsx(_6,{})})]}),y.jsx("div",{className:"mx-2 -mb-1",children:y.jsx(tf,{ref:d,type:"text",placeholder:"Search",onChange:O=>c(O.target.value),icon:y.jsx(Jm,{className:"w-4 h-4"}),className:"mb-0 border-border","data-testid":"selection-panel-search-input"})}),(()=>{if(g)return y.jsx(Hd,{error:g,className:"p-4 mx-3 mt-5"});if(n===0)return y.jsx(M4,{kind:"info",Icon:sk,message:"No rows selected"});if(!h)return y.jsx(M4,{kind:"warn",Icon:vO,message:"No data available. Please report the issue."});if(h.length!==1)return y.jsx(M4,{kind:"warn",Icon:vO,message:`Expected 1 row, got ${h.length} rows. Please report the issue.`});const O=h[0];if(typeof O!="object"||O===null)return y.jsx(M4,{kind:"warn",Icon:vO,message:"Row is not an object. Please report the issue."});const k={};for(const[S,w]of Object.entries(O))S!==$S&&S!==IS&&(S.startsWith(JS)?k[S.slice(JS.length)]=w:k[S]=w);return y.jsxs(iy,{className:"mb-4",children:[y.jsx(mO,{children:y.jsxs(Rc,{children:[y.jsx(oy,{className:"w-1/4",children:"Column"}),y.jsx(oy,{className:"w-3/4",children:"Value"})]})}),y.jsx(gO,{children:r==null?void 0:r.map(([S,[w,T]])=>{const P=k[S];if(!function({columnName:N,columnValue:E,searchQuery:A}){const I=N.toLowerCase(),L=A.toLowerCase();let F=typeof E=="object"?JSON.stringify(E):String(E);return F=F.toLowerCase(),I.includes(L)||F.includes(L)}({columnName:S,columnValue:P,searchQuery:l}))return null;const j=qke({id:S,columnDef:{meta:{dataType:w}},getColumnFormatting:()=>{},applyColumnFormatting:N=>N},()=>P,()=>P,void 0,"text-left break-all"),D=typeof P=="object"?JSON.stringify(P):String(P);return y.jsxs(Rc,{className:"group",children:[y.jsx(jc,{children:y.jsx(QN,{columnName:y.jsx("span",{children:S}),dataType:w})}),y.jsx(jc,{children:y.jsxs("div",{className:"flex flex-row items-center justify-between gap-1",children:[j,y.jsx($v,{value:D,className:"w-3 h-3 mr-1 text-muted-foreground cursor-pointer opacity-0 group-hover:opacity-100"})]})})]},S)})})]})})()]})},M4=t=>{const e=ue.c(8),{kind:n,Icon:r,message:o}=t;let i,a,s;return e[0]!==r?(i=y.jsx(r,{className:"w-5 h-5"}),e[0]=r,e[1]=i):i=e[1],e[2]!==o?(a=y.jsx("span",{children:o}),e[2]=o,e[3]=a):a=e[3],e[4]!==n||e[5]!==i||e[6]!==a?(s=y.jsxs(Km,{kind:n,className:"p-4 mx-3 mt-3 flex flex-row items-center gap-2",children:[i,a]}),e[4]=n,e[5]=i,e[6]=a,e[7]=s):s=e[7],s},N4=_.createContext(null);N4.displayName="PanelGroupContext";const zpt="data-panel-group",J4e="data-panel-group-direction",RC="data-panel-group-id",Vpt="data-panel",qpt="data-panel-collapsible",Fpt="data-panel-id",Bpt="data-panel-size",eDe="data-resize-handle",Wpt="data-resize-handle-active",Upt="data-panel-resize-handle-enabled",jC="data-panel-resize-handle-id",Zpt="data-resize-handle-state",dv=_.useLayoutEffect,tDe=Og.useId,Xpt=typeof tDe=="function"?tDe:()=>null;let Hpt=0;function zU(t=null){const e=Xpt(),n=_.useRef(t||e||null);return n.current===null&&(n.current=""+Hpt++),t??n.current}function nDe({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:a,maxSize:s,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:f,style:h,tagName:g="div",...v}){const b=_.useContext(N4);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:p,expandPanel:O,getPanelSize:k,getPanelStyle:S,groupId:w,isPanelCollapsed:T,reevaluatePanelConstraints:P,registerPanel:j,resizePanel:D,unregisterPanel:N}=b,E=zU(a),A=_.useRef({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:s,minSize:l},id:E,idIsFromProps:a!==void 0,order:f});_.useRef({didLogMissingDefaultSizeWarning:!1}),dv(()=>{const{callbacks:L,constraints:F}=A.current,Q={...F};A.current.id=E,A.current.idIsFromProps=a!==void 0,A.current.order=f,L.onCollapse=c,L.onExpand=u,L.onResize=d,F.collapsedSize=n,F.collapsible=r,F.defaultSize=o,F.maxSize=s,F.minSize=l,Q.collapsedSize===F.collapsedSize&&Q.collapsible===F.collapsible&&Q.maxSize===F.maxSize&&Q.minSize===F.minSize||P(A.current,Q)}),dv(()=>{const L=A.current;return j(L),()=>{N(L)}},[f,E,j,N]),_.useImperativeHandle(i,()=>({collapse:()=>{p(A.current)},expand:L=>{O(A.current,L)},getId:()=>E,getSize:()=>k(A.current),isCollapsed:()=>T(A.current),isExpanded:()=>!T(A.current),resize:L=>{D(A.current,L)}}),[p,O,k,T,E,D]);const I=S(A.current,o);return _.createElement(g,{...v,children:t,className:e,id:E,style:{...I,...h},[RC]:w,[Vpt]:"",[qpt]:r||void 0,[Fpt]:E,[Bpt]:parseFloat(""+I.flexGrow).toFixed(1)})}AA=_.forwardRef((t,e)=>_.createElement(nDe,{...t,forwardedRef:e})),nDe.displayName="Panel",AA.displayName="forwardRef(Panel)";let VU=null,$4=-1,Sm=null;function qU(t,e){var n,r;const o=function(a,s){if(s){const l=(s&fDe)!==0,c=(s&hDe)!==0;if((s&uDe)!==0)return l?"se-resize":c?"ne-resize":"e-resize";if((s&dDe)!==0)return l?"sw-resize":c?"nw-resize":"w-resize";if(l)return"s-resize";if(c)return"n-resize"}switch(a){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(t,e);if(VU!==o){var i;VU=o,Sm===null&&(Sm=document.createElement("style"),document.head.appendChild(Sm)),$4>=0&&((i=Sm.sheet)===null||i===void 0||i.removeRule($4)),$4=(n=(r=Sm.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${o} !important;}`))!==null&&n!==void 0?n:-1}}function rDe(t){return t.type==="keydown"}function oDe(t){return t.type.startsWith("pointer")}function iDe(t){return t.type.startsWith("mouse")}function I4(t){if(oDe(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(iDe(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Ypt(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}const Gpt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Kpt(t){const e=getComputedStyle(t);return e.position==="fixed"||!(e.zIndex==="auto"||e.position==="static"&&!function(n){var r;const o=getComputedStyle((r=cDe(n))!==null&&r!==void 0?r:n).display;return o==="flex"||o==="inline-flex"}(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||!!Gpt.test(e.willChange)||e.webkitOverflowScrolling==="touch"}function aDe(t){let e=t.length;for(;e--;){const n=t[e];if(zn(n,"Missing node"),Kpt(n))return n}return null}function sDe(t){return t&&Number(getComputedStyle(t).zIndex)||0}function lDe(t){const e=[];for(;t;)e.push(t),t=cDe(t);return e}function cDe(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const uDe=1,dDe=2,fDe=4,hDe=8,Jpt=function(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}()==="coarse";let fu=[],ex=!1,fv=new Map,Q4=new Map;const DC=new Set;function emt(t){const{target:e}=t,{x:n,y:r}=I4(t);ex=!0,WU({target:e,x:n,y:r}),L4(),fu.length>0&&(z4("down",t),t.preventDefault(),pDe(e)||t.stopImmediatePropagation())}function FU(t){const{x:e,y:n}=I4(t);if(ex&&t.buttons===0&&(ex=!1,z4("up",t)),!ex){const{target:r}=t;WU({target:r,x:e,y:n})}z4("move",t),UU(),fu.length>0&&t.preventDefault()}function BU(t){const{target:e}=t,{x:n,y:r}=I4(t);Q4.clear(),ex=!1,fu.length>0&&(t.preventDefault(),pDe(e)||t.stopImmediatePropagation()),z4("up",t),WU({target:e,x:n,y:r}),UU(),L4()}function pDe(t){let e=t;for(;e;){if(e.hasAttribute(eDe))return!0;e=e.parentElement}return!1}function WU({target:t,x:e,y:n}){fu.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),DC.forEach(o=>{const{element:i,hitAreaMargins:a}=o,s=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=s,f=Jpt?a.coarse:a.fine;if(e>=c-f&&e<=u+f&&n>=d-f&&n<=l+f){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&function(h,g){if(h===g)throw new Error("Cannot compare node with itself");const v={a:lDe(h),b:lDe(g)};let b;for(;v.a.at(-1)===v.b.at(-1);)h=v.a.pop(),g=v.b.pop(),b=h;zn(b,"Stacking order can only be calculated for elements with a common ancestor");const p=sDe(aDe(v.a)),O=sDe(aDe(v.b));if(p===O){const k=b.childNodes,S={a:v.a.at(-1),b:v.b.at(-1)};let w=k.length;for(;w--;){const T=k[w];if(T===S.a)return 1;if(T===S.b)return-1}}return Math.sign(p-O)}(r,i)>0){let h=r,g=!1;for(;h&&!h.contains(i);){if(Ypt(h.getBoundingClientRect(),s)){g=!0;break}h=h.parentElement}if(g)return}fu.push(o)}})}function tmt(t,e){Q4.set(t,e)}function UU(){let t=!1,e=!1;fu.forEach(r=>{const{direction:o}=r;o==="horizontal"?t=!0:e=!0});let n=0;Q4.forEach(r=>{n|=r}),t&&e?qU("intersection",n):t?qU("horizontal",n):e?qU("vertical",n):Sm!==null&&(document.head.removeChild(Sm),VU=null,Sm=null,$4=-1)}let ZU=new AbortController;function L4(){ZU.abort(),ZU=new AbortController;const t={capture:!0,signal:ZU.signal};DC.size&&(ex?(fu.length>0&&fv.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",BU,t),r.addEventListener("pointerleave",FU,t),r.addEventListener("pointermove",FU,t))}),window.addEventListener("pointerup",BU,t),window.addEventListener("pointercancel",BU,t)):fv.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",emt,t),r.addEventListener("pointermove",FU,t))}))}function z4(t,e){DC.forEach(n=>{const{setResizeHandlerState:r}=n,o=fu.includes(n);r(t,o,e)})}function zn(t,e){if(!t)throw console.error(e),Error(e)}function hv(t,e,n=10){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function xh(t,e,n=10){return hv(t,e,n)===0}function xl(t,e,n){return hv(t,e,n)===0}function tx({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];zn(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:o=0,collapsible:i,maxSize:a=100,minSize:s=0}=r;return hv(n,s)<0&&(i?n=hv(n,(o+s)/2)<0?o:s:n=s),n=Math.min(a,n),n=parseFloat(n.toFixed(10))}function AC({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(xl(t,0))return e;const a=[...e],[s,l]=r;zn(s!=null,"Invalid first pivot index"),zn(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=t<0?l:s,f=n[d];zn(f,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:g,minSize:v=0}=f;if(g){const b=e[d];if(zn(b!=null,`Previous layout not found for panel index ${d}`),xl(b,h)){const p=v-b;hv(p,Math.abs(t))>0&&(t=t<0?0-p:p)}}}{const d=t<0?s:l,f=n[d];zn(f,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:g,minSize:v=0}=f;if(g){const b=e[d];if(zn(b!=null,`Previous layout not found for panel index ${d}`),xl(b,v)){const p=b-h;hv(p,Math.abs(t))>0&&(t=t<0?0-p:p)}}}}{const d=t<0?1:-1;let f=t<0?l:s,h=0;for(;;){const v=e[f];if(zn(v!=null,`Previous layout not found for panel index ${f}`),h+=tx({panelConstraints:n,panelIndex:f,size:100})-v,f+=d,f<0||f>=n.length)break}const g=Math.min(Math.abs(t),Math.abs(h));t=t<0?0-g:g}{let d=t<0?s:l;for(;d>=0&&d<n.length;){const f=Math.abs(t)-Math.abs(c),h=e[d];zn(h!=null,`Previous layout not found for panel index ${d}`);const g=tx({panelConstraints:n,panelIndex:d,size:h-f});if(!xl(h,g)&&(c+=h-g,a[d]=g,c.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?d--:d++}}if(function(d,f,h){if(d.length!==f.length)return!1;for(let g=0;g<d.length;g++)if(!xl(d[g],f[g],h))return!1;return!0}(o,a))return o;{const d=t<0?l:s,f=e[d];zn(f!=null,`Previous layout not found for panel index ${d}`);const h=f+c,g=tx({panelConstraints:n,panelIndex:d,size:h});if(a[d]=g,!xl(g,h)){let v=h-g,b=t<0?l:s;for(;b>=0&&b<n.length;){const p=a[b];zn(p!=null,`Previous layout not found for panel index ${b}`);const O=tx({panelConstraints:n,panelIndex:b,size:p+v});if(xl(p,O)||(v-=O-p,a[b]=O),xl(v,0))break;t>0?b--:b++}}}const u=a.reduce((d,f)=>f+d,0);return xl(u,100)?a:o}function nmt({layout:t,panelsArray:e,pivotIndices:n}){let r=0,o=100,i=0,a=0;const s=n[0];return zn(s!=null,"No pivot index found"),e.forEach((l,c)=>{const{constraints:u}=l,{maxSize:d=100,minSize:f=0}=u;c===s?(r=f,o=d):(i+=f,a+=d)}),{valueMax:Math.min(o,100-i),valueMin:Math.max(r,100-a),valueNow:t[s]}}function MC(t,e=document){return Array.from(e.querySelectorAll(`[${jC}][data-panel-group-id="${t}"]`))}function mDe(t,e,n=document){const r=MC(t,n).findIndex(o=>o.getAttribute(jC)===e);return r??null}function gDe(t,e,n){const r=mDe(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function vDe(t,e=document){var n;return e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t?e:e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`)||null}function V4(t,e=document){return e.querySelector(`[${jC}="${t}"]`)||null}function rmt({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:a}){_.useRef({didWarnAboutMissingResizeHandle:!1}),dv(()=>{if(!i)return;const s=MC(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=nmt({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),f=s[l];if(f!=null){const h=o[l];zn(h,`No panel data found for index "${l}"`),f.setAttribute("aria-controls",h.id),f.setAttribute("aria-valuemax",""+Math.round(c)),f.setAttribute("aria-valuemin",""+Math.round(u)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),_.useEffect(()=>{if(!i)return;const s=e.current;zn(s,"Eager values not found");const{panelDataArray:l}=s;zn(vDe(n,i)!=null,`No group found for id "${n}"`);const c=MC(n,i);zn(c,`No resize handles found for group id "${n}"`);const u=c.map(d=>{const f=d.getAttribute(jC);zn(f,"Resize handle element has no handle id attribute");const[h,g]=function(b,p,O,k=document){var S,w,T,P;const j=V4(p,k),D=MC(b,k),N=j?D.indexOf(j):-1;return[(S=(w=O[N])===null||w===void 0?void 0:w.id)!==null&&S!==void 0?S:null,(T=(P=O[N+1])===null||P===void 0?void 0:P.id)!==null&&T!==void 0?T:null]}(n,f,l,i);if(h==null||g==null)return()=>{};const v=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const p=l.findIndex(O=>O.id===h);if(p>=0){const O=l[p];zn(O,`No panel data found for index ${p}`);const k=r[p],{collapsedSize:S=0,collapsible:w,minSize:T=0}=O.constraints;if(k!=null&&w){const P=AC({delta:xl(k,S)?T-S:S-k,initialLayout:r,panelConstraints:l.map(j=>j.constraints),pivotIndices:gDe(n,f,i),prevLayout:r,trigger:"keyboard"});r!==P&&a(P)}}break}}};return d.addEventListener("keydown",v),()=>{d.removeEventListener("keydown",v)}});return()=>{u.forEach(d=>d())}},[i,t,e,n,r,o,a])}function yDe(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function bDe(t,e){const n=t==="horizontal",{x:r,y:o}=I4(e);return n?r:o}function omt(t,e,n,r,o,i){if(rDe(t)){const a=n==="horizontal";let s=0;s=t.shiftKey?100:o??10;let l=0;switch(t.key){case"ArrowDown":l=a?0:s;break;case"ArrowLeft":l=a?-s:0;break;case"ArrowRight":l=a?s:0;break;case"ArrowUp":l=a?0:-s;break;case"End":l=100;break;case"Home":l=-100}return l}return r==null?0:function(a,s,l,c,u){const d=l==="horizontal",f=V4(s,u);zn(f,`No resize handle element found for id "${s}"`);const h=f.getAttribute(RC);zn(h,"Resize handle element has no group id attribute");let{initialCursorPosition:g}=c;const v=bDe(l,a),b=vDe(h,u);zn(b,`No group element found for id "${h}"`);const p=b.getBoundingClientRect();return(v-g)/(d?p.width:p.height)*100}(t,e,n,r,i)}function nx(t,e,n){e.forEach((r,o)=>{const i=t[o];zn(i,`Panel data not found for index ${o}`);const{callbacks:a,constraints:s,id:l}=i,{collapsedSize:c=0,collapsible:u}=s,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:f,onExpand:h,onResize:g}=a;g&&g(r,d),u&&(f||h)&&(!h||d!=null&&!xh(d,c)||xh(r,c)||h(),!f||d!=null&&xh(d,c)||!xh(r,c)||f())}})}function q4(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function xDe(t){try{if(typeof localStorage>"u")throw new Error("localStorage not supported in this environment");t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)}}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function ODe(t){return`react-resizable-panels:${t}`}function wDe(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=e;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function kDe(t,e){try{const n=ODe(t),r=e.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function imt(t,e,n,r,o){var i;const a=ODe(t),s=wDe(e),l=(i=kDe(t,o))!==null&&i!==void 0?i:{};l[s]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(a,JSON.stringify(l))}catch(c){console.error(c)}}function SDe({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((i,a)=>i+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!xl(r,100)&&n.length>0)for(let i=0;i<e.length;i++){const a=n[i];zn(a!=null,`No layout data found for index ${i}`);const s=100/r*a;n[i]=s}let o=0;for(let i=0;i<e.length;i++){const a=n[i];zn(a!=null,`No layout data found for index ${i}`);const s=tx({panelConstraints:e,panelIndex:i,size:a});a!=s&&(o+=a-s,n[i]=s)}if(!xl(o,0))for(let i=0;i<e.length;i++){const a=n[i];zn(a!=null,`No layout data found for index ${i}`);const s=tx({panelConstraints:e,panelIndex:i,size:a+o});if(a!==s&&(o-=s-a,n[i]=s,xl(o,0)))break}return n}const NC={getItem:t=>(xDe(NC),NC.getItem(t)),setItem:(t,e)=>{xDe(NC),NC.setItem(t,e)}},CDe={};function _De({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=NC,style:c,tagName:u="div",...d}){const f=zU(i),h=_.useRef(null),[g,v]=_.useState(null),[b,p]=_.useState([]),O=function(){const[re,Z]=_.useState(0);return _.useCallback(()=>Z(K=>K+1),[])}(),k=_.useRef({}),S=_.useRef(new Map),w=_.useRef(0),T=_.useRef({autoSaveId:t,direction:r,dragState:g,id:f,keyboardResizeBy:s,onLayout:a,storage:l}),P=_.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});_.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),_.useImperativeHandle(o,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:re}=P.current;return re},setLayout:re=>{const{onLayout:Z}=T.current,{layout:K,panelDataArray:oe}=P.current,ie=SDe({layout:re,panelConstraints:oe.map(Y=>Y.constraints)});yDe(K,ie)||(p(ie),P.current.layout=ie,Z&&Z(ie),nx(oe,ie,k.current))}}),[]),dv(()=>{T.current.autoSaveId=t,T.current.direction=r,T.current.dragState=g,T.current.id=f,T.current.onLayout=a,T.current.storage=l}),rmt({committedValuesRef:T,eagerValuesRef:P,groupId:f,layout:b,panelDataArray:P.current.panelDataArray,setLayout:p,panelGroupElement:h.current}),_.useEffect(()=>{const{panelDataArray:re}=P.current;if(t){if(b.length===0||b.length!==re.length)return;let Z=CDe[t];Z==null&&(Z=function(ie,Y=10){let le=null;return(...me)=>{le!==null&&clearTimeout(le),le=setTimeout(()=>{ie(...me)},Y)}}(imt,100),CDe[t]=Z);const K=[...re],oe=new Map(S.current);Z(t,K,oe,b,l)}},[t,b,l]),_.useEffect(()=>{});const j=_.useCallback(re=>{const{onLayout:Z}=T.current,{layout:K,panelDataArray:oe}=P.current;if(re.constraints.collapsible){const ie=oe.map(ce=>ce.constraints),{collapsedSize:Y=0,panelSize:le,pivotIndices:me}=pv(oe,re,K);if(zn(le!=null,`Panel size not found for panel "${re.id}"`),!xh(le,Y)){S.current.set(re.id,le);const ce=AC({delta:rx(oe,re)===oe.length-1?le-Y:Y-le,initialLayout:K,panelConstraints:ie,pivotIndices:me,prevLayout:K,trigger:"imperative-api"});q4(K,ce)||(p(ce),P.current.layout=ce,Z&&Z(ce),nx(oe,ce,k.current))}}},[]),D=_.useCallback((re,Z)=>{const{onLayout:K}=T.current,{layout:oe,panelDataArray:ie}=P.current;if(re.constraints.collapsible){const Y=ie.map(_e=>_e.constraints),{collapsedSize:le=0,panelSize:me=0,minSize:ce=0,pivotIndices:ve}=pv(ie,re,oe),ye=Z??ce;if(xh(me,le)){const _e=S.current.get(re.id),Se=_e!=null&&_e>=ye?_e:ye,Ae=AC({delta:rx(ie,re)===ie.length-1?me-Se:Se-me,initialLayout:oe,panelConstraints:Y,pivotIndices:ve,prevLayout:oe,trigger:"imperative-api"});q4(oe,Ae)||(p(Ae),P.current.layout=Ae,K&&K(Ae),nx(ie,Ae,k.current))}}},[]),N=_.useCallback(re=>{const{layout:Z,panelDataArray:K}=P.current,{panelSize:oe}=pv(K,re,Z);return zn(oe!=null,`Panel size not found for panel "${re.id}"`),oe},[]),E=_.useCallback((re,Z)=>{const{panelDataArray:K}=P.current,oe=rx(K,re);return function({defaultSize:ie,dragState:Y,layout:le,panelData:me,panelIndex:ce,precision:ve=3}){const ye=le[ce];let _e;return _e=ye==null?ie!=null?ie.toPrecision(ve):"1":me.length===1?"1":ye.toPrecision(ve),{flexBasis:0,flexGrow:_e,flexShrink:1,overflow:"hidden",pointerEvents:Y!==null?"none":void 0}}({defaultSize:Z,dragState:g,layout:b,panelData:K,panelIndex:oe})},[g,b]),A=_.useCallback(re=>{const{layout:Z,panelDataArray:K}=P.current,{collapsedSize:oe=0,collapsible:ie,panelSize:Y}=pv(K,re,Z);return zn(Y!=null,`Panel size not found for panel "${re.id}"`),ie===!0&&xh(Y,oe)},[]),I=_.useCallback(re=>{const{layout:Z,panelDataArray:K}=P.current,{collapsedSize:oe=0,collapsible:ie,panelSize:Y}=pv(K,re,Z);return zn(Y!=null,`Panel size not found for panel "${re.id}"`),!ie||hv(Y,oe)>0},[]),L=_.useCallback(re=>{const{panelDataArray:Z}=P.current;Z.push(re),Z.sort((K,oe)=>{const ie=K.order,Y=oe.order;return ie==null&&Y==null?0:ie==null?-1:Y==null?1:ie-Y}),P.current.panelDataArrayChanged=!0,O()},[O]);dv(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:re,onLayout:Z,storage:K}=T.current,{layout:oe,panelDataArray:ie}=P.current;let Y=null;if(re){const me=function(ce,ve,ye){var _e,Se;return(Se=((_e=kDe(ce,ye))!==null&&_e!==void 0?_e:{})[wDe(ve)])!==null&&Se!==void 0?Se:null}(re,ie,K);me&&(S.current=new Map(Object.entries(me.expandToSizes)),Y=me.layout)}Y==null&&(Y=function({panelDataArray:me}){const ce=Array(me.length),ve=me.map(Se=>Se.constraints);let ye=0,_e=100;for(let Se=0;Se<me.length;Se++){const Ae=ve[Se];zn(Ae,`Panel constraints not found for index ${Se}`);const{defaultSize:je}=Ae;je!=null&&(ye++,ce[Se]=je,_e-=je)}for(let Se=0;Se<me.length;Se++){const Ae=ve[Se];zn(Ae,`Panel constraints not found for index ${Se}`);const{defaultSize:je}=Ae;if(je!=null)continue;const Ie=_e/(me.length-ye);ye++,ce[Se]=Ie,_e-=Ie}return ce}({panelDataArray:ie}));const le=SDe({layout:Y,panelConstraints:ie.map(me=>me.constraints)});yDe(oe,le)||(p(le),P.current.layout=le,Z&&Z(le),nx(ie,le,k.current))}}),dv(()=>{const re=P.current;return()=>{re.layout=[]}},[]);const F=_.useCallback(re=>{let Z=!1;const K=h.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(Z=!0),function(oe){oe.preventDefault();const ie=h.current;if(!ie)return()=>null;const{direction:Y,dragState:le,id:me,keyboardResizeBy:ce,onLayout:ve}=T.current,{layout:ye,panelDataArray:_e}=P.current,{initialLayout:Se}=le??{},Ae=gDe(me,re,ie);let je=omt(oe,re,Y,le,ce,ie);const Ie=Y==="horizontal";Ie&&Z&&(je=-je);const De=AC({delta:je,initialLayout:Se??ye,panelConstraints:_e.map(Fe=>Fe.constraints),pivotIndices:Ae,prevLayout:ye,trigger:rDe(oe)?"keyboard":"mouse-or-touch"}),nt=!q4(ye,De);(oDe(oe)||iDe(oe))&&w.current!=je&&(w.current=je,tmt(re,nt||je===0?0:Ie?je<0?uDe:dDe:je<0?fDe:hDe)),nt&&(p(De),P.current.layout=De,ve&&ve(De),nx(_e,De,k.current))}},[]),Q=_.useCallback((re,Z)=>{const{onLayout:K}=T.current,{layout:oe,panelDataArray:ie}=P.current,Y=ie.map(ve=>ve.constraints),{panelSize:le,pivotIndices:me}=pv(ie,re,oe);zn(le!=null,`Panel size not found for panel "${re.id}"`);const ce=AC({delta:rx(ie,re)===ie.length-1?le-Z:Z-le,initialLayout:oe,panelConstraints:Y,pivotIndices:me,prevLayout:oe,trigger:"imperative-api"});q4(oe,ce)||(p(ce),P.current.layout=ce,K&&K(ce),nx(ie,ce,k.current))},[]),W=_.useCallback((re,Z)=>{const{layout:K,panelDataArray:oe}=P.current,{collapsedSize:ie=0,collapsible:Y}=Z,{collapsedSize:le=0,collapsible:me,maxSize:ce=100,minSize:ve=0}=re.constraints,{panelSize:ye}=pv(oe,re,K);ye!=null&&(Y&&me&&xh(ye,ie)?xh(ie,le)||Q(re,le):ye<ve?Q(re,ve):ye>ce&&Q(re,ce))},[Q]),U=_.useCallback((re,Z)=>{const{direction:K}=T.current,{layout:oe}=P.current;if(!h.current)return;const ie=V4(re,h.current);zn(ie,`Drag handle element not found for id "${re}"`);const Y=bDe(K,Z);v({dragHandleId:re,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:Y,initialLayout:oe})},[]),X=_.useCallback(()=>{v(null)},[]),G=_.useCallback(re=>{const{panelDataArray:Z}=P.current,K=rx(Z,re);K>=0&&(Z.splice(K,1),delete k.current[re.id],P.current.panelDataArrayChanged=!0,O())},[O]),ae=_.useMemo(()=>({collapsePanel:j,direction:r,dragState:g,expandPanel:D,getPanelSize:N,getPanelStyle:E,groupId:f,isPanelCollapsed:A,isPanelExpanded:I,reevaluatePanelConstraints:W,registerPanel:L,registerResizeHandle:F,resizePanel:Q,startDragging:U,stopDragging:X,unregisterPanel:G,panelGroupElement:h.current}),[j,g,r,D,N,E,f,A,I,W,L,F,Q,U,X,G]),ne={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return _.createElement(N4.Provider,{value:ae},_.createElement(u,{...d,children:e,className:n,id:i,ref:h,style:{...ne,...c},[zpt]:"",[J4e]:r,[RC]:f}))}BH=_.forwardRef((t,e)=>_.createElement(_De,{...t,forwardedRef:e}));function rx(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function pv(t,e,n){const r=rx(t,e),o=r===t.length-1?[r-1,r]:[r,r+1],i=n[r];return{...e.constraints,panelSize:i,pivotIndices:o}}$N=function({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onClick:a,onDragging:s,onFocus:l,onPointerDown:c,onPointerUp:u,style:d={},tabIndex:f=0,tagName:h="div",...g}){var v,b;const p=_.useRef(null),O=_.useRef({onClick:a,onDragging:s,onPointerDown:c,onPointerUp:u});_.useEffect(()=>{O.current.onClick=a,O.current.onDragging=s,O.current.onPointerDown=c,O.current.onPointerUp=u});const k=_.useContext(N4);if(k===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:S,groupId:w,registerResizeHandle:T,startDragging:P,stopDragging:j,panelGroupElement:D}=k,N=zU(o),[E,A]=_.useState("inactive"),[I,L]=_.useState(!1),[F,Q]=_.useState(null),W=_.useRef({state:E});dv(()=>{W.current.state=E}),_.useEffect(()=>{if(n)Q(null);else{const G=T(N);Q(()=>G)}},[n,N,T]);const U=(v=r==null?void 0:r.coarse)!==null&&v!==void 0?v:15,X=(b=r==null?void 0:r.fine)!==null&&b!==void 0?b:5;return _.useEffect(()=>{if(n||F==null)return;const G=p.current;zn(G,"Element ref not attached");let ae=!1;return function(ne,re,Z,K,oe){var ie;const{ownerDocument:Y}=re,le={direction:Z,element:re,hitAreaMargins:K,setResizeHandlerState:oe},me=(ie=fv.get(Y))!==null&&ie!==void 0?ie:0;return fv.set(Y,me+1),DC.add(le),L4(),function(){var ce;Q4.delete(ne),DC.delete(le);const ve=(ce=fv.get(Y))!==null&&ce!==void 0?ce:1;if(fv.set(Y,ve-1),L4(),ve===1&&fv.delete(Y),fu.includes(le)){const ye=fu.indexOf(le);ye>=0&&fu.splice(ye,1),UU(),oe("up",!0,null)}}}(N,G,S,{coarse:U,fine:X},(ne,re,Z)=>{if(re)switch(ne){case"down":{A("drag"),ae=!1,zn(Z,'Expected event to be defined for "down" action'),P(N,Z);const{onDragging:K,onPointerDown:oe}=O.current;K==null||K(!0),oe==null||oe();break}case"move":{const{state:K}=W.current;ae=!0,K!=="drag"&&A("hover"),zn(Z,'Expected event to be defined for "move" action'),F(Z);break}case"up":{A("hover"),j();const{onClick:K,onDragging:oe,onPointerUp:ie}=O.current;oe==null||oe(!1),ie==null||ie(),ae||K==null||K();break}}else A("inactive")})},[U,S,n,X,T,N,F,P,j]),function({disabled:G,handleId:ae,resizeHandler:ne,panelGroupElement:re}){_.useEffect(()=>{if(G||ne==null||re==null)return;const Z=V4(ae,re);if(Z==null)return;const K=oe=>{if(!oe.defaultPrevented)switch(oe.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":oe.preventDefault(),ne(oe);break;case"F6":{oe.preventDefault();const ie=Z.getAttribute(RC);zn(ie,`No group element found for id "${ie}"`);const Y=MC(ie,re),le=mDe(ie,ae,re);zn(le!==null,`No resize element found for id "${ae}"`),Y[oe.shiftKey?le>0?le-1:Y.length-1:le+1<Y.length?le+1:0].focus();break}}};return Z.addEventListener("keydown",K),()=>{Z.removeEventListener("keydown",K)}},[re,G,ae,ne])}({disabled:n,handleId:N,resizeHandler:F,panelGroupElement:D}),_.createElement(h,{...g,children:t,className:e,id:o,onBlur:()=>{L(!1),i==null||i()},onFocus:()=>{L(!0),l==null||l()},ref:p,role:"separator",style:{touchAction:"none",userSelect:"none",...d},tabIndex:f,[J4e]:S,[RC]:w,[eDe]:"",[Wpt]:E==="drag"?"pointer":I?"keyboard":void 0,[Upt]:!n,[jC]:N,[Zpt]:E})},_De.displayName="PanelGroup",BH.displayName="forwardRef(PanelGroup)",$N.displayName="PanelResizeHandle";var TDe="Toggle",PDe=_.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...i}=t,[a,s]=Ao({prop:n,onChange:o,defaultProp:r??!1,caller:TDe});return y.jsx(_t.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:ut(t.onClick,()=>{t.disabled||s(!a)})})});PDe.displayName=TDe;var EDe=PDe;let RDe;RDe=Po(we("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","data-[state=on]:bg-muted data-[state=on]:text-muted-foreground"),{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted hover:text-muted-foreground"},size:{default:"h-9 px-3",xs:"h-4 w-4",sm:"h-6 px-2",lg:"h-10 px-5"}},defaultVariants:{variant:"default",size:"default"}}),DO=_.forwardRef((t,e)=>{const n=ue.c(13);let r,o,i,a,s,l;return n[0]!==t?({className:r,variant:a,size:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==r||n[6]!==i||n[7]!==a?(s=we(RDe({variant:a,size:i,className:r})),n[5]=r,n[6]=i,n[7]=a,n[8]=s):s=n[8],n[9]!==o||n[10]!==e||n[11]!==s?(l=y.jsx(EDe,{ref:e,className:s,...o}),n[9]=o,n[10]=e,n[11]=s,n[12]=l):l=n[12],l}),DO.displayName=EDe.displayName,BJ=t=>{const e=ue.c(8),{onResize:n,startingWidth:r,minWidth:o,maxWidth:i}=t,a=_.useRef(null),s=_.useRef(null),l=_.useRef(null);let c,u,d;e[0]!==i||e[1]!==o||e[2]!==n?(c=()=>{const g=a.current,v=s.current,b=l.current;if(!g||!v&&!b)return;let p=Number.parseInt(window.getComputedStyle(g).width),O=0,k=!1,S=null;const w=N=>{if(!g||!k||!S)return;const E=N.clientX-O;O=N.clientX,p=S==="left"?p-E:p+E,o&&(p=Math.max(o,p)),i&&(p=Math.min(i,p)),g.style.width=`${p}px`},T=()=>{k&&(n==null||n(p),k=!1,S=null),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",T)},P=(N,E)=>{N.preventDefault(),k=!0,S=E,O=N.clientX,document.addEventListener("mousemove",w),document.addEventListener("mouseup",T)},j=N=>P(N,"left"),D=N=>P(N,"right");return v&&v.addEventListener("mousedown",j),b&&b.addEventListener("mousedown",D),()=>{v&&v.removeEventListener("mousedown",j),b&&b.removeEventListener("mousedown",D),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",T)}},u=[o,i,n],e[0]=i,e[1]=o,e[2]=n,e[3]=c,e[4]=u):(c=e[3],u=e[4]),_.useEffect(c,u),e[5]===Symbol.for("react.memo_cache_sentinel")?(d={left:s,right:l},e[5]=d):d=e[5];const f=r==="contentWidth"?"var(--content-width-medium)":`${r}px`;let h;return e[6]!==f?(h={resizableDivRef:a,handleRefs:d,style:{width:f}},e[6]=f,e[7]=h):h=e[7],h},UJ=function(t){t||window.dispatchEvent(new Event("resize"))};let XU,jDe;MIe=()=>{const t=ue.c(16),[e,n]=ss(H4e),[r,o]=ss(Y4e),[i,a]=ss(Qpt),[s,l]=ss(G4e);let c;t[0]!==o||t[1]!==n?(c=()=>{n(null),o(!1)},t[0]=o,t[1]=n,t[2]=c):c=t[2];const u=c;if(hM(og.CONTEXT_AWARE_PANEL).length===0||!e||!r)return null;let d;t[3]!==s||t[4]!==i||t[5]!==l||t[6]!==a?(d=()=>y.jsxs("div",{className:"flex flex-row items-center gap-3",children:[y.jsx(qn,{content:i?"Unpin panel":"Pin panel",children:y.jsx(DO,{size:"xs",onPressedChange:()=>a(!i),pressed:i,"aria-label":i?"Unpin panel":"Pin panel",children:i?y.jsx(qce,{className:"w-4 h-4"}):y.jsx(E6,{className:"w-4 h-4"})})}),y.jsx(qn,{content:s?y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx("span",{children:"Follow focused table"}),y.jsx("span",{className:"text-xs text-muted-foreground w-64",children:"The panel updates as cells that output tables are focused. Click to fix to the current cell."})]}):y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx("span",{children:"Focus on current table"}),y.jsx("span",{className:"text-xs text-muted-foreground w-64",children:"The panel is focused on the current table. Click to update based on which cell is focused."})]}),children:y.jsx(DO,{size:"xs",onPressedChange:()=>l(!s),pressed:s,"aria-label":s?"Follow focused cell":"Fixed",children:y.jsx(Tce,{className:we("w-4 h-4",s&&"text-primary")})})})]}),t[3]=s,t[4]=i,t[5]=l,t[6]=a,t[7]=d):d=t[7];const f=d;let h;t[8]!==u||t[9]!==f?(h=()=>y.jsxs("div",{className:"mt-2 pb-7 mb-4 h-full overflow-auto",children:[y.jsxs("div",{className:"flex flex-row justify-between items-center mx-2",children:[f(),y.jsx(Ft,{variant:"linkDestructive",size:"icon",onClick:u,"aria-label":"Close selection panel",children:y.jsx(Qa,{className:"w-4 h-4"})})]}),y.jsx(Bh,{children:y.jsx(oG,{name:og.CONTEXT_AWARE_PANEL})})]}),t[8]=u,t[9]=f,t[10]=h):h=t[10];const g=h;if(!i){let p;return t[11]!==g?(p=y.jsx(jDe,{children:g()}),t[11]=g,t[12]=p):p=t[12],p}let v,b;return t[13]===Symbol.for("react.memo_cache_sentinel")?(v=y.jsx($N,{onDragging:UJ,className:"resize-handle border-border z-20 no-print border-l"}),t[13]=v):v=t[13],t[14]!==g?(b=y.jsxs(y.Fragment,{children:[v,y.jsx(AA,{defaultSize:20,minSize:15,maxSize:80,children:g()})]}),t[14]=g,t[15]=b):b=t[15],b},XU=t=>{const e=ue.c(2),{children:n}=t;let r;return e[0]!==n?(r=y.jsx(Bh,{children:y.jsx(jct,{name:og.CONTEXT_AWARE_PANEL,children:n})}),e[0]=n,e[1]=r):r=e[1],r},jDe=t=>{const e=ue.c(10),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={startingWidth:400,minWidth:300,maxWidth:1500},e[0]=r):r=e[0];const{resizableDivRef:o,handleRefs:i,style:a}=BJ(r);let s,l,c;return e[1]!==i.left?(s=y.jsx("div",{ref:i.left,className:"w-1 h-full cursor-col-resize border-l"}),e[1]=i.left,e[2]=s):s=e[2],e[3]!==n||e[4]!==o||e[5]!==a?(l=y.jsx("div",{ref:o,style:a,children:n}),e[3]=n,e[4]=o,e[5]=a,e[6]=l):l=e[6],e[7]!==s||e[8]!==l?(c=y.jsxs("div",{className:"absolute z-40 right-0 h-full bg-background flex flex-row",children:[s,l]}),e[7]=s,e[8]=l,e[9]=c):c=e[9],c},gn={of:t=>JSON.stringify(t),parse(t){if(!t)return{};try{return JSON.parse(t)}catch{return{label:t}}}};function HU(){return Math.floor(1e5*Math.random())}const DDe=["count","sum","mean","median","min","max"],hu={number:hy.number().describe(gn.of({label:"Value"})),string:Pe().min(1).describe(gn.of({label:"Value"})),stringColumnValues:Pe().min(1).describe(gn.of({label:"Value",special:"column_values"})),stringMultiColumnValues:Wt(Pe()).min(1).describe(gn.of({label:"Value",special:"column_values"})),date:hy.date().describe(gn.of({label:"Value",special:"date"})),datetime:hy.date().describe(gn.of({label:"Value",special:"datetime"})),time:Pe().regex(/^\d{2}:\d{2}(:\d{2})?$/).describe(gn.of({label:"Value",special:"time"}))},F4={is_true:[],is_false:[]},B4=t=>({"==":[t],"!=":[t],">":[t],">=":[t],"<":[t],"<=":[t],is_null:[],is_not_null:[]}),W4=B4(hu.number),U4=B4(hu.date),Z4=B4(hu.time),X4=B4(hu.datetime),H4={equals:[hu.stringColumnValues],does_not_equal:[hu.stringColumnValues],contains:[hu.string],regex:[hu.string],starts_with:[hu.string],ends_with:[hu.string],in:[hu.stringMultiColumnValues],is_null:[],is_not_null:[]},amt={...F4,...W4,...U4,...Z4,...X4,...H4};function ADe(t){return t?t.startsWith("int")?"integer":t.startsWith("float")||t.startsWith("uint")||t.startsWith("number")||t.startsWith("complex")?"number":t.startsWith("string")||t.startsWith("object")||t.startsWith("utf8")?"string":t.startsWith("datetime")?"datetime":t.startsWith("time")?"time":t.startsWith("date")?"date":t.startsWith("bool")?"boolean":"unknown":"unknown"}function MDe(t){if(!t)return[];switch(ADe(t)){case"integer":case"number":return Object.keys(W4);case"string":return Object.keys(H4);case"date":return Object.keys(U4);case"datetime":return Object.keys(X4);case"time":return Object.keys(Z4);case"boolean":return Object.keys(F4);case"unknown":return[]}}const mc=(t,e)=>t[e]?t[e]:[],Y4=Wt(sf([hy.string(),sf([un(r4),Pe()])])),ox=Pe().min(1,"Required").or(yt()).transform(t=>t).describe(gn.of({label:"Column",special:"column_id"})),$C=Wt(ox.describe(gn.of({special:"column_id"}))).min(1,"At least one column is required").default([]).describe(gn.of({label:"Columns"})),smt=Qe({type:Jr("column_conversion"),column_id:ox,data_type:un(["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","complex64","complex128","bool","object","str","unicode","datetime64","timedelta64"]).describe(gn.of({label:"Data type (numpy)"})).default("bool"),errors:un(["ignore","raise"]).default("ignore").describe(gn.of({label:"Handle errors",special:"radio_group"}))}).describe(gn.of({})),lmt=Qe({type:Jr("rename_column"),column_id:ox,new_column_id:Pe().min(1,"Required").transform(t=>t).describe(gn.of({label:"New column name"}))}),cmt=Qe({type:Jr("sort_column"),column_id:ox,ascending:pt().describe(gn.of({label:"Ascending"})).default(!0),na_position:un(["first","last"]).describe(gn.of({label:"N/A position",special:"radio_group"})).default("last")}),YU=Qe({column_id:ox,operator:un(Object.keys(amt)).describe(gn.of({label:" "})),value:El().describe(gn.of({label:"Value"}))}).describe(gn.of({direction:"row",special:"column_filter"})),umt=Qe({type:Jr("filter_rows"),operation:un(["keep_rows","remove_rows"]).default("keep_rows").describe(gn.of({special:"radio_group"})),where:Wt(YU).min(1).transform(t=>t.filter(e=>function(n,r){const o=[mc(F4,n),mc(U4,n),mc(Z4,n),mc(X4,n),mc(W4,n),mc(H4,n)].flat();return o.length===0||o.some(i=>i.safeParse(r).success)}(e.operator,e.value))).describe(gn.of({label:"Value"})).default([{column_id:"",operator:"==",value:""}])}),dmt=Qe({type:Jr("group_by"),column_ids:$C,aggregation:un(DDe).default("count").describe(gn.of({label:"Aggregation"})),drop_na:pt().default(!1).describe(gn.of({label:"Drop N/A"}))}).describe(gn.of({})),fmt=Qe({type:Jr("aggregate"),column_ids:$C,aggregations:Wt(un(DDe)).min(1,"At least one aggregation is required").default(["count"]).describe(gn.of({label:"Aggregations"}))}).describe(gn.of({direction:"row"})),hmt=Qe({type:Jr("select_columns"),column_ids:$C}),pmt=Qe({type:Jr("sample_rows"),n:yt().positive().describe(gn.of({label:"Number of rows"})),seed:yt().default(()=>HU()).describe(gn.of({label:"Re-sample",special:"random_number_button"})),replace:pt().default(!1).describe(gn.of({label:"Sample with replacement"}))}),mmt=Qe({type:Jr("shuffle_rows"),seed:yt().default(()=>HU()).describe(gn.of({label:"Re-shuffle",special:"random_number_button"}))}),gmt=Qe({type:Jr("explode_columns"),column_ids:$C}),vmt=Qe({type:Jr("expand_dict"),column_id:ox}),ymt=Qe({type:Jr("unique"),column_ids:$C,keep:un(["first","last","none","any"]).default("first").describe(gn.of({label:"Keep"}))}).describe(gn.of({direction:"row"})),GU=or([umt,hmt,lmt,smt,cmt,dmt,fmt,pmt,mmt,gmt,vmt,ymt]),bmt=Qe({transforms:Wt(GU)}),Oh=or([yt(),tte(),Pe()]).nullable(),NDe=Qe({total:yt().nullable(),nulls:yt().nullable(),unique:yt().nullable(),true:yt().nullable(),false:yt().nullable(),min:Oh,max:Oh,std:Oh,mean:Oh,median:Oh,p5:Oh,p25:Oh,p75:Oh,p95:Oh}),xmt=Wt(Qe({bin_start:yt(),bin_end:yt(),count:yt()})),Omt=lu("marimo-table").withData(Qe({initialValue:or([Wt(yt()),Wt(Qe({rowId:Pe(),columnName:Pe()}))]),label:Pe().nullable(),data:or([Pe(),Wt(Qe({}).passthrough())]),totalRows:or([yt(),Jr(QS)]),pagination:pt().default(!1),pageSize:yt().default(10),selection:un(["single","multi","single-cell","multi-cell"]).nullable().default(null),showDownload:pt().default(!1),showFilters:pt().default(!1),showColumnSummaries:or([pt(),un(["stats","chart"])]).default(!0),showDataTypes:pt().default(!0),showPageSizeSelector:pt().default(!0),showColumnExplorer:pt().default(!0),showChartBuilder:pt().default(!0),rowHeaders:Y4,freezeColumnsLeft:Wt(Pe()).optional(),freezeColumnsRight:Wt(Pe()).optional(),textJustifyColumns:ds(un(["left","center","right"])).optional(),wrappedColumns:Wt(Pe()).optional(),fieldTypes:Y4.nullish(),totalColumns:yt(),maxColumns:or([yt(),Jr("all")]).default("all"),hasStableRowId:pt().default(!1),cellStyles:ds(ds(Qe({}).passthrough())).optional(),lazy:pt().default(!1),preload:pt().default(!1)})).withFunctions({download_as:_i.input(Qe({format:un(["csv","json","parquet"])})).output(Pe()),get_column_summaries:_i.input(Qe({precompute:pt()})).output(Qe({data:or([Pe(),Wt(Qe({}).passthrough())]).nullable(),stats:ds(Pe(),NDe),bin_values:ds(Pe(),xmt),is_disabled:pt().optional()})),search:_i.input(Qe({sort:Qe({by:Pe(),descending:pt()}).optional(),query:Pe().optional(),filters:Wt(YU).optional(),page_number:yt(),page_size:yt(),max_columns:yt().nullable().optional()})).output(Qe({data:or([Pe(),Wt(Qe({}).passthrough())]),total_rows:or([yt(),Jr(QS)]),cell_styles:ds(ds(Qe({}).passthrough())).nullable()})),get_row_ids:_i.input(Qe({}).passthrough()).output(Qe({row_ids:Wt(yt()),all_rows:pt(),error:Pe().nullable()})),get_data_url:_i.input(Qe({}).passthrough()).output(Qe({data_url:or([Pe(),Wt(Qe({}).passthrough())]),format:un(["csv","json","arrow"])})),calculate_top_k_rows:_i.input(Qe({column:Pe(),k:yt()})).output(Qe({data:Wt(sf([El(),yt()]))})),preview_column:_i.input(Qe({column:Pe()})).output(Qe({chart_spec:Pe().nullable(),chart_code:Pe().nullable(),error:Pe().nullable(),missing_packages:Wt(Pe()).nullable(),stats:NDe.nullable()}))}).renderer(t=>y.jsx($De,{children:y.jsx(wmt,{isLazy:t.data.lazy,preload:t.data.preload,children:y.jsx(KU,{...t.data,...t.functions,host:t.host,enableSearch:!0,data:t.data.data,value:t.value,setValue:t.setValue})})})),wmt=t=>{const e=ue.c(1),{isLazy:n,children:r,preload:o}=t,[i,a]=_.useState(n&&!o);if(i){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsx("div",{className:"flex h-20 items-center justify-center",children:y.jsxs(Ft,{variant:"outline",size:"xs",onClick:()=>a(!1),children:[y.jsx(lee,{className:"mr-2 h-4 w-4"}),"Preview data"]})}),e[0]=s):s=e[0],s}return r},KU=_.memo(t=>{const e=ue.c(97);let n;e[0]!==t.host?(n=function(De){let nt=null;const Fe=Xs.findElement(De);return Fe&&(nt=Xs.parse(Fe.id)),nt}(t.host),e[0]=t.host,e[1]=n):n=e[1];const r=n,o=t.search,i=t.setValue;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[2]=a):a=e[2];const[s,l]=_.useState(a);let c;e[3]!==t.pageSize?(c={pageSize:t.pageSize,pageIndex:0},e[3]=t.pageSize,e[4]=c):c=e[4];const[u,d]=ge.useState(c),[f,h]=_.useState("");let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[5]=g):g=e[5];const[v,b]=_.useState(g);let p;e[6]!==r||e[7]!==t.showChartBuilder?(p=()=>!(!t.showChartBuilder||!r)&&function(De){const nt=Cpt.get(De);return!!nt&&nt.length>0}(r),e[6]=r,e[7]=t.showChartBuilder,e[8]=p):p=e[8];const[O,k]=_.useState(p);let S,w,T,P,j;e[9]!==t.hasStableRowId||e[10]!==i?(S=()=>{t.hasStableRowId||i([])},e[9]=t.hasStableRowId,e[10]=i,e[11]=S):S=e[11],e[12]!==v||e[13]!==t.hasStableRowId||e[14]!==f||e[15]!==i||e[16]!==s?(w=[i,v,f,s,t.hasStableRowId],e[12]=v,e[13]=t.hasStableRowId,e[14]=f,e[15]=i,e[16]=s,e[17]=w):w=e[17],function(De,nt){const Fe=ue.c(2),kt=_.useRef(!1);let Re;Fe[0]!==De?(Re=()=>{kt.current?De():kt.current=!0},Fe[0]=De,Fe[1]=Re):Re=Fe[1],_.useEffect(Re,nt)}(S,w),e[18]!==t.pageSize?(T=()=>{d({pageIndex:0,pageSize:t.pageSize})},P=[t.pageSize],e[18]=t.pageSize,e[19]=T,e[20]=P):(T=e[19],P=e[20]),_.useEffect(T,P),e[21]!==v||e[22]!==u.pageIndex||e[23]!==u.pageSize||e[24]!==t.cellStyles||e[25]!==t.data||e[26]!==t.lazy||e[27]!==t.pageSize||e[28]!==t.totalRows||e[29]!==o||e[30]!==f||e[31]!==s[0]||e[32]!==s.length?(j=async()=>{if(t.totalRows===0)return{rows:Lc.EMPTY,totalRows:0,cellStyles:{}};let De=t.data,nt=t.totalRows,Fe=t.cellStyles;const kt=u.pageSize!==t.pageSize,Re=f===""&&u.pageIndex===0&&v.length===0&&s.length===0&&!t.lazy&&!kt;s.length>1&&Ve.warn("Multiple sort columns are not supported");const ot=o({sort:s.length>0?{by:s[0].id,descending:s[0].desc}:void 0,query:f,page_number:u.pageIndex,page_size:u.pageSize,filters:v.flatMap(Smt)});if(Re)ot.catch(Cmt);else{const Me=await ot;De=Me.data,nt=Me.total_rows,Fe=Me.cell_styles||{}}return De=await Fke(De),{rows:De,totalRows:nt,cellStyles:Fe}},e[21]=v,e[22]=u.pageIndex,e[23]=u.pageSize,e[24]=t.cellStyles,e[25]=t.data,e[26]=t.lazy,e[27]=t.pageSize,e[28]=t.totalRows,e[29]=o,e[30]=f,e[31]=s[0],e[32]=s.length,e[33]=j):j=e[33];const D=Gd(t.fieldTypes);let N;e[34]!==v||e[35]!==u.pageIndex||e[36]!==u.pageSize||e[37]!==t.data||e[38]!==t.lazy||e[39]!==t.totalRows||e[40]!==o||e[41]!==f||e[42]!==s||e[43]!==D?(N=[s,o,v,f,D,t.data,t.totalRows,t.lazy,u.pageSize,u.pageIndex],e[34]=v,e[35]=u.pageIndex,e[36]=u.pageSize,e[37]=t.data,e[38]=t.lazy,e[39]=t.totalRows,e[40]=o,e[41]=f,e[42]=s,e[43]=D,e[44]=N):N=e[44];const{data:E,error:A,isPending:I,isFetching:L}=$a(j,N);let F;e[45]!==v||e[46]!==o||e[47]!==f||e[48]!==s[0]||e[49]!==s.length?(F=async De=>{const nt=await o({page_number:De,page_size:1,sort:s.length>0?{by:s[0].id,descending:s[0].desc}:void 0,query:f,filters:v.flatMap(_mt),max_columns:null});return{rows:await Fke(nt.data)}},e[45]=v,e[46]=o,e[47]=f,e[48]=s[0],e[49]=s.length,e[50]=F):F=e[50];const Q=F;let W;e[51]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{d(Tmt)},e[51]=W):W=e[51];const U=E==null?void 0:E.totalRows;let X,G;e[52]!==U?(X=[U],e[52]=U,e[53]=X):X=e[53],_.useEffect(W,X),e[54]===Symbol.for("react.memo_cache_sentinel")?(G=RT("performant_table_charts"),e[54]=G):G=e[54];const ae=G;let ne,re;e[55]!==t?(ne=async()=>t.totalRows!==0&&t.showColumnSummaries?t.get_column_summaries({precompute:ae}):{data:null,stats:{},bin_values:{}},e[55]=t,e[56]=ne):ne=e[56],e[57]!==v||e[58]!==t.data||e[59]!==t.get_column_summaries||e[60]!==t.showColumnSummaries||e[61]!==t.totalRows||e[62]!==f?(re=[t.get_column_summaries,t.showColumnSummaries,v,f,t.totalRows,t.data],e[57]=v,e[58]=t.data,e[59]=t.get_column_summaries,e[60]=t.showColumnSummaries,e[61]=t.totalRows,e[62]=f,e[63]=re):re=e[63];const{data:Z,error:K}=$a(ne,re);let oe,ie;if(e[64]!==K?(oe=()=>{K&&Ve.error(K)},ie=[K],e[64]=K,e[65]=oe,e[66]=ie):(oe=e[65],ie=e[66]),_.useEffect(oe,ie),I){const De=t.totalRows!==QS&&t.totalRows>0?t.totalRows:t.pageSize;let nt;return e[67]!==De?(nt=y.jsx($_,{milliseconds:200,children:y.jsx(lje,{pageSize:De})}),e[67]=De,e[68]=nt):nt=e[68],nt}let Y,le=null;if(A){let De;Ve.error(A),e[69]!==A?(De=!I_()&&y.jsxs(Qv,{variant:"destructive",className:"mb-2",children:[y.jsx(Lv,{children:"Error"}),y.jsx("div",{className:"text-md",children:A.message||"An unknown error occurred"})]}),e[69]=A,e[70]=De):De=e[70],le=De}e[71]!==O?(Y=()=>{k(!O)},e[71]=O,e[72]=Y):Y=e[72];const me=Y,ce=(E==null?void 0:E.rows)??Lc.EMPTY,ve=L&&!I,ye=(E==null?void 0:E.totalRows)??t.totalRows,_e=(E==null?void 0:E.cellStyles)??t.cellStyles;let Se;e[73]!==r||e[74]!==Z||e[75]!==v||e[76]!==Q||e[77]!==u||e[78]!==t||e[79]!==f||e[80]!==s||e[81]!==ce||e[82]!==ve||e[83]!==ye||e[84]!==_e||e[85]!==me?(Se=y.jsx(kmt,{...t,data:ce,columnSummaries:Z,sorting:s,setSorting:l,searchQuery:f,setSearchQuery:h,filters:v,setFilters:b,reloading:ve,totalRows:ye,paginationState:u,setPaginationState:d,cellStyles:_e,toggleDisplayHeader:me,getRow:Q,cellId:r}),e[73]=r,e[74]=Z,e[75]=v,e[76]=Q,e[77]=u,e[78]=t,e[79]=f,e[80]=s,e[81]=ce,e[82]=ve,e[83]=ye,e[84]=_e,e[85]=me,e[86]=Se):Se=e[86];const Ae=Se;let je,Ie;return e[87]!==r||e[88]!==Ae||e[89]!==O||e[90]!==t.fieldTypes||e[91]!==t.get_data_url||e[92]!==t.showChartBuilder?(je=t.showChartBuilder?y.jsx(_pt,{displayHeader:O,dataTable:Ae,getDataUrl:t.get_data_url,fieldTypes:t.fieldTypes,cellId:r}):Ae,e[87]=r,e[88]=Ae,e[89]=O,e[90]=t.fieldTypes,e[91]=t.get_data_url,e[92]=t.showChartBuilder,e[93]=je):je=e[93],e[94]!==le||e[95]!==je?(Ie=y.jsxs(y.Fragment,{children:[le,je]}),e[94]=le,e[95]=je,e[96]=Ie):Ie=e[96],Ie});KU.displayName="LoadingDataTableComponent";const kmt=({label:t,data:e,totalRows:n,maxColumns:r,pagination:o,selection:i,value:a,showFilters:s,showDownload:l,showPageSizeSelector:c,showColumnExplorer:u,showChartBuilder:d,showDataTypes:f,rowHeaders:h,fieldTypes:g,paginationState:v,setPaginationState:b,download_as:p,columnSummaries:O,className:k,setValue:S,sorting:w,setSorting:T,enableSearch:P,searchQuery:j,setSearchQuery:D,filters:N,setFilters:E,reloading:A,freezeColumnsLeft:I,freezeColumnsRight:L,textJustifyColumns:F,wrappedColumns:Q,totalColumns:W,get_row_ids:U,cellStyles:X,toggleDisplayHeader:G,calculate_top_k_rows:ae,preview_column:ne,getRow:re,cellId:Z})=>{const K=_.useId(),[oe,ie]=_.useState(0),{isPanelOpen:Y,togglePanel:le}=function(Me,We){const it=ue.c(12);let Ue=Gr(G4e);const{focusCell:gt}=PJ(),Tt=PT(),[Kt,Sn]=ss(Ipt),[Jt,sn]=ss(H4e),[jn,Zr]=ss(Y4e),Nr=function(Mt,Dt){return Dt?`${Dt}-${Mt}`:Mt}(Me,We);!We&&Ue&&(Ve.error("CellId is not found, defaulting to fixed mode"),Ue=!1);const go=Mt=>Jt===Nr&&jn&&Mt===Kt,Pi=Tt===We,Xr=Jt&&function(Mt,Dt){return!!Dt&&Mt.startsWith(Dt)}(Jt,We);let at;Ue&&Pi&&Jt!==Nr&&!Xr&&sn(Nr),it[0]!==We||it[1]!==gt||it[2]!==Ue||it[3]!==go||it[4]!==Nr||it[5]!==Zr||it[6]!==sn||it[7]!==Sn?(at=function(Mt){go(Mt)?(sn(null),Zr(!1)):(sn(Nr),Ue&&We&>({cellId:We}),Zr(!0),Sn(Mt))},it[0]=We,it[1]=gt,it[2]=Ue,it[3]=go,it[4]=Nr,it[5]=Zr,it[6]=sn,it[7]=Sn,it[8]=at):at=it[8];const Ne=at;let vt;return it[9]!==go||it[10]!==Ne?(vt={isPanelOpen:go,togglePanel:Ne},it[9]=go,it[10]=Ne,it[11]=vt):vt=it[11],vt}(K,Z),me=_.useMemo(()=>{if(!O||!g||!O.stats)return db.EMPTY;const Me=uz(g);return new db(O.data||[],Me,O.stats,O.bin_values,{includeCharts:!!O.data,usePreComputedValues:RT("performant_table_charts")})},[g,O]),ce=Gd(g??Aj(e)),ve=_.useMemo(()=>r==="all"?ce:ce.slice(0,r),[r,ce]),ye=Gd(h),_e=Gd(F),Se=Gd(Q),Ae=Gd(me),je=ve.length;g||(f=!1);const Ie=_.useMemo(()=>Qke({rowHeaders:ye,selection:i,chartSpecModel:Ae,fieldTypes:ve,textJustifyColumns:_e,wrappedColumns:Se,showDataTypes:f,calculateTopKRows:ae}),[i,f,Ae,ye,ve,_e,Se,ae]),De=_.useMemo(()=>Object.fromEntries((a||[]).map(Me=>[Me,!0])),[a]),nt=Fn(Me=>{if(i==="single"){const We=Zi.asUpdater(Me)({});S(Object.keys(We).slice(0,1))}if(i==="multi"){const We=Zi.asUpdater(Me)(De);S(Object.keys(We))}}),Fe=a.filter(Me=>Me instanceof Object&&Me.columnName!==void 0),kt=Fn(Me=>{if(i==="single-cell"){const We=Zi.asUpdater(Me)(Fe);S(We.slice(0,1))}if(i==="multi-cell"){const We=Zi.asUpdater(Me)(Fe);S(We)}}),Re=i==="multi"||i==="single",ot=u&&ne&&Y("column-explorer");return y.jsxs(y.Fragment,{children:[n===QS&&v.pageSize===e.length&&y.jsxs(Km,{className:"mb-1 rounded",children:["Previewing the first ",v.pageSize," rows."]}),je<W&&je>0&&y.jsxs(Km,{className:"mb-1 rounded",children:["Result clipped. Showing ",je," of ",W," columns."]}),(O==null?void 0:O.is_disabled)&&y.jsx(Km,{className:"mb-1 rounded",children:"Column summaries are unavailable. Filter your data to fewer than 1,000,000 rows."}),Y("row-viewer")&&y.jsx(XU,{children:y.jsx(Lpt,{getRow:re,fieldTypes:ce,totalRows:n,rowIdx:oe,setRowIdx:ie,isSelectable:Re,isRowSelected:De[oe],handleRowSelectionChange:nt})}),ot&&y.jsx(XU,{children:y.jsx(Dpt,{previewColumn:ne,fieldTypes:ce,totalRows:n,totalColumns:W,tableId:K})}),y.jsx(Dke,{value:me,children:y.jsx(Jo,{label:t,align:"top",fullWidth:!0,children:y.jsx(oV,{data:e,columns:Ie,className:k,sorting:w,totalRows:n,totalColumns:W,manualSorting:!0,setSorting:T,pagination:o,manualPagination:!0,selection:i,paginationState:v,setPaginationState:b,rowSelection:De,cellSelection:Fe,cellStyling:X,downloadAs:l?p:void 0,enableSearch:P,searchQuery:j,onSearchQueryChange:D,showFilters:s,filters:N,onFiltersChange:E,reloading:A,onRowSelectionChange:nt,freezeColumnsLeft:I,freezeColumnsRight:L,onCellSelectionChange:kt,getRowIds:U,toggleDisplayHeader:G,showChartBuilder:d,showPageSizeSelector:c,showColumnExplorer:u,togglePanel:le,isPanelOpen:Y,viewedRowIdx:oe,onViewedRowChange:Me=>ie(Me)})})})]})},$De=t=>{const e=ue.c(2),{children:n}=t;let r;return e[0]!==n?(r=y.jsx(Hv,{store:Ht,children:y.jsx(XEe,{controller:Vb,children:y.jsx(zO,{children:n})})}),e[0]=n,e[1]=r):r=e[1],r};function Smt(t){return Gxe(t.id,t.value)}function Cmt(t){Ve.error(t)}function _mt(t){return Gxe(t.id,t.value)}function Tmt(t){return t.pageIndex===0?t:{...t,pageIndex:0}}const Pmt=t=>{const e=ue.c(10);let n,r,o;e[0]!==t?({className:n,offset:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const i=o===void 0?4:o;let a,s;return e[4]!==n?(a=cd(n,Emt),e[4]=n,e[5]=a):a=e[5],e[6]!==i||e[7]!==r||e[8]!==a?(s=y.jsx($ye,{offset:i,className:a,...r}),e[6]=i,e[7]=r,e[8]=a,e[9]=s):s=e[9],s};function Emt(t){return we("z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none","data-[entering]:animate-in data-[entering]:fade-in-0 data-[entering]:zoom-in-95","data-[exiting]:animate-out data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95","data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2",t)}const G4=t=>{const e=ue.c(11),{direction:n}=Mi();let r,o,i,a,s,l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=we(fs({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50","data-[hovered]:opacity-100"),e[0]=r):r=e[0],e[1]!==n?(o=y.jsx(hS,{slot:"previous",className:r,children:n==="rtl"?y.jsx(Qh,{"aria-hidden":!0,className:"size-4"}):y.jsx(ty,{"aria-hidden":!0,className:"size-4"})}),e[1]=n,e[2]=o):o=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(Zye,{className:"grow text-center text-sm font-medium"}),e[3]=i):i=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(a=we(fs({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50","data-[hovered]:opacity-100"),e[4]=a):a=e[4],e[5]!==n?(s=y.jsx(hS,{slot:"next",className:a,children:n==="rtl"?y.jsx(ty,{"aria-hidden":!0,className:"size-4"}):y.jsx(Qh,{"aria-hidden":!0,className:"size-4"})}),e[5]=n,e[6]=s):s=e[6],e[7]!==t||e[8]!==o||e[9]!==s?(l=y.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",...t,children:[o,i,s]}),e[7]=t,e[8]=o,e[9]=s,e[10]=l):l=e[10],l},K4=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we(" border-separate border-spacing-x-0 border-spacing-y-1 ",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(dGe,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},J4=t=>{const e=ue.c(4);let n,r;return e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1],e[2]!==n?(r=y.jsx(Aye,{...n}),e[2]=n,e[3]=r):r=e[3],r},eD=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(Mye,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},tD=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("[&>tr>td]:p-0",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(t9,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},nD=t=>{const e=ue.c(11);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const o=!!_.use(vS);let i,a,s;return e[3]!==o?(i=(l,c)=>we(fs({variant:"ghost"}),"relative flex size-9 items-center justify-center p-0 text-sm font-normal",c.isDisabled&&"text-muted-foreground opacity-50",c.isSelected&&"bg-primary text-primary-foreground data-[focused]:bg-primary data-[focused]:text-primary-foreground",c.isHovered&&c.isSelected&&(c.isSelectionStart||c.isSelectionEnd||!o)&&"data-[hovered]:bg-primary data-[hovered]:text-primary-foreground",c.isSelected&&o&&!c.isSelectionStart&&!c.isSelectionEnd&&"rounded-none bg-accent text-accent-foreground",c.isOutsideMonth&&"text-muted-foreground opacity-50 data-[selected]:bg-accent/50 data-[selected]:text-muted-foreground data-[selected]:opacity-30",c.date.compare(p3(m3()))===0&&!c.isSelected&&"bg-accent text-accent-foreground",c.isUnavailable&&"cursor-default text-destructive ",c.isInvalid&&"bg-destructive text-destructive-foreground data-[focused]:bg-destructive data-[hovered]:bg-destructive data-[focused]:text-destructive-foreground data-[hovered]:text-destructive-foreground",l),e[3]=o,e[4]=i):i=e[4],e[5]!==n||e[6]!==i?(a=cd(n,i),e[5]=n,e[6]=i,e[7]=a):a=e[7],e[8]!==r||e[9]!==a?(s=y.jsx(Nye,{className:a,...r}),e[8]=r,e[9]=a,e[10]=s):s=e[10],s},Rmt=t=>{const e=ue.c(14);let n,r,o,i,a,s,l,c;return e[0]!==t?({errorMessage:r,className:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==n?(i=cd(n,Dmt),e[4]=n,e[5]=i):i=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(G4,{}),e[6]=a):a=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs(K4,{children:[y.jsx(J4,{children:Amt}),y.jsx(tD,{children:Mmt})]}),e[7]=s):s=e[7],e[8]!==r?(l=r&&y.jsx(B1,{className:"text-sm text-destructive",slot:"errorMessage",children:r}),e[8]=r,e[9]=l):l=e[9],e[10]!==o||e[11]!==i||e[12]!==l?(c=y.jsxs(cGe,{className:i,...o,children:[a,s,l]}),e[10]=o,e[11]=i,e[12]=l,e[13]=c):c=e[13],c},jmt=t=>{const e=ue.c(14);let n,r,o,i,a,s,l,c;return e[0]!==t?({errorMessage:r,className:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==n?(i=cd(n,Nmt),e[4]=n,e[5]=i):i=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(G4,{}),e[6]=a):a=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs(K4,{children:[y.jsx(J4,{children:$mt}),y.jsx(tD,{children:Imt})]}),e[7]=s):s=e[7],e[8]!==r?(l=r&&y.jsx(B1,{slot:"errorMessage",className:"text-sm text-destructive",children:r}),e[8]=r,e[9]=l):l=e[9],e[10]!==o||e[11]!==i||e[12]!==l?(c=y.jsxs(uGe,{className:i,...o,children:[a,s,l]}),e[10]=o,e[11]=i,e[12]=l,e[13]=c):c=e[13],c};function Dmt(t){return we("w-fit",t)}function Amt(t){return y.jsx(eD,{children:t})}function Mmt(t){return y.jsx(nD,{date:t})}function Nmt(t){return we("w-fit",t)}function $mt(t){return y.jsx(eD,{children:t})}function Imt(t){return y.jsx(nD,{date:t})}let IDe,JU,eZ,tZ,nZ,QDe,rD;IDe=Po(["text-sm font-medium leading-none","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70","group-data-[invalid]:text-destructive"]),JU=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we(IDe(),n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(KYe,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},U6e=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("text-sm text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(B1,{className:o,...r,slot:"description"}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},eZ=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("text-sm font-medium text-destructive",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(tGe,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},tZ=Po("",{variants:{variant:{default:["relative flex w-full items-center overflow-hidden rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background",fj(),"data-[focus-within]:outline-none data-[focus-within]:ring-2 data-[focus-within]:ring-ring data-[focus-within]:ring-offset-2","data-[disabled]:opacity-50"],ghost:""}},defaultVariants:{variant:"default"}}),nZ=t=>{const e=ue.c(12);let n,r,o,i,a,s;return e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==o?(i=l=>we(tZ({variant:o}),l),e[4]=o,e[5]=i):i=e[5],e[6]!==n||e[7]!==i?(a=cd(n,i),e[6]=n,e[7]=i,e[8]=a):a=e[8],e[9]!==r||e[10]!==a?(s=y.jsx(Dye,{className:a,...r}),e[9]=r,e[10]=a,e[11]=s):s=e[11],s},QDe=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=cd(n,Qmt),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(zye,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},rD=t=>{const e=ue.c(12);let n,r,o,i,a,s;return e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==o?(i=l=>we(tZ({variant:o}),"text-sm",l),e[4]=o,e[5]=i):i=e[5],e[6]!==n||e[7]!==i?(a=cd(n,i),e[6]=n,e[7]=i,e[8]=a):a=e[8],e[9]!==r||e[10]!==a?(s=y.jsx(Qye,{className:a,...r,children:Lmt}),e[9]=r,e[10]=a,e[11]=s):s=e[11],s};function Qmt(t){return we("type-literal:px-0 inline rounded p-0.5 caret-transparent outline outline-0","data-[placeholder]:text-muted-foreground","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","data-[focused]:bg-accent data-[focused]:text-accent-foreground focus:bg-accent focus:text-accent-foreground","data-[invalid]:data-[focused]:bg-destructive data-[invalid]:data-[focused]:data-[placeholder]:text-destructive-foreground data-[invalid]:data-[focused]:text-destructive-foreground data-[invalid]:data-[placeholder]:text-destructive data-[invalid]:text-destructive",t)}function Lmt(t){return y.jsx(QDe,{segment:t})}const LDe=t=>{const e=ue.c(14);let n,r,o,i,a,s,l;return e[0]!==t?({className:n,popoverClassName:r,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==r?(i=cd(r,Vmt),e[4]=r,e[5]=i):i=e[5],e[6]!==n?(a=we("flex w-full flex-col space-y-4 outline-none sm:flex-row sm:space-x-4 sm:space-y-0",n),e[6]=n,e[7]=a):a=e[7],e[8]!==o||e[9]!==a?(s=y.jsx(Iye,{className:a,...o}),e[8]=o,e[9]=a,e[10]=s):s=e[10],e[11]!==i||e[12]!==s?(l=y.jsx(Pmt,{className:i,children:s}),e[11]=i,e[12]=s,e[13]=l):l=e[13],l},zDe=t=>{const e=ue.c(26);let n,r,o,i,a;e[0]!==t?({label:i,description:r,errorMessage:o,className:n,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5]);const[s,l]=_.useState(!1);let c,u,d,f,h,g,v,b,p,O;return e[6]!==n?(c=cd(n,qmt),e[6]=n,e[7]=c):c=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(u=k=>{l(k)},e[8]=u):u=e[8],e[9]!==i?(d=i&&y.jsx(JU,{children:i}),e[9]=i,e[10]=d):d=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(rD,{"aria-label":"date input",className:"flex-1",variant:"ghost"}),e[11]=f):f=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsxs(nZ,{children:[f,y.jsx(hS,{onPressChange:()=>{l(!0)},className:we(fs({variant:"text",size:"icon"}),"ml-1 size-6 data-[focus-visible]:ring-offset-0"),children:y.jsx(aO,{"aria-hidden":!0,className:"size-4"})})]}),e[12]=h):h=e[12],e[13]!==r?(g=r&&y.jsx(B1,{className:"text-sm text-muted-foreground",slot:"description",children:r}),e[13]=r,e[14]=g):g=e[14],e[15]!==o?(v=y.jsx(eZ,{children:o}),e[15]=o,e[16]=v):v=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsx(G4,{}),e[17]=b):b=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(p=y.jsx(LDe,{children:y.jsxs(Rmt,{children:[b,y.jsxs(K4,{children:[y.jsx(J4,{children:Fmt}),y.jsx(tD,{children:Bmt})]})]})}),e[18]=p):p=e[18],e[19]!==s||e[20]!==a||e[21]!==c||e[22]!==d||e[23]!==g||e[24]!==v?(O=y.jsxs(Wye,{isOpen:s,className:c,onOpenChange:u,...a,children:[d,h,g,v,p]}),e[19]=s,e[20]=a,e[21]=c,e[22]=d,e[23]=g,e[24]=v,e[25]=O):O=e[25],O},zmt=t=>{const e=ue.c(28);let n,r,o,i,a;e[0]!==t?({label:i,description:r,errorMessage:o,className:n,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5]);const[s,l]=_.useState(!1);let c,u,d,f,h,g,v,b,p,O,k,S;return e[6]!==n?(c=cd(n,Wmt),e[6]=n,e[7]=c):c=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(u=w=>{l(w)},e[8]=u):u=e[8],e[9]!==i?(d=i&&y.jsx(JU,{children:i}),e[9]=i,e[10]=d):d=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(rD,{variant:"ghost",slot:"start"}),h=y.jsx("span",{"aria-hidden":!0,className:"px-2 text-sm text-muted-foreground",children:"-"}),g=y.jsx(rD,{className:"flex-1",variant:"ghost",slot:"end"}),e[11]=f,e[12]=h,e[13]=g):(f=e[11],h=e[12],g=e[13]),e[14]===Symbol.for("react.memo_cache_sentinel")?(v=y.jsxs(nZ,{children:[f,h,g,y.jsx(hS,{onPressChange:()=>{l(!0)},className:we(fs({variant:"text",size:"icon"}),"ml-1 size-6 data-[focus-visible]:ring-offset-0"),children:y.jsx(aO,{"aria-hidden":!0,className:"size-4"})})]}),e[14]=v):v=e[14],e[15]!==r?(b=r&&y.jsx(B1,{className:"text-sm text-muted-foreground",slot:"description",children:r}),e[15]=r,e[16]=b):b=e[16],e[17]!==o?(p=y.jsx(eZ,{children:o}),e[17]=o,e[18]=p):p=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(G4,{}),e[19]=O):O=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsx(LDe,{children:y.jsxs(jmt,{children:[O,y.jsxs(K4,{children:[y.jsx(J4,{children:Umt}),y.jsx(tD,{children:Zmt})]})]})}),e[20]=k):k=e[20],e[21]!==s||e[22]!==a||e[23]!==c||e[24]!==d||e[25]!==b||e[26]!==p?(S=y.jsxs(Uye,{isOpen:s,className:c,onOpenChange:u,...a,children:[d,v,b,p,k]}),e[21]=s,e[22]=a,e[23]=c,e[24]=d,e[25]=b,e[26]=p,e[27]=S):S=e[27],S};function Vmt(t){return we("w-auto p-3",t)}function qmt(t){return we("group flex flex-col gap-2",t)}function Fmt(t){return y.jsx(eD,{children:t})}function Bmt(t){return y.jsx(nD,{date:t})}function Wmt(t){return we("group flex flex-col gap-2",t)}function Umt(t){return y.jsx(eD,{children:t})}function Zmt(t){return y.jsx(nD,{date:t})}const Xmt=t=>{const e=ue.c(19);let n;e[0]!==t?(n=f=>{if(!f)return;const h=f.toString();t.setValue(h)},e[0]=t,e[1]=n):n=e[1];const r=n,o=t.label,i=t.fullWidth;let a;e[2]!==t.value?(a=r0(t.value),e[2]=t.value,e[3]=a):a=e[3];const s=t.label??"date picker";let l,c,u,d;return e[4]!==t.start?(l=r0(t.start),e[4]=t.start,e[5]=l):l=e[5],e[6]!==t.stop?(c=r0(t.stop),e[6]=t.stop,e[7]=c):c=e[7],e[8]!==r||e[9]!==t.disabled||e[10]!==a||e[11]!==s||e[12]!==l||e[13]!==c?(u=y.jsx(zDe,{granularity:"day",value:a,onChange:r,"aria-label":s,minValue:l,maxValue:c,isDisabled:t.disabled}),e[8]=r,e[9]=t.disabled,e[10]=a,e[11]=s,e[12]=l,e[13]=c,e[14]=u):u=e[14],e[15]!==t.fullWidth||e[16]!==t.label||e[17]!==u?(d=y.jsx(Jo,{label:o,fullWidth:i,children:u}),e[15]=t.fullWidth,e[16]=t.label,e[17]=u,e[18]=d):d=e[18],d},Hmt=t=>{const e=ue.c(24);let n;e[0]!==t?(n=g=>{if(!g)return;const{start:v,end:b}=g,p=[v.toString(),b.toString()];t.setValue(p)},e[0]=t,e[1]=n):n=e[1];const r=n,o=t.label,i=t.fullWidth;let a,s,l;e[2]!==t.value[0]?(a=r0(t.value[0]),e[2]=t.value[0],e[3]=a):a=e[3],e[4]!==t.value[1]?(s=r0(t.value[1]),e[4]=t.value[1],e[5]=s):s=e[5],e[6]!==a||e[7]!==s?(l={start:a,end:s},e[6]=a,e[7]=s,e[8]=l):l=e[8];const c=t.label??"date range picker";let u,d,f,h;return e[9]!==t.start?(u=r0(t.start),e[9]=t.start,e[10]=u):u=e[10],e[11]!==t.stop?(d=r0(t.stop),e[11]=t.stop,e[12]=d):d=e[12],e[13]!==r||e[14]!==t.disabled||e[15]!==l||e[16]!==c||e[17]!==u||e[18]!==d?(f=y.jsx(zmt,{granularity:"day",value:l,onChange:r,"aria-label":c,minValue:u,maxValue:d,isDisabled:t.disabled}),e[13]=r,e[14]=t.disabled,e[15]=l,e[16]=c,e[17]=u,e[18]=d,e[19]=f):f=e[19],e[20]!==t.fullWidth||e[21]!==t.label||e[22]!==f?(h=y.jsx(Jo,{label:o,fullWidth:i,children:f}),e[20]=t.fullWidth,e[21]=t.label,e[22]=f,e[23]=h):h=e[23],h},Ymt=t=>{const e=ue.c(19);let n;e[0]!==t?(n=h=>{if(!h)return;const g=h.toString();t.setValue(g)},e[0]=t,e[1]=n):n=e[1];const r=n;let o;e[2]!==t.value?(o=t.value?h7(t.value):void 0,e[2]=t.value,e[3]=o):o=e[3];const i=o,a=t.label,s=t.fullWidth,l=t.label??"date time picker";let c,u,d,f;return e[4]!==t.start?(c=h7(t.start),e[4]=t.start,e[5]=c):c=e[5],e[6]!==t.stop?(u=h7(t.stop),e[6]=t.stop,e[7]=u):u=e[7],e[8]!==r||e[9]!==i||e[10]!==t.disabled||e[11]!==l||e[12]!==c||e[13]!==u?(d=y.jsx(zDe,{granularity:"minute",value:i,onChange:r,"aria-label":l,minValue:c,maxValue:u,isDisabled:t.disabled}),e[8]=r,e[9]=i,e[10]=t.disabled,e[11]=l,e[12]=c,e[13]=u,e[14]=d):d=e[14],e[15]!==t.fullWidth||e[16]!==t.label||e[17]!==d?(f=y.jsx(Jo,{label:a,fullWidth:s,children:d}),e[15]=t.fullWidth,e[16]=t.label,e[17]=d,e[18]=f):f=e[18],f},Gmt=t=>{const e=ue.c(4),{elementIds:n,setValue:r,children:o}=t;let i,a;return e[0]!==n||e[1]!==r?(i=()=>{const s=l=>{const c=l.detail.element;if(c===null||!(c instanceof Node))return;const u=YB(c);if(u===null)return;const d=n[u];d!==void 0&&r(f=>{const h=f?{...f}:{};return h[d]=l.detail.value,h})};return document.addEventListener(Mp.TYPE,s),()=>{document.removeEventListener(Mp.TYPE,s)}},a=[n,r],e[0]=n,e[1]=r,e[2]=i,e[3]=a):(i=e[2],a=e[3]),_.useEffect(i,a),o},IC="__none__",Kmt=t=>{const e=ue.c(25),{options:n,value:r,setValue:o,label:i,allowSelectNone:a,fullWidth:s}=t,l=_.useId(),[c,u]=_.useState("");let d;e:{if(!c){d=n;break e}let T;if(e[0]!==n||e[1]!==c){let P;e[3]!==c?(P=j=>O4e(j,c)===1,e[3]=c,e[4]=P):P=e[4],T=n.filter(P),e[0]=n,e[1]=c,e[2]=T}else T=e[2];d=T}const f=d;let h;e[5]!==o?(h=T=>{T!=null&&o(T===IC?null:T)},e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==a||e[8]!==f?(v=()=>{const T=a?y.jsx(hc,{value:IC,children:"--"},IC):null;if(f.length>200)return y.jsx(d4e,{style:{height:"200px"},totalCount:f.length,overscan:50,itemContent:j=>{const D=f[j],N=y.jsx(hc,{value:D,children:D},D);return j===0?y.jsxs(y.Fragment,{children:[T,N]}):N}});const P=f.map(Jmt);return y.jsxs(y.Fragment,{children:[T,P]})},e[7]=a,e[8]=f,e[9]=v):v=e[9];const b=v;let p;e[10]!==s?(p=we("w-full",{"w-full":s}),e[10]=s,e[11]=p):p=e[11];const O=r??IC;let k,S,w;return e[12]!==b?(k=b(),e[12]=b,e[13]=k):k=e[13],e[14]!==g||e[15]!==c||e[16]!==p||e[17]!==O||e[18]!==k?(S=y.jsx(Jb,{displayValue:egt,placeholder:"Select...",multiple:!1,className:p,value:O,onValueChange:g,shouldFilter:!1,search:c,onSearchChange:u,"data-testid":"marimo-plugin-searchable-dropdown",children:k}),e[14]=g,e[15]=c,e[16]=p,e[17]=O,e[18]=k,e[19]=S):S=e[19],e[20]!==s||e[21]!==l||e[22]!==i||e[23]!==S?(w=y.jsx(Jo,{label:i,id:l,fullWidth:s,children:S}),e[20]=s,e[21]=l,e[22]=i,e[23]=S,e[24]=w):w=e[24],w};function Jmt(t){return y.jsx(hc,{value:t,children:t},t)}function egt(t){return t===IC?"--":t}const rZ="--",tgt=t=>{const e=ue.c(24),{label:n,options:r,value:o,setValue:i,allowSelectNone:a,fullWidth:s}=t,l=_.useId(),c=a?rZ:r[0],u=o.length===0?c:o[0];let d,f,h,g,v,b;if(e[0]!==i?(d=p=>{const O=p.target.value;i(O===rZ?[]:[O])},e[0]=i,e[1]=d):d=e[1],e[2]!==s?(f=we({"w-full":s}),e[2]=s,e[3]=f):f=e[3],e[4]!==a||e[5]!==o.length?(h=a?y.jsx("option",{value:rZ,selected:o.length===0,children:"--"}):null,e[4]=a,e[5]=o.length,e[6]=h):h=e[6],e[7]!==r||e[8]!==o){let p;e[10]!==o?(p=O=>y.jsx("option",{value:O,selected:o.includes(O),children:O},O),e[10]=o,e[11]=p):p=e[11],g=r.map(p),e[7]=r,e[8]=o,e[9]=g}else g=e[9];return e[12]!==l||e[13]!==u||e[14]!==d||e[15]!==f||e[16]!==h||e[17]!==g?(v=y.jsxs(ny,{"data-testid":"marimo-plugin-dropdown",onChange:d,className:f,value:u,id:l,children:[h,g]}),e[12]=l,e[13]=u,e[14]=d,e[15]=f,e[16]=h,e[17]=g,e[18]=v):v=e[18],e[19]!==s||e[20]!==l||e[21]!==n||e[22]!==v?(b=y.jsx(Jo,{label:n,id:l,fullWidth:s,children:v}),e[19]=s,e[20]=l,e[21]=n,e[22]=v,e[23]=b):b=e[23],b},ngt=ge.lazy(()=>Be(()=>import("./ConnectedDataExplorerComponent-D7WZrIoG.js"),__vite__mapDeps([134,101,102,103,104,105,106,107,108,109,110,111,112,100,113]),import.meta.url)),rgt=lu("marimo-data-explorer").withData(Qe({label:Pe().nullish(),data:Pe()})).renderer(t=>y.jsx(za,{children:y.jsx(ngt,{...t.data,value:t.value,setValue:t.setValue})})),oD=_.createContext(new Map),VDe=_.createContext(""),oZ=_.createContext(()=>Promise.resolve({values:[],too_many_values:!1}));var iZ="Radio",[ogt,qDe]=Wo(iZ),[igt,agt]=ogt(iZ),FDe=_.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,form:c,...u}=t,[d,f]=_.useState(null),h=ln(e,b=>f(b)),g=_.useRef(!1),v=!d||c||!!d.closest("form");return y.jsxs(igt,{scope:n,checked:o,disabled:a,children:[y.jsx(_t.button,{type:"button",role:"radio","aria-checked":o,"data-state":ZDe(o),"data-disabled":a?"":void 0,disabled:a,value:s,...u,ref:h,onClick:ut(t.onClick,b=>{o||(l==null||l()),v&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),v&&y.jsx(UDe,{control:d,bubbles:!g.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});FDe.displayName=iZ;var BDe="RadioIndicator",WDe=_.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...o}=t,i=agt(BDe,n);return y.jsx(Uo,{present:r||i.checked,children:y.jsx(_t.span,{"data-state":ZDe(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:e})})});WDe.displayName=BDe;var UDe=_.forwardRef(({__scopeRadio:t,control:e,checked:n,bubbles:r=!0,...o},i)=>{const a=_.useRef(null),s=ln(a,i),l=G1(n),c=Jw(e);return _.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&f){const h=new Event("click",{bubbles:r});f.call(u,n),u.dispatchEvent(h)}},[l,n,r]),y.jsx(_t.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function ZDe(t){return t?"checked":"unchecked"}UDe.displayName="RadioBubbleInput";var sgt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],iD="RadioGroup",[lgt,o1t]=Wo(iD,[X1,qDe]),XDe=X1(),HDe=qDe(),[cgt,ugt]=lgt(iD),YDe=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...f}=t,h=XDe(n),g=yf(c),[v,b]=Ao({prop:i,defaultProp:o??null,onChange:d,caller:iD});return y.jsx(cgt,{scope:n,name:r,required:a,disabled:s,value:v,onValueChange:b,children:y.jsx(c9,{asChild:!0,...h,orientation:l,dir:g,loop:u,children:y.jsx(_t.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:g,...f,ref:e})})})});YDe.displayName=iD;var GDe="RadioGroupItem",KDe=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...o}=t,i=ugt(GDe,n),a=i.disabled||r,s=XDe(n),l=HDe(n),c=_.useRef(null),u=ln(e,c),d=i.value===o.value,f=_.useRef(!1);return _.useEffect(()=>{const h=v=>{sgt.includes(v.key)&&(f.current=!0)},g=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",g)}},[]),y.jsx(u9,{asChild:!0,...s,focusable:!a,active:d,children:y.jsx(FDe,{disabled:a,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:ut(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:ut(o.onFocus,()=>{var h;f.current&&((h=c.current)==null||h.click())})})})});KDe.displayName=GDe;var JDe=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,o=HDe(n);return y.jsx(WDe,{...o,...r,ref:e})});JDe.displayName="RadioGroupIndicator";var eAe=YDe,tAe=KDe,dgt=JDe;const aZ=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("grid gap-2",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(eAe,{className:i,...o,ref:e}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});aZ.displayName=eAe.displayName;const sZ=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;if(n[0]!==t){const{className:l,children:c,...u}=t;r=l,o=u,n[0]=t,n[1]=r,n[2]=o}else r=n[1],o=n[2];return n[3]!==r?(i=we("h-[16px] w-[16px] transition-shadow data-[state=unchecked]:shadow-xsSolid rounded-full border border-input text-primary ring-offset-background focus:outline-none focus:shadow-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:shadow-none",r),n[3]=r,n[4]=i):i=n[4],n[5]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(dgt,{className:"flex items-center justify-center",children:y.jsx(BO,{className:"h-[10px] w-[10px] fill-primary text-current"})}),n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==i?(s=y.jsx(tAe,{ref:e,className:i,...o,children:a}),n[6]=o,n[7]=e,n[8]=i,n[9]=s):s=n[9],s});sZ.displayName=tAe.displayName,ug=_.forwardRef((t,e)=>{const n=ue.c(16);let r,o,i,a,s,l,c,u;return n[0]!==t?({className:o,bottomAdornment:r,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==o?(a=we("shadow-xsSolid hover:shadow-smSolid disabled:shadow-xsSolid focus-visible:shadow-mdSolid","flex w-full mb-1 rounded-sm border border-input bg-background px-3 py-2 text-sm font-code ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent disabled:cursor-not-allowed disabled:opacity-50 min-h-[1.5rem]",o),n[4]=o,n[5]=a):a=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(s=ai.stopPropagation(),n[6]=s):s=n[6],n[7]!==i||n[8]!==e||n[9]!==a?(l=y.jsx("textarea",{className:a,onClick:s,ref:e,...i}),n[7]=i,n[8]=e,n[9]=a,n[10]=l):l=n[10],n[11]!==r?(c=r&&y.jsx("div",{className:"absolute right-0 bottom-1 flex items-center pr-[6px] pointer-events-none text-muted-foreground h-6",children:r}),n[11]=r,n[12]=c):c=n[12],n[13]!==l||n[14]!==c?(u=y.jsxs("div",{className:"relative",children:[l,c]}),n[13]=l,n[14]=c,n[15]=u):u=n[15],u}),ug.displayName="Textarea";const nAe=_.forwardRef((t,e)=>{const n=ue.c(16);let r,o,i,a;n[0]!==t?({className:r,onValueChange:o,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==o||n[5]!==i.delay||n[6]!==i.value?(a={initialValue:i.value,delay:i.delay,onChange:o},n[4]=o,n[5]=i.delay,n[6]=i.value,n[7]=a):a=n[7];const{value:s,onChange:l}=xS(a);let c,u;return n[8]!==l?(c=d=>l(d.target.value),n[8]=l,n[9]=c):c=n[9],n[10]!==r||n[11]!==i||n[12]!==e||n[13]!==c||n[14]!==s?(u=y.jsx(ug,{ref:e,className:r,...i,onChange:c,value:s}),n[10]=r,n[11]=i,n[12]=e,n[13]=c,n[14]=s,n[15]=u):u=n[15],u});nAe.displayName="DebouncedTextarea";const rAe=_.forwardRef((t,e)=>{const n=ue.c(23);let r,o,i;n[0]!==t?({className:r,onValueChange:o,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const[a,s]=_.useState(i.value);let l;n[4]!==a||n[5]!==o||n[6]!==i.value?(l={prop:i.value,defaultProp:a,onChange:o},n[4]=a,n[5]=o,n[6]=i.value,n[7]=l):l=n[7];const[c,u]=Ao(l);let d,f,h,g,v,b;return n[8]!==c?(d=()=>{s(c||"")},f=[c],n[8]=c,n[9]=d,n[10]=f):(d=n[9],f=n[10]),_.useEffect(d,f),n[11]===Symbol.for("react.memo_cache_sentinel")?(h=p=>s(p.target.value),n[11]=h):h=n[11],n[12]!==a||n[13]!==u?(g=()=>u(a),v=p=>{p.ctrlKey&&p.key==="Enter"&&(p.preventDefault(),u(a))},n[12]=a,n[13]=u,n[14]=g,n[15]=v):(g=n[14],v=n[15]),n[16]!==r||n[17]!==a||n[18]!==i||n[19]!==e||n[20]!==g||n[21]!==v?(b=y.jsx(ug,{ref:e,className:r,...i,value:a,onChange:h,onBlur:g,onKeyDown:v}),n[16]=r,n[17]=a,n[18]=i,n[19]=e,n[20]=g,n[21]=v,n[22]=b):b=n[22],b});py=function(t){const e=n=>n instanceof Of?n._def.value:n instanceof Ey?n._def.defaultValue():n instanceof wf?py(n._def.schema):"innerType"in n._def?e(n._def.innerType):void 0;return t instanceof Sg||t instanceof Py?e(t._def.options[0]):t instanceof Fa?t._def.minLength&&t._def.minLength.value>0?[py(t._def.type)]:[]:t instanceof jl?"":t instanceof Iu?t._def.values[0]:t instanceof Ro?Object.fromEntries(Object.entries(t.shape).map(([n,r])=>[n,e(r)])):e(t)};function ix(t){if(t instanceof Of)return t;if(t instanceof Ro){const e=t._def.shape().type;if(e instanceof Of)return e;throw new Error(`Invalid schema: ${t._type}`)}if(t instanceof Sg||t instanceof Py)return ix(t._def.options[0]);throw Ve.warn(t),new Error(`Invalid schema: ${t._type}`)}rAe.displayName="OnBlurredTextarea";const oAe=t=>{const e=ue.c(24),{value:n,options:r,onChange:o,className:i,placeholder:a,textAreaClassName:s,comboBoxClassName:l}=t,[c,u]=_.useState(!1);let d;e[0]!==n?(d=QC(n),e[0]=n,e[1]=d):d=e[1];const f=d;let h;e[2]!==l||e[3]!==o||e[4]!==r||e[5]!==a||e[6]!==c||e[7]!==s||e[8]!==f?(h=()=>c?y.jsx(lZ,{value:f,className:s,onChange:o,placeholder:a?`${a}: one per line`:"One value per line"}):y.jsx(Jb,{placeholder:a,displayValue:fgt,className:we("w-full max-w-[400px]",l),multiple:!0,value:f,onValueChange:o,keepPopoverOpenOnSelect:!0,chips:!0,chipsClassName:"flex-row flex-wrap min-w-[210px]",children:r.map(hgt)}),e[2]=l,e[3]=o,e[4]=r,e[5]=a,e[6]=c,e[7]=s,e[8]=f,e[9]=h):h=e[9];const g=h;let v,b;e[10]!==i?(v=we("flex gap-1",i),e[10]=i,e[11]=v):v=e[11],e[12]!==g?(b=g(),e[12]=g,e[13]=b):b=e[13];const p=c?"Switch to multi-select":"Switch to textarea";let O,k,S,w;return e[14]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(xG,{className:"w-3 h-3"}),e[14]=O):O=e[14],e[15]!==c?(k=y.jsx(DO,{size:"xs",onPressedChange:u,pressed:c,children:O}),e[15]=c,e[16]=k):k=e[16],e[17]!==p||e[18]!==k?(S=y.jsx(qn,{content:p,children:k}),e[17]=p,e[18]=k,e[19]=S):S=e[19],e[20]!==v||e[21]!==b||e[22]!==S?(w=y.jsxs("div",{className:v,children:[b,S]}),e[20]=v,e[21]=b,e[22]=S,e[23]=w):w=e[23],w},lZ=t=>{const e=ue.c(11),{className:n,value:r,onChange:o,placeholder:i}=t;let a,s,l;if(e[0]!==r){const d=QC(r);a=ug,s=d.join(`
|
474
|
+
`.trim()}function ev(t){const e={};for(const[n,r]of Object.entries(t))r!==void 0&&(e[n]=new Dd(r));return e}const tv="__count__",d4="default",WW="yearmonthdate",Da="",xft={line:yce,bar:bce,pie:S6,scatter:xce,heatmap:ck,area:gce},Uje="mean",Oft={none:rO,count:Jv,sum:Wce,mean:dce,median:rce,min:ice,max:lce,distinct:Jv,valid:Jv,stdev:EA,stdevp:EA,variance:VE,variancep:VE,bin:Fce},wft={none:"No aggregation",count:"Count of records",sum:"Sum of values",mean:"Mean of values",median:"Median of values",min:"Minimum value",max:"Maximum value",distinct:"Count of distinct records",valid:"Count non-null records",stdev:"Standard deviation",stdevp:"Standard deviation of population",variance:"Variance",variancep:"Variance of population",bin:"Group values into bins"},kft=[d4,"accent","category10","category20","category20b","category20c","dark2","paired","pastel1","pastel2","set1","set2","set3","tableau10","tableau20","blues","greens","greys","oranges","purples","reds","bluegreen","bluepurple","goldgreen","goldorange","goldred","greenblue","orangered","purplebluegreen","purplered","redpurple","yellowgreenblue","yelloworangered","blueorange","brownbluegreen","purplegreen","pinkyellowgreen","purpleorange","redblue","redgrey","redyellowblue","redyellowgreen","spectral","rainbow","sinebow"],Sft={number:"Continuous numerical scale",string:"Discrete categorical scale (inputs treated as strings)",temporal:"Continuous temporal scale"},Cft={year:["Year","2025"],quarter:["Quarter","Q1 2025"],month:["Month","Jan 2025"],week:["Week","Jan 01, 2025"],day:["Day","Jan 01, 2025"],hours:["Hour","Jan 01, 2025 12:00"],minutes:["Minute","Jan 01, 2025 12:34"],seconds:["Second","Jan 01, 2025 12:34:56"],milliseconds:["Millisecond","Jan 01, 2025 12:34:56.789"],date:["Date","Jan 01, 2025"],dayofyear:["Day of Year","Day 1 of 2025"],yearmonth:["Year Month","Jan 2025"],yearmonthdate:["Year Month Date","Jan 01, 2025"],monthdate:["Month Date","Jan 01"]},Zje=["number","string","temporal"],Xje=["year","quarter","month","date","week","day","dayofyear","hours","minutes","seconds","milliseconds"],Hje=["yearmonth","yearmonthdate","monthdate"],_ft=[...Xje,...Hje],Yje=["ascending","descending"],Ad="none",hC="bin",Gje=[Ad,hC,"count","sum","mean","median","min","max","distinct","valid","stdev","stdevp","variance","variancep"],Kje=["none","count","distinct","valid"],ei={LINE:"line",BAR:"bar",PIE:"pie",SCATTER:"scatter",HEATMAP:"heatmap",AREA:"area"},Tft=Object.values(ei),Jje=["X","Y","Color",Ad];function f4(t){switch(t){case"number":case"integer":return"quantitative";case"string":case"boolean":case"unknown":return"nominal";case"date":case"datetime":case"time":case"temporal":return"temporal";default:return us(t),"nominal"}}function UW(t){switch(t){case"number":case"integer":return"number";case"string":case"boolean":case"unknown":return"string";case"date":case"datetime":case"time":return"temporal";default:return us(t),"string"}}function e5e(t){switch(t){case ei.PIE:return"arc";case ei.SCATTER:return"point";case ei.HEATMAP:return"rect";default:return t}}function h4(t,e,n,r){if(t===ei.HEATMAP)return n!=null&&n.maxbins?{maxbins:n==null?void 0:n.maxbins}:void 0;if(e!=="number")return;if(!(n!=null&&n.binned))return r;const o={};return n.step!==void 0&&(o.step=n.step),n.maxbins!==void 0&&(o.maxbins=n.maxbins),Object.keys(o).length===0||o}function t5e(t){var r,o;const e=(r=t.color)==null?void 0:r.range;if(e!=null&&e.length)return{range:e};const n=(o=t.color)==null?void 0:o.scheme;return n&&n!==d4?{scheme:n}:void 0}function Pft(t,e){var n,r,o,i,a;if(!((n=e.general)!=null&&n.stacking)&&ti((o=(r=e.general)==null?void 0:r.colorByColumn)==null?void 0:o.field)&&t===ei.BAR)return{field:(a=(i=e.general)==null?void 0:i.colorByColumn)==null?void 0:a.field}}function n5e(t,e,n){if(e!=="temporal"&&t!==Ad&&t!==hC)return t?e==="string"?Kje.includes(t)?t:void 0:t:n||void 0}function Eft(t){switch(t){case"integer":return",.0f";case"number":return",.2f";default:return}}function r5e(t){var l,c,u,d,f,h,g,v,b,p,O,k,S,w,T,P;const{formValues:e,xEncoding:n,yEncoding:r,colorByEncoding:o}=t;if(!e.tooltips)return;function i(j,D,N){if("aggregate"in j&&j.aggregate==="count"&&!ti(j.field))return{aggregate:"count"};if(j&&"field"in j&&ti(j.field))return j.timeUnit&&!N&&(N=j.field),{field:j.field,aggregate:j.aggregate,timeUnit:j.timeUnit,format:Eft(D),title:N,bin:j.bin}}if(e.tooltips.auto){const j=[],D=i(n,((c=(l=e.general)==null?void 0:l.xColumn)==null?void 0:c.type)||"string",(u=e.xAxis)==null?void 0:u.label);D&&j.push(D);const N=i(r,((f=(d=e.general)==null?void 0:d.yColumn)==null?void 0:f.type)||"string",(h=e.yAxis)==null?void 0:h.label);N&&j.push(N);const E=i(o||{},((v=(g=e.general)==null?void 0:g.colorByColumn)==null?void 0:v.type)||"string");return E&&j.push(E),j}const a=e.tooltips.fields??[],s=[];for(const j of a){if("field"in n&&ti(n.field)&&n.field===j.field){const N=i(n,((p=(b=e.general)==null?void 0:b.xColumn)==null?void 0:p.type)||"string",(O=e.xAxis)==null?void 0:O.label);N&&s.push(N);continue}if("field"in r&&ti(r.field)&&r.field===j.field){const N=i(r,((S=(k=e.general)==null?void 0:k.yColumn)==null?void 0:S.type)||"string",(w=e.yAxis)==null?void 0:w.label);N&&s.push(N);continue}if(o&&"field"in o&&ti(o.field)&&o.field===j.field){const N=i(o,((P=(T=e.general)==null?void 0:T.colorByColumn)==null?void 0:P.type)||"string");N&&s.push(N);continue}const D={field:j.field};s.push(D)}return s}function Rft(t,e,n,r,o){var P,j,D,N;const{xColumn:i,yColumn:a,colorByColumn:s,horizontal:l,stacking:c,title:u,facet:d}=e.general??{};if(t===ei.PIE)return function(E,A,I,L){var G,ae,ne,re;const{yColumn:F,colorByColumn:Q,title:W}=E.general??{};if(!ti(Q==null?void 0:Q.field))return"Color by column is required";if(!ti(F==null?void 0:F.field))return"Size by column is required";const U=ZW(F,(G=E.xAxis)==null?void 0:G.bin,p4((ae=E.xAxis)==null?void 0:ae.label),void 0,ei.PIE),X={field:Q.field,type:f4(Q.selectedDataType||"unknown"),scale:t5e(E),title:p4((ne=E.yAxis)==null?void 0:ne.label)};return{...i5e(ei.PIE,E,A,I,L,W),mark:{type:e5e(ei.PIE),innerRadius:(re=E.style)==null?void 0:re.innerRadius},encoding:{theta:U,color:X,tooltip:r5e({formValues:E,xEncoding:U,yEncoding:U,colorByEncoding:X})}}}(e,n,r,o);if(!ti(i==null?void 0:i.field))return"X-axis column is required";if(!ti(a==null?void 0:a.field))return"Y-axis column is required";const f="x",h="y",g=ZW(i,(P=e.xAxis)==null?void 0:P.bin,p4((j=e.xAxis)==null?void 0:j.label),s!=null&&s.field&&l?c:void 0,t);let v=Uje;(a==null?void 0:a.selectedDataType)==="string"&&(v="count");const b=ZW(a,(D=e.yAxis)==null?void 0:D.bin,p4((N=e.yAxis)==null?void 0:N.label),s!=null&&s.field&&!l?c:void 0,t,v),p=d!=null&&d.row.field?o5e(d.row,t):void 0,O=d!=null&&d.column.field?o5e(d.column,t):void 0,k=function(E,A){var W,U,X,G,ae,ne,re,Z,K;if(E===ei.PIE)return;let I;if(ti((U=(W=A.general)==null?void 0:W.colorByColumn)==null?void 0:U.field))I=(X=A.general)==null?void 0:X.colorByColumn;else{if(!ti((G=A.color)==null?void 0:G.field))return;switch((ae=A.color)==null?void 0:ae.field){case"X":I=(ne=A.general)==null?void 0:ne.xColumn;break;case"Y":I=(re=A.general)==null?void 0:re.yColumn;break;case"Color":I=(Z=A.general)==null?void 0:Z.colorByColumn;break;default:return}}if(!I||!ti(I.field)||I.field===Ad)return;if(I.field===tv)return{aggregate:"count",type:"quantitative"};const L=(K=A.color)==null?void 0:K.bin,F=I.selectedDataType||"string",Q=I==null?void 0:I.aggregate;return{field:I.field,type:f4(F),scale:t5e(A),aggregate:n5e(Q,F),bin:h4(E,F,L)}}(t,e),S=i5e(t,e,n,r,o,u),w={[f]:l?b:g,[h]:l?g:b,xOffset:Pft(t,e),color:k,tooltip:r5e({formValues:e,xEncoding:g,yEncoding:b,colorByEncoding:k}),...p&&{row:p},...O&&{column:O}},T=function(E,A){const I={};return(E==null?void 0:E.linkXAxis)===!1&&(I.x="independent"),(A==null?void 0:A.linkYAxis)===!1&&(I.y="independent"),Object.keys(I).length>0?{resolve:{axis:I}}:void 0}(d==null?void 0:d.column,d==null?void 0:d.row);return{...S,mark:{type:e5e(t)},encoding:w,...T}}function ZW(t,e,n,r,o,i){const a=t.selectedDataType||"string";return t.field===tv?{aggregate:"count",type:"quantitative",bin:h4(o,a,e),title:n===tv?void 0:n,stack:r}:{field:t.field,type:f4(t.selectedDataType||"unknown"),bin:h4(o,a,e),title:n,stack:r,aggregate:n5e(t.aggregate,a,i),sort:t.sort,timeUnit:jft(t)}}function o5e(t,e){const n={maxbins:6},r=h4(e,t.selectedDataType||"string",{maxbins:t.maxbins,binned:t.binned},n);return{field:t.field,sort:t.sort,timeUnit:Dft(t),type:f4(t.selectedDataType||"unknown"),bin:r}}function i5e(t,e,n,r,o,i){var s,l,c;let a=((s=e.style)==null?void 0:s.gridLines)??!1;return t===ei.SCATTER&&(a=!0),{$schema:"https://vega.github.io/schema/vega-lite/v5.json",background:n==="dark"?"dark":"white",title:i,data:{values:[]},height:((l=e.yAxis)==null?void 0:l.height)??o,width:((c=e.xAxis)==null?void 0:c.width)??r,config:{axis:{grid:a}}}}function ti(t){return t!==void 0&&t.trim()!==Da}function p4(t){const e=t==null?void 0:t.trim();return e===Da?void 0:e}function jft(t){if(t.selectedDataType==="temporal")return t.timeUnit??WW}function Dft(t){if(t.selectedDataType==="temporal")return t.timeUnit??WW}const a5e=_.createContext({fields:[],saveForm:Zi.NOOP,chartType:ei.LINE}),Md=()=>_.use(a5e);var s5e=["PageUp","PageDown"],l5e=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],c5e={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Hb="Slider",[XW,Aft,Mft]=Lp(Hb),[u5e,r1t]=Wo(Hb,[Mft]),[Nft,m4]=u5e(Hb),d5e=_.forwardRef((t,e)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:h=!1,form:g,...v}=t,b=_.useRef(new Set),p=_.useRef(0),O=a==="horizontal"?$ft:Ift,[k=[],S]=Ao({prop:u,defaultProp:c,onChange:P=>{var D;(D=[...b.current][p.current])==null||D.focus(),d(P)}}),w=_.useRef(k);function T(P,j,{commit:D}={commit:!1}){const N=function(I){return(String(I).split(".")[1]||"").length}(i),E=function(I,L){const F=Math.pow(10,L);return Math.round(I*F)/F}(Math.round((P-r)/i)*i+r,N),A=VO(E,[r,o]);S((I=[])=>{const L=function(F=[],Q,W){const U=[...F];return U[W]=Q,U.sort((X,G)=>X-G)}(I,A,j);if(function(F,Q){if(Q>0){const W=function(U){return U.slice(0,-1).map((X,G)=>U[G+1]-X)}(F);return Math.min(...W)>=Q}return!0}(L,l*i)){p.current=L.indexOf(A);const F=String(L)!==String(I);return F&&D&&f(L),F?L:I}return I})}return y.jsx(Nft,{scope:t.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:p,thumbs:b.current,values:k,orientation:a,form:g,children:y.jsx(XW.Provider,{scope:t.__scopeSlider,children:y.jsx(XW.Slot,{scope:t.__scopeSlider,children:y.jsx(O,{"aria-disabled":s,"data-disabled":s?"":void 0,...v,ref:e,onPointerDown:ut(v.onPointerDown,()=>{s||(w.current=k)}),min:r,max:o,inverted:h,onSlideStart:s?void 0:function(P){const j=function(D,N){if(D.length===1)return 0;const E=D.map(I=>Math.abs(I-N)),A=Math.min(...E);return E.indexOf(A)}(k,P);T(P,j)},onSlideMove:s?void 0:function(P){T(P,p.current)},onSlideEnd:s?void 0:function(){const P=w.current[p.current];k[p.current]!==P&&f(k)},onHomeKeyDown:()=>!s&&T(r,0,{commit:!0}),onEndKeyDown:()=>!s&&T(o,k.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:j})=>{if(!s){const D=s5e.includes(P.key)||P.shiftKey&&l5e.includes(P.key)?10:1,N=p.current;T(k[N]+i*D*j,N,{commit:!0})}}})})})})});d5e.displayName=Hb;var[f5e,h5e]=u5e(Hb,{startEdge:"left",endEdge:"right",size:"width",direction:1}),$ft=_.forwardRef((t,e)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=t,[d,f]=_.useState(null),h=ln(e,k=>f(k)),g=_.useRef(void 0),v=yf(o),b=v==="ltr",p=b&&!i||!b&&i;function O(k){const S=g.current||d.getBoundingClientRect(),w=GW([0,S.width],p?[n,r]:[r,n]);return g.current=S,w(k-S.left)}return y.jsx(f5e,{scope:t.__scopeSlider,startEdge:p?"left":"right",endEdge:p?"right":"left",direction:p?1:-1,size:"width",children:y.jsx(p5e,{dir:v,"data-orientation":"horizontal",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const S=O(k.clientX);a==null||a(S)},onSlideMove:k=>{const S=O(k.clientX);s==null||s(S)},onSlideEnd:()=>{g.current=void 0,l==null||l()},onStepKeyDown:k=>{const S=c5e[p?"from-left":"from-right"].includes(k.key);c==null||c({event:k,direction:S?-1:1})}})})}),Ift=_.forwardRef((t,e)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=t,u=_.useRef(null),d=ln(e,u),f=_.useRef(void 0),h=!o;function g(v){const b=f.current||u.current.getBoundingClientRect(),p=GW([0,b.height],h?[r,n]:[n,r]);return f.current=b,p(v-b.top)}return y.jsx(f5e,{scope:t.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:y.jsx(p5e,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const b=g(v.clientY);i==null||i(b)},onSlideMove:v=>{const b=g(v.clientY);a==null||a(b)},onSlideEnd:()=>{f.current=void 0,s==null||s()},onStepKeyDown:v=>{const b=c5e[h?"from-bottom":"from-top"].includes(v.key);l==null||l({event:v,direction:b?-1:1})}})})}),p5e=_.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=t,u=m4(Hb,n);return y.jsx(_t.span,{...c,ref:e,onKeyDown:ut(t.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):s5e.concat(l5e).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:ut(t.onPointerDown,d=>{const f=d.target;f.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(f)?f.focus():r(d)}),onPointerMove:ut(t.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:ut(t.onPointerUp,d=>{const f=d.target;f.hasPointerCapture(d.pointerId)&&(f.releasePointerCapture(d.pointerId),i(d))})})}),m5e="SliderTrack",g5e=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,o=m4(m5e,n);return y.jsx(_t.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:e})});g5e.displayName=m5e;var HW="SliderRange",v5e=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,o=m4(HW,n),i=h5e(HW,n),a=ln(e,_.useRef(null)),s=o.values.length,l=o.values.map(d=>x5e(d,o.min,o.max)),c=s>1?Math.min(...l):0,u=100-Math.max(...l);return y.jsx(_t.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:a,style:{...t.style,[i.startEdge]:c+"%",[i.endEdge]:u+"%"}})});v5e.displayName=HW;var YW="SliderThumb",y5e=_.forwardRef((t,e)=>{const n=Aft(t.__scopeSlider),[r,o]=_.useState(null),i=ln(e,s=>o(s)),a=_.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return y.jsx(Qft,{...t,ref:i,index:a})}),Qft=_.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:o,...i}=t,a=m4(YW,n),s=h5e(YW,n),[l,c]=_.useState(null),u=ln(e,O=>c(O)),d=!l||a.form||!!l.closest("form"),f=Jw(l),h=a.values[r],g=h===void 0?0:x5e(h,a.min,a.max),v=function(O,k){return k>2?`Value ${O+1} of ${k}`:k===2?["Minimum","Maximum"][O]:void 0}(r,a.values.length),b=f==null?void 0:f[s.size],p=b?function(O,k,S){const w=O/2,T=GW([0,50],[0,w]);return(w-T(k)*S)*S}(b,g,s.direction):0;return _.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),y.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${g}% + ${p}px)`},children:[y.jsx(XW.ItemSlot,{scope:t.__scopeSlider,children:y.jsx(_t.span,{role:"slider","aria-label":t["aria-label"]||v,"aria-valuemin":a.min,"aria-valuenow":h,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:h===void 0?{display:"none"}:t.style,onFocus:ut(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&y.jsx(b5e,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},r)]})});y5e.displayName=YW;var b5e=_.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const o=_.useRef(null),i=ln(o,r),a=G1(e);return _.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&c){const u=new Event("input",{bubbles:!0});c.call(s,e),s.dispatchEvent(u)}},[a,e]),y.jsx(_t.input,{style:{display:"none"},...n,ref:i,defaultValue:e})});function x5e(t,e,n){return VO(100/(n-e)*(t-e),[0,100])}function GW(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}b5e.displayName="RadioBubbleInput";var g4=d5e,O5e=g5e,w5e=v5e,KW=y5e;PN=function(t){const e=ue.c(6),[n,r]=_.useState(t);let o,i,a,s,l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c=>{var u;(u=c==null?void 0:c.stopPropagation)==null||u.call(c),r(!0)},e[0]=o):o=e[0],e[1]===Symbol.for("react.memo_cache_sentinel")?(i=c=>{var u;(u=c==null?void 0:c.stopPropagation)==null||u.call(c),r(!1)},e[1]=i):i=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c=>{var u;(u=c==null?void 0:c.stopPropagation)==null||u.call(c),r(Lft)},e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(s={setTrue:o,setFalse:i,toggle:a},e[3]=s):s=e[3],e[4]!==n?(l=[n,s],e[4]=n,e[5]=l):l=e[5],l};function Lft(t){return!t}const JW=_.forwardRef((t,e)=>{const n=ue.c(25);let r,o,i;n[0]!==t?({className:r,valueMap:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const[a,s]=PN(!1);let l,c,u,d,f,h,g,v;return n[4]!==r?(l=we("relative flex touch-none select-none hover:cursor-pointer","data-[orientation=horizontal]:w-full data-[orientation=horizontal]:items-center","data-[orientation=vertical]:h-full data-[orientation=vertical]:justify-center","data-[disabled]:cursor-not-allowed",r),n[4]=r,n[5]=l):l=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(c=we("relative grow overflow-hidden rounded-full bg-slate-200 dark:bg-accent/60","data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-full","data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2"),n[6]=c):c=n[6],n[7]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(O5e,{"data-testid":"track",className:c,children:y.jsx(w5e,{"data-testid":"range",className:we("absolute bg-blue-500 dark:bg-primary","data-[orientation=horizontal]:h-full","data-[orientation=vertical]:w-full","data-[disabled]:opacity-50")})}),n[7]=u):u=n[7],n[8]!==s.setFalse||n[9]!==s.setTrue?(d=y.jsx($O,{asChild:!0,children:y.jsx(KW,{"data-testid":"thumb",className:"block h-4 w-4 rounded-full shadow-xsSolid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",onFocus:s.setTrue,onBlur:s.setFalse,onMouseEnter:s.setTrue,onMouseLeave:s.setFalse})}),n[8]=s.setFalse,n[9]=s.setTrue,n[10]=d):d=n[10],n[11]!==o.value||n[12]!==i?(f=o.value!=null&&o.value.length===1&&y.jsx(yg,{children:nh(i(o.value[0]))},o.value[0]),n[11]=o.value,n[12]=i,n[13]=f):f=n[13],n[14]!==f?(h=y.jsx(ak,{children:f}),n[14]=f,n[15]=h):h=n[15],n[16]!==a||n[17]!==d||n[18]!==h?(g=y.jsx(za,{children:y.jsxs(IO,{delayDuration:0,open:a,children:[d,h]})}),n[16]=a,n[17]=d,n[18]=h,n[19]=g):g=n[19],n[20]!==o||n[21]!==e||n[22]!==l||n[23]!==g?(v=y.jsxs(g4,{ref:e,className:l,...o,children:[u,g]}),n[20]=o,n[21]=e,n[22]=l,n[23]=g,n[24]=v):v=n[24],v});JW.displayName=g4.displayName;function k5e(t){return()=>t}function zft(t){t()}function S5e(t,e){return n=>t(e(n))}function C5e(t,e){return()=>t(e)}function eU(t){return t!==void 0}function Yb(){}function v4(t,e){return e(t),t}function Vft(t,e){return e(t)}function ko(...t){return t}function zr(t,e){return t(1,e)}function Wn(t,e){t(0,e)}function tU(t){t(2)}function Ji(t){return t(4)}function cn(t,e){return zr(t,function(n,r){return o=>n(r,o)}(e,0))}function Nd(t,e){const n=t(1,r=>{n(),e(r)});return n}function _5e(t){let e,n;return r=>o=>{e=o,n&&clearTimeout(n),n=setTimeout(()=>{r(e)},t)}}function T5e(t,e){return t===e}function So(t=T5e){let e;return n=>r=>{t(e,r)||(e=r,n(r))}}function kn(t){return e=>n=>{t(n)&&e(n)}}function Gt(t){return e=>S5e(e,t)}function $d(t){return e=>()=>{e(t)}}function xt(t,...e){const n=function(...r){return o=>r.reduceRight(Vft,o)}(...e);return(r,o)=>{switch(r){case 2:return void tU(t);case 1:return zr(t,n(o))}}}function Id(t,e){return n=>r=>{n(e=t(e,r))}}function Gb(t){return e=>n=>{t>0?t--:e(n)}}function xm(t){let e,n=null;return r=>o=>{n=o,!e&&(e=setTimeout(()=>{e=void 0,r(n)},t))}}function Zn(...t){const e=new Array(t.length);let n=0,r=null;const o=Math.pow(2,t.length)-1;return t.forEach((i,a)=>{const s=Math.pow(2,a);zr(i,l=>{const c=n;n|=s,e[a]=l,c!==o&&n===o&&r&&(r(),r=null)})}),i=>a=>{const s=()=>{i([a].concat(e))};n===o?s():r=s}}function Rt(t){let e=t;const n=ar();return(r,o)=>{switch(r){case 0:e=o;break;case 1:o(e);break;case 4:return e}return n(r,o)}}function Aa(t,e){return v4(Rt(e),n=>cn(t,n))}function ar(){const t=[];return(e,n)=>{switch(e){case 0:return void t.slice().forEach(r=>{r(n)});case 2:return void t.splice(0,t.length);case 1:return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}}}function yl(t){return v4(ar(),e=>cn(t,e))}function Mr(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:qft(),singleton:n}}const qft=()=>Symbol();function Bi(...t){const e=ar(),n=new Array(t.length);let r=0;const o=Math.pow(2,t.length)-1;return t.forEach((i,a)=>{const s=Math.pow(2,a);zr(i,l=>{n[a]=l,r|=s,r===o&&Wn(e,n)})}),function(i,a){switch(i){case 2:return void tU(e);case 1:return r===o&&a(n),zr(e,a)}}}function Pn(t,e=T5e){return xt(t,So(e))}function P5e(...t){return function(e,n){switch(e){case 2:return;case 1:return function(...r){return()=>{r.map(zft)}}(...t.map(r=>zr(r,n)))}}}var Ms=(t=>(t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t))(Ms||{});const Fft={0:"debug",3:"error",1:"log",2:"warn"},Om=Mr(()=>{const t=Rt(3);return{log:Rt((e,n,r=1)=>{var o;r>=((o=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)!=null?o:Ji(t))&&console[Fft[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,n)}),logLevel:t}},[],{singleton:!0});function nv(t,e,n){return nU(t,e,n).callbackRef}function nU(t,e,n){const r=ge.useRef(null);let o=a=>{};const i=ge.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(a=>{const s=()=>{const l=a[0].target;l.offsetParent!==null&&t(l)};n?s():requestAnimationFrame(s)}):null,[t,n]);return o=a=>{a&&e?(i==null||i.observe(a),r.current=a):(r.current&&(i==null||i.unobserve(r.current)),r.current=null)},{callbackRef:o,ref:r}}function Bft(t,e,n,r,o,i,a,s,l){const c=ge.useCallback(u=>{const d=function(O,k,S,w){const T=O.length;if(T===0)return null;const P=[];for(let j=0;j<T;j++){const D=O.item(j);if(D.dataset.index===void 0)continue;const N=parseInt(D.dataset.index),E=parseFloat(D.dataset.knownSize),A=k(D,S);if(A===0&&w("Zero-sized element, this should not happen",{child:D},Ms.ERROR),A===E)continue;const I=P[P.length-1];P.length===0||I.size!==A||I.endIndex!==N-1?P.push({endIndex:N,size:A,startIndex:N}):P[P.length-1].endIndex++}return P}(u.children,e,s?"offsetWidth":"offsetHeight",o);let f=u.parentElement;for(;!f.dataset.virtuosoScroller;)f=f.parentElement;const h=f.lastElementChild.dataset.viewportType==="window";let g;h&&(g=f.ownerDocument.defaultView);const v=a?s?a.scrollLeft:a.scrollTop:h?s?g.scrollX||g.document.documentElement.scrollLeft:g.scrollY||g.document.documentElement.scrollTop:s?f.scrollLeft:f.scrollTop,b=a?s?a.scrollWidth:a.scrollHeight:h?s?g.document.documentElement.scrollWidth:g.document.documentElement.scrollHeight:s?f.scrollWidth:f.scrollHeight,p=a?s?a.offsetWidth:a.offsetHeight:h?s?g.innerWidth:g.innerHeight:s?f.offsetWidth:f.offsetHeight;r({scrollHeight:b,scrollTop:Math.max(v,0),viewportHeight:p}),i==null||i(s?E5e("column-gap",getComputedStyle(u).columnGap,o):E5e("row-gap",getComputedStyle(u).rowGap,o)),d!==null&&t(d)},[t,e,o,i,a,r,s]);return nU(c,n,l)}function E5e(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,Ms.WARN),e==="normal"?0:parseInt(e??"0",10)}function R5e(t,e,n){const r=ge.useRef(null),o=ge.useCallback(l=>{if(l==null||!l.offsetParent)return;const c=l.getBoundingClientRect(),u=c.width;let d,f;if(e){const h=e.getBoundingClientRect(),g=c.top-h.top;f=h.height-Math.max(0,g),d=g+e.scrollTop}else{const h=a.current.ownerDocument.defaultView;f=h.innerHeight-Math.max(0,c.top),d=c.top+h.scrollY}r.current={offsetTop:d,visibleHeight:f,visibleWidth:u},t(r.current)},[t,e]),{callbackRef:i,ref:a}=nU(o,!0,n),s=ge.useCallback(()=>{o(a.current)},[o,a]);return ge.useEffect(()=>{var l;if(e){e.addEventListener("scroll",s);const c=new ResizeObserver(()=>{requestAnimationFrame(s)});return c.observe(e),()=>{e.removeEventListener("scroll",s),c.unobserve(e)}}{const c=(l=a.current)==null?void 0:l.ownerDocument.defaultView;return c==null||c.addEventListener("scroll",s),c==null||c.addEventListener("resize",s),()=>{c==null||c.removeEventListener("scroll",s),c==null||c.removeEventListener("resize",s)}}},[s,e,a]),i}const ns=Mr(()=>{const t=ar(),e=ar(),n=Rt(0),r=ar(),o=Rt(0),i=ar(),a=ar(),s=Rt(0),l=Rt(0),c=Rt(0),u=Rt(0),d=ar(),f=ar(),h=Rt(!1),g=Rt(!1),v=Rt(!1);return cn(xt(t,Gt(({scrollTop:b})=>b)),e),cn(xt(t,Gt(({scrollHeight:b})=>b)),a),cn(e,o),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:u,headerHeight:s,horizontalDirection:g,scrollBy:f,scrollContainerState:t,scrollHeight:a,scrollingInProgress:h,scrollTo:d,scrollTop:e,skipAnimationFrameInResizeObserver:v,smoothScrollTargetReached:r,statefulScrollTop:o,viewportHeight:i}},[],{singleton:!0}),pC={lvl:0};function j5e(t,e){const n=t.length;if(n===0)return[];let{index:r,value:o}=e(t[0]);const i=[];for(let a=1;a<n;a++){const{index:s,value:l}=e(t[a]);i.push({end:s-1,start:r,value:o}),r=s,o=l}return i.push({end:1/0,start:r,value:o}),i}function so(t){return t===pC}function mC(t,e){if(!so(t))return e===t.k?t.v:e<t.k?mC(t.l,e):mC(t.r,e)}function du(t,e,n="k"){if(so(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const r=du(t.r,e,n);return r[0]===-1/0?[t.k,t.v]:r}return du(t.l,e,n)}function bl(t,e,n){return so(t)?M5e(e,n,1):e===t.k?ea(t,{k:e,v:n}):e<t.k?N5e(ea(t,{l:bl(t.l,e,n)})):N5e(ea(t,{r:bl(t.r,e,n)}))}function Kb(){return pC}function y4(t,e,n){return so(t)?[]:function(r){return j5e(r,({k:o,v:i})=>({index:o,value:i}))}(oU(t,du(t,e)[0],n))}function rU(t,e){if(so(t))return pC;const{k:n,l:r,r:o}=t;if(e===n){if(so(r))return o;if(so(o))return r;{const[i,a]=A5e(r);return iU(ea(t,{k:i,l:D5e(r),v:a}))}}return iU(ea(t,e<n?{l:rU(r,e)}:{r:rU(o,e)}))}function rv(t){return so(t)?[]:[...rv(t.l),{k:t.k,v:t.v},...rv(t.r)]}function oU(t,e,n){if(so(t))return[];const{k:r,l:o,r:i,v:a}=t;let s=[];return r>e&&(s=s.concat(oU(o,e,n))),r>=e&&r<=n&&s.push({k:r,v:a}),r<=n&&(s=s.concat(oU(i,e,n))),s}function iU(t){const{l:e,lvl:n,r}=t;if(r.lvl>=n-1&&e.lvl>=n-1)return t;if(n>r.lvl+1){if(aU(e))return $5e(ea(t,{lvl:n-1}));if(!so(e)&&!so(e.r))return ea(e.r,{l:ea(e,{r:e.r.l}),lvl:n,r:ea(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(aU(t))return sU(ea(t,{lvl:n-1}));if(so(r)||so(r.l))throw new Error("Unexpected empty nodes");{const o=r.l,i=aU(o)?r.lvl-1:r.lvl;return ea(o,{l:ea(t,{lvl:n-1,r:o.l}),lvl:o.lvl+1,r:sU(ea(r,{l:o.r,lvl:i}))})}}function ea(t,e){return M5e(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function D5e(t){return so(t.r)?t.l:iU(ea(t,{r:D5e(t.r)}))}function aU(t){return so(t)||t.lvl>t.r.lvl}function A5e(t){return so(t.r)?[t.k,t.v]:A5e(t.r)}function M5e(t,e,n,r=pC,o=pC){return{k:t,l:r,lvl:n,r:o,v:e}}function N5e(t){return sU($5e(t))}function $5e(t){const{l:e}=t;return so(e)||e.lvl!==t.lvl?t:ea(e,{r:ea(t,{l:e.r})})}function sU(t){const{lvl:e,r:n}=t;return so(n)||so(n.r)||n.lvl!==e||n.r.lvl!==e?t:ea(n,{l:ea(t,{r:n.l}),lvl:e+1})}function I5e(t,e){return!(!t||t.startIndex!==e.startIndex||t.endIndex!==e.endIndex)}function gC(t,e){return!(!t||t[0]!==e[0]||t[1]!==e[1])}const lU=Mr(()=>({recalcInProgress:Rt(!1)}),[],{singleton:!0});function Q5e(t,e,n){return t[b4(t,e,n)]}function b4(t,e,n,r=0){let o=t.length-1;for(;r<=o;){const i=Math.floor((r+o)/2),a=n(t[i],e);if(a===0)return i;if(a===-1){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function wm(t,e){return Math.round(t.getBoundingClientRect()[e])}function x4(t){return!so(t.groupOffsetTree)}function cU({index:t},e){return e===t?0:e<t?-1:1}function Wft({offset:t},e){return e===t?0:e<t?-1:1}function vC(t,e,n){if(e.length===0)return 0;const{index:r,offset:o,size:i}=Q5e(e,t,cU),a=t-r,s=i*a+(a-1)*n+o;return s>0?s+n:s}function L5e(t,e){if(!x4(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function z5e(t,e,n){if(function(r){return typeof r.groupIndex<"u"}(t))return e.groupIndices[t.groupIndex]+1;{let r=L5e(t.index==="LAST"?n:t.index,e);return r=Math.max(0,r,Math.min(n,r)),r}}function Uft(t,e,n,r=0){return r>0&&(e=Math.max(e,Q5e(t,r,cU).offset)),j5e(function(o,i,a,s){const l=b4(o,i,s),c=b4(o,a,s,l);return o.slice(l,c+1)}(t,e,n,Wft),Xft)}function Zft(t,[e,n,r,o]){e.length>0&&r("received item sizes",e,Ms.DEBUG);const i=t.sizeTree;let a=i,s=0;if(n.length>0&&so(i)&&e.length===2){const f=e[0].size,h=e[1].size;a=n.reduce((g,v)=>bl(bl(g,v,f),v+1,h),a)}else[a,s]=function(f,h){let g=so(f)?0:1/0;for(const v of h){const{endIndex:b,size:p,startIndex:O}=v;if(g=Math.min(g,O),so(f)){f=bl(f,0,p);continue}const k=y4(f,O-1,b+1);if(k.some(Hft(v)))continue;let S=!1,w=!1;for(const{end:T,start:P,value:j}of k)S?(b>=P||p===j)&&(f=rU(f,P)):(w=j!==p,S=!0),T>b&&b>=P&&j!==p&&(f=bl(f,b+1,j));w&&(f=bl(f,O,p))}return[f,g]}(a,e);if(a===i)return t;const{lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d}=uU(t.offsetTree,s,a,o);return{groupIndices:n,groupOffsetTree:n.reduce((f,h)=>bl(f,h,vC(h,d,o)),Kb()),lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d,sizeTree:a}}function V5e(t,e){let n=0,r=0;for(;n<t;)n+=e[r+1]-e[r]-1,r++;return r-(n===t?0:1)}function uU(t,e,n,r){let o=t,i=0,a=0,s=0,l=0;if(e!==0){l=b4(o,e-1,cU),s=o[l].offset;const c=du(n,e-1);i=c[0],a=c[1],o.length&&o[l].size===du(n,e)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:u}of y4(n,e,1/0)){const d=c-i,f=d*a+s+d*r;o.push({index:c,offset:f,size:u}),i=c,s=f,a=u}return{lastIndex:i,lastOffset:s,lastSize:a,offsetTree:o}}function Xft(t){return{index:t.index,value:t}}function Hft(t){const{endIndex:e,size:n,startIndex:r}=t;return o=>o.start===r&&(o.end===e||o.end===1/0)&&o.value===n}const Yft={offsetHeight:"height",offsetWidth:"width"},Qd=Mr(([{log:t},{recalcInProgress:e}])=>{const n=ar(),r=ar(),o=Aa(r,0),i=ar(),a=ar(),s=Rt(0),l=Rt([]),c=Rt(void 0),u=Rt(void 0),d=Rt((w,T)=>wm(w,Yft[T])),f=Rt(void 0),h=Rt(0),g={groupIndices:[],groupOffsetTree:Kb(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Kb()},v=Aa(xt(n,Zn(l,t,h),Id(Zft,g),So()),g),b=Aa(xt(l,So(),Id((w,T)=>({current:T,prev:w.current}),{current:[],prev:[]}),Gt(({prev:w})=>w)),[]);cn(xt(l,kn(w=>w.length>0),Zn(v,h),Gt(([w,T,P])=>{const j=w.reduce((D,N,E)=>bl(D,N,vC(N,T.offsetTree,P)||E),Kb());return{...T,groupIndices:w,groupOffsetTree:j}})),v),cn(xt(r,Zn(v),kn(([w,{lastIndex:T}])=>w<T),Gt(([w,{lastIndex:T,lastSize:P}])=>[{endIndex:T,size:P,startIndex:w}])),n),cn(c,u);const p=Aa(xt(c,Gt(w=>w===void 0)),!0);cn(xt(u,kn(w=>w!==void 0&&so(Ji(v).sizeTree)),Gt(w=>[{endIndex:0,size:w,startIndex:0}])),n);const O=yl(xt(n,Zn(v),Id(({sizes:w},[T,P])=>({changed:P!==w,sizes:P}),{changed:!1,sizes:g}),Gt(w=>w.changed)));zr(xt(s,Id((w,T)=>({diff:w.prev-T,prev:T}),{diff:0,prev:0}),Gt(w=>w.diff)),w=>{const{groupIndices:T}=Ji(v);if(w>0)Wn(e,!0),Wn(i,w+V5e(w,T));else if(w<0){const P=Ji(b);P.length>0&&(w-=V5e(-w,P)),Wn(a,w)}}),zr(xt(s,Zn(t)),([w,T])=>{w<0&&T("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},Ms.ERROR)});const k=yl(i);cn(xt(i,Zn(v),Gt(([w,T])=>{const P=T.groupIndices.length>0,j=[],D=T.lastSize;if(P){const N=mC(T.sizeTree,0);let E=0,A=0;for(;E<w;){const L=T.groupIndices[A],F=T.groupIndices.length===A+1?1/0:T.groupIndices[A+1]-L-1;j.push({endIndex:L,size:N,startIndex:L}),j.push({endIndex:L+1+F-1,size:D,startIndex:L+1}),A++,E+=F+1}const I=rv(T.sizeTree);return E!==w&&I.shift(),I.reduce((L,{k:F,v:Q})=>{let W=L.ranges;return L.prevSize!==0&&(W=[...L.ranges,{endIndex:F+w-1,size:L.prevSize,startIndex:L.prevIndex}]),{prevIndex:F+w,prevSize:Q,ranges:W}},{prevIndex:w,prevSize:0,ranges:j}).ranges}return rv(T.sizeTree).reduce((N,{k:E,v:A})=>({prevIndex:E+w,prevSize:A,ranges:[...N.ranges,{endIndex:E+w-1,size:N.prevSize,startIndex:N.prevIndex}]}),{prevIndex:0,prevSize:D,ranges:[]}).ranges})),n);const S=yl(xt(a,Zn(v,h),Gt(([w,{offsetTree:T},P])=>vC(-w,T,P))));return cn(xt(a,Zn(v,h),Gt(([w,T,P])=>{if(T.groupIndices.length>0){if(so(T.sizeTree))return T;let j=Kb();const D=Ji(b);let N=0,E=0,A=0;for(;N<-w;){A=D[E];const I=D[E+1]-A-1;E++,N+=I+1}return j=rv(T.sizeTree).reduce((I,{k:L,v:F})=>bl(I,Math.max(0,L+w),F),j),N!==-w&&(j=bl(j,0,mC(T.sizeTree,A)),j=bl(j,1,du(T.sizeTree,1-w)[1])),{...T,sizeTree:j,...uU(T.offsetTree,0,j,P)}}{const j=rv(T.sizeTree).reduce((D,{k:N,v:E})=>bl(D,Math.max(0,N+w),E),Kb());return{...T,sizeTree:j,...uU(T.offsetTree,0,j,P)}}})),v),{beforeUnshiftWith:k,data:f,defaultItemSize:u,firstItemIndex:s,fixedItemSize:c,gap:h,groupIndices:l,itemSize:d,listRefresh:O,shiftWith:a,shiftWithOffset:S,sizeRanges:n,sizes:v,statefulTotalCount:o,totalCount:r,trackItemSizes:p,unshiftWith:i}},ko(Om,lU),{singleton:!0});function Gft(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const q5e=Mr(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:r,scrollTop:o}])=>{const i=ar(),a=ar(),s=yl(xt(i,Gt(Gft)));return cn(xt(s,Gt(l=>l.totalCount)),n),cn(xt(s,Gt(l=>l.groupIndices)),t),cn(xt(Bi(o,e,r),kn(([l,c])=>x4(c)),Gt(([l,c,u])=>du(c.groupOffsetTree,Math.max(l-u,0),"v")[0]),So(),Gt(l=>[l])),a),{groupCounts:i,topItemsIndexes:a}},ko(Qd,ns)),km=Mr(([{log:t}])=>{const e=Rt(!1),n=yl(xt(e,kn(r=>r),So()));return zr(e,r=>{r&&Ji(t)("props updated",{},Ms.DEBUG)}),{didMount:n,propsReady:e}},ko(Om),{singleton:!0}),Kft=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function F5e(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!Kft)&&(e.behavior="auto"),e.offset||(e.offset=0),e}const yC=Mr(([{gap:t,listRefresh:e,sizes:n,totalCount:r},{fixedFooterHeight:o,fixedHeaderHeight:i,footerHeight:a,headerHeight:s,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{const h=ar(),g=ar(),v=Rt(0);let b=null,p=null,O=null;function k(){b&&(b(),b=null),O&&(O(),O=null),p&&(clearTimeout(p),p=null),Wn(l,!1)}return cn(xt(h,Zn(n,d,r,v,s,a,f),Zn(t,i,o),Gt(([[S,w,T,P,j,D,N,E],A,I,L])=>{const F=F5e(S),{align:Q,behavior:W,offset:U}=F,X=P-1,G=z5e(F,w,X);let ae=vC(G,w.offsetTree,A)+D;Q==="end"?(ae+=I+du(w.sizeTree,G)[1]-T+L,G===X&&(ae+=N)):Q==="center"?ae+=(I+du(w.sizeTree,G)[1]-T+L)/2:ae-=j,U&&(ae+=U);const ne=re=>{k(),re?(E("retrying to scroll to",{location:S},Ms.DEBUG),Wn(h,S)):(Wn(g,!0),E("list did not change, scroll successful",{},Ms.DEBUG))};if(k(),W==="smooth"){let re=!1;O=zr(e,Z=>{re=re||Z}),b=Nd(u,()=>{ne(re)})}else b=Nd(xt(e,function(re){return Z=>{const K=setTimeout(()=>{Z(!1)},re);return oe=>{oe&&(Z(!0),clearTimeout(K))}}}(150)),ne);return p=setTimeout(()=>{k()},1200),Wn(l,!0),E("scrolling from index to",{behavior:W,index:G,top:ae},Ms.DEBUG),{behavior:W,top:ae}})),c),{scrollTargetReached:g,scrollToIndex:h,topListHeight:v}},ko(Qd,ns,Om),{singleton:!0});function dU(t,e){t==0?e():requestAnimationFrame(()=>{dU(t-1,e)})}function fU(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const bC=Mr(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:r},{scrollTargetReached:o,scrollToIndex:i},{didMount:a}])=>{const s=Rt(!0),l=Rt(0),c=Rt(!0);return cn(xt(a,Zn(l),kn(([u,d])=>!!d),$d(!1)),s),cn(xt(a,Zn(l),kn(([u,d])=>!!d),$d(!1)),c),zr(xt(Bi(e,a),Zn(s,n,t,c),kn(([[,u],d,{sizeTree:f},h,g])=>u&&(!so(f)||eU(h))&&!d&&!g),Zn(l)),([,u])=>{Nd(o,()=>{Wn(c,!0)}),dU(4,()=>{Nd(r,()=>{Wn(s,!0)}),Wn(i,u)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:s}},ko(Qd,ns,yC,km),{singleton:!0});function B5e(t,e){return Math.abs(t-e)<1.01}const xC="up",OC="down",Jft={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},wC=Mr(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:r,scrollTop:o,viewportHeight:i}])=>{const a=Rt(!1),s=Rt(!0),l=ar(),c=ar(),u=Rt(4),d=Rt(0),f=Aa(xt(P5e(xt(Pn(o),Gb(1),$d(!0)),xt(Pn(o),Gb(1),$d(!1),_5e(100))),So()),!1),h=Aa(xt(P5e(xt(n,$d(!0)),xt(n,$d(!1),_5e(200))),So()),!1);cn(xt(Bi(Pn(o),Pn(d)),Gt(([O,k])=>O<=k),So()),s),cn(xt(s,xm(50)),c);const g=yl(xt(Bi(r,Pn(i),Pn(e),Pn(t),Pn(u)),Id((O,[{scrollHeight:k,scrollTop:S},w,T,P,j])=>{const D={scrollHeight:k,scrollTop:S,viewportHeight:w};if(S+w-k>-j){let E,A;return S>O.state.scrollTop?(E="SCROLLED_DOWN",A=O.state.scrollTop-S):(E="SIZE_DECREASED",A=O.state.scrollTop-S||O.scrollTopDelta),{atBottom:!0,atBottomBecause:E,scrollTopDelta:A,state:D}}let N;return N=D.scrollHeight>O.state.scrollHeight?"SIZE_INCREASED":w<O.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":S<O.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:N,state:D}},Jft),So((O,k)=>O&&O.atBottom===k.atBottom))),v=Aa(xt(r,Id((O,{scrollHeight:k,scrollTop:S,viewportHeight:w})=>{if(B5e(O.scrollHeight,k))return{changed:!1,jump:0,scrollHeight:k,scrollTop:S};{const T=k-(S+w)<1;return O.scrollTop!==S&&T?{changed:!0,jump:O.scrollTop-S,scrollHeight:k,scrollTop:S}:{changed:!0,jump:0,scrollHeight:k,scrollTop:S}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),kn(O=>O.changed),Gt(O=>O.jump)),0);cn(xt(g,Gt(O=>O.atBottom)),a),cn(xt(a,xm(50)),l);const b=Rt(OC);cn(xt(r,Gt(({scrollTop:O})=>O),So(),Id((O,k)=>Ji(h)?{direction:O.direction,prevScrollTop:k}:{direction:k<O.prevScrollTop?xC:OC,prevScrollTop:k},{direction:OC,prevScrollTop:0}),Gt(O=>O.direction)),b),cn(xt(r,xm(50),$d("none")),b);const p=Rt(0);return cn(xt(f,kn(O=>!O),$d(0)),p),cn(xt(o,xm(100),Zn(f),kn(([O,k])=>!!k),Id(([O,k],[S])=>[k,S],[0,0]),Gt(([O,k])=>k-O)),p),{atBottomState:g,atBottomStateChange:l,atBottomThreshold:u,atTopStateChange:c,atTopThreshold:d,isAtBottom:a,isAtTop:s,isScrolling:f,lastJumpDueToItemResize:v,scrollDirection:b,scrollVelocity:p}},ko(ns)),O4="top",w4="bottom",W5e="none";function U5e(t,e,n){return typeof t=="number"?n===xC&&e===O4||n===OC&&e===w4?t:0:n===xC?e===O4?t.main:t.reverse:e===w4?t.main:t.reverse}function Z5e(t,e){var n;return typeof t=="number"?t:(n=t[e])!=null?n:0}const hU=Mr(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:r,viewportHeight:o}])=>{const i=ar(),a=Rt(0),s=Rt(0),l=Rt(0),c=Aa(xt(Bi(Pn(r),Pn(o),Pn(n),Pn(i,gC),Pn(l),Pn(a),Pn(e),Pn(t),Pn(s)),Gt(([u,d,f,[h,g],v,b,p,O,k])=>{const S=u-O,w=b+p,T=Math.max(f-S,0);let P=W5e;const j=Z5e(k,O4),D=Z5e(k,w4);return h-=O,g+=f+p,(h+=f+p)>u+w-j&&(P=xC),(g-=O)<u-T+d+D&&(P=OC),P!==W5e?[Math.max(S-f-U5e(v,O4,P)-j,0),S-T-p+d+U5e(v,w4,P)+D]:null}),kn(u=>u!=null),So(gC)),[0,0]);return{increaseViewportBy:s,listBoundary:i,overscan:l,topListHeight:a,visibleRange:c}},ko(ns),{singleton:!0}),pU={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function k4(t,e,n,r,o,i){const{lastIndex:a,lastOffset:s,lastSize:l}=o;let c=0,u=0;if(t.length>0){c=t[0].offset;const g=t[t.length-1];u=g.offset+g.size}const d=n-a,f=c,h=s+d*l+(d-1)*r-u;return{bottom:u,firstItemIndex:i,items:H5e(t,o,i),offsetBottom:h,offsetTop:c,top:f,topItems:H5e(e,o,i),topListHeight:e.reduce((g,v)=>v.size+g,0),totalCount:n}}function X5e(t,e,n,r,o,i){let a=0;if(n.groupIndices.length>0)for(const u of n.groupIndices){if(u-a>=t)break;a++}const s=t+a,l=fU(e,s),c=Array.from({length:s}).map((u,d)=>({data:i[d+l],index:d+l,offset:0,size:0}));return k4(c,[],s,o,n,r)}function H5e(t,e,n){if(t.length===0)return[];if(!x4(e))return t.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=t[0].index,o=t[t.length-1].index,i=[],a=y4(e.groupOffsetTree,r,o);let s,l=0;for(const c of t){let u;(!s||s.end<c.index)&&(s=a.shift(),l=e.groupIndices.indexOf(s.start)),u=c.index===s.start?{index:l,type:"group"}:{groupIndex:l,index:c.index-(l+1)+n},i.push({...u,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return i}const ov=Mr(([{data:t,firstItemIndex:e,gap:n,sizes:r,totalCount:o},i,{listBoundary:a,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:h},{recalcInProgress:g}])=>{const v=Rt([]),b=Rt(0),p=ar();cn(i.topItemsIndexes,v);const O=Aa(xt(Bi(h,g,Pn(l,gC),Pn(o),Pn(r),Pn(c),u,Pn(v),Pn(e),Pn(n),t),kn(([T,P,,j,,,,,,,D])=>{const N=D&&D.length!==j;return T&&!P&&!N}),Gt(([,,[T,P],j,D,N,E,A,I,L,F])=>{const Q=D,{offsetTree:W,sizeTree:U}=Q,X=Ji(b);if(j===0)return{...pU,totalCount:j};if(T===0&&P===0)return X===0?{...pU,totalCount:j}:X5e(X,N,D,I,L,F||[]);if(so(U))return X>0?null:k4(function(K,oe,ie){if(x4(oe)){const Y=L5e(K,oe);return[{index:du(oe.groupOffsetTree,Y)[0],offset:0,size:0},{data:ie==null?void 0:ie[0],index:Y,offset:0,size:0}]}return[{data:ie==null?void 0:ie[0],index:K,offset:0,size:0}]}(fU(N,j),Q,F),[],j,L,Q,I);const G=[];if(A.length>0){const K=A[0],oe=A[A.length-1];let ie=0;for(const Y of y4(U,K,oe)){const le=Y.value,me=Math.max(Y.start,K),ce=Math.min(Y.end,oe);for(let ve=me;ve<=ce;ve++)G.push({data:F==null?void 0:F[ve],index:ve,offset:ie,size:le}),ie+=le}}if(!E)return k4([],G,j,L,Q,I);const ae=A.length>0?A[A.length-1]+1:0,ne=Uft(W,T,P,ae);if(ne.length===0)return null;const re=j-1,Z=v4([],K=>{for(const oe of ne){const ie=oe.value;let Y=ie.offset,le=oe.start;const me=ie.size;if(ie.offset<T){le+=Math.floor((T-ie.offset+L)/(me+L));const ve=le-oe.start;Y+=ve*me+ve*L}le<ae&&(Y+=(ae-le)*me,le=ae);const ce=Math.min(oe.end,re);for(let ve=le;ve<=ce&&!(Y>=P);ve++)K.push({data:F==null?void 0:F[ve],index:ve,offset:Y,size:me}),Y+=me+L}});return k4(Z,G,j,L,Q,I)}),kn(T=>T!==null),So()),pU);cn(xt(t,kn(eU),Gt(T=>T==null?void 0:T.length)),o),cn(xt(O,Gt(T=>T.topListHeight)),d),cn(d,s),cn(xt(O,Gt(T=>[T.top,T.bottom])),a),cn(xt(O,Gt(T=>T.items)),p);const k=yl(xt(O,kn(({items:T})=>T.length>0),Zn(o,t),kn(([{items:T},P])=>T[T.length-1].originalIndex===P-1),Gt(([,T,P])=>[T-1,P]),So(gC),Gt(([T])=>T))),S=yl(xt(O,xm(200),kn(({items:T,topItems:P})=>T.length>0&&T[0].originalIndex===P.length),Gt(({items:T})=>T[0].index),So())),w=yl(xt(O,kn(({items:T})=>T.length>0),Gt(({items:T})=>{let P=0,j=T.length-1;for(;T[P].type==="group"&&P<j;)P++;for(;T[j].type==="group"&&j>P;)j--;return{endIndex:T[j].index,startIndex:T[P].index}}),So(I5e)));return{endReached:k,initialItemCount:b,itemsRendered:p,listState:O,rangeChanged:w,startReached:S,topItemsIndexes:v,...f}},ko(Qd,q5e,hU,bC,yC,wC,km,lU),{singleton:!0}),Y5e=Mr(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:r},{listState:o}])=>{const i=ar(),a=Aa(xt(Bi(n,t,r,e,o),Gt(([s,l,c,u,d])=>s+l+c+u+d.offsetBottom+d.bottom)),0);return cn(Pn(a),i),{totalListHeight:a,totalListHeightChanged:i}},ko(ns,ov),{singleton:!0}),eht=Mr(([{viewportHeight:t},{totalListHeight:e}])=>{const n=Rt(!1),r=Aa(xt(Bi(n,t,e),kn(([o])=>o),Gt(([,o,i])=>Math.max(0,o-i)),xm(0),So()),0);return{alignToBottom:n,paddingTopAddition:r}},ko(ns,Y5e),{singleton:!0});function G5e(t){return!!t&&(t==="smooth"?"smooth":"auto")}const tht=Mr(([{listRefresh:t,totalCount:e,fixedItemSize:n},{atBottomState:r,isAtBottom:o},{scrollToIndex:i},{scrolledToInitialItem:a},{didMount:s,propsReady:l},{log:c},{scrollingInProgress:u}])=>{const d=Rt(!1),f=ar();let h=null;function g(b){Wn(i,{align:"end",behavior:b,index:"LAST"})}function v(b){const p=Nd(r,O=>{b&&!O.atBottom&&O.notAtBottomBecause==="SIZE_INCREASED"&&!h&&(Ji(c)("scrolling to bottom due to increased size",{},Ms.DEBUG),g("auto"))});setTimeout(p,100)}return zr(xt(Bi(xt(Pn(e),Gb(1)),s),Zn(Pn(d),o,a,u),Gt(([[b,p],O,k,S,w])=>{let T=p&&S,P="auto";return T&&(P=((j,D)=>typeof j=="function"?G5e(j(D)):D&&G5e(j))(O,k||w),T=T&&!!P),{followOutputBehavior:P,shouldFollow:T,totalCount:b}}),kn(({shouldFollow:b})=>b)),({followOutputBehavior:b,totalCount:p})=>{h&&(h(),h=null),Ji(n)?requestAnimationFrame(()=>{Ji(c)("following output to ",{totalCount:p},Ms.DEBUG),g(b)}):h=Nd(t,()=>{Ji(c)("following output to ",{totalCount:p},Ms.DEBUG),g(b),h=null})}),zr(xt(Bi(Pn(d),e,l),kn(([b,,p])=>b&&p),Id(({value:b},[,p])=>({refreshed:b===p,value:p}),{refreshed:!1,value:0}),kn(({refreshed:b})=>b),Zn(d,e)),([,b])=>{Ji(a)&&v(b!==!1)}),zr(f,()=>{v(Ji(d)!==!1)}),zr(Bi(Pn(d),r),([b,p])=>{b&&!p.atBottom&&p.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&g("auto")}),{autoscrollToBottom:f,followOutput:d}},ko(Qd,wC,yC,bC,km,Om,ns)),nht=Mr(([{data:t,firstItemIndex:e,gap:n,sizes:r},{initialTopMostItemIndex:o},{initialItemCount:i,listState:a},{didMount:s}])=>(cn(xt(s,Zn(i),kn(([,l])=>l!==0),Zn(o,r,e,n,t),Gt(([[,l],c,u,d,f,h=[]])=>X5e(l,c,u,d,f,h))),a),{}),ko(Qd,bC,ov,km),{singleton:!0}),rht=Mr(([{didMount:t},{scrollTo:e},{listState:n}])=>{const r=Rt(0);return zr(xt(t,Zn(r),kn(([,o])=>o!==0),Gt(([,o])=>({top:o}))),o=>{Nd(xt(n,Gb(1),kn(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{Wn(e,o)})})}),{initialScrollTop:r}},ko(km,ns,ov),{singleton:!0}),oht=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:r,...o},viewportBottom:i,viewportTop:a})=>e<a?{...o,align:n??"start",behavior:r}:t>i?{...o,align:n??"end",behavior:r}:null,iht=Mr(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:o,headerHeight:i,scrollingInProgress:a,scrollTop:s,viewportHeight:l},{scrollToIndex:c}])=>{const u=ar();return cn(xt(u,Zn(e,l,n,i,o,r,s),Zn(t),Gt(([[d,f,h,g,v,b,p,O],k])=>{const{align:S,behavior:w,calculateViewLocation:T=oht,done:P,...j}=d,D=z5e(d,f,g-1),N=vC(D,f.offsetTree,k)+v+b,E=T({itemBottom:N+du(f.sizeTree,D)[1],itemTop:N,locationParams:{align:S,behavior:w,...j},viewportBottom:O+h-p,viewportTop:O+b});return E?P&&Nd(xt(a,kn(A=>!A),Gb(Ji(a)?1:2)),P):P&&P(),E}),kn(d=>d!==null)),c),{scrollIntoView:u}},ko(Qd,ns,yC,ov,Om),{singleton:!0}),K5e=Mr(([{scrollVelocity:t}])=>{const e=Rt(!1),n=ar(),r=Rt(!1);return cn(xt(t,Zn(r,e,n),kn(([o,i])=>!!i),Gt(([o,i,a,s])=>{const{enter:l,exit:c}=i;if(a){if(c(o,s))return!1}else if(l(o,s))return!0;return a}),So()),e),zr(xt(Bi(e,t,n),Zn(r)),([[o,i,a],s])=>{o&&s&&s.change&&s.change(i,a)}),{isSeeking:e,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:t}},ko(wC),{singleton:!0}),mU=Mr(([{scrollContainerState:t,scrollTo:e}])=>{const n=ar(),r=ar(),o=ar(),i=Rt(!1),a=Rt(void 0);return cn(xt(Bi(n,r),Gt(([{scrollHeight:s,scrollTop:l,viewportHeight:c},{offsetTop:u}])=>({scrollHeight:s,scrollTop:Math.max(0,l-u),viewportHeight:c}))),t),cn(xt(e,Zn(r),Gt(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),o),{customScrollParent:a,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:o,windowViewportRect:r}},ko(ns)),aht=Mr(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:o},{didMount:i},{useWindowScroll:a,windowScrollContainerState:s,windowViewportRect:l}])=>{const c=ar(),u=Rt(void 0),d=Rt(null),f=Rt(null);return cn(s,d),cn(l,f),zr(xt(c,Zn(e,r,a,d,f,n)),([h,g,v,b,p,O,k])=>{const S=function(w){return rv(w).map(({k:T,v:P},j,D)=>{const N=D[j+1];return{endIndex:N?N.k-1:1/0,size:P,startIndex:T}})}(g.sizeTree);b&&p!==null&&O!==null&&(v=p.scrollTop-O.offsetTop),h({ranges:S,scrollTop:v-=k})}),cn(xt(u,kn(eU),Gt(sht)),o),cn(xt(i,Zn(u),kn(([,h])=>h!==void 0),So(),Gt(([,h])=>h.ranges)),t),{getState:c,restoreStateFrom:u}},ko(Qd,ns,bC,km,mU));function sht(t){return{align:"start",index:0,offset:t.scrollTop}}const lht=Mr(([{topItemsIndexes:t}])=>{const e=Rt(0);return cn(xt(e,kn(n=>n>=0),Gt(n=>Array.from({length:n}).map((r,o)=>o))),t),{topItemCount:e}},ko(ov));function J5e(t){let e,n=!1;return()=>(n||(n=!0,e=t()),e)}const cht=J5e(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),uht=Mr(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:r},{isAtBottom:o,isScrolling:i,lastJumpDueToItemResize:a,scrollDirection:s},{listState:l},{beforeUnshiftWith:c,gap:u,shiftWithOffset:d,sizes:f},{log:h},{recalcInProgress:g}])=>{const v=yl(xt(l,Zn(a),Id(([,p,O,k],[{bottom:S,items:w,offsetBottom:T,totalCount:P},j])=>{const D=S+T;let N=0;return O===P&&p.length>0&&w.length>0&&(w[0].originalIndex===0&&p[0].originalIndex===0||(N=D-k,N!==0&&(N+=j))),[N,w,P,D]},[0,[],0,0]),kn(([p])=>p!==0),Zn(r,s,n,o,h,g),kn(([,p,O,k,,,S])=>!S&&!k&&p!==0&&O===xC),Gt(([[p],,,,,O])=>(O("Upward scrolling compensation",{amount:p},Ms.DEBUG),p))));function b(p){p>0?(Wn(e,{behavior:"auto",top:-p}),Wn(t,0)):(Wn(t,0),Wn(e,{behavior:"auto",top:-p}))}return zr(xt(v,Zn(t,i)),([p,O,k])=>{k&&cht()?Wn(t,O-p):b(-p)}),zr(xt(Bi(Aa(i,!1),t,g),kn(([p,O,k])=>!p&&!k&&O!==0),Gt(([p,O])=>O),xm(1)),b),cn(xt(d,Gt(p=>({top:-p}))),e),zr(xt(c,Zn(f,u),Gt(([p,{groupIndices:O,lastSize:k,sizeTree:S},w])=>{function T(P){return P*(k+w)}if(O.length===0)return T(p);{let P=0;const j=mC(S,0);let D=0,N=0;for(;D<p;){D++,P+=j;let E=O.length===N+1?1/0:O[N+1]-O[N]-1;D+E>p&&(P-=j,E=p-D+1),D+=E,P+=T(E),N++}return P}})),p=>{Wn(t,p),requestAnimationFrame(()=>{Wn(e,{top:p}),requestAnimationFrame(()=>{Wn(t,0),Wn(g,!1)})})}),{deviation:t}},ko(ns,wC,ov,Qd,Om,lU)),dht=Mr(([t,e,n,r,o,i,a,s,l,c])=>({...t,...e,...n,...r,...o,...i,...a,...s,...l,...c}),ko(hU,nht,km,K5e,Y5e,rht,eht,mU,iht,Om)),e4e=Mr(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:r,gap:o,groupIndices:i,itemSize:a,sizeRanges:s,sizes:l,statefulTotalCount:c,totalCount:u,trackItemSizes:d},{initialItemFinalLocationReached:f,initialTopMostItemIndex:h,scrolledToInitialItem:g},v,b,p,{listState:O,topItemsIndexes:k,...S},{scrollToIndex:w},T,{topItemCount:P},{groupCounts:j},D])=>(cn(S.rangeChanged,D.scrollSeekRangeChanged),cn(xt(D.windowViewportRect,Gt(N=>N.visibleHeight)),v.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:r,gap:o,groupCounts:j,initialItemFinalLocationReached:f,initialTopMostItemIndex:h,scrolledToInitialItem:g,sizeRanges:s,topItemCount:P,topItemsIndexes:k,totalCount:u,...p,groupIndices:i,itemSize:a,listState:O,scrollToIndex:w,statefulTotalCount:c,trackItemSizes:d,...S,...D,...v,sizes:l,...b}),ko(Qd,bC,ns,aht,tht,ov,yC,uht,lht,q5e,dht));function fht(t,e){const n={},r={};let o=0;const i=t.length;for(;o<i;)r[t[o]]=1,o+=1;for(const a in e)Object.hasOwn(r,a)||(n[a]=e[a]);return n}const S4=typeof document<"u"?ge.useLayoutEffect:ge.useEffect;function t4e(t,e,n){const r=Object.keys(e.required||{}),o=Object.keys(e.optional||{}),i=Object.keys(e.methods||{}),a=Object.keys(e.events||{}),s=ge.createContext({});function l(f,h){f.propsReady&&Wn(f.propsReady,!1);for(const g of r)Wn(f[e.required[g]],h[g]);for(const g of o)g in h&&Wn(f[e.optional[g]],h[g]);f.propsReady&&Wn(f.propsReady,!0)}function c(f){return a.reduce((h,g)=>(h[g]=function(v){let b,p;const O=()=>b==null?void 0:b();return function(k,S){switch(k){case 1:return S?p===S?void 0:(O(),p=S,b=zr(v,S),b):(O(),Yb);case 2:return O(),void(p=null)}}}(f[e.events[g]]),h),{})}const u=ge.forwardRef((f,h)=>{const{children:g,...v}=f,[b]=ge.useState(()=>v4(function(k){const S=new Map,w=({constructor:T,dependencies:P,id:j,singleton:D})=>{if(D&&S.has(j))return S.get(j);const N=T(P.map(E=>w(E)));return D&&S.set(j,N),N};return w(k)}(t),k=>{l(k,v)})),[p]=ge.useState(C5e(c,b));S4(()=>{for(const k of a)k in v&&zr(p[k],v[k]);return()=>{Object.values(p).map(tU)}},[v,p,b]),S4(()=>{l(b,v)}),ge.useImperativeHandle(h,k5e(function(k){return i.reduce((S,w)=>(S[w]=T=>{Wn(k[e.methods[w]],T)},S),{})}(b)));const O=n;return y.jsx(s.Provider,{value:b,children:n?y.jsx(O,{...fht([...r,...o,...a],v),children:g}):g})}),d=ge.version.startsWith("18")?f=>{const h=ge.useContext(s)[f],g=ge.useCallback(v=>zr(h,v),[h]);return ge.useSyncExternalStore(g,()=>Ji(h),()=>Ji(h))}:f=>{const h=ge.useContext(s)[f],[g,v]=ge.useState(C5e(Ji,h));return S4(()=>zr(h,b=>{b!==g&&v(k5e(b))}),[h,g]),g};return{Component:u,useEmitter:(f,h)=>{const g=ge.useContext(s)[f];S4(()=>zr(g,h),[h,g])},useEmitterValue:d,usePublisher:f=>{const h=ge.useContext(s);return ge.useCallback(g=>{Wn(h[f],g)},[h,f])}}}const n4e=ge.createContext(void 0),r4e=ge.createContext(void 0),o4e=typeof document<"u"?ge.useLayoutEffect:ge.useEffect;function gU(t){return"self"in t}function i4e(t,e,n,r=Yb,o,i){const a=ge.useRef(null),s=ge.useRef(null),l=ge.useRef(null),c=ge.useCallback(u=>{let d,f,h;const g=u.target;if(function(b){return"body"in b}(g)||gU(g)){const b=gU(g)?g:g.defaultView;h=i?b.scrollX:b.scrollY,d=i?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight,f=i?b.innerWidth:b.innerHeight}else h=i?g.scrollLeft:g.scrollTop,d=i?g.scrollWidth:g.scrollHeight,f=i?g.offsetWidth:g.offsetHeight;const v=()=>{t({scrollHeight:d,scrollTop:Math.max(h,0),viewportHeight:f})};u.suppressFlushSync?v():oO.flushSync(v),s.current!==null&&(h===s.current||h<=0||h===d-f)&&(s.current=null,e(!0),l.current&&(clearTimeout(l.current),l.current=null))},[t,e,i]);return ge.useEffect(()=>{const u=o||a.current;return r(o||a.current),c({suppressFlushSync:!0,target:u}),u.addEventListener("scroll",c,{passive:!0}),()=>{r(null),u.removeEventListener("scroll",c)}},[a,c,n,r,o]),{scrollByCallback:function(u){i&&(u={behavior:u.behavior,left:u.top}),a.current.scrollBy(u)},scrollerRef:a,scrollToCallback:function(u){const d=a.current;if(!d||(i?"offsetWidth"in d&&d.offsetWidth===0:"offsetHeight"in d&&d.offsetHeight===0))return;const f=u.behavior==="smooth";let h,g,v;gU(d)?(g=Math.max(wm(d.document.documentElement,i?"width":"height"),i?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight),h=i?d.innerWidth:d.innerHeight,v=i?window.scrollX:window.scrollY):(g=d[i?"scrollWidth":"scrollHeight"],h=wm(d,i?"width":"height"),v=d[i?"scrollLeft":"scrollTop"]);const b=g-h;if(u.top=Math.ceil(Math.max(Math.min(b,u.top),0)),B5e(h,g)||u.top===v)return t({scrollHeight:g,scrollTop:v,viewportHeight:h}),void(f&&e(!0));f?(s.current=u.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=null,e(!0)},1e3)):s.current=null,i&&(u={behavior:u.behavior,left:u.top}),d.scrollTo(u)}}}const vU="-webkit-sticky",a4e="sticky",yU=J5e(()=>{if(typeof document>"u")return a4e;const t=document.createElement("div");return t.style.position=vU,t.style.position===vU?vU:a4e});function bU(t){return t}const hht=Mr(()=>{const t=Rt(l=>`Item ${l}`),e=Rt(null),n=Rt(l=>`Group ${l}`),r=Rt({}),o=Rt(bU),i=Rt("div"),a=Rt(Yb),s=(l,c=null)=>Aa(xt(r,Gt(u=>u[l]),So()),c);return{components:r,computeItemKey:o,context:e,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:n,HeaderComponent:s("Header"),HeaderFooterTag:i,ItemComponent:s("Item","div"),itemContent:t,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),pht=Mr(([t,e])=>({...t,...e}),ko(e4e,hht)),mht=({height:t})=>y.jsx("div",{style:{height:t}}),ght={overflowAnchor:"none",position:yU(),zIndex:1},s4e={overflowAnchor:"none"},vht={...s4e,display:"inline-block",height:"100%"},l4e=ge.memo(function({showTopList:t=!1}){const e=En("listState"),n=dc("sizeRanges"),r=En("useWindowScroll"),o=En("customScrollParent"),i=dc("windowScrollContainerState"),a=dc("scrollContainerState"),s=o||r?i:a,l=En("itemContent"),c=En("context"),u=En("groupContent"),d=En("trackItemSizes"),f=En("itemSize"),h=En("log"),g=dc("gap"),v=En("horizontalDirection"),{callbackRef:b}=Bft(n,f,d,t?Yb:s,h,g,o,v,En("skipAnimationFrameInResizeObserver")),[p,O]=ge.useState(0);xU("deviation",L=>{p!==L&&O(L)});const k=En("EmptyPlaceholder"),S=En("ScrollSeekPlaceholder")||mht,w=En("ListComponent"),T=En("ItemComponent"),P=En("GroupComponent"),j=En("computeItemKey"),D=En("isSeeking"),N=En("groupIndices").length>0,E=En("alignToBottom"),A=En("initialItemFinalLocationReached"),I=t?{}:{boxSizing:"border-box",...v?{display:"inline-block",height:"100%",marginLeft:p!==0?p:E?"auto":0,paddingLeft:e.offsetTop,paddingRight:e.offsetBottom,whiteSpace:"nowrap"}:{marginTop:p!==0?p:E?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},...A?{}:{visibility:"hidden"}};return!t&&e.totalCount===0&&k?y.jsx(k,{...ma(k,c)}):y.jsx(w,{...ma(w,c),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:b,style:I,children:(t?e.topItems:e.items).map(L=>{const F=L.originalIndex,Q=j(F+e.firstItemIndex,L.data,c);return D?_.createElement(S,{...ma(S,c),height:L.size,index:L.index,key:Q,type:L.type||"item",...L.type==="group"?{}:{groupIndex:L.groupIndex}}):L.type==="group"?_.createElement(P,{...ma(P,c),"data-index":F,"data-item-index":L.index,"data-known-size":L.size,key:Q,style:ght},u(L.index,c)):_.createElement(T,{...ma(T,c),...Oht(T,L.data),"data-index":F,"data-item-group-index":L.groupIndex,"data-item-index":L.index,"data-known-size":L.size,key:Q,style:v?vht:s4e},N?l(L.index,L.groupIndex,L.data,c):l(L.index,L.data,c))})})}),yht={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},bht={outline:"none",overflowX:"auto",position:"relative"},C4=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:{}}),xht={position:yU(),top:0,width:"100%",zIndex:1};function ma(t,e){if(typeof t!="string")return{context:e}}function Oht(t,e){return{item:typeof t=="string"?void 0:e}}const wht=ge.memo(function(){const t=En("HeaderComponent"),e=dc("headerHeight"),n=En("HeaderFooterTag"),r=nv(ge.useMemo(()=>i=>{e(wm(i,"height"))},[e]),!0,En("skipAnimationFrameInResizeObserver")),o=En("context");return t?y.jsx(n,{ref:r,children:y.jsx(t,{...ma(t,o)})}):null}),kht=ge.memo(function(){const t=En("FooterComponent"),e=dc("footerHeight"),n=En("HeaderFooterTag"),r=nv(ge.useMemo(()=>i=>{e(wm(i,"height"))},[e]),!0,En("skipAnimationFrameInResizeObserver")),o=En("context");return t?y.jsx(n,{ref:r,children:y.jsx(t,{...ma(t,o)})}):null});function c4e({useEmitter:t,useEmitterValue:e,usePublisher:n}){return ge.memo(function({children:r,style:o,...i}){const a=n("scrollContainerState"),s=e("ScrollerComponent"),l=n("smoothScrollTargetReached"),c=e("scrollerRef"),u=e("context"),d=e("horizontalDirection")||!1,{scrollByCallback:f,scrollerRef:h,scrollToCallback:g}=i4e(a,l,s,c,void 0,d);return t("scrollTo",g),t("scrollBy",f),y.jsx(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:h,style:{...d?bht:yht,...o},tabIndex:0,...i,...ma(s,u),children:r})})}function u4e({useEmitter:t,useEmitterValue:e,usePublisher:n}){return ge.memo(function({children:r,style:o,...i}){const a=n("windowScrollContainerState"),s=e("ScrollerComponent"),l=n("smoothScrollTargetReached"),c=e("totalListHeight"),u=e("deviation"),d=e("customScrollParent"),f=e("context"),h=ge.useRef(null),g=e("scrollerRef"),{scrollByCallback:v,scrollerRef:b,scrollToCallback:p}=i4e(a,l,s,g,d);return o4e(()=>{var O;return b.current=d||((O=h.current)==null?void 0:O.ownerDocument.defaultView),()=>{b.current=null}},[b,d]),t("windowScrollTo",p),t("scrollBy",v),y.jsx(s,{ref:h,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...c!==0?{height:c+u}:{}},...i,...ma(s,f),children:r})})}const Sht=({children:t})=>{const e=ge.useContext(n4e),n=dc("viewportHeight"),r=dc("fixedItemHeight"),o=En("alignToBottom"),i=En("horizontalDirection"),a=nv(ge.useMemo(()=>S5e(n,s=>wm(s,i?"width":"height")),[n,i]),!0,En("skipAnimationFrameInResizeObserver"));return ge.useEffect(()=>{e&&(n(e.viewportHeight),r(e.itemHeight))},[e,n,r]),y.jsx("div",{"data-viewport-type":"element",ref:a,style:C4(o),children:t})},Cht=({children:t})=>{const e=ge.useContext(n4e),n=dc("windowViewportRect"),r=dc("fixedItemHeight"),o=En("customScrollParent"),i=R5e(n,o,En("skipAnimationFrameInResizeObserver")),a=En("alignToBottom");return ge.useEffect(()=>{e&&(r(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,r]),y.jsx("div",{"data-viewport-type":"window",ref:i,style:C4(a),children:t})},_ht=({children:t})=>{const e=En("TopItemListComponent")||"div",n=En("headerHeight"),r={...xht,marginTop:`${n}px`},o=En("context");return y.jsx(e,{style:r,...ma(e,o),children:t})},Tht=ge.memo(function(t){const e=En("useWindowScroll"),n=En("topItemsIndexes").length>0,r=En("customScrollParent"),o=En("context"),i=r||e?Rht:Eht,a=r||e?Cht:Sht;return y.jsxs(i,{...t,...ma(i,o),children:[n&&y.jsx(_ht,{children:y.jsx(l4e,{showTopList:!0})}),y.jsxs(a,{children:[y.jsx(wht,{}),y.jsx(l4e,{}),y.jsx(kht,{})]})]})}),{Component:Pht,useEmitter:xU,useEmitterValue:En,usePublisher:dc}=t4e(pht,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Tht),Eht=c4e({useEmitter:xU,useEmitterValue:En,usePublisher:dc}),Rht=u4e({useEmitter:xU,useEmitterValue:En,usePublisher:dc}),d4e=Pht,jht=Mr(()=>{const t=Rt(c=>y.jsxs("td",{children:["Item $",c]})),e=Rt(null),n=Rt(c=>y.jsxs("td",{colSpan:1e3,children:["Group ",c]})),r=Rt(null),o=Rt(null),i=Rt({}),a=Rt(bU),s=Rt(Yb),l=(c,u=null)=>Aa(xt(i,Gt(d=>d[c]),So()),u);return{components:i,computeItemKey:a,context:e,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:o,fixedHeaderContent:r,itemContent:t,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}});ko(e4e,jht),yU();const f4e={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Dht={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:h4e,floor:_4,max:kC,min:OU,round:p4e}=Math;function m4e(t,e,n){return Array.from({length:e-t+1}).map((r,o)=>({data:n===null?null:n[o+t],index:o+t}))}function T4(t,e){return t&&t.width===e.width&&t.height===e.height}function Aht(t,e){return t&&t.column===e.column&&t.row===e.row}const Mht=Mr(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:r},{footerHeight:o,headerHeight:i,scrollBy:a,scrollContainerState:s,scrollTo:l,scrollTop:c,smoothScrollTargetReached:u,viewportHeight:d},f,h,{didMount:g,propsReady:v},{customScrollParent:b,useWindowScroll:p,windowScrollContainerState:O,windowScrollTo:k,windowViewportRect:S},w])=>{const T=Rt(0),P=Rt(0),j=Rt(f4e),D=Rt({height:0,width:0}),N=Rt({height:0,width:0}),E=ar(),A=ar(),I=Rt(0),L=Rt(null),F=Rt({column:0,row:0}),Q=ar(),W=ar(),U=Rt(!1),X=Rt(0),G=Rt(!0),ae=Rt(!1),ne=Rt(!1);zr(xt(g,Zn(X),kn(([Y,le])=>!!le)),()=>{Wn(G,!1)}),zr(xt(Bi(g,G,N,D,X,ae),kn(([Y,le,me,ce,,ve])=>Y&&!le&&me.height!==0&&ce.height!==0&&!ve)),([,,,,Y])=>{Wn(ae,!0),dU(1,()=>{Wn(E,Y)}),Nd(xt(c),()=>{Wn(e,[0,0]),Wn(G,!0)})}),cn(xt(W,kn(Y=>Y!=null&&Y.scrollTop>0),$d(0)),P),zr(xt(g,Zn(W),kn(([,Y])=>Y!=null)),([,Y])=>{Y&&(Wn(D,Y.viewport),Wn(N,Y.item),Wn(F,Y.gap),Y.scrollTop>0&&(Wn(U,!0),Nd(xt(c,Gb(1)),le=>{Wn(U,!1)}),Wn(l,{top:Y.scrollTop})))}),cn(xt(D,Gt(({height:Y})=>Y)),d),cn(xt(Bi(Pn(D,T4),Pn(N,T4),Pn(F,(Y,le)=>Y&&Y.column===le.column&&Y.row===le.row),Pn(c)),Gt(([Y,le,me,ce])=>({gap:me,item:le,scrollTop:ce,viewport:Y}))),Q),cn(xt(Bi(Pn(T),r,Pn(F,Aht),Pn(N,T4),Pn(D,T4),Pn(L),Pn(P),Pn(U),Pn(G),Pn(X)),kn(([,,,,,,,Y])=>!Y),Gt(([Y,[le,me],ce,ve,ye,_e,Se,,Ae,je])=>{const{column:Ie,row:De}=ce,{height:nt,width:Fe}=ve,{width:kt}=ye;if(Se===0&&(Y===0||kt===0))return f4e;if(Fe===0){const Tt=fU(je,Y);return function(Kt){return{...Dht,items:Kt}}(m4e(Tt,Tt+Math.max(Se-1,0),_e))}const Re=g4e(kt,Fe,Ie);let ot,Me;Ae?le===0&&me===0&&Se>0?(ot=0,Me=Se-1):(ot=Re*_4((le+De)/(nt+De)),Me=Re*h4e((me+De)/(nt+De))-1,Me=OU(Y-1,kC(Me,Re-1)),ot=OU(Me,kC(0,ot))):(ot=0,Me=-1);const We=m4e(ot,Me,_e),{bottom:it,top:Ue}=v4e(ye,ce,ve,We),gt=h4e(Y/Re);return{bottom:it,itemHeight:nt,items:We,itemWidth:Fe,offsetBottom:gt*nt+(gt-1)*De-it,offsetTop:Ue,top:Ue}})),j),cn(xt(L,kn(Y=>Y!==null),Gt(Y=>Y.length)),T),cn(xt(Bi(D,N,j,F),kn(([Y,le,{items:me}])=>me.length>0&&le.height!==0&&Y.height!==0),Gt(([Y,le,{items:me},ce])=>{const{bottom:ve,top:ye}=v4e(Y,ce,le,me);return[ye,ve]}),So(gC)),e);const re=Rt(!1);cn(xt(c,Zn(re),Gt(([Y,le])=>le||Y!==0)),re);const Z=yl(xt(Bi(j,T),kn(([{items:Y}])=>Y.length>0),Zn(re),kn(([[Y,le],me])=>{const ce=Y.items[Y.items.length-1].index===le-1;return(me||Y.bottom>0&&Y.itemHeight>0&&Y.offsetBottom===0&&Y.items.length===le)&&ce}),Gt(([[,Y]])=>Y-1),So())),K=yl(xt(Pn(j),kn(({items:Y})=>Y.length>0&&Y[0].index===0),$d(0),So())),oe=yl(xt(Pn(j),Zn(U),kn(([{items:Y},le])=>Y.length>0&&!le),Gt(([{items:Y}])=>({endIndex:Y[Y.length-1].index,startIndex:Y[0].index})),So(I5e),xm(0)));cn(oe,h.scrollSeekRangeChanged),cn(xt(E,Zn(D,N,T,F),Gt(([Y,le,me,ce,ve])=>{const ye=F5e(Y),{align:_e,behavior:Se,offset:Ae}=ye;let je=ye.index;je==="LAST"&&(je=ce-1),je=kC(0,je,OU(ce-1,je));let Ie=wU(le,ve,me,je);return _e==="end"?Ie=p4e(Ie-le.height+me.height):_e==="center"&&(Ie=p4e(Ie-le.height/2+me.height/2)),Ae&&(Ie+=Ae),{behavior:Se,top:Ie}})),l);const ie=Aa(xt(j,Gt(Y=>Y.offsetBottom+Y.bottom)),0);return cn(xt(S,Gt(Y=>({height:Y.visibleHeight,width:Y.visibleWidth}))),D),{customScrollParent:b,data:L,deviation:I,footerHeight:o,gap:F,headerHeight:i,increaseViewportBy:t,initialItemCount:P,itemDimensions:N,overscan:n,restoreStateFrom:W,scrollBy:a,scrollContainerState:s,scrollHeight:A,scrollTo:l,scrollToIndex:E,scrollTop:c,smoothScrollTargetReached:u,totalCount:T,useWindowScroll:p,viewportDimensions:D,windowScrollContainerState:O,windowScrollTo:k,windowViewportRect:S,...h,gridState:j,horizontalDirection:ne,initialTopMostItemIndex:X,totalListHeight:ie,...f,endReached:Z,propsReady:v,rangeChanged:oe,startReached:K,stateChanged:Q,stateRestoreInProgress:U,...w}},ko(hU,ns,wC,K5e,km,mU,Om));function g4e(t,e,n){return kC(1,_4((t+n)/(_4(e)+n)))}function v4e(t,e,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{bottom:0,top:0};const i=wU(t,e,n,r[0].index);return{bottom:wU(t,e,n,r[r.length-1].index)+o,top:i}}function wU(t,e,n,r){const o=g4e(t.width,n.width,e.column),i=_4(r/o),a=i*n.height+kC(0,i-1)*e.row;return a>0?a+e.row:a}const Nht=Mr(()=>{const t=Rt(d=>`Item ${d}`),e=Rt({}),n=Rt(null),r=Rt("virtuoso-grid-item"),o=Rt("virtuoso-grid-list"),i=Rt(bU),a=Rt("div"),s=Rt(Yb),l=(d,f=null)=>Aa(xt(e,Gt(h=>h[d]),So()),f),c=Rt(!1),u=Rt(!1);return cn(Pn(u),c),{components:e,computeItemKey:i,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:l("Item","div"),itemContent:t,listClassName:o,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:u,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),$ht=Mr(([t,e])=>({...t,...e}),ko(Mht,Nht)),Iht=ge.memo(function(){const t=Io("gridState"),e=Io("listClassName"),n=Io("itemClassName"),r=Io("itemContent"),o=Io("computeItemKey"),i=Io("isSeeking"),a=fc("scrollHeight"),s=Io("ItemComponent"),l=Io("ListComponent"),c=Io("ScrollSeekPlaceholder"),u=Io("context"),d=fc("itemDimensions"),f=fc("gap"),h=Io("log"),g=Io("stateRestoreInProgress"),v=fc("reportReadyState"),b=nv(ge.useMemo(()=>p=>{const O=p.parentElement.parentElement.scrollHeight;a(O);const k=p.firstChild;if(k){const{height:S,width:w}=k.getBoundingClientRect();d({height:S,width:w})}f({column:b4e("column-gap",getComputedStyle(p).columnGap,h),row:b4e("row-gap",getComputedStyle(p).rowGap,h)})},[a,d,f,h]),!0,!1);return o4e(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),g?null:y.jsx(l,{className:e,ref:b,...ma(l,u),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(p=>{const O=o(p.index,p.data,u);return i?y.jsx(c,{...ma(c,u),height:t.itemHeight,index:p.index,width:t.itemWidth},O):_.createElement(s,{...ma(s,u),className:n,"data-index":p.index,key:O},r(p.index,p.data,u))})})}),Qht=ge.memo(function(){const t=Io("HeaderComponent"),e=fc("headerHeight"),n=Io("headerFooterTag"),r=nv(ge.useMemo(()=>i=>{e(wm(i,"height"))},[e]),!0,!1),o=Io("context");return t?y.jsx(n,{ref:r,children:y.jsx(t,{...ma(t,o)})}):null}),Lht=ge.memo(function(){const t=Io("FooterComponent"),e=fc("footerHeight"),n=Io("headerFooterTag"),r=nv(ge.useMemo(()=>i=>{e(wm(i,"height"))},[e]),!0,!1),o=Io("context");return t?y.jsx(n,{ref:r,children:y.jsx(t,{...ma(t,o)})}):null}),zht=({children:t})=>{const e=ge.useContext(r4e),n=fc("itemDimensions"),r=fc("viewportDimensions"),o=nv(ge.useMemo(()=>i=>{r(i.getBoundingClientRect())},[r]),!0,!1);return ge.useEffect(()=>{e&&(r({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,r,n]),y.jsx("div",{ref:o,style:C4(!1),children:t})},Vht=({children:t})=>{const e=ge.useContext(r4e),n=fc("windowViewportRect"),r=fc("itemDimensions"),o=Io("customScrollParent"),i=R5e(n,o,!1);return ge.useEffect(()=>{e&&(r({height:e.itemHeight,width:e.itemWidth}),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,r]),y.jsx("div",{ref:i,style:C4(!1),children:t})},qht=ge.memo(function({...t}){const e=Io("useWindowScroll"),n=Io("customScrollParent"),r=n||e?Bht:Fht,o=n||e?Vht:zht,i=Io("context");return y.jsx(r,{...t,...ma(r,i),children:y.jsxs(o,{children:[y.jsx(Qht,{}),y.jsx(Iht,{}),y.jsx(Lht,{})]})})}),{useEmitter:y4e,useEmitterValue:Io,usePublisher:fc}=t4e($ht,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},qht),Fht=c4e({useEmitter:y4e,useEmitterValue:Io,usePublisher:fc}),Bht=u4e({useEmitter:y4e,useEmitterValue:Io,usePublisher:fc});function b4e(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,Ms.WARN),e==="normal"?0:parseInt(e??"0",10)}const x4e=_.createContext({isSelected:()=>!1,onSelect:Zi.NOOP}),Jb=t=>{const e=ue.c(92);let n,r,o,i,a,s,l,c,u,d,f,h,g,v,b,p,O,k,S,w,T;e[0]!==t?({children:n,displayValue:s,className:o,placeholder:g,value:T,defaultValue:a,onValueChange:f,multiple:p,shouldFilter:O,filterFn:l,open:h,defaultOpen:i,onOpenChange:u,inputPlaceholder:k,search:b,onSearchChange:d,emptyState:S,chips:w,chipsClassName:r,keepPopoverOpenOnSelect:c,...v}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e[9]=u,e[10]=d,e[11]=f,e[12]=h,e[13]=g,e[14]=v,e[15]=b,e[16]=p,e[17]=O,e[18]=k,e[19]=S,e[20]=w,e[21]=T):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],f=e[11],h=e[12],g=e[13],v=e[14],b=e[15],p=e[16],O=e[17],k=e[18],S=e[19],w=e[20],T=e[21]);const P=p!==void 0&&p,j=O===void 0||O,D=k===void 0?"Search...":k,N=S===void 0?"Nothing found.":S,E=w!==void 0&&w,A=i??!1;let I;e[22]!==u||e[23]!==h||e[24]!==A?(I={prop:h,defaultProp:A,onChange:u},e[22]=u,e[23]=h,e[24]=A,e[25]=I):I=e[25];const[L,F]=Ao(I),Q=L!==void 0&&L;let W,U;e[26]!==f?(W=Fe=>{f==null||f(Fe)},e[26]=f,e[27]=W):W=e[27],e[28]!==a||e[29]!==W||e[30]!==T?(U={prop:T,defaultProp:a,onChange:W},e[28]=a,e[29]=W,e[30]=T,e[31]=U):U=e[31];const[X,G]=Ao(U);let ae;e[32]!==X?(ae=Fe=>Array.isArray(X)?X.includes(Fe):X===Fe,e[32]=X,e[33]=ae):ae=e[33];const ne=ae;let re;e[34]!==c||e[35]!==P||e[36]!==F||e[37]!==G||e[38]!==X?(re=Fe=>{let kt=Fe;if(P)if(Array.isArray(X))if(X.includes(kt)){const Re=X.filter(ot=>ot!==Fe);kt=Re.length>0?Re:[]}else kt=[...X,kt];else kt=[kt];else X===Fe&&(kt=null);G(kt),(c??P)||F(!1)},e[34]=c,e[35]=P,e[36]=F,e[37]=G,e[38]=X,e[39]=re):re=e[39];const Z=re;let K;e[40]!==E||e[41]!==s||e[42]!==P||e[43]!==g||e[44]!==X?(K=()=>P&&E&&g?g:X!=null?Array.isArray(X)?X.length===0?g??"--":X.length===1&&s!==void 0?s(X[0]):`${X.length} selected`:s!==void 0?s(X):g??"--":g??"--",e[40]=E,e[41]=s,e[42]=P,e[43]=g,e[44]=X,e[45]=K):K=e[45];const oe=K;let ie,Y,le,me,ce,ve,ye,_e,Se,Ae,je,Ie,De,nt;return e[46]===Symbol.for("react.memo_cache_sentinel")?(ie=we("relative"),e[46]=ie):ie=e[46],e[47]!==o?(Y=we("flex h-6 w-fit mb-1 shadow-xsSolid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-smSolid focus:outline-none focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-mdSolid disabled:cursor-not-allowed disabled:opacity-50",o),e[47]=o,e[48]=Y):Y=e[48],e[49]!==oe?(le=oe(),e[49]=oe,e[50]=le):le=e[50],e[51]===Symbol.for("react.memo_cache_sentinel")?(me=y.jsx(xu,{className:"ml-3 w-4 h-4 opacity-50"}),e[51]=me):me=e[51],e[52]!==Q||e[53]!==Y||e[54]!==le?(ce=y.jsx(sy,{asChild:!0,children:y.jsxs("div",{className:Y,"aria-expanded":Q,children:[le," ",me]})}),e[52]=Q,e[53]=Y,e[54]=le,e[55]=ce):ce=e[55],e[56]!==D||e[57]!==d||e[58]!==b?(ve=y.jsx(EO,{placeholder:D,rootClassName:"px-1 h-8",autoFocus:!0,value:b,onValueChange:d}),e[56]=D,e[57]=d,e[58]=b,e[59]=ve):ve=e[59],e[60]!==N?(ye=y.jsx(RO,{children:N}),e[60]=N,e[61]=ye):ye=e[61],e[62]!==Z||e[63]!==ne?(_e={isSelected:ne,onSelect:Z},e[62]=Z,e[63]=ne,e[64]=_e):_e=e[64],e[65]!==n||e[66]!==_e?(Se=y.jsx(x4e,{value:_e,children:n}),e[65]=n,e[66]=_e,e[67]=Se):Se=e[67],e[68]!==ye||e[69]!==Se?(Ae=y.jsxs(PO,{className:"max-h-60 py-.5",children:[ye,Se]}),e[68]=ye,e[69]=Se,e[70]=Ae):Ae=e[70],e[71]!==l||e[72]!==j||e[73]!==ve||e[74]!==Ae?(je=y.jsx(tp,{className:"w-full min-w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:y.jsxs(by,{filter:l,shouldFilter:j,children:[ve,Ae]})}),e[71]=l,e[72]=j,e[73]=ve,e[74]=Ae,e[75]=je):je=e[75],e[76]!==Q||e[77]!==F||e[78]!==ce||e[79]!==je?(Ie=y.jsxs(dg,{open:Q,onOpenChange:F,children:[ce,je]}),e[76]=Q,e[77]=F,e[78]=ce,e[79]=je,e[80]=Ie):Ie=e[80],e[81]!==E||e[82]!==r||e[83]!==s||e[84]!==Z||e[85]!==P||e[86]!==X?(De=P&&E&&y.jsx("div",{className:we("flex flex-col gap-1 items-start",r),children:Array.isArray(X)&&X.map(Fe=>Fe==null?null:y.jsxs(aM,{variant:"secondary",children:[(s==null?void 0:s(Fe))??String(Fe),y.jsx(PH,{onClick:()=>{Z(Fe)},className:"w-3 h-3 opacity-50 hover:opacity-100 ml-1 cursor-pointer"})]},String(Fe)))}),e[81]=E,e[82]=r,e[83]=s,e[84]=Z,e[85]=P,e[86]=X,e[87]=De):De=e[87],e[88]!==v||e[89]!==Ie||e[90]!==De?(nt=y.jsxs("div",{className:ie,...v,children:[Ie,De]}),e[88]=v,e[89]=Ie,e[90]=De,e[91]=nt):nt=e[91],nt},hc=ge.forwardRef((t,e)=>{const n=ue.c(17),{children:r,className:o,value:i,onSelect:a,disabled:s}=t,l=typeof i=="object"&&"value"in i?i.value:String(i),c=ge.use(x4e);let u,d,f,h;return n[0]!==o?(u=we("pl-6 m-1 py-1",o),n[0]=o,n[1]=u):u=n[1],n[2]!==c||n[3]!==a||n[4]!==i?(d=()=>{c.onSelect(i),a==null||a(i)},n[2]=c,n[3]=a,n[4]=i,n[5]=d):d=n[5],n[6]!==c||n[7]!==i?(f=c.isSelected(i)&&y.jsx(rg,{className:"absolute left-1 h-4 w-4"}),n[6]=c,n[7]=i,n[8]=f):f=n[8],n[9]!==r||n[10]!==s||n[11]!==e||n[12]!==u||n[13]!==d||n[14]!==f||n[15]!==l?(h=y.jsxs(fy,{ref:e,className:u,role:"option",value:l,disabled:s,onSelect:d,children:[f,r]}),n[9]=r,n[10]=s,n[11]=e,n[12]=u,n[13]=d,n[14]=f,n[15]=l,n[16]=h):h=n[16],h});function O4e(t,e){return e.split(/\s+/).every(n=>t.toLowerCase().includes(n.toLowerCase()))?1:0}hc.displayName="ComboboxItem";const kU="__select_all__",SU="__deselect_all__",w4e=t=>{const e=ue.c(45),{options:n,label:r,value:o,setValue:i,fullWidth:a,maxSelections:s}=t,l=_.useId(),[c,u]=_.useState("");let d;e:{if(!c){d=n;break e}let N;if(e[0]!==n||e[1]!==c){let E;e[3]!==c?(E=A=>O4e(A,c)===1,e[3]=c,e[4]=E):E=e[4],N=n.filter(E),e[0]=n,e[1]=c,e[2]=N}else N=e[2];d=N}const f=d;let h;e[5]!==s||e[6]!==i?(h=N=>{N&&N.length!==0?(N=N.filter(Wht),s!==1?(s!=null&&N.length>s&&(N=N.slice(-s)),i(N)):i([N[N.length-1]])):i([])},e[5]=s,e[6]=i,e[7]=h):h=e[7];const g=h;let v;e[8]!==n||e[9]!==i?(v=()=>{i(n)},e[8]=n,e[9]=i,e[10]=v):v=e[10];const b=v;let p;e[11]!==i?(p=()=>{i([])},e[11]=i,e[12]=p):p=e[12];const O=p;let k,S;if(e[13]!==O||e[14]!==b||e[15]!==s||e[16]!==n.length||e[17]!==o){k=[];const N=n.length>0&&o.length<n.length,E=n.length>0&&o.length>0;if(n.length>2&&s==null){const A=!N;let I;e[19]!==b||e[20]!==A?(I=y.jsx(hc,{value:kU,onSelect:b,disabled:A,children:"Select all"},kU),e[19]=b,e[20]=A,e[21]=I):I=e[21],k.push(I)}if(n.length>2){const A=!E,I=s===1?"Deselect":"Deselect all";let L,F;e[22]!==O||e[23]!==A||e[24]!==I?(L=y.jsx(hc,{value:SU,onSelect:O,disabled:A,children:I},SU),e[22]=O,e[23]=A,e[24]=I,e[25]=L):L=e[25],e[26]===Symbol.for("react.memo_cache_sentinel")?(F=y.jsx(LM,{},"_separator"),e[26]=F):F=e[26],k.push(L,F)}e[13]=O,e[14]=b,e[15]=s,e[16]=n.length,e[17]=o,e[18]=k}else k=e[18];e[27]!==k||e[28]!==f?(S=()=>{if(f.length>200)return y.jsx(d4e,{style:{height:"200px"},totalCount:f.length,overscan:50,itemContent:E=>{const A=y.jsx(hc,{value:f[E],children:f[E]},f[E]);return E===0?y.jsxs(y.Fragment,{children:[k,A]}):A}});const N=f.map(Uht);return y.jsxs(y.Fragment,{children:[k,N]})},e[27]=k,e[28]=f,e[29]=S):S=e[29];const w=S;let T,P,j,D;return e[30]!==a?(T=we({"w-full":a}),e[30]=a,e[31]=T):T=e[31],e[32]!==w?(P=w(),e[32]=w,e[33]=P):P=e[33],e[34]!==g||e[35]!==c||e[36]!==T||e[37]!==P||e[38]!==o?(j=y.jsx(Jb,{displayValue:Zht,placeholder:"Select...",multiple:!0,className:T,value:o,onValueChange:g,shouldFilter:!1,search:c,onSearchChange:u,children:P}),e[34]=g,e[35]=c,e[36]=T,e[37]=P,e[38]=o,e[39]=j):j=e[39],e[40]!==a||e[41]!==l||e[42]!==r||e[43]!==j?(D=y.jsx(Jo,{label:r,id:l,fullWidth:a,children:j}),e[40]=a,e[41]=l,e[42]=r,e[43]=j,e[44]=D):D=e[44],D};function Wht(t){return t!==kU&&t!==SU}function Uht(t){return y.jsx(hc,{value:t,children:t},t)}function Zht(t){return t}function k4e({moduleName:t,variableName:e,onAddImport:n,appStore:r=Ht}){if(e in r.get(Du))return!1;const{cellData:o,cellIds:i}=r.get(ur),a=new RegExp(`import[ ]+${t}[ ]+as[ ]+${e}`,"g");for(const s of i.inOrderIds)if(a.test(o[s].code))return!1;return n(`import ${t} as ${e}`),!0}G6e=function({autoInstantiate:t,createNewCell:e,fromCellId:n}){return k4e({moduleName:"marimo",variableName:"mo",onAddImport:r=>{const o=ms.create();e({cellId:n??"__end__",before:!1,code:r,lastCodeRun:t?r:void 0,newCellId:o,autoFocus:!1}),t&&qM({cellIds:[o],codes:[r]})}})};function S4e({autoInstantiate:t,createNewCell:e,fromCellId:n}){return k4e({moduleName:"altair",variableName:"alt",onAddImport:r=>{const o=ms.create();e({cellId:n??"__end__",before:!1,code:r,lastCodeRun:t?r:void 0,newCellId:o,autoFocus:!1}),t&&qM({cellIds:[o],codes:[r]})}})}({valueAtom:oee,useActions:PJ}=Xh(function(){return{focusedCellId:null,lastFocusedCellId:null}},{focusCell:(t,e)=>({...t,focusedCellId:e.cellId,lastFocusedCellId:e.cellId}),toggleCell:(t,e)=>t.focusedCellId===e.cellId?{...t,focusedCellId:null}:{...t,focusedCellId:e.cellId,lastFocusedCellId:e.cellId},blurCell:t=>({...t,focusedCellId:null})})),ON=Ct(t=>t(oee).lastFocusedCellId),PT=function(){return Gr(ON)},q6e=Ct(t=>{const e=t(ON);return e?e===Al?null:C4e(e,t(ur)):null}),GLe=function(t){return Ct(e=>C4e(t,e(ur)))};function C4e(t,e){var l;const{cellData:n,cellHandles:r,cellRuntime:o}=e,i=n[t],a=o[t],s=(l=r[t])==null?void 0:l.current;return!i||!s?null:{cellId:t,name:i.name,config:i.config,status:a?a.status:"idle",getEditorView:()=>s.editorView,hasOutput:(a==null?void 0:a.output)!=null,hasConsoleOutput:(a==null?void 0:a.consoleOutputs)!=null}}see=function(){const t=ue.c(4),e=Gr(FM),n=PT(),{createNewCell:r}=Iv();let o;return t[0]!==e||t[1]!==r||t[2]!==n?(o=i=>{i.includes("alt")&&S4e({autoInstantiate:e,createNewCell:r,fromCellId:n}),r({code:i,before:!1,cellId:n??"__end__"})},t[0]=e,t[1]=r,t[2]=n,t[3]=o):o=t[3],o};let _4e,T4e;_4e=[IT(),mt.lineWrapping],T4e=[Jx(),mt.lineWrapping],hO=_.memo(t=>{const e=ue.c(41),{theme:n}=as();let r,o,i,a,s,l,c,u;e[0]!==t?({code:o,className:r,initiallyHideCode:i,showHideCode:l,showCopyCode:c,insertNewCell:a,language:u,...s}=t,e[0]=t,e[1]=r,e[2]=o,e[3]=i,e[4]=a,e[5]=s,e[6]=l,e[7]=c,e[8]=u):(r=e[1],o=e[2],i=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8]);const d=l===void 0||l,f=c===void 0||c,h=u===void 0?"python":u,[g,v]=_.useState(i);let b,p,O,k,S,w;e[9]!==r?(b=we("relative hover-actions-parent w-full overflow-hidden",r),e[9]=r,e[10]=b):b=e[10],e[11]!==g||e[12]!==d?(p=d&&g&&y.jsx(DJ,{tooltip:"Show code",onClick:()=>v(!1)}),e[11]=g,e[12]=d,e[13]=p):p=e[13],e[14]!==o||e[15]!==f?(O=f&&y.jsx(P4e,{text:o}),e[14]=o,e[15]=f,e[16]=O):O=e[16],e[17]!==o||e[18]!==a?(k=a&&y.jsx(R4e,{code:o}),e[17]=o,e[18]=a,e[19]=k):k=e[19],e[20]!==g||e[21]!==d?(S=d&&!g&&y.jsx(E4e,{onClick:()=>v(!0)}),e[20]=g,e[21]=d,e[22]=S):S=e[22],e[23]!==O||e[24]!==k||e[25]!==S?(w=y.jsxs("div",{className:"absolute top-0 right-0 my-1 mx-2 z-10 hover-action flex gap-2",children:[O,k,S]}),e[23]=O,e[24]=k,e[25]=S,e[26]=w):w=e[26];const T=g&&"opacity-20 h-8 overflow-hidden";let P;e[27]!==T?(P=we("cm",T),e[27]=T,e[28]=P):P=e[28];const j=n==="dark"?"dark":"light",D=!g,N=h==="python"?_4e:T4e;let E,A;return e[29]!==o||e[30]!==s||e[31]!==P||e[32]!==j||e[33]!==D||e[34]!==N?(E=y.jsx(Fx,{...s,className:P,theme:j,height:"100%",editable:D,extensions:N,value:o,readOnly:!0}),e[29]=o,e[30]=s,e[31]=P,e[32]=j,e[33]=D,e[34]=N,e[35]=E):E=e[35],e[36]!==E||e[37]!==b||e[38]!==p||e[39]!==w?(A=y.jsxs("div",{className:b,children:[p,w,E]}),e[36]=E,e[37]=b,e[38]=p,e[39]=w,e[40]=A):A=e[40],A}),hO.displayName="ReadonlyCode";let P4e,E4e,R4e,pc,CU,P4,SC,_U,iv,av,sv,j4e,CC,_C,E4,R4,lv,cv,TU,D4e,j4,TC,PU,A4e,EU,D4;P4e=t=>{const e=ue.c(5);let n;e[0]!==t.text?(n=ai.stopPropagation(async()=>{await Kd(t.text),Kr({title:"Copied to clipboard"})}),e[0]=t.text,e[1]=n):n=e[1];const r=n;let o,i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsx(zv,{size:14,strokeWidth:1.5}),e[2]=o):o=e[2],e[3]!==r?(i=y.jsx(qn,{content:"Copy code",usePortal:!1,children:y.jsx(Ft,{onClick:r,size:"xs",className:"py-0",variant:"secondary",children:o})}),e[3]=r,e[4]=i):i=e[4],i},E4e=t=>{const e=ue.c(3);let n,r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx(vK,{size:14,strokeWidth:1.5}),e[0]=n):n=e[0],e[1]!==t.onClick?(r=y.jsx(qn,{content:"Hide code",usePortal:!1,children:y.jsx(Ft,{onClick:t.onClick,size:"xs",className:"py-0",variant:"secondary",children:n})}),e[1]=t.onClick,e[2]=r):r=e[2],r},DJ=t=>{const e=ue.c(7);let n,r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx(gK,{className:"hover-action w-5 h-5 text-muted-foreground cursor-pointer absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 opacity-80 hover:opacity-100 z-20"}),e[0]=n):n=e[0],e[1]!==t.tooltip?(r=y.jsx(qn,{usePortal:!1,content:t.tooltip,children:n}),e[1]=t.tooltip,e[2]=r):r=e[2],e[3]!==t.className||e[4]!==t.onClick||e[5]!==r?(o=y.jsx("div",{className:t.className,onClick:t.onClick,children:r}),e[3]=t.className,e[4]=t.onClick,e[5]=r,e[6]=o):o=e[6],o},R4e=t=>{const e=ue.c(6),n=see();let r;e[0]!==n||e[1]!==t.code?(r=()=>{n(t.code)},e[0]=n,e[1]=t.code,e[2]=r):r=e[2];const o=r;let i,a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(OO,{size:14,strokeWidth:1.5}),e[3]=i):i=e[3],e[4]!==o?(a=y.jsx(qn,{content:"Add code to notebook",usePortal:!1,children:y.jsx(Ft,{onClick:o,size:"xs",className:"py-0",variant:"secondary",children:i})}),e[4]=o,e[5]=a):a=e[5],a},pc=t=>{const e=ue.c(5),{text:n,tooltip:r}=t;let o,i;return e[0]!==r?(o=r&&y.jsx(qn,{content:r,children:y.jsx(sk,{className:"w-3 h-3 mt-0.5"})}),e[0]=r,e[1]=o):o=e[1],e[2]!==o||e[3]!==n?(i=y.jsxs("h2",{className:"font-semibold my-0 flex items-center gap-1",children:[n,o]}),e[2]=o,e[3]=n,e[4]=i):i=e[4],i},CU=t=>{const e=ue.c(5),{children:n,className:r}=t;let o,i;return e[0]!==r?(o=we("flex flex-col gap-2",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},P4=t=>{const e=ue.c(4),{className:n}=t;let r,o;return e[0]!==n?(r=we("my-1",n),e[0]=n,e[1]=r):r=e[1],e[2]!==r?(o=y.jsx("hr",{className:r}),e[2]=r,e[3]=o):o=e[3],o},SC=t=>{const e=ue.c(5),{children:n,className:r}=t;let o,i;return e[0]!==r?(o=we("flex flex-col gap-1.5",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx("section",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},_U=t=>{const e=ue.c(7),{Icon:n,text:r}=t;let o,i,a;return e[0]!==n?(o=y.jsx(n,{className:"w-3 h-3 mr-2"}),e[0]=n,e[1]=o):o=e[1],e[2]!==r?(i=y.jsx("span",{children:r}),e[2]=r,e[3]=i):i=e[3],e[4]!==o||e[5]!==i?(a=y.jsxs("div",{className:"flex items-center",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a},iv=t=>{const e=ue.c(5),{children:n,className:r}=t;let o,i;return e[0]!==r?(o=we("py-1",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx(qO,{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},av=t=>{const e=ue.c(3),{children:n,value:r}=t;let o;return e[0]!==n||e[1]!==r?(o=y.jsx(ky,{value:r,className:"border-none",children:n}),e[0]=n,e[1]=r,e[2]=o):o=e[2],o},sv=t=>{const e=ue.c(5),{children:n,wrapperClassName:r}=t;let o,i;return e[0]!==r?(o=we("pb-2 flex flex-col gap-2",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx(wy,{wrapperClassName:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},j4e=t=>{const e=ue.c(4),{code:n,insertNewCell:r,language:o}=t;let i;return e[0]!==n||e[1]!==r||e[2]!==o?(i=y.jsx(hO,{minHeight:"330px",maxHeight:"330px",code:n,language:o,showHideCode:!1,showCopyCode:!1,insertNewCell:r}),e[0]=n,e[1]=r,e[2]=o,e[3]=i):i=e[3],i},CC="__clear__",_C=t=>{const e=ue.c(23),{fieldName:n,columns:r,onValueChange:o,includeCountField:i}=t,a=i===void 0||i,s=mo();let l;e[0]!==n?(l=n.replace(".field",".type"),e[0]=n,e[1]=l):l=e[1];const c=l;let u;e[2]!==n?(u=n.replace(".field",".selectedDataType"),e[2]=n,e[3]=u):u=e[3];const d=u;let f;e[4]!==n||e[5]!==s||e[6]!==o||e[7]!==d||e[8]!==c?(f=()=>{s.setValue(n,Da),s.setValue(c,Da),s.setValue(d,Da),o==null||o(Da,void 0)},e[4]=n,e[5]=s,e[6]=o,e[7]=d,e[8]=c,e[9]=f):f=e[9];const h=f;let g,v;return e[10]!==h||e[11]!==r||e[12]!==n||e[13]!==s||e[14]!==a||e[15]!==o||e[16]!==d||e[17]!==c?(g=b=>{const{field:p}=b;return y.jsx(jr,{children:y.jsx(Ir,{children:y.jsxs(Zs,{...p,onValueChange:O=>{if(O===CC)return void h();if(O===tv)return s.setValue(n,O),s.setValue(c,Da),s.setValue(d,Da),void(o==null?void 0:o(n,"number"));const k=r.find(S=>S.name===O);k&&(s.setValue(n,O),s.setValue(c,k.type),s.setValue(d,UW(k.type)),o==null||o(n,k.type))},value:p.value??Da,children:[y.jsx(Ws,{className:"w-40 truncate",onClear:p.value?h:void 0,children:y.jsx(Us,{placeholder:"Select column"})}),y.jsxs(cs,{children:[p.value&&y.jsx(Qo,{value:CC,children:y.jsxs("div",{className:"flex items-center truncate",children:[y.jsx(Qa,{className:"w-3 h-3 mr-2"}),"Clear"]})}),a&&y.jsxs(y.Fragment,{children:[y.jsx(Qo,{value:tv,children:y.jsxs("div",{className:"flex items-center truncate",children:[y.jsx(rO,{className:"w-3 h-3 mr-2"}),"Count of records"]})},tv),y.jsx(of,{})]}),r.map(Xht)]})]})})})},e[10]=h,e[11]=r,e[12]=n,e[13]=s,e[14]=a,e[15]=o,e[16]=d,e[17]=c,e[18]=g):g=e[18],e[19]!==n||e[20]!==s.control||e[21]!==g?(v=y.jsx(rr,{control:s.control,name:n,render:g}),e[19]=n,e[20]=s.control,e[21]=g,e[22]=v):v=e[22],v},E4=t=>{const e=ue.c(8),{fieldName:n,label:r,options:o,defaultValue:i}=t,a=mo();let s,l;return e[0]!==i||e[1]!==r||e[2]!==o?(s=c=>{const{field:u}=c;return y.jsxs(jr,{className:"flex flex-row items-center justify-between",children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsxs(Zs,{...u,onValueChange:u.onChange,value:u.value??i,children:[y.jsx(Ws,{className:"truncate",children:y.jsx(Us,{placeholder:"Select an option"})}),y.jsx(cs,{children:y.jsx(Cu,{children:o.filter(Hht).map(Yht)})})]})})]})},e[0]=i,e[1]=r,e[2]=o,e[3]=s):s=e[3],e[4]!==n||e[5]!==a.control||e[6]!==s?(l=y.jsx(rr,{control:a.control,name:n,render:s}),e[4]=n,e[5]=a.control,e[6]=s,e[7]=l):l=e[7],l},R4=t=>{const e=ue.c(6),{fieldName:n,label:r}=t,o=mo();let i,a;return e[0]!==r?(i=s=>{const{field:l}=s;return y.jsxs(jr,{className:"flex flex-row gap-2 items-center",children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsx(d0,{...l,value:l.value??Da,onValueChange:l.onChange,className:"text-xs h-5"})})]})},e[0]=r,e[1]=i):i=e[1],e[2]!==n||e[3]!==o.control||e[4]!==i?(a=y.jsx(rr,{control:o.control,name:n,render:i}),e[2]=n,e[3]=o.control,e[4]=i,e[5]=a):a=e[5],a},lv=t=>{const e=ue.c(17);let n,r,o,i,a,s;e[0]!==t?({fieldName:r,label:a,className:n,inputClassName:o,isDisabled:i,...s}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a,e[6]=s):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5],s=e[6]);const l=mo();let c,u;return e[7]!==n||e[8]!==o||e[9]!==i||e[10]!==a||e[11]!==s?(c=d=>{const{field:f}=d;return y.jsxs(jr,{className:we("flex flex-row items-center gap-2",n),children:[y.jsx(dr,{className:"whitespace-nowrap",children:a}),y.jsx(Ir,{children:y.jsx(i9,{...f,value:f.value,onValueChange:f.onChange,"aria-label":a,className:we("w-16",o),isDisabled:i,minValue:0,...s})})]})},e[7]=n,e[8]=o,e[9]=i,e[10]=a,e[11]=s,e[12]=c):c=e[12],e[13]!==r||e[14]!==l.control||e[15]!==c?(u=y.jsx(rr,{control:l.control,name:r,render:c}),e[13]=r,e[14]=l.control,e[15]=c,e[16]=u):u=e[16],u},cv=t=>{const e=ue.c(8),{fieldName:n,label:r,className:o,defaultValue:i}=t,a=mo();let s,l;return e[0]!==o||e[1]!==i||e[2]!==r?(s=c=>{const{field:u}=c;return y.jsxs(jr,{className:we("flex flex-row items-center gap-2",o),children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsx(Tl,{checked:u.value??i??!1,onCheckedChange:u.onChange,className:"w-4 h-4"})})]})},e[0]=o,e[1]=i,e[2]=r,e[3]=s):s=e[3],e[4]!==n||e[5]!==a.control||e[6]!==s?(l=y.jsx(rr,{control:a.control,name:n,render:s}),e[4]=n,e[5]=a.control,e[6]=s,e[7]=l):l=e[7],l},TU=t=>{const e=ue.c(16),{fieldName:n,label:r,value:o,start:i,stop:a,step:s,className:l}=t,[c,u]=ge.useState(o),d=mo();let f,h,g,v;return e[0]!==o?(f=()=>{u(o)},h=[o],e[0]=o,e[1]=f,e[2]=h):(f=e[1],h=e[2]),ge.useEffect(f,h),e[3]!==l||e[4]!==n||e[5]!==d||e[6]!==c||e[7]!==r||e[8]!==i||e[9]!==s||e[10]!==a?(g=b=>{const{field:p}=b;return y.jsxs(jr,{className:we("flex flex-row items-center gap-2 w-1/2",l),children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsx(JW,{...p,id:n,className:"relative flex items-center select-none",value:[c],min:i,max:a,step:s,onValueChange:O=>{const[k]=O;u(k),p.onChange(k)},onValueCommit:O=>{const[k]=O;p.onChange(k),d.setValue(n,k)},valueMap:Ght})})]})},e[3]=l,e[4]=n,e[5]=d,e[6]=c,e[7]=r,e[8]=i,e[9]=s,e[10]=a,e[11]=g):g=e[11],e[12]!==n||e[13]!==d.control||e[14]!==g?(v=y.jsx(rr,{control:d.control,name:n,render:g}),e[12]=n,e[13]=d.control,e[14]=g,e[15]=v):v=e[15],v},D4e=t=>{const e=ue.c(21),{fieldName:n,label:r,className:o}=t,i=mo();let a;e[0]!==n||e[1]!==i?(a=i.watch(n),e[0]=n,e[1]=i,e[2]=a):a=e[2];const s=a;let l;e[3]!==s?(l=s??[],e[3]=s,e[4]=l):l=e[4];const[c,u]=ge.useState(l);let d;e[5]!==c||e[6]!==n||e[7]!==i?(d=()=>{const b=[...c,"#000000"];u(b),i.setValue(n,b)},e[5]=c,e[6]=n,e[7]=i,e[8]=d):d=e[8];const f=d;let h;e[9]!==c||e[10]!==n||e[11]!==i?(h=b=>{const p=c.filter((O,k)=>k!==b);u(p),i.setValue(n,p)},e[9]=c,e[10]=n,e[11]=i,e[12]=h):h=e[12];const g=h;let v;if(e[13]!==f||e[14]!==o||e[15]!==c||e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==g){const b=(p,O)=>{const k=[...c];k[p]=O,u(k),i.setValue(n,k)};v=y.jsx(rr,{control:i.control,name:n,render:()=>y.jsxs(jr,{className:we("flex flex-col gap-2",o),children:[y.jsx(dr,{children:r}),y.jsxs("div",{className:"flex flex-col gap-2",children:[c.map((p,O)=>y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("input",{type:"color",value:p,onChange:k=>b(O,k.target.value),className:"w-4 h-4 rounded cursor-pointer"}),y.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:p}),y.jsx(Ft,{variant:"ghost",size:"sm",onClick:()=>g(O),className:"h-4 w-4 p-0",children:y.jsx(Qa,{className:"h-2 w-2"})})]},O)),y.jsxs(Ft,{variant:"outline",size:"sm",onClick:f,className:"w-fit h-6 text-xs",children:[y.jsx(OO,{className:"h-3 w-3 mr-1"}),"Add Color"]})]})]})}),e[13]=f,e[14]=o,e[15]=c,e[16]=n,e[17]=i,e[18]=r,e[19]=g,e[20]=v}else v=e[20];return v},j4=t=>{const e=ue.c(10),{fieldName:n,label:r}=t,o=mo();let i;e[0]!==n||e[1]!==o?(i=()=>{o.setValue(n,Da)},e[0]=n,e[1]=o,e[2]=i):i=e[2];const a=i,s=Kht;let l,c;return e[3]!==a||e[4]!==r?(l=u=>{const{field:d}=u;return y.jsxs(jr,{className:"flex flex-row items-center justify-between w-full",children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsxs(Zs,{...d,onValueChange:f=>{f===CC?a():d.onChange(f)},value:d.value??WW,children:[y.jsx(Ws,{onClear:d.value?a:void 0,children:y.jsx(Us,{placeholder:"Select unit"})}),y.jsxs(cs,{className:"w-72",children:[d.value&&y.jsxs(y.Fragment,{children:[y.jsx(Qo,{value:CC,children:y.jsxs("div",{className:"flex items-center truncate",children:[y.jsx(Qa,{className:"w-3 h-3 mr-2"}),"Clear"]})}),y.jsx(of,{})]}),y.jsxs(Cu,{children:[Hje.map(s),y.jsx(of,{}),Xje.map(s)]})]})]})})]})},e[3]=a,e[4]=r,e[5]=l):l=e[5],e[6]!==n||e[7]!==o.control||e[8]!==l?(c=y.jsx(rr,{control:o.control,name:n,render:l}),e[6]=n,e[7]=o.control,e[8]=l,e[9]=c):c=e[9],c},TC=t=>{const e=ue.c(9),{fieldName:n,label:r,defaultValue:o,onValueChange:i}=t,[a,s]=ge.useState(!1),l=mo();let c,u;return e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==i?(c=d=>{const{field:f}=d;return y.jsxs(jr,{className:"flex flex-row items-center justify-between w-full",children:[y.jsx(dr,{children:r}),y.jsx(Ir,{children:y.jsxs(Zs,{...f,onValueChange:h=>{f.onChange(h),i==null||i(h)},value:f.value??o,open:a,onOpenChange:s,children:[y.jsx(Ws,{children:y.jsx(Us,{placeholder:"Select an option"})}),y.jsx(cs,{children:y.jsx(Cu,{children:Zje.map(h=>{const g=hj[h],v=h==="string"?"categorical":h;return y.jsx(Qo,{value:h,className:"flex flex-col items-start justify-center",subtitle:a&&y.jsx("span",{className:"text-xs text-muted-foreground",children:Sft[h]}),children:y.jsx(_U,{Icon:g,text:Eu(v)})},h)})})})]})})]})},e[0]=o,e[1]=a,e[2]=r,e[3]=i,e[4]=c):c=e[4],e[5]!==n||e[6]!==l.control||e[7]!==c?(u=y.jsx(rr,{control:l.control,name:n,render:c}),e[5]=n,e[6]=l.control,e[7]=c,e[8]=u):u=e[8],u},PU=t=>{const e=ue.c(12),{fieldName:n,selectedDataType:r,binFieldName:o,defaultAggregation:i}=t,a=mo(),s=r==="string"?Kje:Gje,{chartType:l}=Md(),c=l!==ei.HEATMAP,u=Jht,d=ept;let f;e[0]!==o||e[1]!==a?(f=b=>{const{value:p,previousValue:O,onChange:k}=b;p===hC?a.setValue(o,!0):O===hC&&a.setValue(o,!1),k(p)},e[0]=o,e[1]=a,e[2]=f):f=e[2];const h=f;let g,v;return e[3]!==s||e[4]!==i||e[5]!==h||e[6]!==c?(g=b=>{const{field:p}=b;return y.jsx(jr,{children:y.jsx(Ir,{children:y.jsxs(Zs,{...p,value:(p.value??i??Ad).toString(),onValueChange:O=>{h({value:O,previousValue:p.value,onChange:p.onChange})},children:[y.jsx(Ws,{variant:"ghost",children:y.jsx(Us,{})}),y.jsx(cs,{children:y.jsxs(Cu,{children:[y.jsx(sO,{children:"Aggregation"}),s.map(O=>{const k=Oft[O],S=u(wft[O]),w=d({value:O,Icon:k,subtitle:S});return O===hC?c?y.jsxs("div",{children:[y.jsx(of,{}),w]},O):null:w})]})})]})})})},e[3]=s,e[4]=i,e[5]=h,e[6]=c,e[7]=g):g=e[7],e[8]!==n||e[9]!==a.control||e[10]!==g?(v=y.jsx(rr,{control:a.control,name:n,render:g}),e[8]=n,e[9]=a.control,e[10]=g,e[11]=v):v=e[11],v},A4e=t=>{const e=ue.c(7),{fieldName:n,saveFunction:r}=t,o=mo(),{fields:i}=Md(),a=tpt;let s,l;return e[0]!==i||e[1]!==r?(s=c=>{const{field:u}=c,d=u.value,f=(d==null?void 0:d.map(npt))??[];return y.jsx(jr,{children:y.jsx(Ir,{children:y.jsx(w4e,{options:(i==null?void 0:i.map(rpt))??[],value:f,setValue:h=>{const g=(typeof h=="function"?h([]):h).map(v=>a(v,i));u.onChange(g),r()},label:null,fullWidth:!1})})})},e[0]=i,e[1]=r,e[2]=s):s=e[2],e[3]!==n||e[4]!==o.control||e[5]!==s?(l=y.jsx(rr,{control:o.control,name:n,render:s}),e[3]=n,e[4]=o.control,e[5]=s,e[6]=l):l=e[6],l},EU=t=>{const e=ue.c(5),{fieldName:n,label:r,defaultValue:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Yje.map(opt),e[0]=i):i=e[0];const a=o??"ascending";let s;return e[1]!==n||e[2]!==r||e[3]!==a?(s=y.jsx(E4,{fieldName:n,label:r,options:i,defaultValue:a}),e[1]=n,e[2]=r,e[3]=a,e[4]=s):s=e[4],s},D4=t=>{var h,g,v,b;const e=ue.c(10),{fieldName:n}=t,r=mo();let o;e[0]!==r.control?(o={control:r.control},e[0]=r.control,e[1]=o):o=e[1];const i=cu(o);if(!((g=(h=i[n])==null?void 0:h.bin)==null?void 0:g.binned))return null;const s=!Number.isNaN((b=(v=i[n])==null?void 0:v.bin)==null?void 0:b.step),l=`${n}.bin.step`;let c;e[2]!==l?(c=y.jsx(lv,{fieldName:l,label:"Bin step",inputClassName:"w-14",placeholder:"0.5"}),e[2]=l,e[3]=c):c=e[3];const u=`${n}.bin.maxbins`;let d,f;return e[4]!==s||e[5]!==u?(d=y.jsx(lv,{fieldName:u,label:"Max bins",inputClassName:"w-14",isDisabled:s,placeholder:"10"}),e[4]=s,e[5]=u,e[6]=d):d=e[6],e[7]!==c||e[8]!==d?(f=y.jsxs("div",{className:"flex flex-row justify-between",children:[c,d]}),e[7]=c,e[8]=d,e[9]=f):f=e[9],f};function Xht(t){if(t.name.trim()===Da)return null;const e=hj[t.type];return y.jsx(Qo,{value:t.name,children:y.jsxs("div",{className:"flex items-center truncate",children:[y.jsx(e,{className:"w-3 h-3 mr-2"}),t.name]})},t.name)}function Hht(t){return t.value!==Da}function Yht(t){return y.jsx(Qo,{value:t.value,children:t.display},t.value)}function Ght(t){return t}function Kht(t){const[e,n]=Cft[t];return y.jsx(Qo,{value:t,className:"flex flex-row",subtitle:y.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:n}),children:e},t)}function Jht(t){return y.jsx("span",{className:"text-xs text-muted-foreground pr-10",children:t})}function ept(t){const{value:e,Icon:n,subtitle:r}=t;return y.jsx(Qo,{value:e,className:"flex flex-col items-start justify-center",subtitle:r,children:y.jsxs("div",{className:"flex items-center",children:[y.jsx(n,{className:"w-3 h-3 mr-2"}),Eu(e)]})},e)}function tpt(t,e){const n=e.find(r=>r.name===t);return{field:t,type:(n==null?void 0:n.type)??"string"}}function npt(t){return t.field}function rpt(t){return t.name}function opt(t){return{display:y.jsx(_U,{Icon:t==="ascending"?cce:O6,text:Eu(t)}),value:t}}function uv(t){return ti(t==null?void 0:t.field)&&(t==null?void 0:t.field)!==tv}function PC(t){return(t==null?void 0:t.selectedDataType)==="number"&&uv(t)}function RU(t){return(t==null?void 0:t.selectedDataType)==="temporal"&&uv(t)}function A4(t){const e=t!=null&&t.type?UW(t.type):"string";return{inferredDataType:e,selectedDataType:(t==null?void 0:t.selectedDataType)||e}}const jU=t=>{const e=ue.c(14),{columnFieldName:n,column:r,columns:o,binFieldName:i,defaultAggregation:a}=t;let s;e[0]!==r?(s=A4(r),e[0]=r,e[1]=s):s=e[1];const{selectedDataType:l}=s;let c,u,d;return e[2]!==n||e[3]!==o?(c=y.jsx(_C,{fieldName:n,columns:o}),e[2]=n,e[3]=o,e[4]=c):c=e[4],e[5]!==i||e[6]!==r||e[7]!==n||e[8]!==a||e[9]!==l?(u=function(f){return(f==null?void 0:f.selectedDataType)!=="temporal"&&uv(f)}(r)&&y.jsx(PU,{fieldName:n.replace(".field",".aggregate"),selectedDataType:l,binFieldName:i,defaultAggregation:a}),e[5]=i,e[6]=r,e[7]=n,e[8]=a,e[9]=l,e[10]=u):u=e[10],e[11]!==c||e[12]!==u?(d=y.jsxs("div",{className:"flex flex-row justify-between",children:[c,u]}),e[11]=c,e[12]=u,e[13]=d):d=e[13],d},ipt=()=>{const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[y.jsx(af,{className:"w-10 h-10 animate-spin",strokeWidth:1}),y.jsx("span",{children:"Loading chart..."})]}),t[0]=e):e=t[0],e},apt=t=>{const e=ue.c(2),{error:n}=t;let r;return e[0]!==n?(r=y.jsx("div",{className:"flex items-center justify-center",children:y.jsx(Hd,{error:n})}),e[0]=n,e[1]=r):r=e[1],r},spt=t=>{const e=ue.c(7),{value:n,onValueChange:r}=t;let o,i,a,s,l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=fs({variant:"outline",className:"user-select-none w-full justify-between px-3"}),i=y.jsx(Us,{}),e[0]=o,e[1]=i):(o=e[0],i=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsxs(J9,{className:o,children:[i,y.jsx(Wxe,{asChild:!0,children:y.jsx(xu,{className:"h-4 w-4 opacity-50"})})]}),e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[a,y.jsx(cs,{children:Tft.map(upt)})]}),e[3]=s):s=e[3],e[4]!==r||e[5]!==n?(l=y.jsx(Zs,{value:n,onValueChange:r,children:s}),e[4]=r,e[5]=n,e[6]=l):l=e[6],l},lpt=t=>{const e=ue.c(10),{chartType:n}=t,r=xft[n];let o,i,a,s;return e[0]!==r?(o=y.jsx(r,{className:"w-4 h-4 mr-2"}),e[0]=r,e[1]=o):o=e[1],e[2]!==n?(i=Eu(n),e[2]=n,e[3]=i):i=e[3],e[4]!==o||e[5]!==i?(a=y.jsxs("div",{className:"flex items-center",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],e[7]!==n||e[8]!==a?(s=y.jsx(Qo,{value:n,className:"gap-2",children:a}),e[7]=n,e[8]=a,e[9]=s):s=e[9],s},M4e=()=>{var v,b,p,O,k,S,w;const t=ue.c(22),e=mo();let n;t[0]!==e.control?(n={control:e.control},t[0]=e.control,t[1]=n):n=t[1];const r=cu(n),o=Md(),i=(v=r.general)==null?void 0:v.xColumn;let a;t[2]!==i?(a=A4(i),t[2]=i,t[3]=a):a=t[3];const{inferredDataType:s}=a,l=o.chartType===ei.LINE||o.chartType===ei.BAR||o.chartType===ei.AREA;let c,u,d,f,h,g;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(pc,{text:"X-Axis"}),t[4]=c):c=t[4],t[5]!==o.fields||t[6]!==i?(u=y.jsx(jU,{columnFieldName:"general.xColumn.field",column:i,columns:o.fields,binFieldName:"xAxis.bin.binned"}),t[5]=o.fields,t[6]=i,t[7]=u):u=t[7],t[8]!==s||t[9]!==i?(d=uv(i)&&y.jsx(TC,{label:"Data Type",fieldName:"general.xColumn.selectedDataType",defaultValue:s}),t[8]=s,t[9]=i,t[10]=d):d=t[10],t[11]!==i?(f=RU(i)&&y.jsx(j4,{fieldName:"general.xColumn.timeUnit",label:"Time Resolution"}),t[11]=i,t[12]=f):f=t[12],t[13]!==l||t[14]!==((p=(b=r.general)==null?void 0:b.xColumn)==null?void 0:p.sort)||t[15]!==i?(h=uv(i)&&l&&y.jsxs(y.Fragment,{children:[y.jsx(EU,{fieldName:"general.xColumn.sort",label:"Sort",defaultValue:(k=(O=r.general)==null?void 0:O.xColumn)==null?void 0:k.sort}),PC(i)&&y.jsx(D4,{fieldName:"xAxis"})]}),t[13]=l,t[14]=(w=(S=r.general)==null?void 0:S.xColumn)==null?void 0:w.sort,t[15]=i,t[16]=h):h=t[16],t[17]!==u||t[18]!==d||t[19]!==f||t[20]!==h?(g=y.jsxs(SC,{children:[c,u,d,f,h]}),t[17]=u,t[18]=d,t[19]=f,t[20]=h,t[21]=g):g=t[21],g},N4e=()=>{var P,j;const t=ue.c(29),e=mo();let n;t[0]!==e.control?(n={control:e.control},t[0]=e.control,t[1]=n):n=t[1];const r=cu(n),o=Md(),i=(P=r.general)==null?void 0:P.yColumn,a=i==null?void 0:i.field;let s;t[2]!==a?(s=ti(a),t[2]=a,t[3]=s):s=t[3];const l=s,c=(j=r.general)==null?void 0:j.xColumn,u=c==null?void 0:c.field;let d;t[4]!==u?(d=ti(u),t[4]=u,t[5]=d):d=t[5];const f=d;let h;t[6]!==i?(h=A4(i),t[6]=i,t[7]=h):h=t[7];const{inferredDataType:g}=h;let v,b,p,O,k,S,w,T;return PC(i)?v=Uje:function(D){return(D==null?void 0:D.selectedDataType)==="string"&&uv(D)}(i)&&(v="count"),t[8]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsx(pc,{text:"Y-Axis"}),t[8]=b):b=t[8],t[9]!==o.fields||t[10]!==v||t[11]!==i?(p=y.jsx(jU,{columnFieldName:"general.yColumn.field",column:i,columns:o.fields,binFieldName:"yAxis.bin.binned",defaultAggregation:v}),t[9]=o.fields,t[10]=v,t[11]=i,t[12]=p):p=t[12],t[13]!==g||t[14]!==i?(O=uv(i)&&y.jsx(TC,{label:"Data Type",fieldName:"general.yColumn.selectedDataType",defaultValue:g}),t[13]=g,t[14]=i,t[15]=O):O=t[15],t[16]!==i?(k=RU(i)&&y.jsx(j4,{fieldName:"general.yColumn.timeUnit",label:"Time Resolution"}),t[16]=i,t[17]=k):k=t[17],t[18]!==f||t[19]!==l?(S=l&&f&&y.jsx(cv,{fieldName:"general.horizontal",label:"Invert axis"}),t[18]=f,t[19]=l,t[20]=S):S=t[20],t[21]!==i?(w=PC(i)&&y.jsx(D4,{fieldName:"yAxis"}),t[21]=i,t[22]=w):w=t[22],t[23]!==S||t[24]!==w||t[25]!==p||t[26]!==O||t[27]!==k?(T=y.jsxs(SC,{children:[b,p,O,k,S,w]}),t[23]=S,t[24]=w,t[25]=p,t[26]=O,t[27]=k,t[28]=T):T=t[28],T},$4e=()=>{var f;const t=ue.c(13),{fields:e}=Md(),n=mo();let r;t[0]!==n.control?(r={control:n.control},t[0]=n.control,t[1]=r):r=t[1];const o=cu(r),i=(f=o.general)==null?void 0:f.colorByColumn;let a;t[2]!==i?(a=PC(i),t[2]=i,t[3]=a):a=t[3];const s=a;let l,c,u,d;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(pc,{text:"Color by"}),t[4]=l):l=t[4],t[5]!==i||t[6]!==e?(c=y.jsx(jU,{columnFieldName:"general.colorByColumn.field",column:i,columns:e,binFieldName:"color.bin.binned"}),t[5]=i,t[6]=e,t[7]=c):c=t[7],t[8]!==s?(u=s&&y.jsx(D4,{fieldName:"color"}),t[8]=s,t[9]=u):u=t[9],t[10]!==c||t[11]!==u?(d=y.jsxs(SC,{children:[l,c,u]}),t[10]=c,t[11]=u,t[12]=d):d=t[12],d},cpt=()=>{var l,c;const t=ue.c(7),e=Md().fields,n=mo();let r;t[0]!==n.control?(r={control:n.control},t[0]=n.control,t[1]=r):r=t[1];const o=cu(r);let i;t[2]!==e||t[3]!==((l=o.general)==null?void 0:l.facet)?(i=u=>{var v,b;const d=(b=(v=o.general)==null?void 0:v.facet)==null?void 0:b[u],f=ti(d==null?void 0:d.field),{inferredDataType:h}=A4(d),g=u==="row"?"general.facet.row.linkYAxis":"general.facet.column.linkXAxis";return y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsxs("div",{className:"flex flex-row justify-between",children:[y.jsx("p",{className:"font-semibold",children:Eu(u)}),y.jsx(_C,{fieldName:`general.facet.${u}.field`,columns:e})]}),f&&y.jsxs(y.Fragment,{children:[y.jsx(TC,{label:"Data Type",fieldName:`general.facet.${u}.selectedDataType`,defaultValue:h}),RU(d)&&y.jsx(j4,{fieldName:`general.facet.${u}.timeUnit`,label:"Time Resolution"}),PC(d)&&y.jsxs("div",{className:"flex flex-row justify-between",children:[y.jsx(cv,{fieldName:`general.facet.${u}.binned`,label:"Binned",defaultValue:!0}),y.jsx(lv,{fieldName:`general.facet.${u}.maxbins`,label:"Max Bins",placeholder:"6",defaultValue:6})]}),y.jsx(EU,{fieldName:`general.facet.${u}.sort`,label:"Sort"}),y.jsx(cv,{fieldName:g,label:`Link ${u==="row"?"Y":"X"} Axes`,defaultValue:!0})]})]})},t[2]=e,t[3]=(c=o.general)==null?void 0:c.facet,t[4]=i):i=t[4];const a=i;let s;return t[5]!==a?(s=y.jsxs(SC,{className:"gap-3",children:[a("row"),a("column")]}),t[5]=a,t[6]=s):s=t[6],s};function upt(t){return y.jsx(lpt,{chartType:t},t)}const dpt=()=>{var k,S;const t=ue.c(17),e=mo();let n;t[0]!==e.control?(n={control:e.control},t[0]=e.control,t[1]=n):n=t[1];const r=cu(n),o=(k=r.general)==null?void 0:k.yColumn,i=(S=r.general)==null?void 0:S.colorByColumn,a=o==null?void 0:o.field;let s;t[2]!==a?(s=ti(a),t[2]=a,t[3]=s):s=t[3];const l=s,{chartType:c}=Md();let u;t[4]!==c||t[5]!==(i==null?void 0:i.field)?(u=ti(i==null?void 0:i.field)&&(c===ei.BAR||c===ei.LINE),t[4]=c,t[5]=i==null?void 0:i.field,t[6]=u):u=t[6];const d=u;let f,h,g,v,b,p,O;return t[7]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(qn,{delayDuration:100,content:"To persist a chart, add the generated Python code to a new cell.",children:y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(vO,{className:"h-3.5 w-3.5 mb-0.5 text-muted-foreground"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Charts are not saved."})]})}),h=y.jsx(M4e,{}),g=y.jsx(N4e,{}),t[7]=f,t[8]=h,t[9]=g):(f=t[7],h=t[8],g=t[9]),t[10]!==d||t[11]!==l?(v=l&&y.jsxs(y.Fragment,{children:[y.jsx($4e,{}),d&&y.jsx("div",{className:"flex flex-row gap-2",children:y.jsx(cv,{fieldName:"general.stacking",label:"Stacked"})})]}),t[10]=d,t[11]=l,t[12]=v):v=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsx(P4,{}),p=y.jsx(DU,{}),t[13]=b,t[14]=p):(b=t[13],p=t[14]),t[15]!==v?(O=y.jsxs(y.Fragment,{children:[f,h,g,v,b,p]}),t[15]=v,t[16]=O):O=t[16],O},fpt=()=>{const t=ue.c(15),{chartType:e}=Md();let n,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx(iv,{className:"pt-0",children:y.jsx(pc,{text:"General"})}),t[0]=n):n=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(r=y.jsx(R4,{label:"Plot title",fieldName:"general.title"}),t[1]=r):r=t[1];const o=e===ei.SCATTER;let i,a,s,l,c,u,d,f,h,g,v;return t[2]!==o?(i=y.jsxs(av,{value:"general",children:[n,y.jsxs(sv,{children:[r,y.jsx(cv,{fieldName:"style.gridLines",label:"Show grid lines",defaultValue:o})]})]}),t[2]=o,t[3]=i):i=t[3],t[4]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(iv,{children:y.jsx(pc,{text:"X-Axis"})}),t[4]=a):a=t[4],t[5]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs(av,{value:"xAxis",children:[a,y.jsxs(sv,{children:[y.jsx(R4,{label:"Label",fieldName:"xAxis.label"}),y.jsx(TU,{fieldName:"xAxis.width",label:"Width",value:400,start:200,stop:800})]})]}),t[5]=s):s=t[5],t[6]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(iv,{children:y.jsx(pc,{text:"Y-Axis"})}),t[6]=l):l=t[6],t[7]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsxs(av,{value:"yAxis",children:[l,y.jsxs(sv,{children:[y.jsx(R4,{label:"Label",fieldName:"yAxis.label"}),y.jsx(TU,{fieldName:"yAxis.height",label:"Height",value:300,start:150,stop:600})]})]}),t[7]=c):c=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(iv,{children:y.jsx(pc,{text:"Color"})}),t[8]=u):u=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsx(E4,{fieldName:"color.field",label:"Field",options:Jje.map(hpt),defaultValue:Ad}),t[9]=d):d=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(E4,{fieldName:"color.scheme",label:"Color scheme",defaultValue:d4,options:kft.map(ppt)}),h=y.jsx(D4e,{fieldName:"color.range",label:"Color range"}),t[10]=f,t[11]=h):(f=t[10],h=t[11]),t[12]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsxs(av,{value:"color",children:[u,y.jsxs(sv,{children:[d,f,h,y.jsxs("p",{className:"text-xs",children:[y.jsx(sk,{className:"w-2.5 h-2.5 inline mb-1 mr-1"}),"If you are using color range, color scheme will be ignored."]})]})]}),t[12]=g):g=t[12],t[13]!==i?(v=y.jsxs(Sy,{type:"multiple",children:[i,s,c,g]}),t[13]=i,t[14]=v):v=t[14],v},DU=()=>{var f;const t=ue.c(11),{saveForm:e}=Md(),n=mo();let r;t[0]!==n.control?(r={control:n.control},t[0]=n.control,t[1]=r):r=t[1];const o=cu(r),i=(f=o.tooltips)==null?void 0:f.auto;let a,s,l,c,u,d;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(iv,{className:"pt-0",children:y.jsx(pc,{text:"Faceting",tooltip:"Repeat the chart for each unique field value"})}),t[2]=a):a=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs(av,{value:"facet",children:[a,y.jsx(sv,{children:y.jsx(cpt,{})})]}),t[3]=s):s=t[3],t[4]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(iv,{children:y.jsx(pc,{text:"Tooltips"})}),t[4]=l):l=t[4],t[5]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(cv,{fieldName:"tooltips.auto",label:"Include X, Y and Color"}),t[5]=c):c=t[5],t[6]!==i||t[7]!==e?(u=!i&&y.jsx(A4e,{fieldName:"tooltips.fields",saveFunction:e}),t[6]=i,t[7]=e,t[8]=u):u=t[8],t[9]!==u?(d=y.jsxs(Sy,{type:"multiple",children:[s,y.jsxs(av,{value:"tooltips",children:[l,y.jsxs(sv,{wrapperClassName:"flex-row justify-between",children:[c,u]})]})]}),t[9]=u,t[10]=d):d=t[10],d};function hpt(t){return{display:Eu(t),value:t}}function ppt(t){return{display:Eu(t),value:t}}const mpt=()=>{var p,O,k,S;const t=ue.c(17),e=mo();let n;t[0]!==e.control?(n={control:e.control},t[0]=e.control,t[1]=n):n=t[1];const r=cu(n),o=(O=(p=r.general)==null?void 0:p.xColumn)==null?void 0:O.field;let i;t[2]!==o?(i=ti(o),t[2]=o,t[3]=i):i=t[3];const a=i,s=(S=(k=r.general)==null?void 0:k.yColumn)==null?void 0:S.field;let l;t[4]!==s?(l=ti(s),t[4]=s,t[5]=l):l=t[5];const c=l;let u,d,f,h,g,v,b;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(M4e,{}),t[6]=u):u=t[6],t[7]!==a?(d=a&&y.jsx(lv,{fieldName:"xAxis.bin.maxbins",label:"Number of boxes (max)",className:"justify-between"}),t[7]=a,t[8]=d):d=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(N4e,{}),t[9]=f):f=t[9],t[10]!==c?(h=c&&y.jsxs(y.Fragment,{children:[y.jsx(lv,{fieldName:"yAxis.bin.maxbins",label:"Number of boxes (max)",className:"justify-between"}),y.jsx($4e,{})]}),t[10]=c,t[11]=h):h=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(v=y.jsx(P4,{}),g=y.jsx(DU,{}),t[12]=g,t[13]=v):(g=t[12],v=t[13]),t[14]!==d||t[15]!==h?(b=y.jsxs(y.Fragment,{children:[u,d,f,h,v,g]}),t[14]=d,t[15]=h,t[16]=b):b=t[16],b},gpt=()=>{var S,w,T;const t=ue.c(25),e=mo(),{fields:n}=Md();let r;t[0]!==e.control?(r={control:e.control},t[0]=e.control,t[1]=r):r=t[1];const o=cu(r),i=(S=o.general)==null?void 0:S.colorByColumn;let a,s=(T=(w=o.general)==null?void 0:w.yColumn)==null?void 0:T.selectedDataType;s!==Da&&s||(s="string"),t[2]!==i?(a=i!=null&&i.type?UW(i.type):"string",t[2]=i,t[3]=a):a=t[3];const l=a;let c,u,d,f,h,g,v,b,p,O,k;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(pc,{text:"Color by"}),t[4]=c):c=t[4],t[5]!==n?(u=y.jsx(_C,{fieldName:"general.colorByColumn.field",columns:n,includeCountField:!1}),t[5]=n,t[6]=u):u=t[6],t[7]!==(i==null?void 0:i.field)||t[8]!==l?(d=ti(i==null?void 0:i.field)&&y.jsx(TC,{fieldName:"general.colorByColumn.selectedDataType",label:"Data Type",defaultValue:l}),t[7]=i==null?void 0:i.field,t[8]=l,t[9]=d):d=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(pc,{text:"Size by"}),t[10]=f):f=t[10],t[11]!==n?(h=y.jsx(_C,{fieldName:"general.yColumn.field",columns:n}),t[11]=n,t[12]=h):h=t[12],t[13]!==s?(g=y.jsx(PU,{fieldName:"general.yColumn.aggregate",selectedDataType:s,binFieldName:"yAxis.bin.binned"}),t[13]=s,t[14]=g):g=t[14],t[15]!==h||t[16]!==g?(v=y.jsxs("div",{className:"flex flex-row justify-between",children:[h,g]}),t[15]=h,t[16]=g,t[17]=v):v=t[17],t[18]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(lv,{fieldName:"style.innerRadius",label:"Donut size",className:"w-32"}),b=y.jsx(P4,{}),p=y.jsx(DU,{}),t[18]=b,t[19]=p,t[20]=O):(b=t[18],p=t[19],O=t[20]),t[21]!==u||t[22]!==d||t[23]!==v?(k=y.jsxs(y.Fragment,{children:[c,u,d,f,v,O,b,p]}),t[21]=u,t[22]=d,t[23]=v,t[24]=k):k=t[24],k},vpt=ge.lazy(()=>Be(()=>import("./index-7igCaZQI.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107,108,109,110,111,112,113]),import.meta.url).then(t=>({default:t.Vega}))),ypt=t=>{const e=ue.c(8),{baseSpec:n,data:r,height:o}=t,{theme:i}=as();if(!r){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx("div",{children:"No data"}),e[0]=c):c=e[0],c}let a;e[1]!==r||e[2]!==o||e[3]!==i?(a=c=>{if(typeof c=="string")return y.jsx(I4e,{children:c});const u=function(d,f){return{...d,data:{values:f}}}(c,r);return y.jsx(ge.Suspense,{fallback:y.jsx(bpt,{}),children:y.jsx(vpt,{spec:u,theme:i==="dark"?"dark":void 0,height:o,actions:{export:!0,source:!1,compiled:!1,editor:!0}})})},e[1]=r,e[2]=o,e[3]=i,e[4]=a):a=e[4];const s=a;let l;return e[5]!==n||e[6]!==s?(l=y.jsx("div",{className:"h-full m-auto rounded-md w-full",children:s(n)}),e[5]=n,e[6]=s,e[7]=l):l=e[7],l},bpt=()=>{const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx(I4e,{children:"Loading chart..."}),t[0]=e):e=t[0],e},I4e=t=>{const e=ue.c(3),{children:n}=t;let r,o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=y.jsx(S6,{className:"w-10 h-10 text-muted-foreground"}),e[0]=r):r=e[0],e[1]!==n?(o=y.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 mt-14",children:[r,y.jsx("span",{className:"text-md font-semibold text-muted-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o},AU=Qe({binned:pt().optional(),step:yt().optional(),maxbins:yt().optional()}),MU=Qe({field:Pe().optional(),type:un([...r4,Da]).optional(),selectedDataType:un([...Zje,Da]).optional(),sort:un(Yje).default("ascending").optional(),timeUnit:un(_ft).optional()}),NU=MU.extend({aggregate:un(Gje).default(Ad).optional()}),xpt=MU.extend({linkYAxis:pt().default(!0),binned:pt().default(!0),maxbins:yt().default(6)}),Opt=MU.extend({linkXAxis:pt().default(!0),binned:pt().default(!0),maxbins:yt().default(6)}),Q4e=Qe({general:Qe({title:Pe().optional(),xColumn:NU.optional(),yColumn:NU.optional(),colorByColumn:NU.optional(),facet:Qe({row:xpt,column:Opt}).optional(),horizontal:pt().optional(),stacking:pt().optional()}).optional(),xAxis:Qe({label:Pe().optional(),width:yt().optional(),bin:AU.optional()}).optional(),yAxis:Qe({label:Pe().optional(),height:yt().optional(),bin:AU.optional()}).optional(),color:Qe({field:un([...Jje,Ad]).default(Ad),scheme:Pe().default(d4).optional(),range:Wt(Pe()).optional(),domain:Wt(Pe()).optional(),bin:AU.optional()}).optional(),style:Qe({innerRadius:yt().optional(),gridLines:pt().optional()}).optional(),tooltips:Qe({auto:pt(),fields:Wt(Qe({field:Pe(),type:un(r4)}))}).default({auto:!0,fields:[]}).optional()});function L4e(){return{general:{facet:{row:{linkYAxis:!0,binned:!0,maxbins:6},column:{linkXAxis:!0,binned:!0,maxbins:6}}},color:{field:Ad,scheme:"default"},tooltips:{auto:!0,fields:[]}}}const $U="marimo:charts:v2",wpt=Qe({tabName:Pe().transform(t=>t),chartType:Pe().transform(t=>t),config:Q4e}),kpt=Wt(sf([Pe().transform(t=>t),Wt(wpt)])),IU=new ose($U,kpt,()=>[]),z4e={getItem:t=>{try{const e=IU.get(t);return new Map(e)}catch(e){return Ve.warn("Error getting chart storage",e),new Map}},setItem:(t,e)=>{IU.set(t,[...e.entries()])},removeItem:t=>{IU.remove(t)}},Spt=Q_($U,new Map,z4e);function V4e(t,e){const n=Eu(e);return t===0?`${n} Chart`:`${n} Chart ${t+1}`}const Cpt=z4e.getItem($U),EC="table",_pt=t=>{const e=ue.c(33),{cellId:n,dataTable:r,getDataUrl:o,fieldTypes:i,displayHeader:a}=t,[s,l]=ss(Spt),c=n?s.get(n)??[]:[],[u,d]=_.useState(0),[f,h]=_.useState(EC);if(!a||c.length===0&&!a)return r;const g=()=>{if(!n)return;const E=V4e(u,"bar"),A=new Map(s);A.set(n,[...c,{tabName:E,chartType:"bar",config:L4e()}]),l(A),d(u+1),h(E)},v=E=>{const{tabName:A,chartType:I,chartConfig:L}=E;if(!n)return;const F=new Map(s);F.set(n,c.map(Q=>Q.tabName===A?{...Q,chartType:I,config:L}:Q)),l(F)};let b;e[0]!==n||e[1]!==l||e[2]!==s?(b=(E,A)=>{if(!n)return;const I=s.get(n)??[],L=I.findIndex(W=>W.tabName===E);if(L===-1)return;const F=I.map(W=>W.tabName===E?{...W,chartType:A,tabName:V4e(L,A)}:W),Q=new Map(s).set(n,F);l(Q),h(F[L].tabName)},e[0]=n,e[1]=l,e[2]=s,e[3]=b):b=e[3];const p=b,O=sg,k=Kh;let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=y.jsx(Hs,{className:"text-xs",value:EC,onClick:()=>h(EC),children:"Table"}),e[4]=S):S=e[4];const w=c.map((E,A)=>y.jsxs(Hs,{className:"text-xs",value:E.tabName,onClick:()=>h(E.tabName),children:[E.tabName,y.jsx(Qa,{className:"w-3 h-3 ml-1 mt-[0.5px] hover:text-red-500 hover:font-semibold",onClick:I=>{I.stopPropagation(),(L=>{if(!n)return;const F=new Map(s);F.set(n,c.filter(Q=>Q.tabName!==L)),l(F),h(EC),d(u-1)})(E.tabName)}})]},A));let T,P,j,D,N;if(e[5]!==g?(T=y.jsx(Ft,{variant:"text",size:"icon",onClick:g,title:"Add chart",children:"+"}),e[5]=g,e[6]=T):T=e[6],e[7]!==k||e[8]!==S||e[9]!==w||e[10]!==T?(P=y.jsxs(k,{children:[S,w,T]}),e[7]=k,e[8]=S,e[9]=w,e[10]=T,e[11]=P):P=e[11],e[12]!==r?(j=y.jsx(ec,{className:"mt-1 overflow-hidden",value:EC,children:r}),e[12]=r,e[13]=j):j=e[13],e[14]!==r||e[15]!==i||e[16]!==o||e[17]!==v||e[18]!==p||e[19]!==c){let E;e[21]!==r||e[22]!==i||e[23]!==o||e[24]!==v||e[25]!==p?(E=(A,I)=>y.jsx(ec,{value:A.tabName,className:"h-[400px] mt-1",children:y.jsx(Tpt,{chartConfig:A.config,chartType:A.chartType,saveChart:L=>{v({tabName:A.tabName,chartType:A.chartType,chartConfig:L})},saveChartType:L=>{p(A.tabName,L)},getDataUrl:o,fieldTypes:i??Aj(r.props.data)})},I),e[21]=r,e[22]=i,e[23]=o,e[24]=v,e[25]=p,e[26]=E):E=e[26],D=c.map(E),e[14]=r,e[15]=i,e[16]=o,e[17]=v,e[18]=p,e[19]=c,e[20]=D}else D=e[20];return e[27]!==O||e[28]!==f||e[29]!==P||e[30]!==j||e[31]!==D?(N=y.jsxs(O,{value:f,className:"-mt-1",children:[P,j,D]}),e[27]=O,e[28]=f,e[29]=P,e[30]=j,e[31]=D,e[32]=N):N=e[32],N},q4e="X and Y columns are not set",Tpt=({chartConfig:t,chartType:e,saveChart:n,saveChartType:r,getDataUrl:o,fieldTypes:i})=>{const{theme:a}=as(),s=kM({defaultValues:t??L4e(),resolver:wM(Q4e)}),[l,c]=_.useState(e),[u,d]=_.useState(!1),{ref:f}=EH(),{data:h,isPending:g,error:v}=$a(async()=>{if(!o)return[];const w=await o({});return Array.isArray(w.data_url)?w.data_url:await M_(w.data_url,w.format==="arrow"?{type:"arrow"}:w.format==="json"?{type:"json"}:{type:"csv",parse:"auto"},{replacePeriod:!0})},[]),b=s.watch(),p=Rft(l,_.useMemo(()=>structuredClone(b),[b]),a,"container",290),O=_.useMemo(()=>g?y.jsx(ipt,{}):v?y.jsx(apt,{error:v}):y.jsx(ypt,{baseSpec:p,data:h,height:290}),[g,v,p,h]),k=!1,S=y.jsxs(y.Fragment,{children:[y.jsx(spt,{value:l,onValueChange:w=>{c(w),r(w)}}),y.jsx(Ppt,{form:s,saveChart:n,fieldTypes:i,chartType:l})]});return y.jsxs("div",{className:"flex flex-row gap-2 h-full rounded-md border pr-2",children:[y.jsxs("div",{className:"relative flex flex-col gap-2 overflow-auto px-2 py-3 scrollbar-thin transition-width duration-200 "+(u?"w-8":"w-[300px]"),children:[!u&&S,y.jsx(Ft,{variant:"outline",size:"icon",className:"border-border ml-auto",onClick:()=>d(w=>!w),title:u?"Expand sidebar":"Collapse sidebar",children:u?y.jsx(Qh,{className:"w-4 h-5"}):y.jsx(ty,{className:"w-4 h-5"})})]}),y.jsx("div",{className:"flex-1 overflow-auto h-full w-full mt-3",children:(()=>{let w=q4e;return typeof p!="string"&&(w=bft(p,"_df","_chart")),y.jsxs(sg,{defaultValue:"chart",children:[y.jsx("div",{className:"flex flex-row gap-1.5 items-center",children:y.jsxs(Kh,{children:[y.jsxs(Hs,{value:"chart",className:"h-6",children:[y.jsx(VE,{className:"text-muted-foreground mr-2 w-4 h-4"}),"Chart"]}),y.jsxs(Hs,{value:"code",className:"h-6",children:[y.jsx(xK,{className:"text-muted-foreground mr-2"}),"Python code"]}),k]})}),y.jsx(ec,{value:"chart",ref:f,children:O}),y.jsx(ec,{value:"code",children:y.jsx(j4e,{code:w,insertNewCell:w!==q4e,language:"python"})}),k]})})()})]})},Ppt=t=>{const e=ue.c(28),{form:n,saveChart:r,fieldTypes:o,chartType:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];let s,l=a;if(o){let T;e[1]!==o?(T=o.map(Ept),e[1]=o,e[2]=T):T=e[2],l=T}e[3]!==n||e[4]!==r?(s=()=>{const T=n.getValues();r(T)},e[3]=n,e[4]=r,e[5]=s):s=e[5];const c=zJ(s,300);let u,d,f,h,g,v,b,p,O,k,S,w=dpt;return i===ei.PIE?w=gpt:i===ei.HEATMAP&&(w=mpt),e[6]!==i||e[7]!==c||e[8]!==l?(u={fields:l,saveForm:c,chartType:i},e[6]=i,e[7]=c,e[8]=l,e[9]=u):u=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsxs(Hs,{value:"data",className:"w-1/2 h-6",children:[y.jsx(Wx,{className:"w-4 h-4 mr-2"}),"Data"]}),e[10]=d):d=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsxs(Kh,{className:"w-full",children:[d,y.jsxs(Hs,{value:"style",className:"w-1/2 h-6",children:[y.jsx(LN,{className:"w-4 h-4 mr-2"}),"Style"]})]}),e[11]=f):f=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsx("hr",{className:"my-2"}),e[12]=h):h=e[12],e[13]!==w?(g=y.jsxs(ec,{value:"data",children:[h,y.jsx(CU,{children:y.jsx(w,{})})]}),e[13]=w,e[14]=g):g=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(v=y.jsx("hr",{className:"my-2"}),e[15]=v):v=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsxs(ec,{value:"style",children:[v,y.jsx(CU,{children:y.jsx(fpt,{})})]}),e[16]=b):b=e[16],e[17]!==g?(p=y.jsxs(sg,{defaultValue:"data",children:[f,g,b]}),e[17]=g,e[18]=p):p=e[18],e[19]!==c||e[20]!==p?(O=y.jsx("form",{onSubmit:Rpt,onChange:c,children:p}),e[19]=c,e[20]=p,e[21]=O):O=e[21],e[22]!==n||e[23]!==O?(k=y.jsx(hG,{...n,children:O}),e[22]=n,e[23]=O,e[24]=k):k=e[24],e[25]!==k||e[26]!==u?(S=y.jsx(a5e,{value:u,children:k}),e[25]=k,e[26]=u,e[27]=S):S=e[27],S};function Ept(t){return{name:t[0],type:t[1][0]}}function Rpt(t){return t.preventDefault()}let QU,LU;N8e=t=>{const e=ue.c(4),{isExpanded:n}=t,r=n&&"rotate-90";let o,i;return e[0]!==r?(o=we("h-3 w-3 transition-transform",r),e[0]=r,e[1]=o):o=e[1],e[2]!==o?(i=y.jsx(Qh,{className:o}),e[2]=o,e[3]=i):i=e[3],i},k8e=t=>{const e=ue.c(2),{children:n}=t;let r;return e[0]!==n?(r=y.jsx("div",{className:"flex gap-1.5 items-center font-bold px-2 py-1.5 text-muted-foreground bg-[var(--slate-2)] text-sm",children:n}),e[0]=n,e[1]=r):r=e[1],r},aee=t=>{const e=ue.c(5),{content:n,className:r}=t;let o,i;return e[0]!==r?(o=we("text-sm text-muted-foreground py-1",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},iee=t=>{const e=ue.c(6),{error:n,className:r}=t;let o,i,a;return e[0]!==r?(o=we("text-sm bg-red-50 dark:bg-red-900 text-red-600 dark:text-red-50 flex items-center gap-2 p-2 h-8",r),e[0]=r,e[1]=o):o=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(Qa,{className:"h-4 w-4 mt-0.5"}),e[2]=i):i=e[2],e[3]!==n.message||e[4]!==o?(a=y.jsxs("div",{className:o,children:[i,n.message]}),e[3]=n.message,e[4]=o,e[5]=a):a=e[5],a},ZJ=t=>{const e=ue.c(6),{message:n,className:r}=t;let o,i,a;return e[0]!==r?(o=we("text-sm bg-blue-50 dark:bg-[var(--accent)] text-blue-500 dark:text-blue-50 flex items-center gap-2 p-2 h-8",r),e[0]=r,e[1]=o):o=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(af,{className:"h-4 w-4 animate-spin"}),e[2]=i):i=e[2],e[3]!==n||e[4]!==o?(a=y.jsxs("div",{className:o,children:[i,n]}),e[3]=n,e[4]=o,e[5]=a):a=e[5],a},QU=t=>{const e=ue.c(5),{children:n,className:r}=t;let o,i;return e[0]!==r?(o=we("flex flex-col gap-2 relative",r),e[0]=r,e[1]=o):o=e[1],e[2]!==n||e[3]!==o?(i=y.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=i):i=e[4],i},QN=t=>{const e=ue.c(6),{columnName:n,dataType:r}=t,o=hj[r],i=function(c){switch(c){case"boolean":return"bg-[var(--orange-4)]";case"date":case"time":case"datetime":case"temporal":return"bg-[var(--grass-4)] dark:bg-[var(--grass-5)]";case"number":case"integer":return"bg-[var(--purple-4)]";case"string":return"bg-[var(--blue-4)]";case"unknown":return"bg-[var(--slate-4)] dark:bg-[var(--slate-6)]";default:return us(c),"bg-[var(--slate-4)] dark:bg-[var(--slate-6)]"}}(r),a=`w-4 h-4 p-0.5 rounded-sm stroke-card-foreground ${i}`;let s,l;return e[0]!==o||e[1]!==a?(s=y.jsx(o,{className:a}),e[0]=o,e[1]=a,e[2]=s):s=e[2],e[3]!==n||e[4]!==s?(l=y.jsxs("div",{className:"flex flex-row items-center gap-1.5",children:[s,n]}),e[3]=n,e[4]=s,e[5]=l):l=e[5],l},LU=(t,e)=>{Kr(e?{title:"Failed to add package",description:e,variant:"danger"}:{title:"Package added",description:y.jsxs("div",{children:[y.jsxs("div",{children:["The package ",y.jsx(lg,{className:"inline",children:t})," and its dependencies has been added to your environment."]}),y.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},E8e=(t,e)=>{Kr(e?{title:"Failed to upgrade package",description:e,variant:"danger"}:{title:"Package upgraded",description:y.jsxs("div",{children:[y.jsxs("div",{children:["The package ",y.jsx(lg,{className:"inline",children:t})," has been upgraded."]}),y.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},j8e=(t,e)=>{Kr(e?{title:"Failed to remove package",description:e,variant:"danger"}:{title:"Package removed",description:y.jsxs("div",{children:[y.jsxs("div",{children:["The package ",y.jsx(lg,{className:"inline",children:t})," has been removed from your environment."]}),y.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},YJ=function(){const[t,e]=_.useState(!1);return{loading:t,handleInstallPackages:async(n,r)=>{e(!0);try{for(const[o,i]of n.entries()){const a=await OG({package:i});a.success?LU(i):LU(i,a.error),o<n.length-1&&await new Promise(s=>setTimeout(s,1e3))}r==null||r()}catch(o){Ve.error(o)}finally{e(!1)}}}};let F4e,B4e;F4e=t=>{const e=ue.c(13),{packages:n,showMaxPackages:r,className:o,onInstall:i}=t,{handleInstallPackages:a}=YJ();if(!n||n.length===0)return null;let s,l,c,u;return e[0]!==a||e[1]!==i||e[2]!==n?(s=()=>{a(n,i)},e[0]=a,e[1]=i,e[2]=n,e[3]=s):s=e[3],e[4]!==o?(l=we("ml-2",o),e[4]=o,e[5]=l):l=e[5],e[6]!==n||e[7]!==r?(c=r?n.slice(0,r).join(", "):n.join(", "),e[6]=n,e[7]=r,e[8]=c):c=e[8],e[9]!==s||e[10]!==l||e[11]!==c?(u=y.jsxs(Ft,{variant:"outline",size:"xs",onClick:s,className:l,children:["Install"," ",c]}),e[9]=s,e[10]=l,e[11]=c,e[12]=u):u=e[12],u},B4e=ge.lazy(()=>Be(()=>import("./index-7igCaZQI.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107,108,109,110,111,112,113]),import.meta.url).then(t=>({default:t.VegaLite}))),Q8e=t=>{const e=ue.c(51),{table:n,column:r,preview:o,onAddColumnChart:i,sqlTableContext:a}=t,{theme:s}=as();let l;e[0]!==r.name||e[1]!==a||e[2]!==n.name||e[3]!==n.source||e[4]!==n.source_type?(l=()=>{uV({source:n.source,tableName:n.name,columnName:r.name,sourceType:n.source_type,fullyQualifiedTableName:a?`${a.database}.${a.schema}.${n.name}`:n.name})},e[0]=r.name,e[1]=a,e[2]=n.name,e[3]=n.source,e[4]=n.source_type,e[5]=l):l=e[5];const c=l;let u,d;if(e[6]!==o||e[7]!==c||e[8]!==n.source_type?(u=()=>{o||n.source_type!=="connection"&&n.source_type!=="catalog"&&c()},e[6]=o,e[7]=c,e[8]=n.source_type,e[9]=u):u=e[9],iM(u),n.source_type==="connection"){const T=r.name,P=r.external_type;let j,D,N,E;return e[10]!==r.name||e[11]!==i||e[12]!==a||e[13]!==n?(j=ai.stopPropagation(()=>{i(IN({table:n,columnName:r.name,sqlTableContext:a}))}),e[10]=r.name,e[11]=i,e[12]=a,e[13]=n,e[14]=j):j=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(D=y.jsx(LT,{className:"h-3 w-3 mr-1"}),e[15]=D):D=e[15],e[16]!==j?(N=y.jsxs(Ft,{variant:"outline",size:"xs",onClick:j,children:[D," Add SQL cell"]}),e[16]=j,e[17]=N):N=e[17],e[18]!==r.external_type||e[19]!==r.name||e[20]!==N?(E=y.jsxs("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[T," (",P,")",N]}),e[18]=r.external_type,e[19]=r.name,e[20]=N,e[21]=E):E=e[21],E}if(n.source_type==="catalog"){let T;return e[22]!==r.external_type||e[23]!==r.name?(T=y.jsxs("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[r.name," (",r.external_type,")"]}),e[22]=r.external_type,e[23]=r.name,e[24]=T):T=e[24],T}if(!o){let T;return e[25]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading..."}),e[25]=T):T=e[25],T}e[26]!==o.error||e[27]!==o.missing_packages||e[28]!==c?(d=o.error&&W4e({error:o.error,missingPackages:o.missing_packages,refetchPreview:c}),e[26]=o.error,e[27]=o.missing_packages,e[28]=c,e[29]=d):d=e[29];const f=d;let h;e[30]!==r.type||e[31]!==o.stats?(h=o.stats&&U4e(o.stats,r.type),e[30]=r.type,e[31]=o.stats,e[32]=h):h=e[32];const g=h;let v;e[33]!==o.chart_spec||e[34]!==s?(v=o.chart_spec&&Z4e(o.chart_spec,s),e[33]=o.chart_spec,e[34]=s,e[35]=v):v=e[35];const b=v;let p;e[36]!==o.chart_code||e[37]!==n.source_type?(p=o.chart_code&&n.source_type==="local"&&y.jsx(X4e,{chartCode:o.chart_code}),e[36]=o.chart_code,e[37]=n.source_type,e[38]=p):p=e[38];const O=p;let k;e[39]!==r.name||e[40]!==i||e[41]!==a||e[42]!==n?(k=n.source_type==="duckdb"&&y.jsx(qn,{content:"Add SQL cell",delayDuration:400,children:y.jsx(Ft,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-1",onClick:ai.stopPropagation(()=>{i(IN({table:n,columnName:r.name,sqlTableContext:a}))}),children:y.jsx(LT,{className:"h-3 w-3"})})}),e[39]=r.name,e[40]=i,e[41]=a,e[42]=n,e[43]=k):k=e[43];const S=k;if(!f&&!g&&!b){let T;return e[44]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx("span",{className:"text-xs text-muted-foreground",children:"No data"}),e[44]=T):T=e[44],T}let w;return e[45]!==O||e[46]!==S||e[47]!==b||e[48]!==f||e[49]!==g?(w=y.jsxs(QU,{children:[f,O,S,b,g]}),e[45]=O,e[46]=S,e[47]=b,e[48]=f,e[49]=g,e[50]=w):w=e[50],w};function W4e({error:t,missingPackages:e,refetchPreview:n}){return y.jsxs("div",{className:"text-xs text-muted-foreground p-2 border border-border rounded flex items-center justify-between",children:[y.jsx("span",{children:t}),e&&y.jsx(F4e,{packages:e,showMaxPackages:1,className:"w-32",onInstall:n})]})}function U4e(t,e){return y.jsx("div",{className:"gap-x-16 gap-y-1 grid grid-cols-2-fit border rounded p-2 empty:hidden",children:Object.entries(t).map(([n,r])=>r==null?null:y.jsxs("div",{className:"flex items-center gap-1 group",children:[y.jsx("span",{className:"text-xs min-w-[60px] capitalize",children:Alt(n,e)}),y.jsx("span",{className:"text-xs font-bold text-muted-foreground tracking-wide",children:th(r)}),y.jsx($v,{className:"h-3 w-3 invisible group-hover:visible",value:String(r)})]},n))})}const jpt=y.jsx("div",{className:"flex justify-center",children:y.jsx(Ym,{className:"size-4"})});function Z4e(t,e){return y.jsx(_.Suspense,{fallback:jpt,children:y.jsx(B4e,{spec:(n=JSON.parse(t),{...n,background:"transparent",config:{...n.config,background:"transparent"}}),width:"container",height:100,actions:!1,theme:e==="dark"?"dark":"vox"})});var n}const X4e=t=>{const e=ue.c(10),{chartCode:n}=t,r=Gr(FM),o=PT(),{createNewCell:i}=Iv();let a;e[0]!==r||e[1]!==i||e[2]!==o?(a=d=>{d.includes("alt")&&S4e({autoInstantiate:r,createNewCell:i,fromCellId:o}),i({code:d,before:!1,cellId:o??"__end__"})},e[0]=r,e[1]=i,e[2]=o,e[3]=a):a=e[3];const s=a;let l,c,u;return e[4]!==n||e[5]!==s?(l=ai.stopPropagation(()=>s(n)),e[4]=n,e[5]=s,e[6]=l):l=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(LT,{className:"h-3 w-3"}),e[7]=c):c=e[7],e[8]!==l?(u=y.jsx(qn,{content:"Add chart to notebook",delayDuration:400,children:y.jsx(Ft,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-0.5",onClick:l,children:c})}),e[8]=l,e[9]=u):u=e[9],u},Dpt=t=>{const e=ue.c(43),{previewColumn:n,fieldTypes:r,totalRows:o,totalColumns:i,tableId:a}=t,[s,l]=_.useState("");let c,u,d,f,h,g,v,b,p,O,k,S,w;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a||e[4]!==i||e[5]!==o){const T=r==null?void 0:r.filter(Npt),P=T==null?void 0:T.filter(A=>{const[I]=A;return I.toLowerCase().includes(s.toLowerCase())});let j;p="mt-5 mb-3",e[16]!==i||e[17]!==o?(j=rV(o,i),e[16]=i,e[17]=o,e[18]=j):j=e[18];const D=(T==null?void 0:T.map($pt).join(`,
|
475
|
+
`))||"";let N,E;e[19]!==D?(N=y.jsx($v,{tooltip:"Copy column names",value:D,className:"h-3 w-3 ml-1 mt-0.5"}),e[19]=D,e[20]=N):N=e[20],e[21]!==j||e[22]!==N?(O=y.jsxs("span",{className:"text-xs font-semibold ml-2 flex",children:[j,N]}),e[21]=j,e[22]=N,e[23]=O):O=e[23],u=by,g="h-5/6 bg-background",v=!1,e[24]===Symbol.for("react.memo_cache_sentinel")?(E=A=>l(A),e[24]=E):E=e[24],e[25]!==s?(b=y.jsx(EO,{placeholder:"Search columns...",value:s,onValueChange:E}),e[25]=s,e[26]=b):b=e[26],c=PO,d="max-h-full",e[27]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(RO,{children:"No results."}),e[27]=f):f=e[27],h=P==null?void 0:P.map(A=>{const[I,L]=A,[F,Q]=L;return y.jsx(Apt,{columnName:I,dataType:F,externalType:Q,previewColumn:n},`${a}-${I}`)}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=i,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=f,e[10]=h,e[11]=g,e[12]=v,e[13]=b,e[14]=p,e[15]=O}else c=e[6],u=e[7],d=e[8],f=e[9],h=e[10],g=e[11],v=e[12],b=e[13],p=e[14],O=e[15];return e[28]!==c||e[29]!==d||e[30]!==f||e[31]!==h?(k=y.jsxs(c,{className:d,children:[f,h]}),e[28]=c,e[29]=d,e[30]=f,e[31]=h,e[32]=k):k=e[32],e[33]!==u||e[34]!==g||e[35]!==v||e[36]!==b||e[37]!==k?(S=y.jsxs(u,{className:g,shouldFilter:v,children:[b,k]}),e[33]=u,e[34]=g,e[35]=v,e[36]=b,e[37]=k,e[38]=S):S=e[38],e[39]!==S||e[40]!==p||e[41]!==O?(w=y.jsxs("div",{className:p,children:[O,S]}),e[39]=S,e[40]=p,e[41]=O,e[42]=w):w=e[42],w},Apt=t=>{const e=ue.c(28),{columnName:n,dataType:r,externalType:o,previewColumn:i}=t,[a,s]=_.useState(!1),l=a?"font-semibold":"";let c;e[0]!==n||e[1]!==l?(c=y.jsx("span",{className:l,children:n}),e[0]=n,e[1]=l,e[2]=c):c=e[2];const u=c;let d,f,h,g,v,b,p,O;return e[3]!==a?(d=()=>s(!a),e[3]=a,e[4]=d):d=e[4],e[5]!==u||e[6]!==r?(f=y.jsx(QN,{columnName:u,dataType:r}),e[5]=u,e[6]=r,e[7]=f):f=e[7],e[8]!==n?(h=y.jsx(qn,{content:"Copy column name",delayDuration:400,children:y.jsx(Ft,{variant:"text",size:"icon",className:"group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",children:y.jsx($v,{tooltip:!1,value:n,className:"h-3 w-3"})})}),e[8]=n,e[9]=h):h=e[9],e[10]!==o?(g=y.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[10]=o,e[11]=g):g=e[11],e[12]!==h||e[13]!==g?(v=y.jsxs("div",{className:"ml-auto",children:[h,g]}),e[12]=h,e[13]=g,e[14]=v):v=e[14],e[15]!==n||e[16]!==d||e[17]!==f||e[18]!==v?(b=y.jsxs(fy,{onSelect:d,className:"flex flex-row items-center gap-1.5 group w-full cursor-pointer",children:[f,v]},n),e[15]=n,e[16]=d,e[17]=f,e[18]=v,e[19]=b):b=e[19],e[20]!==n||e[21]!==r||e[22]!==a||e[23]!==i?(p=a&&y.jsx(Bh,{children:y.jsx(Mpt,{previewColumn:i,columnName:n,dataType:r})}),e[20]=n,e[21]=r,e[22]=a,e[23]=i,e[24]=p):p=e[24],e[25]!==b||e[26]!==p?(O=y.jsxs(y.Fragment,{children:[b,p]}),e[25]=b,e[26]=p,e[27]=O):O=e[27],O},Mpt=t=>{const e=ue.c(25),{previewColumn:n,columnName:r,dataType:o}=t,{theme:i}=as();let a,s;e[0]!==r||e[1]!==n?(a=async()=>await n({column:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[3]=s):s=e[3];const{data:l,error:c,isPending:u,refetch:d}=$a(a,s);if(c){let N;return e[4]!==c?(N=y.jsx(iee,{error:c}),e[4]=c,e[5]=N):N=e[5],N}if(u){let N;return e[6]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx(ZJ,{message:"Loading..."}),e[6]=N):N=e[6],N}if(!l){let N;return e[7]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx(aee,{content:"No data",className:"pl-4"}),e[7]=N):N=e[7],N}const{chart_spec:f,chart_code:h,error:g,missing_packages:v,stats:b}=l;let p;e[8]!==v||e[9]!==g||e[10]!==d?(p=g&&W4e({error:g,missingPackages:v,refetchPreview:d}),e[8]=v,e[9]=g,e[10]=d,e[11]=p):p=e[11];const O=p;let k;e[12]!==o||e[13]!==b?(k=b&&U4e(b,o),e[12]=o,e[13]=b,e[14]=k):k=e[14];const S=k;let w;e[15]!==f||e[16]!==i?(w=f&&Z4e(f,i),e[15]=f,e[16]=i,e[17]=w):w=e[17];const T=w;let P;e[18]!==h?(P=h&&y.jsx(X4e,{chartCode:h}),e[18]=h,e[19]=P):P=e[19];const j=P;let D;return e[20]!==j||e[21]!==T||e[22]!==O||e[23]!==S?(D=y.jsxs(QU,{className:"px-2 py-1",children:[O,j,T,S]}),e[20]=j,e[21]=T,e[22]=O,e[23]=S,e[24]=D):D=e[24],D};function Npt(t){const[e]=t;return e!==$S&&e!==IS&&!e.startsWith(JS)}function $pt(t){const[e]=t;return e}const H4e=Ct(null),Ipt=Ct(null),Y4e=Ct(!1),Qpt=Ct(!1),G4e=Ct(!1),K4e=Ct({});V6e=function(){return Gr(K4e)},RQe=function(t,e){const n=ue.c(13),{registerAction:r,unregisterAction:o}=function(){const h=Xm(K4e);return{registerAction:Fn((g,v)=>{h(b=>({...b,[g]:v}))}),unregisterAction:Fn(g=>{h(v=>{const{[g]:b,...p}=v;return p})})}}(),i=Gr(hT),a=e===Zi.NOOP;let s;n[0]!==e?(s=h=>e(h),n[0]=e,n[1]=s):s=n[1];const l=Fn(s);let c;n[2]!==e||n[3]!==i||n[4]!==t?(c=h=>{_T(i.getHotkey(t).key)(h)&&e(h)!==!1&&(h.preventDefault(),h.stopPropagation())},n[2]=e,n[3]=i,n[4]=t,n[5]=c):c=n[5];const u=Fn(c);let d,f;Wh(document,"keydown",u),n[6]!==a||n[7]!==l||n[8]!==r||n[9]!==t||n[10]!==o?(d=()=>{if(!a)return r(t,l),()=>o(t)},f=[l,t,a,r,o],n[6]=a,n[7]=l,n[8]=r,n[9]=t,n[10]=o,n[11]=d,n[12]=f):(d=n[11],f=n[12]),_.useEffect(d,f)};const Lpt=({rowIdx:t,setRowIdx:e,totalRows:n,fieldTypes:r,getRow:o,isSelectable:i,isRowSelected:a,handleRowSelectionChange:s})=>{const[l,c]=_.useState(""),u=_.useRef(null),d=_.useRef(null),f=n===QS,{data:h,error:g}=$a(async()=>(await o(t)).rows,[o,t,n]),v=O=>{O<0||typeof n=="number"&&O>=n||e(O)},b=()=>{s==null||s(O=>{if(a){const{[t]:k,...S}=O;return S}return{...O,[t]:!0}})};!f&&t>n&&v(n-1),function(O,k){const S=ue.c(2);let w;S[0]!==k?(w=T=>{for(const[P,j]of cr.entries(k))_T(P)(T)&&(Ve.debug("Satisfied",P,T),j(T)!==!1&&(T.preventDefault(),T.stopPropagation()))},S[0]=k,S[1]=w):w=S[1],Wh(O,"keydown",w)}(u,{ArrowLeft:O=>{if((O==null?void 0:O.target)===d.current)return!1;v(t-1)},ArrowRight:O=>{if((O==null?void 0:O.target)===d.current)return!1;v(t+1)},Space:O=>{if((O==null?void 0:O.target)===d.current)return!1;b()}});const p="h-6 w-6 p-0.5";return y.jsxs("div",{className:"flex flex-col gap-3 mt-4 focus:outline-none",ref:u,tabIndex:-1,children:[y.jsxs("div",{className:"flex flex-row gap-2 items-center mr-2",children:[i&&y.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[y.jsx(Ft,{variant:"link",size:"xs",className:"pr-0",onClick:b,children:a?"Deselect row":"Select row"}),y.jsx(pT,{shortcut:"Space"})]}),y.jsx(Ft,{variant:"outline",size:"xs",className:`${p} ml-auto`,onClick:()=>v(0),disabled:t===0,"aria-label":"Go to first row",children:y.jsx(C6,{})}),y.jsx(Ft,{variant:"outline",size:"xs",className:p,onClick:()=>v(t-1),disabled:t===0,"aria-label":"Previous row",children:y.jsx(ty,{})}),y.jsx("span",{className:"text-xs",children:f?`Row ${t+1}`:`Row ${t+1} of ${bSe(n)}`}),y.jsx(Ft,{variant:"outline",size:"xs",className:p,onClick:()=>v(t+1),disabled:!f&&t===n-1,"aria-label":"Next row",children:y.jsx(Qh,{})}),y.jsx(Ft,{variant:"outline",size:"xs",className:p,onClick:()=>{f||v(n-1)},disabled:f||t===n-1,"aria-label":"Go to last row",children:y.jsx(_6,{})})]}),y.jsx("div",{className:"mx-2 -mb-1",children:y.jsx(tf,{ref:d,type:"text",placeholder:"Search",onChange:O=>c(O.target.value),icon:y.jsx(Jm,{className:"w-4 h-4"}),className:"mb-0 border-border","data-testid":"selection-panel-search-input"})}),(()=>{if(g)return y.jsx(Hd,{error:g,className:"p-4 mx-3 mt-5"});if(n===0)return y.jsx(M4,{kind:"info",Icon:sk,message:"No rows selected"});if(!h)return y.jsx(M4,{kind:"warn",Icon:vO,message:"No data available. Please report the issue."});if(h.length!==1)return y.jsx(M4,{kind:"warn",Icon:vO,message:`Expected 1 row, got ${h.length} rows. Please report the issue.`});const O=h[0];if(typeof O!="object"||O===null)return y.jsx(M4,{kind:"warn",Icon:vO,message:"Row is not an object. Please report the issue."});const k={};for(const[S,w]of Object.entries(O))S!==$S&&S!==IS&&(S.startsWith(JS)?k[S.slice(JS.length)]=w:k[S]=w);return y.jsxs(iy,{className:"mb-4",children:[y.jsx(mO,{children:y.jsxs(Rc,{children:[y.jsx(oy,{className:"w-1/4",children:"Column"}),y.jsx(oy,{className:"w-3/4",children:"Value"})]})}),y.jsx(gO,{children:r==null?void 0:r.map(([S,[w,T]])=>{const P=k[S];if(!function({columnName:N,columnValue:E,searchQuery:A}){const I=N.toLowerCase(),L=A.toLowerCase();let F=typeof E=="object"?JSON.stringify(E):String(E);return F=F.toLowerCase(),I.includes(L)||F.includes(L)}({columnName:S,columnValue:P,searchQuery:l}))return null;const j=qke({id:S,columnDef:{meta:{dataType:w}},getColumnFormatting:()=>{},applyColumnFormatting:N=>N},()=>P,()=>P,void 0,"text-left break-all"),D=typeof P=="object"?JSON.stringify(P):String(P);return y.jsxs(Rc,{className:"group",children:[y.jsx(jc,{children:y.jsx(QN,{columnName:y.jsx("span",{children:S}),dataType:w})}),y.jsx(jc,{children:y.jsxs("div",{className:"flex flex-row items-center justify-between gap-1",children:[j,y.jsx($v,{value:D,className:"w-3 h-3 mr-1 text-muted-foreground cursor-pointer opacity-0 group-hover:opacity-100"})]})})]},S)})})]})})()]})},M4=t=>{const e=ue.c(8),{kind:n,Icon:r,message:o}=t;let i,a,s;return e[0]!==r?(i=y.jsx(r,{className:"w-5 h-5"}),e[0]=r,e[1]=i):i=e[1],e[2]!==o?(a=y.jsx("span",{children:o}),e[2]=o,e[3]=a):a=e[3],e[4]!==n||e[5]!==i||e[6]!==a?(s=y.jsxs(Km,{kind:n,className:"p-4 mx-3 mt-3 flex flex-row items-center gap-2",children:[i,a]}),e[4]=n,e[5]=i,e[6]=a,e[7]=s):s=e[7],s},N4=_.createContext(null);N4.displayName="PanelGroupContext";const zpt="data-panel-group",J4e="data-panel-group-direction",RC="data-panel-group-id",Vpt="data-panel",qpt="data-panel-collapsible",Fpt="data-panel-id",Bpt="data-panel-size",eDe="data-resize-handle",Wpt="data-resize-handle-active",Upt="data-panel-resize-handle-enabled",jC="data-panel-resize-handle-id",Zpt="data-resize-handle-state",dv=_.useLayoutEffect,tDe=Og.useId,Xpt=typeof tDe=="function"?tDe:()=>null;let Hpt=0;function zU(t=null){const e=Xpt(),n=_.useRef(t||e||null);return n.current===null&&(n.current=""+Hpt++),t??n.current}function nDe({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:a,maxSize:s,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:f,style:h,tagName:g="div",...v}){const b=_.useContext(N4);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:p,expandPanel:O,getPanelSize:k,getPanelStyle:S,groupId:w,isPanelCollapsed:T,reevaluatePanelConstraints:P,registerPanel:j,resizePanel:D,unregisterPanel:N}=b,E=zU(a),A=_.useRef({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:s,minSize:l},id:E,idIsFromProps:a!==void 0,order:f});_.useRef({didLogMissingDefaultSizeWarning:!1}),dv(()=>{const{callbacks:L,constraints:F}=A.current,Q={...F};A.current.id=E,A.current.idIsFromProps=a!==void 0,A.current.order=f,L.onCollapse=c,L.onExpand=u,L.onResize=d,F.collapsedSize=n,F.collapsible=r,F.defaultSize=o,F.maxSize=s,F.minSize=l,Q.collapsedSize===F.collapsedSize&&Q.collapsible===F.collapsible&&Q.maxSize===F.maxSize&&Q.minSize===F.minSize||P(A.current,Q)}),dv(()=>{const L=A.current;return j(L),()=>{N(L)}},[f,E,j,N]),_.useImperativeHandle(i,()=>({collapse:()=>{p(A.current)},expand:L=>{O(A.current,L)},getId:()=>E,getSize:()=>k(A.current),isCollapsed:()=>T(A.current),isExpanded:()=>!T(A.current),resize:L=>{D(A.current,L)}}),[p,O,k,T,E,D]);const I=S(A.current,o);return _.createElement(g,{...v,children:t,className:e,id:E,style:{...I,...h},[RC]:w,[Vpt]:"",[qpt]:r||void 0,[Fpt]:E,[Bpt]:parseFloat(""+I.flexGrow).toFixed(1)})}AA=_.forwardRef((t,e)=>_.createElement(nDe,{...t,forwardedRef:e})),nDe.displayName="Panel",AA.displayName="forwardRef(Panel)";let VU=null,$4=-1,Sm=null;function qU(t,e){var n,r;const o=function(a,s){if(s){const l=(s&fDe)!==0,c=(s&hDe)!==0;if((s&uDe)!==0)return l?"se-resize":c?"ne-resize":"e-resize";if((s&dDe)!==0)return l?"sw-resize":c?"nw-resize":"w-resize";if(l)return"s-resize";if(c)return"n-resize"}switch(a){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(t,e);if(VU!==o){var i;VU=o,Sm===null&&(Sm=document.createElement("style"),document.head.appendChild(Sm)),$4>=0&&((i=Sm.sheet)===null||i===void 0||i.removeRule($4)),$4=(n=(r=Sm.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${o} !important;}`))!==null&&n!==void 0?n:-1}}function rDe(t){return t.type==="keydown"}function oDe(t){return t.type.startsWith("pointer")}function iDe(t){return t.type.startsWith("mouse")}function I4(t){if(oDe(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(iDe(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Ypt(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}const Gpt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Kpt(t){const e=getComputedStyle(t);return e.position==="fixed"||!(e.zIndex==="auto"||e.position==="static"&&!function(n){var r;const o=getComputedStyle((r=cDe(n))!==null&&r!==void 0?r:n).display;return o==="flex"||o==="inline-flex"}(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||!!Gpt.test(e.willChange)||e.webkitOverflowScrolling==="touch"}function aDe(t){let e=t.length;for(;e--;){const n=t[e];if(zn(n,"Missing node"),Kpt(n))return n}return null}function sDe(t){return t&&Number(getComputedStyle(t).zIndex)||0}function lDe(t){const e=[];for(;t;)e.push(t),t=cDe(t);return e}function cDe(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const uDe=1,dDe=2,fDe=4,hDe=8,Jpt=function(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}()==="coarse";let fu=[],ex=!1,fv=new Map,Q4=new Map;const DC=new Set;function emt(t){const{target:e}=t,{x:n,y:r}=I4(t);ex=!0,WU({target:e,x:n,y:r}),L4(),fu.length>0&&(z4("down",t),t.preventDefault(),pDe(e)||t.stopImmediatePropagation())}function FU(t){const{x:e,y:n}=I4(t);if(ex&&t.buttons===0&&(ex=!1,z4("up",t)),!ex){const{target:r}=t;WU({target:r,x:e,y:n})}z4("move",t),UU(),fu.length>0&&t.preventDefault()}function BU(t){const{target:e}=t,{x:n,y:r}=I4(t);Q4.clear(),ex=!1,fu.length>0&&(t.preventDefault(),pDe(e)||t.stopImmediatePropagation()),z4("up",t),WU({target:e,x:n,y:r}),UU(),L4()}function pDe(t){let e=t;for(;e;){if(e.hasAttribute(eDe))return!0;e=e.parentElement}return!1}function WU({target:t,x:e,y:n}){fu.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),DC.forEach(o=>{const{element:i,hitAreaMargins:a}=o,s=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=s,f=Jpt?a.coarse:a.fine;if(e>=c-f&&e<=u+f&&n>=d-f&&n<=l+f){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&function(h,g){if(h===g)throw new Error("Cannot compare node with itself");const v={a:lDe(h),b:lDe(g)};let b;for(;v.a.at(-1)===v.b.at(-1);)h=v.a.pop(),g=v.b.pop(),b=h;zn(b,"Stacking order can only be calculated for elements with a common ancestor");const p=sDe(aDe(v.a)),O=sDe(aDe(v.b));if(p===O){const k=b.childNodes,S={a:v.a.at(-1),b:v.b.at(-1)};let w=k.length;for(;w--;){const T=k[w];if(T===S.a)return 1;if(T===S.b)return-1}}return Math.sign(p-O)}(r,i)>0){let h=r,g=!1;for(;h&&!h.contains(i);){if(Ypt(h.getBoundingClientRect(),s)){g=!0;break}h=h.parentElement}if(g)return}fu.push(o)}})}function tmt(t,e){Q4.set(t,e)}function UU(){let t=!1,e=!1;fu.forEach(r=>{const{direction:o}=r;o==="horizontal"?t=!0:e=!0});let n=0;Q4.forEach(r=>{n|=r}),t&&e?qU("intersection",n):t?qU("horizontal",n):e?qU("vertical",n):Sm!==null&&(document.head.removeChild(Sm),VU=null,Sm=null,$4=-1)}let ZU=new AbortController;function L4(){ZU.abort(),ZU=new AbortController;const t={capture:!0,signal:ZU.signal};DC.size&&(ex?(fu.length>0&&fv.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",BU,t),r.addEventListener("pointerleave",FU,t),r.addEventListener("pointermove",FU,t))}),window.addEventListener("pointerup",BU,t),window.addEventListener("pointercancel",BU,t)):fv.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",emt,t),r.addEventListener("pointermove",FU,t))}))}function z4(t,e){DC.forEach(n=>{const{setResizeHandlerState:r}=n,o=fu.includes(n);r(t,o,e)})}function zn(t,e){if(!t)throw console.error(e),Error(e)}function hv(t,e,n=10){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function xh(t,e,n=10){return hv(t,e,n)===0}function xl(t,e,n){return hv(t,e,n)===0}function tx({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];zn(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:o=0,collapsible:i,maxSize:a=100,minSize:s=0}=r;return hv(n,s)<0&&(i?n=hv(n,(o+s)/2)<0?o:s:n=s),n=Math.min(a,n),n=parseFloat(n.toFixed(10))}function AC({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(xl(t,0))return e;const a=[...e],[s,l]=r;zn(s!=null,"Invalid first pivot index"),zn(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=t<0?l:s,f=n[d];zn(f,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:g,minSize:v=0}=f;if(g){const b=e[d];if(zn(b!=null,`Previous layout not found for panel index ${d}`),xl(b,h)){const p=v-b;hv(p,Math.abs(t))>0&&(t=t<0?0-p:p)}}}{const d=t<0?s:l,f=n[d];zn(f,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:g,minSize:v=0}=f;if(g){const b=e[d];if(zn(b!=null,`Previous layout not found for panel index ${d}`),xl(b,v)){const p=b-h;hv(p,Math.abs(t))>0&&(t=t<0?0-p:p)}}}}{const d=t<0?1:-1;let f=t<0?l:s,h=0;for(;;){const v=e[f];if(zn(v!=null,`Previous layout not found for panel index ${f}`),h+=tx({panelConstraints:n,panelIndex:f,size:100})-v,f+=d,f<0||f>=n.length)break}const g=Math.min(Math.abs(t),Math.abs(h));t=t<0?0-g:g}{let d=t<0?s:l;for(;d>=0&&d<n.length;){const f=Math.abs(t)-Math.abs(c),h=e[d];zn(h!=null,`Previous layout not found for panel index ${d}`);const g=tx({panelConstraints:n,panelIndex:d,size:h-f});if(!xl(h,g)&&(c+=h-g,a[d]=g,c.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?d--:d++}}if(function(d,f,h){if(d.length!==f.length)return!1;for(let g=0;g<d.length;g++)if(!xl(d[g],f[g],h))return!1;return!0}(o,a))return o;{const d=t<0?l:s,f=e[d];zn(f!=null,`Previous layout not found for panel index ${d}`);const h=f+c,g=tx({panelConstraints:n,panelIndex:d,size:h});if(a[d]=g,!xl(g,h)){let v=h-g,b=t<0?l:s;for(;b>=0&&b<n.length;){const p=a[b];zn(p!=null,`Previous layout not found for panel index ${b}`);const O=tx({panelConstraints:n,panelIndex:b,size:p+v});if(xl(p,O)||(v-=O-p,a[b]=O),xl(v,0))break;t>0?b--:b++}}}const u=a.reduce((d,f)=>f+d,0);return xl(u,100)?a:o}function nmt({layout:t,panelsArray:e,pivotIndices:n}){let r=0,o=100,i=0,a=0;const s=n[0];return zn(s!=null,"No pivot index found"),e.forEach((l,c)=>{const{constraints:u}=l,{maxSize:d=100,minSize:f=0}=u;c===s?(r=f,o=d):(i+=f,a+=d)}),{valueMax:Math.min(o,100-i),valueMin:Math.max(r,100-a),valueNow:t[s]}}function MC(t,e=document){return Array.from(e.querySelectorAll(`[${jC}][data-panel-group-id="${t}"]`))}function mDe(t,e,n=document){const r=MC(t,n).findIndex(o=>o.getAttribute(jC)===e);return r??null}function gDe(t,e,n){const r=mDe(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function vDe(t,e=document){var n;return e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t?e:e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`)||null}function V4(t,e=document){return e.querySelector(`[${jC}="${t}"]`)||null}function rmt({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:a}){_.useRef({didWarnAboutMissingResizeHandle:!1}),dv(()=>{if(!i)return;const s=MC(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=nmt({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),f=s[l];if(f!=null){const h=o[l];zn(h,`No panel data found for index "${l}"`),f.setAttribute("aria-controls",h.id),f.setAttribute("aria-valuemax",""+Math.round(c)),f.setAttribute("aria-valuemin",""+Math.round(u)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),_.useEffect(()=>{if(!i)return;const s=e.current;zn(s,"Eager values not found");const{panelDataArray:l}=s;zn(vDe(n,i)!=null,`No group found for id "${n}"`);const c=MC(n,i);zn(c,`No resize handles found for group id "${n}"`);const u=c.map(d=>{const f=d.getAttribute(jC);zn(f,"Resize handle element has no handle id attribute");const[h,g]=function(b,p,O,k=document){var S,w,T,P;const j=V4(p,k),D=MC(b,k),N=j?D.indexOf(j):-1;return[(S=(w=O[N])===null||w===void 0?void 0:w.id)!==null&&S!==void 0?S:null,(T=(P=O[N+1])===null||P===void 0?void 0:P.id)!==null&&T!==void 0?T:null]}(n,f,l,i);if(h==null||g==null)return()=>{};const v=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const p=l.findIndex(O=>O.id===h);if(p>=0){const O=l[p];zn(O,`No panel data found for index ${p}`);const k=r[p],{collapsedSize:S=0,collapsible:w,minSize:T=0}=O.constraints;if(k!=null&&w){const P=AC({delta:xl(k,S)?T-S:S-k,initialLayout:r,panelConstraints:l.map(j=>j.constraints),pivotIndices:gDe(n,f,i),prevLayout:r,trigger:"keyboard"});r!==P&&a(P)}}break}}};return d.addEventListener("keydown",v),()=>{d.removeEventListener("keydown",v)}});return()=>{u.forEach(d=>d())}},[i,t,e,n,r,o,a])}function yDe(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function bDe(t,e){const n=t==="horizontal",{x:r,y:o}=I4(e);return n?r:o}function omt(t,e,n,r,o,i){if(rDe(t)){const a=n==="horizontal";let s=0;s=t.shiftKey?100:o??10;let l=0;switch(t.key){case"ArrowDown":l=a?0:s;break;case"ArrowLeft":l=a?-s:0;break;case"ArrowRight":l=a?s:0;break;case"ArrowUp":l=a?0:-s;break;case"End":l=100;break;case"Home":l=-100}return l}return r==null?0:function(a,s,l,c,u){const d=l==="horizontal",f=V4(s,u);zn(f,`No resize handle element found for id "${s}"`);const h=f.getAttribute(RC);zn(h,"Resize handle element has no group id attribute");let{initialCursorPosition:g}=c;const v=bDe(l,a),b=vDe(h,u);zn(b,`No group element found for id "${h}"`);const p=b.getBoundingClientRect();return(v-g)/(d?p.width:p.height)*100}(t,e,n,r,i)}function nx(t,e,n){e.forEach((r,o)=>{const i=t[o];zn(i,`Panel data not found for index ${o}`);const{callbacks:a,constraints:s,id:l}=i,{collapsedSize:c=0,collapsible:u}=s,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:f,onExpand:h,onResize:g}=a;g&&g(r,d),u&&(f||h)&&(!h||d!=null&&!xh(d,c)||xh(r,c)||h(),!f||d!=null&&xh(d,c)||!xh(r,c)||f())}})}function q4(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function xDe(t){try{if(typeof localStorage>"u")throw new Error("localStorage not supported in this environment");t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)}}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function ODe(t){return`react-resizable-panels:${t}`}function wDe(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=e;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function kDe(t,e){try{const n=ODe(t),r=e.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function imt(t,e,n,r,o){var i;const a=ODe(t),s=wDe(e),l=(i=kDe(t,o))!==null&&i!==void 0?i:{};l[s]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(a,JSON.stringify(l))}catch(c){console.error(c)}}function SDe({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((i,a)=>i+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!xl(r,100)&&n.length>0)for(let i=0;i<e.length;i++){const a=n[i];zn(a!=null,`No layout data found for index ${i}`);const s=100/r*a;n[i]=s}let o=0;for(let i=0;i<e.length;i++){const a=n[i];zn(a!=null,`No layout data found for index ${i}`);const s=tx({panelConstraints:e,panelIndex:i,size:a});a!=s&&(o+=a-s,n[i]=s)}if(!xl(o,0))for(let i=0;i<e.length;i++){const a=n[i];zn(a!=null,`No layout data found for index ${i}`);const s=tx({panelConstraints:e,panelIndex:i,size:a+o});if(a!==s&&(o-=s-a,n[i]=s,xl(o,0)))break}return n}const NC={getItem:t=>(xDe(NC),NC.getItem(t)),setItem:(t,e)=>{xDe(NC),NC.setItem(t,e)}},CDe={};function _De({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=NC,style:c,tagName:u="div",...d}){const f=zU(i),h=_.useRef(null),[g,v]=_.useState(null),[b,p]=_.useState([]),O=function(){const[re,Z]=_.useState(0);return _.useCallback(()=>Z(K=>K+1),[])}(),k=_.useRef({}),S=_.useRef(new Map),w=_.useRef(0),T=_.useRef({autoSaveId:t,direction:r,dragState:g,id:f,keyboardResizeBy:s,onLayout:a,storage:l}),P=_.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});_.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),_.useImperativeHandle(o,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:re}=P.current;return re},setLayout:re=>{const{onLayout:Z}=T.current,{layout:K,panelDataArray:oe}=P.current,ie=SDe({layout:re,panelConstraints:oe.map(Y=>Y.constraints)});yDe(K,ie)||(p(ie),P.current.layout=ie,Z&&Z(ie),nx(oe,ie,k.current))}}),[]),dv(()=>{T.current.autoSaveId=t,T.current.direction=r,T.current.dragState=g,T.current.id=f,T.current.onLayout=a,T.current.storage=l}),rmt({committedValuesRef:T,eagerValuesRef:P,groupId:f,layout:b,panelDataArray:P.current.panelDataArray,setLayout:p,panelGroupElement:h.current}),_.useEffect(()=>{const{panelDataArray:re}=P.current;if(t){if(b.length===0||b.length!==re.length)return;let Z=CDe[t];Z==null&&(Z=function(ie,Y=10){let le=null;return(...me)=>{le!==null&&clearTimeout(le),le=setTimeout(()=>{ie(...me)},Y)}}(imt,100),CDe[t]=Z);const K=[...re],oe=new Map(S.current);Z(t,K,oe,b,l)}},[t,b,l]),_.useEffect(()=>{});const j=_.useCallback(re=>{const{onLayout:Z}=T.current,{layout:K,panelDataArray:oe}=P.current;if(re.constraints.collapsible){const ie=oe.map(ce=>ce.constraints),{collapsedSize:Y=0,panelSize:le,pivotIndices:me}=pv(oe,re,K);if(zn(le!=null,`Panel size not found for panel "${re.id}"`),!xh(le,Y)){S.current.set(re.id,le);const ce=AC({delta:rx(oe,re)===oe.length-1?le-Y:Y-le,initialLayout:K,panelConstraints:ie,pivotIndices:me,prevLayout:K,trigger:"imperative-api"});q4(K,ce)||(p(ce),P.current.layout=ce,Z&&Z(ce),nx(oe,ce,k.current))}}},[]),D=_.useCallback((re,Z)=>{const{onLayout:K}=T.current,{layout:oe,panelDataArray:ie}=P.current;if(re.constraints.collapsible){const Y=ie.map(_e=>_e.constraints),{collapsedSize:le=0,panelSize:me=0,minSize:ce=0,pivotIndices:ve}=pv(ie,re,oe),ye=Z??ce;if(xh(me,le)){const _e=S.current.get(re.id),Se=_e!=null&&_e>=ye?_e:ye,Ae=AC({delta:rx(ie,re)===ie.length-1?me-Se:Se-me,initialLayout:oe,panelConstraints:Y,pivotIndices:ve,prevLayout:oe,trigger:"imperative-api"});q4(oe,Ae)||(p(Ae),P.current.layout=Ae,K&&K(Ae),nx(ie,Ae,k.current))}}},[]),N=_.useCallback(re=>{const{layout:Z,panelDataArray:K}=P.current,{panelSize:oe}=pv(K,re,Z);return zn(oe!=null,`Panel size not found for panel "${re.id}"`),oe},[]),E=_.useCallback((re,Z)=>{const{panelDataArray:K}=P.current,oe=rx(K,re);return function({defaultSize:ie,dragState:Y,layout:le,panelData:me,panelIndex:ce,precision:ve=3}){const ye=le[ce];let _e;return _e=ye==null?ie!=null?ie.toPrecision(ve):"1":me.length===1?"1":ye.toPrecision(ve),{flexBasis:0,flexGrow:_e,flexShrink:1,overflow:"hidden",pointerEvents:Y!==null?"none":void 0}}({defaultSize:Z,dragState:g,layout:b,panelData:K,panelIndex:oe})},[g,b]),A=_.useCallback(re=>{const{layout:Z,panelDataArray:K}=P.current,{collapsedSize:oe=0,collapsible:ie,panelSize:Y}=pv(K,re,Z);return zn(Y!=null,`Panel size not found for panel "${re.id}"`),ie===!0&&xh(Y,oe)},[]),I=_.useCallback(re=>{const{layout:Z,panelDataArray:K}=P.current,{collapsedSize:oe=0,collapsible:ie,panelSize:Y}=pv(K,re,Z);return zn(Y!=null,`Panel size not found for panel "${re.id}"`),!ie||hv(Y,oe)>0},[]),L=_.useCallback(re=>{const{panelDataArray:Z}=P.current;Z.push(re),Z.sort((K,oe)=>{const ie=K.order,Y=oe.order;return ie==null&&Y==null?0:ie==null?-1:Y==null?1:ie-Y}),P.current.panelDataArrayChanged=!0,O()},[O]);dv(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:re,onLayout:Z,storage:K}=T.current,{layout:oe,panelDataArray:ie}=P.current;let Y=null;if(re){const me=function(ce,ve,ye){var _e,Se;return(Se=((_e=kDe(ce,ye))!==null&&_e!==void 0?_e:{})[wDe(ve)])!==null&&Se!==void 0?Se:null}(re,ie,K);me&&(S.current=new Map(Object.entries(me.expandToSizes)),Y=me.layout)}Y==null&&(Y=function({panelDataArray:me}){const ce=Array(me.length),ve=me.map(Se=>Se.constraints);let ye=0,_e=100;for(let Se=0;Se<me.length;Se++){const Ae=ve[Se];zn(Ae,`Panel constraints not found for index ${Se}`);const{defaultSize:je}=Ae;je!=null&&(ye++,ce[Se]=je,_e-=je)}for(let Se=0;Se<me.length;Se++){const Ae=ve[Se];zn(Ae,`Panel constraints not found for index ${Se}`);const{defaultSize:je}=Ae;if(je!=null)continue;const Ie=_e/(me.length-ye);ye++,ce[Se]=Ie,_e-=Ie}return ce}({panelDataArray:ie}));const le=SDe({layout:Y,panelConstraints:ie.map(me=>me.constraints)});yDe(oe,le)||(p(le),P.current.layout=le,Z&&Z(le),nx(ie,le,k.current))}}),dv(()=>{const re=P.current;return()=>{re.layout=[]}},[]);const F=_.useCallback(re=>{let Z=!1;const K=h.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(Z=!0),function(oe){oe.preventDefault();const ie=h.current;if(!ie)return()=>null;const{direction:Y,dragState:le,id:me,keyboardResizeBy:ce,onLayout:ve}=T.current,{layout:ye,panelDataArray:_e}=P.current,{initialLayout:Se}=le??{},Ae=gDe(me,re,ie);let je=omt(oe,re,Y,le,ce,ie);const Ie=Y==="horizontal";Ie&&Z&&(je=-je);const De=AC({delta:je,initialLayout:Se??ye,panelConstraints:_e.map(Fe=>Fe.constraints),pivotIndices:Ae,prevLayout:ye,trigger:rDe(oe)?"keyboard":"mouse-or-touch"}),nt=!q4(ye,De);(oDe(oe)||iDe(oe))&&w.current!=je&&(w.current=je,tmt(re,nt||je===0?0:Ie?je<0?uDe:dDe:je<0?fDe:hDe)),nt&&(p(De),P.current.layout=De,ve&&ve(De),nx(_e,De,k.current))}},[]),Q=_.useCallback((re,Z)=>{const{onLayout:K}=T.current,{layout:oe,panelDataArray:ie}=P.current,Y=ie.map(ve=>ve.constraints),{panelSize:le,pivotIndices:me}=pv(ie,re,oe);zn(le!=null,`Panel size not found for panel "${re.id}"`);const ce=AC({delta:rx(ie,re)===ie.length-1?le-Z:Z-le,initialLayout:oe,panelConstraints:Y,pivotIndices:me,prevLayout:oe,trigger:"imperative-api"});q4(oe,ce)||(p(ce),P.current.layout=ce,K&&K(ce),nx(ie,ce,k.current))},[]),W=_.useCallback((re,Z)=>{const{layout:K,panelDataArray:oe}=P.current,{collapsedSize:ie=0,collapsible:Y}=Z,{collapsedSize:le=0,collapsible:me,maxSize:ce=100,minSize:ve=0}=re.constraints,{panelSize:ye}=pv(oe,re,K);ye!=null&&(Y&&me&&xh(ye,ie)?xh(ie,le)||Q(re,le):ye<ve?Q(re,ve):ye>ce&&Q(re,ce))},[Q]),U=_.useCallback((re,Z)=>{const{direction:K}=T.current,{layout:oe}=P.current;if(!h.current)return;const ie=V4(re,h.current);zn(ie,`Drag handle element not found for id "${re}"`);const Y=bDe(K,Z);v({dragHandleId:re,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:Y,initialLayout:oe})},[]),X=_.useCallback(()=>{v(null)},[]),G=_.useCallback(re=>{const{panelDataArray:Z}=P.current,K=rx(Z,re);K>=0&&(Z.splice(K,1),delete k.current[re.id],P.current.panelDataArrayChanged=!0,O())},[O]),ae=_.useMemo(()=>({collapsePanel:j,direction:r,dragState:g,expandPanel:D,getPanelSize:N,getPanelStyle:E,groupId:f,isPanelCollapsed:A,isPanelExpanded:I,reevaluatePanelConstraints:W,registerPanel:L,registerResizeHandle:F,resizePanel:Q,startDragging:U,stopDragging:X,unregisterPanel:G,panelGroupElement:h.current}),[j,g,r,D,N,E,f,A,I,W,L,F,Q,U,X,G]),ne={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return _.createElement(N4.Provider,{value:ae},_.createElement(u,{...d,children:e,className:n,id:i,ref:h,style:{...ne,...c},[zpt]:"",[J4e]:r,[RC]:f}))}BH=_.forwardRef((t,e)=>_.createElement(_De,{...t,forwardedRef:e}));function rx(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function pv(t,e,n){const r=rx(t,e),o=r===t.length-1?[r-1,r]:[r,r+1],i=n[r];return{...e.constraints,panelSize:i,pivotIndices:o}}$N=function({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onClick:a,onDragging:s,onFocus:l,onPointerDown:c,onPointerUp:u,style:d={},tabIndex:f=0,tagName:h="div",...g}){var v,b;const p=_.useRef(null),O=_.useRef({onClick:a,onDragging:s,onPointerDown:c,onPointerUp:u});_.useEffect(()=>{O.current.onClick=a,O.current.onDragging=s,O.current.onPointerDown=c,O.current.onPointerUp=u});const k=_.useContext(N4);if(k===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:S,groupId:w,registerResizeHandle:T,startDragging:P,stopDragging:j,panelGroupElement:D}=k,N=zU(o),[E,A]=_.useState("inactive"),[I,L]=_.useState(!1),[F,Q]=_.useState(null),W=_.useRef({state:E});dv(()=>{W.current.state=E}),_.useEffect(()=>{if(n)Q(null);else{const G=T(N);Q(()=>G)}},[n,N,T]);const U=(v=r==null?void 0:r.coarse)!==null&&v!==void 0?v:15,X=(b=r==null?void 0:r.fine)!==null&&b!==void 0?b:5;return _.useEffect(()=>{if(n||F==null)return;const G=p.current;zn(G,"Element ref not attached");let ae=!1;return function(ne,re,Z,K,oe){var ie;const{ownerDocument:Y}=re,le={direction:Z,element:re,hitAreaMargins:K,setResizeHandlerState:oe},me=(ie=fv.get(Y))!==null&&ie!==void 0?ie:0;return fv.set(Y,me+1),DC.add(le),L4(),function(){var ce;Q4.delete(ne),DC.delete(le);const ve=(ce=fv.get(Y))!==null&&ce!==void 0?ce:1;if(fv.set(Y,ve-1),L4(),ve===1&&fv.delete(Y),fu.includes(le)){const ye=fu.indexOf(le);ye>=0&&fu.splice(ye,1),UU(),oe("up",!0,null)}}}(N,G,S,{coarse:U,fine:X},(ne,re,Z)=>{if(re)switch(ne){case"down":{A("drag"),ae=!1,zn(Z,'Expected event to be defined for "down" action'),P(N,Z);const{onDragging:K,onPointerDown:oe}=O.current;K==null||K(!0),oe==null||oe();break}case"move":{const{state:K}=W.current;ae=!0,K!=="drag"&&A("hover"),zn(Z,'Expected event to be defined for "move" action'),F(Z);break}case"up":{A("hover"),j();const{onClick:K,onDragging:oe,onPointerUp:ie}=O.current;oe==null||oe(!1),ie==null||ie(),ae||K==null||K();break}}else A("inactive")})},[U,S,n,X,T,N,F,P,j]),function({disabled:G,handleId:ae,resizeHandler:ne,panelGroupElement:re}){_.useEffect(()=>{if(G||ne==null||re==null)return;const Z=V4(ae,re);if(Z==null)return;const K=oe=>{if(!oe.defaultPrevented)switch(oe.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":oe.preventDefault(),ne(oe);break;case"F6":{oe.preventDefault();const ie=Z.getAttribute(RC);zn(ie,`No group element found for id "${ie}"`);const Y=MC(ie,re),le=mDe(ie,ae,re);zn(le!==null,`No resize element found for id "${ae}"`),Y[oe.shiftKey?le>0?le-1:Y.length-1:le+1<Y.length?le+1:0].focus();break}}};return Z.addEventListener("keydown",K),()=>{Z.removeEventListener("keydown",K)}},[re,G,ae,ne])}({disabled:n,handleId:N,resizeHandler:F,panelGroupElement:D}),_.createElement(h,{...g,children:t,className:e,id:o,onBlur:()=>{L(!1),i==null||i()},onFocus:()=>{L(!0),l==null||l()},ref:p,role:"separator",style:{touchAction:"none",userSelect:"none",...d},tabIndex:f,[J4e]:S,[RC]:w,[eDe]:"",[Wpt]:E==="drag"?"pointer":I?"keyboard":void 0,[Upt]:!n,[jC]:N,[Zpt]:E})},_De.displayName="PanelGroup",BH.displayName="forwardRef(PanelGroup)",$N.displayName="PanelResizeHandle";var TDe="Toggle",PDe=_.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...i}=t,[a,s]=Ao({prop:n,onChange:o,defaultProp:r??!1,caller:TDe});return y.jsx(_t.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:ut(t.onClick,()=>{t.disabled||s(!a)})})});PDe.displayName=TDe;var EDe=PDe;let RDe;RDe=Po(we("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","data-[state=on]:bg-muted data-[state=on]:text-muted-foreground"),{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted hover:text-muted-foreground"},size:{default:"h-9 px-3",xs:"h-4 w-4",sm:"h-6 px-2",lg:"h-10 px-5"}},defaultVariants:{variant:"default",size:"default"}}),DO=_.forwardRef((t,e)=>{const n=ue.c(13);let r,o,i,a,s,l;return n[0]!==t?({className:r,variant:a,size:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i,n[4]=a):(r=n[1],o=n[2],i=n[3],a=n[4]),n[5]!==r||n[6]!==i||n[7]!==a?(s=we(RDe({variant:a,size:i,className:r})),n[5]=r,n[6]=i,n[7]=a,n[8]=s):s=n[8],n[9]!==o||n[10]!==e||n[11]!==s?(l=y.jsx(EDe,{ref:e,className:s,...o}),n[9]=o,n[10]=e,n[11]=s,n[12]=l):l=n[12],l}),DO.displayName=EDe.displayName,BJ=t=>{const e=ue.c(8),{onResize:n,startingWidth:r,minWidth:o,maxWidth:i}=t,a=_.useRef(null),s=_.useRef(null),l=_.useRef(null);let c,u,d;e[0]!==i||e[1]!==o||e[2]!==n?(c=()=>{const g=a.current,v=s.current,b=l.current;if(!g||!v&&!b)return;let p=Number.parseInt(window.getComputedStyle(g).width),O=0,k=!1,S=null;const w=N=>{if(!g||!k||!S)return;const E=N.clientX-O;O=N.clientX,p=S==="left"?p-E:p+E,o&&(p=Math.max(o,p)),i&&(p=Math.min(i,p)),g.style.width=`${p}px`},T=()=>{k&&(n==null||n(p),k=!1,S=null),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",T)},P=(N,E)=>{N.preventDefault(),k=!0,S=E,O=N.clientX,document.addEventListener("mousemove",w),document.addEventListener("mouseup",T)},j=N=>P(N,"left"),D=N=>P(N,"right");return v&&v.addEventListener("mousedown",j),b&&b.addEventListener("mousedown",D),()=>{v&&v.removeEventListener("mousedown",j),b&&b.removeEventListener("mousedown",D),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",T)}},u=[o,i,n],e[0]=i,e[1]=o,e[2]=n,e[3]=c,e[4]=u):(c=e[3],u=e[4]),_.useEffect(c,u),e[5]===Symbol.for("react.memo_cache_sentinel")?(d={left:s,right:l},e[5]=d):d=e[5];const f=r==="contentWidth"?"var(--content-width-medium)":`${r}px`;let h;return e[6]!==f?(h={resizableDivRef:a,handleRefs:d,style:{width:f}},e[6]=f,e[7]=h):h=e[7],h},UJ=function(t){t||window.dispatchEvent(new Event("resize"))};let XU,jDe;MIe=()=>{const t=ue.c(16),[e,n]=ss(H4e),[r,o]=ss(Y4e),[i,a]=ss(Qpt),[s,l]=ss(G4e);let c;t[0]!==o||t[1]!==n?(c=()=>{n(null),o(!1)},t[0]=o,t[1]=n,t[2]=c):c=t[2];const u=c;if(hM(og.CONTEXT_AWARE_PANEL).length===0||!e||!r)return null;let d;t[3]!==s||t[4]!==i||t[5]!==l||t[6]!==a?(d=()=>y.jsxs("div",{className:"flex flex-row items-center gap-3",children:[y.jsx(qn,{content:i?"Unpin panel":"Pin panel",children:y.jsx(DO,{size:"xs",onPressedChange:()=>a(!i),pressed:i,"aria-label":i?"Unpin panel":"Pin panel",children:i?y.jsx(qce,{className:"w-4 h-4"}):y.jsx(E6,{className:"w-4 h-4"})})}),y.jsx(qn,{content:s?y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx("span",{children:"Follow focused table"}),y.jsx("span",{className:"text-xs text-muted-foreground w-64",children:"The panel updates as cells that output tables are focused. Click to fix to the current cell."})]}):y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx("span",{children:"Focus on current table"}),y.jsx("span",{className:"text-xs text-muted-foreground w-64",children:"The panel is focused on the current table. Click to update based on which cell is focused."})]}),children:y.jsx(DO,{size:"xs",onPressedChange:()=>l(!s),pressed:s,"aria-label":s?"Follow focused cell":"Fixed",children:y.jsx(Tce,{className:we("w-4 h-4",s&&"text-primary")})})})]}),t[3]=s,t[4]=i,t[5]=l,t[6]=a,t[7]=d):d=t[7];const f=d;let h;t[8]!==u||t[9]!==f?(h=()=>y.jsxs("div",{className:"mt-2 pb-7 mb-4 h-full overflow-auto",children:[y.jsxs("div",{className:"flex flex-row justify-between items-center mx-2",children:[f(),y.jsx(Ft,{variant:"linkDestructive",size:"icon",onClick:u,"aria-label":"Close selection panel",children:y.jsx(Qa,{className:"w-4 h-4"})})]}),y.jsx(Bh,{children:y.jsx(oG,{name:og.CONTEXT_AWARE_PANEL})})]}),t[8]=u,t[9]=f,t[10]=h):h=t[10];const g=h;if(!i){let p;return t[11]!==g?(p=y.jsx(jDe,{children:g()}),t[11]=g,t[12]=p):p=t[12],p}let v,b;return t[13]===Symbol.for("react.memo_cache_sentinel")?(v=y.jsx($N,{onDragging:UJ,className:"resize-handle border-border z-20 no-print border-l"}),t[13]=v):v=t[13],t[14]!==g?(b=y.jsxs(y.Fragment,{children:[v,y.jsx(AA,{defaultSize:20,minSize:15,maxSize:80,children:g()})]}),t[14]=g,t[15]=b):b=t[15],b},XU=t=>{const e=ue.c(2),{children:n}=t;let r;return e[0]!==n?(r=y.jsx(Bh,{children:y.jsx(jct,{name:og.CONTEXT_AWARE_PANEL,children:n})}),e[0]=n,e[1]=r):r=e[1],r},jDe=t=>{const e=ue.c(10),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={startingWidth:400,minWidth:300,maxWidth:1500},e[0]=r):r=e[0];const{resizableDivRef:o,handleRefs:i,style:a}=BJ(r);let s,l,c;return e[1]!==i.left?(s=y.jsx("div",{ref:i.left,className:"w-1 h-full cursor-col-resize border-l"}),e[1]=i.left,e[2]=s):s=e[2],e[3]!==n||e[4]!==o||e[5]!==a?(l=y.jsx("div",{ref:o,style:a,children:n}),e[3]=n,e[4]=o,e[5]=a,e[6]=l):l=e[6],e[7]!==s||e[8]!==l?(c=y.jsxs("div",{className:"absolute z-40 right-0 h-full bg-background flex flex-row",children:[s,l]}),e[7]=s,e[8]=l,e[9]=c):c=e[9],c},gn={of:t=>JSON.stringify(t),parse(t){if(!t)return{};try{return JSON.parse(t)}catch{return{label:t}}}};function HU(){return Math.floor(1e5*Math.random())}const DDe=["count","sum","mean","median","min","max"],hu={number:hy.number().describe(gn.of({label:"Value"})),string:Pe().min(1).describe(gn.of({label:"Value"})),stringColumnValues:Pe().min(1).describe(gn.of({label:"Value",special:"column_values"})),stringMultiColumnValues:Wt(Pe()).min(1).describe(gn.of({label:"Value",special:"column_values"})),date:hy.date().describe(gn.of({label:"Value",special:"date"})),datetime:hy.date().describe(gn.of({label:"Value",special:"datetime"})),time:Pe().regex(/^\d{2}:\d{2}(:\d{2})?$/).describe(gn.of({label:"Value",special:"time"}))},F4={is_true:[],is_false:[]},B4=t=>({"==":[t],"!=":[t],">":[t],">=":[t],"<":[t],"<=":[t],is_null:[],is_not_null:[]}),W4=B4(hu.number),U4=B4(hu.date),Z4=B4(hu.time),X4=B4(hu.datetime),H4={equals:[hu.stringColumnValues],does_not_equal:[hu.stringColumnValues],contains:[hu.string],regex:[hu.string],starts_with:[hu.string],ends_with:[hu.string],in:[hu.stringMultiColumnValues],is_null:[],is_not_null:[]},amt={...F4,...W4,...U4,...Z4,...X4,...H4};function ADe(t){return t?t.startsWith("int")?"integer":t.startsWith("float")||t.startsWith("uint")||t.startsWith("number")||t.startsWith("complex")?"number":t.startsWith("string")||t.startsWith("object")||t.startsWith("utf8")?"string":t.startsWith("datetime")?"datetime":t.startsWith("time")?"time":t.startsWith("date")?"date":t.startsWith("bool")?"boolean":"unknown":"unknown"}function MDe(t){if(!t)return[];switch(ADe(t)){case"integer":case"number":return Object.keys(W4);case"string":return Object.keys(H4);case"date":return Object.keys(U4);case"datetime":return Object.keys(X4);case"time":return Object.keys(Z4);case"boolean":return Object.keys(F4);case"unknown":return[]}}const mc=(t,e)=>t[e]?t[e]:[],Y4=Wt(sf([hy.string(),sf([un(r4),Pe()])])),ox=Pe().min(1,"Required").or(yt()).transform(t=>t).describe(gn.of({label:"Column",special:"column_id"})),$C=Wt(ox.describe(gn.of({special:"column_id"}))).min(1,"At least one column is required").default([]).describe(gn.of({label:"Columns"})),smt=Qe({type:Jr("column_conversion"),column_id:ox,data_type:un(["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","complex64","complex128","bool","object","str","unicode","datetime64","timedelta64"]).describe(gn.of({label:"Data type (numpy)"})).default("bool"),errors:un(["ignore","raise"]).default("ignore").describe(gn.of({label:"Handle errors",special:"radio_group"}))}).describe(gn.of({})),lmt=Qe({type:Jr("rename_column"),column_id:ox,new_column_id:Pe().min(1,"Required").transform(t=>t).describe(gn.of({label:"New column name"}))}),cmt=Qe({type:Jr("sort_column"),column_id:ox,ascending:pt().describe(gn.of({label:"Ascending"})).default(!0),na_position:un(["first","last"]).describe(gn.of({label:"N/A position",special:"radio_group"})).default("last")}),YU=Qe({column_id:ox,operator:un(Object.keys(amt)).describe(gn.of({label:" "})),value:El().describe(gn.of({label:"Value"}))}).describe(gn.of({direction:"row",special:"column_filter"})),umt=Qe({type:Jr("filter_rows"),operation:un(["keep_rows","remove_rows"]).default("keep_rows").describe(gn.of({special:"radio_group"})),where:Wt(YU).min(1).transform(t=>t.filter(e=>function(n,r){const o=[mc(F4,n),mc(U4,n),mc(Z4,n),mc(X4,n),mc(W4,n),mc(H4,n)].flat();return o.length===0||o.some(i=>i.safeParse(r).success)}(e.operator,e.value))).describe(gn.of({label:"Value"})).default([{column_id:"",operator:"==",value:""}])}),dmt=Qe({type:Jr("group_by"),column_ids:$C,aggregation:un(DDe).default("count").describe(gn.of({label:"Aggregation"})),drop_na:pt().default(!1).describe(gn.of({label:"Drop N/A"}))}).describe(gn.of({})),fmt=Qe({type:Jr("aggregate"),column_ids:$C,aggregations:Wt(un(DDe)).min(1,"At least one aggregation is required").default(["count"]).describe(gn.of({label:"Aggregations"}))}).describe(gn.of({direction:"row"})),hmt=Qe({type:Jr("select_columns"),column_ids:$C}),pmt=Qe({type:Jr("sample_rows"),n:yt().positive().describe(gn.of({label:"Number of rows"})),seed:yt().default(()=>HU()).describe(gn.of({label:"Re-sample",special:"random_number_button"})),replace:pt().default(!1).describe(gn.of({label:"Sample with replacement"}))}),mmt=Qe({type:Jr("shuffle_rows"),seed:yt().default(()=>HU()).describe(gn.of({label:"Re-shuffle",special:"random_number_button"}))}),gmt=Qe({type:Jr("explode_columns"),column_ids:$C}),vmt=Qe({type:Jr("expand_dict"),column_id:ox}),ymt=Qe({type:Jr("unique"),column_ids:$C,keep:un(["first","last","none","any"]).default("first").describe(gn.of({label:"Keep"}))}).describe(gn.of({direction:"row"})),GU=or([umt,hmt,lmt,smt,cmt,dmt,fmt,pmt,mmt,gmt,vmt,ymt]),bmt=Qe({transforms:Wt(GU)}),Oh=or([yt(),tte(),Pe()]).nullable(),NDe=Qe({total:yt().nullable(),nulls:yt().nullable(),unique:yt().nullable(),true:yt().nullable(),false:yt().nullable(),min:Oh,max:Oh,std:Oh,mean:Oh,median:Oh,p5:Oh,p25:Oh,p75:Oh,p95:Oh}),xmt=Wt(Qe({bin_start:yt(),bin_end:yt(),count:yt()})),Omt=lu("marimo-table").withData(Qe({initialValue:or([Wt(yt()),Wt(Qe({rowId:Pe(),columnName:Pe()}))]),label:Pe().nullable(),data:or([Pe(),Wt(Qe({}).passthrough())]),totalRows:or([yt(),Jr(QS)]),pagination:pt().default(!1),pageSize:yt().default(10),selection:un(["single","multi","single-cell","multi-cell"]).nullable().default(null),showDownload:pt().default(!1),showFilters:pt().default(!1),showColumnSummaries:or([pt(),un(["stats","chart"])]).default(!0),showDataTypes:pt().default(!0),showPageSizeSelector:pt().default(!0),showColumnExplorer:pt().default(!0),showChartBuilder:pt().default(!0),rowHeaders:Y4,freezeColumnsLeft:Wt(Pe()).optional(),freezeColumnsRight:Wt(Pe()).optional(),textJustifyColumns:ds(un(["left","center","right"])).optional(),wrappedColumns:Wt(Pe()).optional(),fieldTypes:Y4.nullish(),totalColumns:yt(),maxColumns:or([yt(),Jr("all")]).default("all"),hasStableRowId:pt().default(!1),cellStyles:ds(ds(Qe({}).passthrough())).optional(),lazy:pt().default(!1),preload:pt().default(!1)})).withFunctions({download_as:_i.input(Qe({format:un(["csv","json","parquet"])})).output(Pe()),get_column_summaries:_i.input(Qe({precompute:pt()})).output(Qe({data:or([Pe(),Wt(Qe({}).passthrough())]).nullable(),stats:ds(Pe(),NDe),bin_values:ds(Pe(),xmt),is_disabled:pt().optional()})),search:_i.input(Qe({sort:Qe({by:Pe(),descending:pt()}).optional(),query:Pe().optional(),filters:Wt(YU).optional(),page_number:yt(),page_size:yt(),max_columns:yt().nullable().optional()})).output(Qe({data:or([Pe(),Wt(Qe({}).passthrough())]),total_rows:or([yt(),Jr(QS)]),cell_styles:ds(ds(Qe({}).passthrough())).nullable()})),get_row_ids:_i.input(Qe({}).passthrough()).output(Qe({row_ids:Wt(yt()),all_rows:pt(),error:Pe().nullable()})),get_data_url:_i.input(Qe({}).passthrough()).output(Qe({data_url:or([Pe(),Wt(Qe({}).passthrough())]),format:un(["csv","json","arrow"])})),calculate_top_k_rows:_i.input(Qe({column:Pe(),k:yt()})).output(Qe({data:Wt(sf([El(),yt()]))})),preview_column:_i.input(Qe({column:Pe()})).output(Qe({chart_spec:Pe().nullable(),chart_code:Pe().nullable(),error:Pe().nullable(),missing_packages:Wt(Pe()).nullable(),stats:NDe.nullable()}))}).renderer(t=>y.jsx($De,{children:y.jsx(wmt,{isLazy:t.data.lazy,preload:t.data.preload,children:y.jsx(KU,{...t.data,...t.functions,host:t.host,enableSearch:!0,data:t.data.data,value:t.value,setValue:t.setValue})})})),wmt=t=>{const e=ue.c(1),{isLazy:n,children:r,preload:o}=t,[i,a]=_.useState(n&&!o);if(i){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsx("div",{className:"flex h-20 items-center justify-center",children:y.jsxs(Ft,{variant:"outline",size:"xs",onClick:()=>a(!1),children:[y.jsx(lee,{className:"mr-2 h-4 w-4"}),"Preview data"]})}),e[0]=s):s=e[0],s}return r},KU=_.memo(t=>{const e=ue.c(97);let n;e[0]!==t.host?(n=function(De){let nt=null;const Fe=Xs.findElement(De);return Fe&&(nt=Xs.parse(Fe.id)),nt}(t.host),e[0]=t.host,e[1]=n):n=e[1];const r=n,o=t.search,i=t.setValue;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[2]=a):a=e[2];const[s,l]=_.useState(a);let c;e[3]!==t.pageSize?(c={pageSize:t.pageSize,pageIndex:0},e[3]=t.pageSize,e[4]=c):c=e[4];const[u,d]=ge.useState(c),[f,h]=_.useState("");let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[5]=g):g=e[5];const[v,b]=_.useState(g);let p;e[6]!==r||e[7]!==t.showChartBuilder?(p=()=>!(!t.showChartBuilder||!r)&&function(De){const nt=Cpt.get(De);return!!nt&&nt.length>0}(r),e[6]=r,e[7]=t.showChartBuilder,e[8]=p):p=e[8];const[O,k]=_.useState(p);let S,w,T,P,j;e[9]!==t.hasStableRowId||e[10]!==i?(S=()=>{t.hasStableRowId||i([])},e[9]=t.hasStableRowId,e[10]=i,e[11]=S):S=e[11],e[12]!==v||e[13]!==t.hasStableRowId||e[14]!==f||e[15]!==i||e[16]!==s?(w=[i,v,f,s,t.hasStableRowId],e[12]=v,e[13]=t.hasStableRowId,e[14]=f,e[15]=i,e[16]=s,e[17]=w):w=e[17],function(De,nt){const Fe=ue.c(2),kt=_.useRef(!1);let Re;Fe[0]!==De?(Re=()=>{kt.current?De():kt.current=!0},Fe[0]=De,Fe[1]=Re):Re=Fe[1],_.useEffect(Re,nt)}(S,w),e[18]!==t.pageSize?(T=()=>{d({pageIndex:0,pageSize:t.pageSize})},P=[t.pageSize],e[18]=t.pageSize,e[19]=T,e[20]=P):(T=e[19],P=e[20]),_.useEffect(T,P),e[21]!==v||e[22]!==u.pageIndex||e[23]!==u.pageSize||e[24]!==t.cellStyles||e[25]!==t.data||e[26]!==t.lazy||e[27]!==t.pageSize||e[28]!==t.totalRows||e[29]!==o||e[30]!==f||e[31]!==s[0]||e[32]!==s.length?(j=async()=>{if(t.totalRows===0)return{rows:Lc.EMPTY,totalRows:0,cellStyles:{}};let De=t.data,nt=t.totalRows,Fe=t.cellStyles;const kt=u.pageSize!==t.pageSize,Re=f===""&&u.pageIndex===0&&v.length===0&&s.length===0&&!t.lazy&&!kt;s.length>1&&Ve.warn("Multiple sort columns are not supported");const ot=o({sort:s.length>0?{by:s[0].id,descending:s[0].desc}:void 0,query:f,page_number:u.pageIndex,page_size:u.pageSize,filters:v.flatMap(Smt)});if(Re)ot.catch(Cmt);else{const Me=await ot;De=Me.data,nt=Me.total_rows,Fe=Me.cell_styles||{}}return De=await Fke(De),{rows:De,totalRows:nt,cellStyles:Fe}},e[21]=v,e[22]=u.pageIndex,e[23]=u.pageSize,e[24]=t.cellStyles,e[25]=t.data,e[26]=t.lazy,e[27]=t.pageSize,e[28]=t.totalRows,e[29]=o,e[30]=f,e[31]=s[0],e[32]=s.length,e[33]=j):j=e[33];const D=Gd(t.fieldTypes);let N;e[34]!==v||e[35]!==u.pageIndex||e[36]!==u.pageSize||e[37]!==t.data||e[38]!==t.lazy||e[39]!==t.totalRows||e[40]!==o||e[41]!==f||e[42]!==s||e[43]!==D?(N=[s,o,v,f,D,t.data,t.totalRows,t.lazy,u.pageSize,u.pageIndex],e[34]=v,e[35]=u.pageIndex,e[36]=u.pageSize,e[37]=t.data,e[38]=t.lazy,e[39]=t.totalRows,e[40]=o,e[41]=f,e[42]=s,e[43]=D,e[44]=N):N=e[44];const{data:E,error:A,isPending:I,isFetching:L}=$a(j,N);let F;e[45]!==v||e[46]!==o||e[47]!==f||e[48]!==s[0]||e[49]!==s.length?(F=async De=>{const nt=await o({page_number:De,page_size:1,sort:s.length>0?{by:s[0].id,descending:s[0].desc}:void 0,query:f,filters:v.flatMap(_mt),max_columns:null});return{rows:await Fke(nt.data)}},e[45]=v,e[46]=o,e[47]=f,e[48]=s[0],e[49]=s.length,e[50]=F):F=e[50];const Q=F;let W;e[51]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{d(Tmt)},e[51]=W):W=e[51];const U=E==null?void 0:E.totalRows;let X,G;e[52]!==U?(X=[U],e[52]=U,e[53]=X):X=e[53],_.useEffect(W,X),e[54]===Symbol.for("react.memo_cache_sentinel")?(G=RT("performant_table_charts"),e[54]=G):G=e[54];const ae=G;let ne,re;e[55]!==t?(ne=async()=>t.totalRows!==0&&t.showColumnSummaries?t.get_column_summaries({precompute:ae}):{data:null,stats:{},bin_values:{}},e[55]=t,e[56]=ne):ne=e[56],e[57]!==v||e[58]!==t.data||e[59]!==t.get_column_summaries||e[60]!==t.showColumnSummaries||e[61]!==t.totalRows||e[62]!==f?(re=[t.get_column_summaries,t.showColumnSummaries,v,f,t.totalRows,t.data],e[57]=v,e[58]=t.data,e[59]=t.get_column_summaries,e[60]=t.showColumnSummaries,e[61]=t.totalRows,e[62]=f,e[63]=re):re=e[63];const{data:Z,error:K}=$a(ne,re);let oe,ie;if(e[64]!==K?(oe=()=>{K&&Ve.error(K)},ie=[K],e[64]=K,e[65]=oe,e[66]=ie):(oe=e[65],ie=e[66]),_.useEffect(oe,ie),I){const De=t.totalRows!==QS&&t.totalRows>0?t.totalRows:t.pageSize;let nt;return e[67]!==De?(nt=y.jsx($_,{milliseconds:200,children:y.jsx(lje,{pageSize:De})}),e[67]=De,e[68]=nt):nt=e[68],nt}let Y,le=null;if(A){let De;Ve.error(A),e[69]!==A?(De=!I_()&&y.jsxs(Qv,{variant:"destructive",className:"mb-2",children:[y.jsx(Lv,{children:"Error"}),y.jsx("div",{className:"text-md",children:A.message||"An unknown error occurred"})]}),e[69]=A,e[70]=De):De=e[70],le=De}e[71]!==O?(Y=()=>{k(!O)},e[71]=O,e[72]=Y):Y=e[72];const me=Y,ce=(E==null?void 0:E.rows)??Lc.EMPTY,ve=L&&!I,ye=(E==null?void 0:E.totalRows)??t.totalRows,_e=(E==null?void 0:E.cellStyles)??t.cellStyles;let Se;e[73]!==r||e[74]!==Z||e[75]!==v||e[76]!==Q||e[77]!==u||e[78]!==t||e[79]!==f||e[80]!==s||e[81]!==ce||e[82]!==ve||e[83]!==ye||e[84]!==_e||e[85]!==me?(Se=y.jsx(kmt,{...t,data:ce,columnSummaries:Z,sorting:s,setSorting:l,searchQuery:f,setSearchQuery:h,filters:v,setFilters:b,reloading:ve,totalRows:ye,paginationState:u,setPaginationState:d,cellStyles:_e,toggleDisplayHeader:me,getRow:Q,cellId:r}),e[73]=r,e[74]=Z,e[75]=v,e[76]=Q,e[77]=u,e[78]=t,e[79]=f,e[80]=s,e[81]=ce,e[82]=ve,e[83]=ye,e[84]=_e,e[85]=me,e[86]=Se):Se=e[86];const Ae=Se;let je,Ie;return e[87]!==r||e[88]!==Ae||e[89]!==O||e[90]!==t.fieldTypes||e[91]!==t.get_data_url||e[92]!==t.showChartBuilder?(je=t.showChartBuilder?y.jsx(_pt,{displayHeader:O,dataTable:Ae,getDataUrl:t.get_data_url,fieldTypes:t.fieldTypes,cellId:r}):Ae,e[87]=r,e[88]=Ae,e[89]=O,e[90]=t.fieldTypes,e[91]=t.get_data_url,e[92]=t.showChartBuilder,e[93]=je):je=e[93],e[94]!==le||e[95]!==je?(Ie=y.jsxs(y.Fragment,{children:[le,je]}),e[94]=le,e[95]=je,e[96]=Ie):Ie=e[96],Ie});KU.displayName="LoadingDataTableComponent";const kmt=({label:t,data:e,totalRows:n,maxColumns:r,pagination:o,selection:i,value:a,showFilters:s,showDownload:l,showPageSizeSelector:c,showColumnExplorer:u,showChartBuilder:d,showDataTypes:f,rowHeaders:h,fieldTypes:g,paginationState:v,setPaginationState:b,download_as:p,columnSummaries:O,className:k,setValue:S,sorting:w,setSorting:T,enableSearch:P,searchQuery:j,setSearchQuery:D,filters:N,setFilters:E,reloading:A,freezeColumnsLeft:I,freezeColumnsRight:L,textJustifyColumns:F,wrappedColumns:Q,totalColumns:W,get_row_ids:U,cellStyles:X,toggleDisplayHeader:G,calculate_top_k_rows:ae,preview_column:ne,getRow:re,cellId:Z})=>{const K=_.useId(),[oe,ie]=_.useState(0),{isPanelOpen:Y,togglePanel:le}=function(Me,We){const it=ue.c(12);let Ue=Gr(G4e);const{focusCell:gt}=PJ(),Tt=PT(),[Kt,Sn]=ss(Ipt),[Jt,sn]=ss(H4e),[jn,Zr]=ss(Y4e),Nr=function(Mt,Dt){return Dt?`${Dt}-${Mt}`:Mt}(Me,We);!We&&Ue&&(Ve.error("CellId is not found, defaulting to fixed mode"),Ue=!1);const go=Mt=>Jt===Nr&&jn&&Mt===Kt,Pi=Tt===We,Xr=Jt&&function(Mt,Dt){return!!Dt&&Mt.startsWith(Dt)}(Jt,We);let at;Ue&&Pi&&Jt!==Nr&&!Xr&&sn(Nr),it[0]!==We||it[1]!==gt||it[2]!==Ue||it[3]!==go||it[4]!==Nr||it[5]!==Zr||it[6]!==sn||it[7]!==Sn?(at=function(Mt){go(Mt)?(sn(null),Zr(!1)):(sn(Nr),Ue&&We&>({cellId:We}),Zr(!0),Sn(Mt))},it[0]=We,it[1]=gt,it[2]=Ue,it[3]=go,it[4]=Nr,it[5]=Zr,it[6]=sn,it[7]=Sn,it[8]=at):at=it[8];const Ne=at;let vt;return it[9]!==go||it[10]!==Ne?(vt={isPanelOpen:go,togglePanel:Ne},it[9]=go,it[10]=Ne,it[11]=vt):vt=it[11],vt}(K,Z),me=_.useMemo(()=>{if(!O||!g||!O.stats)return db.EMPTY;const Me=uz(g);return new db(O.data||[],Me,O.stats,O.bin_values,{includeCharts:!!O.data,usePreComputedValues:RT("performant_table_charts")})},[g,O]),ce=Gd(g??Aj(e)),ve=_.useMemo(()=>r==="all"?ce:ce.slice(0,r),[r,ce]),ye=Gd(h),_e=Gd(F),Se=Gd(Q),Ae=Gd(me),je=ve.length;g||(f=!1);const Ie=_.useMemo(()=>Qke({rowHeaders:ye,selection:i,chartSpecModel:Ae,fieldTypes:ve,textJustifyColumns:_e,wrappedColumns:Se,showDataTypes:f,calculateTopKRows:ae}),[i,f,Ae,ye,ve,_e,Se,ae]),De=_.useMemo(()=>Object.fromEntries((a||[]).map(Me=>[Me,!0])),[a]),nt=Fn(Me=>{if(i==="single"){const We=Zi.asUpdater(Me)({});S(Object.keys(We).slice(0,1))}if(i==="multi"){const We=Zi.asUpdater(Me)(De);S(Object.keys(We))}}),Fe=a.filter(Me=>Me instanceof Object&&Me.columnName!==void 0),kt=Fn(Me=>{if(i==="single-cell"){const We=Zi.asUpdater(Me)(Fe);S(We.slice(0,1))}if(i==="multi-cell"){const We=Zi.asUpdater(Me)(Fe);S(We)}}),Re=i==="multi"||i==="single",ot=u&&ne&&Y("column-explorer");return y.jsxs(y.Fragment,{children:[n===QS&&v.pageSize===e.length&&y.jsxs(Km,{className:"mb-1 rounded",children:["Previewing the first ",v.pageSize," rows."]}),je<W&&je>0&&y.jsxs(Km,{className:"mb-1 rounded",children:["Result clipped. Showing ",je," of ",W," columns."]}),(O==null?void 0:O.is_disabled)&&y.jsx(Km,{className:"mb-1 rounded",children:"Column summaries are unavailable. Filter your data to fewer than 1,000,000 rows."}),Y("row-viewer")&&y.jsx(XU,{children:y.jsx(Lpt,{getRow:re,fieldTypes:ce,totalRows:n,rowIdx:oe,setRowIdx:ie,isSelectable:Re,isRowSelected:De[oe],handleRowSelectionChange:nt})}),ot&&y.jsx(XU,{children:y.jsx(Dpt,{previewColumn:ne,fieldTypes:ce,totalRows:n,totalColumns:W,tableId:K})}),y.jsx(Dke,{value:me,children:y.jsx(Jo,{label:t,align:"top",fullWidth:!0,children:y.jsx(oV,{data:e,columns:Ie,className:k,sorting:w,totalRows:n,totalColumns:W,manualSorting:!0,setSorting:T,pagination:o,manualPagination:!0,selection:i,paginationState:v,setPaginationState:b,rowSelection:De,cellSelection:Fe,cellStyling:X,downloadAs:l?p:void 0,enableSearch:P,searchQuery:j,onSearchQueryChange:D,showFilters:s,filters:N,onFiltersChange:E,reloading:A,onRowSelectionChange:nt,freezeColumnsLeft:I,freezeColumnsRight:L,onCellSelectionChange:kt,getRowIds:U,toggleDisplayHeader:G,showChartBuilder:d,showPageSizeSelector:c,showColumnExplorer:u,togglePanel:le,isPanelOpen:Y,viewedRowIdx:oe,onViewedRowChange:Me=>ie(Me)})})})]})},$De=t=>{const e=ue.c(2),{children:n}=t;let r;return e[0]!==n?(r=y.jsx(Hv,{store:Ht,children:y.jsx(XEe,{controller:Vb,children:y.jsx(zO,{children:n})})}),e[0]=n,e[1]=r):r=e[1],r};function Smt(t){return Gxe(t.id,t.value)}function Cmt(t){Ve.error(t)}function _mt(t){return Gxe(t.id,t.value)}function Tmt(t){return t.pageIndex===0?t:{...t,pageIndex:0}}const Pmt=t=>{const e=ue.c(10);let n,r,o;e[0]!==t?({className:n,offset:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const i=o===void 0?4:o;let a,s;return e[4]!==n?(a=cd(n,Emt),e[4]=n,e[5]=a):a=e[5],e[6]!==i||e[7]!==r||e[8]!==a?(s=y.jsx($ye,{offset:i,className:a,...r}),e[6]=i,e[7]=r,e[8]=a,e[9]=s):s=e[9],s};function Emt(t){return we("z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none","data-[entering]:animate-in data-[entering]:fade-in-0 data-[entering]:zoom-in-95","data-[exiting]:animate-out data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95","data-[placement=bottom]:slide-in-from-top-2 data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2",t)}const G4=t=>{const e=ue.c(11),{direction:n}=Mi();let r,o,i,a,s,l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=we(fs({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50","data-[hovered]:opacity-100"),e[0]=r):r=e[0],e[1]!==n?(o=y.jsx(hS,{slot:"previous",className:r,children:n==="rtl"?y.jsx(Qh,{"aria-hidden":!0,className:"size-4"}):y.jsx(ty,{"aria-hidden":!0,className:"size-4"})}),e[1]=n,e[2]=o):o=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(Zye,{className:"grow text-center text-sm font-medium"}),e[3]=i):i=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(a=we(fs({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50","data-[hovered]:opacity-100"),e[4]=a):a=e[4],e[5]!==n?(s=y.jsx(hS,{slot:"next",className:a,children:n==="rtl"?y.jsx(ty,{"aria-hidden":!0,className:"size-4"}):y.jsx(Qh,{"aria-hidden":!0,className:"size-4"})}),e[5]=n,e[6]=s):s=e[6],e[7]!==t||e[8]!==o||e[9]!==s?(l=y.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",...t,children:[o,i,s]}),e[7]=t,e[8]=o,e[9]=s,e[10]=l):l=e[10],l},K4=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we(" border-separate border-spacing-x-0 border-spacing-y-1 ",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(dGe,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},J4=t=>{const e=ue.c(4);let n,r;return e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1],e[2]!==n?(r=y.jsx(Aye,{...n}),e[2]=n,e[3]=r):r=e[3],r},eD=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(Mye,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},tD=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("[&>tr>td]:p-0",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(t9,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},nD=t=>{const e=ue.c(11);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const o=!!_.use(vS);let i,a,s;return e[3]!==o?(i=(l,c)=>we(fs({variant:"ghost"}),"relative flex size-9 items-center justify-center p-0 text-sm font-normal",c.isDisabled&&"text-muted-foreground opacity-50",c.isSelected&&"bg-primary text-primary-foreground data-[focused]:bg-primary data-[focused]:text-primary-foreground",c.isHovered&&c.isSelected&&(c.isSelectionStart||c.isSelectionEnd||!o)&&"data-[hovered]:bg-primary data-[hovered]:text-primary-foreground",c.isSelected&&o&&!c.isSelectionStart&&!c.isSelectionEnd&&"rounded-none bg-accent text-accent-foreground",c.isOutsideMonth&&"text-muted-foreground opacity-50 data-[selected]:bg-accent/50 data-[selected]:text-muted-foreground data-[selected]:opacity-30",c.date.compare(p3(m3()))===0&&!c.isSelected&&"bg-accent text-accent-foreground",c.isUnavailable&&"cursor-default text-destructive ",c.isInvalid&&"bg-destructive text-destructive-foreground data-[focused]:bg-destructive data-[hovered]:bg-destructive data-[focused]:text-destructive-foreground data-[hovered]:text-destructive-foreground",l),e[3]=o,e[4]=i):i=e[4],e[5]!==n||e[6]!==i?(a=cd(n,i),e[5]=n,e[6]=i,e[7]=a):a=e[7],e[8]!==r||e[9]!==a?(s=y.jsx(Nye,{className:a,...r}),e[8]=r,e[9]=a,e[10]=s):s=e[10],s},Rmt=t=>{const e=ue.c(14);let n,r,o,i,a,s,l,c;return e[0]!==t?({errorMessage:r,className:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==n?(i=cd(n,Dmt),e[4]=n,e[5]=i):i=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(G4,{}),e[6]=a):a=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs(K4,{children:[y.jsx(J4,{children:Amt}),y.jsx(tD,{children:Mmt})]}),e[7]=s):s=e[7],e[8]!==r?(l=r&&y.jsx(B1,{className:"text-sm text-destructive",slot:"errorMessage",children:r}),e[8]=r,e[9]=l):l=e[9],e[10]!==o||e[11]!==i||e[12]!==l?(c=y.jsxs(cGe,{className:i,...o,children:[a,s,l]}),e[10]=o,e[11]=i,e[12]=l,e[13]=c):c=e[13],c},jmt=t=>{const e=ue.c(14);let n,r,o,i,a,s,l,c;return e[0]!==t?({errorMessage:r,className:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==n?(i=cd(n,Nmt),e[4]=n,e[5]=i):i=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(G4,{}),e[6]=a):a=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsxs(K4,{children:[y.jsx(J4,{children:$mt}),y.jsx(tD,{children:Imt})]}),e[7]=s):s=e[7],e[8]!==r?(l=r&&y.jsx(B1,{slot:"errorMessage",className:"text-sm text-destructive",children:r}),e[8]=r,e[9]=l):l=e[9],e[10]!==o||e[11]!==i||e[12]!==l?(c=y.jsxs(uGe,{className:i,...o,children:[a,s,l]}),e[10]=o,e[11]=i,e[12]=l,e[13]=c):c=e[13],c};function Dmt(t){return we("w-fit",t)}function Amt(t){return y.jsx(eD,{children:t})}function Mmt(t){return y.jsx(nD,{date:t})}function Nmt(t){return we("w-fit",t)}function $mt(t){return y.jsx(eD,{children:t})}function Imt(t){return y.jsx(nD,{date:t})}let IDe,JU,eZ,tZ,nZ,QDe,rD;IDe=Po(["text-sm font-medium leading-none","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70","group-data-[invalid]:text-destructive"]),JU=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we(IDe(),n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(KYe,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},U6e=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("text-sm text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(B1,{className:o,...r,slot:"description"}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},eZ=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=we("text-sm font-medium text-destructive",n),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(tGe,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},tZ=Po("",{variants:{variant:{default:["relative flex w-full items-center overflow-hidden rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background",fj(),"data-[focus-within]:outline-none data-[focus-within]:ring-2 data-[focus-within]:ring-ring data-[focus-within]:ring-offset-2","data-[disabled]:opacity-50"],ghost:""}},defaultVariants:{variant:"default"}}),nZ=t=>{const e=ue.c(12);let n,r,o,i,a,s;return e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==o?(i=l=>we(tZ({variant:o}),l),e[4]=o,e[5]=i):i=e[5],e[6]!==n||e[7]!==i?(a=cd(n,i),e[6]=n,e[7]=i,e[8]=a):a=e[8],e[9]!==r||e[10]!==a?(s=y.jsx(Dye,{className:a,...r}),e[9]=r,e[10]=a,e[11]=s):s=e[11],s},QDe=t=>{const e=ue.c(8);let n,r,o,i;return e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),e[3]!==n?(o=cd(n,Qmt),e[3]=n,e[4]=o):o=e[4],e[5]!==r||e[6]!==o?(i=y.jsx(zye,{className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i},rD=t=>{const e=ue.c(12);let n,r,o,i,a,s;return e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==o?(i=l=>we(tZ({variant:o}),"text-sm",l),e[4]=o,e[5]=i):i=e[5],e[6]!==n||e[7]!==i?(a=cd(n,i),e[6]=n,e[7]=i,e[8]=a):a=e[8],e[9]!==r||e[10]!==a?(s=y.jsx(Qye,{className:a,...r,children:Lmt}),e[9]=r,e[10]=a,e[11]=s):s=e[11],s};function Qmt(t){return we("type-literal:px-0 inline rounded p-0.5 caret-transparent outline outline-0","data-[placeholder]:text-muted-foreground","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","data-[focused]:bg-accent data-[focused]:text-accent-foreground focus:bg-accent focus:text-accent-foreground","data-[invalid]:data-[focused]:bg-destructive data-[invalid]:data-[focused]:data-[placeholder]:text-destructive-foreground data-[invalid]:data-[focused]:text-destructive-foreground data-[invalid]:data-[placeholder]:text-destructive data-[invalid]:text-destructive",t)}function Lmt(t){return y.jsx(QDe,{segment:t})}const LDe=t=>{const e=ue.c(14);let n,r,o,i,a,s,l;return e[0]!==t?({className:n,popoverClassName:r,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]),e[4]!==r?(i=cd(r,Vmt),e[4]=r,e[5]=i):i=e[5],e[6]!==n?(a=we("flex w-full flex-col space-y-4 outline-none sm:flex-row sm:space-x-4 sm:space-y-0",n),e[6]=n,e[7]=a):a=e[7],e[8]!==o||e[9]!==a?(s=y.jsx(Iye,{className:a,...o}),e[8]=o,e[9]=a,e[10]=s):s=e[10],e[11]!==i||e[12]!==s?(l=y.jsx(Pmt,{className:i,children:s}),e[11]=i,e[12]=s,e[13]=l):l=e[13],l},zDe=t=>{const e=ue.c(26);let n,r,o,i,a;e[0]!==t?({label:i,description:r,errorMessage:o,className:n,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5]);const[s,l]=_.useState(!1);let c,u,d,f,h,g,v,b,p,O;return e[6]!==n?(c=cd(n,qmt),e[6]=n,e[7]=c):c=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(u=k=>{l(k)},e[8]=u):u=e[8],e[9]!==i?(d=i&&y.jsx(JU,{children:i}),e[9]=i,e[10]=d):d=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(rD,{"aria-label":"date input",className:"flex-1",variant:"ghost"}),e[11]=f):f=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(h=y.jsxs(nZ,{children:[f,y.jsx(hS,{onPressChange:()=>{l(!0)},className:we(fs({variant:"text",size:"icon"}),"ml-1 size-6 data-[focus-visible]:ring-offset-0"),children:y.jsx(aO,{"aria-hidden":!0,className:"size-4"})})]}),e[12]=h):h=e[12],e[13]!==r?(g=r&&y.jsx(B1,{className:"text-sm text-muted-foreground",slot:"description",children:r}),e[13]=r,e[14]=g):g=e[14],e[15]!==o?(v=y.jsx(eZ,{children:o}),e[15]=o,e[16]=v):v=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(b=y.jsx(G4,{}),e[17]=b):b=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(p=y.jsx(LDe,{children:y.jsxs(Rmt,{children:[b,y.jsxs(K4,{children:[y.jsx(J4,{children:Fmt}),y.jsx(tD,{children:Bmt})]})]})}),e[18]=p):p=e[18],e[19]!==s||e[20]!==a||e[21]!==c||e[22]!==d||e[23]!==g||e[24]!==v?(O=y.jsxs(Wye,{isOpen:s,className:c,onOpenChange:u,...a,children:[d,h,g,v,p]}),e[19]=s,e[20]=a,e[21]=c,e[22]=d,e[23]=g,e[24]=v,e[25]=O):O=e[25],O},zmt=t=>{const e=ue.c(28);let n,r,o,i,a;e[0]!==t?({label:i,description:r,errorMessage:o,className:n,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5]);const[s,l]=_.useState(!1);let c,u,d,f,h,g,v,b,p,O,k,S;return e[6]!==n?(c=cd(n,Wmt),e[6]=n,e[7]=c):c=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(u=w=>{l(w)},e[8]=u):u=e[8],e[9]!==i?(d=i&&y.jsx(JU,{children:i}),e[9]=i,e[10]=d):d=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(rD,{variant:"ghost",slot:"start"}),h=y.jsx("span",{"aria-hidden":!0,className:"px-2 text-sm text-muted-foreground",children:"-"}),g=y.jsx(rD,{className:"flex-1",variant:"ghost",slot:"end"}),e[11]=f,e[12]=h,e[13]=g):(f=e[11],h=e[12],g=e[13]),e[14]===Symbol.for("react.memo_cache_sentinel")?(v=y.jsxs(nZ,{children:[f,h,g,y.jsx(hS,{onPressChange:()=>{l(!0)},className:we(fs({variant:"text",size:"icon"}),"ml-1 size-6 data-[focus-visible]:ring-offset-0"),children:y.jsx(aO,{"aria-hidden":!0,className:"size-4"})})]}),e[14]=v):v=e[14],e[15]!==r?(b=r&&y.jsx(B1,{className:"text-sm text-muted-foreground",slot:"description",children:r}),e[15]=r,e[16]=b):b=e[16],e[17]!==o?(p=y.jsx(eZ,{children:o}),e[17]=o,e[18]=p):p=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(G4,{}),e[19]=O):O=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsx(LDe,{children:y.jsxs(jmt,{children:[O,y.jsxs(K4,{children:[y.jsx(J4,{children:Umt}),y.jsx(tD,{children:Zmt})]})]})}),e[20]=k):k=e[20],e[21]!==s||e[22]!==a||e[23]!==c||e[24]!==d||e[25]!==b||e[26]!==p?(S=y.jsxs(Uye,{isOpen:s,className:c,onOpenChange:u,...a,children:[d,v,b,p,k]}),e[21]=s,e[22]=a,e[23]=c,e[24]=d,e[25]=b,e[26]=p,e[27]=S):S=e[27],S};function Vmt(t){return we("w-auto p-3",t)}function qmt(t){return we("group flex flex-col gap-2",t)}function Fmt(t){return y.jsx(eD,{children:t})}function Bmt(t){return y.jsx(nD,{date:t})}function Wmt(t){return we("group flex flex-col gap-2",t)}function Umt(t){return y.jsx(eD,{children:t})}function Zmt(t){return y.jsx(nD,{date:t})}const Xmt=t=>{const e=ue.c(19);let n;e[0]!==t?(n=f=>{if(!f)return;const h=f.toString();t.setValue(h)},e[0]=t,e[1]=n):n=e[1];const r=n,o=t.label,i=t.fullWidth;let a;e[2]!==t.value?(a=r0(t.value),e[2]=t.value,e[3]=a):a=e[3];const s=t.label??"date picker";let l,c,u,d;return e[4]!==t.start?(l=r0(t.start),e[4]=t.start,e[5]=l):l=e[5],e[6]!==t.stop?(c=r0(t.stop),e[6]=t.stop,e[7]=c):c=e[7],e[8]!==r||e[9]!==t.disabled||e[10]!==a||e[11]!==s||e[12]!==l||e[13]!==c?(u=y.jsx(zDe,{granularity:"day",value:a,onChange:r,"aria-label":s,minValue:l,maxValue:c,isDisabled:t.disabled}),e[8]=r,e[9]=t.disabled,e[10]=a,e[11]=s,e[12]=l,e[13]=c,e[14]=u):u=e[14],e[15]!==t.fullWidth||e[16]!==t.label||e[17]!==u?(d=y.jsx(Jo,{label:o,fullWidth:i,children:u}),e[15]=t.fullWidth,e[16]=t.label,e[17]=u,e[18]=d):d=e[18],d},Hmt=t=>{const e=ue.c(24);let n;e[0]!==t?(n=g=>{if(!g)return;const{start:v,end:b}=g,p=[v.toString(),b.toString()];t.setValue(p)},e[0]=t,e[1]=n):n=e[1];const r=n,o=t.label,i=t.fullWidth;let a,s,l;e[2]!==t.value[0]?(a=r0(t.value[0]),e[2]=t.value[0],e[3]=a):a=e[3],e[4]!==t.value[1]?(s=r0(t.value[1]),e[4]=t.value[1],e[5]=s):s=e[5],e[6]!==a||e[7]!==s?(l={start:a,end:s},e[6]=a,e[7]=s,e[8]=l):l=e[8];const c=t.label??"date range picker";let u,d,f,h;return e[9]!==t.start?(u=r0(t.start),e[9]=t.start,e[10]=u):u=e[10],e[11]!==t.stop?(d=r0(t.stop),e[11]=t.stop,e[12]=d):d=e[12],e[13]!==r||e[14]!==t.disabled||e[15]!==l||e[16]!==c||e[17]!==u||e[18]!==d?(f=y.jsx(zmt,{granularity:"day",value:l,onChange:r,"aria-label":c,minValue:u,maxValue:d,isDisabled:t.disabled}),e[13]=r,e[14]=t.disabled,e[15]=l,e[16]=c,e[17]=u,e[18]=d,e[19]=f):f=e[19],e[20]!==t.fullWidth||e[21]!==t.label||e[22]!==f?(h=y.jsx(Jo,{label:o,fullWidth:i,children:f}),e[20]=t.fullWidth,e[21]=t.label,e[22]=f,e[23]=h):h=e[23],h},Ymt=t=>{const e=ue.c(19);let n;e[0]!==t?(n=h=>{if(!h)return;const g=h.toString();t.setValue(g)},e[0]=t,e[1]=n):n=e[1];const r=n;let o;e[2]!==t.value?(o=t.value?h7(t.value):void 0,e[2]=t.value,e[3]=o):o=e[3];const i=o,a=t.label,s=t.fullWidth,l=t.label??"date time picker";let c,u,d,f;return e[4]!==t.start?(c=h7(t.start),e[4]=t.start,e[5]=c):c=e[5],e[6]!==t.stop?(u=h7(t.stop),e[6]=t.stop,e[7]=u):u=e[7],e[8]!==r||e[9]!==i||e[10]!==t.disabled||e[11]!==l||e[12]!==c||e[13]!==u?(d=y.jsx(zDe,{granularity:"minute",value:i,onChange:r,"aria-label":l,minValue:c,maxValue:u,isDisabled:t.disabled}),e[8]=r,e[9]=i,e[10]=t.disabled,e[11]=l,e[12]=c,e[13]=u,e[14]=d):d=e[14],e[15]!==t.fullWidth||e[16]!==t.label||e[17]!==d?(f=y.jsx(Jo,{label:a,fullWidth:s,children:d}),e[15]=t.fullWidth,e[16]=t.label,e[17]=d,e[18]=f):f=e[18],f},Gmt=t=>{const e=ue.c(4),{elementIds:n,setValue:r,children:o}=t;let i,a;return e[0]!==n||e[1]!==r?(i=()=>{const s=l=>{const c=l.detail.element;if(c===null||!(c instanceof Node))return;const u=YB(c);if(u===null)return;const d=n[u];d!==void 0&&r(f=>{const h=f?{...f}:{};return h[d]=l.detail.value,h})};return document.addEventListener(Mp.TYPE,s),()=>{document.removeEventListener(Mp.TYPE,s)}},a=[n,r],e[0]=n,e[1]=r,e[2]=i,e[3]=a):(i=e[2],a=e[3]),_.useEffect(i,a),o},IC="__none__",Kmt=t=>{const e=ue.c(25),{options:n,value:r,setValue:o,label:i,allowSelectNone:a,fullWidth:s}=t,l=_.useId(),[c,u]=_.useState("");let d;e:{if(!c){d=n;break e}let T;if(e[0]!==n||e[1]!==c){let P;e[3]!==c?(P=j=>O4e(j,c)===1,e[3]=c,e[4]=P):P=e[4],T=n.filter(P),e[0]=n,e[1]=c,e[2]=T}else T=e[2];d=T}const f=d;let h;e[5]!==o?(h=T=>{T!=null&&o(T===IC?null:T)},e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==a||e[8]!==f?(v=()=>{const T=a?y.jsx(hc,{value:IC,children:"--"},IC):null;if(f.length>200)return y.jsx(d4e,{style:{height:"200px"},totalCount:f.length,overscan:50,itemContent:j=>{const D=f[j],N=y.jsx(hc,{value:D,children:D},D);return j===0?y.jsxs(y.Fragment,{children:[T,N]}):N}});const P=f.map(Jmt);return y.jsxs(y.Fragment,{children:[T,P]})},e[7]=a,e[8]=f,e[9]=v):v=e[9];const b=v;let p;e[10]!==s?(p=we("w-full",{"w-full":s}),e[10]=s,e[11]=p):p=e[11];const O=r??IC;let k,S,w;return e[12]!==b?(k=b(),e[12]=b,e[13]=k):k=e[13],e[14]!==g||e[15]!==c||e[16]!==p||e[17]!==O||e[18]!==k?(S=y.jsx(Jb,{displayValue:egt,placeholder:"Select...",multiple:!1,className:p,value:O,onValueChange:g,shouldFilter:!1,search:c,onSearchChange:u,"data-testid":"marimo-plugin-searchable-dropdown",children:k}),e[14]=g,e[15]=c,e[16]=p,e[17]=O,e[18]=k,e[19]=S):S=e[19],e[20]!==s||e[21]!==l||e[22]!==i||e[23]!==S?(w=y.jsx(Jo,{label:i,id:l,fullWidth:s,children:S}),e[20]=s,e[21]=l,e[22]=i,e[23]=S,e[24]=w):w=e[24],w};function Jmt(t){return y.jsx(hc,{value:t,children:t},t)}function egt(t){return t===IC?"--":t}const rZ="--",tgt=t=>{const e=ue.c(24),{label:n,options:r,value:o,setValue:i,allowSelectNone:a,fullWidth:s}=t,l=_.useId(),c=a?rZ:r[0],u=o.length===0?c:o[0];let d,f,h,g,v,b;if(e[0]!==i?(d=p=>{const O=p.target.value;i(O===rZ?[]:[O])},e[0]=i,e[1]=d):d=e[1],e[2]!==s?(f=we({"w-full":s}),e[2]=s,e[3]=f):f=e[3],e[4]!==a||e[5]!==o.length?(h=a?y.jsx("option",{value:rZ,selected:o.length===0,children:"--"}):null,e[4]=a,e[5]=o.length,e[6]=h):h=e[6],e[7]!==r||e[8]!==o){let p;e[10]!==o?(p=O=>y.jsx("option",{value:O,selected:o.includes(O),children:O},O),e[10]=o,e[11]=p):p=e[11],g=r.map(p),e[7]=r,e[8]=o,e[9]=g}else g=e[9];return e[12]!==l||e[13]!==u||e[14]!==d||e[15]!==f||e[16]!==h||e[17]!==g?(v=y.jsxs(ny,{"data-testid":"marimo-plugin-dropdown",onChange:d,className:f,value:u,id:l,children:[h,g]}),e[12]=l,e[13]=u,e[14]=d,e[15]=f,e[16]=h,e[17]=g,e[18]=v):v=e[18],e[19]!==s||e[20]!==l||e[21]!==n||e[22]!==v?(b=y.jsx(Jo,{label:n,id:l,fullWidth:s,children:v}),e[19]=s,e[20]=l,e[21]=n,e[22]=v,e[23]=b):b=e[23],b},ngt=ge.lazy(()=>Be(()=>import("./ConnectedDataExplorerComponent-D0dBaLjq.js"),__vite__mapDeps([134,101,102,103,104,105,106,107,108,109,110,111,112,100,113]),import.meta.url)),rgt=lu("marimo-data-explorer").withData(Qe({label:Pe().nullish(),data:Pe()})).renderer(t=>y.jsx(za,{children:y.jsx(ngt,{...t.data,value:t.value,setValue:t.setValue})})),oD=_.createContext(new Map),VDe=_.createContext(""),oZ=_.createContext(()=>Promise.resolve({values:[],too_many_values:!1}));var iZ="Radio",[ogt,qDe]=Wo(iZ),[igt,agt]=ogt(iZ),FDe=_.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,form:c,...u}=t,[d,f]=_.useState(null),h=ln(e,b=>f(b)),g=_.useRef(!1),v=!d||c||!!d.closest("form");return y.jsxs(igt,{scope:n,checked:o,disabled:a,children:[y.jsx(_t.button,{type:"button",role:"radio","aria-checked":o,"data-state":ZDe(o),"data-disabled":a?"":void 0,disabled:a,value:s,...u,ref:h,onClick:ut(t.onClick,b=>{o||(l==null||l()),v&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),v&&y.jsx(UDe,{control:d,bubbles:!g.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});FDe.displayName=iZ;var BDe="RadioIndicator",WDe=_.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...o}=t,i=agt(BDe,n);return y.jsx(Uo,{present:r||i.checked,children:y.jsx(_t.span,{"data-state":ZDe(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:e})})});WDe.displayName=BDe;var UDe=_.forwardRef(({__scopeRadio:t,control:e,checked:n,bubbles:r=!0,...o},i)=>{const a=_.useRef(null),s=ln(a,i),l=G1(n),c=Jw(e);return _.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&f){const h=new Event("click",{bubbles:r});f.call(u,n),u.dispatchEvent(h)}},[l,n,r]),y.jsx(_t.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function ZDe(t){return t?"checked":"unchecked"}UDe.displayName="RadioBubbleInput";var sgt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],iD="RadioGroup",[lgt,o1t]=Wo(iD,[X1,qDe]),XDe=X1(),HDe=qDe(),[cgt,ugt]=lgt(iD),YDe=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...f}=t,h=XDe(n),g=yf(c),[v,b]=Ao({prop:i,defaultProp:o??null,onChange:d,caller:iD});return y.jsx(cgt,{scope:n,name:r,required:a,disabled:s,value:v,onValueChange:b,children:y.jsx(c9,{asChild:!0,...h,orientation:l,dir:g,loop:u,children:y.jsx(_t.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:g,...f,ref:e})})})});YDe.displayName=iD;var GDe="RadioGroupItem",KDe=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...o}=t,i=ugt(GDe,n),a=i.disabled||r,s=XDe(n),l=HDe(n),c=_.useRef(null),u=ln(e,c),d=i.value===o.value,f=_.useRef(!1);return _.useEffect(()=>{const h=v=>{sgt.includes(v.key)&&(f.current=!0)},g=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",g)}},[]),y.jsx(u9,{asChild:!0,...s,focusable:!a,active:d,children:y.jsx(FDe,{disabled:a,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:ut(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:ut(o.onFocus,()=>{var h;f.current&&((h=c.current)==null||h.click())})})})});KDe.displayName=GDe;var JDe=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,o=HDe(n);return y.jsx(WDe,{...o,...r,ref:e})});JDe.displayName="RadioGroupIndicator";var eAe=YDe,tAe=KDe,dgt=JDe;const aZ=_.forwardRef((t,e)=>{const n=ue.c(9);let r,o,i,a;return n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]),n[3]!==r?(i=we("grid gap-2",r),n[3]=r,n[4]=i):i=n[4],n[5]!==o||n[6]!==e||n[7]!==i?(a=y.jsx(eAe,{className:i,...o,ref:e}),n[5]=o,n[6]=e,n[7]=i,n[8]=a):a=n[8],a});aZ.displayName=eAe.displayName;const sZ=_.forwardRef((t,e)=>{const n=ue.c(10);let r,o,i,a,s;if(n[0]!==t){const{className:l,children:c,...u}=t;r=l,o=u,n[0]=t,n[1]=r,n[2]=o}else r=n[1],o=n[2];return n[3]!==r?(i=we("h-[16px] w-[16px] transition-shadow data-[state=unchecked]:shadow-xsSolid rounded-full border border-input text-primary ring-offset-background focus:outline-none focus:shadow-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:shadow-none",r),n[3]=r,n[4]=i):i=n[4],n[5]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(dgt,{className:"flex items-center justify-center",children:y.jsx(BO,{className:"h-[10px] w-[10px] fill-primary text-current"})}),n[5]=a):a=n[5],n[6]!==o||n[7]!==e||n[8]!==i?(s=y.jsx(tAe,{ref:e,className:i,...o,children:a}),n[6]=o,n[7]=e,n[8]=i,n[9]=s):s=n[9],s});sZ.displayName=tAe.displayName,ug=_.forwardRef((t,e)=>{const n=ue.c(16);let r,o,i,a,s,l,c,u;return n[0]!==t?({className:o,bottomAdornment:r,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==o?(a=we("shadow-xsSolid hover:shadow-smSolid disabled:shadow-xsSolid focus-visible:shadow-mdSolid","flex w-full mb-1 rounded-sm border border-input bg-background px-3 py-2 text-sm font-code ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent disabled:cursor-not-allowed disabled:opacity-50 min-h-[1.5rem]",o),n[4]=o,n[5]=a):a=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(s=ai.stopPropagation(),n[6]=s):s=n[6],n[7]!==i||n[8]!==e||n[9]!==a?(l=y.jsx("textarea",{className:a,onClick:s,ref:e,...i}),n[7]=i,n[8]=e,n[9]=a,n[10]=l):l=n[10],n[11]!==r?(c=r&&y.jsx("div",{className:"absolute right-0 bottom-1 flex items-center pr-[6px] pointer-events-none text-muted-foreground h-6",children:r}),n[11]=r,n[12]=c):c=n[12],n[13]!==l||n[14]!==c?(u=y.jsxs("div",{className:"relative",children:[l,c]}),n[13]=l,n[14]=c,n[15]=u):u=n[15],u}),ug.displayName="Textarea";const nAe=_.forwardRef((t,e)=>{const n=ue.c(16);let r,o,i,a;n[0]!==t?({className:r,onValueChange:o,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==o||n[5]!==i.delay||n[6]!==i.value?(a={initialValue:i.value,delay:i.delay,onChange:o},n[4]=o,n[5]=i.delay,n[6]=i.value,n[7]=a):a=n[7];const{value:s,onChange:l}=xS(a);let c,u;return n[8]!==l?(c=d=>l(d.target.value),n[8]=l,n[9]=c):c=n[9],n[10]!==r||n[11]!==i||n[12]!==e||n[13]!==c||n[14]!==s?(u=y.jsx(ug,{ref:e,className:r,...i,onChange:c,value:s}),n[10]=r,n[11]=i,n[12]=e,n[13]=c,n[14]=s,n[15]=u):u=n[15],u});nAe.displayName="DebouncedTextarea";const rAe=_.forwardRef((t,e)=>{const n=ue.c(23);let r,o,i;n[0]!==t?({className:r,onValueChange:o,...i}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const[a,s]=_.useState(i.value);let l;n[4]!==a||n[5]!==o||n[6]!==i.value?(l={prop:i.value,defaultProp:a,onChange:o},n[4]=a,n[5]=o,n[6]=i.value,n[7]=l):l=n[7];const[c,u]=Ao(l);let d,f,h,g,v,b;return n[8]!==c?(d=()=>{s(c||"")},f=[c],n[8]=c,n[9]=d,n[10]=f):(d=n[9],f=n[10]),_.useEffect(d,f),n[11]===Symbol.for("react.memo_cache_sentinel")?(h=p=>s(p.target.value),n[11]=h):h=n[11],n[12]!==a||n[13]!==u?(g=()=>u(a),v=p=>{p.ctrlKey&&p.key==="Enter"&&(p.preventDefault(),u(a))},n[12]=a,n[13]=u,n[14]=g,n[15]=v):(g=n[14],v=n[15]),n[16]!==r||n[17]!==a||n[18]!==i||n[19]!==e||n[20]!==g||n[21]!==v?(b=y.jsx(ug,{ref:e,className:r,...i,value:a,onChange:h,onBlur:g,onKeyDown:v}),n[16]=r,n[17]=a,n[18]=i,n[19]=e,n[20]=g,n[21]=v,n[22]=b):b=n[22],b});py=function(t){const e=n=>n instanceof Of?n._def.value:n instanceof Ey?n._def.defaultValue():n instanceof wf?py(n._def.schema):"innerType"in n._def?e(n._def.innerType):void 0;return t instanceof Sg||t instanceof Py?e(t._def.options[0]):t instanceof Fa?t._def.minLength&&t._def.minLength.value>0?[py(t._def.type)]:[]:t instanceof jl?"":t instanceof Iu?t._def.values[0]:t instanceof Ro?Object.fromEntries(Object.entries(t.shape).map(([n,r])=>[n,e(r)])):e(t)};function ix(t){if(t instanceof Of)return t;if(t instanceof Ro){const e=t._def.shape().type;if(e instanceof Of)return e;throw new Error(`Invalid schema: ${t._type}`)}if(t instanceof Sg||t instanceof Py)return ix(t._def.options[0]);throw Ve.warn(t),new Error(`Invalid schema: ${t._type}`)}rAe.displayName="OnBlurredTextarea";const oAe=t=>{const e=ue.c(24),{value:n,options:r,onChange:o,className:i,placeholder:a,textAreaClassName:s,comboBoxClassName:l}=t,[c,u]=_.useState(!1);let d;e[0]!==n?(d=QC(n),e[0]=n,e[1]=d):d=e[1];const f=d;let h;e[2]!==l||e[3]!==o||e[4]!==r||e[5]!==a||e[6]!==c||e[7]!==s||e[8]!==f?(h=()=>c?y.jsx(lZ,{value:f,className:s,onChange:o,placeholder:a?`${a}: one per line`:"One value per line"}):y.jsx(Jb,{placeholder:a,displayValue:fgt,className:we("w-full max-w-[400px]",l),multiple:!0,value:f,onValueChange:o,keepPopoverOpenOnSelect:!0,chips:!0,chipsClassName:"flex-row flex-wrap min-w-[210px]",children:r.map(hgt)}),e[2]=l,e[3]=o,e[4]=r,e[5]=a,e[6]=c,e[7]=s,e[8]=f,e[9]=h):h=e[9];const g=h;let v,b;e[10]!==i?(v=we("flex gap-1",i),e[10]=i,e[11]=v):v=e[11],e[12]!==g?(b=g(),e[12]=g,e[13]=b):b=e[13];const p=c?"Switch to multi-select":"Switch to textarea";let O,k,S,w;return e[14]===Symbol.for("react.memo_cache_sentinel")?(O=y.jsx(xG,{className:"w-3 h-3"}),e[14]=O):O=e[14],e[15]!==c?(k=y.jsx(DO,{size:"xs",onPressedChange:u,pressed:c,children:O}),e[15]=c,e[16]=k):k=e[16],e[17]!==p||e[18]!==k?(S=y.jsx(qn,{content:p,children:k}),e[17]=p,e[18]=k,e[19]=S):S=e[19],e[20]!==v||e[21]!==b||e[22]!==S?(w=y.jsxs("div",{className:v,children:[b,S]}),e[20]=v,e[21]=b,e[22]=S,e[23]=w):w=e[23],w},lZ=t=>{const e=ue.c(11),{className:n,value:r,onChange:o,placeholder:i}=t;let a,s,l;if(e[0]!==r){const d=QC(r);a=ug,s=d.join(`
|
476
476
|
`),e[0]=r,e[1]=a,e[2]=s}else a=e[1],s=e[2];e[3]!==o?(l=d=>{d.target.value!==""?o(d.target.value.split(`
|
477
477
|
`)):o([])},e[3]=o,e[4]=l):l=e[4];const c=i?`${i}: one per line`:"One value per line";let u;return e[5]!==a||e[6]!==n||e[7]!==s||e[8]!==l||e[9]!==c?(u=y.jsx(a,{value:s,className:n,rows:4,onChange:l,placeholder:c}),e[5]=a,e[6]=n,e[7]=s,e[8]=l,e[9]=c,e[10]=u):u=e[10],u};function QC(t){return t==null?[]:Array.isArray(t)?t:[t].filter(e=>e!=null||e!=="")}function fgt(t){return t}function hgt(t){return y.jsx(hc,{value:t,children:t},t)}kK=({schema:t,form:e,path:n="",renderers:r=[],children:o})=>y.jsxs(bje,{...e,children:[o,Ld(t,e,n,r)]});function Ld(t,e,n,r){var l;for(const c of r){const{isMatch:u,Component:d}=c;if(u(t))return y.jsx(d,{schema:t,form:e,path:n})}const{label:o,description:i,special:a,direction:s="column"}=gn.parse(t._def.description||"");if(t instanceof Ey){let c=t._def.innerType;return c=!c.description&&t.description?c.describe(t.description):c,Ld(c,e,n,r)}if(t instanceof Qu){let c=t._def.innerType;return c=!c.description&&t.description?c.describe(t.description):c,Ld(c,e,n,r)}if(t instanceof Ro)return y.jsxs("div",{className:we("flex",s==="row"?"flex-row gap-6 items-start":s==="two-columns"?"grid grid-cols-2 gap-y-6":"flex-col gap-6"),children:[y.jsx(dr,{children:o}),cr.entries(t._def.shape()).map(([c,u])=>{const d=u instanceof Of,f=Ld(u,e,function(...h){return h.filter(g=>g!=="").join(".")}(n,c),r);return d?y.jsx(ge.Fragment,{children:f},c):y.jsx("div",{className:"flex flex-row align-start",children:f},c)})]});if(t instanceof jl)return a==="time"?y.jsx(rr,{control:e.control,name:n,render:({field:c})=>y.jsxs(jr,{children:[y.jsx(dr,{children:o}),y.jsx(Xi,{children:i}),y.jsx(Ir,{children:y.jsx(d0,{...c,onValueChange:c.onChange,type:"time",className:"my-0"})}),y.jsx(Di,{})]})}):y.jsx(iAe,{schema:t,form:e,path:n});if(t instanceof nw)return y.jsx(rr,{control:e.control,name:n,render:({field:c})=>y.jsxs(jr,{children:[y.jsxs("div",{className:"flex flex-row items-start space-x-2",children:[y.jsx(dr,{children:o}),y.jsx(Xi,{children:i}),y.jsx(Ir,{children:y.jsx(Tl,{"data-testid":"marimo-plugin-data-frames-boolean-checkbox",checked:c.value,onCheckedChange:c.onChange})})]}),y.jsx(Di,{})]})});if(t instanceof rp)return a==="random_number_button"?y.jsx(rr,{control:e.control,name:n,render:({field:c})=>y.jsxs(Ft,{size:"xs","data-testid":"marimo-plugin-data-frames-random-number-button",variant:"secondary",onClick:()=>{c.onChange(HU())},children:[y.jsx(nY,{className:"w-3.5 h-3.5 mr-1"}),o]})}):y.jsx(rr,{control:e.control,name:n,render:({field:c})=>y.jsxs(jr,{children:[y.jsx(dr,{children:o}),y.jsx(Xi,{children:i}),y.jsx(Ir,{children:y.jsx(i9,{...c,className:"my-0",onValueChange:c.onChange})}),y.jsx(Di,{})]})});if(t instanceof kg){const c=a==="datetime"?"datetime-local":a==="time"?"time":"date";return y.jsx(rr,{control:e.control,name:n,render:({field:u})=>y.jsxs(jr,{children:[y.jsx(dr,{children:o}),y.jsx(Xi,{children:i}),y.jsx(Ir,{children:y.jsx(d0,{...u,onValueChange:u.onChange,type:c,className:"my-0"})}),y.jsx(Di,{})]})})}if(t instanceof rw)return y.jsx(iAe,{schema:t,form:e,path:n});if(t instanceof Iu)return y.jsx(ggt,{schema:t,form:e,path:n,options:t._def.values});if(t instanceof Fa){if(a==="text_area_multiline")return y.jsx(mgt,{schema:t,form:e,path:n});const c=t._def.type;if(c instanceof Iu){const u=c._def.values;return y.jsx(vgt,{schema:t,form:e,path:n,itemLabel:o,options:u})}return y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx(nf,{children:o}),y.jsx(pgt,{schema:t._def.type,form:e,path:n,minLength:(l=t._def.minLength)==null?void 0:l.value,renderers:r},n)]})}if(t instanceof Py){const c=t._def.options,u=t._def.discriminator,d=t._def.optionsMap;return y.jsx(rr,{control:e.control,name:n,render:({field:f})=>{const h=f.value,g=c.map(p=>ix(p)._def.value),v=h&&typeof h=="object"&&u in h?h[u]:g[0],b=d.get(v)||c[0];return y.jsxs("div",{className:"flex flex-col",children:[y.jsx(dr,{children:o}),y.jsx("div",{className:"flex border-b mb-4 -mt-2",children:g.map(p=>y.jsx("button",{type:"button",className:"px-4 py-2 "+(v===p?"border-b-2 border-primary font-medium":"text-muted-foreground"),onClick:()=>{const O=d.get(p);O?f.onChange(py(O)):f.onChange({[u]:p})},children:p},p))}),y.jsx("div",{className:"flex flex-col",children:b&&Ld(b,e,n,r)},v)]})}})}return t instanceof Sg?y.jsx(rr,{control:e.control,name:n,render:({field:c})=>{const u=t._def.options;let d=c.value;const f=u.map(g=>ix(g)._def.value);d||(d=f[0]);const h=u.find(g=>ix(g)._def.value===d);return y.jsxs("div",{className:"flex flex-col mb-4 gap-1",children:[y.jsx(dr,{children:o}),y.jsx(ny,{"data-testid":"marimo-plugin-data-frames-union-select",...c,children:f.map(g=>y.jsx("option",{value:g,children:g},g))}),h&&Ld(h,e,n,r)]})}}):t instanceof Of?y.jsx(rr,{control:e.control,name:n,render:({field:c})=>y.jsx("input",{...c,type:"hidden",value:t._def.value})}):t instanceof wf&&["refinement","transform"].includes(t._def.effect.type)?Ld(t._def.schema,e,n,r):y.jsxs("div",{children:["Unknown schema type"," ",t==null?n:JSON.stringify(t._type??t)]})}const pgt=t=>{const e=ue.c(39),{schema:n,form:r,path:o,minLength:i,renderers:a}=t;let s;e[0]!==n._def.description?(s=gn.parse(n._def.description||""),e[0]=n._def.description,e[1]=s):s=e[1];const{label:l,description:c}=s,u=r.control;let d;e[2]!==u||e[3]!==o?(d={control:u,name:o},e[2]=u,e[3]=o,e[4]=d):d=e[4];const{fields:f,append:h,remove:g}=Aje(d),v=i!=null&&f.length<i,b=i==null||f.length>i;let p,O,k,S,w,T,P,j;if(e[5]!==l?(p=y.jsx(dr,{children:l}),e[5]=l,e[6]=p):p=e[6],e[7]!==c?(O=y.jsx(Xi,{children:c}),e[7]=c,e[8]=O):O=e[8],e[9]!==b||e[10]!==f||e[11]!==r||e[12]!==o||e[13]!==g||e[14]!==a||e[15]!==n){let D;e[17]!==b||e[18]!==r||e[19]!==o||e[20]!==g||e[21]!==a||e[22]!==n?(D=(N,E)=>y.jsxs("div",{className:"flex flex-row pl-2 ml-2 border-l-2 border-disabled hover-actions-parent relative pr-5 pt-1 items-center w-fit",onKeyDown:ai.onEnter(ygt),children:[Ld(n,r,`${o}[${E}]`,a),b&&y.jsx(jO,{className:"w-4 h-4 ml-2 my-1 text-muted-foreground hover:text-destructive cursor-pointer absolute right-0 top-5",onClick:()=>{g(E)}})]},N.id),e[17]=b,e[18]=r,e[19]=o,e[20]=g,e[21]=a,e[22]=n,e[23]=D):D=e[23],k=f.map(D),e[9]=b,e[10]=f,e[11]=r,e[12]=o,e[13]=g,e[14]=a,e[15]=n,e[16]=k}else k=e[16];return e[24]!==v||e[25]!==i?(S=v&&y.jsx("div",{className:"text-destructive text-xs font-semibold",children:y.jsxs("div",{children:["At least ",i," required."]})}),e[24]=v,e[25]=i,e[26]=S):S=e[26],e[27]!==h||e[28]!==n?(w=()=>{h(py(n))},e[27]=h,e[28]=n,e[29]=w):w=e[29],e[30]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx(OO,{className:"w-3.5 h-3.5 mr-1"}),e[30]=T):T=e[30],e[31]!==w?(P=y.jsx("div",{children:y.jsxs(Ft,{size:"xs","data-testid":"marimo-plugin-data-frames-add-array-item",variant:"text",className:"hover:text-accent-foreground",onClick:w,children:[T,"Add"]})}),e[31]=w,e[32]=P):P=e[32],e[33]!==p||e[34]!==O||e[35]!==k||e[36]!==S||e[37]!==P?(j=y.jsxs("div",{className:"flex flex-col gap-2 min-w-[220px]",children:[p,O,k,S,P]}),e[33]=p,e[34]=O,e[35]=k,e[36]=S,e[37]=P,e[38]=j):j=e[38],j},iAe=t=>{const e=ue.c(21),{schema:n,form:r,path:o}=t;let i;e[0]!==n._def.description?(i=gn.parse(n._def.description),e[0]=n._def.description,e[1]=i):i=e[1];const{label:a,description:s,placeholder:l,disabled:c,inputType:u}=i;if(u==="textarea"){let h,g;return e[2]!==s||e[3]!==c||e[4]!==a||e[5]!==l?(h=v=>{const{field:b}=v;return y.jsxs(jr,{children:[y.jsx(dr,{children:a}),y.jsx(Xi,{children:s}),y.jsx(Ir,{children:y.jsx(ug,{...b,value:b.value,onChange:b.onChange,className:"my-0",placeholder:l,disabled:c})}),y.jsx(Di,{})]})},e[2]=s,e[3]=c,e[4]=a,e[5]=l,e[6]=h):h=e[6],e[7]!==r.control||e[8]!==o||e[9]!==h?(g=y.jsx(rr,{control:r.control,name:o,render:h}),e[7]=r.control,e[8]=o,e[9]=h,e[10]=g):g=e[10],g}let d,f;return e[11]!==s||e[12]!==c||e[13]!==u||e[14]!==a||e[15]!==l?(d=h=>{const{field:g}=h;return y.jsxs(jr,{children:[y.jsx(dr,{children:a}),y.jsx(Xi,{children:s}),y.jsx(Ir,{children:y.jsx(d0,{...g,type:u,value:g.value,onValueChange:g.onChange,className:"my-0",placeholder:l,disabled:c})}),y.jsx(Di,{})]})},e[11]=s,e[12]=c,e[13]=u,e[14]=a,e[15]=l,e[16]=d):d=e[16],e[17]!==r.control||e[18]!==o||e[19]!==d?(f=y.jsx(rr,{control:r.control,name:o,render:d}),e[17]=r.control,e[18]=o,e[19]=d,e[20]=f):f=e[20],f},mgt=t=>{const e=ue.c(10),{schema:n,form:r,path:o}=t;let i;e[0]!==n._def.description?(i=gn.parse(n._def.description),e[0]=n._def.description,e[1]=i):i=e[1];const{label:a,description:s,placeholder:l}=i;let c,u;return e[2]!==s||e[3]!==a||e[4]!==l?(c=d=>{const{field:f}=d;return y.jsxs(jr,{children:[y.jsx(dr,{children:a}),y.jsx(Xi,{children:s}),y.jsx(Ir,{children:y.jsx(lZ,{...f,placeholder:l})}),y.jsx(Di,{})]})},e[2]=s,e[3]=a,e[4]=l,e[5]=c):c=e[5],e[6]!==r.control||e[7]!==o||e[8]!==c?(u=y.jsx(rr,{control:r.control,name:o,render:c}),e[6]=r.control,e[7]=o,e[8]=c,e[9]=u):u=e[9],u},ggt=t=>{const e=ue.c(22),{schema:n,form:r,path:o,options:i,textTransform:a}=t;let s;e[0]!==n._def.description?(s=gn.parse(n._def.description),e[0]=n._def.description,e[1]=s):s=e[1];const{label:l,description:c,disabled:u,special:d}=s;if(d==="radio_group"){let g,v;return e[2]!==c||e[3]!==l||e[4]!==i||e[5]!==o?(g=b=>{const{field:p}=b;return y.jsxs(jr,{children:[y.jsx(dr,{children:l}),y.jsx(Xi,{children:c}),y.jsx(Ir,{children:y.jsx(aZ,{className:"flex flex-row gap-2 pt-1 items-center",value:p.value,onValueChange:p.onChange,children:i.map(O=>y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(sZ,{value:O,id:`${o}-${O}`},O),y.jsx(dr,{className:"whitespace-pre",htmlFor:`${o}-${O}`,children:Jf.startCase(O)})]},O))})}),y.jsx(Di,{})]})},e[2]=c,e[3]=l,e[4]=i,e[5]=o,e[6]=g):g=e[6],e[7]!==u||e[8]!==r.control||e[9]!==o||e[10]!==g?(v=y.jsx(rr,{control:r.control,name:o,disabled:u,render:g}),e[7]=u,e[8]=r.control,e[9]=o,e[10]=g,e[11]=v):v=e[11],v}let f,h;return e[12]!==c||e[13]!==l||e[14]!==i||e[15]!==a?(f=g=>{const{field:v}=g;return y.jsxs(jr,{children:[y.jsx(dr,{className:"whitespace-pre",children:l}),y.jsx(Xi,{children:c}),y.jsx(Ir,{children:y.jsxs(Zs,{"data-testid":"marimo-plugin-data-frames-select",value:v.value,onValueChange:v.onChange,children:[y.jsx(Ws,{className:"min-w-[180px]",children:y.jsx(Us,{placeholder:"--"})}),y.jsx(cs,{children:y.jsxs(Cu,{children:[i.map(b=>y.jsx(Qo,{value:b,children:(a==null?void 0:a(b))??b},b)),i.length===0&&y.jsx(Qo,{disabled:!0,value:"--",children:"No options"})]})})]})}),y.jsx(Di,{})]})},e[12]=c,e[13]=l,e[14]=i,e[15]=a,e[16]=f):f=e[16],e[17]!==u||e[18]!==r.control||e[19]!==o||e[20]!==f?(h=y.jsx(rr,{control:r.control,name:o,disabled:u,render:f}),e[17]=u,e[18]=r.control,e[19]=o,e[20]=f,e[21]=h):h=e[21],h},vgt=t=>{const e=ue.c(15),{schema:n,form:r,path:o,options:i,itemLabel:a,showSwitchable:s}=t;let l;e[0]!==n._def.description?(l=gn.parse(n._def.description),e[0]=n._def.description,e[1]=l):l=e[1];const{label:c,description:u,placeholder:d}=l;let f;e[2]!==a||e[3]!==d?(f=d??(a?`Select ${a==null?void 0:a.toLowerCase()}`:void 0),e[2]=a,e[3]=d,e[4]=f):f=e[4];const h=f;let g,v;return e[5]!==u||e[6]!==c||e[7]!==i||e[8]!==h||e[9]!==s?(g=b=>{const{field:p}=b,O=QC(p.value);return y.jsxs(jr,{children:[y.jsx(dr,{className:"whitespace-pre",children:c}),y.jsx(Xi,{children:u}),y.jsx(Ir,{children:s?y.jsx(oAe,{...p,value:O,options:i,placeholder:h}):y.jsx(Jb,{className:"min-w-[180px]",placeholder:h,displayValue:bgt,multiple:!0,chips:!0,keepPopoverOpenOnSelect:!0,value:O,onValueChange:p.onChange,children:i.map(xgt)})}),y.jsx(Di,{})]})},e[5]=u,e[6]=c,e[7]=i,e[8]=h,e[9]=s,e[10]=g):g=e[10],e[11]!==r.control||e[12]!==o||e[13]!==g?(v=y.jsx(rr,{control:r.control,name:o,render:g}),e[11]=r.control,e[12]=o,e[13]=g,e[14]=v):v=e[14],v};function ygt(t){return t.preventDefault()}function bgt(t){return Jf.startCase(t)}function xgt(t){return y.jsx(hc,{value:t,children:t},t)}const aAe=t=>{const e=ue.c(4),{type:n}=t;let r;e[0]!==n?(r=()=>n.startsWith("int")||n.startsWith("float")||n.startsWith("uint")||n.startsWith("number")||n.startsWith("complex")?y.jsx(fce,{size:14}):n.startsWith("object")||n.startsWith("string")?y.jsx(MK,{size:14}):n.startsWith("date")||n.startsWith("time")?y.jsx(aO,{size:14}):n.startsWith("bool")?y.jsx(dM,{size:14}):y.jsx(WO,{size:14}),e[0]=n,e[1]=r):r=e[1];const o=r;let i;return e[2]!==o?(i=y.jsx("div",{className:"border p-[1px] border-border bg-[var(--slate-2)] flex items-center justify-center rounded",children:o()}),e[2]=o,e[3]=i):i=e[3],i},sAe=()=>({isMatch:t=>{const{special:e}=gn.parse(t._def.description||"");return e==="column_id"},Component:({schema:t,form:e,path:n})=>{const r=ge.use(oD),{label:o,description:i}=gn.parse(t._def.description);return y.jsx(rr,{control:e.control,name:n,render:({field:a})=>y.jsxs(jr,{children:[y.jsx(dr,{children:o}),y.jsx(Xi,{children:i}),y.jsx(Ir,{children:y.jsxs(Zs,{"data-testid":"marimo-plugin-data-frames-column-select",value:a.value==null?a.value:JSON.stringify(a.value),onValueChange:s=>{const l=JSON.parse(s);a.onChange(l)},children:[y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(Ws,{className:"min-w-[180px]",children:y.jsx(Us,{placeholder:"--"})}),y.jsx(wgt,{})]}),y.jsx(cs,{children:y.jsxs(Cu,{children:[[...r.entries()].map(([s,l])=>y.jsx(Qo,{value:JSON.stringify(s),children:y.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[y.jsx(aAe,{type:l}),y.jsx("span",{className:"flex-1",children:s}),y.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",l,")"]})]})},s)),r.size===0&&y.jsx(Qo,{disabled:!0,value:"--",children:"No columns"})]})})]})})]})})}}),Ogt=t=>{const e=ue.c(11),{schema:n,form:r,path:o,itemLabel:i}=t,a=ge.use(oD);let s;e[0]!==n._def.description?(s=gn.parse(n._def.description),e[0]=n._def.description,e[1]=s):s=e[1];const{description:l}=s,c=i?`Select ${i.toLowerCase()}`:void 0;let u,d;return e[2]!==a||e[3]!==l||e[4]!==i||e[5]!==c?(u=f=>{const{field:h}=f,g=QC(h.value);return y.jsxs(jr,{children:[y.jsx(dr,{children:i}),y.jsx(Xi,{children:l}),y.jsx(Ir,{children:y.jsx(Jb,{className:"min-w-[180px]",placeholder:c,displayValue:String,multiple:!0,chips:!0,keepPopoverOpenOnSelect:!0,value:g,onValueChange:v=>{h.onChange(v)},children:[...a.entries()].map(Cgt)})}),y.jsx(Di,{})]})},e[2]=a,e[3]=l,e[4]=i,e[5]=c,e[6]=u):u=e[6],e[7]!==r.control||e[8]!==o||e[9]!==u?(d=y.jsx(rr,{control:r.control,name:o,render:u}),e[7]=r.control,e[8]=o,e[9]=u,e[10]=d):d=e[10],d},wgt=t=>{const e=ue.c(4),{className:n}=t;let r,o;return e[0]!==n?(r=we("text-destructive text-xs w-[16px]",n),e[0]=n,e[1]=r):r=e[1],e[2]!==r?(o=y.jsx(Bje,{className:r}),e[2]=r,e[3]=o):o=e[3],o},kgt=t=>{var O;const e=ue.c(25),{path:n,form:r,schema:o}=t;let i;e[0]!==o._def.description?(i=gn.parse(o._def.description),e[0]=o._def.description,e[1]=i):i=e[1];const{description:a}=i,s=ge.use(oD),l=(O=cr.entries(o._def.shape()).find(_gt))==null?void 0:O[1];let c;e[2]!==n?(c={name:n},e[2]=n,e[3]=c):c=e[3];const{column_id:u,operator:d}=cu(c),f=sAe(),h=[Ld(l,r,`${n}.column_id`,[f])];let g,v;if(e[4]!==u||e[5]!==s||e[6]!==r||e[7]!==n?(g=()=>{const k=MDe(s.get(u)),S=r.getValues(`${n}.operator`);k.includes(S)||(r.setValue(`${n}.operator`,k[0]),r.setValue(`${n}.value`,void 0))},v=[u,s,r,n],e[4]=u,e[5]=s,e[6]=r,e[7]=n,e[8]=g,e[9]=v):(g=e[8],v=e[9]),_.useEffect(g,v),u!=null){let k;e[10]!==u||e[11]!==s?(k=MDe(s.get(u)),e[10]=u,e[11]=s,e[12]=k):k=e[12];const S=k;if(S.length===0){let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsxs("div",{className:"text-muted-foreground text-xs font-semibold",children:[y.jsx(dr,{className:"whitespace-pre",children:" "}),y.jsx("p",{children:"This column type does not support filtering."})]},"no_operator"),e[13]=w):w=e[13],h.push(w)}else{const w=`${n}.operator`;let T,P;e[14]!==a||e[15]!==S?(T=j=>{const{field:D}=j;return y.jsxs(jr,{children:[y.jsx(dr,{className:"whitespace-pre",children:" "}),y.jsx(Xi,{children:a}),y.jsx(Ir,{children:y.jsxs(Zs,{"data-testid":"marimo-plugin-data-frames-filter-operator-select",value:D.value,onValueChange:D.onChange,children:[y.jsx(Ws,{className:"min-w-[140px]",children:y.jsx(Us,{placeholder:"--"})}),y.jsx(cs,{children:y.jsx(Cu,{children:S.map(Tgt)})})]})}),y.jsx(Di,{})]})},e[14]=a,e[15]=S,e[16]=T):T=e[16],e[17]!==r.control||e[18]!==w||e[19]!==T?(P=y.jsx(rr,{control:r.control,name:w,render:T},"operator"),e[17]=r.control,e[18]=w,e[19]=T,e[20]=P):P=e[20],h.push(P)}}if(d!=null){const k=function(S,w){if(!S||!w)return[];switch(ADe(S)){case"integer":case"number":return mc(W4,w);case"string":return mc(H4,w);case"date":return mc(U4,w);case"datetime":return mc(X4,w);case"time":return mc(Z4,w);case"boolean":return mc(F4,w);case"unknown":return[]}}(s.get(u),d);k.length===1&&h.push(y.jsx(ge.Fragment,{children:Ld(k[0],r,`${n}.value`,[])},"value"))}const b=()=>y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx("div",{className:we("flex flex-row gap-2"),children:h}),y.jsx(Di,{})]});let p;return e[21]!==r.control||e[22]!==n||e[23]!==b?(p=y.jsx(rr,{control:r.control,name:n,render:b}),e[21]=r.control,e[22]=n,e[23]=b,e[24]=p):p=e[24],p},Sgt=[sAe(),{isMatch:t=>{if(t instanceof Fa){const e=t._def.type,{special:n}=gn.parse(e._def.description||"");return n==="column_id"}return!1},Component:({schema:t,form:e,path:n})=>{const{label:r}=gn.parse(t._def.description);return y.jsx(Ogt,{schema:t,form:e,path:n,itemLabel:r})}},{isMatch:t=>{if(t instanceof Fa){const{special:e}=gn.parse(t._def.description||"");return e==="column_values"}return!1},Component:({schema:t,form:e,path:n})=>{const{label:r,description:o,placeholder:i}=gn.parse(t._def.description),a=ge.use(VDe),s=ge.use(oZ),{data:l,isPending:c}=$a(()=>s({column:a}),[a]),u=(l==null?void 0:l.values)||[];if(u.length===0&&!c)return y.jsx(rr,{control:e.control,name:n,render:({field:f})=>y.jsxs(jr,{children:[y.jsx(dr,{children:r}),y.jsx(Xi,{children:o}),y.jsx(Ir,{children:y.jsx(d0,{...f,value:f.value,onValueChange:f.onChange,className:"my-0",placeholder:i})}),y.jsx(Di,{})]})});const d=u.map(String);return y.jsx(rr,{control:e.control,name:n,render:({field:f})=>y.jsxs(jr,{children:[y.jsx(dr,{className:"whitespace-pre",children:r}),y.jsx(Xi,{children:o}),y.jsx(Ir,{children:y.jsx(Jb,{className:"min-w-[180px]",placeholder:i,multiple:!1,displayValue:h=>h,value:Array.isArray(f.value)?f.value[0]:f.value,onValueChange:f.onChange,children:d.map(h=>y.jsx(hc,{value:h,children:h},h))})}),y.jsx(Di,{})]})})}},{isMatch:t=>{const{special:e}=gn.parse(t._def.description||"");return e==="column_values"&&t instanceof Fa},Component:({schema:t,form:e,path:n})=>{const r=ge.use(VDe),o=ge.use(oZ),{data:i,isPending:a}=$a(()=>o({column:r}),[r]),s=(i==null?void 0:i.values)||[];if(s.length===0&&!a)return y.jsx(rr,{control:e.control,name:n,render:({field:c})=>y.jsxs(jr,{children:[y.jsx(dr,{children:t.description}),y.jsx(Ir,{children:y.jsx(lZ,{...c})}),y.jsx(Di,{})]})});const l=s.map(String);return y.jsx(rr,{control:e.control,name:n,render:({field:c})=>{const u=QC(c.value);return y.jsxs(jr,{children:[y.jsx(dr,{children:t.description}),y.jsx(Ir,{children:y.jsx(oAe,{...c,value:u,options:l})}),y.jsx(Di,{})]})}})}},{isMatch:t=>{if(t instanceof Ro){const{special:e}=gn.parse(t._def.description||"");return e==="column_filter"}return!1},Component:({schema:t,form:e,path:n})=>y.jsx(kgt,{schema:t,form:e,path:n})}];function Cgt(t){const[e,n]=t;return y.jsx(hc,{value:e,children:y.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[y.jsx(aAe,{type:n}),y.jsx("span",{className:"flex-1",children:e}),y.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",n,")"]})]})},e)}function _gt(t){const[e]=t;return e==="column_id"}function Tgt(t){return y.jsx(Qo,{value:t,children:Jf.startCase(t)},t)}function Pgt(t,e){switch(t.type){case"column_conversion":return t.column_id&&e.set(t.column_id,t.data_type),e;case"rename_column":{if(!t.new_column_id)return e;const n=e.get(t.column_id);return n&&(e.set(t.new_column_id,n),e.delete(t.column_id)),e}case"group_by":return Vv.filterMap(e,(n,r)=>!t.column_ids.includes(r));case"aggregate":case"select_columns":return Vv.filterMap(e,(n,r)=>t.column_ids.includes(r));case"filter_rows":case"shuffle_rows":case"sample_rows":case"sort_column":case"expand_dict":case"explode_columns":case"unique":return e;default:return us(t),e}}const Egt=({initialValue:t,columns:e,onChange:n,onInvalidChange:r,getColumnValues:o})=>{var k;const i=kM({resolver:wM(bmt),defaultValues:t,mode:"onChange",reValidateMode:"onChange"}),{handleSubmit:a,watch:s,control:l}=i,c=Fn(S=>{n(S)}),u=Fn(S=>{r(S)});_.useEffect(()=>{const S=s(()=>{a(c,()=>{u(i.getValues())})()});return()=>S.unsubscribe()},[a,s,u,c,i]);const[d,f]=ge.useState(t.transforms.length>0?0:void 0),h=Aje({control:l,name:"transforms"}),g=i.watch("transforms"),v=d===void 0||(k=g[d])==null?void 0:k.type,b=GU._def.options.find(S=>ix(S)._def.value===v),p=_.useMemo(()=>function(S,w){if(!S||S.length===0)return w;let T=new Map(w);for(const P of S)T=Pgt(P,T);return T}(g.slice(0,d),e),[e,g,d]),O=S=>{const w=py(S),T=h.fields.length;h.append(w),f(T)};return y.jsx(oD,{value:p,children:y.jsx(oZ,{value:o,children:y.jsxs("form",{onSubmit:S=>S.preventDefault(),className:"flex flex-row max-h-[400px] overflow-hidden bg-background",children:[y.jsx(Rgt,{items:i.watch("transforms"),selected:d,onSelect:S=>{f(S)},onDelete:S=>{h.remove(S);const w=S-1;f(Math.max(w,0))},onAdd:O}),y.jsxs("div",{className:"flex flex-col flex-1 p-4 overflow-auto min-h-[200px] border-l",children:[d!==void 0&&b&&y.jsx(kK,{form:i,schema:b,path:`transforms.${d}`,renderers:Sgt},`transforms.${d}`),(d===void 0||!b)&&y.jsxs("div",{className:"flex flex-col items-center justify-center flex-grow gap-3",children:[y.jsx(R6,{className:"w-8 h-8 text-muted-foreground"}),y.jsx(lAe,{onAdd:O,children:y.jsx(Ft,{"data-testid":"marimo-plugin-data-frames-add-transform",variant:"text",size:"xs",children:y.jsx("div",{className:"text-sm",children:"Select a transform to begin"})})})]})]})]})})})},Rgt=t=>{const e=ue.c(17),{items:n,selected:r,onAdd:o,onSelect:i,onDelete:a}=t;let s,l,c,u,d;if(e[0]!==n||e[1]!==a||e[2]!==i||e[3]!==r){let f;e[5]!==a||e[6]!==i||e[7]!==r?(f=(h,g)=>y.jsxs("div",{onClick:()=>{i(g)},className:we("flex flex-row min-h-[40px] items-center px-2 cursor-pointer hover:bg-accent/50 text-sm overflow-hidden hover-actions-parent border border-muted border-l-2 border-l-transparent",{"border-l-primary bg-accent text-accent-foreground":r===g}),children:[y.jsx("div",{className:"flex-grow text-ellipsis",children:Jf.startCase(h.type)}),y.jsx(jO,{className:"w-3 h-3 hover-action text-muted-foreground hover:text-destructive",onClick:v=>{a(g),v.stopPropagation()}})]},`${JSON.stringify(h)}-${g}`),e[5]=a,e[6]=i,e[7]=r,e[8]=f):f=e[8],s=n.map(f),e[0]=n,e[1]=a,e[2]=i,e[3]=r,e[4]=s}else s=e[4];return e[9]!==s?(l=y.jsx("div",{className:"flex flex-col overflow-y-auto flex-grow",children:s}),e[9]=s,e[10]=l):l=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsxs(Ft,{"data-testid":"marimo-plugin-data-frames-add-transform",variant:"text",className:"w-full rounded-none m-0 hover:text-accent-foreground",size:"xs",children:[y.jsx(OO,{className:"w-3 h-3 mr-1"}),"Add"]}),e[11]=c):c=e[11],e[12]!==o?(u=y.jsx("div",{className:"flex flex-row flex-shrink-0",children:y.jsx(lAe,{onAdd:o,children:c})}),e[12]=o,e[13]=u):u=e[13],e[14]!==l||e[15]!==u?(d=y.jsxs("div",{className:"flex flex-col overflow-y-hidden w-[180px] shadow-xs h-full",children:[l,u]}),e[14]=l,e[15]=u,e[16]=d):d=e[16],d},lAe=t=>{const e=ue.c(12),{onAdd:n,children:r}=t;let o,i,a,s,l,c,u;return e[0]!==r?(o=y.jsx(Gm,{asChild:!0,children:r}),e[0]=r,e[1]=o):o=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(VM,{children:"Add Transform"}),a=y.jsx(cf,{}),e[2]=i,e[3]=a):(i=e[2],a=e[3]),e[4]!==n?(s=Object.values(GU._def.options).map(d=>{const f=ix(d),h=jgt[f._def.value];return y.jsxs($r,{onSelect:g=>{g.stopPropagation(),n(d)},children:[y.jsx(h,{className:"w-3.5 h-3.5 mr-2"}),y.jsx("span",{children:Jf.startCase(f._def.value)})]},f._def.value)}),e[4]=n,e[5]=s):s=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx($r,{onSelect:Dgt,children:y.jsx("span",{className:"underline text-primary text-xs cursor-pointer",children:"Request a transform"})},"_request_"),e[6]=l):l=e[6],e[7]!==s?(c=y.jsxs(zh,{className:"w-56",children:[i,a,y.jsxs(Jbe,{children:[s,l]})]}),e[7]=s,e[8]=c):c=e[8],e[9]!==o||e[10]!==c?(u=y.jsxs(Hm,{modal:!1,children:[o,c]}),e[9]=o,e[10]=c,e[11]=u):u=e[11],u},jgt={aggregate:rO,column_conversion:OK,filter_rows:P6,group_by:$ce,rename_column:VG,select_columns:Uce,sort_column:ace,shuffle_rows:Bce,sample_rows:Sce,explode_columns:hce,expand_dict:T6,unique:Cce};function Dgt(t){t.stopPropagation(),window.open("https://github.com/marimo-team/marimo/issues/new?title=New%20dataframe%20transform:&labels=enhancement&template=feature_request.yaml","_blank")}const Agt=lu("marimo-dataframe").withData(Qe({label:Pe().nullish(),pageSize:yt().default(5),columns:Wt(sf([Pe().or(yt()),Pe(),Pe()])).transform(t=>{const e=new Map;return t.forEach(([n,r])=>e.set(n,r)),e})})).withFunctions({get_dataframe:_i.input(Qe({})).output(Qe({url:Pe(),total_rows:yt(),row_headers:Y4,field_types:Y4,python_code:Pe().nullish(),sql_code:Pe().nullish()})),get_column_values:_i.input(Qe({column:Pe()})).output(Qe({values:Wt(El()),too_many_values:pt()})),search:_i.input(Qe({sort:Qe({by:Pe(),descending:pt()}).optional(),query:Pe().optional(),filters:Wt(YU).optional(),page_number:yt(),page_size:yt()})).output(Qe({data:or([Pe(),Wt(Qe({}).passthrough())]),total_rows:yt()}))}).renderer(t=>y.jsx($De,{children:y.jsx(cAe,{...t.data,...t.functions,value:t.value,setValue:t.setValue,host:t.host})})),Mgt={transforms:[]},cAe=_.memo(t=>{const e=ue.c(64),{columns:n,pageSize:r,value:o,setValue:i,get_dataframe:a,get_column_values:s,search:l,host:c}=t;let u;e[0]!==a?(u=()=>a({}),e[0]=a,e[1]=u):u=e[1];const d=o==null?void 0:o.transforms;let f;e[2]!==d?(f=[d],e[2]=d,e[3]=f):f=e[3];const{data:h,error:g,isPending:v}=$a(u,f);let b;e[4]!==h?(b=h||{},e[4]=h,e[5]=b):b=e[5];const{url:p,total_rows:O,row_headers:k,field_types:S,python_code:w,sql_code:T}=b,[P,j]=_.useState(o||Mgt),D=_.useRef(P);let N,E;e[6]!==P?(N=()=>{D.current=P},e[6]=P,e[7]=N):N=e[7],_.useEffect(N),e[8]!==i||e[9]!==(o==null?void 0:o.transforms.length)?(E=()=>{const _e=D.current;(o==null?void 0:o.transforms.length)!==_e.transforms.length&&i(_e)},e[8]=i,e[9]=o==null?void 0:o.transforms.length,e[10]=E):E=e[10];const A=o==null?void 0:o.transforms.length;let I,L,F,Q,W,U,X,G,ae,ne,re,Z,K,oe;e[11]!==h||e[12]!==i||e[13]!==A?(I=[h,A,D,i],e[11]=h,e[12]=i,e[13]=A,e[14]=I):I=e[14],_.useEffect(E,I),e[15]===Symbol.for("react.memo_cache_sentinel")?(L=y.jsxs(Hs,{value:"transform",className:"text-xs py-1",children:[y.jsx(rO,{className:"w-3 h-3 mr-2"}),"Transform"]}),e[15]=L):L=e[15],e[16]!==w?(F=w&&y.jsxs(Hs,{value:"python-code",className:"text-xs py-1",children:[y.jsx(mG,{className:"w-3 h-3 mr-2"}),"Python Code"]}),e[16]=w,e[17]=F):F=e[17],e[18]!==T?(Q=T&&y.jsxs(Hs,{value:"sql-code",className:"text-xs py-1",children:[y.jsx(Wx,{className:"w-3 h-3 mr-2"}),"SQL Code"]}),e[18]=T,e[19]=Q):Q=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(W=y.jsx("div",{className:"flex-grow"}),e[20]=W):W=e[20],e[21]!==F||e[22]!==Q?(U=y.jsxs(Kh,{className:"h-8",children:[L,F,Q,W]}),e[21]=F,e[22]=Q,e[23]=U):U=e[23],e[24]!==v?(X=v&&y.jsx(Ym,{size:"small"}),e[24]=v,e[25]=X):X=e[25],e[26]!==U||e[27]!==X?(G=y.jsxs("div",{className:"flex items-center gap-2",children:[U,X]}),e[26]=U,e[27]=X,e[28]=G):G=e[28],e[29]!==i||e[30]!==o?(ae=_e=>{mf(_e,o)||(i(_e),j(_e))},e[29]=i,e[30]=o,e[31]=ae):ae=e[31],e[32]!==n||e[33]!==s||e[34]!==P||e[35]!==ae?(ne=y.jsx(ec,{value:"transform",className:"mt-1 border rounded-t overflow-hidden",children:y.jsx(Egt,{initialValue:P,columns:n,onChange:ae,onInvalidChange:j,getColumnValues:s})}),e[32]=n,e[33]=s,e[34]=P,e[35]=ae,e[36]=ne):ne=e[36],e[37]!==w?(re=w&&y.jsx(ec,{value:"python-code",className:"mt-1 border rounded-t overflow-hidden",children:y.jsx(hO,{minHeight:"215px",maxHeight:"215px",code:w,language:"python"})}),e[37]=w,e[38]=re):re=e[38],e[39]!==T?(Z=T&&y.jsx(ec,{value:"sql-code",className:"mt-1 border rounded-t overflow-hidden",children:y.jsx(hO,{minHeight:"215px",maxHeight:"215px",code:T,language:"sql"})}),e[39]=T,e[40]=Z):Z=e[40],e[41]!==G||e[42]!==ne||e[43]!==re||e[44]!==Z?(K=y.jsxs(sg,{defaultValue:"transform",children:[G,ne,re,Z]}),e[41]=G,e[42]=ne,e[43]=re,e[44]=Z,e[45]=K):K=e[45],e[46]!==g?(oe=g&&y.jsx(Hd,{error:g}),e[46]=g,e[47]=oe):oe=e[47];const ie=p||"",Y=O??0;let le;e[48]!==n?(le=Object.keys(n),e[48]=n,e[49]=le):le=e[49];const me=k||Lc.EMPTY,ce=O&&O>5||!1;let ve,ye;return e[50]!==S||e[51]!==c||e[52]!==r||e[53]!==l||e[54]!==ie||e[55]!==Y||e[56]!==le.length||e[57]!==me||e[58]!==ce?(ve=y.jsx(KU,{label:null,className:"rounded-b border-x border-b",data:ie,hasStableRowId:!1,totalRows:Y,totalColumns:le.length,maxColumns:"all",pageSize:r,pagination:!0,fieldTypes:S,rowHeaders:me,showDownload:!1,download_as:Zi.THROW,enableSearch:!1,showFilters:!1,search:l,showColumnSummaries:!1,showDataTypes:!0,get_column_summaries:Ngt,showPageSizeSelector:ce,showColumnExplorer:!1,showChartBuilder:!1,value:Lc.EMPTY,setValue:Zi.NOOP,selection:null,lazy:!1,host:c}),e[50]=S,e[51]=c,e[52]=r,e[53]=l,e[54]=ie,e[55]=Y,e[56]=le.length,e[57]=me,e[58]=ce,e[59]=ve):ve=e[59],e[60]!==K||e[61]!==oe||e[62]!==ve?(ye=y.jsxs("div",{children:[K,oe,ve]}),e[60]=K,e[61]=oe,e[62]=ve,e[63]=ye):ye=e[63],ye});function Ngt(){return Promise.resolve({stats:{},data:null,bin_values:{}})}JH=function(t){const e=t.split(".").pop();if(e===void 0)return"unknown";switch(e.toLowerCase()){case"py":return"python";case"txt":case"md":case"qmd":return"text";case"png":case"jpg":case"jpeg":case"gif":return"image";case"csv":return"data";case"json":return"json";case"js":case"ts":case"tsx":case"html":case"css":case"toml":case"yaml":case"yml":case"wasm":return"code";case"mp3":case"m4a":case"m4v":case"ogg":case"wav":return"audio";case"mp4":case"webm":case"mkv":return"video";case"pdf":return"pdf";case"zip":case"tar":case"gz":return"zip";default:return"unknown"}},cAe.displayName="DataFrameComponent";let wh;eY={directory:Ace,python:qE,json:T6,code:qE,text:TH,image:Rce,audio:Ece,video:jce,pdf:qE,zip:Dce,data:Wx,unknown:NH},wh=" ",_8e={directory:t=>`os.listdir("${t}")`,python:t=>`with open("${t}", "r") as _f:
|
478
478
|
${wh}...
|
@@ -494,12 +494,12 @@ ${wh}...
|
|
494
494
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function vAe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function yAe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?vAe(Object(n),!0).forEach(function(r){bAe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vAe(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function bAe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LC(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var i,a,s=[],l=!0,c=!1;try{for(o=o.call(n);!(l=(i=o.next()).done)&&(s.push(i.value),!r||s.length!==r);l=!0);}catch(u){c=!0,a=u}finally{try{l||o.return==null||o.return()}finally{if(c)throw a}}return s}}(t,e)||xAe(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
495
495
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function xAe(t,e){if(t){if(typeof t=="string")return hZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hZ(t,e):void 0}}function hZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var qgt=typeof fZ=="function"?fZ:fZ.default,Fgt=function(){var t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split(","),e=t.length>1?"one of ".concat(t.join(", ")):t[0];return{code:"file-invalid-type",message:"File type must be ".concat(e)}},OAe=function(t){return{code:"file-too-large",message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},wAe=function(t){return{code:"file-too-small",message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Bgt={code:"too-many-files",message:"Too many files"};function kAe(t,e){var n=t.type==="application/x-moz-file"||qgt(t,e);return[n,n?null:Fgt(e)]}function SAe(t,e,n){if(mv(t.size))if(mv(e)&&mv(n)){if(t.size>n)return[!1,OAe(n)];if(t.size<e)return[!1,wAe(e)]}else{if(mv(e)&&t.size<e)return[!1,wAe(e)];if(mv(n)&&t.size>n)return[!1,OAe(n)]}return[!0,null]}function mv(t){return t!=null}function sD(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():t.cancelBubble!==void 0&&t.cancelBubble}function lD(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function CAe(t){t.preventDefault()}function zd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return e.some(function(s){return!sD(r)&&s&&s.apply(void 0,[r].concat(i)),sD(r)})}}function _Ae(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||t==="application/*"||/\w+\/[-+.\w]+/g.test(t)}function TAe(t){return/^.*\.[\w]+$/.test(t)}var Wgt=["children"],Ugt=["open"],Zgt=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Xgt=["refKey","onChange","onClick"];function Hgt(t){return function(e){if(Array.isArray(e))return mZ(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||PAe(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
496
496
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function pZ(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var i,a,s=[],l=!0,c=!1;try{for(o=o.call(n);!(l=(i=o.next()).done)&&(s.push(i.value),!r||s.length!==r);l=!0);}catch(u){c=!0,a=u}finally{try{l||o.return==null||o.return()}finally{if(c)throw a}}return s}}(t,e)||PAe(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
497
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function PAe(t,e){if(t){if(typeof t=="string")return mZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mZ(t,e):void 0}}function mZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function EAe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function qo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?EAe(Object(n),!0).forEach(function(r){gZ(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):EAe(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function gZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cD(t,e){if(t==null)return{};var n,r,o=function(a,s){if(a==null)return{};var l,c,u={},d=Object.keys(a);for(c=0;c<d.length;c++)l=d[c],s.indexOf(l)>=0||(u[l]=a[l]);return u}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var vZ=_.forwardRef(function(t,e){var n=t.children,r=AN(cD(t,Wgt)),o=r.open,i=cD(r,Ugt);return _.useImperativeHandle(e,function(){return{open:o}},[o]),ge.createElement(_.Fragment,null,n(qo(qo({},i),{},{open:o})))});vZ.displayName="Dropzone";var RAe={disabled:!1,getFilesFromEvent:function(t){return Zg(this,void 0,void 0,function*(){return aD(t)&&aD(t.dataTransfer)?function(e,n){return Zg(this,void 0,void 0,function*(){if(e.items){const r=uZ(e.items).filter(o=>o.kind==="file");return n!=="drop"?r:dAe(fAe(yield Promise.all(r.map(zgt))))}return dAe(uZ(e.files).map(r=>ax(r)))})}(t.dataTransfer,t.type):function(e){return aD(e)&&aD(e.target)}(t)?function(e){return uZ(e.target.files).map(n=>ax(n))}(t):Array.isArray(t)&&t.every(e=>"getFile"in e&&typeof e.getFile=="function")?function(e){return Zg(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>ax(n))})}(t):[]})},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};vZ.defaultProps=RAe,vZ.propTypes={children:Fr.func,accept:Fr.objectOf(Fr.arrayOf(Fr.string)),multiple:Fr.bool,preventDropOnDocument:Fr.bool,noClick:Fr.bool,noKeyboard:Fr.bool,noDrag:Fr.bool,noDragEventsBubbling:Fr.bool,minSize:Fr.number,maxSize:Fr.number,maxFiles:Fr.number,disabled:Fr.bool,getFilesFromEvent:Fr.func,onFileDialogCancel:Fr.func,onFileDialogOpen:Fr.func,useFsAccessApi:Fr.bool,autoFocus:Fr.bool,onDragEnter:Fr.func,onDragLeave:Fr.func,onDragOver:Fr.func,onDrop:Fr.func,onDropAccepted:Fr.func,onDropRejected:Fr.func,onError:Fr.func,validator:Fr.func};var yZ={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};AN=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=qo(qo({},RAe),t),n=e.accept,r=e.disabled,o=e.getFilesFromEvent,i=e.maxSize,a=e.minSize,s=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,f=e.onDrop,h=e.onDropAccepted,g=e.onDropRejected,v=e.onFileDialogCancel,b=e.onFileDialogOpen,p=e.useFsAccessApi,O=e.autoFocus,k=e.preventDropOnDocument,S=e.noClick,w=e.noKeyboard,T=e.noDrag,P=e.noDragEventsBubbling,j=e.onError,D=e.validator,N=_.useMemo(function(){return function(Re){if(mv(Re))return Object.entries(Re).reduce(function(ot,Me){var We=LC(Me,2),it=We[0],Ue=We[1];return[].concat(gAe(ot),[it],gAe(Ue))},[]).filter(function(ot){return _Ae(ot)||TAe(ot)}).join(",")}(n)},[n]),E=_.useMemo(function(){return function(Re){return mv(Re)?[{description:"Files",accept:Object.entries(Re).filter(function(ot){var Me=LC(ot,2),We=Me[0],it=Me[1],Ue=!0;return _Ae(We)||(console.warn('Skipped "'.concat(We,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),Ue=!1),Array.isArray(it)&&it.every(TAe)||(console.warn('Skipped "'.concat(We,'" because an invalid file extension was provided.')),Ue=!1),Ue}).reduce(function(ot,Me){var We=LC(Me,2),it=We[0],Ue=We[1];return yAe(yAe({},ot),{},bAe({},it,Ue))},{})}]:Re}(n)},[n]),A=_.useMemo(function(){return typeof b=="function"?b:jAe},[b]),I=_.useMemo(function(){return typeof v=="function"?v:jAe},[v]),L=_.useRef(null),F=_.useRef(null),Q=pZ(_.useReducer(Ygt,yZ),2),W=Q[0],U=Q[1],X=W.isFocused,G=W.isFileDialogActive,ae=_.useRef(typeof window<"u"&&window.isSecureContext&&p&&"showOpenFilePicker"in window),ne=function(){!ae.current&&G&&setTimeout(function(){F.current&&(F.current.files.length||(U({type:"closeDialog"}),I()))},300)};_.useEffect(function(){return window.addEventListener("focus",ne,!1),function(){window.removeEventListener("focus",ne,!1)}},[F,G,I,ae]);var re=_.useRef([]),Z=function(Re){L.current&&L.current.contains(Re.target)||(Re.preventDefault(),re.current=[])};_.useEffect(function(){return k&&(document.addEventListener("dragover",CAe,!1),document.addEventListener("drop",Z,!1)),function(){k&&(document.removeEventListener("dragover",CAe),document.removeEventListener("drop",Z))}},[L,k]),_.useEffect(function(){return!r&&O&&L.current&&L.current.focus(),function(){}},[L,O,r]);var K=_.useCallback(function(Re){j?j(Re):console.error(Re)},[j]),oe=_.useCallback(function(Re){Re.preventDefault(),Re.persist(),De(Re),re.current=[].concat(Hgt(re.current),[Re.target]),lD(Re)&&Promise.resolve(o(Re)).then(function(ot){if(!sD(Re)||P){var Me=ot.length,We=Me>0&&function(it){var Ue=it.files,gt=it.accept,Tt=it.minSize,Kt=it.maxSize,Sn=it.multiple,Jt=it.maxFiles,sn=it.validator;return!(!Sn&&Ue.length>1||Sn&&Jt>=1&&Ue.length>Jt)&&Ue.every(function(jn){var Zr=LC(kAe(jn,gt),1)[0],Nr=LC(SAe(jn,Tt,Kt),1)[0],go=sn?sn(jn):null;return Zr&&Nr&&!go})}({files:ot,accept:N,minSize:a,maxSize:i,multiple:s,maxFiles:l,validator:D});U({isDragAccept:We,isDragReject:Me>0&&!We,isDragActive:!0,type:"setDraggedFiles"}),c&&c(Re)}}).catch(function(ot){return K(ot)})},[o,c,K,P,N,a,i,s,l,D]),ie=_.useCallback(function(Re){Re.preventDefault(),Re.persist(),De(Re);var ot=lD(Re);if(ot&&Re.dataTransfer)try{Re.dataTransfer.dropEffect="copy"}catch{}return ot&&d&&d(Re),!1},[d,P]),Y=_.useCallback(function(Re){Re.preventDefault(),Re.persist(),De(Re);var ot=re.current.filter(function(We){return L.current&&L.current.contains(We)}),Me=ot.indexOf(Re.target);Me!==-1&&ot.splice(Me,1),re.current=ot,ot.length>0||(U({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),lD(Re)&&u&&u(Re))},[L,u,P]),le=_.useCallback(function(Re,ot){var Me=[],We=[];Re.forEach(function(it){var Ue=pZ(kAe(it,N),2),gt=Ue[0],Tt=Ue[1],Kt=pZ(SAe(it,a,i),2),Sn=Kt[0],Jt=Kt[1],sn=D?D(it):null;if(gt&&Sn&&!sn)Me.push(it);else{var jn=[Tt,Jt];sn&&(jn=jn.concat(sn)),We.push({file:it,errors:jn.filter(function(Zr){return Zr})})}}),(!s&&Me.length>1||s&&l>=1&&Me.length>l)&&(Me.forEach(function(it){We.push({file:it,errors:[Bgt]})}),Me.splice(0)),U({acceptedFiles:Me,fileRejections:We,isDragReject:We.length>0,type:"setFiles"}),f&&f(Me,We,ot),We.length>0&&g&&g(We,ot),Me.length>0&&h&&h(Me,ot)},[U,s,N,a,i,l,f,h,g,D]),me=_.useCallback(function(Re){Re.preventDefault(),Re.persist(),De(Re),re.current=[],lD(Re)&&Promise.resolve(o(Re)).then(function(ot){sD(Re)&&!P||le(ot,Re)}).catch(function(ot){return K(ot)}),U({type:"reset"})},[o,le,K,P]),ce=_.useCallback(function(){if(ae.current){U({type:"openDialog"}),A();var Re={multiple:s,types:E};window.showOpenFilePicker(Re).then(function(ot){return o(ot)}).then(function(ot){le(ot,null),U({type:"closeDialog"})}).catch(function(ot){var Me;(Me=ot)instanceof DOMException&&(Me.name==="AbortError"||Me.code===Me.ABORT_ERR)?(I(ot),U({type:"closeDialog"})):function(We){return We instanceof DOMException&&(We.name==="SecurityError"||We.code===We.SECURITY_ERR)}(ot)?(ae.current=!1,F.current?(F.current.value=null,F.current.click()):K(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):K(ot)})}else F.current&&(U({type:"openDialog"}),A(),F.current.value=null,F.current.click())},[U,A,I,p,le,K,E,s]),ve=_.useCallback(function(Re){L.current&&L.current.isEqualNode(Re.target)&&(Re.key!==" "&&Re.key!=="Enter"&&Re.keyCode!==32&&Re.keyCode!==13||(Re.preventDefault(),ce()))},[L,ce]),ye=_.useCallback(function(){U({type:"focus"})},[]),_e=_.useCallback(function(){U({type:"blur"})},[]),Se=_.useCallback(function(){S||(function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return function(ot){return ot.indexOf("MSIE")!==-1||ot.indexOf("Trident/")!==-1}(Re)||function(ot){return ot.indexOf("Edge/")!==-1}(Re)}()?setTimeout(ce,0):ce())},[S,ce]),Ae=function(Re){return r?null:Re},je=function(Re){return w?null:Ae(Re)},Ie=function(Re){return T?null:Ae(Re)},De=function(Re){P&&Re.stopPropagation()},nt=_.useMemo(function(){return function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ot=Re.refKey,Me=ot===void 0?"ref":ot,We=Re.role,it=Re.onKeyDown,Ue=Re.onFocus,gt=Re.onBlur,Tt=Re.onClick,Kt=Re.onDragEnter,Sn=Re.onDragOver,Jt=Re.onDragLeave,sn=Re.onDrop,jn=cD(Re,Zgt);return qo(qo(gZ({onKeyDown:je(zd(it,ve)),onFocus:je(zd(Ue,ye)),onBlur:je(zd(gt,_e)),onClick:Ae(zd(Tt,Se)),onDragEnter:Ie(zd(Kt,oe)),onDragOver:Ie(zd(Sn,ie)),onDragLeave:Ie(zd(Jt,Y)),onDrop:Ie(zd(sn,me)),role:typeof We=="string"&&We!==""?We:"presentation"},Me,L),r||w?{}:{tabIndex:0}),jn)}},[L,ve,ye,_e,Se,oe,ie,Y,me,w,T,r]),Fe=_.useCallback(function(Re){Re.stopPropagation()},[]),kt=_.useMemo(function(){return function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ot=Re.refKey,Me=ot===void 0?"ref":ot,We=Re.onChange,it=Re.onClick,Ue=cD(Re,Xgt);return qo(qo({},gZ({accept:N,multiple:s,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Ae(zd(We,me)),onClick:Ae(zd(it,Fe)),tabIndex:-1},Me,F)),Ue)}},[F,n,s,me,r]);return qo(qo({},W),{},{isFocused:X&&!r,getRootProps:nt,getInputProps:kt,rootRef:L,inputRef:F,open:Ae(ce)})};function Ygt(t,e){switch(e.type){case"focus":return qo(qo({},t),{},{isFocused:!0});case"blur":return qo(qo({},t),{},{isFocused:!1});case"openDialog":return qo(qo({},yZ),{},{isFileDialogActive:!0});case"closeDialog":return qo(qo({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return qo(qo({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return qo(qo({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return qo({},yZ);default:return t}}function jAe(){}function DAe(t){return new Promise(e=>{const n=new FileReader;n.readAsDataURL(t),n.onload=r=>{var o;if((o=r.target)!=null&&o.result){const i=r.target.result,a=i.slice(i.indexOf(",")+1);e(a)}}})}const Ggt=t=>{const e=ue.c(78);let n;e[0]!==t.filetypes?(n=function(K){const oe={},ie=(Y,le)=>{Object.hasOwn(oe,Y)?oe[Y].push(le):oe[Y]=[le]};return K.forEach(Y=>{switch(Y){case".png":case".jpg":case".jpeg":case".gif":case".avif":case".bmp":case".ico":case".svg":case".tiff":case".webp":ie("image/*",Y);break;case".avi":case".mp4":case".mpeg":case".ogg":case".webm":ie("video/*",Y);break;case".pdf":ie("application/pdf",Y);break;case".csv":ie("text/csv",Y);break;default:ie("text/plain",Y)}}),oe}(t.filetypes),e[0]=t.filetypes,e[1]=n):n=e[1];const r=n,{setValue:o,kind:i,multiple:a,value:s,max_size:l}=t;let c,u;e[2]!==o?(c=K=>{var oe;(oe=K,Promise.all(oe.map(ie=>DAe(ie).then(Y=>[ie.name,Y])))).then(ie=>{o(ie)}).catch(n0t)},e[2]=o,e[3]=c):c=e[3],e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==c?(u={accept:r,multiple:a,maxSize:l,onError:Kgt,onDropRejected:t0t,onDrop:c},e[4]=r,e[5]=l,e[6]=a,e[7]=c,e[8]=u):u=e[8];const{getRootProps:d,getInputProps:f,isFocused:h,isDragAccept:g,isDragReject:v}=AN(u);let b,p;e[9]!==s?(b=s.map(r0t),e[9]=s,e[10]=b):b=e[10],e[11]!==b?(p=y.jsx("ul",{children:b}),e[11]=b,e[12]=p):p=e[12];const O=p,k=s.length>0;if(i==="button"){const K=t.label??"Upload";let oe,ie,Y,le,me,ce,ve,ye,_e;return e[13]!==d?(oe=d({}),e[13]=d,e[14]=oe):oe=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(ie=fs({variant:"secondary",size:"xs"}),e[15]=ie):ie=e[15],e[16]!==K?(Y=Br({html:K}),e[16]=K,e[17]=Y):Y=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(le=y.jsx(MN,{size:14,className:"ml-2"}),e[18]=le):le=e[18],e[19]!==oe||e[20]!==ie||e[21]!==Y?(me=y.jsxs("button",{"data-testid":"marimo-plugin-file-upload-button",...oe,className:ie,children:[Y,le]}),e[19]=oe,e[20]=ie,e[21]=Y,e[22]=me):me=e[22],e[23]!==f?(ce=f({}),e[23]=f,e[24]=ce):ce=e[24],e[25]!==ce?(ve=y.jsx("input",{...ce,type:"file"}),e[25]=ce,e[26]=ve):ve=e[26],e[27]!==o||e[28]!==k||e[29]!==O||e[30]!==s.length?(ye=k?y.jsxs(y.Fragment,{children:[y.jsx(qn,{content:O,children:y.jsxs("span",{className:"text-xs text-muted-foreground",children:["Uploaded"," ",y.jsxs("span",{className:"underline cursor-pointer",children:[s.length," ",s.length===1?"file":"files","."]})]})}),y.jsx("button",{className:we("text-xs cursor-pointer text-destructive hover:underline"),onClick:()=>o([]),type:"button",children:"Click to clear files."})]}):null,e[27]=o,e[28]=k,e[29]=O,e[30]=s.length,e[31]=ye):ye=e[31],e[32]!==ve||e[33]!==ye||e[34]!==me?(_e=y.jsx(za,{children:y.jsxs("div",{className:"flex flex-row items-center justify-start gap-2",children:[me,ve,ye]})}),e[32]=ve,e[33]=ye,e[34]=me,e[35]=_e):_e=e[35],_e}const S=t.label??`Drag and drop ${a?"files":"a file"} here, or click to open file browser`,w=!h&&"border-input/60 border-dashed",T=h&&"border-solid";let P,j,D,N,E;e[36]!==w||e[37]!==T?(P=we("hover:text-primary","mt-3 mb-2 w-full flex flex-col items-center justify-center ","px-6 py-6 sm:px-8 sm:py-8 md:py-10 md:px-16","border rounded-sm","text-sm text-muted-foreground","hover:cursor-pointer","active:shadow-xsSolid","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent",w,T),e[36]=w,e[37]=T,e[38]=P):P=e[38],e[39]!==d?(j=d(),e[39]=d,e[40]=j):j=e[40],e[41]!==f?(D=f(),e[41]=f,e[42]=D):D=e[42],e[43]!==D?(N=y.jsx("input",{...D}),e[43]=D,e[44]=N):N=e[44],e[45]!==S||e[46]!==k?(E=k?y.jsxs("span",{children:["To re-upload: ",Br({html:S})]}):y.jsx("span",{className:"mt-0",children:Br({html:S})}),e[45]=S,e[46]=k,e[47]=E):E=e[47];const A=g&&"text-primary",I=v&&"text-destructive";let L,F;e[48]!==A||e[49]!==I?(L=we(A,I),e[48]=A,e[49]=I,e[50]=L):L=e[50],e[51]!==L?(F=y.jsx(MN,{strokeWidth:1.4,className:L}),e[51]=L,e[52]=F):F=e[52];const Q=g&&"text-primary",W=v&&"text-destructive";let U,X,G,ae,ne,re,Z;return e[53]!==Q||e[54]!==W?(U=we(Q,W),e[53]=Q,e[54]=W,e[55]=U):U=e[55],e[56]!==U?(X=y.jsx(R6,{strokeWidth:1.4,className:U}),e[56]=U,e[57]=X):X=e[57],e[58]!==F||e[59]!==X?(G=y.jsxs("div",{className:"flex flex-row items-center justify-center flex-grow gap-3",children:[F,X]}),e[58]=F,e[59]=X,e[60]=G):G=e[60],e[61]!==E||e[62]!==G?(ae=y.jsxs("div",{className:"flex flex-col items-center justify-center flex-grow gap-3",children:[E,G]}),e[61]=E,e[62]=G,e[63]=ae):ae=e[63],e[64]!==N||e[65]!==ae||e[66]!==P||e[67]!==j?(ne=y.jsxs("div",{className:P,...j,children:[N,ae]}),e[64]=N,e[65]=ae,e[66]=P,e[67]=j,e[68]=ne):ne=e[68],e[69]!==a||e[70]!==o||e[71]!==k||e[72]!==O||e[73]!==s.length?(re=k?y.jsxs("div",{className:"flex flex-row gap-1",children:[y.jsx("div",{className:"text-xs text-muted-foreground",children:y.jsxs(za,{children:["Uploaded"," ",y.jsx(qn,{content:O,children:y.jsxs("span",{className:"underline cursor-pointer",children:[s.length," ",s.length===1?"file":"files","."]})})]})}),y.jsx("span",{className:"text-xs text-destructive hover:underline hover:cursor-pointer",children:y.jsxs("button",{className:we("text-destructive","hover:underline"),onClick:()=>o([]),type:"button",children:["Click to clear ",a?"files":"file","."]})})]}):null,e[69]=a,e[70]=o,e[71]=k,e[72]=O,e[73]=s.length,e[74]=re):re=e[74],e[75]!==ne||e[76]!==re?(Z=y.jsx("section",{children:y.jsxs("div",{className:"flex flex-col items-start justify-start flex-grow gap-3",children:[ne,re]})}),e[75]=ne,e[76]=re,e[77]=Z):Z=e[77],Z};function Kgt(t){Ve.error(t),Kr({title:"File upload failed",description:t.message,variant:"danger"})}function Jgt(t){return t.message}function e0t(t){return y.jsxs("div",{children:[t.file.name," (",t.errors.map(Jgt).join(", "),")"]},t.file.name)}function t0t(t){Kr({title:"File upload failed",description:y.jsx("div",{className:"flex flex-col gap-1",children:t.map(e0t)}),variant:"danger"})}function n0t(t){Ve.error(t),Kr({title:"File upload failed",description:"Failed to convert file to base64.",variant:"danger"})}function r0t(t){const[e]=t;return y.jsx("li",{children:e},e)}const o0t=lu("marimo-form").withData(Qe({label:Pe().nullable(),elementId:Pe(),bordered:pt().default(!0),loading:pt().default(!1),submitButtonLabel:Pe().default("Submit"),submitButtonTooltip:Pe().optional(),submitButtonDisabled:pt().default(!1),clearOnSubmit:pt().default(!1),showClearButton:pt().default(!1),clearButtonLabel:Pe().default("Clear"),clearButtonTooltip:Pe().optional(),shouldValidate:pt().optional()})).withFunctions({validate:_i.input(Qe({value:lp()})).output(Pe().nullish())}).renderer(({data:t,functions:e,...n})=>y.jsx(za,{children:y.jsx(a0t,{...t,...n,...e})})),i0t=t=>{const e=ue.c(46),{children:n,currentValue:r,newValue:o,setValue:i,label:a,bordered:s,loading:l,submitButtonLabel:c,submitButtonTooltip:u,submitButtonDisabled:d,clearOnSubmit:f,showClearButton:h,clearButtonLabel:g,clearButtonTooltip:v,validate:b,shouldValidate:p}=t,O=_.useRef(null),k=o===r,S=k?"secondary":"action",[w,T]=_.useState(null);let P;e[0]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{O.current&&bZ(O.current)},e[0]=P):P=e[0];const j=P;let D;e[1]!==f||e[2]!==o||e[3]!==i||e[4]!==p||e[5]!==b?(D=async Z=>{if(Z.preventDefault(),p){const K=await b({value:o}).catch(oe=>{T(oe.message??"Error validating")});if(K!=null)return void T(K)}T(null),i(o),f&&j()},e[1]=f,e[2]=o,e[3]=i,e[4]=p,e[5]=b,e[6]=D):D=e[6];const N=!k&&s;let E,A,I,L,F,Q;e[7]!==s||e[8]!==N?(E=we("flex flex-col gap-4 rounded-lg py-4 px-8",{"bg-[var(--gray-1)] shadow-md border border-input":s,"bg-[var(--amber-1)] border-[var(--amber-7)]":N}),e[7]=s,e[8]=N,e[9]=E):E=e[9],e[10]!==o||e[11]!==i?(A=Z=>{Z.key==="Enter"&&(Z.ctrlKey||Z.metaKey)&&(Z.preventDefault(),Z.stopPropagation(),i(o))},e[10]=o,e[11]=i,e[12]=A):A=e[12],e[13]!==a?(I=a===null?null:y.jsx("div",{className:"text-center",children:Br({html:a})}),e[13]=a,e[14]=I):I=e[14],e[15]!==w?(L=w!=null&&y.jsx(Km,{kind:"danger",className:"rounded",children:w??"Invalid input"}),e[15]=w,e[16]=L):L=e[16],e[17]!==n?(F=y.jsx("div",{children:n}),e[17]=n,e[18]=F):F=e[18],e[19]!==g||e[20]!==v||e[21]!==h?(Q=h&&AAe(y.jsx(Ft,{"data-testid":"marimo-plugin-form-clear-button",variant:"text",onClick:Z=>{Z.preventDefault(),j()},children:g}),v),e[19]=g,e[20]=v,e[21]=h,e[22]=Q):Q=e[22];const W=d||l;let U,X,G,ae,ne,re;return e[23]!==l?(U=l&&y.jsx(af,{className:"h-4 w-4 mr-2 animate-spin"}),e[23]=l,e[24]=U):U=e[24],e[25]!==c||e[26]!==W||e[27]!==U||e[28]!==S?(X=y.jsxs(Ft,{"data-testid":"marimo-plugin-form-submit-button",variant:S,disabled:W,type:"submit",children:[U,c]}),e[25]=c,e[26]=W,e[27]=U,e[28]=S,e[29]=X):X=e[29],e[30]!==u||e[31]!==X?(G=AAe(X,u),e[30]=u,e[31]=X,e[32]=G):G=e[32],e[33]!==G||e[34]!==Q?(ae=y.jsxs("div",{className:"flex justify-end gap-2 font-code",children:[Q,G]}),e[33]=G,e[34]=Q,e[35]=ae):ae=e[35],e[36]!==ae||e[37]!==E||e[38]!==A||e[39]!==I||e[40]!==L||e[41]!==F?(ne=y.jsxs("div",{className:E,onKeyDown:A,children:[I,L,F,ae]}),e[36]=ae,e[37]=E,e[38]=A,e[39]=I,e[40]=L,e[41]=F,e[42]=ne):ne=e[42],e[43]!==ne||e[44]!==D?(re=y.jsx("form",{className:"contents",ref:O,onSubmit:D,children:ne}),e[43]=ne,e[44]=D,e[45]=re):re=e[45],re},a0t=t=>{const e=ue.c(24);let n,r,o,i,a,s,l;e[0]!==t?({elementId:o,value:s,setValue:i,children:n,validate:a,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a,e[6]=s):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5],s=e[6]),e[7]!==o?(l=uf.lookupValue(o),e[7]=o,e[8]=l):l=e[8];const[c,u]=_.useState(l);let d,f;e[9]!==o?(d=()=>{u(uf.lookupValue(o))},f=[o],e[9]=o,e[10]=d,e[11]=f):(d=e[10],f=e[11]),_.useEffect(d,f);const h=uf.lookupValue(o);let g,v,b;return h!==c&&u(h),e[12]!==o?(g=()=>{const p=O=>{const k=O.detail.element;k===null||!(k instanceof Node)||YB(k)===o&&u(O.detail.value)};return document.addEventListener(Mp.TYPE,p),()=>{document.removeEventListener(Mp.TYPE,p)}},e[12]=o,e[13]=g):g=e[13],e[14]!==o||e[15]!==i?(v=[o,i],e[14]=o,e[15]=i,e[16]=v):v=e[16],_.useEffect(g,v),e[17]!==n||e[18]!==r||e[19]!==c||e[20]!==i||e[21]!==a||e[22]!==s?(b=y.jsx(i0t,{currentValue:s,newValue:c,setValue:i,validate:a,...r,children:n}),e[17]=n,e[18]=r,e[19]=c,e[20]=i,e[21]=a,e[22]=s,e[23]=b):b=e[23],b};function AAe(t,e){return e?y.jsx(qn,{content:e,children:t}):t}function bZ(t){t instanceof HTMLElement&&(t.shadowRoot&&[...t.shadowRoot.children].forEach(bZ),[...t.children].forEach(bZ),t.tagName===K5&&t.reset())}const s0t=t=>{const e=ue.c(12),{onStart:n,onStop:r,status:o,time:i}=t;let a,s,l,c;return e[0]!==n||e[1]!==o?(a=o==="stopped"&&y.jsx(Ft,{"data-testid":"audio-recorder-start",variant:"secondary",onClick:n,className:"w-[50px]",children:y.jsx(BO,{className:we("w-6 h-6 border border-input rounded-full"),strokeWidth:1.5,fill:"var(--red-9)"})}),e[0]=n,e[1]=o,e[2]=a):a=e[2],e[3]!==r||e[4]!==o?(s=o==="recording"&&y.jsxs(Ft,{"data-testid":"audio-recorder-pause",variant:"secondary",onClick:r,className:"w-[50px]",children:[y.jsx(SK,{className:"w-5 h-5 rounded-sm",fill:"var(--red-9)",strokeWidth:1.5}),y.jsx(BO,{className:we("w-6 h-6 absolute opacity-20 animate-ping"),fill:"var(--red-9)",style:{animationDuration:"1.5s"},strokeWidth:0})]}),e[3]=r,e[4]=o,e[5]=s):s=e[5],e[6]!==i?(l=i&&y.jsxs("span",{className:"text-sm font-bold",children:[i,"s"]}),e[6]=i,e[7]=l):l=e[7],e[8]!==a||e[9]!==s||e[10]!==l?(c=y.jsxs("div",{className:"flex items-center gap-3",children:[a,s,l]}),e[8]=a,e[9]=s,e[10]=l,e[11]=c):c=e[11],c};function l0t(t){return t+.1}function c0t(t){const e=ue.c(18),{onDone:n,options:r}=t,[o,i]=_.useState("stopped"),a=_.useRef(void 0),[s,l]=_.useState(!0),[c,u]=_.useState(),d=function(){const w=ue.c(12),[T,P]=_.useState(0),j=_.useRef(void 0);let D;w[0]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{j.current=window.setInterval(()=>{P(l0t)},100)},w[0]=D):D=w[0];const N=Fn(D);let E;w[1]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{j.current!=null&&(window.clearInterval(j.current),j.current=void 0)},w[1]=E):E=w[1];const A=Fn(E);let I;w[2]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{P(0)},w[2]=I):I=w[2];const L=Fn(I);let F,Q,W,U;return w[3]===Symbol.for("react.memo_cache_sentinel")?(F=()=>()=>{window.clearInterval(j.current)},Q=[],w[3]=F,w[4]=Q):(F=w[3],Q=w[4]),_.useEffect(F,Q),w[5]!==T?(W=new Intl.NumberFormat("en-US",{minimumFractionDigits:1,maximumFractionDigits:1}).format(T),w[5]=T,w[6]=W):W=w[6],w[7]!==L||w[8]!==N||w[9]!==A||w[10]!==W?(U={time:W,start:N,stop:A,clear:L},w[7]=L,w[8]=N,w[9]=A,w[10]=W,w[11]=U):U=w[11],U}();let f;e[0]!==n||e[1]!==r||e[2]!==d?(f=()=>{d.clear(),navigator.mediaDevices.getUserMedia({audio:!0}).then(w=>{const T=new MediaRecorder(w,r);i("recording"),a.current=T,T.start(),d.start(),T.addEventListener("dataavailable",P=>{u(P.data),n==null||n(P.data),T.stream.getTracks().forEach(d0t),a.current=void 0})}).catch(w=>{Ve.log(w),l(!1)})},e[0]=n,e[1]=r,e[2]=d,e[3]=f):f=e[3];const h=Fn(f);let g;e[4]!==d?(g=()=>{var w;(w=a.current)==null||w.stop(),d.stop(),i("stopped")},e[4]=d,e[5]=g):g=e[5];const v=Fn(g);let b;e[6]!==d?(b=()=>{i(w=>{var T,P;return w==="recording"?((T=a.current)==null||T.pause(),d.stop(),"paused"):w==="paused"?((P=a.current)==null||P.resume(),d.start(),"recording"):w})},e[6]=d,e[7]=b):b=e[7];const p=Fn(b);let O;var k;let S;return e[8]!==d?(O=()=>{var w,T;(w=a.current)==null||w.stream.getTracks().forEach(u0t),(T=a.current)==null||T.stop(),d.stop()},e[8]=d,e[9]=O):O=e[9],k=O,_.useEffect(()=>k(),[]),e[10]!==s||e[11]!==p||e[12]!==c||e[13]!==o||e[14]!==h||e[15]!==v||e[16]!==d.time?(S={start:h,stop:v,pauseResume:p,allowed:s,recordingBlob:c,recordingStatus:o,recordingTime:d.time,mediaRecorder:a},e[10]=s,e[11]=p,e[12]=c,e[13]=o,e[14]=h,e[15]=v,e[16]=d.time,e[17]=S):S=e[17],S}function u0t(t){return t.stop()}function d0t(t){return t.stop()}const f0t=t=>{const e=ue.c(14),{setValue:n,data:r}=t;let o;e[0]!==n?(o={onDone:async g=>{const v=await DAe(g);n(v)}},e[0]=n,e[1]=o):o=e[1];const{start:i,stop:a,pauseResume:s,recordingStatus:l,recordingTime:c,allowed:u}=c0t(o);let d,f,h;return e[2]!==u?(d=!u&&y.jsx("div",{className:"text-destructive text-sm",children:"Microphone access is disabled. Please allow microphone access in your browser."}),e[2]=u,e[3]=d):d=e[3],e[4]!==s||e[5]!==l||e[6]!==c||e[7]!==i||e[8]!==a?(f=y.jsx(s0t,{onStart:i,onStop:a,onPause:s,status:l,time:c}),e[4]=s,e[5]=l,e[6]=c,e[7]=i,e[8]=a,e[9]=f):f=e[9],e[10]!==r.label||e[11]!==d||e[12]!==f?(h=y.jsxs(Jo,{label:r.label,align:"top",children:[d,f]}),e[10]=r.label,e[11]=d,e[12]=f,e[13]=h):h=e[13],h},h0t=t=>{const e=ue.c(23);let n=_.useId();const r=!t.debounce;let o,i;e[0]!==t?(o=k=>{t.setValue(k)},e[0]=t,e[1]=o):o=e[1],e[2]!==t.value||e[3]!==r||e[4]!==o?(i={initialValue:t.value,delay:200,disabled:r,onChange:o},e[2]=t.value,e[3]=r,e[4]=o,e[5]=i):i=e[5];const{value:a,onChange:s}=xS(i),l=t.label,c=n,u=t.fullWidth,d=t.fullWidth&&"w-full";let f;e[6]!==d?(f=we("min-w-[3em]",d),e[6]=d,e[7]=f):f=e[7];const h=t.start??void 0,g=t.stop??void 0,v=a??void 0,b=t.label||"Number input";let p,O;return e[8]!==n||e[9]!==s||e[10]!==t.disabled||e[11]!==t.step||e[12]!==v||e[13]!==b||e[14]!==f||e[15]!==h||e[16]!==g?(p=y.jsx(Yh,{"data-testid":"marimo-plugin-number-input",className:f,minValue:h,maxValue:g,value:v,step:t.step,onChange:s,id:n,"aria-label":b,isDisabled:t.disabled}),e[8]=n,e[9]=s,e[10]=t.disabled,e[11]=t.step,e[12]=v,e[13]=b,e[14]=f,e[15]=h,e[16]=g,e[17]=p):p=e[17],e[18]!==n||e[19]!==t.fullWidth||e[20]!==t.label||e[21]!==p?(O=y.jsx(Jo,{label:l,id:c,fullWidth:u,children:p}),e[18]=n,e[19]=t.fullWidth,e[20]=t.label,e[21]=p,e[22]=O):O=e[22],O};jLe=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return _.useMemo(()=>r=>{e.forEach(o=>o(r))},e)},TK=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,DT=function(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"},GM=function(t){return"nodeType"in t},yy=function(t){var e,n;return t?DT(t)?t:GM(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window},PK=function(t){const{Document:e}=yy(t);return t instanceof e},wK=function(t){return!DT(t)&&t instanceof yy(t).HTMLElement},IK=function(t){return t instanceof yy(t).SVGElement},mLe=function(t){return t?DT(t)?t.document:GM(t)?PK(t)?t:wK(t)||IK(t)?t.ownerDocument:document:document:document},UM=TK?_.useLayoutEffect:_.useEffect,ZM=function(t){const e=_.useRef(t);return UM(()=>{e.current=t}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])},ELe=function(){const t=_.useRef(null);return[_.useCallback((n,r)=>{t.current=setInterval(n,r)},[]),_.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[])]},hLe=function(t,e){e===void 0&&(e=[t]);const n=_.useRef(t);return UM(()=>{n.current!==t&&(n.current=t)},e),n},PLe=function(t,e){const n=_.useRef();return _.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])},pLe=function(t){const e=ZM(t),n=_.useRef(null),r=_.useCallback(o=>{o!==n.current&&(e==null||e(o,n.current)),n.current=o},[]);return[n,r]},rQe=function(t){const e=_.useRef();return _.useEffect(()=>{e.current=t},[t]),e.current};let xZ={};fLe=function(t,e){return _.useMemo(()=>{if(e)return e;const n=xZ[t]==null?0:xZ[t]+1;return xZ[t]=n,t+"-"+n},[t,e])};function MAe(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,a)=>{const s=Object.entries(a);for(const[l,c]of s){const u=i[l];u!=null&&(i[l]=u+t*c)}return i},{...e})}}yLe=MAe(1),vLe=MAe(-1),gLe=function(t){if(!t)return!1;const{KeyboardEvent:e}=yy(t.target);return e&&t instanceof e},bLe=function(t){if(function(e){if(!e)return!1;const{TouchEvent:n}=yy(e.target);return n&&e instanceof n}(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(t)?{x:t.clientX,y:t.clientY}:null};let OZ;KM=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[KM.Translate.toString(t),KM.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),OZ="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]",RLe=function(t){return t.matches(OZ)?t:t.querySelector(OZ)};const p0t=Qe({content:or([Qe({type:Jr("ACK")}),Pe()]).nullable()});function uD(t,e){if(Array.isArray(t))return t.map(n=>uD(n,e));if(t instanceof Map){const n={};for(const[r,o]of t.entries())n[String(r)]=uD(o,e);return n}if(typeof t=="object"&&t!==null&&"to_base64"in t&&typeof t.to_base64=="function"){const n=e.length;return e.push(t.to_base64()),{id:n}}if(typeof t=="object"&&t!==null){const n={};for(const r of Object.keys(t))n[r]=uD(t[r],e);return n}return t}class m0t{constructor(e,n=200){this.processEvents=e,this.blockDuration=n,this.buffer=[],this.isBlocked=!1,this.timeout=null}add(e){this.buffer.push(e),this.flush()}flush(){this.isBlocked||(this.processEvents(),this.block())}block(){this.isBlocked=!0,this.timeout!==null&&clearTimeout(this.timeout),this.timeout=window.setTimeout(()=>{this.isBlocked=!1,this.buffer.length>0&&this.flush()},this.blockDuration)}size(){return this.buffer.length}clear(){this.buffer=[]}getAndClear(){const e=[...this.buffer];return this.clear(),e}}const g0t=lu("marimo-panel").withData(Qe({extension:Pe().nullable(),docs_json:ds(lp()),render_json:Qe({roots:ds(Pe())}).catchall(lp())})).withFunctions({send_to_widget:_i.input(Qe({message:lp(),buffers:Wt(Pe())})).output(fp().optional())}).renderer(t=>y.jsx(v0t,{...t}));function NAe(){return window.Bokeh!=null}const v0t=t=>{const e=ue.c(23),{data:n,functions:r,host:o}=t,{extension:i,docs_json:a,render_json:s}=n,l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),[d,f]=_.useState(!1),[h,g]=_.useState(null),v=ZM(()=>{if(!p.current||!c.current)return;const D=p.current.getAndClear(),N=c.current.create_json_patch(D),E={...window.Bokeh.protocol.Message.create("PATCH-DOC",{},N)},A=[];E.content=uD(E.content,A),r.send_to_widget({message:E,buffers:A})});let b;e[0]!==v?(b=new m0t(v),e[0]=v,e[1]=b):b=e[1];const p=_.useRef(b);let O,k,S,w,T,P,j;return e[2]!==i?(O=()=>{if(NAe())return void f(!0);if(i){const N=document.createElement("script");N.innerHTML=i,document.head.append(N)}const D=setInterval(()=>{NAe()&&(f(!0),clearInterval(D))},10);return()=>clearInterval(D)},k=[i,f],e[2]=i,e[3]=O,e[4]=k):(O=e[3],k=e[4]),_.useEffect(O,k),e[5]!==p||e[6]!==v?(S=D=>{if(D.detail.message==null)return;const N=p0t.parse(D.detail.message),E=D.detail.buffers,A=u.current,I=c.current;if(!A||!I)return;const L=N.content;if(L!==null&&typeof N.content!="string")return void(p.current&&p.current.size()>0&&v());if(E&&E.length>0){const Q=E[0];Q instanceof ArrayBuffer?A.consume(Q):Q.buffer instanceof ArrayBuffer&&A.consume(Q.buffer)}else{if(!L||typeof L!="string")return;A.consume(L)}const F=A.message;F!=null&&Object.keys(F.content).length>0&&(F.content.events!==void 0&&(F.content.events=F.content.events.filter(Q=>I._all_models.has(Q.model.id))),I.apply_json_patch(F.content,F.buffers))},e[5]=p,e[6]=v,e[7]=S):S=e[7],Wh(o,LE.TYPE,S),e[8]!==a||e[9]!==p||e[10]!==d||e[11]!==s||e[12]!==h?(w=()=>{const D=Object.keys(a)[0];!d||h===D||(async()=>{const N={...s,roots:{}};for(const A of Object.keys(s.roots)){const I=s.roots[A];if(l.current){const L=l.current.querySelector(`#${I}`);N.roots[A]=L}}const E=Object.keys(N.roots)[0];await window.Bokeh.embed.embed_items_notebook(a,[N]),c.current=window.Bokeh.index.get_by_id(E).model.document,u.current=new window.Bokeh.protocol.Receiver,c.current.on_change(A=>{var I;return(I=p.current)==null?void 0:I.add(A)}),g(D)})()},e[8]=a,e[9]=p,e[10]=d,e[11]=s,e[12]=h,e[13]=w):w=e[13],e[14]!==a||e[15]!==d||e[16]!==s||e[17]!==h?(T=[a,d,s,h],e[14]=a,e[15]=d,e[16]=s,e[17]=h,e[18]=T):T=e[18],_.useEffect(w,T),e[19]!==s.roots?(P=Object.values(s.roots).map(y0t),e[19]=s.roots,e[20]=P):P=e[20],e[21]!==P?(j=y.jsx("div",{ref:l,children:P}),e[21]=P,e[22]=j):j=e[22],j};function y0t(t){return y.jsx("div",{id:t,children:y.jsx("div",{"data-root-id":t,style:{display:"contents"}})},t)}const b0t={removeOnUnmount:!1};function $Ae(t){const e=/(\w+)=%{([^}]+)}/g,n={};let r;for(;(r=e.exec(t))!==null;)n[r[1]]=r[2];return{update(o){return o===t?this:$Ae(o)},parse:o=>Object.entries(n).reduce((i,[a,s])=>(i[a]=eM(o,s),i),{})}}const x0t=_.lazy(()=>Be(()=>import("./react-plotly-BfQN4uRZ.js").then(t=>t.r),[],import.meta.url));function wZ(t){return{autosize:t.layout.width===void 0,dragmode:"select",height:540,...t.layout}}const IAe=["color","curveNumber","entry","hovertext","id","label","parent","percentEntry","percentParent","percentRoot","pointNumber","root","value"],O0t=IAe,QAe=_.memo(t=>{const e=ue.c(46),{figure:n,value:r,setValue:o,config:i}=t;let a;e[0]!==n?(a=()=>structuredClone(n),e[0]=n,e[1]=a):a=e[1];const[s,l]=_.useState(a),c=function(re){const Z=ue.c(6),K=b0t;let oe;Z[0]!==re?(oe=()=>{const ce=document.querySelector(`script[src="${re}"]`);return(ce==null?void 0:ce.dataset.status)||"unknown"},Z[0]=re,Z[1]=oe):oe=Z[1];const[ie,Y]=ge.useState(oe);let le,me;return Z[2]!==K.removeOnUnmount||Z[3]!==re?(le=()=>{let ce=document.querySelector(`script[src="${re}"]`);const ve=je=>{ce&&(ce.dataset.status=je,Y(je))},ye=()=>ve("ready"),_e=()=>ve("error"),Se=je=>{const Ie=new MutationObserver(()=>{const De=je.dataset.status;De&&Y(De)});return Ie.observe(je,{attributes:!0,attributeFilter:["data-status"]}),Ie};if(!ce){ce=document.createElement("script"),ce.src=re,ce.async=!0,ve("loading"),document.body.append(ce),ce.addEventListener("load",ye),ce.addEventListener("error",_e);const je=Se(ce);return()=>{je.disconnect(),ce&&(ce.removeEventListener("load",ye),ce.removeEventListener("error",_e),K.removeOnUnmount&&ce.remove())}}const Ae=ce.dataset.status;if(Ae){if(Ae==="ready"||Ae==="error")return;const je=Se(ce);return()=>je.disconnect()}Y("unknown")},me=[re,K.removeOnUnmount],Z[2]=K.removeOnUnmount,Z[3]=re,Z[4]=le,Z[5]=me):(le=Z[4],me=Z[5]),ge.useEffect(le,me),ie}("https://cdn.jsdelivr.net/npm/mathjax-full@3.2.2/es5/tex-mml-svg.min.js"),u=c==="ready";let d,f;e[2]!==u||e[3]!==n?(d=[n,u],e[2]=u,e[3]=n,e[4]=d):d=e[4],_.useEffect(()=>{const re=structuredClone(n);l(re),v(Z=>({...wZ(re),...Z}))},d),e[5]!==s||e[6]!==r?(f=()=>({...wZ(s),...r}),e[5]=s,e[6]=r,e[7]=f):f=e[7];const[h,g]=_.useState(f),v=g;let b;e[8]!==n||e[9]!==v||e[10]!==o?(b=()=>{const re=structuredClone(n);l(re),v(wZ(re)),o({})},e[8]=n,e[9]=v,e[10]=o,e[11]=b):b=e[11];const p=Fn(b),O=Gd(i);let k,S,w,T;e[12]===Symbol.for("react.memo_cache_sentinel")?(S={svg:`
|
497
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function PAe(t,e){if(t){if(typeof t=="string")return mZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mZ(t,e):void 0}}function mZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function EAe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function qo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?EAe(Object(n),!0).forEach(function(r){gZ(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):EAe(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function gZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cD(t,e){if(t==null)return{};var n,r,o=function(a,s){if(a==null)return{};var l,c,u={},d=Object.keys(a);for(c=0;c<d.length;c++)l=d[c],s.indexOf(l)>=0||(u[l]=a[l]);return u}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var vZ=_.forwardRef(function(t,e){var n=t.children,r=AN(cD(t,Wgt)),o=r.open,i=cD(r,Ugt);return _.useImperativeHandle(e,function(){return{open:o}},[o]),ge.createElement(_.Fragment,null,n(qo(qo({},i),{},{open:o})))});vZ.displayName="Dropzone";var RAe={disabled:!1,getFilesFromEvent:function(t){return Zg(this,void 0,void 0,function*(){return aD(t)&&aD(t.dataTransfer)?function(e,n){return Zg(this,void 0,void 0,function*(){if(e.items){const r=uZ(e.items).filter(o=>o.kind==="file");return n!=="drop"?r:dAe(fAe(yield Promise.all(r.map(zgt))))}return dAe(uZ(e.files).map(r=>ax(r)))})}(t.dataTransfer,t.type):function(e){return aD(e)&&aD(e.target)}(t)?function(e){return uZ(e.target.files).map(n=>ax(n))}(t):Array.isArray(t)&&t.every(e=>"getFile"in e&&typeof e.getFile=="function")?function(e){return Zg(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>ax(n))})}(t):[]})},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};vZ.defaultProps=RAe,vZ.propTypes={children:Fr.func,accept:Fr.objectOf(Fr.arrayOf(Fr.string)),multiple:Fr.bool,preventDropOnDocument:Fr.bool,noClick:Fr.bool,noKeyboard:Fr.bool,noDrag:Fr.bool,noDragEventsBubbling:Fr.bool,minSize:Fr.number,maxSize:Fr.number,maxFiles:Fr.number,disabled:Fr.bool,getFilesFromEvent:Fr.func,onFileDialogCancel:Fr.func,onFileDialogOpen:Fr.func,useFsAccessApi:Fr.bool,autoFocus:Fr.bool,onDragEnter:Fr.func,onDragLeave:Fr.func,onDragOver:Fr.func,onDrop:Fr.func,onDropAccepted:Fr.func,onDropRejected:Fr.func,onError:Fr.func,validator:Fr.func};var yZ={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};AN=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=qo(qo({},RAe),t),n=e.accept,r=e.disabled,o=e.getFilesFromEvent,i=e.maxSize,a=e.minSize,s=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,f=e.onDrop,h=e.onDropAccepted,g=e.onDropRejected,v=e.onFileDialogCancel,b=e.onFileDialogOpen,p=e.useFsAccessApi,O=e.autoFocus,k=e.preventDropOnDocument,S=e.noClick,w=e.noKeyboard,T=e.noDrag,P=e.noDragEventsBubbling,j=e.onError,D=e.validator,N=_.useMemo(function(){return function(Re){if(mv(Re))return Object.entries(Re).reduce(function(ot,Me){var We=LC(Me,2),it=We[0],Ue=We[1];return[].concat(gAe(ot),[it],gAe(Ue))},[]).filter(function(ot){return _Ae(ot)||TAe(ot)}).join(",")}(n)},[n]),E=_.useMemo(function(){return function(Re){return mv(Re)?[{description:"Files",accept:Object.entries(Re).filter(function(ot){var Me=LC(ot,2),We=Me[0],it=Me[1],Ue=!0;return _Ae(We)||(console.warn('Skipped "'.concat(We,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),Ue=!1),Array.isArray(it)&&it.every(TAe)||(console.warn('Skipped "'.concat(We,'" because an invalid file extension was provided.')),Ue=!1),Ue}).reduce(function(ot,Me){var We=LC(Me,2),it=We[0],Ue=We[1];return yAe(yAe({},ot),{},bAe({},it,Ue))},{})}]:Re}(n)},[n]),A=_.useMemo(function(){return typeof b=="function"?b:jAe},[b]),I=_.useMemo(function(){return typeof v=="function"?v:jAe},[v]),L=_.useRef(null),F=_.useRef(null),Q=pZ(_.useReducer(Ygt,yZ),2),W=Q[0],U=Q[1],X=W.isFocused,G=W.isFileDialogActive,ae=_.useRef(typeof window<"u"&&window.isSecureContext&&p&&"showOpenFilePicker"in window),ne=function(){!ae.current&&G&&setTimeout(function(){F.current&&(F.current.files.length||(U({type:"closeDialog"}),I()))},300)};_.useEffect(function(){return window.addEventListener("focus",ne,!1),function(){window.removeEventListener("focus",ne,!1)}},[F,G,I,ae]);var re=_.useRef([]),Z=function(Re){L.current&&L.current.contains(Re.target)||(Re.preventDefault(),re.current=[])};_.useEffect(function(){return k&&(document.addEventListener("dragover",CAe,!1),document.addEventListener("drop",Z,!1)),function(){k&&(document.removeEventListener("dragover",CAe),document.removeEventListener("drop",Z))}},[L,k]),_.useEffect(function(){return!r&&O&&L.current&&L.current.focus(),function(){}},[L,O,r]);var K=_.useCallback(function(Re){j?j(Re):console.error(Re)},[j]),oe=_.useCallback(function(Re){Re.preventDefault(),Re.persist(),De(Re),re.current=[].concat(Hgt(re.current),[Re.target]),lD(Re)&&Promise.resolve(o(Re)).then(function(ot){if(!sD(Re)||P){var Me=ot.length,We=Me>0&&function(it){var Ue=it.files,gt=it.accept,Tt=it.minSize,Kt=it.maxSize,Sn=it.multiple,Jt=it.maxFiles,sn=it.validator;return!(!Sn&&Ue.length>1||Sn&&Jt>=1&&Ue.length>Jt)&&Ue.every(function(jn){var Zr=LC(kAe(jn,gt),1)[0],Nr=LC(SAe(jn,Tt,Kt),1)[0],go=sn?sn(jn):null;return Zr&&Nr&&!go})}({files:ot,accept:N,minSize:a,maxSize:i,multiple:s,maxFiles:l,validator:D});U({isDragAccept:We,isDragReject:Me>0&&!We,isDragActive:!0,type:"setDraggedFiles"}),c&&c(Re)}}).catch(function(ot){return K(ot)})},[o,c,K,P,N,a,i,s,l,D]),ie=_.useCallback(function(Re){Re.preventDefault(),Re.persist(),De(Re);var ot=lD(Re);if(ot&&Re.dataTransfer)try{Re.dataTransfer.dropEffect="copy"}catch{}return ot&&d&&d(Re),!1},[d,P]),Y=_.useCallback(function(Re){Re.preventDefault(),Re.persist(),De(Re);var ot=re.current.filter(function(We){return L.current&&L.current.contains(We)}),Me=ot.indexOf(Re.target);Me!==-1&&ot.splice(Me,1),re.current=ot,ot.length>0||(U({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),lD(Re)&&u&&u(Re))},[L,u,P]),le=_.useCallback(function(Re,ot){var Me=[],We=[];Re.forEach(function(it){var Ue=pZ(kAe(it,N),2),gt=Ue[0],Tt=Ue[1],Kt=pZ(SAe(it,a,i),2),Sn=Kt[0],Jt=Kt[1],sn=D?D(it):null;if(gt&&Sn&&!sn)Me.push(it);else{var jn=[Tt,Jt];sn&&(jn=jn.concat(sn)),We.push({file:it,errors:jn.filter(function(Zr){return Zr})})}}),(!s&&Me.length>1||s&&l>=1&&Me.length>l)&&(Me.forEach(function(it){We.push({file:it,errors:[Bgt]})}),Me.splice(0)),U({acceptedFiles:Me,fileRejections:We,isDragReject:We.length>0,type:"setFiles"}),f&&f(Me,We,ot),We.length>0&&g&&g(We,ot),Me.length>0&&h&&h(Me,ot)},[U,s,N,a,i,l,f,h,g,D]),me=_.useCallback(function(Re){Re.preventDefault(),Re.persist(),De(Re),re.current=[],lD(Re)&&Promise.resolve(o(Re)).then(function(ot){sD(Re)&&!P||le(ot,Re)}).catch(function(ot){return K(ot)}),U({type:"reset"})},[o,le,K,P]),ce=_.useCallback(function(){if(ae.current){U({type:"openDialog"}),A();var Re={multiple:s,types:E};window.showOpenFilePicker(Re).then(function(ot){return o(ot)}).then(function(ot){le(ot,null),U({type:"closeDialog"})}).catch(function(ot){var Me;(Me=ot)instanceof DOMException&&(Me.name==="AbortError"||Me.code===Me.ABORT_ERR)?(I(ot),U({type:"closeDialog"})):function(We){return We instanceof DOMException&&(We.name==="SecurityError"||We.code===We.SECURITY_ERR)}(ot)?(ae.current=!1,F.current?(F.current.value=null,F.current.click()):K(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):K(ot)})}else F.current&&(U({type:"openDialog"}),A(),F.current.value=null,F.current.click())},[U,A,I,p,le,K,E,s]),ve=_.useCallback(function(Re){L.current&&L.current.isEqualNode(Re.target)&&(Re.key!==" "&&Re.key!=="Enter"&&Re.keyCode!==32&&Re.keyCode!==13||(Re.preventDefault(),ce()))},[L,ce]),ye=_.useCallback(function(){U({type:"focus"})},[]),_e=_.useCallback(function(){U({type:"blur"})},[]),Se=_.useCallback(function(){S||(function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return function(ot){return ot.indexOf("MSIE")!==-1||ot.indexOf("Trident/")!==-1}(Re)||function(ot){return ot.indexOf("Edge/")!==-1}(Re)}()?setTimeout(ce,0):ce())},[S,ce]),Ae=function(Re){return r?null:Re},je=function(Re){return w?null:Ae(Re)},Ie=function(Re){return T?null:Ae(Re)},De=function(Re){P&&Re.stopPropagation()},nt=_.useMemo(function(){return function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ot=Re.refKey,Me=ot===void 0?"ref":ot,We=Re.role,it=Re.onKeyDown,Ue=Re.onFocus,gt=Re.onBlur,Tt=Re.onClick,Kt=Re.onDragEnter,Sn=Re.onDragOver,Jt=Re.onDragLeave,sn=Re.onDrop,jn=cD(Re,Zgt);return qo(qo(gZ({onKeyDown:je(zd(it,ve)),onFocus:je(zd(Ue,ye)),onBlur:je(zd(gt,_e)),onClick:Ae(zd(Tt,Se)),onDragEnter:Ie(zd(Kt,oe)),onDragOver:Ie(zd(Sn,ie)),onDragLeave:Ie(zd(Jt,Y)),onDrop:Ie(zd(sn,me)),role:typeof We=="string"&&We!==""?We:"presentation"},Me,L),r||w?{}:{tabIndex:0}),jn)}},[L,ve,ye,_e,Se,oe,ie,Y,me,w,T,r]),Fe=_.useCallback(function(Re){Re.stopPropagation()},[]),kt=_.useMemo(function(){return function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ot=Re.refKey,Me=ot===void 0?"ref":ot,We=Re.onChange,it=Re.onClick,Ue=cD(Re,Xgt);return qo(qo({},gZ({accept:N,multiple:s,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Ae(zd(We,me)),onClick:Ae(zd(it,Fe)),tabIndex:-1},Me,F)),Ue)}},[F,n,s,me,r]);return qo(qo({},W),{},{isFocused:X&&!r,getRootProps:nt,getInputProps:kt,rootRef:L,inputRef:F,open:Ae(ce)})};function Ygt(t,e){switch(e.type){case"focus":return qo(qo({},t),{},{isFocused:!0});case"blur":return qo(qo({},t),{},{isFocused:!1});case"openDialog":return qo(qo({},yZ),{},{isFileDialogActive:!0});case"closeDialog":return qo(qo({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return qo(qo({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return qo(qo({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return qo({},yZ);default:return t}}function jAe(){}function DAe(t){return new Promise(e=>{const n=new FileReader;n.readAsDataURL(t),n.onload=r=>{var o;if((o=r.target)!=null&&o.result){const i=r.target.result,a=i.slice(i.indexOf(",")+1);e(a)}}})}const Ggt=t=>{const e=ue.c(78);let n;e[0]!==t.filetypes?(n=function(K){const oe={},ie=(Y,le)=>{Object.hasOwn(oe,Y)?oe[Y].push(le):oe[Y]=[le]};return K.forEach(Y=>{switch(Y){case".png":case".jpg":case".jpeg":case".gif":case".avif":case".bmp":case".ico":case".svg":case".tiff":case".webp":ie("image/*",Y);break;case".avi":case".mp4":case".mpeg":case".ogg":case".webm":ie("video/*",Y);break;case".pdf":ie("application/pdf",Y);break;case".csv":ie("text/csv",Y);break;default:ie("text/plain",Y)}}),oe}(t.filetypes),e[0]=t.filetypes,e[1]=n):n=e[1];const r=n,{setValue:o,kind:i,multiple:a,value:s,max_size:l}=t;let c,u;e[2]!==o?(c=K=>{var oe;(oe=K,Promise.all(oe.map(ie=>DAe(ie).then(Y=>[ie.name,Y])))).then(ie=>{o(ie)}).catch(n0t)},e[2]=o,e[3]=c):c=e[3],e[4]!==r||e[5]!==l||e[6]!==a||e[7]!==c?(u={accept:r,multiple:a,maxSize:l,onError:Kgt,onDropRejected:t0t,onDrop:c},e[4]=r,e[5]=l,e[6]=a,e[7]=c,e[8]=u):u=e[8];const{getRootProps:d,getInputProps:f,isFocused:h,isDragAccept:g,isDragReject:v}=AN(u);let b,p;e[9]!==s?(b=s.map(r0t),e[9]=s,e[10]=b):b=e[10],e[11]!==b?(p=y.jsx("ul",{children:b}),e[11]=b,e[12]=p):p=e[12];const O=p,k=s.length>0;if(i==="button"){const K=t.label??"Upload";let oe,ie,Y,le,me,ce,ve,ye,_e;return e[13]!==d?(oe=d({}),e[13]=d,e[14]=oe):oe=e[14],e[15]===Symbol.for("react.memo_cache_sentinel")?(ie=fs({variant:"secondary",size:"xs"}),e[15]=ie):ie=e[15],e[16]!==K?(Y=Br({html:K}),e[16]=K,e[17]=Y):Y=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(le=y.jsx(MN,{size:14,className:"ml-2"}),e[18]=le):le=e[18],e[19]!==oe||e[20]!==ie||e[21]!==Y?(me=y.jsxs("button",{"data-testid":"marimo-plugin-file-upload-button",...oe,className:ie,children:[Y,le]}),e[19]=oe,e[20]=ie,e[21]=Y,e[22]=me):me=e[22],e[23]!==f?(ce=f({}),e[23]=f,e[24]=ce):ce=e[24],e[25]!==ce?(ve=y.jsx("input",{...ce,type:"file"}),e[25]=ce,e[26]=ve):ve=e[26],e[27]!==o||e[28]!==k||e[29]!==O||e[30]!==s.length?(ye=k?y.jsxs(y.Fragment,{children:[y.jsx(qn,{content:O,children:y.jsxs("span",{className:"text-xs text-muted-foreground",children:["Uploaded"," ",y.jsxs("span",{className:"underline cursor-pointer",children:[s.length," ",s.length===1?"file":"files","."]})]})}),y.jsx("button",{className:we("text-xs cursor-pointer text-destructive hover:underline"),onClick:()=>o([]),type:"button",children:"Click to clear files."})]}):null,e[27]=o,e[28]=k,e[29]=O,e[30]=s.length,e[31]=ye):ye=e[31],e[32]!==ve||e[33]!==ye||e[34]!==me?(_e=y.jsx(za,{children:y.jsxs("div",{className:"flex flex-row items-center justify-start gap-2",children:[me,ve,ye]})}),e[32]=ve,e[33]=ye,e[34]=me,e[35]=_e):_e=e[35],_e}const S=t.label??`Drag and drop ${a?"files":"a file"} here, or click to open file browser`,w=!h&&"border-input/60 border-dashed",T=h&&"border-solid";let P,j,D,N,E;e[36]!==w||e[37]!==T?(P=we("hover:text-primary","mt-3 mb-2 w-full flex flex-col items-center justify-center ","px-6 py-6 sm:px-8 sm:py-8 md:py-10 md:px-16","border rounded-sm","text-sm text-muted-foreground","hover:cursor-pointer","active:shadow-xsSolid","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent",w,T),e[36]=w,e[37]=T,e[38]=P):P=e[38],e[39]!==d?(j=d(),e[39]=d,e[40]=j):j=e[40],e[41]!==f?(D=f(),e[41]=f,e[42]=D):D=e[42],e[43]!==D?(N=y.jsx("input",{...D}),e[43]=D,e[44]=N):N=e[44],e[45]!==S||e[46]!==k?(E=k?y.jsxs("span",{children:["To re-upload: ",Br({html:S})]}):y.jsx("span",{className:"mt-0",children:Br({html:S})}),e[45]=S,e[46]=k,e[47]=E):E=e[47];const A=g&&"text-primary",I=v&&"text-destructive";let L,F;e[48]!==A||e[49]!==I?(L=we(A,I),e[48]=A,e[49]=I,e[50]=L):L=e[50],e[51]!==L?(F=y.jsx(MN,{strokeWidth:1.4,className:L}),e[51]=L,e[52]=F):F=e[52];const Q=g&&"text-primary",W=v&&"text-destructive";let U,X,G,ae,ne,re,Z;return e[53]!==Q||e[54]!==W?(U=we(Q,W),e[53]=Q,e[54]=W,e[55]=U):U=e[55],e[56]!==U?(X=y.jsx(R6,{strokeWidth:1.4,className:U}),e[56]=U,e[57]=X):X=e[57],e[58]!==F||e[59]!==X?(G=y.jsxs("div",{className:"flex flex-row items-center justify-center flex-grow gap-3",children:[F,X]}),e[58]=F,e[59]=X,e[60]=G):G=e[60],e[61]!==E||e[62]!==G?(ae=y.jsxs("div",{className:"flex flex-col items-center justify-center flex-grow gap-3",children:[E,G]}),e[61]=E,e[62]=G,e[63]=ae):ae=e[63],e[64]!==N||e[65]!==ae||e[66]!==P||e[67]!==j?(ne=y.jsxs("div",{className:P,...j,children:[N,ae]}),e[64]=N,e[65]=ae,e[66]=P,e[67]=j,e[68]=ne):ne=e[68],e[69]!==a||e[70]!==o||e[71]!==k||e[72]!==O||e[73]!==s.length?(re=k?y.jsxs("div",{className:"flex flex-row gap-1",children:[y.jsx("div",{className:"text-xs text-muted-foreground",children:y.jsxs(za,{children:["Uploaded"," ",y.jsx(qn,{content:O,children:y.jsxs("span",{className:"underline cursor-pointer",children:[s.length," ",s.length===1?"file":"files","."]})})]})}),y.jsx("span",{className:"text-xs text-destructive hover:underline hover:cursor-pointer",children:y.jsxs("button",{className:we("text-destructive","hover:underline"),onClick:()=>o([]),type:"button",children:["Click to clear ",a?"files":"file","."]})})]}):null,e[69]=a,e[70]=o,e[71]=k,e[72]=O,e[73]=s.length,e[74]=re):re=e[74],e[75]!==ne||e[76]!==re?(Z=y.jsx("section",{children:y.jsxs("div",{className:"flex flex-col items-start justify-start flex-grow gap-3",children:[ne,re]})}),e[75]=ne,e[76]=re,e[77]=Z):Z=e[77],Z};function Kgt(t){Ve.error(t),Kr({title:"File upload failed",description:t.message,variant:"danger"})}function Jgt(t){return t.message}function e0t(t){return y.jsxs("div",{children:[t.file.name," (",t.errors.map(Jgt).join(", "),")"]},t.file.name)}function t0t(t){Kr({title:"File upload failed",description:y.jsx("div",{className:"flex flex-col gap-1",children:t.map(e0t)}),variant:"danger"})}function n0t(t){Ve.error(t),Kr({title:"File upload failed",description:"Failed to convert file to base64.",variant:"danger"})}function r0t(t){const[e]=t;return y.jsx("li",{children:e},e)}const o0t=lu("marimo-form").withData(Qe({label:Pe().nullable(),elementId:Pe(),bordered:pt().default(!0),loading:pt().default(!1),submitButtonLabel:Pe().default("Submit"),submitButtonTooltip:Pe().optional(),submitButtonDisabled:pt().default(!1),clearOnSubmit:pt().default(!1),showClearButton:pt().default(!1),clearButtonLabel:Pe().default("Clear"),clearButtonTooltip:Pe().optional(),shouldValidate:pt().optional()})).withFunctions({validate:_i.input(Qe({value:lp()})).output(Pe().nullish())}).renderer(({data:t,functions:e,...n})=>y.jsx(za,{children:y.jsx(a0t,{...t,...n,...e})})),i0t=t=>{const e=ue.c(46),{children:n,currentValue:r,newValue:o,setValue:i,label:a,bordered:s,loading:l,submitButtonLabel:c,submitButtonTooltip:u,submitButtonDisabled:d,clearOnSubmit:f,showClearButton:h,clearButtonLabel:g,clearButtonTooltip:v,validate:b,shouldValidate:p}=t,O=_.useRef(null),k=o===r,S=k?"secondary":"action",[w,T]=_.useState(null);let P;e[0]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{O.current&&bZ(O.current)},e[0]=P):P=e[0];const j=P;let D;e[1]!==f||e[2]!==o||e[3]!==i||e[4]!==p||e[5]!==b?(D=async Z=>{if(Z.preventDefault(),p){const K=await b({value:o}).catch(oe=>{T(oe.message??"Error validating")});if(K!=null)return void T(K)}T(null),i(o),f&&j()},e[1]=f,e[2]=o,e[3]=i,e[4]=p,e[5]=b,e[6]=D):D=e[6];const N=!k&&s;let E,A,I,L,F,Q;e[7]!==s||e[8]!==N?(E=we("flex flex-col gap-4 rounded-lg py-4 px-8",{"bg-[var(--gray-1)] shadow-md border border-input":s,"bg-[var(--amber-1)] border-[var(--amber-7)]":N}),e[7]=s,e[8]=N,e[9]=E):E=e[9],e[10]!==o||e[11]!==i?(A=Z=>{Z.key==="Enter"&&(Z.ctrlKey||Z.metaKey)&&(Z.preventDefault(),Z.stopPropagation(),i(o))},e[10]=o,e[11]=i,e[12]=A):A=e[12],e[13]!==a?(I=a===null?null:y.jsx("div",{className:"text-center",children:Br({html:a})}),e[13]=a,e[14]=I):I=e[14],e[15]!==w?(L=w!=null&&y.jsx(Km,{kind:"danger",className:"rounded",children:w??"Invalid input"}),e[15]=w,e[16]=L):L=e[16],e[17]!==n?(F=y.jsx("div",{children:n}),e[17]=n,e[18]=F):F=e[18],e[19]!==g||e[20]!==v||e[21]!==h?(Q=h&&AAe(y.jsx(Ft,{"data-testid":"marimo-plugin-form-clear-button",variant:"text",onClick:Z=>{Z.preventDefault(),j()},children:g}),v),e[19]=g,e[20]=v,e[21]=h,e[22]=Q):Q=e[22];const W=d||l;let U,X,G,ae,ne,re;return e[23]!==l?(U=l&&y.jsx(af,{className:"h-4 w-4 mr-2 animate-spin"}),e[23]=l,e[24]=U):U=e[24],e[25]!==c||e[26]!==W||e[27]!==U||e[28]!==S?(X=y.jsxs(Ft,{"data-testid":"marimo-plugin-form-submit-button",variant:S,disabled:W,type:"submit",children:[U,c]}),e[25]=c,e[26]=W,e[27]=U,e[28]=S,e[29]=X):X=e[29],e[30]!==u||e[31]!==X?(G=AAe(X,u),e[30]=u,e[31]=X,e[32]=G):G=e[32],e[33]!==G||e[34]!==Q?(ae=y.jsxs("div",{className:"flex justify-end gap-2 font-code",children:[Q,G]}),e[33]=G,e[34]=Q,e[35]=ae):ae=e[35],e[36]!==ae||e[37]!==E||e[38]!==A||e[39]!==I||e[40]!==L||e[41]!==F?(ne=y.jsxs("div",{className:E,onKeyDown:A,children:[I,L,F,ae]}),e[36]=ae,e[37]=E,e[38]=A,e[39]=I,e[40]=L,e[41]=F,e[42]=ne):ne=e[42],e[43]!==ne||e[44]!==D?(re=y.jsx("form",{className:"contents",ref:O,onSubmit:D,children:ne}),e[43]=ne,e[44]=D,e[45]=re):re=e[45],re},a0t=t=>{const e=ue.c(24);let n,r,o,i,a,s,l;e[0]!==t?({elementId:o,value:s,setValue:i,children:n,validate:a,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i,e[5]=a,e[6]=s):(n=e[1],r=e[2],o=e[3],i=e[4],a=e[5],s=e[6]),e[7]!==o?(l=uf.lookupValue(o),e[7]=o,e[8]=l):l=e[8];const[c,u]=_.useState(l);let d,f;e[9]!==o?(d=()=>{u(uf.lookupValue(o))},f=[o],e[9]=o,e[10]=d,e[11]=f):(d=e[10],f=e[11]),_.useEffect(d,f);const h=uf.lookupValue(o);let g,v,b;return h!==c&&u(h),e[12]!==o?(g=()=>{const p=O=>{const k=O.detail.element;k===null||!(k instanceof Node)||YB(k)===o&&u(O.detail.value)};return document.addEventListener(Mp.TYPE,p),()=>{document.removeEventListener(Mp.TYPE,p)}},e[12]=o,e[13]=g):g=e[13],e[14]!==o||e[15]!==i?(v=[o,i],e[14]=o,e[15]=i,e[16]=v):v=e[16],_.useEffect(g,v),e[17]!==n||e[18]!==r||e[19]!==c||e[20]!==i||e[21]!==a||e[22]!==s?(b=y.jsx(i0t,{currentValue:s,newValue:c,setValue:i,validate:a,...r,children:n}),e[17]=n,e[18]=r,e[19]=c,e[20]=i,e[21]=a,e[22]=s,e[23]=b):b=e[23],b};function AAe(t,e){return e?y.jsx(qn,{content:e,children:t}):t}function bZ(t){t instanceof HTMLElement&&(t.shadowRoot&&[...t.shadowRoot.children].forEach(bZ),[...t.children].forEach(bZ),t.tagName===K5&&t.reset())}const s0t=t=>{const e=ue.c(12),{onStart:n,onStop:r,status:o,time:i}=t;let a,s,l,c;return e[0]!==n||e[1]!==o?(a=o==="stopped"&&y.jsx(Ft,{"data-testid":"audio-recorder-start",variant:"secondary",onClick:n,className:"w-[50px]",children:y.jsx(BO,{className:we("w-6 h-6 border border-input rounded-full"),strokeWidth:1.5,fill:"var(--red-9)"})}),e[0]=n,e[1]=o,e[2]=a):a=e[2],e[3]!==r||e[4]!==o?(s=o==="recording"&&y.jsxs(Ft,{"data-testid":"audio-recorder-pause",variant:"secondary",onClick:r,className:"w-[50px]",children:[y.jsx(SK,{className:"w-5 h-5 rounded-sm",fill:"var(--red-9)",strokeWidth:1.5}),y.jsx(BO,{className:we("w-6 h-6 absolute opacity-20 animate-ping"),fill:"var(--red-9)",style:{animationDuration:"1.5s"},strokeWidth:0})]}),e[3]=r,e[4]=o,e[5]=s):s=e[5],e[6]!==i?(l=i&&y.jsxs("span",{className:"text-sm font-bold",children:[i,"s"]}),e[6]=i,e[7]=l):l=e[7],e[8]!==a||e[9]!==s||e[10]!==l?(c=y.jsxs("div",{className:"flex items-center gap-3",children:[a,s,l]}),e[8]=a,e[9]=s,e[10]=l,e[11]=c):c=e[11],c};function l0t(t){return t+.1}function c0t(t){const e=ue.c(18),{onDone:n,options:r}=t,[o,i]=_.useState("stopped"),a=_.useRef(void 0),[s,l]=_.useState(!0),[c,u]=_.useState(),d=function(){const w=ue.c(12),[T,P]=_.useState(0),j=_.useRef(void 0);let D;w[0]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{j.current=window.setInterval(()=>{P(l0t)},100)},w[0]=D):D=w[0];const N=Fn(D);let E;w[1]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{j.current!=null&&(window.clearInterval(j.current),j.current=void 0)},w[1]=E):E=w[1];const A=Fn(E);let I;w[2]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{P(0)},w[2]=I):I=w[2];const L=Fn(I);let F,Q,W,U;return w[3]===Symbol.for("react.memo_cache_sentinel")?(F=()=>()=>{window.clearInterval(j.current)},Q=[],w[3]=F,w[4]=Q):(F=w[3],Q=w[4]),_.useEffect(F,Q),w[5]!==T?(W=new Intl.NumberFormat("en-US",{minimumFractionDigits:1,maximumFractionDigits:1}).format(T),w[5]=T,w[6]=W):W=w[6],w[7]!==L||w[8]!==N||w[9]!==A||w[10]!==W?(U={time:W,start:N,stop:A,clear:L},w[7]=L,w[8]=N,w[9]=A,w[10]=W,w[11]=U):U=w[11],U}();let f;e[0]!==n||e[1]!==r||e[2]!==d?(f=()=>{d.clear(),navigator.mediaDevices.getUserMedia({audio:!0}).then(w=>{const T=new MediaRecorder(w,r);i("recording"),a.current=T,T.start(),d.start(),T.addEventListener("dataavailable",P=>{u(P.data),n==null||n(P.data),T.stream.getTracks().forEach(d0t),a.current=void 0})}).catch(w=>{Ve.log(w),l(!1)})},e[0]=n,e[1]=r,e[2]=d,e[3]=f):f=e[3];const h=Fn(f);let g;e[4]!==d?(g=()=>{var w;(w=a.current)==null||w.stop(),d.stop(),i("stopped")},e[4]=d,e[5]=g):g=e[5];const v=Fn(g);let b;e[6]!==d?(b=()=>{i(w=>{var T,P;return w==="recording"?((T=a.current)==null||T.pause(),d.stop(),"paused"):w==="paused"?((P=a.current)==null||P.resume(),d.start(),"recording"):w})},e[6]=d,e[7]=b):b=e[7];const p=Fn(b);let O;var k;let S;return e[8]!==d?(O=()=>{var w,T;(w=a.current)==null||w.stream.getTracks().forEach(u0t),(T=a.current)==null||T.stop(),d.stop()},e[8]=d,e[9]=O):O=e[9],k=O,_.useEffect(()=>k(),[]),e[10]!==s||e[11]!==p||e[12]!==c||e[13]!==o||e[14]!==h||e[15]!==v||e[16]!==d.time?(S={start:h,stop:v,pauseResume:p,allowed:s,recordingBlob:c,recordingStatus:o,recordingTime:d.time,mediaRecorder:a},e[10]=s,e[11]=p,e[12]=c,e[13]=o,e[14]=h,e[15]=v,e[16]=d.time,e[17]=S):S=e[17],S}function u0t(t){return t.stop()}function d0t(t){return t.stop()}const f0t=t=>{const e=ue.c(14),{setValue:n,data:r}=t;let o;e[0]!==n?(o={onDone:async g=>{const v=await DAe(g);n(v)}},e[0]=n,e[1]=o):o=e[1];const{start:i,stop:a,pauseResume:s,recordingStatus:l,recordingTime:c,allowed:u}=c0t(o);let d,f,h;return e[2]!==u?(d=!u&&y.jsx("div",{className:"text-destructive text-sm",children:"Microphone access is disabled. Please allow microphone access in your browser."}),e[2]=u,e[3]=d):d=e[3],e[4]!==s||e[5]!==l||e[6]!==c||e[7]!==i||e[8]!==a?(f=y.jsx(s0t,{onStart:i,onStop:a,onPause:s,status:l,time:c}),e[4]=s,e[5]=l,e[6]=c,e[7]=i,e[8]=a,e[9]=f):f=e[9],e[10]!==r.label||e[11]!==d||e[12]!==f?(h=y.jsxs(Jo,{label:r.label,align:"top",children:[d,f]}),e[10]=r.label,e[11]=d,e[12]=f,e[13]=h):h=e[13],h},h0t=t=>{const e=ue.c(23);let n=_.useId();const r=!t.debounce;let o,i;e[0]!==t?(o=k=>{t.setValue(k)},e[0]=t,e[1]=o):o=e[1],e[2]!==t.value||e[3]!==r||e[4]!==o?(i={initialValue:t.value,delay:200,disabled:r,onChange:o},e[2]=t.value,e[3]=r,e[4]=o,e[5]=i):i=e[5];const{value:a,onChange:s}=xS(i),l=t.label,c=n,u=t.fullWidth,d=t.fullWidth&&"w-full";let f;e[6]!==d?(f=we("min-w-[3em]",d),e[6]=d,e[7]=f):f=e[7];const h=t.start??void 0,g=t.stop??void 0,v=a??void 0,b=t.label||"Number input";let p,O;return e[8]!==n||e[9]!==s||e[10]!==t.disabled||e[11]!==t.step||e[12]!==v||e[13]!==b||e[14]!==f||e[15]!==h||e[16]!==g?(p=y.jsx(Yh,{"data-testid":"marimo-plugin-number-input",className:f,minValue:h,maxValue:g,value:v,step:t.step,onChange:s,id:n,"aria-label":b,isDisabled:t.disabled}),e[8]=n,e[9]=s,e[10]=t.disabled,e[11]=t.step,e[12]=v,e[13]=b,e[14]=f,e[15]=h,e[16]=g,e[17]=p):p=e[17],e[18]!==n||e[19]!==t.fullWidth||e[20]!==t.label||e[21]!==p?(O=y.jsx(Jo,{label:l,id:c,fullWidth:u,children:p}),e[18]=n,e[19]=t.fullWidth,e[20]=t.label,e[21]=p,e[22]=O):O=e[22],O};jLe=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return _.useMemo(()=>r=>{e.forEach(o=>o(r))},e)},TK=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,DT=function(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"},GM=function(t){return"nodeType"in t},yy=function(t){var e,n;return t?DT(t)?t:GM(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window},PK=function(t){const{Document:e}=yy(t);return t instanceof e},wK=function(t){return!DT(t)&&t instanceof yy(t).HTMLElement},IK=function(t){return t instanceof yy(t).SVGElement},mLe=function(t){return t?DT(t)?t.document:GM(t)?PK(t)?t:wK(t)||IK(t)?t.ownerDocument:document:document:document},UM=TK?_.useLayoutEffect:_.useEffect,ZM=function(t){const e=_.useRef(t);return UM(()=>{e.current=t}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])},ELe=function(){const t=_.useRef(null);return[_.useCallback((n,r)=>{t.current=setInterval(n,r)},[]),_.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[])]},hLe=function(t,e){e===void 0&&(e=[t]);const n=_.useRef(t);return UM(()=>{n.current!==t&&(n.current=t)},e),n},PLe=function(t,e){const n=_.useRef();return _.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])},pLe=function(t){const e=ZM(t),n=_.useRef(null),r=_.useCallback(o=>{o!==n.current&&(e==null||e(o,n.current)),n.current=o},[]);return[n,r]},rQe=function(t){const e=_.useRef();return _.useEffect(()=>{e.current=t},[t]),e.current};let xZ={};fLe=function(t,e){return _.useMemo(()=>{if(e)return e;const n=xZ[t]==null?0:xZ[t]+1;return xZ[t]=n,t+"-"+n},[t,e])};function MAe(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,a)=>{const s=Object.entries(a);for(const[l,c]of s){const u=i[l];u!=null&&(i[l]=u+t*c)}return i},{...e})}}yLe=MAe(1),vLe=MAe(-1),gLe=function(t){if(!t)return!1;const{KeyboardEvent:e}=yy(t.target);return e&&t instanceof e},bLe=function(t){if(function(e){if(!e)return!1;const{TouchEvent:n}=yy(e.target);return n&&e instanceof n}(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(t)?{x:t.clientX,y:t.clientY}:null};let OZ;KM=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[KM.Translate.toString(t),KM.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),OZ="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]",RLe=function(t){return t.matches(OZ)?t:t.querySelector(OZ)};const p0t=Qe({content:or([Qe({type:Jr("ACK")}),Pe()]).nullable()});function uD(t,e){if(Array.isArray(t))return t.map(n=>uD(n,e));if(t instanceof Map){const n={};for(const[r,o]of t.entries())n[String(r)]=uD(o,e);return n}if(typeof t=="object"&&t!==null&&"to_base64"in t&&typeof t.to_base64=="function"){const n=e.length;return e.push(t.to_base64()),{id:n}}if(typeof t=="object"&&t!==null){const n={};for(const r of Object.keys(t))n[r]=uD(t[r],e);return n}return t}class m0t{constructor(e,n=200){this.processEvents=e,this.blockDuration=n,this.buffer=[],this.isBlocked=!1,this.timeout=null}add(e){this.buffer.push(e),this.flush()}flush(){this.isBlocked||(this.processEvents(),this.block())}block(){this.isBlocked=!0,this.timeout!==null&&clearTimeout(this.timeout),this.timeout=window.setTimeout(()=>{this.isBlocked=!1,this.buffer.length>0&&this.flush()},this.blockDuration)}size(){return this.buffer.length}clear(){this.buffer=[]}getAndClear(){const e=[...this.buffer];return this.clear(),e}}const g0t=lu("marimo-panel").withData(Qe({extension:Pe().nullable(),docs_json:ds(lp()),render_json:Qe({roots:ds(Pe())}).catchall(lp())})).withFunctions({send_to_widget:_i.input(Qe({message:lp(),buffers:Wt(Pe())})).output(fp().optional())}).renderer(t=>y.jsx(v0t,{...t}));function NAe(){return window.Bokeh!=null}const v0t=t=>{const e=ue.c(23),{data:n,functions:r,host:o}=t,{extension:i,docs_json:a,render_json:s}=n,l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),[d,f]=_.useState(!1),[h,g]=_.useState(null),v=ZM(()=>{if(!p.current||!c.current)return;const D=p.current.getAndClear(),N=c.current.create_json_patch(D),E={...window.Bokeh.protocol.Message.create("PATCH-DOC",{},N)},A=[];E.content=uD(E.content,A),r.send_to_widget({message:E,buffers:A})});let b;e[0]!==v?(b=new m0t(v),e[0]=v,e[1]=b):b=e[1];const p=_.useRef(b);let O,k,S,w,T,P,j;return e[2]!==i?(O=()=>{if(NAe())return void f(!0);if(i){const N=document.createElement("script");N.innerHTML=i,document.head.append(N)}const D=setInterval(()=>{NAe()&&(f(!0),clearInterval(D))},10);return()=>clearInterval(D)},k=[i,f],e[2]=i,e[3]=O,e[4]=k):(O=e[3],k=e[4]),_.useEffect(O,k),e[5]!==p||e[6]!==v?(S=D=>{if(D.detail.message==null)return;const N=p0t.parse(D.detail.message),E=D.detail.buffers,A=u.current,I=c.current;if(!A||!I)return;const L=N.content;if(L!==null&&typeof N.content!="string")return void(p.current&&p.current.size()>0&&v());if(E&&E.length>0){const Q=E[0];Q instanceof ArrayBuffer?A.consume(Q):Q.buffer instanceof ArrayBuffer&&A.consume(Q.buffer)}else{if(!L||typeof L!="string")return;A.consume(L)}const F=A.message;F!=null&&Object.keys(F.content).length>0&&(F.content.events!==void 0&&(F.content.events=F.content.events.filter(Q=>I._all_models.has(Q.model.id))),I.apply_json_patch(F.content,F.buffers))},e[5]=p,e[6]=v,e[7]=S):S=e[7],Wh(o,LE.TYPE,S),e[8]!==a||e[9]!==p||e[10]!==d||e[11]!==s||e[12]!==h?(w=()=>{const D=Object.keys(a)[0];!d||h===D||(async()=>{const N={...s,roots:{}};for(const A of Object.keys(s.roots)){const I=s.roots[A];if(l.current){const L=l.current.querySelector(`#${I}`);N.roots[A]=L}}const E=Object.keys(N.roots)[0];await window.Bokeh.embed.embed_items_notebook(a,[N]),c.current=window.Bokeh.index.get_by_id(E).model.document,u.current=new window.Bokeh.protocol.Receiver,c.current.on_change(A=>{var I;return(I=p.current)==null?void 0:I.add(A)}),g(D)})()},e[8]=a,e[9]=p,e[10]=d,e[11]=s,e[12]=h,e[13]=w):w=e[13],e[14]!==a||e[15]!==d||e[16]!==s||e[17]!==h?(T=[a,d,s,h],e[14]=a,e[15]=d,e[16]=s,e[17]=h,e[18]=T):T=e[18],_.useEffect(w,T),e[19]!==s.roots?(P=Object.values(s.roots).map(y0t),e[19]=s.roots,e[20]=P):P=e[20],e[21]!==P?(j=y.jsx("div",{ref:l,children:P}),e[21]=P,e[22]=j):j=e[22],j};function y0t(t){return y.jsx("div",{id:t,children:y.jsx("div",{"data-root-id":t,style:{display:"contents"}})},t)}const b0t={removeOnUnmount:!1};function $Ae(t){const e=/(\w+)=%{([^}]+)}/g,n={};let r;for(;(r=e.exec(t))!==null;)n[r[1]]=r[2];return{update(o){return o===t?this:$Ae(o)},parse:o=>Object.entries(n).reduce((i,[a,s])=>(i[a]=eM(o,s),i),{})}}const x0t=_.lazy(()=>Be(()=>import("./react-plotly-7OGAN-Pp.js").then(t=>t.r),[],import.meta.url));function wZ(t){return{autosize:t.layout.width===void 0,dragmode:"select",height:540,...t.layout}}const IAe=["color","curveNumber","entry","hovertext","id","label","parent","percentEntry","percentParent","percentRoot","pointNumber","root","value"],O0t=IAe,QAe=_.memo(t=>{const e=ue.c(46),{figure:n,value:r,setValue:o,config:i}=t;let a;e[0]!==n?(a=()=>structuredClone(n),e[0]=n,e[1]=a):a=e[1];const[s,l]=_.useState(a),c=function(re){const Z=ue.c(6),K=b0t;let oe;Z[0]!==re?(oe=()=>{const ce=document.querySelector(`script[src="${re}"]`);return(ce==null?void 0:ce.dataset.status)||"unknown"},Z[0]=re,Z[1]=oe):oe=Z[1];const[ie,Y]=ge.useState(oe);let le,me;return Z[2]!==K.removeOnUnmount||Z[3]!==re?(le=()=>{let ce=document.querySelector(`script[src="${re}"]`);const ve=je=>{ce&&(ce.dataset.status=je,Y(je))},ye=()=>ve("ready"),_e=()=>ve("error"),Se=je=>{const Ie=new MutationObserver(()=>{const De=je.dataset.status;De&&Y(De)});return Ie.observe(je,{attributes:!0,attributeFilter:["data-status"]}),Ie};if(!ce){ce=document.createElement("script"),ce.src=re,ce.async=!0,ve("loading"),document.body.append(ce),ce.addEventListener("load",ye),ce.addEventListener("error",_e);const je=Se(ce);return()=>{je.disconnect(),ce&&(ce.removeEventListener("load",ye),ce.removeEventListener("error",_e),K.removeOnUnmount&&ce.remove())}}const Ae=ce.dataset.status;if(Ae){if(Ae==="ready"||Ae==="error")return;const je=Se(ce);return()=>je.disconnect()}Y("unknown")},me=[re,K.removeOnUnmount],Z[2]=K.removeOnUnmount,Z[3]=re,Z[4]=le,Z[5]=me):(le=Z[4],me=Z[5]),ge.useEffect(le,me),ie}("https://cdn.jsdelivr.net/npm/mathjax-full@3.2.2/es5/tex-mml-svg.min.js"),u=c==="ready";let d,f;e[2]!==u||e[3]!==n?(d=[n,u],e[2]=u,e[3]=n,e[4]=d):d=e[4],_.useEffect(()=>{const re=structuredClone(n);l(re),v(Z=>({...wZ(re),...Z}))},d),e[5]!==s||e[6]!==r?(f=()=>({...wZ(s),...r}),e[5]=s,e[6]=r,e[7]=f):f=e[7];const[h,g]=_.useState(f),v=g;let b;e[8]!==n||e[9]!==v||e[10]!==o?(b=()=>{const re=structuredClone(n);l(re),v(wZ(re)),o({})},e[8]=n,e[9]=v,e[10]=o,e[11]=b):b=e[11];const p=Fn(b),O=Gd(i);let k,S,w,T;e[12]===Symbol.for("react.memo_cache_sentinel")?(S={svg:`
|
498
498
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
499
499
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-ccw">
|
500
500
|
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
|
501
501
|
<path d="M3 3v5h5" />
|
502
|
-
</svg>`},e[12]=S):S=e[12],e[13]!==p?(w=[{name:"reset",title:"Reset state",icon:S,click:p}],e[13]=p,e[14]=w):w=e[14],e[15]!==O||e[16]!==w?(T={displaylogo:!1,modeBarButtonsToAdd:w,...O},e[15]=O,e[16]=w,e[17]=T):T=e[17],k=T;const P=k,j=function(re){const[Z,K]=_.useState(re),[oe,ie]=_.useState(null);return re!==Z&&(ie(Z),K(re)),oe}(s)??s;let D,N,E,A;e[18]!==s.layout||e[19]!==j.layout||e[20]!==v?(D=()=>{const re=new Set(["autosize","dragmode","xaxis","yaxis"]);for(const K of re)mf(s.layout[K],j.layout[K])||re.delete(K);const Z=cr.omit(s.layout,re);v(K=>({...K,...Z}))},e[18]=s.layout,e[19]=j.layout,e[20]=v,e[21]=D):D=e[21],e[22]!==s.layout||e[23]!==j.layout?(N=[s.layout,j.layout],e[22]=s.layout,e[23]=j.layout,e[24]=N):N=e[24],_.useEffect(D,N),e[25]!==o?(E=re=>{if("dragmode"in re&&o(Z=>({...Z,dragmode:re.dragmode})),Object.keys(re).some(k0t)){const Z={};Object.entries(re).forEach(K=>{const[oe,ie]=K;wne(Z,oe,ie)}),o(K=>({...K,...Z}))}},e[25]=o,e[26]=E):E=e[26],e[27]!==o?(A=()=>{o(S0t)},e[27]=o,e[28]=A):A=e[28];const I=Fn(A);let L;e[29]!==o?(L=re=>{re&&o(Z=>({...Z,points:re.points.map(C0t)}))},e[29]=o,e[30]=L):L=e[30];const F=Fn(L);let Q;e[31]!==o?(Q=re=>{re&&o(Z=>({...Z,points:re.points.map(_0t)}))},e[31]=o,e[32]=Q):Q=e[32];const W=Fn(Q);let U;e[33]!==o?(U=re=>{re&&o(Z=>({...Z,selections:"selections"in re?re.selections:[],points:w0t(re.points),indices:re.points.map(T0t),range:re.range}))},e[33]=o,e[34]=U):U=e[34];const X=Fn(U),G=s.frames??void 0,ae=Fn(P0t);let ne;return e[35]!==s||e[36]!==h||e[37]!==P||e[38]!==E||e[39]!==I||e[40]!==F||e[41]!==W||e[42]!==X||e[43]!==G||e[44]!==ae?(ne=y.jsx(x0t,{...s,layout:h,onRelayout:E,onDeselect:I,onTreemapClick:F,onSunburstClick:W,config:P,onSelected:X,className:"w-full",useResizeHandler:!0,frames:G,onError:ae}),e[35]=s,e[36]=h,e[37]=P,e[38]=E,e[39]=I,e[40]=F,e[41]=W,e[42]=X,e[43]=G,e[44]=ae,e[45]=ne):ne=e[45],ne});function w0t(t){if(!t)return[];let e;return t.map(n=>{const r=Array.isArray(n.data.hovertemplate)?n.data.hovertemplate[0]:n.data.hovertemplate;return e=e?e.update(r):$Ae(r),e.parse(n)})}function k0t(t){return t.includes("xaxis")||t.includes("yaxis")}function S0t(t){return{...t,selections:Lc.EMPTY,points:Lc.EMPTY,indices:Lc.EMPTY,range:void 0}}function C0t(t){return cM(t,O0t)}function _0t(t){return cM(t,IAe)}function T0t(t){return t.pointIndex}function P0t(t){Ve.error("PlotlyPlugin: ",t)}QAe.displayName="PlotlyComponent";const E0t=t=>{const e=ue.c(18),n=_.useId(),r=t.label,o=t.inline?"left":"top",i=t.value??"",a=t.setValue,s=t.inline&&"grid-flow-col gap-4";let l;e[0]!==s?(l=we(s),e[0]=s,e[1]=l):l=e[1];const c=t.disabled;let u,d,f;if(e[2]!==n||e[3]!==t.options){let h;e[5]!==n?(h=(g,v)=>y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(sZ,{value:g,id:`${n}-${v.toString()}`}),y.jsx(nf,{htmlFor:`${n}-${v.toString()}`,className:"text-sm font-normal",children:g})]},v),e[5]=n,e[6]=h):h=e[6],u=t.options.map(h),e[2]=n,e[3]=t.options,e[4]=u}else u=e[4];return e[7]!==t.disabled||e[8]!==t.setValue||e[9]!==i||e[10]!==l||e[11]!==u?(d=y.jsx(aZ,{"data-testid":"marimo-plugin-radio",value:i,onValueChange:a,className:l,"aria-label":"Radio Group",disabled:c,children:u}),e[7]=t.disabled,e[8]=t.setValue,e[9]=i,e[10]=l,e[11]=u,e[12]=d):d=e[12],e[13]!==n||e[14]!==t.label||e[15]!==o||e[16]!==d?(f=y.jsx(Jo,{label:r,id:n,align:o,children:d}),e[13]=n,e[14]=t.label,e[15]=o,e[16]=d,e[17]=f):f=e[17],f},LAe=_.forwardRef((t,e)=>{const n=ue.c(38);let r,o,i;n[0]!==t?({className:r,valueMap:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const[a,s]=PN(!1);let l,c,u,d,f,h,g,v,b,p,O,k;return n[4]!==r?(l=we("relative flex touch-none select-none hover:cursor-pointer","data-[orientation=horizontal]:w-full data-[orientation=horizontal]:items-center","data-[orientation=vertical]:h-full data-[orientation=vertical]:justify-center","data-[disabled]:cursor-not-allowed",r),n[4]=r,n[5]=l):l=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(c=we("relative grow overflow-hidden rounded-full bg-slate-200 dark:bg-accent/60","data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-full","data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2"),n[6]=c):c=n[6],n[7]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(O5e,{"data-testid":"track",className:c,children:y.jsx(w5e,{"data-testid":"range",className:we("absolute bg-blue-500 dark:bg-primary","data-[orientation=horizontal]:h-full","data-[orientation=vertical]:w-full","data-[disabled]:opacity-50")})}),n[7]=u):u=n[7],n[8]!==s.setFalse||n[9]!==s.setTrue?(d=y.jsx($O,{asChild:!0,children:y.jsx(KW,{"data-testid":"thumb",className:"block h-4 w-4 rounded-full shadow-xsSolid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",onFocus:s.setTrue,onBlur:s.setFalse,onMouseEnter:s.setTrue,onMouseLeave:s.setFalse})}),n[8]=s.setFalse,n[9]=s.setTrue,n[10]=d):d=n[10],n[11]!==o.value||n[12]!==i?(f=o.value!=null&&o.value.length===2&&y.jsx(yg,{children:nh(i(o.value[0]))},o.value[0]),n[11]=o.value,n[12]=i,n[13]=f):f=n[13],n[14]!==f?(h=y.jsx(ak,{children:f}),n[14]=f,n[15]=h):h=n[15],n[16]!==a||n[17]!==d||n[18]!==h?(g=y.jsx(za,{children:y.jsxs(IO,{delayDuration:0,open:a,children:[d,h]})}),n[16]=a,n[17]=d,n[18]=h,n[19]=g):g=n[19],n[20]!==s.setFalse||n[21]!==s.setTrue?(v=y.jsx($O,{asChild:!0,children:y.jsx(KW,{"data-testid":"thumb",className:"block h-4 w-4 rounded-full shadow-xsSolid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",onFocus:s.setTrue,onBlur:s.setFalse,onMouseEnter:s.setTrue,onMouseLeave:s.setFalse})}),n[20]=s.setFalse,n[21]=s.setTrue,n[22]=v):v=n[22],n[23]!==o.value||n[24]!==i?(b=o.value!=null&&o.value.length===2&&y.jsx(yg,{children:nh(i(o.value[1]))},o.value[1]),n[23]=o.value,n[24]=i,n[25]=b):b=n[25],n[26]!==b?(p=y.jsx(ak,{children:b}),n[26]=b,n[27]=p):p=n[27],n[28]!==a||n[29]!==p||n[30]!==v?(O=y.jsx(za,{children:y.jsxs(IO,{delayDuration:0,open:a,children:[v,p]})}),n[28]=a,n[29]=p,n[30]=v,n[31]=O):O=n[31],n[32]!==o||n[33]!==e||n[34]!==l||n[35]!==O||n[36]!==g?(k=y.jsxs(g4,{ref:e,className:l,...o,children:[u,g,O]}),n[32]=o,n[33]=e,n[34]=l,n[35]=O,n[36]=g,n[37]=k):k=n[37],k});LAe.displayName=g4.displayName;const R0t=t=>{const e=ue.c(49),{label:n,setValue:r,value:o,start:i,stop:a,step:s,debounce:l,orientation:c,showValue:u,fullWidth:d,disabled:f,valueMap:h}=t,g=_.useId(),[v,b]=_.useState(o);let p,O;e[0]!==o?(p=()=>{b(o)},O=[o],e[0]=o,e[1]=p,e[2]=O):(p=e[1],O=e[2]),_.useEffect(p,O);const k=c==="horizontal"?"left":"top",S=d&&"my-1 w-full";let w;e[3]!==S?(w=we(S),e[3]=S,e[4]=w):w=e[4];const T=c==="vertical"&&"items-end inline-flex justify-center self-center mx-2",P=d&&"w-full";let j;e[5]!==T||e[6]!==P?(j=we("flex items-center gap-2",T,P),e[5]=T,e[6]=P,e[7]=j):j=e[7];const D=!d&&"data-[orientation=horizontal]:w-36 ";let N,E,A,I,L,F,Q,W,U;return e[8]!==D?(N=we("relative flex items-center select-none",D,"data-[orientation=vertical]:h-36"),e[8]=D,e[9]=N):N=e[9],e[10]!==l||e[11]!==r?(E=X=>{b(X),l||r(X)},A=X=>{l&&r(X)},e[10]=l,e[11]=r,e[12]=E,e[13]=A):(E=e[12],A=e[13]),e[14]!==l||e[15]!==v||e[16]!==r||e[17]!==o?(I=()=>{l&&!mf(v,o)&&r(v)},L=()=>{l&&!mf(v,o)&&r(v)},e[14]=l,e[15]=v,e[16]=r,e[17]=o,e[18]=I,e[19]=L):(I=e[18],L=e[19]),e[20]!==f||e[21]!==g||e[22]!==v||e[23]!==c||e[24]!==i||e[25]!==s||e[26]!==a||e[27]!==N||e[28]!==E||e[29]!==A||e[30]!==I||e[31]!==L||e[32]!==h?(F=y.jsx(LAe,{id:g,className:N,value:v,min:i,max:a,step:s,orientation:c,disabled:f,onValueChange:E,onValueCommit:A,onPointerUp:I,onMouseUp:L,valueMap:h}),e[20]=f,e[21]=g,e[22]=v,e[23]=c,e[24]=i,e[25]=s,e[26]=a,e[27]=N,e[28]=E,e[29]=A,e[30]=I,e[31]=L,e[32]=h,e[33]=F):F=e[33],e[34]!==v||e[35]!==u||e[36]!==h?(Q=u&&y.jsx("div",{className:"text-xs text-muted-foreground min-w-[16px]",children:`${nh(h(v[0]))}, ${nh(h(v[1]))}`}),e[34]=v,e[35]=u,e[36]=h,e[37]=Q):Q=e[37],e[38]!==F||e[39]!==Q||e[40]!==j?(W=y.jsxs("div",{className:j,children:[F,Q]}),e[38]=F,e[39]=Q,e[40]=j,e[41]=W):W=e[41],e[42]!==d||e[43]!==g||e[44]!==n||e[45]!==W||e[46]!==k||e[47]!==w?(U=y.jsx(Jo,{label:n,id:g,align:k,className:w,fullWidth:d,children:W}),e[42]=d,e[43]=g,e[44]=n,e[45]=W,e[46]=k,e[47]=w,e[48]=U):U=e[48],U};var kZ,zAe,j0t=function(){if(zAe)return kZ;zAe=1,kZ=function(r,o,i){i=Object.assign({},t,i||{}),(typeof r=="number"||r.match(/^[-+]?[0-9.]+$/g))&&(r=parseInt(r)+"ms");let a=0;const s=function(c){const u={ms:.001,s:1,m:60,h:3600};return u.d=c.hoursPerDay*u.h,u.w=c.daysPerWeek*u.d,u.mth=c.daysPerYear/c.monthsPerYear*u.d,u.y=c.daysPerYear*u.d,u}(i),l=r.toLowerCase().replace(/[^.\w+-]+/g,"").match(/[-+]?[0-9.]+[a-z]+/g);if(l===null)throw new Error(`The value [${r}] could not be parsed by timestring`);return l.forEach(c=>{const u=c.match(/[0-9.]+/g)[0],d=c.match(/[a-z]+/g)[0];a+=function(f,h,g){return f*g[n(h)]}(u,d,s)}),o?function(c,u,d){return c/d[n(u)]}(a,o,s):a};const t={hoursPerDay:24,daysPerWeek:7,weeksPerMonth:4,monthsPerYear:12,daysPerYear:365.25},e={ms:["ms","milli","millisecond","milliseconds"],s:["s","sec","secs","second","seconds"],m:["m","min","mins","minute","minutes"],h:["h","hr","hrs","hour","hours"],d:["d","day","days"],w:["w","week","weeks"],mth:["mon","mth","mths","month","months"],y:["y","yr","yrs","year","years"]};function n(r){for(const o of Object.keys(e))if(e[o].indexOf(r)>-1)return o;throw new Error(`The unit [${r}] is not supported by timestring`)}return kZ}();const SZ=el(j0t),dD=.1,VAe=Pe().superRefine((t,e)=>{try{return void(SZ(t)<dD&&e.addIssue({code:wt.custom,message:"Must be greater than 0.1 seconds."}))}catch{return void e.addIssue({code:wt.custom,message:"Must be a valid timestring. e.g. 1m, 30m, 1h."})}}),fD="off";let D0t=0;const A0t=({setValue:t,data:e})=>{const[n,r]=_.useState(e.defaultInterval??fD);_.useEffect(()=>{r(e.defaultInterval??fD)},[e.defaultInterval]);const[o,i]=_.useState(!1),a=Fn(()=>{i(!0),t(()=>`${n} (${D0t++})`),setTimeout(()=>i(!1),500)});_.useEffect(()=>{if(n===fD)return;let c=typeof n=="number"?n:/[a-z]/.test(n)?SZ(n):SZ(`${n}s`);c=Math.max(c,dD);const u=setInterval(a,1e3*c);return()=>clearInterval(u)},[n,a]);const s="shadow-none! hover:shadow-none! focus:shadow-none! active:shadow-none!",l=e.options.length>0;return y.jsx(Jo,{label:e.label,children:y.jsxs("span",{className:"inline-flex items-center text-secondary-foreground rounded shadow-smSolid",children:[y.jsx(Ft,{"data-testid":"marimo-plugin-refresh-button",variant:"secondary",size:"icon",className:we(s,"border mb-0 rounded",l&&"border-r-0 rounded-tr-none rounded-br-none"),onClick:a,children:y.jsx(rJ,{className:we("w-3.5 h-3.5",o&&"animate-spin")})}),y.jsxs(ny,{"data-testid":"marimo-plugin-refresh-select",onChange:c=>{r(c.target.value)},value:n,className:we(s,"border mb-0 bg-secondary rounded rounded-tl-none rounded-bl-none hover:bg-secondary/60",!l&&"hidden"),children:[y.jsx("option",{value:fD,children:"off"}),e.options.map(c=>y.jsx("option",{value:c,children:typeof c=="number"?`${c}s`:c},c))]})]})})},M0t=t=>{const e=ue.c(54),{label:n,setValue:r,value:o,start:i,stop:a,step:s,debounce:l,orientation:c,showValue:u,fullWidth:d,valueMap:f,includeInput:h,disabled:g}=t,v=_.useId(),[b,p]=_.useState(o);let O,k;e[0]!==o?(O=()=>{p(o)},k=[o],e[0]=o,e[1]=O,e[2]=k):(O=e[1],k=e[2]),_.useEffect(O,k);const S=c==="horizontal"?"left":"top",w=d&&"my-1 w-full";let T;e[3]!==w?(T=we(w),e[3]=w,e[4]=T):T=e[4];const P=c==="vertical"&&"items-end inline-flex justify-center self-center mx-2";let j;e[5]!==P?(j=we("flex items-center gap-2",P),e[5]=P,e[6]=j):j=e[6];const D=!d&&"data-[orientation=horizontal]:w-36 ";let N,E,A,I,L,F,Q,W,U;return e[7]!==D?(N=we("relative flex items-center select-none",D,"data-[orientation=vertical]:h-36"),e[7]=D,e[8]=N):N=e[8],e[9]!==b?(E=[b],e[9]=b,e[10]=E):E=e[10],e[11]!==l||e[12]!==r?(A=X=>{const[G]=X;p(G),l||r(G)},I=X=>{const[G]=X;l&&r(G)},e[11]=l,e[12]=r,e[13]=A,e[14]=I):(A=e[13],I=e[14]),e[15]!==g||e[16]!==v||e[17]!==c||e[18]!==i||e[19]!==s||e[20]!==a||e[21]!==E||e[22]!==A||e[23]!==I||e[24]!==N||e[25]!==f?(L=y.jsx(JW,{id:v,className:N,value:E,min:i,max:a,step:s,orientation:c,onValueChange:A,onValueCommit:I,valueMap:f,disabled:g}),e[15]=g,e[16]=v,e[17]=c,e[18]=i,e[19]=s,e[20]=a,e[21]=E,e[22]=A,e[23]=I,e[24]=N,e[25]=f,e[26]=L):L=e[26],e[27]!==b||e[28]!==u||e[29]!==f?(F=u&&y.jsx("div",{className:"text-xs text-muted-foreground min-w-[16px]",children:nh(f(b))}),e[27]=b,e[28]=u,e[29]=f,e[30]=F):F=e[30],e[31]!==l||e[32]!==g||e[33]!==h||e[34]!==b||e[35]!==n||e[36]!==r||e[37]!==i||e[38]!==s||e[39]!==a||e[40]!==f?(Q=h&&y.jsx(Yh,{value:f(b),onChange:X=>{p(X),l||r(X)},minValue:i,maxValue:a,step:s,className:"w-24","aria-label":`${n||"Slider"} value input`,isDisabled:g}),e[31]=l,e[32]=g,e[33]=h,e[34]=b,e[35]=n,e[36]=r,e[37]=i,e[38]=s,e[39]=a,e[40]=f,e[41]=Q):Q=e[41],e[42]!==L||e[43]!==F||e[44]!==Q||e[45]!==j?(W=y.jsxs("div",{className:j,children:[L,F,Q]}),e[42]=L,e[43]=F,e[44]=Q,e[45]=j,e[46]=W):W=e[46],e[47]!==d||e[48]!==v||e[49]!==n||e[50]!==W||e[51]!==S||e[52]!==T?(U=y.jsx(Jo,{label:n,id:v,align:S,fullWidth:d,className:T,children:W}),e[47]=d,e[48]=v,e[49]=n,e[50]=W,e[51]=S,e[52]=T,e[53]=U):U=e[53],U};var hD="Switch",[N0t,i1t]=Wo(hD),[$0t,I0t]=N0t(hD),qAe=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=t,[f,h]=_.useState(null),g=ln(e,k=>h(k)),v=_.useRef(!1),b=!f||u||!!f.closest("form"),[p,O]=Ao({prop:o,defaultProp:i??!1,onChange:c,caller:hD});return y.jsxs($0t,{scope:n,checked:p,disabled:s,children:[y.jsx(_t.button,{type:"button",role:"switch","aria-checked":p,"aria-required":a,"data-state":UAe(p),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:g,onClick:ut(t.onClick,k=>{O(S=>!S),b&&(v.current=k.isPropagationStopped(),v.current||k.stopPropagation())})}),b&&y.jsx(WAe,{control:f,bubbles:!v.current,name:r,value:l,checked:p,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});qAe.displayName=hD;var FAe="SwitchThumb",BAe=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,o=I0t(FAe,n);return y.jsx(_t.span,{"data-state":UAe(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:e})});BAe.displayName=FAe;var WAe=_.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...o},i)=>{const a=_.useRef(null),s=ln(a,i),l=G1(n),c=Jw(e);return _.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&f){const h=new Event("click",{bubbles:r});f.call(u,n),u.dispatchEvent(h)}},[l,n,r]),y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function UAe(t){return t?"checked":"unchecked"}WAe.displayName="SwitchBubbleInput";var ZAe=qAe,Q0t=BAe;let XAe,HAe;XAe=Po("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-[1.5rem] w-[2.75rem] mb-1",sm:"h-[1.125rem] w-[2.125rem]"}},defaultVariants:{size:"default"}}),HAe=Po("pointer-events-none block rounded-full bg-background shadow-xs ring-0 transition-transform",{variants:{size:{default:"h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",sm:"h-3.5 w-3.5 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"}},defaultVariants:{size:"default"}}),mM=_.forwardRef((t,e)=>{const n=ue.c(16);let r,o,i,a,s,l,c;return n[0]!==t?({className:r,size:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==r||n[5]!==i?(a=we(XAe({size:i}),r),n[4]=r,n[5]=i,n[6]=a):a=n[6],n[7]!==i?(s=we(HAe({size:i})),n[7]=i,n[8]=s):s=n[8],n[9]!==s?(l=y.jsx(Q0t,{className:s}),n[9]=s,n[10]=l):l=n[10],n[11]!==o||n[12]!==e||n[13]!==a||n[14]!==l?(c=y.jsx(ZAe,{className:a,...o,ref:e,children:l}),n[11]=o,n[12]=e,n[13]=a,n[14]=l,n[15]=c):c=n[15],c}),mM.displayName=ZAe.displayName;const L0t=t=>{const e=ue.c(9),{value:n,setValue:r,data:o}=t,i=_.useId();let a,s;return e[0]!==o.disabled||e[1]!==i||e[2]!==r||e[3]!==n?(a=y.jsx(mM,{"data-testid":"marimo-plugin-switch",checked:n,onCheckedChange:r,id:i,className:"data-[state=unchecked]:hover:bg-input/80 mb-0",disabled:o.disabled}),e[0]=o.disabled,e[1]=i,e[2]=r,e[3]=n,e[4]=a):a=e[4],e[5]!==o.label||e[6]!==i||e[7]!==a?(s=y.jsx(Jo,{label:o.label,align:"right",id:i,labelClassName:"ml-1",children:a}),e[5]=o.label,e[6]=i,e[7]=a,e[8]=s):s=e[8],s},z0t=t=>{const e=ue.c(13),{tabs:n,value:r,setValue:o,children:i}=t,[a,s]=ge.useState(r||"0");let l;e[0]!==o?(l=g=>{s(g),o(g)},e[0]=o,e[1]=l):l=e[1];const c=l;let u,d,f,h;return r!==a&&r&&s(r),e[2]!==n?(u=n.map(V0t),e[2]=n,e[3]=u):u=e[3],e[4]!==u?(d=y.jsx(Kh,{children:u}),e[4]=u,e[5]=d):d=e[5],e[6]!==i?(f=ge.Children.map(i,q0t),e[6]=i,e[7]=f):f=e[7],e[8]!==c||e[9]!==a||e[10]!==d||e[11]!==f?(h=y.jsxs(sg,{value:a,onValueChange:c,children:[d,f]}),e[8]=c,e[9]=a,e[10]=d,e[11]=f,e[12]=h):h=e[12],h};function V0t(t,e){return y.jsx(Hs,{value:e.toString(),children:Br({html:t})},e)}function q0t(t,e){return y.jsx(ec,{value:e.toString(),children:t})}const F0t=t=>{const e=ue.c(57);let n;e[0]!==t.maxLength||e[1]!==t.value?(n=t.maxLength?y.jsxs("span",{className:"text-muted-foreground text-xs font-medium",children:[t.value.length,"/",t.maxLength]}):null,e[0]=t.maxLength,e[1]=t.value,e[2]=n):n=e[2];const r=n;if(t.debounce===!0){const d=t.label,f=t.fullWidth;let h;e[3]!==t.fullWidth?(h=we("font-code",{"w-full":t.fullWidth}),e[3]=t.fullWidth,e[4]=h):h=e[4];const g=t.minLength!=null&&t.minLength>0;let v,b;return e[5]!==r||e[6]!==t.disabled||e[7]!==t.maxLength||e[8]!==t.minLength||e[9]!==t.placeholder||e[10]!==t.rows||e[11]!==t.setValue||e[12]!==t.value||e[13]!==h||e[14]!==g?(v=y.jsx(rAe,{className:h,rows:t.rows,cols:33,maxLength:t.maxLength,minLength:t.minLength,required:g,disabled:t.disabled,bottomAdornment:r,value:t.value,onValueChange:t.setValue,placeholder:t.placeholder}),e[5]=r,e[6]=t.disabled,e[7]=t.maxLength,e[8]=t.minLength,e[9]=t.placeholder,e[10]=t.rows,e[11]=t.setValue,e[12]=t.value,e[13]=h,e[14]=g,e[15]=v):v=e[15],e[16]!==t.fullWidth||e[17]!==t.label||e[18]!==v?(b=y.jsx(Jo,{label:d,align:"top",fullWidth:f,children:v}),e[16]=t.fullWidth,e[17]=t.label,e[18]=v,e[19]=b):b=e[19],b}if(typeof t.debounce=="number"){const d=t.label,f=t.fullWidth;let h;e[20]!==t.fullWidth?(h=we("font-code",{"w-full":t.fullWidth}),e[20]=t.fullWidth,e[21]=h):h=e[21];const g=t.minLength!=null&&t.minLength>0;let v,b;return e[22]!==r||e[23]!==t.debounce||e[24]!==t.disabled||e[25]!==t.maxLength||e[26]!==t.minLength||e[27]!==t.placeholder||e[28]!==t.rows||e[29]!==t.setValue||e[30]!==t.value||e[31]!==h||e[32]!==g?(v=y.jsx(nAe,{className:h,rows:t.rows,cols:33,maxLength:t.maxLength,minLength:t.minLength,required:g,disabled:t.disabled,bottomAdornment:r,value:t.value,onValueChange:t.setValue,placeholder:t.placeholder,delay:t.debounce}),e[22]=r,e[23]=t.debounce,e[24]=t.disabled,e[25]=t.maxLength,e[26]=t.minLength,e[27]=t.placeholder,e[28]=t.rows,e[29]=t.setValue,e[30]=t.value,e[31]=h,e[32]=g,e[33]=v):v=e[33],e[34]!==t.fullWidth||e[35]!==t.label||e[36]!==v?(b=y.jsx(Jo,{label:d,align:"top",fullWidth:f,children:v}),e[34]=t.fullWidth,e[35]=t.label,e[36]=v,e[37]=b):b=e[37],b}const o=t.label,i=t.fullWidth;let a;e[38]!==t.fullWidth?(a=we("font-code",{"w-full":t.fullWidth}),e[38]=t.fullWidth,e[39]=a):a=e[39];const s=t.minLength!=null&&t.minLength>0;let l,c,u;return e[40]!==t?(l=d=>t.setValue(d.target.value),e[40]=t,e[41]=l):l=e[41],e[42]!==r||e[43]!==t.disabled||e[44]!==t.maxLength||e[45]!==t.minLength||e[46]!==t.placeholder||e[47]!==t.rows||e[48]!==t.value||e[49]!==a||e[50]!==s||e[51]!==l?(c=y.jsx(ug,{className:a,rows:t.rows,cols:33,maxLength:t.maxLength,minLength:t.minLength,required:s,disabled:t.disabled,bottomAdornment:r,value:t.value,onInput:l,placeholder:t.placeholder}),e[42]=r,e[43]=t.disabled,e[44]=t.maxLength,e[45]=t.minLength,e[46]=t.placeholder,e[47]=t.rows,e[48]=t.value,e[49]=a,e[50]=s,e[51]=l,e[52]=c):c=e[52],e[53]!==t.fullWidth||e[54]!==t.label||e[55]!==c?(u=y.jsx(Jo,{label:o,align:"top",fullWidth:i,children:c}),e[53]=t.fullWidth,e[54]=t.label,e[55]=c,e[56]=u):u=e[56],u},B0t=t=>{const e=ue.c(66),[n,r]=_.useState(t.value),o=n??t.value,i=function(D,N){if(!N)return!0;switch(D){case"email":return Pe().email().safeParse(N).success;case"url":return Pe().url().safeParse(N).success;default:return!0}}(t.kind,o);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={text:null,password:y.jsx(rG,{size:16}),email:y.jsx(uce,{size:16}),url:y.jsx(RK,{size:16})},e[0]=a):a=e[0];const s=a;let l;e[1]!==t.maxLength||e[2]!==t.value?(l=t.maxLength?y.jsxs("span",{className:"text-muted-foreground text-xs font-medium",children:[t.value.length,"/",t.maxLength]}):null,e[1]=t.maxLength,e[2]=t.value,e[3]=l):l=e[3];const c=l;if(t.debounce===!0){const D=t.label,N=t.fullWidth,E=t.kind,A=s[t.kind],I=t.placeholder,L=t.maxLength,F=t.minLength,Q=t.minLength!=null&&t.minLength>0,W=t.disabled,U=!i;let X,G,ae;return e[4]!==t.fullWidth||e[5]!==U?(X=we({"border-destructive":U,"w-full":t.fullWidth}),e[4]=t.fullWidth,e[5]=U,e[6]=X):X=e[6],e[7]!==c||e[8]!==t.disabled||e[9]!==t.kind||e[10]!==t.maxLength||e[11]!==t.minLength||e[12]!==t.placeholder||e[13]!==t.setValue||e[14]!==t.value||e[15]!==X||e[16]!==A||e[17]!==Q?(G=y.jsx(Kye,{"data-testid":"marimo-plugin-text-input",type:E,icon:A,placeholder:I,maxLength:L,minLength:F,required:Q,disabled:W,className:X,endAdornment:c,value:t.value,onValueChange:t.setValue}),e[7]=c,e[8]=t.disabled,e[9]=t.kind,e[10]=t.maxLength,e[11]=t.minLength,e[12]=t.placeholder,e[13]=t.setValue,e[14]=t.value,e[15]=X,e[16]=A,e[17]=Q,e[18]=G):G=e[18],e[19]!==t.fullWidth||e[20]!==t.label||e[21]!==G?(ae=y.jsx(Jo,{label:D,fullWidth:N,children:G}),e[19]=t.fullWidth,e[20]=t.label,e[21]=G,e[22]=ae):ae=e[22],ae}if(typeof t.debounce=="number"){const D=t.label,N=t.fullWidth,E=t.kind,A=s[t.kind],I=t.placeholder,L=t.maxLength,F=t.minLength,Q=t.minLength!=null&&t.minLength>0,W=t.disabled,U=!i;let X,G,ae,ne;return e[23]!==t.fullWidth||e[24]!==U?(X=we({"border-destructive":U,"w-full":t.fullWidth}),e[23]=t.fullWidth,e[24]=U,e[25]=X):X=e[25],e[26]===Symbol.for("react.memo_cache_sentinel")?(G=re=>r(re.currentTarget.value),e[26]=G):G=e[26],e[27]!==c||e[28]!==t.debounce||e[29]!==t.disabled||e[30]!==t.kind||e[31]!==t.maxLength||e[32]!==t.minLength||e[33]!==t.placeholder||e[34]!==t.setValue||e[35]!==t.value||e[36]!==X||e[37]!==A||e[38]!==Q?(ae=y.jsx(d0,{"data-testid":"marimo-plugin-text-input",type:E,icon:A,placeholder:I,maxLength:L,minLength:F,required:Q,disabled:W,className:X,endAdornment:c,value:t.value,onValueChange:t.setValue,onBlur:G,delay:t.debounce}),e[27]=c,e[28]=t.debounce,e[29]=t.disabled,e[30]=t.kind,e[31]=t.maxLength,e[32]=t.minLength,e[33]=t.placeholder,e[34]=t.setValue,e[35]=t.value,e[36]=X,e[37]=A,e[38]=Q,e[39]=ae):ae=e[39],e[40]!==t.fullWidth||e[41]!==t.label||e[42]!==ae?(ne=y.jsx(Jo,{label:D,fullWidth:N,children:ae}),e[40]=t.fullWidth,e[41]=t.label,e[42]=ae,e[43]=ne):ne=e[43],ne}const u=t.label,d=t.fullWidth,f=t.kind,h=s[t.kind],g=t.placeholder,v=t.maxLength,b=t.minLength,p=t.minLength!=null&&t.minLength>0,O=t.disabled,k=!i;let S,w,T,P,j;return e[44]!==t.fullWidth||e[45]!==k?(S=we({"border-destructive":k,"w-full":t.fullWidth}),e[44]=t.fullWidth,e[45]=k,e[46]=S):S=e[46],e[47]!==t?(w=D=>t.setValue(D.currentTarget.value),e[47]=t,e[48]=w):w=e[48],e[49]===Symbol.for("react.memo_cache_sentinel")?(T=D=>r(D.currentTarget.value),e[49]=T):T=e[49],e[50]!==c||e[51]!==t.disabled||e[52]!==t.kind||e[53]!==t.maxLength||e[54]!==t.minLength||e[55]!==t.placeholder||e[56]!==t.value||e[57]!==S||e[58]!==w||e[59]!==h||e[60]!==p?(P=y.jsx(tf,{"data-testid":"marimo-plugin-text-input",type:f,icon:h,placeholder:g,maxLength:v,minLength:b,required:p,disabled:O,className:S,endAdornment:c,value:t.value,onInput:w,onBlur:T}),e[50]=c,e[51]=t.disabled,e[52]=t.kind,e[53]=t.maxLength,e[54]=t.minLength,e[55]=t.placeholder,e[56]=t.value,e[57]=S,e[58]=w,e[59]=h,e[60]=p,e[61]=P):P=e[61],e[62]!==t.fullWidth||e[63]!==t.label||e[64]!==P?(j=y.jsx(Jo,{label:u,fullWidth:d,children:P}),e[62]=t.fullWidth,e[63]=t.label,e[64]=P,e[65]=j):j=e[65],j},W0t=ge.lazy(()=>Be(()=>import("./vega-component-DJxpBrZ9.js"),__vite__mapDeps([135,101,102,103,104,105,106,107,108,109,110,111,112,100,113]),import.meta.url)),U0t=t=>{const e=ue.c(8),{labels:n,multiple:r,children:o}=t,i=r?"multiple":"single";let a,s;if(e[0]!==o||e[1]!==n){let l;e[3]!==n?(l=(c,u)=>y.jsxs(ky,{value:u.toString(),children:[y.jsx(qO,{className:"py-2 text-md",children:Br({html:n[u]})}),y.jsx(wy,{className:"text-md",children:c})]},u),e[3]=n,e[4]=l):l=e[4],a=ge.Children.map(o,l),e[0]=o,e[1]=n,e[2]=a}else a=e[2];return e[5]!==a||e[6]!==i?(s=y.jsx(Sy,{type:i,className:"text-muted-foreground",collapsible:!0,children:a}),e[5]=a,e[6]=i,e[7]=s):s=e[7],s},Z0t=Po("border rounded-lg p-12 mt-12 mb-12 text-foreground shadow-[4px_4px_0px_0px]",{variants:{kind:{neutral:"border-[var(--slate-9)] shadow-[var(--slate-8)]",alert:"bg-[var(--red-2)] border-[var(--red-9)] shadow-[var(--red-8)]",info:"bg-[var(--sky-1)] border-[var(--sky-8)] shadow-[var(--sky-7)]",danger:"bg-[var(--red-2)] border-[var(--red-9)] shadow-[var(--red-8)]",warn:"bg-[var(--amber-2)] border-[var(--amber-9)] shadow-[var(--amber-8)]",success:"bg-[var(--grass-2)] border-[var(--grass-9)] shadow-[var(--grass-8)]"}},defaultVariants:{kind:"neutral"}}),YAe=_.memo(t=>{const e=ue.c(7),{html:n,kind:r}=t;let o,i,a;return e[0]!==r?(o=Z0t({kind:r}),e[0]=r,e[1]=o):o=e[1],e[2]!==n?(i=y.jsx(BE,{html:n}),e[2]=n,e[3]=i):i=e[3],e[4]!==o||e[5]!==i?(a=y.jsx("div",{className:o,children:i}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a});YAe.displayName="CalloutOutput";const X0t=ge.lazy(()=>Be(()=>import("./slides-component-882wphDJ.js"),__vite__mapDeps([136,137]),import.meta.url)),H0t=lu("marimo-download").withData(Qe({data:Pe(),disabled:pt().default(!1),filename:Pe().nullish(),label:Pe().nullish(),lazy:pt().default(!1)})).withFunctions({load:_i.input(Qe({})).output(Qe({data:Pe(),filename:Pe().nullish()}))}).renderer(t=>y.jsx(Y0t,{data:t.data,...t.functions})),Y0t=({data:t,load:e})=>{const[n,r]=_.useState(!1),o=n?af:DA,i=t.label?Br({html:t.label}):"Download";return y.jsxs("a",{href:t.data,download:t.filename||!0,target:"_blank",rel:"noopener noreferrer",onClick:async a=>{if(t.lazy&&!t.disabled){a.preventDefault(),r(!0);try{const s=await e({});ZO(s.data,s.filename||t.filename||"download")}catch(s){Kr({title:"Failed to download",description:"Please try again."}),Ve.error("Failed to download:",s)}finally{r(!1)}}},className:fs({variant:"secondary",disabled:t.disabled||n}),children:[y.jsx(o,{className:we("w-3 h-3",t.label&&"mr-2",n&&"animate-spin")}),i]})},G0t=ge.lazy(()=>Be(()=>import("./ImageComparisonComponent-AOpXII7o.js"),[],import.meta.url)),K0t=lu("marimo-lazy").withData(Qe({showLoadingIndicator:pt().default(!1)})).withFunctions({load:_i.input(Qe({})).output(Qe({html:Pe()}))}).renderer(t=>y.jsx(J0t,{value:t.value,setValue:t.setValue,...t.data,...t.functions})),J0t=t=>{const e=ue.c(15),{load:n,showLoadingIndicator:r,value:o,setValue:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={threshold:0,root:null,rootMargin:"0px"},e[0]=a):a=e[0];const[s,l]=xke(a);let c,u;l!=null&&l.isIntersecting&&!o&&i(!0),e[1]!==n||e[2]!==o?(c=b=>o?n({}):(b.previous(),Promise.resolve(void 0)),e[1]=n,e[2]=o,e[3]=c):c=e[3],e[4]!==o?(u=[o],e[4]=o,e[5]=u):u=e[5];const{data:d,error:f,isPending:h}=$a(c,u);if(f){let b;return e[6]!==f?(b=y.jsx(Hd,{error:f}),e[6]=f,e[7]=b):b=e[7],b}let g,v;return e[8]!==d||e[9]!==h||e[10]!==r?(g=h&&r?y.jsx(af,{className:"w-12 h-12 animate-spin text-primary my-4 mx-4"}):d&&Br({html:d.html}),e[8]=d,e[9]=h,e[10]=r,e[11]=g):g=e[11],e[12]!==s||e[13]!==g?(v=y.jsx("div",{ref:s,className:"min-h-4",children:g}),e[12]=s,e[13]=g,e[14]=v):v=e[14],v},evt=_.lazy(()=>Be(()=>import("./mermaid-Cq-UCuW0.js").then(async t=>(await t.__tla,t)).then(t=>t.aq),__vite__mapDeps([138,128,103,110]),import.meta.url));var GAe,KAe={exports:{}},tvt=(GAe||(GAe=1,function(t){(function(){var e=Object.assign||function(p){for(var O,k=1;k<arguments.length;k++)for(var S in O=arguments[k])f(O,S)&&(p[S]=O[S]);return p},n=Array.isArray||function(p){return Object.prototype.toString.call(p)==="[object Array]"},r=i(function(p){return p===1?"\u03C7\u03C1\u03CC\u03BD\u03BF\u03C2":"\u03C7\u03C1\u03CC\u03BD\u03B9\u03B1"},function(p){return p===1?"\u03BC\u03AE\u03BD\u03B1\u03C2":"\u03BC\u03AE\u03BD\u03B5\u03C2"},function(p){return p===1?"\u03B5\u03B2\u03B4\u03BF\u03BC\u03AC\u03B4\u03B1":"\u03B5\u03B2\u03B4\u03BF\u03BC\u03AC\u03B4\u03B5\u03C2"},function(p){return p===1?"\u03BC\u03AD\u03C1\u03B1":"\u03BC\u03AD\u03C1\u03B5\u03C2"},function(p){return p===1?"\u03CE\u03C1\u03B1":"\u03CE\u03C1\u03B5\u03C2"},function(p){return p===1?"\u03BB\u03B5\u03C0\u03C4\u03CC":"\u03BB\u03B5\u03C0\u03C4\u03AC"},function(p){return p===1?"\u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03BF":"\u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03B1"},function(p){return(p===1?"\u03C7\u03B9\u03BB\u03B9\u03BF\u03C3\u03C4\u03CC":"\u03C7\u03B9\u03BB\u03B9\u03BF\u03C3\u03C4\u03AC")+" \u03C4\u03BF\u03C5 \u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03BF\u03BB\u03AD\u03C0\u03C4\u03BF\u03C5"},","),o={af:i("jaar",function(p){return"maand"+(p===1?"":"e")},function(p){return p===1?"week":"weke"},function(p){return p===1?"dag":"dae"},function(p){return p===1?"uur":"ure"},function(p){return p===1?"minuut":"minute"},function(p){return"sekonde"+(p===1?"":"s")},function(p){return"millisekonde"+(p===1?"":"s")},","),am:i("\u12D3\u1218\u1275","\u12C8\u122D","\u1233\u121D\u1295\u1275","\u1240\u1295","\u1230\u12D3\u1275","\u12F0\u1242\u1243","\u1230\u12A8\u1295\u12F5","\u121A\u120A\u1230\u12A8\u1295\u12F5"),ar:e(i(function(p){return["\u0633\u0646\u0629","\u0633\u0646\u062A\u0627\u0646","\u0633\u0646\u0648\u0627\u062A"][a(p)]},function(p){return["\u0634\u0647\u0631","\u0634\u0647\u0631\u0627\u0646","\u0623\u0634\u0647\u0631"][a(p)]},function(p){return["\u0623\u0633\u0628\u0648\u0639","\u0623\u0633\u0628\u0648\u0639\u064A\u0646","\u0623\u0633\u0627\u0628\u064A\u0639"][a(p)]},function(p){return["\u064A\u0648\u0645","\u064A\u0648\u0645\u064A\u0646","\u0623\u064A\u0627\u0645"][a(p)]},function(p){return["\u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u062A\u064A\u0646","\u0633\u0627\u0639\u0627\u062A"][a(p)]},function(p){return["\u062F\u0642\u064A\u0642\u0629","\u062F\u0642\u064A\u0642\u062A\u0627\u0646","\u062F\u0642\u0627\u0626\u0642"][a(p)]},function(p){return["\u062B\u0627\u0646\u064A\u0629","\u062B\u0627\u0646\u064A\u062A\u0627\u0646","\u062B\u0648\u0627\u0646\u064A"][a(p)]},function(p){return["\u062C\u0632\u0621 \u0645\u0646 \u0627\u0644\u062B\u0627\u0646\u064A\u0629","\u062C\u0632\u0622\u0646 \u0645\u0646 \u0627\u0644\u062B\u0627\u0646\u064A\u0629","\u0623\u062C\u0632\u0627\u0621 \u0645\u0646 \u0627\u0644\u062B\u0627\u0646\u064A\u0629"][a(p)]},","),{delimiter:" \uFEED ",_hideCountIf2:!0,_digitReplacements:["\u06F0","\u0661","\u0662","\u0663","\u0664","\u0665","\u0666","\u0667","\u0668","\u0669"]}),bg:i(function(p){return["\u0433\u043E\u0434\u0438\u043D\u0438","\u0433\u043E\u0434\u0438\u043D\u0430","\u0433\u043E\u0434\u0438\u043D\u0438"][l(p)]},function(p){return["\u043C\u0435\u0441\u0435\u0446\u0430","\u043C\u0435\u0441\u0435\u0446","\u043C\u0435\u0441\u0435\u0446\u0430"][l(p)]},function(p){return["\u0441\u0435\u0434\u043C\u0438\u0446\u0438","\u0441\u0435\u0434\u043C\u0438\u0446\u0430","\u0441\u0435\u0434\u043C\u0438\u0446\u0438"][l(p)]},function(p){return["\u0434\u043D\u0438","\u0434\u0435\u043D","\u0434\u043D\u0438"][l(p)]},function(p){return["\u0447\u0430\u0441\u0430","\u0447\u0430\u0441","\u0447\u0430\u0441\u0430"][l(p)]},function(p){return["\u043C\u0438\u043D\u0443\u0442\u0438","\u043C\u0438\u043D\u0443\u0442\u0430","\u043C\u0438\u043D\u0443\u0442\u0438"][l(p)]},function(p){return["\u0441\u0435\u043A\u0443\u043D\u0434\u0438","\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u0441\u0435\u043A\u0443\u043D\u0434\u0438"][l(p)]},function(p){return["\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0438","\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0438"][l(p)]},","),bn:i("\u09AC\u099B\u09B0","\u09AE\u09BE\u09B8","\u09B8\u09AA\u09CD\u09A4\u09BE\u09B9","\u09A6\u09BF\u09A8","\u0998\u09A8\u09CD\u099F\u09BE","\u09AE\u09BF\u09A8\u09BF\u099F","\u09B8\u09C7\u0995\u09C7\u09A8\u09CD\u09A1","\u09AE\u09BF\u09B2\u09BF\u09B8\u09C7\u0995\u09C7\u09A8\u09CD\u09A1"),ca:i(function(p){return"any"+(p===1?"":"s")},function(p){return"mes"+(p===1?"":"os")},function(p){return"setman"+(p===1?"a":"es")},function(p){return"di"+(p===1?"a":"es")},function(p){return"hor"+(p===1?"a":"es")},function(p){return"minut"+(p===1?"":"s")},function(p){return"segon"+(p===1?"":"s")},function(p){return"milisegon"+(p===1?"":"s")},","),ckb:i("\u0633\u0627\u06B5","\u0645\u0627\u0646\u06AF","\u0647\u06D5\u0641\u062A\u06D5","\u0695\u06C6\u0698","\u06A9\u0627\u0698\u06CE\u0631","\u062E\u0648\u0644\u06D5\u06A9","\u0686\u0631\u06A9\u06D5","\u0645\u06CC\u0644\u06CC \u0686\u0631\u06A9\u06D5","."),cs:i(function(p){return["rok","roku","roky","let"][c(p)]},function(p){return["m\u011Bs\xEDc","m\u011Bs\xEDce","m\u011Bs\xEDce","m\u011Bs\xEDc\u016F"][c(p)]},function(p){return["t\xFDden","t\xFDdne","t\xFDdny","t\xFDdn\u016F"][c(p)]},function(p){return["den","dne","dny","dn\xED"][c(p)]},function(p){return["hodina","hodiny","hodiny","hodin"][c(p)]},function(p){return["minuta","minuty","minuty","minut"][c(p)]},function(p){return["sekunda","sekundy","sekundy","sekund"][c(p)]},function(p){return["milisekunda","milisekundy","milisekundy","milisekund"][c(p)]},","),cy:i("flwyddyn","mis","wythnos","diwrnod","awr","munud","eiliad","milieiliad"),da:i("\xE5r",function(p){return"m\xE5ned"+(p===1?"":"er")},function(p){return"uge"+(p===1?"":"r")},function(p){return"dag"+(p===1?"":"e")},function(p){return"time"+(p===1?"":"r")},function(p){return"minut"+(p===1?"":"ter")},function(p){return"sekund"+(p===1?"":"er")},function(p){return"millisekund"+(p===1?"":"er")},","),de:i(function(p){return"Jahr"+(p===1?"":"e")},function(p){return"Monat"+(p===1?"":"e")},function(p){return"Woche"+(p===1?"":"n")},function(p){return"Tag"+(p===1?"":"e")},function(p){return"Stunde"+(p===1?"":"n")},function(p){return"Minute"+(p===1?"":"n")},function(p){return"Sekunde"+(p===1?"":"n")},function(p){return"Millisekunde"+(p===1?"":"n")},","),el:r,en:i(function(p){return"year"+(p===1?"":"s")},function(p){return"month"+(p===1?"":"s")},function(p){return"week"+(p===1?"":"s")},function(p){return"day"+(p===1?"":"s")},function(p){return"hour"+(p===1?"":"s")},function(p){return"minute"+(p===1?"":"s")},function(p){return"second"+(p===1?"":"s")},function(p){return"millisecond"+(p===1?"":"s")}),eo:i(function(p){return"jaro"+(p===1?"":"j")},function(p){return"monato"+(p===1?"":"j")},function(p){return"semajno"+(p===1?"":"j")},function(p){return"tago"+(p===1?"":"j")},function(p){return"horo"+(p===1?"":"j")},function(p){return"minuto"+(p===1?"":"j")},function(p){return"sekundo"+(p===1?"":"j")},function(p){return"milisekundo"+(p===1?"":"j")},","),es:i(function(p){return"a\xF1o"+(p===1?"":"s")},function(p){return"mes"+(p===1?"":"es")},function(p){return"semana"+(p===1?"":"s")},function(p){return"d\xEDa"+(p===1?"":"s")},function(p){return"hora"+(p===1?"":"s")},function(p){return"minuto"+(p===1?"":"s")},function(p){return"segundo"+(p===1?"":"s")},function(p){return"milisegundo"+(p===1?"":"s")},","),et:i(function(p){return"aasta"+(p===1?"":"t")},function(p){return"kuu"+(p===1?"":"d")},function(p){return"n\xE4dal"+(p===1?"":"at")},function(p){return"p\xE4ev"+(p===1?"":"a")},function(p){return"tund"+(p===1?"":"i")},function(p){return"minut"+(p===1?"":"it")},function(p){return"sekund"+(p===1?"":"it")},function(p){return"millisekund"+(p===1?"":"it")},","),eu:i("urte","hilabete","aste","egun","ordu","minutu","segundo","milisegundo",","),fa:i("\u0633\u0627\u0644","\u0645\u0627\u0647","\u0647\u0641\u062A\u0647","\u0631\u0648\u0632","\u0633\u0627\u0639\u062A","\u062F\u0642\u06CC\u0642\u0647","\u062B\u0627\u0646\u06CC\u0647","\u0645\u06CC\u0644\u06CC \u062B\u0627\u0646\u06CC\u0647"),fi:i(function(p){return p===1?"vuosi":"vuotta"},function(p){return p===1?"kuukausi":"kuukautta"},function(p){return"viikko"+(p===1?"":"a")},function(p){return"p\xE4iv\xE4"+(p===1?"":"\xE4")},function(p){return"tunti"+(p===1?"":"a")},function(p){return"minuutti"+(p===1?"":"a")},function(p){return"sekunti"+(p===1?"":"a")},function(p){return"millisekunti"+(p===1?"":"a")},","),fo:i("\xE1r",function(p){return p===1?"m\xE1na\xF0ur":"m\xE1na\xF0ir"},function(p){return p===1?"vika":"vikur"},function(p){return p===1?"dagur":"dagar"},function(p){return p===1?"t\xEDmi":"t\xEDmar"},function(p){return p===1?"minuttur":"minuttir"},"sekund","millisekund",","),fr:i(function(p){return"an"+(p>=2?"s":"")},"mois",function(p){return"semaine"+(p>=2?"s":"")},function(p){return"jour"+(p>=2?"s":"")},function(p){return"heure"+(p>=2?"s":"")},function(p){return"minute"+(p>=2?"s":"")},function(p){return"seconde"+(p>=2?"s":"")},function(p){return"milliseconde"+(p>=2?"s":"")},","),gr:r,he:i(function(p){return p===1?"\u05E9\u05E0\u05D4":"\u05E9\u05E0\u05D9\u05DD"},function(p){return p===1?"\u05D7\u05D5\u05D3\u05E9":"\u05D7\u05D5\u05D3\u05E9\u05D9\u05DD"},function(p){return p===1?"\u05E9\u05D1\u05D5\u05E2":"\u05E9\u05D1\u05D5\u05E2\u05D5\u05EA"},function(p){return p===1?"\u05D9\u05D5\u05DD":"\u05D9\u05DE\u05D9\u05DD"},function(p){return p===1?"\u05E9\u05E2\u05D4":"\u05E9\u05E2\u05D5\u05EA"},function(p){return p===1?"\u05D3\u05E7\u05D4":"\u05D3\u05E7\u05D5\u05EA"},function(p){return p===1?"\u05E9\u05E0\u05D9\u05D4":"\u05E9\u05E0\u05D9\u05D5\u05EA"},function(p){return p===1?"\u05DE\u05D9\u05DC\u05D9\u05E9\u05E0\u05D9\u05D9\u05D4":"\u05DE\u05D9\u05DC\u05D9\u05E9\u05E0\u05D9\u05D5\u05EA"}),hr:i(function(p){return p%10==2||p%10==3||p%10==4?"godine":"godina"},function(p){return p===1?"mjesec":p===2||p===3||p===4?"mjeseca":"mjeseci"},function(p){return p%10==1&&p!==11?"tjedan":"tjedna"},function(p){return p===1?"dan":"dana"},function(p){return p===1?"sat":p===2||p===3||p===4?"sata":"sati"},function(p){var O=p%10;return O!==2&&O!==3&&O!==4||!(p<10||p>14)?"minuta":"minute"},function(p){var O=p%10;return O===5||Math.floor(p)===p&&p>=10&&p<=19?"sekundi":O===1?"sekunda":O===2||O===3||O===4?"sekunde":"sekundi"},function(p){return p===1?"milisekunda":p%10==2||p%10==3||p%10==4?"milisekunde":"milisekundi"},","),hi:i("\u0938\u093E\u0932",function(p){return p===1?"\u092E\u0939\u0940\u0928\u093E":"\u092E\u0939\u0940\u0928\u0947"},function(p){return p===1?"\u0939\u095E\u094D\u0924\u093E":"\u0939\u092B\u094D\u0924\u0947"},"\u0926\u093F\u0928",function(p){return p===1?"\u0918\u0902\u091F\u093E":"\u0918\u0902\u091F\u0947"},"\u092E\u093F\u0928\u091F","\u0938\u0947\u0915\u0902\u0921","\u092E\u093F\u0932\u0940\u0938\u0947\u0915\u0902\u0921"),hu:i("\xE9v","h\xF3nap","h\xE9t","nap","\xF3ra","perc","m\xE1sodperc","ezredm\xE1sodperc",","),id:i("tahun","bulan","minggu","hari","jam","menit","detik","milidetik"),is:i("\xE1r",function(p){return"m\xE1nu\xF0"+(p===1?"ur":"ir")},function(p){return"vik"+(p===1?"a":"ur")},function(p){return"dag"+(p===1?"ur":"ar")},function(p){return"klukkut\xEDm"+(p===1?"i":"ar")},function(p){return"m\xEDn\xFAt"+(p===1?"a":"ur")},function(p){return"sek\xFAnd"+(p===1?"a":"ur")},function(p){return"millisek\xFAnd"+(p===1?"a":"ur")}),it:i(function(p){return"ann"+(p===1?"o":"i")},function(p){return"mes"+(p===1?"e":"i")},function(p){return"settiman"+(p===1?"a":"e")},function(p){return"giorn"+(p===1?"o":"i")},function(p){return"or"+(p===1?"a":"e")},function(p){return"minut"+(p===1?"o":"i")},function(p){return"second"+(p===1?"o":"i")},function(p){return"millisecond"+(p===1?"o":"i")},","),ja:i("\u5E74","\u30F6\u6708","\u9031\u9593","\u65E5","\u6642\u9593","\u5206","\u79D2","\u30DF\u30EA\u79D2"),km:i("\u1786\u17D2\u1793\u17B6\u17C6","\u1781\u17C2","\u179F\u1794\u17D2\u178F\u17B6\u17A0\u17CD","\u1790\u17D2\u1784\u17C3","\u1798\u17C9\u17C4\u1784","\u1793\u17B6\u1791\u17B8","\u179C\u17B7\u1793\u17B6\u1791\u17B8","\u1798\u17B7\u179B\u17D2\u179B\u17B8\u179C\u17B7\u1793\u17B6\u1791\u17B8"),kn:i(function(p){return p===1?"\u0CB5\u0CB0\u0CCD\u0CB7":"\u0CB5\u0CB0\u0CCD\u0CB7\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CA4\u0CBF\u0C82\u0C97\u0CB3\u0CC1":"\u0CA4\u0CBF\u0C82\u0C97\u0CB3\u0CC1\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CB5\u0CBE\u0CB0":"\u0CB5\u0CBE\u0CB0\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CA6\u0CBF\u0CA8":"\u0CA6\u0CBF\u0CA8\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0C97\u0C82\u0C9F\u0CC6":"\u0C97\u0C82\u0C9F\u0CC6\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CA8\u0CBF\u0CAE\u0CBF\u0CB7":"\u0CA8\u0CBF\u0CAE\u0CBF\u0CB7\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CB8\u0CC6\u0C95\u0CC6\u0C82\u0CA1\u0CCD":"\u0CB8\u0CC6\u0C95\u0CC6\u0C82\u0CA1\u0CC1\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CAE\u0CBF\u0CB2\u0CBF\u0CB8\u0CC6\u0C95\u0CC6\u0C82\u0CA1\u0CCD":"\u0CAE\u0CBF\u0CB2\u0CBF\u0CB8\u0CC6\u0C95\u0CC6\u0C82\u0CA1\u0CC1\u0C97\u0CB3\u0CC1"}),ko:i("\uB144","\uAC1C\uC6D4","\uC8FC\uC77C","\uC77C","\uC2DC\uAC04","\uBD84","\uCD08","\uBC00\uB9AC \uCD08"),ku:i("sal","meh","hefte","roj","seet","deqe","saniye","m\xEEl\xEE\xE7irk",","),lo:i("\u0E9B\u0EB5","\u0EC0\u0E94\u0EB7\u0EAD\u0E99","\u0EAD\u0EB2\u0E97\u0EB4\u0E94","\u0EA1\u0EB7\u0EC9","\u0E8A\u0EBB\u0EC8\u0EA7\u0EC2\u0EA1\u0E87","\u0E99\u0EB2\u0E97\u0EB5","\u0EA7\u0EB4\u0E99\u0EB2\u0E97\u0EB5","\u0EA1\u0EB4\u0E99\u0EA5\u0EB4\u0EA7\u0EB4\u0E99\u0EB2\u0E97\u0EB5",","),lt:i(function(p){return p%10==0||p%100>=10&&p%100<=20?"met\u0173":"metai"},function(p){return["m\u0117nuo","m\u0117nesiai","m\u0117nesi\u0173"][u(p)]},function(p){return["savait\u0117","savait\u0117s","savai\u010Di\u0173"][u(p)]},function(p){return["diena","dienos","dien\u0173"][u(p)]},function(p){return["valanda","valandos","valand\u0173"][u(p)]},function(p){return["minut\u0117","minut\u0117s","minu\u010Di\u0173"][u(p)]},function(p){return["sekund\u0117","sekund\u0117s","sekund\u017Ei\u0173"][u(p)]},function(p){return["milisekund\u0117","milisekund\u0117s","milisekund\u017Ei\u0173"][u(p)]},","),lv:i(function(p){return d(p)?"gads":"gadi"},function(p){return d(p)?"m\u0113nesis":"m\u0113ne\u0161i"},function(p){return d(p)?"ned\u0113\u013Ca":"ned\u0113\u013Cas"},function(p){return d(p)?"diena":"dienas"},function(p){return d(p)?"stunda":"stundas"},function(p){return d(p)?"min\u016Bte":"min\u016Btes"},function(p){return d(p)?"sekunde":"sekundes"},function(p){return d(p)?"milisekunde":"milisekundes"},","),mk:i(function(p){return p===1?"\u0433\u043E\u0434\u0438\u043D\u0430":"\u0433\u043E\u0434\u0438\u043D\u0438"},function(p){return p===1?"\u043C\u0435\u0441\u0435\u0446":"\u043C\u0435\u0441\u0435\u0446\u0438"},function(p){return p===1?"\u043D\u0435\u0434\u0435\u043B\u0430":"\u043D\u0435\u0434\u0435\u043B\u0438"},function(p){return p===1?"\u0434\u0435\u043D":"\u0434\u0435\u043D\u0430"},function(p){return p===1?"\u0447\u0430\u0441":"\u0447\u0430\u0441\u0430"},function(p){return p===1?"\u043C\u0438\u043D\u0443\u0442\u0430":"\u043C\u0438\u043D\u0443\u0442\u0438"},function(p){return p===1?"\u0441\u0435\u043A\u0443\u043D\u0434\u0430":"\u0441\u0435\u043A\u0443\u043D\u0434\u0438"},function(p){return p===1?"\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430":"\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0438"},","),mn:i("\u0436\u0438\u043B","\u0441\u0430\u0440","\u0434\u043E\u043B\u043E\u043E \u0445\u043E\u043D\u043E\u0433","\u04E9\u0434\u04E9\u0440","\u0446\u0430\u0433","\u043C\u0438\u043D\u0443\u0442","\u0441\u0435\u043A\u0443\u043D\u0434","\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434"),mr:i(function(p){return p===1?"\u0935\u0930\u094D\u0937":"\u0935\u0930\u094D\u0937\u0947"},function(p){return p===1?"\u092E\u0939\u093F\u0928\u093E":"\u092E\u0939\u093F\u0928\u0947"},function(p){return p===1?"\u0906\u0920\u0935\u0921\u093E":"\u0906\u0920\u0935\u0921\u0947"},"\u0926\u093F\u0935\u0938","\u0924\u093E\u0938",function(p){return p===1?"\u092E\u093F\u0928\u093F\u091F":"\u092E\u093F\u0928\u093F\u091F\u0947"},"\u0938\u0947\u0915\u0902\u0926","\u092E\u093F\u0932\u093F\u0938\u0947\u0915\u0902\u0926"),ms:i("tahun","bulan","minggu","hari","jam","minit","saat","milisaat"),nl:i("jaar",function(p){return p===1?"maand":"maanden"},function(p){return p===1?"week":"weken"},function(p){return p===1?"dag":"dagen"},"uur",function(p){return p===1?"minuut":"minuten"},function(p){return p===1?"seconde":"seconden"},function(p){return p===1?"milliseconde":"milliseconden"},","),no:i("\xE5r",function(p){return"m\xE5ned"+(p===1?"":"er")},function(p){return"uke"+(p===1?"":"r")},function(p){return"dag"+(p===1?"":"er")},function(p){return"time"+(p===1?"":"r")},function(p){return"minutt"+(p===1?"":"er")},function(p){return"sekund"+(p===1?"":"er")},function(p){return"millisekund"+(p===1?"":"er")},","),pl:i(function(p){return["rok","roku","lata","lat"][s(p)]},function(p){return["miesi\u0105c","miesi\u0105ca","miesi\u0105ce","miesi\u0119cy"][s(p)]},function(p){return["tydzie\u0144","tygodnia","tygodnie","tygodni"][s(p)]},function(p){return["dzie\u0144","dnia","dni","dni"][s(p)]},function(p){return["godzina","godziny","godziny","godzin"][s(p)]},function(p){return["minuta","minuty","minuty","minut"][s(p)]},function(p){return["sekunda","sekundy","sekundy","sekund"][s(p)]},function(p){return["milisekunda","milisekundy","milisekundy","milisekund"][s(p)]},","),pt:i(function(p){return"ano"+(p===1?"":"s")},function(p){return p===1?"m\xEAs":"meses"},function(p){return"semana"+(p===1?"":"s")},function(p){return"dia"+(p===1?"":"s")},function(p){return"hora"+(p===1?"":"s")},function(p){return"minuto"+(p===1?"":"s")},function(p){return"segundo"+(p===1?"":"s")},function(p){return"milissegundo"+(p===1?"":"s")},","),ro:i(function(p){return p===1?"an":"ani"},function(p){return p===1?"lun\u0103":"luni"},function(p){return p===1?"s\u0103pt\u0103m\xE2n\u0103":"s\u0103pt\u0103m\xE2ni"},function(p){return p===1?"zi":"zile"},function(p){return p===1?"or\u0103":"ore"},function(p){return p===1?"minut":"minute"},function(p){return p===1?"secund\u0103":"secunde"},function(p){return p===1?"milisecund\u0103":"milisecunde"},","),ru:i(function(p){return["\u043B\u0435\u0442","\u0433\u043E\u0434","\u0433\u043E\u0434\u0430"][l(p)]},function(p){return["\u043C\u0435\u0441\u044F\u0446\u0435\u0432","\u043C\u0435\u0441\u044F\u0446","\u043C\u0435\u0441\u044F\u0446\u0430"][l(p)]},function(p){return["\u043D\u0435\u0434\u0435\u043B\u044C","\u043D\u0435\u0434\u0435\u043B\u044F","\u043D\u0435\u0434\u0435\u043B\u0438"][l(p)]},function(p){return["\u0434\u043D\u0435\u0439","\u0434\u0435\u043D\u044C","\u0434\u043D\u044F"][l(p)]},function(p){return["\u0447\u0430\u0441\u043E\u0432","\u0447\u0430\u0441","\u0447\u0430\u0441\u0430"][l(p)]},function(p){return["\u043C\u0438\u043D\u0443\u0442","\u043C\u0438\u043D\u0443\u0442\u0430","\u043C\u0438\u043D\u0443\u0442\u044B"][l(p)]},function(p){return["\u0441\u0435\u043A\u0443\u043D\u0434","\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u0441\u0435\u043A\u0443\u043D\u0434\u044B"][l(p)]},function(p){return["\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434","\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u044B"][l(p)]},","),sq:i(function(p){return p===1?"vit":"vjet"},"muaj","jav\xEB","dit\xEB","or\xEB",function(p){return"minut"+(p===1?"\xEB":"a")},function(p){return"sekond"+(p===1?"\xEB":"a")},function(p){return"milisekond"+(p===1?"\xEB":"a")},","),sr:i(function(p){return["\u0433\u043E\u0434\u0438\u043D\u0438","\u0433\u043E\u0434\u0438\u043D\u0430","\u0433\u043E\u0434\u0438\u043D\u0435"][l(p)]},function(p){return["\u043C\u0435\u0441\u0435\u0446\u0438","\u043C\u0435\u0441\u0435\u0446","\u043C\u0435\u0441\u0435\u0446\u0430"][l(p)]},function(p){return["\u043D\u0435\u0434\u0435\u0459\u0438","\u043D\u0435\u0434\u0435\u0459\u0430","\u043D\u0435\u0434\u0435\u0459\u0435"][l(p)]},function(p){return["\u0434\u0430\u043D\u0438","\u0434\u0430\u043D","\u0434\u0430\u043D\u0430"][l(p)]},function(p){return["\u0441\u0430\u0442\u0438","\u0441\u0430\u0442","\u0441\u0430\u0442\u0430"][l(p)]},function(p){return["\u043C\u0438\u043D\u0443\u0442\u0430","\u043C\u0438\u043D\u0443\u0442","\u043C\u0438\u043D\u0443\u0442\u0430"][l(p)]},function(p){return["\u0441\u0435\u043A\u0443\u043D\u0434\u0438","\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u0441\u0435\u043A\u0443\u043D\u0434\u0435"][l(p)]},function(p){return["\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0438","\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0435"][l(p)]},","),sr_Latn:i(function(p){return["godini","godina","godine"][l(p)]},function(p){return["meseci","mesec","meseca"][l(p)]},function(p){return["nedelji","nedelja","nedelje"][l(p)]},function(p){return["dani","dan","dana"][l(p)]},function(p){return["sati","sat","sata"][l(p)]},function(p){return["minuta","minut","minuta"][l(p)]},function(p){return["sekundi","sekunda","sekunde"][l(p)]},function(p){return["milisekundi","milisekunda","milisekunde"][l(p)]},","),ta:i(function(p){return p===1?"\u0BB5\u0BB0\u0BC1\u0B9F\u0BAE\u0BCD":"\u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD"},function(p){return p===1?"\u0BAE\u0BBE\u0BA4\u0BAE\u0BCD":"\u0BAE\u0BBE\u0BA4\u0B99\u0BCD\u0B95\u0BB3\u0BCD"},function(p){return p===1?"\u0BB5\u0BBE\u0BB0\u0BAE\u0BCD":"\u0BB5\u0BBE\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BCD"},function(p){return p===1?"\u0BA8\u0BBE\u0BB3\u0BCD":"\u0BA8\u0BBE\u0B9F\u0BCD\u0B95\u0BB3\u0BCD"},function(p){return p===1?"\u0BAE\u0BA3\u0BBF":"\u0BAE\u0BA3\u0BBF\u0BA8\u0BC7\u0BB0\u0BAE\u0BCD"},function(p){return"\u0BA8\u0BBF\u0BAE\u0BBF\u0B9F"+(p===1?"\u0BAE\u0BCD":"\u0B99\u0BCD\u0B95\u0BB3\u0BCD")},function(p){return"\u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF"+(p===1?"":"\u0B95\u0BB3\u0BCD")},function(p){return"\u0BAE\u0BBF\u0BB2\u0BCD\u0BB2\u0BBF \u0BB5\u0BBF\u0BA8\u0BBE\u0B9F\u0BBF"+(p===1?"":"\u0B95\u0BB3\u0BCD")}),te:i(function(p){return"\u0C38\u0C02\u0C35\u0C24\u0C4D\u0C38"+(p===1?"\u0C30\u0C02":"\u0C30\u0C3E\u0C32")},function(p){return"\u0C28\u0C46\u0C32"+(p===1?"":"\u0C32")},function(p){return p===1?"\u0C35\u0C3E\u0C30\u0C02":"\u0C35\u0C3E\u0C30\u0C3E\u0C32\u0C41"},function(p){return"\u0C30\u0C4B\u0C1C\u0C41"+(p===1?"":"\u0C32\u0C41")},function(p){return"\u0C17\u0C02\u0C1F"+(p===1?"":"\u0C32\u0C41")},function(p){return p===1?"\u0C28\u0C3F\u0C2E\u0C3F\u0C37\u0C02":"\u0C28\u0C3F\u0C2E\u0C3F\u0C37\u0C3E\u0C32\u0C41"},function(p){return p===1?"\u0C38\u0C46\u0C15\u0C28\u0C41":"\u0C38\u0C46\u0C15\u0C28\u0C4D\u0C32\u0C41"},function(p){return p===1?"\u0C2E\u0C3F\u0C32\u0C4D\u0C32\u0C40\u0C38\u0C46\u0C15\u0C28\u0C4D":"\u0C2E\u0C3F\u0C32\u0C4D\u0C32\u0C40\u0C38\u0C46\u0C15\u0C28\u0C4D\u0C32\u0C41"}),uk:i(function(p){return["\u0440\u043E\u043A\u0456\u0432","\u0440\u0456\u043A","\u0440\u043E\u043A\u0438"][l(p)]},function(p){return["\u043C\u0456\u0441\u044F\u0446\u0456\u0432","\u043C\u0456\u0441\u044F\u0446\u044C","\u043C\u0456\u0441\u044F\u0446\u0456"][l(p)]},function(p){return["\u0442\u0438\u0436\u043D\u0456\u0432","\u0442\u0438\u0436\u0434\u0435\u043D\u044C","\u0442\u0438\u0436\u043D\u0456"][l(p)]},function(p){return["\u0434\u043D\u0456\u0432","\u0434\u0435\u043D\u044C","\u0434\u043D\u0456"][l(p)]},function(p){return["\u0433\u043E\u0434\u0438\u043D","\u0433\u043E\u0434\u0438\u043D\u0430","\u0433\u043E\u0434\u0438\u043D\u0438"][l(p)]},function(p){return["\u0445\u0432\u0438\u043B\u0438\u043D","\u0445\u0432\u0438\u043B\u0438\u043D\u0430","\u0445\u0432\u0438\u043B\u0438\u043D\u0438"][l(p)]},function(p){return["\u0441\u0435\u043A\u0443\u043D\u0434","\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u0441\u0435\u043A\u0443\u043D\u0434\u0438"][l(p)]},function(p){return["\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434","\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434\u0438"][l(p)]},","),ur:i("\u0633\u0627\u0644",function(p){return p===1?"\u0645\u06C1\u06CC\u0646\u06C1":"\u0645\u06C1\u06CC\u0646\u06D2"},function(p){return p===1?"\u06C1\u0641\u062A\u06C1":"\u06C1\u0641\u062A\u06D2"},"\u062F\u0646",function(p){return p===1?"\u06AF\u06BE\u0646\u0679\u06C1":"\u06AF\u06BE\u0646\u0679\u06D2"},"\u0645\u0646\u0679","\u0633\u06CC\u06A9\u0646\u0688","\u0645\u0644\u06CC \u0633\u06CC\u06A9\u0646\u0688"),sk:i(function(p){return["rok","roky","roky","rokov"][c(p)]},function(p){return["mesiac","mesiace","mesiace","mesiacov"][c(p)]},function(p){return["t\xFD\u017Ede\u0148","t\xFD\u017Edne","t\xFD\u017Edne","t\xFD\u017Ed\u0148ov"][c(p)]},function(p){return["de\u0148","dni","dni","dn\xED"][c(p)]},function(p){return["hodina","hodiny","hodiny","hod\xEDn"][c(p)]},function(p){return["min\xFAta","min\xFAty","min\xFAty","min\xFAt"][c(p)]},function(p){return["sekunda","sekundy","sekundy","sek\xFAnd"][c(p)]},function(p){return["milisekunda","milisekundy","milisekundy","milisek\xFAnd"][c(p)]},","),sl:i(function(p){return p%10==1?"leto":p%100==2?"leti":p%100==3||p%100==4||Math.floor(p)!==p&&p%100<=5?"leta":"let"},function(p){return p%10==1?"mesec":p%100==2||Math.floor(p)!==p&&p%100<=5?"meseca":p%10==3||p%10==4?"mesece":"mesecev"},function(p){return p%10==1?"teden":p%10==2||Math.floor(p)!==p&&p%100<=4?"tedna":p%10==3||p%10==4?"tedne":"tednov"},function(p){return p%100==1?"dan":"dni"},function(p){return p%10==1?"ura":p%100==2?"uri":p%10==3||p%10==4||Math.floor(p)!==p?"ure":"ur"},function(p){return p%10==1?"minuta":p%10==2?"minuti":p%10==3||p%10==4||Math.floor(p)!==p&&p%100<=4?"minute":"minut"},function(p){return p%10==1?"sekunda":p%100==2?"sekundi":p%100==3||p%100==4||Math.floor(p)!==p?"sekunde":"sekund"},function(p){return p%10==1?"milisekunda":p%100==2?"milisekundi":p%100==3||p%100==4||Math.floor(p)!==p?"milisekunde":"milisekund"},","),sv:i("\xE5r",function(p){return"m\xE5nad"+(p===1?"":"er")},function(p){return"veck"+(p===1?"a":"or")},function(p){return"dag"+(p===1?"":"ar")},function(p){return"timm"+(p===1?"e":"ar")},function(p){return"minut"+(p===1?"":"er")},function(p){return"sekund"+(p===1?"":"er")},function(p){return"millisekund"+(p===1?"":"er")},","),sw:e(i(function(p){return p===1?"mwaka":"miaka"},function(p){return p===1?"mwezi":"miezi"},"wiki",function(p){return p===1?"siku":"masiku"},function(p){return p===1?"saa":"masaa"},"dakika","sekunde","milisekunde"),{_numberFirst:!0}),tr:i("y\u0131l","ay","hafta","g\xFCn","saat","dakika","saniye","milisaniye",","),th:i("\u0E1B\u0E35","\u0E40\u0E14\u0E37\u0E2D\u0E19","\u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C","\u0E27\u0E31\u0E19","\u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07","\u0E19\u0E32\u0E17\u0E35","\u0E27\u0E34\u0E19\u0E32\u0E17\u0E35","\u0E21\u0E34\u0E25\u0E25\u0E34\u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"),uz:i("yil","oy","hafta","kun","soat","minut","sekund","millisekund"),uz_CYR:i("\u0439\u0438\u043B","\u043E\u0439","\u04B3\u0430\u0444\u0442\u0430","\u043A\u0443\u043D","\u0441\u043E\u0430\u0442","\u043C\u0438\u043D\u0443\u0442","\u0441\u0435\u043A\u0443\u043D\u0434","\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434"),vi:i("n\u0103m","th\xE1ng","tu\u1EA7n","ng\xE0y","gi\u1EDD","ph\xFAt","gi\xE2y","mili gi\xE2y",","),zh_CN:i("\u5E74","\u4E2A\u6708","\u5468","\u5929","\u5C0F\u65F6","\u5206\u949F","\u79D2","\u6BEB\u79D2"),zh_TW:i("\u5E74","\u500B\u6708","\u5468","\u5929","\u5C0F\u6642","\u5206\u9418","\u79D2","\u6BEB\u79D2")};function i(p,O,k,S,w,T,P,j,D){var N={y:p,mo:O,w:k,d:S,h:w,m:T,s:P,ms:j};return D!==void 0&&(N.decimal=D),N}function a(p){return p===2?1:p>2&&p<11?2:0}function s(p){return p===1?0:Math.floor(p)!==p?1:p%10>=2&&p%10<=4&&!(p%100>10&&p%100<20)?2:3}function l(p){return Math.floor(p)!==p?2:p%100>=5&&p%100<=20||p%10>=5&&p%10<=9||p%10==0?0:p%10==1?1:p>1?2:0}function c(p){return p===1?0:Math.floor(p)!==p?1:p%10>=2&&p%10<=4&&p%100<10?2:3}function u(p){return p===1||p%10==1&&p%100>20?0:Math.floor(p)!==p||p%10>=2&&p%100>20||p%10>=2&&p%100<10?1:2}function d(p){return p%10==1&&p%100!=11}function f(p,O){return Object.prototype.hasOwnProperty.call(p,O)}function h(p,O,k){var S,w,T,P=p.unitName,j=p.unitCount,D=k.spacer,N=k.maxDecimalPoints;S=f(k,"decimal")?k.decimal:f(O,"decimal")?O.decimal:".","digitReplacements"in k?w=k.digitReplacements:"_digitReplacements"in O&&(w=O._digitReplacements);var E=(N===void 0?j:Math.floor(j*Math.pow(10,N))/Math.pow(10,N)).toString();if(O._hideCountIf2&&j===2)T="",D="";else if(w){T="";for(var A=0;A<E.length;A++){var I=E[A];T+=I==="."?S:w[I]}}else T=E.replace(".",S);var L,F=O[P];return L=typeof F=="function"?F(j):F,O._numberFirst?L+D+T:T+D+L}function g(p,O){var k=function(N){var E=[N.language];if(f(N,"fallbacks")){if(!n(N.fallbacks)||!N.fallbacks.length)throw new Error("fallbacks must be an array with at least one element");E=E.concat(N.fallbacks)}for(var A=0;A<E.length;A++){var I=E[A];if(f(N.languages,I))return N.languages[I];if(f(o,I))return o[I]}throw new Error("No language found.")}(O);if(!p.length){var S=O.units;return h({unitName:S[S.length-1],unitCount:0},k,O)}var w,T=O.conjunction,P=O.serialComma;w=f(O,"delimiter")?O.delimiter:f(k,"delimiter")?k.delimiter:", ";for(var j=[],D=0;D<p.length;D++)j.push(h(p[D],k,O));return T&&p.length!==1?p.length===2?j.join(T):j.slice(0,-1).join(w)+(P?",":"")+T+j.slice(-1):j.join(w)}function v(p){var O=function(k,S){k=Math.abs(k);var w=e({},O,S||{}),T=function(P,j){var D,N,E,A,I=j.units,L=j.unitMeasures,F="largest"in j?j.largest:1/0;if(!I.length)return[];var Q={};for(A=P,N=0;N<I.length;N++){var W=L[D=I[N]];E=N===I.length-1?A/W:Math.floor(A/W),Q[D]=E,A-=E*W}if(j.round){var U=F;for(N=0;N<I.length;N++)if((E=Q[D=I[N]])!==0&&--U===0){for(var X=N+1;X<I.length;X++){var G=I[X],ae=Q[G];Q[D]+=ae*L[G]/L[D],Q[G]=0}break}for(N=I.length-1;N>=0;N--)if((E=Q[D=I[N]])!==0){var ne=Math.round(E);if(Q[D]=ne,N===0)break;var re=I[N-1],Z=L[re],K=Math.floor(ne*L[D]/Z);if(!K)break;Q[re]+=K,Q[D]=0}}var oe=[];for(N=0;N<I.length&&oe.length<F;N++)(E=Q[D=I[N]])&&oe.push({unitName:D,unitCount:E});return oe}(k,w);return g(T,w)};return e(O,{language:"en",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},p)}var b=e(v({}),{getSupportedLanguages:function(){var p=[];for(var O in o)f(o,O)&&O!=="gr"&&p.push(O);return p},humanizer:v});t.exports?t.exports=b:this.humanizeDuration=b})()}(KAe)),KAe.exports);const nvt=el(tvt);var CZ="Progress",rvt=100,[ovt,a1t]=Wo(CZ),[ivt,avt]=ovt(CZ),JAe=_.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=svt,...a}=t;!o&&o!==0||rMe(o)||console.error(`Invalid prop \`max\` of value \`${`${o}`}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`);const s=rMe(o)?o:rvt;r===null||oMe(r,s)||console.error(function(u,d){return`Invalid prop \`value\` of value \`${u}\` supplied to \`${d}\`. The \`value\` prop must be:
|
502
|
+
</svg>`},e[12]=S):S=e[12],e[13]!==p?(w=[{name:"reset",title:"Reset state",icon:S,click:p}],e[13]=p,e[14]=w):w=e[14],e[15]!==O||e[16]!==w?(T={displaylogo:!1,modeBarButtonsToAdd:w,...O},e[15]=O,e[16]=w,e[17]=T):T=e[17],k=T;const P=k,j=function(re){const[Z,K]=_.useState(re),[oe,ie]=_.useState(null);return re!==Z&&(ie(Z),K(re)),oe}(s)??s;let D,N,E,A;e[18]!==s.layout||e[19]!==j.layout||e[20]!==v?(D=()=>{const re=new Set(["autosize","dragmode","xaxis","yaxis"]);for(const K of re)mf(s.layout[K],j.layout[K])||re.delete(K);const Z=cr.omit(s.layout,re);v(K=>({...K,...Z}))},e[18]=s.layout,e[19]=j.layout,e[20]=v,e[21]=D):D=e[21],e[22]!==s.layout||e[23]!==j.layout?(N=[s.layout,j.layout],e[22]=s.layout,e[23]=j.layout,e[24]=N):N=e[24],_.useEffect(D,N),e[25]!==o?(E=re=>{if("dragmode"in re&&o(Z=>({...Z,dragmode:re.dragmode})),Object.keys(re).some(k0t)){const Z={};Object.entries(re).forEach(K=>{const[oe,ie]=K;wne(Z,oe,ie)}),o(K=>({...K,...Z}))}},e[25]=o,e[26]=E):E=e[26],e[27]!==o?(A=()=>{o(S0t)},e[27]=o,e[28]=A):A=e[28];const I=Fn(A);let L;e[29]!==o?(L=re=>{re&&o(Z=>({...Z,points:re.points.map(C0t)}))},e[29]=o,e[30]=L):L=e[30];const F=Fn(L);let Q;e[31]!==o?(Q=re=>{re&&o(Z=>({...Z,points:re.points.map(_0t)}))},e[31]=o,e[32]=Q):Q=e[32];const W=Fn(Q);let U;e[33]!==o?(U=re=>{re&&o(Z=>({...Z,selections:"selections"in re?re.selections:[],points:w0t(re.points),indices:re.points.map(T0t),range:re.range}))},e[33]=o,e[34]=U):U=e[34];const X=Fn(U),G=s.frames??void 0,ae=Fn(P0t);let ne;return e[35]!==s||e[36]!==h||e[37]!==P||e[38]!==E||e[39]!==I||e[40]!==F||e[41]!==W||e[42]!==X||e[43]!==G||e[44]!==ae?(ne=y.jsx(x0t,{...s,layout:h,onRelayout:E,onDeselect:I,onTreemapClick:F,onSunburstClick:W,config:P,onSelected:X,className:"w-full",useResizeHandler:!0,frames:G,onError:ae}),e[35]=s,e[36]=h,e[37]=P,e[38]=E,e[39]=I,e[40]=F,e[41]=W,e[42]=X,e[43]=G,e[44]=ae,e[45]=ne):ne=e[45],ne});function w0t(t){if(!t)return[];let e;return t.map(n=>{const r=Array.isArray(n.data.hovertemplate)?n.data.hovertemplate[0]:n.data.hovertemplate;return e=e?e.update(r):$Ae(r),e.parse(n)})}function k0t(t){return t.includes("xaxis")||t.includes("yaxis")}function S0t(t){return{...t,selections:Lc.EMPTY,points:Lc.EMPTY,indices:Lc.EMPTY,range:void 0}}function C0t(t){return cM(t,O0t)}function _0t(t){return cM(t,IAe)}function T0t(t){return t.pointIndex}function P0t(t){Ve.error("PlotlyPlugin: ",t)}QAe.displayName="PlotlyComponent";const E0t=t=>{const e=ue.c(18),n=_.useId(),r=t.label,o=t.inline?"left":"top",i=t.value??"",a=t.setValue,s=t.inline&&"grid-flow-col gap-4";let l;e[0]!==s?(l=we(s),e[0]=s,e[1]=l):l=e[1];const c=t.disabled;let u,d,f;if(e[2]!==n||e[3]!==t.options){let h;e[5]!==n?(h=(g,v)=>y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(sZ,{value:g,id:`${n}-${v.toString()}`}),y.jsx(nf,{htmlFor:`${n}-${v.toString()}`,className:"text-sm font-normal",children:g})]},v),e[5]=n,e[6]=h):h=e[6],u=t.options.map(h),e[2]=n,e[3]=t.options,e[4]=u}else u=e[4];return e[7]!==t.disabled||e[8]!==t.setValue||e[9]!==i||e[10]!==l||e[11]!==u?(d=y.jsx(aZ,{"data-testid":"marimo-plugin-radio",value:i,onValueChange:a,className:l,"aria-label":"Radio Group",disabled:c,children:u}),e[7]=t.disabled,e[8]=t.setValue,e[9]=i,e[10]=l,e[11]=u,e[12]=d):d=e[12],e[13]!==n||e[14]!==t.label||e[15]!==o||e[16]!==d?(f=y.jsx(Jo,{label:r,id:n,align:o,children:d}),e[13]=n,e[14]=t.label,e[15]=o,e[16]=d,e[17]=f):f=e[17],f},LAe=_.forwardRef((t,e)=>{const n=ue.c(38);let r,o,i;n[0]!==t?({className:r,valueMap:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]);const[a,s]=PN(!1);let l,c,u,d,f,h,g,v,b,p,O,k;return n[4]!==r?(l=we("relative flex touch-none select-none hover:cursor-pointer","data-[orientation=horizontal]:w-full data-[orientation=horizontal]:items-center","data-[orientation=vertical]:h-full data-[orientation=vertical]:justify-center","data-[disabled]:cursor-not-allowed",r),n[4]=r,n[5]=l):l=n[5],n[6]===Symbol.for("react.memo_cache_sentinel")?(c=we("relative grow overflow-hidden rounded-full bg-slate-200 dark:bg-accent/60","data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-full","data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2"),n[6]=c):c=n[6],n[7]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(O5e,{"data-testid":"track",className:c,children:y.jsx(w5e,{"data-testid":"range",className:we("absolute bg-blue-500 dark:bg-primary","data-[orientation=horizontal]:h-full","data-[orientation=vertical]:w-full","data-[disabled]:opacity-50")})}),n[7]=u):u=n[7],n[8]!==s.setFalse||n[9]!==s.setTrue?(d=y.jsx($O,{asChild:!0,children:y.jsx(KW,{"data-testid":"thumb",className:"block h-4 w-4 rounded-full shadow-xsSolid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",onFocus:s.setTrue,onBlur:s.setFalse,onMouseEnter:s.setTrue,onMouseLeave:s.setFalse})}),n[8]=s.setFalse,n[9]=s.setTrue,n[10]=d):d=n[10],n[11]!==o.value||n[12]!==i?(f=o.value!=null&&o.value.length===2&&y.jsx(yg,{children:nh(i(o.value[0]))},o.value[0]),n[11]=o.value,n[12]=i,n[13]=f):f=n[13],n[14]!==f?(h=y.jsx(ak,{children:f}),n[14]=f,n[15]=h):h=n[15],n[16]!==a||n[17]!==d||n[18]!==h?(g=y.jsx(za,{children:y.jsxs(IO,{delayDuration:0,open:a,children:[d,h]})}),n[16]=a,n[17]=d,n[18]=h,n[19]=g):g=n[19],n[20]!==s.setFalse||n[21]!==s.setTrue?(v=y.jsx($O,{asChild:!0,children:y.jsx(KW,{"data-testid":"thumb",className:"block h-4 w-4 rounded-full shadow-xsSolid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",onFocus:s.setTrue,onBlur:s.setFalse,onMouseEnter:s.setTrue,onMouseLeave:s.setFalse})}),n[20]=s.setFalse,n[21]=s.setTrue,n[22]=v):v=n[22],n[23]!==o.value||n[24]!==i?(b=o.value!=null&&o.value.length===2&&y.jsx(yg,{children:nh(i(o.value[1]))},o.value[1]),n[23]=o.value,n[24]=i,n[25]=b):b=n[25],n[26]!==b?(p=y.jsx(ak,{children:b}),n[26]=b,n[27]=p):p=n[27],n[28]!==a||n[29]!==p||n[30]!==v?(O=y.jsx(za,{children:y.jsxs(IO,{delayDuration:0,open:a,children:[v,p]})}),n[28]=a,n[29]=p,n[30]=v,n[31]=O):O=n[31],n[32]!==o||n[33]!==e||n[34]!==l||n[35]!==O||n[36]!==g?(k=y.jsxs(g4,{ref:e,className:l,...o,children:[u,g,O]}),n[32]=o,n[33]=e,n[34]=l,n[35]=O,n[36]=g,n[37]=k):k=n[37],k});LAe.displayName=g4.displayName;const R0t=t=>{const e=ue.c(49),{label:n,setValue:r,value:o,start:i,stop:a,step:s,debounce:l,orientation:c,showValue:u,fullWidth:d,disabled:f,valueMap:h}=t,g=_.useId(),[v,b]=_.useState(o);let p,O;e[0]!==o?(p=()=>{b(o)},O=[o],e[0]=o,e[1]=p,e[2]=O):(p=e[1],O=e[2]),_.useEffect(p,O);const k=c==="horizontal"?"left":"top",S=d&&"my-1 w-full";let w;e[3]!==S?(w=we(S),e[3]=S,e[4]=w):w=e[4];const T=c==="vertical"&&"items-end inline-flex justify-center self-center mx-2",P=d&&"w-full";let j;e[5]!==T||e[6]!==P?(j=we("flex items-center gap-2",T,P),e[5]=T,e[6]=P,e[7]=j):j=e[7];const D=!d&&"data-[orientation=horizontal]:w-36 ";let N,E,A,I,L,F,Q,W,U;return e[8]!==D?(N=we("relative flex items-center select-none",D,"data-[orientation=vertical]:h-36"),e[8]=D,e[9]=N):N=e[9],e[10]!==l||e[11]!==r?(E=X=>{b(X),l||r(X)},A=X=>{l&&r(X)},e[10]=l,e[11]=r,e[12]=E,e[13]=A):(E=e[12],A=e[13]),e[14]!==l||e[15]!==v||e[16]!==r||e[17]!==o?(I=()=>{l&&!mf(v,o)&&r(v)},L=()=>{l&&!mf(v,o)&&r(v)},e[14]=l,e[15]=v,e[16]=r,e[17]=o,e[18]=I,e[19]=L):(I=e[18],L=e[19]),e[20]!==f||e[21]!==g||e[22]!==v||e[23]!==c||e[24]!==i||e[25]!==s||e[26]!==a||e[27]!==N||e[28]!==E||e[29]!==A||e[30]!==I||e[31]!==L||e[32]!==h?(F=y.jsx(LAe,{id:g,className:N,value:v,min:i,max:a,step:s,orientation:c,disabled:f,onValueChange:E,onValueCommit:A,onPointerUp:I,onMouseUp:L,valueMap:h}),e[20]=f,e[21]=g,e[22]=v,e[23]=c,e[24]=i,e[25]=s,e[26]=a,e[27]=N,e[28]=E,e[29]=A,e[30]=I,e[31]=L,e[32]=h,e[33]=F):F=e[33],e[34]!==v||e[35]!==u||e[36]!==h?(Q=u&&y.jsx("div",{className:"text-xs text-muted-foreground min-w-[16px]",children:`${nh(h(v[0]))}, ${nh(h(v[1]))}`}),e[34]=v,e[35]=u,e[36]=h,e[37]=Q):Q=e[37],e[38]!==F||e[39]!==Q||e[40]!==j?(W=y.jsxs("div",{className:j,children:[F,Q]}),e[38]=F,e[39]=Q,e[40]=j,e[41]=W):W=e[41],e[42]!==d||e[43]!==g||e[44]!==n||e[45]!==W||e[46]!==k||e[47]!==w?(U=y.jsx(Jo,{label:n,id:g,align:k,className:w,fullWidth:d,children:W}),e[42]=d,e[43]=g,e[44]=n,e[45]=W,e[46]=k,e[47]=w,e[48]=U):U=e[48],U};var kZ,zAe,j0t=function(){if(zAe)return kZ;zAe=1,kZ=function(r,o,i){i=Object.assign({},t,i||{}),(typeof r=="number"||r.match(/^[-+]?[0-9.]+$/g))&&(r=parseInt(r)+"ms");let a=0;const s=function(c){const u={ms:.001,s:1,m:60,h:3600};return u.d=c.hoursPerDay*u.h,u.w=c.daysPerWeek*u.d,u.mth=c.daysPerYear/c.monthsPerYear*u.d,u.y=c.daysPerYear*u.d,u}(i),l=r.toLowerCase().replace(/[^.\w+-]+/g,"").match(/[-+]?[0-9.]+[a-z]+/g);if(l===null)throw new Error(`The value [${r}] could not be parsed by timestring`);return l.forEach(c=>{const u=c.match(/[0-9.]+/g)[0],d=c.match(/[a-z]+/g)[0];a+=function(f,h,g){return f*g[n(h)]}(u,d,s)}),o?function(c,u,d){return c/d[n(u)]}(a,o,s):a};const t={hoursPerDay:24,daysPerWeek:7,weeksPerMonth:4,monthsPerYear:12,daysPerYear:365.25},e={ms:["ms","milli","millisecond","milliseconds"],s:["s","sec","secs","second","seconds"],m:["m","min","mins","minute","minutes"],h:["h","hr","hrs","hour","hours"],d:["d","day","days"],w:["w","week","weeks"],mth:["mon","mth","mths","month","months"],y:["y","yr","yrs","year","years"]};function n(r){for(const o of Object.keys(e))if(e[o].indexOf(r)>-1)return o;throw new Error(`The unit [${r}] is not supported by timestring`)}return kZ}();const SZ=el(j0t),dD=.1,VAe=Pe().superRefine((t,e)=>{try{return void(SZ(t)<dD&&e.addIssue({code:wt.custom,message:"Must be greater than 0.1 seconds."}))}catch{return void e.addIssue({code:wt.custom,message:"Must be a valid timestring. e.g. 1m, 30m, 1h."})}}),fD="off";let D0t=0;const A0t=({setValue:t,data:e})=>{const[n,r]=_.useState(e.defaultInterval??fD);_.useEffect(()=>{r(e.defaultInterval??fD)},[e.defaultInterval]);const[o,i]=_.useState(!1),a=Fn(()=>{i(!0),t(()=>`${n} (${D0t++})`),setTimeout(()=>i(!1),500)});_.useEffect(()=>{if(n===fD)return;let c=typeof n=="number"?n:/[a-z]/.test(n)?SZ(n):SZ(`${n}s`);c=Math.max(c,dD);const u=setInterval(a,1e3*c);return()=>clearInterval(u)},[n,a]);const s="shadow-none! hover:shadow-none! focus:shadow-none! active:shadow-none!",l=e.options.length>0;return y.jsx(Jo,{label:e.label,children:y.jsxs("span",{className:"inline-flex items-center text-secondary-foreground rounded shadow-smSolid",children:[y.jsx(Ft,{"data-testid":"marimo-plugin-refresh-button",variant:"secondary",size:"icon",className:we(s,"border mb-0 rounded",l&&"border-r-0 rounded-tr-none rounded-br-none"),onClick:a,children:y.jsx(rJ,{className:we("w-3.5 h-3.5",o&&"animate-spin")})}),y.jsxs(ny,{"data-testid":"marimo-plugin-refresh-select",onChange:c=>{r(c.target.value)},value:n,className:we(s,"border mb-0 bg-secondary rounded rounded-tl-none rounded-bl-none hover:bg-secondary/60",!l&&"hidden"),children:[y.jsx("option",{value:fD,children:"off"}),e.options.map(c=>y.jsx("option",{value:c,children:typeof c=="number"?`${c}s`:c},c))]})]})})},M0t=t=>{const e=ue.c(54),{label:n,setValue:r,value:o,start:i,stop:a,step:s,debounce:l,orientation:c,showValue:u,fullWidth:d,valueMap:f,includeInput:h,disabled:g}=t,v=_.useId(),[b,p]=_.useState(o);let O,k;e[0]!==o?(O=()=>{p(o)},k=[o],e[0]=o,e[1]=O,e[2]=k):(O=e[1],k=e[2]),_.useEffect(O,k);const S=c==="horizontal"?"left":"top",w=d&&"my-1 w-full";let T;e[3]!==w?(T=we(w),e[3]=w,e[4]=T):T=e[4];const P=c==="vertical"&&"items-end inline-flex justify-center self-center mx-2";let j;e[5]!==P?(j=we("flex items-center gap-2",P),e[5]=P,e[6]=j):j=e[6];const D=!d&&"data-[orientation=horizontal]:w-36 ";let N,E,A,I,L,F,Q,W,U;return e[7]!==D?(N=we("relative flex items-center select-none",D,"data-[orientation=vertical]:h-36"),e[7]=D,e[8]=N):N=e[8],e[9]!==b?(E=[b],e[9]=b,e[10]=E):E=e[10],e[11]!==l||e[12]!==r?(A=X=>{const[G]=X;p(G),l||r(G)},I=X=>{const[G]=X;l&&r(G)},e[11]=l,e[12]=r,e[13]=A,e[14]=I):(A=e[13],I=e[14]),e[15]!==g||e[16]!==v||e[17]!==c||e[18]!==i||e[19]!==s||e[20]!==a||e[21]!==E||e[22]!==A||e[23]!==I||e[24]!==N||e[25]!==f?(L=y.jsx(JW,{id:v,className:N,value:E,min:i,max:a,step:s,orientation:c,onValueChange:A,onValueCommit:I,valueMap:f,disabled:g}),e[15]=g,e[16]=v,e[17]=c,e[18]=i,e[19]=s,e[20]=a,e[21]=E,e[22]=A,e[23]=I,e[24]=N,e[25]=f,e[26]=L):L=e[26],e[27]!==b||e[28]!==u||e[29]!==f?(F=u&&y.jsx("div",{className:"text-xs text-muted-foreground min-w-[16px]",children:nh(f(b))}),e[27]=b,e[28]=u,e[29]=f,e[30]=F):F=e[30],e[31]!==l||e[32]!==g||e[33]!==h||e[34]!==b||e[35]!==n||e[36]!==r||e[37]!==i||e[38]!==s||e[39]!==a||e[40]!==f?(Q=h&&y.jsx(Yh,{value:f(b),onChange:X=>{p(X),l||r(X)},minValue:i,maxValue:a,step:s,className:"w-24","aria-label":`${n||"Slider"} value input`,isDisabled:g}),e[31]=l,e[32]=g,e[33]=h,e[34]=b,e[35]=n,e[36]=r,e[37]=i,e[38]=s,e[39]=a,e[40]=f,e[41]=Q):Q=e[41],e[42]!==L||e[43]!==F||e[44]!==Q||e[45]!==j?(W=y.jsxs("div",{className:j,children:[L,F,Q]}),e[42]=L,e[43]=F,e[44]=Q,e[45]=j,e[46]=W):W=e[46],e[47]!==d||e[48]!==v||e[49]!==n||e[50]!==W||e[51]!==S||e[52]!==T?(U=y.jsx(Jo,{label:n,id:v,align:S,fullWidth:d,className:T,children:W}),e[47]=d,e[48]=v,e[49]=n,e[50]=W,e[51]=S,e[52]=T,e[53]=U):U=e[53],U};var hD="Switch",[N0t,i1t]=Wo(hD),[$0t,I0t]=N0t(hD),qAe=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=t,[f,h]=_.useState(null),g=ln(e,k=>h(k)),v=_.useRef(!1),b=!f||u||!!f.closest("form"),[p,O]=Ao({prop:o,defaultProp:i??!1,onChange:c,caller:hD});return y.jsxs($0t,{scope:n,checked:p,disabled:s,children:[y.jsx(_t.button,{type:"button",role:"switch","aria-checked":p,"aria-required":a,"data-state":UAe(p),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:g,onClick:ut(t.onClick,k=>{O(S=>!S),b&&(v.current=k.isPropagationStopped(),v.current||k.stopPropagation())})}),b&&y.jsx(WAe,{control:f,bubbles:!v.current,name:r,value:l,checked:p,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});qAe.displayName=hD;var FAe="SwitchThumb",BAe=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,o=I0t(FAe,n);return y.jsx(_t.span,{"data-state":UAe(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:e})});BAe.displayName=FAe;var WAe=_.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...o},i)=>{const a=_.useRef(null),s=ln(a,i),l=G1(n),c=Jw(e);return _.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&f){const h=new Event("click",{bubbles:r});f.call(u,n),u.dispatchEvent(h)}},[l,n,r]),y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function UAe(t){return t?"checked":"unchecked"}WAe.displayName="SwitchBubbleInput";var ZAe=qAe,Q0t=BAe;let XAe,HAe;XAe=Po("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-[1.5rem] w-[2.75rem] mb-1",sm:"h-[1.125rem] w-[2.125rem]"}},defaultVariants:{size:"default"}}),HAe=Po("pointer-events-none block rounded-full bg-background shadow-xs ring-0 transition-transform",{variants:{size:{default:"h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",sm:"h-3.5 w-3.5 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"}},defaultVariants:{size:"default"}}),mM=_.forwardRef((t,e)=>{const n=ue.c(16);let r,o,i,a,s,l,c;return n[0]!==t?({className:r,size:i,...o}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=i):(r=n[1],o=n[2],i=n[3]),n[4]!==r||n[5]!==i?(a=we(XAe({size:i}),r),n[4]=r,n[5]=i,n[6]=a):a=n[6],n[7]!==i?(s=we(HAe({size:i})),n[7]=i,n[8]=s):s=n[8],n[9]!==s?(l=y.jsx(Q0t,{className:s}),n[9]=s,n[10]=l):l=n[10],n[11]!==o||n[12]!==e||n[13]!==a||n[14]!==l?(c=y.jsx(ZAe,{className:a,...o,ref:e,children:l}),n[11]=o,n[12]=e,n[13]=a,n[14]=l,n[15]=c):c=n[15],c}),mM.displayName=ZAe.displayName;const L0t=t=>{const e=ue.c(9),{value:n,setValue:r,data:o}=t,i=_.useId();let a,s;return e[0]!==o.disabled||e[1]!==i||e[2]!==r||e[3]!==n?(a=y.jsx(mM,{"data-testid":"marimo-plugin-switch",checked:n,onCheckedChange:r,id:i,className:"data-[state=unchecked]:hover:bg-input/80 mb-0",disabled:o.disabled}),e[0]=o.disabled,e[1]=i,e[2]=r,e[3]=n,e[4]=a):a=e[4],e[5]!==o.label||e[6]!==i||e[7]!==a?(s=y.jsx(Jo,{label:o.label,align:"right",id:i,labelClassName:"ml-1",children:a}),e[5]=o.label,e[6]=i,e[7]=a,e[8]=s):s=e[8],s},z0t=t=>{const e=ue.c(13),{tabs:n,value:r,setValue:o,children:i}=t,[a,s]=ge.useState(r||"0");let l;e[0]!==o?(l=g=>{s(g),o(g)},e[0]=o,e[1]=l):l=e[1];const c=l;let u,d,f,h;return r!==a&&r&&s(r),e[2]!==n?(u=n.map(V0t),e[2]=n,e[3]=u):u=e[3],e[4]!==u?(d=y.jsx(Kh,{children:u}),e[4]=u,e[5]=d):d=e[5],e[6]!==i?(f=ge.Children.map(i,q0t),e[6]=i,e[7]=f):f=e[7],e[8]!==c||e[9]!==a||e[10]!==d||e[11]!==f?(h=y.jsxs(sg,{value:a,onValueChange:c,children:[d,f]}),e[8]=c,e[9]=a,e[10]=d,e[11]=f,e[12]=h):h=e[12],h};function V0t(t,e){return y.jsx(Hs,{value:e.toString(),children:Br({html:t})},e)}function q0t(t,e){return y.jsx(ec,{value:e.toString(),children:t})}const F0t=t=>{const e=ue.c(57);let n;e[0]!==t.maxLength||e[1]!==t.value?(n=t.maxLength?y.jsxs("span",{className:"text-muted-foreground text-xs font-medium",children:[t.value.length,"/",t.maxLength]}):null,e[0]=t.maxLength,e[1]=t.value,e[2]=n):n=e[2];const r=n;if(t.debounce===!0){const d=t.label,f=t.fullWidth;let h;e[3]!==t.fullWidth?(h=we("font-code",{"w-full":t.fullWidth}),e[3]=t.fullWidth,e[4]=h):h=e[4];const g=t.minLength!=null&&t.minLength>0;let v,b;return e[5]!==r||e[6]!==t.disabled||e[7]!==t.maxLength||e[8]!==t.minLength||e[9]!==t.placeholder||e[10]!==t.rows||e[11]!==t.setValue||e[12]!==t.value||e[13]!==h||e[14]!==g?(v=y.jsx(rAe,{className:h,rows:t.rows,cols:33,maxLength:t.maxLength,minLength:t.minLength,required:g,disabled:t.disabled,bottomAdornment:r,value:t.value,onValueChange:t.setValue,placeholder:t.placeholder}),e[5]=r,e[6]=t.disabled,e[7]=t.maxLength,e[8]=t.minLength,e[9]=t.placeholder,e[10]=t.rows,e[11]=t.setValue,e[12]=t.value,e[13]=h,e[14]=g,e[15]=v):v=e[15],e[16]!==t.fullWidth||e[17]!==t.label||e[18]!==v?(b=y.jsx(Jo,{label:d,align:"top",fullWidth:f,children:v}),e[16]=t.fullWidth,e[17]=t.label,e[18]=v,e[19]=b):b=e[19],b}if(typeof t.debounce=="number"){const d=t.label,f=t.fullWidth;let h;e[20]!==t.fullWidth?(h=we("font-code",{"w-full":t.fullWidth}),e[20]=t.fullWidth,e[21]=h):h=e[21];const g=t.minLength!=null&&t.minLength>0;let v,b;return e[22]!==r||e[23]!==t.debounce||e[24]!==t.disabled||e[25]!==t.maxLength||e[26]!==t.minLength||e[27]!==t.placeholder||e[28]!==t.rows||e[29]!==t.setValue||e[30]!==t.value||e[31]!==h||e[32]!==g?(v=y.jsx(nAe,{className:h,rows:t.rows,cols:33,maxLength:t.maxLength,minLength:t.minLength,required:g,disabled:t.disabled,bottomAdornment:r,value:t.value,onValueChange:t.setValue,placeholder:t.placeholder,delay:t.debounce}),e[22]=r,e[23]=t.debounce,e[24]=t.disabled,e[25]=t.maxLength,e[26]=t.minLength,e[27]=t.placeholder,e[28]=t.rows,e[29]=t.setValue,e[30]=t.value,e[31]=h,e[32]=g,e[33]=v):v=e[33],e[34]!==t.fullWidth||e[35]!==t.label||e[36]!==v?(b=y.jsx(Jo,{label:d,align:"top",fullWidth:f,children:v}),e[34]=t.fullWidth,e[35]=t.label,e[36]=v,e[37]=b):b=e[37],b}const o=t.label,i=t.fullWidth;let a;e[38]!==t.fullWidth?(a=we("font-code",{"w-full":t.fullWidth}),e[38]=t.fullWidth,e[39]=a):a=e[39];const s=t.minLength!=null&&t.minLength>0;let l,c,u;return e[40]!==t?(l=d=>t.setValue(d.target.value),e[40]=t,e[41]=l):l=e[41],e[42]!==r||e[43]!==t.disabled||e[44]!==t.maxLength||e[45]!==t.minLength||e[46]!==t.placeholder||e[47]!==t.rows||e[48]!==t.value||e[49]!==a||e[50]!==s||e[51]!==l?(c=y.jsx(ug,{className:a,rows:t.rows,cols:33,maxLength:t.maxLength,minLength:t.minLength,required:s,disabled:t.disabled,bottomAdornment:r,value:t.value,onInput:l,placeholder:t.placeholder}),e[42]=r,e[43]=t.disabled,e[44]=t.maxLength,e[45]=t.minLength,e[46]=t.placeholder,e[47]=t.rows,e[48]=t.value,e[49]=a,e[50]=s,e[51]=l,e[52]=c):c=e[52],e[53]!==t.fullWidth||e[54]!==t.label||e[55]!==c?(u=y.jsx(Jo,{label:o,align:"top",fullWidth:i,children:c}),e[53]=t.fullWidth,e[54]=t.label,e[55]=c,e[56]=u):u=e[56],u},B0t=t=>{const e=ue.c(66),[n,r]=_.useState(t.value),o=n??t.value,i=function(D,N){if(!N)return!0;switch(D){case"email":return Pe().email().safeParse(N).success;case"url":return Pe().url().safeParse(N).success;default:return!0}}(t.kind,o);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={text:null,password:y.jsx(rG,{size:16}),email:y.jsx(uce,{size:16}),url:y.jsx(RK,{size:16})},e[0]=a):a=e[0];const s=a;let l;e[1]!==t.maxLength||e[2]!==t.value?(l=t.maxLength?y.jsxs("span",{className:"text-muted-foreground text-xs font-medium",children:[t.value.length,"/",t.maxLength]}):null,e[1]=t.maxLength,e[2]=t.value,e[3]=l):l=e[3];const c=l;if(t.debounce===!0){const D=t.label,N=t.fullWidth,E=t.kind,A=s[t.kind],I=t.placeholder,L=t.maxLength,F=t.minLength,Q=t.minLength!=null&&t.minLength>0,W=t.disabled,U=!i;let X,G,ae;return e[4]!==t.fullWidth||e[5]!==U?(X=we({"border-destructive":U,"w-full":t.fullWidth}),e[4]=t.fullWidth,e[5]=U,e[6]=X):X=e[6],e[7]!==c||e[8]!==t.disabled||e[9]!==t.kind||e[10]!==t.maxLength||e[11]!==t.minLength||e[12]!==t.placeholder||e[13]!==t.setValue||e[14]!==t.value||e[15]!==X||e[16]!==A||e[17]!==Q?(G=y.jsx(Kye,{"data-testid":"marimo-plugin-text-input",type:E,icon:A,placeholder:I,maxLength:L,minLength:F,required:Q,disabled:W,className:X,endAdornment:c,value:t.value,onValueChange:t.setValue}),e[7]=c,e[8]=t.disabled,e[9]=t.kind,e[10]=t.maxLength,e[11]=t.minLength,e[12]=t.placeholder,e[13]=t.setValue,e[14]=t.value,e[15]=X,e[16]=A,e[17]=Q,e[18]=G):G=e[18],e[19]!==t.fullWidth||e[20]!==t.label||e[21]!==G?(ae=y.jsx(Jo,{label:D,fullWidth:N,children:G}),e[19]=t.fullWidth,e[20]=t.label,e[21]=G,e[22]=ae):ae=e[22],ae}if(typeof t.debounce=="number"){const D=t.label,N=t.fullWidth,E=t.kind,A=s[t.kind],I=t.placeholder,L=t.maxLength,F=t.minLength,Q=t.minLength!=null&&t.minLength>0,W=t.disabled,U=!i;let X,G,ae,ne;return e[23]!==t.fullWidth||e[24]!==U?(X=we({"border-destructive":U,"w-full":t.fullWidth}),e[23]=t.fullWidth,e[24]=U,e[25]=X):X=e[25],e[26]===Symbol.for("react.memo_cache_sentinel")?(G=re=>r(re.currentTarget.value),e[26]=G):G=e[26],e[27]!==c||e[28]!==t.debounce||e[29]!==t.disabled||e[30]!==t.kind||e[31]!==t.maxLength||e[32]!==t.minLength||e[33]!==t.placeholder||e[34]!==t.setValue||e[35]!==t.value||e[36]!==X||e[37]!==A||e[38]!==Q?(ae=y.jsx(d0,{"data-testid":"marimo-plugin-text-input",type:E,icon:A,placeholder:I,maxLength:L,minLength:F,required:Q,disabled:W,className:X,endAdornment:c,value:t.value,onValueChange:t.setValue,onBlur:G,delay:t.debounce}),e[27]=c,e[28]=t.debounce,e[29]=t.disabled,e[30]=t.kind,e[31]=t.maxLength,e[32]=t.minLength,e[33]=t.placeholder,e[34]=t.setValue,e[35]=t.value,e[36]=X,e[37]=A,e[38]=Q,e[39]=ae):ae=e[39],e[40]!==t.fullWidth||e[41]!==t.label||e[42]!==ae?(ne=y.jsx(Jo,{label:D,fullWidth:N,children:ae}),e[40]=t.fullWidth,e[41]=t.label,e[42]=ae,e[43]=ne):ne=e[43],ne}const u=t.label,d=t.fullWidth,f=t.kind,h=s[t.kind],g=t.placeholder,v=t.maxLength,b=t.minLength,p=t.minLength!=null&&t.minLength>0,O=t.disabled,k=!i;let S,w,T,P,j;return e[44]!==t.fullWidth||e[45]!==k?(S=we({"border-destructive":k,"w-full":t.fullWidth}),e[44]=t.fullWidth,e[45]=k,e[46]=S):S=e[46],e[47]!==t?(w=D=>t.setValue(D.currentTarget.value),e[47]=t,e[48]=w):w=e[48],e[49]===Symbol.for("react.memo_cache_sentinel")?(T=D=>r(D.currentTarget.value),e[49]=T):T=e[49],e[50]!==c||e[51]!==t.disabled||e[52]!==t.kind||e[53]!==t.maxLength||e[54]!==t.minLength||e[55]!==t.placeholder||e[56]!==t.value||e[57]!==S||e[58]!==w||e[59]!==h||e[60]!==p?(P=y.jsx(tf,{"data-testid":"marimo-plugin-text-input",type:f,icon:h,placeholder:g,maxLength:v,minLength:b,required:p,disabled:O,className:S,endAdornment:c,value:t.value,onInput:w,onBlur:T}),e[50]=c,e[51]=t.disabled,e[52]=t.kind,e[53]=t.maxLength,e[54]=t.minLength,e[55]=t.placeholder,e[56]=t.value,e[57]=S,e[58]=w,e[59]=h,e[60]=p,e[61]=P):P=e[61],e[62]!==t.fullWidth||e[63]!==t.label||e[64]!==P?(j=y.jsx(Jo,{label:u,fullWidth:d,children:P}),e[62]=t.fullWidth,e[63]=t.label,e[64]=P,e[65]=j):j=e[65],j},W0t=ge.lazy(()=>Be(()=>import("./vega-component-CLT_xHWY.js"),__vite__mapDeps([135,101,102,103,104,105,106,107,108,109,110,111,112,100,113]),import.meta.url)),U0t=t=>{const e=ue.c(8),{labels:n,multiple:r,children:o}=t,i=r?"multiple":"single";let a,s;if(e[0]!==o||e[1]!==n){let l;e[3]!==n?(l=(c,u)=>y.jsxs(ky,{value:u.toString(),children:[y.jsx(qO,{className:"py-2 text-md",children:Br({html:n[u]})}),y.jsx(wy,{className:"text-md",children:c})]},u),e[3]=n,e[4]=l):l=e[4],a=ge.Children.map(o,l),e[0]=o,e[1]=n,e[2]=a}else a=e[2];return e[5]!==a||e[6]!==i?(s=y.jsx(Sy,{type:i,className:"text-muted-foreground",collapsible:!0,children:a}),e[5]=a,e[6]=i,e[7]=s):s=e[7],s},Z0t=Po("border rounded-lg p-12 mt-12 mb-12 text-foreground shadow-[4px_4px_0px_0px]",{variants:{kind:{neutral:"border-[var(--slate-9)] shadow-[var(--slate-8)]",alert:"bg-[var(--red-2)] border-[var(--red-9)] shadow-[var(--red-8)]",info:"bg-[var(--sky-1)] border-[var(--sky-8)] shadow-[var(--sky-7)]",danger:"bg-[var(--red-2)] border-[var(--red-9)] shadow-[var(--red-8)]",warn:"bg-[var(--amber-2)] border-[var(--amber-9)] shadow-[var(--amber-8)]",success:"bg-[var(--grass-2)] border-[var(--grass-9)] shadow-[var(--grass-8)]"}},defaultVariants:{kind:"neutral"}}),YAe=_.memo(t=>{const e=ue.c(7),{html:n,kind:r}=t;let o,i,a;return e[0]!==r?(o=Z0t({kind:r}),e[0]=r,e[1]=o):o=e[1],e[2]!==n?(i=y.jsx(BE,{html:n}),e[2]=n,e[3]=i):i=e[3],e[4]!==o||e[5]!==i?(a=y.jsx("div",{className:o,children:i}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a});YAe.displayName="CalloutOutput";const X0t=ge.lazy(()=>Be(()=>import("./slides-component-CcPfoe4P.js"),__vite__mapDeps([136,137]),import.meta.url)),H0t=lu("marimo-download").withData(Qe({data:Pe(),disabled:pt().default(!1),filename:Pe().nullish(),label:Pe().nullish(),lazy:pt().default(!1)})).withFunctions({load:_i.input(Qe({})).output(Qe({data:Pe(),filename:Pe().nullish()}))}).renderer(t=>y.jsx(Y0t,{data:t.data,...t.functions})),Y0t=({data:t,load:e})=>{const[n,r]=_.useState(!1),o=n?af:DA,i=t.label?Br({html:t.label}):"Download";return y.jsxs("a",{href:t.data,download:t.filename||!0,target:"_blank",rel:"noopener noreferrer",onClick:async a=>{if(t.lazy&&!t.disabled){a.preventDefault(),r(!0);try{const s=await e({});ZO(s.data,s.filename||t.filename||"download")}catch(s){Kr({title:"Failed to download",description:"Please try again."}),Ve.error("Failed to download:",s)}finally{r(!1)}}},className:fs({variant:"secondary",disabled:t.disabled||n}),children:[y.jsx(o,{className:we("w-3 h-3",t.label&&"mr-2",n&&"animate-spin")}),i]})},G0t=ge.lazy(()=>Be(()=>import("./ImageComparisonComponent-YdaNaDey.js"),[],import.meta.url)),K0t=lu("marimo-lazy").withData(Qe({showLoadingIndicator:pt().default(!1)})).withFunctions({load:_i.input(Qe({})).output(Qe({html:Pe()}))}).renderer(t=>y.jsx(J0t,{value:t.value,setValue:t.setValue,...t.data,...t.functions})),J0t=t=>{const e=ue.c(15),{load:n,showLoadingIndicator:r,value:o,setValue:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={threshold:0,root:null,rootMargin:"0px"},e[0]=a):a=e[0];const[s,l]=xke(a);let c,u;l!=null&&l.isIntersecting&&!o&&i(!0),e[1]!==n||e[2]!==o?(c=b=>o?n({}):(b.previous(),Promise.resolve(void 0)),e[1]=n,e[2]=o,e[3]=c):c=e[3],e[4]!==o?(u=[o],e[4]=o,e[5]=u):u=e[5];const{data:d,error:f,isPending:h}=$a(c,u);if(f){let b;return e[6]!==f?(b=y.jsx(Hd,{error:f}),e[6]=f,e[7]=b):b=e[7],b}let g,v;return e[8]!==d||e[9]!==h||e[10]!==r?(g=h&&r?y.jsx(af,{className:"w-12 h-12 animate-spin text-primary my-4 mx-4"}):d&&Br({html:d.html}),e[8]=d,e[9]=h,e[10]=r,e[11]=g):g=e[11],e[12]!==s||e[13]!==g?(v=y.jsx("div",{ref:s,className:"min-h-4",children:g}),e[12]=s,e[13]=g,e[14]=v):v=e[14],v},evt=_.lazy(()=>Be(()=>import("./mermaid-DBrEGSCd.js").then(async t=>(await t.__tla,t)).then(t=>t.aq),__vite__mapDeps([138,128,103,110]),import.meta.url));var GAe,KAe={exports:{}},tvt=(GAe||(GAe=1,function(t){(function(){var e=Object.assign||function(p){for(var O,k=1;k<arguments.length;k++)for(var S in O=arguments[k])f(O,S)&&(p[S]=O[S]);return p},n=Array.isArray||function(p){return Object.prototype.toString.call(p)==="[object Array]"},r=i(function(p){return p===1?"\u03C7\u03C1\u03CC\u03BD\u03BF\u03C2":"\u03C7\u03C1\u03CC\u03BD\u03B9\u03B1"},function(p){return p===1?"\u03BC\u03AE\u03BD\u03B1\u03C2":"\u03BC\u03AE\u03BD\u03B5\u03C2"},function(p){return p===1?"\u03B5\u03B2\u03B4\u03BF\u03BC\u03AC\u03B4\u03B1":"\u03B5\u03B2\u03B4\u03BF\u03BC\u03AC\u03B4\u03B5\u03C2"},function(p){return p===1?"\u03BC\u03AD\u03C1\u03B1":"\u03BC\u03AD\u03C1\u03B5\u03C2"},function(p){return p===1?"\u03CE\u03C1\u03B1":"\u03CE\u03C1\u03B5\u03C2"},function(p){return p===1?"\u03BB\u03B5\u03C0\u03C4\u03CC":"\u03BB\u03B5\u03C0\u03C4\u03AC"},function(p){return p===1?"\u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03BF":"\u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03B1"},function(p){return(p===1?"\u03C7\u03B9\u03BB\u03B9\u03BF\u03C3\u03C4\u03CC":"\u03C7\u03B9\u03BB\u03B9\u03BF\u03C3\u03C4\u03AC")+" \u03C4\u03BF\u03C5 \u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03BF\u03BB\u03AD\u03C0\u03C4\u03BF\u03C5"},","),o={af:i("jaar",function(p){return"maand"+(p===1?"":"e")},function(p){return p===1?"week":"weke"},function(p){return p===1?"dag":"dae"},function(p){return p===1?"uur":"ure"},function(p){return p===1?"minuut":"minute"},function(p){return"sekonde"+(p===1?"":"s")},function(p){return"millisekonde"+(p===1?"":"s")},","),am:i("\u12D3\u1218\u1275","\u12C8\u122D","\u1233\u121D\u1295\u1275","\u1240\u1295","\u1230\u12D3\u1275","\u12F0\u1242\u1243","\u1230\u12A8\u1295\u12F5","\u121A\u120A\u1230\u12A8\u1295\u12F5"),ar:e(i(function(p){return["\u0633\u0646\u0629","\u0633\u0646\u062A\u0627\u0646","\u0633\u0646\u0648\u0627\u062A"][a(p)]},function(p){return["\u0634\u0647\u0631","\u0634\u0647\u0631\u0627\u0646","\u0623\u0634\u0647\u0631"][a(p)]},function(p){return["\u0623\u0633\u0628\u0648\u0639","\u0623\u0633\u0628\u0648\u0639\u064A\u0646","\u0623\u0633\u0627\u0628\u064A\u0639"][a(p)]},function(p){return["\u064A\u0648\u0645","\u064A\u0648\u0645\u064A\u0646","\u0623\u064A\u0627\u0645"][a(p)]},function(p){return["\u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u062A\u064A\u0646","\u0633\u0627\u0639\u0627\u062A"][a(p)]},function(p){return["\u062F\u0642\u064A\u0642\u0629","\u062F\u0642\u064A\u0642\u062A\u0627\u0646","\u062F\u0642\u0627\u0626\u0642"][a(p)]},function(p){return["\u062B\u0627\u0646\u064A\u0629","\u062B\u0627\u0646\u064A\u062A\u0627\u0646","\u062B\u0648\u0627\u0646\u064A"][a(p)]},function(p){return["\u062C\u0632\u0621 \u0645\u0646 \u0627\u0644\u062B\u0627\u0646\u064A\u0629","\u062C\u0632\u0622\u0646 \u0645\u0646 \u0627\u0644\u062B\u0627\u0646\u064A\u0629","\u0623\u062C\u0632\u0627\u0621 \u0645\u0646 \u0627\u0644\u062B\u0627\u0646\u064A\u0629"][a(p)]},","),{delimiter:" \uFEED ",_hideCountIf2:!0,_digitReplacements:["\u06F0","\u0661","\u0662","\u0663","\u0664","\u0665","\u0666","\u0667","\u0668","\u0669"]}),bg:i(function(p){return["\u0433\u043E\u0434\u0438\u043D\u0438","\u0433\u043E\u0434\u0438\u043D\u0430","\u0433\u043E\u0434\u0438\u043D\u0438"][l(p)]},function(p){return["\u043C\u0435\u0441\u0435\u0446\u0430","\u043C\u0435\u0441\u0435\u0446","\u043C\u0435\u0441\u0435\u0446\u0430"][l(p)]},function(p){return["\u0441\u0435\u0434\u043C\u0438\u0446\u0438","\u0441\u0435\u0434\u043C\u0438\u0446\u0430","\u0441\u0435\u0434\u043C\u0438\u0446\u0438"][l(p)]},function(p){return["\u0434\u043D\u0438","\u0434\u0435\u043D","\u0434\u043D\u0438"][l(p)]},function(p){return["\u0447\u0430\u0441\u0430","\u0447\u0430\u0441","\u0447\u0430\u0441\u0430"][l(p)]},function(p){return["\u043C\u0438\u043D\u0443\u0442\u0438","\u043C\u0438\u043D\u0443\u0442\u0430","\u043C\u0438\u043D\u0443\u0442\u0438"][l(p)]},function(p){return["\u0441\u0435\u043A\u0443\u043D\u0434\u0438","\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u0441\u0435\u043A\u0443\u043D\u0434\u0438"][l(p)]},function(p){return["\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0438","\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0438"][l(p)]},","),bn:i("\u09AC\u099B\u09B0","\u09AE\u09BE\u09B8","\u09B8\u09AA\u09CD\u09A4\u09BE\u09B9","\u09A6\u09BF\u09A8","\u0998\u09A8\u09CD\u099F\u09BE","\u09AE\u09BF\u09A8\u09BF\u099F","\u09B8\u09C7\u0995\u09C7\u09A8\u09CD\u09A1","\u09AE\u09BF\u09B2\u09BF\u09B8\u09C7\u0995\u09C7\u09A8\u09CD\u09A1"),ca:i(function(p){return"any"+(p===1?"":"s")},function(p){return"mes"+(p===1?"":"os")},function(p){return"setman"+(p===1?"a":"es")},function(p){return"di"+(p===1?"a":"es")},function(p){return"hor"+(p===1?"a":"es")},function(p){return"minut"+(p===1?"":"s")},function(p){return"segon"+(p===1?"":"s")},function(p){return"milisegon"+(p===1?"":"s")},","),ckb:i("\u0633\u0627\u06B5","\u0645\u0627\u0646\u06AF","\u0647\u06D5\u0641\u062A\u06D5","\u0695\u06C6\u0698","\u06A9\u0627\u0698\u06CE\u0631","\u062E\u0648\u0644\u06D5\u06A9","\u0686\u0631\u06A9\u06D5","\u0645\u06CC\u0644\u06CC \u0686\u0631\u06A9\u06D5","."),cs:i(function(p){return["rok","roku","roky","let"][c(p)]},function(p){return["m\u011Bs\xEDc","m\u011Bs\xEDce","m\u011Bs\xEDce","m\u011Bs\xEDc\u016F"][c(p)]},function(p){return["t\xFDden","t\xFDdne","t\xFDdny","t\xFDdn\u016F"][c(p)]},function(p){return["den","dne","dny","dn\xED"][c(p)]},function(p){return["hodina","hodiny","hodiny","hodin"][c(p)]},function(p){return["minuta","minuty","minuty","minut"][c(p)]},function(p){return["sekunda","sekundy","sekundy","sekund"][c(p)]},function(p){return["milisekunda","milisekundy","milisekundy","milisekund"][c(p)]},","),cy:i("flwyddyn","mis","wythnos","diwrnod","awr","munud","eiliad","milieiliad"),da:i("\xE5r",function(p){return"m\xE5ned"+(p===1?"":"er")},function(p){return"uge"+(p===1?"":"r")},function(p){return"dag"+(p===1?"":"e")},function(p){return"time"+(p===1?"":"r")},function(p){return"minut"+(p===1?"":"ter")},function(p){return"sekund"+(p===1?"":"er")},function(p){return"millisekund"+(p===1?"":"er")},","),de:i(function(p){return"Jahr"+(p===1?"":"e")},function(p){return"Monat"+(p===1?"":"e")},function(p){return"Woche"+(p===1?"":"n")},function(p){return"Tag"+(p===1?"":"e")},function(p){return"Stunde"+(p===1?"":"n")},function(p){return"Minute"+(p===1?"":"n")},function(p){return"Sekunde"+(p===1?"":"n")},function(p){return"Millisekunde"+(p===1?"":"n")},","),el:r,en:i(function(p){return"year"+(p===1?"":"s")},function(p){return"month"+(p===1?"":"s")},function(p){return"week"+(p===1?"":"s")},function(p){return"day"+(p===1?"":"s")},function(p){return"hour"+(p===1?"":"s")},function(p){return"minute"+(p===1?"":"s")},function(p){return"second"+(p===1?"":"s")},function(p){return"millisecond"+(p===1?"":"s")}),eo:i(function(p){return"jaro"+(p===1?"":"j")},function(p){return"monato"+(p===1?"":"j")},function(p){return"semajno"+(p===1?"":"j")},function(p){return"tago"+(p===1?"":"j")},function(p){return"horo"+(p===1?"":"j")},function(p){return"minuto"+(p===1?"":"j")},function(p){return"sekundo"+(p===1?"":"j")},function(p){return"milisekundo"+(p===1?"":"j")},","),es:i(function(p){return"a\xF1o"+(p===1?"":"s")},function(p){return"mes"+(p===1?"":"es")},function(p){return"semana"+(p===1?"":"s")},function(p){return"d\xEDa"+(p===1?"":"s")},function(p){return"hora"+(p===1?"":"s")},function(p){return"minuto"+(p===1?"":"s")},function(p){return"segundo"+(p===1?"":"s")},function(p){return"milisegundo"+(p===1?"":"s")},","),et:i(function(p){return"aasta"+(p===1?"":"t")},function(p){return"kuu"+(p===1?"":"d")},function(p){return"n\xE4dal"+(p===1?"":"at")},function(p){return"p\xE4ev"+(p===1?"":"a")},function(p){return"tund"+(p===1?"":"i")},function(p){return"minut"+(p===1?"":"it")},function(p){return"sekund"+(p===1?"":"it")},function(p){return"millisekund"+(p===1?"":"it")},","),eu:i("urte","hilabete","aste","egun","ordu","minutu","segundo","milisegundo",","),fa:i("\u0633\u0627\u0644","\u0645\u0627\u0647","\u0647\u0641\u062A\u0647","\u0631\u0648\u0632","\u0633\u0627\u0639\u062A","\u062F\u0642\u06CC\u0642\u0647","\u062B\u0627\u0646\u06CC\u0647","\u0645\u06CC\u0644\u06CC \u062B\u0627\u0646\u06CC\u0647"),fi:i(function(p){return p===1?"vuosi":"vuotta"},function(p){return p===1?"kuukausi":"kuukautta"},function(p){return"viikko"+(p===1?"":"a")},function(p){return"p\xE4iv\xE4"+(p===1?"":"\xE4")},function(p){return"tunti"+(p===1?"":"a")},function(p){return"minuutti"+(p===1?"":"a")},function(p){return"sekunti"+(p===1?"":"a")},function(p){return"millisekunti"+(p===1?"":"a")},","),fo:i("\xE1r",function(p){return p===1?"m\xE1na\xF0ur":"m\xE1na\xF0ir"},function(p){return p===1?"vika":"vikur"},function(p){return p===1?"dagur":"dagar"},function(p){return p===1?"t\xEDmi":"t\xEDmar"},function(p){return p===1?"minuttur":"minuttir"},"sekund","millisekund",","),fr:i(function(p){return"an"+(p>=2?"s":"")},"mois",function(p){return"semaine"+(p>=2?"s":"")},function(p){return"jour"+(p>=2?"s":"")},function(p){return"heure"+(p>=2?"s":"")},function(p){return"minute"+(p>=2?"s":"")},function(p){return"seconde"+(p>=2?"s":"")},function(p){return"milliseconde"+(p>=2?"s":"")},","),gr:r,he:i(function(p){return p===1?"\u05E9\u05E0\u05D4":"\u05E9\u05E0\u05D9\u05DD"},function(p){return p===1?"\u05D7\u05D5\u05D3\u05E9":"\u05D7\u05D5\u05D3\u05E9\u05D9\u05DD"},function(p){return p===1?"\u05E9\u05D1\u05D5\u05E2":"\u05E9\u05D1\u05D5\u05E2\u05D5\u05EA"},function(p){return p===1?"\u05D9\u05D5\u05DD":"\u05D9\u05DE\u05D9\u05DD"},function(p){return p===1?"\u05E9\u05E2\u05D4":"\u05E9\u05E2\u05D5\u05EA"},function(p){return p===1?"\u05D3\u05E7\u05D4":"\u05D3\u05E7\u05D5\u05EA"},function(p){return p===1?"\u05E9\u05E0\u05D9\u05D4":"\u05E9\u05E0\u05D9\u05D5\u05EA"},function(p){return p===1?"\u05DE\u05D9\u05DC\u05D9\u05E9\u05E0\u05D9\u05D9\u05D4":"\u05DE\u05D9\u05DC\u05D9\u05E9\u05E0\u05D9\u05D5\u05EA"}),hr:i(function(p){return p%10==2||p%10==3||p%10==4?"godine":"godina"},function(p){return p===1?"mjesec":p===2||p===3||p===4?"mjeseca":"mjeseci"},function(p){return p%10==1&&p!==11?"tjedan":"tjedna"},function(p){return p===1?"dan":"dana"},function(p){return p===1?"sat":p===2||p===3||p===4?"sata":"sati"},function(p){var O=p%10;return O!==2&&O!==3&&O!==4||!(p<10||p>14)?"minuta":"minute"},function(p){var O=p%10;return O===5||Math.floor(p)===p&&p>=10&&p<=19?"sekundi":O===1?"sekunda":O===2||O===3||O===4?"sekunde":"sekundi"},function(p){return p===1?"milisekunda":p%10==2||p%10==3||p%10==4?"milisekunde":"milisekundi"},","),hi:i("\u0938\u093E\u0932",function(p){return p===1?"\u092E\u0939\u0940\u0928\u093E":"\u092E\u0939\u0940\u0928\u0947"},function(p){return p===1?"\u0939\u095E\u094D\u0924\u093E":"\u0939\u092B\u094D\u0924\u0947"},"\u0926\u093F\u0928",function(p){return p===1?"\u0918\u0902\u091F\u093E":"\u0918\u0902\u091F\u0947"},"\u092E\u093F\u0928\u091F","\u0938\u0947\u0915\u0902\u0921","\u092E\u093F\u0932\u0940\u0938\u0947\u0915\u0902\u0921"),hu:i("\xE9v","h\xF3nap","h\xE9t","nap","\xF3ra","perc","m\xE1sodperc","ezredm\xE1sodperc",","),id:i("tahun","bulan","minggu","hari","jam","menit","detik","milidetik"),is:i("\xE1r",function(p){return"m\xE1nu\xF0"+(p===1?"ur":"ir")},function(p){return"vik"+(p===1?"a":"ur")},function(p){return"dag"+(p===1?"ur":"ar")},function(p){return"klukkut\xEDm"+(p===1?"i":"ar")},function(p){return"m\xEDn\xFAt"+(p===1?"a":"ur")},function(p){return"sek\xFAnd"+(p===1?"a":"ur")},function(p){return"millisek\xFAnd"+(p===1?"a":"ur")}),it:i(function(p){return"ann"+(p===1?"o":"i")},function(p){return"mes"+(p===1?"e":"i")},function(p){return"settiman"+(p===1?"a":"e")},function(p){return"giorn"+(p===1?"o":"i")},function(p){return"or"+(p===1?"a":"e")},function(p){return"minut"+(p===1?"o":"i")},function(p){return"second"+(p===1?"o":"i")},function(p){return"millisecond"+(p===1?"o":"i")},","),ja:i("\u5E74","\u30F6\u6708","\u9031\u9593","\u65E5","\u6642\u9593","\u5206","\u79D2","\u30DF\u30EA\u79D2"),km:i("\u1786\u17D2\u1793\u17B6\u17C6","\u1781\u17C2","\u179F\u1794\u17D2\u178F\u17B6\u17A0\u17CD","\u1790\u17D2\u1784\u17C3","\u1798\u17C9\u17C4\u1784","\u1793\u17B6\u1791\u17B8","\u179C\u17B7\u1793\u17B6\u1791\u17B8","\u1798\u17B7\u179B\u17D2\u179B\u17B8\u179C\u17B7\u1793\u17B6\u1791\u17B8"),kn:i(function(p){return p===1?"\u0CB5\u0CB0\u0CCD\u0CB7":"\u0CB5\u0CB0\u0CCD\u0CB7\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CA4\u0CBF\u0C82\u0C97\u0CB3\u0CC1":"\u0CA4\u0CBF\u0C82\u0C97\u0CB3\u0CC1\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CB5\u0CBE\u0CB0":"\u0CB5\u0CBE\u0CB0\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CA6\u0CBF\u0CA8":"\u0CA6\u0CBF\u0CA8\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0C97\u0C82\u0C9F\u0CC6":"\u0C97\u0C82\u0C9F\u0CC6\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CA8\u0CBF\u0CAE\u0CBF\u0CB7":"\u0CA8\u0CBF\u0CAE\u0CBF\u0CB7\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CB8\u0CC6\u0C95\u0CC6\u0C82\u0CA1\u0CCD":"\u0CB8\u0CC6\u0C95\u0CC6\u0C82\u0CA1\u0CC1\u0C97\u0CB3\u0CC1"},function(p){return p===1?"\u0CAE\u0CBF\u0CB2\u0CBF\u0CB8\u0CC6\u0C95\u0CC6\u0C82\u0CA1\u0CCD":"\u0CAE\u0CBF\u0CB2\u0CBF\u0CB8\u0CC6\u0C95\u0CC6\u0C82\u0CA1\u0CC1\u0C97\u0CB3\u0CC1"}),ko:i("\uB144","\uAC1C\uC6D4","\uC8FC\uC77C","\uC77C","\uC2DC\uAC04","\uBD84","\uCD08","\uBC00\uB9AC \uCD08"),ku:i("sal","meh","hefte","roj","seet","deqe","saniye","m\xEEl\xEE\xE7irk",","),lo:i("\u0E9B\u0EB5","\u0EC0\u0E94\u0EB7\u0EAD\u0E99","\u0EAD\u0EB2\u0E97\u0EB4\u0E94","\u0EA1\u0EB7\u0EC9","\u0E8A\u0EBB\u0EC8\u0EA7\u0EC2\u0EA1\u0E87","\u0E99\u0EB2\u0E97\u0EB5","\u0EA7\u0EB4\u0E99\u0EB2\u0E97\u0EB5","\u0EA1\u0EB4\u0E99\u0EA5\u0EB4\u0EA7\u0EB4\u0E99\u0EB2\u0E97\u0EB5",","),lt:i(function(p){return p%10==0||p%100>=10&&p%100<=20?"met\u0173":"metai"},function(p){return["m\u0117nuo","m\u0117nesiai","m\u0117nesi\u0173"][u(p)]},function(p){return["savait\u0117","savait\u0117s","savai\u010Di\u0173"][u(p)]},function(p){return["diena","dienos","dien\u0173"][u(p)]},function(p){return["valanda","valandos","valand\u0173"][u(p)]},function(p){return["minut\u0117","minut\u0117s","minu\u010Di\u0173"][u(p)]},function(p){return["sekund\u0117","sekund\u0117s","sekund\u017Ei\u0173"][u(p)]},function(p){return["milisekund\u0117","milisekund\u0117s","milisekund\u017Ei\u0173"][u(p)]},","),lv:i(function(p){return d(p)?"gads":"gadi"},function(p){return d(p)?"m\u0113nesis":"m\u0113ne\u0161i"},function(p){return d(p)?"ned\u0113\u013Ca":"ned\u0113\u013Cas"},function(p){return d(p)?"diena":"dienas"},function(p){return d(p)?"stunda":"stundas"},function(p){return d(p)?"min\u016Bte":"min\u016Btes"},function(p){return d(p)?"sekunde":"sekundes"},function(p){return d(p)?"milisekunde":"milisekundes"},","),mk:i(function(p){return p===1?"\u0433\u043E\u0434\u0438\u043D\u0430":"\u0433\u043E\u0434\u0438\u043D\u0438"},function(p){return p===1?"\u043C\u0435\u0441\u0435\u0446":"\u043C\u0435\u0441\u0435\u0446\u0438"},function(p){return p===1?"\u043D\u0435\u0434\u0435\u043B\u0430":"\u043D\u0435\u0434\u0435\u043B\u0438"},function(p){return p===1?"\u0434\u0435\u043D":"\u0434\u0435\u043D\u0430"},function(p){return p===1?"\u0447\u0430\u0441":"\u0447\u0430\u0441\u0430"},function(p){return p===1?"\u043C\u0438\u043D\u0443\u0442\u0430":"\u043C\u0438\u043D\u0443\u0442\u0438"},function(p){return p===1?"\u0441\u0435\u043A\u0443\u043D\u0434\u0430":"\u0441\u0435\u043A\u0443\u043D\u0434\u0438"},function(p){return p===1?"\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430":"\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0438"},","),mn:i("\u0436\u0438\u043B","\u0441\u0430\u0440","\u0434\u043E\u043B\u043E\u043E \u0445\u043E\u043D\u043E\u0433","\u04E9\u0434\u04E9\u0440","\u0446\u0430\u0433","\u043C\u0438\u043D\u0443\u0442","\u0441\u0435\u043A\u0443\u043D\u0434","\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434"),mr:i(function(p){return p===1?"\u0935\u0930\u094D\u0937":"\u0935\u0930\u094D\u0937\u0947"},function(p){return p===1?"\u092E\u0939\u093F\u0928\u093E":"\u092E\u0939\u093F\u0928\u0947"},function(p){return p===1?"\u0906\u0920\u0935\u0921\u093E":"\u0906\u0920\u0935\u0921\u0947"},"\u0926\u093F\u0935\u0938","\u0924\u093E\u0938",function(p){return p===1?"\u092E\u093F\u0928\u093F\u091F":"\u092E\u093F\u0928\u093F\u091F\u0947"},"\u0938\u0947\u0915\u0902\u0926","\u092E\u093F\u0932\u093F\u0938\u0947\u0915\u0902\u0926"),ms:i("tahun","bulan","minggu","hari","jam","minit","saat","milisaat"),nl:i("jaar",function(p){return p===1?"maand":"maanden"},function(p){return p===1?"week":"weken"},function(p){return p===1?"dag":"dagen"},"uur",function(p){return p===1?"minuut":"minuten"},function(p){return p===1?"seconde":"seconden"},function(p){return p===1?"milliseconde":"milliseconden"},","),no:i("\xE5r",function(p){return"m\xE5ned"+(p===1?"":"er")},function(p){return"uke"+(p===1?"":"r")},function(p){return"dag"+(p===1?"":"er")},function(p){return"time"+(p===1?"":"r")},function(p){return"minutt"+(p===1?"":"er")},function(p){return"sekund"+(p===1?"":"er")},function(p){return"millisekund"+(p===1?"":"er")},","),pl:i(function(p){return["rok","roku","lata","lat"][s(p)]},function(p){return["miesi\u0105c","miesi\u0105ca","miesi\u0105ce","miesi\u0119cy"][s(p)]},function(p){return["tydzie\u0144","tygodnia","tygodnie","tygodni"][s(p)]},function(p){return["dzie\u0144","dnia","dni","dni"][s(p)]},function(p){return["godzina","godziny","godziny","godzin"][s(p)]},function(p){return["minuta","minuty","minuty","minut"][s(p)]},function(p){return["sekunda","sekundy","sekundy","sekund"][s(p)]},function(p){return["milisekunda","milisekundy","milisekundy","milisekund"][s(p)]},","),pt:i(function(p){return"ano"+(p===1?"":"s")},function(p){return p===1?"m\xEAs":"meses"},function(p){return"semana"+(p===1?"":"s")},function(p){return"dia"+(p===1?"":"s")},function(p){return"hora"+(p===1?"":"s")},function(p){return"minuto"+(p===1?"":"s")},function(p){return"segundo"+(p===1?"":"s")},function(p){return"milissegundo"+(p===1?"":"s")},","),ro:i(function(p){return p===1?"an":"ani"},function(p){return p===1?"lun\u0103":"luni"},function(p){return p===1?"s\u0103pt\u0103m\xE2n\u0103":"s\u0103pt\u0103m\xE2ni"},function(p){return p===1?"zi":"zile"},function(p){return p===1?"or\u0103":"ore"},function(p){return p===1?"minut":"minute"},function(p){return p===1?"secund\u0103":"secunde"},function(p){return p===1?"milisecund\u0103":"milisecunde"},","),ru:i(function(p){return["\u043B\u0435\u0442","\u0433\u043E\u0434","\u0433\u043E\u0434\u0430"][l(p)]},function(p){return["\u043C\u0435\u0441\u044F\u0446\u0435\u0432","\u043C\u0435\u0441\u044F\u0446","\u043C\u0435\u0441\u044F\u0446\u0430"][l(p)]},function(p){return["\u043D\u0435\u0434\u0435\u043B\u044C","\u043D\u0435\u0434\u0435\u043B\u044F","\u043D\u0435\u0434\u0435\u043B\u0438"][l(p)]},function(p){return["\u0434\u043D\u0435\u0439","\u0434\u0435\u043D\u044C","\u0434\u043D\u044F"][l(p)]},function(p){return["\u0447\u0430\u0441\u043E\u0432","\u0447\u0430\u0441","\u0447\u0430\u0441\u0430"][l(p)]},function(p){return["\u043C\u0438\u043D\u0443\u0442","\u043C\u0438\u043D\u0443\u0442\u0430","\u043C\u0438\u043D\u0443\u0442\u044B"][l(p)]},function(p){return["\u0441\u0435\u043A\u0443\u043D\u0434","\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u0441\u0435\u043A\u0443\u043D\u0434\u044B"][l(p)]},function(p){return["\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434","\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u044B"][l(p)]},","),sq:i(function(p){return p===1?"vit":"vjet"},"muaj","jav\xEB","dit\xEB","or\xEB",function(p){return"minut"+(p===1?"\xEB":"a")},function(p){return"sekond"+(p===1?"\xEB":"a")},function(p){return"milisekond"+(p===1?"\xEB":"a")},","),sr:i(function(p){return["\u0433\u043E\u0434\u0438\u043D\u0438","\u0433\u043E\u0434\u0438\u043D\u0430","\u0433\u043E\u0434\u0438\u043D\u0435"][l(p)]},function(p){return["\u043C\u0435\u0441\u0435\u0446\u0438","\u043C\u0435\u0441\u0435\u0446","\u043C\u0435\u0441\u0435\u0446\u0430"][l(p)]},function(p){return["\u043D\u0435\u0434\u0435\u0459\u0438","\u043D\u0435\u0434\u0435\u0459\u0430","\u043D\u0435\u0434\u0435\u0459\u0435"][l(p)]},function(p){return["\u0434\u0430\u043D\u0438","\u0434\u0430\u043D","\u0434\u0430\u043D\u0430"][l(p)]},function(p){return["\u0441\u0430\u0442\u0438","\u0441\u0430\u0442","\u0441\u0430\u0442\u0430"][l(p)]},function(p){return["\u043C\u0438\u043D\u0443\u0442\u0430","\u043C\u0438\u043D\u0443\u0442","\u043C\u0438\u043D\u0443\u0442\u0430"][l(p)]},function(p){return["\u0441\u0435\u043A\u0443\u043D\u0434\u0438","\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u0441\u0435\u043A\u0443\u043D\u0434\u0435"][l(p)]},function(p){return["\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0438","\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u043C\u0438\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0435"][l(p)]},","),sr_Latn:i(function(p){return["godini","godina","godine"][l(p)]},function(p){return["meseci","mesec","meseca"][l(p)]},function(p){return["nedelji","nedelja","nedelje"][l(p)]},function(p){return["dani","dan","dana"][l(p)]},function(p){return["sati","sat","sata"][l(p)]},function(p){return["minuta","minut","minuta"][l(p)]},function(p){return["sekundi","sekunda","sekunde"][l(p)]},function(p){return["milisekundi","milisekunda","milisekunde"][l(p)]},","),ta:i(function(p){return p===1?"\u0BB5\u0BB0\u0BC1\u0B9F\u0BAE\u0BCD":"\u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD"},function(p){return p===1?"\u0BAE\u0BBE\u0BA4\u0BAE\u0BCD":"\u0BAE\u0BBE\u0BA4\u0B99\u0BCD\u0B95\u0BB3\u0BCD"},function(p){return p===1?"\u0BB5\u0BBE\u0BB0\u0BAE\u0BCD":"\u0BB5\u0BBE\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BCD"},function(p){return p===1?"\u0BA8\u0BBE\u0BB3\u0BCD":"\u0BA8\u0BBE\u0B9F\u0BCD\u0B95\u0BB3\u0BCD"},function(p){return p===1?"\u0BAE\u0BA3\u0BBF":"\u0BAE\u0BA3\u0BBF\u0BA8\u0BC7\u0BB0\u0BAE\u0BCD"},function(p){return"\u0BA8\u0BBF\u0BAE\u0BBF\u0B9F"+(p===1?"\u0BAE\u0BCD":"\u0B99\u0BCD\u0B95\u0BB3\u0BCD")},function(p){return"\u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF"+(p===1?"":"\u0B95\u0BB3\u0BCD")},function(p){return"\u0BAE\u0BBF\u0BB2\u0BCD\u0BB2\u0BBF \u0BB5\u0BBF\u0BA8\u0BBE\u0B9F\u0BBF"+(p===1?"":"\u0B95\u0BB3\u0BCD")}),te:i(function(p){return"\u0C38\u0C02\u0C35\u0C24\u0C4D\u0C38"+(p===1?"\u0C30\u0C02":"\u0C30\u0C3E\u0C32")},function(p){return"\u0C28\u0C46\u0C32"+(p===1?"":"\u0C32")},function(p){return p===1?"\u0C35\u0C3E\u0C30\u0C02":"\u0C35\u0C3E\u0C30\u0C3E\u0C32\u0C41"},function(p){return"\u0C30\u0C4B\u0C1C\u0C41"+(p===1?"":"\u0C32\u0C41")},function(p){return"\u0C17\u0C02\u0C1F"+(p===1?"":"\u0C32\u0C41")},function(p){return p===1?"\u0C28\u0C3F\u0C2E\u0C3F\u0C37\u0C02":"\u0C28\u0C3F\u0C2E\u0C3F\u0C37\u0C3E\u0C32\u0C41"},function(p){return p===1?"\u0C38\u0C46\u0C15\u0C28\u0C41":"\u0C38\u0C46\u0C15\u0C28\u0C4D\u0C32\u0C41"},function(p){return p===1?"\u0C2E\u0C3F\u0C32\u0C4D\u0C32\u0C40\u0C38\u0C46\u0C15\u0C28\u0C4D":"\u0C2E\u0C3F\u0C32\u0C4D\u0C32\u0C40\u0C38\u0C46\u0C15\u0C28\u0C4D\u0C32\u0C41"}),uk:i(function(p){return["\u0440\u043E\u043A\u0456\u0432","\u0440\u0456\u043A","\u0440\u043E\u043A\u0438"][l(p)]},function(p){return["\u043C\u0456\u0441\u044F\u0446\u0456\u0432","\u043C\u0456\u0441\u044F\u0446\u044C","\u043C\u0456\u0441\u044F\u0446\u0456"][l(p)]},function(p){return["\u0442\u0438\u0436\u043D\u0456\u0432","\u0442\u0438\u0436\u0434\u0435\u043D\u044C","\u0442\u0438\u0436\u043D\u0456"][l(p)]},function(p){return["\u0434\u043D\u0456\u0432","\u0434\u0435\u043D\u044C","\u0434\u043D\u0456"][l(p)]},function(p){return["\u0433\u043E\u0434\u0438\u043D","\u0433\u043E\u0434\u0438\u043D\u0430","\u0433\u043E\u0434\u0438\u043D\u0438"][l(p)]},function(p){return["\u0445\u0432\u0438\u043B\u0438\u043D","\u0445\u0432\u0438\u043B\u0438\u043D\u0430","\u0445\u0432\u0438\u043B\u0438\u043D\u0438"][l(p)]},function(p){return["\u0441\u0435\u043A\u0443\u043D\u0434","\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u0441\u0435\u043A\u0443\u043D\u0434\u0438"][l(p)]},function(p){return["\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434","\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434\u0430","\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434\u0438"][l(p)]},","),ur:i("\u0633\u0627\u0644",function(p){return p===1?"\u0645\u06C1\u06CC\u0646\u06C1":"\u0645\u06C1\u06CC\u0646\u06D2"},function(p){return p===1?"\u06C1\u0641\u062A\u06C1":"\u06C1\u0641\u062A\u06D2"},"\u062F\u0646",function(p){return p===1?"\u06AF\u06BE\u0646\u0679\u06C1":"\u06AF\u06BE\u0646\u0679\u06D2"},"\u0645\u0646\u0679","\u0633\u06CC\u06A9\u0646\u0688","\u0645\u0644\u06CC \u0633\u06CC\u06A9\u0646\u0688"),sk:i(function(p){return["rok","roky","roky","rokov"][c(p)]},function(p){return["mesiac","mesiace","mesiace","mesiacov"][c(p)]},function(p){return["t\xFD\u017Ede\u0148","t\xFD\u017Edne","t\xFD\u017Edne","t\xFD\u017Ed\u0148ov"][c(p)]},function(p){return["de\u0148","dni","dni","dn\xED"][c(p)]},function(p){return["hodina","hodiny","hodiny","hod\xEDn"][c(p)]},function(p){return["min\xFAta","min\xFAty","min\xFAty","min\xFAt"][c(p)]},function(p){return["sekunda","sekundy","sekundy","sek\xFAnd"][c(p)]},function(p){return["milisekunda","milisekundy","milisekundy","milisek\xFAnd"][c(p)]},","),sl:i(function(p){return p%10==1?"leto":p%100==2?"leti":p%100==3||p%100==4||Math.floor(p)!==p&&p%100<=5?"leta":"let"},function(p){return p%10==1?"mesec":p%100==2||Math.floor(p)!==p&&p%100<=5?"meseca":p%10==3||p%10==4?"mesece":"mesecev"},function(p){return p%10==1?"teden":p%10==2||Math.floor(p)!==p&&p%100<=4?"tedna":p%10==3||p%10==4?"tedne":"tednov"},function(p){return p%100==1?"dan":"dni"},function(p){return p%10==1?"ura":p%100==2?"uri":p%10==3||p%10==4||Math.floor(p)!==p?"ure":"ur"},function(p){return p%10==1?"minuta":p%10==2?"minuti":p%10==3||p%10==4||Math.floor(p)!==p&&p%100<=4?"minute":"minut"},function(p){return p%10==1?"sekunda":p%100==2?"sekundi":p%100==3||p%100==4||Math.floor(p)!==p?"sekunde":"sekund"},function(p){return p%10==1?"milisekunda":p%100==2?"milisekundi":p%100==3||p%100==4||Math.floor(p)!==p?"milisekunde":"milisekund"},","),sv:i("\xE5r",function(p){return"m\xE5nad"+(p===1?"":"er")},function(p){return"veck"+(p===1?"a":"or")},function(p){return"dag"+(p===1?"":"ar")},function(p){return"timm"+(p===1?"e":"ar")},function(p){return"minut"+(p===1?"":"er")},function(p){return"sekund"+(p===1?"":"er")},function(p){return"millisekund"+(p===1?"":"er")},","),sw:e(i(function(p){return p===1?"mwaka":"miaka"},function(p){return p===1?"mwezi":"miezi"},"wiki",function(p){return p===1?"siku":"masiku"},function(p){return p===1?"saa":"masaa"},"dakika","sekunde","milisekunde"),{_numberFirst:!0}),tr:i("y\u0131l","ay","hafta","g\xFCn","saat","dakika","saniye","milisaniye",","),th:i("\u0E1B\u0E35","\u0E40\u0E14\u0E37\u0E2D\u0E19","\u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C","\u0E27\u0E31\u0E19","\u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07","\u0E19\u0E32\u0E17\u0E35","\u0E27\u0E34\u0E19\u0E32\u0E17\u0E35","\u0E21\u0E34\u0E25\u0E25\u0E34\u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"),uz:i("yil","oy","hafta","kun","soat","minut","sekund","millisekund"),uz_CYR:i("\u0439\u0438\u043B","\u043E\u0439","\u04B3\u0430\u0444\u0442\u0430","\u043A\u0443\u043D","\u0441\u043E\u0430\u0442","\u043C\u0438\u043D\u0443\u0442","\u0441\u0435\u043A\u0443\u043D\u0434","\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434"),vi:i("n\u0103m","th\xE1ng","tu\u1EA7n","ng\xE0y","gi\u1EDD","ph\xFAt","gi\xE2y","mili gi\xE2y",","),zh_CN:i("\u5E74","\u4E2A\u6708","\u5468","\u5929","\u5C0F\u65F6","\u5206\u949F","\u79D2","\u6BEB\u79D2"),zh_TW:i("\u5E74","\u500B\u6708","\u5468","\u5929","\u5C0F\u6642","\u5206\u9418","\u79D2","\u6BEB\u79D2")};function i(p,O,k,S,w,T,P,j,D){var N={y:p,mo:O,w:k,d:S,h:w,m:T,s:P,ms:j};return D!==void 0&&(N.decimal=D),N}function a(p){return p===2?1:p>2&&p<11?2:0}function s(p){return p===1?0:Math.floor(p)!==p?1:p%10>=2&&p%10<=4&&!(p%100>10&&p%100<20)?2:3}function l(p){return Math.floor(p)!==p?2:p%100>=5&&p%100<=20||p%10>=5&&p%10<=9||p%10==0?0:p%10==1?1:p>1?2:0}function c(p){return p===1?0:Math.floor(p)!==p?1:p%10>=2&&p%10<=4&&p%100<10?2:3}function u(p){return p===1||p%10==1&&p%100>20?0:Math.floor(p)!==p||p%10>=2&&p%100>20||p%10>=2&&p%100<10?1:2}function d(p){return p%10==1&&p%100!=11}function f(p,O){return Object.prototype.hasOwnProperty.call(p,O)}function h(p,O,k){var S,w,T,P=p.unitName,j=p.unitCount,D=k.spacer,N=k.maxDecimalPoints;S=f(k,"decimal")?k.decimal:f(O,"decimal")?O.decimal:".","digitReplacements"in k?w=k.digitReplacements:"_digitReplacements"in O&&(w=O._digitReplacements);var E=(N===void 0?j:Math.floor(j*Math.pow(10,N))/Math.pow(10,N)).toString();if(O._hideCountIf2&&j===2)T="",D="";else if(w){T="";for(var A=0;A<E.length;A++){var I=E[A];T+=I==="."?S:w[I]}}else T=E.replace(".",S);var L,F=O[P];return L=typeof F=="function"?F(j):F,O._numberFirst?L+D+T:T+D+L}function g(p,O){var k=function(N){var E=[N.language];if(f(N,"fallbacks")){if(!n(N.fallbacks)||!N.fallbacks.length)throw new Error("fallbacks must be an array with at least one element");E=E.concat(N.fallbacks)}for(var A=0;A<E.length;A++){var I=E[A];if(f(N.languages,I))return N.languages[I];if(f(o,I))return o[I]}throw new Error("No language found.")}(O);if(!p.length){var S=O.units;return h({unitName:S[S.length-1],unitCount:0},k,O)}var w,T=O.conjunction,P=O.serialComma;w=f(O,"delimiter")?O.delimiter:f(k,"delimiter")?k.delimiter:", ";for(var j=[],D=0;D<p.length;D++)j.push(h(p[D],k,O));return T&&p.length!==1?p.length===2?j.join(T):j.slice(0,-1).join(w)+(P?",":"")+T+j.slice(-1):j.join(w)}function v(p){var O=function(k,S){k=Math.abs(k);var w=e({},O,S||{}),T=function(P,j){var D,N,E,A,I=j.units,L=j.unitMeasures,F="largest"in j?j.largest:1/0;if(!I.length)return[];var Q={};for(A=P,N=0;N<I.length;N++){var W=L[D=I[N]];E=N===I.length-1?A/W:Math.floor(A/W),Q[D]=E,A-=E*W}if(j.round){var U=F;for(N=0;N<I.length;N++)if((E=Q[D=I[N]])!==0&&--U===0){for(var X=N+1;X<I.length;X++){var G=I[X],ae=Q[G];Q[D]+=ae*L[G]/L[D],Q[G]=0}break}for(N=I.length-1;N>=0;N--)if((E=Q[D=I[N]])!==0){var ne=Math.round(E);if(Q[D]=ne,N===0)break;var re=I[N-1],Z=L[re],K=Math.floor(ne*L[D]/Z);if(!K)break;Q[re]+=K,Q[D]=0}}var oe=[];for(N=0;N<I.length&&oe.length<F;N++)(E=Q[D=I[N]])&&oe.push({unitName:D,unitCount:E});return oe}(k,w);return g(T,w)};return e(O,{language:"en",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},p)}var b=e(v({}),{getSupportedLanguages:function(){var p=[];for(var O in o)f(o,O)&&O!=="gr"&&p.push(O);return p},humanizer:v});t.exports?t.exports=b:this.humanizeDuration=b})()}(KAe)),KAe.exports);const nvt=el(tvt);var CZ="Progress",rvt=100,[ovt,a1t]=Wo(CZ),[ivt,avt]=ovt(CZ),JAe=_.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=svt,...a}=t;!o&&o!==0||rMe(o)||console.error(`Invalid prop \`max\` of value \`${`${o}`}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`);const s=rMe(o)?o:rvt;r===null||oMe(r,s)||console.error(function(u,d){return`Invalid prop \`value\` of value \`${u}\` supplied to \`${d}\`. The \`value\` prop must be:
|
503
503
|
- a positive number
|
504
504
|
- less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
|
505
505
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|