@orangecatai/adgen-canvas 0.0.38 → 0.0.39

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.
@@ -1,7 +1,7 @@
1
- import{$ as Pb,A as zR,B as qE,C as JE,D as Yp,E as Td,F as Xp,G as jp,H as kd,I as QE,J as e2,K as t2,L as Wa,M as sl,N as o2,O as UR,P as rs,Q as ll,R as Cd,T as n2,V as r2,W as a2,X as Zp,Y as i2,Z as Mb,_ as Ka,a as YE,aa as cl,b as ns,ba as s2,c as Tr,ca as Ab,d as XE,da as as,e as ft,ea as l2,f as jE,fa as Lb,g as Me,ga as c2,h as ol,ha as sr,i as kr,ia as d2,j as wd,ja as qp,k as vd,ka as _b,l as nl,la as m2,m as Ed,ma as p2,n as rl,na as u2,o as ZE,oa as Sd,p as Cb,q as Cr,r as Rn,s as Va,t as on,u as sa,v as al,w as il,x as Sb,y as Id,z as Kp}from"./chunk-3NZJNQVB.js";import{a as C}from"./chunk-7QV54JOA.js";import{M as kb}from"./chunk-CLQPYXMS.js";import{c as KE}from"./chunk-3PELD44J.js";import{b as VE,c as WE,d as D}from"./chunk-SRAX5OIU.js";import _ae,{useEffect as Dae,useMemo as Rae}from"react";import{DEFAULT_UI_OPTIONS as OR,isShallowEqual as Nae}from"@orangecatai/common";import k_ from"clsx";import Mte from"lodash.throttle";import na,{useContext as ji}from"react";import{flushSync as pn}from"react-dom";import Pte from"roughjs/bin/rough";import{nanoid as Cv}from"nanoid";import{clamp as C_,pointFrom as Ae,pointDistance as $i,vector as S_,pointRotateRads as Sv,vectorFromPoint as Mv,vectorSubtract as M_,vectorDot as P_,vectorNormalize as A_}from"@orangecatai/math";import{COLOR_PALETTE as Ate,CODES as L_,shouldResizeFromCenter as __,shouldMaintainAspectRatio as xp,shouldRotateWithDiscreteAngle as D_,isArrowKey as Hf,KEYS as fe,APP_NAME as Lte,CURSOR_TYPE as Ft,DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT as _te,DEFAULT_VERTICAL_ALIGN as R_,DRAGGING_THRESHOLD as N_,ELEMENT_SHIFT_TRANSLATE_AMOUNT as Dte,ELEMENT_TRANSLATE_AMOUNT as B_,EVENT as Be,FRAME_STYLE as Pn,IMAGE_MIME_TYPES as Rte,IMAGE_RENDER_TIMEOUT as Nte,LINE_CONFIRM_THRESHOLD as Pv,MAX_ALLOWED_FILE_BYTES as F_,MIME_TYPES as qr,MQ_RIGHT_SIDEBAR_MIN_WIDTH as Bte,POINTER_BUTTON as Ra,ROUNDNESS as Gf,SCROLL_TIMEOUT as Fte,TAP_TWICE_TIMEOUT as Ote,TEXT_TO_CENTER_SNAP_THRESHOLD as zte,THEME as $f,TOUCH_CTX_MENU_TIMEOUT as Ute,VERTICAL_ALIGN as Hte,YOUTUBE_STATES as Vf,ZOOM_STEP as Gte,POINTER_EVENTS as Vi,TOOL_TYPE as Jr,supportsResizeObserver as $te,DEFAULT_COLLISION_THRESHOLD as O_,DEFAULT_TEXT_ALIGN as Vte,ARROW_TYPE as Wi,DEFAULT_REDUCED_GLOBAL_ALPHA as z_,isLocalLink as Wte,normalizeLink as Av,toValidURL as Kte,getGridPoint as Ao,getLineHeight as U_,debounce as H_,distance as cd,getFontString as Lv,getNearestScrollableContainer as Yte,isInputLike as G_,isToolIcon as Xte,isWritableElement as yp,sceneCoordsToViewportCoords as wp,tupleToCoors as _v,viewportCoordsToSceneCoords as At,wrapEvent as jte,updateObject as Dv,updateActiveTool as Qr,isTransparent as Zte,easeToValuesRAF as qte,muteFSAbortError as Jte,isTestEnv as kD,isDevEnv as CD,easeOut as Qte,updateStable as vp,addEventListener as Vt,normalizeEOL as eoe,getDateTime as $_,isShallowEqual as V_,arrayToMap as Ep,applyDarkModeFilter as toe,randomInteger as ooe,CLASSES as Rv,Emitter as js,MINIMUM_ARROW_SIZE as noe,DOUBLE_TAP_POSITION_THRESHOLD as roe,BIND_MODE_TIMEOUT as aoe,invariant as ea,getFeatureFlag as Na,createUserAgentDescriptor as SD,getFormFactor as ioe,deriveStylesPanelMode as Jf,isIOS as soe,isBrave as loe,isSafari as coe,loadDesktopUIModePreference as doe,setDesktopUIMode as moe,isSelectionLikeTool as Wf,oneOf as W_}from"@orangecatai/common";import{getObservedAppState as poe,getCommonBounds as dd,getElementAbsoluteCoords as Kf,bindOrUnbindBindingElements as K_,fixBindingsAfterDeletion as uoe,getHoveredElementForBinding as vr,isBindingEnabled as Ip,shouldEnableBindingForPointerEvent as goe,updateBoundElements as Yf,LinearElementEditor as st,newElementWith as ta,newFrameElement as Nv,newFreeDrawElement as hoe,newEmbeddableElement as Y_,newMagicFrameElement as X_,newIframeElement as foe,newArrowElement as boe,newElement as xoe,newImageElement as Bv,newVideoElement as j_,newLinearElement as yoe,newTextElement as Z_,refreshTextDimensions as woe,deepCopyElement as q_,duplicateElements as Fv,hasBoundTextElement as J_,isArrowElement as md,isBindingElement as oa,isBindingElementType as voe,isBoundToContainer as Ov,isFrameLikeElement as Io,isImageElement as Ki,isVideoElement as Eoe,isEmbeddableElement as Ba,isInitializedImageElement as Tp,isLinearElement as Jo,isLinearElementType as Ioe,isUsingAdaptiveRadius as Toe,isIframeElement as pd,isIframeLikeElement as zv,isMagicFrameElement as Uv,isTextBindableContainer as Q_,isElbowArrow as un,isFlowchartNodeElement as koe,isBindableElement as Hv,isTextElement as Er,getNormalizedDimensions as Coe,isElementCompletelyInViewport as Gv,isElementInViewport as $v,isInvisiblySmallElement as eD,getCornerRadius as Soe,isPathALoop as tD,createSrcDoc as oD,embeddableURLValidator as Vv,maybeParseEmbedSrc as Moe,getEmbedLink as Xf,getInitializedImageElements as Poe,normalizeSVG as nD,updateImageCache as Aoe,getBoundTextElement as Wv,getContainerCenter as Kv,getContainerElement as rD,isValidTextContainer as Loe,redrawTextBoundingBox as _oe,hasBoundingBox as Doe,getFrameChildren as Yv,isCursorInFrame as aD,addElementsToFrame as Xv,replaceAllElementsInFrame as Roe,removeElementsFromFrame as Noe,getElementsInResizingFrame as jv,getElementsInNewFrame as Boe,getContainingFrame as jf,orderFramesToBack as Foe,elementOverlapsWithFrame as Ooe,updateFrameMembershipOfSelectedElements as iD,isElementInFrame as sD,getFrameLikeTitle as zoe,getElementsOverlappingFrame as Uoe,filterElementsEligibleAsFrameChildren as Hoe,hitElementBoundText as Goe,hitElementBoundingBoxOnly as $oe,hitElementItself as kp,getVisibleSceneBounds as Voe,FlowChartCreator as Woe,FlowChartNavigator as Koe,getLinkDirectionFromKey as lD,cropElement as Yoe,wrapText as Xoe,isElementLink as Zv,parseElementLinkFromURL as joe,isMeasureTextSupported as Zoe,normalizeText as qoe,measureText as cD,getLineHeightInPx as Joe,getApproxMinLineWidth as Qoe,getApproxMinLineHeight as ene,getMinTextElementWidth as tne,ShapeCache as Cp,getRenderOpacity as dD,editGroupForSelectedElement as one,getElementsInGroup as Zs,getSelectedGroupIdForElement as nne,getSelectedGroupIds as rne,isElementInGroup as mD,isSelectedViaGroup as ane,selectGroupsForSelectedElements as or,syncInvalidIndices as MD,syncMovedIndices as pD,excludeElementsInFramesFromSelection as ine,getSelectionStateForElements as sne,makeNextSelectedElementIds as gt,getResizeOffsetXY as lne,getResizeArrowDirection as cne,transformElements as dne,getCursorForResizingElement as uD,getElementWithTransformHandleType as gD,getTransformHandleTypeFromCoords as hD,dragNewElement as fD,dragSelectedElements as mne,getDragOffsetXY as pne,isNonDeletedElement as bD,Scene as xD,Store as une,CaptureUpdateAction as Lo,hitElementBoundingBox as gne,isLineElement as qv,isSimpleArrow as Jv,StoreDelta as yD,positionElementsOnGrid as Qv,calculateFixedPointForNonElbowArrowBinding as wD,bindOrUnbindBindingElement as hne,mutateElement as Zf,getElementBounds as vD,doBoundsIntersect as fne,isPointInElement as bne,maxBindingDistance_simple as eE,convertToExcalidrawElements as ED,getSnapOutlineMidPoint as tE,handleFocusPointDrag as xne,handleFocusPointHover as yne,handleFocusPointPointerDown as wne,handleFocusPointPointerUp as vne,maybeHandleArrowPointlikeDrag as qf,getUncroppedWidthAndHeight as Ene}from"@orangecatai/element";import{KEYS as r0,MOBILE_ACTION_BUTTON_BG as QR,updateActiveTool as e8}from"@orangecatai/common";import{getNonDeletedElements as a0}from"@orangecatai/element";import{fixBindingsAfterDeletion as t8}from"@orangecatai/element";import{LinearElementEditor as pT}from"@orangecatai/element";import{newElementWith as wu}from"@orangecatai/element";import{getContainerElement as uT}from"@orangecatai/element";import{isBoundToContainer as xu,isElbowArrow as o8,isFrameLikeElement as n8}from"@orangecatai/element";import{getFrameChildren as r8}from"@orangecatai/element";import{getElementsInGroup as i0,selectGroupsForSelectedElements as a8}from"@orangecatai/element";import{CaptureUpdateAction as yu}from"@orangecatai/element";import{isDevEnv as VR}from"@orangecatai/common";import{atom as Ze,createStore as HR}from"jotai";import{createIsolation as GR}from"jotai-scope";var g2=GR();var{useAtom:Ee,useSetAtom:Sr,useAtomValue:dl,useStore:Hae}=g2,h2=g2.Provider,Yt=HR();var $R=VE({"./locales/ar-SA.json":()=>import("./locales/ar-SA-NXDWD63E.js"),"./locales/az-AZ.json":()=>import("./locales/az-AZ-MXSORGZV.js"),"./locales/bg-BG.json":()=>import("./locales/bg-BG-O6MV2KSF.js"),"./locales/bn-BD.json":()=>import("./locales/bn-BD-T2VJNT7N.js"),"./locales/bn-IN.json":()=>import("./locales/bn-IN-MMW2ORAC.js"),"./locales/ca-ES.json":()=>import("./locales/ca-ES-MKBCGNOG.js"),"./locales/cs-CZ.json":()=>import("./locales/cs-CZ-V77HGUP7.js"),"./locales/da-DK.json":()=>import("./locales/da-DK-I5RFNTM4.js"),"./locales/de-CH.json":()=>import("./locales/de-CH-WLRDEVBV.js"),"./locales/de-DE.json":()=>import("./locales/de-DE-DTI4WUSC.js"),"./locales/el-GR.json":()=>import("./locales/el-GR-ZXDJ2OS4.js"),"./locales/en.json":()=>import("./locales/en-ZZURI326.js"),"./locales/es-ES.json":()=>import("./locales/es-ES-DYQHAD43.js"),"./locales/eu-ES.json":()=>import("./locales/eu-ES-QDSYU5Y3.js"),"./locales/fa-IR.json":()=>import("./locales/fa-IR-26LZG4PM.js"),"./locales/fi-FI.json":()=>import("./locales/fi-FI-6YS4KDE4.js"),"./locales/fr-FR.json":()=>import("./locales/fr-FR-BRLLPTZC.js"),"./locales/gl-ES.json":()=>import("./locales/gl-ES-OKUZTLYG.js"),"./locales/he-IL.json":()=>import("./locales/he-IL-26MGYIU7.js"),"./locales/hi-IN.json":()=>import("./locales/hi-IN-Q4ZOGTP2.js"),"./locales/hu-HU.json":()=>import("./locales/hu-HU-P2OXPSN5.js"),"./locales/id-ID.json":()=>import("./locales/id-ID-2EIKXYN6.js"),"./locales/it-IT.json":()=>import("./locales/it-IT-4CFKVXI2.js"),"./locales/ja-JP.json":()=>import("./locales/ja-JP-MAND2Z4V.js"),"./locales/kaa.json":()=>import("./locales/kaa-HQRTCXTJ.js"),"./locales/kab-KAB.json":()=>import("./locales/kab-KAB-JKIKKTGH.js"),"./locales/kk-KZ.json":()=>import("./locales/kk-KZ-HXQ63ZFC.js"),"./locales/km-KH.json":()=>import("./locales/km-KH-PKL3LSGX.js"),"./locales/ko-KR.json":()=>import("./locales/ko-KR-KXLREZX3.js"),"./locales/ku-TR.json":()=>import("./locales/ku-TR-MJ4IER3X.js"),"./locales/lt-LT.json":()=>import("./locales/lt-LT-H6WFQ6FJ.js"),"./locales/lv-LV.json":()=>import("./locales/lv-LV-GOCK6SJW.js"),"./locales/mr-IN.json":()=>import("./locales/mr-IN-IXVLDMEQ.js"),"./locales/my-MM.json":()=>import("./locales/my-MM-YG6MYTTD.js"),"./locales/nb-NO.json":()=>import("./locales/nb-NO-XGWJISD2.js"),"./locales/nl-NL.json":()=>import("./locales/nl-NL-XVDVCPNC.js"),"./locales/nn-NO.json":()=>import("./locales/nn-NO-EMX5MJX5.js"),"./locales/oc-FR.json":()=>import("./locales/oc-FR-ROEINTVO.js"),"./locales/pa-IN.json":()=>import("./locales/pa-IN-ZYN6SUDY.js"),"./locales/percentages.json":()=>import("./locales/percentages-5DKR754L.js"),"./locales/pl-PL.json":()=>import("./locales/pl-PL-6VTG7PHC.js"),"./locales/pt-BR.json":()=>import("./locales/pt-BR-5YFKRR5G.js"),"./locales/pt-PT.json":()=>import("./locales/pt-PT-GEIXXZ67.js"),"./locales/ro-RO.json":()=>import("./locales/ro-RO-E2P6TFZI.js"),"./locales/ru-RU.json":()=>import("./locales/ru-RU-YBIIY43T.js"),"./locales/si-LK.json":()=>import("./locales/si-LK-673C2CI2.js"),"./locales/sk-SK.json":()=>import("./locales/sk-SK-CKZHQ4AP.js"),"./locales/sl-SI.json":()=>import("./locales/sl-SI-557H2GWM.js"),"./locales/sv-SE.json":()=>import("./locales/sv-SE-XOPKKDWS.js"),"./locales/ta-IN.json":()=>import("./locales/ta-IN-XBH7DQI3.js"),"./locales/th-TH.json":()=>import("./locales/th-TH-TOCWH3R4.js"),"./locales/tr-TR.json":()=>import("./locales/tr-TR-GXW6CYY5.js"),"./locales/uk-UA.json":()=>import("./locales/uk-UA-IJKTNUDG.js"),"./locales/uz-UZ.json":()=>import("./locales/uz-UZ-TBZZEA4V.js"),"./locales/vi-VN.json":()=>import("./locales/vi-VN-MULSGNVB.js"),"./locales/zh-CN.json":()=>import("./locales/zh-CN-MVX3E32U.js"),"./locales/zh-HK.json":()=>import("./locales/zh-HK-JNU5RLIE.js"),"./locales/zh-TW.json":()=>import("./locales/zh-TW-LENVCA6T.js")});var WR=85,Mr={code:"en",label:"English"},pl=[Mr,...[{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",rtl:!0},{code:"bg-BG",label:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"},{code:"ca-ES",label:"Catal\xE0"},{code:"cs-CZ",label:"\u010Cesky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"},{code:"es-ES",label:"Espa\xF1ol"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Fran\xE7ais"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"\u05E2\u05D1\u05E8\u05D9\u05EA",rtl:!0},{code:"hi-IN",label:"\u0939\u093F\u0928\u094D\u0926\u0940"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4"},{code:"ku-TR",label:"Kurd\xEE"},{code:"lt-LT",label:"Lietuvi\u0173"},{code:"lv-LV",label:"Latvie\u0161u"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokm\xE5l"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Portugu\xEAs Brasileiro"},{code:"pt-PT",label:"Portugu\xEAs"},{code:"ro-RO",label:"Rom\xE2n\u0103"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},{code:"sk-SK",label:"Sloven\u010Dina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Sloven\u0161\u010Dina"},{code:"tr-TR",label:"T\xFCrk\xE7e"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"},{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t"},{code:"mr-IN",label:"\u092E\u0930\u093E\u0920\u0940"}].filter(e=>KE[e.code]>=WR).sort((e,t)=>e.label>t.label?1:-1)],Qp="__test__";VR()&&pl.unshift({code:Qp,label:"test language"},{code:`${Qp}.rtl`,label:"\u202Atest language (rtl)\u202C",rtl:!0});var ml=Mr,Jp={},eu=async e=>{if(ml=e,document.documentElement.dir=ml.rtl?"rtl":"ltr",document.documentElement.lang=ml.code,e.code.startsWith(Qp))Jp={};else try{Jp=await $R(`./locales/${ml.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),Jp=kb}Yt.set(b2,e.code)},la=()=>ml,f2=(e,t)=>{for(let o=0;o<t.length;++o){let n=t[o];if(e[n]===void 0)return;e=e[n]}if(typeof e=="string")return e},b=(e,t,o)=>{if(ml.code.startsWith(Qp))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let n=e.split("."),r=f2(Jp,n)||f2(kb,n)||o;if(r===void 0){let a=`Can't find translation for ${e}`;if(C.PROD)return console.warn(a),"";throw new Error(a)}if(t)for(let a in t)r=r.replace(`{{${a}}}`,String(t[a]));return r},b2=Ze(Mr.code),bt=()=>{let e=dl(b2);return{t:b,langCode:e}};import KR from"clsx";import go from"react";import{THEME as YR}from"@orangecatai/common";import{Fragment as xt,jsx as x,jsxs as V}from"react/jsx-runtime";var lr=e=>"var(--icon-fill-color)",x2=e=>e===YR.LIGHT?"#fff":"#1e1e1e",N=(e,t=512)=>{let{width:o=512,height:n=o,mirror:r,style:a,...i}=typeof t=="number"?{width:t}:t;return x("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${o} ${n}`,className:KR({"rtl-mirror":r}),style:a,...i,children:typeof e=="string"?x("path",{fill:"currentColor",d:e}):e})},te={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},ze={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},oie=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:3,y:8,width:18,height:4,rx:1}),x("line",{x1:12,y1:8,x2:12,y2:21}),x("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),x("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"})]}),te),tu=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),x("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),x("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),x("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),x("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),te),ou=N(V("svg",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),te),y2=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"1"}),x("circle",{cx:"12",cy:"19",r:"1"}),x("circle",{cx:"12",cy:"5",r:"1"})]}),te),w2=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),x("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),x("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]}),te),v2=N(V("svg",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),x("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),x("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),te),Db=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M6.5 9.5l3.5 -3"}),x("path",{d:"M14 5.5l3 1.5"}),x("path",{d:"M18.5 10l-2.5 7"}),x("path",{d:"M13.5 17.5l-7 -5"})]}),te),is=N(V("g",{children:[x("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"}),x("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"}),x("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:x("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"})}),x("g",{mask:"url(#UnlockedIcon)",children:x("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"})})]}),ze),ul=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),x("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"})]}),ze),E2=N(x("g",{fill:"currentColor",children:x("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3"})}),{width:24,height:24}),I2=N(V(xt,{children:[x("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"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),x("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"}),T2=N(V(xt,{children:[x("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"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),x("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"}),k2=N(V(xt,{children:[x("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"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),x("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"}),nie=N(x("g",{fill:"currentColor",children:x("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"}),ss=N(V("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),Ya=N(V("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,children:[x("path",{d:"M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255"}),x("path",{d:"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 17c0 1.42 .316 2.805 1 4"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),gl=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),te),hl=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"})]}),te),fl=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"})]}),te),nu=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),x("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),x("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),te),bl=N(x("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),ze),C2=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),x("path",{d:"M16 7h4"}),x("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),te),Pr=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("path",{d:"m11.25 5.417 3.333 3.333"})]}),ze),Ar=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),x("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),x("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),x("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),x("polyline",{points:"5 20 11 4 13 4 20 20"})]}),te),S2=N(V("g",{stroke:"currentColor",strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 7v-2h13v2"}),x("path",{d:"M10 5v14"}),x("path",{d:"M12 19h-4"}),x("path",{d:"M15 13v-1h6v1"}),x("path",{d:"M18 12v7"}),x("path",{d:"M17 19h2"})]}),te),xl=N(V("g",{strokeWidth:"1.25",children:[x("path",{d:"M12.5 6.667h.01"}),x("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"}),x("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),x("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),ze),M2=N(V("g",{strokeWidth:"1.25",children:[x("path",{d:"M15 10l4.553-2.843A1 1 0 0 1 21 8.059v7.882a1 1 0 0 1-1.447.902L15 14"}),x("rect",{x:"3",y:"6",width:"12",height:"12",rx:"2"})]}),ze),ru=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M18 13.3l-6.3 -6.3"})]}),te),Rb=N(x("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),ze),Nb=N(x("path",{d:"M5 10h10",strokeWidth:"1.25"}),ze),P2=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M21 21l-6 -6"}),x("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"}),x("path",{d:"M3 4v4h4"})]}),te),Co=N(x("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"}),ze),yl=N(V("g",{strokeWidth:"1.5",children:[x("polyline",{points:"12 16 18 10 12 4"}),x("polyline",{points:"8 4 2 10 8 16"})]}),ze),Md=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("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"})]}),ze),Pd=N(x("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"}),ze),Ad=N(x("g",{stroke:"currentColor",strokeLinejoin:"round",children:x("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"})}),{...ze,strokeWidth:1.5}),A2=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),x("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),x("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),te),ls=N(x("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"}),ze),wl=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"}),x("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),L2=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"}),x("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),Bb=N(x("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"}),ze),au=N(x("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"}),ze),_2=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("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"})]}),ze),D2=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),x("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),te),iu=N(x("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Ld=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("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"})]}),ze),R2=N("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}),N2=N("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}),vl=N(x("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"}),ze),rie=N("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}),aie=N("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"),su=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),x("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"}),x("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"})]}),te),B2=N(x("g",{strokeWidth:1.5,children:x("path",{d:"M6 18l12 -12"})}),te),lu=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 8h.01"}),x("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),x("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),x("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),x("path",{d:"M19 16v6"}),x("path",{d:"M22 19l-3 3l-3 -3"})]}),te),F2=N("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}),iie=N("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}),sie=N("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}),O2=N("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"),lie=N("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"),Fb=N(x("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"}),ze),Ob=N(x("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"}),ze),z2=N("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}),U2=N(x("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"}),ze),cie=N("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"),die=N("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}),mie=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M12 14v-11"}),x("path",{d:"M9 6l3 -3l3 3"})]}),te),pie=N(V(xt,{children:[x("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"}),x("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}),uie=N(x("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}),H2=V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 10l0 10"}),x("path",{d:"M12 10l4 4"}),x("path",{d:"M12 10l-4 4"}),x("path",{d:"M4 4l16 0"})]}),G2=V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 5l0 14"}),x("path",{d:"M16 9l-4 -4"}),x("path",{d:"M8 9l4 -4"})]}),zb=N(G2,te),Ub=N(G2,{...te,style:{transform:"rotate(180deg)"}}),Hb=N(H2,te),Gb=N(H2,{...te,style:{transform:"rotate(180deg)"}}),$b=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Vb=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Wb=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Kb=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),$2=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),V2=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Yb=N(V("g",{stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),x("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),ze),Xb=N(V("g",{stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),x("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),ze),cu=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"9",cy:"7",r:"4"}),x("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),x("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),x("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),te),gie=N("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"),W2=N("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"),Nn=N(V(xt,{children:[x("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:x("path",{d:"M15 5 5 15M5 5l10 10"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),hie=N("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}),fie=N("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}),bie=N("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}),jb=go.memo(({theme:e})=>N(V(xt,{children:[x("path",{d:"M25 26H111V111H25",fill:lr(e)}),x("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:lr(e),strokeWidth:"2"}),x("path",{d:"M100 100H160V160H100",fill:lr(e)}),x("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:lr(e),strokeWidth:"2"}),V("g",{fill:x2(e),stroke:lr(e),strokeWidth:"6",children:[x("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),Zb=go.memo(({theme:e})=>N(V(xt,{children:[x("path",{d:"M25 26H111V111H25",fill:lr(e)}),x("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:lr(e),strokeWidth:"2"}),x("path",{d:"M100 100H160V160H100",fill:lr(e)}),x("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:lr(e),strokeWidth:"2"}),V("g",{fill:x2(e),stroke:lr(e),strokeWidth:"6",children:[x("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),x("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),K2=N(x("g",{strokeWidth:1.25,children:x("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"})}),ze),Y2=N(V(xt,{children:[x("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"}),x("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:x("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"})}),x("g",{mask:"url(#FillHachureIcon)",children:x("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"})})]}),ze),X2=N(V(xt,{children:[V("g",{clipPath:"url(#a)",children:[x("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"}),x("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:x("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"})}),x("g",{mask:"url(#FillCrossHatchIcon)",children:x("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"})})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),j2=N(V(xt,{children:[x("g",{clipPath:"url(#a)",children:x("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"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...ze,fill:"currentColor"}),qb=N(x(xt,{children:x("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ze),Z2=N(x("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),ze),q2=N(x("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),ze),xie=go.memo(({theme:e})=>N(x("path",{d:"M6 10H34",stroke:lr(e),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})),J2=N(V("g",{strokeWidth:"2",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12h2"}),x("path",{d:"M17 12h2"}),x("path",{d:"M11 12h2"})]}),te),Q2=N(V("g",{strokeWidth:"2",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 12v.01"}),x("path",{d:"M8 12v.01"}),x("path",{d:"M12 12v.01"}),x("path",{d:"M16 12v.01"}),x("path",{d:"M20 12v.01"})]}),te),eI=N(x("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"}),ze),tI=N(x("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"}),ze),oI=N(x("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"}),ze),nI=N(V("svg",{strokeWidth:"1.5",children:[x("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"}),x("path",{d:"M13.3333 3.33331V3.34331"}),x("path",{d:"M16.6667 3.33331V3.34331"}),x("path",{d:"M16.6667 6.66669V6.67669"}),x("path",{d:"M16.6667 10V10.01"}),x("path",{d:"M3.33334 13.3333V13.3433"}),x("path",{d:"M16.6667 13.3333V13.3433"}),x("path",{d:"M3.33334 16.6667V16.6767"}),x("path",{d:"M6.66666 16.6667V16.6767"}),x("path",{d:"M10 16.6667V16.6767"}),x("path",{d:"M13.3333 16.6667V16.6767"}),x("path",{d:"M16.6667 16.6667V16.6767"})]}),ze),rI=N(V("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),x("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),x("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),x("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),x("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),x("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),x("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),x("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),x("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),x("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),x("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),x("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),te),aI=go.memo(({flip:e=!1})=>N(V("g",{transform:e?"translate(24, 0) scale(-1, 1)":"",stroke:"currentColor",opacity:.3,strokeWidth:2,children:[x("path",{d:"M12 12l-9 0"}),x("path",{d:"M21 9l-6 6"}),x("path",{d:"M21 15l-6 -6"})]}),te)),iI=go.memo(({flip:e=!1})=>N(V("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[x("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),x("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),sI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[x("path",{d:"M32 10L6 10",strokeWidth:2}),x("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),lI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[x("path",{d:"M26 10L6 10"}),x("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),cI=go.memo(({flip:e=!1})=>N(x("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:x("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),dI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[x("path",{d:"M32 10L6 10",strokeWidth:2}),x("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),mI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[x("path",{d:"M6,9.5H27"}),x("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),pI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{d:"M6,9.5H20"}),x("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),uI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{d:"M6,9.5H20"}),x("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),gI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),hI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),fI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),bI=N(V(xt,{children:[x("g",{clipPath:"url(#a)",children:x("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"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),xI=N(V(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),yI=N(V(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),wI=N(x(xt,{children:x("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"})}),ze),cs=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 7v-2h13v2"}),x("path",{d:"M10 5v14"}),x("path",{d:"M12 19h-4"}),x("path",{d:"M15 13v-1h6v1"}),x("path",{d:"M18 12v7"}),x("path",{d:"M17 19h2"})]}),te),vI=N(x(xt,{children:V("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 12h10"}),x("path",{d:"M7 5v14"}),x("path",{d:"M17 5v14"}),x("path",{d:"M15 19h4"}),x("path",{d:"M15 5h4"}),x("path",{d:"M5 19h4"}),x("path",{d:"M5 5h4"})]})}),te),_d=N(x(xt,{children:x("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:x("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"})})}),ze),Jb=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 8l-4 4l4 4"}),x("path",{d:"M17 8l4 4l-4 4"}),x("path",{d:"M14 4l-4 16"})]}),te),du=Jb,EI=N(V("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),x("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),te),II=N(V("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),x("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),te),TI=N(V("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),x("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),te),kI=go.memo(({theme:e})=>N(V("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),x("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),te)),CI=go.memo(({theme:e})=>N(V("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),x("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),te)),SI=go.memo(({theme:e})=>N(V("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),x("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),x("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),te)),mu=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M21 19h-18l9 -15"}),x("path",{d:"M20.615 15.171h.015"}),x("path",{d:"M19.515 11.771h.015"}),x("path",{d:"M17.715 8.671h.015"}),x("path",{d:"M15.415 5.971h.015"})]}),te),MI=N(x("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}),yie=N(x("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"})),El=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),x("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),x("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),x("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"})]}),te),Qb=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),x("path",{d:"M7 11l5 5l5 -5"}),x("path",{d:"M12 4l0 12"})]}),te),Il=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),te),PI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M9.15 14.85l8.85 -10.85"}),x("path",{d:"M6 4l8.85 10.85"})]}),te),AI=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),x("path",{d:"M12 17l0 .01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),wie=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 4v16l13 -8z"})]}),te),vie=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"})]}),te),LI=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12l5 5l10 -10"})]}),te),pu=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M12 9v4"}),x("path",{d:"M12 17h.01"})]}),te),_I=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11 7l6 6"}),x("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"})]}),te),Dd=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 3l-4 7h8z"}),x("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("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"})]}),te),Lr=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 7l16 0"}),x("path",{d:"M4 17l16 0"}),x("path",{d:"M7 4l0 16"}),x("path",{d:"M17 4l0 16"})]}),te),uu=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),x("circle",{cx:"8.5",cy:"8.5",r:"1.5",fill:"currentColor",stroke:"none"}),x("path",{d:"M3 16l5-5c.928-.893 2.072-.893 3 0l5 5"}),x("path",{d:"M14 14l1-1c.928-.893 2.072-.893 3 0l3 3"}),x("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),te),gu=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"3",y:"6",width:"12",height:"12",rx:"2"}),x("path",{d:"M15 10l4.553-2.07A1 1 0 0 1 21 8.87v6.26a1 1 0 0 1-1.447.94L15 14"}),x("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),te),Tl=N(x("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"})),DI=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),x("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]}),te),RI=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 10l-2 1l8 4l8 -4l-2 -1"}),x("path",{d:"M4 15l8 4l8 -4"}),x("path",{d:"M12 4v7"}),x("path",{d:"M15 8l-3 3l-3 -3"})]}),te),Xa=N(V("g",{strokeWidth:"1.25",children:[x("path",{d:"M4.16602 10H15.8327"}),x("path",{d:"M12.5 13.3333L15.8333 10"}),x("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),ze),_r=N(V("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[x("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"}),x("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),ds=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),x("path",{d:"M15 6l3 3"}),x("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"}),x("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"})]}),te),Eie=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),x("path",{d:"M15 6l3 3"}),x("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"}),x("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"})]}),te),Iie=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),x("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),x("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"}),x("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),x("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),x("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"})]}),te),NI=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),x("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),x("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),x("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),te),kl=N(V("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),x("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"})]}),te),BI=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),x("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"}),x("path",{d:"M3 3l18 18"})]}),te),FI=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("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"}),x("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),x("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),x("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),x("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),te),OI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("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"}),x("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),x("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),x("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),x("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),te),bn=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),x("path",{d:"M21 21l-6 -6"})]}),te),zI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),x("path",{d:"M12 7v5l3 3"}),x("path",{d:"M19 16l-2 3h4l-2 3"})]}),te),UI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 8l0 4l2 2"}),x("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})]}),te),HI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M5 10a7 7 0 0 0 14 0"}),x("path",{d:"M8 21l8 0"}),x("path",{d:"M12 17l0 4"})]}),te),GI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 3l18 18"}),x("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"}),x("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),x("path",{d:"M8 21l8 0"}),x("path",{d:"M12 17l0 4"})]}),te),Rd=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),te),$I=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M12 20v.01"}),x("path",{d:"M16 20v.01"}),x("path",{d:"M8 20v.01"}),x("path",{d:"M4 20v.01"}),x("path",{d:"M4 16v.01"}),x("path",{d:"M4 12v.01"}),x("path",{d:"M4 8v.01"}),x("path",{d:"M4 4v.01"}),x("path",{d:"M8 4v.01"}),x("path",{d:"M12 4v.01"}),x("path",{d:"M16 4v.01"}),x("path",{d:"M20 4v.01"}),x("path",{d:"M20 8v.01"}),x("path",{d:"M20 12v.01"}),x("path",{d:"M20 16v.01"}),x("path",{d:"M20 20v.01"})]}),te),VI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 3v18"}),x("path",{d:"M19 21v-18"}),x("path",{d:"M5 7h14"}),x("path",{d:"M5 15h14"}),x("path",{d:"M8 13v4"}),x("path",{d:"M11 13v4"}),x("path",{d:"M16 13v4"}),x("path",{d:"M14 5v4"}),x("path",{d:"M11 5v4"}),x("path",{d:"M8 5v4"}),x("path",{d:"M3 21h18"})]}),te),WI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 12l18 0"}),x("path",{d:"M7 16l10 0l-10 5l0 -5"}),x("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),te),KI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 3l0 18"}),x("path",{d:"M16 7l0 10l5 0l-5 -10"}),x("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),te),e0=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),x("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"})]}),te),Cl=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),x("path",{d:"M22 22l-3 -3"}),x("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),x("path",{d:"M3 11v-1"}),x("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),x("path",{d:"M10 3h1"}),x("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),te),YI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),x("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),x("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"}),x("path",{d:"M10 15l2 6l2 -6"}),x("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),te),XI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),x("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),x("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),x("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),x("path",{d:"M11 21v-6l3 6v-6"})]}),te),jI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M4 8l5 0"}),x("path",{d:"M15 8l4 0"})]}),te),ZI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),x("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),x("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),x("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),te),qI=N(V("g",{stroke:"currentColor",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"})]}),{...te,strokeWidth:1.5}),Tie=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M21 12h-13l3 -3"}),x("path",{d:"M11 15l-3 -3"})]}),te),JI=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M10 9l5 3l-5 3z"})]}),te),QI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 6h18"}),x("path",{d:"M3 12h18"}),x("path",{d:"M3 18h18"}),x("path",{d:"M6 3v18"}),x("path",{d:"M12 3v18"}),x("path",{d:"M18 3v18"})]}),te),eT=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("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"}),x("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),te),Sl=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 18l12 -12"}),x("path",{d:"M18 10v-4h-4"})]}),te),Ml=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),x("path",{d:"M18 4l3 3l-3 3"})]}),te),Pl=N(V("g",{children:[x("path",{d:"M16,12L20,9L16,6"}),x("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),te),hu=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 9l6 6l6 -6"})]}),te),tT=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 15l6 -6l6 6"})]}),te),oT=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 15l6 -6l6 6"})]}),te),t0=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),x("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),te),fu=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 7l0 10"}),x("path",{d:"M7 5l10 0"}),x("path",{d:"M7 19l10 0"}),x("path",{d:"M19 7l0 10"})]}),te),kie=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1"}),x("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})]}),te),nT=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 6l8 0"}),x("path",{d:"M16 6l4 0"}),x("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 12l2 0"}),x("path",{d:"M10 12l10 0"}),x("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 18l11 0"}),x("path",{d:"M19 18l1 0"})]}),te),rT=N(V("g",{strokeWidth:1,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4"})]}),te),aT=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),x("path",{d:"M13.5 6.5l4 4"})]}),te),Cie=N(V("g",{strokeWidth:1,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11 7l-5 5l5 5"}),x("path",{d:"M17 7l-5 5l5 5"})]}),te),iT=N(V("g",{strokeWidth:"1.75",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}),x("path",{d:"M15 4l0 16"})]}),te),Sie=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1"})]}),te),Mie=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 4l18 0"}),x("path",{d:"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10"}),x("path",{d:"M12 16l0 4"}),x("path",{d:"M9 20l6 0"}),x("path",{d:"M8 12l3 -3l2 2l3 -3"})]}),te),sT=x("div",{style:{width:"1rem",height:"1rem"}}),lT=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("polyline",{points:"9 6 15 12 9 18"})]}),te),cT=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 6l8 0"}),x("path",{d:"M16 6l4 0"}),x("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 12l2 0"}),x("path",{d:"M10 12l10 0"}),x("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 18l11 0"}),x("path",{d:"M19 18l1 0"})]}),te);import dT from"clsx";import n0,{useEffect as ZR,useRef as mT,useState as qR}from"react";import{isPromiseLike as JR}from"@orangecatai/common";import XR from"react";import{jsx as o0}from"react/jsx-runtime";var jR=({size:e="1em",circleWidth:t=8,synchronized:o=!1,className:n=""})=>{let a=-(XR.useRef(Date.now()).current%1600);return o0("div",{className:`Spinner ${n}`,children:o0("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":o?`${a}ms`:0},children:o0("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},So=jR;import{jsx as Nd,jsxs as Bd}from"react/jsx-runtime";var xe=n0.forwardRef(({size:e="medium",visible:t=!0,className:o="",...n},r)=>{let{id:a}=St(),i=n0.useRef(null);n0.useImperativeHandle(r,()=>i.current);let s=`ToolIcon_size_${e}`,[l,c]=qR(!1),m=mT(!0),p=async u=>{let g="onClick"in n&&n.onClick?.(u);if(JR(g))try{c(!0),await g}catch(h){if(h instanceof rl)console.warn(h);else throw h}finally{m.current&&c(!1)}};ZR(()=>(m.current=!0,()=>{m.current=!1}),[]);let d=mT(null);if(n.type==="button"||n.type==="icon"||n.type==="submit"){let u=n.type==="icon"?"button":n.type;return Bd("button",{className:dT("ToolIcon_type_button",s,o,t&&!n.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!n.hidden,"ToolIcon--selected":n.selected,"ToolIcon--plain":n.type==="icon"}),style:n.style,"data-testid":n["data-testid"],hidden:n.hidden,title:n.title,"aria-label":n["aria-label"],type:u,onClick:p,ref:i,disabled:l||n.isLoading||!!n.disabled,children:[(n.icon||n.label)&&Bd("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!n.disabled,children:[n.icon||n.label,n.keyBindingLabel&&Nd("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel}),n.isLoading&&Nd(So,{})]}),n.showAriaLabel&&Bd("div",{className:"ToolIcon__label",children:[n["aria-label"]," ",l&&Nd(So,{})]}),n.children]})}return Bd("label",{className:dT("ToolIcon",o),title:n.title,onPointerDown:u=>{d.current=u.pointerType||null,n.onPointerDown?.({pointerType:u.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{d.current=null})},children:[Nd("input",{className:`ToolIcon_type_radio ${s}`,type:"radio",name:n.name,"aria-label":n["aria-label"],"aria-keyshortcuts":n["aria-keyshortcuts"],"data-testid":n["data-testid"],id:`${a}-${n.id}`,onChange:()=>{n.onChange?.({pointerType:d.current})},checked:n.checked,ref:i}),Bd("div",{className:"ToolIcon__icon",children:[n.icon,n.keyBindingLabel&&Nd("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel})]})]})});xe.displayName="ToolButton";var bu=[],Y=e=>(bu=bu.concat(e),e);import{jsx as s8}from"react/jsx-runtime";var i8=(e,t,o)=>{let n=new Set(Me(e.filter(m=>n8(m)),t).map(m=>m.id)),r={},a=o.scene.getNonDeletedElementsMap(),i=new Set;for(let m of n){let p=r8(e,m);for(let d of p)if(!i.has(d.id)){if(xu(d)){let u=uT(d,a);u&&(r[u.id]=!0)}else r[d.id]=!0;i.add(d.id)}}let s=!0,l=e.map(m=>{if(t.selectedElementIds[m.id]){let p=xu(m)?uT(m,a):null;return m.frameId&&n.has(m.frameId)?(s=!1,r[m.id]=!0,m):p?.frameId&&n.has(p?.frameId)?m:(m.boundElements&&m.boundElements.forEach(d=>{let u=o.scene.getNonDeletedElementsMap().get(d.id);u&&o8(u)&&o.scene.mutateElement(u,{startBinding:m.id===u.startBinding?.elementId?null:u.startBinding,endBinding:m.id===u.endBinding?.elementId?null:u.endBinding})}),wu(m,{isDeleted:!0}))}return m.frameId&&n.has(m.frameId)?(s=!1,xu(m)||(r[m.id]=!0),wu(m,{frameId:null})):xu(m)&&t.selectedElementIds[m.containerId]?wu(m,{isDeleted:!0}):m}),c=t.editingGroupId;if(s&&t.editingGroupId){let m=i0(l,t.editingGroupId).filter(p=>!p.isDeleted);if(m.length>1)m[0]&&(r[m[0].id]=!0);else{c=null,m[0]&&(r[m[0].id]=!0);let p=m[0];if(p){let d=p.groupIds.findIndex(g=>g===t.editingGroupId),u=p.groupIds[d+1];if(u){let g=i0(l,u).filter(h=>!h.isDeleted);g.length>1&&(c=u,g.forEach(h=>{r[h.id]=!0}))}}}}return{elements:l,appState:{...t,...a8({selectedElementIds:r,editingGroupId:c},l,t,null)}}},gT=(e,t)=>{if(e.editingGroupId){let o=i0(a0(t),e.editingGroupId);if(o.length)return{...e,selectedElementIds:{[o[0].id]:!0}}}return e},Fd=Y({name:"deleteSelectedElements",label:"labels.delete",icon:Co,trackEvent:{category:"element",action:"delete"},perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing){let{elementId:i,selectedPointsIndices:s}=t.selectedLinearElement,l=n.scene.getNonDeletedElementsMap(),c=pT.getElement(i,l);if(!c||s==null)return!1;if(s.length>=c.points.length){let m=e.map(d=>d.id===c.id?wu(d,{isDeleted:!0}):d),p=gT(t,m);return{elements:m,appState:{...p,selectedLinearElement:null},captureUpdate:yu.IMMEDIATELY}}return pT.deletePoints(c,n,s),{elements:e,appState:{...t,selectedLinearElement:{...t.selectedLinearElement,selectedPointsIndices:s?.[0]>0?[s[0]-1]:[0]}},captureUpdate:yu.IMMEDIATELY}}let{elements:r,appState:a}=i8(e,t,n);return t8(r,r.filter(i=>i.isDeleted)),a=gT(a,r),{elements:r,appState:{...a,activeTool:e8(t,{type:n.state.preferredSelectionTool.type}),multiElement:null,newElement:null,activeEmbeddable:null,selectedLinearElement:null},captureUpdate:ft(a0(e),t)?yu.IMMEDIATELY:yu.EVENTUALLY}},keyTest:(e,t,o)=>(e.key===r0.BACKSPACE||e.key===r0.DELETE)&&!e[r0.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ho()==="mobile";return s8(xe,{type:"button",icon:Co,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>o(null),disabled:!ft(a0(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?QR:{}}})}});import{KEYS as Al,CODES as Ll,isDarwin as vu}from"@orangecatai/common";import{moveOneLeft as l8,moveOneRight as c8,moveAllLeft as d8,moveAllRight as m8}from"@orangecatai/element";import{CaptureUpdateAction as Eu}from"@orangecatai/element";import{isDarwin as hT}from"@orangecatai/common";var $=e=>e.replace(/\b(Opt(?:ion)?|Alt)\b/i,hT?b("keys.option"):b("keys.alt")).replace(/\bShift\b/i,b("keys.shift")).replace(/\b(Enter|Return)\b/i,b("keys.enter")).replace(/\b(Ctrl|Cmd|Command|CtrlOrCmd)\b/gi,hT?b("keys.cmd"):b("keys.ctrl")).replace(/\b(Esc(?:ape)?)\b/i,b("keys.escape")).replace(/\b(Space(?:bar)?)\b/i,b("keys.spacebar")).replace(/\b(Del(?:ete)?)\b/i,b("keys.delete"));import{jsx as Iu}from"react/jsx-runtime";var s0=Y({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:Ub,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:l8(e,t,n.scene),appState:t,captureUpdate:Eu.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Al.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ll.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>Iu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.sendBackward")} \u2014 ${$("CtrlOrCmd+[")}`,children:Ub})}),l0=Y({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:zb,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:c8(e,t,n.scene),appState:t,captureUpdate:Eu.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Al.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ll.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>Iu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.bringForward")} \u2014 ${$("CtrlOrCmd+]")}`,children:zb})}),c0=Y({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:Gb,trackEvent:{category:"element"},perform:(e,t)=>({elements:d8(e,t),appState:t,captureUpdate:Eu.IMMEDIATELY}),keyTest:e=>vu?e[Al.CTRL_OR_CMD]&&e.altKey&&e.code===Ll.BRACKET_LEFT:e[Al.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ll.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>Iu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.sendToBack")} \u2014 ${vu?$("CtrlOrCmd+Alt+["):$("CtrlOrCmd+Shift+[")}`,children:Gb})}),d0=Y({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:Hb,trackEvent:{category:"element"},perform:(e,t)=>({elements:m8(e,t),appState:t,captureUpdate:Eu.IMMEDIATELY}),keyTest:e=>vu?e[Al.CTRL_OR_CMD]&&e.altKey&&e.code===Ll.BRACKET_RIGHT:e[Al.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ll.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>Iu("button",{type:"button",className:"zIndexButton",onClick:o=>e(null),title:`${b("labels.bringToFront")} \u2014 ${vu?$("CtrlOrCmd+Alt+]"):$("CtrlOrCmd+Shift+]")}`,children:Hb})});import{getNonDeletedElements as p8}from"@orangecatai/element";import{LinearElementEditor as u8}from"@orangecatai/element";import{isLinearElement as g8,isTextElement as h8}from"@orangecatai/element";import{arrayToMap as f8,KEYS as fT}from"@orangecatai/common";import{selectGroupsForSelectedElements as b8}from"@orangecatai/element";import{CaptureUpdateAction as x8}from"@orangecatai/element";var m0=Y({name:"selectAll",label:"labels.selectAll",icon:$I,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing)return!1;let r=e.filter(a=>!a.isDeleted&&!(h8(a)&&a.containerId)&&!a.locked).reduce((a,i)=>(a[i.id]=!0,a),{});return{appState:{...t,...b8({editingGroupId:null,selectedElementIds:r},p8(e),t,n),selectedLinearElement:Object.keys(r).length===1&&g8(e[0])?new u8(e[0],f8(e)):null},captureUpdate:x8.IMMEDIATELY}},keyTest:e=>e[fT.CTRL_OR_CMD]&&e.key===fT.A});import{DEFAULT_GRID_SIZE as bT,KEYS as xT,MOBILE_ACTION_BUTTON_BG as y8,arrayToMap as yT}from"@orangecatai/common";import{getNonDeletedElements as wT}from"@orangecatai/element";import{LinearElementEditor as w8}from"@orangecatai/element";import{getSelectedElements as v8,getSelectionStateForElements as E8}from"@orangecatai/element";import{syncMovedIndices as I8}from"@orangecatai/element";import{duplicateElements as T8}from"@orangecatai/element";import{CaptureUpdateAction as vT}from"@orangecatai/element";import{jsx as k8}from"react/jsx-runtime";var p0=Y({name:"duplicateSelection",label:"labels.duplicateSelection",icon:Md,trackEvent:{category:"element"},perform:(e,t,o,n)=>{if(t.selectedElementsAreBeingDragged)return!1;if(t.selectedLinearElement?.isEditing)try{let i=w8.duplicateSelectedPoints(t,n.scene);return{elements:e,appState:i,captureUpdate:vT.IMMEDIATELY}}catch{return!1}let{duplicatedElements:r,elementsWithDuplicates:a}=T8({type:"in-place",elements:e,idsOfElementsToDuplicate:yT(v8(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),appState:t,randomizeSeed:!0,overrides:({origElement:i,origIdToDuplicateId:s})=>{let l=i.frameId&&s.get(i.frameId);return{x:i.x+bT/2,y:i.y+bT/2,frameId:l??i.frameId}}});if(n.props.onDuplicate&&a){let i=n.props.onDuplicate(a,e);i&&(a=i)}return{elements:I8(a,yT(r)),appState:{...t,...E8(r,wT(a),t)},captureUpdate:vT.IMMEDIATELY}},keyTest:e=>e[xT.CTRL_OR_CMD]&&e.key===xT.D,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ho()==="mobile";return k8(xe,{type:"button",icon:Md,title:`${b("labels.duplicateSelection")} \u2014 ${$("CtrlOrCmd+D")}`,"aria-label":b("labels.duplicateSelection"),onClick:()=>o(null),disabled:!ft(wT(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?y8:{}}})}});import{pointFrom as wN}from"@orangecatai/math";import{useEffect as N0,useMemo as vN,useRef as B0,useState as EN}from"react";import{ARROW_TYPE as Un,DEFAULT_FONT_FAMILY as IN,DEFAULT_FONT_SIZE as TN,FONT_FAMILY as kN,ROUNDNESS as Fu,STROKE_WIDTH as F0,VERTICAL_ALIGN as Nu,KEYS as zl,randomInteger as CN,arrayToMap as z0,getFontFamilyString as SN,getLineHeight as MN,isTransparent as PN,reduceToCommonValue as AN,invariant as U0,FONT_SIZES as Bu}from"@orangecatai/common";import{canBecomePolygon as LN,getNonDeletedElements as mk}from"@orangecatai/element";import{bindBindingElement as sk,calculateFixedPointForElbowArrowBinding as lk,updateBoundElements as _N}from"@orangecatai/element";import{LinearElementEditor as us}from"@orangecatai/element";import{newElementWith as io}from"@orangecatai/element";import{getBoundTextElement as ni,redrawTextBoundingBox as Zd}from"@orangecatai/element";import{isArrowElement as Ou,isBoundToContainer as DN,isElbowArrow as pk,isLinearElement as O0,isLineElement as ck,isTextElement as rn,isUsingAdaptiveRadius as RN}from"@orangecatai/element";import{hasStrokeColor as NN}from"@orangecatai/element";import{updateElbowArrowPoints as BN,CaptureUpdateAction as so,toggleLinePolygonState as FN}from"@orangecatai/element";import{deriveStylesPanelMode as ON}from"@orangecatai/common";import{isDevEnv as C8}from"@orangecatai/common";var S8=new Set(["command_palette","export"]),Ne=(e,t,o,n)=>{try{if(typeof window>"u"||C.VITE_WORKER_ID||C.VITE_APP_ENABLE_TRACKING!=="true"||!S8.has(e)||C8())return;C.PROD||console.info("trackEvent",{category:e,action:t,label:o,value:n}),window.sa_event&&window.sa_event(t,{category:e,label:o,value:n})}catch(r){console.error("error during analytics",r)}};import L8 from"clsx";import M8 from"clsx";import{forwardRef as P8}from"react";import{jsx as A8}from"react/jsx-runtime";var _l=P8((e,t)=>{let{title:o,className:n,testId:r,active:a,standalone:i,icon:s,onClick:l}=e;return A8("button",{type:"button",ref:t,title:o,"data-testid":r,className:M8(n,{standalone:i,active:a}),onClick:l,style:e.style,children:s},o)});import{Fragment as D8,jsx as u0,jsxs as _8}from"react/jsx-runtime";var Bn=e=>u0(D8,{children:e.options.map(t=>e.type==="button"?u0(_l,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:o=>e.onClick(t.value,o)},t.text):_8("label",{className:L8({active:e.value===t.value}),title:t.text,children:[u0("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))});import{Popover as UT}from"radix-ui";import HT from"clsx";import{useRef as GT,useEffect as M7}from"react";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as OT,COLOR_PALETTE as $T,isColorDark as zT,isWritableElement as P7}from"@orangecatai/common";import{useEffect as O8,useRef as z8}from"react";import{createPortal as U8}from"react-dom";import{EVENT as Za,KEYS as H8,rgbToHex as G8}from"@orangecatai/common";import ET from"react";var g0=ET.createContext(null),qe=()=>ET.useContext(g0);import{useState as R8,useLayoutEffect as IT}from"react";import{THEME as N8}from"@orangecatai/common";var Tu=e=>{let[t,o]=R8(null),n=Je(),{theme:r}=qe(),{container:a}=St();return IT(()=>{t&&(t.className="",t.classList.add("excalidraw",...e?.className?.split(/\s+/)||[]),t.classList.toggle("excalidraw--mobile",n.formFactor==="phone"),t.classList.toggle("theme--dark",r===N8.DARK))},[t,r,n.formFactor,e?.className]),IT(()=>{let i=e?.parentSelector?a?.querySelector(e.parentSelector):document.body;if(!i)return;let s=document.createElement("div");return i.appendChild(s),o(s),()=>{i.removeChild(s)}},[a,e?.parentSelector]),t};import{useEffect as B8}from"react";import{EVENT as ku}from"@orangecatai/common";function Dl(e,t,o){B8(()=>{function n(r){let a=r;if(!e.current)return;let i=o?.(a,e.current);if(i===!0)return;if(i===!1)return t(a);e.current.contains(a.target)||!document.documentElement.contains(a.target)||a.target.closest("[data-radix-portal]")||a.target===document.documentElement&&document.body.style.pointerEvents==="none"||a.target.closest("[data-prevent-outside-click]")||t(a)}return document.addEventListener(ku.POINTER_DOWN,n),document.addEventListener(ku.TOUCH_START,n),()=>{document.removeEventListener(ku.POINTER_DOWN,n),document.removeEventListener(ku.TOUCH_START,n)}},[e,t,o])}import{useRef as F8}from"react";var ja=e=>{let t=F8(e);return Object.assign(t.current,e),t.current};import{jsx as $8}from"react/jsx-runtime";var qa=Ze(null),TT=({onCancel:e,onChange:t,onSelect:o,colorPickerType:n})=>{let r=Tu({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),a=qe(),i=Fn(),s=Mt(),l=Me(i,a),c=ja({app:s,onCancel:e,onChange:t,onSelect:o,selectedElements:l}),{container:m}=St();O8(()=>{let d=p.current;if(!d||!s.canvas||!r)return;let u=!1,g=s.canvas.getContext("2d"),h=({clientX:k,clientY:S})=>{let T=g.getImageData((k-a.offsetLeft)*window.devicePixelRatio,(S-a.offsetTop)*window.devicePixelRatio,1,1).data;return G8(T[0],T[1],T[2])},f=({clientX:k,clientY:S,altKey:T})=>{d.style.top=`${S+20}px`,d.style.left=`${k+20}px`;let A=h({clientX:k,clientY:S});u&&c.onChange(n,A,c.selectedElements,{altKey:T}),d.style.background=A},w=()=>{c.onCancel()},y=(k,S)=>{c.onSelect(k,S)},v=k=>{u=!0,k.stopImmediatePropagation()},E=k=>{u=!1,m?.focus(),k.stopImmediatePropagation(),k.preventDefault(),y(h(k),k)},I=k=>{k.key===H8.ESCAPE&&(k.preventDefault(),k.stopImmediatePropagation(),w())};return r.tabIndex=-1,r.focus(),f({clientX:c.app.lastViewportPosition.x,clientY:c.app.lastViewportPosition.y,altKey:!1}),r.addEventListener(Za.KEYDOWN,I),r.addEventListener(Za.POINTER_DOWN,v),r.addEventListener(Za.POINTER_UP,E),window.addEventListener("pointermove",f,{passive:!0}),window.addEventListener(Za.BLUR,w),()=>{u=!1,r.removeEventListener(Za.KEYDOWN,I),r.removeEventListener(Za.POINTER_DOWN,v),r.removeEventListener(Za.POINTER_UP,E),window.removeEventListener("pointermove",f),window.removeEventListener(Za.BLUR,w)}},[c,s.canvas,r,n,m,a.offsetLeft,a.offsetTop]);let p=z8(null);return Dl(p,()=>{e()},d=>!!d.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),r?U8($8("div",{ref:p,className:"excalidraw-eye-dropper-preview"}),r):null};import{Popover as h0}from"radix-ui";import Y8 from"clsx";import X8 from"react";import{isInteractive as j8}from"@orangecatai/common";import V8 from"react";import W8 from"clsx";import{jsx as K8}from"react/jsx-runtime";var $t=V8.forwardRef(({children:e,padding:t,className:o,style:n},r)=>K8("div",{className:W8("Island",o),style:{"--padding":t,...n},ref:r,children:e}));import{jsx as f0,jsxs as Z8}from"react/jsx-runtime";var ca=X8.forwardRef(({className:e,container:t,children:o,style:n,onClose:r,onKeyDown:a,onFocusOutside:i,onPointerLeave:s,onPointerDownOutside:l,preventAutoFocusOnTouch:c=!1},m)=>{let p=Je(),d=p.formFactor==="phone"&&!p.isLandscape;return f0(h0.Portal,{container:t,children:Z8(h0.Content,{ref:m,className:Y8("focus-visible-none",e),"data-prevent-outside-click":!0,side:d?"bottom":"right",align:d?"center":"start",alignOffset:-16,sideOffset:20,collisionBoundary:t??void 0,style:{zIndex:"var(--zIndex-ui-styles-popup)",marginLeft:p.formFactor==="phone"?"0.5rem":void 0},onPointerLeave:s,onKeyDown:a,onFocusOutside:i,onPointerDownOutside:l,onOpenAutoFocus:u=>{c&&p.isTouchScreen&&u.preventDefault()},onCloseAutoFocus:u=>{u.stopPropagation(),u.preventDefault(),t&&!j8(document.activeElement)&&t.focus(),r()},children:[f0($t,{padding:3,style:n,children:o}),f0(h0.Arrow,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})});import{useState as q8,useCallback as b0}from"react";var Cu=()=>document.querySelector(".excalidraw-wysiwyg"),Su=()=>{let e=Cu();return e?{start:e.selectionStart,end:e.selectionEnd}:null},Od=e=>{setTimeout(()=>{let t=Cu();t&&(t.focus(),e&&(t.selectionStart=e.start,t.selectionEnd=e.end))},0)},zd=(e,t,o,n)=>{t&&n&&n();let r=t&&o?Su():null;e(),t&&o&&Od(r)},kT=()=>{let[e,t]=q8(null),o=b0(()=>{let a=Su();t(a)},[]),n=b0(()=>{setTimeout(()=>{let a=Cu();a&&(a.focus(),e&&(a.selectionStart=e.start,a.selectionEnd=e.end,t(null)))},0)},[e]),r=b0(()=>{t(null)},[]);return{saveCaretPosition:o,restoreCaretPosition:n,clearSavedPosition:r,hasSavedPosition:!!e}},CT=(e=100)=>{let t=Cu();if(t){let o=t.onblur;t.onblur=null,setTimeout(()=>{t.onblur=o},e)}};import Q8 from"clsx";import{useCallback as e7,useEffect as y0,useRef as MT,useState as t7}from"react";import{KEYS as w0,normalizeInputColor as o7}from"@orangecatai/common";import{MAX_CUSTOM_COLORS_USED_IN_CANVAS as J8}from"@orangecatai/common";var Ja=({palette:e,color:t})=>{if(!t)return null;for(let[o,n]of Object.entries(e))if(Array.isArray(n)){let r=n.indexOf(t);if(r>-1)return{colorName:o,shade:r}}else if(n===t)return{colorName:o,shade:null};return null},Ud=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),x0=({color:e,palette:t})=>!Object.values(t).flat().includes(e),ST=(e,t,o)=>{let n={elementBackground:"backgroundColor",elementStroke:"strokeColor"},r=e.filter(i=>{if(i.isDeleted)return!1;let s=i[n[t]];return x0({color:s,palette:o})}),a=new Map;return r.forEach(i=>{let s=i[n[t]];a.has(s)?a.set(s,a.get(s)+1):a.set(s,1)}),[...a.entries()].sort((i,s)=>s[1]-i[1]).map(i=>i[0]).slice(0,J8)},On=Ze(null);import{Fragment as n7,jsx as Hd,jsxs as PT}from"react/jsx-runtime";var AT=({color:e,onChange:t,label:o,colorPickerType:n,placeholder:r})=>{let a=Je(),[i,s]=t7(e),[l,c]=Ee(On);y0(()=>{s(e)},[e]);let m=e7(f=>{let w=f.toLowerCase(),y=o7(w);y&&t(y),s(w)},[t]),p=MT(null),d=MT(null);y0(()=>{p.current&&p.current.focus()},[l]);let[u,g]=Ee(qa),h=/^#[0-9a-f]{6}$/i.test(e)?e:"#000000";return y0(()=>()=>{g(null)},[g]),PT("div",{className:"color-picker__input-label",children:[Hd("input",{type:"color","data-testid":"custom-color-wheel","aria-label":b("labels.colorPicker"),value:h,onChange:f=>t(f.target.value)}),Hd("div",{className:"color-picker__input-hash",children:"#"}),Hd("input",{ref:l==="hex"?p:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:f=>{m(f.target.value)},value:(i||"").replace(/^#/,""),onBlur:()=>{s(e)},tabIndex:-1,onFocus:()=>c("hex"),onKeyDown:f=>{f.key!==w0.TAB&&(f.key===w0.ESCAPE&&d.current?.focus(),f.stopPropagation())},placeholder:r}),a.formFactor!=="phone"&&PT(n7,{children:[Hd("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),Hd("div",{ref:d,className:Q8("excalidraw-eye-dropper-trigger",{selected:u}),onClick:()=>g(f=>f?null:{keepOpenOnAlt:!1,onSelect:w=>t(w),colorPickerType:n}),title:`${b("labels.eyeDropper")} \u2014 ${w0.I.toLocaleUpperCase()} or ${$("Alt")} `,children:_I})]})]})};import T0,{useEffect as k0,useImperativeHandle as I7,useState as T7}from"react";import{EVENT as BT}from"@orangecatai/common";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX as k7,DEFAULT_ELEMENT_STROKE_COLOR_INDEX as C7,KEYS as S7}from"@orangecatai/common";import s7 from"clsx";import{useEffect as l7,useRef as c7}from"react";import{isColorDark as r7}from"@orangecatai/common";import{jsxs as i7}from"react/jsx-runtime";var a7=({color:e,keyLabel:t,isShade:o=!1})=>i7("div",{className:"color-picker__button__hotkey-label",style:{color:r7(e)?"#fff":"#000"},children:[o&&"\u21E7",t]}),Rl=a7;import{jsx as v0,jsxs as d7}from"react/jsx-runtime";var LT=({colors:e,color:t,onChange:o,label:n})=>{let[r,a]=Ee(On),i=c7(null);return l7(()=>{i.current&&i.current.focus()},[t,r]),v0("div",{className:"color-picker-content--default",children:e.map((s,l)=>d7("button",{ref:t===s?i:void 0,tabIndex:-1,type:"button",className:s7("color-picker__button color-picker__button--large has-outline",{active:t===s,"is-transparent":s==="transparent"||!s}),onClick:()=>{o(s),a("custom")},title:s,"aria-label":n,style:{"--swatch-color":s},children:[v0("div",{className:"color-picker__button-outline"}),v0(Rl,{color:s,keyLabel:l+1})]},l))})};import m7 from"clsx";import{useEffect as p7,useRef as u7}from"react";import{jsx as E0,jsxs as h7}from"react/jsx-runtime";var g7=({palette:e,color:t,onChange:o,activeShade:n,showHotKey:r=!0})=>{let a=Ja({color:t,palette:e}),[i,s]=Ee(On),l=u7(null);return p7(()=>{l.current&&i==="baseColors"&&l.current.focus()},[a?.colorName,i]),E0("div",{className:"color-picker-content--default",children:Object.entries(e).map(([c,m],p)=>{let d=(Array.isArray(m)?m[n]:m)||"transparent",u=Ud[p],g=b(`colors.${c.replace(/\d+/,"")}`,null,"");return h7("button",{ref:a?.colorName===c?l:void 0,tabIndex:-1,type:"button",className:m7("color-picker__button color-picker__button--large has-outline",{active:a?.colorName===c,"is-transparent":d==="transparent"||!d}),onClick:()=>{o(d),s("baseColors")},title:`${g}${d.startsWith("#")?` ${d}`:""} \u2014 ${u}`,"aria-label":`${g} \u2014 ${u}`,style:d?{"--swatch-color":d}:void 0,"data-testid":`color-${c}`,children:[E0("div",{className:"color-picker__button-outline"}),r&&E0(Rl,{color:d,keyLabel:u})]},c)})})},_T=g7;import{jsx as b7}from"react/jsx-runtime";var f7=({children:e})=>b7("div",{className:"color-picker__heading",children:e}),Nl=f7;import x7 from"clsx";import{useEffect as y7,useRef as w7}from"react";import{jsx as Gd,jsxs as DT}from"react/jsx-runtime";var RT=({color:e,onChange:t,palette:o,showHotKey:n})=>{let r=Ja({color:e||"transparent",palette:o}),[a,i]=Ee(On),s=w7(null);if(y7(()=>{s.current&&a==="shades"&&s.current.focus()},[r,a]),r){let{colorName:l,shade:c}=r,m=o[l];if(Array.isArray(m))return Gd("div",{className:"color-picker-content--default shades",children:m.map((p,d)=>DT("button",{ref:d===c&&a==="shades"?s:void 0,tabIndex:-1,type:"button",className:x7("color-picker__button color-picker__button--large has-outline",{active:d===c}),"aria-label":"Shade",title:`${l} - ${d+1}`,style:p?{"--swatch-color":p}:void 0,onClick:()=>{t(p),i("shades")},children:[Gd("div",{className:"color-picker__button-outline"}),n&&Gd(Rl,{color:p,keyLabel:d+1,isShade:!0})]},d))})}return DT("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[Gd("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),Gd("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:b("colorPicker.noShades")})]})};import{COLORS_PER_ROW as Bl,COLOR_PALETTE as v7,KEYS as $d}from"@orangecatai/common";var I0=(e,t,o)=>{let n=Math.ceil(o/Bl);switch(t=t??-1,e){case"ArrowLeft":{let r=t-1;return r<0?o-1:r}case"ArrowRight":return(t+1)%o;case"ArrowDown":{let r=t+Bl;return r>=o?t%Bl:r}case"ArrowUp":{let r=t-Bl,a=r<0?Bl*n+r:r;return a>=o?void 0:a}}},E7=({e,colorObj:t,onChange:o,palette:n,customColors:r,setActiveColorPickerSection:a,activeShade:i})=>{if(t?.shade!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let s=Number(e.code.slice(-1))-1;return o(n[t.colorName][s]),a("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&r[Number(e.key)-1])return o(r[Number(e.key)-1]),a("custom"),!0;if(Ud.includes(e.key)){let s=Ud.indexOf(e.key),l=Object.keys(n)[s],c=n[l],m=Array.isArray(c)?c[i]:c;return o(m),a("baseColors"),!0}return!1},NT=({event:e,activeColorPickerSection:t,palette:o,color:n,onChange:r,customColors:a,setActiveColorPickerSection:i,updateData:s,activeShade:l,onEyeDropperToggle:c,onEscape:m})=>{if(e[$d.CTRL_OR_CMD])return!1;if(e.key===$d.ESCAPE)return m(e),!0;if(e.key===$d.ALT)return c(!0),!0;if(e.key===$d.I)return c(),!0;let p=Ja({color:n,palette:o});if(e.key===$d.TAB){let d={custom:!!a.length,baseColors:!0,shades:p?.shade!=null,hex:!0},u=Object.entries(d).reduce((y,[v,E])=>(E&&y.push(v),y),[]),g=u.indexOf(t),h=e.shiftKey?-1:1,f=g+h>u.length-1?0:g+h<0?u.length-1:g+h,w=u[f];return w&&i(w),w==="custom"?r(a[0]):w==="baseColors"&&(Object.entries(o).find(([v,E])=>Array.isArray(E)?E.includes(n):E===n?v:null)||r(v7.black)),e.preventDefault(),e.stopPropagation(),!0}if(E7({e,colorObj:p,onChange:r,palette:o,customColors:a,setActiveColorPickerSection:i,activeShade:l}))return!0;if(t==="shades"&&p){let{shade:d}=p,u=I0(e.key,d,Bl);if(u!==void 0)return r(o[p.colorName][u]),!0}if(t==="baseColors"&&p){let{colorName:d}=p,u=Object.keys(o),g=u.indexOf(d),h=I0(e.key,g,u.length);if(h!==void 0){let f=u[h],w=o[f];return r(Array.isArray(w)?w[l]:w),!0}}if(t==="custom"){let d=n!=null?a.indexOf(n):0,u=I0(e.key,d,a.length);if(u!==void 0){let g=a[u];return r(g),!0}}return!1};import{jsx as Qa,jsxs as Mu}from"react/jsx-runtime";var FT=T0.forwardRef(({color:e,onChange:t,type:o,elements:n,palette:r,updateData:a,children:i,showTitle:s,onEyeDropperToggle:l,onEscape:c,showHotKey:m=!0},p)=>{let d=s?o==="elementStroke"?b("labels.stroke"):o==="elementBackground"?b("labels.background"):null:null,[u]=T0.useState(()=>o==="canvasBackground"?[]:ST(n,o,r)),[g,h]=Ee(On),f=Ja({color:e,palette:r});k0(()=>{if(!g){let E=!!e&&x0({color:e,palette:r}),I=E&&!u.includes(e);h(I?null:E?"custom":f?.shade!=null?"shades":"baseColors")}},[g,e,r,h,f,u]);let[w,y]=T7(f?.shade??(o==="elementBackground"?k7:C7));k0(()=>{f?.shade!=null&&y(f.shade);let E=I=>{I.key===S7.ALT&&l(!1)};return document.addEventListener(BT.KEYUP,E,{capture:!0}),()=>{document.removeEventListener(BT.KEYUP,E,{capture:!0})}},[f,l]);let v=T0.useRef(null);return I7(p,()=>v.current),k0(()=>{v?.current?.focus()},[]),Qa("div",{role:"dialog","aria-modal":"true","aria-label":b("labels.colorPicker"),children:Mu("div",{ref:v,onKeyDown:E=>{NT({event:E,activeColorPickerSection:g,palette:r,color:e,onChange:t,onEyeDropperToggle:l,customColors:u,setActiveColorPickerSection:h,updateData:a,activeShade:w,onEscape:c})&&(E.preventDefault(),E.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[d&&Qa("div",{className:"color-picker__title",children:d}),!!u.length&&Mu("div",{children:[Qa(Nl,{children:b("colorPicker.mostUsedCustomColors")}),Qa(LT,{colors:u,color:e,label:b("colorPicker.mostUsedCustomColors"),onChange:t})]}),Mu("div",{children:[Qa(Nl,{children:b("colorPicker.colors")}),Qa(_T,{color:e,palette:r,onChange:t,activeShade:w,showHotKey:m})]}),Mu("div",{children:[Qa(Nl,{children:b("colorPicker.shades")}),Qa(RT,{color:e,onChange:t,palette:r,showHotKey:m})]}),i]})})});import{jsx as zn,jsxs as C0}from"react/jsx-runtime";var A7=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=$T,updateData:i,getOpenPopup:s,appState:l})=>{let{container:c}=St(),m=ho(),p=m!=="full",d=m==="mobile",[,u]=Ee(On),[g,h]=Ee(qa),f=C0("div",{children:[zn(Nl,{children:b("colorPicker.hexCode")}),zn(AT,{color:t||"",label:n,onChange:v=>{o(v)},colorPickerType:e,placeholder:b("colorPicker.color")})]}),w=GT(null),y=()=>{w.current?.focus()};return zn(ca,{container:c,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!l.editingTextElement,onFocusOutside:v=>{P7(v.target)||y(),v.preventDefault()},onPointerDownOutside:v=>{g&&v.preventDefault()},onClose:()=>{s()===e&&i({openPopup:null}),u(null),l.editingTextElement&&setTimeout(()=>{let v=document.querySelector(".excalidraw-wysiwyg");v&&v.focus()},0)},children:a?zn(FT,{ref:w,palette:a,color:t,onChange:v=>{let E=l.editingTextElement?Su():null;o(v),l.editingTextElement&&E&&Od(E)},onEyeDropperToggle:v=>{h(E=>v?(E=E||{keepOpenOnAlt:!0,onSelect:o,colorPickerType:e},E.keepOpenOnAlt=!0,E):v===!1||E?null:{keepOpenOnAlt:!1,onSelect:o,colorPickerType:e})},onEscape:v=>{g?h(null):i({openPopup:null})},type:e,elements:r,updateData:i,showTitle:p,showHotKey:!d,children:f}):f})},L7=({label:e,color:t,type:o,mode:n="background",onToggle:r,editingTextElement:a})=>{let i=ho(),s=i!=="full",l=i==="mobile",c=m=>{m.preventDefault(),m.stopPropagation(),a&&CT(),r()};return C0(UT.Trigger,{type:"button",className:HT("color-picker__button active-color properties-trigger",{"is-transparent":!t||t==="transparent","has-outline":!t||!zT(t,OT),"compact-sizing":s,"mobile-border":l,"color-picker__button--wide":!s}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:o==="elementStroke"?b("labels.showStroke"):b("labels.showBackground"),"data-openpopup":o,onClick:c,"data-testid":`color-picker-more-${o}`,children:[zn("div",{className:"color-picker__button-outline",children:!t&&B2}),zn("span",{className:"color-picker__more-icon","aria-hidden":"true",children:ou}),s&&t&&n==="stroke"&&zn("div",{className:"color-picker__button-background",children:zn("span",{style:{color:t&&zT(t,OT)?"#fff":"#111"},children:rT})})]})},Vd=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=$T,updateData:i,appState:s})=>{let l=GT(s.openPopup);M7(()=>{l.current=s.openPopup},[s.openPopup]);let m=ho()!=="full";return zn("div",{children:zn("div",{role:"dialog","aria-modal":"true",className:HT("color-picker-container",{"color-picker-container--no-top-picks":m}),children:C0(UT.Root,{open:s.openPopup===e,onOpenChange:p=>{p&&i({openPopup:e})},children:[zn(L7,{color:t,label:n,type:e,mode:e==="elementStroke"?"stroke":"background",editingTextElement:!!s.editingTextElement,onToggle:()=>{s.openPopup===e?i({openPopup:null}):s.openPopup?i({openPopup:e}):i({openPopup:e})}}),s.openPopup===e&&zn(A7,{type:e,color:t,onChange:o,label:n,elements:r,palette:a,updateData:i,getOpenPopup:()=>l.current,appState:s})]})})})};import{Popover as iN}from"radix-ui";import sN from"clsx";import lN,{useCallback as cN,useMemo as dN}from"react";import{FONT_FAMILY as A0}from"@orangecatai/common";import{jsx as _7}from"react/jsx-runtime";var VT=()=>_7("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}});import Z7,{useMemo as oi,useState as q7,useRef as XT,useEffect as jT,useCallback as ZT,useSyncExternalStore as J7}from"react";import{arrayToList as Q7,debounce as eN,FONT_FAMILY as ms,getFontFamilyString as tN}from"@orangecatai/common";import D7 from"clsx";import R7 from"react";import{jsx as N7,jsxs as B7}from"react/jsx-runtime";var Pu=R7.forwardRef(({className:e,placeholder:t,onChange:o},n)=>B7("div",{className:D7("QuickSearch__wrapper",e),children:[bn,N7("input",{ref:n,className:"QuickSearch__input",type:"text",placeholder:t,onChange:r=>o(r.target.value.trim().toLowerCase())})]}));import F7 from"clsx";import{Children as O7}from"react";import{jsx as WT}from"react/jsx-runtime";var Au=({className:e,placeholder:t,children:o})=>{let n=!O7.count(o);return WT("div",{className:F7("ScrollableList__wrapper",e),role:"menu",children:n?WT("div",{className:"empty",children:t}):o})};import{jsx as z7,jsxs as U7}from"react/jsx-runtime";var KT=({children:e,className:t="",style:o,title:n})=>U7("div",{className:`dropdown-menu-group ${t}`,style:o,children:[n&&z7("p",{className:"dropdown-menu-group-title",children:n}),e]}),Wd=KT;KT.displayName="DropdownMenuGroup";import{THEME as X7}from"@orangecatai/common";import{DropdownMenu as j7}from"radix-ui";import H7,{useContext as G7}from"react";import{composeEventHandlers as $7}from"@orangecatai/common";var S0=H7.createContext({}),ei=(e="",t=!1,o=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e} ${t?"dropdown-menu-item--selected":""} ${o?"dropdown-menu-item--hovered":""}`.trim(),Lu=e=>{let t=G7(S0);return $7(e,o=>{t.onSelect?.(o)})};import{jsx as V7}from"react/jsx-runtime";var Kd=({children:e,...t})=>V7("span",{...t,style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...t.style},children:e});import{Fragment as K7,jsx as Yd,jsxs as Y7}from"react/jsx-runtime";var W7=({textStyle:e,icon:t,shortcut:o,children:n,badge:r})=>{let a=Je();return Y7(K7,{children:[t&&Yd("div",{className:"dropdown-menu-item__icon",children:t}),Yd("div",{style:e,className:"dropdown-menu-item__text",children:Yd(Kd,{children:n})}),r&&Yd("div",{className:"dropdown-menu-item__badge",children:r}),o&&a.formFactor!=="phone"&&Yd("div",{className:"dropdown-menu-item__shortcut",children:o})]})},ti=W7;import{jsx as _u}from"react/jsx-runtime";var M0=({icon:e,badge:t,value:o,children:n,shortcut:r,className:a,selected:i,onSelect:s,...l})=>{let c=Lu(s);return _u(j7.Item,{className:"radix-menu-item",onSelect:c,asChild:!0,children:_u("button",{...l,value:o,className:ei(a,i),title:l.title??l["aria-label"],children:_u(ti,{icon:e,shortcut:r,badge:t,children:n})})})};M0.displayName="DropdownMenuItem";var Fl={GREEN:"green",RED:"red",BLUE:"blue"},Du=({type:e=Fl.BLUE,children:t})=>{let{theme:o}=nn(),n={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:o===X7.LIGHT?"1.5px solid white":"none"};switch(e){case Fl.GREEN:Object.assign(n,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case Fl.RED:Object.assign(n,{backgroundColor:"pink",color:"darkred"});break;case Fl.BLUE:default:Object.assign(n,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return _u("div",{className:"DropDownMenuItemBadge",style:n,children:t})};Du.displayName="DropdownMenuItemBadge";M0.Badge=Du;var No=M0;import{KEYS as Ol}from"@orangecatai/common";var YT=({event:e,inputRef:t,hoveredFont:o,filteredFonts:n,onClose:r,onSelect:a,onHover:i})=>{if(!e[Ol.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===Ol.F)return t.current?.focus(),!0;if(e.key===Ol.ESCAPE)return r(),!0;if(e.key===Ol.ENTER)return o?.value&&a(o.value),!0;if(e.key===Ol.ARROW_DOWN)return o?.next?i(o.next.value):n[0]?.value&&i(n[0].value),!0;if(e.key===Ol.ARROW_UP)return o?.prev?i(o.prev.value):n[n.length-1]?.value&&i(n[n.length-1].value),!0};import{jsx as da,jsxs as nN}from"react/jsx-runtime";var oN=e=>{switch(e){case ms.Excalifont:case ms.Virgil:return Pr;case ms.Nunito:case ms.Helvetica:return _d;case ms["Lilita One"]:return vI;case ms["Comic Shanns"]:case ms.Cascadia:return du;default:return _d}},qT=Z7.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:o,onHover:n,onLeave:r,onOpen:a,onClose:i})=>{let{container:s}=St(),l=Mt(),{fonts:c}=l,{showDeprecatedFonts:m}=Dr(),p=ho(),[d,u]=q7(""),g=XT(null),h=J7(Rn.subscribeToCustomFonts,Rn.getCustomFontVersion),f=oi(()=>Array.from(Rn.registered.entries()).filter(([P,{metadata:F}])=>!F.private&&!F.fallback).map(([P,{metadata:F,fontFaces:U}])=>{let B={value:P,icon:oN(P),text:U[0]?.fontFace?.family??"Unknown"};return F.deprecated&&Object.assign(B,{deprecated:F.deprecated,badge:{type:Fl.RED,placeholder:b("fontList.badge.old")}}),B}).sort((P,F)=>P.text.toLowerCase()>F.text.toLowerCase()?1:-1),[h]),w=oi(()=>new Set(c.getSceneFamilies()),[e]),y=oi(()=>f.filter(P=>w.has(P.value)),[f,w]),v=oi(()=>f.filter(P=>!w.has(P.value)&&(m||!P.deprecated)),[f,w,m]),E=oi(()=>Q7([...y,...v].filter(P=>P.text?.toLowerCase().includes(d))),[y,v,d]),I=oi(()=>{let P;return t?P=E.find(F=>F.value===t):e&&(P=E.find(F=>F.value===e)),!P&&d&&(E[0]?.value?n(E[0].value):r()),P},[t,e,d,E,n,r]),k=ZT(P=>{let F=null;if(l.state.editingTextElement){let U=document.querySelector(".excalidraw-wysiwyg");U&&(F={start:U.selectionStart,end:U.selectionEnd})}o(P),l.state.editingTextElement&&F&&setTimeout(()=>{let U=document.querySelector(".excalidraw-wysiwyg");U&&F&&(U.focus(),U.selectionStart=F.start,U.selectionEnd=F.end)},0)},[o,l.state.editingTextElement]),S=ZT(P=>{YT({event:P,inputRef:g,hoveredFont:I,filteredFonts:E,onSelect:k,onHover:n,onClose:i})&&(P.preventDefault(),P.stopPropagation())},[I,E,k,n,i]);jT(()=>(a(),()=>{i()}),[]);let T=oi(()=>E.filter(P=>w.has(P.value)),[E,w]),A=oi(()=>E.filter(P=>!w.has(P.value)),[E,w]),R=({font:P,order:F})=>{let U=XT(null),B=P.value===I?.value,G=P.value===e;return jT(()=>{B&&(F===0?U.current?.scrollIntoView?.({block:"end"}):U.current?.scrollIntoView?.({block:"nearest"}))},[B,F]),da("button",{ref:U,type:"button",value:P.value,className:ei("",G,B),title:P.text,tabIndex:G?0:-1,onClick:_=>{k(Number(_.currentTarget.value))},onMouseMove:()=>{I?.value!==P.value&&n(P.value)},children:da(ti,{icon:P.icon,badge:P.badge&&da(Du,{type:P.badge.type,children:P.badge.placeholder}),textStyle:{fontFamily:tN({fontFamily:P.value})},children:P.text})})},M=[];return T.length&&M.push(da(Wd,{title:b("fontList.sceneFonts"),children:T.map((P,F)=>da(R,{font:P,order:F},P.value))},"group_1")),A.length&&M.push(da(Wd,{title:b("fontList.availableFonts"),children:A.map((P,F)=>da(R,{font:P,order:F+T.length},P.value))},"group_2")),nN(ca,{className:"properties-content",container:s,style:{width:"15rem"},onClose:()=>{i(),l.state.editingTextElement&&setTimeout(()=>{let P=document.querySelector(".excalidraw-wysiwyg");P&&P.focus()},0)},onPointerLeave:r,onKeyDown:S,preventAutoFocusOnTouch:!!l.state.editingTextElement,children:[p==="full"&&da(Pu,{ref:g,placeholder:b("quickSearch.placeholder"),onChange:eN(u,20)}),da(Au,{className:"dropdown-menu fonts manual-hover",placeholder:b("fontList.empty"),children:M.length?M:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as rN}from"radix-ui";import{MOBILE_ACTION_BUTTON_BG as aN}from"@orangecatai/common";import{jsx as P0}from"react/jsx-runtime";var JT=({selectedFontFamily:e,isOpened:t=!1,compactMode:o=!1})=>{let n=Qe(),r=o?{...aN,width:"2rem",height:"2rem"}:{};return P0(rN.Trigger,{asChild:!0,children:P0("div",{"data-openpopup":"fontFamily",className:"properties-trigger",children:P0(_l,{standalone:!0,icon:Ar,title:b("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{n(a=>({openPopup:a.openPopup==="fontFamily"?null:a.openPopup}))},style:{border:"none",...r}})})})};import{jsx as Xd,jsxs as QT}from"react/jsx-runtime";var ek=[{value:A0.Excalifont,icon:Pr,text:b("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:A0.Nunito,icon:_d,text:b("labels.normal"),testId:"font-family-normal"},{value:A0["Comic Shanns"],icon:du,text:b("labels.code"),testId:"font-family-code"}],Lpe=new Set(ek.map(e=>e.value));var tk=lN.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:o,onSelect:n,onHover:r,onLeave:a,onPopupChange:i,compactMode:s=!1})=>{let l=dN(()=>ek,[]),c=cN(m=>{m&&n(m)},[n]);return QT("div",{role:"dialog","aria-modal":"true",className:sN("FontPicker__container",{"FontPicker__container--compact":s}),children:[!s&&Xd("div",{className:"buttonList",children:Xd(Bn,{type:"button",options:l,value:t,onClick:c})}),!s&&Xd(VT,{}),QT(iN.Root,{open:e,onOpenChange:i,children:[Xd(JT,{selectedFontFamily:t,isOpened:e,compactMode:s}),e&&Xd(qT,{selectedFontFamily:t,hoveredFontFamily:o,onSelect:c,onHover:r,onLeave:a,onOpen:()=>i(!0),onClose:()=>i(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as L0}from"radix-ui";import gN from"clsx";import Ru,{useEffect as hN}from"react";import{isArrowKey as fN,KEYS as ma}from"@orangecatai/common";import{jsx as mN}from"react/jsx-runtime";var Rr=({className:e,icon:t,size:o="1em"})=>mN("span",{className:e,style:{width:o,height:"100%",margin:"0 0.5ex 0 0.5ex",display:"inline-flex",lineHeight:0,verticalAlign:"middle",flex:"0 0 auto"},children:t});import{Fragment as uN,jsx as ok,jsxs as nk}from"react/jsx-runtime";var pN=({label:e,open:t,openTrigger:o,children:n,className:r,showCollapsedIcon:a=!0})=>nk(uN,{children:[nk("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:r,onClick:o,children:[e,a&&ok(Rr,{icon:t?tT:hu})]}),t&&ok("div",{style:{display:"flex",flexDirection:"column"},children:n})]}),jd=pN;import{jsx as ps,jsxs as _0}from"react/jsx-runtime";var bN=Ze(!1);function xN({options:e,value:t,label:o,onChange:n,onClose:r,numberOfOptionsToAlwaysShow:a=e.length}){let i=Je(),{container:s}=St(),l=h=>{let f=e.find(w=>w.keyBinding===h.key.toLowerCase());if(!(h.metaKey||h.altKey||h.ctrlKey)&&f)n(f.value),h.preventDefault();else if(h.key===ma.TAB){let w=e.findIndex(v=>v.value===t),y=h.shiftKey?(e.length+w-1)%e.length:(w+1)%e.length;n(e[y].value)}else if(fN(h.key)){let w=la().rtl,y=e.findIndex(v=>v.value===t);if(y!==-1){let v=e.length,E=y;switch(h.key){case(w?ma.ARROW_LEFT:ma.ARROW_RIGHT):E=(y+1)%v;break;case(w?ma.ARROW_RIGHT:ma.ARROW_LEFT):E=(v+y-1)%v;break;case ma.ARROW_DOWN:{E=(y+(a??1))%v;break}case ma.ARROW_UP:{E=(v+y-(a??1))%v;break}}n(e[E].value)}h.preventDefault()}else(h.key===ma.ESCAPE||h.key===ma.ENTER)&&(h.preventDefault(),r());h.nativeEvent.stopImmediatePropagation(),h.stopPropagation()},[c,m]=Ee(bN),p=Ru.useMemo(()=>e.slice(0,a),[e,a]),d=Ru.useMemo(()=>e.slice(a),[e,a]);hN(()=>{p.some(h=>h.value===t)||m(!0)},[t,p,m]);let u=h=>ps("div",{className:"picker-content",children:h.map((f,w)=>_0("button",{type:"button",className:gN("picker-option",{active:t===f.value}),onClick:y=>{n(f.value)},title:`${f.text} ${f.keyBinding&&`\u2014 ${f.keyBinding.toUpperCase()}`}`,"aria-label":f.text||"none","aria-keyshortcuts":f.keyBinding||void 0,ref:y=>{t===f.value&&setTimeout(()=>{y?.focus()},0)},children:[f.icon,f.keyBinding&&ps("span",{className:"picker-keybinding",children:f.keyBinding})]},f.text))}),g=i.formFactor==="phone";return ps(L0.Content,{side:g?"right":"bottom",align:"start",sideOffset:g?8:12,style:{zIndex:"var(--zIndex-ui-styles-popup)"},onKeyDown:l,collisionBoundary:s??void 0,children:_0("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":o,children:[u(p),d.length>0&&ps(jd,{label:b("labels.more_options"),open:c,openTrigger:()=>{m(h=>!h)},className:"picker-collapsible",children:u(d)})]})})}function D0({value:e,label:t,options:o,onChange:n,group:r="",numberOfOptionsToAlwaysShow:a}){let[i,s]=Ru.useState(!1),l=Ru.useRef(null);return ps("div",{children:_0(L0.Root,{open:i,onOpenChange:c=>s(c),children:[ps(L0.Trigger,{name:r,type:"button","aria-label":t,onClick:()=>s(!i),ref:l,className:i?"active":"",children:o.find(c=>c.value===e)?.icon}),i&&ps(xN,{options:o,value:e,label:t,onChange:n,onClose:()=>{s(!1)},numberOfOptionsToAlwaysShow:a})]})})}import rk,{useEffect as yN}from"react";import{jsx as R0,jsxs as ak}from"react/jsx-runtime";var ik=({updateData:e,app:t,testId:o})=>{let n=rk.useRef(null),r=rk.useRef(null),a=t.scene.getSelectedElements(t.state),i=!0,s=a.at(0),c=a.reduce((m,p)=>(m!=null&&m!==p.opacity&&(i=!1),m==null||m>p.opacity?p.opacity:m),s?.opacity??null)??t.state.currentItemOpacity;return yN(()=>{if(n.current&&r.current){let m=n.current,p=r.current,d=m.offsetWidth,u=15,g=c/100*(d-u)+u/2;p.style.left=`${g}px`,m.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${c}%, var(--button-bg) ${c}%, var(--button-bg) 100%)`}},[c]),ak("label",{className:"control-label",children:[b("labels.opacity"),ak("div",{className:"range-wrapper",children:[R0("input",{style:{"--color-slider-track":i?void 0:"var(--button-bg)"},ref:n,type:"range",min:"0",max:"100",step:"10",onChange:m=>{e(+m.target.value)},value:c,className:"range-input","data-testid":o}),R0("div",{className:"value-bubble",ref:r,children:c!==0?c:null}),R0("div",{className:"zero-label",children:"0"})]})]})};import{Fragment as V0,jsx as De,jsxs as Vo}from"react/jsx-runtime";var uk=.1,Ul=e=>{let t=ON(e.editorInterface);return{stylesPanelMode:t,isCompact:t!=="full",isMobile:t==="mobile"}},$o=(e,t,o,n=!1)=>{let r=z0(Me(e,t,{includeBoundTextElement:n}));return e.map(a=>r.get(a.id)||a.id===t.editingTextElement?.id?o(a):a)},Bo=function(e,t,o,n,r){let a=t.state.editingTextElement,i=mk(e),s=null;if(a&&(s=o(a)),!s)if(ft(i,t.state)){let c=t.scene.getSelectedElements(t.state),m=n===!0?c:c.filter(p=>n(p));s=AN(m,o)??(typeof r=="function"?r(!0):r)}else s=typeof r=="function"?r(!1):r;return s},zN=(e,t,o)=>DN(t)||!t.autoResize?t:o.mutateElement(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}),H0=(e,t,o,n,r)=>{let a=new Set,i=$o(e,t,s=>{if(rn(s)){let l=n(s);a.add(l);let c=io(s,{fontSize:l});return Zd(c,o.scene.getContainerElement(s),o.scene),c=zN(s,c,o.scene),c}return s},!0);return Me(e,t,{includeBoundTextElement:!0}).forEach(s=>{rn(s)&&_N(s,o.scene)}),{elements:i,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:r??t.currentItemFontSize},captureUpdate:so.IMMEDIATELY}},UN=Y({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,o)=>({...o?.currentItemStrokeColor&&{elements:$o(e,t,n=>NN(n.type)?io(n,{strokeColor:o.currentItemStrokeColor}):n,!0)},appState:{...t,...o},captureUpdate:o?.currentItemStrokeColor?so.IMMEDIATELY:so.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Ul(n);return Vo(V0,{children:[a==="full"&&De("h3",{"aria-hidden":"true",children:b("labels.stroke")}),De(Vd,{type:"elementStroke",label:b("labels.stroke"),color:Bo(e,n,i=>i.strokeColor,!0,i=>i?null:t.currentItemStrokeColor),onChange:i=>o({currentItemStrokeColor:i}),elements:e,appState:t,updateData:o})]})}}),HN=Y({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,o,n)=>{if(!o?.currentItemBackgroundColor)return{appState:{...t,...o},captureUpdate:so.EVENTUALLY};let r,a=n.scene.getSelectedElements(t);if(!PN(o.currentItemBackgroundColor)&&a.every(s=>ck(s)&&LN(s.points))){let s=z0(a);r=e.map(l=>s.has(l.id)&&ck(l)?io(l,{backgroundColor:o.currentItemBackgroundColor,...FN(l,!0)}):l)}else r=$o(e,t,s=>io(s,{backgroundColor:o.currentItemBackgroundColor}));return{elements:r,appState:{...t,...o},captureUpdate:so.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Ul(n);return Vo(V0,{children:[a==="full"&&De("h3",{"aria-hidden":"true",children:b("labels.background")}),De(Vd,{type:"elementBackground",label:b("labels.background"),color:Bo(e,n,i=>i.backgroundColor,!0,i=>i?null:t.currentItemBackgroundColor),onChange:i=>o({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:o})]})}}),GN=Y({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,o,n)=>(Ne("element","changeFillStyle",`${o} (${n.editorInterface.formFactor==="phone"?"mobile":"desktop"})`),{elements:$o(e,t,r=>io(r,{fillStyle:o})),appState:{...t,currentItemFillStyle:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=Me(e,t),a=r.length>0&&r.every(i=>i.fillStyle==="zigzag");return Vo("fieldset",{children:[De("legend",{children:b("labels.fill")}),De("div",{className:"buttonList",children:De(Bn,{type:"button",options:[{value:"hachure",text:`${a?b("labels.zigzag"):b("labels.hachure")} (${$("Alt-Click")})`,icon:a?K2:Y2,active:a?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:b("labels.crossHatch"),icon:X2,testId:"fill-cross-hatch"},{value:"solid",text:b("labels.solid"),icon:j2,testId:"fill-solid"}],value:Bo(e,n,i=>i.fillStyle,i=>i.hasOwnProperty("fillStyle"),i=>i?null:t.currentItemFillStyle),onClick:(i,s)=>{let l=s.altKey&&i==="hachure"&&r.every(c=>c.fillStyle==="hachure")?"zigzag":i;o(l)}})})]})}}),$N=Y({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{strokeWidth:o})),appState:{...t,currentItemStrokeWidth:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.strokeWidth")}),De("div",{className:"buttonList",children:De(Bn,{group:"stroke-width",options:[{value:F0.thin,text:b("labels.thin"),icon:qb,testId:"strokeWidth-thin"},{value:F0.bold,text:b("labels.bold"),icon:Z2,testId:"strokeWidth-bold"},{value:F0.extraBold,text:b("labels.extraBold"),icon:q2,testId:"strokeWidth-extraBold"}],value:Bo(e,n,a=>a.strokeWidth,a=>a.hasOwnProperty("strokeWidth"),a=>a?null:t.currentItemStrokeWidth),onChange:a=>o(a)})})]})}),VN=Y({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{seed:CN(),roughness:o})),appState:{...t,currentItemRoughness:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.sloppiness")}),De("div",{className:"buttonList",children:De(Bn,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:eI},{value:1,text:b("labels.artist"),icon:tI},{value:2,text:b("labels.cartoonist"),icon:oI}],value:Bo(e,n,a=>a.roughness,a=>a.hasOwnProperty("roughness"),a=>a?null:t.currentItemRoughness),onChange:a=>o(a)})})]})}),Bue=Y({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{strokeStyle:o})),appState:{...t,currentItemStrokeStyle:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.strokeStyle")}),De("div",{className:"buttonList",children:De(Bn,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:qb},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:J2},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:Q2}],value:Bo(e,n,a=>a.strokeStyle,a=>a.hasOwnProperty("strokeStyle"),a=>a?null:t.currentItemStrokeStyle),onChange:a=>o(a)})})]})}),WN=Y({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{opacity:o}),!0),appState:{...t,currentItemOpacity:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({app:e,updateData:t})=>De(ik,{updateData:t,app:e,testId:"opacity"})}),KN=Y({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,o,n)=>H0(e,t,n,()=>(U0(o,"actionChangeFontSize: Expected a font size value"),o),o),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Ul(n);return Vo("fieldset",{children:[De("legend",{children:b("labels.fontSize")}),De("div",{className:"buttonList",children:De(Bn,{group:"font-size",options:[{value:Bu.sm,text:b("labels.small"),icon:bI,testId:"fontSize-small"},{value:Bu.md,text:b("labels.medium"),icon:xI,testId:"fontSize-medium"},{value:Bu.lg,text:b("labels.large"),icon:yI,testId:"fontSize-large"},{value:Bu.xl,text:b("labels.veryLarge"),icon:wI,testId:"fontSize-veryLarge"}],value:Bo(e,n,i=>{if(rn(i))return i.fontSize;let s=ni(i,n.scene.getNonDeletedElementsMap());return s?s.fontSize:null},i=>rn(i)||ni(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||TN),onChange:i=>{zd(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),G0=Y({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:cs,trackEvent:!1,perform:(e,t,o,n)=>H0(e,t,n,r=>Math.round(1/(1+uk)*r.fontSize)),keyTest:e=>e[zl.CTRL_OR_CMD]&&e.shiftKey&&(e.key===zl.CHEVRON_LEFT||e.key===zl.COMMA)}),$0=Y({name:"increaseFontSize",label:"labels.increaseFontSize",icon:cs,trackEvent:!1,perform:(e,t,o,n)=>H0(e,t,n,r=>Math.round(r.fontSize*(1+uk))),keyTest:e=>e[zl.CTRL_OR_CMD]&&e.shiftKey&&(e.key===zl.CHEVRON_RIGHT||e.key===zl.PERIOD)}),YN=Y({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,o,n)=>{let{cachedElements:r,resetAll:a,resetContainers:i,...s}=o;if(a)return{elements:$o(e,t,h=>{let f=r?.get(h.id);return f?io(h,{...f}):h},!0),appState:{...t,...s},captureUpdate:so.NEVER};U0(o,"actionChangeFontFamily: value must be defined");let{currentItemFontFamily:l,currentHoveredFontFamily:c}=o,m=so.EVENTUALLY,p,d=!1;if(l)p=l,m=so.IMMEDIATELY;else if(c){p=c,m=so.EVENTUALLY;let g=Me(e,t,{includeBoundTextElement:!0}).filter(h=>rn(h));if(g.length>200)d=!0;else{let h=0,f=0;for(;h<g.length&&f<5e3;){let w=g[h];f+=w?.originalText.length||0,h++}f>5e3&&(d=!0)}}let u={appState:{...t,...s},captureUpdate:m};if(p&&!d){let g=new Map,h=new Set,f=!1,w=Array.from(Rn.loadedFontsCache.values()),y=Object.entries(kN).find(([I,k])=>k===p)?.[0];c&&y&&w.some(I=>I.startsWith(y))&&(f=!0),Object.assign(u,{elements:$o(e,t,I=>{if(rn(I)&&(I.fontFamily!==p||l)){let k=io(I,{fontFamily:p,lineHeight:MN(p)}),S=r?.get(I.containerId||"")||{},T=n.scene.getContainerElement(I);return i&&T&&S&&n.scene.mutateElement(T,{...S}),f||(h=new Set([...h,...Array.from(k.originalText)])),g.set(k,T),k}return I},!0)});let v=`10px ${SN({fontFamily:p})}`,E=Array.from(h.values()).join();if(f||window.document.fonts.check(v,E))for(let[I,k]of g)Zd(I,k,n.scene);else window.document.fonts.load(v,E).then(I=>{for(let[k,S]of g){let T=n.scene.getElement(k.id),A=S?n.scene.getElement(S.id):null;T&&Zd(T,A,n.scene)}n.fonts.onLoaded(I)})}return u},PanelComponent:({elements:e,appState:t,app:o,updateData:n})=>{let r=B0(new Map),a=B0(null),[i,s]=EN({}),l=B0(!0),{stylesPanelMode:c,isCompact:m}=Ul(o),p=vN(()=>{let d=(u,g)=>Bo(u,o,h=>{if(rn(h))return h.fontFamily;let f=ni(h,g);return f?f.fontFamily:null},h=>rn(h)||ni(h,g)!==null,h=>h?null:t.currentItemFontFamily||IN);return i.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?d(Array.from(r.current?.values()??[]),r.current):!i.openPopup&&t.openPopup!=="fontFamily"?d(e,o.scene.getNonDeletedElementsMap()):a.current},[i.openPopup,t,e,o]);return N0(()=>{a.current=p},[p]),N0(()=>{Object.keys(i).length&&(n(i),s({}))},[i]),N0(()=>(l.current=!1,()=>{l.current=!0}),[]),Vo(V0,{children:[c==="full"&&De("legend",{children:b("labels.fontFamily")}),De(tk,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:p,hoveredFontFamily:t.currentHoveredFontFamily,compactMode:c!=="full",onSelect:d=>{zd(()=>{s({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:d}),r.current.clear()},m,!!t.editingTextElement)},onHover:d=>{s({currentHoveredFontFamily:d,cachedElements:new Map(r.current),resetContainers:!0})},onLeave:()=>{s({currentHoveredFontFamily:null,cachedElements:new Map(r.current),resetAll:!0})},onPopupChange:d=>{if(d){r.current.clear();let{editingTextElement:u}=t;if(u?.type==="text"){let g=o.scene.getElement(u.id);r.current.set(u.id,io(g||u,{},!0))}else{let g=Me(e,t,{includeBoundTextElement:!0});for(let h of g)r.current.set(h.id,io(h,{},!0))}s({...i,openPopup:"fontFamily"})}else{let u={currentHoveredFontFamily:null,cachedElements:new Map(r.current),resetAll:!0};s({...u}),r.current.clear(),m&&t.editingTextElement&&Od(null)}}})]})}}),XN=Y({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,o,n)=>({elements:$o(e,t,r=>{if(rn(r)){let a=io(r,{textAlign:o});return Zd(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t,currentItemTextAlign:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let a=n.scene.getNonDeletedElementsMap(),{isCompact:i}=Ul(n);return Vo("fieldset",{children:[De("legend",{children:b("labels.textAlign")}),De("div",{className:"buttonList",children:De(Bn,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:EI,testId:"align-left"},{value:"center",text:b("labels.center"),icon:II,testId:"align-horizontal-center"},{value:"right",text:b("labels.right"),icon:TI,testId:"align-right"}],value:Bo(e,n,s=>{if(rn(s))return s.textAlign;let l=ni(s,a);return l?l.textAlign:null},s=>rn(s)||ni(s,a)!==null,s=>s?null:t.currentItemTextAlign),onChange:s=>{zd(()=>o(s),i,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),jN=Y({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:$o(e,t,r=>{if(rn(r)){let a=io(r,{verticalAlign:o});return Zd(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Ul(n);return De("fieldset",{children:De("div",{className:"buttonList",children:De(Bn,{group:"text-align",options:[{value:Nu.TOP,text:b("labels.alignTop"),icon:De(kI,{theme:t.theme}),testId:"align-top"},{value:Nu.MIDDLE,text:b("labels.centerVertically"),icon:De(SI,{theme:t.theme}),testId:"align-middle"},{value:Nu.BOTTOM,text:b("labels.alignBottom"),icon:De(CI,{theme:t.theme}),testId:"align-bottom"}],value:Bo(e,n,i=>{if(rn(i)&&i.containerId)return i.verticalAlign;let s=ni(i,n.scene.getNonDeletedElementsMap());return s?s.verticalAlign:null},i=>rn(i)||ni(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:Nu.MIDDLE),onChange:i=>{zd(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})})}}),Fue=Y({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>pk(n)?n:io(n,{roundness:o==="round"?{type:RN(n.type)?Fu.ADAPTIVE_RADIUS:Fu.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>{let i=ol(mk(e),t).some(s=>s.roundness?.type===Fu.LEGACY);return Vo("fieldset",{children:[De("legend",{children:b("labels.edges")}),Vo("div",{className:"buttonList",children:[De(Bn,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:nI},{value:"round",text:b("labels.round"),icon:rI}],value:Bo(e,n,s=>i?null:s.roundness?"round":"sharp",s=>!Ou(s)&&s.hasOwnProperty("roundness"),s=>s?null:t.currentItemRoundness),onChange:s=>o(s)}),r("togglePolygon")]})]})}}),dk=e=>[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:De(aI,{flip:e})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:De(iI,{flip:e})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:De(dI,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:b("labels.arrowhead_triangle_outline"),icon:De(mI,{flip:e}),keyBinding:"r"},{value:"circle",text:b("labels.arrowhead_circle"),keyBinding:"a",icon:De(sI,{flip:e})},{value:"circle_outline",text:b("labels.arrowhead_circle_outline"),keyBinding:"s",icon:De(lI,{flip:e})},{value:"diamond",text:b("labels.arrowhead_diamond"),icon:De(pI,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:b("labels.arrowhead_diamond_outline"),icon:De(uI,{flip:e}),keyBinding:"f"},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"z",icon:De(cI,{flip:e})},{value:"crowfoot_one",text:b("labels.arrowhead_crowfoot_one"),icon:De(hI,{flip:e}),keyBinding:"x"},{value:"crowfoot_many",text:b("labels.arrowhead_crowfoot_many"),icon:De(gI,{flip:e}),keyBinding:"c"},{value:"crowfoot_one_or_many",text:b("labels.arrowhead_crowfoot_one_or_many"),icon:De(fI,{flip:e}),keyBinding:"v"}],Oue=Y({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,o)=>(U0(o,"actionChangeArrowhead: value must be defined"),{elements:$o(e,t,n=>{if(O0(n)){let{position:r,type:a}=o;if(r==="start")return io(n,{startArrowhead:a});if(r==="end")return io(n,{endArrowhead:a})}return n}),appState:{...t,[o.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:o.type},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=la().rtl;return Vo("fieldset",{children:[De("legend",{children:b("labels.arrowheads")}),Vo("div",{className:"iconSelectList buttonList",children:[De(D0,{label:"arrowhead_start",options:dk(!r),value:Bo(e,n,a=>O0(a)&&nl(a.type)?a.startArrowhead:t.currentItemStartArrowhead,!0,a=>a?null:t.currentItemStartArrowhead),onChange:a=>o({position:"start",type:a}),numberOfOptionsToAlwaysShow:4}),De(D0,{label:"arrowhead_end",group:"arrowheads",options:dk(!!r),value:Bo(e,n,a=>O0(a)&&nl(a.type)?a.endArrowhead:t.currentItemEndArrowhead,!0,a=>a?null:t.currentItemEndArrowhead),onChange:a=>o({position:"end",type:a}),numberOfOptionsToAlwaysShow:4})]})]})}}),ZN=Y({name:"changeArrowProperties",label:"Change arrow properties",trackEvent:!1,perform:(e,t,o,n)=>!1,PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>Vo("div",{className:"selected-shape-actions",children:[r("changeArrowhead"),r("changeArrowType")]})}),zue=Y({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,o,n)=>{let r=$o(e,t,s=>{if(!Ou(s))return s;let l=n.scene.getNonDeletedElementsMap(),c=us.getPointAtIndexGlobalCoordinates(s,0,l),m=us.getPointAtIndexGlobalCoordinates(s,-1,l),p=io(s,{x:o===Un.elbow?c[0]:s.x,y:o===Un.elbow?c[1]:s.y,roundness:o===Un.round?{type:Fu.PROPORTIONAL_RADIUS}:null,elbowed:o===Un.elbow,angle:o===Un.elbow?0:s.angle,points:o===Un.elbow||s.elbowed?[us.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},c,l),us.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},m,l)]:s.points});if(pk(p)){p.fixedSegments=null;let d=n.scene.getNonDeletedElementsMap();n.dismissLinearEditor();let u=us.getPointAtIndexGlobalCoordinates(p,0,d),g=us.getPointAtIndexGlobalCoordinates(p,-1,d),h=p.startBinding&&d.get(p.startBinding.elementId),f=p.endBinding&&d.get(p.endBinding.elementId),w=h&&p.startBinding?{...p.startBinding,...lk(p,h,"start",d)}:null,y=f&&p.endBinding?{...p.endBinding,...lk(p,f,"end",d)}:null;p={...p,startBinding:w,endBinding:y,...BN(p,d,{points:[u,g].map(v=>wN(v[0]-p.x,v[1]-p.y)),startBinding:w,endBinding:y,fixedSegments:null})}}else{let d=n.scene.getNonDeletedElementsMap();if(p.startBinding){let u=d.get(p.startBinding.elementId);u&&sk(p,u,t.bindMode==="inside"?"inside":"orbit","start",n.scene)}if(p.endBinding){let u=d.get(p.endBinding.elementId);u&&sk(p,u,t.bindMode==="inside"?"inside":"orbit","end",n.scene)}}return p}),a={...t,currentItemArrowType:o},i=t.selectedLinearElement?.elementId;if(i){let s=r.find(l=>l.id===i);s&&(a.selectedLinearElement=new us(s,z0(e)))}return{elements:r,appState:a,captureUpdate:so.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Vo("fieldset",{children:[De("legend",{children:b("labels.arrowtypes")}),De("div",{className:"buttonList",children:De(Bn,{group:"arrowtypes",options:[{value:Un.sharp,text:b("labels.arrowtype_sharp"),icon:Sl,testId:"sharp-arrow"},{value:Un.round,text:b("labels.arrowtype_round"),icon:Pl,testId:"round-arrow"},{value:Un.elbow,text:b("labels.arrowtype_elbowed"),icon:Ml,testId:"elbow-arrow"}],value:Bo(e,n,r=>Ou(r)?r.elbowed?Un.elbow:r.roundness?Un.round:Un.sharp:null,r=>Ou(r),r=>r?null:t.currentItemArrowType),onChange:r=>o(r)})})]})});import{clamp as j0,roundToStep as n9}from"@orangecatai/math";import{CURSOR_TYPE as vk,MAX_ZOOM as Ek,MIN_ZOOM as Ik,THEME as qd,ZOOM_STEP as Z0,updateActiveTool as Gl,CODES as Br,KEYS as ua,viewportCoordsToSceneCoords as r9}from"@orangecatai/common";import{getElementAbsoluteCoords as xk,getNonDeletedElements as Tk,getVisibleElements as a9}from"@orangecatai/element";import{newElementWith as i9}from"@orangecatai/element";import{getCommonBounds as kk}from"@orangecatai/element";import{CaptureUpdateAction as cr}from"@orangecatai/element";import{useEffect as qN}from"react";import{jsx as QN}from"react/jsx-runtime";var Hl=()=>{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},W0=(e,t,o="bottom")=>{let n=e.getBoundingClientRect(),r=window.innerWidth,a=window.innerHeight,i=5,s=t.left+t.width/2-n.width/2;s<0?s=i:s+n.width>=r&&(s=r-n.width-i);let l;o==="bottom"?(l=t.top+t.height+i,l+n.height>=a&&(l=t.top-n.height-i)):(l=t.top-n.height-i,l<0&&(l=t.top+t.height+i)),Object.assign(e.style,{top:`${l}px`,left:`${s}px`})},JN=(e,t,o,n)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=n?"50ch":"10ch",t.style.maxWidth=n?"50ch":"15ch",t.textContent=o;let r=e.getBoundingClientRect();W0(t,r)},Fo=({children:e,label:t,long:o=!1,style:n,disabled:r})=>(qN(()=>()=>Hl().classList.remove("excalidraw-tooltip--visible"),[]),r?null:QN("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:a=>JN(a.currentTarget,Hl(),t,o),onPointerLeave:()=>Hl().classList.remove("excalidraw-tooltip--visible"),style:n,children:e}));import{CURSOR_TYPE as K0,MIME_TYPES as Y0,THEME as hk}from"@orangecatai/common";var fk='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',e9='<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"/>',bk='<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"/>',t9=`data:${Y0.svg},${encodeURIComponent(`${fk}${bk}</svg>`)}`,o9=`data:${Y0.svg},${encodeURIComponent(`${fk}${e9}${bk}</svg>`)}`,xn=e=>{e&&(e.style.cursor="")},pt=(e,t)=>{e&&(e.style.cursor=t)},Nr,gk,X0=(e,t)=>{let n=()=>{let r=t===hk.DARK;Nr=document.createElement("canvas"),Nr.theme=t,Nr.height=20,Nr.width=20;let a=Nr.getContext("2d");a.lineWidth=1,a.beginPath(),a.arc(Nr.width/2,Nr.height/2,5,0,2*Math.PI),a.fillStyle=r?"#000":"#fff",a.fill(),a.strokeStyle=r?"#fff":"#000",a.stroke(),gk=Nr.toDataURL(Y0.svg)};(!Nr||Nr.theme!==t)&&n(),pt(e,`url(${gk}) ${20/2} ${20/2}, auto`)},yn=(e,t)=>{if(e)if(t.activeTool.type==="selection")xn(e);else if(sa(t))e.style.cursor=K0.GRAB;else if(on(t))X0(e,t.theme);else if(t.activeTool.type==="laser"){let o=t.theme===hk.LIGHT?t9:o9;e.style.cursor=`url(${o}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=K0.AUTO):e.style.cursor=K0.CROSSHAIR};var pa=({viewportX:e,viewportY:t,nextZoom:o},n)=>{let r=e-n.offsetLeft,a=t-n.offsetTop,i=n.zoom.value,s=n.scrollX+(r-r/i),l=n.scrollY+(a-a/i),c=-(r-r/o),m=-(a-a/o);return{scrollX:s+c,scrollY:l+m,zoom:{value:o}}};import{jsx as $l,jsxs as h9}from"react/jsx-runtime";var s9=Y({name:"changeViewBackgroundColor",label:"labels.canvasBackground",trackEvent:!1,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,o)=>({appState:{...t,...o},captureUpdate:o?.viewBackgroundColor?cr.IMMEDIATELY:cr.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,appProps:n,data:r})=>$l(Vd,{palette:null,label:b("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:a=>o({viewBackgroundColor:a}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:o})}),ga=Y({name:"clearCanvas",label:"labels.clearCanvas",icon:Co,trackEvent:{category:"canvas"},predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector",perform:(e,t,o,n)=>(n.imageCache.clear(),{elements:e.map(r=>i9(r,{isDeleted:!0})),appState:{...Va(),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:n.state.preferredSelectionTool.type}:t.activeTool},captureUpdate:cr.IMMEDIATELY})}),zu=Y({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:Rb,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Tr(t.zoom.value+Z0)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(xe,{type:"button",className:"zoom-in-button zoom-button",icon:Rb,title:`${b("buttons.zoomIn")} \u2014 ${$("CtrlOrCmd++")}`,"aria-label":b("buttons.zoomIn"),disabled:t.zoom.value>=Ek,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Br.EQUAL||e.code===Br.NUM_ADD)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),Uu=Y({name:"zoomOut",label:"buttons.zoomOut",icon:Nb,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Tr(t.zoom.value-Z0)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(xe,{type:"button",className:"zoom-out-button zoom-button",icon:Nb,title:`${b("buttons.zoomOut")} \u2014 ${$("CtrlOrCmd+-")}`,"aria-label":b("buttons.zoomOut"),disabled:t.zoom.value<=Ik,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Br.MINUS||e.code===Br.NUM_SUBTRACT)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),Hu=Y({name:"resetZoom",label:"buttons.resetZoom",icon:P2,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Tr(1)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(Fo,{label:b("buttons.resetZoom"),style:{height:"100%"},children:h9(xe,{type:"button",className:"reset-zoom-button zoom-button",title:b("buttons.resetZoom"),"aria-label":b("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===Br.ZERO||e.code===Br.NUM_ZERO)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),l9=(e,t,o=1)=>{let[n,r,a,i]=e,s=a-n,l=t.width/s,c=i-r,m=t.height/c,d=Math.min(l,m)*j0(o,.1,1);return Math.min(d,1)},c9=.8,d9=(e,t)=>e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1],m9=(e,t)=>[e[0]-t,e[1]-t,e[2]+t,e[3]+t],yk=(e,t)=>{let o=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Math.hypot(o-t.x,n-t.y)},wk=e=>[e[0],e[1],e[2],e[3]],p9=(e,t)=>{let o=Tk(e);if(!o.length)return[];let n=a9(o),r=n.length?n:o,a=new Map(o.map(d=>[d.id,d])),i=r9({clientX:t.offsetLeft+t.width/2,clientY:t.offsetTop+t.height/2},t),s=r.reduce((d,u)=>{let g=wk(xk(u,a));return d?yk(g,i)<yk(d.bounds,i)?{element:u,bounds:g}:d:{element:u,bounds:g}},null);if(!s)return[];let l=Math.max(160/t.zoom.value,.12*Math.min(t.width,t.height)/t.zoom.value),c=new Map([[s.element.id,s.element]]),m=s.bounds,p=!0;for(;p;){p=!1;let d=m9(m,l);for(let u of r){if(c.has(u.id))continue;let g=wk(xk(u,a));d9(g,d)&&(c.set(u.id,u),m=kk([...c.values()]),p=!0)}}return[...c.values()]},Ck=({bounds:e,appState:t,canvasOffsets:o,fitToViewport:n=!1,viewportZoomFactor:r=1,minZoom:a=-1/0,maxZoom:i=1/0})=>{r=j0(r,Ik,Ek);let[s,l,c,m]=e,p=(s+c)/2,d=(l+m)/2,u=o?.left??0,g=o?.top??0,h=o?.right??0,f=o?.bottom??0,w=t.width-u-h,y=t.height-g-f,v;if(n){let k=c-s,S=m-l;v=Math.min(w/k,y/S)*r}else v=l9(e,{width:w,height:y},r);let E=Tr(j0(n9(v,Z0,"floor"),a,i)),I=YE({scenePoint:{x:p,y:d},viewportDimensions:{width:t.width,height:t.height},offsets:o,zoom:{value:E}});return{appState:{...t,scrollX:I.scrollX,scrollY:I.scrollY,zoom:{value:E}},captureUpdate:cr.EVENTUALLY}},Vl=({canvasOffsets:e,targetElements:t,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})=>{let s=kk(Tk(t));return Ck({canvasOffsets:e,bounds:s,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})},vge=Y({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:Cl,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Vl({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Br.TWO&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),Ege=Y({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:Cl,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Vl({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Br.THREE&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),u9=Y({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:Cl,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>Vl({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()}),keyTest:e=>e.code===Br.ONE&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),g9=Y({name:"scrollBackToContent",label:"buttons.scrollBackToContent",icon:Cl,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=r.length?r:p9(e,t);return a.length?Vl({targetElements:a,appState:{...t,userToFollow:null},fitToViewport:!0,viewportZoomFactor:c9,canvasOffsets:n.getEditorUIOffsets()}):!1},PanelComponent:({updateData:e})=>$l(Fo,{label:b("buttons.scrollBackToContent"),style:{height:"100%"},children:$l(xe,{type:"button",className:"scroll-back-to-content-button zoom-button",icon:Cl,title:b("buttons.scrollBackToContent"),"aria-label":b("buttons.scrollBackToContent"),onClick:()=>{e(null)}})})}),gs=Y({name:"toggleTheme",label:(e,t)=>t.theme===qd.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:(e,t)=>e.theme===qd.LIGHT?Pd:Ad,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o)=>({appState:{...t,theme:o||(t.theme===qd.LIGHT?qd.DARK:qd.LIGHT)},captureUpdate:cr.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===Br.D,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.toggleTheme}),Ige=Y({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t,o,n)=>{let r;return on(t)?r=Gl(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):r=Gl(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.IMMEDIATELY}},keyTest:e=>e.key===ua.E}),Tge=Y({name:"toggleLassoTool",label:"toolBar.lasso",icon:Ya,trackEvent:{category:"toolbar"},predicate:(e,t,o,n)=>n.state.preferredSelectionTool.type!=="lasso",perform:(e,t,o,n)=>{let r;return t.activeTool.type!=="lasso"?(r=Gl(t,{type:"lasso",fromSelection:!1}),pt(n.interactiveCanvas,vk.CROSSHAIR)):r=Gl(t,{type:"selection"}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.NEVER}}}),Sk=Y({name:"toggleHandTool",label:"toolBar.hand",trackEvent:{category:"toolbar"},icon:El,viewMode:!1,perform:(e,t,o,n)=>{let r;return sa(t)?r=Gl(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(r=Gl(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),pt(n.interactiveCanvas,vk.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[ua.CTRL_OR_CMD]&&e.key===ua.H});import{updateActiveTool as Mk}from"@orangecatai/common";import{CaptureUpdateAction as f9}from"@orangecatai/element";var b9=Y({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,o,n)=>{let r=Mk(t,{type:"embeddable"});return yn(n.canvas,{...t,activeTool:r}),{elements:e,appState:{...t,activeTool:Mk(t,{type:"embeddable"})},captureUpdate:f9.EVENTUALLY}}});import{pointFrom as Pk}from"@orangecatai/math";import{bindOrUnbindBindingElement as x9}from"@orangecatai/element/binding";import{isValidPolygon as Ak,LinearElementEditor as Gu,newElementWith as q0}from"@orangecatai/element";import{isBindingElement as Lk,isFreeDrawElement as _k,isLinearElement as Dk,isLineElement as $u}from"@orangecatai/element";import{KEYS as J0,arrayToMap as y9,invariant as Rk,shouldRotateWithDiscreteAngle as w9,updateActiveTool as Nk}from"@orangecatai/common";import{isPathALoop as v9}from"@orangecatai/element";import{isInvisiblySmallElement as Q0}from"@orangecatai/element";import{CaptureUpdateAction as Bk}from"@orangecatai/element";import{jsx as E9}from"react/jsx-runtime";var Wo=Y({name:"finalize",label:"",trackEvent:!1,perform:(e,t,o,n)=>{let r=e,{interactiveCanvas:a,focusContainer:i,scene:s}=n,l=s.getNonDeletedElementsMap();if(o&&t.selectedLinearElement){let{event:d,sceneCoords:u}=o,g=Gu.getElement(t.selectedLinearElement.elementId,l);Rk(g,"Arrow element should exist if selectedLinearElement is set"),Rk(u,"sceneCoords should be defined if actionFinalize is called with event");let h=Gu.handlePointerUp(d,t.selectedLinearElement,t,n.scene);if(Lk(g)&&!t.selectedLinearElement.segmentMidPointHoveredCoords){let f=!!t.newElement,y=(f||!t.selectedLinearElement.selectedPointsIndices?[g.points.length-1]:t.selectedLinearElement.selectedPointsIndices).reduce((v,E)=>(v.set(E,{point:Gu.pointFromAbsoluteCoords(g,Pk(u.x-h.pointerOffset.x,u.y-h.pointerOffset.y),l)}),v),new Map)??new Map;x9(g,y,u.x-h.pointerOffset.x,u.y-h.pointerOffset.y,s,t,{newArrow:f,altKey:d.altKey,angleLocked:w9(d)})}else $u(g)&&t.selectedLinearElement?.isEditing&&!t.newElement&&!Ak(g.points)&&s.mutateElement(g,{polygon:!1});if(h!==t.selectedLinearElement){g&&Q0(g)&&(r=r.map(w=>w.id===g.id?q0(w,{isDeleted:!0}):w));let f=t.activeTool?.locked;return{elements:g.points.length<2||Q0(g)?e.map(w=>w.id===g.id?q0(w,{isDeleted:!0}):w):r,appState:{...t,cursorButton:"up",selectedLinearElement:f?null:{...h,selectedPointsIndices:null,isEditing:!1,initialState:{...h.initialState,lastClickedPoint:-1},pointerOffset:{x:0,y:0}},selectionElement:null,suggestedBinding:null,newElement:null,multiElement:null},captureUpdate:Bk.IMMEDIATELY}}}window.document.activeElement instanceof HTMLElement&&i();let c=null;if(t.multiElement)c=t.multiElement;else if(t.newElement?.type==="freedraw"||Lk(t.newElement))c=t.newElement;else if(Object.keys(t.selectedElementIds).length===1){let d=l.get(Object.keys(t.selectedElementIds)[0]);d&&(c=d)}if(c){if(t.selectedLinearElement&&t.multiElement&&c.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:d}=c,{lastCommittedPoint:u}=t.selectedLinearElement;(!u||d[d.length-1]!==u)&&s.mutateElement(c,{points:c.points.slice(0,-1)})}if(c&&Q0(c)&&(r=r.map(d=>d.id===c?.id?q0(d,{isDeleted:!0}):d)),Dk(c)||_k(c)){if(v9(c.points,t.zoom.value)&&($u(c)||_k(c))){let u=c.points,g=u[0],h=u.map((f,w)=>w===u.length-1?Pk(g[0],g[1]):f);$u(c)?s.mutateElement(c,{points:h,polygon:!0}):s.mutateElement(c,{points:h})}$u(c)&&!Ak(c.points)&&s.mutateElement(c,{polygon:!1})}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!c)&&xn(a);let m;t.activeTool.type==="eraser"?m=Nk(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):m=Nk(t,{type:n.state.preferredSelectionTool.type});let p=c&&Dk(c)?new Gu(c,y9(r)):t.selectedLinearElement;return p=p&&{...p,isEditing:t.newElement?!1:p.isEditing,initialState:{...p.initialState,lastClickedPoint:-1,origin:null}},{elements:r,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&c?t.activeTool:m,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBinding:null,selectedElementIds:c&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[c.id]:!0}:t.selectedElementIds,selectedLinearElement:p},captureUpdate:Bk.IMMEDIATELY}},keyTest:(e,t)=>e.key===J0.ESCAPE&&(t.selectedLinearElement?.isEditing||!t.newElement&&t.multiElement===null)||(e.key===J0.ESCAPE||e.key===J0.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:o})=>E9(xe,{type:"button",icon:O2,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:t,visible:e.multiElement!=null,size:o?.size||"medium",style:{pointerEvents:"all"}})});import{KEYS as Xl,DEFAULT_EXPORT_PADDING as pB,EXPORT_SCALES as uB,THEME as ox}from"@orangecatai/common";import{getNonDeletedElements as gB}from"@orangecatai/element";import{CaptureUpdateAction as pr}from"@orangecatai/element";import{viewportCoordsToSceneCoords as hB}from"@orangecatai/common";import I9 from"clsx";import{jsx as Fk,jsxs as T9}from"react/jsx-runtime";var Jd=({children:e,checked:t,onChange:o,className:n})=>T9("div",{className:I9("Checkbox",n,{"is-checked":t}),onClick:r=>{o(!t,r),r.currentTarget.querySelector(".Checkbox-box").focus()},children:[Fk("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:iu}),Fk("div",{className:"Checkbox-label",children:e})]});import{THEME as Qd}from"@orangecatai/common";import{jsx as em}from"react/jsx-runtime";var zk=e=>{let t=e.title||(e.value===Qd.DARK?b("buttons.lightMode"):b("buttons.darkMode"));return em(xe,{type:"icon",icon:e.value===Qd.LIGHT?Ok.MOON:Ok.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===Qd.DARK?Qd.LIGHT:Qd.DARK),"data-testid":"toggle-dark-mode"})},Ok={SUN:em("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:em("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:em("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:em("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"})})};import{useState as k9}from"react";import{focusNearestParent as C9,KEYS as S9}from"@orangecatai/common";import{jsx as Uk,jsxs as M9}from"react/jsx-runtime";var Hk=e=>{let{id:t}=St(),[o,n]=k9(e.value),r=i=>{e.ignoreFocus||C9(i.target);let s=i.target.value;s!==e.value&&e.onChange(s)},a=i=>{if(i.key===S9.ENTER){if(i.preventDefault(),i.nativeEvent.isComposing||i.keyCode===229)return;i.currentTarget.blur()}};return M9("div",{className:"ProjectName",children:[Uk("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),Uk("input",{type:"text",className:"TextInput",onBlur:r,onKeyDown:a,id:`${t}-filename`,value:o,onChange:i=>n(i.target.value)})]})};import{DEFAULT_EXPORT_PADDING as nB,DEFAULT_FILENAME as rB,IMAGE_MIME_TYPES as rC,isFirefox as aB,MIME_TYPES as iB,cloneJSON as sB,SVG_DOCUMENT_PREAMBLE as lB}from"@orangecatai/common";import{getNonDeletedElements as cB}from"@orangecatai/element";import{isFrameLikeElement as dB}from"@orangecatai/element";import{getElementsOverlappingFrame as mB}from"@orangecatai/element";import{ALLOWED_PASTE_MIME_TYPES as U9,EXPORT_DATA_TYPES as nm,MIME_TYPES as wn,arrayToMap as H9,isMemberOf as G9,isPromiseLike as $9,EVENT as Ku}from"@orangecatai/common";import{mutateElement as V9}from"@orangecatai/element";import{deepCopyElement as W9}from"@orangecatai/element";import{isFrameLikeElement as K9,isInitializedImageElement as Y9}from"@orangecatai/element";import{getContainingFrame as Jk}from"@orangecatai/element";import{pointFrom as ri}from"@orangecatai/math";import{COLOR_PALETTE as $k,DEFAULT_CHART_COLOR_INDEX as P9,getAllColorsSpecificShade as A9,DEFAULT_FONT_FAMILY as L9,DEFAULT_FONT_SIZE as Vk,VERTICAL_ALIGN as _9,randomId as Wk,isDevEnv as Kk,FONT_SIZES as D9}from"@orangecatai/common";import{newTextElement as Vu,newLinearElement as om,newElement as tx}from"@orangecatai/element";var dr=32,It=12,ai=256,Yk=50,hs="NOT_SPREADSHEET",Wl="VALID_SPREADSHEET",tm=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},ex=(e,t)=>e.slice(1).every(o=>tm(o[t])!==null),Gk=e=>{let t=e[0].length;if(t>2)return{type:hs,reason:"More than 2 columns"};if(t===1){if(!ex(e,0))return{type:hs,reason:"Value is not numeric"};let l=tm(e[0][0])===null,c=(l?e.slice(1):e).map(m=>tm(m[0]));return c.length<2?{type:hs,reason:"Less than two rows"}:{type:Wl,spreadsheet:{title:l?e[0][0]:null,labels:null,values:c}}}let o=ex(e,0),n=ex(e,1);if(!o&&!n)return{type:hs,reason:"Value is not numeric"};let[r,a]=n?[0,1]:[1,0],i=tm(e[0][a])===null,s=i?e.slice(1):e;return s.length<2?{type:hs,reason:"Less than 2 rows"}:{type:Wl,spreadsheet:{title:i?e[0][a]:null,labels:s.map(l=>l[r]),values:s.map(l=>tm(l[a]))}}},R9=e=>{let t=[];for(let o=0;o<e[0].length;o++){let n=[];for(let r=0;r<e.length;r++)n.push(e[r][o]);t.push(n)}return t},Xk=e=>{let t=e.trim().split(`
1
+ import{$ as Pb,A as zR,B as qE,C as JE,D as Yp,E as Td,F as Xp,G as jp,H as kd,I as QE,J as e2,K as t2,L as Wa,M as sl,N as o2,O as UR,P as rs,Q as ll,R as Cd,T as n2,V as r2,W as a2,X as Zp,Y as i2,Z as Mb,_ as Ka,a as YE,aa as cl,b as ns,ba as s2,c as Tr,ca as Ab,d as XE,da as as,e as ft,ea as l2,f as jE,fa as Lb,g as Me,ga as c2,h as ol,ha as sr,i as kr,ia as d2,j as wd,ja as qp,k as vd,ka as _b,l as nl,la as m2,m as Ed,ma as p2,n as rl,na as u2,o as ZE,oa as Sd,p as Cb,q as Cr,r as Rn,s as Va,t as on,u as sa,v as al,w as il,x as Sb,y as Id,z as Kp}from"./chunk-T3ZLBHX4.js";import{a as C}from"./chunk-WBFDC4WN.js";import{M as kb}from"./chunk-CLQPYXMS.js";import{c as KE}from"./chunk-3PELD44J.js";import{b as VE,c as WE,d as D}from"./chunk-SRAX5OIU.js";import _ae,{useEffect as Dae,useMemo as Rae}from"react";import{DEFAULT_UI_OPTIONS as OR,isShallowEqual as Nae}from"@orangecatai/common";import k_ from"clsx";import Mte from"lodash.throttle";import na,{useContext as ji}from"react";import{flushSync as pn}from"react-dom";import Pte from"roughjs/bin/rough";import{nanoid as Cv}from"nanoid";import{clamp as C_,pointFrom as Ae,pointDistance as $i,vector as S_,pointRotateRads as Sv,vectorFromPoint as Mv,vectorSubtract as M_,vectorDot as P_,vectorNormalize as A_}from"@orangecatai/math";import{COLOR_PALETTE as Ate,CODES as L_,shouldResizeFromCenter as __,shouldMaintainAspectRatio as xp,shouldRotateWithDiscreteAngle as D_,isArrowKey as Hf,KEYS as fe,APP_NAME as Lte,CURSOR_TYPE as Ft,DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT as _te,DEFAULT_VERTICAL_ALIGN as R_,DRAGGING_THRESHOLD as N_,ELEMENT_SHIFT_TRANSLATE_AMOUNT as Dte,ELEMENT_TRANSLATE_AMOUNT as B_,EVENT as Be,FRAME_STYLE as Pn,IMAGE_MIME_TYPES as Rte,IMAGE_RENDER_TIMEOUT as Nte,LINE_CONFIRM_THRESHOLD as Pv,MAX_ALLOWED_FILE_BYTES as F_,MIME_TYPES as qr,MQ_RIGHT_SIDEBAR_MIN_WIDTH as Bte,POINTER_BUTTON as Ra,ROUNDNESS as Gf,SCROLL_TIMEOUT as Fte,TAP_TWICE_TIMEOUT as Ote,TEXT_TO_CENTER_SNAP_THRESHOLD as zte,THEME as $f,TOUCH_CTX_MENU_TIMEOUT as Ute,VERTICAL_ALIGN as Hte,YOUTUBE_STATES as Vf,ZOOM_STEP as Gte,POINTER_EVENTS as Vi,TOOL_TYPE as Jr,supportsResizeObserver as $te,DEFAULT_COLLISION_THRESHOLD as O_,DEFAULT_TEXT_ALIGN as Vte,ARROW_TYPE as Wi,DEFAULT_REDUCED_GLOBAL_ALPHA as z_,isLocalLink as Wte,normalizeLink as Av,toValidURL as Kte,getGridPoint as Ao,getLineHeight as U_,debounce as H_,distance as cd,getFontString as Lv,getNearestScrollableContainer as Yte,isInputLike as G_,isToolIcon as Xte,isWritableElement as yp,sceneCoordsToViewportCoords as wp,tupleToCoors as _v,viewportCoordsToSceneCoords as At,wrapEvent as jte,updateObject as Dv,updateActiveTool as Qr,isTransparent as Zte,easeToValuesRAF as qte,muteFSAbortError as Jte,isTestEnv as kD,isDevEnv as CD,easeOut as Qte,updateStable as vp,addEventListener as Vt,normalizeEOL as eoe,getDateTime as $_,isShallowEqual as V_,arrayToMap as Ep,applyDarkModeFilter as toe,randomInteger as ooe,CLASSES as Rv,Emitter as js,MINIMUM_ARROW_SIZE as noe,DOUBLE_TAP_POSITION_THRESHOLD as roe,BIND_MODE_TIMEOUT as aoe,invariant as ea,getFeatureFlag as Na,createUserAgentDescriptor as SD,getFormFactor as ioe,deriveStylesPanelMode as Jf,isIOS as soe,isBrave as loe,isSafari as coe,loadDesktopUIModePreference as doe,setDesktopUIMode as moe,isSelectionLikeTool as Wf,oneOf as W_}from"@orangecatai/common";import{getObservedAppState as poe,getCommonBounds as dd,getElementAbsoluteCoords as Kf,bindOrUnbindBindingElements as K_,fixBindingsAfterDeletion as uoe,getHoveredElementForBinding as vr,isBindingEnabled as Ip,shouldEnableBindingForPointerEvent as goe,updateBoundElements as Yf,LinearElementEditor as st,newElementWith as ta,newFrameElement as Nv,newFreeDrawElement as hoe,newEmbeddableElement as Y_,newMagicFrameElement as X_,newIframeElement as foe,newArrowElement as boe,newElement as xoe,newImageElement as Bv,newVideoElement as j_,newLinearElement as yoe,newTextElement as Z_,refreshTextDimensions as woe,deepCopyElement as q_,duplicateElements as Fv,hasBoundTextElement as J_,isArrowElement as md,isBindingElement as oa,isBindingElementType as voe,isBoundToContainer as Ov,isFrameLikeElement as Io,isImageElement as Ki,isVideoElement as Eoe,isEmbeddableElement as Ba,isInitializedImageElement as Tp,isLinearElement as Jo,isLinearElementType as Ioe,isUsingAdaptiveRadius as Toe,isIframeElement as pd,isIframeLikeElement as zv,isMagicFrameElement as Uv,isTextBindableContainer as Q_,isElbowArrow as un,isFlowchartNodeElement as koe,isBindableElement as Hv,isTextElement as Er,getNormalizedDimensions as Coe,isElementCompletelyInViewport as Gv,isElementInViewport as $v,isInvisiblySmallElement as eD,getCornerRadius as Soe,isPathALoop as tD,createSrcDoc as oD,embeddableURLValidator as Vv,maybeParseEmbedSrc as Moe,getEmbedLink as Xf,getInitializedImageElements as Poe,normalizeSVG as nD,updateImageCache as Aoe,getBoundTextElement as Wv,getContainerCenter as Kv,getContainerElement as rD,isValidTextContainer as Loe,redrawTextBoundingBox as _oe,hasBoundingBox as Doe,getFrameChildren as Yv,isCursorInFrame as aD,addElementsToFrame as Xv,replaceAllElementsInFrame as Roe,removeElementsFromFrame as Noe,getElementsInResizingFrame as jv,getElementsInNewFrame as Boe,getContainingFrame as jf,orderFramesToBack as Foe,elementOverlapsWithFrame as Ooe,updateFrameMembershipOfSelectedElements as iD,isElementInFrame as sD,getFrameLikeTitle as zoe,getElementsOverlappingFrame as Uoe,filterElementsEligibleAsFrameChildren as Hoe,hitElementBoundText as Goe,hitElementBoundingBoxOnly as $oe,hitElementItself as kp,getVisibleSceneBounds as Voe,FlowChartCreator as Woe,FlowChartNavigator as Koe,getLinkDirectionFromKey as lD,cropElement as Yoe,wrapText as Xoe,isElementLink as Zv,parseElementLinkFromURL as joe,isMeasureTextSupported as Zoe,normalizeText as qoe,measureText as cD,getLineHeightInPx as Joe,getApproxMinLineWidth as Qoe,getApproxMinLineHeight as ene,getMinTextElementWidth as tne,ShapeCache as Cp,getRenderOpacity as dD,editGroupForSelectedElement as one,getElementsInGroup as Zs,getSelectedGroupIdForElement as nne,getSelectedGroupIds as rne,isElementInGroup as mD,isSelectedViaGroup as ane,selectGroupsForSelectedElements as or,syncInvalidIndices as MD,syncMovedIndices as pD,excludeElementsInFramesFromSelection as ine,getSelectionStateForElements as sne,makeNextSelectedElementIds as gt,getResizeOffsetXY as lne,getResizeArrowDirection as cne,transformElements as dne,getCursorForResizingElement as uD,getElementWithTransformHandleType as gD,getTransformHandleTypeFromCoords as hD,dragNewElement as fD,dragSelectedElements as mne,getDragOffsetXY as pne,isNonDeletedElement as bD,Scene as xD,Store as une,CaptureUpdateAction as Lo,hitElementBoundingBox as gne,isLineElement as qv,isSimpleArrow as Jv,StoreDelta as yD,positionElementsOnGrid as Qv,calculateFixedPointForNonElbowArrowBinding as wD,bindOrUnbindBindingElement as hne,mutateElement as Zf,getElementBounds as vD,doBoundsIntersect as fne,isPointInElement as bne,maxBindingDistance_simple as eE,convertToExcalidrawElements as ED,getSnapOutlineMidPoint as tE,handleFocusPointDrag as xne,handleFocusPointHover as yne,handleFocusPointPointerDown as wne,handleFocusPointPointerUp as vne,maybeHandleArrowPointlikeDrag as qf,getUncroppedWidthAndHeight as Ene}from"@orangecatai/element";import{KEYS as r0,MOBILE_ACTION_BUTTON_BG as QR,updateActiveTool as e8}from"@orangecatai/common";import{getNonDeletedElements as a0}from"@orangecatai/element";import{fixBindingsAfterDeletion as t8}from"@orangecatai/element";import{LinearElementEditor as pT}from"@orangecatai/element";import{newElementWith as wu}from"@orangecatai/element";import{getContainerElement as uT}from"@orangecatai/element";import{isBoundToContainer as xu,isElbowArrow as o8,isFrameLikeElement as n8}from"@orangecatai/element";import{getFrameChildren as r8}from"@orangecatai/element";import{getElementsInGroup as i0,selectGroupsForSelectedElements as a8}from"@orangecatai/element";import{CaptureUpdateAction as yu}from"@orangecatai/element";import{isDevEnv as VR}from"@orangecatai/common";import{atom as Ze,createStore as HR}from"jotai";import{createIsolation as GR}from"jotai-scope";var g2=GR();var{useAtom:Ee,useSetAtom:Sr,useAtomValue:dl,useStore:Hae}=g2,h2=g2.Provider,Yt=HR();var $R=VE({"./locales/ar-SA.json":()=>import("./locales/ar-SA-NXDWD63E.js"),"./locales/az-AZ.json":()=>import("./locales/az-AZ-MXSORGZV.js"),"./locales/bg-BG.json":()=>import("./locales/bg-BG-O6MV2KSF.js"),"./locales/bn-BD.json":()=>import("./locales/bn-BD-T2VJNT7N.js"),"./locales/bn-IN.json":()=>import("./locales/bn-IN-MMW2ORAC.js"),"./locales/ca-ES.json":()=>import("./locales/ca-ES-MKBCGNOG.js"),"./locales/cs-CZ.json":()=>import("./locales/cs-CZ-V77HGUP7.js"),"./locales/da-DK.json":()=>import("./locales/da-DK-I5RFNTM4.js"),"./locales/de-CH.json":()=>import("./locales/de-CH-WLRDEVBV.js"),"./locales/de-DE.json":()=>import("./locales/de-DE-DTI4WUSC.js"),"./locales/el-GR.json":()=>import("./locales/el-GR-ZXDJ2OS4.js"),"./locales/en.json":()=>import("./locales/en-ZZURI326.js"),"./locales/es-ES.json":()=>import("./locales/es-ES-DYQHAD43.js"),"./locales/eu-ES.json":()=>import("./locales/eu-ES-QDSYU5Y3.js"),"./locales/fa-IR.json":()=>import("./locales/fa-IR-26LZG4PM.js"),"./locales/fi-FI.json":()=>import("./locales/fi-FI-6YS4KDE4.js"),"./locales/fr-FR.json":()=>import("./locales/fr-FR-BRLLPTZC.js"),"./locales/gl-ES.json":()=>import("./locales/gl-ES-OKUZTLYG.js"),"./locales/he-IL.json":()=>import("./locales/he-IL-26MGYIU7.js"),"./locales/hi-IN.json":()=>import("./locales/hi-IN-Q4ZOGTP2.js"),"./locales/hu-HU.json":()=>import("./locales/hu-HU-P2OXPSN5.js"),"./locales/id-ID.json":()=>import("./locales/id-ID-2EIKXYN6.js"),"./locales/it-IT.json":()=>import("./locales/it-IT-4CFKVXI2.js"),"./locales/ja-JP.json":()=>import("./locales/ja-JP-MAND2Z4V.js"),"./locales/kaa.json":()=>import("./locales/kaa-HQRTCXTJ.js"),"./locales/kab-KAB.json":()=>import("./locales/kab-KAB-JKIKKTGH.js"),"./locales/kk-KZ.json":()=>import("./locales/kk-KZ-HXQ63ZFC.js"),"./locales/km-KH.json":()=>import("./locales/km-KH-PKL3LSGX.js"),"./locales/ko-KR.json":()=>import("./locales/ko-KR-KXLREZX3.js"),"./locales/ku-TR.json":()=>import("./locales/ku-TR-MJ4IER3X.js"),"./locales/lt-LT.json":()=>import("./locales/lt-LT-H6WFQ6FJ.js"),"./locales/lv-LV.json":()=>import("./locales/lv-LV-GOCK6SJW.js"),"./locales/mr-IN.json":()=>import("./locales/mr-IN-IXVLDMEQ.js"),"./locales/my-MM.json":()=>import("./locales/my-MM-YG6MYTTD.js"),"./locales/nb-NO.json":()=>import("./locales/nb-NO-XGWJISD2.js"),"./locales/nl-NL.json":()=>import("./locales/nl-NL-XVDVCPNC.js"),"./locales/nn-NO.json":()=>import("./locales/nn-NO-EMX5MJX5.js"),"./locales/oc-FR.json":()=>import("./locales/oc-FR-ROEINTVO.js"),"./locales/pa-IN.json":()=>import("./locales/pa-IN-ZYN6SUDY.js"),"./locales/percentages.json":()=>import("./locales/percentages-5DKR754L.js"),"./locales/pl-PL.json":()=>import("./locales/pl-PL-6VTG7PHC.js"),"./locales/pt-BR.json":()=>import("./locales/pt-BR-5YFKRR5G.js"),"./locales/pt-PT.json":()=>import("./locales/pt-PT-GEIXXZ67.js"),"./locales/ro-RO.json":()=>import("./locales/ro-RO-E2P6TFZI.js"),"./locales/ru-RU.json":()=>import("./locales/ru-RU-YBIIY43T.js"),"./locales/si-LK.json":()=>import("./locales/si-LK-673C2CI2.js"),"./locales/sk-SK.json":()=>import("./locales/sk-SK-CKZHQ4AP.js"),"./locales/sl-SI.json":()=>import("./locales/sl-SI-557H2GWM.js"),"./locales/sv-SE.json":()=>import("./locales/sv-SE-XOPKKDWS.js"),"./locales/ta-IN.json":()=>import("./locales/ta-IN-XBH7DQI3.js"),"./locales/th-TH.json":()=>import("./locales/th-TH-TOCWH3R4.js"),"./locales/tr-TR.json":()=>import("./locales/tr-TR-GXW6CYY5.js"),"./locales/uk-UA.json":()=>import("./locales/uk-UA-IJKTNUDG.js"),"./locales/uz-UZ.json":()=>import("./locales/uz-UZ-TBZZEA4V.js"),"./locales/vi-VN.json":()=>import("./locales/vi-VN-MULSGNVB.js"),"./locales/zh-CN.json":()=>import("./locales/zh-CN-MVX3E32U.js"),"./locales/zh-HK.json":()=>import("./locales/zh-HK-JNU5RLIE.js"),"./locales/zh-TW.json":()=>import("./locales/zh-TW-LENVCA6T.js")});var WR=85,Mr={code:"en",label:"English"},pl=[Mr,...[{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",rtl:!0},{code:"bg-BG",label:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"},{code:"ca-ES",label:"Catal\xE0"},{code:"cs-CZ",label:"\u010Cesky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"},{code:"es-ES",label:"Espa\xF1ol"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Fran\xE7ais"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"\u05E2\u05D1\u05E8\u05D9\u05EA",rtl:!0},{code:"hi-IN",label:"\u0939\u093F\u0928\u094D\u0926\u0940"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4"},{code:"ku-TR",label:"Kurd\xEE"},{code:"lt-LT",label:"Lietuvi\u0173"},{code:"lv-LV",label:"Latvie\u0161u"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokm\xE5l"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Portugu\xEAs Brasileiro"},{code:"pt-PT",label:"Portugu\xEAs"},{code:"ro-RO",label:"Rom\xE2n\u0103"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},{code:"sk-SK",label:"Sloven\u010Dina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Sloven\u0161\u010Dina"},{code:"tr-TR",label:"T\xFCrk\xE7e"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"},{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t"},{code:"mr-IN",label:"\u092E\u0930\u093E\u0920\u0940"}].filter(e=>KE[e.code]>=WR).sort((e,t)=>e.label>t.label?1:-1)],Qp="__test__";VR()&&pl.unshift({code:Qp,label:"test language"},{code:`${Qp}.rtl`,label:"\u202Atest language (rtl)\u202C",rtl:!0});var ml=Mr,Jp={},eu=async e=>{if(ml=e,document.documentElement.dir=ml.rtl?"rtl":"ltr",document.documentElement.lang=ml.code,e.code.startsWith(Qp))Jp={};else try{Jp=await $R(`./locales/${ml.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),Jp=kb}Yt.set(b2,e.code)},la=()=>ml,f2=(e,t)=>{for(let o=0;o<t.length;++o){let n=t[o];if(e[n]===void 0)return;e=e[n]}if(typeof e=="string")return e},b=(e,t,o)=>{if(ml.code.startsWith(Qp))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let n=e.split("."),r=f2(Jp,n)||f2(kb,n)||o;if(r===void 0){let a=`Can't find translation for ${e}`;if(C.PROD)return console.warn(a),"";throw new Error(a)}if(t)for(let a in t)r=r.replace(`{{${a}}}`,String(t[a]));return r},b2=Ze(Mr.code),bt=()=>{let e=dl(b2);return{t:b,langCode:e}};import KR from"clsx";import go from"react";import{THEME as YR}from"@orangecatai/common";import{Fragment as xt,jsx as x,jsxs as V}from"react/jsx-runtime";var lr=e=>"var(--icon-fill-color)",x2=e=>e===YR.LIGHT?"#fff":"#1e1e1e",N=(e,t=512)=>{let{width:o=512,height:n=o,mirror:r,style:a,...i}=typeof t=="number"?{width:t}:t;return x("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${o} ${n}`,className:KR({"rtl-mirror":r}),style:a,...i,children:typeof e=="string"?x("path",{fill:"currentColor",d:e}):e})},te={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},ze={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},oie=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:3,y:8,width:18,height:4,rx:1}),x("line",{x1:12,y1:8,x2:12,y2:21}),x("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),x("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"})]}),te),tu=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),x("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),x("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),x("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),x("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),te),ou=N(V("svg",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),te),y2=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"1"}),x("circle",{cx:"12",cy:"19",r:"1"}),x("circle",{cx:"12",cy:"5",r:"1"})]}),te),w2=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),x("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),x("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]}),te),v2=N(V("svg",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),x("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),x("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),te),Db=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M6.5 9.5l3.5 -3"}),x("path",{d:"M14 5.5l3 1.5"}),x("path",{d:"M18.5 10l-2.5 7"}),x("path",{d:"M13.5 17.5l-7 -5"})]}),te),is=N(V("g",{children:[x("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"}),x("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"}),x("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:x("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"})}),x("g",{mask:"url(#UnlockedIcon)",children:x("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"})})]}),ze),ul=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),x("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"})]}),ze),E2=N(x("g",{fill:"currentColor",children:x("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3"})}),{width:24,height:24}),I2=N(V(xt,{children:[x("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"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),x("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"}),T2=N(V(xt,{children:[x("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"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),x("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"}),k2=N(V(xt,{children:[x("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"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),x("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"}),nie=N(x("g",{fill:"currentColor",children:x("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"}),ss=N(V("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),Ya=N(V("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,children:[x("path",{d:"M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255"}),x("path",{d:"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 17c0 1.42 .316 2.805 1 4"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),gl=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),te),hl=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"})]}),te),fl=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"})]}),te),nu=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),x("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),x("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),te),bl=N(x("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),ze),C2=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),x("path",{d:"M16 7h4"}),x("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),te),Pr=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("path",{d:"m11.25 5.417 3.333 3.333"})]}),ze),Ar=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),x("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),x("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),x("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),x("polyline",{points:"5 20 11 4 13 4 20 20"})]}),te),S2=N(V("g",{stroke:"currentColor",strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 7v-2h13v2"}),x("path",{d:"M10 5v14"}),x("path",{d:"M12 19h-4"}),x("path",{d:"M15 13v-1h6v1"}),x("path",{d:"M18 12v7"}),x("path",{d:"M17 19h2"})]}),te),xl=N(V("g",{strokeWidth:"1.25",children:[x("path",{d:"M12.5 6.667h.01"}),x("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"}),x("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),x("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),ze),M2=N(V("g",{strokeWidth:"1.25",children:[x("path",{d:"M15 10l4.553-2.843A1 1 0 0 1 21 8.059v7.882a1 1 0 0 1-1.447.902L15 14"}),x("rect",{x:"3",y:"6",width:"12",height:"12",rx:"2"})]}),ze),ru=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M18 13.3l-6.3 -6.3"})]}),te),Rb=N(x("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),ze),Nb=N(x("path",{d:"M5 10h10",strokeWidth:"1.25"}),ze),P2=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M21 21l-6 -6"}),x("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"}),x("path",{d:"M3 4v4h4"})]}),te),Co=N(x("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"}),ze),yl=N(V("g",{strokeWidth:"1.5",children:[x("polyline",{points:"12 16 18 10 12 4"}),x("polyline",{points:"8 4 2 10 8 16"})]}),ze),Md=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("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"})]}),ze),Pd=N(x("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"}),ze),Ad=N(x("g",{stroke:"currentColor",strokeLinejoin:"round",children:x("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"})}),{...ze,strokeWidth:1.5}),A2=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),x("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),x("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),te),ls=N(x("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"}),ze),wl=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"}),x("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),L2=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"}),x("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),Bb=N(x("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"}),ze),au=N(x("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"}),ze),_2=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("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"})]}),ze),D2=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),x("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),te),iu=N(x("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Ld=N(V("g",{strokeWidth:"1.25",children:[x("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"}),x("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"})]}),ze),R2=N("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}),N2=N("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}),vl=N(x("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"}),ze),rie=N("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}),aie=N("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"),su=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),x("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"}),x("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"})]}),te),B2=N(x("g",{strokeWidth:1.5,children:x("path",{d:"M6 18l12 -12"})}),te),lu=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 8h.01"}),x("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),x("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),x("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),x("path",{d:"M19 16v6"}),x("path",{d:"M22 19l-3 3l-3 -3"})]}),te),F2=N("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}),iie=N("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}),sie=N("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}),O2=N("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"),lie=N("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"),Fb=N(x("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"}),ze),Ob=N(x("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"}),ze),z2=N("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}),U2=N(x("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"}),ze),cie=N("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"),die=N("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}),mie=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M12 14v-11"}),x("path",{d:"M9 6l3 -3l3 3"})]}),te),pie=N(V(xt,{children:[x("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"}),x("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}),uie=N(x("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}),H2=V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 10l0 10"}),x("path",{d:"M12 10l4 4"}),x("path",{d:"M12 10l-4 4"}),x("path",{d:"M4 4l16 0"})]}),G2=V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 5l0 14"}),x("path",{d:"M16 9l-4 -4"}),x("path",{d:"M8 9l4 -4"})]}),zb=N(G2,te),Ub=N(G2,{...te,style:{transform:"rotate(180deg)"}}),Hb=N(H2,te),Gb=N(H2,{...te,style:{transform:"rotate(180deg)"}}),$b=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Vb=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Wb=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Kb=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),$2=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),V2=N(V(xt,{children:[V("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Yb=N(V("g",{stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),x("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),ze),Xb=N(V("g",{stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),x("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),x("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"})]}),ze),cu=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"9",cy:"7",r:"4"}),x("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),x("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),x("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),te),gie=N("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"),W2=N("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"),Nn=N(V(xt,{children:[x("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:x("path",{d:"M15 5 5 15M5 5l10 10"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),hie=N("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}),fie=N("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}),bie=N("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}),jb=go.memo(({theme:e})=>N(V(xt,{children:[x("path",{d:"M25 26H111V111H25",fill:lr(e)}),x("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:lr(e),strokeWidth:"2"}),x("path",{d:"M100 100H160V160H100",fill:lr(e)}),x("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:lr(e),strokeWidth:"2"}),V("g",{fill:x2(e),stroke:lr(e),strokeWidth:"6",children:[x("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),Zb=go.memo(({theme:e})=>N(V(xt,{children:[x("path",{d:"M25 26H111V111H25",fill:lr(e)}),x("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:lr(e),strokeWidth:"2"}),x("path",{d:"M100 100H160V160H100",fill:lr(e)}),x("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:lr(e),strokeWidth:"2"}),V("g",{fill:x2(e),stroke:lr(e),strokeWidth:"6",children:[x("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),x("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),K2=N(x("g",{strokeWidth:1.25,children:x("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"})}),ze),Y2=N(V(xt,{children:[x("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"}),x("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:x("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"})}),x("g",{mask:"url(#FillHachureIcon)",children:x("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"})})]}),ze),X2=N(V(xt,{children:[V("g",{clipPath:"url(#a)",children:[x("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"}),x("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:x("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"})}),x("g",{mask:"url(#FillCrossHatchIcon)",children:x("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"})})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),j2=N(V(xt,{children:[x("g",{clipPath:"url(#a)",children:x("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"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...ze,fill:"currentColor"}),qb=N(x(xt,{children:x("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ze),Z2=N(x("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),ze),q2=N(x("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),ze),xie=go.memo(({theme:e})=>N(x("path",{d:"M6 10H34",stroke:lr(e),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})),J2=N(V("g",{strokeWidth:"2",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12h2"}),x("path",{d:"M17 12h2"}),x("path",{d:"M11 12h2"})]}),te),Q2=N(V("g",{strokeWidth:"2",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 12v.01"}),x("path",{d:"M8 12v.01"}),x("path",{d:"M12 12v.01"}),x("path",{d:"M16 12v.01"}),x("path",{d:"M20 12v.01"})]}),te),eI=N(x("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"}),ze),tI=N(x("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"}),ze),oI=N(x("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"}),ze),nI=N(V("svg",{strokeWidth:"1.5",children:[x("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"}),x("path",{d:"M13.3333 3.33331V3.34331"}),x("path",{d:"M16.6667 3.33331V3.34331"}),x("path",{d:"M16.6667 6.66669V6.67669"}),x("path",{d:"M16.6667 10V10.01"}),x("path",{d:"M3.33334 13.3333V13.3433"}),x("path",{d:"M16.6667 13.3333V13.3433"}),x("path",{d:"M3.33334 16.6667V16.6767"}),x("path",{d:"M6.66666 16.6667V16.6767"}),x("path",{d:"M10 16.6667V16.6767"}),x("path",{d:"M13.3333 16.6667V16.6767"}),x("path",{d:"M16.6667 16.6667V16.6767"})]}),ze),rI=N(V("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),x("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),x("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),x("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),x("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),x("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),x("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),x("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),x("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),x("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),x("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),x("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),te),aI=go.memo(({flip:e=!1})=>N(V("g",{transform:e?"translate(24, 0) scale(-1, 1)":"",stroke:"currentColor",opacity:.3,strokeWidth:2,children:[x("path",{d:"M12 12l-9 0"}),x("path",{d:"M21 9l-6 6"}),x("path",{d:"M21 15l-6 -6"})]}),te)),iI=go.memo(({flip:e=!1})=>N(V("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[x("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),x("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),sI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[x("path",{d:"M32 10L6 10",strokeWidth:2}),x("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),lI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[x("path",{d:"M26 10L6 10"}),x("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),cI=go.memo(({flip:e=!1})=>N(x("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:x("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),dI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[x("path",{d:"M32 10L6 10",strokeWidth:2}),x("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),mI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[x("path",{d:"M6,9.5H27"}),x("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),pI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{d:"M6,9.5H20"}),x("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),uI=go.memo(({flip:e=!1})=>N(V("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{d:"M6,9.5H20"}),x("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),gI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),hI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),fI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),bI=N(V(xt,{children:[x("g",{clipPath:"url(#a)",children:x("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"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),xI=N(V(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),yI=N(V(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),wI=N(x(xt,{children:x("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"})}),ze),cs=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 7v-2h13v2"}),x("path",{d:"M10 5v14"}),x("path",{d:"M12 19h-4"}),x("path",{d:"M15 13v-1h6v1"}),x("path",{d:"M18 12v7"}),x("path",{d:"M17 19h2"})]}),te),vI=N(x(xt,{children:V("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 12h10"}),x("path",{d:"M7 5v14"}),x("path",{d:"M17 5v14"}),x("path",{d:"M15 19h4"}),x("path",{d:"M15 5h4"}),x("path",{d:"M5 19h4"}),x("path",{d:"M5 5h4"})]})}),te),_d=N(x(xt,{children:x("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:x("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"})})}),ze),Jb=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 8l-4 4l4 4"}),x("path",{d:"M17 8l4 4l-4 4"}),x("path",{d:"M14 4l-4 16"})]}),te),du=Jb,EI=N(V("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),x("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),te),II=N(V("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),x("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),te),TI=N(V("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),x("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),te),kI=go.memo(({theme:e})=>N(V("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),x("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),te)),CI=go.memo(({theme:e})=>N(V("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),x("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),te)),SI=go.memo(({theme:e})=>N(V("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),x("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),x("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),te)),mu=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M21 19h-18l9 -15"}),x("path",{d:"M20.615 15.171h.015"}),x("path",{d:"M19.515 11.771h.015"}),x("path",{d:"M17.715 8.671h.015"}),x("path",{d:"M15.415 5.971h.015"})]}),te),MI=N(x("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}),yie=N(x("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"})),El=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),x("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),x("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),x("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"})]}),te),Qb=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),x("path",{d:"M7 11l5 5l5 -5"}),x("path",{d:"M12 4l0 12"})]}),te),Il=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),te),PI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M9.15 14.85l8.85 -10.85"}),x("path",{d:"M6 4l8.85 10.85"})]}),te),AI=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),x("path",{d:"M12 17l0 .01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),wie=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 4v16l13 -8z"})]}),te),vie=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"})]}),te),LI=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12l5 5l10 -10"})]}),te),pu=N(V(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M12 9v4"}),x("path",{d:"M12 17h.01"})]}),te),_I=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11 7l6 6"}),x("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"})]}),te),Dd=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 3l-4 7h8z"}),x("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("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"})]}),te),Lr=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 7l16 0"}),x("path",{d:"M4 17l16 0"}),x("path",{d:"M7 4l0 16"}),x("path",{d:"M17 4l0 16"})]}),te),uu=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),x("circle",{cx:"8.5",cy:"8.5",r:"1.5",fill:"currentColor",stroke:"none"}),x("path",{d:"M3 16l5-5c.928-.893 2.072-.893 3 0l5 5"}),x("path",{d:"M14 14l1-1c.928-.893 2.072-.893 3 0l3 3"}),x("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),te),gu=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"3",y:"6",width:"12",height:"12",rx:"2"}),x("path",{d:"M15 10l4.553-2.07A1 1 0 0 1 21 8.87v6.26a1 1 0 0 1-1.447.94L15 14"}),x("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),te),Tl=N(x("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"})),DI=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),x("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]}),te),RI=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 10l-2 1l8 4l8 -4l-2 -1"}),x("path",{d:"M4 15l8 4l8 -4"}),x("path",{d:"M12 4v7"}),x("path",{d:"M15 8l-3 3l-3 -3"})]}),te),Xa=N(V("g",{strokeWidth:"1.25",children:[x("path",{d:"M4.16602 10H15.8327"}),x("path",{d:"M12.5 13.3333L15.8333 10"}),x("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),ze),_r=N(V("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[x("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"}),x("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),ds=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),x("path",{d:"M15 6l3 3"}),x("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"}),x("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"})]}),te),Eie=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),x("path",{d:"M15 6l3 3"}),x("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"}),x("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"})]}),te),Iie=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),x("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),x("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"}),x("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),x("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),x("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"})]}),te),NI=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),x("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),x("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),x("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),te),kl=N(V("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),x("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"})]}),te),BI=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),x("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"}),x("path",{d:"M3 3l18 18"})]}),te),FI=N(V("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("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"}),x("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),x("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),x("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),x("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),te),OI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("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"}),x("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),x("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),x("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),x("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),te),bn=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),x("path",{d:"M21 21l-6 -6"})]}),te),zI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),x("path",{d:"M12 7v5l3 3"}),x("path",{d:"M19 16l-2 3h4l-2 3"})]}),te),UI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 8l0 4l2 2"}),x("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})]}),te),HI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M5 10a7 7 0 0 0 14 0"}),x("path",{d:"M8 21l8 0"}),x("path",{d:"M12 17l0 4"})]}),te),GI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 3l18 18"}),x("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"}),x("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),x("path",{d:"M8 21l8 0"}),x("path",{d:"M12 17l0 4"})]}),te),Rd=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),te),$I=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M12 20v.01"}),x("path",{d:"M16 20v.01"}),x("path",{d:"M8 20v.01"}),x("path",{d:"M4 20v.01"}),x("path",{d:"M4 16v.01"}),x("path",{d:"M4 12v.01"}),x("path",{d:"M4 8v.01"}),x("path",{d:"M4 4v.01"}),x("path",{d:"M8 4v.01"}),x("path",{d:"M12 4v.01"}),x("path",{d:"M16 4v.01"}),x("path",{d:"M20 4v.01"}),x("path",{d:"M20 8v.01"}),x("path",{d:"M20 12v.01"}),x("path",{d:"M20 16v.01"}),x("path",{d:"M20 20v.01"})]}),te),VI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 3v18"}),x("path",{d:"M19 21v-18"}),x("path",{d:"M5 7h14"}),x("path",{d:"M5 15h14"}),x("path",{d:"M8 13v4"}),x("path",{d:"M11 13v4"}),x("path",{d:"M16 13v4"}),x("path",{d:"M14 5v4"}),x("path",{d:"M11 5v4"}),x("path",{d:"M8 5v4"}),x("path",{d:"M3 21h18"})]}),te),WI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 12l18 0"}),x("path",{d:"M7 16l10 0l-10 5l0 -5"}),x("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),te),KI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 3l0 18"}),x("path",{d:"M16 7l0 10l5 0l-5 -10"}),x("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),te),e0=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),x("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"})]}),te),Cl=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),x("path",{d:"M22 22l-3 -3"}),x("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),x("path",{d:"M3 11v-1"}),x("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),x("path",{d:"M10 3h1"}),x("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),te),YI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),x("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),x("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"}),x("path",{d:"M10 15l2 6l2 -6"}),x("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),te),XI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),x("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),x("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),x("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),x("path",{d:"M11 21v-6l3 6v-6"})]}),te),jI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M4 8l5 0"}),x("path",{d:"M15 8l4 0"})]}),te),ZI=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),x("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),x("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),x("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),te),qI=N(V("g",{stroke:"currentColor",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"})]}),{...te,strokeWidth:1.5}),Tie=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M21 12h-13l3 -3"}),x("path",{d:"M11 15l-3 -3"})]}),te),JI=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("path",{d:"M10 9l5 3l-5 3z"})]}),te),QI=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 6h18"}),x("path",{d:"M3 12h18"}),x("path",{d:"M3 18h18"}),x("path",{d:"M6 3v18"}),x("path",{d:"M12 3v18"}),x("path",{d:"M18 3v18"})]}),te),eT=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("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"}),x("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"}),x("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),te),Sl=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 18l12 -12"}),x("path",{d:"M18 10v-4h-4"})]}),te),Ml=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),x("path",{d:"M18 4l3 3l-3 3"})]}),te),Pl=N(V("g",{children:[x("path",{d:"M16,12L20,9L16,6"}),x("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),te),hu=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 9l6 6l6 -6"})]}),te),tT=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 15l6 -6l6 6"})]}),te),oT=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 15l6 -6l6 6"})]}),te),t0=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),x("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),te),fu=N(V("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 7l0 10"}),x("path",{d:"M7 5l10 0"}),x("path",{d:"M7 19l10 0"}),x("path",{d:"M19 7l0 10"})]}),te),kie=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1"}),x("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})]}),te),nT=N(V("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 6l8 0"}),x("path",{d:"M16 6l4 0"}),x("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 12l2 0"}),x("path",{d:"M10 12l10 0"}),x("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 18l11 0"}),x("path",{d:"M19 18l1 0"})]}),te),rT=N(V("g",{strokeWidth:1,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4"})]}),te),aT=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),x("path",{d:"M13.5 6.5l4 4"})]}),te),Cie=N(V("g",{strokeWidth:1,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11 7l-5 5l5 5"}),x("path",{d:"M17 7l-5 5l5 5"})]}),te),iT=N(V("g",{strokeWidth:"1.75",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}),x("path",{d:"M15 4l0 16"})]}),te),Sie=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1"})]}),te),Mie=N(V("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 4l18 0"}),x("path",{d:"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10"}),x("path",{d:"M12 16l0 4"}),x("path",{d:"M9 20l6 0"}),x("path",{d:"M8 12l3 -3l2 2l3 -3"})]}),te),sT=x("div",{style:{width:"1rem",height:"1rem"}}),lT=N(V("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("polyline",{points:"9 6 15 12 9 18"})]}),te),cT=N(V("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 6l8 0"}),x("path",{d:"M16 6l4 0"}),x("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 12l2 0"}),x("path",{d:"M10 12l10 0"}),x("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 18l11 0"}),x("path",{d:"M19 18l1 0"})]}),te);import dT from"clsx";import n0,{useEffect as ZR,useRef as mT,useState as qR}from"react";import{isPromiseLike as JR}from"@orangecatai/common";import XR from"react";import{jsx as o0}from"react/jsx-runtime";var jR=({size:e="1em",circleWidth:t=8,synchronized:o=!1,className:n=""})=>{let a=-(XR.useRef(Date.now()).current%1600);return o0("div",{className:`Spinner ${n}`,children:o0("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":o?`${a}ms`:0},children:o0("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},So=jR;import{jsx as Nd,jsxs as Bd}from"react/jsx-runtime";var xe=n0.forwardRef(({size:e="medium",visible:t=!0,className:o="",...n},r)=>{let{id:a}=St(),i=n0.useRef(null);n0.useImperativeHandle(r,()=>i.current);let s=`ToolIcon_size_${e}`,[l,c]=qR(!1),m=mT(!0),p=async u=>{let g="onClick"in n&&n.onClick?.(u);if(JR(g))try{c(!0),await g}catch(h){if(h instanceof rl)console.warn(h);else throw h}finally{m.current&&c(!1)}};ZR(()=>(m.current=!0,()=>{m.current=!1}),[]);let d=mT(null);if(n.type==="button"||n.type==="icon"||n.type==="submit"){let u=n.type==="icon"?"button":n.type;return Bd("button",{className:dT("ToolIcon_type_button",s,o,t&&!n.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!n.hidden,"ToolIcon--selected":n.selected,"ToolIcon--plain":n.type==="icon"}),style:n.style,"data-testid":n["data-testid"],hidden:n.hidden,title:n.title,"aria-label":n["aria-label"],type:u,onClick:p,ref:i,disabled:l||n.isLoading||!!n.disabled,children:[(n.icon||n.label)&&Bd("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!n.disabled,children:[n.icon||n.label,n.keyBindingLabel&&Nd("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel}),n.isLoading&&Nd(So,{})]}),n.showAriaLabel&&Bd("div",{className:"ToolIcon__label",children:[n["aria-label"]," ",l&&Nd(So,{})]}),n.children]})}return Bd("label",{className:dT("ToolIcon",o),title:n.title,onPointerDown:u=>{d.current=u.pointerType||null,n.onPointerDown?.({pointerType:u.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{d.current=null})},children:[Nd("input",{className:`ToolIcon_type_radio ${s}`,type:"radio",name:n.name,"aria-label":n["aria-label"],"aria-keyshortcuts":n["aria-keyshortcuts"],"data-testid":n["data-testid"],id:`${a}-${n.id}`,onChange:()=>{n.onChange?.({pointerType:d.current})},checked:n.checked,ref:i}),Bd("div",{className:"ToolIcon__icon",children:[n.icon,n.keyBindingLabel&&Nd("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel})]})]})});xe.displayName="ToolButton";var bu=[],Y=e=>(bu=bu.concat(e),e);import{jsx as s8}from"react/jsx-runtime";var i8=(e,t,o)=>{let n=new Set(Me(e.filter(m=>n8(m)),t).map(m=>m.id)),r={},a=o.scene.getNonDeletedElementsMap(),i=new Set;for(let m of n){let p=r8(e,m);for(let d of p)if(!i.has(d.id)){if(xu(d)){let u=uT(d,a);u&&(r[u.id]=!0)}else r[d.id]=!0;i.add(d.id)}}let s=!0,l=e.map(m=>{if(t.selectedElementIds[m.id]){let p=xu(m)?uT(m,a):null;return m.frameId&&n.has(m.frameId)?(s=!1,r[m.id]=!0,m):p?.frameId&&n.has(p?.frameId)?m:(m.boundElements&&m.boundElements.forEach(d=>{let u=o.scene.getNonDeletedElementsMap().get(d.id);u&&o8(u)&&o.scene.mutateElement(u,{startBinding:m.id===u.startBinding?.elementId?null:u.startBinding,endBinding:m.id===u.endBinding?.elementId?null:u.endBinding})}),wu(m,{isDeleted:!0}))}return m.frameId&&n.has(m.frameId)?(s=!1,xu(m)||(r[m.id]=!0),wu(m,{frameId:null})):xu(m)&&t.selectedElementIds[m.containerId]?wu(m,{isDeleted:!0}):m}),c=t.editingGroupId;if(s&&t.editingGroupId){let m=i0(l,t.editingGroupId).filter(p=>!p.isDeleted);if(m.length>1)m[0]&&(r[m[0].id]=!0);else{c=null,m[0]&&(r[m[0].id]=!0);let p=m[0];if(p){let d=p.groupIds.findIndex(g=>g===t.editingGroupId),u=p.groupIds[d+1];if(u){let g=i0(l,u).filter(h=>!h.isDeleted);g.length>1&&(c=u,g.forEach(h=>{r[h.id]=!0}))}}}}return{elements:l,appState:{...t,...a8({selectedElementIds:r,editingGroupId:c},l,t,null)}}},gT=(e,t)=>{if(e.editingGroupId){let o=i0(a0(t),e.editingGroupId);if(o.length)return{...e,selectedElementIds:{[o[0].id]:!0}}}return e},Fd=Y({name:"deleteSelectedElements",label:"labels.delete",icon:Co,trackEvent:{category:"element",action:"delete"},perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing){let{elementId:i,selectedPointsIndices:s}=t.selectedLinearElement,l=n.scene.getNonDeletedElementsMap(),c=pT.getElement(i,l);if(!c||s==null)return!1;if(s.length>=c.points.length){let m=e.map(d=>d.id===c.id?wu(d,{isDeleted:!0}):d),p=gT(t,m);return{elements:m,appState:{...p,selectedLinearElement:null},captureUpdate:yu.IMMEDIATELY}}return pT.deletePoints(c,n,s),{elements:e,appState:{...t,selectedLinearElement:{...t.selectedLinearElement,selectedPointsIndices:s?.[0]>0?[s[0]-1]:[0]}},captureUpdate:yu.IMMEDIATELY}}let{elements:r,appState:a}=i8(e,t,n);return t8(r,r.filter(i=>i.isDeleted)),a=gT(a,r),{elements:r,appState:{...a,activeTool:e8(t,{type:n.state.preferredSelectionTool.type}),multiElement:null,newElement:null,activeEmbeddable:null,selectedLinearElement:null},captureUpdate:ft(a0(e),t)?yu.IMMEDIATELY:yu.EVENTUALLY}},keyTest:(e,t,o)=>(e.key===r0.BACKSPACE||e.key===r0.DELETE)&&!e[r0.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ho()==="mobile";return s8(xe,{type:"button",icon:Co,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>o(null),disabled:!ft(a0(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?QR:{}}})}});import{KEYS as Al,CODES as Ll,isDarwin as vu}from"@orangecatai/common";import{moveOneLeft as l8,moveOneRight as c8,moveAllLeft as d8,moveAllRight as m8}from"@orangecatai/element";import{CaptureUpdateAction as Eu}from"@orangecatai/element";import{isDarwin as hT}from"@orangecatai/common";var $=e=>e.replace(/\b(Opt(?:ion)?|Alt)\b/i,hT?b("keys.option"):b("keys.alt")).replace(/\bShift\b/i,b("keys.shift")).replace(/\b(Enter|Return)\b/i,b("keys.enter")).replace(/\b(Ctrl|Cmd|Command|CtrlOrCmd)\b/gi,hT?b("keys.cmd"):b("keys.ctrl")).replace(/\b(Esc(?:ape)?)\b/i,b("keys.escape")).replace(/\b(Space(?:bar)?)\b/i,b("keys.spacebar")).replace(/\b(Del(?:ete)?)\b/i,b("keys.delete"));import{jsx as Iu}from"react/jsx-runtime";var s0=Y({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:Ub,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:l8(e,t,n.scene),appState:t,captureUpdate:Eu.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Al.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ll.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>Iu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.sendBackward")} \u2014 ${$("CtrlOrCmd+[")}`,children:Ub})}),l0=Y({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:zb,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:c8(e,t,n.scene),appState:t,captureUpdate:Eu.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Al.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ll.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>Iu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.bringForward")} \u2014 ${$("CtrlOrCmd+]")}`,children:zb})}),c0=Y({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:Gb,trackEvent:{category:"element"},perform:(e,t)=>({elements:d8(e,t),appState:t,captureUpdate:Eu.IMMEDIATELY}),keyTest:e=>vu?e[Al.CTRL_OR_CMD]&&e.altKey&&e.code===Ll.BRACKET_LEFT:e[Al.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ll.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>Iu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.sendToBack")} \u2014 ${vu?$("CtrlOrCmd+Alt+["):$("CtrlOrCmd+Shift+[")}`,children:Gb})}),d0=Y({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:Hb,trackEvent:{category:"element"},perform:(e,t)=>({elements:m8(e,t),appState:t,captureUpdate:Eu.IMMEDIATELY}),keyTest:e=>vu?e[Al.CTRL_OR_CMD]&&e.altKey&&e.code===Ll.BRACKET_RIGHT:e[Al.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ll.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>Iu("button",{type:"button",className:"zIndexButton",onClick:o=>e(null),title:`${b("labels.bringToFront")} \u2014 ${vu?$("CtrlOrCmd+Alt+]"):$("CtrlOrCmd+Shift+]")}`,children:Hb})});import{getNonDeletedElements as p8}from"@orangecatai/element";import{LinearElementEditor as u8}from"@orangecatai/element";import{isLinearElement as g8,isTextElement as h8}from"@orangecatai/element";import{arrayToMap as f8,KEYS as fT}from"@orangecatai/common";import{selectGroupsForSelectedElements as b8}from"@orangecatai/element";import{CaptureUpdateAction as x8}from"@orangecatai/element";var m0=Y({name:"selectAll",label:"labels.selectAll",icon:$I,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing)return!1;let r=e.filter(a=>!a.isDeleted&&!(h8(a)&&a.containerId)&&!a.locked).reduce((a,i)=>(a[i.id]=!0,a),{});return{appState:{...t,...b8({editingGroupId:null,selectedElementIds:r},p8(e),t,n),selectedLinearElement:Object.keys(r).length===1&&g8(e[0])?new u8(e[0],f8(e)):null},captureUpdate:x8.IMMEDIATELY}},keyTest:e=>e[fT.CTRL_OR_CMD]&&e.key===fT.A});import{DEFAULT_GRID_SIZE as bT,KEYS as xT,MOBILE_ACTION_BUTTON_BG as y8,arrayToMap as yT}from"@orangecatai/common";import{getNonDeletedElements as wT}from"@orangecatai/element";import{LinearElementEditor as w8}from"@orangecatai/element";import{getSelectedElements as v8,getSelectionStateForElements as E8}from"@orangecatai/element";import{syncMovedIndices as I8}from"@orangecatai/element";import{duplicateElements as T8}from"@orangecatai/element";import{CaptureUpdateAction as vT}from"@orangecatai/element";import{jsx as k8}from"react/jsx-runtime";var p0=Y({name:"duplicateSelection",label:"labels.duplicateSelection",icon:Md,trackEvent:{category:"element"},perform:(e,t,o,n)=>{if(t.selectedElementsAreBeingDragged)return!1;if(t.selectedLinearElement?.isEditing)try{let i=w8.duplicateSelectedPoints(t,n.scene);return{elements:e,appState:i,captureUpdate:vT.IMMEDIATELY}}catch{return!1}let{duplicatedElements:r,elementsWithDuplicates:a}=T8({type:"in-place",elements:e,idsOfElementsToDuplicate:yT(v8(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),appState:t,randomizeSeed:!0,overrides:({origElement:i,origIdToDuplicateId:s})=>{let l=i.frameId&&s.get(i.frameId);return{x:i.x+bT/2,y:i.y+bT/2,frameId:l??i.frameId}}});if(n.props.onDuplicate&&a){let i=n.props.onDuplicate(a,e);i&&(a=i)}return{elements:I8(a,yT(r)),appState:{...t,...E8(r,wT(a),t)},captureUpdate:vT.IMMEDIATELY}},keyTest:e=>e[xT.CTRL_OR_CMD]&&e.key===xT.D,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ho()==="mobile";return k8(xe,{type:"button",icon:Md,title:`${b("labels.duplicateSelection")} \u2014 ${$("CtrlOrCmd+D")}`,"aria-label":b("labels.duplicateSelection"),onClick:()=>o(null),disabled:!ft(wT(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?y8:{}}})}});import{pointFrom as wN}from"@orangecatai/math";import{useEffect as N0,useMemo as vN,useRef as B0,useState as EN}from"react";import{ARROW_TYPE as Un,DEFAULT_FONT_FAMILY as IN,DEFAULT_FONT_SIZE as TN,FONT_FAMILY as kN,ROUNDNESS as Fu,STROKE_WIDTH as F0,VERTICAL_ALIGN as Nu,KEYS as zl,randomInteger as CN,arrayToMap as z0,getFontFamilyString as SN,getLineHeight as MN,isTransparent as PN,reduceToCommonValue as AN,invariant as U0,FONT_SIZES as Bu}from"@orangecatai/common";import{canBecomePolygon as LN,getNonDeletedElements as mk}from"@orangecatai/element";import{bindBindingElement as sk,calculateFixedPointForElbowArrowBinding as lk,updateBoundElements as _N}from"@orangecatai/element";import{LinearElementEditor as us}from"@orangecatai/element";import{newElementWith as io}from"@orangecatai/element";import{getBoundTextElement as ni,redrawTextBoundingBox as Zd}from"@orangecatai/element";import{isArrowElement as Ou,isBoundToContainer as DN,isElbowArrow as pk,isLinearElement as O0,isLineElement as ck,isTextElement as rn,isUsingAdaptiveRadius as RN}from"@orangecatai/element";import{hasStrokeColor as NN}from"@orangecatai/element";import{updateElbowArrowPoints as BN,CaptureUpdateAction as so,toggleLinePolygonState as FN}from"@orangecatai/element";import{deriveStylesPanelMode as ON}from"@orangecatai/common";import{isDevEnv as C8}from"@orangecatai/common";var S8=new Set(["command_palette","export"]),Ne=(e,t,o,n)=>{try{if(typeof window>"u"||C.VITE_WORKER_ID||C.VITE_APP_ENABLE_TRACKING!=="true"||!S8.has(e)||C8())return;C.PROD||console.info("trackEvent",{category:e,action:t,label:o,value:n}),window.sa_event&&window.sa_event(t,{category:e,label:o,value:n})}catch(r){console.error("error during analytics",r)}};import L8 from"clsx";import M8 from"clsx";import{forwardRef as P8}from"react";import{jsx as A8}from"react/jsx-runtime";var _l=P8((e,t)=>{let{title:o,className:n,testId:r,active:a,standalone:i,icon:s,onClick:l}=e;return A8("button",{type:"button",ref:t,title:o,"data-testid":r,className:M8(n,{standalone:i,active:a}),onClick:l,style:e.style,children:s},o)});import{Fragment as D8,jsx as u0,jsxs as _8}from"react/jsx-runtime";var Bn=e=>u0(D8,{children:e.options.map(t=>e.type==="button"?u0(_l,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:o=>e.onClick(t.value,o)},t.text):_8("label",{className:L8({active:e.value===t.value}),title:t.text,children:[u0("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))});import{Popover as UT}from"radix-ui";import HT from"clsx";import{useRef as GT,useEffect as M7}from"react";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as OT,COLOR_PALETTE as $T,isColorDark as zT,isWritableElement as P7}from"@orangecatai/common";import{useEffect as O8,useRef as z8}from"react";import{createPortal as U8}from"react-dom";import{EVENT as Za,KEYS as H8,rgbToHex as G8}from"@orangecatai/common";import ET from"react";var g0=ET.createContext(null),qe=()=>ET.useContext(g0);import{useState as R8,useLayoutEffect as IT}from"react";import{THEME as N8}from"@orangecatai/common";var Tu=e=>{let[t,o]=R8(null),n=Je(),{theme:r}=qe(),{container:a}=St();return IT(()=>{t&&(t.className="",t.classList.add("excalidraw",...e?.className?.split(/\s+/)||[]),t.classList.toggle("excalidraw--mobile",n.formFactor==="phone"),t.classList.toggle("theme--dark",r===N8.DARK))},[t,r,n.formFactor,e?.className]),IT(()=>{let i=e?.parentSelector?a?.querySelector(e.parentSelector):document.body;if(!i)return;let s=document.createElement("div");return i.appendChild(s),o(s),()=>{i.removeChild(s)}},[a,e?.parentSelector]),t};import{useEffect as B8}from"react";import{EVENT as ku}from"@orangecatai/common";function Dl(e,t,o){B8(()=>{function n(r){let a=r;if(!e.current)return;let i=o?.(a,e.current);if(i===!0)return;if(i===!1)return t(a);e.current.contains(a.target)||!document.documentElement.contains(a.target)||a.target.closest("[data-radix-portal]")||a.target===document.documentElement&&document.body.style.pointerEvents==="none"||a.target.closest("[data-prevent-outside-click]")||t(a)}return document.addEventListener(ku.POINTER_DOWN,n),document.addEventListener(ku.TOUCH_START,n),()=>{document.removeEventListener(ku.POINTER_DOWN,n),document.removeEventListener(ku.TOUCH_START,n)}},[e,t,o])}import{useRef as F8}from"react";var ja=e=>{let t=F8(e);return Object.assign(t.current,e),t.current};import{jsx as $8}from"react/jsx-runtime";var qa=Ze(null),TT=({onCancel:e,onChange:t,onSelect:o,colorPickerType:n})=>{let r=Tu({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),a=qe(),i=Fn(),s=Mt(),l=Me(i,a),c=ja({app:s,onCancel:e,onChange:t,onSelect:o,selectedElements:l}),{container:m}=St();O8(()=>{let d=p.current;if(!d||!s.canvas||!r)return;let u=!1,g=s.canvas.getContext("2d"),h=({clientX:k,clientY:S})=>{let T=g.getImageData((k-a.offsetLeft)*window.devicePixelRatio,(S-a.offsetTop)*window.devicePixelRatio,1,1).data;return G8(T[0],T[1],T[2])},f=({clientX:k,clientY:S,altKey:T})=>{d.style.top=`${S+20}px`,d.style.left=`${k+20}px`;let A=h({clientX:k,clientY:S});u&&c.onChange(n,A,c.selectedElements,{altKey:T}),d.style.background=A},w=()=>{c.onCancel()},y=(k,S)=>{c.onSelect(k,S)},v=k=>{u=!0,k.stopImmediatePropagation()},E=k=>{u=!1,m?.focus(),k.stopImmediatePropagation(),k.preventDefault(),y(h(k),k)},I=k=>{k.key===H8.ESCAPE&&(k.preventDefault(),k.stopImmediatePropagation(),w())};return r.tabIndex=-1,r.focus(),f({clientX:c.app.lastViewportPosition.x,clientY:c.app.lastViewportPosition.y,altKey:!1}),r.addEventListener(Za.KEYDOWN,I),r.addEventListener(Za.POINTER_DOWN,v),r.addEventListener(Za.POINTER_UP,E),window.addEventListener("pointermove",f,{passive:!0}),window.addEventListener(Za.BLUR,w),()=>{u=!1,r.removeEventListener(Za.KEYDOWN,I),r.removeEventListener(Za.POINTER_DOWN,v),r.removeEventListener(Za.POINTER_UP,E),window.removeEventListener("pointermove",f),window.removeEventListener(Za.BLUR,w)}},[c,s.canvas,r,n,m,a.offsetLeft,a.offsetTop]);let p=z8(null);return Dl(p,()=>{e()},d=>!!d.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),r?U8($8("div",{ref:p,className:"excalidraw-eye-dropper-preview"}),r):null};import{Popover as h0}from"radix-ui";import Y8 from"clsx";import X8 from"react";import{isInteractive as j8}from"@orangecatai/common";import V8 from"react";import W8 from"clsx";import{jsx as K8}from"react/jsx-runtime";var $t=V8.forwardRef(({children:e,padding:t,className:o,style:n},r)=>K8("div",{className:W8("Island",o),style:{"--padding":t,...n},ref:r,children:e}));import{jsx as f0,jsxs as Z8}from"react/jsx-runtime";var ca=X8.forwardRef(({className:e,container:t,children:o,style:n,onClose:r,onKeyDown:a,onFocusOutside:i,onPointerLeave:s,onPointerDownOutside:l,preventAutoFocusOnTouch:c=!1},m)=>{let p=Je(),d=p.formFactor==="phone"&&!p.isLandscape;return f0(h0.Portal,{container:t,children:Z8(h0.Content,{ref:m,className:Y8("focus-visible-none",e),"data-prevent-outside-click":!0,side:d?"bottom":"right",align:d?"center":"start",alignOffset:-16,sideOffset:20,collisionBoundary:t??void 0,style:{zIndex:"var(--zIndex-ui-styles-popup)",marginLeft:p.formFactor==="phone"?"0.5rem":void 0},onPointerLeave:s,onKeyDown:a,onFocusOutside:i,onPointerDownOutside:l,onOpenAutoFocus:u=>{c&&p.isTouchScreen&&u.preventDefault()},onCloseAutoFocus:u=>{u.stopPropagation(),u.preventDefault(),t&&!j8(document.activeElement)&&t.focus(),r()},children:[f0($t,{padding:3,style:n,children:o}),f0(h0.Arrow,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})});import{useState as q8,useCallback as b0}from"react";var Cu=()=>document.querySelector(".excalidraw-wysiwyg"),Su=()=>{let e=Cu();return e?{start:e.selectionStart,end:e.selectionEnd}:null},Od=e=>{setTimeout(()=>{let t=Cu();t&&(t.focus(),e&&(t.selectionStart=e.start,t.selectionEnd=e.end))},0)},zd=(e,t,o,n)=>{t&&n&&n();let r=t&&o?Su():null;e(),t&&o&&Od(r)},kT=()=>{let[e,t]=q8(null),o=b0(()=>{let a=Su();t(a)},[]),n=b0(()=>{setTimeout(()=>{let a=Cu();a&&(a.focus(),e&&(a.selectionStart=e.start,a.selectionEnd=e.end,t(null)))},0)},[e]),r=b0(()=>{t(null)},[]);return{saveCaretPosition:o,restoreCaretPosition:n,clearSavedPosition:r,hasSavedPosition:!!e}},CT=(e=100)=>{let t=Cu();if(t){let o=t.onblur;t.onblur=null,setTimeout(()=>{t.onblur=o},e)}};import Q8 from"clsx";import{useCallback as e7,useEffect as y0,useRef as MT,useState as t7}from"react";import{KEYS as w0,normalizeInputColor as o7}from"@orangecatai/common";import{MAX_CUSTOM_COLORS_USED_IN_CANVAS as J8}from"@orangecatai/common";var Ja=({palette:e,color:t})=>{if(!t)return null;for(let[o,n]of Object.entries(e))if(Array.isArray(n)){let r=n.indexOf(t);if(r>-1)return{colorName:o,shade:r}}else if(n===t)return{colorName:o,shade:null};return null},Ud=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),x0=({color:e,palette:t})=>!Object.values(t).flat().includes(e),ST=(e,t,o)=>{let n={elementBackground:"backgroundColor",elementStroke:"strokeColor"},r=e.filter(i=>{if(i.isDeleted)return!1;let s=i[n[t]];return x0({color:s,palette:o})}),a=new Map;return r.forEach(i=>{let s=i[n[t]];a.has(s)?a.set(s,a.get(s)+1):a.set(s,1)}),[...a.entries()].sort((i,s)=>s[1]-i[1]).map(i=>i[0]).slice(0,J8)},On=Ze(null);import{Fragment as n7,jsx as Hd,jsxs as PT}from"react/jsx-runtime";var AT=({color:e,onChange:t,label:o,colorPickerType:n,placeholder:r})=>{let a=Je(),[i,s]=t7(e),[l,c]=Ee(On);y0(()=>{s(e)},[e]);let m=e7(f=>{let w=f.toLowerCase(),y=o7(w);y&&t(y),s(w)},[t]),p=MT(null),d=MT(null);y0(()=>{p.current&&p.current.focus()},[l]);let[u,g]=Ee(qa),h=/^#[0-9a-f]{6}$/i.test(e)?e:"#000000";return y0(()=>()=>{g(null)},[g]),PT("div",{className:"color-picker__input-label",children:[Hd("input",{type:"color","data-testid":"custom-color-wheel","aria-label":b("labels.colorPicker"),value:h,onChange:f=>t(f.target.value)}),Hd("div",{className:"color-picker__input-hash",children:"#"}),Hd("input",{ref:l==="hex"?p:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:f=>{m(f.target.value)},value:(i||"").replace(/^#/,""),onBlur:()=>{s(e)},tabIndex:-1,onFocus:()=>c("hex"),onKeyDown:f=>{f.key!==w0.TAB&&(f.key===w0.ESCAPE&&d.current?.focus(),f.stopPropagation())},placeholder:r}),a.formFactor!=="phone"&&PT(n7,{children:[Hd("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),Hd("div",{ref:d,className:Q8("excalidraw-eye-dropper-trigger",{selected:u}),onClick:()=>g(f=>f?null:{keepOpenOnAlt:!1,onSelect:w=>t(w),colorPickerType:n}),title:`${b("labels.eyeDropper")} \u2014 ${w0.I.toLocaleUpperCase()} or ${$("Alt")} `,children:_I})]})]})};import T0,{useEffect as k0,useImperativeHandle as I7,useState as T7}from"react";import{EVENT as BT}from"@orangecatai/common";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX as k7,DEFAULT_ELEMENT_STROKE_COLOR_INDEX as C7,KEYS as S7}from"@orangecatai/common";import s7 from"clsx";import{useEffect as l7,useRef as c7}from"react";import{isColorDark as r7}from"@orangecatai/common";import{jsxs as i7}from"react/jsx-runtime";var a7=({color:e,keyLabel:t,isShade:o=!1})=>i7("div",{className:"color-picker__button__hotkey-label",style:{color:r7(e)?"#fff":"#000"},children:[o&&"\u21E7",t]}),Rl=a7;import{jsx as v0,jsxs as d7}from"react/jsx-runtime";var LT=({colors:e,color:t,onChange:o,label:n})=>{let[r,a]=Ee(On),i=c7(null);return l7(()=>{i.current&&i.current.focus()},[t,r]),v0("div",{className:"color-picker-content--default",children:e.map((s,l)=>d7("button",{ref:t===s?i:void 0,tabIndex:-1,type:"button",className:s7("color-picker__button color-picker__button--large has-outline",{active:t===s,"is-transparent":s==="transparent"||!s}),onClick:()=>{o(s),a("custom")},title:s,"aria-label":n,style:{"--swatch-color":s},children:[v0("div",{className:"color-picker__button-outline"}),v0(Rl,{color:s,keyLabel:l+1})]},l))})};import m7 from"clsx";import{useEffect as p7,useRef as u7}from"react";import{jsx as E0,jsxs as h7}from"react/jsx-runtime";var g7=({palette:e,color:t,onChange:o,activeShade:n,showHotKey:r=!0})=>{let a=Ja({color:t,palette:e}),[i,s]=Ee(On),l=u7(null);return p7(()=>{l.current&&i==="baseColors"&&l.current.focus()},[a?.colorName,i]),E0("div",{className:"color-picker-content--default",children:Object.entries(e).map(([c,m],p)=>{let d=(Array.isArray(m)?m[n]:m)||"transparent",u=Ud[p],g=b(`colors.${c.replace(/\d+/,"")}`,null,"");return h7("button",{ref:a?.colorName===c?l:void 0,tabIndex:-1,type:"button",className:m7("color-picker__button color-picker__button--large has-outline",{active:a?.colorName===c,"is-transparent":d==="transparent"||!d}),onClick:()=>{o(d),s("baseColors")},title:`${g}${d.startsWith("#")?` ${d}`:""} \u2014 ${u}`,"aria-label":`${g} \u2014 ${u}`,style:d?{"--swatch-color":d}:void 0,"data-testid":`color-${c}`,children:[E0("div",{className:"color-picker__button-outline"}),r&&E0(Rl,{color:d,keyLabel:u})]},c)})})},_T=g7;import{jsx as b7}from"react/jsx-runtime";var f7=({children:e})=>b7("div",{className:"color-picker__heading",children:e}),Nl=f7;import x7 from"clsx";import{useEffect as y7,useRef as w7}from"react";import{jsx as Gd,jsxs as DT}from"react/jsx-runtime";var RT=({color:e,onChange:t,palette:o,showHotKey:n})=>{let r=Ja({color:e||"transparent",palette:o}),[a,i]=Ee(On),s=w7(null);if(y7(()=>{s.current&&a==="shades"&&s.current.focus()},[r,a]),r){let{colorName:l,shade:c}=r,m=o[l];if(Array.isArray(m))return Gd("div",{className:"color-picker-content--default shades",children:m.map((p,d)=>DT("button",{ref:d===c&&a==="shades"?s:void 0,tabIndex:-1,type:"button",className:x7("color-picker__button color-picker__button--large has-outline",{active:d===c}),"aria-label":"Shade",title:`${l} - ${d+1}`,style:p?{"--swatch-color":p}:void 0,onClick:()=>{t(p),i("shades")},children:[Gd("div",{className:"color-picker__button-outline"}),n&&Gd(Rl,{color:p,keyLabel:d+1,isShade:!0})]},d))})}return DT("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[Gd("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),Gd("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:b("colorPicker.noShades")})]})};import{COLORS_PER_ROW as Bl,COLOR_PALETTE as v7,KEYS as $d}from"@orangecatai/common";var I0=(e,t,o)=>{let n=Math.ceil(o/Bl);switch(t=t??-1,e){case"ArrowLeft":{let r=t-1;return r<0?o-1:r}case"ArrowRight":return(t+1)%o;case"ArrowDown":{let r=t+Bl;return r>=o?t%Bl:r}case"ArrowUp":{let r=t-Bl,a=r<0?Bl*n+r:r;return a>=o?void 0:a}}},E7=({e,colorObj:t,onChange:o,palette:n,customColors:r,setActiveColorPickerSection:a,activeShade:i})=>{if(t?.shade!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let s=Number(e.code.slice(-1))-1;return o(n[t.colorName][s]),a("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&r[Number(e.key)-1])return o(r[Number(e.key)-1]),a("custom"),!0;if(Ud.includes(e.key)){let s=Ud.indexOf(e.key),l=Object.keys(n)[s],c=n[l],m=Array.isArray(c)?c[i]:c;return o(m),a("baseColors"),!0}return!1},NT=({event:e,activeColorPickerSection:t,palette:o,color:n,onChange:r,customColors:a,setActiveColorPickerSection:i,updateData:s,activeShade:l,onEyeDropperToggle:c,onEscape:m})=>{if(e[$d.CTRL_OR_CMD])return!1;if(e.key===$d.ESCAPE)return m(e),!0;if(e.key===$d.ALT)return c(!0),!0;if(e.key===$d.I)return c(),!0;let p=Ja({color:n,palette:o});if(e.key===$d.TAB){let d={custom:!!a.length,baseColors:!0,shades:p?.shade!=null,hex:!0},u=Object.entries(d).reduce((y,[v,E])=>(E&&y.push(v),y),[]),g=u.indexOf(t),h=e.shiftKey?-1:1,f=g+h>u.length-1?0:g+h<0?u.length-1:g+h,w=u[f];return w&&i(w),w==="custom"?r(a[0]):w==="baseColors"&&(Object.entries(o).find(([v,E])=>Array.isArray(E)?E.includes(n):E===n?v:null)||r(v7.black)),e.preventDefault(),e.stopPropagation(),!0}if(E7({e,colorObj:p,onChange:r,palette:o,customColors:a,setActiveColorPickerSection:i,activeShade:l}))return!0;if(t==="shades"&&p){let{shade:d}=p,u=I0(e.key,d,Bl);if(u!==void 0)return r(o[p.colorName][u]),!0}if(t==="baseColors"&&p){let{colorName:d}=p,u=Object.keys(o),g=u.indexOf(d),h=I0(e.key,g,u.length);if(h!==void 0){let f=u[h],w=o[f];return r(Array.isArray(w)?w[l]:w),!0}}if(t==="custom"){let d=n!=null?a.indexOf(n):0,u=I0(e.key,d,a.length);if(u!==void 0){let g=a[u];return r(g),!0}}return!1};import{jsx as Qa,jsxs as Mu}from"react/jsx-runtime";var FT=T0.forwardRef(({color:e,onChange:t,type:o,elements:n,palette:r,updateData:a,children:i,showTitle:s,onEyeDropperToggle:l,onEscape:c,showHotKey:m=!0},p)=>{let d=s?o==="elementStroke"?b("labels.stroke"):o==="elementBackground"?b("labels.background"):null:null,[u]=T0.useState(()=>o==="canvasBackground"?[]:ST(n,o,r)),[g,h]=Ee(On),f=Ja({color:e,palette:r});k0(()=>{if(!g){let E=!!e&&x0({color:e,palette:r}),I=E&&!u.includes(e);h(I?null:E?"custom":f?.shade!=null?"shades":"baseColors")}},[g,e,r,h,f,u]);let[w,y]=T7(f?.shade??(o==="elementBackground"?k7:C7));k0(()=>{f?.shade!=null&&y(f.shade);let E=I=>{I.key===S7.ALT&&l(!1)};return document.addEventListener(BT.KEYUP,E,{capture:!0}),()=>{document.removeEventListener(BT.KEYUP,E,{capture:!0})}},[f,l]);let v=T0.useRef(null);return I7(p,()=>v.current),k0(()=>{v?.current?.focus()},[]),Qa("div",{role:"dialog","aria-modal":"true","aria-label":b("labels.colorPicker"),children:Mu("div",{ref:v,onKeyDown:E=>{NT({event:E,activeColorPickerSection:g,palette:r,color:e,onChange:t,onEyeDropperToggle:l,customColors:u,setActiveColorPickerSection:h,updateData:a,activeShade:w,onEscape:c})&&(E.preventDefault(),E.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[d&&Qa("div",{className:"color-picker__title",children:d}),!!u.length&&Mu("div",{children:[Qa(Nl,{children:b("colorPicker.mostUsedCustomColors")}),Qa(LT,{colors:u,color:e,label:b("colorPicker.mostUsedCustomColors"),onChange:t})]}),Mu("div",{children:[Qa(Nl,{children:b("colorPicker.colors")}),Qa(_T,{color:e,palette:r,onChange:t,activeShade:w,showHotKey:m})]}),Mu("div",{children:[Qa(Nl,{children:b("colorPicker.shades")}),Qa(RT,{color:e,onChange:t,palette:r,showHotKey:m})]}),i]})})});import{jsx as zn,jsxs as C0}from"react/jsx-runtime";var A7=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=$T,updateData:i,getOpenPopup:s,appState:l})=>{let{container:c}=St(),m=ho(),p=m!=="full",d=m==="mobile",[,u]=Ee(On),[g,h]=Ee(qa),f=C0("div",{children:[zn(Nl,{children:b("colorPicker.hexCode")}),zn(AT,{color:t||"",label:n,onChange:v=>{o(v)},colorPickerType:e,placeholder:b("colorPicker.color")})]}),w=GT(null),y=()=>{w.current?.focus()};return zn(ca,{container:c,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!l.editingTextElement,onFocusOutside:v=>{P7(v.target)||y(),v.preventDefault()},onPointerDownOutside:v=>{g&&v.preventDefault()},onClose:()=>{s()===e&&i({openPopup:null}),u(null),l.editingTextElement&&setTimeout(()=>{let v=document.querySelector(".excalidraw-wysiwyg");v&&v.focus()},0)},children:a?zn(FT,{ref:w,palette:a,color:t,onChange:v=>{let E=l.editingTextElement?Su():null;o(v),l.editingTextElement&&E&&Od(E)},onEyeDropperToggle:v=>{h(E=>v?(E=E||{keepOpenOnAlt:!0,onSelect:o,colorPickerType:e},E.keepOpenOnAlt=!0,E):v===!1||E?null:{keepOpenOnAlt:!1,onSelect:o,colorPickerType:e})},onEscape:v=>{g?h(null):i({openPopup:null})},type:e,elements:r,updateData:i,showTitle:p,showHotKey:!d,children:f}):f})},L7=({label:e,color:t,type:o,mode:n="background",onToggle:r,editingTextElement:a})=>{let i=ho(),s=i!=="full",l=i==="mobile",c=m=>{m.preventDefault(),m.stopPropagation(),a&&CT(),r()};return C0(UT.Trigger,{type:"button",className:HT("color-picker__button active-color properties-trigger",{"is-transparent":!t||t==="transparent","has-outline":!t||!zT(t,OT),"compact-sizing":s,"mobile-border":l,"color-picker__button--wide":!s}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:o==="elementStroke"?b("labels.showStroke"):b("labels.showBackground"),"data-openpopup":o,onClick:c,"data-testid":`color-picker-more-${o}`,children:[zn("div",{className:"color-picker__button-outline",children:!t&&B2}),zn("span",{className:"color-picker__more-icon","aria-hidden":"true",children:ou}),s&&t&&n==="stroke"&&zn("div",{className:"color-picker__button-background",children:zn("span",{style:{color:t&&zT(t,OT)?"#fff":"#111"},children:rT})})]})},Vd=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=$T,updateData:i,appState:s})=>{let l=GT(s.openPopup);M7(()=>{l.current=s.openPopup},[s.openPopup]);let m=ho()!=="full";return zn("div",{children:zn("div",{role:"dialog","aria-modal":"true",className:HT("color-picker-container",{"color-picker-container--no-top-picks":m}),children:C0(UT.Root,{open:s.openPopup===e,onOpenChange:p=>{p&&i({openPopup:e})},children:[zn(L7,{color:t,label:n,type:e,mode:e==="elementStroke"?"stroke":"background",editingTextElement:!!s.editingTextElement,onToggle:()=>{s.openPopup===e?i({openPopup:null}):s.openPopup?i({openPopup:e}):i({openPopup:e})}}),s.openPopup===e&&zn(A7,{type:e,color:t,onChange:o,label:n,elements:r,palette:a,updateData:i,getOpenPopup:()=>l.current,appState:s})]})})})};import{Popover as iN}from"radix-ui";import sN from"clsx";import lN,{useCallback as cN,useMemo as dN}from"react";import{FONT_FAMILY as A0}from"@orangecatai/common";import{jsx as _7}from"react/jsx-runtime";var VT=()=>_7("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}});import Z7,{useMemo as oi,useState as q7,useRef as XT,useEffect as jT,useCallback as ZT,useSyncExternalStore as J7}from"react";import{arrayToList as Q7,debounce as eN,FONT_FAMILY as ms,getFontFamilyString as tN}from"@orangecatai/common";import D7 from"clsx";import R7 from"react";import{jsx as N7,jsxs as B7}from"react/jsx-runtime";var Pu=R7.forwardRef(({className:e,placeholder:t,onChange:o},n)=>B7("div",{className:D7("QuickSearch__wrapper",e),children:[bn,N7("input",{ref:n,className:"QuickSearch__input",type:"text",placeholder:t,onChange:r=>o(r.target.value.trim().toLowerCase())})]}));import F7 from"clsx";import{Children as O7}from"react";import{jsx as WT}from"react/jsx-runtime";var Au=({className:e,placeholder:t,children:o})=>{let n=!O7.count(o);return WT("div",{className:F7("ScrollableList__wrapper",e),role:"menu",children:n?WT("div",{className:"empty",children:t}):o})};import{jsx as z7,jsxs as U7}from"react/jsx-runtime";var KT=({children:e,className:t="",style:o,title:n})=>U7("div",{className:`dropdown-menu-group ${t}`,style:o,children:[n&&z7("p",{className:"dropdown-menu-group-title",children:n}),e]}),Wd=KT;KT.displayName="DropdownMenuGroup";import{THEME as X7}from"@orangecatai/common";import{DropdownMenu as j7}from"radix-ui";import H7,{useContext as G7}from"react";import{composeEventHandlers as $7}from"@orangecatai/common";var S0=H7.createContext({}),ei=(e="",t=!1,o=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e} ${t?"dropdown-menu-item--selected":""} ${o?"dropdown-menu-item--hovered":""}`.trim(),Lu=e=>{let t=G7(S0);return $7(e,o=>{t.onSelect?.(o)})};import{jsx as V7}from"react/jsx-runtime";var Kd=({children:e,...t})=>V7("span",{...t,style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...t.style},children:e});import{Fragment as K7,jsx as Yd,jsxs as Y7}from"react/jsx-runtime";var W7=({textStyle:e,icon:t,shortcut:o,children:n,badge:r})=>{let a=Je();return Y7(K7,{children:[t&&Yd("div",{className:"dropdown-menu-item__icon",children:t}),Yd("div",{style:e,className:"dropdown-menu-item__text",children:Yd(Kd,{children:n})}),r&&Yd("div",{className:"dropdown-menu-item__badge",children:r}),o&&a.formFactor!=="phone"&&Yd("div",{className:"dropdown-menu-item__shortcut",children:o})]})},ti=W7;import{jsx as _u}from"react/jsx-runtime";var M0=({icon:e,badge:t,value:o,children:n,shortcut:r,className:a,selected:i,onSelect:s,...l})=>{let c=Lu(s);return _u(j7.Item,{className:"radix-menu-item",onSelect:c,asChild:!0,children:_u("button",{...l,value:o,className:ei(a,i),title:l.title??l["aria-label"],children:_u(ti,{icon:e,shortcut:r,badge:t,children:n})})})};M0.displayName="DropdownMenuItem";var Fl={GREEN:"green",RED:"red",BLUE:"blue"},Du=({type:e=Fl.BLUE,children:t})=>{let{theme:o}=nn(),n={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:o===X7.LIGHT?"1.5px solid white":"none"};switch(e){case Fl.GREEN:Object.assign(n,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case Fl.RED:Object.assign(n,{backgroundColor:"pink",color:"darkred"});break;case Fl.BLUE:default:Object.assign(n,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return _u("div",{className:"DropDownMenuItemBadge",style:n,children:t})};Du.displayName="DropdownMenuItemBadge";M0.Badge=Du;var No=M0;import{KEYS as Ol}from"@orangecatai/common";var YT=({event:e,inputRef:t,hoveredFont:o,filteredFonts:n,onClose:r,onSelect:a,onHover:i})=>{if(!e[Ol.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===Ol.F)return t.current?.focus(),!0;if(e.key===Ol.ESCAPE)return r(),!0;if(e.key===Ol.ENTER)return o?.value&&a(o.value),!0;if(e.key===Ol.ARROW_DOWN)return o?.next?i(o.next.value):n[0]?.value&&i(n[0].value),!0;if(e.key===Ol.ARROW_UP)return o?.prev?i(o.prev.value):n[n.length-1]?.value&&i(n[n.length-1].value),!0};import{jsx as da,jsxs as nN}from"react/jsx-runtime";var oN=e=>{switch(e){case ms.Excalifont:case ms.Virgil:return Pr;case ms.Nunito:case ms.Helvetica:return _d;case ms["Lilita One"]:return vI;case ms["Comic Shanns"]:case ms.Cascadia:return du;default:return _d}},qT=Z7.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:o,onHover:n,onLeave:r,onOpen:a,onClose:i})=>{let{container:s}=St(),l=Mt(),{fonts:c}=l,{showDeprecatedFonts:m}=Dr(),p=ho(),[d,u]=q7(""),g=XT(null),h=J7(Rn.subscribeToCustomFonts,Rn.getCustomFontVersion),f=oi(()=>Array.from(Rn.registered.entries()).filter(([P,{metadata:F}])=>!F.private&&!F.fallback).map(([P,{metadata:F,fontFaces:U}])=>{let B={value:P,icon:oN(P),text:U[0]?.fontFace?.family??"Unknown"};return F.deprecated&&Object.assign(B,{deprecated:F.deprecated,badge:{type:Fl.RED,placeholder:b("fontList.badge.old")}}),B}).sort((P,F)=>P.text.toLowerCase()>F.text.toLowerCase()?1:-1),[h]),w=oi(()=>new Set(c.getSceneFamilies()),[e]),y=oi(()=>f.filter(P=>w.has(P.value)),[f,w]),v=oi(()=>f.filter(P=>!w.has(P.value)&&(m||!P.deprecated)),[f,w,m]),E=oi(()=>Q7([...y,...v].filter(P=>P.text?.toLowerCase().includes(d))),[y,v,d]),I=oi(()=>{let P;return t?P=E.find(F=>F.value===t):e&&(P=E.find(F=>F.value===e)),!P&&d&&(E[0]?.value?n(E[0].value):r()),P},[t,e,d,E,n,r]),k=ZT(P=>{let F=null;if(l.state.editingTextElement){let U=document.querySelector(".excalidraw-wysiwyg");U&&(F={start:U.selectionStart,end:U.selectionEnd})}o(P),l.state.editingTextElement&&F&&setTimeout(()=>{let U=document.querySelector(".excalidraw-wysiwyg");U&&F&&(U.focus(),U.selectionStart=F.start,U.selectionEnd=F.end)},0)},[o,l.state.editingTextElement]),S=ZT(P=>{YT({event:P,inputRef:g,hoveredFont:I,filteredFonts:E,onSelect:k,onHover:n,onClose:i})&&(P.preventDefault(),P.stopPropagation())},[I,E,k,n,i]);jT(()=>(a(),()=>{i()}),[]);let T=oi(()=>E.filter(P=>w.has(P.value)),[E,w]),A=oi(()=>E.filter(P=>!w.has(P.value)),[E,w]),R=({font:P,order:F})=>{let U=XT(null),B=P.value===I?.value,G=P.value===e;return jT(()=>{B&&(F===0?U.current?.scrollIntoView?.({block:"end"}):U.current?.scrollIntoView?.({block:"nearest"}))},[B,F]),da("button",{ref:U,type:"button",value:P.value,className:ei("",G,B),title:P.text,tabIndex:G?0:-1,onClick:_=>{k(Number(_.currentTarget.value))},onMouseMove:()=>{I?.value!==P.value&&n(P.value)},children:da(ti,{icon:P.icon,badge:P.badge&&da(Du,{type:P.badge.type,children:P.badge.placeholder}),textStyle:{fontFamily:tN({fontFamily:P.value})},children:P.text})})},M=[];return T.length&&M.push(da(Wd,{title:b("fontList.sceneFonts"),children:T.map((P,F)=>da(R,{font:P,order:F},P.value))},"group_1")),A.length&&M.push(da(Wd,{title:b("fontList.availableFonts"),children:A.map((P,F)=>da(R,{font:P,order:F+T.length},P.value))},"group_2")),nN(ca,{className:"properties-content",container:s,style:{width:"15rem"},onClose:()=>{i(),l.state.editingTextElement&&setTimeout(()=>{let P=document.querySelector(".excalidraw-wysiwyg");P&&P.focus()},0)},onPointerLeave:r,onKeyDown:S,preventAutoFocusOnTouch:!!l.state.editingTextElement,children:[p==="full"&&da(Pu,{ref:g,placeholder:b("quickSearch.placeholder"),onChange:eN(u,20)}),da(Au,{className:"dropdown-menu fonts manual-hover",placeholder:b("fontList.empty"),children:M.length?M:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as rN}from"radix-ui";import{MOBILE_ACTION_BUTTON_BG as aN}from"@orangecatai/common";import{jsx as P0}from"react/jsx-runtime";var JT=({selectedFontFamily:e,isOpened:t=!1,compactMode:o=!1})=>{let n=Qe(),r=o?{...aN,width:"2rem",height:"2rem"}:{};return P0(rN.Trigger,{asChild:!0,children:P0("div",{"data-openpopup":"fontFamily",className:"properties-trigger",children:P0(_l,{standalone:!0,icon:Ar,title:b("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{n(a=>({openPopup:a.openPopup==="fontFamily"?null:a.openPopup}))},style:{border:"none",...r}})})})};import{jsx as Xd,jsxs as QT}from"react/jsx-runtime";var ek=[{value:A0.Excalifont,icon:Pr,text:b("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:A0.Nunito,icon:_d,text:b("labels.normal"),testId:"font-family-normal"},{value:A0["Comic Shanns"],icon:du,text:b("labels.code"),testId:"font-family-code"}],Lpe=new Set(ek.map(e=>e.value));var tk=lN.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:o,onSelect:n,onHover:r,onLeave:a,onPopupChange:i,compactMode:s=!1})=>{let l=dN(()=>ek,[]),c=cN(m=>{m&&n(m)},[n]);return QT("div",{role:"dialog","aria-modal":"true",className:sN("FontPicker__container",{"FontPicker__container--compact":s}),children:[!s&&Xd("div",{className:"buttonList",children:Xd(Bn,{type:"button",options:l,value:t,onClick:c})}),!s&&Xd(VT,{}),QT(iN.Root,{open:e,onOpenChange:i,children:[Xd(JT,{selectedFontFamily:t,isOpened:e,compactMode:s}),e&&Xd(qT,{selectedFontFamily:t,hoveredFontFamily:o,onSelect:c,onHover:r,onLeave:a,onOpen:()=>i(!0),onClose:()=>i(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as L0}from"radix-ui";import gN from"clsx";import Ru,{useEffect as hN}from"react";import{isArrowKey as fN,KEYS as ma}from"@orangecatai/common";import{jsx as mN}from"react/jsx-runtime";var Rr=({className:e,icon:t,size:o="1em"})=>mN("span",{className:e,style:{width:o,height:"100%",margin:"0 0.5ex 0 0.5ex",display:"inline-flex",lineHeight:0,verticalAlign:"middle",flex:"0 0 auto"},children:t});import{Fragment as uN,jsx as ok,jsxs as nk}from"react/jsx-runtime";var pN=({label:e,open:t,openTrigger:o,children:n,className:r,showCollapsedIcon:a=!0})=>nk(uN,{children:[nk("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:r,onClick:o,children:[e,a&&ok(Rr,{icon:t?tT:hu})]}),t&&ok("div",{style:{display:"flex",flexDirection:"column"},children:n})]}),jd=pN;import{jsx as ps,jsxs as _0}from"react/jsx-runtime";var bN=Ze(!1);function xN({options:e,value:t,label:o,onChange:n,onClose:r,numberOfOptionsToAlwaysShow:a=e.length}){let i=Je(),{container:s}=St(),l=h=>{let f=e.find(w=>w.keyBinding===h.key.toLowerCase());if(!(h.metaKey||h.altKey||h.ctrlKey)&&f)n(f.value),h.preventDefault();else if(h.key===ma.TAB){let w=e.findIndex(v=>v.value===t),y=h.shiftKey?(e.length+w-1)%e.length:(w+1)%e.length;n(e[y].value)}else if(fN(h.key)){let w=la().rtl,y=e.findIndex(v=>v.value===t);if(y!==-1){let v=e.length,E=y;switch(h.key){case(w?ma.ARROW_LEFT:ma.ARROW_RIGHT):E=(y+1)%v;break;case(w?ma.ARROW_RIGHT:ma.ARROW_LEFT):E=(v+y-1)%v;break;case ma.ARROW_DOWN:{E=(y+(a??1))%v;break}case ma.ARROW_UP:{E=(v+y-(a??1))%v;break}}n(e[E].value)}h.preventDefault()}else(h.key===ma.ESCAPE||h.key===ma.ENTER)&&(h.preventDefault(),r());h.nativeEvent.stopImmediatePropagation(),h.stopPropagation()},[c,m]=Ee(bN),p=Ru.useMemo(()=>e.slice(0,a),[e,a]),d=Ru.useMemo(()=>e.slice(a),[e,a]);hN(()=>{p.some(h=>h.value===t)||m(!0)},[t,p,m]);let u=h=>ps("div",{className:"picker-content",children:h.map((f,w)=>_0("button",{type:"button",className:gN("picker-option",{active:t===f.value}),onClick:y=>{n(f.value)},title:`${f.text} ${f.keyBinding&&`\u2014 ${f.keyBinding.toUpperCase()}`}`,"aria-label":f.text||"none","aria-keyshortcuts":f.keyBinding||void 0,ref:y=>{t===f.value&&setTimeout(()=>{y?.focus()},0)},children:[f.icon,f.keyBinding&&ps("span",{className:"picker-keybinding",children:f.keyBinding})]},f.text))}),g=i.formFactor==="phone";return ps(L0.Content,{side:g?"right":"bottom",align:"start",sideOffset:g?8:12,style:{zIndex:"var(--zIndex-ui-styles-popup)"},onKeyDown:l,collisionBoundary:s??void 0,children:_0("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":o,children:[u(p),d.length>0&&ps(jd,{label:b("labels.more_options"),open:c,openTrigger:()=>{m(h=>!h)},className:"picker-collapsible",children:u(d)})]})})}function D0({value:e,label:t,options:o,onChange:n,group:r="",numberOfOptionsToAlwaysShow:a}){let[i,s]=Ru.useState(!1),l=Ru.useRef(null);return ps("div",{children:_0(L0.Root,{open:i,onOpenChange:c=>s(c),children:[ps(L0.Trigger,{name:r,type:"button","aria-label":t,onClick:()=>s(!i),ref:l,className:i?"active":"",children:o.find(c=>c.value===e)?.icon}),i&&ps(xN,{options:o,value:e,label:t,onChange:n,onClose:()=>{s(!1)},numberOfOptionsToAlwaysShow:a})]})})}import rk,{useEffect as yN}from"react";import{jsx as R0,jsxs as ak}from"react/jsx-runtime";var ik=({updateData:e,app:t,testId:o})=>{let n=rk.useRef(null),r=rk.useRef(null),a=t.scene.getSelectedElements(t.state),i=!0,s=a.at(0),c=a.reduce((m,p)=>(m!=null&&m!==p.opacity&&(i=!1),m==null||m>p.opacity?p.opacity:m),s?.opacity??null)??t.state.currentItemOpacity;return yN(()=>{if(n.current&&r.current){let m=n.current,p=r.current,d=m.offsetWidth,u=15,g=c/100*(d-u)+u/2;p.style.left=`${g}px`,m.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${c}%, var(--button-bg) ${c}%, var(--button-bg) 100%)`}},[c]),ak("label",{className:"control-label",children:[b("labels.opacity"),ak("div",{className:"range-wrapper",children:[R0("input",{style:{"--color-slider-track":i?void 0:"var(--button-bg)"},ref:n,type:"range",min:"0",max:"100",step:"10",onChange:m=>{e(+m.target.value)},value:c,className:"range-input","data-testid":o}),R0("div",{className:"value-bubble",ref:r,children:c!==0?c:null}),R0("div",{className:"zero-label",children:"0"})]})]})};import{Fragment as V0,jsx as De,jsxs as Vo}from"react/jsx-runtime";var uk=.1,Ul=e=>{let t=ON(e.editorInterface);return{stylesPanelMode:t,isCompact:t!=="full",isMobile:t==="mobile"}},$o=(e,t,o,n=!1)=>{let r=z0(Me(e,t,{includeBoundTextElement:n}));return e.map(a=>r.get(a.id)||a.id===t.editingTextElement?.id?o(a):a)},Bo=function(e,t,o,n,r){let a=t.state.editingTextElement,i=mk(e),s=null;if(a&&(s=o(a)),!s)if(ft(i,t.state)){let c=t.scene.getSelectedElements(t.state),m=n===!0?c:c.filter(p=>n(p));s=AN(m,o)??(typeof r=="function"?r(!0):r)}else s=typeof r=="function"?r(!1):r;return s},zN=(e,t,o)=>DN(t)||!t.autoResize?t:o.mutateElement(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}),H0=(e,t,o,n,r)=>{let a=new Set,i=$o(e,t,s=>{if(rn(s)){let l=n(s);a.add(l);let c=io(s,{fontSize:l});return Zd(c,o.scene.getContainerElement(s),o.scene),c=zN(s,c,o.scene),c}return s},!0);return Me(e,t,{includeBoundTextElement:!0}).forEach(s=>{rn(s)&&_N(s,o.scene)}),{elements:i,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:r??t.currentItemFontSize},captureUpdate:so.IMMEDIATELY}},UN=Y({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,o)=>({...o?.currentItemStrokeColor&&{elements:$o(e,t,n=>NN(n.type)?io(n,{strokeColor:o.currentItemStrokeColor}):n,!0)},appState:{...t,...o},captureUpdate:o?.currentItemStrokeColor?so.IMMEDIATELY:so.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Ul(n);return Vo(V0,{children:[a==="full"&&De("h3",{"aria-hidden":"true",children:b("labels.stroke")}),De(Vd,{type:"elementStroke",label:b("labels.stroke"),color:Bo(e,n,i=>i.strokeColor,!0,i=>i?null:t.currentItemStrokeColor),onChange:i=>o({currentItemStrokeColor:i}),elements:e,appState:t,updateData:o})]})}}),HN=Y({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,o,n)=>{if(!o?.currentItemBackgroundColor)return{appState:{...t,...o},captureUpdate:so.EVENTUALLY};let r,a=n.scene.getSelectedElements(t);if(!PN(o.currentItemBackgroundColor)&&a.every(s=>ck(s)&&LN(s.points))){let s=z0(a);r=e.map(l=>s.has(l.id)&&ck(l)?io(l,{backgroundColor:o.currentItemBackgroundColor,...FN(l,!0)}):l)}else r=$o(e,t,s=>io(s,{backgroundColor:o.currentItemBackgroundColor}));return{elements:r,appState:{...t,...o},captureUpdate:so.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Ul(n);return Vo(V0,{children:[a==="full"&&De("h3",{"aria-hidden":"true",children:b("labels.background")}),De(Vd,{type:"elementBackground",label:b("labels.background"),color:Bo(e,n,i=>i.backgroundColor,!0,i=>i?null:t.currentItemBackgroundColor),onChange:i=>o({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:o})]})}}),GN=Y({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,o,n)=>(Ne("element","changeFillStyle",`${o} (${n.editorInterface.formFactor==="phone"?"mobile":"desktop"})`),{elements:$o(e,t,r=>io(r,{fillStyle:o})),appState:{...t,currentItemFillStyle:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=Me(e,t),a=r.length>0&&r.every(i=>i.fillStyle==="zigzag");return Vo("fieldset",{children:[De("legend",{children:b("labels.fill")}),De("div",{className:"buttonList",children:De(Bn,{type:"button",options:[{value:"hachure",text:`${a?b("labels.zigzag"):b("labels.hachure")} (${$("Alt-Click")})`,icon:a?K2:Y2,active:a?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:b("labels.crossHatch"),icon:X2,testId:"fill-cross-hatch"},{value:"solid",text:b("labels.solid"),icon:j2,testId:"fill-solid"}],value:Bo(e,n,i=>i.fillStyle,i=>i.hasOwnProperty("fillStyle"),i=>i?null:t.currentItemFillStyle),onClick:(i,s)=>{let l=s.altKey&&i==="hachure"&&r.every(c=>c.fillStyle==="hachure")?"zigzag":i;o(l)}})})]})}}),$N=Y({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{strokeWidth:o})),appState:{...t,currentItemStrokeWidth:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.strokeWidth")}),De("div",{className:"buttonList",children:De(Bn,{group:"stroke-width",options:[{value:F0.thin,text:b("labels.thin"),icon:qb,testId:"strokeWidth-thin"},{value:F0.bold,text:b("labels.bold"),icon:Z2,testId:"strokeWidth-bold"},{value:F0.extraBold,text:b("labels.extraBold"),icon:q2,testId:"strokeWidth-extraBold"}],value:Bo(e,n,a=>a.strokeWidth,a=>a.hasOwnProperty("strokeWidth"),a=>a?null:t.currentItemStrokeWidth),onChange:a=>o(a)})})]})}),VN=Y({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{seed:CN(),roughness:o})),appState:{...t,currentItemRoughness:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.sloppiness")}),De("div",{className:"buttonList",children:De(Bn,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:eI},{value:1,text:b("labels.artist"),icon:tI},{value:2,text:b("labels.cartoonist"),icon:oI}],value:Bo(e,n,a=>a.roughness,a=>a.hasOwnProperty("roughness"),a=>a?null:t.currentItemRoughness),onChange:a=>o(a)})})]})}),Bue=Y({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{strokeStyle:o})),appState:{...t,currentItemStrokeStyle:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.strokeStyle")}),De("div",{className:"buttonList",children:De(Bn,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:qb},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:J2},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:Q2}],value:Bo(e,n,a=>a.strokeStyle,a=>a.hasOwnProperty("strokeStyle"),a=>a?null:t.currentItemStrokeStyle),onChange:a=>o(a)})})]})}),WN=Y({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{opacity:o}),!0),appState:{...t,currentItemOpacity:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({app:e,updateData:t})=>De(ik,{updateData:t,app:e,testId:"opacity"})}),KN=Y({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,o,n)=>H0(e,t,n,()=>(U0(o,"actionChangeFontSize: Expected a font size value"),o),o),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Ul(n);return Vo("fieldset",{children:[De("legend",{children:b("labels.fontSize")}),De("div",{className:"buttonList",children:De(Bn,{group:"font-size",options:[{value:Bu.sm,text:b("labels.small"),icon:bI,testId:"fontSize-small"},{value:Bu.md,text:b("labels.medium"),icon:xI,testId:"fontSize-medium"},{value:Bu.lg,text:b("labels.large"),icon:yI,testId:"fontSize-large"},{value:Bu.xl,text:b("labels.veryLarge"),icon:wI,testId:"fontSize-veryLarge"}],value:Bo(e,n,i=>{if(rn(i))return i.fontSize;let s=ni(i,n.scene.getNonDeletedElementsMap());return s?s.fontSize:null},i=>rn(i)||ni(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||TN),onChange:i=>{zd(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),G0=Y({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:cs,trackEvent:!1,perform:(e,t,o,n)=>H0(e,t,n,r=>Math.round(1/(1+uk)*r.fontSize)),keyTest:e=>e[zl.CTRL_OR_CMD]&&e.shiftKey&&(e.key===zl.CHEVRON_LEFT||e.key===zl.COMMA)}),$0=Y({name:"increaseFontSize",label:"labels.increaseFontSize",icon:cs,trackEvent:!1,perform:(e,t,o,n)=>H0(e,t,n,r=>Math.round(r.fontSize*(1+uk))),keyTest:e=>e[zl.CTRL_OR_CMD]&&e.shiftKey&&(e.key===zl.CHEVRON_RIGHT||e.key===zl.PERIOD)}),YN=Y({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,o,n)=>{let{cachedElements:r,resetAll:a,resetContainers:i,...s}=o;if(a)return{elements:$o(e,t,h=>{let f=r?.get(h.id);return f?io(h,{...f}):h},!0),appState:{...t,...s},captureUpdate:so.NEVER};U0(o,"actionChangeFontFamily: value must be defined");let{currentItemFontFamily:l,currentHoveredFontFamily:c}=o,m=so.EVENTUALLY,p,d=!1;if(l)p=l,m=so.IMMEDIATELY;else if(c){p=c,m=so.EVENTUALLY;let g=Me(e,t,{includeBoundTextElement:!0}).filter(h=>rn(h));if(g.length>200)d=!0;else{let h=0,f=0;for(;h<g.length&&f<5e3;){let w=g[h];f+=w?.originalText.length||0,h++}f>5e3&&(d=!0)}}let u={appState:{...t,...s},captureUpdate:m};if(p&&!d){let g=new Map,h=new Set,f=!1,w=Array.from(Rn.loadedFontsCache.values()),y=Object.entries(kN).find(([I,k])=>k===p)?.[0];c&&y&&w.some(I=>I.startsWith(y))&&(f=!0),Object.assign(u,{elements:$o(e,t,I=>{if(rn(I)&&(I.fontFamily!==p||l)){let k=io(I,{fontFamily:p,lineHeight:MN(p)}),S=r?.get(I.containerId||"")||{},T=n.scene.getContainerElement(I);return i&&T&&S&&n.scene.mutateElement(T,{...S}),f||(h=new Set([...h,...Array.from(k.originalText)])),g.set(k,T),k}return I},!0)});let v=`10px ${SN({fontFamily:p})}`,E=Array.from(h.values()).join();if(f||window.document.fonts.check(v,E))for(let[I,k]of g)Zd(I,k,n.scene);else window.document.fonts.load(v,E).then(I=>{for(let[k,S]of g){let T=n.scene.getElement(k.id),A=S?n.scene.getElement(S.id):null;T&&Zd(T,A,n.scene)}n.fonts.onLoaded(I)})}return u},PanelComponent:({elements:e,appState:t,app:o,updateData:n})=>{let r=B0(new Map),a=B0(null),[i,s]=EN({}),l=B0(!0),{stylesPanelMode:c,isCompact:m}=Ul(o),p=vN(()=>{let d=(u,g)=>Bo(u,o,h=>{if(rn(h))return h.fontFamily;let f=ni(h,g);return f?f.fontFamily:null},h=>rn(h)||ni(h,g)!==null,h=>h?null:t.currentItemFontFamily||IN);return i.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?d(Array.from(r.current?.values()??[]),r.current):!i.openPopup&&t.openPopup!=="fontFamily"?d(e,o.scene.getNonDeletedElementsMap()):a.current},[i.openPopup,t,e,o]);return N0(()=>{a.current=p},[p]),N0(()=>{Object.keys(i).length&&(n(i),s({}))},[i]),N0(()=>(l.current=!1,()=>{l.current=!0}),[]),Vo(V0,{children:[c==="full"&&De("legend",{children:b("labels.fontFamily")}),De(tk,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:p,hoveredFontFamily:t.currentHoveredFontFamily,compactMode:c!=="full",onSelect:d=>{zd(()=>{s({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:d}),r.current.clear()},m,!!t.editingTextElement)},onHover:d=>{s({currentHoveredFontFamily:d,cachedElements:new Map(r.current),resetContainers:!0})},onLeave:()=>{s({currentHoveredFontFamily:null,cachedElements:new Map(r.current),resetAll:!0})},onPopupChange:d=>{if(d){r.current.clear();let{editingTextElement:u}=t;if(u?.type==="text"){let g=o.scene.getElement(u.id);r.current.set(u.id,io(g||u,{},!0))}else{let g=Me(e,t,{includeBoundTextElement:!0});for(let h of g)r.current.set(h.id,io(h,{},!0))}s({...i,openPopup:"fontFamily"})}else{let u={currentHoveredFontFamily:null,cachedElements:new Map(r.current),resetAll:!0};s({...u}),r.current.clear(),m&&t.editingTextElement&&Od(null)}}})]})}}),XN=Y({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,o,n)=>({elements:$o(e,t,r=>{if(rn(r)){let a=io(r,{textAlign:o});return Zd(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t,currentItemTextAlign:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let a=n.scene.getNonDeletedElementsMap(),{isCompact:i}=Ul(n);return Vo("fieldset",{children:[De("legend",{children:b("labels.textAlign")}),De("div",{className:"buttonList",children:De(Bn,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:EI,testId:"align-left"},{value:"center",text:b("labels.center"),icon:II,testId:"align-horizontal-center"},{value:"right",text:b("labels.right"),icon:TI,testId:"align-right"}],value:Bo(e,n,s=>{if(rn(s))return s.textAlign;let l=ni(s,a);return l?l.textAlign:null},s=>rn(s)||ni(s,a)!==null,s=>s?null:t.currentItemTextAlign),onChange:s=>{zd(()=>o(s),i,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),jN=Y({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:$o(e,t,r=>{if(rn(r)){let a=io(r,{verticalAlign:o});return Zd(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Ul(n);return De("fieldset",{children:De("div",{className:"buttonList",children:De(Bn,{group:"text-align",options:[{value:Nu.TOP,text:b("labels.alignTop"),icon:De(kI,{theme:t.theme}),testId:"align-top"},{value:Nu.MIDDLE,text:b("labels.centerVertically"),icon:De(SI,{theme:t.theme}),testId:"align-middle"},{value:Nu.BOTTOM,text:b("labels.alignBottom"),icon:De(CI,{theme:t.theme}),testId:"align-bottom"}],value:Bo(e,n,i=>{if(rn(i)&&i.containerId)return i.verticalAlign;let s=ni(i,n.scene.getNonDeletedElementsMap());return s?s.verticalAlign:null},i=>rn(i)||ni(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:Nu.MIDDLE),onChange:i=>{zd(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})})}}),Fue=Y({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>pk(n)?n:io(n,{roundness:o==="round"?{type:RN(n.type)?Fu.ADAPTIVE_RADIUS:Fu.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>{let i=ol(mk(e),t).some(s=>s.roundness?.type===Fu.LEGACY);return Vo("fieldset",{children:[De("legend",{children:b("labels.edges")}),Vo("div",{className:"buttonList",children:[De(Bn,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:nI},{value:"round",text:b("labels.round"),icon:rI}],value:Bo(e,n,s=>i?null:s.roundness?"round":"sharp",s=>!Ou(s)&&s.hasOwnProperty("roundness"),s=>s?null:t.currentItemRoundness),onChange:s=>o(s)}),r("togglePolygon")]})]})}}),dk=e=>[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:De(aI,{flip:e})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:De(iI,{flip:e})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:De(dI,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:b("labels.arrowhead_triangle_outline"),icon:De(mI,{flip:e}),keyBinding:"r"},{value:"circle",text:b("labels.arrowhead_circle"),keyBinding:"a",icon:De(sI,{flip:e})},{value:"circle_outline",text:b("labels.arrowhead_circle_outline"),keyBinding:"s",icon:De(lI,{flip:e})},{value:"diamond",text:b("labels.arrowhead_diamond"),icon:De(pI,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:b("labels.arrowhead_diamond_outline"),icon:De(uI,{flip:e}),keyBinding:"f"},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"z",icon:De(cI,{flip:e})},{value:"crowfoot_one",text:b("labels.arrowhead_crowfoot_one"),icon:De(hI,{flip:e}),keyBinding:"x"},{value:"crowfoot_many",text:b("labels.arrowhead_crowfoot_many"),icon:De(gI,{flip:e}),keyBinding:"c"},{value:"crowfoot_one_or_many",text:b("labels.arrowhead_crowfoot_one_or_many"),icon:De(fI,{flip:e}),keyBinding:"v"}],Oue=Y({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,o)=>(U0(o,"actionChangeArrowhead: value must be defined"),{elements:$o(e,t,n=>{if(O0(n)){let{position:r,type:a}=o;if(r==="start")return io(n,{startArrowhead:a});if(r==="end")return io(n,{endArrowhead:a})}return n}),appState:{...t,[o.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:o.type},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=la().rtl;return Vo("fieldset",{children:[De("legend",{children:b("labels.arrowheads")}),Vo("div",{className:"iconSelectList buttonList",children:[De(D0,{label:"arrowhead_start",options:dk(!r),value:Bo(e,n,a=>O0(a)&&nl(a.type)?a.startArrowhead:t.currentItemStartArrowhead,!0,a=>a?null:t.currentItemStartArrowhead),onChange:a=>o({position:"start",type:a}),numberOfOptionsToAlwaysShow:4}),De(D0,{label:"arrowhead_end",group:"arrowheads",options:dk(!!r),value:Bo(e,n,a=>O0(a)&&nl(a.type)?a.endArrowhead:t.currentItemEndArrowhead,!0,a=>a?null:t.currentItemEndArrowhead),onChange:a=>o({position:"end",type:a}),numberOfOptionsToAlwaysShow:4})]})]})}}),ZN=Y({name:"changeArrowProperties",label:"Change arrow properties",trackEvent:!1,perform:(e,t,o,n)=>!1,PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>Vo("div",{className:"selected-shape-actions",children:[r("changeArrowhead"),r("changeArrowType")]})}),zue=Y({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,o,n)=>{let r=$o(e,t,s=>{if(!Ou(s))return s;let l=n.scene.getNonDeletedElementsMap(),c=us.getPointAtIndexGlobalCoordinates(s,0,l),m=us.getPointAtIndexGlobalCoordinates(s,-1,l),p=io(s,{x:o===Un.elbow?c[0]:s.x,y:o===Un.elbow?c[1]:s.y,roundness:o===Un.round?{type:Fu.PROPORTIONAL_RADIUS}:null,elbowed:o===Un.elbow,angle:o===Un.elbow?0:s.angle,points:o===Un.elbow||s.elbowed?[us.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},c,l),us.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},m,l)]:s.points});if(pk(p)){p.fixedSegments=null;let d=n.scene.getNonDeletedElementsMap();n.dismissLinearEditor();let u=us.getPointAtIndexGlobalCoordinates(p,0,d),g=us.getPointAtIndexGlobalCoordinates(p,-1,d),h=p.startBinding&&d.get(p.startBinding.elementId),f=p.endBinding&&d.get(p.endBinding.elementId),w=h&&p.startBinding?{...p.startBinding,...lk(p,h,"start",d)}:null,y=f&&p.endBinding?{...p.endBinding,...lk(p,f,"end",d)}:null;p={...p,startBinding:w,endBinding:y,...BN(p,d,{points:[u,g].map(v=>wN(v[0]-p.x,v[1]-p.y)),startBinding:w,endBinding:y,fixedSegments:null})}}else{let d=n.scene.getNonDeletedElementsMap();if(p.startBinding){let u=d.get(p.startBinding.elementId);u&&sk(p,u,t.bindMode==="inside"?"inside":"orbit","start",n.scene)}if(p.endBinding){let u=d.get(p.endBinding.elementId);u&&sk(p,u,t.bindMode==="inside"?"inside":"orbit","end",n.scene)}}return p}),a={...t,currentItemArrowType:o},i=t.selectedLinearElement?.elementId;if(i){let s=r.find(l=>l.id===i);s&&(a.selectedLinearElement=new us(s,z0(e)))}return{elements:r,appState:a,captureUpdate:so.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Vo("fieldset",{children:[De("legend",{children:b("labels.arrowtypes")}),De("div",{className:"buttonList",children:De(Bn,{group:"arrowtypes",options:[{value:Un.sharp,text:b("labels.arrowtype_sharp"),icon:Sl,testId:"sharp-arrow"},{value:Un.round,text:b("labels.arrowtype_round"),icon:Pl,testId:"round-arrow"},{value:Un.elbow,text:b("labels.arrowtype_elbowed"),icon:Ml,testId:"elbow-arrow"}],value:Bo(e,n,r=>Ou(r)?r.elbowed?Un.elbow:r.roundness?Un.round:Un.sharp:null,r=>Ou(r),r=>r?null:t.currentItemArrowType),onChange:r=>o(r)})})]})});import{clamp as j0,roundToStep as n9}from"@orangecatai/math";import{CURSOR_TYPE as vk,MAX_ZOOM as Ek,MIN_ZOOM as Ik,THEME as qd,ZOOM_STEP as Z0,updateActiveTool as Gl,CODES as Br,KEYS as ua,viewportCoordsToSceneCoords as r9}from"@orangecatai/common";import{getElementAbsoluteCoords as xk,getNonDeletedElements as Tk,getVisibleElements as a9}from"@orangecatai/element";import{newElementWith as i9}from"@orangecatai/element";import{getCommonBounds as kk}from"@orangecatai/element";import{CaptureUpdateAction as cr}from"@orangecatai/element";import{useEffect as qN}from"react";import{jsx as QN}from"react/jsx-runtime";var Hl=()=>{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},W0=(e,t,o="bottom")=>{let n=e.getBoundingClientRect(),r=window.innerWidth,a=window.innerHeight,i=5,s=t.left+t.width/2-n.width/2;s<0?s=i:s+n.width>=r&&(s=r-n.width-i);let l;o==="bottom"?(l=t.top+t.height+i,l+n.height>=a&&(l=t.top-n.height-i)):(l=t.top-n.height-i,l<0&&(l=t.top+t.height+i)),Object.assign(e.style,{top:`${l}px`,left:`${s}px`})},JN=(e,t,o,n)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=n?"50ch":"10ch",t.style.maxWidth=n?"50ch":"15ch",t.textContent=o;let r=e.getBoundingClientRect();W0(t,r)},Fo=({children:e,label:t,long:o=!1,style:n,disabled:r})=>(qN(()=>()=>Hl().classList.remove("excalidraw-tooltip--visible"),[]),r?null:QN("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:a=>JN(a.currentTarget,Hl(),t,o),onPointerLeave:()=>Hl().classList.remove("excalidraw-tooltip--visible"),style:n,children:e}));import{CURSOR_TYPE as K0,MIME_TYPES as Y0,THEME as hk}from"@orangecatai/common";var fk='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',e9='<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"/>',bk='<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"/>',t9=`data:${Y0.svg},${encodeURIComponent(`${fk}${bk}</svg>`)}`,o9=`data:${Y0.svg},${encodeURIComponent(`${fk}${e9}${bk}</svg>`)}`,xn=e=>{e&&(e.style.cursor="")},pt=(e,t)=>{e&&(e.style.cursor=t)},Nr,gk,X0=(e,t)=>{let n=()=>{let r=t===hk.DARK;Nr=document.createElement("canvas"),Nr.theme=t,Nr.height=20,Nr.width=20;let a=Nr.getContext("2d");a.lineWidth=1,a.beginPath(),a.arc(Nr.width/2,Nr.height/2,5,0,2*Math.PI),a.fillStyle=r?"#000":"#fff",a.fill(),a.strokeStyle=r?"#fff":"#000",a.stroke(),gk=Nr.toDataURL(Y0.svg)};(!Nr||Nr.theme!==t)&&n(),pt(e,`url(${gk}) ${20/2} ${20/2}, auto`)},yn=(e,t)=>{if(e)if(t.activeTool.type==="selection")xn(e);else if(sa(t))e.style.cursor=K0.GRAB;else if(on(t))X0(e,t.theme);else if(t.activeTool.type==="laser"){let o=t.theme===hk.LIGHT?t9:o9;e.style.cursor=`url(${o}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=K0.AUTO):e.style.cursor=K0.CROSSHAIR};var pa=({viewportX:e,viewportY:t,nextZoom:o},n)=>{let r=e-n.offsetLeft,a=t-n.offsetTop,i=n.zoom.value,s=n.scrollX+(r-r/i),l=n.scrollY+(a-a/i),c=-(r-r/o),m=-(a-a/o);return{scrollX:s+c,scrollY:l+m,zoom:{value:o}}};import{jsx as $l,jsxs as h9}from"react/jsx-runtime";var s9=Y({name:"changeViewBackgroundColor",label:"labels.canvasBackground",trackEvent:!1,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,o)=>({appState:{...t,...o},captureUpdate:o?.viewBackgroundColor?cr.IMMEDIATELY:cr.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,appProps:n,data:r})=>$l(Vd,{palette:null,label:b("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:a=>o({viewBackgroundColor:a}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:o})}),ga=Y({name:"clearCanvas",label:"labels.clearCanvas",icon:Co,trackEvent:{category:"canvas"},predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector",perform:(e,t,o,n)=>(n.imageCache.clear(),{elements:e.map(r=>i9(r,{isDeleted:!0})),appState:{...Va(),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:n.state.preferredSelectionTool.type}:t.activeTool},captureUpdate:cr.IMMEDIATELY})}),zu=Y({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:Rb,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Tr(t.zoom.value+Z0)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(xe,{type:"button",className:"zoom-in-button zoom-button",icon:Rb,title:`${b("buttons.zoomIn")} \u2014 ${$("CtrlOrCmd++")}`,"aria-label":b("buttons.zoomIn"),disabled:t.zoom.value>=Ek,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Br.EQUAL||e.code===Br.NUM_ADD)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),Uu=Y({name:"zoomOut",label:"buttons.zoomOut",icon:Nb,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Tr(t.zoom.value-Z0)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(xe,{type:"button",className:"zoom-out-button zoom-button",icon:Nb,title:`${b("buttons.zoomOut")} \u2014 ${$("CtrlOrCmd+-")}`,"aria-label":b("buttons.zoomOut"),disabled:t.zoom.value<=Ik,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Br.MINUS||e.code===Br.NUM_SUBTRACT)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),Hu=Y({name:"resetZoom",label:"buttons.resetZoom",icon:P2,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Tr(1)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(Fo,{label:b("buttons.resetZoom"),style:{height:"100%"},children:h9(xe,{type:"button",className:"reset-zoom-button zoom-button",title:b("buttons.resetZoom"),"aria-label":b("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===Br.ZERO||e.code===Br.NUM_ZERO)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),l9=(e,t,o=1)=>{let[n,r,a,i]=e,s=a-n,l=t.width/s,c=i-r,m=t.height/c,d=Math.min(l,m)*j0(o,.1,1);return Math.min(d,1)},c9=.8,d9=(e,t)=>e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1],m9=(e,t)=>[e[0]-t,e[1]-t,e[2]+t,e[3]+t],yk=(e,t)=>{let o=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Math.hypot(o-t.x,n-t.y)},wk=e=>[e[0],e[1],e[2],e[3]],p9=(e,t)=>{let o=Tk(e);if(!o.length)return[];let n=a9(o),r=n.length?n:o,a=new Map(o.map(d=>[d.id,d])),i=r9({clientX:t.offsetLeft+t.width/2,clientY:t.offsetTop+t.height/2},t),s=r.reduce((d,u)=>{let g=wk(xk(u,a));return d?yk(g,i)<yk(d.bounds,i)?{element:u,bounds:g}:d:{element:u,bounds:g}},null);if(!s)return[];let l=Math.max(160/t.zoom.value,.12*Math.min(t.width,t.height)/t.zoom.value),c=new Map([[s.element.id,s.element]]),m=s.bounds,p=!0;for(;p;){p=!1;let d=m9(m,l);for(let u of r){if(c.has(u.id))continue;let g=wk(xk(u,a));d9(g,d)&&(c.set(u.id,u),m=kk([...c.values()]),p=!0)}}return[...c.values()]},Ck=({bounds:e,appState:t,canvasOffsets:o,fitToViewport:n=!1,viewportZoomFactor:r=1,minZoom:a=-1/0,maxZoom:i=1/0})=>{r=j0(r,Ik,Ek);let[s,l,c,m]=e,p=(s+c)/2,d=(l+m)/2,u=o?.left??0,g=o?.top??0,h=o?.right??0,f=o?.bottom??0,w=t.width-u-h,y=t.height-g-f,v;if(n){let k=c-s,S=m-l;v=Math.min(w/k,y/S)*r}else v=l9(e,{width:w,height:y},r);let E=Tr(j0(n9(v,Z0,"floor"),a,i)),I=YE({scenePoint:{x:p,y:d},viewportDimensions:{width:t.width,height:t.height},offsets:o,zoom:{value:E}});return{appState:{...t,scrollX:I.scrollX,scrollY:I.scrollY,zoom:{value:E}},captureUpdate:cr.EVENTUALLY}},Vl=({canvasOffsets:e,targetElements:t,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})=>{let s=kk(Tk(t));return Ck({canvasOffsets:e,bounds:s,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})},vge=Y({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:Cl,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Vl({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Br.TWO&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),Ege=Y({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:Cl,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Vl({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Br.THREE&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),u9=Y({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:Cl,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>Vl({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()}),keyTest:e=>e.code===Br.ONE&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),g9=Y({name:"scrollBackToContent",label:"buttons.scrollBackToContent",icon:Cl,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=r.length?r:p9(e,t);return a.length?Vl({targetElements:a,appState:{...t,userToFollow:null},fitToViewport:!0,viewportZoomFactor:c9,canvasOffsets:n.getEditorUIOffsets()}):!1},PanelComponent:({updateData:e})=>$l(Fo,{label:b("buttons.scrollBackToContent"),style:{height:"100%"},children:$l(xe,{type:"button",className:"scroll-back-to-content-button zoom-button",icon:Cl,title:b("buttons.scrollBackToContent"),"aria-label":b("buttons.scrollBackToContent"),onClick:()=>{e(null)}})})}),gs=Y({name:"toggleTheme",label:(e,t)=>t.theme===qd.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:(e,t)=>e.theme===qd.LIGHT?Pd:Ad,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o)=>({appState:{...t,theme:o||(t.theme===qd.LIGHT?qd.DARK:qd.LIGHT)},captureUpdate:cr.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===Br.D,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.toggleTheme}),Ige=Y({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t,o,n)=>{let r;return on(t)?r=Gl(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):r=Gl(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.IMMEDIATELY}},keyTest:e=>e.key===ua.E}),Tge=Y({name:"toggleLassoTool",label:"toolBar.lasso",icon:Ya,trackEvent:{category:"toolbar"},predicate:(e,t,o,n)=>n.state.preferredSelectionTool.type!=="lasso",perform:(e,t,o,n)=>{let r;return t.activeTool.type!=="lasso"?(r=Gl(t,{type:"lasso",fromSelection:!1}),pt(n.interactiveCanvas,vk.CROSSHAIR)):r=Gl(t,{type:"selection"}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.NEVER}}}),Sk=Y({name:"toggleHandTool",label:"toolBar.hand",trackEvent:{category:"toolbar"},icon:El,viewMode:!1,perform:(e,t,o,n)=>{let r;return sa(t)?r=Gl(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(r=Gl(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),pt(n.interactiveCanvas,vk.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[ua.CTRL_OR_CMD]&&e.key===ua.H});import{updateActiveTool as Mk}from"@orangecatai/common";import{CaptureUpdateAction as f9}from"@orangecatai/element";var b9=Y({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,o,n)=>{let r=Mk(t,{type:"embeddable"});return yn(n.canvas,{...t,activeTool:r}),{elements:e,appState:{...t,activeTool:Mk(t,{type:"embeddable"})},captureUpdate:f9.EVENTUALLY}}});import{pointFrom as Pk}from"@orangecatai/math";import{bindOrUnbindBindingElement as x9}from"@orangecatai/element/binding";import{isValidPolygon as Ak,LinearElementEditor as Gu,newElementWith as q0}from"@orangecatai/element";import{isBindingElement as Lk,isFreeDrawElement as _k,isLinearElement as Dk,isLineElement as $u}from"@orangecatai/element";import{KEYS as J0,arrayToMap as y9,invariant as Rk,shouldRotateWithDiscreteAngle as w9,updateActiveTool as Nk}from"@orangecatai/common";import{isPathALoop as v9}from"@orangecatai/element";import{isInvisiblySmallElement as Q0}from"@orangecatai/element";import{CaptureUpdateAction as Bk}from"@orangecatai/element";import{jsx as E9}from"react/jsx-runtime";var Wo=Y({name:"finalize",label:"",trackEvent:!1,perform:(e,t,o,n)=>{let r=e,{interactiveCanvas:a,focusContainer:i,scene:s}=n,l=s.getNonDeletedElementsMap();if(o&&t.selectedLinearElement){let{event:d,sceneCoords:u}=o,g=Gu.getElement(t.selectedLinearElement.elementId,l);Rk(g,"Arrow element should exist if selectedLinearElement is set"),Rk(u,"sceneCoords should be defined if actionFinalize is called with event");let h=Gu.handlePointerUp(d,t.selectedLinearElement,t,n.scene);if(Lk(g)&&!t.selectedLinearElement.segmentMidPointHoveredCoords){let f=!!t.newElement,y=(f||!t.selectedLinearElement.selectedPointsIndices?[g.points.length-1]:t.selectedLinearElement.selectedPointsIndices).reduce((v,E)=>(v.set(E,{point:Gu.pointFromAbsoluteCoords(g,Pk(u.x-h.pointerOffset.x,u.y-h.pointerOffset.y),l)}),v),new Map)??new Map;x9(g,y,u.x-h.pointerOffset.x,u.y-h.pointerOffset.y,s,t,{newArrow:f,altKey:d.altKey,angleLocked:w9(d)})}else $u(g)&&t.selectedLinearElement?.isEditing&&!t.newElement&&!Ak(g.points)&&s.mutateElement(g,{polygon:!1});if(h!==t.selectedLinearElement){g&&Q0(g)&&(r=r.map(w=>w.id===g.id?q0(w,{isDeleted:!0}):w));let f=t.activeTool?.locked;return{elements:g.points.length<2||Q0(g)?e.map(w=>w.id===g.id?q0(w,{isDeleted:!0}):w):r,appState:{...t,cursorButton:"up",selectedLinearElement:f?null:{...h,selectedPointsIndices:null,isEditing:!1,initialState:{...h.initialState,lastClickedPoint:-1},pointerOffset:{x:0,y:0}},selectionElement:null,suggestedBinding:null,newElement:null,multiElement:null},captureUpdate:Bk.IMMEDIATELY}}}window.document.activeElement instanceof HTMLElement&&i();let c=null;if(t.multiElement)c=t.multiElement;else if(t.newElement?.type==="freedraw"||Lk(t.newElement))c=t.newElement;else if(Object.keys(t.selectedElementIds).length===1){let d=l.get(Object.keys(t.selectedElementIds)[0]);d&&(c=d)}if(c){if(t.selectedLinearElement&&t.multiElement&&c.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:d}=c,{lastCommittedPoint:u}=t.selectedLinearElement;(!u||d[d.length-1]!==u)&&s.mutateElement(c,{points:c.points.slice(0,-1)})}if(c&&Q0(c)&&(r=r.map(d=>d.id===c?.id?q0(d,{isDeleted:!0}):d)),Dk(c)||_k(c)){if(v9(c.points,t.zoom.value)&&($u(c)||_k(c))){let u=c.points,g=u[0],h=u.map((f,w)=>w===u.length-1?Pk(g[0],g[1]):f);$u(c)?s.mutateElement(c,{points:h,polygon:!0}):s.mutateElement(c,{points:h})}$u(c)&&!Ak(c.points)&&s.mutateElement(c,{polygon:!1})}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!c)&&xn(a);let m;t.activeTool.type==="eraser"?m=Nk(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):m=Nk(t,{type:n.state.preferredSelectionTool.type});let p=c&&Dk(c)?new Gu(c,y9(r)):t.selectedLinearElement;return p=p&&{...p,isEditing:t.newElement?!1:p.isEditing,initialState:{...p.initialState,lastClickedPoint:-1,origin:null}},{elements:r,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&c?t.activeTool:m,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBinding:null,selectedElementIds:c&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[c.id]:!0}:t.selectedElementIds,selectedLinearElement:p},captureUpdate:Bk.IMMEDIATELY}},keyTest:(e,t)=>e.key===J0.ESCAPE&&(t.selectedLinearElement?.isEditing||!t.newElement&&t.multiElement===null)||(e.key===J0.ESCAPE||e.key===J0.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:o})=>E9(xe,{type:"button",icon:O2,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:t,visible:e.multiElement!=null,size:o?.size||"medium",style:{pointerEvents:"all"}})});import{KEYS as Xl,DEFAULT_EXPORT_PADDING as pB,EXPORT_SCALES as uB,THEME as ox}from"@orangecatai/common";import{getNonDeletedElements as gB}from"@orangecatai/element";import{CaptureUpdateAction as pr}from"@orangecatai/element";import{viewportCoordsToSceneCoords as hB}from"@orangecatai/common";import I9 from"clsx";import{jsx as Fk,jsxs as T9}from"react/jsx-runtime";var Jd=({children:e,checked:t,onChange:o,className:n})=>T9("div",{className:I9("Checkbox",n,{"is-checked":t}),onClick:r=>{o(!t,r),r.currentTarget.querySelector(".Checkbox-box").focus()},children:[Fk("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:iu}),Fk("div",{className:"Checkbox-label",children:e})]});import{THEME as Qd}from"@orangecatai/common";import{jsx as em}from"react/jsx-runtime";var zk=e=>{let t=e.title||(e.value===Qd.DARK?b("buttons.lightMode"):b("buttons.darkMode"));return em(xe,{type:"icon",icon:e.value===Qd.LIGHT?Ok.MOON:Ok.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===Qd.DARK?Qd.LIGHT:Qd.DARK),"data-testid":"toggle-dark-mode"})},Ok={SUN:em("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:em("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:em("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:em("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"})})};import{useState as k9}from"react";import{focusNearestParent as C9,KEYS as S9}from"@orangecatai/common";import{jsx as Uk,jsxs as M9}from"react/jsx-runtime";var Hk=e=>{let{id:t}=St(),[o,n]=k9(e.value),r=i=>{e.ignoreFocus||C9(i.target);let s=i.target.value;s!==e.value&&e.onChange(s)},a=i=>{if(i.key===S9.ENTER){if(i.preventDefault(),i.nativeEvent.isComposing||i.keyCode===229)return;i.currentTarget.blur()}};return M9("div",{className:"ProjectName",children:[Uk("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),Uk("input",{type:"text",className:"TextInput",onBlur:r,onKeyDown:a,id:`${t}-filename`,value:o,onChange:i=>n(i.target.value)})]})};import{DEFAULT_EXPORT_PADDING as nB,DEFAULT_FILENAME as rB,IMAGE_MIME_TYPES as rC,isFirefox as aB,MIME_TYPES as iB,cloneJSON as sB,SVG_DOCUMENT_PREAMBLE as lB}from"@orangecatai/common";import{getNonDeletedElements as cB}from"@orangecatai/element";import{isFrameLikeElement as dB}from"@orangecatai/element";import{getElementsOverlappingFrame as mB}from"@orangecatai/element";import{ALLOWED_PASTE_MIME_TYPES as U9,EXPORT_DATA_TYPES as nm,MIME_TYPES as wn,arrayToMap as H9,isMemberOf as G9,isPromiseLike as $9,EVENT as Ku}from"@orangecatai/common";import{mutateElement as V9}from"@orangecatai/element";import{deepCopyElement as W9}from"@orangecatai/element";import{isFrameLikeElement as K9,isInitializedImageElement as Y9}from"@orangecatai/element";import{getContainingFrame as Jk}from"@orangecatai/element";import{pointFrom as ri}from"@orangecatai/math";import{COLOR_PALETTE as $k,DEFAULT_CHART_COLOR_INDEX as P9,getAllColorsSpecificShade as A9,DEFAULT_FONT_FAMILY as L9,DEFAULT_FONT_SIZE as Vk,VERTICAL_ALIGN as _9,randomId as Wk,isDevEnv as Kk,FONT_SIZES as D9}from"@orangecatai/common";import{newTextElement as Vu,newLinearElement as om,newElement as tx}from"@orangecatai/element";var dr=32,It=12,ai=256,Yk=50,hs="NOT_SPREADSHEET",Wl="VALID_SPREADSHEET",tm=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},ex=(e,t)=>e.slice(1).every(o=>tm(o[t])!==null),Gk=e=>{let t=e[0].length;if(t>2)return{type:hs,reason:"More than 2 columns"};if(t===1){if(!ex(e,0))return{type:hs,reason:"Value is not numeric"};let l=tm(e[0][0])===null,c=(l?e.slice(1):e).map(m=>tm(m[0]));return c.length<2?{type:hs,reason:"Less than two rows"}:{type:Wl,spreadsheet:{title:l?e[0][0]:null,labels:null,values:c}}}let o=ex(e,0),n=ex(e,1);if(!o&&!n)return{type:hs,reason:"Value is not numeric"};let[r,a]=n?[0,1]:[1,0],i=tm(e[0][a])===null,s=i?e.slice(1):e;return s.length<2?{type:hs,reason:"Less than 2 rows"}:{type:Wl,spreadsheet:{title:i?e[0][a]:null,labels:s.map(l=>l[r]),values:s.map(l=>tm(l[a]))}}},R9=e=>{let t=[];for(let o=0;o<e[0].length;o++){let n=[];for(let r=0;r<e.length;r++)n.push(e[r][o]);t.push(n)}return t},Xk=e=>{let t=e.trim().split(`
2
2
  `).map(a=>a.trim().split(" "));if(t.length&&t[0].length!==2&&(t=e.trim().split(`
3
3
  `).map(a=>a.trim().split(","))),t.length===0)return{type:hs,reason:"No values"};let o=t[0].length;if(!t.every(a=>a.length===o))return{type:hs,reason:"All rows don't have same number of columns"};let r=Gk(t);if(r.type!==Wl){let a=Gk(R9(t));if(a.type===Wl)return a}return r},Wu=A9(P9),Hn={fillStyle:"hachure",fontFamily:L9,fontSize:Vk,opacity:100,roughness:1,strokeColor:$k.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:_9.MIDDLE,locked:!1},jk=e=>{let t=(dr+It)*e.values.length+It,o=ai+It*2;return{chartWidth:t,chartHeight:o}},N9=(e,t,o,n,r)=>e.labels?.map((a,i)=>Vu({groupIds:[n],backgroundColor:r,...Hn,text:a.length>8?`${a.slice(0,5)}...`:a,x:t+i*(dr+It)+It*2,y:o+It/2,width:dr,angle:5.87,fontSize:D9.sm,textAlign:"center",verticalAlign:"top"}))||[],B9=(e,t,o,n,r)=>{let a=Vu({groupIds:[n],backgroundColor:r,...Hn,x:t-It,y:o-It,text:"0",textAlign:"right"}),i=Vu({groupIds:[n],backgroundColor:r,...Hn,x:t-It,y:o-ai-a.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[a,i]},F9=(e,t,o,n,r)=>{let{chartWidth:a,chartHeight:i}=jk(e),s=om({backgroundColor:r,groupIds:[n],...Hn,type:"line",x:t,y:o,width:a,points:[ri(0,0),ri(a,0)]}),l=om({backgroundColor:r,groupIds:[n],...Hn,type:"line",x:t,y:o,height:i,points:[ri(0,0),ri(0,-i)]}),c=om({backgroundColor:r,groupIds:[n],...Hn,type:"line",x:t,y:o-ai-It,strokeStyle:"dotted",width:a,opacity:Yk,points:[ri(0,0),ri(a,0)]});return[s,l,c]},Zk=(e,t,o,n,r,a)=>{let{chartWidth:i,chartHeight:s}=jk(e),l=e.title?Vu({backgroundColor:r,groupIds:[n],...Hn,text:e.title,x:t+i/2,y:o-ai-It*2-Vk,roundness:null,textAlign:"center"}):null,c=a?tx({backgroundColor:r,groupIds:[n],...Hn,type:"rectangle",x:t,y:o-s,width:i,height:s,strokeColor:$k.black,fillStyle:"solid",opacity:6}):null;return[...c?[c]:[],...l?[l]:[],...N9(e,t,o,n,r),...B9(e,t,o,n,r),...F9(e,t,o,n,r)]},O9=(e,t,o)=>{let n=Math.max(...e.values),r=Wk(),a=Wu[Math.floor(Math.random()*Wu.length)];return[...e.values.map((s,l)=>{let c=s/n*ai;return tx({backgroundColor:a,groupIds:[r],...Hn,type:"rectangle",x:t+l*(dr+It)+It,y:o-c-It,width:dr,height:c})}),...Zk(e,t,o,r,a,Kk())]},z9=(e,t,o)=>{let n=Math.max(...e.values),r=Wk(),a=Wu[Math.floor(Math.random()*Wu.length)],i=0,s=[];for(let h of e.values){let f=i*(dr+It),w=-(h/n)*ai;s.push([f,w]),i++}let l=Math.max(...s.map(h=>h[0])),c=Math.max(...s.map(h=>h[1])),m=Math.min(...s.map(h=>h[0])),p=Math.min(...s.map(h=>h[1])),d=om({backgroundColor:a,groupIds:[r],...Hn,type:"line",x:t+It+dr/2,y:o-It,height:c-p,width:l-m,strokeWidth:2,points:s}),u=e.values.map((h,f)=>{let w=f*(dr+It)+It/2,y=-(h/n)*ai+It/2;return tx({backgroundColor:a,groupIds:[r],...Hn,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+w+dr/2,y:o+y-It*2,width:It,height:It})}),g=e.values.map((h,f)=>{let w=f*(dr+It)+It/2,y=h/n*ai+It/2+It;return om({backgroundColor:a,groupIds:[r],...Hn,type:"line",x:t+w+dr/2+It/2,y:o-y,height:y,strokeStyle:"dotted",opacity:Yk,points:[ri(0,0),ri(0,y)]})});return[...Zk(e,t,o,r,a,Kk()),d,...g,...u]},qk=(e,t,o,n)=>e==="line"?z9(t,o,n):O9(t,o,n);var Fhe="clipboard"in navigator&&"readText"in navigator.clipboard,Yu="clipboard"in navigator&&"writeText"in navigator.clipboard,Kl="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,X9=e=>!!([nm.excalidraw,nm.excalidrawClipboard,nm.excalidrawClipboardWithAPI].includes(e?.type)&&Array.isArray(e.elements)),Qk=({types:e,files:t})=>{!e&&!t&&console.warn("createPasteEvent: no types or files provided");let o=new ClipboardEvent(Ku.PASTE,{clipboardData:new DataTransfer});if(e)for(let[n,r]of Object.entries(e)){if(typeof r!="string"){t=t||[],t.push(r);continue}try{if(o.clipboardData?.items.add(r,n),o.clipboardData?.getData(n)!==r)throw new Error(`Failed to set "${n}" as clipboardData item`)}catch(a){throw new Error(a.message)}}if(t){let n=-1;for(let r of t){n++;try{if(o.clipboardData?.items.add(r),o.clipboardData?.files[n]!==r)throw new Error(`Failed to set file "${r.name}" as clipboardData item`)}catch(a){throw new Error(a.message)}}}return o},j9=({elements:e,files:t})=>{let o=H9(e),n=new Set(e.filter(s=>K9(s))),r=!1,a=e.reduce((s,l)=>(Y9(l)&&(r=!0,t&&t[l.fileId]&&(s[l.fileId]=t[l.fileId])),s),{});r&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let i={type:nm.excalidrawClipboard,elements:e.map(s=>{if(Jk(s,o)&&!n.has(Jk(s,o))){let l=W9(s);return V9(l,o,{frameId:null}),l}return s}),files:t?a:void 0};return JSON.stringify(i)},Xu=async(e,t,o)=>{let n=j9({elements:e,files:t});await mr({[wn.excalidrawClipboard]:n,[wn.text]:n},o)},Z9=e=>{let t=Xk(e);return t.type===Wl?{spreadsheet:t.spreadsheet}:null};function eC(e){let t=[];for(let o of e.childNodes)if(o.nodeType===3){let n=o.textContent?.trim();n&&t.push({type:"text",value:n})}else if(o instanceof HTMLImageElement){let n=o.getAttribute("src");n&&n.startsWith("http")&&t.push({type:"imageUrl",value:n})}else t=t.concat(eC(o));return t}var q9=e=>{let t=e.value;try{let o=new DOMParser().parseFromString(t,wn.html),n=eC(o.body);if(n.length)return{type:"mixedContent",value:n}}catch(o){console.error(`error in parseHTMLFromPaste: ${o.message}`)}return null},tC=async()=>{let e={},t;try{t=await navigator.clipboard?.read()}catch(o){try{if(navigator.clipboard?.readText){console.warn(`navigator.clipboard.readText() failed (${o.message}). Failling back to navigator.clipboard.read()`);let n=await navigator.clipboard?.readText();if(n)return{[wn.text]:n}}}catch(n){if(navigator.clipboard?.read)console.warn(`navigator.clipboard.readText() failed (${n.message}). Failling back to navigator.clipboard.read()`);else{if(n.name==="DataError")return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${n.message}`),e;throw n}}throw o}for(let o of t)for(let n of o.types)if(G9(U9,n))try{if(n===wn.text||n===wn.html)e[n]=await(await o.getType(n)).text();else if(i2(n)){let r=await o.getType(n),a=u2(r,n,void 0);e[n]=a}else throw new Cb(`Unsupported clipboard type: ${n}`)}catch(r){console.warn(r instanceof Cb?r.message:`Cannot retrieve ${n} from clipboardItem: ${r.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},J9=async(e,t=!1)=>{try{let o=e.findByType(wn.html),n=!t&&o&&q9(o);return n?n.value.every(r=>r.type==="text")?{type:"text",value:e.getData(wn.text)??n.value.map(r=>r.value).join(`
4
- `).trim()}:n:{type:"text",value:(e.getData(wn.text)||"").trim()}}catch{return{type:"text",value:""}}},Q9=function(e){return this.find(t=>t.type===e)||null},eB=function(e){return this.find(o=>o.type===e)?.value??null},tB=function(){return this.filter(e=>e.kind==="file")},oC=e=>{let t;nC(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let o=new Set;for(let n of Array.from(t||[]))o.has(n.type)||o.add(n.type);return o},Yl=async e=>{let t;nC(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let o=(await Promise.all(Array.from(t||[]).map(async n=>{if(n.kind==="file"){let r=n.getAsFile();if(r){let a=await p2(n);return r=await Sd(r),{type:r.type,kind:"file",file:r,fileHandle:a}}}else if(n.kind==="string"){let{type:r}=n,a;return"clipboardData"in e&&e.clipboardData?a=e.clipboardData?.getData(r):a=await new Promise(i=>{n.getAsString(s=>i(s))}),{type:r,kind:"string",value:a}}return null}))).filter(n=>n!=null);return Object.assign(o,{findByType:Q9,getData:eB,getFiles:tB})},ju=async(e,t=!1)=>{let o=await J9(e,t);if(o.type==="mixedContent")return{mixedContent:o.value};try{let n=!t&&Z9(o.value);if(n)return n}catch(n){console.error(n)}try{let n=JSON.parse(o.value),r=n.type===nm.excalidrawClipboardWithAPI;if(X9(n))return{elements:n.elements,files:n.files,text:t?JSON.stringify(n.elements,null,2):void 0,programmaticAPI:r}}catch{}return{text:o.value}},Zu=async e=>{try{await navigator.clipboard.write([new ClipboardItem({[wn.png]:e})])}catch(t){if($9(e))await navigator.clipboard.write([new ClipboardItem({[wn.png]:await e})]);else throw t}},mr=async(e,t)=>{e=e||"";let o=Object.entries(typeof e=="string"?{[wn.text]:e}:e);try{if(t){for(let[r,a]of o)if(t.clipboardData?.setData(r,a),t.clipboardData?.getData(r)!==a)throw new Error("Failed to setData on clipboardEvent");return}}catch(r){console.error(r)}let n=o.find(([r])=>r===wn.text);if(Yu&&n)try{await navigator.clipboard.writeText(n[1]);return}catch(r){console.error(r)}if(n&&!oB(n[1]))throw new Error("Error copying to clipboard.")},oB=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",o=document.createElement("textarea");o.style.border="0",o.style.padding="0",o.style.margin="0",o.style.position="absolute",o.style[t?"right":"left"]="-9999px";let n=window.pageYOffset||document.documentElement.scrollTop;o.style.top=`${n}px`,o.style.fontSize="12pt",o.setAttribute("readonly",""),o.value=e,document.body.appendChild(o);let r=!1;try{o.select(),o.setSelectionRange(0,o.value.length),r=document.execCommand("copy")}catch(a){console.error(a)}return o.remove(),r},nC=e=>e.type===Ku.PASTE||e.type===Ku.COPY||e.type===Ku.CUT;var fs=(e,{selectedElementIds:t},o)=>{e=cB(e);let n=o&&ft(e,{selectedElementIds:t}),r=null,a=n?Me(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return n&&(a.length===1&&dB(a[0])?(r=a[0],a=mB(e,r)):a.length>1&&(a=Me(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:r,exportedElements:sB(a)}},bs=async(e,t,o,n,{exportBackground:r,exportPadding:a=nB,viewBackgroundColor:i,name:s=o.name||rB,fileHandle:l=null,exportingFrame:c=null})=>{if(t.length===0)throw new Error(b("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let p=sl(t,{exportBackground:r,exportWithDarkMode:o.exportWithDarkMode,viewBackgroundColor:i,exportPadding:a,exportScale:o.exportScale,exportEmbedScene:o.exportEmbedScene&&e==="svg"},n,{exportingFrame:c});if(e==="svg")return Sb(p.then(d=>new Blob([lB+d.outerHTML],{type:iB.svg})),{description:"Export to SVG",name:s,extension:o.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[rC.svg],fileHandle:l});if(e==="clipboard-svg"){let d=await p.then(u=>u.outerHTML);try{await mr(d)}catch{throw new Error(b("errors.copyToSystemClipboardFailed"))}return}}let m=Wa(t,o,n,{exportBackground:r,viewBackgroundColor:i,exportPadding:a,exportingFrame:c});if(e==="png"){let p=as(m);return o.exportEmbedScene&&(p=p.then(d=>import("./data/image-6UHTG2HH.js").then(({encodePngMetadata:u})=>u({blob:d,metadata:Id(t,o,n,"local")})))),Sb(p,{description:"Export to PNG",name:s,extension:o.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[rC.png],fileHandle:l})}else if(e==="clipboard")try{let p=as(m);await Zu(p)}catch(p){throw console.warn(p),p.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(b("canvasError.canvasTooBig")):aB&&p.name==="TypeError"?new Error(`${b("alerts.couldNotCopyToClipboard")}
4
+ `).trim()}:n:{type:"text",value:(e.getData(wn.text)||"").trim()}}catch{return{type:"text",value:""}}},Q9=function(e){return this.find(t=>t.type===e)||null},eB=function(e){return this.find(o=>o.type===e)?.value??null},tB=function(){return this.filter(e=>e.kind==="file")},oC=e=>{let t;nC(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let o=new Set;for(let n of Array.from(t||[]))o.has(n.type)||o.add(n.type);return o},Yl=async e=>{let t;nC(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let o=(await Promise.all(Array.from(t||[]).map(async n=>{if(n.kind==="file"){let r=n.getAsFile();if(r){let a=await p2(n);return r=await Sd(r),{type:r.type,kind:"file",file:r,fileHandle:a}}}else if(n.kind==="string"){let{type:r}=n,a;return"clipboardData"in e&&e.clipboardData?a=e.clipboardData?.getData(r):a=await new Promise(i=>{n.getAsString(s=>i(s))}),{type:r,kind:"string",value:a}}return null}))).filter(n=>n!=null);return Object.assign(o,{findByType:Q9,getData:eB,getFiles:tB})},ju=async(e,t=!1)=>{let o=await J9(e,t);if(o.type==="mixedContent")return{mixedContent:o.value};try{let n=!t&&Z9(o.value);if(n)return n}catch(n){console.error(n)}try{let n=JSON.parse(o.value),r=n.type===nm.excalidrawClipboardWithAPI;if(X9(n))return{elements:n.elements,files:n.files,text:t?JSON.stringify(n.elements,null,2):void 0,programmaticAPI:r}}catch{}return{text:o.value}},Zu=async e=>{try{await navigator.clipboard.write([new ClipboardItem({[wn.png]:e})])}catch(t){if($9(e))await navigator.clipboard.write([new ClipboardItem({[wn.png]:await e})]);else throw t}},mr=async(e,t)=>{e=e||"";let o=Object.entries(typeof e=="string"?{[wn.text]:e}:e);try{if(t){for(let[r,a]of o)if(t.clipboardData?.setData(r,a),t.clipboardData?.getData(r)!==a)throw new Error("Failed to setData on clipboardEvent");return}}catch(r){console.error(r)}let n=o.find(([r])=>r===wn.text);if(Yu&&n)try{await navigator.clipboard.writeText(n[1]);return}catch(r){console.error(r)}if(n&&!oB(n[1]))throw new Error("Error copying to clipboard.")},oB=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",o=document.createElement("textarea");o.style.border="0",o.style.padding="0",o.style.margin="0",o.style.position="absolute",o.style[t?"right":"left"]="-9999px";let n=window.pageYOffset||document.documentElement.scrollTop;o.style.top=`${n}px`,o.style.fontSize="12pt",o.setAttribute("readonly",""),o.value=e,document.body.appendChild(o);let r=!1;try{o.select(),o.setSelectionRange(0,o.value.length),r=document.execCommand("copy")}catch(a){console.error(a)}return o.remove(),r},nC=e=>e.type===Ku.PASTE||e.type===Ku.COPY||e.type===Ku.CUT;var fs=(e,{selectedElementIds:t},o)=>{e=cB(e);let n=o&&ft(e,{selectedElementIds:t}),r=null,a=n?Me(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return n&&(a.length===1&&dB(a[0])?(r=a[0],a=mB(e,r)):a.length>1&&(a=Me(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:r,exportedElements:sB(a)}},bs=async(e,t,o,n,{exportBackground:r,exportPadding:a=nB,viewBackgroundColor:i,name:s=o.name||rB,fileHandle:l=null,exportingFrame:c=null})=>{if(t.length===0)throw new Error(b("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let p=sl(t,{exportBackground:r,exportWithDarkMode:o.exportWithDarkMode,viewBackgroundColor:i,exportPadding:a,exportScale:o.exportScale,exportEmbedScene:o.exportEmbedScene&&e==="svg"},n,{exportingFrame:c});if(e==="svg")return Sb(p.then(d=>new Blob([lB+d.outerHTML],{type:iB.svg})),{description:"Export to SVG",name:s,extension:o.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[rC.svg],fileHandle:l});if(e==="clipboard-svg"){let d=await p.then(u=>u.outerHTML);try{await mr(d)}catch{throw new Error(b("errors.copyToSystemClipboardFailed"))}return}}let m=Wa(t,o,n,{exportBackground:r,viewBackgroundColor:i,exportPadding:a,exportingFrame:c});if(e==="png"){let p=as(m);return o.exportEmbedScene&&(p=p.then(d=>import("./data/image-AG3CTRSJ.js").then(({encodePngMetadata:u})=>u({blob:d,metadata:Id(t,o,n,"local")})))),Sb(p,{description:"Export to PNG",name:s,extension:o.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[rC.png],fileHandle:l})}else if(e==="clipboard")try{let p=as(m);await Zu(p)}catch(p){throw console.warn(p),p.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(b("canvasError.canvasTooBig")):aB&&p.name==="TypeError"?new Error(`${b("alerts.couldNotCopyToClipboard")}
5
5
 
6
6
  ${b("hints.firefox_clipboard_write")}`):new Error(b("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")};var aC=async(e,t,o,n)=>{let{exportBackground:r,viewBackgroundColor:a,fileHandle:i}=t,s=r2(i);if(!i||!a2(s))throw new Error("fileHandle should exist and should be of type svg or png when resaving");t={...t,exportEmbedScene:!0};let{exportedElements:l,exportingFrame:c}=fs(e,t,!1);return await bs(s,l,t,o,{exportBackground:r,viewBackgroundColor:a,name:n,fileHandle:i,exportingFrame:c}),{fileHandle:i}};import{Fragment as fB,jsx as ha,jsxs as bB}from"react/jsx-runtime";var nx=Y({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,o)=>({appState:{...t,name:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:o,data:n,app:r})=>ha(Hk,{label:b("labels.fileTitle"),value:r.getName(),onChange:a=>t(a),ignoreFocus:n?.ignoreFocus??!1})}),iC=Y({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,o)=>({appState:{...t,exportScale:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o})=>{let n=gB(e),a=ft(n,t)?Me(n,t):n;return ha(fB,{children:uB.map(i=>{let[s,l]=o2(a,pB,i),c=`${b("imageExportDialog.label.scale")} ${i}x (${s}x${l})`;return ha(xe,{size:"small",type:"radio",icon:`${i}x`,name:"export-canvas-scale",title:c,"aria-label":c,id:"export-canvas-scale",checked:i===t.exportScale,onChange:()=>o(i)},i)})})}}),rx=Y({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,o)=>({appState:{...t,exportBackground:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>ha(Jd,{checked:e.exportBackground,onChange:o=>t(o),children:b("imageExportDialog.label.withBackground")})}),qu=Y({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,o)=>({appState:{...t,exportEmbedScene:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>bB(Jd,{checked:e.exportEmbedScene,onChange:o=>t(o),children:[b("imageExportDialog.label.embedScene"),ha(Fo,{label:b("imageExportDialog.tooltip.embedScene"),long:!0,children:ha("div",{className:"excalidraw-tooltip-icon",children:z2})})]})}),xs=Y({name:"saveToActiveFile",label:"buttons.save",icon:ls,trackEvent:{category:"export"},predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,o,n)=>{let r=!!t.fileHandle;try{let{fileHandle:a}=Zp(t.fileHandle)?await aC(e,t,n.files,n.getName()):await Kp(e,t,n.files,n.getName());return{captureUpdate:pr.EVENTUALLY,appState:{...t,fileHandle:a,toast:r?{message:a?.name?b("toast.fileSavedToFilename").replace("{filename}",`"${a.name}"`):b("toast.fileSaved")}:null}}}catch(a){return a?.name!=="AbortError"?console.error(a):console.warn(a),{captureUpdate:pr.EVENTUALLY}}},keyTest:e=>e.key===Xl.S&&e[Xl.CTRL_OR_CMD]&&!e.shiftKey}),rm=Y({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:ls,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,o,n)=>{try{let{fileHandle:r}=await Kp(e,{...t,fileHandle:null},n.files,n.getName());return{captureUpdate:pr.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:r,toast:{message:b("toast.fileSaved")}}}}catch(r){return r?.name!=="AbortError"?console.error(r):console.warn(r),{captureUpdate:pr.EVENTUALLY}}},keyTest:e=>e.key===Xl.S&&e.shiftKey&&e[Xl.CTRL_OR_CMD],PanelComponent:({updateData:e})=>ha(xe,{type:"button",icon:N2,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:Je().formFactor==="phone",hidden:!al,onClick:()=>e(null),"data-testid":"save-as-button"})}),jl=Y({name:"loadScene",label:"buttons.load",trackEvent:{category:"export"},predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,o,n)=>{try{let r=await il({description:"Excalidraw or video files"});if(Ka(r)){let l=t.width/2+t.offsetLeft,c=t.height/2+t.offsetTop,{x:m,y:p}=hB({clientX:l,clientY:c},t);return await n.insertVideos([r],m,p),!1}let{elements:a,appState:i,files:s}=await cl(r,t,e,r.handle??null);return{elements:a,appState:i,files:s,captureUpdate:pr.IMMEDIATELY}}catch(r){return r?.name==="AbortError"?(console.warn(r),!1):{elements:e,appState:{...t,errorMessage:r.message},files:n.files,captureUpdate:pr.EVENTUALLY}}},keyTest:e=>e[Xl.CTRL_OR_CMD]&&e.key===Xl.O}),sC=Y({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,o)=>({appState:{...t,exportWithDarkMode:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>ha("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:ha(zk,{value:e.exportWithDarkMode?ox.DARK:ox.LIGHT,onChange:o=>{t(o===ox.DARK)},title:b("imageExportDialog.label.darkMode")})})});import{DEFAULT_FONT_SIZE as xB,DEFAULT_FONT_FAMILY as yB,DEFAULT_TEXT_ALIGN as wB,CODES as lC,KEYS as cC,getLineHeight as vB}from"@orangecatai/common";import{newElementWith as Ju}from"@orangecatai/element";import{hasBoundTextElement as EB,canApplyRoundnessTypeToElement as IB,getDefaultRoundnessTypeForElement as TB,isFrameLikeElement as kB,isArrowElement as CB,isExcalidrawElement as SB,isTextElement as ax}from"@orangecatai/element";import{getBoundTextElement as MB,redrawTextBoundingBox as PB}from"@orangecatai/element";import{CaptureUpdateAction as ix}from"@orangecatai/element";var dC="{}",sx=Y({name:"copyStyles",label:"labels.copyStyles",icon:e0,trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=[],a=e.find(i=>t.selectedElementIds[i.id]);if(r.push(a),a&&EB(a)){let i=MB(a,n.scene.getNonDeletedElementsMap());r.push(i)}return a&&(dC=JSON.stringify(r)),{appState:{...t,toast:{message:b("toast.copyStyles")}},captureUpdate:ix.EVENTUALLY}},keyTest:e=>e[cC.CTRL_OR_CMD]&&e.altKey&&e.code===lC.C}),lx=Y({name:"pasteStyles",label:"labels.pasteStyles",icon:e0,trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=JSON.parse(dC),a=r[0],i=r[1];if(!SB(a))return{elements:e,captureUpdate:ix.EVENTUALLY};let s=Me(e,t,{includeBoundTextElement:!0}),l=s.map(c=>c.id);return{elements:e.map(c=>{if(l.includes(c.id)){let m=a;if(ax(c)&&c.containerId&&(m=i),!m)return c;let p=Ju(c,{backgroundColor:m?.backgroundColor,strokeWidth:m?.strokeWidth,strokeColor:m?.strokeColor,strokeStyle:m?.strokeStyle,fillStyle:m?.fillStyle,opacity:m?.opacity,roughness:m?.roughness,roundness:m.roundness?IB(m.roundness.type,c)?m.roundness:TB(c):null});if(ax(p)){let d=m.fontSize||xB,u=m.fontFamily||yB;p=Ju(p,{fontSize:d,fontFamily:u,textAlign:m.textAlign||wB,lineHeight:m.lineHeight||vB(u)});let g=null;p.containerId&&(g=s.find(h=>ax(p)&&h.id===p.containerId)||null),PB(p,g,n.scene)}return p.type==="arrow"&&CB(m)&&(p=Ju(p,{startArrowhead:m.startArrowhead,endArrowhead:m.endArrowhead})),kB(c)&&(p=Ju(p,{roundness:null,backgroundColor:"transparent"})),p}return c}),captureUpdate:ix.IMMEDIATELY}},keyTest:e=>e[cC.CTRL_OR_CMD]&&e.altKey&&e.code===lC.V});import{KEYS as AB}from"@orangecatai/common";import{CaptureUpdateAction as LB}from"@orangecatai/element";var ys=Y({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:L2,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,o,{focusContainer:n})=>(t.openDialog?.name==="help"&&n(),{appState:{...t,openDialog:t.openDialog?.name==="help"?null:{name:"help"},openMenu:null,openPopup:null},captureUpdate:LB.EVENTUALLY}),keyTest:e=>e.key===AB.QUESTION_MARK});import{getNonDeletedElements as eg}from"@orangecatai/element";import{newElementWith as uC}from"@orangecatai/element";import{isBoundToContainer as _B}from"@orangecatai/element";import{frameAndChildrenSelectedTogether as DB,getElementsInResizingFrame as RB,getFrameLikeElements as NB,getRootElements as BB,groupByFrameLikes as FB,removeElementsFromFrame as OB,replaceAllElementsInFrame as zB}from"@orangecatai/element";import{KEYS as tg,randomId as UB,arrayToMap as cx}from"@orangecatai/common";import{getSelectedGroupIds as Qu,selectGroup as HB,selectGroupsForSelectedElements as GB,getElementsInGroup as mC,addToGroup as $B,removeFromSelectedGroups as VB,isElementInGroup as gC}from"@orangecatai/element";import{syncMovedIndices as WB}from"@orangecatai/element";import{CaptureUpdateAction as am}from"@orangecatai/element";import{jsx as Zl}from"react/jsx-runtime";var KB=e=>{if(e.length>=2){let t=e[0].groupIds;for(let o of t)if(e.reduce((n,r)=>n&&gC(r,o),!0))return!0}return!1},pC=(e,t,o)=>{let n=o.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return n.length>=2&&!KB(n)&&!DB(n)},dx=Y({name:"group",label:"labels.group",icon:e=>Zl(jb,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=BB(n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(r.length<2)return{appState:t,elements:e,captureUpdate:am.EVENTUALLY};let a=Qu(t);if(a.length===1){let f=a[0],w=new Set(mC(e,f).map(E=>E.id)),y=new Set(r.map(E=>E.id));if(new Set([...Array.from(w),...Array.from(y)]).size===w.size)return{appState:t,elements:e,captureUpdate:am.EVENTUALLY}}let i=[...e];new Set(r.map(f=>f.frameId)).size>1&&FB(r).forEach((w,y)=>{OB(w,n.scene.getNonDeletedElementsMap())});let l=UB(),c=cx(r);i=i.map(f=>c.get(f.id)?uC(f,{groupIds:$B(f.groupIds,l,t.editingGroupId)}):f);let m=mC(i,l),p=m[m.length-1],d=i.lastIndexOf(p),u=i.slice(d+1),g=i.slice(0,d).filter(f=>!gC(f,l)),h=WB([...g,...m,...u],cx(m));return{appState:{...t,...HB(l,{...t,selectedGroupIds:{}},eg(i))},elements:h,captureUpdate:am.IMMEDIATELY}},predicate:(e,t,o,n)=>pC(e,t,n),keyTest:e=>!e.shiftKey&&e[tg.CTRL_OR_CMD]&&e.key===tg.G,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Zl(xe,{hidden:!pC(e,t,n),type:"button",icon:Zl(jb,{theme:t.theme}),onClick:()=>o(null),title:`${b("labels.group")} \u2014 ${$("CtrlOrCmd+G")}`,"aria-label":b("labels.group"),visible:ft(eg(e),t)})}),mx=Y({name:"ungroup",label:"labels.ungroup",icon:e=>Zl(Zb,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=Qu(t),a=cx(e);if(r.length===0)return{appState:t,elements:e,captureUpdate:am.EVENTUALLY};let i=[...e],s=[];i=i.map(d=>{_B(d)&&s.push(d.id);let u=VB(d.groupIds,t.selectedGroupIds);return u.length===d.groupIds.length?d:uC(d,{groupIds:u})});let l=GB(t,eg(i),t,null),c=n.scene.getSelectedElements(t),m=new Set(c.filter(d=>d.frameId).map(d=>d.frameId));return NB(e).filter(d=>m.has(d.id)).forEach(d=>{d&&(i=zB(i,RB(i,d,t,a),d,n))}),l.selectedElementIds=Object.entries(l.selectedElementIds).reduce((d,[u,g])=>(g&&!s.includes(u)&&(d[u]=!0),d),{}),{appState:{...t,...l},elements:i,captureUpdate:am.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[tg.CTRL_OR_CMD]&&e.key===tg.G.toUpperCase(),predicate:(e,t)=>Qu(t).length>0,PanelComponent:({elements:e,appState:t,updateData:o})=>Zl(xe,{type:"button",hidden:Qu(t).length===0,icon:Zl(Zb,{theme:t.theme}),onClick:()=>o(null),title:`${b("labels.ungroup")} \u2014 ${$("CtrlOrCmd+Shift+G")}`,"aria-label":b("labels.ungroup"),visible:ft(eg(e),t)})});import QB from"clsx";import{CaptureUpdateAction as yC}from"@orangecatai/element";import{invariant as eF}from"@orangecatai/common";import{COLOR_CHARCOAL_BLACK as YB,COLOR_VOICE_CALL as XB,COLOR_WHITE as ng,THEME as jB,UserIdleState as hC}from"@orangecatai/common";var og=(e,t,o,n,r,a,i)=>{e.beginPath(),e.moveTo(t+a,o),e.lineTo(t+n-a,o),e.quadraticCurveTo(t+n,o,t+n,o+a),e.lineTo(t+n,o+r-a),e.quadraticCurveTo(t+n,o+r,t+n-a,o+r),e.lineTo(t+a,o+r),e.quadraticCurveTo(t,o+r,t,o+r-a),e.lineTo(t,o+a),e.quadraticCurveTo(t,o,t+a,o),e.closePath(),e.fill(),i&&(e.strokeStyle=i),e.stroke()};function ZB(e){let t=0;if(e.length===0)return t;for(let o=0;o<e.length;o++){let n=e.charCodeAt(o);t=(t<<5)-t+n}return t}var ws=(e,t)=>`hsl(${Math.abs(ZB(t?.id||e))%37*10}, 100%, 83%)`,fC=e=>{let t=e?.trim()?.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},bC=({context:e,renderConfig:t,appState:o,normalizedWidth:n,normalizedHeight:r})=>{for(let[a,i]of t.remotePointerViewportCoords){let{x:s,y:l}=i,c=o.collaborators.get(a);s-=o.offsetLeft,l-=o.offsetTop;let m=11,p=14,d=s<0||s>n-m||l<0||l>r-p;s=Math.max(s,0),s=Math.min(s,n-m),l=Math.max(l,0),l=Math.min(l,r-p);let u=ws(a,c);e.save(),e.strokeStyle=u,e.fillStyle=u;let g=t.remotePointerUserStates.get(a),h=d||g===hC.IDLE||g===hC.AWAY;h&&(e.globalAlpha=.3),t.remotePointerButton.get(a)==="down"&&(e.beginPath(),e.arc(s,l,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(s,l,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=u,e.stroke(),e.closePath());let f=o.theme===jB.DARK?"#2f6330":XB,w=c?.isSpeaking;w&&(e.fillStyle=f,e.strokeStyle=f,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(s,l),e.lineTo(s+0,l+14),e.lineTo(s+4,l+9),e.lineTo(s+11,l+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=ng,e.strokeStyle=ng,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(s,l),e.lineTo(s+0,l+14),e.lineTo(s+4,l+9),e.lineTo(s+11,l+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=u,e.strokeStyle=u,e.lineWidth=2,e.lineJoin="round",e.beginPath(),h?(e.moveTo(s-1,l-1),e.lineTo(s-1,l+15),e.lineTo(s+5,l+10),e.lineTo(s+12,l+9),e.closePath(),e.fill()):(e.moveTo(s,l),e.lineTo(s+0,l+14),e.lineTo(s+4,l+9),e.lineTo(s+11,l+8),e.closePath(),e.fill(),e.stroke());let y=t.remotePointerUsernames.get(a)||"";if(!d&&y){e.font="600 12px sans-serif";let v=(w?s+0:s)+m/2,E=(w?l+0:l)+p+2,I=5,k=3,S=e.measureText(y),T=S.actualBoundingBoxDescent+S.actualBoundingBoxAscent,A=Math.max(T,12),R=v-1,M=E-1,P=S.width+2+I*2+2,F=A+2+k*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(R,M,P,F,8),e.fillStyle=u,e.fill(),e.strokeStyle=ng,e.stroke(),w&&(e.beginPath(),e.roundRect(R-2,M-2,P+4,F+4,8),e.strokeStyle=f,e.stroke())):og(e,R,M,P,F,8,ng),e.fillStyle=YB,e.fillText(y,v+I+1,E+k+S.actualBoundingBoxAscent+Math.floor((A-T)/2)+2),w){e.fillStyle=f;let U=8,B=8,G=5;e.fillRect(R+P+B,M+(F/2-U/2),2,U),e.fillRect(R+P+B+G,M+(F/2-U*2/2),2,U*2),e.fillRect(R+P+B+G*2,M+(F/2-U/2),2,U)}}e.restore(),e.closePath()}};import qB from"clsx";import{useState as JB}from"react";import{jsx as xC}from"react/jsx-runtime";var px=({color:e,onClick:t,name:o,src:n,className:r})=>{let a=fC(o),[i,s]=JB(!1),l=!i&&n,c=l?void 0:{background:e};return xC("div",{className:qB("Avatar",r),style:c,onClick:t,children:l?xC("img",{className:"Avatar-img",src:n,alt:a,referrerPolicy:"no-referrer",onError:()=>s(!0)}):a})};import{jsx as Fr,jsxs as rg}from"react/jsx-runtime";var tF=Y({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,o)=>(eF(o,"actionGoToCollaborator: collaborator should be defined when actionGoToCollaborator is called"),!o.socketId||t.userToFollow?.socketId===o.socketId||o.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:yC.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:o.socketId,username:o.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:yC.EVENTUALLY}),PanelComponent:({updateData:e,data:t,appState:o})=>{let{socketId:n,collaborator:r,withName:a,isBeingFollowed:i}=t,s=ws(n,r),l=QB({"is-followed":i,"is-current-user":r.isCurrentUser===!0,"is-speaking":r.isSpeaking,"is-in-call":r.isInCall,"is-muted":r.isMuted}),c=r.isInCall?r.isSpeaking?rg("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:b("userList.hint.isSpeaking"),children:[Fr("div",{}),Fr("div",{}),Fr("div",{})]}):r.isMuted?Fr("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:b("userList.hint.micMuted"),children:GI}):Fr("div",{title:b("userList.hint.inCall"),children:HI}):null;return a?rg("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${l}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(r),children:[Fr(px,{color:s,onClick:()=>{},name:r.username||"",src:r.avatarUrl,className:l}),Fr("div",{className:"UserList__collaborator-name",children:r.username}),rg("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[i&&Fr("div",{className:"UserList__collaborator-status-icon-is-followed",title:b("userList.hint.followStatus"),children:kl}),c]})]}):rg("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${l}`,children:[Fr(px,{color:s,onClick:()=>{e(r)},name:r.username||"",src:r.avatarUrl,className:l}),c&&Fr("div",{className:"UserList__collaborator-status-icon",children:c})]})}});import{LIBRARY_DISABLED_TYPES as oF,randomId as nF}from"@orangecatai/common";import{deepCopyElement as rF}from"@orangecatai/element";import{CaptureUpdateAction as ux}from"@orangecatai/element";var gx=Y({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let a of oF)if(r.some(i=>i.type===a))return{captureUpdate:ux.EVENTUALLY,appState:{...t,errorMessage:b(`errors.libraryElementTypeError.${a}`)}};return n.library.getLatestLibrary().then(a=>n.library.setLibrary([{id:nF(),status:"unpublished",elements:r.map(rF),created:Date.now()},...a])).then(()=>({captureUpdate:ux.EVENTUALLY,appState:{...t,toast:{message:b("toast.addedToLibrary")}}})).catch(a=>({captureUpdate:ux.EVENTUALLY,appState:{...t,errorMessage:a.message}}))},label:"labels.addToLibrary"});import{getNonDeletedElements as ql}from"@orangecatai/element";import{isFrameLikeElement as aF}from"@orangecatai/element";import{updateFrameMembershipOfSelectedElements as iF}from"@orangecatai/element";import{KEYS as ii,arrayToMap as sF}from"@orangecatai/common";import{alignElements as lF}from"@orangecatai/element";import{CaptureUpdateAction as Jl}from"@orangecatai/element";import{getSelectedElementsByGroup as cF}from"@orangecatai/element";import{jsx as ec}from"react/jsx-runtime";var Ko=(e,t)=>{let o=t.scene.getSelectedElements(e);return cF(o,t.scene.getNonDeletedElementsMap(),e).length>1&&!o.some(n=>aF(n))},Ql=(e,t,o,n)=>{let r=o.scene.getSelectedElements(t),a=lF(r,n,o.scene,t),i=sF(a);return iF(e.map(s=>i.get(s.id)||s),t,o)},dF=Y({name:"alignTop",label:"labels.alignTop",icon:$b,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"start",axis:"y"}),captureUpdate:Jl.IMMEDIATELY}),keyTest:e=>e[ii.CTRL_OR_CMD]&&e.shiftKey&&e.key===ii.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(xe,{hidden:!Ko(t,n),type:"button",icon:$b,onClick:()=>o(null),title:`${b("labels.alignTop")} \u2014 ${$("CtrlOrCmd+Shift+Up")}`,"aria-label":b("labels.alignTop"),visible:ft(ql(e),t)})}),mF=Y({name:"alignBottom",label:"labels.alignBottom",icon:Vb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"end",axis:"y"}),captureUpdate:Jl.IMMEDIATELY}),keyTest:e=>e[ii.CTRL_OR_CMD]&&e.shiftKey&&e.key===ii.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(xe,{hidden:!Ko(t,n),type:"button",icon:Vb,onClick:()=>o(null),title:`${b("labels.alignBottom")} \u2014 ${$("CtrlOrCmd+Shift+Down")}`,"aria-label":b("labels.alignBottom"),visible:ft(ql(e),t)})}),pF=Y({name:"alignLeft",label:"labels.alignLeft",icon:Wb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"start",axis:"x"}),captureUpdate:Jl.IMMEDIATELY}),keyTest:e=>e[ii.CTRL_OR_CMD]&&e.shiftKey&&e.key===ii.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(xe,{hidden:!Ko(t,n),type:"button",icon:Wb,onClick:()=>o(null),title:`${b("labels.alignLeft")} \u2014 ${$("CtrlOrCmd+Shift+Left")}`,"aria-label":b("labels.alignLeft"),visible:ft(ql(e),t)})}),uF=Y({name:"alignRight",label:"labels.alignRight",icon:Kb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"end",axis:"x"}),captureUpdate:Jl.IMMEDIATELY}),keyTest:e=>e[ii.CTRL_OR_CMD]&&e.shiftKey&&e.key===ii.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(xe,{hidden:!Ko(t,n),type:"button",icon:Kb,onClick:()=>o(null),title:`${b("labels.alignRight")} \u2014 ${$("CtrlOrCmd+Shift+Right")}`,"aria-label":b("labels.alignRight"),visible:ft(ql(e),t)})}),gF=Y({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:Yb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"center",axis:"y"}),captureUpdate:Jl.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(xe,{hidden:!Ko(t,n),type:"button",icon:Yb,onClick:()=>o(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:ft(ql(e),t)})}),hF=Y({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:Xb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"center",axis:"x"}),captureUpdate:Jl.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(xe,{hidden:!Ko(t,n),type:"button",icon:Xb,onClick:()=>o(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:ft(ql(e),t)})});import{getNonDeletedElements as wC}from"@orangecatai/element";import{isFrameLikeElement as fF}from"@orangecatai/element";import{CODES as vC,KEYS as EC,arrayToMap as bF}from"@orangecatai/common";import{updateFrameMembershipOfSelectedElements as xF}from"@orangecatai/element";import{distributeElements as yF}from"@orangecatai/element";import{CaptureUpdateAction as IC}from"@orangecatai/element";import{getSelectedElementsByGroup as wF}from"@orangecatai/element";import{jsx as CC}from"react/jsx-runtime";var TC=(e,t)=>{let o=t.scene.getSelectedElements(e);return wF(o,t.scene.getNonDeletedElementsMap(),e).length>2&&!o.some(n=>fF(n))},kC=(e,t,o,n)=>{let r=o.scene.getSelectedElements(t),a=yF(r,o.scene.getNonDeletedElementsMap(),n,t,o.scene),i=bF(a);return xF(e.map(s=>i.get(s.id)||s),t,o)},vF=Y({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,o,n)=>({appState:t,elements:kC(e,t,n,{space:"between",axis:"x"}),captureUpdate:IC.IMMEDIATELY}),keyTest:e=>!e[EC.CTRL_OR_CMD]&&e.altKey&&e.code===vC.H,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>CC(xe,{hidden:!TC(t,n),type:"button",icon:$2,onClick:()=>o(null),title:`${b("labels.distributeHorizontally")} \u2014 ${$("Alt+H")}`,"aria-label":b("labels.distributeHorizontally"),visible:ft(wC(e),t)})}),EF=Y({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,o,n)=>({appState:t,elements:kC(e,t,n,{space:"between",axis:"y"}),captureUpdate:IC.IMMEDIATELY}),keyTest:e=>!e[EC.CTRL_OR_CMD]&&e.altKey&&e.code===vC.V,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>CC(xe,{hidden:!TC(t,n),type:"button",icon:V2,onClick:()=>o(null),title:`${b("labels.distributeVertically")} \u2014 ${$("Alt+V")}`,"aria-label":b("labels.distributeVertically"),visible:ft(wC(e),t)})});import{getNonDeletedElements as IF}from"@orangecatai/element";import{bindOrUnbindBindingElements as TF}from"@orangecatai/element";import{getCommonBoundingBox as SC}from"@orangecatai/element";import{newElementWith as kF}from"@orangecatai/element";import{deepCopyElement as CF}from"@orangecatai/element";import{resizeMultipleElements as SF}from"@orangecatai/element";import{isArrowElement as MC,isElbowArrow as MF}from"@orangecatai/element";import{updateFrameMembershipOfSelectedElements as PC}from"@orangecatai/element";import{CODES as AC,KEYS as PF,arrayToMap as AF}from"@orangecatai/common";import{CaptureUpdateAction as LC}from"@orangecatai/element";var hx=Y({name:"flipHorizontal",label:"labels.flipHorizontal",icon:KI,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:PC(_C(e,n.scene.getNonDeletedElementsMap(),t,"horizontal",n),t,n),appState:t,captureUpdate:LC.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===AC.H}),fx=Y({name:"flipVertical",label:"labels.flipVertical",icon:WI,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:PC(_C(e,n.scene.getNonDeletedElementsMap(),t,"vertical",n),t,n),appState:t,captureUpdate:LC.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===AC.V&&!e[PF.CTRL_OR_CMD]}),_C=(e,t,o,n,r)=>{let a=Me(IF(e),o,{includeBoundTextElement:!0,includeElementsInFrames:!0}),i=LF(a,t,n,r),s=AF(i);return e.map(l=>s.get(l.id)||l)},LF=(e,t,o,n)=>{if(e.every(d=>MC(d)&&(d.startBinding||d.endBinding)))return e.map(d=>{let u=d;return kF(u,{startArrowhead:u.endArrowhead,endArrowhead:u.startArrowhead})});let{midX:r,midY:a}=SC(e);SF(e,t,"nw",n.scene,new Map(Array.from(t.values()).map(d=>[d.id,CF(d)])),{flipByX:o==="horizontal",flipByY:o==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),TF(e.filter(MC),n.scene,n.state);let{elbowArrows:i,otherElements:s}=e.reduce((d,u)=>MF(u)?{...d,elbowArrows:d.elbowArrows.concat(u)}:{...d,otherElements:d.otherElements.concat(u)},{elbowArrows:[],otherElements:[]}),{midX:l,midY:c}=SC(e),[m,p]=[r-l,a-c];return s.forEach(d=>n.scene.mutateElement(d,{x:d.x+m,y:d.y+p})),i.forEach(d=>n.scene.mutateElement(d,{x:d.x+m,y:d.y+p})),e};import{isTextElement as _F}from"@orangecatai/element";import{getTextFromElements as DF}from"@orangecatai/element";import{CODES as RF,KEYS as DC,isFirefox as NF}from"@orangecatai/common";import{CaptureUpdateAction as vn}from"@orangecatai/element";var tc=Y({name:"copy",label:"labels.copy",icon:Md,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await Xu(r,n.files,o)}catch(a){return{captureUpdate:vn.EVENTUALLY,appState:{...t,errorMessage:a.message}}}return{captureUpdate:vn.EVENTUALLY}},keyTest:void 0}),bx=Y({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,o,n)=>{let r;try{r=await tC()}catch(a){return a.name==="AbortError"||a.name==="NotAllowedError"?!1:(console.error(`actionPaste ${a.name}: ${a.message}`),NF?{captureUpdate:vn.EVENTUALLY,appState:{...t,errorMessage:b("hints.firefox_clipboard_write")}}:{captureUpdate:vn.EVENTUALLY,appState:{...t,errorMessage:b("errors.asyncPasteFailedOnRead")}})}try{n.pasteFromClipboard(Qk({types:r}))}catch(a){return console.error(a),{captureUpdate:vn.EVENTUALLY,appState:{...t,errorMessage:b("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:vn.EVENTUALLY}},keyTest:void 0}),ag=Y({name:"cut",label:"labels.cut",icon:PI,trackEvent:{category:"element"},perform:(e,t,o,n)=>(tc.perform(e,t,o,n),Fd.perform(e,t,null,n)),keyTest:e=>e[DC.CTRL_OR_CMD]&&e.key===DC.X}),ig=Y({name:"copyAsSvg",label:"labels.copyAsSvg",icon:YI,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{if(!n.canvas)return{captureUpdate:vn.EVENTUALLY};let{exportedElements:r,exportingFrame:a}=fs(e,t,!0);try{await bs("clipboard-svg",r,t,n.files,{...t,exportingFrame:a,name:n.getName()});let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:b("toast.copyToClipboardAsSvg",{exportSelection:i.length?b("toast.selection"):b("toast.canvas"),exportColorScheme:t.exportWithDarkMode?b("buttons.darkMode"):b("buttons.lightMode")})}},captureUpdate:vn.EVENTUALLY}}catch(i){return console.error(i),{appState:{errorMessage:i.message},captureUpdate:vn.EVENTUALLY}}},predicate:e=>Yu&&e.length>0,keywords:["svg","clipboard","copy"]}),sg=Y({name:"copyAsPng",label:"labels.copyAsPng",icon:XI,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{if(!n.canvas)return{captureUpdate:vn.EVENTUALLY};let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:a,exportingFrame:i}=fs(e,t,!0);try{return await bs("clipboard",a,t,n.files,{...t,exportingFrame:i,name:n.getName()}),{appState:{...t,toast:{message:b("toast.copyToClipboardAsPng",{exportSelection:r.length?b("toast.selection"):b("toast.canvas"),exportColorScheme:t.exportWithDarkMode?b("buttons.darkMode"):b("buttons.lightMode")})}},captureUpdate:vn.EVENTUALLY}}catch(s){return console.error(s),{appState:{...t,errorMessage:s.message},captureUpdate:vn.EVENTUALLY}}},predicate:e=>Kl&&e.length>0,keyTest:e=>e.code===RF.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),lg=Y({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{mr(DF(r))}catch{throw new Error(b("errors.copyToSystemClipboardFailed"))}return{captureUpdate:vn.EVENTUALLY}},predicate:(e,t,o,n)=>Yu&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(_F),keywords:["text","clipboard","copy"]});import{CODES as BF,KEYS as FF}from"@orangecatai/common";import{CaptureUpdateAction as OF}from"@orangecatai/element";var oc=Y({name:"gridMode",icon:QI,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:OF.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,o)=>o.gridModeEnabled===void 0,keyTest:e=>e[FF.CTRL_OR_CMD]&&e.code===BF.QUOTE});import{CODES as zF,KEYS as UF}from"@orangecatai/common";import{CaptureUpdateAction as HF}from"@orangecatai/element";var si=Y({name:"zenMode",label:"buttons.zenMode",icon:ZI,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:HF.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,o,n)=>n.editorInterface.formFactor!=="phone"&&typeof o.zenModeEnabled>"u",keyTest:e=>!e[UF.CTRL_OR_CMD]&&e.altKey&&e.code===zF.Z});import{CODES as GF,KEYS as $F}from"@orangecatai/common";import{CaptureUpdateAction as VF}from"@orangecatai/element";var im=Y({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:jI,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:VF.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,o)=>typeof o.objectsSnapModeEnabled>"u",keyTest:e=>!e[$F.CTRL_OR_CMD]&&e.altKey&&e.code===GF.S});import{CODES as WF,KEYS as KF}from"@orangecatai/common";import{CaptureUpdateAction as YF}from"@orangecatai/element";var li=Y({name:"stats",label:"stats.fullTitle",icon:VI,viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:YF.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[KF.CTRL_OR_CMD]&&e.altKey&&e.code===WF.SLASH});import{BOUND_TEXT_PADDING as RC,ROUNDNESS as NC,TEXT_ALIGN as OC,VERTICAL_ALIGN as zC,arrayToMap as UC,getFontString as XF}from"@orangecatai/common";import{getOriginalContainerHeightFromCache as jF,isBoundToContainer as BC,resetOriginalContainerCache as ZF,updateOriginalContainerCache as qF}from"@orangecatai/element";import{computeBoundTextPosition as JF,computeContainerDimensionForBoundText as FC,getBoundTextElement as HC,redrawTextBoundingBox as GC}from"@orangecatai/element";import{hasBoundTextElement as QF,isArrowElement as eO,isTextBindableContainer as xx,isTextElement as sm,isUsingAdaptiveRadius as tO}from"@orangecatai/element";import{measureText as oO}from"@orangecatai/element";import{syncMovedIndices as $C}from"@orangecatai/element";import{newElement as nO}from"@orangecatai/element";import{CaptureUpdateAction as yx}from"@orangecatai/element";var wx=Y({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,o,n)=>n.scene.getSelectedElements(t).some(a=>QF(a)),perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=n.scene.getNonDeletedElementsMap();return r.forEach(i=>{let s=HC(i,a);if(s){let{width:l,height:c}=oO(s.originalText,XF(s),s.lineHeight),m=jF(i.id);ZF(i.id);let{x:p,y:d}=JF(i,s,a);n.scene.mutateElement(s,{containerId:null,width:l,height:c,text:s.originalText,x:p,y:d}),n.scene.mutateElement(i,{boundElements:i.boundElements?.filter(u=>u.id!==s.id),height:m||i.height})}}),{elements:e,appState:t,captureUpdate:yx.IMMEDIATELY}}}),vx=Y({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);if(r.length===2){let a=sm(r[0])||sm(r[1]),i;if(xx(r[0])?i=r[0]:xx(r[1])&&(i=r[1]),a&&i&&HC(i,n.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a,i;sm(r[0])&&xx(r[1])?(a=r[0],i=r[1]):(a=r[1],i=r[0]),n.scene.mutateElement(a,{containerId:i.id,verticalAlign:zC.MIDDLE,textAlign:OC.CENTER,autoResize:!0,angle:eO(i)?0:i?.angle??0}),n.scene.mutateElement(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:a.id})});let s=i.height;return GC(a,i,n.scene),qF(i.id,s),{elements:rO(e,i,a),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:yx.IMMEDIATELY}}}),rO=(e,t,o)=>{let n=e.slice(),r=n.findIndex(i=>i.id===o.id);n.splice(r,1);let a=n.findIndex(i=>i.id===t.id);return n.splice(a+1,0,o),$C(n,UC([t,o])),n},aO=(e,t,o)=>{let n=e.slice(),r=n.findIndex(i=>i.id===t.id);n.splice(r,1);let a=n.findIndex(i=>i.id===o.id);return n.splice(a,0,t),$C(n,UC([t,o])),n},VC=Y({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=r.some(i=>sm(i)&&!BC(i));return r.length>0&&a},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=e.slice(),i={};for(let s of r)if(sm(s)&&!BC(s)){let l=nO({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...s.boundElements||[],{id:s.id,type:"text"}],angle:s.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:tO("rectangle")?NC.ADAPTIVE_RADIUS:NC.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:s.x-RC,y:s.y-RC,width:FC(s.width,"rectangle"),height:FC(s.height,"rectangle"),groupIds:s.groupIds,frameId:s.frameId});if(s.boundElements?.length){let c=s.boundElements.filter(p=>p.type==="arrow").map(p=>p.id);a.filter(p=>c.includes(p.id)).forEach(p=>{let d=p.startBinding,u=p.endBinding;d?.elementId===s.id&&(d={...d,elementId:l.id}),u?.elementId===s.id&&(u={...u,elementId:l.id}),(d||u)&&n.scene.mutateElement(p,{startBinding:d,endBinding:u})})}n.scene.mutateElement(s,{containerId:l.id,verticalAlign:zC.MIDDLE,boundElements:null,textAlign:OC.CENTER,autoResize:!0}),GC(s,l,n.scene),a=aO([...a,l],l,s),i[l.id]=!0}return{elements:a,appState:{...t,selectedElementIds:i},captureUpdate:yx.IMMEDIATELY}}});import{isEmbeddableElement as EO}from"@orangecatai/element";import{KEYS as e5}from"@orangecatai/common";import{CaptureUpdateAction as IO}from"@orangecatai/element";import{pointFrom as XC}from"@orangecatai/math";import iO from"clsx";import{useCallback as WC,useEffect as KC,useLayoutEffect as sO,useRef as lO,useState as cO}from"react";import{EVENT as Ex,HYPERLINK_TOOLTIP_DELAY as dO,KEYS as cg}from"@orangecatai/common";import{getElementAbsoluteCoords as Sx}from"@orangecatai/element";import{hitElementBoundingBox as mO}from"@orangecatai/element";import{isElementLink as pO}from"@orangecatai/element";import{getEmbedLink as uO,embeddableURLValidator as gO}from"@orangecatai/element";import{sceneCoordsToViewportCoords as jC,viewportCoordsToSceneCoords as hO,wrapEvent as fO,isLocalLink as bO,normalizeLink as Ix}from"@orangecatai/common";import{isEmbeddableElement as Tx}from"@orangecatai/element";import{jsx as nc,jsxs as YC}from"react/jsx-runtime";var Mx=380,xO=42,kx=5,ZC=85,yO=500,Cx=!1,dg=new Map,qC=({element:e,scene:t,setAppState:o,onLinkOpen:n,setToast:r,updateEmbedValidationStatus:a})=>{let i=t.getNonDeletedElementsMap(),s=nn(),l=Dr(),c=Je(),m=e.link||"",[p,d]=cO(m),u=lO(null),g=s.showHyperlinkPopup==="editor",h=WC(()=>{if(!u.current)return;let E=Ix(u.current.value)||null;if(!e.link&&E&&Ne("hyperlink","create"),Tx(e)){if(s.activeEmbeddable?.element===e&&o({activeEmbeddable:null}),!E){t.mutateElement(e,{link:null}),a(e,!1);return}if(!gO(E,l.validateEmbeddable))E&&r({message:b("toast.unableToEmbed"),closable:!0}),e.link&&dg.set(e.id,e.link),t.mutateElement(e,{link:E}),a(e,!1);else{let{width:I,height:k}=e,S=uO(E);S?.error instanceof URIError&&r({message:b("toast.unrecognizedLinkFormat"),closable:!0});let T=S?S.intrinsicSize.w/S.intrinsicSize.h:1,A=dg.get(e.id)!==e.link;t.mutateElement(e,{...A?{width:S?.type==="video"?I>k?I:k*T:I,height:S?.type==="video"&&I>k?I/T:k}:{},link:E}),a(e,!0),dg.has(e.id)&&dg.delete(e.id)}}else t.mutateElement(e,{link:E})},[e,t,r,l.validateEmbeddable,s.activeEmbeddable,o,a]);sO(()=>()=>{h()},[h]),KC(()=>{g&&u?.current&&!(c.formFactor==="phone"||c.isTouchScreen)&&u.current.select()},[g,c.formFactor,c.isTouchScreen]),KC(()=>{let E=null,I=k=>{if(g)return;E&&clearTimeout(E),vO(e,i,s,XC(k.clientX,k.clientY))&&(E=window.setTimeout(()=>{o({showHyperlinkPopup:!1})},yO))};return window.addEventListener(Ex.POINTER_MOVE,I,!1),()=>{window.removeEventListener(Ex.POINTER_MOVE,I,!1),E&&clearTimeout(E)}},[s,e,g,o,i]);let f=WC(()=>{Ne("hyperlink","delete"),t.mutateElement(e,{link:null}),o({showHyperlinkPopup:!1})},[o,e,t]),w=()=>{Ne("hyperlink","edit","popup-ui"),o({showHyperlinkPopup:"editor"})},{x:y,y:v}=JC(e,s,i);return s.contextMenu||s.selectedElementsAreBeingDragged||s.resizingElement||s.isRotating||s.openMenu||s.viewModeEnabled?null:YC("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${v}px`,left:`${y}px`,width:Mx,padding:kx},children:[g?nc("input",{className:iO("excalidraw-hyperlinkContainer-input"),placeholder:b("labels.link.hint"),ref:u,value:p,onChange:E=>d(E.target.value),autoFocus:!0,onKeyDown:E=>{E.stopPropagation(),E[cg.CTRL_OR_CMD]&&E.key===cg.K&&E.preventDefault(),(E.key===cg.ENTER||E.key===cg.ESCAPE)&&(h(),o({showHyperlinkPopup:"info"}))}}):e.link?nc("a",{href:Ix(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:bO(e.link)?"_self":"_blank",onClick:E=>{if(e.link&&n){let I=fO(Ex.EXCALIDRAW_LINK,E.nativeEvent);n({...e,link:Ix(e.link)},I),I.defaultPrevented&&E.preventDefault()}},rel:"noopener noreferrer",children:e.link}):nc("div",{className:"excalidraw-hyperlinkContainer-link",children:b("labels.link.empty")}),YC("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!g&&nc(xe,{type:"button",title:b("buttons.edit"),"aria-label":b("buttons.edit"),label:b("buttons.edit"),onClick:w,className:"excalidraw-hyperlinkContainer--edit",icon:Pr}),nc(xe,{type:"button",title:b("labels.linkToElement"),"aria-label":b("labels.linkToElement"),label:b("labels.linkToElement"),onClick:()=>{o({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:fu}),m&&!Tx(e)&&nc(xe,{type:"button",title:b("buttons.remove"),"aria-label":b("buttons.remove"),label:b("buttons.remove"),onClick:f,className:"excalidraw-hyperlinkContainer--remove",icon:Co})]})]})},JC=(e,t,o)=>{let[n,r]=Sx(e,o),{x:a,y:i}=jC({sceneX:n+e.width/2,sceneY:r},t),s=a-t.offsetLeft-Mx/2,l=i-t.offsetTop-ZC;return{x:s,y:l}},Px=(e,t)=>{let o=Me(e,t);return Tx(o[0])?"labels.link.editEmbed":o[0]?.link?"labels.link.edit":"labels.link.create"},lm=null,QC=(e,t,o)=>{lm&&clearTimeout(lm),lm=window.setTimeout(()=>wO(e,t,o),dO)},wO=(e,t,o)=>{if(!e.link)return;let n=Hl();n.classList.add("excalidraw-tooltip--visible"),n.style.maxWidth="20rem",n.textContent=pO(e.link)?b("labels.link.goToElement"):e.link;let[r,a,i,s]=Sx(e,o),[l,c,m,p]=JE([r,a,i,s],e.angle,t),d=jC({sceneX:l,sceneY:c},t);W0(n,{left:d.x,top:d.y,width:m,height:p},"top"),Ne("hyperlink","tooltip","link-icon"),Cx=!0},Ax=()=>{lm&&clearTimeout(lm),Cx&&(Cx=!1,Hl().classList.remove("excalidraw-tooltip--visible"))},vO=(e,t,o,[n,r])=>{let{x:a,y:i}=hO({clientX:n,clientY:r},o),s=15/o.zoom.value;if(mO(XC(a,i),e,t))return!1;let[l,c,m]=Sx(e,t);if(a>=l&&a<=m&&i>=c-ZC&&i<=c)return!1;let{x:p,y:d}=JC(e,o,t);return!(n>=p-s&&n<=p+Mx+kx*2+s&&r>=d-s&&r<=d+s+kx*2+xO)};import{jsx as TO}from"react/jsx-runtime";var cm=Y({name:"hyperlink",label:(e,t)=>Px(e,t),icon:Ld,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:IO.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[e5.CTRL_OR_CMD]&&e.key===e5.K,predicate:(e,t)=>Me(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:o})=>{let n=Me(e,t);return TO(xe,{type:"button",icon:Ld,"aria-label":b(Px(e,t)),title:`${EO(e[0])?b("labels.link.labelEmbed"):b("labels.link.label")} - ${$("CtrlOrCmd+K")}`,onClick:()=>o(null),selected:n.length===1&&!!n[0].link})}});import{KEYS as t5,arrayToMap as _x,randomId as kO}from"@orangecatai/common";import{elementsAreInSameGroup as CO,newElementWith as o5,selectGroupsFromGivenElements as n5}from"@orangecatai/element";import{CaptureUpdateAction as r5}from"@orangecatai/element";var Lx=e=>e.every(t=>!t.locked),dm=Y({name:"toggleElementLock",label:(e,t,o)=>{let n=o.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return Lx(n)?"labels.elementLock.lock":"labels.elementLock.unlock"},icon:(e,t)=>{let o=Me(t,e);return Lx(o)?ul:is},trackEvent:{category:"element"},predicate:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return r.length>0&&!r.some(a=>a.locked&&a.frameId)},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!r.length)return!1;let a=Lx(r),i=_x(r),s=r.length>1&&CO(r),c=r.length===1||s?null:kO(),m={...t.lockedMultiSelections};if(a)m={...t.lockedMultiSelections,...c?{[c]:!0}:{}};else if(s){let w=r[0].groupIds.at(-1);delete m[w]}let p=e.map(w=>{if(!i.has(w.id))return w;let y=w.groupIds;return a?c&&(y=[...y,c]):y=y.filter(v=>!t.lockedMultiSelections[v]),o5(w,{locked:a,groupIds:y.length!==w.groupIds.length?y:w.groupIds})}),d=_x(p),u=a?{}:Object.fromEntries(r.map(w=>[w.id,!0])),g=r.map(w=>d.get(w.id)||w),h=a?{}:n5(g,t),f=a?c||(s?r[0].groupIds.at(-1):r[0].id):null;return{elements:p,appState:{...t,selectedElementIds:u,selectedGroupIds:h,selectedLinearElement:a?null:t.selectedLinearElement,lockedMultiSelections:m,activeLockedId:f},captureUpdate:r5.IMMEDIATELY}},keyTest:(e,t,o,n)=>e.key.toLocaleLowerCase()===t5.L&&e[t5.CTRL_OR_CMD]&&e.shiftKey&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),a5=Y({name:"unlockAllElements",trackEvent:{category:"canvas"},viewMode:!1,icon:is,predicate:(e,t)=>Me(e,t).length===0&&e.some(n=>n.locked),perform:(e,t)=>{let o=e.filter(i=>i.locked),n=e.map(i=>{if(i.locked){let s=i.groupIds.filter(l=>!t.lockedMultiSelections[l]);return o5(i,{locked:!1,groupIds:i.groupIds.length!==s.length?s:i.groupIds})}return i}),r=_x(n),a=o.map(i=>r.get(i.id)||i);return{elements:n,appState:{...t,selectedElementIds:Object.fromEntries(o.map(i=>[i.id,!0])),selectedGroupIds:n5(a,t),lockedMultiSelections:{},activeLockedId:null},captureUpdate:r5.IMMEDIATELY}},label:"labels.elementLock.unlockAll"});import{isElbowArrow as p$,isLinearElement as u$,isLineElement as Ic}from"@orangecatai/element";import{arrayToMap as g$,invariant as U1}from"@orangecatai/common";import{toggleLinePolygonState as h$,CaptureUpdateAction as SS}from"@orangecatai/element";import tS from"clsx";import oG from"fuzzy";import{useEffect as zg,useRef as oS,useMemo as nG,useState as Og}from"react";import{DEFAULT_SIDEBAR as J3,EVENT as Hg,KEYS as hr,capitalizeString as rG,isWritableElement as aG}from"@orangecatai/common";import{CaptureUpdateAction as lz}from"@orangecatai/element";import{useEffect as um,useMemo as i5,useRef as Bx,useState as SO}from"react";import{getLinearElementSubType as ic,updateElbowArrowPoints as MO}from"@orangecatai/element";import{pointFrom as pg,pointRotateRads as PO}from"@orangecatai/math";import{hasBoundTextElement as AO,isArrowBoundToElement as LO,isArrowElement as _O,isElbowArrow as DO,isLinearElement as Ux,isUsingAdaptiveRadius as RO}from"@orangecatai/element";import{getCommonBoundingBox as NO,getElementAbsoluteCoords as BO}from"@orangecatai/element";import{getBoundTextElement as m5,getBoundTextMaxHeight as FO,getBoundTextMaxWidth as OO,redrawTextBoundingBox as zO}from"@orangecatai/element";import{wrapText as UO}from"@orangecatai/element";import{assertNever as HO,CLASSES as GO,getFontString as Dx,isProdEnv as $O,mapFind as VO,reduceToCommonValue as WO,updateActiveTool as s5}from"@orangecatai/common";import{measureText as l5}from"@orangecatai/element";import{LinearElementEditor as KO}from"@orangecatai/element";import{newArrowElement as Rx,newElement as YO,newLinearElement as XO}from"@orangecatai/element";import{ShapeCache as jO}from"@orangecatai/element";import{updateBindings as ZO}from"@orangecatai/element";import{jsx as zx}from"react/jsx-runtime";var qO=8,JO=10,mm=["rectangle","diamond","ellipse"],pm=["line","sharpArrow","curvedArrow","elbowArrow"],QO=new Set(mm),ez=new Set(pm),sc=e=>QO.has(e),gg=e=>e==="arrow"||ez.has(e),ur=Ze(null),gm=new Map,hm=new Map,tz=({app:e})=>{let t=e.scene.getSelectedElements(e.state),o=Bx(null);return um(()=>{if(t.length===0){e.updateEditorAtom(ur,null);return}let n=lc(t);n&&!o.current?o.current=n:(o.current&&!n||o.current&&n!==o.current)&&(e.updateEditorAtom(ur,null),o.current=null)},[t,e]),um(()=>()=>{gm.clear(),hm.clear()},[]),zx(oz,{app:e,elements:t})},oz=({app:e,elements:t})=>{let o=lc(t),n=i5(()=>o==="generic"?u5(t):[],[o,t]),r=i5(()=>o==="linear"?Ox(t):[],[o,t]),a=o==="generic"?n.every(p=>p.type===n[0].type):o==="linear"?r.every(p=>ic(p)===ic(r[0])):!1,[i,s]=SO({x:0,y:0}),l=Bx(""),c=Bx(null);um(()=>{let p=[...n,...r].sort((f,w)=>f.id.localeCompare(w.id)),d=`
7
7
  ${e.state.scrollX}${e.state.scrollY}${e.state.offsetTop}${e.state.offsetLeft}${e.state.zoom.value}${p.map(f=>f.id).join(",")}`;if(d===l.current)return;l.current=d;let u;if(p.length===1){let[f,,,w,y,v]=BO(p[0],e.scene.getNonDeletedElementsMap());u=PO(pg(f,w),pg(y,v),p[0].angle)}else{let{minX:f,maxY:w}=NO(p);u=pg(f,w)}let{x:g,y:h}=h5({sceneX:u[0],sceneY:u[1]},e.state);s({x:g,y:h})},[n,r,e.scene,e.state]),um(()=>{for(let p of r){let d=Fx(p.id,sz(p));hm.has(d)||hm.set(d,p)}},[r]),um(()=>{for(let p of n)if(!gm.has(p.id)){let d=m5(p,e.scene.getNonDeletedElementsMap());d&&gm.set(p.id,{fontSize:d.fontSize})}},[n,e.scene]);let m=o==="linear"?[["line",bl],["sharpArrow",Sl],["curvedArrow",Pl],["elbowArrow",Ml]]:o==="generic"?[["rectangle",gl],["diamond",hl],["ellipse",fl]]:[];return zx("div",{ref:c,tabIndex:-1,style:{position:"absolute",top:`${i.y+(JO+8)*e.state.zoom.value-e.state.offsetTop}px`,left:`${i.x-e.state.offsetLeft-qO}px`,zIndex:2},className:GO.CONVERT_ELEMENT_TYPE_POPUP,children:m.map(([p,d])=>{let u=a&&(o==="generic"&&n[0].type===p||o==="linear"&&ic(r[0])===p);return zx(xe,{className:"Shape",type:"radio",icon:d,checked:u,name:"convertElementType-option",title:p,keyBindingLabel:"","aria-label":p,"data-testid":`toolbar-${p}`,onChange:()=>{e.state.activeTool.type!==p&&Ne("convertElementType",p,"ui"),Hx(e,{conversionType:o,nextType:p}),c.current?.focus()}},`${t[0].id}${t[0].version}_${p}`)})})},nz=(e,t,o)=>{let n=OO(e,t),r=FO(e,t),a=UO(t.text,Dx(t),n),i=l5(a,Dx(t),t.lineHeight),s=t.fontSize;for(;(i.width>n||i.height>r)&&s>0;){s-=1;let l={...t,fontSize:s};i=l5(t.text,Dx(l),t.lineHeight)}hg(t,o.getNonDeletedElementsMap(),{fontSize:s,width:i.width,height:i.height}),zO(t,e,o)},Hx=(e,{conversionType:t,nextType:o,direction:n="right"})=>{if(!t)return!1;let r=e.scene.getSelectedElements(e.state),a=r.reduce((s,l)=>({...s,[l.id]:!0}),{}),i=n==="right"?1:-1;if(t==="generic"){let s=u5(r),c=s.every(m=>m.type===s[0].type)?mm.indexOf(s[0].type):-1;if(o=o??mm[(c+mm.length+i)%mm.length],o&&sc(o)){let m={};for(let d of s){let u=d5(d,o,e);m[u.id]=u}let p=[];for(let d of e.scene.getElementsIncludingDeleted())m[d.id]?p.push(m[d.id]):p.push(d);e.scene.replaceAllElements(p);for(let d of Object.values(m)){let u=m5(d,e.scene.getNonDeletedElementsMap());u&&(gm.get(d.id)&&hg(u,e.scene.getNonDeletedElementsMap(),{fontSize:gm.get(d.id)?.fontSize??u.fontSize}),nz(d,u,e.scene))}e.setState(d=>({selectedElementIds:a,activeTool:s5(d,{type:"selection"})}))}}if(t==="linear"){let s=Ox(r);if(!o){let c=WO(s,ic),m=c?pm.indexOf(c):-1;o=pm[(m+pm.length+i)%pm.length]}if(gg(o)){let c=[],m=e.scene.getElementsMapIncludingDeleted();for(let p of s){let d=hm.get(Fx(p.id,o));if(d&&ic(d)===o)m.set(d.id,d),c.push(d);else{let u=d5(p,o,e);m.set(u.id,u),c.push(u)}}e.scene.replaceAllElements(m);for(let p of c)if(Ux(p))if(DO(p)){let d=rz(p);if(d.length<2)continue;let u=[];for(let h=1;h<d.length-2;h++)u.push({start:d[h],end:d[h+1],index:h+1});let g=MO(p,e.scene.getNonDeletedElementsMap(),{points:d,fixedSegments:u});hg(p,e.scene.getNonDeletedElementsMap(),{...g,endArrowhead:"arrow"})}else{let d=VO(["line","sharpArrow","curvedArrow"],u=>hm.get(Fx(p.id,u)));if(d){let u=d.points;e.scene.mutateElement(p,{points:u})}}}let l=Ox(e.scene.getSelectedElements(e.state));e.setState(c=>({selectedElementIds:a,selectedLinearElement:l.length===1?new KO(l[0],e.scene.getNonDeletedElementsMap()):null,activeTool:s5(c,{type:"selection"})}))}return!0},lc=e=>{if(e.length===0)return null;let t=!1;for(let o of e){if(sc(o.type))return"generic";p5(o)&&(t=!0)}return t?"linear":null},p5=e=>Ux(e)&&(!_O(e)||!LO(e)&&!AO(e)),Fx=(e,t)=>`${e}:${t}`,u5=e=>e.filter(t=>sc(t.type)),Ox=e=>e.filter(t=>p5(t)),mg=20,rc=(e,t)=>e[0]===t[0],Nx=(e,t)=>e[1]===t[1],c5=(e,t)=>rc(e,t)?Math.abs(e[1]-t[1]):Math.abs(e[0]-t[0]),rz=e=>{let t=[e.points[0]],o=az(e.points);for(let a=1;a<o.length;++a){let i=t[t.length-1],s=[...o[a]];Math.abs(s[0]-i[0])<mg?s[0]=i[0]:Math.abs(s[1]-i[1])<mg&&(s[1]=i[1]),rc(i,s)||Nx(i,s)||t.push(pg(i[0],s[1])),t.push(s)}let n=[t[0]];for(let a=1;a<t.length-1;++a)rc(t[a-1],t[a])&&rc(t[a],t[a+1])||Nx(t[a-1],t[a])&&Nx(t[a],t[a+1])||n.push(t[a]);n.push(t[t.length-1]);let r=[n[0]];for(let a=1;a<n.length-1;++a){let i=r[r.length-1],s=n[a],l=n[a+1],c=rc(i,s),m=rc(s,l);if(c!==m){let p=c5(i,s),d=c5(s,l);if(p<mg||d<mg){if(d<p)c?l[0]=i[0]:l[1]=i[1];else if(m)for(let u=r.length-1;u>=0&&r[u][0]===i[0];--u)r[u][0]=s[0];else for(let u=r.length-1;u>=0&&r[u][1]===i[1];--u)r[u][1]=s[1];continue}}r.push(s)}return r.push(n[n.length-1]),r},az=e=>{if(e.length===0)return[];let t=[e[0]];for(let o=1;o<e.length;o++){let[n,r]=t[t.length-1],[a,i]=e[o];(n!==a||r!==i)&&t.push(e[o])}return t},d5=(e,t,o)=>{if(!iz(e.type,t)){if(!$O())throw Error(`Invalid conversion from ${e.type} to ${t}.`);return e}if(e.type===t)return e;if(jO.delete(e),sc(t)){let n=ac(YO({...e,type:t,roundness:t==="diamond"&&e.roundness?{type:RO(t)?ug.ADAPTIVE_RADIUS:ug.PROPORTIONAL_RADIUS}:e.roundness}));return ZO(n,o.scene,o.state),n}if(gg(t))switch(t){case"line":return ac(XO({...e,type:"line"}));case"sharpArrow":return ac(Rx({...e,type:"arrow",elbowed:!1,roundness:null,startArrowhead:o.state.currentItemStartArrowhead,endArrowhead:o.state.currentItemEndArrowhead}));case"curvedArrow":return ac(Rx({...e,type:"arrow",elbowed:!1,roundness:{type:ug.PROPORTIONAL_RADIUS},startArrowhead:o.state.currentItemStartArrowhead,endArrowhead:o.state.currentItemEndArrowhead}));case"elbowArrow":return ac(Rx({...e,type:"arrow",elbowed:!0,fixedSegments:null,roundness:null}))}return HO(t,`unhandled conversion type: ${t}`),e},iz=(e,t)=>!!(sc(e)&&sc(t)||gg(e)&&gg(t)),sz=e=>Ux(e)?ic(e):e.type,g5=tz;var f5=Y({name:"toggleShapeSwitch",label:"labels.shapeSwitch",icon:()=>null,viewMode:!0,trackEvent:{category:"shape_switch",action:"toggle"},keywords:["change","switch","swap"],perform(e,t,o,n){return Yt.set(ur,{type:"panel"}),{captureUpdate:lz.NEVER}},checked:e=>e.gridModeEnabled,predicate:(e,t,o)=>lc(e)!==null});import{canCreateLinkFromElements as Gx,defaultGetElementLinkFromSelection as cz,getLinkIdAndTypeFromSelection as dz}from"@orangecatai/element";import{CaptureUpdateAction as fm}from"@orangecatai/element";var fg=Y({name:"copyElementLink",label:"labels.copyElementLink",icon:Il,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{let r=Me(e,t);try{if(window.location){let a=dz(r,t);return a?(await mr(n.props.generateLinkForSelection?n.props.generateLinkForSelection(a.id,a.type):cz(a.id,a.type)),{appState:{toast:{message:b("toast.elementLinkCopied"),closable:!0}},captureUpdate:fm.EVENTUALLY}):{appState:t,elements:e,app:n,captureUpdate:fm.EVENTUALLY}}}catch(a){console.error(a)}return{appState:t,elements:e,app:n,captureUpdate:fm.EVENTUALLY}},predicate:(e,t)=>Gx(Me(e,t))}),b5=Y({name:"linkToElement",label:"labels.linkToElement",icon:fu,perform:(e,t,o,n)=>{let r=Me(e,t);return r.length!==1||!Gx(r)?{elements:e,appState:t,app:n,captureUpdate:fm.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:Me(e,t)[0].id}},captureUpdate:fm.IMMEDIATELY}},predicate:(e,t,o,n)=>{let r=Me(e,t);return t.openDialog?.name!=="elementLinkSelector"&&r.length===1&&Gx(r)},trackEvent:!1});import{isDarwin as x5}from"@orangecatai/common";var mz={toggleTheme:[$("Shift+Alt+D")],saveScene:[$("CtrlOrCmd+S")],loadScene:[$("CtrlOrCmd+O")],clearCanvas:[$("CtrlOrCmd+Delete")],imageExport:[$("CtrlOrCmd+Shift+E")],commandPalette:[$("CtrlOrCmd+/"),$("CtrlOrCmd+Shift+P")],cut:[$("CtrlOrCmd+X")],copy:[$("CtrlOrCmd+C")],paste:[$("CtrlOrCmd+V")],copyStyles:[$("CtrlOrCmd+Alt+C")],pasteStyles:[$("CtrlOrCmd+Alt+V")],selectAll:[$("CtrlOrCmd+A")],deleteSelectedElements:[$("Delete")],duplicateSelection:[$("CtrlOrCmd+D"),$(`Alt+${b("helpDialog.drag")}`)],sendBackward:[$("CtrlOrCmd+[")],bringForward:[$("CtrlOrCmd+]")],sendToBack:[x5?$("CtrlOrCmd+Alt+["):$("CtrlOrCmd+Shift+[")],bringToFront:[x5?$("CtrlOrCmd+Alt+]"):$("CtrlOrCmd+Shift+]")],copyAsPng:[$("Shift+Alt+C")],group:[$("CtrlOrCmd+G")],ungroup:[$("CtrlOrCmd+Shift+G")],gridMode:[$("CtrlOrCmd+'")],zenMode:[$("Alt+Z")],objectsSnapMode:[$("Alt+S")],stats:[$("Alt+/")],addToLibrary:[],flipHorizontal:[$("Shift+H")],flipVertical:[$("Shift+V")],viewMode:[$("Alt+R")],hyperlink:[$("CtrlOrCmd+K")],toggleElementLock:[$("CtrlOrCmd+Shift+L")],resetZoom:[$("CtrlOrCmd+0")],zoomOut:[$("CtrlOrCmd+-")],zoomIn:[$("CtrlOrCmd++")],zoomToFitSelection:[$("Shift+3")],zoomToFit:[$("Shift+1")],zoomToFitSelectionInViewport:[$("Shift+2")],toggleEraserTool:[$("E")],toggleHandTool:[$("H")],setFrameAsActiveTool:[$("F")],cycleThroughFrameChildren:[$("CtrlOrCmd+J")],openImageGenerator:[$("G")],openVideoGenerator:[$("M")],saveFileToDisk:[$("CtrlOrCmd+S")],saveToActiveFile:[$("CtrlOrCmd+S")],toggleShortcuts:[$("?")],searchMenu:[$("CtrlOrCmd+F")],wrapSelectionInFrame:[],toolLock:[$("Q")]},Tt=(e,t=0)=>{let o=mz[e];return o&&o.length>0?o[t]||o[0]:""};var pz="\\u0300-\\u036f",uz="\\ufe20-\\ufe2f",gz="\\u20d0-\\u20ff",hz=pz+uz+gz,fz=`[${hz}]`,bz=RegExp(fz,"g"),xz=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yz={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"E",\u00E6:"e",\u00DE:"T",\u00FE:"t",\u00DF:"s",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"I",\u0133:"i",\u0152:"E",\u0153:"e",\u0149:"n",\u017F:"s"},vs=e=>e.replace(xz,t=>yz[t]||t).replace(bz,"");import RH from"clsx";import{useEffect as NH,useState as BH}from"react";import{KEYS as FH,queryFocusableElements as S3}from"@orangecatai/common";import{useCallback as wz,useState as vz}from"react";var y5=()=>{let[e,t]=vz(null),o=wz(n=>t(n),[]);return[e,o]};import{useState as v3,useCallback as d1,useMemo as E3,useEffect as m1,memo as I3,useRef as yH}from"react";import{LIBRARY_DISABLED_TYPES as wH,randomId as vH,isShallowEqual as EH,KEYS as IH,isWritableElement as TH,addEventListener as kH,EVENT as CH,CLASSES as x3}from"@orangecatai/common";import{useEffect as E5,useRef as I5}from"react";import{URL_HASH_KEYS as Wx,URL_QUERY_KEYS as Kx,APP_NAME as T5,EVENT as xg,DEFAULT_SIDEBAR as kz,LIBRARY_SIDEBAR_TAB as Cz,arrayToMap as Yx,cloneJSON as Sz,preventUnload as Mz,promiseTry as k5,resolvablePromise as Pz,toValidURL as Az,Queue as Lz,Emitter as _z}from"@orangecatai/common";import{hashElementsVersion as Dz,hashString as Rz}from"@orangecatai/element";import{getCommonBoundingBox as Vx}from"@orangecatai/element";import{MIME_TYPES as Es}from"@orangecatai/common";var ci=({elements:e,appState:t,files:o,maxWidthOrHeight:n,getDimensions:r,exportPadding:a,exportingFrame:i})=>{let s=rs(e,null,{deleteInvisibleElements:!0}),l=ll(t,null),{exportBackground:c,viewBackgroundColor:m}=l;return Wa(s,{...l,offsetTop:0,offsetLeft:0,width:0,height:0},o||{},{exportBackground:c,exportPadding:a,viewBackgroundColor:m,exportingFrame:i},(p,d)=>{let u=document.createElement("canvas");if(n){typeof r=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let h=Math.max(p,d),f=n<h?n/h:t?.exportScale??1;return u.width=p*f,u.height=d*f,{canvas:u,scale:f}}let g=r?.(p,d)||{width:p,height:d};return u.width=g.width,u.height=g.height,{canvas:u,scale:g.scale??1}})},cc=async e=>{let{mimeType:t=Es.png,quality:o}=e;t===Es.png&&typeof o=="number"&&console.warn(`"quality" will be ignored for "${Es.png}" mimeType`),t==="image/jpg"&&(t=Es.jpg),t===Es.jpg&&!e.appState?.exportBackground&&(console.warn(`Defaulting "exportBackground" to "true" for "${Es.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let n=await ci(e);return o=o||(/image\/jpe?g/.test(t)?.92:.8),new Promise((r,a)=>{n.toBlob(async i=>{if(!i)return a(new Error("couldn't export to blob"));i&&t===Es.png&&e.appState?.exportEmbedScene&&(i=await n2({blob:i,metadata:Id(e.elements,e.appState,e.files||{},"local")})),r(i)},t,o)})},dc=async({elements:e,appState:t=Va(),files:o={},exportPadding:n,renderEmbeddables:r,exportingFrame:a,skipInliningFonts:i,reuseImages:s})=>{let l=rs(e,null,{deleteInvisibleElements:!0}),m={...ll(t,null),exportPadding:n};return sl(l,m,o,{exportingFrame:a,renderEmbeddables:r,skipInliningFonts:i,reuseImages:s})},Ez=async e=>{if(e.type==="svg"){let t=await dc(e);await mr(t.outerHTML)}else if(e.type==="png")await Zu(cc(e));else if(e.type==="json")await Xu(e.elements,e.files);else throw new Error("Invalid export type")};import{useEffect as w5,useState as Iz}from"react";import{COLOR_PALETTE as Tz}from"@orangecatai/common";var $x=Ze(new Map),v5=async e=>await dc({elements:e,appState:{exportBackground:!1,viewBackgroundColor:Tz.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),bg=(e,t,o,n)=>{let[r,a]=Iz();return w5(()=>{if(t)if(e){let i=o.get(e);i?a(i):(async()=>{let s=await v5(t);s.querySelector(".style-fonts")?.remove(),s&&(o.set(e,s),a(s))})()}else(async()=>{let i=await v5(t);a(i)})()},[e,t,o,a]),w5(()=>{let i=n.current;if(i)return r&&(i.innerHTML=r.outerHTML),()=>{i.innerHTML=""}},[r,n]),r},mc=()=>{let[e]=Ee($x);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:n=>{n.forEach(r=>e.delete(r))},svgCache:e}};var Nz=["excalidraw.com","raw.githubusercontent.com/excalidraw/excalidraw-libraries"],S5=new _z,fa=Ze({status:"loaded",isInitialized:!1,libraryItems:[]}),bm=e=>Sz(e),Bz=(e,t)=>!e.find(o=>o.elements.length!==t.elements.length?!1:o.elements.every((n,r)=>n.id===t.elements[r].id&&n.versionNonce===t.elements[r].versionNonce)),M5=(e,t)=>{let o=[];for(let n of t)Bz(e,n)&&o.push(n);return[...o,...e]},P5=(e,t)=>{let o=Yx(t),n={deletedItems:new Map,addedItems:new Map,updatedItems:new Map};for(let a of e)o.has(a.id)||n.deletedItems.set(a.id,a);let r=Yx(e);for(let a of t){let i=r.get(a.id);i?Zx(i)!==Zx(a)&&n.updatedItems.set(a.id,a):n.addedItems.set(a.id,a)}return n},Xx=class{constructor(t){D(this,"currLibraryItems",[]);D(this,"prevLibraryItems",bm(this.currLibraryItems));D(this,"app");D(this,"updateQueue",[]);D(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]);D(this,"notifyListeners",()=>{if(this.updateQueue.length>0)Yt.set(fa,t=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:t.isInitialized}));else{Yt.set(fa,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let t=this.prevLibraryItems;this.prevLibraryItems=bm(this.currLibraryItems);let o=bm(this.currLibraryItems);this.app.props.onLibraryChange?.(o),S5.trigger(P5(t,o),o)}catch(t){console.error(t)}}});D(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],Yt.set($x,new Map)});D(this,"resetLibrary",()=>this.setLibrary([]));D(this,"getLatestLibrary",()=>new Promise(async t=>{try{let o=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(bm(o))}catch{return t(this.currLibraryItems)}}));D(this,"updateLibrary",async({libraryItems:t,prompt:o=!1,merge:n=!1,openLibraryMenu:r=!1,defaultStatus:a="unpublished"})=>(r&&this.app.setState({openSidebar:{name:kz.name,tab:Cz}}),this.setLibrary(()=>new Promise(async(i,s)=>{try{let l=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),c;l instanceof Blob?c=await Ab(l,a):c=Cd(l,a),!o||window.confirm(b("alerts.confirmAddLibrary",{numShapes:c.length}))?(o&&this.app.focusContainer(),i(n?M5(this.currLibraryItems,c):c)):s(new rl)}catch(l){s(l)}}))));D(this,"setLibrary",t=>{let o=new Promise(async(n,r)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=bm(await t),n(this.currLibraryItems)}catch(a){r(a)}}).catch(n=>{if(n.name==="AbortError")return console.warn("Library update aborted by user"),this.currLibraryItems;throw n}).finally(()=>{this.updateQueue=this.updateQueue.filter(n=>n!==o),this.notifyListeners()});return this.updateQueue.push(o),this.notifyListeners(),o});this.app=t}},A5=Xx,uc=e=>{let o=Math.ceil(Math.sqrt(e.length)),n=[],r=u=>e.slice(u*o,u*o+o).reduce((h,f)=>{let{height:w}=Vx(f.elements);return Math.max(h,w)},0),a=u=>{let g=0,h=0,f=0;for(let w of e){if(g%o===0&&(h=0),h===u){let{width:y}=Vx(w.elements);f=Math.max(f,y)}g++,h++}return f},i=0,s=0,l=0,c=0,m=0,p=0,d=0;for(let u of e){m&&m%o===0&&(s+=l+50,i=0,p=0,d++),p===0&&(l=r(d)),c=a(p);let{minX:g,minY:h,width:f,height:w}=Vx(u.elements),y=(c-f)/2,v=(l-w)/2;n.push(...u.elements.map(E=>({...E,x:E.x+i+y-g,y:E.y+s+v-h}))),i+=c+50,m++,p++}return n},Fz=(e,t=Nz)=>{if(typeof t=="function"?t(e):t.some(o=>{let n=new URL(`https://${o.replace(/^https?:\/\//,"")}`),{hostname:r,pathname:a}=new URL(e);return new RegExp(`(^|\\.)${n.hostname}$`).test(r)&&new RegExp(`^${n.pathname.replace(/\/+$/,"")}(/+|$)`).test(a)}))return!0;throw new Error(`Invalid or disallowed library URL: "${e}"`)},jx=()=>{let e=new URLSearchParams(window.location.hash.slice(1)).get(Wx.addLibrary)||new URLSearchParams(window.location.search).get(Kx.addLibrary),t=e?new URLSearchParams(window.location.hash.slice(1)).get("token"):null;return e?{libraryUrl:e,idToken:t}:null},di=class di{constructor(t){D(this,"adapter");this.adapter=t}static async getLibraryItems(t,o,n=!0){let r=()=>new Promise(async(a,i)=>{try{let s=await t.load({source:o});a(Cd(s?.libraryItems||[],"published"))}catch(s){i(s)}});return n?di.queue.push(r):r()}getLibraryItems(t){return di.getLibraryItems(this.adapter,t,!1)}};D(di,"queue",new Lz),D(di,"run",async(t,o)=>{let n=new di(t);return di.queue.push(()=>o(n))});var pc=di,xm=0,yg=0,Zx=e=>`${e.id}:${e.name||""}:${Dz(e.elements)}`,wg=e=>Rz(e.map(t=>Zx(t)).sort().join()),C5=async(e,t)=>{try{return yg++,await pc.run(e,async o=>{let n=Yx(await o.getLibraryItems("save"));for(let[s]of t.deletedItems)n.delete(s);let r=[];for(let[s,l]of t.addedItems)n.has(s)?n.set(s,l):r.push(l);if(t.updatedItems)for(let[s,l]of t.updatedItems)n.set(s,l);let a=r.concat(Array.from(n.values())),i=wg(a);return i!==xm&&await e.save({libraryItems:a}),xm=i,a})}finally{yg--}},Oz=e=>{let{excalidrawAPI:t}=e,o=I5(e);o.current=e;let n=I5(!1);E5(()=>{if(!t)return;n.current=!1;let r=async({libraryUrl:s,idToken:l})=>{let c=new Promise(async(p,d)=>{try{s=decodeURIComponent(s),s=Az(s),Fz(s,o.current.validateLibraryUrl);let g=await(await fetch(s)).blob();p(g)}catch(u){d(u)}}),m=l!==t.id;await(m&&document.hidden?new Promise(p=>{window.addEventListener("focus",()=>p(),{once:!0})}):null);try{await t.updateLibrary({libraryItems:c,prompt:m,merge:!0,defaultStatus:"published",openLibraryMenu:!0})}catch(p){throw t.updateScene({appState:{errorMessage:p.message}}),p}finally{if(window.location.hash.includes(Wx.addLibrary)){let p=new URLSearchParams(window.location.hash.slice(1));p.delete(Wx.addLibrary),window.history.replaceState({},T5,`#${p.toString()}`)}else if(window.location.search.includes(Kx.addLibrary)){let p=new URLSearchParams(window.location.search);p.delete(Kx.addLibrary),window.history.replaceState({},T5,`?${p.toString()}`)}}},a=s=>{s.preventDefault();let l=jx();l&&(s.stopImmediatePropagation(),window.history.replaceState({},"",s.oldURL),r(l))},i=jx();if(i&&r(i),"getInitialLibraryItems"in o.current&&o.current.getInitialLibraryItems&&(console.warn("useHandleLibrar `opts.getInitialLibraryItems` is deprecated. Use `opts.adapter` instead."),Promise.resolve(o.current.getInitialLibraryItems()).then(s=>{t.updateLibrary({libraryItems:s,merge:!0})}).catch(s=>{console.error(`UseHandeLibrary getInitialLibraryItems failed: ${s?.message}`)})),"adapter"in o.current&&o.current.adapter){let s=o.current.adapter,l=o.current.migrationAdapter,c=Pz();l?c.resolve(k5(l.load).then(async m=>{let p=null;try{if(!m)return pc.getLibraryItems(s,"load");p=Cd(m.libraryItems||[],"published");let d=await C5(s,P5([],p));try{await l.clear()}catch(u){console.error(`couldn't delete legacy library data: ${u.message}`)}return d}catch(d){return console.error(`couldn't migrate legacy library data: ${d.message}`),p}}).catch(m=>(console.error(`error during library migration: ${m.message}`),pc.getLibraryItems(s,"load")))):c.resolve(k5(pc.getLibraryItems,s,"load")),t.updateLibrary({libraryItems:c.then(m=>{let p=m||[];return xm=wg(p),p}),merge:!0}).finally(()=>{n.current=!0})}return window.addEventListener(xg.HASHCHANGE,a),()=>{window.removeEventListener(xg.HASHCHANGE,a)}},[t]),E5(()=>{let r=S5.on(async(i,s)=>{let l=n.current,c="adapter"in o.current&&o.current.adapter||null;try{c&&xm!==wg(s)&&await C5(c,i)}catch(m){console.error(`couldn't persist library update: ${m.message}`,i),l&&o.current.excalidrawAPI&&o.current.excalidrawAPI.updateScene({appState:{errorMessage:b("errors.saveLibraryError")}})}}),a=i=>{yg&&Mz(i)};return window.addEventListener(xg.BEFORE_UNLOAD,a),()=>{window.removeEventListener(xg.BEFORE_UNLOAD,a),r(),xm=0,yg=0}},[])};import Gz from"clsx";import{VERSIONS as zz}from"@orangecatai/common";import{jsx as Hz}from"react/jsx-runtime";var Uz=({theme:e,id:t,libraryReturnUrl:o})=>{let n=o||window.location.origin+window.location.pathname;return Hz("a",{className:"library-menu-browse-button",href:`${C.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${n}&useHash=true&token=${t}&theme=${e}&version=${zz.excalidrawLibrary}`,target:"_excalidraw_libraries",children:b("labels.libraries")})},L5=Uz;import{jsx as $z,jsxs as Vz}from"react/jsx-runtime";var vg=({libraryReturnUrl:e,theme:t,id:o,style:n,children:r,className:a})=>Vz("div",{className:Gz("library-menu-control-buttons",a),style:n,children:[$z(L5,{id:o,libraryReturnUrl:e,theme:t}),r]});import{useCallback as fc,useEffect as i1,useMemo as s1,useRef as h3,useState as f3}from"react";import{MIME_TYPES as pH,arrayToMap as uH,nextAnimationFrame as gH}from"@orangecatai/common";import{duplicateElements as hH}from"@orangecatai/element";import fH from"clsx";import Wz from"lodash.throttle";import{useEffect as Kz}from"react";var Yz=Ze(0),_5=e=>{let[t,o]=Ee(Yz);return Kz(()=>{let{current:n}=e;if(!n)return;let r=Wz(()=>{let{scrollTop:a}=n;o(a)},200);return n.addEventListener("scroll",r),()=>{r.cancel(),n.removeEventListener("scroll",r)}},[e,o]),t};import GU from"clsx";import{useCallback as $U,useState as n1}from"react";import{muteFSAbortError as VU}from"@orangecatai/common";import{flushSync as D5}from"react-dom";import Xz from"clsx";import{jsx as Eg,jsxs as Zz}from"react/jsx-runtime";var jz=({label:e,onClick:t,className:o,children:n,actionType:r,type:a="button",isLoading:i,...s})=>{let l=r?`Dialog__action-button--${r}`:"";return Zz("button",{className:Xz("Dialog__action-button",l,o),type:a,"aria-label":e,onClick:t,...s,children:[n&&Eg("div",{style:i?{visibility:"hidden"}:{},children:n}),Eg("div",{style:i?{visibility:"hidden"}:{},children:e}),i&&Eg("div",{style:{position:"absolute",inset:0},children:Eg(So,{})})]})},ba=jz;import{jsx as R5,jsxs as N5}from"react/jsx-runtime";var qz=e=>{let{onConfirm:t,onCancel:o,children:n,confirmText:r=b("buttons.confirm"),cancelText:a=b("buttons.cancel"),className:i="",...s}=e,l=Qe(),c=Sr(gc),{container:m}=St();return N5(Xt,{onCloseRequest:o,size:"small",...s,className:`confirm-dialog ${i}`,children:[n,N5("div",{className:"confirm-dialog-buttons",children:[R5(ba,{label:a,onClick:()=>{l({openMenu:null}),c(!1),D5(()=>{o()}),m?.focus()}}),R5(ba,{label:r,onClick:()=>{l({openMenu:null}),c(!1),D5(()=>{t()}),m?.focus()},actionType:"danger"})]})]})},Ig=qz;import{useCallback as rU,useEffect as Qx,useRef as B5,useState as qx}from"react";import{EDITOR_LS_KEYS as Jx,EXPORT_DATA_TYPES as aU,MIME_TYPES as F5,VERSIONS as iU,chunk as sU,getExportSource as lU}from"@orangecatai/common";var Gn=class{static has(t){try{return!!window.localStorage.getItem(t)}catch(o){return console.warn(`localStorage.getItem error: ${o.message}`),!1}}static get(t){try{let o=window.localStorage.getItem(t);return o?JSON.parse(o):null}catch(o){return console.warn(`localStorage.getItem error: ${o.message}`),null}}};D(Gn,"set",(t,o)=>{try{return window.localStorage.setItem(t,JSON.stringify(o)),!0}catch(n){return console.warn(`localStorage.setItem error: ${n.message}`),!1}}),D(Gn,"delete",t=>{try{window.localStorage.removeItem(t)}catch(o){console.warn(`localStorage.removeItem error: ${o.message}`)}});import Tg from"react";var Jz=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,Qz=/{{([\w-]+)}}/,eU=/<([\w-]+)>/,tU=/<\/([\w-]+)>/,oU=(e,t)=>{let o=[{name:"",children:[]}];return e.split(Jz).filter(Boolean).forEach(n=>{let r=n.match(eU),a=n.match(tU),i=n.match(Qz);if(r!==null){let s=r[1];t.hasOwnProperty(s)?o.push({name:s,children:[]}):console.warn(`Trans: missed to pass in prop ${s} for interpolating ${e}`)}else if(a!==null)if(a[1]===o[o.length-1].name){let l=o.pop(),c=Tg.createElement(Tg.Fragment,{},...l.children),m=t[l.name];typeof m=="function"&&o[o.length-1].children.push(m(c))}else console.warn(`Trans: unexpected end tag ${n} for interpolating ${e}`);else if(i!==null){let s=i[1];t.hasOwnProperty(s)?o[o.length-1].children.push(t[s]):console.warn(`Trans: key ${s} not in props for interpolating ${e}`)}else o[o.length-1].children.push(n)}),o.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),o[0].children},nU=({i18nKey:e,children:t,...o})=>{let{t:n}=bt();return Tg.createElement(Tg.Fragment,{},...oU(n(e),o))},Yo=nU;import{jsx as at,jsxs as Oo}from"react/jsx-runtime";var cU=async e=>{let n=Math.round(8),r=Math.max(Math.round(128/64),2),a=sU(e,6),i=document.createElement("canvas");i.width=a[0].length*128+(a[0].length+1)*(n*2)-n*2,i.height=a.length*128+(a.length+1)*(n*2)-n*2;let s=i.getContext("2d");s.fillStyle="#fff",s.fillRect(0,0,i.width,i.height);for(let[l,c]of e.entries()){let m=await ci({elements:c.elements,files:null,maxWidthOrHeight:128}),{width:p,height:d}=m,u=Math.floor(l/6)*(128+n*2),g=l%6*(128+n*2);s.drawImage(m,g+(128-p)/2+n,u+(128-d)/2+n),s.lineWidth=r,s.strokeStyle="#ced4da",s.strokeRect(g+n/2,u+n/2,128+n,128+n)}return await qp(new File([await as(i)],"preview",{type:F5.png}),{outputType:F5.jpg,maxWidthOrHeight:5e3})},dU=({libItem:e,appState:t,index:o,onChange:n,onRemove:r})=>{let a=B5(null),i=B5(null);return Qx(()=>{let s=a.current;s&&(async()=>{let l=await dc({elements:e.elements,appState:{...t,viewBackgroundColor:"#fff",exportBackground:!0},files:null,skipInliningFonts:!0});s.innerHTML=l.outerHTML})()},[e.elements,t]),Oo("div",{className:"single-library-item",children:[e.status==="published"&&at("span",{className:"single-library-item-status",children:b("labels.statusPublished")}),at("div",{ref:a,className:"single-library-item__svg"}),at(xe,{"aria-label":b("buttons.remove"),type:"button",icon:Nn,className:"single-library-item--remove",onClick:r.bind(null,e.id),title:b("buttons.remove")}),Oo("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[Oo("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[Oo("div",{style:{padding:"0.5em 0"},children:[at("span",{style:{fontWeight:500,color:"#868e96"},children:b("publishDialog.itemName")}),at("span",{"aria-hidden":"true",className:"required",children:"*"})]}),at("input",{type:"text",ref:i,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:s=>{n(s.target.value,o)}})]}),at("span",{className:"error",children:e.error})]})]})},mU=({onClose:e,libraryItems:t,appState:o,onSuccess:n,onError:r,updateItemsInStorage:a,onRemove:i})=>{let[s,l]=qx({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[c,m]=qx(!1);Qx(()=>{let v=Gn.get(Jx.PUBLISH_LIBRARY);v&&l(v)},[]);let[p,d]=qx(t.slice());Qx(()=>{d(t.slice())},[t]);let u=v=>{l({...s,[v.target.name]:v.target.value})},g=async v=>{v.preventDefault(),m(!0);let E=[],I=!1;if(p.forEach(M=>{let P="";M.name||(P=b("publishDialog.errors.required"),I=!0),E.push({...M,error:P})}),I){d(E),m(!1);return}let k=await cU(p),S={type:aU.excalidrawLibrary,version:iU.excalidrawLibrary,source:lU(),libraryItems:p},T=JSON.stringify(S,null,2),A=new Blob([T],{type:"application/json"}),R=new FormData;R.append("excalidrawLib",A),R.append("previewImage",k),R.append("previewImageType",k.type),R.append("title",s.name),R.append("authorName",s.authorName),R.append("githubHandle",s.githubHandle),R.append("name",s.name),R.append("description",s.description),R.append("twitterHandle",s.twitterHandle),R.append("website",s.website),fetch(`${C.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:R}).then(M=>M.ok?M.json().then(({url:P})=>{Gn.delete(Jx.PUBLISH_LIBRARY),n({url:P,authorName:s.authorName,items:p})}):M.json().catch(()=>{throw new Error(M.statusText||"something went wrong")}).then(P=>{throw new Error(P.message||M.statusText||"something went wrong")}),M=>{console.error(M),r(M),m(!1)}).catch(M=>{console.error(M),r(M),m(!1)})},h=()=>{let v=[];return p.forEach((E,I)=>{v.push(at("div",{className:"single-library-item-wrapper",children:at(dU,{libItem:E,appState:o,index:I,onChange:(k,S)=>{let T=p.slice();T[S].name=k,d(T)},onRemove:i})},I))}),at("div",{className:"selected-library-items",children:v})},f=rU(()=>{a(p),Gn.set(Jx.PUBLISH_LIBRARY,s),e()},[p,e,a,s]),w=!!t.length,y=t.some(v=>v.status==="published");return at(Xt,{onCloseRequest:f,title:b("publishDialog.title"),className:"publish-library",children:w?Oo("form",{onSubmit:g,children:[at("div",{className:"publish-library-note",children:at(Yo,{i18nKey:"publishDialog.noteDescription",link:v=>at("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener",children:v})})}),at("span",{className:"publish-library-note",children:at(Yo,{i18nKey:"publishDialog.noteGuidelines",link:v=>at("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:v})})}),at("div",{className:"publish-library-note",children:b("publishDialog.noteItems")}),y&&at("span",{className:"publish-library-note publish-library-warning",children:b("publishDialog.republishWarning")}),h(),Oo("div",{className:"publish-library__fields",children:[Oo("label",{children:[Oo("div",{children:[at("span",{children:b("publishDialog.libraryName")}),at("span",{"aria-hidden":"true",className:"required",children:"*"})]}),at("input",{type:"text",name:"name",required:!0,value:s.name,onChange:u,placeholder:b("publishDialog.placeholder.libraryName")})]}),Oo("label",{style:{alignItems:"flex-start"},children:[Oo("div",{children:[at("span",{children:b("publishDialog.libraryDesc")}),at("span",{"aria-hidden":"true",className:"required",children:"*"})]}),at("textarea",{name:"description",rows:4,required:!0,value:s.description,onChange:u,placeholder:b("publishDialog.placeholder.libraryDesc")})]}),Oo("label",{children:[Oo("div",{children:[at("span",{children:b("publishDialog.authorName")}),at("span",{"aria-hidden":"true",className:"required",children:"*"})]}),at("input",{type:"text",name:"authorName",required:!0,value:s.authorName,onChange:u,placeholder:b("publishDialog.placeholder.authorName")})]}),Oo("label",{children:[at("span",{children:b("publishDialog.githubUsername")}),at("input",{type:"text",name:"githubHandle",value:s.githubHandle,onChange:u,placeholder:b("publishDialog.placeholder.githubHandle")})]}),Oo("label",{children:[at("span",{children:b("publishDialog.twitterUsername")}),at("input",{type:"text",name:"twitterHandle",value:s.twitterHandle,onChange:u,placeholder:b("publishDialog.placeholder.twitterHandle")})]}),Oo("label",{children:[at("span",{children:b("publishDialog.website")}),at("input",{type:"text",name:"website",pattern:"https?://.+",title:b("publishDialog.errors.website"),value:s.website,onChange:u,placeholder:b("publishDialog.placeholder.website")})]}),at("span",{className:"publish-library-note",children:at(Yo,{i18nKey:"publishDialog.noteLicense",link:v=>at("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:v})})})]}),Oo("div",{className:"publish-library__buttons",children:[at(ba,{label:b("buttons.saveLibNames"),onClick:f,"data-testid":"cancel-clear-canvas-button"}),at(ba,{type:"submit",label:b("buttons.submit"),actionType:"primary",isLoading:c})]})]}):at("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:b("publishDialog.atleastOneLibItem")})})},O5=mU;import l3 from"react";import{DropdownMenu as OU}from"radix-ui";import{CLASSES as zU}from"@orangecatai/common";import gU from"clsx";import{useCallback as hU,useEffect as fU,useRef as bU}from"react";import{CLASSES as xU,EVENT as G5,KEYS as yU}from"@orangecatai/common";import{DropdownMenu as wU}from"radix-ui";import{forwardRef as z5}from"react";import U5 from"clsx";import{jsx as H5}from"react/jsx-runtime";var pU=z5(({children:e,gap:t,align:o,justifyContent:n,className:r,style:a},i)=>H5("div",{className:U5("Stack Stack_horizontal",r),style:{"--gap":t,alignItems:o,justifyContent:n,...a},ref:i,children:e})),uU=z5(({children:e,gap:t,align:o,justifyContent:n,className:r,style:a},i)=>H5("div",{className:U5("Stack Stack_vertical",r),style:{"--gap":t,justifyItems:o,justifyContent:n,...a},ref:i,children:e})),fo={Row:pU,Col:uU};import{jsx as kg}from"react/jsx-runtime";var $5=({children:e,onClickOutside:t,className:o="",onSelect:n,open:r=!0,align:a="end",style:i})=>{let s=Je(),l=bU(null),c=ja({onClickOutside:t});Dl(l,hU(p=>{l.current?.closest(`.${xU.DROPDOWN_MENU_EVENT_WRAPPER}`)?.contains(p.target)||c.onClickOutside?.()},[c])),fU(()=>{if(!r)return;let p=u=>{u.key===yU.ESCAPE&&(u.stopImmediatePropagation(),c.onClickOutside?.())},d={capture:!0};return document.addEventListener(G5.KEYDOWN,p,d),()=>{document.removeEventListener(G5.KEYDOWN,p,d)}},[c,r]);let m=gU(`dropdown-menu ${o}`,{"dropdown-menu--mobile":s.formFactor==="phone"}).trim();return kg(S0.Provider,{value:{onSelect:n},children:kg(wU.Content,{ref:l,className:m,style:i,"data-testid":"dropdown-menu",align:a,sideOffset:8,onCloseAutoFocus:p=>p.preventDefault(),children:s.formFactor==="phone"?kg(fo.Col,{className:"dropdown-menu-container",children:e}):kg($t,{className:"dropdown-menu-container",padding:2,children:e})})})};$5.displayName="DropdownMenuContent";var V5=$5;import{jsx as EU}from"react/jsx-runtime";var vU=({children:e,className:t="",selected:o,...n})=>EU("div",{...n,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${o?"dropdown-menu-item--selected":""}`.trim(),children:e}),W5=vU;import{DropdownMenu as IU}from"radix-ui";import{jsx as e1}from"react/jsx-runtime";var K5=({icon:e,shortcut:t,href:o,children:n,onSelect:r,className:a="",selected:i,rel:s="noopener",...l})=>{let c=Lu(r);return e1(IU.Item,{className:"radix-menu-item",onSelect:c,asChild:!0,children:e1("a",{...l,href:o,target:"_blank",rel:`noopener ${s}`,className:ei(a,i),title:l.title??l["aria-label"],children:e1(ti,{icon:e,shortcut:t,children:n})})})},hc=K5;K5.displayName="DropdownMenuItemLink";import{jsx as TU}from"react/jsx-runtime";var Y5=()=>TU("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:"6px 0",flex:"0 0 auto"}}),X5=Y5;Y5.displayName="DropdownMenuSeparator";import{DropdownMenu as LU}from"radix-ui";import kU from"clsx";import{DropdownMenu as CU}from"radix-ui";import{useCallback as SU,useState as j5}from"react";import{jsx as o1}from"react/jsx-runtime";var t1=-4,MU=4,Z5=({children:e,className:t})=>{let o=Je(),n=kU(`dropdown-menu dropdown-submenu ${t}`,{"dropdown-menu--mobile":o.formFactor==="phone"}).trim(),r=SU(c=>{if(c){let p=c.closest(".dropdown-menu-container")?.getBoundingClientRect();if(p){let d=c.getBoundingClientRect().width,g=window.innerWidth-p.right;g<d+20&&(i(g-d+t1),l(t1+8))}}},[]),[a,i]=j5(MU),[s,l]=j5(t1);return o1(CU.SubContent,{className:n,sideOffset:a,alignOffset:s,collisionPadding:8,ref:r,children:o.formFactor==="phone"?o1(fo.Col,{className:"dropdown-menu-container",children:e}):o1($t,{className:"dropdown-menu-container",padding:2,style:{zIndex:1},children:e})})},q5=Z5;Z5.displayName="DropdownMenuSubContent";import{DropdownMenu as PU}from"radix-ui";import{jsx as J5,jsxs as AU}from"react/jsx-runtime";var Q5=({children:e,icon:t,shortcut:o,className:n})=>AU(PU.SubTrigger,{className:`${ei(n)} dropdown-menu__submenu-trigger`,children:[J5(ti,{icon:t,shortcut:o,children:e}),J5("div",{className:"dropdown-menu__submenu-trigger-icon",children:lT})]}),e3=Q5;Q5.displayName="DropdownMenuSubTrigger";import t3 from"react";var Cg=e=>t=>{let o=t3.Children.toArray(t).find(n=>t3.isValidElement(n)&&typeof n.type!="string"&&n?.type.displayName&&n.type.displayName===e);return o||null},o3=Cg("DropdownMenuTrigger"),n3=Cg("DropdownMenuContent"),r3=Cg("DropdownMenuSubTrigger"),a3=Cg("DropdownMenuSubContent");import{jsxs as _U}from"react/jsx-runtime";var Sg=({children:e})=>{let t=r3(e),o=a3(e);return _U(LU.Sub,{children:[t,o]})};Sg.Trigger=e3;Sg.Content=q5;Sg.displayName="DropdownMenuSub";var mi=Sg;import DU from"clsx";import{DropdownMenu as RU}from"radix-ui";import{jsx as NU}from"react/jsx-runtime";var i3=({className:e="",children:t,onToggle:o,title:n,...r})=>{let a=Je(),i=DU(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":a.formFactor==="phone"}).trim();return NU(RU.Trigger,{className:i,onClick:o,type:"button","data-testid":"dropdown-menu-button",title:n,...r,children:t})},s3=i3;i3.displayName="DropdownMenuTrigger";import{jsx as FU}from"react/jsx-runtime";var BU=e=>FU(No,{...e,icon:e.checked?iu:sT}),xa=BU;import{jsx as HU,jsxs as UU}from"react/jsx-runtime";var gr=({children:e,open:t})=>{let o=o3(e),n=n3(e),r=n&&l3.isValidElement(n)?l3.cloneElement(n,{open:t}):n;return HU(OU.Root,{open:t,modal:!1,children:UU("div",{className:zU.DROPDOWN_MENU_EVENT_WRAPPER,style:{display:"contents"},children:[o,r]})})};gr.Trigger=s3;gr.Content=V5;gr.Item=No;gr.ItemCheckbox=xa;gr.ItemLink=hc;gr.ItemCustom=W5;gr.Group=Wd;gr.Separator=X5;gr.Sub=mi;var Ue=gr;gr.displayName="DropdownMenu";import{jsx as an,jsxs as Mg}from"react/jsx-runtime";var WU=(e,t)=>e.filter(o=>t.includes(o.id)),KU=({setAppState:e,selectedItems:t,library:o,onRemoveFromLibrary:n,resetLibrary:r,onSelectItems:a,appState:i,className:s})=>{let[l]=Ee(fa),[c,m]=Ee(gc),p=()=>{let R=t.length?b("alerts.removeItemsFromsLibrary",{count:t.length}):b("alerts.resetLibrary"),M=t.length?b("confirmDialog.removeItemsFromLib"):b("confirmDialog.resetLibrary");return an(Ig,{onConfirm:()=>{t.length?n():r(),u(!1)},onCancel:()=>{u(!1)},title:M,children:an("p",{children:R})})},[d,u]=n1(!1),g=!!t.length,h=g?l.libraryItems.filter(R=>t.includes(R.id)):l.libraryItems,f=g?b("buttons.remove"):b("buttons.resetLibrary"),[w,y]=n1(!1),[v,E]=n1(null),I=$U(()=>Mg(Xt,{onCloseRequest:()=>E(null),title:b("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[an("p",{children:an(Yo,{i18nKey:"publishSuccessDialog.content",authorName:v.authorName,link:R=>an("a",{href:v?.url,target:"_blank",rel:"noopener noreferrer",children:R})})}),an(xe,{type:"button",title:b("buttons.close"),"aria-label":b("buttons.close"),label:b("buttons.close"),onClick:()=>E(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[E,v]),k=(R,M)=>{y(!1),E({url:R.url,authorName:R.authorName});let P=M.slice();P.forEach(F=>{t.includes(F.id)&&(F.status="published")}),o.setLibrary(P)},S=async()=>{try{await o.updateLibrary({libraryItems:il({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(R){if(R?.name==="AbortError"){console.warn(R);return}e({errorMessage:b("errors.importLibraryError")})}},T=async()=>{let R=g?h:await o.getLatestLibrary();qE(R).catch(VU).catch(M=>{e({errorMessage:M.message})})},A=()=>Mg(Ue,{open:c,children:[an(Ue.Trigger,{onToggle:()=>m(!c),children:y2}),Mg(Ue.Content,{onClickOutside:()=>m(!1),onSelect:()=>m(!1),className:"library-menu",children:[!g&&an(Ue.Item,{onSelect:S,icon:vl,"data-testid":"lib-dropdown--load",children:b("buttons.load")}),!!h.length&&an(Ue.Item,{onSelect:T,icon:ls,"data-testid":"lib-dropdown--export",children:b("buttons.export")}),g&&an(Ue.Item,{icon:MI,onSelect:()=>y(!0),"data-testid":"lib-dropdown--remove",children:b("buttons.publishLibrary")}),!!h.length&&an(Ue.Item,{onSelect:()=>u(!0),icon:Co,children:f})]})]});return Mg("div",{className:GU("library-menu-dropdown-container",s),children:[A(),t.length>0&&an("div",{className:"library-actions-counter",children:t.length}),d&&p(),w&&an(O5,{onClose:()=>y(!1),libraryItems:WU(l.libraryItems,t),appState:i,onSuccess:R=>k(R,l.libraryItems),onError:R=>window.alert(R),updateItemsInStorage:()=>o.setLibrary(l.libraryItems),onRemove:R=>a(t.filter(M=>M!==R))}),v&&I()]})},c3=({selectedItems:e,onSelectItems:t,className:o})=>{let{library:n}=Mt(),{clearLibraryCache:r,deleteItemsFromLibraryCache:a}=mc(),i=qe(),s=Qe(),[l]=Ee(fa),c=async p=>{let d=p.filter(u=>!e.includes(u.id));n.setLibrary(d).catch(()=>{s({errorMessage:b("alerts.errorRemovingFromLibrary")})}),a(e),t([])};return an(KU,{appState:i,setAppState:s,selectedItems:e,onSelectItems:t,library:n,onRemoveFromLibrary:()=>c(l.libraryItems),resetLibrary:()=>{n.resetLibrary(),r()},className:o})};import{memo as eH,useEffect as tH,useState as oH}from"react";import YU,{useCallback as XU}from"react";function jU(){return[!1,XU(t=>t(),[])]}var d3=YU.useTransition||jU;import m3 from"clsx";import{memo as ZU,useRef as qU,useState as JU}from"react";import{jsx as Pg,jsxs as QU}from"react/jsx-runtime";var p3=ZU(({id:e,elements:t,isPending:o,onClick:n,selected:r,onToggle:a,onDrag:i,svgCache:s})=>{let l=qU(null),c=bg(e,t,s,l),[m,p]=JU(!1),d=Je().formFactor==="phone",u=o&&Pg("div",{className:"library-unit__adder",children:ou});return QU("div",{className:m3("library-unit",{"library-unit__active":t,"library-unit--hover":t&&m,"library-unit--selected":r,"library-unit--skeleton":!c}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[Pg("div",{className:m3("library-unit__dragger",{"library-unit__pulse":!!o}),ref:l,draggable:!!t,onClick:t||o?g=>{e&&g.shiftKey?a(e,g):n(e)}:void 0,onDragStart:g=>{if(!e){g.preventDefault();return}p(!1),i(e,g)}}),u,e&&t&&(m||d||r)&&Pg(Jd,{checked:r,onChange:(g,h)=>a(e,h),className:"library-unit__checkbox"})]})}),u3=()=>Pg("div",{className:"library-unit library-unit--skeleton"});import{Fragment as nH,jsx as Ag}from"react/jsx-runtime";var Lg=({children:e})=>Ag("div",{className:"library-menu-items-container__grid",children:e}),ym=eH(({items:e,onItemSelectToggle:t,onItemDrag:o,isItemSelected:n,onClick:r,svgCache:a,itemsRenderedPerBatch:i})=>{let[,s]=d3(),[l,c]=oH(0);return tH(()=>{l<e.length&&s(()=>{c(l+i)})},[l,e.length,s,i]),Ag(nH,{children:e.map((m,p)=>p<l?Ag(p3,{elements:m?.elements,isPending:!m?.id&&!!m?.elements,onClick:r,svgCache:a,id:m?.id,selected:n(m.id),onToggle:t,onDrag:o},m?.id??p):Ag(u3,{},p))})});import r1 from"clsx";import{forwardRef as sH,useRef as lH,useImperativeHandle as cH,useLayoutEffect as dH,useState as mH}from"react";import rH from"clsx";import{composeEventHandlers as aH}from"@orangecatai/common";import{jsx as iH}from"react/jsx-runtime";var Xo=({type:e="button",onSelect:t,selected:o,children:n,className:r="",...a})=>iH("button",{onClick:aH(a.onClick,i=>{t()}),type:e,className:rH("excalidraw-button",r,{selected:o}),...a,children:n});import{jsx as a1,jsxs as g3}from"react/jsx-runtime";var pi=sH(({onChange:e,label:t,fullWidth:o,placeholder:n,readonly:r,selectOnRender:a,onKeyDown:i,isRedacted:s=!1,icon:l,className:c,type:m,...p},d)=>{let u=lH(null);cH(d,()=>u.current),dH(()=>{a&&(u.current?.focus(),u.current?.select())},[a]);let[g,h]=mH(!1);return g3("div",{className:r1("ExcTextField",c,{"ExcTextField--fullWidth":o,"ExcTextField--hasIcon":!!l}),onClick:()=>{u.current?.focus()},children:[l,t&&a1("div",{className:"ExcTextField__label",children:t}),g3("div",{className:r1("ExcTextField__input",{"ExcTextField__input--readonly":r}),children:[a1("input",{className:r1({"is-redacted":"value"in p&&p.value&&s&&!g}),readOnly:r,value:"value"in p?p.value:void 0,defaultValue:"defaultValue"in p?p.defaultValue:void 0,placeholder:n,ref:u,onChange:f=>e?.(f.target.value),onKeyDown:i,type:m}),s&&a1(Xo,{onSelect:()=>h(!g),style:{border:0,userSelect:"none"},children:g?BI:kl})]})]})});import{Fragment as b3,jsx as bo,jsxs as Or}from"react/jsx-runtime";var bH=17,xH=64;function l1({isLoading:e,libraryItems:t,onAddToLibrary:o,onInsertLibraryItems:n,pendingElements:r,theme:a,id:i,libraryReturnUrl:s,onSelectItems:l,selectedItems:c}){let m=Je(),p=h3(null),d=_5(p);i1(()=>{d>0&&p.current?.scrollTo(0,d)},[]);let{svgCache:u}=mc(),[g,h]=f3(null),[f,w]=f3(""),y=!t.length&&!r.length,v=!y&&!!f.trim(),E=s1(()=>{let _=vs(f.trim().toLowerCase());return _?t.filter(L=>{let z=L.name||"";return z.trim()&&vs(z.toLowerCase()).includes(_)}):[]},[t,f]),I=s1(()=>t.filter(_=>_.status!=="published"),[t]),k=s1(()=>t.filter(_=>_.status==="published"),[t]),S=fc((_,L)=>{let z=!c.includes(_),O=[...I,...k];if(z){if(L.shiftKey&&g){let W=O.findIndex(be=>be.id===g),se=O.findIndex(be=>be.id===_);if(W===-1||se===-1){l([...c,_]);return}let j=uH(c),Q=Math.min(W,se),H=Math.max(W,se),ne=O.reduce((be,X,ie)=>((ie>=Q&&ie<=H||j.has(X.id))&&be.push(X.id),be),[]);l(ne)}else l([...c,_]);h(_)}else h(null),l(c.filter(W=>W!==_))},[g,l,k,c,I]);i1(()=>{c.length||h(null)},[c]);let T=fc(_=>{let L;return c.includes(_)?L=t.filter(z=>c.includes(z.id)):L=t.filter(z=>z.id===_),L.map(z=>({...z,elements:hH({type:"everything",elements:z.elements,randomizeSeed:!0}).duplicatedElements}))},[t,c]),A=fc((_,L)=>{let z={itemIds:c.includes(_)?c:[_]};L.dataTransfer.setData(pH.excalidrawlibIds,JSON.stringify(z))},[c]),R=fc(_=>_?c.includes(_):!1,[c]),M=fc(()=>{o(r)},[r,o]),P=fc(_=>{_&&n(T(_))},[T,n]),F=u.size>=(E.length?E:t).length?xH:bH,U=h3(null);i1(()=>{gH(()=>{U.current?.focus()})},[]);let B=!v&&Or(b3,{children:[!y&&bo("div",{className:"library-menu-items-container__header",children:b("labels.personalLib")}),!r.length&&!I.length?Or("div",{className:"library-menu-items__no-items",children:[!k.length&&bo("div",{className:"library-menu-items__no-items__label",children:b("library.noItems")}),bo("div",{className:"library-menu-items__no-items__hint",children:k.length>0?b("library.hint_emptyPrivateLibrary"):b("library.hint_emptyLibrary")})]}):Or(Lg,{children:[r.length>0&&bo(ym,{itemsRenderedPerBatch:F,items:[{id:null,elements:r}],onItemSelectToggle:S,onItemDrag:A,onClick:M,isItemSelected:R,svgCache:u}),bo(ym,{itemsRenderedPerBatch:F,items:I,onItemSelectToggle:S,onItemDrag:A,onClick:P,isItemSelected:R,svgCache:u})]}),k.length>0&&bo("div",{className:"library-menu-items-container__header",style:{marginTop:"0.75rem"},children:b("labels.excalidrawLib")}),k.length>0&&bo(Lg,{children:bo(ym,{itemsRenderedPerBatch:F,items:k,onItemSelectToggle:S,onItemDrag:A,onClick:P,isItemSelected:R,svgCache:u})})]}),G=v&&Or(b3,{children:[Or("div",{className:"library-menu-items-container__header",children:[b("library.search.heading"),!e&&Or("div",{className:"library-menu-items-container__header__hint",style:{cursor:"pointer"},onPointerDown:_=>_.preventDefault(),onClick:_=>{w("")},children:[bo("kbd",{children:"esc"})," to clear"]})]}),E.length>0?bo(Lg,{children:bo(ym,{itemsRenderedPerBatch:F,items:E,onItemSelectToggle:S,onItemDrag:A,onClick:P,isItemSelected:R,svgCache:u})}):Or("div",{className:"library-menu-items__no-items",children:[bo("div",{className:"library-menu-items__no-items__hint",children:b("library.search.noResults")}),bo(Xo,{onPointerDown:_=>_.preventDefault(),onSelect:()=>{w("")},style:{width:"auto",marginTop:"1rem"},children:b("library.search.clearSearch")})]})]});return Or("div",{className:"library-menu-items-container",style:r.length||I.length||k.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[Or("div",{className:"library-menu-items-header",children:[!y&&bo(pi,{ref:U,type:"search",className:fH("library-menu-items-container__search",{hideCancelButton:m.formFactor!=="phone"}),placeholder:b("library.search.inputPlaceholder"),value:f,onChange:_=>w(_)}),bo(c3,{selectedItems:c,onSelectItems:l,className:"library-menu-dropdown-container--in-heading"})]}),Or(fo.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:k.length>0?1:"0 1 auto",margin:y?"auto":0},ref:p,children:[e&&bo("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:bo(So,{})}),B,G,y&&bo(vg,{style:{padding:"16px 0",width:"100%"},id:i,libraryReturnUrl:s,theme:a})]})]})}import{jsx as ui,jsxs as w3}from"react/jsx-runtime";var gc=Ze(!1),y3=({children:e})=>ui("div",{className:"layer-ui__library",children:e}),SH=I3(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:o,setAppState:n,libraryReturnUrl:r,library:a,id:i,theme:s,selectedItems:l,onSelectItems:c})=>{let[m]=Ee(fa),p=d1(g=>{(async(f,w)=>{Ne("element","addToLibrary","ui");for(let v of wH)if(f.some(E=>E.type===v))return n({errorMessage:b(`errors.libraryElementTypeError.${v}`)});let y=[{status:"unpublished",elements:f,id:vH(),created:Date.now()},...w];o(),a.setLibrary(y).catch(()=>{n({errorMessage:b("alerts.errorAddingToLibrary")})})})(g,m.libraryItems)},[o,a,n,m.libraryItems]),d=E3(()=>m.libraryItems,[m]);if(m.status==="loading"&&!m.isInitialized)return ui(y3,{children:ui("div",{className:"layer-ui__library-message",children:w3("div",{children:[ui(So,{size:"2em"}),ui("span",{children:b("labels.libraryLoadingMessage")})]})})});let u=m.libraryItems.length>0||t.length>0;return w3(y3,{children:[ui(l1,{isLoading:m.status==="loading",libraryItems:d,onAddToLibrary:p,onInsertLibraryItems:e,pendingElements:t,id:i,libraryReturnUrl:r,theme:s,onSelectItems:c,selectedItems:l}),u&&ui(vg,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:i,libraryReturnUrl:r,theme:s})]})}),c1=(e,t)=>({elements:e,pending:Me(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),MH=(e,t)=>{let o=Fn(),[n,r]=v3(()=>c1(o,e.selectedElementIds)),a=yH(new Map);return m1(()=>{for(let i of n.pending)a.current.set(i.id,i.version)},[n.pending]),m1(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&r(i=>{if(!EH(i.selectedElementIds,e.selectedElementIds))return a.current.clear(),c1(o,e.selectedElementIds);let s=t.scene.getNonDeletedElementsMap();for(let l of Object.keys(e.selectedElementIds)){let c=s.get(l)?.version;if(c&&c!==a.current.get(l))return c1(o,e.selectedElementIds)}return i})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,o]),n.pending},T3=I3(()=>{let e=Mt(),{onInsertElements:t}=e,o=Dr(),n=qe(),r=Qe(),[a,i]=v3([]),s=E3(()=>e.library,[e.library]),l=MH(n,e);m1(()=>kH(document,CH.KEYDOWN,p=>{if(p.key===IH.ESCAPE&&p.target instanceof HTMLElement){let d=p.target;if(d.closest(`.${x3.SIDEBAR}`))a.length>0?(p.stopPropagation(),i([])):TH(d)&&d instanceof HTMLInputElement&&!d.value&&(p.stopPropagation(),r({openSidebar:null}),e.focusContainer());else if(a.length>0){let{x:u,y:g}=e.lastViewportPosition;document.elementFromPoint(u,g)?.closest(`.${x3.SIDEBAR}`)&&(p.stopPropagation(),i([]))}}},{capture:!0}),[a,r,e]);let c=d1(p=>{t(uc(p)),e.focusContainer()},[t,e]),m=d1(()=>{r({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[r]);return ui(SH,{pendingElements:l,onInsertLibraryItems:c,onAddToLibrary:m,setAppState:r,libraryReturnUrl:o.libraryReturnUrl,library:s,id:e.id,theme:n.theme,selectedItems:a,onSelectItems:i})});import PH from"clsx";import{useRef as AH}from"react";import{createPortal as LH}from"react-dom";import{KEYS as _H}from"@orangecatai/common";import{jsx as k3,jsxs as DH}from"react/jsx-runtime";var C3=e=>{let{closeOnClickOutside:t=!0}=e,o=Tu({className:"excalidraw-modal-container"}),n=AH(document.body.classList.contains("excalidraw-animations-disabled"));if(!o)return null;let r=a=>{a.key===_H.ESCAPE&&(a.nativeEvent.stopImmediatePropagation(),a.stopPropagation(),e.onCloseRequest())};return LH(DH("div",{className:PH("Modal",e.className,{"animations-disabled":n.current}),role:"dialog","aria-modal":"true",onKeyDown:r,"aria-labelledby":e.labelledBy,children:[k3("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),k3("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),o)};import{jsx as wm,jsxs as zH}from"react/jsx-runtime";function OH(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;case"regular":default:return 800}}var Xt=e=>{let[t,o]=y5(),[n]=BH(document.activeElement),{id:r}=St(),a=Je().formFactor==="phone";NH(()=>{if(!t)return;let c=S3(t);setTimeout(()=>{c.length>0&&e.autofocus!==!1&&(c[1]||c[0]).focus()});let m=p=>{if(p.key===FH.TAB){let d=S3(t),{activeElement:u}=document,g=d.findIndex(h=>h===u);g===0&&p.shiftKey?(d[d.length-1].focus(),p.preventDefault()):g===d.length-1&&!p.shiftKey&&(d[0].focus(),p.preventDefault())}};return t.addEventListener("keydown",m),()=>t.removeEventListener("keydown",m)},[t,e.autofocus]);let i=Qe(),s=Sr(gc),l=()=>{i({openMenu:null}),s(!1),n.focus(),e.onCloseRequest()};return wm(C3,{className:RH("Dialog",e.className,{"Dialog--fullscreen":a}),labelledBy:"dialog-title",maxWidth:OH(e.size),onCloseRequest:l,closeOnClickOutside:e.closeOnClickOutside,children:zH($t,{ref:o,children:[e.title&&wm("h2",{id:`${r}-dialog-title`,className:"Dialog__title",children:wm("span",{className:"Dialog__titleContent",children:e.title})}),a&&wm("button",{className:"Dialog__close",onClick:l,title:b("buttons.close"),"aria-label":b("buttons.close"),type:"button",children:Nn}),wm("div",{className:"Dialog__content",children:e.children})]})})};import{KEYS as Ot}from"@orangecatai/common";var _g=[{icon:El,value:"hand",key:Ot.H,numericKey:null,fillable:!1,toolbar:!0},{icon:ss,value:"selection",key:Ot.V,numericKey:Ot[1],fillable:!0,toolbar:!0},{icon:gl,value:"rectangle",key:Ot.R,numericKey:Ot[2],fillable:!0,toolbar:!0},{icon:hl,value:"diamond",key:Ot.D,numericKey:Ot[3],fillable:!0,toolbar:!0},{icon:fl,value:"ellipse",key:Ot.O,numericKey:Ot[4],fillable:!0,toolbar:!0},{icon:nu,value:"arrow",key:Ot.A,numericKey:Ot[5],fillable:!0,toolbar:!0},{icon:bl,value:"line",key:Ot.L,numericKey:Ot[6],fillable:!0,toolbar:!0},{icon:Pr,value:"freedraw",key:[Ot.P,Ot.X],numericKey:Ot[7],fillable:!1,toolbar:!0},{icon:Ar,value:"text",key:Ot.T,numericKey:Ot[8],fillable:!1,toolbar:!0},{icon:xl,value:"image",key:null,numericKey:Ot[9],fillable:!1,toolbar:!0},{icon:ru,value:"eraser",key:Ot.E,numericKey:Ot[0],fillable:!1,toolbar:!0},{icon:_r,value:"laser",key:Ot.K,numericKey:null,fillable:!1,toolbar:!1}],p1=e=>e.state.preferredSelectionTool.type==="lasso"?[{value:"lasso",icon:ss,key:Ot.V,numericKey:Ot[1],fillable:!0,toolbar:!0},..._g.slice(1)]:_g,M3=(e,t)=>p1(t).find((n,r)=>n.numericKey!=null&&e===n.numericKey.toString()||n.key&&(typeof n.key=="string"?n.key===e:n.key.includes(e)))?.value||null;import Ur from"clsx";import{useRef as XH,useState as jH}from"react";import{Popover as hi}from"radix-ui";import{CLASSES as R3,KEYS as ZH,capitalizeString as gi,isTransparent as Rg}from"@orangecatai/common";import{shouldAllowVerticalAlign as N3,suppportsHorizontalAlign as B3,hasBoundTextElement as Ng,isElbowArrow as f1,isImageElement as F3,isLinearElement as b1,isTextElement as Fg,isArrowElement as _3,hasStrokeColor as D3,toolIsArrow as Bg}from"@orangecatai/element";import{createIsolation as UH}from"jotai-scope";import u1 from"react";import zr from"tunnel-rat";var g1=u1.createContext(null),kt=()=>u1.useContext(g1),HH=UH(),P3=()=>u1.useMemo(()=>({MainMenuTunnel:zr(),WelcomeScreenMenuHintTunnel:zr(),WelcomeScreenToolbarHintTunnel:zr(),WelcomeScreenHelpHintTunnel:zr(),WelcomeScreenCenterTunnel:zr(),FooterCenterTunnel:zr(),DefaultSidebarTriggerTunnel:zr(),DefaultSidebarTabTriggersTunnel:zr(),OverwriteConfirmDialogTunnel:zr(),TTDDialogTriggerTunnel:zr(),tunnelsJotai:HH}),[]);import{CODES as GH,KEYS as $H}from"@orangecatai/common";import{CaptureUpdateAction as VH}from"@orangecatai/element";var Is=Y({name:"viewMode",label:"labels.viewMode",icon:kl,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:VH.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,o)=>typeof o.viewModeEnabled>"u",keyTest:e=>!e[$H.CTRL_OR_CMD]&&e.altKey&&e.code===GH.R});import{useEffect as WH,useState as KH}from"react";import A3 from"clsx";import{capitalizeString as L3}from"@orangecatai/common";import{Popover as h1}from"radix-ui";import{jsx as Dg,jsxs as YH}from"react/jsx-runtime";var bc=({app:e,options:t,activeTool:o,defaultOption:n,className:r="Shape",namePrefix:a,title:i,"data-testid":s,onToolChange:l,displayedOption:c,fillable:m=!1})=>{let[p,d]=KH(!1),u=o.type,g=c.type===u,h=32/2+10,{container:f}=St();return!t.some(w=>w.type===u)&&p&&d(!1),WH(()=>{let w=e.onPointerDownEmitter.on(()=>{d(!1)});return()=>w?.()},[e]),YH(h1.Root,{open:p,children:[Dg(h1.Trigger,{asChild:!0,children:Dg(xe,{className:A3(r,{fillable:m,active:t.some(w=>w.type===o.type)}),type:"radio",icon:c.icon,checked:g,name:"editor-current-shape",title:i,"aria-label":i,"data-testid":s,onPointerDown:()=>{d(w=>!w),l(n)}})}),Dg(h1.Content,{className:"tool-popover-content",sideOffset:h,collisionBoundary:f??void 0,children:t.map(({type:w,icon:y,title:v})=>Dg(xe,{className:A3(r,{active:u===w}),type:"radio",icon:y,checked:u===w,name:`${a}-option`,title:v||L3(w),keyBindingLabel:"","aria-label":v||L3(w),"data-testid":`toolbar-${w}`,onChange:()=>{e.state.activeTool.type!==w&&Ne("toolbar",w,"ui"),e.setActiveTool({type:w}),l?.(w)}},w))})]})};import{Fragment as En,jsx as ye,jsxs as et}from"react/jsx-runtime";var x1=Ur([R3.SHAPE_ACTIONS_THEME_SCOPE,"properties-content"]),vm=(e,t)=>{let o=t[0]?.type||null;for(let n of t)if(n.type!==o){o=null;break}return D3(e.activeTool.type)&&o!=="image"&&o!=="frame"&&o!=="magicframe"||t.some(n=>D3(n.type))},Em=(e,t)=>kr(e.activeTool.type)||t.some(o=>kr(o.type)),O3=({appState:e,elementsMap:t,renderAction:o,app:n})=>{let r=ol(t,e),a=!1;r.length===2&&(Ng(r[0])||Ng(r[1]))&&(a=!0);let i=!!(e.editingTextElement||e.newElement),s=Je(),l=document.documentElement.getAttribute("dir")==="rtl",c=kr(e.activeTool.type)&&!Rg(e.currentItemBackgroundColor)||r.some(g=>kr(g.type)&&!Rg(g.backgroundColor)),m=r.length===1||a,p=!e.selectedLinearElement?.isEditing&&r.length===1&&b1(r[0])&&!f1(r[0]),d=!e.croppingElementId&&r.length===1&&F3(r[0]),u=!a&&Ko(e,n);return et("div",{className:"selected-shape-actions",children:[ye("div",{children:vm(e,r)&&o("changeStrokeColor")}),Em(e,r)&&ye("div",{children:o("changeBackgroundColor")}),c&&o("changeFillStyle"),(wd(e.activeTool.type)||r.some(g=>wd(g.type)))&&o("changeStrokeWidth"),(e.activeTool.type==="freedraw"||r.some(g=>g.type==="freedraw"))&&o("changeStrokeShape"),(vd(e.activeTool.type)||r.some(g=>vd(g.type)))&&et(En,{children:[o("changeStrokeStyle"),o("changeSloppiness")]}),(Ed(e.activeTool.type)||r.some(g=>Ed(g.type)))&&ye(En,{children:o("changeRoundness")}),(Bg(e.activeTool.type)||r.some(g=>Bg(g.type)))&&ye(En,{children:o("changeArrowType")}),(e.activeTool.type==="text"||r.some(Fg))&&et(En,{children:[o("changeFontFamily"),o("changeFontSize"),(e.activeTool.type==="text"||B3(r,t))&&o("changeTextAlign")]}),N3(r,t)&&o("changeVerticalAlign"),(nl(e.activeTool.type)||r.some(g=>nl(g.type)))&&ye(En,{children:o("changeArrowhead")}),o("changeOpacity"),et("fieldset",{children:[ye("legend",{children:b("labels.layers")}),et("div",{className:"buttonList",children:[o("sendToBack"),o("sendBackward"),o("bringForward"),o("bringToFront")]})]}),u&&!a&&et("fieldset",{children:[ye("legend",{children:b("labels.align")}),et("div",{className:"buttonList",children:[l?et(En,{children:[o("alignRight"),o("alignHorizontallyCentered"),o("alignLeft")]}):et(En,{children:[o("alignLeft"),o("alignHorizontallyCentered"),o("alignRight")]}),r.length>2&&o("distributeHorizontally"),ye("div",{style:{flexBasis:"100%",height:0}}),et("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[o("alignTop"),o("alignVerticallyCentered"),o("alignBottom"),r.length>2&&o("distributeVertically")]})]})]}),!i&&r.length>0&&et("fieldset",{children:[ye("legend",{children:b("labels.actions")}),et("div",{className:"buttonList",children:[s.formFactor!=="phone"&&o("duplicateSelection"),s.formFactor!=="phone"&&o("deleteSelectedElements"),o("group"),o("ungroup"),m&&o("hyperlink"),d&&o("cropEditor"),p&&o("toggleLinearEditor")]})]})]})},z3=({appState:e,renderAction:t,setAppState:o,targetElements:n,container:r})=>{let a=kr(e.activeTool.type)&&!Rg(e.currentItemBackgroundColor)||n.some(l=>kr(l.type)&&!Rg(l.backgroundColor)),i=n.length>0||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser"&&e.activeTool.type!=="lasso",s=e.openPopup==="compactStrokeStyles";return i?ye("div",{className:"compact-action-item",children:et(hi.Root,{open:s,onOpenChange:l=>{o(l?{openPopup:"compactStrokeStyles"}:{openPopup:null})},children:[ye(hi.Trigger,{asChild:!0,children:ye("button",{type:"button",className:Ur("compact-action-button properties-trigger",{active:s}),title:b("labels.stroke"),onClick:l=>{l.preventDefault(),l.stopPropagation(),o({openPopup:s?null:"compactStrokeStyles"})},children:nT})}),s&&ye(ca,{className:x1,container:r,style:{maxWidth:"13rem"},onClose:()=>{},children:et("div",{className:"selected-shape-actions",children:[a&&t("changeFillStyle"),(wd(e.activeTool.type)||n.some(l=>wd(l.type)))&&t("changeStrokeWidth"),(vd(e.activeTool.type)||n.some(l=>vd(l.type)))&&et(En,{children:[t("changeStrokeStyle"),t("changeSloppiness")]}),(Ed(e.activeTool.type)||n.some(l=>Ed(l.type)))&&t("changeRoundness"),t("changeOpacity")]})})]})}):null},U3=({appState:e,renderAction:t,setAppState:o,targetElements:n,container:r,app:a})=>{let i=Bg(e.activeTool.type)||n.some(l=>Bg(l.type)),s=e.openPopup==="compactArrowProperties";return i?ye("div",{className:"compact-action-item",children:et(hi.Root,{open:s,onOpenChange:l=>{o(l?{openPopup:"compactArrowProperties"}:{openPopup:null})},children:[ye(hi.Trigger,{asChild:!0,children:ye("button",{type:"button",className:Ur("compact-action-button properties-trigger",{active:s}),title:b("labels.arrowtypes"),onClick:l=>{l.preventDefault(),l.stopPropagation(),o({openPopup:s?null:"compactArrowProperties"})},children:(()=>{let l=Bo(n,a,c=>_3(c)?c.elbowed?"elbow":c.roundness?"round":"sharp":null,c=>_3(c),c=>c?null:e.currentItemArrowType);return l==="elbow"?Ml:l==="round"?Pl:Sl})()})}),s&&ye(ca,{container:r,className:"properties-content",style:{maxWidth:"13rem"},onClose:()=>{},children:t("changeArrowProperties")})]})}):null},H3=({appState:e,renderAction:t,setAppState:o,targetElements:n,container:r,elementsMap:a})=>{let{saveCaretPosition:i,restoreCaretPosition:s}=kT(),l=e.openPopup==="compactTextProperties";return ye("div",{className:"compact-action-item",children:et(hi.Root,{open:l,onOpenChange:c=>{c?(e.editingTextElement&&i(),o({openPopup:"compactTextProperties"})):(o({openPopup:null}),e.editingTextElement&&s())},children:[ye(hi.Trigger,{asChild:!0,children:ye("button",{type:"button",className:Ur("compact-action-button properties-trigger",{active:l}),title:b("labels.textAlign"),onClick:c=>{c.preventDefault(),c.stopPropagation(),l?o({openPopup:null}):(e.editingTextElement&&i(),o({openPopup:"compactTextProperties"}))},children:S2})}),e.openPopup==="compactTextProperties"&&ye(ca,{className:x1,container:r,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!e.editingTextElement,onClose:()=>{e.editingTextElement&&s()},children:et("div",{className:"selected-shape-actions",children:[(e.activeTool.type==="text"||n.some(Fg))&&t("changeFontSize"),(e.activeTool.type==="text"||B3(n,a))&&t("changeTextAlign"),N3(n,a)&&t("changeVerticalAlign")]})})]})})},G3=({appState:e,renderAction:t,targetElements:o,setAppState:n,container:r,app:a,showDuplicate:i,showDelete:s})=>{let l=!!(e.editingTextElement||e.newElement),c=!e.croppingElementId&&o.length===1&&F3(o[0]),m=o.length===1,p=Ko(e,a),d=!1;o.length===2&&(Ng(o[0])||Ng(o[1]))&&(d=!0);let u=document.documentElement.getAttribute("dir")==="rtl",g=e.openPopup==="compactOtherProperties";return l||o.length===0?null:ye("div",{className:"compact-action-item",children:et(hi.Root,{open:g,onOpenChange:h=>{n(h?{openPopup:"compactOtherProperties"}:{openPopup:null})},children:[ye(hi.Trigger,{asChild:!0,children:ye("button",{type:"button",className:Ur("compact-action-button properties-trigger",{active:g}),title:b("labels.actions"),onClick:h=>{h.preventDefault(),h.stopPropagation(),n({openPopup:g?null:"compactOtherProperties"})},children:w2})}),g&&ye(ca,{className:x1,container:r,style:{maxWidth:"12rem",justifyContent:"center",alignItems:"center"},onClose:()=>{},children:et("div",{className:"selected-shape-actions",children:[et("fieldset",{children:[ye("legend",{children:b("labels.layers")}),et("div",{className:"buttonList",children:[t("sendToBack"),t("sendBackward"),t("bringForward"),t("bringToFront")]})]}),p&&!d&&et("fieldset",{children:[ye("legend",{children:b("labels.align")}),et("div",{className:"buttonList",children:[u?et(En,{children:[t("alignRight"),t("alignHorizontallyCentered"),t("alignLeft")]}):et(En,{children:[t("alignLeft"),t("alignHorizontallyCentered"),t("alignRight")]}),o.length>2&&t("distributeHorizontally"),ye("div",{style:{flexBasis:"100%",height:0}}),et("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[t("alignTop"),t("alignVerticallyCentered"),t("alignBottom"),o.length>2&&t("distributeVertically")]})]})]}),et("fieldset",{children:[ye("legend",{children:b("labels.actions")}),et("div",{className:"buttonList",children:[t("group"),t("ungroup"),m&&t("hyperlink"),c&&t("cropEditor"),i&&t("duplicateSelection"),s&&t("deleteSelectedElements")]})]})]})})]})})},qH=({appState:e,renderAction:t,targetElements:o})=>!e.selectedLinearElement?.isEditing&&o.length===1&&b1(o[0])&&!f1(o[0])?ye("div",{className:"compact-action-item",children:t("toggleLinearEditor")}):null,$3=({appState:e,elementsMap:t,renderAction:o,app:n,setAppState:r})=>{let a=ol(t,e),{container:i}=St(),s=!!(e.editingTextElement||e.newElement),l=!e.selectedLinearElement?.isEditing&&a.length===1&&b1(a[0])&&!f1(a[0]);return et("div",{className:"compact-shape-actions",children:[vm(e,a)&&ye("div",{className:Ur("compact-action-item"),children:o("changeStrokeColor")}),Em(e,a)&&ye("div",{className:"compact-action-item",children:o("changeBackgroundColor")}),ye(z3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i}),ye(U3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,app:n}),l&&ye("div",{className:"compact-action-item",children:o("toggleLinearEditor")}),(e.activeTool.type==="text"||a.some(Fg))&&et(En,{children:[ye("div",{className:"compact-action-item",children:o("changeFontFamily")}),ye(H3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,elementsMap:t})]}),!s&&a.length>0&&ye("div",{className:"compact-action-item",children:o("duplicateSelection")}),!s&&a.length>0&&ye("div",{className:"compact-action-item",children:o("deleteSelectedElements")}),ye(G3,{appState:e,renderAction:o,targetElements:a,setAppState:r,container:i,app:n})]})},V3=({appState:e,elementsMap:t,renderAction:o,app:n,setAppState:r})=>{let a=ol(t,e),{container:i}=St(),s=XH(null),l=s.current?.getBoundingClientRect()?.width??0,c=9,m=6,p=32,d=c*p+(c-1)*m,u=p+m,g=l>=d+u,h=l>=d+2*u;return et($t,{className:"compact-shape-actions mobile-shape-actions",style:{flexDirection:"row",boxShadow:"none",padding:0,zIndex:2,backgroundColor:"transparent",height:p*1.35,marginBottom:4,alignItems:"center",gap:m,pointerEvents:"none"},ref:s,children:[et("div",{style:{display:"flex",flexDirection:"row",gap:m,flex:1},children:[vm(e,a)&&ye("div",{className:Ur("compact-action-item"),children:o("changeStrokeColor")}),Em(e,a)&&ye("div",{className:"compact-action-item",children:o("changeBackgroundColor")}),ye(z3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i}),ye(U3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,app:n}),ye(qH,{appState:e,renderAction:o,targetElements:a}),(e.activeTool.type==="text"||a.some(Fg))&&et(En,{children:[ye("div",{className:"compact-action-item",children:o("changeFontFamily")}),ye(H3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,elementsMap:t})]}),ye(G3,{appState:e,renderAction:o,targetElements:a,setAppState:r,container:i,app:n,showDuplicate:!h,showDelete:!g})]}),et("div",{style:{display:"flex",flexDirection:"row",gap:m},children:[ye("div",{className:"compact-action-item",children:o("undo")}),ye("div",{className:"compact-action-item",children:o("redo")}),h&&ye("div",{className:"compact-action-item",children:o("duplicateSelection")}),g&&ye("div",{className:"compact-action-item",children:o("deleteSelectedElements")})]})]})},W3=({activeTool:e,setAppState:t,app:o,UIOptions:n})=>{let[r,a]=jH(!1),i=ho(),s=i==="full",l=i==="compact",c=[{type:"selection",icon:ss,title:gi(b("toolBar.selection"))},{type:"lasso",icon:Ya,title:gi(b("toolBar.lasso"))}],m=e.type==="frame",p=e.type==="laser",d=s&&e.type==="lasso"&&o.state.preferredSelectionTool.type!=="lasso",u=e.type==="embeddable",{TTDDialogTriggerTunnel:g}=kt();return et(En,{children:[p1(o).map(({value:h,icon:f,key:w,numericKey:y,fillable:v,toolbar:E})=>{if(E===!1||n.tools?.[h]===!1)return null;let I=b(`toolBar.${h}`),k=w&&gi(typeof w=="string"?w:w[0]),S=k?`${k} ${b("helpDialog.or")} ${y}`:`${y}`,T=h==="hand"?void 0:y||k;return(h==="selection"||h==="lasso")&&l?ye(bc,{app:o,options:c,activeTool:e,defaultOption:o.state.preferredSelectionTool.type,namePrefix:"selectionType",title:gi(b("toolBar.selection")),"data-testid":"toolbar-selection",onToolChange:A=>{(A==="selection"||A==="lasso")&&(o.setActiveTool({type:A}),t({preferredSelectionTool:{type:A,initialized:!0}}))},displayedOption:c.find(A=>A.type===o.state.preferredSelectionTool.type)||c[0],fillable:e.type==="selection"},"selection-popover"):ye(xe,{className:Ur("Shape",{fillable:v}),type:"radio",icon:f,checked:e.type===h,name:"editor-current-shape",title:`${gi(I)} \u2014 ${S}`,keyBindingLabel:T,"aria-label":gi(I),"aria-keyshortcuts":S,"data-testid":`toolbar-${h}`,onPointerDown:({pointerType:A})=>{!o.state.penDetected&&A==="pen"&&o.togglePenMode(!0),h==="selection"&&(o.state.activeTool.type==="selection"?o.setActiveTool({type:"lasso"}):o.setActiveTool({type:"selection"}))},onChange:({pointerType:A})=>{o.state.activeTool.type!==h&&Ne("toolbar",h,"ui"),h==="image"?o.setActiveTool({type:h}):o.setActiveTool({type:h})}},h)}),ye("div",{className:"App-toolbar__divider"}),ye(xe,{className:"Shape",type:"radio",icon:uu,checked:!1,name:"editor-current-shape",title:"Image Generator \u2014 G",keyBindingLabel:"G","aria-label":"Image Generator","data-testid":"toolbar-image-generator",onChange:()=>{Ne("toolbar","imageGenerator","ui"),o.onImageGeneratorSelect()}}),ye(xe,{className:"Shape",type:"radio",icon:gu,checked:!1,name:"editor-current-shape",title:"Video Generator \u2014 M",keyBindingLabel:"M","aria-label":"Video Generator","data-testid":"toolbar-video-generator",onChange:()=>{Ne("toolbar","videoGenerator","ui"),o.onVideoGeneratorSelect()}}),ye(xe,{className:"Shape",type:"radio",icon:Lr,checked:m,name:"editor-current-shape",title:`${gi(b("toolBar.frame"))} \u2014 F`,keyBindingLabel:"F","aria-label":gi(b("toolBar.frame")),"data-testid":"toolbar-frame",onChange:()=>{Ne("toolbar","frame","ui"),o.setActiveTool({type:"frame"})}}),et(Ue,{open:r,children:[ye(Ue.Trigger,{className:Ur("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":u||d||p&&!o.props.isCollaborating}),onToggle:()=>{a(!r),t({openMenu:null,openPopup:null})},title:b("toolBar.extraTools"),children:u?yl:p&&!o.props.isCollaborating?_r:d?Ya:Dd}),et(Ue.Content,{onClickOutside:()=>a(!1),onSelect:()=>a(!1),className:"App-toolbar__extra-tools-dropdown",children:[ye(Ue.Item,{onSelect:()=>o.setActiveTool({type:"embeddable"}),icon:yl,"data-testid":"toolbar-embeddable",selected:u,children:b("toolBar.embeddable")}),ye(Ue.Item,{onSelect:()=>o.setActiveTool({type:"laser"}),icon:_r,"data-testid":"toolbar-laser",selected:p,shortcut:ZH.K.toLocaleUpperCase(),children:b("toolBar.laser")}),s&&ye(Ue.Item,{onSelect:()=>o.setActiveTool({type:"lasso"}),icon:Ya,"data-testid":"toolbar-lasso",selected:d,children:b("toolBar.lasso")}),ye("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),o.props.aiEnabled!==!1&&ye(g.Out,{}),ye(Ue.Item,{onSelect:()=>o.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:Tl,"data-testid":"toolbar-mermaid",children:b("toolBar.mermaidToExcalidraw")}),o.props.aiEnabled!==!1&&o.plugins.diagramToCode&&ye(Ue.Item,{onSelect:()=>o.onMagicframeToolSelect(),icon:ds,"data-testid":"toolbar-magicframe",badge:ye(Ue.Item.Badge,{children:"AI"}),children:b("toolBar.magicframe")})]})]})]})},K3=({renderAction:e})=>e("scrollBackToContent"),Y3=({renderAction:e,zoom:t})=>et(fo.Row,{align:"center",className:R3.ZOOM_ACTIONS,children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]}),X3=({renderAction:e,className:t})=>et("div",{className:`undo-redo-buttons ${t}`,children:[ye("div",{className:"undo-button-container",children:ye(Fo,{label:b("buttons.undo"),children:e("undo")})}),ye("div",{className:"redo-button-container",children:et(Fo,{label:b("buttons.redo"),children:[" ",e("redo")]})})]}),j3=({actionManager:e,showExitZenModeBtn:t})=>ye("button",{type:"button",className:Ur("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(si),children:b("buttons.exitZenMode")}),Z3=({actionManager:e})=>ye("button",{type:"button",className:"disable-view-mode",onClick:()=>e.executeAction(Is),children:aT});import{useRef as JH}from"react";var y1=e=>{let t=JH({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...o)=>t.current.userFn(...o)),t.current.stableFn};import{jsx as eG,jsxs as QH}from"react/jsx-runtime";var Ts=Ze(null),q3=()=>{let[e,t]=Ee(Ts),o=Rt();return e&&e==="clearCanvas"?eG(Ig,{onConfirm:()=>{o.executeAction(ga),t(null)},onCancel:()=>t(null),title:b("clearCanvasDialog.title"),children:QH("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})}):null};var w1={};WE(w1,{toggleTheme:()=>tG});var tG={...gs,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(gs,"commandPalette")}};import{jsx as xo,jsxs as Hr}from"react/jsx-runtime";var iG=Ze(null),Nt={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links",library:"Library"},Q3=e=>{switch(e){case Nt.app:return 1;case Nt.export:return 2;case Nt.editor:return 3;case Nt.tools:return 4;case Nt.elements:return 5;case Nt.links:return 6;default:return 10}},Ug=({shortcut:e,className:t,children:o})=>{let n=e.replace("++","+$").split("+");return Hr("div",{className:tS("shortcut",t),children:[n.map((r,a)=>xo("div",{className:"shortcut-wrapper",children:xo("div",{className:"shortcut-key",children:r==="$"?"+":r})},r)),xo("div",{className:"shortcut-desc",children:o})]})},nS=e=>!e.altKey&&e[hr.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===hr.P||e.key===hr.SLASH),sG=Object.assign(e=>{let t=qe(),o=Qe();return zg(()=>{let n=r=>{nS(r)&&(r.preventDefault(),r.stopPropagation(),o(a=>{let i=a.openDialog?.name==="commandPalette"?null:{name:"commandPalette"};return i&&Ne("command_palette","open","shortcut"),{openDialog:i}}))};return window.addEventListener(Hg.KEYDOWN,n,{capture:!0}),()=>window.removeEventListener(Hg.KEYDOWN,n,{capture:!0})},[o]),t.openDialog?.name!=="commandPalette"?null:xo(lG,{...e})},{defaultItems:w1});function lG({customCommandPaletteItems:e}){let t=Mt(),o=qe(),n=Qe(),r=Dr(),a=Rt(),[i,s]=Ee(iG),[l,c]=Og(null),m=oS(null),p=ja({uiAppState:o,customCommandPaletteItems:e,appProps:r}),[d]=Ee(fa),u=nG(()=>d.libraryItems?.filter(T=>!!T.name).map(T=>({label:T.name,icon:xo(cG,{id:T.id,elements:T.elements}),category:"Library",order:Q3("Library"),haystack:vs(T.name),perform:()=>{t.onInsertElements(uc([T]))}}))||[],[t,d.libraryItems]);zg(()=>{let{uiAppState:T,customCommandPaletteItems:A,appProps:R}=p,M=B=>{let G="";return B.label&&(typeof B.label=="function"?G=b(B.label(t.scene.getNonDeletedElements(),T,t)):G=b(B.label)),G},P=B=>typeof B.icon=="function"?B.icon(T,t.scene.getNonDeletedElements()):B.icon,F=[],U=(B,G,_)=>{let L={label:M(B),icon:P(B),category:G,shortcut:Tt(B.name),keywords:B.keywords,predicate:B.predicate,viewMode:B.viewMode,perform:()=>{a.executeAction(B,"commandPalette")}};return _?_(L,B):L};if(T&&t.scene&&a){let B=[a.actions.group,a.actions.ungroup,a.actions.cut,a.actions.copy,a.actions.deleteSelectedElements,a.actions.wrapSelectionInFrame,a.actions.copyStyles,a.actions.pasteStyles,a.actions.bringToFront,a.actions.bringForward,a.actions.sendBackward,a.actions.sendToBack,a.actions.alignTop,a.actions.alignBottom,a.actions.alignLeft,a.actions.alignRight,a.actions.alignVerticallyCentered,a.actions.alignHorizontallyCentered,a.actions.duplicateSelection,a.actions.flipHorizontal,a.actions.flipVertical,a.actions.zoomToFitSelection,a.actions.zoomToFitSelectionInViewport,a.actions.increaseFontSize,a.actions.decreaseFontSize,a.actions.toggleLinearEditor,a.actions.cropEditor,a.actions.togglePolygon,cm,fg,b5].map(W=>U(W,Nt.elements,(se,j)=>({...se,predicate:j.predicate?j.predicate:(Q,H,ne,be)=>Me(Q,H).length>0}))),G=[a.actions.toggleHandTool,a.actions.setFrameAsActiveTool,a.actions.toggleLassoTool].map(W=>U(W,Nt.tools)),_=[a.actions.undo,a.actions.redo,a.actions.zoomIn,a.actions.zoomOut,a.actions.resetZoom,a.actions.zoomToFit,a.actions.zenMode,a.actions.viewMode,a.actions.gridMode,a.actions.objectsSnapMode,a.actions.toggleShortcuts,a.actions.selectAll,a.actions.toggleElementLock,a.actions.unlockAllElements,a.actions.stats].map(W=>U(W,Nt.editor)),L=[a.actions.saveToActiveFile,a.actions.saveFileToDisk,a.actions.copyAsPng,a.actions.copyAsSvg].map(W=>U(W,Nt.export));F=[...B,..._,{label:M(ga),icon:P(ga),shortcut:Tt(ga.name),category:Nt.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{Yt.set(Ts,"clearCanvas")}},{label:b("buttons.exportImage"),category:Nt.export,icon:lu,shortcut:Tt("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{n({openDialog:{name:"imageExport"}})}},...L];let z=[{label:b("toolBar.library"),category:Nt.app,icon:tu,viewMode:!1,perform:()=>{T.openSidebar?n({openSidebar:null}):n({openSidebar:{name:J3.name,tab:J3.defaultTab}})}},{label:b("search.title"),category:Nt.app,icon:bn,viewMode:!0,perform:()=>{a.executeAction(Im)}},{label:b("labels.shapeSwitch"),category:Nt.elements,icon:Rd,perform:()=>{a.executeAction(f5)}},{label:b("labels.changeStroke"),keywords:["color","outline"],category:Nt.elements,icon:su,viewMode:!1,predicate:(W,se)=>{let j=Me(W,se);return j.length>0&&vm(se,j)},perform:()=>{n(W=>({openPopup:"elementStroke"}))}},{label:b("labels.changeBackground"),keywords:["color","fill"],icon:su,category:Nt.elements,viewMode:!1,predicate:(W,se)=>{let j=Me(W,se);return j.length>0&&Em(se,j)},perform:()=>{n(W=>({openPopup:"elementBackground"}))}},{label:b("labels.canvasBackground"),keywords:["color"],icon:su,category:Nt.editor,viewMode:!1,perform:()=>{n(W=>({openMenu:W.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},..._g.reduce((W,se)=>{let{value:j,icon:Q,key:H,numericKey:ne}=se;if(R.UIOptions.tools?.[j]===!1)return W;let X=H&&rG(typeof H=="string"?H:H[0])||ne,ie={label:b(`toolBar.${j}`),category:Nt.tools,shortcut:X,icon:Q,keywords:["toolbar"],viewMode:!1,perform:({event:ve})=>{j==="image"?t.setActiveTool({type:j}):t.setActiveTool({type:j})}};return W.push(ie),W},[]),...G,{label:b("toolBar.lock"),category:Nt.tools,icon:T.activeTool.locked?ul:is,shortcut:hr.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${b("labels.textToDiagram")}...`,category:Nt.tools,icon:OI,viewMode:!1,predicate:R.aiEnabled,perform:()=>{n(W=>({...W,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${b("toolBar.mermaidToExcalidraw")}...`,category:Nt.tools,icon:Tl,viewMode:!1,predicate:R.aiEnabled,perform:()=>{n(W=>({...W,openDialog:{name:"ttd",tab:"mermaid"}}))}}],O=[...F,...z,...A||[]].map(W=>({...W,icon:W.icon||Rd,order:W.order??Q3(W.category),haystack:`${vs(W.label.toLocaleLowerCase())} ${W.keywords?.join(" ")||""}`}));c(O),s([...O,...u].find(W=>W.label===i?.label)??null)}},[p,t,a,c,i?.label,s,n,u]);let[g,h]=Og(""),[f,w]=Og(null),[y,v]=Og({}),E=T=>{n({openDialog:null},T),h("")},I=(T,A)=>{o.openDialog?.name==="commandPalette"&&(A.stopPropagation(),A.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),E(()=>{T.perform({actionManager:a,event:A}),s(T),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},k=y1(T=>T.viewMode===!1&&o.viewModeEnabled?!1:typeof T.predicate=="function"?T.predicate(t.scene.getNonDeletedElements(),o,r,t):T.predicate===void 0||T.predicate),S=y1(T=>{let A=aG(T.target)||nS(T)||T.key===hr.ESCAPE;if(A&&T.key!==hr.ARROW_UP&&T.key!==hr.ARROW_DOWN&&T.key!==hr.ENTER)return;let R=Object.values(y).flat(),M=i&&!g&&k(i);if(T.key===hr.ARROW_UP){T.preventDefault();let P=R.findIndex(B=>B.label===f?.label);if(M){if(P===0){w(i);return}if(f===i){let B=R[R.length-1];B&&w(B);return}}let F;P===-1?F=R.length-1:F=P===0?R.length-1:(P-1)%R.length;let U=R[F];U&&w(U);return}if(T.key===hr.ARROW_DOWN){T.preventDefault();let P=R.findIndex(B=>B.label===f?.label);if(M){if(!f||P===R.length-1){w(i);return}if(f===i){let B=R[0];B&&w(B);return}}let F=(P+1)%R.length,U=R[F];U&&w(U);return}if(T.key===hr.ENTER&&f&&setTimeout(()=>{I(f,T)}),!A){if(T.stopPropagation(),/^[a-zA-Z0-9]$/.test(T.key)){m?.current?.focus();return}T.preventDefault()}});return zg(()=>(window.addEventListener(Hg.KEYDOWN,S,{capture:!0}),()=>window.removeEventListener(Hg.KEYDOWN,S,{capture:!0})),[S]),zg(()=>{if(!l)return;let T=P=>{let F={};for(let U of P)F[U.category]?F[U.category].push(U):F[U.category]=[U];return F},A=g?.length>1?[...l.filter(k).sort((P,F)=>P.order-F.order),...u]:l.filter(k).sort((P,F)=>P.order-F.order),R=!g&&i&&k(i);if(!g){v(T(R?A.filter(P=>P.label!==i?.label):A)),w(R?i:A[0]||null);return}let M=vs(g.toLocaleLowerCase().replace(/[<>_| -]/g,""));A=oG.filter(M,A,{extract:P=>P.haystack??""}).sort((P,F)=>F.score-P.score).map(P=>P.original),v(T(A)),w(A[0]??null)},[g,l,k,i,u]),Hr(Xt,{onCloseRequest:()=>E(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[xo(pi,{value:g,placeholder:b("commandPalette.search.placeholder"),onChange:T=>{h(T)},selectOnRender:!0,ref:m}),t.editorInterface.formFactor!=="phone"&&Hr("div",{className:"shortcuts-wrapper",children:[xo(Ug,{shortcut:"\u2191\u2193",children:b("commandPalette.shortcuts.select")}),xo(Ug,{shortcut:"\u21B5",children:b("commandPalette.shortcuts.confirm")}),xo(Ug,{shortcut:$("Esc"),children:b("commandPalette.shortcuts.close")})]}),Hr("div",{className:"commands",children:[i&&!g&&Hr("div",{className:"command-category",children:[Hr("div",{className:"command-category-title",children:[b("commandPalette.recents"),xo("div",{className:"icon",style:{marginLeft:"6px"},children:zI})]}),xo(eS,{command:i,isSelected:i.label===f?.label,onClick:T=>I(i,T),disabled:!k(i),onMouseMove:()=>w(i),showShortcut:t.editorInterface.formFactor!=="phone",appState:o})]}),Object.keys(y).length>0?Object.keys(y).map((T,A)=>Hr("div",{className:"command-category",children:[xo("div",{className:"command-category-title",children:T}),y[T].map(R=>xo(eS,{command:R,isSelected:R.label===f?.label,onClick:M=>I(R,M),onMouseMove:()=>w(R),showShortcut:t.editorInterface.formFactor!=="phone",appState:o,size:T==="Library"?"large":"small"},R.label))]},T)):l?Hr("div",{className:"no-match",children:[xo("div",{className:"icon",children:bn})," ",b("commandPalette.search.noMatch")]}):null]})]})}var cG=({id:e,elements:t})=>{let o=oS(null),{svgCache:n}=mc();return bg(e,t,n,o),xo("div",{className:"library-item-icon",ref:o})},eS=({command:e,isSelected:t,disabled:o,onMouseMove:n,onClick:r,showShortcut:a,appState:i,size:s="small"})=>{let l=()=>{};return Hr("div",{className:tS("command-item",{"item-selected":t,"item-disabled":o,"command-item-large":s==="large"}),ref:c=>{t&&!o&&c?.scrollIntoView?.({block:"nearest"})},onClick:o?l:r,onMouseMove:o?l:n,title:o?b("commandPalette.itemNotAvailable"):"",children:[Hr("div",{className:"name",children:[e.icon&&xo(Rr,{className:"icon",size:"var(--icon-size, 1rem)",icon:typeof e.icon=="function"?e.icon(i,[]):e.icon}),xo(Kd,{children:e.label})]}),a&&e.shortcut&&xo(Ug,{shortcut:e.shortcut})]})};import{getSizeFromPoints as bAe,randomInteger as d$,getUpdatedTimestamp as m$}from"@orangecatai/common";import{simplify as jG}from"points-on-curve";import{getStroke as ZG}from"perfect-freehand";import{pointsOnBezierCurves as nCe}from"points-on-curve";import{invariant as aCe}from"@orangecatai/common";import{curve as sCe,lineSegment as lCe,pointFrom as cCe,pointDistance as dCe,pointFromArray as mCe,pointFromVector as pCe,pointRotateRads as uCe,polygon as gCe,polygonFromPoints as hCe,PRECISION as fCe,segmentsIntersectAt as bCe,vector as xCe,vectorAdd as yCe,vectorFromPoint as wCe,vectorScale as vCe}from"@orangecatai/math";import{getElementAbsoluteCoords as ICe}from"@orangecatai/element";var v1=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops};import{pointFrom as qG,pointDistance as vS,pointRotateRads as oAe}from"@orangecatai/math";import{ROUGHNESS as JG,THEME as z1,isTransparent as Sm,assertNever as QG,COLOR_PALETTE as e$,LINE_POLYGON_POINT_MERGE_DISTANCE as rAe,applyDarkModeFilter as qg}from"@orangecatai/common";import{RoughGenerator as t$}from"roughjs/bin/generator";import pPe from"roughjs/bin/rough";import{isRightAngleRads as gPe,lineSegment as hPe,pointFrom as fPe,pointRotateRads as bPe}from"@orangecatai/math";import{BOUND_TEXT_PADDING as yPe,DEFAULT_REDUCED_GLOBAL_ALPHA as wPe,ELEMENT_READY_TO_ERASE_OPACITY as vPe,FRAME_STYLE as EPe,DARK_THEME_FILTER as IPe,MIME_TYPES as yS,THEME as TPe,distance as kPe,getFontString as CPe,isRTL as SPe,getVerticalOffset as MPe,invariant as PPe,applyDarkModeFilter as APe,isSafari as LPe}from"@orangecatai/common";import TMe from"roughjs/bin/rough";import{arrayToMap as CMe,invariant as pS,rescalePoints as SMe,sizeOf as MMe}from"@orangecatai/common";import{degreesToRadians as D1,lineSegment as AMe,pointDistance as LMe,pointFrom as Mo,pointFromArray as LG,pointRotateRads as Ec}from"@orangecatai/math";import{pointsOnBezierCurves as RMe}from"points-on-curve";import{pointCenter as z4e,pointFrom as U4e,pointRotateRads as H4e,pointsEqual as G4e,pointDistance as $4e,vectorFromPoint as V4e,curveLength as W4e,curvePointAtLength as K4e}from"@orangecatai/math";import{DRAGGING_THRESHOLD as j4e,KEYS as Z4e,shouldRotateWithDiscreteAngle as q4e,getGridPoint as J4e,invariant as Q4e,isShallowEqual as eMe,getFeatureFlag as tMe}from"@orangecatai/common";import{deconstructLinearOrFreeDrawElement as nMe,getSnapOutlineMidPoint as rMe,isPathALoop as aMe,moveArrowAboveBindable as iMe,projectFixedPointOntoDiagonal as sMe}from"@orangecatai/element";import{KEYS as zSe,arrayToMap as USe,getFeatureFlag as HSe,invariant as GSe,isTransparent as $Se}from"@orangecatai/common";import{PRECISION as WSe,clamp as KSe,lineSegment as YSe,pointDistance as XSe,pointDistanceSq as jSe,pointFrom as ZSe,pointFromVector as qSe,pointRotateRads as JSe,pointsEqual as QSe,vectorFromPoint as e4e,vectorNormalize as t4e,vectorScale as o4e}from"@orangecatai/math";import{invariant as m3e,isTransparent as p3e}from"@orangecatai/common";import{curveIntersectLineSegment as g3e,isPointWithinBounds as h3e,lineSegment as f3e,lineSegmentIntersectionPoints as b3e,pointFrom as x3e,pointFromVector as y3e,pointRotateRads as w3e,pointsEqual as v3e,vectorFromPoint as E3e,vectorNormalize as I3e,vectorScale as T3e}from"@orangecatai/math";import{ellipse as C3e,ellipseSegmentInterceptPoints as S3e}from"@orangecatai/math/ellipse";import{DEFAULT_ADAPTIVE_RADIUS as pG,DEFAULT_PROPORTIONAL_RADIUS as I1,invariant as RCe,LINE_CONFIRM_THRESHOLD as uG,ROUNDNESS as T1}from"@orangecatai/common";import{bezierEquation as BCe,curve as FCe,curveCatmullRomCubicApproxPoints as OCe,curveOffsetPoints as zCe,lineSegment as UCe,lineSegmentIntersectionPoints as HCe,pointDistance as gG,pointFrom as GCe,pointFromArray as $Ce,pointFromVector as VCe,pointRotateRads as WCe,pointTranslate as KCe,rectangle as YCe,vectorFromPoint as XCe,vectorNormalize as jCe,vectorScale as ZCe}from"@orangecatai/math";import{ROUNDNESS as SCe,assertNever as MCe}from"@orangecatai/common";import{pointsEqual as ACe}from"@orangecatai/math";var rS=e=>!!e&&e.type==="embeddable",aS=e=>!!e&&e.type==="iframe",E1=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),ks=e=>e!=null&&e.type==="text";var Gg=e=>e!=null&&(e.type==="frame"||e.type==="magicframe");var Cs=e=>e!=null&&dG(e.type);var Ss=e=>e!=null&&e.type==="arrow",Tm=e=>Ss(e)&&e.elbowed;var dG=e=>e==="arrow"||e==="line";var xc=e=>e!==null&&"containerId"in e&&e.containerId!==null&&ks(e);var $g=(e,t=1)=>{if(e.length>=3){let[o,n]=[e[0],e[e.length-1]];return gG(o,n)<=uG/t}return!1},km=(e,t)=>{if(t.roundness?.type===T1.PROPORTIONAL_RADIUS||t.roundness?.type===T1.LEGACY)return e*I1;if(t.roundness?.type===T1.ADAPTIVE_RADIUS){let o=t.roundness?.value??pG,n=o/I1;return e<=n?e*I1:o}return 0};import{ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO as R5e,ARROW_LABEL_WIDTH_FRACTION as N5e,BOUND_TEXT_PADDING as B5e,DEFAULT_FONT_SIZE as F5e,TEXT_ALIGN as O5e,VERTICAL_ALIGN as z5e,getFontString as U5e,isProdEnv as H5e,invariant as G5e}from"@orangecatai/common";import{pointFrom as V5e,pointRotateRads as W5e}from"@orangecatai/math";import{BOUND_TEXT_PADDING as m5e,DEFAULT_FONT_SIZE as p5e,DEFAULT_FONT_FAMILY as u5e,getFontString as g5e,isTestEnv as h5e,normalizeEOL as f5e}from"@orangecatai/common";var b5e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase();import{isDevEnv as T5e,isTestEnv as k5e}from"@orangecatai/common";import{curvePointDistance as e3e,distanceToLineSegment as t3e,pointRotateRads as o3e}from"@orangecatai/math";import{ellipse as r3e,ellipseDistanceFromPoint as a3e}from"@orangecatai/math/ellipse";import{invariant as H3e,isDevEnv as G3e,isTestEnv as $3e}from"@orangecatai/common";import{pointFrom as W3e,pointFromVector as K3e,pointRotateRads as Y3e,pointScaleFromOrigin as X3e,pointsEqual as j3e,triangleIncludesPoint as Z3e,vectorCross as q3e,vectorFromPoint as TG,vectorScale as J3e}from"@orangecatai/math";var L1=[1,0],lS=[0,1],_1=[-1,0],cS=[0,-1],Kg=e=>{let[t,o]=e,n=Math.abs(t),r=Math.abs(o);return t>r?L1:t<=-r?_1:o>n?lS:cS},dS=(e,t)=>Kg(TG(e,t)),Yg=(e,t)=>Xg(dS(e,t)),A1=(e,t)=>e[0]===t[0]&&e[1]===t[1],Xg=e=>A1(e,L1)||A1(e,_1);import{clamp as rSe,pointDistance as aSe,pointFrom as iSe,pointScaleFromOrigin as sSe,pointsEqual as lSe,pointTranslate as cSe,vector as dSe,vectorCross as mSe,vectorFromPoint as pSe,vectorScale as uSe}from"@orangecatai/math";import{BinaryHeap as hSe,invariant as fSe,isAnyTrue as bSe,getSizeFromPoints as xSe,isDevEnv as ySe,arrayToMap as wSe}from"@orangecatai/common";var g4e=10/1.5;import{SHIFT_LOCKING_ANGLE as y4e,viewportCoordsToSceneCoords as w4e}from"@orangecatai/common";import{normalizeRadians as E4e,radiansBetweenAngles as I4e,radiansDifference as T4e}from"@orangecatai/math";import{pointsEqual as C4e}from"@orangecatai/math";var Vg=e=>{let t=Math.floor(e.width/2)+1,o=0,n=e.width,r=Math.floor(e.height/2)+1,a=t,i=e.height;return[t,o,n,r,a,i,0,r]};var _G=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}},DG=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},R1=(e,t,o,n)=>{if(t.length<1)return null;let r=v1(t[0]);if(r.length<1)return null;let a=o==="start"?1:r.length-1,i=r[a].data;pS(i.length===6,"Op data length is not 6");let s=Mo(i[4],i[5]),l=Mo(i[2],i[3]),c=Mo(i[0],i[1]),m=r[a-1],p=Mo(0,0);if(m.op==="move"){let B=LG(m.data);pS(B!=null,"Op data is not a point"),p=B}else m.op==="bcurveTo"&&(p=Mo(m.data[4],m.data[5]));let d=(B,G)=>Math.pow(1-B,3)*s[G]+3*B*Math.pow(1-B,2)*l[G]+3*Math.pow(B,2)*(1-B)*c[G]+p[G]*Math.pow(B,3),[u,g]=o==="start"?p:s,[h,f]=[d(.3,0),d(.3,1)],w=Math.hypot(u-h,g-f),y=(u-h)/w,v=(g-f)/w,E=_G(n),I=0;{let[B,G]=o==="end"?e.points[e.points.length-1]:e.points[0],[_,L]=e.points.length>1?o==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];I=Math.hypot(B-_,G-L)}let S=Math.min(E,I*(n==="diamond"||n==="diamond_outline"?.25:.5)),T=u-y*S,A=g-v*S;if(n==="dot"||n==="circle"||n==="circle_outline"){let B=Math.hypot(A-g,T-u)+e.strokeWidth-2;return[u,g,B]}let R=DG(n);if(n==="crowfoot_many"||n==="crowfoot_one_or_many"){let[B,G]=Ec(Mo(u,g),Mo(T,A),D1(-R)),[_,L]=Ec(Mo(u,g),Mo(T,A),D1(R));return[T,A,B,G,_,L]}let[M,P]=Ec(Mo(T,A),Mo(u,g),-R*Math.PI/180),[F,U]=Ec(Mo(T,A),Mo(u,g),D1(R));if(n==="diamond"||n==="diamond_outline"){let B,G;if(o==="start"){let[_,L]=e.points.length>1?e.points[1]:[0,0];[B,G]=Ec(Mo(u+S*2,g),Mo(u,g),Math.atan2(L-g,_-u))}else{let[_,L]=e.points.length>1?e.points[e.points.length-2]:[0,0];[B,G]=Ec(Mo(u-S*2,g),Mo(u,g),Math.atan2(g-L,u-_))}return[u,g,M,P,B,G,F,U]}return[u,g,M,P,F,U]};import{pointFrom as XMe,pointCenter as jMe,pointRotateRads as ZMe,vectorFromPoint as qMe,vectorNormalize as JMe,vectorSubtract as QMe,vectorAdd as e6e,vectorScale as t6e,pointFromVector as o6e,clamp as n6e,isCloseTo as r6e}from"@orangecatai/math";import{arrayToMap as V6e}from"@orangecatai/common";import{isPointWithinBounds as K6e,pointFrom as Y6e}from"@orangecatai/math";import{vectorCross as c6e,vectorFromPoint as d6e}from"@orangecatai/math";import{arrayToMap as RG}from"@orangecatai/common";import{getElementBounds as NG}from"@orangecatai/element";import{isArrowElement as BG,isExcalidrawElement as FG,isFreeDrawElement as OG,isLinearElement as zG,isTextElement as UG}from"@orangecatai/element";import{rangeIncludesValue as jg,pointFrom as wa,pointRotateRads as HG,rangeInclusive as Zg}from"@orangecatai/math";var GG=e=>e.type==="diamond"?[wa(e.width/2,0),wa(e.width,e.height/2),wa(e.width/2,e.height),wa(0,e.height/2)]:[wa(0,0),wa(0+e.width,0),wa(0+e.width,e.height),wa(0,e.height)],$G=e=>zG(e)||OG(e)?e.points:GG(e),gS=e=>{let t=e.reduce((o,[n,r])=>(o.minY=Math.min(o.minY,r),o.minX=Math.min(o.minX,n),o.maxX=Math.max(o.maxX,n),o.maxY=Math.max(o.maxY,r),o),{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},hS=e=>{let t=$G(e),{cx:o,cy:n}=gS(t),r=wa(o,n),a=t.map(m=>HG(m,r,e.angle)),{minX:i,minY:s,maxX:l,maxY:c}=gS(a);return[i+e.x,s+e.y,l+e.x,c+e.y]},N1=(e,t,o=!1)=>{let n=hS(e),r=t[0]<=n[0]&&t[2]>=n[2]&&t[1]<=n[1]&&t[3]>=n[3];return o?r?!0:n[0]<=t[0]&&n[2]>=t[2]&&n[1]<=t[1]&&n[3]>=t[3]:r},fS=(e,t)=>{let o=hS(e);return(jg(o[0],Zg(t[0],t[2]))||jg(t[0],Zg(o[0],o[2])))&&(jg(o[1],Zg(t[1],t[3]))||jg(t[1],Zg(o[1],o[3])))},bS=({elements:e,bounds:t,type:o,errorMargin:n=0})=>{FG(t)&&(t=NG(t,RG(e)));let r=[t[0]-n,t[1]-n,t[2]+n,t[3]+n],a=new Set;for(let i of e){if(a.has(i.id))continue;if(o==="overlap"?fS(i,r):o==="inside"?N1(i,r):N1(i,r,!0)){if(a.add(i.id),i.boundElements)for(let l of i.boundElements)a.add(l.id);UG(i)&&i.containerId&&a.add(i.containerId),BG(i)&&(i.startBinding&&a.add(i.startBinding.elementId),i.endBinding&&a.add(i.endBinding?.elementId))}}return e.filter(i=>a.has(i.id))};import{arrayToMap as C6e,isShallowEqual as WG}from"@orangecatai/common";var VG=function(){let e=null,t=null,o=null,n=(a,i,s,l)=>{if(o!==void 0&&i===t&&a===e&&s.editingGroupId===o?.editingGroupId)return o;let c={};for(let d of a){let u=d.groupIds;if(s.editingGroupId){let g=u.indexOf(s.editingGroupId);g>-1&&(u=u.slice(0,g))}if(u.length>0){let g=u[u.length-1];c[g]=!0}}let m={},p=i.reduce((d,u)=>{if(u.isDeleted)return d;let g=u.groupIds.find(h=>c[h]);return g&&(d[u.id]=!0,Array.isArray(m[g])?m[g].push(u.id):m[g]=[u.id]),d},{});for(let d of Object.keys(m))m[d].length<2&&c[d]&&(c[d]=!1);return t=i,e=a,o={editingGroupId:s.editingGroupId,selectedGroupIds:c,selectedElementIds:B1({...s.selectedElementIds,...p},l)},o},r=(a,i,s,l)=>{let c=l?l.scene.getSelectedElements({selectedElementIds:a.selectedElementIds,elements:i}):F1(i,a);return c.length?n(c,i,a,s):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:B1(a.selectedElementIds,s)}};return r.clearCache=()=>{t=null,e=null,o=null},r}();var D6e=function(){let e=null,t=null,o=null,n=(r,a)=>(o!=null&&r===e&&a.selectedElementIds===t||(o=r.some(i=>a.selectedElementIds[i.id]),e=r,t=a.selectedElementIds),o);return n.clearCache=()=>{e=null,t=null,o=null},n}(),F1=(e,t,o)=>{let n=new Set,r=[];for(let a of e.values()){if(t.selectedElementIds[a.id]){r.push(a),n.add(a.id);continue}if(o?.includeBoundTextElement&&xc(a)&&t.selectedElementIds[a?.containerId]){r.push(a),n.add(a.id);continue}}if(o?.includeElementsInFrames){let a=[];return r.forEach(i=>{Gg(i)&&xS(e,i.id).forEach(s=>!n.has(s.id)&&a.push(s)),a.push(i)}),a}return r};var B1=(e,t)=>WG(t.selectedElementIds,e)?t.selectedElementIds:e;var xS=(e,t)=>{let o=[];for(let n of e.values())n.frameId===t&&o.push(n);return o};var YG=typeof document<"u"?document.createElement("img"):{src:""};YG.src=`data:${yS.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 XG=typeof document<"u"?document.createElement("img"):{src:""};XG.src=`data:${yS.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 O1=new WeakMap;var wS=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image";var sn=class sn{};D(sn,"rg",new t$),D(sn,"cache",new WeakMap),D(sn,"get",(t,o)=>{let n=sn.cache.get(t);if(n&&(o===null||n.theme===o))return n.shape}),D(sn,"delete",t=>{sn.cache.delete(t),O1.delete(t)}),D(sn,"destroy",()=>{sn.cache=new WeakMap}),D(sn,"generateElementShape",(t,o)=>{let n=o?.isExporting?void 0:sn.get(t,o?o.theme:null);if(n!==void 0)return n;O1.delete(t);let r=r$(t,sn.rg,o||{isExporting:!1,canvasBackgroundColor:e$.white,embedsValidationStatus:null,theme:z1.LIGHT});return o?.isExporting||sn.cache.set(t,{shape:r,theme:o?.theme||z1.LIGHT}),r});var vc=sn,o$=e=>[8,8+e],kS=e=>[1.5,6+e];function n$(e){let t=e.roughness,o=Math.max(e.width,e.height),n=Math.min(e.width,e.height);return n>=20&&o>=50||n>=15&&e.roundness&&wS(e.type)||Cs(e)&&o>=50?t:Math.min(t/(o<10?3:2),2.5)}var ya=(e,t=!1,o=!1)=>{let n={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?o$(e.strokeWidth):e.strokeStyle==="dotted"?kS(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:n$(e),stroke:o?qg(e.strokeColor):e.strokeColor,preserveVertices:t||e.roughness<JG.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"video":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill=Sm(e.backgroundColor)?void 0:o?qg(e.backgroundColor):e.backgroundColor,e.type==="ellipse"&&(n.curveFitting=1),n;case"line":case"freedraw":return $g(e.points)&&(n.fillStyle=e.fillStyle,n.fill=e.backgroundColor==="transparent"?void 0:o?qg(e.backgroundColor):e.backgroundColor),n;case"arrow":return n;default:throw new Error(`Unimplemented type ${e.type}`)}},ES=(e,t,o)=>E1(e)&&(t||rS(e)&&o?.get(e.id)!==!0)&&Sm(e.backgroundColor)&&Sm(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:aS(e)?{...e,strokeColor:Sm(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:Sm(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,IS=(e,t,o,n,r,a,i,s)=>{let l=R1(e,t,o,n);if(l===null)return[];let c=(p,d)=>{if(p===null)return[];let[,,u,g,h,f]=p;return[r.line(u,g,h,f,d)]},m=s?qg(e.strokeColor):e.strokeColor;switch(n){case"dot":case"circle":case"circle_outline":{let[p,d,u]=l;return delete a.strokeLineDash,[r.circle(p,d,u,{...a,fill:n==="circle_outline"?i:m,fillStyle:"solid",stroke:m,roughness:Math.min(.5,a.roughness||0)})]}case"triangle":case"triangle_outline":{let[p,d,u,g,h,f]=l;return delete a.strokeLineDash,[r.polygon([[p,d],[u,g],[h,f],[p,d]],{...a,fill:n==="triangle_outline"?i:m,fillStyle:"solid",roughness:Math.min(1,a.roughness||0)})]}case"diamond":case"diamond_outline":{let[p,d,u,g,h,f,w,y]=l;return delete a.strokeLineDash,[r.polygon([[p,d],[u,g],[h,f],[w,y],[p,d]],{...a,fill:n==="diamond_outline"?i:m,fillStyle:"solid",roughness:Math.min(1,a.roughness||0)})]}case"crowfoot_one":return c(l,a);case"bar":case"arrow":case"crowfoot_many":case"crowfoot_one_or_many":default:{let[p,d,u,g,h,f]=l;if(e.strokeStyle==="dotted"){let w=kS(e.strokeWidth-1);a.strokeLineDash=[w[0],w[1]-1]}else delete a.strokeLineDash;return a.roughness=Math.min(1,a.roughness||0),[r.line(u,g,p,d,a),r.line(h,f,p,d,a),...n==="crowfoot_one_or_many"?c(R1(e,t,o,"crowfoot_one"),a):[]]}}};var r$=(e,t,{isExporting:o,canvasBackgroundColor:n,embedsValidationStatus:r,theme:a})=>{let i=a===z1.DARK;switch(e.type){case"rectangle":case"iframe":case"embeddable":case"video":{let s;if(e.roundness){let l=e.width,c=e.height,m=km(Math.min(l,c),e);s=t.path(`M ${m} 0 L ${l-m} 0 Q ${l} 0, ${l} ${m} L ${l} ${c-m} Q ${l} ${c}, ${l-m} ${c} L ${m} ${c} Q 0 ${c}, 0 ${c-m} L 0 ${m} Q 0 0, ${m} 0`,ya(ES(e,o,r),!0,i))}else s=t.rectangle(0,0,e.width,e.height,ya(ES(e,o,r),!1,i));return s}case"diamond":{let s,[l,c,m,p,d,u,g,h]=Vg(e);if(e.roundness){let f=km(Math.abs(l-g),e),w=km(Math.abs(p-c),e);s=t.path(`M ${l+f} ${c+w} L ${m-f} ${p-w}