@layers-app/editor 0.6.1 → 0.6.3
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/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{layers.Bc5uJC47.js → layers.1YPHQmyr.js} +1 -1
- package/dist/{layers.Bl8IX7HK.js → layers.2ezQNfhO.js} +1 -1
- package/dist/{layers.CPUnM31Z.js → layers.4zkAs3pI.js} +1 -1
- package/dist/layers.5jLpGXWS.js +8 -0
- package/dist/{layers.B4DZUAOT.js → layers.7htK0qkc.js} +1 -1
- package/dist/{layers.DIPX0xmv.js → layers.8n9wNuEx.js} +1 -1
- package/dist/{layers.C7Gv20au.js → layers.AEehU6Sm.js} +1 -1
- package/dist/{layers.k8rTp6Qv.js → layers.B3OrpIYF.js} +1 -1
- package/dist/{layers.CTvZEptB.js → layers.B3iNLxFR.js} +1 -1
- package/dist/{layers.Dr8Gt3ys.js → layers.B5C8wDBh.js} +3 -3
- package/dist/{layers.uOmWW03b.js → layers.B5sSm-lN.js} +3 -3
- package/dist/{layers.B91BKOY4.js → layers.B84McXEm.js} +1 -1
- package/dist/{layers.5-fIF21X.js → layers.BAe_LWMS.js} +1 -1
- package/dist/{layers.B0ITvllV.js → layers.BBFAL8ao.js} +1 -1
- package/dist/{layers.BhCjg_Di.js → layers.BCDq2xQT.js} +1 -1
- package/dist/{layers.CpBm9OI0.js → layers.BFkxyYLw.js} +1 -1
- package/dist/{layers.B_TTUiE9.js → layers.BG2_EEuc.js} +1 -1
- package/dist/{layers.D2Hete12.js → layers.BGlQb1U1.js} +3 -3
- package/dist/{layers.D2iAmiaa.js → layers.BIEjzwEd.js} +1 -1
- package/dist/{layers.CD9bcn-I.js → layers.BIH0gCon.js} +1 -1
- package/dist/layers.BJwwi7TU.js +1 -0
- package/dist/{layers.DmEPp8z2.js → layers.BL8VKvEJ.js} +1 -1
- package/dist/{layers.DMkCvSun.js → layers.BMCaopwk.js} +1 -1
- package/dist/{layers.Dj7NyN1B.js → layers.BMuHdxnH.js} +1 -1
- package/dist/{layers.DkLwn3LQ.js → layers.BTMHVVAU.js} +1 -1
- package/dist/{layers.BE1mfFWR.js → layers.BTZYncV2.js} +1 -1
- package/dist/{layers.BVkkjJKc.js → layers.BX1vqiN6.js} +1 -1
- package/dist/{layers.C_vZ0NuB.js → layers.BXOvf3i5.js} +1 -1
- package/dist/{layers.yedR42zA.js → layers.BbDQof7_.js} +1 -1
- package/dist/{layers.klb1U2XS.js → layers.BbNf8viQ.js} +1 -1
- package/dist/{layers.3U30GEAd.js → layers.Bc0v430s.js} +1 -1
- package/dist/{layers.C2Eni0Sy.js → layers.Bcp9IqSU.js} +1 -1
- package/dist/{layers.Bn2ncK_y.js → layers.BczHMjjZ.js} +4 -4
- package/dist/{layers.CC-Xq_sc.js → layers.BdYxewrL.js} +4 -4
- package/dist/{layers.NcUJfdOv.js → layers.Bdm6pk-7.js} +1 -1
- package/dist/{layers.DnfoOjUk.js → layers.BepNWIpT.js} +1 -1
- package/dist/{layers.ZXrwNrVl.js → layers.BiTQiPqd.js} +1 -1
- package/dist/{layers.C0MaC4aH.js → layers.BjcEWpws.js} +1 -1
- package/dist/{layers.BhUDle4s.js → layers.BkBShRKy.js} +1 -1
- package/dist/{layers.BgnFroQl.js → layers.BlACsc4B.js} +1 -1
- package/dist/{layers.BHvPLN6o.js → layers.BleJvOH_.js} +1 -1
- package/dist/{layers.DCmmSStc.js → layers.BmKMmFU0.js} +1 -1
- package/dist/{layers.BHNPjk4K.js → layers.BmObZ2O2.js} +1 -1
- package/dist/{layers.YTNyGd5I.js → layers.Bn63ebFL.js} +1 -1
- package/dist/{layers.jm0e8Psm.js → layers.BoWA2ewq.js} +1 -1
- package/dist/{layers.CvJBoGvb.js → layers.BpGS5TC1.js} +6104 -5918
- package/dist/{layers.B0LE0qMi.js → layers.BprKZ1eM.js} +1 -1
- package/dist/{layers.BCHEzWTZ.js → layers.Bpz_9RMJ.js} +1 -1
- package/dist/{layers.C3SeFoQ5.js → layers.BrOhHIze.js} +1 -1
- package/dist/{layers.B6p7rIs4.js → layers.Bs2GZCs9.js} +1 -1
- package/dist/{layers.BE52sb5G.js → layers.BtBBBTIo.js} +1 -1
- package/dist/{layers.Bnzr31-l.js → layers.BtUL3kuB.js} +1 -1
- package/dist/{layers.DfCkB8us.js → layers.BtfYB6Fg.js} +1 -1
- package/dist/{layers.D2fxswZv.js → layers.Bu16DVf3.js} +2 -2
- package/dist/{layers.BJCiE_l8.js → layers.BuagOhMG.js} +1 -1
- package/dist/{layers.B6IB8dwa.js → layers.Bw2Ndw9E.js} +1 -1
- package/dist/{layers.CvkPWNz6.js → layers.BxkZ3UCV.js} +3 -3
- package/dist/{layers.DenztkGl.js → layers.BzWoBRRP.js} +3 -3
- package/dist/{layers.DR6xFwk7.js → layers.C0Vg7Pfz.js} +1 -1
- package/dist/{layers.CKD44byx.js → layers.C1K3R2M2.js} +2 -2
- package/dist/{layers.DVPCLKjN.js → layers.C1fjuC-N.js} +1 -1
- package/dist/{layers.D4JzdyBQ.js → layers.C2DC-QX9.js} +4 -4
- package/dist/{layers.zlxCgz5o.js → layers.C3Ov8Jdj.js} +2 -2
- package/dist/{layers.Xya0R5qm.js → layers.C4oivfst.js} +1 -1
- package/dist/{layers.BVLcUYWr.js → layers.C4y79BWI.js} +1 -1
- package/dist/{layers.Da1C-p2A.js → layers.C8LviuVv.js} +4 -4
- package/dist/{layers.DurUGCfX.js → layers.CAkAKsM1.js} +3 -3
- package/dist/{layers.oppbq1V8.js → layers.CBOYuL5E.js} +24 -24
- package/dist/{layers.DyFkAG4v.js → layers.CCa_egl8.js} +4 -4
- package/dist/{layers.C2m1FCZM.js → layers.CD59JDek.js} +4 -4
- package/dist/{layers.BDEzwoD0.js → layers.CDDF04dz.js} +1 -1
- package/dist/{layers.WLuvBhhO.js → layers.CDeJP1kV.js} +1 -1
- package/dist/{layers.IyblTwwj.js → layers.CEOs9VQ-.js} +1 -1
- package/dist/{layers.DiOFpShT.js → layers.CEtiHVLl.js} +1 -1
- package/dist/{layers.WLRBvBJV.js → layers.CHeTy3Sb.js} +1 -1
- package/dist/{layers.CpSrAOWh.js → layers.CPpyZoVS.js} +1 -1
- package/dist/{layers.IlFNq4l7.js → layers.CQ3QwxD8.js} +1 -1
- package/dist/{layers.CiAUXfRk.js → layers.CQnJlryh.js} +1 -1
- package/dist/{layers.DUSnwZkf.js → layers.CR0V62Ai.js} +1 -1
- package/dist/{layers.CQUaf576.js → layers.CS-hfe4C.js} +1 -1
- package/dist/{layers.DCZDvkQY.js → layers.CSYORp5P.js} +1 -1
- package/dist/{layers.D441tyKb.js → layers.CUJ8qvMu.js} +1 -1
- package/dist/{layers.DnKE_0nH.js → layers.CWT_bEvr.js} +1 -1
- package/dist/{layers.Bn9FtCwB.js → layers.CYtqwZwS.js} +1 -1
- package/dist/{layers.BpkejIBE.js → layers.CaKGGnAn.js} +1 -1
- package/dist/{layers.CJb3NDTx.js → layers.Caj6p3EO.js} +1 -1
- package/dist/{layers.DcAXeN4H.js → layers.Cd8Qz5rd.js} +3 -3
- package/dist/{layers.BlFkk34t.js → layers.CdBkWO9Q.js} +1 -1
- package/dist/{layers.CvXNYNtw.js → layers.CdIGmaxw.js} +1 -1
- package/dist/{layers.HblZ66rx.js → layers.CfImCPws.js} +1 -1
- package/dist/{layers.BJiF1YhD.js → layers.ChO6G201.js} +1 -1
- package/dist/{layers.BCpCM6cF.js → layers.ChresRb8.js} +1 -1
- package/dist/layers.Chu72E5Q.js +6 -0
- package/dist/{layers.DHRSuLVs.js → layers.Ci6EzO0S.js} +1 -1
- package/dist/{layers.DVUGI-yF.js → layers.CiSC9rzh.js} +1 -1
- package/dist/{layers.Dm_WtI0f.js → layers.Cj_H11ek.js} +1 -1
- package/dist/{layers.Bo2G74v1.js → layers.ClTXsc5_.js} +1 -1
- package/dist/{layers.Cs6LP-Ws.js → layers.ClUvHwpz.js} +1 -1
- package/dist/{layers.ymeFsY_7.js → layers.Clln2nI-.js} +1 -1
- package/dist/{layers.ClI1HtA1.js → layers.CmRfzmBX.js} +1 -1
- package/dist/{layers.DvpUQ7O1.js → layers.CnANLO0j.js} +1 -1
- package/dist/{layers.MyfjAzKU.js → layers.CnUvX4bJ.js} +1 -1
- package/dist/layers.CrUOtKSX.js +1 -0
- package/dist/{layers.BhYHAnG5.js → layers.CsGHV1kG.js} +1 -1
- package/dist/{layers.m94tJFKv.js → layers.Csr2m1zc.js} +1 -1
- package/dist/{layers.B3UOW9kM.js → layers.CtREG6vm.js} +1 -1
- package/dist/{layers.DqrWzdkO.js → layers.CtwGwhuN.js} +1 -1
- package/dist/{layers.C9n6yCjj.js → layers.Cv3YYI_b.js} +1 -1
- package/dist/{layers.DMZvxsxt.js → layers.CvYa1PyL.js} +1 -1
- package/dist/{layers.DDJKm1dN.js → layers.CvjoFPEw.js} +1 -1
- package/dist/{layers.C5T2PhRe.js → layers.CweFwMK3.js} +1 -1
- package/dist/{layers.Dut-n8DC.js → layers.CxWFGTUz.js} +1 -1
- package/dist/{layers.DHHs2c0M.js → layers.CzQvc6hI.js} +1 -1
- package/dist/{layers.BhJNrpA3.js → layers.D2PXq46X.js} +2 -2
- package/dist/{layers.BANCGUrU.js → layers.D2wNECrn.js} +1 -1
- package/dist/{layers.CLeQzG_O.js → layers.D3uEWWKk.js} +1 -1
- package/dist/{layers.CPWL3tHT.js → layers.D5Ff-TQt.js} +1 -1
- package/dist/{layers.BCHiqf4h.js → layers.D8_wYnYv.js} +1 -1
- package/dist/{layers.DpcCywPK.js → layers.DABZ99Fk.js} +1 -1
- package/dist/{layers.B1P5sIYl.js → layers.DBbT3cVy.js} +1 -1
- package/dist/{layers.E97qOri2.js → layers.DCDzWO1l.js} +1 -1
- package/dist/{layers.rS4Y9F4V.js → layers.DClPM9WV.js} +1 -1
- package/dist/{layers.BpWYOAc0.js → layers.DDEO8keV.js} +1 -1
- package/dist/{layers.CHb3fDyP.js → layers.DNup2uqL.js} +1 -1
- package/dist/{layers.upFkvLfW.js → layers.DP6uQXdV.js} +1 -1
- package/dist/{layers.CPPZYBwd.js → layers.DQTMJhIU.js} +1 -1
- package/dist/{layers.CvswJGGE.js → layers.DQ_ueXSU.js} +2 -2
- package/dist/{layers.Bfy8l2kr.js → layers.DRv5pP6Z.js} +1 -1
- package/dist/{layers.BQWq1dS_.js → layers.DT58Pc3R.js} +1 -1
- package/dist/{layers.Bd8AHNDD.js → layers.DT9Q2uqd.js} +1 -1
- package/dist/{layers.CulQ2uk1.js → layers.DVU4FtWe.js} +3 -3
- package/dist/{layers.C_mYi96H.js → layers.DX3AEW0l.js} +5 -5
- package/dist/{layers.Bt_1Izqx.js → layers.DXdx7Izv.js} +1 -1
- package/dist/{layers.D_uz6BuB.js → layers.DYFkD-N6.js} +1 -1
- package/dist/{layers.DVgYGM1w.js → layers.DYNPx6wI.js} +1 -1
- package/dist/{layers.C8nMfZR8.js → layers.DYifPXYI.js} +1 -1
- package/dist/{layers.Ca5keRI5.js → layers.DYvoPijo.js} +1 -1
- package/dist/{layers._WwyuPPl.js → layers.DaPDkcnM.js} +1 -1
- package/dist/{layers.Aq0SUL5q.js → layers.DbaEDl4N.js} +1 -1
- package/dist/{layers.DsNyZQAk.js → layers.DeTps6zH.js} +1 -1
- package/dist/{layers.DIMz0rbb.js → layers.Deztqx8B.js} +1 -1
- package/dist/{layers.CCSYnSIr.js → layers.Df5yWQYk.js} +1 -1
- package/dist/{layers.CO-tXyYW.js → layers.DfQnEX6E.js} +1 -1
- package/dist/{layers.bElFyxsU.js → layers.DjA-Uz7b.js} +1 -1
- package/dist/{layers.BVGUJrpk.js → layers.DjmRnBfj.js} +7 -7
- package/dist/{layers.lzPKLUXP.js → layers.DjuoI6d5.js} +1 -1
- package/dist/{layers.B6l694O3.js → layers.DkDAOzey.js} +6 -6
- package/dist/{layers.RzeifHH3.js → layers.Dki7UmlE.js} +1 -1
- package/dist/{layers.CKND34ue.js → layers.Dm7Bn63C.js} +1 -1
- package/dist/{layers.ByPOX6Oc.js → layers.DnVV7i-O.js} +1 -1
- package/dist/{layers.DUnVb8_5.js → layers.DnVVtjk8.js} +1 -1
- package/dist/{layers.jEw3A18y.js → layers.Doau9sw3.js} +2 -2
- package/dist/{layers.C9PR1YEO.js → layers.Dpj4VC_0.js} +1 -1
- package/dist/{layers.BI_DwGKY.js → layers.DrkGOOD1.js} +1 -1
- package/dist/{layers.CKzGHT9a.js → layers.DsOHb5HU.js} +1 -1
- package/dist/{layers.KA-C6J9c.js → layers.DuMWgXyp.js} +1 -1
- package/dist/{layers.DB-0231e.js → layers.DuNWp28A.js} +1 -1
- package/dist/layers.Dvku4eqp.js +1 -0
- package/dist/{layers.BSNHhHc5.js → layers.DwJH3LjE.js} +1 -1
- package/dist/{layers.CnKfP4tc.js → layers.DxvUGqe3.js} +1 -1
- package/dist/{layers.waY0fD81.js → layers.EhfZHTdp.js} +1 -1
- package/dist/{layers.DHGlkms1.js → layers.Et2G4wV1.js} +1 -1
- package/dist/{layers.WE3tLCXz.js → layers.FGM5MYMq.js} +1 -1
- package/dist/{layers.B9mvovq1.js → layers.FJu-8GDf.js} +1 -1
- package/dist/{layers.Vphy-jMh.js → layers.HBXF3L3c.js} +4 -4
- package/dist/{layers.CXUKgI5q.js → layers.KN4jiEFM.js} +1 -1
- package/dist/{layers.C5JcPjms.js → layers.LE1hx1bQ.js} +4 -4
- package/dist/{layers.D6EmV-XA.js → layers.Lvw1dR9H.js} +1 -1
- package/dist/{layers.DA_Q1DwJ.js → layers.M5wdZDVx.js} +4 -4
- package/dist/{layers.Hb0J7tKS.js → layers.ME89fWfY.js} +1 -1
- package/dist/{layers.A3Fw0TFw.js → layers.MQn4UkTw.js} +1 -1
- package/dist/{layers.DbyX-lJT.js → layers.OYUtlgT2.js} +2 -2
- package/dist/{layers.Bxo8qFfZ.js → layers.Q4gs09Kt.js} +1 -1
- package/dist/{layers.YOwq_Za2.js → layers.QLnxl4QQ.js} +1 -1
- package/dist/layers.RlEYBWe3.js +229 -0
- package/dist/{layers.C-RiaptQ.js → layers.SFsV6m2U.js} +1 -1
- package/dist/{layers.cBZ-P3nx.js → layers.TPFc7TkQ.js} +1 -1
- package/dist/{layers.Dco19f_-.js → layers.TqTP1KNg.js} +1 -1
- package/dist/{layers.C1hS-Yik.js → layers.Ul1PJjbB.js} +1 -1
- package/dist/{layers.Dbc77u4l.js → layers._XSuvEPf.js} +3 -3
- package/dist/{layers.DJOGd3tQ.js → layers.b2OUrw66.js} +1 -1
- package/dist/{layers.DCU6gO-l.js → layers.bq5sIWdM.js} +4 -4
- package/dist/{layers.z8N4rXXw.js → layers.dDrQizdE.js} +1 -1
- package/dist/{layers.D2tZTitd.js → layers.eAlV0nkW.js} +5 -5
- package/dist/{layers.CoMJAPt_.js → layers.eChpgtC4.js} +1 -1
- package/dist/{layers.C7-gYd4x.js → layers.eoIhkkpP.js} +1 -1
- package/dist/{layers.x83OFv25.js → layers.fk82ApcJ.js} +3 -3
- package/dist/{layers.CyS9yZ07.js → layers.gcteVdBy.js} +1 -1
- package/dist/{layers.IPx3dBa0.js → layers.iW9w713r.js} +1 -1
- package/dist/{layers.B2biNaBR.js → layers.jTjq_sOt.js} +1 -1
- package/dist/{layers.C21nzrSY.js → layers.k0SJSUhD.js} +1 -1
- package/dist/{layers.DrxWA6j_.js → layers.lLC-cUQo.js} +1 -1
- package/dist/{layers.Db7LZEsM.js → layers.lMQpDtSh.js} +1 -1
- package/dist/layers.lsThdXHq.js +230 -0
- package/dist/{layers.DrskdBZ_.js → layers.nLzNyQgW.js} +1 -1
- package/dist/{layers.DYpj292-.js → layers.o34OpuFi.js} +1 -1
- package/dist/{layers.DpQhkpbr.js → layers.opyf2xIY.js} +1 -1
- package/dist/{layers.Bx7OCV3r.js → layers.pF7R5t5s.js} +1 -1
- package/dist/{layers.BO-PZk8i.js → layers.pTPZR2_0.js} +1 -1
- package/dist/{layers.CclvSuMx.js → layers.uoMXGcjE.js} +3 -3
- package/dist/{layers.BQWyPT9Z.js → layers.xyhOWQKt.js} +1 -1
- package/dist/{layers.DwUoAnGC.js → layers.yPFAq3FE.js} +1 -1
- package/dist/{layers.1cw4PPu8.js → layers.ySLJiaOh.js} +1 -1
- package/dist/{layers.7Q672Pf5.js → layers.zGD7Rp7z.js} +1 -1
- package/package.json +1 -1
- package/dist/layers.Bk54sqj7.js +0 -8
- package/dist/layers.BqKfAFsh.js +0 -230
- package/dist/layers.CMwF7dgU.js +0 -206
- package/dist/layers.DfvhX3vC.js +0 -1
- package/dist/layers.DgbWQVOK.js +0 -6
- package/dist/layers.DsN4v91h.js +0 -1
- package/dist/layers.kERuI3ru.js +0 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";const Qt=require("./layers.BdYxewrL.js"),M=require("react"),f=require("react/jsx-runtime"),Xt=require("react-dom");var cs=typeof document<"u"?document.currentScript:null;function Y5(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const B=Y5(M),Z5=Y5(Xt);var be={VITE_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",VITE_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",VITE_APP_LIBRARY_URL:"https://libraries.excalidraw.com",VITE_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",VITE_APP_PLUS_LP:"https://plus.excalidraw.com",VITE_APP_PLUS_APP:"https://app.excalidraw.com",VITE_APP_AI_BACKEND:"https://oss-ai.excalidraw.com",VITE_APP_WS_SERVER_URL:"https://oss-collab.excalidraw.com",VITE_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',VITE_APP_ENABLE_TRACKING:"false",VITE_APP_PLUS_EXPORT_PUBLIC_KEY:`MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApQ0jM9Qz8TdFLzcuAZZX
|
|
2
|
+
/WvuKSOJxiw6AR/ZcE3eFQWM/mbFdhQgyK8eHGkKQifKzH1xUZjCxyXcxW6ZO02t
|
|
3
|
+
kPOPxhz+nxUrIoWCD/V4NGmUA1lxwHuO21HN1gzKrN3xHg5EGjyouR9vibT9VDGF
|
|
4
|
+
gq6+4Ic/kJX+AD2MM7Yre2+FsOdysrmuW2Fu3ahuC1uQE7pOe1j0k7auNP0y1q53
|
|
5
|
+
PrB8Ts2LUpepWC1l7zIXFm4ViDULuyWXTEpUcHSsEH8vpd1tckjypxCwkipfZsXx
|
|
6
|
+
iPszy0o0Dx2iArPfWMXlFAI9mvyFCyFC3+nSvfyAUb2C4uZgCwAuyFh/ydPF4DEE
|
|
7
|
+
PQIDAQAB`,VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX:"false",VITE_APP_COLLAPSE_OVERLAY:"false",VITE_APP_ENABLE_ESLINT:"false",PKG_NAME:"@excalidraw/excalidraw",PKG_VERSION:"0.18.0",PROD:!0},K5=Object.defineProperty,Py=(e,t,n)=>t in e?K5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ny=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Oy=e=>t=>{var n=e[t];if(n)return n();throw new Error("Module not found in bundle: "+t)},q5=(e,t)=>{for(var n in t)K5(e,n,{get:t[n],enumerable:!0})},L=(e,t,n)=>(Py(e,typeof t!="symbol"?t+"":t,n),n),jf={},WU;function J5(){return WU||(WU=1,(function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="0.3.0";function n(){for(var d=0,o=new Array(256),u=0;u!=256;++u)d=u,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,d=d&1?-306674912^d>>>1:d>>>1,o[u]=d;return typeof Int32Array<"u"?new Int32Array(o):o}var a=n(),i=typeof Buffer<"u";function r(d){if(d.length>32768&&i)return l(new Buffer(d));for(var o=-1,u=d.length-1,h=0;h<u;)o=a[(o^d.charCodeAt(h++))&255]^o>>>8,o=a[(o^d.charCodeAt(h++))&255]^o>>>8;return h===u&&(o=o>>>8^a[(o^d.charCodeAt(h))&255]),o^-1}function s(d){if(d.length>1e4)return l(d);for(var o=-1,u=0,h=d.length-3;u<h;)o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255];for(;u<h+3;)o=o>>>8^a[(o^d[u++])&255];return o^-1}function l(d){for(var o=-1,u=0,h=d.length-7;u<h;)o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255],o=o>>>8^a[(o^d[u++])&255];for(;u<h+7;)o=o>>>8^a[(o^d[u++])&255];return o^-1}function c(d){for(var o=-1,u=0,h=d.length,p,U;u<h;)p=d.charCodeAt(u++),p<128?o=o>>>8^a[(o^p)&255]:p<2048?(o=o>>>8^a[(o^(192|p>>6&31))&255],o=o>>>8^a[(o^(128|p&63))&255]):p>=55296&&p<57344?(p=(p&1023)+64,U=d.charCodeAt(u++)&1023,o=o>>>8^a[(o^(240|p>>8&7))&255],o=o>>>8^a[(o^(128|p>>2&63))&255],o=o>>>8^a[(o^(128|U>>6&15|p&3))&255],o=o>>>8^a[(o^(128|U&63))&255]):(o=o>>>8^a[(o^(224|p>>12&15))&255],o=o>>>8^a[(o^(128|p>>6&63))&255],o=o>>>8^a[(o^(128|p&63))&255]);return o^-1}t.table=a,t.bstr=r,t.buf=s,t.str=c})})(jf)),jf}var Af,VU;function $y(){if(VU)return Af;VU=1;var e=J5();Af=i;var t=new Uint8Array(4),n=new Int32Array(t.buffer),a=new Uint32Array(t.buffer);function i(r){if(r[0]!==137)throw new Error("Invalid .png file header");if(r[1]!==80)throw new Error("Invalid .png file header");if(r[2]!==78)throw new Error("Invalid .png file header");if(r[3]!==71)throw new Error("Invalid .png file header");if(r[4]!==13)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(r[5]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(r[6]!==26)throw new Error("Invalid .png file header");if(r[7]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");for(var s=!1,l=[],c=8;c<r.length;){t[3]=r[c++],t[2]=r[c++],t[1]=r[c++],t[0]=r[c++];var d=a[0]+4,o=new Uint8Array(d);o[0]=r[c++],o[1]=r[c++],o[2]=r[c++],o[3]=r[c++];var u=String.fromCharCode(o[0])+String.fromCharCode(o[1])+String.fromCharCode(o[2])+String.fromCharCode(o[3]);if(!l.length&&u!=="IHDR")throw new Error("IHDR header missing");if(u==="IEND"){s=!0,l.push({name:u,data:new Uint8Array(0)});break}for(var h=4;h<d;h++)o[h]=r[c++];t[3]=r[c++],t[2]=r[c++],t[1]=r[c++],t[0]=r[c++];var p=n[0],U=e.buf(o);if(U!==p)throw new Error("CRC values for "+u+" header do not match, PNG file is likely corrupted");var m=new Uint8Array(o.buffer.slice(4));l.push({name:u,data:m})}if(!s)throw new Error(".png file ended prematurely: no IEND header was found");return l}return Af}var Fy=$y();const Q5=Qt.getDefaultExportFromCjs(Fy);var xc={},Rf,GU;function zy(){if(GU)return Rf;GU=1,Rf=e;function e(t,n){if(t=String(t),n=String(n),!/^[\x00-\xFF]+$/.test(t)||!/^[\x00-\xFF]+$/.test(n))throw new Error("Only Latin-1 characters are permitted in PNG tEXt chunks. You might want to consider base64 encoding and/or zEXt compression");if(t.length>=80)throw new Error('Keyword "'+t+'" is longer than the 79-character limit imposed by the PNG specification');for(var a=t.length+n.length+1,i=new Uint8Array(a),r=0,s,l=0;l<t.length;l++){if(!(s=t.charCodeAt(l)))throw new Error("0x00 character is not permitted in tEXt keywords");i[r++]=s}i[r++]=0;for(var c=0;c<n.length;c++){if(!(s=n.charCodeAt(c)))throw new Error("0x00 character is not permitted in tEXt content");i[r++]=s}return{name:"tEXt",data:i}}return Rf}var Lf,YU;function By(){if(YU)return Lf;YU=1,Lf=e;function e(t){t.data&&t.name&&(t=t.data);for(var n=!0,a="",i="",r=0;r<t.length;r++){var s=t[r];if(n)s?i+=String.fromCharCode(s):n=!1;else if(s)a+=String.fromCharCode(s);else throw new Error("Invalid NULL character found. 0x00 character is not permitted in tEXt content")}return{keyword:i,text:a}}return Lf}var ZU;function Hy(){return ZU||(ZU=1,xc.encode=zy(),xc.decode=By()),xc}var Xy=Hy();const eb=Qt.getDefaultExportFromCjs(Xy);var Df,KU;function Wy(){return KU||(KU=1,Df=function(e,t,n){var a=[],i=e.length;if(i===0)return a;var r=t<0?Math.max(0,t+i):t||0;for(n!==void 0&&(i=n<0?n+i:n);i-- >r;)a[i-r]=e[i];return a}),Df}var Pf,qU;function Vy(){if(qU)return Pf;qU=1;var e=Wy(),t=J5();Pf=r;var n=new Uint8Array(4),a=new Int32Array(n.buffer),i=new Uint32Array(n.buffer);function r(s){var l=8,c=l,d;for(d=0;d<s.length;d++)l+=s[d].data.length,l+=12;var o=new Uint8Array(l);for(o[0]=137,o[1]=80,o[2]=78,o[3]=71,o[4]=13,o[5]=10,o[6]=26,o[7]=10,d=0;d<s.length;d++){var u=s[d],h=u.name,p=u.data,U=p.length,m=[h.charCodeAt(0),h.charCodeAt(1),h.charCodeAt(2),h.charCodeAt(3)];i[0]=U,o[c++]=n[3],o[c++]=n[2],o[c++]=n[1],o[c++]=n[0],o[c++]=m[0],o[c++]=m[1],o[c++]=m[2],o[c++]=m[3];for(var g=0;g<U;)o[c++]=p[g++];var b=m.concat(e(p)),v=t.buf(b);a[0]=v,o[c++]=n[3],o[c++]=n[2],o[c++]=n[1],o[c++]=n[0]}return o}return Pf}var Gy=Vy();const Yy=Qt.getDefaultExportFromCjs(Gy);/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Zy=4,JU=0,QU=1,Ky=2;function ol(e){let t=e.length;for(;--t>=0;)e[t]=0}const qy=0,tb=1,Jy=2,Qy=3,ew=258,j0=29,Yo=256,go=Yo+1+j0,Ps=30,A0=19,nb=2*go+1,Mr=15,Nf=16,tw=7,R0=256,ab=16,ib=17,rb=18,n1=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),qc=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),nw=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),sb=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),aw=512,ii=new Array((go+2)*2);ol(ii);const Ql=new Array(Ps*2);ol(Ql);const bo=new Array(aw);ol(bo);const vo=new Array(ew-Qy+1);ol(vo);const L0=new Array(j0);ol(L0);const jd=new Array(Ps);ol(jd);function Of(e,t,n,a,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=a,this.max_length=i,this.has_stree=e&&e.length}let lb,ob,cb;function $f(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const db=e=>e<256?bo[e]:bo[256+(e>>>7)],xo=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},bn=(e,t,n)=>{e.bi_valid>Nf-n?(e.bi_buf|=t<<e.bi_valid&65535,xo(e,e.bi_buf),e.bi_buf=t>>Nf-e.bi_valid,e.bi_valid+=n-Nf):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Aa=(e,t,n)=>{bn(e,n[t*2],n[t*2+1])},ub=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},iw=e=>{e.bi_valid===16?(xo(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},rw=(e,t)=>{const n=t.dyn_tree,a=t.max_code,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,c=t.stat_desc.max_length;let d,o,u,h,p,U,m=0;for(h=0;h<=Mr;h++)e.bl_count[h]=0;for(n[e.heap[e.heap_max]*2+1]=0,d=e.heap_max+1;d<nb;d++)o=e.heap[d],h=n[n[o*2+1]*2+1]+1,h>c&&(h=c,m++),n[o*2+1]=h,!(o>a)&&(e.bl_count[h]++,p=0,o>=l&&(p=s[o-l]),U=n[o*2],e.opt_len+=U*(h+p),r&&(e.static_len+=U*(i[o*2+1]+p)));if(m!==0){do{for(h=c-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,m-=2}while(m>0);for(h=c;h!==0;h--)for(o=e.bl_count[h];o!==0;)u=e.heap[--d],!(u>a)&&(n[u*2+1]!==h&&(e.opt_len+=(h-n[u*2+1])*n[u*2],n[u*2+1]=h),o--)}},fb=(e,t,n)=>{const a=new Array(Mr+1);let i=0,r,s;for(r=1;r<=Mr;r++)a[r]=i=i+n[r-1]<<1;for(s=0;s<=t;s++){let l=e[s*2+1];l!==0&&(e[s*2]=ub(a[l]++,l))}},sw=()=>{let e,t,n,a,i;const r=new Array(Mr+1);for(n=0,a=0;a<j0-1;a++)for(L0[a]=n,e=0;e<1<<n1[a];e++)vo[n++]=a;for(vo[n-1]=a,i=0,a=0;a<16;a++)for(jd[a]=i,e=0;e<1<<qc[a];e++)bo[i++]=a;for(i>>=7;a<Ps;a++)for(jd[a]=i<<7,e=0;e<1<<qc[a]-7;e++)bo[256+i++]=a;for(t=0;t<=Mr;t++)r[t]=0;for(e=0;e<=143;)ii[e*2+1]=8,e++,r[8]++;for(;e<=255;)ii[e*2+1]=9,e++,r[9]++;for(;e<=279;)ii[e*2+1]=7,e++,r[7]++;for(;e<=287;)ii[e*2+1]=8,e++,r[8]++;for(fb(ii,go+1,r),e=0;e<Ps;e++)Ql[e*2+1]=5,Ql[e*2]=ub(e,5);lb=new Of(ii,n1,Yo+1,go,Mr),ob=new Of(Ql,qc,0,Ps,Mr),cb=new Of(new Array(0),nw,0,A0,tw)},hb=e=>{let t;for(t=0;t<go;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Ps;t++)e.dyn_dtree[t*2]=0;for(t=0;t<A0;t++)e.bl_tree[t*2]=0;e.dyn_ltree[R0*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},pb=e=>{e.bi_valid>8?xo(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},lw=(e,t,n,a)=>{pb(e),xo(e,n),xo(e,~n),e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},em=(e,t,n,a)=>{const i=t*2,r=n*2;return e[i]<e[r]||e[i]===e[r]&&a[t]<=a[n]},Ff=(e,t,n)=>{const a=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&em(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!em(t,a,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=a},tm=(e,t,n)=>{let a,i,r=0,s,l;if(e.last_lit!==0)do a=e.pending_buf[e.d_buf+r*2]<<8|e.pending_buf[e.d_buf+r*2+1],i=e.pending_buf[e.l_buf+r],r++,a===0?Aa(e,i,t):(s=vo[i],Aa(e,s+Yo+1,t),l=n1[s],l!==0&&(i-=L0[s],bn(e,i,l)),a--,s=db(a),Aa(e,s,n),l=qc[s],l!==0&&(a-=jd[s],bn(e,a,l)));while(r<e.last_lit);Aa(e,R0,t)},a1=(e,t)=>{const n=t.dyn_tree,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,r=t.stat_desc.elems;let s,l,c=-1,d;for(e.heap_len=0,e.heap_max=nb,s=0;s<r;s++)n[s*2]!==0?(e.heap[++e.heap_len]=c=s,e.depth[s]=0):n[s*2+1]=0;for(;e.heap_len<2;)d=e.heap[++e.heap_len]=c<2?++c:0,n[d*2]=1,e.depth[d]=0,e.opt_len--,i&&(e.static_len-=a[d*2+1]);for(t.max_code=c,s=e.heap_len>>1;s>=1;s--)Ff(e,n,s);d=r;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ff(e,n,1),l=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=l,n[d*2]=n[s*2]+n[l*2],e.depth[d]=(e.depth[s]>=e.depth[l]?e.depth[s]:e.depth[l])+1,n[s*2+1]=n[l*2+1]=d,e.heap[1]=d++,Ff(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],rw(e,t),fb(n,c,e.bl_count)},nm=(e,t,n)=>{let a,i=-1,r,s=t[1],l=0,c=7,d=4;for(s===0&&(c=138,d=3),t[(n+1)*2+1]=65535,a=0;a<=n;a++)r=s,s=t[(a+1)*2+1],!(++l<c&&r===s)&&(l<d?e.bl_tree[r*2]+=l:r!==0?(r!==i&&e.bl_tree[r*2]++,e.bl_tree[ab*2]++):l<=10?e.bl_tree[ib*2]++:e.bl_tree[rb*2]++,l=0,i=r,s===0?(c=138,d=3):r===s?(c=6,d=3):(c=7,d=4))},am=(e,t,n)=>{let a,i=-1,r,s=t[1],l=0,c=7,d=4;for(s===0&&(c=138,d=3),a=0;a<=n;a++)if(r=s,s=t[(a+1)*2+1],!(++l<c&&r===s)){if(l<d)do Aa(e,r,e.bl_tree);while(--l!==0);else r!==0?(r!==i&&(Aa(e,r,e.bl_tree),l--),Aa(e,ab,e.bl_tree),bn(e,l-3,2)):l<=10?(Aa(e,ib,e.bl_tree),bn(e,l-3,3)):(Aa(e,rb,e.bl_tree),bn(e,l-11,7));l=0,i=r,s===0?(c=138,d=3):r===s?(c=6,d=3):(c=7,d=4)}},ow=e=>{let t;for(nm(e,e.dyn_ltree,e.l_desc.max_code),nm(e,e.dyn_dtree,e.d_desc.max_code),a1(e,e.bl_desc),t=A0-1;t>=3&&e.bl_tree[sb[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},cw=(e,t,n,a)=>{let i;for(bn(e,t-257,5),bn(e,n-1,5),bn(e,a-4,4),i=0;i<a;i++)bn(e,e.bl_tree[sb[i]*2+1],3);am(e,e.dyn_ltree,t-1),am(e,e.dyn_dtree,n-1)},dw=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return JU;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return QU;for(n=32;n<Yo;n++)if(e.dyn_ltree[n*2]!==0)return QU;return JU};let im=!1;const uw=e=>{im||(sw(),im=!0),e.l_desc=new $f(e.dyn_ltree,lb),e.d_desc=new $f(e.dyn_dtree,ob),e.bl_desc=new $f(e.bl_tree,cb),e.bi_buf=0,e.bi_valid=0,hb(e)},Ub=(e,t,n,a)=>{bn(e,(qy<<1)+(a?1:0),3),lw(e,t,n)},fw=e=>{bn(e,tb<<1,3),Aa(e,R0,ii),iw(e)},hw=(e,t,n,a)=>{let i,r,s=0;e.level>0?(e.strm.data_type===Ky&&(e.strm.data_type=dw(e)),a1(e,e.l_desc),a1(e,e.d_desc),s=ow(e),i=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=i&&(i=r)):i=r=n+5,n+4<=i&&t!==-1?Ub(e,t,n,a):e.strategy===Zy||r===i?(bn(e,(tb<<1)+(a?1:0),3),tm(e,ii,Ql)):(bn(e,(Jy<<1)+(a?1:0),3),cw(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),tm(e,e.dyn_ltree,e.dyn_dtree)),hb(e),a&&pb(e)},pw=(e,t,n)=>(e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(vo[n]+Yo+1)*2]++,e.dyn_dtree[db(t)*2]++),e.last_lit===e.lit_bufsize-1);var Uw=uw,mw=Ub,gw=hw,bw=pw,vw=fw,xw={_tr_init:Uw,_tr_stored_block:mw,_tr_flush_block:gw,_tr_tally:bw,_tr_align:vw};const yw=(e,t,n,a)=>{let i=e&65535|0,r=e>>>16&65535|0,s=0;for(;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+t[a++]|0,r=r+i|0;while(--s);i%=65521,r%=65521}return i|r<<16|0};var yo=yw;const ww=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var a=0;a<8;a++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},Ew=new Uint32Array(ww()),Sw=(e,t,n,a)=>{const i=Ew,r=a+n;e^=-1;for(let s=a;s<r;s++)e=e>>>8^i[(e^t[s])&255];return e^-1};var Nt=Sw,Fr={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Iu={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Cw,_tr_stored_block:kw,_tr_flush_block:Mw,_tr_tally:Vi,_tr_align:Iw}=xw,{Z_NO_FLUSH:as,Z_PARTIAL_FLUSH:Tw,Z_FULL_FLUSH:_w,Z_FINISH:Gi,Z_BLOCK:rm,Z_OK:Ra,Z_STREAM_END:sm,Z_STREAM_ERROR:$n,Z_DATA_ERROR:jw,Z_BUF_ERROR:zf,Z_DEFAULT_COMPRESSION:Aw,Z_FILTERED:Rw,Z_HUFFMAN_ONLY:yc,Z_RLE:Lw,Z_FIXED:Dw,Z_DEFAULT_STRATEGY:Pw,Z_UNKNOWN:Nw,Z_DEFLATED:Tu}=Iu,Ow=9,$w=15,Fw=8,zw=29,Bw=256,i1=Bw+1+zw,Hw=30,Xw=19,Ww=2*i1+1,Vw=15,Ae=3,zi=258,la=zi+Ae+1,Gw=32,_u=42,r1=69,Jc=73,Qc=91,ed=103,Ir=113,$l=666,Lt=1,Zo=2,zr=3,cl=4,Yw=3,Bi=(e,t)=>(e.msg=Fr[t],t),lm=e=>(e<<1)-(e>4?9:0),Fi=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let Zw=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Yi=Zw;const Ri=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Wt=(e,t)=>{Mw(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ri(e.strm)},ze=(e,t)=>{e.pending_buf[e.pending++]=t},xl=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Kw=(e,t,n,a)=>{let i=e.avail_in;return i>a&&(i=a),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=yo(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Nt(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},mb=(e,t)=>{let n=e.max_chain_length,a=e.strstart,i,r,s=e.prev_length,l=e.nice_match;const c=e.strstart>e.w_size-la?e.strstart-(e.w_size-la):0,d=e.window,o=e.w_mask,u=e.prev,h=e.strstart+zi;let p=d[a+s-1],U=d[a+s];e.prev_length>=e.good_match&&(n>>=2),l>e.lookahead&&(l=e.lookahead);do if(i=t,!(d[i+s]!==U||d[i+s-1]!==p||d[i]!==d[a]||d[++i]!==d[a+1])){a+=2,i++;do;while(d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&a<h);if(r=zi-(h-a),a=h-zi,r>s){if(e.match_start=t,s=r,r>=l)break;p=d[a+s-1],U=d[a+s]}}while((t=u[t&o])>c&&--n!==0);return s<=e.lookahead?s:e.lookahead},Br=e=>{const t=e.w_size;let n,a,i,r,s;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-la)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,a=e.hash_size,n=a;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--a);a=t,n=a;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--a);r+=t}if(e.strm.avail_in===0)break;if(a=Kw(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=a,e.lookahead+e.insert>=Ae)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=Yi(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=Yi(e,e.ins_h,e.window[s+Ae-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<Ae)););}while(e.lookahead<la&&e.strm.avail_in!==0)},qw=(e,t)=>{let n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Br(e),e.lookahead===0&&t===as)return Lt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const a=e.block_start+n;if((e.strstart===0||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,Wt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-la&&(Wt(e,!1),e.strm.avail_out===0))return Lt}return e.insert=0,t===Gi?(Wt(e,!0),e.strm.avail_out===0?zr:cl):(e.strstart>e.block_start&&(Wt(e,!1),e.strm.avail_out===0),Lt)},Bf=(e,t)=>{let n,a;for(;;){if(e.lookahead<la){if(Br(e),e.lookahead<la&&t===as)return Lt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Ae&&(e.ins_h=Yi(e,e.ins_h,e.window[e.strstart+Ae-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-la&&(e.match_length=mb(e,n)),e.match_length>=Ae)if(a=Vi(e,e.strstart-e.match_start,e.match_length-Ae),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ae){e.match_length--;do e.strstart++,e.ins_h=Yi(e,e.ins_h,e.window[e.strstart+Ae-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Yi(e,e.ins_h,e.window[e.strstart+1]);else a=Vi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(a&&(Wt(e,!1),e.strm.avail_out===0))return Lt}return e.insert=e.strstart<Ae-1?e.strstart:Ae-1,t===Gi?(Wt(e,!0),e.strm.avail_out===0?zr:cl):e.last_lit&&(Wt(e,!1),e.strm.avail_out===0)?Lt:Zo},ds=(e,t)=>{let n,a,i;for(;;){if(e.lookahead<la){if(Br(e),e.lookahead<la&&t===as)return Lt;if(e.lookahead===0)break}if(n=0,e.lookahead>=Ae&&(e.ins_h=Yi(e,e.ins_h,e.window[e.strstart+Ae-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Ae-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-la&&(e.match_length=mb(e,n),e.match_length<=5&&(e.strategy===Rw||e.match_length===Ae&&e.strstart-e.match_start>4096)&&(e.match_length=Ae-1)),e.prev_length>=Ae&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Ae,a=Vi(e,e.strstart-1-e.prev_match,e.prev_length-Ae),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Yi(e,e.ins_h,e.window[e.strstart+Ae-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Ae-1,e.strstart++,a&&(Wt(e,!1),e.strm.avail_out===0))return Lt}else if(e.match_available){if(a=Vi(e,0,e.window[e.strstart-1]),a&&Wt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Lt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(a=Vi(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Ae-1?e.strstart:Ae-1,t===Gi?(Wt(e,!0),e.strm.avail_out===0?zr:cl):e.last_lit&&(Wt(e,!1),e.strm.avail_out===0)?Lt:Zo},Jw=(e,t)=>{let n,a,i,r;const s=e.window;for(;;){if(e.lookahead<=zi){if(Br(e),e.lookahead<=zi&&t===as)return Lt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Ae&&e.strstart>0&&(i=e.strstart-1,a=s[i],a===s[++i]&&a===s[++i]&&a===s[++i])){r=e.strstart+zi;do;while(a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&i<r);e.match_length=zi-(r-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ae?(n=Vi(e,1,e.match_length-Ae),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Vi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Wt(e,!1),e.strm.avail_out===0))return Lt}return e.insert=0,t===Gi?(Wt(e,!0),e.strm.avail_out===0?zr:cl):e.last_lit&&(Wt(e,!1),e.strm.avail_out===0)?Lt:Zo},Qw=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Br(e),e.lookahead===0)){if(t===as)return Lt;break}if(e.match_length=0,n=Vi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Wt(e,!1),e.strm.avail_out===0))return Lt}return e.insert=0,t===Gi?(Wt(e,!0),e.strm.avail_out===0?zr:cl):e.last_lit&&(Wt(e,!1),e.strm.avail_out===0)?Lt:Zo};function wa(e,t,n,a,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=a,this.func=i}const Fl=[new wa(0,0,0,0,qw),new wa(4,4,8,4,Bf),new wa(4,5,16,8,Bf),new wa(4,6,32,32,Bf),new wa(4,4,16,16,ds),new wa(8,16,32,32,ds),new wa(8,16,128,128,ds),new wa(8,32,128,256,ds),new wa(32,128,258,1024,ds),new wa(32,258,258,4096,ds)],eE=e=>{e.window_size=2*e.w_size,Fi(e.head),e.max_lazy_match=Fl[e.level].max_lazy,e.good_match=Fl[e.level].good_length,e.nice_match=Fl[e.level].nice_length,e.max_chain_length=Fl[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Ae-1,e.match_available=0,e.ins_h=0};function tE(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Tu,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ww*2),this.dyn_dtree=new Uint16Array((2*Hw+1)*2),this.bl_tree=new Uint16Array((2*Xw+1)*2),Fi(this.dyn_ltree),Fi(this.dyn_dtree),Fi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Vw+1),this.heap=new Uint16Array(2*i1+1),Fi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*i1+1),Fi(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const gb=e=>{if(!e||!e.state)return Bi(e,$n);e.total_in=e.total_out=0,e.data_type=Nw;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?_u:Ir,e.adler=t.wrap===2?0:1,t.last_flush=as,Cw(t),Ra},bb=e=>{const t=gb(e);return t===Ra&&eE(e.state),t},nE=(e,t)=>!e||!e.state||e.state.wrap!==2?$n:(e.state.gzhead=t,Ra),vb=(e,t,n,a,i,r)=>{if(!e)return $n;let s=1;if(t===Aw&&(t=6),a<0?(s=0,a=-a):a>15&&(s=2,a-=16),i<1||i>Ow||n!==Tu||a<8||a>15||t<0||t>9||r<0||r>Dw)return Bi(e,$n);a===8&&(a=9);const l=new tE;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=i+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Ae-1)/Ae),l.window=new Uint8Array(l.w_size*2),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Uint8Array(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=r,l.method=n,bb(e)},aE=(e,t)=>vb(e,t,Tu,$w,Fw,Pw),iE=(e,t)=>{let n,a;if(!e||!e.state||t>rm||t<0)return e?Bi(e,$n):$n;const i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===$l&&t!==Gi)return Bi(e,e.avail_out===0?zf:$n);i.strm=e;const r=i.last_flush;if(i.last_flush=t,i.status===_u)if(i.wrap===2)e.adler=0,ze(i,31),ze(i,139),ze(i,8),i.gzhead?(ze(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),ze(i,i.gzhead.time&255),ze(i,i.gzhead.time>>8&255),ze(i,i.gzhead.time>>16&255),ze(i,i.gzhead.time>>24&255),ze(i,i.level===9?2:i.strategy>=yc||i.level<2?4:0),ze(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(ze(i,i.gzhead.extra.length&255),ze(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Nt(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=r1):(ze(i,0),ze(i,0),ze(i,0),ze(i,0),ze(i,0),ze(i,i.level===9?2:i.strategy>=yc||i.level<2?4:0),ze(i,Yw),i.status=Ir);else{let s=Tu+(i.w_bits-8<<4)<<8,l=-1;i.strategy>=yc||i.level<2?l=0:i.level<6?l=1:i.level===6?l=2:l=3,s|=l<<6,i.strstart!==0&&(s|=Gw),s+=31-s%31,i.status=Ir,xl(i,s),i.strstart!==0&&(xl(i,e.adler>>>16),xl(i,e.adler&65535)),e.adler=1}if(i.status===r1)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),Ri(e),n=i.pending,i.pending===i.pending_buf_size));)ze(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Jc)}else i.status=Jc;if(i.status===Jc)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),Ri(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}i.gzindex<i.gzhead.name.length?a=i.gzhead.name.charCodeAt(i.gzindex++)&255:a=0,ze(i,a)}while(a!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.gzindex=0,i.status=Qc)}else i.status=Qc;if(i.status===Qc)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),Ri(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}i.gzindex<i.gzhead.comment.length?a=i.gzhead.comment.charCodeAt(i.gzindex++)&255:a=0,ze(i,a)}while(a!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.status=ed)}else i.status=ed;if(i.status===ed&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Ri(e),i.pending+2<=i.pending_buf_size&&(ze(i,e.adler&255),ze(i,e.adler>>8&255),e.adler=0,i.status=Ir)):i.status=Ir),i.pending!==0){if(Ri(e),e.avail_out===0)return i.last_flush=-1,Ra}else if(e.avail_in===0&&lm(t)<=lm(r)&&t!==Gi)return Bi(e,zf);if(i.status===$l&&e.avail_in!==0)return Bi(e,zf);if(e.avail_in!==0||i.lookahead!==0||t!==as&&i.status!==$l){let s=i.strategy===yc?Qw(i,t):i.strategy===Lw?Jw(i,t):Fl[i.level].func(i,t);if((s===zr||s===cl)&&(i.status=$l),s===Lt||s===zr)return e.avail_out===0&&(i.last_flush=-1),Ra;if(s===Zo&&(t===Tw?Iw(i):t!==rm&&(kw(i,0,0,!1),t===_w&&(Fi(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Ri(e),e.avail_out===0))return i.last_flush=-1,Ra}return t!==Gi?Ra:i.wrap<=0?sm:(i.wrap===2?(ze(i,e.adler&255),ze(i,e.adler>>8&255),ze(i,e.adler>>16&255),ze(i,e.adler>>24&255),ze(i,e.total_in&255),ze(i,e.total_in>>8&255),ze(i,e.total_in>>16&255),ze(i,e.total_in>>24&255)):(xl(i,e.adler>>>16),xl(i,e.adler&65535)),Ri(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Ra:sm)},rE=e=>{if(!e||!e.state)return $n;const t=e.state.status;return t!==_u&&t!==r1&&t!==Jc&&t!==Qc&&t!==ed&&t!==Ir&&t!==$l?Bi(e,$n):(e.state=null,t===Ir?Bi(e,jw):Ra)},sE=(e,t)=>{let n=t.length;if(!e||!e.state)return $n;const a=e.state,i=a.wrap;if(i===2||i===1&&a.status!==_u||a.lookahead)return $n;if(i===1&&(e.adler=yo(e.adler,t,n,0)),a.wrap=0,n>=a.w_size){i===0&&(Fi(a.head),a.strstart=0,a.block_start=0,a.insert=0);let c=new Uint8Array(a.w_size);c.set(t.subarray(n-a.w_size,n),0),t=c,n=a.w_size}const r=e.avail_in,s=e.next_in,l=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Br(a);a.lookahead>=Ae;){let c=a.strstart,d=a.lookahead-(Ae-1);do a.ins_h=Yi(a,a.ins_h,a.window[c+Ae-1]),a.prev[c&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=c,c++;while(--d);a.strstart=c,a.lookahead=Ae-1,Br(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=Ae-1,a.match_available=0,e.next_in=s,e.input=l,e.avail_in=r,a.wrap=i,Ra};var lE=aE,oE=vb,cE=bb,dE=gb,uE=nE,fE=iE,hE=rE,pE=sE,UE="pako deflate (from Nodeca project)",eo={deflateInit:lE,deflateInit2:oE,deflateReset:cE,deflateResetKeep:dE,deflateSetHeader:uE,deflate:fE,deflateEnd:hE,deflateSetDictionary:pE,deflateInfo:UE};const mE=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var gE=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const a in n)mE(n,a)&&(e[a]=n[a])}}return e},bE=e=>{let t=0;for(let a=0,i=e.length;a<i;a++)t+=e[a].length;const n=new Uint8Array(t);for(let a=0,i=0,r=e.length;a<r;a++){let s=e[a];n.set(s,i),i+=s.length}return n},ju={assign:gE,flattenChunks:bE};let xb=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{xb=!1}const wo=new Uint8Array(256);for(let e=0;e<256;e++)wo[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;wo[254]=wo[254]=1;var vE=e=>{let t,n,a,i,r,s=e.length,l=0;for(i=0;i<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(a=e.charCodeAt(i+1),(a&64512)===56320&&(n=65536+(n-55296<<10)+(a-56320),i++)),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(l),r=0,i=0;r<l;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(a=e.charCodeAt(i+1),(a&64512)===56320&&(n=65536+(n-55296<<10)+(a-56320),i++)),n<128?t[r++]=n:n<2048?(t[r++]=192|n>>>6,t[r++]=128|n&63):n<65536?(t[r++]=224|n>>>12,t[r++]=128|n>>>6&63,t[r++]=128|n&63):(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63,t[r++]=128|n>>>6&63,t[r++]=128|n&63);return t};const xE=(e,t)=>{if(t<65534&&e.subarray&&xb)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n};var yE=(e,t)=>{let n,a;const i=t||e.length,r=new Array(i*2);for(a=0,n=0;n<i;){let s=e[n++];if(s<128){r[a++]=s;continue}let l=wo[s];if(l>4){r[a++]=65533,n+=l-1;continue}for(s&=l===2?31:l===3?15:7;l>1&&n<i;)s=s<<6|e[n++]&63,l--;if(l>1){r[a++]=65533;continue}s<65536?r[a++]=s:(s-=65536,r[a++]=55296|s>>10&1023,r[a++]=56320|s&1023)}return xE(r,a)},wE=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+wo[e[n]]>t?n:t},Eo={string2buf:vE,buf2string:yE,utf8border:wE};function EE(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var yb=EE;const wb=Object.prototype.toString,{Z_NO_FLUSH:SE,Z_SYNC_FLUSH:CE,Z_FULL_FLUSH:kE,Z_FINISH:ME,Z_OK:Ad,Z_STREAM_END:IE,Z_DEFAULT_COMPRESSION:TE,Z_DEFAULT_STRATEGY:_E,Z_DEFLATED:jE}=Iu;function Au(e){this.options=ju.assign({level:TE,method:jE,chunkSize:16384,windowBits:15,memLevel:8,strategy:_E},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yb,this.strm.avail_out=0;let n=eo.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Ad)throw new Error(Fr[n]);if(t.header&&eo.deflateSetHeader(this.strm,t.header),t.dictionary){let a;if(typeof t.dictionary=="string"?a=Eo.string2buf(t.dictionary):wb.call(t.dictionary)==="[object ArrayBuffer]"?a=new Uint8Array(t.dictionary):a=t.dictionary,n=eo.deflateSetDictionary(this.strm,a),n!==Ad)throw new Error(Fr[n]);this._dict_set=!0}}Au.prototype.push=function(e,t){const n=this.strm,a=this.options.chunkSize;let i,r;if(this.ended)return!1;for(t===~~t?r=t:r=t===!0?ME:SE,typeof e=="string"?n.input=Eo.string2buf(e):wb.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(a),n.next_out=0,n.avail_out=a),(r===CE||r===kE)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=eo.deflate(n,r),i===IE)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=eo.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Ad;if(n.avail_out===0){this.onData(n.output);continue}if(r>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};Au.prototype.onData=function(e){this.chunks.push(e)};Au.prototype.onEnd=function(e){e===Ad&&(this.result=ju.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function AE(e,t){const n=new Au(t);if(n.push(e,!0),n.err)throw n.msg||Fr[n.err];return n.result}var RE=AE,LE={deflate:RE};const wc=30,DE=12;var PE=function(t,n){let a,i,r,s,l,c,d,o,u,h,p,U,m,g,b,v,x,y,E,S,w,k,T,_;const j=t.state;a=t.next_in,T=t.input,i=a+(t.avail_in-5),r=t.next_out,_=t.output,s=r-(n-t.avail_out),l=r+(t.avail_out-257),c=j.dmax,d=j.wsize,o=j.whave,u=j.wnext,h=j.window,p=j.hold,U=j.bits,m=j.lencode,g=j.distcode,b=(1<<j.lenbits)-1,v=(1<<j.distbits)-1;e:do{U<15&&(p+=T[a++]<<U,U+=8,p+=T[a++]<<U,U+=8),x=m[p&b];t:for(;;){if(y=x>>>24,p>>>=y,U-=y,y=x>>>16&255,y===0)_[r++]=x&65535;else if(y&16){E=x&65535,y&=15,y&&(U<y&&(p+=T[a++]<<U,U+=8),E+=p&(1<<y)-1,p>>>=y,U-=y),U<15&&(p+=T[a++]<<U,U+=8,p+=T[a++]<<U,U+=8),x=g[p&v];n:for(;;){if(y=x>>>24,p>>>=y,U-=y,y=x>>>16&255,y&16){if(S=x&65535,y&=15,U<y&&(p+=T[a++]<<U,U+=8,U<y&&(p+=T[a++]<<U,U+=8)),S+=p&(1<<y)-1,S>c){t.msg="invalid distance too far back",j.mode=wc;break e}if(p>>>=y,U-=y,y=r-s,S>y){if(y=S-y,y>o&&j.sane){t.msg="invalid distance too far back",j.mode=wc;break e}if(w=0,k=h,u===0){if(w+=d-y,y<E){E-=y;do _[r++]=h[w++];while(--y);w=r-S,k=_}}else if(u<y){if(w+=d+u-y,y-=u,y<E){E-=y;do _[r++]=h[w++];while(--y);if(w=0,u<E){y=u,E-=y;do _[r++]=h[w++];while(--y);w=r-S,k=_}}}else if(w+=u-y,y<E){E-=y;do _[r++]=h[w++];while(--y);w=r-S,k=_}for(;E>2;)_[r++]=k[w++],_[r++]=k[w++],_[r++]=k[w++],E-=3;E&&(_[r++]=k[w++],E>1&&(_[r++]=k[w++]))}else{w=r-S;do _[r++]=_[w++],_[r++]=_[w++],_[r++]=_[w++],E-=3;while(E>2);E&&(_[r++]=_[w++],E>1&&(_[r++]=_[w++]))}}else if((y&64)===0){x=g[(x&65535)+(p&(1<<y)-1)];continue n}else{t.msg="invalid distance code",j.mode=wc;break e}break}}else if((y&64)===0){x=m[(x&65535)+(p&(1<<y)-1)];continue t}else if(y&32){j.mode=DE;break e}else{t.msg="invalid literal/length code",j.mode=wc;break e}break}}while(a<i&&r<l);E=U>>3,a-=E,U-=E<<3,p&=(1<<U)-1,t.next_in=a,t.next_out=r,t.avail_in=a<i?5+(i-a):5-(a-i),t.avail_out=r<l?257+(l-r):257-(r-l),j.hold=p,j.bits=U};const us=15,om=852,cm=592,dm=0,Hf=1,um=2,NE=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),OE=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),$E=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),FE=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),zE=(e,t,n,a,i,r,s,l)=>{const c=l.bits;let d=0,o=0,u=0,h=0,p=0,U=0,m=0,g=0,b=0,v=0,x,y,E,S,w,k=null,T=0,_;const j=new Uint16Array(us+1),A=new Uint16Array(us+1);let R=null,N=0,O,$,P;for(d=0;d<=us;d++)j[d]=0;for(o=0;o<a;o++)j[t[n+o]]++;for(p=c,h=us;h>=1&&j[h]===0;h--);if(p>h&&(p=h),h===0)return i[r++]=1<<24|64<<16|0,i[r++]=1<<24|64<<16|0,l.bits=1,0;for(u=1;u<h&&j[u]===0;u++);for(p<u&&(p=u),g=1,d=1;d<=us;d++)if(g<<=1,g-=j[d],g<0)return-1;if(g>0&&(e===dm||h!==1))return-1;for(A[1]=0,d=1;d<us;d++)A[d+1]=A[d]+j[d];for(o=0;o<a;o++)t[n+o]!==0&&(s[A[t[n+o]]++]=o);if(e===dm?(k=R=s,_=19):e===Hf?(k=NE,T-=257,R=OE,N-=257,_=256):(k=$E,R=FE,_=-1),v=0,o=0,d=u,w=r,U=p,m=0,E=-1,b=1<<p,S=b-1,e===Hf&&b>om||e===um&&b>cm)return 1;for(;;){O=d-m,s[o]<_?($=0,P=s[o]):s[o]>_?($=R[N+s[o]],P=k[T+s[o]]):($=96,P=0),x=1<<d-m,y=1<<U,u=y;do y-=x,i[w+(v>>m)+y]=O<<24|$<<16|P|0;while(y!==0);for(x=1<<d-1;v&x;)x>>=1;if(x!==0?(v&=x-1,v+=x):v=0,o++,--j[d]===0){if(d===h)break;d=t[n+s[o]]}if(d>p&&(v&S)!==E){for(m===0&&(m=p),w+=u,U=d-m,g=1<<U;U+m<h&&(g-=j[U+m],!(g<=0));)U++,g<<=1;if(b+=1<<U,e===Hf&&b>om||e===um&&b>cm)return 1;E=v&S,i[E]=p<<24|U<<16|w-r|0}}return v!==0&&(i[w+v]=d-m<<24|64<<16|0),l.bits=p,0};var to=zE;const BE=0,Eb=1,Sb=2,{Z_FINISH:fm,Z_BLOCK:HE,Z_TREES:Ec,Z_OK:Hr,Z_STREAM_END:XE,Z_NEED_DICT:WE,Z_STREAM_ERROR:Bn,Z_DATA_ERROR:Cb,Z_MEM_ERROR:kb,Z_BUF_ERROR:VE,Z_DEFLATED:hm}=Iu,Mb=1,pm=2,Um=3,mm=4,gm=5,bm=6,vm=7,xm=8,ym=9,wm=10,Rd=11,Ja=12,Xf=13,Em=14,Wf=15,Sm=16,Cm=17,km=18,Mm=19,Sc=20,Cc=21,Im=22,Tm=23,_m=24,jm=25,Am=26,Vf=27,Rm=28,Lm=29,rt=30,Ib=31,GE=32,YE=852,ZE=592,KE=15,qE=KE,Dm=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function JE(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Tb=e=>{if(!e||!e.state)return Bn;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Mb,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(YE),t.distcode=t.distdyn=new Int32Array(ZE),t.sane=1,t.back=-1,Hr},_b=e=>{if(!e||!e.state)return Bn;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Tb(e)},jb=(e,t)=>{let n;if(!e||!e.state)return Bn;const a=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?Bn:(a.window!==null&&a.wbits!==t&&(a.window=null),a.wrap=n,a.wbits=t,_b(e))},Ab=(e,t)=>{if(!e)return Bn;const n=new JE;e.state=n,n.window=null;const a=jb(e,t);return a!==Hr&&(e.state=null),a},QE=e=>Ab(e,qE);let Pm=!0,Gf,Yf;const eS=e=>{if(Pm){Gf=new Int32Array(512),Yf=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(to(Eb,e.lens,0,288,Gf,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;to(Sb,e.lens,0,32,Yf,0,e.work,{bits:5}),Pm=!1}e.lencode=Gf,e.lenbits=9,e.distcode=Yf,e.distbits=5},Rb=(e,t,n,a)=>{let i;const r=e.state;return r.window===null&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),a>=r.wsize?(r.window.set(t.subarray(n-r.wsize,n),0),r.wnext=0,r.whave=r.wsize):(i=r.wsize-r.wnext,i>a&&(i=a),r.window.set(t.subarray(n-a,n-a+i),r.wnext),a-=i,a?(r.window.set(t.subarray(n-a,n),0),r.wnext=a,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=i))),0},tS=(e,t)=>{let n,a,i,r,s,l,c,d,o,u,h,p,U,m,g=0,b,v,x,y,E,S,w,k;const T=new Uint8Array(4);let _,j;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Bn;n=e.state,n.mode===Ja&&(n.mode=Xf),s=e.next_out,i=e.output,c=e.avail_out,r=e.next_in,a=e.input,l=e.avail_in,d=n.hold,o=n.bits,u=l,h=c,k=Hr;e:for(;;)switch(n.mode){case Mb:if(n.wrap===0){n.mode=Xf;break}for(;o<16;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if(n.wrap&2&&d===35615){n.check=0,T[0]=d&255,T[1]=d>>>8&255,n.check=Nt(n.check,T,2,0),d=0,o=0,n.mode=pm;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((d&255)<<8)+(d>>8))%31){e.msg="incorrect header check",n.mode=rt;break}if((d&15)!==hm){e.msg="unknown compression method",n.mode=rt;break}if(d>>>=4,o-=4,w=(d&15)+8,n.wbits===0)n.wbits=w;else if(w>n.wbits){e.msg="invalid window size",n.mode=rt;break}n.dmax=1<<n.wbits,e.adler=n.check=1,n.mode=d&512?wm:Ja,d=0,o=0;break;case pm:for(;o<16;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if(n.flags=d,(n.flags&255)!==hm){e.msg="unknown compression method",n.mode=rt;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=rt;break}n.head&&(n.head.text=d>>8&1),n.flags&512&&(T[0]=d&255,T[1]=d>>>8&255,n.check=Nt(n.check,T,2,0)),d=0,o=0,n.mode=Um;case Um:for(;o<32;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}n.head&&(n.head.time=d),n.flags&512&&(T[0]=d&255,T[1]=d>>>8&255,T[2]=d>>>16&255,T[3]=d>>>24&255,n.check=Nt(n.check,T,4,0)),d=0,o=0,n.mode=mm;case mm:for(;o<16;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}n.head&&(n.head.xflags=d&255,n.head.os=d>>8),n.flags&512&&(T[0]=d&255,T[1]=d>>>8&255,n.check=Nt(n.check,T,2,0)),d=0,o=0,n.mode=gm;case gm:if(n.flags&1024){for(;o<16;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}n.length=d,n.head&&(n.head.extra_len=d),n.flags&512&&(T[0]=d&255,T[1]=d>>>8&255,n.check=Nt(n.check,T,2,0)),d=0,o=0}else n.head&&(n.head.extra=null);n.mode=bm;case bm:if(n.flags&1024&&(p=n.length,p>l&&(p=l),p&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(a.subarray(r,r+p),w)),n.flags&512&&(n.check=Nt(n.check,a,p,r)),l-=p,r+=p,n.length-=p),n.length))break e;n.length=0,n.mode=vm;case vm:if(n.flags&2048){if(l===0)break e;p=0;do w=a[r+p++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w));while(w&&p<l);if(n.flags&512&&(n.check=Nt(n.check,a,p,r)),l-=p,r+=p,w)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=xm;case xm:if(n.flags&4096){if(l===0)break e;p=0;do w=a[r+p++],n.head&&w&&n.length<65536&&(n.head.comment+=String.fromCharCode(w));while(w&&p<l);if(n.flags&512&&(n.check=Nt(n.check,a,p,r)),l-=p,r+=p,w)break e}else n.head&&(n.head.comment=null);n.mode=ym;case ym:if(n.flags&512){for(;o<16;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if(d!==(n.check&65535)){e.msg="header crc mismatch",n.mode=rt;break}d=0,o=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Ja;break;case wm:for(;o<32;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}e.adler=n.check=Dm(d),d=0,o=0,n.mode=Rd;case Rd:if(n.havedict===0)return e.next_out=s,e.avail_out=c,e.next_in=r,e.avail_in=l,n.hold=d,n.bits=o,WE;e.adler=n.check=1,n.mode=Ja;case Ja:if(t===HE||t===Ec)break e;case Xf:if(n.last){d>>>=o&7,o-=o&7,n.mode=Vf;break}for(;o<3;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}switch(n.last=d&1,d>>>=1,o-=1,d&3){case 0:n.mode=Em;break;case 1:if(eS(n),n.mode=Sc,t===Ec){d>>>=2,o-=2;break e}break;case 2:n.mode=Cm;break;case 3:e.msg="invalid block type",n.mode=rt}d>>>=2,o-=2;break;case Em:for(d>>>=o&7,o-=o&7;o<32;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if((d&65535)!==(d>>>16^65535)){e.msg="invalid stored block lengths",n.mode=rt;break}if(n.length=d&65535,d=0,o=0,n.mode=Wf,t===Ec)break e;case Wf:n.mode=Sm;case Sm:if(p=n.length,p){if(p>l&&(p=l),p>c&&(p=c),p===0)break e;i.set(a.subarray(r,r+p),s),l-=p,r+=p,c-=p,s+=p,n.length-=p;break}n.mode=Ja;break;case Cm:for(;o<14;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if(n.nlen=(d&31)+257,d>>>=5,o-=5,n.ndist=(d&31)+1,d>>>=5,o-=5,n.ncode=(d&15)+4,d>>>=4,o-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=rt;break}n.have=0,n.mode=km;case km:for(;n.have<n.ncode;){for(;o<3;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}n.lens[A[n.have++]]=d&7,d>>>=3,o-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,_={bits:n.lenbits},k=to(BE,n.lens,0,19,n.lencode,0,n.work,_),n.lenbits=_.bits,k){e.msg="invalid code lengths set",n.mode=rt;break}n.have=0,n.mode=Mm;case Mm:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[d&(1<<n.lenbits)-1],b=g>>>24,v=g>>>16&255,x=g&65535,!(b<=o);){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if(x<16)d>>>=b,o-=b,n.lens[n.have++]=x;else{if(x===16){for(j=b+2;o<j;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if(d>>>=b,o-=b,n.have===0){e.msg="invalid bit length repeat",n.mode=rt;break}w=n.lens[n.have-1],p=3+(d&3),d>>>=2,o-=2}else if(x===17){for(j=b+3;o<j;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}d>>>=b,o-=b,w=0,p=3+(d&7),d>>>=3,o-=3}else{for(j=b+7;o<j;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}d>>>=b,o-=b,w=0,p=11+(d&127),d>>>=7,o-=7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=rt;break}for(;p--;)n.lens[n.have++]=w}}if(n.mode===rt)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=rt;break}if(n.lenbits=9,_={bits:n.lenbits},k=to(Eb,n.lens,0,n.nlen,n.lencode,0,n.work,_),n.lenbits=_.bits,k){e.msg="invalid literal/lengths set",n.mode=rt;break}if(n.distbits=6,n.distcode=n.distdyn,_={bits:n.distbits},k=to(Sb,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,_),n.distbits=_.bits,k){e.msg="invalid distances set",n.mode=rt;break}if(n.mode=Sc,t===Ec)break e;case Sc:n.mode=Cc;case Cc:if(l>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=r,e.avail_in=l,n.hold=d,n.bits=o,PE(e,h),s=e.next_out,i=e.output,c=e.avail_out,r=e.next_in,a=e.input,l=e.avail_in,d=n.hold,o=n.bits,n.mode===Ja&&(n.back=-1);break}for(n.back=0;g=n.lencode[d&(1<<n.lenbits)-1],b=g>>>24,v=g>>>16&255,x=g&65535,!(b<=o);){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if(v&&(v&240)===0){for(y=b,E=v,S=x;g=n.lencode[S+((d&(1<<y+E)-1)>>y)],b=g>>>24,v=g>>>16&255,x=g&65535,!(y+b<=o);){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}d>>>=y,o-=y,n.back+=y}if(d>>>=b,o-=b,n.back+=b,n.length=x,v===0){n.mode=Am;break}if(v&32){n.back=-1,n.mode=Ja;break}if(v&64){e.msg="invalid literal/length code",n.mode=rt;break}n.extra=v&15,n.mode=Im;case Im:if(n.extra){for(j=n.extra;o<j;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}n.length+=d&(1<<n.extra)-1,d>>>=n.extra,o-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Tm;case Tm:for(;g=n.distcode[d&(1<<n.distbits)-1],b=g>>>24,v=g>>>16&255,x=g&65535,!(b<=o);){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if((v&240)===0){for(y=b,E=v,S=x;g=n.distcode[S+((d&(1<<y+E)-1)>>y)],b=g>>>24,v=g>>>16&255,x=g&65535,!(y+b<=o);){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}d>>>=y,o-=y,n.back+=y}if(d>>>=b,o-=b,n.back+=b,v&64){e.msg="invalid distance code",n.mode=rt;break}n.offset=x,n.extra=v&15,n.mode=_m;case _m:if(n.extra){for(j=n.extra;o<j;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}n.offset+=d&(1<<n.extra)-1,d>>>=n.extra,o-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=rt;break}n.mode=jm;case jm:if(c===0)break e;if(p=h-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=rt;break}p>n.wnext?(p-=n.wnext,U=n.wsize-p):U=n.wnext-p,p>n.length&&(p=n.length),m=n.window}else m=i,U=s-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[s++]=m[U++];while(--p);n.length===0&&(n.mode=Cc);break;case Am:if(c===0)break e;i[s++]=n.length,c--,n.mode=Cc;break;case Vf:if(n.wrap){for(;o<32;){if(l===0)break e;l--,d|=a[r++]<<o,o+=8}if(h-=c,e.total_out+=h,n.total+=h,h&&(e.adler=n.check=n.flags?Nt(n.check,i,h,s-h):yo(n.check,i,h,s-h)),h=c,(n.flags?d:Dm(d))!==n.check){e.msg="incorrect data check",n.mode=rt;break}d=0,o=0}n.mode=Rm;case Rm:if(n.wrap&&n.flags){for(;o<32;){if(l===0)break e;l--,d+=a[r++]<<o,o+=8}if(d!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=rt;break}d=0,o=0}n.mode=Lm;case Lm:k=XE;break e;case rt:k=Cb;break e;case Ib:return kb;case GE:default:return Bn}return e.next_out=s,e.avail_out=c,e.next_in=r,e.avail_in=l,n.hold=d,n.bits=o,(n.wsize||h!==e.avail_out&&n.mode<rt&&(n.mode<Vf||t!==fm))&&Rb(e,e.output,e.next_out,h-e.avail_out),u-=e.avail_in,h-=e.avail_out,e.total_in+=u,e.total_out+=h,n.total+=h,n.wrap&&h&&(e.adler=n.check=n.flags?Nt(n.check,i,h,e.next_out-h):yo(n.check,i,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Ja?128:0)+(n.mode===Sc||n.mode===Wf?256:0),(u===0&&h===0||t===fm)&&k===Hr&&(k=VE),k},nS=e=>{if(!e||!e.state)return Bn;let t=e.state;return t.window&&(t.window=null),e.state=null,Hr},aS=(e,t)=>{if(!e||!e.state)return Bn;const n=e.state;return(n.wrap&2)===0?Bn:(n.head=t,t.done=!1,Hr)},iS=(e,t)=>{const n=t.length;let a,i,r;return!e||!e.state||(a=e.state,a.wrap!==0&&a.mode!==Rd)?Bn:a.mode===Rd&&(i=1,i=yo(i,t,n,0),i!==a.check)?Cb:(r=Rb(e,t,n,n),r?(a.mode=Ib,kb):(a.havedict=1,Hr))};var rS=_b,sS=jb,lS=Tb,oS=QE,cS=Ab,dS=tS,uS=nS,fS=aS,hS=iS,pS="pako inflate (from Nodeca project)",ri={inflateReset:rS,inflateReset2:sS,inflateResetKeep:lS,inflateInit:oS,inflateInit2:cS,inflate:dS,inflateEnd:uS,inflateGetHeader:fS,inflateSetDictionary:hS,inflateInfo:pS};function US(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var mS=US;const Lb=Object.prototype.toString,{Z_NO_FLUSH:gS,Z_FINISH:bS,Z_OK:So,Z_STREAM_END:Zf,Z_NEED_DICT:Kf,Z_STREAM_ERROR:vS,Z_DATA_ERROR:Nm,Z_MEM_ERROR:xS}=Iu;function Ru(e){this.options=ju.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yb,this.strm.avail_out=0;let n=ri.inflateInit2(this.strm,t.windowBits);if(n!==So)throw new Error(Fr[n]);if(this.header=new mS,ri.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Eo.string2buf(t.dictionary):Lb.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=ri.inflateSetDictionary(this.strm,t.dictionary),n!==So)))throw new Error(Fr[n])}Ru.prototype.push=function(e,t){const n=this.strm,a=this.options.chunkSize,i=this.options.dictionary;let r,s,l;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?bS:gS,Lb.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(a),n.next_out=0,n.avail_out=a),r=ri.inflate(n,s),r===Kf&&i&&(r=ri.inflateSetDictionary(n,i),r===So?r=ri.inflate(n,s):r===Nm&&(r=Kf));n.avail_in>0&&r===Zf&&n.state.wrap>0&&e[n.next_in]!==0;)ri.inflateReset(n),r=ri.inflate(n,s);switch(r){case vS:case Nm:case Kf:case xS:return this.onEnd(r),this.ended=!0,!1}if(l=n.avail_out,n.next_out&&(n.avail_out===0||r===Zf))if(this.options.to==="string"){let c=Eo.utf8border(n.output,n.next_out),d=n.next_out-c,o=Eo.buf2string(n.output,c);n.next_out=d,n.avail_out=a-d,d&&n.output.set(n.output.subarray(c,c+d),0),this.onData(o)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(r===So&&l===0)){if(r===Zf)return r=ri.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};Ru.prototype.onData=function(e){this.chunks.push(e)};Ru.prototype.onEnd=function(e){e===So&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ju.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function yS(e,t){const n=new Ru(t);if(n.push(e),n.err)throw n.msg||Fr[n.err];return n.result}var wS=yS,ES={inflate:wS};const{deflate:SS}=LE,{inflate:CS}=ES;var kS=SS,MS=CS;const IS="#ffffff",TS="#000000",_S=["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],jS=["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],AS=["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],RS=["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],LS=["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],DS=["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],PS=["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],NS=["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],OS=["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],$S=["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],FS=["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],zS=["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],BS=["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"],Ft={white:IS,black:TS,gray:_S,red:jS,pink:AS,grape:RS,violet:LS,indigo:DS,blue:PS,cyan:NS,teal:OS,green:$S,lime:FS,yellow:zS,orange:BS},HS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Lu=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=HS[n[e]&63];return t};var qf,Om;function XS(){if(Om)return qf;Om=1;var e="Expected a function",t=NaN,n="[object Symbol]",a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c=typeof Qt.commonjsGlobal=="object"&&Qt.commonjsGlobal&&Qt.commonjsGlobal.Object===Object&&Qt.commonjsGlobal,d=typeof self=="object"&&self&&self.Object===Object&&self,o=c||d||Function("return this")(),u=Object.prototype,h=u.toString,p=Math.max,U=Math.min,m=function(){return o.Date.now()};function g(S,w,k){var T,_,j,A,R,N,O=0,$=!1,P=!1,W=!0;if(typeof S!="function")throw new TypeError(e);w=E(w)||0,v(k)&&($=!!k.leading,P="maxWait"in k,j=P?p(E(k.maxWait)||0,w):j,W="trailing"in k?!!k.trailing:W);function F(ue){var Fe=T,Ee=_;return T=_=void 0,O=ue,A=S.apply(Ee,Fe),A}function Y(ue){return O=ue,R=setTimeout(ie,w),$?F(ue):A}function Q(ue){var Fe=ue-N,Ee=ue-O,je=w-Fe;return P?U(je,j-Ee):je}function le(ue){var Fe=ue-N,Ee=ue-O;return N===void 0||Fe>=w||Fe<0||P&&Ee>=j}function ie(){var ue=m();if(le(ue))return Te(ue);R=setTimeout(ie,Q(ue))}function Te(ue){return R=void 0,W&&T?F(ue):(T=_=void 0,A)}function _e(){R!==void 0&&clearTimeout(R),O=0,T=N=_=R=void 0}function Ie(){return R===void 0?A:Te(m())}function oe(){var ue=m(),Fe=le(ue);if(T=arguments,_=this,N=ue,Fe){if(R===void 0)return Y(N);if(P)return R=setTimeout(ie,w),F(N)}return R===void 0&&(R=setTimeout(ie,w)),A}return oe.cancel=_e,oe.flush=Ie,oe}function b(S,w,k){var T=!0,_=!0;if(typeof S!="function")throw new TypeError(e);return v(k)&&(T="leading"in k?!!k.leading:T,_="trailing"in k?!!k.trailing:_),g(S,w,{leading:T,maxWait:w,trailing:_})}function v(S){var w=typeof S;return!!S&&(w=="object"||w=="function")}function x(S){return!!S&&typeof S=="object"}function y(S){return typeof S=="symbol"||x(S)&&h.call(S)==n}function E(S){if(typeof S=="number")return S;if(y(S))return t;if(v(S)){var w=typeof S.valueOf=="function"?S.valueOf():S;S=v(w)?w+"":w}if(typeof S!="string")return S===0?S:+S;S=S.replace(a,"");var k=r.test(S);return k||s.test(S)?l(S.slice(2),k?2:8):i.test(S)?t:+S}return qf=b,qf}var WS=XS();const Ko=Qt.getDefaultExportFromCjs(WS);var td={exports:{}},VS=td.exports,$m;function GS(){return $m||($m=1,(function(e,t){(function(n,a){e.exports=a()})(VS,function(){var n=function(){this._listeners={}};n.prototype.addEventListener=function(d,o){this._listeners[d]=this._listeners[d]||[],this._listeners[d].indexOf(o)<0&&this._listeners[d].push(o)},n.prototype.removeEventListener=function(d,o){if(this._listeners[d]){var u=this._listeners[d].indexOf(o);u>=0&&this._listeners[d].splice(u,1)}},n.prototype.dispatchEvent=function(d){if(this._listeners[d.type]&&this._listeners[d.type].length)for(var o=this._listeners[d.type].slice(),u=0,h=o.length;u<h;++u)o[u].call(this,d)};var a=function(d){return typeof d.constructor=="function"&&d.constructor.name==="GeneratorFunction"},i=function(d){return{next:function(){var o=d();return o?{value:o}:{done:!0}}}},r=function(d){var o=!1;return{next:function(){return o?{done:!0}:(o=!0,{value:d})}}},s=function(d,o){var u=typeof d;if(u==="object"){if(typeof d.next=="function")return d;if(typeof d.then=="function")return r(d)}return u==="function"?a(d)?d():i(d):r(o.resolve(d))},l=function(d,o,u){this.target=d,this.type=o,this.data=u},c=function(d,o,u){if(n.call(this),typeof o!="number"||Math.floor(o)!==o||o<1)throw new Error("Invalid concurrency");this._concurrency=o,this._options=u||{},this._options.promise=this._options.promise||Promise,this._iterator=s(d,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return c.prototype=new n,c.prototype.constructor=c,c.prototype.concurrency=function(d){return typeof d<"u"&&(this._concurrency=d,this.active()&&this._proceed()),this._concurrency},c.prototype.size=function(){return this._size},c.prototype.active=function(){return!!this._promise},c.prototype.promise=function(){return this._promise},c.prototype.start=function(){var d=this,o=this._options.promise;return this._promise=new o(function(u,h){d._callbacks={reject:h,resolve:u},d._proceed()}),this._promise},c.prototype._fireEvent=function(d,o){this.dispatchEvent(new l(this,d,o))},c.prototype._settle=function(d){d?this._callbacks.reject(d):this._callbacks.resolve(),this._promise=null,this._callbacks=null},c.prototype._onPooledPromiseFulfilled=function(d,o){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:d,result:o}),this._proceed())},c.prototype._onPooledPromiseRejected=function(d,o){this._size--,this.active()&&(this._fireEvent("rejected",{promise:d,error:o}),this._settle(o||new Error("Unknown error")))},c.prototype._trackPromise=function(d){var o=this;d.then(function(u){o._onPooledPromiseFulfilled(d,u)},function(u){o._onPooledPromiseRejected(d,u)}).catch(function(u){o._settle(new Error("Promise processing failed: "+u))})},c.prototype._proceed=function(){if(!this._done){for(var d={done:!1};this._size<this._concurrency&&!(d=this._iterator.next()).done;)this._size++,this._trackPromise(d.value);this._done=d===null||!!d.done}this._done&&this._size===0&&this._settle()},c.PromisePoolEvent=l,c.PromisePool=c,c})})(td)),td.exports}var YS=GS();const ZS=Qt.getDefaultExportFromCjs(YS);function s1(e,t,n){if(e&&e.length){const[a,i]=t,r=Math.PI/180*n,s=Math.cos(r),l=Math.sin(r);for(const c of e){const[d,o]=c;c[0]=(d-a)*s-(o-i)*l+a,c[1]=(d-a)*l+(o-i)*s+i}}}function KS(e,t,n){const a=[];e.forEach(i=>a.push(...i)),s1(a,t,n)}function qS(e,t){return e[0]===t[0]&&e[1]===t[1]}function JS(e,t,n,a=1){const i=n,r=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,l=[0,0];if(i)for(const d of s)s1(d,l,i);const c=QS(s,r,a);if(i){for(const d of s)s1(d,l,-i);KS(c,l,-i)}return c}function QS(e,t,n){const a=[];for(const d of e){const o=[...d];qS(o[0],o[o.length-1])||o.push([o[0][0],o[0][1]]),o.length>2&&a.push(o)}const i=[];t=Math.max(t,.1);const r=[];for(const d of a)for(let o=0;o<d.length-1;o++){const u=d[o],h=d[o+1];if(u[1]!==h[1]){const p=Math.min(u[1],h[1]);r.push({ymin:p,ymax:Math.max(u[1],h[1]),x:p===u[1]?u[0]:h[0],islope:(h[0]-u[0])/(h[1]-u[1])})}}if(r.sort((d,o)=>d.ymin<o.ymin?-1:d.ymin>o.ymin?1:d.x<o.x?-1:d.x>o.x?1:d.ymax===o.ymax?0:(d.ymax-o.ymax)/Math.abs(d.ymax-o.ymax)),!r.length)return i;let s=[],l=r[0].ymin,c=0;for(;s.length||r.length;){if(r.length){let d=-1;for(let u=0;u<r.length&&!(r[u].ymin>l);u++)d=u;r.splice(0,d+1).forEach(u=>{s.push({s:l,edge:u})})}if(s=s.filter(d=>!(d.edge.ymax<=l)),s.sort((d,o)=>d.edge.x===o.edge.x?0:(d.edge.x-o.edge.x)/Math.abs(d.edge.x-o.edge.x)),(n!==1||c%t===0)&&s.length>1)for(let d=0;d<s.length;d=d+2){const o=d+1;if(o>=s.length)break;const u=s[d].edge,h=s[o].edge;i.push([[Math.round(u.x),l],[Math.round(h.x),l]])}l+=n,s.forEach(d=>{d.edge.x=d.edge.x+n*d.edge.islope}),c++}return i}function qo(e,t){var n;const a=t.hachureAngle+90;let i=t.hachureGap;i<0&&(i=t.strokeWidth*4),i=Math.max(i,.1);let r=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(r=i),JS(e,i,a,r||1)}class D0{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const a=qo(t,n);return{type:"fillSketch",ops:this.renderLines(a,n)}}renderLines(t,n){const a=[];for(const i of t)a.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],n));return a}}function Du(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class eC extends D0{fillPolygons(t,n){let a=n.hachureGap;a<0&&(a=n.strokeWidth*4),a=Math.max(a,.1);const i=Object.assign({},n,{hachureGap:a}),r=qo(t,i),s=Math.PI/180*n.hachureAngle,l=[],c=a*.5*Math.cos(s),d=a*.5*Math.sin(s);for(const[u,h]of r)Du([u,h])&&l.push([[u[0]-c,u[1]+d],[...h]],[[u[0]+c,u[1]-d],[...h]]);return{type:"fillSketch",ops:this.renderLines(l,n)}}}class tC extends D0{fillPolygons(t,n){const a=this._fillPolygons(t,n),i=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),r=this._fillPolygons(t,i);return a.ops=a.ops.concat(r.ops),a}}class nC{constructor(t){this.helper=t}fillPolygons(t,n){n=Object.assign({},n,{hachureAngle:0});const a=qo(t,n);return this.dotsOnLines(a,n)}dotsOnLines(t,n){const a=[];let i=n.hachureGap;i<0&&(i=n.strokeWidth*4),i=Math.max(i,.1);let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const s=i/4;for(const l of t){const c=Du(l),d=c/i,o=Math.ceil(d)-1,u=c-o*i,h=(l[0][0]+l[1][0])/2-i/4,p=Math.min(l[0][1],l[1][1]);for(let U=0;U<o;U++){const m=p+u+U*i,g=h-s+Math.random()*2*s,b=m-s+Math.random()*2*s,v=this.helper.ellipse(g,b,r,r,n);a.push(...v.ops)}}return{type:"fillSketch",ops:a}}}class aC{constructor(t){this.helper=t}fillPolygons(t,n){const a=qo(t,n);return{type:"fillSketch",ops:this.dashedLine(a,n)}}dashedLine(t,n){const a=n.dashOffset<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashOffset,i=n.dashGap<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashGap,r=[];return t.forEach(s=>{const l=Du(s),c=Math.floor(l/(a+i)),d=(l+i-c*(a+i))/2;let o=s[0],u=s[1];o[0]>u[0]&&(o=s[1],u=s[0]);const h=Math.atan((u[1]-o[1])/(u[0]-o[0]));for(let p=0;p<c;p++){const U=p*(a+i),m=U+a,g=[o[0]+U*Math.cos(h)+d*Math.cos(h),o[1]+U*Math.sin(h)+d*Math.sin(h)],b=[o[0]+m*Math.cos(h)+d*Math.cos(h),o[1]+m*Math.sin(h)+d*Math.sin(h)];r.push(...this.helper.doubleLineOps(g[0],g[1],b[0],b[1],n))}}),r}}class iC{constructor(t){this.helper=t}fillPolygons(t,n){const a=n.hachureGap<0?n.strokeWidth*4:n.hachureGap,i=n.zigzagOffset<0?a:n.zigzagOffset;n=Object.assign({},n,{hachureGap:a+i});const r=qo(t,n);return{type:"fillSketch",ops:this.zigzagLines(r,i,n)}}zigzagLines(t,n,a){const i=[];return t.forEach(r=>{const s=Du(r),l=Math.round(s/(2*n));let c=r[0],d=r[1];c[0]>d[0]&&(c=r[1],d=r[0]);const o=Math.atan((d[1]-c[1])/(d[0]-c[0]));for(let u=0;u<l;u++){const h=u*2*n,p=(u+1)*2*n,U=Math.sqrt(2*Math.pow(n,2)),m=[c[0]+h*Math.cos(o),c[1]+h*Math.sin(o)],g=[c[0]+p*Math.cos(o),c[1]+p*Math.sin(o)],b=[m[0]+U*Math.cos(o+Math.PI/4),m[1]+U*Math.sin(o+Math.PI/4)];i.push(...this.helper.doubleLineOps(m[0],m[1],b[0],b[1],a),...this.helper.doubleLineOps(b[0],b[1],g[0],g[1],a))}}),i}}const fn={};function rC(e,t){let n=e.fillStyle||"hachure";if(!fn[n])switch(n){case"zigzag":fn[n]||(fn[n]=new eC(t));break;case"cross-hatch":fn[n]||(fn[n]=new tC(t));break;case"dots":fn[n]||(fn[n]=new nC(t));break;case"dashed":fn[n]||(fn[n]=new aC(t));break;case"zigzag-line":fn[n]||(fn[n]=new iC(t));break;case"hachure":default:n="hachure",fn[n]||(fn[n]=new D0(t));break}return fn[n]}function sC(){return Math.floor(Math.random()*2**31)}class Db{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const lC=0,l1=1,Pb=2,kc={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function oC(e){const t=new Array;for(;e!=="";)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:lC,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:l1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:Pb,text:""},t}function Jf(e,t){return e.type===t}function P0(e){const t=[],n=oC(e);let a="BOD",i=0,r=n[i];for(;!Jf(r,Pb);){let s=0;const l=[];if(a==="BOD")if(r.text==="M"||r.text==="m")i++,s=kc[r.text],a=r.text;else return P0("M0,0"+e);else Jf(r,l1)?s=kc[a]:(i++,s=kc[r.text],a=r.text);if(i+s<n.length){for(let c=i;c<i+s;c++){const d=n[c];if(Jf(d,l1))l[l.length]=+d.text;else throw new Error("Param not a number: "+a+","+d.text)}if(typeof kc[a]=="number"){const c={key:a,data:l};t.push(c),i+=s,r=n[i],a==="M"&&(a="L"),a==="m"&&(a="l")}else throw new Error("Bad segment: "+a)}else throw new Error("Path data ended short")}return t}function Nb(e){let t=0,n=0,a=0,i=0;const r=[];for(const{key:s,data:l}of e)switch(s){case"M":r.push({key:"M",data:[...l]}),[t,n]=l,[a,i]=l;break;case"m":t+=l[0],n+=l[1],r.push({key:"M",data:[t,n]}),a=t,i=n;break;case"L":r.push({key:"L",data:[...l]}),[t,n]=l;break;case"l":t+=l[0],n+=l[1],r.push({key:"L",data:[t,n]});break;case"C":r.push({key:"C",data:[...l]}),t=l[4],n=l[5];break;case"c":{const c=l.map((d,o)=>o%2?d+n:d+t);r.push({key:"C",data:c}),t=c[4],n=c[5];break}case"Q":r.push({key:"Q",data:[...l]}),t=l[2],n=l[3];break;case"q":{const c=l.map((d,o)=>o%2?d+n:d+t);r.push({key:"Q",data:c}),t=c[2],n=c[3];break}case"A":r.push({key:"A",data:[...l]}),t=l[5],n=l[6];break;case"a":t+=l[5],n+=l[6],r.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,n]});break;case"H":r.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],r.push({key:"H",data:[t]});break;case"V":r.push({key:"V",data:[...l]}),n=l[0];break;case"v":n+=l[0],r.push({key:"V",data:[n]});break;case"S":r.push({key:"S",data:[...l]}),t=l[2],n=l[3];break;case"s":{const c=l.map((d,o)=>o%2?d+n:d+t);r.push({key:"S",data:c}),t=c[2],n=c[3];break}case"T":r.push({key:"T",data:[...l]}),t=l[0],n=l[1];break;case"t":t+=l[0],n+=l[1],r.push({key:"T",data:[t,n]});break;case"Z":case"z":r.push({key:"Z",data:[]}),t=a,n=i;break}return r}function Ob(e){const t=[];let n="",a=0,i=0,r=0,s=0,l=0,c=0;for(const{key:d,data:o}of e){switch(d){case"M":t.push({key:"M",data:[...o]}),[a,i]=o,[r,s]=o;break;case"C":t.push({key:"C",data:[...o]}),a=o[4],i=o[5],l=o[2],c=o[3];break;case"L":t.push({key:"L",data:[...o]}),[a,i]=o;break;case"H":a=o[0],t.push({key:"L",data:[a,i]});break;case"V":i=o[0],t.push({key:"L",data:[a,i]});break;case"S":{let u=0,h=0;n==="C"||n==="S"?(u=a+(a-l),h=i+(i-c)):(u=a,h=i),t.push({key:"C",data:[u,h,...o]}),l=o[0],c=o[1],a=o[2],i=o[3];break}case"T":{const[u,h]=o;let p=0,U=0;n==="Q"||n==="T"?(p=a+(a-l),U=i+(i-c)):(p=a,U=i);const m=a+2*(p-a)/3,g=i+2*(U-i)/3,b=u+2*(p-u)/3,v=h+2*(U-h)/3;t.push({key:"C",data:[m,g,b,v,u,h]}),l=p,c=U,a=u,i=h;break}case"Q":{const[u,h,p,U]=o,m=a+2*(u-a)/3,g=i+2*(h-i)/3,b=p+2*(u-p)/3,v=U+2*(h-U)/3;t.push({key:"C",data:[m,g,b,v,p,U]}),l=u,c=h,a=p,i=U;break}case"A":{const u=Math.abs(o[0]),h=Math.abs(o[1]),p=o[2],U=o[3],m=o[4],g=o[5],b=o[6];u===0||h===0?(t.push({key:"C",data:[a,i,g,b,g,b]}),a=g,i=b):(a!==g||i!==b)&&($b(a,i,g,b,u,h,p,U,m).forEach(function(x){t.push({key:"C",data:x})}),a=g,i=b);break}case"Z":t.push({key:"Z",data:[]}),a=r,i=s;break}n=d}return t}function cC(e){return Math.PI*e/180}function yl(e,t,n){const a=e*Math.cos(n)-t*Math.sin(n),i=e*Math.sin(n)+t*Math.cos(n);return[a,i]}function $b(e,t,n,a,i,r,s,l,c,d){const o=cC(s);let u=[],h=0,p=0,U=0,m=0;if(d)[h,p,U,m]=d;else{[e,t]=yl(e,t,-o),[n,a]=yl(n,a,-o);const A=(e-n)/2,R=(t-a)/2;let N=A*A/(i*i)+R*R/(r*r);N>1&&(N=Math.sqrt(N),i=N*i,r=N*r);const O=l===c?-1:1,$=i*i,P=r*r,W=$*P-$*R*R-P*A*A,F=$*R*R+P*A*A,Y=O*Math.sqrt(Math.abs(W/F));U=Y*i*R/r+(e+n)/2,m=Y*-r*A/i+(t+a)/2,h=Math.asin(parseFloat(((t-m)/r).toFixed(9))),p=Math.asin(parseFloat(((a-m)/r).toFixed(9))),e<U&&(h=Math.PI-h),n<U&&(p=Math.PI-p),h<0&&(h=Math.PI*2+h),p<0&&(p=Math.PI*2+p),c&&h>p&&(h=h-Math.PI*2),!c&&p>h&&(p=p-Math.PI*2)}let g=p-h;if(Math.abs(g)>Math.PI*120/180){const A=p,R=n,N=a;c&&p>h?p=h+Math.PI*120/180*1:p=h+Math.PI*120/180*-1,n=U+i*Math.cos(p),a=m+r*Math.sin(p),u=$b(n,a,R,N,i,r,s,0,c,[p,A,U,m])}g=p-h;const b=Math.cos(h),v=Math.sin(h),x=Math.cos(p),y=Math.sin(p),E=Math.tan(g/4),S=4/3*i*E,w=4/3*r*E,k=[e,t],T=[e+S*v,t-w*b],_=[n+S*y,a-w*x],j=[n,a];if(T[0]=2*k[0]-T[0],T[1]=2*k[1]-T[1],d)return[T,_,j].concat(u);{u=[T,_,j].concat(u);const A=[];for(let R=0;R<u.length;R+=3){const N=yl(u[R][0],u[R][1],o),O=yl(u[R+1][0],u[R+1][1],o),$=yl(u[R+2][0],u[R+2][1],o);A.push([N[0],N[1],O[0],O[1],$[0],$[1]])}return A}}const dC={randOffset:UC,randOffsetWithRange:mC,ellipse:hC,doubleLineOps:gC};function Fb(e,t,n,a,i){return{type:"path",ops:hi(e,t,n,a,i)}}function nd(e,t,n){const a=(e||[]).length;if(a>2){const i=[];for(let r=0;r<a-1;r++)i.push(...hi(e[r][0],e[r][1],e[r+1][0],e[r+1][1],n));return t&&i.push(...hi(e[a-1][0],e[a-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}else if(a===2)return Fb(e[0][0],e[0][1],e[1][0],e[1][1],n);return{type:"path",ops:[]}}function uC(e,t){return nd(e,!0,t)}function fC(e,t,n,a,i){const r=[[e,t],[e+n,t],[e+n,t+a],[e,t+a]];return uC(r,i)}function Fm(e,t){let n=Xm(e,1*(1+t.roughness*.2),t);if(!t.disableMultiStroke){const a=Xm(e,1.5*(1+t.roughness*.22),bC(t));n=n.concat(a)}return{type:"path",ops:n}}function hC(e,t,n,a,i){const r=zb(n,a,i);return o1(e,t,i,r).opset}function zb(e,t,n){const a=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*a)),r=Math.PI*2/i;let s=Math.abs(e/2),l=Math.abs(t/2);const c=1-n.curveFitting;return s+=he(s*c,n),l+=he(l*c,n),{increment:r,rx:s,ry:l}}function o1(e,t,n,a){const[i,r]=Wm(a.increment,e,t,a.rx,a.ry,1,a.increment*Ld(.1,Ld(.4,1,n),n),n);let s=Dd(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[l]=Wm(a.increment,e,t,a.rx,a.ry,1.5,0,n),c=Dd(l,null,n);s=s.concat(c)}return{estimatedPoints:r,opset:{type:"path",ops:s}}}function zm(e,t,n,a,i,r,s,l,c){const d=e,o=t;let u=Math.abs(n/2),h=Math.abs(a/2);u+=he(u*.01,c),h+=he(h*.01,c);let p=i,U=r;for(;p<0;)p+=Math.PI*2,U+=Math.PI*2;U-p>Math.PI*2&&(p=0,U=Math.PI*2);const m=Math.PI*2/c.curveStepCount,g=Math.min(m/2,(U-p)/2),b=Vm(g,d,o,u,h,p,U,1,c);if(!c.disableMultiStroke){const v=Vm(g,d,o,u,h,p,U,1.5,c);b.push(...v)}return s&&(l?b.push(...hi(d,o,d+u*Math.cos(p),o+h*Math.sin(p),c),...hi(d,o,d+u*Math.cos(U),o+h*Math.sin(U),c)):b.push({op:"lineTo",data:[d,o]},{op:"lineTo",data:[d+u*Math.cos(p),o+h*Math.sin(p)]})),{type:"path",ops:b}}function Bm(e,t){const n=Ob(Nb(P0(e))),a=[];let i=[0,0],r=[0,0];for(const{key:s,data:l}of n)switch(s){case"M":{r=[l[0],l[1]],i=[l[0],l[1]];break}case"L":a.push(...hi(r[0],r[1],l[0],l[1],t)),r=[l[0],l[1]];break;case"C":{const[c,d,o,u,h,p]=l;a.push(...vC(c,d,o,u,h,p,r,t)),r=[h,p];break}case"Z":a.push(...hi(r[0],r[1],i[0],i[1],t)),r=[i[0],i[1]];break}return{type:"path",ops:a}}function Qf(e,t){const n=[];for(const a of e)if(a.length){const i=t.maxRandomnessOffset||0,r=a.length;if(r>2){n.push({op:"move",data:[a[0][0]+he(i,t),a[0][1]+he(i,t)]});for(let s=1;s<r;s++)n.push({op:"lineTo",data:[a[s][0]+he(i,t),a[s][1]+he(i,t)]})}}return{type:"fillPath",ops:n}}function Es(e,t){return rC(t,dC).fillPolygons(e,t)}function pC(e,t,n,a,i,r,s){const l=e,c=t;let d=Math.abs(n/2),o=Math.abs(a/2);d+=he(d*.01,s),o+=he(o*.01,s);let u=i,h=r;for(;u<0;)u+=Math.PI*2,h+=Math.PI*2;h-u>Math.PI*2&&(u=0,h=Math.PI*2);const p=(h-u)/s.curveStepCount,U=[];for(let m=u;m<=h;m=m+p)U.push([l+d*Math.cos(m),c+o*Math.sin(m)]);return U.push([l+d*Math.cos(h),c+o*Math.sin(h)]),U.push([l,c]),Es([U],s)}function UC(e,t){return he(e,t)}function mC(e,t,n){return Ld(e,t,n)}function gC(e,t,n,a,i){return hi(e,t,n,a,i,!0)}function bC(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Bb(e){return e.randomizer||(e.randomizer=new Db(e.seed||0)),e.randomizer.next()}function Ld(e,t,n,a=1){return n.roughness*a*(Bb(n)*(t-e)+e)}function he(e,t,n=1){return Ld(-e,e,t,n)}function hi(e,t,n,a,i,r=!1){const s=r?i.disableMultiStrokeFill:i.disableMultiStroke,l=Hm(e,t,n,a,i,!0,!1);if(s)return l;const c=Hm(e,t,n,a,i,!0,!0);return l.concat(c)}function Hm(e,t,n,a,i,r,s){const l=Math.pow(e-n,2)+Math.pow(t-a,2),c=Math.sqrt(l);let d=1;c<200?d=1:c>500?d=.4:d=-.0016668*c+1.233334;let o=i.maxRandomnessOffset||0;o*o*100>l&&(o=c/10);const u=o/2,h=.2+Bb(i)*.2;let p=i.bowing*i.maxRandomnessOffset*(a-t)/200,U=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=he(p,i,d),U=he(U,i,d);const m=[],g=()=>he(u,i,d),b=()=>he(o,i,d),v=i.preserveVertices;return s?m.push({op:"move",data:[e+(v?0:g()),t+(v?0:g())]}):m.push({op:"move",data:[e+(v?0:he(o,i,d)),t+(v?0:he(o,i,d))]}),s?m.push({op:"bcurveTo",data:[p+e+(n-e)*h+g(),U+t+(a-t)*h+g(),p+e+2*(n-e)*h+g(),U+t+2*(a-t)*h+g(),n+(v?0:g()),a+(v?0:g())]}):m.push({op:"bcurveTo",data:[p+e+(n-e)*h+b(),U+t+(a-t)*h+b(),p+e+2*(n-e)*h+b(),U+t+2*(a-t)*h+b(),n+(v?0:b()),a+(v?0:b())]}),m}function Xm(e,t,n){const a=[];a.push([e[0][0]+he(t,n),e[0][1]+he(t,n)]),a.push([e[0][0]+he(t,n),e[0][1]+he(t,n)]);for(let i=1;i<e.length;i++)a.push([e[i][0]+he(t,n),e[i][1]+he(t,n)]),i===e.length-1&&a.push([e[i][0]+he(t,n),e[i][1]+he(t,n)]);return Dd(a,null,n)}function Dd(e,t,n){const a=e.length,i=[];if(a>3){const r=[],s=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let l=1;l+2<a;l++){const c=e[l];r[0]=[c[0],c[1]],r[1]=[c[0]+(s*e[l+1][0]-s*e[l-1][0])/6,c[1]+(s*e[l+1][1]-s*e[l-1][1])/6],r[2]=[e[l+1][0]+(s*e[l][0]-s*e[l+2][0])/6,e[l+1][1]+(s*e[l][1]-s*e[l+2][1])/6],r[3]=[e[l+1][0],e[l+1][1]],i.push({op:"bcurveTo",data:[r[1][0],r[1][1],r[2][0],r[2][1],r[3][0],r[3][1]]})}}else a===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):a===2&&i.push(...hi(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function Wm(e,t,n,a,i,r,s,l){const c=l.roughness===0,d=[],o=[];if(c){e=e/4,o.push([t+a*Math.cos(-e),n+i*Math.sin(-e)]);for(let u=0;u<=Math.PI*2;u=u+e){const h=[t+a*Math.cos(u),n+i*Math.sin(u)];d.push(h),o.push(h)}o.push([t+a*Math.cos(0),n+i*Math.sin(0)]),o.push([t+a*Math.cos(e),n+i*Math.sin(e)])}else{const u=he(.5,l)-Math.PI/2;o.push([he(r,l)+t+.9*a*Math.cos(u-e),he(r,l)+n+.9*i*Math.sin(u-e)]);const h=Math.PI*2+u-.01;for(let p=u;p<h;p=p+e){const U=[he(r,l)+t+a*Math.cos(p),he(r,l)+n+i*Math.sin(p)];d.push(U),o.push(U)}o.push([he(r,l)+t+a*Math.cos(u+Math.PI*2+s*.5),he(r,l)+n+i*Math.sin(u+Math.PI*2+s*.5)]),o.push([he(r,l)+t+.98*a*Math.cos(u+s),he(r,l)+n+.98*i*Math.sin(u+s)]),o.push([he(r,l)+t+.9*a*Math.cos(u+s*.5),he(r,l)+n+.9*i*Math.sin(u+s*.5)])}return[o,d]}function Vm(e,t,n,a,i,r,s,l,c){const d=r+he(.1,c),o=[];o.push([he(l,c)+t+.9*a*Math.cos(d-e),he(l,c)+n+.9*i*Math.sin(d-e)]);for(let u=d;u<=s;u=u+e)o.push([he(l,c)+t+a*Math.cos(u),he(l,c)+n+i*Math.sin(u)]);return o.push([t+a*Math.cos(s),n+i*Math.sin(s)]),o.push([t+a*Math.cos(s),n+i*Math.sin(s)]),Dd(o,null,c)}function vC(e,t,n,a,i,r,s,l){const c=[],d=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3];let o=[0,0];const u=l.disableMultiStroke?1:2,h=l.preserveVertices;for(let p=0;p<u;p++)p===0?c.push({op:"move",data:[s[0],s[1]]}):c.push({op:"move",data:[s[0]+(h?0:he(d[0],l)),s[1]+(h?0:he(d[0],l))]}),o=h?[i,r]:[i+he(d[p],l),r+he(d[p],l)],c.push({op:"bcurveTo",data:[e+he(d[p],l),t+he(d[p],l),n+he(d[p],l),a+he(d[p],l),o[0],o[1]]});return c}function wl(e){return[...e]}function xC(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const a=[];if(n===3)a.push(wl(e[0]),wl(e[1]),wl(e[2]),wl(e[2]));else{const i=[];i.push(e[0],e[0]);for(let l=1;l<e.length;l++)i.push(e[l]),l===e.length-1&&i.push(e[l]);const r=[],s=1-t;a.push(wl(i[0]));for(let l=1;l+2<i.length;l++){const c=i[l];r[0]=[c[0],c[1]],r[1]=[c[0]+(s*i[l+1][0]-s*i[l-1][0])/6,c[1]+(s*i[l+1][1]-s*i[l-1][1])/6],r[2]=[i[l+1][0]+(s*i[l][0]-s*i[l+2][0])/6,i[l+1][1]+(s*i[l][1]-s*i[l+2][1])/6],r[3]=[i[l+1][0],i[l+1][1]],a.push(r[1],r[2],r[3])}}return a}function yC(e,t){return Math.sqrt(ad(e,t))}function ad(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function wC(e,t,n){const a=ad(t,n);if(a===0)return ad(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/a;return i=Math.max(0,Math.min(1,i)),ad(e,br(t,n,i))}function br(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function EC(e,t){const n=e[t+0],a=e[t+1],i=e[t+2],r=e[t+3];let s=3*a[0]-2*n[0]-r[0];s*=s;let l=3*a[1]-2*n[1]-r[1];l*=l;let c=3*i[0]-2*r[0]-n[0];c*=c;let d=3*i[1]-2*r[1]-n[1];return d*=d,s<c&&(s=c),l<d&&(l=d),s+l}function c1(e,t,n,a){const i=a||[];if(EC(e,t)<n){const r=e[t+0];i.length?yC(i[i.length-1],r)>1&&i.push(r):i.push(r),i.push(e[t+3])}else{const s=e[t+0],l=e[t+1],c=e[t+2],d=e[t+3],o=br(s,l,.5),u=br(l,c,.5),h=br(c,d,.5),p=br(o,u,.5),U=br(u,h,.5),m=br(p,U,.5);c1([s,o,p,m],0,n,i),c1([m,U,h,d],0,n,i)}return i}function d1(e,t,n,a,i){const r=i||[],s=e[t],l=e[n-1];let c=0,d=1;for(let o=t+1;o<n-1;++o){const u=wC(e[o],s,l);u>c&&(c=u,d=o)}return Math.sqrt(c)>a?(d1(e,t,d+1,a,r),d1(e,d,n,a,r)):(r.length||r.push(s),r.push(l)),r}function SC(e,t=.15,n){const a=[],i=(e.length-1)/3;for(let r=0;r<i;r++){const s=r*3;c1(e,s,t,a)}return n&&n>0?d1(a,0,a.length,n):a}function CC(e,t){return Math.sqrt(id(e,t))}function id(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function kC(e,t,n){const a=id(t,n);if(a===0)return id(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/a;return i=Math.max(0,Math.min(1,i)),id(e,vr(t,n,i))}function vr(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function MC(e,t){const n=e[t+0],a=e[t+1],i=e[t+2],r=e[t+3];let s=3*a[0]-2*n[0]-r[0];s*=s;let l=3*a[1]-2*n[1]-r[1];l*=l;let c=3*i[0]-2*r[0]-n[0];c*=c;let d=3*i[1]-2*r[1]-n[1];return d*=d,s<c&&(s=c),l<d&&(l=d),s+l}function u1(e,t,n,a){const i=a||[];if(MC(e,t)<n){const r=e[t+0];i.length?CC(i[i.length-1],r)>1&&i.push(r):i.push(r),i.push(e[t+3])}else{const s=e[t+0],l=e[t+1],c=e[t+2],d=e[t+3],o=vr(s,l,.5),u=vr(l,c,.5),h=vr(c,d,.5),p=vr(o,u,.5),U=vr(u,h,.5),m=vr(p,U,.5);u1([s,o,p,m],0,n,i),u1([m,U,h,d],0,n,i)}return i}function IC(e,t){return f1(e,0,e.length,t)}function f1(e,t,n,a,i){const r=i||[],s=e[t],l=e[n-1];let c=0,d=1;for(let o=t+1;o<n-1;++o){const u=kC(e[o],s,l);u>c&&(c=u,d=o)}return Math.sqrt(c)>a?(f1(e,t,d+1,a,r),f1(e,d,n,a,r)):(r.length||r.push(s),r.push(l)),r}function TC(e,t=.15,n){const a=[],i=(e.length-1)/3;for(let r=0;r<i;r++){const s=r*3;u1(e,s,t,a)}return a}function _C(e,t,n){const a=P0(e),i=Ob(Nb(a)),r=[];let s=[],l=[0,0],c=[];const d=()=>{c.length>=4&&s.push(...TC(c,t)),c=[]},o=()=>{d(),s.length&&(r.push(s),s=[])};for(const{key:h,data:p}of i)switch(h){case"M":o(),l=[p[0],p[1]],s.push(l);break;case"L":d(),s.push([p[0],p[1]]);break;case"C":if(!c.length){const U=s.length?s[s.length-1]:l;c.push([U[0],U[1]])}c.push([p[0],p[1]]),c.push([p[2],p[3]]),c.push([p[4],p[5]]);break;case"Z":d(),s.push([l[0],l[1]]);break}if(o(),!n)return r;const u=[];for(const h of r){const p=IC(h,n);p.length&&u.push(p)}return u}const Sn="none";class Co{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return sC()}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,a){return{shape:t,sets:n||[],options:a||this.defaultOptions}}line(t,n,a,i,r){const s=this._o(r);return this._d("line",[Fb(t,n,a,i,s)],s)}rectangle(t,n,a,i,r){const s=this._o(r),l=[],c=fC(t,n,a,i,s);if(s.fill){const d=[[t,n],[t+a,n],[t+a,n+i],[t,n+i]];s.fillStyle==="solid"?l.push(Qf([d],s)):l.push(Es([d],s))}return s.stroke!==Sn&&l.push(c),this._d("rectangle",l,s)}ellipse(t,n,a,i,r){const s=this._o(r),l=[],c=zb(a,i,s),d=o1(t,n,s,c);if(s.fill)if(s.fillStyle==="solid"){const o=o1(t,n,s,c).opset;o.type="fillPath",l.push(o)}else l.push(Es([d.estimatedPoints],s));return s.stroke!==Sn&&l.push(d.opset),this._d("ellipse",l,s)}circle(t,n,a,i){const r=this.ellipse(t,n,a,a,i);return r.shape="circle",r}linearPath(t,n){const a=this._o(n);return this._d("linearPath",[nd(t,!1,a)],a)}arc(t,n,a,i,r,s,l=!1,c){const d=this._o(c),o=[],u=zm(t,n,a,i,r,s,l,!0,d);if(l&&d.fill)if(d.fillStyle==="solid"){const h=Object.assign({},d);h.disableMultiStroke=!0;const p=zm(t,n,a,i,r,s,!0,!1,h);p.type="fillPath",o.push(p)}else o.push(pC(t,n,a,i,r,s,d));return d.stroke!==Sn&&o.push(u),this._d("arc",o,d)}curve(t,n){const a=this._o(n),i=[],r=Fm(t,a);if(a.fill&&a.fill!==Sn&&t.length>=3)if(a.fillStyle==="solid"){const s=Fm(t,Object.assign(Object.assign({},a),{disableMultiStroke:!0,roughness:a.roughness?a.roughness+a.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=xC(t),l=SC(s,10,(1+a.roughness)/2);i.push(Es([l],a))}return a.stroke!==Sn&&i.push(r),this._d("curve",i,a)}polygon(t,n){const a=this._o(n),i=[],r=nd(t,!0,a);return a.fill&&(a.fillStyle==="solid"?i.push(Qf([t],a)):i.push(Es([t],a))),a.stroke!==Sn&&i.push(r),this._d("polygon",i,a)}path(t,n){const a=this._o(n),i=[];if(!t)return this._d("path",i,a);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=a.fill&&a.fill!=="transparent"&&a.fill!==Sn,s=a.stroke!==Sn,l=!!(a.simplification&&a.simplification<1),c=l?4-4*(a.simplification||1):(1+a.roughness)/2,d=_C(t,1,c),o=Bm(t,a);if(r)if(a.fillStyle==="solid")if(d.length===1){const u=Bm(t,Object.assign(Object.assign({},a),{disableMultiStroke:!0,roughness:a.roughness?a.roughness+a.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else i.push(Qf(d,a));else i.push(Es(d,a));return s&&(l?d.forEach(u=>{i.push(nd(u,!1,a))}):i.push(o)),this._d("path",i,a)}opsToPath(t,n){let a="";for(const i of t.ops){const r=typeof n=="number"&&n>=0?i.data.map(s=>+s.toFixed(n)):i.data;switch(i.op){case"move":a+=`M${r[0]} ${r[1]} `;break;case"bcurveTo":a+=`C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;break;case"lineTo":a+=`L${r[0]} ${r[1]} `;break}}return a.trim()}toPaths(t){const n=t.sets||[],a=t.options||this.defaultOptions,i=[];for(const r of n){let s=null;switch(r.type){case"path":s={d:this.opsToPath(r),stroke:a.stroke,strokeWidth:a.strokeWidth,fill:Sn};break;case"fillPath":s={d:this.opsToPath(r),stroke:Sn,strokeWidth:0,fill:a.fill||Sn};break;case"fillSketch":s=this.fillSketch(r,a);break}s&&i.push(s)}return i}fillSketch(t,n){let a=n.fillWeight;return a<0&&(a=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||Sn,strokeWidth:a,fill:Sn}}_mergedShape(t){return t.filter((n,a)=>a===0?!0:n.op!=="move")}}class jC{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Co(n)}draw(t){const n=t.sets||[],a=t.options||this.getDefaultOptions(),i=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(const s of n)switch(s.type){case"path":i.save(),i.strokeStyle=a.stroke==="none"?"transparent":a.stroke,i.lineWidth=a.strokeWidth,a.strokeLineDash&&i.setLineDash(a.strokeLineDash),a.strokeLineDashOffset&&(i.lineDashOffset=a.strokeLineDashOffset),this._drawToContext(i,s,r),i.restore();break;case"fillPath":{i.save(),i.fillStyle=a.fill||"";const l=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,r,l),i.restore();break}case"fillSketch":this.fillSketch(i,s,a);break}}fillSketch(t,n,a){let i=a.fillWeight;i<0&&(i=a.strokeWidth/2),t.save(),a.fillLineDash&&t.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(t.lineDashOffset=a.fillLineDashOffset),t.strokeStyle=a.fill||"",t.lineWidth=i,this._drawToContext(t,n,a.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,a,i="nonzero"){t.beginPath();for(const r of n.ops){const s=typeof a=="number"&&a>=0?r.data.map(l=>+l.toFixed(a)):r.data;switch(r.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1]);break}}n.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,a,i,r){const s=this.gen.line(t,n,a,i,r);return this.draw(s),s}rectangle(t,n,a,i,r){const s=this.gen.rectangle(t,n,a,i,r);return this.draw(s),s}ellipse(t,n,a,i,r){const s=this.gen.ellipse(t,n,a,i,r);return this.draw(s),s}circle(t,n,a,i){const r=this.gen.circle(t,n,a,i);return this.draw(r),r}linearPath(t,n){const a=this.gen.linearPath(t,n);return this.draw(a),a}polygon(t,n){const a=this.gen.polygon(t,n);return this.draw(a),a}arc(t,n,a,i,r,s,l=!1,c){const d=this.gen.arc(t,n,a,i,r,s,l,c);return this.draw(d),d}curve(t,n){const a=this.gen.curve(t,n);return this.draw(a),a}path(t,n){const a=this.gen.path(t,n);return this.draw(a),a}}const Mc="http://www.w3.org/2000/svg";class AC{constructor(t,n){this.svg=t,this.gen=new Co(n)}draw(t){const n=t.sets||[],a=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,r=i.createElementNS(Mc,"g"),s=t.options.fixedDecimalPlaceDigits;for(const l of n){let c=null;switch(l.type){case"path":{c=i.createElementNS(Mc,"path"),c.setAttribute("d",this.opsToPath(l,s)),c.setAttribute("stroke",a.stroke),c.setAttribute("stroke-width",a.strokeWidth+""),c.setAttribute("fill","none"),a.strokeLineDash&&c.setAttribute("stroke-dasharray",a.strokeLineDash.join(" ").trim()),a.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${a.strokeLineDashOffset}`);break}case"fillPath":{c=i.createElementNS(Mc,"path"),c.setAttribute("d",this.opsToPath(l,s)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",a.fill||""),(t.shape==="curve"||t.shape==="polygon")&&c.setAttribute("fill-rule","evenodd");break}case"fillSketch":{c=this.fillSketch(i,l,a);break}}c&&r.appendChild(c)}return r}fillSketch(t,n,a){let i=a.fillWeight;i<0&&(i=a.strokeWidth/2);const r=t.createElementNS(Mc,"path");return r.setAttribute("d",this.opsToPath(n,a.fixedDecimalPlaceDigits)),r.setAttribute("stroke",a.fill||""),r.setAttribute("stroke-width",i+""),r.setAttribute("fill","none"),a.fillLineDash&&r.setAttribute("stroke-dasharray",a.fillLineDash.join(" ").trim()),a.fillLineDashOffset&&r.setAttribute("stroke-dashoffset",`${a.fillLineDashOffset}`),r}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,a,i,r){const s=this.gen.line(t,n,a,i,r);return this.draw(s)}rectangle(t,n,a,i,r){const s=this.gen.rectangle(t,n,a,i,r);return this.draw(s)}ellipse(t,n,a,i,r){const s=this.gen.ellipse(t,n,a,i,r);return this.draw(s)}circle(t,n,a,i){const r=this.gen.circle(t,n,a,i);return this.draw(r)}linearPath(t,n){const a=this.gen.linearPath(t,n);return this.draw(a)}polygon(t,n){const a=this.gen.polygon(t,n);return this.draw(a)}arc(t,n,a,i,r,s,l=!1,c){const d=this.gen.arc(t,n,a,i,r,s,l,c);return this.draw(d)}curve(t,n){const a=this.gen.curve(t,n);return this.draw(a)}path(t,n){const a=this.gen.path(t,n);return this.draw(a)}}const lr={canvas(e,t){return new jC(e,t)},svg(e,t){return new AC(e,t)},generator(e){return new Co(e)},newSeed(){return Co.newSeed()}};function Gm(e,t,n,a=i=>i){return e*a(.5-t*(.5-n))}function RC(e){return[-e[0],-e[1]]}function Qn(e,t){return[e[0]+t[0],e[1]+t[1]]}function Rn(e,t){return[e[0]-t[0],e[1]-t[1]]}function qn(e,t){return[e[0]*t,e[1]*t]}function LC(e,t){return[e[0]/t,e[1]/t]}function El(e){return[e[1],-e[0]]}function Ym(e,t){return e[0]*t[0]+e[1]*t[1]}function DC(e,t){return e[0]===t[0]&&e[1]===t[1]}function PC(e){return Math.hypot(e[0],e[1])}function NC(e){return e[0]*e[0]+e[1]*e[1]}function Zm(e,t){return NC(Rn(e,t))}function Hb(e){return LC(e,PC(e))}function OC(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function Sl(e,t,n){let a=Math.sin(n),i=Math.cos(n),r=e[0]-t[0],s=e[1]-t[1],l=r*i-s*a,c=r*a+s*i;return[l+t[0],c+t[1]]}function h1(e,t,n){return Qn(e,qn(Rn(t,e),n))}function Km(e,t,n){return Qn(e,qn(t,n))}var{min:fs,PI:$C}=Math,qm=.275,Cl=$C+1e-4;function FC(e,t={}){let{size:n=16,smoothing:a=.5,thinning:i=.5,simulatePressure:r=!0,easing:s=P=>P,start:l={},end:c={},last:d=!1}=t,{cap:o=!0,easing:u=P=>P*(2-P)}=l,{cap:h=!0,easing:p=P=>--P*P*P+1}=c;if(e.length===0||n<=0)return[];let U=e[e.length-1].runningLength,m=l.taper===!1?0:l.taper===!0?Math.max(n,U):l.taper,g=c.taper===!1?0:c.taper===!0?Math.max(n,U):c.taper,b=Math.pow(n*a,2),v=[],x=[],y=e.slice(0,10).reduce((P,W)=>{let F=W.pressure;if(r){let Y=fs(1,W.distance/n),Q=fs(1,1-Y);F=fs(1,P+(Q-P)*(Y*qm))}return(P+F)/2},e[0].pressure),E=Gm(n,i,e[e.length-1].pressure,s),S,w=e[0].vector,k=e[0].point,T=k,_=k,j=T,A=!1;for(let P=0;P<e.length;P++){let{pressure:W}=e[P],{point:F,vector:Y,distance:Q,runningLength:le}=e[P];if(P<e.length-1&&U-le<3)continue;if(i){if(r){let Ee=fs(1,Q/n),je=fs(1,1-Ee);W=fs(1,y+(je-y)*(Ee*qm))}E=Gm(n,i,W,s)}else E=n/2;S===void 0&&(S=E);let ie=le<m?u(le/m):1,Te=U-le<g?p((U-le)/g):1;E=Math.max(.01,E*Math.min(ie,Te));let _e=(P<e.length-1?e[P+1]:e[P]).vector,Ie=P<e.length-1?Ym(Y,_e):1,oe=Ym(Y,w)<0&&!A,ue=Ie!==null&&Ie<0;if(oe||ue){let Ee=qn(El(w),E);for(let je=1/13,gt=0;gt<=1;gt+=je)_=Sl(Rn(F,Ee),F,Cl*gt),v.push(_),j=Sl(Qn(F,Ee),F,Cl*-gt),x.push(j);k=_,T=j,ue&&(A=!0);continue}if(A=!1,P===e.length-1){let Ee=qn(El(Y),E);v.push(Rn(F,Ee)),x.push(Qn(F,Ee));continue}let Fe=qn(El(h1(_e,Y,Ie)),E);_=Rn(F,Fe),(P<=1||Zm(k,_)>b)&&(v.push(_),k=_),j=Qn(F,Fe),(P<=1||Zm(T,j)>b)&&(x.push(j),T=j),y=W,w=Y}let R=e[0].point.slice(0,2),N=e.length>1?e[e.length-1].point.slice(0,2):Qn(e[0].point,[1,1]),O=[],$=[];if(e.length===1){if(!(m||g)||d){let P=Km(R,Hb(El(Rn(R,N))),-(S||E)),W=[];for(let F=1/13,Y=F;Y<=1;Y+=F)W.push(Sl(P,R,Cl*2*Y));return W}}else{if(!(m||g&&e.length===1))if(o)for(let W=1/13,F=W;F<=1;F+=W){let Y=Sl(x[0],R,Cl*F);O.push(Y)}else{let W=Rn(v[0],x[0]),F=qn(W,.5),Y=qn(W,.51);O.push(Rn(R,F),Rn(R,Y),Qn(R,Y),Qn(R,F))}let P=El(RC(e[e.length-1].vector));if(g||m&&e.length===1)$.push(N);else if(h){let W=Km(N,P,E);for(let F=1/29,Y=F;Y<1;Y+=F)$.push(Sl(W,N,Cl*3*Y))}else $.push(Qn(N,qn(P,E)),Qn(N,qn(P,E*.99)),Rn(N,qn(P,E*.99)),Rn(N,qn(P,E)))}return v.concat($,x.reverse(),O)}function zC(e,t={}){var n;let{streamline:a=.5,size:i=16,last:r=!1}=t;if(e.length===0)return[];let s=.15+(1-a)*.85,l=Array.isArray(e[0])?e:e.map(({x:p,y:U,pressure:m=.5})=>[p,U,m]);if(l.length===2){let p=l[1];l=l.slice(0,-1);for(let U=1;U<5;U++)l.push(h1(l[0],p,U/4))}l.length===1&&(l=[...l,[...Qn(l[0],[1,1]),...l[0].slice(2)]]);let c=[{point:[l[0][0],l[0][1]],pressure:l[0][2]>=0?l[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],d=!1,o=0,u=c[0],h=l.length-1;for(let p=1;p<l.length;p++){let U=r&&p===h?l[p].slice(0,2):h1(u.point,l[p],s);if(DC(u.point,U))continue;let m=OC(U,u.point);if(o+=m,p<h&&!d){if(o<i)continue;d=!0}u={point:U,pressure:l[p][2]>=0?l[p][2]:.5,vector:Hb(Rn(u.point,U)),distance:m,runningLength:o},c.push(u)}return c[0].vector=((n=c[1])==null?void 0:n.vector)||[0,0],c}function BC(e,t={}){return FC(zC(e,t),t)}function Xb(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Xb(e[t]))&&(a&&(a+=" "),a+=n);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function ne(){for(var e=0,t,n,a="";e<arguments.length;)(t=arguments[e++])&&(n=Xb(t))&&(a&&(a+=" "),a+=n);return a}function HC(e,t){return Math.sqrt(rd(e,t))}function rd(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function XC(e,t,n){const a=rd(t,n);if(a===0)return rd(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/a;return i=Math.max(0,Math.min(1,i)),rd(e,xr(t,n,i))}function xr(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function WC(e,t){const n=e[t+0],a=e[t+1],i=e[t+2],r=e[t+3];let s=3*a[0]-2*n[0]-r[0];s*=s;let l=3*a[1]-2*n[1]-r[1];l*=l;let c=3*i[0]-2*r[0]-n[0];c*=c;let d=3*i[1]-2*r[1]-n[1];return d*=d,s<c&&(s=c),l<d&&(l=d),s+l}function p1(e,t,n,a){const i=a||[];if(WC(e,t)<n){const r=e[t+0];i.length?HC(i[i.length-1],r)>1&&i.push(r):i.push(r),i.push(e[t+3])}else{const s=e[t+0],l=e[t+1],c=e[t+2],d=e[t+3],o=xr(s,l,.5),u=xr(l,c,.5),h=xr(c,d,.5),p=xr(o,u,.5),U=xr(u,h,.5),m=xr(p,U,.5);p1([s,o,p,m],0,n,i),p1([m,U,h,d],0,n,i)}return i}function VC(e,t){return Pd(e,0,e.length,t)}function Pd(e,t,n,a,i){const r=i||[],s=e[t],l=e[n-1];let c=0,d=1;for(let o=t+1;o<n-1;++o){const u=XC(e[o],s,l);u>c&&(c=u,d=o)}return Math.sqrt(c)>a?(Pd(e,t,d+1,a,r),Pd(e,d,n,a,r)):(r.length||r.push(s),r.push(l)),r}function GC(e,t=.15,n){const a=[],i=(e.length-1)/3;for(let r=0;r<i;r++){const s=r*3;p1(e,s,t,a)}return Pd(a,0,a.length,n)}var kl={},Jm;function YC(){if(Jm)return kl;Jm=1,Object.defineProperty(kl,"__esModule",{value:!0}),kl.sanitizeUrl=void 0;var e=/^([^\w]*)(javascript|data|vbscript)/im,t=/&#(\w+)(^\w|;)?/g,n=/&(newline|tab);/gi,a=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,i=/^.+(:|:)/gim,r=[".","/"];function s(d){return r.indexOf(d[0])>-1}function l(d){return d.replace(t,function(o,u){return String.fromCharCode(u)})}function c(d){var o=l(d||"").replace(n,"").replace(a,"").trim();if(!o)return"about:blank";if(s(o))return o;var u=o.match(i);if(!u)return o;var h=u[0];return e.test(h)?"about:blank":o}return kl.sanitizeUrl=c,kl}var Wb=YC();const Vb="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function ks(e,t,n){const a=n[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===a||t&&t.slice(-1)===a)throw new Error("trailing zero");if(t){let s=0;for(;(e[s]||a)===t[s];)s++;if(s>0)return t.slice(0,s)+ks(e.slice(s),t.slice(s),n)}const i=e?n.indexOf(e[0]):0,r=t!=null?n.indexOf(t[0]):n.length;if(r-i>1){const s=Math.round(.5*(i+r));return n[s]}else return t&&t.length>1?t.slice(0,1):n[i]+ks(e.slice(1),null,n)}function Gb(e){if(e.length!==Yb(e[0]))throw new Error("invalid integer part of order key: "+e)}function Yb(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function zl(e){const t=Yb(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function Qm(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const n=zl(e);if(e.slice(n.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function e2(e,t){Gb(e);const[n,...a]=e.split("");let i=!0;for(let r=a.length-1;i&&r>=0;r--){const s=t.indexOf(a[r])+1;s===t.length?a[r]=t[0]:(a[r]=t[s],i=!1)}if(i){if(n==="Z")return"a"+t[0];if(n==="z")return null;const r=String.fromCharCode(n.charCodeAt(0)+1);return r>"a"?a.push(t[0]):a.pop(),r+a.join("")}else return n+a.join("")}function ZC(e,t){Gb(e);const[n,...a]=e.split("");let i=!0;for(let r=a.length-1;i&&r>=0;r--){const s=t.indexOf(a[r])-1;s===-1?a[r]=t.slice(-1):(a[r]=t[s],i=!1)}if(i){if(n==="a")return"Z"+t.slice(-1);if(n==="A")return null;const r=String.fromCharCode(n.charCodeAt(0)-1);return r<"Z"?a.push(t.slice(-1)):a.pop(),r+a.join("")}else return n+a.join("")}function hs(e,t,n=Vb){if(e!=null&&Qm(e,n),t!=null&&Qm(t,n),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+n[0];const c=zl(t),d=t.slice(c.length);if(c==="A"+n[0].repeat(26))return c+ks("",d,n);if(c<t)return c;const o=ZC(c,n);if(o==null)throw new Error("cannot decrement any more");return o}if(t==null){const c=zl(e),d=e.slice(c.length),o=e2(c,n);return o??c+ks(d,null,n)}const a=zl(e),i=e.slice(a.length),r=zl(t),s=t.slice(r.length);if(a===r)return a+ks(i,s,n);const l=e2(a,n);if(l==null)throw new Error("cannot increment any more");return l<t?l:a+ks(i,null,n)}function U1(e,t,n,a=Vb){if(n===0)return[];if(n===1)return[hs(e,t,a)];if(t==null){let s=hs(e,t,a);const l=[s];for(let c=0;c<n-1;c++)s=hs(s,t,a),l.push(s);return l}if(e==null){let s=hs(e,t,a);const l=[s];for(let c=0;c<n-1;c++)s=hs(e,s,a),l.push(s);return l.reverse(),l}const i=Math.floor(n/2),r=hs(e,t,a);return[...U1(e,r,i,a),r,...U1(r,t,n-i-1,a)]}const is=(()=>{if(typeof self>"u")return!1;if(!("top"in self&&self!==top)){if("showOpenFilePicker"in self)return"showOpenFilePicker"}return!1})(),KC=is?Promise.resolve().then(()=>require("./layers.D0zn4_Mx.js")):Promise.resolve().then(()=>require("./layers.BSTBZrFn.js"));async function qC(...e){return(await KC).default(...e)}is?Promise.resolve().then(()=>require("./layers.B3D4g2HH.js")):Promise.resolve().then(()=>require("./layers.BAtv1CM7.js"));const JC=is?Promise.resolve().then(()=>require("./layers.DbaKVP5e.js")):Promise.resolve().then(()=>require("./layers.52famHy6.js"));async function QC(...e){return(await JC).default(...e)}var ek=(e,t)=>t.reduce((n,a)=>(a in e&&(n[a]=e[a]),n),{}),tk=5,Ss=5,nk=4,Bl=4,Hl=1,Yn=[0,2,4,6,8],Zn=(e,t)=>t.map(n=>Ft[e][n]),we={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:Zn("gray",Yn),red:Zn("red",Yn),pink:Zn("pink",Yn),grape:Zn("grape",Yn),violet:Zn("violet",Yn),blue:Zn("blue",Yn),cyan:Zn("cyan",Yn),teal:Zn("teal",Yn),green:Zn("green",Yn),yellow:Zn("yellow",Yn),orange:Zn("orange",Yn),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},Zb=ek(we,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Kb=[we.black,we.red[Bl],we.green[Bl],we.blue[Bl],we.yellow[Bl]],qb=[we.transparent,we.red[Hl],we.green[Hl],we.blue[Hl],we.yellow[Hl]],Jb=[we.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],ak={transparent:we.transparent,white:we.white,gray:we.gray,black:we.black,bronze:we.bronze,...Zb},ik={transparent:we.transparent,white:we.white,gray:we.gray,black:we.black,bronze:we.bronze,...Zb},rk=e=>[we.cyan[e],we.blue[e],we.violet[e],we.grape[e],we.pink[e],we.green[e],we.teal[e],we.yellow[e],we.orange[e],we.red[e]],sk=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`,Fa=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Qb=/^Win/.test(navigator.platform),lk=/\b(android)\b/i.test(navigator.userAgent),ko="netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,ok=navigator.userAgent.indexOf("Chrome")!==-1,ck=!ok&&navigator.userAgent.indexOf("Safari")!==-1,e8=/iPad|iPhone/.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,dk=()=>{var e,t;return((t=(e=navigator.brave)==null?void 0:e.isBrave)==null?void 0:t.name)==="isBrave"},m1=typeof window<"u"&&"ResizeObserver"in window,g1="Excalidraw",uk=36,yr=10,sd=8,fk=5,t2=1,hk=30,Ji=Math.PI/12,t8="red",He={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},Li={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},ps={enabled:"all",disabled:"none"},Ic={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},vn={TEST:"test"},Ws={SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper"},Ms="Xiaolai",Mo="Segoe UI Emoji",it={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9},Is={[Ms]:100,[Mo]:1e3},n8=e=>{switch(e){case it.Excalifont:return[Ms,Mo];default:return[Mo]}},ke={LIGHT:"light",DARK:"dark"},ot={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},N0=1,Ci=20,or=it.Excalifont,Jo="left",Nd="top",Xr=2,Od=2*Xr,pk=1e-5,Uk=2*Od-pk,Tc="#ffffff",mk="#1e1e1e",gk="#a2f1a6",$d=20,a8=5,Vs={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},ae={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json","excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...Vs},bk=[ae.text,ae.html,...Object.values(Vs)],eh={png:"png",svg:"svg",clipboard:"clipboard"},Fn={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},O0=window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,vk=500,xk=300,yk=500,wk=100,Pu=.1,$0=.1,F0=30,Ek=300,z0="invert(93%) hue-rotate(180deg)",b1={addLibrary:"addLibrary"},v1={addLibrary:"addLibrary"},n2={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0}},Sk=730,Ck=1e3,kk=500,Mk=1229,Ml=2,B0=[1,2,3],dl=10,Ik=1440,a2=4*1024*1024,Le="http://www.w3.org/2000/svg",Nu={excalidraw:2,excalidrawLibrary:2},Mt=5,Tk=.7,_k=11,Mn={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},Io={LEFT:"left",CENTER:"center",RIGHT:"right"},jk=20,th=.25,Ak=32,St={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},i8={artist:1,cartoonist:2},nh={thin:1,bold:2,extraBold:4},ft={strokeColor:we.black,backgroundColor:we.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:i8.artist,opacity:100,locked:!1},Fd="library",Ns="search",oa={name:"default",defaultTab:Fd},r8=new Set(["iframe","embeddable","image"]),Rt={selection:"selection",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",text:"text",image:"image",eraser:"eraser",frame:"frame",magicframe:"magicframe",laser:"laser"},no={MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},s8="Untitled",Ts={generalStats:1,elementProperties:2},Ln=1,Ot={sharp:"sharp",round:"round",elbow:"elbow"},l8=.3,zd="element",Rk=Symbol.for("__test__originalId__"),o8=(e=>(e.ACTIVE="active",e.AWAY="away",e.IDLE="idle",e))(o8||{}),Lk=B0.includes(devicePixelRatio)?devicePixelRatio:1,za=()=>({showWelcomeScreen:!1,theme:ke.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:ft.backgroundColor,currentItemEndArrowhead:"arrow",currentItemFillStyle:ft.fillStyle,currentItemFontFamily:or,currentItemFontSize:Ci,currentItemOpacity:ft.opacity,currentItemRoughness:ft.roughness,currentItemStartArrowhead:null,currentItemStrokeColor:ft.strokeColor,currentItemRoundness:"round",currentItemArrowType:Ot.round,currentItemStrokeStyle:ft.strokeStyle,currentItemStrokeWidth:ft.strokeWidth,currentItemTextAlign:Jo,currentHoveredFontFamily:null,cursorButton:"up",activeEmbeddable:null,newElement:null,editingTextElement:null,editingGroupId:null,editingLinearElement:null,activeTool:{type:"selection",customType:null,locked:ft.locked,lastActiveTool:null},penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:Lk,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:$d,gridStep:a8,gridModeEnabled:!1,isBindingEnabled:!0,defaultSidebarDockedPreference:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:null,contextMenu:null,openMenu:null,openPopup:null,openSidebar:null,openDialog:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},hoveredElementIds:{},selectedGroupIds:{},selectedElementsAreBeingDragged:!1,selectionElement:null,shouldCacheIgnoreZoom:!1,stats:{open:!1,panels:Ts.generalStats|Ts.elementProperties},startBoundElement:null,suggestedBindings:[],frameRendering:{enabled:!0,clip:!0,name:!0,outline:!0},frameToHighlight:null,editingFrame:null,elementsToHighlight:null,toast:null,viewBackgroundColor:we.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElementId:null,showHyperlinkPopup:!1,selectedLinearElement:null,snapLines:[],originSnapOffset:{x:0,y:0},objectsSnapModeEnabled:!1,userToFollow:null,followedBy:new Set,isCropping:!1,croppingElementId:null,searchMatches:[]}),Dk=(e=>e)({showWelcomeScreen:{browser:!0,export:!1,server:!1},theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemRoundness:{browser:!0,export:!1,server:!1},currentItemArrowType:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},currentHoveredFontFamily:{browser:!1,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},activeEmbeddable:{browser:!1,export:!1,server:!1},newElement:{browser:!1,export:!1,server:!1},editingTextElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},activeTool:{browser:!0,export:!1,server:!1},penMode:{browser:!0,export:!1,server:!1},penDetected:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},gridStep:{browser:!0,export:!0,server:!0},gridModeEnabled:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},defaultSidebarDockedPreference:{browser:!0,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},contextMenu:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},openSidebar:{browser:!0,export:!1,server:!1},openDialog:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},hoveredElementIds:{browser:!1,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectedElementsAreBeingDragged:{browser:!1,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},stats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},frameRendering:{browser:!1,export:!1,server:!1},frameToHighlight:{browser:!1,export:!1,server:!1},editingFrame:{browser:!1,export:!1,server:!1},elementsToHighlight:{browser:!1,export:!1,server:!1},toast:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElementId:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1},selectedLinearElement:{browser:!0,export:!1,server:!1},snapLines:{browser:!1,export:!1,server:!1},originSnapOffset:{browser:!1,export:!1,server:!1},objectsSnapModeEnabled:{browser:!0,export:!1,server:!1},userToFollow:{browser:!1,export:!1,server:!1},followedBy:{browser:!1,export:!1,server:!1},isCropping:{browser:!1,export:!1,server:!1},croppingElementId:{browser:!1,export:!1,server:!1},searchMatches:{browser:!1,export:!1,server:!1}}),c8=(e,t)=>{var a;let n={};for(let i of Object.keys(e))if((a=Dk[i])!=null&&a[t]){let r=e[i];n[i]=r}return n},d8=e=>c8(e,"export"),Pk=e=>c8(e,"server"),Ia=({activeTool:e})=>e.type==="eraser",Gs=({activeTool:e})=>e.type==="hand",Se=(e,t,n)=>Math.min(Math.max(e,t),n),Oa=(e,t,n="round")=>{let a=Math.pow(10,t);return Math[n]((e+Number.EPSILON)*a)/a},Nk=(e,t,n="round")=>{let a=1/t;return Math[n](e*a)/a},_c=(e,t)=>(e+t)/2,ao=e=>typeof e=="number"&&Number.isFinite(e),i2=(e,t,n=1e-4)=>Math.abs(e-t)<n,Bd=e=>e<0?e+2*Math.PI:e>=2*Math.PI?e-2*Math.PI:e;function Rr(e){return e*Math.PI/180}function Qo(e){return e*180/Math.PI}function Ok(e){return Math.abs(Math.sin(2*e))<1e-4}function Ht(e,t,n=0,a=0){return[e-n,t-a]}function re(e,t=[0,0]){return Ht(e[0]-t[0],e[1]-t[1])}function At(e,t){return e[0]*t[1]-t[0]*e[1]}function r2(e,t){return e[0]*t[0]+e[1]*t[1]}function Hi(e,t){return[e[0]+t[0],e[1]+t[1]]}function Hd(e,t){return[e[0]-t[0],e[1]-t[1]]}function pt(e,t){return Ht(e[0]*t,e[1]*t)}function $k(e){return e[0]*e[0]+e[1]*e[1]}function Fk(e){return Math.sqrt($k(e))}var en=e=>{let t=Fk(e);return t===0?Ht(0,0):Ht(e[0]/t,e[1]/t)};function C(e,t){return[e,t]}function H0(e){return e.length===2?C(e[0],e[1]):void 0}function Ce(e,t=C(0,0)){return C(t[0]+e[0],t[1]+e[1])}function zk(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&!isNaN(e[0])&&typeof e[1]=="number"&&!isNaN(e[1])}function fa(e,t){let n=Math.abs;return n(e[0]-t[0])<1e-4&&n(e[1]-t[1])<1e-4}function H([e,t],[n,a],i){return C((e-n)*Math.cos(i)-(t-a)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-a)*Math.cos(i)+a)}function Xd(e,t=[0,0]){return C(e[0]+t[0],e[1]+t[1])}function ec(e,t){return C((e[0]+t[0])/2,(e[1]+t[1])/2)}function Oe(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function To(e,t){let n=t[0]-e[0],a=t[1]-e[1];return n*n+a*a}var ti=(e,t,n)=>Xd(t,pt(re(e,t),n)),u8=(e,t,n)=>t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1]);function x1(e,t){return[e,t]}function Bk(e,t){let n=e[1][1]-e[0][1],a=e[0][0]-e[1][0],i=t[1][1]-t[0][1],r=t[0][0]-t[1][0],s=n*r-i*a;if(s!==0){let l=n*e[0][0]+a*e[0][1],c=i*t[0][0]+r*t[0][1];return C((l*r-c*a)/s,(n*c-i*l)/s)}return null}function se(e,t){return[e,t]}var Wr=(e,t,n=1e-4)=>{let a=X0(e,t);return a===0?!0:a<n},X0=(e,t)=>{let[n,a]=e,[[i,r],[s,l]]=t,c=n-i,d=a-r,o=s-i,u=l-r,h=c*o+d*u,p=o*o+u*u,U=-1;p!==0&&(U=h/p);let m,g;U<0?(m=i,g=r):U>1?(m=s,g=l):(m=i+U*o,g=r+U*u);let b=n-m,v=a-g;return Math.sqrt(b*b+v*v)};function _o(e,t){let n=Bk(x1(e[0],e[1]),x1(t[0],t[1]));return!n||!Wr(n,t)||!Wr(n,e)?null:n}function y1(e,t){return[e,t]}function Hk(e,t){return[se(e[0],C(e[1][0],e[0][1])),se(C(e[1][0],e[0][1]),e[1]),se(e[1],C(e[0][0],e[1][1])),se(C(e[0][0],e[1][1]),e[0])].map(n=>_o(t,n)).filter(n=>!!n)}function oi(e,t,n,a){return[e,t,n,a]}function s2(e,t,n,a=1e-6){return[(e(t+a,n)-e(t-a,n))/(2*a),(e(t,n+a)-e(t,n-a))/(2*a)]}function Xk(e,t,n,a=.001,i=10){let r=1/0,s=0;for(;r>=a;){if(s>=i)return null;let l=e(t,n),c=[s2((m,g)=>e(m,g)[0],t,n),s2((m,g)=>e(m,g)[1],t,n)],d=[[-l[0]],[-l[1]]],o=c[0][0]*c[1][1]-c[0][1]*c[1][0];if(o===0)return null;let u=[[c[1][1]/o,-c[0][1]/o],[-c[1][0]/o,c[0][0]/o]],h=[[u[0][0]*d[0][0]+u[0][1]*d[1][0]],[u[1][0]*d[0][0]+u[1][1]*d[1][0]]];t=t+h[0][0],n=n+h[1][0];let[p,U]=e(t,n);r=Math.max(Math.abs(p),Math.abs(U)),s+=1}return[t,n]}var io=(e,t)=>C((1-t)**3*e[0][0]+3*(1-t)**2*t*e[1][0]+3*(1-t)*t**2*e[2][0]+t**3*e[3][0],(1-t)**3*e[0][1]+3*(1-t)**2*t*e[1][1]+3*(1-t)*t**2*e[2][1]+t**3*e[3][1]);function f8(e,t){let n=Vk(e);if(Hk(y1(C(n[0],n[1]),C(n[2],n[3])),t).length===0)return[];let a=l=>C(t[0][0]+l*(t[1][0]-t[0][0]),t[0][1]+l*(t[1][1]-t[0][1])),i=[[.5,0],[.2,0],[.8,0]],r=([l,c])=>{let d=Xk((h,p)=>{let U=io(e,h),m=a(p);return[U[0]-m[0],U[1]-m[1]]},l,c);if(!d)return null;let[o,u]=d;return o<0||o>1||u<0||u>1?null:io(e,o)},s=r(i[0]);return s?[s]:(s=r(i[1]),s?[s]:(s=r(i[2]),s?[s]:[]))}function Wk(e,t,n=.001){let a=(c,d,o,u=n)=>{let h=c,p=d,U;for(;p-h>u;)U=(p+h)/2,o(U-u)<o(U+u)?p=U:h=U;return U},i=0;for(let c=1/0,d=0;d<30;d++){let o=Oe(t,io(e,d/30));o<c&&(c=o,i=d)}let r=Math.max((i-1)/30,0),s=Math.min((i+1)/30,1),l=a(r,s,c=>Oe(t,io(e,c)));return l?io(e,l):null}function h8(e,t){let n=Wk(e,t);return n?Oe(t,n):0}function Vk(e){let[t,n,a,i]=e,r=[t[0],n[0],a[0],i[0]],s=[t[1],n[1],a[1],i[1]];return[Math.min(...r),Math.min(...s),Math.max(...r),Math.max(...s)]}function l2(...e){return p8(e)}function Wd(e){return p8(e)}var o2=(e,t)=>{let n=e[0],a=e[1],i=!1;for(let r=0,s=t.length-1;r<t.length;s=r++){let l=t[r][0],c=t[r][1],d=t[s][0],o=t[s][1];(c>a&&o<=a||c<=a&&o>a)&&n<(d-l)*(a-c)/(o-c)+l&&(i=!i)}return i},Gk=(e,t,n=1e-4)=>{let a=!1;for(let i=0,r=t.length-1;i<r;i++)if(Wr(e,se(t[i],t[i+1]),n)){a=!0;break}return a};function p8(e){return Yk(e)?e:[...e,e[0]]}function Yk(e){return fa(e[0],e[e.length-1])}function Kt(e,t){return Hn([e,t])}var Vd=([e,t],[n,a])=>e<=n?t>=n:e>=n?a>=e:!1,Gd=([e,t],[n,a])=>{let i=Math.max(e,n),r=Math.min(t,a);return i<=r?Hn([i,r]):null},jc=(e,[t,n])=>e>=t&&e<=n;function Us([e,t,n],a){let i=(o,u,h)=>(o[0]-h[0])*(u[1]-h[1])-(u[0]-h[0])*(o[1]-h[1]),r=i(a,e,t),s=i(a,t,n),l=i(a,n,e),c=r<0||s<0||l<0,d=r>0||s>0||l>0;return!(c&&d)}var c2=()=>{let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),a=`${e.getDate()}`.padStart(2,"0"),i=`${e.getHours()}`.padStart(2,"0"),r=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${a}-${i}${r}`},ro=e=>e.charAt(0).toUpperCase()+e.slice(1),Zk=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),w1=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Kk=e=>w1(e)||e instanceof Element&&!!e.closest("label, button"),Er=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"),Ys=({fontFamily:e})=>{for(let[t,n]of Object.entries(it))if(n===e)return`${t}${n8(n).map(a=>`, ${a}`).join("")}`;return Mo},Ve=({fontSize:e,fontFamily:t})=>`${e}px ${Ys({fontFamily:t})}`,Zs=(e,t)=>{let n=0,a=null,i=(...r)=>{a=r,clearTimeout(n),n=window.setTimeout(()=>{a=null,e(...r)},t)};return i.flush=()=>{if(clearTimeout(n),a){let r=a;a=null,e(...r)}},i.cancel=()=>{a=null,clearTimeout(n)},i},Ou=(e,t)=>{let n=null,a=null,i=null,r=l=>{n=window.requestAnimationFrame(()=>{n=null,e(...l),a=null,i&&(a=i,i=null,r(a))})},s=(...l)=>{if(be.MODE==="test"){e(...l);return}a=l,n===null?r(a):t!=null&&t.trailing&&(i=l)};return s.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),a&&(e(...i||a),a=i=null)},s.cancel=()=>{a=i=null,n!==null&&(cancelAnimationFrame(n),n=null)},s},Lr=e=>1-Math.pow(1-e,4),d2=(e,t,n)=>(t-e)*Lr(n)+e,qk=({fromValues:e,toValues:t,onStep:n,duration:a=250,interpolateValue:i,onStart:r,onEnd:s,onCancel:l})=>{let c=!1,d=0,o;function u(h){if(c)return;o===void 0&&(o=h,r==null||r());let p=Math.min(h-o,a),U=Lr(p/a),m={};if(Object.keys(e).forEach(g=>{let b=g,v=(t[b]-e[b])*U+e[b];m[b]=v}),n(m),p<a){let g=p/a,b={};Object.keys(e).forEach(v=>{let x=v,y=e[x],E=t[x],S;S=i?i(y,E,g,x):d2(y,E,g),S==null&&(S=d2(y,E,g)),b[x]=S}),n(b),d=window.requestAnimationFrame(u)}else n(t),s==null||s()}return d=window.requestAnimationFrame(u),()=>{l==null||l(),c=!0,window.cancelAnimationFrame(d)}},Jk=(e,t)=>{if(!e.length||t<1)return[];let n=0,a=0,i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[a++]=e.slice(n,n+=t);return i},qt=(e,t)=>Math.abs(e-t),Et=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked},V=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter"),Fa?e.replace(/\bCtrlOrCmd\b/gi,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/gi,"Ctrl")),Ze=({clientX:e,clientY:t},{zoom:n,offsetLeft:a,offsetTop:i,scrollX:r,scrollY:s})=>{let l=(e-a)/n.value-r,c=(t-i)/n.value-s;return{x:l,y:c}},Nn=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:a,offsetTop:i,scrollX:r,scrollY:s})=>{let l=(e+r)*n.value+a,c=(t+s)*n.value+i;return{x:l,y:c}},Ac=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),Qk="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--",eM="֑-߿יִ-﷽ﹰ-ﻼ",tM=new RegExp(`^[^${Qk}]*[${eM}]`),U8=e=>tM.test(e),aa=e=>{let[t,n]=e;return{x:t,y:n}},m8=e=>{if((e==null?void 0:e.name)==="AbortError"){console.warn(e);return}throw e},g8=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let a=n-1;for(;++a<e.length;)if(t(e[a],a,e))return a;return-1},Sr=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let a=n+1;for(;--a>-1;)if(t(e[a],a,e))return a;return-1},ia=e=>{let t=e.length===5&&e.substr(4,1)==="0",n=e.length===9&&e.substr(7,2)==="00";return t||n||e===we.transparent},ah=e=>e.fillStyle!=="solid"||ia(e.backgroundColor),b8=()=>{let e,t,n=new Promise((a,i)=>{e=a,t=i});return n.resolve=e,n.reject=t,n},nM=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},aM=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},iM=e=>{e.preventDefault(),e.returnValue=""},rM=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),ul=()=>pi()?1:Date.now(),ce=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),sM=e=>e.reduce((t,n,a)=>(t.set(n.id,[n,a]),t),new Map),Qa=(e,t)=>e.reduce((n,a)=>(n[t?t(a):String(a)]=a,n),{}),lM=e=>e.reduce((t,n,a)=>{let i={...n,prev:null,next:null};if(a!==0){let r=t[a-1];if(i.prev=r,r.next=i,a===e.length-1){let s=t[0];i.next=s,s.prev=i}}return t.push(i),t},[]),pi=()=>be.MODE==="test",v8=()=>be.MODE==="development",oM=()=>typeof process<"u"&&!0,x8=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),ld=(e,t)=>{let n=!1;for(let a in t){let i=t[a];if(typeof i<"u"){if(e[a]===i&&(typeof i!="object"||i===null))continue;n=!0}}return n?{...e,...t}:e},cM=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},tc=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,E1=e=>{let t=e==null?void 0:e.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},u2=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,Vt=(e,t,n,a=!1)=>{let i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return a&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let s of n)if(!(e[s]===t[s]||u2(e[s],t[s])))return a&&console.warn(`%cisShallowEqual: ${s} not equal ->`,"color: #8B4000",e[s],t[s]),!1;return!0}return i.every(s=>{let l=n==null?void 0:n[s],c=l?l(e[s],t[s]):e[s]===t[s]||u2(e[s],t[s]);return!c&&a&&console.warn(`%cisShallowEqual: ${s} not equal ->`,"color: #8B4000",e[s],t[s]),c})},$u=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(a){if(e==null||e(a),!n||!(a!=null&&a.defaultPrevented))return t==null?void 0:t(a)},Vr=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function nn(e,t){if(!e)throw new Error(t)}var dM=e=>{let t,n,a=function(i){let r=Object.entries(i);if(t){let l=!0;for(let[c,d]of r)if(t.get(c)!==d){l=!1;break}if(l)return n}let s=e(i);return t=new Map(r),n=s,s};return a.clear=()=>{t=void 0,n=void 0},a},y8=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),ui=e=>JSON.parse(JSON.stringify(e)),Il=(e,t)=>Vt(e,t)?e:t;function st(e,t,n,a){var i;return e?((i=e==null?void 0:e.addEventListener)==null||i.call(e,t,n,a),()=>{var r;(r=e==null?void 0:e.removeEventListener)==null||r.call(e,t,n,a)}):()=>{}}function uM(e,t=!0){let n=e.length;if(n<4)return"";let a=e[0],i=e[1],r=e[2],s=`M${a[0].toFixed(2)},${a[1].toFixed(2)} Q${i[0].toFixed(2)},${i[1].toFixed(2)} ${_c(i[0],r[0]).toFixed(2)},${_c(i[1],r[1]).toFixed(2)} T`;for(let l=2,c=n-1;l<c;l++)a=e[l],i=e[l+1],s+=`${_c(a[0],i[0]).toFixed(2)},${_c(a[1],i[1]).toFixed(2)} `;return t&&(s+="Z"),s}var w8=e=>e.replace(/\r?\n|\r/g,`
|
|
8
|
+
`),Hn=e=>e,Qi=async(e,...t)=>new Promise(n=>{n(e(...t))}),fM=(...e)=>Math.max(...e.map(t=>t?1:0))>0,f2=class{constructor(e,t){L(this,"pool"),L(this,"entries",{}),this.pool=new ZS(e,t)}all(){let e=t=>{if(t.data.result){let[n,a]=t.data.result;this.entries[n]=a}};return this.pool.addEventListener("fulfilled",e),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",e)}),Object.values(this.entries)))}},od=e=>e.replace(/"/g,"""),h2=e=>Array.isArray(e)?e:[e],Dn=e=>!!e&&e.type==="image"&&!!e.fileId,Ne=e=>!!e&&e.type==="image",Un=e=>!!e&&e.type==="embeddable",Oi=e=>!!e&&e.type==="iframe",Pn=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),q=e=>e!=null&&e.type==="text",E8=e=>e!=null&&e.type==="frame",cd=e=>e!=null&&e.type==="magicframe",de=e=>e!=null&&(e.type==="frame"||e.type==="magicframe"),Xn=e=>e!=null&&hM(e.type),hM=e=>e==="freedraw",fe=e=>e!=null&&W0(e.type),xe=e=>e!=null&&e.type==="arrow",ee=e=>xe(e)&&e.elbowed,W0=e=>e==="arrow"||e==="line",La=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&S8(e.type),S8=e=>e==="arrow",ha=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),pM=e=>e!=null&&(e.type==="rectangle"||e.type==="diamond"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),Dr=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||xe(e)),C8=e=>{let t=e==null?void 0:e.type;if(!t)return!1;switch(t){case"text":case"diamond":case"rectangle":case"iframe":case"embeddable":case"ellipse":case"arrow":case"freedraw":case"line":case"frame":case"magicframe":case"image":case"selection":return!0;default:return Vr(t,null),!1}},Fu=e=>e.type==="rectangle"||e.type==="ellipse"||e.type==="diamond",Wn=e=>{var t;return Dr(e)&&!!((t=e.boundElements)!=null&&t.some(({type:n})=>n==="text"))},at=e=>e!==null&&"containerId"in e&&e.containerId!==null&&q(e),fl=e=>e==="rectangle"||e==="embeddable"||e==="iframe"||e==="image",k8=e=>e==="line"||e==="arrow"||e==="diamond",UM=(e,t)=>!!((e===St.ADAPTIVE_RADIUS||e===St.LEGACY)&&fl(t.type)||e===St.PROPORTIONAL_RADIUS&&k8(t.type)),mM=e=>k8(e.type)?{type:St.PROPORTIONAL_RADIUS}:fl(e.type)?{type:St.ADAPTIVE_RADIUS}:null,Yd=e=>Object.hasOwn(e,"fixedPoint")&&e.fixedPoint!=null,an=(e,t,n)=>{let a=e.split(`
|
|
9
|
+
`).map(s=>s||" ").join(`
|
|
10
|
+
`),i=parseFloat(t),r=yM(a,i,n);return{width:Y0(a,t),height:r}},M8="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),I8=(e,t)=>{let n=wM(e);return n===0?an(M8.split("").join(`
|
|
11
|
+
`),e,t).width+Mt*2:n+Mt*2},V0=(e,t)=>an("",e,t).width+Mt*2,gM=()=>Y0(M8,Ve({fontSize:Ci,fontFamily:or}))>0,Ks=e=>w8(e).replace(/\t/g," "),G0=e=>Ks(e).split(`
|
|
12
|
+
`),bM=e=>{let t=G0(e.text).length;return e.height/t/e.fontSize},nc=(e,t)=>e*t,T8=(e,t)=>nc(e,t)+Mt*2,dd,vM=e=>{dd=e},xM=class{constructor(){L(this,"canvas"),this.canvas=document.createElement("canvas")}getLineWidth(e,t){let n=this.canvas.getContext("2d");n.font=t;let a=n.measureText(e).width;return pi()?a*10:a}},Gr=(e,t)=>(dd||(dd=new xM),dd.getLineWidth(e,t)),Y0=(e,t)=>{let n=G0(e),a=0;return n.forEach(i=>{a=Math.max(a,Gr(i,t))}),a},yM=(e,t,n)=>{let a=G0(e).length;return nc(t,n)*a},ac=(()=>{let e={};return{calculate:(t,n)=>{let a=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][a]){let i=Gr(t,n);e[n][a]=i}return e[n][a]},getCache:t=>e[t],clearCache:t=>{e[t]=[]}}})(),wM=e=>{let t=ac.getCache(e);if(!t)return 0;let n=t.filter(a=>a!==void 0);return Math.max(...n)},ih,Rc,rh,EM=e=>(ih||(ih=Be.class(...Object.values(ni))),ih.test(e)),SM=()=>{if(!Rc)try{Rc=kM()}catch{Rc=CM()}return Rc},Z0=()=>(rh||(rh=MM()),rh),jn={WHITESPACE:/\s/u,HYPHEN:/-/u,OPENING:/<\(\[\{/u,CLOSING:/>\)\]\}.,:;!\?…\//u},ni={CHAR:new RegExp("\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}`'^〃〰〆#&*+-ー/\=|¦〒¬ ̄","u"),OPENING:/([{〈《⦅「「『【〖〔〘〚<〝/u,CLOSING:/)]}〉》⦆」」』】〗〕〙〛>。.,、〟‥?!:;・〜〞/u,CURRENCY:/¥₩£¢$/u},pr={FLAG:new RegExp("\\p{RI}\\p{RI}","u"),JOINER:new RegExp("(?:\\p{Emoji_Modifier}|\\uFE0F\\u20E3?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?","u"),ZWJ:/\u200D/u,ANY:/[\p{Emoji}]/u,MOST:/[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u},CM=()=>Be.or(Z0(),yt.On(jn.HYPHEN,jn.WHITESPACE,ni.CHAR)),kM=()=>Be.or(Z0(),yt.Before(jn.WHITESPACE).Build(),yt.After(jn.WHITESPACE,jn.HYPHEN).Build(),yt.Before(ni.CHAR,ni.CURRENCY).NotPrecededBy(jn.OPENING,ni.OPENING).Build(),yt.After(ni.CHAR).NotFollowedBy(jn.HYPHEN,jn.CLOSING,ni.CLOSING).Build(),yt.BeforeMany(ni.OPENING).NotPrecededBy(jn.OPENING).Build(),yt.AfterMany(ni.CLOSING).NotFollowedBy(jn.CLOSING).Build(),yt.AfterMany(jn.CLOSING).FollowedBy(jn.OPENING).Build()),MM=()=>Be.group(Be.or(pr.FLAG,Be.and(pr.MOST,pr.JOINER,Be.build(`(?:${pr.ZWJ.source}(?:${pr.FLAG.source}|${pr.ANY.source}${pr.JOINER.source}))*`)))),Be={build:e=>new RegExp(e,"u"),join:(...e)=>e.map(t=>t.source).join(""),and:(...e)=>Be.build(Be.join(...e)),or:(...e)=>Be.build(e.map(t=>t.source).join("|")),group:(...e)=>Be.build(`(${Be.join(...e)})`),class:(...e)=>Be.build(`[${Be.join(...e)}]`)},yt={On:(...e)=>{let t=Be.join(...e);return Be.build(`([${t}])`)},Before:(...e)=>{let t=Be.join(...e),n=()=>Be.build(`(?=[${t}])`);return yt.Chain(n)},After:(...e)=>{let t=Be.join(...e),n=()=>Be.build(`(?<=[${t}])`);return yt.Chain(n)},BeforeMany:(...e)=>{let t=Be.join(...e),n=()=>Be.build(`(?<![${t}])(?=[${t}])`);return yt.Chain(n)},AfterMany:(...e)=>{let t=Be.join(...e),n=()=>Be.build(`(?<=[${t}])(?![${t}])`);return yt.Chain(n)},NotBefore:(...e)=>{let t=Be.join(...e),n=()=>Be.build(`(?![${t}])`);return yt.Chain(n)},NotAfter:(...e)=>{let t=Be.join(...e),n=()=>Be.build(`(?<![${t}])`);return yt.Chain(n)},Chain:e=>({Build:e,PreceededBy:(...t)=>{let n=e(),a=yt.After(...t).Build(),i=()=>Be.and(a,n);return yt.Chain(i)},FollowedBy:(...t)=>{let n=e(),a=yt.Before(...t).Build(),i=()=>Be.and(n,a);return yt.Chain(i)},NotPrecededBy:(...t)=>{let n=e(),a=yt.NotAfter(...t).Build(),i=()=>Be.and(a,n);return yt.Chain(i)},NotFollowedBy:(...t)=>{let n=e(),a=yt.NotBefore(...t).Build(),i=()=>Be.and(n,a);return yt.Chain(i)}})},IM=e=>{let t=SM();return e.normalize("NFC").split(t).filter(Boolean)},rs=(e,t,n)=>{if(!Number.isFinite(n)||n<0)return e;let a=[],i=e.split(`
|
|
13
|
+
`);for(let r of i){if(Gr(r,t)<=n){a.push(r);continue}let s=TM(r,t,n);a.push(...s)}return a.join(`
|
|
14
|
+
`)},TM=(e,t,n)=>{let a=[],i=IM(e)[Symbol.iterator](),r="",s=0,l=i.next();for(;!l.done;){let c=l.value,d=r+c,o=AM(c)?s+ac.calculate(c,t):Gr(d,t);if(/\s/.test(c)||o<=n){r=d,s=o,l=i.next();continue}if(r)a.push(r.trimEnd()),r="",s=0;else{let u=_M(c,t,n),h=u[u.length-1]??"",p=u.slice(0,-1);a.push(...p),r=h,s=Gr(h,t),l=i.next()}}if(r){let c=jM(r,t,n);a.push(c)}return a},_M=(e,t,n)=>{if(Z0().test(e))return[e];RM(e);let a=[],i=Array.from(e),r="",s=0;for(let l of i){let c=ac.calculate(l,t),d=s+c;if(d<=n){r=r+l,s=d;continue}r&&a.push(r),r=l,s=c}return r&&a.push(r),a},jM=(e,t,n)=>{if(!(Gr(e,t)>n))return e;let[,a,i]=e.match(/^(.+?)(\s+)$/)??[e,e.trimEnd(),""],r=Gr(a,t);for(let s of Array.from(i)){let l=ac.calculate(s,t),c=r+l;if(c>n)break;a=a+s,r=c}return a},AM=e=>e.codePointAt(0)!==void 0&&e.codePointAt(1)===void 0,RM=e=>{if((be.MODE===vn.TEST||be.DEV)&&/\s/.test(e))throw new Error("Word should not contain any whitespaces!")},rn=class{};L(rn,"rg",new Co),L(rn,"cache",new WeakMap),L(rn,"get",e=>rn.cache.get(e)),L(rn,"set",(e,t)=>rn.cache.set(e,t)),L(rn,"delete",e=>rn.cache.delete(e)),L(rn,"destroy",()=>{rn.cache=new WeakMap}),L(rn,"generateElementShape",(e,t)=>{let n=t!=null&&t.isExporting?void 0:rn.get(e);if(n!==void 0)return n;A1.delete(e);let a=BL(e,rn.rg,t||{isExporting:!1,canvasBackgroundColor:we.white,embedsValidationStatus:null});return rn.cache.set(e,a),a});var dt=rn,na=e=>"var(--icon-fill-color)",_8=e=>e===ke.LIGHT?Ft.white:"#1e1e1e",z=(e,t=512)=>{let{width:n=512,height:a=n,mirror:i,style:r,...s}=typeof t=="number"?{width:t}:t;return f.jsx("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${n} ${a}`,className:ne({"rtl-mirror":i}),style:r,...s,children:typeof e=="string"?f.jsx("path",{fill:"currentColor",d:e}):e})},K={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},me={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("rect",{x:3,y:8,width:18,height:4,rx:1}),f.jsx("line",{x1:12,y1:8,x2:12,y2:21}),f.jsx("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),f.jsx("path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5"})]}),K);var K0=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),f.jsx("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),f.jsx("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),f.jsx("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),f.jsx("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),K),LM=z(f.jsxs("svg",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),f.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),K),DM=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("circle",{cx:"12",cy:"12",r:"1"}),f.jsx("circle",{cx:"12",cy:"19",r:"1"}),f.jsx("circle",{cx:"12",cy:"5",r:"1"})]}),K),PM=z(f.jsxs("svg",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),f.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),f.jsx("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),K),zu=z(f.jsxs("g",{children:[f.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z",stroke:"currentColor",strokeWidth:"1.25"}),f.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z",stroke:"currentColor",strokeWidth:"1.25"}),f.jsx("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:f.jsx("path",{stroke:"none",d:"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481",fill:"#fff"})}),f.jsx("g",{mask:"url(#UnlockedIcon)",children:f.jsx("path",{stroke:"none",d:"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z",fill:"currentColor"})})]}),me),q0=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"}),f.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),f.jsx("path",{d:"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916"})]}),me),NM=z(f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),f.jsx("path",{d:"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:41,height:94,fill:"none"}),OM=z(f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),f.jsx("path",{d:"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:85,height:71,fill:"none"}),$M=z(f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),f.jsx("path",{d:"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:38,height:78,fill:"none"});z(f.jsx("g",{fill:"currentColor",children:f.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"});var FM=z(f.jsxs("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z"}),f.jsx("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),zM=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),K),BM=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z"})]}),K),HM=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("circle",{cx:"12",cy:"12",r:"9"})]}),K),XM=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),f.jsx("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),f.jsx("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),K),WM=z(f.jsx("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),me),VM=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),f.jsx("path",{d:"M16 7h4"}),f.jsx("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),K),jo=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{clipRule:"evenodd",d:"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"}),f.jsx("path",{d:"m11.25 5.417 3.333 3.333"})]}),me),j8=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),f.jsx("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),f.jsx("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),f.jsx("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),f.jsx("polyline",{points:"5 20 11 4 13 4 20 20"})]}),K),GM=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{d:"M12.5 6.667h.01"}),f.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"}),f.jsx("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),f.jsx("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),me),YM=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"}),f.jsx("path",{d:"M18 13.3l-6.3 -6.3"})]}),K),p2=z(f.jsx("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),me),U2=z(f.jsx("path",{d:"M5 10h10",strokeWidth:"1.25"}),me),ZM=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M21 21l-6 -6"}),f.jsx("path",{d:"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403"}),f.jsx("path",{d:"M3 4v4h4"})]}),K),Yr=z(f.jsx("path",{strokeWidth:"1.25",d:"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"}),me),KM=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("polyline",{points:"12 16 18 10 12 4"}),f.jsx("polyline",{points:"8 4 2 10 8 16"})]}),me),S1=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{d:"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z"}),f.jsx("path",{clipRule:"evenodd",d:"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"})]}),me),C1=z(f.jsx("path",{clipRule:"evenodd",d:"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z",stroke:"currentColor"}),me),k1=z(f.jsx("g",{stroke:"currentColor",strokeLinejoin:"round",children:f.jsx("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667"})}),{...me,strokeWidth:1.5}),A8=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),f.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),K),Bu=z(f.jsx("path",{strokeWidth:"1.25",d:"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"}),me),J0=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("circle",{cx:"12",cy:"12",r:"9"}),f.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),f.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),K),qM=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("circle",{cx:"12",cy:"12",r:"9"}),f.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),f.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),K),m2=z(f.jsx("path",{strokeWidth:"1.25",d:"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"}),me),R8=z(f.jsx("path",{d:"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5",strokeWidth:"1.25"}),me),JM=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{d:"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"}),f.jsx("path",{d:"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"})]}),me),QM=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),f.jsx("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),K),eI=z(f.jsx("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),M1=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{d:"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416"}),f.jsx("path",{d:"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416"})]}),me),tI=z("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),nI=z("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),Q0=z(f.jsx("path",{d:"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z",strokeWidth:"1.25"}),me);z("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512});var aI=z("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),sh=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),f.jsx("path",{d:"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z"}),f.jsx("path",{d:"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208"})]}),K),L8=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M15 8h.01"}),f.jsx("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),f.jsx("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),f.jsx("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),f.jsx("path",{d:"M19 16v6"}),f.jsx("path",{d:"M22 19l-3 3l-3 -3"})]}),K),iI=z("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512});z("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512});z("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512});var rI=z("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z");z("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z");var g2=z(f.jsx("path",{d:"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5",strokeWidth:"1.25"}),me),b2=z(f.jsx("path",{d:"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5",strokeWidth:"1.25"}),me),sI=z("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0}),lI=z(f.jsx("path",{d:"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834",strokeWidth:"1.5"}),me);z("M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z");z("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24});z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"}),f.jsx("path",{d:"M12 14v-11"}),f.jsx("path",{d:"M9 6l3 -3l3 3"})]}),K);z(f.jsxs(f.Fragment,{children:[f.jsx("path",{fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),f.jsx("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64});z(f.jsx("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024});var D8=f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M12 10l0 10"}),f.jsx("path",{d:"M12 10l4 4"}),f.jsx("path",{d:"M12 10l-4 4"}),f.jsx("path",{d:"M4 4l16 0"})]}),P8=f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M12 5l0 14"}),f.jsx("path",{d:"M16 9l-4 -4"}),f.jsx("path",{d:"M8 9l4 -4"})]}),v2=z(P8,K),x2=z(P8,{...K,style:{transform:"rotate(180deg)"}}),y2=z(D8,K),w2=z(D8,{...K,style:{transform:"rotate(180deg)"}}),E2=z(f.jsxs(f.Fragment,{children:[f.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[f.jsx("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),S2=z(f.jsxs(f.Fragment,{children:[f.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[f.jsx("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),C2=z(f.jsxs(f.Fragment,{children:[f.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[f.jsx("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),k2=z(f.jsxs(f.Fragment,{children:[f.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[f.jsx("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),oI=z(f.jsxs(f.Fragment,{children:[f.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[f.jsx("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),cI=z(f.jsxs(f.Fragment,{children:[f.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[f.jsx("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),M2=z(f.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[f.jsx("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),f.jsx("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z"})]}),me),I2=z(f.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[f.jsx("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),f.jsx("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),f.jsx("path",{d:"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z"})]}),me),N8=z(f.jsxs("g",{strokeWidth:"1.5",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("circle",{cx:"9",cy:"7",r:"4"}),f.jsx("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),f.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),f.jsx("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),K);z("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z");z("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z");var hl=z(f.jsxs(f.Fragment,{children:[f.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M15 5 5 15M5 5l10 10"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me);z("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0});z("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24});z("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512});var T2=M.memo(({theme:e})=>z(f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M25 26H111V111H25",fill:na()}),f.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:na(),strokeWidth:"2"}),f.jsx("path",{d:"M100 100H160V160H100",fill:na()}),f.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:na(),strokeWidth:"2"}),f.jsxs("g",{fill:_8(e),stroke:na(),strokeWidth:"6",children:[f.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),f.jsx("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),f.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),f.jsx("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),_2=M.memo(({theme:e})=>z(f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M25 26H111V111H25",fill:na()}),f.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:na(),strokeWidth:"2"}),f.jsx("path",{d:"M100 100H160V160H100",fill:na()}),f.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:na(),strokeWidth:"2"}),f.jsxs("g",{fill:_8(e),stroke:na(),strokeWidth:"6",children:[f.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),f.jsx("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),f.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),f.jsx("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),f.jsx("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),f.jsx("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),dI=z(f.jsx("g",{strokeWidth:1.25,children:f.jsx("path",{d:"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793"})}),me),uI=z(f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),f.jsx("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:f.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.25"})}),f.jsx("g",{mask:"url(#FillHachureIcon)",children:f.jsx("path",{d:"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})]}),me),fI=z(f.jsxs(f.Fragment,{children:[f.jsxs("g",{clipPath:"url(#a)",children:[f.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),f.jsx("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:f.jsx("path",{d:"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),f.jsx("g",{mask:"url(#FillCrossHatchIcon)",children:f.jsx("path",{d:"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z",fill:"currentColor"})})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),hI=z(f.jsxs(f.Fragment,{children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z",stroke:"currentColor",strokeWidth:"1.25"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...me,fill:"currentColor"}),O8=z(f.jsx(f.Fragment,{children:f.jsx("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),me),pI=z(f.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),me),UI=z(f.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),me);M.memo(({theme:e})=>z(f.jsx("path",{d:"M6 10H34",stroke:na(),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20}));var mI=z(f.jsxs("g",{strokeWidth:"2",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M5 12h2"}),f.jsx("path",{d:"M17 12h2"}),f.jsx("path",{d:"M11 12h2"})]}),K),gI=z(f.jsxs("g",{strokeWidth:"2",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M4 12v.01"}),f.jsx("path",{d:"M8 12v.01"}),f.jsx("path",{d:"M12 12v.01"}),f.jsx("path",{d:"M16 12v.01"}),f.jsx("path",{d:"M20 12v.01"})]}),K),bI=z(f.jsx("path",{d:"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814",strokeWidth:"1.25"}),me),vI=z(f.jsx("path",{d:"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43",strokeWidth:"1.25"}),me),xI=z(f.jsx("path",{d:"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42",strokeWidth:"1.25"}),me),yI=z(f.jsxs("svg",{strokeWidth:"1.5",children:[f.jsx("path",{d:"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10"}),f.jsx("path",{d:"M13.3333 3.33331V3.34331"}),f.jsx("path",{d:"M16.6667 3.33331V3.34331"}),f.jsx("path",{d:"M16.6667 6.66669V6.67669"}),f.jsx("path",{d:"M16.6667 10V10.01"}),f.jsx("path",{d:"M3.33334 13.3333V13.3433"}),f.jsx("path",{d:"M16.6667 13.3333V13.3433"}),f.jsx("path",{d:"M3.33334 16.6667V16.6767"}),f.jsx("path",{d:"M6.66666 16.6667V16.6767"}),f.jsx("path",{d:"M10 16.6667V16.6767"}),f.jsx("path",{d:"M13.3333 16.6667V16.6767"}),f.jsx("path",{d:"M16.6667 16.6667V16.6767"})]}),me),wI=z(f.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),f.jsx("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),f.jsx("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),f.jsx("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),f.jsx("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),f.jsx("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),f.jsx("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),f.jsx("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),f.jsx("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),f.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),f.jsx("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),f.jsx("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),K),EI=z(f.jsxs("g",{stroke:"currentColor",opacity:.3,strokeWidth:2,children:[f.jsx("path",{d:"M12 12l9 0"}),f.jsx("path",{d:"M3 9l6 6"}),f.jsx("path",{d:"M3 15l6 -6"})]}),K),SI=M.memo(({flip:e=!1})=>z(f.jsxs("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[f.jsx("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),f.jsx("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),CI=M.memo(({flip:e=!1})=>z(f.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[f.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),f.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),kI=M.memo(({flip:e=!1})=>z(f.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[f.jsx("path",{d:"M26 10L6 10"}),f.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),MI=M.memo(({flip:e=!1})=>z(f.jsx("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:f.jsx("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),II=M.memo(({flip:e=!1})=>z(f.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[f.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),f.jsx("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),TI=M.memo(({flip:e=!1})=>z(f.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[f.jsx("path",{d:"M6,9.5H27"}),f.jsx("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),_I=M.memo(({flip:e=!1})=>z(f.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[f.jsx("path",{d:"M6,9.5H20"}),f.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),jI=M.memo(({flip:e=!1})=>z(f.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[f.jsx("path",{d:"M6,9.5H20"}),f.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),AI=M.memo(({flip:e=!1})=>z(f.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:f.jsx("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),RI=M.memo(({flip:e=!1})=>z(f.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:f.jsx("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),LI=M.memo(({flip:e=!1})=>z(f.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:f.jsx("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),DI=z(f.jsxs(f.Fragment,{children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{d:"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),PI=z(f.jsxs(f.Fragment,{children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),NI=z(f.jsxs(f.Fragment,{children:[f.jsx("g",{clipPath:"url(#a)",children:f.jsx("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),OI=z(f.jsx(f.Fragment,{children:f.jsx("path",{d:"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),me),Hu=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M3 7v-2h13v2"}),f.jsx("path",{d:"M10 5v14"}),f.jsx("path",{d:"M12 19h-4"}),f.jsx("path",{d:"M15 13v-1h6v1"}),f.jsx("path",{d:"M18 12v7"}),f.jsx("path",{d:"M17 19h2"})]}),K),$I=z(f.jsx(f.Fragment,{children:f.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M7 12h10"}),f.jsx("path",{d:"M7 5v14"}),f.jsx("path",{d:"M17 5v14"}),f.jsx("path",{d:"M15 19h4"}),f.jsx("path",{d:"M15 5h4"}),f.jsx("path",{d:"M5 19h4"}),f.jsx("path",{d:"M5 5h4"})]})}),K),Zd=z(f.jsx(f.Fragment,{children:f.jsx("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334"})})}),me),I1=z(f.jsxs(f.Fragment,{children:[f.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"a",children:f.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),me),FI=z(f.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),f.jsx("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),f.jsx("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),K),zI=z(f.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),f.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),f.jsx("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),K),BI=z(f.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),f.jsx("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),f.jsx("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),K),HI=M.memo(({theme:e})=>z(f.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),f.jsx("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),K)),XI=M.memo(({theme:e})=>z(f.jsxs("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),f.jsx("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),K)),WI=M.memo(({theme:e})=>z(f.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),f.jsx("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),f.jsx("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),K)),$8=z(f.jsxs("g",{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M21 19h-18l9 -15"}),f.jsx("path",{d:"M20.615 15.171h.015"}),f.jsx("path",{d:"M19.515 11.771h.015"}),f.jsx("path",{d:"M17.715 8.671h.015"}),f.jsx("path",{d:"M15.415 5.971h.015"})]}),K),VI=z(f.jsx("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512});z(f.jsx("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"}));var F8=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),f.jsx("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),f.jsx("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),f.jsx("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"})]}),K),j2=z(f.jsxs(f.Fragment,{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),f.jsx("path",{d:"M7 11l5 5l5 -5"}),f.jsx("path",{d:"M12 4l0 12"})]}),K),ep=z(f.jsxs(f.Fragment,{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),f.jsx("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),K),GI=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),f.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),f.jsx("path",{d:"M9.15 14.85l8.85 -10.85"}),f.jsx("path",{d:"M6 4l8.85 10.85"})]}),K),YI=z(f.jsxs(f.Fragment,{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),f.jsx("path",{d:"M12 17l0 .01"}),f.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),K);z(f.jsxs(f.Fragment,{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M7 4v16l13 -8z"})]}),K);z(f.jsxs(f.Fragment,{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"})]}),K);var ZI=z(f.jsxs(f.Fragment,{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M5 12l5 5l10 -10"})]}),K),KI=z(f.jsxs(f.Fragment,{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"}),f.jsx("path",{d:"M12 9v4"}),f.jsx("path",{d:"M12 17h.01"})]}),K),qI=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M11 7l6 6"}),f.jsx("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]}),K),JI=z(f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M12 3l-4 7h8z"}),f.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),f.jsx("path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"})]}),K),z8=z(f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M4 7l16 0"}),f.jsx("path",{d:"M4 17l16 0"}),f.jsx("path",{d:"M7 4l0 16"}),f.jsx("path",{d:"M17 4l0 16"})]}),K),B8=z(f.jsx("path",{fill:"currentColor",d:"M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z"})),ud=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{d:"M4.16602 10H15.8327"}),f.jsx("path",{d:"M12.5 13.3333L15.8333 10"}),f.jsx("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),me),H8=z(f.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[f.jsx("path",{clipRule:"evenodd",d:"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z"}),f.jsx("path",{d:"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13"})]}),20),X8=z(f.jsxs("g",{stroke:"currentColor",fill:"none",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),f.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),f.jsx("path",{d:"M15 6l3 3"}),f.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),f.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),K);z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),f.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),f.jsx("path",{d:"M15 6l3 3"}),f.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),f.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),K);z(f.jsxs("g",{stroke:"currentColor",fill:"none",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),f.jsx("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),f.jsx("path",{d:"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348"}),f.jsx("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),f.jsx("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),f.jsx("path",{d:"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42"})]}),K);var QI=z(f.jsxs("g",{stroke:"currentColor",fill:"none",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),f.jsx("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),f.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),f.jsx("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),K),tp=z(f.jsxs("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),f.jsx("path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"})]}),K),eT=z(f.jsxs("g",{stroke:"currentColor",fill:"none",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),f.jsx("path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}),f.jsx("path",{d:"M3 3l18 18"})]}),K),tT=z(f.jsxs("g",{stroke:"currentColor",fill:"none",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),f.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),f.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),f.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),f.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),f.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),K),nT=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),f.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),f.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),f.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),f.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),f.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),K),Zr=z(f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),f.jsx("path",{d:"M21 21l-6 -6"})]}),K),aT=z(f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),f.jsx("path",{d:"M12 7v5l3 3"}),f.jsx("path",{d:"M19 16l-2 3h4l-2 3"})]}),K),iT=z(f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"}),f.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),f.jsx("path",{d:"M8 21l8 0"}),f.jsx("path",{d:"M12 17l0 4"})]}),K),rT=z(f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M3 3l18 18"}),f.jsx("path",{d:"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1"}),f.jsx("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),f.jsx("path",{d:"M8 21l8 0"}),f.jsx("path",{d:"M12 17l0 4"})]}),K),W8=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),K),sT=z(f.jsxs("g",{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z"}),f.jsx("path",{d:"M12 20v.01"}),f.jsx("path",{d:"M16 20v.01"}),f.jsx("path",{d:"M8 20v.01"}),f.jsx("path",{d:"M4 20v.01"}),f.jsx("path",{d:"M4 16v.01"}),f.jsx("path",{d:"M4 12v.01"}),f.jsx("path",{d:"M4 8v.01"}),f.jsx("path",{d:"M4 4v.01"}),f.jsx("path",{d:"M8 4v.01"}),f.jsx("path",{d:"M12 4v.01"}),f.jsx("path",{d:"M16 4v.01"}),f.jsx("path",{d:"M20 4v.01"}),f.jsx("path",{d:"M20 8v.01"}),f.jsx("path",{d:"M20 12v.01"}),f.jsx("path",{d:"M20 16v.01"}),f.jsx("path",{d:"M20 20v.01"})]}),K),lT=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M5 3v18"}),f.jsx("path",{d:"M19 21v-18"}),f.jsx("path",{d:"M5 7h14"}),f.jsx("path",{d:"M5 15h14"}),f.jsx("path",{d:"M8 13v4"}),f.jsx("path",{d:"M11 13v4"}),f.jsx("path",{d:"M16 13v4"}),f.jsx("path",{d:"M14 5v4"}),f.jsx("path",{d:"M11 5v4"}),f.jsx("path",{d:"M8 5v4"}),f.jsx("path",{d:"M3 21h18"})]}),K),oT=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M3 12l18 0"}),f.jsx("path",{d:"M7 16l10 0l-10 5l0 -5"}),f.jsx("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),K),cT=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M12 3l0 18"}),f.jsx("path",{d:"M16 7l0 10l5 0l-5 -10"}),f.jsx("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),K),V8=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),f.jsx("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),f.jsx("path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"})]}),K),np=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),f.jsx("path",{d:"M22 22l-3 -3"}),f.jsx("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),f.jsx("path",{d:"M3 11v-1"}),f.jsx("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),f.jsx("path",{d:"M10 3h1"}),f.jsx("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),K),dT=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),f.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),f.jsx("path",{d:"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"}),f.jsx("path",{d:"M10 15l2 6l2 -6"}),f.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),K),uT=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),f.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),f.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),f.jsx("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),f.jsx("path",{d:"M11 21v-6l3 6v-6"})]}),K),fT=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0"}),f.jsx("path",{d:"M4 8l5 0"}),f.jsx("path",{d:"M15 8l4 0"})]}),K),hT=z(f.jsxs("g",{strokeWidth:1.25,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"}),f.jsx("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),f.jsx("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),f.jsx("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),f.jsx("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),K),pT=z(f.jsxs("g",{stroke:"currentColor",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4"})]}),{...K,strokeWidth:1.5});z(f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),f.jsx("path",{d:"M21 12h-13l3 -3"}),f.jsx("path",{d:"M11 15l-3 -3"})]}),K);var UT=z(f.jsxs("g",{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"}),f.jsx("path",{d:"M10 9l5 3l-5 3z"})]}),K),mT=z(f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M3 6h18"}),f.jsx("path",{d:"M3 12h18"}),f.jsx("path",{d:"M3 18h18"}),f.jsx("path",{d:"M6 3v18"}),f.jsx("path",{d:"M12 3v18"}),f.jsx("path",{d:"M18 3v18"})]}),K),gT=z(f.jsxs("g",{strokeWidth:1.5,children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),f.jsx("path",{d:"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),f.jsx("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),K),bT=z(f.jsxs("g",{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M6 18l12 -12"}),f.jsx("path",{d:"M18 10v-4h-4"})]}),K),vT=z(f.jsxs("g",{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),f.jsx("path",{d:"M18 4l3 3l-3 3"})]}),K),xT=z(f.jsxs("g",{children:[f.jsx("path",{d:"M16,12L20,9L16,6"}),f.jsx("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),K),G8=z(f.jsxs("g",{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M6 9l6 6l6 -6"})]}),K),yT=z(f.jsxs("g",{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M6 15l6 -6l6 6"})]}),K),wT=z(f.jsxs("g",{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M6 15l6 -6l6 6"})]}),K),A2=z(f.jsxs("g",{strokeWidth:"1.25",children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),f.jsx("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),K),Y8=z(f.jsxs("g",{children:[f.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.jsx("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),f.jsx("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),f.jsx("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),f.jsx("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),f.jsx("path",{d:"M5 7l0 10"}),f.jsx("path",{d:"M7 5l10 0"}),f.jsx("path",{d:"M7 19l10 0"}),f.jsx("path",{d:"M19 7l0 10"})]}),K),Kd={[it.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:jo},[it.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.35},icon:Zd},[it["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15},icon:$I},[it["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25},icon:I1},[it.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:jo,deprecated:!0},[it.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},icon:Zd,deprecated:!0,local:!0},[it.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},icon:I1,deprecated:!0},[it["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},serverSide:!0},[Is.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.15},fallback:!0},[Is["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Cr={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},ap="local:",ET=class extends Error{constructor(e="Couldn't export canvas.",t="CANVAS_ERROR"){super(),this.name=t,this.message=e}},Xu=class extends DOMException{constructor(e="Request Aborted"){super(e,"AbortError")}},Tr=class extends Error{constructor(e="Image Scene Data Error",t="IMAGE_SCENE_DATA_ERROR"){super(e),L(this,"code"),this.name="EncodingError",this.code=t}},ST=class extends Error{constructor(){super(...arguments),L(this,"code","ELEMENT_HAS_INVALID_INDEX")}},Z8=class extends Error{constructor(e="Worker URL is not defined!",t="WORKER_URL_NOT_DEFINED"){super(e),L(this,"code"),this.name="WorkerUrlNotDefinedError",this.code=t}},K8=class extends Error{constructor(e="Worker has to be in a separate chunk!",t="WORKER_IN_THE_MAIN_CHUNK"){super(e),L(this,"code"),this.name="WorkerInTheMainChunkError",this.code=t}},R2=class extends Error{constructor(e){super(e),this.name="ExcalidrawError"}},CT=class{constructor(e){L(this,"instance"),L(this,"debounceTerminate"),this.instance=new Worker(e,{type:"module"})}},kT=class q8{constructor(t,n){L(this,"idleWorkers",new Set),L(this,"workerUrl"),L(this,"workerTTL"),this.workerUrl=t,this.workerTTL=n.ttl||1e3}static create(t,n={}){if(!t)throw new Z8;if(!(typeof document>"u"?require("url").pathToFileURL(__filename).href:cs&&cs.tagName.toUpperCase()==="SCRIPT"&&cs.src||new URL("layers.lsThdXHq.js",document.baseURI).href)||t.toString()===(typeof document>"u"?require("url").pathToFileURL(__filename).href:cs&&cs.tagName.toUpperCase()==="SCRIPT"&&cs.src||new URL("layers.lsThdXHq.js",document.baseURI).href))throw new K8;return new q8(t,n)}async postMessage(t,n){let a,i=Array.from(this.idleWorkers).shift();return i?(this.idleWorkers.delete(i),a=i):a=await this.createWorker(),new Promise((r,s)=>{a.instance.onmessage=this.onMessageHandler(a,r),a.instance.onerror=this.onErrorHandler(a,s),a.instance.postMessage(t,n),a.debounceTerminate(()=>s(new Error(`Active worker did not respond for ${this.workerTTL}ms!`)))})}async clear(){for(let t of this.idleWorkers)t.debounceTerminate.cancel(),t.instance.terminate();this.idleWorkers.clear()}async createWorker(){let t=new CT(this.workerUrl);return t.debounceTerminate=Zs(n=>{t.instance.terminate(),this.idleWorkers.has(t)?(this.idleWorkers.delete(t),console.debug("Job finished! Idle worker has been released from the pool.")):n?n():console.error("Worker has been terminated!")},this.workerTTL),t}onMessageHandler(t,n){return a=>{t.debounceTerminate(),this.idleWorkers.add(t),n(a.data)}}onErrorHandler(t,n){return a=>{t.debounceTerminate(()=>n(a)),t.debounceTerminate.flush(),this.clear()}}},L2=typeof Worker<"u",MT=async(e,t)=>{let{Commands:n,subsetToBase64:a,toBase64:i}=await TT();return L2?Qi(async()=>{try{let r=await _T(),s=e.slice(0),l=await r.postMessage({command:n.Subset,arrayBuffer:s,codePoints:t},{transfer:[s]});return i(l)}catch(r){return L2=!1,oM()&&(r instanceof Z8||r instanceof K8)||console.error("Failed to use workers for subsetting, falling back to the main thread.",r),a(e,t)}}):a(e,t)},lh=null,oh=null,IT=async()=>(lh||(lh=Promise.resolve().then(()=>require("./layers.CzQvc6hI.js"))),lh),TT=async()=>(oh||(oh=Promise.resolve().then(()=>require("./layers.CrUOtKSX.js"))),oh),ch=null,_T=()=>(ch||(ch=Qi(async()=>{let{WorkerUrl:e}=await IT();return kT.create(e)})),ch),J8=class fd{constructor(t,n,a){L(this,"urls"),L(this,"fontFace"),this.urls=fd.createUrls(n);let i=this.urls.map(r=>`url(${r}) ${fd.getFormat(r)}`).join(", ");this.fontFace=new FontFace(t,i,{display:"swap",style:"normal",weight:"400",...a})}toCSS(t){if(!this.getUnicodeRangeRegex().test(t))return;let n=Array.from(t).map(a=>a.codePointAt(0));return this.getContent(n).then(a=>`@font-face { font-family: ${this.fontFace.family}; src: url(${a}); }`)}async getContent(t){let n=0,a=[];for(;n<this.urls.length;){let i=this.urls[n];try{let r=await this.fetchFont(i);return await MT(r,t)}catch(r){a.push(`"${i.toString()}" returned error "${r}"`)}n++}return console.error(`Failed to fetch font family "${this.fontFace.family}"`,JSON.stringify(a,void 0,2)),this.urls.length?this.urls[this.urls.length-1].toString():""}fetchFont(t){return Qi(async()=>{let n=await fetch(t,{cache:"force-cache",headers:{Accept:"font/woff2"}});if(!n.ok){let a=t instanceof URL?t.toString():"dataurl";throw new Error(`Failed to fetch "${a}": ${n.statusText}`)}return await n.arrayBuffer()})}getUnicodeRangeRegex(){let t=this.fontFace.unicodeRange.split(/,\s*/).map(n=>{let[a,i]=n.replace("U+","").split("-");return i?`\\u{${a}}-\\u{${i}}`:`\\u{${a}}`}).join("");return new RegExp(`[${t}]`,"u")}static createUrls(t){if(t.startsWith("data"))return[t];if(t.startsWith(ap))return[];if(t.startsWith("http"))return[new URL(t)];let n=t.replace(/^\/+/,""),a=[];if(typeof window.EXCALIDRAW_ASSET_PATH=="string"){let i=this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);a.push(new URL(n,i))}else Array.isArray(window.EXCALIDRAW_ASSET_PATH)&&window.EXCALIDRAW_ASSET_PATH.forEach(i=>{let r=this.normalizeBaseUrl(i);a.push(new URL(n,r))});return a.push(new URL(n,fd.ASSETS_FALLBACK_URL)),a}static getFormat(t){if(!(t instanceof URL))return"";try{let n=new URL(t).pathname.split(".");return n.length===1?"":`format('${n.pop()}')`}catch{return""}}static normalizeBaseUrl(t){var a;let n=t;return/^\.?\//.test(n)&&(n=new URL(n.replace(/^\.?\/+/,""),(a=window==null?void 0:window.location)==null?void 0:a.origin).toString()),n=`${n.replace(/\/+$/,"")}/`,n}};L(J8,"ASSETS_FALLBACK_URL",`https://esm.sh/${`${be.PKG_NAME}@${be.PKG_VERSION}`}/dist/prod/`);var jT=J8,AT="./fonts/Cascadia/CascadiaCode-Regular.woff2",RT=[{uri:AT}],LT="./fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2",DT="./fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2",PT="./fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2",NT="./fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2",OT=[{uri:LT,descriptors:{unicodeRange:"U+20-7e,U+a1-a6,U+a8,U+ab-ac,U+af-b1,U+b4,U+b8,U+bb-bc,U+bf-cf,U+d1-d7,U+d9-de,U+e0-ef,U+f1-f7,U+f9-ff,U+131,U+152-153,U+2c6,U+2da,U+2dc,U+2013-2014,U+2018-201a,U+201c-201d,U+2020-2022,U+2026,U+2039-203a,U+2044,U+20ac,U+2191,U+2193,U+2212"}},{uri:DT,descriptors:{unicodeRange:"U+100-10f,U+112-125,U+128-130,U+134-137,U+139-13c,U+141-148,U+14c-151,U+154-161,U+164-165,U+168-17f,U+1bf,U+1f7,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+a75b"}},{uri:PT,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+315,U+2190,U+2192,U+2200,U+2203-2204,U+2264-2265,U+f6c3"}},{uri:NT,descriptors:{unicodeRange:"U+3bb"}}],$T=[{uri:ap}],FT="./fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2",zT="./fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2",BT="./fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2",HT="./fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2",XT="./fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2",WT="./fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2",VT="./fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2",GT=[{uri:FT,descriptors:{unicodeRange:"U+20-7e,U+a0-a3,U+a5-a6,U+a8-ab,U+ad-b1,U+b4,U+b6-b8,U+ba-ff,U+131,U+152-153,U+2bc,U+2c6,U+2da,U+2dc,U+304,U+308,U+2013-2014,U+2018-201a,U+201c-201e,U+2020,U+2022,U+2024-2026,U+2030,U+2039-203a,U+20ac,U+2122,U+2212"}},{uri:zT,descriptors:{unicodeRange:"U+100-130,U+132-137,U+139-149,U+14c-151,U+154-17e,U+192,U+1fc-1ff,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+2113"}},{uri:BT,descriptors:{unicodeRange:"U+400-45f,U+490-491,U+2116"}},{uri:HT,descriptors:{unicodeRange:"U+37e,U+384-38a,U+38c,U+38e-393,U+395-3a1,U+3a3-3a8,U+3aa-3cf,U+3d7"}},{uri:XT,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+302,U+306-307,U+30a-30c,U+326-328,U+212e,U+2211,U+fb01-fb02"}},{uri:WT,descriptors:{unicodeRange:"U+462-463,U+472-475,U+4d8-4d9,U+4e2-4e3,U+4e6-4e9,U+4ee-4ef"}},{uri:VT,descriptors:{unicodeRange:"U+300-301,U+303"}}],YT=[{uri:ap}],ZT="./fonts/Liberation/LiberationSans-Regular.woff2",KT=[{uri:ZT}],qT="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2",JT="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2",QT=[{uri:JT,descriptors:{unicodeRange:Cr.LATIN_EXT}},{uri:qT,descriptors:{unicodeRange:Cr.LATIN}}],e_="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2",t_="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2",n_="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2",a_="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2",i_="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2",r_=[{uri:a_,descriptors:{unicodeRange:Cr.CYRILIC_EXT,weight:"500"}},{uri:n_,descriptors:{unicodeRange:Cr.CYRILIC,weight:"500"}},{uri:i_,descriptors:{unicodeRange:Cr.VIETNAMESE,weight:"500"}},{uri:t_,descriptors:{unicodeRange:Cr.LATIN_EXT,weight:"500"}},{uri:e_,descriptors:{unicodeRange:Cr.LATIN,weight:"500"}}],s_="./fonts/Virgil/Virgil-Regular.woff2",l_=[{uri:s_}],o_="./fonts/Xiaolai/Xiaolai-Regular-09850c4077f3fffe707905872e0e2460.woff2",c_="./fonts/Xiaolai/Xiaolai-Regular-7eb9fffd1aa890d07d0f88cc82e6cfe4.woff2",d_="./fonts/Xiaolai/Xiaolai-Regular-60a3089806700d379f11827ee9843b6b.woff2",u_="./fonts/Xiaolai/Xiaolai-Regular-6fe5c5973cc06f74b2387a631ea36b88.woff2",f_="./fonts/Xiaolai/Xiaolai-Regular-b96d9226ce77ec94ceca043d712182e6.woff2",h_="./fonts/Xiaolai/Xiaolai-Regular-6ae5b42180ad70b971c91e7eefb8eba2.woff2",p_="./fonts/Xiaolai/Xiaolai-Regular-a4c34be6d42152e64b0df90bc4607f64.woff2",U_="./fonts/Xiaolai/Xiaolai-Regular-c69f61a4ab18d0488c8d1fc12e7028e8.woff2",m_="./fonts/Xiaolai/Xiaolai-Regular-e3fcf5180fd466c8915c4e8069491054.woff2",g_="./fonts/Xiaolai/Xiaolai-Regular-c1f94158256bb1f3bf665b053d895af9.woff2",b_="./fonts/Xiaolai/Xiaolai-Regular-544fc28abe2c5c30e62383fd4dac255f.woff2",v_="./fonts/Xiaolai/Xiaolai-Regular-7197d6fda6cba7c3874c53d6381ca239.woff2",x_="./fonts/Xiaolai/Xiaolai-Regular-70c2eb8d64e71a42a834eb857ea9df51.woff2",y_="./fonts/Xiaolai/Xiaolai-Regular-069e77aac84590e2e991d0a0176d34f2.woff2",w_="./fonts/Xiaolai/Xiaolai-Regular-41521fade99856108931b4768b1b2648.woff2",E_="./fonts/Xiaolai/Xiaolai-Regular-a004ddfcb26e67bd6e678c8ed19e25ce.woff2",S_="./fonts/Xiaolai/Xiaolai-Regular-04b718e5623574919c8b0dea5f301444.woff2",C_="./fonts/Xiaolai/Xiaolai-Regular-7e4bde7e9c7f84cd34d8a845e384c746.woff2",k_="./fonts/Xiaolai/Xiaolai-Regular-23686f7f29da6e8008c36dd3a80c83d6.woff2",M_="./fonts/Xiaolai/Xiaolai-Regular-69c09cc5fa3e55c74fc4821f76909cc3.woff2",I_="./fonts/Xiaolai/Xiaolai-Regular-25b7f38e18f035f96cb5e547bd2bd08c.woff2",T_="./fonts/Xiaolai/Xiaolai-Regular-ba3de316d63c7e339987b16f41a0b879.woff2",__="./fonts/Xiaolai/Xiaolai-Regular-12b52b58eb3df36804b9a654ec9ee194.woff2",j_="./fonts/Xiaolai/Xiaolai-Regular-b1220a3c61f85cc0408deedb4c5f57a2.woff2",A_="./fonts/Xiaolai/Xiaolai-Regular-4535823663ad81405188a528d8f2b1a2.woff2",R_="./fonts/Xiaolai/Xiaolai-Regular-3eaa538115d76932653c21d8dc28f207.woff2",L_="./fonts/Xiaolai/Xiaolai-Regular-7e929f262f30c8ee78bf398150b1a7cd.woff2",D_="./fonts/Xiaolai/Xiaolai-Regular-73e309718fd16cea44b4d54a33581811.woff2",P_="./fonts/Xiaolai/Xiaolai-Regular-9eb5a99df4e76ac3363453ac9ca288b1.woff2",N_="./fonts/Xiaolai/Xiaolai-Regular-3e63ed8162808a9e425ed80a8bc79114.woff2",O_="./fonts/Xiaolai/Xiaolai-Regular-cb17fc3db95f6d139afc9d31a8e93293.woff2",$_="./fonts/Xiaolai/Xiaolai-Regular-c8b71798409ccc126ee264a00aadcf21.woff2",F_="./fonts/Xiaolai/Xiaolai-Regular-11c345711937f0ba4b8f7b6b919c8440.woff2",z_="./fonts/Xiaolai/Xiaolai-Regular-e480d9c614742d05f0e78f274f1e69e6.woff2",B_="./fonts/Xiaolai/Xiaolai-Regular-95429962233afd82db1c27df1500a28c.woff2",H_="./fonts/Xiaolai/Xiaolai-Regular-2cf96d082d35ea3d8106851223ad0d16.woff2",X_="./fonts/Xiaolai/Xiaolai-Regular-2d43040e86ff03ba677f6f9c04cd0805.woff2",W_="./fonts/Xiaolai/Xiaolai-Regular-2a26d20a23b00898ce82f09d2ee47c3f.woff2",V_="./fonts/Xiaolai/Xiaolai-Regular-a365e82ed54697a52f27adcea1315fe8.woff2",G_="./fonts/Xiaolai/Xiaolai-Regular-f5d079153c99a25b9be5b8583c4cc8a7.woff2",Y_="./fonts/Xiaolai/Xiaolai-Regular-10a7ae9a371830a80c3d844acf1c02d7.woff2",Z_="./fonts/Xiaolai/Xiaolai-Regular-e4bca6cfa53e499cae0a6be4894a90e9.woff2",K_="./fonts/Xiaolai/Xiaolai-Regular-60a41c7e1c68f22424e6d22df544bc82.woff2",q_="./fonts/Xiaolai/Xiaolai-Regular-7ab2bed91166a9dca83a5ebfbe2a7f38.woff2",J_="./fonts/Xiaolai/Xiaolai-Regular-670ba603758d94268e8606f240a42e12.woff2",Q_="./fonts/Xiaolai/Xiaolai-Regular-e656f091b9dc4709722c9f4b84d3c797.woff2",ej="./fonts/Xiaolai/Xiaolai-Regular-15dc6d811c9cd078f9086a740d5a1038.woff2",tj="./fonts/Xiaolai/Xiaolai-Regular-f0f13b5c60e0af5553bd359f5513be1b.woff2",nj="./fonts/Xiaolai/Xiaolai-Regular-8c2f33cee3993174f7e87c28e4bf42ee.woff2",aj="./fonts/Xiaolai/Xiaolai-Regular-761d05e3cd968cf574166867998ef06a.woff2",ij="./fonts/Xiaolai/Xiaolai-Regular-642b26e2e5f5fb780b51b593dbc8c851.woff2",rj="./fonts/Xiaolai/Xiaolai-Regular-5572b3513ba8df57a3d5d7303ee6b11b.woff2",sj="./fonts/Xiaolai/Xiaolai-Regular-3c9de2ae0ea4bc91a510942dfa4be8d2.woff2",lj="./fonts/Xiaolai/Xiaolai-Regular-671a2c20b1eb9e4ef8a192833940e319.woff2",oj="./fonts/Xiaolai/Xiaolai-Regular-4dc6d5f188d5c96d44815cd1e81aa885.woff2",cj="./fonts/Xiaolai/Xiaolai-Regular-ce4884f96f11589608b76b726a755803.woff2",dj="./fonts/Xiaolai/Xiaolai-Regular-8f476c4c99813d57cbe6eca4727388ad.woff2",uj="./fonts/Xiaolai/Xiaolai-Regular-5935a5775af3d5c6307ac667bd9ae74e.woff2",fj="./fonts/Xiaolai/Xiaolai-Regular-79f007c1c6d07557120982951ea67998.woff2",hj="./fonts/Xiaolai/Xiaolai-Regular-bafff7a14c27403dcc6cf1432e8ea836.woff2",pj="./fonts/Xiaolai/Xiaolai-Regular-543fa46ace099a7099dad69123399400.woff2",Uj="./fonts/Xiaolai/Xiaolai-Regular-4ddc14ed3eb0c3e46364317dfc0144a3.woff2",mj="./fonts/Xiaolai/Xiaolai-Regular-0fa55a080fcd0f9dc2e0b0058b793df8.woff2",gj="./fonts/Xiaolai/Xiaolai-Regular-66493ba5a8367f2928812f446f47b56a.woff2",bj="./fonts/Xiaolai/Xiaolai-Regular-57862b464a55b18c7bf234ce22907d73.woff2",vj="./fonts/Xiaolai/Xiaolai-Regular-8d3bcabb847b56243b16afe62adaaf21.woff2",xj="./fonts/Xiaolai/Xiaolai-Regular-2b77e8ebfb2367ab2662396a60e7d320.woff2",yj="./fonts/Xiaolai/Xiaolai-Regular-0b5d723fdc4e249c140f0909e87d03b4.woff2",wj="./fonts/Xiaolai/Xiaolai-Regular-cdbce89e82cc1ab53a2decbf5819278f.woff2",Ej="./fonts/Xiaolai/Xiaolai-Regular-739bc1a567439c7cffcd1614644593d2.woff2",Sj="./fonts/Xiaolai/Xiaolai-Regular-72252d73220fa3cd856677888cee1635.woff2",Cj="./fonts/Xiaolai/Xiaolai-Regular-08e0dc436ad0ad61ba5558db0674d762.woff2",kj="./fonts/Xiaolai/Xiaolai-Regular-cf6ff4e0f491ca0cf3038187a997b9b4.woff2",Mj="./fonts/Xiaolai/Xiaolai-Regular-9cfb2a77a4e45025105ad29a1748b90d.woff2",Ij="./fonts/Xiaolai/Xiaolai-Regular-450da755d5bcb70906e1295e559b9602.woff2",Tj="./fonts/Xiaolai/Xiaolai-Regular-0986d134c05864f5025962eef9f994a0.woff2",_j="./fonts/Xiaolai/Xiaolai-Regular-1ee544f0f1dac422545c505baa788992.woff2",jj="./fonts/Xiaolai/Xiaolai-Regular-4806e761d750087c2d734fc64596eaff.woff2",Aj="./fonts/Xiaolai/Xiaolai-Regular-33432927cd87d40cfe393c7482bf221f.woff2",Rj="./fonts/Xiaolai/Xiaolai-Regular-be549ab72f0719d606a5c01e2c0219b6.woff2",Lj="./fonts/Xiaolai/Xiaolai-Regular-019d66dcad46dc156b162d267f981c20.woff2",Dj="./fonts/Xiaolai/Xiaolai-Regular-b5c1596551c256e0e9cf02028595b092.woff2",Pj="./fonts/Xiaolai/Xiaolai-Regular-e5f453bb04da18eed01675eeebd88bf8.woff2",Nj="./fonts/Xiaolai/Xiaolai-Regular-cf2cc71752631e579e35b0e423bf2638.woff2",Oj="./fonts/Xiaolai/Xiaolai-Regular-6f3256af8454371776bc46670d33cc65.woff2",$j="./fonts/Xiaolai/Xiaolai-Regular-23f228f3999c01983860012330e4be08.woff2",Fj="./fonts/Xiaolai/Xiaolai-Regular-21430ee05a1248901da8d0de08744d47.woff2",zj="./fonts/Xiaolai/Xiaolai-Regular-5330a2119a716e4e7224ed108b085dac.woff2",Bj="./fonts/Xiaolai/Xiaolai-Regular-cd145ce4a0ea18469358df53c207bc1b.woff2",Hj="./fonts/Xiaolai/Xiaolai-Regular-36925dfe329a45086cbb7fc5c20d45ac.woff2",Xj="./fonts/Xiaolai/Xiaolai-Regular-4bfaa8ffa64c5ee560aa2daba7c9cbd3.woff2",Wj="./fonts/Xiaolai/Xiaolai-Regular-112c051027b2d766c19a519f6ee1f4f7.woff2",Vj="./fonts/Xiaolai/Xiaolai-Regular-5b0ed6971aaab9c8ad563230bd5471a7.woff2",Gj="./fonts/Xiaolai/Xiaolai-Regular-98f2ad84457de7f3740d9920b8fa8667.woff2",Yj="./fonts/Xiaolai/Xiaolai-Regular-733171b4ffcd17ea1fe1c0ba627173bf.woff2",Zj="./fonts/Xiaolai/Xiaolai-Regular-684d65f1793cac449dde5d59cb3c47fb.woff2",Kj="./fonts/Xiaolai/Xiaolai-Regular-cbaaefaaf326668277aa24dfa93c4d28.woff2",qj="./fonts/Xiaolai/Xiaolai-Regular-58fd02350d0bc52cf1ca3bb32ce9766e.woff2",Jj="./fonts/Xiaolai/Xiaolai-Regular-7ccce86603f80a099ddb0cb21d4ae3e3.woff2",Qj="./fonts/Xiaolai/Xiaolai-Regular-3717077e38f98d89eae729b6c14e56dc.woff2",eA="./fonts/Xiaolai/Xiaolai-Regular-dbea1af6dcd9860be40c3d18254338f5.woff2",tA="./fonts/Xiaolai/Xiaolai-Regular-4a0fdb40036e87b40aa08dd30584cb85.woff2",nA="./fonts/Xiaolai/Xiaolai-Regular-0f626226ba1272e832aea87bafd9720e.woff2",aA="./fonts/Xiaolai/Xiaolai-Regular-938d90c10ff8c20386af7f242c05d6b0.woff2",iA="./fonts/Xiaolai/Xiaolai-Regular-b6d128682ee29e471486354d486a1b90.woff2",rA="./fonts/Xiaolai/Xiaolai-Regular-e51ef413167c6e14e0c0fdcc585f2fc9.woff2",sA="./fonts/Xiaolai/Xiaolai-Regular-9d81066dd2b337c938df6e90380a00dc.woff2",lA="./fonts/Xiaolai/Xiaolai-Regular-20e7bf72fa05de9adf7dbcc7bf51dde6.woff2",oA="./fonts/Xiaolai/Xiaolai-Regular-4095eb84ef3874e2600247bee0b04026.woff2",cA="./fonts/Xiaolai/Xiaolai-Regular-4ee10ae43505e2e0bc62656ced49c0fa.woff2",dA="./fonts/Xiaolai/Xiaolai-Regular-7494dc504ae00ee9cd0505f990f88c5d.woff2",uA="./fonts/Xiaolai/Xiaolai-Regular-8de5b863cb50dfefdd07cb11c774d579.woff2",fA="./fonts/Xiaolai/Xiaolai-Regular-3e1f8f654357353bf0e04ba5c34b5f7f.woff2",hA="./fonts/Xiaolai/Xiaolai-Regular-2e33e8dc771ef5e1d9127d60a6b73679.woff2",pA="./fonts/Xiaolai/Xiaolai-Regular-173945821411c09f70c95f98d590e697.woff2",UA="./fonts/Xiaolai/Xiaolai-Regular-b358f7a51ece39a3247942b1feabdb29.woff2",mA="./fonts/Xiaolai/Xiaolai-Regular-23ad2d71b280f00b1363b95b7bea94eb.woff2",gA="./fonts/Xiaolai/Xiaolai-Regular-5882ffa04f32584d26109137e2da4352.woff2",bA="./fonts/Xiaolai/Xiaolai-Regular-a203b91dad570bf05a58c3c3ddb529bf.woff2",vA="./fonts/Xiaolai/Xiaolai-Regular-bd77e3c7f9e0b072d96af37f73d1aa32.woff2",xA="./fonts/Xiaolai/Xiaolai-Regular-5a45d991244d4c7140217e1e5f5ca4f4.woff2",yA="./fonts/Xiaolai/Xiaolai-Regular-f56414bf9bced67990def8660e306759.woff2",wA="./fonts/Xiaolai/Xiaolai-Regular-583d166e56ba0de4b77eabb47ef67839.woff2",EA="./fonts/Xiaolai/Xiaolai-Regular-7f855356ab893b0d2b9c1c83b8116f0e.woff2",SA="./fonts/Xiaolai/Xiaolai-Regular-b57aaedfd8ebdf3931f25119dc6a5eb2.woff2",CA="./fonts/Xiaolai/Xiaolai-Regular-b6fd38ca30869792244804b04bc058da.woff2",kA="./fonts/Xiaolai/Xiaolai-Regular-452225341522a7942f0f6aab1a5c91a3.woff2",MA="./fonts/Xiaolai/Xiaolai-Regular-866fa7613df6b3fd272bcfd4530c0bb9.woff2",IA="./fonts/Xiaolai/Xiaolai-Regular-52a84a22fd1369bffeaf21da2d6158dc.woff2",TA="./fonts/Xiaolai/Xiaolai-Regular-829615148e6357d826b9242eb7fbbd1e.woff2",_A="./fonts/Xiaolai/Xiaolai-Regular-c99eda15fc26a2941579560f76c3a5cf.woff2",jA="./fonts/Xiaolai/Xiaolai-Regular-395c35dd584b56b0789f58a0559beaf1.woff2",AA="./fonts/Xiaolai/Xiaolai-Regular-203b0e569e3b14aac86a003dc3fa523e.woff2",RA="./fonts/Xiaolai/Xiaolai-Regular-51a0e808bbc8361236ac521a119758a3.woff2",LA="./fonts/Xiaolai/Xiaolai-Regular-6e092f71c1e634059ada0e52abadce67.woff2",DA="./fonts/Xiaolai/Xiaolai-Regular-0f7fb1e0d5015bb1371343153ecf7ce3.woff2",PA="./fonts/Xiaolai/Xiaolai-Regular-d0cf73942fea1c74edbdf0b3011f4656.woff2",NA="./fonts/Xiaolai/Xiaolai-Regular-968cffdc8ee679da094e77ebf50f58ef.woff2",OA="./fonts/Xiaolai/Xiaolai-Regular-7a07ddc0f0c0f5f4a9bad6ee3dda66b5.woff2",$A="./fonts/Xiaolai/Xiaolai-Regular-ec181b795ac1fb5a50d700b6e996d745.woff2",FA="./fonts/Xiaolai/Xiaolai-Regular-cfb211578629b7e8153b37240de6a9d5.woff2",zA="./fonts/Xiaolai/Xiaolai-Regular-59e9ff77b0efaf684bc09274fb6908c9.woff2",BA="./fonts/Xiaolai/Xiaolai-Regular-2adbc89c11e65905393d3dfc468b9d5b.woff2",HA="./fonts/Xiaolai/Xiaolai-Regular-70e811fd7994e61f408c923de6ddd078.woff2",XA="./fonts/Xiaolai/Xiaolai-Regular-c4a687ac4f0c2766eefc9f77ed99cddf.woff2",WA="./fonts/Xiaolai/Xiaolai-Regular-51502f1206be09c565f1547c406e9558.woff2",VA="./fonts/Xiaolai/Xiaolai-Regular-1fdc0c67ed57263a80fd108c1f6ccf24.woff2",GA="./fonts/Xiaolai/Xiaolai-Regular-e11567fd2accf9957cd0d3c2be937d87.woff2",YA="./fonts/Xiaolai/Xiaolai-Regular-20cc1bbf50e7efb442756cb605672c1f.woff2",ZA="./fonts/Xiaolai/Xiaolai-Regular-5d2898fbc097a7e24c6f38d80587621e.woff2",KA="./fonts/Xiaolai/Xiaolai-Regular-ac9ceb44437becc3e9c4dbfebab7fc2d.woff2",qA="./fonts/Xiaolai/Xiaolai-Regular-c16ed9740b85badf16e86ea782a3062f.woff2",JA="./fonts/Xiaolai/Xiaolai-Regular-aa0d470430e6391eca720c7cfa44446f.woff2",QA="./fonts/Xiaolai/Xiaolai-Regular-f2b54d4e7be0eaefe1c2c56836fa5368.woff2",eR="./fonts/Xiaolai/Xiaolai-Regular-99a16ef6a64934d5781933dbd9c46b2e.woff2",tR="./fonts/Xiaolai/Xiaolai-Regular-c40533fdf4cc57177b12803598af7e59.woff2",nR="./fonts/Xiaolai/Xiaolai-Regular-91ddb2969bf2d31ba02ad82998d1314c.woff2",aR="./fonts/Xiaolai/Xiaolai-Regular-774d4f764a1299da5d28ec2f2ffe0d69.woff2",iR="./fonts/Xiaolai/Xiaolai-Regular-7718fe60986d8b42b1be9c5ace5ccf25.woff2",rR="./fonts/Xiaolai/Xiaolai-Regular-aa5c9ca6cf4fba00433b7aa3fa10671a.woff2",sR="./fonts/Xiaolai/Xiaolai-Regular-4f50e5136e136527280bc902c5817561.woff2",lR="./fonts/Xiaolai/Xiaolai-Regular-093b9ef39a46ceae95a1df18a0a3a326.woff2",oR="./fonts/Xiaolai/Xiaolai-Regular-a0ca5df4258213d7fc9fce80f65ce760.woff2",cR="./fonts/Xiaolai/Xiaolai-Regular-d2666cbed13462c5dc36fa2f15c202ca.woff2",dR="./fonts/Xiaolai/Xiaolai-Regular-1e6fd68f1f3902ce48ce8c69df385622.woff2",uR="./fonts/Xiaolai/Xiaolai-Regular-87599f94b6cc129d505b375798d0d751.woff2",fR="./fonts/Xiaolai/Xiaolai-Regular-06c77b8c66e51ed6c63ccb502dd8b8af.woff2",hR="./fonts/Xiaolai/Xiaolai-Regular-13ae07ed2e272d26d59bc0691cd7117a.woff2",pR="./fonts/Xiaolai/Xiaolai-Regular-353f33792a8f60dc69323ddf635a269e.woff2",UR="./fonts/Xiaolai/Xiaolai-Regular-0facdf1ea213ba40261022f5d5ed4493.woff2",mR="./fonts/Xiaolai/Xiaolai-Regular-f8ee5d36068a42b51d0e4a1116cfcec1.woff2",gR="./fonts/Xiaolai/Xiaolai-Regular-79d494361ae093b69e74ee9dbe65bfd4.woff2",bR="./fonts/Xiaolai/Xiaolai-Regular-74e2263a91439c25b91d5132ce9f4d62.woff2",vR="./fonts/Xiaolai/Xiaolai-Regular-ee8bae97908d5147b423f77ad0d3c1bb.woff2",xR="./fonts/Xiaolai/Xiaolai-Regular-56467a5c8840c4d23a60b2f935114848.woff2",yR="./fonts/Xiaolai/Xiaolai-Regular-145aa02cdd91946e67dc934e1acffe75.woff2",wR="./fonts/Xiaolai/Xiaolai-Regular-54acdfc2166ad7fcbd074f75fd4a56ba.woff2",ER="./fonts/Xiaolai/Xiaolai-Regular-29cec36cd205b211da97acabaa62f055.woff2",SR="./fonts/Xiaolai/Xiaolai-Regular-3756e81d3e149cf6099163ee79944fec.woff2",CR="./fonts/Xiaolai/Xiaolai-Regular-8e9f97f01034820170065b2921b4fb5e.woff2",kR="./fonts/Xiaolai/Xiaolai-Regular-13d2887ec8ee73c43acdabc52a05af7b.woff2",MR="./fonts/Xiaolai/Xiaolai-Regular-72536a3d71b694a0d53dd90ddceae41e.woff2",IR="./fonts/Xiaolai/Xiaolai-Regular-603aefd23e350ba7eb124273e3c9bcf1.woff2",TR="./fonts/Xiaolai/Xiaolai-Regular-095c169f3314805276f603a362766abd.woff2",_R="./fonts/Xiaolai/Xiaolai-Regular-9544732d2e62d1a429674f8ee41b5d3a.woff2",jR="./fonts/Xiaolai/Xiaolai-Regular-d3716376641d615e2995605b29bca7b6.woff2",AR="./fonts/Xiaolai/Xiaolai-Regular-5a1ce3117cfe90c48e8fb4a9a00f694d.woff2",RR="./fonts/Xiaolai/Xiaolai-Regular-b7d203b051eff504ff59ddca7576b6a9.woff2",LR="./fonts/Xiaolai/Xiaolai-Regular-4a38cc3e9cf104e69ba246d37f8cf135.woff2",DR="./fonts/Xiaolai/Xiaolai-Regular-982b630266d87db93d2539affb1275c6.woff2",PR="./fonts/Xiaolai/Xiaolai-Regular-9592bfc861f07bcb8d75c196b370e548.woff2",NR="./fonts/Xiaolai/Xiaolai-Regular-a7accba310e821da5505f71c03b76bdb.woff2",OR="./fonts/Xiaolai/Xiaolai-Regular-dac48066b5883d8b4551fc584f0c2a3e.woff2",$R="./fonts/Xiaolai/Xiaolai-Regular-a1f916d6039285c4ffb900cd654e418f.woff2",FR="./fonts/Xiaolai/Xiaolai-Regular-95bfd249da4902577b4b7d76ebdd0b44.woff2",zR="./fonts/Xiaolai/Xiaolai-Regular-93fc8f28a33234bcadf1527cafabd502.woff2",BR="./fonts/Xiaolai/Xiaolai-Regular-903bb6865f3452e2fda42e3a25547bc5.woff2",HR="./fonts/Xiaolai/Xiaolai-Regular-4aca6a43e59aceee2166b0c7e4e85ef1.woff2",XR="./fonts/Xiaolai/Xiaolai-Regular-24476a126f129212beb33f66853ea151.woff2",WR="./fonts/Xiaolai/Xiaolai-Regular-1b611157cd46bb184d4fa4dae2d6a2b8.woff2",VR="./fonts/Xiaolai/Xiaolai-Regular-56a32a7689abd0326e57c10c6c069bb4.woff2",GR="./fonts/Xiaolai/Xiaolai-Regular-3cc70dbb64df5b21f1326cc24dee2195.woff2",YR="./fonts/Xiaolai/Xiaolai-Regular-f6032fc06eb20480f096199713f70885.woff2",ZR="./fonts/Xiaolai/Xiaolai-Regular-e2ead7ea7da0437f085f42ffc05f8d13.woff2",KR="./fonts/Xiaolai/Xiaolai-Regular-97f7f48ce90c9429bf32ae51469db74d.woff2",qR="./fonts/Xiaolai/Xiaolai-Regular-24a21c1e4449222e8d1898d69ff3a404.woff2",JR="./fonts/Xiaolai/Xiaolai-Regular-726303e0774b4e678bff8c2deb6ca603.woff2",QR="./fonts/Xiaolai/Xiaolai-Regular-5a7fac4b8b23a6e4e5ba0c9bf1756c91.woff2",eL="./fonts/Xiaolai/Xiaolai-Regular-2b7441d46298788ac94e610ffcc709b6.woff2",tL=[{uri:o_,descriptors:{unicodeRange:"U+f9b8-fa6d,U+fe32,U+fe45-fe4f,U+ff02-ff0b,U+ff0d-ff1e,U+ff20-ff2a"}},{uri:c_,descriptors:{unicodeRange:"U+20dd-20de,U+25ef,U+ff2b-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd7,U+ffda-ffdc,U+ffe0-ffe6,U+ffe8-ffee"}},{uri:d_,descriptors:{unicodeRange:"U+d7eb-d7fb,U+f900-f9b7"}},{uri:u_,descriptors:{unicodeRange:"U+d6f2-d7a3,U+d7b0-d7c6,U+d7cb-d7ea"}},{uri:f_,descriptors:{unicodeRange:"U+d609-d6f1"}},{uri:h_,descriptors:{unicodeRange:"U+d520-d608"}},{uri:p_,descriptors:{unicodeRange:"U+d437-d51f"}},{uri:U_,descriptors:{unicodeRange:"U+d34e-d436"}},{uri:m_,descriptors:{unicodeRange:"U+d265-d34d"}},{uri:g_,descriptors:{unicodeRange:"U+d17c-d264"}},{uri:b_,descriptors:{unicodeRange:"U+d093-d17b"}},{uri:v_,descriptors:{unicodeRange:"U+cfaa-d092"}},{uri:x_,descriptors:{unicodeRange:"U+cec1-cfa9"}},{uri:y_,descriptors:{unicodeRange:"U+cdd8-cec0"}},{uri:w_,descriptors:{unicodeRange:"U+ccf1-cdd7"}},{uri:E_,descriptors:{unicodeRange:"U+cc08-ccf0"}},{uri:S_,descriptors:{unicodeRange:"U+cb43-cc07"}},{uri:C_,descriptors:{unicodeRange:"U+ca83-cb42"}},{uri:k_,descriptors:{unicodeRange:"U+c9a1-ca82"}},{uri:M_,descriptors:{unicodeRange:"U+c8b8-c9a0"}},{uri:I_,descriptors:{unicodeRange:"U+c7cf-c8b7"}},{uri:T_,descriptors:{unicodeRange:"U+c6e6-c7ce"}},{uri:__,descriptors:{unicodeRange:"U+c5fd-c6e5"}},{uri:j_,descriptors:{unicodeRange:"U+c514-c5fc"}},{uri:A_,descriptors:{unicodeRange:"U+c42b-c513"}},{uri:R_,descriptors:{unicodeRange:"U+c341-c34e,U+c350-c42a"}},{uri:L_,descriptors:{unicodeRange:"U+c258-c340"}},{uri:D_,descriptors:{unicodeRange:"U+c16f-c257"}},{uri:P_,descriptors:{unicodeRange:"U+c086-c16e"}},{uri:N_,descriptors:{unicodeRange:"U+bf9d-c085"}},{uri:O_,descriptors:{unicodeRange:"U+beb4-bf9c"}},{uri:$_,descriptors:{unicodeRange:"U+bdcb-beb3"}},{uri:F_,descriptors:{unicodeRange:"U+bce2-bdca"}},{uri:z_,descriptors:{unicodeRange:"U+bbf9-bce1"}},{uri:B_,descriptors:{unicodeRange:"U+bb10-bbf8"}},{uri:H_,descriptors:{unicodeRange:"U+ba27-bb0f"}},{uri:X_,descriptors:{unicodeRange:"U+b93e-ba26"}},{uri:W_,descriptors:{unicodeRange:"U+b855-b93d"}},{uri:V_,descriptors:{unicodeRange:"U+b76c-b854"}},{uri:G_,descriptors:{unicodeRange:"U+b683-b76b"}},{uri:Y_,descriptors:{unicodeRange:"U+b59a-b682"}},{uri:Z_,descriptors:{unicodeRange:"U+b4b1-b599"}},{uri:K_,descriptors:{unicodeRange:"U+11fb-11ff,U+b3cd-b4b0"}},{uri:q_,descriptors:{unicodeRange:"U+11e6-11fa,U+b2f9-b3cc"}},{uri:J_,descriptors:{unicodeRange:"U+11d1-11e5,U+b225-b2f8"}},{uri:Q_,descriptors:{unicodeRange:"U+11bc-11d0,U+b151-b224"}},{uri:ej,descriptors:{unicodeRange:"U+11a7-11bb,U+b07d-b150"}},{uri:tj,descriptors:{unicodeRange:"U+1191-11a6,U+afaa-b07c"}},{uri:nj,descriptors:{unicodeRange:"U+117c-1190,U+aed6-afa9"}},{uri:aj,descriptors:{unicodeRange:"U+1167-117b,U+ae02-aed5"}},{uri:ij,descriptors:{unicodeRange:"U+1152-115e,U+1160-1166,U+ad2d-ae01"}},{uri:rj,descriptors:{unicodeRange:"U+113d-1151,U+ac59-ad2c"}},{uri:sj,descriptors:{unicodeRange:"U+1100-113c,U+9f95-9f98,U+9f9c-9f9e,U+9fa1-9fce,U+9fd0,U+a960-a97c,U+ac00-ac58"}},{uri:lj,descriptors:{unicodeRange:"U+9771-9772,U+9775,U+9777-977b,U+977d-9784,U+9786-978a,U+978c,U+978e-9790,U+9793,U+9795-9797,U+9799-979f,U+97a1-97a2,U+97a4-97aa,U+97ac,U+97ae,U+97b0-97b1,U+97b3,U+97b5-97e5,U+97e8,U+97ee-97f2,U+97f4,U+97f7-982d"}},{uri:oj,descriptors:{unicodeRange:"U+9491,U+9496,U+9498,U+94c7,U+94cf,U+94d3-94d4,U+94da,U+94e6,U+94fb,U+951c,U+9520,U+9527,U+9533,U+953d,U+9543,U+9548,U+954b,U+9555,U+955a,U+9560,U+956e,U+9574-9575,U+9577-957e,U+9580-95e7,U+95ec,U+95ff,U+9607,U+9613,U+9618,U+961b,U+961e,U+9620,U+9623-9629,U+962b-962d,U+962f-9630,U+9637-963a,U+963e,U+9641,U+9643,U+964a,U+964e-964f,U+9651-9653,U+9656-965a,U+965c-965e,U+9660,U+9663,U+9665-9666,U+966b,U+966d-9671,U+9673,U+9678-9684,U+9687,U+9689-968a,U+968c,U+968e,U+9691-9693"}},{uri:cj,descriptors:{unicodeRange:"U+923c-9273,U+9275-928d,U+928f-92ad,U+92af-92c7,U+92c9-92ee"}},{uri:dj,descriptors:{unicodeRange:"U+9159,U+915b-915c,U+915f-9160,U+9166-9168,U+916b,U+916d,U+9173,U+917a-917c,U+9180-9184,U+9186,U+9188,U+918a,U+918e-918f,U+9193-9199,U+919c-91a1,U+91a4-91a9,U+91ab-91ac,U+91b0-91b3,U+91b6-91b9,U+91bb-91c6,U+91c8,U+91cb,U+91d0,U+91d2-91db,U+91dd-923b"}},{uri:uj,descriptors:{unicodeRange:"U+902b-902c,U+9030-9034,U+9037,U+9039-903a,U+903d,U+903f-9040,U+9043,U+9045-9046,U+9048-904c,U+904e,U+9054-9056,U+9059-905a,U+905c-9061,U+9064,U+9066-9067,U+9069-906c,U+906f-9073,U+9076-907c,U+907e,U+9081,U+9084-9087,U+9089-908a,U+908c-9090,U+9092,U+9094,U+9096,U+9098,U+909a,U+909c,U+909e-90a0,U+90a4-90a5,U+90a7-90a9,U+90ab,U+90ad,U+90b2,U+90b7,U+90bc-90bd,U+90bf-90c0,U+90c2-90c3,U+90c6,U+90c8-90c9,U+90cb-90cd,U+90d2,U+90d4-90d6,U+90d8-90da,U+90de-90e0,U+90e3-90e5,U+90e9-90ea,U+90ec,U+90ee,U+90f0-90f3,U+90f5-90f7,U+90f9-90fc,U+90ff-9101,U+9103,U+9105-9118,U+911a-911d,U+911f-9121,U+9124-912e,U+9130,U+9132-9138,U+913a-9142,U+9144-9145,U+9147-9148,U+9151,U+9153-9156,U+9158"}},{uri:fj,descriptors:{unicodeRange:"U+8f03-8f65,U+8f6a,U+8f80,U+8f8c,U+8f92,U+8f9d,U+8fa0-8fa2,U+8fa4-8fa7,U+8faa,U+8fac-8faf,U+8fb2-8fb5,U+8fb7-8fb8,U+8fba-8fbc,U+8fbf-8fc0,U+8fc3,U+8fc6,U+8fc9-8fcd,U+8fcf,U+8fd2,U+8fd6-8fd7,U+8fda,U+8fe0-8fe1,U+8fe3,U+8fe7,U+8fec,U+8fef,U+8ff1-8ff2,U+8ff4-8ff6,U+8ffa-8ffc,U+8ffe-8fff,U+9007-9008,U+900c,U+900e,U+9013,U+9015,U+9018-9019,U+901c,U+9023-9025,U+9027-902a"}},{uri:hj,descriptors:{unicodeRange:"U+8d03-8d1c,U+8d20,U+8d51-8d52,U+8d57,U+8d5f,U+8d65,U+8d68-8d6a,U+8d6c,U+8d6e-8d6f,U+8d71-8d72,U+8d78-8d80,U+8d82-8d83,U+8d86-8d89,U+8d8c-8d90,U+8d92-8d93,U+8d95-8d9e,U+8da0-8da2,U+8da4-8db0,U+8db2,U+8db6-8db7,U+8db9,U+8dbb,U+8dbd,U+8dc0-8dc2,U+8dc5,U+8dc7-8dca,U+8dcd,U+8dd0,U+8dd2-8dd5,U+8dd8-8dd9,U+8ddc,U+8de0-8de2,U+8de5-8de7,U+8de9,U+8ded-8dee,U+8df0-8df2,U+8df4,U+8df6,U+8dfc,U+8dfe-8e04,U+8e06-8e08,U+8e0b,U+8e0d-8e0e,U+8e10-8e13,U+8e15-8e1c,U+8e20-8e21,U+8e24-8e28,U+8e2b,U+8e2d,U+8e30,U+8e32-8e34,U+8e36-8e38,U+8e3b-8e3c,U+8e3e-8e3f,U+8e43,U+8e45-8e46"}},{uri:pj,descriptors:{unicodeRange:"U+8bea,U+8c09,U+8c1e,U+8c38-8c40,U+8c42-8c45,U+8c48,U+8c4a-8c4b,U+8c4d-8c54,U+8c56-8c59,U+8c5b-8c60,U+8c63-8c69,U+8c6c-8c72,U+8c74-8c77,U+8c7b-8c81,U+8c83-8c84,U+8c86-8c88,U+8c8b,U+8c8d-8c93,U+8c95-8c97,U+8c99-8d02"}},{uri:Uj,descriptors:{unicodeRange:"U+8a64-8a78,U+8a7a-8a88,U+8a8b-8a92,U+8a94-8b06,U+8b08-8b1b"}},{uri:mj,descriptors:{unicodeRange:"U+8987-89c0,U+89c3,U+89cd,U+89d3-89d5,U+89d7-89d9,U+89db,U+89dd,U+89df-89e2,U+89e4,U+89e7-89ea,U+89ec-89ee,U+89f0-89f2,U+89f4-89ff,U+8a01-8a06,U+8a08-8a3d,U+8a3f-8a47,U+8a49-8a63"}},{uri:gj,descriptors:{unicodeRange:"U+87e3-87e4,U+87e6-87e9,U+87eb-87ed,U+87ef-87f8,U+87fa-87fd,U+87ff-8802,U+8804-8809,U+880b-8812,U+8814,U+8817-881a,U+881c-8820,U+8823-8831,U+8833-8838,U+883a-883b,U+883d-883f,U+8841-8843,U+8846-884b,U+884e-8853,U+8855-8856,U+8858,U+885a-8860,U+8866-8867,U+886a,U+886d,U+886f,U+8871,U+8873-8876,U+8878-887c,U+8880,U+8883,U+8886-8887,U+8889-888a,U+888c,U+888e-8891,U+8893-8895,U+8897-889b,U+889d-88a1,U+88a3,U+88a5-88aa,U+88ac,U+88ae-88b0,U+88b2-88b6,U+88b8-88bb"}},{uri:bj,descriptors:{unicodeRange:"U+86e7-86e8,U+86ea-86ec,U+86ef,U+86f5-86f7,U+86fa-86fd,U+86ff,U+8701,U+8704-8706,U+870b-870c,U+870e-8711,U+8714,U+8716,U+8719,U+871b,U+871d,U+871f-8720,U+8724,U+8726-8728,U+872a-872d,U+872f-8730,U+8732-8733,U+8735-8736,U+8738-873a,U+873c-873d,U+8740-8746,U+874a-874b,U+874d,U+874f-8752,U+8754-8756,U+8758,U+875a-875f,U+8761-8762,U+8766-876d,U+876f,U+8771-8773,U+8775,U+8777-877a,U+877f-8781,U+8784,U+8786-8787,U+8789-878a,U+878c,U+878e-8792,U+8794-8796,U+8798-879e,U+87a0-87a7,U+87a9-87aa,U+87ae,U+87b0-87b2,U+87b4,U+87b6-87b9,U+87bb-87bc,U+87be-87bf,U+87c1-87c5,U+87c7-87c9,U+87cc-87d0,U+87d4-87da,U+87dc-87df,U+87e1-87e2"}},{uri:vj,descriptors:{unicodeRange:"U+8604,U+8606-8610,U+8612-8615,U+8617-8626,U+8628,U+862a-8637,U+8639-863b,U+863d-864c,U+8652-8653,U+8655-8659,U+865b-865d,U+865f-8661,U+8663-866a,U+866d,U+866f-8670,U+8672-8678,U+8683-8689,U+868e-8692,U+8694,U+8696-869b,U+869e-86a2,U+86a5-86a6,U+86ab,U+86ad-86ae,U+86b2-86b3,U+86b7-86b9,U+86bb-86bf,U+86c1-86c3,U+86c5,U+86c8,U+86cc-86cd,U+86d2-86d3,U+86d5-86d7,U+86da,U+86dc-86dd,U+86e0-86e3,U+86e5-86e6"}},{uri:xj,descriptors:{unicodeRange:"U+8456,U+8458,U+845d-8460,U+8462,U+8464-8468,U+846a,U+846e-8470,U+8472,U+8474,U+8477,U+8479,U+847b-8481,U+8483-8486,U+848a,U+848d,U+848f-8496,U+8498,U+849a-849b,U+849d-84a0,U+84a2-84ae,U+84b0-84b1,U+84b3,U+84b5-84b7,U+84bb-84bc,U+84be,U+84c0,U+84c2-84c3,U+84c5-84c8,U+84cb-84cc,U+84ce-84cf,U+84d2,U+84d4-84d5,U+84d7-84dc,U+84de,U+84e1-84e2,U+84e4,U+84e7-84eb,U+84ed-84ef,U+84f1-84fb,U+84fd-84fe,U+8500-850b,U+850d-8510,U+8512,U+8514-8516,U+8518-8519,U+851b-851e,U+8520,U+8522-852a,U+852d-8536,U+853e-8542,U+8544-8547,U+854b-854f"}},{uri:yj,descriptors:{unicodeRange:"U+82c2-82c3,U+82c5-82c6,U+82c9,U+82d0,U+82d6,U+82d9-82da,U+82dd,U+82e2,U+82e7-82ea,U+82ec-82ee,U+82f0,U+82f2-82f3,U+82f5-82f6,U+82f8,U+82fa,U+82fc-8300,U+830a-830b,U+830d,U+8310,U+8312-8313,U+8316,U+8318-8319,U+831d-8326,U+8329-832a,U+832e,U+8330,U+8332,U+8337,U+833b,U+833d-833f,U+8341-8342,U+8344-8345,U+8348,U+834a-834e,U+8353,U+8355-8359,U+835d,U+8362,U+8370-8376,U+8379-837a,U+837e-8384,U+8387-8388,U+838a-838d,U+838f-8391,U+8394-8397,U+8399-839a,U+839d,U+839f,U+83a1-83a7,U+83ac-83af,U+83b5,U+83bb,U+83be-83bf,U+83c2-83c4,U+83c6,U+83c8-83c9,U+83cb,U+83cd-83ce,U+83d0-83d3,U+83d5,U+83d7,U+83d9-83db,U+83de,U+83e2-83e4,U+83e6-83e8,U+83eb-83ef,U+83f3-83f7,U+83fa-83fc,U+83fe-8400,U+8402,U+8405,U+8407-840a,U+8410,U+8412-8417,U+8419-841b,U+841e-8423,U+8429-8430,U+8432-8437,U+8439-843b,U+843e-8445,U+8447-8450,U+8452-8455"}},{uri:wj,descriptors:{unicodeRange:"U+81a4-81a5,U+81a7,U+81a9,U+81ab-81b2,U+81b4-81b9,U+81bc-81bf,U+81c4-81c5,U+81c7-81c9,U+81cb,U+81cd-81e2,U+81e4-81e6,U+81e8-81e9,U+81eb,U+81ee-81f2,U+81f5-81fa,U+81fd,U+81ff,U+8203,U+8207-820b,U+820e-820f,U+8211,U+8213,U+8215-821a,U+821d,U+8220,U+8224-8227,U+8229,U+822e,U+8232,U+823a,U+823c-823d,U+823f-8243,U+8245-8246,U+8248,U+824a,U+824c-824e,U+8250-8257,U+8259,U+825b-825e,U+8260-8267,U+8269-826d,U+8271,U+8275-8278,U+827b-827c,U+8280-8281,U+8283,U+8285-8287,U+8289,U+828c,U+8290,U+8293-8296,U+829a-829b,U+829e,U+82a0,U+82a2-82a3,U+82a7,U+82b2,U+82b5-82b6,U+82ba-82bc,U+82bf-82c0"}},{uri:Ej,descriptors:{unicodeRange:"U+8059,U+805b-8068,U+806b-8070,U+8072-807e,U+8081-8082,U+8085,U+8088,U+808a,U+808d-8092,U+8094-8095,U+8097,U+8099,U+809e,U+80a3,U+80a6-80a8,U+80ac,U+80b0,U+80b3,U+80b5-80b6,U+80b8-80b9,U+80bb,U+80c5,U+80c7-80cb,U+80cf-80d5,U+80d8,U+80df-80e0,U+80e2-80e3,U+80e6,U+80ee,U+80f5,U+80f7,U+80f9,U+80fb,U+80fe-8101,U+8103-8105,U+8107-8108,U+810b-810c,U+8115,U+8117,U+8119,U+811b-811d,U+811f-812b,U+812d-812e,U+8130,U+8133-8135,U+8137,U+8139-813d,U+813f-8145,U+8147,U+8149,U+814d-814f,U+8152,U+8156-8158,U+815b-815f,U+8161-8164,U+8166,U+8168,U+816a-816c,U+816f,U+8172-8173,U+8175-8178,U+8181,U+8183-8187,U+8189,U+818b-818e,U+8190,U+8192-8197,U+8199-819a,U+819e-81a2"}},{uri:Sj,descriptors:{unicodeRange:"U+7f3c-7f41,U+7f43,U+7f46-7f4f,U+7f52-7f53,U+7f56,U+7f59,U+7f5b-7f5e,U+7f60,U+7f63-7f67,U+7f6b-7f6d,U+7f6f-7f70,U+7f73,U+7f75-7f78,U+7f7a-7f7d,U+7f7f-7f80,U+7f82-7f89,U+7f8b,U+7f8d,U+7f8f-7f93,U+7f95-7f99,U+7f9b-7f9c,U+7fa0,U+7fa2-7fa3,U+7fa5-7fa6,U+7fa8-7fae,U+7fb1,U+7fb3-7fb7,U+7fba-7fbb,U+7fbe,U+7fc0,U+7fc2-7fc4,U+7fc6-7fc9,U+7fcb,U+7fcd,U+7fcf-7fd3,U+7fd6-7fd7,U+7fd9-7fde,U+7fe2-7fe4,U+7fe7-7fe8,U+7fea-7fed,U+7fef,U+7ff2,U+7ff4-7ffa,U+7ffd-7fff,U+8002,U+8007-800a,U+800e-800f,U+8011,U+8013,U+801a-801b,U+801d-801f,U+8021,U+8023-8024,U+802b-8030,U+8032,U+8034,U+8039-803a,U+803c,U+803e,U+8040-8041,U+8044-8045,U+8047-8049,U+804e-8051,U+8053,U+8055-8057"}},{uri:Cj,descriptors:{unicodeRange:"U+7cd8,U+7cda-7cdb,U+7cdd-7cde,U+7ce1-7ce7,U+7ce9-7cee,U+7cf0-7cf7,U+7cf9-7cfa,U+7cfc-7d09,U+7d0b-7d1f,U+7d21,U+7d23-7d26,U+7d28-7d2a,U+7d2c-7d2e,U+7d30-7d6d,U+7d6f-7d76,U+7d78-7d94"}},{uri:kj,descriptors:{unicodeRange:"U+7afe,U+7b00-7b02,U+7b05,U+7b07,U+7b09,U+7b0c-7b0e,U+7b10,U+7b12-7b13,U+7b16-7b18,U+7b1a,U+7b1c-7b1d,U+7b1f,U+7b21-7b23,U+7b27,U+7b29,U+7b2d,U+7b2f-7b30,U+7b32,U+7b34-7b37,U+7b39,U+7b3b,U+7b3d,U+7b3f-7b44,U+7b46,U+7b48,U+7b4a,U+7b4d-7b4e,U+7b53,U+7b55,U+7b57,U+7b59,U+7b5c,U+7b5e-7b5f,U+7b61,U+7b63-7b6d,U+7b6f-7b70,U+7b73-7b74,U+7b76,U+7b78,U+7b7a,U+7b7c-7b7d,U+7b7f,U+7b81-7b84,U+7b86-7b8c,U+7b8e-7b8f,U+7b91-7b93,U+7b96,U+7b98-7b9b,U+7b9e-7ba0,U+7ba3-7ba5,U+7bae-7bb0,U+7bb2-7bb3,U+7bb5-7bb7,U+7bb9-7bc0,U+7bc2-7bc5,U+7bc8-7bcb,U+7bcd-7bd0,U+7bd2,U+7bd4-7bd8,U+7bdb-7bdc,U+7bde-7be0,U+7be2-7be4,U+7be7-7be9,U+7beb-7bed,U+7bef-7bf0,U+7bf2-7bf6,U+7bf8-7bfb,U+7bfd,U+7bff-7c06,U+7c08-7c0a,U+7c0d-7c0e,U+7c10-7c13"}},{uri:Mj,descriptors:{unicodeRange:"U+7a10-7a13,U+7a15-7a16,U+7a18-7a19,U+7a1b-7a1d,U+7a1f,U+7a21-7a22,U+7a24-7a32,U+7a34-7a36,U+7a38,U+7a3a,U+7a3e,U+7a40-7a45,U+7a47-7a50,U+7a52-7a56,U+7a58-7a6f,U+7a71-7a73,U+7a75,U+7a7b-7a7e,U+7a82,U+7a85,U+7a87,U+7a89-7a8c,U+7a8e-7a90,U+7a93-7a94,U+7a99-7a9b,U+7a9e,U+7aa1-7aa4,U+7aa7,U+7aa9-7aab,U+7aae-7ab2,U+7ab4-7abe,U+7ac0-7aca,U+7acc-7ad5,U+7ad7-7ad8,U+7ada-7add,U+7ae1-7ae2,U+7ae4,U+7ae7-7aec,U+7aee,U+7af0-7af8,U+7afb-7afc"}},{uri:Ij,descriptors:{unicodeRange:"U+790d-7912,U+7914-791d,U+791f-7923,U+7925-7933,U+7935-7939,U+793d,U+793f,U+7942-7945,U+7947,U+794a-7952,U+7954-7955,U+7958-7959,U+7961,U+7963-7964,U+7966,U+7969-796c,U+796e,U+7970-7976,U+7979,U+797b-797f,U+7982-7983,U+7986-7989,U+798b-798e,U+7990-7999,U+799b-79a6,U+79a8-79b2,U+79b4-79b8,U+79bc,U+79bf,U+79c2,U+79c4-79c5,U+79c7-79c8,U+79ca,U+79cc,U+79ce-79d0,U+79d3-79d4,U+79d6-79d7,U+79d9-79de,U+79e0-79e2,U+79e5,U+79e8,U+79ea,U+79ec,U+79ee,U+79f1-79f7,U+79f9-79fa,U+79fc,U+79fe-79ff,U+7a01,U+7a04-7a05,U+7a07-7a0a,U+7a0c,U+7a0f"}},{uri:Tj,descriptors:{unicodeRange:"U+77d8-77da,U+77dd-77e1,U+77e4,U+77e6,U+77e8,U+77ea,U+77ef-77f2,U+77f4-77f5,U+77f7,U+77f9-77fc,U+7803-7808,U+780a-780b,U+780e-7810,U+7813,U+7815,U+7819,U+781b,U+781e,U+7820-7822,U+7824,U+7828,U+782a-782b,U+782e-782f,U+7831-7833,U+7835-7836,U+783d,U+783f,U+7841-7844,U+7846,U+7848-784b,U+784d,U+784f,U+7851,U+7853-7854,U+7858-785c,U+785e-7869,U+786f-7876,U+7878-787b,U+787d-7886,U+7888,U+788a-788b,U+788f-7890,U+7892,U+7894-7896,U+7899,U+789d-789e,U+78a0,U+78a2,U+78a4,U+78a6,U+78a8-78af,U+78b5-78b8,U+78ba-78bd,U+78bf-78c0,U+78c2-78c4,U+78c6-78c8,U+78cc-78cf,U+78d1-78d3,U+78d6-78d8,U+78da-78e7,U+78e9-78eb,U+78ed-78f1,U+78f3,U+78f5-78f6,U+78f8-78f9,U+78fb-7900,U+7902-7904,U+7906-790c"}},{uri:_j,descriptors:{unicodeRange:"U+76af-76b0,U+76b3,U+76b5-76be,U+76c0-76c1,U+76c3-76c4,U+76c7,U+76c9,U+76cb-76cc,U+76d3,U+76d5,U+76d9-76da,U+76dc-76de,U+76e0-76e4,U+76e6-76ed,U+76f0,U+76f3,U+76f5-76f7,U+76fa-76fb,U+76fd,U+76ff-7703,U+7705-7706,U+770a,U+770c,U+770e-7718,U+771b-771e,U+7721,U+7723-7725,U+7727,U+772a-772c,U+772e,U+7730-7734,U+7739,U+773b,U+773d-773f,U+7742,U+7744-7746,U+7748-774f,U+7752-7759,U+775c-7760,U+7764,U+7767,U+7769-776a,U+776d-7778,U+777a-777c,U+7781-7783,U+7786-778b,U+778f-7790,U+7793-779e,U+77a1,U+77a3-77a4,U+77a6,U+77a8,U+77ab,U+77ad-77af,U+77b1-77b2,U+77b4,U+77b6-77ba,U+77bc,U+77be,U+77c0-77cc,U+77ce-77d6"}},{uri:jj,descriptors:{unicodeRange:"U+7589-758a,U+758c-758e,U+7590,U+7593,U+7595,U+7598,U+759b-759c,U+759e,U+75a2,U+75a6-75aa,U+75ad,U+75b6-75b7,U+75ba-75bb,U+75bf-75c1,U+75c6,U+75cb-75cc,U+75ce-75d1,U+75d3,U+75d7,U+75d9-75da,U+75dc-75dd,U+75df-75e1,U+75e5,U+75e9,U+75ec-75ef,U+75f2-75f3,U+75f5-75f8,U+75fa-75fb,U+75fd-75fe,U+7602,U+7604,U+7606-7609,U+760b,U+760d-760f,U+7611-7614,U+7616,U+761a,U+761c-761e,U+7621,U+7623,U+7627-7628,U+762c,U+762e-762f,U+7631-7632,U+7636-7637,U+7639-763b,U+763d,U+7641-7642,U+7644-764b,U+764e-7653,U+7655,U+7657-765b,U+765d,U+765f-7662,U+7664-766a,U+766c-766e,U+7670-7677,U+7679-767a,U+767c,U+767f-7681,U+7683,U+7685,U+7689-768a,U+768c-768d,U+768f-7690,U+7692,U+7694-7695,U+7697-7698,U+769a-76a3,U+76a5-76ad"}},{uri:Aj,descriptors:{unicodeRange:"U+7492-749b,U+749d,U+749f-74a6,U+74aa-74b9,U+74bb-74d1,U+74d3-74db,U+74dd,U+74df,U+74e1,U+74e5,U+74e7-74ed,U+74f0-74f3,U+74f5,U+74f8-74fe,U+7500-7503,U+7505-750c,U+750e,U+7510,U+7512,U+7514-7517,U+751b,U+751d-751e,U+7520-7524,U+7526-7527,U+752a,U+752e,U+7534,U+7536,U+7539,U+753c-753d,U+753f,U+7541-7544,U+7546-7547,U+7549-754a,U+754d,U+7550-7553,U+7555-7558,U+755d-7564,U+7567-7569,U+756b-7571,U+7573,U+7575-7577,U+757a-757e,U+7580-7582,U+7584-7585,U+7587-7588"}},{uri:Rj,descriptors:{unicodeRange:"U+7372-737d,U+737f-7383,U+7385-7386,U+7388,U+738a,U+738c-738d,U+738f-7390,U+7392-7395,U+7397-739a,U+739c-739e,U+73a0-73a1,U+73a3-73a8,U+73aa,U+73ac-73ad,U+73b1,U+73b4-73b6,U+73b8-73b9,U+73bc-73bf,U+73c1,U+73c3-73c7,U+73cb-73cc,U+73ce,U+73d2-73d8,U+73da-73dd,U+73df,U+73e1-73e4,U+73e6,U+73e8,U+73ea-73ec,U+73ee-73f1,U+73f3-7402,U+7404,U+7407-7408,U+740b-740e,U+7411-7419,U+741c-7421,U+7423-7424,U+7427,U+7429,U+742b,U+742d,U+742f,U+7431-7432,U+7437-743b,U+743d-7440,U+7442-7454,U+7456,U+7458,U+745d,U+7460-746c,U+746e-746f,U+7471-7475,U+7478-747d,U+747f,U+7482,U+7484-7486,U+7488-748a,U+748c-748d,U+748f,U+7491"}},{uri:Lj,descriptors:{unicodeRange:"U+7054-705d,U+705f-706a,U+706e,U+7071-7074,U+7077,U+7079-707b,U+707d,U+7081-7084,U+7086-7088,U+708b-708d,U+708f-7091,U+7093,U+7097-7098,U+709a-709b,U+709e-70aa,U+70b0,U+70b2,U+70b4-70b6,U+70ba,U+70be-70bf,U+70c4-70c7,U+70c9,U+70cb-70d7,U+70da,U+70dc-70de,U+70e0-70e3,U+70e5,U+70ea,U+70ee,U+70f0-70f6,U+70f8,U+70fa-70fc,U+70fe-7108,U+710b-710f,U+7111-7112,U+7114,U+7117,U+711b-7125,U+7127-712e,U+7132-7135,U+7137-7144,U+7146-7149,U+714b,U+714d,U+714f-715b,U+715d,U+715f-7163,U+7165,U+7169-716d,U+716f-7171,U+7174-7177"}},{uri:Dj,descriptors:{unicodeRange:"U+722e-722f,U+7232-7234,U+723a,U+723c,U+723e,U+7240-7246,U+7249-724b,U+724e-7251,U+7253-7255,U+7257-7258,U+725a,U+725c,U+725e,U+7260,U+7263-7265,U+7268,U+726a-726d,U+7270-7271,U+7273-7274,U+7276-7278,U+727b-727d,U+7282-7283,U+7285-7289,U+728c,U+728e,U+7290-7291,U+7293-729e,U+72a0-72ab,U+72ae,U+72b1-72b3,U+72b5,U+72ba-72c0,U+72c5-72c7,U+72c9-72cc,U+72cf,U+72d1,U+72d3-72d6,U+72d8,U+72da-72dd,U+72df,U+72e2-72e7,U+72ea-72eb,U+72f5-72f6,U+72f9,U+72fd-7300,U+7302,U+7304-7309,U+730b-730d,U+730f-7312,U+7314,U+7318-731a,U+731f-7320,U+7323-7324,U+7326-7328,U+732d,U+732f-7330,U+7332-7333,U+7335-7336,U+733a-733d,U+7340-734c,U+734e-734f,U+7351,U+7353-7356,U+7358-735f,U+7361-736b,U+736e,U+7370-7371"}},{uri:Pj,descriptors:{unicodeRange:"U+6ec5-6ec6,U+6ec8-6eca,U+6ecc-6ece,U+6ed0,U+6ed2,U+6ed6,U+6ed8-6ed9,U+6edb-6edd,U+6ee3,U+6ee7,U+6eea-6ef3,U+6ef5-6ef8,U+6efa-6f01,U+6f03-6f05,U+6f07-6f08,U+6f0a-6f0e,U+6f10-6f12,U+6f16-6f1f,U+6f21-6f23,U+6f25-6f28,U+6f2c,U+6f2e,U+6f30,U+6f32,U+6f34-6f35,U+6f37-6f3d,U+6f3f-6f45,U+6f48-6f4a,U+6f4c,U+6f4e-6f57,U+6f59-6f5b,U+6f5d,U+6f5f-6f61,U+6f63-6f65,U+6f67-6f6c,U+6f6f-6f71,U+6f73,U+6f75-6f77,U+6f79,U+6f7b,U+6f7d-6f83,U+6f85-6f87,U+6f8a-6f8b,U+6f8f-6f9b,U+6f9d-6fa0,U+6fa2-6fa6,U+6fa8-6fb1"}},{uri:Nj,descriptors:{unicodeRange:"U+6d73,U+6d75-6d76,U+6d79-6d7b,U+6d7d-6d81,U+6d83-6d84,U+6d86-6d87,U+6d8a-6d8b,U+6d8d,U+6d8f-6d90,U+6d92,U+6d96-6d9a,U+6d9c,U+6da2,U+6da5,U+6dac-6dad,U+6db0-6db1,U+6db3-6db4,U+6db6-6db7,U+6db9-6dbe,U+6dc1-6dc3,U+6dc8-6dca,U+6dcd-6dd0,U+6dd2-6dd5,U+6dd7,U+6dda-6ddc,U+6ddf,U+6de2-6de3,U+6de5,U+6de7-6dea,U+6ded,U+6def-6df0,U+6df2,U+6df4-6df6,U+6df8,U+6dfa,U+6dfd-6e04,U+6e06-6e09,U+6e0b,U+6e0f,U+6e12-6e13,U+6e15,U+6e18-6e19,U+6e1b-6e1c,U+6e1e-6e1f,U+6e22,U+6e26-6e28,U+6e2a,U+6e2c,U+6e2e,U+6e30-6e31,U+6e33,U+6e35-6e37,U+6e39,U+6e3b-6e42,U+6e45-6e4c,U+6e4f-6e52,U+6e55,U+6e57,U+6e59-6e5a,U+6e5c-6e5e,U+6e60-6e6a,U+6e6c-6e6d,U+6e6f-6e7d,U+6e80-6e82,U+6e84,U+6e87-6e88,U+6e8a-6e8e,U+6e91-6e97,U+6e99-6e9b,U+6e9d-6e9e,U+6ea0-6ea1,U+6ea3-6ea4,U+6ea6,U+6ea8-6ea9,U+6eab-6eae,U+6eb0,U+6eb3,U+6eb5,U+6eb8-6eb9,U+6ebc,U+6ebe-6ec0,U+6ec3-6ec4"}},{uri:Oj,descriptors:{unicodeRange:"U+6bbb-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bca,U+6bcc,U+6bce,U+6bd0-6bd1,U+6bd8,U+6bda,U+6bdc-6be0,U+6be2-6be9,U+6bec-6bee,U+6bf0-6bf2,U+6bf4,U+6bf6-6bf8,U+6bfa-6bfc,U+6bfe-6c04,U+6c08-6c0c,U+6c0e,U+6c12,U+6c17,U+6c1c-6c1e,U+6c20,U+6c23,U+6c25,U+6c2b-6c2d,U+6c31,U+6c33,U+6c36-6c37,U+6c39-6c3c,U+6c3e-6c3f,U+6c43-6c45,U+6c48,U+6c4b-6c4f,U+6c51-6c53,U+6c56,U+6c58-6c5a,U+6c62-6c63,U+6c65-6c67,U+6c6b-6c6f,U+6c71,U+6c73,U+6c75,U+6c77-6c78,U+6c7a-6c7c,U+6c7f-6c80,U+6c84,U+6c87,U+6c8a-6c8b,U+6c8d-6c8e,U+6c91-6c92,U+6c95-6c98,U+6c9a,U+6c9c-6c9e,U+6ca0,U+6ca2,U+6ca8,U+6cac,U+6caf-6cb0,U+6cb4-6cb7,U+6cba,U+6cc0-6cc3,U+6cc6-6cc8,U+6ccb,U+6ccd-6ccf,U+6cd1-6cd2,U+6cd8-6cda,U+6cdc-6cdd,U+6cdf,U+6ce4,U+6ce6-6ce7,U+6ce9,U+6cec-6ced,U+6cf2,U+6cf4,U+6cf9,U+6cff-6d00,U+6d02-6d03,U+6d05-6d06,U+6d08-6d0a,U+6d0d,U+6d0f-6d11,U+6d13-6d16,U+6d18,U+6d1c-6d1d,U+6d1f-6d24,U+6d26,U+6d28-6d29,U+6d2c-6d2d,U+6d2f-6d30,U+6d34,U+6d36-6d38,U+6d3a,U+6d3f-6d40,U+6d42,U+6d44,U+6d49,U+6d4c,U+6d50,U+6d55-6d58,U+6d5b,U+6d5d,U+6d5f,U+6d61-6d62,U+6d64-6d65,U+6d67-6d68,U+6d6b-6d6d,U+6d70-6d72"}},{uri:$j,descriptors:{unicodeRange:"U+6967-696a,U+696c-696d,U+696f-6970,U+6972-6976,U+697a-697b,U+697d-697f,U+6981,U+6983,U+6985,U+698a-698c,U+698e-6993,U+6996-6997,U+6999-699a,U+699d-69a6,U+69a9-69aa,U+69ac,U+69ae-69b0,U+69b2-69b3,U+69b5-69b6,U+69b8-69ba,U+69bc-69c0,U+69c2-69c9,U+69cb,U+69cd,U+69cf,U+69d1-69d3,U+69d5-69da,U+69dc-69de,U+69e1-69ec,U+69ee-69f1,U+69f3-69fc,U+69fe,U+6a00-6a09,U+6a0b-6a16,U+6a19-6a1e,U+6a20,U+6a22-6a27,U+6a29,U+6a2b-6a2e,U+6a30,U+6a32-6a34,U+6a36-6a3c,U+6a3f-6a43,U+6a45-6a46,U+6a48-6a4a"}},{uri:Fj,descriptors:{unicodeRange:"U+6830-6831,U+6834-6836,U+683a-683b,U+683f,U+6847,U+684b,U+684d,U+684f,U+6852,U+6856-685f,U+686a,U+686c-6873,U+6875,U+6878-6880,U+6882,U+6884,U+6887-688e,U+6890-6892,U+6894-6896,U+6898-68a1,U+68a3-68a5,U+68a9-68ac,U+68ae,U+68b1-68b2,U+68b4,U+68b6-68bf,U+68c1,U+68c3-68c8,U+68ca,U+68cc,U+68ce-68d1,U+68d3-68d4,U+68d6-68d7,U+68d9,U+68db-68df,U+68e1-68e2,U+68e4-68ed,U+68ef,U+68f2-68f4,U+68f6-68f8,U+68fb,U+68fd-6900,U+6902-6904,U+6906-690a,U+690c,U+690f,U+6911,U+6913-691e,U+6921-6923,U+6925-692c,U+692e-692f,U+6931-6933,U+6935-6938,U+693a-693c,U+693e,U+6940-6941,U+6943-6953,U+6955-6956,U+6958-6959,U+695b-695c,U+695f,U+6961-6962,U+6964-6965"}},{uri:zj,descriptors:{unicodeRange:"U+66b8,U+66ba-66bd,U+66bf-66d8,U+66da,U+66de-66e5,U+66e7-66e8,U+66ea-66ef,U+66f1,U+66f5-66f6,U+66f8,U+66fa-66fb,U+66fd,U+6701-6707,U+670c,U+670e-670f,U+6711-6713,U+6716,U+6718-671a,U+671c,U+671e,U+6720-6725,U+6727,U+6729,U+672e,U+6730,U+6732-6733,U+6736-6739,U+673b-673c,U+673e-673f,U+6741,U+6744-6745,U+6747,U+674a-674b,U+674d,U+6752,U+6754-6755,U+6757-675b,U+675d,U+6762-6764,U+6766-6767,U+676b-676c,U+676e,U+6771,U+6774,U+6776,U+6778-677b,U+677d,U+6780,U+6782-6783,U+6785-6786,U+6788,U+678a,U+678c-678f,U+6791-6794,U+6796,U+6799,U+679b,U+679f-67a1,U+67a4,U+67a6,U+67a9,U+67ac,U+67ae,U+67b1-67b2,U+67b4,U+67b9-67c0,U+67c2,U+67c5-67ce,U+67d5-67d7,U+67db,U+67df,U+67e1,U+67e3-67e4,U+67e6-67e8,U+67ea-67eb,U+67ed-67ee,U+67f2,U+67f5-67fc,U+67fe,U+6801-6804,U+6806,U+680d,U+6810,U+6812,U+6814-6815,U+6818-681c,U+681e-6820,U+6822-6828,U+682b-682f"}},{uri:Bj,descriptors:{unicodeRange:"U+6569-656a,U+656d-656f,U+6571,U+6573,U+6575-6576,U+6578-6586,U+6588-658a,U+658d-658f,U+6592,U+6594-6596,U+6598,U+659a,U+659d-659e,U+65a0,U+65a2-65a3,U+65a6,U+65a8,U+65aa,U+65ac,U+65ae,U+65b1-65b8,U+65ba-65bb,U+65be-65c0,U+65c2,U+65c7-65ca,U+65cd,U+65d0-65d1,U+65d3-65d5,U+65d8-65df,U+65e1,U+65e3-65e4,U+65ea-65eb,U+65f2-65f5,U+65f8-65f9,U+65fb-65ff,U+6601,U+6604-6605,U+6607-6609,U+660b,U+660d,U+6610-6612,U+6616-6618,U+661a-661c,U+661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630,U+6632-6633,U+6637-663b,U+663d,U+663f-6640,U+6642,U+6644-664a,U+664d-664e,U+6650-6651,U+6658-6659,U+665b-665e,U+6660,U+6662-6663,U+6665,U+6667,U+6669-666d,U+6671-6673,U+6675,U+6678-6679,U+667b-667d,U+667f-6681,U+6683,U+6685-6686,U+6688-668b,U+668d-6690,U+6692-6695,U+6698-669c,U+669e-66a6,U+66a9-66ad,U+66af-66b3,U+66b5-66b7"}},{uri:Hj,descriptors:{unicodeRange:"U+5f30,U+5f32-5f38,U+5f3b,U+5f3d-5f3f,U+5f41-5f4f,U+5f51,U+5f54,U+5f59-5f5c,U+5f5e-5f60,U+5f63,U+5f65,U+5f67-5f68,U+5f6b,U+5f6e-5f6f,U+5f72,U+5f74-5f76,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f83,U+5f86,U+5f8d-5f8f,U+5f91,U+5f93-5f94,U+5f96,U+5f9a-5f9b,U+5f9d-5fa0,U+5fa2-5fa7,U+5fa9,U+5fab-5fac,U+5faf-5fb4,U+5fb6,U+5fb8-5fbb,U+5fbe-5fc2,U+5fc7-5fc8,U+5fca-5fcb,U+5fce,U+5fd3-5fd5,U+5fda-5fdc,U+5fde-5fdf,U+5fe2-5fe3,U+5fe5-5fe6,U+5fe8-5fe9,U+5fec,U+5fef-5ff0,U+5ff2-5ff4,U+5ff6-5ff7,U+5ff9-5ffa,U+5ffc,U+6007-6009,U+600b-600c,U+6010-6011,U+6013,U+6017-6018,U+601a,U+601e-601f,U+6022-6024,U+602c-602e,U+6030-6034,U+6036-603a,U+603d-603e,U+6040,U+6044-604a,U+604c,U+604e-604f,U+6051,U+6053-6054,U+6056-6058,U+605b-605c,U+605e-6061,U+6065-6066,U+606e,U+6071-6072,U+6074-6075,U+6077,U+607e,U+6080-6082,U+6085-6088,U+608a-608b,U+608e-6091,U+6093,U+6095,U+6097-6099,U+609c,U+609e,U+60a1-60a2,U+60a4-60a5,U+60a7,U+60a9-60aa,U+60ae,U+60b0,U+60b3,U+60b5-60b7,U+60b9-60ba,U+60bd-60c4,U+60c7-60c9,U+60cc"}},{uri:Xj,descriptors:{unicodeRange:"U+635a-635d,U+6360,U+6364-6366,U+6368,U+636a-636c,U+636f-6370,U+6372-6375,U+6378-6379,U+637c-637f,U+6381,U+6383-6386,U+638b,U+638d,U+6391,U+6393-6395,U+6397,U+6399-639f,U+63a1,U+63a4,U+63a6,U+63ab,U+63af,U+63b1-63b2,U+63b5-63b6,U+63b9,U+63bb,U+63bd,U+63bf-63c3,U+63c5,U+63c7-63c8,U+63ca-63cc,U+63d1,U+63d3-63d5,U+63d7-63dd,U+63df,U+63e2,U+63e4-63e8,U+63eb-63ec,U+63ee-63f1,U+63f3,U+63f5,U+63f7,U+63f9-63fc,U+63fe,U+6403-6404,U+6406-640a,U+640d-640e,U+6411-6412,U+6415-641a,U+641d,U+641f,U+6422-6425,U+6427-6429,U+642b,U+642e-6433,U+6435-6439,U+643b-643c,U+643e,U+6440,U+6442-6443,U+6449,U+644b-6451,U+6453,U+6455-6457,U+6459-645d,U+645f-6466,U+6468,U+646a-646c,U+646e-6477,U+647b-6481,U+6483,U+6486,U+6488-648f"}},{uri:Wj,descriptors:{unicodeRange:"U+61c5-61c7,U+61c9,U+61cc-61d0,U+61d3,U+61d5-61e5,U+61e7-61f4,U+61f6-61fe,U+6200-6205,U+6207,U+6209,U+6213-6214,U+6219,U+621c-621e,U+6220,U+6223,U+6226-6229,U+622b,U+622d,U+622f-6232,U+6235-6236,U+6238-623c,U+6242,U+6244-6246,U+624a,U+624f-6250,U+6255-6257,U+6259-625a,U+625c-6262,U+6264-6265,U+6268,U+6271-6272,U+6274-6275,U+6277-6278,U+627a-627b,U+627d,U+6281-6283,U+6285-6288,U+628b-6290,U+6294,U+6299,U+629c-629e,U+62a3,U+62a6-62a7,U+62a9-62aa,U+62ad-62b0,U+62b2-62b4,U+62b6-62b8,U+62ba,U+62be,U+62c0-62c1,U+62c3,U+62cb,U+62cf,U+62d1,U+62d5,U+62dd-62de,U+62e0-62e1,U+62e4,U+62ea-62eb,U+62f0,U+62f2,U+62f5,U+62f8-62fb,U+6300,U+6303-6306,U+630a-630d,U+630f-6310,U+6312-6315,U+6317-6319,U+631c,U+6326-6327,U+6329,U+632c-632e,U+6330-6331,U+6333-6338,U+633b-633c,U+633e-6341,U+6344,U+6347-6348,U+634a,U+6351-6354,U+6356-6359"}},{uri:Vj,descriptors:{unicodeRange:"U+5dd0-5dda,U+5ddc,U+5ddf-5de0,U+5de3-5de4,U+5dea,U+5dec-5ded,U+5df0,U+5df5-5df6,U+5df8-5dfc,U+5dff-5e00,U+5e04,U+5e07,U+5e09-5e0b,U+5e0d-5e0e,U+5e12-5e13,U+5e17,U+5e1e-5e25,U+5e28-5e2c,U+5e2f-5e30,U+5e32-5e36,U+5e39-5e3a,U+5e3e-5e41,U+5e43,U+5e46-5e4b,U+5e4d-5e53,U+5e56-5e5a,U+5e5c-5e5d,U+5e5f-5e60,U+5e63-5e71,U+5e75,U+5e77,U+5e79,U+5e7e,U+5e81-5e83,U+5e85,U+5e88-5e89,U+5e8c-5e8e,U+5e92,U+5e98,U+5e9b,U+5e9d,U+5ea1-5ea4,U+5ea8-5eac,U+5eae-5eb2,U+5eb4,U+5eba-5ebd,U+5ebf-5ec8,U+5ecb-5ed0,U+5ed4-5ed5,U+5ed7-5eda,U+5edc-5ee7,U+5ee9,U+5eeb-5ef3,U+5ef5,U+5ef8-5ef9,U+5efb-5efd,U+5f05-5f07,U+5f09,U+5f0c-5f0e,U+5f10,U+5f12,U+5f14,U+5f16,U+5f19-5f1a,U+5f1c-5f1e,U+5f21-5f24,U+5f28,U+5f2b-5f2c,U+5f2e"}},{uri:Gj,descriptors:{unicodeRange:"U+60cd-60d0,U+60d2-60d4,U+60d6-60d7,U+60d9,U+60db,U+60de,U+60e1-60e5,U+60ea,U+60f1-60f2,U+60f5,U+60f7-60f8,U+60fb-60ff,U+6102-6105,U+6107,U+610a-610c,U+6110-6114,U+6116-6119,U+611b-611e,U+6121-6122,U+6125,U+6128-612a,U+612c-613e,U+6140-6147,U+6149,U+614b,U+614d,U+614f-6150,U+6152-6154,U+6156-615c,U+615e-6161,U+6163-6166,U+6169-616f,U+6171-6174,U+6176,U+6178-618a,U+618c-618d,U+618f-6193,U+6195-619c,U+619e-61a6,U+61aa-61ab,U+61ad-61b6,U+61b8-61bd,U+61bf-61c1,U+61c3-61c4"}},{uri:Yj,descriptors:{unicodeRange:"U+5cf4-5cfa,U+5cfc-5d01,U+5d04-5d05,U+5d08-5d0d,U+5d0f-5d13,U+5d15,U+5d17-5d1a,U+5d1c-5d1d,U+5d1f-5d23,U+5d25,U+5d28,U+5d2a-5d2c,U+5d2f-5d33,U+5d35-5d3c,U+5d3f-5d46,U+5d48-5d49,U+5d4d-5d57,U+5d59-5d5a,U+5d5c,U+5d5e-5d68,U+5d6a,U+5d6d-5d6e,U+5d70-5d73,U+5d75-5d81,U+5d83-5d98,U+5d9a-5d9c,U+5d9e-5db6,U+5db8-5dc4,U+5dc6-5dcc,U+5dce-5dcf"}},{uri:Zj,descriptors:{unicodeRange:"U+5b52,U+5b56,U+5b5e,U+5b60-5b61,U+5b67-5b68,U+5b6b,U+5b6d-5b6f,U+5b72,U+5b74,U+5b76-5b79,U+5b7b-5b7c,U+5b7e-5b7f,U+5b82,U+5b86,U+5b8a,U+5b8d-5b8e,U+5b90-5b92,U+5b94,U+5b96,U+5b9f,U+5ba7-5ba9,U+5bac-5baf,U+5bb1-5bb2,U+5bb7,U+5bba-5bbc,U+5bc0-5bc1,U+5bc3,U+5bc8-5bcb,U+5bcd-5bcf,U+5bd1,U+5bd4-5bdc,U+5be0,U+5be2-5be3,U+5be6-5be7,U+5be9-5bed,U+5bef,U+5bf1-5bf7,U+5bfd-5bfe,U+5c00,U+5c02-5c03,U+5c05,U+5c07-5c08,U+5c0b-5c0e,U+5c10,U+5c12-5c13,U+5c17,U+5c19,U+5c1b,U+5c1e-5c21,U+5c23,U+5c26,U+5c28-5c2b,U+5c2d-5c30,U+5c32-5c33,U+5c35-5c37,U+5c43-5c44,U+5c46-5c47,U+5c4c-5c4d,U+5c52-5c54,U+5c56-5c58,U+5c5a-5c5d,U+5c5f,U+5c62,U+5c64,U+5c67-5c6d,U+5c70,U+5c72-5c78,U+5c7b-5c7e,U+5c80,U+5c83-5c87,U+5c89-5c8b,U+5c8e-5c8f,U+5c92-5c93,U+5c95,U+5c9d-5ca1,U+5ca4-5ca8,U+5caa,U+5cae-5cb0,U+5cb2,U+5cb4,U+5cb6,U+5cb9-5cbc,U+5cbe,U+5cc0,U+5cc2-5cc3,U+5cc5-5cca,U+5ccc-5cd1,U+5cd3-5cd8,U+5cda-5ce0,U+5ce2-5ce3,U+5ce7,U+5ce9,U+5ceb-5cec,U+5cee-5cef,U+5cf1-5cf3"}},{uri:Kj,descriptors:{unicodeRange:"U+593b,U+593d-5940,U+5943,U+5945-5946,U+594a,U+594c-594d,U+5950,U+5952-5953,U+5959,U+595b-595f,U+5961,U+5963-5964,U+5966-5972,U+5975,U+5977,U+597a-597c,U+597e-5980,U+5985,U+5989,U+598b-598c,U+598e-5991,U+5994-5995,U+5998,U+599a-599d,U+599f-59a2,U+59a6-59a7,U+59ac-59ad,U+59b0-59b1,U+59b3-59b8,U+59ba,U+59bc-59bd,U+59bf-59c5,U+59c7-59c9,U+59cc-59cf,U+59d5-59d6,U+59d9,U+59db,U+59de-59e2,U+59e4,U+59e6-59e7,U+59e9-59eb,U+59ed-59f8,U+59fa,U+59fc-59fe,U+5a00,U+5a02,U+5a0a-5a0b,U+5a0d-5a10,U+5a12,U+5a14-5a17,U+5a19-5a1b,U+5a1d-5a1e,U+5a21-5a22,U+5a24,U+5a26-5a28,U+5a2a-5a30,U+5a33,U+5a35,U+5a37-5a3b,U+5a3d-5a3f,U+5a41-5a45,U+5a47-5a48,U+5a4b-5a54,U+5a56-5a59,U+5a5b-5a61,U+5a63-5a66,U+5a68-5a69,U+5a6b-5a73,U+5a78-5a79,U+5a7b-5a7e,U+5a80-5a90"}},{uri:qj,descriptors:{unicodeRange:"U+5a91,U+5a93-5a99,U+5a9c-5aa9,U+5aab-5ab1,U+5ab4,U+5ab6-5ab7,U+5ab9-5abd,U+5abf-5ac0,U+5ac3-5ac8,U+5aca-5acb,U+5acd-5ad1,U+5ad3,U+5ad5,U+5ad7,U+5ad9-5adb,U+5add-5adf,U+5ae2,U+5ae4-5ae5,U+5ae7-5ae8,U+5aea,U+5aec-5af0,U+5af2-5b08,U+5b0a-5b15,U+5b18-5b31,U+5b33,U+5b35-5b36,U+5b38-5b3f,U+5b41-5b4f"}},{uri:Jj,descriptors:{unicodeRange:"U+5843,U+5845-584b,U+584e-5850,U+5852-5853,U+5855-5857,U+5859-585d,U+585f-5864,U+5866-586a,U+586d-587d,U+587f,U+5882,U+5884,U+5886-5888,U+588a-5891,U+5894-5898,U+589b-589d,U+58a0-58a7,U+58aa-58bb,U+58bd-58c0,U+58c2-58c4,U+58c6-58d0,U+58d2-58d4,U+58d6-58e3,U+58e5-58ea,U+58ed,U+58ef,U+58f1-58f2,U+58f4-58f5,U+58f7-58f8,U+58fa-5901,U+5903,U+5905-5906,U+5908-590c,U+590e,U+5910-5913,U+5917-5918,U+591b,U+591d-591e,U+5920-5923,U+5926,U+5928,U+592c,U+5930,U+5932-5933,U+5935-5936"}},{uri:Qj,descriptors:{unicodeRange:"U+56d0-56d3,U+56d5-56d6,U+56d8-56d9,U+56dc,U+56e3,U+56e5-56ea,U+56ec,U+56ee-56ef,U+56f2-56f3,U+56f6-56f8,U+56fb-56fc,U+5700-5702,U+5705,U+5707,U+570b-571b,U+571d-571e,U+5720-5722,U+5724-5727,U+572b,U+5731-5732,U+5734-5738,U+573c-573d,U+573f,U+5741,U+5743-5746,U+5748-5749,U+574b,U+5752-5756,U+5758-5759,U+5762-5763,U+5765,U+5767,U+576c,U+576e,U+5770-5772,U+5774-5775,U+5778-577a,U+577d-5781,U+5787-578a,U+578d-5791,U+5794-579a,U+579c-579f,U+57a5,U+57a8,U+57aa,U+57ac,U+57af-57b1,U+57b3,U+57b5-57b7,U+57b9-57c1,U+57c4-57ca,U+57cc-57cd,U+57d0-57d1,U+57d3,U+57d6-57d7,U+57db-57dc,U+57de,U+57e1-57e3,U+57e5-57ec,U+57ee,U+57f0-57f3,U+57f5-57f7,U+57fb-57fc,U+57fe-57ff,U+5801,U+5803-5805,U+5808-580a,U+580c,U+580e-5810,U+5812-5814,U+5816-5818,U+581a-581d,U+581f,U+5822-5823,U+5825-5829,U+582b-582f,U+5831-5834,U+5836-5842"}},{uri:eA,descriptors:{unicodeRange:"U+55f9-55fc,U+55ff,U+5602-5607,U+560a-560b,U+560d,U+5610-5617,U+5619-561a,U+561c-561d,U+5620-5622,U+5625-5626,U+5628-562b,U+562e-5630,U+5633,U+5635,U+5637-5638,U+563a,U+563c-563e,U+5640-564b,U+564f-5653,U+5655-5656,U+565a-565b,U+565d-5661,U+5663,U+5665-5667,U+566d-5670,U+5672-5675,U+5677-567a,U+567d-5684,U+5687-568d,U+5690-5692,U+5694-56a2,U+56a4-56ae,U+56b0-56b6,U+56b8-56bb,U+56bd-56c9,U+56cb-56cf"}},{uri:tA,descriptors:{unicodeRange:"U+5286-5287,U+5289-528f,U+5291-5292,U+5294-529a,U+529c,U+52a4-52a7,U+52ae-52b0,U+52b4-52bd,U+52c0-52c2,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cf,U+52d1,U+52d3-52d5,U+52d7,U+52d9-52de,U+52e0-52e3,U+52e5-52ef,U+52f1-52f8,U+52fb-52fd,U+5301-5304,U+5307,U+5309-530c,U+530e,U+5311-5314,U+5318,U+531b-531c,U+531e-531f,U+5322,U+5324-5325,U+5327-5329,U+532b-532d,U+532f-5338,U+533c-533d,U+5340,U+5342,U+5344,U+5346,U+534b-534d,U+5350,U+5354,U+5358-5359,U+535b,U+535d,U+5365,U+5368,U+536a,U+536c-536d,U+5372,U+5376,U+5379,U+537b-537e,U+5380-5381,U+5383,U+5387-5388,U+538a,U+538e-5394,U+5396-5397,U+5399,U+539b-539c,U+539e,U+53a0-53a1,U+53a4,U+53a7,U+53aa-53ad,U+53af-53b5,U+53b7-53ba,U+53bc-53be,U+53c0,U+53c3-53c7,U+53ce-53d0,U+53d2-53d3,U+53d5,U+53da,U+53dc-53de,U+53e1-53e2,U+53e7,U+53f4,U+53fa,U+53fe-5400,U+5402,U+5405,U+5407,U+540b,U+5414,U+5418-541a,U+541c,U+5422,U+5424-5425,U+542a,U+5430,U+5433,U+5436-5437,U+543a"}},{uri:nA,descriptors:{unicodeRange:"U+5101-5105,U+5108-510a,U+510c-5111,U+5113-5120,U+5122-513e,U+5142,U+5147,U+514a,U+514c,U+514e-5150,U+5152-5153,U+5157-5159,U+515b,U+515d-5161,U+5163-5164,U+5166-5167,U+5169-516a,U+516f,U+5172,U+517a,U+517e-517f,U+5183-5184,U+5186-5187,U+518a-518b,U+518e-5191,U+5193-5194,U+5198,U+519a,U+519d-519f,U+51a1,U+51a3,U+51a6-51aa,U+51ad-51ae,U+51b4,U+51b8-51ba,U+51be-51bf,U+51c1-51c3,U+51c5,U+51c8,U+51ca,U+51cd-51ce,U+51d0,U+51d2-51da,U+51dc,U+51de-51df,U+51e2-51e3,U+51e5-51ea,U+51ec,U+51ee,U+51f1-51f2,U+51f4,U+51f7,U+51fe,U+5204-5205,U+5209,U+520b-520c,U+520f-5210,U+5213-5215,U+521c,U+521e-521f,U+5221-5223,U+5225-5227,U+522a,U+522c,U+522f,U+5231-5232,U+5234-5235,U+523c,U+523e,U+5244-5249,U+524b,U+524e-524f,U+5252-5253,U+5255,U+5257-525b,U+525d,U+525f-5260,U+5262-5264,U+5266,U+5268,U+526b-526e,U+5270-5271,U+5273-527c,U+527e,U+5280,U+5283-5285"}},{uri:aA,descriptors:{unicodeRange:"U+543d,U+543f,U+5441-5442,U+5444-5445,U+5447,U+5449,U+544c-544f,U+5451,U+545a,U+545d-5461,U+5463,U+5465,U+5467,U+5469-5470,U+5474,U+5479-547a,U+547e-547f,U+5481,U+5483,U+5485,U+5487-548a,U+548d,U+5491,U+5493,U+5497-5498,U+549c,U+549e-54a2,U+54a5,U+54ae,U+54b0,U+54b2,U+54b5-54b7,U+54b9-54ba,U+54bc,U+54be,U+54c3,U+54c5,U+54ca-54cb,U+54d6,U+54d8,U+54db,U+54e0-54e4,U+54eb-54ec,U+54ef-54f1,U+54f4-54f9,U+54fb,U+54fe,U+5500,U+5502-5505,U+5508,U+550a-550e,U+5512-5513,U+5515-551a,U+551c-551f,U+5521,U+5525-5526,U+5528-5529,U+552b,U+552d,U+5532,U+5534-5536,U+5538-553b,U+553d,U+5540,U+5542,U+5545,U+5547-5548,U+554b-554f,U+5551-5554,U+5557-555b,U+555d-5560,U+5562-5563,U+5568-5569,U+556b,U+556f-5574,U+5579-557a,U+557d,U+557f,U+5585-5586,U+558c-558e,U+5590,U+5592-5593,U+5595-5597,U+559a-559b,U+559e,U+55a0-55a6,U+55a8-55b0,U+55b2,U+55b4,U+55b6,U+55b8,U+55ba,U+55bc,U+55bf-55c3,U+55c6-55c8,U+55ca-55cb,U+55ce-55d0,U+55d5,U+55d7-55db,U+55de,U+55e0,U+55e2,U+55e7,U+55e9,U+55ed-55ee,U+55f0-55f1,U+55f4,U+55f6,U+55f8"}},{uri:iA,descriptors:{unicodeRange:"U+4fe0,U+4fe2,U+4fe4-4fe5,U+4fe7,U+4feb-4fec,U+4ff0,U+4ff2,U+4ff4-4ff7,U+4ff9,U+4ffb-4ffd,U+4fff-500b,U+500e,U+5010-5011,U+5013,U+5015-5017,U+501b,U+501d-501e,U+5020,U+5022-5024,U+5027,U+502b,U+502f-5039,U+503b,U+503d,U+503f-5042,U+5044-5046,U+5049-504b,U+504d,U+5050-5054,U+5056-5059,U+505b,U+505d-5064,U+5066-506b,U+506d-5075,U+5078-507a,U+507c-507d,U+5081-5084,U+5086-5087,U+5089-508c,U+508e-50a2,U+50a4,U+50a6,U+50aa-50ab,U+50ad-50b1,U+50b3-50b9,U+50bc-50ce,U+50d0-50d5,U+50d7-50d9,U+50db-50e5,U+50e8-50eb,U+50ef-50f2,U+50f4,U+50f6-50fa,U+50fc-5100"}},{uri:rA,descriptors:{unicodeRange:"U+49d5-4a77"}},{uri:sA,descriptors:{unicodeRange:"U+4dac-4dad,U+4daf-4db5,U+4e02,U+4e04-4e06,U+4e0f,U+4e12,U+4e17,U+4e1f-4e21,U+4e23,U+4e26,U+4e29,U+4e2e-4e2f,U+4e31,U+4e33,U+4e35,U+4e37,U+4e3c,U+4e40-4e42,U+4e44,U+4e46,U+4e4a,U+4e51,U+4e55,U+4e57,U+4e5a-4e5b,U+4e62-4e65,U+4e67-4e68,U+4e6a-4e6f,U+4e72,U+4e74-4e7d,U+4e7f-4e85,U+4e87,U+4e8a,U+4e90,U+4e96-4e97,U+4e99,U+4e9c-4e9e,U+4ea3,U+4eaa,U+4eaf-4eb1,U+4eb4,U+4eb6-4eb9,U+4ebc-4ebe,U+4ec8,U+4ecc,U+4ecf-4ed0,U+4ed2,U+4eda-4edc,U+4ee0,U+4ee2,U+4ee6-4ee7,U+4ee9,U+4eed-4eef,U+4ef1,U+4ef4,U+4ef8-4efa,U+4efc,U+4efe,U+4f00,U+4f02-4f08,U+4f0b-4f0c,U+4f12-4f16,U+4f1c-4f1d,U+4f21,U+4f23,U+4f28-4f29,U+4f2c-4f2e,U+4f31,U+4f33,U+4f35,U+4f37,U+4f39,U+4f3b,U+4f3e-4f42,U+4f44-4f45,U+4f47-4f4c,U+4f52,U+4f54,U+4f56,U+4f61-4f62,U+4f66,U+4f68,U+4f6a-4f6b,U+4f6d-4f6e,U+4f71-4f72,U+4f75,U+4f77-4f7a,U+4f7d,U+4f80-4f82,U+4f85-4f87,U+4f8a,U+4f8c,U+4f8e,U+4f90,U+4f92-4f93,U+4f95-4f96,U+4f98-4f9a,U+4f9c,U+4f9e-4f9f,U+4fa1-4fa2,U+4fa4,U+4fab,U+4fad,U+4fb0-4fb4,U+4fb6-4fbe,U+4fc0-4fc2,U+4fc6-4fc9,U+4fcb-4fcd,U+4fd2-4fd6,U+4fd9,U+4fdb"}},{uri:lA,descriptors:{unicodeRange:"U+4933-49d4"}},{uri:oA,descriptors:{unicodeRange:"U+487a-4932"}},{uri:cA,descriptors:{unicodeRange:"U+47d2-4879,U+2ce7c,U+2ce88,U+2ce93"}},{uri:dA,descriptors:{unicodeRange:"U+4756-47d1,U+2ca02,U+2ca0e,U+2ca7d,U+2caa9,U+2cb29,U+2cb2e,U+2cb31,U+2cb38-2cb39,U+2cb3f,U+2cb41,U+2cb4e,U+2cb5a,U+2cb64,U+2cb69,U+2cb6c,U+2cb6f,U+2cb76,U+2cb78,U+2cb7c,U+2cbb1,U+2cbbf-2cbc0,U+2cbce,U+2cc5f,U+2ccf5-2ccf6,U+2ccfd,U+2ccff,U+2cd02-2cd03,U+2cd0a,U+2cd8b,U+2cd8d,U+2cd8f-2cd90,U+2cd9f-2cda0,U+2cda8,U+2cdad-2cdae,U+2cdd5,U+2ce18,U+2ce1a,U+2ce23,U+2ce26,U+2ce2a"}},{uri:uA,descriptors:{unicodeRange:"U+46c3-4755,U+2c488,U+2c494,U+2c497,U+2c542,U+2c613,U+2c618,U+2c621,U+2c629,U+2c62b-2c62d,U+2c62f,U+2c642,U+2c64a-2c64b,U+2c72c,U+2c72f,U+2c79f,U+2c7c1,U+2c7fd,U+2c8d9,U+2c8de,U+2c8e1,U+2c8f3,U+2c907,U+2c90a,U+2c91d"}},{uri:fA,descriptors:{unicodeRange:"U+4629-46c2,U+2bdf7,U+2be29,U+2c029-2c02a,U+2c0a9,U+2c0ca,U+2c1d5,U+2c1d9,U+2c1f9,U+2c27c,U+2c288,U+2c2a4,U+2c317,U+2c35b,U+2c361,U+2c364"}},{uri:hA,descriptors:{unicodeRange:"U+458e-4628,U+2b7a9,U+2b7c5,U+2b7e6,U+2b7f9,U+2b806,U+2b80a,U+2b81c,U+2b8b8,U+2bac7,U+2bb5f,U+2bb62,U+2bb7c,U+2bb83,U+2bc1b,U+2bd77,U+2bd87"}},{uri:pA,descriptors:{unicodeRange:"U+4449-4511,U+2afa2,U+2b127-2b128,U+2b137-2b138,U+2b1ed"}},{uri:UA,descriptors:{unicodeRange:"U+439b-4448,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a7dd,U+2a8fb,U+2a917,U+2aa30,U+2aa36,U+2aa58"}},{uri:mA,descriptors:{unicodeRange:"U+4275-430d,U+298c6,U+29a72,U+29d98,U+29ddb,U+29e15,U+29e3d,U+29e49"}},{uri:gA,descriptors:{unicodeRange:"U+4132-41de,U+28bef,U+28c47,U+28c4f,U+28c51,U+28c54,U+28d10,U+28d71,U+28dfb,U+28e1f,U+28e36,U+28e89,U+28e99,U+28eeb,U+28f32,U+28ff8,U+292a0"}},{uri:bA,descriptors:{unicodeRange:"U+41df-4274,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750"}},{uri:vA,descriptors:{unicodeRange:"U+408e-4131,U+285c8-285c9,U+28678,U+28695,U+286d7,U+286fa,U+287e0,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28b49,U+28bc1"}},{uri:xA,descriptors:{unicodeRange:"U+3e83-3f2f,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752"}},{uri:yA,descriptors:{unicodeRange:"U+3f30-3fdb,U+27985,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27cb8,U+27da0,U+27e10"}},{uri:wA,descriptors:{unicodeRange:"U+3fdc-408d,U+27fb7,U+27ff9,U+2808a,U+280bb,U+2815d,U+28277,U+28282,U+282e2,U+282f3,U+283cd,U+28408,U+2840c,U+28455,U+28468,U+2856b"}},{uri:EA,descriptors:{unicodeRange:"U+3dd2-3e82,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26b5c,U+26c21,U+26c29,U+26c73,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d"}},{uri:SA,descriptors:{unicodeRange:"U+3d34-3dd1,U+2648d,U+26676,U+2667e,U+266b0,U+2671d,U+2677c,U+267cc,U+268dd,U+268ea,U+26951,U+2696f,U+269dd,U+269fa,U+26a1e"}},{uri:CA,descriptors:{unicodeRange:"U+3c76-3d33,U+25d0a,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed7-25ed8,U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26221,U+26270,U+26286,U+2634c,U+26402"}},{uri:kA,descriptors:{unicodeRange:"U+3bda-3c75,U+25771,U+257a9,U+257b4,U+259c4,U+259d4,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c14,U+25c4b,U+25c64"}},{uri:MA,descriptors:{unicodeRange:"U+3b25-3bd9,U+2504a,U+25055,U+25122,U+2512b,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+25532,U+25562,U+255a7-255a8"}},{uri:IA,descriptors:{unicodeRange:"U+3a6b-3b24,U+24896,U+249db,U+24a4d,U+24a7d,U+24ac9,U+24b56,U+24b6f,U+24c16,U+24d14,U+24dea,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24eaa"}},{uri:TA,descriptors:{unicodeRange:"U+39a9-3a6a,U+24096,U+24103,U+241ac,U+241c6,U+241fe,U+243bc,U+243f8,U+244d3,U+24629,U+246a5,U+247f1"}},{uri:_A,descriptors:{unicodeRange:"U+38e3-39a8,U+23a98,U+23c7f,U+23c97-23c98,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23e23,U+23f7e"}},{uri:jA,descriptors:{unicodeRange:"U+3760-382a,U+22ab8,U+22b43,U+22b46,U+22b4f-22b50,U+22ba6,U+22bca,U+22c1d,U+22c24,U+22c55,U+22d4c,U+22de1"}},{uri:AA,descriptors:{unicodeRange:"U+382b-38e2,U+231b6,U+231c3-231c4,U+231f5,U+23350,U+23372,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+235cb,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237ff,U+23824,U+2383d"}},{uri:RA,descriptors:{unicodeRange:"U+3698-375f,U+22218,U+2231e,U+223ad,U+224dc,U+226f3,U+2285b,U+228ab,U+2298f"}},{uri:LA,descriptors:{unicodeRange:"U+35e6-3697,U+21c56,U+21cde,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b"}},{uri:DA,descriptors:{unicodeRange:"U+3444-350e,U+20ad3,U+20b1d,U+20b9f,U+20c41,U+20cbf,U+20cd0,U+20d45,U+20de1,U+20e64,U+20e6d,U+20e95,U+20e9d,U+20ea2,U+20f5f,U+210c1,U+21201,U+2123d,U+21255,U+21274,U+2127b"}},{uri:PA,descriptors:{unicodeRange:"U+350f-35e5,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+2139a,U+213c4,U+21413,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3"}},{uri:NA,descriptors:{unicodeRange:"U+336d-3443,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+20547,U+205d6,U+20628,U+20676,U+2074f,U+20779,U+20807,U+2083a,U+20895,U+208b9,U+2097c,U+2099d"}},{uri:OA,descriptors:{unicodeRange:"U+328b-336c,U+2000b,U+20089,U+200a2,U+200a4,U+20164,U+201a2,U+20213"}},{uri:$A,descriptors:{unicodeRange:"U+3192-31ba,U+31c0-31e3,U+31f0-321e,U+3220-328a,U+1f250-1f251"}},{uri:FA,descriptors:{unicodeRange:"U+2f74-2fd5,U+3000,U+3003-3007,U+3012-3013,U+3018-301c,U+3020-3029,U+302f-303f,U+3041-3096,U+3099-30a1"}},{uri:zA,descriptors:{unicodeRange:"U+30a2-30ff,U+3105-312f,U+3131-318e,U+3190-3191"}},{uri:BA,descriptors:{unicodeRange:"U+4e36,U+4ea0,U+4f74,U+4f91,U+4f94,U+4fc5,U+507e,U+50ed,U+5182,U+51f5,U+525e,U+5282,U+52f9,U+5326,U+537a,U+53a3,U+5423,U+5459,U+54b4,U+54d9,U+55c9,U+57f4,U+580b,U+5902,U+5925,U+5a08,U+5ab5,U+5b84,U+5be4,U+5c22,U+5cb5,U+5cbd,U+5d3e,U+5e31,U+5e5e,U+5e80,U+5ee8,U+5f82,U+5fc9,U+5fed,U+600a,U+605d,U+609b,U+609d,U+60dd,U+6243,U+6322,U+63ce,U+640c,U+643f,U+6445,U+64d7,U+6534,U+6549,U+656b,U+6603,U+674c,U+680a,U+6864,U+69d4,U+6a65,U+6c2a,U+6c46,U+6c5c,U+6d0e,U+6d48,U+6e2b,U+6eb2,U+6eb7,U+6f89,U+706c,U+70b1,U+7113,U+71d4,U+727f,U+72f3,U+7303,U+7321,U+736c,U+736f,U+74a9,U+74de,U+750d,U+7513,U+7592,U+75c4,U+7605,U+760a,U+761b,U+7625,U+762d,U+7643,U+7707,U+7747,U+77b5,U+7839,U+784e,U+78a5,U+7924,U+793b,U+798a,U+7a03,U+7a06,U+7a78,U+7a80,U+7aad,U+7ba8,U+7be5,U+7cc8,U+7ec1,U+7f0b,U+7f0f,U+7f12,U+7f68,U+7f9d,U+8025,U+809c,U+80ad,U+80b7,U+80e8,U+811e,U+8204,U+8223,U+822d,U+823b,U+824b,U+825a,U+827d,U+827f,U+828f,U+82c8,U+8307,U+831b,U+8347,U+837d,U+839b,U+83a9,U+83f9,U+84b9,U+8579,U+864d,U+867f,U+86b0,U+86d1,U+86d8,U+86f2,U+8764,U+8770,U+8788,U+8797,U+87ac-87ad,U+87b5,U+881b,U+8844,U+88bc,U+88fc,U+8930,U+89cf,U+89d6,U+8ba0,U+8bd4,U+8c02,U+8c2b,U+8c85,U+8e23,U+8f81-8f82,U+8fd5,U+90b6,U+90db,U+914e,U+9164,U+91ad,U+943e,U+94b7-94b8,U+94eb,U+950d,U+9514,U+9516,U+9518,U+9529,U+9538,U+953f,U+954e,U+955f,U+95fc,U+9667,U+96b3,U+9792,U+97b2,U+98a1,U+9969,U+9987,U+9998,U+9a80,U+9a92,U+9a96,U+9adf,U+9cb4,U+9cbd,U+9cd0,U+9cd4,U+9e31,U+9e3a,U+9e71,U+9ee5,U+9eea,U+9ef9,U+9fa0"}},{uri:HA,descriptors:{unicodeRange:"U+4e0c,U+4e28,U+4e3f,U+4ec2,U+502e,U+50ba,U+5155,U+5181,U+522d,U+5281,U+5290,U+5369,U+53b6,U+54d5,U+54dc,U+54ff,U+552a,U+553c,U+5588,U+55b5,U+5686,U+570a,U+5776,U+5786,U+57a4,U+5820,U+5865,U+58bc,U+5b32,U+5b65,U+5c1c,U+5c66,U+5c6e,U+5c8d,U+5ddb,U+5f2a,U+5f50,U+5f61,U+6067,U+614a,U+615d,U+619d,U+61d4,U+620b,U+6224-6225,U+6343,U+63ad,U+63f2,U+640b,U+6420,U+6434,U+6496,U+64d0,U+6509,U+652e,U+67a8,U+6833,U+6844,U+684a,U+6920,U+6957,U+6971,U+6a8e,U+6a91,U+6aa0,U+6b43,U+6bea,U+6bf5,U+6c15,U+6cd0,U+6ee0,U+6f24,U+6f2d,U+70c0,U+721d,U+728b,U+72c3,U+72e8,U+730a,U+7338-7339,U+734d,U+746d,U+752f,U+754e,U+770d,U+7735,U+778d,U+77a2,U+77e7,U+7857,U+786d,U+78c9,U+78f2,U+791e,U+7953,U+7b58,U+7b9d,U+7bda,U+7cd7,U+7f32-7f33,U+8022,U+8028-8029,U+8035,U+804d,U+8080,U+80c2,U+80e9,U+80ec,U+80f2,U+810e,U+8221,U+8274,U+82b0,U+82e0,U+83b0,U+8487-8488,U+848e,U+84cd,U+84d0,U+8539,U+857a,U+85a8,U+85b7,U+867c,U+871e,U+8723,U+877e,U+878b,U+8793,U+8803,U+88d2,U+8966,U+89cc,U+89eb,U+8b26,U+8c8a,U+8c98,U+8d33,U+8d47,U+8d55,U+8dbc,U+8e40,U+8e94,U+8f77,U+8f79,U+9058,U+91a2,U+91b5,U+928e,U+9494,U+94b6,U+94de,U+94f4,U+94f9,U+950a,U+950e,U+951e,U+952b,U+953c,U+953e,U+9544,U+9561,U+9564,U+9569,U+95f6,U+9603,U+960d,U+963d,U+9674,U+9794,U+97ab,U+98a5,U+9a9f,U+9ab1,U+9ad1,U+9b0f,U+9b2f,U+9c92,U+9c95,U+9cba,U+9cbc,U+9cc6,U+9ccb,U+9cd8,U+9e32,U+9e38,U+9e5b,U+9e7e,U+9eb4,U+9efb-9efc,U+9f3d"}},{uri:XA,descriptors:{unicodeRange:"U+2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f73,U+ffffd"}},{uri:WA,descriptors:{unicodeRange:"U+4e69,U+4f1b,U+4f67,U+4f7e,U+4fdc,U+50e6,U+5196,U+5202,U+5233,U+523f,U+52a2,U+536e,U+5476,U+54ad,U+54cf,U+5537,U+561e,U+56dd,U+56df,U+5709,U+572c,U+57cf,U+57f8,U+580d,U+5881,U+589a,U+5941,U+59b2,U+5c25,U+5d24,U+5d74,U+5e42,U+5e8b,U+5eb3,U+5ed2,U+5fad,U+6003,U+603c,U+6083,U+6100,U+6126,U+6206,U+62ca,U+638e,U+63b4,U+6426,U+646d,U+6535,U+65c4,U+66db,U+6715,U+6769,U+6798,U+67c3,U+6861,U+698d,U+69ca,U+69ed,U+69f2,U+69ff,U+6a18,U+6b39,U+6bb3,U+6c0d,U+6cb2,U+6cd6,U+6cf7,U+6cfa,U+6d33,U+6e16,U+6e53-6e54,U+6ebb,U+6fb6,U+709d,U+72ad,U+72f7,U+72fb,U+7313,U+739f,U+74ba,U+754b,U+755b,U+758b,U+75ac,U+75d6,U+7617,U+7635,U+7640,U+76a4,U+76b2,U+775a,U+77bd,U+781f,U+79b3,U+7b2b,U+7b31,U+7b3e,U+7b6e,U+7b9c,U+7c0b,U+7c9e,U+7cc1,U+7ce8,U+7ea5,U+7f21,U+7f27,U+7f74,U+7fb0,U+8031,U+8071,U+80ea,U+8114,U+8160,U+81a6,U+81c1,U+829f,U+82a4,U+82fb,U+831a,U+8333,U+836c,U+83b6,U+83f8,U+8411,U+841c,U+8489,U+848c,U+85a4,U+8627,U+8629,U+866e,U+86b5,U+872e,U+8731,U+877b,U+877d,U+87ea,U+8813,U+8816,U+8864,U+88ce,U+88e5,U+897b,U+89cb,U+89f3,U+8bfc,U+8c35,U+8d46,U+8d4d,U+8dba,U+8e3a,U+8f75,U+8f7e,U+8fd3,U+9161,U+9179,U+917e,U+91a3,U+94ac,U+94d7,U+94e5,U+952a,U+952c,U+9545,U+9565,U+9568,U+956a,U+961d,U+96e0,U+972a,U+9730,U+989f,U+98e7,U+990d,U+9967,U+9993,U+9aa3,U+9ac0,U+9ae1,U+9aeb,U+9af9,U+9c86,U+9c8b,U+9ca0-9ca1,U+9ca3,U+9ce2,U+9e48,U+9e6a,U+9e87,U+9ee2,U+9ee9,U+9f17,U+9f19,U+9f2c,U+9f80"}},{uri:VA,descriptors:{unicodeRange:"U+4ef3,U+50d6,U+50ec,U+51ab,U+51b1,U+52d6,U+54a9,U+54da,U+55be,U+55cd,U+564d,U+572f,U+574c,U+576b,U+57d8,U+57fd,U+5844,U+59d2,U+5ae0,U+5b16,U+5b37,U+5b5b,U+5b80,U+5d1e,U+5d6b,U+5efe,U+5f11,U+5f56,U+5f58,U+5f73,U+5f8c,U+5fc4,U+5fe4,U+602b,U+6106,U+610d,U+63de,U+63f8,U+641b,U+64e4,U+6634,U+676a,U+67b5,U+681d,U+6883,U+69b1,U+69e0,U+6b37,U+6b9b,U+6d7c,U+6ed7,U+6f36,U+6f72,U+6f8c,U+7035,U+7039,U+7173,U+7178,U+7228,U+728f,U+72b4,U+72ef,U+72f4,U+7331,U+7481,U+74e0,U+7540,U+75c3,U+75e6,U+763c,U+764d,U+76cd,U+7704,U+7743,U+7780,U+7847,U+786a,U+78b9,U+7962,U+7a02,U+7aac,U+7ab3,U+7b0a,U+7b4c,U+7b7b,U+7bfc,U+7c0f,U+7c16,U+7c40,U+7ca2,U+7cc7,U+7cf8,U+7d77,U+7e3b,U+7ea1,U+7ea9,U+7ef2,U+7f02,U+7f07,U+7f0c,U+7f23,U+7f2f,U+7fbc,U+8016,U+8020,U+812c,U+8136,U+8182,U+822f,U+8233,U+825f,U+8268,U+8284,U+8288,U+8291,U+8308,U+8311,U+835b,U+836d,U+83dd,U+8406,U+840f,U+845c,U+84b4,U+84e3,U+850c,U+855e,U+863c,U+86ba,U+86c4,U+86de,U+86f1,U+873e,U+87bd,U+87db,U+880a,U+883c,U+887f,U+88f0,U+890a,U+892b,U+895e,U+89ef,U+8a48,U+8bdc,U+8c18,U+8c33,U+8c94,U+8db1,U+8dcf,U+8dd6,U+8de3,U+8e6f,U+8e90,U+8f7a,U+8fb6,U+902d,U+90be,U+91af,U+936a,U+948b,U+94d8,U+9513,U+953a,U+956c,U+963c,U+9654,U+966c,U+9688,U+97b4,U+996b,U+9a75,U+9a7a,U+9aba,U+9aed,U+9b08,U+9b43,U+9c8e,U+9c94,U+9c9a,U+9e2b,U+9e36,U+9e4b,U+9e4e,U+9e55,U+9e63,U+9e68-9e69,U+9ebd,U+9ec9,U+9f0d,U+9f37,U+9f51"}},{uri:GA,descriptors:{unicodeRange:"U+50a7,U+5240,U+5261,U+52ac,U+531a,U+5363,U+5432,U+5452,U+5456,U+5472,U+5478,U+553f,U+5575,U+5581,U+55cc,U+55fe,U+5601,U+572e,U+57d2,U+57ef,U+581e,U+5924,U+5981,U+5997,U+59a3,U+5aaa,U+5ab8,U+5b34,U+5d5d,U+5def,U+5e11,U+5e91,U+5ed1,U+5ef4,U+5f40,U+600d,U+6019,U+601b,U+605a,U+6092,U+60ab,U+6217,U+623d,U+6369,U+65d2,U+6661,U+670a,U+6753,U+67a7,U+6855,U+68f9,U+6939,U+696e,U+6980,U+6a7c,U+6aab,U+6b82,U+6bf3,U+6bf9,U+6c05,U+6c19-6c1a,U+6ca9,U+6cf6,U+6d1a,U+6dab,U+6f74,U+7085,U+7198,U+71b5,U+7256,U+725d,U+727e,U+72fa,U+7322,U+738e,U+73e5,U+750f,U+755a,U+7594,U+75b3,U+760c,U+7615,U+7630,U+763f,U+77ec,U+7817,U+78a1,U+78d9,U+7905,U+7b2a,U+7b2e,U+7b62,U+7b85,U+7bcc,U+7bea,U+7c26,U+7c74,U+7c9c-7c9d,U+7e47,U+7e9b,U+7e9f,U+7ee0,U+7ee8,U+7ef1,U+7f01,U+7f11,U+7f17,U+7f36,U+7f7e,U+7fee,U+802a,U+80cd,U+8112,U+8169,U+8234,U+8279,U+8298,U+82ca,U+82d8,U+82e1,U+83c0,U+83d4,U+83df,U+8401,U+8451,U+845a,U+8476,U+8478,U+84ba,U+84bd,U+84e0,U+851f,U+8548,U+8556,U+8585,U+868d,U+86e9,U+86f4,U+86f8,U+8765,U+8785,U+87ab,U+87ee,U+8832,U+8872,U+88b7,U+88e2-88e3,U+89da,U+8bce,U+8bd3,U+8bd6,U+8bf9,U+8c16,U+8c73,U+8d5c,U+8dde,U+8f6d,U+8f94,U+8fe8,U+9011,U+915e,U+9185,U+918c,U+94ab,U+94d1,U+94f3,U+9515,U+951d,U+9558,U+9567,U+96ce,U+96e9,U+9785,U+9878,U+987c,U+9883,U+98d1,U+9954,U+9963,U+9a93,U+9ac1,U+9acc,U+9b1f,U+9b49,U+9b4d,U+9b51,U+9ca7,U+9cae,U+9cce,U+9cd3,U+9e37,U+9e39,U+9e41,U+9e46,U+9f22,U+9f2f,U+9f39,U+9f85"}},{uri:YA,descriptors:{unicodeRange:"U+4e5c,U+4edf,U+4f25,U+4f32,U+4f5e,U+4f76,U+4faa,U+4fe6,U+5028,U+5048,U+5250,U+535f,U+538d,U+53c1,U+5412,U+5443,U+54d4,U+54dd,U+5541,U+5550,U+5577,U+55dd,U+55f3,U+560f,U+562c,U+5657-5658,U+5664,U+56af,U+575c,U+577c,U+57b2,U+57da,U+5800,U+5a62,U+5aeb,U+5c3b,U+5ca3,U+5d26,U+5d9d,U+5f01,U+5fb5,U+5fdd,U+5ff8,U+6029,U+6041,U+6079,U+60b1,U+6222,U+629f,U+6332,U+63bc,U+63e0,U+6485,U+65ab,U+65c3,U+65c6,U+668c,U+669d,U+66be,U+67fd,U+6800,U+68fc,U+690b,U+6924,U+6978,U+69a7,U+6a3e,U+6a50,U+6a5b,U+6a97,U+6b24,U+6b8d,U+6baa,U+6c10,U+6c54,U+6ceb,U+6d04,U+6d4d,U+6eb1,U+6ebd,U+7110,U+71b3,U+71f9,U+7230,U+728d,U+7292,U+72b8,U+72d2,U+7360,U+73a2,U+7511,U+75a0,U+75c8,U+779f,U+7826,U+7877,U+7a39,U+7aa8,U+7ae6,U+7b04,U+7b0f,U+7baa,U+7bac,U+7c1f,U+7ccd,U+7ecb,U+7ed4,U+7ed7,U+7efb,U+7f0d,U+7f5f,U+7faf,U+7fd5,U+7fe5,U+8027,U+80bc,U+80dd,U+80fc,U+8132,U+815a,U+8167,U+816d,U+81ca,U+8228,U+82a1,U+82a9,U+82ab,U+82cc,U+8351,U+8368,U+83b8,U+83d8,U+83ea,U+83f0,U+8497,U+84c1,U+858f,U+85ff,U+867b,U+86a8-86a9,U+870a,U+8722,U+876e,U+877c,U+87e5,U+8888,U+88df,U+8919,U+8bcc,U+8bdf,U+8be8,U+8bee,U+8c20,U+8c2f,U+8d36,U+8df8,U+8e05,U+8e2f,U+8f9a,U+9021,U+908b,U+90b4,U+90ba,U+90d0,U+90eb,U+90fe,U+91aa,U+933e,U+9486-9487,U+948d,U+9490,U+94ad,U+94bd,U+94d6,U+94d9,U+9507,U+9546,U+955e,U+956b,U+95e9,U+9604,U+960b,U+9612,U+9615,U+9617,U+96b9,U+989a-989b,U+989e,U+9a78,U+9a7d,U+9aa0,U+9aa2,U+9ac2,U+9b23,U+9b3b,U+9c82,U+9cca,U+9cd9,U+9e28,U+9e5a,U+9e5e,U+9e6c,U+9efe,U+9f0b"}},{uri:ZA,descriptors:{unicodeRange:"U+4e47,U+4e8d,U+4f65,U+4f89,U+50ee,U+520e,U+5416,U+5454,U+54bb,U+54c2,U+54d3,U+54de,U+5591,U+55e5,U+560c,U+566b,U+5769,U+578c,U+5793,U+57e4,U+5889,U+593c,U+59ab,U+5ad4,U+5ad8,U+5af1,U+5b53,U+5ba5,U+5c59,U+5c63,U+5d5b,U+5e0f,U+5e14,U+5edb,U+5fbc,U+6004,U+60ad,U+610e,U+61b7,U+624c,U+634c,U+647a,U+64ba,U+65f0,U+6600,U+66f7,U+67e2,U+67f0,U+680c,U+686b,U+6874,U+691f,U+6989,U+6a17,U+6b81,U+6b84,U+6c06-6c07,U+6c3d,U+6d07,U+6d27,U+6d2b,U+6d91,U+6e6b,U+6e8f,U+6fde,U+70bb,U+723b,U+726e,U+72b0,U+72ce,U+72f2,U+7301,U+731e,U+737e,U+7477,U+748e,U+74ff,U+7633,U+7654,U+771a,U+7726,U+7765,U+7768,U+781c,U+7829,U+78d4,U+7913,U+7957,U+79d5,U+79eb,U+7a70,U+7a86,U+7b25,U+7b38,U+7b47,U+7b72,U+7ba6-7ba7,U+7dae,U+7ee1,U+7efe,U+7f26,U+7f31,U+7f35,U+801c,U+8043,U+809f,U+80ab,U+80d7,U+8118,U+8188,U+81cc,U+823e,U+8244,U+824f,U+82b4,U+82c1,U+82e4,U+82f4,U+8306,U+833a,U+835c,U+839c,U+83b3,U+83bc,U+846d,U+867a,U+868b,U+8734,U+87ca,U+886e,U+887e,U+88a2,U+88c9,U+8921,U+8bb5,U+8bf3,U+8c04,U+8c17,U+8c1d,U+8c25,U+8c36,U+8c55,U+8c78,U+8d3d,U+8d40,U+8d59,U+8d67,U+8d91,U+8dbf,U+8deb-8dec,U+8dfd,U+8e14,U+8e41,U+8f8e,U+900b,U+9044,U+9062,U+90cf,U+9123,U+9146,U+9162,U+9172,U+918d,U+9190,U+92c8,U+93ca,U+948c,U+94aa,U+94b2,U+94c8,U+94ca,U+94d5,U+94df,U+94e9-94ea,U+94f7,U+94fc-94fd,U+951b,U+954f,U+9554,U+9559,U+9566,U+9571-9572,U+95f1,U+9608,U+960f,U+97af,U+988f,U+98d5,U+992e,U+9955,U+9ab0,U+9b32,U+9c90,U+9c9e,U+9ca5,U+9ca9,U+9cad,U+9cb1,U+9cc3,U+9e47,U+9ee7,U+9f87"}},{uri:KA,descriptors:{unicodeRange:"U+4e93,U+4ec4,U+4ef5,U+4f27,U+4f7b,U+4fe3,U+5080,U+5121,U+51eb,U+5208,U+52f0,U+53f5,U+5453,U+5466,U+54a6,U+54bf,U+54d0,U+5533,U+5549,U+5556,U+556d,U+558f,U+55f2,U+55f5,U+5627,U+567b,U+56d4,U+571c,U+5739,U+57b4,U+5807,U+58c5,U+59a4,U+59af,U+59d8,U+5a09,U+5a0c,U+5a4a,U+5ad2,U+5b6c,U+5ca2,U+5cac,U+5d03,U+5d6c,U+5db7,U+5ebe,U+5f2d,U+5fea,U+6042,U+6120,U+6175,U+6221,U+623e,U+6339,U+638a,U+643d,U+64b8,U+64e2,U+66e9,U+67b3,U+67c1,U+67d2,U+6832,U+6877,U+68f0,U+6934,U+6966,U+6987,U+6998,U+69c1,U+69ce,U+6a3d,U+6a84,U+6aa9,U+6b87,U+6bd6,U+6c16,U+6c18,U+6cd4,U+6cee,U+6de0,U+6e0c,U+6ecf,U+6f4b,U+70b7,U+7168,U+72d9,U+7352,U+73b3,U+73d0,U+7441,U+74d2,U+75a5,U+75e7-75e8,U+7610,U+7619,U+765e,U+772d,U+7812,U+782c,U+784c,U+7850,U+7856,U+789b,U+78f4,U+7a51,U+7b15,U+7b1e,U+7b24,U+7b5a,U+7bb8,U+7bc1,U+7bd9,U+7ed0,U+7ee6,U+7efa,U+7f1b,U+7f1f,U+7f22,U+7f45,U+7f71,U+7fa7,U+7fbf,U+7ff3,U+8052,U+80b1,U+80db,U+80f4,U+81bb,U+81ec,U+8202,U+8210,U+8249,U+828a,U+828e,U+82e3,U+8315,U+8369,U+8378,U+83a8,U+83aa,U+83b4,U+83e1,U+84fc,U+8538,U+853b,U+859c,U+85ae,U+86b4,U+86c9,U+86cf,U+8725,U+879f,U+87b3,U+887d,U+88fe,U+8a8a,U+8ba7,U+8c07,U+8c14,U+8c30,U+8c47,U+8db5,U+8dd7,U+8e1f,U+8e69,U+8e70,U+8e85,U+8f78,U+8f87,U+8f8b,U+8f8f,U+90c4,U+9143,U+917d,U+948f,U+94cd,U+94d2,U+94ef,U+954a,U+9609-960a,U+96d2,U+9708,U+9765,U+97ea,U+9880,U+98a7,U+996c,U+9980,U+9991,U+9a88,U+9ab6,U+9afb,U+9b47,U+9c87,U+9c9b,U+9cb5,U+9cc7,U+9e2c,U+9e42,U+9e58,U+9ecd,U+9ecf,U+9f8a,U+9f8c"}},{uri:qA,descriptors:{unicodeRange:"U+4ebb,U+4edd,U+4fa9,U+502c,U+50a5,U+51c7,U+51fc,U+523d,U+5241,U+530f,U+5464,U+549d,U+54a3,U+5514,U+5527,U+555c,U+556e,U+5576,U+55b1,U+55b9,U+55eb,U+5624,U+564c,U+5671,U+5685,U+568f,U+56d7,U+56e1,U+57a1,U+57d9,U+5942,U+5a67,U+5c50,U+5c7a,U+5c98,U+5d06,U+5d27,U+5d6f,U+5df3,U+5dfd,U+5e19,U+5ea0,U+5eb9,U+5eea,U+5ffe,U+600f,U+606b,U+6215,U+622c,U+6266,U+62bb,U+62bf,U+6308,U+6387,U+63b8,U+63c4,U+63c6,U+63f6,U+6441,U+6555,U+659b,U+6677,U+66a7,U+6775,U+678b,U+679e,U+6840,U+6849,U+6860,U+68c2,U+6910,U+6a28,U+6a2f,U+6a79,U+6b92-6b93,U+6bc2,U+6bfd,U+6c29,U+6c32,U+6c86,U+6cc5,U+6d0c,U+6d60,U+6da0,U+6ddd,U+6e86,U+6ed3,U+6edf,U+6fb9,U+6fd1,U+6fef,U+7023,U+7080,U+70ca,U+712f,U+7145,U+7284,U+732c,U+73c8,U+73d9,U+740a,U+7457,U+7596,U+759d,U+75a3,U+75d8,U+75e3-75e4,U+75ff,U+7622,U+7688,U+76b4,U+76e5,U+7818,U+7887,U+789a,U+78b2,U+7b08,U+7b33,U+7c2a,U+7ccc,U+7ea8,U+7ec0,U+7fe6,U+8012,U+8084,U+8093,U+80e4,U+80ef,U+8297,U+82a8,U+82be,U+8331,U+8366,U+83c5,U+83fd,U+8473,U+84a1,U+84ca,U+84d1,U+857b,U+85c1,U+85d3,U+8605,U+8662,U+86aa,U+86b1,U+86d4,U+86ed,U+86f3,U+8709,U+8748,U+874c,U+8763,U+89c7,U+89de,U+89e5,U+8a3e,U+8ba6,U+8c00,U+8c21,U+8c49,U+8c7a,U+8d30,U+8df9,U+8e51,U+8e59,U+8f6b,U+8f73,U+8ff3,U+9016,U+9026,U+902f,U+9099,U+909b,U+90c7,U+914a,U+91ae,U+91ba,U+9495,U+94a3,U+94af,U+94ba,U+94bf,U+94cc,U+94e1,U+94f0,U+9531,U+955d,U+95f3,U+9697,U+96bc,U+975b,U+977c,U+98a2,U+998a,U+9994-9995,U+9a9b,U+9ab7,U+9ac5,U+9c91,U+9ccf,U+9cd5,U+9e29,U+9edc,U+9edf,U+9f83,U+9f88-9f89"}},{uri:JA,descriptors:{unicodeRange:"U+4ee8,U+4f22,U+4f43,U+4f57,U+4f5d,U+4f6f,U+4ff8,U+502d,U+507b,U+5345,U+53df,U+53fb,U+544b,U+5482,U+54a7,U+54cc,U+550f,U+5544,U+5555,U+5594,U+55e8,U+55ec,U+55ef,U+564e,U+56f9,U+5704,U+576d,U+5785,U+57ad,U+5914,U+5958,U+599e,U+59aa,U+59be,U+5a06,U+5abe,U+5ae1,U+5b40,U+5bee,U+5cbf,U+5cc4,U+5ccb,U+5d47,U+603f,U+6078,U+607d,U+607f,U+608c,U+609a,U+60fa,U+61ff,U+621b,U+622e,U+626a,U+6371,U+63ae,U+63cd,U+63d6,U+6410,U+6414,U+6421,U+6448,U+64d8,U+6710,U+6748,U+6772,U+680e,U+6954,U+69ab,U+6c68,U+6c8f,U+6ca4,U+6d2e,U+6e4e,U+6e98,U+6fe0,U+7094,U+70e9,U+7116,U+7119,U+723f,U+73c9,U+74e4,U+753e,U+7548,U+75bd,U+75cd,U+7618,U+7634,U+76c5,U+76f1,U+7708,U+7719,U+777e,U+7791,U+77b3,U+7823,U+7827,U+7830,U+7889,U+7893,U+7949,U+795c,U+79e3,U+7a14,U+7a88,U+7a95,U+7aa0,U+7afd,U+7b90,U+7bd1,U+7bfe,U+7da6,U+7ec2,U+7eef,U+7f03-7f04,U+7f08,U+7f58,U+7f61,U+7f9f,U+8174,U+8200,U+828d,U+82c4,U+82d5,U+82dc,U+82f7,U+832d,U+835a,U+840b,U+8438,U+852b,U+869d,U+86ac,U+86d0,U+86f0,U+8782,U+87a8,U+87d1-87d2,U+87e0,U+8839,U+8913,U+891b,U+8934,U+8941,U+89ca,U+89ce,U+8a07,U+8ba3,U+8bc5,U+8bcb,U+8bdb,U+8c11,U+8c15,U+8c29,U+8c32,U+8dc4,U+8dce,U+8ddb,U+8dfa,U+8e09,U+8e1d,U+8e39,U+8e42,U+8e49,U+8e4b,U+8e8f,U+8f71-8f72,U+9004,U+9036,U+9097,U+90dc,U+90e2,U+90e6,U+90ef,U+9104,U+919a,U+91b4,U+938f,U+9497,U+950f,U+9557,U+9562-9563,U+9573,U+9606,U+9649,U+972d,U+973e,U+97a3,U+97eb,U+988c,U+9894,U+98a6,U+9974,U+9977,U+997d,U+9a90,U+9a9d,U+9aef,U+9ca2,U+9ccd,U+9cdf,U+9e20,U+9e4c,U+9e6b,U+9f3e"}},{uri:QA,descriptors:{unicodeRange:"U+4ede,U+4ee1,U+4eeb,U+4fda,U+4ffe,U+5025,U+506c,U+50f3,U+5106,U+520d,U+525c,U+52ad,U+530d,U+5310,U+539d,U+53a9,U+53fc,U+5421,U+5477,U+54e7,U+551b,U+5530,U+557e,U+5599,U+55c4,U+55d1,U+55d4,U+55df,U+55e4,U+55ea,U+5623,U+562d,U+5654,U+56eb,U+56f5,U+57a7,U+57d5,U+57dd,U+584d,U+5880,U+58ec,U+59dd,U+5a32,U+5a55,U+5a75,U+5b51,U+5b71,U+5b73,U+5cd2,U+5ce4,U+5e5b,U+5e96,U+5fd2,U+607b,U+61d1,U+634b,U+636d,U+63b3,U+63ff,U+64c0,U+661d,U+6657,U+66dc,U+67a5,U+6841,U+6867,U+6901,U+699b,U+6a47,U+6b46,U+6c21,U+6c24,U+6c35,U+6c4a,U+6c94,U+6ca3,U+6d39,U+6d63,U+6d6f,U+6d94,U+705e,U+71e7,U+726f,U+72cd,U+72de,U+72f0,U+7325,U+7350,U+7391,U+741a,U+757f,U+7583,U+75b1,U+75b4,U+75b8,U+75c2,U+75f1,U+766f,U+7699,U+7751,U+789c,U+7a17,U+7be6,U+7cb2,U+7ea3,U+7eb0,U+7ebe,U+7eeb,U+7f25,U+7f2c,U+7fb8,U+8026,U+8037,U+8153,U+8171,U+8191,U+8214,U+821b,U+8222,U+826e,U+82eb,U+830c,U+8314,U+8334,U+83d6,U+8418,U+843c,U+84ff,U+8564,U+8572,U+8616,U+866c,U+8693,U+86a3,U+86a7,U+86af,U+86b6,U+86c6,U+86ca,U+8708,U+870d,U+8759,U+8760,U+87af,U+87c6,U+8869,U+88c6,U+89d0,U+8b07,U+8baa-8bab,U+8bc2,U+8be4,U+8bf0,U+8c2a,U+8c62,U+8c89,U+8d49,U+8d6d,U+8d84,U+8d94,U+8db8,U+8dc6,U+8e2e,U+8e3d,U+8e47,U+8e7f,U+9005,U+9051,U+907d,U+9082,U+9088,U+90b0,U+90d3,U+9150,U+949c,U+94a4,U+94b9,U+94cb,U+94e0,U+9509,U+9512,U+951f,U+9534,U+9552-9553,U+965f,U+96b0,U+9791,U+9889,U+9990,U+9a9c,U+9aa7,U+9c88,U+9cb2-9cb3,U+9cb6-9cb7,U+9cc5,U+9cdc,U+9e22,U+9e2a,U+9e57,U+9e67,U+9e73,U+9e82,U+9eb8,U+9ee0,U+9f9b"}},{uri:eR,descriptors:{unicodeRange:"U+4eb5,U+4f09,U+4f5a,U+4f8f,U+4fce,U+4fdf,U+4fea,U+4ff3,U+500c,U+500f,U+504e,U+5088,U+52be,U+5420,U+5457,U+5499,U+549b,U+54c6,U+54d2,U+558b,U+559f,U+55bd,U+55d6,U+565c,U+567c,U+568e,U+5768,U+577b,U+57a9,U+57ed,U+59f9,U+5a11,U+5a40,U+5ae6,U+5b6a,U+5b93,U+5bb8,U+5c15,U+5c99,U+5c9c,U+5cc1,U+5d2e,U+5d4b,U+5d99,U+5e54,U+5e61,U+5fcf-5fd1,U+6002,U+6006,U+6014,U+60af,U+60c6,U+60da,U+60f4,U+621f,U+62c8,U+631b,U+631e,U+63e9,U+64b5,U+655d,U+6619,U+6635,U+6641,U+67ad,U+67b0,U+67b7,U+67e9,U+684e,U+688f,U+695d,U+696b,U+69b7,U+6a58,U+6c26,U+6d35,U+6d43,U+6d9e,U+6dd9,U+6dec,U+6e11,U+6e6e,U+6e9f,U+6ec2,U+6ee2,U+6ef9,U+6f09,U+6f66,U+6f8d,U+6fc2,U+6fc9,U+729f,U+72c8,U+73de,U+7430,U+7566,U+7579,U+75c9,U+75e2,U+75fc,U+762a,U+7638,U+7678,U+76c2,U+76f9,U+778c,U+77cd,U+77dc,U+7800,U+781d,U+782d,U+783b-783c,U+78a3,U+78ec,U+7980,U+7a23,U+7b95,U+7bdd,U+7c0c,U+7c41,U+7c91,U+7cb3,U+7cc5,U+7ecc,U+7f19,U+7fca,U+8006,U+8069,U+807f,U+80bd,U+80ed,U+814b,U+8198,U+82cb,U+82d2,U+834f,U+8360,U+847a,U+84d6,U+84e5,U+8537,U+85d0,U+8671,U+86a4,U+86ce,U+86f9,U+8703,U+8707,U+8737,U+873b,U+8815,U+8936,U+8bc3,U+8bcf,U+8bd2,U+8bd8,U+8be9,U+8c0c,U+8c0f,U+8c4c,U+8d45,U+8d5d,U+8d73,U+8e31,U+8e6d,U+8e76,U+8fe4,U+9041,U+90d7,U+9169,U+92ae,U+94a1,U+94c4,U+94c9,U+94db,U+94e7,U+9503,U+9506,U+9517,U+9528,U+9537,U+9542,U+9549,U+95fe,U+9616,U+961a,U+96c9,U+96f3,U+9701,U+970e,U+9739,U+9753,U+9798,U+98d2-98d3,U+98d9-98da,U+9968,U+996f,U+9984,U+9997,U+9acb,U+9b03,U+9c85,U+9ca8,U+9cab,U+9e49,U+9e51,U+9e66,U+9f10"}},{uri:tR,descriptors:{unicodeRange:"U+4e15,U+4e1e,U+4e2b,U+4eb3,U+4ec9,U+4f0e,U+4f64,U+501c,U+50a9,U+510b,U+51a2,U+51bc,U+527d,U+52d0,U+53fd,U+5429,U+542e,U+5486,U+54af,U+5506,U+5511,U+5522,U+552c,U+556c,U+55b3,U+55d2,U+55e6,U+55fd,U+561f,U+5639,U+5659,U+5662,U+5693,U+572a,U+5892,U+598a,U+5992,U+59a9,U+5a20,U+5ae3,U+5b17,U+5b7d,U+5d34,U+5d3d,U+5d4a,U+5d82,U+5e1a-5e1b,U+5ea5,U+5f0b,U+5f77,U+5fd6,U+5fff,U+6026,U+6035,U+6063,U+60b4,U+60bb,U+60ee,U+612b,U+6194,U+61ca,U+61e6,U+61f5,U+620a,U+6248,U+62a1,U+62d7,U+6376,U+637b,U+652b,U+65bc,U+65cc,U+65ce,U+65d6,U+664c,U+665f,U+6666,U+6684,U+66b9,U+6773,U+6777,U+6787,U+67de,U+6845,U+693d,U+6994,U+6a35,U+6d54,U+6d5c,U+6d8e,U+6dd6,U+6eb4,U+6f2a,U+6f78,U+704f,U+70ec,U+7118,U+714a,U+7172,U+71b9,U+724d,U+728a,U+7337,U+733e,U+7396,U+73b7,U+73cf,U+7428,U+742c,U+742e,U+74ee,U+74f4,U+7525,U+753a,U+7572,U+75d4,U+765c,U+768e,U+7762,U+777d,U+77fd,U+7825,U+7837,U+78b4,U+795f,U+79ed,U+7a1e,U+7b06,U+7b20,U+7ba9,U+7bab,U+7c7c,U+7cbd,U+7cdc,U+7ec9,U+7ef6,U+7f30,U+7f42,U+7f44,U+7f54,U+7f94,U+8004,U+800b,U+8019,U+809b,U+80ae,U+80c4,U+80f1,U+8146,U+816e,U+817c,U+81c0,U+81fc,U+81fe,U+822b,U+830f,U+832f,U+8340,U+8365,U+8385,U+8392,U+83a0,U+8424,U+84af,U+869c,U+8713,U+8717-8718,U+87c0,U+87cb,U+87fe,U+8821,U+8902,U+89d1,U+8bb9,U+8c12,U+8d32,U+8d53,U+8df7,U+8e7c,U+8f7c,U+8f95,U+8fab,U+9052,U+905b,U+9095,U+909d,U+90c5,U+911e,U+9122,U+916a,U+919b,U+948e,U+9492,U+949a,U+94b5,U+94bc,U+94c6,U+94f1,U+9502,U+9511,U+9536,U+956f-9570,U+9602,U+9621,U+9631,U+998b,U+99a5,U+9a81,U+9a9e,U+9ebe,U+9f8b"}},{uri:nR,descriptors:{unicodeRange:"U+4f2b,U+4f3d,U+4fac,U+5043,U+5055,U+5140,U+5156,U+51cb,U+5243,U+531d,U+536f,U+53a5,U+53ae,U+53f1,U+541d,U+5431,U+547b,U+5492,U+5494,U+54a4,U+54aa,U+54ce,U+54fd,U+5509,U+5520,U+553e,U+557b,U+55c5,U+55e1,U+55f7,U+5608,U+5636,U+563b,U+5773,U+57a0,U+5811,U+587e,U+58d5,U+59e3,U+5a29,U+5a6a,U+5a76,U+5a7a,U+5ac9,U+5b62,U+5b95,U+5c49,U+5c8c,U+5cab,U+5cb7,U+5d02,U+5d58,U+5e44,U+5e7a,U+5eff,U+5f29,U+5f89,U+5f9c,U+5fa8,U+6005,U+6043,U+60b8,U+60d8,U+60ec,U+60f0,U+6115,U+618e,U+630e,U+637a,U+6390,U+63ac,U+63b0,U+64de,U+6525,U+6538,U+65ee-65ef,U+6631,U+6636,U+6654,U+677c,U+67b8,U+67d8,U+683e,U+6886,U+68b5,U+692d,U+6963,U+6979,U+6988,U+6b59,U+6b9a,U+6c69,U+6c74,U+6cae,U+6ce0,U+6cef,U+6d95,U+6dc5,U+6dde,U+6de6,U+6dfc,U+6ea7,U+6f15,U+6f29,U+7096,U+70c3,U+7131,U+715c,U+7166,U+7266,U+7317,U+731d,U+7329,U+73e9,U+7425,U+7455,U+7490,U+74ef,U+7519,U+75b5,U+75b9,U+75de,U+7656,U+7663,U+7691,U+7729,U+77fe,U+783e,U+787c,U+795a,U+7a79,U+7abf,U+7b3a,U+7b4f,U+7b60,U+7b75,U+7b8d,U+7bb4,U+7bd3,U+7be1,U+7cbc,U+7edb,U+7f1c,U+7f8c,U+7fb2,U+7fb9,U+7fce,U+7ff1,U+810d,U+81c6,U+82a5,U+82aa,U+82de,U+8317,U+8343,U+835e,U+8364,U+836a,U+853a,U+8543,U+854a,U+8559,U+8568,U+85b0,U+85b9,U+864f,U+86e4,U+8715,U+8845,U+8884,U+88e8,U+88f1,U+8983,U+8be1,U+8c1f,U+8c27,U+8c5a,U+8c82,U+8d58,U+8dbe,U+8f98,U+9035,U+9074,U+90a1,U+9149,U+9157,U+93d6,U+949d,U+94c2,U+94e3-94e4,U+95eb,U+95f0,U+9611,U+9619,U+9642,U+968d,U+9706,U+970f,U+97ed,U+988a,U+9893,U+98e8,U+9a77,U+9a87,U+9aa1,U+9abc,U+9cdd,U+9e2f,U+9e33,U+9e44,U+9e5c,U+9e9d,U+9edd"}},{uri:aR,descriptors:{unicodeRange:"U+4f58,U+4f6c,U+4f70,U+4fd0,U+5014,U+51bd,U+524c,U+5315,U+5323,U+535e,U+540f,U+542d,U+545b,U+548e,U+549a,U+54ab,U+54fc,U+5567,U+556a,U+5600,U+5618,U+563f,U+5669,U+56f1,U+56ff,U+573b,U+574d,U+579b,U+57b8,U+57c2,U+586c,U+58f9,U+595a,U+598d,U+5993,U+5996,U+59d7,U+5b7a,U+5ba6,U+5c4e,U+5c96,U+5ce5,U+5eb6,U+5f08,U+5f99,U+602f,U+6059,U+606c,U+607a,U+60ed,U+61a9,U+620c,U+6249,U+62a8,U+62c4,U+62ed,U+62fd,U+6342,U+6345,U+6396,U+63a3,U+6402,U+6413,U+642a,U+6487,U+64a9,U+64ac,U+64ae,U+64b7,U+659f,U+65a1,U+667e,U+66f3,U+67e0,U+69db,U+69df,U+6aac,U+6b86,U+6c50,U+6c5e,U+6c76,U+6c85,U+6c8c,U+6cde,U+6d19,U+6d52,U+6da7,U+6db8,U+6e1a,U+6e25,U+6e4d,U+6e5f,U+6ec1,U+6f31,U+6f7a,U+6fa7,U+6fe1,U+701b,U+70ab,U+70f7,U+717d,U+71a8,U+7252,U+72c4,U+72e1,U+7315,U+736d,U+73ae,U+73c0,U+73c2,U+740f,U+75a4,U+7600-7601,U+768b,U+76bf,U+76d4,U+7728,U+772f,U+776c,U+77a0,U+77b0,U+77f8,U+783a,U+78d0,U+78fa,U+7977,U+7a37,U+7a92,U+7afa,U+7b71,U+7b94,U+7cef,U+7f28,U+7fe1,U+808b,U+80e5,U+80eb,U+8110,U+8113,U+812f,U+814c,U+81c3,U+8235,U+82d4,U+8309,U+83c1,U+8431,U+8469,U+84bf,U+84d3,U+84df,U+84e6,U+8511,U+8638,U+86c0,U+86db,U+86fe,U+8757,U+8822,U+8882,U+8885,U+8892,U+88f3,U+892a,U+8ba5,U+8bd9,U+8be0,U+8be7,U+8bfd,U+8c1a,U+8d4a,U+8d4e,U+8d66,U+8dda,U+8e0c,U+8e52,U+8e74,U+8e87,U+8f76,U+8fc2,U+8fe6,U+900d,U+9068,U+90ac,U+90b3,U+90b8,U+90e7,U+9119,U+9131,U+915a,U+916e,U+94b4,U+94d0,U+94e2,U+94ec,U+94ff,U+9522,U+9535,U+9556,U+965b,U+96f9,U+9774,U+9981,U+998d,U+998f,U+9a6e,U+9a7f,U+9a8a,U+9b13,U+9c9f,U+9e3e,U+9e43,U+9e6d,U+9e8b,U+9e92,U+9edb,U+9eef"}},{uri:iR,descriptors:{unicodeRange:"U+4e10,U+4e56,U+4e98,U+4ec3,U+4f3a,U+4f5f,U+4f88,U+4f97,U+4fa5,U+4fe8,U+504c,U+5197,U+52fa,U+5364,U+53e8,U+5406,U+543c,U+545c,U+5471,U+5480,U+5495,U+54b3,U+54df,U+54e6,U+54ee,U+557c,U+5583,U+55dc,U+55e3,U+566c,U+592f,U+5944,U+5983,U+59ca,U+59e5,U+5a13,U+5a7f,U+5b09,U+5bd0,U+5e4c,U+5eb5,U+5f1b,U+5f3c,U+608d,U+60cb,U+61a7,U+61ac,U+61cb,U+6233,U+62a0,U+62e7,U+62ee,U+62f4,U+62f7,U+634e,U+6382,U+63c9,U+63ea,U+6400,U+645e,U+6482,U+6556,U+6593,U+6615,U+664f,U+66e6,U+672d,U+675e,U+67da,U+6805,U+6808,U+6868,U+68a2,U+695e,U+69ad,U+6a80,U+6a90,U+6b83,U+6be1,U+6c30,U+6cad,U+6cb1,U+6cf1,U+6d31,U+6d93,U+6dae,U+6dbf,U+6dc6-6dc7,U+6e0d,U+6e32,U+6e3a,U+6e85,U+6eba,U+6f3e,U+6f5e,U+6f7c,U+6fee,U+71ee,U+722a,U+72b7,U+72e9,U+73ba,U+73d1,U+7409,U+7435-7436,U+7459-745a,U+747e,U+7487,U+74e2,U+7504,U+752c-752d,U+7599,U+759f,U+75a1,U+75ca,U+75f0,U+761f,U+7629,U+777f,U+7785,U+77a5,U+77bf,U+78d5,U+7934,U+7940,U+79a7,U+7b19,U+7c38,U+7c95,U+7cb1,U+7ce0,U+7eca,U+7ef7,U+7f2b,U+7f81,U+7fcc,U+8046,U+8148,U+8165,U+819b,U+81ba,U+828b,U+82ae,U+82b7,U+82d3,U+8301,U+830e,U+831c,U+8338,U+837c,U+8393,U+8398,U+83ba,U+83e0,U+83e9,U+853c,U+8654,U+86df,U+8712,U+873f,U+874e,U+8783,U+8859,U+88a4,U+8925,U+8bb7,U+8bff,U+8c19,U+8c1b,U+8c24,U+8c2c,U+8d61,U+8db4,U+8e6c,U+8f8a,U+8fe5,U+8ff8,U+901e,U+90f4,U+912f,U+9163,U+9170,U+91dc,U+949b,U+94a8,U+94b3,U+94c0,U+94e8,U+9525,U+9530,U+9539,U+954c-954d,U+9550,U+955b,U+962a,U+9685,U+96cc,U+9776,U+988d,U+9975,U+9985,U+9a6f,U+9aa5,U+9ab8,U+9c7f,U+9ca4,U+9cb8,U+9e25,U+9e35,U+9e4a"}},{uri:rR,descriptors:{unicodeRange:"U+4ea2,U+4ea5,U+4f36,U+4f84,U+4f8d,U+501a,U+5029,U+516e,U+51a5,U+51c4,U+51f8,U+5201,U+527f,U+5321,U+5352,U+5366,U+53e9,U+54c7,U+5632,U+5676,U+56b7,U+56bc,U+56da,U+56e4,U+5703,U+5729,U+5742,U+57a2-57a3,U+5815,U+58d1,U+5919,U+592d,U+5955,U+5a05,U+5a25,U+5a34,U+5b70,U+5b75,U+5bdd,U+5bf0,U+5c41,U+5c79,U+5c91,U+5c94,U+5ce6,U+5ced,U+5d69,U+5dc5,U+5e16,U+5e27,U+5f27,U+5f95,U+5ffb,U+6020,U+604d,U+6055,U+60e6,U+60eb,U+6123,U+618b,U+61a8,U+620d,U+62c7,U+62ce,U+62d9,U+631f,U+634d,U+6452,U+6479,U+64ce,U+64d2,U+655b,U+660a,U+6726,U+67c4,U+6809,U+6853,U+68e3,U+68f1,U+68fa,U+693f,U+6942,U+6995,U+69a8,U+69b4,U+6a71,U+6b89,U+6bcb,U+6bd3,U+6bd9,U+6c40,U+6cf8,U+6cfe,U+6d85,U+6da3,U+6daa,U+6e0e,U+6e43-6e44,U+6f88,U+7078,U+7099,U+70bd,U+70d9,U+70fd,U+7109,U+7184,U+7239,U+733f,U+73f2,U+748b,U+749c,U+749e,U+759a,U+75d2,U+75eb,U+7620,U+766b,U+7693,U+76cf,U+7738,U+773a,U+776b,U+778e,U+77aa,U+7852,U+78be,U+7948,U+795b,U+7960,U+796f,U+79ba,U+7a20,U+7a96,U+7aa5,U+7b03,U+7b28,U+7b50,U+7b77,U+7bc6,U+7bf1,U+7c27,U+7d0a,U+7ead,U+7ec5,U+7ee2,U+7ef0,U+7efd,U+7f0e,U+7f2e,U+7f79,U+7f9a,U+8098,U+80da,U+80e7,U+80f0,U+80f3,U+80fa,U+818a,U+81e7,U+8237-8238,U+8299,U+82b8,U+82ce,U+837b,U+83bd,U+83cf,U+8426,U+8475,U+85c9,U+85d5,U+85dc,U+85e9,U+871a,U+8747,U+8749,U+888d,U+8910,U+891a,U+8bb4,U+8be3,U+8bec,U+8bf2,U+8c06,U+8c0d,U+8d31,U+8d48,U+8de4,U+8e1e,U+8e4a,U+8e66,U+8f84,U+8f97,U+9083,U+90e1,U+9165,U+91c9,U+94b0,U+94f5,U+9504,U+9532,U+956d,U+95f5,U+95fa,U+9668,U+9698,U+96bd,U+9704,U+9773,U+9890,U+996a,U+997a,U+9a74,U+9a8b,U+9cc4,U+9ccc"}},{uri:sR,descriptors:{unicodeRange:"U+4ea8,U+4f1e,U+4f51,U+4f63,U+4f7c,U+4f83,U+4fa0,U+4fd1,U+4ffa,U+5018,U+5026,U+508d,U+50bb,U+50f5,U+50fb,U+5162,U+5319,U+5320,U+538c,U+5413,U+541f,U+5475,U+54bd,U+54d1,U+5589,U+5598,U+575f,U+57ae,U+57e0,U+5937,U+5974,U+5978,U+59ae,U+5a1f,U+5a49,U+5ab3,U+5b99,U+5b9b,U+5ba0,U+5be1,U+5be5,U+5c09,U+5c27,U+5de2,U+5e9a,U+5f26,U+5f8a,U+5f98,U+6021,U+606d,U+60bc,U+60d5,U+60e7,U+611a,U+614c,U+6254,U+626f,U+6292,U+6296,U+62b9,U+62e2,U+631a,U+631d,U+6320,U+6346,U+63ba,U+6467,U+64bc,U+658b,U+663c,U+6643,U+6652,U+6656,U+6687,U+66d9,U+66dd,U+66f0,U+673d,U+67ab,U+6816-6817,U+68a7,U+68ad,U+68cd,U+68e0,U+6986,U+69fd,U+6b47,U+6bd7,U+6c1f,U+6c2e-6c2f,U+6cbe,U+6de4,U+6e1d,U+6e83,U+6e9c,U+6ed4-6ed5,U+6f4d,U+70f9,U+7130,U+716e,U+718f,U+71ac,U+71e5,U+72fc,U+731c,U+7334,U+73ca,U+7422,U+7426,U+745f,U+7470,U+75af,U+75f4,U+762b,U+763e,U+7696,U+7737,U+7741,U+77a7,U+77bb,U+77ee,U+785d,U+788c,U+78ca,U+7901,U+796d,U+7985,U+79fd,U+7a3c,U+7a57,U+7a74,U+7b5b,U+7caa,U+7cb9,U+7cd5,U+7eac,U+7eb6,U+7ed1,U+7ee5,U+7f20,U+7f2a,U+7f38,U+7f69,U+7fa1,U+8018,U+8038,U+803f,U+804b,U+80a2,U+80be,U+80d6,U+817a,U+81fb,U+820c,U+82ad,U+82af,U+82bd,U+8327,U+8354,U+835f,U+8367,U+836b,U+840c,U+841d,U+8471,U+849c,U+84b2,U+84c9,U+8517,U+851a,U+8549,U+8681,U+8721,U+8776,U+88d9,U+88f9,U+89c5,U+8c1c,U+8c34,U+8d81,U+8d9f,U+8e0a,U+8e72,U+8eb2,U+8fed,U+901b,U+902e,U+906e,U+9091,U+90aa,U+90af,U+915d,U+9171,U+946b,U+9489,U+9499,U+94a5,U+9508,U+9524,U+952d,U+9551,U+9576,U+95f7,U+9600,U+96b6,U+96c0,U+9756,U+97f6,U+98a0,U+98a4,U+997f,U+9a73,U+9a86,U+9ad3,U+9e3d,U+9ed4"}},{uri:lR,descriptors:{unicodeRange:"U+4e4d,U+4e5e,U+4ec7,U+4ed5,U+50da,U+50e7,U+515c,U+51a4,U+51ff,U+5203,U+5254,U+5300,U+533e,U+5375,U+53ee,U+5435,U+543b,U+5455,U+548b,U+548f,U+54d7,U+54fa,U+5578,U+5587,U+55a7,U+560e,U+5760,U+576f,U+5777,U+5830,U+58a9,U+5962,U+59e8,U+5a07,U+5a23,U+5a3c,U+5b5a,U+5bb5,U+5bc5,U+5bde,U+5c7f,U+5cb1,U+5ce8,U+5cea,U+5d29,U+5d4c,U+5e18,U+5f57,U+5f5d,U+5f87,U+5ff1,U+6016,U+601c,U+6064,U+6177,U+61d2,U+625b,U+62e3,U+62f1,U+634f,U+63a0,U+6401,U+6405,U+6495,U+64c2,U+6512,U+6577,U+6590,U+65a7,U+65a9,U+65f7,U+6627,U+6655,U+6714,U+6795,U+67d1,U+67ff,U+68b3,U+68d5,U+68d8,U+6930,U+6960,U+6977,U+69bb,U+69d0,U+6a31,U+6b7c,U+6bb4,U+6c22,U+6c72,U+6c79,U+6c7e,U+6c81,U+6c93,U+6ca5,U+6cbc,U+6ce3,U+6cfb,U+6d3c,U+6da9,U+6df3,U+6e2d,U+6eaf,U+6ec7,U+6f13,U+6f33,U+6f62,U+6fa1,U+7011,U+707c,U+708a,U+70c1,U+70d8,U+70eb,U+711a,U+7194,U+7281,U+7316,U+7357,U+7384,U+7405,U+742a,U+745b,U+7574,U+7578,U+75ea,U+7682,U+7792,U+77d7,U+77e9,U+77eb,U+77f6,U+780c,U+78c5,U+7941,U+79e4,U+7a1a,U+7a9c,U+7ad6,U+7b5d,U+7bf7,U+7c07,U+7c3f,U+7c9f,U+7ca5,U+7cdf,U+7e82,U+7eab,U+7ece,U+7eda,U+7f09,U+7f15,U+7f9e,U+7fdf,U+7fe9,U+803b,U+803d,U+80aa,U+80b4,U+813e,U+8155,U+817b,U+819d,U+821c,U+82b9,U+82df,U+82ef,U+8304,U+83b9,U+8446,U+853d,U+85af,U+85fb,U+8650,U+865e,U+86d9,U+86ee,U+8700,U+8862,U+889c,U+88d4,U+88f8,U+895f,U+8a79,U+8bb3,U+8bb6,U+8bc0,U+8beb,U+8bf5,U+8c23,U+8c79,U+8d1e,U+8dcb,U+8e29,U+8e44,U+8e81,U+8eac,U+8eaf,U+8f8d,U+9050,U+90f8,U+914b,U+948a,U+94be,U+94ee,U+950c,U+9540,U+962e,U+9647,U+9661,U+9699,U+96cf,U+9716,U+9761,U+97a0,U+97e7,U+9a7c,U+9a8f,U+9ae6,U+9cd6,U+9e26"}},{uri:oR,descriptors:{unicodeRange:"U+4fa3,U+4fae,U+4fd8,U+4fef,U+50a3,U+5189,U+5195,U+51db,U+51f3,U+51f9,U+5220,U+5228,U+5288,U+52ff,U+532e,U+533f,U+5351,U+53db,U+53ed,U+5450,U+5484,U+5490,U+54c9,U+54e9,U+5501,U+5507,U+5543,U+55d3,U+56a3,U+575e,U+589f,U+5984,U+59ec,U+5a04,U+5a36,U+5a77,U+5a9a-5a9b,U+5ab2,U+5ac2,U+5ad6,U+5bc7,U+5c2c,U+5c34,U+5c51,U+5cd9,U+5d0e,U+5deb,U+5e3c,U+5e87,U+5ed3,U+5f13,U+5f64,U+5fe1,U+606a,U+6096,U+60df,U+60f6,U+60f9,U+6151,U+620e,U+6241,U+6252,U+6273,U+627c,U+6289,U+62c2,U+62cc,U+62ef,U+6361,U+6363,U+63b7,U+63e3,U+6518,U+66ae,U+6756,U+6789,U+6813,U+6829,U+6862,U+6866,U+6893,U+6897,U+690e,U+6984,U+69cc,U+6a1f,U+6a44,U+6a59,U+6ba1,U+6c13,U+6c90,U+6ca6,U+6cbd,U+6ccc,U+6cd3,U+6cd7,U+6d4a,U+6d4f,U+6d5a,U+6d9f,U+6da1,U+6dcc,U+6ea5,U+6ee4,U+6ee6,U+6f2f,U+6f8e,U+701a,U+7095,U+709c,U+70af,U+70db,U+70e8,U+714e,U+715e,U+71a0,U+71ce,U+7235,U+7280,U+72d0,U+72f8,U+73ab,U+7410,U+745c,U+7480,U+74a7-74a8,U+74e3,U+75ae,U+75f9,U+76b1,U+76ce,U+7736,U+77e2-77e3,U+781a,U+789f,U+797a,U+79be,U+79c3,U+79c6,U+79f8,U+7a8d,U+7a98,U+7aa6,U+7aff,U+7b1b,U+7cd9,U+7d6e,U+7ede,U+7eee,U+7f00,U+7f24,U+7f2d,U+7fd8,U+800d,U+8116,U+8151,U+81b3,U+8205,U+82c7,U+82db,U+832c,U+8335,U+8339,U+8386,U+846b,U+8587,U+8611,U+8682,U+868a,U+868c,U+8774,U+88d8,U+88f4,U+8912,U+8b6c,U+8bbd,U+8c0e,U+8c41,U+8d26,U+8d3b-8d3c,U+8d50,U+8dea,U+8e35,U+8f99,U+8fe2,U+8fe9,U+9017,U+914c,U+916f,U+9175-9176,U+918b,U+94a0,U+94ae,U+94ce,U+94f2,U+951a,U+952f,U+9541,U+9640,U+9672,U+968b,U+96cd,U+96ef,U+9713,U+97ec,U+9885,U+9992,U+9a6d,U+9a79,U+9a85,U+9cbb,U+9cd7,U+9cde,U+9e93,U+9f9f"}},{uri:cR,descriptors:{unicodeRange:"U+4e11,U+4ed7,U+4fcf,U+4fe9,U+4fed,U+50ac,U+50b2,U+5112,U+5180,U+5188,U+51f6,U+522e,U+5265,U+52cb,U+52df,U+5349,U+5367,U+5378,U+537f,U+5395,U+5398,U+53d4,U+543e,U+5440,U+5446,U+54b8,U+5565-5566,U+5580,U+55bb,U+56ca,U+572d,U+573e,U+574e,U+5782-5784,U+58f3,U+5938-5939,U+5948,U+594e,U+5a1c,U+5a74,U+5ae9,U+5b55,U+5b5c,U+5bb0,U+5bd3,U+5bf8,U+5c3f,U+5d14,U+5d2d,U+5df7,U+5dfe,U+5e05-5e06,U+5e1c,U+5e62,U+5e7b,U+5e7d,U+5ed6,U+5f2f,U+5f66,U+5f6c,U+5fa1,U+604b,U+609f,U+60a6,U+60e8,U+6101,U+6124,U+6127,U+6148,U+61be,U+6247,U+62d8,U+62da,U+633d,U+635e,U+6367,U+6380,U+638f,U+63a9,U+63fd,U+641c,U+64e6,U+655e,U+6572,U+6591,U+65a5,U+6691,U+6735,U+67a2-67a3,U+67ef,U+680b,U+6876,U+6905,U+6a0a,U+6a61,U+6b79,U+6bb7,U+6bbf,U+6c41,U+6c55,U+6c83,U+6c9b,U+6ca7,U+6cfc,U+6d46,U+6d51,U+6d74,U+6d9d,U+6daf,U+6dc0,U+6deb,U+6e17,U+6e24,U+6e89,U+6ea2,U+6ef4,U+6f6d,U+707f,U+70b3,U+70e4,U+70ef,U+710a,U+722c,U+725f,U+7261,U+72ee,U+72f1,U+730e,U+732b,U+7433,U+7538,U+75bc,U+7624,U+7709,U+7750,U+7779,U+7802,U+7898,U+78a7,U+78b1,U+78cb,U+78f7,U+7984,U+7a83,U+7aed,U+7b3c,U+7b4b,U+7c92,U+7c98,U+7ca4,U+7eb9,U+7ee3,U+7ef3,U+7ef5,U+7f05,U+7f55,U+7f62,U+7fc1,U+7fd4,U+7fe0,U+8042,U+806a,U+80a0,U+80a4,U+80c3,U+8102,U+8106,U+814a,U+8154,U+8247,U+8258,U+82cd,U+8328,U+832b,U+8389,U+83ca,U+845b,U+846c,U+84b8,U+8574,U+859b,U+8680,U+8695,U+86c7,U+8702,U+886c,U+8896,U+88b1,U+88e4,U+8bc8,U+8c10,U+8c26,U+8c28,U+8c2d,U+8d4c,U+8d63,U+8f67,U+8f74,U+8fc4,U+9006,U+9063,U+90a2,U+90b1,U+90c1,U+9177,U+9189,U+9493,U+949e,U+94fe,U+9610,U+961c,U+96a7,U+96fe,U+978d,U+97f5,U+9888,U+997c,U+9a84,U+9b3c,U+9b44-9b45,U+9b54,U+9e64,U+9f0e,U+9f9a"}},{uri:dR,descriptors:{unicodeRange:"U+4e19,U+4e38,U+4e53,U+4e7e,U+4e9f,U+4ec6,U+4f50,U+4fde,U+502a,U+5154,U+517d,U+51d1,U+51f0,U+5239,U+5256,U+52c9,U+52fe,U+5308,U+532a,U+535c,U+5384,U+53a2,U+53a8,U+53c9,U+53e0,U+5496,U+54ac,U+54c0,U+54c4,U+54e8,U+5561,U+5582,U+561b,U+5631,U+566a,U+5764,U+576a,U+5792,U+57ab,U+584c,U+5885,U+58f6,U+59a8,U+5acc,U+5bc2,U+5c38-5c39,U+5c60,U+5c6f,U+5c82,U+5c90,U+5d16,U+5dcd,U+5e37,U+5e90,U+5eb8,U+5f6a,U+5fcc,U+6012,U+6068,U+6073,U+607c,U+6094,U+6109,U+621a,U+626e,U+6284,U+62d0,U+62e6,U+62fe,U+6321,U+6328,U+632b,U+6349,U+6454,U+65ed,U+660f,U+6674,U+66a8,U+6749,U+674f,U+6760,U+67af,U+6850,U+6854,U+6869,U+68a8,U+68d2,U+68f5,U+6912,U+6b49,U+6b6a,U+6bef,U+6c28,U+6c5d,U+6c82,U+6cab,U+6cb8,U+6cc4,U+6cf5,U+6d47,U+6d78,U+6da4,U+6dc4,U+6dcb,U+6df9,U+6e0a,U+6e23,U+6e5b,U+6eb6,U+6f06,U+6f47,U+6f84,U+6f9c,U+6fd2,U+7076,U+70ac,U+7199,U+723d,U+72ac,U+72ed,U+7476,U+7529,U+752b,U+754f,U+7554,U+75d5,U+7626,U+76ef,U+7720,U+7766,U+7784,U+77ac,U+780d,U+7838,U+7845,U+786b,U+78b3,U+7978,U+79b9,U+79c9,U+79e7,U+7a3d,U+7a84,U+7a9f,U+7b0b,U+7b52,U+7c7d,U+7f1a,U+7fc5,U+7ff0,U+804a,U+8086-8087,U+808c,U+809a,U+80ba,U+810a,U+8180,U+818f,U+81c2,U+81ed,U+8231,U+8292,U+829c,U+82a6,U+82d1,U+8346,U+838e,U+839e,U+83c7,U+83f1,U+8403,U+840e,U+8513,U+857e,U+85e4,U+867e,U+871c,U+87ba,U+87f9,U+884d,U+8944,U+8a93,U+8c05,U+8d2c,U+8d2e,U+8d42-8d43,U+8dfb,U+8e22,U+8eba,U+8f69,U+8f9c,U+8fa3,U+8fa8,U+8fb1,U+900a,U+9038,U+903b,U+9042,U+904f,U+90b5,U+90dd,U+9102,U+9187,U+94a7,U+94c5,U+9523,U+95f8,U+95fd,U+960e,U+964b-964c,U+96c1,U+9709,U+971c,U+97ad,U+9882,U+9965,U+9976,U+9988,U+99a8,U+9a82,U+9a9a,U+9b41,U+9c8d,U+9e45,U+9e70,U+9e9f,U+9f3b,U+9f7f"}},{uri:uR,descriptors:{unicodeRange:"U+4e08,U+4e18,U+4e1b,U+4e22,U+4e27,U+4e32,U+4e52,U+4e73,U+4ead,U+4ed4,U+4ed9,U+4ef0,U+4fa6,U+5076,U+5179,U+51bb,U+51c9,U+51ef,U+51fd,U+524a,U+526a,U+529d,U+52ab,U+5306,U+5339,U+53d9,U+540a,U+5410,U+541e,U+5439,U+54b1,U+54ed,U+5564,U+558a,U+55b7,U+5634,U+574a,U+5751,U+57a6,U+57cb,U+57d4,U+5824,U+582a,U+5835,U+5858,U+5893,U+58e4,U+5951,U+5986,U+59da,U+59fb,U+59ff,U+5a03,U+5a46,U+5ac1,U+5b5d,U+5bfa,U+5c18,U+5c3a,U+5c48,U+5c4f,U+5c61,U+5cb3,U+5d1b,U+5e15,U+5e3d,U+5e99,U+5e9e,U+5eca,U+5f0a,U+5f17-5f18,U+5f25,U+5f7c,U+5fcd,U+6028,U+60a0,U+60ac,U+60d1,U+614e,U+6155,U+6168,U+61c8,U+6208,U+6212,U+6251,U+629a-629b,U+62ab-62ac,U+62fc,U+6323,U+632a,U+63d2,U+643a,U+6491-6492,U+649e,U+64b0,U+64c5,U+659c,U+6614,U+662d,U+6664,U+6670,U+6676,U+6746,U+67cf,U+67d4,U+682a,U+6843,U+6846,U+68da,U+6b3a,U+6b67,U+6c27,U+6c5b,U+6c64,U+6c70,U+6caa,U+6cca,U+6ce1,U+6d12,U+6d45,U+6dd1,U+6dd8,U+6e34,U+6e7f,U+6ee5,U+6f02,U+7092,U+70c2,U+70e6,U+7115,U+7237,U+7272,U+727a,U+72c2,U+739b,U+73b2,U+743c,U+751c,U+758f,U+75b2,U+7686,U+76c6,U+76d2,U+76fc,U+775b,U+77a9,U+7816,U+788e,U+7897,U+78b0,U+79bd,U+7a0d,U+7a91,U+7a9d,U+7ae3,U+7bad,U+7cca,U+7d2b,U+7eb1,U+7f06,U+7f14,U+7f1d,U+7f50,U+7ffc,U+8036,U+80bf,U+80c1,U+80ce,U+80f8,U+8109,U+810f,U+8170,U+8179,U+819c,U+821f,U+8230,U+8236,U+8273,U+829d,U+82f9,U+8305,U+8350,U+83b2,U+83cc,U+8404,U+840d,U+8427,U+8482,U+8679,U+8854,U+886b,U+8bbc,U+8be6,U+8c31,U+8c6b,U+8d4b,U+8dcc,U+8e2a,U+8e48,U+8f90,U+8fb0,U+9022,U+903c,U+903e,U+9065,U+916c,U+917f,U+94a9,U+94c3,U+94dd,U+94ed,U+9510,U+953b,U+96c7,U+970d,U+9738,U+9877,U+987d,U+989c,U+98d8,U+9a70,U+9a91,U+9aa4,U+9b42,U+9b4f,U+9e2d,U+9e3f,U+9e7f,U+9f20"}},{uri:fR,descriptors:{unicodeRange:"U+4e59,U+4ed3,U+4f0f,U+4f38,U+4f69,U+4fa7,U+4faf,U+4ff1,U+5077,U+5085,U+5144,U+5151,U+51af,U+51b6,U+51cc,U+523a,U+5251,U+5269,U+5272,U+52d8,U+5353,U+5389,U+53f9,U+5401,U+5415,U+541b,U+54f2,U+5524,U+554a,U+559d,U+5609,U+5740,U+575d,U+5806,U+5821,U+586b,U+5915,U+594f,U+5960,U+5999,U+59a5,U+59b9,U+59c6,U+59d1,U+59dc,U+5b5f,U+5b64,U+5b87,U+5bb4,U+5bbf,U+5c16,U+5c1d,U+5c3e,U+5c9a,U+5ca9,U+5cad,U+5cfb,U+5de1,U+5de7,U+5de9,U+5ef7,U+5f04,U+5f70,U+5f79,U+5fc6,U+602a,U+6050,U+6052,U+6070,U+6084,U+60b2,U+60dc,U+60e9,U+6167,U+6170,U+61c2,U+6270,U+6291,U+62b1,U+62bc,U+62dc,U+62df,U+62f3,U+6324,U+633a,U+6377,U+6398,U+63cf,U+640f,U+642c-642d,U+6458,U+6478,U+6500,U+654c,U+6566,U+658c,U+65c1,U+65cb,U+65e8,U+65ec,U+6696-6697,U+6734,U+679a,U+679d,U+67dc,U+67f3-67f4,U+680f,U+683d,U+684c,U+68af,U+699c,U+6bc1,U+6c0f,U+6c1b,U+6c57,U+6c6a,U+6d3d,U+6d6e,U+6d82,U+6db5,U+6dee,U+6e58,U+6eaa,U+6ecb,U+6ede,U+6ee9,U+6f0f,U+6f20,U+6f58,U+704c,U+7070,U+70b8,U+718a,U+7238,U+7262,U+7275,U+72b9,U+72d7,U+72e0,U+741b,U+7434,U+7483,U+74f6-74f7,U+75ab,U+764c,U+7761,U+7855,U+7891,U+78c1,U+79d2,U+7a00,U+7a3b,U+7c97,U+7ea4,U+7eb2,U+7ed2,U+7eea,U+7ef8,U+7f18,U+7fbd,U+8000,U+8010,U+8096,U+809d,U+80a9,U+817f,U+81e3,U+8206,U+8212,U+82ac,U+8302,U+8361,U+8377,U+83f2,U+8461,U+848b,U+84ec,U+8521,U+85aa,U+8870,U+8877,U+8881,U+888b,U+88ad,U+88c2,U+8986,U+8bd1,U+8bf1,U+8d24,U+8d2a,U+8d3e-8d3f,U+8d41,U+8d56,U+8d64,U+8d6b,U+8e0f,U+8f70,U+8f85,U+8f88,U+8fa9,U+9003,U+901d,U+90b9,U+90ce,U+94a6,U+94f8,U+9505,U+95ea,U+95ef,U+95f2,U+95f9,U+9601,U+9605,U+9634,U+966a,U+9677,U+9690,U+9694,U+96d5,U+971e,U+9896-9897,U+9972,U+9a71,U+9a76,U+9a7e,U+9e1f,U+9e23"}},{uri:hR,descriptors:{unicodeRange:"U+4e01,U+4e43,U+4ea6,U+4ef2,U+4eff,U+4f26,U+4f2a,U+4f2f,U+4f5b,U+4fa8,U+4fca,U+4fd7,U+5021,U+504f,U+5141,U+51c0,U+51dd,U+51e4,U+51ed,U+5200,U+5237,U+5427,U+5448,U+54a8,U+5706,U+5708,U+5723,U+575b,U+57c3,U+5899,U+58a8,U+58c1,U+5976,U+5988,U+59bb,U+59d0,U+59d3,U+5a18,U+5a31,U+5a92,U+5b54,U+5b85,U+5baa-5bab,U+5bc4,U+5bd2,U+5be8,U+5bff,U+5c65,U+5d07,U+5e1d,U+5e78,U+5e7c,U+5f03,U+5f1f,U+5f39,U+5f6d,U+5f92,U+5faa,U+5fbd,U+5fe7,U+5ffd,U+60a8,U+60ef,U+6108,U+6162,U+622a,U+6234,U+626b,U+626d,U+62c6,U+62d2,U+62d4,U+62d6,U+62e8,U+6316,U+6355,U+63ed,U+6447,U+64a4,U+65f1,U+6606,U+6628,U+664b,U+6668,U+6682,U+66f9,U+66fc,U+66ff,U+6717,U+6740,U+676d,U+67aa,U+67ec,U+67f1,U+6842,U+6851,U+695a,U+6982,U+6a2a,U+6b20,U+6b23,U+6b32,U+6b96,U+6bc5,U+6beb,U+6c60,U+6c9f,U+6cea,U+6cf3,U+6d1e,U+6d53,U+6d66,U+6d69,U+6d8c,U+6d9b,U+6db2,U+6de1,U+6dfb,U+6e14,U+6ed1,U+6eda,U+6ee8,U+6f2b,U+706d,U+7089,U+708e,U+70ad-70ae,U+70e7,U+7126,U+714c,U+71c3,U+71d5,U+7206,U+7259,U+731b,U+73a9,U+73bb,U+74dc,U+7532,U+7545,U+755c,U+75c7,U+7687,U+76d7,U+76f2,U+788d,U+78e8,U+79e6,U+79e9,U+7a3f,U+7a46,U+7a97,U+7af9,U+7bee,U+7c4d,U+7c89,U+7cd6,U+7eb5,U+7ebd,U+7ed8,U+8017,U+8033,U+80c0,U+80de,U+80f6,U+8138,U+817e,U+81a8,U+820d,U+827e,U+82b3,U+82d7,U+83b1,U+84c4,U+84dd,U+8584,U+864e,U+865a,U+866b,U+86cb,U+88d5,U+89e6,U+8bca,U+8bde,U+8bfa,U+8c0a,U+8c37,U+8c46,U+8c6a,U+8c8c,U+8d1d,U+8d29,U+8d4f,U+8d54,U+8d5a,U+8d60,U+8d62,U+8f7f,U+8f96,U+8f9e-8f9f,U+8fc1,U+8fdf,U+8fea,U+8ff7,U+9012,U+906d,U+9075,U+90a6,U+90bb,U+90ca,U+9178,U+9192,U+91ca,U+94bb,U+94dc,U+94fa,U+9501,U+950b,U+9521,U+955c,U+963b,U+9655,U+9675-9676,U+9887,U+9891,U+9971,U+9a97,U+9ece,U+9ed8"}},{uri:pR,descriptors:{unicodeRange:"U+4e1d,U+4e39,U+4e4c,U+4e4f,U+4e54,U+4e58,U+4e95,U+4ea1,U+4eab,U+4eae,U+4ec1,U+4f10,U+4f19,U+4f30,U+4f34,U+4fb5,U+503e,U+518c,U+5192,U+51a0,U+51ac,U+51b0,U+51e1,U+5211,U+5242,U+52a3,U+52b2,U+52c3,U+52c7,U+52d2,U+52e4,U+5377,U+539a,U+53a6,U+53e5,U+5417,U+5510,U+552f,U+5531,U+574f-5750,U+5761,U+5851,U+5854,U+58ee,U+593a,U+5949,U+5954,U+5a5a,U+5b8b,U+5bbd,U+5c04,U+5c0a,U+5c4b,U+5ce1,U+5cf0,U+5e10,U+5e8a,U+5e9f,U+5ec9,U+5f31,U+5f84,U+5fd8-5fd9,U+5fe0,U+6015,U+6062,U+6069,U+6076,U+6089,U+60a3,U+60ca,U+620f,U+624e,U+6263,U+6298,U+62a2,U+62bd,U+6311,U+6350,U+6389,U+638c,U+63f4,U+6446,U+644a,U+6469,U+64cd,U+654f,U+6562,U+656c,U+65d7,U+65e6,U+65fa,U+660c,U+6653,U+66b4,U+670b,U+672b,U+676f-6770,U+6881,U+6885,U+68a6,U+68cb,U+68ee,U+6b8a,U+6c88-6c89,U+6cc9,U+6ce5,U+6d01,U+6d17,U+6d1b,U+6d59,U+6d6a,U+6da8,U+6df7,U+6e10,U+6e20-6e21,U+6f5c,U+706f,U+70bc,U+719f,U+7267,U+732a,U+73cd,U+7518,U+756a,U+7586,U+7591,U+75db,U+76c8,U+76d0,U+76d6,U+76d8,U+76df,U+76fe,U+77db,U+7801,U+786c,U+795d,U+7965,U+79cb,U+7a77,U+7a7f,U+7aef,U+7b11,U+7bb1,U+7bc7,U+7ea0,U+7eaf,U+7ed5,U+7edc,U+7f13,U+7f29,U+7f34,U+7f8a,U+7ffb,U+8015,U+8058,U+805a,U+8083,U+80af,U+80c6,U+80cc,U+811a,U+8150,U+82e5,U+8336,U+8352,U+83ab,U+8428,U+8463,U+852c,U+8861,U+89c8,U+8bcd,U+8bd7,U+8bda,U+8be2,U+8bef,U+8bf8,U+8c0b,U+8c13,U+8d34,U+8d3a,U+8d74,U+8d76,U+8da3,U+8dd1,U+8ddd,U+8ddf,U+8df3,U+8f68,U+8f6f,U+8f7d,U+8f91,U+8f9b,U+8fbd,U+8fc8,U+8fd4,U+8feb,U+8ff9,U+900f,U+9057,U+907f-9080,U+90d1,U+90ed,U+91ce,U+9519,U+9526,U+95ed,U+9614,U+9635,U+9644,U+9686,U+96c5,U+96ea,U+9707,U+9732,U+9759,U+978b,U+9876,U+9881,U+9910,U+996e,U+9970,U+9c81,U+9e21,U+9ebb,U+9f84"}},{uri:UR,descriptors:{unicodeRange:"U+4e3d,U+4e4e,U+4e71,U+4e8f,U+4ed8,U+4eea,U+4f0a,U+4f0d,U+4f11,U+4f1f,U+4f24,U+4f3c,U+4f73,U+4fc4,U+500d,U+5012,U+501f,U+503a,U+505c,U+507f,U+50a8,U+514d,U+5178,U+517c,U+51b2,U+51b7,U+520a,U+5238,U+523b,U+52b1,U+535a,U+5371,U+5385,U+53eb-53ec,U+53f3,U+53f6,U+5409,U+542b,U+542f,U+5434,U+5462,U+5473,U+547c,U+54c8,U+54ea,U+56fa,U+5733,U+5757,U+5766,U+5802,U+585e,U+590f,U+591c,U+591f,U+5947,U+594b,U+5987,U+5a01,U+5b59,U+5b63,U+5b88,U+5b97,U+5b9c,U+5bbe,U+5bfb,U+5c01,U+5c1a,U+5c24,U+5c3c,U+5c97,U+5c9b,U+5cb8,U+5de6,U+5e01,U+5e2e,U+5e45,U+5e55,U+5e84,U+5ef6,U+5f02,U+5f52,U+5f69,U+5f7b,U+5f90,U+5fae,U+6000,U+600e,U+6025,U+60e0,U+6276,U+6297,U+62b5,U+62cd,U+62d3,U+62e5,U+62e9,U+62ff,U+6302,U+632f,U+63e1,U+6444,U+64ad,U+653b,U+6551,U+6563,U+65a4,U+65e7,U+6620,U+667a,U+66f2,U+671d,U+6731,U+6742,U+675f,U+6768,U+677e-677f,U+6790,U+67b6,U+67d3,U+6863,U+68b0,U+68c9,U+690d,U+6b8b,U+6bcd,U+6bd2,U+6bd5,U+6c38,U+6c61,U+6cbf,U+6cdb,U+6cf0,U+6d2a,U+6d89,U+6da6,U+6f6e,U+6fb3,U+7075,U+707e,U+70df,U+7164,U+7236,U+725b,U+7389,U+73e0,U+745e,U+74e6,U+751a,U+7537,U+75be,U+76ae,U+76db,U+793c,U+7956,U+7981,U+79d8,U+79df,U+79fb,U+7adf,U+7ae5,U+7b14,U+7b26,U+7b54,U+7b79,U+7d2f,U+7eb8,U+7eba,U+7ec6,U+7ee9,U+7eff,U+7f5a,U+7f6a,U+7f72,U+8089,U+80a5,U+80e1,U+8111,U+8131,U+821e,U+822c,U+8270,U+8499,U+8651,U+867d,U+8840,U+8857,U+8863,U+88c1,U+89c9,U+89d2,U+8a89,U+8bed,U+8bfe,U+8c01,U+8c22,U+8d21,U+8d25,U+8d2f,U+8d5e,U+8d75,U+8d8b,U+8dc3,U+8de8,U+8df5,U+8f6e,U+8f86,U+8f89,U+8fc5,U+8ff0,U+8ffd,U+9014,U+904d,U+90ae,U+9274,U+949f,U+952e,U+969c,U+96c4,U+96e8,U+96f6-96f7,U+97e9,U+987f,U+996d,U+9a7b,U+9aa8,U+9c7c,U+9c9c,U+9e4f,U+9f13,U+9f50"}},{uri:mR,descriptors:{unicodeRange:"U+4e13,U+4e16,U+4e1c,U+4e24,U+4e3e,U+4e49,U+4e61,U+4e66,U+4e89,U+4e8c,U+4e94,U+4e9b,U+4ea4,U+4eac,U+4ebf,U+4eca,U+4ef6-4ef7,U+4efb,U+4f18,U+4f20,U+4f46,U+4f7f,U+4fe1,U+503c,U+505a,U+5146,U+5148,U+515a,U+5171,U+5177,U+519b,U+51b3,U+51c6,U+51e0,U+5212,U+521b,U+522b,U+529e,U+52bf,U+534e-534f,U+5355,U+5357,U+5382,U+539f,U+53bb,U+53bf,U+53c2,U+53c8,U+53ca,U+53d6-53d8,U+53e3,U+53ea,U+53f0,U+540d,U+5411,U+56db,U+56de,U+56e0,U+56e2,U+578b,U+57ce,U+57fa,U+589e,U+5904,U+5934,U+5982,U+5b89,U+5b8c,U+5bfc,U+5c06,U+5c11,U+5c40,U+5c71,U+5e38,U+5e72,U+5e76,U+5e7f,U+5e94,U+5e9c,U+5f0f,U+5f15,U+5f20,U+5f3a,U+5f62,U+5f88,U+5fc5,U+5fd7,U+5feb,U+601d,U+6027,U+60c5,U+60f3,U+610f,U+6216,U+6218,U+624b,U+624d,U+6279,U+628a,U+6295,U+6301,U+6307,U+636e,U+63a5,U+63a8,U+652f,U+6536,U+653e,U+6548,U+6559,U+6570,U+65bd,U+65e0,U+6602,U+660e,U+6613,U+66f4,U+6700,U+670d,U+671f,U+672f,U+6743,U+674e,U+6751,U+6761,U+6784,U+6797,U+679c,U+67e5,U+6807,U+6837,U+683c,U+6b21,U+6b63-6b65,U+6bcf,U+6bd4,U+6c42,U+6c5f,U+6ca1,U+6cbb,U+6d3b,U+6d41,U+6d88,U+6df1,U+70b9,U+7136,U+7269,U+7279,U+7531,U+754c,U+767e,U+76ca,U+76f8,U+770b,U+7740,U+7814,U+79ef,U+7a0b,U+7a0e,U+7a76,U+7b80,U+7cbe,U+7cfb,U+7e41,U+7ea7,U+7ec4,U+7ec7,U+7ed3,U+7ed9,U+7edf,U+7f8e,U+8001,U+804c,U+8054,U+80b2,U+81f3,U+8425,U+8868,U+88ab,U+897f,U+89c1-89c2,U+89c4,U+89c6,U+89e3,U+8ba1,U+8ba4,U+8bae,U+8bb0,U+8bba,U+8bc1,U+8c03,U+8d28,U+8d39,U+8def,U+8f66,U+8f6c,U+8fd0-8fd1,U+9020,U+9053,U+90a3,U+90fd,U+91cc,U+9500,U+9547,U+95e8,U+95f4,U+961f,U+9645,U+9662,U+96be,U+96c6,U+9700,U+9769,U+97e6,U+9875,U+9879,U+9886,U+9898,U+98ce,U+9996,U+2b5af,U+2cc56,U+2e9f5,U+30edd-30ede"}},{uri:gR,descriptors:{unicodeRange:"U+4e03,U+4e30,U+4e34,U+4e45,U+4e60,U+4e70,U+4e88,U+4e91-4e92,U+4ea9,U+4eb2,U+4ec0,U+4ecb,U+4ecd,U+4ee4,U+4fee,U+5019,U+5047,U+50cf,U+5145,U+516d,U+5170,U+5175,U+5199,U+51cf,U+51fb,U+521a,U+5224,U+5267,U+52aa,U+5347-5348,U+534a,U+5356,U+5361,U+536b,U+5370,U+538b,U+53e4,U+53e6,U+5403,U+5426,U+5428,U+542c,U+5438,U+5668,U+56ed,U+56f4,U+56fe,U+57df,U+592a,U+5957,U+5b69,U+5b81,U+5b8f,U+5b98,U+5b9d,U+5ba1,U+5ba4,U+5bb3,U+5bc6,U+5bdf,U+5c3d,U+5c5e,U+5c81,U+5ddd,U+5de8,U+5dee,U+5e0c,U+5e86,U+5e8f,U+5e93,U+5e95,U+5e97,U+5ea7,U+5ead,U+5eb7,U+5f55,U+5f81,U+5f85,U+5ff5,U+6001,U+613f,U+6258,U+6267,U+6269,U+626c,U+627e,U+62db,U+62ec,U+6325,U+635f,U+6362,U+6388,U+6392,U+63a2,U+63a7,U+63aa,U+641e,U+6545,U+6597,U+65e2,U+65e9,U+661f,U+665a,U+666e-666f,U+66fe,U+6728,U+67d0,U+6811,U+6838,U+6865,U+697c,U+6b22,U+6b27,U+6b4c,U+6b62,U+6b66,U+6b7b,U+6bdb,U+6c47,U+6c49,U+6c7d,U+6c99,U+6cfd,U+6d0b,U+6d25,U+6d32,U+6d3e,U+6d4b,U+6e29,U+6e56,U+6e7e,U+6f14,U+6fc0,U+706b,U+70c8,U+7247,U+72af,U+72b6,U+72ec,U+732e,U+73ed,U+7403,U+7533,U+753b,U+7559,U+7565,U+7597,U+767b,U+773c,U+7763,U+77ed,U+77ff,U+7968,U+798f,U+79bb,U+79c0-79c1,U+7ad9,U+7ae0,U+7b51,U+7b7e,U+7cae,U+7d22,U+7ea2,U+7eb3,U+7eb7,U+7ec3,U+7ec8,U+7ecd,U+7edd,U+7efc,U+7f16,U+7f3a,U+7f51,U+7f57,U+7f6e,U+80dc,U+822a,U+8239,U+826f,U+82cf,U+82e6,U+8349,U+8363,U+83dc,U+8457,U+85cf,U+878d,U+8865,U+8a00,U+8b66,U+8ba2,U+8ba8,U+8bad,U+8bb2,U+8bc9,U+8bd5,U+8bfb,U+8d2b,U+8d35,U+8d37,U+8f7b,U+8f93,U+8fce,U+8fdd,U+9000-9002,U+9010,U+9047,U+9093,U+9152,U+9488,U+94a2,U+9633,U+9636,U+963f,U+9646,U+9648,U+964d,U+9664,U+9669,U+9760,U+97f3,U+987a,U+987e,U+9884,U+98de,U+9986,U+9ed1"}},{uri:bR,descriptors:{unicodeRange:"U+4e14,U+4e25,U+4e48,U+4e50,U+4e5d,U+4e9a,U+4ec5,U+4efd,U+4f17,U+4f4e-4f4f,U+4f55,U+4f59,U+4f60,U+4f8b,U+4f9b,U+4f9d,U+4fbf,U+4fc3,U+5065,U+513f,U+5149,U+514b,U+516b,U+5174,U+517b,U+518d,U+51b5,U+5207,U+5217-5219,U+521d,U+526f,U+529f,U+52a9,U+52b3,U+5305,U+533b,U+5343,U+5360,U+5373-5374,U+5386,U+53cb-53cd,U+53f2,U+53f7,U+544a,U+5468,U+547d,U+54cd,U+552e,U+5584,U+56f0,U+571f,U+5747,U+575a,U+57f9,U+5883,U+58eb,U+58f0,U+5907,U+590d,U+592e,U+5931,U+5956,U+5965,U+5973,U+5979,U+59cb,U+5b57-5b58,U+5b83,U+5ba2-5ba3,U+5bb9,U+5bcc,U+5c42,U+5c45,U+5c4a,U+5dde,U+5df1,U+5df4,U+5e03,U+5e08,U+5e26,U+5e2d,U+5f71,U+5f80,U+5f8b,U+5fb7,U+606f,U+611f,U+6237,U+623f,U+6253,U+627f,U+6293,U+62a4,U+62c5,U+62c9,U+6309,U+6574,U+6599,U+65ad,U+65af,U+65c5,U+65cf,U+6625,U+663e,U+671b,U+672a,U+6750,U+6781,U+6821,U+6839,U+6848,U+68c0,U+6a21,U+6b3e,U+6bb5,U+6c14,U+6cb3,U+6cb9,U+6ce8,U+6e05,U+6e2f,U+6e38,U+6e90,U+6ee1,U+70ed,U+7167,U+7231,U+7248,U+724c,U+7387,U+738b,U+73af,U+7530,U+75c5,U+767d,U+76d1,U+76f4,U+771f,U+77e5,U+77f3,U+7834,U+7840,U+786e,U+793a,U+795e,U+79f0,U+7a33,U+7a7a,U+7a81,U+7ade,U+7b56,U+7b97,U+7c73,U+7c7b,U+7d20,U+7d27,U+7ea6,U+7eaa,U+7ebf,U+7ee7,U+7eed,U+7ef4,U+7fa4,U+8003,U+80a1,U+81f4,U+8272,U+827a,U+8282,U+82b1,U+82f1,U+8303,U+836f,U+83b7,U+843d,U+88c5,U+8ba9,U+8baf,U+8bb8,U+8bbf,U+8bc4,U+8bc6,U+8bdd,U+8be5,U+8bf7,U+8c08,U+8c61,U+8d1f,U+8d22-8d23,U+8d27,U+8d2d,U+8d38,U+8d5b,U+8d70,U+8d85,U+8d8a,U+8db3,U+8eab,U+8f83,U+8fb9,U+8fdc,U+8fde,U+9009,U+901f,U+914d,U+91c7,U+94b1,U+94c1,U+94f6,U+95fb,U+9632,U+9650,U+968f,U+9752,U+975e,U+987b,U+989d,U+98df,U+9999,U+9a6c,U+9a8c,U+9ec4,U+9feb-9fec"}},{uri:vR,descriptors:{unicodeRange:"U+98fb-990c,U+990e-990f,U+9911-992d,U+992f-9953,U+9956-9962,U+9964,U+9966,U+9973,U+9978-9979,U+997b,U+997e,U+9982-9983,U+9989,U+998c,U+998e,U+999a-99a4,U+99a6-99a7,U+99a9-99c8"}},{uri:xR,descriptors:{unicodeRange:"U+8e4c-8e50,U+8e53-8e58,U+8e5a-8e65,U+8e67-8e68,U+8e6a-8e6b,U+8e6e,U+8e71,U+8e73,U+8e75,U+8e77-8e7b,U+8e7d-8e7e,U+8e80,U+8e82-8e84,U+8e86,U+8e88-8e8e,U+8e91-8e93,U+8e95-8e9b,U+8e9d,U+8e9f-8eaa,U+8ead-8eae,U+8eb0-8eb1,U+8eb3-8eb9,U+8ebb-8ecd,U+8ecf-8f02"}},{uri:yR,descriptors:{unicodeRange:"U+2e3a,U+3001-3002,U+3008-3011,U+3014-3017,U+301d-301f,U+4dae,U+4e00,U+4e07,U+4e09-4e0b,U+4e0d-4e0e,U+4e1a,U+4e2a,U+4e2d,U+4e3a-4e3b,U+4e4b,U+4e5f,U+4e86,U+4e8b,U+4e8e,U+4ea7,U+4eba,U+4ece,U+4ed1,U+4ed6,U+4ee3,U+4ee5,U+4eec,U+4f01,U+4f1a,U+4f4d,U+4f53,U+4f5c,U+4fdd,U+5143,U+5165,U+5168,U+516c,U+5173,U+5176,U+5185,U+519c,U+51fa,U+5206,U+5229,U+5230,U+5236,U+524d,U+529b,U+52a0-52a1,U+52a8,U+5316-5317,U+533a,U+5341,U+5362,U+53d1,U+53ef,U+53f8,U+5404,U+5408,U+540c,U+540e,U+5458,U+548c,U+54c1,U+54e5,U+5546,U+559c,U+56fd,U+5728,U+5730,U+573a,U+5916,U+591a,U+5927,U+5929,U+592b,U+597d,U+59d4,U+5b50,U+5b66,U+5b9a,U+5b9e,U+5bb6,U+5bf9,U+5c0f,U+5c14,U+5c31,U+5c55,U+5de5,U+5df2,U+5e02,U+5e73-5e74,U+5ea6,U+5efa,U+5f00,U+5f53,U+5f97,U+5fc3,U+603b,U+6210-6211,U+6240,U+6280,U+62a5,U+63d0,U+6539,U+653f,U+6587,U+65b0,U+65b9,U+65e5,U+65f6,U+662f,U+6708-6709,U+672c,U+673a,U+675c,U+6765,U+6c11,U+6c34,U+6cd5,U+6ce2,U+6d4e,U+6d77,U+73b0,U+7406,U+751f,U+7528,U+7535,U+7684,U+76ee,U+793e,U+79cd,U+79d1,U+7acb,U+7b2c,U+7b49,U+7ba1,U+7ecf,U+8005,U+800c,U+80fd,U+81ea,U+884c,U+8981,U+8bbe,U+8bf4,U+8d44,U+8d77,U+8fbe,U+8fc7,U+8fd8-8fd9,U+8fdb,U+901a,U+90e8,U+91cd,U+91cf,U+91d1,U+9485,U+957f,U+95ee,U+9762,U+9ad8,U+9ea6,U+9f99,U+9fcf,U+9fd4,U+9fed,U+fe10-fe19,U+fe30-fe31,U+fe33-fe44,U+ff01,U+ff0c,U+ff1f,U+2b4e7,U+2b7f7,U+2b7fc,U+2cb2d,U+2cb3b,U+2cb4a,U+2cb5b,U+2cb73"}},{uri:wR,descriptors:{unicodeRange:"U+6490,U+6493-6494,U+6497-6498,U+649a-649d,U+649f-64a3,U+64a5-64a8,U+64aa-64ab,U+64af,U+64b1-64b4,U+64b6,U+64b9,U+64bb,U+64bd-64bf,U+64c1,U+64c3-64c4,U+64c6-64cc,U+64cf,U+64d1,U+64d3-64d6,U+64d9-64dd,U+64df-64e1,U+64e3,U+64e5,U+64e7-64ff,U+6501-6508,U+650a-6511,U+6513-6517,U+6519-6524,U+6526-652a,U+652c-652d,U+6530-6533,U+6537,U+653a,U+653c-653d,U+6540-6544,U+6546-6547,U+654a-654b,U+654d-654e,U+6550,U+6552-6554,U+6557-6558,U+655a,U+655c,U+655f-6561,U+6564-6565,U+6567-6568"}},{uri:ER,descriptors:{unicodeRange:"U+9695-9696,U+969a-969b,U+969d-96a6,U+96a8-96af,U+96b1-96b2,U+96b4-96b5,U+96b7-96b8,U+96ba-96bb,U+96bf,U+96c2-96c3,U+96c8,U+96ca-96cb,U+96d0-96d1,U+96d3-96d4,U+96d6-96df,U+96e1-96e7,U+96eb-96ee,U+96f0-96f2,U+96f4-96f5,U+96f8,U+96fa-96fd,U+96ff,U+9702-9703,U+9705,U+970a-970c,U+9710-9712,U+9714-9715,U+9717-971b,U+971d,U+971f-9729,U+972b-972c,U+972e-972f,U+9731,U+9733-9737,U+973a-973d,U+973f-9751,U+9754-9755,U+9757-9758,U+975a,U+975c-975d,U+975f,U+9763-9764,U+9766-9768,U+976a-9770"}},{uri:SR,descriptors:{unicodeRange:"U+6af0-6b1f,U+6b25-6b26,U+6b28-6b31,U+6b33-6b36,U+6b38,U+6b3b-6b3d,U+6b3f-6b42,U+6b44-6b45,U+6b48,U+6b4a-6b4b,U+6b4d-6b58,U+6b5a-6b61,U+6b68-6b69,U+6b6b-6b78,U+6b7a,U+6b7d-6b80,U+6b85,U+6b88,U+6b8c,U+6b8e-6b91,U+6b94-6b95,U+6b97-6b99,U+6b9c-6ba0,U+6ba2-6ba9,U+6bab-6bb2,U+6bb6,U+6bb8-6bba"}},{uri:CR,descriptors:{unicodeRange:"U+430e-439a,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29f7e,U+29f83,U+29f8c,U+29fce,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a38c"}},{uri:kR,descriptors:{unicodeRange:"U+92ef-933d,U+933f-9369,U+936b-9388"}},{uri:MR,descriptors:{unicodeRange:"U+4512-458d,U+2b300,U+2b363,U+2b36f,U+2b372,U+2b37d,U+2b404,U+2b410,U+2b413,U+2b461,U+2b4ef,U+2b4f6,U+2b4f9,U+2b50d-2b50e,U+2b536,U+2b5ae,U+2b5b3,U+2b5e7,U+2b5f4,U+2b61c-2b61d,U+2b626-2b628,U+2b62a,U+2b62c,U+2b695-2b696,U+2b6ad,U+2b6ed"}},{uri:IR,descriptors:{unicodeRange:"U+88bd-88c0,U+88c3-88c4,U+88c7-88c8,U+88ca-88cd,U+88cf-88d1,U+88d3,U+88d6-88d7,U+88da-88de,U+88e0-88e1,U+88e6-88e7,U+88e9-88ef,U+88f2,U+88f5-88f7,U+88fa-88fb,U+88fd,U+88ff-8901,U+8903-8909,U+890b-890f,U+8911,U+8914-8918,U+891c-8920,U+8922-8924,U+8926-8929,U+892c-892f,U+8931-8933,U+8935,U+8937-8940,U+8942-8943,U+8945-895d,U+8960-8965,U+8967-897a,U+897c-897e,U+8980,U+8982,U+8984-8985"}},{uri:TR,descriptors:{unicodeRange:"U+4b0b-4ba0"}},{uri:_R,descriptors:{unicodeRange:"U+7179,U+717b-717c,U+717e-7183,U+7185-7189,U+718b-718e,U+7190-7193,U+7195-7197,U+719a-719e,U+71a1-71a7,U+71a9-71ab,U+71ad-71b2,U+71b4,U+71b6-71b8,U+71ba-71c2,U+71c4-71cd,U+71cf-71d3,U+71d6-71df,U+71e1-71e4,U+71e6,U+71e8-71ed,U+71ef-71f8,U+71fa-7205,U+7207-721c,U+721e-7227,U+7229,U+722b,U+722d"}},{uri:jR,descriptors:{unicodeRange:"U+982e-9874,U+988b,U+988e,U+9892,U+9895,U+9899,U+98a3,U+98a8-98cd,U+98cf-98d0,U+98d4,U+98d6-98d7,U+98db-98dd,U+98e0-98e6,U+98e9-98fa"}},{uri:AR,descriptors:{unicodeRange:"U+7c14-7c15,U+7c17-7c1e,U+7c20-7c25,U+7c28-7c29,U+7c2b-7c37,U+7c39-7c3e,U+7c42-7c4c,U+7c4e-7c72,U+7c75-7c7a,U+7c7e-7c88,U+7c8a-7c90,U+7c93-7c94,U+7c96,U+7c99-7c9b,U+7ca0-7ca1,U+7ca3,U+7ca6-7ca9,U+7cab-7cad,U+7caf-7cb0,U+7cb4-7cb8,U+7cba-7cbb,U+7cbf-7cc0,U+7cc2-7cc4,U+7cc6,U+7cc9,U+7ccb,U+7cce-7cd4"}},{uri:RR,descriptors:{unicodeRange:"U+7d95-7da5,U+7da7-7dad,U+7daf-7e2a"}},{uri:LR,descriptors:{unicodeRange:"U+4a78-4b0a"}},{uri:DR,descriptors:{unicodeRange:"U+9b30-9b31,U+9b33-9b3a,U+9b3d-9b40,U+9b46,U+9b4a-9b4c,U+9b4e,U+9b50,U+9b52-9b53,U+9b55-9bcf"}},{uri:PR,descriptors:{unicodeRange:"U+6a4b-6a4f,U+6a51-6a57,U+6a5a,U+6a5c-6a60,U+6a62-6a64,U+6a66-6a70,U+6a72-6a78,U+6a7a-6a7b,U+6a7d-6a7f,U+6a81-6a83,U+6a85-6a8d,U+6a8f,U+6a92-6a96,U+6a98-6a9f,U+6aa1-6aa8,U+6aaa,U+6aad-6aef"}},{uri:NR,descriptors:{unicodeRange:"U+99c9-9a53"}},{uri:OR,descriptors:{unicodeRange:"U+8550-8555,U+8557-8558,U+855a-855d,U+855f-8563,U+8565-8567,U+8569-8571,U+8573,U+8575-8578,U+857c-857d,U+857f-8583,U+8586,U+8588-858e,U+8590-859a,U+859d-85a3,U+85a5-85a7,U+85a9,U+85ab-85ad,U+85b1-85b6,U+85b8,U+85ba-85c0,U+85c2-85c8,U+85ca-85ce,U+85d1-85d2,U+85d4,U+85d6-85db,U+85dd-85e3,U+85e5-85e8,U+85ea-85fa,U+85fc-85fe,U+8600-8603"}},{uri:$R,descriptors:{unicodeRange:"U+6fb2,U+6fb4-6fb5,U+6fb7-6fb8,U+6fba-6fbf,U+6fc1,U+6fc3-6fc8,U+6fca-6fd0,U+6fd3-6fdd,U+6fdf,U+6fe2-6fed,U+6ff0-7010,U+7012-7019,U+701c-7022,U+7024-7034,U+7036-7038,U+703a-704b,U+704d-704e,U+7050-7053"}},{uri:FR,descriptors:{unicodeRange:"U+4ba1-4c2c"}},{uri:zR,descriptors:{unicodeRange:"U+9a54-9a6b,U+9a72,U+9a83,U+9a89,U+9a8d-9a8e,U+9a94-9a95,U+9a99,U+9aa6,U+9aa9-9aaf,U+9ab2-9ab5,U+9ab9,U+9abb,U+9abd-9abf,U+9ac3-9ac4,U+9ac6-9aca,U+9acd-9ad0,U+9ad2,U+9ad4-9ad7,U+9ad9-9ade,U+9ae0,U+9ae2-9ae5,U+9ae7-9aea,U+9aec,U+9aee,U+9af0-9af8,U+9afa,U+9afc-9b02,U+9b04-9b07,U+9b09-9b0e,U+9b10-9b12,U+9b14-9b1e,U+9b20-9b22,U+9b24-9b2e"}},{uri:BR,descriptors:{unicodeRange:"U+9d1a-9da1"}},{uri:HR,descriptors:{unicodeRange:"U+9e13-9e1e,U+9e24,U+9e27,U+9e2e,U+9e30,U+9e34,U+9e3b-9e3c,U+9e40,U+9e4d,U+9e50,U+9e52-9e54,U+9e56,U+9e59,U+9e5d,U+9e5f-9e62,U+9e65,U+9e6e-9e6f,U+9e72,U+9e74-9e7d,U+9e80-9e81,U+9e83-9e86,U+9e89-9e8a,U+9e8c-9e91,U+9e94-9e9c,U+9e9e,U+9ea0-9ea5,U+9ea7-9eb3,U+9eb5-9eb7,U+9eb9-9eba,U+9ebc,U+9ebf-9ec3,U+9ec5-9ec8,U+9eca-9ecc,U+9ed0,U+9ed2-9ed3,U+9ed5-9ed7,U+9ed9-9eda,U+9ede,U+9ee1,U+9ee3-9ee4,U+9ee6,U+9ee8,U+9eeb-9eee,U+9ef0-9ef8"}},{uri:XR,descriptors:{unicodeRange:"U+8b1c-8b25,U+8b27-8b65,U+8b67-8b6b,U+8b6d-8b9f,U+8bac,U+8bb1,U+8bbb,U+8bc7,U+8bd0"}},{uri:WR,descriptors:{unicodeRange:"U+4cad-4d2f"}},{uri:VR,descriptors:{unicodeRange:"U+9c4b-9c7b,U+9c7d-9c7e,U+9c80,U+9c83-9c84,U+9c89-9c8a,U+9c8c,U+9c8f,U+9c93,U+9c96-9c99,U+9c9d,U+9caa,U+9cac,U+9caf,U+9cb9,U+9cbe-9cc2,U+9cc8-9cc9,U+9cd1-9cd2,U+9cda-9cdb,U+9ce0-9ce1,U+9ce3-9d19"}},{uri:GR,descriptors:{unicodeRange:"U+9389-938e,U+9390-93c9,U+93cb-93d5,U+93d7-9410"}},{uri:YR,descriptors:{unicodeRange:"U+20a0-20b5,U+20b9-20ba,U+20bc-20bd,U+4e2c,U+5107,U+5216,U+5293,U+54f3,U+5523,U+5819,U+5adc,U+5c88,U+5e3b,U+5fee,U+62f6,U+63be,U+6484,U+6499,U+67d9,U+67dd,U+6d5e,U+6f46,U+717a,U+71e0,U+72c1,U+73e7,U+75b0,U+7603,U+7722,U+7809,U+7811,U+7946,U+7967,U+799a,U+7b45,U+7ba2,U+8014,U+80d9,U+8159,U+817d,U+81a3,U+81aa,U+8201,U+833c,U+836e,U+83e5,U+8459,U+84f0,U+8729,U+8753,U+87d3,U+89dc,U+8bf6,U+8c2e,U+8e2c,U+8e9c,U+8e9e,U+8ece,U+8fee,U+9139,U+914f,U+9174,U+9191,U+960c,U+9622,U+9a98,U+9b48,U+9ca6,U+9cb0,U+9da2-9e12,U+9e88,U+9f44,U+9f86"}},{uri:ZR,descriptors:{unicodeRange:"U+9bd0-9c4a"}},{uri:KR,descriptors:{unicodeRange:"U+4c2d-4cac"}},{uri:qR,descriptors:{unicodeRange:"U+4d30-4dab"}},{uri:JR,descriptors:{unicodeRange:"U+9411-943d,U+943f-946a,U+946c-9484"}},{uri:QR,descriptors:{unicodeRange:"U+9efa,U+9efd,U+9eff-9f0a,U+9f0c,U+9f0f,U+9f11-9f12,U+9f14-9f16,U+9f18,U+9f1a-9f1f,U+9f21,U+9f23-9f2b,U+9f2d-9f2e,U+9f30-9f36,U+9f38,U+9f3a,U+9f3c,U+9f3f-9f43,U+9f45-9f4f,U+9f52-9f7e,U+9f81-9f82,U+9f8d-9f94"}},{uri:eL,descriptors:{unicodeRange:"U+7e2b-7e3a,U+7e3c-7e40,U+7e42-7e46,U+7e48-7e81,U+7e83-7e9a,U+7e9c-7e9e,U+7eae,U+7eb4,U+7ebb-7ebc,U+7ed6,U+7ee4,U+7eec,U+7ef9,U+7f0a,U+7f10,U+7f1e,U+7f37,U+7f39,U+7f3b"}}],Di=class Ge{constructor(t){L(this,"scene"),L(this,"getSceneFamilies",()=>Ge.getUniqueFamilies(this.scene.getNonDeletedElements())),L(this,"onLoaded",n=>{let a=!0;for(let s of n){let l=`${s.family}-${s.style}-${s.weight}-${s.unicodeRange}`;Ge.loadedFontsCache.has(l)||(Ge.loadedFontsCache.add(l),a=!1)}if(a)return;let i=!1,r=this.scene.getNonDeletedElementsMap();for(let s of this.scene.getNonDeletedElements())if(q(s)){i=!0,dt.delete(s),ac.clearCache(Ve(s));let l=zt(s,r);l&&dt.delete(l)}i&&this.scene.triggerUpdate()}),L(this,"loadSceneFonts",async()=>{let n=this.getSceneFamilies(),a=Ge.getCharsPerFamily(this.scene.getNonDeletedElements());return Ge.loadFontFaces(n,a)}),this.scene=t}static get registered(){return Ge._registered?Ge._initialized||(Ge._registered=new Map([...Ge.init().entries(),...Ge._registered.entries()])):Ge._registered=Ge.init(),Ge._registered}get registered(){return Ge.registered}static async generateFontFaceDeclarations(t){let n=Ge.getUniqueFamilies(t),a=Ge.getCharsPerFamily(t),i=n.find(c=>n8(c).includes(Ms));if(i){let c=Ge.getCharacters(a,i);if(EM(c)){let d=Is[Ms];a[d]=new Set(c),n.unshift(Is[Ms])}}let r=Ge.fontFacesStylesGenerator(n,a),s=3,l=await new f2(r,s).all();return Array.from(new Set(l))}static async loadFontFaces(t,n){for(let{fontFaces:r,metadata:s}of Ge.registered.values())if(!s.local)for(let{fontFace:l}of r)window.document.fonts.has(l)||window.document.fonts.add(l);let a=Ge.fontFacesLoader(t,n),i=10;return(await new f2(a,i).all()).flat().filter(Boolean)}static*fontFacesLoader(t,n){for(let[a,i]of t.entries()){let r=Ve({fontFamily:i,fontSize:16}),s=Ge.getCharacters(n,i);window.document.fonts.check(r,s)||(yield Qi(async()=>{var l;try{let c=await window.document.fonts.load(r,s);return[a,c]}catch(c){console.error(`Failed to load font "${r}" from urls "${(l=Ge.registered.get(i))==null?void 0:l.fontFaces.map(d=>d.urls)}"`,c)}}))}}static*fontFacesStylesGenerator(t,n){for(let[a,i]of t.entries()){let{fontFaces:r,metadata:s}=Ge.registered.get(i)??{};if(!Array.isArray(r)){console.error(`Couldn't find registered fonts for font-family "${i}"`,Ge.registered);continue}if(!(s!=null&&s.local))for(let[l,c]of r.entries())yield Qi(async()=>{try{let d=Ge.getCharacters(n,i),o=await c.toCSS(d);return o?[a*1e4+l,o]:void 0}catch(d){console.error(`Couldn't transform font-face to css for family "${c.fontFace.family}"`,d)}})}}static register(t,n,...a){let i=it[t]??Is[t];return this.registered.get(i)||this.registered.set(i,{metadata:n,fontFaces:a.map(({uri:r,descriptors:s})=>new jT(t,r,s))}),this.registered}static init(){let t={registered:new Map},n=(a,...i)=>{let r=it[a]??Is[a],s=Kd[r]??Kd[it.Excalifont];Ge.register.call(t,a,s,...i)};return n("Cascadia",...RT),n("Comic Shanns",...OT),n("Excalifont",...GT),n("Helvetica",...YT),n("Liberation Sans",...KT),n("Lilita One",...QT),n("Nunito",...r_),n("Virgil",...l_),n(Ms,...tL),n(Mo,...$T),Ge._initialized=!0,t.registered}static getUniqueFamilies(t){return Array.from(t.reduce((n,a)=>(q(a)&&n.add(a.fontFamily),n),new Set))}static getCharsPerFamily(t){let n={};for(let a of t)if(q(a))for(let i of a.originalText)n[a.fontFamily]||(n[a.fontFamily]=new Set),n[a.fontFamily].add(i);return n}static getCharacters(t,n){return t[n]?Array.from(t[n]).join(""):""}static getAllFamilies(){return Array.from(Ge.registered.keys())}};L(Di,"loadedFontsCache",new Set),L(Di,"_registered"),L(Di,"_initialized",!1),L(Di,"loadElementsFonts",async e=>{let t=Di.getUniqueFamilies(e),n=Di.getCharsPerFamily(e);return Di.loadFontFaces(t,n)});var fi=Di,Q8=(e,t,n)=>{var c;let{unitsPerEm:a,ascender:i,descender:r}=((c=fi.registered.get(e))==null?void 0:c.metadata.metrics)||Kd[it.Virgil].metrics,s=t/a,l=(n-s*i+s*r)/2;return s*i+l},Kr=e=>{var n;let{lineHeight:t}=((n=fi.registered.get(e))==null?void 0:n.metadata.metrics)||Kd[it.Excalifont].metrics;return t},e7=e=>{let{angle:t,width:n,height:a,x:i,y:r}=e,s=i+n/2,l=r+a/2,c=C(s,l),d;return e.type==="diamond"?d=l2(H(C(s,r),c,t),H(C(i+n,l),c,t),H(C(s,r+a),c,t),H(C(i,l),c,t)):d=l2(H(C(i,r),c,t),H(C(i+n,r),c,t),H(C(i+n,r+a),c,t),H(C(i,r+a),c,t)),{type:"polygon",data:d}},nL=(e,t,n=10)=>{let[a,i,r,s,l,c]=pe(e,t,!0);a-=n,r+=n,i-=n,s+=n;let d=C(l,c),o=H(C(a,i),d,e.angle),u=H(C(r,i),d,e.angle),h=H(C(a,s),d,e.angle),p=H(C(r,s),d,e.angle);return{type:"polygon",data:[o,u,p,h]}},aL=e=>{let{width:t,height:n,angle:a,x:i,y:r}=e;return{type:"ellipse",data:{center:C(i+t/2,r+n/2),angle:a,halfWidth:t/2,halfHeight:n/2}}},cr=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops},iL=(e,t=C(0,0),n,a)=>{let i=c=>H(C(c[0]+t[0],c[1]+t[1]),a,n),r=cr(e),s=[],l=C(0,0);for(let c of r){if(c.op==="move"){let d=H0(c.data);nn(d!=null,"Ops data is not a point"),l=i(d)}if(c.op==="bcurveTo"){let d=i(C(c.data[0],c.data[1])),o=i(C(c.data[2],c.data[3])),u=i(C(c.data[4],c.data[5]));s.push(oi(l,d,o,u)),l=u}}return{type:"polycurve",data:s}},rL=e=>{let t=e[0],n=[];for(let a=1;a<e.length;a++){let i=e[a];n.push(se(t,i)),t=i}return n},sL=(e,t,n=!1)=>{let a=r=>H(Ce(Hi(re(r),Ht(e.x,e.y))),t,e.angle),i=rL(e.points.map(r=>a(r)));return n?{type:"polygon",data:Wd(i.flat())}:{type:"polyline",data:i}},lL=(e,t,n=C(0,0),a,i)=>{let r=o=>H(C(o[0]+n[0],o[1]+n[1]),i,a);if(e.roundness===null)return{type:"polygon",data:Wd(e.points.map(o=>r(o)))};let s=cr(t),l=[],c=!1;for(let o of s)o.op==="move"?(c=!c,c&&l.push(C(o.data[0],o.data[1]))):o.op==="bcurveTo"?c&&(l.push(C(o.data[0],o.data[1])),l.push(C(o.data[2],o.data[3])),l.push(C(o.data[4],o.data[5]))):o.op==="lineTo"&&c&&l.push(C(o.data[0],o.data[1]));let d=GC(l,10,5).map(o=>r(o));return{type:"polygon",data:Wd(d)}},oL=(e,t)=>{let{angle:n,halfWidth:a,halfHeight:i,center:r}=t,s=a,l=i,c=Hi(re(e),pt(re(r),-1)),[d,o]=H(Ce(c),C(0,0),-n),u=Math.abs(d),h=Math.abs(o),p=.707,U=.707;for(let b=0;b<3;b++){let v=s*p,x=l*U,y=(s*s-l*l)*p**3/s,E=(l*l-s*s)*U**3/l,S=v-y,w=x-E,k=u-y,T=h-E,_=Math.hypot(w,S),j=Math.hypot(T,k);p=Math.min(1,Math.max(0,(k*_/j+y)/s)),U=Math.min(1,Math.max(0,(T*_/j+E)/l));let A=Math.hypot(U,p);p/=A,U/=A}let[m,g]=[s*p*Math.sign(d),l*U*Math.sign(o)];return Oe(C(d,o),C(m,g))},cL=(e,t,n=1e-4)=>oL(e,t)<=n,dL=(e,t)=>{let{center:n,angle:a,halfWidth:i,halfHeight:r}=t,s=Hi(re(e),pt(re(n),-1)),[l,c]=H(Ce(s),C(0,0),-a);return l/i*(l/i)+c/r*(c/r)<=1},T1=(e,t,n=0)=>{switch(t.type){case"polygon":return Gk(e,t.data,n);case"ellipse":return cL(e,t.data,n);case"line":return Wr(e,t.data,n);case"polyline":return n7(e,t.data,n);case"curve":return t7(e,t.data,n);case"polycurve":return uL(e,t.data,n);default:throw Error(`shape ${t} is not implemented`)}},qd=(e,t)=>{switch(t.type){case"polygon":return o2(e,t.data);case"line":return!1;case"curve":return!1;case"ellipse":return dL(e,t.data);case"polyline":{let n=Wd(t.data.flat());return o2(e,n)}case"polycurve":return!1;default:throw Error(`shape ${t} is not implemented`)}},uL=(e,t,n)=>t.some(a=>t7(e,a,n)),fL=e=>{let[t,n,a,i]=e;return(r,s)=>Math.pow(1-r,3)*i[s]+3*r*Math.pow(1-r,2)*a[s]+3*Math.pow(r,2)*(1-r)*n[s]+t[s]*Math.pow(r,3)},hL=(e,t=10)=>{let n=fL(e),a=[n(0,0),n(0,1)],i=[],r=0,s=1/t;for(let l=0;l<t;l++)if(r+=s,r<=1){let c=C(n(r,0),n(r,1));i.push(se(a,c)),a=c}return i},t7=(e,t,n)=>n7(e,hL(t),n),n7=(e,t,n=1e-4)=>t.some(a=>Wr(e,a,n));function a7(e,t,n){return{center:e,halfWidth:t,halfHeight:n}}var pL=(e,t)=>{let{halfWidth:n,halfHeight:a,center:i}=t,r=n,s=a,l=Hi(re(e),pt(re(i),-1)),c=Math.abs(l[0]),d=Math.abs(l[1]),o=.707,u=.707;for(let U=0;U<3;U++){let m=r*o,g=s*u,b=(r*r-s*s)*o**3/r,v=(s*s-r*r)*u**3/s,x=m-b,y=g-v,E=c-b,S=d-v,w=Math.hypot(y,x),k=Math.hypot(S,E);o=Math.min(1,Math.max(0,(E*w/k+b)/r)),u=Math.min(1,Math.max(0,(S*w/k+v)/s));let T=Math.hypot(u,o);o/=T,u/=T}let[h,p]=[r*o*Math.sign(l[0]),s*u*Math.sign(l[1])];return Oe(Ce(l),C(h,p))};function UL({center:e,halfWidth:t,halfHeight:n},[a,i]){let[r,s]=e,l=a[0]-r,c=a[1]-s,d=i[0]-r,o=i[1]-s,u=Math.pow(d-l,2)/Math.pow(t,2)+Math.pow(o-c,2)/Math.pow(n,2),h=2*(l*(d-l)/Math.pow(t,2)+c*(o-c)/Math.pow(n,2)),p=Math.pow(l,2)/Math.pow(t,2)+Math.pow(c,2)/Math.pow(n,2)-1,U=(-h+Math.sqrt(Math.pow(h,2)-4*u*p))/(2*u),m=(-h-Math.sqrt(Math.pow(h,2)-4*u*p))/(2*u),g=[C(l+U*(d-l)+r,c+U*(o-c)+s),C(l+m*(d-l)+r,c+m*(o-c)+s)].filter(b=>!isNaN(b[0])&&!isNaN(b[1]));return g.length===2&&fa(g[0],g[1])?[g[0]]:g}function i7(e,t=0){let n=ca(Math.min(e.width,e.height),e);if(n<=0){let u=y1(C(e.x-t,e.y-t),C(e.x+e.width+t,e.y+e.height+t)),h=se(C(u[0][0]+n,u[0][1]),C(u[1][0]-n,u[0][1])),p=se(C(u[1][0],u[0][1]+n),C(u[1][0],u[1][1]-n)),U=se(C(u[0][0]+n,u[1][1]),C(u[1][0]-n,u[1][1])),m=se(C(u[0][0],u[1][1]-n),C(u[0][0],u[0][1]+n));return[[h,p,U,m],[]]}let a=C(e.x+e.width/2,e.y+e.height/2),i=y1(C(e.x,e.y),C(e.x+e.width,e.y+e.height)),r=se(C(i[0][0]+n,i[0][1]),C(i[1][0]-n,i[0][1])),s=se(C(i[1][0],i[0][1]+n),C(i[1][0],i[1][1]-n)),l=se(C(i[0][0]+n,i[1][1]),C(i[1][0]-n,i[1][1])),c=se(C(i[0][0],i[1][1]-n),C(i[0][0],i[0][1]+n)),d=[pt(en(re(C(i[0][0]-t,i[0][1]-t),a)),t),pt(en(re(C(i[1][0]+t,i[0][1]-t),a)),t),pt(en(re(C(i[1][0]+t,i[1][1]+t),a)),t),pt(en(re(C(i[0][0]-t,i[1][1]+t),a)),t)],o=[oi(Ce(d[0],c[1]),Ce(d[0],C(c[1][0]+2/3*(i[0][0]-c[1][0]),c[1][1]+2/3*(i[0][1]-c[1][1]))),Ce(d[0],C(r[0][0]+2/3*(i[0][0]-r[0][0]),r[0][1]+2/3*(i[0][1]-r[0][1]))),Ce(d[0],r[0])),oi(Ce(d[1],r[1]),Ce(d[1],C(r[1][0]+2/3*(i[1][0]-r[1][0]),r[1][1]+2/3*(i[0][1]-r[1][1]))),Ce(d[1],C(s[0][0]+2/3*(i[1][0]-s[0][0]),s[0][1]+2/3*(i[0][1]-s[0][1]))),Ce(d[1],s[0])),oi(Ce(d[2],s[1]),Ce(d[2],C(s[1][0]+2/3*(i[1][0]-s[1][0]),s[1][1]+2/3*(i[1][1]-s[1][1]))),Ce(d[2],C(l[1][0]+2/3*(i[1][0]-l[1][0]),l[1][1]+2/3*(i[1][1]-l[1][1]))),Ce(d[2],l[1])),oi(Ce(d[3],l[0]),Ce(d[3],C(l[0][0]+2/3*(i[0][0]-l[0][0]),l[0][1]+2/3*(i[1][1]-l[0][1]))),Ce(d[3],C(c[0][0]+2/3*(i[0][0]-c[0][0]),c[0][1]+2/3*(i[1][1]-c[0][1]))),Ce(d[3],c[0]))];return[[se(o[0][3],o[1][0]),se(o[1][3],o[2][0]),se(o[2][3],o[3][0]),se(o[3][3],o[0][0])],o]}function r7(e,t=0){var x;let[n,a,i,r,s,l,c,d]=S7(e),o=ca(Math.abs(n-c),e),u=ca(Math.abs(r-a),e);if(((x=e.roundness)==null?void 0:x.type)==null){let[y,E,S,w]=[C(e.x+n,e.y+a-t),C(e.x+i+t,e.y+r),C(e.x+s,e.y+l+t),C(e.x+c-t,e.y+d)],k=se(C(y[0]+o,y[1]+u),C(E[0]-o,E[1]-u)),T=se(C(E[0]-o,E[1]+u),C(S[0]+o,S[1]-u)),_=se(C(S[0]-o,S[1]-u),C(w[0]+o,w[1]+u)),j=se(C(w[0]+o,w[1]-u),C(y[0]-o,y[1]+u));return[[k,T,_,j],[]]}let h=C(e.x+e.width/2,e.y+e.height/2),[p,U,m,g]=[C(e.x+n,e.y+a),C(e.x+i,e.y+r),C(e.x+s,e.y+l),C(e.x+c,e.y+d)],b=[pt(en(re(U,h)),t),pt(en(re(m,h)),t),pt(en(re(g,h)),t),pt(en(re(p,h)),t)],v=[oi(Ce(b[0],C(U[0]-o,U[1]-u)),Ce(b[0],U),Ce(b[0],U),Ce(b[0],C(U[0]-o,U[1]+u))),oi(Ce(b[1],C(m[0]+o,m[1]-u)),Ce(b[1],m),Ce(b[1],m),Ce(b[1],C(m[0]-o,m[1]-u))),oi(Ce(b[2],C(g[0]+o,g[1]+u)),Ce(b[2],g),Ce(b[2],g),Ce(b[2],C(g[0]+o,g[1]-u))),oi(Ce(b[3],C(p[0]-o,p[1]+u)),Ce(b[3],p),Ce(b[3],p),Ce(b[3],C(p[0]+o,p[1]+u)))];return[[se(v[0][3],v[1][0]),se(v[1][3],v[2][0]),se(v[2][3],v[3][0]),se(v[3][3],v[0][0])],v]}var _1=e=>{if(e.type==="arrow")return!1;let t=!ia(e.backgroundColor)||Wn(e)||Pn(e)||q(e);return e.type==="line"||e.type==="freedraw"?t&&Ui(e.points):t||Ne(e)},Cs=({x:e,y:t,element:n,shape:a,threshold:i=10,frameNameBound:r=null})=>{let s=_1(n)&&qd(C(e,t),a)||T1(C(e,t),a,i);return!s&&r&&(s=qd(C(e,t),{type:"polygon",data:e7(r).data})),s},ip=(e,t,n,a,i=0)=>{let[r,s,l,c]=pa(n,a);return r-=i,s-=i,l+=i,c+=i,u8(C(r,s),C(e,t),C(l,c))},mL=(e,t)=>!Cs(e)&&!s7(e.x,e.y,o7(e.element,t))&&ip(e.x,e.y,e.element,t),s7=(e,t,n)=>!!n&&qd(C(e,t),n),l7=(e,t,n=0)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return gL(e,t,n);case"diamond":return bL(e,t,n);case"ellipse":return vL(e,t,n);default:throw new Error(`Unimplemented element type '${e.type}'`)}},gL=(e,t,n=0)=>{let a=C(e.x+e.width/2,e.y+e.height/2),i=H(t[0],a,-e.angle),r=H(t[1],a,-e.angle),[s,l]=i7(e,n);return[...s.map(c=>_o(se(i,r),c)).filter(c=>c!=null).map(c=>H(c,a,e.angle)),...l.flatMap(c=>f8(c,se(i,r))).filter(c=>c!=null).map(c=>H(c,a,e.angle))].filter((c,d,o)=>o.findIndex(u=>fa(c,u))===d)},bL=(e,t,n=0)=>{let a=C(e.x+e.width/2,e.y+e.height/2),i=H(t[0],a,-e.angle),r=H(t[1],a,-e.angle),[s,l]=r7(e,n);return[...s.map(c=>_o(se(i,r),c)).filter(c=>c!=null).map(c=>H(c,a,e.angle)),...l.flatMap(c=>f8(c,se(i,r))).filter(c=>c!=null).map(c=>H(c,a,e.angle))].filter((c,d,o)=>o.findIndex(u=>fa(c,u))===d)},vL=(e,t,n=0)=>{let a=C(e.x+e.width/2,e.y+e.height/2),i=H(t[0],a,-e.angle),r=H(t[1],a,-e.angle);return UL(a7(a,e.width/2+n,e.height/2+n),x1(i,r)).map(s=>H(s,a,e.angle))},Re={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},D={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Fa?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SLASH:"/",A:"a",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},xL=new Map([[D.Z,Re.Z],[D.Y,Re.Y]]),yL=e=>/^[a-z]$/.test(e.toLowerCase()),j1=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=xL.get(t);return!!(n&&!yL(e.key)&&e.code===n)},Xl=e=>e===D.ARROW_LEFT||e===D.ARROW_RIGHT||e===D.ARROW_DOWN||e===D.ARROW_UP,dh=e=>e.altKey,Tl=e=>e.shiftKey,so=e=>e.shiftKey,rp=[{icon:FM,value:"selection",key:D.V,numericKey:D[1],fillable:!0},{icon:zM,value:"rectangle",key:D.R,numericKey:D[2],fillable:!0},{icon:BM,value:"diamond",key:D.D,numericKey:D[3],fillable:!0},{icon:HM,value:"ellipse",key:D.O,numericKey:D[4],fillable:!0},{icon:XM,value:"arrow",key:D.A,numericKey:D[5],fillable:!0},{icon:WM,value:"line",key:D.L,numericKey:D[6],fillable:!0},{icon:jo,value:"freedraw",key:[D.P,D.X],numericKey:D[7],fillable:!1},{icon:j8,value:"text",key:D.T,numericKey:D[8],fillable:!1},{icon:GM,value:"image",key:null,numericKey:D[9],fillable:!1},{icon:YM,value:"eraser",key:D.E,numericKey:D[0],fillable:!1}],wL=e=>{var t;return((t=rp.find((n,a)=>n.numericKey!=null&&e===n.numericKey.toString()||n.key&&(typeof n.key=="string"?n.key===e:n.key.includes(e))))==null?void 0:t.value)||null},si=(e,t)=>{var n;switch(e.type){case"rectangle":case"diamond":case"frame":case"magicframe":case"embeddable":case"image":case"iframe":case"text":case"selection":return e7(e);case"arrow":case"line":{let a=((n=dt.get(e))==null?void 0:n[0])??dt.generateElementShape(e,null)[0],[,,,,i,r]=pe(e,t);return _1(e)?lL(e,a,C(e.x,e.y),e.angle,C(i,r)):iL(a,C(e.x,e.y),e.angle,C(i,r))}case"ellipse":return aL(e);case"freedraw":{let[,,,,a,i]=pe(e,t);return sL(e,C(a,i),_1(e))}}},o7=(e,t)=>{let n=ge(e,t);return n?e.type==="arrow"?si({...n,...J.getBoundTextElementPosition(e,n,t)},t):si(n,t):null},c7=(e,t)=>{let n=dt.generateElementShape(e,null);if(!n)return null;let a=cr(n[0]),i=C(0,0),r=0,s=1/0,l=null;for(;r<a.length;){let{op:c,data:d}=a[r];if(c==="move"&&(nn(zk(d),"The returned ops is not compatible with a point"),i=d),c==="bcurveTo"){let o=i,u=C(d[0],d[1]),h=C(d[2],d[3]),p=C(d[4],d[5]),U=Oe(p,t);U<s&&(s=U,l=[o,u,h,p]),i=p}r++}return l},d7=(e,t,n,a,i)=>{let r=(c,d)=>Math.pow(1-c,3)*a[d]+3*c*Math.pow(1-c,2)*n[d]+3*Math.pow(c,2)*(1-c)*t[d]+e[d]*Math.pow(c,3),s=r(i,0),l=r(i,1);return C(s,l)},EL=(e,t)=>{let n=c7(e,t);if(!n)return[];let a=[],i=1;for(;i>0;){let r=d7(n[0],n[1],n[2],n[3],i);a.push(C(r[0],r[1])),i-=.05}return a.length&&fa(a.at(-1),t)&&a.push(C(t[0],t[1])),a},u7=(e,t)=>{let n=[];n[0]=0;let a=EL(e,t),i=0,r=0;for(;i<a.length-1;){let s=Oe(a[i],a[i+1]);r+=s,n.push(r),i++}return n},SL=(e,t)=>u7(e,t).at(-1),CL=(e,t,n)=>{let a=u7(e,t),i=a.length-1,r=a.at(-1),s=n*r,l=0,c=i,d=0;for(;l<c;)d=Math.floor(l+(c-l)/2),a[d]<s?l=d+1:c=d;return a[d]>s&&d--,a[d]===s?d/i:1-(d+(s-a[d])/(a[d+1]-a[d]))/i},ja=(e,t)=>{let n={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,midX:e.x+e.width/2,midY:e.y+e.height/2},a=C(n.midX,n.midY),[i,r]=H(C(n.minX,n.minY),a,e.angle),[s,l]=H(C(n.maxX,n.minY),a,e.angle),[c,d]=H(C(n.maxX,n.maxY),a,e.angle),[o,u]=H(C(n.minX,n.maxY),a,e.angle),h=[Math.min(i,s,c,o),Math.min(r,l,d,u),Math.max(i,s,c,o),Math.max(r,l,d,u)];if(t){let[p,U,m,g]=t;return[h[0]-g,h[1]-p,h[2]+U,h[3]+m]}return h},qs=(e,t)=>e[0]>t[0]&&e[0]<t[2]&&e[1]>t[1]&&e[1]<t[3],ca=(e,t)=>{var n,a,i,r;if(((n=t.roundness)==null?void 0:n.type)===St.PROPORTIONAL_RADIUS||((a=t.roundness)==null?void 0:a.type)===St.LEGACY)return e*th;if(((i=t.roundness)==null?void 0:i.type)===St.ADAPTIVE_RADIUS){let s=((r=t.roundness)==null?void 0:r.value)??Ak,l=s/th;return e<=l?e*th:s}return 0},Ui=(e,t=1)=>{if(e.length>=3){let[n,a]=[e[0],e[e.length-1]];return Oe(n,a)<=sd/t}return!1},Pt=10,kL=(e,t,n,a,i,r,s)=>{var _,j;let{width:l,height:c}=mi(e),d=n/l,o=a/c,u=(((_=e.crop)==null?void 0:_.x)??0)/d,h=(((j=e.crop)==null?void 0:j.y)??0)/o,p=H(C(i,r),C(e.x+e.width/2,e.y+e.height/2),-e.angle);i=p[0],r=p[1];let U=e.width,m=e.height,g=e.crop??{x:0,y:0,width:n,height:a,naturalWidth:n,naturalHeight:a},b=g.height,v=g.width,x=e.scale[0]===-1,y=e.scale[1]===-1,E=r-e.y,S=i-e.x;t.includes("n")&&(m=Se(e.height-E,Pt,y?c-h:e.height+h)),t.includes("s")&&(E=r-e.y-e.height,m=Se(e.height+E,Pt,y?e.height+h:c-h)),t.includes("e")&&(S=i-e.x-e.width,U=Se(e.width+S,Pt,x?e.width+u:l-u)),t.includes("w")&&(U=Se(e.width-S,Pt,x?l-u:e.width+u));let w=A=>{A.height=m*o,A.width=U*d};w(g);let k=(A,R)=>{w(R),A.includes("n")&&(y||(R.y+=b-R.height)),A.includes("s")&&y&&(R.y+=b-R.height),A.includes("e")&&x&&(R.x+=v-R.width),A.includes("w")&&(x||(R.x+=v-R.width))};switch(t){case"n":{if(s){let A=u+e.width/2,R=l-u-e.width/2,N=Math.min(A,R)*2;U=Se(m*s,Pt,N),m=U/s}k(t,g),s&&(g.x+=(v-g.width)/2);break}case"s":{if(s){let A=u+e.width/2,R=l-u-e.width/2,N=Math.min(A,R)*2;U=Se(m*s,Pt,N),m=U/s}k(t,g),s&&(g.x+=(v-g.width)/2);break}case"w":{if(s){let A=h+e.height/2,R=c-h-e.height/2,N=Math.min(A,R)*2;m=Se(U/s,Pt,N),U=m*s}k(t,g),s&&(g.y+=(b-g.height)/2);break}case"e":{if(s){let A=h+e.height/2,R=c-h-e.height/2,N=Math.min(A,R)*2;m=Se(U/s,Pt,N),U=m*s}k(t,g),s&&(g.y+=(b-g.height)/2);break}case"ne":{if(s)if(S>-E){let A=y?c-h:h+e.height;m=Se(U/s,Pt,A),U=m*s}else{let A=x?u+e.width:l-u;U=Se(m*s,Pt,A),m=U/s}k(t,g);break}case"nw":{if(s)if(S<E){let A=y?c-h:h+e.height;m=Se(U/s,Pt,A),U=m*s}else{let A=x?l-u:u+e.width;U=Se(m*s,Pt,A),m=U/s}k(t,g);break}case"se":{if(s)if(S>E){let A=y?h+e.height:c-h;m=Se(U/s,Pt,A),U=m*s}else{let A=x?u+e.width:l-u;U=Se(m*s,Pt,A),m=U/s}k(t,g);break}case"sw":{if(s)if(-S>E){let A=y?h+e.height:c-h;m=Se(U/s,Pt,A),U=m*s}else{let A=x?l-u:u+e.width;U=Se(m*s,Pt,A),m=U/s}k(t,g);break}}let T=ML(e,t,U,m,!!s);return i2(g.width,g.naturalWidth)&&i2(g.height,g.naturalHeight)&&(g=null),{x:T[0],y:T[1],width:U,height:m,crop:g}},ML=(e,t,n,a,i)=>{let[r,s,l,c]=Zi(e,e.width,e.height,!0),d=C(r,s),o=C(l,c),u=ec(d,o),[h,p,U,m]=Zi(e,n,a,!0),g=U-h,b=m-p,v=[...d];if(["n","w","nw"].includes(t)&&(v=[o[0]-Math.abs(g),o[1]-Math.abs(b)]),t==="ne"){let k=[d[0],o[1]];v=[k[0],k[1]-Math.abs(b)]}if(t==="sw"){let k=[o[0],d[1]];v=[k[0]-Math.abs(g),k[1]]}i&&(["s","n"].includes(t)&&(v[0]=u[0]-g/2),["e","w"].includes(t)&&(v[1]=u[1]-b/2));let x=e.angle,y=H(v,u,x),E=[v[0]+Math.abs(g)/2,v[1]+Math.abs(b)/2],S=H(E,u,x);v=H(y,S,-x);let w=[...v];return w[0]+=e.x-h,w[1]+=e.y-p,w},IL=(e,t)=>{if(e.crop){let{width:n,height:a}=mi(e),[i,r,s,l,c,d]=pe(e,t),o=re(H(C(i,r),C(c,d),e.angle)),u=re(H(C(s,r),C(c,d),e.angle)),h=en(Hd(u,o)),p=re(H(C(i,l),C(c,d),e.angle)),U=Hd(p,o),m=en(U),{cropX:g,cropY:b}=TL(e.crop,e.scale),v=Hi(Hi(o,pt(h,-g*n/e.crop.naturalWidth)),pt(m,-b*a/e.crop.naturalHeight)),x=Ce(Hi(Hi(v,pt(h,n/2)),pt(m,a/2))),y=H(Ce(v),x,-e.angle);return{...e,x:y[0],y:y[1],width:n,height:a,crop:null}}return e},mi=e=>{if(e.crop){let t=e.width/(e.crop.width/e.crop.naturalWidth),n=e.height/(e.crop.height/e.crop.naturalHeight);return{width:t,height:n}}return{width:e.width,height:e.height}},TL=(e,t)=>{let n=e.x,a=e.y,i=t[0]===-1,r=t[1]===-1;return i&&(n=e.naturalWidth-Math.abs(n)-e.width),r&&(a=e.naturalHeight-Math.abs(a)-e.height),{cropX:n,cropY:a}},_L=(e,t=!1)=>{let n=e.crop;if(!n)return null;let a=e.scale[0]===-1,i=e.scale[1]===-1,r=n.x,s=n.y;if(a&&(r=n.naturalWidth-n.width-n.x),i&&(s=n.naturalHeight-n.height-n.y),t)return{x:r,y:s};let{width:l,height:c}=mi(e);return{x:r/(n.naturalWidth/l),y:s/(n.naturalHeight/c)}},f7="invert(100%) hue-rotate(180deg) saturate(1.25)",jL=za(),h7=(e,t)=>Dn(e)&&!t.imageCache.has(e.fileId),p7=(e,t,n)=>{var a;return n.theme===ke.DARK&&Dn(e)&&!h7(e,t)&&((a=t.imageCache.get(e.fileId))==null?void 0:a.mimeType)!==ae.svg},Wu=e=>{switch(e.type){case"freedraw":return e.strokeWidth*12;case"text":return e.fontSize/2;default:return 20}},U7=(e,t,n,a,i=1)=>{let r=((t==null?void 0:t.opacity)??100)*e.opacity/1e4*i;return(n.has(e.id)||a&&a.some(s=>s.id===e.id)||t&&n.has(t.id))&&(r*=jk/100),r},AL=(e,t,n)=>{let a=Wu(e),[i,r,s,l]=pe(e,t),c=fe(e)||Xn(e)?qt(i,s):e.width,d=fe(e)||Xn(e)?qt(r,l):e.height,o=c*window.devicePixelRatio+a*2,u=d*window.devicePixelRatio+a*2,h=n.value;return(o*h>32767||u*h>32767)&&(h=Math.min(32767/o,32767/u)),o*u*h*h>16777216&&(h=Math.sqrt(16777216/(o*u))),o=Math.floor(o*h),u=Math.floor(u*h),{width:o,height:u,scale:h}},m7=(e,t,n,a,i)=>{var b,v;let r=document.createElement("canvas"),s=r.getContext("2d"),l=Wu(e),{width:c,height:d,scale:o}=AL(e,t,n);if(!c||!d)return null;r.width=c,r.height=d;let u=-100,h=0;if(fe(e)||Xn(e)){let[x,y]=pe(e,t);u=e.x>x?qt(e.x,x)*window.devicePixelRatio*o:0,h=e.y>y?qt(e.y,y)*window.devicePixelRatio*o:0,s.translate(u,h)}s.save(),s.translate(l*o,l*o),s.scale(window.devicePixelRatio*o,window.devicePixelRatio*o);let p=lr.canvas(r);p7(e,a,i)&&(s.filter=f7),hd(e,p,s,a),s.restore();let U=ge(e,t),m=document.createElement("canvas"),g=m.getContext("2d");if(xe(e)&&U){let[x,y,E,S]=pe(e,t),w=Math.max(qt(x,E),qt(y,S));m.width=w*window.devicePixelRatio*o+l*o*10,m.height=w*window.devicePixelRatio*o+l*o*10,g.translate(m.width/2,m.height/2),g.rotate(e.angle),g.drawImage(r,-r.width/2,-r.height/2,r.width,r.height);let[,,,,k,T]=pe(U,t);g.rotate(-e.angle);let _=(m.width-r.width)/2,j=(m.height-r.height)/2,A=m.width/2-(k-x)*window.devicePixelRatio*o-_-l*o,R=m.height/2-(T-y)*window.devicePixelRatio*o-j-l*o;g.translate(-A,-R),g.clearRect(-(U.width/2+Mt)*window.devicePixelRatio*o,-(U.height/2+Mt)*window.devicePixelRatio*o,(U.width+Mt*2)*window.devicePixelRatio*o,(U.height+Mt*2)*window.devicePixelRatio*o)}return{element:e,canvas:r,theme:i.theme,scale:o,zoomValue:n.value,canvasOffsetX:u,canvasOffsetY:h,boundTextElementVersion:((b=ge(e,t))==null?void 0:b.version)||null,containingFrameOpacity:((v=wn(e,t))==null?void 0:v.opacity)||100,boundTextCanvas:m,angle:e.angle,imageCrop:Ne(e)?e.crop:null}},RL=14,g7=document.createElement("img");g7.src=`data:${ae.svg},${encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>')}`;var b7=document.createElement("img");b7.src=`data:${ae.svg},${encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>')}`;var LL=(e,t)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);let n=Math.min(e.width,e.height),a=Math.min(n,Math.min(n*.4,100));t.drawImage(e.status==="error"?b7:g7,e.width/2-a/2,e.height/2-a/2,a,a)},hd=(e,t,n,a,i)=>{var r;switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":{n.lineJoin="round",n.lineCap="round",t.draw(dt.get(e));break}case"arrow":case"line":{n.lineJoin="round",n.lineCap="round",dt.get(e).forEach(s=>{t.draw(s)});break}case"freedraw":{n.save(),n.fillStyle=e.strokeColor;let s=NL(e),l=dt.get(e);l&&t.draw(l),n.fillStyle=e.strokeColor,n.fill(s),n.restore();break}case"image":{let s=Dn(e)?(r=a.imageCache.get(e.fileId))==null?void 0:r.image:void 0;if(s!=null&&!(s instanceof Promise)){e.roundness&&n.roundRect&&(n.beginPath(),n.roundRect(0,0,e.width,e.height,ca(Math.min(e.width,e.height),e)),n.clip());let{x:l,y:c,width:d,height:o}=e.crop?e.crop:{x:0,y:0,width:s.naturalWidth,height:s.naturalHeight};n.drawImage(s,l,c,d,o,0,0,e.width,e.height)}else LL(e,n);break}default:if(q(e)){let s=U8(e.text),l=s&&!n.canvas.isConnected;l&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",s?"rtl":"ltr"),n.save(),n.font=Ve(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;let c=e.text.replace(/\r\n?/g,`
|
|
15
|
+
`).split(`
|
|
16
|
+
`),d=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,o=nc(e.fontSize,e.lineHeight),u=Q8(e.fontFamily,e.fontSize,o);for(let h=0;h<c.length;h++)n.fillText(c[h],d,h*o+u);n.restore(),l&&n.canvas.remove()}else throw new Error(`Unimplemented type ${e.type}`)}},A1=new WeakMap,D2=(e,t,n,a)=>{var u;let i=n?a.zoom:jL.zoom,r=A1.get(e),s=r&&r.zoomValue!==i.value&&!(a!=null&&a.shouldCacheIgnoreZoom),l=ge(e,t),c=(l==null?void 0:l.version)||null,d=Ne(e)?e.crop:null,o=((u=wn(e,t))==null?void 0:u.opacity)||100;if(!r||s||r.theme!==a.theme||r.boundTextElementVersion!==c||r.imageCrop!==d||r.containingFrameOpacity!==o||xe(e)&&l&&e.angle!==r.angle){let h=m7(e,t,i,n,a);return h?(A1.set(e,h),h):null}return r},uh=(e,t,n,a,i)=>{let r=e.element,s=Wu(r),l=e.scale,[c,d,o,u]=pe(r,i),h=((c+o)/2+a.scrollX)*window.devicePixelRatio,p=((d+u)/2+a.scrollY)*window.devicePixelRatio;t.save(),t.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);let U=ge(r,i);if(xe(r)&&U){let m=(e.boundTextCanvas.width-e.canvas.width)/2,g=(e.boundTextCanvas.height-e.canvas.height)/2;t.translate(h,p),t.drawImage(e.boundTextCanvas,-(o-c)/2*window.devicePixelRatio-m/l-s,-(u-d)/2*window.devicePixelRatio-g/l-s,e.boundTextCanvas.width/l,e.boundTextCanvas.height/l)}else t.translate(h,p),t.rotate(r.angle),"scale"in e.element&&!h7(r,n)&&t.scale(e.element.scale[0],e.element.scale[1]),t.translate(-h,-p),t.drawImage(e.canvas,(c+a.scrollX)*window.devicePixelRatio-s*e.scale/e.scale,(d+a.scrollY)*window.devicePixelRatio-s*e.scale/e.scale,e.canvas.width/e.scale,e.canvas.height/e.scale),be.VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX;t.restore()},DL=(e,t,n,a)=>{t.save(),t.translate(e.x+n.scrollX,e.y+n.scrollY),t.fillStyle="rgba(0, 0, 200, 0.04)";let i=.5/n.zoom.value;t.fillRect(i,i,e.width,e.height),t.lineWidth=1/n.zoom.value,t.strokeStyle=a,t.strokeRect(i,i,e.width,e.height),t.restore()},wr=(e,t,n,a,i,r,s)=>{var c;let l=((c=s.openDialog)==null?void 0:c.name)==="elementLinkSelector"&&!s.selectedElementIds[e.id]&&!s.hoveredElementIds[e.id];switch(i.globalAlpha=U7(e,wn(e,t),r.elementsPendingErasure,r.pendingFlowchartNodes,l?l8:1),e.type){case"magicframe":case"frame":{s.frameRendering.enabled&&s.frameRendering.outline&&(i.save(),i.translate(e.x+s.scrollX,e.y+s.scrollY),i.fillStyle="rgba(0, 0, 200, 0.04)",i.lineWidth=ot.strokeWidth/s.zoom.value,i.strokeStyle=ot.strokeColor,cd(e)&&(i.strokeStyle=s.theme===ke.LIGHT?"#7affd7":"#1d8264"),i.roundRect?(i.beginPath(),i.roundRect(0,0,e.width,e.height,ot.radius/s.zoom.value),i.stroke(),i.closePath()):i.strokeRect(0,0,e.width,e.height),i.restore());break}case"freedraw":{if(dt.generateElementShape(e,null),r.isExporting){let[d,o,u,h]=pe(e,t),p=(d+u)/2+s.scrollX,U=(o+h)/2+s.scrollY,m=(u-d)/2-(e.x-d),g=(h-o)/2-(e.y-o);i.save(),i.translate(p,U),i.rotate(e.angle),i.translate(-m,-g),hd(e,a,i,r),i.restore()}else{let d=D2(e,n,r,s);if(!d)return;uh(d,i,r,s,n)}break}case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":case"iframe":case"embeddable":{if(dt.generateElementShape(e,r),r.isExporting){let[d,o,u,h]=pe(e,t),p=(d+u)/2+s.scrollX,U=(o+h)/2+s.scrollY,m=(u-d)/2-(e.x-d),g=(h-o)/2-(e.y-o);if(q(e)){let v=zt(e,t);if(xe(v)){let x=J.getBoundTextElementPosition(v,e,t);m=(u-d)/2-(x.x-d),g=(h-o)/2-(x.y-o)}}i.save(),i.translate(p,U),p7(e,r,s)&&(i.filter="none");let b=ge(e,t);if(xe(e)&&b){let v=document.createElement("canvas"),x=v.getContext("2d"),y=Math.max(qt(d,u),qt(o,h)),E=Wu(e);v.width=y*s.exportScale+E*10*s.exportScale,v.height=y*s.exportScale+E*10*s.exportScale,x.translate(v.width/2,v.height/2),x.scale(s.exportScale,s.exportScale),m=e.width/2-(e.x-d),g=e.height/2-(e.y-o),x.rotate(e.angle);let S=lr.canvas(v);x.translate(-m,-g),hd(e,S,x,r),x.translate(m,g),x.rotate(-e.angle);let[,,,,w,k]=pe(b,t),T=(d+u)/2-w,_=(o+h)/2-k;x.translate(-T,-_),x.clearRect(-b.width/2,-b.height/2,b.width,b.height),i.scale(1/s.exportScale,1/s.exportScale),i.drawImage(v,-v.width/2,-v.height/2,v.width,v.height)}else i.rotate(e.angle),e.type==="image"&&i.scale(e.scale[0],e.scale[1]),i.translate(-m,-g),hd(e,a,i,r);i.restore()}else{let d=D2(e,n,r,s);if(!d)return;let o=i.imageSmoothingEnabled;if(!(s!=null&&s.shouldCacheIgnoreZoom)&&(!e.angle||Ok(e.angle))&&(i.imageSmoothingEnabled=!1),e.id===s.croppingElementId&&Ne(d.element)&&d.element.crop!==null){i.save(),i.globalAlpha=.1;let u=m7(IL(d.element,t),n,s.zoom,r,s);u&&uh(u,i,r,s,n),i.restore()}uh(d,i,r,s,n),i.imageSmoothingEnabled=o}break}default:throw new Error(`Unimplemented type ${e.type}`)}i.globalAlpha=1},v7=new WeakMap([]);function PL(e){let t=sp(e),n=new Path2D(t);return v7.set(e,n),n}function NL(e){return v7.get(e)}function sp(e){let t=e.simulatePressure?e.points:e.points.length?e.points.map(([a,i],r)=>[a,i,e.pressures[r]]):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:a=>Math.sin(a*Math.PI/2),last:!!e.lastCommittedPoint};return $L(BC(t,n))}function P2(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var OL=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;function $L(e){if(!e.length)return"";let t=e.length-1;return e.reduce((n,a,i,r)=>(i===t?n.push(a,P2(a,r[0]),"L",r[0],"Z"):n.push(a,P2(a,r[i+1])),n),["M",e[0],"Q"]).join(" ").replace(OL,"$1")}var Js=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="line"||e==="freedraw",R1=e=>e!=="image"&&e!=="frame"&&e!=="magicframe",N2=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line",O2=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="arrow"||e==="line",L1=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image",$2=e=>e==="arrow",Jd=e=>e==="arrow",ht=[1,0],$t=[0,1],mn=[-1,0],gn=[0,-1],Lc=(e,t)=>{let n=Qo(Math.atan2(t[1]-e[1],t[0]-e[0]));return n>=315||n<45?gn:n>=45&&n<135?ht:n>=135&&n<225?$t:mn},qr=e=>{let[t,n]=e,a=Math.abs(t),i=Math.abs(n);return t>i?ht:t<=-i?mn:n>a?$t:gn},Ao=(e,t)=>qr(re(e,t)),li=(e,t)=>ci(Ao(e,t)),Ut=(e,t)=>e[0]===t[0]&&e[1]===t[1],ci=e=>Ut(e,ht)||Ut(e,mn),x7=(e,t,n)=>{let a=cp(t);if(e.type==="diamond"){if(n[0]<e.x)return mn;if(n[1]<e.y)return gn;if(n[0]>e.x+e.width)return ht;if(n[1]>e.y+e.height)return $t;let c=H(ti(C(e.x+e.width/2,e.y),a,2),a,e.angle),d=H(ti(C(e.x+e.width,e.y+e.height/2),a,2),a,e.angle),o=H(ti(C(e.x+e.width/2,e.y+e.height),a,2),a,e.angle),u=H(ti(C(e.x,e.y+e.height/2),a,2),a,e.angle);return Us([c,d,a],n)?Lc(c,d):Us([d,o,a],n)?Lc(d,o):Us([o,u,a],n)?Lc(o,u):Lc(u,c)}let i=ti(C(t[0],t[1]),a,2),r=ti(C(t[2],t[1]),a,2),s=ti(C(t[0],t[3]),a,2),l=ti(C(t[2],t[3]),a,2);return Us([i,r,a],n)?gn:Us([r,l,a],n)?ht:Us([l,s,a],n)?$t:mn},y7=e=>[e[0]===0?0:e[0]>0?-1:1,e[1]===0?0:e[1]>0?-1:1],FL=e=>[8,8+e],w7=e=>[1.5,6+e];function zL(e){let t=e.roughness,n=Math.max(e.width,e.height),a=Math.min(e.width,e.height);return a>=20&&n>=50||a>=15&&e.roundness&&L1(e.type)||fe(e)&&n>=50?t:Math.min(t/(n<10?3:2),2.5)}var Cn=(e,t=!1)=>{let n={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?FL(e.strokeWidth):e.strokeStyle==="dotted"?w7(e.strokeWidth):void 0,disableMultiStroke:e.strokeStyle!=="solid",strokeWidth:e.strokeStyle!=="solid"?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:e.strokeWidth*4,roughness:zL(e),stroke:e.strokeColor,preserveVertices:t||e.roughness<i8.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill=ia(e.backgroundColor)?void 0:e.backgroundColor,e.type==="ellipse"&&(n.curveFitting=1),n;case"line":case"freedraw":return Ui(e.points)&&(n.fillStyle=e.fillStyle,n.fill=e.backgroundColor==="transparent"?void 0:e.backgroundColor),n;case"arrow":return n;default:throw new Error(`Unimplemented type ${e.type}`)}},F2=(e,t,n)=>Pn(e)&&(t||Un(e)&&(n==null?void 0:n.get(e.id))!==!0)&&ia(e.backgroundColor)&&ia(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:Oi(e)?{...e,strokeColor:ia(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:ia(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,z2=(e,t,n,a,i,r,s)=>{let l=W2(e,t,n,a);if(l===null)return[];let c=(d,o)=>{if(d===null)return[];let[,,u,h,p,U]=d;return[i.line(u,h,p,U,o)]};switch(a){case"dot":case"circle":case"circle_outline":{let[d,o,u]=l;return delete r.strokeLineDash,[i.circle(d,o,u,{...r,fill:a==="circle_outline"?s:e.strokeColor,fillStyle:"solid",stroke:e.strokeColor,roughness:Math.min(.5,r.roughness||0)})]}case"triangle":case"triangle_outline":{let[d,o,u,h,p,U]=l;return delete r.strokeLineDash,[i.polygon([[d,o],[u,h],[p,U],[d,o]],{...r,fill:a==="triangle_outline"?s:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,r.roughness||0)})]}case"diamond":case"diamond_outline":{let[d,o,u,h,p,U,m,g]=l;return delete r.strokeLineDash,[i.polygon([[d,o],[u,h],[p,U],[m,g],[d,o]],{...r,fill:a==="diamond_outline"?s:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,r.roughness||0)})]}case"crowfoot_one":return c(l,r);case"bar":case"arrow":case"crowfoot_many":case"crowfoot_one_or_many":default:{let[d,o,u,h,p,U]=l;if(e.strokeStyle==="dotted"){let m=w7(e.strokeWidth-1);r.strokeLineDash=[m[0],m[1]-1]}else delete r.strokeLineDash;return r.roughness=Math.min(1,r.roughness||0),[i.line(u,h,d,o,r),i.line(p,U,d,o,r),...a==="crowfoot_one_or_many"?c(W2(e,t,n,"crowfoot_one"),r):[]]}}},BL=(e,t,{isExporting:n,canvasBackgroundColor:a,embedsValidationStatus:i})=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":{let r;if(e.roundness){let s=e.width,l=e.height,c=ca(Math.min(s,l),e);r=t.path(`M ${c} 0 L ${s-c} 0 Q ${s} 0, ${s} ${c} L ${s} ${l-c} Q ${s} ${l}, ${s-c} ${l} L ${c} ${l} Q 0 ${l}, 0 ${l-c} L 0 ${c} Q 0 0, ${c} 0`,Cn(F2(e,n,i),!0))}else r=t.rectangle(0,0,e.width,e.height,Cn(F2(e,n,i),!1));return r}case"diamond":{let r,[s,l,c,d,o,u,h,p]=S7(e);if(e.roundness){let U=ca(Math.abs(s-h),e),m=ca(Math.abs(d-l),e);r=t.path(`M ${s+U} ${l+m} L ${c-U} ${d-m}
|
|
17
|
+
C ${c} ${d}, ${c} ${d}, ${c-U} ${d+m}
|
|
18
|
+
L ${o+U} ${u-m}
|
|
19
|
+
C ${o} ${u}, ${o} ${u}, ${o-U} ${u-m}
|
|
20
|
+
L ${h+U} ${p+m}
|
|
21
|
+
C ${h} ${p}, ${h} ${p}, ${h+U} ${p-m}
|
|
22
|
+
L ${s-U} ${l+m}
|
|
23
|
+
C ${s} ${l}, ${s} ${l}, ${s+U} ${l+m}`,Cn(e,!0))}else r=t.polygon([[s,l],[c,d],[o,u],[h,p]],Cn(e));return r}case"ellipse":return t.ellipse(e.width/2,e.height/2,e.width,e.height,Cn(e));case"line":case"arrow":{let r,s=Cn(e),l=e.points.length?e.points:[C(0,0)];if(ee(e)?l.every(c=>Math.abs(c[0])<=1e6&&Math.abs(c[1])<=1e6)?r=[t.path(HL(l,16),Cn(e,!0))]:(console.error("Elbow arrow with extreme point positions detected. Arrow not rendered.",e.id,JSON.stringify(l)),r=[]):e.roundness?r=[t.curve(l,s)]:s.fill?r=[t.polygon(l,s)]:r=[t.linearPath(l,s)],e.type==="arrow"){let{startArrowhead:c=null,endArrowhead:d="arrow"}=e;if(c!==null){let o=z2(e,r,"start",c,t,s,a);r.push(...o)}if(d!==null){let o=z2(e,r,"end",d,t,s,a);r.push(...o)}}return r}case"freedraw":{let r;if(PL(e),Ui(e.points)){let s=VC(e.points,.75);r=t.curve(s,{...Cn(e),stroke:"none"})}else r=null;return r}case"frame":case"magicframe":case"text":case"image":return null;default:return Vr(e,`generateElementShape(): Unimplemented type ${e==null?void 0:e.type}`),null}},HL=(e,t)=>{let n=[];for(let i=1;i<e.length-1;i+=1){let r=e[i-1],s=e[i+1],l=e[i],c=li(l,r),d=li(s,l),o=Math.min(t,Oe(e[i],s)/2,Oe(e[i],r)/2);c?r[0]<l[0]?n.push([e[i][0]-o,e[i][1]]):n.push([e[i][0]+o,e[i][1]]):r[1]<l[1]?n.push([e[i][0],e[i][1]-o]):n.push([e[i][0],e[i][1]+o]),n.push(e[i]),d?s[0]<l[0]?n.push([e[i][0]-o,e[i][1]]):n.push([e[i][0]+o,e[i][1]]):s[1]<l[1]?n.push([e[i][0],e[i][1]-o]):n.push([e[i][0],e[i][1]+o])}let a=[`M ${e[0][0]} ${e[0][1]}`];for(let i=0;i<n.length;i+=3)a.push(`L ${n[i][0]} ${n[i][1]}`),a.push(`Q ${n[i+1][0]} ${n[i+1][1]}, ${n[i+2][0]} ${n[i+2][1]}`);return a.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),a.join(" ")},Qs=e=>{let t=e.map(a=>a[0]),n=e.map(a=>a[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},Qd=(e,t,n,a)=>{let i=n.map(h=>h[e]),r=Math.max(...i),s=Math.min(...i),l=r-s,c=l===0?1:t/l,d=1/0,o=n.map(h=>{let p=h[e]*c,U=[...h];return U[e]=p,p<d&&(d=p),U});if(!a||o.length===2)return o;let u=s-d;return o.map(h=>h.map((p,U)=>U===e?p+u:p))},E7=class pd{static getBounds(t,n){let a=pd.boundsCache.get(t);if(a!=null&&a.version&&a.version===t.version&&!at(t))return a.bounds;let i=pd.calculateBounds(t,n);return pd.boundsCache.set(t,{version:t.version,bounds:i}),i}static calculateBounds(t,n){let a,[i,r,s,l,c,d]=pe(t,n);if(Xn(t)){let[o,u,h,p]=lp(t.points.map(([U,m])=>H(C(U,m),C(c-t.x,d-t.y),t.angle)));return[o+t.x,u+t.y,h+t.x,p+t.y]}else if(fe(t))a=KL(t,c,d,n);else if(t.type==="diamond"){let[o,u]=H(C(c,r),C(c,d),t.angle),[h,p]=H(C(c,l),C(c,d),t.angle),[U,m]=H(C(i,d),C(c,d),t.angle),[g,b]=H(C(s,d),C(c,d),t.angle),v=Math.min(o,h,U,g),x=Math.min(u,p,m,b),y=Math.max(o,h,U,g),E=Math.max(u,p,m,b);a=[v,x,y,E]}else if(t.type==="ellipse"){let o=(s-i)/2,u=(l-r)/2,h=Math.cos(t.angle),p=Math.sin(t.angle),U=Math.hypot(o*h,u*p),m=Math.hypot(u*h,o*p);a=[c-U,d-m,c+U,d+m]}else{let[o,u]=H(C(i,r),C(c,d),t.angle),[h,p]=H(C(i,l),C(c,d),t.angle),[U,m]=H(C(s,l),C(c,d),t.angle),[g,b]=H(C(s,r),C(c,d),t.angle),v=Math.min(o,h,U,g),x=Math.min(u,p,m,b),y=Math.max(o,h,U,g),E=Math.max(u,p,m,b);a=[v,x,y,E]}return a}};L(E7,"boundsCache",new WeakMap);var XL=E7,pe=(e,t,n=!1)=>{if(Xn(e))return VL(e);if(fe(e))return J.getElementAbsoluteCoords(e,t,n);if(q(e)){let a=t?zt(e,t):null;if(xe(a)){let{x:i,y:r}=J.getBoundTextElementPosition(a,e,t);return[i,r,i+e.width,r+e.height,i+e.width/2,r+e.height/2]}}return[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2]},B2=(e,t)=>{let[n,a,i,r,s,l]=pe(e,t),c=C(s,l);if(fe(e)||Xn(e)){let b=[],v=0;for(;v<e.points.length-1;)b.push(se(H(C(e.points[v][0]+e.x,e.points[v][1]+e.y),c,e.angle),H(C(e.points[v+1][0]+e.x,e.points[v+1][1]+e.y),c,e.angle))),v++;return b}let[d,o,u,h,p,U,m,g]=[[n,a],[i,a],[n,r],[i,r],[s,a],[s,r],[n,l],[i,l]].map(b=>H(b,c,e.angle));return e.type==="diamond"?[se(p,m),se(p,g),se(U,m),se(U,g)]:e.type==="ellipse"?[se(p,m),se(p,g),se(U,m),se(U,g),se(p,m),se(p,g),se(U,m),se(U,g)]:[se(d,o),se(u,h),se(d,u),se(o,h),se(d,g),se(u,g),se(o,m),se(h,m)]},S7=e=>{let t=Math.floor(e.width/2)+1,n=0,a=e.width,i=Math.floor(e.height/2)+1,r=t,s=e.height;return[t,n,a,i,r,s,0,i]},H2=(e,t,n,a,i)=>{let r=1-e;return Math.pow(r,3)*t+3*Math.pow(r,2)*e*n+3*r*Math.pow(e,2)*a+Math.pow(e,3)*i},X2=(e,t,n,a)=>{let i=t-e,r=n-t,s=a-n,l=3*i-6*r+3*s,c=6*r-6*i,d=3*i,o=c*c-4*l*d;if(!(o>=0))return!1;let u=null,h=null,p=1/0,U=1/0;return l===0?p=U=-d/c:(p=(-c+Math.sqrt(o))/(2*l),U=(-c-Math.sqrt(o))/(2*l)),p>=0&&p<=1&&(u=H2(p,e,t,n,a)),U>=0&&U<=1&&(h=H2(U,e,t,n,a)),[u,h]},WL=(e,t,n,a)=>{let i=X2(e[0],t[0],n[0],a[0]),r=X2(e[1],t[1],n[1],a[1]),s=Math.min(e[0],a[0]),l=Math.max(e[0],a[0]);if(i){let o=i.filter(u=>u!==null);s=Math.min(s,...o),l=Math.max(l,...o)}let c=Math.min(e[1],a[1]),d=Math.max(e[1],a[1]);if(r){let o=r.filter(u=>u!==null);c=Math.min(c,...o),d=Math.max(d,...o)}return[s,c,l,d]},Vu=(e,t)=>{let n=C(0,0),{minX:a,minY:i,maxX:r,maxY:s}=e.reduce((l,{op:c,data:d})=>{if(c==="move"){let o=H0(d);nn(o!=null,"Op data is not a point"),n=o}else if(c==="bcurveTo"){let o=C(d[0],d[1]),u=C(d[2],d[3]),h=C(d[4],d[5]),p=t?t(o):o,U=t?t(u):u,m=t?t(h):h,g=t?t(n):n;n=h;let[b,v,x,y]=WL(g,p,U,m);l.minX=Math.min(l.minX,b),l.minY=Math.min(l.minY,v),l.maxX=Math.max(l.maxX,x),l.maxY=Math.max(l.maxY,y)}return l},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[a,i,r,s]},lp=e=>{let t=1/0,n=1/0,a=-1/0,i=-1/0;for(let[r,s]of e)t=Math.min(t,r),n=Math.min(n,s),a=Math.max(a,r),i=Math.max(i,s);return[t,n,a,i]},VL=e=>{let[t,n,a,i]=lp(e.points),r=t+e.x,s=n+e.y,l=a+e.x,c=i+e.y;return[r,s,l,c,(r+l)/2,(s+c)/2]},GL=e=>{switch(e){case"arrow":return 25;case"diamond":case"diamond_outline":return 12;case"crowfoot_many":case"crowfoot_one":case"crowfoot_one_or_many":return 20;default:return 15}},YL=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},W2=(e,t,n,a)=>{if(t.length<1)return null;let i=cr(t[0]);if(i.length<1)return null;let r=n==="start"?1:i.length-1,s=i[r].data;nn(s.length===6,"Op data length is not 6");let l=C(s[4],s[5]),c=C(s[2],s[3]),d=C(s[0],s[1]),o=i[r-1],u=C(0,0);if(o.op==="move"){let N=H0(o.data);nn(N!=null,"Op data is not a point"),u=N}else o.op==="bcurveTo"&&(u=C(o.data[4],o.data[5]));let h=(N,O)=>Math.pow(1-N,3)*l[O]+3*N*Math.pow(1-N,2)*c[O]+3*Math.pow(N,2)*(1-N)*d[O]+u[O]*Math.pow(N,3),[p,U]=n==="start"?u:l,[m,g]=[h(.3,0),h(.3,1)],b=Math.hypot(p-m,U-g),v=(p-m)/b,x=(U-g)/b,y=GL(a),E=0;{let[N,O]=n==="end"?e.points[e.points.length-1]:e.points[0],[$,P]=e.points.length>1?n==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];E=Math.hypot(N-$,O-P)}let S=Math.min(y,E*(a==="diamond"||a==="diamond_outline"?.25:.5)),w=p-v*S,k=U-x*S;if(a==="dot"||a==="circle"||a==="circle_outline"){let N=Math.hypot(k-U,w-p)+e.strokeWidth-2;return[p,U,N]}let T=YL(a);if(a==="crowfoot_many"||a==="crowfoot_one_or_many"){let[N,O]=H(C(p,U),C(w,k),Rr(-T)),[$,P]=H(C(p,U),C(w,k),Rr(T));return[w,k,N,O,$,P]}let[_,j]=H(C(w,k),C(p,U),-T*Math.PI/180),[A,R]=H(C(w,k),C(p,U),Rr(T));if(a==="diamond"||a==="diamond_outline"){let N,O;if(n==="start"){let[$,P]=e.points.length>1?e.points[1]:[0,0];[N,O]=H(C(p+S*2,U),C(p,U),Math.atan2(P-U,$-p))}else{let[$,P]=e.points.length>1?e.points[e.points.length-2]:[0,0];[N,O]=H(C(p-S*2,U),C(p,U),Math.atan2(U-P,p-$))}return[p,U,_,j,N,O,A,R]}return[p,U,_,j,A,R]},ZL=e=>{let t=lr.generator(),n=Cn(e),a=e.roundness?"curve":n.fill?"polygon":"linearPath";return t[a](e.points,n)},KL=(e,t,n,a)=>{var d;let i=ge(e,a);if(e.points.length<2){let[o,u]=e.points[0],[h,p]=H(C(e.x+o,e.y+u),C(t,n),e.angle),U=[h,p,h,p];if(i){let m=J.getMinMaxXYWithBoundText(e,a,[h,p,h,p],i);U=[m[0],m[1],m[2],m[3]]}return U}let r=((d=dt.get(e))==null?void 0:d[0])??ZL(e),s=cr(r),l=Vu(s,([o,u])=>H(C(e.x+o,e.y+u),C(t,n),e.angle)),c=[l[0],l[1],l[2],l[3]];if(i){let o=J.getMinMaxXYWithBoundText(e,a,c,i);c=[o[0],o[1],o[2],o[3]]}return c},pa=(e,t)=>XL.getBounds(e,t),$e=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,a=-1/0,i=1/0,r=-1/0,s=t||ce(e);return e.forEach(l=>{let[c,d,o,u]=pa(l,s);n=Math.min(n,c),i=Math.min(i,d),a=Math.max(a,o),r=Math.max(r,u)}),[n,i,a,r]},op=(e,t)=>{let[n,a,i,r]=$e(e);return[n+t.x,a+t.y,i+t.x,r+t.y]},Zi=(e,t,n,a)=>{if(!(fe(e)||Xn(e)))return[e.x,e.y,e.x+t,e.y+n];let i=Qd(0,t,Qd(1,n,e.points,a),a),r;if(Xn(e))r=lp(i);else{let o=lr.generator(),u=e.roundness?o.curve(i,Cn(e)):o.linearPath(i,Cn(e)),h=cr(u);r=Vu(h)}let[s,l,c,d]=r;return[s+e.x,l+e.y,c+e.x,d+e.y]},V2=(e,t)=>{let n=lr.generator(),a=e.roundness==null?n.linearPath(t,Cn(e)):n.curve(t,Cn(e)),i=cr(a),[r,s,l,c]=Vu(i);return[r+e.x,s+e.y,l+e.x,c+e.y]},qL=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,a=e[0],i=ce(e);return e.forEach(r=>{let[s,l,c,d]=pa(r,i),o=Oe(C((s+c)/2,(l+d)/2),C(t.x,t.y));o<n&&(n=o,a=r)}),pa(a,i)},da=e=>{let[t,n,a,i]=$e(e);return{minX:t,minY:n,maxX:a,maxY:i,width:a-t,height:i-n,midX:(t+a)/2,midY:(n+i)/2}},C7=({scrollX:e,scrollY:t,width:n,height:a,zoom:i})=>[-e,-t,-e+n/i.value,-t+a/i.value],cp=e=>C(e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2),JL=(e,t)=>{if(e==null||t==null)return!1;let[n,a,i,r]=e,[s,l,c,d]=t;return n<c&&i>s&&a<d&&r>l},Gu=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return QL(e,t);case"diamond":return eD(e,t);case"ellipse":return tD(e,t)}},QL=(e,t)=>{let n=C(e.x+e.width/2,e.y+e.height/2),a=H(t,n,-e.angle),[i,r]=i7(e);return Math.min(...i.map(s=>X0(a,s)),...r.map(s=>h8(s,a)).filter(s=>s!==null))},eD=(e,t)=>{let n=C(e.x+e.width/2,e.y+e.height/2),a=H(t,n,-e.angle),[i,r]=r7(e);return Math.min(...i.map(s=>X0(a,s)),...r.map(s=>h8(s,a)).filter(s=>s!==null))},tD=(e,t)=>{let n=C(e.x+e.width/2,e.y+e.height/2);return pL(H(t,n,-e.angle),a7(n,e.width/2,e.height/2))},nD=e=>!e[D.CTRL_OR_CMD],_r=e=>e.isBindingEnabled,Je=5,dp=10,up=4,aD=(e,t)=>{let n=[];return t.forEach(a=>{let i=e.getNonDeletedElement(a);i!=null&&n.push(i)}),n},Yu=(e,t,n,a,i)=>{let r=new Set,s=new Set;G2(e,t,n,"start",r,s,a),G2(e,n,t,"end",r,s,a);let l=Array.from(s).filter(c=>!r.has(c));aD(i,l).forEach(c=>{var d;G(c,{boundElements:(d=c.boundElements)==null?void 0:d.filter(o=>o.type!=="arrow"||o.id!==e.id)})})},G2=(e,t,n,a,i,r,s)=>{if(t!=="keep"){if(t===null){let l=oD(e,a);l!=null&&r.add(l);return}T7(e)?(n==null||(n==="keep"?!M7(e,t,a):a==="start"||n.id!==t.id))&&(Ba(e,t,a,s),i.add(t.id)):(Ba(e,t,a,s),i.add(t.id))}},iD=(e,t,n,a)=>{var s,l;let i=_7(e,t,n),r=t==="start"?(s=e.startBinding)==null?void 0:s.elementId:(l=e.endBinding)==null?void 0:l.elementId;if(r){let c=n.get(r);if(ha(c)&&Ud(c,i,n,a))return c}return null},k7=(e,t,n)=>["start","end"].map(a=>iD(e,a,t,n)),rD=(e,t,n,a,i,r)=>{let s=e.points.length-1,l=n.findIndex(u=>u===0)>-1,c=n.findIndex(u=>u===s)>-1,d=l?t?_s(e,"start",a,i,r):null:ee(e)?"keep":_s(e,"start",a,i,r),o=c?t?_s(e,"end",a,i,r):null:ee(e)?"keep":_s(e,"end",a,i,r);return[d,o]},sD=(e,t,n,a,i)=>{if(ee(e))return["keep","keep"];let[r,s]=k7(e,t,i),l=r&&a?_s(e,"start",t,n,i):null,c=s&&a?_s(e,"end",t,n,i):null;return[l,c]},eu=(e,t,n,a,i,r,s)=>{e.forEach(l=>{let[c,d]=r!=null&&r.length?rD(l,i,r??[],t,n,s):sD(l,t,n,i,s);Yu(l,c,d,t,a)})},fh=(e,t,n)=>e.length>50?[]:e.filter(fe).flatMap(a=>k7(a,t,n)).filter(a=>a!==null).filter(a=>e.filter(i=>i.id===(a==null?void 0:a.id)).length===0),D1=(e,t,n,a,i)=>{t.startBoundElement!=null&&Ba(e,t.startBoundElement,"start",a);let r=ra(n,i,a,t.zoom,ee(e),ee(e));r!==null&&(M7(e,r,"end")||Ba(e,r,"end",a))},lD=(e,t)=>{let n=e.gap,a=ic(t,t.width,t.height);return n>a&&(n=dp+up),{...e,gap:n}},Ba=(e,t,n,a)=>{if(!xe(e))return;let i={elementId:t.id,...ee(e)?{...tu(e,t,n),focus:0,gap:0}:{...lD(uD(e,t,n,a),t)}};G(e,{[n==="start"?"startBinding":"endBinding"]:i}),ce(t.boundElements||[]).has(e.id)||G(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},M7=(e,t,n)=>{let a=e[n==="start"?"endBinding":"startBinding"];return I7(e,a==null?void 0:a.elementId,t)},I7=(e,t,n)=>t===n.id&&T7(e),T7=e=>e.points.length<3,oD=(e,t)=>{let n=t==="start"?"startBinding":"endBinding",a=e[n];return a==null?null:(G(e,{[n]:null}),a.elementId)},ra=(e,t,n,a,i,r)=>{if(r){let s=!1,l=dD(t,d=>ha(d,!1)&&Ud(d,e,n,a,(i||!ah(d))&&!de(d))).filter(d=>s?!1:(ah(d)||(s=!0),!0));if(!l||l.length===0)return null;if(l.length===1)return l[0];let c=l.filter(d=>Ud(d,e,n,a,!1));return c.length===1?c[0]:l.sort((d,o)=>o.width**2+o.height**2-(d.width**2+d.height**2)).pop()}return cD(t,s=>ha(s,!1)&&Ud(s,e,n,a,(i||!ah(s))&&!de(s)))},cD=(e,t)=>{let n=null;for(let a=e.length-1;a>=0;--a){let i=e[a];if(!i.isDeleted&&t(i)){n=i;break}}return n},dD=(e,t)=>{let n=[];for(let a=e.length-1;a>=0;--a){let i=e[a];i.isDeleted||t(i)&&n.push(i)}return n},uD=(e,t,n,a)=>{let i=n==="start"?-1:1,r=i===-1?0:e.points.length-1,s=r-i,l=J.getPointAtIndexGlobalCoordinates(e,r,a),c=J.getPointAtIndexGlobalCoordinates(e,s,a);return{focus:xD(t,c,l),gap:Math.max(1,Gu(t,l))}},xn=(e,t,n)=>{let{newSize:a,simultaneouslyUpdated:i}=n??{},r=hD(i);ha(e)&&Zu(t,e,s=>{var U,m;if(!fe(s)||s.isDeleted||!fD(s,e))return;let l=s.startBinding?t.get(s.startBinding.elementId):null,c=s.endBinding?t.get(s.endBinding.elementId):null,d=null,o=null;l&&c&&(d=pa(l,t),o=pa(c,t));let u={startBinding:Y2(e,s.startBinding,a),endBinding:Y2(e,s.endBinding,a)};if(r.has(s.id)){G(s,u,!0);return}let h=Ku(t,s,(g,b)=>{var v,x;if(g&&ha(g)&&(b==="startBinding"||b==="endBinding")&&(e.id===((v=s[b])==null?void 0:v.elementId)||e.id===((x=s[b==="startBinding"?"endBinding":"startBinding"])==null?void 0:x.elementId)&&!JL(d,o))){let y=vD(s,b,u[b],g,t);if(y)return{index:b==="startBinding"?0:s.points.length-1,point:y}}return null}).filter(g=>g!==null);J.movePoints(s,h,{...e.id===((U=s.startBinding)==null?void 0:U.elementId)?{startBinding:u.startBinding}:{},...e.id===((m=s.endBinding)==null?void 0:m.elementId)?{endBinding:u.endBinding}:{}});let p=ge(s,t);p&&!p.isDeleted&&rc(s,t,!1)})},fD=(e,t)=>{var n,a;return((n=e.startBinding)==null?void 0:n.elementId)===t.id||((a=e.endBinding)==null?void 0:a.elementId)===t.id},hD=e=>new Set((e||[]).map(t=>t.id)),pD=(e,t,n,a,i,r,s)=>{let l=qr(re(t,e));return!n||!a?l:UD(r,n,i,s)?x7(n,a,e):qr(re(e,C(n.x+n.width/2,n.y+n.height/2)))},UD=(e,t,n,a)=>{let i=Gu(t,e),r=ic(t,t.width,t.height,a);return i>r?null:i},Ro=(e,t,n)=>{let a=t&&ja(t),i=e.points[n==="start"?0:e.points.length-1],r=C(e.x+i[0],e.y+i[1]),s=pM(t)?gD(t,r):r;if(t&&a){let l=cp(a),c=l7(t,se(l,Ce(pt(en(re(s,l)),Math.max(t.width,t.height)),l)))[0],d=Oe(s,l),o=Math.max(Oe(c??s,l),1e-4),u=Oa(d/o,6);switch(!0){case u>.9:return d-o>Je||To(s,c)<1e-4?s:Ce(pt(en(re(s,c??l)),u>1?Je:-Je),c??l);default:return mD(s,t,a)}}return s},mD=(e,t,n)=>{let a=cp(n),i=qr(re(e,a));switch(!0){case Ut(i,gn):return H(C((n[0]+n[2])/2+.1,n[1]),a,t.angle);case Ut(i,ht):return H(C(n[2],(n[1]+n[3])/2+.1),a,t.angle);case Ut(i,$t):return H(C((n[0]+n[2])/2-.1,n[3]),a,t.angle);default:return H(C(n[0],(n[1]+n[3])/2-.1),a,t.angle)}},gD=(e,t)=>{let n=C(e.x+e.width/2,e.y+e.height/2),a=H(t,n,-e.angle);return a[0]<e.x&&a[1]<e.y?a[1]-e.y>-Je?H(C(e.x-Je,e.y),n,e.angle):H(C(e.x,e.y-Je),n,e.angle):a[0]<e.x&&a[1]>e.y+e.height?a[0]-e.x>-Je?H(C(e.x,e.y+e.height+Je),n,e.angle):H(C(e.x-Je,e.y+e.height),n,e.angle):a[0]>e.x+e.width&&a[1]>e.y+e.height?a[0]-e.x<e.width+Je?H(C(e.x+e.width,e.y+e.height+Je),n,e.angle):H(C(e.x+e.width+Je,e.y+e.height),n,e.angle):a[0]>e.x+e.width&&a[1]<e.y?a[0]-e.x<e.width+Je?H(C(e.x+e.width,e.y-Je),n,e.angle):H(C(e.x+e.width+Je,e.y),n,e.angle):t},bD=(e,t,n=.05)=>{let{x:a,y:i,width:r,height:s,angle:l}=e,c=C(a+r/2-.1,i+s/2-.1),d=H(t,c,-l),o=Se(n*s,5,80),u=Se(n*r,5,80);return d[0]<=a+r/2&&d[1]>c[1]-o&&d[1]<c[1]+o?H(C(a-Je,c[1]),c,l):d[1]<=i+s/2&&d[0]>c[0]-u&&d[0]<c[0]+u?H(C(c[0],i-Je),c,l):d[0]>=a+r/2&&d[1]>c[1]-o&&d[1]<c[1]+o?H(C(a+r+Je,c[1]),c,l):d[1]>=i+s/2&&d[0]>c[0]-u&&d[0]<c[0]+u?H(C(c[0],i+s+Je),c,l):t},vD=(e,t,n,a,i)=>{if(n==null||n.elementId!==a.id&&e.points.length>2)return null;let r=t==="startBinding"?-1:1,s=r===-1?0:e.points.length-1;if(ee(e)&&Yd(n)){let u=qu(n.fixedPoint)??tu(e,a,t==="startBinding"?"start":"end").fixedPoint,h=C(a.x+a.width/2,a.y+a.height/2),p=C(a.x+u[0]*a.width,a.y+u[1]*a.height),U=H(p,h,a.angle);return J.pointFromAbsoluteCoords(e,U,i)}let l=s-r,c=J.getPointAtIndexGlobalCoordinates(e,l,i),d=yD(a,n.focus,c),o;if(n.gap===0)o=d;else{let u=J.getPointAtIndexGlobalCoordinates(e,s,i),h=C(a.x+a.width/2,a.y+a.height/2),p=Oe(c,u)+Oe(c,h)+Math.max(a.width,a.height)*2,U=l7(a,se(c,Ce(pt(en(re(d,c)),p),c)),n.gap).sort((m,g)=>To(m,c)-To(g,c));U.length>1?o=U[0]:U.length===1?o=d:o=u}return J.pointFromAbsoluteCoords(e,o,i)},tu=(e,t,n,a)=>{let i=[t.x,t.y,t.x+t.width,t.y+t.height],r=Ro(e,t,n),s=C(i[0]+(i[2]-i[0])/2,i[1]+(i[3]-i[1])/2),l=H(r,s,-t.angle);return{fixedPoint:qu([(l[0]-t.x)/t.width,(l[1]-t.y)/t.height])}},Y2=(e,t,n)=>{if(t==null||n==null)return t;let{width:a,height:i}=n,{width:r,height:s}=e,l=Math.max(1,Math.min(ic(e,a,i),t.gap*(a<i?a/r:i/s)));return{...t,gap:l}},_s=(e,t,n,a,i)=>ra(_7(e,t,n),a,n,i,ee(e),ee(e)),_7=(e,t,n)=>{let a=t==="start"?0:-1;return aa(J.getPointAtIndexGlobalCoordinates(e,a,n))},j7=(e,t,n,a)=>{let i=new Set,r=new Set,s=a==="duplicatesServeAsOld",l=new Map([...n].map(([c,d])=>[d,c]));t.forEach(c=>{let{boundElements:d}=c;if(d!=null&&d.length>0&&(d.forEach(o=>{s&&!n.has(o.id)&&i.add(o.id)}),r.add(n.get(c.id))),La(c)){if(c.startBinding!=null){let{elementId:o}=c.startBinding;s&&!n.has(o)&&r.add(o)}if(c.endBinding!=null){let{elementId:o}=c.endBinding;s&&!n.has(o)&&r.add(o)}(c.startBinding!=null||c.endBinding!=null)&&i.add(n.get(c.id))}}),e.filter(({id:c})=>i.has(c)).forEach(c=>{let{startBinding:d,endBinding:o}=c;G(c,{startBinding:Z2(d,n),endBinding:Z2(o,n)})}),e.filter(({id:c})=>r.has(c)).forEach(c=>{var u;let d=l.get(c.id),o=(u=e.find(({id:h})=>h===d))==null?void 0:u.boundElements;o&&o.length>0&&G(c,{boundElements:o.map(h=>n.has(h.id)?{id:n.get(h.id),type:h.type}:h)})})},Z2=(e,t)=>e==null?null:{...e,elementId:t.get(e.elementId)??e.elementId},A7=(e,t)=>{let n=ce(e);for(let a of t)js.unbindAffected(n,a,G),As.unbindAffected(n,a,G)},Lo=(e,t,n=[])=>{if(!e)return null;let a=e.filter(i=>!t.has(i.id));return a.push(...n.map(i=>({id:i.id,type:i.type}))),a},Ud=(e,{x:t,y:n},a,i,r)=>{let s=ic(e,e.width,e.height,i),l=si(e,a);return T1(C(t,n),l,s)||r===!0&&qs(C(t,n),ja(e))},ic=(e,t,n,a)=>{let i=a!=null&&a.value&&a.value<1?a.value:1,r=(e.type==="diamond"?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32),dp/i+up)},xD=(e,t,n)=>{let a=C(e.x+e.width/2,e.y+e.height/2);if(fa(t,n))return 0;let i=H(t,a,-e.angle),r=H(n,a,-e.angle),s=Math.sign(At(re(r,t),re(r,a)))*-1,l=se(r,Ce(pt(en(re(r,i)),Math.max(e.width*2,e.height*2)),r)),c=e.type==="diamond"?[se(C(e.x+e.width/2,e.y),C(e.x+e.width/2,e.y+e.height)),se(C(e.x,e.y+e.height/2),C(e.x+e.width,e.y+e.height/2))]:[se(C(e.x,e.y),C(e.x+e.width,e.y+e.height)),se(C(e.x+e.width,e.y),C(e.x,e.y+e.height))],d=e.type==="diamond"?[se(C(e.x+e.width/2,e.y-e.height),C(e.x+e.width/2,e.y+e.height*2)),se(C(e.x-e.width,e.y+e.height/2),C(e.x+e.width*2,e.y+e.height/2))]:[se(C(e.x-e.width,e.y-e.height),C(e.x+e.width*2,e.y+e.height*2)),se(C(e.x+e.width*2,e.y-e.height),C(e.x-e.width,e.y+e.height*2))];return[_o(l,d[0]),_o(l,d[1])].filter(o=>o!==null).sort((o,u)=>To(o,n)-To(u,n)).map((o,u)=>s*Oe(a,o)/(e.type==="diamond"?Oe(c[u][0],c[u][1])/2:Math.sqrt(e.width**2+e.height**2)/2)).sort((o,u)=>Math.abs(o)-Math.abs(u))[0]??0},yD=(e,t,n)=>{let a=C(e.x+e.width/2,e.y+e.height/2);if(t===0)return a;let i=(e.type==="diamond"?[C(e.x,e.y+e.height/2),C(e.x+e.width/2,e.y),C(e.x+e.width,e.y+e.height/2),C(e.x+e.width/2,e.y+e.height)]:[C(e.x,e.y),C(e.x+e.width,e.y),C(e.x+e.width,e.y+e.height),C(e.x,e.y+e.height)]).map(s=>Ce(pt(re(s,a),Math.abs(t)),a)).map(s=>H(s,a,e.angle)),r=[At(re(n,i[0]),re(i[1],i[0]))>0&&(t>0?At(re(n,i[1]),re(i[2],i[1]))<0:At(re(n,i[3]),re(i[0],i[3]))<0),At(re(n,i[1]),re(i[2],i[1]))>0&&(t>0?At(re(n,i[2]),re(i[3],i[2]))<0:At(re(n,i[0]),re(i[1],i[0]))<0),At(re(n,i[2]),re(i[3],i[2]))>0&&(t>0?At(re(n,i[3]),re(i[0],i[3]))<0:At(re(n,i[1]),re(i[2],i[1]))<0),At(re(n,i[3]),re(i[0],i[3]))>0&&(t>0?At(re(n,i[0]),re(i[1],i[0]))<0:At(re(n,i[2]),re(i[3],i[2]))<0)];return r[0]?t>0?i[1]:i[0]:r[1]?t>0?i[2]:i[1]:r[2]?t>0?i[3]:i[2]:t>0?i[0]:i[3]},wD=new Set(["boundElements","frameId","containerId","startBinding","endBinding"]),Zu=(e,t,n)=>{var a;ha(t)&&(((a=t.boundElements)==null?void 0:a.slice())??[]).forEach(({id:i})=>{n(e.get(i),"boundElements",i)})},Ku=(e,t,n)=>{let a=[];if(t.frameId){let i=t.frameId;a.push(n(e.get(i),"frameId",i))}if(at(t)){let i=t.containerId;a.push(n(e.get(i),"containerId",i))}if(xe(t)){if(t.startBinding){let i=t.startBinding.elementId;a.push(n(e.get(i),"startBinding",i))}if(t.endBinding){let i=t.endBinding.elementId;a.push(n(e.get(i),"endBinding",i))}}return a},js=class{static unbindAffected(e,t,n){t&&Ku(e,t,a=>{!a||a.isDeleted||Zu(e,a,(i,r,s)=>{s===t.id&&n(a,{boundElements:Lo(a.boundElements,new Set([s]))})})})}};L(js,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||Ku(e,t,(a,i)=>{var r,s;if(!a||a.isDeleted){n(t,{[i]:null});return}i!=="frameId"&&((r=a.boundElements)!=null&&r.find(l=>l.id===t.id)||(xe(t)&&n(a,{boundElements:Lo(a.boundElements,new Set,new Array(t))}),q(t)&&((s=a.boundElements)!=null&&s.find(l=>l.type==="text")?n(t,{[i]:null}):n(a,{boundElements:Lo(a.boundElements,new Set,new Array(t))}))))})});var As=class{static unbindAffected(e,t,n){t&&Zu(e,t,a=>{!a||a.isDeleted||Ku(e,a,(i,r,s)=>{s===t.id&&n(a,{[r]:null})})})}};L(As,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||Zu(e,t,(a,i,r)=>{var s,l;if(!a||a.isDeleted){n(t,{boundElements:Lo(t.boundElements,new Set([r]))});return}q(a)&&(((l=(((s=t.boundElements)==null?void 0:s.slice())??[]).reverse().find(c=>c.type==="text"))==null?void 0:l.id)===a.id?a.containerId!==t.id&&n(a,{containerId:t.id}):(a.containerId!==null&&n(a,{containerId:null}),n(t,{boundElements:Lo(t.boundElements,new Set([a.id]))})))})});var P1=(e,t)=>{let[n,a]=qu(e);return H(C(t.x+t.width*n,t.y+t.height*a),C(t.x+t.width/2,t.y+t.height/2),t.angle)},ED=(e,t)=>{let n=e.startBinding&&t.get(e.startBinding.elementId),a=e.endBinding&&t.get(e.endBinding.elementId),i=n&&e.startBinding?P1(e.startBinding.fixedPoint,n):C(e.x+e.points[0][0],e.y+e.points[0][1]),r=a&&e.endBinding?P1(e.endBinding.fixedPoint,a):C(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]);return[i,r]},SD=(e,t)=>{let[n,a]=ED(e,t);return[J.pointFromAbsoluteCoords(e,n,t),J.pointFromAbsoluteCoords(e,a,t)]},qu=e=>e&&(Math.abs(e[0]-.5)<1e-4||Math.abs(e[1]-.5)<1e-4)?e.map(t=>Math.abs(t-.5)<1e-4?.5001:t):e,CD=(e,t)=>{let[n,a,i,r]=t,{x:s,y:l}=Nn({sceneX:n,sceneY:a},e),{x:c,y:d}=Nn({sceneX:i,sceneY:r},e);return c-s>e.width||d-l>e.height},R7=({scenePoint:e,viewportDimensions:t,zoom:n,offsets:a})=>{let i=(t.width-((a==null?void 0:a.right)??0))/2/n.value-e.x;i+=((a==null?void 0:a.left)??0)/2/n.value;let r=(t.height-((a==null?void 0:a.bottom)??0))/2/n.value-e.y;return r+=((a==null?void 0:a.top)??0)/2/n.value,{scrollX:i,scrollY:r}},Do=(e,t)=>{if(e=WN(e),!e.length)return{scrollX:0,scrollY:0};let[n,a,i,r]=$e(e);CD(t,[n,a,i,r])&&([n,a,i,r]=qL(e,Ze({clientX:t.scrollX,clientY:t.scrollY},t)));let s=(n+i)/2,l=(a+r)/2;return R7({scenePoint:{x:s,y:l},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},di=e=>Se(Oa(e,6),$0,F0),kD=e=>Se(Math.round(e),1,100),L7=e=>Se(Math.round(e),1,100),D7=(e,t,n)=>{let a=n.reduce((i,r)=>(r.groupIds.includes(e)&&(i[r.id]=!0),i),{});return Object.keys(a).length<2?t.selectedGroupIds[e]||t.editingGroupId===e?{selectedElementIds:t.selectedElementIds,selectedGroupIds:{...t.selectedGroupIds,[e]:!1},editingGroupId:null}:t:{editingGroupId:t.editingGroupId,selectedGroupIds:{...t.selectedGroupIds,[e]:!0},selectedElementIds:{...t.selectedElementIds,...a}}},ln=(function(){let e=null,t=null,n=null,a=(r,s,l,c)=>{if(n!==void 0&&s===t&&r===e&&l.editingGroupId===(n==null?void 0:n.editingGroupId))return n;let d={};for(let h of r){let p=h.groupIds;if(l.editingGroupId){let U=p.indexOf(l.editingGroupId);U>-1&&(p=p.slice(0,U))}if(p.length>0){let U=p[p.length-1];d[U]=!0}}let o={},u=s.reduce((h,p)=>{if(p.isDeleted)return h;let U=p.groupIds.find(m=>d[m]);return U&&(h[p.id]=!0,Array.isArray(o[U])?o[U].push(p.id):o[U]=[p.id]),h},{});for(let h of Object.keys(o))o[h].length<2&&d[h]&&(d[h]=!1);return t=s,e=r,n={editingGroupId:l.editingGroupId,selectedGroupIds:d,selectedElementIds:Pe({...l.selectedElementIds,...u},c)},n},i=(r,s,l,c)=>{let d=c?c.scene.getSelectedElements({selectedElementIds:r.selectedElementIds,elements:s}):ve(s,r);return d.length?a(d,s,r,l):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:Pe(r.selectedElementIds,l)}};return i.clearCache=()=>{t=null,e=null,n=null},i})(),P7=(e,t)=>N7(e,t)!=null,N7=(e,t)=>t.groupIds.filter(n=>n!==e.editingGroupId).find(n=>e.selectedGroupIds[n]),Pr=e=>Object.entries(e.selectedGroupIds).filter(([t,n])=>n).map(([t,n])=>t),O7=(e,t)=>{let n={...t,selectedGroupIds:{}};for(let a of e){let i=a.groupIds;if(t.editingGroupId){let r=i.indexOf(t.editingGroupId);r>-1&&(i=i.slice(0,r))}if(i.length>0){let r=i[i.length-1];n={...n,...D7(r,n,e)}}}return n.selectedGroupIds},MD=(e,t)=>({...e,editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[t.id]:!0}}),Po=(e,t)=>e.groupIds.includes(t),nt=(e,t)=>{let n=[];for(let a of e.values())Po(a,t)&&n.push(a);return n},ID=(e,t)=>e.groupIds.find(n=>t[n]),TD=(e,t,n)=>{let a=[...e],i=t?e.indexOf(t):-1,r=i>-1?i:e.length;for(let s=0;s<r;s++)a[s]=n(a[s]);return a},_D=(e,t,n)=>{let a=[...e],i=n?a.indexOf(n):-1,r=i>-1?i:a.length;return a.splice(r,0,t),a},jD=(e,t)=>e.filter(n=>!t[n]),Ju=(e,t)=>{let n=new Map;return e.forEach(a=>{let i=a.groupIds.length===0?a.id:a.groupIds[a.groupIds.length-1],r=n.get(i)||[],s=ge(a,t);s&&r.push(s),n.set(i,[...r,a])}),Array.from(n.values())},AD=e=>{let t=new Set;for(let[,n]of e)if(!n.isDeleted)for(let a of n.groupIds??[])t.add(a);return t},$7=e=>{let t=e.flatMap(i=>i.groupIds),n=new Map,a=0;for(let i of t)n.set(i,(n.get(i)??0)+1),n.get(i)>a&&(a=n.get(i));return a===e.length},el=e=>e.groupIds.length>0,RD=8,K2=99999,Qu=e=>RD/e,hn=class{};L(hn,"referenceSnapPoints",null),L(hn,"visibleGaps",null),L(hn,"setReferenceSnapPoints",e=>{hn.referenceSnapPoints=e}),L(hn,"getReferenceSnapPoints",()=>hn.referenceSnapPoints),L(hn,"setVisibleGaps",e=>{hn.visibleGaps=e}),L(hn,"getVisibleGaps",()=>hn.visibleGaps),L(hn,"destroy",()=>{hn.referenceSnapPoints=null,hn.visibleGaps=null});var ai=hn,No=e=>e.props.gridModeEnabled??e.state.gridModeEnabled,er=({event:e,app:t,selectedElements:n})=>e?t.state.objectsSnapModeEnabled&&!e[D.CTRL_OR_CMD]||!t.state.objectsSnapModeEnabled&&e[D.CTRL_OR_CMD]&&!No(t):n.length===1&&n[0].type==="arrow"?!1:t.state.objectsSnapModeEnabled,LD=(e,t,n=.01)=>Math.abs(e-t)<=n,Oo=(e,t,{omitCenter:n,boundingBoxCorners:a,dragOffset:i}={omitCenter:!1,boundingBoxCorners:!1})=>{let r=[];if(e.length===1){let s=e[0],[l,c,d,o,u,h]=pe(s,t);i&&(l+=i.x,d+=i.x,u+=i.x,c+=i.y,o+=i.y,h+=i.y);let p=(d-l)/2,U=(o-c)/2;if((s.type==="diamond"||s.type==="ellipse")&&!a){let m=H(C(l,c+U),C(u,h),s.angle),g=H(C(l+p,c),C(u,h),s.angle),b=H(C(d,c+U),C(u,h),s.angle),v=H(C(l+p,o),C(u,h),s.angle),x=C(u,h);r=n?[m,g,b,v]:[m,g,b,v,x]}else{let m=H(C(l,c),C(u,h),s.angle),g=H(C(d,c),C(u,h),s.angle),b=H(C(l,o),C(u,h),s.angle),v=H(C(d,o),C(u,h),s.angle),x=C(u,h);r=n?[m,g,b,v]:[m,g,b,v,x]}}else if(e.length>1){let[s,l,c,d]=op(e,i??{x:0,y:0}),o=c-s,u=d-l,h=C(s,l),p=C(c,l),U=C(s,d),m=C(c,d),g=C(s+o/2,l+u/2);r=n?[h,p,U,m]:[h,p,U,m,g]}return r.map(s=>C(ct(s[0]),ct(s[1])))},F7=(e,t,n,a)=>{let i=t.filter(r=>de(r)).map(r=>r.id);return $3(e,t,n,a).filter(r=>!(r.frameId&&i.includes(r.frameId)))},DD=(e,t,n,a)=>{let i=F7(e,t,n,a),r=Ju(i,a).filter(u=>!(u.length===1&&at(u[0]))).map(u=>$e(u).map(h=>ct(h))),s=r.sort((u,h)=>u[0]-h[0]),l=[],c=0;e:for(let u=0;u<s.length;u++){let h=s[u];for(let p=u+1;p<s.length;p++){if(++c>K2)break e;let U=s[p],[,m,g,b]=h,[v,x,,y]=U;g<v&&Vd(Kt(m,b),Kt(x,y))&&l.push({startBounds:h,endBounds:U,startSide:[C(g,m),C(g,b)],endSide:[C(v,x),C(v,y)],length:v-g,overlap:Gd(Kt(m,b),Kt(x,y))})}}let d=r.sort((u,h)=>u[1]-h[1]),o=[];c=0;e:for(let u=0;u<d.length;u++){let h=d[u];for(let p=u+1;p<d.length;p++){if(++c>K2)break e;let U=d[p],[m,,g,b]=h,[v,x,y]=U;b<x&&Vd(Kt(m,g),Kt(v,y))&&o.push({startBounds:h,endBounds:U,startSide:[C(m,b),C(g,b)],endSide:[C(v,x),C(y,x)],length:x-b,overlap:Gd(Kt(m,g),Kt(v,y))})}}return{horizontalGaps:l,verticalGaps:o}},q2=(e,t,n,a,i,r,s)=>{if(!er({app:n,event:a,selectedElements:e}))return[];if(e.length===0)return[];let l=ai.getVisibleGaps();if(l){let{horizontalGaps:c,verticalGaps:d}=l,[o,u,h,p]=op(e,t).map(g=>ct(g)),U=(o+h)/2,m=(u+p)/2;for(let g of c){if(!Vd(Kt(u,p),g.overlap))continue;let b=g.startSide[0][0]+g.length/2,v=ct(b-U);if(g.length>h-o&&Math.abs(v)<=s.x){Math.abs(v)<s.x&&(i.length=0),s.x=Math.abs(v);let T={type:"gap",direction:"center_horizontal",gap:g,offset:v};i.push(T);continue}let[,,x]=g.endBounds,y=o-x,E=ct(g.length-y);if(Math.abs(E)<=s.x){Math.abs(E)<s.x&&(i.length=0),s.x=Math.abs(E);let T={type:"gap",direction:"side_right",gap:g,offset:E};i.push(T);continue}let[S,,,]=g.startBounds,w=S-h,k=ct(w-g.length);if(Math.abs(k)<=s.x){Math.abs(k)<s.x&&(i.length=0),s.x=Math.abs(k);let T={type:"gap",direction:"side_left",gap:g,offset:k};i.push(T);continue}}for(let g of d){if(!Vd(Kt(o,h),g.overlap))continue;let b=g.startSide[0][1]+g.length/2,v=ct(b-m);if(g.length>p-u&&Math.abs(v)<=s.y){Math.abs(v)<s.y&&(r.length=0),s.y=Math.abs(v);let T={type:"gap",direction:"center_vertical",gap:g,offset:v};r.push(T);continue}let[,x,,]=g.startBounds,y=x-p,E=ct(y-g.length);if(Math.abs(E)<=s.y){Math.abs(E)<s.y&&(r.length=0),s.y=Math.abs(E);let T={type:"gap",direction:"side_top",gap:g,offset:E};r.push(T);continue}let[,,,S]=g.endBounds,w=ct(u-S),k=g.length-w;if(Math.abs(k)<=s.y){Math.abs(k)<s.y&&(r.length=0),s.y=Math.abs(k);let T={type:"gap",direction:"side_bottom",gap:g,offset:k};r.push(T);continue}}}},PD=(e,t,n,a)=>{let i=F7(e,t,n,a);return Ju(i,a).filter(r=>!(r.length===1&&at(r[0]))).flatMap(r=>Oo(r,a))},tl=(e,t,n,a,i,r,s)=>{if(!er({app:n,event:a,selectedElements:e})||e.length===0&&t.length===0)return[];let l=ai.getReferenceSnapPoints();if(l)for(let c of t)for(let d of l){let o=d[0]-c[0],u=d[1]-c[1];Math.abs(o)<=s.x&&(Math.abs(o)<s.x&&(i.length=0),i.push({type:"point",points:[c,d],offset:o}),s.x=Math.abs(o)),Math.abs(u)<=s.y&&(Math.abs(u)<s.y&&(r.length=0),r.push({type:"point",points:[c,d],offset:u}),s.y=Math.abs(u))}},ND=(e,t,n,a,i)=>{var g,b;let r=n.state,s=ve(e,r);if(!er({app:n,event:a,selectedElements:s})||s.length===0)return{snapOffset:{x:0,y:0},snapLines:[]};t.x=ct(t.x),t.y=ct(t.y);let l=[],c=[],d=Qu(r.zoom.value),o={x:d,y:d},u=Oo(s,i,{dragOffset:t});tl(s,u,n,a,l,c,o),q2(s,t,n,a,l,c,o);let h={x:((g=l[0])==null?void 0:g.offset)??0,y:((b=c[0])==null?void 0:b.offset)??0};o.x=0,o.y=0,l.length=0,c.length=0;let p={x:ct(t.x+h.x),y:ct(t.y+h.y)};tl(s,Oo(s,i,{dragOffset:p}),n,a,l,c,o),q2(s,p,n,a,l,c,o);let U=fp(l,c),m=$D(s,p,[...l,...c].filter(v=>v.type==="gap"));return{snapOffset:h,snapLines:[...U,...m]}},ct=e=>Math.round(e*10**6)/10**6,J2=e=>{let t=new Map;for(let n of e){let a=n.join(",");t.has(a)||t.set(a,n)}return Array.from(t.values())},fp=(e,t)=>{let n={},a={};if(e.length>0){for(let i of e)if(i.type==="point"){let r=ct(i.points[0][0]);n[r]||(n[r]=[]),n[r].push(...i.points.map(s=>C(ct(s[0]),ct(s[1]))))}}if(t.length>0){for(let i of t)if(i.type==="point"){let r=ct(i.points[0][1]);a[r]||(a[r]=[]),a[r].push(...i.points.map(s=>C(ct(s[0]),ct(s[1]))))}}return Object.entries(n).map(([i,r])=>({type:"points",points:J2(r.map(s=>C(Number(i),s[1])).sort((s,l)=>s[1]-l[1]))})).concat(Object.entries(a).map(([i,r])=>({type:"points",points:J2(r.map(s=>C(s[0],Number(i))).sort((s,l)=>s[0]-l[0]))})))},OD=e=>{let t=new Map;for(let n of e){let a=n.points.flat().map(i=>[ct(i)]).join(",");t.has(a)||t.set(a,n)}return Array.from(t.values())},$D=(e,t,n)=>{let[a,i,r,s]=op(e,t),l=[];for(let c of n){let[d,o,u,h]=c.gap.startBounds,[p,U,m,g]=c.gap.endBounds,b=Gd(Kt(i,s),c.gap.overlap),v=Gd(Kt(a,r),c.gap.overlap);switch(c.direction){case"center_horizontal":{if(b){let x=(b[0]+b[1])/2;l.push({type:"gap",direction:"horizontal",points:[C(c.gap.startSide[0][0],x),C(a,x)]},{type:"gap",direction:"horizontal",points:[C(r,x),C(c.gap.endSide[0][0],x)]})}break}case"center_vertical":{if(v){let x=(v[0]+v[1])/2;l.push({type:"gap",direction:"vertical",points:[C(x,c.gap.startSide[0][1]),C(x,i)]},{type:"gap",direction:"vertical",points:[C(x,s),C(x,c.gap.endSide[0][1])]})}break}case"side_right":{if(b){let x=(b[0]+b[1])/2;l.push({type:"gap",direction:"horizontal",points:[C(u,x),C(p,x)]},{type:"gap",direction:"horizontal",points:[C(m,x),C(a,x)]})}break}case"side_left":{if(b){let x=(b[0]+b[1])/2;l.push({type:"gap",direction:"horizontal",points:[C(r,x),C(d,x)]},{type:"gap",direction:"horizontal",points:[C(u,x),C(p,x)]})}break}case"side_top":{if(v){let x=(v[0]+v[1])/2;l.push({type:"gap",direction:"vertical",points:[C(x,s),C(x,o)]},{type:"gap",direction:"vertical",points:[C(x,h),C(x,U)]})}break}case"side_bottom":{if(v){let x=(v[0]+v[1])/2;l.push({type:"gap",direction:"vertical",points:[C(x,h),C(x,U)]},{type:"gap",direction:"vertical",points:[C(x,g),C(x,i)]})}break}}}return OD(l.map(c=>({...c,points:c.points.map(d=>C(ct(d[0]),ct(d[1])))})))},Q2=(e,t,n,a,i,r)=>{var S,w;if(!er({event:a,selectedElements:e,app:n})||e.length===0||e.length===1&&!LD(e[0].angle,0))return{snapOffset:{x:0,y:0},snapLines:[]};let[s,l,c,d]=$e(t);r&&(r.includes("e")?c+=i.x:r.includes("w")&&(s+=i.x),r.includes("n")?l+=i.y:r.includes("s")&&(d+=i.y));let o=[];if(r)switch(r){case"e":{o.push(C(c,l),C(c,d));break}case"w":{o.push(C(s,l),C(s,d));break}case"n":{o.push(C(s,l),C(c,l));break}case"s":{o.push(C(s,d),C(c,d));break}case"ne":{o.push(C(c,l));break}case"nw":{o.push(C(s,l));break}case"se":{o.push(C(c,d));break}case"sw":{o.push(C(s,d));break}}let u=Qu(n.state.zoom.value),h={x:u,y:u},p=[],U=[];tl(t,o,n,a,p,U,h);let m={x:((S=p[0])==null?void 0:S.offset)??0,y:((w=U[0])==null?void 0:w.offset)??0};h.x=0,h.y=0,p.length=0,U.length=0;let[g,b,v,x]=$e(e).map(k=>ct(k)),y=[C(g,b),C(g,x),C(v,b),C(v,x)];tl(e,y,n,a,p,U,h);let E=fp(p,U);return{snapOffset:m,snapLines:E}},FD=(e,t,n,a,i,r)=>{var U,m;if(!er({event:n,selectedElements:[e],app:t}))return{snapOffset:{x:0,y:0},snapLines:[]};let s=[C(a.x+i.x,a.y+i.y)],l=Qu(t.state.zoom.value),c={x:l,y:l},d=[],o=[];tl([e],s,t,n,d,o,c);let u={x:((U=d[0])==null?void 0:U.offset)??0,y:((m=o[0])==null?void 0:m.offset)??0};c.x=0,c.y=0,d.length=0,o.length=0;let h=Oo([e],r,{boundingBoxCorners:!0,omitCenter:!0});tl([e],h,t,n,d,o,c);let p=fp(d,o);return{snapOffset:u,snapLines:p}},zD=(e,t,n,a,i)=>{if(!er({event:a,selectedElements:[],app:t}))return{originOffset:{x:0,y:0},snapLines:[]};let r=$3(e,[],t.state,i),s=Qu(t.state.zoom.value),l={x:s,y:s},c=[],d=[];for(let o of r){let u=Oo([o],i);for(let h of u){let p=h[0]-n.x;Math.abs(p)<=Math.abs(l.x)&&(Math.abs(p)<Math.abs(l.x)&&(d.length=0),d.push({type:"pointer",points:[h,C(h[0],n.y)],direction:"vertical"}),l.x=p);let U=h[1]-n.y;Math.abs(U)<=Math.abs(l.y)&&(Math.abs(U)<Math.abs(l.y)&&(c.length=0),c.push({type:"pointer",points:[h,C(n.x,h[1])],direction:"horizontal"}),l.y=U)}}return{originOffset:{x:d.length>0?d[0].points[0][0]-n.x:0,y:c.length>0?c[0].points[0][1]-n.y:0},snapLines:[...d,...c]}},BD=e=>e===Rt.rectangle||e===Rt.ellipse||e===Rt.diamond||e===Rt.frame||e===Rt.magicframe||e===Rt.image||e===Rt.text,kt=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],Ti={version:null,points:[],zoom:null},bt=class ye{constructor(t){L(this,"elementId"),L(this,"selectedPointsIndices"),L(this,"pointerDownState"),L(this,"isDragging"),L(this,"lastUncommittedPoint"),L(this,"pointerOffset"),L(this,"startBindingElement"),L(this,"endBindingElement"),L(this,"hoverPointIndex"),L(this,"segmentMidPointHoveredCoords"),L(this,"elbowed"),this.elementId=t.id,fa(t.points[0],C(0,0))||console.error("Linear element is not normalized",Error().stack),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:null,segmentMidpoint:{value:null,index:null,added:!1}},this.hoverPointIndex=-1,this.segmentMidPointHoveredCoords=null,this.elbowed=ee(t)&&t.elbowed}static getElement(t,n){return n.get(t)||null}static handleBoxSelection(t,n,a,i){if(!n.editingLinearElement||!n.selectionElement)return!1;let{editingLinearElement:r}=n,{selectedPointsIndices:s,elementId:l}=r,c=ye.getElement(l,i);if(!c)return!1;let[d,o,u,h]=pe(n.selectionElement,i),p=ye.getPointsGlobalCoordinates(c,i).reduce((U,m,g)=>((m[0]>=d&&m[0]<=u&&m[1]>=o&&m[1]<=h||t.shiftKey&&(s!=null&&s.includes(g)))&&U.push(g),U),[]).filter(U=>!(ee(c)&&U!==0&&U!==c.points.length-1));a({editingLinearElement:{...r,selectedPointsIndices:p.length?p:null}})}static handlePointDragging(t,n,a,i,r,s,l){var U;if(!s)return!1;let{elementId:c}=s,d=l.getNonDeletedElementsMap(),o=ye.getElement(c,d);if(!o||ee(o)&&!s.pointerDownState.lastClickedIsEndPoint&&s.pointerDownState.lastClickedPoint!==0)return!1;let u=ee(o)?(U=s.selectedPointsIndices)==null?void 0:U.reduce((m,g)=>g===0?[0,m[1]]:[m[0],o.points.length-1],[!1,!1]).filter(m=>typeof m=="number"):s.selectedPointsIndices,h=ee(o)?s.pointerDownState.lastClickedPoint>0?o.points.length-1:0:s.pointerDownState.lastClickedPoint,p=o.points[h];if(u&&p){if(so(t)&&u.length===1&&o.points.length>1){let m=u[0],g=o.points[m===0?1:m-1],[b,v]=ye._getShiftLockedDelta(o,d,g,C(a,i),t[D.CTRL_OR_CMD]?null:n.getEffectiveGridSize());ye.movePoints(o,[{index:m,point:C(b+g[0],v+g[1]),isDragging:m===h}])}else{let m=ye.createPointAt(o,d,a-s.pointerOffset.x,i-s.pointerOffset.y,t[D.CTRL_OR_CMD]?null:n.getEffectiveGridSize()),g=m[0]-p[0],b=m[1]-p[1];ye.movePoints(o,u.map(v=>{let x=v===h?ye.createPointAt(o,d,a-s.pointerOffset.x,i-s.pointerOffset.y,t[D.CTRL_OR_CMD]?null:n.getEffectiveGridSize()):C(o.points[v][0]+g,o.points[v][1]+b);return{index:v,point:x,isDragging:v===h}}))}if(ge(o,d)&&rc(o,d,!1),La(o,!1)){let m=[];u[0]===0&&m.push(aa(ye.getPointGlobalCoordinates(o,o.points[0],d)));let g=u[u.length-1];g===o.points.length-1&&m.push(aa(ye.getPointGlobalCoordinates(o,o.points[g],d))),m.length&&r(o,m)}return!0}return!1}static handlePointerUp(t,n,a,i){var p;let r=i.getNonDeletedElementsMap(),s=i.getNonDeletedElements(),{elementId:l,selectedPointsIndices:c,isDragging:d,pointerDownState:o}=n,u=ye.getElement(l,r);if(!u)return n;let h={};if(d&&c){for(let U of c)if(U===0||U===u.points.length-1){Ui(u.points,a.zoom.value)&&ye.movePoints(u,[{index:U,point:U===0?u.points[u.points.length-1]:u.points[0]}]);let m=_r(a)?ra(aa(ye.getPointAtIndexGlobalCoordinates(u,U,r)),s,r,a.zoom,ee(u),ee(u)):null;h[U===0?"startBindingElement":"endBindingElement"]=m}}return{...n,...h,selectedPointsIndices:d||t.shiftKey?!d&&t.shiftKey&&((p=o.prevSelectedPointsIndices)!=null&&p.includes(o.lastClickedPoint))?c&&c.filter(U=>U!==o.lastClickedPoint):c:c!=null&&c.includes(o.lastClickedPoint)?[o.lastClickedPoint]:c,isDragging:!1,pointerOffset:{x:0,y:0}}}static isSegmentTooShort(t,n,a,i,r){if(ee(t))return i>=0&&i<t.points.length?Oe(n,a)*r.value<ye.POINT_HANDLE_SIZE/2:!1;let s=Oe(n,a);return t.points.length>2&&t.roundness&&(s=SL(t,a)),s*r.value<ye.POINT_HANDLE_SIZE*4}static getSegmentMidPoint(t,n,a,i,r){let s=ec(n,a);if(t.points.length>2&&t.roundness){let l=c7(t,t.points[i]);if(l){let c=CL(t,t.points[i],.5);s=ye.getPointGlobalCoordinates(t,d7(l[0],l[1],l[2],l[3],c),r)}}return s}static getSegmentMidPointIndex(t,n,a,i){let r=ye.getElement(t.elementId,i);if(!r)return-1;let s=ye.getEditorMidPoints(r,i,n),l=0;for(;l<s.length;){if(ye.arePointsEqual(a,s[l]))return l+1;l++}return-1}static handlePointerDown(t,n,a,i,r,s){var k;let l=n.state,c=s.getNonDeletedElementsMap(),d=s.getNonDeletedElements(),o={didAddPoint:!1,hitElement:null,linearElementEditor:null};if(!r)return o;let{elementId:u}=r,h=ye.getElement(u,c);if(!h)return o;let p=ye.getSegmentMidpointHitCoords(r,i,l,c),U=null;if(p)U=ye.getSegmentMidPointIndex(r,l,p,c);else if(t.altKey&&l.editingLinearElement)return r.lastUncommittedPoint==null&&(G(h,{points:[...h.points,ye.createPointAt(h,c,i.x,i.y,t[D.CTRL_OR_CMD]?null:n.getEffectiveGridSize())]}),o.didAddPoint=!0),a.shouldCaptureIncrement(),o.linearElementEditor={...r,pointerDownState:{prevSelectedPointsIndices:r.selectedPointsIndices,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:p,index:U,added:!1}},selectedPointsIndices:[h.points.length-1],lastUncommittedPoint:null,endBindingElement:ra(i,d,c,n.state.zoom,r.elbowed)},o.didAddPoint=!0,o;let m=ye.getPointIndexUnderCursor(h,c,l.zoom,i.x,i.y);if(m>=0||p)o.hitElement=h;else{let{startBindingElement:T,endBindingElement:_}=r;_r(l)&&La(h)&&Yu(h,T,_,c,s)}let[g,b,v,x]=pe(h,c),y=(g+v)/2,E=(b+x)/2,S=m>-1&&H(C(h.x+h.points[m][0],h.y+h.points[m][1]),C(y,E),h.angle),w=m>-1||t.shiftKey?t.shiftKey||(k=r.selectedPointsIndices)!=null&&k.includes(m)?HD([...r.selectedPointsIndices||[],m]):[m]:null;return o.linearElementEditor={...r,pointerDownState:{prevSelectedPointsIndices:r.selectedPointsIndices,lastClickedPoint:m,lastClickedIsEndPoint:m===h.points.length-1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:p,index:U,added:!1}},selectedPointsIndices:w,pointerOffset:S?{x:i.x-S[0],y:i.y-S[1]}:{x:0,y:0}},o}static arePointsEqual(t,n){return!t&&!n?!0:!t||!n?!1:fa(t,n)}static handlePointerMove(t,n,a,i,r){let s=i.state;if(!s.editingLinearElement)return null;let{elementId:l,lastUncommittedPoint:c}=s.editingLinearElement,d=ye.getElement(l,r);if(!d)return s.editingLinearElement;let{points:o}=d,u=o[o.length-1];if(!t.altKey)return u===c&&ye.deletePoints(d,[o.length-1]),{...s.editingLinearElement,lastUncommittedPoint:null};let h;if(so(t)&&o.length>=2){let p=o[o.length-2],[U,m]=ye._getShiftLockedDelta(d,r,p,C(n,a),t[D.CTRL_OR_CMD]?null:i.getEffectiveGridSize());h=C(U+p[0],m+p[1])}else h=ye.createPointAt(d,r,n-s.editingLinearElement.pointerOffset.x,a-s.editingLinearElement.pointerOffset.y,t[D.CTRL_OR_CMD]||ee(d)?null:i.getEffectiveGridSize());return u===c?ye.movePoints(d,[{index:d.points.length-1,point:h}]):ye.addPoints(d,[{point:h}]),{...s.editingLinearElement,lastUncommittedPoint:d.points[d.points.length-1]}}static getPointGlobalCoordinates(t,n,a){let[i,r,s,l]=pe(t,a),c=(i+s)/2,d=(r+l)/2,{x:o,y:u}=t;return H(C(o+n[0],u+n[1]),C(c,d),t.angle)}static getPointsGlobalCoordinates(t,n){let[a,i,r,s]=pe(t,n),l=(a+r)/2,c=(i+s)/2;return t.points.map(d=>{let{x:o,y:u}=t;return H(C(o+d[0],u+d[1]),C(l,c),t.angle)})}static getPointAtIndexGlobalCoordinates(t,n,a){let i=n<0?t.points.length+n:n,[r,s,l,c]=pe(t,a),d=(r+l)/2,o=(s+c)/2,u=t.points[i],{x:h,y:p}=t;return H(u?C(h+u[0],p+u[1]):C(h,p),C(d,o),t.angle)}static pointFromAbsoluteCoords(t,n,a){if(ee(t))return C(n[0]-t.x,n[1]-t.y);let[i,r,s,l]=pe(t,a),c=(i+s)/2,d=(r+l)/2,[o,u]=H(C(n[0],n[1]),C(c,d),-t.angle);return C(o-t.x,u-t.y)}static getPointIndexUnderCursor(t,n,a,i,r){let s=ye.getPointsGlobalCoordinates(t,n),l=s.length;for(;--l>-1;){let c=s[l];if(Oe(C(i,r),C(c[0],c[1]))*a.value<ye.POINT_HANDLE_SIZE+1)return l}return-1}static createPointAt(t,n,a,i,r){let s=kt(a,i,r),[l,c,d,o]=pe(t,n),u=(l+d)/2,h=(c+o)/2,[p,U]=H(C(s[0],s[1]),C(u,h),-t.angle);return C(p-t.x,U-t.y)}static getNormalizedPoints(t){let{points:n}=t,a=n[0][0],i=n[0][1];return{points:n.map(r=>C(r[0]-a,r[1]-i)),x:t.x+a,y:t.y+i}}static normalizePoints(t){G(t,ye.getNormalizedPoints(t))}static duplicateSelectedPoints(t,n){nn(t.editingLinearElement,"Not currently editing a linear element");let{selectedPointsIndices:a,elementId:i}=t.editingLinearElement,r=ye.getElement(i,n);nn(r,"The linear element does not exist in the provided Scene"),nn(a!=null,"There are no selected points to duplicate");let{points:s}=r,l=[],c=!1,d=-1,o=s.reduce((u,h,p)=>{if(++d,u.push(h),a.includes(p)){let U=s[p+1];U||(c=!0),u.push(U?C((h[0]+U[0])/2,(h[1]+U[1])/2):C(h[0],h[1])),l.push(d+1),++d}return u},[]);if(G(r,{points:o}),c){let u=r.points[r.points.length-1];ye.movePoints(r,[{index:r.points.length-1,point:C(u[0]+30,u[1]+30)}])}return{...t,editingLinearElement:{...t.editingLinearElement,selectedPointsIndices:l}}}static deletePoints(t,n){let a=0,i=0;if(n.includes(0)){let s=t.points.find((l,c)=>!n.includes(c));s&&(a=s[0],i=s[1])}let r=t.points.reduce((s,l,c)=>(n.includes(c)||s.push(s.length?C(l[0]-a,l[1]-i):C(0,0)),s),[]);ye._updatePoints(t,r,a,i)}static addPoints(t,n){let a=[...t.points,...n.map(i=>i.point)];ye._updatePoints(t,a,0,0)}static movePoints(t,n,a){var o,u,h;let{points:i}=t,[r,s]=((o=n.find(({index:p})=>p===0))==null?void 0:o.point)??C(0,0),[l,c]=C(r-i[0][0],s-i[0][1]),d=ee(t)?[((u=n.find(p=>p.index===0))==null?void 0:u.point)??i[0],((h=n.find(p=>p.index===i.length-1))==null?void 0:h.point)??i[i.length-1]]:i.map((p,U)=>{var g;let m=((g=n.find(b=>b.index===U))==null?void 0:g.point)??p;return C(m[0]-l,m[1]-c)});ye._updatePoints(t,d,l,c,a,{isDragging:n.reduce((p,U)=>p||U.isDragging===!0,!1)})}static shouldAddMidpoint(t,n,a,i){let r=ye.getElement(t.elementId,i);if(r&&ee(r)||!r)return!1;let{segmentMidpoint:s}=t.pointerDownState;if(s.added||s.value===null||s.index===null||t.pointerDownState.origin===null)return!1;let l=t.pointerDownState.origin,c=Oe(C(l.x,l.y),C(n.x,n.y));return!(!a.editingLinearElement&&c<yr/a.zoom.value)}static addMidpoint(t,n,a,i,r){let s=ye.getElement(t.elementId,r);if(!s)return;let{segmentMidpoint:l}=t.pointerDownState,c={pointerDownState:t.pointerDownState,selectedPointsIndices:t.selectedPointsIndices},d=ye.createPointAt(s,r,n.x,n.y,i&&!ee(s)?a.getEffectiveGridSize():null),o=[...s.points.slice(0,l.index),d,...s.points.slice(l.index)];return G(s,{points:o}),c.pointerDownState={...t.pointerDownState,segmentMidpoint:{...t.pointerDownState.segmentMidpoint,added:!0},lastClickedPoint:l.index},c.selectedPointsIndices=[l.index],c}static _updatePoints(t,n,a,i,r,s){if(ee(t)){let l={};(r==null?void 0:r.startBinding)!==void 0&&(l.startBinding=r.startBinding!==null&&Yd(r.startBinding)?r.startBinding:null),(r==null?void 0:r.endBinding)!==void 0&&(l.endBinding=r.endBinding!==null&&Yd(r.endBinding)?r.endBinding:null),l.points=Array.from(n),G(t,l,!0,{isDragging:s==null?void 0:s.isDragging})}else{let l=V2(t,n),c=V2(t,t.points),d=(l[0]+l[2])/2,o=(l[1]+l[3])/2,u=(c[0]+c[2])/2,h=(c[1]+c[3])/2,p=u-d,U=h-o,m=H(C(a,i),C(p,U),t.angle);G(t,{...r,points:n,x:t.x+m[0],y:t.y+m[1]})}}static _getShiftLockedDelta(t,n,a,i,r){let s=ye.getPointGlobalCoordinates(t,a,n);if(ee(t))return[i[0]-s[0],i[1]-s[1]];let[l,c]=kt(i[0],i[1],r),{width:d,height:o}=V1(s[0],s[1],l,c);return H(C(d,o),C(0,0),-t.angle)}static moveFixedSegment(t,n,a,i,r){let s=ye.getElement(t.elementId,r);if(!s||!ee(s))return t;if(n&&n>0&&n<s.points.length){let l=ci(qr(re(s.points[n],s.points[n-1]))),c=(s.fixedSegments??[]).reduce((h,p)=>(h[p.index]=p,h),{});c[n]={index:n,start:C(l?s.points[n-1][0]:a-s.x,l?i-s.y:s.points[n-1][1]),end:C(l?s.points[n][0]:a-s.x,l?i-s.y:s.points[n][1])};let d=Object.values(c).sort((h,p)=>h.index-p.index),o=d.map(h=>h.index).reduce((h,p)=>p<n?h+1:h,0);G(s,{fixedSegments:d});let u=C(s.x+(s.fixedSegments[o].start[0]+s.fixedSegments[o].end[0])/2,s.y+(s.fixedSegments[o].start[1]+s.fixedSegments[o].end[1])/2);return{...t,segmentMidPointHoveredCoords:u,pointerDownState:{...t.pointerDownState,segmentMidpoint:{added:!1,index:s.fixedSegments[o].index,value:u}}}}return t}static deleteFixedSegment(t,n){var a;G(t,{fixedSegments:(a=t.fixedSegments)==null?void 0:a.filter(i=>i.index!==n)}),G(t,{},!0)}};L(bt,"POINT_HANDLE_SIZE",10),L(bt,"getEditorMidPoints",(e,t,n)=>{let a=ge(e,t);return!ee(e)&&!n.editingLinearElement&&e.points.length>2&&!a?[]:(Ti.version===e.version&&Ti.zoom===n.zoom.value||bt.updateEditorMidPointsCache(e,t,n),Ti.points)}),L(bt,"updateEditorMidPointsCache",(e,t,n)=>{let a=bt.getPointsGlobalCoordinates(e,t),i=0,r=[];for(;i<a.length-1;){if(bt.isSegmentTooShort(e,e.points[i],e.points[i+1],i,n.zoom)){r.push(null),i++;continue}let s=bt.getSegmentMidPoint(e,a[i],a[i+1],i+1,t);r.push(s),i++}Ti.points=r,Ti.version=e.version,Ti.zoom=n.zoom.value}),L(bt,"getSegmentMidpointHitCoords",(e,t,n,a)=>{let{elementId:i}=e,r=bt.getElement(i,a);if(!r)return null;let s=bt.getPointIndexUnderCursor(r,a,n.zoom,t.x,t.y);if(!ee(r)&&s>=0||bt.getPointsGlobalCoordinates(r,a).length>=3&&!n.editingLinearElement&&!ee(r))return null;let l=(bt.POINT_HANDLE_SIZE+1)/n.zoom.value,c=e.segmentMidPointHoveredCoords;if(c&&Oe(C(c[0],c[1]),C(t.x,t.y))<=l)return c;let d=0,o=bt.getEditorMidPoints(r,a,n);for(;d<o.length;){if(o[d]!==null&&Oe(o[d],C(t.x,t.y))<=l)return o[d];d++}return null}),L(bt,"getBoundTextElementPosition",(e,t,n)=>{let a=bt.getPointsGlobalCoordinates(e,n);a.length<2&&G(t,{isDeleted:!0});let i=0,r=0;if(e.points.length%2===1){let s=Math.floor(e.points.length/2),l=bt.getPointGlobalCoordinates(e,e.points[s],n);i=l[0]-t.width/2,r=l[1]-t.height/2}else{let s=e.points.length/2-1,l=Ti.points[s];e.points.length===2&&(l=ec(a[0],a[1])),(!l||Ti.version!==e.version)&&(l=bt.getSegmentMidPoint(e,a[s],a[s+1],s+1,n)),i=l[0]-t.width/2,r=l[1]-t.height/2}return{x:i,y:r}}),L(bt,"getMinMaxXYWithBoundText",(e,t,n,a)=>{let[i,r,s,l]=n,c=(i+s)/2,d=(r+l)/2,{x:o,y:u}=bt.getBoundTextElementPosition(e,a,t),h=o+a.width,p=u+a.height,U=C(c,d),m=H(C(i,r),U,e.angle),g=H(C(s,r),U,e.angle),b=H(C(o,u),U,-e.angle),v=H(C(h,u),U,-e.angle),x=H(C(o,p),U,-e.angle),y=H(C(h,p),U,-e.angle);return m[0]<g[0]&&m[1]>=g[1]?(i=Math.min(i,x[0]),s=Math.max(s,Math.max(v[0],y[0])),r=Math.min(r,b[1]),l=Math.max(l,y[1])):m[0]>=g[0]&&m[1]>g[1]?(i=Math.min(i,y[0]),s=Math.max(s,Math.max(b[0],v[0])),r=Math.min(r,x[1]),l=Math.max(l,v[1])):m[0]>=g[0]?(i=Math.min(i,v[0]),s=Math.max(s,x[0]),r=Math.min(r,y[1]),l=Math.max(l,b[1])):m[1]<=g[1]&&(i=Math.min(i,Math.min(v[0],b[0])),s=Math.max(s,y[0]),r=Math.min(r,v[1]),l=Math.max(l,x[1])),[i,r,s,l,c,d]}),L(bt,"getElementAbsoluteCoords",(e,t,n=!1)=>{let a,i,r,s,l;if(e.points.length<2||!dt.get(e)){let{minX:u,minY:h,maxX:p,maxY:U}=e.points.reduce((m,[g,b])=>(m.minY=Math.min(m.minY,b),m.minX=Math.min(m.minX,g),m.maxX=Math.max(m.maxX,g),m.maxY=Math.max(m.maxY,b),m),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});i=u+e.x,r=h+e.y,s=p+e.x,l=U+e.y}else{let u=dt.generateElementShape(e,null),h=cr(u[0]),[p,U,m,g]=Vu(h);i=p+e.x,r=U+e.y,s=m+e.x,l=g+e.y}let c=(i+s)/2,d=(r+l)/2;if(a=[i,r,s,l,c,d],!n)return a;let o=ge(e,t);return o&&(a=bt.getMinMaxXYWithBoundText(e,t,[i,r,s,l],o)),a});var J=bt,HD=e=>{let t=[...new Set(e.filter(n=>n!==null&&n!==-1))];return t=t.sort((n,a)=>n-a),t.length?t:null},nl={},nu=(e,t)=>{let n=nl[e]||(nl[e]={height:t});return n.height=t,n},z7=e=>{nl[e]&&delete nl[e]},XD=e=>{var t;return((t=nl[e])==null?void 0:t.height)??null},on=(e,t,n,a=!0)=>{let i,r={x:e.x,y:e.y,text:e.text,width:e.width,height:e.height,angle:(t==null?void 0:t.angle)??e.angle};r.text=e.text,(t||!e.autoResize)&&(i=t?bi(t,e):e.width,r.text=rs(e.originalText,Ve(e),i));let s=an(r.text,Ve(e),e.lineHeight);if(e.autoResize&&(r.width=s.width),r.height=s.height,t){let l=tf(t,e),c=bi(t,e);if(!xe(t)&&s.height>l){let h=Jr(s.height,t.type);G(t,{height:h},a),nu(t.id,h)}if(s.width>c){let h=Jr(s.width,t.type);G(t,{width:h},a)}let d={...e,...r},{x:o,y:u}=ef(t,d,n);r.x=o,r.y=u}G(e,r,a)},B7=(e,t,n)=>{let a=ce(e);t.forEach(i=>{let r=n.get(i.id),s=gi(i);if(s){let l=n.get(s);if(l){let c=a.get(r);c&&G(c,{boundElements:(i.boundElements||[]).filter(o=>o.id!==l&&o.id!==s).concat({type:"text",id:l})});let d=a.get(l);d&&q(d)&&G(d,{containerId:c?r:null})}}})},rc=(e,t,n,a=!1)=>{if(!gi(e))return;z7(e.id);let i=ge(e,t);if(i&&i.text){if(!e)return;let r=i.text,s=i.height,l=i.width,c=bi(e,i),d=tf(e,i),o=e.height;if(a||n!=="n"&&n!=="s"){r&&(r=rs(i.originalText,Ve(i),c));let u=an(r,Ve(i),i.lineHeight);s=u.height,l=u.width}if(s>d){o=Jr(s,e.type);let u=o-e.height,h=!xe(e)&&(n==="ne"||n==="nw"||n==="n")?e.y-u:e.y;G(e,{height:o,y:h})}G(i,{text:r,width:l,height:s}),xe(e)||G(i,ef(e,i,t))}},ef=(e,t,n)=>{if(xe(e))return J.getBoundTextElementPosition(e,t,n);let a=WD(e),i=tf(e,t),r=bi(e,t),s,l;return t.verticalAlign===Mn.TOP?l=a.y:t.verticalAlign===Mn.BOTTOM?l=a.y+(i-t.height):l=a.y+(i/2-t.height/2),t.textAlign===Io.LEFT?s=a.x:t.textAlign===Io.RIGHT?s=a.x+(r-t.width):s=a.x+(r/2-t.width/2),{x:s,y:l}},gi=e=>{var t,n,a;return((t=e==null?void 0:e.boundElements)==null?void 0:t.length)&&((a=(n=e==null?void 0:e.boundElements)==null?void 0:n.find(i=>i.type==="text"))==null?void 0:a.id)||null},ge=(e,t)=>{if(!e)return null;let n=gi(e);return n&&t.get(n)||null},zt=(e,t)=>e&&e.containerId&&t.get(e.containerId)||null,hh=(e,t,n)=>{if(!xe(e))return{x:e.x+e.width/2,y:e.y+e.height/2};let a=J.getPointsGlobalCoordinates(e,n);if(a.length%2===1){let s=Math.floor(e.points.length/2),l=J.getPointGlobalCoordinates(e,e.points[s],n);return{x:l[0],y:l[1]}}let i=e.points.length/2-1,r=J.getEditorMidPoints(e,n,t)[i];return r||(r=J.getSegmentMidPoint(e,a[i],a[i+1],i+1,n)),{x:r[0],y:r[1]}},WD=e=>{let t=Mt,n=Mt;return e.type==="ellipse"&&(t+=e.width/2*(1-Math.sqrt(2)/2),n+=e.height/2*(1-Math.sqrt(2)/2)),e.type==="diamond"&&(t+=e.width/4,n+=e.height/4),{x:e.x+t,y:e.y+n}},VD=(e,t)=>!t||xe(t)?e.angle:t.angle,GD=(e,t)=>e.some(n=>{if(at(n)){let a=zt(n,t);return!xe(a)}return!1}),YD=(e,t)=>e.some(n=>{if(at(n)){let a=zt(n,t);return!xe(a)}return q(n)}),ZD=new Set(["rectangle","ellipse","diamond","arrow"]),KD=e=>ZD.has(e.type),Jr=(e,t)=>{e=Math.ceil(e);let n=Mt*2;return t==="ellipse"?Math.round((e+n)/Math.sqrt(2)*2):t==="arrow"?e+n*8:t==="diamond"?2*(e+n):e+n},bi=(e,t)=>{let{width:n}=e;if(xe(e)){let a=((t==null?void 0:t.fontSize)??Ci)*_k;return Math.max(Tk*n,a)}return e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Mt*2:e.type==="diamond"?Math.round(n/2)-Mt*2:n-Mt*2},tf=(e,t)=>{let{height:n}=e;return xe(e)?n-Mt*8*2<=0?t.height:n:e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-Mt*2:e.type==="diamond"?Math.round(n/2)-Mt*2:n-Mt*2},H7=(e,t=`
|
|
24
|
+
|
|
25
|
+
`)=>e.reduce((n,a)=>(q(a)&&n.push(a.text),n),[]).join(t),yn=e=>(e=e.trim(),e&&Wb.sanitizeUrl(od(e))),X7=e=>!!(e!=null&&e.includes(location.origin)||e!=null&&e.startsWith("/")),hp=e=>{if(e=yn(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e},N1=[],Z=e=>(N1=N1.concat(e),e),W7='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',qD='<path d="M6.164 11.755a5.314 5.314 0 0 1-4.932-5.298 5.314 5.314 0 0 1 5.311-5.311 5.314 5.314 0 0 1 5.307 5.113l8.773 8.773a3.322 3.322 0 0 1 0 4.696l-.895.895a3.322 3.322 0 0 1-4.696 0l-8.868-8.868Z" style="fill:#fff"/>',V7='<path stroke="#1b1b1f" fill="#fff" d="m7.868 11.113 7.773 7.774a2.359 2.359 0 0 0 1.667.691 2.368 2.368 0 0 0 2.357-2.358c0-.625-.248-1.225-.69-1.667L11.201 7.78 9.558 9.469l-1.69 1.643v.001Zm10.273 3.606-3.333 3.333m-3.25-6.583 2 2m-7-7 3 3M3.664 3.625l1 1M2.529 6.922l1.407-.144m5.735-2.932-1.118.866M4.285 9.823l.758-1.194m1.863-6.207-.13 1.408"/>',JD=`data:${ae.svg},${encodeURIComponent(`${W7}${V7}</svg>`)}`,QD=`data:${ae.svg},${encodeURIComponent(`${W7}${qD}${V7}</svg>`)}`,Jn=e=>{e&&(e.style.cursor="")},We=(e,t)=>{e&&(e.style.cursor=t)},Ea,eg,G7=(e,t)=>{let n=()=>{let a=t===ke.DARK;Ea=document.createElement("canvas"),Ea.theme=t,Ea.height=20,Ea.width=20;let i=Ea.getContext("2d");i.lineWidth=1,i.beginPath(),i.arc(Ea.width/2,Ea.height/2,5,0,2*Math.PI),i.fillStyle=a?Ft.black:Ft.white,i.fill(),i.strokeStyle=a?Ft.white:Ft.black,i.stroke(),eg=Ea.toDataURL(ae.svg)};(!Ea||Ea.theme!==t)&&n(),We(e,`url(${eg}) ${20/2} ${20/2}, auto`)},Ma=(e,t)=>{if(e)if(t.activeTool.type==="selection")Jn(e);else if(Gs(t))e.style.cursor=He.GRAB;else if(Ia(t))G7(e,t.theme);else if(t.activeTool.type==="laser"){let n=t.theme===ke.LIGHT?JD:QD;e.style.cursor=`url(${n}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=He.AUTO):e.style.cursor=He.CROSSHAIR},eP=new Db(Date.now()),tP=0,Ha=()=>Math.floor(eP.next()*2**31),Vn=()=>pi()?`id${tP++}`:Lu(),Ua=(e,{x:t,y:n,strokeColor:a=ft.strokeColor,backgroundColor:i=ft.backgroundColor,fillStyle:r=ft.fillStyle,strokeWidth:s=ft.strokeWidth,strokeStyle:l=ft.strokeStyle,roughness:c=ft.roughness,opacity:d=ft.opacity,width:o=0,height:u=0,angle:h=0,groupIds:p=[],frameId:U=null,index:m=null,roundness:g=null,boundElements:b=null,link:v=null,locked:x=ft.locked,...y})=>((t<-1e6||t>1e6||n<-1e6||n>1e6||o<-1e6||o>1e6||u<-1e6||u>1e6)&&console.error("New element size or position is too large",{x:t,y:n,width:o,height:u,points:y.points}),{id:y.id||Vn(),type:e,x:t,y:n,width:o,height:u,angle:h,strokeColor:a,backgroundColor:i,fillStyle:r,strokeWidth:s,strokeStyle:l,roughness:c,opacity:d,groupIds:p,frameId:U,index:m,roundness:g,seed:y.seed??Ha(),version:y.version||1,versionNonce:y.versionNonce??0,isDeleted:!1,boundElements:b,updated:ul(),link:v,locked:x,customData:y.customData}),Xa=e=>Ua(e.type,e),tg=e=>Ua("embeddable",e),nP=e=>({...Ua("iframe",e)}),pp=e=>Ue({...Ua("frame",e),type:"frame",name:(e==null?void 0:e.name)||null},{}),O1=e=>Ue({...Ua("magicframe",e),type:"magicframe",name:(e==null?void 0:e.name)||null},{}),Y7=(e,t)=>({x:e.textAlign==="center"?t.width/2:e.textAlign==="right"?t.width:0,y:e.verticalAlign==="middle"?t.height/2:0}),Tn=e=>{let t=e.fontFamily||or,n=e.fontSize||Ci,a=e.lineHeight||Kr(t),i=Ks(e.text),r=an(i,Ve({fontFamily:t,fontSize:n}),a),s=e.textAlign||Jo,l=e.verticalAlign||Nd,c=Y7({textAlign:s,verticalAlign:l},r),d={...Ua("text",e),text:i,fontSize:n,fontFamily:t,textAlign:s,verticalAlign:l,x:e.x-c.x,y:e.y-c.y,width:r.width,height:r.height,containerId:e.containerId||null,originalText:e.originalText??i,autoResize:e.autoResize??!0,lineHeight:a};return Ue(d,{})},aP=(e,t,n)=>{let{width:a,height:i}=an(n,Ve(e),e.lineHeight);e.autoResize||(a=e.width);let{textAlign:r,verticalAlign:s}=e,l,c;if(r==="center"&&s===Mn.MIDDLE&&!e.containerId&&e.autoResize){let d=an(e.text,Ve(e),e.lineHeight),o=Y7(e,{width:a-d.width,height:i-d.height});l=e.x-o.x,c=e.y-o.y}else{let[d,o,u,h]=pe(e,t),[p,U,m,g]=Zi(e,a,i,!1),b=(d-p)/2,v=(o-U)/2,x=(u-m)/2,y=(h-g)/2;[l,c]=iP({s:!0,e:r==="center"||r==="left",w:r==="center"||r==="right"},e.x,e.y,e.angle,b,v,x,y)}return{width:a,height:i,x:Number.isFinite(l)?l:e.x,y:Number.isFinite(c)?c:e.y}},iP=(e,t,n,a,i,r,s,l)=>{let c=Math.cos(a),d=Math.sin(a);return e.e&&e.w?t+=i+s:e.e?(t+=i*(1+c),n+=i*d,t+=s*(1-c),n+=s*-d):e.w&&(t+=i*(1-c),n+=i*-d,t+=s*(1+c),n+=s*d),e.n&&e.s?n+=r+l:e.n?(t+=r*d,n+=r*(1-c),t+=l*-d,n+=l*(1+c)):(t+=r*-d,n+=r*(1+c),t+=l*d,n+=l*(1-c)),[t,n]},Z7=(e,t,n,a=e.text)=>{if(e.isDeleted)return;(t||!e.autoResize)&&(a=rs(a,Ve(e),t?bi(t,e):e.width));let i=aP(e,n,a);return{text:a,...i}},rP=e=>({...Ua(e.type,e),points:e.points||[],pressures:e.pressures||[],simulatePressure:e.simulatePressure,lastCommittedPoint:null}),Nr=e=>({...Ua(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:null,endArrowhead:null}),Up=e=>e.elbowed?{...Ua(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!0,fixedSegments:e.fixedSegments||[],startIsSpecial:!1,endIsSpecial:!1}:{...Ua(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!1},K7=e=>({...Ua("image",e),strokeColor:"transparent",status:e.status??"pending",fileId:e.fileId??null,scale:e.scale??[1,1],crop:e.crop??null}),au=(e,t=0)=>{if(e==null||typeof e!="object")return e;let n=Object.prototype.toString.call(e);if(n==="[object Object]"){let a=typeof e.constructor=="function"?Object.create(Object.getPrototypeOf(e)):{};for(let i in e)if(e.hasOwnProperty(i)){if(t===0&&(i==="shape"||i==="canvas"))continue;a[i]=au(e[i],t+1)}return a}if(Array.isArray(e)){let a=e.length,i=new Array(a);for(;a--;)i[a]=au(e[a],t+1);return i}return be.DEV&&n!=="[object Object]"&&n!=="[object Array]"&&n.startsWith("[object ")&&console.warn(`_deepCloneElement: unexpected object type ${n}. This value will not be cloned!`),e},ss=e=>au(e),q7=(e,t)=>{Object.defineProperty(e,Rk,{value:t,writable:!1,enumerable:!1})},iu=()=>Vn(),J7=(e,t,n,a)=>{let i=ss(n);return pi()&&q7(i,n.id),i.id=iu(),i.boundElements=null,i.updated=ul(),i.seed=Ha(),i.groupIds=TD(i.groupIds,e,r=>(t.has(r)||t.set(r,iu()),t.get(r))),a&&(i=Object.assign(i,a)),i},Q7=(e,t)=>{let n=[],a=ce(e),i=new Map,r=l=>{if(i.has(l))return i.get(l);if(a.has(l)){let c=iu();return i.set(l,c),c}return null},s=new Map;for(let l of e){let c=au(l);if(c.id=r(l.id),pi()&&q7(c,l.id),t!=null&&t.randomizeSeed&&(c.seed=Ha(),uc(c)),c.groupIds&&(c.groupIds=c.groupIds.map(d=>(s.has(d)||s.set(d,iu()),s.get(d)))),"containerId"in c&&c.containerId){let d=r(c.containerId);c.containerId=d}if("boundElements"in c&&c.boundElements&&(c.boundElements=c.boundElements.reduce((d,o)=>{let u=r(o.id);return u&&d.push({...o,id:u}),d},[])),"endBinding"in c&&c.endBinding){let d=r(c.endBinding.elementId);c.endBinding=d?{...c.endBinding,elementId:d}:null}if("startBinding"in c&&c.startBinding){let d=r(c.startBinding.elementId);c.startBinding=d?{...c.startBinding,elementId:d}:null}c.frameId&&(c.frameId=r(c.frameId)),n.push(c)}return n},mp=(e,{shouldThrow:t=!1,includeBoundTextValidation:n=!1,ignoreLogs:a,reconciliationContext:i})=>{let r=[],s=c=>`${c==null?void 0:c.index}:${c==null?void 0:c.id}:${c==null?void 0:c.type}:${c==null?void 0:c.isDeleted}:${c==null?void 0:c.version}:${c==null?void 0:c.versionNonce}`,l=e.map(c=>c.index);for(let[c,d]of l.entries()){let o=l[c-1],u=l[c+1];if($1(d,o,u)||r.push(`Fractional indices invariant has been compromised: "${s(e[c-1])}", "${s(e[c])}", "${s(e[c+1])}"`),n&&Wn(e[c])){let h=e[c],p=ge(h,ce(e));p&&p.index<=h.index&&r.push(`Fractional indices invariant for bound elements has been compromised: "${s(p)}", "${s(h)}"`)}}if(r.length){let c=new ST,d=[];if(i&&(d.push("Additional reconciliation context:"),d.push(i.localElements.map(o=>s(o))),d.push(i.remoteElements.map(o=>s(o)))),a||console.error(r.join(`
|
|
26
|
+
|
|
27
|
+
`),c.stack,e.map(o=>s(o)),...d),t)throw c}},e3=e=>e.sort((t,n)=>ng(t)&&ng(n)?t.index<n.index?-1:t.index>n.index?1:t.id<n.id?-1:1:1),Wa=(e,t)=>{try{let n=sP(e,t),a=t3(e,n),i=e.map(r=>a.has(r)?{...r,...a.get(r)}:r);mp(i,{includeBoundTextValidation:!1,shouldThrow:!0,ignoreLogs:!0});for(let[r,s]of a)G(r,s,!1)}catch{Va(e)}return e},Va=e=>{let t=lP(e),n=t3(e,t);for(let[a,i]of n)G(a,i,!1);return e},sP=(e,t)=>{let n=[],a=0;for(;a<e.length;)if(t.has(e[a].id)){let i=[a-1,a];for(;++a<e.length&&t.has(e[a].id);)i.push(a);i.push(a),n.push(i)}else a++;return n},lP=e=>{let t=[],n,a,i=-1,r=0,s=d=>{var h;let o=e[i]?e[i].index:void 0,u=(h=e[d-1])==null?void 0:h.index;return!o&&u||o&&u&&u>o?[u,d-1]:[o,i]},l=d=>{var h;let o=e[r]?e[r].index:void 0;if(o&&d<r)return[o,r];let u=r;for(;++u<e.length;){let p=(h=e[u])==null?void 0:h.index;if(!o&&p||o&&p&&p>o)return[p,u]}return[void 0,u]},c=0;for(;c<e.length;){let d=e[c].index;if([n,i]=s(c),[a,r]=l(c),$1(d,n,a))c++;else{let o=[i,c];for(;++c<e.length;){let u=e[c].index,[h,p]=s(c),[U,m]=l(c);if($1(u,h,U))break;[n,i]=[h,p],[a,r]=[U,m],o.push(c)}o.push(r),t.push(o)}}return t},$1=(e,t,n)=>e?t&&n?t<e&&e<n:!t&&n?e<n:t&&!n?t<e:!!e:!1,t3=(e,t)=>{var a,i;let n=new Map;for(let r of t){let s=r.shift(),l=r.pop(),c=U1((a=e[s])==null?void 0:a.index,(i=e[l])==null?void 0:i.index,r.length);for(let d=0;d<r.length;d++){let o=e[r[d]];n.set(o,{index:c[d]})}}return n},ng=e=>!!e.index,wt=class ka{constructor(t,n){this.deleted=t,this.inserted=n}static create(t,n,a,i){let r=a&&i!=="inserted"?a(t):t,s=a&&i!=="deleted"?a(n):n;return new ka(r,s)}static calculate(t,n,a,i){if(t===n)return ka.empty();let r={},s={};for(let d of this.distinctKeysIterator("full",t,n))r[d]=t[d],s[d]=n[d];let[l,c]=i?i(r,s):[r,s];return ka.create(l,c,a)}static empty(){return new ka({},{})}static isEmpty(t){return!Object.keys(t.deleted).length&&!Object.keys(t.inserted).length}static mergeObjects(t,n,a){let i={...t};for(let r of Object.keys(a))delete i[r];return{...i,...n}}static mergeArrays(t,n,a,i){return Object.values(ka.mergeObjects(Qa(t??[],i),Qa(n??[],i),Qa(a??[],i)))}static diffObjects(t,n,a,i){if(!(!t[a]&&!n[a])&&(typeof t[a]=="object"||typeof n[a]=="object")){let r=t[a]??{},s=n[a]??{},l=ka.getLeftDifferences(r,s).reduce((d,o)=>(d[o]=i(r[o]),d),{}),c=ka.getRightDifferences(r,s).reduce((d,o)=>(d[o]=i(s[o]),d),{});Object.keys(l).length||Object.keys(c).length?(Reflect.set(t,a,l),Reflect.set(n,a,c)):(Reflect.deleteProperty(t,a),Reflect.deleteProperty(n,a))}}static diffArrays(t,n,a,i){if(!(!t[a]&&!n[a])&&(Array.isArray(t[a])||Array.isArray(n[a]))){let r=Array.isArray(t[a])?t[a]:[],s=Array.isArray(n[a])?n[a]:[],l=Qa(ka.getLeftDifferences(Qa(r,i),Qa(s,i))),c=Qa(ka.getRightDifferences(Qa(r,i),Qa(s,i)));if(Object.keys(l).length||Object.keys(c).length){let d=r.filter(u=>l[i?i(u):String(u)]),o=s.filter(u=>c[i?i(u):String(u)]);Reflect.set(t,a,d),Reflect.set(n,a,o)}else Reflect.deleteProperty(t,a),Reflect.deleteProperty(n,a)}}static isLeftDifferent(t,n,a=!1){return!!this.distinctKeysIterator("left",t,n,a).next().value}static isRightDifferent(t,n,a=!1){return!!this.distinctKeysIterator("right",t,n,a).next().value}static getLeftDifferences(t,n,a=!1){return Array.from(this.distinctKeysIterator("left",t,n,a))}static getRightDifferences(t,n,a=!1){return Array.from(this.distinctKeysIterator("right",t,n,a))}static*distinctKeysIterator(t,n,a,i=!1){if(n===a)return;let r=[];t==="left"?r=Object.keys(n):t==="right"?r=Object.keys(a):t==="full"?r=Array.from(new Set([...Object.keys(n),...Object.keys(a)])):Vr(t,`Unknown distinctKeysIterator's join param "${t}"`,!0);for(let s of r){let l=n[s],c=a[s];if(l!==c){if(!i&&typeof l=="object"&&typeof c=="object"&&l!==null&&c!==null&&Vt(l,c))continue;yield s}}}},ag=class pn{constructor(t){this.delta=t}static calculate(t,n){let a=wt.calculate(t,n,void 0,pn.postProcess);return new pn(a)}static empty(){return new pn(wt.create({},{}))}inverse(){let t=wt.create(this.delta.inserted,this.delta.deleted);return new pn(t)}applyTo(t,n){try{let{selectedElementIds:a={},selectedGroupIds:i={}}=this.delta.deleted,{selectedElementIds:r={},selectedGroupIds:s={},selectedLinearElementId:l,editingLinearElementId:c,...d}=this.delta.inserted,o=wt.mergeObjects(t.selectedElementIds,r,a),u=wt.mergeObjects(t.selectedGroupIds,s,i),h=l&&n.has(l)?new J(n.get(l)):null,p=c&&n.has(c)?new J(n.get(c)):null,U={...t,...d,selectedElementIds:o,selectedGroupIds:u,selectedLinearElement:typeof l<"u"?h:t.selectedLinearElement,editingLinearElement:typeof c<"u"?p:t.editingLinearElement},m=this.filterInvisibleChanges(t,U,n);return[U,m]}catch(a){if(console.error("Couldn't apply appstate change",a),be.DEV||be.MODE===vn.TEST)throw a;return[t,!1]}}isEmpty(){return wt.isEmpty(this.delta)}static postProcess(t,n){try{wt.diffObjects(t,n,"selectedElementIds",a=>!0),wt.diffObjects(t,n,"selectedGroupIds",a=>a??!1)}catch(a){if(console.error("Couldn't postprocess appstate change deltas."),be.DEV||be.MODE===vn.TEST)throw a}finally{return[t,n]}}filterInvisibleChanges(t,n,a){let i=ru(t),r=ru(n),s=wt.isRightDifferent(pn.stripElementsProps(i),pn.stripElementsProps(r)),l=wt.isRightDifferent(pn.stripStandaloneProps(i),pn.stripStandaloneProps(r));if(!s&&!l)return!1;let c={value:s};if(l){let d=wt.getRightDifferences(pn.stripStandaloneProps(i),pn.stripStandaloneProps(r)),o=new Set;(d.includes("editingGroupId")||d.includes("selectedGroupIds"))&&(o=AD(a));for(let u of d)switch(u){case"selectedElementIds":n[u]=pn.filterSelectedElements(n[u],a,c);break;case"selectedGroupIds":n[u]=pn.filterSelectedGroups(n[u],o,c);break;case"croppingElementId":{let m=n[u],g=m&&a.get(m);g&&!g.isDeleted?c.value=!0:n[u]=null;break}case"editingGroupId":let h=n[u];h?o.has(h)?c.value=!0:n[u]=null:c.value=!0;break;case"selectedLinearElementId":case"editingLinearElementId":let p=pn.convertToAppStateKey(u),U=n[p];if(!U)c.value=!0;else{let m=a.get(U.elementId);m&&!m.isDeleted?c.value=!0:n[p]=null}break;default:Vr(u,`Unknown ObservedElementsAppState's key "${u}"`,!0)}}return c.value}static convertToAppStateKey(t){switch(t){case"selectedLinearElementId":return"selectedLinearElement";case"editingLinearElementId":return"editingLinearElement"}}static filterSelectedElements(t,n,a){let i=Object.keys(t);if(!i.length)return a.value=!0,t;let r={...t};for(let s of i){let l=n.get(s);l&&!l.isDeleted?a.value=!0:delete r[s]}return r}static filterSelectedGroups(t,n,a){if(!Object.keys(t).length)return a.value=!0,t;let i={...t};for(let r of Object.keys(i))n.has(r)?a.value=!0:delete i[r];return i}static stripElementsProps(t){let{editingGroupId:n,selectedGroupIds:a,selectedElementIds:i,editingLinearElementId:r,selectedLinearElementId:s,croppingElementId:l,...c}=t;return c}static stripStandaloneProps(t){let{name:n,viewBackgroundColor:a,...i}=t;return i}},Pi=class lt{constructor(t,n,a){this.added=t,this.removed=n,this.updated=a}static create(t,n,a,i={shouldRedistribute:!1}){let r;if(i.shouldRedistribute){let s=new Map,l=new Map,c=new Map,d=[...t,...n,...a];for(let[o,u]of d)this.satisfiesAddition(u)?s.set(o,u):this.satisfiesRemoval(u)?l.set(o,u):c.set(o,u);r=new lt(s,l,c)}else r=new lt(t,n,a);return(be.DEV||be.MODE===vn.TEST)&&(lt.validate(r,"added",this.satisfiesAddition),lt.validate(r,"removed",this.satisfiesRemoval),lt.validate(r,"updated",this.satisfiesUpdate)),r}static validate(t,n,a){for(let[i,r]of t[n].entries())if(!a(r))throw console.error(`Broken invariant for "${n}" delta, element "${i}", delta:`,r),new Error(`ElementsChange invariant broken for element "${i}".`)}static calculate(t,n){if(t===n)return lt.empty();let a=new Map,i=new Map,r=new Map;for(let s of t.values())if(!n.get(s.id)){let l={...s,isDeleted:!1},c={isDeleted:!0},d=wt.create(l,c,lt.stripIrrelevantProps);i.set(s.id,d)}for(let s of n.values()){let l=t.get(s.id);if(!l){let c={isDeleted:!0},d={...s,isDeleted:!1},o=wt.create(c,d,lt.stripIrrelevantProps);a.set(s.id,o);continue}if(l.versionNonce!==s.versionNonce){let c=wt.calculate(l,s,lt.stripIrrelevantProps,lt.postProcess);if(typeof l.isDeleted=="boolean"&&typeof s.isDeleted=="boolean"&&l.isDeleted!==s.isDeleted){l.isDeleted&&!s.isDeleted?a.set(s.id,c):i.set(s.id,c);continue}wt.isEmpty(c)||r.set(s.id,c)}}return lt.create(a,i,r)}static empty(){return lt.create(new Map,new Map,new Map)}inverse(){let t=r=>{let s=new Map;for(let[l,c]of r.entries())s.set(l,wt.create(c.inserted,c.deleted));return s},n=t(this.added),a=t(this.removed),i=t(this.updated);return lt.create(a,n,i)}isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}applyLatestChanges(t){let n=l=>c=>{let d={};for(let o of Object.keys(c))switch(o){case"boundElements":d[o]=c[o];break;default:d[o]=l[o]}return d},a=l=>{let c=new Map;for(let[d,o]of l.entries()){let u=t.get(d);if(u){let h=wt.create(o.deleted,o.inserted,n(u),"inserted");c.set(d,h)}else c.set(d,o)}return c},i=a(this.added),r=a(this.removed),s=a(this.updated);return lt.create(i,r,s,{shouldRedistribute:!0})}applyTo(t,n){let a=Hn(new Map(t)),i,r={containsVisibleDifference:!1,containsZindexDifference:!1};try{let s=lt.createApplier(a,n,r),l=s(this.added),c=s(this.removed),d=s(this.updated),o=this.resolveConflicts(t,a);i=new Map([...l,...c,...d,...o])}catch(s){if(console.error("Couldn't apply elements change",s),be.DEV||be.MODE===vn.TEST)throw s;return[t,!0]}try{lt.redrawTextBoundingBoxes(a,i),a=lt.reorderElements(a,i,r),lt.redrawBoundArrows(a,i)}catch(s){if(console.error("Couldn't mutate elements after applying elements change",s),be.DEV||be.MODE===vn.TEST)throw s}finally{return[a,r.containsVisibleDifference]}}static applyDelta(t,n,a={containsVisibleDifference:!0,containsZindexDifference:!0}){var s,l;let{boundElements:i,...r}=n.inserted;if((s=n.deleted.boundElements)!=null&&s.length||(l=n.inserted.boundElements)!=null&&l.length){let c=wt.mergeArrays(t.boundElements,n.inserted.boundElements,n.deleted.boundElements,d=>d.id);Object.assign(r,{boundElements:c})}if(Ne(t)){let c=n;(c.deleted.crop||c.inserted.crop)&&Object.assign(r,{crop:c.inserted.crop??null})}if(!a.containsVisibleDifference){let{index:c,...d}=r,o=lt.checkForVisibleDifference(t,d);a.containsVisibleDifference=o}return a.containsZindexDifference||(a.containsZindexDifference=n.deleted.index!==n.inserted.index),Ue(t,r)}static checkForVisibleDifference(t,n){return t.isDeleted&&n.isDeleted!==!1?!1:t.isDeleted&&n.isDeleted===!1||t.isDeleted===!1&&n.isDeleted?!0:wt.isRightDifferent(t,n)}resolveConflicts(t,n){let a=new Map,i=(d,o)=>{let u=n.get(d.id);if(!u)return;let h;t.get(d.id)===u?h=Ue(u,o):h=G(u,o),a.set(h.id,h),n.set(h.id,h)};for(let[d]of this.removed)lt.unbindAffected(t,n,d,i);for(let[d]of this.added)lt.rebindAffected(t,n,d,i);for(let[d]of Array.from(this.updated).filter(([o,u])=>Object.keys({...u.deleted,...u.inserted}).find(h=>wD.has(h)))){let o=n.get(d);!o||o.isDeleted||lt.rebindAffected(t,n,d,i)}let r=new Map(Array.from(t).filter(([d])=>a.has(d))),{added:s,removed:l,updated:c}=lt.calculate(r,a);for(let[d,o]of s)this.added.set(d,o);for(let[d,o]of l)this.removed.set(d,o);for(let[d,o]of c)this.updated.set(d,o);return a}static unbindAffected(t,n,a,i){let r=()=>t.get(a),s=()=>n.get(a);js.unbindAffected(n,r(),i),js.unbindAffected(n,s(),i),As.unbindAffected(n,r(),i),As.unbindAffected(n,s(),i)}static rebindAffected(t,n,a,i){let r=()=>t.get(a),s=()=>n.get(a);js.unbindAffected(n,r(),i),js.rebindAffected(n,s(),i),As.unbindAffected(n,r(),(l,c)=>{q(l)&&i(l,c)}),As.rebindAffected(n,s(),i)}static redrawTextBoundingBoxes(t,n){let a=new Map;for(let i of n.values()){if(at(i)){let{containerId:r}=i,s=r?t.get(r):void 0;s&&a.set(s.id,{container:s,boundText:i})}if(Wn(i)){let r=gi(i),s=r?t.get(r):void 0;s&&a.set(i.id,{container:i,boundText:s})}}for(let{container:i,boundText:r}of a.values())i.isDeleted||r.isDeleted||on(r,i,t,!1)}static redrawBoundArrows(t,n){for(let a of n.values())!a.isDeleted&&ha(a)&&xn(a,t,{})}static reorderElements(t,n,a){if(!a.containsZindexDifference)return t;let i=Array.from(t.values()),r=e3([...i]),s=wt.getRightDifferences(i,r,!0).reduce((l,c)=>{let d=i[Number(c)];return d&&n.has(d.id)&&l.set(d.id,d),l},new Map);return!a.containsVisibleDifference&&s.size&&(a.containsVisibleDifference=!0),ce(Wa(r,s))}static postProcess(t,n){try{wt.diffArrays(t,n,"boundElements",a=>a.id)}catch(a){if(console.error("Couldn't postprocess elements change deltas."),be.DEV||be.MODE===vn.TEST)throw a}finally{return[t,n]}}static stripIrrelevantProps(t){let{id:n,updated:a,version:i,versionNonce:r,seed:s,...l}=t;return l}};L(Pi,"satisfiesAddition",({deleted:e,inserted:t})=>e.isDeleted===!0&&!t.isDeleted),L(Pi,"satisfiesRemoval",({deleted:e,inserted:t})=>!e.isDeleted&&t.isDeleted===!0),L(Pi,"satisfiesUpdate",({deleted:e,inserted:t})=>!!e.isDeleted==!!t.isDeleted),L(Pi,"createApplier",(e,t,n)=>{let a=Pi.createGetter(e,t,n);return i=>Array.from(i.entries()).reduce((r,[s,l])=>{let c=a(s,l.inserted);if(c){let d=Pi.applyDelta(c,l,n);e.set(d.id,d),r.set(d.id,d)}return r},new Map)}),L(Pi,"createGetter",(e,t,n)=>(a,i)=>{let r=e.get(a);return r||(r=t.get(a),r&&(n.containsZindexDifference=!0,(i.isDeleted===!1||i.isDeleted!==!0&&r.isDeleted===!1)&&(n.containsVisibleDifference=!0))),r});var ig=Pi,Ta=class{constructor(){L(this,"subscribers",[])}on(...e){let t=e.flat().filter(n=>typeof n=="function");return this.subscribers.push(...t),()=>this.off(t)}once(...e){let t=e.flat().filter(a=>typeof a=="function");t.push(()=>n());let n=this.on(...t);return n}off(...e){let t=e.flat();this.subscribers=this.subscribers.filter(n=>!t.includes(n))}trigger(...e){for(let t of this.subscribers)t(...e);return this}clear(){this.subscribers=[]}},n3="__observedAppState",ru=e=>{var n,a;let t={name:e.name,editingGroupId:e.editingGroupId,viewBackgroundColor:e.viewBackgroundColor,selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,editingLinearElementId:((n=e.editingLinearElement)==null?void 0:n.elementId)||null,selectedLinearElementId:((a=e.selectedLinearElement)==null?void 0:a.elementId)||null,croppingElementId:e.croppingElementId};return Reflect.defineProperty(t,n3,{value:!0,enumerable:!1}),t},oP=e=>!!Reflect.get(e,n3),X={IMMEDIATELY:"IMMEDIATELY",NEVER:"NEVER",EVENTUALLY:"EVENTUALLY"},cP=class{constructor(e,t){this.elementsChange=e,this.appStateChange=t}},dP=class{constructor(){L(this,"onStoreIncrementEmitter",new Ta),L(this,"scheduledActions",new Set),L(this,"_snapshot",rg.empty()),L(this,"shouldCaptureIncrement",()=>{this.scheduleAction(X.IMMEDIATELY)}),L(this,"shouldUpdateSnapshot",()=>{this.scheduleAction(X.NEVER)}),L(this,"scheduleAction",e=>{this.scheduledActions.add(e),this.satisfiesScheduledActionsInvariant()}),L(this,"commit",(e,t)=>{try{this.scheduledActions.has(X.IMMEDIATELY)?this.captureIncrement(e,t):this.scheduledActions.has(X.NEVER)&&this.updateSnapshot(e,t)}finally{this.satisfiesScheduledActionsInvariant(),this.scheduledActions=new Set}}),L(this,"captureIncrement",(e,t)=>{let n=this.snapshot,a=this.snapshot.maybeClone(e,t);if(n!==a){let i=a.meta.didElementsChange?ig.calculate(n.elements,a.elements):ig.empty(),r=a.meta.didAppStateChange?ag.calculate(n.appState,a.appState):ag.empty();(!i.isEmpty()||!r.isEmpty())&&this.onStoreIncrementEmitter.trigger(new cP(i,r)),this.snapshot=a}}),L(this,"updateSnapshot",(e,t)=>{let n=this.snapshot.maybeClone(e,t);this.snapshot!==n&&(this.snapshot=n)}),L(this,"filterUncomittedElements",(e,t)=>{for(let[n,a]of e.entries()){if(!t.get(n))continue;let i=this.snapshot.elements.get(n);i?i.version<a.version&&t.set(n,i):t.delete(n)}return t}),L(this,"clear",()=>{this.snapshot=rg.empty(),this.scheduledActions=new Set}),L(this,"satisfiesScheduledActionsInvariant",()=>{if(!(this.scheduledActions.size>=0&&this.scheduledActions.size<=3)){let e=`There can be at most three store actions scheduled at the same time, but there are "${this.scheduledActions.size}".`;if(console.error(e,this.scheduledActions.values()),be.DEV||be.MODE===vn.TEST)throw new Error(e)}})}get snapshot(){return this._snapshot}set snapshot(e){this._snapshot=e}},rg=class F1{constructor(t,n,a={didElementsChange:!1,didAppStateChange:!1,isEmpty:!1}){this.elements=t,this.appState=n,this.meta=a}static empty(){return new F1(new Map,ru(za()),{didElementsChange:!1,didAppStateChange:!1,isEmpty:!0})}isEmpty(){return this.meta.isEmpty}maybeClone(t,n){let a=this.maybeCreateElementsSnapshot(t),i=this.maybeCreateAppStateSnapshot(n),r=!1,s=!1;return this.elements!==a&&(r=!0),this.appState!==i&&(s=!0),!r&&!s?this:new F1(a,i,{didElementsChange:r,didAppStateChange:s})}maybeCreateAppStateSnapshot(t){if(!t)return this.appState;let n=oP(t)?t:ru(t);return this.detectChangedAppState(n)?n:this.appState}detectChangedAppState(t){return!Vt(this.appState,t,{selectedElementIds:Vt,selectedGroupIds:Vt})}maybeCreateElementsSnapshot(t){return t?this.detectChangedElements(t)?this.createElementsSnapshot(t):this.elements:this.elements}detectChangedElements(t){if(this.elements===t)return!1;if(this.elements.size!==t.size)return!0;let n=Array.from(t.keys());for(let a=n.length-1;a>=0;a--){let i=this.elements.get(n[a]),r=t.get(n[a]);if(!i||!r||i.id!==r.id||i.versionNonce!==r.versionNonce)return!0}return!1}createElementsSnapshot(t){let n=new Map;for(let[a,i]of this.elements.entries())t.get(a)?n.set(a,i):n.set(a,Ue(i,{isDeleted:!0}));for(let[a,i]of t.entries()){let r=n.get(a);(!r||r&&r.versionNonce!==i.versionNonce)&&n.set(a,ss(i))}return n}},Sa=new Map,uP=/^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)(?:\?t=|&t=|\?start=|&start=)?([a-zA-Z0-9_-]+)?[^\s]*$/,fP=/^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/,hP=/^https:\/\/(?:www\.)?figma\.com/,sg=/^https:\/\/gist\.github\.com\/([\w_-]+)\/([\w_-]+)/,pP=/^<script[\s\S]*?\ssrc=["'](https:\/\/gist\.github\.com\/.*?)\.js["']/i,lg=/(?:https?:\/\/)?(?:(?:w){3}\.)?(?:twitter|x)\.com\/[^/]+\/status\/(\d+)/,UP=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:twitter|x)\.com\/[^"']*)/i,mP=/^https:\/\/(?:www\.)?val\.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/,gP=/^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i,og=/giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/,cg=/^(?:http(?:s)?:\/\/)?(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)\/?(?:\?[^#\s]*)?(?:#[^\s]*)?$/,bP=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:www\.)?reddit\.com\/[^"']*)/i,z1=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","link.excalidraw.com","gist.github.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","val.town","giphy.com","reddit.com"]),dg=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","reddit.com"]),lo=e=>`<html><body>${e}</body></html>`,Rs=e=>{if(!e)return null;if(Sa.has(e))return Sa.get(e);let t=e,n=dg.has(B1(e,dg)||""),a="generic",i={w:560,h:840},r=e.match(uP);if(r!=null&&r[2]){let c=r[3]?`&start=${r[3]}`:"",d=e.includes("shorts");switch(a="video",r[1]){case"embed/":case"watch?v=":case"shorts/":e=`https://www.youtube.com/embed/${r[2]}?enablejsapi=1${c}`;break;case"playlist?list=":case"embed/videoseries?list=":e=`https://www.youtube.com/embed/videoseries?list=${r[2]}&enablejsapi=1${c}`;break;default:e=`https://www.youtube.com/embed/${r[2]}?enablejsapi=1${c}`;break}return i=d?{w:315,h:560}:{w:560,h:315},Sa.set(t,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}}let s=e.match(fP);if(s!=null&&s[1]){let c=s==null?void 0:s[1],d=/^\d+$/.test(c)?void 0:new URIError("Invalid embed link format");return a="video",e=`https://player.vimeo.com/video/${c}?api=1`,i={w:560,h:315},Sa.set(t,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,error:d,sandbox:{allowSameOrigin:n}}}if(e.match(hP))return a="generic",e=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(e)}`,i={w:550,h:550},Sa.set(t,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}};let l=e.match(mP);if(l)return e=l[1]==="embed"?l[0]:l[0].replace("/v","/embed"),Sa.set(t,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}};if(lg.test(e)){let c=e.match(lg)[1],d=od(`https://twitter.com/x/status/${c}`),o={type:"document",srcdoc:u=>lo(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${u}"><a href="${d}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return Sa.set(t,o),o}if(cg.test(e)){let[,c,d,o]=e.match(cg),u=od(`https://reddit.com/r/${c}/comments/${d}/${o}`),h={type:"document",srcdoc:p=>lo(`<blockquote class="reddit-embed-bq" data-embed-theme="${p}"><a href="${u}"></a><br></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return Sa.set(t,h),h}if(sg.test(e)){let[,c,d]=e.match(sg),o=od(`https://gist.github.com/${c}/${d}`),u={type:"document",srcdoc:()=>lo(`
|
|
28
|
+
<script src="${o}.js"><\/script>
|
|
29
|
+
<style type="text/css">
|
|
30
|
+
* { margin: 0px; }
|
|
31
|
+
table, .gist { height: 100%; }
|
|
32
|
+
.gist .gist-file { height: calc(100vh - 2px); padding: 0px; display: grid; grid-template-rows: 1fr auto; }
|
|
33
|
+
</style>
|
|
34
|
+
`),intrinsicSize:{w:550,h:720},sandbox:{allowSameOrigin:n}};return Sa.set(e,u),u}return Sa.set(e,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}},a3=e=>{let t;Oi(e)?t="IFrame element":t=!e.link||(e==null?void 0:e.link)===""?"Empty Web-Embed":e.link;let n=Math.max(Math.min(e.width/2,e.width/t.length),e.width/30),a=it.Helvetica,i=Ve({fontSize:n,fontFamily:a});return Tn({x:e.x+e.width/2,y:e.y+e.height/2,strokeColor:e.strokeColor!=="transparent"?e.strokeColor:"black",backgroundColor:"transparent",fontFamily:a,fontSize:n,text:rs(t,i,e.width-20),textAlign:"center",verticalAlign:Mn.MIDDLE,angle:e.angle??0})};Z({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,n,a)=>{let i=Et(t,{type:"embeddable"});return Ma(a.canvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:Et(t,{type:"embeddable"})},captureUpdate:X.EVENTUALLY}}});var B1=(e,t)=>{try{let{hostname:n}=new URL(e),a=n.replace(/^www\./,"");if(t instanceof Set){if(z1.has(a))return a;let r=a.replace(/^([^.]+)/,"*");return z1.has(r)?r:null}let i=t.replace(/^www\./,"");if(a===i)return i}catch{}return null},vP=e=>{let t=e.match(UP);if(t&&t.length===2)return t[1];let n=e.match(bP);if(n&&n.length===2)return n[1];let a=e.match(pP);if(a&&a.length===2)return a[1];if(og.test(e))return`https://giphy.com/embed/${og.exec(e)[1]}`;let i=e.match(gP);return i&&i.length===2?i[1]:e},md=(e,t)=>{if(!e)return!1;if(t!=null)if(typeof t=="function"){let n=t(e);if(typeof n=="boolean")return n}else{if(typeof t=="boolean")return t;if(t instanceof RegExp)return t.test(e);if(Array.isArray(t)){for(let n of t)if(n instanceof RegExp){if(e.match(n))return!0}else if(B1(e,n))return!0;return!1}}return!!B1(e,z1)},_l=(e,t,n)=>{let a={sets:t.sets,shape:t.shape,options:{...t.options,fixedDecimalPlaceDigits:n}};return e.draw(a)},jl=(e,t,n,a,i)=>{if(!a.enabled||!a.clip)return null;let r=wn(e,i);if(r){let s=t.ownerDocument.createElementNS(Le,"g");return s.setAttributeNS(Le,"clip-path",`url(#${r.id})`),n.forEach(l=>s.appendChild(l)),s}return null},gd=(e,t,n,a,i,r,s,l)=>{var x;let c={x:r,y:s},[d,o,u,h]=pe(e,t),p=(u-d)/2-(e.x-d),U=(h-o)/2-(e.y-o);if(q(e)){let y=zt(e,t);if(xe(y)){let[E,S,w,k]=pe(y,t),T=J.getBoundTextElementPosition(y,e,t);p=(w-E)/2-(T.x-E),U=(k-S)/2-(T.y-S),r=r+T.x-e.x,s=s+T.y-e.y}}let m=180*e.angle/Math.PI,g=a;if(e.link){let y=a.ownerDocument.createElementNS(Le,"a");y.setAttribute("href",yn(e.link)),g.appendChild(y),g=y}let b=(y,E)=>{pi()&&y.setAttribute("data-id",E.id),g.appendChild(y)},v=(((x=wn(e,t))==null?void 0:x.opacity)??100)*e.opacity/1e4;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{let y=dt.generateElementShape(e,null),E=_l(n,y,Ml);v!==1&&(E.setAttribute("stroke-opacity",`${v}`),E.setAttribute("fill-opacity",`${v}`)),E.setAttribute("stroke-linecap","round"),E.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`);let S=jl(e,g,[E],l.frameRendering,t);b(S||E,e);break}case"iframe":case"embeddable":{let y=dt.generateElementShape(e,l),E=_l(n,y,Ml),S=e.opacity/100;S!==1&&(E.setAttribute("stroke-opacity",`${S}`),E.setAttribute("fill-opacity",`${S}`)),E.setAttribute("stroke-linecap","round"),E.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`),b(E,e);let w=a3(e);gd(w,t,n,g,i,w.x+c.x-e.x,w.y+c.y-e.y,l);let k=_l(n,y,Ml);for(k.setAttribute("stroke-linecap","round"),k.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`);k.firstChild;)k.removeChild(k.firstChild);let T=ca(Math.min(e.width,e.height),e),_=Rs(hp(e.link||""));if(l.renderEmbeddables===!1||(_==null?void 0:_.type)==="document"){let j=a.ownerDocument.createElementNS(Le,"a");j.setAttribute("href",yn(e.link||"")),j.setAttribute("target","_blank"),j.setAttribute("rel","noopener noreferrer"),j.style.borderRadius=`${T}px`,k.appendChild(j)}else{let j=a.ownerDocument.createElementNS(Le,"foreignObject");j.style.width=`${e.width}px`,j.style.height=`${e.height}px`,j.style.border="none";let A=j.ownerDocument.createElementNS(Le,"div");A.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),A.style.width="100%",A.style.height="100%";let R=A.ownerDocument.createElement("iframe");R.src=(_==null?void 0:_.link)??"",R.style.width="100%",R.style.height="100%",R.style.border="none",R.style.borderRadius=`${T}px`,R.style.top="0",R.style.left="0",R.allowFullscreen=!0,A.appendChild(R),j.appendChild(A),k.appendChild(j)}b(k,e);break}case"line":case"arrow":{let y=ge(e,t),E=a.ownerDocument.createElementNS(Le,"mask");if(y){E.setAttribute("id",`mask-${e.id}`);let k=a.ownerDocument.createElementNS(Le,"rect");r=r||0,s=s||0,k.setAttribute("x","0"),k.setAttribute("y","0"),k.setAttribute("fill","#fff"),k.setAttribute("width",`${e.width+100+r}`),k.setAttribute("height",`${e.height+100+s}`),E.appendChild(k);let T=a.ownerDocument.createElementNS(Le,"rect"),_=J.getBoundTextElementPosition(e,y,t),j=r+_.x-e.x,A=s+_.y-e.y;T.setAttribute("x",j.toString()),T.setAttribute("y",A.toString()),T.setAttribute("fill","#000"),T.setAttribute("width",`${y.width}`),T.setAttribute("height",`${y.height}`),T.setAttribute("opacity","1"),E.appendChild(T)}let S=a.ownerDocument.createElementNS(Le,"g");y&&S.setAttribute("mask",`url(#mask-${e.id})`),S.setAttribute("stroke-linecap","round"),dt.generateElementShape(e,l).forEach(k=>{let T=_l(n,k,Ml);v!==1&&(T.setAttribute("stroke-opacity",`${v}`),T.setAttribute("fill-opacity",`${v}`)),T.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`),e.type==="line"&&Ui(e.points)&&e.backgroundColor!=="transparent"&&T.setAttribute("fill-rule","evenodd"),S.appendChild(T)});let w=jl(e,g,[S,E],l.frameRendering,t);w?(b(w,e),g.appendChild(w)):(b(S,e),g.append(E));break}case"freedraw":{let y=dt.generateElementShape(e,l),E=y?_l(n,y,Ml):a.ownerDocument.createElementNS(Le,"g");v!==1&&(E.setAttribute("stroke-opacity",`${v}`),E.setAttribute("fill-opacity",`${v}`)),E.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`),E.setAttribute("stroke","none");let S=a.ownerDocument.createElementNS(Le,"path");S.setAttribute("fill",e.strokeColor),S.setAttribute("d",sp(e)),E.appendChild(S);let w=jl(e,g,[E],l.frameRendering,t);b(w||E,e);break}case"image":{let y=Math.round(e.width),E=Math.round(e.height),S=Dn(e)&&i[e.fileId];if(S){let{reuseImages:w=!0}=l,k=`image-${S.id}`,T=e.width,_=e.height;e.crop&&({width:T,height:_}=mi(e),k=`image-crop-${S.id}-${Wp(`${T}x${_}`)}`),w||(k=`image-${e.id}`);let j=a.querySelector(`#${k}`);if(!j){j=a.ownerDocument.createElementNS(Le,"symbol"),j.id=k;let F=a.ownerDocument.createElementNS(Le,"image");F.setAttribute("href",S.dataURL),F.setAttribute("preserveAspectRatio","none"),e.crop||!w?(F.setAttribute("width",`${T}`),F.setAttribute("height",`${_}`)):(F.setAttribute("width","100%"),F.setAttribute("height","100%")),j.appendChild(F),(g.querySelector("defs")||g).prepend(j)}let A=a.ownerDocument.createElementNS(Le,"use");A.setAttribute("href",`#${k}`),l.exportWithDarkMode&&S.mimeType!==ae.svg&&A.setAttribute("filter",f7);let R=0,N=0;if(e.crop){let{width:F,height:Y}=mi(e);R=e.crop.x/(e.crop.naturalWidth/F),N=e.crop.y/(e.crop.naturalHeight/Y)}let O=p+R,$=U+N;A.setAttribute("width",`${y+R}`),A.setAttribute("height",`${E+N}`),A.setAttribute("opacity",`${v}`),(e.scale[0]!==1||e.scale[1]!==1)&&A.setAttribute("transform",`translate(${O} ${$}) scale(${e.scale[0]} ${e.scale[1]}) translate(${-O} ${-$})`);let P=a.ownerDocument.createElementNS(Le,"g");if(e.crop){let F=a.ownerDocument.createElementNS(Le,"mask");F.setAttribute("id",`mask-image-crop-${e.id}`),F.setAttribute("fill","#fff");let Y=a.ownerDocument.createElementNS(Le,"rect");Y.setAttribute("x",`${R}`),Y.setAttribute("y",`${N}`),Y.setAttribute("width",`${y}`),Y.setAttribute("height",`${E}`),F.appendChild(Y),g.appendChild(F),P.setAttribute("mask",`url(#${F.id})`)}if(P.appendChild(A),P.setAttribute("transform",`translate(${r-R} ${s-N}) rotate(${m} ${O} ${$})`),e.roundness){let F=a.ownerDocument.createElementNS(Le,"clipPath");F.id=`image-clipPath-${e.id}`;let Y=a.ownerDocument.createElementNS(Le,"rect"),Q=ca(Math.min(e.width,e.height),e);Y.setAttribute("width",`${e.width}`),Y.setAttribute("height",`${e.height}`),Y.setAttribute("rx",`${Q}`),Y.setAttribute("ry",`${Q}`),F.appendChild(Y),b(F,e),P.setAttributeNS(Le,"clip-path",`url(#${F.id})`)}let W=jl(e,g,[P],l.frameRendering,t);b(W||P,e)}break}case"frame":case"magicframe":{if(l.frameRendering.enabled&&l.frameRendering.outline){let y=document.createElementNS(Le,"rect");y.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`),y.setAttribute("width",`${e.width}px`),y.setAttribute("height",`${e.height}px`),y.setAttribute("rx",ot.radius.toString()),y.setAttribute("ry",ot.radius.toString()),y.setAttribute("fill","none"),y.setAttribute("stroke",ot.strokeColor),y.setAttribute("stroke-width",ot.strokeWidth.toString()),b(y,e)}break}default:if(q(e)){let y=a.ownerDocument.createElementNS(Le,"g");v!==1&&(y.setAttribute("stroke-opacity",`${v}`),y.setAttribute("fill-opacity",`${v}`)),y.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`);let E=e.text.replace(/\r\n?/g,`
|
|
35
|
+
`).split(`
|
|
36
|
+
`),S=nc(e.fontSize,e.lineHeight),w=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,k=Q8(e.fontFamily,e.fontSize,S),T=U8(e.text)?"rtl":"ltr",_=e.textAlign==="center"?"middle":e.textAlign==="right"||T==="rtl"?"end":"start";for(let A=0;A<E.length;A++){let R=a.ownerDocument.createElementNS(Le,"text");R.textContent=E[A],R.setAttribute("x",`${w}`),R.setAttribute("y",`${A*S+k}`),R.setAttribute("font-family",Ys(e)),R.setAttribute("font-size",`${e.fontSize}px`),R.setAttribute("fill",e.strokeColor),R.setAttribute("text-anchor",_),R.setAttribute("style","white-space: pre;"),R.setAttribute("direction",T),R.setAttribute("dominant-baseline","alphabetic"),y.appendChild(R)}let j=jl(e,g,[y],l.frameRendering,t);b(j||y,e)}else throw new Error(`Unimplemented type ${e.type}`)}},xP=(e,t,n,a,i,r)=>{a&&(e.filter(s=>!Pn(s)).forEach(s=>{if(!s.isDeleted){if(q(s)&&s.containerId&&t.has(s.containerId))return;try{gd(s,t,n,a,i,s.x+r.offsetX,s.y+r.offsetY,r);let l=ge(s,t);l&&gd(l,t,n,a,i,l.x+r.offsetX,l.y+r.offsetY,r)}catch(l){console.error(l)}}}),e.filter(s=>Pn(s)).forEach(s=>{if(!s.isDeleted)try{gd(s,t,n,a,i,s.x+r.offsetX,s.y+r.offsetY,r)}catch(l){console.error(l)}}))},ug=500,gp=e=>{var a,i;let t=(a=e.extensions)==null?void 0:a.reduce((r,s)=>(r.push(ae[s]),r),[]),n=(i=e.extensions)==null?void 0:i.reduce((r,s)=>s==="jpg"?r.concat(".jpg",".jpeg"):r.concat(`.${s}`),[]);return qC({description:e.description,extensions:n,mimeTypes:t,multiple:e.multiple??!1,legacySetup:(r,s,l)=>{let c=Zs(s,ug),d=()=>{o(),document.addEventListener("keyup",c),document.addEventListener("pointerup",c),c()},o=()=>{var h;if((h=l.files)!=null&&h.length){let p=e.multiple?[...l.files]:l.files[0];r(p)}};requestAnimationFrame(()=>{window.addEventListener("focus",d)});let u=window.setInterval(()=>{o()},ug);return h=>{clearInterval(u),c.cancel(),window.removeEventListener("focus",d),document.removeEventListener("keyup",c),document.removeEventListener("pointerup",c),h&&(console.warn("Opening the file was canceled (legacy-fs)."),h(new Xu))}}})},su=(e,t)=>QC(e,{fileName:`${t.name}.${t.extension}`,description:t.description,extensions:[`.${t.extension}`],mimeTypes:t.mimeTypes},t.fileHandle),yP=(e,t)=>{let n={};for(let a of e)!a.isDeleted&&"fileId"in a&&a.fileId&&t[a.fileId]&&(n[a.fileId]=t[a.fileId]);return n},sc=(e,t,n,a)=>{let i={type:Fn.excalidraw,version:Nu.excalidraw,source:O0,elements:a==="local"?Z3(e):VN(e),appState:a==="local"?d8(t):Pk(t),files:a==="local"?yP(e,n):void 0};return JSON.stringify(i,null,2)},i3=async(e,t,n,a=t.name||s8)=>{let i=sc(e,t,n,"local"),r=new Blob([i],{type:ae.excalidraw});return{fileHandle:await su(r,{name:a,extension:"excalidraw",description:"Excalidraw file",fileHandle:Vp(t.fileHandle)?null:t.fileHandle})}},wP=async(e,t)=>{let n=await gp({description:"Excalidraw files"});return Yp(await Zp(n),e,t,n.handle)},EP=e=>(e==null?void 0:e.type)===Fn.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||typeof e.appState=="object")),r3=e=>typeof e=="object"&&e&&e.type===Fn.excalidrawLibrary&&(e.version===1||e.version===2),bp=e=>{let t={type:Fn.excalidrawLibrary,version:Nu.excalidrawLibrary,source:O0,libraryItems:e};return JSON.stringify(t,null,2)},SP=async e=>{let t=bp(e);await su(new Blob([t],{type:ae.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})},s3=e=>new Promise((t,n)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=i=>{n(i)},a.src=e}),l3=async({fileIds:e,files:t,imageCache:n})=>{let a=new Map,i=new Map;return await Promise.all(e.reduce((r,s)=>{let l=t[s];return l&&!a.has(s)?(a.set(s,!0),r.concat((async()=>{try{if(l.mimeType===ae.binary)throw new Error("Only images can be added to ImageCache");let c=s3(l.dataURL),d={image:c,mimeType:l.mimeType};n.set(s,d);let o=await c;n.set(s,{...d,image:o})}catch{i.set(s,!0)}})())):r},[])),{imageCache:n,updatedFiles:a,erroredFiles:i}},o3=e=>e.filter(t=>Dn(t)),CP=e=>(e==null?void 0:e.nodeName.toLowerCase())==="svg",fg=e=>{let t=new DOMParser().parseFromString(e,ae.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||!CP(n))throw new Error("Invalid SVG");{n.hasAttribute("xmlns")||n.setAttribute("xmlns",Le);let a=n.getAttribute("width"),i=n.getAttribute("height");(a!=null&&a.includes("%")||a==="auto")&&(a=null),(i!=null&&i.includes("%")||i==="auto")&&(i=null);let r=n.getAttribute("viewBox");if(!a||!i){if(a=a||"50",i=i||"50",r){let s=r.match(/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/);s&&([,a,i]=s)}n.setAttribute("width",a),n.setAttribute("height",i)}return r||n.setAttribute("viewBox",`0 0 ${a} ${i}`),n.outerHTML}},c3=document.createElement("img");c3.src=`data:${ae.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>')}`;var d3=document.createElement("img");d3.src=`data:${ae.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-big-right-line"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 9v-3.586a1 1 0 0 1 1.707 -.707l6.586 6.586a1 1 0 0 1 0 1.414l-6.586 6.586a1 1 0 0 1 -1.707 -.707v-3.586h-6v-6h6z" /><path d="M3 9v6" /></svg>')}`;var vp=([e,t,n,a],i,r)=>{let s=RL,l=s/r.zoom.value,c=s/r.zoom.value,d=s/r.zoom.value,o=(e+n)/2,u=(t+a)/2,h=(s-8)/(2*r.zoom.value),p=4/r.zoom.value,U=n+p-h,m=t-p-d+h,[g,b]=H(C(U+l/2,m+c/2),C(o,u),i);return[g-l/2,b-c/2,l,c]},u3=(e,t,n,[a,i])=>{let r=4/n.zoom.value,[s,l,c,d]=pe(e,t),[o,u,h,p]=vp([s,l,c,d],e.angle,n);return a>o-r&&a<o+r+h&&i>u-r&&i<u+p+r},ph=(e,t,n,[a,i],r)=>!e.link||n.selectedElementIds[e.id]?!1:!r&&n.viewModeEnabled&&ip(a,i,e,t)?!0:u3(e,t,n,C(a,i)),nf=(e,t,n,a,i=!0)=>{e.beginPath(),e.arc(t,n,a,0,Math.PI*2),e.fill(),i&&e.stroke()},xp=(e,t)=>[e.width/t,e.height/t],yp=({canvas:e,scale:t,normalizedWidth:n,normalizedHeight:a,theme:i,isExporting:r,viewBackgroundColor:s})=>{let l=e.getContext("2d");return l.setTransform(1,0,0,1,0,0),l.scale(t,t),r&&i===ke.DARK&&(l.filter=z0),typeof s=="string"?((s==="transparent"||s.length===5||s.length===9||/(hsla|rgba)\(/.test(s))&&l.clearRect(0,0,n,a),l.save(),l.fillStyle=s,l.fillRect(0,0,n,a),l.restore()):l.clearRect(0,0,n,a),l},f3=(e,t)=>{let n=window.location.href;try{let a=new URL(n);return a.searchParams.set(zd,e),yn(a.toString())}catch(a){console.error(a)}return yn(n)},h3=(e,t)=>{if(e.length>0&&lu(e)){if(e.length===1)return{id:e[0].id,type:"element"};if(e.length>1){let n=Object.keys(t.selectedGroupIds)[0];return n?{id:n,type:"group"}:{id:e[0].groupIds[0],type:"group"}}}return null},lu=e=>!!(e.length===1||e.length>1&&$7(e)),Os=e=>{try{let t=new URL(e);return t.searchParams.has(zd)&&t.host===window.location.host}catch{return!1}},kP=e=>{try{let{searchParams:t}=new URL(e);if(t.has(zd))return t.get(zd)}catch{}return null},Dc={Bold:"#dddddd",Regular:"#e5e5e5"},MP=(e,t,n,a,i,r,s,l)=>{let c=a%t-t,d=i%t-t,o=t*r.value,u=1/r.value;e.save(),r.value===1&&e.translate(c%1?0:.5,d%1?0:.5);for(let h=c;h<c+s+t*2;h+=t){let p=n>1&&Math.round(h-a)%(n*t)===0;if(!p&&o<10)continue;let U=Math.min(1/r.value,p?4:1);e.lineWidth=U;let m=[U*3,u+(U+u)];e.beginPath(),e.setLineDash(p?[]:m),e.strokeStyle=p?Dc.Bold:Dc.Regular,e.moveTo(h,d-t),e.lineTo(h,Math.ceil(d+l+t*2)),e.stroke()}for(let h=d;h<d+l+t*2;h+=t){let p=n>1&&Math.round(h-i)%(n*t)===0;if(!p&&o<10)continue;let U=Math.min(1/r.value,p?4:1);e.lineWidth=U;let m=[U*3,u+(U+u)];e.beginPath(),e.setLineDash(p?[]:m),e.strokeStyle=p?Dc.Bold:Dc.Regular,e.moveTo(c-t,h),e.lineTo(Math.ceil(c+s+t*2),h),e.stroke()}e.restore()},hg=(e,t,n,a)=>{t.translate(e.x+a.scrollX,e.y+a.scrollY),t.beginPath(),t.roundRect?t.roundRect(0,0,e.width,e.height,ot.radius/a.zoom.value):t.rect(0,0,e.width,e.height),t.clip(),t.translate(-(e.x+a.scrollX),-(e.y+a.scrollY))},pg={regularLink:null,elementLink:null},Ug=(e,t,n,a)=>{if(e.link&&!n.selectedElementIds[e.id]){let[i,r,s,l]=pe(e,a),[c,d,o,u]=vp([i,r,s,l],e.angle,n),h=c+o/2,p=d+u/2;t.save(),t.translate(n.scrollX+h,n.scrollY+p),t.rotate(e.angle);let U=Os(e.link)?"elementLink":"regularLink",m=pg[U];if(!m||m.zoom!==n.zoom.value){m=Object.assign(document.createElement("canvas"),{zoom:n.zoom.value}),m.width=o*window.devicePixelRatio*n.zoom.value,m.height=u*window.devicePixelRatio*n.zoom.value,pg[U]=m;let g=m.getContext("2d");g.scale(window.devicePixelRatio*n.zoom.value,window.devicePixelRatio*n.zoom.value),g.fillStyle="#fff",g.fillRect(0,0,o,u),U==="elementLink"?g.drawImage(d3,0,0,o,u):g.drawImage(c3,0,0,o,u),g.restore()}t.drawImage(m,c-h,d-p,o,u),t.restore()}},p3=({canvas:e,rc:t,elementsMap:n,allElementsMap:a,visibleElements:i,scale:r,appState:s,renderConfig:l})=>{var m;if(e===null)return;let{renderGrid:c=!0,isExporting:d}=l,[o,u]=xp(e,r),h=yp({canvas:e,scale:r,normalizedWidth:o,normalizedHeight:u,theme:s.theme,isExporting:d,viewBackgroundColor:s.viewBackgroundColor});h.scale(s.zoom.value,s.zoom.value),c&&MP(h,s.gridSize,s.gridStep,s.scrollX,s.scrollY,s.zoom,o/s.zoom.value,u/s.zoom.value);let p=new Set;i.forEach(g=>{g.groupIds.length>0&&s.frameToHighlight&&s.selectedElementIds[g.id]&&(nr(g,s.frameToHighlight,n)||g.groupIds.find(b=>p.has(b)))&&g.groupIds.forEach(b=>p.add(b))});let U=new Map;i.filter(g=>!Pn(g)).forEach(g=>{var b;try{let v=g.frameId||((b=s.frameToHighlight)==null?void 0:b.id);if(q(g)&&g.containerId&&n.has(g.containerId))return;if(h.save(),v&&s.frameRendering.enabled&&s.frameRendering.clip){let y=X1(g,n,s);y&&Tg(g,y,s,n,U)&&hg(y,h,l,s),wr(g,n,a,t,h,l,s)}else wr(g,n,a,t,h,l,s);let x=ge(g,n);x&&wr(x,n,a,t,h,l,s),h.restore(),d||Ug(g,h,s,n)}catch(v){console.error(v,g.id,g.x,g.y,g.width,g.height)}}),i.filter(g=>Pn(g)).forEach(g=>{var b;try{let v=()=>{if(wr(g,n,a,t,h,l,s),Pn(g)&&(d||Un(g)&&l.embedsValidationStatus.get(g.id)!==!0)&&g.width&&g.height){let x=a3(g);wr(x,n,a,t,h,l,s)}d||Ug(g,h,s,n)};if((g.frameId||(b=s.frameToHighlight)!=null&&b.id)&&s.frameRendering.enabled&&s.frameRendering.clip){h.save();let x=X1(g,n,s);x&&Tg(g,x,s,n,U)&&hg(x,h,l,s),v(),h.restore()}else v()}catch(v){console.error(v)}}),(m=l.pendingFlowchartNodes)==null||m.forEach(g=>{try{wr(g,n,a,t,h,l,s)}catch(b){console.error(b)}})},U3=Ou(e=>{p3(e)},{trailing:!0}),m3=(e,t)=>{if(t){U3(e);return}p3(e)},IP=(e,t)=>{if(e.width<=t)return e;let n=document.createElement("canvas").getContext("2d");n.font=Ve({fontFamily:e.fontFamily,fontSize:e.fontSize});let a=e.text;if(n.measureText(a).width>t)for(let i=a.length;i>0;i--){let r=`${a.slice(0,i)}...`;if(n.measureText(r).width<=t){a=r;break}}return Ue(e,{text:a,width:t})},TP=(e,t)=>{let n=[];for(let a of e){if(de(a)){let i=Tn({x:a.x,y:a.y-ot.nameOffsetY,fontFamily:it.Helvetica,fontSize:ot.nameFontSize,lineHeight:ot.nameLineHeight,strokeColor:t.exportWithDarkMode?ot.nameColorDarkTheme:ot.nameColorLightTheme,text:N3(a)});i.y-=i.height,i=IP(i,a.width),n.push(i)}n.push(a)}return n},g3=(e,t)=>(t=t||za().frameRendering,{enabled:e?!0:t.enabled,outline:e?!1:t.outline,name:e?!1:t.name,clip:e?!0:t.clip}),b3=({elements:e,exportingFrame:t,frameRendering:n,exportWithDarkMode:a})=>{let i;return t?i=Np(e,t):n.enabled&&n.name?i=TP(e,{exportWithDarkMode:a}):i=e,i},v3=async(e,t,n,{exportBackground:a,exportPadding:i=dl,viewBackgroundColor:r,exportingFrame:s},l=(d,o)=>{let u=document.createElement("canvas");return u.width=d*t.exportScale,u.height=o*t.exportScale,{canvas:u,scale:t.exportScale}},c=async()=>{await fi.loadElementsFonts(e)})=>{await c();let d=g3(s??null,t.frameRendering??null);s&&(d.clip=!1);let o=b3({elements:e,exportingFrame:s,exportWithDarkMode:t.exportWithDarkMode,frameRendering:d});s&&(i=0);let[u,h,p,U]=Ep(s?[s]:Pp(o),i),{canvas:m,scale:g=1}=l(p,U),b=za(),{imageCache:v}=await l3({imageCache:new Map,fileIds:o3(o).map(x=>x.fileId),files:n});return m3({canvas:m,rc:lr.canvas(m),elementsMap:Hn(ce(o)),allElementsMap:Hn(ce(Va(e))),visibleElements:o,scale:g,appState:{...t,frameRendering:d,viewBackgroundColor:a?r:null,scrollX:-u+i,scrollY:-h+i,zoom:b.zoom,shouldCacheIgnoreZoom:!1,theme:t.exportWithDarkMode?ke.DARK:ke.LIGHT},renderConfig:{canvasBackgroundColor:r,imageCache:v,renderGrid:!1,isExporting:!0,embedsValidationStatus:new Map,elementsPendingErasure:new Set,pendingFlowchartNodes:null}}),m},Wl=e=>document.createComment(` ${e} `),wp=async(e,t,n,a)=>{let i=g3((a==null?void 0:a.exportingFrame)??null,t.frameRendering??null),{exportPadding:r=dl,exportWithDarkMode:s=!1,viewBackgroundColor:l,exportScale:c=1,exportEmbedScene:d}=t,{exportingFrame:o=null}=a||{},u=b3({elements:e,exportingFrame:o,exportWithDarkMode:s,frameRendering:i});o&&(r=0);let[h,p,U,m]=Ep(o?[o]:Pp(u),r),g=-h+r,b=-p+r,v=document.createElementNS(Le,"svg");v.setAttribute("version","1.1"),v.setAttribute("xmlns",Le),v.setAttribute("viewBox",`0 0 ${U} ${m}`),v.setAttribute("width",`${U*c}`),v.setAttribute("height",`${m*c}`),s&&v.setAttribute("filter",z0);let x=v.ownerDocument.createElementNS(Le,"defs"),y=v.ownerDocument.createElementNS(Le,"metadata");if(v.appendChild(Wl("svg-source:excalidraw")),v.appendChild(y),v.appendChild(x),d)try{_P({metadataElement:y,payload:sc(e,t,n||{},"local")})}catch(j){console.error(j)}let E=Dp(e);if(E.length){let j=ce(e);for(let A of E){let R=v.ownerDocument.createElementNS(Le,"clipPath");R.setAttribute("id",A.id);let[N,O,$,P]=pe(A,j),W=($-N)/2-(A.x-N),F=(P-O)/2-(A.y-O),Y=v.ownerDocument.createElementNS(Le,"rect");Y.setAttribute("transform",`translate(${A.x+g} ${A.y+b}) rotate(${A.angle} ${W} ${F})`),Y.setAttribute("width",`${A.width}`),Y.setAttribute("height",`${A.height}`),o||(Y.setAttribute("rx",`${ot.radius}`),Y.setAttribute("ry",`${ot.radius}`)),R.appendChild(Y),x.appendChild(R)}}let S=a!=null&&a.skipInliningFonts?[]:await fi.generateFontFaceDeclarations(e),w=`
|
|
37
|
+
`,k=v.ownerDocument.createElementNS(Le,"style");if(k.classList.add("style-fonts"),k.appendChild(document.createTextNode(`${w}${S.join(w)}`)),x.appendChild(k),t.exportBackground&&l){let j=v.ownerDocument.createElementNS(Le,"rect");j.setAttribute("x","0"),j.setAttribute("y","0"),j.setAttribute("width",`${U}`),j.setAttribute("height",`${m}`),j.setAttribute("fill",l),v.appendChild(j)}let T=lr.svg(v),_=(a==null?void 0:a.renderEmbeddables)??!1;return xP(u,Hn(ce(u)),T,v,n||{},{offsetX:g,offsetY:b,isExporting:!0,exportWithDarkMode:s,renderEmbeddables:_,frameRendering:i,canvasBackgroundColor:l,embedsValidationStatus:_?new Map(u.filter(j=>de(j)).map(j=>[j.id,!0])):new Map,reuseImages:(a==null?void 0:a.reuseImages)??!0}),v},_P=({payload:e,metadataElement:t})=>{let n=a4(JSON.stringify(r4({text:e})),!0);t.appendChild(Wl(`payload-type:${ae.excalidraw}`)),t.appendChild(Wl("payload-version:2")),t.appendChild(Wl("payload-start")),t.appendChild(document.createTextNode(n)),t.appendChild(Wl("payload-end"))},jP=({svg:e})=>{var t;if(e.includes(`payload-type:${ae.excalidraw}`)){let n=e.match(/<!-- payload-start -->\s*(.+?)\s*<!-- payload-end -->/);if(!n)throw new Error("INVALID");let a=(((t=e.match(/<!-- payload-version:(\d+) -->/))==null?void 0:t[1])||"1")!=="1";try{let i=i4(n[1],a),r=JSON.parse(i);if(!("encoded"in r)){if("type"in r&&r.type===Fn.excalidraw)return i;throw new Error("FAILED")}return s4(r)}catch(i){throw console.error(i),new Error("FAILED")}}throw new Error("INVALID")},Ep=(e,t)=>{let[n,a,i,r]=$e(e),s=qt(n,i)+t*2,l=qt(a,r)+t*2;return[n,a,s,l]},AP=(e,t,n)=>{let[,,a,i]=Ep(e,t).map(r=>Math.trunc(r*n));return[a,i]},RP=class{constructor(t){this.scoreFunction=t,L(this,"content",[])}sinkDown(t){let n=this.content[t];for(;t>0;){let a=(t+1>>1)-1,i=this.content[a];if(this.scoreFunction(n)<this.scoreFunction(i))this.content[a]=n,this.content[t]=i,t=a;else break}}bubbleUp(t){let n=this.content.length,a=this.content[t],i=this.scoreFunction(a);for(;;){let r=t+1<<1,s=r-1,l=null,c=0;if(s<n){let d=this.content[s];c=this.scoreFunction(d),c<i&&(l=s)}if(r<n){let d=this.content[r];this.scoreFunction(d)<(l===null?i:c)&&(l=r)}if(l!==null)this.content[t]=this.content[l],this.content[l]=a,t=l;else break}}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),a=this.content.pop();n<this.content.length&&(this.content[n]=a,this.scoreFunction(a)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}},Sp=1,Xe=40,LP=(e,t)=>{let n=e.fixedSegments?e.fixedSegments.slice():null;if(n){let a=[];e.points.map(s=>C(e.x+s[0],e.y+s[1])).forEach((s,l,c)=>{if(l<2)return a.push(s);let d=Ao(s,c[l-1]),o=Ao(c[l-1],c[l-2]);if(Ut(d,o)){let u=(n==null?void 0:n.findIndex(p=>p.index===l-1))??-1,h=(n==null?void 0:n.findIndex(p=>p.index===l))??-1;h!==-1&&(n[h].start=C(c[l-2][0]-e.x,c[l-2][1]-e.y)),u!==-1&&n.splice(u,1),a.splice(-1,1),n.forEach(p=>{p.index>l-1&&(p.index-=1)})}return a.push(s)});let i=[];a.forEach((s,l,c)=>{if(l<3)return i.push(s);if(Oe(c[l-2],c[l-1])<Sp){let d=(n==null?void 0:n.findIndex(h=>h.index===l-2))??-1,o=(n==null?void 0:n.findIndex(h=>h.index===l-1))??-1;o!==-1&&n.splice(o,1),d!==-1&&n.splice(d,1),i.splice(-2,2),n.forEach(h=>{h.index>l-2&&(h.index-=2)});let u=li(s,c[l-1]);return i.push(C(u?s[0]:c[l-2][0],u?c[l-2][1]:s[1]))}i.push(s)});let r=n.filter(s=>s.index!==1&&s.index!==i.length-1);return r.length===0?tr(Ip(Tp(Mp(e,kp(e,t,i.map(s=>C(s[0]-e.x,s[1]-e.y)),e.startBinding&&al(e.startBinding.elementId,t),e.endBinding&&al(e.endBinding.elementId,t)))??[])),r,null,null):(be.DEV&&nn(_p(i),"Invalid elbow points with fixed segments"),tr(i,r,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},DP=(e,t,n)=>{var k,T;let a=t.map(_=>_.index),i=(((k=e.fixedSegments)==null?void 0:k.map(_=>_.index))??[]).findIndex(_=>!a.includes(_));if(i===-1||!((T=e.fixedSegments)!=null&&T[i]))return{points:e.points};let r=e.fixedSegments[i].index,s=e.fixedSegments[i-1],l=e.fixedSegments[i+1],c=e.x+(s?s.end[0]:0),d=e.y+(s?s.end[1]:0),o=s?null:e.startBinding,u=l?null:e.endBinding,{startHeading:h,endHeading:p,startGlobalPoint:U,endGlobalPoint:m,hoveredStartElement:g,hoveredEndElement:b,...v}=kp({x:c,y:d,startBinding:o,endBinding:u,startArrowhead:null,endArrowhead:null,points:e.points},n,[C(0,0),C(e.x+((l==null?void 0:l.start[0])??e.points[e.points.length-1][0])-c,e.y+((l==null?void 0:l.start[1])??e.points[e.points.length-1][1])-d)],o&&al(o.elementId,n),u&&al(u.elementId,n),{isDragging:!1}),{points:x}=tr(Ip(Tp(Mp(e,{startHeading:h,endHeading:p,startGlobalPoint:U,endGlobalPoint:m,hoveredEndElement:b,...v})??[])),t,null,null),y=[];if(s)for(let _=0;_<s.index;_++)y.push(C(e.x+e.points[_][0],e.y+e.points[_][1]));if(x.forEach(_=>{y.push(C(e.x+(s?s.end[0]:0)+_[0],e.y+(s?s.end[1]:0)+_[1]))}),l)for(let _=l.index;_<e.points.length;_++)y.push(C(e.x+e.points[_][0],e.y+e.points[_][1]));let E=((l==null?void 0:l.index)??e.points.length)-((s==null?void 0:s.index)??0)-1,S=t.map(_=>_.index>r?{..._,index:_.index-E+(x.length-1)}:_),w=y.flatMap((_,j)=>{let A=y[j-1],R=y[j+1];if(A&&R){let N=Ao(_,A),O=Ao(R,_);if(Ut(N,O))return S.forEach($=>{$.index>j&&($.index-=1)}),[];if(Ut(N,y7(O)))return S.forEach($=>{$.index>j&&($.index+=1)}),[_,_]}return[_]});return tr(w,S,!1,!1)},PP=(e,t,n,a,i,r)=>{var E,S;let s=t.map((w,k)=>e.fixedSegments==null||e.fixedSegments[k]===void 0||e.fixedSegments[k].index!==w.index||(w.start[0]!==e.fixedSegments[k].start[0]&&w.end[0]!==e.fixedSegments[k].end[0])!=(w.start[1]!==e.fixedSegments[k].start[1]&&w.end[1]!==e.fixedSegments[k].end[1])?k:null).filter(w=>w!==null).shift();if(s==null)return{points:e.points};let l=((E=e.fixedSegments)==null?void 0:E.findIndex(w=>w.index===1))??-1,c=((S=e.fixedSegments)==null?void 0:S.findIndex(w=>w.index===e.points.length-1))??-1,d=Oe(t[s].start,t[s].end),o=d<Xe+5;if(l===-1&&t[s].index===1&&i){let w=ci(n),k=(w?Ut(n,ht):Ut(n,$t))?o?d/2:Xe:o?-d/2:-Xe;t[s].start=C(t[s].start[0]+(w?k:0),t[s].start[1]+(w?0:k))}if(c===-1&&t[s].index===e.points.length-1&&r){let w=ci(a),k=(w?Ut(a,ht):Ut(a,$t))?o?d/2:Xe:o?-d/2:-Xe;t[s].end=C(t[s].end[0]+(w?k:0),t[s].end[1]+(w?0:k))}let u=t.map(w=>({...w,start:C(e.x+w.start[0],e.y+w.start[1]),end:C(e.x+w.end[0],e.y+w.end[1])})),h=e.points.map((w,k)=>C(e.x+w[0],e.y+w[1])),p=u[s].index-1,U=u[s].index,m=u[s].start,g=u[s].end,b=h[p-1]&&!fa(h[p],h[p-1])?li(h[p-1],h[p]):void 0,v=h[U+1]&&!fa(h[U],h[U+1])?li(h[U+1],h[U]):void 0;if(b!==void 0){let w=b?1:0;h[p-1][w]=m[w]}if(h[p]=m,h[U]=g,v!==void 0){let w=v?1:0;h[U+1][w]=g[w]}let x=u.findIndex(w=>w.index===p);if(x!==-1){let w=li(u[x].end,u[x].start)?1:0;u[x].start[w]=m[w],u[x].end=m}let y=u.findIndex(w=>w.index===U+1);if(y!==-1){let w=li(u[y].end,u[y].start)?1:0;u[y].end[w]=g[w],u[y].start=g}if(l===-1&&p===0){let w=i?ci(n):li(h[1],h[0]);h.unshift(C(w?m[0]:e.x+e.points[0][0],w?e.y+e.points[0][1]:m[1])),i&&h.unshift(C(e.x+e.points[0][0],e.y+e.points[0][1]));for(let k of u)k.index+=i?2:1}if(c===-1&&U===e.points.length-1){let w=ci(a);h.push(C(w?g[0]:e.x+e.points[e.points.length-1][0],w?e.y+e.points[e.points.length-1][1]:g[1])),r&&h.push(C(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return tr(h,u.map(w=>({...w,start:C(w.start[0]-e.x,w.start[1]-e.y),end:C(w.end[0]-e.x,w.end[1]-e.y)})),!1,!1)},NP=(e,t,n,a,i,r,s,l,c)=>{let d=e.startIsSpecial??null,o=e.endIsSpecial??null,u=t.map((g,b)=>b===0||b===t.length-1?C(e.x+g[0],e.y+g[1]):C(e.x+e.points[b][0],e.y+e.points[b][1])),h=n.map(g=>({...g,start:C(e.x+(g.start[0]-t[0][0]),e.y+(g.start[1]-t[0][1])),end:C(e.x+(g.end[0]-t[0][0]),e.y+(g.end[1]-t[0][1]))})),p=[],U=2+(d?1:0),m=2+(o?1:0);for(;p.length+U<u.length-m;)p.push(u[p.length+U]);{let g=u[d?2:1],b=u[d?3:2],v=ci(a),x=ci(qr(re(g,b)));if(l&&v===x){let y=v?Ut(a,ht):Ut(a,$t);if(p.unshift(C(x?r[0]+(y?Xe:-Xe):b[0],x?b[1]:r[1]+(y?Xe:-Xe))),p.unshift(C(v?r[0]+(y?Xe:-Xe):r[0],v?r[1]:r[1]+(y?Xe:-Xe))),!d){d=!0;for(let E of h)E.index>1&&(E.index+=1)}}else if(p.unshift(C(x?r[0]:g[0],x?g[1]:r[1])),d){d=!1;for(let y of h)y.index>1&&(y.index-=1)}p.unshift(r)}{let g=u[u.length-(o?3:2)],b=u[u.length-(o?4:3)],v=ci(i),x=li(b,g);if(c&&v===x){let y=v?Ut(i,ht):Ut(i,$t);p.push(C(x?s[0]+(y?Xe:-Xe):b[0],x?b[1]:s[1]+(y?Xe:-Xe))),p.push(C(v?s[0]+(y?Xe:-Xe):s[0],v?s[1]:s[1]+(y?Xe:-Xe))),o||(o=!0)}else p.push(C(x?s[0]:g[0],x?g[1]:s[1])),o&&(o=!1)}return p.push(s),tr(p,h.map(({index:g})=>({index:g,start:p[g-1],end:p[g]})).map(g=>({...g,start:C(g.start[0]-r[0],g.start[1]-r[1]),end:C(g.end[0]-r[0],g.end[1]-r[1])})),d,o)},Ke=1e6,Cp=(e,t,n,a)=>{var b,v,x,y,E,S,w,k,T,_,j,A,R,N,O,$,P,W,F,Y,Q,le,ie,Te,_e;if(e.points.length<2)return{points:n.points??e.points};(e.x<-Ke||e.x>Ke||e.y<-Ke||e.y>Ke||e.x+(((x=(v=n==null?void 0:n.points)==null?void 0:v[((b=n==null?void 0:n.points)==null?void 0:b.length)-1])==null?void 0:x[0])??0)<-Ke||e.x+(((S=(E=n==null?void 0:n.points)==null?void 0:E[((y=n==null?void 0:n.points)==null?void 0:y.length)-1])==null?void 0:S[0])??0)>Ke||e.y+(((T=(k=n==null?void 0:n.points)==null?void 0:k[((w=n==null?void 0:n.points)==null?void 0:w.length)-1])==null?void 0:T[1])??0)<-Ke||e.y+(((A=(j=n==null?void 0:n.points)==null?void 0:j[((_=n==null?void 0:n.points)==null?void 0:_.length)-1])==null?void 0:A[1])??0)>Ke||e.x+(((O=(N=e==null?void 0:e.points)==null?void 0:N[((R=e==null?void 0:e.points)==null?void 0:R.length)-1])==null?void 0:O[0])??0)<-Ke||e.x+(((W=(P=e==null?void 0:e.points)==null?void 0:P[(($=e==null?void 0:e.points)==null?void 0:$.length)-1])==null?void 0:W[0])??0)>Ke||e.y+(((Q=(Y=e==null?void 0:e.points)==null?void 0:Y[((F=e==null?void 0:e.points)==null?void 0:F.length)-1])==null?void 0:Q[1])??0)<-Ke||e.y+(((Te=(ie=e==null?void 0:e.points)==null?void 0:ie[((le=e==null?void 0:e.points)==null?void 0:le.length)-1])==null?void 0:Te[1])??0)>Ke)&&console.error("Elbow arrow (or update) is outside reasonable bounds (> 1e6)",{arrow:e,updates:n}),e.x=Se(e.x,-Ke,Ke),e.y=Se(e.y,-Ke,Ke),n.points&&(n.points=n.points.map(([Ie,oe])=>C(Se(Ie,-Ke,Ke),Se(oe,-Ke,Ke))));let i=n.points?n.points&&n.points.length===2?e.points.map((Ie,oe)=>oe===0?n.points[0]:oe===e.points.length-1?n.points[1]:Ie):n.points.slice():e.points.slice(),r=typeof n.startBinding<"u"?n.startBinding:e.startBinding,s=typeof n.endBinding<"u"?n.endBinding:e.endBinding,l=r&&al(r.elementId,t),c=s&&al(s.elementId,t);if(t.size===0&&_p(i)||(l==null?void 0:l.id)!==(r==null?void 0:r.elementId)||(c==null?void 0:c.id)!==(s==null?void 0:s.elementId))return tr(i.map(Ie=>C(e.x+Ie[0],e.y+Ie[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:d,endHeading:o,startGlobalPoint:u,endGlobalPoint:h,hoveredStartElement:p,hoveredEndElement:U,...m}=kp({x:e.x,y:e.y,startBinding:r,endBinding:s,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,i,l,c,a),g=n.fixedSegments??e.fixedSegments??[];return!n.points&&!n.fixedSegments&&!n.startBinding&&!n.endBinding?LP(e,t):n.startBinding===e.startBinding&&n.endBinding===e.endBinding&&(n.points??[]).every((Ie,oe)=>fa(Ie,e.points[oe]??C(1/0,1/0)))?{}:g.length===0?tr(Ip(Tp(Mp(e,{startHeading:d,endHeading:o,startGlobalPoint:u,endGlobalPoint:h,hoveredEndElement:U,...m})??[])),g,null,null):(((_e=e.fixedSegments)==null?void 0:_e.length)??0)>g.length?DP(e,g,t):n.points?n.points&&n.fixedSegments?n:NP(e,i,g,d,o,u,h,p,U):PP(e,g,d,o,p,U)},kp=(e,t,n,a,i,r)=>{var w,k;let s=Xd(n[0],Ht(e.x,e.y)),l=Xd(n[n.length-1],Ht(e.x,e.y)),c=a,d=i;if(r!=null&&r.isDragging){let T=Array.from(t.values());c=vg(s,t,T,r==null?void 0:r.zoom)||a,d=vg(l,t,T,r==null?void 0:r.zoom)||i}let o=gg({...e,points:n},"start",(w=e.startBinding)==null?void 0:w.fixedPoint,s,a,c,r==null?void 0:r.isDragging),u=gg({...e,points:n},"end",(k=e.endBinding)==null?void 0:k.fixedPoint,l,i,d,r==null?void 0:r.isDragging),h=bg(o,u,t,c,s),p=bg(u,o,t,d,l),U=[o[0]-2,o[1]-2,o[0]+2,o[1]+2],m=[u[0]-2,u[1]-2,u[0]+2,u[1]+2],g=c?ja(c,_i(h,e.startArrowhead?Je*6:Je*2,1)):U,b=d?ja(d,_i(p,e.endArrowhead?Je*6:Je*2,1)):m,v=qs(o,d?ja(d,_i(p,Xe,Xe)):m)||qs(u,c?ja(c,_i(h,Xe,Xe)):U),x=x3(v?[U,m]:[g,b]),y=FP(v?U:g,v?m:b,x,v?_i(h,!c&&!d?0:Xe,0):_i(h,!c&&!d?0:Xe-(e.startArrowhead?Je*6:Je*2),Xe),v?_i(p,!c&&!d?0:Xe,0):_i(p,!c&&!d?0:Xe-(e.endArrowhead?Je*6:Je*2),Xe),v,c&&ja(c),d&&ja(d)),E=mg(y[0],h,o),S=mg(y[1],p,u);return{dynamicAABBs:y,startDonglePosition:E,startGlobalPoint:o,startHeading:h,endDonglePosition:S,endGlobalPoint:u,endHeading:p,commonBounds:x,hoveredStartElement:c,hoveredEndElement:d,boundsOverlap:v,startElementBounds:g,endElementBounds:b}},Mp=(e,t)=>{let{dynamicAABBs:n,startDonglePosition:a,startGlobalPoint:i,startHeading:r,endDonglePosition:s,endGlobalPoint:l,endHeading:c,commonBounds:d,hoveredEndElement:o}=t,u=zP(n,a||i,r,s||l,c,d),h=a&&Pc(a,u),p=s&&Pc(s,u),U=Pc(l,u);U&&o&&(U.closed=!0);let m=Pc(i,u);m&&e.startBinding&&(m.closed=!0);let g=h&&p&&(qs(h.pos,n[1])||qs(p.pos,n[0])),b=OP(h||m,p||U,u,r||ht,c||ht,g?[]:n);if(b){let v=b.map(x=>[x.pos[0],x.pos[1]]);return h&&v.unshift(i),p&&v.push(l),v}return null},_i=(e,t,n)=>{switch(e){case gn:return[t,n,n,n];case ht:return[n,t,n,n];case $t:return[n,n,t,n]}return[n,n,n,t]},OP=(e,t,n,a,i,r)=>{let s=Uh(e.pos,t.pos),l=new RP(c=>c.f);for(l.push(e);l.size()>0;){let c=l.pop();if(!c||c.closed)continue;if(c===t)return $P(e,c);c.closed=!0;let d=HP(c.addr,n);for(let o=0;o<4;o++){let u=d[o];if(!u||u.closed)continue;let h=ti(u.pos,c.pos,.5);if(fM(...r.map(x=>qs(h,x))))continue;let p=XP(o),U=c.parent?qr(re(c.pos,c.parent.pos)):a,m=y7(U);if(Ut(m,p)||xg(e.addr,u.addr)&&Ut(p,a)||xg(t.addr,u.addr)&&Ut(p,i))continue;let g=U!==p,b=c.g+Uh(u.pos,c.pos)+(g?Math.pow(s,3):0),v=u.visited;if(!v||b<u.g){let x=BP(u,t,p,i);u.visited=!0,u.parent=c,u.h=Uh(t.pos,u.pos)+x*Math.pow(s,2),u.g=b,u.f=u.g+u.h,v?l.rescoreElement(u):l.push(u)}}}return null},$P=(e,t)=>{let n=t,a=[];for(;n.parent;)a.unshift(n),n=n.parent;return a.unshift(e),a},Uh=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),FP=(e,t,n,a,i,r,s,l)=>{let c=s??e,d=l??t,[o,u,h,p]=a??[0,0,0,0],[U,m,g,b]=i??[0,0,0,0],v=[e[0]>t[2]?e[1]>t[3]||e[3]<t[1]?Math.min((c[0]+d[2])/2,e[0]-p):(c[0]+d[2])/2:e[0]>t[0]?e[0]-p:n[0]-p,e[1]>t[3]?e[0]>t[2]||e[2]<t[0]?Math.min((c[1]+d[3])/2,e[1]-o):(c[1]+d[3])/2:e[1]>t[1]?e[1]-o:n[1]-o,e[2]<t[0]?e[1]>t[3]||e[3]<t[1]?Math.max((c[2]+d[0])/2,e[2]+u):(c[2]+d[0])/2:e[2]<t[2]?e[2]+u:n[2]+u,e[3]<t[1]?e[0]>t[2]||e[2]<t[0]?Math.max((c[3]+d[1])/2,e[3]+h):(c[3]+d[1])/2:e[3]<t[3]?e[3]+h:n[3]+h],x=[t[0]>e[2]?t[1]>e[3]||t[3]<e[1]?Math.min((d[0]+c[2])/2,t[0]-b):(d[0]+c[2])/2:t[0]>e[0]?t[0]-b:n[0]-b,t[1]>e[3]?t[0]>e[2]||t[2]<e[0]?Math.min((d[1]+c[3])/2,t[1]-U):(d[1]+c[3])/2:t[1]>e[1]?t[1]-U:n[1]-U,t[2]<e[0]?t[1]>e[3]||t[3]<e[1]?Math.max((d[2]+c[0])/2,t[2]+m):(d[2]+c[0])/2:t[2]<e[2]?t[2]+m:n[2]+m,t[3]<e[1]?t[0]>e[2]||t[2]<e[0]?Math.max((d[3]+c[1])/2,t[3]+g):(d[3]+c[1])/2:t[3]<e[3]?t[3]+g:n[3]+g],y=x3([v,x]);if(!r&&v[2]-v[0]+x[2]-x[0]>y[2]-y[0]+1e-11&&v[3]-v[1]+x[3]-x[1]>y[3]-y[1]+1e-11){let[E,S]=[(x[0]+x[2])/2,(x[1]+x[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let w=v[2]+(x[0]-v[2])/2,k=x[3]+(v[1]-x[3])/2;return At(Ht(e[2]-E,e[1]-S),Ht(e[0]-E,e[3]-S))>0?[[v[0],v[1],w,v[3]],[w,x[1],x[2],x[3]]]:[[v[0],k,v[2],v[3]],[x[0],x[1],x[2],k]]}else if(e[2]<t[0]&&e[3]<t[1]){let w=v[2]+(x[0]-v[2])/2,k=v[3]+(x[1]-v[3])/2;return At(Ht(e[0]-E,e[1]-S),Ht(e[2]-E,e[3]-S))>0?[[v[0],v[1],v[2],k],[x[0],k,x[2],x[3]]]:[[v[0],v[1],w,v[3]],[w,x[1],x[2],x[3]]]}else if(e[0]>t[2]&&e[3]<t[1]){let w=x[2]+(v[0]-x[2])/2,k=v[3]+(x[1]-v[3])/2;return At(Ht(e[2]-E,e[1]-S),Ht(e[0]-E,e[3]-S))>0?[[w,v[1],v[2],v[3]],[x[0],x[1],w,x[3]]]:[[v[0],v[1],v[2],k],[x[0],k,x[2],x[3]]]}else if(e[0]>t[2]&&e[1]>t[3]){let w=x[2]+(v[0]-x[2])/2,k=x[3]+(v[1]-x[3])/2;return At(Ht(e[0]-E,e[1]-S),Ht(e[2]-E,e[3]-S))>0?[[w,v[1],v[2],v[3]],[x[0],x[1],w,x[3]]]:[[v[0],k,v[2],v[3]],[x[0],x[1],x[2],k]]}}return[v,x]},zP=(e,t,n,a,i,r)=>{let s=new Set,l=new Set;n===mn||n===ht?l.add(t[1]):s.add(t[0]),i===mn||i===ht?l.add(a[1]):s.add(a[0]),e.forEach(o=>{s.add(o[0]),s.add(o[2]),l.add(o[1]),l.add(o[3])}),s.add(r[0]),s.add(r[2]),l.add(r[1]),l.add(r[3]);let c=Array.from(l).sort((o,u)=>o-u),d=Array.from(s).sort((o,u)=>o-u);return{row:c.length,col:d.length,data:c.flatMap((o,u)=>d.map((h,p)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[p,u],pos:[h,o]})))}},mg=(e,t,n)=>{switch(t){case gn:return C(n[0],e[1]);case ht:return C(e[2],n[1]);case $t:return C(n[0],e[3])}return C(e[0],n[1])},BP=(e,t,n,a)=>{if(a===ht)switch(n){case ht:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case gn:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case $t:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case mn:return e.pos[1]===t.pos[1]?4:2}else if(a===mn)switch(n){case ht:return e.pos[1]===t.pos[1]?4:2;case gn:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case $t:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case mn:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(a===gn)switch(n){case ht:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case gn:return e.pos[1]>=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case $t:return e.pos[0]===t.pos[0]?4:2;case mn:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(a===$t)switch(n){case ht:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case gn:return e.pos[0]===t.pos[0]?4:2;case $t:return e.pos[1]<=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case mn:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3}return 0},HP=([e,t],n)=>[Vl([e,t-1],n),Vl([e+1,t],n),Vl([e,t+1],n),Vl([e-1,t],n)],Vl=([e,t],n)=>e<0||e>=n.col||t<0||t>=n.row?null:n.data[t*n.col+e]??null,Pc=(e,t)=>{for(let n=0;n<t.col;n++)for(let a=0;a<t.row;a++){let i=Vl([n,a],t);if(i&&e[0]===i.pos[0]&&e[1]===i.pos[1])return i}return null},x3=e=>[Math.min(...e.map(t=>t[0])),Math.min(...e.map(t=>t[1])),Math.max(...e.map(t=>t[2])),Math.max(...e.map(t=>t[3]))],al=(e,t)=>{let n=t.get(e);return n&&ha(n)?n:null},tr=(e,t,n,a)=>{let i=e[0][0],r=e[0][1],s=e.map(l=>Xd(l,pt(re(e[0]),-1)));return(i<-Ke||i>Ke||r<-Ke||r>Ke||i+s[s.length-1][0]<-Ke||r+s[s.length-1][0]>Ke||i+s[s.length-1][1]<-Ke||r+s[s.length-1][1]>Ke)&&console.error("Elbow arrow normalization is outside reasonable bounds (> 1e6)",{x:i,y:r,points:s,...Qs(s)}),s=s.map(([l,c])=>C(Se(l,-1e6,1e6),Se(c,-1e6,1e6))),{points:s,x:Se(i,-1e6,1e6),y:Se(r,-1e6,1e6),fixedSegments:((t==null?void 0:t.length)??0)>0?t:null,...Qs(s),startIsSpecial:n,endIsSpecial:a}},Ip=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1])<Math.abs(e[0][0]-e[1][0]);return e.filter((n,a)=>{if(a===0||a===e.length-1)return!0;let i=e[a+1],r=Math.abs(n[1]-i[1])<Math.abs(n[0]-i[0]);return t===r?(t=r,!1):(t=r,!0)})}return e},Tp=e=>e.length>=4?e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let a=e[n-1];return Oe(a,t)>Sp}):e,XP=e=>{switch(e){case 0:return gn;case 1:return ht;case 2:return $t}return mn},gg=(e,t,n,a,i,r,s)=>{if(s){if(r){let l=Ro(e,r,t);return bD(r,l)}return a}if(i){let l=P1(n||[0,0],i);return Math.abs(Gu(i,l)-Je)>.01?Ro(e,i,t):l}return a},bg=(e,t,n,a,i)=>pD(e,t,a,a&&ja(a,Array(4).fill(Gu(a,e))),n,i),vg=(e,t,n,a)=>ra(aa(e),n,t,a,!0,!0),xg=(e,t)=>e[0]===t[0]&&e[1]===t[1],_p=(e,t=Sp)=>e.slice(1).map((n,a)=>Math.abs(n[0]-e[a][0])<t||Math.abs(n[1]-e[a][1])<t).every(Boolean),WP={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1,custom:!0,frame:!0,embeddable:!0,hand:!0,laser:!1,magicframe:!1},VP=e=>Object.keys(it).includes(e)?it[e]:or,ms=(e,t)=>{if(!t)return null;let n=t.focus||0;return ee(e)?Yd(t)?{...t,focus:n,fixedPoint:qu(t.fixedPoint??[0,0])}:null:{...t,focus:n}},ji=(e,t)=>{let n={type:t.type||e.type,version:e.version||1,versionNonce:e.versionNonce??0,index:e.index??null,isDeleted:e.isDeleted??!1,id:e.id||Vn(),fillStyle:e.fillStyle||ft.fillStyle,strokeWidth:e.strokeWidth||ft.strokeWidth,strokeStyle:e.strokeStyle??ft.strokeStyle,roughness:e.roughness??ft.roughness,opacity:e.opacity==null?ft.opacity:e.opacity,angle:e.angle||0,x:t.x??e.x??0,y:t.y??e.y??0,strokeColor:e.strokeColor||ft.strokeColor,backgroundColor:e.backgroundColor||ft.backgroundColor,width:e.width||0,height:e.height||0,seed:e.seed??1,groupIds:e.groupIds??[],frameId:e.frameId??null,roundness:e.roundness?e.roundness:e.strokeSharpness==="round"?{type:fl(e.type)?St.LEGACY:St.PROPORTIONAL_RADIUS}:null,boundElements:e.boundElementIds?e.boundElementIds.map(a=>({type:"arrow",id:a})):e.boundElements??[],updated:e.updated??ul(),link:e.link?yn(e.link):null,locked:e.locked??!1};return("customData"in e||"customData"in t)&&(n.customData="customData"in t?t.customData:e.customData),{...e,...n,...z3(n),...t}},GP=e=>{switch(e={...e},e.type){case"text":delete e.rawText;let t=e.fontSize,n=e.fontFamily;if("font"in e){let[o,u]=e.font.split(" ");t=parseFloat(o),n=VP(u)}let a=typeof e.text=="string"&&e.text||"",i=e.lineHeight||(e.height?bM(e):Kr(e.fontFamily));return e=ji(e,{fontSize:t,fontFamily:n,text:a,textAlign:e.textAlign||Jo,verticalAlign:e.verticalAlign||Nd,containerId:e.containerId??null,originalText:e.originalText||a,autoResize:e.autoResize??!0,lineHeight:i}),!a&&!e.isDeleted&&(e={...e,originalText:a,isDeleted:!0},e=uc(e)),e;case"freedraw":return ji(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return ji(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1],crop:e.crop??null});case"line":case"draw":let{startArrowhead:r=null,endArrowhead:s=null}=e,l=e.x,c=e.y,d=!Array.isArray(e.points)||e.points.length<2?[C(0,0),C(e.width,e.height)]:e.points;return(d[0][0]!==0||d[0][1]!==0)&&({points:d,x:l,y:c}=J.getNormalizedPoints(e)),ji(e,{type:e.type==="draw"?"line":e.type,startBinding:ms(e,e.startBinding),endBinding:ms(e,e.endBinding),lastCommittedPoint:null,startArrowhead:r,endArrowhead:s,points:d,x:l,y:c,...Qs(d)});case"arrow":{let{startArrowhead:o=null,endArrowhead:u="arrow"}=e,h=e.x,p=e.y,U=!Array.isArray(e.points)||e.points.length<2?[C(0,0),C(e.width,e.height)]:e.points;(U[0][0]!==0||U[0][1]!==0)&&({points:U,x:h,y:p}=J.getNormalizedPoints(e));let m={type:e.type,startBinding:ms(e,e.startBinding),endBinding:ms(e,e.endBinding),lastCommittedPoint:null,startArrowhead:o,endArrowhead:u,points:U,x:h,y:p,elbowed:e.elbowed,...Qs(U)};return ee(e)?ji(e,{...m,elbowed:!0,startBinding:ms(e,e.startBinding),endBinding:ms(e,e.endBinding),fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}):ji(e,m)}case"ellipse":case"rectangle":case"diamond":case"iframe":case"embeddable":return ji(e,{});case"magicframe":case"frame":return ji(e,{name:e.name??null})}return null},YP=(e,t)=>{if(e.boundElements){let n=e.boundElements.slice(),a=new Set;e.boundElements=n.reduce((i,r)=>{let s=t.get(r.id);if(s&&!a.has(r.id)){if(a.add(r.id),s.isDeleted)return i;i.push(r),q(s)&&!s.containerId&&(s.containerId=e.id)}return i},[])}},ZP=(e,t)=>{let n=e.containerId?t.get(e.containerId):null;if(!n){e.containerId=null;return}if(!e.isDeleted&&n.boundElements&&!n.boundElements.find(a=>a.id===e.id)){let a=(n.boundElements||(n.boundElements=[])).slice();a.push({type:"text",id:e.id}),n.boundElements=a}},KP=(e,t)=>{e.frameId&&(t.get(e.frameId)||(e.frameId=null))},af=(e,t,n)=>{let a=new Set,i=t?ce(t):null,r=Va((e||[]).reduce((l,c)=>{if(c.type!=="selection"&&!Qr(c)){let d=GP(c);if(d){let o=i==null?void 0:i.get(c.id);o&&o.version>d.version&&(d=uc(d,o.version)),a.has(d.id)&&(d={...d,id:Vn()}),a.add(d.id),l.push(d)}}return l},[]));if(!(n!=null&&n.repairBindings))return r;let s=ce(r);for(let l of r)l.frameId&&KP(l,s),q(l)&&l.containerId?ZP(l,s):l.boundElements&&YP(l,s),n.refreshDimensions&&q(l)&&Object.assign(l,Z7(l,zt(l,s),s)),fe(l)&&(l.startBinding&&(!s.has(l.startBinding.elementId)||!xe(l))&&(l.startBinding=null),l.endBinding&&(!s.has(l.endBinding.elementId)||!xe(l))&&(l.endBinding=null));return r.map(l=>{if(ee(l)&&l.startBinding==null&&l.endBinding==null&&!_p(l.points))return{...l,...Cp(l,s,{points:[C(0,0),l.points[l.points.length-1]]}),index:l.index};if(ee(l)&&l.startBinding&&l.endBinding&&l.startBinding.elementId===l.endBinding.elementId&&l.points.length>1&&l.points.some(([c,d])=>Math.abs(c)>1e6||Math.abs(d)>1e6)){console.error("Fixing self-bound elbow arrow",l.id);let c=s.get(l.startBinding.elementId);return c?{...l,x:c.x+c.width/2,y:c.y-5,width:c.width,height:c.height,points:[C(0,0),C(0,-10),C(c.width/2+5,-10),C(c.width/2+5,c.height/2+5)]}:(console.error("Bound element not found",l.startBinding.elementId),l)}return l})},qP=(e,t,n)=>{let a=t[e];return a!==void 0?a:n[e]},yg={isSidebarDocked:(e,t)=>["defaultSidebarDockedPreference",e.isSidebarDocked??qP("defaultSidebarDockedPreference",e,t)]},y3=(e,t)=>{var i;e=e||{};let n=za(),a={};for(let r of Object.keys(yg))if(r in e){let[s,l]=yg[r](e,n);a[s]=l}for(let[r,s]of Object.entries(n)){let l=e[r],c=t?t[r]:void 0;a[r]=l!==void 0?l:c!==void 0?c:s}return{...a,cursorButton:(t==null?void 0:t.cursorButton)||"up",penDetected:(t==null?void 0:t.penDetected)??(e.penMode?e.penDetected??!1:!1),activeTool:{...Et(n,a.activeTool.type&&WP[a.activeTool.type]?a.activeTool:{type:"selection"}),lastActiveTool:null,locked:a.activeTool.locked??!1},zoom:{value:di(ao(e.zoom)?e.zoom:((i=e.zoom)==null?void 0:i.value)??n.zoom.value)},openSidebar:typeof e.openSidebar=="string"?{name:oa.name}:a.openSidebar,gridSize:kD(ao(e.gridSize)?e.gridSize:$d),gridStep:L7(ao(e.gridStep)?e.gridStep:a8),editingFrame:null}},lc=(e,t,n,a)=>({elements:af(e==null?void 0:e.elements,n,a),appState:y3(e==null?void 0:e.appState,t||null),files:(e==null?void 0:e.files)||{}}),wg=e=>{let t=af(Ye(e.elements),null);return t.length?{...e,elements:t}:null},oc=(e=[],t)=>{let n=[];for(let a of e)if(Array.isArray(a)){let i=wg({status:t,elements:a,id:Vn(),created:Date.now()});i&&n.push(i)}else{let i=a,r=wg({...i,id:i.id||Vn(),status:i.status||t,created:i.created||Date.now()});r&&n.push(r)}return n},ta=32,qe=12,Ki=256,w3=50,kr="NOT_SPREADSHEET",$o="VALID_SPREADSHEET",Gl=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},mh=(e,t)=>e.slice(1).every(n=>Gl(n[t])!==null),Eg=e=>{let t=e[0].length;if(t>2)return{type:kr,reason:"More than 2 columns"};if(t===1){if(!mh(e,0))return{type:kr,reason:"Value is not numeric"};let c=Gl(e[0][0])===null,d=(c?e.slice(1):e).map(o=>Gl(o[0]));return d.length<2?{type:kr,reason:"Less than two rows"}:{type:$o,spreadsheet:{title:c?e[0][0]:null,labels:null,values:d}}}let n=mh(e,0),a=mh(e,1);if(!n&&!a)return{type:kr,reason:"Value is not numeric"};let[i,r]=a?[0,1]:[1,0],s=Gl(e[0][r])===null,l=s?e.slice(1):e;return l.length<2?{type:kr,reason:"Less than 2 rows"}:{type:$o,spreadsheet:{title:s?e[0][r]:null,labels:l.map(c=>c[i]),values:l.map(c=>Gl(c[r]))}}},JP=e=>{let t=[];for(let n=0;n<e[0].length;n++){let a=[];for(let i=0;i<e.length;i++)a.push(e[i][n]);t.push(a)}return t},QP=e=>{let t=e.trim().split(`
|
|
38
|
+
`).map(i=>i.trim().split(" "));if(t.length&&t[0].length!==2&&(t=e.trim().split(`
|
|
39
|
+
`).map(i=>i.trim().split(","))),t.length===0)return{type:kr,reason:"No values"};let n=t[0].length;if(!t.every(i=>i.length===n))return{type:kr,reason:"All rows don't have same number of columns"};let a=Eg(t);if(a.type!==$o){let i=Eg(JP(t));if(i.type===$o)return i}return a},ou=rk(nk),zn={fillStyle:"hachure",fontFamily:or,fontSize:Ci,opacity:100,roughness:1,strokeColor:we.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:Mn.MIDDLE,locked:!1},E3=e=>{let t=(ta+qe)*e.values.length+qe,n=Ki+qe*2;return{chartWidth:t,chartHeight:n}},eN=(e,t,n,a,i)=>{var r;return((r=e.labels)==null?void 0:r.map((s,l)=>Tn({groupIds:[a],backgroundColor:i,...zn,text:s.length>8?`${s.slice(0,5)}...`:s,x:t+l*(ta+qe)+qe*2,y:n+qe/2,width:ta,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))||[]},tN=(e,t,n,a,i)=>{let r=Tn({groupIds:[a],backgroundColor:i,...zn,x:t-qe,y:n-qe,text:"0",textAlign:"right"}),s=Tn({groupIds:[a],backgroundColor:i,...zn,x:t-qe,y:n-Ki-r.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[r,s]},nN=(e,t,n,a,i)=>{let{chartWidth:r,chartHeight:s}=E3(e),l=Nr({backgroundColor:i,groupIds:[a],...zn,type:"line",x:t,y:n,width:r,points:[C(0,0),C(r,0)]}),c=Nr({backgroundColor:i,groupIds:[a],...zn,type:"line",x:t,y:n,height:s,points:[C(0,0),C(0,-s)]}),d=Nr({backgroundColor:i,groupIds:[a],...zn,type:"line",x:t,y:n-Ki-qe,strokeStyle:"dotted",width:r,opacity:w3,points:[C(0,0),C(r,0)]});return[l,c,d]},S3=(e,t,n,a,i,r)=>{let{chartWidth:s,chartHeight:l}=E3(e),c=e.title?Tn({backgroundColor:i,groupIds:[a],...zn,text:e.title,x:t+s/2,y:n-Ki-qe*2-Ci,roundness:null,textAlign:"center"}):null,d=r?Xa({backgroundColor:i,groupIds:[a],...zn,type:"rectangle",x:t,y:n-l,width:s,height:l,strokeColor:we.black,fillStyle:"solid",opacity:6}):null;return[...d?[d]:[],...c?[c]:[],...eN(e,t,n,a,i),...tN(e,t,n,a,i),...nN(e,t,n,a,i)]},aN=(e,t,n)=>{let a=Math.max(...e.values),i=Vn(),r=ou[Math.floor(Math.random()*ou.length)];return[...e.values.map((s,l)=>{let c=s/a*Ki;return Xa({backgroundColor:r,groupIds:[i],...zn,type:"rectangle",x:t+l*(ta+qe)+qe,y:n-c-qe,width:ta,height:c})}),...S3(e,t,n,i,r,be.DEV)]},iN=(e,t,n)=>{let a=Math.max(...e.values),i=Vn(),r=ou[Math.floor(Math.random()*ou.length)],s=0,l=[];for(let m of e.values){let g=s*(ta+qe),b=-(m/a)*Ki;l.push([g,b]),s++}let c=Math.max(...l.map(m=>m[0])),d=Math.max(...l.map(m=>m[1])),o=Math.min(...l.map(m=>m[0])),u=Math.min(...l.map(m=>m[1])),h=Nr({backgroundColor:r,groupIds:[i],...zn,type:"line",x:t+qe+ta/2,y:n-qe,height:d-u,width:c-o,strokeWidth:2,points:l}),p=e.values.map((m,g)=>{let b=g*(ta+qe)+qe/2,v=-(m/a)*Ki+qe/2;return Xa({backgroundColor:r,groupIds:[i],...zn,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+b+ta/2,y:n+v-qe*2,width:qe,height:qe})}),U=e.values.map((m,g)=>{let b=g*(ta+qe)+qe/2,v=m/a*Ki+qe/2+qe;return Nr({backgroundColor:r,groupIds:[i],...zn,type:"line",x:t+b+ta/2+qe/2,y:n-v,height:v,strokeStyle:"dotted",opacity:w3,points:[C(0,0),C(0,v)]})});return[...S3(e,t,n,i,r,be.DEV),h,...U,...p]},rN=(e,t,n,a)=>e==="line"?iN(t,n,a):aN(t,n,a),jp="clipboard"in navigator&&"writeText"in navigator.clipboard,Ap="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,sN=e=>!!([Fn.excalidraw,Fn.excalidrawClipboard,Fn.excalidrawClipboardWithAPI].includes(e==null?void 0:e.type)&&Array.isArray(e.elements)),lN=({types:e,files:t})=>{var a,i,r,s;!e&&!t&&console.warn("createPasteEvent: no types or files provided");let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});if(e)for(let[l,c]of Object.entries(e)){if(typeof c!="string"){t=t||[],t.push(c);continue}try{if((a=n.clipboardData)==null||a.setData(l,c),((i=n.clipboardData)==null?void 0:i.getData(l))!==c)throw new Error(`Failed to set "${l}" as clipboardData item`)}catch(d){throw new Error(d.message)}}if(t){let l=-1;for(let c of t){l++;try{if((r=n.clipboardData)==null||r.items.add(c),((s=n.clipboardData)==null?void 0:s.files[l])!==c)throw new Error(`Failed to set file "${c.name}" as clipboardData item`)}catch(d){throw new Error(d.message)}}}return n},oN=({elements:e,files:t})=>{let n=ce(e),a=new Set(e.filter(l=>de(l))),i=!1,r=e.reduce((l,c)=>(Dn(c)&&(i=!0,t&&t[c.fileId]&&(l[c.fileId]=t[c.fileId])),l),{});i&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let s={type:Fn.excalidrawClipboard,elements:e.map(l=>{if(wn(l,n)&&!a.has(wn(l,n))){let c=ss(l);return G(c,{frameId:null}),c}return l}),files:t?r:void 0};return JSON.stringify(s)},C3=async(e,t,n)=>{await pl(oN({elements:e,files:t}),n)},cN=e=>{let t=QP(e);return t.type===$o?{spreadsheet:t.spreadsheet}:null};function k3(e){var n;let t=[];for(let a of e.childNodes)if(a.nodeType===3){let i=(n=a.textContent)==null?void 0:n.trim();i&&t.push({type:"text",value:i})}else if(a instanceof HTMLImageElement){let i=a.getAttribute("src");i&&i.startsWith("http")&&t.push({type:"imageUrl",value:i})}else t=t.concat(k3(a));return t}var dN=e=>{var n;let t=(n=e.clipboardData)==null?void 0:n.getData(ae.html);if(!t)return null;try{let a=new DOMParser().parseFromString(t,ae.html),i=k3(a.body);if(i.length)return{type:"mixedContent",value:i}}catch(a){console.error(`error in parseHTMLFromPaste: ${a.message}`)}return null},uN=async()=>{var n,a,i,r;let e={},t;try{t=await((n=navigator.clipboard)==null?void 0:n.read())}catch(s){try{if((a=navigator.clipboard)!=null&&a.readText){console.warn(`navigator.clipboard.readText() failed (${s.message}). Failling back to navigator.clipboard.read()`);let l=await((i=navigator.clipboard)==null?void 0:i.readText());if(l)return{[ae.text]:l}}}catch(l){if((r=navigator.clipboard)!=null&&r.read)console.warn(`navigator.clipboard.readText() failed (${l.message}). Failling back to navigator.clipboard.read()`);else{if(l.name==="DataError")return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${l.message}`),e;throw l}}throw s}for(let s of t)for(let l of s.types)if(y8(bk,l))try{if(l===ae.text||l===ae.html)e[l]=await(await s.getType(l)).text();else if(J3(l)){let c=await s.getType(l),d=Yl(c,l,void 0);e[l]=d}else throw new R2(`Unsupported clipboard type: ${l}`)}catch(c){console.warn(c instanceof R2?c.message:`Cannot retrieve ${l} from clipboardItem: ${c.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},fN=async(e,t=!1)=>{var n,a;try{let i=!t&&e&&dN(e);return i?i.value.every(r=>r.type==="text")?{type:"text",value:((n=e.clipboardData)==null?void 0:n.getData(ae.text))||i.value.map(r=>r.value).join(`
|
|
40
|
+
`).trim()}:i:{type:"text",value:(((a=e.clipboardData)==null?void 0:a.getData(ae.text))||"").trim()}}catch{return{type:"text",value:""}}},M3=async(e,t=!1)=>{let n=await fN(e,t);if(n.type==="mixedContent")return{mixedContent:n.value};try{let a=!t&&cN(n.value);if(a)return a}catch(a){console.error(a)}try{let a=JSON.parse(n.value),i=a.type===Fn.excalidrawClipboardWithAPI;if(sN(a))return{elements:a.elements,files:a.files,text:t?JSON.stringify(a.elements,null,2):void 0,programmaticAPI:i}}catch{}return{text:n.value}},I3=async e=>{try{await navigator.clipboard.write([new window.ClipboardItem({[ae.png]:e})])}catch(t){if(tc(e))await navigator.clipboard.write([new window.ClipboardItem({[ae.png]:await e})]);else throw t}},pl=async(e,t)=>{var n,a;if(jp)try{await navigator.clipboard.writeText(e||"");return}catch(i){console.error(i)}try{if(t){if((n=t.clipboardData)==null||n.setData(ae.text,e||""),((a=t.clipboardData)==null?void 0:a.getData(ae.text))!==e)throw new Error("Failed to setData on clipboardEvent");return}}catch(i){console.error(i)}if(!hN(e))throw new Error("Error copying to clipboard.")},hN=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";let a=window.pageYOffset||document.documentElement.scrollTop;n.style.top=`${a}px`,n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand("copy")}catch(r){console.error(r)}return n.remove(),i},cc=({elements:e,appState:t,files:n,maxWidthOrHeight:a,getDimensions:i,exportPadding:r,exportingFrame:s})=>{let{elements:l,appState:c}=lc({elements:e,appState:t},null,null),{exportBackground:d,viewBackgroundColor:o}=c;return v3(l,{...c,offsetTop:0,offsetLeft:0,width:0,height:0},n||{},{exportBackground:d,exportPadding:r,viewBackgroundColor:o,exportingFrame:s},(u,h)=>{let p=document.createElement("canvas");if(a){typeof i=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let m=Math.max(u,h),g=a<m?a/m:(t==null?void 0:t.exportScale)??1;return p.width=u*g,p.height=h*g,{canvas:p,scale:g}}let U=(i==null?void 0:i(u,h))||{width:u,height:h};return p.width=U.width,p.height=U.height,{canvas:p,scale:U.scale??1}})},T3=async e=>{var i;let{mimeType:t=ae.png,quality:n}=e;t===ae.png&&typeof n=="number"&&console.warn(`"quality" will be ignored for "${ae.png}" mimeType`),t==="image/jpg"&&(t=ae.jpg),t===ae.jpg&&!((i=e.appState)!=null&&i.exportBackground)&&(console.warn(`Defaulting "exportBackground" to "true" for "${ae.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let a=await cc(e);return n=n||(/image\/jpe?g/.test(t)?.92:.8),new Promise((r,s)=>{a.toBlob(async l=>{var c;if(!l)return s(new Error("couldn't export to blob"));l&&t===ae.png&&((c=e.appState)!=null&&c.exportEmbedScene)&&(l=await o4({blob:l,metadata:sc(e.elements,e.appState,e.files||{},"local")})),r(l)},t,n)})},rf=async({elements:e,appState:t=za(),files:n={},exportPadding:a,renderEmbeddables:i,exportingFrame:r,skipInliningFonts:s,reuseImages:l})=>{let{elements:c,appState:d}=lc({elements:e,appState:t},null,null),o={...d,exportPadding:a};return wp(c,o,n,{exportingFrame:r,renderEmbeddables:i,skipInliningFonts:s,reuseImages:l})},pN=async e=>{if(e.type==="svg"){let t=await rf(e);await pl(t.outerHTML)}else if(e.type==="png")await I3(T3(e));else if(e.type==="json")await C3(e.elements,e.files);else throw new Error("Invalid export type")},UN=e=>e.type==="diamond"?[C(e.width/2,0),C(e.width,e.height/2),C(e.width/2,e.height),C(0,e.height/2)]:[C(0,0),C(0+e.width,0),C(0+e.width,e.height),C(0,e.height)],mN=e=>fe(e)||Xn(e)?e.points:UN(e),Sg=e=>{let t=e.reduce((n,[a,i])=>(n.minY=Math.min(n.minY,i),n.minX=Math.min(n.minX,a),n.maxX=Math.max(n.maxX,a),n.maxY=Math.max(n.maxY,i),n),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,cx:0,cy:0});return t.cx=(t.maxX+t.minX)/2,t.cy=(t.maxY+t.minY)/2,t},_3=e=>{let t=mN(e),{cx:n,cy:a}=Sg(t),i=C(n,a),r=t.map(o=>H(o,i,e.angle)),{minX:s,minY:l,maxX:c,maxY:d}=Sg(r);return[s+e.x,l+e.y,c+e.x,d+e.y]},H1=(e,t,n=!1)=>{let a=_3(e),i=t[0]<=a[0]&&t[2]>=a[2]&&t[1]<=a[1]&&t[3]>=a[3];return n?i?!0:a[0]<=t[0]&&a[2]>=t[2]&&a[1]<=t[1]&&a[3]>=t[3]:i},j3=(e,t)=>{let n=_3(e);return(jc(n[0],Kt(t[0],t[2]))||jc(t[0],Kt(n[0],n[2])))&&(jc(n[1],Kt(t[1],t[3]))||jc(t[1],Kt(n[1],n[3])))},A3=({elements:e,bounds:t,type:n,errorMargin:a=0})=>{var s;C8(t)&&(t=pa(t,ce(e)));let i=[t[0]-a,t[1]-a,t[2]+a,t[3]+a],r=new Set;for(let l of e)if(!r.has(l.id)&&(n==="overlap"?j3(l,i):n==="inside"?H1(l,i):H1(l,i,!0))){if(r.add(l.id),l.boundElements)for(let c of l.boundElements)r.add(c.id);q(l)&&l.containerId&&r.add(l.containerId),xe(l)&&(l.startBinding&&r.add(l.startBinding.elementId),l.endBinding&&r.add((s=l.endBinding)==null?void 0:s.elementId))}return e.filter(l=>r.has(l.id))};function Cg(e){return[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])]}function gN(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}var bN=1e-6;function kg(e,t){let n=re(e[1],e[0]),a=re(t,e[0]),i=At(n,a);return Math.abs(i)<bN}function gh(e,t){let n=re(e[1],e[0]),a=re(t,e[0]);return At(n,a)<0}function Mg(e,t){return kg(e,t[0])||kg(e,t[1])||(gh(e,t[0])?!gh(e,t[1]):gh(e,t[1]))}function vN(e,t){return gN(Cg(e),Cg(t))&&Mg(e,t)&&Mg(t,e)}var R3=(e,t,n)=>{let a=ce(e);for(let i of t)if(i.frameId){let r=n.get(i.id),s=n.get(i.frameId);if(r){let l=a.get(r);l&&G(l,{frameId:s??i.frameId},!1)}}};function Rp(e,t,n){let a=B2(t,n),i=B2(e,n);return a.some(r=>i.some(s=>vN(r,s)))}var L3=(e,t,n)=>lf($p(e,t,n,!1)).filter(a=>!de(a)&&!a.frameId||a.frameId===t.id),Lp=(e,t,n)=>$p([t],e,n).some(a=>a.id===t.id),dc=(e,t,n)=>{let[a,i,r,s]=pe(t,n),[l,c,d,o]=$e(e);return a<=l&&i<=c&&r>=d&&s>=o},nr=(e,t,n)=>dc([e],t,n)||Rp(e,t,n)||Lp(e,t,n),Ig=(e,t,n)=>{let[a,i,r,s]=pe(t,n);return u8(C(a,i),C(e.x,e.y),C(r,s))},xN=e=>{let t=new Map;for(let n of e){let a=de(n)?n.id:n.frameId;a&&!t.has(a)&&t.set(a,Ga(e,a))}return t},Ga=(e,t)=>{let n=[];for(let a of e.values())a.frameId===t&&n.push(a);return n},Dp=e=>e.filter(t=>de(t)),Pp=e=>{let t=ce(Dp(e));return e.filter(n=>t.has(n.id)||!n.frameId||!t.has(n.frameId))},bd=(e,t,n,a)=>{let i=Ga(e,t.id),r=new Set(i),s=new Set([...L3(e,t,a),...i.filter(h=>Lp(h,t,a))]),l=i.filter(h=>!s.has(h)),c=new Set(Array.from(s).flatMap(h=>h.groupIds));for(let h of l)if(!Rp(h,t,a))h.groupIds.length===0&&r.delete(h);else if(h.groupIds.length>0)for(let p of h.groupIds)c.add(p);for(let h of l)if(h.groupIds.length>0){let p=!0;for(let U of h.groupIds)c.has(U)&&(p=!1);p&&r.delete(h)}let d=Array.from(s).filter(h=>h.groupIds.length===0);for(let h of d)r.add(h);let o=Array.from(s).filter(h=>h.groupIds.length>0),u=O7(o,n);for(let[h,p]of Object.entries(u))if(p){let U=nt(e,h);if(dc(U,t,a))for(let m of U)r.add(m)}return[...r].filter(h=>!(q(h)&&h.containerId))},yN=(e,t,n)=>wN(lf(e,L3(e,t,n)),t,n),wN=(e,t,n)=>{let a=[],i=new Map;for(let r of e){let s=!1;if(r.groupIds.length>0){if(r.groupIds.some(l=>i.get(l)))s=!0;else{let l=new Set(r.groupIds.flatMap(c=>nt(n,c)));s=!dc(Array.from(l),t,n)}r.groupIds.forEach(l=>{i.set(l,s)})}s||a.push(r)}return a},wn=(e,t)=>e.frameId&&t.get(e.frameId)||null,EN=(e,t)=>{let n=new Set,a=ce(e);e=lf(e);for(let s of e)de(s)&&s.id!==t.id&&n.add(s.id);let i=new Set,r=[];for(let s of e)if(!(de(s)||s.frameId&&n.has(s.frameId)))if(s.groupIds.length){let l=s.groupIds.at(-1);if(!i.has(l)){i.add(l);let c=nt(e,l);if(c.some(d=>nr(d,t,a)))for(let d of c)r.push(d)}}else nr(s,t,a)&&r.push(s);return r},oo=(e,t,n,a)=>{let i=ce(e),r=new Map;for(let d of e.values())d.frameId===n.id&&r.set(d.id,!0);let s=new Set(t.map(d=>d.id)),l=[],c=new Set;for(let d of t)de(d)&&d.id!==n.id&&c.add(d.id);for(let d of lf(e,t)){if(de(d)||d.frameId&&c.has(d.frameId)||d.frameId&&a.selectedElementIds[d.id]&&a.selectedElementIds[d.frameId])continue;r.has(d.id)||l.push(d);let o=ge(d,i);o&&!s.has(o.id)&&!r.has(o.id)&&l.push(o)}for(let d of l)G(d,{frameId:n.id},!1);return e},sf=(e,t)=>{let n=new Map,a=new Map;for(let i of e)if(i.frameId){n.set(i.id,i);let r=a.get(i.frameId)||[];r.push(i);let s=ge(i,t);s&&(n.set(s.id,s),r.push(s)),a.set(i.frameId,r)}for(let[,i]of n)G(i,{frameId:null},!1)},D3=(e,t)=>{let n=Ga(e,t.id);return sf(n,ce(e)),e},P3=(e,t,n,a)=>oo(D3(e,n),t,n,a.state).slice(),il=(e,t,n)=>{let a=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),i=new Set(a);if(t.editingGroupId)for(let l of a)l.groupIds.length===0?i.add(l):l.groupIds.flatMap(c=>nt(e,c)).forEach(c=>i.add(c));let r=new Set,s=ce(e);return i.forEach(l=>{l.frameId&&!de(l)&&!cu(l,s,t)&&r.add(l)}),r.size>0&&sf(r,s),e},lf=(e,t)=>{let n=new Set,a=t||e;for(let s of a.values()){let l=s.groupIds[s.groupIds.length-1];l&&n.add(l)}let i=new Set;for(let s of n)nt(e,s).some(l=>de(l))&&i.add(s);let r=[];for(let s of a.values())i.has(s.groupIds[s.groupIds.length-1])||r.push(s);return r},X1=(e,t,n)=>{let a=q(e)&&zt(e,t)||e;return a.frameId&&n.selectedElementIds[a.id]&&n.selectedElementIds[a.frameId]?wn(a,t):n.selectedElementIds[a.id]&&n.selectedElementsAreBeingDragged?n.frameToHighlight:wn(a,t)},cu=(e,t,n,a)=>{var c;let i=(a==null?void 0:a.targetFrame)??X1(e,t,n);if(!i)return!1;let r=q(e)&&zt(e,t)||e,s=d=>{a!=null&&a.checkedGroups&&r.groupIds.forEach(o=>{var u;(u=a.checkedGroups)==null||u.set(o,d)})};if(!n.selectedElementIds[r.id]||!n.selectedElementsAreBeingDragged||n.selectedElementIds[r.id]&&n.selectedElementIds[i.id])return!0;if(r.groupIds.length===0)return nr(r,i,t);for(let d of r.groupIds)if((c=a==null?void 0:a.checkedGroups)!=null&&c.has(d))return a.checkedGroups.get(d);let l=new Set(r.groupIds.filter(d=>a!=null&&a.checkedGroups?!a.checkedGroups.has(d):!0).flatMap(d=>nt(t,d)));if(n.editingGroupId&&n.selectedElementsAreBeingDragged){let d=new Set(ve(t,n));if(n.frameToHighlight!==null)return!0;d.forEach(o=>{l.delete(o)})}for(let d of l)if(de(d))return s(!1),!1;for(let d of l)if(nr(d,i,t))return s(!0),!0;return!1},Tg=(e,t,n,a,i)=>{if(!n.frameRendering||!n.frameRendering.clip)return!1;let r=Rp(e,t,a)||Lp(e,t,a);if(r){for(let s of e.groupIds)i==null||i.set(s,!0);return!0}if(!r&&e.groupIds.length>0&&!dc([e],t,a)){let s=!1;if(n.selectedElementsAreBeingDragged)s=cu(e,a,n,{targetFrame:t,checkedGroups:i});else{s=e.frameId===t.id;for(let l of e.groupIds)i==null||i.set(l,s)}for(let l of e.groupIds)i==null||i.set(l,s);return s}return!1},N3=e=>e.name===null?E8(e)?"Frame":"AI Frame":e.name,Np=(e,t)=>A3({elements:e,bounds:t,type:"overlap"}).filter(n=>!n.frameId||n.frameId===t.id),O3=e=>{let t=ce(e);return e.length>1&&e.some(n=>n.frameId&&t.has(n.frameId))},Op=e=>{let t=new Set;return e.forEach(n=>{de(n)&&t.add(n.id)}),e.filter(n=>!(n.frameId&&t.has(n.frameId)))},$p=(e,t,n,a=!0)=>{let[i,r,s,l]=pe(t,n),c=e.filter(d=>{let[o,u,h,p]=pa(d,n),U=wn(d,n);if(U){let[m,g,b,v]=pa(U,n);o=Math.max(m,o),u=Math.max(g,u),h=Math.min(b,h),p=Math.min(v,p)}return d.locked===!1&&d.type!=="selection"&&!at(d)&&i<=o&&r<=u&&s>=h&&l>=p});return c=a?Op(c):c,c=c.filter(d=>{let o=wn(d,n);return o?nr(d,o,n):!0}),c},$3=(e,t,n,a)=>{let i=new Set(t.map(r=>r.id));return e.filter(r=>{let s=du(r,n.width,n.height,n,a);return!i.has(r.id)&&s})},It=(function(){let e=null,t=null,n=null,a=(i,r)=>(n!=null&&i===e&&r.selectedElementIds===t||(n=i.some(s=>r.selectedElementIds[s.id]),e=i,t=r.selectedElementIds),n);return a.clearCache=()=>{e=null,t=null,n=null},a})(),SN=(e,t,n)=>{let a=Array.from(new Set(ve(e,t).map(i=>n(i))));return a.length===1?a[0]:null},ve=(e,t,n)=>{let a=new Set,i=[];for(let r of e.values()){if(t.selectedElementIds[r.id]){i.push(r),a.add(r.id);continue}if(n!=null&&n.includeBoundTextElement&&at(r)&&t.selectedElementIds[r==null?void 0:r.containerId]){i.push(r),a.add(r.id);continue}}if(n!=null&&n.includeElementsInFrames){let r=[];return i.forEach(s=>{de(s)&&Ga(e,s.id).forEach(l=>!a.has(l.id)&&r.push(l)),r.push(s)}),r}return i},F3=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:ve(e,t,{includeBoundTextElement:!0}),Pe=(e,t)=>Vt(t.selectedElementIds,e)?t.selectedElementIds:e,_g=e=>{let t=new Map,n=[];for(let a of e)a.isDeleted||(n.push(a),t.set(a.id,a));return{elementsMap:t,elements:n}},CN=Ko(e=>{(be.DEV||be.MODE===vn.TEST||window!=null&&window.DEBUG_FRACTIONAL_INDICES)&&mp(e,{shouldThrow:be.DEV||be.MODE===vn.TEST,includeBoundTextValidation:!0})},1e3*60,{leading:!0,trailing:!1}),kN=e=>{let t=["includeBoundTextElement","includeElementsInFrames"],n="";for(let a of t)n+=`${a}:${e[a]?"1":"0"}`;return n},jg=e=>typeof e=="string",W1=class vd{constructor(){L(this,"callbacks",new Set),L(this,"nonDeletedElements",[]),L(this,"nonDeletedElementsMap",Hn(new Map)),L(this,"elements",[]),L(this,"nonDeletedFramesLikes",[]),L(this,"frames",[]),L(this,"elementsMap",Hn(new Map)),L(this,"selectedElementsCache",{selectedElementIds:null,elements:null,cache:new Map}),L(this,"sceneNonce"),L(this,"insertElement",t=>{let n=t.frameId?this.getElementIndex(t.frameId):this.elements.length;this.insertElementAtIndex(t,n)}),L(this,"insertElements",t=>{var a;if(!t.length)return;let n=(a=t[0])!=null&&a.frameId?this.getElementIndex(t[0].frameId):this.elements.length;this.insertElementsAtIndex(t,n)}),L(this,"getContainerElement",t=>t&&t.containerId&&this.getElement(t.containerId)||null),L(this,"getElementsFromId",t=>{let n=this.getNonDeletedElementsMap(),a=n.get(t);return a?[a]:nt(n,t)})}static mapElementToScene(t,n){jg(t)?this.sceneMapById.set(t,n):(this.sceneMapByElement.set(t,n),this.sceneMapById.set(t.id,n))}static getScene(t){return jg(t)?this.sceneMapById.get(t)||null:this.sceneMapByElement.get(t)||null}getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}getSelectedElements(t){let n=kN(t),a=(t==null?void 0:t.elements)||this.nonDeletedElements;if(this.selectedElementsCache.elements===a&&this.selectedElementsCache.selectedElementIds===t.selectedElementIds){let r=this.selectedElementsCache.cache.get(n);if(r)return r}else(t==null?void 0:t.elements)==null&&this.selectedElementsCache.cache.clear();let i=ve(a,{selectedElementIds:t.selectedElementIds},t);return(t==null?void 0:t.elements)==null&&(this.selectedElementsCache.selectedElementIds=t.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(n,i)),i}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(t){return this.elementsMap.get(t)||null}getNonDeletedElement(t){let n=this.getElement(t);return n&&Y1(n)?n:null}mapElements(t){let n=!1,a=this.elements.map(i=>{let r=t(i);return r!==i&&(n=!0),r});return n&&this.replaceAllElements(a),n}replaceAllElements(t){let n=t instanceof Array?t:Array.from(t.values()),a=[];CN(n),this.elements=Va(n),this.elementsMap.clear(),this.elements.forEach(r=>{de(r)&&a.push(r),this.elementsMap.set(r.id,r),vd.mapElementToScene(r,this)});let i=_g(this.elements);this.nonDeletedElements=i.elements,this.nonDeletedElementsMap=i.elementsMap,this.frames=a,this.nonDeletedFramesLikes=_g(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=Ha();for(let t of Array.from(this.callbacks))t()}onUpdate(t){if(this.callbacks.has(t))throw new Error;return this.callbacks.add(t),()=>{if(!this.callbacks.has(t))throw new Error;this.callbacks.delete(t)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),vd.sceneMapById.forEach((t,n)=>{t===this&&vd.sceneMapById.delete(n)}),this.callbacks.clear()}insertElementAtIndex(t,n){if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let a=[...this.elements.slice(0,n),t,...this.elements.slice(n)];Wa(a,ce([t])),this.replaceAllElements(a)}insertElementsAtIndex(t,n){if(!t.length)return;if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let a=[...this.elements.slice(0,n),...t,...this.elements.slice(n)];Wa(a,ce(t)),this.replaceAllElements(a)}getElementIndex(t){return this.elements.findIndex(n=>n.id===t)}};L(W1,"sceneMapByElement",new WeakMap),L(W1,"sceneMapById",new Map);var MN=W1,vi=MN,G=(e,t,n=!0,a)=>{var o,u;let i=!1,{points:r,fixedSegments:s,fileId:l,startBinding:c,endBinding:d}=t;if(ee(e)&&(Object.keys(t).length===0||typeof r<"u"||typeof s<"u"||typeof c<"u"||typeof d<"u")){let h=Hn(((o=vi.getScene(e))==null?void 0:o.getNonDeletedElementsMap())??new Map);t={...t,angle:0,...Cp({...e,x:t.x||e.x,y:t.y||e.y},h,{fixedSegments:s,points:r,startBinding:c,endBinding:d},{isDragging:a==null?void 0:a.isDragging})}}else typeof r<"u"&&(t={...Qs(r),...t});for(let h in t){let p=t[h];if(typeof p<"u"){if(e[h]===p&&(typeof p!="object"||p===null||h==="groupIds"||h==="scale"))continue;if(h==="scale"){let U=e[h],m=p;if(U[0]===m[0]&&U[1]===m[1])continue}else if(h==="points"){let U=e[h],m=p;if(U.length===m.length){let g=!1,b=U.length;for(;--b;){let v=U[b],x=m[b];if(v[0]!==x[0]||v[1]!==x[1]){g=!0;break}}if(!g)continue}}e[h]=p,i=!0}}return i&&((typeof t.height<"u"||typeof t.width<"u"||typeof l<"u"||typeof r<"u")&&dt.delete(e),e.version++,e.versionNonce=Ha(),e.updated=ul(),n&&((u=vi.getScene(e))==null||u.triggerUpdate())),e},Ue=(e,t,n=!1)=>{let a=!1;for(let i in t){let r=t[i];if(typeof r<"u"){if(e[i]===r&&(typeof r!="object"||r===null))continue;a=!0}}return!a&&!n?e:{...e,...t,updated:ul(),version:e.version+1,versionNonce:Ha()}},uc=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=Ha(),e.updated=ul(),e),Qr=e=>fe(e)||Xn(e)?e.points.length<2:e.width===0&&e.height===0,du=(e,t,n,a,i)=>{let[r,s,l,c]=pa(e,i),d=Ze({clientX:a.offsetLeft,clientY:a.offsetTop},a),o=Ze({clientX:a.offsetLeft+t,clientY:a.offsetTop+n},a);return d.x<=l&&d.y<=c&&o.x>=r&&o.y>=s},xd=(e,t,n,a,i,r)=>{let[s,l,c,d]=$e(e,i),o=Ze({clientX:a.offsetLeft+((r==null?void 0:r.left)||0),clientY:a.offsetTop+((r==null?void 0:r.top)||0)},a),u=Ze({clientX:a.offsetLeft+t-((r==null?void 0:r.right)||0),clientY:a.offsetTop+n-((r==null?void 0:r.bottom)||0)},a);return s>=o.x&&l>=o.y&&c<=u.x&&d<=u.y},Ag=(e,t,n)=>{let a=Math.abs(t),i=Math.abs(n);if(e==="line"||e==="arrow"||e==="freedraw"){let r=Math.round(Math.atan(i/a)/Ji)*Ji;r===0?n=0:r===Math.PI/2?t=0:n=a*Math.tan(r)*Math.sign(n)||n}else e!=="selection"&&(n=a*Math.sign(n));return{width:t,height:n}},V1=(e,t,n,a)=>{let i=n-e,r=a-t,s=Math.round(Math.atan(r/i)/Ji)*Ji;if(s===0)r=0;else if(s===Math.PI/2)i=0;else{let l=Math.tan(s),c=-1,d=t-l*e,o=-1/l,u=-1,h=a-o*n,p=(c*h-u*d)/(l*u-o*c),U=(d*o-h*l)/(l*u-o*c);i=p-e,r=U-t}return{width:i,height:r}},z3=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){let n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},Rg={mouse:8,pen:16,touch:28},IN=16,B3={e:!0,s:!0,n:!0,w:!0},Lg={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},bh={e:!0,s:!0,n:!0,w:!0},ei=(e,t,n,a,i,r,s)=>{let[l,c]=H(C(e+n/2,t+a/2),C(i,r),s);return[l-n/2,c-a/2,n,a]},Fp=e=>!(e.viewport.isMobile||e.isTouchScreen&&(lk||e8)),co=e=>Fp(e)?B3:{},zp=([e,t,n,a,i,r],s,l,c,d={},o=4,u=Xr)=>{let h=Rg[c],p=h/l.value,U=h/l.value,m=h/l.value,g=h/l.value,b=n-e,v=a-t,x=o/l.value,y=(h-u*2)/(2*l.value),E={nw:d.nw?void 0:ei(e-x-m+y,t-x-g+y,p,U,i,r,s),ne:d.ne?void 0:ei(n+x-y,t-x-g+y,p,U,i,r,s),sw:d.sw?void 0:ei(e-x-m+y,a+x-y,p,U,i,r,s),se:d.se?void 0:ei(n+x-y,a+x-y,p,U,i,r,s),rotation:d.rotation?void 0:ei(e+b/2-p/2,t-x-g+y-IN/l.value,p,U,i,r,s)},S=5*Rg.mouse/l.value;return Math.abs(b)>S&&(d.n||(E.n=ei(e+b/2-p/2,t-x-g+y,p,U,i,r,s)),d.s||(E.s=ei(e+b/2-p/2,a+x-y,p,U,i,r,s))),Math.abs(v)>S&&(d.w||(E.w=ei(e-x-m+y,t+v/2-U/2,p,U,i,r,s)),d.e||(E.e=ei(n+x-y,t+v/2-U/2,p,U,i,r,s))),E},H3=(e,t,n,a="mouse",i=B3)=>{if(e.locked||ee(e))return{};if(e.type==="freedraw"||fe(e)){if(e.points.length===2){let[,s]=e.points;s[0]===0||s[1]===0?i=bh:s[0]>0&&s[1]<0?i=Lg:s[0]>0&&s[1]>0?i=bh:s[0]<0&&s[1]>0?i=Lg:s[0]<0&&s[1]<0&&(i=bh)}}else de(e)&&(i={...i,rotation:!0});let r=fe(e)?Xr+8:Ne(e)?0:Xr;return zp(pe(e,n,!0),e.angle,t,a,i,r,Ne(e)?0:void 0)},X3=(e,t)=>{if(t.editingLinearElement)return!1;if(e.length>1)return!0;let n=e[0];return ee(n)?!1:fe(n)?n.points.length>2:!0},G1=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],TN=(e,t,n,a,i,r,s,l)=>{if(!n.selectedElementIds[e.id])return!1;let{rotation:c,...d}=H3(e,r,t,s,co(l));if(c&&G1(c,a,i))return"rotation";let o=Object.keys(d).filter(u=>{let h=d[u];return h?G1(h,a,i):!1});if(o.length>0)return o[0];if(Fp(l)){let[u,h,p,U,m,g]=pe(e,t);if(!(fe(e)&&e.points.length<=2)){let b=Ne(e)?0:Od/r.value,v=Od/r.value,x=W3(C(u-b,h-b),C(p+b,U+b),C(m,g),e.angle);for(let[y,E]of Object.entries(x))if(Wr(C(a,i),E,v))return y}}return!1},Dg=(e,t,n,a,i,r,s,l)=>e.reduce((c,d)=>{if(c)return c;let o=TN(d,s,t,n,a,i,r,l);return o?{element:d,transformHandleType:o}:null},null),Pg=([e,t,n,a],i,r,s,l,c)=>{let d=zp([e,t,n,a,(e+n)/2,(t+a)/2],0,s,l,co(c)),o=Object.keys(d).find(u=>{let h=d[u];return h&&G1(h,i,r)});if(o)return o;if(Fp(c)){let u=(e+n)/2,h=(t+a)/2,p=Od/s.value,U=W3(C(e-p,t-p),C(n+p,a+p),C(u,h),0);for(let[m,g]of Object.entries(U))if(Wr(C(i,r),g,p))return m}return!1},vh=["ns","nesw","ew","nwse"],_N=(e,t)=>{let n=vh.indexOf(e);if(n>=0){let a=Math.round(t/(Math.PI/4));e=vh[(n+a)%vh.length]}return e},Ng=e=>{let{element:t,transformHandleType:n}=e,a=t&&Math.sign(t.height)*Math.sign(t.width)===-1,i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":a?i="nesw":i="nwse";break;case"ne":case"sw":a?i="nwse":i="nesw";break;case"rotation":return"grab"}return i&&t&&(i=_N(i,t.angle)),i?`${i}-resize`:""},W3=([e,t],[n,a],i,r)=>{let s=H(C(e,t),i,r),l=H(C(n,t),i,r),c=H(C(e,a),i,r),d=H(C(n,a),i,r);return{n:[s,l],e:[l,d],s:[d,c],w:[c,s]}},jN=(e,t,n,a,i,r,s,l,c,d,o,u)=>{if(n.length===1){let[h]=n;if(t==="rotation")ee(h)||(AN(h,a,i,c,d,r),xn(h,a));else{if(q(h)&&t)return RN(e,h,a,t,s,c,d),xn(h,a),!0;if(t){let p=n[0].id,U=a.get(p),m=e.get(p);if(U&&m){let{nextWidth:g,nextHeight:b}=$N(U,m,a,e,t,c,d,{shouldMaintainAspectRatio:l,shouldResizeFromCenter:s});Fo(g,b,U,m,a,e,t,{shouldMaintainAspectRatio:l,shouldResizeFromCenter:s})}}}return!0}else if(n.length>1){if(t==="rotation")return LN(e,n,a,i,c,d,r,o,u),!0;if(t){let{nextWidth:h,nextHeight:p,flipByX:U,flipByY:m,originalBoundingBox:g}=FN(n,e,a,t,c,d,{shouldMaintainAspectRatio:l,shouldResizeFromCenter:s});return V3(n,a,t,i,e,{shouldResizeFromCenter:s,shouldMaintainAspectRatio:l,flipByX:U,flipByY:m,nextWidth:h,nextHeight:p,originalBoundingBox:g}),!0}}return!1},AN=(e,t,n,a,i,r)=>{let[s,l,c,d]=pe(e,t),o=(s+c)/2,u=(l+d)/2,h;de(e)?h=0:(h=5*Math.PI/2+Math.atan2(i-u,a-o),r&&(h=h+Ji/2,h=h-h%Ji),h=Bd(h));let p=gi(e);if(G(e,{angle:h}),p){let U=n.getElement(p);U&&!xe(e)&&G(U,{angle:h})}},Bp=(e,t,n,a)=>fe(e)||Xn(e)?{points:Qd(0,t,Qd(1,n,e.points,a),a)}:{},Hp=(e,t,n)=>{let a=e.width;if(at(e)){let r=zt(e,t);r&&(a=bi(r,e))}let i=e.fontSize*(n/a);return i<N0?null:{size:i}},RN=(e,t,n,a,i,r,s)=>{let[l,c,d,o,u,h]=pe(t,n),[p,U]=H(C(r,s),C(u,h),-t.angle),m=0,g=0;a!=="e"&&a!=="w"&&(a.includes("e")&&(m=(p-l)/(d-l)),a.includes("w")&&(m=(d-p)/(d-l)),a.includes("n")&&(g=(o-U)/(o-c)),a.includes("s")&&(g=(U-c)/(o-c)));let b=Math.max(m,g);if(b>0){let v=t.width*b,x=t.height*b,y=Hp(t,n,v);if(y===null)return;let E=[l,c],S=[d,o],w=[u,h],k=C(l,c);if(["n","w","nw"].includes(a)&&(k=C(S[0]-Math.abs(v),S[1]-Math.abs(x))),a==="ne"){let O=[E[0],S[1]];k=C(O[0],O[1]-Math.abs(x))}if(a==="sw"){let O=[S[0],E[1]];k=C(O[0]-Math.abs(v),O[1])}["s","n"].includes(a)&&(k[0]=w[0]-v/2),["e","w"].includes(a)&&(k[1]=w[1]-x/2),i&&(k[0]=w[0]-Math.abs(v)/2,k[1]=w[1]-Math.abs(x)/2);let T=t.angle,_=H(k,C(u,h),T),j=C(k[0]+Math.abs(v)/2,k[1]+Math.abs(x)/2),A=H(j,C(u,h),T);k=H(_,A,-T);let[R,N]=k;G(t,{fontSize:y.size,width:v,height:x,x:R,y:N})}if(a==="e"||a==="w"){let v=e.get(t.id),[x,y,E,S]=Zi(v,v.width,v.height,!0),w=C(x,y),k=C(E,S),T=ec(w,k),_=H(C(r,s),T,-v.angle),[j,,A]=Zi(t,t.width,t.height,!0),R=A-j,N=k[0]-w[0],O=V0(Ve({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),$=N/R;a.includes("e")&&($=(_[0]-w[0])/R),a.includes("w")&&($=(k[0]-_[0])/R);let P=t.width*$<O?O:t.width*$,W=rs(t.originalText,Ve(t),Math.abs(P)),F=an(W,Ve(t),t.lineHeight),Y=F.height,[Q,le,ie,Te]=Zi(v,P,Y,!0),_e=ie-Q,Ie=Te-le,oe=[...w];["n","w","nw"].includes(a)&&(oe=[k[0]-Math.abs(_e),w[1]]);let ue=v.angle,Fe=H(oe,T,ue),Ee=C(oe[0]+Math.abs(_e)/2,oe[1]+Math.abs(Ie)/2),je=H(Ee,T,ue);oe=H(Fe,je,-ue);let gt={width:Math.abs(P),height:Math.abs(F.height),x:oe[0],y:oe[1],text:W,autoResize:!1};G(t,gt)}},LN=(e,t,n,a,i,r,s,l,c)=>{var o;let d=5*Math.PI/2+Math.atan2(r-c,i-l);s&&(d+=Ji/2,d-=d%Ji);for(let u of t)if(!de(u)){let[h,p,U,m]=pe(u,n),g=(h+U)/2,b=(p+m)/2,v=((o=e.get(u.id))==null?void 0:o.angle)??u.angle,[x,y]=H(C(g,b),C(l,c),d+v-u.angle);ee(u)?G(u,{points:SD(u,n)}):G(u,{x:u.x+(x-g),y:u.y+(y-b),angle:Bd(d+v)},!1),xn(u,n,{simultaneouslyUpdated:t});let E=ge(u,n);E&&!xe(u)&&G(E,{x:E.x+(x-g),y:E.y+(y-b),angle:Bd(d+v)},!1)}a.triggerUpdate()},DN=(e,t,n,a,i)=>{let[r,s,l,c]=t.length===1?pe(t[0],n):$e(t),d=(r+l)/2,o=(s+c)/2,u=t.length===1?t[0].angle:0;switch([a,i]=H(C(a,i),C(d,o),-u),e){case"n":return H(C(a-(r+l)/2,i-s),C(0,0),u);case"s":return H(C(a-(r+l)/2,i-c),C(0,0),u);case"w":return H(C(a-r,i-(s+c)/2),C(0,0),u);case"e":return H(C(a-l,i-(s+c)/2),C(0,0),u);case"nw":return H(C(a-r,i-s),C(0,0),u);case"ne":return H(C(a-l,i-s),C(0,0),u);case"sw":return H(C(a-r,i-c),C(0,0),u);case"se":return H(C(a-l,i-c),C(0,0),u);default:return[0,0]}},PN=(e,t)=>{let[,[n,a]]=t.points;return e==="nw"&&(n<0||a<0)||e==="ne"&&n>=0||e==="sw"&&n<=0||e==="se"&&(n>0||a>0)?"end":"origin"},NN=(e,t,n)=>{if(n)return"center";if(t)switch(e){case"n":return"south-side";case"e":return"west-side";case"s":return"north-side";case"w":return"east-side";case"ne":return"bottom-left";case"nw":return"bottom-right";case"se":return"top-left";case"sw":return"top-right"}return["e","se","s"].includes(e)?"top-left":["n","nw","w"].includes(e)?"bottom-right":e==="ne"?"bottom-left":"top-right"},ON=(e,t,n,a,i,r,s,l,c)=>{let d=NN(s,l,c),[o,u]=e;switch(d){case"top-left":return{x:o+(t-a)/2+(a-t)/2*Math.cos(r)+(n-i)/2*Math.sin(r),y:u+(n-i)/2+(a-t)/2*Math.sin(r)+(i-n)/2*Math.cos(r)};case"top-right":return{x:o+(t-a)/2*(Math.cos(r)+1)+(n-i)/2*Math.sin(r),y:u+(n-i)/2+(t-a)/2*Math.sin(r)+(i-n)/2*Math.cos(r)};case"bottom-left":return{x:o+(t-a)/2*(1-Math.cos(r))+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)+(a-t)/2*Math.sin(r)};case"bottom-right":return{x:o+(t-a)/2*(Math.cos(r)+1)+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)+(t-a)/2*Math.sin(r)};case"center":return{x:o-(a-t)/2,y:u-(i-n)/2};case"east-side":return{x:o+(t-a)/2*(Math.cos(r)+1),y:u+(t-a)/2*Math.sin(r)+(n-i)/2};case"west-side":return{x:o+(t-a)/2*(1-Math.cos(r)),y:u+(a-t)/2*Math.sin(r)+(n-i)/2};case"north-side":return{x:o+(t-a)/2+(n-i)/2*Math.sin(r),y:u+(i-n)/2*(Math.cos(r)-1)};case"south-side":return{x:o+(t-a)/2+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)}}},Fo=(e,t,n,a,i,r,s,{shouldInformMutation:l=!0,shouldMaintainAspectRatio:c=!1,shouldResizeFromCenter:d=!1}={})=>{let o={},u=ge(n,i);if(u){let m=r.get(u.id);if(m&&(o={fontSize:m.fontSize}),c){let g={...n,width:e},b=Hp(u,i,bi(g,u));if(b===null)return;o={fontSize:b.size}}else{let g=I8(Ve(u),u.lineHeight),b=T8(u.fontSize,u.lineHeight);e=Math.max(e,g),t=Math.max(t,b)}}let h=Bp(a,e,t,!0),p=C(a.x,a.y);if(fe(a)){let[m,g]=pa(a,r);p=C(m,g)}let U=ON(p,a.width,a.height,e,t,a.angle,s,c,d);if(fe(a)&&h.points){let m=a.x-p[0],g=a.y-p[1];U.x+=m,U.y+=g;let b=h.points[0][0],v=h.points[0][1];U.x+=b,U.y+=v,h.points=h.points.map(x=>C(x[0]-b,x[1]-v))}if(e<0&&(U.x=U.x+e),t<0&&(U.y=U.y+t),"scale"in n&&"scale"in a&&G(n,{scale:[(Math.sign(e)||a.scale[0])*a.scale[0],(Math.sign(t)||a.scale[1])*a.scale[1]]}),xe(n)&&u&&c){let m=e/n.width*u.fontSize;if(m<N0)return;o.fontSize=m}if(e!==0&&t!==0&&Number.isFinite(U.x)&&Number.isFinite(U.y)){let m={...U,width:Math.abs(e),height:Math.abs(t),...h};G(n,m,l),xn(n,i,{newSize:{width:e,height:t}}),u&&o!=null&&G(u,{fontSize:o.fontSize}),rc(n,i,s,c)}},$N=(e,t,n,a,i,r,s,{shouldMaintainAspectRatio:l=!1,shouldResizeFromCenter:c=!1}={})=>{let[d,o,u,h]=Zi(t,t.width,t.height,!0),p=C(d,o),U=C(u,h),m=ec(p,U),g=H(C(r,s),m,-t.angle),[b,v,x,y]=Zi(e,e.width,e.height,!0),E=x-b,S=y-v,w=U[0]-p[0],k=U[1]-p[1],T=w/E,_=k/S;i.includes("e")&&(T=(g[0]-p[0])/E),i.includes("s")&&(_=(g[1]-p[1])/S),i.includes("w")&&(T=(U[0]-g[0])/E),i.includes("n")&&(_=(U[1]-g[1])/S);let j=e.width*T,A=e.height*_;if(c&&(j=2*j-t.width,A=2*A-t.height),l){let R=Math.abs(j)/t.width,N=Math.abs(A)/t.height;if(i.length===1&&(A*=R,j*=N),i.length===2){let O=Math.max(R,N);j=t.width*O*Math.sign(j),A=t.height*O*Math.sign(A)}}return{nextWidth:j,nextHeight:A}},FN=(e,t,n,a,i,r,{shouldMaintainAspectRatio:s=!1,shouldResizeFromCenter:l=!1}={})=>{let c=e.map(R=>t.get(R.id)),d=c.reduce((R,N)=>{if(!fe(N))return R;let O=gi(N);if(!O)return R;let $=t.get(O)??null;return at($)?[...R,{...$,...J.getBoundTextElementPosition(N,$,n)}]:R},[]),o=da(c.map(R=>R).concat(d)),{minX:u,minY:h,maxX:p,maxY:U,midX:m,midY:g}=o,b=p-u,v=U-h,x={ne:[u,U],se:[u,h],sw:[p,h],nw:[p,U],e:[u,h+v/2],w:[p,h+v/2],n:[u+b/2,U],s:[u+b/2,h]},[y,E]=l?[m,g]:x[a],S=l?2:1,w=Math.max(Math.abs(i-y)/b||0,Math.abs(r-E)/v||0)*S,k=a.includes("e")||a.includes("w")?Math.abs(i-y)*S:b,T=a.includes("n")||a.includes("s")?Math.abs(r-E)*S:v;s&&(k=b*w*Math.sign(i-y),T=v*w*Math.sign(r-E));let _={ne:[i<y,r>E],se:[i<y,r<E],sw:[i>y,r<E],nw:[i>y,r>E],e:[i<y,!1],w:[i>y,!1],n:[!1,r>E],s:[!1,r<E]},[j,A]=_[a].map(R=>R);return{originalBoundingBox:o,nextWidth:k,nextHeight:T,flipByX:j,flipByY:A}},V3=(e,t,n,a,i,{shouldMaintainAspectRatio:r=!1,shouldResizeFromCenter:s=!1,flipByX:l=!1,flipByY:c=!1,nextHeight:d,nextWidth:o,originalBoundingBox:u}={})=>{if(o===void 0&&d===void 0&&l===void 0&&c===void 0||d===0||o===0)return;i||(i=t);let h=e.reduce((S,w)=>{let k=i.get(w.id);return k&&S.push({orig:k,latest:w}),S},[]),p;if(u)p=u;else{let S=h.reduce((w,{orig:k})=>{if(!fe(k))return w;let T=gi(k);if(!T)return w;let _=i.get(T)??null;return at(_)?[...w,{..._,...J.getBoundTextElementPosition(k,_,t)}]:w},[]);p=da(h.map(({orig:w})=>w).concat(S))}let{minX:U,minY:m,maxX:g,maxY:b,midX:v,midY:x}=p,y=g-U,E=b-m;if(o===void 0&&d===void 0&&(o=y,d=E),r&&(o===void 0?o=d*(y/E):d===void 0?d=o*(E/y):Math.abs(o/d-y/E)>.001&&(o=d*(y/E))),o&&d){let S=n.includes("e")||n.includes("w")?Math.abs(o)/y:1,w=n.includes("n")||n.includes("s")?Math.abs(d)/E:1,k;n.length===1?k=n.includes("e")||n.includes("w")?S:w:k=Math.max(Math.abs(o)/y||0,Math.abs(d)/E||0);let T={ne:[U,b],se:[U,m],sw:[g,m],nw:[g,b],e:[U,m+E/2],w:[g,m+E/2],n:[U+y/2,b],s:[U+y/2,m]},[_,j]=s?[v,x]:T[n],A=r||h.some(P=>P.latest.angle!==0||q(P.latest)||el(P.latest));A&&(S=k,w=k);let[R,N]=[l?-1:1,c?-1:1],O=[];for(let{orig:P,latest:W}of h){if(q(P)&&at(P))continue;let F=P.width*S,Y=P.height*w,Q=Bd(P.angle*R*N),le=fe(P)||Xn(P),ie=P.x-_,Te=P.y-j,_e=l&&!le?F:0,Ie=c&&!le?Y:0,oe=_+R*(ie*S+_e),ue=j+N*(Te*w+Ie),Fe=Bp(P,F*R,Y*N,!1),Ee={x:oe,y:ue,width:F,height:Y,angle:Q,...Fe};if(ee(P)&&(P.startBinding&&(Ee.startBinding={...P.startBinding,fixedPoint:[l?-P.startBinding.fixedPoint[0]+1:P.startBinding.fixedPoint[0],c?-P.startBinding.fixedPoint[1]+1:P.startBinding.fixedPoint[1]]}),P.endBinding&&(Ee.endBinding={...P.endBinding,fixedPoint:[l?-P.endBinding.fixedPoint[0]+1:P.endBinding.fixedPoint[0],c?-P.endBinding.fixedPoint[1]+1:P.endBinding.fixedPoint[1]]}),P.fixedSegments&&Fe.points&&(Ee.fixedSegments=P.fixedSegments.map(gt=>({...gt,start:Fe.points[gt.index-1],end:Fe.points[gt.index]})))),Ne(P)&&(Ee.scale=[P.scale[0]*R,P.scale[1]*N]),q(P)){let gt=Hp(P,t,F);if(!gt)return;Ee.fontSize=gt.size}let je=i.get(gi(P)??"");if(je)if(A){let gt=je.fontSize*k;if(gt<N0)return;Ee.boundTextFontSize=gt}else Ee.boundTextFontSize=je.fontSize;O.push({element:W,update:Ee})}let $=O.map(({element:P})=>P);for(let{element:P,update:{boundTextFontSize:W,...F}}of O){let{width:Y,height:Q,angle:le}=F;G(P,F,!1,{isDragging:!0}),xn(P,t,{simultaneouslyUpdated:$,newSize:{width:Y,height:Q}});let ie=ge(P,t);ie&&W&&(G(ie,{fontSize:W,angle:fe(P)?void 0:le},!1),rc(P,t,n,!0))}a.triggerUpdate()}},zN=(e,t,n,a,i,r)=>{if(t.length===1&&ee(t[0])&&(t[0].startBinding||t[0].endBinding))return;let s=t.filter(u=>{if(ee(u)&&u.startBinding&&u.endBinding){let h=t.find(U=>{var m;return U.id===((m=u.startBinding)==null?void 0:m.elementId)}),p=t.find(U=>{var m;return U.id===((m=u.endBinding)==null?void 0:m.elementId)});return h&&p}return!0}),l=new Set(s),c=s.filter(u=>de(u)).map(u=>u.id);if(c.length>0)for(let u of a.getNonDeletedElements())u.frameId!==null&&c.includes(u.frameId)&&l.add(u);let d=$e(Array.from(l).map(u=>e.originalElements.get(u.id)??u)),o=BN(d,n,i,r);l.forEach(u=>{if(Og(e,u,o),!xe(u)){let h=ge(u,a.getNonDeletedElementsMap());h&&Og(e,h,o),xn(u,a.getElementsMapIncludingDeleted(),{simultaneouslyUpdated:Array.from(l)})}})},BN=(e,t,n,a)=>{let[i,r]=e,s=i+t.x+n.x,l=r+t.y+n.y;if(n.x===0||n.y===0){let[c,d]=kt(i+t.x,r+t.y,a);n.x===0&&(s=c),n.y===0&&(l=d)}return{x:s-i,y:l-r}},Og=(e,t,n)=>{let a=e.originalElements.get(t.id)??t,i=a.x+n.x,r=a.y+n.y;G(t,{x:i,y:r})},HN=(e,t,n)=>{let[a,i]=$e(e);return[t-a,n-i]},$g=({newElement:e,elementType:t,originX:n,originY:a,x:i,y:r,width:s,height:l,shouldMaintainAspectRatio:c,shouldResizeFromCenter:d,zoom:o,widthAspectRatio:u=null,originOffset:h=null,informMutation:p=!0})=>{c&&e.type!=="selection"&&(u?l=s/u:(Math.abs(r-a)>Math.abs(i-n)?{width:s,height:l}=Ag(t,l,i<n?-s:s):{width:s,height:l}=Ag(t,s,r<a?-l:l),l<0&&(l=-l)));let U=i<n?n-s:n,m=r<a?a-l:a;d&&(s+=s,l+=l,U=n-s/2,m=a-l/2);let g=null;if(q(e)){l=e.height;let b=V0(Ve({fontSize:e.fontSize,fontFamily:e.fontFamily}),e.lineHeight);s=Math.max(s,b),Math.abs(i-n)>uk/o&&(g={autoResize:!1}),m=a,d&&(U=n-s/2)}if(s!==0&&l!==0){let b=null;Ne(e)&&(b={initialWidth:s,initialHeight:l}),G(e,{x:U+((h==null?void 0:h.x)??0),y:m+((h==null?void 0:h.y)??0),width:s,height:l,...g,...b},p)}},Xp=(e,t)=>{var n;return!!(!e.viewModeEnabled&&((n=e.openDialog)==null?void 0:n.name)!=="elementLinkSelector"&&(e.activeTool.type!=="custom"&&(e.editingTextElement||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser")||ve(t,e).length))},XN=e=>e.reduce((t,n)=>t+n.version,0),G3=e=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e[n].versionNonce;return t>>>0},Wp=e=>{let t=5381;for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);t=(t<<5)+t+a}return t>>>0},WN=e=>e.filter(t=>!t.isDeleted&&!Qr(t)),Ye=e=>e.filter(t=>!t.isDeleted),Y1=e=>!e.isDeleted,Y3=e=>Ye(e).map(t=>W0(t.type)?{...t,lastCommittedPoint:null}:t),VN=e=>Y3(e),Z3=e=>Y3(e),K3=async e=>{let t;if(e.type===ae.png)try{return await(await Promise.resolve().then(()=>require("./layers.D5Ff-TQt.js"))).decodePngMetadata(e)}catch(n){throw n.message==="INVALID"?new Tr("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new Tr("Error: cannot restore image")}else if("text"in Blob?t=await e.text():t=await new Promise(n=>{let a=new FileReader;a.readAsText(e,"utf8"),a.onloadend=()=>{a.readyState===FileReader.DONE&&n(a.result)}}),e.type===ae.svg)try{return jP({svg:t})}catch(n){throw n.message==="INVALID"?new Tr("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new Tr("Error: cannot restore image")}return t},q3=e=>{var t;return e&&((t=e.name.match(/\.(json|excalidraw|png|svg)$/))==null?void 0:t[1])||null},GN=e=>e==="png"||e==="svg",Vp=e=>{let t=q3(e);return t==="png"||t==="svg"},J3=e=>!!e&&Object.values(Vs).includes(e),Or=e=>{let{type:t}=e||{};return J3(t)},Gp=async(e,t,n,a)=>{let i=await K3(e),r;try{try{r=JSON.parse(i)}catch(s){throw Or(e)?new Tr("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):s}if(EP(r))return{type:ae.excalidraw,data:lc({elements:Z3(r.elements||[]),appState:{theme:t==null?void 0:t.theme,fileHandle:a||e.handle||null,...d8(r.appState||{}),...t?Do(r.elements||[],t):{}},files:r.files},t,n,{repairBindings:!0,refreshDimensions:!1})};if(r3(r))return{type:ae.excalidrawlib,data:r};throw new Error("Error: invalid file")}catch(s){throw s instanceof Tr?s:new Error("Error: invalid file")}},Yp=async(e,t,n,a)=>{let i=await Gp(e,t,n,a);if(i.type!==ae.excalidraw)throw new Error("Error: invalid file");return i.data},Q3=(e,t="unpublished")=>{let n=JSON.parse(e);if(!r3(n))throw new Error("Invalid library");let a=n.libraryItems||n.library;return oc(a,t)},e4=async(e,t="unpublished")=>Q3(await K3(e),t),zo=async e=>new Promise(async(t,n)=>{try{tc(e)&&(e=await e),e.toBlob(a=>{if(!a)return n(new ET("Error: Canvas too big","CANVAS_POSSIBLY_TOO_BIG"));t(a)})}catch(a){n(a)}}),YN=async e=>{try{let t=await window.crypto.subtle.digest("SHA-1",await jr(e));return rM(new Uint8Array(t))}catch(t){return console.error(t),Lu(40)}},Z1=async e=>new Promise((t,n)=>{let a=new FileReader;a.onload=()=>{let i=a.result;t(i)},a.onerror=i=>n(i),a.readAsDataURL(e)}),ZN=(e,t)=>`data:${t};base64,${a4(uu(e),!0)}`,KN=(e,t="")=>{let n=e.indexOf(","),a=atob(e.slice(n+1)),i=e.slice(0,n).split(":")[1].split(";")[0],r=new ArrayBuffer(a.length),s=new Uint8Array(r);for(let l=0;l<a.length;l++)s[l]=a.charCodeAt(l);return new File([r],t,{type:i})},qN=e=>i4(e.slice(e.indexOf(",")+1)),K1=async(e,t)=>{if(e.type===ae.svg)return e;let[n,a]=await Promise.all([Promise.resolve().then(()=>require("./layers.BX1vqiN6.js")).then(r=>r.pica).then(r=>r.default),Promise.resolve().then(()=>require("./layers.C_IvrzZ3.js")).then(r=>r.default)]),i=a({pica:n({features:["js","wasm"]})});if(t.outputType){let{outputType:r}=t;i._create_blob=function(s){return this.pica.toBlob(s.out_canvas,r,.8).then(l=>(s.out_blob=l,s))}}if(!Or(e))throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"});return new File([await i.toBlob(e,{max:t.maxWidthOrHeight,alpha:!0})],e.name,{type:t.outputType||e.type})},Fg=(e,t="")=>new File([new TextEncoder().encode(e)],t,{type:ae.svg}),JN=async(e,t="")=>{let n;try{n=await fetch(e)}catch{throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"})}if(!n.ok)throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"});let a=await n.blob();if(a.type&&Or(a)){let i=t||a.name||"";return new File([a],i,{type:a.type})}throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"})},QN=async e=>{let t=e.dataTransfer.files.item(0),n=await eO(e);return{file:t?await Zp(t):null,fileHandle:n}},eO=async e=>{if(is)try{return await e.dataTransfer.items[0].getAsFileSystemHandle()||null}catch(t){return console.warn(t.name,t.message),null}return null},zg=e=>{let t=null,n=`${[...new Uint8Array(e).slice(0,8)].join(" ")} `,a={png:"137 80 78 71 13 10 26 10 ",jpg:"255 216 255 ",gif:"71 73 70 56 57 97 "};return n===a.png?t=ae.png:n.startsWith(a.jpg)?t=ae.jpg:n.startsWith(a.gif)&&(t=ae.gif),t},Yl=(e,t,n)=>new File([e],n||"",{type:t}),Zp=async e=>{var t,n;if(e.type){if(Or(e)){let a=await jr(e),i=zg(a);i&&i!==e.type&&(e=Yl(a,i,e.name))}}else if((t=e==null?void 0:e.name)!=null&&t.endsWith(".excalidrawlib"))e=Yl(await jr(e),ae.excalidrawlib,e.name);else if((n=e==null?void 0:e.name)!=null&&n.endsWith(".excalidraw"))e=Yl(await jr(e),ae.excalidraw,e.name);else{let a=await jr(e),i=zg(a);i&&(e=Yl(a,i,e.name))}return e},jr=e=>"arrayBuffer"in e?e.arrayBuffer():new Promise((t,n)=>{let a=new FileReader;a.onload=i=>{var r;if(!((r=i.target)!=null&&r.result))return n(new Error("Couldn't convert blob to ArrayBuffer"));t(i.target.result)},a.readAsArrayBuffer(e)}),uu=e=>{let t=typeof e=="string"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let a of t)n+=String.fromCharCode(a);return n},t4=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let a=0,i=e.length;a<i;a++)n[a]=e.charCodeAt(a);return t},n4=e=>new TextDecoder("utf-8").decode(t4(e)),a4=(e,t=!1)=>t?window.btoa(e):window.btoa(uu(e)),i4=(e,t=!1)=>t?window.atob(e):n4(window.atob(e)),r4=({text:e,compress:t})=>{let n;if(t!==!1)try{n=uu(kS(e))}catch(a){console.error("encode: cannot deflate",a)}return{version:"1",encoding:"bstring",compressed:!!n,encoded:n||uu(e)}},s4=e=>{let t;switch(e.encoding){case"bstring":t=e.compressed?e.encoded:n4(e.encoded);break;default:throw new Error(`decode: unknown encoding "${e.encoding}"`)}return e.compressed?MS(new Uint8Array(t4(t)),{to:"string"}):t},l4=async e=>{let t=Q5(new Uint8Array(await jr(e))).find(n=>n.name==="tEXt");return t?eb.decode(t.data):null},o4=async({blob:e,metadata:t})=>{let n=Q5(new Uint8Array(await jr(e))),a=eb.encode(ae.excalidraw,JSON.stringify(r4({text:t,compress:!0})));return n.splice(-1,0,a),new Blob([Yy(n)],{type:ae.png})},tO=async e=>{let t=await l4(e);if((t==null?void 0:t.keyword)===ae.excalidraw)try{let n=JSON.parse(t.text);if(!("encoded"in n)){if("type"in n&&n.type===Fn.excalidraw)return t.text;throw new Error("FAILED")}return s4(n)}catch(n){throw console.error(n),new Error("FAILED")}throw new Error("INVALID")},c4={paste:"Paste",pasteAsPlaintext:"Paste as plaintext",pasteCharts:"Paste charts",selectAll:"Select all",multiSelect:"Add element to selection",moveCanvas:"Move canvas",cut:"Cut",copy:"Copy",copyAsPng:"Copy to clipboard as PNG",copyAsSvg:"Copy to clipboard as SVG",copyText:"Copy to clipboard as text",copySource:"Copy source to clipboard",convertToCode:"Convert to code",bringForward:"Bring forward",sendToBack:"Send to back",bringToFront:"Bring to front",sendBackward:"Send backward",delete:"Delete",copyStyles:"Copy styles",pasteStyles:"Paste styles",stroke:"Stroke",changeStroke:"Change stroke color",background:"Background",changeBackground:"Change background color",fill:"Fill",strokeWidth:"Stroke width",strokeStyle:"Stroke style",strokeStyle_solid:"Solid",strokeStyle_dashed:"Dashed",strokeStyle_dotted:"Dotted",sloppiness:"Sloppiness",opacity:"Opacity",textAlign:"Text align",edges:"Edges",sharp:"Sharp",round:"Round",arrowheads:"Arrowheads",arrowhead_none:"None",arrowhead_arrow:"Arrow",arrowhead_bar:"Bar",arrowhead_circle:"Circle",arrowhead_circle_outline:"Circle (outline)",arrowhead_triangle:"Triangle",arrowhead_triangle_outline:"Triangle (outline)",arrowhead_diamond:"Diamond",arrowhead_diamond_outline:"Diamond (outline)",arrowhead_crowfoot_many:"Crow's foot (many)",arrowhead_crowfoot_one:"Crow's foot (one)",arrowhead_crowfoot_one_or_many:"Crow's foot (one or many)",more_options:"More options",arrowtypes:"Arrow type",arrowtype_sharp:"Sharp arrow",arrowtype_round:"Curved arrow",arrowtype_elbowed:"Elbow arrow",fontSize:"Font size",fontFamily:"Font family",addWatermark:'Add "Made with Excalidraw"',handDrawn:"Hand-drawn",normal:"Normal",code:"Code",small:"Small",medium:"Medium",large:"Large",veryLarge:"Very large",solid:"Solid",hachure:"Hachure",zigzag:"Zigzag",crossHatch:"Cross-hatch",thin:"Thin",bold:"Bold",left:"Left",center:"Center",right:"Right",extraBold:"Extra bold",architect:"Architect",artist:"Artist",cartoonist:"Cartoonist",fileTitle:"File name",colorPicker:"Color picker",canvasColors:"Used on canvas",canvasBackground:"Canvas background",drawingCanvas:"Drawing canvas",clearCanvas:"Clear canvas",layers:"Layers",actions:"Actions",language:"Language",liveCollaboration:"Live collaboration...",duplicateSelection:"Duplicate",untitled:"Untitled",name:"Name",yourName:"Your name",madeWithExcalidraw:"Made with Excalidraw",group:"Group selection",ungroup:"Ungroup selection",collaborators:"Collaborators",toggleGrid:"Toggle grid",addToLibrary:"Add to library",removeFromLibrary:"Remove from library",libraryLoadingMessage:"Loading library…",libraries:"Browse libraries",loadingScene:"Loading scene…",loadScene:"Load scene from file",align:"Align",alignTop:"Align top",alignBottom:"Align bottom",alignLeft:"Align left",alignRight:"Align right",centerVertically:"Center vertically",centerHorizontally:"Center horizontally",distributeHorizontally:"Distribute horizontally",distributeVertically:"Distribute vertically",flipHorizontal:"Flip horizontal",flipVertical:"Flip vertical",viewMode:"View mode",share:"Share",showStroke:"Show stroke color picker",showBackground:"Show background color picker",showFonts:"Show font picker",toggleTheme:"Toggle light/dark theme",theme:"Theme",personalLib:"Personal Library",excalidrawLib:"Excalidraw Library",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",unbindText:"Unbind text",bindText:"Bind text to the container",createContainerFromText:"Wrap text in a container",link:{edit:"Edit link",editEmbed:"Edit embeddable link",create:"Add link",label:"Link",labelEmbed:"Link & embed",empty:"No link is set",hint:"Type or paste your link here",goToElement:"Go to target element"},lineEditor:{edit:"Edit line",editArrow:"Edit arrow"},elementLock:{lock:"Lock",unlock:"Unlock",lockAll:"Lock all",unlockAll:"Unlock all"},statusPublished:"Published",sidebarLock:"Keep sidebar open",selectAllElementsInFrame:"Select all elements in frame",removeAllElementsFromFrame:"Remove all elements from frame",eyeDropper:"Pick color from canvas",textToDiagram:"Text to diagram",prompt:"Prompt",followUs:"Follow us",discordChat:"Discord chat",zoomToFitViewport:"Zoom to fit in viewport",zoomToFitSelection:"Zoom to fit selection",zoomToFit:"Zoom to fit all elements",installPWA:"Install Excalidraw locally (PWA)",autoResize:"Enable text auto-resizing",imageCropping:"Image cropping",unCroppedDimension:"Uncropped dimension",copyElementLink:"Copy link to object",linkToElement:"Link to object",wrapSelectionInFrame:"Wrap selection in frame"},d4={title:"Link to object",desc:"Click on a shape on canvas or paste a link.",notFound:"Linked object wasn't found on canvas."},u4={noItems:"No items added yet...",hint_emptyLibrary:"Select an item on canvas to add it here, or install a library from the public repository, below.",hint_emptyPrivateLibrary:"Select an item on canvas to add it here."},f4={title:"Find on canvas",noMatch:"No matches found...",singleResult:"result",multipleResults:"results",placeholder:"Find text on canvas..."},h4={clearReset:"Reset the canvas",exportJSON:"Export to file",exportImage:"Export image...",export:"Save to...",copyToClipboard:"Copy to clipboard",copyLink:"Copy link",save:"Save to current file",saveAs:"Save as",load:"Open",getShareableLink:"Get shareable link",close:"Close",selectLanguage:"Select language",scrollBackToContent:"Scroll back to content",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",menu:"Menu",done:"Done",edit:"Edit",undo:"Undo",redo:"Redo",resetLibrary:"Reset library",createNewRoom:"Create new room",fullScreen:"Full screen",darkMode:"Dark mode",lightMode:"Light mode",systemMode:"System mode",zenMode:"Zen mode",objectsSnapMode:"Snap to objects",exitZenMode:"Exit zen mode",cancel:"Cancel",clear:"Clear",remove:"Remove",embed:"Toggle embedding",publishLibrary:"Publish",submit:"Submit",confirm:"Confirm",embeddableInteractionButton:"Click to interact"},p4={clearReset:"This will clear the whole canvas. Are you sure?",couldNotCreateShareableLink:"Couldn't create shareable link.",couldNotCreateShareableLinkTooBig:"Couldn't create shareable link: the scene is too big",couldNotLoadInvalidFile:"Couldn't load invalid file",importBackendFailed:"Importing from backend failed.",cannotExportEmptyCanvas:"Cannot export empty canvas.",couldNotCopyToClipboard:"Couldn't copy to clipboard.",decryptFailed:"Couldn't decrypt data.",uploadedSecurly:"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can't read the content.",loadSceneOverridePrompt:"Loading external drawing will replace your existing content. Do you wish to continue?",collabStopOverridePrompt:`Stopping the session will overwrite your previous, locally stored drawing. Are you sure?
|
|
41
|
+
|
|
42
|
+
(If you want to keep your local drawing, simply close the browser tab instead.)`,errorAddingToLibrary:"Couldn't add item to the library",errorRemovingFromLibrary:"Couldn't remove item from the library",confirmAddLibrary:"This will add {{numShapes}} shape(s) to your library. Are you sure?",imageDoesNotContainScene:"This image does not seem to contain any scene data. Have you enabled scene embedding during export?",cannotRestoreFromImage:"Scene couldn't be restored from this image file",invalidSceneUrl:"Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",resetLibrary:"This will clear your library. Are you sure?",removeItemsFromsLibrary:"Delete {{count}} item(s) from library?",invalidEncryptionKey:"Encryption key must be of 22 characters. Live collaboration is disabled.",collabOfflineWarning:`No internet connection available.
|
|
43
|
+
Your changes will not be saved!`},U4={unsupportedFileType:"Unsupported file type.",imageInsertError:"Couldn't insert image. Try again later...",fileTooBig:"File is too big. Maximum allowed size is {{maxSize}}.",svgImageInsertError:"Couldn't insert SVG image. The SVG markup looks invalid.",failedToFetchImage:"Failed to fetch image.",cannotResolveCollabServer:"Couldn't connect to the collab server. Please reload the page and try again.",importLibraryError:"Couldn't load library",saveLibraryError:"Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.",collabSaveFailed:"Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.",collabSaveFailed_sizeExceeded:"Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.",imageToolNotSupported:"Images are disabled.",brave_measure_text_error:{line1:"Looks like you are using Brave browser with the <bold>Aggressively Block Fingerprinting</bold> setting enabled.",line2:"This could result in breaking the <bold>Text Elements</bold> in your drawings.",line3:"We strongly recommend disabling this setting. You can follow <link>these steps</link> on how to do so.",line4:"If disabling this setting doesn't fix the display of text elements, please open an <issueLink>issue</issueLink> on our GitHub, or write us on <discordLink>Discord</discordLink>"},libraryElementTypeError:{embeddable:"Embeddable elements cannot be added to the library.",iframe:"IFrame elements cannot be added to the library.",image:"Support for adding images to the library coming soon!"},asyncPasteFailedOnRead:"Couldn't paste (couldn't read from system clipboard).",asyncPasteFailedOnParse:"Couldn't paste.",copyToSystemClipboardFailed:"Couldn't copy to clipboard."},m4={selection:"Selection",image:"Insert image",rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Draw",text:"Text",library:"Library",lock:"Keep selected tool active after drawing",penMode:"Pen mode - prevent touch",link:"Add / Update link for a selected shape",eraser:"Eraser",frame:"Frame tool",magicframe:"Wireframe to code",embeddable:"Web Embed",laser:"Laser pointer",hand:"Hand (panning tool)",extraTools:"More tools",mermaidToExcalidraw:"Mermaid to Excalidraw"},g4={rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Freedraw",text:"Text",image:"Image",group:"Group",frame:"Frame",magicframe:"Wireframe to code",embeddable:"Web Embed",selection:"Selection",iframe:"IFrame"},b4={canvasActions:"Canvas actions",selectedShapeActions:"Selected shape actions",shapes:"Shapes"},v4={dismissSearch:"Escape to dismiss search",canvasPanning:"To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool",linearElement:"Click to start multiple points, drag for single line",arrowTool:"Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.",freeDraw:"Click and drag, release when you're finished",text:"Tip: you can also add text by double-clicking anywhere with the selection tool",embeddable:"Click-drag to create a website embed",text_selected:"Double-click or press ENTER to edit text",text_editing:"Press Escape or CtrlOrCmd+ENTER to finish editing",linearElementMulti:"Click on last point or press Escape or Enter to finish",lockAngle:"You can constrain angle by holding SHIFT",resize:`You can constrain proportions by holding SHIFT while resizing,
|
|
44
|
+
hold ALT to resize from the center`,resizeImage:`You can resize freely by holding SHIFT,
|
|
45
|
+
hold ALT to resize from the center`,rotate:"You can constrain angles by holding SHIFT while rotating",lineEditor_info:"Hold CtrlOrCmd and Double-click or press CtrlOrCmd + Enter to edit points",lineEditor_pointSelected:`Press Delete to remove point(s),
|
|
46
|
+
CtrlOrCmd+D to duplicate, or drag to move`,lineEditor_nothingSelected:`Select a point to edit (hold SHIFT to select multiple),
|
|
47
|
+
or hold Alt and click to add new points`,placeImage:"Click to place the image, or click and drag to set its size manually",publishLibrary:"Publish your own library",bindTextToElement:"Press enter to add text",createFlowchart:"Hold CtrlOrCmd and Arrow key to create a flowchart",deepBoxSelect:"Hold CtrlOrCmd to deep select, and to prevent dragging",eraserRevert:"Hold Alt to revert the elements marked for deletion",firefox_clipboard_write:'This feature can likely be enabled by setting the "dom.events.asyncClipboard.clipboardItem" flag to "true". To change the browser flags in Firefox, visit the "about:config" page.',disableSnapping:"Hold CtrlOrCmd to disable snapping",enterCropEditor:"Double click the image or press ENTER to crop the image",leaveCropEditor:"Click outside the image or press ENTER or ESCAPE to finish cropping"},x4={cannotShowPreview:"Cannot show preview",canvasTooBig:"The canvas may be too big.",canvasTooBigTip:"Tip: try moving the farthest elements a bit closer together."},y4={headingMain:"Encountered an error. Try <button>reloading the page</button>.",clearCanvasMessage:"If reloading doesn't work, try <button>clearing the canvas</button>.",clearCanvasCaveat:" This will result in loss of work ",trackedToSentry:"The error with identifier {{eventId}} was tracked on our system.",openIssueMessage:"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our <button>bug tracker</button>. Please include information below by copying and pasting into the GitHub issue.",sceneContent:"Scene content:"},w4={or:"Or"},E4={desc_intro:"Invite people to collaborate on your drawing.",desc_privacy:"Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.",button_startSession:"Start session",button_stopSession:"Stop session",desc_inProgressIntro:"Live-collaboration session is now in progress.",desc_shareLink:"Share this link with anyone you want to collaborate with:",desc_exitSession:"Stopping the session will disconnect you from the room, but you'll be able to continue working with the scene, locally. Note that this won't affect other people, and they'll still be able to collaborate on their version.",shareTitle:"Join a live collaboration session on Excalidraw"},S4={title:"Error"},C4={disk_title:"Save to disk",disk_details:"Export the scene data to a file from which you can import later.",disk_button:"Save to file",link_title:"Shareable link",link_details:"Export as a read-only link.",link_button:"Export to Link",excalidrawplus_description:"Save the scene to your Excalidraw+ workspace.",excalidrawplus_button:"Export",excalidrawplus_exportError:"Couldn't export to Excalidraw+ at this moment..."},k4={blog:"Read our blog",click:"click",deepSelect:"Deep select",deepBoxSelect:"Deep select within box, and prevent dragging",createFlowchart:"Create a flowchart from a generic element",navigateFlowchart:"Navigate a flowchart",curvedArrow:"Curved arrow",curvedLine:"Curved line",documentation:"Documentation",doubleClick:"double-click",drag:"drag",editor:"Editor",editLineArrowPoints:"Edit line/arrow points",editText:"Edit text / add label",github:"Found an issue? Submit",howto:"Follow our guides",or:"or",preventBinding:"Prevent arrow binding",tools:"Tools",shortcuts:"Keyboard shortcuts",textFinish:"Finish editing (text editor)",textNewLine:"Add new line (text editor)",title:"Help",view:"View",zoomToFit:"Zoom to fit all elements",zoomToSelection:"Zoom to selection",toggleElementLock:"Lock/unlock selection",movePageUpDown:"Move page up/down",movePageLeftRight:"Move page left/right",cropStart:"Crop image",cropFinish:"Finish image cropping"},M4={title:"Clear canvas"},I4={title:"Publish library",itemName:"Item name",authorName:"Author name",githubUsername:"GitHub username",twitterUsername:"Twitter username",libraryName:"Library name",libraryDesc:"Library description",website:"Website",placeholder:{authorName:"Your name or username",libraryName:"Name of your library",libraryDesc:"Description of your library to help people understand its usage",githubHandle:"GitHub handle (optional), so you can edit the library once submitted for review",twitterHandle:"Twitter username (optional), so we know who to credit when promoting over Twitter",website:"Link to your personal website or elsewhere (optional)"},errors:{required:"Required",website:"Enter a valid URL"},noteDescription:"Submit your library to be included in the <link>public library repository</link> for other people to use in their drawings.",noteGuidelines:"The library needs to be manually approved first. Please read the <link>guidelines</link> before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required.",noteLicense:"By submitting, you agree the library will be published under the <link>MIT License</link>, which in short means anyone can use them without restrictions.",noteItems:"Each library item must have its own name so it's filterable. The following library items will be included:",atleastOneLibItem:"Please select at least one library item to get started",republishWarning:"Note: some of the selected items are marked as already published/submitted. You should only resubmit items when updating an existing library or submission."},T4={title:"Library submitted",content:"Thank you {{authorName}}. Your library has been submitted for review. You can track the status <link>here</link>"},_4={resetLibrary:"Reset library",removeItemsFromLib:"Remove selected items from library"},j4={header:"Export image",label:{withBackground:"Background",onlySelected:"Only selected",darkMode:"Dark mode",embedScene:"Embed scene",scale:"Scale",padding:"Padding"},tooltip:{embedScene:`Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.
|
|
48
|
+
Will increase exported file size.`},title:{exportToPng:"Export to PNG",exportToSvg:"Export to SVG",copyPngToClipboard:"Copy PNG to clipboard"},button:{exportToPng:"PNG",exportToSvg:"SVG",copyPngToClipboard:"Copy to clipboard"}},A4={tooltip:"Your drawings are end-to-end encrypted so Excalidraw's servers will never see them.",link:"Blog post on end-to-end encryption in Excalidraw"},R4={angle:"Angle",shapes:"Shapes",height:"Height",scene:"Scene",selected:"Selected",storage:"Storage",fullTitle:"Canvas & Shape properties",title:"Properties",generalStats:"General",elementProperties:"Shape properties",total:"Total",version:"Version",versionCopy:"Click to copy",versionNotAvailable:"Version not available",width:"Width"},L4={addedToLibrary:"Added to library",copyStyles:"Copied styles.",copyToClipboard:"Copied to clipboard.",copyToClipboardAsPng:`Copied {{exportSelection}} to clipboard as PNG
|
|
49
|
+
({{exportColorScheme}})`,copyToClipboardAsSvg:`Copied {{exportSelection}} to clipboard as SVG
|
|
50
|
+
({{exportColorScheme}})`,fileSaved:"File saved.",fileSavedToFilename:"Saved to {filename}",canvas:"canvas",selection:"selection",pasteAsSingleElement:`Use {{shortcut}} to paste as a single element,
|
|
51
|
+
or paste into an existing text editor`,unableToEmbed:"Embedding this url is currently not allowed. Raise an issue on GitHub to request the url whitelisted",unrecognizedLinkFormat:"The link you embedded does not match the expected format. Please try to paste the 'embed' string provided by the source site",elementLinkCopied:"Link copied to clipboard"},D4={transparent:"Transparent",black:"Black",white:"White",red:"Red",pink:"Pink",grape:"Grape",violet:"Violet",gray:"Gray",blue:"Blue",cyan:"Cyan",teal:"Teal",green:"Green",yellow:"Yellow",orange:"Orange",bronze:"Bronze"},P4={app:{center_heading:"All your data is saved locally in your browser.",center_heading_plus:"Did you want to go to the Excalidraw+ instead?",menuHint:"Export, preferences, languages, ..."},defaults:{menuHint:"Export, preferences, and more...",center_heading:"Diagrams. Made. Simple.",toolbarHint:"Pick a tool & Start drawing!",helpHint:"Shortcuts & help"}},N4={mostUsedCustomColors:"Most used custom colors",colors:"Colors",shades:"Shades",hexCode:"Hex code",noShades:"No shades available for this color"},O4={action:{exportToImage:{title:"Export as image",button:"Export as image",description:"Export the scene data as an image from which you can import later."},saveToDisk:{title:"Save to disk",button:"Save to disk",description:"Export the scene data to a file from which you can import later."},excalidrawPlus:{title:"Excalidraw+",button:"Export to Excalidraw+",description:"Save the scene to your Excalidraw+ workspace."}},modal:{loadFromFile:{title:"Load from file",button:"Load from file",description:"Loading from a file will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first using one of the options below."},shareableLink:{title:"Load from link",button:"Replace my content",description:"Loading external drawing will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first by using one of the options below."}}},$4={title:"Mermaid to Excalidraw",button:"Insert",description:"Currently only <flowchartLink>Flowchart</flowchartLink>,<sequenceLink> Sequence, </sequenceLink> and <classLink>Class </classLink>Diagrams are supported. The other types will be rendered as image in Excalidraw.",syntax:"Mermaid Syntax",preview:"Preview"},F4={placeholder:"Quick search"},z4={badge:{old:"old"},sceneFonts:"In this scene",availableFonts:"Available fonts",empty:"No fonts found"},B4={empty:"No users found",hint:{text:"Click on user to follow",followStatus:"You're currently following this user",inCall:"User is in a voice call",micMuted:"User's microphone is muted",isSpeaking:"User is speaking"}},H4={title:"Command palette",shortcuts:{select:"Select",confirm:"Confirm",close:"Close"},recents:"Recently used",search:{placeholder:"Search menus, commands, and discover hidden gems",noMatch:"No matching commands..."},itemNotAvailable:"Command is not available...",shortcutHint:"For Command palette, use {{shortcut}}"},Kp={labels:c4,elementLink:d4,library:u4,search:f4,buttons:h4,alerts:p4,errors:U4,toolBar:m4,element:g4,headings:b4,hints:v4,canvasError:x4,errorSplash:y4,shareDialog:w4,roomDialog:E4,errorDialog:S4,exportDialog:C4,helpDialog:k4,clearCanvasDialog:M4,publishDialog:I4,publishSuccessDialog:T4,confirmDialog:_4,imageExportDialog:j4,encrypted:A4,stats:R4,toast:L4,colors:D4,welcomeScreen:P4,colorPicker:N4,overwriteConfirm:O4,mermaid:$4,quickSearch:F4,fontList:z4,userList:B4,commandPalette:H4},X4=100,W4=36,V4={"ar-SA":94,"az-AZ":17,"bg-BG":71,"bn-BD":52,"ca-ES":83,"cs-CZ":86,"da-DK":61,"de-DE":100,"el-GR":80,en:X4,"es-ES":96,"eu-ES":97,"fa-IR":84,"fi-FI":76,"fr-FR":99,"gl-ES":86,"he-IL":77,"hi-IN":76,"hu-HU":76,"id-ID":91,"it-IT":98,"ja-JP":90,kaa:W4,"kab-KAB":76,"kk-KZ":18,"km-KH":83,"ko-KR":100,"ku-TR":87,"lt-LT":48,"lv-LV":77,"mr-IN":98,"my-MM":35,"nb-NO":93,"nl-NL":75,"nn-NO":67,"oc-FR":92,"pa-IN":78,"pl-PL":99,"pt-BR":91,"pt-PT":83,"ro-RO":99,"ru-RU":92,"si-LK":7,"sk-SK":100,"sl-SI":100,"sv-SE":100,"ta-IN":81,"th-TH":44,"tr-TR":87,"uk-UA":93,"vi-VN":49,"zh-CN":100,"zh-HK":22,"zh-TW":100};const xi={};let nO=0;function Bt(e,t){const n=`atom${++nO}`,a={toString(){return(xi?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?a.read=e:(a.init=e,a.read=aO,a.write=iO),a}function aO(e){return e(this)}function iO(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const Bg=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,q1=e=>"init"in e,xh=e=>!!e.write,fu=new WeakMap,J1=e=>{var t;return Q1(e)&&!((t=fu.get(e))!=null&&t[1])},rO=(e,t)=>{const n=fu.get(e);if(n)n[1]=!0,n[0].forEach(a=>a(t));else if((xi?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},sO=e=>{if(fu.has(e))return;const t=[new Set,!1];fu.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=a=>{t[0].add(a)}},Q1=e=>typeof(e==null?void 0:e.then)=="function",Hg=e=>"v"in e||"e"in e,Nc=e=>{if("e"in e)throw e.e;if((xi?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},G4=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},Xg=(e,t,n,a,i)=>{var r;if((xi?"production":void 0)!=="production"&&a===t)throw new Error("[Bug] atom cannot depend on itself");n.d.set(a,i.n),J1(n.v)&&G4(t,n.v,i),(r=i.m)==null||r.t.add(t),e&&lO(e,a,t)},Al=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),uo=(e,t,n)=>{e[t].add(n)},Wg=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),uo(e,"M",()=>{var a;(a=n.m)==null||a.l.forEach(i=>uo(e,"M",i))}))},lO=(e,t,n)=>{const a=e.D.get(t);a&&a.add(n)},oO=(e,t)=>e.D.get(t),Ur=e=>{let t,n=!1;const a=i=>{try{i()}catch(r){n||(t=r,n=!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(a),e.H.clear(),e.M.forEach(a),e.M.clear(),e.L.forEach(a),e.L.clear();if(n)throw t},Y4=(...[e,t,n,a])=>{const i=(b,v,x)=>{const y="v"in v,E=v.v,S=J1(v.v)?v.v:null;if(Q1(x)){sO(x);for(const w of v.d.keys())G4(b,x,e(w));v.v=x}else v.v=x;delete v.e,delete v.x,(!y||!Object.is(E,v.v))&&(++v.n,S&&rO(S,x))},r=(b,v)=>{var x;const y=e(v);if(Hg(y)&&(y.m&&!y.x||Array.from(y.d).every(([_,j])=>r(b,_).n===j)))return y;y.d.clear();let E=!0;const S=_=>{if(Bg(v,_)){const A=e(_);if(!Hg(A))if(q1(_))i(_,A,_.init);else throw new Error("no atom init");return Nc(A)}const j=r(b,_);try{return Nc(j)}finally{if(E)Xg(b,v,y,_,j);else{const A=Al();Xg(A,v,y,_,j),u(A,v,y),Ur(A)}}};let w,k;const T={get signal(){return w||(w=new AbortController),w.signal},get setSelf(){return(xi?"production":void 0)!=="production"&&!xh(v)&&console.warn("setSelf function cannot be used with read-only atom"),!k&&xh(v)&&(k=(..._)=>{if((xi?"production":void 0)!=="production"&&E&&console.warn("setSelf function cannot be called in sync"),!E)return o(v,..._)}),k}};try{const _=t(v,S,T);if(i(v,y,_),Q1(_)){(x=_.onCancel)==null||x.call(_,()=>w==null?void 0:w.abort());const j=()=>{if(y.m){const A=Al();u(A,v,y),Ur(A)}};_.then(j,j)}return y}catch(_){return delete y.v,y.e=_,delete y.x,++y.n,y}finally{E=!1}},s=b=>Nc(r(void 0,b)),l=(b,v,x)=>{var y,E;const S=new Map;for(const w of((y=x.m)==null?void 0:y.t)||[]){const k=e(w);k.m&&S.set(w,k)}for(const w of x.p)S.set(w,e(w));return(E=oO(b,v))==null||E.forEach(w=>{S.set(w,e(w))}),S},c=(b,v,x)=>{const y=[],E=new Set,S=new Set,w=[[v,x]];for(;w.length>0;){const[k,T]=w[w.length-1];if(S.has(k)){w.pop();continue}if(E.has(k)){y.push([k,T,T.n]),S.add(k),T.x=!0,w.pop();continue}E.add(k);for(const[_,j]of l(b,k,T))k!==_&&!E.has(_)&&w.push([_,j])}uo(b,"H",()=>{const k=new Set([v]);for(let T=y.length-1;T>=0;--T){const[_,j,A]=y[T];let R=!1;for(const N of j.d.keys())if(N!==_&&k.has(N)){R=!0;break}R&&(r(b,_),u(b,_,j),A!==j.n&&(Wg(b,_,j),k.add(_))),delete j.x}})},d=(b,v,...x)=>{let y=!0;const E=w=>Nc(r(b,w)),S=(w,...k)=>{const T=e(w);try{if(Bg(v,w)){if(!q1(w))throw new Error("atom not writable");const _=T.n,j=k[0];i(w,T,j),u(b,w,T),_!==T.n&&(Wg(b,w,T),c(b,w,T));return}else return d(b,w,...k)}finally{y||Ur(b)}};try{return n(v,E,S,...x)}finally{y=!1}},o=(b,...v)=>{const x=Al();try{return d(x,b,...v)}finally{Ur(x)}},u=(b,v,x)=>{if(x.m&&!J1(x.v)){for(const y of x.d.keys())x.m.d.has(y)||(h(b,y,e(y)).t.add(v),x.m.d.add(y));for(const y of x.m.d||[])if(!x.d.has(y)){x.m.d.delete(y);const E=p(b,y,e(y));E==null||E.t.delete(v)}}},h=(b,v,x)=>{if(!x.m){r(b,v);for(const y of x.d.keys())h(b,y,e(y)).t.add(v);if(x.m={l:new Set,d:new Set(x.d.keys()),t:new Set},xh(v)){const y=x.m;let E;const S=(w,k)=>{let T=!0;E=(..._)=>{try{return d(w,v,..._)}finally{T||Ur(w)}};try{return k()}finally{T=!1}};uo(b,"L",()=>{const w=S(b,()=>a(v,(...k)=>E(...k)));w&&(y.u=k=>S(k,w))})}}return x.m},p=(b,v,x)=>{if(x.m&&!x.m.l.size&&!Array.from(x.m.t).some(y=>{var E;return(E=e(y).m)==null?void 0:E.d.has(v)})){const y=x.m.u;y&&uo(b,"L",()=>y(b)),delete x.m;for(const E of x.d.keys()){const S=p(b,E,e(E));S==null||S.t.delete(v)}return}return x.m};return{get:s,set:o,sub:(b,v)=>{const x=Al(),y=e(b),S=h(x,b,y).l;return S.add(v),Ur(x),()=>{S.delete(v);const w=Al();p(w,b,y),Ur(w)}},unstable_derive:b=>Y4(...b(e,t,n,a))}},cO=e=>{const t=new WeakMap,n=new Set;let a,i=0;const r=e.unstable_derive((c,d,o,u)=>(a=c,[h=>{let p=t.get(h);if(!p){const U=c(h);p=new Proxy(U,{set(m,g,b){return g==="m"&&n.add(h),Reflect.set(m,g,b)},deleteProperty(m,g){return g==="m"&&n.delete(h),Reflect.deleteProperty(m,g)}}),t.set(h,p)}return p},d,(h,p,U,...m)=>i?U(h,...m):o(h,p,U,...m),u])),s=r.set;return Object.assign(r,{dev4_get_internal_weak_map:()=>({get:c=>{const d=a(c);if(d.n!==0)return d}}),dev4_get_mounted_atoms:()=>n,dev4_restore_atoms:c=>{s({read:()=>null,write:(o,u)=>{++i;try{for(const[h,p]of c)q1(h)&&u(h,p)}finally{--i}}})}})},qp=()=>{const e=new WeakMap,n=Y4(a=>{if((xi?"production":void 0)!=="production"&&!a)throw new Error("Atom is undefined or null");let i=e.get(a);return i||(i={d:new Map,p:new Set,n:0},e.set(a,i)),i},(a,...i)=>a.read(...i),(a,...i)=>a.write(...i),(a,...i)=>{var r;return(r=a.onMount)==null?void 0:r.call(a,...i)});return(xi?"production":void 0)!=="production"?cO(n):n};let Rl;const dO=()=>(Rl||(Rl=qp(),(xi?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Rl),globalThis.__JOTAI_DEFAULT_STORE__!==Rl&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Rl),Z4={},uO=M.createContext(void 0),of=e=>{const t=M.useContext(uO);return(e==null?void 0:e.store)||t||dO()},e0=e=>typeof(e==null?void 0:e.then)=="function",K4=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},fO=M.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(K4(e),e)}),yh=new WeakMap,Vg=e=>{let t=yh.get(e);return t||(t=new Promise((n,a)=>{let i=e;const r=c=>d=>{i===c&&n(d)},s=c=>d=>{i===c&&a(d)},l=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(d=>{if((Z4?"production":void 0)!=="production"&&d===c)throw new Error("[Bug] p is not updated even after cancelation");e0(d)?(yh.set(d,t),i=d,d.then(r(d),s(d)),l(d)):n(d)})};e.then(r(e),s(e)),l(e)}),yh.set(e,t)),t};function q4(e,t){const n=of(t),[[a,i,r],s]=M.useReducer(d=>{const o=n.get(e);return Object.is(d[0],o)&&d[1]===n&&d[2]===e?d:[o,n,e]},void 0,()=>[n.get(e),n,e]);let l=a;(i!==n||r!==e)&&(s(),l=n.get(e));const c=t==null?void 0:t.delay;if(M.useEffect(()=>{const d=n.sub(e,()=>{if(typeof c=="number"){const o=n.get(e);e0(o)&&K4(Vg(o)),setTimeout(s,c);return}s()});return s(),d},[n,e,c]),M.useDebugValue(l),e0(l)){const d=Vg(l);return fO(d)}return l}function J4(e,t){const n=of(t);return M.useCallback((...i)=>{if((Z4?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function hO(e,t){return[q4(e,t),J4(e,t)]}const Gg=new WeakMap;function pO(e,t){const n=of(t),a=UO(n);for(const[i,r]of e)(!a.has(i)||t!=null&&t.dangerouslyForceHydrate)&&(a.add(i),n.set(i,r))}const UO=e=>{let t=Gg.get(e);return t||(t=new WeakSet,Gg.set(e,t)),t};function Ls(){return Ls=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Ls.apply(this,arguments)}function Q4(){const e=M.createContext(null);function t({store:s,initialValues:l=[],children:c}){const d=M.useRef(s);return d.current||(d.current=qp()),pO(l,{store:d.current}),f.jsx(e.Provider,{value:d.current,children:c})}const n=s=>{const l=M.useContext(e);if(!l)throw new Error("Missing Provider from createIsolation");return of(Ls({store:l},s))};return{Provider:t,useStore:n,useAtom:(s,l)=>{const c=n();return hO(s,Ls({store:c},l))},useAtomValue:(s,l)=>{const c=n();return q4(s,Ls({store:c},l))},useSetAtom:(s,l)=>{const c=n();return J4(s,Ls({store:c},l))}}}process.env.NODE_ENV;const{read:dZ,write:uZ}=Bt(null);M.createContext({scope:void 0,baseStore:void 0});function qi(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Yg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function e9(...e){return t=>{let n=!1;const a=e.map(i=>{const r=Yg(i,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<a.length;i++){const r=a[i];typeof r=="function"?r():Yg(e[i],null)}}}}function dr(...e){return B.useCallback(e9(...e),e)}function t9(e,t=[]){let n=[];function a(r,s){const l=B.createContext(s),c=n.length;n=[...n,s];const d=u=>{var b;const{scope:h,children:p,...U}=u,m=((b=h==null?void 0:h[e])==null?void 0:b[c])||l,g=B.useMemo(()=>U,Object.values(U));return f.jsx(m.Provider,{value:g,children:p})};d.displayName=r+"Provider";function o(u,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[c])||l,U=B.useContext(p);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${r}\``)}return[d,o]}const i=()=>{const r=n.map(s=>B.createContext(s));return function(l){const c=(l==null?void 0:l[e])||r;return B.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[a,mO(i,...t)]}function mO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(r){const s=a.reduce((l,{useScope:c,scopeName:d})=>{const u=c(r)[`__scope${d}`];return{...l,...u}},{});return B.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Jp=B.forwardRef((e,t)=>{const{children:n,...a}=e,i=B.Children.toArray(n),r=i.find(bO);if(r){const s=r.props.children,l=i.map(c=>c===r?B.Children.count(s)>1?B.Children.only(null):B.isValidElement(s)?s.props.children:null:c);return f.jsx(t0,{...a,ref:t,children:B.isValidElement(s)?B.cloneElement(s,void 0,l):null})}return f.jsx(t0,{...a,ref:t,children:n})});Jp.displayName="Slot";var t0=B.forwardRef((e,t)=>{const{children:n,...a}=e;if(B.isValidElement(n)){const i=xO(n),r=vO(a,n.props);return n.type!==B.Fragment&&(r.ref=t?e9(t,i):i),B.cloneElement(n,r)}return B.Children.count(n)>1?B.Children.only(null):null});t0.displayName="SlotClone";var gO=({children:e})=>f.jsx(f.Fragment,{children:e});function bO(e){return B.isValidElement(e)&&e.type===gO}function vO(e,t){const n={...t};for(const a in t){const i=e[a],r=t[a];/^on[A-Z]/.test(a)?i&&r?n[a]=(...l)=>{r(...l),i(...l)}:i&&(n[a]=i):a==="style"?n[a]={...i,...r}:a==="className"&&(n[a]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}function xO(e){var a,i;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ki=yO.reduce((e,t)=>{const n=B.forwardRef((a,i)=>{const{asChild:r,...s}=a,l=r?Jp:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(l,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function wO(e,t){e&&Z5.flushSync(()=>e.dispatchEvent(t))}function ar(e){const t=B.useRef(e);return B.useEffect(()=>{t.current=e}),B.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function EO(e,t=globalThis==null?void 0:globalThis.document){const n=ar(e);B.useEffect(()=>{const a=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var SO="DismissableLayer",n0="dismissableLayer.update",CO="dismissableLayer.pointerDownOutside",kO="dismissableLayer.focusOutside",Zg,n9=B.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),a9=B.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:s,onDismiss:l,...c}=e,d=B.useContext(n9),[o,u]=B.useState(null),h=(o==null?void 0:o.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=B.useState({}),U=dr(t,w=>u(w)),m=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(g),v=o?m.indexOf(o):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,y=v>=b,E=TO(w=>{const k=w.target,T=[...d.branches].some(_=>_.contains(k));!y||T||(i==null||i(w),s==null||s(w),w.defaultPrevented||l==null||l())},h),S=_O(w=>{const k=w.target;[...d.branches].some(_=>_.contains(k))||(r==null||r(w),s==null||s(w),w.defaultPrevented||l==null||l())},h);return EO(w=>{v===d.layers.size-1&&(a==null||a(w),!w.defaultPrevented&&l&&(w.preventDefault(),l()))},h),B.useEffect(()=>{if(o)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Zg=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(o)),d.layers.add(o),Kg(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Zg)}},[o,h,n,d]),B.useEffect(()=>()=>{o&&(d.layers.delete(o),d.layersWithOutsidePointerEventsDisabled.delete(o),Kg())},[o,d]),B.useEffect(()=>{const w=()=>p({});return document.addEventListener(n0,w),()=>document.removeEventListener(n0,w)},[]),f.jsx(ki.div,{...c,ref:U,style:{pointerEvents:x?y?"auto":"none":void 0,...e.style},onFocusCapture:qi(e.onFocusCapture,S.onFocusCapture),onBlurCapture:qi(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:qi(e.onPointerDownCapture,E.onPointerDownCapture)})});a9.displayName=SO;var MO="DismissableLayerBranch",IO=B.forwardRef((e,t)=>{const n=B.useContext(n9),a=B.useRef(null),i=dr(t,a);return B.useEffect(()=>{const r=a.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),f.jsx(ki.div,{...e,ref:i})});IO.displayName=MO;function TO(e,t=globalThis==null?void 0:globalThis.document){const n=ar(e),a=B.useRef(!1),i=B.useRef(()=>{});return B.useEffect(()=>{const r=l=>{if(l.target&&!a.current){let c=function(){i9(CO,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);a.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",r),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function _O(e,t=globalThis==null?void 0:globalThis.document){const n=ar(e),a=B.useRef(!1);return B.useEffect(()=>{const i=r=>{r.target&&!a.current&&i9(kO,n,{originalEvent:r},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Kg(){const e=new CustomEvent(n0);document.dispatchEvent(e)}function i9(e,t,n,{discrete:a}){const i=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),a?wO(i,r):i.dispatchEvent(r)}var wh=0;function jO(){B.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qg()),document.body.insertAdjacentElement("beforeend",e[1]??qg()),wh++,()=>{wh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),wh--}},[])}function qg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Eh="focusScope.autoFocusOnMount",Sh="focusScope.autoFocusOnUnmount",Jg={bubbles:!1,cancelable:!0},AO="FocusScope",r9=B.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:r,...s}=e,[l,c]=B.useState(null),d=ar(i),o=ar(r),u=B.useRef(null),h=dr(t,m=>c(m)),p=B.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;B.useEffect(()=>{if(a){let m=function(x){if(p.paused||!l)return;const y=x.target;l.contains(y)?u.current=y:Ni(u.current,{select:!0})},g=function(x){if(p.paused||!l)return;const y=x.relatedTarget;y!==null&&(l.contains(y)||Ni(u.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&Ni(l)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const v=new MutationObserver(b);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),v.disconnect()}}},[a,l,p.paused]),B.useEffect(()=>{if(l){e6.add(p);const m=document.activeElement;if(!l.contains(m)){const b=new CustomEvent(Eh,Jg);l.addEventListener(Eh,d),l.dispatchEvent(b),b.defaultPrevented||(RO(OO(s9(l)),{select:!0}),document.activeElement===m&&Ni(l))}return()=>{l.removeEventListener(Eh,d),setTimeout(()=>{const b=new CustomEvent(Sh,Jg);l.addEventListener(Sh,o),l.dispatchEvent(b),b.defaultPrevented||Ni(m??document.body,{select:!0}),l.removeEventListener(Sh,o),e6.remove(p)},0)}}},[l,d,o,p]);const U=B.useCallback(m=>{if(!n&&!a||p.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(g&&b){const v=m.currentTarget,[x,y]=LO(v);x&&y?!m.shiftKey&&b===y?(m.preventDefault(),n&&Ni(x,{select:!0})):m.shiftKey&&b===x&&(m.preventDefault(),n&&Ni(y,{select:!0})):b===v&&m.preventDefault()}},[n,a,p.paused]);return f.jsx(ki.div,{tabIndex:-1,...s,ref:h,onKeyDown:U})});r9.displayName=AO;function RO(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(Ni(a,{select:t}),document.activeElement!==n)return}function LO(e){const t=s9(e),n=Qg(t,e),a=Qg(t.reverse(),e);return[n,a]}function s9(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const i=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||i?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qg(e,t){for(const n of e)if(!DO(n,{upTo:t}))return n}function DO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function PO(e){return e instanceof HTMLInputElement&&"select"in e}function Ni(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&PO(e)&&t&&e.select()}}var e6=NO();function NO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=t6(e,t),e.unshift(t)},remove(t){var n;e=t6(e,t),(n=e[0])==null||n.resume()}}}function t6(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function OO(e){return e.filter(t=>t.tagName!=="A")}var es=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{},$O=B.useId||(()=>{}),FO=0;function zO(e){const[t,n]=B.useState($O());return es(()=>{n(a=>a??String(FO++))},[e]),e||(t?`radix-${t}`:"")}const BO=["top","right","bottom","left"],ir=Math.min,kn=Math.max,hu=Math.round,Oc=Math.floor,$a=e=>({x:e,y:e}),HO={left:"right",right:"left",bottom:"top",top:"bottom"},XO={start:"end",end:"start"};function a0(e,t,n){return kn(e,ir(t,n))}function yi(e,t){return typeof e=="function"?e(t):e}function wi(e){return e.split("-")[0]}function Ul(e){return e.split("-")[1]}function Qp(e){return e==="x"?"y":"x"}function eU(e){return e==="y"?"height":"width"}const WO=new Set(["top","bottom"]);function Pa(e){return WO.has(wi(e))?"y":"x"}function tU(e){return Qp(Pa(e))}function VO(e,t,n){n===void 0&&(n=!1);const a=Ul(e),i=tU(e),r=eU(i);let s=i==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=pu(s)),[s,pu(s)]}function GO(e){const t=pu(e);return[i0(e),t,i0(t)]}function i0(e){return e.replace(/start|end/g,t=>XO[t])}const n6=["left","right"],a6=["right","left"],YO=["top","bottom"],ZO=["bottom","top"];function KO(e,t,n){switch(e){case"top":case"bottom":return n?t?a6:n6:t?n6:a6;case"left":case"right":return t?YO:ZO;default:return[]}}function qO(e,t,n,a){const i=Ul(e);let r=KO(wi(e),n==="start",a);return i&&(r=r.map(s=>s+"-"+i),t&&(r=r.concat(r.map(i0)))),r}function pu(e){return e.replace(/left|right|bottom|top/g,t=>HO[t])}function JO(e){return{top:0,right:0,bottom:0,left:0,...e}}function l9(e){return typeof e!="number"?JO(e):{top:e,right:e,bottom:e,left:e}}function Uu(e){const{x:t,y:n,width:a,height:i}=e;return{width:a,height:i,top:n,left:t,right:t+a,bottom:n+i,x:t,y:n}}function i6(e,t,n){let{reference:a,floating:i}=e;const r=Pa(t),s=tU(t),l=eU(s),c=wi(t),d=r==="y",o=a.x+a.width/2-i.width/2,u=a.y+a.height/2-i.height/2,h=a[l]/2-i[l]/2;let p;switch(c){case"top":p={x:o,y:a.y-i.height};break;case"bottom":p={x:o,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:u};break;case"left":p={x:a.x-i.width,y:u};break;default:p={x:a.x,y:a.y}}switch(Ul(t)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const QO=async(e,t,n)=>{const{placement:a="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:o,y:u}=i6(d,a,c),h=a,p={},U=0;for(let m=0;m<l.length;m++){const{name:g,fn:b}=l[m],{x:v,y:x,data:y,reset:E}=await b({x:o,y:u,initialPlacement:a,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:e,floating:t}});o=v??o,u=x??u,p={...p,[g]:{...p[g],...y}},E&&U<=50&&(U++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(d=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:o,y:u}=i6(d,h,c)),m=-1)}return{x:o,y:u,placement:h,strategy:i,middlewareData:p}};async function Bo(e,t){var n;t===void 0&&(t={});const{x:a,y:i,platform:r,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:o="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=yi(t,e),U=l9(p),g=l[h?u==="floating"?"reference":"floating":u],b=Uu(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:d,rootBoundary:o,strategy:c})),v=u==="floating"?{x:a,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),y=await(r.isElement==null?void 0:r.isElement(x))?await(r.getScale==null?void 0:r.getScale(x))||{x:1,y:1}:{x:1,y:1},E=Uu(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:x,strategy:c}):v);return{top:(b.top-E.top+U.top)/y.y,bottom:(E.bottom-b.bottom+U.bottom)/y.y,left:(b.left-E.left+U.left)/y.x,right:(E.right-b.right+U.right)/y.x}}const e$=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:i,rects:r,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:o=0}=yi(e,t)||{};if(d==null)return{};const u=l9(o),h={x:n,y:a},p=tU(i),U=eU(p),m=await s.getDimensions(d),g=p==="y",b=g?"top":"left",v=g?"bottom":"right",x=g?"clientHeight":"clientWidth",y=r.reference[U]+r.reference[p]-h[p]-r.floating[U],E=h[p]-r.reference[p],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let w=S?S[x]:0;(!w||!await(s.isElement==null?void 0:s.isElement(S)))&&(w=l.floating[x]||r.floating[U]);const k=y/2-E/2,T=w/2-m[U]/2-1,_=ir(u[b],T),j=ir(u[v],T),A=_,R=w-m[U]-j,N=w/2-m[U]/2+k,O=a0(A,N,R),$=!c.arrow&&Ul(i)!=null&&N!==O&&r.reference[U]/2-(N<A?_:j)-m[U]/2<0,P=$?N<A?N-A:N-R:0;return{[p]:h[p]+P,data:{[p]:O,centerOffset:N-O-P,...$&&{alignmentOffset:P}},reset:$}}}),t$=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:o=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:U="none",flipAlignment:m=!0,...g}=yi(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const b=wi(i),v=Pa(l),x=wi(l)===l,y=await(c.isRTL==null?void 0:c.isRTL(d.floating)),E=h||(x||!m?[pu(l)]:GO(l)),S=U!=="none";!h&&S&&E.push(...qO(l,m,U,y));const w=[l,...E],k=await Bo(t,g),T=[];let _=((a=r.flip)==null?void 0:a.overflows)||[];if(o&&T.push(k[b]),u){const N=VO(i,s,y);T.push(k[N[0]],k[N[1]])}if(_=[..._,{placement:i,overflows:T}],!T.every(N=>N<=0)){var j,A;const N=(((j=r.flip)==null?void 0:j.index)||0)+1,O=w[N];if(O&&(!(u==="alignment"?v!==Pa(O):!1)||_.every(W=>Pa(W.placement)===v?W.overflows[0]>0:!0)))return{data:{index:N,overflows:_},reset:{placement:O}};let $=(A=_.filter(P=>P.overflows[0]<=0).sort((P,W)=>P.overflows[1]-W.overflows[1])[0])==null?void 0:A.placement;if(!$)switch(p){case"bestFit":{var R;const P=(R=_.filter(W=>{if(S){const F=Pa(W.placement);return F===v||F==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(F=>F>0).reduce((F,Y)=>F+Y,0)]).sort((W,F)=>W[1]-F[1])[0])==null?void 0:R[0];P&&($=P);break}case"initialPlacement":$=l;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function r6(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function s6(e){return BO.some(t=>e[t]>=0)}const n$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...i}=yi(e,t);switch(a){case"referenceHidden":{const r=await Bo(t,{...i,elementContext:"reference"}),s=r6(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:s6(s)}}}case"escaped":{const r=await Bo(t,{...i,altBoundary:!0}),s=r6(r,n.floating);return{data:{escapedOffsets:s,escaped:s6(s)}}}default:return{}}}}},o9=new Set(["left","top"]);async function a$(e,t){const{placement:n,platform:a,elements:i}=e,r=await(a.isRTL==null?void 0:a.isRTL(i.floating)),s=wi(n),l=Ul(n),c=Pa(n)==="y",d=o9.has(s)?-1:1,o=r&&c?-1:1,u=yi(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:U}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof U=="number"&&(p=l==="end"?U*-1:U),c?{x:p*o,y:h*d}:{x:h*d,y:p*o}}const i$=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:i,y:r,placement:s,middlewareData:l}=t,c=await a$(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},r$=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:i}=t,{mainAxis:r=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:b,y:v}=g;return{x:b,y:v}}},...c}=yi(e,t),d={x:n,y:a},o=await Bo(t,c),u=Pa(wi(i)),h=Qp(u);let p=d[h],U=d[u];if(r){const g=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=p+o[g],x=p-o[b];p=a0(v,p,x)}if(s){const g=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=U+o[g],x=U-o[b];U=a0(v,U,x)}const m=l.fn({...t,[h]:p,[u]:U});return{...m,data:{x:m.x-n,y:m.y-a,enabled:{[h]:r,[u]:s}}}}}},s$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:i,rects:r,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=yi(e,t),o={x:n,y:a},u=Pa(i),h=Qp(u);let p=o[h],U=o[u];const m=yi(l,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const x=h==="y"?"height":"width",y=r.reference[h]-r.floating[x]+g.mainAxis,E=r.reference[h]+r.reference[x]-g.mainAxis;p<y?p=y:p>E&&(p=E)}if(d){var b,v;const x=h==="y"?"width":"height",y=o9.has(wi(i)),E=r.reference[u]-r.floating[x]+(y&&((b=s.offset)==null?void 0:b[u])||0)+(y?0:g.crossAxis),S=r.reference[u]+r.reference[x]+(y?0:((v=s.offset)==null?void 0:v[u])||0)-(y?g.crossAxis:0);U<E?U=E:U>S&&(U=S)}return{[h]:p,[u]:U}}}},l$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:i,rects:r,platform:s,elements:l}=t,{apply:c=()=>{},...d}=yi(e,t),o=await Bo(t,d),u=wi(i),h=Ul(i),p=Pa(i)==="y",{width:U,height:m}=r.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(b=u,g=h==="end"?"top":"bottom");const v=m-o.top-o.bottom,x=U-o.left-o.right,y=ir(m-o[g],v),E=ir(U-o[b],x),S=!t.middlewareData.shift;let w=y,k=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=x),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(w=v),S&&!h){const _=kn(o.left,0),j=kn(o.right,0),A=kn(o.top,0),R=kn(o.bottom,0);p?k=U-2*(_!==0||j!==0?_+j:kn(o.left,o.right)):w=m-2*(A!==0||R!==0?A+R:kn(o.top,o.bottom))}await c({...t,availableWidth:k,availableHeight:w});const T=await s.getDimensions(l.floating);return U!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function cf(){return typeof window<"u"}function ml(e){return c9(e)?(e.nodeName||"").toLowerCase():"#document"}function In(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Za(e){var t;return(t=(c9(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function c9(e){return cf()?e instanceof Node||e instanceof In(e).Node:!1}function ma(e){return cf()?e instanceof Element||e instanceof In(e).Element:!1}function Ya(e){return cf()?e instanceof HTMLElement||e instanceof In(e).HTMLElement:!1}function l6(e){return!cf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof In(e).ShadowRoot}const o$=new Set(["inline","contents"]);function fc(e){const{overflow:t,overflowX:n,overflowY:a,display:i}=ga(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!o$.has(i)}const c$=new Set(["table","td","th"]);function d$(e){return c$.has(ml(e))}const u$=[":popover-open",":modal"];function df(e){return u$.some(t=>{try{return e.matches(t)}catch{return!1}})}const f$=["transform","translate","scale","rotate","perspective"],h$=["transform","translate","scale","rotate","perspective","filter"],p$=["paint","layout","strict","content"];function nU(e){const t=aU(),n=ma(e)?ga(e):e;return f$.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||h$.some(a=>(n.willChange||"").includes(a))||p$.some(a=>(n.contain||"").includes(a))}function U$(e){let t=rr(e);for(;Ya(t)&&!rl(t);){if(nU(t))return t;if(df(t))return null;t=rr(t)}return null}function aU(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const m$=new Set(["html","body","#document"]);function rl(e){return m$.has(ml(e))}function ga(e){return In(e).getComputedStyle(e)}function uf(e){return ma(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rr(e){if(ml(e)==="html")return e;const t=e.assignedSlot||e.parentNode||l6(e)&&e.host||Za(e);return l6(t)?t.host:t}function d9(e){const t=rr(e);return rl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ya(t)&&fc(t)?t:d9(t)}function Ho(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=d9(e),r=i===((a=e.ownerDocument)==null?void 0:a.body),s=In(i);if(r){const l=r0(s);return t.concat(s,s.visualViewport||[],fc(i)?i:[],l&&n?Ho(l):[])}return t.concat(i,Ho(i,[],n))}function r0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function u9(e){const t=ga(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const i=Ya(e),r=i?e.offsetWidth:n,s=i?e.offsetHeight:a,l=hu(n)!==r||hu(a)!==s;return l&&(n=r,a=s),{width:n,height:a,$:l}}function iU(e){return ma(e)?e:e.contextElement}function $s(e){const t=iU(e);if(!Ya(t))return $a(1);const n=t.getBoundingClientRect(),{width:a,height:i,$:r}=u9(t);let s=(r?hu(n.width):n.width)/a,l=(r?hu(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const g$=$a(0);function f9(e){const t=In(e);return!aU()||!t.visualViewport?g$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function b$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==In(e)?!1:t}function ts(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=iU(e);let s=$a(1);t&&(a?ma(a)&&(s=$s(a)):s=$s(e));const l=b$(r,n,a)?f9(r):$a(0);let c=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,o=i.width/s.x,u=i.height/s.y;if(r){const h=In(r),p=a&&ma(a)?In(a):a;let U=h,m=r0(U);for(;m&&a&&p!==U;){const g=$s(m),b=m.getBoundingClientRect(),v=ga(m),x=b.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,y=b.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,d*=g.y,o*=g.x,u*=g.y,c+=x,d+=y,U=In(m),m=r0(U)}}return Uu({width:o,height:u,x:c,y:d})}function ff(e,t){const n=uf(e).scrollLeft;return t?t.left+n:ts(Za(e)).left+n}function h9(e,t){const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-ff(e,n),i=n.top+t.scrollTop;return{x:a,y:i}}function v$(e){let{elements:t,rect:n,offsetParent:a,strategy:i}=e;const r=i==="fixed",s=Za(a),l=t?df(t.floating):!1;if(a===s||l&&r)return n;let c={scrollLeft:0,scrollTop:0},d=$a(1);const o=$a(0),u=Ya(a);if((u||!u&&!r)&&((ml(a)!=="body"||fc(s))&&(c=uf(a)),Ya(a))){const p=ts(a);d=$s(a),o.x=p.x+a.clientLeft,o.y=p.y+a.clientTop}const h=s&&!u&&!r?h9(s,c):$a(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+o.x+h.x,y:n.y*d.y-c.scrollTop*d.y+o.y+h.y}}function x$(e){return Array.from(e.getClientRects())}function y$(e){const t=Za(e),n=uf(e),a=e.ownerDocument.body,i=kn(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),r=kn(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let s=-n.scrollLeft+ff(e);const l=-n.scrollTop;return ga(a).direction==="rtl"&&(s+=kn(t.clientWidth,a.clientWidth)-i),{width:i,height:r,x:s,y:l}}const o6=25;function w$(e,t){const n=In(e),a=Za(e),i=n.visualViewport;let r=a.clientWidth,s=a.clientHeight,l=0,c=0;if(i){r=i.width,s=i.height;const o=aU();(!o||o&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const d=ff(a);if(d<=0){const o=a.ownerDocument,u=o.body,h=getComputedStyle(u),p=o.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,U=Math.abs(a.clientWidth-u.clientWidth-p);U<=o6&&(r-=U)}else d<=o6&&(r+=d);return{width:r,height:s,x:l,y:c}}const E$=new Set(["absolute","fixed"]);function S$(e,t){const n=ts(e,!0,t==="fixed"),a=n.top+e.clientTop,i=n.left+e.clientLeft,r=Ya(e)?$s(e):$a(1),s=e.clientWidth*r.x,l=e.clientHeight*r.y,c=i*r.x,d=a*r.y;return{width:s,height:l,x:c,y:d}}function c6(e,t,n){let a;if(t==="viewport")a=w$(e,n);else if(t==="document")a=y$(Za(e));else if(ma(t))a=S$(t,n);else{const i=f9(e);a={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Uu(a)}function p9(e,t){const n=rr(e);return n===t||!ma(n)||rl(n)?!1:ga(n).position==="fixed"||p9(n,t)}function C$(e,t){const n=t.get(e);if(n)return n;let a=Ho(e,[],!1).filter(l=>ma(l)&&ml(l)!=="body"),i=null;const r=ga(e).position==="fixed";let s=r?rr(e):e;for(;ma(s)&&!rl(s);){const l=ga(s),c=nU(s);!c&&l.position==="fixed"&&(i=null),(r?!c&&!i:!c&&l.position==="static"&&!!i&&E$.has(i.position)||fc(s)&&!c&&p9(e,s))?a=a.filter(o=>o!==s):i=l,s=rr(s)}return t.set(e,a),a}function k$(e){let{element:t,boundary:n,rootBoundary:a,strategy:i}=e;const s=[...n==="clippingAncestors"?df(t)?[]:C$(t,this._c):[].concat(n),a],l=s[0],c=s.reduce((d,o)=>{const u=c6(t,o,i);return d.top=kn(u.top,d.top),d.right=ir(u.right,d.right),d.bottom=ir(u.bottom,d.bottom),d.left=kn(u.left,d.left),d},c6(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function M$(e){const{width:t,height:n}=u9(e);return{width:t,height:n}}function I$(e,t,n){const a=Ya(t),i=Za(t),r=n==="fixed",s=ts(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const c=$a(0);function d(){c.x=ff(i)}if(a||!a&&!r)if((ml(t)!=="body"||fc(i))&&(l=uf(t)),a){const p=ts(t,!0,r,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else i&&d();r&&!a&&i&&d();const o=i&&!a&&!r?h9(i,l):$a(0),u=s.left+l.scrollLeft-c.x-o.x,h=s.top+l.scrollTop-c.y-o.y;return{x:u,y:h,width:s.width,height:s.height}}function Ch(e){return ga(e).position==="static"}function d6(e,t){if(!Ya(e)||ga(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Za(e)===n&&(n=n.ownerDocument.body),n}function U9(e,t){const n=In(e);if(df(e))return n;if(!Ya(e)){let i=rr(e);for(;i&&!rl(i);){if(ma(i)&&!Ch(i))return i;i=rr(i)}return n}let a=d6(e,t);for(;a&&d$(a)&&Ch(a);)a=d6(a,t);return a&&rl(a)&&Ch(a)&&!nU(a)?n:a||U$(e)||n}const T$=async function(e){const t=this.getOffsetParent||U9,n=this.getDimensions,a=await n(e.floating);return{reference:I$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function _$(e){return ga(e).direction==="rtl"}const j$={convertOffsetParentRelativeRectToViewportRelativeRect:v$,getDocumentElement:Za,getClippingRect:k$,getOffsetParent:U9,getElementRects:T$,getClientRects:x$,getDimensions:M$,getScale:$s,isElement:ma,isRTL:_$};function m9(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function A$(e,t){let n=null,a;const i=Za(e);function r(){var l;clearTimeout(a),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),r();const d=e.getBoundingClientRect(),{left:o,top:u,width:h,height:p}=d;if(l||t(),!h||!p)return;const U=Oc(u),m=Oc(i.clientWidth-(o+h)),g=Oc(i.clientHeight-(u+p)),b=Oc(o),x={rootMargin:-U+"px "+-m+"px "+-g+"px "+-b+"px",threshold:kn(0,ir(1,c))||1};let y=!0;function E(S){const w=S[0].intersectionRatio;if(w!==c){if(!y)return s();w?s(!1,w):a=setTimeout(()=>{s(!1,1e-7)},1e3)}w===1&&!m9(d,e.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return s(!0),r}function R$(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=iU(e),o=i||r?[...d?Ho(d):[],...Ho(t)]:[];o.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),r&&b.addEventListener("resize",n)});const u=d&&l?A$(d,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(b=>{let[v]=b;v&&v.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),d&&!c&&p.observe(d),p.observe(t));let U,m=c?ts(e):null;c&&g();function g(){const b=ts(e);m&&!m9(m,b)&&n(),m=b,U=requestAnimationFrame(g)}return n(),()=>{var b;o.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),u==null||u(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(U)}}const L$=i$,D$=r$,P$=t$,N$=l$,O$=n$,u6=e$,$$=s$,F$=(e,t,n)=>{const a=new Map,i={platform:j$,...n},r={...i.platform,_c:a};return QO(e,t,{...i,platform:r})};var z$=typeof document<"u",B$=function(){},yd=z$?M.useLayoutEffect:B$;function mu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!mu(e[a],t[a]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,i[a]))return!1;for(a=n;a--!==0;){const r=i[a];if(!(r==="_owner"&&e.$$typeof)&&!mu(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function g9(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function f6(e,t){const n=g9(e);return Math.round(t*n)/n}function kh(e){const t=B.useRef(e);return yd(()=>{t.current=e}),t}function H$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:i,elements:{reference:r,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[o,u]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=B.useState(a);mu(h,a)||p(a);const[U,m]=B.useState(null),[g,b]=B.useState(null),v=B.useCallback(W=>{W!==S.current&&(S.current=W,m(W))},[]),x=B.useCallback(W=>{W!==w.current&&(w.current=W,b(W))},[]),y=r||U,E=s||g,S=B.useRef(null),w=B.useRef(null),k=B.useRef(o),T=c!=null,_=kh(c),j=kh(i),A=kh(d),R=B.useCallback(()=>{if(!S.current||!w.current)return;const W={placement:t,strategy:n,middleware:h};j.current&&(W.platform=j.current),F$(S.current,w.current,W).then(F=>{const Y={...F,isPositioned:A.current!==!1};N.current&&!mu(k.current,Y)&&(k.current=Y,Z5.flushSync(()=>{u(Y)}))})},[h,t,n,j,A]);yd(()=>{d===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,u(W=>({...W,isPositioned:!1})))},[d]);const N=B.useRef(!1);yd(()=>(N.current=!0,()=>{N.current=!1}),[]),yd(()=>{if(y&&(S.current=y),E&&(w.current=E),y&&E){if(_.current)return _.current(y,E,R);R()}},[y,E,R,_,T]);const O=B.useMemo(()=>({reference:S,floating:w,setReference:v,setFloating:x}),[v,x]),$=B.useMemo(()=>({reference:y,floating:E}),[y,E]),P=B.useMemo(()=>{const W={position:n,left:0,top:0};if(!$.floating)return W;const F=f6($.floating,o.x),Y=f6($.floating,o.y);return l?{...W,transform:"translate("+F+"px, "+Y+"px)",...g9($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Y}},[n,l,$.floating,o.x,o.y]);return B.useMemo(()=>({...o,update:R,refs:O,elements:$,floatingStyles:P}),[o,R,O,$,P])}const X$=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:i}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?u6({element:a.current,padding:i}).fn(n):{}:a?u6({element:a,padding:i}).fn(n):{}}}},W$=(e,t)=>({...L$(e),options:[e,t]}),V$=(e,t)=>({...D$(e),options:[e,t]}),G$=(e,t)=>({...$$(e),options:[e,t]}),Y$=(e,t)=>({...P$(e),options:[e,t]}),Z$=(e,t)=>({...N$(e),options:[e,t]}),K$=(e,t)=>({...O$(e),options:[e,t]}),q$=(e,t)=>({...X$(e),options:[e,t]});var J$="Arrow",b9=B.forwardRef((e,t)=>{const{children:n,width:a=10,height:i=5,...r}=e;return f.jsx(ki.svg,{...r,ref:t,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});b9.displayName=J$;var Q$=b9;function eF(e){const[t,n]=B.useState(void 0);return es(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const r=i[0];let s,l;if("borderBoxSize"in r){const c=r.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var rU="Popper",[v9,x9]=t9(rU),[tF,y9]=v9(rU),w9=e=>{const{__scopePopper:t,children:n}=e,[a,i]=B.useState(null);return f.jsx(tF,{scope:t,anchor:a,onAnchorChange:i,children:n})};w9.displayName=rU;var E9="PopperAnchor",S9=B.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...i}=e,r=y9(E9,n),s=B.useRef(null),l=dr(t,s);return B.useEffect(()=>{r.onAnchorChange((a==null?void 0:a.current)||s.current)}),a?null:f.jsx(ki.div,{...i,ref:l})});S9.displayName=E9;var sU="PopperContent",[nF,aF]=v9(sU),C9=B.forwardRef((e,t)=>{var oe,ue,Fe,Ee,je,gt;const{__scopePopper:n,side:a="bottom",sideOffset:i=0,align:r="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:o=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:U,...m}=e,g=y9(sU,n),[b,v]=B.useState(null),x=dr(t,fr=>v(fr)),[y,E]=B.useState(null),S=eF(y),w=(S==null?void 0:S.width)??0,k=(S==null?void 0:S.height)??0,T=a+(r!=="center"?"-"+r:""),_=typeof o=="number"?o:{top:0,right:0,bottom:0,left:0,...o},j=Array.isArray(d)?d:[d],A=j.length>0,R={padding:_,boundary:j.filter(rF),altBoundary:A},{refs:N,floatingStyles:O,placement:$,isPositioned:P,middlewareData:W}=H$({strategy:"fixed",placement:T,whileElementsMounted:(...fr)=>R$(...fr,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[W$({mainAxis:i+k,alignmentAxis:s}),c&&V$({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?G$():void 0,...R}),c&&Y$({...R}),Z$({...R,apply:({elements:fr,rects:vl,availableWidth:os,availableHeight:hr})=>{const{width:ya,height:Dy}=vl.reference,vc=fr.floating.style;vc.setProperty("--radix-popper-available-width",`${os}px`),vc.setProperty("--radix-popper-available-height",`${hr}px`),vc.setProperty("--radix-popper-anchor-width",`${ya}px`),vc.setProperty("--radix-popper-anchor-height",`${Dy}px`)}}),y&&q$({element:y,padding:l}),sF({arrowWidth:w,arrowHeight:k}),h&&K$({strategy:"referenceHidden",...R})]}),[F,Y]=I9($),Q=ar(U);es(()=>{P&&(Q==null||Q())},[P,Q]);const le=(oe=W.arrow)==null?void 0:oe.x,ie=(ue=W.arrow)==null?void 0:ue.y,Te=((Fe=W.arrow)==null?void 0:Fe.centerOffset)!==0,[_e,Ie]=B.useState();return es(()=>{b&&Ie(window.getComputedStyle(b).zIndex)},[b]),f.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:P?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(Ee=W.transformOrigin)==null?void 0:Ee.x,(je=W.transformOrigin)==null?void 0:je.y].join(" "),...((gt=W.hide)==null?void 0:gt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(nF,{scope:n,placedSide:F,onArrowChange:E,arrowX:le,arrowY:ie,shouldHideArrow:Te,children:f.jsx(ki.div,{"data-side":F,"data-align":Y,...m,ref:x,style:{...m.style,animation:P?void 0:"none"}})})})});C9.displayName=sU;var k9="PopperArrow",iF={top:"bottom",right:"left",bottom:"top",left:"right"},M9=B.forwardRef(function(t,n){const{__scopePopper:a,...i}=t,r=aF(k9,a),s=iF[r.placedSide];return f.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:f.jsx(Q$,{...i,ref:n,style:{...i.style,display:"block"}})})});M9.displayName=k9;function rF(e){return e!==null}var sF=e=>({name:"transformOrigin",options:e,fn(t){var g,b,v;const{placement:n,rects:a,middlewareData:i}=t,s=((g=i.arrow)==null?void 0:g.centerOffset)!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,o]=I9(n),u={start:"0%",center:"50%",end:"100%"}[o],h=(((b=i.arrow)==null?void 0:b.x)??0)+l/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+c/2;let U="",m="";return d==="bottom"?(U=s?u:`${h}px`,m=`${-c}px`):d==="top"?(U=s?u:`${h}px`,m=`${a.floating.height+c}px`):d==="right"?(U=`${-c}px`,m=s?u:`${p}px`):d==="left"&&(U=`${a.floating.width+c}px`,m=s?u:`${p}px`),{data:{x:U,y:m}}}});function I9(e){const[t,n="center"]=e.split("-");return[t,n]}var lF=w9,T9=S9,oF=C9,cF=M9,dF="Portal",_9=B.forwardRef((e,t)=>{var l;const{container:n,...a}=e,[i,r]=B.useState(!1);es(()=>r(!0),[]);const s=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?Xt.createPortal(f.jsx(ki.div,{...a,ref:t}),s):null});_9.displayName=dF;function uF(e,t){return B.useReducer((n,a)=>t[n][a]??n,e)}var lU=e=>{const{present:t,children:n}=e,a=fF(t),i=typeof n=="function"?n({present:a.isPresent}):B.Children.only(n),r=dr(a.ref,hF(i));return typeof n=="function"||a.isPresent?B.cloneElement(i,{ref:r}):null};lU.displayName="Presence";function fF(e){const[t,n]=B.useState(),a=B.useRef({}),i=B.useRef(e),r=B.useRef("none"),s=e?"mounted":"unmounted",[l,c]=uF(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return B.useEffect(()=>{const d=$c(a.current);r.current=l==="mounted"?d:"none"},[l]),es(()=>{const d=a.current,o=i.current;if(o!==e){const h=r.current,p=$c(d);e?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(o&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),es(()=>{if(t){let d;const o=t.ownerDocument.defaultView??window,u=p=>{const m=$c(a.current).includes(p.animationName);if(p.target===t&&m&&(c("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",d=o.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=p=>{p.target===t&&(r.current=$c(a.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{o.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:B.useCallback(d=>{d&&(a.current=getComputedStyle(d)),n(d)},[])}}function $c(e){return(e==null?void 0:e.animationName)||"none"}function hF(e){var a,i;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function pF({prop:e,defaultProp:t,onChange:n=()=>{}}){const[a,i]=UF({defaultProp:t,onChange:n}),r=e!==void 0,s=r?e:a,l=ar(n),c=B.useCallback(d=>{if(r){const u=typeof d=="function"?d(e):d;u!==e&&l(u)}else i(d)},[r,e,i,l]);return[s,c]}function UF({defaultProp:e,onChange:t}){const n=B.useState(e),[a]=n,i=B.useRef(a),r=ar(t);return B.useEffect(()=>{i.current!==a&&(r(a),i.current=a)},[a,i,r]),n}var mF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},gs=new WeakMap,Fc=new WeakMap,zc={},Mh=0,j9=function(e){return e&&(e.host||j9(e.parentNode))},gF=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=j9(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},bF=function(e,t,n,a){var i=gF(t,Array.isArray(e)?e:[e]);zc[n]||(zc[n]=new WeakMap);var r=zc[n],s=[],l=new Set,c=new Set(i),d=function(u){!u||l.has(u)||(l.add(u),d(u.parentNode))};i.forEach(d);var o=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(h){if(l.has(h))o(h);else try{var p=h.getAttribute(a),U=p!==null&&p!=="false",m=(gs.get(h)||0)+1,g=(r.get(h)||0)+1;gs.set(h,m),r.set(h,g),s.push(h),m===1&&U&&Fc.set(h,!0),g===1&&h.setAttribute(n,"true"),U||h.setAttribute(a,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return o(t),l.clear(),Mh++,function(){s.forEach(function(u){var h=gs.get(u)-1,p=r.get(u)-1;gs.set(u,h),r.set(u,p),h||(Fc.has(u)||u.removeAttribute(a),Fc.delete(u)),p||u.removeAttribute(n)}),Mh--,Mh||(gs=new WeakMap,gs=new WeakMap,Fc=new WeakMap,zc={})}},vF=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),i=mF(e);return i?(a.push.apply(a,Array.from(i.querySelectorAll("[aria-live], script"))),bF(a,i,n,"aria-hidden")):function(){return null}},Da=function(){return Da=Object.assign||function(t){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Da.apply(this,arguments)};function A9(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]]);return n}function xF(e,t,n){if(n||arguments.length===2)for(var a=0,i=t.length,r;a<i;a++)(r||!(a in t))&&(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}var wd="right-scroll-bar-position",Ed="width-before-scroll-bar",yF="with-scroll-bars-hidden",wF="--removed-body-scroll-bar-size";function Ih(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function EF(e,t){var n=M.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var i=n.value;i!==a&&(n.value=a,n.callback(a,i))}}}})[0];return n.callback=t,n.facade}var SF=typeof window<"u"?B.useLayoutEffect:B.useEffect,h6=new WeakMap;function CF(e,t){var n=EF(null,function(a){return e.forEach(function(i){return Ih(i,a)})});return SF(function(){var a=h6.get(n);if(a){var i=new Set(a),r=new Set(e),s=n.current;i.forEach(function(l){r.has(l)||Ih(l,null)}),r.forEach(function(l){i.has(l)||Ih(l,s)})}h6.set(n,e)},[e]),n}function kF(e){return e}function MF(e,t){t===void 0&&(t=kF);var n=[],a=!1,i={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(r){var s=t(r,a);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(r){for(a=!0;n.length;){var s=n;n=[],s.forEach(r)}n={push:function(l){return r(l)},filter:function(){return n}}},assignMedium:function(r){a=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(r),s=n}var c=function(){var o=s;s=[],o.forEach(r)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(o){s.push(o),d()},filter:function(o){return s=s.filter(o),n}}}};return i}function IF(e){e===void 0&&(e={});var t=MF(null);return t.options=Da({async:!0,ssr:!1},e),t}var R9=function(e){var t=e.sideCar,n=A9(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return B.createElement(a,Da({},n))};R9.isSideCarExport=!0;function TF(e,t){return e.useMedium(t),R9}var L9=IF(),Th=function(){},hf=B.forwardRef(function(e,t){var n=B.useRef(null),a=B.useState({onScrollCapture:Th,onWheelCapture:Th,onTouchMoveCapture:Th}),i=a[0],r=a[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,o=e.enabled,u=e.shards,h=e.sideCar,p=e.noRelative,U=e.noIsolation,m=e.inert,g=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,x=e.gapMode,y=A9(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,S=CF([n,t]),w=Da(Da({},y),i);return B.createElement(B.Fragment,null,o&&B.createElement(E,{sideCar:L9,removeScrollBar:d,shards:u,noRelative:p,noIsolation:U,inert:m,setCallbacks:r,allowPinchZoom:!!g,lockRef:n,gapMode:x}),s?B.cloneElement(B.Children.only(l),Da(Da({},w),{ref:S})):B.createElement(v,Da({},w,{className:c,ref:S}),l))});hf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hf.classNames={fullWidth:Ed,zeroRight:wd};var _F=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jF(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_F();return t&&e.setAttribute("nonce",t),e}function AF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function RF(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var LF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jF())&&(AF(t,n),RF(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},DF=function(){var e=LF();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},D9=function(){var e=DF(),t=function(n){var a=n.styles,i=n.dynamic;return e(a,i),null};return t},PF={left:0,top:0,right:0,gap:0},_h=function(e){return parseInt(e||"",10)||0},NF=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[_h(n),_h(a),_h(i)]},OF=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return PF;var t=NF(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},$F=D9(),Fs="data-scroll-locked",FF=function(e,t,n,a){var i=e.left,r=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
52
|
+
.`.concat(yF,` {
|
|
53
|
+
overflow: hidden `).concat(a,`;
|
|
54
|
+
padding-right: `).concat(l,"px ").concat(a,`;
|
|
55
|
+
}
|
|
56
|
+
body[`).concat(Fs,`] {
|
|
57
|
+
overflow: hidden `).concat(a,`;
|
|
58
|
+
overscroll-behavior: contain;
|
|
59
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
60
|
+
padding-left: `.concat(i,`px;
|
|
61
|
+
padding-top: `).concat(r,`px;
|
|
62
|
+
padding-right: `).concat(s,`px;
|
|
63
|
+
margin-left:0;
|
|
64
|
+
margin-top:0;
|
|
65
|
+
margin-right: `).concat(l,"px ").concat(a,`;
|
|
66
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.`).concat(wd,` {
|
|
70
|
+
right: `).concat(l,"px ").concat(a,`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.`).concat(Ed,` {
|
|
74
|
+
margin-right: `).concat(l,"px ").concat(a,`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.`).concat(wd," .").concat(wd,` {
|
|
78
|
+
right: 0 `).concat(a,`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.`).concat(Ed," .").concat(Ed,` {
|
|
82
|
+
margin-right: 0 `).concat(a,`;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
body[`).concat(Fs,`] {
|
|
86
|
+
`).concat(wF,": ").concat(l,`px;
|
|
87
|
+
}
|
|
88
|
+
`)},p6=function(){var e=parseInt(document.body.getAttribute(Fs)||"0",10);return isFinite(e)?e:0},zF=function(){B.useEffect(function(){return document.body.setAttribute(Fs,(p6()+1).toString()),function(){var e=p6()-1;e<=0?document.body.removeAttribute(Fs):document.body.setAttribute(Fs,e.toString())}},[])},BF=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,i=a===void 0?"margin":a;zF();var r=B.useMemo(function(){return OF(i)},[i]);return B.createElement($F,{styles:FF(r,!t,i,n?"":"!important")})},s0=!1;if(typeof window<"u")try{var Bc=Object.defineProperty({},"passive",{get:function(){return s0=!0,!0}});window.addEventListener("test",Bc,Bc),window.removeEventListener("test",Bc,Bc)}catch{s0=!1}var bs=s0?{passive:!1}:!1,HF=function(e){return e.tagName==="TEXTAREA"},P9=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!HF(e)&&n[t]==="visible")},XF=function(e){return P9(e,"overflowY")},WF=function(e){return P9(e,"overflowX")},U6=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var i=N9(e,a);if(i){var r=O9(e,a),s=r[1],l=r[2];if(s>l)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},VF=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},GF=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},N9=function(e,t){return e==="v"?XF(t):WF(t)},O9=function(e,t){return e==="v"?VF(t):GF(t)},YF=function(e,t){return e==="h"&&t==="rtl"?-1:1},ZF=function(e,t,n,a,i){var r=YF(e,window.getComputedStyle(t).direction),s=r*a,l=n.target,c=t.contains(l),d=!1,o=s>0,u=0,h=0;do{if(!l)break;var p=O9(e,l),U=p[0],m=p[1],g=p[2],b=m-g-r*U;(U||b)&&N9(e,l)&&(u+=b,h+=U);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(o&&Math.abs(u)<1||!o&&Math.abs(h)<1)&&(d=!0),d},Hc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},m6=function(e){return[e.deltaX,e.deltaY]},g6=function(e){return e&&"current"in e?e.current:e},KF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qF=function(e){return`
|
|
89
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
90
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
91
|
+
`)},JF=0,vs=[];function QF(e){var t=B.useRef([]),n=B.useRef([0,0]),a=B.useRef(),i=B.useState(JF++)[0],r=B.useState(D9)[0],s=B.useRef(e);B.useEffect(function(){s.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=xF([e.lockRef.current],(e.shards||[]).map(g6),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=B.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var b=Hc(m),v=n.current,x="deltaX"in m?m.deltaX:v[0]-b[0],y="deltaY"in m?m.deltaY:v[1]-b[1],E,S=m.target,w=Math.abs(x)>Math.abs(y)?"h":"v";if("touches"in m&&w==="h"&&S.type==="range")return!1;var k=U6(w,S);if(!k)return!0;if(k?E=w:(E=w==="v"?"h":"v",k=U6(w,S)),!k)return!1;if(!a.current&&"changedTouches"in m&&(x||y)&&(a.current=E),!E)return!0;var T=a.current||E;return ZF(T,g,m,T==="h"?x:y)},[]),c=B.useCallback(function(m){var g=m;if(!(!vs.length||vs[vs.length-1]!==r)){var b="deltaY"in g?m6(g):Hc(g),v=t.current.filter(function(E){return E.name===g.type&&(E.target===g.target||g.target===E.shadowParent)&&KF(E.delta,b)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var x=(s.current.shards||[]).map(g6).filter(Boolean).filter(function(E){return E.contains(g.target)}),y=x.length>0?l(g,x[0]):!s.current.noIsolation;y&&g.cancelable&&g.preventDefault()}}},[]),d=B.useCallback(function(m,g,b,v){var x={name:m,delta:g,target:b,should:v,shadowParent:ez(b)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(y){return y!==x})},1)},[]),o=B.useCallback(function(m){n.current=Hc(m),a.current=void 0},[]),u=B.useCallback(function(m){d(m.type,m6(m),m.target,l(m,e.lockRef.current))},[]),h=B.useCallback(function(m){d(m.type,Hc(m),m.target,l(m,e.lockRef.current))},[]);B.useEffect(function(){return vs.push(r),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",c,bs),document.addEventListener("touchmove",c,bs),document.addEventListener("touchstart",o,bs),function(){vs=vs.filter(function(m){return m!==r}),document.removeEventListener("wheel",c,bs),document.removeEventListener("touchmove",c,bs),document.removeEventListener("touchstart",o,bs)}},[]);var p=e.removeScrollBar,U=e.inert;return B.createElement(B.Fragment,null,U?B.createElement(r,{styles:qF(i)}):null,p?B.createElement(BF,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ez(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const tz=TF(L9,QF);var $9=B.forwardRef(function(e,t){return B.createElement(hf,Da({},e,{ref:t,sideCar:tz}))});$9.classNames=hf.classNames;var oU="Popover",[F9]=t9(oU,[x9]),hc=x9(),[nz,ur]=F9(oU),z9=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:i,onOpenChange:r,modal:s=!1}=e,l=hc(t),c=B.useRef(null),[d,o]=B.useState(!1),[u=!1,h]=pF({prop:a,defaultProp:i,onChange:r});return f.jsx(lF,{...l,children:f.jsx(nz,{scope:t,contentId:zO(),triggerRef:c,open:u,onOpenChange:h,onOpenToggle:B.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:d,onCustomAnchorAdd:B.useCallback(()=>o(!0),[]),onCustomAnchorRemove:B.useCallback(()=>o(!1),[]),modal:s,children:n})})};z9.displayName=oU;var B9="PopoverAnchor",az=B.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=ur(B9,n),r=hc(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=i;return B.useEffect(()=>(s(),()=>l()),[s,l]),f.jsx(T9,{...r,...a,ref:t})});az.displayName=B9;var H9="PopoverTrigger",X9=B.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=ur(H9,n),r=hc(n),s=dr(t,i.triggerRef),l=f.jsx(ki.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":K9(i.open),...a,ref:s,onClick:qi(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:f.jsx(T9,{asChild:!0,...r,children:l})});X9.displayName=H9;var cU="PopoverPortal",[iz,rz]=F9(cU,{forceMount:void 0}),W9=e=>{const{__scopePopover:t,forceMount:n,children:a,container:i}=e,r=ur(cU,t);return f.jsx(iz,{scope:t,forceMount:n,children:f.jsx(lU,{present:n||r.open,children:f.jsx(_9,{asChild:!0,container:i,children:a})})})};W9.displayName=cU;var sl="PopoverContent",V9=B.forwardRef((e,t)=>{const n=rz(sl,e.__scopePopover),{forceMount:a=n.forceMount,...i}=e,r=ur(sl,e.__scopePopover);return f.jsx(lU,{present:a||r.open,children:r.modal?f.jsx(sz,{...i,ref:t}):f.jsx(lz,{...i,ref:t})})});V9.displayName=sl;var sz=B.forwardRef((e,t)=>{const n=ur(sl,e.__scopePopover),a=B.useRef(null),i=dr(t,a),r=B.useRef(!1);return B.useEffect(()=>{const s=a.current;if(s)return vF(s)},[]),f.jsx($9,{as:Jp,allowPinchZoom:!0,children:f.jsx(G9,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qi(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),r.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:qi(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;r.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:qi(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),lz=B.forwardRef((e,t)=>{const n=ur(sl,e.__scopePopover),a=B.useRef(!1),i=B.useRef(!1);return f.jsx(G9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,r),r.defaultPrevented||(a.current||(l=n.triggerRef.current)==null||l.focus(),r.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:r=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=r.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&i.current&&r.preventDefault()}})}),G9=B.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:r,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:o,...u}=e,h=ur(sl,n),p=hc(n);return jO(),f.jsx(r9,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:r,children:f.jsx(a9,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:f.jsx(oF,{"data-state":K9(h.open),role:"dialog",id:h.contentId,...p,...u,ref:t,style:{...u.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)"}})})})}),Y9="PopoverClose",oz=B.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=ur(Y9,n);return f.jsx(ki.button,{type:"button",...a,ref:t,onClick:qi(e.onClick,()=>i.onOpenChange(!1))})});oz.displayName=Y9;var cz="PopoverArrow",Z9=B.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=hc(n);return f.jsx(cF,{...i,...a,ref:t})});Z9.displayName=cz;function K9(e){return e?"open":"closed"}var pf=z9,Uf=X9,dz=W9,dU=V9,q9=Z9,jh={exports:{}},b6;function uz(){return b6||(b6=1,(function(e,t){(function(){var n={};e.exports=n,n.simpleFilter=function(a,i){return i.filter(function(r){return n.test(a,r)})},n.test=function(a,i){return n.match(a,i)!==null},n.match=function(a,i,r){r=r||{};var s=0,l=[],c=i.length,d=0,o=0,u=r.pre||"",h=r.post||"",p=r.caseSensitive&&i||i.toLowerCase(),U;a=r.caseSensitive&&a||a.toLowerCase();for(var m=0;m<c;m++)U=i[m],p[m]===a[s]?(U=u+U+h,s+=1,o+=1+o):o=0,d+=o,l[l.length]=U;return s===a.length?(d=p===a?1/0:d,{rendered:l.join(""),score:d}):null},n.filter=function(a,i,r){return!i||i.length===0?[]:typeof a!="string"?i:(r=r||{},i.reduce(function(s,l,c,d){var o=l;r.extract&&(o=r.extract(l));var u=n.match(a,o,r);return u!=null&&(s[s.length]={string:u.rendered,score:u.score,index:c,original:l}),s},[]).sort(function(s,l){var c=l.score-s.score;return c||s.index-l.index}))}})()})(jh)),jh.exports}var fz=uz();const hz=Qt.getDefaultExportFromCjs(fz),pz={},v6=e=>{let t;const n=new Set,a=(o,u)=>{const h=typeof o=="function"?o(t):o;if(!Object.is(h,t)){const p=t;t=u??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(U=>U(t,p))}},i=()=>t,c={setState:a,getState:i,getInitialState:()=>d,subscribe:o=>(n.add(o),()=>n.delete(o)),destroy:()=>{(pz?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(a,i,c);return c},Uz=e=>e?v6(e):v6;var Xc={exports:{}},Ah={},Wc={exports:{}},Rh={};/**
|
|
92
|
+
* @license React
|
|
93
|
+
* use-sync-external-store-shim.production.js
|
|
94
|
+
*
|
|
95
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the MIT license found in the
|
|
98
|
+
* LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/var x6;function mz(){if(x6)return Rh;x6=1;var e=M;function t(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,i=e.useEffect,r=e.useLayoutEffect,s=e.useDebugValue;function l(u,h){var p=h(),U=a({inst:{value:p,getSnapshot:h}}),m=U[0].inst,g=U[1];return r(function(){m.value=p,m.getSnapshot=h,c(m)&&g({inst:m})},[u,p,h]),i(function(){return c(m)&&g({inst:m}),u(function(){c(m)&&g({inst:m})})},[u]),s(p),p}function c(u){var h=u.getSnapshot;u=u.value;try{var p=h();return!n(u,p)}catch{return!0}}function d(u,h){return h()}var o=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Rh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:o,Rh}var Lh={};/**
|
|
100
|
+
* @license React
|
|
101
|
+
* use-sync-external-store-shim.development.js
|
|
102
|
+
*
|
|
103
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the MIT license found in the
|
|
106
|
+
* LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/var y6;function gz(){return y6||(y6=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,U){return p===U&&(p!==0||1/p===1/U)||p!==p&&U!==U}function t(p,U){o||i.startTransition===void 0||(o=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=U();if(!u){var g=U();r(m,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}g=s({inst:{value:m,getSnapshot:U}});var b=g[0].inst,v=g[1];return c(function(){b.value=m,b.getSnapshot=U,n(b)&&v({inst:b})},[p,m,U]),l(function(){return n(b)&&v({inst:b}),p(function(){n(b)&&v({inst:b})})},[p]),d(m),m}function n(p){var U=p.getSnapshot;p=p.value;try{var m=U();return!r(p,m)}catch{return!0}}function a(p,U){return U()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=M,r=typeof Object.is=="function"?Object.is:e,s=i.useState,l=i.useEffect,c=i.useLayoutEffect,d=i.useDebugValue,o=!1,u=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:t;Lh.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Lh}var w6;function J9(){return w6||(w6=1,process.env.NODE_ENV==="production"?Wc.exports=mz():Wc.exports=gz()),Wc.exports}/**
|
|
108
|
+
* @license React
|
|
109
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
110
|
+
*
|
|
111
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the MIT license found in the
|
|
114
|
+
* LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/var E6;function bz(){if(E6)return Ah;E6=1;var e=M,t=J9();function n(d,o){return d===o&&(d!==0||1/d===1/o)||d!==d&&o!==o}var a=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,r=e.useRef,s=e.useEffect,l=e.useMemo,c=e.useDebugValue;return Ah.useSyncExternalStoreWithSelector=function(d,o,u,h,p){var U=r(null);if(U.current===null){var m={hasValue:!1,value:null};U.current=m}else m=U.current;U=l(function(){function b(S){if(!v){if(v=!0,x=S,S=h(S),p!==void 0&&m.hasValue){var w=m.value;if(p(w,S))return y=w}return y=S}if(w=y,a(x,S))return w;var k=h(S);return p!==void 0&&p(w,k)?(x=S,w):(x=S,y=k)}var v=!1,x,y,E=u===void 0?null:u;return[function(){return b(o())},E===null?void 0:function(){return b(E())}]},[o,u,h,p]);var g=i(d,U[0],U[1]);return s(function(){m.hasValue=!0,m.value=g},[g]),c(g),g},Ah}var Dh={};/**
|
|
116
|
+
* @license React
|
|
117
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
118
|
+
*
|
|
119
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the MIT license found in the
|
|
122
|
+
* LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/var S6;function vz(){return S6||(S6=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,o){return d===o&&(d!==0||1/d===1/o)||d!==d&&o!==o}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=M,n=J9(),a=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,r=t.useRef,s=t.useEffect,l=t.useMemo,c=t.useDebugValue;Dh.useSyncExternalStoreWithSelector=function(d,o,u,h,p){var U=r(null);if(U.current===null){var m={hasValue:!1,value:null};U.current=m}else m=U.current;U=l(function(){function b(S){if(!v){if(v=!0,x=S,S=h(S),p!==void 0&&m.hasValue){var w=m.value;if(p(w,S))return y=w}return y=S}if(w=y,a(x,S))return w;var k=h(S);return p!==void 0&&p(w,k)?(x=S,w):(x=S,y=k)}var v=!1,x,y,E=u===void 0?null:u;return[function(){return b(o())},E===null?void 0:function(){return b(E())}]},[o,u,h,p]);var g=i(d,U[0],U[1]);return s(function(){m.hasValue=!0,m.value=g},[g]),c(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Dh}var C6;function xz(){return C6||(C6=1,process.env.NODE_ENV==="production"?Xc.exports=bz():Xc.exports=vz()),Xc.exports}var yz=xz();const wz=Qt.getDefaultExportFromCjs(yz),Q9={},{useDebugValue:Ez}=M,{useSyncExternalStoreWithSelector:Sz}=wz;let k6=!1;const Cz=e=>e;function kz(e,t=Cz,n){(Q9?"production":void 0)!=="production"&&n&&!k6&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),k6=!0);const a=Sz(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ez(a),a}const M6=e=>{(Q9?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Uz(e):e,n=(a,i)=>kz(t,a,i);return Object.assign(n,t),n},Mz=e=>e?M6(e):M6;var I6,T6;const _6=typeof window<"u"&&((I6=window.document)!=null&&I6.createElement||((T6=window.navigator)==null?void 0:T6.product)==="ReactNative")?M.useLayoutEffect:M.useEffect;function Ca(){const e=Mz(t=>({current:new Array,version:0,set:t}));return{In:({children:t})=>{const n=e(i=>i.set),a=e(i=>i.version);return _6(()=>{n(i=>({version:i.version+1}))},[]),_6(()=>(n(({current:i})=>({current:[...i,t]})),()=>n(({current:i})=>({current:i.filter(r=>r!==t)}))),[t,a]),null},Out:()=>{const t=e(n=>n.current);return M.createElement(M.Fragment,null,t)}}}function Dt(){return Dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Dt.apply(null,arguments)}function Ph(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Iz(e,t=[]){let n=[];function a(r,s){const l=M.createContext(s),c=n.length;n=[...n,s];function d(u){const{scope:h,children:p,...U}=u,m=(h==null?void 0:h[e][c])||l,g=M.useMemo(()=>U,Object.values(U));return M.createElement(m.Provider,{value:g},p)}function o(u,h){const p=(h==null?void 0:h[e][c])||l,U=M.useContext(p);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${r}\``)}return d.displayName=r+"Provider",[d,o]}const i=()=>{const r=n.map(s=>M.createContext(s));return function(l){const c=(l==null?void 0:l[e])||r;return M.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[a,Tz(i,...t)]}function Tz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(r){const s=a.reduce((l,{useScope:c,scopeName:d})=>{const u=c(r)[`__scope${d}`];return{...l,...u}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function zs(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function _z(e,t=[]){let n=[];function a(r,s){const l=M.createContext(s),c=n.length;n=[...n,s];function d(u){const{scope:h,children:p,...U}=u,m=(h==null?void 0:h[e][c])||l,g=M.useMemo(()=>U,Object.values(U));return M.createElement(m.Provider,{value:g},p)}function o(u,h){const p=(h==null?void 0:h[e][c])||l,U=M.useContext(p);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${r}\``)}return d.displayName=r+"Provider",[d,o]}const i=()=>{const r=n.map(s=>M.createContext(s));return function(l){const c=(l==null?void 0:l[e])||r;return M.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[a,jz(i,...t)]}function jz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(r){const s=a.reduce((l,{useScope:c,scopeName:d})=>{const u=c(r)[`__scope${d}`];return{...l,...u}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Az(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ev(...e){return t=>e.forEach(n=>Az(n,t))}function j6(...e){return M.useCallback(ev(...e),e)}const l0=M.forwardRef((e,t)=>{const{children:n,...a}=e,i=M.Children.toArray(n),r=i.find(Lz);if(r){const s=r.props.children,l=i.map(c=>c===r?M.Children.count(s)>1?M.Children.only(null):M.isValidElement(s)?s.props.children:null:c);return M.createElement(o0,Dt({},a,{ref:t}),M.isValidElement(s)?M.cloneElement(s,void 0,l):null)}return M.createElement(o0,Dt({},a,{ref:t}),n)});l0.displayName="Slot";const o0=M.forwardRef((e,t)=>{const{children:n,...a}=e;return M.isValidElement(n)?M.cloneElement(n,{...Dz(a,n.props),ref:ev(t,n.ref)}):M.Children.count(n)>1?M.Children.only(null):null});o0.displayName="SlotClone";const Rz=({children:e})=>M.createElement(M.Fragment,null,e);function Lz(e){return M.isValidElement(e)&&e.type===Rz}function Dz(e,t){const n={...t};for(const a in t){const i=e[a],r=t[a];/^on[A-Z]/.test(a)?i&&r?n[a]=(...l)=>{r(...l),i(...l)}:i&&(n[a]=i):a==="style"?n[a]={...i,...r}:a==="className"&&(n[a]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}function Pz(e){const t=e+"CollectionProvider",[n,a]=_z(t),[i,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:U,children:m}=p,g=M.useRef(null),b=M.useRef(new Map).current;return M.createElement(i,{scope:U,itemMap:b,collectionRef:g},m)},l=e+"CollectionSlot",c=M.forwardRef((p,U)=>{const{scope:m,children:g}=p,b=r(l,m),v=j6(U,b.collectionRef);return M.createElement(l0,{ref:v},g)}),d=e+"CollectionItemSlot",o="data-radix-collection-item",u=M.forwardRef((p,U)=>{const{scope:m,children:g,...b}=p,v=M.useRef(null),x=j6(U,v),y=r(d,m);return M.useEffect(()=>(y.itemMap.set(v,{ref:v,...b}),()=>void y.itemMap.delete(v))),M.createElement(l0,{[o]:"",ref:x},g)});function h(p){const U=r(e+"CollectionConsumer",p);return M.useCallback(()=>{const g=U.collectionRef.current;if(!g)return[];const b=Array.from(g.querySelectorAll(`[${o}]`));return Array.from(U.itemMap.values()).sort((y,E)=>b.indexOf(y.ref.current)-b.indexOf(E.ref.current))},[U.collectionRef,U.itemMap])}return[{Provider:s,Slot:c,ItemSlot:u},h,a]}function Nz(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tv(...e){return t=>e.forEach(n=>Nz(n,t))}function Oz(...e){return M.useCallback(tv(...e),e)}function $z(e,t=[]){let n=[];function a(r,s){const l=M.createContext(s),c=n.length;n=[...n,s];function d(u){const{scope:h,children:p,...U}=u,m=(h==null?void 0:h[e][c])||l,g=M.useMemo(()=>U,Object.values(U));return M.createElement(m.Provider,{value:g},p)}function o(u,h){const p=(h==null?void 0:h[e][c])||l,U=M.useContext(p);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${r}\``)}return d.displayName=r+"Provider",[d,o]}const i=()=>{const r=n.map(s=>M.createContext(s));return function(l){const c=(l==null?void 0:l[e])||r;return M.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[a,Fz(i,...t)]}function Fz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(r){const s=a.reduce((l,{useScope:c,scopeName:d})=>{const u=c(r)[`__scope${d}`];return{...l,...u}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const zz=globalThis!=null&&globalThis.document?M.useLayoutEffect:()=>{},Bz=B.useId||(()=>{});let Hz=0;function Xz(e){const[t,n]=B.useState(Bz());return zz(()=>{n(a=>a??String(Hz++))},[e]),t?`radix-${t}`:""}const nv=M.forwardRef((e,t)=>{const{children:n,...a}=e,i=M.Children.toArray(n),r=i.find(Vz);if(r){const s=r.props.children,l=i.map(c=>c===r?M.Children.count(s)>1?M.Children.only(null):M.isValidElement(s)?s.props.children:null:c);return M.createElement(c0,Dt({},a,{ref:t}),M.isValidElement(s)?M.cloneElement(s,void 0,l):null)}return M.createElement(c0,Dt({},a,{ref:t}),n)});nv.displayName="Slot";const c0=M.forwardRef((e,t)=>{const{children:n,...a}=e;return M.isValidElement(n)?M.cloneElement(n,{...Gz(a,n.props),ref:tv(t,n.ref)}):M.Children.count(n)>1?M.Children.only(null):null});c0.displayName="SlotClone";const Wz=({children:e})=>M.createElement(M.Fragment,null,e);function Vz(e){return M.isValidElement(e)&&e.type===Wz}function Gz(e,t){const n={...t};for(const a in t){const i=e[a],r=t[a];/^on[A-Z]/.test(a)?i&&r?n[a]=(...l)=>{r(...l),i(...l)}:i&&(n[a]=i):a==="style"?n[a]={...i,...r}:a==="className"&&(n[a]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}const Yz=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],av=Yz.reduce((e,t)=>{const n=M.forwardRef((a,i)=>{const{asChild:r,...s}=a,l=r?nv:t;return M.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),M.createElement(l,Dt({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function uU(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>(...n)=>{var a;return(a=t.current)===null||a===void 0?void 0:a.call(t,...n)},[])}function Zz({prop:e,defaultProp:t,onChange:n=()=>{}}){const[a,i]=Kz({defaultProp:t,onChange:n}),r=e!==void 0,s=r?e:a,l=uU(n),c=M.useCallback(d=>{if(r){const u=typeof d=="function"?d(e):d;u!==e&&l(u)}else i(d)},[r,e,i,l]);return[s,c]}function Kz({defaultProp:e,onChange:t}){const n=M.useState(e),[a]=n,i=M.useRef(a),r=uU(t);return M.useEffect(()=>{i.current!==a&&(r(a),i.current=a)},[a,i,r]),n}const qz=M.createContext(void 0);function iv(e){const t=M.useContext(qz);return e||t||"ltr"}const Nh="rovingFocusGroup.onEntryFocus",Jz={bubbles:!1,cancelable:!0},fU="RovingFocusGroup",[d0,rv,Qz]=Pz(fU),[eB,sv]=$z(fU,[Qz]),[tB,nB]=eB(fU),aB=M.forwardRef((e,t)=>M.createElement(d0.Provider,{scope:e.__scopeRovingFocusGroup},M.createElement(d0.Slot,{scope:e.__scopeRovingFocusGroup},M.createElement(iB,Dt({},e,{ref:t}))))),iB=M.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:i=!1,dir:r,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,...o}=e,u=M.useRef(null),h=Oz(t,u),p=iv(r),[U=null,m]=Zz({prop:s,defaultProp:l,onChange:c}),[g,b]=M.useState(!1),v=uU(d),x=rv(n),y=M.useRef(!1),[E,S]=M.useState(0);return M.useEffect(()=>{const w=u.current;if(w)return w.addEventListener(Nh,v),()=>w.removeEventListener(Nh,v)},[v]),M.createElement(tB,{scope:n,orientation:a,dir:p,loop:i,currentTabStopId:U,onItemFocus:M.useCallback(w=>m(w),[m]),onItemShiftTab:M.useCallback(()=>b(!0),[]),onFocusableItemAdd:M.useCallback(()=>S(w=>w+1),[]),onFocusableItemRemove:M.useCallback(()=>S(w=>w-1),[])},M.createElement(av.div,Dt({tabIndex:g||E===0?-1:0,"data-orientation":a},o,{ref:h,style:{outline:"none",...e.style},onMouseDown:zs(e.onMouseDown,()=>{y.current=!0}),onFocus:zs(e.onFocus,w=>{const k=!y.current;if(w.target===w.currentTarget&&k&&!g){const T=new CustomEvent(Nh,Jz);if(w.currentTarget.dispatchEvent(T),!T.defaultPrevented){const _=x().filter(O=>O.focusable),j=_.find(O=>O.active),A=_.find(O=>O.id===U),N=[j,A,..._].filter(Boolean).map(O=>O.ref.current);lv(N)}}y.current=!1}),onBlur:zs(e.onBlur,()=>b(!1))})))}),rB="RovingFocusGroupItem",sB=M.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:i=!1,tabStopId:r,...s}=e,l=Xz(),c=r||l,d=nB(rB,n),o=d.currentTabStopId===c,u=rv(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=d;return M.useEffect(()=>{if(a)return h(),()=>p()},[a,h,p]),M.createElement(d0.ItemSlot,{scope:n,id:c,focusable:a,active:i},M.createElement(av.span,Dt({tabIndex:o?0:-1,"data-orientation":d.orientation},s,{ref:t,onMouseDown:zs(e.onMouseDown,U=>{a?d.onItemFocus(c):U.preventDefault()}),onFocus:zs(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:zs(e.onKeyDown,U=>{if(U.key==="Tab"&&U.shiftKey){d.onItemShiftTab();return}if(U.target!==U.currentTarget)return;const m=cB(U,d.orientation,d.dir);if(m!==void 0){U.preventDefault();let b=u().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const v=b.indexOf(U.currentTarget);b=d.loop?dB(b,v+1):b.slice(v+1)}setTimeout(()=>lv(b))}})})))}),lB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oB(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cB(e,t,n){const a=oB(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return lB[a]}function lv(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function dB(e,t){return e.map((n,a)=>e[(t+a)%e.length])}const uB=aB,fB=sB;function hB(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ov(...e){return t=>e.forEach(n=>hB(n,t))}function pB(...e){return M.useCallback(ov(...e),e)}const u0=globalThis!=null&&globalThis.document?M.useLayoutEffect:()=>{};function UB(e,t){return M.useReducer((n,a)=>{const i=t[n][a];return i??n},e)}const cv=e=>{const{present:t,children:n}=e,a=mB(t),i=typeof n=="function"?n({present:a.isPresent}):M.Children.only(n),r=pB(a.ref,i.ref);return typeof n=="function"||a.isPresent?M.cloneElement(i,{ref:r}):null};cv.displayName="Presence";function mB(e){const[t,n]=M.useState(),a=M.useRef({}),i=M.useRef(e),r=M.useRef("none"),s=e?"mounted":"unmounted",[l,c]=UB(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const d=Vc(a.current);r.current=l==="mounted"?d:"none"},[l]),u0(()=>{const d=a.current,o=i.current;if(o!==e){const h=r.current,p=Vc(d);e?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(o&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),u0(()=>{if(t){const d=u=>{const p=Vc(a.current).includes(u.animationName);u.target===t&&p&&Xt.flushSync(()=>c("ANIMATION_END"))},o=u=>{u.target===t&&(r.current=Vc(a.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:M.useCallback(d=>{d&&(a.current=getComputedStyle(d)),n(d)},[])}}function Vc(e){return(e==null?void 0:e.animationName)||"none"}const dv=M.forwardRef((e,t)=>{const{children:n,...a}=e,i=M.Children.toArray(n),r=i.find(bB);if(r){const s=r.props.children,l=i.map(c=>c===r?M.Children.count(s)>1?M.Children.only(null):M.isValidElement(s)?s.props.children:null:c);return M.createElement(f0,Dt({},a,{ref:t}),M.isValidElement(s)?M.cloneElement(s,void 0,l):null)}return M.createElement(f0,Dt({},a,{ref:t}),n)});dv.displayName="Slot";const f0=M.forwardRef((e,t)=>{const{children:n,...a}=e;return M.isValidElement(n)?M.cloneElement(n,{...vB(a,n.props),ref:ov(t,n.ref)}):M.Children.count(n)>1?M.Children.only(null):null});f0.displayName="SlotClone";const gB=({children:e})=>M.createElement(M.Fragment,null,e);function bB(e){return M.isValidElement(e)&&e.type===gB}function vB(e,t){const n={...t};for(const a in t){const i=e[a],r=t[a];/^on[A-Z]/.test(a)?i&&r?n[a]=(...l)=>{r(...l),i(...l)}:i&&(n[a]=i):a==="style"?n[a]={...i,...r}:a==="className"&&(n[a]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}const xB=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],mf=xB.reduce((e,t)=>{const n=M.forwardRef((a,i)=>{const{asChild:r,...s}=a,l=r?dv:t;return M.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),M.createElement(l,Dt({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function uv(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>(...n)=>{var a;return(a=t.current)===null||a===void 0?void 0:a.call(t,...n)},[])}function yB({prop:e,defaultProp:t,onChange:n=()=>{}}){const[a,i]=wB({defaultProp:t,onChange:n}),r=e!==void 0,s=r?e:a,l=uv(n),c=M.useCallback(d=>{if(r){const u=typeof d=="function"?d(e):d;u!==e&&l(u)}else i(d)},[r,e,i,l]);return[s,c]}function wB({defaultProp:e,onChange:t}){const n=M.useState(e),[a]=n,i=M.useRef(a),r=uv(t);return M.useEffect(()=>{i.current!==a&&(r(a),i.current=a)},[a,i,r]),n}const EB=B.useId||(()=>{});let SB=0;function CB(e){const[t,n]=B.useState(EB());return u0(()=>{n(a=>a??String(SB++))},[e]),e||(t?`radix-${t}`:"")}const fv="Tabs",[kB]=Iz(fv,[sv]),hv=sv(),[MB,hU]=kB(fv),IB=M.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:i,defaultValue:r,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,o=iv(l),[u,h]=yB({prop:a,onChange:i,defaultProp:r});return M.createElement(MB,{scope:n,baseId:CB(),value:u,onValueChange:h,orientation:s,dir:o,activationMode:c},M.createElement(mf.div,Dt({dir:o,"data-orientation":s},d,{ref:t})))}),TB="TabsList",_B=M.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...i}=e,r=hU(TB,n),s=hv(n);return M.createElement(uB,Dt({asChild:!0},s,{orientation:r.orientation,dir:r.dir,loop:a}),M.createElement(mf.div,Dt({role:"tablist","aria-orientation":r.orientation},i,{ref:t})))}),jB="TabsTrigger",AB=M.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:i=!1,...r}=e,s=hU(jB,n),l=hv(n),c=pv(s.baseId,a),d=Uv(s.baseId,a),o=a===s.value;return M.createElement(fB,Dt({asChild:!0},l,{focusable:!i,active:o}),M.createElement(mf.button,Dt({type:"button",role:"tab","aria-selected":o,"aria-controls":d,"data-state":o?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c},r,{ref:t,onMouseDown:Ph(e.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?s.onValueChange(a):u.preventDefault()}),onKeyDown:Ph(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&s.onValueChange(a)}),onFocus:Ph(e.onFocus,()=>{const u=s.activationMode!=="manual";!o&&!i&&u&&s.onValueChange(a)})})))}),RB="TabsContent",LB=M.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:i,children:r,...s}=e,l=hU(RB,n),c=pv(l.baseId,a),d=Uv(l.baseId,a),o=a===l.value,u=M.useRef(o);return M.useEffect(()=>{const h=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(h)},[]),M.createElement(cv,{present:i||o},({present:h})=>M.createElement(mf.div,Dt({"data-state":o?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:d,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0}}),h&&r))});function pv(e,t){return`${e}-trigger-${t}`}function Uv(e,t){return`${e}-content-${t}`}const mv=IB,gv=_B,bv=AB,vv=LB;var Oh,A6;function DB(){if(A6)return Oh;A6=1;var e="Expected a function",t=NaN,n="[object Symbol]",a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c=typeof Qt.commonjsGlobal=="object"&&Qt.commonjsGlobal&&Qt.commonjsGlobal.Object===Object&&Qt.commonjsGlobal,d=typeof self=="object"&&self&&self.Object===Object&&self,o=c||d||Function("return this")(),u=Object.prototype,h=u.toString,p=Math.max,U=Math.min,m=function(){return o.Date.now()};function g(E,S,w){var k,T,_,j,A,R,N=0,O=!1,$=!1,P=!0;if(typeof E!="function")throw new TypeError(e);S=y(S)||0,b(w)&&(O=!!w.leading,$="maxWait"in w,_=$?p(y(w.maxWait)||0,S):_,P="trailing"in w?!!w.trailing:P);function W(oe){var ue=k,Fe=T;return k=T=void 0,N=oe,j=E.apply(Fe,ue),j}function F(oe){return N=oe,A=setTimeout(le,S),O?W(oe):j}function Y(oe){var ue=oe-R,Fe=oe-N,Ee=S-ue;return $?U(Ee,_-Fe):Ee}function Q(oe){var ue=oe-R,Fe=oe-N;return R===void 0||ue>=S||ue<0||$&&Fe>=_}function le(){var oe=m();if(Q(oe))return ie(oe);A=setTimeout(le,Y(oe))}function ie(oe){return A=void 0,P&&k?W(oe):(k=T=void 0,j)}function Te(){A!==void 0&&clearTimeout(A),N=0,k=R=T=A=void 0}function _e(){return A===void 0?j:ie(m())}function Ie(){var oe=m(),ue=Q(oe);if(k=arguments,T=this,R=oe,ue){if(A===void 0)return F(R);if($)return A=setTimeout(le,S),W(R)}return A===void 0&&(A=setTimeout(le,S)),j}return Ie.cancel=Te,Ie.flush=_e,Ie}function b(E){var S=typeof E;return!!E&&(S=="object"||S=="function")}function v(E){return!!E&&typeof E=="object"}function x(E){return typeof E=="symbol"||v(E)&&h.call(E)==n}function y(E){if(typeof E=="number")return E;if(x(E))return t;if(b(E)){var S=typeof E.valueOf=="function"?E.valueOf():E;E=b(S)?S+"":S}if(typeof E!="string")return E===0?E:+E;E=E.replace(a,"");var w=r.test(E);return w||s.test(E)?l(E.slice(2),w?2:8):i.test(E)?t:+E}return Oh=g,Oh}var PB=DB();const NB=Qt.getDefaultExportFromCjs(PB);function OB(e,t,n,a){Object.defineProperty(e,t,{get:n,set:a,enumerable:!0,configurable:!0})}var $B={};OB($B,"LaserPointer",()=>bu);function vt([e,t,n],[a,i,r]){return[e+a,t+i,n+r]}function Zl([e,t,n],[a,i,r]){return[e-a,t-i,n-r]}function Ct([e,t,n],a){return[e*a,t*a,n*a]}function xs([e,t,n]){return[e/Math.sqrt(e**2+t**2),t/Math.sqrt(e**2+t**2),n]}function Zt([e,t,n],a){return[Math.cos(a)*e-Math.sin(a)*t,Math.sin(a)*e+Math.cos(a)*t,n]}function FB(e,t,n){return vt(e,Ct(Zl(t,e),n))}function R6(e,t,n){return Math.atan2(n[1]-e[1],n[0]-e[0])-Math.atan2(t[1]-e[1],t[0]-e[0])}function L6(e){return Math.atan2(Math.sin(e),Math.cos(e))}function D6([e,t]){return Math.sqrt(e**2+t**2)}function Bs([e,t],[n,a]){return Math.sqrt((n-e)**2+(a-t)**2)}function zB(e){if(e.length<2)return 0;let t=0;for(let n=1;n<=e.length-1;n++)t+=Bs(e[n-1],e[n]);return t+=Bs(e[e.length-2],e[e.length-1]),t}const BB=(e,t,n)=>Math.max(t,Math.min(n,e));function HB(e,t,n){const a=Bs(t,n);if(a===0)return Bs(e,t);const i=BB(((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/a**2,0,1),r=[t[0]+i*(n[0]-t[0]),t[1]+i*(n[1]-t[1]),e[2]];return Bs(r,e)}function gu(e,t){if(t===0||e.length<=2)return e;const n=e[0],a=e[e.length-1],[i,r]=e.reduce(([s,l],c,d)=>{const o=HB(c,n,a);return o>s?[o,d]:[s,l]},[0,-1]);if(i>=t){const s=e[r];return[...gu([n,...e.slice(1,r),s],t).slice(0,-1),s,...gu([s,...e.slice(r,-1),a],t).slice(1)]}else return[n,a]}const $i=class $i{constructor(t){this.originalPoints=[],this.stablePoints=[],this.tailPoints=[],this.isFresh=!0,this.options=Object.assign({},$i.defaults,t)}get lastPoint(){return this.tailPoints[this.tailPoints.length-1]??this.stablePoints[this.stablePoints.length-1]}addPoint(t){const n=this.originalPoints[this.originalPoints.length-1];if(!(n&&n[0]===t[0]&&n[1]===t[1])){if(this.originalPoints.push(t),this.isFresh){this.isFresh=!1,this.stablePoints.push(t);return}this.options.streamline>0&&(t=FB(this.lastPoint,t,1-this.options.streamline)),this.tailPoints.push(t),zB(this.tailPoints)>$i.constants.maxTailLength&&this.stabilizeTail()}}close(){this.stabilizeTail()}stabilizeTail(){if(this.options.simplify>0&&this.options.simplifyPhase=="tail")throw new Error("Not implemented yet");this.stablePoints.push(...this.tailPoints),this.tailPoints=[]}getSize(t,n,a,i,r){return(t??this.options.size)*this.options.sizeMapping({pressure:n,runningLength:r,currentIndex:a,totalLength:i})}getStrokeOutline(t){if(this.isFresh)return[];let n=[...this.stablePoints,...this.tailPoints];this.options.simplify>0&&this.options.simplifyPhase==="input"&&(n=gu(n,this.options.simplify));const a=n.length;if(a===0)return[];if(a===1){const w=n[0],k=this.getSize(t,w[2],0,a,0);if(k<.5)return[];const T=[];for(let _=0;_<=Math.PI*2;_+=Math.PI/16)T.push(vt(w,Ct(Zt([1,0,0],_),k)));return T.push(vt(w,Ct([1,0,0],this.getSize(t,w[2],0,a,0)))),T}if(a===2){const w=n[0],k=n[1],T=this.getSize(t,w[2],0,a,0),_=this.getSize(t,k[2],0,a,0);if(T<.5||_<.5)return[];const j=[],A=R6(w,[w[0],w[1]-100,w[2]],k);for(let R=A;R<=Math.PI+A;R+=Math.PI/16)j.push(vt(w,Ct(Zt([1,0,0],R),T)));for(let R=Math.PI+A;R<=Math.PI*2+A;R+=Math.PI/16)j.push(vt(k,Ct(Zt([1,0,0],R),_)));return j.push(j[0]),j}const i=[],r=[];let s=0,l=0,c=0,d=0;for(let w=1;w<a-1;w++){const k=n[w-1],T=n[w],_=n[w+1];let j=T[2];const A=Bs(k,T);d+=A,s=l+(A-l)*.2;const R=this.getSize(t,j,w,a,d);if(R===0){c=w+1;continue}const N=xs(Zl(k,T)),O=xs(Zl(_,T)),$=Zt(N,Math.PI/2),P=Zt(N,-Math.PI/2),W=Zt(O,Math.PI/2),F=Zt(O,-Math.PI/2),Y=vt(T,Ct($,R)),Q=vt(T,Ct(P,R)),le=vt(T,Ct(W,R)),ie=vt(T,Ct(F,R)),Te=vt($,F),_e=vt(P,W),Ie=vt(T,Ct(D6(Te)===0?N:xs(Te),R)),oe=vt(T,Ct(D6(_e)===0?O:xs(_e),R)),ue=L6(R6(T,k,_)),Fe=$i.constants.cornerDetectionMaxAngle/180*Math.PI*$i.constants.cornerDetectionVariance(s);if(Math.abs(ue)<Fe){const Ee=Math.abs(L6(Math.PI-ue));if(Ee===0)continue;if(ue<0){r.push(Q,oe);for(let je=0;je<=Ee;je+=Ee/4)i.push(vt(T,Zt(Ct($,R),je)));for(let je=Ee;je>=0;je-=Ee/4)r.push(vt(T,Zt(Ct($,R),je)));r.push(oe,le)}else{i.push(Y,Ie);for(let je=0;je<=Ee;je+=Ee/4)r.push(vt(T,Zt(Ct($,-R),-je)));for(let je=Ee;je>=0;je-=Ee/4)i.push(vt(T,Zt(Ct($,-R),-je)));i.push(Ie,ie)}}else i.push(Ie),r.push(oe);l=s}if(c>=a-2)if(this.options.keepHead){const w=n[a-1],k=[];for(let T=0;T<=Math.PI*2;T+=Math.PI/16)k.push(vt(w,Ct(Zt([1,0,0],T),this.options.size)));return k.push(vt(w,Ct([1,0,0],this.options.size))),k}else return[];const o=n[c],u=n[c+1],h=n[a-2],p=n[a-1],U=xs(Zl(u,o)),m=xs(Zl(h,p)),g=Zt(U,-Math.PI/2),b=Zt(m,Math.PI/2),v=this.getSize(t,o[2],0,a,0),x=[],y=this.options.keepHead?this.options.size:this.getSize(t,h[2],a-2,a,d),E=[];if(v>1){for(let w=0;w<=Math.PI;w+=Math.PI/16)x.unshift(vt(o,Zt(Ct(g,v),-w)));x.unshift(vt(o,Ct(g,-v)))}else x.push(o);for(let w=0;w<=Math.PI*3;w+=Math.PI/16)E.push(vt(p,Zt(Ct(b,-y),-w)));const S=[...x,...i,...E.reverse(),...r.reverse()];return x.length>0&&S.push(x[0]),this.options.simplify>0&&this.options.simplifyPhase==="output"?gu(S,this.options.simplify):S}};$i.defaults={size:2,streamline:.45,simplify:.1,simplifyPhase:"output",keepHead:!1,sizeMapping:()=>1},$i.constants={cornerDetectionMaxAngle:75,cornerDetectionVariance:t=>t>35?.5:1,maxTailLength:50};let bu=$i;var xv=Q4(),{useAtom:mt,useSetAtom:gf,useAtomValue:yv,useStore:fZ}=xv,XB=xv.Provider,sa=qp(),WB=Oy({"./locales/ar-SA.json":()=>Promise.resolve().then(()=>require("./layers.BoWA2ewq.js")),"./locales/az-AZ.json":()=>Promise.resolve().then(()=>require("./layers.CnUvX4bJ.js")),"./locales/bg-BG.json":()=>Promise.resolve().then(()=>require("./layers.CHeTy3Sb.js")),"./locales/bn-BD.json":()=>Promise.resolve().then(()=>require("./layers.DXdx7Izv.js")),"./locales/ca-ES.json":()=>Promise.resolve().then(()=>require("./layers.Bs2GZCs9.js")),"./locales/cs-CZ.json":()=>Promise.resolve().then(()=>require("./layers.Dm7Bn63C.js")),"./locales/da-DK.json":()=>Promise.resolve().then(()=>require("./layers.KN4jiEFM.js")),"./locales/de-DE.json":()=>Promise.resolve().then(()=>require("./layers.BuagOhMG.js")),"./locales/el-GR.json":()=>Promise.resolve().then(()=>require("./layers.Bpz_9RMJ.js")),"./locales/en.json":()=>Promise.resolve().then(()=>require("./layers.DT9Q2uqd.js")),"./locales/es-ES.json":()=>Promise.resolve().then(()=>require("./layers.nLzNyQgW.js")),"./locales/eu-ES.json":()=>Promise.resolve().then(()=>require("./layers.BIH0gCon.js")),"./locales/fa-IR.json":()=>Promise.resolve().then(()=>require("./layers.DsOHb5HU.js")),"./locales/fi-FI.json":()=>Promise.resolve().then(()=>require("./layers.Clln2nI-.js")),"./locales/fr-FR.json":()=>Promise.resolve().then(()=>require("./layers.CQnJlryh.js")),"./locales/gl-ES.json":()=>Promise.resolve().then(()=>require("./layers.7htK0qkc.js")),"./locales/he-IL.json":()=>Promise.resolve().then(()=>require("./layers.CtwGwhuN.js")),"./locales/hi-IN.json":()=>Promise.resolve().then(()=>require("./layers.4zkAs3pI.js")),"./locales/hu-HU.json":()=>Promise.resolve().then(()=>require("./layers.ClTXsc5_.js")),"./locales/id-ID.json":()=>Promise.resolve().then(()=>require("./layers.Lvw1dR9H.js")),"./locales/it-IT.json":()=>Promise.resolve().then(()=>require("./layers.2ezQNfhO.js")),"./locales/ja-JP.json":()=>Promise.resolve().then(()=>require("./layers.BtUL3kuB.js")),"./locales/kaa.json":()=>Promise.resolve().then(()=>require("./layers.CtREG6vm.js")),"./locales/kab-KAB.json":()=>Promise.resolve().then(()=>require("./layers.CdIGmaxw.js")),"./locales/kk-KZ.json":()=>Promise.resolve().then(()=>require("./layers.BleJvOH_.js")),"./locales/km-KH.json":()=>Promise.resolve().then(()=>require("./layers.C0Vg7Pfz.js")),"./locales/ko-KR.json":()=>Promise.resolve().then(()=>require("./layers.CR0V62Ai.js")),"./locales/ku-TR.json":()=>Promise.resolve().then(()=>require("./layers.BMuHdxnH.js")),"./locales/lt-LT.json":()=>Promise.resolve().then(()=>require("./layers.DYvoPijo.js")),"./locales/lv-LV.json":()=>Promise.resolve().then(()=>require("./layers.CYtqwZwS.js")),"./locales/mr-IN.json":()=>Promise.resolve().then(()=>require("./layers.lMQpDtSh.js")),"./locales/my-MM.json":()=>Promise.resolve().then(()=>require("./layers.BFkxyYLw.js")),"./locales/nb-NO.json":()=>Promise.resolve().then(()=>require("./layers.ySLJiaOh.js")),"./locales/nl-NL.json":()=>Promise.resolve().then(()=>require("./layers.Ul1PJjbB.js")),"./locales/nn-NO.json":()=>Promise.resolve().then(()=>require("./layers.CvYa1PyL.js")),"./locales/oc-FR.json":()=>Promise.resolve().then(()=>require("./layers.CEOs9VQ-.js")),"./locales/pa-IN.json":()=>Promise.resolve().then(()=>require("./layers.BmKMmFU0.js")),"./locales/percentages.json":()=>Promise.resolve().then(()=>require("./layers.lLC-cUQo.js")),"./locales/pl-PL.json":()=>Promise.resolve().then(()=>require("./layers.CSYORp5P.js")),"./locales/pt-BR.json":()=>Promise.resolve().then(()=>require("./layers.BmObZ2O2.js")),"./locales/pt-PT.json":()=>Promise.resolve().then(()=>require("./layers.Deztqx8B.js")),"./locales/ro-RO.json":()=>Promise.resolve().then(()=>require("./layers.CQ3QwxD8.js")),"./locales/ru-RU.json":()=>Promise.resolve().then(()=>require("./layers.DYNPx6wI.js")),"./locales/si-LK.json":()=>Promise.resolve().then(()=>require("./layers.DaPDkcnM.js")),"./locales/sk-SK.json":()=>Promise.resolve().then(()=>require("./layers.gcteVdBy.js")),"./locales/sl-SI.json":()=>Promise.resolve().then(()=>require("./layers.C4y79BWI.js")),"./locales/sv-SE.json":()=>Promise.resolve().then(()=>require("./layers.CUJ8qvMu.js")),"./locales/ta-IN.json":()=>Promise.resolve().then(()=>require("./layers.CWT_bEvr.js")),"./locales/th-TH.json":()=>Promise.resolve().then(()=>require("./layers.opyf2xIY.js")),"./locales/tr-TR.json":()=>Promise.resolve().then(()=>require("./layers.pTPZR2_0.js")),"./locales/uk-UA.json":()=>Promise.resolve().then(()=>require("./layers.Bdm6pk-7.js")),"./locales/vi-VN.json":()=>Promise.resolve().then(()=>require("./layers.FGM5MYMq.js")),"./locales/zh-CN.json":()=>Promise.resolve().then(()=>require("./layers.DbaEDl4N.js")),"./locales/zh-HK.json":()=>Promise.resolve().then(()=>require("./layers.Dki7UmlE.js")),"./locales/zh-TW.json":()=>Promise.resolve().then(()=>require("./layers.DnVVtjk8.js"))}),VB=85,ls={code:"en",label:"English"},bf=[ls,...[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"cs-CZ",label:"Česky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"Қазақ тілі"},{code:"ko-KR",label:"한국어"},{code:"ku-TR",label:"Kurdî"},{code:"lt-LT",label:"Lietuvių"},{code:"lv-LV",label:"Latviešu"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Slovenščina"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"vi-VN",label:"Tiếng Việt"},{code:"mr-IN",label:"मराठी"}].filter(e=>V4[e.code]>=VB).sort((e,t)=>e.label>t.label?1:-1)],vu="__test__";be.DEV&&bf.unshift({code:vu,label:"test language"},{code:`${vu}.rtl`,label:"test language (rtl)",rtl:!0});var Ds=ls,Sd={},wv=async e=>{if(Ds=e,document.documentElement.dir=Ds.rtl?"rtl":"ltr",document.documentElement.lang=Ds.code,e.code.startsWith(vu))Sd={};else try{Sd=await WB(`./locales/${Ds.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),Sd=Kp}sa.set(Ev,e.code)},Xo=()=>Ds,P6=(e,t)=>{for(let n=0;n<t.length;++n){let a=t[n];if(e[a]===void 0)return;e=e[a]}if(typeof e=="string")return e},I=(e,t,n)=>{if(Ds.code.startsWith(vu))return`[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]`;let a=e.split("."),i=P6(Sd,a)||P6(Kp,a)||n;if(i===void 0){let r=`Can't find translation for ${e}`;return console.warn(r),""}if(t)for(let r in t)i=i.replace(`{{${r}}}`,String(t[r]));return i},Ev=Bt(ls.code),Gt=()=>{let e=yv(Ev);return{t:I,langCode:e}},GB=({size:e="1em",circleWidth:t=8,synchronized:n=!1,className:a=""})=>{let i=-(M.useRef(Date.now()).current%1600);return f.jsx("div",{className:`Spinner ${a}`,children:f.jsx("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":n?`${i}ms`:0},children:f.jsx("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},Ei=GB,Sv=({delay:e,theme:t})=>{let[n,a]=M.useState(!!e);return M.useEffect(()=>{if(!e)return;let i=setTimeout(()=>{a(!1)},e);return()=>clearTimeout(i)},[e]),n?null:f.jsxs("div",{className:ne("LoadingMessage",{"LoadingMessage--dark":t===ke.DARK}),children:[f.jsx("div",{children:f.jsx(Ei,{})}),f.jsx("div",{className:"LoadingMessage-text",children:I("labels.loadingScene")})]})},YB=e=>{let[t,n]=M.useState(!0);return M.useEffect(()=>{let a=async()=>{await wv(i),n(!1)},i=bf.find(r=>r.code===e.langCode)||ls;a()},[e.langCode]),t?f.jsx(Sv,{theme:e.theme}):e.children},Me=M.forwardRef(({size:e="medium",visible:t=!0,className:n="",...a},i)=>{let{id:r}=qa(),s=M.useRef(null);M.useImperativeHandle(i,()=>s.current);let l=`ToolIcon_size_${e}`,[c,d]=M.useState(!1),o=M.useRef(!0),u=async p=>{var m;let U="onClick"in a&&((m=a.onClick)==null?void 0:m.call(a,p));if(tc(U))try{d(!0),await U}catch(g){if(g instanceof Xu)console.warn(g);else throw g}finally{o.current&&d(!1)}};M.useEffect(()=>(o.current=!0,()=>{o.current=!1}),[]);let h=M.useRef(null);if(a.type==="button"||a.type==="icon"||a.type==="submit"){let p=a.type==="icon"?"button":a.type;return f.jsxs("button",{className:ne("ToolIcon_type_button",l,n,t&&!a.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!a.hidden,"ToolIcon--selected":a.selected,"ToolIcon--plain":a.type==="icon"}),style:a.style,"data-testid":a["data-testid"],hidden:a.hidden,title:a.title,"aria-label":a["aria-label"],type:p,onClick:u,ref:s,disabled:c||a.isLoading||!!a.disabled,children:[(a.icon||a.label)&&f.jsxs("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!a.disabled,children:[a.icon||a.label,a.keyBindingLabel&&f.jsx("span",{className:"ToolIcon__keybinding",children:a.keyBindingLabel}),a.isLoading&&f.jsx(Ei,{})]}),a.showAriaLabel&&f.jsxs("div",{className:"ToolIcon__label",children:[a["aria-label"]," ",c&&f.jsx(Ei,{})]}),a.children]})}return f.jsxs("label",{className:ne("ToolIcon",n),title:a.title,onPointerDown:p=>{var U;h.current=p.pointerType||null,(U=a.onPointerDown)==null||U.call(a,{pointerType:p.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{h.current=null})},children:[f.jsx("input",{className:`ToolIcon_type_radio ${l}`,type:"radio",name:a.name,"aria-label":a["aria-label"],"aria-keyshortcuts":a["aria-keyshortcuts"],"data-testid":a["data-testid"],id:`${r}-${a.id}`,onChange:()=>{var p;(p=a.onChange)==null||p.call(a,{pointerType:h.current})},checked:a.checked,ref:s}),f.jsxs("div",{className:"ToolIcon__icon",children:[a.icon,a.keyBindingLabel&&f.jsx("span",{className:"ToolIcon__keybinding",children:a.keyBindingLabel})]})]})});Me.displayName="ToolButton";var ZB=(e,t,n)=>{let a=new Set(ve(e.filter(o=>de(o)),t).map(o=>o.id)),i={},r=n.scene.getNonDeletedElementsMap(),s=new Set;for(let o of a){let u=Ga(e,o);for(let h of u)if(!s.has(h.id)){if(at(h)){let p=zt(h,r);p&&(i[p.id]=!0)}else i[h.id]=!0;s.add(h.id)}}let l=!0,c=e.map(o=>{if(t.selectedElementIds[o.id]){let u=at(o)?zt(o,r):null;return o.frameId&&a.has(o.frameId)?(l=!1,i[o.id]=!0,o):u!=null&&u.frameId&&a.has(u==null?void 0:u.frameId)?o:(o.boundElements&&o.boundElements.forEach(h=>{var U,m;let p=n.scene.getNonDeletedElementsMap().get(h.id);p&&ee(p)&&(G(p,{startBinding:o.id===((U=p.startBinding)==null?void 0:U.elementId)?null:p.startBinding,endBinding:o.id===((m=p.endBinding)==null?void 0:m.elementId)?null:p.endBinding}),G(p,{points:p.points}))}),Ue(o,{isDeleted:!0}))}return o.frameId&&a.has(o.frameId)?(l=!1,at(o)||(i[o.id]=!0),Ue(o,{frameId:null})):at(o)&&t.selectedElementIds[o.containerId]?Ue(o,{isDeleted:!0}):o}),d=t.editingGroupId;if(l&&t.editingGroupId){let o=nt(c,t.editingGroupId).filter(u=>!u.isDeleted);if(o.length>1)o[0]&&(i[o[0].id]=!0);else{d=null,o[0]&&(i[o[0].id]=!0);let u=o[0];if(u){let h=u.groupIds.findIndex(U=>U===t.editingGroupId),p=u.groupIds[h+1];if(p){let U=nt(c,p).filter(m=>!m.isDeleted);U.length>1&&(d=p,U.forEach(m=>{i[m.id]=!0}))}}}}return{elements:c,appState:{...t,...ln({selectedElementIds:i,editingGroupId:d},c,t,null)}}},N6=(e,t)=>{if(e.editingGroupId){let n=nt(Ye(t),e.editingGroupId);if(n.length)return{...e,selectedElementIds:{[n[0].id]:!0}}}return e},Cv=Z({name:"deleteSelectedElements",label:"labels.delete",icon:Yr,trackEvent:{category:"element",action:"delete"},perform:(e,t,n,a)=>{if(t.editingLinearElement){let{elementId:s,selectedPointsIndices:l,startBindingElement:c,endBindingElement:d}=t.editingLinearElement,o=a.scene.getNonDeletedElementsMap(),u=J.getElement(s,o);if(!u||l==null)return!1;if(u.points.length<2){let p=e.map(m=>m.id===u.id?Ue(m,{isDeleted:!0}):m),U=N6(t,p);return{elements:p,appState:{...U,editingLinearElement:null},captureUpdate:X.IMMEDIATELY}}let h={startBindingElement:l!=null&&l.includes(0)?null:c,endBindingElement:l!=null&&l.includes(u.points.length-1)?null:d};return J.deletePoints(u,l),{elements:e,appState:{...t,editingLinearElement:{...t.editingLinearElement,...h,selectedPointsIndices:(l==null?void 0:l[0])>0?[l[0]-1]:[0]}},captureUpdate:X.IMMEDIATELY}}let{elements:i,appState:r}=ZB(e,t,a);return A7(i,i.filter(s=>s.isDeleted)),r=N6(r,i),{elements:i,appState:{...r,activeTool:Et(t,{type:"selection"}),multiElement:null,activeEmbeddable:null},captureUpdate:It(Ye(e),t)?X.IMMEDIATELY:X.EVENTUALLY}},keyTest:(e,t,n)=>(e.key===D.BACKSPACE||e.key===D.DELETE)&&!e[D.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:n})=>f.jsx(Me,{type:"button",icon:Yr,title:I("labels.delete"),"aria-label":I("labels.delete"),onClick:()=>n(null),visible:It(Ye(e),t)})}),h0=(e,t)=>e.frameId===t||e.id===t,kv=(e,t,n)=>{let a=[],i=[],r=null,s=-1,l=ce(n||ve(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++s<e.length;){let c=e[s];l.get(c.id)?(i.length&&(a=a.concat(i),i=[]),a.push(s),r=s+1):c.isDeleted&&r===s?(r=s+1,i.push(s)):i=[]}return a},KB=e=>{let t=0;return e.reduce((n,a,i)=>(i>0&&e[i-1]!==a-1&&(t=++t),(n[t]||(n[t]=[])).push(a),n),[])},O6=(e,t,n)=>{var a,i;if("containerId"in e&&e.containerId){let r=vi.getScene(e).getElement(e.containerId);if(r)return n==="left"?Math.min(t.indexOf(r),t.indexOf(e)):Math.max(t.indexOf(r),t.indexOf(e))}else{let r=(i=(a=e.boundElements)==null?void 0:a.find(s=>s.type!=="arrow"))==null?void 0:i.id;if(r){let s=vi.getScene(e).getElement(r);if(s)return n==="left"?Math.min(t.indexOf(s),t.indexOf(e)):Math.max(t.indexOf(s),t.indexOf(e))}}},qB=(e,t)=>{let n=-1,a=-1;return e.forEach((i,r)=>{h0(i,t)&&(n===-1&&(n=r),a=r)}),n===-1?[]:e.slice(n,a+1)},JB=(e,t,n,a,i)=>{let r=t[n],s=u=>u.isDeleted?!1:i?u.frameId===i:e.editingGroupId?u.groupIds.includes(e.editingGroupId):!0,l=a==="left"?Sr(t,u=>s(u),Math.max(0,n-1)):g8(t,u=>s(u),n+1),c=t[l];if(!c)return-1;if(e.editingGroupId){if((r==null?void 0:r.groupIds.join(""))===(c==null?void 0:c.groupIds.join("")))return O6(c,t,a)??l;if(!(c!=null&&c.groupIds.includes(e.editingGroupId)))return-1}if(!i&&(c.frameId||de(c))){let u=qB(t,c.frameId||c.id);return a==="left"?t.indexOf(u[0]):t.indexOf(u[u.length-1])}if(!c.groupIds.length)return O6(c,t,a)??l;let d=e.editingGroupId?c.groupIds[c.groupIds.indexOf(e.editingGroupId)-1]:c.groupIds[c.groupIds.length-1],o=nt(t,d);return o.length?a==="left"?t.indexOf(o[0]):t.indexOf(o[o.length-1]):l},Mv=(e,t)=>t.reduce((n,a)=>{let i=e[a];return n.set(i.id,i),n},new Map),Iv=(e,t,n)=>{let a=kv(e,t),i=Mv(e,a),r=KB(a);n==="right"&&(r=r.reverse());let s=new Set(a.filter(l=>de(e[l])).map(l=>e[l].id));return r.forEach((l,c)=>{var v;let d=l[0],o=l[l.length-1],u=n==="left"?d:o,h=l.some(x=>{let y=e[x];return y.frameId&&s.has(y.frameId)})?null:(v=e[u])==null?void 0:v.frameId,p=JB(t,e,u,n,h);if(p===-1||u===p)return;let U=n==="left"?e.slice(0,p):e.slice(0,d),m=e.slice(d,o+1),g=n==="left"?e.slice(p,d):e.slice(o+1,p+1),b=n==="left"?e.slice(o+1):e.slice(p+1);e=n==="left"?[...U,...m,...g,...b]:[...U,...g,...m,...b]}),Wa(e,i),e},Tv=(e,t,n,a,i)=>{let r=kv(e,t,i),s=Mv(e,r),l=[],c,d;if(n==="left"){if(a)c=g8(e,U=>h0(U,a));else if(t.editingGroupId){let U=nt(e,t.editingGroupId);if(!U.length)return e;c=e.indexOf(U[0])}else c=0;d=r[r.length-1]}else{if(a)d=Sr(e,U=>h0(U,a));else if(t.editingGroupId){let U=nt(e,t.editingGroupId);if(!U.length)return e;d=e.indexOf(U[U.length-1])}else d=e.length-1;c=r[0]}c===-1&&(c=0);for(let U=c;U<d+1;U++)r.includes(U)||l.push(e[U]);let o=Array.from(s.values()),u=e.slice(0,c),h=e.slice(d+1),p=n==="left"?[...u,...o,...l,...h]:[...u,...l,...o,...h];return Wa(p,s),p};function _v(e,t,n,a){let i=ce(ve(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),r={regularElements:[],frameChildren:new Map},s=new Set;for(let d of e)i.has(d.id)&&de(d)&&s.add(d.id);for(let d of e)if(i.has(d.id))if(de(d)||d.frameId&&s.has(d.frameId))r.regularElements.push(d);else if(!d.frameId)r.regularElements.push(d);else{let o=r.frameChildren.get(d.frameId)||[];o.push(d),r.frameChildren.set(d.frameId,o)}let l=e,c=Array.from(r.frameChildren.entries());for(let[d,o]of c)l=a(e,t,n,d,o);return a(l,t,n,null,r.regularElements)}var QB=(e,t)=>Iv(e,t,"left"),eH=(e,t)=>Iv(e,t,"right"),tH=(e,t)=>_v(e,t,"left",Tv),nH=(e,t)=>_v(e,t,"right",Tv),aH=Z({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:x2,trackEvent:{category:"element"},perform:(e,t)=>({elements:QB(e,t),appState:t,captureUpdate:X.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[D.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Re.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>f.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${I("labels.sendBackward")} — ${V("CtrlOrCmd+[")}`,children:x2})}),iH=Z({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:v2,trackEvent:{category:"element"},perform:(e,t)=>({elements:eH(e,t),appState:t,captureUpdate:X.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[D.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Re.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>f.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${I("labels.bringForward")} — ${V("CtrlOrCmd+]")}`,children:v2})}),rH=Z({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:w2,trackEvent:{category:"element"},perform:(e,t)=>({elements:tH(e,t),appState:t,captureUpdate:X.IMMEDIATELY}),keyTest:e=>Fa?e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.BRACKET_LEFT:e[D.CTRL_OR_CMD]&&e.shiftKey&&e.code===Re.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>f.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${I("labels.sendToBack")} — ${V(Fa?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")}`,children:w2})}),sH=Z({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:y2,trackEvent:{category:"element"},perform:(e,t)=>({elements:nH(e,t),appState:t,captureUpdate:X.IMMEDIATELY}),keyTest:e=>Fa?e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.BRACKET_RIGHT:e[D.CTRL_OR_CMD]&&e.shiftKey&&e.code===Re.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>f.jsx("button",{type:"button",className:"zIndexButton",onClick:n=>e(null),title:`${I("labels.bringToFront")} — ${V(Fa?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")}`,children:y2})}),lH=Z({name:"selectAll",label:"labels.selectAll",icon:sT,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,n,a)=>{if(t.editingLinearElement)return!1;let i=e.filter(r=>!r.isDeleted&&!(q(r)&&r.containerId)&&!r.locked).reduce((r,s)=>(r[s.id]=!0,r),{});return{appState:{...t,...ln({editingGroupId:null,selectedElementIds:i},Ye(e),t,a),selectedLinearElement:Object.keys(i).length===1&&fe(e[0])?new J(e[0]):null},captureUpdate:X.IMMEDIATELY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.A}),oH=e=>{let t=e.slice(),n=new Set,a=r=>{var d,o,u;let s=(o=(d=r[0])==null?void 0:d.groupIds)==null?void 0:o.join(""),l=[r[0]],c=[];for(let h of r.slice(1))((u=h.groupIds)==null?void 0:u.join(""))===s?l.push(h):c.push(h);return c.length?[...l,...a(c)]:l},i=new Map;return t.forEach((r,s)=>{var l;if(!i.has(r.id))if((l=r.groupIds)!=null&&l.length){let c=r.groupIds[r.groupIds.length-1],d=t.slice(s).filter(o=>{var h;let u=(h=o==null?void 0:o.groupIds)==null?void 0:h.some(p=>p===c);return u&&i.set(o.id,!0),u});for(let o of a(d))n.add(o)}else n.add(r)}),n.size!==e.length?(console.error("normalizeGroupElementOrder: lost some elements... bailing!"),e):[...n]},cH=e=>{let t=sM(e),n=e.slice(),a=new Set;return n.forEach((i,r)=>{var s,l,c;i&&((s=i.boundElements)!=null&&s.length?(a.add(i),n[r]=null,i.boundElements.forEach(d=>{let o=t.get(d.id);o&&d.type==="text"&&(a.add(o[0]),n[o[1]]=null)})):i.type==="text"&&i.containerId&&((c=(l=t.get(i.containerId))==null?void 0:l[0].boundElements)!=null&&c.find(d=>d.id===i.id))||(a.add(i),n[r]=null))}),a.size!==e.length?(console.error("normalizeBoundElementsOrder: lost some elements... bailing!"),e):[...a]},dH=e=>cH(oH(e)),uH=Z({name:"duplicateSelection",label:"labels.duplicateSelection",icon:S1,trackEvent:{category:"element"},perform:(e,t,n,a)=>{if(t.editingLinearElement)try{let r=J.duplicateSelectedPoints(t,a.scene.getNonDeletedElementsMap());return{elements:e,appState:r,captureUpdate:X.IMMEDIATELY}}catch{return!1}let i=fH(e,t);if(a.props.onDuplicate&&i.elements){let r=a.props.onDuplicate(i.elements,e);r&&(i.elements=r)}return{...i,captureUpdate:X.IMMEDIATELY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.D,PanelComponent:({elements:e,appState:t,updateData:n})=>f.jsx(Me,{type:"button",icon:S1,title:`${I("labels.duplicateSelection")} — ${V("CtrlOrCmd+D")}`,"aria-label":I("labels.duplicateSelection"),onClick:()=>n(null),visible:It(Ye(e),t)})}),fH=(e,t)=>{let n=new Map,a=[],i=[],r=new Map,s=new Map,l=ce(e),c=m=>{let g=h2(m).reduce((b,v)=>{if(o.has(v.id))return b;o.set(v.id,!0);let x=J7(t.editingGroupId,n,v,{x:v.x+$d/2,y:v.y+$d/2});return o.set(x.id,!0),s.set(x.id,x),r.set(v.id,x.id),i.push(v),a.push(x),b.push(x),b},[]);return Array.isArray(m)?g:g[0]||null};e=dH(e);let d=ce(ve(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),o=new Map,u=e.slice(),h=(m,g)=>{nn(m!==-1,"targetIndex === -1 "),!(!Array.isArray(g)&&!g)&&u.splice(m+1,0,...h2(g))},p=new Set(e.filter(m=>d.has(m.id)&&de(m)).map(m=>m.id));for(let m of e){if(o.has(m.id)||!d.has(m.id))continue;let g=N7(t,m);if(g){let b=nt(e,g).flatMap(x=>de(x)?[...Ga(e,x.id),x]:[x]),v=Sr(u,x=>{var y;return(y=x.groupIds)==null?void 0:y.includes(g)});h(v,c(b));continue}if(!(m.frameId&&p.has(m.frameId))){if(de(m)){let b=m.id,v=Ga(e,b),x=Sr(u,y=>y.frameId===b||y.id===b);h(x,c([...v,m]));continue}if(Wn(m)){let b=ge(m,l),v=Sr(u,x=>x.id===m.id||"containerId"in x&&x.containerId===m.id);b?h(v,c([m,b])):h(v,c(m));continue}if(at(m)){let b=zt(m,l),v=Sr(u,x=>x.id===m.id||x.id===(b==null?void 0:b.id));b?h(v,c([b,m])):h(v,c(m));continue}h(Sr(u,b=>b.id===m.id),c(m))}}B7(u,i,r),j7(u,i,r),R3(u,i,r);let U=Op(a);return{elements:u,appState:{...t,...ln({editingGroupId:t.editingGroupId,selectedElementIds:U.reduce((m,g)=>(at(g)||(m[g.id]=!0),m),{})},Ye(u),t,null)}}},hH=new Set(["command_palette","export"]),Qe=(e,t,n,a)=>{try{if(typeof window>"u"||be.VITE_WORKER_ID||be.VITE_APP_ENABLE_TRACKING!=="true"||!hH.has(e)||be.DEV)return;be.PROD||console.info("trackEvent",{category:e,action:t,label:n,value:a}),window.sa_event&&window.sa_event(t,{category:e,label:n,value:a})}catch(i){console.error("error during analytics",i)}},jv=M.forwardRef((e,t)=>{let{title:n,className:a,testId:i,active:r,standalone:s,icon:l,onClick:c}=e;return f.jsx("button",{type:"button",ref:t,title:n,"data-testid":i,className:ne(a,{standalone:s,active:r}),onClick:c,children:l},n)}),Ka=e=>f.jsx("div",{className:"buttonList",children:e.options.map(t=>e.type==="button"?f.jsx(jv,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:n=>e.onClick(t.value,n)},t.text):f.jsxs("label",{className:ne({active:e.value===t.value}),title:t.text,children:[f.jsx("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))}),pH=({onChange:e,type:t,activeColor:n,topPicks:a})=>{let i;return t==="elementStroke"&&(i=Kb),t==="elementBackground"&&(i=qb),t==="canvasBackground"&&(i=Jb),a&&(i=a),i?f.jsx("div",{className:"color-picker__top-picks",children:i.map(r=>f.jsx("button",{className:ne("color-picker__button",{active:r===n,"is-transparent":r==="transparent"||!r}),style:{"--swatch-color":r},type:"button",title:r,onClick:()=>e(r),"data-testid":`color-top-pick-${r}`,children:f.jsx("div",{className:"color-picker__button-outline"})},r))}):(console.error("Invalid type for TopPicks"),null)},Av=()=>f.jsx("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}}),vf=({palette:e,color:t})=>{for(let[n,a]of Object.entries(e))if(Array.isArray(a)){let i=a.indexOf(t);if(i>-1)return{colorName:n,shade:i}}else if(a===t)return{colorName:n,shade:null};return null},p0=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),Rv=({color:e,palette:t})=>!Object.values(t).flat().includes(e),UH=(e,t,n)=>{let a={elementBackground:"backgroundColor",elementStroke:"strokeColor"},i=e.filter(s=>{if(s.isDeleted)return!1;let l=s[a[t]];return Rv({color:l,palette:n})}),r=new Map;return i.forEach(s=>{let l=s[a[t]];r.has(l)?r.set(l,r.get(l)+1):r.set(l,1)}),[...r.entries()].sort((s,l)=>l[1]-s[1]).map(s=>s[0]).slice(0,tk)},gl=Bt(null),$6=(e,t,n)=>(e*299+t*587+n*114)/1e3>=160?"black":"white",mH=(e,t)=>{if(t){let r=new Option().style;if(r.color=e,r.color){let s=r.color.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(","),l=parseInt(s[0]),c=parseInt(s[1]),d=parseInt(s[2]);return $6(l,c,d)}}if(e==="transparent")return"black";let n=parseInt(e.substring(1,3),16),a=parseInt(e.substring(3,5),16),i=parseInt(e.substring(5,7),16);return $6(n,a,i)},gH=({color:e,keyLabel:t,isCustomColor:n=!1,isShade:a=!1})=>f.jsxs("div",{className:"color-picker__button__hotkey-label",style:{color:mH(e,n)},children:[a&&"⇧",t]}),pU=gH,bH=({hex:e,onChange:t,palette:n})=>{let a=vf({color:e||"transparent",palette:n}),[i,r]=mt(gl),s=M.useRef(null);if(M.useEffect(()=>{s.current&&i==="shades"&&s.current.focus()},[a,i]),a){let{colorName:l,shade:c}=a,d=n[l];if(Array.isArray(d))return f.jsx("div",{className:"color-picker-content--default shades",children:d.map((o,u)=>f.jsxs("button",{ref:u===c&&i==="shades"?s:void 0,tabIndex:-1,type:"button",className:ne("color-picker__button color-picker__button--large",{active:u===c}),"aria-label":"Shade",title:`${l} - ${u+1}`,style:o?{"--swatch-color":o}:void 0,onClick:()=>{t(o),r("shades")},children:[f.jsx("div",{className:"color-picker__button-outline"}),f.jsx(pU,{color:o,keyLabel:u+1,isShade:!0})]},u))})}return f.jsxs("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[f.jsx("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),f.jsx("div",{tabIndex:-1,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"0.75rem"},children:I("colorPicker.noShades")})]})},vH=({palette:e,color:t,onChange:n,label:a,activeShade:i})=>{let r=vf({color:t||"transparent",palette:e}),[s,l]=mt(gl),c=M.useRef(null);return M.useEffect(()=>{c.current&&s==="baseColors"&&c.current.focus()},[r==null?void 0:r.colorName,s]),f.jsx("div",{className:"color-picker-content--default",children:Object.entries(e).map(([d,o],u)=>{let h=(Array.isArray(o)?o[i]:o)||"transparent",p=p0[u],U=I(`colors.${d.replace(/\d+/,"")}`,null,"");return f.jsxs("button",{ref:(r==null?void 0:r.colorName)===d?c:void 0,tabIndex:-1,type:"button",className:ne("color-picker__button color-picker__button--large",{active:(r==null?void 0:r.colorName)===d,"is-transparent":h==="transparent"||!h}),onClick:()=>{n(h),l("baseColors")},title:`${U}${h.startsWith("#")?` ${h}`:""} — ${p}`,"aria-label":`${U} — ${p}`,style:{"--swatch-color":h},"data-testid":`color-${d}`,children:[f.jsx("div",{className:"color-picker__button-outline"}),f.jsx(pU,{color:h,keyLabel:p})]},d)})})},xH=vH,yH=({colors:e,color:t,onChange:n,label:a})=>{let[i,r]=mt(gl),s=M.useRef(null);return M.useEffect(()=>{s.current&&s.current.focus()},[t,i]),f.jsx("div",{className:"color-picker-content--default",children:e.map((l,c)=>f.jsxs("button",{ref:t===l?s:void 0,tabIndex:-1,type:"button",className:ne("color-picker__button color-picker__button--large",{active:t===l,"is-transparent":l==="transparent"||!l}),onClick:()=>{n(l),r("custom")},title:l,"aria-label":a,style:{"--swatch-color":l},children:[f.jsx("div",{className:"color-picker__button-outline"}),f.jsx(pU,{color:l,keyLabel:c+1,isCustomColor:!0})]},c))})},$h=(e,t,n)=>{let a=Math.ceil(n/Ss);switch(t=t??-1,e){case"ArrowLeft":{let i=t-1;return i<0?n-1:i}case"ArrowRight":return(t+1)%n;case"ArrowDown":{let i=t+Ss;return i>=n?t%Ss:i}case"ArrowUp":{let i=t-Ss,r=i<0?Ss*a+i:i;return r>=n?void 0:r}}},wH=({e,colorObj:t,onChange:n,palette:a,customColors:i,setActiveColorPickerSection:r,activeShade:s})=>{if((t==null?void 0:t.shade)!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let l=Number(e.code.slice(-1))-1;return n(a[t.colorName][l]),r("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&i[Number(e.key)-1])return n(i[Number(e.key)-1]),r("custom"),!0;if(p0.includes(e.key)){let l=p0.indexOf(e.key),c=Object.keys(a)[l],d=a[c],o=Array.isArray(d)?d[s]:d;return n(o),r("baseColors"),!0}return!1},EH=({event:e,activeColorPickerSection:t,palette:n,color:a,onChange:i,customColors:r,setActiveColorPickerSection:s,updateData:l,activeShade:c,onEyeDropperToggle:d,onEscape:o})=>{if(e[D.CTRL_OR_CMD])return!1;if(e.key===D.ESCAPE)return o(e),!0;if(e.key===D.ALT)return d(!0),!0;if(e.key===D.I)return d(),!0;let u=vf({color:a,palette:n});if(e.key===D.TAB){let h={custom:!!r.length,baseColors:!0,shades:(u==null?void 0:u.shade)!=null,hex:!0},p=Object.entries(h).reduce((v,[x,y])=>(y&&v.push(x),v),[]),U=p.indexOf(t),m=e.shiftKey?-1:1,g=U+m>p.length-1?0:U+m<0?p.length-1:U+m,b=p[g];return b&&s(b),b==="custom"?i(r[0]):b==="baseColors"&&(Object.entries(n).find(([v,x])=>Array.isArray(x)?x.includes(a):x===a?v:null)||i(we.black)),e.preventDefault(),e.stopPropagation(),!0}if(wH({e,colorObj:u,onChange:i,palette:n,customColors:r,setActiveColorPickerSection:s,activeShade:c}))return!0;if(t==="shades"&&u){let{shade:h}=u,p=$h(e.key,h,Ss);if(p!==void 0)return i(n[u.colorName][p]),!0}if(t==="baseColors"&&u){let{colorName:h}=u,p=Object.keys(n),U=p.indexOf(h),m=$h(e.key,U,p.length);if(m!==void 0){let g=p[m],b=n[g];return i(Array.isArray(b)?b[c]:b),!0}}if(t==="custom"){let h=r.indexOf(a),p=$h(e.key,h,r.length);if(p!==void 0){let U=r[p];return i(U),!0}}return!1},SH=({children:e})=>f.jsx("div",{className:"color-picker__heading",children:e}),Cd=SH,CH=({color:e,onChange:t,label:n,type:a,elements:i,palette:r,updateData:s,children:l,onEyeDropperToggle:c,onEscape:d})=>{let[o]=M.useState(()=>a==="canvasBackground"?[]:UH(i,a,r)),[u,h]=mt(gl),p=vf({color:e,palette:r});M.useEffect(()=>{if(!u){let b=Rv({color:e,palette:r}),v=b&&!o.includes(e);h(v?"hex":b?"custom":(p==null?void 0:p.shade)!=null?"shades":"baseColors")}},[u,e,r,h,p,o]);let[U,m]=M.useState((p==null?void 0:p.shade)??(a==="elementBackground"?Hl:Bl));M.useEffect(()=>{(p==null?void 0:p.shade)!=null&&m(p.shade);let b=v=>{v.key===D.ALT&&c(!1)};return document.addEventListener("keyup",b,{capture:!0}),()=>{document.removeEventListener("keyup",b,{capture:!0})}},[p,c]);let g=M.useRef(null);return f.jsx("div",{role:"dialog","aria-modal":"true","aria-label":I("labels.colorPicker"),children:f.jsxs("div",{ref:g,onKeyDown:b=>{EH({event:b,activeColorPickerSection:u,palette:r,color:e,onChange:t,onEyeDropperToggle:c,customColors:o,setActiveColorPickerSection:h,updateData:s,activeShade:U,onEscape:d})&&(b.preventDefault(),b.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[!!o.length&&f.jsxs("div",{children:[f.jsx(Cd,{children:I("colorPicker.mostUsedCustomColors")}),f.jsx(yH,{colors:o,color:e,label:I("colorPicker.mostUsedCustomColors"),onChange:t})]}),f.jsxs("div",{children:[f.jsx(Cd,{children:I("colorPicker.colors")}),f.jsx(xH,{color:e,label:n,palette:r,onChange:t,activeShade:U})]}),f.jsxs("div",{children:[f.jsx(Cd,{children:I("colorPicker.shades")}),f.jsx(bH,{hex:e,onChange:t,palette:r})]}),l]})})},Lv=M.createContext(null),Yt=()=>M.useContext(Lv),Dv=e=>{let[t,n]=M.useState(null),a=Tt(),{theme:i}=Yt(),{container:r}=qa();return M.useLayoutEffect(()=>{var s;t&&(t.className="",t.classList.add("excalidraw",...((s=e==null?void 0:e.className)==null?void 0:s.split(/\s+/))||[]),t.classList.toggle("excalidraw--mobile",a.editor.isMobile),t.classList.toggle("theme--dark",i===ke.DARK))},[t,i,a.editor.isMobile,e==null?void 0:e.className]),M.useLayoutEffect(()=>{let s=e!=null&&e.parentSelector?r==null?void 0:r.querySelector(e.parentSelector):document.body;if(!s)return;let l=document.createElement("div");return s.appendChild(l),n(l),()=>{s.removeChild(l)}},[r,e==null?void 0:e.parentSelector]),t};function UU(e,t,n){M.useEffect(()=>{function a(i){let r=i;if(!e.current)return;let s=n==null?void 0:n(r,e.current);if(s!==!0){if(s===!1)return t(r);e.current.contains(r.target)||!document.documentElement.contains(r.target)||r.target.closest("[data-radix-portal]")||r.target===document.documentElement&&document.body.style.pointerEvents==="none"||r.target.closest("[data-prevent-outside-click]")||t(r)}}return document.addEventListener("pointerdown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("pointerdown",a),document.removeEventListener("touchstart",a)}},[e,t,n])}var xf=e=>{let t=M.useRef(e);return Object.assign(t.current,e),t.current},yf=Bt(null),kH=({onCancel:e,onChange:t,onSelect:n,colorPickerType:a})=>{let i=Dv({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),r=Yt(),s=Tf(),l=va(),c=ve(s,r),d=xf({app:l,onCancel:e,onChange:t,onSelect:n,selectedElements:c}),{container:o}=qa();M.useEffect(()=>{let h=u.current;if(!h||!l.canvas||!i)return;let p=!1,U=l.canvas.getContext("2d"),m=({clientX:S,clientY:w})=>{let k=U.getImageData((S-r.offsetLeft)*window.devicePixelRatio,(w-r.offsetTop)*window.devicePixelRatio,1,1).data;return sk(k[0],k[1],k[2])},g=({clientX:S,clientY:w,altKey:k})=>{h.style.top=`${w+20}px`,h.style.left=`${S+20}px`;let T=m({clientX:S,clientY:w});p&&d.onChange(a,T,d.selectedElements,{altKey:k}),h.style.background=T},b=()=>{d.onCancel()},v=(S,w)=>{d.onSelect(S,w)},x=S=>{p=!0,S.stopImmediatePropagation()},y=S=>{p=!1,o==null||o.focus(),S.stopImmediatePropagation(),S.preventDefault(),v(m(S),S)},E=S=>{S.key===D.ESCAPE&&(S.preventDefault(),S.stopImmediatePropagation(),b())};return i.tabIndex=-1,i.focus(),g({clientX:d.app.lastViewportPosition.x,clientY:d.app.lastViewportPosition.y,altKey:!1}),i.addEventListener("keydown",E),i.addEventListener("pointerdown",x),i.addEventListener("pointerup",y),window.addEventListener("pointermove",g,{passive:!0}),window.addEventListener("blur",b),()=>{p=!1,i.removeEventListener("keydown",E),i.removeEventListener("pointerdown",x),i.removeEventListener("pointerup",y),window.removeEventListener("pointermove",g),window.removeEventListener("blur",b)}},[d,l.canvas,i,a,o,r.offsetLeft,r.offsetTop]);let u=M.useRef(null);return UU(u,()=>{e()},h=>!!h.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),i?Xt.createPortal(f.jsx("div",{ref:u,className:"excalidraw-eye-dropper-preview"}),i):null},MH=({color:e,onChange:t,label:n,colorPickerType:a})=>{let i=Tt(),[r,s]=M.useState(e),[l,c]=mt(gl);M.useEffect(()=>{s(e)},[e]);let d=M.useCallback(U=>{let m=U.toLowerCase(),g=IH(m);g&&t(g),s(m)},[t]),o=M.useRef(null),u=M.useRef(null);M.useEffect(()=>{o.current&&o.current.focus()},[l]);let[h,p]=mt(yf);return M.useEffect(()=>()=>{p(null)},[p]),f.jsxs("div",{className:"color-picker__input-label",children:[f.jsx("div",{className:"color-picker__input-hash",children:"#"}),f.jsx("input",{ref:l==="hex"?o:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":n,onChange:U=>{d(U.target.value)},value:(r||"").replace(/^#/,""),onBlur:()=>{s(e)},tabIndex:-1,onFocus:()=>c("hex"),onKeyDown:U=>{var m;U.key!==D.TAB&&(U.key===D.ESCAPE&&((m=u.current)==null||m.focus()),U.stopPropagation())}}),!i.editor.isMobile&&f.jsxs(f.Fragment,{children:[f.jsx("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),f.jsx("div",{ref:u,className:ne("excalidraw-eye-dropper-trigger",{selected:h}),onClick:()=>p(U=>U?null:{keepOpenOnAlt:!1,onSelect:m=>t(m),colorPickerType:a}),title:`${I("labels.eyeDropper")} — ${D.I.toLocaleUpperCase()} or ${V("Alt")} `,children:qI})]})]})},ua=M.forwardRef(({children:e,padding:t,className:n,style:a},i)=>f.jsx("div",{className:ne("Island",n),style:{"--padding":t,...a},ref:i,children:e})),Pv=M.forwardRef(({className:e,container:t,children:n,style:a,onClose:i,onKeyDown:r,onFocusOutside:s,onPointerLeave:l,onPointerDownOutside:c},d)=>{let o=Tt();return f.jsx(dz,{container:t,children:f.jsxs(dU,{ref:d,className:ne("focus-visible-none",e),"data-prevent-outside-click":!0,side:o.editor.isMobile&&!o.viewport.isLandscape?"bottom":"right",align:o.editor.isMobile&&!o.viewport.isLandscape?"center":"start",alignOffset:-16,sideOffset:20,style:{zIndex:"var(--zIndex-popup)"},onPointerLeave:l,onKeyDown:r,onFocusOutside:s,onPointerDownOutside:c,onCloseAutoFocus:u=>{u.stopPropagation(),u.preventDefault(),t&&!Kk(document.activeElement)&&t.focus(),i()},children:[f.jsx(ua,{padding:3,style:a,children:n}),f.jsx(q9,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})}),F6=e=>{let t=new Option().style;return t.color=e,!!t.color},IH=e=>ia(e)?e:F6(`#${e}`)?`#${e}`:F6(e)?e:null,TH=({type:e,color:t,onChange:n,label:a,elements:i,palette:r=we,updateData:s})=>{let{container:l}=qa(),[,c]=mt(gl),[d,o]=mt(yf),u=f.jsxs("div",{children:[f.jsx(Cd,{children:I("colorPicker.hexCode")}),f.jsx(MH,{color:t,label:a,onChange:U=>{n(U)},colorPickerType:e})]}),h=M.useRef(null),p=()=>{var U,m;(m=(U=h.current)==null?void 0:U.querySelector(".color-picker-content"))==null||m.focus()};return f.jsx(Pv,{container:l,style:{maxWidth:"13rem"},onFocusOutside:U=>{p(),U.preventDefault()},onPointerDownOutside:U=>{d&&U.preventDefault()},onClose:()=>{s({openPopup:null}),c(null)},children:r?f.jsx(CH,{palette:r,color:t,onChange:U=>{n(U)},onEyeDropperToggle:U=>{o(m=>U?(m=m||{keepOpenOnAlt:!0,onSelect:n,colorPickerType:e},m.keepOpenOnAlt=!0,m):U===!1||m?null:{keepOpenOnAlt:!1,onSelect:n,colorPickerType:e})},onEscape:U=>{d?o(null):s({openPopup:null})},label:a,type:e,elements:i,updateData:s,children:u}):u})},_H=({label:e,color:t,type:n})=>f.jsx(Uf,{type:"button",className:ne("color-picker__button active-color properties-trigger",{"is-transparent":t==="transparent"||!t}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:I(n==="elementStroke"?"labels.showStroke":"labels.showBackground"),children:f.jsx("div",{className:"color-picker__button-outline"})}),mU=({type:e,color:t,onChange:n,label:a,elements:i,palette:r=we,topPicks:s,updateData:l,appState:c})=>f.jsx("div",{children:f.jsxs("div",{role:"dialog","aria-modal":"true",className:"color-picker-container",children:[f.jsx(pH,{activeColor:t,onChange:n,type:e,topPicks:s}),f.jsx(Av,{}),f.jsxs(pf,{open:c.openPopup===e,onOpenChange:d=>{l({openPopup:d?e:null})},children:[f.jsx(_H,{color:t,label:a,type:e}),c.openPopup===e&&f.jsx(TH,{type:e,color:t,onChange:n,label:a,elements:i,palette:r,updateData:l})]})]})}),wf=({icon:e})=>f.jsx("span",{style:{width:"1em",margin:"0 0.5ex 0 0.5ex",display:"inline-block",lineHeight:0,verticalAlign:"middle"},children:e}),jH=({label:e,open:t,openTrigger:n,children:a,className:i})=>f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:i,onClick:n,children:[e,f.jsx(wf,{icon:t?yT:G8})]}),t&&f.jsx("div",{style:{display:"flex",flexDirection:"column"},children:a})]}),U0=jH,AH=Bt(!1);function RH({options:e,value:t,label:n,onChange:a,onClose:i,numberOfOptionsToAlwaysShow:r=e.length}){let s=Tt(),l=p=>{let U=e.find(m=>m.keyBinding===p.key.toLowerCase());if(!(p.metaKey||p.altKey||p.ctrlKey)&&U)a(U.value),p.preventDefault();else if(p.key===D.TAB){let m=e.findIndex(b=>b.value===t),g=p.shiftKey?(e.length+m-1)%e.length:(m+1)%e.length;a(e[g].value)}else if(Xl(p.key)){let m=Xo().rtl,g=e.findIndex(b=>b.value===t);if(g!==-1){let b=e.length,v=g;switch(p.key){case(m?D.ARROW_LEFT:D.ARROW_RIGHT):v=(g+1)%b;break;case(m?D.ARROW_RIGHT:D.ARROW_LEFT):v=(b+g-1)%b;break;case D.ARROW_DOWN:{v=(g+(r??1))%b;break}case D.ARROW_UP:{v=(b+g-(r??1))%b;break}}a(e[v].value)}p.preventDefault()}else(p.key===D.ESCAPE||p.key===D.ENTER)&&(p.preventDefault(),i());p.nativeEvent.stopImmediatePropagation(),p.stopPropagation()},[c,d]=mt(AH),o=M.useMemo(()=>e.slice(0,r),[e,r]),u=M.useMemo(()=>e.slice(r),[e,r]);M.useEffect(()=>{o.some(p=>p.value===t)||d(!0)},[t,o,d]);let h=p=>f.jsx("div",{className:"picker-content",children:p.map((U,m)=>f.jsxs("button",{type:"button",className:ne("picker-option",{active:t===U.value}),onClick:g=>{a(U.value)},title:`${U.text} ${U.keyBinding&&`— ${U.keyBinding.toUpperCase()}`}`,"aria-label":U.text||"none","aria-keyshortcuts":U.keyBinding||void 0,ref:g=>{t===U.value&&setTimeout(()=>{g==null||g.focus()},0)},children:[U.icon,U.keyBinding&&f.jsx("span",{className:"picker-keybinding",children:U.keyBinding})]},U.text))});return f.jsx(dU,{side:s.editor.isMobile&&!s.viewport.isLandscape?"top":"bottom",align:"start",sideOffset:12,style:{zIndex:"var(--zIndex-popup)"},onKeyDown:l,children:f.jsxs("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":n,children:[h(o),u.length>0&&f.jsx(U0,{label:I("labels.more_options"),open:c,openTrigger:()=>{d(p=>!p)},className:"picker-collapsible",children:h(u)})]})})}function z6({value:e,label:t,options:n,onChange:a,group:i="",numberOfOptionsToAlwaysShow:r}){var d;let[s,l]=M.useState(!1),c=M.useRef(null);return f.jsx("div",{children:f.jsxs(pf,{open:s,onOpenChange:o=>l(o),children:[f.jsx(Uf,{name:i,type:"button","aria-label":t,onClick:()=>l(!s),ref:c,className:s?"active":"",children:(d=n.find(o=>o.value===e))==null?void 0:d.icon}),s&&f.jsx(RH,{options:n,value:e,label:t,onChange:a,onClose:()=>{l(!1)},numberOfOptionsToAlwaysShow:r})]})})}var Nv=M.forwardRef(({className:e,placeholder:t,onChange:n},a)=>f.jsxs("div",{className:ne("QuickSearch__wrapper",e),children:[Zr,f.jsx("input",{ref:a,className:"QuickSearch__input",type:"text",placeholder:t,onChange:i=>n(i.target.value.trim().toLowerCase())})]})),Ov=({className:e,placeholder:t,children:n})=>{let a=!M.Children.count(n);return f.jsx("div",{className:ne("ScrollableList__wrapper",e),role:"menu",children:a?f.jsx("div",{className:"empty",children:t}):n})},$v=({children:e,className:t="",style:n,title:a})=>f.jsxs("div",{className:`dropdown-menu-group ${t}`,style:n,children:[a&&f.jsx("p",{className:"dropdown-menu-group-title",children:a}),e]}),m0=$v;$v.displayName="DropdownMenuGroup";var Fv=M.createContext({}),zv=(e="",t=!1,n=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e}
|
|
124
|
+
${t?"dropdown-menu-item--selected":""} ${n?"dropdown-menu-item--hovered":""}`.trim(),Bv=(e,t)=>{let n=M.useContext(Fv);return $u(e,a=>{var r;let i=new CustomEvent("menu.itemSelect",{bubbles:!0,cancelable:!0});t==null||t(i),i.defaultPrevented||((r=n.onSelect)==null||r.call(n,i))})},LH=({textStyle:e,icon:t,shortcut:n,children:a})=>{let i=Tt();return f.jsxs(f.Fragment,{children:[t&&f.jsx("div",{className:"dropdown-menu-item__icon",children:t}),f.jsx("div",{style:e,className:"dropdown-menu-item__text",children:a}),n&&!i.editor.isMobile&&f.jsx("div",{className:"dropdown-menu-item__shortcut",children:n})]})},Hv=LH,gU=({icon:e,value:t,order:n,children:a,shortcut:i,className:r,hovered:s,selected:l,textStyle:c,onSelect:d,onClick:o,...u})=>{let h=Bv(o,d),p=M.useRef(null);return M.useEffect(()=>{var U,m;s&&(n===0?(U=p.current)==null||U.scrollIntoView({block:"end"}):(m=p.current)==null||m.scrollIntoView({block:"nearest"}))},[s,n]),f.jsx("button",{...u,ref:p,value:t,onClick:h,className:zv(r,l,s),title:u.title??u["aria-label"],children:f.jsx(Hv,{textStyle:c,icon:e,shortcut:i,children:a})})};gU.displayName="DropdownMenuItem";var Kl={GREEN:"green",RED:"red",BLUE:"blue"},bU=({type:e=Kl.BLUE,children:t})=>{let{theme:n}=gc(),a={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:n===ke.LIGHT?"1.5px solid white":"none"};switch(e){case Kl.GREEN:Object.assign(a,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case Kl.RED:Object.assign(a,{backgroundColor:"pink",color:"darkred"});break;case Kl.BLUE:default:Object.assign(a,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return f.jsx("div",{className:"DropDownMenuItemBadge",style:a,children:t})};bU.displayName="DropdownMenuItemBadge";gU.Badge=bU;var Gn=gU,DH=({event:e,inputRef:t,hoveredFont:n,filteredFonts:a,onClose:i,onSelect:r,onHover:s})=>{var l,c,d;if(!e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===D.F)return(l=t.current)==null||l.focus(),!0;if(e.key===D.ESCAPE)return i(),!0;if(e.key===D.ENTER)return n!=null&&n.value&&r(n.value),!0;if(e.key===D.ARROW_DOWN)return n!=null&&n.next?s(n.next.value):(c=a[0])!=null&&c.value&&s(a[0].value),!0;if(e.key===D.ARROW_UP)return n!=null&&n.prev?s(n.prev.value):(d=a[a.length-1])!=null&&d.value&&s(a[a.length-1].value),!0},PH=M.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:n,onHover:a,onLeave:i,onOpen:r,onClose:s})=>{let{container:l}=qa(),{fonts:c}=va(),{showDeprecatedFonts:d}=mc(),[o,u]=M.useState(""),h=M.useRef(null),p=M.useMemo(()=>Array.from(fi.registered.entries()).filter(([k,{metadata:T}])=>!T.serverSide&&!T.fallback).map(([k,{metadata:T,fontFaces:_}])=>{var A,R;let j={value:k,icon:T.icon??Zd,text:((R=(A=_[0])==null?void 0:A.fontFace)==null?void 0:R.family)??"Unknown"};return T.deprecated&&Object.assign(j,{deprecated:T.deprecated,badge:{type:Kl.RED,placeholder:I("fontList.badge.old")}}),j}).sort((k,T)=>k.text.toLowerCase()>T.text.toLowerCase()?1:-1),[]),U=M.useMemo(()=>new Set(c.getSceneFamilies()),[e]),m=M.useMemo(()=>p.filter(k=>U.has(k.value)),[p,U]),g=M.useMemo(()=>p.filter(k=>!U.has(k.value)&&(d||!k.deprecated)),[p,U,d]),b=M.useMemo(()=>lM([...m,...g].filter(k=>{var T;return(T=k.text)==null?void 0:T.toLowerCase().includes(o)})),[m,g,o]),v=M.useMemo(()=>{var T;let k;return t?k=b.find(_=>_.value===t):e&&(k=b.find(_=>_.value===e)),!k&&o&&((T=b[0])!=null&&T.value?a(b[0].value):i()),k},[t,e,o,b,a,i]),x=M.useCallback(k=>{DH({event:k,inputRef:h,hoveredFont:v,filteredFonts:b,onSelect:n,onHover:a,onClose:s})&&(k.preventDefault(),k.stopPropagation())},[v,b,n,a,s]);M.useEffect(()=>(r(),()=>{s()}),[]);let y=M.useMemo(()=>b.filter(k=>U.has(k.value)),[b,U]),E=M.useMemo(()=>b.filter(k=>!U.has(k.value)),[b,U]),S=(k,T)=>f.jsxs(Gn,{icon:k.icon,value:k.value,order:T,textStyle:{fontFamily:Ys({fontFamily:k.value})},hovered:k.value===(v==null?void 0:v.value),selected:k.value===e,tabIndex:k.value===e?0:-1,onClick:_=>{n(Number(_.currentTarget.value))},onMouseMove:()=>{(v==null?void 0:v.value)!==k.value&&a(k.value)},children:[k.text,k.badge&&f.jsx(bU,{type:k.badge.type,children:k.badge.placeholder})]},k.value),w=[];return y.length&&w.push(f.jsx(m0,{title:I("fontList.sceneFonts"),children:y.map(S)},"group_1")),E.length&&w.push(f.jsx(m0,{title:I("fontList.availableFonts"),children:E.map((k,T)=>S(k,T+y.length))},"group_2")),f.jsxs(Pv,{className:"properties-content",container:l,style:{width:"15rem"},onClose:s,onPointerLeave:i,onKeyDown:x,children:[f.jsx(Nv,{ref:h,placeholder:I("quickSearch.placeholder"),onChange:Zs(u,20)}),f.jsx(Ov,{className:"dropdown-menu fonts manual-hover",placeholder:I("fontList.empty"),children:w.length?w:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),NH=({selectedFontFamily:e})=>{let t=M.useMemo(()=>!!(e&&!$H(e)),[e]);return f.jsx(Uf,{asChild:!0,children:f.jsx("div",{children:f.jsx(jv,{standalone:!0,icon:j8,title:I("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{}})})})},Xv=[{value:it.Excalifont,icon:jo,text:I("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:it.Nunito,icon:Zd,text:I("labels.normal"),testId:"font-family-normal"},{value:it["Comic Shanns"],icon:I1,text:I("labels.code"),testId:"font-family-code"}],OH=new Set(Xv.map(e=>e.value)),$H=e=>e?OH.has(e):!1,FH=M.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:n,onSelect:a,onHover:i,onLeave:r,onPopupChange:s})=>{let l=M.useMemo(()=>Xv,[]),c=M.useCallback(d=>{d&&a(d)},[a]);return f.jsxs("div",{role:"dialog","aria-modal":"true",className:"FontPicker__container",children:[f.jsx(Ka,{type:"button",options:l,value:t,onClick:c}),f.jsx(Av,{}),f.jsxs(pf,{open:e,onOpenChange:s,children:[f.jsx(NH,{selectedFontFamily:t}),e&&f.jsx(PH,{selectedFontFamily:t,hoveredFontFamily:n,onSelect:c,onHover:i,onLeave:r,onOpen:()=>s(!0),onClose:()=>s(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),zH=({updateData:e,appState:t,elements:n,testId:a})=>{let i=M.useRef(null),r=M.useRef(null),s=dn(n,t,l=>l.opacity,!0,t.currentItemOpacity);return M.useEffect(()=>{if(i.current&&r.current){let l=i.current,c=r.current,d=l.offsetWidth,o=15,u=s/100*(d-o)+o/2;c.style.left=`${u}px`,l.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${s}%, var(--button-bg) ${s}%, var(--button-bg) 100%)`}},[s]),f.jsxs("label",{className:"control-label",children:[I("labels.opacity"),f.jsxs("div",{className:"range-wrapper",children:[f.jsx("input",{ref:i,type:"range",min:"0",max:"100",step:"10",onChange:l=>{e(+l.target.value)},value:s,className:"range-input","data-testid":a}),f.jsx("div",{className:"value-bubble",ref:r,children:s!==0?s:null}),f.jsx("div",{className:"zero-label",children:"0"})]})]})},Wv=.1,cn=(e,t,n,a=!1)=>{let i=ce(ve(e,t,{includeBoundTextElement:a}));return e.map(r=>{var s;return i.get(r.id)||r.id===((s=t.editingTextElement)==null?void 0:s.id)?n(r):r})},dn=function(e,t,n,a,i){let r=t.editingTextElement,s=Ye(e),l=null;return r&&(l=n(r)),l||(It(s,t)?l=SN(a===!0?s:s.filter(c=>a(c)),t,n)??(typeof i=="function"?i(!0):i):l=typeof i=="function"?i(!1):i),l},BH=(e,t)=>at(t)||!t.autoResize?t:G(t,{x:e.textAlign==="left"?e.x:e.x+(e.width-t.width)/(e.textAlign==="center"?2:1),y:e.y+(e.height-t.height)/2},!1),vU=(e,t,n,a,i)=>{let r=new Set,s=cn(e,t,c=>{if(q(c)){let d=a(c);r.add(d);let o=Ue(c,{fontSize:d});return on(o,n.scene.getContainerElement(c),n.scene.getNonDeletedElementsMap()),o=BH(c,o),o}return c},!0),l=ce(s);return ve(e,t,{includeBoundTextElement:!0}).forEach(c=>{q(c)&&xn(c,l)}),{elements:s,appState:{...t,currentItemFontSize:r.size===1?[...r][0]:i??t.currentItemFontSize},captureUpdate:X.IMMEDIATELY}};Z({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemStrokeColor&&{elements:cn(e,t,a=>R1(a.type)?Ue(a,{strokeColor:n.currentItemStrokeColor}):a,!0)},appState:{...t,...n},captureUpdate:n.currentItemStrokeColor?X.IMMEDIATELY:X.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:a})=>f.jsxs(f.Fragment,{children:[f.jsx("h3",{"aria-hidden":"true",children:I("labels.stroke")}),f.jsx(mU,{topPicks:Kb,palette:ak,type:"elementStroke",label:I("labels.stroke"),color:dn(e,t,i=>i.strokeColor,!0,t.currentItemStrokeColor),onChange:i=>n({currentItemStrokeColor:i}),elements:e,appState:t,updateData:n})]})});Z({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemBackgroundColor&&{elements:cn(e,t,a=>Ue(a,{backgroundColor:n.currentItemBackgroundColor}))},appState:{...t,...n},captureUpdate:n.currentItemBackgroundColor?X.IMMEDIATELY:X.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:a})=>f.jsxs(f.Fragment,{children:[f.jsx("h3",{"aria-hidden":"true",children:I("labels.background")}),f.jsx(mU,{topPicks:qb,palette:ik,type:"elementBackground",label:I("labels.background"),color:dn(e,t,i=>i.backgroundColor,!0,t.currentItemBackgroundColor),onChange:i=>n({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:n})]})});Z({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,n,a)=>(Qe("element","changeFillStyle",`${n} (${a.device.editor.isMobile?"mobile":"desktop"})`),{elements:cn(e,t,i=>Ue(i,{fillStyle:n})),appState:{...t,currentItemFillStyle:n},captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=ve(e,t),i=a.length>0&&a.every(r=>r.fillStyle==="zigzag");return f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.fill")}),f.jsx(Ka,{type:"button",options:[{value:"hachure",text:`${I(i?"labels.zigzag":"labels.hachure")} (${V("Alt-Click")})`,icon:i?dI:uI,active:i?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:I("labels.crossHatch"),icon:fI,testId:"fill-cross-hatch"},{value:"solid",text:I("labels.solid"),icon:hI,testId:"fill-solid"}],value:dn(e,t,r=>r.fillStyle,r=>r.hasOwnProperty("fillStyle"),r=>r?null:t.currentItemFillStyle),onClick:(r,s)=>{let l=s.altKey&&r==="hachure"&&a.every(c=>c.fillStyle==="hachure")?"zigzag":r;n(l)}})]})}});Z({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,n)=>({elements:cn(e,t,a=>Ue(a,{strokeWidth:n})),appState:{...t,currentItemStrokeWidth:n},captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.strokeWidth")}),f.jsx(Ka,{group:"stroke-width",options:[{value:nh.thin,text:I("labels.thin"),icon:O8,testId:"strokeWidth-thin"},{value:nh.bold,text:I("labels.bold"),icon:pI,testId:"strokeWidth-bold"},{value:nh.extraBold,text:I("labels.extraBold"),icon:UI,testId:"strokeWidth-extraBold"}],value:dn(e,t,a=>a.strokeWidth,a=>a.hasOwnProperty("strokeWidth"),a=>a?null:t.currentItemStrokeWidth),onChange:a=>n(a)})]})});Z({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,n)=>({elements:cn(e,t,a=>Ue(a,{seed:Ha(),roughness:n})),appState:{...t,currentItemRoughness:n},captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.sloppiness")}),f.jsx(Ka,{group:"sloppiness",options:[{value:0,text:I("labels.architect"),icon:bI},{value:1,text:I("labels.artist"),icon:vI},{value:2,text:I("labels.cartoonist"),icon:xI}],value:dn(e,t,a=>a.roughness,a=>a.hasOwnProperty("roughness"),a=>a?null:t.currentItemRoughness),onChange:a=>n(a)})]})});Z({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,n)=>({elements:cn(e,t,a=>Ue(a,{strokeStyle:n})),appState:{...t,currentItemStrokeStyle:n},captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.strokeStyle")}),f.jsx(Ka,{group:"strokeStyle",options:[{value:"solid",text:I("labels.strokeStyle_solid"),icon:O8},{value:"dashed",text:I("labels.strokeStyle_dashed"),icon:mI},{value:"dotted",text:I("labels.strokeStyle_dotted"),icon:gI}],value:dn(e,t,a=>a.strokeStyle,a=>a.hasOwnProperty("strokeStyle"),a=>a?null:t.currentItemStrokeStyle),onChange:a=>n(a)})]})});Z({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,n)=>({elements:cn(e,t,a=>Ue(a,{opacity:n}),!0),appState:{...t,currentItemOpacity:n},captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>f.jsx(zH,{updateData:n,elements:e,appState:t,testId:"opacity"})});Z({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,n,a)=>vU(e,t,a,()=>n,n),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.fontSize")}),f.jsx(Ka,{group:"font-size",options:[{value:16,text:I("labels.small"),icon:DI,testId:"fontSize-small"},{value:20,text:I("labels.medium"),icon:PI,testId:"fontSize-medium"},{value:28,text:I("labels.large"),icon:NI,testId:"fontSize-large"},{value:36,text:I("labels.veryLarge"),icon:OI,testId:"fontSize-veryLarge"}],value:dn(e,t,i=>{if(q(i))return i.fontSize;let r=ge(i,a.scene.getNonDeletedElementsMap());return r?r.fontSize:null},i=>q(i)||ge(i,a.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||Ci),onChange:i=>n(i)})]})});var B6=Z({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:Hu,trackEvent:!1,perform:(e,t,n,a)=>vU(e,t,a,i=>Math.round(1/(1+Wv)*i.fontSize)),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&(e.key===D.CHEVRON_LEFT||e.key===D.COMMA)}),H6=Z({name:"increaseFontSize",label:"labels.increaseFontSize",icon:Hu,trackEvent:!1,perform:(e,t,n,a)=>vU(e,t,a,i=>Math.round(i.fontSize*(1+Wv))),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&(e.key===D.CHEVRON_RIGHT||e.key===D.PERIOD)});Z({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,n,a)=>{var U;let{cachedElements:i,resetAll:r,resetContainers:s,...l}=n;if(r)return{elements:cn(e,t,m=>{let g=i==null?void 0:i.get(m.id);return g?Ue(m,{...g}):m},!0),appState:{...t,...l},captureUpdate:X.NEVER};let{currentItemFontFamily:c,currentHoveredFontFamily:d}=n,o=X.EVENTUALLY,u,h=!1;if(c)u=c,o=X.IMMEDIATELY;else if(d){u=d,o=X.EVENTUALLY;let m=ve(e,t,{includeBoundTextElement:!0}).filter(g=>q(g));if(m.length>200)h=!0;else{let g=0,b=0;for(;g<m.length&&b<5e3;){let v=m[g];b+=(v==null?void 0:v.originalText.length)||0,g++}b>5e3&&(h=!0)}}let p={appState:{...t,...l},captureUpdate:o};if(u&&!h){let m=new Map,g=new Set,b=!1,v=Array.from(fi.loadedFontsCache.values()),x=(U=Object.entries(it).find(([S,w])=>w===u))==null?void 0:U[0];d&&x&&v.some(S=>S.startsWith(x))&&(b=!0),Object.assign(p,{elements:cn(e,t,S=>{if(q(S)&&(S.fontFamily!==u||c)){let w=Ue(S,{fontFamily:u,lineHeight:Kr(u)}),k=(i==null?void 0:i.get(S.containerId||""))||{},T=a.scene.getContainerElement(S);return s&&T&&k&&G(T,{...k},!1),b||(g=new Set([...g,...Array.from(w.originalText)])),m.set(w,T),w}return S},!0)});let y=`10px ${Ys({fontFamily:u})}`,E=Array.from(g.values()).join();if(b||window.document.fonts.check(y,E))for(let[S,w]of m)on(S,w,a.scene.getNonDeletedElementsMap(),!1);else window.document.fonts.load(y,E).then(S=>{for(let[w,k]of m){let T=a.scene.getElement(w.id),_=k?a.scene.getElement(k.id):null;T&&on(T,_,a.scene.getNonDeletedElementsMap(),!1)}a.fonts.onLoaded(S)})}return p},PanelComponent:({elements:e,appState:t,app:n,updateData:a})=>{let i=M.useRef(new Map),r=M.useRef(null),[s,l]=M.useState({}),c=M.useRef(!0),d=M.useMemo(()=>{var u;let o=(h,p)=>dn(h,t,U=>{if(q(U))return U.fontFamily;let m=ge(U,p);return m?m.fontFamily:null},U=>q(U)||ge(U,p)!==null,U=>U?null:t.currentItemFontFamily||or);return s.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?o(Array.from(((u=i.current)==null?void 0:u.values())??[]),i.current):!s.openPopup&&t.openPopup!=="fontFamily"?o(e,n.scene.getNonDeletedElementsMap()):r.current},[s.openPopup,t,e,n.scene]);return M.useEffect(()=>{r.current=d},[d]),M.useEffect(()=>{Object.keys(s).length&&(a(s),l({}))},[s]),M.useEffect(()=>(c.current=!1,()=>{c.current=!0}),[]),f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.fontFamily")}),f.jsx(FH,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:d,hoveredFontFamily:t.currentHoveredFontFamily,onSelect:o=>{l({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:o}),i.current.clear()},onHover:o=>{l({currentHoveredFontFamily:o,cachedElements:new Map(i.current),resetContainers:!0})},onLeave:()=>{l({currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0})},onPopupChange:o=>{if(o){i.current.clear();let{editingTextElement:u}=t;if((u==null?void 0:u.type)==="text"){let h=n.scene.getElement(u.id);i.current.set(u.id,Ue(h||u,{},!0))}else{let h=ve(e,t,{includeBoundTextElement:!0});for(let p of h)i.current.set(p.id,Ue(p,{},!0))}l({openPopup:"fontFamily"})}else{let u={openPopup:null,currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0};c.current?a({...s,...u}):l(u),i.current.clear()}}})]})}});Z({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,n,a)=>({elements:cn(e,t,i=>{if(q(i)){let r=Ue(i,{textAlign:n});return on(r,a.scene.getContainerElement(i),a.scene.getNonDeletedElementsMap()),r}return i},!0),appState:{...t,currentItemTextAlign:n},captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>{let i=a.scene.getNonDeletedElementsMap();return f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.textAlign")}),f.jsx(Ka,{group:"text-align",options:[{value:"left",text:I("labels.left"),icon:FI,testId:"align-left"},{value:"center",text:I("labels.center"),icon:zI,testId:"align-horizontal-center"},{value:"right",text:I("labels.right"),icon:BI,testId:"align-right"}],value:dn(e,t,r=>{if(q(r))return r.textAlign;let s=ge(r,i);return s?s.textAlign:null},r=>q(r)||ge(r,i)!==null,r=>r?null:t.currentItemTextAlign),onChange:r=>n(r)})]})}});Z({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,n,a)=>({elements:cn(e,t,i=>{if(q(i)){let r=Ue(i,{verticalAlign:n});return on(r,a.scene.getContainerElement(i),a.scene.getNonDeletedElementsMap()),r}return i},!0),appState:{...t},captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx("fieldset",{children:f.jsx(Ka,{group:"text-align",options:[{value:Mn.TOP,text:I("labels.alignTop"),icon:f.jsx(HI,{theme:t.theme}),testId:"align-top"},{value:Mn.MIDDLE,text:I("labels.centerVertically"),icon:f.jsx(WI,{theme:t.theme}),testId:"align-middle"},{value:Mn.BOTTOM,text:I("labels.alignBottom"),icon:f.jsx(XI,{theme:t.theme}),testId:"align-bottom"}],value:dn(e,t,i=>{if(q(i)&&i.containerId)return i.verticalAlign;let r=ge(i,a.scene.getNonDeletedElementsMap());return r?r.verticalAlign:null},i=>q(i)||ge(i,a.scene.getNonDeletedElementsMap())!==null,i=>i?null:Mn.MIDDLE),onChange:i=>n(i)})})});Z({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,n)=>({elements:cn(e,t,a=>ee(a)?a:Ue(a,{roundness:n==="round"?{type:fl(a.type)?St.ADAPTIVE_RADIUS:St.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:n},captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=F3(Ye(e),t).some(i=>{var r;return((r=i.roundness)==null?void 0:r.type)===St.LEGACY});return f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.edges")}),f.jsx(Ka,{group:"edges",options:[{value:"sharp",text:I("labels.sharp"),icon:yI},{value:"round",text:I("labels.round"),icon:wI}],value:dn(e,t,i=>a?null:i.roundness?"round":"sharp",i=>!xe(i)&&i.hasOwnProperty("roundness"),i=>i?null:t.currentItemRoundness),onChange:i=>n(i)})]})}});var X6=e=>[{value:null,text:I("labels.arrowhead_none"),keyBinding:"q",icon:EI},{value:"arrow",text:I("labels.arrowhead_arrow"),keyBinding:"w",icon:f.jsx(SI,{flip:e})},{value:"triangle",text:I("labels.arrowhead_triangle"),icon:f.jsx(II,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:I("labels.arrowhead_triangle_outline"),icon:f.jsx(TI,{flip:e}),keyBinding:"r"},{value:"circle",text:I("labels.arrowhead_circle"),keyBinding:"a",icon:f.jsx(CI,{flip:e})},{value:"circle_outline",text:I("labels.arrowhead_circle_outline"),keyBinding:"s",icon:f.jsx(kI,{flip:e})},{value:"diamond",text:I("labels.arrowhead_diamond"),icon:f.jsx(_I,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:I("labels.arrowhead_diamond_outline"),icon:f.jsx(jI,{flip:e}),keyBinding:"f"},{value:"bar",text:I("labels.arrowhead_bar"),keyBinding:"z",icon:f.jsx(MI,{flip:e})},{value:"crowfoot_one",text:I("labels.arrowhead_crowfoot_one"),icon:f.jsx(RI,{flip:e}),keyBinding:"c"},{value:"crowfoot_many",text:I("labels.arrowhead_crowfoot_many"),icon:f.jsx(AI,{flip:e}),keyBinding:"x"},{value:"crowfoot_one_or_many",text:I("labels.arrowhead_crowfoot_one_or_many"),icon:f.jsx(LI,{flip:e}),keyBinding:"v"}];Z({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,n)=>({elements:cn(e,t,a=>{if(fe(a)){let{position:i,type:r}=n;if(i==="start")return Ue(a,{startArrowhead:r});if(i==="end")return Ue(a,{endArrowhead:r})}return a}),appState:{...t,[n.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type},captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=Xo().rtl;return f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.arrowheads")}),f.jsxs("div",{className:"iconSelectList buttonList",children:[f.jsx(z6,{label:"arrowhead_start",options:X6(!a),value:dn(e,t,i=>fe(i)&&Jd(i.type)?i.startArrowhead:t.currentItemStartArrowhead,!0,t.currentItemStartArrowhead),onChange:i=>n({position:"start",type:i}),numberOfOptionsToAlwaysShow:4}),f.jsx(z6,{label:"arrowhead_end",group:"arrowheads",options:X6(!!a),value:dn(e,t,i=>fe(i)&&Jd(i.type)?i.endArrowhead:t.currentItemEndArrowhead,!0,t.currentItemEndArrowhead),onChange:i=>n({position:"end",type:i}),numberOfOptionsToAlwaysShow:4})]})]})}});Z({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,n,a)=>{var l;let i=cn(e,t,c=>{if(!xe(c))return c;let d=Ue(c,{roundness:n===Ot.round?{type:St.PROPORTIONAL_RADIUS}:null,elbowed:n===Ot.elbow,points:n===Ot.elbow||c.elbowed?[c.points[0],c.points[c.points.length-1]]:c.points});if(ee(d)){let o=a.scene.getNonDeletedElementsMap();a.dismissLinearEditor();let u=J.getPointAtIndexGlobalCoordinates(d,0,o),h=J.getPointAtIndexGlobalCoordinates(d,-1,o),p=!d.startBinding&&ra(aa(u),e,o,t.zoom,!1,!0),U=!d.endBinding&&ra(aa(h),e,o,t.zoom,!1,!0),m=p||d.startBinding&&o.get(d.startBinding.elementId),g=U||d.endBinding&&o.get(d.endBinding.elementId),b=p?Ro(d,p,"start"):u,v=U?Ro(d,U,"end"):h;p&&Ba(d,p,"start",o),U&&Ba(d,U,"end",o),G(d,{points:[b,v].map(x=>C(x[0]-d.x,x[1]-d.y)),...m&&d.startBinding?{startBinding:{...d.startBinding,...tu(d,m,"start")}}:{},...g&&d.endBinding?{endBinding:{...d.endBinding,...tu(d,g,"end")}}:{}}),J.updateEditorMidPointsCache(d,o,a.state)}return d}),r={...t,currentItemArrowType:n},s=(l=t.selectedLinearElement)==null?void 0:l.elementId;if(s){let c=i.find(d=>d.id===s);c&&(r.selectedLinearElement=new J(c))}return{elements:i,appState:r,captureUpdate:X.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:n})=>f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.arrowtypes")}),f.jsx(Ka,{group:"arrowtypes",options:[{value:Ot.sharp,text:I("labels.arrowtype_sharp"),icon:bT,testId:"sharp-arrow"},{value:Ot.round,text:I("labels.arrowtype_round"),icon:xT,testId:"round-arrow"},{value:Ot.elbow,text:I("labels.arrowtype_elbowed"),icon:vT,testId:"elbow-arrow"}],value:dn(e,t,a=>xe(a)?a.elbowed?Ot.elbow:a.roundness?Ot.round:Ot.sharp:null,a=>xe(a),a=>a?null:t.currentItemArrowType),onChange:a=>n(a)})]})});var Ar=({viewportX:e,viewportY:t,nextZoom:n},a)=>{let i=e-a.offsetLeft,r=t-a.offsetTop,s=a.zoom.value,l=a.scrollX+(i-i/s),c=a.scrollY+(r-r/s),d=-(i-i/n),o=-(r-r/n);return{scrollX:l+d,scrollY:c+o,zoom:{value:n}}},fo=()=>{let e=document.querySelector(".excalidraw-tooltip");if(e)return e;let t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},Vv=(e,t,n="bottom")=>{let a=e.getBoundingClientRect(),i=window.innerWidth,r=window.innerHeight,s=5,l=t.left+t.width/2-a.width/2;l<0?l=s:l+a.width>=i&&(l=i-a.width-s);let c;n==="bottom"?(c=t.top+t.height+s,c+a.height>=r&&(c=t.top-a.height-s)):(c=t.top-a.height-s,c<0&&(c=t.top+t.height+s)),Object.assign(e.style,{top:`${c}px`,left:`${l}px`})},HH=(e,t,n,a)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=a?"50ch":"10ch",t.style.maxWidth=a?"50ch":"15ch",t.textContent=n;let i=e.getBoundingClientRect();Vv(t,i)},ns=({children:e,label:t,long:n=!1,style:a,disabled:i})=>(M.useEffect(()=>()=>fo().classList.remove("excalidraw-tooltip--visible"),[]),i?null:f.jsx("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:r=>HH(r.currentTarget,fo(),t,n),onPointerLeave:()=>fo().classList.remove("excalidraw-tooltip--visible"),style:a,children:e}));Z({name:"changeViewBackgroundColor",label:"labels.canvasBackground",paletteName:"Change canvas background color",trackEvent:!1,predicate:(e,t,n,a)=>!!a.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,n)=>({appState:{...t,...n},captureUpdate:n.viewBackgroundColor?X.IMMEDIATELY:X.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:a})=>f.jsx(mU,{palette:null,topPicks:Jb,label:I("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:i=>n({viewBackgroundColor:i}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:n})});var ho=Z({name:"clearCanvas",label:"labels.clearCanvas",paletteName:"Clear canvas",icon:Yr,trackEvent:{category:"canvas"},predicate:(e,t,n,a)=>{var i;return!!a.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&((i=t.openDialog)==null?void 0:i.name)!=="elementLinkSelector"},perform:(e,t,n,a)=>(a.imageCache.clear(),{elements:e.map(i=>Ue(i,{isDeleted:!0})),appState:{...za(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:"selection"}:t.activeTool},captureUpdate:X.IMMEDIATELY})}),W6=Z({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:p2,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>({appState:{...t,...Ar({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:di(t.zoom.value+Pu)},t),userToFollow:null},captureUpdate:X.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>f.jsx(Me,{type:"button",className:"zoom-in-button zoom-button",icon:p2,title:`${I("buttons.zoomIn")} — ${V("CtrlOrCmd++")}`,"aria-label":I("buttons.zoomIn"),disabled:t.zoom.value>=F0,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Re.EQUAL||e.code===Re.NUM_ADD)&&(e[D.CTRL_OR_CMD]||e.shiftKey)}),V6=Z({name:"zoomOut",label:"buttons.zoomOut",icon:U2,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>({appState:{...t,...Ar({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:di(t.zoom.value-Pu)},t),userToFollow:null},captureUpdate:X.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>f.jsx(Me,{type:"button",className:"zoom-out-button zoom-button",icon:U2,title:`${I("buttons.zoomOut")} — ${V("CtrlOrCmd+-")}`,"aria-label":I("buttons.zoomOut"),disabled:t.zoom.value<=$0,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Re.MINUS||e.code===Re.NUM_SUBTRACT)&&(e[D.CTRL_OR_CMD]||e.shiftKey)}),G6=Z({name:"resetZoom",label:"buttons.resetZoom",icon:ZM,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>({appState:{...t,...Ar({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:di(1)},t),userToFollow:null},captureUpdate:X.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>f.jsx(ns,{label:I("buttons.resetZoom"),style:{height:"100%"},children:f.jsxs(Me,{type:"button",className:"reset-zoom-button zoom-button",title:I("buttons.resetZoom"),"aria-label":I("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===Re.ZERO||e.code===Re.NUM_ZERO)&&(e[D.CTRL_OR_CMD]||e.shiftKey)}),XH=(e,t,n=1)=>{let[a,i,r,s]=e,l=r-a,c=t.width/l,d=s-i,o=t.height/d,u=Math.min(c,o)*Se(n,.1,1);return Math.min(u,1)},Gv=({bounds:e,appState:t,canvasOffsets:n,fitToViewport:a=!1,viewportZoomFactor:i=1,minZoom:r=-1/0,maxZoom:s=1/0})=>{i=Se(i,$0,F0);let[l,c,d,o]=e,u=(l+d)/2,h=(c+o)/2,p=(n==null?void 0:n.left)??0,U=(n==null?void 0:n.top)??0,m=(n==null?void 0:n.right)??0,g=(n==null?void 0:n.bottom)??0,b=t.width-p-m,v=t.height-U-g,x;if(a){let S=d-l,w=o-c;x=Math.min(b/S,v/w)*i}else x=XH(e,{width:b,height:v},i);let y=di(Se(Nk(x,Pu,"floor"),r,s)),E=R7({scenePoint:{x:u,y:h},viewportDimensions:{width:t.width,height:t.height},offsets:n,zoom:{value:y}});return{appState:{...t,scrollX:E.scrollX,scrollY:E.scrollY,zoom:{value:y}},captureUpdate:X.EVENTUALLY}},Ef=({canvasOffsets:e,targetElements:t,appState:n,fitToViewport:a,viewportZoomFactor:i,minZoom:r,maxZoom:s})=>{let l=$e(Ye(t));return Gv({canvasOffsets:e,bounds:l,appState:n,fitToViewport:a,viewportZoomFactor:i,minZoom:r,maxZoom:s})};Z({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:np,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return Ef({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:a.getEditorUIOffsets()})},keyTest:e=>e.code===Re.TWO&&e.shiftKey&&!e.altKey&&!e[D.CTRL_OR_CMD]});Z({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:np,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return Ef({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:a.getEditorUIOffsets()})},keyTest:e=>e.code===Re.THREE&&e.shiftKey&&!e.altKey&&!e[D.CTRL_OR_CMD]});Z({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:np,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>Ef({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:a.getEditorUIOffsets()}),keyTest:e=>e.code===Re.ONE&&e.shiftKey&&!e.altKey&&!e[D.CTRL_OR_CMD]});var xu=Z({name:"toggleTheme",label:(e,t)=>t.theme===ke.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:e=>e.theme===ke.LIGHT?C1:k1,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n)=>({appState:{...t,theme:n||(t.theme===ke.LIGHT?ke.DARK:ke.LIGHT)},captureUpdate:X.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===Re.D,predicate:(e,t,n,a)=>!!a.props.UIOptions.canvasActions.toggleTheme});Z({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t)=>{let n;return Ia(t)?n=Et(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):n=Et(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:n},captureUpdate:X.IMMEDIATELY}},keyTest:e=>e.key===D.E});var WH=Z({name:"toggleHandTool",label:"toolBar.hand",paletteName:"Toggle hand tool",trackEvent:{category:"toolbar"},icon:F8,viewMode:!1,perform:(e,t,n,a)=>{let i;return Gs(t)?i=Et(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(i=Et(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),We(a.interactiveCanvas,He.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:i},captureUpdate:X.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[D.CTRL_OR_CMD]&&e.key===D.H}),Kn=Z({name:"finalize",label:"",trackEvent:!1,perform:(e,t,n,a)=>{var h;let{interactiveCanvas:i,focusContainer:r,scene:s}=a,l=s.getNonDeletedElementsMap();if(t.editingLinearElement){let{elementId:p,startBindingElement:U,endBindingElement:m}=t.editingLinearElement,g=J.getElement(p,l);if(g)return La(g)&&Yu(g,U,m,l,s),{elements:g.points.length<2||Qr(g)?e.filter(b=>b.id!==g.id):void 0,appState:{...t,cursorButton:"up",editingLinearElement:null},captureUpdate:X.IMMEDIATELY}}let c=e,d=t.pendingImageElementId&&s.getElement(t.pendingImageElementId);d&&G(d,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&r();let o=t.multiElement?t.multiElement:((h=t.newElement)==null?void 0:h.type)==="freedraw"?t.newElement:null;if(o){if(o.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:U,lastCommittedPoint:m}=o;(!m||U[U.length-1]!==m)&&G(o,{points:o.points.slice(0,-1)})}Qr(o)&&(c=c.filter(U=>U.id!==o.id));let p=Ui(o.points,t.zoom.value);if((o.type==="line"||o.type==="freedraw")&&p){let U=o.points,m=U[0];G(o,{points:U.map((g,b)=>b===U.length-1?C(m[0],m[1]):g)})}if(La(o)&&!p&&o.points.length>1){let[U,m]=J.getPointAtIndexGlobalCoordinates(o,-1,ce(e));D1(o,t,{x:U,y:m},l,e)}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!o)&&Jn(i);let u;return t.activeTool.type==="eraser"?u=Et(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):u=Et(t,{type:"selection"}),{elements:c,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&o?t.activeTool:u,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:o&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[o.id]:!0}:t.selectedElementIds,selectedLinearElement:o&&fe(o)?new J(o):t.selectedLinearElement,pendingImageElementId:null},captureUpdate:X.IMMEDIATELY}},keyTest:(e,t)=>e.key===D.ESCAPE&&(t.editingLinearElement!==null||!t.newElement&&t.multiElement===null)||(e.key===D.ESCAPE||e.key===D.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:n})=>f.jsx(Me,{type:"button",icon:rI,title:I("buttons.done"),"aria-label":I("buttons.done"),onClick:t,visible:e.multiElement!=null,size:(n==null?void 0:n.size)||"medium",style:{pointerEvents:"all"}})}),VH=e=>{let{id:t}=qa(),[n,a]=M.useState(e.value),i=s=>{e.ignoreFocus||aM(s.target);let l=s.target.value;l!==e.value&&e.onChange(l)},r=s=>{if(s.key===D.ENTER){if(s.preventDefault(),s.nativeEvent.isComposing||s.keyCode===229)return;s.currentTarget.blur()}};return f.jsxs("div",{className:"ProjectName",children:[f.jsx("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),f.jsx("input",{type:"text",className:"TextInput",onBlur:i,onKeyDown:r,id:`${t}-filename`,value:n,onChange:s=>a(s.target.value)})]})},GH=e=>{let t=e.title||(e.value===ke.DARK?I("buttons.lightMode"):I("buttons.darkMode"));return f.jsx(Me,{type:"icon",icon:e.value===ke.LIGHT?Y6.MOON:Y6.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===ke.DARK?ke.LIGHT:ke.DARK),"data-testid":"toggle-dark-mode"})},Y6={SUN:f.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:f.jsx("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:f.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:f.jsx("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})},Sf=(e,{selectedElementIds:t},n)=>{e=Ye(e);let a=n&&It(e,{selectedElementIds:t}),i=null,r=a?ve(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return a&&(r.length===1&&de(r[0])?(i=r[0],r=Np(e,i)):r.length>1&&(r=ve(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:i,exportedElements:ui(r)}},Cf=async(e,t,n,a,{exportBackground:i,exportPadding:r=dl,viewBackgroundColor:s,name:l=n.name||s8,fileHandle:c=null,exportingFrame:d=null})=>{if(t.length===0)throw new Error(I("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let u=wp(t,{exportBackground:i,exportWithDarkMode:n.exportWithDarkMode,viewBackgroundColor:s,exportPadding:r,exportScale:n.exportScale,exportEmbedScene:n.exportEmbedScene&&e==="svg"},a,{exportingFrame:d});if(e==="svg")return su(u.then(h=>new Blob([h.outerHTML],{type:ae.svg})),{description:"Export to SVG",name:l,extension:n.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[Vs.svg],fileHandle:c});if(e==="clipboard-svg"){let h=await u.then(p=>p.outerHTML);try{await pl(h)}catch{throw new Error(I("errors.copyToSystemClipboardFailed"))}return}}let o=v3(t,n,a,{exportBackground:i,viewBackgroundColor:s,exportPadding:r,exportingFrame:d});if(e==="png"){let u=zo(o);return n.exportEmbedScene&&(u=u.then(h=>Promise.resolve().then(()=>require("./layers.D5Ff-TQt.js")).then(({encodePngMetadata:p})=>p({blob:h,metadata:sc(t,n,a,"local")})))),su(u,{description:"Export to PNG",name:l,extension:n.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[Vs.png],fileHandle:c})}else if(e==="clipboard")try{let u=zo(o);await I3(u)}catch(u){throw console.warn(u),u.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(I("canvasError.canvasTooBig")):ko&&u.name==="TypeError"?new Error(`${I("alerts.couldNotCopyToClipboard")}
|
|
125
|
+
|
|
126
|
+
${I("hints.firefox_clipboard_write")}`):new Error(I("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")},YH=async(e,t,n,a)=>{let{exportBackground:i,viewBackgroundColor:r,fileHandle:s}=t,l=q3(s);if(!s||!GN(l))throw new Error("fileHandle should exist and should be of type svg or png when resaving");t={...t,exportEmbedScene:!0};let{exportedElements:c,exportingFrame:d}=Sf(e,t,!1);return await Cf(l,c,t,n,{exportBackground:i,viewBackgroundColor:r,name:a,fileHandle:s,exportingFrame:d}),{fileHandle:s}},xU=({children:e,checked:t,onChange:n,className:a})=>f.jsxs("div",{className:ne("Checkbox",a,{"is-checked":t}),onClick:i=>{n(!t,i),i.currentTarget.querySelector(".Checkbox-box").focus()},children:[f.jsx("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:eI}),f.jsx("div",{className:"Checkbox-label",children:e})]}),ZH=Z({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,n)=>({appState:{...t,name:n},captureUpdate:X.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:n,data:a,app:i})=>f.jsx(VH,{label:I("labels.fileTitle"),value:i.getName(),onChange:r=>t(r),ignoreFocus:(a==null?void 0:a.ignoreFocus)??!1})}),KH=Z({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,n)=>({appState:{...t,exportScale:n},captureUpdate:X.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=Ye(e),i=It(a,t)?ve(a,t):a;return f.jsx(f.Fragment,{children:B0.map(r=>{let[s,l]=AP(i,dl,r),c=`${I("imageExportDialog.label.scale")} ${r}x (${s}x${l})`;return f.jsx(Me,{size:"small",type:"radio",icon:`${r}x`,name:"export-canvas-scale",title:c,"aria-label":c,id:"export-canvas-scale",checked:r===t.exportScale,onChange:()=>n(r)},r)})})}}),qH=Z({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,n)=>({appState:{...t,exportBackground:n},captureUpdate:X.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>f.jsx(xU,{checked:e.exportBackground,onChange:n=>t(n),children:I("imageExportDialog.label.withBackground")})}),Yv=Z({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,n)=>({appState:{...t,exportEmbedScene:n},captureUpdate:X.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>f.jsxs(xU,{checked:e.exportEmbedScene,onChange:n=>t(n),children:[I("imageExportDialog.label.embedScene"),f.jsx(ns,{label:I("imageExportDialog.tooltip.embedScene"),long:!0,children:f.jsx("div",{className:"excalidraw-tooltip-icon",children:sI})})]})}),Z6=Z({name:"saveToActiveFile",label:"buttons.save",icon:Bu,trackEvent:{category:"export"},predicate:(e,t,n,a)=>!!a.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,n,a)=>{let i=!!t.fileHandle;try{let{fileHandle:r}=Vp(t.fileHandle)?await YH(e,t,a.files,a.getName()):await i3(e,t,a.files,a.getName());return{captureUpdate:X.EVENTUALLY,appState:{...t,fileHandle:r,toast:i?{message:r!=null&&r.name?I("toast.fileSavedToFilename").replace("{filename}",`"${r.name}"`):I("toast.fileSaved")}:null}}}catch(r){return(r==null?void 0:r.name)!=="AbortError"?console.error(r):console.warn(r),{captureUpdate:X.EVENTUALLY}}},keyTest:e=>e.key===D.S&&e[D.CTRL_OR_CMD]&&!e.shiftKey}),Zv=Z({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:Bu,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,n,a)=>{try{let{fileHandle:i}=await i3(e,{...t,fileHandle:null},a.files,a.getName());return{captureUpdate:X.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:i,toast:{message:I("toast.fileSaved")}}}}catch(i){return(i==null?void 0:i.name)!=="AbortError"?console.error(i):console.warn(i),{captureUpdate:X.EVENTUALLY}}},keyTest:e=>e.key===D.S&&e.shiftKey&&e[D.CTRL_OR_CMD],PanelComponent:({updateData:e})=>f.jsx(Me,{type:"button",icon:nI,title:I("buttons.saveAs"),"aria-label":I("buttons.saveAs"),showAriaLabel:Tt().editor.isMobile,hidden:!is,onClick:()=>e(null),"data-testid":"save-as-button"})}),g0=Z({name:"loadScene",label:"buttons.load",trackEvent:{category:"export"},predicate:(e,t,n,a)=>!!a.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,n,a)=>{try{let{elements:i,appState:r,files:s}=await wP(t,e);return{elements:i,appState:r,files:s,captureUpdate:X.IMMEDIATELY}}catch(i){return(i==null?void 0:i.name)==="AbortError"?(console.warn(i),!1):{elements:e,appState:{...t,errorMessage:i.message},files:a.files,captureUpdate:X.EVENTUALLY}}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.O}),JH=Z({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,n)=>({appState:{...t,exportWithDarkMode:n},captureUpdate:X.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>f.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:f.jsx(GH,{value:e.exportWithDarkMode?ke.DARK:ke.LIGHT,onChange:n=>{t(n===ke.DARK)},title:I("imageExportDialog.label.darkMode")})})}),Kv="{}",QH=Z({name:"copyStyles",label:"labels.copyStyles",icon:V8,trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=[],r=e.find(s=>t.selectedElementIds[s.id]);if(i.push(r),r&&Wn(r)){let s=ge(r,a.scene.getNonDeletedElementsMap());i.push(s)}return r&&(Kv=JSON.stringify(i)),{appState:{...t,toast:{message:I("toast.copyStyles")}},captureUpdate:X.EVENTUALLY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.C}),eX=Z({name:"pasteStyles",label:"labels.pasteStyles",icon:V8,trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=JSON.parse(Kv),r=i[0],s=i[1];if(!C8(r))return{elements:e,captureUpdate:X.EVENTUALLY};let l=ve(e,t,{includeBoundTextElement:!0}),c=l.map(d=>d.id);return{elements:e.map(d=>{if(c.includes(d.id)){let o=r;if(q(d)&&d.containerId&&(o=s),!o)return d;let u=Ue(d,{backgroundColor:o==null?void 0:o.backgroundColor,strokeWidth:o==null?void 0:o.strokeWidth,strokeColor:o==null?void 0:o.strokeColor,strokeStyle:o==null?void 0:o.strokeStyle,fillStyle:o==null?void 0:o.fillStyle,opacity:o==null?void 0:o.opacity,roughness:o==null?void 0:o.roughness,roundness:o.roundness?UM(o.roundness.type,d)?o.roundness:mM(d):null});if(q(u)){let h=o.fontSize||Ci,p=o.fontFamily||or;u=Ue(u,{fontSize:h,fontFamily:p,textAlign:o.textAlign||Jo,lineHeight:o.lineHeight||Kr(p)});let U=null;u.containerId&&(U=l.find(m=>q(u)&&m.id===u.containerId)||null),on(u,U,a.scene.getNonDeletedElementsMap())}return u.type==="arrow"&&xe(o)&&(u=Ue(u,{startArrowhead:o.startArrowhead,endArrowhead:o.endArrowhead})),de(d)&&(u=Ue(u,{roundness:null,backgroundColor:"transparent"})),u}return d}),captureUpdate:X.IMMEDIATELY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.V});Z({name:"toggleCanvasMenu",label:"buttons.menu",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="canvas"?null:"canvas"},captureUpdate:X.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>f.jsx(Me,{type:"button",icon:A8,"aria-label":I("buttons.menu"),onClick:t,selected:e.openMenu==="canvas"})});Z({name:"toggleEditMenu",label:"buttons.edit",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="shape"?null:"shape"},captureUpdate:X.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>f.jsx(Me,{visible:Xp(t,Ye(e)),type:"button",icon:aI,"aria-label":I("buttons.edit"),onClick:n,selected:t.openMenu==="shape"})});var yU=Z({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:qM,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,n,{focusContainer:a})=>{var i,r;return((i=t.openDialog)==null?void 0:i.name)==="help"&&a(),{appState:{...t,openDialog:((r=t.openDialog)==null?void 0:r.name)==="help"?null:{name:"help"}},captureUpdate:X.EVENTUALLY}},keyTest:e=>e.key===D.QUESTION_MARK}),tX=e=>{if(e.length>=2){let t=e[0].groupIds;for(let n of t)if(e.reduce((a,i)=>a&&Po(i,n),!0))return!0}return!1},K6=(e,t,n)=>{let a=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return a.length>=2&&!tX(a)&&!O3(a)},nX=Z({name:"group",label:"labels.group",icon:e=>f.jsx(T2,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=Pp(a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(i.length<2)return{appState:t,elements:e,captureUpdate:X.EVENTUALLY};let r=Pr(t);if(r.length===1){let m=r[0],g=new Set(nt(e,m).map(v=>v.id)),b=new Set(i.map(v=>v.id));if(new Set([...Array.from(g),...Array.from(b)]).size===g.size)return{appState:t,elements:e,captureUpdate:X.EVENTUALLY}}let s=[...e];new Set(i.map(m=>m.frameId)).size>1&&xN(i).forEach((m,g)=>{sf(m,a.scene.getNonDeletedElementsMap())});let l=Vn(),c=ce(i);s=s.map(m=>c.get(m.id)?Ue(m,{groupIds:_D(m.groupIds,l,t.editingGroupId)}):m);let d=nt(s,l),o=d[d.length-1],u=s.lastIndexOf(o),h=s.slice(u+1),p=s.slice(0,u).filter(m=>!Po(m,l)),U=Wa([...p,...d,...h],ce(d));return{appState:{...t,...D7(l,{...t,selectedGroupIds:{}},Ye(s))},elements:U,captureUpdate:X.IMMEDIATELY}},predicate:(e,t,n,a)=>K6(e,t,a),keyTest:e=>!e.shiftKey&&e[D.CTRL_OR_CMD]&&e.key===D.G,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx(Me,{hidden:!K6(e,t,a),type:"button",icon:f.jsx(T2,{theme:t.theme}),onClick:()=>n(null),title:`${I("labels.group")} — ${V("CtrlOrCmd+G")}`,"aria-label":I("labels.group"),visible:It(Ye(e),t)})}),aX=Z({name:"ungroup",label:"labels.ungroup",icon:e=>f.jsx(_2,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=Pr(t),r=ce(e);if(i.length===0)return{appState:t,elements:e,captureUpdate:X.EVENTUALLY};let s=[...e],l=[];s=s.map(u=>{at(u)&&l.push(u.id);let h=jD(u.groupIds,t.selectedGroupIds);return h.length===u.groupIds.length?u:Ue(u,{groupIds:h})});let c=ln(t,Ye(s),t,null),d=a.scene.getSelectedElements(t),o=new Set(d.filter(u=>u.frameId).map(u=>u.frameId));return Dp(e).filter(u=>o.has(u.id)).forEach(u=>{u&&(s=P3(s,bd(s,u,t,r),u,a))}),c.selectedElementIds=Object.entries(c.selectedElementIds).reduce((u,[h,p])=>(p&&!l.includes(h)&&(u[h]=!0),u),{}),{appState:{...t,...c},elements:s,captureUpdate:X.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[D.CTRL_OR_CMD]&&e.key===D.G.toUpperCase(),predicate:(e,t)=>Pr(t).length>0,PanelComponent:({elements:e,appState:t,updateData:n})=>f.jsx(Me,{type:"button",hidden:Pr(t).length===0,icon:f.jsx(_2,{theme:t.theme}),onClick:()=>n(null),title:`${I("labels.ungroup")} — ${V("CtrlOrCmd+Shift+G")}`,"aria-label":I("labels.ungroup"),visible:It(Ye(e),t)})}),qv=(e,t,n,a,i,r,s)=>{e.beginPath(),e.moveTo(t+r,n),e.lineTo(t+a-r,n),e.quadraticCurveTo(t+a,n,t+a,n+r),e.lineTo(t+a,n+i-r),e.quadraticCurveTo(t+a,n+i,t+a-r,n+i),e.lineTo(t+r,n+i),e.quadraticCurveTo(t,n+i,t,n+i-r),e.lineTo(t,n+r),e.quadraticCurveTo(t,n,t+r,n),e.closePath(),e.fill(),s&&(e.strokeStyle=s),e.stroke()};function iX(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);t=(t<<5)-t+a}return t}var kf=(e,t)=>`hsl(${Math.abs(iX((t==null?void 0:t.id)||e))%37*10}, 100%, 83%)`,rX=e=>{var n;let t=(n=e==null?void 0:e.trim())==null?void 0:n.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},sX=({context:e,renderConfig:t,appState:n,normalizedWidth:a,normalizedHeight:i})=>{for(let[r,s]of t.remotePointerViewportCoords){let{x:l,y:c}=s,d=n.collaborators.get(r);l-=n.offsetLeft,c-=n.offsetTop;let o=11,u=14,h=l<0||l>a-o||c<0||c>i-u;l=Math.max(l,0),l=Math.min(l,a-o),c=Math.max(c,0),c=Math.min(c,i-u);let p=kf(r,d);e.save(),e.strokeStyle=p,e.fillStyle=p;let U=t.remotePointerUserStates.get(r),m=h||U==="idle"||U==="away";m&&(e.globalAlpha=.3),t.remotePointerButton.get(r)==="down"&&(e.beginPath(),e.arc(l,c,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(l,c,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=p,e.stroke(),e.closePath());let g=n.theme===ke.DARK?"#2f6330":gk,b=d==null?void 0:d.isSpeaking;b&&(e.fillStyle=g,e.strokeStyle=g,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(l,c),e.lineTo(l+0,c+14),e.lineTo(l+4,c+9),e.lineTo(l+11,c+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=Tc,e.strokeStyle=Tc,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(l,c),e.lineTo(l+0,c+14),e.lineTo(l+4,c+9),e.lineTo(l+11,c+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=p,e.strokeStyle=p,e.lineWidth=2,e.lineJoin="round",e.beginPath(),m?(e.moveTo(l-1,c-1),e.lineTo(l-1,c+15),e.lineTo(l+5,c+10),e.lineTo(l+12,c+9),e.closePath(),e.fill()):(e.moveTo(l,c),e.lineTo(l+0,c+14),e.lineTo(l+4,c+9),e.lineTo(l+11,c+8),e.closePath(),e.fill(),e.stroke());let v=t.remotePointerUsernames.get(r)||"";if(!h&&v){e.font="600 12px sans-serif";let x=(b?l+0:l)+o/2,y=(b?c+0:c)+u+2,E=5,S=3,w=e.measureText(v),k=w.actualBoundingBoxDescent+w.actualBoundingBoxAscent,T=Math.max(k,12),_=x-1,j=y-1,A=w.width+2+E*2+2,R=T+2+S*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(_,j,A,R,8),e.fillStyle=p,e.fill(),e.strokeStyle=Tc,e.stroke(),b&&(e.beginPath(),e.roundRect(_-2,j-2,A+4,R+4,8),e.strokeStyle=g,e.stroke())):qv(e,_,j,A,R,8,Tc),e.fillStyle=mk,e.fillText(v,x+E+1,y+S+w.actualBoundingBoxAscent+Math.floor((T-k)/2)+2),b){e.fillStyle=g;let N=8,O=8,$=5;e.fillRect(_+A+O,j+(R/2-N/2),2,N),e.fillRect(_+A+O+$,j+(R/2-N*2/2),2,N*2),e.fillRect(_+A+O+$*2,j+(R/2-N/2),2,N)}}e.restore(),e.closePath()}},q6=({color:e,onClick:t,name:n,src:a,className:i})=>{let r=rX(n),[s,l]=M.useState(!1),c=!s&&a,d=c?void 0:{background:e};return f.jsx("div",{className:ne("Avatar",i),style:d,onClick:t,children:c?f.jsx("img",{className:"Avatar-img",src:a,alt:r,referrerPolicy:"no-referrer",onError:()=>l(!0)}):r})};Z({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,n)=>{var a;return!n.socketId||((a=t.userToFollow)==null?void 0:a.socketId)===n.socketId||n.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:X.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:n.socketId,username:n.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:X.EVENTUALLY}},PanelComponent:({updateData:e,data:t,appState:n})=>{let{socketId:a,collaborator:i,withName:r,isBeingFollowed:s}=t,l=kf(a,i),c=ne({"is-followed":s,"is-current-user":i.isCurrentUser===!0,"is-speaking":i.isSpeaking,"is-in-call":i.isInCall,"is-muted":i.isMuted}),d=i.isInCall?i.isSpeaking?f.jsxs("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:I("userList.hint.isSpeaking"),children:[f.jsx("div",{}),f.jsx("div",{}),f.jsx("div",{})]}):i.isMuted?f.jsx("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:I("userList.hint.micMuted"),children:rT}):f.jsx("div",{title:I("userList.hint.inCall"),children:iT}):null;return r?f.jsxs("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${c}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(i),children:[f.jsx(q6,{color:l,onClick:()=>{},name:i.username||"",src:i.avatarUrl,className:c}),f.jsx("div",{className:"UserList__collaborator-name",children:i.username}),f.jsxs("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[s&&f.jsx("div",{className:"UserList__collaborator-status-icon-is-followed",title:I("userList.hint.followStatus"),children:tp}),d]})]}):f.jsxs("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${c}`,children:[f.jsx(q6,{color:l,onClick:()=>{e(i)},name:i.username||"",src:i.avatarUrl,className:c}),d&&f.jsx("div",{className:"UserList__collaborator-status-icon",children:d})]})}});var lX=Z({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let r of r8)if(i.some(s=>s.type===r))return{captureUpdate:X.EVENTUALLY,appState:{...t,errorMessage:I(`errors.libraryElementTypeError.${r}`)}};return a.library.getLatestLibrary().then(r=>a.library.setLibrary([{id:Vn(),status:"unpublished",elements:i.map(ss),created:Date.now()},...r])).then(()=>({captureUpdate:X.EVENTUALLY,appState:{...t,toast:{message:I("toast.addedToLibrary")}}})).catch(r=>({captureUpdate:X.EVENTUALLY,appState:{...t,errorMessage:r.message}}))},label:"labels.addToLibrary"}),oX=(e,t,n,a)=>{let i=Ju(e,t),r=da(e);return i.flatMap(s=>{let l=cX(s,r,n);return s.map(c=>{let d=G(c,{x:c.x+l.x,y:c.y+l.y});return xn(c,a.getNonDeletedElementsMap(),{simultaneouslyUpdated:s}),d})})},cX=(e,t,{axis:n,position:a})=>{let i=da(e),[r,s]=n==="x"?["minX","maxX"]:["minY","maxY"],l={x:0,y:0};return a==="start"?{...l,[n]:t[r]-i[r]}:a==="end"?{...l,[n]:t[s]-i[s]}:{...l,[n]:(t[r]+t[s])/2-(i[r]+i[s])/2}},_n=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(a=>de(a))},bl=(e,t,n,a)=>{let i=n.scene.getSelectedElements(t),r=ce(e),s=oX(i,r,a,n.scene),l=ce(s);return il(e.map(c=>l.get(c.id)||c),t,n)};Z({name:"alignTop",label:"labels.alignTop",icon:E2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>_n(t,a),perform:(e,t,n,a)=>({appState:t,elements:bl(e,t,a,{position:"start",axis:"y"}),captureUpdate:X.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx(Me,{hidden:!_n(t,a),type:"button",icon:E2,onClick:()=>n(null),title:`${I("labels.alignTop")} — ${V("CtrlOrCmd+Shift+Up")}`,"aria-label":I("labels.alignTop"),visible:It(Ye(e),t)})});Z({name:"alignBottom",label:"labels.alignBottom",icon:S2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>_n(t,a),perform:(e,t,n,a)=>({appState:t,elements:bl(e,t,a,{position:"end",axis:"y"}),captureUpdate:X.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx(Me,{hidden:!_n(t,a),type:"button",icon:S2,onClick:()=>n(null),title:`${I("labels.alignBottom")} — ${V("CtrlOrCmd+Shift+Down")}`,"aria-label":I("labels.alignBottom"),visible:It(Ye(e),t)})});Z({name:"alignLeft",label:"labels.alignLeft",icon:C2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>_n(t,a),perform:(e,t,n,a)=>({appState:t,elements:bl(e,t,a,{position:"start",axis:"x"}),captureUpdate:X.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx(Me,{hidden:!_n(t,a),type:"button",icon:C2,onClick:()=>n(null),title:`${I("labels.alignLeft")} — ${V("CtrlOrCmd+Shift+Left")}`,"aria-label":I("labels.alignLeft"),visible:It(Ye(e),t)})});Z({name:"alignRight",label:"labels.alignRight",icon:k2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>_n(t,a),perform:(e,t,n,a)=>({appState:t,elements:bl(e,t,a,{position:"end",axis:"x"}),captureUpdate:X.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx(Me,{hidden:!_n(t,a),type:"button",icon:k2,onClick:()=>n(null),title:`${I("labels.alignRight")} — ${V("CtrlOrCmd+Shift+Right")}`,"aria-label":I("labels.alignRight"),visible:It(Ye(e),t)})});Z({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:M2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>_n(t,a),perform:(e,t,n,a)=>({appState:t,elements:bl(e,t,a,{position:"center",axis:"y"}),captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx(Me,{hidden:!_n(t,a),type:"button",icon:M2,onClick:()=>n(null),title:I("labels.centerVertically"),"aria-label":I("labels.centerVertically"),visible:It(Ye(e),t)})});Z({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:I2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>_n(t,a),perform:(e,t,n,a)=>({appState:t,elements:bl(e,t,a,{position:"center",axis:"x"}),captureUpdate:X.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx(Me,{hidden:!_n(t,a),type:"button",icon:I2,onClick:()=>n(null),title:I("labels.centerHorizontally"),"aria-label":I("labels.centerHorizontally"),visible:It(Ye(e),t)})});var dX=(e,t,n)=>{let[a,i,r,s]=n.axis==="x"?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],l=da(e),c=Ju(e,t).map(h=>[h,da(h)]).sort((h,p)=>h[1][i]-p[1][i]),d=0;for(let h of c)d+=h[1][s];let o=(l[s]-d)/(c.length-1);if(o<0){let h=c.findIndex(g=>g[1][a]===l[a]),p=c.findIndex(g=>g[1][r]===l[r]),U=(c[p][1][i]-c[h][1][i])/(c.length-1),m=c[h][1][i];return c.flatMap(([g,b],v)=>{let x={x:0,y:0};return v!==h&&v!==p&&(m+=U,x[n.axis]=m-b[i]),g.map(y=>Ue(y,{x:y.x+x.x,y:y.y+x.y}))})}let u=l[a];return c.flatMap(([h,p])=>{let U={x:0,y:0};return U[n.axis]=u-p[a],u+=o,u+=p[s],h.map(m=>Ue(m,{x:m.x+U.x,y:m.y+U.y}))})},Jv=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(a=>de(a))},Qv=(e,t,n,a)=>{let i=n.scene.getSelectedElements(t),r=dX(i,n.scene.getNonDeletedElementsMap(),a),s=ce(r);return il(e.map(l=>s.get(l.id)||l),t,n)};Z({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,n,a)=>({appState:t,elements:Qv(e,t,a,{axis:"x"}),captureUpdate:X.IMMEDIATELY}),keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.H,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx(Me,{hidden:!Jv(t,a),type:"button",icon:oI,onClick:()=>n(null),title:`${I("labels.distributeHorizontally")} — ${V("Alt+H")}`,"aria-label":I("labels.distributeHorizontally"),visible:It(Ye(e),t)})});Z({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,n,a)=>({appState:t,elements:Qv(e,t,a,{axis:"y"}),captureUpdate:X.IMMEDIATELY}),keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.V,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>f.jsx(Me,{hidden:!Jv(t,a),type:"button",icon:cI,onClick:()=>n(null),title:`${I("labels.distributeVertically")} — ${V("Alt+V")}`,"aria-label":I("labels.distributeVertically"),visible:It(Ye(e),t)})});var uX=Z({name:"flipHorizontal",label:"labels.flipHorizontal",icon:cT,trackEvent:{category:"element"},perform:(e,t,n,a)=>({elements:il(ex(e,a.scene.getNonDeletedElementsMap(),t,"horizontal",a),t,a),appState:t,captureUpdate:X.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===Re.H}),fX=Z({name:"flipVertical",label:"labels.flipVertical",icon:oT,trackEvent:{category:"element"},perform:(e,t,n,a)=>({elements:il(ex(e,a.scene.getNonDeletedElementsMap(),t,"vertical",a),t,a),appState:t,captureUpdate:X.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===Re.V&&!e[D.CTRL_OR_CMD]}),ex=(e,t,n,a,i)=>{let r=ve(Ye(e),n,{includeBoundTextElement:!0,includeElementsInFrames:!0}),s=hX(r,t,n,a,i),l=ce(s);return e.map(c=>l.get(c.id)||c)},hX=(e,t,n,a,i)=>{if(e.every(p=>xe(p)&&(p.startBinding||p.endBinding)))return e.map(p=>{let U=p;return Ue(U,{startArrowhead:U.endArrowhead,endArrowhead:U.startArrowhead})});let{midX:r,midY:s}=da(e);V3(e,t,"nw",i.scene,new Map(Array.from(t.values()).map(p=>[p.id,ss(p)])),{flipByX:a==="horizontal",flipByY:a==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),eu(e.filter(fe),t,i.scene.getNonDeletedElements(),i.scene,_r(n),[],n.zoom);let{elbowArrows:l,otherElements:c}=e.reduce((p,U)=>ee(U)?{...p,elbowArrows:p.elbowArrows.concat(U)}:{...p,otherElements:p.otherElements.concat(U)},{elbowArrows:[],otherElements:[]}),{midX:d,midY:o}=da(e),[u,h]=[r-d,s-o];return c.forEach(p=>G(p,{x:p.x+u,y:p.y+h})),l.forEach(p=>G(p,{x:p.x+u,y:p.y+h})),e},kd=Z({name:"copy",label:"labels.copy",icon:S1,trackEvent:{category:"element"},perform:async(e,t,n,a)=>{let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await C3(i,a.files,n)}catch(r){return{captureUpdate:X.EVENTUALLY,appState:{...t,errorMessage:r.message}}}return{captureUpdate:X.EVENTUALLY}},keyTest:void 0}),J6=Z({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,n,a)=>{let i;try{i=await uN()}catch(r){return r.name==="AbortError"||r.name==="NotAllowedError"?!1:(console.error(`actionPaste ${r.name}: ${r.message}`),ko?{captureUpdate:X.EVENTUALLY,appState:{...t,errorMessage:I("hints.firefox_clipboard_write")}}:{captureUpdate:X.EVENTUALLY,appState:{...t,errorMessage:I("errors.asyncPasteFailedOnRead")}})}try{a.pasteFromClipboard(lN({types:i}))}catch(r){return console.error(r),{captureUpdate:X.EVENTUALLY,appState:{...t,errorMessage:I("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:X.EVENTUALLY}},keyTest:void 0}),Q6=Z({name:"cut",label:"labels.cut",icon:GI,trackEvent:{category:"element"},perform:(e,t,n,a)=>(kd.perform(e,t,n,a),Cv.perform(e,t,null,a)),keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.X}),e5=Z({name:"copyAsSvg",label:"labels.copyAsSvg",icon:dT,trackEvent:{category:"element"},perform:async(e,t,n,a)=>{if(!a.canvas)return{captureUpdate:X.EVENTUALLY};let{exportedElements:i,exportingFrame:r}=Sf(e,t,!0);try{await Cf("clipboard-svg",i,t,a.files,{...t,exportingFrame:r,name:a.getName()});let s=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:I("toast.copyToClipboardAsSvg",{exportSelection:s.length?I("toast.selection"):I("toast.canvas"),exportColorScheme:t.exportWithDarkMode?I("buttons.darkMode"):I("buttons.lightMode")})}},captureUpdate:X.EVENTUALLY}}catch(s){return console.error(s),{appState:{errorMessage:s.message},captureUpdate:X.EVENTUALLY}}},predicate:e=>jp&&e.length>0,keywords:["svg","clipboard","copy"]}),t5=Z({name:"copyAsPng",label:"labels.copyAsPng",icon:uT,trackEvent:{category:"element"},perform:async(e,t,n,a)=>{if(!a.canvas)return{captureUpdate:X.EVENTUALLY};let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:r,exportingFrame:s}=Sf(e,t,!0);try{return await Cf("clipboard",r,t,a.files,{...t,exportingFrame:s,name:a.getName()}),{appState:{...t,toast:{message:I("toast.copyToClipboardAsPng",{exportSelection:i.length?I("toast.selection"):I("toast.canvas"),exportColorScheme:t.exportWithDarkMode?I("buttons.darkMode"):I("buttons.lightMode")})}},captureUpdate:X.EVENTUALLY}}catch(l){return console.error(l),{appState:{...t,errorMessage:l.message},captureUpdate:X.EVENTUALLY}}},predicate:e=>Ap&&e.length>0,keyTest:e=>e.code===Re.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),n5=Z({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{pl(H7(i))}catch{throw new Error(I("errors.copyToSystemClipboardFailed"))}return{captureUpdate:X.EVENTUALLY}},predicate:(e,t,n,a)=>jp&&a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(q),keywords:["text","clipboard","copy"]}),a5=Z({name:"gridMode",icon:mT,keywords:["snap"],label:"labels.toggleGrid",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>e.gridModeEnabled},perform(e,t){return{appState:{...t,gridModeEnabled:!this.checked(t),objectsSnapModeEnabled:!1},captureUpdate:X.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[D.CTRL_OR_CMD]&&e.code===Re.QUOTE}),b0=Z({name:"zenMode",label:"buttons.zenMode",icon:hT,paletteName:"Toggle zen mode",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:X.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,n)=>typeof n.zenModeEnabled>"u",keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.Z}),pX=Z({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:fT,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:X.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,n)=>typeof n.objectsSnapModeEnabled>"u",keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.S}),v0=Z({name:"stats",label:"stats.fullTitle",icon:lT,paletteName:"Toggle stats",viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:X.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.SLASH}),UX=Z({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,n,a)=>a.scene.getSelectedElements(t).some(i=>Wn(i)),perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t),r=a.scene.getNonDeletedElementsMap();return i.forEach(s=>{var c;let l=ge(s,r);if(l){let{width:d,height:o}=an(l.originalText,Ve(l),l.lineHeight),u=XD(s.id);z7(s.id);let{x:h,y:p}=ef(s,l,r);G(l,{containerId:null,width:d,height:o,text:l.originalText,x:h,y:p}),G(s,{boundElements:(c=s.boundElements)==null?void 0:c.filter(U=>U.id!==l.id),height:u||s.height})}}),{elements:e,appState:t,captureUpdate:X.IMMEDIATELY}}}),mX=Z({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);if(i.length===2){let r=q(i[0])||q(i[1]),s;if(Dr(i[0])?s=i[0]:Dr(i[1])&&(s=i[1]),r&&s&&ge(s,a.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t),r,s;q(i[0])&&Dr(i[1])?(r=i[0],s=i[1]):(r=i[1],s=i[0]),G(r,{containerId:s.id,verticalAlign:Mn.MIDDLE,textAlign:Io.CENTER,autoResize:!0}),G(s,{boundElements:(s.boundElements||[]).concat({type:"text",id:r.id})});let l=s.height;return on(r,s,a.scene.getNonDeletedElementsMap()),nu(s.id,l),{elements:gX(e,s,r),appState:{...t,selectedElementIds:{[s.id]:!0}},captureUpdate:X.IMMEDIATELY}}}),gX=(e,t,n)=>{let a=e.slice(),i=a.findIndex(s=>s.id===n.id);a.splice(i,1);let r=a.findIndex(s=>s.id===t.id);return a.splice(r+1,0,n),Wa(a,ce([t,n])),a},bX=(e,t,n)=>{let a=e.slice(),i=a.findIndex(s=>s.id===t.id);a.splice(i,1);let r=a.findIndex(s=>s.id===n.id);return a.splice(r,0,t),Wa(a,ce([t,n])),a},vX=Z({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t),r=i.every(s=>q(s));return i.length>0&&r},perform:(e,t,n,a)=>{var l;let i=a.scene.getSelectedElements(t),r=e.slice(),s={};for(let c of i)if(q(c)){let d=Xa({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...c.boundElements||[],{id:c.id,type:"text"}],angle:c.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:fl("rectangle")?St.ADAPTIVE_RADIUS:St.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:c.x-Mt,y:c.y-Mt,width:Jr(c.width,"rectangle"),height:Jr(c.height,"rectangle"),groupIds:c.groupIds,frameId:c.frameId});if((l=c.boundElements)!=null&&l.length){let o=c.boundElements.filter(u=>u.type==="arrow").map(u=>u.id);r.filter(u=>o.includes(u.id)).forEach(u=>{let h=u.startBinding,p=u.endBinding;(h==null?void 0:h.elementId)===c.id&&(h={...h,elementId:d.id}),(p==null?void 0:p.elementId)===c.id&&(p={...p,elementId:d.id}),(h||p)&&G(u,{startBinding:h,endBinding:p},!1)})}G(c,{containerId:d.id,verticalAlign:Mn.MIDDLE,boundElements:null,textAlign:Io.CENTER,autoResize:!0},!1),on(c,d,a.scene.getNonDeletedElementsMap()),r=bX([...r,d],d,c),s[d.id]=!0}return{elements:r,appState:{...t,selectedElementIds:s},captureUpdate:X.IMMEDIATELY}}}),wU=380,xX=42,x0=5,tx=85,yX=500,y0=!1,Gc=new Map,wX=({element:e,elementsMap:t,setAppState:n,onLinkOpen:a,setToast:i,updateEmbedValidationStatus:r})=>{let s=gc(),l=mc(),c=Tt(),d=e.link||"",[o,u]=M.useState(d),h=M.useRef(null),p=s.showHyperlinkPopup==="editor",U=M.useCallback(()=>{var y;if(!h.current)return;let x=yn(h.current.value)||null;if(!e.link&&x&&Qe("hyperlink","create"),Un(e)){if(((y=s.activeEmbeddable)==null?void 0:y.element)===e&&n({activeEmbeddable:null}),!x){G(e,{link:null}),r(e,!1);return}if(!md(x,l.validateEmbeddable))x&&i({message:I("toast.unableToEmbed"),closable:!0}),e.link&&Gc.set(e.id,e.link),G(e,{link:x}),r(e,!1);else{let{width:E,height:S}=e,w=Rs(x);(w==null?void 0:w.error)instanceof URIError&&i({message:I("toast.unrecognizedLinkFormat"),closable:!0});let k=w?w.intrinsicSize.w/w.intrinsicSize.h:1,T=Gc.get(e.id)!==e.link;G(e,{...T?{width:(w==null?void 0:w.type)==="video"?E>S?E:S*k:E,height:(w==null?void 0:w.type)==="video"&&E>S?E/k:S}:{},link:x}),r(e,!0),Gc.has(e.id)&&Gc.delete(e.id)}}else G(e,{link:x})},[e,i,l.validateEmbeddable,s.activeEmbeddable,n,r]);M.useLayoutEffect(()=>()=>{U()},[U]),M.useEffect(()=>{p&&(h!=null&&h.current)&&!(c.viewport.isMobile||c.isTouchScreen)&&h.current.select()},[p,c.viewport.isMobile,c.isTouchScreen]),M.useEffect(()=>{let x=null,y=E=>{p||(x&&clearTimeout(x),CX(e,t,s,C(E.clientX,E.clientY))&&(x=window.setTimeout(()=>{n({showHyperlinkPopup:!1})},yX)))};return window.addEventListener("pointermove",y,!1),()=>{window.removeEventListener("pointermove",y,!1),x&&clearTimeout(x)}},[s,e,p,n,t]);let m=M.useCallback(()=>{Qe("hyperlink","delete"),G(e,{link:null}),n({showHyperlinkPopup:!1})},[n,e]),g=()=>{Qe("hyperlink","edit","popup-ui"),n({showHyperlinkPopup:"editor"})},{x:b,y:v}=nx(e,s,t);return s.contextMenu||s.selectedElementsAreBeingDragged||s.resizingElement||s.isRotating||s.openMenu||s.viewModeEnabled?null:f.jsxs("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${v}px`,left:`${b}px`,width:wU,padding:x0},children:[p?f.jsx("input",{className:ne("excalidraw-hyperlinkContainer-input"),placeholder:I("labels.link.hint"),ref:h,value:o,onChange:x=>u(x.target.value),autoFocus:!0,onKeyDown:x=>{x.stopPropagation(),x[D.CTRL_OR_CMD]&&x.key===D.K&&x.preventDefault(),(x.key===D.ENTER||x.key===D.ESCAPE)&&(U(),n({showHyperlinkPopup:"info"}))}}):e.link?f.jsx("a",{href:yn(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:X7(e.link)?"_self":"_blank",onClick:x=>{if(e.link&&a){let y=x8("excalidraw-link",x.nativeEvent);a({...e,link:yn(e.link)},y),y.defaultPrevented&&x.preventDefault()}},rel:"noopener noreferrer",children:e.link}):f.jsx("div",{className:"excalidraw-hyperlinkContainer-link",children:I("labels.link.empty")}),f.jsxs("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!p&&f.jsx(Me,{type:"button",title:I("buttons.edit"),"aria-label":I("buttons.edit"),label:I("buttons.edit"),onClick:g,className:"excalidraw-hyperlinkContainer--edit",icon:jo}),f.jsx(Me,{type:"button",title:I("labels.linkToElement"),"aria-label":I("labels.linkToElement"),label:I("labels.linkToElement"),onClick:()=>{n({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:Y8}),d&&!Un(e)&&f.jsx(Me,{type:"button",title:I("buttons.remove"),"aria-label":I("buttons.remove"),label:I("buttons.remove"),onClick:m,className:"excalidraw-hyperlinkContainer--remove",icon:Yr})]})]})},nx=(e,t,n)=>{let[a,i]=pe(e,n),{x:r,y:s}=Nn({sceneX:a+e.width/2,sceneY:i},t),l=r-t.offsetLeft-wU/2,c=s-t.offsetTop-tx;return{x:l,y:c}},i5=(e,t)=>{var a;let n=ve(e,t);return Un(n[0])?"labels.link.editEmbed":(a=n[0])!=null&&a.link?"labels.link.edit":"labels.link.create"},po=null,EX=(e,t,n)=>{po&&clearTimeout(po),po=window.setTimeout(()=>SX(e,t,n),Ek)},SX=(e,t,n)=>{if(!e.link)return;let a=fo();a.classList.add("excalidraw-tooltip--visible"),a.style.maxWidth="20rem",a.textContent=Os(e.link)?I("labels.link.goToElement"):e.link;let[i,r,s,l]=pe(e,n),[c,d,o,u]=vp([i,r,s,l],e.angle,t),h=Nn({sceneX:c,sceneY:d},t);Vv(a,{left:h.x,top:h.y,width:o,height:u},"top"),Qe("hyperlink","tooltip","link-icon"),y0=!0},r5=()=>{po&&clearTimeout(po),y0&&(y0=!1,fo().classList.remove("excalidraw-tooltip--visible"))},CX=(e,t,n,[a,i])=>{let{x:r,y:s}=Ze({clientX:a,clientY:i},n),l=15/n.zoom.value;if(ip(r,s,e,t))return!1;let[c,d,o]=pe(e,t);if(r>=c&&r<=o&&s>=d-tx&&s<=d)return!1;let{x:u,y:h}=nx(e,n,t);return!(a>=u-l&&a<=u+wU+x0*2+l&&i>=h-l&&i<=h+l+x0*2+xX)},ax=Z({name:"hyperlink",label:(e,t)=>i5(e,t),icon:M1,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:X.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.K,predicate:(e,t)=>ve(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=ve(e,t);return f.jsx(Me,{type:"button",icon:M1,"aria-label":I(i5(e,t)),title:`${Un(e[0])?I("labels.link.labelEmbed"):I("labels.link.label")} - ${V("CtrlOrCmd+K")}`,onClick:()=>n(null),selected:a.length===1&&!!a[0].link})}}),Fh=e=>e.every(t=>!t.locked),kX=Z({name:"toggleElementLock",label:(e,t,n)=>{let a=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return a.length===1&&!de(a[0])?a[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock":Fh(a)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll"},icon:(e,t)=>{let n=ve(t,e);return Fh(n)?q0:zu},trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return i.length>0&&!i.some(r=>r.locked&&r.frameId)},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!i.length)return!1;let r=Fh(i),s=ce(i);return{elements:e.map(l=>s.has(l.id)?Ue(l,{locked:r}):l),appState:{...t,selectedLinearElement:r?null:t.selectedLinearElement},captureUpdate:X.IMMEDIATELY}},keyTest:(e,t,n,a)=>e.key.toLocaleLowerCase()===D.L&&e[D.CTRL_OR_CMD]&&e.shiftKey&&a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),MX=Z({name:"unlockAllElements",paletteName:"Unlock all elements",trackEvent:{category:"canvas"},viewMode:!1,icon:zu,predicate:(e,t)=>ve(e,t).length===0&&e.some(n=>n.locked),perform:(e,t)=>{let n=e.filter(a=>a.locked);return{elements:e.map(a=>a.locked?Ue(a,{locked:!1}):a),appState:{...t,selectedElementIds:Object.fromEntries(n.map(a=>[a.id,!0]))},captureUpdate:X.IMMEDIATELY}},label:"labels.elementLock.unlockAll"}),IX=()=>{let[e,t]=M.useState(null),n=M.useCallback(a=>t(a),[]);return[e,n]},TX=e=>{let{closeOnClickOutside:t=!0}=e,n=Dv({className:"excalidraw-modal-container"}),a=M.useRef(document.body.classList.contains("excalidraw-animations-disabled"));if(!n)return null;let i=r=>{r.key===D.ESCAPE&&(r.nativeEvent.stopImmediatePropagation(),r.stopPropagation(),e.onCloseRequest())};return Xt.createPortal(f.jsxs("div",{className:ne("Modal",e.className,{"animations-disabled":a.current}),role:"dialog","aria-modal":"true",onKeyDown:i,"aria-labelledby":e.labelledBy,"data-prevent-outside-click":!0,children:[f.jsx("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),f.jsx("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),n)},ix=Bt(new Map),s5=async e=>await rf({elements:e,appState:{exportBackground:!1,viewBackgroundColor:we.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),_X=(e,t,n)=>{let[a,i]=M.useState();return M.useEffect(()=>{if(t)if(e){let r=n.get(e);r?i(r):(async()=>{var l;let s=await s5(t);(l=s.querySelector(".style-fonts"))==null||l.remove(),s&&(n.set(e,s),i(s))})()}else(async()=>{let r=await s5(t);i(r)})()},[e,t,n,i]),a},rx=()=>{let[e]=mt(ix);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:t=>{t.forEach(n=>e.delete(n))},svgCache:e}},jX=class{constructor(){L(this,"jobs",[]),L(this,"running",!1)}tick(){if(this.running)return;let e=this.jobs.shift();e?(this.running=!0,e.promise.resolve(Qi(e.jobFactory,...e.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(e,...t){let n=b8();return this.jobs.push({jobFactory:e,promise:n,args:t}),this.tick(),n}},AX=["excalidraw.com","raw.githubusercontent.com/excalidraw/excalidraw-libraries"],sx=new Ta,Wo=Bt({status:"loaded",isInitialized:!1,libraryItems:[]}),Ll=e=>ui(e),RX=(e,t)=>!e.find(n=>n.elements.length!==t.elements.length?!1:n.elements.every((a,i)=>a.id===t.elements[i].id&&a.versionNonce===t.elements[i].versionNonce)),lx=(e,t)=>{let n=[];for(let a of t)RX(e,a)&&n.push(a);return[...n,...e]},ox=(e,t)=>{let n=ce(t),a={deletedItems:new Map,addedItems:new Map};for(let r of e)n.has(r.id)||a.deletedItems.set(r.id,r);let i=ce(e);for(let r of t)i.has(r.id)||a.addedItems.set(r.id,r);return a},LX=class{constructor(e){L(this,"currLibraryItems",[]),L(this,"prevLibraryItems",Ll(this.currLibraryItems)),L(this,"app"),L(this,"updateQueue",[]),L(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]),L(this,"notifyListeners",()=>{var t,n;if(this.updateQueue.length>0)sa.set(Wo,a=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:a.isInitialized}));else{sa.set(Wo,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let a=this.prevLibraryItems;this.prevLibraryItems=Ll(this.currLibraryItems);let i=Ll(this.currLibraryItems);(n=(t=this.app.props).onLibraryChange)==null||n.call(t,i),sx.trigger(ox(a,i),i)}catch(a){console.error(a)}}}),L(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],sa.set(ix,new Map)}),L(this,"resetLibrary",()=>this.setLibrary([])),L(this,"getLatestLibrary",()=>new Promise(async t=>{try{let n=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(Ll(n))}catch{return t(this.currLibraryItems)}})),L(this,"updateLibrary",async({libraryItems:t,prompt:n=!1,merge:a=!1,openLibraryMenu:i=!1,defaultStatus:r="unpublished"})=>(i&&this.app.setState({openSidebar:{name:oa.name,tab:Fd}}),this.setLibrary(()=>new Promise(async(s,l)=>{try{let c=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),d;c instanceof Blob?d=await e4(c,r):d=oc(c,r),!n||window.confirm(I("alerts.confirmAddLibrary",{numShapes:d.length}))?(n&&this.app.focusContainer(),s(a?lx(this.currLibraryItems,d):d)):l(new Xu)}catch(c){l(c)}})))),L(this,"setLibrary",t=>{let n=new Promise(async(a,i)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=Ll(await t),a(this.currLibraryItems)}catch(r){i(r)}}).catch(a=>{if(a.name==="AbortError")return console.warn("Library update aborted by user"),this.currLibraryItems;throw a}).finally(()=>{this.updateQueue=this.updateQueue.filter(a=>a!==n),this.notifyListeners()});return this.updateQueue.push(n),this.notifyListeners(),n}),this.app=e}},DX=LX,cx=e=>{let t=Math.ceil(Math.sqrt(e.length)),n=[],a=h=>e.slice(h*t,h*t+t).reduce((p,U)=>{let{height:m}=da(U.elements);return Math.max(p,m)},0),i=h=>{let p=0,U=0,m=0;for(let g of e){if(p%t===0&&(U=0),U===h){let{width:b}=da(g.elements);m=Math.max(m,b)}p++,U++}return m},r=0,s=0,l=0,c=0,d=0,o=0,u=0;for(let h of e){d&&d%t===0&&(s+=l+50,r=0,o=0,u++),o===0&&(l=a(u)),c=i(o);let{minX:p,minY:U,width:m,height:g}=da(h.elements),b=(c-m)/2,v=(l-g)/2;n.push(...h.elements.map(x=>({...x,x:x.x+r+b-p,y:x.y+s+v-U}))),r+=c+50,d++,o++}return n},PX=(e,t=AX)=>{if(typeof t=="function"?t(e):t.some(n=>{let a=new URL(`https://${n.replace(/^https?:\/\//,"")}`),{hostname:i,pathname:r}=new URL(e);return new RegExp(`(^|\\.)${a.hostname}$`).test(i)&&new RegExp(`^${a.pathname.replace(/\/+$/,"")}(/+|$)`).test(r)}))return!0;throw new Error(`Invalid or disallowed library URL: "${e}"`)},w0=()=>{let e=new URLSearchParams(window.location.hash.slice(1)).get(v1.addLibrary)||new URLSearchParams(window.location.search).get(b1.addLibrary),t=e?new URLSearchParams(window.location.hash.slice(1)).get("token"):null;return e?{libraryUrl:e,idToken:t}:null},ql=class E0{constructor(t){L(this,"adapter"),this.adapter=t}static async getLibraryItems(t,n,a=!0){let i=()=>new Promise(async(r,s)=>{try{let l=await t.load({source:n});r(oc((l==null?void 0:l.libraryItems)||[],"published"))}catch(l){s(l)}});return a?E0.queue.push(i):i()}getLibraryItems(t){return E0.getLibraryItems(this.adapter,t,!1)}};L(ql,"queue",new jX),L(ql,"run",async(e,t)=>{let n=new ql(e);return ql.queue.push(()=>t(n))});var Md=ql,Uo=0,yu=0,wu=e=>Wp(e.map(t=>`${t.id}:${G3(t.elements)}`).sort().join()),l5=async(e,t)=>{try{return yu++,await Md.run(e,async n=>{let a=ce(await n.getLibraryItems("save"));for(let[l]of t.deletedItems)a.delete(l);let i=[];for(let[l,c]of t.addedItems)a.has(l)?a.set(l,c):i.push(c);let r=i.concat(Array.from(a.values())),s=wu(r);return s!==Uo&&await e.save({libraryItems:r}),Uo=s,r})}finally{yu--}},NX=e=>{let{excalidrawAPI:t}=e,n=M.useRef(e);n.current=e;let a=M.useRef(!1);M.useEffect(()=>{if(!t)return;a.current=!1;let i=async({libraryUrl:l,idToken:c})=>{let d=new Promise(async(u,h)=>{try{l=decodeURIComponent(l),l=hp(l),PX(l,n.current.validateLibraryUrl);let p=await(await fetch(l)).blob();u(p)}catch(p){h(p)}}),o=c!==t.id;await(o&&document.hidden?new Promise(u=>{window.addEventListener("focus",()=>u(),{once:!0})}):null);try{await t.updateLibrary({libraryItems:d,prompt:o,merge:!0,defaultStatus:"published",openLibraryMenu:!0})}catch(u){throw t.updateScene({appState:{errorMessage:u.message}}),u}finally{if(window.location.hash.includes(v1.addLibrary)){let u=new URLSearchParams(window.location.hash.slice(1));u.delete(v1.addLibrary),window.history.replaceState({},g1,`#${u.toString()}`)}else if(window.location.search.includes(b1.addLibrary)){let u=new URLSearchParams(window.location.search);u.delete(b1.addLibrary),window.history.replaceState({},g1,`?${u.toString()}`)}}},r=l=>{l.preventDefault();let c=w0();c&&(l.stopImmediatePropagation(),window.history.replaceState({},"",l.oldURL),i(c))},s=w0();if(s&&i(s),"getInitialLibraryItems"in n.current&&n.current.getInitialLibraryItems&&(console.warn("useHandleLibrar `opts.getInitialLibraryItems` is deprecated. Use `opts.adapter` instead."),Promise.resolve(n.current.getInitialLibraryItems()).then(l=>{t.updateLibrary({libraryItems:l,merge:!0})}).catch(l=>{console.error(`UseHandeLibrary getInitialLibraryItems failed: ${l==null?void 0:l.message}`)})),"adapter"in n.current&&n.current.adapter){let l=n.current.adapter,c=n.current.migrationAdapter,d=b8();c?d.resolve(Qi(c.load).then(async o=>{let u=null;try{if(!o)return Md.getLibraryItems(l,"load");u=oc(o.libraryItems||[],"published");let h=await l5(l,ox([],u));try{await c.clear()}catch(p){console.error(`couldn't delete legacy library data: ${p.message}`)}return h}catch(h){return console.error(`couldn't migrate legacy library data: ${h.message}`),u}}).catch(o=>(console.error(`error during library migration: ${o.message}`),Md.getLibraryItems(l,"load")))):d.resolve(Qi(Md.getLibraryItems,l,"load")),t.updateLibrary({libraryItems:d.then(o=>{let u=o||[];return Uo=wu(u),u}),merge:!0}).finally(()=>{a.current=!0})}return window.addEventListener("hashchange",r),()=>{window.removeEventListener("hashchange",r)}},[t]),M.useEffect(()=>{let i=sx.on(async(s,l)=>{let c=a.current,d="adapter"in n.current&&n.current.adapter||null;try{d&&Uo!==wu(l)&&await l5(d,s)}catch(o){console.error(`couldn't persist library update: ${o.message}`,s),c&&n.current.excalidrawAPI&&n.current.excalidrawAPI.updateScene({appState:{errorMessage:I("errors.saveLibraryError")}})}}),r=s=>{yu&&iM(s)};return window.addEventListener("beforeunload",r),()=>{window.removeEventListener("beforeunload",r),i(),Uo=0,yu=0}},[])},OX=M.forwardRef(({children:e,gap:t,align:n,justifyContent:a,className:i,style:r},s)=>f.jsx("div",{className:ne("Stack Stack_horizontal",i),style:{"--gap":t,alignItems:n,justifyContent:a,...r},ref:s,children:e})),$X=M.forwardRef(({children:e,gap:t,align:n,justifyContent:a,className:i,style:r},s)=>f.jsx("div",{className:ne("Stack Stack_vertical",i),style:{"--gap":t,justifyItems:n,justifyContent:a,...r},ref:s,children:e})),On={Row:OX,Col:$X},FX=({theme:e,id:t,libraryReturnUrl:n})=>{let a=n||window.location.origin+window.location.pathname;return f.jsx("a",{className:"library-menu-browse-button",href:`${be.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${a}&useHash=true&token=${t}&theme=${e}&version=${Nu.excalidrawLibrary}`,target:"_excalidraw_libraries",children:I("labels.libraries")})},zX=FX,dx=({libraryReturnUrl:e,theme:t,id:n,style:a,children:i,className:r})=>f.jsxs("div",{className:ne("library-menu-control-buttons",r),style:a,children:[f.jsx(zX,{id:n,libraryReturnUrl:e,theme:t}),i]}),BX=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,HX=/{{([\w-]+)}}/,XX=/<([\w-]+)>/,WX=/<\/([\w-]+)>/,VX=(e,t)=>{let n=[{name:"",children:[]}];return e.split(BX).filter(Boolean).forEach(a=>{let i=a.match(XX),r=a.match(WX),s=a.match(HX);if(i!==null){let l=i[1];t.hasOwnProperty(l)?n.push({name:l,children:[]}):console.warn(`Trans: missed to pass in prop ${l} for interpolating ${e}`)}else if(r!==null)if(r[1]===n[n.length-1].name){let l=n.pop(),c=M.createElement(M.Fragment,{},...l.children),d=t[l.name];typeof d=="function"&&n[n.length-1].children.push(d(c))}else console.warn(`Trans: unexpected end tag ${a} for interpolating ${e}`);else if(s!==null){let l=s[1];t.hasOwnProperty(l)?n[n.length-1].children.push(t[l]):console.warn(`Trans: key ${l} not in props for interpolating ${e}`)}else n[n.length-1].children.push(a)}),n.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),n[0].children},GX=({i18nKey:e,children:t,...n})=>{let{t:a}=Gt();return M.createElement(M.Fragment,{},...VX(a(e),n))},Na=GX,YX=({label:e,onClick:t,className:n,children:a,actionType:i,type:r="button",isLoading:s,...l})=>{let c=i?`Dialog__action-button--${i}`:"";return f.jsxs("button",{className:ne("Dialog__action-button",c,n),type:r,"aria-label":e,onClick:t,...l,children:[a&&f.jsx("div",{style:s?{visibility:"hidden"}:{},children:a}),f.jsx("div",{style:s?{visibility:"hidden"}:{},children:e}),s&&f.jsx("div",{style:{position:"absolute",inset:0},children:f.jsx(Ei,{})})]})},ll=YX,ZX=e=>{let{onConfirm:t,onCancel:n,children:a,confirmText:i=I("buttons.confirm"),cancelText:r=I("buttons.cancel"),className:s="",...l}=e,c=_t(),d=gf(EU),{container:o}=qa();return f.jsxs(ba,{onCloseRequest:n,size:"small",...l,className:`confirm-dialog ${s}`,children:[a,f.jsxs("div",{className:"confirm-dialog-buttons",children:[f.jsx(ll,{label:r,onClick:()=>{c({openMenu:null}),d(!1),Xt.flushSync(()=>{n()}),o==null||o.focus()}}),f.jsx(ll,{label:i,onClick:()=>{c({openMenu:null}),d(!1),Xt.flushSync(()=>{t()}),o==null||o.focus()},actionType:"danger"})]})]})},ux=ZX,$r=class{static has(e){try{return!!window.localStorage.getItem(e)}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),!1}}static get(e){try{let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),null}}};L($r,"set",(e,t)=>{try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){return console.warn(`localStorage.setItem error: ${n.message}`),!1}}),L($r,"delete",e=>{try{window.localStorage.removeItem(e)}catch(t){console.warn(`localStorage.removeItem error: ${t.message}`)}});var KX=async e=>{let t=Math.round(8),n=Math.max(Math.round(128/64),2),a=Jk(e,6),i=document.createElement("canvas");i.width=a[0].length*128+(a[0].length+1)*(t*2)-t*2,i.height=a.length*128+(a.length+1)*(t*2)-t*2;let r=i.getContext("2d");r.fillStyle=Ft.white,r.fillRect(0,0,i.width,i.height);for(let[s,l]of e.entries()){let c=await cc({elements:l.elements,files:null,maxWidthOrHeight:128}),{width:d,height:o}=c,u=Math.floor(s/6)*(128+t*2),h=s%6*(128+t*2);r.drawImage(c,h+(128-d)/2+t,u+(128-o)/2+t),r.lineWidth=n,r.strokeStyle=Ft.gray[4],r.strokeRect(h+t/2,u+t/2,128+t,128+t)}return await K1(new File([await zo(i)],"preview",{type:ae.png}),{outputType:ae.jpg,maxWidthOrHeight:5e3})},qX=({libItem:e,appState:t,index:n,onChange:a,onRemove:i})=>{let r=M.useRef(null),s=M.useRef(null);return M.useEffect(()=>{let l=r.current;l&&(async()=>{let c=await rf({elements:e.elements,appState:{...t,viewBackgroundColor:Ft.white,exportBackground:!0},files:null,skipInliningFonts:!0});l.innerHTML=c.outerHTML})()},[e.elements,t]),f.jsxs("div",{className:"single-library-item",children:[e.status==="published"&&f.jsx("span",{className:"single-library-item-status",children:I("labels.statusPublished")}),f.jsx("div",{ref:r,className:"single-library-item__svg"}),f.jsx(Me,{"aria-label":I("buttons.remove"),type:"button",icon:hl,className:"single-library-item--remove",onClick:i.bind(null,e.id),title:I("buttons.remove")}),f.jsxs("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[f.jsxs("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[f.jsxs("div",{style:{padding:"0.5em 0"},children:[f.jsx("span",{style:{fontWeight:500,color:Ft.gray[6]},children:I("publishDialog.itemName")}),f.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),f.jsx("input",{type:"text",ref:s,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:l=>{a(l.target.value,n)}})]}),f.jsx("span",{className:"error",children:e.error})]})]})},JX=({onClose:e,libraryItems:t,appState:n,onSuccess:a,onError:i,updateItemsInStorage:r,onRemove:s})=>{let[l,c]=M.useState({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[d,o]=M.useState(!1);M.useEffect(()=>{let x=$r.get(no.PUBLISH_LIBRARY);x&&c(x)},[]);let[u,h]=M.useState(t.slice());M.useEffect(()=>{h(t.slice())},[t]);let p=x=>{c({...l,[x.target.name]:x.target.value})},U=async x=>{x.preventDefault(),o(!0);let y=[],E=!1;if(u.forEach(j=>{let A="";j.name||(A=I("publishDialog.errors.required"),E=!0),y.push({...j,error:A})}),E){h(y),o(!1);return}let S=await KX(u),w={type:Fn.excalidrawLibrary,version:Nu.excalidrawLibrary,source:O0,libraryItems:u},k=JSON.stringify(w,null,2),T=new Blob([k],{type:"application/json"}),_=new FormData;_.append("excalidrawLib",T),_.append("previewImage",S),_.append("previewImageType",S.type),_.append("title",l.name),_.append("authorName",l.authorName),_.append("githubHandle",l.githubHandle),_.append("name",l.name),_.append("description",l.description),_.append("twitterHandle",l.twitterHandle),_.append("website",l.website),fetch(`${be.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:_}).then(j=>j.ok?j.json().then(({url:A})=>{$r.delete(no.PUBLISH_LIBRARY),a({url:A,authorName:l.authorName,items:u})}):j.json().catch(()=>{throw new Error(j.statusText||"something went wrong")}).then(A=>{throw new Error(A.message||j.statusText||"something went wrong")}),j=>{console.error(j),i(j),o(!1)}).catch(j=>{console.error(j),i(j),o(!1)})},m=()=>{let x=[];return u.forEach((y,E)=>{x.push(f.jsx("div",{className:"single-library-item-wrapper",children:f.jsx(qX,{libItem:y,appState:n,index:E,onChange:(S,w)=>{let k=u.slice();k[w].name=S,h(k)},onRemove:s})},E))}),f.jsx("div",{className:"selected-library-items",children:x})},g=M.useCallback(()=>{r(u),$r.set(no.PUBLISH_LIBRARY,l),e()},[u,e,r,l]),b=!!t.length,v=t.some(x=>x.status==="published");return f.jsx(ba,{onCloseRequest:g,title:I("publishDialog.title"),className:"publish-library",children:b?f.jsxs("form",{onSubmit:U,children:[f.jsx("div",{className:"publish-library-note",children:f.jsx(Na,{i18nKey:"publishDialog.noteDescription",link:x=>f.jsx("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:x})})}),f.jsx("span",{className:"publish-library-note",children:f.jsx(Na,{i18nKey:"publishDialog.noteGuidelines",link:x=>f.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:x})})}),f.jsx("div",{className:"publish-library-note",children:I("publishDialog.noteItems")}),v&&f.jsx("span",{className:"publish-library-note publish-library-warning",children:I("publishDialog.republishWarning")}),m(),f.jsxs("div",{className:"publish-library__fields",children:[f.jsxs("label",{children:[f.jsxs("div",{children:[f.jsx("span",{children:I("publishDialog.libraryName")}),f.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),f.jsx("input",{type:"text",name:"name",required:!0,value:l.name,onChange:p,placeholder:I("publishDialog.placeholder.libraryName")})]}),f.jsxs("label",{style:{alignItems:"flex-start"},children:[f.jsxs("div",{children:[f.jsx("span",{children:I("publishDialog.libraryDesc")}),f.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),f.jsx("textarea",{name:"description",rows:4,required:!0,value:l.description,onChange:p,placeholder:I("publishDialog.placeholder.libraryDesc")})]}),f.jsxs("label",{children:[f.jsxs("div",{children:[f.jsx("span",{children:I("publishDialog.authorName")}),f.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),f.jsx("input",{type:"text",name:"authorName",required:!0,value:l.authorName,onChange:p,placeholder:I("publishDialog.placeholder.authorName")})]}),f.jsxs("label",{children:[f.jsx("span",{children:I("publishDialog.githubUsername")}),f.jsx("input",{type:"text",name:"githubHandle",value:l.githubHandle,onChange:p,placeholder:I("publishDialog.placeholder.githubHandle")})]}),f.jsxs("label",{children:[f.jsx("span",{children:I("publishDialog.twitterUsername")}),f.jsx("input",{type:"text",name:"twitterHandle",value:l.twitterHandle,onChange:p,placeholder:I("publishDialog.placeholder.twitterHandle")})]}),f.jsxs("label",{children:[f.jsx("span",{children:I("publishDialog.website")}),f.jsx("input",{type:"text",name:"website",pattern:"https?://.+",title:I("publishDialog.errors.website"),value:l.website,onChange:p,placeholder:I("publishDialog.placeholder.website")})]}),f.jsx("span",{className:"publish-library-note",children:f.jsx(Na,{i18nKey:"publishDialog.noteLicense",link:x=>f.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:x})})})]}),f.jsxs("div",{className:"publish-library__buttons",children:[f.jsx(ll,{label:I("buttons.cancel"),onClick:g,"data-testid":"cancel-clear-canvas-button"}),f.jsx(ll,{type:"submit",label:I("buttons.submit"),actionType:"primary",isLoading:d})]})]}):f.jsx("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:I("publishDialog.atleastOneLibItem")})})},QX=JX,fx=({className:e="",children:t,onToggle:n,title:a,...i})=>{let r=Tt(),s=ne(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":r.editor.isMobile}).trim();return f.jsx("button",{"data-prevent-outside-click":!0,className:s,onClick:n,type:"button","data-testid":"dropdown-menu-button",title:a,...i,children:t})},eW=fx;fx.displayName="DropdownMenuTrigger";var hx=()=>f.jsx("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:".5rem 0"}}),tW=hx;hx.displayName="DropdownMenuSeparator";var px=({children:e,onClickOutside:t,className:n="",onSelect:a,style:i})=>{let r=Tt(),s=M.useRef(null),l=xf({onClickOutside:t});UU(s,()=>{var d;(d=l.onClickOutside)==null||d.call(l)}),M.useEffect(()=>{let d=u=>{var h;u.key===D.ESCAPE&&(u.stopImmediatePropagation(),(h=l.onClickOutside)==null||h.call(l))},o={capture:!0};return document.addEventListener("keydown",d,o),()=>{document.removeEventListener("keydown",d,o)}},[l]);let c=ne(`dropdown-menu ${n}`,{"dropdown-menu--mobile":r.editor.isMobile}).trim();return f.jsx(Fv.Provider,{value:{onSelect:a},children:f.jsx("div",{ref:s,className:c,style:i,"data-testid":"dropdown-menu",children:r.editor.isMobile?f.jsx(On.Col,{className:"dropdown-menu-container",children:e}):f.jsx(ua,{className:"dropdown-menu-container",padding:2,style:{zIndex:2},children:e})})})};px.displayName="DropdownMenuContent";var nW=px,Ux=({icon:e,shortcut:t,href:n,children:a,onSelect:i,className:r="",selected:s,rel:l="noreferrer",...c})=>{let d=Bv(c.onClick,i);return f.jsx("a",{...c,href:n,target:"_blank",rel:"noreferrer",className:zv(r,s),title:c.title??c["aria-label"],onClick:d,children:f.jsx(Hv,{icon:e,shortcut:t,children:a})})},Id=Ux;Ux.displayName="DropdownMenuItemLink";var aW=({children:e,className:t="",selected:n,...a})=>f.jsx("div",{...a,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${n?"dropdown-menu-item--selected":""}`.trim(),children:e}),iW=aW,rW=e=>M.Children.toArray(e).find(n=>M.isValidElement(n)&&typeof n.type!="string"&&(n==null?void 0:n.type.displayName)&&n.type.displayName==="DropdownMenuTrigger")||null,sW=e=>M.Children.toArray(e).find(n=>M.isValidElement(n)&&typeof n.type!="string"&&(n==null?void 0:n.type.displayName)&&n.type.displayName==="DropdownMenuContent")||null,Mi=({children:e,open:t})=>{let n=rW(e),a=sW(e);return f.jsxs(f.Fragment,{children:[n,t&&a]})};Mi.Trigger=eW;Mi.Content=nW;Mi.Item=Gn;Mi.ItemLink=Id;Mi.ItemCustom=iW;Mi.Group=m0;Mi.Separator=tW;var et=Mi;Mi.displayName="DropdownMenu";var lW=(e,t)=>e.filter(n=>t.includes(n.id)),oW=({setAppState:e,selectedItems:t,library:n,onRemoveFromLibrary:a,resetLibrary:i,onSelectItems:r,appState:s,className:l})=>{let[c]=mt(Wo),[d,o]=mt(EU),u=()=>{let _=t.length?I("alerts.removeItemsFromsLibrary",{count:t.length}):I("alerts.resetLibrary"),j=t.length?I("confirmDialog.removeItemsFromLib"):I("confirmDialog.resetLibrary");return f.jsx(ux,{onConfirm:()=>{t.length?a():i(),p(!1)},onCancel:()=>{p(!1)},title:j,children:f.jsx("p",{children:_})})},[h,p]=M.useState(!1),U=!!t.length,m=U?c.libraryItems.filter(_=>t.includes(_.id)):c.libraryItems,g=I(U?"buttons.remove":"buttons.resetLibrary"),[b,v]=M.useState(!1),[x,y]=M.useState(null),E=M.useCallback(()=>f.jsxs(ba,{onCloseRequest:()=>y(null),title:I("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[f.jsx("p",{children:f.jsx(Na,{i18nKey:"publishSuccessDialog.content",authorName:x.authorName,link:_=>f.jsx("a",{href:x==null?void 0:x.url,target:"_blank",rel:"noopener noreferrer",children:_})})}),f.jsx(Me,{type:"button",title:I("buttons.close"),"aria-label":I("buttons.close"),label:I("buttons.close"),onClick:()=>y(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[y,x]),S=(_,j)=>{v(!1),y({url:_.url,authorName:_.authorName});let A=j.slice();A.forEach(R=>{t.includes(R.id)&&(R.status="published")}),n.setLibrary(A)},w=async()=>{try{await n.updateLibrary({libraryItems:gp({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(_){if((_==null?void 0:_.name)==="AbortError"){console.warn(_);return}e({errorMessage:I("errors.importLibraryError")})}},k=async()=>{let _=U?m:await n.getLatestLibrary();SP(_).catch(m8).catch(j=>{e({errorMessage:j.message})})},T=()=>f.jsxs(et,{open:d,children:[f.jsx(et.Trigger,{onToggle:()=>o(!d),children:DM}),f.jsxs(et.Content,{onClickOutside:()=>o(!1),onSelect:()=>o(!1),className:"library-menu",children:[!U&&f.jsx(et.Item,{onSelect:w,icon:Q0,"data-testid":"lib-dropdown--load",children:I("buttons.load")}),!!m.length&&f.jsx(et.Item,{onSelect:k,icon:Bu,"data-testid":"lib-dropdown--export",children:I("buttons.export")}),!!m.length&&f.jsx(et.Item,{onSelect:()=>p(!0),icon:Yr,children:g}),U&&f.jsx(et.Item,{icon:VI,onSelect:()=>v(!0),"data-testid":"lib-dropdown--remove",children:I("buttons.publishLibrary")})]})]});return f.jsxs("div",{className:ne("library-menu-dropdown-container",l),children:[T(),t.length>0&&f.jsx("div",{className:"library-actions-counter",children:t.length}),h&&u(),b&&f.jsx(QX,{onClose:()=>v(!1),libraryItems:lW(c.libraryItems,t),appState:s,onSuccess:_=>S(_,c.libraryItems),onError:_=>window.alert(_),updateItemsInStorage:()=>n.setLibrary(c.libraryItems),onRemove:_=>r(t.filter(j=>j!==_))}),x&&E()]})},o5=({selectedItems:e,onSelectItems:t,className:n})=>{let{library:a}=va(),{clearLibraryCache:i,deleteItemsFromLibraryCache:r}=rx(),s=Yt(),l=_t(),[c]=mt(Wo),d=async o=>{let u=o.filter(h=>!e.includes(h.id));a.setLibrary(u).catch(()=>{l({errorMessage:I("alerts.errorRemovingFromLibrary")})}),r(e),t([])};return f.jsx(oW,{appState:s,setAppState:l,selectedItems:e,onSelectItems:t,library:a,onRemoveFromLibrary:()=>d(c.libraryItems),resetLibrary:()=>{a.resetLibrary(),i()},className:n})},cW=M.memo(({id:e,elements:t,isPending:n,onClick:a,selected:i,onToggle:r,onDrag:s,svgCache:l})=>{let c=M.useRef(null),d=_X(e,t,l);M.useEffect(()=>{let U=c.current;if(U)return d&&(U.innerHTML=d.outerHTML),()=>{U.innerHTML=""}},[d]);let[o,u]=M.useState(!1),h=Tt().editor.isMobile,p=n&&f.jsx("div",{className:"library-unit__adder",children:LM});return f.jsxs("div",{className:ne("library-unit",{"library-unit__active":t,"library-unit--hover":t&&o,"library-unit--selected":i,"library-unit--skeleton":!d}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[f.jsx("div",{className:ne("library-unit__dragger",{"library-unit__pulse":!!n}),ref:c,draggable:!!t,onClick:t||n?U=>{e&&U.shiftKey?r(e,U):a(e)}:void 0,onDragStart:U=>{if(!e){U.preventDefault();return}u(!1),s(e,U)}}),p,e&&t&&(o||h||i)&&f.jsx(xU,{checked:i,onChange:(U,m)=>r(e,m),className:"library-unit__checkbox"})]})}),dW=()=>f.jsx("div",{className:"library-unit library-unit--skeleton"});function uW(){return[!1,M.useCallback(e=>e(),[])]}var fW=M.useTransition||uW,c5=({children:e})=>f.jsx("div",{className:"library-menu-items-container__grid",children:e}),zh=M.memo(({items:e,onItemSelectToggle:t,onItemDrag:n,isItemSelected:a,onClick:i,svgCache:r,itemsRenderedPerBatch:s})=>{let[,l]=fW(),[c,d]=M.useState(0);return M.useEffect(()=>{c<e.length&&l(()=>{d(c+s)})},[c,e.length,l,s]),f.jsx(f.Fragment,{children:e.map((o,u)=>u<c?f.jsx(cW,{elements:o==null?void 0:o.elements,isPending:!(o!=null&&o.id)&&!!(o!=null&&o.elements),onClick:i,svgCache:r,id:o==null?void 0:o.id,selected:a(o.id),onToggle:t,onDrag:n},(o==null?void 0:o.id)??u):f.jsx(dW,{},u))})}),hW=Bt(0),pW=e=>{let[t,n]=mt(hW);return M.useEffect(()=>{let{current:a}=e;if(!a)return;let i=Ko(()=>{let{scrollTop:r}=a;n(r)},200);return a.addEventListener("scroll",i),()=>{i.cancel(),a.removeEventListener("scroll",i)}},[e,n]),t},UW=17,mW=64;function gW({isLoading:e,libraryItems:t,onAddToLibrary:n,onInsertLibraryItems:a,pendingElements:i,theme:r,id:s,libraryReturnUrl:l,onSelectItems:c,selectedItems:d}){let o=M.useRef(null),u=pW(o);M.useEffect(()=>{var _;u>0&&((_=o.current)==null||_.scrollTo(0,u))},[]);let{svgCache:h}=rx(),p=M.useMemo(()=>t.filter(_=>_.status!=="published"),[t]),U=M.useMemo(()=>t.filter(_=>_.status==="published"),[t]),m=!t.length&&!i.length,g=!i.length&&!p.length&&!U.length,[b,v]=M.useState(null),x=M.useCallback((_,j)=>{let A=!d.includes(_),R=[...p,...U];if(A){if(j.shiftKey&&b){let N=R.findIndex(W=>W.id===b),O=R.findIndex(W=>W.id===_);if(N===-1||O===-1){c([...d,_]);return}let $=ce(d),P=R.reduce((W,F,Y)=>((Y>=N&&Y<=O||$.has(F.id))&&W.push(F.id),W),[]);c(P)}else c([...d,_]);v(_)}else v(null),c(d.filter(N=>N!==_))},[b,c,U,d,p]),y=M.useCallback(_=>{let j;return d.includes(_)?j=t.filter(A=>d.includes(A.id)):j=t.filter(A=>A.id===_),j.map(A=>({...A,elements:Q7(A.elements,{randomizeSeed:!0})}))},[t,d]),E=M.useCallback((_,j)=>{j.dataTransfer.setData(ae.excalidrawlib,bp(y(_)))},[y]),S=M.useCallback(_=>_?d.includes(_):!1,[d]),w=M.useCallback(()=>{n(i)},[i,n]),k=M.useCallback(_=>{_&&a(y(_))},[y,a]),T=h.size>=t.length?mW:UW;return f.jsxs("div",{className:"library-menu-items-container",style:i.length||p.length||U.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[!g&&f.jsx(o5,{selectedItems:d,onSelectItems:c,className:"library-menu-dropdown-container--in-heading"}),f.jsxs(On.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:U.length>0?1:"0 1 auto",marginBottom:0},ref:o,children:[f.jsxs(f.Fragment,{children:[!g&&f.jsx("div",{className:"library-menu-items-container__header",children:I("labels.personalLib")}),e&&f.jsx("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:f.jsx(Ei,{})}),!i.length&&!p.length?f.jsxs("div",{className:"library-menu-items__no-items",children:[f.jsx("div",{className:"library-menu-items__no-items__label",children:I("library.noItems")}),f.jsx("div",{className:"library-menu-items__no-items__hint",children:U.length>0?I("library.hint_emptyPrivateLibrary"):I("library.hint_emptyLibrary")})]}):f.jsxs(c5,{children:[i.length>0&&f.jsx(zh,{itemsRenderedPerBatch:T,items:[{id:null,elements:i}],onItemSelectToggle:x,onItemDrag:E,onClick:w,isItemSelected:S,svgCache:h}),f.jsx(zh,{itemsRenderedPerBatch:T,items:p,onItemSelectToggle:x,onItemDrag:E,onClick:k,isItemSelected:S,svgCache:h})]})]}),f.jsxs(f.Fragment,{children:[(U.length>0||i.length>0||p.length>0)&&f.jsx("div",{className:"library-menu-items-container__header library-menu-items-container__header--excal",children:I("labels.excalidrawLib")}),U.length>0?f.jsx(c5,{children:f.jsx(zh,{itemsRenderedPerBatch:T,items:U,onItemSelectToggle:x,onItemDrag:E,onClick:k,isItemSelected:S,svgCache:h})}):p.length>0?f.jsx("div",{style:{margin:"1rem 0",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",fontSize:".9rem"},children:I("library.noItems")}):null]}),m&&f.jsx(dx,{style:{padding:"16px 0",width:"100%"},id:s,libraryReturnUrl:l,theme:r,children:f.jsx(o5,{selectedItems:d,onSelectItems:c})})]})]})}var EU=Bt(!1),d5=({children:e})=>f.jsx("div",{className:"layer-ui__library",children:e}),bW=M.memo(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:n,setAppState:a,libraryReturnUrl:i,library:r,id:s,theme:l,selectedItems:c,onSelectItems:d})=>{let[o]=mt(Wo),u=M.useCallback(U=>{(async(m,g)=>{Qe("element","addToLibrary","ui");for(let v of r8)if(m.some(x=>x.type===v))return a({errorMessage:I(`errors.libraryElementTypeError.${v}`)});let b=[{status:"unpublished",elements:m,id:Vn(),created:Date.now()},...g];n(),r.setLibrary(b).catch(()=>{a({errorMessage:I("alerts.errorAddingToLibrary")})})})(U,o.libraryItems)},[n,r,a,o.libraryItems]),h=M.useMemo(()=>o.libraryItems,[o]);if(o.status==="loading"&&!o.isInitialized)return f.jsx(d5,{children:f.jsx("div",{className:"layer-ui__library-message",children:f.jsxs("div",{children:[f.jsx(Ei,{size:"2em"}),f.jsx("span",{children:I("labels.libraryLoadingMessage")})]})})});let p=o.libraryItems.length>0||t.length>0;return f.jsxs(d5,{children:[f.jsx(gW,{isLoading:o.status==="loading",libraryItems:h,onAddToLibrary:u,onInsertLibraryItems:e,pendingElements:t,id:s,libraryReturnUrl:i,theme:l,onSelectItems:d,selectedItems:c}),p&&f.jsx(dx,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:s,libraryReturnUrl:i,theme:l})]})}),Bh=(e,t)=>({elements:e,pending:ve(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),vW=(e,t)=>{let n=Tf(),[a,i]=M.useState(()=>Bh(n,e.selectedElementIds)),r=M.useRef(new Map);return M.useEffect(()=>{for(let s of a.pending)r.current.set(s.id,s.version)},[a.pending]),M.useEffect(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&i(s=>{var c;if(!Vt(s.selectedElementIds,e.selectedElementIds))return r.current.clear(),Bh(n,e.selectedElementIds);let l=t.scene.getNonDeletedElementsMap();for(let d of Object.keys(e.selectedElementIds)){let o=(c=l.get(d))==null?void 0:c.version;if(o&&o!==r.current.get(d))return Bh(n,e.selectedElementIds)}return s})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,n]),a.pending},xW=M.memo(()=>{let e=va(),{onInsertElements:t}=e,n=mc(),a=Yt(),i=_t(),[r,s]=M.useState([]),l=M.useMemo(()=>e.library,[e.library]),c=vW(a,e),d=M.useCallback(u=>{t(cx(u))},[t]),o=M.useCallback(()=>{i({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[i]);return f.jsx(bW,{pendingElements:c,onInsertLibraryItems:d,onAddToLibrary:o,setAppState:i,libraryReturnUrl:n.libraryReturnUrl,library:l,id:e.id,theme:a.theme,selectedItems:r,onSelectItems:s})});function yW(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;case"regular":default:return 800}}var ba=e=>{let[t,n]=IX(),[a]=M.useState(document.activeElement),{id:i}=qa(),r=Tt().viewport.isMobile;M.useEffect(()=>{if(!t)return;let d=E1(t);setTimeout(()=>{d.length>0&&e.autofocus!==!1&&(d[1]||d[0]).focus()});let o=u=>{if(u.key===D.TAB){let h=E1(t),{activeElement:p}=document,U=h.findIndex(m=>m===p);U===0&&u.shiftKey?(h[h.length-1].focus(),u.preventDefault()):U===h.length-1&&!u.shiftKey&&(h[0].focus(),u.preventDefault())}};return t.addEventListener("keydown",o),()=>t.removeEventListener("keydown",o)},[t,e.autofocus]);let s=_t(),l=gf(EU),c=()=>{s({openMenu:null}),l(!1),a.focus(),e.onCloseRequest()};return f.jsx(TX,{className:ne("Dialog",e.className,{"Dialog--fullscreen":r}),labelledBy:"dialog-title",maxWidth:yW(e.size),onCloseRequest:c,closeOnClickOutside:e.closeOnClickOutside,children:f.jsxs(ua,{ref:n,children:[e.title&&f.jsx("h2",{id:`${i}-dialog-title`,className:"Dialog__title",children:f.jsx("span",{className:"Dialog__titleContent",children:e.title})}),r&&f.jsx("button",{className:"Dialog__close",onClick:c,title:I("buttons.close"),"aria-label":I("buttons.close"),type:"button",children:hl}),f.jsx("div",{className:"Dialog__content",children:e.children})]})})},sr=({type:e="button",onSelect:t,selected:n,children:a,className:i="",...r})=>f.jsx("button",{onClick:$u(r.onClick,s=>{t()}),type:e,className:ne("excalidraw-button",i,{selected:n}),...r,children:a}),SU=M.forwardRef(({onChange:e,label:t,fullWidth:n,placeholder:a,readonly:i,selectOnRender:r,onKeyDown:s,isRedacted:l=!1,icon:c,className:d,...o},u)=>{let h=M.useRef(null);M.useImperativeHandle(u,()=>h.current),M.useLayoutEffect(()=>{var m,g;r&&((m=h.current)==null||m.focus(),(g=h.current)==null||g.select())},[r]);let[p,U]=M.useState(!1);return f.jsxs("div",{className:ne("ExcTextField",d,{"ExcTextField--fullWidth":n,"ExcTextField--hasIcon":!!c}),onClick:()=>{var m;(m=h.current)==null||m.focus()},children:[c,t&&f.jsx("div",{className:"ExcTextField__label",children:t}),f.jsxs("div",{className:ne("ExcTextField__input",{"ExcTextField__input--readonly":i}),children:[f.jsx("input",{className:ne({"is-redacted":"value"in o&&o.value&&l&&!p}),readOnly:i,value:"value"in o?o.value:void 0,defaultValue:"defaultValue"in o?o.defaultValue:void 0,placeholder:a,ref:h,onChange:m=>e==null?void 0:e(m.target.value),onKeyDown:s}),l&&f.jsx(sr,{onSelect:()=>U(!p),style:{border:0,userSelect:"none"},children:p?eT:tp})]})]})}),wW={toggleTheme:[V("Shift+Alt+D")],saveScene:[V("CtrlOrCmd+S")],loadScene:[V("CtrlOrCmd+O")],clearCanvas:[V("CtrlOrCmd+Delete")],imageExport:[V("CtrlOrCmd+Shift+E")],commandPalette:[V("CtrlOrCmd+/"),V("CtrlOrCmd+Shift+P")],cut:[V("CtrlOrCmd+X")],copy:[V("CtrlOrCmd+C")],paste:[V("CtrlOrCmd+V")],copyStyles:[V("CtrlOrCmd+Alt+C")],pasteStyles:[V("CtrlOrCmd+Alt+V")],selectAll:[V("CtrlOrCmd+A")],deleteSelectedElements:[V("Delete")],duplicateSelection:[V("CtrlOrCmd+D"),V(`Alt+${I("helpDialog.drag")}`)],sendBackward:[V("CtrlOrCmd+[")],bringForward:[V("CtrlOrCmd+]")],sendToBack:[V(Fa?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[V(Fa?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[V("Shift+Alt+C")],group:[V("CtrlOrCmd+G")],ungroup:[V("CtrlOrCmd+Shift+G")],gridMode:[V("CtrlOrCmd+'")],zenMode:[V("Alt+Z")],objectsSnapMode:[V("Alt+S")],stats:[V("Alt+/")],addToLibrary:[],flipHorizontal:[V("Shift+H")],flipVertical:[V("Shift+V")],viewMode:[V("Alt+R")],hyperlink:[V("CtrlOrCmd+K")],toggleElementLock:[V("CtrlOrCmd+Shift+L")],resetZoom:[V("CtrlOrCmd+0")],zoomOut:[V("CtrlOrCmd+-")],zoomIn:[V("CtrlOrCmd++")],zoomToFitSelection:[V("Shift+3")],zoomToFit:[V("Shift+1")],zoomToFitSelectionInViewport:[V("Shift+2")],toggleEraserTool:[V("E")],toggleHandTool:[V("H")],setFrameAsActiveTool:[V("F")],saveFileToDisk:[V("CtrlOrCmd+S")],saveToActiveFile:[V("CtrlOrCmd+S")],toggleShortcuts:[V("?")],searchMenu:[V("CtrlOrCmd+F")],wrapSelectionInFrame:[]},tn=(e,t=0)=>{let n=wW[e];return n&&n.length>0?n[t]||n[0]:""},EW="\\u0300-\\u036f",SW="\\ufe20-\\ufe2f",CW="\\u20d0-\\u20ff",kW=EW+SW+CW,MW=`[${kW}]`,IW=RegExp(MW,"g"),TW=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_W={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"E",æ:"e",Þ:"T",þ:"t",ß:"s",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"I",ij:"i",Œ:"E",œ:"e",ʼn:"n",ſ:"s"},u5=e=>e.replace(TW,t=>_W[t]||t).replace(IW,""),mx=M.createContext(null),un=()=>M.useContext(mx),jW=Q4(),AW=()=>M.useMemo(()=>({MainMenuTunnel:Ca(),WelcomeScreenMenuHintTunnel:Ca(),WelcomeScreenToolbarHintTunnel:Ca(),WelcomeScreenHelpHintTunnel:Ca(),WelcomeScreenCenterTunnel:Ca(),FooterCenterTunnel:Ca(),DefaultSidebarTriggerTunnel:Ca(),DefaultSidebarTabTriggersTunnel:Ca(),OverwriteConfirmDialogTunnel:Ca(),TTDDialogTriggerTunnel:Ca(),tunnelsJotai:jW}),[]),gx=(e,t)=>{var a;let n=((a=t[0])==null?void 0:a.type)||null;for(let i of t)if(i.type!==n){n=null;break}return R1(e.activeTool.type)&&e.activeTool.type!=="image"&&n!=="image"&&n!=="frame"&&n!=="magicframe"||t.some(i=>R1(i.type))},bx=(e,t)=>Js(e.activeTool.type)||t.some(n=>Js(n.type)),vx=({appState:e,elementsMap:t,renderAction:n,app:a})=>{let i=F3(t,e),r=!1;i.length===2&&(Wn(i[0])||Wn(i[1]))&&(r=!0);let s=!!(e.editingTextElement||e.newElement),l=Tt(),c=document.documentElement.getAttribute("dir")==="rtl",d=Js(e.activeTool.type)&&!ia(e.currentItemBackgroundColor)||i.some(U=>Js(U.type)&&!ia(U.backgroundColor)),o=i.length===1||r,u=!e.editingLinearElement&&i.length===1&&fe(i[0])&&!ee(i[0]),h=!e.croppingElementId&&i.length===1&&Ne(i[0]),p=!r&&_n(e,a);return f.jsxs("div",{className:"panelColumn",children:[f.jsx("div",{children:gx(e,i)&&n("changeStrokeColor")}),bx(e,i)&&f.jsx("div",{children:n("changeBackgroundColor")}),d&&n("changeFillStyle"),(N2(e.activeTool.type)||i.some(U=>N2(U.type)))&&n("changeStrokeWidth"),(e.activeTool.type==="freedraw"||i.some(U=>U.type==="freedraw"))&&n("changeStrokeShape"),(O2(e.activeTool.type)||i.some(U=>O2(U.type)))&&f.jsxs(f.Fragment,{children:[n("changeStrokeStyle"),n("changeSloppiness")]}),(L1(e.activeTool.type)||i.some(U=>L1(U.type)))&&f.jsx(f.Fragment,{children:n("changeRoundness")}),($2(e.activeTool.type)||i.some(U=>$2(U.type)))&&f.jsx(f.Fragment,{children:n("changeArrowType")}),(e.activeTool.type==="text"||i.some(q))&&f.jsxs(f.Fragment,{children:[n("changeFontFamily"),n("changeFontSize"),(e.activeTool.type==="text"||YD(i,t))&&n("changeTextAlign")]}),GD(i,t)&&n("changeVerticalAlign"),(Jd(e.activeTool.type)||i.some(U=>Jd(U.type)))&&f.jsx(f.Fragment,{children:n("changeArrowhead")}),n("changeOpacity"),f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.layers")}),f.jsxs("div",{className:"buttonList",children:[n("sendToBack"),n("sendBackward"),n("bringForward"),n("bringToFront")]})]}),p&&!r&&f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.align")}),f.jsxs("div",{className:"buttonList",children:[c?f.jsxs(f.Fragment,{children:[n("alignRight"),n("alignHorizontallyCentered"),n("alignLeft")]}):f.jsxs(f.Fragment,{children:[n("alignLeft"),n("alignHorizontallyCentered"),n("alignRight")]}),i.length>2&&n("distributeHorizontally"),f.jsx("div",{style:{flexBasis:"100%",height:0}}),f.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[n("alignTop"),n("alignVerticallyCentered"),n("alignBottom"),i.length>2&&n("distributeVertically")]})]})]}),!s&&i.length>0&&f.jsxs("fieldset",{children:[f.jsx("legend",{children:I("labels.actions")}),f.jsxs("div",{className:"buttonList",children:[!l.editor.isMobile&&n("duplicateSelection"),!l.editor.isMobile&&n("deleteSelectedElements"),n("group"),n("ungroup"),o&&n("hyperlink"),h&&n("cropEditor"),u&&n("toggleLinearEditor")]})]})]})},xx=({activeTool:e,appState:t,app:n,UIOptions:a})=>{let[i,r]=M.useState(!1),s=e.type==="frame",l=e.type==="laser",c=e.type==="embeddable",{TTDDialogTriggerTunnel:d}=un();return f.jsxs(f.Fragment,{children:[rp.map(({value:o,icon:u,key:h,numericKey:p,fillable:U},m)=>{var x;if(((x=a.tools)==null?void 0:x[o])===!1)return null;let g=I(`toolBar.${o}`),b=h&&ro(typeof h=="string"?h:h[0]),v=b?`${b} ${I("helpDialog.or")} ${p}`:`${p}`;return f.jsx(Me,{className:ne("Shape",{fillable:U}),type:"radio",icon:u,checked:e.type===o,name:"editor-current-shape",title:`${ro(g)} — ${v}`,keyBindingLabel:p||b,"aria-label":ro(g),"aria-keyshortcuts":v,"data-testid":`toolbar-${o}`,onPointerDown:({pointerType:y})=>{!t.penDetected&&y==="pen"&&n.togglePenMode(!0)},onChange:({pointerType:y})=>{t.activeTool.type!==o&&Qe("toolbar",o,"ui"),o==="image"?n.setActiveTool({type:o,insertOnCanvasDirectly:y!=="mouse"}):n.setActiveTool({type:o})}},o)}),f.jsx("div",{className:"App-toolbar__divider"}),f.jsxs(et,{open:i,children:[f.jsx(et.Trigger,{className:ne("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":s||c||l&&!n.props.isCollaborating}),onToggle:()=>r(!i),title:I("toolBar.extraTools"),children:JI}),f.jsxs(et.Content,{onClickOutside:()=>r(!1),onSelect:()=>r(!1),className:"App-toolbar__extra-tools-dropdown",children:[f.jsx(et.Item,{onSelect:()=>n.setActiveTool({type:"frame"}),icon:z8,shortcut:D.F.toLocaleUpperCase(),"data-testid":"toolbar-frame",selected:s,children:I("toolBar.frame")}),f.jsx(et.Item,{onSelect:()=>n.setActiveTool({type:"embeddable"}),icon:KM,"data-testid":"toolbar-embeddable",selected:c,children:I("toolBar.embeddable")}),f.jsx(et.Item,{onSelect:()=>n.setActiveTool({type:"laser"}),icon:H8,"data-testid":"toolbar-laser",selected:l,shortcut:D.K.toLocaleUpperCase(),children:I("toolBar.laser")}),f.jsx("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),n.props.aiEnabled!==!1&&f.jsx(d.Out,{}),f.jsx(et.Item,{onSelect:()=>n.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:B8,"data-testid":"toolbar-embeddable",children:I("toolBar.mermaidToExcalidraw")}),n.props.aiEnabled!==!1&&n.plugins.diagramToCode&&f.jsx(f.Fragment,{children:f.jsxs(et.Item,{onSelect:()=>n.onMagicframeToolSelect(),icon:X8,"data-testid":"toolbar-magicframe",children:[I("toolBar.magicframe"),f.jsx(et.Item.Badge,{children:"AI"})]})})]})]})]})},RW=({renderAction:e,zoom:t})=>f.jsx(On.Col,{gap:1,className:Ws.ZOOM_ACTIONS,children:f.jsxs(On.Row,{align:"center",children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]})}),LW=({renderAction:e,className:t})=>f.jsxs("div",{className:`undo-redo-buttons ${t}`,children:[f.jsx("div",{className:"undo-button-container",children:f.jsx(ns,{label:I("buttons.undo"),children:e("undo")})}),f.jsx("div",{className:"redo-button-container",children:f.jsxs(ns,{label:I("buttons.redo"),children:[" ",e("redo")]})})]}),DW=({actionManager:e,showExitZenModeBtn:t})=>f.jsx("button",{type:"button",className:ne("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(b0),children:I("buttons.exitZenMode")}),PW=({renderAction:e,className:t})=>f.jsx("div",{className:`finalize-button ${t}`,children:e("finalize",{size:"small"})}),f5=e=>{let t=M.useRef({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...n)=>t.current.userFn(...n)),t.current.stableFn},Mf=Bt(null),NW=()=>{let[e,t]=mt(Mf),n=En();return e&&e==="clearCanvas"?f.jsx(ux,{onConfirm:()=>{n.executeAction(ho),t(null)},onCancel:()=>t(null),title:I("clearCanvasDialog.title"),children:f.jsxs("p",{className:"clear-canvas__content",children:[" ",I("alerts.clearReset")]})}):null},yx={};q5(yx,{toggleTheme:()=>OW});var OW={...xu,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(xu,"commandPalette")}},wx=Z({name:"copyElementLink",label:"labels.copyElementLink",icon:ep,trackEvent:{category:"element"},perform:async(e,t,n,a)=>{let i=ve(e,t);try{if(window.location){let r=h3(i,t);return r?(await pl(a.props.generateLinkForSelection?a.props.generateLinkForSelection(r.id,r.type):f3(r.id,r.type)),{appState:{toast:{message:I("toast.elementLinkCopied"),closable:!0}},captureUpdate:X.EVENTUALLY}):{appState:t,elements:e,app:a,captureUpdate:X.EVENTUALLY}}}catch(r){console.error(r)}return{appState:t,elements:e,app:a,captureUpdate:X.EVENTUALLY}},predicate:(e,t)=>lu(ve(e,t))}),$W=Z({name:"linkToElement",label:"labels.linkToElement",icon:Y8,perform:(e,t,n,a)=>{let i=ve(e,t);return i.length!==1||!lu(i)?{elements:e,appState:t,app:a,captureUpdate:X.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:ve(e,t)[0].id}},captureUpdate:X.IMMEDIATELY}},predicate:(e,t,n,a)=>{var r;let i=ve(e,t);return((r=t.openDialog)==null?void 0:r.name)!=="elementLinkSelector"&&i.length===1&&lu(i)},trackEvent:!1}),FW=Bt(null),xt={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links"},zW=e=>{switch(e){case xt.app:return 1;case xt.export:return 2;case xt.editor:return 3;case xt.tools:return 4;case xt.elements:return 5;case xt.links:return 6;default:return 10}},Td=({shortcut:e,className:t,children:n})=>{let a=e.replace("++","+$").split("+");return f.jsxs("div",{className:ne("shortcut",t),children:[a.map((i,r)=>f.jsx("div",{className:"shortcut-wrapper",children:f.jsx("div",{className:"shortcut-key",children:i==="$"?"+":i})},i)),f.jsx("div",{className:"shortcut-desc",children:n})]})},Ex=e=>!e.altKey&&e[D.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===D.P||e.key===D.SLASH);Object.assign(e=>{var a;let t=Yt(),n=_t();return M.useEffect(()=>{let i=r=>{Ex(r)&&(r.preventDefault(),r.stopPropagation(),n(s=>{var c;let l=((c=s.openDialog)==null?void 0:c.name)==="commandPalette"?null:{name:"commandPalette"};return l&&Qe("command_palette","open","shortcut"),{openDialog:l}}))};return window.addEventListener("keydown",i,{capture:!0}),()=>window.removeEventListener("keydown",i,{capture:!0})},[n]),((a=t.openDialog)==null?void 0:a.name)!=="commandPalette"?null:f.jsx(BW,{...e})},{defaultItems:yx});function BW({customCommandPaletteItems:e}){let t=va(),n=Yt(),a=_t(),i=mc(),r=En(),[s,l]=mt(FW),[c,d]=M.useState(null),o=M.useRef(null),u=xf({uiAppState:n,customCommandPaletteItems:e,appProps:i});M.useEffect(()=>{let{uiAppState:S,customCommandPaletteItems:w,appProps:k}=u,T=R=>{let N="";return R.label&&(typeof R.label=="function"?N=I(R.label(t.scene.getNonDeletedElements(),S,t)):N=I(R.label)),N},_=R=>typeof R.icon=="function"?R.icon(S,t.scene.getNonDeletedElements()):R.icon,j=[],A=(R,N,O)=>{let $={label:T(R),icon:_(R),category:N,shortcut:tn(R.name),keywords:R.keywords,predicate:R.predicate,viewMode:R.viewMode,perform:()=>{r.executeAction(R,"commandPalette")}};return O?O($,R):$};if(S&&t.scene&&r){let R=[r.actions.group,r.actions.ungroup,r.actions.cut,r.actions.copy,r.actions.deleteSelectedElements,r.actions.wrapSelectionInFrame,r.actions.copyStyles,r.actions.pasteStyles,r.actions.bringToFront,r.actions.bringForward,r.actions.sendBackward,r.actions.sendToBack,r.actions.alignTop,r.actions.alignBottom,r.actions.alignLeft,r.actions.alignRight,r.actions.alignVerticallyCentered,r.actions.alignHorizontallyCentered,r.actions.duplicateSelection,r.actions.flipHorizontal,r.actions.flipVertical,r.actions.zoomToFitSelection,r.actions.zoomToFitSelectionInViewport,r.actions.increaseFontSize,r.actions.decreaseFontSize,r.actions.toggleLinearEditor,r.actions.cropEditor,ax,wx,$W].map(F=>A(F,xt.elements,(Y,Q)=>({...Y,predicate:Q.predicate?Q.predicate:(le,ie,Te,_e)=>ve(le,ie).length>0}))),N=[r.actions.toggleHandTool,r.actions.setFrameAsActiveTool].map(F=>A(F,xt.tools)),O=[r.actions.undo,r.actions.redo,r.actions.zoomIn,r.actions.zoomOut,r.actions.resetZoom,r.actions.zoomToFit,r.actions.zenMode,r.actions.viewMode,r.actions.gridMode,r.actions.objectsSnapMode,r.actions.toggleShortcuts,r.actions.selectAll,r.actions.toggleElementLock,r.actions.unlockAllElements,r.actions.stats].map(F=>A(F,xt.editor)),$=[r.actions.saveToActiveFile,r.actions.saveFileToDisk,r.actions.copyAsPng,r.actions.copyAsSvg].map(F=>A(F,xt.export));j=[...R,...O,{label:T(ho),icon:_(ho),shortcut:tn(ho.name),category:xt.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{sa.set(Mf,"clearCanvas")}},{label:I("buttons.exportImage"),category:xt.export,icon:L8,shortcut:tn("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{a({openDialog:{name:"imageExport"}})}},...$];let P=[{label:I("toolBar.library"),category:xt.app,icon:K0,viewMode:!1,perform:()=>{S.openSidebar?a({openSidebar:null}):a({openSidebar:{name:oa.name,tab:oa.defaultTab}})}},{label:I("search.title"),category:xt.app,icon:Zr,viewMode:!0,perform:()=>{r.executeAction(Sx)}},{label:I("labels.changeStroke"),keywords:["color","outline"],category:xt.elements,icon:sh,viewMode:!1,predicate:(F,Y)=>{let Q=ve(F,Y);return Q.length>0&&gx(Y,Q)},perform:()=>{a(F=>({openMenu:F.openMenu==="shape"?null:"shape",openPopup:"elementStroke"}))}},{label:I("labels.changeBackground"),keywords:["color","fill"],icon:sh,category:xt.elements,viewMode:!1,predicate:(F,Y)=>{let Q=ve(F,Y);return Q.length>0&&bx(Y,Q)},perform:()=>{a(F=>({openMenu:F.openMenu==="shape"?null:"shape",openPopup:"elementBackground"}))}},{label:I("labels.canvasBackground"),keywords:["color"],icon:sh,category:xt.editor,viewMode:!1,perform:()=>{a(F=>({openMenu:F.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...rp.reduce((F,Y)=>{var oe;let{value:Q,icon:le,key:ie,numericKey:Te}=Y;if(((oe=k.UIOptions.tools)==null?void 0:oe[Q])===!1)return F;let _e=ie&&ro(typeof ie=="string"?ie:ie[0])||Te,Ie={label:I(`toolBar.${Q}`),category:xt.tools,shortcut:_e,icon:le,keywords:["toolbar"],viewMode:!1,perform:({event:ue})=>{Q==="image"?t.setActiveTool({type:Q,insertOnCanvasDirectly:ue.type==="keydown"}):t.setActiveTool({type:Q})}};return F.push(Ie),F},[]),...N,{label:I("toolBar.lock"),category:xt.tools,icon:S.activeTool.locked?q0:zu,shortcut:D.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${I("labels.textToDiagram")}...`,category:xt.tools,icon:nT,viewMode:!1,predicate:k.aiEnabled,perform:()=>{a(F=>({...F,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${I("toolBar.mermaidToExcalidraw")}...`,category:xt.tools,icon:B8,viewMode:!1,predicate:k.aiEnabled,perform:()=>{a(F=>({...F,openDialog:{name:"ttd",tab:"mermaid"}}))}}],W=[...j,...P,...w||[]].map(F=>{var Y;return{...F,icon:F.icon||W8,order:F.order??zW(F.category),haystack:`${u5(F.label.toLocaleLowerCase())} ${((Y=F.keywords)==null?void 0:Y.join(" "))||""}`}});d(W),l(W.find(F=>F.label===(s==null?void 0:s.label))??null)}},[u,t,r,d,s==null?void 0:s.label,l,a]);let[h,p]=M.useState(""),[U,m]=M.useState(null),[g,b]=M.useState({}),v=S=>{a({openDialog:null},S),p("")},x=(S,w)=>{var k;((k=n.openDialog)==null?void 0:k.name)==="commandPalette"&&(w.stopPropagation(),w.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),v(()=>{S.perform({actionManager:r,event:w}),l(S),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},y=f5(S=>S.viewMode===!1&&n.viewModeEnabled?!1:typeof S.predicate=="function"?S.predicate(t.scene.getNonDeletedElements(),n,i,t):S.predicate===void 0||S.predicate),E=f5(S=>{var _;let w=Er(S.target)||Ex(S)||S.key===D.ESCAPE;if(w&&S.key!==D.ARROW_UP&&S.key!==D.ARROW_DOWN&&S.key!==D.ENTER)return;let k=Object.values(g).flat(),T=s&&!h&&y(s);if(S.key===D.ARROW_UP){S.preventDefault();let j=k.findIndex(N=>N.label===(U==null?void 0:U.label));if(T){if(j===0){m(s);return}if(U===s){let N=k[k.length-1];N&&m(N);return}}let A;j===-1?A=k.length-1:A=j===0?k.length-1:(j-1)%k.length;let R=k[A];R&&m(R);return}if(S.key===D.ARROW_DOWN){S.preventDefault();let j=k.findIndex(N=>N.label===(U==null?void 0:U.label));if(T){if(!U||j===k.length-1){m(s);return}if(U===s){let N=k[0];N&&m(N);return}}let A=(j+1)%k.length,R=k[A];R&&m(R);return}if(S.key===D.ENTER&&U&&setTimeout(()=>{x(U,S)}),!w){if(S.stopPropagation(),/^[a-zA-Z0-9]$/.test(S.key)){(_=o==null?void 0:o.current)==null||_.focus();return}S.preventDefault()}});return M.useEffect(()=>(window.addEventListener("keydown",E,{capture:!0}),()=>window.removeEventListener("keydown",E,{capture:!0})),[E]),M.useEffect(()=>{if(!c)return;let S=_=>{let j={};for(let A of _)j[A.category]?j[A.category].push(A):j[A.category]=[A];return j},w=c.filter(y).sort((_,j)=>_.order-j.order),k=!h&&s&&y(s);if(!h){b(S(k?w.filter(_=>_.label!==(s==null?void 0:s.label)):w)),m(k?s:w[0]||null);return}let T=u5(h.toLocaleLowerCase().replace(/[<>_| -]/g,""));w=hz.filter(T,w,{extract:_=>_.haystack}).sort((_,j)=>j.score-_.score).map(_=>_.original),b(S(w)),m(w[0]??null)},[h,c,y,s]),f.jsxs(ba,{onCloseRequest:()=>v(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[f.jsx(SU,{value:h,placeholder:I("commandPalette.search.placeholder"),onChange:S=>{p(S)},selectOnRender:!0,ref:o}),!t.device.viewport.isMobile&&f.jsxs("div",{className:"shortcuts-wrapper",children:[f.jsx(Td,{shortcut:"↑↓",children:I("commandPalette.shortcuts.select")}),f.jsx(Td,{shortcut:"↵",children:I("commandPalette.shortcuts.confirm")}),f.jsx(Td,{shortcut:V("Esc"),children:I("commandPalette.shortcuts.close")})]}),f.jsxs("div",{className:"commands",children:[s&&!h&&f.jsxs("div",{className:"command-category",children:[f.jsxs("div",{className:"command-category-title",children:[I("commandPalette.recents"),f.jsx("div",{className:"icon",style:{marginLeft:"6px"},children:aT})]}),f.jsx(h5,{command:s,isSelected:s.label===(U==null?void 0:U.label),onClick:S=>x(s,S),disabled:!y(s),onMouseMove:()=>m(s),showShortcut:!t.device.viewport.isMobile,appState:n})]}),Object.keys(g).length>0?Object.keys(g).map((S,w)=>f.jsxs("div",{className:"command-category",children:[f.jsx("div",{className:"command-category-title",children:S}),g[S].map(k=>f.jsx(h5,{command:k,isSelected:k.label===(U==null?void 0:U.label),onClick:T=>x(k,T),onMouseMove:()=>m(k),showShortcut:!t.device.viewport.isMobile,appState:n},k.label))]},S)):c?f.jsxs("div",{className:"no-match",children:[f.jsx("div",{className:"icon",children:Zr})," ",I("commandPalette.search.noMatch")]}):null]})]})}var h5=({command:e,isSelected:t,disabled:n,onMouseMove:a,onClick:i,showShortcut:r,appState:s})=>{let l=()=>{};return f.jsxs("div",{className:ne("command-item",{"item-selected":t,"item-disabled":n}),ref:c=>{var d;t&&!n&&((d=c==null?void 0:c.scrollIntoView)==null||d.call(c,{block:"nearest"}))},onClick:n?l:i,onMouseMove:n?l:a,title:n?I("commandPalette.itemNotAvailable"):"",children:[f.jsxs("div",{className:"name",children:[e.icon&&f.jsx(wf,{icon:typeof e.icon=="function"?e.icon(s):e.icon}),e.label]}),r&&e.shortcut&&f.jsx(Td,{shortcut:e.shortcut})]})},HW=Z({name:"toggleLinearEditor",category:xt.elements,label:(e,t,n)=>{var a;return((a=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds})[0])==null?void 0:a.type)==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit"},keywords:["line"],trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return!!(!t.editingLinearElement&&i.length===1&&fe(i[0])&&!ee(i[0]))},perform(e,t,n,a){var s;let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0],r=((s=t.editingLinearElement)==null?void 0:s.elementId)===i.id?null:new J(i);return{appState:{...t,editingLinearElement:r},captureUpdate:X.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:n})=>{let a=n.scene.getSelectedElements({selectedElementIds:e.selectedElementIds})[0],i=I(a.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit");return f.jsx(Me,{type:"button",icon:gT,title:i,"aria-label":i,onClick:()=>t(null)})}}),Sx=Z({name:"searchMenu",icon:Zr,keywords:["search","find"],label:"search.title",viewMode:!0,trackEvent:{category:"search_menu",action:"toggle",predicate:e=>e.gridModeEnabled},perform(e,t,n,a){var i,r;if(((i=t.openSidebar)==null?void 0:i.name)===oa.name&&t.openSidebar.tab===Ns){let s=(r=a.excalidrawContainerValue.container)==null?void 0:r.querySelector(`.${Ws.SEARCH_MENU_INPUT_WRAPPER} input`);return s!=null&&s.matches(":focus")?{appState:{...t,openSidebar:null},captureUpdate:X.EVENTUALLY}:(s==null||s.focus(),s==null||s.select(),!1)}return{appState:{...t,openSidebar:{name:oa.name,tab:Ns},openDialog:null},captureUpdate:X.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.F}),XW=Z({name:"cropEditor",label:"helpDialog.cropStart",icon:A2,viewMode:!0,trackEvent:{category:"menu"},keywords:["image","crop"],perform(e,t,n,a){let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];return{appState:{...t,isCropping:!1,croppingElementId:i.id},captureUpdate:X.IMMEDIATELY}},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return!!(!t.croppingElementId&&i.length===1&&Ne(i[0]))},PanelComponent:({appState:e,updateData:t,app:n})=>{let a=I("helpDialog.cropStart");return f.jsx(Me,{type:"button",icon:A2,title:a,"aria-label":a,onClick:()=>t(null)})}}),Eu=class{constructor(e=!0,t=!0){this.isUndoStackEmpty=e,this.isRedoStackEmpty=t}},p5=class Jl{constructor(){L(this,"onHistoryChangedEmitter",new Ta),L(this,"undoStack",[]),L(this,"redoStack",[])}get isUndoStackEmpty(){return this.undoStack.length===0}get isRedoStackEmpty(){return this.redoStack.length===0}clear(){this.undoStack.length=0,this.redoStack.length=0}record(t,n){let a=WW.create(n,t);a.isEmpty()||(this.undoStack.push(a.inverse()),a.elementsChange.isEmpty()||(this.redoStack.length=0),this.onHistoryChangedEmitter.trigger(new Eu(this.isUndoStackEmpty,this.isRedoStackEmpty)))}undo(t,n,a){return this.perform(t,n,a,()=>Jl.pop(this.undoStack),i=>Jl.push(this.redoStack,i,t))}redo(t,n,a){return this.perform(t,n,a,()=>Jl.pop(this.redoStack),i=>Jl.push(this.undoStack,i,t))}perform(t,n,a,i,r){try{let s=i();if(s===null)return;let l=t,c=n,d=!1;for(;s;){try{[l,c,d]=s.applyTo(l,c,a)}finally{r(s)}if(d)break;s=i()}return[l,c]}finally{this.onHistoryChangedEmitter.trigger(new Eu(this.isUndoStackEmpty,this.isRedoStackEmpty))}}static pop(t){if(!t.length)return null;let n=t.pop();return n!==void 0?n:null}static push(t,n,a){let i=n.inverse().applyLatestChanges(a);return t.push(i)}},WW=class _d{constructor(t,n){this.appStateChange=t,this.elementsChange=n}static create(t,n){return new _d(t,n)}inverse(){return new _d(this.appStateChange.inverse(),this.elementsChange.inverse())}applyTo(t,n,a){let[i,r]=this.elementsChange.applyTo(t,a.elements),[s,l]=this.appStateChange.applyTo(n,i);return[i,s,r||l]}applyLatestChanges(t){let n=this.elementsChange.applyLatestChanges(t);return _d.create(this.appStateChange,n)}isEmpty(){return this.appStateChange.isEmpty()&&this.elementsChange.isEmpty()}},Cx=(e,t)=>{let[n,a]=M.useState(t);return M.useEffect(()=>{let i=e.on(r=>{a(r)});return()=>{i()}},[e]),n},kx=(e,t,n)=>{if(!t.multiElement&&!t.resizingElement&&!t.editingTextElement&&!t.newElement&&!t.selectedElementsAreBeingDragged&&!t.selectionElement&&!e.flowChartCreator.isCreatingChart){let a=n();if(!a)return{captureUpdate:X.EVENTUALLY};let[i,r]=a,s=Array.from(i.values());return{appState:r,elements:s,captureUpdate:X.NEVER}}return{captureUpdate:X.EVENTUALLY}},VW=(e,t)=>({name:"undo",label:"buttons.undo",icon:g2,trackEvent:{category:"history"},viewMode:!1,perform:(n,a,i,r)=>kx(r,a,()=>e.undo(ce(n),a,t.snapshot)),keyTest:n=>n[D.CTRL_OR_CMD]&&j1(n,D.Z)&&!n.shiftKey,PanelComponent:({updateData:n,data:a})=>{let{isUndoStackEmpty:i}=Cx(e.onHistoryChangedEmitter,new Eu(e.isUndoStackEmpty,e.isRedoStackEmpty));return f.jsx(Me,{type:"button",icon:g2,"aria-label":I("buttons.undo"),onClick:n,size:(a==null?void 0:a.size)||"medium",disabled:i,"data-testid":"button-undo"})}}),GW=(e,t)=>({name:"redo",label:"buttons.redo",icon:b2,trackEvent:{category:"history"},viewMode:!1,perform:(n,a,i,r)=>kx(r,a,()=>e.redo(ce(n),a,t.snapshot)),keyTest:n=>n[D.CTRL_OR_CMD]&&n.shiftKey&&j1(n,D.Z)||Qb&&n.ctrlKey&&!n.shiftKey&&j1(n,D.Y),PanelComponent:({updateData:n,data:a})=>{let{isRedoStackEmpty:i}=Cx(e.onHistoryChangedEmitter,new Eu(e.isUndoStackEmpty,e.isRedoStackEmpty));return f.jsx(Me,{type:"button",icon:b2,"aria-label":I("buttons.redo"),onClick:n,size:(a==null?void 0:a.size)||"medium",disabled:i,"data-testid":"button-redo"})}}),Hh=(e,t,n,a,i,r)=>{if(e.trackEvent)try{typeof e.trackEvent=="object"&&(!e.trackEvent.predicate||e.trackEvent.predicate(n,a,r))&&Qe(e.trackEvent.category,e.trackEvent.action||e.name,`${t} (${i.device.editor.isMobile?"mobile":"desktop"})`)}catch(s){console.error("error while logging action:",s)}},YW=class{constructor(e,t,n,a){L(this,"actions",{}),L(this,"updater"),L(this,"getAppState"),L(this,"getElementsIncludingDeleted"),L(this,"app"),L(this,"renderAction",(i,r)=>{let s=this.app.props.UIOptions.canvasActions;if(this.actions[i]&&"PanelComponent"in this.actions[i]&&(!(i in s)||s[i])){let l=this.actions[i],c=l.PanelComponent;c.displayName="PanelComponent";let d=this.getElementsIncludingDeleted(),o=this.getAppState(),u=h=>{Hh(l,"ui",o,d,this.app,h),this.updater(l.perform(this.getElementsIncludingDeleted(),this.getAppState(),h,this.app))};return f.jsx(c,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:u,appProps:this.app.props,app:this.app,data:r})}return null}),L(this,"isActionEnabled",i=>{let r=this.getElementsIncludingDeleted(),s=this.getAppState();return!i.predicate||i.predicate(r,s,this.app.props,this.app)}),this.updater=i=>{if(tc(i))i.then(r=>e(r));else return e(i)},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=a}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach(t=>this.registerAction(t))}handleKeyDown(e){let t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort((l,c)=>(c.keyPriority||0)-(l.keyPriority||0)).filter(l=>(l.name in t?t[l.name]:!0)&&l.keyTest&&l.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted(),this.app));if(n.length!==1)return n.length>1&&console.warn("Canceling as multiple actions match this shortcut",n),!1;let a=n[0];if(this.getAppState().viewModeEnabled&&a.viewMode!==!0)return!1;let i=this.getElementsIncludingDeleted(),r=this.getAppState();return Hh(a,"keyboard",r,i,this.app,null),e.preventDefault(),e.stopPropagation(),this.updater(n[0].perform(i,r,null,this.app)),!0}executeAction(e,t="api",n=null){let a=this.getElementsIncludingDeleted(),i=this.getAppState();Hh(e,t,i,a,this.app,n),this.updater(e.perform(a,i,n,this.app))}},U5=e=>{let t=Array.from(e.values());return{x:g5(t,n=>n.x)/t.length,y:g5(t,n=>n.y)/t.length}},m5=([e,t])=>Math.hypot(e.x-t.x,e.y-t.y),g5=(e,t)=>e.reduce((n,a)=>n+t(a),0),ZW=({children:e,left:t,top:n,onCloseRequest:a,fitInViewport:i=!1,offsetLeft:r=0,offsetTop:s=0,viewportWidth:l=window.innerWidth,viewportHeight:c=window.innerHeight})=>{let d=M.useRef(null);M.useEffect(()=>{let u=d.current;if(!u)return;u.contains(document.activeElement)||u.focus();let h=p=>{var U,m,g;if(p.key===D.TAB){let b=E1(u),{activeElement:v}=document,x=b.findIndex(y=>y===v);v===u?(p.shiftKey?(U=b[b.length-1])==null||U.focus():b[0].focus(),p.preventDefault(),p.stopImmediatePropagation()):x===0&&p.shiftKey?((m=b[b.length-1])==null||m.focus(),p.preventDefault(),p.stopImmediatePropagation()):x===b.length-1&&!p.shiftKey&&((g=b[0])==null||g.focus(),p.preventDefault(),p.stopImmediatePropagation())}};return u.addEventListener("keydown",h),()=>u.removeEventListener("keydown",h)},[]);let o=M.useRef(null);return M.useLayoutEffect(()=>{var u,h;if(i&&d.current&&n!=null&&t!=null){let p=d.current,{width:U,height:m}=p.getBoundingClientRect();if(((u=o.current)==null?void 0:u.top)===n&&((h=o.current)==null?void 0:h.left)===t)return;o.current={top:n,left:t},U>=l?(p.style.width=`${l}px`,p.style.left="0px",p.style.overflowX="scroll"):t+U-r>l?p.style.left=`${l-U-10}px`:p.style.left=`${t}px`,m>=c?(p.style.height=`${c-20}px`,p.style.top="10px",p.style.overflowY="scroll"):n+m-s>c?p.style.top=`${c-m}px`:p.style.top=`${n}px`}},[n,t,i,l,c,r,s]),M.useEffect(()=>{if(a){let u=h=>{var p;(p=d.current)!=null&&p.contains(h.target)||Xt.unstable_batchedUpdates(()=>a(h))};return document.addEventListener("pointerdown",u,!1),()=>document.removeEventListener("pointerdown",u,!1)}},[a]),f.jsx("div",{className:"popover",ref:d,tabIndex:-1,children:e})},jt="separator",KW=M.memo(({actionManager:e,items:t,top:n,left:a,onClose:i})=>{let r=gc(),s=Tf(),l=t.reduce((c,d)=>(d&&(d===jt||!d.predicate||d.predicate(s,r,e.app.props,e.app))&&c.push(d),c),[]);return f.jsx(ZW,{onCloseRequest:()=>{i()},top:n,left:a,fitInViewport:!0,offsetLeft:r.offsetLeft,offsetTop:r.offsetTop,viewportWidth:r.width,viewportHeight:r.height,children:f.jsx("ul",{className:"context-menu",onContextMenu:c=>c.preventDefault(),children:l.map((c,d)=>{var h;if(c===jt)return!l[d-1]||l[d-1]===jt?null:f.jsx("hr",{className:"context-menu-item-separator"},d);let o=c.name,u="";return c.label&&(typeof c.label=="function"?u=I(c.label(s,r,e.app)):u=I(c.label)),f.jsx("li",{"data-testid":o,onClick:()=>{i(()=>{e.executeAction(c,"contextMenu")})},children:f.jsxs("button",{type:"button",className:ne("context-menu-item",{dangerous:o==="deleteSelectedElements",checkmark:(h=c.checked)==null?void 0:h.call(c,r)}),children:[f.jsx("div",{className:"context-menu-item__label",children:u}),f.jsx("kbd",{className:"context-menu-item__shortcut",children:o?tn(o):""})]})},d)})})})}),qW=({children:e,onClose:t})=>{let[n,a]=M.useState(!!e),{container:i}=qa(),r=M.useCallback(()=>{a(!1),t&&t(),i==null||i.focus()},[t,i]);return f.jsx(f.Fragment,{children:n&&f.jsx(ba,{size:"small",onCloseRequest:r,title:I("errorDialog.title"),children:f.jsx("div",{style:{whiteSpace:"pre-wrap"},children:e})})})},Mx=function({onChange:e,value:t,choices:n,name:a}){return f.jsx("div",{className:"RadioGroup",children:n.map(i=>f.jsxs("div",{className:ne("RadioGroup__choice",{active:i.value===t}),title:i.ariaLabel,children:[f.jsx("input",{name:a,type:"radio",checked:i.value===t,onChange:()=>e(i.value),"aria-label":i.ariaLabel}),i.label]},String(i.value)))})},Yc=({title:e,name:t,checked:n,onChange:a,disabled:i=!1})=>f.jsx("div",{className:ne("Switch",{toggled:n,disabled:i}),children:f.jsx("input",{name:t,id:t,title:e,type:"checkbox",checked:n,disabled:i,onChange:()=>a(!n),onKeyDown:r=>{r.key===" "&&a(!n)}})}),mo=M.forwardRef(({children:e,icon:t,onClick:n,label:a,variant:i="filled",color:r="primary",size:s="medium",fullWidth:l,className:c,status:d},o)=>{let[u,h]=M.useState(!1),p=async m=>{let g=n==null?void 0:n(m);if(tc(g)){let b=window.setTimeout(()=>{h(!0)},50);try{await g}catch(v){if(v instanceof Xu)console.warn(v);else throw v}finally{clearTimeout(b),h(!1)}}},U=u?"loading":d;return r=U==="success"?"success":r,f.jsx("button",{className:ne("ExcButton",`ExcButton--color-${r}`,`ExcButton--variant-${i}`,`ExcButton--size-${s}`,`ExcButton--status-${U}`,{"ExcButton--fullWidth":l},c),onClick:p,type:"button","aria-label":a,ref:o,disabled:U==="loading"||U==="success",children:f.jsxs("div",{className:"ExcButton__contents",children:[U==="loading"?f.jsx(Ei,{className:"ExcButton__statusIcon"}):U==="success"&&f.jsx("div",{className:"ExcButton__statusIcon",children:ZI}),t&&f.jsx("div",{className:"ExcButton__icon","aria-hidden":!0,children:t}),i!=="icon"&&(e??a)]})})}),JW=2e3,QW=()=>{let[e,t]=M.useState(null),n=M.useRef(0),a=()=>{clearTimeout(n.current),t("success"),n.current=window.setTimeout(()=>{t(null)},JW)},i=M.useCallback(()=>{t(null)},[]);return{copyStatus:e,resetCopyStatus:i,onCopy:a}},eV="filter"in document.createElement("canvas").getContext("2d"),tV=()=>f.jsxs("div",{children:[f.jsx("h3",{children:I("canvasError.cannotShowPreview")}),f.jsx("p",{children:f.jsx("span",{children:I("canvasError.canvasTooBig")})}),f.jsxs("em",{children:["(",I("canvasError.canvasTooBigTip"),")"]})]}),nV=({appStateSnapshot:e,elementsSnapshot:t,files:n,actionManager:a,onExportImage:i,name:r})=>{let s=It(t,e),[l,c]=M.useState(r),[d,o]=M.useState(s),[u,h]=M.useState(e.exportBackground),[p,U]=M.useState(e.exportWithDarkMode),[m,g]=M.useState(e.exportEmbedScene),[b,v]=M.useState(e.exportScale),x=M.useRef(null),[y,E]=M.useState(null),{onCopy:S,copyStatus:w,resetCopyStatus:k}=QW();M.useEffect(()=>{k()},[l,u,p,b,m,k]);let{exportedElements:T,exportingFrame:_}=Sf(t,e,d);return M.useEffect(()=>{let j=x.current;if(!j)return;let A=j.offsetWidth,R=j.offsetHeight;A&&cc({elements:T,appState:{...e,name:l,exportBackground:u,exportWithDarkMode:p,exportScale:b,exportEmbedScene:m},files:n,exportPadding:dl,maxWidthOrHeight:Math.max(A,R),exportingFrame:_}).then(N=>(E(null),zo(N).then(()=>{j.replaceChildren(N)}).catch(O=>{throw O.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(I("canvasError.canvasTooBig")):O}))).catch(N=>{console.error(N),E(N)})},[e,n,T,_,l,u,p,b,m]),f.jsxs("div",{className:"ImageExportModal",children:[f.jsx("h3",{children:I("imageExportDialog.header")}),f.jsxs("div",{className:"ImageExportModal__preview",children:[f.jsx("div",{className:"ImageExportModal__preview__canvas",ref:x,children:y&&f.jsx(tV,{})}),f.jsx("div",{className:"ImageExportModal__preview__filename",children:!is&&f.jsx("input",{type:"text",className:"TextInput",value:l,style:{width:"30ch"},onChange:j=>{c(j.target.value),a.executeAction(ZH,"ui",j.target.value)}})})]}),f.jsxs("div",{className:"ImageExportModal__settings",children:[f.jsx("h3",{children:I("imageExportDialog.header")}),s&&f.jsx(Dl,{label:I("imageExportDialog.label.onlySelected"),name:"exportOnlySelected",children:f.jsx(Yc,{name:"exportOnlySelected",checked:d,onChange:j=>{o(j)}})}),f.jsx(Dl,{label:I("imageExportDialog.label.withBackground"),name:"exportBackgroundSwitch",children:f.jsx(Yc,{name:"exportBackgroundSwitch",checked:u,onChange:j=>{h(j),a.executeAction(qH,"ui",j)}})}),eV&&f.jsx(Dl,{label:I("imageExportDialog.label.darkMode"),name:"exportDarkModeSwitch",children:f.jsx(Yc,{name:"exportDarkModeSwitch",checked:p,onChange:j=>{U(j),a.executeAction(JH,"ui",j)}})}),f.jsx(Dl,{label:I("imageExportDialog.label.embedScene"),tooltip:I("imageExportDialog.tooltip.embedScene"),name:"exportEmbedSwitch",children:f.jsx(Yc,{name:"exportEmbedSwitch",checked:m,onChange:j=>{g(j),a.executeAction(Yv,"ui",j)}})}),f.jsx(Dl,{label:I("imageExportDialog.label.scale"),name:"exportScale",children:f.jsx(Mx,{name:"exportScale",value:b,onChange:j=>{v(j),a.executeAction(KH,"ui",j)},choices:B0.map(j=>({value:j,label:`${j}×`}))})}),f.jsxs("div",{className:"ImageExportModal__settings__buttons",children:[f.jsx(mo,{className:"ImageExportModal__settings__buttons__button",label:I("imageExportDialog.title.exportToPng"),onClick:()=>i(eh.png,T,{exportingFrame:_}),icon:j2,children:I("imageExportDialog.button.exportToPng")}),f.jsx(mo,{className:"ImageExportModal__settings__buttons__button",label:I("imageExportDialog.title.exportToSvg"),onClick:()=>i(eh.svg,T,{exportingFrame:_}),icon:j2,children:I("imageExportDialog.button.exportToSvg")}),(Ap||ko)&&f.jsx(mo,{className:"ImageExportModal__settings__buttons__button",label:I("imageExportDialog.title.copyPngToClipboard"),status:w,onClick:async()=>{await i(eh.clipboard,T,{exportingFrame:_}),S()},icon:ep,children:I("imageExportDialog.button.copyPngToClipboard")})]})]})]})},Dl=({label:e,children:t,tooltip:n,name:a})=>f.jsxs("div",{className:"ImageExportModal__settings__setting",title:e,children:[f.jsxs("label",{htmlFor:a,className:"ImageExportModal__settings__setting__label",children:[e,n&&f.jsx(ns,{label:n,long:!0,children:YI})]}),f.jsx("div",{className:"ImageExportModal__settings__setting__content",children:t})]}),aV=({elements:e,appState:t,files:n,actionManager:a,onExportImage:i,onCloseRequest:r,name:s})=>{let[{appStateSnapshot:l,elementsSnapshot:c}]=M.useState(()=>({appStateSnapshot:ui(t),elementsSnapshot:ui(e)}));return f.jsx(ba,{onCloseRequest:r,size:"wide",title:!1,children:f.jsx(nV,{elementsSnapshot:c,appStateSnapshot:l,files:n,actionManager:a,onExportImage:i,name:s})})},Ix=({children:e,side:t,className:n})=>f.jsx("div",{className:ne("FixedSideContainer",`FixedSideContainer_side_${t}`,n),children:e}),Hs=100,Xs=100,b5=e=>{switch(e){case D.ARROW_UP:return"up";case D.ARROW_DOWN:return"down";case D.ARROW_RIGHT:return"right";case D.ARROW_LEFT:return"left";default:return"right"}},Tx=(e,t,n,a)=>{let i=[...n.values()].reduce((r,s)=>{var c;let l;if(ee(s)&&(l=s[e==="predecessors"?"startBinding":"endBinding"])&&((c=s[e==="predecessors"?"endBinding":"startBinding"])==null?void 0:c.elementId)===t.id){let d=n.get(l.elementId);if(!d)return r;nn(ha(d),"not an ExcalidrawBindableElement");let o=e==="predecessors"?s.points[s.points.length-1]:[0,0],u=x7(t,ja(t),[o[0]+s.x,o[1]+s.y]);r.push({relative:d,heading:u})}return r},[]);switch(a){case"up":return i.filter(r=>Ut(r.heading,gn)).map(r=>r.relative);case"down":return i.filter(r=>Ut(r.heading,$t)).map(r=>r.relative);case"right":return i.filter(r=>Ut(r.heading,ht)).map(r=>r.relative);case"left":return i.filter(r=>Ut(r.heading,mn)).map(r=>r.relative)}},S0=(e,t,n)=>Tx("successors",e,t,n),C0=(e,t,n)=>Tx("predecessors",e,t,n),iV=(e,t,n)=>{let a=Xs+e.width;if(n==="up"||n==="down"){let l=Hs+e.height,c=e.x,d=e.x+e.width;if(t.every(o=>o.x+o.width<c||o.x>d))return{x:0,y:l*(n==="up"?-1:1)}}else if(n==="right"||n==="left"){let l=e.y,c=e.y+e.height;if(t.every(d=>d.y+d.height<l||d.y>c))return{x:(Xs+e.width)*(n==="left"?-1:1),y:0}}if(n==="up"||n==="down"){let l=Hs+e.height,c=(t.length,l),d=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*a:t.length/2*a*-1;return n==="up"?{x:d,y:c*-1}:{x:d,y:c}}let i=Hs+e.height,r=(t.length,Xs+e.width),s=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*i:t.length/2*i*-1;return n==="left"?{x:r*-1,y:s}:{x:r,y:s}},rV=(e,t,n,a)=>{let i=S0(e,t,a),r=C0(e,t,a),s=iV(e,[...i,...r],a),l=Xa({type:e.type,x:e.x+s.x,y:e.y+s.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});nn(Fu(l),"not an ExcalidrawFlowchartNodeElement");let c=_x(e,l,t,a,n);return{nextNode:l,bindingArrow:c}},sV=(e,t,n,a,i)=>{let r=[];for(let s=0;s<i;s++){let l,c;if(a==="left"||a==="right"){let u=Hs*(i-1)+i*e.height,h=e.y+e.height/2-u/2,p=Xs+e.width;a==="left"&&(p*=-1),l=e.x+p;let U=(Hs+e.height)*s;c=h+U}else{let u=Xs*(i-1)+i*e.width,h=e.x+e.width/2-u/2,p=Hs+e.height;a==="up"&&(p*=-1),c=e.y+p;let U=(Xs+e.width)*s;l=h+U}let d=Xa({type:e.type,x:l,y:c,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});nn(Fu(d),"not an ExcalidrawFlowchartNodeElement");let o=_x(e,d,t,a,n);r.push(d),r.push(o)}return r},_x=(e,t,n,a,i)=>{let r,s;switch(a){case"up":{r=e.x+e.width/2,s=e.y-6;break}case"down":{r=e.x+e.width/2,s=e.y+e.height+6;break}case"right":{r=e.x+e.width+6,s=e.y+e.height/2;break}case"left":{r=e.x-6,s=e.y+e.height/2;break}}let l,c;switch(a){case"up":{l=t.x+t.width/2-r,c=t.y+t.height-s+6;break}case"down":{l=t.x+t.width/2-r,c=t.y-s-6;break}case"right":{l=t.x-r-6,c=t.y-s+t.height/2;break}case"left":{l=t.x+t.width-r+6,c=t.y-s+t.height/2;break}}let d=Up({type:"arrow",x:r,y:s,startArrowhead:null,endArrowhead:i.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[C(0,0),C(l,c)],elbowed:!0});Ba(d,e,"start",n),Ba(d,t,"end",n);let o=new Map;o.set(e.id,e),o.set(t.id,t),o.set(d.id,d),J.movePoints(d,[{index:1,point:d.points[1]}]);let u=Cp(d,Hn(new Map([...n.entries(),[e.id,e],[t.id,t],[d.id,d]])),{points:d.points});return{...d,...u}},lV=class{constructor(){L(this,"isExploring",!1),L(this,"sameLevelNodes",[]),L(this,"sameLevelIndex",0),L(this,"direction",null),L(this,"visitedNodes",new Set)}clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(e,t,n){if(!ha(e))return null;if(n!==this.direction&&this.clear(),this.visitedNodes.has(e.id)||this.visitedNodes.add(e.id),this.isExploring&&n===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let a=[...S0(e,t,n),...C0(e,t,n)];if(a.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=a,this.direction=n,this.visitedNodes.add(a[0].id),a[0].id;if(n===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(e.id);let i=["up","right","down","left"].filter(r=>r!==n).map(r=>[...S0(e,t,r),...C0(e,t,r)]).flat().filter(r=>!this.visitedNodes.has(r.id));for(let r of i)if(!this.visitedNodes.has(r.id))return this.visitedNodes.add(r.id),this.isExploring=!0,this.direction=n,r.id}return null}},oV=class{constructor(){L(this,"isCreatingChart",!1),L(this,"numberOfNodes",0),L(this,"direction","right"),L(this,"pendingNodes",null)}createNodes(e,t,n,a){if(a!==this.direction){let{nextNode:i,bindingArrow:r}=rV(e,t,n,a);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=a,this.pendingNodes=[i,r]}else{this.numberOfNodes+=1;let i=sV(e,t,n,a,this.numberOfNodes);this.isCreatingChart=!0,this.direction=a,this.pendingNodes=i}if(e.frameId){let i=t.get(e.frameId);nn(i&&E8(i),"not an ExcalidrawFrameElement"),i&&this.pendingNodes.every(r=>dc([r],i,t)||nr(r,i,t))&&(this.pendingNodes=this.pendingNodes.map(r=>G(r,{frameId:e.frameId},!1)))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},cV=(e,t)=>{var n,a;for(let[,i]of t)if(i.type==="arrow"&&(((n=i.startBinding)==null?void 0:n.elementId)===e.id||((a=i.endBinding)==null?void 0:a.elementId)===e.id))return!0;return!1},dV=({appState:e,isMobile:t,device:n,app:a})=>{var o,u;let{activeTool:i,isResizing:r,isRotating:s,lastPointerDownWith:l}=e,c=e.multiElement!==null;if(((o=e.openSidebar)==null?void 0:o.name)===oa.name&&e.openSidebar.tab===Ns&&((u=e.searchMatches)!=null&&u.length))return I("hints.dismissSearch");if(e.openSidebar&&!n.editor.canFitSidebar)return null;if(Ia(e))return I("hints.eraserRevert");if(i.type==="arrow"||i.type==="line")return c?I("hints.linearElementMulti"):i.type==="arrow"?I("hints.arrowTool",{arrowShortcut:V("A")}):I("hints.linearElement");if(i.type==="freedraw")return I("hints.freeDraw");if(i.type==="text")return I("hints.text");if(i.type==="embeddable")return I("hints.embeddable");if(e.activeTool.type==="image"&&e.pendingImageElementId)return I("hints.placeImage");let d=a.scene.getSelectedElements(e);if(r&&l==="mouse"&&d.length===1){let h=d[0];return fe(h)&&h.points.length===2?I("hints.lockAngle"):Ne(h)?I("hints.resizeImage"):I("hints.resize")}if(s&&l==="mouse")return I("hints.rotate");if(d.length===1&&q(d[0]))return I("hints.text_selected");if(e.editingTextElement)return I("hints.text_editing");if(e.croppingElementId)return I("hints.leaveCropEditor");if(d.length===1&&Ne(d[0]))return I("hints.enterCropEditor");if(i.type==="selection"){if(e.selectionElement&&!d.length&&!e.editingTextElement&&!e.editingLinearElement)return I("hints.deepBoxSelect");if(No(a)&&e.selectedElementsAreBeingDragged)return I("hints.disableSnapping");if(!d.length&&!t)return I("hints.canvasPanning");if(d.length===1){if(fe(d[0]))return e.editingLinearElement?e.editingLinearElement.selectedPointsIndices?I("hints.lineEditor_pointSelected"):I("hints.lineEditor_nothingSelected"):I("hints.lineEditor_info");if(!e.newElement&&!e.selectedElementsAreBeingDragged&&Dr(d[0]))return Fu(d[0])?cV(d[0],a.scene.getNonDeletedElementsMap())?[I("hints.bindTextToElement"),I("hints.createFlowchart")]:[I("hints.bindTextToElement"),I("hints.createFlowchart")]:I("hints.bindTextToElement")}}return null},jx=({appState:e,isMobile:t,device:n,app:a})=>{let i=dV({appState:e,isMobile:t,device:n,app:a});if(!i)return null;let r=Array.isArray(i)?i.map(s=>V(s).replace(/\. ?$/,"")).join(". "):V(i);return f.jsx("div",{className:"HintViewer",children:f.jsx("span",{children:r})})},uV="medium",v5={CHECKED:q0,UNCHECKED:zu},Ax=e=>f.jsxs("label",{className:ne("ToolIcon ToolIcon__lock",`ToolIcon_size_${uV}`,{"is-mobile":e.isMobile}),title:`${e.title} — Q`,children:[f.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-lock"}),f.jsx("div",{className:"ToolIcon__icon",children:e.checked?v5.CHECKED:v5.UNCHECKED})]}),Vo=({heading:e,children:t,...n})=>{let{id:a}=qa(),i=f.jsx("h2",{className:"visually-hidden",id:`${a}-${e}-title`,children:I(`headings.${e}`)});return f.jsx("section",{...n,"aria-labelledby":`${a}-${e}-title`,children:typeof t=="function"?t(i):f.jsxs(f.Fragment,{children:[i,t]})})},_a=4,Xi=6,fV="rgba(0,0,0,0.3)",hV=(e,t,n,a)=>{if(!e.length)return{horizontal:null,vertical:null};let[i,r,s,l]=$e(e),c=t/a.zoom.value,d=n/a.zoom.value,o=t-c,u=n-d,h={top:parseInt(Ac("sat"))||0,bottom:parseInt(Ac("sab"))||0,left:parseInt(Ac("sal"))||0,right:parseInt(Ac("sar"))||0},p=Xo().rtl,U=-a.scrollX+o/2+h.left,m=-a.scrollY+u/2+h.top,g=U+c-h.right,b=m+d-h.bottom,v=Math.min(i,U),x=Math.min(r,m),y=Math.max(s,g),E=Math.max(l,b);return{horizontal:U===v&&g===y?null:{x:Math.max(h.left,_a)+(U-v)/(y-v)*t,y:n-Xi-Math.max(_a,h.bottom),width:(g-U)/(y-v)*t-Math.max(_a*2,h.left+h.right),height:Xi},vertical:m===x&&b===E?null:{x:p?Math.max(h.left,_a):t-Xi-Math.max(h.right,_a),y:(m-x)/(E-x)*n+Math.max(h.top,_a),width:Xi,height:(b-m)/(E-x)*n-Math.max(_a*2,h.top+h.bottom)}}},x5=(e,t,n)=>{let[a,i]=[e.horizontal,e.vertical].map(r=>r!=null&&r.x<=t&&t<=r.x+r.width&&r.y<=n&&n<=r.y+r.height);return{isOverEither:a||i,isOverHorizontal:a,isOverVertical:i}},pV="medium",Rx=e=>e.penDetected?f.jsxs("label",{className:ne("ToolIcon ToolIcon__penMode",`ToolIcon_size_${pV}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[f.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),f.jsx("div",{className:"ToolIcon__icon",children:VM})]}):null,Lx=e=>f.jsx(Me,{className:ne("Shape",{fillable:!1}),type:"radio",icon:F8,name:"editor-current-shape",checked:e.checked,title:`${e.title} — H`,keyBindingLabel:e.isMobile?void 0:D.H.toLocaleUpperCase(),"aria-label":`${e.title} — H`,"aria-keyshortcuts":D.H,"data-testid":"toolbar-hand",onChange:()=>{var t;return(t=e.onChange)==null?void 0:t.call(e)}}),UV=({appState:e,elements:t,actionManager:n,setAppState:a,onLockToggle:i,onHandToolToggle:r,onPenModeToggle:s,renderTopRightUI:l,renderCustomStats:c,renderSidebars:d,device:o,renderWelcomeScreen:u,UIOptions:h,app:p})=>{var x,y;let{WelcomeScreenCenterTunnel:U,MainMenuTunnel:m,DefaultSidebarTriggerTunnel:g}=un(),b=()=>f.jsxs(Ix,{side:"top",className:"App-top-bar",children:[u&&f.jsx(U.Out,{}),f.jsx(Vo,{heading:"shapes",children:E=>{var S;return f.jsx(On.Col,{gap:4,align:"center",children:f.jsxs(On.Row,{gap:1,className:"App-toolbar-container",children:[f.jsxs(ua,{padding:1,className:"App-toolbar App-toolbar--mobile",children:[E,f.jsx(On.Row,{gap:1,children:f.jsx(xx,{appState:e,activeTool:e.activeTool,UIOptions:h,app:p})})]}),l&&l(!0,e),f.jsxs("div",{className:"mobile-misc-tools-container",children:[!e.viewModeEnabled&&((S=e.openDialog)==null?void 0:S.name)!=="elementLinkSelector"&&f.jsx(g.Out,{}),f.jsx(Rx,{checked:e.penMode,onChange:()=>s(null),title:I("toolBar.penMode"),isMobile:!0,penDetected:e.penDetected}),f.jsx(Ax,{checked:e.activeTool.locked,onChange:i,title:I("toolBar.lock"),isMobile:!0}),f.jsx(Lx,{checked:Gs(e),onChange:()=>r(),title:I("toolBar.hand"),isMobile:!0})]})]})})}}),f.jsx(jx,{appState:e,isMobile:!0,device:o,app:p})]}),v=()=>{var E;return e.viewModeEnabled||((E=e.openDialog)==null?void 0:E.name)==="elementLinkSelector"?f.jsx("div",{className:"App-toolbar-content",children:f.jsx(m.Out,{})}):f.jsxs("div",{className:"App-toolbar-content",children:[f.jsx(m.Out,{}),n.renderAction("toggleEditMenu"),n.renderAction(e.multiElement?"finalize":"duplicateSelection"),n.renderAction("deleteSelectedElements"),f.jsxs("div",{children:[n.renderAction("undo"),n.renderAction("redo")]})]})};return f.jsxs(f.Fragment,{children:[d(),!e.viewModeEnabled&&((x=e.openDialog)==null?void 0:x.name)!=="elementLinkSelector"&&b(),f.jsx("div",{className:"App-bottom-bar",style:{marginBottom:Xi+_a*2,marginLeft:Xi+_a*2,marginRight:Xi+_a*2},children:f.jsxs(ua,{padding:0,children:[e.openMenu==="shape"&&!e.viewModeEnabled&&((y=e.openDialog)==null?void 0:y.name)!=="elementLinkSelector"&&Xp(e,t)?f.jsx(Vo,{className:"App-mobile-menu",heading:"selectedShapeActions",children:f.jsx(vx,{appState:e,elementsMap:p.scene.getNonDeletedElementsMap(),renderAction:n.renderAction,app:p})}):null,f.jsxs("footer",{className:"App-toolbar",children:[v(),e.scrolledOutside&&!e.openMenu&&!e.openSidebar&&f.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{a(E=>({...Do(t,E)}))},children:I("buttons.scrollBackToContent")})]})]})})]})},y5=e=>{let t=M.useRef(null),[n,a]=M.useState(null);return M.useLayoutEffect(()=>{if(!e.spreadsheet)return;let i=rN(e.chartType,e.spreadsheet,0,0);a(i);let r,s=t.current;return(async()=>{var l;return r=await wp(i,{exportBackground:!1,viewBackgroundColor:Ft.white},null,{skipInliningFonts:!0}),(l=r.querySelector(".style-fonts"))==null||l.remove(),s.replaceChildren(),s.appendChild(r),e.selected&&s.parentNode.focus()})(),()=>{s.replaceChildren()}},[e.spreadsheet,e.chartType,e.selected]),f.jsx("button",{type:"button",className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:f.jsx("div",{ref:t})})},mV=({setAppState:e,appState:t,onClose:n})=>{let{onInsertElements:a}=va(),i=M.useCallback(()=>{n&&n()},[n]),r=(s,l)=>{a(l),Qe("paste","chart",s),e({currentChartType:s,pasteDialog:{shown:!1,data:null}})};return f.jsx(ba,{size:"small",onCloseRequest:i,title:I("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:f.jsxs("div",{className:"container",children:[f.jsx(y5,{chartType:"bar",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="bar",onClick:r}),f.jsx(y5,{chartType:"line",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="line",onClick:r})]})})},gV=()=>f.jsxs("div",{className:"HelpDialog__header",children:[f.jsxs("a",{className:"HelpDialog__btn",href:"https://docs.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:[f.jsx("div",{className:"HelpDialog__link-icon",children:m2}),I("helpDialog.documentation")]}),f.jsxs("a",{className:"HelpDialog__btn",href:"https://plus.excalidraw.com/blog",target:"_blank",rel:"noopener noreferrer",children:[f.jsx("div",{className:"HelpDialog__link-icon",children:m2}),I("helpDialog.blog")]}),f.jsxs("a",{className:"HelpDialog__btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:[f.jsx("div",{className:"HelpDialog__link-icon",children:R8}),I("helpDialog.github")]}),f.jsxs("a",{className:"HelpDialog__btn",href:"https://youtube.com/@excalidraw",target:"_blank",rel:"noopener noreferrer",children:[f.jsx("div",{className:"HelpDialog__link-icon",children:UT}),"YouTube"]})]}),bV=e=>f.jsxs(f.Fragment,{children:[f.jsx("h3",{children:e.title}),f.jsx("div",{className:"HelpDialog__islands-container",children:e.children})]}),Xh=e=>f.jsxs("div",{className:`HelpDialog__island ${e.className}`,children:[f.jsx("h4",{className:"HelpDialog__island-title",children:e.caption}),f.jsx("div",{className:"HelpDialog__island-content",children:e.children})]});function*vV(e,t){let n=!0;for(let a of e)n||(yield t),n=!1,yield a}var xV=e=>e.replace(/\b[a-z]\b/,t=>t.toUpperCase()),te=({label:e,shortcuts:t,isOr:n=!0})=>{let a=t.map(i=>(i.endsWith("++")?[...i.slice(0,-2).split("+"),"+"]:i.split("+")).map(r=>f.jsx(yV,{children:xV(r)},r)));return f.jsxs("div",{className:"HelpDialog__shortcut",children:[f.jsx("div",{children:e}),f.jsx("div",{className:"HelpDialog__key-container",children:[...vV(a,n?I("helpDialog.or"):null)]})]})},yV=e=>f.jsx("kbd",{className:"HelpDialog__key",...e}),wV=({onClose:e})=>{let t=M.useCallback(()=>{e&&e()},[e]);return f.jsx(f.Fragment,{children:f.jsxs(ba,{onCloseRequest:t,title:I("helpDialog.title"),className:"HelpDialog",children:[f.jsx(gV,{}),f.jsxs(bV,{title:I("helpDialog.shortcuts"),children:[f.jsxs(Xh,{className:"HelpDialog__island--tools",caption:I("helpDialog.tools"),children:[f.jsx(te,{label:I("toolBar.hand"),shortcuts:[D.H]}),f.jsx(te,{label:I("toolBar.selection"),shortcuts:[D.V,D[1]]}),f.jsx(te,{label:I("toolBar.rectangle"),shortcuts:[D.R,D[2]]}),f.jsx(te,{label:I("toolBar.diamond"),shortcuts:[D.D,D[3]]}),f.jsx(te,{label:I("toolBar.ellipse"),shortcuts:[D.O,D[4]]}),f.jsx(te,{label:I("toolBar.arrow"),shortcuts:[D.A,D[5]]}),f.jsx(te,{label:I("toolBar.line"),shortcuts:[D.L,D[6]]}),f.jsx(te,{label:I("toolBar.freedraw"),shortcuts:[D.P,D[7]]}),f.jsx(te,{label:I("toolBar.text"),shortcuts:[D.T,D[8]]}),f.jsx(te,{label:I("toolBar.image"),shortcuts:[D[9]]}),f.jsx(te,{label:I("toolBar.eraser"),shortcuts:[D.E,D[0]]}),f.jsx(te,{label:I("toolBar.frame"),shortcuts:[D.F]}),f.jsx(te,{label:I("toolBar.laser"),shortcuts:[D.K]}),f.jsx(te,{label:I("labels.eyeDropper"),shortcuts:[D.I,"Shift+S","Shift+G"]}),f.jsx(te,{label:I("helpDialog.editLineArrowPoints"),shortcuts:[V("CtrlOrCmd+Enter")]}),f.jsx(te,{label:I("helpDialog.editText"),shortcuts:[V("Enter")]}),f.jsx(te,{label:I("helpDialog.textNewLine"),shortcuts:[V("Enter"),V("Shift+Enter")]}),f.jsx(te,{label:I("helpDialog.textFinish"),shortcuts:[V("Esc"),V("CtrlOrCmd+Enter")]}),f.jsx(te,{label:I("helpDialog.curvedArrow"),shortcuts:["A",I("helpDialog.click"),I("helpDialog.click"),I("helpDialog.click")],isOr:!1}),f.jsx(te,{label:I("helpDialog.curvedLine"),shortcuts:["L",I("helpDialog.click"),I("helpDialog.click"),I("helpDialog.click")],isOr:!1}),f.jsx(te,{label:I("helpDialog.cropStart"),shortcuts:[I("helpDialog.doubleClick"),V("Enter")],isOr:!0}),f.jsx(te,{label:I("helpDialog.cropFinish"),shortcuts:[V("Enter"),V("Escape")],isOr:!0}),f.jsx(te,{label:I("toolBar.lock"),shortcuts:[D.Q]}),f.jsx(te,{label:I("helpDialog.preventBinding"),shortcuts:[V("CtrlOrCmd")]}),f.jsx(te,{label:I("toolBar.link"),shortcuts:[V("CtrlOrCmd+K")]})]}),f.jsxs(Xh,{className:"HelpDialog__island--view",caption:I("helpDialog.view"),children:[f.jsx(te,{label:I("buttons.zoomIn"),shortcuts:[V("CtrlOrCmd++")]}),f.jsx(te,{label:I("buttons.zoomOut"),shortcuts:[V("CtrlOrCmd+-")]}),f.jsx(te,{label:I("buttons.resetZoom"),shortcuts:[V("CtrlOrCmd+0")]}),f.jsx(te,{label:I("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),f.jsx(te,{label:I("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),f.jsx(te,{label:I("helpDialog.movePageUpDown"),shortcuts:["PgUp/PgDn"]}),f.jsx(te,{label:I("helpDialog.movePageLeftRight"),shortcuts:["Shift+PgUp/PgDn"]}),f.jsx(te,{label:I("buttons.zenMode"),shortcuts:[V("Alt+Z")]}),f.jsx(te,{label:I("buttons.objectsSnapMode"),shortcuts:[V("Alt+S")]}),f.jsx(te,{label:I("labels.toggleGrid"),shortcuts:[V("CtrlOrCmd+'")]}),f.jsx(te,{label:I("labels.viewMode"),shortcuts:[V("Alt+R")]}),f.jsx(te,{label:I("labels.toggleTheme"),shortcuts:[V("Alt+Shift+D")]}),f.jsx(te,{label:I("stats.fullTitle"),shortcuts:[V("Alt+/")]}),f.jsx(te,{label:I("search.title"),shortcuts:[tn("searchMenu")]}),f.jsx(te,{label:I("commandPalette.title"),shortcuts:ko?[tn("commandPalette")]:[tn("commandPalette"),tn("commandPalette",1)]})]}),f.jsxs(Xh,{className:"HelpDialog__island--editor",caption:I("helpDialog.editor"),children:[f.jsx(te,{label:I("helpDialog.createFlowchart"),shortcuts:[V("CtrlOrCmd+Arrow Key")],isOr:!0}),f.jsx(te,{label:I("helpDialog.navigateFlowchart"),shortcuts:[V("Alt+Arrow Key")],isOr:!0}),f.jsx(te,{label:I("labels.moveCanvas"),shortcuts:[V(`Space+${I("helpDialog.drag")}`),V(`Wheel+${I("helpDialog.drag")}`)],isOr:!0}),f.jsx(te,{label:I("buttons.clearReset"),shortcuts:[V("CtrlOrCmd+Delete")]}),f.jsx(te,{label:I("labels.delete"),shortcuts:[V("Delete")]}),f.jsx(te,{label:I("labels.cut"),shortcuts:[V("CtrlOrCmd+X")]}),f.jsx(te,{label:I("labels.copy"),shortcuts:[V("CtrlOrCmd+C")]}),f.jsx(te,{label:I("labels.paste"),shortcuts:[V("CtrlOrCmd+V")]}),f.jsx(te,{label:I("labels.pasteAsPlaintext"),shortcuts:[V("CtrlOrCmd+Shift+V")]}),f.jsx(te,{label:I("labels.selectAll"),shortcuts:[V("CtrlOrCmd+A")]}),f.jsx(te,{label:I("labels.multiSelect"),shortcuts:[V(`Shift+${I("helpDialog.click")}`)]}),f.jsx(te,{label:I("helpDialog.deepSelect"),shortcuts:[V(`CtrlOrCmd+${I("helpDialog.click")}`)]}),f.jsx(te,{label:I("helpDialog.deepBoxSelect"),shortcuts:[V(`CtrlOrCmd+${I("helpDialog.drag")}`)]}),(Ap||ko)&&f.jsx(te,{label:I("labels.copyAsPng"),shortcuts:[V("Shift+Alt+C")]}),f.jsx(te,{label:I("labels.copyStyles"),shortcuts:[V("CtrlOrCmd+Alt+C")]}),f.jsx(te,{label:I("labels.pasteStyles"),shortcuts:[V("CtrlOrCmd+Alt+V")]}),f.jsx(te,{label:I("labels.sendToBack"),shortcuts:[V(Fa?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),f.jsx(te,{label:I("labels.bringToFront"),shortcuts:[V(Fa?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),f.jsx(te,{label:I("labels.sendBackward"),shortcuts:[V("CtrlOrCmd+[")]}),f.jsx(te,{label:I("labels.bringForward"),shortcuts:[V("CtrlOrCmd+]")]}),f.jsx(te,{label:I("labels.alignTop"),shortcuts:[V("CtrlOrCmd+Shift+Up")]}),f.jsx(te,{label:I("labels.alignBottom"),shortcuts:[V("CtrlOrCmd+Shift+Down")]}),f.jsx(te,{label:I("labels.alignLeft"),shortcuts:[V("CtrlOrCmd+Shift+Left")]}),f.jsx(te,{label:I("labels.alignRight"),shortcuts:[V("CtrlOrCmd+Shift+Right")]}),f.jsx(te,{label:I("labels.duplicateSelection"),shortcuts:[V("CtrlOrCmd+D"),V(`Alt+${I("helpDialog.drag")}`)]}),f.jsx(te,{label:I("helpDialog.toggleElementLock"),shortcuts:[V("CtrlOrCmd+Shift+L")]}),f.jsx(te,{label:I("buttons.undo"),shortcuts:[V("CtrlOrCmd+Z")]}),f.jsx(te,{label:I("buttons.redo"),shortcuts:Qb?[V("CtrlOrCmd+Y"),V("CtrlOrCmd+Shift+Z")]:[V("CtrlOrCmd+Shift+Z")]}),f.jsx(te,{label:I("labels.group"),shortcuts:[V("CtrlOrCmd+G")]}),f.jsx(te,{label:I("labels.ungroup"),shortcuts:[V("CtrlOrCmd+Shift+G")]}),f.jsx(te,{label:I("labels.flipHorizontal"),shortcuts:[V("Shift+H")]}),f.jsx(te,{label:I("labels.flipVertical"),shortcuts:[V("Shift+V")]}),f.jsx(te,{label:I("labels.showStroke"),shortcuts:[V("S")]}),f.jsx(te,{label:I("labels.showBackground"),shortcuts:[V("G")]}),f.jsx(te,{label:I("labels.showFonts"),shortcuts:[V("Shift+F")]}),f.jsx(te,{label:I("labels.decreaseFontSize"),shortcuts:[V("CtrlOrCmd+Shift+<")]}),f.jsx(te,{label:I("labels.increaseFontSize"),shortcuts:[V("CtrlOrCmd+Shift+>")]})]})]})]})})},EV=4,SV=8,CV=({shouldWrap:e,children:t,username:n})=>e?f.jsx(ns,{label:n||"Unknown user",children:t}):f.jsx(f.Fragment,{children:t}),Wh=({actionManager:e,collaborator:t,socketId:n,withName:a=!1,shouldWrapWithTooltip:i=!1,isBeingFollowed:r})=>{let s={socketId:n,collaborator:t,withName:a,isBeingFollowed:r},l=e.renderAction("goToCollaborator",s);return f.jsx(CV,{username:t.username,shouldWrap:i,children:l},n)},kV=["avatarUrl","id","socketId","username","isInCall","isSpeaking","isMuted"],Dx=M.memo(({className:e,mobile:t,collaborators:n,userToFollow:a})=>{let i=En(),r=new Map;n.forEach((U,m)=>{let g=U.id||m;r.set(g,{...U,socketId:m})});let s=Array.from(r.values()).filter(U=>{var m;return(m=U.username)==null?void 0:m.trim()}),[l,c]=M.useState(""),d=s.filter(U=>{var m;return(m=U.username)==null?void 0:m.toLowerCase().includes(l)}),o=M.useRef(null);M.useLayoutEffect(()=>{if(o.current){let U=g=>{let b=Math.max(1,Math.min(8,Math.floor(g/38)));h(b)};if(U(o.current.clientWidth),!m1)return;let m=new ResizeObserver(g=>{for(let b of g){let{width:v}=b.contentRect;U(v)}});return m.observe(o.current),()=>{m.disconnect()}}},[]);let[u,h]=M.useState(EV),p=s.slice(0,u-1).map(U=>Wh({actionManager:i,collaborator:U,socketId:U.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:U.socketId===a}));return t?f.jsx("div",{className:ne("UserList UserList_mobile",e),children:s.map(U=>Wh({actionManager:i,collaborator:U,socketId:U.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:U.socketId===a}))}):f.jsx("div",{className:"UserList__wrapper",ref:o,children:f.jsxs("div",{className:ne("UserList",e),style:{"--max-avatars":u},children:[p,s.length>u-1&&f.jsxs(pf,{children:[f.jsxs(Uf,{className:"UserList__more",children:["+",s.length-u+1]}),f.jsx(dU,{style:{zIndex:2,width:"15rem",textAlign:"left"},align:"end",sideOffset:10,children:f.jsxs(ua,{padding:2,children:[s.length>=SV&&f.jsx(Nv,{placeholder:I("quickSearch.placeholder"),onChange:c}),f.jsx(Ov,{className:"dropdown-menu UserList__collaborators",placeholder:I("userList.empty"),children:d.length>0?[f.jsx("div",{className:"hint",children:I("userList.hint.text")}),d.map(U=>Wh({actionManager:i,collaborator:U,socketId:U.socketId,withName:!0,isBeingFollowed:U.socketId===a}))]:[]}),f.jsx(q9,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})]})]})})},(e,t)=>{if(e.collaborators.size!==t.collaborators.size||e.mobile!==t.mobile||e.className!==t.className||e.userToFollow!==t.userToFollow)return!1;let n=t.collaborators.keys();for(let[a,i]of e.collaborators){let r=t.collaborators.get(a);if(!r||a!==n.next().value||!Vt(i,r,kV))return!1}return!0}),w5=({children:e,color:t})=>f.jsx("div",{className:"Card",style:{"--card-color":t==="primary"?"var(--color-primary)":Ft[t][7],"--card-color-darker":t==="primary"?"var(--color-primary-darker)":Ft[t][8],"--card-color-darkest":t==="primary"?"var(--color-primary-darkest)":Ft[t][9]},children:e}),MV=({elements:e,appState:t,setAppState:n,files:a,actionManager:i,exportOpts:r,canvas:s,onCloseRequest:l})=>{let{onExportToBackend:c}=r;return f.jsx("div",{className:"ExportDialog ExportDialog--json",children:f.jsxs("div",{className:"ExportDialog-cards",children:[r.saveFileToDisk&&f.jsxs(w5,{color:"lime",children:[f.jsx("div",{className:"Card-icon",children:iI}),f.jsx("h2",{children:I("exportDialog.disk_title")}),f.jsxs("div",{className:"Card-details",children:[I("exportDialog.disk_details"),!is&&i.renderAction("changeProjectName")]}),f.jsx(Me,{className:"Card-button",type:"button",title:I("exportDialog.disk_button"),"aria-label":I("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(Zv,"ui")}})]}),c&&f.jsxs(w5,{color:"pink",children:[f.jsx("div",{className:"Card-icon",children:M1}),f.jsx("h2",{children:I("exportDialog.link_title")}),f.jsx("div",{className:"Card-details",children:I("exportDialog.link_details")}),f.jsx(Me,{className:"Card-button",type:"button",title:I("exportDialog.link_button"),"aria-label":I("exportDialog.link_button"),showAriaLabel:!0,onClick:async()=>{try{Qe("export","link",`ui (${cM()})`),await c(e,t,a),l()}catch(d){n({errorMessage:d.message})}}})]}),r.renderCustomUI&&r.renderCustomUI(e,t,a,s)]})})},IV=({elements:e,appState:t,files:n,actionManager:a,exportOpts:i,canvas:r,setAppState:s})=>{var c;let l=M.useCallback(()=>{s({openDialog:null})},[s]);return f.jsx(f.Fragment,{children:((c=t.openDialog)==null?void 0:c.name)==="jsonExport"&&f.jsx(ba,{onCloseRequest:l,title:I("buttons.export"),children:f.jsx(MV,{elements:e,appState:t,setAppState:s,files:n,actionManager:a,onCloseRequest:l,exportOpts:i,canvas:r})})})},TV=e=>f.jsx("button",{className:"help-icon",onClick:e.onClick,type:"button",title:`${I("helpDialog.title")} — ?`,"aria-label":I("helpDialog.title"),children:J0}),Px=({appState:e,actionManager:t,showExitZenModeBtn:n,renderWelcomeScreen:a})=>{let{FooterCenterTunnel:i,WelcomeScreenHelpHintTunnel:r}=un(),s=Tt(),l=!e.viewModeEnabled&&e.multiElement&&s.isTouchScreen;return f.jsxs("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[f.jsx("div",{className:ne("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled}),children:f.jsx(On.Col,{gap:2,children:f.jsxs(Vo,{heading:"canvasActions",children:[f.jsx(RW,{renderAction:t.renderAction,zoom:e.zoom}),!e.viewModeEnabled&&f.jsx(LW,{renderAction:t.renderAction,className:ne("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":e.zenModeEnabled})}),l&&f.jsx(PW,{renderAction:t.renderAction,className:ne("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled})})]})})}),f.jsx(i.Out,{}),f.jsx("div",{className:ne("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right":e.zenModeEnabled}),children:f.jsxs("div",{style:{position:"relative"},children:[a&&f.jsx(r.Out,{}),f.jsx(TV,{onClick:()=>t.executeAction(yU)})]})}),f.jsx(DW,{actionManager:t,showExitZenModeBtn:n})]})},_V=Px;Px.displayName="Footer";var Nx=M.createContext({}),Ox=({children:e,className:t})=>{let n=Tt(),a=M.useContext(Nx),i=!!(n.editor.canFitSidebar&&a.shouldRenderDockButton);return f.jsxs("div",{className:ne("sidebar__header",t),"data-testid":"sidebar-header",children:[e,f.jsxs("div",{className:"sidebar__header__buttons",children:[i&&f.jsx(ns,{label:I("labels.sidebarLock"),children:f.jsx(sr,{onSelect:()=>{var r;return(r=a.onDock)==null?void 0:r.call(a,!a.docked)},selected:!!a.docked,className:"sidebar__dock","data-testid":"sidebar-dock","aria-label":I("labels.sidebarLock"),children:PM})}),f.jsx(sr,{"data-testid":"sidebar-close",className:"sidebar__close",onSelect:a.onCloseRequest,"aria-label":I("buttons.close"),children:hl})]})]})};Ox.displayName="SidebarHeader";var $x=({name:e,tab:t,icon:n,title:a,children:i,onToggle:r,className:s,style:l})=>{var o;let c=_t(),d=Yt();return f.jsxs("label",{title:a,className:"sidebar-trigger__label-element",children:[f.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",onChange:u=>{var p;(p=document.querySelector(".layer-ui__wrapper"))==null||p.classList.remove("animate");let h=u.target.checked;c({openSidebar:h?{name:e,tab:t}:null}),r==null||r(h)},checked:((o=d.openSidebar)==null?void 0:o.name)===e,"aria-label":a,"aria-keyshortcuts":"0"}),f.jsxs("div",{className:ne("sidebar-trigger",s),style:l,children:[n&&f.jsx("div",{children:n}),i&&f.jsx("div",{className:"sidebar-trigger__label",children:i})]})]})};$x.displayName="SidebarTrigger";var Fx=({children:e,...t})=>f.jsx(gv,{className:"sidebar-triggers",...t,children:e});Fx.displayName="SidebarTabTriggers";var zx=({children:e,tab:t,onSelect:n,...a})=>f.jsx(bv,{value:t,asChild:!0,onSelect:n,children:f.jsx("button",{type:"button",className:"excalidraw-button sidebar-tab-trigger",...a,children:e})});zx.displayName="SidebarTabTrigger";var Bx=({children:e,...t})=>{let n=Yt(),a=_t();if(!n.openSidebar)return null;let{name:i}=n.openSidebar;return f.jsx(mv,{className:"sidebar-tabs-root",value:n.openSidebar.tab,onValueChange:r=>a(s=>({...s,openSidebar:{...s.openSidebar,name:i,tab:r}})),...t,children:e})};Bx.displayName="SidebarTabs";var Hx=({tab:e,children:t,...n})=>f.jsx(vv,{...n,value:e,"data-testid":e,children:t});Hx.displayName="SidebarTab";var CU=Bt(!1),Xx=M.forwardRef(({name:e,children:t,onDock:n,docked:a,className:i,...r},s)=>{be.DEV&&n&&a==null&&console.warn("Sidebar: `docked` must be set when `onDock` is supplied for the sidebar to be user-dockable. To hide this message, either pass `docked` or remove `onDock`");let l=_t(),c=gf(CU);M.useLayoutEffect(()=>(c(!!a),()=>{c(!1)}),[c,a]);let d=M.useRef({});d.current.onCloseRequest=()=>{l({openSidebar:null})},d.current.onDock=p=>n==null?void 0:n(p),d.current=ld(d.current,{docked:a,shouldRenderDockButton:!!n&&a!=null});let o=M.useRef(null);M.useImperativeHandle(s,()=>o.current);let u=Tt(),h=M.useCallback(()=>{document.querySelector(".Dialog")||l({openSidebar:null})},[l]);return UU(o,M.useCallback(p=>{p.target.closest(".sidebar-trigger")||(!a||!u.editor.canFitSidebar)&&h()},[h,a,u.editor.canFitSidebar])),M.useEffect(()=>{let p=U=>{U.key===D.ESCAPE&&(!a||!u.editor.canFitSidebar)&&h()};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[h,a,u.editor.canFitSidebar]),f.jsx(ua,{...r,className:ne("sidebar",{"sidebar--docked":a},i),ref:o,children:f.jsx(Nx.Provider,{value:d.current,children:t})})});Xx.displayName="SidebarInner";var ea=Object.assign(M.forwardRef((e,t)=>{var l;let n=Yt(),{onStateChange:a}=e,i=M.useRef(n.openSidebar);M.useEffect(()=>{var c,d,o,u,h;(!n.openSidebar&&((c=i==null?void 0:i.current)==null?void 0:c.name)===e.name||((d=n.openSidebar)==null?void 0:d.name)===e.name&&((o=i==null?void 0:i.current)==null?void 0:o.name)!==e.name||((u=i.current)==null?void 0:u.name)===e.name)&&n.openSidebar!==i.current&&(a==null||a(((h=n.openSidebar)==null?void 0:h.name)!==e.name?null:n.openSidebar)),i.current=n.openSidebar},[n.openSidebar,a,e.name]);let[r,s]=M.useState(!1);return M.useLayoutEffect(()=>(s(!0),()=>s(!1)),[]),r&&((l=n.openSidebar)==null?void 0:l.name)===e.name?M.createElement(Xx,{...e,ref:t,key:e.name}):null}),{Header:Ox,TabTriggers:Fx,TabTrigger:zx,Tabs:Bx,Tab:Hx,Trigger:$x});ea.displayName="Sidebar";var Wx={};q5(Wx,{ChangeCanvasBackground:()=>ny,ClearCanvas:()=>ey,CommandPalette:()=>qx,Export:()=>ay,Help:()=>Qx,LiveCollaborationTrigger:()=>ry,LoadScene:()=>Yx,SaveAsImage:()=>Kx,SaveToActiveFile:()=>Zx,SearchMenu:()=>Jx,Socials:()=>iy,ToggleTheme:()=>ty});var Vx=Bt({active:!1});async function jV({title:e,description:t,actionLabel:n,color:a}){return new Promise(i=>{sa.set(Vx,{active:!0,onConfirm:()=>i(!0),onClose:()=>i(!1),onReject:()=>i(!1),title:e,description:t,actionLabel:n,color:a})})}var Gx=({value:e,shortcut:t,onChange:n,choices:a,children:i,name:r})=>{let s=Tt();return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"dropdown-menu-item-base dropdown-menu-item-bare",children:[f.jsx("label",{className:"dropdown-menu-item__text",htmlFor:r,children:i}),f.jsx(Mx,{name:r,value:e,onChange:n,choices:a})]}),t&&!s.editor.isMobile&&f.jsx("div",{className:"dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned",children:t})]})};Gx.displayName="DropdownMenuItemContentRadio";var AV=Gx,Yx=()=>{let{t:e}=Gt(),t=En(),n=Tf();return t.isActionEnabled(g0)?f.jsx(Gn,{icon:Q0,onSelect:async()=>{(!n.length||await jV({title:e("overwriteConfirm.modal.loadFromFile.title"),actionLabel:e("overwriteConfirm.modal.loadFromFile.button"),color:"warning",description:f.jsx(Na,{i18nKey:"overwriteConfirm.modal.loadFromFile.description",bold:a=>f.jsx("strong",{children:a}),br:()=>f.jsx("br",{})})}))&&t.executeAction(g0)},"data-testid":"load-button",shortcut:tn("loadScene"),"aria-label":e("buttons.load"),children:e("buttons.load")}):null};Yx.displayName="LoadScene";var Zx=()=>{let{t:e}=Gt(),t=En();return t.isActionEnabled(Z6)?f.jsx(Gn,{shortcut:tn("saveScene"),"data-testid":"save-button",onSelect:()=>t.executeAction(Z6),icon:tI,"aria-label":`${e("buttons.save")}`,children:`${e("buttons.save")}`}):null};Zx.displayName="SaveToActiveFile";var Kx=()=>{let e=_t(),{t}=Gt();return f.jsx(Gn,{icon:L8,"data-testid":"image-export-button",onSelect:()=>e({openDialog:{name:"imageExport"}}),shortcut:tn("imageExport"),"aria-label":t("buttons.exportImage"),children:t("buttons.exportImage")})};Kx.displayName="SaveAsImage";var qx=e=>{let t=_t(),{t:n}=Gt();return f.jsx(Gn,{icon:W8,"data-testid":"command-palette-button",onSelect:()=>{Qe("command_palette","open","menu"),t({openDialog:{name:"commandPalette"}})},shortcut:tn("commandPalette"),"aria-label":n("commandPalette.title"),className:e==null?void 0:e.className,children:n("commandPalette.title")})};qx.displayName="CommandPalette";var Jx=e=>{let{t}=Gt(),n=En();return f.jsx(Gn,{icon:Zr,"data-testid":"search-menu-button",onSelect:()=>{n.executeAction(Sx)},shortcut:tn("searchMenu"),"aria-label":t("search.title"),className:e==null?void 0:e.className,children:t("search.title")})};Jx.displayName="SearchMenu";var Qx=()=>{let{t:e}=Gt(),t=En();return f.jsx(Gn,{"data-testid":"help-menu-item",icon:J0,onSelect:()=>t.executeAction(yU),shortcut:"?","aria-label":e("helpDialog.title"),children:e("helpDialog.title")})};Qx.displayName="Help";var ey=()=>{let{t:e}=Gt(),t=gf(Mf);return En().isActionEnabled(ho)?f.jsx(Gn,{icon:Yr,onSelect:()=>t("clearCanvas"),"data-testid":"clear-canvas-button","aria-label":e("buttons.clearReset"),children:e("buttons.clearReset")}):null};ey.displayName="ClearCanvas";var ty=e=>{let{t}=Gt(),n=Yt(),a=En(),i=tn("toggleTheme");return a.isActionEnabled(xu)?e!=null&&e.allowSystemTheme?f.jsx(AV,{name:"theme",value:e.theme,onChange:r=>e.onSelect(r),choices:[{value:ke.LIGHT,label:k1,ariaLabel:`${t("buttons.lightMode")} - ${i}`},{value:ke.DARK,label:C1,ariaLabel:`${t("buttons.darkMode")} - ${i}`},{value:"system",label:pT,ariaLabel:t("buttons.systemMode")}],children:t("labels.theme")}):f.jsx(Gn,{onSelect:r=>{if(r.preventDefault(),e==null?void 0:e.onSelect)e.onSelect(n.theme===ke.DARK?ke.LIGHT:ke.DARK);else return a.executeAction(xu)},icon:n.theme===ke.DARK?k1:C1,"data-testid":"toggle-dark-mode",shortcut:i,"aria-label":n.theme===ke.DARK?t("buttons.lightMode"):t("buttons.darkMode"),children:n.theme===ke.DARK?t("buttons.lightMode"):t("buttons.darkMode")}):null};ty.displayName="ToggleTheme";var ny=()=>{let{t:e}=Gt(),t=Yt(),n=En(),a=mc();return t.viewModeEnabled||!a.UIOptions.canvasActions.changeViewBackgroundColor?null:f.jsxs("div",{style:{marginTop:"0.5rem"},children:[f.jsx("div",{"data-testid":"canvas-background-label",style:{fontSize:".75rem",marginBottom:".5rem"},children:e("labels.canvasBackground")}),f.jsx("div",{style:{padding:"0 0.625rem"},children:n.renderAction("changeViewBackgroundColor")})]})};ny.displayName="ChangeCanvasBackground";var ay=()=>{let{t:e}=Gt(),t=_t();return f.jsx(Gn,{icon:Bu,onSelect:()=>{t({openDialog:{name:"jsonExport"}})},"data-testid":"json-export-button","aria-label":e("buttons.export"),children:e("buttons.export")})};ay.displayName="Export";var iy=()=>{let{t:e}=Gt();return f.jsxs(f.Fragment,{children:[f.jsx(Id,{icon:R8,href:"https://github.com/excalidraw/excalidraw","aria-label":"GitHub",children:"GitHub"}),f.jsx(Id,{icon:QM,href:"https://x.com/excalidraw","aria-label":"X",children:e("labels.followUs")}),f.jsx(Id,{icon:JM,href:"https://discord.gg/UexuTaE","aria-label":"Discord",children:e("labels.discordChat")})]})};iy.displayName="Socials";var ry=({onSelect:e,isCollaborating:t})=>{let{t:n}=Gt();return f.jsx(Gn,{"data-testid":"collab-button",icon:N8,className:ne({"active-collab":t}),onSelect:e,children:n("labels.liveCollaboration")})};ry.displayName="LiveCollaborationTrigger";var pc=(e,t)=>{let n=Bt(0),a=i=>{let{tunnelsJotai:{useAtom:r}}=un(),[,s]=r(n),l=M.useRef({preferHost:!1,counter:0});return M.useLayoutEffect(()=>{let c=l.current;return s(d=>{let o=d+1;return c.counter=o,o}),()=>{s(d=>{let o=d-1;return c.counter=o,o||(c.preferHost=!1),o})}},[s]),i.__fallback||(l.current.preferHost=!0),!l.current.counter&&i.__fallback&&l.current.preferHost||l.current.counter>1&&i.__fallback?null:f.jsx(t,{...i})};return a.displayName=e,a},RV=Object.assign(pc("MainMenu",({children:e,onSelect:t})=>{var l;let{MainMenuTunnel:n}=un(),a=Tt(),i=Yt(),r=_t(),s=a.editor.isMobile?void 0:()=>r({openMenu:null});return f.jsx(n.In,{children:f.jsxs(et,{open:i.openMenu==="canvas",children:[f.jsx(et.Trigger,{onToggle:()=>{r({openMenu:i.openMenu==="canvas"?null:"canvas"})},"data-testid":"main-menu-trigger",className:"main-menu-trigger",children:A8}),f.jsxs(et.Content,{onClickOutside:s,onSelect:$u(t,()=>{r({openMenu:null})}),children:[e,a.editor.isMobile&&i.collaborators.size>0&&f.jsxs("fieldset",{className:"UserList-Wrapper",children:[f.jsx("legend",{children:I("labels.collaborators")}),f.jsx(Dx,{mobile:!0,collaborators:i.collaborators,userToFollow:((l=i.userToFollow)==null?void 0:l.socketId)||null})]})]})]})})}),{Trigger:et.Trigger,Item:et.Item,ItemLink:et.ItemLink,ItemCustom:et.ItemCustom,Group:et.Group,Separator:et.Separator,DefaultItems:Wx}),sn=RV,kU=({title:e,children:t,actionLabel:n,onClick:a})=>f.jsxs("div",{className:"OverwriteConfirm__Actions__Action",children:[f.jsx("h4",{children:e}),f.jsx("div",{className:"OverwriteConfirm__Actions__Action__content",children:t}),f.jsx(mo,{variant:"outlined",color:"muted",label:n,size:"large",fullWidth:!0,onClick:a})]}),LV=()=>{let{t:e}=Gt(),t=En(),n=_t();return f.jsx(kU,{title:e("overwriteConfirm.action.exportToImage.title"),actionLabel:e("overwriteConfirm.action.exportToImage.button"),onClick:()=>{t.executeAction(Yv,"ui",!0),n({openDialog:{name:"imageExport"}})},children:e("overwriteConfirm.action.exportToImage.description")})},DV=()=>{let{t:e}=Gt(),t=En();return f.jsx(kU,{title:e("overwriteConfirm.action.saveToDisk.title"),actionLabel:e("overwriteConfirm.action.saveToDisk.button"),onClick:()=>{t.executeAction(Zv,"ui")},children:e("overwriteConfirm.action.saveToDisk.description")})},E5=Object.assign(({children:e})=>f.jsx("div",{className:"OverwriteConfirm__Actions",children:e}),{ExportToImage:LV,SaveToDisk:DV}),Vh=Object.assign(pc("OverwriteConfirmDialog",({children:e})=>{let{OverwriteConfirmDialogTunnel:t}=un(),[n,a]=mt(Vx);if(!n.active)return null;let i=()=>{n.onClose(),a(s=>({...s,active:!1}))},r=()=>{n.onConfirm(),a(s=>({...s,active:!1}))};return f.jsx(t.In,{children:f.jsx(ba,{onCloseRequest:i,title:!1,size:916,children:f.jsxs("div",{className:"OverwriteConfirm",children:[f.jsx("h3",{children:n.title}),f.jsxs("div",{className:`OverwriteConfirm__Description OverwriteConfirm__Description--color-${n.color}`,children:[f.jsx("div",{className:"OverwriteConfirm__Description__icon",children:KI}),f.jsx("div",{children:n.description}),f.jsx("div",{className:"OverwriteConfirm__Description__spacer"}),f.jsx(mo,{color:n.color,size:"large",label:n.actionLabel,onClick:r})]}),f.jsx(E5,{children:e})]})})})}),{Actions:E5,Action:kU}),PV=Bt(""),sy=Bt(null),NV=350,OV=()=>{let e=va(),t=_t(),n=M.useRef(null),[a,i]=mt(PV),r=a.trim(),[s,l]=M.useState(!1),[c,d]=M.useState({nonce:null,items:[]}),o=M.useRef(null),u=M.useRef(void 0),[h,p]=mt(sy),U=e.scene.getNonDeletedElementsMap();M.useEffect(()=>{s||(r!==o.current||e.scene.getSceneNonce()!==u.current)&&(o.current=null,S5(r,e,(x,y)=>{d({nonce:Ha(),items:x}),o.current=r,u.current=e.scene.getSceneNonce(),t({searchMatches:x.map(E=>({id:E.textElement.id,focus:!1,matchedLines:E.matchedLines}))})}))},[s,r,U,e,t,p,u]);let m=()=>{c.items.length>0&&p(x=>x===null?0:(x+1)%c.items.length)},g=()=>{c.items.length>0&&p(x=>x===null?0:x-1<0?c.items.length-1:x-1)};M.useEffect(()=>{t(x=>({searchMatches:x.searchMatches.map((y,E)=>E===h?{...y,focus:!0}:{...y,focus:!1})}))},[h,t]),M.useEffect(()=>{var x,y,E,S;if(c.items.length>0&&h!==null){let w=c.items[h];if(w){let k=e.state.zoom.value,T=Tn({text:w.searchQuery,x:w.textElement.x+(((x=w.matchedLines[0])==null?void 0:x.offsetX)??0),y:w.textElement.y+(((y=w.matchedLines[0])==null?void 0:y.offsetY)??0),width:(E=w.matchedLines[0])==null?void 0:E.width,height:(S=w.matchedLines[0])==null?void 0:S.height,fontSize:w.textElement.fontSize,fontFamily:w.textElement.fontFamily}),_=14,j=w.textElement.fontSize,A=j*k<_;if(!xd([T],e.canvas.width/window.devicePixelRatio,e.canvas.height/window.devicePixelRatio,{offsetLeft:e.state.offsetLeft,offsetTop:e.state.offsetTop,scrollX:e.state.scrollX,scrollY:e.state.scrollY,zoom:e.state.zoom},e.scene.getNonDeletedElementsMap(),e.getEditorUIOffsets())||A){let R;A?j>=_?R={fitToContent:!0}:R={fitToViewport:!0,maxZoom:Oa(_/j,1)}:R={fitToContent:!0},e.scrollToContent(T,{animate:!0,duration:300,...R,canvasOffsets:e.getEditorUIOffsets()})}}}},[h,c,e]),M.useEffect(()=>()=>{p(null),o.current=null,u.current=void 0,t({searchMatches:[]}),l(!1)},[t,p]);let b=xf({goToNextItem:m,goToPreviousItem:g,searchMatches:c});M.useEffect(()=>st(window,"keydown",y=>{var E,S,w;if(y.key===D.ESCAPE&&!e.state.openDialog&&!e.state.openPopup){y.preventDefault(),y.stopPropagation(),t({openSidebar:null});return}y[D.CTRL_OR_CMD]&&y.key===D.F&&(y.preventDefault(),y.stopPropagation(),(E=n.current)!=null&&E.matches(":focus")?t({openSidebar:null}):(e.state.openDialog&&t({openDialog:null}),(S=n.current)==null||S.focus(),(w=n.current)==null||w.select())),y.target instanceof HTMLElement&&y.target.closest(".layer-ui__search")&&b.searchMatches.items.length&&(y.key===D.ENTER&&(y.stopPropagation(),b.goToNextItem()),y.key===D.ARROW_UP?(y.stopPropagation(),b.goToPreviousItem()):y.key===D.ARROW_DOWN&&(y.stopPropagation(),b.goToNextItem()))},{capture:!0,passive:!1}),[t,b,e]);let v=`${c.items.length} ${c.items.length===1?I("search.singleResult"):I("search.multipleResults")}`;return f.jsxs("div",{className:"layer-ui__search",children:[f.jsx("div",{className:"layer-ui__search-header",children:f.jsx(SU,{className:Ws.SEARCH_MENU_INPUT_WRAPPER,value:a,ref:n,placeholder:I("search.placeholder"),icon:Zr,onChange:x=>{i(x),l(!0);let y=x.trim();S5(y,e,(E,S)=>{d({nonce:Ha(),items:E}),p(S),o.current=y,u.current=e.scene.getSceneNonce(),t({searchMatches:E.map(w=>({id:w.textElement.id,focus:!1,matchedLines:w.matchedLines}))}),l(!1)})},selectOnRender:!0})}),f.jsxs("div",{className:"layer-ui__search-count",children:[c.items.length>0&&f.jsxs(f.Fragment,{children:[h!==null&&h>-1?f.jsxs("div",{children:[h+1," / ",v]}):f.jsx("div",{children:v}),f.jsxs("div",{className:"result-nav",children:[f.jsx(sr,{onSelect:()=>{m()},className:"result-nav-btn",children:G8}),f.jsx(sr,{onSelect:()=>{g()},className:"result-nav-btn",children:wT})]})]}),c.items.length===0&&r&&o.current&&f.jsx("div",{style:{margin:"1rem auto"},children:I("search.noMatch")})]}),f.jsx(BV,{matches:c,onItemClick:p,focusIndex:h,searchQuery:r})]})},$V=e=>{let t=[e.preview.moreBefore?"...":"",e.preview.previewText.slice(0,e.preview.indexInSearchQuery),e.preview.previewText.slice(e.preview.indexInSearchQuery,e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.previewText.slice(e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.moreAfter?"...":""];return f.jsx("div",{tabIndex:-1,className:ne("layer-ui__result-item",{active:e.highlighted}),onClick:e.onClick,ref:n=>{e.highlighted&&(n==null||n.scrollIntoView({behavior:"auto",block:"nearest"}))},children:f.jsx("div",{className:"preview-text",children:t.flatMap((n,a)=>f.jsx(M.Fragment,{children:a===2?f.jsx("b",{children:n}):n},a))})})},FV=e=>f.jsx("div",{className:"layer-ui__search-result-container",children:e.matches.items.map((t,n)=>f.jsx($V,{searchQuery:e.searchQuery,preview:t.preview,highlighted:n===e.focusIndex,onClick:()=>e.onItemClick(n)},t.textElement.id+t.index))}),zV=(e,t)=>e.matches.nonce===t.matches.nonce&&e.focusIndex===t.focusIndex,BV=M.memo(FV,zV),HV=(e,t,n)=>{let a=e.slice(0,t),i=a.split(/\s+/),r=a.endsWith(" "),s=i.length-2-1-(r?0:1),l=i.slice(s<=0?0:s).join(" ")+(r?" ":""),c=20;l=l.length>c?l.slice(-c):l;let d=e.slice(t+n.length),o=d.split(/\s+/),u=!d.startsWith(" "),h=u?6:5,p=(u?"":" ")+o.slice(0,h).join(" ");return{indexInSearchQuery:l.length,previewText:l+n+p,moreBefore:s>0,moreAfter:o.length>h}},XV=(e,t)=>{let n=e.split(`
|
|
127
|
+
`),a=[],i=0;for(let r=0;r<n.length;r++){let s=n[r],l=n[r+1];if(l){let c=t.indexOf(l,i);if(c>s.length+i){let d=c-(s.length+i);for(;d>0;)s+=" ",d--}}a.push(s),i=i+s.length}return a.join(`
|
|
128
|
+
`)},WV=(e,t,n)=>{let a=XV(e.text,e.originalText).split(`
|
|
129
|
+
`),i=[],r=0,s=0;for(let o of a){let u=r,h=u+o.length-1;i.push({line:o,startIndex:u,endIndex:h,lineNumber:s}),r=h+1,s++}let l=n,c=e.originalText.slice(n,n+t.length),d=[];for(let o of i){if(c==="")break;if(l>=o.startIndex&&l<=o.endIndex){let u=o.endIndex+1-l,h=o.line.slice(0,l-o.startIndex),p=c.slice(0,u);c=c.slice(u);let U=an(h,Ve(e),e.lineHeight);if(h===""&&(U.width=0),e.textAlign!=="left"&&o.line.length>0){let x=an(o.line,Ve(e),e.lineHeight),y=e.textAlign==="center"?(e.width-x.width)/2:e.width-x.width;U.width+=y}let{width:m,height:g}=an(p,Ve(e),e.lineHeight),b=U.width,v=o.lineNumber*U.height;d.push({offsetX:b,offsetY:v,width:m,height:g}),l+=u}}return d},VV=e=>e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),S5=NB((e,t,n)=>{if(!e||e===""){n([],null);return}let a=t.scene.getNonDeletedElements().filter(c=>q(c));a.sort((c,d)=>c.y-d.y);let i=[],r=new RegExp(VV(e),"gi");for(let c of a){let d=null,o=c.originalText;for(;(d=r.exec(o))!==null;){let u=HV(o,d.index,e),h=WV(c,e,d.index);h.length>0&&i.push({textElement:c,searchQuery:e,preview:u,index:d.index,matchedLines:h})}}let s=new Set(t.visibleElements.map(c=>c.id)),l=i.findIndex(c=>s.has(c.textElement.id))??null;n(i,l)},NV),ly=pc("DefaultSidebarTrigger",e=>{let{DefaultSidebarTriggerTunnel:t}=un();return f.jsx(t.In,{children:f.jsx(ea.Trigger,{...e,className:"default-sidebar-trigger",name:oa.name})})});ly.displayName="DefaultSidebarTrigger";var oy=({children:e})=>{let{DefaultSidebarTabTriggersTunnel:t}=un();return f.jsx(t.In,{children:e})};oy.displayName="DefaultTabTriggers";var k0=Object.assign(pc("DefaultSidebar",({children:e,className:t,onDock:n,docked:a,...i})=>{var d;let r=Yt(),s=_t(),{DefaultSidebarTabTriggersTunnel:l}=un(),c=((d=r.openSidebar)==null?void 0:d.tab)===Ns;return M.createElement(ea,{...i,name:"default",key:"default",className:ne("default-sidebar",t),docked:c||(a??r.defaultSidebarDockedPreference),onDock:c||n===!1||!n&&a!=null?void 0:$u(n,o=>{s({defaultSidebarDockedPreference:o})})},f.jsxs(ea.Tabs,{children:[f.jsx(ea.Header,{children:f.jsxs(ea.TabTriggers,{children:[f.jsx(ea.TabTrigger,{tab:Ns,children:Zr}),f.jsx(ea.TabTrigger,{tab:Fd,children:K0}),f.jsx(l.Out,{})]})}),f.jsx(ea.Tab,{tab:Fd,children:f.jsx(xW,{})}),f.jsx(ea.Tab,{tab:Ns,children:f.jsx(OV,{})}),e]}))}),{Trigger:ly,TabTriggers:oy}),GV="small",YV=e=>f.jsxs("label",{className:ne("ToolIcon ToolIcon__LaserPointer",`ToolIcon_size_${GV}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[f.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-LaserPointer"}),f.jsx("div",{className:"ToolIcon__icon",children:H8})]}),ZV=({canvasRef:e,setError:t})=>{let n=e.current;if(!n)return;let a=n.parentElement;a&&(a.style.background="",t(null),n.replaceChildren())},cy=async({canvasRef:e,mermaidToExcalidrawLib:t,mermaidDefinition:n,setError:a,data:i})=>{let r=e.current,s=r==null?void 0:r.parentElement;if(!(!r||!s)){if(!n){ZV({canvasRef:e,setError:a});return}try{let l=await t.api,c;try{c=await l.parseMermaidToExcalidraw(n)}catch{c=await l.parseMermaidToExcalidraw(n.replace(/"/g,"'"))}let{elements:d,files:o}=c;a(null),i.current={elements:Mu(d,{regenerateIds:!0}),files:o};let u=await cc({elements:i.current.elements,files:i.current.files,exportPadding:dl,maxWidthOrHeight:Math.max(s.offsetWidth,s.offsetHeight)*window.devicePixelRatio});try{await zo(u)}catch(h){throw h.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(I("canvasError.canvasTooBig")):h}s.style.background="var(--default-bg-color)",r.replaceChildren(u)}catch(l){throw s.style.background="var(--default-bg-color)",n&&a(l),l}}},MU=e=>{$r.set(no.MERMAID_TO_EXCALIDRAW,e)},dy=({app:e,data:t,text:n,shouldSaveMermaidDataToStorage:a})=>{let{elements:i,files:r}=t.current;i.length&&(e.addElementsFromPasteOrLibrary({elements:i,files:r,position:"center",fitToContent:!0}),e.setOpenDialog(null),a&&n&&MU(n))},uy=({children:e})=>f.jsx("div",{className:"ttd-dialog-panels",children:e}),Su=({label:e,children:t,panelAction:n,panelActionDisabled:a=!1,onTextSubmitInProgess:i,renderTopRight:r,renderSubmitShortcut:s,renderBottomRight:l})=>f.jsxs("div",{className:"ttd-dialog-panel",children:[f.jsxs("div",{className:"ttd-dialog-panel__header",children:[f.jsx("label",{children:e}),r==null?void 0:r()]}),t,f.jsxs("div",{className:ne("ttd-dialog-panel-button-container",{invisible:!n}),style:{display:"flex",alignItems:"center"},children:[f.jsxs(sr,{className:"ttd-dialog-panel-button",onSelect:n?n.action:()=>{},disabled:a||i,children:[f.jsxs("div",{className:ne({invisible:i}),children:[n==null?void 0:n.label,(n==null?void 0:n.icon)&&f.jsx("span",{children:n.icon})]}),i&&f.jsx(Ei,{})]}),!a&&!i&&(s==null?void 0:s()),l==null?void 0:l()]})]}),fy=({input:e,placeholder:t,onChange:n,onKeyboardSubmit:a})=>{let i=M.useRef(null),r=M.useRef(a);return r.current=a,M.useEffect(()=>{if(!r.current)return;let s=i.current;if(s){let l=c=>{var d;c[D.CTRL_OR_CMD]&&c.key===D.ENTER&&(c.preventDefault(),(d=r.current)==null||d.call(r))};return s.addEventListener("keydown",l),()=>{s.removeEventListener("keydown",l)}}},[]),f.jsx("textarea",{className:"ttd-dialog-input",onChange:n,value:e,placeholder:t,autoFocus:!0,ref:i})},KV=({error:e})=>f.jsxs("div",{"data-testid":"ttd-dialog-output-error",className:"ttd-dialog-output-error",children:["Error! ",f.jsx("p",{children:e})]}),hy=({error:e,canvasRef:t,loaded:n})=>f.jsxs("div",{className:"ttd-dialog-output-wrapper",children:[e&&f.jsx(KV,{error:e.message}),n?f.jsx("div",{ref:t,style:{opacity:e?"0.15":1},className:"ttd-dialog-output-canvas-container"}):f.jsx(Ei,{size:"2rem"})]}),py=()=>f.jsxs("div",{className:"ttd-dialog-submit-shortcut",children:[f.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:V("CtrlOrCmd")}),f.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:V("Enter")})]}),qV=`flowchart TD
|
|
130
|
+
A[Christmas] -->|Get money| B(Go shopping)
|
|
131
|
+
B --> C{Let me think}
|
|
132
|
+
C -->|One| D[Laptop]
|
|
133
|
+
C -->|Two| E[iPhone]
|
|
134
|
+
C -->|Three| F[Car]`,C5=Zs(MU,300),JV=({mermaidToExcalidrawLib:e})=>{let[t,n]=M.useState(()=>$r.get(no.MERMAID_TO_EXCALIDRAW)||qV),a=M.useDeferredValue(t.trim()),[i,r]=M.useState(null),s=M.useRef(null),l=M.useRef({elements:[],files:null}),c=va();M.useEffect(()=>{cy({canvasRef:s,data:l,mermaidToExcalidrawLib:e,setError:r,mermaidDefinition:a}).catch(o=>{v8()&&console.error("Failed to parse mermaid definition",o)}),C5(a)},[a,e]),M.useEffect(()=>()=>{C5.flush()},[]);let d=()=>{dy({app:c,data:l,text:t,shouldSaveMermaidDataToStorage:!0})};return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"ttd-dialog-desc",children:f.jsx(Na,{i18nKey:"mermaid.description",flowchartLink:o=>f.jsx("a",{href:"https://mermaid.js.org/syntax/flowchart.html",children:o}),sequenceLink:o=>f.jsx("a",{href:"https://mermaid.js.org/syntax/sequenceDiagram.html",children:o}),classLink:o=>f.jsx("a",{href:"https://mermaid.js.org/syntax/classDiagram.html",children:o})})}),f.jsxs(uy,{children:[f.jsx(Su,{label:I("mermaid.syntax"),children:f.jsx(fy,{input:t,placeholder:"Write Mermaid diagram defintion here...",onChange:o=>n(o.target.value),onKeyboardSubmit:()=>{d()}})}),f.jsx(Su,{label:I("mermaid.preview"),panelAction:{action:()=>{d()},label:I("mermaid.button"),icon:ud},renderSubmitShortcut:()=>f.jsx(py,{}),children:f.jsx(hy,{canvasRef:s,loaded:e.loaded,error:i})})]})]})},QV=JV,Uy=e=>{let t=_t(),n=M.useRef(null),a=M.useRef(0);return f.jsx(mv,{ref:n,className:"ttd-dialog-tabs-root",value:e.tab,onValueChange:i=>{var s;if(!i)return;let r=(s=n.current)==null?void 0:s.closest(".Modal__content");if(r){let l=r.offsetHeight||0;l>a.current&&(a.current=l,r.style.minHeight=`min(${a.current}px, 100%)`)}e.dialog==="ttd"&&y8(["text-to-diagram","mermaid"],i)&&t({openDialog:{name:e.dialog,tab:i}})},children:e.children})};Uy.displayName="TTDDialogTabs";var eG=Uy,my=({children:e,...t})=>f.jsx(gv,{className:"ttd-dialog-triggers",...t,children:e});my.displayName="TTDDialogTabTriggers";var M0=({children:e,tab:t,onSelect:n,...a})=>f.jsx(bv,{value:t,asChild:!0,onSelect:n,children:f.jsx("button",{type:"button",className:"ttd-dialog-tab-trigger",...a,children:e})});M0.displayName="TTDDialogTabTrigger";var I0=({tab:e,children:t,...n})=>f.jsx(vv,{...n,value:e,children:t});I0.displayName="TTDDialogTab";var Gh=3,ys=1e3,tG=Bt(null),nG=Bt(null),gy=e=>{var n;let t=Yt();return((n=t.openDialog)==null?void 0:n.name)!=="ttd"?null:f.jsx(aG,{...e,tab:t.openDialog.tab})},aG=pc("TTDDialogBase",({tab:e,...t})=>{let n=va(),a=_t(),i=M.useRef(null),[r,s]=mt(nG),[l,c]=M.useState((r==null?void 0:r.prompt)??""),d=l.trim(),o=S=>{c(S.target.value),s(w=>({generatedResponse:(w==null?void 0:w.generatedResponse)??null,prompt:S.target.value}))},[u,h]=M.useState(!1),[p,U]=mt(tG),m=async()=>{if(d.length>ys||d.length<Gh||u||(p==null?void 0:p.rateLimitRemaining)===0||"__fallback"in t){d.length<Gh&&E(new Error(`Prompt is too short (min ${Gh} characters)`)),d.length>ys&&E(new Error(`Prompt is too long (max ${ys} characters)`));return}try{h(!0),Qe("ai","generate","ttd");let{generatedResponse:S,error:w,rateLimit:k,rateLimitRemaining:T}=await t.onTextSubmit(d);if(typeof S=="string"&&s(_=>({generatedResponse:S,prompt:(_==null?void 0:_.prompt)??null})),ao(k)&&ao(T)&&U({rateLimit:k,rateLimitRemaining:T}),w){E(w);return}if(!S){E(new Error("Generation failed"));return}try{await cy({canvasRef:i,data:x,mermaidToExcalidrawLib:b,setError:E,mermaidDefinition:S}),Qe("ai","mermaid parse success","ttd")}catch(_){console.info(`%cTTD mermaid render errror: ${_.message}`,"color: red"),console.info(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
135
|
+
TTD mermaid definition render errror: ${_.message}`,"color: yellow"),Qe("ai","mermaid parse failed","ttd"),E(new Error("Generated an invalid diagram :(. You may also try a different prompt."))}}catch(S){let w=S.message;(!w||w==="Failed to fetch")&&(w="Request failed"),E(new Error(w))}finally{h(!1)}},g=M.useRef(m);g.current=m;let[b,v]=M.useState({loaded:!1,api:Promise.resolve().then(()=>require("./layers.Cd8Qz5rd.js")).then(S=>S.index)});M.useEffect(()=>{(async()=>(await b.api,v(S=>({...S,loaded:!0}))))()},[b.api]);let x=M.useRef({elements:[],files:null}),[y,E]=M.useState(null);return f.jsx(ba,{className:"ttd-dialog",onCloseRequest:()=>{n.setOpenDialog(null)},size:1200,title:!1,...t,autofocus:!1,children:f.jsxs(eG,{dialog:"ttd",tab:e,children:["__fallback"in t&&t.__fallback?f.jsx("p",{className:"dialog-mermaid-title",children:I("mermaid.title")}):f.jsxs(my,{children:[f.jsx(M0,{tab:"text-to-diagram",children:f.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[I("labels.textToDiagram"),f.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"1px 6px",marginLeft:"10px",fontSize:10,borderRadius:"12px",background:"var(--color-promo)",color:"var(--color-surface-lowest)"},children:"AI Beta"})]})}),f.jsx(M0,{tab:"mermaid",children:"Mermaid"})]}),f.jsx(I0,{className:"ttd-dialog-content",tab:"mermaid",children:f.jsx(QV,{mermaidToExcalidrawLib:b})}),!("__fallback"in t)&&f.jsxs(I0,{className:"ttd-dialog-content",tab:"text-to-diagram",children:[f.jsx("div",{className:"ttd-dialog-desc",children:"Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar."}),f.jsxs(uy,{children:[f.jsx(Su,{label:I("labels.prompt"),panelAction:{action:m,label:"Generate",icon:ud},onTextSubmitInProgess:u,panelActionDisabled:d.length>ys||(p==null?void 0:p.rateLimitRemaining)===0,renderTopRight:()=>p?f.jsxs("div",{className:"ttd-dialog-rate-limit",style:{fontSize:12,marginLeft:"auto",color:p.rateLimitRemaining===0?"var(--color-danger)":void 0},children:[p.rateLimitRemaining," requests left today"]}):null,renderSubmitShortcut:()=>f.jsx(py,{}),renderBottomRight:()=>{if(typeof(r==null?void 0:r.generatedResponse)=="string")return f.jsxs("div",{className:"excalidraw-link",style:{marginLeft:"auto",fontSize:14},onClick:()=>{typeof(r==null?void 0:r.generatedResponse)=="string"&&(MU(r.generatedResponse),a({openDialog:{name:"ttd",tab:"mermaid"}}))},children:["View as Mermaid",f.jsx(wf,{icon:ud})]});let S=d.length/ys;return S>.8?f.jsxs("div",{style:{marginLeft:"auto",fontSize:12,fontFamily:"monospace",color:S>1?"var(--color-danger)":void 0},children:["Length: ",d.length,"/",ys]}):null},children:f.jsx(fy,{onChange:o,input:l,placeholder:"Describe what you want to see...",onKeyboardSubmit:()=>{g.current()}})}),f.jsx(Su,{label:"Preview",panelAction:{action:()=>{console.info("Panel action clicked"),dy({app:n,data:x})},label:"Insert",icon:ud},children:f.jsx(hy,{canvasRef:i,error:y,loaded:b.loaded})})]})]})]})})}),iG=.01,Si=(e,t)=>!(t==="height"&&q(e)||t==="width"&&q(e)||t==="angle"&&de(e)),Jt=(e,t)=>{let n=e+t/2;return n-n%t},Cu=(e,t,n)=>Object.keys(e).map(a=>({original:(n??t).get(a),latest:t.get(a)})).filter(a=>a.original!==void 0&&a.latest!==void 0),Go=(e,t,n,a,i,r,s,l=!0)=>{let c=a.get(n.id);if(!c)return;let[d,o]=[n.x+n.width/2,n.y+n.height/2],[u,h]=H(C(n.x,n.y),C(d,o),n.angle),p=e-u,U=t-h,[m,g]=H(C(e,t),C(d+p,o+U),-n.angle);G(c,{x:m,y:g},l),T0(c,a,i,r);let b=ge(n,s);if(b){let v=a.get(b.id);v&&G(v,{x:b.x+p,y:b.y+U},l)}},IU=(e,t)=>{let n=Pr(t).map(a=>nt(e,a).reduce((i,r)=>(i[r.id]=!0,i),{}));return e.filter(a=>!el(a)).forEach(a=>{n.push({[a.id]:!0})}),n},T0=(e,t,n,a,i)=>{fe(e)?eu([e],t,n,a,!0,[],i==null?void 0:i.zoom):xn(e,t,i)},rG=({label:e,icon:t,dragInputCallback:n,value:a,elements:i,editable:r=!0,shouldKeepAspectRatio:s,property:l,scene:c,appState:d,sensitivity:o=1})=>{let u=va(),h=M.useRef(null),p=M.useRef(null),[U,m]=M.useState(a.toString()),g=M.useRef(null);g.current||(g.current={originalAppState:ui(d),originalElements:i,lastUpdatedValue:U,updatePending:!1}),M.useEffect(()=>{let x=a.toString();m(x),g.current.lastUpdatedValue=x},[a]);let b=(x,y,E)=>{if(!g.current.updatePending)return!1;g.current.updatePending=!1;let S=Number(x);if(isNaN(S)){m(a.toString());return}let w=Number(S.toFixed(2)),k=Number(a);(isNaN(k)||Math.abs(w-k)>=iG)&&(g.current.lastUpdatedValue=x,n({accumulatedChange:0,instantChange:0,originalElements:y,originalElementsMap:u.scene.getNonDeletedElementsMap(),shouldKeepAspectRatio:s,shouldChangeByStepSize:!1,scene:c,nextValue:w,property:l,originalAppState:E,setInputValue:T=>m(String(T))}),u.syncActionResult({captureUpdate:X.IMMEDIATELY}))},v=M.useRef({});return v.current.handleInputValue=b,M.useEffect(()=>{let x=h.current,y=v.current;return()=>{var S;let E=x==null?void 0:x.value;E&&((S=y.handleInputValue)==null||S.call(y,E,g.current.originalElements,g.current.originalAppState)),window.removeEventListener("pointermove",y.onPointerMove,!1),window.removeEventListener("pointerup",y.onPointerUp,!1)}},[r]),r?f.jsxs("div",{className:ne("drag-input-container",!r&&"disabled"),"data-testid":e,children:[f.jsx("div",{className:"drag-input-label",ref:p,onPointerDown:x=>{if(h.current&&r){document.body.classList.add("excalidraw-cursor-resize"),Number(h.current.value);let y=null,E=u.scene.getNonDeletedElements().reduce((A,R)=>(A.set(R.id,ss(R)),A),new Map),S=i.map(A=>E.get(A.id)),w=ui(d),k=0,T=0,_=A=>{if(y&&E!==null&&S!==null){let R=A.clientX-y.x;R!==0&&(T+=R,Math.abs(T)>=o&&(T=Math.sign(T)*Math.floor(Math.abs(T)/o),k+=T,n({accumulatedChange:k,instantChange:T,originalElements:S,originalElementsMap:E,shouldKeepAspectRatio:s,shouldChangeByStepSize:A.shiftKey,property:l,scene:c,originalAppState:w,setInputValue:N=>m(String(N))}),T=0))}y={x:A.clientX,y:A.clientY}},j=()=>{window.removeEventListener("pointermove",_,!1),u.syncActionResult({captureUpdate:X.IMMEDIATELY}),y=null,k=0,T=0,S=null,E=null,document.body.classList.remove("excalidraw-cursor-resize"),window.removeEventListener("pointerup",j,!1)};v.current.onPointerMove=_,v.current.onPointerUp=j,window.addEventListener("pointermove",_,!1),window.addEventListener("pointerup",j,!1)}},onPointerEnter:()=>{p.current&&(p.current.style.cursor="ew-resize")},children:t?f.jsx(wf,{icon:t}):e}),f.jsx("input",{className:"drag-input",autoComplete:"off",spellCheck:"false",onKeyDown:x=>{if(r){let y=x.target;y instanceof HTMLInputElement&&x.key===D.ENTER&&(b(y.value,i,d),u.focusContainer())}},ref:h,value:U,onChange:x=>{g.current.updatePending=!0,m(x.target.value)},onFocus:x=>{x.target.select(),g.current.originalElements=i,g.current.originalAppState=ui(d)},onBlur:x=>{U?r&&b(x.target.value,g.current.originalElements,g.current.originalAppState):m(a.toString())},disabled:!r})]}):null},Ii=rG,k5=10,sG=e=>e.type==="image",lG=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldKeepAspectRatio:a,shouldChangeByStepSize:i,nextValue:r,property:s,originalAppState:l,instantChange:c,scene:d})=>{let o=d.getNonDeletedElementsMap(),u=t[0],h=o.get(u.id);if(u&&h){let p=a||sG(u),U=u.width/u.height;if(l.croppingElementId===u.id){let x=o.get(u.id);if(!x||!Ne(x)||!x.crop)return;let y=x.crop,E={...y},S=x.scale[0]===-1,w=x.scale[1]===-1,{width:k,height:T}=mi(x),_=y.naturalWidth/k,j=y.naturalHeight/T,A=S?y.width+y.x:y.naturalWidth-y.x,R=w?y.height+y.y:y.naturalHeight-y.y,N=Pt*_,O=Pt*j;if(r!==void 0){if(s==="width"){let Y=r*_,Q=Se(Y,N,A);E={...E,width:Q,x:S?y.x+y.width-Q:y.x}}else if(s==="height"){let Y=r*j,Q=Se(Y,O,R);E={...E,height:Q,y:w?y.y+y.height-Q:y.y}}G(x,{crop:E,width:E.width/(y.naturalWidth/k),height:E.height/(y.naturalHeight/T)});return}let $=s==="width"?c:0,P=s==="height"?c:0,W=Se(y.width+$,N,A),F=Se(y.height+P,N,R);E={...y,x:S?y.x+y.width-W:y.x,y:w?y.y+y.height-F:y.y,width:W,height:F},G(x,{crop:E,width:E.width/(y.naturalWidth/k),height:E.height/(y.naturalHeight/T)});return}if(r!==void 0){let x=Math.max(s==="width"?r:p?r*U:u.width,Ln),y=Math.max(s==="height"?r:p?r/U:u.height,Ln);Fo(x,y,h,u,o,n,s==="width"?"e":"s",{shouldMaintainAspectRatio:p});return}let m=s==="width"?e:0,g=s==="height"?e:0,b=Math.max(0,u.width+m);s==="width"&&(i?b=Jt(b,k5):b=Math.round(b));let v=Math.max(0,u.height+g);s==="height"&&(i?v=Jt(v,k5):v=Math.round(v)),p&&(s==="width"?v=Math.round(b/U*100)/100:b=Math.round(v*U*100)/100),v=Math.max(Ln,v),b=Math.max(Ln,b),Fo(b,v,h,u,o,n,s==="width"?"e":"s",{shouldMaintainAspectRatio:p})}},oG=({property:e,element:t,scene:n,appState:a})=>{let i=Oa(e==="width"?t.width:t.height,2);if(a.croppingElementId&&a.croppingElementId===t.id&&Ne(t)&&t.crop){let{width:r,height:s}=mi(t);if(e==="width"){let l=r/t.crop.naturalWidth;i=Oa(t.crop.width*l,2)}if(e==="height"){let l=s/t.crop.naturalHeight;i=Oa(t.crop.height*l,2)}}return f.jsx(Ii,{label:e==="width"?"W":"H",elements:[t],dragInputCallback:lG,value:i,editable:Si(t,e),scene:n,appState:a,property:e})},M5=oG,cG=15,dG=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:a,scene:i})=>{let r=i.getNonDeletedElementsMap(),s=i.getNonDeletedElements(),l=t[0];if(l&&!ee(l)){let c=r.get(l.id);if(!c)return;if(a!==void 0){let U=Rr(a);G(c,{angle:U}),T0(c,r,s,i);let m=ge(c,r);m&&!xe(c)&&G(m,{angle:U});return}let d=Math.round(Qo(l.angle)*100)/100,o=Math.round(e),u=(d+o)%360;n&&(u=Jt(u,cG)),u=u<0?u+360:u;let h=Rr(u);G(c,{angle:h}),T0(c,r,s,i);let p=ge(c,r);p&&!xe(c)&&G(p,{angle:h})}},uG=({element:e,scene:t,appState:n,property:a})=>f.jsx(Ii,{label:"A",icon:$8,value:Math.round(Qo(e.angle)%360*100)/100,elements:[e],dragInputCallback:dG,editable:Si(e,"angle"),scene:t,appState:n,property:a}),fG=uG,I5=4,hG=4,pG=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:a,scene:i})=>{let r=i.getNonDeletedElementsMap(),s=t[0];if(s){let l=r.get(s.id);if(!l||!q(l))return;let c;if(a!==void 0)c=Math.max(Math.round(a),I5);else if(s.type==="text"){let d=Math.round(s.fontSize),o=Math.round(e);c=Math.max(d+o,I5),n&&(c=Jt(c,hG))}c&&(G(l,{fontSize:c}),on(l,i.getContainerElement(l),i.getNonDeletedElementsMap()))}},UG=({element:e,scene:t,appState:n,property:a})=>{let i=q(e)?e:Wn(e)?ge(e,t.getNonDeletedElementsMap()):null;return i?f.jsx(Ii,{label:"F",value:Math.round(i.fontSize*10)/10,elements:[i],dragInputCallback:pG,icon:Hu,appState:n,scene:t,property:a}):null},mG=UG,ws=10,gG=(e,t,n,a)=>{let i=a.x-e,r=a.y-t,s=a.width*n,l=a.height*n,c=e+i*n,d=t+r*n;return{width:s,height:l,x:c,y:d,...Bp(a,s,l,!1),...q(a)?{fontSize:a.fontSize*n}:{}}},bG=(e,t,n,a,i,r,s,l)=>{let c=gG(e,t,a,r);G(i,c,!1);let d=ge(r,l);if(d){let o=d.fontSize*a;xn(i,s,{newSize:{width:c.width,height:c.height}});let u=s.get(d.id);u&&q(u)&&(G(u,{fontSize:o},!1),rc(i,s,n==="width"?"e":"s",!0))}},T5=(e,t,n,a,i,r,s,l,c,d)=>{r==="width"?t=Math.round(e/a*100)/100:e=Math.round(t*a*100)/100;let o=t/n;for(let u=0;u<l.length;u++){let h=l[u],p=s[u];bG(i[0],i[1],r,o,p,h,c,d)}},vG=({accumulatedChange:e,originalElements:t,originalElementsMap:n,originalAppState:a,shouldChangeByStepSize:i,nextValue:r,scene:s,property:l})=>{let c=s.getNonDeletedElementsMap(),d=IU(t,a);if(r!==void 0){for(let h of d){let p=Cu(h,c,n);if(p.length>1){let U=p.map(T=>T.latest),m=p.map(T=>T.original),[g,b,v,x]=$e(m),y=v-g,E=x-b,S=y/E,w=Math.max(Ln,l==="width"?Math.max(0,r):y),k=Math.max(Ln,l==="height"?Math.max(0,r):E);T5(w,k,E,S,C(g,b),l,U,m,c,n)}else{let[U]=p,m=U==null?void 0:U.latest,g=U==null?void 0:U.original;if(m&&g&&Si(m,l)){let b=l==="width"?Math.max(0,r):m.width;l==="width"&&(i?b=Jt(b,ws):b=Math.round(b));let v=l==="height"?Math.max(0,r):m.height;l==="height"&&(i?v=Jt(v,ws):v=Math.round(v)),b=Math.max(Ln,b),v=Math.max(Ln,v),Fo(b,v,m,g,c,n,l==="width"?"e":"s",{shouldInformMutation:!1})}}}s.triggerUpdate();return}let o=l==="width"?e:0,u=l==="height"?e:0;for(let h of d){let p=Cu(h,c,n);if(p.length>1){let U=p.map(T=>T.latest),m=p.map(T=>T.original),[g,b,v,x]=$e(m),y=v-g,E=x-b,S=y/E,w=Math.max(0,y+o);l==="width"&&(i?w=Jt(w,ws):w=Math.round(w));let k=Math.max(0,E+u);l==="height"&&(i?k=Jt(k,ws):k=Math.round(k)),w=Math.max(Ln,w),k=Math.max(Ln,k),T5(w,k,E,S,C(g,b),l,U,m,c,n)}else{let[U]=p,m=U==null?void 0:U.latest,g=U==null?void 0:U.original;if(m&&g&&Si(m,l)){let b=Math.max(0,g.width+o);l==="width"&&(i?b=Jt(b,ws):b=Math.round(b));let v=Math.max(0,g.height+u);l==="height"&&(i?v=Jt(v,ws):v=Math.round(v)),b=Math.max(Ln,b),v=Math.max(Ln,v),Fo(b,v,m,g,c,n,l==="width"?"e":"s",{shouldInformMutation:!1})}}}s.triggerUpdate()},xG=({property:e,elements:t,elementsMap:n,atomicUnits:a,scene:i,appState:r})=>{let s=M.useMemo(()=>a.map(d=>{let o=Cu(d,n);if(o.length>1){let[h,p,U,m]=$e(o.map(g=>g.latest));return Math.round((e==="width"?U-h:m-p)*100)/100}let[u]=o;return Math.round((e==="width"?u.latest.width:u.latest.height)*100)/100}),[n,a,e]),l=new Set(s).size===1?Math.round(s[0]*100)/100:"Mixed",c=s.length>0;return f.jsx(Ii,{label:e==="width"?"W":"H",elements:t,dragInputCallback:vG,value:l,editable:c,appState:r,property:e,scene:i})},_5=xG,yG=15,wG=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:a,property:i,scene:r})=>{let s=r.getNonDeletedElementsMap(),l=t.map(d=>s.get(d.id)).filter(d=>d&&!el(d)&&Si(d,i)),c=t.filter(d=>!el(d)&&Si(d,i));if(a!==void 0){let d=Rr(a);for(let o of l){if(!o)continue;G(o,{angle:d},!1);let u=ge(o,s);u&&!xe(o)&&G(u,{angle:d},!1)}r.triggerUpdate();return}for(let d=0;d<l.length;d++){let o=l[d];if(!o)continue;let u=c[d],h=Math.round(Qo(u.angle)*100)/100,p=Math.round(e),U=(h+p)%360;n&&(U=Jt(U,yG)),U=U<0?U+360:U;let m=Rr(U);G(o,{angle:m},!1);let g=ge(o,s);g&&!xe(o)&&G(g,{angle:m},!1)}r.triggerUpdate()},EG=({elements:e,scene:t,appState:n,property:a})=>{let i=e.filter(c=>!el(c)&&Si(c,"angle")),r=i.map(c=>Math.round(Qo(c.angle)%360*100)/100),s=new Set(r).size===1?r[0]:"Mixed",l=i.some(c=>Si(c,"angle"));return f.jsx(Ii,{label:"A",icon:$8,value:s,elements:e,dragInputCallback:wG,editable:l,appState:n,scene:t,property:a})},SG=EG,j5=4,CG=4,kG=(e,t)=>e.reduce((n,a)=>{if(!a||el(a))return n;if(q(a))return n.push(a),n;if(Wn(a)){let i=ge(a,t);if(i)return n.push(i),n}return n},[]),MG=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:a,scene:i})=>{let r=i.getNonDeletedElementsMap(),s=t.map(c=>r.get(c.id)),l;if(a){l=Math.max(Math.round(a),j5);for(let c of s)G(c,{fontSize:l},!1),on(c,i.getContainerElement(c),r,!1);i.triggerUpdate()}else{let c=t;for(let d=0;d<s.length;d++){let o=s[d],u=c[d],h=Math.round(u.fontSize),p=Math.round(e),U=Math.max(h+p,j5);n&&(U=Jt(U,CG)),G(o,{fontSize:U},!1),on(o,i.getContainerElement(o),r,!1)}i.triggerUpdate()}},IG=({elements:e,scene:t,appState:n,property:a,elementsMap:i})=>{let r=kG(e,i);if(!r.length)return null;let s=r.map(d=>Math.round(d.fontSize*10)/10),l=new Set(s).size===1?s[0]:"Mixed",c=s.length>0;return f.jsx(Ii,{label:"F",icon:Hu,elements:r,dragInputCallback:MG,value:l,editable:c,scene:t,property:a,appState:n})},TG=IG,A5=10,_G=({accumulatedChange:e,instantChange:t,originalElements:n,originalElementsMap:a,shouldChangeByStepSize:i,nextValue:r,property:s,scene:l,originalAppState:c})=>{let d=l.getNonDeletedElementsMap(),o=l.getNonDeletedElements(),u=n[0],[h,p]=[u.x+u.width/2,u.y+u.height/2],[U,m]=H(C(u.x,u.y),C(h,p),u.angle);if(c.croppingElementId===u.id){let y=d.get(u.id);if(!y||!Ne(y)||!y.crop)return;let E=y.crop,S=E,w=y.scale[0]===-1,k=y.scale[1]===-1,{width:T,height:_}=mi(y);if(r!==void 0){if(s==="x"){let R=r*(E.naturalWidth/T);w?S={...E,x:Se(E.naturalWidth-R-E.width,0,E.naturalWidth-E.width)}:S={...E,x:Se(r*(E.naturalWidth/T),0,E.naturalWidth-E.width)}}s==="y"&&(S={...E,y:Se(r*(E.naturalHeight/_),0,E.naturalHeight-E.height)}),G(y,{crop:S});return}let j=(s==="x"?t:0)*(w?-1:1),A=(s==="y"?t:0)*(k?-1:1);S={...E,x:Se(E.x+j,0,E.naturalWidth-E.width),y:Se(E.y+A,0,E.naturalHeight-E.height)},G(y,{crop:S});return}if(r!==void 0){Go(s==="x"?r:U,s==="y"?r:m,u,d,o,l,a);return}let g=s==="x"?e:0,b=s==="y"?e:0,v=s==="x"?Math.round(i?Jt(u.x+g,A5):U+g):U,x=s==="y"?Math.round(i?Jt(u.y+b,A5):m+b):m;Go(v,x,u,d,o,l,a)},jG=({property:e,element:t,elementsMap:n,scene:a,appState:i})=>{let[r,s]=H(C(t.x,t.y),C(t.x+t.width/2,t.y+t.height/2),t.angle),l=Oa(e==="x"?r:s,2);if(i.croppingElementId===t.id&&Ne(t)&&t.crop){let c=_L(t);c&&(l=Oa(e==="x"?c.x:c.y,2))}return f.jsx(Ii,{label:e==="x"?"X":"Y",elements:[t],dragInputCallback:_G,scene:a,value:l,property:e,appState:i})},R5=jG,AG=10,RG=(e,t,n,a,i,r,s,l)=>{for(let c=0;c<a.length;c++){let d=i[c],[o,u]=[d.x+d.width/2,d.y+d.height/2],[h,p]=H(C(d.x,d.y),C(o,u),d.angle),U=e==="x"?Math.round(h+t):h,m=e==="y"?Math.round(p+n):p;Go(U,m,d,r,a,l,s,!1)}},LG=(e,t,n,a,i,r,s)=>{let[l,c,,]=$e(n),d=e-l,o=t-c;for(let u=0;u<n.length;u++){let h=n[u],p=a.get(h.id);if(p&&(!q(p)||!p.containerId)){let[U,m]=[p.x+p.width/2,p.y+p.height/2],[g,b]=H(C(p.x,p.y),C(U,m),p.angle);Go(g+d,b+o,h,a,i,s,r,!1)}}},DG=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldChangeByStepSize:a,nextValue:i,property:r,scene:s,originalAppState:l})=>{var u,h;let c=s.getNonDeletedElementsMap(),d=s.getNonDeletedElements();if(i!==void 0){for(let p of IU(t,l)){let U=Cu(p,c,n);if(U.length>1){let[m,g,,]=$e(U.map(b=>b.latest));LG(r==="x"?i:m,r==="y"?i:g,U.map(b=>b.original),c,d,n,s)}else{let m=(u=U[0])==null?void 0:u.original,g=(h=U[0])==null?void 0:h.latest;if(m&&g&&Si(g,r)){let[b,v]=[m.x+m.width/2,m.y+m.height/2],[x,y]=H(C(m.x,m.y),C(b,v),m.angle);Go(r==="x"?i:x,r==="y"?i:y,m,c,d,s,n,!1)}}}s.triggerUpdate();return}let o=a?Jt(e,AG):e;RG(r,r==="x"?o:0,r==="y"?o:0,t,t,c,n,s),s.triggerUpdate()},PG=({property:e,elements:t,elementsMap:n,atomicUnits:a,scene:i,appState:r})=>{let s=M.useMemo(()=>a.map(c=>{let d=Object.keys(c).map(m=>n.get(m)).filter(m=>m!==void 0);if(d.length>1){let[m,g]=$e(d);return Math.round((e==="x"?m:g)*100)/100}let[o]=d,[u,h]=[o.x+o.width/2,o.y+o.height/2],[p,U]=H(C(o.x,o.y),C(u,h),o.angle);return Math.round((e==="x"?p:U)*100)/100}),[a,n,e]),l=new Set(s).size===1?s[0]:"Mixed";return f.jsx(Ii,{label:e==="x"?"X":"Y",elements:t,dragInputCallback:DG,value:l,property:e,scene:i,appState:r})},L5=PG,D5=5,NG=({property:e,scene:t,appState:n,setAppState:a})=>f.jsx(Ii,{label:"Grid step",sensitivity:8,elements:[],dragInputCallback:({nextValue:i,instantChange:r,shouldChangeByStepSize:s,setInputValue:l})=>{a(c=>{let d;return i?d=i:r&&(d=s?Jt(c.gridStep+D5*Math.sign(r),D5):c.gridStep+r),d?(d=L7(d),l(d),{gridStep:d}):(l(c.gridStep),null)})},scene:t,value:n.gridStep,property:e,appState:n}),OG=NG,$G=50,If=e=>{let t=gc(),n=e.app.scene.getSceneNonce()||1,a=e.app.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}),i=No(e.app);return f.jsx(FG,{...e,appState:t,sceneNonce:n,selectedElements:a,gridModeEnabled:i})},tt=({children:e,columns:t=1,heading:n,style:a,...i})=>f.jsx("div",{className:ne("exc-stats__row",{"exc-stats__row--heading":n}),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,...a},...i,children:e});tt.displayName="StatsRow";var ku=({children:e,order:t,style:n,...a})=>f.jsx("div",{className:"exc-stats__rows",style:{order:t,...n},...a,children:e});ku.displayName="StatsRows";If.StatsRow=tt;If.StatsRows=ku;var FG=M.memo(({app:e,onClose:t,renderCustomStats:n,selectedElements:a,appState:i,sceneNonce:r,gridModeEnabled:s})=>{let l=e.scene,c=l.getNonDeletedElements(),d=l.getNonDeletedElementsMap(),o=_t(),u=a.length===1?a[0]:null,h=a.length>1?a:null,p=i.croppingElementId&&Ne(u),U=p?mi(u):null,[m,g]=M.useState({width:0,height:0}),b=M.useMemo(()=>Ko(y=>{let E=$e(y);g({width:Math.round(E[2])-Math.round(E[0]),height:Math.round(E[3])-Math.round(E[1])})},$G),[]);M.useEffect(()=>{b(c)},[r,c,b]),M.useEffect(()=>()=>b.cancel(),[b]);let v=M.useMemo(()=>IU(a,i),[a,i]),x=M.useMemo(()=>O3(a),[a]);return f.jsx("div",{className:"exc-stats",children:f.jsxs(ua,{padding:3,children:[f.jsxs("div",{className:"title",children:[f.jsx("h2",{children:I("stats.title")}),f.jsx("div",{className:"close",onClick:t,children:hl})]}),f.jsxs(U0,{label:f.jsx("h3",{children:I("stats.generalStats")}),open:!!(i.stats.panels&Ts.generalStats),openTrigger:()=>o(y=>({stats:{open:!0,panels:y.stats.panels^Ts.generalStats}})),children:[f.jsxs(ku,{children:[f.jsx(tt,{heading:!0,children:I("stats.scene")}),f.jsxs(tt,{columns:2,children:[f.jsx("div",{children:I("stats.shapes")}),f.jsx("div",{children:c.length})]}),f.jsxs(tt,{columns:2,children:[f.jsx("div",{children:I("stats.width")}),f.jsx("div",{children:m.width})]}),f.jsxs(tt,{columns:2,children:[f.jsx("div",{children:I("stats.height")}),f.jsx("div",{children:m.height})]}),s&&f.jsxs(f.Fragment,{children:[f.jsx(tt,{heading:!0,children:"Canvas"}),f.jsx(tt,{children:f.jsx(OG,{property:"gridStep",scene:l,appState:i,setAppState:o})})]})]}),n==null?void 0:n(c,i)]}),!x&&a.length>0&&f.jsx("div",{id:"elementStats",style:{marginTop:12},children:f.jsx(U0,{label:f.jsx("h3",{children:I("stats.elementProperties")}),open:!!(i.stats.panels&Ts.elementProperties),openTrigger:()=>o(y=>({stats:{open:!0,panels:y.stats.panels^Ts.elementProperties}})),children:f.jsxs(ku,{children:[u&&f.jsxs(f.Fragment,{children:[p&&f.jsx(tt,{heading:!0,children:I("labels.unCroppedDimension")}),i.croppingElementId&&Ne(u)&&U&&f.jsxs(tt,{columns:2,children:[f.jsx("div",{children:I("stats.width")}),f.jsx("div",{children:Oa(U.width,2)})]}),i.croppingElementId&&Ne(u)&&U&&f.jsxs(tt,{columns:2,children:[f.jsx("div",{children:I("stats.height")}),f.jsx("div",{children:Oa(U.height,2)})]}),f.jsx(tt,{heading:!0,"data-testid":"stats-element-type",children:i.croppingElementId?I("labels.imageCropping"):I(`element.${u.type}`)}),f.jsx(tt,{children:f.jsx(R5,{element:u,property:"x",elementsMap:d,scene:l,appState:i})}),f.jsx(tt,{children:f.jsx(R5,{element:u,property:"y",elementsMap:d,scene:l,appState:i})}),f.jsx(tt,{children:f.jsx(M5,{property:"width",element:u,scene:l,appState:i})}),f.jsx(tt,{children:f.jsx(M5,{property:"height",element:u,scene:l,appState:i})}),!ee(u)&&f.jsx(tt,{children:f.jsx(fG,{property:"angle",element:u,scene:l,appState:i})}),f.jsx(tt,{children:f.jsx(mG,{property:"fontSize",element:u,scene:l,appState:i})})]}),h&&f.jsxs(f.Fragment,{children:[$7(h)&&f.jsx(tt,{heading:!0,children:I("element.group")}),f.jsxs(tt,{columns:2,style:{margin:"0.3125rem 0"},children:[f.jsx("div",{children:I("stats.shapes")}),f.jsx("div",{children:a.length})]}),f.jsx(tt,{children:f.jsx(L5,{property:"x",elements:h,elementsMap:d,atomicUnits:v,scene:l,appState:i})}),f.jsx(tt,{children:f.jsx(L5,{property:"y",elements:h,elementsMap:d,atomicUnits:v,scene:l,appState:i})}),f.jsx(tt,{children:f.jsx(_5,{property:"width",elements:h,elementsMap:d,atomicUnits:v,scene:l,appState:i})}),f.jsx(tt,{children:f.jsx(_5,{property:"height",elements:h,elementsMap:d,atomicUnits:v,scene:l,appState:i})}),f.jsx(tt,{children:f.jsx(SG,{property:"angle",elements:h,scene:l,appState:i})}),f.jsx(tt,{children:f.jsx(TG,{property:"fontSize",elements:h,scene:l,appState:i,elementsMap:d})})]})]})})})]})})},(e,t)=>e.sceneNonce===t.sceneNonce&&e.selectedElements===t.selectedElements&&e.appState.stats.panels===t.appState.stats.panels&&e.gridModeEnabled===t.gridModeEnabled&&e.appState.gridStep===t.appState.gridStep&&e.appState.croppingElementId===t.appState.croppingElementId),zG=({sourceElementId:e,onClose:t,elementsMap:n,appState:a,generateLinkForSelection:i=f3})=>{var u;let r=((u=n.get(e))==null?void 0:u.link)??null,[s,l]=M.useState(r),[c,d]=M.useState(!1);M.useEffect(()=>{let h=ve(n,a),p=r;if(h.length>0&&i){let U=h3(h,a);U&&(p=yn(i(U.id,U.type)))}l(p)},[n,a,a.selectedElementIds,r,i]);let o=M.useCallback(()=>{var h;if(s&&s!==((h=n.get(e))==null?void 0:h.link)){let p=n.get(e);p&&G(p,{link:s})}if(!s&&c&&e){let p=n.get(e);p&&G(p,{link:null})}t==null||t()},[e,s,n,c,t]);return M.useEffect(()=>{let h=p=>{var U,m;((U=a.openDialog)==null?void 0:U.name)==="elementLinkSelector"&&p.key===D.ENTER&&o(),((m=a.openDialog)==null?void 0:m.name)==="elementLinkSelector"&&p.key===D.ESCAPE&&(t==null||t())};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[a,t,o]),f.jsxs("div",{className:"ElementLinkDialog",children:[f.jsxs("div",{className:"ElementLinkDialog__header",children:[f.jsx("h2",{children:I("elementLink.title")}),f.jsx("p",{children:I("elementLink.desc")})]}),f.jsxs("div",{className:"ElementLinkDialog__input",children:[f.jsx(SU,{value:s??"",onChange:h=>{c||d(!0),l(h)},onKeyDown:h=>{h.key===D.ENTER&&o()},className:"ElementLinkDialog__input-field",selectOnRender:!0}),r&&s&&f.jsx(Me,{type:"button",title:I("buttons.remove"),"aria-label":I("buttons.remove"),label:I("buttons.remove"),onClick:()=>{l(null),d(!0)},className:"ElementLinkDialog__remove",icon:Yr})]}),f.jsxs("div",{className:"ElementLinkDialog__actions",children:[f.jsx(ll,{label:I("buttons.cancel"),onClick:()=>{t==null||t()},style:{marginRight:10}}),f.jsx(ll,{label:I("buttons.confirm"),onClick:o,actionType:"primary"})]})]})},BG=zG,HG=({UIOptions:e})=>f.jsxs(sn,{__fallback:!0,children:[f.jsx(sn.DefaultItems.LoadScene,{}),f.jsx(sn.DefaultItems.SaveToActiveFile,{}),e.canvasActions.export&&f.jsx(sn.DefaultItems.Export,{}),e.canvasActions.saveAsImage&&f.jsx(sn.DefaultItems.SaveAsImage,{}),f.jsx(sn.DefaultItems.SearchMenu,{}),f.jsx(sn.DefaultItems.Help,{}),f.jsx(sn.DefaultItems.ClearCanvas,{}),f.jsx(sn.Separator,{}),f.jsx(sn.Group,{title:"Excalidraw links",children:f.jsx(sn.DefaultItems.Socials,{})}),f.jsx(sn.Separator,{}),f.jsx(sn.DefaultItems.ToggleTheme,{}),f.jsx(sn.DefaultItems.ChangeCanvasBackground,{})]}),XG=()=>f.jsxs(Vh,{__fallback:!0,children:[f.jsx(Vh.Actions.SaveToDisk,{}),f.jsx(Vh.Actions.ExportToImage,{})]}),WG=({actionManager:e,appState:t,files:n,setAppState:a,elements:i,canvas:r,onLockToggle:s,onHandToolToggle:l,onPenModeToggle:c,showExitZenModeBtn:d,renderTopRightUI:o,renderCustomStats:u,UIOptions:h,onExportImage:p,renderWelcomeScreen:U,children:m,app:g,isCollaborating:b,generateLinkForSelection:v})=>{var $,P,W;let x=Tt(),y=AW(),E=y.tunnelsJotai.Provider,[S,w]=mt(yf),k=()=>h.canvasActions.export?f.jsx(IV,{elements:i,appState:t,files:n,actionManager:e,exportOpts:h.canvasActions.export,canvas:r,setAppState:a}):null,T=()=>{var F;return!h.canvasActions.saveAsImage||((F=t.openDialog)==null?void 0:F.name)!=="imageExport"?null:f.jsx(aV,{elements:i,appState:t,files:n,actionManager:e,onExportImage:p,onCloseRequest:()=>a({openDialog:null}),name:g.getName()})},_=()=>f.jsxs("div",{style:{position:"relative"},children:[f.jsx(y.MainMenuTunnel.Out,{}),U&&f.jsx(y.WelcomeScreenMenuHintTunnel.Out,{})]}),j=()=>f.jsx(Vo,{heading:"selectedShapeActions",className:ne("selected-shape-actions zen-mode-transition",{"transition-left":t.zenModeEnabled}),children:f.jsx(ua,{className:Ws.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:`${t.height-166}px`},children:f.jsx(vx,{appState:t,elementsMap:g.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:g})})}),A=()=>{var Q,le,ie,Te,_e;let F=Xp(t,i),Y=t.stats.open&&!t.zenModeEnabled&&!t.viewModeEnabled&&((Q=t.openDialog)==null?void 0:Q.name)!=="elementLinkSelector";return f.jsx(Ix,{side:"top",children:f.jsxs("div",{className:"App-menu App-menu_top",children:[f.jsxs(On.Col,{gap:6,className:ne("App-menu_top__left"),children:[_(),F&&j()]}),!t.viewModeEnabled&&((le=t.openDialog)==null?void 0:le.name)!=="elementLinkSelector"&&f.jsx(Vo,{heading:"shapes",className:"shapes-section",children:Ie=>f.jsxs("div",{style:{position:"relative"},children:[U&&f.jsx(y.WelcomeScreenToolbarHintTunnel.Out,{}),f.jsx(On.Col,{gap:4,align:"start",children:f.jsxs(On.Row,{gap:1,className:ne("App-toolbar-container",{"zen-mode":t.zenModeEnabled}),children:[f.jsxs(ua,{padding:1,className:ne("App-toolbar",{"zen-mode":t.zenModeEnabled}),children:[f.jsx(jx,{appState:t,isMobile:x.editor.isMobile,device:x,app:g}),Ie,f.jsxs(On.Row,{gap:1,children:[f.jsx(Rx,{zenModeEnabled:t.zenModeEnabled,checked:t.penMode,onChange:()=>c(null),title:I("toolBar.penMode"),penDetected:t.penDetected}),f.jsx(Ax,{checked:t.activeTool.locked,onChange:s,title:I("toolBar.lock")}),f.jsx("div",{className:"App-toolbar__divider"}),f.jsx(Lx,{checked:Gs(t),onChange:()=>l(),title:I("toolBar.hand"),isMobile:!0}),f.jsx(xx,{appState:t,activeTool:t.activeTool,UIOptions:h,app:g})]})]}),b&&f.jsx(ua,{style:{marginLeft:8,alignSelf:"center",height:"fit-content"},children:f.jsx(YV,{title:I("toolBar.laser"),checked:t.activeTool.type===Rt.laser,onChange:()=>g.setActiveTool({type:Rt.laser}),isMobile:!0})})]})})]})}),f.jsxs("div",{className:ne("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":t.zenModeEnabled}),children:[t.collaborators.size>0&&f.jsx(Dx,{collaborators:t.collaborators,userToFollow:((ie=t.userToFollow)==null?void 0:ie.socketId)||null}),o==null?void 0:o(x.editor.isMobile,t),!t.viewModeEnabled&&((Te=t.openDialog)==null?void 0:Te.name)!=="elementLinkSelector"&&(!N||((_e=t.openSidebar)==null?void 0:_e.name)!==oa.name)&&f.jsx(y.DefaultSidebarTriggerTunnel.Out,{}),Y&&f.jsx(If,{app:g,onClose:()=>{e.executeAction(v0)},renderCustomStats:u})]})]})})},R=()=>f.jsx(k0,{__fallback:!0,onDock:F=>{Qe("sidebar",`toggleDock (${F?"dock":"undock"})`,`(${x.editor.isMobile?"mobile":"desktop"})`)}}),N=yv(CU),O=f.jsxs(f.Fragment,{children:[m,f.jsx(HG,{UIOptions:h}),f.jsx(k0.Trigger,{__fallback:!0,icon:K0,title:ro(I("toolBar.library")),onToggle:F=>{F&&Qe("sidebar",`${oa.name} (open)`,`button (${x.editor.isMobile?"mobile":"desktop"})`)},tab:oa.defaultTab,children:I("toolBar.library")}),f.jsx(XG,{}),(($=t.openDialog)==null?void 0:$.name)==="ttd"&&f.jsx(gy,{__fallback:!0}),t.isLoading&&f.jsx(Sv,{delay:250}),t.errorMessage&&f.jsx(qW,{onClose:()=>a({errorMessage:null}),children:t.errorMessage}),S&&!x.editor.isMobile&&f.jsx(kH,{colorPickerType:S.colorPickerType,onCancel:()=>{w(null)},onChange:(F,Y,Q,{altKey:le})=>{var ie;if(!(F!=="elementBackground"&&F!=="elementStroke"))if(Q.length){for(let Te of Q)G(Te,{[le&&S.swapPreviewOnAlt?F==="elementBackground"?"strokeColor":"backgroundColor":F==="elementBackground"?"backgroundColor":"strokeColor"]:Y},!1),dt.delete(Te);(ie=vi.getScene(Q[0]))==null||ie.triggerUpdate()}else a(F==="elementBackground"?{currentItemBackgroundColor:Y}:{currentItemStrokeColor:Y})},onSelect:(F,Y)=>{var Q;w(le=>le!=null&&le.keepOpenOnAlt&&Y.altKey?le:null),(Q=S==null?void 0:S.onSelect)==null||Q.call(S,F,Y)}}),((P=t.openDialog)==null?void 0:P.name)==="help"&&f.jsx(wV,{onClose:()=>{a({openDialog:null})}}),f.jsx(NW,{}),((W=t.openDialog)==null?void 0:W.name)==="elementLinkSelector"&&f.jsx(BG,{sourceElementId:t.openDialog.sourceElementId,onClose:()=>{a({openDialog:null})},elementsMap:g.scene.getNonDeletedElementsMap(),appState:t,generateLinkForSelection:v}),f.jsx(y.OverwriteConfirmDialogTunnel.Out,{}),T(),k(),t.pasteDialog.shown&&f.jsx(mV,{setAppState:a,appState:t,onClose:()=>a({pasteDialog:{shown:!1,data:null}})}),x.editor.isMobile&&f.jsx(UV,{app:g,appState:t,elements:i,actionManager:e,renderJSONExportDialog:k,renderImageExportDialog:T,setAppState:a,onLockToggle:s,onHandToolToggle:l,onPenModeToggle:c,renderTopRightUI:o,renderCustomStats:u,renderSidebars:R,device:x,renderWelcomeScreen:U,UIOptions:h}),!x.editor.isMobile&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"layer-ui__wrapper",style:t.openSidebar&&N&&x.editor.canFitSidebar?{width:"calc(100% - var(--right-sidebar-width))"}:{},children:[U&&f.jsx(y.WelcomeScreenCenterTunnel.Out,{}),A(),f.jsx(_V,{appState:t,actionManager:e,showExitZenModeBtn:d,renderWelcomeScreen:U}),t.scrolledOutside&&f.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{a(F=>({...Do(i,F)}))},children:I("buttons.scrollBackToContent")})]}),R()]})]});return f.jsx(Lv.Provider,{value:t,children:f.jsx(E,{children:f.jsx(mx.Provider,{value:y,children:O})})})},P5=e=>{let{suggestedBindings:t,startBoundElement:n,cursorButton:a,scrollX:i,scrollY:r,...s}=e;return s},VG=(e,t)=>{if(e.children!==t.children)return!1;let{canvas:n,appState:a,...i}=e,{canvas:r,appState:s,...l}=t;return Vt(P5(a),P5(s),{selectedElementIds:Vt,selectedGroupIds:Vt})&&Vt(i,l)},GG=M.memo(WG,VG),YG=5e3,ZG=({message:e,onClose:t,closable:n=!1,duration:a=YG,style:i})=>{let r=M.useRef(0),s=a!==1/0,l=M.useCallback(()=>{s&&(r.current=window.setTimeout(()=>t(),a))},[t,a,s]);return M.useEffect(()=>{if(s)return l(),()=>clearTimeout(r.current)},[l,e,a,s]),f.jsxs("div",{className:"Toast",onMouseEnter:s?()=>clearTimeout(r==null?void 0:r.current):void 0,onMouseLeave:s?l:void 0,style:i,children:[f.jsx("p",{className:"Toast__message",children:e}),n&&f.jsx(Me,{icon:hl,"aria-label":"close",type:"icon",onClick:t,className:"close"})]})},N5=Z({name:"viewMode",label:"labels.viewMode",paletteName:"Toggle view mode",icon:tp,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:X.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,n)=>typeof n.viewModeEnabled>"u",keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Re.R}),by=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length===1&&de(n[0])},KG=Z({name:"selectAllElementsInFrame",label:"labels.selectAllElementsInFrame",trackEvent:{category:"canvas"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t).at(0)||null;if(de(i)){let r=Ga(Ye(e),i.id).filter(s=>!(s.type==="text"&&s.containerId));return{elements:e,appState:{...t,selectedElementIds:r.reduce((s,l)=>(s[l.id]=!0,s),{})},captureUpdate:X.IMMEDIATELY}}return{elements:e,appState:t,captureUpdate:X.EVENTUALLY}},predicate:(e,t,n,a)=>by(t,a)}),qG=Z({name:"removeAllElementsFromFrame",label:"labels.removeAllElementsFromFrame",trackEvent:{category:"history"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t).at(0)||null;return de(i)?{elements:D3(e,i),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:X.IMMEDIATELY}:{elements:e,appState:t,captureUpdate:X.EVENTUALLY}},predicate:(e,t,n,a)=>by(t,a)});Z({name:"updateFrameRendering",label:"labels.updateFrameRendering",viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t)=>({elements:e,appState:{...t,frameRendering:{...t.frameRendering,enabled:!t.frameRendering.enabled}},captureUpdate:X.EVENTUALLY}),checked:e=>e.frameRendering.enabled});Z({name:"setFrameAsActiveTool",label:"toolBar.frame",trackEvent:{category:"toolbar"},icon:z8,viewMode:!1,perform:(e,t,n,a)=>{let i=Et(t,{type:"frame"});return Ma(a.interactiveCanvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:Et(t,{type:"frame"})},captureUpdate:X.EVENTUALLY}},keyTest:e=>!e[D.CTRL_OR_CMD]&&!e.shiftKey&&!e.altKey&&e.key.toLocaleLowerCase()===D.F});var JG=Z({name:"wrapSelectionInFrame",label:"labels.wrapSelectionInFrame",trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=ve(e,t);return i.length>0&&!i.some(r=>de(r))},perform:(e,t,n,a)=>{let i=ve(e,t),[r,s,l,c]=$e(i,a.scene.getNonDeletedElementsMap()),d=16,o=pp({x:r-d,y:s-d,width:l-r+d*2,height:c-s+d*2});if(t.editingGroupId){let u=nt(i,t.editingGroupId);for(let h of u){let p=h.groupIds.indexOf(t.editingGroupId);G(h,{groupIds:h.groupIds.slice(0,p)},!1)}}return{elements:oo([...a.scene.getElementsIncludingDeleted(),o],i,o,t),appState:{selectedElementIds:{[o.id]:!0}},captureUpdate:X.IMMEDIATELY}}}),QG=()=>f.jsxs("div",{"data-testid":"brave-measure-text-error",children:[f.jsx("p",{children:f.jsx(Na,{i18nKey:"errors.brave_measure_text_error.line1",bold:e=>f.jsx("span",{style:{fontWeight:600},children:e})})}),f.jsx("p",{children:f.jsx(Na,{i18nKey:"errors.brave_measure_text_error.line2",bold:e=>f.jsx("span",{style:{fontWeight:600},children:e})})}),f.jsx("p",{children:f.jsx(Na,{i18nKey:"errors.brave_measure_text_error.line3",link:e=>f.jsx("a",{href:"http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser",children:e})})}),f.jsx("p",{children:f.jsx(Na,{i18nKey:"errors.brave_measure_text_error.line4",issueLink:e=>f.jsx("a",{href:"https://github.com/excalidraw/excalidraw/issues/new",children:e}),discordLink:e=>f.jsxs("a",{href:"https://discord.gg/UexuTaE",children:[e,"."]})})})]}),eY=QG,Zc={width:100,height:0},Wi=100,tY=(e,t,n)=>{let a=Tn({x:0,y:0,textAlign:Io.CENTER,verticalAlign:Mn.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:a.id})}),on(a,e,n),[e,a]},O5=(e,t,n,a,i)=>{let r,s;if(Object.assign(e,{startBinding:(e==null?void 0:e.startBinding)||null,endBinding:e.endBinding||null}),t){let o=(t==null?void 0:t.width)??Wi,u=(t==null?void 0:t.height)??Wi,h;t.id&&(h=a.getElement(t.id),h||console.error(`No element for start binding with id ${t.id} found`));let p=t.x||e.x-o,U=t.y||e.y-u/2,m=h?h.type:t.type;if(m){if(m==="text"){let g="";h&&h.type==="text"?g=h.text:t.type==="text"&&(g=t.text),g||console.error(`No text found for start binding text element for ${e.id}`),r=Tn({x:p,y:U,type:"text",...h,...t,text:g}),Object.assign(r,{x:t.x||e.x-r.width,y:t.y||e.y-r.height/2})}else switch(m){case"rectangle":case"ellipse":case"diamond":{r=Xa({x:p,y:U,width:o,height:u,...h,...t,type:m});break}default:Vr(e,`Unhandled element start type "${t.type}"`,!0)}Ba(e,r,"start",i)}}if(n){let o=(n==null?void 0:n.height)??Wi,u=(n==null?void 0:n.width)??Wi,h;n.id&&(h=a.getElement(n.id),h||console.error(`No element for end binding with id ${n.id} found`));let p=n.x||e.x+e.width,U=n.y||e.y-o/2,m=h?h.type:n.type;if(m){if(m==="text"){let g="";h&&h.type==="text"?g=h.text:n.type==="text"&&(g=n.text),g||console.error(`No text found for end binding text element for ${e.id}`),s=Tn({x:p,y:U,type:"text",...h,...n,text:g}),Object.assign(s,{y:n.y||e.y-s.height/2})}else switch(m){case"rectangle":case"ellipse":case"diamond":{s=Xa({x:p,y:U,width:u,height:o,...h,...n,type:m});break}default:Vr(e,`Unhandled element end type "${m}"`,!0)}Ba(e,s,"end",i)}}if(e.points.length<2)return{linearElement:e,startBoundElement:r,endBoundElement:s};let l=e.points.length-1,c=.5,d=ui(e.points);return e.points[l][0]>e.points[l-1][0]&&(d[0][0]=c,d[l][0]-=c),e.points[l][0]<e.points[l-1][0]&&(d[0][0]=-c,d[l][0]+=c),e.points[l][1]>e.points[l-1][1]&&(d[0][1]=c,d[l][1]-=c),e.points[l][1]<e.points[l-1][1]&&(d[0][1]=-c,d[l][1]+=c),Object.assign(e,{points:d}),{linearElement:e,startBoundElement:r,endBoundElement:s}},nY=class{constructor(){L(this,"excalidrawElements",new Map),L(this,"add",e=>{e&&this.excalidrawElements.set(e.id,e)}),L(this,"getElements",()=>Va(Array.from(this.excalidrawElements.values()))),L(this,"getElementsMap",()=>Hn(ce(this.getElements()))),L(this,"getElement",e=>this.excalidrawElements.get(e))}},Mu=(e,t)=>{var l,c,d;if(!e)return[];let n=ui(e),a=new nY,i=new Map,r=new Map;for(let o of n){let u,h=o.id;switch((t==null?void 0:t.regenerateIds)!==!1&&Object.assign(o,{id:Vn()}),o.type){case"rectangle":case"ellipse":case"diamond":{let p=(l=o==null?void 0:o.label)!=null&&l.text&&o.width===void 0?0:(o==null?void 0:o.width)||Wi,U=(c=o==null?void 0:o.label)!=null&&c.text&&o.height===void 0?0:(o==null?void 0:o.height)||Wi;u=Xa({...o,width:p,height:U});break}case"line":{let p=o.width||Zc.width,U=o.height||Zc.height;u=Nr({width:p,height:U,points:[C(0,0),C(p,U)],...o});break}case"arrow":{let p=o.width||Zc.width,U=o.height||Zc.height;u=Up({width:p,height:U,endArrowhead:"arrow",points:[C(0,0),C(p,U)],...o,type:"arrow"}),Object.assign(u,Qs(u.points));break}case"text":{let p=(o==null?void 0:o.fontFamily)||or,U=(o==null?void 0:o.fontSize)||Ci,m=(o==null?void 0:o.lineHeight)||Kr(p),g=o.text??"",b=Ks(g),v=an(b,Ve({fontFamily:p,fontSize:U}),m);u=Tn({width:v.width,height:v.height,fontFamily:p,fontSize:U,...o});break}case"image":{u=K7({width:(o==null?void 0:o.width)||Wi,height:(o==null?void 0:o.height)||Wi,...o});break}case"frame":{u=pp({x:0,y:0,...o});break}case"magicframe":{u=O1({x:0,y:0,...o});break}case"freedraw":case"iframe":case"embeddable":{u=o;break}default:u=o,Vr(o,`Unhandled element type "${o.type}"`,!0)}a.getElement(u.id)?console.error(`Duplicate id found for ${u.id}`):(a.add(u),i.set(u.id,o),h&&r.set(h,u.id))}let s=a.getElementsMap();for(let[o,u]of i){let h=a.getElement(o);switch(u.type){case"rectangle":case"ellipse":case"diamond":case"arrow":{if((d=u.label)!=null&&d.text){let[p,U]=tY(h,u==null?void 0:u.label,s);if(a.add(p),a.add(U),xe(p)){let m=u.type==="arrow"?u==null?void 0:u.start:void 0,g=u.type==="arrow"?u==null?void 0:u.end:void 0;if(m&&m.id){let y=r.get(m.id);y&&Object.assign(m,{id:y})}if(g&&g.id){let y=r.get(g.id);y&&Object.assign(g,{id:y})}let{linearElement:b,startBoundElement:v,endBoundElement:x}=O5(p,m,g,a,s);p=b,a.add(b),a.add(v),a.add(x)}}else switch(u.type){case"arrow":{let{start:p,end:U}=u;if(p&&p.id){let v=r.get(p.id);Object.assign(p,{id:v})}if(U&&U.id){let v=r.get(U.id);Object.assign(U,{id:v})}let{linearElement:m,startBoundElement:g,endBoundElement:b}=O5(h,p,U,a,s);a.add(m),a.add(g),a.add(b);break}}break}}}for(let[o,u]of i){if(u.type!=="frame"&&u.type!=="magicframe")continue;let h=a.getElement(o);if(!h)throw new Error(`Excalidraw element with id ${o} doesn't exist`);let p=[];u.children.forEach(w=>{var _;let k=r.get(w);if(!k)throw new Error(`Element with ${w} wasn't mapped correctly`);let T=a.getElement(k);if(!T)throw new Error(`Frame element with id ${k} doesn't exist`);Object.assign(T,{frameId:h.id}),(_=T==null?void 0:T.boundElements)==null||_.forEach(j=>{let A=a.getElement(j.id);if(!A)throw new Error(`Bound element with id ${j.id} doesn't exist`);Object.assign(A,{frameId:h.id}),p.push(A)}),p.push(T)});let[U,m,g,b]=$e(p),v=10;U=U-v,m=m-v,g=g+v,b=b+v;let x=(h==null?void 0:h.x)||U,y=(h==null?void 0:h.y)||m,E=(h==null?void 0:h.width)||g-U,S=(h==null?void 0:h.height)||b-m;Object.assign(h,{x,y,width:E,height:S}),v8()&&u.children.length&&(h!=null&&h.x||h!=null&&h.y||h!=null&&h.width||h!=null&&h.height)&&console.info("User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically")}return a.getElements()},ut=e=>t=>{Xt.unstable_batchedUpdates(e,t)},Yh=e=>Ou(t=>{Xt.unstable_batchedUpdates(e,t)}),TU=(()=>{let e;try{let n=M.version.split(".");e=Number(n[0])>17}catch{e=!1}let t=!1;return()=>window.EXCALIDRAW_THROTTLE_RENDER===!0?e?!0:(t||(t=!0,console.warn("Excalidraw: render throttling is disabled on React versions < 18.")),!1):!1})(),aY="#ff6b6b",iY="#ff0000",$5=1,F5=2,rY=(e,t)=>{if(!t.snapLines.length)return;let n=t.theme===ke.LIGHT||t.zenModeEnabled?aY:iY,a=(t.zenModeEnabled?$5*1.5:$5)/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY);for(let i of t.snapLines)i.type==="pointer"?(e.lineWidth=a,e.strokeStyle=n,lY(i,e,t)):i.type==="gap"?(e.lineWidth=a,e.strokeStyle=n,oY(i.points[0],i.points[1],i.direction,t,e)):i.type==="points"&&(e.lineWidth=a,e.strokeStyle=n,sY(i,e,t));e.restore()},sY=(e,t,n)=>{if(!n.zenModeEnabled){let a=e.points[0],i=e.points[e.points.length-1];An(a,i,t)}for(let a of e.points)vy(a,n,t)},lY=(e,t,n)=>{vy(e.points[0],n,t),n.zenModeEnabled||An(e.points[0],e.points[1],t)},vy=([e,t],n,a)=>{a.save();let i=(n.zenModeEnabled?F5*1.5:F5)/n.zoom.value;a.beginPath(),a.moveTo(e-i,t-i),a.lineTo(e+i,t+i),a.moveTo(e+i,t-i),a.lineTo(e-i,t+i),a.stroke(),a.restore()},An=(e,t,n)=>{n.beginPath(),n.lineTo(e[0],e[1]),n.lineTo(t[0],t[1]),n.stroke()},oY=(e,t,n,a,i)=>{let r=8/a.zoom.value,s=r/2,l=r/4;if(n==="horizontal"){let c=[(e[0]+t[0])/2,e[1]];a.zenModeEnabled||An(C(e[0],e[1]-r),C(e[0],e[1]+r),i),An(C(c[0]-l,c[1]-s),C(c[0]-l,c[1]+s),i),An(C(c[0]+l,c[1]-s),C(c[0]+l,c[1]+s),i),a.zenModeEnabled||(An(C(t[0],t[1]-r),C(t[0],t[1]+r),i),An(e,t,i))}else{let c=[e[0],(e[1]+t[1])/2];a.zenModeEnabled||An(C(e[0]-r,e[1]),C(e[0]+r,e[1]),i),An(C(c[0]-s,c[1]-l),C(c[0]+s,c[1]-l),i),An(C(c[0]-s,c[1]+l),C(c[0]+s,c[1]+l),i),a.zenModeEnabled||(An(C(t[0]-r,t[1]),C(t[0]+r,t[1]),i),An(e,t,i))}},cY=(e,t)=>{nn(t.selectedLinearElement,"selectedLinearElement is null");let{segmentMidPointHoveredCoords:n}=t.selectedLinearElement;nn(n,"midPointCoords is null"),e.save(),e.translate(t.scrollX,t.scrollY),xy(n,e,t),e.restore()},dY=(e,t,n)=>{var l,c;let{elementId:a,hoverPointIndex:i}=t.selectedLinearElement;if((c=(l=t.editingLinearElement)==null?void 0:l.selectedPointsIndices)!=null&&c.includes(i))return;let r=J.getElement(a,n);if(!r)return;let s=J.getPointAtIndexGlobalCoordinates(r,i,n);e.save(),e.translate(t.scrollX,t.scrollY),xy(s,e,t),e.restore()},xy=(e,t,n)=>{t.fillStyle="rgba(105, 101, 219, 0.4)",nf(t,e[0],e[1],J.POINT_HANDLE_SIZE/n.zoom.value,!1)},Uc=(e,t,n,a,i,r,s,l,c=!1,d=0)=>{e.save(),e.translate(r,s),e.rotate(l),c&&e.fillRect(t-r,n-s,a,i),d&&e.roundRect?(e.beginPath(),e.roundRect(t-r,n-s,a,i,d),e.stroke(),e.closePath()):e.strokeRect(t-r,n-s,a,i),e.restore()},uY=(e,t,n,a,i,r)=>{e.save(),e.translate(a,i),e.rotate(r),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()},Zh=(e,t,n,a,i,r=!1)=>{e.strokeStyle="#5e5ad8",e.setLineDash([]),e.fillStyle="rgba(255, 255, 255, 0.9)",i?e.fillStyle="rgba(134, 131, 226, 0.9)":r&&(e.fillStyle="rgba(177, 151, 252, 0.7)"),nf(e,n[0],n[1],a/t.zoom.value,!r)},fY=(e,t,n,a,i,r)=>{e.beginPath(),e.ellipse(a,i,t/2,n/2,r,0,Math.PI*2),e.stroke()},hY=(e,t,n,a)=>{let[i,r,s,l]=pe(t,n),c=s-i,d=l-r;e.strokeStyle="rgba(0,0,0,.05)";let o=a.value<1?a.value:1;e.lineWidth=dp/o;let u=e.lineWidth/2+up,h=ca(Math.min(t.width,t.height),t);switch(t.type){case"rectangle":case"text":case"image":case"iframe":case"embeddable":case"frame":case"magicframe":Uc(e,i-u,r-u,c+u*2,d+u*2,i+c/2,r+d/2,t.angle,void 0,h);break;case"diamond":let p=Math.hypot(c,d),U=u*p/d,m=u*p/c;uY(e,c+U*2,d+m*2,i+c/2,r+d/2,t.angle);break;case"ellipse":fY(e,c+u*2,d+u*2,i+c/2,r+d/2,t.angle);break}},pY=(e,t,n,a)=>{let[i,r,s]=t,l=ic(s,s.width,s.height,a);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",(r==="both"?[0,-1]:r==="start"?[0]:[-1]).forEach(c=>{let[d,o]=J.getPointAtIndexGlobalCoordinates(i,c,n);nf(e,d,o,l)})},yy=(e,t,n)=>{let{angle:a,x1:i,y1:r,x2:s,y2:l,selectionColors:c,cx:d,cy:o,dashed:u,activeEmbeddable:h}=n,p=s-i,U=l-r,m=(n.padding??Xr*2)/t.zoom.value,g=8/t.zoom.value,b=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=(h?4:1)/t.zoom.value;let v=c.length;for(let x=0;x<v;++x)e.strokeStyle=c[x],u&&e.setLineDash([g,b+(g+b)*(v-1)]),e.lineDashOffset=(g+b)*x,Uc(e,i-m,r-m,p+m*2,U+m*2,d,o,a);e.restore()},UY=(e,t,n,a)=>{let i=Array.isArray(n)?pY:hY;e.save(),e.translate(t.scrollX,t.scrollY),i(e,n,a,t.zoom),e.restore()},mY=(e,t,n,a)=>{let[i,r,s,l]=pe(n,a),c=s-i,d=l-r;e.strokeStyle="rgb(0,118,255)",e.lineWidth=ot.strokeWidth/t.zoom.value,e.save(),e.translate(t.scrollX,t.scrollY),Uc(e,i,r,c,d,i+c/2,r+d/2,n.angle,!1,ot.radius/t.zoom.value),e.restore()},gY=(e,t,n)=>{let a=n.filter(l=>l.groupIds.length===0),i=n.filter(l=>l.groupIds.length>0),r=l=>{let[c,d,o,u]=$e(l);return{angle:0,x1:c,x2:o,y1:d,y2:u,selectionColors:["rgb(0,118,255)"],dashed:!1,cx:c+(o-c)/2,cy:d+(u-d)/2,activeEmbeddable:!1}},s=l=>{let c=nt(n,l);return r(c)};Object.entries(O7(i,t)).filter(([l,c])=>c).map(([l,c])=>l).map(l=>s(l)).concat(a.map(l=>r([l]))).forEach(l=>yy(e,t,l))},Kh=(e,t,n,a)=>{var l;if(!t.selectedLinearElement)return;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;let i=J.getPointsGlobalCoordinates(n,a),{POINT_HANDLE_SIZE:r}=J,s=t.editingLinearElement?r:r/2;if(i.forEach((c,d)=>{var u,h;if(ee(n)&&d!==0&&d!==i.length-1)return;let o=!!((h=(u=t.editingLinearElement)==null?void 0:u.selectedPointsIndices)!=null&&h.includes(d));Zh(e,t,c,s,o)}),ee(n)){let c=((l=n.fixedSegments)==null?void 0:l.map(d=>d.index))||[];i.slice(0,-1).forEach((d,o)=>{J.isSegmentTooShort(n,i[o+1],i[o],o,t.zoom)||Zh(e,t,C((d[0]+i[o+1][0])/2,(d[1]+i[o+1][1])/2),r/2,!1,!c.includes(o+1))})}else J.getEditorMidPoints(n,a,t).filter((c,d,o)=>c!==null&&!(ee(n)&&(d===0||d===o.length-1))).forEach(c=>{(t.editingLinearElement||i.length===2)&&Zh(e,t,c,r/2,!1,!0)});e.restore()},z5=(e,t,n,a,i)=>{Object.keys(a).forEach(r=>{let s=a[r];if(s!==void 0){let[l,c,d,o]=s;e.save(),e.lineWidth=1/n.zoom.value,t.selectionColor&&(e.strokeStyle=t.selectionColor),r==="rotation"?nf(e,l+d/2,c+o/2,d/2):e.roundRect?(e.beginPath(),e.roundRect(l,c,d,o,2/n.zoom.value),e.fill(),e.stroke()):Uc(e,l,c,d,o,l+d/2,c+o/2,i,!0),e.restore()}})},bY=(e,t,n,a,i)=>{let[r,s,,,l,c]=pe(a,i),d=3,o=20,u=d/n.zoom.value,h=u/2,p=l-r+u,U=c-s+u,m=Math.min(o/n.zoom.value,p),g=Math.min(o/n.zoom.value,U);e.save(),e.fillStyle=t.selectionColor,e.strokeStyle=t.selectionColor,e.lineWidth=u,[[[-p,-U],[0,h],[m,h],[h,0],[h,g]],[[p-h,-U],[h,h],[-m+h,h],[0,0],[0,g]],[[-p,U],[0,-h],[m,-h],[h,0],[h,-g]],[[p-h,U],[h,-h],[-m+h,-h],[0,0],[0,-g]]].forEach(b=>{let[[v,x],[y,E],[S,w],[k,T],[_,j]]=b;e.save(),e.translate(l,c),e.rotate(a.angle),e.beginPath(),e.moveTo(v+y,x+E),e.lineTo(v+S,x+w),e.stroke(),e.beginPath(),e.moveTo(v+k,x+T),e.lineTo(v+_,x+j),e.stroke(),e.restore()}),e.restore()},vY=(e,t,n,a)=>{t.save();let i=Xr*2/n.zoom.value,r=e.width+i*2,s=e.height+i*2,l=e.x+r/2,c=e.y+s/2,d=-(r/2+i),o=-(s/2+i);t.translate(l+n.scrollX,c+n.scrollY),t.rotate(e.angle),t.lineWidth=1/n.zoom.value,t.strokeStyle=a,t.strokeRect(d,o,r,s),t.restore()},wy=({canvas:e,elementsMap:t,visibleElements:n,selectedElements:a,allElementsMap:i,scale:r,appState:s,renderConfig:l,device:c})=>{var m,g,b;if(e===null)return{atLeastOneVisibleElement:!1,elementsMap:t};let[d,o]=xp(e,r),u=yp({canvas:e,scale:r,normalizedWidth:d,normalizedHeight:o});u.save(),u.scale(s.zoom.value,s.zoom.value);let h;if(n.forEach(v=>{var x;((x=s.editingLinearElement)==null?void 0:x.elementId)===v.id&&v&&(h=v)}),h&&Kh(u,s,h,t),s.selectionElement&&!s.isCropping)try{DL(s.selectionElement,u,s,l.selectionColor)}catch(v){console.error(v)}if(s.editingTextElement&&q(s.editingTextElement)){let v=i.get(s.editingTextElement.id);v&&!v.autoResize&&vY(v,u,s,l.selectionColor)}s.isBindingEnabled&&s.suggestedBindings.filter(v=>v!=null).forEach(v=>{UY(u,s,v,t)}),s.frameToHighlight&&mY(u,s,s.frameToHighlight,t),s.elementsToHighlight&&gY(u,s,s.elementsToHighlight);let p=a.some(v=>de(v));if(a.length===1&&((m=s.editingLinearElement)==null?void 0:m.elementId)===a[0].id&&Kh(u,s,a[0],t),ee(a[0])&&s.selectedLinearElement&&s.selectedLinearElement.segmentMidPointHoveredCoords?cY(u,s):s.selectedLinearElement&&s.selectedLinearElement.hoverPointIndex>=0&&!(ee(a[0])&&s.selectedLinearElement.hoverPointIndex>0&&s.selectedLinearElement.hoverPointIndex<a[0].points.length-1)&&dY(u,s,t),!s.multiElement&&!s.editingLinearElement){let v=X3(a,s),x=a.length===1&&fe(a[0]);x&&((g=s.selectedLinearElement)==null?void 0:g.elementId)===a[0].id&&!a[0].locked&&Kh(u,s,a[0],t);let y=l.selectionColor||Ft.black;if(v){let E=ce(a),S=[];for(let k of t.values()){let T=[],_=l.remoteSelectedElementIds.get(k.id);if(x&&ee(k)&&(k.startBinding||k.endBinding)||(E.has(k.id)&&!P7(s,k)&&T.push(y),_&&T.push(..._.map(j=>kf(j,s.collaborators.get(j))))),T.length){let[j,A,R,N,O,$]=pe(k,t,!0);S.push({angle:k.angle,x1:j,y1:A,x2:R,y2:N,selectionColors:T,dashed:!!_,cx:O,cy:$,activeEmbeddable:((b=s.activeEmbeddable)==null?void 0:b.element)===k&&s.activeEmbeddable.state==="active",padding:k.id===s.croppingElementId||Ne(k)?0:void 0})}}let w=k=>{let T=nt(t,k),[_,j,A,R]=$e(T);S.push({angle:0,x1:_,x2:A,y1:j,y2:R,selectionColors:[Ft.black],dashed:!0,cx:_+(A-_)/2,cy:j+(R-j)/2,activeEmbeddable:!1})};for(let k of Pr(s))w(k);s.editingGroupId&&w(s.editingGroupId),S.forEach(k=>yy(u,s,k))}if(u.save(),u.translate(s.scrollX,s.scrollY),a.length===1){u.fillStyle=Ft.white;let E=H3(a[0],s.zoom,t,"mouse",co(c));if(!s.viewModeEnabled&&v&&!q(s.editingTextElement)&&!s.croppingElementId&&z5(u,l,s,E,a[0].angle),s.croppingElementId&&!s.isCropping){let S=t.get(s.croppingElementId);S&&Ne(S)&&bY(u,l,s,S,t)}}else if(a.length>1&&!s.isRotating){let E=Xr*2/s.zoom.value;u.fillStyle=Ft.white;let[S,w,k,T]=$e(a),_=u.getLineDash();u.setLineDash([2/s.zoom.value]);let j=u.lineWidth;u.lineWidth=1/s.zoom.value,u.strokeStyle=y,Uc(u,S-E,w-E,k-S+E*2,T-w+E*2,(S+k)/2,(w+T)/2,0),u.lineWidth=j,u.setLineDash(_);let A=zp([S,w,k,T,(S+k)/2,(w+T)/2],0,s.zoom,"mouse",p?{...co(c),rotation:!0}:co(c));a.some(R=>!R.locked)&&z5(u,l,s,A,0)}u.restore()}s.searchMatches.forEach(({id:v,focus:x,matchedLines:y})=>{let E=t.get(v);if(E&&q(E)){let[S,w,,,k,T]=pe(E,t,!0);u.save(),s.theme===ke.LIGHT?x?u.fillStyle="rgba(255, 124, 0, 0.4)":u.fillStyle="rgba(255, 226, 0, 0.4)":x?u.fillStyle="rgba(229, 82, 0, 0.4)":u.fillStyle="rgba(99, 52, 0, 0.4)",u.translate(s.scrollX,s.scrollY),u.translate(k,T),u.rotate(E.angle),y.forEach(_=>{u.fillRect(S+_.offsetX-k,w+_.offsetY-T,_.width,_.height)}),u.restore()}}),rY(u,s),u.restore(),sX({context:u,renderConfig:l,appState:s,normalizedWidth:d,normalizedHeight:o});let U;return l.renderScrollbars&&(U=hV(n,d,o,s),u.save(),u.fillStyle=fV,u.strokeStyle="rgba(255,255,255,0.8)",[U.horizontal,U.vertical].forEach(v=>{v&&qv(u,v.x,v.y,v.width,v.height,Xi/2)}),u.restore()),{scrollBars:U,atLeastOneVisibleElement:n.length>0,elementsMap:t}},Ey=Ou(e=>{var n;let t=wy(e);(n=e.callback)==null||n.call(e,t)},{trailing:!0}),xY=(e,t)=>{if(t){Ey(e);return}let n=wy(e);return e.callback(n),n},yY=e=>{let t=M.useRef(!1);return M.useEffect(()=>{var c;if(!t.current){t.current=!0;return}let n=new Map,a=new Map,i=new Map,r=new Map,s=new Map;e.appState.collaborators.forEach((d,o)=>{if(d.selectedElementIds)for(let u of Object.keys(d.selectedElementIds))i.has(u)||i.set(u,[]),i.get(u).push(o);!d.pointer||d.pointer.renderCursor===!1||(d.username&&r.set(o,d.username),d.userState&&s.set(o,d.userState),a.set(o,Nn({sceneX:d.pointer.x,sceneY:d.pointer.y},e.appState)),n.set(o,d.button))});let l=((c=e.containerRef)==null?void 0:c.current)&&getComputedStyle(e.containerRef.current).getPropertyValue("--color-selection")||"#6965db";xY({canvas:e.canvas,elementsMap:e.elementsMap,visibleElements:e.visibleElements,selectedElements:e.selectedElements,allElementsMap:e.allElementsMap,scale:window.devicePixelRatio,appState:e.appState,renderConfig:{remotePointerViewportCoords:a,remotePointerButton:n,remoteSelectedElementIds:i,remotePointerUsernames:r,remotePointerUserStates:s,selectionColor:l,renderScrollbars:!1},device:e.device,callback:e.renderInteractiveSceneCallback},TU())}),f.jsx("canvas",{className:"excalidraw__canvas interactive",style:{width:e.appState.width,height:e.appState.height,cursor:e.appState.viewModeEnabled?He.GRAB:He.AUTO},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:e.handleCanvasRef,onContextMenu:e.onContextMenu,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.onPointerCancel,onTouchMove:e.onTouchMove,onPointerDown:e.onPointerDown,onDoubleClick:e.appState.viewModeEnabled?void 0:e.onDoubleClick,children:I("labels.drawingCanvas")})},B5=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,editingGroupId:e.editingGroupId,editingLinearElement:e.editingLinearElement,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,selectionElement:e.selectionElement,selectedGroupIds:e.selectedGroupIds,selectedLinearElement:e.selectedLinearElement,multiElement:e.multiElement,isBindingEnabled:e.isBindingEnabled,suggestedBindings:e.suggestedBindings,isRotating:e.isRotating,elementsToHighlight:e.elementsToHighlight,collaborators:e.collaborators,activeEmbeddable:e.activeEmbeddable,snapLines:e.snapLines,zenModeEnabled:e.zenModeEnabled,editingTextElement:e.editingTextElement,isCropping:e.isCropping,croppingElementId:e.croppingElementId,searchMatches:e.searchMatches}),wY=(e,t)=>e.selectionNonce!==t.selectionNonce||e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements||e.selectedElements!==t.selectedElements?!1:Vt(B5(e.appState),B5(t.appState)),EY=M.memo(yY,wY),SY=e=>{let t=M.useRef(null),n=M.useRef(!1);return M.useEffect(()=>{let a=t.current;if(!a)return;let i=e.canvas;n.current||(n.current=!0,a.replaceChildren(i),i.classList.add("excalidraw__canvas","static"));let r=`${e.appState.width}px`,s=`${e.appState.height}px`;i.style.width!==r&&(i.style.width=r),i.style.height!==s&&(i.style.height=s);let l=e.appState.width*e.scale,c=e.appState.height*e.scale;i.width!==l&&(i.width=l),i.height!==c&&(i.height=c),m3({canvas:i,rc:e.rc,scale:e.scale,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,visibleElements:e.visibleElements,appState:e.appState,renderConfig:e.renderConfig},TU())}),f.jsx("div",{className:"excalidraw__canvas-wrapper",ref:t})},H5=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,hoveredElementIds:e.hoveredElementIds,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,shouldCacheIgnoreZoom:e.shouldCacheIgnoreZoom,viewBackgroundColor:e.viewBackgroundColor,exportScale:e.exportScale,selectedElementsAreBeingDragged:e.selectedElementsAreBeingDragged,gridSize:e.gridSize,gridStep:e.gridStep,frameRendering:e.frameRendering,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,editingGroupId:e.editingGroupId,currentHoveredFontFamily:e.currentHoveredFontFamily,croppingElementId:e.croppingElementId}),CY=(e,t)=>e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements?!1:Vt(H5(e.appState),H5(t.appState))&&Vt(e.renderConfig,t.renderConfig),kY=M.memo(SY,CY),X5=class{constructor(e){L(this,"scene"),L(this,"getRenderableElements",(()=>{let t=({elementsMap:a,zoom:i,offsetLeft:r,offsetTop:s,scrollX:l,scrollY:c,height:d,width:o})=>{let u=[];for(let h of a.values())du(h,o,d,{zoom:i,offsetLeft:r,offsetTop:s,scrollX:l,scrollY:c},a)&&u.push(h);return u},n=({elements:a,editingTextElement:i,newElementId:r,pendingImageElementId:s})=>{let l=Hn(new Map);for(let c of a)Ne(c)&&s===c.id||r!==c.id&&(!i||i.type!=="text"||c.id!==i.id)&&l.set(c.id,c);return l};return dM(({zoom:a,offsetLeft:i,offsetTop:r,scrollX:s,scrollY:l,height:c,width:d,editingTextElement:o,newElementId:u,pendingImageElementId:h,sceneNonce:p})=>{let U=this.scene.getNonDeletedElements(),m=n({elements:U,editingTextElement:o,newElementId:u,pendingImageElementId:h}),g=t({elementsMap:m,zoom:a,offsetLeft:i,offsetTop:r,scrollX:s,scrollY:l,height:c,width:d});return{elementsMap:m,visibleElements:g}})})()),this.scene=e}destroy(){Ey.cancel(),U3.cancel(),this.getRenderableElements.clear()}},MY=({trails:e})=>{let t=M.useRef(null);return M.useEffect(()=>{if(t.current)for(let n of e)n.start(t.current);return()=>{for(let n of e)n.stop()}},e),f.jsx("div",{className:"SVGLayer",children:f.jsx("svg",{ref:t})})},IY=5,TY=(e,t,n)=>{let[a,i]=pe(e,n),{x:r,y:s}=Nn({sceneX:a+e.width,sceneY:i},t),l=r-t.offsetLeft+10,c=s-t.offsetTop;return{x:l,y:c}},W5=({children:e,element:t,elementsMap:n})=>{let a=gc();if(a.contextMenu||a.newElement||a.resizingElement||a.isRotating||a.openMenu||a.viewModeEnabled)return null;let{x:i,y:r}=TY(t,a,n);return f.jsx("div",{className:"excalidraw-canvas-buttons",style:{top:`${r}px`,left:`${i}px`,padding:IY},children:e})},_Y="small",qh=e=>f.jsxs("label",{className:ne("ToolIcon ToolIcon__MagicButton",`ToolIcon_size_${_Y}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[f.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),f.jsx("div",{className:"ToolIcon__icon",children:e.icon})]}),jY=({height:e,width:t,userToFollow:n,onDisconnect:a})=>f.jsx("div",{className:"follow-mode",style:{width:t,height:e},children:f.jsxs("div",{className:"follow-mode__badge",children:[f.jsxs("div",{className:"follow-mode__badge__label",children:["Following"," ",f.jsx("span",{className:"follow-mode__badge__username",title:n.username,children:n.username})]}),f.jsx("button",{type:"button",onClick:a,className:"follow-mode__disconnect-btn",children:hl})]})}),AY=jY,RY=class{constructor(){L(this,"targets",new WeakMap),L(this,"rafIds",new WeakMap)}register(e,t){this.targets.set(e,{callback:t,stopped:!0})}start(e){let t=this.targets.get(e);t&&(this.rafIds.has(e)||(this.targets.set(e,{...t,stopped:!1}),this.scheduleFrame(e)))}stop(e){let t=this.targets.get(e);t&&!t.stopped&&this.targets.set(e,{...t,stopped:!0}),this.cancelFrame(e)}constructFrame(e){return t=>{let n=this.targets.get(e);if(!n)return;let a=this.onFrame(n,t);!n.stopped&&!a?this.scheduleFrame(e):this.cancelFrame(e)}}scheduleFrame(e){let t=requestAnimationFrame(this.constructFrame(e));this.rafIds.set(e,t)}cancelFrame(e){if(this.rafIds.has(e)){let t=this.rafIds.get(e);cancelAnimationFrame(t)}this.rafIds.delete(e)}onFrame(e,t){return e.callback(t)??!1}},_0=class{constructor(e,t,n){this.animationFrameHandler=e,this.app=t,this.options=n,L(this,"currentTrail"),L(this,"pastTrails",[]),L(this,"container"),L(this,"trailElement"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.trailElement=document.createElementNS(Le,"path")}get hasCurrentTrail(){return!!this.currentTrail}hasLastPoint(e,t){if(this.currentTrail){let n=this.currentTrail.originalPoints.length;return this.currentTrail.originalPoints[n-1][0]===e&&this.currentTrail.originalPoints[n-1][1]===t}return!1}start(e){e&&(this.container=e),this.trailElement.parentNode!==this.container&&this.container&&this.container.appendChild(this.trailElement),this.animationFrameHandler.start(this)}stop(){var e;this.animationFrameHandler.stop(this),this.trailElement.parentNode===this.container&&((e=this.container)==null||e.removeChild(this.trailElement))}startPath(e,t){this.currentTrail=new bu(this.options),this.currentTrail.addPoint([e,t,performance.now()]),this.update()}addPointToPath(e,t){this.currentTrail&&(this.currentTrail.addPoint([e,t,performance.now()]),this.update())}endPath(){this.currentTrail&&(this.currentTrail.close(),this.currentTrail.options.keepHead=!1,this.pastTrails.push(this.currentTrail),this.currentTrail=void 0,this.update())}update(){this.start()}onFrame(){let e=[];for(let n of this.pastTrails)e.push(this.drawTrail(n,this.app.state));if(this.currentTrail){let n=this.drawTrail(this.currentTrail,this.app.state);e.push(n)}this.pastTrails=this.pastTrails.filter(n=>n.getStrokeOutline().length!==0),e.length===0&&this.stop();let t=e.join(" ").trim();this.trailElement.setAttribute("d",t),this.trailElement.setAttribute("fill",(this.options.fill??(()=>"black"))(this))}drawTrail(e,t){let n=e.getStrokeOutline(e.options.size/t.zoom.value).map(([a,i])=>{let r=Nn({sceneX:a,sceneY:i},t);return[r.x,r.y]});return uM(n,!0)}},LY=class{constructor(e,t){this.animationFrameHandler=e,this.app=t,L(this,"localTrail"),L(this,"collabTrails",new Map),L(this,"container"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.localTrail=new _0(e,t,{...this.getTrailOptions(),fill:()=>t8})}getTrailOptions(){return{simplify:0,streamline:.4,sizeMapping:e=>{let t=Math.max(0,1-(performance.now()-e.pressure)/1e3),n=(50-Math.min(50,e.totalLength-e.currentIndex))/50;return Math.min(Lr(n),Lr(t))}}}startPath(e,t){this.localTrail.startPath(e,t)}addPointToPath(e,t){this.localTrail.addPointToPath(e,t)}endPath(){this.localTrail.endPath()}start(e){this.container=e,this.animationFrameHandler.start(this),this.localTrail.start(e)}stop(){this.animationFrameHandler.stop(this),this.localTrail.stop()}onFrame(){this.updateCollabTrails()}updateCollabTrails(){if(!(!this.container||this.app.state.collaborators.size===0)){for(let[e,t]of this.app.state.collaborators.entries()){let n;this.collabTrails.has(e)?n=this.collabTrails.get(e):(n=new _0(this.animationFrameHandler,this.app,{...this.getTrailOptions(),fill:()=>{var a;return((a=t.pointer)==null?void 0:a.laserColor)||kf(e,t)}}),n.start(this.container),this.collabTrails.set(e,n)),t.pointer&&t.pointer.tool==="laser"&&(t.button==="down"&&!n.hasCurrentTrail&&n.startPath(t.pointer.x,t.pointer.y),t.button==="down"&&n.hasCurrentTrail&&!n.hasLastPoint(t.pointer.x,t.pointer.y)&&n.addPointToPath(t.pointer.x,t.pointer.y),t.button==="up"&&n.hasCurrentTrail&&(n.addPointToPath(t.pointer.x,t.pointer.y),n.endPath()))}for(let e of this.collabTrails.keys())this.app.state.collaborators.has(e)||(this.collabTrails.get(e).stop(),this.collabTrails.delete(e))}}},DY=(e,t,n,a,i,r)=>{let{zoom:s}=a,l=180*n/Math.PI,c=e*(s.value-1)/2,d=t*(s.value-1)/2;return e>i&&s.value!==1&&(c=i*(s.value-1)/2),t>r&&s.value!==1&&(d=r*(s.value-1)/2),`translate(${c}px, ${d}px) scale(${s.value}) rotate(${l}deg)`},PY=({id:e,onChange:t,onSubmit:n,getViewportCoords:a,element:i,canvas:r,excalidrawContainer:s,app:l,autoSelect:c=!0})=>{let d=(O,$)=>{if(!$.style.fontFamily||!$.style.fontSize)return!1;let P=$.style.fontFamily.replace(/"/g,"");return Ys({fontFamily:O.fontFamily})!==P||`${O.fontSize}px`!==$.style.fontSize},o=()=>{var Y;let O=l.state,$=(Y=vi.getScene(i))==null?void 0:Y.getElement(e);if(!$)return;let{textAlign:P,verticalAlign:W}=$,F=l.scene.getNonDeletedElementsMap();if($&&q($)){let Q=$.x,le=$.y,ie=zt($,l.scene.getNonDeletedElementsMap()),Te=$.width,_e=$.height,Ie=$.width,oe=$.height;if(ie&&$.containerId){if(xe(ie)){let ya=J.getBoundTextElementPosition(ie,$,F);Q=ya.x,le=ya.y}let os=d($,u),hr;if(os?hr=nu(ie.id,ie.height):(hr=nl[ie.id],hr||(hr=nu(ie.id,ie.height))),Ie=bi(ie,$),oe=tf(ie,$),!xe(ie)&&_e>oe){let ya=Jr(_e,ie.type);G(ie,{height:ya});return}else if(!xe(ie)&&ie.height>hr.height&&_e<oe){let ya=Jr(_e,ie.type);G(ie,{height:ya})}else{let{y:ya}=ef(ie,$,F);le=ya}}let[ue,Fe]=a(Q,le),Ee=u.selectionStart,je=u.selectionEnd,gt=u.value.length;if(Ee===je&&je!==gt){let os=gt-je;u.selectionStart=u.value.length-os,u.selectionEnd=u.value.length-os}ie?Te+=.5:(Ie=(O.width-8-ue)/O.zoom.value,Te=Math.min(Te,Ie)),_e*=1.05;let fr=Ve($),vl=(O.height-Fe)/O.zoom.value;Object.assign(u.style,{font:fr,lineHeight:$.lineHeight,width:`${Te}px`,height:`${_e}px`,left:`${ue}px`,top:`${Fe}px`,transform:DY(Te,_e,VD($,ie),O,Ie,vl),textAlign:P,verticalAlign:W,color:$.strokeColor,opacity:$.opacity/100,filter:"var(--theme-filter)",maxHeight:`${vl}px`}),u.scrollTop=0,pi()&&(u.style.fontFamily=Ys($)),G($,{x:Q,y:le})}},u=document.createElement("textarea");u.dir="auto",u.tabIndex=0,u.dataset.type="wysiwyg",u.wrap="off",u.classList.add("excalidraw-wysiwyg");let h="pre",p="normal";(at(i)||!i.autoResize)&&(h="pre-wrap",p="break-word"),Object.assign(u.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:p,whiteSpace:h,overflowWrap:"break-word",boxSizing:"content-box"}),u.value=i.originalText,o(),t&&(u.onpaste=async O=>{let $=await M3(O,!0);if(!$.text)return;let P=Ks($.text);if(!P)return;let W=zt(i,l.scene.getNonDeletedElementsMap()),F=Ve({fontSize:l.state.currentItemFontSize,fontFamily:l.state.currentItemFontFamily});if(W){let Y=ge(W,l.scene.getNonDeletedElementsMap()),Q=rs(`${u.value}${P}`,F,bi(W,Y)),le=Y0(Q,F);u.style.width=`${le}px`}},u.oninput=()=>{let O=Ks(u.value);if(u.value!==O){let $=u.selectionStart;u.value=O,u.selectionStart=$,u.selectionEnd=$}t(u.value)}),u.onkeydown=O=>{if(!O.shiftKey&&W6.keyTest(O))O.preventDefault(),l.actionManager.executeAction(W6),o();else if(!O.shiftKey&&V6.keyTest(O))O.preventDefault(),l.actionManager.executeAction(V6),o();else if(!O.shiftKey&&G6.keyTest(O))O.preventDefault(),l.actionManager.executeAction(G6),o();else if(B6.keyTest(O))l.actionManager.executeAction(B6);else if(H6.keyTest(O))l.actionManager.executeAction(H6);else if(O.key===D.ESCAPE)O.preventDefault(),E=!0,S();else if(O.key===D.ENTER&&O[D.CTRL_OR_CMD]){if(O.preventDefault(),O.isComposing||O.keyCode===229)return;E=!0,S()}else if(O.key===D.TAB||O[D.CTRL_OR_CMD]&&(O.code===Re.BRACKET_LEFT||O.code===Re.BRACKET_RIGHT)){if(O.preventDefault(),O.isComposing)return;O.shiftKey||O.code===Re.BRACKET_LEFT?v():b(),u.dispatchEvent(new Event("input"))}};let U=4,m=" ".repeat(U),g=new RegExp(`^ {1,${U}}`),b=()=>{let{selectionStart:O,selectionEnd:$}=u,P=x(),W=u.value;P.forEach(F=>{let Y=W.slice(0,F),Q=W.slice(F);W=`${Y}${m}${Q}`}),u.value=W,u.selectionStart=O+U,u.selectionEnd=$+U*P.length},v=()=>{let{selectionStart:O,selectionEnd:$}=u,P=x(),W=[],F=u.value;P.forEach(Y=>{let Q=F.slice(Y,Y+U).match(g);if(Q){let le=F.slice(0,Y),ie=F.slice(Y+Q[0].length);F=`${le}${ie}`,W.push(Y)}}),u.value=F,W.length&&(O>W[W.length-1]?u.selectionStart=Math.max(O-U,W[W.length-1]):u.selectionStart=O,u.selectionEnd=Math.max(u.selectionStart,$-U*W.length))},x=()=>{let{selectionStart:O,selectionEnd:$,value:P}=u,W=P.slice(0,O).match(/[^\n]*$/)[0].length;return O=O-W,P.slice(O,$).split(`
|
|
136
|
+
`).reduce((F,Y,Q,le)=>F.concat(Q?F[Q-1]+le[Q-1].length+1:O),[]).reverse()},y=O=>{O.target instanceof HTMLCanvasElement&&(O.preventDefault(),O.stopPropagation())},E=!1,S=()=>{var P,W;if(R)return;R=!0,w();let O=(P=vi.getScene(i))==null?void 0:P.getElement(i.id);if(!O)return;let $=zt(O,l.scene.getNonDeletedElementsMap());if($){if(u.value.trim()){let F=gi($);!F||F!==i.id?G($,{boundElements:($.boundElements||[]).concat({type:"text",id:i.id})}):xe($)&&uc($)}else G($,{boundElements:(W=$.boundElements)==null?void 0:W.filter(F=>!q(F))});on(O,$,l.scene.getNonDeletedElementsMap())}n({viaKeyboard:E,nextOriginalText:u.value})},w=()=>{u.onblur=null,u.oninput=null,u.onkeydown=null,N&&N.disconnect(),window.removeEventListener("resize",o),window.removeEventListener("wheel",y,!0),window.removeEventListener("pointerdown",_),window.removeEventListener("pointerup",k),window.removeEventListener("blur",S),window.removeEventListener("beforeunload",S),j(),A(),u.remove()},k=O=>{window.removeEventListener("pointerup",k);let $=O==null?void 0:O.target,P=$ instanceof HTMLElement&&$.classList.contains("properties-trigger");setTimeout(()=>{u.onblur=S,P||u.focus()})},T=()=>{u.onblur=null,window.addEventListener("pointerup",k),window.addEventListener("blur",S)},_=O=>{let $=O==null?void 0:O.target;if(O.button===Li.WHEEL){$ instanceof HTMLTextAreaElement&&(O.preventDefault(),l.handleCanvasPanUsingWheelOrSpaceDrag(O)),T();return}let P=$ instanceof HTMLElement&&$.classList.contains("properties-trigger");(O.target instanceof HTMLElement||O.target instanceof SVGElement)&&O.target.closest(`.${Ws.SHAPE_ACTIONS_MENU}, .${Ws.ZOOM_ACTIONS}`)&&!Er(O.target)||P?T():O.target instanceof HTMLCanvasElement&&!pi()&&requestAnimationFrame(()=>{S()})},j=l.scene.onUpdate(()=>{var O;o(),(O=document.activeElement)!=null&&O.closest(".properties-content")||u.focus()}),A=l.onScrollChangeEmitter.on(()=>{o()}),R=!1;c&&u.select(),k();let N=null;r&&"ResizeObserver"in window?(N=new window.ResizeObserver(()=>{o()}),N.observe(r)):window.addEventListener("resize",o),u.onpointerdown=O=>O.stopPropagation(),requestAnimationFrame(()=>{window.addEventListener("pointerdown",_,{capture:!0})}),window.addEventListener("beforeunload",S),s==null||s.querySelector(".excalidraw-textEditorContainer").appendChild(u)},NY=Z({name:"autoResize",label:"labels.autoResize",icon:null,trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=ve(e,t);return i.length===1&&q(i[0])&&!i[0].autoResize},perform:(e,t,n,a)=>{let i=ve(e,t);return{appState:t,elements:e.map(r=>{if(r.id===i[0].id&&q(r)){let s=an(r.originalText,Ve(r),r.lineHeight);return Ue(r,{autoResize:!0,width:s.width,height:s.height,text:r.originalText})}return r}),captureUpdate:X.IMMEDIATELY}}}),OY=e=>{let t=["flowchart","graph","sequenceDiagram","classDiagram","stateDiagram","stateDiagram-v2","erDiagram","journey","gantt","pie","quadrantChart","requirementDiagram","gitGraph","C4Context","mindmap","timeline","zenuml","sankey","xychart","block"];return new RegExp(`^(?:%%{.*?}%%[\\s\\n]*)?\\b(?:${t.map(n=>`\\s*${n}(-beta)?`).join("|")})\\b`).test(e.trim())},Sy=({canvas:e,rc:t,newElement:n,elementsMap:a,allElementsMap:i,scale:r,appState:s,renderConfig:l})=>{if(e){let[c,d]=xp(e,r),o=yp({canvas:e,scale:r,normalizedWidth:c,normalizedHeight:d});o.save(),o.scale(s.zoom.value,s.zoom.value),n&&n.type!=="selection"?wr(n,a,i,t,o,l,s):o.clearRect(0,0,c,d)}},$Y=Ou(e=>{Sy(e)},{trailing:!0}),FY=(e,t)=>{if(t){$Y(e);return}Sy(e)},zY=e=>{let t=M.useRef(null);return M.useEffect(()=>{t.current&&FY({canvas:t.current,scale:e.scale,newElement:e.appState.newElement,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,rc:e.rc,renderConfig:e.renderConfig,appState:e.appState},TU())}),f.jsx("canvas",{className:"excalidraw__canvas",style:{width:e.appState.width,height:e.appState.height},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:t})},BY=zY,Cy=M.createContext(null),ky=M.createContext(null),My={viewport:{isMobile:!1,isLandscape:!1},editor:{isMobile:!1,canFitSidebar:!1},isTouchScreen:!1},_U=M.createContext(My);_U.displayName="DeviceContext";var jU=M.createContext({container:null,id:null});jU.displayName="ExcalidrawContainerContext";var AU=M.createContext([]);AU.displayName="ExcalidrawElementsContext";var RU=M.createContext({...za(),width:0,height:0,offsetLeft:0,offsetTop:0});RU.displayName="ExcalidrawAppStateContext";var LU=M.createContext(()=>{console.warn("Uninitialized ExcalidrawSetAppStateContext context!")});LU.displayName="ExcalidrawSetAppStateContext";var DU=M.createContext(null);DU.displayName="ExcalidrawActionManagerContext";var va=()=>M.useContext(Cy),mc=()=>M.useContext(ky),Tt=()=>M.useContext(_U),qa=()=>M.useContext(jU),Tf=()=>M.useContext(AU),gc=()=>M.useContext(RU),_t=()=>M.useContext(LU),En=()=>M.useContext(DU),Pl=!1,Jh=0,mr=!1,Nl=!1,Qh=!1,e1={horizontal:null,vertical:null},Ai=0,Ol=!1,t1=new Map,Kc=!1,V5=0,G5=!1,gr=null,De={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},HY=class Iy extends M.Component{constructor(t){super(t),L(this,"canvas"),L(this,"interactiveCanvas",null),L(this,"rc"),L(this,"unmounted",!1),L(this,"actionManager"),L(this,"device",My),L(this,"excalidrawContainerRef",M.createRef()),L(this,"scene"),L(this,"fonts"),L(this,"renderer"),L(this,"visibleElements"),L(this,"resizeObserver"),L(this,"nearestScrollableContainer"),L(this,"library"),L(this,"libraryItemsFromStorage"),L(this,"id"),L(this,"store"),L(this,"history"),L(this,"excalidrawContainerValue"),L(this,"files",{}),L(this,"imageCache",new Map),L(this,"iFrameRefs",new Map),L(this,"embedsValidationStatus",new Map),L(this,"initializedEmbeds",new Set),L(this,"elementsPendingErasure",new Set),L(this,"flowChartCreator",new oV),L(this,"flowChartNavigator",new lV),L(this,"hitLinkElement"),L(this,"lastPointerDownEvent",null),L(this,"lastPointerUpEvent",null),L(this,"lastPointerMoveEvent",null),L(this,"lastPointerMoveCoords",null),L(this,"lastViewportPosition",{x:0,y:0}),L(this,"animationFrameHandler",new RY),L(this,"laserTrails",new LY(this.animationFrameHandler,this)),L(this,"eraserTrail",new _0(this.animationFrameHandler,this,{streamline:.2,size:5,keepHead:!0,sizeMapping:o=>{let u=Math.max(0,1-(performance.now()-o.pressure)/200),h=(10-Math.min(10,o.totalLength-o.currentIndex))/10;return Math.min(Lr(h),Lr(u))},fill:()=>this.state.theme===ke.LIGHT?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.2)"})),L(this,"onChangeEmitter",new Ta),L(this,"onPointerDownEmitter",new Ta),L(this,"onPointerUpEmitter",new Ta),L(this,"onUserFollowEmitter",new Ta),L(this,"onScrollChangeEmitter",new Ta),L(this,"missingPointerEventCleanupEmitter",new Ta),L(this,"onRemoveEventListenersEmitter",new Ta),L(this,"getEffectiveGridSize",()=>No(this)?this.state.gridSize:null),L(this,"updateEmbedValidationStatus",(o,u)=>{this.embedsValidationStatus.set(o.id,u),dt.delete(o)}),L(this,"updateEmbeddables",()=>{let o=new Set,u=!1;this.scene.getNonDeletedElements().filter(h=>{if(Un(h)){if(o.add(h.id),!this.embedsValidationStatus.has(h.id)){u=!0;let p=md(h.link,this.props.validateEmbeddable);this.updateEmbedValidationStatus(h,p)}}else Oi(h)&&o.add(h.id);return!1}),u&&this.scene.triggerUpdate(),this.iFrameRefs.forEach((h,p)=>{o.has(p)||this.iFrameRefs.delete(p)})}),L(this,"getFrameNameDOMId",o=>`${this.id}-frame-name-${o.id}`),L(this,"frameNameBoundsCache",{get:o=>{let u=this.frameNameBoundsCache._cache.get(o.id);if(!u||u.zoom!==this.state.zoom.value||u.versionNonce!==o.versionNonce){let h=document.getElementById(this.getFrameNameDOMId(o));if(h){let p=h.getBoundingClientRect(),U=Ze({clientX:p.x,clientY:p.y},this.state),m=Ze({clientX:p.right,clientY:p.bottom},this.state);return u={x:U.x,y:U.y,width:m.x-U.x,height:m.y-U.y,angle:0,zoom:this.state.zoom.value,versionNonce:o.versionNonce},this.frameNameBoundsCache._cache.set(o.id,u),u}return null}return u},_cache:new Map}),L(this,"resetEditingFrame",o=>{var u;o&&G(o,{name:((u=o.name)==null?void 0:u.trim())||null}),this.setState({editingFrame:null})}),L(this,"renderFrameNames",()=>{if(!this.state.frameRendering.enabled||!this.state.frameRendering.name)return this.state.editingFrame&&this.resetEditingFrame(null),null;let o=this.state.theme===ke.DARK;return this.scene.getNonDeletedFramesLikes().map(u=>{if(!du(u,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap()))return this.state.editingFrame===u.id&&this.resetEditingFrame(u),null;let{x:h,y:p}=Nn({sceneX:u.x,sceneY:u.y},this.state),U=6,m,g=N3(u);if(u.id===this.state.editingFrame){let b=g;m=f.jsx("input",{autoFocus:!0,value:b,onChange:v=>{G(u,{name:v.target.value})},onFocus:v=>v.target.select(),onBlur:()=>this.resetEditingFrame(u),onKeyDown:v=>{(v.key===D.ESCAPE||v.key===D.ENTER)&&this.resetEditingFrame(u)},style:{background:this.state.viewBackgroundColor,filter:o?z0:"none",zIndex:2,border:"none",display:"block",padding:`${U}px`,borderRadius:4,boxShadow:"inset 0 0 0 1px var(--color-primary)",fontFamily:"Assistant",fontSize:"14px",transform:`translate(-${U}px, ${U}px)`,color:"var(--color-gray-80)",overflow:"hidden",maxWidth:`${document.body.clientWidth-h-U}px`},size:b.length+1||1,dir:"auto",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off"})}else m=g;return f.jsx("div",{id:this.getFrameNameDOMId(u),style:{position:"absolute",bottom:`${this.state.height+ot.nameOffsetY-p+this.state.offsetTop}px`,left:`${h-this.state.offsetLeft}px`,zIndex:2,fontSize:ot.nameFontSize,color:o?ot.nameColorDarkTheme:ot.nameColorLightTheme,lineHeight:ot.nameLineHeight,width:"max-content",maxWidth:`${u.width}px`,overflow:u.id===this.state.editingFrame?"visible":"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:He.MOVE,pointerEvents:this.state.viewModeEnabled?ps.disabled:ps.enabled},onPointerDown:b=>this.handleCanvasPointerDown(b),onWheel:b=>this.handleWheel(b),onContextMenu:this.handleCanvasContextMenu,onDoubleClick:()=>{this.setState({editingFrame:u.id})},children:m},u.id)})}),L(this,"focusContainer",()=>{var o;(o=this.excalidrawContainerRef.current)==null||o.focus()}),L(this,"getSceneElementsIncludingDeleted",()=>this.scene.getElementsIncludingDeleted()),L(this,"getSceneElements",()=>this.scene.getNonDeletedElements()),L(this,"onInsertElements",o=>{this.addElementsFromPasteOrLibrary({elements:o,position:"center",files:null})}),L(this,"onExportImage",async(o,u,h)=>{Qe("export",o,"ui");let p=await Cf(o,u,this.state,this.files,{exportBackground:this.state.exportBackground,name:this.getName(),viewBackgroundColor:this.state.viewBackgroundColor,exportingFrame:h.exportingFrame}).catch(m8).catch(U=>{console.error(U),this.setState({errorMessage:U.message})});this.state.exportEmbedScene&&p&&Vp(p)&&this.setState({fileHandle:p})}),L(this,"magicGenerations",new Map),L(this,"updateMagicGeneration",({frameElement:o,data:u})=>{u.status==="pending"?G(o,{customData:{generationData:void 0}},!1):G(o,{customData:{generationData:u}},!1),this.magicGenerations.set(o.id,u),this.triggerRender()}),L(this,"plugins",{}),L(this,"onMagicframeToolSelect",()=>{let o=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds});if(o.length===0)this.setActiveTool({type:Rt.magicframe}),Qe("ai","tool-select (empty-selection)","d2c");else{let u=o.length===1&&cd(o[0])&&o[0];if(!u&&o.some(p=>de(p)||p.frameId)){this.setActiveTool({type:Rt.magicframe});return}Qe("ai","tool-select (existing selection)","d2c");let h;if(u)h=u;else{let[p,U,m,g]=$e(o),b=50;h=O1({...ot,x:p-b,y:U-b,width:m-p+b*2,height:g-U+b*2,opacity:100,locked:!1}),this.scene.insertElement(h);for(let v of o)G(v,{frameId:h.id});this.setState({selectedElementIds:{[h.id]:!0}})}this.onMagicFrameGenerate(h,"upstream")}}),L(this,"openEyeDropper",({type:o})=>{sa.set(yf,{swapPreviewOnAlt:!0,colorPickerType:o==="stroke"?"elementStroke":"elementBackground",onSelect:(u,h)=>{let p=o==="background"&&h.altKey||o==="stroke"&&!h.altKey;!this.scene.getSelectedElements(this.state).length||this.state.activeTool.type!=="selection"?p?this.syncActionResult({appState:{...this.state,currentItemStrokeColor:u},captureUpdate:X.IMMEDIATELY}):this.syncActionResult({appState:{...this.state,currentItemBackgroundColor:u},captureUpdate:X.IMMEDIATELY}):this.updateScene({elements:this.scene.getElementsIncludingDeleted().map(U=>this.state.selectedElementIds[U.id]?Ue(U,{[p?"strokeColor":"backgroundColor"]:u}):U),captureUpdate:X.IMMEDIATELY})},keepOpenOnAlt:!1})}),L(this,"dismissLinearEditor",()=>{setTimeout(()=>{this.setState({editingLinearElement:null})})}),L(this,"syncActionResult",ut(o=>{var p,U,m,g,b,v;if(this.unmounted||o===!1)return;o.captureUpdate===X.NEVER?this.store.shouldUpdateSnapshot():o.captureUpdate===X.IMMEDIATELY&&this.store.shouldCaptureIncrement();let u=!1,h=null;if(o.elements&&(this.scene.replaceAllElements(o.elements),u=!0),o.files&&(this.addMissingFiles(o.files,o.replaceFiles),this.addNewImagesToImageCache()),o.appState||h||this.state.contextMenu){let x=((p=o==null?void 0:o.appState)==null?void 0:p.viewModeEnabled)||!1,y=((U=o==null?void 0:o.appState)==null?void 0:U.zenModeEnabled)||!1,E=((m=o==null?void 0:o.appState)==null?void 0:m.theme)||this.props.theme||ke.LIGHT,S=((g=o==null?void 0:o.appState)==null?void 0:g.name)??this.state.name,w=((b=o==null?void 0:o.appState)==null?void 0:b.errorMessage)??this.state.errorMessage;typeof this.props.viewModeEnabled<"u"&&(x=this.props.viewModeEnabled),typeof this.props.zenModeEnabled<"u"&&(y=this.props.zenModeEnabled),h=((v=o.appState)==null?void 0:v.editingTextElement)||null,o.elements&&h&&o.elements.forEach(k=>{(h==null?void 0:h.id)===k.id&&h!==k&&Y1(k)&&q(k)&&(h=k)}),h!=null&&h.isDeleted&&(h=null),this.setState(k=>{let T=o.appState||{};return{...k,...T,contextMenu:null,editingTextElement:h,viewModeEnabled:x,zenModeEnabled:y,theme:E,name:S,errorMessage:w}}),u=!0}!u&&o.captureUpdate!==X.EVENTUALLY&&this.scene.triggerUpdate()})),L(this,"onBlur",ut(()=>{mr=!1,this.setState({isBindingEnabled:!0})})),L(this,"onUnload",()=>{this.onBlur()}),L(this,"disableEvent",o=>{o.preventDefault()}),L(this,"resetHistory",()=>{this.history.clear()}),L(this,"resetStore",()=>{this.store.clear()}),L(this,"resetScene",ut(o=>{this.scene.replaceAllElements([]),this.setState(u=>({...za(),isLoading:o!=null&&o.resetLoadingState?!1:u.isLoading,theme:this.state.theme})),this.resetStore(),this.resetHistory()})),L(this,"initializeScene",async()=>{var h;"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(async p=>{if(!p.files.length)return;let U=p.files[0],m=await U.getFile();this.loadFileToCanvas(new File([m],m.name||"",{type:m.type}),U)}),this.props.theme&&this.setState({theme:this.props.theme}),this.state.isLoading||this.setState({isLoading:!0});let o=null;try{typeof this.props.initialData=="function"?o=await this.props.initialData()||null:o=await this.props.initialData||null,o!=null&&o.libraryItems&&this.library.updateLibrary({libraryItems:o.libraryItems,merge:!0}).catch(p=>{console.error(p)})}catch(p){console.error(p),o={appState:{errorMessage:p.message||"Encountered an error during importing or restoring scene data"}}}let u=lc(o,null,null,{repairBindings:!0});u.appState={...u.appState,theme:this.props.theme||u.appState.theme,openSidebar:((h=u.appState)==null?void 0:h.openSidebar)||this.state.openSidebar,activeTool:u.appState.activeTool.type==="image"?{...u.appState.activeTool,type:"selection"}:u.appState.activeTool,isLoading:!1,toast:this.state.toast},o!=null&&o.scrollToContent&&(u.appState={...u.appState,...Do(u.elements,{...u.appState,width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})}),this.resetStore(),this.resetHistory(),this.syncActionResult({...u,captureUpdate:X.NEVER}),this.clearImageShapeCache(),this.fonts.loadSceneFonts().then(p=>{this.fonts.onLoaded(p)}),Os(window.location.href)&&this.scrollToContent(window.location.href,{animate:!1})}),L(this,"isMobileBreakpoint",(o,u)=>o<Sk||u<kk&&o<Ck),L(this,"refreshViewportBreakpoints",()=>{if(!this.excalidrawContainerRef.current)return;let{clientWidth:o,clientHeight:u}=document.body,h=this.device.viewport,p=ld(h,{isLandscape:o>u,isMobile:this.isMobileBreakpoint(o,u)});return h!==p?(this.device={...this.device,viewport:p},!0):!1}),L(this,"refreshEditorBreakpoints",()=>{let o=this.excalidrawContainerRef.current;if(!o)return;let{width:u,height:h}=o.getBoundingClientRect(),p=this.props.UIOptions.dockedSidebarBreakpoint!=null?this.props.UIOptions.dockedSidebarBreakpoint:Mk,U=this.device.editor,m=ld(U,{isMobile:this.isMobileBreakpoint(u,h),canFitSidebar:u>p});return U!==m?(this.device={...this.device,editor:m},!0):!1}),L(this,"onResize",ut(()=>{this.scene.getElementsIncludingDeleted().forEach(o=>dt.delete(o)),this.refreshViewportBreakpoints(),this.updateDOMRect(),m1||this.refreshEditorBreakpoints(),this.setState({})})),L(this,"onFullscreenChange",()=>{var o;!document.fullscreenElement&&((o=this.state.activeEmbeddable)==null?void 0:o.state)==="active"&&this.setState({activeEmbeddable:null})}),L(this,"renderInteractiveSceneCallback",({atLeastOneVisibleElement:o,scrollBars:u,elementsMap:h})=>{u&&(e1=u);let p=this.state.editingTextElement?!1:!o&&h.size>0;this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.scheduleImageRefresh()}),L(this,"onScroll",Zs(()=>{let{offsetTop:o,offsetLeft:u}=this.getCanvasOffsets();this.setState(h=>h.offsetLeft===u&&h.offsetTop===o?null:{offsetTop:o,offsetLeft:u})},wk)),L(this,"onCut",ut(o=>{var u;!((u=this.excalidrawContainerRef.current)!=null&&u.contains(document.activeElement))||Er(o.target)||(this.actionManager.executeAction(Q6,"keyboard",o),o.preventDefault(),o.stopPropagation())})),L(this,"onCopy",ut(o=>{var u;!((u=this.excalidrawContainerRef.current)!=null&&u.contains(document.activeElement))||Er(o.target)||(this.actionManager.executeAction(kd,"keyboard",o),o.preventDefault(),o.stopPropagation())})),L(this,"onTouchStart",o=>{if(e8&&o.preventDefault(),!Pl){Pl=!0,clearTimeout(Jh),Jh=window.setTimeout(Iy.resetTapTwice,xk);return}if(Pl&&o.touches.length===1){let u=o.touches[0];this.handleCanvasDoubleClick({clientX:u.clientX,clientY:u.clientY}),Pl=!1,clearTimeout(Jh)}o.touches.length===2&&this.setState({selectedElementIds:Pe({},this.state),activeEmbeddable:null})}),L(this,"onTouchEnd",o=>{this.resetContextMenuTimer(),o.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:Pe(this.state.previousSelectedElementIds,this.state)}):De.pointers.clear()}),L(this,"pasteFromClipboard",ut(async o=>{var x,y;let u=!!Kc,h=document.activeElement,p=(x=this.excalidrawContainerRef.current)==null?void 0:x.contains(h);if(o&&!p)return;let U=document.elementFromPoint(this.lastViewportPosition.x,this.lastViewportPosition.y);if(o&&(!(U instanceof HTMLCanvasElement)||Er(h)))return;let{x:m,y:g}=Ze({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),b=(y=o==null?void 0:o.clipboardData)==null?void 0:y.files[0],v=await M3(o,u);if(!b&&!u){if(v.mixedContent)return this.addElementsFromMixedContentPaste(v.mixedContent,{isPlainPaste:u,sceneX:m,sceneY:g});if(v.text){let E=v.text.trim();E.startsWith("<svg")&&E.endsWith("</svg>")&&(b=Fg(E))}}if(Or(b)&&!v.spreadsheet){if(!this.isToolSupported("image")){this.setState({errorMessage:I("errors.imageToolNotSupported")});return}let E=this.createImageElement({sceneX:m,sceneY:g});this.insertImageElement(E,b),this.initializeImageDimensions(E),this.setState({selectedElementIds:Pe({[E.id]:!0},this.state)});return}if(this.props.onPaste)try{if(await this.props.onPaste(v,o)===!1)return}catch(E){console.error(E)}if(v.errorMessage)this.setState({errorMessage:v.errorMessage});else if(v.spreadsheet&&!u)this.setState({pasteDialog:{data:v.spreadsheet,shown:!0}});else if(v.elements){let E=v.programmaticAPI?Mu(v.elements):v.elements;this.addElementsFromPasteOrLibrary({elements:E,files:v.files||null,position:"cursor",retainSeed:u})}else if(v.text){if(v.text&&OY(v.text)){let w=await Promise.resolve().then(()=>require("./layers.Cd8Qz5rd.js")).then(k=>k.index);try{let{elements:k,files:T}=await w.parseMermaidToExcalidraw(v.text),_=Mu(k,{regenerateIds:!0});this.addElementsFromPasteOrLibrary({elements:_,files:T,position:"cursor"});return}catch(k){console.warn(`parsing pasted text as mermaid definition failed: ${k.message}`)}}let E=w8(v.text).split(/\n+/).map(w=>w.trim()).filter(Boolean),S=E.map(w=>vP(w)).filter(w=>{var k;return md(w,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(w)||((k=Rs(w))==null?void 0:k.type)==="video")});if(!Kc&&S.length>0&&S.length===E.length){let w=[];for(let k of S){let T=w[w.length-1],_=this.insertEmbeddableElement({sceneX:T?T.x+T.width+20:m,sceneY:g,link:yn(k)});_&&w.push(_)}w.length&&this.setState({selectedElementIds:Object.fromEntries(w.map(k=>[k.id,!0]))});return}this.addTextFromPaste(v.text,u)}this.setActiveTool({type:"selection"}),o==null||o.preventDefault()})),L(this,"addElementsFromPasteOrLibrary",o=>{var O,$;let u=af(o.elements,null,void 0),[h,p,U,m]=$e(u),g=qt(h,U)/2,b=qt(p,m)/2,v=typeof o.position=="object"?o.position.clientX:o.position==="cursor"?this.lastViewportPosition.x:this.state.width/2+this.state.offsetLeft,x=typeof o.position=="object"?o.position.clientY:o.position==="cursor"?this.lastViewportPosition.y:this.state.height/2+this.state.offsetTop,{x:y,y:E}=Ze({clientX:v,clientY:x},this.state),S=y-g,w=E-b,[k,T]=kt(S,w,this.getEffectiveGridSize()),_=Q7(u.map(P=>Ue(P,{x:P.x+k-h,y:P.y+T-p})),{randomizeSeed:!o.retainSeed}),j=this.scene.getElementsIncludingDeleted(),A=[...j,..._];A=(($=(O=this.props).onDuplicate)==null?void 0:$.call(O,A,j))||A,Wa(A,ce(_));let R=this.getTopLayerFrameAtSceneCoords({x:y,y:E});if(R){let P=EN(_,R);oo(A,P,R,this.state)}this.scene.replaceAllElements(A),_.forEach(P=>{if(q(P)&&at(P)){let W=zt(P,this.scene.getElementsMapIncludingDeleted());on(P,W,this.scene.getElementsMapIncludingDeleted())}}),ck&&fi.loadElementsFonts(_).then(P=>{this.fonts.onLoaded(P)}),o.files&&this.addMissingFiles(o.files),this.store.shouldCaptureIncrement();let N=Op(_);this.setState({...this.state,openSidebar:this.state.openSidebar&&this.device.editor.canFitSidebar&&sa.get(CU)?this.state.openSidebar:null,...ln({editingGroupId:null,selectedElementIds:N.reduce((P,W)=>(at(W)||(P[W.id]=!0),P),{})},this.scene.getNonDeletedElements(),this.state,this)},()=>{o.files&&this.addNewImagesToImageCache()}),this.setActiveTool({type:"selection"}),o.fitToContent&&this.scrollToContent(_,{fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()})}),L(this,"setAppState",(o,u)=>{this.setState(o,u)}),L(this,"removePointer",o=>{Ai&&this.resetContextMenuTimer(),De.pointers.delete(o.pointerId)}),L(this,"toggleLock",(o="ui")=>{this.state.activeTool.locked||Qe("toolbar","toggleLock",`${o} (${this.device.editor.isMobile?"mobile":"desktop"})`),this.setState(u=>({activeTool:{...u.activeTool,...Et(this.state,u.activeTool.locked?{type:"selection"}:u.activeTool),locked:!u.activeTool.locked}}))}),L(this,"updateFrameRendering",o=>{this.setState(u=>{let h=typeof o=="function"?o(u.frameRendering):o;return{frameRendering:{enabled:(h==null?void 0:h.enabled)??u.frameRendering.enabled,clip:(h==null?void 0:h.clip)??u.frameRendering.clip,name:(h==null?void 0:h.name)??u.frameRendering.name,outline:(h==null?void 0:h.outline)??u.frameRendering.outline}}})}),L(this,"togglePenMode",o=>{this.setState(u=>({penMode:o??!u.penMode,penDetected:!0}))}),L(this,"onHandToolToggle",()=>{this.actionManager.executeAction(WH)}),L(this,"zoomCanvas",o=>{this.setState({...Ar({viewportX:this.state.width/2+this.state.offsetLeft,viewportY:this.state.height/2+this.state.offsetTop,nextZoom:di(o)},this.state)})}),L(this,"cancelInProgressAnimation",null),L(this,"scrollToContent",(o=this.scene.getNonDeletedElements(),u)=>{var g;if(typeof o=="string"){let b;if(Os(o)?b=kP(o):b=o,b){let v=this.scene.getElementsFromId(b);v!=null&&v.length?this.scrollToContent(v,{fitToContent:(u==null?void 0:u.fitToContent)??!0,animate:(u==null?void 0:u.animate)??!0}):Os(o)&&this.setState({toast:{message:I("elementLink.notFound"),duration:3e3,closable:!0}})}return}(g=this.cancelInProgressAnimation)==null||g.call(this);let h=Array.isArray(o)?o:[o],p=this.state.zoom,U=this.state.scrollX,m=this.state.scrollY;if(u!=null&&u.fitToContent||u!=null&&u.fitToViewport){let{appState:b}=Ef({canvasOffsets:u.canvasOffsets,targetElements:h,appState:this.state,fitToViewport:!!(u!=null&&u.fitToViewport),viewportZoomFactor:u==null?void 0:u.viewportZoomFactor,minZoom:u==null?void 0:u.minZoom,maxZoom:u==null?void 0:u.maxZoom});p=b.zoom,U=b.scrollX,m=b.scrollY}else{let b=Do(h,this.state);U=b.scrollX,m=b.scrollY}if(u!=null&&u.animate){let b=this.state.scrollX,v=this.state.scrollY,x=this.state.zoom.value,y=qk({fromValues:{scrollX:b,scrollY:v,zoom:x},toValues:{scrollX:U,scrollY:m,zoom:p.value},interpolateValue:(E,S,w,k)=>{if(k==="zoom")return E*Math.pow(S/E,Lr(w))},onStep:({scrollX:E,scrollY:S,zoom:w})=>{this.setState({scrollX:E,scrollY:S,zoom:{value:w}})},onStart:()=>{this.setState({shouldCacheIgnoreZoom:!0})},onEnd:()=>{this.setState({shouldCacheIgnoreZoom:!1})},onCancel:()=>{this.setState({shouldCacheIgnoreZoom:!1})},duration:(u==null?void 0:u.duration)??500});this.cancelInProgressAnimation=()=>{y(),this.cancelInProgressAnimation=null}}else this.setState({scrollX:U,scrollY:m,zoom:p})}),L(this,"maybeUnfollowRemoteUser",()=>{this.state.userToFollow&&this.setState({userToFollow:null})}),L(this,"translateCanvas",o=>{var u;(u=this.cancelInProgressAnimation)==null||u.call(this),this.maybeUnfollowRemoteUser(),this.setState(o)}),L(this,"setToast",o=>{this.setState({toast:o})}),L(this,"restoreFileFromShare",async()=>{try{let o=await caches.open("web-share-target"),u=await o.match("shared-file");if(u){let h=await u.blob(),p=new File([h],h.name||"",{type:h.type});this.loadFileToCanvas(p,null),await o.delete("shared-file"),window.history.replaceState(null,g1,window.location.pathname)}}catch(o){this.setState({errorMessage:o.message})}}),L(this,"addFiles",ut(o=>{let{addedFiles:u}=this.addMissingFiles(o);this.clearImageShapeCache(u),this.scene.triggerUpdate(),this.addNewImagesToImageCache()})),L(this,"addMissingFiles",(o,u=!1)=>{let h=u?{}:{...this.files},p={},U=Array.isArray(o)?o:Object.values(o);for(let m of U)if(!h[m.id]&&(p[m.id]=m,h[m.id]=m,m.mimeType===ae.svg))try{let g=ZN(fg(qN(m.dataURL)),ae.svg);m.dataURL!==g&&(m.version=(m.version??1)+1,m.dataURL=g)}catch(g){console.error(g)}return this.files=h,{addedFiles:p}}),L(this,"updateScene",ut(o=>{let u=Va(o.elements??[]);if(o.captureUpdate&&o.captureUpdate!==X.EVENTUALLY){let h=this.store.snapshot.appState,p=this.store.snapshot.elements,U=o.appState?Object.assign({},h,o.appState):h,m=o.elements?this.store.filterUncomittedElements(this.scene.getElementsMapIncludingDeleted(),ce(u)):p;o.captureUpdate===X.IMMEDIATELY?this.store.captureIncrement(m,U):o.captureUpdate===X.NEVER&&this.store.updateSnapshot(m,U)}o.appState&&this.setState(o.appState),o.elements&&this.scene.replaceAllElements(u),o.collaborators&&this.setState({collaborators:o.collaborators})})),L(this,"triggerRender",o=>{o===!0?this.scene.triggerUpdate():this.setState({})}),L(this,"toggleSidebar",({name:o,tab:u,force:h})=>{var m,g;let p;h===void 0?p=((m=this.state.openSidebar)==null?void 0:m.name)===o&&((g=this.state.openSidebar)==null?void 0:g.tab)===u?null:o:p=h?o:null;let U=p?{name:p}:null;return U&&u&&(U.tab=u),this.setState({openSidebar:U}),!!p}),L(this,"updateCurrentCursorPosition",ut(o=>{this.lastViewportPosition.x=o.clientX,this.lastViewportPosition.y=o.clientY})),L(this,"getEditorUIOffsets",()=>{var U,m,g,b,v,x,y,E,S,w;let o=((b=(g=(m=(U=this.excalidrawContainerRef)==null?void 0:U.current)==null?void 0:m.querySelector(".App-toolbar"))==null?void 0:g.getBoundingClientRect())==null?void 0:b.bottom)??0,u=(y=(x=(v=this.excalidrawContainerRef)==null?void 0:v.current)==null?void 0:x.querySelector(".sidebar"))==null?void 0:y.getBoundingClientRect(),h=(w=(S=(E=this.excalidrawContainerRef)==null?void 0:E.current)==null?void 0:S.querySelector(".App-menu__left"))==null?void 0:w.getBoundingClientRect(),p=16;return Xo().rtl?{top:o+p,right:Math.max(this.state.width-((h==null?void 0:h.left)??this.state.width),0)+p,bottom:p,left:Math.max((u==null?void 0:u.right)??0,0)+p}:{top:o+p,right:Math.max(this.state.width-((u==null?void 0:u.left)??this.state.width)+p,0),bottom:p,left:Math.max((h==null?void 0:h.right)??0,0)+p}}),L(this,"onKeyDown",ut(o=>{var U,m;if("Proxy"in window&&(!o.shiftKey&&/^[A-Z]$/.test(o.key)||o.shiftKey&&/^[a-z]$/.test(o.key))&&(o=new Proxy(o,{get(g,b){let v=g[b];return typeof v=="function"?v.bind(g):b==="key"?o.shiftKey?g.key.toUpperCase():g.key.toLowerCase():v}})),!w1(o.target)){if((o.key===D.ESCAPE||o.key===D.ENTER)&&this.state.croppingElementId){this.finishImageCropping();return}let g=ve(this.scene.getNonDeletedElementsMap(),this.state);if(g.length===1&&Ne(g[0])&&o.key===D.ENTER){this.startImageCropping(g[0]);return}if(o.key===D.ESCAPE&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.clear(),this.triggerRender(!0);return}let b=Xl(o.key);if(o[D.CTRL_OR_CMD]&&b&&!o.shiftKey){o.preventDefault();let v=ve(this.scene.getNonDeletedElementsMap(),this.state);v.length===1&&Fu(v[0])&&this.flowChartCreator.createNodes(v[0],this.scene.getNonDeletedElementsMap(),this.state,b5(o.key)),(U=this.flowChartCreator.pendingNodes)!=null&&U.length&&!xd(this.flowChartCreator.pendingNodes,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(this.flowChartCreator.pendingNodes,{animate:!0,duration:300,fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()});return}if(o.altKey){let v=ve(this.scene.getNonDeletedElementsMap(),this.state);if(v.length===1&&b){o.preventDefault();let x=this.flowChartNavigator.exploreByDirection(v[0],this.scene.getNonDeletedElementsMap(),b5(o.key));if(x){this.setState(E=>({selectedElementIds:Pe({[x]:!0},E)}));let y=this.scene.getNonDeletedElementsMap().get(x);y&&!xd([y],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(y,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})}return}}}if(o[D.CTRL_OR_CMD]&&o.key===D.P&&!o.shiftKey&&!o.altKey){this.setToast({message:I("commandPalette.shortcutHint",{shortcut:tn("commandPalette")})}),o.preventDefault();return}if(o[D.CTRL_OR_CMD]&&o.key.toLowerCase()===D.V&&(Kc=o.shiftKey,clearTimeout(V5),V5=window.setTimeout(()=>{Kc=!1},100)),o[D.CTRL_OR_CMD]&&Er(o.target)&&(o.code===Re.MINUS||o.code===Re.EQUAL)){o.preventDefault();return}if(Er(o.target)&&o.key!==D.ESCAPE||Xl(o.key)&&w1(o.target))return;if(o.key===D.QUESTION_MARK){this.setState({openDialog:{name:"help"}});return}else if(o.key.toLowerCase()===D.E&&o.shiftKey&&o[D.CTRL_OR_CMD]){o.preventDefault(),this.setState({openDialog:{name:"imageExport"}});return}if(o.key===D.PAGE_UP||o.key===D.PAGE_DOWN){let g=(o.shiftKey?this.state.width:this.state.height)/this.state.zoom.value;o.key===D.PAGE_DOWN&&(g=-g),o.shiftKey?this.translateCanvas(b=>({scrollX:b.scrollX+g})):this.translateCanvas(b=>({scrollY:b.scrollY+g}))}if(((m=this.state.openDialog)==null?void 0:m.name)==="elementLinkSelector"||this.actionManager.handleKeyDown(o)||this.state.viewModeEnabled)return;if(o[D.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),Xl(o.key)){let g=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),b=g.find(ee),v=new Set;g.filter(ee).filter(S=>{let w=S.startBinding&&!g.some(T=>{var _;return T.id===((_=S.startBinding)==null?void 0:_.elementId)}),k=S.endBinding&&!g.some(T=>{var _;return T.id===((_=S.endBinding)==null?void 0:_.elementId)});return w||k}).forEach(S=>v.add(S.id)),g=g.filter(S=>!v.has(S.id));let x=this.getEffectiveGridSize()&&(o.shiftKey?t2:this.getEffectiveGridSize())||(o.shiftKey?fk:t2),y=0,E=0;o.key===D.ARROW_LEFT?y=-x:o.key===D.ARROW_RIGHT?y=x:o.key===D.ARROW_UP?E=-x:o.key===D.ARROW_DOWN&&(E=x),g.forEach(S=>{G(S,{x:S.x+y,y:S.y+E},!1),xn(S,this.scene.getNonDeletedElementsMap(),{simultaneouslyUpdated:g})}),this.setState({suggestedBindings:fh(g.filter(S=>S.id!==(b==null?void 0:b.id)||x!==0),this.scene.getNonDeletedElementsMap(),this.state.zoom)}),this.scene.triggerUpdate(),o.preventDefault()}else if(o.key===D.ENTER){let g=this.scene.getSelectedElements(this.state);if(g.length===1){let b=g[0];if(o[D.CTRL_OR_CMD])fe(b)&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==g[0].id)&&(this.store.shouldCaptureIncrement(),ee(b)||this.setState({editingLinearElement:new J(b)}));else if(q(b)||KD(b)){let v;q(b)||(v=b);let x=hh(b,this.state,this.scene.getNonDeletedElementsMap()),y=x.x,E=x.y;this.startTextEditing({sceneX:y,sceneY:E,container:v}),o.preventDefault();return}else de(b)&&this.setState({editingFrame:b.id})}}else if(!o.ctrlKey&&!o.altKey&&!o.metaKey&&!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged){let g=wL(o.key);g?(this.state.activeTool.type!==g&&Qe("toolbar",g,`keyboard (${this.device.editor.isMobile?"mobile":"desktop"})`),g==="arrow"&&this.state.activeTool.type==="arrow"&&this.setState(b=>({currentItemArrowType:b.currentItemArrowType===Ot.sharp?Ot.round:b.currentItemArrowType===Ot.round?Ot.elbow:Ot.sharp})),this.setActiveTool({type:g}),o.stopPropagation()):o.key===D.Q&&(this.toggleLock("keyboard"),o.stopPropagation())}if(o.key===D.SPACE&&De.pointers.size===0&&(mr=!0,We(this.interactiveCanvas,He.GRAB),o.preventDefault()),(o.key===D.G||o.key===D.S)&&!o.altKey&&!o[D.CTRL_OR_CMD]){let g=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!g.length)return;o.key===D.G&&(Js(this.state.activeTool.type)||g.some(b=>Js(b.type)))&&(this.setState({openPopup:"elementBackground"}),o.stopPropagation()),o.key===D.S&&(this.setState({openPopup:"elementStroke"}),o.stopPropagation())}if(!o[D.CTRL_OR_CMD]&&o.shiftKey&&o.key.toLowerCase()===D.F){let g=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!g.length)return;(this.state.activeTool.type==="text"||g.find(b=>q(b)||ge(b,this.scene.getNonDeletedElementsMap())))&&(o.preventDefault(),this.setState({openPopup:"fontFamily"}))}if(o.key===D.K&&!o.altKey&&!o[D.CTRL_OR_CMD]){this.state.activeTool.type==="laser"?this.setActiveTool({type:"selection"}):this.setActiveTool({type:"laser"});return}o[D.CTRL_OR_CMD]&&(o.key===D.BACKSPACE||o.key===D.DELETE)&&sa.set(Mf,"clearCanvas");let u=o.key.toLocaleLowerCase(),h=u===D.S&&o.shiftKey,p=o.key===D.I||u===D.G&&o.shiftKey;(h||p)&&this.openEyeDropper({type:h?"stroke":"background"})})),L(this,"onKeyUp",ut(o=>{var u,h,p,U;if(o.key===D.SPACE&&(this.state.viewModeEnabled||((u=this.state.openDialog)==null?void 0:u.name)==="elementLinkSelector"?We(this.interactiveCanvas,He.GRAB):this.state.activeTool.type==="selection"?Jn(this.interactiveCanvas):(Ma(this.interactiveCanvas,this.state),this.setState({selectedElementIds:Pe({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})),mr=!1),!o[D.CTRL_OR_CMD]&&!this.state.isBindingEnabled&&this.setState({isBindingEnabled:!0}),Xl(o.key)&&(eu(this.scene.getSelectedElements(this.state).filter(fe),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,_r(this.state),((h=this.state.selectedLinearElement)==null?void 0:h.selectedPointsIndices)??[],this.state.zoom),this.setState({suggestedBindings:[]})),o.altKey||this.flowChartNavigator.isExploring&&(this.flowChartNavigator.clear(),this.syncActionResult({captureUpdate:X.IMMEDIATELY})),!o[D.CTRL_OR_CMD]&&this.flowChartCreator.isCreatingChart){(p=this.flowChartCreator.pendingNodes)!=null&&p.length&&this.scene.insertElements(this.flowChartCreator.pendingNodes);let m=(U=this.flowChartCreator.pendingNodes)==null?void 0:U[0];m&&(this.setState(g=>({selectedElementIds:Pe({[m.id]:!0},g)})),xd([m],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())||this.scrollToContent(m,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})),this.flowChartCreator.clear(),this.syncActionResult({captureUpdate:X.IMMEDIATELY})}})),L(this,"isToolSupported",o=>{var u;return((u=this.props.UIOptions.tools)==null?void 0:u[o])!==!1}),L(this,"setActiveTool",o=>{if(!this.isToolSupported(o.type)){console.warn(`"${o.type}" tool is disabled via "UIOptions.canvasActions.tools.${o.type}"`);return}let u=Et(this.state,o);u.type==="hand"?We(this.interactiveCanvas,He.GRAB):mr||Ma(this.interactiveCanvas,{...this.state,activeTool:u}),Zk(document.activeElement)&&this.focusContainer(),W0(u.type)||this.setState({suggestedBindings:[]}),u.type==="image"&&this.onImageAction({insertOnCanvasDirectly:(o.type==="image"&&o.insertOnCanvasDirectly)??!1}),this.setState(h=>{let p={snapLines:h.snapLines.length?[]:h.snapLines,originSnapOffset:null,activeEmbeddable:null};return u.type==="freedraw"&&this.store.shouldCaptureIncrement(),u.type!=="selection"?{...h,activeTool:u,selectedElementIds:Pe({},h),selectedGroupIds:Pe({},h),editingGroupId:null,multiElement:null,...p}:{...h,activeTool:u,...p}})}),L(this,"setOpenDialog",o=>{this.setState({openDialog:o})}),L(this,"setCursor",o=>{We(this.interactiveCanvas,o)}),L(this,"resetCursor",()=>{Jn(this.interactiveCanvas)}),L(this,"isTouchScreenMultiTouchGesture",()=>De.pointers.size>=2),L(this,"getName",()=>this.state.name||this.props.name||`${I("labels.untitled")}-${c2()}`),L(this,"onGestureStart",ut(o=>{o.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({selectedElementIds:Pe({},this.state),activeEmbeddable:null}),De.initialScale=this.state.zoom.value})),L(this,"onGestureChange",ut(o=>{if(o.preventDefault(),this.isTouchScreenMultiTouchGesture())return;let u=De.initialScale;u&&this.setState(h=>({...Ar({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:di(u*o.scale)},h)}))})),L(this,"onGestureEnd",ut(o=>{o.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({previousSelectedElementIds:{},selectedElementIds:Pe(this.state.previousSelectedElementIds,this.state)}),De.initialScale=null})),L(this,"startTextEditing",({sceneX:o,sceneY:u,insertAtParentCenter:h=!0,container:p,autoEdit:U=!0})=>{let m=!1,g=h&&this.getTextWysiwygSnappedToCenterPosition(o,u,this.state,p);p&&g&&(ge(p,this.scene.getNonDeletedElementsMap())||(m=!0));let b=null,v=this.scene.getSelectedElements(this.state);v.length===1?q(v[0])?b=v[0]:p?b=ge(v[0],this.scene.getNonDeletedElementsMap()):b=this.getTextElementAtPosition(o,u):b=this.getTextElementAtPosition(o,u);let x=(b==null?void 0:b.fontFamily)||this.state.currentItemFontFamily,y=(b==null?void 0:b.lineHeight)||Kr(x),E=this.state.currentItemFontSize;if(!b&&m&&p&&!xe(p)){let k=I8(Ve({fontSize:E,fontFamily:x}),y),T=T8(E,y),_=Math.max(p.height,T),j=Math.max(p.width,k);G(p,{height:_,width:j}),o=p.x+j/2,u=p.y+_/2,g&&(g=this.getTextWysiwygSnappedToCenterPosition(o,u,this.state,p))}let S=this.getTopLayerFrameAtSceneCoords({x:o,y:u}),w=b||Tn({x:g?g.elementCenterX:o,y:g?g.elementCenterY:u,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:"",fontSize:E,fontFamily:x,textAlign:g?"center":this.state.currentItemTextAlign,verticalAlign:g?Mn.MIDDLE:Nd,containerId:m?p==null?void 0:p.id:void 0,groupIds:(p==null?void 0:p.groupIds)??[],lineHeight:y,angle:(p==null?void 0:p.angle)??0,frameId:S?S.id:null});if(!b&&m&&p&&G(p,{boundElements:(p.boundElements||[]).concat({type:"text",id:w.id})}),this.setState({editingTextElement:w}),!b)if(p&&m){let k=this.scene.getElementIndex(p.id);this.scene.insertElementAtIndex(w,k+1)}else this.scene.insertElement(w);U||b||p?this.handleTextWysiwyg(w,{isExistingElement:!!b}):this.setState({newElement:w,multiElement:null})}),L(this,"startImageCropping",o=>{this.store.shouldCaptureIncrement(),this.setState({croppingElementId:o.id})}),L(this,"finishImageCropping",()=>{this.state.croppingElementId&&(this.store.shouldCaptureIncrement(),this.setState({croppingElementId:null}))}),L(this,"handleCanvasDoubleClick",o=>{if(this.state.multiElement||this.state.activeTool.type!=="selection")return;let u=this.scene.getSelectedElements(this.state),{x:h,y:p}=Ze(o,this.state);if(u.length===1&&fe(u[0])){if(o[D.CTRL_OR_CMD]&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==u[0].id)&&!ee(u[0])){this.store.shouldCaptureIncrement(),this.setState({editingLinearElement:new J(u[0])});return}else if(this.state.selectedLinearElement&&ee(u[0])){let U=J.getSegmentMidpointHitCoords(this.state.selectedLinearElement,{x:h,y:p},this.state,this.scene.getNonDeletedElementsMap()),m=U?J.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,U,this.scene.getNonDeletedElementsMap()):-1;if(m&&m>-1){this.store.shouldCaptureIncrement(),J.deleteFixedSegment(u[0],m);let g=J.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:h,y:p},this.state,this.scene.getNonDeletedElementsMap()),b=g?J.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,g,this.scene.getNonDeletedElementsMap()):null;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:{...this.state.selectedLinearElement.pointerDownState,segmentMidpoint:{index:b,value:U,added:!1}},segmentMidPointHoveredCoords:g}});return}}}if(u.length===1&&Ne(u[0])){this.startImageCropping(u[0]);return}if(Jn(this.interactiveCanvas),Pr(this.state).length>0){let U=this.getElementAtPosition(h,p),m=U&&ID(U,this.state.selectedGroupIds);if(m){this.store.shouldCaptureIncrement(),this.setState(g=>({...g,...ln({editingGroupId:m,selectedElementIds:{[U.id]:!0}},this.scene.getNonDeletedElements(),g,this)}));return}}if(Jn(this.interactiveCanvas),!o[D.CTRL_OR_CMD]&&!this.state.viewModeEnabled){let U=this.getElementAtPosition(h,p);if(Pn(U)){this.setState({activeEmbeddable:{element:U,state:"active"}});return}let m=this.getTextBindableContainerAtPosition(h,p);if(m&&(Wn(m)||!ia(m.backgroundColor)||Cs({x:h,y:p,element:m,shape:si(m,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()}))){let g=hh(m,this.state,this.scene.getNonDeletedElementsMap());h=g.x,p=g.y}this.startTextEditing({sceneX:h,sceneY:p,insertAtParentCenter:!o.altKey,container:m})}}),L(this,"getElementLinkAtPosition",(o,u)=>{let h=this.scene.getNonDeletedElements(),p=-1;for(let U=h.length-1;U>=0;U--){let m=h[U];if(u&&m.id===u.id&&(p=U),m.link&&U>=p&&ph(m,this.scene.getNonDeletedElementsMap(),this.state,C(o.x,o.y),this.device.editor.isMobile))return m}}),L(this,"redirectToLink",(o,u)=>{let h=Oe(C(this.lastPointerDownEvent.clientX,this.lastPointerDownEvent.clientY),C(this.lastPointerUpEvent.clientX,this.lastPointerUpEvent.clientY));if(!this.hitLinkElement||h>yr)return;let p=Ze(this.lastPointerDownEvent,this.state),U=this.scene.getNonDeletedElementsMap(),m=ph(this.hitLinkElement,U,this.state,C(p.x,p.y),this.device.editor.isMobile),g=Ze(this.lastPointerUpEvent,this.state),b=ph(this.hitLinkElement,U,this.state,C(g.x,g.y),this.device.editor.isMobile);if(m&&b){r5();let v=this.hitLinkElement.link;if(v){v=yn(v);let x;if(this.props.onLinkOpen&&(x=x8("excalidraw-link",o.nativeEvent),this.props.onLinkOpen({...this.hitLinkElement,link:v},x)),!(x!=null&&x.defaultPrevented)){let y=X7(v)?"_self":"_blank",E=window.open(void 0,y);E&&(E.opener=null,E.location=v)}}}}),L(this,"getTopLayerFrameAtSceneCoords",o=>{let u=this.scene.getNonDeletedElementsMap(),h=this.scene.getNonDeletedFramesLikes().filter(p=>Ig(o,p,u));return h.length?h[h.length-1]:null}),L(this,"handleCanvasPointerMove",o=>{var x,y,E,S,w,k;this.savePointer(o.clientX,o.clientY,this.state.cursorButton),this.lastPointerMoveEvent=o.nativeEvent,De.pointers.has(o.pointerId)&&De.pointers.set(o.pointerId,{x:o.clientX,y:o.clientY});let u=De.initialScale;if(De.pointers.size===2&&De.lastCenter&&u&&De.initialDistance){let T=U5(De.pointers),_=T.x-De.lastCenter.x,j=T.y-De.lastCenter.y;De.lastCenter=T;let A=m5(Array.from(De.pointers.values())),R=this.state.activeTool.type==="freedraw"&&this.state.penMode?1:A/De.initialDistance,N=R?di(u*R):this.state.zoom.value;this.setState(O=>{let $=Ar({viewportX:T.x,viewportY:T.y,nextZoom:N},O);this.translateCanvas({zoom:$.zoom,scrollX:$.scrollX+2*(_/N),scrollY:$.scrollY+2*(j/N),shouldCacheIgnoreZoom:!0})}),this.resetShouldCacheIgnoreZoomDebounced()}else De.lastCenter=De.initialDistance=De.initialScale=null;if(mr||Nl||Qh||Gs(this.state))return;let h=x5(e1,o.clientX-this.state.offsetLeft,o.clientY-this.state.offsetTop).isOverEither;!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.multiElement&&(h?Jn(this.interactiveCanvas):Ma(this.interactiveCanvas,this.state));let p=Ze(o,this.state),{x:U,y:m}=p;if(!this.state.newElement&&BD(this.state.activeTool.type)){let{originOffset:T,snapLines:_}=zD(this.scene.getNonDeletedElements(),this,{x:U,y:m},o,this.scene.getNonDeletedElementsMap());this.setState(j=>{let A=Il(j.snapLines,_),R=j.originSnapOffset?Il(j.originSnapOffset,T):T;return j.snapLines===A&&j.originSnapOffset===R?null:{snapLines:A,originSnapOffset:R}})}else!this.state.newElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.selectionElement&&this.setState(T=>T.snapLines.length?{snapLines:[]}:null);if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){let T=J.handlePointerMove(o,U,m,this,this.scene.getNonDeletedElementsMap());T&&T!==this.state.editingLinearElement&&Xt.flushSync(()=>{this.setState({editingLinearElement:T})}),(T==null?void 0:T.lastUncommittedPoint)!=null?this.maybeSuggestBindingAtCursor(p,T.elbowed):Xt.flushSync(()=>{this.setState({suggestedBindings:[]})})}if(S8(this.state.activeTool.type)){let{newElement:T}=this.state;La(T,!1)?this.maybeSuggestBindingsForLinearElementAtCoords(T,[p],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(p,!1)}if(this.state.multiElement){let{multiElement:T}=this.state,{x:_,y:j}=T,{points:A,lastCommittedPoint:R}=T,N=A[A.length-1];if(Ma(this.interactiveCanvas,this.state),N===R)Oe(C(U-_,m-j),N)>=sd?G(T,{points:[...A,C(U-_,m-j)]},!1):We(this.interactiveCanvas,He.POINTER);else if(A.length>2&&R&&Oe(C(U-_,m-j),R)<sd)We(this.interactiveCanvas,He.POINTER),G(T,{points:A.slice(0,-1)},!1);else{let[O,$]=kt(U,m,o[D.CTRL_OR_CMD]||ee(T)?null:this.getEffectiveGridSize()),[P,W]=(T==null?void 0:T.lastCommittedPoint)??[0,0],F=O-_-P,Y=$-j-W;so(o)&&({width:F,height:Y}=V1(P+_,W+j,O,$)),Ui(A,this.state.zoom.value)&&We(this.interactiveCanvas,He.POINTER),G(T,{points:[...A.slice(0,-1),C(P+F,W+Y)]},!1,{isDragging:!0}),this.triggerRender(!1)}return}if(o.buttons||this.state.activeTool.type!=="selection"&&this.state.activeTool.type!=="text"&&this.state.activeTool.type!=="eraser")return;let g=this.scene.getNonDeletedElements(),b=this.scene.getSelectedElements(this.state);if(b.length===1&&!h&&!this.state.editingLinearElement){if(this.state.selectedLinearElement&&this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,U,m),(!this.state.selectedLinearElement||this.state.selectedLinearElement.hoverPointIndex===-1)&&((x=this.state.openDialog)==null?void 0:x.name)!=="elementLinkSelector"&&!(b.length===1&&ee(b[0]))){let T=Dg(g,this.state,U,m,this.state.zoom,o.pointerType,this.scene.getNonDeletedElementsMap(),this.device);if(T&&T.transformHandleType){We(this.interactiveCanvas,Ng(T));return}}}else if(b.length>1&&!h&&((y=this.state.openDialog)==null?void 0:y.name)!=="elementLinkSelector"){let T=Pg($e(b),U,m,this.state.zoom,o.pointerType,this.device);if(T){We(this.interactiveCanvas,Ng({transformHandleType:T}));return}}let v=this.getElementAtPosition(p.x,p.y);this.hitLinkElement=this.getElementLinkAtPosition(p,v),!Ia(this.state)&&(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?(We(this.interactiveCanvas,He.POINTER),EX(this.hitLinkElement,this.state,this.scene.getNonDeletedElementsMap())):(r5(),v&&(v.link||Un(v))&&this.state.selectedElementIds[v.id]&&!this.state.contextMenu&&!this.state.showHyperlinkPopup?this.setState({showHyperlinkPopup:"info"}):this.state.activeTool.type==="text"?We(this.interactiveCanvas,q(v)?He.TEXT:He.CROSSHAIR):this.state.viewModeEnabled?We(this.interactiveCanvas,He.GRAB):((E=this.state.openDialog)==null?void 0:E.name)==="elementLinkSelector"?We(this.interactiveCanvas,He.AUTO):h?We(this.interactiveCanvas,He.AUTO):this.state.selectedLinearElement?this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,U,m):o[D.CTRL_OR_CMD]?We(this.interactiveCanvas,He.AUTO):(v||this.isHittingCommonBoundingBoxOfSelectedElements(p,b))&&!(v!=null&&v.locked)&&(v&&Pn(v)&&this.isIframeLikeElementCenter(v,o,U,m)?(We(this.interactiveCanvas,He.POINTER),this.setState({activeEmbeddable:{element:v,state:"hover"}})):(!v||!ee(v))&&(We(this.interactiveCanvas,He.MOVE),((S=this.state.activeEmbeddable)==null?void 0:S.state)==="hover"&&this.setState({activeEmbeddable:null})))),((w=this.state.openDialog)==null?void 0:w.name)==="elementLinkSelector"&&v?this.setState(T=>({hoveredElementIds:Il(T.hoveredElementIds,ln({editingGroupId:T.editingGroupId,selectedElementIds:{[v.id]:!0}},this.scene.getNonDeletedElements(),T,this).selectedElementIds)})):((k=this.state.openDialog)==null?void 0:k.name)==="elementLinkSelector"&&!v&&this.setState(T=>({hoveredElementIds:Il(T.hoveredElementIds,{})})))}),L(this,"handleEraser",(o,u,h)=>{this.eraserTrail.addPointToPath(h.x,h.y);let p=!1,U=new Set,m=this.scene.getNonDeletedElements(),g=E=>{var S;for(let w of E){if(w.locked)return;if(o.altKey?this.elementsPendingErasure.delete(w.id)&&(p=!0):this.elementsPendingErasure.has(w.id)||(p=!0,this.elementsPendingErasure.add(w.id)),p&&((S=w.groupIds)==null?void 0:S.length)){let k=w.groupIds.at(-1);if(!U.has(k)){U.add(k);let T=nt(m,k);for(let _ of T)o.altKey?this.elementsPendingErasure.delete(_.id):this.elementsPendingErasure.add(_.id)}}}},b=Oe(C(u.lastCoords.x,u.lastCoords.y),C(h.x,h.y)),v=this.getElementHitThreshold(),x={...u.lastCoords},y=0;for(;y<=b;){let E=this.getElementsAtPosition(x.x,x.y);if(g(E),y===b)break;y=Math.min(y+v,b);let S=y/b,w=(1-S)*x.x+S*h.x,k=(1-S)*x.y+S*h.y;x.x=w,x.y=k}if(u.lastCoords.x=h.x,u.lastCoords.y=h.y,p){for(let E of this.scene.getNonDeletedElements())at(E)&&(this.elementsPendingErasure.has(E.id)||this.elementsPendingErasure.has(E.containerId))&&(o.altKey?(this.elementsPendingErasure.delete(E.id),this.elementsPendingErasure.delete(E.containerId)):(this.elementsPendingErasure.add(E.id),this.elementsPendingErasure.add(E.containerId)));this.elementsPendingErasure=new Set(this.elementsPendingErasure),this.triggerRender()}}),L(this,"handleTouchMove",o=>{Ol=!0}),L(this,"handleCanvasPointerDown",o=>{var v,x,y;let u=o.target;if(u.setPointerCapture&&u.setPointerCapture(o.pointerId),this.maybeCleanupAfterMissingPointerUp(o.nativeEvent),this.maybeUnfollowRemoteUser(),this.state.searchMatches&&(this.setState(E=>({searchMatches:E.searchMatches.map(S=>({...S,focus:!1}))})),sa.set(sy,null)),this.state.contextMenu&&this.setState({contextMenu:null}),this.state.snapLines&&this.setAppState({snapLines:[]}),this.updateGestureOnPointerDown(o),o.pointerType==="touch"&&this.state.newElement&&this.state.newElement.type==="freedraw"){let E=this.state.newElement;this.updateScene({...E.points.length<10?{elements:this.scene.getElementsIncludingDeleted().filter(S=>S.id!==E.id)}:{},appState:{newElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:Pe(Object.keys(this.state.selectedElementIds).filter(S=>S!==E.id).reduce((S,w)=>(S[w]=this.state.selectedElementIds[w],S),{}),this.state)},captureUpdate:((v=this.state.openDialog)==null?void 0:v.name)==="elementLinkSelector"?X.EVENTUALLY:X.NEVER});return}let h=document.getSelection();if(h!=null&&h.anchorNode&&h.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(o),!this.state.penDetected&&o.pointerType==="pen"&&this.setState(E=>({penMode:!0,penDetected:!0})),!this.device.isTouchScreen&&["pen","touch"].includes(o.pointerType)&&(this.device=ld(this.device,{isTouchScreen:!0})),Nl||(this.lastPointerDownEvent=o,this.handleCanvasPanUsingWheelOrSpaceDrag(o)))return;if(this.setState({lastPointerDownWith:o.pointerType,cursorButton:"down"}),this.savePointer(o.clientX,o.clientY,"down"),o.button===Li.ERASER&&this.state.activeTool.type!==Rt.eraser){this.setState({activeTool:Et(this.state,{type:Rt.eraser,lastActiveToolBeforeEraser:this.state.activeTool})},()=>{this.handleCanvasPointerDown(o);let E=()=>{S(),w==null||w(),Ia(this.state)&&this.setState({activeTool:Et(this.state,{...this.state.activeTool.lastActiveTool||{type:Rt.selection},lastActiveToolBeforeEraser:null})})},S=st(window,"pointerup",E,{once:!0}),w;requestAnimationFrame(()=>{w=this.missingPointerEventCleanupEmitter.once(E)})});return}if(o.button!==Li.MAIN&&o.button!==Li.TOUCH&&o.button!==Li.ERASER||De.pointers.size>1)return;let p=this.initialPointerDownState(o);if(this.setState({selectedElementsAreBeingDragged:!1}),this.handleDraggingScrollBar(o,p)||(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(o),this.handleSelectionOnPointerDown(o,p))||!(!this.state.penMode||o.pointerType!=="touch"||this.state.activeTool.type==="selection"||this.state.activeTool.type==="text"||this.state.activeTool.type==="image"))return;if(this.state.activeTool.type==="text")this.handleTextOnPointerDown(o,p);else if(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")this.handleLinearElementOnPointerDown(o,this.state.activeTool.type,p);else if(this.state.activeTool.type==="image"){We(this.interactiveCanvas,He.CROSSHAIR);let E=this.state.pendingImageElementId&&this.scene.getElement(this.state.pendingImageElementId);if(!E)return;this.setState({newElement:E,pendingImageElementId:null,multiElement:null});let{x:S,y:w}=Ze(o,this.state),k=this.getTopLayerFrameAtSceneCoords({x:S,y:w});G(E,{x:S,y:w,frameId:k?k.id:null})}else this.state.activeTool.type==="freedraw"?this.handleFreeDrawElementOnPointerDown(o,this.state.activeTool.type,p):this.state.activeTool.type==="custom"?Ma(this.interactiveCanvas,this.state):this.state.activeTool.type===Rt.frame||this.state.activeTool.type===Rt.magicframe?this.createFrameElementOnPointerDown(p,this.state.activeTool.type):this.state.activeTool.type==="laser"?this.laserTrails.startPath(p.lastCoords.x,p.lastCoords.y):this.state.activeTool.type!=="eraser"&&this.state.activeTool.type!=="hand"&&this.createGenericElementOnPointerDown(this.state.activeTool.type,p);(y=(x=this.props)==null?void 0:x.onPointerDown)==null||y.call(x,this.state.activeTool,p),this.onPointerDownEmitter.trigger(this.state.activeTool,p,o),this.state.activeTool.type==="eraser"&&this.eraserTrail.startPath(p.lastCoords.x,p.lastCoords.y);let U=this.onPointerMoveFromPointerDownHandler(p),m=this.onPointerUpFromPointerDownHandler(p),g=this.onKeyDownFromPointerDownHandler(p),b=this.onKeyUpFromPointerDownHandler(p);this.missingPointerEventCleanupEmitter.once(E=>m(E||o.nativeEvent)),(!this.state.viewModeEnabled||this.state.activeTool.type==="laser")&&(window.addEventListener("pointermove",U),window.addEventListener("pointerup",m),window.addEventListener("keydown",g),window.addEventListener("keyup",b),p.eventListeners.onMove=U,p.eventListeners.onUp=m,p.eventListeners.onKeyUp=b,p.eventListeners.onKeyDown=g)}),L(this,"handleCanvasPointerUp",o=>{var p;this.removePointer(o),this.lastPointerUpEvent=o;let u=Ze({clientX:o.clientX,clientY:o.clientY},this.state),h=o.timeStamp-(((p=this.lastPointerDownEvent)==null?void 0:p.timeStamp)??0);if(this.device.editor.isMobile&&h<300){let U=this.getElementAtPosition(u.x,u.y);if(Pn(U)&&this.isIframeLikeElementCenter(U,o,u.x,u.y)){this.handleEmbeddableCenterClick(U);return}}if(this.device.isTouchScreen){let U=this.getElementAtPosition(u.x,u.y);this.hitLinkElement=this.getElementLinkAtPosition(u,U)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?h<300&&Pn(this.hitLinkElement)&&!u3(this.hitLinkElement,this.scene.getNonDeletedElementsMap(),this.state,C(u.x,u.y))?this.handleEmbeddableCenterClick(this.hitLinkElement):this.redirectToLink(o,this.device.isTouchScreen):this.state.viewModeEnabled&&this.setState({activeEmbeddable:null,selectedElementIds:{}})}),L(this,"maybeOpenContextMenuAfterPointerDownOnTouchDevices",o=>{o.pointerType==="touch"&&(Ol=!1,Ai?Ol=!0:Ai=window.setTimeout(()=>{Ai=0,Ol||this.handleCanvasContextMenu(o)},yk))}),L(this,"resetContextMenuTimer",()=>{clearTimeout(Ai),Ai=0,Ol=!1}),L(this,"maybeCleanupAfterMissingPointerUp",o=>{gr==null||gr(),this.missingPointerEventCleanupEmitter.trigger(o).clear()}),L(this,"handleCanvasPanUsingWheelOrSpaceDrag",o=>{if(!(De.pointers.size<=1&&(o.button===Li.WHEEL||o.button===Li.MAIN&&mr||Gs(this.state)||this.state.viewModeEnabled)))return!1;Nl=!0,this.focusContainer(),this.state.editingTextElement||o.preventDefault();let u=!1,h=typeof window===void 0?!1:/Linux/.test(window.navigator.platform);We(this.interactiveCanvas,He.GRABBING);let{clientX:p,clientY:U}=o,m=Yh(b=>{let v=p-b.clientX,x=U-b.clientY;if(p=b.clientX,U=b.clientY,h&&!u&&(Math.abs(v)>1||Math.abs(x)>1)){u=!0;let y=S=>{document.body.removeEventListener("paste",y),S.stopPropagation()},E=()=>{setTimeout(()=>{document.body.removeEventListener("paste",y),window.removeEventListener("pointerup",E)},100)};document.body.addEventListener("paste",y),window.addEventListener("pointerup",E)}this.translateCanvas({scrollX:this.state.scrollX-v/this.state.zoom.value,scrollY:this.state.scrollY-x/this.state.zoom.value})}),g=ut(gr=()=>{gr=null,Nl=!1,mr||(this.state.viewModeEnabled?We(this.interactiveCanvas,He.GRAB):Ma(this.interactiveCanvas,this.state)),this.setState({cursorButton:"up"}),this.savePointer(o.clientX,o.clientY,"up"),window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",g),window.removeEventListener("blur",g),m.flush()});return window.addEventListener("blur",g),window.addEventListener("pointermove",m,{passive:!0}),window.addEventListener("pointerup",g),!0}),L(this,"clearSelectionIfNotUsingSelection",()=>{this.state.activeTool.type!=="selection"&&this.setState({selectedElementIds:Pe({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}),L(this,"handleSelectionOnPointerDown",(o,u)=>{var h;if(this.state.activeTool.type==="selection"){let p=this.scene.getNonDeletedElements(),U=this.scene.getNonDeletedElementsMap(),m=this.scene.getSelectedElements(this.state);if(m.length===1&&!this.state.editingLinearElement&&!ee(m[0])&&!(this.state.selectedLinearElement&&this.state.selectedLinearElement.hoverPointIndex!==-1)){let g=Dg(p,this.state,u.origin.x,u.origin.y,this.state.zoom,o.pointerType,this.scene.getNonDeletedElementsMap(),this.device);g!=null&&(g.transformHandleType==="rotation"?(this.setState({resizingElement:g.element}),u.resize.handleType=g.transformHandleType):(this.state.croppingElementId||this.setState({resizingElement:g.element}),u.resize.handleType=g.transformHandleType))}else m.length>1&&(u.resize.handleType=Pg($e(m),u.origin.x,u.origin.y,this.state.zoom,o.pointerType,this.device));if(u.resize.handleType)u.resize.isResizing=!0,u.resize.offset=aa(DN(u.resize.handleType,m,U,u.origin.x,u.origin.y)),m.length===1&&fe(m[0])&&m[0].points.length===2&&(u.resize.arrowDirection=PN(u.resize.handleType,m[0]));else{if(this.state.selectedLinearElement){let v=this.state.editingLinearElement||this.state.selectedLinearElement,x=J.handlePointerDown(o,this,this.store,u.origin,v,this.scene);if(x.hitElement&&(u.hit.element=x.hitElement),x.linearElementEditor&&(this.setState({selectedLinearElement:x.linearElementEditor}),this.state.editingLinearElement&&this.setState({editingLinearElement:x.linearElementEditor})),x.didAddPoint)return!0}if(u.hit.element=u.hit.element??this.getElementAtPosition(u.origin.x,u.origin.y),this.hitLinkElement=this.getElementLinkAtPosition(u.origin,u.hit.element),this.hitLinkElement)return!0;if(this.state.croppingElementId&&((h=u.hit.element)==null?void 0:h.id)!==this.state.croppingElementId&&this.finishImageCropping(),u.hit.element&&this.getElementLinkAtPosition({x:u.origin.x,y:u.origin.y},u.hit.element))return!1;u.hit.allHitElements=this.getElementsAtPosition(u.origin.x,u.origin.y);let g=u.hit.element,b=u.hit.allHitElements.some(v=>this.isASelectedElement(v));if((g===null||!b)&&!o.shiftKey&&!u.hit.hasHitCommonBoundingBoxOfSelectedElements&&this.clearSelection(g),this.state.editingLinearElement)this.setState({selectedElementIds:Pe({[this.state.editingLinearElement.elementId]:!0},this.state)});else if(g!=null){if(o[D.CTRL_OR_CMD])return this.state.selectedElementIds[g.id]||(u.hit.wasAddedToSelection=!0),this.setState(v=>({...MD(v,g),previousSelectedElementIds:this.state.selectedElementIds})),!1;this.state.selectedElementIds[g.id]||(this.state.editingGroupId&&!Po(g,this.state.editingGroupId)&&this.setState({selectedElementIds:Pe({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),!b&&!u.hit.hasHitCommonBoundingBoxOfSelectedElements&&(this.setState(v=>{var E;let x={...v.selectedElementIds,[g.id]:!0},y=[];if(Object.keys(v.selectedElementIds).forEach(S=>{let w=this.scene.getElement(S);w&&y.push(w)}),de(g))Ga(y,g.id).forEach(S=>{delete x[S.id]});else if(g.frameId)x[g.frameId]&&delete x[g.id];else{let S=g.groupIds,w=new Set(S.flatMap(k=>nt(this.scene.getNonDeletedElements(),k)).filter(k=>de(k)).map(k=>k.id));w.size>0&&y.forEach(k=>{k.frameId&&w.has(k.frameId)&&(delete x[k.id],k.groupIds.flatMap(T=>nt(this.scene.getNonDeletedElements(),T)).forEach(T=>{delete x[T.id]}))})}return((E=v.openDialog)==null?void 0:E.name)==="elementLinkSelector"&&(g.groupIds.some(S=>v.selectedGroupIds[S])||(x={[g.id]:!0})),{...ln({editingGroupId:v.editingGroupId,selectedElementIds:x},this.scene.getNonDeletedElements(),v,this),showHyperlinkPopup:g.link||Un(g)?"info":!1}}),u.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1}),L(this,"handleTextOnPointerDown",(o,u)=>{if(this.state.editingTextElement)return;let h=u.origin.x,p=u.origin.y,U=this.getElementAtPosition(h,p,{includeBoundTextElement:!0}),m=this.getTextBindableContainerAtPosition(h,p);Wn(U)&&(m=U,h=U.x+U.width/2,p=U.y+U.height/2),this.startTextEditing({sceneX:h,sceneY:p,insertAtParentCenter:!o.altKey,container:m,autoEdit:!1}),Jn(this.interactiveCanvas),this.state.activeTool.locked||this.setState({activeTool:Et(this.state,{type:"selection"})})}),L(this,"handleFreeDrawElementOnPointerDown",(o,u,h)=>{let[p,U]=kt(h.origin.x,h.origin.y,null),m=this.getTopLayerFrameAtSceneCoords({x:p,y:U}),g=o.pressure===.5,b=rP({type:u,x:p,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:null,simulatePressure:g,locked:!1,frameId:m?m.id:null,points:[C(0,0)],pressures:g?[]:[o.pressure]});this.scene.insertElement(b),this.setState(x=>{let y={...x.selectedElementIds};return delete y[b.id],{selectedElementIds:Pe(y,x)}});let v=ra(h.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom);this.setState({newElement:b,startBoundElement:v,suggestedBindings:[]})}),L(this,"insertIframeElement",({sceneX:o,sceneY:u,width:h,height:p})=>{var b;let[U,m]=kt(o,u,(b=this.lastPointerDownEvent)!=null&&b[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=nP({type:"iframe",x:U,y:m,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("iframe"),opacity:this.state.currentItemOpacity,locked:!1,width:h,height:p});return this.scene.insertElement(g),g}),L(this,"insertEmbeddableElement",({sceneX:o,sceneY:u,link:h})=>{var b;let[p,U]=kt(o,u,(b=this.lastPointerDownEvent)!=null&&b[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=Rs(h);if(!m)return;m.error instanceof URIError&&this.setToast({message:I("toast.unrecognizedLinkFormat"),closable:!0});let g=tg({type:"embeddable",x:p,y:U,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("embeddable"),opacity:this.state.currentItemOpacity,locked:!1,width:m.intrinsicSize.w,height:m.intrinsicSize.h,link:h});return this.scene.insertElement(g),g}),L(this,"createImageElement",({sceneX:o,sceneY:u,addToFrameUnderCursor:h=!0})=>{var g;let[p,U]=kt(o,u,(g=this.lastPointerDownEvent)!=null&&g[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=h?this.getTopLayerFrameAtSceneCoords({x:p,y:U}):null;return K7({type:"image",x:p,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:null,opacity:this.state.currentItemOpacity,locked:!1,frameId:m?m.id:null})}),L(this,"handleLinearElementOnPointerDown",(o,u,h)=>{if(this.state.multiElement){let{multiElement:p}=this.state;if(p.type==="line"&&Ui(p.points,this.state.zoom.value)){G(p,{lastCommittedPoint:p.points[p.points.length-1]}),this.actionManager.executeAction(Kn);return}if(ee(p)&&p.points.length>1){G(p,{lastCommittedPoint:p.points[p.points.length-1]}),this.actionManager.executeAction(Kn);return}let{x:U,y:m,lastCommittedPoint:g}=p;if(p.points.length>1&&g&&Oe(C(h.origin.x-U,h.origin.y-m),g)<sd){this.actionManager.executeAction(Kn);return}this.setState(b=>({selectedElementIds:Pe({...b.selectedElementIds,[p.id]:!0},b)})),G(p,{lastCommittedPoint:p.points[p.points.length-1]}),We(this.interactiveCanvas,He.POINTER)}else{let[p,U]=kt(h.origin.x,h.origin.y,o[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=this.getTopLayerFrameAtSceneCoords({x:p,y:U}),{currentItemStartArrowhead:g,currentItemEndArrowhead:b}=this.state,[v,x]=u==="arrow"?[g,b]:[null,null],y=u==="arrow"?Up({type:u,x:p,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemArrowType===Ot.round?{type:St.PROPORTIONAL_RADIUS}:null,startArrowhead:v,endArrowhead:x,locked:!1,frameId:m?m.id:null,elbowed:this.state.currentItemArrowType===Ot.elbow,fixedSegments:this.state.currentItemArrowType===Ot.elbow?[]:null}):Nr({type:u,x:p,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemRoundness==="round"?{type:St.PROPORTIONAL_RADIUS}:null,locked:!1,frameId:m?m.id:null});this.setState(S=>{let w={...S.selectedElementIds};return delete w[y.id],{selectedElementIds:Pe(w,S)}}),G(y,{points:[...y.points,C(0,0)]});let E=ra(h.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,ee(y),ee(y));this.scene.insertElement(y),this.setState({newElement:y,startBoundElement:E,suggestedBindings:[]})}}),L(this,"createGenericElementOnPointerDown",(o,u)=>{var b;let[h,p]=kt(u.origin.x,u.origin.y,(b=this.lastPointerDownEvent)!=null&&b[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),U=this.getTopLayerFrameAtSceneCoords({x:h,y:p}),m={x:h,y:p,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.getCurrentItemRoundness(o),locked:!1,frameId:U?U.id:null},g;o==="embeddable"?g=tg({type:"embeddable",...m}):g=Xa({type:o,...m}),g.type==="selection"?this.setState({selectionElement:g}):(this.scene.insertElement(g),this.setState({multiElement:null,newElement:g}))}),L(this,"createFrameElementOnPointerDown",(o,u)=>{var g;let[h,p]=kt(o.origin.x,o.origin.y,(g=this.lastPointerDownEvent)!=null&&g[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),U={x:h,y:p,opacity:this.state.currentItemOpacity,locked:!1,...ot},m=u===Rt.magicframe?O1(U):pp(U);this.scene.insertElement(m),this.setState({multiElement:null,newElement:m})}),L(this,"restoreReadyToEraseElements",()=>{this.elementsPendingErasure=new Set,this.triggerRender()}),L(this,"eraseElements",()=>{let o=!1,u=this.scene.getElementsIncludingDeleted().map(h=>this.elementsPendingErasure.has(h.id)||h.frameId&&this.elementsPendingErasure.has(h.frameId)||at(h)&&this.elementsPendingErasure.has(h.containerId)?(o=!0,Ue(h,{isDeleted:!0})):h);this.elementsPendingErasure=new Set,o&&(this.store.shouldCaptureIncrement(),this.scene.replaceAllElements(u))}),L(this,"initializeImage",async({imageFile:o,imageElement:u,showCursorImagePreview:h=!1})=>{var b,v,x,y,E;if(!Or(o))throw new Error(I("errors.unsupportedFileType"));let p=o.type;if(We(this.interactiveCanvas,"wait"),p===ae.svg)try{o=Fg(fg(await o.text()),o.name)}catch(S){throw console.warn(S),new Error(I("errors.svgImageInsertError"))}let U=await(((v=(b=this.props).generateIdForFile)==null?void 0:v.call(b,o))||YN(o));if(!U)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(I("errors.imageInsertError"));if(!((x=this.files[U])!=null&&x.dataURL)){try{o=await K1(o,{maxWidthOrHeight:Ik})}catch(S){console.error("Error trying to resizing image file on insertion",S)}if(o.size>a2)throw new Error(I("errors.fileTooBig",{maxSize:`${Math.trunc(a2/1024/1024)}MB`}))}if(h){let S=(y=this.files[U])==null?void 0:y.dataURL,w=S&&KN(S);this.setImagePreviewCursor(w||o)}let m=((E=this.files[U])==null?void 0:E.dataURL)||await Z1(o),g=G(u,{fileId:U},!1);return new Promise(async(S,w)=>{var k;try{this.addMissingFiles([{mimeType:p,id:U,dataURL:m,created:Date.now(),lastRetrieved:Date.now()}]);let T=this.imageCache.get(U);T||(this.addNewImagesToImageCache(),await this.updateImageCache([g])),(T==null?void 0:T.image)instanceof Promise&&await T.image,this.state.pendingImageElementId!==g.id&&((k=this.state.newElement)==null?void 0:k.id)!==g.id&&this.initializeImageDimensions(g,!0),S(g)}catch(T){console.error(T),w(new Error(I("errors.imageInsertError")))}finally{h||Jn(this.interactiveCanvas)}})}),L(this,"insertImageElement",async(o,u,h)=>{if(!this.isToolSupported("image")){this.setState({errorMessage:I("errors.imageToolNotSupported")});return}this.scene.insertElement(o);try{return await this.initializeImage({imageFile:u,imageElement:o,showCursorImagePreview:h})}catch(p){return G(o,{isDeleted:!0}),this.actionManager.executeAction(Kn),this.setState({errorMessage:p.message||I("errors.imageInsertError")}),null}}),L(this,"setImagePreviewCursor",async o=>{let u;try{u=await K1(o,{maxWidthOrHeight:96})}catch(p){throw p.cause==="UNSUPPORTED"?new Error(I("errors.unsupportedFileType")):p}let h=await Z1(u);if(o.type===ae.svg){let p=await s3(h),U=Math.min(p.height,96),m=U*(p.width/p.height);m>96&&(m=96,U=m*(p.height/p.width));let g=document.createElement("canvas");g.height=U,g.width=m,g.getContext("2d").drawImage(p,0,0,m,U),h=g.toDataURL(ae.svg)}this.state.pendingImageElementId&&We(this.interactiveCanvas,`url(${h}) 4 4, auto`)}),L(this,"onImageAction",async({insertOnCanvasDirectly:o})=>{try{let u=this.state.width/2+this.state.offsetLeft,h=this.state.height/2+this.state.offsetTop,{x:p,y:U}=Ze({clientX:u,clientY:h},this.state),m=await gp({description:"Image",extensions:Object.keys(Vs)}),g=this.createImageElement({sceneX:p,sceneY:U,addToFrameUnderCursor:!1});o?(this.insertImageElement(g,m),this.initializeImageDimensions(g),this.setState({selectedElementIds:Pe({[g.id]:!0},this.state)},()=>{this.actionManager.executeAction(Kn)})):this.setState({pendingImageElementId:g.id},()=>{this.insertImageElement(g,m,!0)})}catch(u){u.name!=="AbortError"?console.error(u):console.warn(u),this.setState({pendingImageElementId:null,newElement:null,activeTool:Et(this.state,{type:"selection"})},()=>{this.actionManager.executeAction(Kn)})}}),L(this,"initializeImageDimensions",(o,u=!1)=>{var p;let h=Dn(o)&&((p=this.imageCache.get(o.fileId))==null?void 0:p.image);if(!h||h instanceof Promise){if(o.width<yr/this.state.zoom.value&&o.height<yr/this.state.zoom.value){let U=100/this.state.zoom.value;G(o,{x:o.x-U/2,y:o.y-U/2,width:U,height:U})}return}if(u||o.width<yr/this.state.zoom.value&&o.height<yr/this.state.zoom.value){let U=Math.max(this.state.height-120,160),m=Math.min(U,Math.floor(this.state.height*.5)/this.state.zoom.value),g=Math.min(h.naturalHeight,m),b=g*(h.naturalWidth/h.naturalHeight),v=o.x+o.width/2-b/2,x=o.y+o.height/2-g/2;G(o,{x:v,y:x,width:b,height:g,crop:null})}}),L(this,"updateImageCache",async(o,u=this.files)=>{let{updatedFiles:h,erroredFiles:p}=await l3({imageCache:this.imageCache,fileIds:o.map(U=>U.fileId),files:u});if(h.size||p.size)for(let U of o)h.has(U.fileId)&&dt.delete(U);return p.size&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(U=>Dn(U)&&p.has(U.fileId)?Ue(U,{status:"error"}):U)),{updatedFiles:h,erroredFiles:p}}),L(this,"addNewImagesToImageCache",async(o=o3(this.scene.getNonDeletedElements()),u=this.files)=>{let h=o.filter(p=>!p.isDeleted&&!this.imageCache.has(p.fileId));if(h.length){let{updatedFiles:p}=await this.updateImageCache(h,u);p.size&&this.scene.triggerUpdate()}}),L(this,"scheduleImageRefresh",Ko(()=>{this.addNewImagesToImageCache()},vk)),L(this,"updateBindingEnabledOnPointerMove",o=>{let u=nD(o);this.state.isBindingEnabled!==u&&this.setState({isBindingEnabled:u})}),L(this,"maybeSuggestBindingAtCursor",(o,u)=>{let h=ra(o,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,!1,u);this.setState({suggestedBindings:h!=null?[h]:[]})}),L(this,"maybeSuggestBindingsForLinearElementAtCoords",(o,u,h)=>{if(!u.length)return;let p=u.reduce((U,m)=>{let g=ra(m,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,ee(o),ee(o));return g!=null&&!I7(o,h==null?void 0:h.id,g)&&U.push(g),U},[]);this.setState({suggestedBindings:p})}),L(this,"handleInteractiveCanvasRef",o=>{var u,h;o!==null?(this.interactiveCanvas=o,this.interactiveCanvas.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.interactiveCanvas.addEventListener("touchend",this.onTouchEnd)):((u=this.interactiveCanvas)==null||u.removeEventListener("touchstart",this.onTouchStart),(h=this.interactiveCanvas)==null||h.removeEventListener("touchend",this.onTouchEnd))}),L(this,"handleAppOnDrop",async o=>{var g,b,v,x;let{file:u,fileHandle:h}=await QN(o),{x:p,y:U}=Ze(o,this.state);try{if(Or(u)&&this.isToolSupported("image")){if((u==null?void 0:u.type)===ae.png||(u==null?void 0:u.type)===ae.svg)try{let E=await Yp(u,this.state,this.scene.getElementsIncludingDeleted(),h);this.syncActionResult({...E,appState:{...E.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:X.IMMEDIATELY});return}catch(E){if(E.name!=="EncodingError")throw new Error(I("alerts.couldNotLoadInvalidFile"))}let y=this.createImageElement({sceneX:p,sceneY:U});this.insertImageElement(y,u),this.initializeImageDimensions(y),this.setState({selectedElementIds:Pe({[y.id]:!0},this.state)});return}}catch(y){return this.setState({isLoading:!1,errorMessage:y.message})}let m=o.dataTransfer.getData(ae.excalidrawlib);if(m&&typeof m=="string"){try{let y=Q3(m);this.addElementsFromPasteOrLibrary({elements:cx(y),position:o,files:null})}catch(y){this.setState({errorMessage:y.message})}return}if(u&&await this.loadFileToCanvas(u,h),(b=(g=o.dataTransfer)==null?void 0:g.types)==null?void 0:b.includes("text/plain")){let y=(v=o.dataTransfer)==null?void 0:v.getData("text");if(y&&md(y,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(y)||((x=Rs(y))==null?void 0:x.type)==="video")){let E=this.insertEmbeddableElement({sceneX:p,sceneY:U,link:yn(y)});E&&this.setState({selectedElementIds:{[E.id]:!0}})}}}),L(this,"loadFileToCanvas",async(o,u)=>{o=await Zp(o);try{let h=this.scene.getElementsIncludingDeleted(),p;try{p=await Gp(o,this.state,h,u)}catch(U){let m=U instanceof Tr;if(m&&U.code==="IMAGE_NOT_CONTAINS_SCENE_DATA"&&!this.isToolSupported("image")){this.setState({isLoading:!1,errorMessage:I("errors.imageToolNotSupported")});return}let g=I(m?"alerts.cannotRestoreFromImage":"alerts.couldNotLoadInvalidFile");this.setState({isLoading:!1,errorMessage:g})}if(!p)return;p.type===ae.excalidraw?(Va(h.concat(p.data.elements)),this.store.updateSnapshot(ce(h),this.state),this.setState({isLoading:!0}),this.syncActionResult({...p.data,appState:{...p.data.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:X.IMMEDIATELY})):p.type===ae.excalidrawlib&&await this.library.updateLibrary({libraryItems:o,merge:!0,openLibraryMenu:!0}).catch(U=>{console.error(U),this.setState({errorMessage:I("errors.importLibraryError")})})}catch(h){this.setState({isLoading:!1,errorMessage:h.message})}}),L(this,"handleCanvasContextMenu",o=>{if(o.preventDefault(),("pointerType"in o.nativeEvent&&o.nativeEvent.pointerType==="touch"||"pointerType"in o.nativeEvent&&o.nativeEvent.pointerType==="pen"&&o.button!==Li.SECONDARY)&&this.state.activeTool.type!=="selection")return;let{x:u,y:h}=Ze(o,this.state),p=this.getElementAtPosition(u,h,{preferSelected:!0,includeLockedElements:!0}),U=this.scene.getSelectedElements(this.state),m=this.isHittingCommonBoundingBoxOfSelectedElements({x:u,y:h},U),g=p||m?"element":"canvas",b=this.excalidrawContainerRef.current,{top:v,left:x}=b.getBoundingClientRect(),y=o.clientX-x,E=o.clientY-v;Qe("contextMenu","openContextMenu",g),this.setState({...p&&!this.state.selectedElementIds[p.id]?{...this.state,...ln({editingGroupId:this.state.editingGroupId,selectedElementIds:{[p.id]:!0}},this.scene.getNonDeletedElements(),this.state,this),selectedLinearElement:fe(p)?new J(p):null}:this.state,showHyperlinkPopup:!1},()=>{this.setState({contextMenu:{top:E,left:y,items:this.getContextMenuItems(g)}})})}),L(this,"maybeDragNewGenericElement",(o,u,h=!0)=>{var S,w,k;let p=this.state.selectionElement,U=o.lastCoords;if(p&&this.state.activeTool.type!=="eraser"){$g({newElement:p,elementType:this.state.activeTool.type,originX:o.origin.x,originY:o.origin.y,x:U.x,y:U.y,width:qt(o.origin.x,U.x),height:qt(o.origin.y,U.y),shouldMaintainAspectRatio:Tl(u),shouldResizeFromCenter:dh(u),zoom:this.state.zoom.value,informMutation:h});return}let m=this.state.newElement;if(!m)return;let[g,b]=kt(U.x,U.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=Dn(m)&&((S=this.imageCache.get(m.fileId))==null?void 0:S.image),x=v&&!(v instanceof Promise)?v.width/v.height:null;this.maybeCacheReferenceSnapPoints(u,[m]);let{snapOffset:y,snapLines:E}=FD(m,this,u,{x:o.originInGrid.x+(((w=this.state.originSnapOffset)==null?void 0:w.x)??0),y:o.originInGrid.y+(((k=this.state.originSnapOffset)==null?void 0:k.y)??0)},{x:g-o.originInGrid.x,y:b-o.originInGrid.y},this.scene.getNonDeletedElementsMap());g+=y.x,b+=y.y,this.setState({snapLines:E}),$g({newElement:m,elementType:this.state.activeTool.type,originX:o.originInGrid.x,originY:o.originInGrid.y,x:g,y:b,width:qt(o.originInGrid.x,g),height:qt(o.originInGrid.y,b),shouldMaintainAspectRatio:Ne(m)?!Tl(u):Tl(u),shouldResizeFromCenter:dh(u),zoom:this.state.zoom.value,widthAspectRatio:x,originOffset:this.state.originSnapOffset,informMutation:h}),this.setState({newElement:m}),(this.state.activeTool.type===Rt.frame||this.state.activeTool.type===Rt.magicframe)&&this.setState({elementsToHighlight:bd(this.scene.getNonDeletedElements(),m,this.state,this.scene.getNonDeletedElementsMap())})}),L(this,"maybeHandleCrop",(o,u)=>{var b;if(!this.state.croppingElementId)return!1;let h=o.resize.handleType,p=o.lastCoords,[U,m]=kt(p.x-o.resize.offset.x,p.y-o.resize.offset.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(h&&g&&Ne(g)){let v=o.originalElements.get(g.id),x=Dn(g)&&((b=this.imageCache.get(g.fileId))==null?void 0:b.image);if(v&&Ne(v)&&x&&!(x instanceof Promise)){let[y,E]=kt(p.x,p.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),S={x:y-o.originInGrid.x,y:E-o.originInGrid.y};this.maybeCacheReferenceSnapPoints(u,[g]);let{snapOffset:w,snapLines:k}=Q2([g],[v],this,u,S,h);G(g,kL(g,h,x.naturalWidth,x.naturalHeight,U+w.x,m+w.y,u.shiftKey?v.width/v.height:void 0)),xn(g,this.scene.getNonDeletedElementsMap(),{newSize:{width:g.width,height:g.height}}),this.setState({isCropping:h&&h!=="rotation",snapLines:k})}return!0}return!1}),L(this,"maybeHandleResize",(o,u)=>{let h=this.scene.getSelectedElements(this.state),p=h.filter(x=>de(x)),U=o.resize.handleType;if(p.length>0&&U==="rotation"||h.length===1&&ee(h[0])||this.state.croppingElementId)return!1;this.setState({isResizing:U&&U!=="rotation",isRotating:U==="rotation",activeEmbeddable:null});let m=o.lastCoords,[g,b]=kt(m.x-o.resize.offset.x,m.y-o.resize.offset.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=new Map;if(p.forEach(x=>{Ga(this.scene.getNonDeletedElements(),x.id).forEach(y=>{v.set(x.id+y.id,{x:y.x-x.x,y:y.y-x.y})})}),!this.state.selectedElementsAreBeingDragged){let[x,y]=kt(m.x,m.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),E={x:x-o.originInGrid.x,y:y-o.originInGrid.y},S=[...o.originalElements.values()];this.maybeCacheReferenceSnapPoints(u,h);let{snapOffset:w,snapLines:k}=Q2(h,ve(S,this.state),this,u,E,U);g+=w.x,b+=w.y,this.setState({snapLines:k})}if(jN(o.originalElements,U,h,this.scene.getElementsMapIncludingDeleted(),this.scene,so(u),dh(u),h.some(x=>Ne(x))?!Tl(u):Tl(u),g,b,o.resize.center.x,o.resize.center.y)){let x=fh(h,this.scene.getNonDeletedElementsMap(),this.state.zoom),y=new Set;return p.forEach(E=>{bd(this.scene.getNonDeletedElements(),E,this.state,this.scene.getNonDeletedElementsMap()).forEach(S=>y.add(S))}),this.setState({elementsToHighlight:[...y],suggestedBindings:x}),!0}return!1}),L(this,"getContextMenuItems",o=>{let u=[];return u.push(t5,e5),o==="canvas"?this.state.viewModeEnabled?[...u,a5,b0,N5,v0]:[J6,jt,t5,e5,n5,jt,lH,MX,jt,a5,pX,b0,N5,v0]:(u.push(n5),this.state.viewModeEnabled?[kd,...u]:[jt,Q6,kd,J6,jt,KG,qG,JG,jt,XW,jt,...u,jt,QH,eX,jt,nX,NY,UX,mX,vX,aX,jt,lX,jt,aH,iH,rH,sH,jt,uX,fX,jt,HW,jt,ax,wx,jt,uH,kX,jt,Cv])}),L(this,"handleWheel",ut(o=>{if(!(o.target instanceof HTMLCanvasElement||o.target instanceof HTMLTextAreaElement||o.target instanceof HTMLIFrameElement)){o[D.CTRL_OR_CMD]&&o.preventDefault();return}if(o.preventDefault(),Nl)return;let{deltaX:u,deltaY:h}=o;if(o.metaKey||o.ctrlKey){let p=Math.sign(h),U=Pu*100,m=Math.abs(h),g=h;m>U&&(g=U*p);let b=this.state.zoom.value-g/100;b+=Math.log10(Math.max(1,this.state.zoom.value))*-p*Math.min(1,m/20),this.translateCanvas(v=>({...Ar({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:di(b)},v),shouldCacheIgnoreZoom:!0})),this.resetShouldCacheIgnoreZoomDebounced();return}if(o.shiftKey){this.translateCanvas(({zoom:p,scrollX:U})=>({scrollX:U-(h||u)/p.value}));return}this.translateCanvas(({zoom:p,scrollX:U,scrollY:m})=>({scrollX:U-u/p.value,scrollY:m-h/p.value}))})),L(this,"savePointer",(o,u,h)=>{var g,b;if(!o||!u)return;let{x:p,y:U}=Ze({clientX:o,clientY:u},this.state),m={x:p,y:U,tool:this.state.activeTool.type==="laser"?"laser":"pointer"};(b=(g=this.props).onPointerUpdate)==null||b.call(g,{pointer:m,button:h,pointersMap:De.pointers})}),L(this,"resetShouldCacheIgnoreZoomDebounced",Zs(()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})},300)),L(this,"updateDOMRect",o=>{var u;if((u=this.excalidrawContainerRef)!=null&&u.current){let h=this.excalidrawContainerRef.current,{width:p,height:U,left:m,top:g}=h.getBoundingClientRect(),{width:b,height:v,offsetTop:x,offsetLeft:y}=this.state;if(p===b&&U===v&&m===y&&g===x){o&&o();return}this.setState({width:p,height:U,offsetLeft:m,offsetTop:g},()=>{o&&o()})}}),L(this,"refresh",()=>{this.setState({...this.getCanvasOffsets()})});let n=za(),{excalidrawAPI:a,viewModeEnabled:i=!1,zenModeEnabled:r=!1,gridModeEnabled:s=!1,objectsSnapModeEnabled:l=!1,theme:c=n.theme,name:d=`${I("labels.untitled")}-${c2()}`}=t;if(this.state={...n,theme:c,isLoading:!0,...this.getCanvasOffsets(),viewModeEnabled:i,zenModeEnabled:r,objectsSnapModeEnabled:l,gridModeEnabled:s??n.gridModeEnabled,name:d,width:window.innerWidth,height:window.innerHeight},this.id=Lu(),this.library=new DX(this),this.actionManager=new YW(this.syncActionResult,()=>this.state,()=>this.scene.getElementsIncludingDeleted(),this),this.scene=new vi,this.canvas=document.createElement("canvas"),this.rc=lr.canvas(this.canvas),this.renderer=new X5(this.scene),this.visibleElements=[],this.store=new dP,this.history=new p5,a){let o={updateScene:this.updateScene,updateLibrary:this.library.updateLibrary,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,getName:this.getName,registerAction:u=>{this.actionManager.registerAction(u)},refresh:this.refresh,setToast:this.setToast,id:this.id,setActiveTool:this.setActiveTool,setCursor:this.setCursor,resetCursor:this.resetCursor,updateFrameRendering:this.updateFrameRendering,toggleSidebar:this.toggleSidebar,onChange:u=>this.onChangeEmitter.on(u),onPointerDown:u=>this.onPointerDownEmitter.on(u),onPointerUp:u=>this.onPointerUpEmitter.on(u),onScrollChange:u=>this.onScrollChangeEmitter.on(u),onUserFollow:u=>this.onUserFollowEmitter.on(u)};typeof a=="function"?a(o):console.error("excalidrawAPI should be a function!")}this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.fonts=new fi(this.scene),this.history=new p5,this.actionManager.registerAll(N1),this.actionManager.registerAction(VW(this.history,this.store)),this.actionManager.registerAction(GW(this.history,this.store))}onWindowMessage(t){if(t.origin!=="https://player.vimeo.com"&&t.origin!=="https://www.youtube.com")return;let n=null;try{n=JSON.parse(t.data)}catch{}if(n)switch(t.origin){case"https://player.vimeo.com":if(n.method==="paused"){let a=null,i=document.body.querySelectorAll("iframe.excalidraw__embeddable");if(!i)break;for(let r of i)r.contentWindow===t.source&&(a=r.contentWindow);a==null||a.postMessage(JSON.stringify({method:n.value?"play":"pause",value:!0}),"*")}break;case"https://www.youtube.com":if(n.event==="infoDelivery"&&n.info&&n.id&&typeof n.info.playerState=="number"){let a=n.id,i=n.info.playerState;Object.values(Ic).includes(i)&&t1.set(a,i)}break}}cacheEmbeddableRef(t,n){n&&this.iFrameRefs.set(t.id,n)}getHTMLIFrameElement(t){return this.iFrameRefs.get(t.id)}handleEmbeddableCenterClick(t){var a,i,r,s;if(((a=this.state.activeEmbeddable)==null?void 0:a.element)===t&&((i=this.state.activeEmbeddable)==null?void 0:i.state)==="active"||(setTimeout(()=>{this.setState({activeEmbeddable:{element:t,state:"active"},selectedElementIds:{[t.id]:!0},newElement:null,selectionElement:null})},100),Oi(t)))return;let n=this.getHTMLIFrameElement(t);if(n!=null&&n.contentWindow){if(n.src.includes("youtube")){let l=t1.get(t.id);switch(l||(t1.set(t.id,Ic.UNSTARTED),n.contentWindow.postMessage(JSON.stringify({event:"listening",id:t.id}),"*")),l){case Ic.PLAYING:case Ic.BUFFERING:(r=n.contentWindow)==null||r.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*");break;default:(s=n.contentWindow)==null||s.postMessage(JSON.stringify({event:"command",func:"playVideo",args:""}),"*")}}n.src.includes("player.vimeo.com")&&n.contentWindow.postMessage(JSON.stringify({method:"paused"}),"*")}}isIframeLikeElementCenter(t,n,a,i){var r,s;return t&&!n.altKey&&!n.shiftKey&&!n.metaKey&&!n.ctrlKey&&(((r=this.state.activeEmbeddable)==null?void 0:r.element)!==t||((s=this.state.activeEmbeddable)==null?void 0:s.state)==="hover"||!this.state.activeEmbeddable)&&a>=t.x+t.width/3&&a<=t.x+2*t.width/3&&i>=t.y+t.height/3&&i<=t.y+2*t.height/3}renderEmbeddables(){let t=this.state.zoom.value,n=this.state.width,a=this.state.height,i=this.scene.getNonDeletedElements().filter(r=>Un(r)&&this.embedsValidationStatus.get(r.id)===!0||Oi(r));return f.jsx(f.Fragment,{children:i.map(r=>{var p,U,m,g,b,v,x,y,E;let{x:s,y:l}=Nn({sceneX:r.x,sceneY:r.y},this.state),c=du(r,n,a,this.state,this.scene.getNonDeletedElementsMap()),d=this.initializedEmbeds.has(r.id);if(c&&!d&&this.initializedEmbeds.add(r.id),!(c||d))return null;let o;if(Oi(r)){o=null;let S=(((p=r.customData)==null?void 0:p.generationData)??this.magicGenerations.get(r.id))||{status:"error",message:"No generation data",code:"ERR_NO_GENERATION_DATA"};if(S.status==="done"){let w=S.html;o={intrinsicSize:{w:r.width,h:r.height},type:"document",srcdoc:()=>w}}else if(S.status==="pending")o={intrinsicSize:{w:r.width,h:r.height},type:"document",srcdoc:()=>lo(`
|
|
137
|
+
<style>
|
|
138
|
+
html, body {
|
|
139
|
+
width: 100%;
|
|
140
|
+
height: 100%;
|
|
141
|
+
color: ${this.state.theme===ke.DARK?"white":"black"};
|
|
142
|
+
}
|
|
143
|
+
body {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: center;
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
gap: 1rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.Spinner {
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
margin-left: auto;
|
|
156
|
+
margin-right: auto;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.Spinner svg {
|
|
160
|
+
animation: rotate 1.6s linear infinite;
|
|
161
|
+
transform-origin: center center;
|
|
162
|
+
width: 40px;
|
|
163
|
+
height: 40px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.Spinner circle {
|
|
167
|
+
stroke: currentColor;
|
|
168
|
+
animation: dash 1.6s linear 0s infinite;
|
|
169
|
+
stroke-linecap: round;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@keyframes rotate {
|
|
173
|
+
100% {
|
|
174
|
+
transform: rotate(360deg);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@keyframes dash {
|
|
179
|
+
0% {
|
|
180
|
+
stroke-dasharray: 1, 300;
|
|
181
|
+
stroke-dashoffset: 0;
|
|
182
|
+
}
|
|
183
|
+
50% {
|
|
184
|
+
stroke-dasharray: 150, 300;
|
|
185
|
+
stroke-dashoffset: -200;
|
|
186
|
+
}
|
|
187
|
+
100% {
|
|
188
|
+
stroke-dasharray: 1, 300;
|
|
189
|
+
stroke-dashoffset: -280;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
</style>
|
|
193
|
+
<div class="Spinner">
|
|
194
|
+
<svg
|
|
195
|
+
viewBox="0 0 100 100"
|
|
196
|
+
>
|
|
197
|
+
<circle
|
|
198
|
+
cx="50"
|
|
199
|
+
cy="50"
|
|
200
|
+
r="46"
|
|
201
|
+
stroke-width="8"
|
|
202
|
+
fill="none"
|
|
203
|
+
stroke-miter-limit="10"
|
|
204
|
+
/>
|
|
205
|
+
</svg>
|
|
206
|
+
</div>
|
|
207
|
+
<div>Generating...</div>
|
|
208
|
+
`)};else{let w;S.code==="ERR_GENERATION_INTERRUPTED"?w="Generation was interrupted...":w=S.message||"Generation failed",o={intrinsicSize:{w:r.width,h:r.height},type:"document",srcdoc:()=>lo(`
|
|
209
|
+
<style>
|
|
210
|
+
html, body {
|
|
211
|
+
height: 100%;
|
|
212
|
+
}
|
|
213
|
+
body {
|
|
214
|
+
display: flex;
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
align-items: center;
|
|
217
|
+
justify-content: center;
|
|
218
|
+
color: ${we.red[3]};
|
|
219
|
+
}
|
|
220
|
+
h1, h3 {
|
|
221
|
+
margin-top: 0;
|
|
222
|
+
margin-bottom: 0.5rem;
|
|
223
|
+
}
|
|
224
|
+
</style>
|
|
225
|
+
<h1>Error!</h1>
|
|
226
|
+
<h3>${w}</h3>
|
|
227
|
+
`)}}}else o=Rs(hp(r.link||""));let u=((U=this.state.activeEmbeddable)==null?void 0:U.element)===r&&((m=this.state.activeEmbeddable)==null?void 0:m.state)==="active",h=((g=this.state.activeEmbeddable)==null?void 0:g.element)===r&&((b=this.state.activeEmbeddable)==null?void 0:b.state)==="hover";return f.jsx("div",{className:ne("excalidraw__embeddable-container",{"is-hovered":h}),style:{transform:c?`translate(${s-this.state.offsetLeft}px, ${l-this.state.offsetTop}px) scale(${t})`:"none",display:c?"block":"none",opacity:U7(r,wn(r,this.scene.getNonDeletedElementsMap()),this.elementsPendingErasure,null,((v=this.state.openDialog)==null?void 0:v.name)==="elementLinkSelector"?l8:1),"--embeddable-radius":`${ca(Math.min(r.width,r.height),r)}px`},children:f.jsxs("div",{className:"excalidraw__embeddable-container__inner",style:{width:c?`${r.width}px`:0,height:c?`${r.height}px`:0,transform:c?`rotate(${r.angle}rad)`:"none",pointerEvents:u?ps.enabled:ps.disabled},children:[h&&f.jsx("div",{className:"excalidraw__embeddable-hint",children:I("buttons.embeddableInteractionButton")}),f.jsx("div",{className:"excalidraw__embeddable__outer",style:{padding:`${r.strokeWidth}px`},children:(Un(r)?(y=(x=this.props).renderEmbeddable)==null?void 0:y.call(x,r,this.state):null)??f.jsx("iframe",{ref:S=>this.cacheEmbeddableRef(r,S),className:"excalidraw__embeddable",srcDoc:(o==null?void 0:o.type)==="document"?o.srcdoc(this.state.theme):void 0,src:(o==null?void 0:o.type)!=="document"?(o==null?void 0:o.link)??"":void 0,scrolling:"no",referrerPolicy:"no-referrer-when-downgrade",title:"Excalidraw Embedded Content",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sandbox:`${(E=o==null?void 0:o.sandbox)!=null&&E.allowSameOrigin?"allow-same-origin":""} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`})})]})},r.id)})})}toggleOverscrollBehavior(t){document.documentElement.style.overscrollBehaviorX=t.type==="pointerenter"?"none":"auto"}render(){var o,u,h,p,U,m,g,b;let t=this.scene.getSelectedElements(this.state),{renderTopRightUI:n,renderCustomStats:a}=this.props,i=this.scene.getSceneNonce(),{elementsMap:r,visibleElements:s}=this.renderer.getRenderableElements({sceneNonce:i,zoom:this.state.zoom,offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,height:this.state.height,width:this.state.width,editingTextElement:this.state.editingTextElement,newElementId:(o=this.state.newElement)==null?void 0:o.id,pendingImageElementId:this.state.pendingImageElementId});this.visibleElements=s;let l=this.scene.getNonDeletedElementsMap(),c="setPointerCapture"in HTMLElement.prototype?!1:this.state.selectionElement||this.state.newElement||this.state.selectedElementsAreBeingDragged||this.state.resizingElement||this.state.activeTool.type==="laser"&&this.state.cursorButton==="down",d=t[0];return f.jsx("div",{className:ne("excalidraw excalidraw-container",{"excalidraw--view-mode":this.state.viewModeEnabled||((u=this.state.openDialog)==null?void 0:u.name)==="elementLinkSelector","excalidraw--mobile":this.device.editor.isMobile}),style:{"--ui-pointerEvents":c?ps.disabled:ps.enabled,"--right-sidebar-width":"302px"},ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,onPointerEnter:this.toggleOverscrollBehavior,onPointerLeave:this.toggleOverscrollBehavior,children:f.jsx(Cy.Provider,{value:this,children:f.jsx(ky.Provider,{value:this.props,children:f.jsx(jU.Provider,{value:this.excalidrawContainerValue,children:f.jsx(_U.Provider,{value:this.device,children:f.jsx(LU.Provider,{value:this.setAppState,children:f.jsx(RU.Provider,{value:this.state,children:f.jsxs(AU.Provider,{value:this.scene.getNonDeletedElements(),children:[f.jsxs(DU.Provider,{value:this.actionManager,children:[f.jsx(GG,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getNonDeletedElements(),onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onHandToolToggle:this.onHandToolToggle,langCode:Xo().code,renderTopRightUI:n,renderCustomStats:a,showExitZenModeBtn:typeof((h=this.props)==null?void 0:h.zenModeEnabled)>"u"&&this.state.zenModeEnabled,UIOptions:this.props.UIOptions,onExportImage:this.onExportImage,renderWelcomeScreen:!this.state.isLoading&&this.state.showWelcomeScreen&&this.state.activeTool.type==="selection"&&!this.state.zenModeEnabled&&!this.scene.getElementsIncludingDeleted().length,app:this,isCollaborating:this.props.isCollaborating,generateLinkForSelection:this.props.generateLinkForSelection,children:this.props.children}),f.jsx("div",{className:"excalidraw-textEditorContainer"}),f.jsx("div",{className:"excalidraw-contextMenuContainer"}),f.jsx("div",{className:"excalidraw-eye-dropper-container"}),f.jsx(MY,{trails:[this.laserTrails,this.eraserTrail]}),t.length===1&&((p=this.state.openDialog)==null?void 0:p.name)!=="elementLinkSelector"&&this.state.showHyperlinkPopup&&f.jsx(wX,{element:d,elementsMap:l,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen,setToast:this.setToast,updateEmbedValidationStatus:this.updateEmbedValidationStatus},d.id),this.props.aiEnabled!==!1&&t.length===1&&cd(d)&&f.jsx(W5,{element:d,elementsMap:r,children:f.jsx(qh,{title:I("labels.convertToCode"),icon:X8,checked:!1,onChange:()=>this.onMagicFrameGenerate(d,"button")})}),t.length===1&&Oi(d)&&((m=(U=d.customData)==null?void 0:U.generationData)==null?void 0:m.status)==="done"&&f.jsxs(W5,{element:d,elementsMap:r,children:[f.jsx(qh,{title:I("labels.copySource"),icon:ep,checked:!1,onChange:()=>this.onIframeSrcCopy(d)}),f.jsx(qh,{title:"Enter fullscreen",icon:QI,checked:!1,onChange:()=>{let v=this.getHTMLIFrameElement(d);if(v)try{v.requestFullscreen(),this.setState({activeEmbeddable:{element:d,state:"active"},selectedElementIds:{[d.id]:!0},newElement:null,selectionElement:null})}catch(x){console.warn(x),this.setState({errorMessage:"Couldn't enter fullscreen"})}}})]}),this.state.toast!==null&&f.jsx(ZG,{message:this.state.toast.message,onClose:()=>this.setToast(null),duration:this.state.toast.duration,closable:this.state.toast.closable}),this.state.contextMenu&&f.jsx(KW,{items:this.state.contextMenu.items,top:this.state.contextMenu.top,left:this.state.contextMenu.left,actionManager:this.actionManager,onClose:v=>{this.setState({contextMenu:null},()=>{this.focusContainer(),v==null||v()})}}),f.jsx(kY,{canvas:this.canvas,rc:this.rc,elementsMap:r,allElementsMap:l,visibleElements:s,sceneNonce:i,selectionNonce:(g=this.state.selectionElement)==null?void 0:g.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:No(this),canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:this.flowChartCreator.pendingNodes}}),this.state.newElement&&f.jsx(BY,{appState:this.state,scale:window.devicePixelRatio,rc:this.rc,elementsMap:r,allElementsMap:l,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:!1,canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:null}}),f.jsx(EY,{containerRef:this.excalidrawContainerRef,canvas:this.interactiveCanvas,elementsMap:r,visibleElements:s,allElementsMap:l,selectedElements:t,sceneNonce:i,selectionNonce:(b=this.state.selectionElement)==null?void 0:b.versionNonce,scale:window.devicePixelRatio,appState:this.state,device:this.device,renderInteractiveSceneCallback:this.renderInteractiveSceneCallback,handleCanvasRef:this.handleInteractiveCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick}),this.state.userToFollow&&f.jsx(AY,{width:this.state.width,height:this.state.height,userToFollow:this.state.userToFollow,onDisconnect:this.maybeUnfollowRemoteUser}),this.renderFrameNames()]}),this.renderEmbeddables()]})})})})})})})})}setPlugins(t){Object.assign(this.plugins,t)}async onMagicFrameGenerate(t,n){var s;let a=(s=this.plugins.diagramToCode)==null?void 0:s.generate;if(!a){this.setState({errorMessage:"No diagram to code plugin found"});return}let i=Np(this.scene.getNonDeletedElements(),t).filter(l=>!cd(l));if(!i.length){n==="button"?(this.setState({errorMessage:"Cannot generate from an empty frame"}),Qe("ai","generate (no-children)","d2c")):this.setActiveTool({type:"magicframe"});return}let r=this.insertIframeElement({sceneX:t.x+t.width+30,sceneY:t.y,width:t.width,height:t.height});if(r){this.updateMagicGeneration({frameElement:r,data:{status:"pending"}}),this.setState({selectedElementIds:{[r.id]:!0}}),Qe("ai","generate (start)","d2c");try{let{html:l}=await a({frame:t,children:i});if(Qe("ai","generate (success)","d2c"),!l.trim()){this.updateMagicGeneration({frameElement:r,data:{status:"error",code:"ERR_OAI",message:"Nothing genereated :("}});return}let c=l.includes("<!DOCTYPE html>")&&l.includes("</html>")?l.slice(l.indexOf("<!DOCTYPE html>"),l.indexOf("</html>")+7):l;this.updateMagicGeneration({frameElement:r,data:{status:"done",html:c}})}catch(l){Qe("ai","generate (failed)","d2c"),this.updateMagicGeneration({frameElement:r,data:{status:"error",code:"ERR_OAI",message:l.message||"Unknown error during generation"}})}}}onIframeSrcCopy(t){var n,a;((a=(n=t.customData)==null?void 0:n.generationData)==null?void 0:a.status)==="done"&&(pl(t.customData.generationData.html),this.setToast({message:"copied to clipboard",closable:!1,duration:1500}))}clearImageShapeCache(t){let n=t??this.files;this.scene.getNonDeletedElements().forEach(a=>{Dn(a)&&n[a.fileId]&&(this.imageCache.delete(a.fileId),dt.delete(a))})}async componentDidMount(){var t;this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,(be.MODE===vn.TEST||be.DEV)&&(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:(...n)=>this.setState(...n)},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history},store:{configurable:!0,value:this.store},fonts:{configurable:!0,value:this.fonts}})),this.store.onStoreIncrementEmitter.on(n=>{this.history.record(n.elementsChange,n.appStateChange)}),this.scene.onUpdate(this.triggerRender),this.addEventListeners(),this.props.autoFocus&&this.excalidrawContainerRef.current&&this.focusContainer(),pi()||(this.refreshViewportBreakpoints(),this.refreshEditorBreakpoints()),m1&&this.excalidrawContainerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this.refreshEditorBreakpoints(),this.updateDOMRect()}),(t=this.resizeObserver)==null||t.observe(this.excalidrawContainerRef.current)),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene),dk()&&!gM()&&this.setState({errorMessage:f.jsx(eY,{})})}componentWillUnmount(){var t,n;(t=window.launchQueue)==null||t.setConsumer(()=>{}),this.renderer.destroy(),this.scene.destroy(),this.scene=new vi,this.fonts=new fi(this.scene),this.renderer=new X5(this.scene),this.files={},this.imageCache.clear(),(n=this.resizeObserver)==null||n.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.library.destroy(),this.laserTrails.stop(),this.eraserTrail.stop(),this.onChangeEmitter.clear(),this.store.onStoreIncrementEmitter.clear(),dt.destroy(),ai.destroy(),clearTimeout(Ai),It.clearCache(),ln.clearCache(),Ai=0,document.documentElement.style.overscrollBehaviorX=""}removeEventListeners(){this.onRemoveEventListenersEmitter.trigger()}addEventListeners(){this.removeEventListeners(),this.props.handleKeyboardGlobally&&this.onRemoveEventListenersEmitter.once(st(document,"keydown",this.onKeyDown,!1)),this.onRemoveEventListenersEmitter.once(st(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),st(window,"message",this.onWindowMessage,!1),st(document,"pointerup",this.removePointer,{passive:!1}),st(document,"copy",this.onCopy,{passive:!1}),st(document,"keyup",this.onKeyUp,{passive:!0}),st(document,"pointermove",this.updateCurrentCursorPosition,{passive:!1}),st(document.fonts,"loadingdone",t=>{let n=t.fontfaces;this.fonts.onLoaded(n)},{passive:!1}),st(document,"gesturestart",this.onGestureStart,!1),st(document,"gesturechange",this.onGestureChange,!1),st(document,"gestureend",this.onGestureEnd,!1),st(window,"focus",()=>{this.maybeCleanupAfterMissingPointerUp(null),this.triggerRender(!0)},{passive:!1})),!this.state.viewModeEnabled&&(this.onRemoveEventListenersEmitter.once(st(document,"fullscreenchange",this.onFullscreenChange,{passive:!1}),st(document,"paste",this.pasteFromClipboard,{passive:!1}),st(document,"cut",this.onCut,{passive:!1}),st(window,"resize",this.onResize,!1),st(window,"unload",this.onUnload,!1),st(window,"blur",this.onBlur,!1),st(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),st(this.excalidrawContainerRef.current,"dragover",this.disableEvent,!1),st(this.excalidrawContainerRef.current,"drop",this.disableEvent,!1)),this.props.detectScroll&&this.onRemoveEventListenersEmitter.once(st(nM(this.excalidrawContainerRef.current),"scroll",this.onScroll,{passive:!1})))}componentDidUpdate(t,n){var l,c,d,o,u,h,p,U,m,g;this.updateEmbeddables();let a=this.scene.getElementsIncludingDeleted(),i=this.scene.getElementsMapIncludingDeleted(),r=this.scene.getNonDeletedElementsMap();!this.state.showWelcomeScreen&&!a.length&&this.setState({showWelcomeScreen:!0}),t.UIOptions.dockedSidebarBreakpoint!==this.props.UIOptions.dockedSidebarBreakpoint&&this.refreshEditorBreakpoints(),n.userToFollow&&!this.state.collaborators.has(n.userToFollow.socketId)&&this.maybeUnfollowRemoteUser(),(n.zoom.value!==this.state.zoom.value||n.scrollX!==this.state.scrollX||n.scrollY!==this.state.scrollY)&&((c=(l=this.props)==null?void 0:l.onScrollChange)==null||c.call(l,this.state.scrollX,this.state.scrollY,this.state.zoom),this.onScrollChangeEmitter.trigger(this.state.scrollX,this.state.scrollY,this.state.zoom)),n.userToFollow!==this.state.userToFollow&&(n.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:n.userToFollow,action:"UNFOLLOW"}),this.state.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:this.state.userToFollow,action:"FOLLOW"})),Object.keys(this.state.selectedElementIds).length&&Ia(this.state)&&this.setState({activeTool:Et(this.state,{type:"selection"})}),this.state.activeTool.type==="eraser"&&n.theme!==this.state.theme&&G7(this.interactiveCanvas,this.state.theme),n.activeTool.type==="selection"&&this.state.activeTool.type!=="selection"&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),t.langCode!==this.props.langCode&&this.updateLanguage(),Ia(n)&&!Ia(this.state)&&this.eraserTrail.endPath(),t.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),n.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),(((d=n.openDialog)==null?void 0:d.name)==="elementLinkSelector"||((o=this.state.openDialog)==null?void 0:o.name)==="elementLinkSelector")&&((u=n.openDialog)==null?void 0:u.name)!==((h=this.state.openDialog)==null?void 0:h.name)&&(this.deselectElements(),this.setState({hoveredElementIds:{}})),t.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),t.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),(p=this.excalidrawContainerRef.current)==null||p.classList.toggle("theme--dark",this.state.theme===ke.DARK),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(()=>{this.state.editingLinearElement&&this.actionManager.executeAction(Kn)}),(U=this.state.editingTextElement)!=null&&U.isDeleted&&this.setState({editingTextElement:null}),this.state.selectedLinearElement&&!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]&&this.setState({selectedLinearElement:null});let{multiElement:s}=n;n.activeTool!==this.state.activeTool&&s!=null&&_r(this.state)&&La(s,!1)&&D1(s,this.state,aa(J.getPointAtIndexGlobalCoordinates(s,-1,r)),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.store.commit(i,this.state),this.state.isLoading||((g=(m=this.props).onChange)==null||g.call(m,a,this.state,this.files),this.onChangeEmitter.trigger(a,this.state,this.files))}static resetTapTwice(){Pl=!1}async addElementsFromMixedContentPaste(t,{isPlainPaste:n,sceneX:a,sceneY:i}){if(!n&&t.some(r=>r.type==="imageUrl")&&this.isToolSupported("image")){let r=t.filter(u=>u.type==="imageUrl").map(u=>u.value),s=await Promise.all(r.map(async u=>{try{return{file:await JN(u)}}catch(h){let p=h.message;return h.cause==="FETCH_ERROR"?p=I("errors.failedToFetchImage"):h.cause==="UNSUPPORTED"&&(p=I("errors.unsupportedFileType")),{errorMessage:p}}})),l=i,c=!1,d={};for(let u of s)if(u.file){let h=this.createImageElement({sceneX:a,sceneY:l}),p=await this.insertImageElement(h,u.file);p&&(c||(c=!0,l-=p.height/2),G(p,{y:l},!1),l=h.y+h.height+25,d[h.id]=!0)}this.setState({selectedElementIds:Pe(d,this.state)});let o=s.find(u=>!!u.errorMessage);o&&o.errorMessage&&this.setState({errorMessage:o.errorMessage})}else{let r=t.filter(s=>s.type==="text");r.length&&this.addTextFromPaste(r.map(s=>s.value).join(`
|
|
228
|
+
|
|
229
|
+
`),n)}}addTextFromPaste(t,n=!1){let{x:a,y:i}=Ze({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),r={x:a,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roundness:null,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:t,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:Jo,verticalAlign:Nd,locked:!1},s=Ve({fontSize:r.fontSize,fontFamily:r.fontFamily}),l=Kr(r.fontFamily),[c,,d]=C7(this.state),o=Math.max(Math.min((d-c)*.5,800),200),u=10,h=i,p=n?[t]:t.split(`
|
|
230
|
+
`),U=p.reduce((m,g,b)=>{var x;let v=Ks(g).trim();if(v.length){let y=this.getTopLayerFrameAtSceneCoords({x:a,y:h}),E=an(v,s,l),S=E.width>o,w=S?rs(v,s,o):v;E=S?an(w,s,l):E;let k=a-E.width/2,T=h-E.height/2,_=Tn({...r,x:k,y:T,text:w,originalText:v,lineHeight:l,autoResize:!S,frameId:y?y.id:null});m.push(_),h+=_.height+u}else(x=p[b-1])!=null&&x.trim()&&(h+=nc(r.fontSize,l)+u);return m},[]);U.length!==0&&(this.scene.insertElements(U),this.setState({selectedElementIds:Pe(Object.fromEntries(U.map(m=>[m.id,!0])),this.state)}),!n&&U.length>1&&G5===!1&&!this.device.editor.isMobile&&(this.setToast({message:I("toast.pasteAsSingleElement",{shortcut:V("CtrlOrCmd+Shift+V")}),duration:5e3}),G5=!0),this.store.shouldCaptureIncrement())}handleTextWysiwyg(t,{isExistingElement:n=!1}){let a=this.scene.getElementsMapIncludingDeleted(),i=(r,s)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(l=>l.id===t.id&&q(l)?Ue(l,{originalText:r,isDeleted:s??l.isDeleted,...Z7(l,zt(l,a),a,r)}):l)])};PY({id:t.id,canvas:this.canvas,getViewportCoords:(r,s)=>{let{x:l,y:c}=Nn({sceneX:r,sceneY:s},this.state);return[l-this.state.offsetLeft,c-this.state.offsetTop]},onChange:ut(r=>{i(r,!1),Y1(t)&&xn(t,this.scene.getNonDeletedElementsMap())}),onSubmit:ut(({viaKeyboard:r,nextOriginalText:s})=>{let l=!s.trim();if(i(s,l),!l&&r){let c=t.containerId?t.containerId:t.id;Xt.flushSync(()=>{this.setState(d=>({selectedElementIds:Pe({...d.selectedElementIds,[c]:!0},d)}))})}l&&A7(this.scene.getNonDeletedElements(),[t]),(!l||n)&&this.store.shouldCaptureIncrement(),Xt.flushSync(()=>{this.setState({newElement:null,editingTextElement:null})}),this.state.activeTool.locked&&Ma(this.interactiveCanvas,this.state),this.focusContainer()}),element:t,excalidrawContainer:this.excalidrawContainerRef.current,app:this,autoSelect:!this.device.isTouchScreen}),this.deselectElements(),i(t.originalText,!1)}deselectElements(){this.setState({selectedElementIds:Pe({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}getTextElementAtPosition(t,n){let a=this.getElementAtPosition(t,n,{includeBoundTextElement:!0});return a&&q(a)&&!a.isDeleted?a:null}getElementAtPosition(t,n,a){let i=this.getElementsAtPosition(t,n,a==null?void 0:a.includeBoundTextElement,a==null?void 0:a.includeLockedElements);if(i.length>1){if(a!=null&&a.preferSelected){for(let s=i.length-1;s>-1;s--)if(this.state.selectedElementIds[i[s].id])return i[s]}let r=i[i.length-1];return Cs({x:t,y:n,element:r,shape:si(r,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()/2,frameNameBound:de(r)?this.frameNameBoundsCache.get(r):null})?r:i[i.length-2]}return i.length===1?i[0]:null}getElementsAtPosition(t,n,a=!1,i=!1){let r=[],s=this.scene.getNonDeletedElementsMap();return(a&&i?this.scene.getNonDeletedElements():this.scene.getNonDeletedElements().filter(l=>(i||!l.locked)&&(a||!(q(l)&&l.containerId)))).filter(l=>this.hitElement(t,n,l)).filter(l=>{let c=wn(l,s);return c&&this.state.frameRendering.enabled&&this.state.frameRendering.clip?Ig({x:t,y:n},c,s):!0}).filter(l=>Oi(l)?(r.push(l),!1):!0).concat(r)}getElementHitThreshold(){return Uk/this.state.zoom.value}hitElement(t,n,a,i=!0){if(i&&this.state.selectedElementIds[a.id]&&X3([a],this.state)){let r=nL(a,this.scene.getNonDeletedElementsMap(),Ne(a)?0:this.getElementHitThreshold());if(qd(C(t,n),r))return!0}return s7(t,n,o7(a,this.scene.getNonDeletedElementsMap()))?!0:Cs({x:t,y:n,element:a,shape:si(a,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:de(a)?this.frameNameBoundsCache.get(a):null})}getTextBindableContainerAtPosition(t,n){let a=this.scene.getNonDeletedElements(),i=this.scene.getSelectedElements(this.state);if(i.length===1)return Dr(i[0],!1)?i[0]:null;let r=null;for(let s=a.length-1;s>=0;--s){if(a[s].isDeleted)continue;let[l,c,d,o]=pe(a[s],this.scene.getNonDeletedElementsMap());if(xe(a[s])&&Cs({x:t,y:n,element:a[s],shape:si(a[s],this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()})){r=a[s];break}else if(l<t&&t<d&&c<n&&n<o){r=a[s];break}}return Dr(r,!1)?r:null}handleHoverSelectedLinearElement(t,n,a){let i=this.scene.getNonDeletedElementsMap(),r=J.getElement(t.elementId,i);if(r)if(this.state.selectedLinearElement){let s=-1,l=null;Cs({x:n,y:a,element:r,shape:si(r,this.scene.getNonDeletedElementsMap())})?(s=J.getPointIndexUnderCursor(r,i,this.state.zoom,n,a),l=J.getSegmentMidpointHitCoords(t,{x:n,y:a},this.state,this.scene.getNonDeletedElementsMap()),(ee(r)?s===0||s===r.points.length-1:s>=0)||l?We(this.interactiveCanvas,He.POINTER):this.hitElement(n,a,r)&&We(this.interactiveCanvas,He.MOVE)):this.hitElement(n,a,r)&&(!ee(r)||!(r.startBinding||r.endBinding))&&We(this.interactiveCanvas,He.MOVE),this.state.selectedLinearElement.hoverPointIndex!==s&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,hoverPointIndex:s}}),J.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords,l)||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:l}})}else We(this.interactiveCanvas,He.AUTO)}updateGestureOnPointerDown(t){De.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),De.pointers.size===2&&(De.lastCenter=U5(De.pointers),De.initialScale=this.state.zoom.value,De.initialDistance=m5(Array.from(De.pointers.values())))}initialPointerDownState(t){let n=Ze(t,this.state),a=this.scene.getSelectedElements(this.state),[i,r,s,l]=$e(a),c=a.findIndex(ee)===0;return{origin:n,withCmdOrCtrl:t[D.CTRL_OR_CMD],originInGrid:aa(kt(n.x,n.y,t[D.CTRL_OR_CMD]||c?null:this.getEffectiveGridSize())),scrollbars:x5(e1,t.clientX-this.state.offsetLeft,t.clientY-this.state.offsetTop),lastCoords:{...n},originalElements:this.scene.getNonDeletedElements().reduce((d,o)=>(d.set(o.id,ss(o)),d),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(s+i)/2,y:(l+r)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(n,a)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(t,n){if(!(n.scrollbars.isOverEither&&!this.state.multiElement))return!1;Qh=!0,n.lastCoords.x=t.clientX,n.lastCoords.y=t.clientY;let a=Yh(r=>{r.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(r,n)}),i=ut(()=>{gr=null,Qh=!1,Ma(this.interactiveCanvas,this.state),this.setState({cursorButton:"up"}),this.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",i),a.flush()});return gr=i,window.addEventListener("pointermove",a),window.addEventListener("pointerup",i),!0}isASelectedElement(t){return t!=null&&this.state.selectedElementIds[t.id]}isHittingCommonBoundingBoxOfSelectedElements(t,n){if(n.length<2)return!1;let a=this.getElementHitThreshold(),[i,r,s,l]=$e(n);return t.x>i-a&&t.x<s+a&&t.y>r-a&&t.y<l+a}getCurrentItemRoundness(t){return this.state.currentItemRoundness==="round"?{type:fl(t)?St.ADAPTIVE_RADIUS:St.PROPORTIONAL_RADIUS}:null}maybeCacheReferenceSnapPoints(t,n,a=!1){er({event:t,app:this,selectedElements:n})&&(a||!ai.getReferenceSnapPoints())&&ai.setReferenceSnapPoints(PD(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}maybeCacheVisibleGaps(t,n,a=!1){er({event:t,app:this,selectedElements:n})&&(a||!ai.getVisibleGaps())&&ai.setVisibleGaps(DD(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}onKeyDownFromPointerDownHandler(t){return ut(n=>{this.maybeHandleResize(t,n)||this.maybeDragNewGenericElement(t,n)})}onKeyUpFromPointerDownHandler(t){return ut(n=>{n.key===D.ALT&&n.preventDefault(),!this.maybeHandleResize(t,n)&&this.maybeDragNewGenericElement(t,n)})}onPointerMoveFromPointerDownHandler(t){return Yh(n=>{var o,u,h,p,U,m;if(((o=this.state.openDialog)==null?void 0:o.name)==="elementLinkSelector")return;let a=Ze(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.elbowed&&this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index){let[g,b]=kt(a.x,a.y,n[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;if(v<0){let y=J.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:g,y:b},this.state,this.scene.getNonDeletedElementsMap());v=y?J.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,y,this.scene.getNonDeletedElementsMap()):-1}let x=J.moveFixedSegment(this.state.selectedLinearElement,v,g,b,this.scene.getNonDeletedElementsMap());Xt.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:x.segmentMidPointHoveredCoords,pointerDownState:x.pointerDownState}})});return}let i=this.lastPointerMoveCoords??t.origin;if(this.lastPointerMoveCoords=a,t.drag.offset===null&&(t.drag.offset=aa(HN(this.scene.getSelectedElements(this.state),t.origin.x,t.origin.y))),!(n.target instanceof HTMLElement)||this.handlePointerMoveOverScrollbars(n,t))return;if(Ia(this.state)){this.handleEraser(n,t,a);return}this.state.activeTool.type==="laser"&&this.laserTrails.addPointToPath(a.x,a.y);let[r,s]=kt(a.x,a.y,n[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize());if(!t.drag.hasOccurred&&(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")&&Oe(C(a.x,a.y),C(t.origin.x,t.origin.y))<yr)return;if(t.resize.isResizing&&(t.lastCoords.x=a.x,t.lastCoords.y=a.y,this.maybeHandleCrop(t,n)||this.maybeHandleResize(t,n)))return!0;let l=this.scene.getNonDeletedElementsMap();if(this.state.selectedLinearElement){let g=this.state.editingLinearElement||this.state.selectedLinearElement;if(J.shouldAddMidpoint(this.state.selectedLinearElement,a,this.state,l)){let b=J.addMidpoint(this.state.selectedLinearElement,a,this,!n[D.CTRL_OR_CMD],l);if(!b)return;Xt.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:b.pointerDownState,selectedPointsIndices:b.selectedPointsIndices}}),this.state.editingLinearElement&&this.setState({editingLinearElement:{...this.state.editingLinearElement,pointerDownState:b.pointerDownState,selectedPointsIndices:b.selectedPointsIndices}})});return}else if(g.pointerDownState.segmentMidpoint.value!==null&&!g.pointerDownState.segmentMidpoint.added)return;if(J.handlePointDragging(n,this,a.x,a.y,(b,v)=>{this.maybeSuggestBindingsForLinearElementAtCoords(b,v)},g,this.scene)){t.lastCoords.x=a.x,t.lastCoords.y=a.y,t.drag.hasOccurred=!0,this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging&&this.setState({editingLinearElement:{...this.state.editingLinearElement,isDragging:!0}}),this.state.selectedLinearElement.isDragging||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!0}});return}}let c=t.hit.allHitElements.some(g=>this.isASelectedElement(g)),d=this.state.editingLinearElement&&n.shiftKey&&this.state.editingLinearElement.elementId===((u=t.hit.element)==null?void 0:u.id);if((c||t.hit.hasHitCommonBoundingBoxOfSelectedElements)&&!d){let g=this.scene.getSelectedElements(this.state);if(g.every(y=>y.locked))return;let b=g.find(y=>de(y)),v=this.getTopLayerFrameAtSceneCoords(a),x=v&&!b?v:null;if(this.state.frameToHighlight!==x&&Xt.flushSync(()=>{this.setState({frameToHighlight:x})}),t.drag.hasOccurred=!0,g.length>0&&!t.withCmdOrCtrl&&!this.state.editingTextElement&&((h=this.state.activeEmbeddable)==null?void 0:h.state)!=="active"){let y={x:a.x-t.origin.x,y:a.y-t.origin.y},E=[...t.originalElements.values()],S=n.shiftKey;if(S){let T=Math.abs(y.x),_=Math.abs(y.y),j=S&&T<_,A=S&&T>_;j&&(y.x=0),A&&(y.y=0)}if(this.state.croppingElementId){let T=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(T&&Ne(T)&&T.crop!==null&&t.hit.element===T){let _=T.crop,j=Dn(T)&&((p=this.imageCache.get(T.fileId))==null?void 0:p.image);if(j&&!(j instanceof Promise)){let A=pt(Ht(a.x-i.x,a.y-i.y),Math.max(this.state.zoom.value,2)),[R,N,O,$,P,W]=pe(T,l),F=re(H(C(R,N),C(P,W),T.angle)),Y=re(H(C(O,N),C(P,W),T.angle)),Q=re(H(C(R,$),C(P,W),T.angle)),le=en(Hd(Y,F)),ie=en(Hd(Q,F)),Te=Ht(r2(A,le),r2(A,ie)),_e={..._,x:Se(_.x-Te[0]*Math.sign(T.scale[0]),0,j.naturalWidth-_.width),y:Se(_.y-Te[1]*Math.sign(T.scale[1]),0,j.naturalHeight-_.height)};G(T,{crop:_e});return}}}this.maybeCacheVisibleGaps(n,g),this.maybeCacheReferenceSnapPoints(n,g);let{snapOffset:w,snapLines:k}=ND(E,y,this,n,this.scene.getNonDeletedElementsMap());if(this.setState({snapLines:k}),this.state.editingFrame||zN(t,g,y,this.scene,w,n[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),this.setState({selectedElementsAreBeingDragged:!0,selectionElement:null}),(g.length!==1||!ee(g[0]))&&this.setState({suggestedBindings:fh(g,this.scene.getNonDeletedElementsMap(),this.state.zoom)}),n.altKey&&!t.hit.hasBeenDuplicated){t.hit.hasBeenDuplicated=!0;let T=[],_=[],j=new Map,A=new Map,R=t.hit.element,N=new Set(this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}).map(P=>P.id)),O=this.scene.getElementsIncludingDeleted();for(let P of O){let W=N.has(P.id)||P.id===(R==null?void 0:R.id)&&t.hit.wasAddedToSelection;if(Math.abs(P.x)>1e7||Math.abs(P.x)>1e7||Math.abs(P.width)>1e7||Math.abs(P.height)>1e7){console.error("Alt+dragging element in scene with invalid dimensions",P.x,P.y,P.width,P.height,W);return}if(W){let F=J7(this.state.editingGroupId,j,P);if(Math.abs(F.x)>1e7||Math.abs(F.x)>1e7||Math.abs(F.width)>1e7||Math.abs(F.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",F.x,F.y,F.width,F.height);return}let Y=t.originalElements.get(P.id);if(Math.abs(Y.x)>1e7||Math.abs(Y.x)>1e7||Math.abs(Y.width)>1e7||Math.abs(Y.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",Y.x,Y.y,Y.width,Y.height);return}G(F,{x:Y.x,y:Y.y}),t.originalElements.set(F.id,F),T.push(F),_.push(P),A.set(P.id,F.id)}else T.push(P)}let $=[...T,..._];$=((m=(U=this.props).onDuplicate)==null?void 0:m.call(U,$,O))||$,Wa($,ce(_)),B7(T,_,A),j7($,_,A,"duplicatesServeAsOld"),R3($,_,A),this.scene.replaceAllElements($),this.maybeCacheVisibleGaps(n,g,!0),this.maybeCacheReferenceSnapPoints(n,g,!0)}return}}if(this.state.selectionElement)t.lastCoords.x=a.x,t.lastCoords.y=a.y,this.maybeDragNewGenericElement(t,n);else{let g=this.state.newElement;if(!g)return;if(g.type==="freedraw"){let b=g.points,v=a.x-g.x,x=a.y-g.y,y=b.length>0&&b[b.length-1];if(!(y&&y[0]===v&&y[1]===x)){let E=g.simulatePressure?g.pressures:[...g.pressures,n.pressure];G(g,{points:[...b,C(v,x)],pressures:E},!1),this.setState({newElement:g})}}else if(fe(g)){t.drag.hasOccurred=!0;let b=g.points,v=r-g.x,x=s-g.y;so(n)&&b.length===2&&({width:v,height:x}=V1(g.x,g.y,a.x,a.y)),b.length===1?G(g,{points:[...b,C(v,x)]},!1):(b.length===2||b.length>1&&ee(g))&&G(g,{points:[...b.slice(0,-1),C(v,x)]},!1,{isDragging:!0}),this.setState({newElement:g}),La(g,!1)&&this.maybeSuggestBindingsForLinearElementAtCoords(g,[a],this.state.startBoundElement)}else t.lastCoords.x=a.x,t.lastCoords.y=a.y,this.maybeDragNewGenericElement(t,n,!1)}if(this.state.activeTool.type==="selection"){t.boxSelection.hasOccurred=!0;let g=this.scene.getNonDeletedElements();if(this.state.editingLinearElement)J.handleBoxSelection(n,this.state,this.setState.bind(this),this.scene.getNonDeletedElementsMap());else{let b=!0;!n.shiftKey&&It(g,this.state)&&(t.withCmdOrCtrl&&t.hit.element?this.setState(x=>ln({...x,selectedElementIds:{[t.hit.element.id]:!0}},this.scene.getNonDeletedElements(),x,this)):b=!1);let v=this.state.selectionElement?$p(g,this.state.selectionElement,this.scene.getNonDeletedElementsMap(),!1):[];this.setState(x=>{let y={...b&&x.selectedElementIds,...v.reduce((E,S)=>(E[S.id]=!0,E),{})};return t.hit.element&&(v.length?delete y[t.hit.element.id]:y[t.hit.element.id]=!0),x=b?x:{...x,selectedGroupIds:{},editingGroupId:null},{...ln({editingGroupId:x.editingGroupId,selectedElementIds:y},this.scene.getNonDeletedElements(),x,this),selectedLinearElement:v.length===1&&fe(v[0])?new J(v[0]):null,showHyperlinkPopup:v.length===1&&(v[0].link||Un(v[0]))?"info":!1}})}}})}handlePointerMoveOverScrollbars(t,n){if(n.scrollbars.isOverHorizontal){let a=t.clientX,i=a-n.lastCoords.x;return this.translateCanvas({scrollX:this.state.scrollX-i/this.state.zoom.value}),n.lastCoords.x=a,!0}if(n.scrollbars.isOverVertical){let a=t.clientY,i=a-n.lastCoords.y;return this.translateCanvas({scrollY:this.state.scrollY-i/this.state.zoom.value}),n.lastCoords.y=a,!0}return!1}onPointerUpFromPointerDownHandler(t){return ut(n=>{var m,g,b,v,x,y,E,S,w,k,T,_;this.removePointer(n),t.eventListeners.onMove&&t.eventListeners.onMove.flush();let{newElement:a,resizingElement:i,croppingElementId:r,multiElement:s,activeTool:l,isResizing:c,isRotating:d,isCropping:o}=this.state;this.setState(j=>({isResizing:!1,isRotating:!1,isCropping:!1,resizingElement:null,selectionElement:null,frameToHighlight:null,elementsToHighlight:null,cursorButton:"up",snapLines:Il(j.snapLines,[]),originSnapOffset:null})),this.lastPointerMoveCoords=null,ai.setReferenceSnapPoints(null),ai.setVisibleGaps(null),this.savePointer(n.clientX,n.clientY,"up"),this.setState({selectedElementsAreBeingDragged:!1});let u=this.scene.getNonDeletedElementsMap();if(t.drag.hasOccurred&&((g=(m=t.hit)==null?void 0:m.element)!=null&&g.id)){let j=u.get(t.hit.element.id);ha(j)&&((b=j.boundElements)==null||b.filter(A=>A.type==="arrow").map(A=>u.get(A.id)).filter(A=>ee(A)).forEach(A=>{A&&G(A,{},!0)}))}if(this.state.editingLinearElement)if(!t.boxSelection.hasOccurred&&((x=(v=t.hit)==null?void 0:v.element)==null?void 0:x.id)!==this.state.editingLinearElement.elementId)this.actionManager.executeAction(Kn);else{let j=J.handlePointerUp(n,this.state.editingLinearElement,this.state,this.scene);j!==this.state.editingLinearElement&&this.setState({editingLinearElement:j,suggestedBindings:[]})}else if(this.state.selectedLinearElement){if(this.state.selectedLinearElement.elbowed){let j=J.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());j&&G(j,{},!0)}if(((E=(y=t.hit)==null?void 0:y.element)==null?void 0:E.id)!==this.state.selectedLinearElement.elementId)this.scene.getSelectedElements(this.state).length>1&&this.setState({selectedLinearElement:null});else{let j=J.handlePointerUp(n,this.state.selectedLinearElement,this.state,this.scene),{startBindingElement:A,endBindingElement:R}=j,N=this.scene.getElement(j.elementId);La(N)&&Yu(N,A,R,u,this.scene),j!==this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...j,selectedPointsIndices:null},suggestedBindings:[]})}}if(this.missingPointerEventCleanupEmitter.clear(),window.removeEventListener("pointermove",t.eventListeners.onMove),window.removeEventListener("pointerup",t.eventListeners.onUp),window.removeEventListener("keydown",t.eventListeners.onKeyDown),window.removeEventListener("keyup",t.eventListeners.onKeyUp),this.state.pendingImageElementId&&this.setState({pendingImageElementId:null}),(w=(S=this.props)==null?void 0:S.onPointerUp)==null||w.call(S,l,t),this.onPointerUpEmitter.trigger(this.state.activeTool,t,n),(a==null?void 0:a.type)==="freedraw"){let j=Ze(n,this.state),A=a.points,R=j.x-a.x,N=j.y-a.y;R===A[0][0]&&N===A[0][1]&&(N+=1e-4,R+=1e-4);let O=a.simulatePressure?[]:[...a.pressures,n.pressure];G(a,{points:[...A,C(R,N)],pressures:O,lastCommittedPoint:C(R,N)}),this.actionManager.executeAction(Kn);return}if(Ne(a)){let j=a;try{this.initializeImageDimensions(j),this.setState({selectedElementIds:Pe({[j.id]:!0},this.state)},()=>{this.actionManager.executeAction(Kn)})}catch(A){console.error(A),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter(R=>R.id!==j.id)),this.actionManager.executeAction(Kn)}return}if(fe(a)){a.points.length>1&&this.store.shouldCaptureIncrement();let j=Ze(n,this.state);!t.drag.hasOccurred&&a&&!s?(G(a,{points:[...a.points,C(j.x-a.x,j.y-a.y)]}),this.setState({multiElement:a,newElement:a})):t.drag.hasOccurred&&!s&&(_r(this.state)&&La(a,!1)&&D1(a,this.state,j,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.setState({suggestedBindings:[],startBoundElement:null}),l.locked?this.setState(A=>({newElement:null})):(Jn(this.interactiveCanvas),this.setState(A=>({newElement:null,activeTool:Et(this.state,{type:"selection"}),selectedElementIds:Pe({...A.selectedElementIds,[a.id]:!0},A),selectedLinearElement:new J(a)}))),this.scene.triggerUpdate());return}if(q(a)){let j=V0(Ve({fontSize:a.fontSize,fontFamily:a.fontFamily}),a.lineHeight);a.width<j&&G(a,{autoResize:!0}),this.resetCursor(),this.handleTextWysiwyg(a,{isExistingElement:!0})}if(l.type!=="selection"&&a&&Qr(a)){this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(j=>j.id!==a.id),appState:{newElement:null},captureUpdate:X.NEVER});return}if(de(a)){let j=yN(this.scene.getElementsIncludingDeleted(),a,this.scene.getNonDeletedElementsMap());this.scene.replaceAllElements(oo(this.scene.getElementsMapIncludingDeleted(),j,a,this.state))}if(a&&(G(a,z3(a)),this.scene.triggerUpdate()),t.drag.hasOccurred){let j=Ze(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.isDragging){let A=this.scene.getElement(this.state.selectedLinearElement.elementId);if(A!=null&&A.frameId){let R=wn(A,u);R&&A&&(nr(A,R,this.scene.getNonDeletedElementsMap())||(G(A,{groupIds:[]}),sf([A],this.scene.getNonDeletedElementsMap()),this.scene.triggerUpdate()))}}else{let A=this.getTopLayerFrameAtSceneCoords(j),R=this.scene.getSelectedElements(this.state),N=this.scene.getElementsMapIncludingDeleted(),O=$=>{if($.length>0){for(let P of $){let W=P.groupIds.indexOf(this.state.editingGroupId);G(P,{groupIds:P.groupIds.slice(0,W)},!1)}N.forEach(P=>{P.groupIds.length&&nt(N,P.groupIds[P.groupIds.length-1]).length<2&&G(P,{groupIds:[]},!1)}),this.setState({editingGroupId:null})}};if(A&&!this.state.selectedElementIds[A.id]){let $=R.filter(P=>P.frameId!==A.id&&cu(P,N,this.state));this.state.editingGroupId&&O($),N=oo(N,$,A,this.state)}else if(!A&&this.state.editingGroupId){let $=R.filter(P=>P.frameId&&!cu(P,N,this.state));O($)}N=il(N,this.state,this),this.scene.replaceAllElements(N)}}if(i&&this.store.shouldCaptureIncrement(),i&&Qr(i)&&this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(j=>j.id!==i.id),captureUpdate:X.NEVER}),t.resize.isResizing){let j=il(this.scene.getElementsIncludingDeleted(),this.state,this),A=this.scene.getSelectedElements(this.state).filter(R=>de(R));for(let R of A)j=P3(j,bd(this.scene.getElementsIncludingDeleted(),R,this.state,u),R,this);this.scene.replaceAllElements(j)}let h=t.hit.element;((k=this.state.selectedLinearElement)==null?void 0:k.elementId)!==(h==null?void 0:h.id)&&fe(h)&&this.scene.getSelectedElements(this.state).length===1&&this.setState({selectedLinearElement:new J(h)}),(!r||r&&(!h&&!o||h&&h.id!==r))&&this.finishImageCropping();let p=this.lastPointerDownEvent,U=this.lastPointerUpEvent||this.lastPointerMoveEvent;if(Ia(this.state)&&p&&U){if(this.eraserTrail.endPath(),Oe(C(p.clientX,p.clientY),C(U.clientX,U.clientY))===0){let j=Ze({clientX:U.clientX,clientY:U.clientY},this.state);this.getElementsAtPosition(j.x,j.y).forEach(A=>this.elementsPendingErasure.add(A.id))}this.eraseElements();return}else this.elementsPendingErasure.size&&this.restoreReadyToEraseElements();if(h&&!t.drag.hasOccurred&&!t.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!t.boxSelection.hasOccurred)&&(n.shiftKey&&!this.state.editingLinearElement?this.state.selectedElementIds[h.id]?P7(this.state,h)?this.setState(j=>{let A={...j.selectedElementIds};for(let R of h.groupIds.flatMap(N=>nt(this.scene.getNonDeletedElements(),N)))delete A[R.id];return{selectedGroupIds:{...j.selectedElementIds,...h.groupIds.map(R=>({[R]:!1})).reduce((R,N)=>({...R,...N}),{})},selectedElementIds:Pe(A,j)}}):(T=this.state.selectedLinearElement)!=null&&T.isDragging||this.setState(j=>{let A={...j.selectedElementIds};delete A[h.id];let R=ve(this.scene.getNonDeletedElements(),{selectedElementIds:A});return{...ln({editingGroupId:j.editingGroupId,selectedElementIds:A},this.scene.getNonDeletedElements(),j,this),selectedLinearElement:R.length===1&&fe(R[0])?new J(R[0]):j.selectedLinearElement}}):h.frameId&&this.state.selectedElementIds[h.frameId]?this.setState(j=>{var R;let A={...j.selectedElementIds,[h.id]:!0};return delete A[h.frameId],(((R=this.scene.getElement(h.frameId))==null?void 0:R.groupIds)??[]).flatMap(N=>nt(this.scene.getNonDeletedElements(),N)).forEach(N=>{delete A[N.id]}),{...ln({editingGroupId:j.editingGroupId,selectedElementIds:A},this.scene.getNonDeletedElements(),j,this),showHyperlinkPopup:h.link||Un(h)?"info":!1}}):this.setState(j=>({selectedElementIds:Pe({...j.selectedElementIds,[h.id]:!0},j)})):this.setState(j=>{var A;return{...ln({editingGroupId:j.editingGroupId,selectedElementIds:{[h.id]:!0}},this.scene.getNonDeletedElements(),j,this),selectedLinearElement:fe(h)&&((A=j.selectedLinearElement)==null?void 0:A.elementId)!==h.id?new J(h):j.selectedLinearElement}})),!(h&&ee(h))&&!t.drag.hasOccurred&&!this.state.isResizing&&(h&&mL({x:t.origin.x,y:t.origin.y,element:h,shape:si(h,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:de(h)?this.frameNameBoundsCache.get(h):null},u)||!h&&t.hit.hasHitCommonBoundingBoxOfSelectedElements)){this.state.editingLinearElement?this.setState({editingLinearElement:null}):this.setState({selectedElementIds:Pe({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),We(this.interactiveCanvas,He.AUTO);return}if(!l.locked&&l.type!=="freedraw"&&a&&this.setState(j=>({selectedElementIds:Pe({...j.selectedElementIds,[a.id]:!0},j),showHyperlinkPopup:Un(a)&&!a.link?"editor":j.showHyperlinkPopup})),(l.type!=="selection"||It(this.scene.getNonDeletedElements(),this.state)||!Vt(this.state.previousSelectedElementIds,this.state.selectedElementIds))&&this.store.shouldCaptureIncrement(),t.drag.hasOccurred||c||d||o){let j=this.scene.getSelectedElements(this.state).filter(fe);eu(j,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,_r(this.state),((_=this.state.selectedLinearElement)==null?void 0:_.selectedPointsIndices)??[],this.state.zoom)}if(l.type==="laser"){this.laserTrails.endPath();return}!l.locked&&l.type!=="freedraw"?(Jn(this.interactiveCanvas),this.setState({newElement:null,suggestedBindings:[],activeTool:Et(this.state,{type:"selection"})})):this.setState({newElement:null,suggestedBindings:[]}),h&&this.lastPointerUpEvent&&this.lastPointerDownEvent&&this.lastPointerUpEvent.timeStamp-this.lastPointerDownEvent.timeStamp<300&&De.pointers.size<=1&&Pn(h)&&this.isIframeLikeElementCenter(h,this.lastPointerUpEvent,t.origin.x,t.origin.y)&&this.handleEmbeddableCenterClick(h)})}clearSelection(t){this.setState(n=>({selectedElementIds:Pe({},n),activeEmbeddable:null,selectedGroupIds:{},editingGroupId:n.editingGroupId&&t!=null&&Po(t,n.editingGroupId)?n.editingGroupId:null})),this.setState({selectedElementIds:Pe({},this.state),activeEmbeddable:null,previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(t,n,a,i){if(i){let r=i.x+i.width/2,s=i.y+i.height/2,l=hh(i,a,this.scene.getNonDeletedElementsMap());if(l&&(r=l.x,s=l.y),Math.hypot(t-r,n-s)<hk){let{x:c,y:d}=Nn({sceneX:r,sceneY:s},a);return{viewportX:c,viewportY:d,elementCenterX:r,elementCenterY:s}}}}getCanvasOffsets(){var t;if((t=this.excalidrawContainerRef)!=null&&t.current){let n=this.excalidrawContainerRef.current,{left:a,top:i}=n.getBoundingClientRect();return{offsetLeft:a,offsetTop:i}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){let t=bf.find(n=>n.code===this.props.langCode)||ls;await wv(t),this.setAppState({})}},XY=()=>{(be.MODE===vn.TEST||be.DEV)&&(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){var e;return(e=this.app)==null?void 0:e.scene.getElementsIncludingDeleted()},set(e){var t;return(t=this.app)==null?void 0:t.scene.replaceAllElements(Va(e))}},scene:{configurable:!0,get(){var e;return(e=this.app)==null?void 0:e.scene}}}))};XY();var WY=HY,VY=()=>{Array.prototype.at||Object.defineProperty(Array.prototype,"at",{value:function(e){if(e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]},writable:!0,enumerable:!1,configurable:!0}),Element.prototype.replaceChildren||(Element.prototype.replaceChildren=function(...e){this.innerHTML="",this.append(...e)})},GY=VY,Ty=({children:e})=>{let{FooterCenterTunnel:t}=un(),n=Yt();return f.jsx(t.In,{children:f.jsx("div",{className:ne("footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":n.zenModeEnabled}),children:e})})},YY=Ty;Ty.displayName="FooterCenter";var ZY=()=>f.jsx("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ExcalidrawLogo-icon",children:f.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),KY=()=>f.jsxs("svg",{viewBox:"0 0 450 55",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"ExcalidrawLogo-text",children:[f.jsx("path",{d:"M429.27 96.74c2.47-1.39 4.78-3.02 6.83-4.95 1.43-1.35 2.73-2.86 3.81-4.51-.66.9-1.4 1.77-2.23 2.59-2.91 2.84-5.72 5.09-8.42 6.87h.01ZM343.6 69.36c.33 3.13.58 6.27.79 9.4.09 1.37.18 2.75.25 4.12-.12-4.46-.27-8.93-.5-13.39-.11-2.08-.24-4.16-.4-6.24-.06 1.79-.11 3.85-.13 6.11h-.01ZM378.47 98.34c.01-.37.07-1.13.01-6.51-.11 1.9-.22 3.81-.31 5.71-.07 1.42-.22 2.91-.16 4.35.39.03.78.07 1.17.1-.92-.85-.76-2.01-.72-3.66l.01.01ZM344.09 86.12c-.09-2.41-.22-4.83-.39-7.24v12.21c.15-.05.32-.09.47-.14.05-1.61-.03-3.23-.09-4.83h.01ZM440.69 66.79c-.22-.34-.45-.67-.69-.99-3.71-4.87-9.91-7.14-15.65-8.55-1.05-.26-2.12-.49-3.18-.71 2.29.59 4.48 1.26 6.64 2.02 7.19 2.54 10.57 5.41 12.88 8.23ZM305.09 72.46l1.2 3.6c.84 2.53 1.67 5.06 2.46 7.61.24.78.5 1.57.73 2.36.22-.04.44-.08.67-.12a776.9 776.9 0 0 1-5.01-13.57c-.02.04-.03.09-.05.13v-.01ZM345.49 90.25v.31c1.48-.42 3.05-.83 4.66-1.2-1.56.25-3.12.52-4.66.89ZM371.02 90.22c0-.57-.04-1.14-.11-1.71-.06-.02-.12-.04-.19-.05-.21-.05-.43-.08-.65-.11.42.16.74.88.95 1.87ZM398.93 54.23c-.13 0-.27-.01-.4-.02l.03.4c.11-.15.23-.27.37-.38ZM401.57 62.28v-.15c-1.22-.24-2.86-.61-3.23-1.25-.09-.15-.18-.51-.27-.98-.09.37-.2.73-.33 1.09 1.24.56 2.52.98 3.83 1.29ZM421.73 88.68c-2.97 1.65-6.28 3.12-9.69 3.68v.18c4.72-.14 11.63-3.85 16.33-8.38-2.04 1.75-4.33 3.24-6.63 4.53l-.01-.01ZM411.28 80.92c-.05-1.2-.09-2.4-.15-3.6-.21 5.66-.46 11.38-.47 14.51.24-.02.48-.04.71-.07.15-3.61.05-7.23-.09-10.83v-.01Z",transform:"translate(-144.023 -51.76)"}),f.jsx("path",{d:"M425.38 67.41c-3.5-1.45-7.19-2.57-14.06-3.62.09 1.97.06 4.88-.03 8.12.03.04.06.09.06.15.19 1.36.28 2.73.37 4.1.25 3.77.39 7.55.41 11.33 0 1.38-.01 2.76-.07 4.13 1.4-.25 2.78-.65 4.12-1.15 4.07-1.5 7.94-3.78 11.28-6.54 2.33-1.92 5.13-4.49 5.88-7.58.63-3.53-2.45-6.68-7.97-8.96l.01.02ZM411.35 92.53v-.06l-.34.03c.11.01.22.03.34.03ZM314.26 64.06c-.23-.59-.47-1.17-.7-1.75.57 1.62 1.11 3.25 1.6 4.9l.15.54 2.35 6.05c.32.82.66 1.64.98 2.46-1.38-4.1-2.83-8.17-4.39-12.2h.01ZM156.82 103.07c-.18.13-.38.23-.58.33 1.32-.03 2.66-.2 3.93-.34.86-.09 1.72-.22 2.58-.33-2.12.1-4.12.17-5.94.34h.01ZM210.14 68.88s.03.04.05.07c.18-.31.39-.64.58-.96-.21.3-.42.6-.64.89h.01ZM201.65 82.8c-.5.77-1.02 1.56-1.49 2.37 1.11-1.55 2.21-3.1 3.2-4.59-.23.23-.49.51-.75.79-.32.47-.65.95-.96 1.43ZM194.03 98.66c-.33-.4-.65-.84-1.05-1.17-.24-.2-.07-.49.17-.56-.23-.26-.42-.5-.63-.75 1.51-2.55 3.93-5.87 6.4-9.28-.17-.08-.29-.28-.2-.49.04-.09.09-.17.13-.26-1.21 1.78-2.42 3.55-3.61 5.33-.87 1.31-1.74 2.64-2.54 4-.29.5-.63 1.04-.87 1.61.81.65 1.63 1.27 2.47 1.88-.09-.11-.18-.21-.27-.32v.01ZM307.79 82.93c-1-3.17-2.05-6.32-3.1-9.48-1.62 4.08-3.69 9.17-6.16 15.19 3.32-1.04 6.77-1.87 10.27-2.5-.32-1.08-.67-2.15-1.01-3.21ZM149.5 80.7c.05-1.71.04-3.43 0-5.14-.1 2.26-.16 4.51-.22 6.77-.02.73-.03 1.46-.04 2.19.14-1.27.2-2.55.24-3.82h.02ZM228.98 98.3c.39 1.25.91 3.03.94 3.91.06-.03.12-.07.17-.1.08-1.29-.55-2.65-1.11-3.81ZM307.72 53.36c.81.5 1.53 1.04 2.07 1.49-.38-.8-.78-1.58-1.21-2.35-.17.03-.34.06-.51.11-.43.12-.86.26-1.29.41.35-.01.53.1.94.34ZM283.69 96.14c3.91-7.25 6.89-13.35 8.88-18.15l1.1-2.66c-1.27 2.64-2.56 5.27-3.83 7.9-1.53 3.15-3.06 6.31-4.58 9.47-.87 1.81-1.76 3.62-2.54 5.47.04.02.07.04.11.07.05.05.1.09.15.14.05-.73.27-1.48.71-2.24ZM289.92 103.23s-.04.01-.05.03c0-.02.04-.03.05-.04.05-.05.11-.1.16-.15l.21-.21c-.55 0-1.5-.27-2.55-.72.4.26.8.51 1.22.74.24.13.48.26.73.37.05.02.1.03.14.05a.27.27 0 0 1 .08-.07h.01ZM269.23 68.49c-.39-.19-.82-.48-1.33-.87-3.06-1.56-6.31-2.78-9.36-2.35-3.5.49-5.7 1.11-7.74 2.44 5.71-2.6 12.82-2.07 18.44.79l-.01-.01ZM177.87 53.69l1.06.03c-.96-.22-2-.25-2.89-.3-4.95-.26-9.99.33-14.86 1.19-2.44.43-4.88.95-7.28 1.59 9.09-1.76 15.69-2.77 23.97-2.51ZM219.85 55.51c-.18.12-.36.27-.56.45-.45.53-.86 1.11-1.26 1.66-1.91 2.61-3.71 5.31-5.57 7.95l-.12.18 8.05-10.11c-.18-.05-.36-.1-.55-.13h.01ZM510.71 54.1c.12-.15.29-.3.53-.45.69-.4 3.72-.63 5.87-.74-.36-.02-.73-.04-1.09-.05-1.84-.03-3.67.09-5.49.35.05.3.12.59.18.88v.01ZM510.76 86.02c1.37-3.07 2.49-6.27 3.57-9.46.55-1.64 1.12-3.3 1.6-4.97-1.59 4.01-3.67 9.14-6.2 15.3.24-.08.5-.14.74-.22.1-.22.19-.44.29-.65ZM566.95 75.76c.11-.02.23.03.31.11-.05-.13-.09-.26-.14-.39-.05.09-.11.18-.17.28ZM511.33 86.41c3.08-.89 6.24-1.62 9.46-2.14-1.51-3.98-2.98-7.96-4.39-11.87-.05.15-.09.31-.14.46-1.02 3.32-2.15 6.61-3.39 9.85-.48 1.25-.98 2.49-1.53 3.7h-.01ZM578.24 74.45c.11-.44.23-.87.35-1.31-.31.7-.64 1.39-.97 2.08.09.21.19.4.28.61.12-.46.23-.92.35-1.38h-.01ZM520.62 53.11c-.09 0-.18-.01-.28-.02.38.34.29 1.08.93 2.53l6.65 17.15c2.2 5.68 4.69 11.36 7.41 16.87l1.06 2.17c-2.95-7.05-5.92-14.08-8.87-21.13-1.58-3.79-3.16-7.59-4.7-11.4-.78-1.92-1.73-3.89-2.25-5.91-.03-.1 0-.19.04-.26h.01ZM578.78 77.87c1.45-5.77 3.07-10.43 3.58-13.36.05-.34.16-.88.31-1.55-.67 1.79-1.37 3.56-2.08 5.33-.12.43-.23.86-.35 1.29-.65 2.43-1.29 4.86-1.9 7.3.14.33.29.65.43 1l.01-.01ZM545.3 94.66c.02-.44.03-.83.05-1.12.02-1.01.05-2.02.11-3.02.03-6.66-.46-14.33-1.46-22.8-.13-.42-.27-1.24-.56-2.89 0-.02 0-.04-.01-.06.62 6.61.95 13.25 1.32 19.87.17 3.08.33 6.16.52 9.23.02.25.03.52.04.78l-.01.01ZM580.77 102.81c.13.2.27.38.37.49.27-.11.53-.22.8-.32-.43.09-.82.05-1.17-.16v-.01ZM530.48 104.07h.33c-.36-.13-.71-.32-1.04-.56.14.24.3.47.45.7.06-.08.14-.13.26-.13v-.01ZM542.63 58.82c.06.23.11.47.15.71.14-.33.36-.62.7-.86-.28.05-.57.11-.85.15ZM583.81 57.87c.15-.7.29-1.41.42-2.11-.14.45-.28.9-.42 1.34-.46 1.44-.89 2.89-1.31 4.34.44-1.19.88-2.37 1.31-3.57ZM523.62 91.48c-4.66 1.17-9.05 2.89-14.02 5.27 4.65-1.84 9.48-3.29 14.28-4.63-.09-.22-.17-.41-.26-.64ZM460.64 78.3c-.04-2.9-.11-5.81-.28-8.71-.1-1.68-.17-3.43-.5-5.09-.07.02-.14.03-.2.05.3 6.54.45 12.17.51 17.12.17-.07.34-.14.51-.2 0-1.06-.01-2.11-.03-3.17h-.01ZM470.63 63.24c-3.38-.26-6.81.32-10.1 1.1.41 2.01.47 4.14.57 6.18.18 3.55.25 7.11.27 10.67 3.31-1.38 6.5-3.12 9.3-5.35 1.96-1.56 3.86-3.41 5.02-5.66.73-1.41 1.19-3.22.26-4.65-1.09-1.7-3.46-2.14-5.32-2.29ZM460.29 63.68c1-.24 2.01-.46 3.04-.65-1.15.16-2.37.38-3.71.69v.13c.07-.02.15-.04.22-.05.11-.13.3-.18.45-.11v-.01ZM457.24 100.96c.43-.03.86-.07 1.29-.11.14-.49.27-.99.38-1.49-.44.7-1 1.23-1.67 1.6ZM482.88 104.98c-.18.23-.36.38-.55.47.14.09.27.19.4.28a70.76 70.76 0 0 0 4.37-4.63c.76-.89 1.52-1.81 2.19-2.77-.3-.27-.61-.53-.92-.79-.07 1.94-4.62 6.32-5.49 7.45v-.01Z",transform:"translate(-144.023 -51.76)"}),f.jsx("path",{d:"M474.36 63.31c-.4-.16-.84-.27-1.29-.37 1.56.42 3.08 1.22 3.76 2.74.62 1.4.32 2.95-.28 4.32.7-1.22.94-2.34.74-3.47-.24-1.33-1.19-2.54-2.93-3.21v-.01ZM477.34 89.18c-1.2-.81-2.4-1.62-3.6-2.42-.14.1-.26.19-.4.29 1.4.67 2.73 1.39 4 2.13ZM465.88 93.85c.37.25.74.5 1.1.75.46.32.92.65 1.38.97-1.57-1.2-2.01-1.61-2.49-1.72h.01ZM574.92 90.06c-2.28-5.21-4.93-11.13-5.67-12.26-.1-.15-1.57-3.01-1.63-3.08 0 0-.01.02-.02.02.4 1.37 1.09 2.69 1.65 3.99 2.14 4.95 4.36 9.86 6.67 14.73.6 1.26 1.21 2.52 1.83 3.78-.75-2.01-1.64-4.45-2.83-7.18ZM448.73 65.29c.1.2.22.38.34.57.22-.02.43-.06.65-.08v-.08c-.14-.05-.25 0-.99-.41ZM460.16 94.81c-.02.31-.06.59-.1.89-.03 1.71-.33 3.43-.79 5.07.15-.02.3-.03.45-.05.01-.04.02-.08.03-.11.09-.34.15-.69.2-1.03.17-1.07.25-2.16.33-3.24.05-.69.08-1.39.12-2.08-.27.1-.27.26-.24.57v-.02Z",transform:"translate(-144.023 -51.76)"}),f.jsx("path",{d:"m328.67 98.12-3.22-6.58c-1.29-2.63-2.53-5.29-3.72-7.97-.25-.85-.52-1.69-.79-2.53-.81-2.57-1.67-5.12-2.55-7.67-1.92-5.53-3.9-11.08-6.32-16.41-.72-1.58-1.46-3.44-2.63-4.79-.03-.17-.16-.29-.34-.36a.282.282 0 0 0-.23-.04c-.06-.01-.12 0-.18.01-.74.06-1.5.38-2.19.61-2.22.77-4.4 1.64-6.63 2.38-.03-.08-.06-.16-.09-.25-.15-.42-.82-.24-.67.19.03.09.07.19.1.28l-.18.06c-.36.11-.28.6 0 .68.18 1.18.63 2.36.98 3.49.03.09.06.17.08.26-.08.23-.17.46-.24.64-.37.98-.79 1.94-1.21 2.9-1.27 2.89-2.62 5.75-3.98 8.6-3.18 6.67-6.44 13.31-9.64 19.97-1.08 2.25-2.2 4.5-3.15 6.81-.13.32.24.5.5.37 1.34 1.33 2.84 2.5 4.4 3.57.65.44 1.31.87 2.01 1.24.4.22.86.48 1.33.5.24.01.35-.19.33-.37.11-.1.21-.21.28-.28.41-.41.81-.84 1.2-1.26.85-.92 1.69-1.87 2.5-2.84 6.31-2.34 12.6-4.31 18.71-5.84 2.14 5.3 3.43 8.43 3.97 9.58.55 1.05 1.15 1.88 1.82 2.52 1.32.56 6.96-.03 9.23-1.96.87-1.28 1.19-2.67.93-4.15-.09-.5-.22-.95-.4-1.33l-.01-.03Zm-20.09-45.61c.43.77.83 1.56 1.21 2.35-.54-.45-1.27-.99-2.07-1.49-.42-.24-.6-.35-.94-.34.43-.15.85-.29 1.29-.41.17-.05.34-.08.51-.11Zm-25.86 45.66c.78-1.85 1.67-3.66 2.54-5.47 1.51-3.16 3.05-6.31 4.58-9.47 1.28-2.63 2.56-5.26 3.83-7.9l-1.1 2.66c-1.99 4.79-4.97 10.9-8.88 18.15-.43.76-.66 1.51-.71 2.24-.05-.05-.1-.09-.15-.14a.259.259 0 0 0-.11-.07Zm6.24 4.71c-.42-.23-.82-.48-1.22-.74 1.05.45 2 .72 2.55.72l-.21.21c-.05.05-.11.1-.16.15-.01.01-.04.03-.05.04 0-.02.03-.02.05-.03a.27.27 0 0 0-.08.07c-.05-.02-.1-.03-.14-.05-.25-.1-.49-.24-.73-.37h-.01Zm15.73-29.43c1.05 3.15 2.1 6.31 3.1 9.48.34 1.06.69 2.13 1.01 3.21-3.5.63-6.95 1.46-10.27 2.5 2.48-6.03 4.54-11.11 6.16-15.19Zm4.79 12.57c-.23-.79-.49-1.58-.73-2.36-.79-2.54-1.63-5.08-2.46-7.61l-1.2-3.6c.02-.04.04-.09.05-.13 1.6 4.45 3.28 9 5.01 13.57l-.67.12v.01Zm5.83-18.27-.15-.54c-.49-1.64-1.03-3.28-1.6-4.9.23.58.47 1.17.7 1.75 1.56 4.03 3.01 8.1 4.39 12.2-.33-.82-.67-1.64-.98-2.46l-2.35-6.05h-.01ZM390.43 79.37c-.13-10.43-.22-17.5-.24-19.97-.24-1.6.21-2.88-.65-3.65-.14-.13-.32-.23-.52-.32h.03c.45 0 .45-.69 0-.7-1.75-.03-3.5-.04-5.25-.14-1.38-.08-2.76-.21-4.15-.31-.07 0-.12.01-.17.04-.21-.07-.47.03-.45.31l.03.45c-.11.14-.19.3-.22.5-.21 1.26-.32 13.67-.36 23.59-.32 5.79-.67 11.57-.97 17.36-.09 1.73-.29 3.54-.21 5.3-.39.02-.38.64.04.69v.12c.05.44.74.45.7 0v-.06c1.1.09 2.2.21 3.3.3 1.14.19 2.44.2 3.29.17 1.73-.05 2.92-.05 3.8-.37.45-.05.9-.11 1.35-.17.44-.06.25-.73-.19-.67h-.01c.24-.32.45-.72.62-1.25.66-1.84.41-6.36.34-11.33l-.13-9.9.02.01Zm-12.26 18.17c.09-1.91.2-3.81.31-5.71.06 5.38 0 6.14-.01 6.51-.05 1.65-.21 2.81.72 3.66-.39-.04-.78-.07-1.17-.1-.06-1.44.09-2.93.16-4.35l-.01-.01ZM588.97 53.85c-2.06-.25-3.17-.51-3.76-.6a.3.3 0 0 1 .04-.08c.22-.39-.39-.75-.6-.35-.56 1.02-.9 2.19-1.26 3.29-.61 1.88-1.17 3.78-1.72 5.68-.63 2.19-1.24 4.39-1.83 6.59-.81 2.03-1.67 4.05-2.61 6.03-1.7-3.64-3.11-6.04-4.03-7.57-2.26-3.74-2.85-5.48-3.57-6.08l.31-.09c.43-.12.25-.8-.19-.67-1.06.3-2.12.6-3.17.95-.93.32-1.85.69-2.76 1.07-.13.05-.19.16-.22.27-.04.02-.08.05-.11.07-.04-.06-.07-.12-.11-.18a.354.354 0 0 0-.48-.12c-.16.09-.22.32-.13.48l.33.54c0 .09.02.18.06.28.51 1.16.78 1.38.72 1.47-2.42 3.44-5.41 7.86-6.2 9.1-1.27 1.97-2.01 3.14-2.45 3.84l-.91-6.56-.43-4.1c-.19-1.85-.37-3.23-.53-4.13-.19-1.1-.3-2.15-.45-3.16-.2-1.36-.29-2.06-.47-2.42h.04c.45.02.45-.68 0-.7-3.43-.16-6.81.94-10.17 1.48-.24-.22-.73-.04-.58.32.24.59.33 1.25.43 1.87.17 1.06.29 2.13.4 3.2.32 3.09.53 6.2.74 9.3.44 6.75.77 13.51 1.17 20.26.11 1.95.13 3.96.46 5.89.05.3.37.31.55.14.74 1.71 2.87 1.27 6.13 1.27 1.34 0 2.39.04 2.99-.11.02.32.48.53.63.18 3.61-8.26 7.41-16.46 12.05-24.2.03-.05.04-.1.05-.15.3.73.64 1.45.94 2.16.97 2.26 1.97 4.52 2.98 6.76 2.26 5.03 4.54 10.07 7.09 14.96.47.9.94 1.79 1.47 2.65.2.32.4.67.66.96-.18.25 0 .68.34.54.91-.38 1.82-.75 2.76-1.07 1.04-.35 2.11-.65 3.17-.95.39-.11.28-.66-.07-.68.62-.4.95-.96.87-1.91-.3-3.34.72-7.47.86-8.52l2.14-11.43c1.75-10.74 3.13-17.51 3.23-20.86.02-.49.08-2.84.13-3.24.17-1.25.48-1-4.96-1.65l.03-.02Zm-46.19 5.67c-.04-.24-.09-.48-.15-.71l.85-.15c-.34.24-.56.53-.7.86Zm1.95 25.12c-.36-6.63-.7-13.26-1.32-19.87 0 .02 0 .04.01.06.29 1.65.44 2.47.56 2.89 1 8.46 1.5 16.14 1.46 22.8-.06.99-.1 2-.11 3.02-.01.29-.03.68-.05 1.12-.01-.26-.03-.53-.04-.78-.19-3.08-.35-6.16-.52-9.23l.01-.01Zm36.4 18.66c-.11-.11-.24-.29-.37-.49.35.21.74.26 1.17.16-.27.11-.53.22-.8.32v.01Zm-.89-33.72c.12-.43.23-.86.35-1.29.71-1.77 1.41-3.55 2.08-5.33-.15.68-.26 1.22-.31 1.55-.5 2.94-2.13 7.59-3.58 13.36-.15-.35-.29-.66-.43-1 .61-2.44 1.25-4.87 1.9-7.3l-.01.01Zm3.56-12.48c.14-.44.28-.89.42-1.34-.13.7-.27 1.41-.42 2.11-.43 1.19-.86 2.38-1.31 3.57.42-1.45.85-2.9 1.31-4.34Zm-5.22 16.05c-.11.44-.23.87-.35 1.31-.12.46-.23.92-.35 1.38-.1-.22-.19-.4-.28-.61.34-.69.66-1.38.97-2.08h.01Zm-11.64 2.62c.06-.1.12-.19.17-.28.05.13.09.26.14.39a.398.398 0 0 0-.31-.11Zm2.3 2.98c-.56-1.3-1.25-2.63-1.65-3.99 0 0 .01-.02.02-.02.06.08 1.52 2.93 1.63 3.08.73 1.13 3.38 7.04 5.67 12.26 1.2 2.73 2.08 5.17 2.83 7.18-.62-1.25-1.23-2.51-1.83-3.78-2.31-4.87-4.53-9.78-6.67-14.73ZM275.92 87.03c-1.06-2.18-1.13-3.45-2.44-2.93-1.52.57-2.94 1.3-4.5 2.1-1.4.72-2.68 1.44-3.92 2.12.01-.25-.24-.5-.51-.34-4.8 2.93-12.41 4.7-17.28 1.31-1.98-1.77-3.32-4.15-3.97-5.78-.29-.95-.49-1.94-.63-2.93-.14-3.34 1.58-6.53 3.9-9.12.8-.79 1.68-1.51 2.66-2.12 3.7-2.3 8.22-3.07 12.51-2.51 2.71.35 5.32 1.24 7.71 2.55.39.22.75-.39.35-.6-.18-.1-.37-.18-.55-.27.56.27 1.03.33 1.51.19l-.48.39c-.15.11-.23.3-.13.48.09.15.33.24.48.13 1.3-.97 2.46-2.09 3.45-3.37.37-.29.64-.6.65-.97v-.02c.08-.33-.03-.7-.21-1.08-.31-.87-.98-2.01-2.19-3.26-2.43-2.52-3.79-3.45-5.68-4.26-1.14-.49-3.12-1.06-4.42-1.23-3.28-.42-10.64-1.21-18.18 4.11-7.74 5.46-11.94 12.3-12.23 20.61-.08 2.06.04 3.98.34 5.71.74 4.18 2.57 8 5.44 11.34 4.26 4.99 9.76 7.52 16.34 7.52 4.85 0 9.69-1.77 14.89-4.62.23-.12.45-.23.68-.35 2.19-1.1 4.37-2.23 6.46-3.5.49-.3 1.03-.61 1.5-.98 1.47-.87 1.11-1.12.49-2.95-.39-1.14-.76-2.7-2.06-5.36l.02-.01Zm-17.38-21.76c3.05-.42 6.31.79 9.36 2.35.51.39.94.68 1.33.87-5.61-2.86-12.72-3.39-18.44-.79 2.05-1.33 4.24-1.95 7.74-2.44l.01.01ZM443.67 72.67c-.4-2.2-1.15-4.33-2.37-6.22-1.49-2.32-3.58-4.19-5.91-5.64-6.17-3.81-13.75-5.11-20.83-6.01-3.23-.41-6.47-.69-9.72-.92l-1.39-.12c-.85-.07-1.52-.1-2.05-.1-1.08-.06-2.17-.12-3.25-.17-.08 0-.14.02-.19.05-.1.05-.18.14-.16.3.27 2.55-.01 5.12-.92 7.52-.15.38.4.56.62.28 1.32.59 2.68 1.05 4.08 1.37 0 2.78-.14 7.58-.33 12.91 0 0 0 .02-.01.03-.61 3.66-.79 7.42-1 11.12-.23 4.01-.43 8.03-.44 12.05 0 .64 0 1.28.03 1.93.02.31 0 .68.15.96.06.11.14.16.24.17-.2.17-.21.54.11.59 3.83.67 7.78.71 11.68.25 2.3-.19 4.87-.65 7.65-1.56 1.85-.54 3.67-1.18 5.43-1.91 7.2-3.02 14.31-8.07 17.35-15.53.76-1.86 1.17-3.8 1.31-5.75.3-1.93.28-3.82-.09-5.58l.01-.02Zm-19.32-15.42c5.74 1.41 11.94 3.68 15.65 8.55.25.32.47.65.69.99-2.3-2.82-5.68-5.69-12.88-8.23-2.16-.76-4.35-1.43-6.64-2.02 1.06.21 2.13.45 3.18.71Zm-25.82-3.04c.13 0 .27.01.4.02-.14.1-.26.23-.37.38 0-.13-.02-.26-.03-.4Zm34.82 22.17c-.75 3.09-3.55 5.66-5.88 7.58-3.35 2.76-7.21 5.03-11.28 6.54-1.33.49-2.71.9-4.12 1.15.06-1.38.08-2.76.07-4.13-.02-3.78-.16-7.56-.41-11.33-.09-1.37-.18-2.74-.37-4.1 0-.06-.03-.11-.06-.15.09-3.25.12-6.16.03-8.12 6.86 1.05 10.56 2.17 14.06 3.62 5.52 2.28 8.59 5.44 7.97 8.96l-.01-.02Zm-22 16.15c-.12 0-.23-.02-.34-.03l.34-.03v.06Zm-.69-.7c0-3.13.26-8.84.47-14.51.06 1.2.11 2.41.15 3.6.15 3.6.25 7.23.09 10.83-.24.03-.48.05-.71.07v.01Zm-12.33-30.94c.37.63 2.01 1.01 3.23 1.25v.15c-1.31-.31-2.59-.73-3.83-1.29.12-.36.23-.72.33-1.09.08.48.18.84.27.98Zm13.7 31.65v-.18c3.41-.56 6.71-2.02 9.69-3.68 2.31-1.28 4.59-2.78 6.63-4.53-4.69 4.53-11.61 8.24-16.33 8.38l.01.01Zm24.07-.75c-2.05 1.93-4.37 3.56-6.83 4.95 2.7-1.78 5.52-4.03 8.42-6.87.82-.82 1.56-1.69 2.23-2.59-1.08 1.65-2.38 3.16-3.81 4.51h-.01ZM187.16 92.14c-.79-2.47-2.1-7.12-3.1-6.87-.19-.01-2.09.77-4.08 1.54-3.06 1.18-5.91 2.13-10.09 2.82-2.74.42-5.87 1.01-10.61 1.06.04-3.34.05-6.01.05-7.99 7.97-.65 12.33-2.11 16.37-3.55 1.11-.39 2.69-1.01 2.63-1.8-.08-.35-.55-1.39-1.17-2.61-.47-1.16-.98-2.31-1.61-3.38-.42-.71-1.04-1.69-1.86-2.06-.11-.08-.22-.13-.29-.12-.02 0-.04 0-.07.01-.19-.04-.39-.05-.6-.01-.17.03-.24.15-.25.28-.04.02-.09.04-.14.05-4.33 1.48-8.85 2.33-13.24 3.61a499.1 499.1 0 0 0-.31-8.19c4.51-.99 8.88-1.38 13.11-1.82 3.68-.38 6.28.12 7.47.34.59.11.9.16 1.16.18h.1c-.1.37.44.66.62.28.02-.04.03-.08.05-.13.15.2.53.22.62-.1.17-.58.19-1.21.21-1.81v-.36c.03-.15.05-.3.07-.45.52-2.47.33-5.09-.64-7.44-.11-.27-.44-.28-.6-.14-.08-.21-.15-.42-.24-.62-.19-.41-.79-.05-.6.35.03.07.05.15.09.22-.98-.42-2.15-.54-3.17-.63-2.17-.19-4.37-.14-6.54 0-5.7.35-11.4 1.3-16.91 2.79-2.08.56-4.13 1.22-6.14 2-4.54 1.05-3.79 1.51-2.17 6.07.18.51.46 1.68.54 1.94.82 2.47 1.08 2.13 3.1 2.13s0 .05 0 .08h.52c-.48 2.66-.51 5.45-.62 8.13-.15 3.48-.22 6.96-.28 10.45 0 .41-.01.82-.02 1.23-.16.29-.33.57-.51.85-.05.38-.09.77-.14 1.18-.42 3.52-.59 6.48-.52 8.8v.34c.02.47.05.76.06.87.16 1.57-.26 3.47 1.35 3.79 1.61.32 3.5.55 4.85.55.11 0 .22-.02.33-.02 1.79.24 3.67.05 5.45-.12 2.85-.28 5.69-.7 8.51-1.19 3.03-.53 6.05-1.14 9.04-1.86 2.4-.58 4.82-1.19 7.13-2.06.51-.19 1.73-.57 2.46-1.14 1.81-.68 2.18-1 1.57-2.67-.23-.62-.48-1.49-.91-2.78l-.03-.02Zm-11.12-38.71c.89.05 1.93.08 2.89.3-.33 0-.68-.02-1.06-.03-8.28-.26-14.88.75-23.97 2.51 2.41-.64 4.85-1.16 7.28-1.59 4.87-.86 9.91-1.45 14.86-1.19Zm-26.53 22.13c.03 1.71.04 3.43 0 5.14-.04 1.27-.11 2.55-.24 3.82 0-.73.02-1.46.04-2.19.05-2.26.12-4.51.22-6.77h-.02Zm6.73 27.85c.2-.1.4-.21.58-.33 1.82-.17 3.82-.24 5.94-.34-.86.11-1.72.24-2.58.33-1.27.14-2.61.31-3.93.34h-.01ZM534.48 85.44c-3.52-8.38-7.07-16.75-10.5-25.17-.63-1.54-1.25-3.09-1.86-4.65-.31-.8-.65-1.6-.87-2.43-.04-.17-.17-.24-.31-.25.1-.2 0-.51-.29-.53-1.59-.08-3.18-.22-4.78-.25-1.96-.03-3.91.13-5.84.42-.31.05-.31.38-.13.56-.03.06-.05.14-.04.22.23 1.54.63 3.06 1.16 4.53.13.35.27.7.41 1.06l-2.68 6.18c-.11.03-.2.09-.25.22-.67 1.9-1.52 3.73-2.34 5.56a536.85 536.85 0 0 1-3.9 8.45c-2.64 5.64-5.34 11.25-7.91 16.93-.44.97-.88 1.94-1.29 2.93-.2.48-.47 1-.55 1.52v.05c-.02.12.02.26.16.34 1.19.73 2.41 1.41 3.66 2.05 1.2.62 2.45 1.25 3.76 1.61.43.12.62-.55.19-.67-1.13-.31-2.2-.83-3.24-1.36 1.09.36 2.1.69 2.75.93 2.82 1.01 2.38 1.1 4.3-3.75 2.1-1.09 4.34-1.96 6.53-2.79 4.35-1.64 8.8-3.03 13.27-4.29.82 2.01 1.77 3.97 2.72 5.92.35.83.62 1.45.79 1.82.22.42.45.8.69 1.15.17.33.33.67.5 1 .42.8.84 1.63 1.4 2.35.23.29.6 0 .55-.31 1.53-.02 3.06-.07 4.58-.27.92-.12 1.82-.32 2.71-.54 1.39-.27 3.85-1.11 3.74-1.42-.67-1.96-1.55-3.87-2.34-5.78-1.57-3.78-3.16-7.56-4.75-11.33v-.01Zm-11.65-26.16c1.54 3.81 3.12 7.6 4.7 11.4 2.94 7.05 5.91 14.09 8.87 21.13l-1.06-2.17c-2.71-5.51-5.2-11.19-7.41-16.87l-6.65-17.15c-.65-1.45-.55-2.19-.93-2.53.09 0 .18.01.28.02a.29.29 0 0 0-.04.26c.52 2.02 1.47 3.98 2.25 5.91h-.01Zm-6.58 13.58c.05-.15.09-.31.14-.46 1.41 3.92 2.88 7.9 4.39 11.87-3.22.52-6.38 1.25-9.46 2.14.55-1.22 1.05-2.46 1.53-3.7 1.24-3.24 2.37-6.53 3.39-9.85h.01Zm-.23-20c.36 0 .73.03 1.09.05-2.15.1-5.18.33-5.87.74-.24.15-.41.3-.53.45-.06-.29-.13-.58-.18-.88 1.82-.26 3.65-.39 5.49-.35v-.01Zm-.09 18.72c-.49 1.67-1.05 3.33-1.6 4.97-1.07 3.19-2.19 6.38-3.57 9.46-.09.21-.19.43-.29.65-.25.07-.5.14-.74.22 2.53-6.16 4.61-11.29 6.2-15.3Zm-6.34 25.16c4.97-2.38 9.37-4.1 14.02-5.27l.26.64c-4.8 1.35-9.63 2.8-14.28 4.63Zm20.17 6.76c.33.23.68.42 1.04.56h-.33c-.12 0-.21.06-.26.13-.15-.23-.31-.45-.45-.7v.01ZM226.57 91.75c-3.55-4.74-6.68-9.11-9.31-12.99 9.2-15.25 10.05-17.81 10.35-18.38.17-.34 1.09-2.27.64-2.53-1.13-.65-1.03-.65-2.97-1.71-1.19-.65-3.04-1.61-4.53-2.12-1.71-.59-1.24-.36-3 2.77-.06.1-.11.2-.17.3-.75 1.02-1.48 2.05-2.2 3.09-1.88 2.71-3.73 5.45-5.69 8.1-3.68-4.91-6.88-8.76-9.51-11.43-.15-.15-.3-.29-.46-.42-1.27-1.28-7.24 3.53-7.93 5.58-.09.09-.19.16-.28.25-.27.26.03.64.33.58.19.65.5 1.29.94 1.91 3.85 5.06 7.19 9.76 9.94 14-1.23 2.61-3.06 5-4.67 7.38l-2.28 3.33c-.5.66-.93 1.23-1.29 1.69-.67.93-2.09 2.61-2.3 3.87-.51.85-1.16 1.84-1.29 2.83-.06.44.61.63.67.19.01-.08.04-.15.06-.22 1.36 1.08 2.76 2.11 4.19 3.11 1.3.91 2.62 1.85 4.04 2.56.21.1.4 0 .48-.17.24.07.48.14.72.2.44.1.62-.57.19-.67-2.02-.48-3.77-1.57-5.23-3.02-.47-.46-.9-.96-1.32-1.46 1.74 1.35 4.2 2.89 5.89 4.14 1.39 1.03 2.85-2.27 4.22-4.2 1.86-2.64 3.96-5.86 5.52-8.29l10.39 14.51c.67.81 1.14 1.21 1.57 1.36-.05.24.12.51.41.4 1.53-.58 3.05-1.19 4.54-1.87 1.52-.69 3.06-1.45 4.36-2.5a.28.28 0 0 0 .12-.23c1.66-1.1.81-1.74-1.41-4.91-1.13-1.58-1.71-2.36-3.7-5.01l-.03-.02Zm2.41 6.54c.56 1.15 1.19 2.52 1.11 3.81-.06.04-.12.07-.17.1-.03-.88-.55-2.66-.94-3.91Zm-16.51-32.73c1.86-2.65 3.65-5.35 5.57-7.95.4-.55.81-1.13 1.26-1.66.19-.18.38-.33.56-.45.18.03.36.08.55.13l-8.05 10.11.12-.18h-.01ZM192.7 95.48c.79-1.37 1.66-2.69 2.54-4 1.19-1.79 2.4-3.56 3.61-5.33-.04.09-.09.17-.13.26-.1.22.03.41.2.49-2.47 3.42-4.89 6.73-6.4 9.28.21.24.4.48.63.75-.24.07-.4.36-.17.56.4.33.72.77 1.05 1.17.09.11.18.21.27.32-.84-.61-1.66-1.24-2.47-1.88.24-.57.58-1.11.87-1.61v-.01Zm7.46-10.32c.47-.81.98-1.59 1.49-2.37.31-.48.64-.95.96-1.43.26-.29.52-.56.75-.79-.99 1.48-2.09 3.03-3.2 4.59Zm10.03-16.22s-.03-.05-.05-.07c.22-.29.43-.59.64-.89-.2.32-.4.65-.58.96h-.01ZM371.54 87.96c-.01-.08-.01-.16-.03-.23-.06-.38-.58-.29-.66.03-.3-.05-.6-.08-.81-.11-1.14-.15-2.29-.19-3.44-.2 1.04-.09 2.09-.18 3.14-.23.45-.02.45-.72 0-.7-6.57.35-13.14 1.23-19.65 2.11-1.53.21-3.05.42-4.57.68-.01 0-.02.01-.04.01-.04-3.33-.13-6.66-.24-9.99-.19-5.7-.4-11.41-.88-17.1-.13-1.51-.23-3.07-.49-4.58 0-.25 0-.48-.02-.68-.06-1.19-.04-2.61-.68-2.78-.16-.07-.72-.16-1.5-.24.22-.17.16-.62-.2-.63-1.19-.04-2.39.09-3.57.23-1.2.14-2.41.32-3.59.6-.16-.1-.41-.06-.5.12-.06.02-.13.03-.19.05-.35.1-.29.55-.03.66-.26.6-.19 2.27-.21 3-.02.66-.66 33.73-.9 40.3-.03.65.06 1.12.04 1.45-.16 3.05.87 4.96 6.34 3.93 1.09-.08 2.75-.77 5.36-1.43 4.13-1.04 5.78-1.52 6.2-1.65 6.43-1.69 6.78-1.97 11.72-2.43.55-.05 4.8-.38 6.03-.3.64.04 1.19.07 1.65.1.09 0 .16-.03.24-.05.1.27.56.33.66-.02.39-1.32.61-2.71.78-4.08.2-1.61.29-3.24.15-4.86.24.03.52-.23.38-.53-.09-.2-.27-.33-.49-.43v-.02Zm-.63.56c.07.57.11 1.14.11 1.71-.21-.99-.53-1.71-.95-1.87.22.03.44.06.65.11.06.01.12.04.19.05Zm-25.41 1.73c1.54-.36 3.1-.64 4.66-.89-1.61.37-3.18.77-4.66 1.2v-.31Zm-.86-7.37c-.07-1.37-.16-2.75-.25-4.12-.21-3.13-.45-6.27-.79-9.4.02-2.25.08-4.31.13-6.11.16 2.08.29 4.16.4 6.24.23 4.46.38 8.93.5 13.39h.01Zm-.94-4c.16 2.41.29 4.83.39 7.24.06 1.6.14 3.22.09 4.83-.15.05-.32.09-.47.14V78.88h-.01ZM483.72 92.83c-3.05-2.28-6.22-4.4-9.38-6.51 8.86-6.49 13.49-12.95 13.73-19.23.04-.76 0-1.5-.13-2.2-.67-3.82-3.5-6.68-8.39-8.48.13.04.27.08.4.13 3.92 1.39 7.74 4.23 8.5 8.56.34 1.95-.05 3.96-.98 5.69-.21.4.39.75.6.35 1.86-3.46 1.46-7.55-.97-10.63-3.53-4.47-9.76-5.88-15.16-6.16-2.32-.12-4.64-.04-6.95.19-6 .32-12.71 1.68-17.63 3.21-.37.11-.67.23-.92.35-.2-.17-.62.02-.57.37v.03c-.64.68-.18 1.64.48 3.21.38.91.67 1.89 1.15 2.58.32.76.68 1.51 1.13 2.19.14.21.38.19.53.07.19-.02.38-.05.57-.08v1.57c-.06.06-.1.13-.11.23-.27 4.18-.34 8.38-.48 12.57l-.3 9.03c-.24 3.91-.44 6.77-.46 7.26-.05.88-.11 1.95.07 2.81-.01.22-.02.43-.04.65 0 .11-.02.23-.03.35 0 .05-.03.27-.01.16-.05.4.5.59.64.28.05.04.12.08.2.08 1.75.13 3.5.28 5.25.3 1.69.02 3.38-.12 5.06-.32.08.23.36.39.55.15.06-.08.11-.17.16-.26.18-.09.24-.32.18-.48.05-.2.1-.4.13-.6.16-.86.25-1.74.33-2.62.11-1.17.17-2.34.23-3.51.15-.01.32-.03.52-.04.36-.03 1.73-.15 2.06-.15.39 0 .7-.02.95-.04 1.76 1.11 3.45 2.35 5.14 3.55 2.83 2.01 5.64 4.04 8.47 6.04 1.42 1 2.85 2 4.29 2.97.1.06.19.07.27.04.08 0 .17-.02.25-.1 1.61-1.56 3.15-3.18 4.6-4.88.75-.88 1.49-1.78 2.15-2.73.01.01.03.02.04.03.34.3.83-.2.49-.49-2.16-1.9-4.34-3.76-6.64-5.48l.03-.01Zm-6.38-3.65a55.72 55.72 0 0 0-4-2.13c.14-.1.26-.19.4-.29 1.2.81 2.4 1.61 3.6 2.42Zm-20.1 11.78c.67-.37 1.23-.91 1.67-1.6-.11.5-.24 1-.38 1.49-.43.04-.86.08-1.29.11Zm2.38-37.24c1.34-.31 2.56-.52 3.71-.69-1.03.19-2.04.41-3.04.65-.14-.07-.34-.02-.45.11-.07.02-.15.04-.22.05v-.13.01Zm.04.84c.07-.02.14-.03.2-.05.34 1.66.41 3.41.5 5.09.17 2.9.24 5.81.28 8.71l.03 3.17c-.17.07-.34.14-.51.2-.06-4.96-.21-10.58-.51-17.12h.01Zm16.04 5.62c-1.16 2.25-3.06 4.1-5.02 5.66-2.8 2.23-5.99 3.97-9.3 5.35-.01-3.56-.09-7.12-.27-10.67-.1-2.04-.16-4.16-.57-6.18 3.3-.78 6.72-1.36 10.1-1.1 1.85.14 4.23.59 5.32 2.29.92 1.43.46 3.24-.26 4.65Zm.85-.18c.6-1.37.9-2.92.28-4.32-.67-1.52-2.2-2.32-3.76-2.74.46.1.89.21 1.29.37 1.74.67 2.69 1.88 2.93 3.21.2 1.13-.05 2.25-.74 3.47V70Zm-27.47-4.14c-.12-.19-.23-.38-.34-.57.74.42.85.36.99.41v.08c-.22.03-.43.06-.65.08Zm11.21 30.46c-.08 1.08-.16 2.17-.33 3.24-.05.35-.11.69-.2 1.03 0 .04-.02.07-.03.11-.15.02-.3.04-.45.05.45-1.64.76-3.36.79-5.07.03-.29.08-.57.1-.89-.03-.31-.03-.47.24-.57-.04.69-.07 1.39-.12 2.08v.02Zm5.6-2.47c.48.11.92.52 2.49 1.72-.46-.32-.92-.65-1.38-.97-.37-.25-.73-.5-1.1-.75h-.01Zm21.23 7.24a70.76 70.76 0 0 1-4.37 4.63c-.14-.09-.27-.19-.4-.28.19-.09.37-.24.55-.47.87-1.14 5.43-5.51 5.49-7.45.31.26.62.53.92.79-.67.97-1.42 1.88-2.19 2.77v.01Z",fill:"currentColor",transform:"translate(-144.023 -51.76)"})]}),qY=({style:e,size:t="small",withText:n})=>f.jsxs("div",{className:`ExcalidrawLogo is-${t}`,style:e,children:[f.jsx(ZY,{}),n&&f.jsx(KY,{})]}),PU=({icon:e,shortcut:t,children:n})=>{let a=Tt();return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"welcome-screen-menu-item__icon",children:e}),f.jsx("div",{className:"welcome-screen-menu-item__text",children:n}),t&&!a.editor.isMobile&&f.jsx("div",{className:"welcome-screen-menu-item__shortcut",children:t})]})};PU.displayName="WelcomeScreenMenuItemContent";var bc=({onSelect:e,children:t,icon:n,shortcut:a,className:i="",...r})=>f.jsx("button",{...r,type:"button",className:`welcome-screen-menu-item ${i}`,onClick:e,children:f.jsx(PU,{icon:n,shortcut:a,children:t})});bc.displayName="WelcomeScreenMenuItem";var _y=({children:e,href:t,icon:n,shortcut:a,className:i="",...r})=>f.jsx("a",{...r,className:`welcome-screen-menu-item ${i}`,href:t,target:"_blank",rel:"noreferrer",children:f.jsx(PU,{icon:n,shortcut:a,children:e})});_y.displayName="WelcomeScreenMenuItemLink";var xa=({children:e})=>{let{WelcomeScreenCenterTunnel:t}=un();return f.jsx(t.In,{children:f.jsx("div",{className:"welcome-screen-center",children:e||f.jsxs(f.Fragment,{children:[f.jsx(NU,{}),f.jsx(OU,{children:I("welcomeScreen.defaults.center_heading")}),f.jsxs($U,{children:[f.jsx(zU,{}),f.jsx(FU,{})]})]})})})};xa.displayName="Center";var NU=({children:e})=>f.jsx("div",{className:"welcome-screen-center__logo excalifont welcome-screen-decor",children:e||f.jsx(qY,{withText:!0})});NU.displayName="Logo";var OU=({children:e})=>f.jsx("div",{className:"welcome-screen-center__heading welcome-screen-decor excalifont",children:e});OU.displayName="Heading";var $U=({children:e})=>f.jsx("div",{className:"welcome-screen-menu",children:e});$U.displayName="Menu";var FU=()=>{let e=En();return f.jsx(bc,{onSelect:()=>e.executeAction(yU),shortcut:"?",icon:J0,children:I("helpDialog.title")})};FU.displayName="MenuItemHelp";var zU=()=>{let e=Yt(),t=En();return e.viewModeEnabled?null:f.jsx(bc,{onSelect:()=>t.executeAction(g0),shortcut:tn("loadScene"),icon:Q0,children:I("buttons.load")})};zU.displayName="MenuItemLoadScene";var jy=({onSelect:e})=>{let{t}=Gt();return f.jsx(bc,{shortcut:null,onSelect:e,icon:N8,children:t("labels.liveCollaboration")})};jy.displayName="MenuItemLiveCollaborationTrigger";xa.Logo=NU;xa.Heading=OU;xa.Menu=$U;xa.MenuItem=bc;xa.MenuItemLink=_y;xa.MenuItemHelp=FU;xa.MenuItemLoadScene=zU;xa.MenuItemLiveCollaborationTrigger=jy;var BU=({children:e})=>{let{WelcomeScreenMenuHintTunnel:t}=un();return f.jsx(t.In,{children:f.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--menu",children:[NM,f.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||I("welcomeScreen.defaults.menuHint")})]})})};BU.displayName="MenuHint";var HU=({children:e})=>{let{WelcomeScreenToolbarHintTunnel:t}=un();return f.jsx(t.In,{children:f.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar",children:[f.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||I("welcomeScreen.defaults.toolbarHint")}),$M]})})};HU.displayName="ToolbarHint";var XU=({children:e})=>{let{WelcomeScreenHelpHintTunnel:t}=un();return f.jsx(t.In,{children:f.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--help",children:[f.jsx("div",{children:e||I("welcomeScreen.defaults.helpHint")}),OM]})})};XU.displayName="HelpHint";var _f=e=>f.jsx(f.Fragment,{children:e.children||f.jsxs(f.Fragment,{children:[f.jsx(xa,{}),f.jsx(BU,{}),f.jsx(HU,{}),f.jsx(XU,{})]})});_f.displayName="WelcomeScreen";_f.Center=xa;_f.Hints={MenuHint:BU,ToolbarHint:HU,HelpHint:XU};var JY=_f,Ay=({isCollaborating:e,onSelect:t,...n})=>{let a=Yt(),i=a.width<830;return f.jsxs(sr,{...n,className:ne("collab-button",{active:e}),type:"button",onSelect:t,style:{position:"relative",width:i?void 0:"auto"},title:I("labels.liveCollaboration"),children:[i?lI:I("labels.share"),a.collaborators.size>0&&f.jsx("div",{className:"CollabButton-collaborators",children:a.collaborators.size})]})},QY=Ay;Ay.displayName="LiveCollaborationTrigger";var eZ=(e,t,n)=>{var a,i,r;return!!(t&&(t.id===((a=e.editingTextElement)==null?void 0:a.id)||t.id===((i=e.resizingElement)==null?void 0:i.id)||t.id===((r=e.newElement)==null?void 0:r.id)||t.version>n.version||t.version===n.version&&t.versionNonce<n.versionNonce))},tZ=Ko((e,t,n)=>{if(be.DEV||be.MODE===vn.TEST||window!=null&&window.DEBUG_FRACTIONAL_INDICES){let a=Va(e.map(i=>({...i})));mp(a,{shouldThrow:be.DEV||be.MODE===vn.TEST,includeBoundTextValidation:!0,reconciliationContext:{localElements:t,remoteElements:n}})}},1e3*60,{leading:!0,trailing:!1}),nZ=(e,t,n)=>{let a=ce(e),i=[],r=new Set;for(let l of t)if(!r.has(l.id)){let c=a.get(l.id),d=eZ(n,c,l);c&&d?(i.push(c),r.add(c.id)):(i.push(l),r.add(l.id))}for(let l of e)r.has(l.id)||(i.push(l),r.add(l.id));let s=e3(i);return tZ(s,e,t),Va(s),s},Ry=({children:e,icon:t})=>{let{TTDDialogTriggerTunnel:n}=un(),a=_t();return f.jsx(n.In,{children:f.jsxs(et.Item,{onSelect:()=>{Qe("ai","dialog open","ttd"),a({openDialog:{name:"ttd",tab:"text-to-diagram"}})},icon:t??tT,children:[e??I("labels.textToDiagram"),f.jsx(et.Item.Badge,{children:"AI"})]})})};Ry.displayName="TTDDialogTrigger";var aZ=e=>{let t=va();return M.useLayoutEffect(()=>{t.setPlugins({diagramToCode:{generate:e.generate}})},[t,e.generate]),null};GY();var iZ=e=>{var W,F,Y,Q;let{onChange:t,initialData:n,excalidrawAPI:a,isCollaborating:i=!1,onPointerUpdate:r,renderTopRightUI:s,langCode:l=ls.code,viewModeEnabled:c,zenModeEnabled:d,gridModeEnabled:o,libraryReturnUrl:u,theme:h,name:p,renderCustomStats:U,onPaste:m,detectScroll:g=!0,handleKeyboardGlobally:b=!1,onLibraryChange:v,autoFocus:x=!1,generateIdForFile:y,onLinkOpen:E,generateLinkForSelection:S,onPointerDown:w,onPointerUp:k,onScrollChange:T,onDuplicate:_,children:j,validateEmbeddable:A,renderEmbeddable:R,aiEnabled:N,showDeprecatedFonts:O}=e,$=(W=e.UIOptions)==null?void 0:W.canvasActions,P={...e.UIOptions,canvasActions:{...n2.canvasActions,...$},tools:{image:((Y=(F=e.UIOptions)==null?void 0:F.tools)==null?void 0:Y.image)??!0}};return $!=null&&$.export&&(P.canvasActions.export.saveFileToDisk=((Q=$.export)==null?void 0:Q.saveFileToDisk)??n2.canvasActions.export.saveFileToDisk),P.canvasActions.toggleTheme===null&&typeof h>"u"&&(P.canvasActions.toggleTheme=!0),M.useEffect(()=>{(async()=>await Promise.resolve().then(()=>require("./layers.JWCLFILJ.js")))();let le=ie=>{typeof ie.scale=="number"&&ie.scale!==1&&ie.preventDefault()};return document.addEventListener("touchmove",le,{passive:!1}),()=>{document.removeEventListener("touchmove",le)}},[]),f.jsx(XB,{store:sa,children:f.jsx(YB,{langCode:l,theme:h,children:f.jsx(WY,{onChange:t,initialData:n,excalidrawAPI:a,isCollaborating:i,onPointerUpdate:r,renderTopRightUI:s,langCode:l,viewModeEnabled:c,zenModeEnabled:d,gridModeEnabled:o,libraryReturnUrl:u,theme:h,name:p,renderCustomStats:U,UIOptions:P,onPaste:m,detectScroll:g,handleKeyboardGlobally:b,onLibraryChange:v,autoFocus:x,generateIdForFile:y,onLinkOpen:E,generateLinkForSelection:S,onPointerDown:w,onPointerUp:k,onScrollChange:T,onDuplicate:_,validateEmbeddable:A,renderEmbeddable:R,aiEnabled:N!==!1,showDeprecatedFonts:O,children:j})})})},rZ=(e,t)=>{if(e.children!==t.children)return!1;let{initialData:n,UIOptions:a={},...i}=e,{initialData:r,UIOptions:s={},...l}=t,c=Object.keys(a),d=Object.keys(s);return c.length!==d.length?!1:c.every(o=>o==="canvasActions"?Object.keys(a.canvasActions).every(u=>{var h,p,U,m;return u==="export"&&((h=a==null?void 0:a.canvasActions)!=null&&h.export)&&((p=s==null?void 0:s.canvasActions)!=null&&p.export)?a.canvasActions.export.saveFileToDisk===s.canvasActions.export.saveFileToDisk:((U=a==null?void 0:a.canvasActions)==null?void 0:U[u])===((m=s==null?void 0:s.canvasActions)==null?void 0:m[u])}):a[o]===s[o])&&Vt(i,l)},Ly=M.memo(iZ,rZ);Ly.displayName="Excalidraw";const sZ=Object.freeze(Object.defineProperty({__proto__:null,Button:sr,CaptureUpdateAction:X,DEFAULT_LASER_COLOR:t8,DefaultSidebar:k0,DiagramToCodePlugin:aZ,Excalidraw:Ly,FONT_FAMILY:it,Footer:YY,LiveCollaborationTrigger:QY,MIME_TYPES:ae,MainMenu:sn,ROUNDNESS:St,Sidebar:ea,Stats:If,THEME:ke,TTDDialog:gy,TTDDialogTrigger:Ry,UserIdleState:o8,WelcomeScreen:JY,bumpVersion:uc,convertToExcalidrawElements:Mu,defaultLang:ls,elementPartiallyOverlapsWithOrContainsBBox:j3,elementsOverlappingBBox:A3,exportToBlob:T3,exportToCanvas:cc,exportToClipboard:pN,exportToSvg:rf,getCommonBounds:$e,getDataURL:Z1,getFreeDrawSvgPath:sp,getLibraryItemsHash:wu,getNonDeletedElements:Ye,getSceneVersion:XN,getTextFromElements:H7,getVisibleSceneBounds:C7,hashElementsVersion:G3,hashString:Wp,isElementInsideBBox:H1,isElementLink:Os,isInvisiblySmallElement:Qr,isLinearElement:fe,languages:bf,loadFromBlob:Yp,loadLibraryFromBlob:e4,loadSceneOrLibraryFromBlob:Gp,mergeLibraryItems:lx,mutateElement:G,newElementWith:Ue,normalizeLink:yn,parseLibraryTokensFromUrl:w0,reconcileElements:nZ,restore:lc,restoreAppState:y3,restoreElements:af,restoreLibraryItems:oc,sceneCoordsToViewportCoords:Nn,serializeAsJSON:sc,serializeLibraryAsJSON:bp,setCustomTextMetricsProvider:vM,useDevice:Tt,useHandleLibrary:NX,useI18n:Gt,viewportCoordsToSceneCoords:Ze,zoomToFitBounds:Gv},Symbol.toStringTag,{value:"Module"}));exports.A=N4;exports.B=Kp;exports.C=_4;exports.D=$4;exports.E=A4;exports.F=D4;exports.I=F4;exports.L=L4;exports.N=z4;exports.N$1=V4;exports.P=P4;exports.R=H4;exports.R$1=X4;exports.S=T4;exports.T=R4;exports.X9=l4;exports._=O4;exports._p=o4;exports.a=u4;exports.b=w4;exports.c=g4;exports.d=m4;exports.distExports=Wb;exports.f=I4;exports.f$1=Ny;exports.g=E4;exports.h=y4;exports.i=f4;exports.iC=tO;exports.index=sZ;exports.k=k4;exports.k$1=W4;exports.l=p4;exports.m=v4;exports.n=h4;exports.nanoid=Lu;exports.p=b4;exports.r=d4;exports.s=U4;exports.t=c4;exports.u=x4;exports.v=M4;exports.w=C4;exports.x=j4;exports.y=S4;exports.z=B4;
|