/**
 * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.
 * Original file: /npm/@excalidraw/excalidraw@0.18.1/dist/prod/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import z5 from"/npm/png-chunks-extract@1.0.0/+esm";import F5 from"/npm/png-chunk-text@1.0.0/+esm";import $5 from"/npm/png-chunks-encode@1.0.0/+esm";import{deflate as H5,inflate as X5}from"/npm/pako@2.0.3/+esm";import Mt from"/npm/open-color@1.9.1/+esm";import{nanoid as Sd}from"/npm/nanoid@3.3.3/+esm";import Kl from"/npm/lodash.throttle@4.1.1/+esm";import W5 from"/npm/es6-promise-pool@2.5.0/+esm";import Jn from"/npm/roughjs@4.6.4/bin/rough/+esm";import{getStroke as G5}from"/npm/perfect-freehand@1.2.0/+esm";import{RoughGenerator as V5}from"/npm/roughjs@4.6.4/bin/generator/+esm";import ee,{useState as se,useRef as re,useEffect as ae,forwardRef as xi,useMemo as mt,useCallback as at,memo as il,useImperativeHandle as eu,useLayoutEffect as Ia,createElement as tu,version as Y5,useContext as Ja,Children as j5,Fragment as Z5,useDeferredValue as K5}from"/npm/react@19.2.5/+esm";import Q from"/npm/clsx@1.1.1/+esm";import{jsxs as M,jsx as h,Fragment as te}from"/npm/react@19.2.5/jsx-runtime/+esm";import{pointsOnBezierCurves as q5,simplify as J5}from"/npm/points-on-curve@1.0.1/+esm";import{sanitizeUrl as Q5}from"/npm/@braintree/sanitize-url@6.0.2/+esm";import{Random as eg}from"/npm/roughjs@4.6.4/bin/math/+esm";import{generateNKeysBetween as tg}from"/npm/fractional-indexing@3.2.0/+esm";import{fileOpen as ag,fileSave as ng,supported as gs}from"/npm/browser-fs-access@0.29.1/+esm";import{createStore as ig,atom as Lt}from"/npm/jotai@2.11.0/+esm";import{createIsolation as au}from"/npm/jotai-scope@0.7.2/+esm";import{flushSync as xn,unstable_batchedUpdates as Md,createPortal as nu}from"/npm/react-dom@19.2.5/+esm";import*as Jt from"/npm/@radix-ui/react-popover@1.1.6/+esm";import lg from"/npm/fuzzy@0.1.3/+esm";import Qa from"/npm/tunnel-rat@0.1.2/+esm";import*as Qn from"/npm/@radix-ui/react-tabs@1.0.2/+esm";import rg from"/npm/lodash.debounce@4.0.8/+esm";import{LaserPointer as sg}from"/npm/@excalidraw/laser-pointer@1.3.1/+esm";var Cd=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};function iu(){throw new Error("setTimeout has not been defined")}function lu(){throw new Error("clearTimeout has not been defined")}var ei=iu,ti=lu;typeof Cd.setTimeout=="function"&&(ei=setTimeout),typeof Cd.clearTimeout=="function"&&(ti=clearTimeout);function ru(e){if(ei===setTimeout)return setTimeout(e,0);if((ei===iu||!ei)&&setTimeout)return ei=setTimeout,setTimeout(e,0);try{return ei(e,0)}catch{try{return ei.call(null,e,0)}catch{return ei.call(this,e,0)}}}function og(e){if(ti===clearTimeout)return clearTimeout(e);if((ti===lu||!ti)&&clearTimeout)return ti=clearTimeout,clearTimeout(e);try{return ti(e)}catch{try{return ti.call(null,e)}catch{return ti.call(this,e)}}}var Sn=[],ll=!1,Si,bs=-1;function dg(){!ll||!Si||(ll=!1,Si.length?Sn=Si.concat(Sn):bs=-1,Sn.length&&su())}function su(){if(!ll){var e=ru(dg);ll=!0;for(var t=Sn.length;t;){for(Si=Sn,Sn=[];++bs<t;)Si&&Si[bs].run();bs=-1,t=Sn.length}Si=null,ll=!1,og(e)}}function cg(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];Sn.push(new ou(e,t)),Sn.length===1&&!ll&&ru(su)}function ou(e,t){this.fun=e,this.array=t}ou.prototype.run=function(){this.fun.apply(null,this.array)};var hg="browser",ug="browser",Ug=!0,fg={},pg=[],mg="",gg={},bg={},yg={};function Mi(){}var vg=Mi,wg=Mi,Eg=Mi,xg=Mi,Sg=Mi,Mg=Mi,Cg=Mi;function kg(e){throw new Error("process.binding is not supported")}function Ig(){return"/"}function Tg(e){throw new Error("process.chdir is not supported")}function Lg(){return 0}var rl=Cd.performance||{},Dg=rl.now||rl.mozNow||rl.msNow||rl.oNow||rl.webkitNow||function(){return new Date().getTime()};function Ag(e){var t=Dg.call(rl)*.001,a=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(a=a-e[0],n=n-e[1],n<0&&(a--,n+=1e9)),[a,n]}var Rg=new Date;function Ng(){var e=new Date,t=e-Rg;return t/1e3}var du={nextTick:cg,title:hg,browser:Ug,env:fg,argv:pg,version:mg,versions:gg,on:vg,addListener:wg,once:Eg,off:xg,removeListener:Sg,removeAllListeners:Mg,emit:Cg,binding:kg,cwd:Ig,chdir:Tg,umask:Lg,hrtime:Ag,platform:ug,release:bg,config:yg,uptime:Ng};typeof Symbol=="function"&&Symbol.toStringTag&&Object.defineProperty(du,Symbol.toStringTag,{value:"process",enumerable:!1,writable:!0,configurable:!1});var me={VITE_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",VITE_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",VITE_APP_LIBRARY_URL:"https://libraries.excalidraw.com",VITE_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",VITE_APP_PLUS_LP:"https://plus.excalidraw.com",VITE_APP_PLUS_APP:"https://app.excalidraw.com",VITE_APP_AI_BACKEND:"https://oss-ai.excalidraw.com",VITE_APP_WS_SERVER_URL:"https://oss-collab.excalidraw.com",VITE_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',VITE_APP_ENABLE_TRACKING:"false",VITE_APP_PLUS_EXPORT_PUBLIC_KEY:`MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApQ0jM9Qz8TdFLzcuAZZX
/WvuKSOJxiw6AR/ZcE3eFQWM/mbFdhQgyK8eHGkKQifKzH1xUZjCxyXcxW6ZO02t
kPOPxhz+nxUrIoWCD/V4NGmUA1lxwHuO21HN1gzKrN3xHg5EGjyouR9vibT9VDGF
gq6+4Ic/kJX+AD2MM7Yre2+FsOdysrmuW2Fu3ahuC1uQE7pOe1j0k7auNP0y1q53
PrB8Ts2LUpepWC1l7zIXFm4ViDULuyWXTEpUcHSsEH8vpd1tckjypxCwkipfZsXx
iPszy0o0Dx2iArPfWMXlFAI9mvyFCyFC3+nSvfyAUb2C4uZgCwAuyFh/ydPF4DEE
PQIDAQAB`,VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX:"false",VITE_APP_COLLAPSE_OVERLAY:"false",VITE_APP_ENABLE_ESLINT:"false",PKG_NAME:"@excalidraw/excalidraw",PKG_VERSION:"0.18.1",PROD:!0},cu=Object.defineProperty,Pg=(e,t,a)=>t in e?cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var _g=e=>t=>{var a=e[t];if(a)return a();throw new Error("Module not found in bundle: "+t)},hu=(e,t)=>{for(var a in t)cu(e,a,{get:t[a],enumerable:!0})},I=(e,t,a)=>(Pg(e,typeof t!="symbol"?t+"":t,a),a),Og=(e,t)=>t.reduce((a,n)=>(n in e&&(a[n]=e[n]),a),{}),Bg=5,sl=5,zg=4,ql=4,Jl=1,Ta=[0,2,4,6,8],La=(e,t)=>t.map(a=>Mt[e][a]),ye={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:La("gray",Ta),red:La("red",Ta),pink:La("pink",Ta),grape:La("grape",Ta),violet:La("violet",Ta),blue:La("blue",Ta),cyan:La("cyan",Ta),teal:La("teal",Ta),green:La("green",Ta),yellow:La("yellow",Ta),orange:La("orange",Ta),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},uu=Og(ye,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Uu=[ye.black,ye.red[ql],ye.green[ql],ye.blue[ql],ye.yellow[ql]],fu=[ye.transparent,ye.red[Jl],ye.green[Jl],ye.blue[Jl],ye.yellow[Jl]],pu=[ye.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Fg={transparent:ye.transparent,white:ye.white,gray:ye.gray,black:ye.black,bronze:ye.bronze,...uu},$g={transparent:ye.transparent,white:ye.white,gray:ye.gray,black:ye.black,bronze:ye.bronze,...uu},Hg=e=>[ye.cyan[e],ye.blue[e],ye.violet[e],ye.grape[e],ye.pink[e],ye.green[e],ye.teal[e],ye.yellow[e],ye.orange[e],ye.red[e]],Xg=(e,t,a)=>`#${((1<<24)+(e<<16)+(t<<8)+a).toString(16).slice(1)}`,en=/Mac|iPod|iPhone|iPad/.test(navigator.platform),mu=/^Win/.test(navigator.platform),Wg=/\b(android)\b/i.test(navigator.userAgent),Ql="netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Gg=navigator.userAgent.indexOf("Chrome")!==-1,Vg=!Gg&&navigator.userAgent.indexOf("Safari")!==-1,gu=/iPad|iPhone/.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Yg=()=>navigator.brave?.isBrave?.name==="isBrave",kd=typeof window<"u"&&"ResizeObserver"in window,Id="Excalidraw",jg=36,Ci=10,ys=8,Zg=5,bu=1,Kg=30,ai=Math.PI/12,yu="red",Pe={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},ni={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},ol={enabled:"all",disabled:"none"},vs={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},Qt={TEST:"test"},dl={SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper"},cl="Xiaolai",er="Segoe UI Emoji",Ke={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9},hl={[cl]:100,[er]:1e3},vu=e=>e===Ke.Excalifont?[cl,er]:[er],Se={LIGHT:"light",DARK:"dark"},qe={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},Td=1,Mn=20,ii=Ke.Excalifont,tr="left",ws="top",ki=2,Es=2*ki,qg=1e-5,Jg=2*Es-qg,xs="#ffffff",Qg="#1e1e1e",e7="#a2f1a6",Ss=20,wu=5,ul={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},ne={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json","excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...ul},t7=[ne.text,ne.html,...Object.values(ul)],Ld={png:"png",svg:"svg",clipboard:"clipboard"},Da={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Dd=window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,a7=500,n7=300,i7=500,l7=100,Ms=.1,Ad=.1,Rd=30,r7=300,Nd="invert(93%) hue-rotate(180deg)",Pd={addLibrary:"addLibrary"},_d={addLibrary:"addLibrary"},Eu={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0}},s7=730,o7=1e3,d7=500,c7=1229,ar=2,Od=[1,2,3],Ul=10,h7=1440,xu=4*1024*1024,Ie="http://www.w3.org/2000/svg",Cs={excalidraw:2,excalidrawLibrary:2},gt=5,u7=.7,U7=11,ca={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},nr={LEFT:"left",CENTER:"center",RIGHT:"right"},f7=20,Bd=.25,p7=32,Ut={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Su={artist:1,cartoonist:2},zd={thin:1,bold:2,extraBold:4},nt={strokeColor:ye.black,backgroundColor:ye.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:Su.artist,opacity:100,locked:!1},ks="library",fl="search",Aa={name:"default",defaultTab:ks},Mu=new Set(["iframe","embeddable","image"]),Et={selection:"selection",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",text:"text",image:"image",eraser:"eraser",frame:"frame",magicframe:"magicframe",laser:"laser"},ir={MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},Cu="Untitled",pl={generalStats:1,elementProperties:2},pa=1,Ct={sharp:"sharp",round:"round",elbow:"elbow"},ku=.3,Is="element",m7=Symbol.for("__test__originalId__"),Iu=(e=>(e.ACTIVE="active",e.AWAY="away",e.IDLE="idle",e))(Iu||{}),g7=Od.includes(devicePixelRatio)?devicePixelRatio:1,tn=()=>({showWelcomeScreen:!1,theme:Se.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:nt.backgroundColor,currentItemEndArrowhead:"arrow",currentItemFillStyle:nt.fillStyle,currentItemFontFamily:ii,currentItemFontSize:Mn,currentItemOpacity:nt.opacity,currentItemRoughness:nt.roughness,currentItemStartArrowhead:null,currentItemStrokeColor:nt.strokeColor,currentItemRoundness:"round",currentItemArrowType:Ct.round,currentItemStrokeStyle:nt.strokeStyle,currentItemStrokeWidth:nt.strokeWidth,currentItemTextAlign:tr,currentHoveredFontFamily:null,cursorButton:"up",activeEmbeddable:null,newElement:null,editingTextElement:null,editingGroupId:null,editingLinearElement:null,activeTool:{type:"selection",customType:null,locked:nt.locked,lastActiveTool:null},penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:g7,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:Ss,gridStep:wu,gridModeEnabled:!1,isBindingEnabled:!0,defaultSidebarDockedPreference:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:null,contextMenu:null,openMenu:null,openPopup:null,openSidebar:null,openDialog:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},hoveredElementIds:{},selectedGroupIds:{},selectedElementsAreBeingDragged:!1,selectionElement:null,shouldCacheIgnoreZoom:!1,stats:{open:!1,panels:pl.generalStats|pl.elementProperties},startBoundElement:null,suggestedBindings:[],frameRendering:{enabled:!0,clip:!0,name:!0,outline:!0},frameToHighlight:null,editingFrame:null,elementsToHighlight:null,toast:null,viewBackgroundColor:ye.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElementId:null,showHyperlinkPopup:!1,selectedLinearElement:null,snapLines:[],originSnapOffset:{x:0,y:0},objectsSnapModeEnabled:!1,userToFollow:null,followedBy:new Set,isCropping:!1,croppingElementId:null,searchMatches:[]}),b7=(e=>e)({showWelcomeScreen:{browser:!0,export:!1,server:!1},theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemRoundness:{browser:!0,export:!1,server:!1},currentItemArrowType:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},currentHoveredFontFamily:{browser:!1,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},activeEmbeddable:{browser:!1,export:!1,server:!1},newElement:{browser:!1,export:!1,server:!1},editingTextElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},activeTool:{browser:!0,export:!1,server:!1},penMode:{browser:!0,export:!1,server:!1},penDetected:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},gridStep:{browser:!0,export:!0,server:!0},gridModeEnabled:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},defaultSidebarDockedPreference:{browser:!0,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},contextMenu:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},openSidebar:{browser:!0,export:!1,server:!1},openDialog:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},hoveredElementIds:{browser:!1,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectedElementsAreBeingDragged:{browser:!1,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},stats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},frameRendering:{browser:!1,export:!1,server:!1},frameToHighlight:{browser:!1,export:!1,server:!1},editingFrame:{browser:!1,export:!1,server:!1},elementsToHighlight:{browser:!1,export:!1,server:!1},toast:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElementId:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1},selectedLinearElement:{browser:!0,export:!1,server:!1},snapLines:{browser:!1,export:!1,server:!1},originSnapOffset:{browser:!1,export:!1,server:!1},objectsSnapModeEnabled:{browser:!0,export:!1,server:!1},userToFollow:{browser:!1,export:!1,server:!1},followedBy:{browser:!1,export:!1,server:!1},isCropping:{browser:!1,export:!1,server:!1},croppingElementId:{browser:!1,export:!1,server:!1},searchMatches:{browser:!1,export:!1,server:!1}}),Tu=(e,t)=>{let a={};for(let n of Object.keys(e))if(b7[n]?.[t]){let i=e[n];a[n]=i}return a},Lu=e=>Tu(e,"export"),y7=e=>Tu(e,"server"),an=({activeTool:e})=>e.type==="eraser",ml=({activeTool:e})=>e.type==="hand",we=(e,t,a)=>Math.min(Math.max(e,t),a),nn=(e,t,a="round")=>{let n=Math.pow(10,t);return Math[a]((e+Number.EPSILON)*n)/n},v7=(e,t,a="round")=>{let n=1/t;return Math[a](e*n)/n},Ts=(e,t)=>(e+t)/2,lr=e=>typeof e=="number"&&Number.isFinite(e),Du=(e,t,a=1e-4)=>Math.abs(e-t)<a,Ls=e=>e<0?e+2*Math.PI:e>=2*Math.PI?e-2*Math.PI:e;function Ii(e){return e*Math.PI/180}function rr(e){return e*180/Math.PI}function w7(e){return Math.abs(Math.sin(2*e))<1e-4}function Dt(e,t,a=0,n=0){return[e-a,t-n]}function ie(e,t=[0,0]){return Dt(e[0]-t[0],e[1]-t[1])}function xt(e,t){return e[0]*t[1]-t[0]*e[1]}function Au(e,t){return e[0]*t[0]+e[1]*t[1]}function li(e,t){return[e[0]+t[0],e[1]+t[1]]}function Ds(e,t){return[e[0]-t[0],e[1]-t[1]]}function it(e,t){return Dt(e[0]*t,e[1]*t)}function E7(e){return e[0]*e[0]+e[1]*e[1]}function x7(e){return Math.sqrt(E7(e))}var Pt=e=>{let t=x7(e);return t===0?Dt(0,0):Dt(e[0]/t,e[1]/t)};function w(e,t){return[e,t]}function Fd(e){return e.length===2?w(e[0],e[1]):void 0}function Ee(e,t=w(0,0)){return w(t[0]+e[0],t[1]+e[1])}function S7(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&!isNaN(e[0])&&typeof e[1]=="number"&&!isNaN(e[1])}function Ra(e,t){let a=Math.abs;return a(e[0]-t[0])<1e-4&&a(e[1]-t[1])<1e-4}function O([e,t],[a,n],i){return w((e-a)*Math.cos(i)-(t-n)*Math.sin(i)+a,(e-a)*Math.sin(i)+(t-n)*Math.cos(i)+n)}function As(e,t=[0,0]){return w(e[0]+t[0],e[1]+t[1])}function sr(e,t){return w((e[0]+t[0])/2,(e[1]+t[1])/2)}function Te(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function or(e,t){let a=t[0]-e[0],n=t[1]-e[1];return a*a+n*n}var Cn=(e,t,a)=>As(t,it(ie(e,t),a)),Ru=(e,t,a)=>t[0]<=Math.max(e[0],a[0])&&t[0]>=Math.min(e[0],a[0])&&t[1]<=Math.max(e[1],a[1])&&t[1]>=Math.min(e[1],a[1]);function $d(e,t){return[e,t]}function M7(e,t){let a=e[1][1]-e[0][1],n=e[0][0]-e[1][0],i=t[1][1]-t[0][1],l=t[0][0]-t[1][0],r=a*l-i*n;if(r!==0){let o=a*e[0][0]+n*e[0][1],d=i*t[0][0]+l*t[0][1];return w((o*l-d*n)/r,(a*d-i*o)/r)}return null}function le(e,t){return[e,t]}var Ti=(e,t,a=1e-4)=>{let n=Hd(e,t);return n===0?!0:n<a},Hd=(e,t)=>{let[a,n]=e,[[i,l],[r,o]]=t,d=a-i,u=n-l,s=r-i,c=o-l,U=d*s+u*c,f=s*s+c*c,p=-1;f!==0&&(p=U/f);let m,g;p<0?(m=i,g=l):p>1?(m=r,g=o):(m=i+p*s,g=l+p*c);let y=a-m,v=n-g;return Math.sqrt(y*y+v*v)};function dr(e,t){let a=M7($d(e[0],e[1]),$d(t[0],t[1]));return!a||!Ti(a,t)||!Ti(a,e)?null:a}function Xd(e,t){return[e,t]}function C7(e,t){return[le(e[0],w(e[1][0],e[0][1])),le(w(e[1][0],e[0][1]),e[1]),le(e[1],w(e[0][0],e[1][1])),le(w(e[0][0],e[1][1]),e[0])].map(a=>dr(t,a)).filter(a=>!!a)}function kn(e,t,a,n){return[e,t,a,n]}function Nu(e,t,a,n=1e-6){return[(e(t+n,a)-e(t-n,a))/(2*n),(e(t,a+n)-e(t,a-n))/(2*n)]}function k7(e,t,a,n=.001,i=10){let l=1/0,r=0;for(;l>=n;){if(r>=i)return null;let o=e(t,a),d=[Nu((m,g)=>e(m,g)[0],t,a),Nu((m,g)=>e(m,g)[1],t,a)],u=[[-o[0]],[-o[1]]],s=d[0][0]*d[1][1]-d[0][1]*d[1][0];if(s===0)return null;let c=[[d[1][1]/s,-d[0][1]/s],[-d[1][0]/s,d[0][0]/s]],U=[[c[0][0]*u[0][0]+c[0][1]*u[1][0]],[c[1][0]*u[0][0]+c[1][1]*u[1][0]]];t=t+U[0][0],a=a+U[1][0];let[f,p]=e(t,a);l=Math.max(Math.abs(f),Math.abs(p)),r+=1}return[t,a]}var cr=(e,t)=>w((1-t)**3*e[0][0]+3*(1-t)**2*t*e[1][0]+3*(1-t)*t**2*e[2][0]+t**3*e[3][0],(1-t)**3*e[0][1]+3*(1-t)**2*t*e[1][1]+3*(1-t)*t**2*e[2][1]+t**3*e[3][1]);function Pu(e,t){let a=T7(e);if(C7(Xd(w(a[0],a[1]),w(a[2],a[3])),t).length===0)return[];let n=o=>w(t[0][0]+o*(t[1][0]-t[0][0]),t[0][1]+o*(t[1][1]-t[0][1])),i=[[.5,0],[.2,0],[.8,0]],l=([o,d])=>{let u=k7((U,f)=>{let p=cr(e,U),m=n(f);return[p[0]-m[0],p[1]-m[1]]},o,d);if(!u)return null;let[s,c]=u;return s<0||s>1||c<0||c>1?null:cr(e,s)},r=l(i[0]);return r?[r]:(r=l(i[1]),r?[r]:(r=l(i[2]),r?[r]:[]))}function I7(e,t,a=.001){let n=(d,u,s,c=a)=>{let U=d,f=u,p;for(;f-U>c;)p=(f+U)/2,s(p-c)<s(p+c)?f=p:U=p;return p},i=0;for(let d=1/0,u=0;u<30;u++){let s=Te(t,cr(e,u/30));s<d&&(d=s,i=u)}let l=Math.max((i-1)/30,0),r=Math.min((i+1)/30,1),o=n(l,r,d=>Te(t,cr(e,d)));return o?cr(e,o):null}function _u(e,t){let a=I7(e,t);return a?Te(t,a):0}function T7(e){let[t,a,n,i]=e,l=[t[0],a[0],n[0],i[0]],r=[t[1],a[1],n[1],i[1]];return[Math.min(...l),Math.min(...r),Math.max(...l),Math.max(...r)]}function Ou(...e){return zu(e)}function Rs(e){return zu(e)}var Bu=(e,t)=>{let a=e[0],n=e[1],i=!1;for(let l=0,r=t.length-1;l<t.length;r=l++){let o=t[l][0],d=t[l][1],u=t[r][0],s=t[r][1];(d>n&&s<=n||d<=n&&s>n)&&a<(u-o)*(n-d)/(s-d)+o&&(i=!i)}return i},L7=(e,t,a=1e-4)=>{let n=!1;for(let i=0,l=t.length-1;i<l;i++)if(Ti(e,le(t[i],t[i+1]),a)){n=!0;break}return n};function zu(e){return D7(e)?e:[...e,e[0]]}function D7(e){return Ra(e[0],e[e.length-1])}function _t(e,t){return ga([e,t])}var Ns=([e,t],[a,n])=>e<=a?t>=a:e>=a?n>=e:!1,Ps=([e,t],[a,n])=>{let i=Math.max(e,a),l=Math.min(t,n);return i<=l?ga([i,l]):null},_s=(e,[t,a])=>e>=t&&e<=a;function gl([e,t,a],n){let i=(s,c,U)=>(s[0]-U[0])*(c[1]-U[1])-(c[0]-U[0])*(s[1]-U[1]),l=i(n,e,t),r=i(n,t,a),o=i(n,a,e),d=l<0||r<0||o<0,u=l>0||r>0||o>0;return!(d&&u)}var Fu=()=>{let e=new Date,t=e.getFullYear(),a=`${e.getMonth()+1}`.padStart(2,"0"),n=`${e.getDate()}`.padStart(2,"0"),i=`${e.getHours()}`.padStart(2,"0"),l=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${a}-${n}-${i}${l}`},hr=e=>e.charAt(0).toUpperCase()+e.slice(1),A7=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),Wd=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,R7=e=>Wd(e)||e instanceof Element&&!!e.closest("label, button"),Li=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"),bl=({fontFamily:e})=>{for(let[t,a]of Object.entries(Ke))if(a===e)return`${t}${vu(a).map(n=>`, ${n}`).join("")}`;return er},Oe=({fontSize:e,fontFamily:t})=>`${e}px ${bl({fontFamily:t})}`,yl=(e,t)=>{let a=0,n=null,i=(...l)=>{n=l,clearTimeout(a),a=window.setTimeout(()=>{n=null,e(...l)},t)};return i.flush=()=>{if(clearTimeout(a),n){let l=n;n=null,e(...l)}},i.cancel=()=>{n=null,clearTimeout(a)},i},Os=(e,t)=>{let a=null,n=null,i=null,l=o=>{a=window.requestAnimationFrame(()=>{a=null,e(...o),n=null,i&&(n=i,i=null,l(n))})},r=(...o)=>{if(me.MODE==="test"){e(...o);return}n=o,a===null?l(n):t?.trailing&&(i=o)};return r.flush=()=>{a!==null&&(cancelAnimationFrame(a),a=null),n&&(e(...i||n),n=i=null)},r.cancel=()=>{n=i=null,a!==null&&(cancelAnimationFrame(a),a=null)},r},Di=e=>1-Math.pow(1-e,4),$u=(e,t,a)=>(t-e)*Di(a)+e,N7=({fromValues:e,toValues:t,onStep:a,duration:n=250,interpolateValue:i,onStart:l,onEnd:r,onCancel:o})=>{let d=!1,u=0,s;function c(U){if(d)return;s===void 0&&(s=U,l?.());let f=Math.min(U-s,n),p=Di(f/n),m={};if(Object.keys(e).forEach(g=>{let y=g,v=(t[y]-e[y])*p+e[y];m[y]=v}),a(m),f<n){let g=f/n,y={};Object.keys(e).forEach(v=>{let b=v,x=e[b],S=t[b],C;C=i?i(x,S,g,b):$u(x,S,g),C==null&&(C=$u(x,S,g)),y[b]=C}),a(y),u=window.requestAnimationFrame(c)}else a(t),r?.()}return u=window.requestAnimationFrame(c),()=>{o?.(),d=!0,window.cancelAnimationFrame(u)}},P7=(e,t)=>{if(!e.length||t<1)return[];let a=0,n=0,i=Array(Math.ceil(e.length/t));for(;a<e.length;)i[n++]=e.slice(a,a+=t);return i},Ot=(e,t)=>Math.abs(e-t),ft=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked},z=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter"),en?e.replace(/\bCtrlOrCmd\b/gi,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/gi,"Ctrl")),$e=({clientX:e,clientY:t},{zoom:a,offsetLeft:n,offsetTop:i,scrollX:l,scrollY:r})=>{let o=(e-n)/a.value-l,d=(t-i)/a.value-r;return{x:o,y:d}},ma=({sceneX:e,sceneY:t},{zoom:a,offsetLeft:n,offsetTop:i,scrollX:l,scrollY:r})=>{let o=(e+l)*a.value+n,d=(t+r)*a.value+i;return{x:o,y:d}},Bs=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),_7="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",O7="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",B7=new RegExp(`^[^${_7}]*[${O7}]`),Hu=e=>B7.test(e),Na=e=>{let[t,a]=e;return{x:t,y:a}},Xu=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},Wu=(e,t,a=0)=>{a<0&&(a=e.length+a),a=Math.min(e.length,Math.max(a,0));let n=a-1;for(;++n<e.length;)if(t(e[n],n,e))return n;return-1},Ai=(e,t,a=e.length-1)=>{a<0&&(a=e.length+a),a=Math.min(e.length-1,Math.max(a,0));let n=a+1;for(;--n>-1;)if(t(e[n],n,e))return n;return-1},Pa=e=>{let t=e.length===5&&e.substr(4,1)==="0",a=e.length===9&&e.substr(7,2)==="00";return t||a||e===ye.transparent},Gd=e=>e.fillStyle!=="solid"||Pa(e.backgroundColor),Gu=()=>{let e,t,a=new Promise((n,i)=>{e=n,t=i});return a.resolve=e,a.reject=t,a},z7=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:a}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(a==="auto"||a==="scroll"||a==="overlay"))return t;t=t.parentElement}return document},F7=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},$7=e=>{e.preventDefault(),e.returnValue=""},H7=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),vl=()=>Tn()?1:Date.now(),oe=e=>e instanceof Map?e:e.reduce((t,a)=>(t.set(typeof a=="string"?a:a.id,a),t),new Map),X7=e=>e.reduce((t,a,n)=>(t.set(a.id,[a,n]),t),new Map),In=(e,t)=>e.reduce((a,n)=>(a[t?t(n):String(n)]=n,a),{}),W7=e=>e.reduce((t,a,n)=>{let i={...a,prev:null,next:null};if(n!==0){let l=t[n-1];if(i.prev=l,l.next=i,n===e.length-1){let r=t[0];i.next=r,r.prev=i}}return t.push(i),t},[]),Tn=()=>me.MODE==="test",Vu=()=>me.MODE==="development",G7=()=>typeof du<"u"&&!0,Yu=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),zs=(e,t)=>{let a=!1;for(let n in t){let i=t[n];if(typeof i<"u"){if(e[n]===i&&(typeof i!="object"||i===null))continue;a=!0}}return a?{...e,...t}:e},V7=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},ur=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,Vd=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(a=>a.tabIndex>-1&&!a.disabled):[]},ju=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,At=(e,t,a,n=!1)=>{let i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return n&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(a&&Array.isArray(a)){for(let r of a)if(!(e[r]===t[r]||ju(e[r],t[r])))return n&&console.warn(`%cisShallowEqual: ${r} not equal ->`,"color: #8B4000",e[r],t[r]),!1;return!0}return i.every(r=>{let o=a?.[r],d=o?o(e[r],t[r]):e[r]===t[r]||ju(e[r],t[r]);return!d&&n&&console.warn(`%cisShallowEqual: ${r} not equal ->`,"color: #8B4000",e[r],t[r]),d})},Fs=(e,t,{checkForDefaultPrevented:a=!0}={})=>function(n){if(e?.(n),!a||!n?.defaultPrevented)return t?.(n)},Ri=(e,t,a)=>{if(!t)return e;if(a)return console.error(t),e;throw new Error(t)};function Bt(e,t){if(!e)throw new Error(t)}var Y7=e=>{let t,a,n=function(i){let l=Object.entries(i);if(t){let o=!0;for(let[d,u]of l)if(t.get(d)!==u){o=!1;break}if(o)return a}let r=e(i);return t=new Map(l),a=r,r};return n.clear=()=>{t=void 0,a=void 0},n},Zu=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Ln=e=>JSON.parse(JSON.stringify(e)),Ur=(e,t)=>At(e,t)?e:t;function Je(e,t,a,n){return e?(e?.addEventListener?.(t,a,n),()=>{e?.removeEventListener?.(t,a,n)}):()=>{}}function j7(e,t=!0){let a=e.length;if(a<4)return"";let n=e[0],i=e[1],l=e[2],r=`M${n[0].toFixed(2)},${n[1].toFixed(2)} Q${i[0].toFixed(2)},${i[1].toFixed(2)} ${Ts(i[0],l[0]).toFixed(2)},${Ts(i[1],l[1]).toFixed(2)} T`;for(let o=2,d=a-1;o<d;o++)n=e[o],i=e[o+1],r+=`${Ts(n[0],i[0]).toFixed(2)},${Ts(n[1],i[1]).toFixed(2)} `;return t&&(r+="Z"),r}var Ku=e=>e.replace(/\r?\n|\r/g,`
`),ga=e=>e,ri=async(e,...t)=>new Promise(a=>{a(e(...t))}),Z7=(...e)=>Math.max(...e.map(t=>t?1:0))>0,qu=class{constructor(e,t){I(this,"pool"),I(this,"entries",{}),this.pool=new W5(e,t)}all(){let e=t=>{if(t.data.result){let[a,n]=t.data.result;this.entries[a]=n}};return this.pool.addEventListener("fulfilled",e),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",e)}),Object.values(this.entries)))}},$s=e=>e.replace(/"/g,"&quot;"),Ju=e=>Array.isArray(e)?e:[e],ba=e=>!!e&&e.type==="image"&&!!e.fileId,Le=e=>!!e&&e.type==="image",ea=e=>!!e&&e.type==="embeddable",si=e=>!!e&&e.type==="iframe",ya=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),j=e=>e!=null&&e.type==="text",Qu=e=>e!=null&&e.type==="frame",Hs=e=>e!=null&&e.type==="magicframe",de=e=>e!=null&&(e.type==="frame"||e.type==="magicframe"),va=e=>e!=null&&K7(e.type),K7=e=>e==="freedraw",he=e=>e!=null&&Yd(e.type),ge=e=>e!=null&&e.type==="arrow",q=e=>ge(e)&&e.elbowed,Yd=e=>e==="arrow"||e==="line",ln=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&eU(e.type),eU=e=>e==="arrow",_a=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),q7=e=>e!=null&&(e.type==="rectangle"||e.type==="diamond"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),Ni=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||ge(e)),tU=e=>{let t=e?.type;if(!t)return!1;switch(t){case"text":case"diamond":case"rectangle":case"iframe":case"embeddable":case"ellipse":case"arrow":case"freedraw":case"line":case"frame":case"magicframe":case"image":case"selection":return!0;default:return Ri(t,null),!1}},Xs=e=>e.type==="rectangle"||e.type==="ellipse"||e.type==="diamond",wa=e=>Ni(e)&&!!e.boundElements?.some(({type:t})=>t==="text"),Ye=e=>e!==null&&"containerId"in e&&e.containerId!==null&&j(e),wl=e=>e==="rectangle"||e==="embeddable"||e==="iframe"||e==="image",aU=e=>e==="line"||e==="arrow"||e==="diamond",J7=(e,t)=>!!((e===Ut.ADAPTIVE_RADIUS||e===Ut.LEGACY)&&wl(t.type)||e===Ut.PROPORTIONAL_RADIUS&&aU(t.type)),Q7=e=>aU(e.type)?{type:Ut.PROPORTIONAL_RADIUS}:wl(e.type)?{type:Ut.ADAPTIVE_RADIUS}:null,Ws=e=>Object.hasOwn(e,"fixedPoint")&&e.fixedPoint!=null,zt=(e,t,a)=>{let n=e.split(`
`).map(r=>r||" ").join(`
`),i=parseFloat(t),l=i8(n,i,a);return{width:Kd(n,t),height:l}},nU="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),iU=(e,t)=>{let a=l8(e);return a===0?zt(nU.split("").join(`
`),e,t).width+gt*2:a+gt*2},jd=(e,t)=>zt("",e,t).width+gt*2,e8=()=>Kd(nU,Oe({fontSize:Mn,fontFamily:ii}))>0,El=e=>Ku(e).replace(/\t/g,"        "),Zd=e=>El(e).split(`
`),t8=e=>{let t=Zd(e.text).length;return e.height/t/e.fontSize},fr=(e,t)=>e*t,lU=(e,t)=>fr(e,t)+gt*2,Gs,a8=e=>{Gs=e},n8=class{constructor(){I(this,"canvas"),this.canvas=document.createElement("canvas")}getLineWidth(e,t){let a=this.canvas.getContext("2d");a.font=t;let n=a.measureText(e).width;return Tn()?n*10:n}},Pi=(e,t)=>(Gs||(Gs=new n8),Gs.getLineWidth(e,t)),Kd=(e,t)=>{let a=Zd(e),n=0;return a.forEach(i=>{n=Math.max(n,Pi(i,t))}),n},i8=(e,t,a)=>{let n=Zd(e).length;return fr(t,a)*n},pr=(()=>{let e={};return{calculate:(t,a)=>{let n=t.charCodeAt(0);if(e[a]||(e[a]=[]),!e[a][n]){let i=Pi(t,a);e[a][n]=i}return e[a][n]},getCache:t=>e[t],clearCache:t=>{e[t]=[]}}})(),l8=e=>{let t=pr.getCache(e);if(!t)return 0;let a=t.filter(n=>n!==void 0);return Math.max(...a)},qd,Vs,Jd,r8=e=>(qd||(qd=Ne.class(...Object.values(Dn))),qd.test(e)),s8=()=>{if(!Vs)try{Vs=d8()}catch{Vs=o8()}return Vs},Qd=()=>(Jd||(Jd=c8()),Jd),Ea={WHITESPACE:/\s/u,HYPHEN:/-/u,OPENING:/<\(\[\{/u,CLOSING:/>\)\]\}.,:;!\?…\//u},Dn={CHAR:/\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}｀＇＾〃〰〆＃＆＊＋－ー／＼＝｜￤〒￢￣/u,OPENING:/（［｛〈《｟｢「『【〖〔〘〚＜〝/u,CLOSING:/）］｝〉》｠｣」』】〗〕〙〛＞。．，、〟‥？！：；・〜〞/u,CURRENCY:/￥￦￡￠＄/u},_i={FLAG:/\p{RI}\p{RI}/u,JOINER:/(?:\p{Emoji_Modifier}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?/u,ZWJ:/\u200D/u,ANY:/[\p{Emoji}]/u,MOST:/[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u},o8=()=>Ne.or(Qd(),dt.On(Ea.HYPHEN,Ea.WHITESPACE,Dn.CHAR)),d8=()=>Ne.or(Qd(),dt.Before(Ea.WHITESPACE).Build(),dt.After(Ea.WHITESPACE,Ea.HYPHEN).Build(),dt.Before(Dn.CHAR,Dn.CURRENCY).NotPrecededBy(Ea.OPENING,Dn.OPENING).Build(),dt.After(Dn.CHAR).NotFollowedBy(Ea.HYPHEN,Ea.CLOSING,Dn.CLOSING).Build(),dt.BeforeMany(Dn.OPENING).NotPrecededBy(Ea.OPENING).Build(),dt.AfterMany(Dn.CLOSING).NotFollowedBy(Ea.CLOSING).Build(),dt.AfterMany(Ea.CLOSING).FollowedBy(Ea.OPENING).Build()),c8=()=>Ne.group(Ne.or(_i.FLAG,Ne.and(_i.MOST,_i.JOINER,Ne.build(`(?:${_i.ZWJ.source}(?:${_i.FLAG.source}|${_i.ANY.source}${_i.JOINER.source}))*`)))),Ne={build:e=>new RegExp(e,"u"),join:(...e)=>e.map(t=>t.source).join(""),and:(...e)=>Ne.build(Ne.join(...e)),or:(...e)=>Ne.build(e.map(t=>t.source).join("|")),group:(...e)=>Ne.build(`(${Ne.join(...e)})`),class:(...e)=>Ne.build(`[${Ne.join(...e)}]`)},dt={On:(...e)=>{let t=Ne.join(...e);return Ne.build(`([${t}])`)},Before:(...e)=>{let t=Ne.join(...e),a=()=>Ne.build(`(?=[${t}])`);return dt.Chain(a)},After:(...e)=>{let t=Ne.join(...e),a=()=>Ne.build(`(?<=[${t}])`);return dt.Chain(a)},BeforeMany:(...e)=>{let t=Ne.join(...e),a=()=>Ne.build(`(?<![${t}])(?=[${t}])`);return dt.Chain(a)},AfterMany:(...e)=>{let t=Ne.join(...e),a=()=>Ne.build(`(?<=[${t}])(?![${t}])`);return dt.Chain(a)},NotBefore:(...e)=>{let t=Ne.join(...e),a=()=>Ne.build(`(?![${t}])`);return dt.Chain(a)},NotAfter:(...e)=>{let t=Ne.join(...e),a=()=>Ne.build(`(?<![${t}])`);return dt.Chain(a)},Chain:e=>({Build:e,PreceededBy:(...t)=>{let a=e(),n=dt.After(...t).Build(),i=()=>Ne.and(n,a);return dt.Chain(i)},FollowedBy:(...t)=>{let a=e(),n=dt.Before(...t).Build(),i=()=>Ne.and(a,n);return dt.Chain(i)},NotPrecededBy:(...t)=>{let a=e(),n=dt.NotAfter(...t).Build(),i=()=>Ne.and(n,a);return dt.Chain(i)},NotFollowedBy:(...t)=>{let a=e(),n=dt.NotBefore(...t).Build(),i=()=>Ne.and(a,n);return dt.Chain(i)}})},h8=e=>{let t=s8();return e.normalize("NFC").split(t).filter(Boolean)},Oi=(e,t,a)=>{if(!Number.isFinite(a)||a<0)return e;let n=[],i=e.split(`
`);for(let l of i){if(Pi(l,t)<=a){n.push(l);continue}let r=u8(l,t,a);n.push(...r)}return n.join(`
`)},u8=(e,t,a)=>{let n=[],i=h8(e)[Symbol.iterator](),l="",r=0,o=i.next();for(;!o.done;){let d=o.value,u=l+d,s=p8(d)?r+pr.calculate(d,t):Pi(u,t);if(/\s/.test(d)||s<=a){l=u,r=s,o=i.next();continue}if(l)n.push(l.trimEnd()),l="",r=0;else{let c=U8(d,t,a),U=c[c.length-1]??"",f=c.slice(0,-1);n.push(...f),l=U,r=Pi(U,t),o=i.next()}}if(l){let d=f8(l,t,a);n.push(d)}return n},U8=(e,t,a)=>{if(Qd().test(e))return[e];m8(e);let n=[],i=Array.from(e),l="",r=0;for(let o of i){let d=pr.calculate(o,t),u=r+d;if(u<=a){l=l+o,r=u;continue}l&&n.push(l),l=o,r=d}return l&&n.push(l),n},f8=(e,t,a)=>{if(!(Pi(e,t)>a))return e;let[,n,i]=e.match(/^(.+?)(\s+)$/)??[e,e.trimEnd(),""],l=Pi(n,t);for(let r of Array.from(i)){let o=pr.calculate(r,t),d=l+o;if(d>a)break;n=n+r,l=d}return n},p8=e=>e.codePointAt(0)!==void 0&&e.codePointAt(1)===void 0,m8=e=>{if((me.MODE===Qt.TEST||me.DEV)&&/\s/.test(e))throw new Error("Word should not contain any whitespaces!")},Ht=class{};I(Ht,"rg",new V5),I(Ht,"cache",new WeakMap),I(Ht,"get",e=>Ht.cache.get(e)),I(Ht,"set",(e,t)=>Ht.cache.set(e,t)),I(Ht,"delete",e=>Ht.cache.delete(e)),I(Ht,"destroy",()=>{Ht.cache=new WeakMap}),I(Ht,"generateElementShape",(e,t)=>{let a=t?.isExporting?void 0:Ht.get(e);if(a!==void 0)return a;xc.delete(e);let n=Mw(e,Ht.rg,t||{isExporting:!1,canvasBackgroundColor:ye.white,embedsValidationStatus:null});return Ht.cache.set(e,n),n});var Qe=Ht,Oa=e=>"var(--icon-fill-color)",rU=e=>e===Se.LIGHT?Mt.white:"#1e1e1e",N=(e,t=512)=>{let{width:a=512,height:n=a,mirror:i,style:l,...r}=typeof t=="number"?{width:t}:t;return h("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${a} ${n}`,className:Q({"rtl-mirror":i}),style:l,...r,children:typeof e=="string"?h("path",{fill:"currentColor",d:e}):e})},Y={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},ue={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("rect",{x:3,y:8,width:18,height:4,rx:1}),h("line",{x1:12,y1:8,x2:12,y2:21}),h("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),h("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"})]}),Y);var ec=N(M("g",{strokeWidth:"1.25",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),h("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),h("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),h("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),h("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),Y),g8=N(M("svg",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),h("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),Y),b8=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("circle",{cx:"12",cy:"12",r:"1"}),h("circle",{cx:"12",cy:"19",r:"1"}),h("circle",{cx:"12",cy:"5",r:"1"})]}),Y),y8=N(M("svg",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),h("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),h("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),Y),Ys=N(M("g",{children:[h("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"}),h("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"}),h("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:h("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"})}),h("g",{mask:"url(#UnlockedIcon)",children:h("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"})})]}),ue),tc=N(M("g",{strokeWidth:"1.25",children:[h("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"}),h("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),h("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"})]}),ue),v8=N(M(te,{children:[h("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"}),h("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),h("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"}),w8=N(M(te,{children:[h("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"}),h("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),h("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"}),E8=N(M(te,{children:[h("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"}),h("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),h("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"});N(h("g",{fill:"currentColor",children:h("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"});var x8=N(M("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),S8=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),Y),M8=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"})]}),Y),C8=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("circle",{cx:"12",cy:"12",r:"9"})]}),Y),k8=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),h("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),h("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),Y),I8=N(h("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),ue),T8=N(M("g",{strokeWidth:"1.25",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),h("path",{d:"M16 7h4"}),h("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),Y),mr=N(M("g",{strokeWidth:"1.25",children:[h("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"}),h("path",{d:"m11.25 5.417 3.333 3.333"})]}),ue),sU=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),h("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),h("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),h("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),h("polyline",{points:"5 20 11 4 13 4 20 20"})]}),Y),L8=N(M("g",{strokeWidth:"1.25",children:[h("path",{d:"M12.5 6.667h.01"}),h("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"}),h("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),h("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),ue),D8=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M18 13.3l-6.3 -6.3"})]}),Y),oU=N(h("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),ue),dU=N(h("path",{d:"M5 10h10",strokeWidth:"1.25"}),ue),A8=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M21 21l-6 -6"}),h("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"}),h("path",{d:"M3 4v4h4"})]}),Y),Bi=N(h("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"}),ue),R8=N(M("g",{strokeWidth:"1.25",children:[h("polyline",{points:"12 16 18 10 12 4"}),h("polyline",{points:"8 4 2 10 8 16"})]}),ue),ac=N(M("g",{strokeWidth:"1.25",children:[h("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"}),h("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"})]}),ue),nc=N(h("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"}),ue),ic=N(h("g",{stroke:"currentColor",strokeLinejoin:"round",children:h("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"})}),{...ue,strokeWidth:1.5}),cU=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),h("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),h("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),Y),js=N(h("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"}),ue),lc=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("circle",{cx:"12",cy:"12",r:"9"}),h("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),h("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Y),N8=N(M("g",{strokeWidth:"1.25",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("circle",{cx:"12",cy:"12",r:"9"}),h("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),h("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Y),hU=N(h("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"}),ue),uU=N(h("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"}),ue),P8=N(M("g",{strokeWidth:"1.25",children:[h("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"}),h("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"})]}),ue),_8=N(M("g",{strokeWidth:"1.25",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),h("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),Y),O8=N(h("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),rc=N(M("g",{strokeWidth:"1.25",children:[h("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"}),h("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"})]}),ue),B8=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}),z8=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}),sc=N(h("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"}),ue);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});var F8=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"),oc=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),h("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"}),h("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"})]}),Y),UU=N(M("g",{strokeWidth:"1.25",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M15 8h.01"}),h("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),h("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),h("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),h("path",{d:"M19 16v6"}),h("path",{d:"M22 19l-3 3l-3 -3"})]}),Y),$8=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});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}),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});var H8=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");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");var fU=N(h("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"}),ue),pU=N(h("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"}),ue),X8=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}),W8=N(h("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"}),ue);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"),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}),N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M12 14v-11"}),h("path",{d:"M9 6l3 -3l3 3"})]}),Y),N(M(te,{children:[h("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"}),h("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}),N(h("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024});var mU=M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 10l0 10"}),h("path",{d:"M12 10l4 4"}),h("path",{d:"M12 10l-4 4"}),h("path",{d:"M4 4l16 0"})]}),gU=M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 5l0 14"}),h("path",{d:"M16 9l-4 -4"}),h("path",{d:"M8 9l4 -4"})]}),bU=N(gU,Y),yU=N(gU,{...Y,style:{transform:"rotate(180deg)"}}),vU=N(mU,Y),wU=N(mU,{...Y,style:{transform:"rotate(180deg)"}}),EU=N(M(te,{children:[M("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),xU=N(M(te,{children:[M("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),SU=N(M(te,{children:[M("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),MU=N(M(te,{children:[M("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),G8=N(M(te,{children:[M("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),V8=N(M(te,{children:[M("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h("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"})]}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),CU=N(M("g",{stroke:"currentColor",strokeWidth:"1.25",children:[h("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),h("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),h("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),h("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"})]}),ue),kU=N(M("g",{stroke:"currentColor",strokeWidth:"1.25",children:[h("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),h("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),h("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),h("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"})]}),ue),IU=N(M("g",{strokeWidth:"1.5",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("circle",{cx:"9",cy:"7",r:"4"}),h("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),h("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),h("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),Y);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"),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");var xl=N(M(te,{children:[h("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:h("path",{d:"M15 5 5 15M5 5l10 10"})}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue);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}),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}),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});var TU=ee.memo(({theme:e})=>N(M(te,{children:[h("path",{d:"M25 26H111V111H25",fill:Oa()}),h("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:Oa(),strokeWidth:"2"}),h("path",{d:"M100 100H160V160H100",fill:Oa()}),h("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:Oa(),strokeWidth:"2"}),M("g",{fill:rU(e),stroke:Oa(),strokeWidth:"6",children:[h("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),h("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),h("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),h("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),LU=ee.memo(({theme:e})=>N(M(te,{children:[h("path",{d:"M25 26H111V111H25",fill:Oa()}),h("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:Oa(),strokeWidth:"2"}),h("path",{d:"M100 100H160V160H100",fill:Oa()}),h("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:Oa(),strokeWidth:"2"}),M("g",{fill:rU(e),stroke:Oa(),strokeWidth:"6",children:[h("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),h("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),h("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),h("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),h("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),h("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),Y8=N(h("g",{strokeWidth:1.25,children:h("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"})}),ue),j8=N(M(te,{children:[h("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"}),h("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:h("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"})}),h("g",{mask:"url(#FillHachureIcon)",children:h("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"})})]}),ue),Z8=N(M(te,{children:[M("g",{clipPath:"url(#a)",children:[h("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"}),h("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:h("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"})}),h("g",{mask:"url(#FillCrossHatchIcon)",children:h("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"})})]}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),K8=N(M(te,{children:[h("g",{clipPath:"url(#a)",children:h("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"})}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...ue,fill:"currentColor"}),DU=N(h(te,{children:h("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ue),q8=N(h("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),ue),J8=N(h("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),ue);ee.memo(({theme:e})=>N(h("path",{d:"M6 10H34",stroke:Oa(),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20}));var Q8=N(M("g",{strokeWidth:"2",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M5 12h2"}),h("path",{d:"M17 12h2"}),h("path",{d:"M11 12h2"})]}),Y),e3=N(M("g",{strokeWidth:"2",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 12v.01"}),h("path",{d:"M8 12v.01"}),h("path",{d:"M12 12v.01"}),h("path",{d:"M16 12v.01"}),h("path",{d:"M20 12v.01"})]}),Y),t3=N(h("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"}),ue),a3=N(h("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"}),ue),n3=N(h("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"}),ue),i3=N(M("svg",{strokeWidth:"1.5",children:[h("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"}),h("path",{d:"M13.3333 3.33331V3.34331"}),h("path",{d:"M16.6667 3.33331V3.34331"}),h("path",{d:"M16.6667 6.66669V6.67669"}),h("path",{d:"M16.6667 10V10.01"}),h("path",{d:"M3.33334 13.3333V13.3433"}),h("path",{d:"M16.6667 13.3333V13.3433"}),h("path",{d:"M3.33334 16.6667V16.6767"}),h("path",{d:"M6.66666 16.6667V16.6767"}),h("path",{d:"M10 16.6667V16.6767"}),h("path",{d:"M13.3333 16.6667V16.6767"}),h("path",{d:"M16.6667 16.6667V16.6767"})]}),ue),l3=N(M("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),h("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),h("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),h("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),h("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),h("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),h("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),h("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),h("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),h("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),h("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),h("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),Y),r3=N(M("g",{stroke:"currentColor",opacity:.3,strokeWidth:2,children:[h("path",{d:"M12 12l9 0"}),h("path",{d:"M3 9l6 6"}),h("path",{d:"M3 15l6 -6"})]}),Y),s3=ee.memo(({flip:e=!1})=>N(M("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[h("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),h("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),o3=ee.memo(({flip:e=!1})=>N(M("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[h("path",{d:"M32 10L6 10",strokeWidth:2}),h("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),d3=ee.memo(({flip:e=!1})=>N(M("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[h("path",{d:"M26 10L6 10"}),h("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),c3=ee.memo(({flip:e=!1})=>N(h("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:h("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),h3=ee.memo(({flip:e=!1})=>N(M("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[h("path",{d:"M32 10L6 10",strokeWidth:2}),h("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),u3=ee.memo(({flip:e=!1})=>N(M("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[h("path",{d:"M6,9.5H27"}),h("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),U3=ee.memo(({flip:e=!1})=>N(M("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[h("path",{d:"M6,9.5H20"}),h("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),f3=ee.memo(({flip:e=!1})=>N(M("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[h("path",{d:"M6,9.5H20"}),h("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),p3=ee.memo(({flip:e=!1})=>N(h("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:h("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),m3=ee.memo(({flip:e=!1})=>N(h("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:h("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),g3=ee.memo(({flip:e=!1})=>N(h("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:h("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),b3=N(M(te,{children:[h("g",{clipPath:"url(#a)",children:h("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"})}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),y3=N(M(te,{children:[h("g",{clipPath:"url(#a)",children:h("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),v3=N(M(te,{children:[h("g",{clipPath:"url(#a)",children:h("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),w3=N(h(te,{children:h("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"})}),ue),Zs=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 7v-2h13v2"}),h("path",{d:"M10 5v14"}),h("path",{d:"M12 19h-4"}),h("path",{d:"M15 13v-1h6v1"}),h("path",{d:"M18 12v7"}),h("path",{d:"M17 19h2"})]}),Y),E3=N(h(te,{children:M("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7 12h10"}),h("path",{d:"M7 5v14"}),h("path",{d:"M17 5v14"}),h("path",{d:"M15 19h4"}),h("path",{d:"M15 5h4"}),h("path",{d:"M5 19h4"}),h("path",{d:"M5 5h4"})]})}),Y),Ks=N(h(te,{children:h("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:h("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"})})}),ue),dc=N(M(te,{children:[h("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:h("path",{d:"M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667"})}),h("defs",{children:h("clipPath",{id:"a",children:h("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ue),x3=N(M("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),h("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),h("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),Y),S3=N(M("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),h("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),h("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),Y),M3=N(M("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),h("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),h("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),Y),C3=ee.memo(({theme:e})=>N(M("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),h("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),Y)),k3=ee.memo(({theme:e})=>N(M("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),h("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),Y)),I3=ee.memo(({theme:e})=>N(M("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),h("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),h("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),Y)),AU=N(M("g",{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M21 19h-18l9 -15"}),h("path",{d:"M20.615 15.171h.015"}),h("path",{d:"M19.515 11.771h.015"}),h("path",{d:"M17.715 8.671h.015"}),h("path",{d:"M15.415 5.971h.015"})]}),Y),T3=N(h("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});N(h("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"}));var RU=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),h("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),h("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),h("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"})]}),Y),NU=N(M(te,{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),h("path",{d:"M7 11l5 5l5 -5"}),h("path",{d:"M12 4l0 12"})]}),Y),cc=N(M(te,{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),Y),L3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),h("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),h("path",{d:"M9.15 14.85l8.85 -10.85"}),h("path",{d:"M6 4l8.85 10.85"})]}),Y),D3=N(M(te,{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),h("path",{d:"M12 17l0 .01"}),h("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Y);N(M(te,{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M7 4v16l13 -8z"})]}),Y),N(M(te,{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"})]}),Y);var A3=N(M(te,{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M5 12l5 5l10 -10"})]}),Y),R3=N(M(te,{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M12 9v4"}),h("path",{d:"M12 17h.01"})]}),Y),N3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M11 7l6 6"}),h("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"})]}),Y),P3=N(M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 3l-4 7h8z"}),h("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),h("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"})]}),Y),PU=N(M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 7l16 0"}),h("path",{d:"M4 17l16 0"}),h("path",{d:"M7 4l0 16"}),h("path",{d:"M17 4l0 16"})]}),Y),_U=N(h("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"})),qs=N(M("g",{strokeWidth:"1.25",children:[h("path",{d:"M4.16602 10H15.8327"}),h("path",{d:"M12.5 13.3333L15.8333 10"}),h("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),ue),OU=N(M("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[h("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"}),h("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),BU=N(M("g",{stroke:"currentColor",fill:"none",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z"}),h("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),h("path",{d:"M15 6l3 3"}),h("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"}),h("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"})]}),Y);N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z"}),h("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),h("path",{d:"M15 6l3 3"}),h("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"}),h("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"})]}),Y),N(M("g",{stroke:"currentColor",fill:"none",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),h("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),h("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"}),h("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),h("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),h("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"})]}),Y);var _3=N(M("g",{stroke:"currentColor",fill:"none",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),h("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),h("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),h("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),Y),hc=N(M("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),h("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"})]}),Y),O3=N(M("g",{stroke:"currentColor",fill:"none",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),h("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"}),h("path",{d:"M3 3l18 18"})]}),Y),B3=N(M("g",{stroke:"currentColor",fill:"none",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("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"}),h("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),h("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),h("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),h("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),Y),z3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("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"}),h("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),h("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),h("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),h("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),Y),zi=N(M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),h("path",{d:"M21 21l-6 -6"})]}),Y),F3=N(M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),h("path",{d:"M12 7v5l3 3"}),h("path",{d:"M19 16l-2 3h4l-2 3"})]}),Y),$3=N(M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M5 10a7 7 0 0 0 14 0"}),h("path",{d:"M8 21l8 0"}),h("path",{d:"M12 17l0 4"})]}),Y),H3=N(M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 3l18 18"}),h("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"}),h("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),h("path",{d:"M8 21l8 0"}),h("path",{d:"M12 17l0 4"})]}),Y),zU=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),Y),X3=N(M("g",{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M12 20v.01"}),h("path",{d:"M16 20v.01"}),h("path",{d:"M8 20v.01"}),h("path",{d:"M4 20v.01"}),h("path",{d:"M4 16v.01"}),h("path",{d:"M4 12v.01"}),h("path",{d:"M4 8v.01"}),h("path",{d:"M4 4v.01"}),h("path",{d:"M8 4v.01"}),h("path",{d:"M12 4v.01"}),h("path",{d:"M16 4v.01"}),h("path",{d:"M20 4v.01"}),h("path",{d:"M20 8v.01"}),h("path",{d:"M20 12v.01"}),h("path",{d:"M20 16v.01"}),h("path",{d:"M20 20v.01"})]}),Y),W3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M5 3v18"}),h("path",{d:"M19 21v-18"}),h("path",{d:"M5 7h14"}),h("path",{d:"M5 15h14"}),h("path",{d:"M8 13v4"}),h("path",{d:"M11 13v4"}),h("path",{d:"M16 13v4"}),h("path",{d:"M14 5v4"}),h("path",{d:"M11 5v4"}),h("path",{d:"M8 5v4"}),h("path",{d:"M3 21h18"})]}),Y),G3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 12l18 0"}),h("path",{d:"M7 16l10 0l-10 5l0 -5"}),h("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),Y),V3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M12 3l0 18"}),h("path",{d:"M16 7l0 10l5 0l-5 -10"}),h("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),Y),FU=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),h("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"})]}),Y),uc=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),h("path",{d:"M22 22l-3 -3"}),h("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),h("path",{d:"M3 11v-1"}),h("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),h("path",{d:"M10 3h1"}),h("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),Y),Y3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),h("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),h("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"}),h("path",{d:"M10 15l2 6l2 -6"}),h("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),Y),j3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),h("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),h("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),h("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),h("path",{d:"M11 21v-6l3 6v-6"})]}),Y),Z3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M4 8l5 0"}),h("path",{d:"M15 8l4 0"})]}),Y),K3=N(M("g",{strokeWidth:1.25,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),h("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),h("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),h("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),Y),q3=N(M("g",{stroke:"currentColor",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"})]}),{...Y,strokeWidth:1.5});N(M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M21 12h-13l3 -3"}),h("path",{d:"M11 15l-3 -3"})]}),Y);var J3=N(M("g",{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("path",{d:"M10 9l5 3l-5 3z"})]}),Y),Q3=N(M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M3 6h18"}),h("path",{d:"M3 12h18"}),h("path",{d:"M3 18h18"}),h("path",{d:"M6 3v18"}),h("path",{d:"M12 3v18"}),h("path",{d:"M18 3v18"})]}),Y),eb=N(M("g",{strokeWidth:1.5,children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("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"}),h("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"}),h("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),Y),tb=N(M("g",{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6 18l12 -12"}),h("path",{d:"M18 10v-4h-4"})]}),Y),ab=N(M("g",{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),h("path",{d:"M18 4l3 3l-3 3"})]}),Y),nb=N(M("g",{children:[h("path",{d:"M16,12L20,9L16,6"}),h("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),Y),$U=N(M("g",{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6 9l6 6l6 -6"})]}),Y),ib=N(M("g",{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6 15l6 -6l6 6"})]}),Y),lb=N(M("g",{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M6 15l6 -6l6 6"})]}),Y),HU=N(M("g",{strokeWidth:"1.25",children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),h("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),Y),XU=N(M("g",{children:[h("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h("path",{d:"M5 7l0 10"}),h("path",{d:"M7 5l10 0"}),h("path",{d:"M7 19l10 0"}),h("path",{d:"M19 7l0 10"})]}),Y),Js={[Ke.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:mr},[Ke.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.35},icon:Ks},[Ke["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15},icon:E3},[Ke["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25},icon:dc},[Ke.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:mr,deprecated:!0},[Ke.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},icon:Ks,deprecated:!0,local:!0},[Ke.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},icon:dc,deprecated:!0},[Ke["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},serverSide:!0},[hl.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.15},fallback:!0},[hl["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Fi={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},Uc="local:",rb=class extends Error{constructor(e="Couldn't export canvas.",t="CANVAS_ERROR"){super(),this.name=t,this.message=e}},Qs=class extends DOMException{constructor(e="Request Aborted"){super(e,"AbortError")}},$i=class extends Error{constructor(e="Image Scene Data Error",t="IMAGE_SCENE_DATA_ERROR"){super(e),I(this,"code"),this.name="EncodingError",this.code=t}},sb=class extends Error{constructor(){super(...arguments),I(this,"code","ELEMENT_HAS_INVALID_INDEX")}},WU=class extends Error{constructor(e="Worker URL is not defined!",t="WORKER_URL_NOT_DEFINED"){super(e),I(this,"code"),this.name="WorkerUrlNotDefinedError",this.code=t}},GU=class extends Error{constructor(e="Worker has to be in a separate chunk!",t="WORKER_IN_THE_MAIN_CHUNK"){super(e),I(this,"code"),this.name="WorkerInTheMainChunkError",this.code=t}},VU=class extends Error{constructor(e){super(e),this.name="ExcalidrawError"}},ob=class{constructor(e){I(this,"instance"),I(this,"debounceTerminate"),this.instance=new Worker(e,{type:"module"})}},db=class O5{constructor(t,a){I(this,"idleWorkers",new Set),I(this,"workerUrl"),I(this,"workerTTL"),this.workerUrl=t,this.workerTTL=a.ttl||1e3}static create(t,a={}){if(!t)throw new WU;if(!new URL("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/chunk-K2UTITRG.js",import.meta.url).href||t.toString()===new URL("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/chunk-K2UTITRG.js",import.meta.url).href)throw new GU;return new O5(t,a)}async postMessage(t,a){let n,i=Array.from(this.idleWorkers).shift();return i?(this.idleWorkers.delete(i),n=i):n=await this.createWorker(),new Promise((l,r)=>{n.instance.onmessage=this.onMessageHandler(n,l),n.instance.onerror=this.onErrorHandler(n,r),n.instance.postMessage(t,a),n.debounceTerminate(()=>r(new Error(`Active worker did not respond for ${this.workerTTL}ms!`)))})}async clear(){for(let t of this.idleWorkers)t.debounceTerminate.cancel(),t.instance.terminate();this.idleWorkers.clear()}async createWorker(){let t=new ob(this.workerUrl);return t.debounceTerminate=yl(a=>{t.instance.terminate(),this.idleWorkers.has(t)?(this.idleWorkers.delete(t),console.debug("Job finished! Idle worker has been released from the pool.")):a?a():console.error("Worker has been terminated!")},this.workerTTL),t}onMessageHandler(t,a){return n=>{t.debounceTerminate(),this.idleWorkers.add(t),a(n.data)}}onErrorHandler(t,a){return n=>{t.debounceTerminate(()=>a(n)),t.debounceTerminate.flush(),this.clear()}}},YU=typeof Worker<"u",cb=async(e,t)=>{let{Commands:a,subsetToBase64:n,toBase64:i}=await ub();return YU?ri(async()=>{try{let l=await Ub(),r=e.slice(0),o=await l.postMessage({command:a.Subset,arrayBuffer:r,codePoints:t},{transfer:[r]});return i(o)}catch(l){return YU=!1,G7()&&(l instanceof WU||l instanceof GU)||console.error("Failed to use workers for subsetting, falling back to the main thread.",l),n(e,t)}}):n(e,t)},fc=null,pc=null,hb=async()=>(fc||(fc=import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/subset-worker.chunk.js/+esm")),fc),ub=async()=>(pc||(pc=import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/subset-shared.chunk.js/+esm")),pc),mc=null,Ub=()=>(mc||(mc=ri(async()=>{let{WorkerUrl:e}=await hb();return db.create(e)})),mc),jU=class vd{constructor(t,a,n){I(this,"urls"),I(this,"fontFace"),this.urls=vd.createUrls(a);let i=this.urls.map(l=>`url(${l}) ${vd.getFormat(l)}`).join(", ");this.fontFace=new FontFace(t,i,{display:"swap",style:"normal",weight:"400",...n})}toCSS(t){if(!this.getUnicodeRangeRegex().test(t))return;let a=Array.from(t).map(n=>n.codePointAt(0));return this.getContent(a).then(n=>`@font-face { font-family: ${this.fontFace.family}; src: url(${n}); }`)}async getContent(t){let a=0,n=[];for(;a<this.urls.length;){let i=this.urls[a];try{let l=await this.fetchFont(i);return await cb(l,t)}catch(l){n.push(`"${i.toString()}" returned error "${l}"`)}a++}return console.error(`Failed to fetch font family "${this.fontFace.family}"`,JSON.stringify(n,void 0,2)),this.urls.length?this.urls[this.urls.length-1].toString():""}fetchFont(t){return ri(async()=>{let a=await fetch(t,{cache:"force-cache",headers:{Accept:"font/woff2"}});if(!a.ok){let n=t instanceof URL?t.toString():"dataurl";throw new Error(`Failed to fetch "${n}": ${a.statusText}`)}return await a.arrayBuffer()})}getUnicodeRangeRegex(){let t=this.fontFace.unicodeRange.split(/,\s*/).map(a=>{let[n,i]=a.replace("U+","").split("-");return i?`\\u{${n}}-\\u{${i}}`:`\\u{${n}}`}).join("");return new RegExp(`[${t}]`,"u")}static createUrls(t){if(t.startsWith("data"))return[t];if(t.startsWith(Uc))return[];if(t.startsWith("http"))return[new URL(t)];let a=t.replace(/^\/+/,""),n=[];if(typeof window.EXCALIDRAW_ASSET_PATH=="string"){let i=this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);n.push(new URL(a,i))}else Array.isArray(window.EXCALIDRAW_ASSET_PATH)&&window.EXCALIDRAW_ASSET_PATH.forEach(i=>{let l=this.normalizeBaseUrl(i);n.push(new URL(a,l))});return n.push(new URL(a,vd.ASSETS_FALLBACK_URL)),n}static getFormat(t){if(!(t instanceof URL))return"";try{let a=new URL(t).pathname.split(".");return a.length===1?"":`format('${a.pop()}')`}catch{return""}}static normalizeBaseUrl(t){let a=t;return/^\.?\//.test(a)&&(a=new URL(a.replace(/^\.?\/+/,""),window?.location?.origin).toString()),a=`${a.replace(/\/+$/,"")}/`,a}};I(jU,"ASSETS_FALLBACK_URL",`https://esm.sh/${`${me.PKG_NAME}@${me.PKG_VERSION}`}/dist/prod/`);var fb=jU,pb="./fonts/Cascadia/CascadiaCode-Regular.woff2",mb=[{uri:pb}],gb="./fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2",bb="./fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2",yb="./fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2",vb="./fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2",wb=[{uri:gb,descriptors:{unicodeRange:"U+20-7e,U+a1-a6,U+a8,U+ab-ac,U+af-b1,U+b4,U+b8,U+bb-bc,U+bf-cf,U+d1-d7,U+d9-de,U+e0-ef,U+f1-f7,U+f9-ff,U+131,U+152-153,U+2c6,U+2da,U+2dc,U+2013-2014,U+2018-201a,U+201c-201d,U+2020-2022,U+2026,U+2039-203a,U+2044,U+20ac,U+2191,U+2193,U+2212"}},{uri:bb,descriptors:{unicodeRange:"U+100-10f,U+112-125,U+128-130,U+134-137,U+139-13c,U+141-148,U+14c-151,U+154-161,U+164-165,U+168-17f,U+1bf,U+1f7,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+a75b"}},{uri:yb,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+315,U+2190,U+2192,U+2200,U+2203-2204,U+2264-2265,U+f6c3"}},{uri:vb,descriptors:{unicodeRange:"U+3bb"}}],Eb=[{uri:Uc}],xb="./fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2",Sb="./fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2",Mb="./fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2",Cb="./fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2",kb="./fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2",Ib="./fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2",Tb="./fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2",Lb=[{uri:xb,descriptors:{unicodeRange:"U+20-7e,U+a0-a3,U+a5-a6,U+a8-ab,U+ad-b1,U+b4,U+b6-b8,U+ba-ff,U+131,U+152-153,U+2bc,U+2c6,U+2da,U+2dc,U+304,U+308,U+2013-2014,U+2018-201a,U+201c-201e,U+2020,U+2022,U+2024-2026,U+2030,U+2039-203a,U+20ac,U+2122,U+2212"}},{uri:Sb,descriptors:{unicodeRange:"U+100-130,U+132-137,U+139-149,U+14c-151,U+154-17e,U+192,U+1fc-1ff,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+2113"}},{uri:Mb,descriptors:{unicodeRange:"U+400-45f,U+490-491,U+2116"}},{uri:Cb,descriptors:{unicodeRange:"U+37e,U+384-38a,U+38c,U+38e-393,U+395-3a1,U+3a3-3a8,U+3aa-3cf,U+3d7"}},{uri:kb,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+302,U+306-307,U+30a-30c,U+326-328,U+212e,U+2211,U+fb01-fb02"}},{uri:Ib,descriptors:{unicodeRange:"U+462-463,U+472-475,U+4d8-4d9,U+4e2-4e3,U+4e6-4e9,U+4ee-4ef"}},{uri:Tb,descriptors:{unicodeRange:"U+300-301,U+303"}}],Db=[{uri:Uc}],Ab="./fonts/Liberation/LiberationSans-Regular.woff2",Rb=[{uri:Ab}],Nb="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2",Pb="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2",_b=[{uri:Pb,descriptors:{unicodeRange:Fi.LATIN_EXT}},{uri:Nb,descriptors:{unicodeRange:Fi.LATIN}}],Ob="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2",Bb="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2",zb="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2",Fb="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2",$b="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2",Hb=[{uri:Fb,descriptors:{unicodeRange:Fi.CYRILIC_EXT,weight:"500"}},{uri:zb,descriptors:{unicodeRange:Fi.CYRILIC,weight:"500"}},{uri:$b,descriptors:{unicodeRange:Fi.VIETNAMESE,weight:"500"}},{uri:Bb,descriptors:{unicodeRange:Fi.LATIN_EXT,weight:"500"}},{uri:Ob,descriptors:{unicodeRange:Fi.LATIN,weight:"500"}}],Xb="./fonts/Virgil/Virgil-Regular.woff2",Wb=[{uri:Xb}],Gb="./fonts/Xiaolai/Xiaolai-Regular-09850c4077f3fffe707905872e0e2460.woff2",Vb="./fonts/Xiaolai/Xiaolai-Regular-7eb9fffd1aa890d07d0f88cc82e6cfe4.woff2",Yb="./fonts/Xiaolai/Xiaolai-Regular-60a3089806700d379f11827ee9843b6b.woff2",jb="./fonts/Xiaolai/Xiaolai-Regular-6fe5c5973cc06f74b2387a631ea36b88.woff2",Zb="./fonts/Xiaolai/Xiaolai-Regular-b96d9226ce77ec94ceca043d712182e6.woff2",Kb="./fonts/Xiaolai/Xiaolai-Regular-6ae5b42180ad70b971c91e7eefb8eba2.woff2",qb="./fonts/Xiaolai/Xiaolai-Regular-a4c34be6d42152e64b0df90bc4607f64.woff2",Jb="./fonts/Xiaolai/Xiaolai-Regular-c69f61a4ab18d0488c8d1fc12e7028e8.woff2",Qb="./fonts/Xiaolai/Xiaolai-Regular-e3fcf5180fd466c8915c4e8069491054.woff2",e4="./fonts/Xiaolai/Xiaolai-Regular-c1f94158256bb1f3bf665b053d895af9.woff2",t4="./fonts/Xiaolai/Xiaolai-Regular-544fc28abe2c5c30e62383fd4dac255f.woff2",a4="./fonts/Xiaolai/Xiaolai-Regular-7197d6fda6cba7c3874c53d6381ca239.woff2",n4="./fonts/Xiaolai/Xiaolai-Regular-70c2eb8d64e71a42a834eb857ea9df51.woff2",i4="./fonts/Xiaolai/Xiaolai-Regular-069e77aac84590e2e991d0a0176d34f2.woff2",l4="./fonts/Xiaolai/Xiaolai-Regular-41521fade99856108931b4768b1b2648.woff2",r4="./fonts/Xiaolai/Xiaolai-Regular-a004ddfcb26e67bd6e678c8ed19e25ce.woff2",s4="./fonts/Xiaolai/Xiaolai-Regular-04b718e5623574919c8b0dea5f301444.woff2",o4="./fonts/Xiaolai/Xiaolai-Regular-7e4bde7e9c7f84cd34d8a845e384c746.woff2",d4="./fonts/Xiaolai/Xiaolai-Regular-23686f7f29da6e8008c36dd3a80c83d6.woff2",c4="./fonts/Xiaolai/Xiaolai-Regular-69c09cc5fa3e55c74fc4821f76909cc3.woff2",h4="./fonts/Xiaolai/Xiaolai-Regular-25b7f38e18f035f96cb5e547bd2bd08c.woff2",u4="./fonts/Xiaolai/Xiaolai-Regular-ba3de316d63c7e339987b16f41a0b879.woff2",U4="./fonts/Xiaolai/Xiaolai-Regular-12b52b58eb3df36804b9a654ec9ee194.woff2",f4="./fonts/Xiaolai/Xiaolai-Regular-b1220a3c61f85cc0408deedb4c5f57a2.woff2",p4="./fonts/Xiaolai/Xiaolai-Regular-4535823663ad81405188a528d8f2b1a2.woff2",m4="./fonts/Xiaolai/Xiaolai-Regular-3eaa538115d76932653c21d8dc28f207.woff2",g4="./fonts/Xiaolai/Xiaolai-Regular-7e929f262f30c8ee78bf398150b1a7cd.woff2",b4="./fonts/Xiaolai/Xiaolai-Regular-73e309718fd16cea44b4d54a33581811.woff2",y4="./fonts/Xiaolai/Xiaolai-Regular-9eb5a99df4e76ac3363453ac9ca288b1.woff2",v4="./fonts/Xiaolai/Xiaolai-Regular-3e63ed8162808a9e425ed80a8bc79114.woff2",w4="./fonts/Xiaolai/Xiaolai-Regular-cb17fc3db95f6d139afc9d31a8e93293.woff2",E4="./fonts/Xiaolai/Xiaolai-Regular-c8b71798409ccc126ee264a00aadcf21.woff2",x4="./fonts/Xiaolai/Xiaolai-Regular-11c345711937f0ba4b8f7b6b919c8440.woff2",S4="./fonts/Xiaolai/Xiaolai-Regular-e480d9c614742d05f0e78f274f1e69e6.woff2",M4="./fonts/Xiaolai/Xiaolai-Regular-95429962233afd82db1c27df1500a28c.woff2",C4="./fonts/Xiaolai/Xiaolai-Regular-2cf96d082d35ea3d8106851223ad0d16.woff2",k4="./fonts/Xiaolai/Xiaolai-Regular-2d43040e86ff03ba677f6f9c04cd0805.woff2",I4="./fonts/Xiaolai/Xiaolai-Regular-2a26d20a23b00898ce82f09d2ee47c3f.woff2",T4="./fonts/Xiaolai/Xiaolai-Regular-a365e82ed54697a52f27adcea1315fe8.woff2",L4="./fonts/Xiaolai/Xiaolai-Regular-f5d079153c99a25b9be5b8583c4cc8a7.woff2",D4="./fonts/Xiaolai/Xiaolai-Regular-10a7ae9a371830a80c3d844acf1c02d7.woff2",A4="./fonts/Xiaolai/Xiaolai-Regular-e4bca6cfa53e499cae0a6be4894a90e9.woff2",R4="./fonts/Xiaolai/Xiaolai-Regular-60a41c7e1c68f22424e6d22df544bc82.woff2",N4="./fonts/Xiaolai/Xiaolai-Regular-7ab2bed91166a9dca83a5ebfbe2a7f38.woff2",P4="./fonts/Xiaolai/Xiaolai-Regular-670ba603758d94268e8606f240a42e12.woff2",_4="./fonts/Xiaolai/Xiaolai-Regular-e656f091b9dc4709722c9f4b84d3c797.woff2",O4="./fonts/Xiaolai/Xiaolai-Regular-15dc6d811c9cd078f9086a740d5a1038.woff2",B4="./fonts/Xiaolai/Xiaolai-Regular-f0f13b5c60e0af5553bd359f5513be1b.woff2",z4="./fonts/Xiaolai/Xiaolai-Regular-8c2f33cee3993174f7e87c28e4bf42ee.woff2",F4="./fonts/Xiaolai/Xiaolai-Regular-761d05e3cd968cf574166867998ef06a.woff2",$4="./fonts/Xiaolai/Xiaolai-Regular-642b26e2e5f5fb780b51b593dbc8c851.woff2",H4="./fonts/Xiaolai/Xiaolai-Regular-5572b3513ba8df57a3d5d7303ee6b11b.woff2",X4="./fonts/Xiaolai/Xiaolai-Regular-3c9de2ae0ea4bc91a510942dfa4be8d2.woff2",W4="./fonts/Xiaolai/Xiaolai-Regular-671a2c20b1eb9e4ef8a192833940e319.woff2",G4="./fonts/Xiaolai/Xiaolai-Regular-4dc6d5f188d5c96d44815cd1e81aa885.woff2",V4="./fonts/Xiaolai/Xiaolai-Regular-ce4884f96f11589608b76b726a755803.woff2",Y4="./fonts/Xiaolai/Xiaolai-Regular-8f476c4c99813d57cbe6eca4727388ad.woff2",j4="./fonts/Xiaolai/Xiaolai-Regular-5935a5775af3d5c6307ac667bd9ae74e.woff2",Z4="./fonts/Xiaolai/Xiaolai-Regular-79f007c1c6d07557120982951ea67998.woff2",K4="./fonts/Xiaolai/Xiaolai-Regular-bafff7a14c27403dcc6cf1432e8ea836.woff2",q4="./fonts/Xiaolai/Xiaolai-Regular-543fa46ace099a7099dad69123399400.woff2",J4="./fonts/Xiaolai/Xiaolai-Regular-4ddc14ed3eb0c3e46364317dfc0144a3.woff2",Q4="./fonts/Xiaolai/Xiaolai-Regular-0fa55a080fcd0f9dc2e0b0058b793df8.woff2",e9="./fonts/Xiaolai/Xiaolai-Regular-66493ba5a8367f2928812f446f47b56a.woff2",t9="./fonts/Xiaolai/Xiaolai-Regular-57862b464a55b18c7bf234ce22907d73.woff2",a9="./fonts/Xiaolai/Xiaolai-Regular-8d3bcabb847b56243b16afe62adaaf21.woff2",n9="./fonts/Xiaolai/Xiaolai-Regular-2b77e8ebfb2367ab2662396a60e7d320.woff2",i9="./fonts/Xiaolai/Xiaolai-Regular-0b5d723fdc4e249c140f0909e87d03b4.woff2",l9="./fonts/Xiaolai/Xiaolai-Regular-cdbce89e82cc1ab53a2decbf5819278f.woff2",r9="./fonts/Xiaolai/Xiaolai-Regular-739bc1a567439c7cffcd1614644593d2.woff2",s9="./fonts/Xiaolai/Xiaolai-Regular-72252d73220fa3cd856677888cee1635.woff2",o9="./fonts/Xiaolai/Xiaolai-Regular-08e0dc436ad0ad61ba5558db0674d762.woff2",d9="./fonts/Xiaolai/Xiaolai-Regular-cf6ff4e0f491ca0cf3038187a997b9b4.woff2",c9="./fonts/Xiaolai/Xiaolai-Regular-9cfb2a77a4e45025105ad29a1748b90d.woff2",h9="./fonts/Xiaolai/Xiaolai-Regular-450da755d5bcb70906e1295e559b9602.woff2",u9="./fonts/Xiaolai/Xiaolai-Regular-0986d134c05864f5025962eef9f994a0.woff2",U9="./fonts/Xiaolai/Xiaolai-Regular-1ee544f0f1dac422545c505baa788992.woff2",f9="./fonts/Xiaolai/Xiaolai-Regular-4806e761d750087c2d734fc64596eaff.woff2",p9="./fonts/Xiaolai/Xiaolai-Regular-33432927cd87d40cfe393c7482bf221f.woff2",m9="./fonts/Xiaolai/Xiaolai-Regular-be549ab72f0719d606a5c01e2c0219b6.woff2",g9="./fonts/Xiaolai/Xiaolai-Regular-019d66dcad46dc156b162d267f981c20.woff2",b9="./fonts/Xiaolai/Xiaolai-Regular-b5c1596551c256e0e9cf02028595b092.woff2",y9="./fonts/Xiaolai/Xiaolai-Regular-e5f453bb04da18eed01675eeebd88bf8.woff2",v9="./fonts/Xiaolai/Xiaolai-Regular-cf2cc71752631e579e35b0e423bf2638.woff2",w9="./fonts/Xiaolai/Xiaolai-Regular-6f3256af8454371776bc46670d33cc65.woff2",E9="./fonts/Xiaolai/Xiaolai-Regular-23f228f3999c01983860012330e4be08.woff2",x9="./fonts/Xiaolai/Xiaolai-Regular-21430ee05a1248901da8d0de08744d47.woff2",S9="./fonts/Xiaolai/Xiaolai-Regular-5330a2119a716e4e7224ed108b085dac.woff2",M9="./fonts/Xiaolai/Xiaolai-Regular-cd145ce4a0ea18469358df53c207bc1b.woff2",C9="./fonts/Xiaolai/Xiaolai-Regular-36925dfe329a45086cbb7fc5c20d45ac.woff2",k9="./fonts/Xiaolai/Xiaolai-Regular-4bfaa8ffa64c5ee560aa2daba7c9cbd3.woff2",I9="./fonts/Xiaolai/Xiaolai-Regular-112c051027b2d766c19a519f6ee1f4f7.woff2",T9="./fonts/Xiaolai/Xiaolai-Regular-5b0ed6971aaab9c8ad563230bd5471a7.woff2",L9="./fonts/Xiaolai/Xiaolai-Regular-98f2ad84457de7f3740d9920b8fa8667.woff2",D9="./fonts/Xiaolai/Xiaolai-Regular-733171b4ffcd17ea1fe1c0ba627173bf.woff2",A9="./fonts/Xiaolai/Xiaolai-Regular-684d65f1793cac449dde5d59cb3c47fb.woff2",R9="./fonts/Xiaolai/Xiaolai-Regular-cbaaefaaf326668277aa24dfa93c4d28.woff2",N9="./fonts/Xiaolai/Xiaolai-Regular-58fd02350d0bc52cf1ca3bb32ce9766e.woff2",P9="./fonts/Xiaolai/Xiaolai-Regular-7ccce86603f80a099ddb0cb21d4ae3e3.woff2",_9="./fonts/Xiaolai/Xiaolai-Regular-3717077e38f98d89eae729b6c14e56dc.woff2",O9="./fonts/Xiaolai/Xiaolai-Regular-dbea1af6dcd9860be40c3d18254338f5.woff2",B9="./fonts/Xiaolai/Xiaolai-Regular-4a0fdb40036e87b40aa08dd30584cb85.woff2",z9="./fonts/Xiaolai/Xiaolai-Regular-0f626226ba1272e832aea87bafd9720e.woff2",F9="./fonts/Xiaolai/Xiaolai-Regular-938d90c10ff8c20386af7f242c05d6b0.woff2",$9="./fonts/Xiaolai/Xiaolai-Regular-b6d128682ee29e471486354d486a1b90.woff2",H9="./fonts/Xiaolai/Xiaolai-Regular-e51ef413167c6e14e0c0fdcc585f2fc9.woff2",X9="./fonts/Xiaolai/Xiaolai-Regular-9d81066dd2b337c938df6e90380a00dc.woff2",W9="./fonts/Xiaolai/Xiaolai-Regular-20e7bf72fa05de9adf7dbcc7bf51dde6.woff2",G9="./fonts/Xiaolai/Xiaolai-Regular-4095eb84ef3874e2600247bee0b04026.woff2",V9="./fonts/Xiaolai/Xiaolai-Regular-4ee10ae43505e2e0bc62656ced49c0fa.woff2",Y9="./fonts/Xiaolai/Xiaolai-Regular-7494dc504ae00ee9cd0505f990f88c5d.woff2",j9="./fonts/Xiaolai/Xiaolai-Regular-8de5b863cb50dfefdd07cb11c774d579.woff2",Z9="./fonts/Xiaolai/Xiaolai-Regular-3e1f8f654357353bf0e04ba5c34b5f7f.woff2",K9="./fonts/Xiaolai/Xiaolai-Regular-2e33e8dc771ef5e1d9127d60a6b73679.woff2",q9="./fonts/Xiaolai/Xiaolai-Regular-173945821411c09f70c95f98d590e697.woff2",J9="./fonts/Xiaolai/Xiaolai-Regular-b358f7a51ece39a3247942b1feabdb29.woff2",Q9="./fonts/Xiaolai/Xiaolai-Regular-23ad2d71b280f00b1363b95b7bea94eb.woff2",ey="./fonts/Xiaolai/Xiaolai-Regular-5882ffa04f32584d26109137e2da4352.woff2",ty="./fonts/Xiaolai/Xiaolai-Regular-a203b91dad570bf05a58c3c3ddb529bf.woff2",ay="./fonts/Xiaolai/Xiaolai-Regular-bd77e3c7f9e0b072d96af37f73d1aa32.woff2",ny="./fonts/Xiaolai/Xiaolai-Regular-5a45d991244d4c7140217e1e5f5ca4f4.woff2",iy="./fonts/Xiaolai/Xiaolai-Regular-f56414bf9bced67990def8660e306759.woff2",ly="./fonts/Xiaolai/Xiaolai-Regular-583d166e56ba0de4b77eabb47ef67839.woff2",ry="./fonts/Xiaolai/Xiaolai-Regular-7f855356ab893b0d2b9c1c83b8116f0e.woff2",sy="./fonts/Xiaolai/Xiaolai-Regular-b57aaedfd8ebdf3931f25119dc6a5eb2.woff2",oy="./fonts/Xiaolai/Xiaolai-Regular-b6fd38ca30869792244804b04bc058da.woff2",dy="./fonts/Xiaolai/Xiaolai-Regular-452225341522a7942f0f6aab1a5c91a3.woff2",cy="./fonts/Xiaolai/Xiaolai-Regular-866fa7613df6b3fd272bcfd4530c0bb9.woff2",hy="./fonts/Xiaolai/Xiaolai-Regular-52a84a22fd1369bffeaf21da2d6158dc.woff2",uy="./fonts/Xiaolai/Xiaolai-Regular-829615148e6357d826b9242eb7fbbd1e.woff2",Uy="./fonts/Xiaolai/Xiaolai-Regular-c99eda15fc26a2941579560f76c3a5cf.woff2",fy="./fonts/Xiaolai/Xiaolai-Regular-395c35dd584b56b0789f58a0559beaf1.woff2",py="./fonts/Xiaolai/Xiaolai-Regular-203b0e569e3b14aac86a003dc3fa523e.woff2",my="./fonts/Xiaolai/Xiaolai-Regular-51a0e808bbc8361236ac521a119758a3.woff2",gy="./fonts/Xiaolai/Xiaolai-Regular-6e092f71c1e634059ada0e52abadce67.woff2",by="./fonts/Xiaolai/Xiaolai-Regular-0f7fb1e0d5015bb1371343153ecf7ce3.woff2",yy="./fonts/Xiaolai/Xiaolai-Regular-d0cf73942fea1c74edbdf0b3011f4656.woff2",vy="./fonts/Xiaolai/Xiaolai-Regular-968cffdc8ee679da094e77ebf50f58ef.woff2",wy="./fonts/Xiaolai/Xiaolai-Regular-7a07ddc0f0c0f5f4a9bad6ee3dda66b5.woff2",Ey="./fonts/Xiaolai/Xiaolai-Regular-ec181b795ac1fb5a50d700b6e996d745.woff2",xy="./fonts/Xiaolai/Xiaolai-Regular-cfb211578629b7e8153b37240de6a9d5.woff2",Sy="./fonts/Xiaolai/Xiaolai-Regular-59e9ff77b0efaf684bc09274fb6908c9.woff2",My="./fonts/Xiaolai/Xiaolai-Regular-2adbc89c11e65905393d3dfc468b9d5b.woff2",Cy="./fonts/Xiaolai/Xiaolai-Regular-70e811fd7994e61f408c923de6ddd078.woff2",ky="./fonts/Xiaolai/Xiaolai-Regular-c4a687ac4f0c2766eefc9f77ed99cddf.woff2",Iy="./fonts/Xiaolai/Xiaolai-Regular-51502f1206be09c565f1547c406e9558.woff2",Ty="./fonts/Xiaolai/Xiaolai-Regular-1fdc0c67ed57263a80fd108c1f6ccf24.woff2",Ly="./fonts/Xiaolai/Xiaolai-Regular-e11567fd2accf9957cd0d3c2be937d87.woff2",Dy="./fonts/Xiaolai/Xiaolai-Regular-20cc1bbf50e7efb442756cb605672c1f.woff2",Ay="./fonts/Xiaolai/Xiaolai-Regular-5d2898fbc097a7e24c6f38d80587621e.woff2",Ry="./fonts/Xiaolai/Xiaolai-Regular-ac9ceb44437becc3e9c4dbfebab7fc2d.woff2",Ny="./fonts/Xiaolai/Xiaolai-Regular-c16ed9740b85badf16e86ea782a3062f.woff2",Py="./fonts/Xiaolai/Xiaolai-Regular-aa0d470430e6391eca720c7cfa44446f.woff2",_y="./fonts/Xiaolai/Xiaolai-Regular-f2b54d4e7be0eaefe1c2c56836fa5368.woff2",Oy="./fonts/Xiaolai/Xiaolai-Regular-99a16ef6a64934d5781933dbd9c46b2e.woff2",By="./fonts/Xiaolai/Xiaolai-Regular-c40533fdf4cc57177b12803598af7e59.woff2",zy="./fonts/Xiaolai/Xiaolai-Regular-91ddb2969bf2d31ba02ad82998d1314c.woff2",Fy="./fonts/Xiaolai/Xiaolai-Regular-774d4f764a1299da5d28ec2f2ffe0d69.woff2",$y="./fonts/Xiaolai/Xiaolai-Regular-7718fe60986d8b42b1be9c5ace5ccf25.woff2",Hy="./fonts/Xiaolai/Xiaolai-Regular-aa5c9ca6cf4fba00433b7aa3fa10671a.woff2",Xy="./fonts/Xiaolai/Xiaolai-Regular-4f50e5136e136527280bc902c5817561.woff2",Wy="./fonts/Xiaolai/Xiaolai-Regular-093b9ef39a46ceae95a1df18a0a3a326.woff2",Gy="./fonts/Xiaolai/Xiaolai-Regular-a0ca5df4258213d7fc9fce80f65ce760.woff2",Vy="./fonts/Xiaolai/Xiaolai-Regular-d2666cbed13462c5dc36fa2f15c202ca.woff2",Yy="./fonts/Xiaolai/Xiaolai-Regular-1e6fd68f1f3902ce48ce8c69df385622.woff2",jy="./fonts/Xiaolai/Xiaolai-Regular-87599f94b6cc129d505b375798d0d751.woff2",Zy="./fonts/Xiaolai/Xiaolai-Regular-06c77b8c66e51ed6c63ccb502dd8b8af.woff2",Ky="./fonts/Xiaolai/Xiaolai-Regular-13ae07ed2e272d26d59bc0691cd7117a.woff2",qy="./fonts/Xiaolai/Xiaolai-Regular-353f33792a8f60dc69323ddf635a269e.woff2",Jy="./fonts/Xiaolai/Xiaolai-Regular-0facdf1ea213ba40261022f5d5ed4493.woff2",Qy="./fonts/Xiaolai/Xiaolai-Regular-f8ee5d36068a42b51d0e4a1116cfcec1.woff2",ev="./fonts/Xiaolai/Xiaolai-Regular-79d494361ae093b69e74ee9dbe65bfd4.woff2",tv="./fonts/Xiaolai/Xiaolai-Regular-74e2263a91439c25b91d5132ce9f4d62.woff2",av="./fonts/Xiaolai/Xiaolai-Regular-ee8bae97908d5147b423f77ad0d3c1bb.woff2",nv="./fonts/Xiaolai/Xiaolai-Regular-56467a5c8840c4d23a60b2f935114848.woff2",iv="./fonts/Xiaolai/Xiaolai-Regular-145aa02cdd91946e67dc934e1acffe75.woff2",lv="./fonts/Xiaolai/Xiaolai-Regular-54acdfc2166ad7fcbd074f75fd4a56ba.woff2",rv="./fonts/Xiaolai/Xiaolai-Regular-29cec36cd205b211da97acabaa62f055.woff2",sv="./fonts/Xiaolai/Xiaolai-Regular-3756e81d3e149cf6099163ee79944fec.woff2",ov="./fonts/Xiaolai/Xiaolai-Regular-8e9f97f01034820170065b2921b4fb5e.woff2",dv="./fonts/Xiaolai/Xiaolai-Regular-13d2887ec8ee73c43acdabc52a05af7b.woff2",cv="./fonts/Xiaolai/Xiaolai-Regular-72536a3d71b694a0d53dd90ddceae41e.woff2",hv="./fonts/Xiaolai/Xiaolai-Regular-603aefd23e350ba7eb124273e3c9bcf1.woff2",uv="./fonts/Xiaolai/Xiaolai-Regular-095c169f3314805276f603a362766abd.woff2",Uv="./fonts/Xiaolai/Xiaolai-Regular-9544732d2e62d1a429674f8ee41b5d3a.woff2",fv="./fonts/Xiaolai/Xiaolai-Regular-d3716376641d615e2995605b29bca7b6.woff2",pv="./fonts/Xiaolai/Xiaolai-Regular-5a1ce3117cfe90c48e8fb4a9a00f694d.woff2",mv="./fonts/Xiaolai/Xiaolai-Regular-b7d203b051eff504ff59ddca7576b6a9.woff2",gv="./fonts/Xiaolai/Xiaolai-Regular-4a38cc3e9cf104e69ba246d37f8cf135.woff2",bv="./fonts/Xiaolai/Xiaolai-Regular-982b630266d87db93d2539affb1275c6.woff2",yv="./fonts/Xiaolai/Xiaolai-Regular-9592bfc861f07bcb8d75c196b370e548.woff2",vv="./fonts/Xiaolai/Xiaolai-Regular-a7accba310e821da5505f71c03b76bdb.woff2",wv="./fonts/Xiaolai/Xiaolai-Regular-dac48066b5883d8b4551fc584f0c2a3e.woff2",Ev="./fonts/Xiaolai/Xiaolai-Regular-a1f916d6039285c4ffb900cd654e418f.woff2",xv="./fonts/Xiaolai/Xiaolai-Regular-95bfd249da4902577b4b7d76ebdd0b44.woff2",Sv="./fonts/Xiaolai/Xiaolai-Regular-93fc8f28a33234bcadf1527cafabd502.woff2",Mv="./fonts/Xiaolai/Xiaolai-Regular-903bb6865f3452e2fda42e3a25547bc5.woff2",Cv="./fonts/Xiaolai/Xiaolai-Regular-4aca6a43e59aceee2166b0c7e4e85ef1.woff2",kv="./fonts/Xiaolai/Xiaolai-Regular-24476a126f129212beb33f66853ea151.woff2",Iv="./fonts/Xiaolai/Xiaolai-Regular-1b611157cd46bb184d4fa4dae2d6a2b8.woff2",Tv="./fonts/Xiaolai/Xiaolai-Regular-56a32a7689abd0326e57c10c6c069bb4.woff2",Lv="./fonts/Xiaolai/Xiaolai-Regular-3cc70dbb64df5b21f1326cc24dee2195.woff2",Dv="./fonts/Xiaolai/Xiaolai-Regular-f6032fc06eb20480f096199713f70885.woff2",Av="./fonts/Xiaolai/Xiaolai-Regular-e2ead7ea7da0437f085f42ffc05f8d13.woff2",Rv="./fonts/Xiaolai/Xiaolai-Regular-97f7f48ce90c9429bf32ae51469db74d.woff2",Nv="./fonts/Xiaolai/Xiaolai-Regular-24a21c1e4449222e8d1898d69ff3a404.woff2",Pv="./fonts/Xiaolai/Xiaolai-Regular-726303e0774b4e678bff8c2deb6ca603.woff2",_v="./fonts/Xiaolai/Xiaolai-Regular-5a7fac4b8b23a6e4e5ba0c9bf1756c91.woff2",Ov="./fonts/Xiaolai/Xiaolai-Regular-2b7441d46298788ac94e610ffcc709b6.woff2",Bv=[{uri:Gb,descriptors:{unicodeRange:"U+f9b8-fa6d,U+fe32,U+fe45-fe4f,U+ff02-ff0b,U+ff0d-ff1e,U+ff20-ff2a"}},{uri:Vb,descriptors:{unicodeRange:"U+20dd-20de,U+25ef,U+ff2b-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd7,U+ffda-ffdc,U+ffe0-ffe6,U+ffe8-ffee"}},{uri:Yb,descriptors:{unicodeRange:"U+d7eb-d7fb,U+f900-f9b7"}},{uri:jb,descriptors:{unicodeRange:"U+d6f2-d7a3,U+d7b0-d7c6,U+d7cb-d7ea"}},{uri:Zb,descriptors:{unicodeRange:"U+d609-d6f1"}},{uri:Kb,descriptors:{unicodeRange:"U+d520-d608"}},{uri:qb,descriptors:{unicodeRange:"U+d437-d51f"}},{uri:Jb,descriptors:{unicodeRange:"U+d34e-d436"}},{uri:Qb,descriptors:{unicodeRange:"U+d265-d34d"}},{uri:e4,descriptors:{unicodeRange:"U+d17c-d264"}},{uri:t4,descriptors:{unicodeRange:"U+d093-d17b"}},{uri:a4,descriptors:{unicodeRange:"U+cfaa-d092"}},{uri:n4,descriptors:{unicodeRange:"U+cec1-cfa9"}},{uri:i4,descriptors:{unicodeRange:"U+cdd8-cec0"}},{uri:l4,descriptors:{unicodeRange:"U+ccf1-cdd7"}},{uri:r4,descriptors:{unicodeRange:"U+cc08-ccf0"}},{uri:s4,descriptors:{unicodeRange:"U+cb43-cc07"}},{uri:o4,descriptors:{unicodeRange:"U+ca83-cb42"}},{uri:d4,descriptors:{unicodeRange:"U+c9a1-ca82"}},{uri:c4,descriptors:{unicodeRange:"U+c8b8-c9a0"}},{uri:h4,descriptors:{unicodeRange:"U+c7cf-c8b7"}},{uri:u4,descriptors:{unicodeRange:"U+c6e6-c7ce"}},{uri:U4,descriptors:{unicodeRange:"U+c5fd-c6e5"}},{uri:f4,descriptors:{unicodeRange:"U+c514-c5fc"}},{uri:p4,descriptors:{unicodeRange:"U+c42b-c513"}},{uri:m4,descriptors:{unicodeRange:"U+c341-c34e,U+c350-c42a"}},{uri:g4,descriptors:{unicodeRange:"U+c258-c340"}},{uri:b4,descriptors:{unicodeRange:"U+c16f-c257"}},{uri:y4,descriptors:{unicodeRange:"U+c086-c16e"}},{uri:v4,descriptors:{unicodeRange:"U+bf9d-c085"}},{uri:w4,descriptors:{unicodeRange:"U+beb4-bf9c"}},{uri:E4,descriptors:{unicodeRange:"U+bdcb-beb3"}},{uri:x4,descriptors:{unicodeRange:"U+bce2-bdca"}},{uri:S4,descriptors:{unicodeRange:"U+bbf9-bce1"}},{uri:M4,descriptors:{unicodeRange:"U+bb10-bbf8"}},{uri:C4,descriptors:{unicodeRange:"U+ba27-bb0f"}},{uri:k4,descriptors:{unicodeRange:"U+b93e-ba26"}},{uri:I4,descriptors:{unicodeRange:"U+b855-b93d"}},{uri:T4,descriptors:{unicodeRange:"U+b76c-b854"}},{uri:L4,descriptors:{unicodeRange:"U+b683-b76b"}},{uri:D4,descriptors:{unicodeRange:"U+b59a-b682"}},{uri:A4,descriptors:{unicodeRange:"U+b4b1-b599"}},{uri:R4,descriptors:{unicodeRange:"U+11fb-11ff,U+b3cd-b4b0"}},{uri:N4,descriptors:{unicodeRange:"U+11e6-11fa,U+b2f9-b3cc"}},{uri:P4,descriptors:{unicodeRange:"U+11d1-11e5,U+b225-b2f8"}},{uri:_4,descriptors:{unicodeRange:"U+11bc-11d0,U+b151-b224"}},{uri:O4,descriptors:{unicodeRange:"U+11a7-11bb,U+b07d-b150"}},{uri:B4,descriptors:{unicodeRange:"U+1191-11a6,U+afaa-b07c"}},{uri:z4,descriptors:{unicodeRange:"U+117c-1190,U+aed6-afa9"}},{uri:F4,descriptors:{unicodeRange:"U+1167-117b,U+ae02-aed5"}},{uri:$4,descriptors:{unicodeRange:"U+1152-115e,U+1160-1166,U+ad2d-ae01"}},{uri:H4,descriptors:{unicodeRange:"U+113d-1151,U+ac59-ad2c"}},{uri:X4,descriptors:{unicodeRange:"U+1100-113c,U+9f95-9f98,U+9f9c-9f9e,U+9fa1-9fce,U+9fd0,U+a960-a97c,U+ac00-ac58"}},{uri:W4,descriptors:{unicodeRange:"U+9771-9772,U+9775,U+9777-977b,U+977d-9784,U+9786-978a,U+978c,U+978e-9790,U+9793,U+9795-9797,U+9799-979f,U+97a1-97a2,U+97a4-97aa,U+97ac,U+97ae,U+97b0-97b1,U+97b3,U+97b5-97e5,U+97e8,U+97ee-97f2,U+97f4,U+97f7-982d"}},{uri:G4,descriptors:{unicodeRange:"U+9491,U+9496,U+9498,U+94c7,U+94cf,U+94d3-94d4,U+94da,U+94e6,U+94fb,U+951c,U+9520,U+9527,U+9533,U+953d,U+9543,U+9548,U+954b,U+9555,U+955a,U+9560,U+956e,U+9574-9575,U+9577-957e,U+9580-95e7,U+95ec,U+95ff,U+9607,U+9613,U+9618,U+961b,U+961e,U+9620,U+9623-9629,U+962b-962d,U+962f-9630,U+9637-963a,U+963e,U+9641,U+9643,U+964a,U+964e-964f,U+9651-9653,U+9656-965a,U+965c-965e,U+9660,U+9663,U+9665-9666,U+966b,U+966d-9671,U+9673,U+9678-9684,U+9687,U+9689-968a,U+968c,U+968e,U+9691-9693"}},{uri:V4,descriptors:{unicodeRange:"U+923c-9273,U+9275-928d,U+928f-92ad,U+92af-92c7,U+92c9-92ee"}},{uri:Y4,descriptors:{unicodeRange:"U+9159,U+915b-915c,U+915f-9160,U+9166-9168,U+916b,U+916d,U+9173,U+917a-917c,U+9180-9184,U+9186,U+9188,U+918a,U+918e-918f,U+9193-9199,U+919c-91a1,U+91a4-91a9,U+91ab-91ac,U+91b0-91b3,U+91b6-91b9,U+91bb-91c6,U+91c8,U+91cb,U+91d0,U+91d2-91db,U+91dd-923b"}},{uri:j4,descriptors:{unicodeRange:"U+902b-902c,U+9030-9034,U+9037,U+9039-903a,U+903d,U+903f-9040,U+9043,U+9045-9046,U+9048-904c,U+904e,U+9054-9056,U+9059-905a,U+905c-9061,U+9064,U+9066-9067,U+9069-906c,U+906f-9073,U+9076-907c,U+907e,U+9081,U+9084-9087,U+9089-908a,U+908c-9090,U+9092,U+9094,U+9096,U+9098,U+909a,U+909c,U+909e-90a0,U+90a4-90a5,U+90a7-90a9,U+90ab,U+90ad,U+90b2,U+90b7,U+90bc-90bd,U+90bf-90c0,U+90c2-90c3,U+90c6,U+90c8-90c9,U+90cb-90cd,U+90d2,U+90d4-90d6,U+90d8-90da,U+90de-90e0,U+90e3-90e5,U+90e9-90ea,U+90ec,U+90ee,U+90f0-90f3,U+90f5-90f7,U+90f9-90fc,U+90ff-9101,U+9103,U+9105-9118,U+911a-911d,U+911f-9121,U+9124-912e,U+9130,U+9132-9138,U+913a-9142,U+9144-9145,U+9147-9148,U+9151,U+9153-9156,U+9158"}},{uri:Z4,descriptors:{unicodeRange:"U+8f03-8f65,U+8f6a,U+8f80,U+8f8c,U+8f92,U+8f9d,U+8fa0-8fa2,U+8fa4-8fa7,U+8faa,U+8fac-8faf,U+8fb2-8fb5,U+8fb7-8fb8,U+8fba-8fbc,U+8fbf-8fc0,U+8fc3,U+8fc6,U+8fc9-8fcd,U+8fcf,U+8fd2,U+8fd6-8fd7,U+8fda,U+8fe0-8fe1,U+8fe3,U+8fe7,U+8fec,U+8fef,U+8ff1-8ff2,U+8ff4-8ff6,U+8ffa-8ffc,U+8ffe-8fff,U+9007-9008,U+900c,U+900e,U+9013,U+9015,U+9018-9019,U+901c,U+9023-9025,U+9027-902a"}},{uri:K4,descriptors:{unicodeRange:"U+8d03-8d1c,U+8d20,U+8d51-8d52,U+8d57,U+8d5f,U+8d65,U+8d68-8d6a,U+8d6c,U+8d6e-8d6f,U+8d71-8d72,U+8d78-8d80,U+8d82-8d83,U+8d86-8d89,U+8d8c-8d90,U+8d92-8d93,U+8d95-8d9e,U+8da0-8da2,U+8da4-8db0,U+8db2,U+8db6-8db7,U+8db9,U+8dbb,U+8dbd,U+8dc0-8dc2,U+8dc5,U+8dc7-8dca,U+8dcd,U+8dd0,U+8dd2-8dd5,U+8dd8-8dd9,U+8ddc,U+8de0-8de2,U+8de5-8de7,U+8de9,U+8ded-8dee,U+8df0-8df2,U+8df4,U+8df6,U+8dfc,U+8dfe-8e04,U+8e06-8e08,U+8e0b,U+8e0d-8e0e,U+8e10-8e13,U+8e15-8e1c,U+8e20-8e21,U+8e24-8e28,U+8e2b,U+8e2d,U+8e30,U+8e32-8e34,U+8e36-8e38,U+8e3b-8e3c,U+8e3e-8e3f,U+8e43,U+8e45-8e46"}},{uri:q4,descriptors:{unicodeRange:"U+8bea,U+8c09,U+8c1e,U+8c38-8c40,U+8c42-8c45,U+8c48,U+8c4a-8c4b,U+8c4d-8c54,U+8c56-8c59,U+8c5b-8c60,U+8c63-8c69,U+8c6c-8c72,U+8c74-8c77,U+8c7b-8c81,U+8c83-8c84,U+8c86-8c88,U+8c8b,U+8c8d-8c93,U+8c95-8c97,U+8c99-8d02"}},{uri:J4,descriptors:{unicodeRange:"U+8a64-8a78,U+8a7a-8a88,U+8a8b-8a92,U+8a94-8b06,U+8b08-8b1b"}},{uri:Q4,descriptors:{unicodeRange:"U+8987-89c0,U+89c3,U+89cd,U+89d3-89d5,U+89d7-89d9,U+89db,U+89dd,U+89df-89e2,U+89e4,U+89e7-89ea,U+89ec-89ee,U+89f0-89f2,U+89f4-89ff,U+8a01-8a06,U+8a08-8a3d,U+8a3f-8a47,U+8a49-8a63"}},{uri:e9,descriptors:{unicodeRange:"U+87e3-87e4,U+87e6-87e9,U+87eb-87ed,U+87ef-87f8,U+87fa-87fd,U+87ff-8802,U+8804-8809,U+880b-8812,U+8814,U+8817-881a,U+881c-8820,U+8823-8831,U+8833-8838,U+883a-883b,U+883d-883f,U+8841-8843,U+8846-884b,U+884e-8853,U+8855-8856,U+8858,U+885a-8860,U+8866-8867,U+886a,U+886d,U+886f,U+8871,U+8873-8876,U+8878-887c,U+8880,U+8883,U+8886-8887,U+8889-888a,U+888c,U+888e-8891,U+8893-8895,U+8897-889b,U+889d-88a1,U+88a3,U+88a5-88aa,U+88ac,U+88ae-88b0,U+88b2-88b6,U+88b8-88bb"}},{uri:t9,descriptors:{unicodeRange:"U+86e7-86e8,U+86ea-86ec,U+86ef,U+86f5-86f7,U+86fa-86fd,U+86ff,U+8701,U+8704-8706,U+870b-870c,U+870e-8711,U+8714,U+8716,U+8719,U+871b,U+871d,U+871f-8720,U+8724,U+8726-8728,U+872a-872d,U+872f-8730,U+8732-8733,U+8735-8736,U+8738-873a,U+873c-873d,U+8740-8746,U+874a-874b,U+874d,U+874f-8752,U+8754-8756,U+8758,U+875a-875f,U+8761-8762,U+8766-876d,U+876f,U+8771-8773,U+8775,U+8777-877a,U+877f-8781,U+8784,U+8786-8787,U+8789-878a,U+878c,U+878e-8792,U+8794-8796,U+8798-879e,U+87a0-87a7,U+87a9-87aa,U+87ae,U+87b0-87b2,U+87b4,U+87b6-87b9,U+87bb-87bc,U+87be-87bf,U+87c1-87c5,U+87c7-87c9,U+87cc-87d0,U+87d4-87da,U+87dc-87df,U+87e1-87e2"}},{uri:a9,descriptors:{unicodeRange:"U+8604,U+8606-8610,U+8612-8615,U+8617-8626,U+8628,U+862a-8637,U+8639-863b,U+863d-864c,U+8652-8653,U+8655-8659,U+865b-865d,U+865f-8661,U+8663-866a,U+866d,U+866f-8670,U+8672-8678,U+8683-8689,U+868e-8692,U+8694,U+8696-869b,U+869e-86a2,U+86a5-86a6,U+86ab,U+86ad-86ae,U+86b2-86b3,U+86b7-86b9,U+86bb-86bf,U+86c1-86c3,U+86c5,U+86c8,U+86cc-86cd,U+86d2-86d3,U+86d5-86d7,U+86da,U+86dc-86dd,U+86e0-86e3,U+86e5-86e6"}},{uri:n9,descriptors:{unicodeRange:"U+8456,U+8458,U+845d-8460,U+8462,U+8464-8468,U+846a,U+846e-8470,U+8472,U+8474,U+8477,U+8479,U+847b-8481,U+8483-8486,U+848a,U+848d,U+848f-8496,U+8498,U+849a-849b,U+849d-84a0,U+84a2-84ae,U+84b0-84b1,U+84b3,U+84b5-84b7,U+84bb-84bc,U+84be,U+84c0,U+84c2-84c3,U+84c5-84c8,U+84cb-84cc,U+84ce-84cf,U+84d2,U+84d4-84d5,U+84d7-84dc,U+84de,U+84e1-84e2,U+84e4,U+84e7-84eb,U+84ed-84ef,U+84f1-84fb,U+84fd-84fe,U+8500-850b,U+850d-8510,U+8512,U+8514-8516,U+8518-8519,U+851b-851e,U+8520,U+8522-852a,U+852d-8536,U+853e-8542,U+8544-8547,U+854b-854f"}},{uri:i9,descriptors:{unicodeRange:"U+82c2-82c3,U+82c5-82c6,U+82c9,U+82d0,U+82d6,U+82d9-82da,U+82dd,U+82e2,U+82e7-82ea,U+82ec-82ee,U+82f0,U+82f2-82f3,U+82f5-82f6,U+82f8,U+82fa,U+82fc-8300,U+830a-830b,U+830d,U+8310,U+8312-8313,U+8316,U+8318-8319,U+831d-8326,U+8329-832a,U+832e,U+8330,U+8332,U+8337,U+833b,U+833d-833f,U+8341-8342,U+8344-8345,U+8348,U+834a-834e,U+8353,U+8355-8359,U+835d,U+8362,U+8370-8376,U+8379-837a,U+837e-8384,U+8387-8388,U+838a-838d,U+838f-8391,U+8394-8397,U+8399-839a,U+839d,U+839f,U+83a1-83a7,U+83ac-83af,U+83b5,U+83bb,U+83be-83bf,U+83c2-83c4,U+83c6,U+83c8-83c9,U+83cb,U+83cd-83ce,U+83d0-83d3,U+83d5,U+83d7,U+83d9-83db,U+83de,U+83e2-83e4,U+83e6-83e8,U+83eb-83ef,U+83f3-83f7,U+83fa-83fc,U+83fe-8400,U+8402,U+8405,U+8407-840a,U+8410,U+8412-8417,U+8419-841b,U+841e-8423,U+8429-8430,U+8432-8437,U+8439-843b,U+843e-8445,U+8447-8450,U+8452-8455"}},{uri:l9,descriptors:{unicodeRange:"U+81a4-81a5,U+81a7,U+81a9,U+81ab-81b2,U+81b4-81b9,U+81bc-81bf,U+81c4-81c5,U+81c7-81c9,U+81cb,U+81cd-81e2,U+81e4-81e6,U+81e8-81e9,U+81eb,U+81ee-81f2,U+81f5-81fa,U+81fd,U+81ff,U+8203,U+8207-820b,U+820e-820f,U+8211,U+8213,U+8215-821a,U+821d,U+8220,U+8224-8227,U+8229,U+822e,U+8232,U+823a,U+823c-823d,U+823f-8243,U+8245-8246,U+8248,U+824a,U+824c-824e,U+8250-8257,U+8259,U+825b-825e,U+8260-8267,U+8269-826d,U+8271,U+8275-8278,U+827b-827c,U+8280-8281,U+8283,U+8285-8287,U+8289,U+828c,U+8290,U+8293-8296,U+829a-829b,U+829e,U+82a0,U+82a2-82a3,U+82a7,U+82b2,U+82b5-82b6,U+82ba-82bc,U+82bf-82c0"}},{uri:r9,descriptors:{unicodeRange:"U+8059,U+805b-8068,U+806b-8070,U+8072-807e,U+8081-8082,U+8085,U+8088,U+808a,U+808d-8092,U+8094-8095,U+8097,U+8099,U+809e,U+80a3,U+80a6-80a8,U+80ac,U+80b0,U+80b3,U+80b5-80b6,U+80b8-80b9,U+80bb,U+80c5,U+80c7-80cb,U+80cf-80d5,U+80d8,U+80df-80e0,U+80e2-80e3,U+80e6,U+80ee,U+80f5,U+80f7,U+80f9,U+80fb,U+80fe-8101,U+8103-8105,U+8107-8108,U+810b-810c,U+8115,U+8117,U+8119,U+811b-811d,U+811f-812b,U+812d-812e,U+8130,U+8133-8135,U+8137,U+8139-813d,U+813f-8145,U+8147,U+8149,U+814d-814f,U+8152,U+8156-8158,U+815b-815f,U+8161-8164,U+8166,U+8168,U+816a-816c,U+816f,U+8172-8173,U+8175-8178,U+8181,U+8183-8187,U+8189,U+818b-818e,U+8190,U+8192-8197,U+8199-819a,U+819e-81a2"}},{uri:s9,descriptors:{unicodeRange:"U+7f3c-7f41,U+7f43,U+7f46-7f4f,U+7f52-7f53,U+7f56,U+7f59,U+7f5b-7f5e,U+7f60,U+7f63-7f67,U+7f6b-7f6d,U+7f6f-7f70,U+7f73,U+7f75-7f78,U+7f7a-7f7d,U+7f7f-7f80,U+7f82-7f89,U+7f8b,U+7f8d,U+7f8f-7f93,U+7f95-7f99,U+7f9b-7f9c,U+7fa0,U+7fa2-7fa3,U+7fa5-7fa6,U+7fa8-7fae,U+7fb1,U+7fb3-7fb7,U+7fba-7fbb,U+7fbe,U+7fc0,U+7fc2-7fc4,U+7fc6-7fc9,U+7fcb,U+7fcd,U+7fcf-7fd3,U+7fd6-7fd7,U+7fd9-7fde,U+7fe2-7fe4,U+7fe7-7fe8,U+7fea-7fed,U+7fef,U+7ff2,U+7ff4-7ffa,U+7ffd-7fff,U+8002,U+8007-800a,U+800e-800f,U+8011,U+8013,U+801a-801b,U+801d-801f,U+8021,U+8023-8024,U+802b-8030,U+8032,U+8034,U+8039-803a,U+803c,U+803e,U+8040-8041,U+8044-8045,U+8047-8049,U+804e-8051,U+8053,U+8055-8057"}},{uri:o9,descriptors:{unicodeRange:"U+7cd8,U+7cda-7cdb,U+7cdd-7cde,U+7ce1-7ce7,U+7ce9-7cee,U+7cf0-7cf7,U+7cf9-7cfa,U+7cfc-7d09,U+7d0b-7d1f,U+7d21,U+7d23-7d26,U+7d28-7d2a,U+7d2c-7d2e,U+7d30-7d6d,U+7d6f-7d76,U+7d78-7d94"}},{uri:d9,descriptors:{unicodeRange:"U+7afe,U+7b00-7b02,U+7b05,U+7b07,U+7b09,U+7b0c-7b0e,U+7b10,U+7b12-7b13,U+7b16-7b18,U+7b1a,U+7b1c-7b1d,U+7b1f,U+7b21-7b23,U+7b27,U+7b29,U+7b2d,U+7b2f-7b30,U+7b32,U+7b34-7b37,U+7b39,U+7b3b,U+7b3d,U+7b3f-7b44,U+7b46,U+7b48,U+7b4a,U+7b4d-7b4e,U+7b53,U+7b55,U+7b57,U+7b59,U+7b5c,U+7b5e-7b5f,U+7b61,U+7b63-7b6d,U+7b6f-7b70,U+7b73-7b74,U+7b76,U+7b78,U+7b7a,U+7b7c-7b7d,U+7b7f,U+7b81-7b84,U+7b86-7b8c,U+7b8e-7b8f,U+7b91-7b93,U+7b96,U+7b98-7b9b,U+7b9e-7ba0,U+7ba3-7ba5,U+7bae-7bb0,U+7bb2-7bb3,U+7bb5-7bb7,U+7bb9-7bc0,U+7bc2-7bc5,U+7bc8-7bcb,U+7bcd-7bd0,U+7bd2,U+7bd4-7bd8,U+7bdb-7bdc,U+7bde-7be0,U+7be2-7be4,U+7be7-7be9,U+7beb-7bed,U+7bef-7bf0,U+7bf2-7bf6,U+7bf8-7bfb,U+7bfd,U+7bff-7c06,U+7c08-7c0a,U+7c0d-7c0e,U+7c10-7c13"}},{uri:c9,descriptors:{unicodeRange:"U+7a10-7a13,U+7a15-7a16,U+7a18-7a19,U+7a1b-7a1d,U+7a1f,U+7a21-7a22,U+7a24-7a32,U+7a34-7a36,U+7a38,U+7a3a,U+7a3e,U+7a40-7a45,U+7a47-7a50,U+7a52-7a56,U+7a58-7a6f,U+7a71-7a73,U+7a75,U+7a7b-7a7e,U+7a82,U+7a85,U+7a87,U+7a89-7a8c,U+7a8e-7a90,U+7a93-7a94,U+7a99-7a9b,U+7a9e,U+7aa1-7aa4,U+7aa7,U+7aa9-7aab,U+7aae-7ab2,U+7ab4-7abe,U+7ac0-7aca,U+7acc-7ad5,U+7ad7-7ad8,U+7ada-7add,U+7ae1-7ae2,U+7ae4,U+7ae7-7aec,U+7aee,U+7af0-7af8,U+7afb-7afc"}},{uri:h9,descriptors:{unicodeRange:"U+790d-7912,U+7914-791d,U+791f-7923,U+7925-7933,U+7935-7939,U+793d,U+793f,U+7942-7945,U+7947,U+794a-7952,U+7954-7955,U+7958-7959,U+7961,U+7963-7964,U+7966,U+7969-796c,U+796e,U+7970-7976,U+7979,U+797b-797f,U+7982-7983,U+7986-7989,U+798b-798e,U+7990-7999,U+799b-79a6,U+79a8-79b2,U+79b4-79b8,U+79bc,U+79bf,U+79c2,U+79c4-79c5,U+79c7-79c8,U+79ca,U+79cc,U+79ce-79d0,U+79d3-79d4,U+79d6-79d7,U+79d9-79de,U+79e0-79e2,U+79e5,U+79e8,U+79ea,U+79ec,U+79ee,U+79f1-79f7,U+79f9-79fa,U+79fc,U+79fe-79ff,U+7a01,U+7a04-7a05,U+7a07-7a0a,U+7a0c,U+7a0f"}},{uri:u9,descriptors:{unicodeRange:"U+77d8-77da,U+77dd-77e1,U+77e4,U+77e6,U+77e8,U+77ea,U+77ef-77f2,U+77f4-77f5,U+77f7,U+77f9-77fc,U+7803-7808,U+780a-780b,U+780e-7810,U+7813,U+7815,U+7819,U+781b,U+781e,U+7820-7822,U+7824,U+7828,U+782a-782b,U+782e-782f,U+7831-7833,U+7835-7836,U+783d,U+783f,U+7841-7844,U+7846,U+7848-784b,U+784d,U+784f,U+7851,U+7853-7854,U+7858-785c,U+785e-7869,U+786f-7876,U+7878-787b,U+787d-7886,U+7888,U+788a-788b,U+788f-7890,U+7892,U+7894-7896,U+7899,U+789d-789e,U+78a0,U+78a2,U+78a4,U+78a6,U+78a8-78af,U+78b5-78b8,U+78ba-78bd,U+78bf-78c0,U+78c2-78c4,U+78c6-78c8,U+78cc-78cf,U+78d1-78d3,U+78d6-78d8,U+78da-78e7,U+78e9-78eb,U+78ed-78f1,U+78f3,U+78f5-78f6,U+78f8-78f9,U+78fb-7900,U+7902-7904,U+7906-790c"}},{uri:U9,descriptors:{unicodeRange:"U+76af-76b0,U+76b3,U+76b5-76be,U+76c0-76c1,U+76c3-76c4,U+76c7,U+76c9,U+76cb-76cc,U+76d3,U+76d5,U+76d9-76da,U+76dc-76de,U+76e0-76e4,U+76e6-76ed,U+76f0,U+76f3,U+76f5-76f7,U+76fa-76fb,U+76fd,U+76ff-7703,U+7705-7706,U+770a,U+770c,U+770e-7718,U+771b-771e,U+7721,U+7723-7725,U+7727,U+772a-772c,U+772e,U+7730-7734,U+7739,U+773b,U+773d-773f,U+7742,U+7744-7746,U+7748-774f,U+7752-7759,U+775c-7760,U+7764,U+7767,U+7769-776a,U+776d-7778,U+777a-777c,U+7781-7783,U+7786-778b,U+778f-7790,U+7793-779e,U+77a1,U+77a3-77a4,U+77a6,U+77a8,U+77ab,U+77ad-77af,U+77b1-77b2,U+77b4,U+77b6-77ba,U+77bc,U+77be,U+77c0-77cc,U+77ce-77d6"}},{uri:f9,descriptors:{unicodeRange:"U+7589-758a,U+758c-758e,U+7590,U+7593,U+7595,U+7598,U+759b-759c,U+759e,U+75a2,U+75a6-75aa,U+75ad,U+75b6-75b7,U+75ba-75bb,U+75bf-75c1,U+75c6,U+75cb-75cc,U+75ce-75d1,U+75d3,U+75d7,U+75d9-75da,U+75dc-75dd,U+75df-75e1,U+75e5,U+75e9,U+75ec-75ef,U+75f2-75f3,U+75f5-75f8,U+75fa-75fb,U+75fd-75fe,U+7602,U+7604,U+7606-7609,U+760b,U+760d-760f,U+7611-7614,U+7616,U+761a,U+761c-761e,U+7621,U+7623,U+7627-7628,U+762c,U+762e-762f,U+7631-7632,U+7636-7637,U+7639-763b,U+763d,U+7641-7642,U+7644-764b,U+764e-7653,U+7655,U+7657-765b,U+765d,U+765f-7662,U+7664-766a,U+766c-766e,U+7670-7677,U+7679-767a,U+767c,U+767f-7681,U+7683,U+7685,U+7689-768a,U+768c-768d,U+768f-7690,U+7692,U+7694-7695,U+7697-7698,U+769a-76a3,U+76a5-76ad"}},{uri:p9,descriptors:{unicodeRange:"U+7492-749b,U+749d,U+749f-74a6,U+74aa-74b9,U+74bb-74d1,U+74d3-74db,U+74dd,U+74df,U+74e1,U+74e5,U+74e7-74ed,U+74f0-74f3,U+74f5,U+74f8-74fe,U+7500-7503,U+7505-750c,U+750e,U+7510,U+7512,U+7514-7517,U+751b,U+751d-751e,U+7520-7524,U+7526-7527,U+752a,U+752e,U+7534,U+7536,U+7539,U+753c-753d,U+753f,U+7541-7544,U+7546-7547,U+7549-754a,U+754d,U+7550-7553,U+7555-7558,U+755d-7564,U+7567-7569,U+756b-7571,U+7573,U+7575-7577,U+757a-757e,U+7580-7582,U+7584-7585,U+7587-7588"}},{uri:m9,descriptors:{unicodeRange:"U+7372-737d,U+737f-7383,U+7385-7386,U+7388,U+738a,U+738c-738d,U+738f-7390,U+7392-7395,U+7397-739a,U+739c-739e,U+73a0-73a1,U+73a3-73a8,U+73aa,U+73ac-73ad,U+73b1,U+73b4-73b6,U+73b8-73b9,U+73bc-73bf,U+73c1,U+73c3-73c7,U+73cb-73cc,U+73ce,U+73d2-73d8,U+73da-73dd,U+73df,U+73e1-73e4,U+73e6,U+73e8,U+73ea-73ec,U+73ee-73f1,U+73f3-7402,U+7404,U+7407-7408,U+740b-740e,U+7411-7419,U+741c-7421,U+7423-7424,U+7427,U+7429,U+742b,U+742d,U+742f,U+7431-7432,U+7437-743b,U+743d-7440,U+7442-7454,U+7456,U+7458,U+745d,U+7460-746c,U+746e-746f,U+7471-7475,U+7478-747d,U+747f,U+7482,U+7484-7486,U+7488-748a,U+748c-748d,U+748f,U+7491"}},{uri:g9,descriptors:{unicodeRange:"U+7054-705d,U+705f-706a,U+706e,U+7071-7074,U+7077,U+7079-707b,U+707d,U+7081-7084,U+7086-7088,U+708b-708d,U+708f-7091,U+7093,U+7097-7098,U+709a-709b,U+709e-70aa,U+70b0,U+70b2,U+70b4-70b6,U+70ba,U+70be-70bf,U+70c4-70c7,U+70c9,U+70cb-70d7,U+70da,U+70dc-70de,U+70e0-70e3,U+70e5,U+70ea,U+70ee,U+70f0-70f6,U+70f8,U+70fa-70fc,U+70fe-7108,U+710b-710f,U+7111-7112,U+7114,U+7117,U+711b-7125,U+7127-712e,U+7132-7135,U+7137-7144,U+7146-7149,U+714b,U+714d,U+714f-715b,U+715d,U+715f-7163,U+7165,U+7169-716d,U+716f-7171,U+7174-7177"}},{uri:b9,descriptors:{unicodeRange:"U+722e-722f,U+7232-7234,U+723a,U+723c,U+723e,U+7240-7246,U+7249-724b,U+724e-7251,U+7253-7255,U+7257-7258,U+725a,U+725c,U+725e,U+7260,U+7263-7265,U+7268,U+726a-726d,U+7270-7271,U+7273-7274,U+7276-7278,U+727b-727d,U+7282-7283,U+7285-7289,U+728c,U+728e,U+7290-7291,U+7293-729e,U+72a0-72ab,U+72ae,U+72b1-72b3,U+72b5,U+72ba-72c0,U+72c5-72c7,U+72c9-72cc,U+72cf,U+72d1,U+72d3-72d6,U+72d8,U+72da-72dd,U+72df,U+72e2-72e7,U+72ea-72eb,U+72f5-72f6,U+72f9,U+72fd-7300,U+7302,U+7304-7309,U+730b-730d,U+730f-7312,U+7314,U+7318-731a,U+731f-7320,U+7323-7324,U+7326-7328,U+732d,U+732f-7330,U+7332-7333,U+7335-7336,U+733a-733d,U+7340-734c,U+734e-734f,U+7351,U+7353-7356,U+7358-735f,U+7361-736b,U+736e,U+7370-7371"}},{uri:y9,descriptors:{unicodeRange:"U+6ec5-6ec6,U+6ec8-6eca,U+6ecc-6ece,U+6ed0,U+6ed2,U+6ed6,U+6ed8-6ed9,U+6edb-6edd,U+6ee3,U+6ee7,U+6eea-6ef3,U+6ef5-6ef8,U+6efa-6f01,U+6f03-6f05,U+6f07-6f08,U+6f0a-6f0e,U+6f10-6f12,U+6f16-6f1f,U+6f21-6f23,U+6f25-6f28,U+6f2c,U+6f2e,U+6f30,U+6f32,U+6f34-6f35,U+6f37-6f3d,U+6f3f-6f45,U+6f48-6f4a,U+6f4c,U+6f4e-6f57,U+6f59-6f5b,U+6f5d,U+6f5f-6f61,U+6f63-6f65,U+6f67-6f6c,U+6f6f-6f71,U+6f73,U+6f75-6f77,U+6f79,U+6f7b,U+6f7d-6f83,U+6f85-6f87,U+6f8a-6f8b,U+6f8f-6f9b,U+6f9d-6fa0,U+6fa2-6fa6,U+6fa8-6fb1"}},{uri:v9,descriptors:{unicodeRange:"U+6d73,U+6d75-6d76,U+6d79-6d7b,U+6d7d-6d81,U+6d83-6d84,U+6d86-6d87,U+6d8a-6d8b,U+6d8d,U+6d8f-6d90,U+6d92,U+6d96-6d9a,U+6d9c,U+6da2,U+6da5,U+6dac-6dad,U+6db0-6db1,U+6db3-6db4,U+6db6-6db7,U+6db9-6dbe,U+6dc1-6dc3,U+6dc8-6dca,U+6dcd-6dd0,U+6dd2-6dd5,U+6dd7,U+6dda-6ddc,U+6ddf,U+6de2-6de3,U+6de5,U+6de7-6dea,U+6ded,U+6def-6df0,U+6df2,U+6df4-6df6,U+6df8,U+6dfa,U+6dfd-6e04,U+6e06-6e09,U+6e0b,U+6e0f,U+6e12-6e13,U+6e15,U+6e18-6e19,U+6e1b-6e1c,U+6e1e-6e1f,U+6e22,U+6e26-6e28,U+6e2a,U+6e2c,U+6e2e,U+6e30-6e31,U+6e33,U+6e35-6e37,U+6e39,U+6e3b-6e42,U+6e45-6e4c,U+6e4f-6e52,U+6e55,U+6e57,U+6e59-6e5a,U+6e5c-6e5e,U+6e60-6e6a,U+6e6c-6e6d,U+6e6f-6e7d,U+6e80-6e82,U+6e84,U+6e87-6e88,U+6e8a-6e8e,U+6e91-6e97,U+6e99-6e9b,U+6e9d-6e9e,U+6ea0-6ea1,U+6ea3-6ea4,U+6ea6,U+6ea8-6ea9,U+6eab-6eae,U+6eb0,U+6eb3,U+6eb5,U+6eb8-6eb9,U+6ebc,U+6ebe-6ec0,U+6ec3-6ec4"}},{uri:w9,descriptors:{unicodeRange:"U+6bbb-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bca,U+6bcc,U+6bce,U+6bd0-6bd1,U+6bd8,U+6bda,U+6bdc-6be0,U+6be2-6be9,U+6bec-6bee,U+6bf0-6bf2,U+6bf4,U+6bf6-6bf8,U+6bfa-6bfc,U+6bfe-6c04,U+6c08-6c0c,U+6c0e,U+6c12,U+6c17,U+6c1c-6c1e,U+6c20,U+6c23,U+6c25,U+6c2b-6c2d,U+6c31,U+6c33,U+6c36-6c37,U+6c39-6c3c,U+6c3e-6c3f,U+6c43-6c45,U+6c48,U+6c4b-6c4f,U+6c51-6c53,U+6c56,U+6c58-6c5a,U+6c62-6c63,U+6c65-6c67,U+6c6b-6c6f,U+6c71,U+6c73,U+6c75,U+6c77-6c78,U+6c7a-6c7c,U+6c7f-6c80,U+6c84,U+6c87,U+6c8a-6c8b,U+6c8d-6c8e,U+6c91-6c92,U+6c95-6c98,U+6c9a,U+6c9c-6c9e,U+6ca0,U+6ca2,U+6ca8,U+6cac,U+6caf-6cb0,U+6cb4-6cb7,U+6cba,U+6cc0-6cc3,U+6cc6-6cc8,U+6ccb,U+6ccd-6ccf,U+6cd1-6cd2,U+6cd8-6cda,U+6cdc-6cdd,U+6cdf,U+6ce4,U+6ce6-6ce7,U+6ce9,U+6cec-6ced,U+6cf2,U+6cf4,U+6cf9,U+6cff-6d00,U+6d02-6d03,U+6d05-6d06,U+6d08-6d0a,U+6d0d,U+6d0f-6d11,U+6d13-6d16,U+6d18,U+6d1c-6d1d,U+6d1f-6d24,U+6d26,U+6d28-6d29,U+6d2c-6d2d,U+6d2f-6d30,U+6d34,U+6d36-6d38,U+6d3a,U+6d3f-6d40,U+6d42,U+6d44,U+6d49,U+6d4c,U+6d50,U+6d55-6d58,U+6d5b,U+6d5d,U+6d5f,U+6d61-6d62,U+6d64-6d65,U+6d67-6d68,U+6d6b-6d6d,U+6d70-6d72"}},{uri:E9,descriptors:{unicodeRange:"U+6967-696a,U+696c-696d,U+696f-6970,U+6972-6976,U+697a-697b,U+697d-697f,U+6981,U+6983,U+6985,U+698a-698c,U+698e-6993,U+6996-6997,U+6999-699a,U+699d-69a6,U+69a9-69aa,U+69ac,U+69ae-69b0,U+69b2-69b3,U+69b5-69b6,U+69b8-69ba,U+69bc-69c0,U+69c2-69c9,U+69cb,U+69cd,U+69cf,U+69d1-69d3,U+69d5-69da,U+69dc-69de,U+69e1-69ec,U+69ee-69f1,U+69f3-69fc,U+69fe,U+6a00-6a09,U+6a0b-6a16,U+6a19-6a1e,U+6a20,U+6a22-6a27,U+6a29,U+6a2b-6a2e,U+6a30,U+6a32-6a34,U+6a36-6a3c,U+6a3f-6a43,U+6a45-6a46,U+6a48-6a4a"}},{uri:x9,descriptors:{unicodeRange:"U+6830-6831,U+6834-6836,U+683a-683b,U+683f,U+6847,U+684b,U+684d,U+684f,U+6852,U+6856-685f,U+686a,U+686c-6873,U+6875,U+6878-6880,U+6882,U+6884,U+6887-688e,U+6890-6892,U+6894-6896,U+6898-68a1,U+68a3-68a5,U+68a9-68ac,U+68ae,U+68b1-68b2,U+68b4,U+68b6-68bf,U+68c1,U+68c3-68c8,U+68ca,U+68cc,U+68ce-68d1,U+68d3-68d4,U+68d6-68d7,U+68d9,U+68db-68df,U+68e1-68e2,U+68e4-68ed,U+68ef,U+68f2-68f4,U+68f6-68f8,U+68fb,U+68fd-6900,U+6902-6904,U+6906-690a,U+690c,U+690f,U+6911,U+6913-691e,U+6921-6923,U+6925-692c,U+692e-692f,U+6931-6933,U+6935-6938,U+693a-693c,U+693e,U+6940-6941,U+6943-6953,U+6955-6956,U+6958-6959,U+695b-695c,U+695f,U+6961-6962,U+6964-6965"}},{uri:S9,descriptors:{unicodeRange:"U+66b8,U+66ba-66bd,U+66bf-66d8,U+66da,U+66de-66e5,U+66e7-66e8,U+66ea-66ef,U+66f1,U+66f5-66f6,U+66f8,U+66fa-66fb,U+66fd,U+6701-6707,U+670c,U+670e-670f,U+6711-6713,U+6716,U+6718-671a,U+671c,U+671e,U+6720-6725,U+6727,U+6729,U+672e,U+6730,U+6732-6733,U+6736-6739,U+673b-673c,U+673e-673f,U+6741,U+6744-6745,U+6747,U+674a-674b,U+674d,U+6752,U+6754-6755,U+6757-675b,U+675d,U+6762-6764,U+6766-6767,U+676b-676c,U+676e,U+6771,U+6774,U+6776,U+6778-677b,U+677d,U+6780,U+6782-6783,U+6785-6786,U+6788,U+678a,U+678c-678f,U+6791-6794,U+6796,U+6799,U+679b,U+679f-67a1,U+67a4,U+67a6,U+67a9,U+67ac,U+67ae,U+67b1-67b2,U+67b4,U+67b9-67c0,U+67c2,U+67c5-67ce,U+67d5-67d7,U+67db,U+67df,U+67e1,U+67e3-67e4,U+67e6-67e8,U+67ea-67eb,U+67ed-67ee,U+67f2,U+67f5-67fc,U+67fe,U+6801-6804,U+6806,U+680d,U+6810,U+6812,U+6814-6815,U+6818-681c,U+681e-6820,U+6822-6828,U+682b-682f"}},{uri:M9,descriptors:{unicodeRange:"U+6569-656a,U+656d-656f,U+6571,U+6573,U+6575-6576,U+6578-6586,U+6588-658a,U+658d-658f,U+6592,U+6594-6596,U+6598,U+659a,U+659d-659e,U+65a0,U+65a2-65a3,U+65a6,U+65a8,U+65aa,U+65ac,U+65ae,U+65b1-65b8,U+65ba-65bb,U+65be-65c0,U+65c2,U+65c7-65ca,U+65cd,U+65d0-65d1,U+65d3-65d5,U+65d8-65df,U+65e1,U+65e3-65e4,U+65ea-65eb,U+65f2-65f5,U+65f8-65f9,U+65fb-65ff,U+6601,U+6604-6605,U+6607-6609,U+660b,U+660d,U+6610-6612,U+6616-6618,U+661a-661c,U+661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630,U+6632-6633,U+6637-663b,U+663d,U+663f-6640,U+6642,U+6644-664a,U+664d-664e,U+6650-6651,U+6658-6659,U+665b-665e,U+6660,U+6662-6663,U+6665,U+6667,U+6669-666d,U+6671-6673,U+6675,U+6678-6679,U+667b-667d,U+667f-6681,U+6683,U+6685-6686,U+6688-668b,U+668d-6690,U+6692-6695,U+6698-669c,U+669e-66a6,U+66a9-66ad,U+66af-66b3,U+66b5-66b7"}},{uri:C9,descriptors:{unicodeRange:"U+5f30,U+5f32-5f38,U+5f3b,U+5f3d-5f3f,U+5f41-5f4f,U+5f51,U+5f54,U+5f59-5f5c,U+5f5e-5f60,U+5f63,U+5f65,U+5f67-5f68,U+5f6b,U+5f6e-5f6f,U+5f72,U+5f74-5f76,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f83,U+5f86,U+5f8d-5f8f,U+5f91,U+5f93-5f94,U+5f96,U+5f9a-5f9b,U+5f9d-5fa0,U+5fa2-5fa7,U+5fa9,U+5fab-5fac,U+5faf-5fb4,U+5fb6,U+5fb8-5fbb,U+5fbe-5fc2,U+5fc7-5fc8,U+5fca-5fcb,U+5fce,U+5fd3-5fd5,U+5fda-5fdc,U+5fde-5fdf,U+5fe2-5fe3,U+5fe5-5fe6,U+5fe8-5fe9,U+5fec,U+5fef-5ff0,U+5ff2-5ff4,U+5ff6-5ff7,U+5ff9-5ffa,U+5ffc,U+6007-6009,U+600b-600c,U+6010-6011,U+6013,U+6017-6018,U+601a,U+601e-601f,U+6022-6024,U+602c-602e,U+6030-6034,U+6036-603a,U+603d-603e,U+6040,U+6044-604a,U+604c,U+604e-604f,U+6051,U+6053-6054,U+6056-6058,U+605b-605c,U+605e-6061,U+6065-6066,U+606e,U+6071-6072,U+6074-6075,U+6077,U+607e,U+6080-6082,U+6085-6088,U+608a-608b,U+608e-6091,U+6093,U+6095,U+6097-6099,U+609c,U+609e,U+60a1-60a2,U+60a4-60a5,U+60a7,U+60a9-60aa,U+60ae,U+60b0,U+60b3,U+60b5-60b7,U+60b9-60ba,U+60bd-60c4,U+60c7-60c9,U+60cc"}},{uri:k9,descriptors:{unicodeRange:"U+635a-635d,U+6360,U+6364-6366,U+6368,U+636a-636c,U+636f-6370,U+6372-6375,U+6378-6379,U+637c-637f,U+6381,U+6383-6386,U+638b,U+638d,U+6391,U+6393-6395,U+6397,U+6399-639f,U+63a1,U+63a4,U+63a6,U+63ab,U+63af,U+63b1-63b2,U+63b5-63b6,U+63b9,U+63bb,U+63bd,U+63bf-63c3,U+63c5,U+63c7-63c8,U+63ca-63cc,U+63d1,U+63d3-63d5,U+63d7-63dd,U+63df,U+63e2,U+63e4-63e8,U+63eb-63ec,U+63ee-63f1,U+63f3,U+63f5,U+63f7,U+63f9-63fc,U+63fe,U+6403-6404,U+6406-640a,U+640d-640e,U+6411-6412,U+6415-641a,U+641d,U+641f,U+6422-6425,U+6427-6429,U+642b,U+642e-6433,U+6435-6439,U+643b-643c,U+643e,U+6440,U+6442-6443,U+6449,U+644b-6451,U+6453,U+6455-6457,U+6459-645d,U+645f-6466,U+6468,U+646a-646c,U+646e-6477,U+647b-6481,U+6483,U+6486,U+6488-648f"}},{uri:I9,descriptors:{unicodeRange:"U+61c5-61c7,U+61c9,U+61cc-61d0,U+61d3,U+61d5-61e5,U+61e7-61f4,U+61f6-61fe,U+6200-6205,U+6207,U+6209,U+6213-6214,U+6219,U+621c-621e,U+6220,U+6223,U+6226-6229,U+622b,U+622d,U+622f-6232,U+6235-6236,U+6238-623c,U+6242,U+6244-6246,U+624a,U+624f-6250,U+6255-6257,U+6259-625a,U+625c-6262,U+6264-6265,U+6268,U+6271-6272,U+6274-6275,U+6277-6278,U+627a-627b,U+627d,U+6281-6283,U+6285-6288,U+628b-6290,U+6294,U+6299,U+629c-629e,U+62a3,U+62a6-62a7,U+62a9-62aa,U+62ad-62b0,U+62b2-62b4,U+62b6-62b8,U+62ba,U+62be,U+62c0-62c1,U+62c3,U+62cb,U+62cf,U+62d1,U+62d5,U+62dd-62de,U+62e0-62e1,U+62e4,U+62ea-62eb,U+62f0,U+62f2,U+62f5,U+62f8-62fb,U+6300,U+6303-6306,U+630a-630d,U+630f-6310,U+6312-6315,U+6317-6319,U+631c,U+6326-6327,U+6329,U+632c-632e,U+6330-6331,U+6333-6338,U+633b-633c,U+633e-6341,U+6344,U+6347-6348,U+634a,U+6351-6354,U+6356-6359"}},{uri:T9,descriptors:{unicodeRange:"U+5dd0-5dda,U+5ddc,U+5ddf-5de0,U+5de3-5de4,U+5dea,U+5dec-5ded,U+5df0,U+5df5-5df6,U+5df8-5dfc,U+5dff-5e00,U+5e04,U+5e07,U+5e09-5e0b,U+5e0d-5e0e,U+5e12-5e13,U+5e17,U+5e1e-5e25,U+5e28-5e2c,U+5e2f-5e30,U+5e32-5e36,U+5e39-5e3a,U+5e3e-5e41,U+5e43,U+5e46-5e4b,U+5e4d-5e53,U+5e56-5e5a,U+5e5c-5e5d,U+5e5f-5e60,U+5e63-5e71,U+5e75,U+5e77,U+5e79,U+5e7e,U+5e81-5e83,U+5e85,U+5e88-5e89,U+5e8c-5e8e,U+5e92,U+5e98,U+5e9b,U+5e9d,U+5ea1-5ea4,U+5ea8-5eac,U+5eae-5eb2,U+5eb4,U+5eba-5ebd,U+5ebf-5ec8,U+5ecb-5ed0,U+5ed4-5ed5,U+5ed7-5eda,U+5edc-5ee7,U+5ee9,U+5eeb-5ef3,U+5ef5,U+5ef8-5ef9,U+5efb-5efd,U+5f05-5f07,U+5f09,U+5f0c-5f0e,U+5f10,U+5f12,U+5f14,U+5f16,U+5f19-5f1a,U+5f1c-5f1e,U+5f21-5f24,U+5f28,U+5f2b-5f2c,U+5f2e"}},{uri:L9,descriptors:{unicodeRange:"U+60cd-60d0,U+60d2-60d4,U+60d6-60d7,U+60d9,U+60db,U+60de,U+60e1-60e5,U+60ea,U+60f1-60f2,U+60f5,U+60f7-60f8,U+60fb-60ff,U+6102-6105,U+6107,U+610a-610c,U+6110-6114,U+6116-6119,U+611b-611e,U+6121-6122,U+6125,U+6128-612a,U+612c-613e,U+6140-6147,U+6149,U+614b,U+614d,U+614f-6150,U+6152-6154,U+6156-615c,U+615e-6161,U+6163-6166,U+6169-616f,U+6171-6174,U+6176,U+6178-618a,U+618c-618d,U+618f-6193,U+6195-619c,U+619e-61a6,U+61aa-61ab,U+61ad-61b6,U+61b8-61bd,U+61bf-61c1,U+61c3-61c4"}},{uri:D9,descriptors:{unicodeRange:"U+5cf4-5cfa,U+5cfc-5d01,U+5d04-5d05,U+5d08-5d0d,U+5d0f-5d13,U+5d15,U+5d17-5d1a,U+5d1c-5d1d,U+5d1f-5d23,U+5d25,U+5d28,U+5d2a-5d2c,U+5d2f-5d33,U+5d35-5d3c,U+5d3f-5d46,U+5d48-5d49,U+5d4d-5d57,U+5d59-5d5a,U+5d5c,U+5d5e-5d68,U+5d6a,U+5d6d-5d6e,U+5d70-5d73,U+5d75-5d81,U+5d83-5d98,U+5d9a-5d9c,U+5d9e-5db6,U+5db8-5dc4,U+5dc6-5dcc,U+5dce-5dcf"}},{uri:A9,descriptors:{unicodeRange:"U+5b52,U+5b56,U+5b5e,U+5b60-5b61,U+5b67-5b68,U+5b6b,U+5b6d-5b6f,U+5b72,U+5b74,U+5b76-5b79,U+5b7b-5b7c,U+5b7e-5b7f,U+5b82,U+5b86,U+5b8a,U+5b8d-5b8e,U+5b90-5b92,U+5b94,U+5b96,U+5b9f,U+5ba7-5ba9,U+5bac-5baf,U+5bb1-5bb2,U+5bb7,U+5bba-5bbc,U+5bc0-5bc1,U+5bc3,U+5bc8-5bcb,U+5bcd-5bcf,U+5bd1,U+5bd4-5bdc,U+5be0,U+5be2-5be3,U+5be6-5be7,U+5be9-5bed,U+5bef,U+5bf1-5bf7,U+5bfd-5bfe,U+5c00,U+5c02-5c03,U+5c05,U+5c07-5c08,U+5c0b-5c0e,U+5c10,U+5c12-5c13,U+5c17,U+5c19,U+5c1b,U+5c1e-5c21,U+5c23,U+5c26,U+5c28-5c2b,U+5c2d-5c30,U+5c32-5c33,U+5c35-5c37,U+5c43-5c44,U+5c46-5c47,U+5c4c-5c4d,U+5c52-5c54,U+5c56-5c58,U+5c5a-5c5d,U+5c5f,U+5c62,U+5c64,U+5c67-5c6d,U+5c70,U+5c72-5c78,U+5c7b-5c7e,U+5c80,U+5c83-5c87,U+5c89-5c8b,U+5c8e-5c8f,U+5c92-5c93,U+5c95,U+5c9d-5ca1,U+5ca4-5ca8,U+5caa,U+5cae-5cb0,U+5cb2,U+5cb4,U+5cb6,U+5cb9-5cbc,U+5cbe,U+5cc0,U+5cc2-5cc3,U+5cc5-5cca,U+5ccc-5cd1,U+5cd3-5cd8,U+5cda-5ce0,U+5ce2-5ce3,U+5ce7,U+5ce9,U+5ceb-5cec,U+5cee-5cef,U+5cf1-5cf3"}},{uri:R9,descriptors:{unicodeRange:"U+593b,U+593d-5940,U+5943,U+5945-5946,U+594a,U+594c-594d,U+5950,U+5952-5953,U+5959,U+595b-595f,U+5961,U+5963-5964,U+5966-5972,U+5975,U+5977,U+597a-597c,U+597e-5980,U+5985,U+5989,U+598b-598c,U+598e-5991,U+5994-5995,U+5998,U+599a-599d,U+599f-59a2,U+59a6-59a7,U+59ac-59ad,U+59b0-59b1,U+59b3-59b8,U+59ba,U+59bc-59bd,U+59bf-59c5,U+59c7-59c9,U+59cc-59cf,U+59d5-59d6,U+59d9,U+59db,U+59de-59e2,U+59e4,U+59e6-59e7,U+59e9-59eb,U+59ed-59f8,U+59fa,U+59fc-59fe,U+5a00,U+5a02,U+5a0a-5a0b,U+5a0d-5a10,U+5a12,U+5a14-5a17,U+5a19-5a1b,U+5a1d-5a1e,U+5a21-5a22,U+5a24,U+5a26-5a28,U+5a2a-5a30,U+5a33,U+5a35,U+5a37-5a3b,U+5a3d-5a3f,U+5a41-5a45,U+5a47-5a48,U+5a4b-5a54,U+5a56-5a59,U+5a5b-5a61,U+5a63-5a66,U+5a68-5a69,U+5a6b-5a73,U+5a78-5a79,U+5a7b-5a7e,U+5a80-5a90"}},{uri:N9,descriptors:{unicodeRange:"U+5a91,U+5a93-5a99,U+5a9c-5aa9,U+5aab-5ab1,U+5ab4,U+5ab6-5ab7,U+5ab9-5abd,U+5abf-5ac0,U+5ac3-5ac8,U+5aca-5acb,U+5acd-5ad1,U+5ad3,U+5ad5,U+5ad7,U+5ad9-5adb,U+5add-5adf,U+5ae2,U+5ae4-5ae5,U+5ae7-5ae8,U+5aea,U+5aec-5af0,U+5af2-5b08,U+5b0a-5b15,U+5b18-5b31,U+5b33,U+5b35-5b36,U+5b38-5b3f,U+5b41-5b4f"}},{uri:P9,descriptors:{unicodeRange:"U+5843,U+5845-584b,U+584e-5850,U+5852-5853,U+5855-5857,U+5859-585d,U+585f-5864,U+5866-586a,U+586d-587d,U+587f,U+5882,U+5884,U+5886-5888,U+588a-5891,U+5894-5898,U+589b-589d,U+58a0-58a7,U+58aa-58bb,U+58bd-58c0,U+58c2-58c4,U+58c6-58d0,U+58d2-58d4,U+58d6-58e3,U+58e5-58ea,U+58ed,U+58ef,U+58f1-58f2,U+58f4-58f5,U+58f7-58f8,U+58fa-5901,U+5903,U+5905-5906,U+5908-590c,U+590e,U+5910-5913,U+5917-5918,U+591b,U+591d-591e,U+5920-5923,U+5926,U+5928,U+592c,U+5930,U+5932-5933,U+5935-5936"}},{uri:_9,descriptors:{unicodeRange:"U+56d0-56d3,U+56d5-56d6,U+56d8-56d9,U+56dc,U+56e3,U+56e5-56ea,U+56ec,U+56ee-56ef,U+56f2-56f3,U+56f6-56f8,U+56fb-56fc,U+5700-5702,U+5705,U+5707,U+570b-571b,U+571d-571e,U+5720-5722,U+5724-5727,U+572b,U+5731-5732,U+5734-5738,U+573c-573d,U+573f,U+5741,U+5743-5746,U+5748-5749,U+574b,U+5752-5756,U+5758-5759,U+5762-5763,U+5765,U+5767,U+576c,U+576e,U+5770-5772,U+5774-5775,U+5778-577a,U+577d-5781,U+5787-578a,U+578d-5791,U+5794-579a,U+579c-579f,U+57a5,U+57a8,U+57aa,U+57ac,U+57af-57b1,U+57b3,U+57b5-57b7,U+57b9-57c1,U+57c4-57ca,U+57cc-57cd,U+57d0-57d1,U+57d3,U+57d6-57d7,U+57db-57dc,U+57de,U+57e1-57e3,U+57e5-57ec,U+57ee,U+57f0-57f3,U+57f5-57f7,U+57fb-57fc,U+57fe-57ff,U+5801,U+5803-5805,U+5808-580a,U+580c,U+580e-5810,U+5812-5814,U+5816-5818,U+581a-581d,U+581f,U+5822-5823,U+5825-5829,U+582b-582f,U+5831-5834,U+5836-5842"}},{uri:O9,descriptors:{unicodeRange:"U+55f9-55fc,U+55ff,U+5602-5607,U+560a-560b,U+560d,U+5610-5617,U+5619-561a,U+561c-561d,U+5620-5622,U+5625-5626,U+5628-562b,U+562e-5630,U+5633,U+5635,U+5637-5638,U+563a,U+563c-563e,U+5640-564b,U+564f-5653,U+5655-5656,U+565a-565b,U+565d-5661,U+5663,U+5665-5667,U+566d-5670,U+5672-5675,U+5677-567a,U+567d-5684,U+5687-568d,U+5690-5692,U+5694-56a2,U+56a4-56ae,U+56b0-56b6,U+56b8-56bb,U+56bd-56c9,U+56cb-56cf"}},{uri:B9,descriptors:{unicodeRange:"U+5286-5287,U+5289-528f,U+5291-5292,U+5294-529a,U+529c,U+52a4-52a7,U+52ae-52b0,U+52b4-52bd,U+52c0-52c2,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cf,U+52d1,U+52d3-52d5,U+52d7,U+52d9-52de,U+52e0-52e3,U+52e5-52ef,U+52f1-52f8,U+52fb-52fd,U+5301-5304,U+5307,U+5309-530c,U+530e,U+5311-5314,U+5318,U+531b-531c,U+531e-531f,U+5322,U+5324-5325,U+5327-5329,U+532b-532d,U+532f-5338,U+533c-533d,U+5340,U+5342,U+5344,U+5346,U+534b-534d,U+5350,U+5354,U+5358-5359,U+535b,U+535d,U+5365,U+5368,U+536a,U+536c-536d,U+5372,U+5376,U+5379,U+537b-537e,U+5380-5381,U+5383,U+5387-5388,U+538a,U+538e-5394,U+5396-5397,U+5399,U+539b-539c,U+539e,U+53a0-53a1,U+53a4,U+53a7,U+53aa-53ad,U+53af-53b5,U+53b7-53ba,U+53bc-53be,U+53c0,U+53c3-53c7,U+53ce-53d0,U+53d2-53d3,U+53d5,U+53da,U+53dc-53de,U+53e1-53e2,U+53e7,U+53f4,U+53fa,U+53fe-5400,U+5402,U+5405,U+5407,U+540b,U+5414,U+5418-541a,U+541c,U+5422,U+5424-5425,U+542a,U+5430,U+5433,U+5436-5437,U+543a"}},{uri:z9,descriptors:{unicodeRange:"U+5101-5105,U+5108-510a,U+510c-5111,U+5113-5120,U+5122-513e,U+5142,U+5147,U+514a,U+514c,U+514e-5150,U+5152-5153,U+5157-5159,U+515b,U+515d-5161,U+5163-5164,U+5166-5167,U+5169-516a,U+516f,U+5172,U+517a,U+517e-517f,U+5183-5184,U+5186-5187,U+518a-518b,U+518e-5191,U+5193-5194,U+5198,U+519a,U+519d-519f,U+51a1,U+51a3,U+51a6-51aa,U+51ad-51ae,U+51b4,U+51b8-51ba,U+51be-51bf,U+51c1-51c3,U+51c5,U+51c8,U+51ca,U+51cd-51ce,U+51d0,U+51d2-51da,U+51dc,U+51de-51df,U+51e2-51e3,U+51e5-51ea,U+51ec,U+51ee,U+51f1-51f2,U+51f4,U+51f7,U+51fe,U+5204-5205,U+5209,U+520b-520c,U+520f-5210,U+5213-5215,U+521c,U+521e-521f,U+5221-5223,U+5225-5227,U+522a,U+522c,U+522f,U+5231-5232,U+5234-5235,U+523c,U+523e,U+5244-5249,U+524b,U+524e-524f,U+5252-5253,U+5255,U+5257-525b,U+525d,U+525f-5260,U+5262-5264,U+5266,U+5268,U+526b-526e,U+5270-5271,U+5273-527c,U+527e,U+5280,U+5283-5285"}},{uri:F9,descriptors:{unicodeRange:"U+543d,U+543f,U+5441-5442,U+5444-5445,U+5447,U+5449,U+544c-544f,U+5451,U+545a,U+545d-5461,U+5463,U+5465,U+5467,U+5469-5470,U+5474,U+5479-547a,U+547e-547f,U+5481,U+5483,U+5485,U+5487-548a,U+548d,U+5491,U+5493,U+5497-5498,U+549c,U+549e-54a2,U+54a5,U+54ae,U+54b0,U+54b2,U+54b5-54b7,U+54b9-54ba,U+54bc,U+54be,U+54c3,U+54c5,U+54ca-54cb,U+54d6,U+54d8,U+54db,U+54e0-54e4,U+54eb-54ec,U+54ef-54f1,U+54f4-54f9,U+54fb,U+54fe,U+5500,U+5502-5505,U+5508,U+550a-550e,U+5512-5513,U+5515-551a,U+551c-551f,U+5521,U+5525-5526,U+5528-5529,U+552b,U+552d,U+5532,U+5534-5536,U+5538-553b,U+553d,U+5540,U+5542,U+5545,U+5547-5548,U+554b-554f,U+5551-5554,U+5557-555b,U+555d-5560,U+5562-5563,U+5568-5569,U+556b,U+556f-5574,U+5579-557a,U+557d,U+557f,U+5585-5586,U+558c-558e,U+5590,U+5592-5593,U+5595-5597,U+559a-559b,U+559e,U+55a0-55a6,U+55a8-55b0,U+55b2,U+55b4,U+55b6,U+55b8,U+55ba,U+55bc,U+55bf-55c3,U+55c6-55c8,U+55ca-55cb,U+55ce-55d0,U+55d5,U+55d7-55db,U+55de,U+55e0,U+55e2,U+55e7,U+55e9,U+55ed-55ee,U+55f0-55f1,U+55f4,U+55f6,U+55f8"}},{uri:$9,descriptors:{unicodeRange:"U+4fe0,U+4fe2,U+4fe4-4fe5,U+4fe7,U+4feb-4fec,U+4ff0,U+4ff2,U+4ff4-4ff7,U+4ff9,U+4ffb-4ffd,U+4fff-500b,U+500e,U+5010-5011,U+5013,U+5015-5017,U+501b,U+501d-501e,U+5020,U+5022-5024,U+5027,U+502b,U+502f-5039,U+503b,U+503d,U+503f-5042,U+5044-5046,U+5049-504b,U+504d,U+5050-5054,U+5056-5059,U+505b,U+505d-5064,U+5066-506b,U+506d-5075,U+5078-507a,U+507c-507d,U+5081-5084,U+5086-5087,U+5089-508c,U+508e-50a2,U+50a4,U+50a6,U+50aa-50ab,U+50ad-50b1,U+50b3-50b9,U+50bc-50ce,U+50d0-50d5,U+50d7-50d9,U+50db-50e5,U+50e8-50eb,U+50ef-50f2,U+50f4,U+50f6-50fa,U+50fc-5100"}},{uri:H9,descriptors:{unicodeRange:"U+49d5-4a77"}},{uri:X9,descriptors:{unicodeRange:"U+4dac-4dad,U+4daf-4db5,U+4e02,U+4e04-4e06,U+4e0f,U+4e12,U+4e17,U+4e1f-4e21,U+4e23,U+4e26,U+4e29,U+4e2e-4e2f,U+4e31,U+4e33,U+4e35,U+4e37,U+4e3c,U+4e40-4e42,U+4e44,U+4e46,U+4e4a,U+4e51,U+4e55,U+4e57,U+4e5a-4e5b,U+4e62-4e65,U+4e67-4e68,U+4e6a-4e6f,U+4e72,U+4e74-4e7d,U+4e7f-4e85,U+4e87,U+4e8a,U+4e90,U+4e96-4e97,U+4e99,U+4e9c-4e9e,U+4ea3,U+4eaa,U+4eaf-4eb1,U+4eb4,U+4eb6-4eb9,U+4ebc-4ebe,U+4ec8,U+4ecc,U+4ecf-4ed0,U+4ed2,U+4eda-4edc,U+4ee0,U+4ee2,U+4ee6-4ee7,U+4ee9,U+4eed-4eef,U+4ef1,U+4ef4,U+4ef8-4efa,U+4efc,U+4efe,U+4f00,U+4f02-4f08,U+4f0b-4f0c,U+4f12-4f16,U+4f1c-4f1d,U+4f21,U+4f23,U+4f28-4f29,U+4f2c-4f2e,U+4f31,U+4f33,U+4f35,U+4f37,U+4f39,U+4f3b,U+4f3e-4f42,U+4f44-4f45,U+4f47-4f4c,U+4f52,U+4f54,U+4f56,U+4f61-4f62,U+4f66,U+4f68,U+4f6a-4f6b,U+4f6d-4f6e,U+4f71-4f72,U+4f75,U+4f77-4f7a,U+4f7d,U+4f80-4f82,U+4f85-4f87,U+4f8a,U+4f8c,U+4f8e,U+4f90,U+4f92-4f93,U+4f95-4f96,U+4f98-4f9a,U+4f9c,U+4f9e-4f9f,U+4fa1-4fa2,U+4fa4,U+4fab,U+4fad,U+4fb0-4fb4,U+4fb6-4fbe,U+4fc0-4fc2,U+4fc6-4fc9,U+4fcb-4fcd,U+4fd2-4fd6,U+4fd9,U+4fdb"}},{uri:W9,descriptors:{unicodeRange:"U+4933-49d4"}},{uri:G9,descriptors:{unicodeRange:"U+487a-4932"}},{uri:V9,descriptors:{unicodeRange:"U+47d2-4879,U+2ce7c,U+2ce88,U+2ce93"}},{uri:Y9,descriptors:{unicodeRange:"U+4756-47d1,U+2ca02,U+2ca0e,U+2ca7d,U+2caa9,U+2cb29,U+2cb2e,U+2cb31,U+2cb38-2cb39,U+2cb3f,U+2cb41,U+2cb4e,U+2cb5a,U+2cb64,U+2cb69,U+2cb6c,U+2cb6f,U+2cb76,U+2cb78,U+2cb7c,U+2cbb1,U+2cbbf-2cbc0,U+2cbce,U+2cc5f,U+2ccf5-2ccf6,U+2ccfd,U+2ccff,U+2cd02-2cd03,U+2cd0a,U+2cd8b,U+2cd8d,U+2cd8f-2cd90,U+2cd9f-2cda0,U+2cda8,U+2cdad-2cdae,U+2cdd5,U+2ce18,U+2ce1a,U+2ce23,U+2ce26,U+2ce2a"}},{uri:j9,descriptors:{unicodeRange:"U+46c3-4755,U+2c488,U+2c494,U+2c497,U+2c542,U+2c613,U+2c618,U+2c621,U+2c629,U+2c62b-2c62d,U+2c62f,U+2c642,U+2c64a-2c64b,U+2c72c,U+2c72f,U+2c79f,U+2c7c1,U+2c7fd,U+2c8d9,U+2c8de,U+2c8e1,U+2c8f3,U+2c907,U+2c90a,U+2c91d"}},{uri:Z9,descriptors:{unicodeRange:"U+4629-46c2,U+2bdf7,U+2be29,U+2c029-2c02a,U+2c0a9,U+2c0ca,U+2c1d5,U+2c1d9,U+2c1f9,U+2c27c,U+2c288,U+2c2a4,U+2c317,U+2c35b,U+2c361,U+2c364"}},{uri:K9,descriptors:{unicodeRange:"U+458e-4628,U+2b7a9,U+2b7c5,U+2b7e6,U+2b7f9,U+2b806,U+2b80a,U+2b81c,U+2b8b8,U+2bac7,U+2bb5f,U+2bb62,U+2bb7c,U+2bb83,U+2bc1b,U+2bd77,U+2bd87"}},{uri:q9,descriptors:{unicodeRange:"U+4449-4511,U+2afa2,U+2b127-2b128,U+2b137-2b138,U+2b1ed"}},{uri:J9,descriptors:{unicodeRange:"U+439b-4448,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a7dd,U+2a8fb,U+2a917,U+2aa30,U+2aa36,U+2aa58"}},{uri:Q9,descriptors:{unicodeRange:"U+4275-430d,U+298c6,U+29a72,U+29d98,U+29ddb,U+29e15,U+29e3d,U+29e49"}},{uri:ey,descriptors:{unicodeRange:"U+4132-41de,U+28bef,U+28c47,U+28c4f,U+28c51,U+28c54,U+28d10,U+28d71,U+28dfb,U+28e1f,U+28e36,U+28e89,U+28e99,U+28eeb,U+28f32,U+28ff8,U+292a0"}},{uri:ty,descriptors:{unicodeRange:"U+41df-4274,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750"}},{uri:ay,descriptors:{unicodeRange:"U+408e-4131,U+285c8-285c9,U+28678,U+28695,U+286d7,U+286fa,U+287e0,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28b49,U+28bc1"}},{uri:ny,descriptors:{unicodeRange:"U+3e83-3f2f,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752"}},{uri:iy,descriptors:{unicodeRange:"U+3f30-3fdb,U+27985,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27cb8,U+27da0,U+27e10"}},{uri:ly,descriptors:{unicodeRange:"U+3fdc-408d,U+27fb7,U+27ff9,U+2808a,U+280bb,U+2815d,U+28277,U+28282,U+282e2,U+282f3,U+283cd,U+28408,U+2840c,U+28455,U+28468,U+2856b"}},{uri:ry,descriptors:{unicodeRange:"U+3dd2-3e82,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26b5c,U+26c21,U+26c29,U+26c73,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d"}},{uri:sy,descriptors:{unicodeRange:"U+3d34-3dd1,U+2648d,U+26676,U+2667e,U+266b0,U+2671d,U+2677c,U+267cc,U+268dd,U+268ea,U+26951,U+2696f,U+269dd,U+269fa,U+26a1e"}},{uri:oy,descriptors:{unicodeRange:"U+3c76-3d33,U+25d0a,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed7-25ed8,U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26221,U+26270,U+26286,U+2634c,U+26402"}},{uri:dy,descriptors:{unicodeRange:"U+3bda-3c75,U+25771,U+257a9,U+257b4,U+259c4,U+259d4,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c14,U+25c4b,U+25c64"}},{uri:cy,descriptors:{unicodeRange:"U+3b25-3bd9,U+2504a,U+25055,U+25122,U+2512b,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+25532,U+25562,U+255a7-255a8"}},{uri:hy,descriptors:{unicodeRange:"U+3a6b-3b24,U+24896,U+249db,U+24a4d,U+24a7d,U+24ac9,U+24b56,U+24b6f,U+24c16,U+24d14,U+24dea,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24eaa"}},{uri:uy,descriptors:{unicodeRange:"U+39a9-3a6a,U+24096,U+24103,U+241ac,U+241c6,U+241fe,U+243bc,U+243f8,U+244d3,U+24629,U+246a5,U+247f1"}},{uri:Uy,descriptors:{unicodeRange:"U+38e3-39a8,U+23a98,U+23c7f,U+23c97-23c98,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23e23,U+23f7e"}},{uri:fy,descriptors:{unicodeRange:"U+3760-382a,U+22ab8,U+22b43,U+22b46,U+22b4f-22b50,U+22ba6,U+22bca,U+22c1d,U+22c24,U+22c55,U+22d4c,U+22de1"}},{uri:py,descriptors:{unicodeRange:"U+382b-38e2,U+231b6,U+231c3-231c4,U+231f5,U+23350,U+23372,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+235cb,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237ff,U+23824,U+2383d"}},{uri:my,descriptors:{unicodeRange:"U+3698-375f,U+22218,U+2231e,U+223ad,U+224dc,U+226f3,U+2285b,U+228ab,U+2298f"}},{uri:gy,descriptors:{unicodeRange:"U+35e6-3697,U+21c56,U+21cde,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b"}},{uri:by,descriptors:{unicodeRange:"U+3444-350e,U+20ad3,U+20b1d,U+20b9f,U+20c41,U+20cbf,U+20cd0,U+20d45,U+20de1,U+20e64,U+20e6d,U+20e95,U+20e9d,U+20ea2,U+20f5f,U+210c1,U+21201,U+2123d,U+21255,U+21274,U+2127b"}},{uri:yy,descriptors:{unicodeRange:"U+350f-35e5,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+2139a,U+213c4,U+21413,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3"}},{uri:vy,descriptors:{unicodeRange:"U+336d-3443,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+20547,U+205d6,U+20628,U+20676,U+2074f,U+20779,U+20807,U+2083a,U+20895,U+208b9,U+2097c,U+2099d"}},{uri:wy,descriptors:{unicodeRange:"U+328b-336c,U+2000b,U+20089,U+200a2,U+200a4,U+20164,U+201a2,U+20213"}},{uri:Ey,descriptors:{unicodeRange:"U+3192-31ba,U+31c0-31e3,U+31f0-321e,U+3220-328a,U+1f250-1f251"}},{uri:xy,descriptors:{unicodeRange:"U+2f74-2fd5,U+3000,U+3003-3007,U+3012-3013,U+3018-301c,U+3020-3029,U+302f-303f,U+3041-3096,U+3099-30a1"}},{uri:Sy,descriptors:{unicodeRange:"U+30a2-30ff,U+3105-312f,U+3131-318e,U+3190-3191"}},{uri:My,descriptors:{unicodeRange:"U+4e36,U+4ea0,U+4f74,U+4f91,U+4f94,U+4fc5,U+507e,U+50ed,U+5182,U+51f5,U+525e,U+5282,U+52f9,U+5326,U+537a,U+53a3,U+5423,U+5459,U+54b4,U+54d9,U+55c9,U+57f4,U+580b,U+5902,U+5925,U+5a08,U+5ab5,U+5b84,U+5be4,U+5c22,U+5cb5,U+5cbd,U+5d3e,U+5e31,U+5e5e,U+5e80,U+5ee8,U+5f82,U+5fc9,U+5fed,U+600a,U+605d,U+609b,U+609d,U+60dd,U+6243,U+6322,U+63ce,U+640c,U+643f,U+6445,U+64d7,U+6534,U+6549,U+656b,U+6603,U+674c,U+680a,U+6864,U+69d4,U+6a65,U+6c2a,U+6c46,U+6c5c,U+6d0e,U+6d48,U+6e2b,U+6eb2,U+6eb7,U+6f89,U+706c,U+70b1,U+7113,U+71d4,U+727f,U+72f3,U+7303,U+7321,U+736c,U+736f,U+74a9,U+74de,U+750d,U+7513,U+7592,U+75c4,U+7605,U+760a,U+761b,U+7625,U+762d,U+7643,U+7707,U+7747,U+77b5,U+7839,U+784e,U+78a5,U+7924,U+793b,U+798a,U+7a03,U+7a06,U+7a78,U+7a80,U+7aad,U+7ba8,U+7be5,U+7cc8,U+7ec1,U+7f0b,U+7f0f,U+7f12,U+7f68,U+7f9d,U+8025,U+809c,U+80ad,U+80b7,U+80e8,U+811e,U+8204,U+8223,U+822d,U+823b,U+824b,U+825a,U+827d,U+827f,U+828f,U+82c8,U+8307,U+831b,U+8347,U+837d,U+839b,U+83a9,U+83f9,U+84b9,U+8579,U+864d,U+867f,U+86b0,U+86d1,U+86d8,U+86f2,U+8764,U+8770,U+8788,U+8797,U+87ac-87ad,U+87b5,U+881b,U+8844,U+88bc,U+88fc,U+8930,U+89cf,U+89d6,U+8ba0,U+8bd4,U+8c02,U+8c2b,U+8c85,U+8e23,U+8f81-8f82,U+8fd5,U+90b6,U+90db,U+914e,U+9164,U+91ad,U+943e,U+94b7-94b8,U+94eb,U+950d,U+9514,U+9516,U+9518,U+9529,U+9538,U+953f,U+954e,U+955f,U+95fc,U+9667,U+96b3,U+9792,U+97b2,U+98a1,U+9969,U+9987,U+9998,U+9a80,U+9a92,U+9a96,U+9adf,U+9cb4,U+9cbd,U+9cd0,U+9cd4,U+9e31,U+9e3a,U+9e71,U+9ee5,U+9eea,U+9ef9,U+9fa0"}},{uri:Cy,descriptors:{unicodeRange:"U+4e0c,U+4e28,U+4e3f,U+4ec2,U+502e,U+50ba,U+5155,U+5181,U+522d,U+5281,U+5290,U+5369,U+53b6,U+54d5,U+54dc,U+54ff,U+552a,U+553c,U+5588,U+55b5,U+5686,U+570a,U+5776,U+5786,U+57a4,U+5820,U+5865,U+58bc,U+5b32,U+5b65,U+5c1c,U+5c66,U+5c6e,U+5c8d,U+5ddb,U+5f2a,U+5f50,U+5f61,U+6067,U+614a,U+615d,U+619d,U+61d4,U+620b,U+6224-6225,U+6343,U+63ad,U+63f2,U+640b,U+6420,U+6434,U+6496,U+64d0,U+6509,U+652e,U+67a8,U+6833,U+6844,U+684a,U+6920,U+6957,U+6971,U+6a8e,U+6a91,U+6aa0,U+6b43,U+6bea,U+6bf5,U+6c15,U+6cd0,U+6ee0,U+6f24,U+6f2d,U+70c0,U+721d,U+728b,U+72c3,U+72e8,U+730a,U+7338-7339,U+734d,U+746d,U+752f,U+754e,U+770d,U+7735,U+778d,U+77a2,U+77e7,U+7857,U+786d,U+78c9,U+78f2,U+791e,U+7953,U+7b58,U+7b9d,U+7bda,U+7cd7,U+7f32-7f33,U+8022,U+8028-8029,U+8035,U+804d,U+8080,U+80c2,U+80e9,U+80ec,U+80f2,U+810e,U+8221,U+8274,U+82b0,U+82e0,U+83b0,U+8487-8488,U+848e,U+84cd,U+84d0,U+8539,U+857a,U+85a8,U+85b7,U+867c,U+871e,U+8723,U+877e,U+878b,U+8793,U+8803,U+88d2,U+8966,U+89cc,U+89eb,U+8b26,U+8c8a,U+8c98,U+8d33,U+8d47,U+8d55,U+8dbc,U+8e40,U+8e94,U+8f77,U+8f79,U+9058,U+91a2,U+91b5,U+928e,U+9494,U+94b6,U+94de,U+94f4,U+94f9,U+950a,U+950e,U+951e,U+952b,U+953c,U+953e,U+9544,U+9561,U+9564,U+9569,U+95f6,U+9603,U+960d,U+963d,U+9674,U+9794,U+97ab,U+98a5,U+9a9f,U+9ab1,U+9ad1,U+9b0f,U+9b2f,U+9c92,U+9c95,U+9cba,U+9cbc,U+9cc6,U+9ccb,U+9cd8,U+9e32,U+9e38,U+9e5b,U+9e7e,U+9eb4,U+9efb-9efc,U+9f3d"}},{uri:ky,descriptors:{unicodeRange:"U+2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f73,U+ffffd"}},{uri:Iy,descriptors:{unicodeRange:"U+4e69,U+4f1b,U+4f67,U+4f7e,U+4fdc,U+50e6,U+5196,U+5202,U+5233,U+523f,U+52a2,U+536e,U+5476,U+54ad,U+54cf,U+5537,U+561e,U+56dd,U+56df,U+5709,U+572c,U+57cf,U+57f8,U+580d,U+5881,U+589a,U+5941,U+59b2,U+5c25,U+5d24,U+5d74,U+5e42,U+5e8b,U+5eb3,U+5ed2,U+5fad,U+6003,U+603c,U+6083,U+6100,U+6126,U+6206,U+62ca,U+638e,U+63b4,U+6426,U+646d,U+6535,U+65c4,U+66db,U+6715,U+6769,U+6798,U+67c3,U+6861,U+698d,U+69ca,U+69ed,U+69f2,U+69ff,U+6a18,U+6b39,U+6bb3,U+6c0d,U+6cb2,U+6cd6,U+6cf7,U+6cfa,U+6d33,U+6e16,U+6e53-6e54,U+6ebb,U+6fb6,U+709d,U+72ad,U+72f7,U+72fb,U+7313,U+739f,U+74ba,U+754b,U+755b,U+758b,U+75ac,U+75d6,U+7617,U+7635,U+7640,U+76a4,U+76b2,U+775a,U+77bd,U+781f,U+79b3,U+7b2b,U+7b31,U+7b3e,U+7b6e,U+7b9c,U+7c0b,U+7c9e,U+7cc1,U+7ce8,U+7ea5,U+7f21,U+7f27,U+7f74,U+7fb0,U+8031,U+8071,U+80ea,U+8114,U+8160,U+81a6,U+81c1,U+829f,U+82a4,U+82fb,U+831a,U+8333,U+836c,U+83b6,U+83f8,U+8411,U+841c,U+8489,U+848c,U+85a4,U+8627,U+8629,U+866e,U+86b5,U+872e,U+8731,U+877b,U+877d,U+87ea,U+8813,U+8816,U+8864,U+88ce,U+88e5,U+897b,U+89cb,U+89f3,U+8bfc,U+8c35,U+8d46,U+8d4d,U+8dba,U+8e3a,U+8f75,U+8f7e,U+8fd3,U+9161,U+9179,U+917e,U+91a3,U+94ac,U+94d7,U+94e5,U+952a,U+952c,U+9545,U+9565,U+9568,U+956a,U+961d,U+96e0,U+972a,U+9730,U+989f,U+98e7,U+990d,U+9967,U+9993,U+9aa3,U+9ac0,U+9ae1,U+9aeb,U+9af9,U+9c86,U+9c8b,U+9ca0-9ca1,U+9ca3,U+9ce2,U+9e48,U+9e6a,U+9e87,U+9ee2,U+9ee9,U+9f17,U+9f19,U+9f2c,U+9f80"}},{uri:Ty,descriptors:{unicodeRange:"U+4ef3,U+50d6,U+50ec,U+51ab,U+51b1,U+52d6,U+54a9,U+54da,U+55be,U+55cd,U+564d,U+572f,U+574c,U+576b,U+57d8,U+57fd,U+5844,U+59d2,U+5ae0,U+5b16,U+5b37,U+5b5b,U+5b80,U+5d1e,U+5d6b,U+5efe,U+5f11,U+5f56,U+5f58,U+5f73,U+5f8c,U+5fc4,U+5fe4,U+602b,U+6106,U+610d,U+63de,U+63f8,U+641b,U+64e4,U+6634,U+676a,U+67b5,U+681d,U+6883,U+69b1,U+69e0,U+6b37,U+6b9b,U+6d7c,U+6ed7,U+6f36,U+6f72,U+6f8c,U+7035,U+7039,U+7173,U+7178,U+7228,U+728f,U+72b4,U+72ef,U+72f4,U+7331,U+7481,U+74e0,U+7540,U+75c3,U+75e6,U+763c,U+764d,U+76cd,U+7704,U+7743,U+7780,U+7847,U+786a,U+78b9,U+7962,U+7a02,U+7aac,U+7ab3,U+7b0a,U+7b4c,U+7b7b,U+7bfc,U+7c0f,U+7c16,U+7c40,U+7ca2,U+7cc7,U+7cf8,U+7d77,U+7e3b,U+7ea1,U+7ea9,U+7ef2,U+7f02,U+7f07,U+7f0c,U+7f23,U+7f2f,U+7fbc,U+8016,U+8020,U+812c,U+8136,U+8182,U+822f,U+8233,U+825f,U+8268,U+8284,U+8288,U+8291,U+8308,U+8311,U+835b,U+836d,U+83dd,U+8406,U+840f,U+845c,U+84b4,U+84e3,U+850c,U+855e,U+863c,U+86ba,U+86c4,U+86de,U+86f1,U+873e,U+87bd,U+87db,U+880a,U+883c,U+887f,U+88f0,U+890a,U+892b,U+895e,U+89ef,U+8a48,U+8bdc,U+8c18,U+8c33,U+8c94,U+8db1,U+8dcf,U+8dd6,U+8de3,U+8e6f,U+8e90,U+8f7a,U+8fb6,U+902d,U+90be,U+91af,U+936a,U+948b,U+94d8,U+9513,U+953a,U+956c,U+963c,U+9654,U+966c,U+9688,U+97b4,U+996b,U+9a75,U+9a7a,U+9aba,U+9aed,U+9b08,U+9b43,U+9c8e,U+9c94,U+9c9a,U+9e2b,U+9e36,U+9e4b,U+9e4e,U+9e55,U+9e63,U+9e68-9e69,U+9ebd,U+9ec9,U+9f0d,U+9f37,U+9f51"}},{uri:Ly,descriptors:{unicodeRange:"U+50a7,U+5240,U+5261,U+52ac,U+531a,U+5363,U+5432,U+5452,U+5456,U+5472,U+5478,U+553f,U+5575,U+5581,U+55cc,U+55fe,U+5601,U+572e,U+57d2,U+57ef,U+581e,U+5924,U+5981,U+5997,U+59a3,U+5aaa,U+5ab8,U+5b34,U+5d5d,U+5def,U+5e11,U+5e91,U+5ed1,U+5ef4,U+5f40,U+600d,U+6019,U+601b,U+605a,U+6092,U+60ab,U+6217,U+623d,U+6369,U+65d2,U+6661,U+670a,U+6753,U+67a7,U+6855,U+68f9,U+6939,U+696e,U+6980,U+6a7c,U+6aab,U+6b82,U+6bf3,U+6bf9,U+6c05,U+6c19-6c1a,U+6ca9,U+6cf6,U+6d1a,U+6dab,U+6f74,U+7085,U+7198,U+71b5,U+7256,U+725d,U+727e,U+72fa,U+7322,U+738e,U+73e5,U+750f,U+755a,U+7594,U+75b3,U+760c,U+7615,U+7630,U+763f,U+77ec,U+7817,U+78a1,U+78d9,U+7905,U+7b2a,U+7b2e,U+7b62,U+7b85,U+7bcc,U+7bea,U+7c26,U+7c74,U+7c9c-7c9d,U+7e47,U+7e9b,U+7e9f,U+7ee0,U+7ee8,U+7ef1,U+7f01,U+7f11,U+7f17,U+7f36,U+7f7e,U+7fee,U+802a,U+80cd,U+8112,U+8169,U+8234,U+8279,U+8298,U+82ca,U+82d8,U+82e1,U+83c0,U+83d4,U+83df,U+8401,U+8451,U+845a,U+8476,U+8478,U+84ba,U+84bd,U+84e0,U+851f,U+8548,U+8556,U+8585,U+868d,U+86e9,U+86f4,U+86f8,U+8765,U+8785,U+87ab,U+87ee,U+8832,U+8872,U+88b7,U+88e2-88e3,U+89da,U+8bce,U+8bd3,U+8bd6,U+8bf9,U+8c16,U+8c73,U+8d5c,U+8dde,U+8f6d,U+8f94,U+8fe8,U+9011,U+915e,U+9185,U+918c,U+94ab,U+94d1,U+94f3,U+9515,U+951d,U+9558,U+9567,U+96ce,U+96e9,U+9785,U+9878,U+987c,U+9883,U+98d1,U+9954,U+9963,U+9a93,U+9ac1,U+9acc,U+9b1f,U+9b49,U+9b4d,U+9b51,U+9ca7,U+9cae,U+9cce,U+9cd3,U+9e37,U+9e39,U+9e41,U+9e46,U+9f22,U+9f2f,U+9f39,U+9f85"}},{uri:Dy,descriptors:{unicodeRange:"U+4e5c,U+4edf,U+4f25,U+4f32,U+4f5e,U+4f76,U+4faa,U+4fe6,U+5028,U+5048,U+5250,U+535f,U+538d,U+53c1,U+5412,U+5443,U+54d4,U+54dd,U+5541,U+5550,U+5577,U+55dd,U+55f3,U+560f,U+562c,U+5657-5658,U+5664,U+56af,U+575c,U+577c,U+57b2,U+57da,U+5800,U+5a62,U+5aeb,U+5c3b,U+5ca3,U+5d26,U+5d9d,U+5f01,U+5fb5,U+5fdd,U+5ff8,U+6029,U+6041,U+6079,U+60b1,U+6222,U+629f,U+6332,U+63bc,U+63e0,U+6485,U+65ab,U+65c3,U+65c6,U+668c,U+669d,U+66be,U+67fd,U+6800,U+68fc,U+690b,U+6924,U+6978,U+69a7,U+6a3e,U+6a50,U+6a5b,U+6a97,U+6b24,U+6b8d,U+6baa,U+6c10,U+6c54,U+6ceb,U+6d04,U+6d4d,U+6eb1,U+6ebd,U+7110,U+71b3,U+71f9,U+7230,U+728d,U+7292,U+72b8,U+72d2,U+7360,U+73a2,U+7511,U+75a0,U+75c8,U+779f,U+7826,U+7877,U+7a39,U+7aa8,U+7ae6,U+7b04,U+7b0f,U+7baa,U+7bac,U+7c1f,U+7ccd,U+7ecb,U+7ed4,U+7ed7,U+7efb,U+7f0d,U+7f5f,U+7faf,U+7fd5,U+7fe5,U+8027,U+80bc,U+80dd,U+80fc,U+8132,U+815a,U+8167,U+816d,U+81ca,U+8228,U+82a1,U+82a9,U+82ab,U+82cc,U+8351,U+8368,U+83b8,U+83d8,U+83ea,U+83f0,U+8497,U+84c1,U+858f,U+85ff,U+867b,U+86a8-86a9,U+870a,U+8722,U+876e,U+877c,U+87e5,U+8888,U+88df,U+8919,U+8bcc,U+8bdf,U+8be8,U+8bee,U+8c20,U+8c2f,U+8d36,U+8df8,U+8e05,U+8e2f,U+8f9a,U+9021,U+908b,U+90b4,U+90ba,U+90d0,U+90eb,U+90fe,U+91aa,U+933e,U+9486-9487,U+948d,U+9490,U+94ad,U+94bd,U+94d6,U+94d9,U+9507,U+9546,U+955e,U+956b,U+95e9,U+9604,U+960b,U+9612,U+9615,U+9617,U+96b9,U+989a-989b,U+989e,U+9a78,U+9a7d,U+9aa0,U+9aa2,U+9ac2,U+9b23,U+9b3b,U+9c82,U+9cca,U+9cd9,U+9e28,U+9e5a,U+9e5e,U+9e6c,U+9efe,U+9f0b"}},{uri:Ay,descriptors:{unicodeRange:"U+4e47,U+4e8d,U+4f65,U+4f89,U+50ee,U+520e,U+5416,U+5454,U+54bb,U+54c2,U+54d3,U+54de,U+5591,U+55e5,U+560c,U+566b,U+5769,U+578c,U+5793,U+57e4,U+5889,U+593c,U+59ab,U+5ad4,U+5ad8,U+5af1,U+5b53,U+5ba5,U+5c59,U+5c63,U+5d5b,U+5e0f,U+5e14,U+5edb,U+5fbc,U+6004,U+60ad,U+610e,U+61b7,U+624c,U+634c,U+647a,U+64ba,U+65f0,U+6600,U+66f7,U+67e2,U+67f0,U+680c,U+686b,U+6874,U+691f,U+6989,U+6a17,U+6b81,U+6b84,U+6c06-6c07,U+6c3d,U+6d07,U+6d27,U+6d2b,U+6d91,U+6e6b,U+6e8f,U+6fde,U+70bb,U+723b,U+726e,U+72b0,U+72ce,U+72f2,U+7301,U+731e,U+737e,U+7477,U+748e,U+74ff,U+7633,U+7654,U+771a,U+7726,U+7765,U+7768,U+781c,U+7829,U+78d4,U+7913,U+7957,U+79d5,U+79eb,U+7a70,U+7a86,U+7b25,U+7b38,U+7b47,U+7b72,U+7ba6-7ba7,U+7dae,U+7ee1,U+7efe,U+7f26,U+7f31,U+7f35,U+801c,U+8043,U+809f,U+80ab,U+80d7,U+8118,U+8188,U+81cc,U+823e,U+8244,U+824f,U+82b4,U+82c1,U+82e4,U+82f4,U+8306,U+833a,U+835c,U+839c,U+83b3,U+83bc,U+846d,U+867a,U+868b,U+8734,U+87ca,U+886e,U+887e,U+88a2,U+88c9,U+8921,U+8bb5,U+8bf3,U+8c04,U+8c17,U+8c1d,U+8c25,U+8c36,U+8c55,U+8c78,U+8d3d,U+8d40,U+8d59,U+8d67,U+8d91,U+8dbf,U+8deb-8dec,U+8dfd,U+8e14,U+8e41,U+8f8e,U+900b,U+9044,U+9062,U+90cf,U+9123,U+9146,U+9162,U+9172,U+918d,U+9190,U+92c8,U+93ca,U+948c,U+94aa,U+94b2,U+94c8,U+94ca,U+94d5,U+94df,U+94e9-94ea,U+94f7,U+94fc-94fd,U+951b,U+954f,U+9554,U+9559,U+9566,U+9571-9572,U+95f1,U+9608,U+960f,U+97af,U+988f,U+98d5,U+992e,U+9955,U+9ab0,U+9b32,U+9c90,U+9c9e,U+9ca5,U+9ca9,U+9cad,U+9cb1,U+9cc3,U+9e47,U+9ee7,U+9f87"}},{uri:Ry,descriptors:{unicodeRange:"U+4e93,U+4ec4,U+4ef5,U+4f27,U+4f7b,U+4fe3,U+5080,U+5121,U+51eb,U+5208,U+52f0,U+53f5,U+5453,U+5466,U+54a6,U+54bf,U+54d0,U+5533,U+5549,U+5556,U+556d,U+558f,U+55f2,U+55f5,U+5627,U+567b,U+56d4,U+571c,U+5739,U+57b4,U+5807,U+58c5,U+59a4,U+59af,U+59d8,U+5a09,U+5a0c,U+5a4a,U+5ad2,U+5b6c,U+5ca2,U+5cac,U+5d03,U+5d6c,U+5db7,U+5ebe,U+5f2d,U+5fea,U+6042,U+6120,U+6175,U+6221,U+623e,U+6339,U+638a,U+643d,U+64b8,U+64e2,U+66e9,U+67b3,U+67c1,U+67d2,U+6832,U+6877,U+68f0,U+6934,U+6966,U+6987,U+6998,U+69c1,U+69ce,U+6a3d,U+6a84,U+6aa9,U+6b87,U+6bd6,U+6c16,U+6c18,U+6cd4,U+6cee,U+6de0,U+6e0c,U+6ecf,U+6f4b,U+70b7,U+7168,U+72d9,U+7352,U+73b3,U+73d0,U+7441,U+74d2,U+75a5,U+75e7-75e8,U+7610,U+7619,U+765e,U+772d,U+7812,U+782c,U+784c,U+7850,U+7856,U+789b,U+78f4,U+7a51,U+7b15,U+7b1e,U+7b24,U+7b5a,U+7bb8,U+7bc1,U+7bd9,U+7ed0,U+7ee6,U+7efa,U+7f1b,U+7f1f,U+7f22,U+7f45,U+7f71,U+7fa7,U+7fbf,U+7ff3,U+8052,U+80b1,U+80db,U+80f4,U+81bb,U+81ec,U+8202,U+8210,U+8249,U+828a,U+828e,U+82e3,U+8315,U+8369,U+8378,U+83a8,U+83aa,U+83b4,U+83e1,U+84fc,U+8538,U+853b,U+859c,U+85ae,U+86b4,U+86c9,U+86cf,U+8725,U+879f,U+87b3,U+887d,U+88fe,U+8a8a,U+8ba7,U+8c07,U+8c14,U+8c30,U+8c47,U+8db5,U+8dd7,U+8e1f,U+8e69,U+8e70,U+8e85,U+8f78,U+8f87,U+8f8b,U+8f8f,U+90c4,U+9143,U+917d,U+948f,U+94cd,U+94d2,U+94ef,U+954a,U+9609-960a,U+96d2,U+9708,U+9765,U+97ea,U+9880,U+98a7,U+996c,U+9980,U+9991,U+9a88,U+9ab6,U+9afb,U+9b47,U+9c87,U+9c9b,U+9cb5,U+9cc7,U+9e2c,U+9e42,U+9e58,U+9ecd,U+9ecf,U+9f8a,U+9f8c"}},{uri:Ny,descriptors:{unicodeRange:"U+4ebb,U+4edd,U+4fa9,U+502c,U+50a5,U+51c7,U+51fc,U+523d,U+5241,U+530f,U+5464,U+549d,U+54a3,U+5514,U+5527,U+555c,U+556e,U+5576,U+55b1,U+55b9,U+55eb,U+5624,U+564c,U+5671,U+5685,U+568f,U+56d7,U+56e1,U+57a1,U+57d9,U+5942,U+5a67,U+5c50,U+5c7a,U+5c98,U+5d06,U+5d27,U+5d6f,U+5df3,U+5dfd,U+5e19,U+5ea0,U+5eb9,U+5eea,U+5ffe,U+600f,U+606b,U+6215,U+622c,U+6266,U+62bb,U+62bf,U+6308,U+6387,U+63b8,U+63c4,U+63c6,U+63f6,U+6441,U+6555,U+659b,U+6677,U+66a7,U+6775,U+678b,U+679e,U+6840,U+6849,U+6860,U+68c2,U+6910,U+6a28,U+6a2f,U+6a79,U+6b92-6b93,U+6bc2,U+6bfd,U+6c29,U+6c32,U+6c86,U+6cc5,U+6d0c,U+6d60,U+6da0,U+6ddd,U+6e86,U+6ed3,U+6edf,U+6fb9,U+6fd1,U+6fef,U+7023,U+7080,U+70ca,U+712f,U+7145,U+7284,U+732c,U+73c8,U+73d9,U+740a,U+7457,U+7596,U+759d,U+75a3,U+75d8,U+75e3-75e4,U+75ff,U+7622,U+7688,U+76b4,U+76e5,U+7818,U+7887,U+789a,U+78b2,U+7b08,U+7b33,U+7c2a,U+7ccc,U+7ea8,U+7ec0,U+7fe6,U+8012,U+8084,U+8093,U+80e4,U+80ef,U+8297,U+82a8,U+82be,U+8331,U+8366,U+83c5,U+83fd,U+8473,U+84a1,U+84ca,U+84d1,U+857b,U+85c1,U+85d3,U+8605,U+8662,U+86aa,U+86b1,U+86d4,U+86ed,U+86f3,U+8709,U+8748,U+874c,U+8763,U+89c7,U+89de,U+89e5,U+8a3e,U+8ba6,U+8c00,U+8c21,U+8c49,U+8c7a,U+8d30,U+8df9,U+8e51,U+8e59,U+8f6b,U+8f73,U+8ff3,U+9016,U+9026,U+902f,U+9099,U+909b,U+90c7,U+914a,U+91ae,U+91ba,U+9495,U+94a3,U+94af,U+94ba,U+94bf,U+94cc,U+94e1,U+94f0,U+9531,U+955d,U+95f3,U+9697,U+96bc,U+975b,U+977c,U+98a2,U+998a,U+9994-9995,U+9a9b,U+9ab7,U+9ac5,U+9c91,U+9ccf,U+9cd5,U+9e29,U+9edc,U+9edf,U+9f83,U+9f88-9f89"}},{uri:Py,descriptors:{unicodeRange:"U+4ee8,U+4f22,U+4f43,U+4f57,U+4f5d,U+4f6f,U+4ff8,U+502d,U+507b,U+5345,U+53df,U+53fb,U+544b,U+5482,U+54a7,U+54cc,U+550f,U+5544,U+5555,U+5594,U+55e8,U+55ec,U+55ef,U+564e,U+56f9,U+5704,U+576d,U+5785,U+57ad,U+5914,U+5958,U+599e,U+59aa,U+59be,U+5a06,U+5abe,U+5ae1,U+5b40,U+5bee,U+5cbf,U+5cc4,U+5ccb,U+5d47,U+603f,U+6078,U+607d,U+607f,U+608c,U+609a,U+60fa,U+61ff,U+621b,U+622e,U+626a,U+6371,U+63ae,U+63cd,U+63d6,U+6410,U+6414,U+6421,U+6448,U+64d8,U+6710,U+6748,U+6772,U+680e,U+6954,U+69ab,U+6c68,U+6c8f,U+6ca4,U+6d2e,U+6e4e,U+6e98,U+6fe0,U+7094,U+70e9,U+7116,U+7119,U+723f,U+73c9,U+74e4,U+753e,U+7548,U+75bd,U+75cd,U+7618,U+7634,U+76c5,U+76f1,U+7708,U+7719,U+777e,U+7791,U+77b3,U+7823,U+7827,U+7830,U+7889,U+7893,U+7949,U+795c,U+79e3,U+7a14,U+7a88,U+7a95,U+7aa0,U+7afd,U+7b90,U+7bd1,U+7bfe,U+7da6,U+7ec2,U+7eef,U+7f03-7f04,U+7f08,U+7f58,U+7f61,U+7f9f,U+8174,U+8200,U+828d,U+82c4,U+82d5,U+82dc,U+82f7,U+832d,U+835a,U+840b,U+8438,U+852b,U+869d,U+86ac,U+86d0,U+86f0,U+8782,U+87a8,U+87d1-87d2,U+87e0,U+8839,U+8913,U+891b,U+8934,U+8941,U+89ca,U+89ce,U+8a07,U+8ba3,U+8bc5,U+8bcb,U+8bdb,U+8c11,U+8c15,U+8c29,U+8c32,U+8dc4,U+8dce,U+8ddb,U+8dfa,U+8e09,U+8e1d,U+8e39,U+8e42,U+8e49,U+8e4b,U+8e8f,U+8f71-8f72,U+9004,U+9036,U+9097,U+90dc,U+90e2,U+90e6,U+90ef,U+9104,U+919a,U+91b4,U+938f,U+9497,U+950f,U+9557,U+9562-9563,U+9573,U+9606,U+9649,U+972d,U+973e,U+97a3,U+97eb,U+988c,U+9894,U+98a6,U+9974,U+9977,U+997d,U+9a90,U+9a9d,U+9aef,U+9ca2,U+9ccd,U+9cdf,U+9e20,U+9e4c,U+9e6b,U+9f3e"}},{uri:_y,descriptors:{unicodeRange:"U+4ede,U+4ee1,U+4eeb,U+4fda,U+4ffe,U+5025,U+506c,U+50f3,U+5106,U+520d,U+525c,U+52ad,U+530d,U+5310,U+539d,U+53a9,U+53fc,U+5421,U+5477,U+54e7,U+551b,U+5530,U+557e,U+5599,U+55c4,U+55d1,U+55d4,U+55df,U+55e4,U+55ea,U+5623,U+562d,U+5654,U+56eb,U+56f5,U+57a7,U+57d5,U+57dd,U+584d,U+5880,U+58ec,U+59dd,U+5a32,U+5a55,U+5a75,U+5b51,U+5b71,U+5b73,U+5cd2,U+5ce4,U+5e5b,U+5e96,U+5fd2,U+607b,U+61d1,U+634b,U+636d,U+63b3,U+63ff,U+64c0,U+661d,U+6657,U+66dc,U+67a5,U+6841,U+6867,U+6901,U+699b,U+6a47,U+6b46,U+6c21,U+6c24,U+6c35,U+6c4a,U+6c94,U+6ca3,U+6d39,U+6d63,U+6d6f,U+6d94,U+705e,U+71e7,U+726f,U+72cd,U+72de,U+72f0,U+7325,U+7350,U+7391,U+741a,U+757f,U+7583,U+75b1,U+75b4,U+75b8,U+75c2,U+75f1,U+766f,U+7699,U+7751,U+789c,U+7a17,U+7be6,U+7cb2,U+7ea3,U+7eb0,U+7ebe,U+7eeb,U+7f25,U+7f2c,U+7fb8,U+8026,U+8037,U+8153,U+8171,U+8191,U+8214,U+821b,U+8222,U+826e,U+82eb,U+830c,U+8314,U+8334,U+83d6,U+8418,U+843c,U+84ff,U+8564,U+8572,U+8616,U+866c,U+8693,U+86a3,U+86a7,U+86af,U+86b6,U+86c6,U+86ca,U+8708,U+870d,U+8759,U+8760,U+87af,U+87c6,U+8869,U+88c6,U+89d0,U+8b07,U+8baa-8bab,U+8bc2,U+8be4,U+8bf0,U+8c2a,U+8c62,U+8c89,U+8d49,U+8d6d,U+8d84,U+8d94,U+8db8,U+8dc6,U+8e2e,U+8e3d,U+8e47,U+8e7f,U+9005,U+9051,U+907d,U+9082,U+9088,U+90b0,U+90d3,U+9150,U+949c,U+94a4,U+94b9,U+94cb,U+94e0,U+9509,U+9512,U+951f,U+9534,U+9552-9553,U+965f,U+96b0,U+9791,U+9889,U+9990,U+9a9c,U+9aa7,U+9c88,U+9cb2-9cb3,U+9cb6-9cb7,U+9cc5,U+9cdc,U+9e22,U+9e2a,U+9e57,U+9e67,U+9e73,U+9e82,U+9eb8,U+9ee0,U+9f9b"}},{uri:Oy,descriptors:{unicodeRange:"U+4eb5,U+4f09,U+4f5a,U+4f8f,U+4fce,U+4fdf,U+4fea,U+4ff3,U+500c,U+500f,U+504e,U+5088,U+52be,U+5420,U+5457,U+5499,U+549b,U+54c6,U+54d2,U+558b,U+559f,U+55bd,U+55d6,U+565c,U+567c,U+568e,U+5768,U+577b,U+57a9,U+57ed,U+59f9,U+5a11,U+5a40,U+5ae6,U+5b6a,U+5b93,U+5bb8,U+5c15,U+5c99,U+5c9c,U+5cc1,U+5d2e,U+5d4b,U+5d99,U+5e54,U+5e61,U+5fcf-5fd1,U+6002,U+6006,U+6014,U+60af,U+60c6,U+60da,U+60f4,U+621f,U+62c8,U+631b,U+631e,U+63e9,U+64b5,U+655d,U+6619,U+6635,U+6641,U+67ad,U+67b0,U+67b7,U+67e9,U+684e,U+688f,U+695d,U+696b,U+69b7,U+6a58,U+6c26,U+6d35,U+6d43,U+6d9e,U+6dd9,U+6dec,U+6e11,U+6e6e,U+6e9f,U+6ec2,U+6ee2,U+6ef9,U+6f09,U+6f66,U+6f8d,U+6fc2,U+6fc9,U+729f,U+72c8,U+73de,U+7430,U+7566,U+7579,U+75c9,U+75e2,U+75fc,U+762a,U+7638,U+7678,U+76c2,U+76f9,U+778c,U+77cd,U+77dc,U+7800,U+781d,U+782d,U+783b-783c,U+78a3,U+78ec,U+7980,U+7a23,U+7b95,U+7bdd,U+7c0c,U+7c41,U+7c91,U+7cb3,U+7cc5,U+7ecc,U+7f19,U+7fca,U+8006,U+8069,U+807f,U+80bd,U+80ed,U+814b,U+8198,U+82cb,U+82d2,U+834f,U+8360,U+847a,U+84d6,U+84e5,U+8537,U+85d0,U+8671,U+86a4,U+86ce,U+86f9,U+8703,U+8707,U+8737,U+873b,U+8815,U+8936,U+8bc3,U+8bcf,U+8bd2,U+8bd8,U+8be9,U+8c0c,U+8c0f,U+8c4c,U+8d45,U+8d5d,U+8d73,U+8e31,U+8e6d,U+8e76,U+8fe4,U+9041,U+90d7,U+9169,U+92ae,U+94a1,U+94c4,U+94c9,U+94db,U+94e7,U+9503,U+9506,U+9517,U+9528,U+9537,U+9542,U+9549,U+95fe,U+9616,U+961a,U+96c9,U+96f3,U+9701,U+970e,U+9739,U+9753,U+9798,U+98d2-98d3,U+98d9-98da,U+9968,U+996f,U+9984,U+9997,U+9acb,U+9b03,U+9c85,U+9ca8,U+9cab,U+9e49,U+9e51,U+9e66,U+9f10"}},{uri:By,descriptors:{unicodeRange:"U+4e15,U+4e1e,U+4e2b,U+4eb3,U+4ec9,U+4f0e,U+4f64,U+501c,U+50a9,U+510b,U+51a2,U+51bc,U+527d,U+52d0,U+53fd,U+5429,U+542e,U+5486,U+54af,U+5506,U+5511,U+5522,U+552c,U+556c,U+55b3,U+55d2,U+55e6,U+55fd,U+561f,U+5639,U+5659,U+5662,U+5693,U+572a,U+5892,U+598a,U+5992,U+59a9,U+5a20,U+5ae3,U+5b17,U+5b7d,U+5d34,U+5d3d,U+5d4a,U+5d82,U+5e1a-5e1b,U+5ea5,U+5f0b,U+5f77,U+5fd6,U+5fff,U+6026,U+6035,U+6063,U+60b4,U+60bb,U+60ee,U+612b,U+6194,U+61ca,U+61e6,U+61f5,U+620a,U+6248,U+62a1,U+62d7,U+6376,U+637b,U+652b,U+65bc,U+65cc,U+65ce,U+65d6,U+664c,U+665f,U+6666,U+6684,U+66b9,U+6773,U+6777,U+6787,U+67de,U+6845,U+693d,U+6994,U+6a35,U+6d54,U+6d5c,U+6d8e,U+6dd6,U+6eb4,U+6f2a,U+6f78,U+704f,U+70ec,U+7118,U+714a,U+7172,U+71b9,U+724d,U+728a,U+7337,U+733e,U+7396,U+73b7,U+73cf,U+7428,U+742c,U+742e,U+74ee,U+74f4,U+7525,U+753a,U+7572,U+75d4,U+765c,U+768e,U+7762,U+777d,U+77fd,U+7825,U+7837,U+78b4,U+795f,U+79ed,U+7a1e,U+7b06,U+7b20,U+7ba9,U+7bab,U+7c7c,U+7cbd,U+7cdc,U+7ec9,U+7ef6,U+7f30,U+7f42,U+7f44,U+7f54,U+7f94,U+8004,U+800b,U+8019,U+809b,U+80ae,U+80c4,U+80f1,U+8146,U+816e,U+817c,U+81c0,U+81fc,U+81fe,U+822b,U+830f,U+832f,U+8340,U+8365,U+8385,U+8392,U+83a0,U+8424,U+84af,U+869c,U+8713,U+8717-8718,U+87c0,U+87cb,U+87fe,U+8821,U+8902,U+89d1,U+8bb9,U+8c12,U+8d32,U+8d53,U+8df7,U+8e7c,U+8f7c,U+8f95,U+8fab,U+9052,U+905b,U+9095,U+909d,U+90c5,U+911e,U+9122,U+916a,U+919b,U+948e,U+9492,U+949a,U+94b5,U+94bc,U+94c6,U+94f1,U+9502,U+9511,U+9536,U+956f-9570,U+9602,U+9621,U+9631,U+998b,U+99a5,U+9a81,U+9a9e,U+9ebe,U+9f8b"}},{uri:zy,descriptors:{unicodeRange:"U+4f2b,U+4f3d,U+4fac,U+5043,U+5055,U+5140,U+5156,U+51cb,U+5243,U+531d,U+536f,U+53a5,U+53ae,U+53f1,U+541d,U+5431,U+547b,U+5492,U+5494,U+54a4,U+54aa,U+54ce,U+54fd,U+5509,U+5520,U+553e,U+557b,U+55c5,U+55e1,U+55f7,U+5608,U+5636,U+563b,U+5773,U+57a0,U+5811,U+587e,U+58d5,U+59e3,U+5a29,U+5a6a,U+5a76,U+5a7a,U+5ac9,U+5b62,U+5b95,U+5c49,U+5c8c,U+5cab,U+5cb7,U+5d02,U+5d58,U+5e44,U+5e7a,U+5eff,U+5f29,U+5f89,U+5f9c,U+5fa8,U+6005,U+6043,U+60b8,U+60d8,U+60ec,U+60f0,U+6115,U+618e,U+630e,U+637a,U+6390,U+63ac,U+63b0,U+64de,U+6525,U+6538,U+65ee-65ef,U+6631,U+6636,U+6654,U+677c,U+67b8,U+67d8,U+683e,U+6886,U+68b5,U+692d,U+6963,U+6979,U+6988,U+6b59,U+6b9a,U+6c69,U+6c74,U+6cae,U+6ce0,U+6cef,U+6d95,U+6dc5,U+6dde,U+6de6,U+6dfc,U+6ea7,U+6f15,U+6f29,U+7096,U+70c3,U+7131,U+715c,U+7166,U+7266,U+7317,U+731d,U+7329,U+73e9,U+7425,U+7455,U+7490,U+74ef,U+7519,U+75b5,U+75b9,U+75de,U+7656,U+7663,U+7691,U+7729,U+77fe,U+783e,U+787c,U+795a,U+7a79,U+7abf,U+7b3a,U+7b4f,U+7b60,U+7b75,U+7b8d,U+7bb4,U+7bd3,U+7be1,U+7cbc,U+7edb,U+7f1c,U+7f8c,U+7fb2,U+7fb9,U+7fce,U+7ff1,U+810d,U+81c6,U+82a5,U+82aa,U+82de,U+8317,U+8343,U+835e,U+8364,U+836a,U+853a,U+8543,U+854a,U+8559,U+8568,U+85b0,U+85b9,U+864f,U+86e4,U+8715,U+8845,U+8884,U+88e8,U+88f1,U+8983,U+8be1,U+8c1f,U+8c27,U+8c5a,U+8c82,U+8d58,U+8dbe,U+8f98,U+9035,U+9074,U+90a1,U+9149,U+9157,U+93d6,U+949d,U+94c2,U+94e3-94e4,U+95eb,U+95f0,U+9611,U+9619,U+9642,U+968d,U+9706,U+970f,U+97ed,U+988a,U+9893,U+98e8,U+9a77,U+9a87,U+9aa1,U+9abc,U+9cdd,U+9e2f,U+9e33,U+9e44,U+9e5c,U+9e9d,U+9edd"}},{uri:Fy,descriptors:{unicodeRange:"U+4f58,U+4f6c,U+4f70,U+4fd0,U+5014,U+51bd,U+524c,U+5315,U+5323,U+535e,U+540f,U+542d,U+545b,U+548e,U+549a,U+54ab,U+54fc,U+5567,U+556a,U+5600,U+5618,U+563f,U+5669,U+56f1,U+56ff,U+573b,U+574d,U+579b,U+57b8,U+57c2,U+586c,U+58f9,U+595a,U+598d,U+5993,U+5996,U+59d7,U+5b7a,U+5ba6,U+5c4e,U+5c96,U+5ce5,U+5eb6,U+5f08,U+5f99,U+602f,U+6059,U+606c,U+607a,U+60ed,U+61a9,U+620c,U+6249,U+62a8,U+62c4,U+62ed,U+62fd,U+6342,U+6345,U+6396,U+63a3,U+6402,U+6413,U+642a,U+6487,U+64a9,U+64ac,U+64ae,U+64b7,U+659f,U+65a1,U+667e,U+66f3,U+67e0,U+69db,U+69df,U+6aac,U+6b86,U+6c50,U+6c5e,U+6c76,U+6c85,U+6c8c,U+6cde,U+6d19,U+6d52,U+6da7,U+6db8,U+6e1a,U+6e25,U+6e4d,U+6e5f,U+6ec1,U+6f31,U+6f7a,U+6fa7,U+6fe1,U+701b,U+70ab,U+70f7,U+717d,U+71a8,U+7252,U+72c4,U+72e1,U+7315,U+736d,U+73ae,U+73c0,U+73c2,U+740f,U+75a4,U+7600-7601,U+768b,U+76bf,U+76d4,U+7728,U+772f,U+776c,U+77a0,U+77b0,U+77f8,U+783a,U+78d0,U+78fa,U+7977,U+7a37,U+7a92,U+7afa,U+7b71,U+7b94,U+7cef,U+7f28,U+7fe1,U+808b,U+80e5,U+80eb,U+8110,U+8113,U+812f,U+814c,U+81c3,U+8235,U+82d4,U+8309,U+83c1,U+8431,U+8469,U+84bf,U+84d3,U+84df,U+84e6,U+8511,U+8638,U+86c0,U+86db,U+86fe,U+8757,U+8822,U+8882,U+8885,U+8892,U+88f3,U+892a,U+8ba5,U+8bd9,U+8be0,U+8be7,U+8bfd,U+8c1a,U+8d4a,U+8d4e,U+8d66,U+8dda,U+8e0c,U+8e52,U+8e74,U+8e87,U+8f76,U+8fc2,U+8fe6,U+900d,U+9068,U+90ac,U+90b3,U+90b8,U+90e7,U+9119,U+9131,U+915a,U+916e,U+94b4,U+94d0,U+94e2,U+94ec,U+94ff,U+9522,U+9535,U+9556,U+965b,U+96f9,U+9774,U+9981,U+998d,U+998f,U+9a6e,U+9a7f,U+9a8a,U+9b13,U+9c9f,U+9e3e,U+9e43,U+9e6d,U+9e8b,U+9e92,U+9edb,U+9eef"}},{uri:$y,descriptors:{unicodeRange:"U+4e10,U+4e56,U+4e98,U+4ec3,U+4f3a,U+4f5f,U+4f88,U+4f97,U+4fa5,U+4fe8,U+504c,U+5197,U+52fa,U+5364,U+53e8,U+5406,U+543c,U+545c,U+5471,U+5480,U+5495,U+54b3,U+54df,U+54e6,U+54ee,U+557c,U+5583,U+55dc,U+55e3,U+566c,U+592f,U+5944,U+5983,U+59ca,U+59e5,U+5a13,U+5a7f,U+5b09,U+5bd0,U+5e4c,U+5eb5,U+5f1b,U+5f3c,U+608d,U+60cb,U+61a7,U+61ac,U+61cb,U+6233,U+62a0,U+62e7,U+62ee,U+62f4,U+62f7,U+634e,U+6382,U+63c9,U+63ea,U+6400,U+645e,U+6482,U+6556,U+6593,U+6615,U+664f,U+66e6,U+672d,U+675e,U+67da,U+6805,U+6808,U+6868,U+68a2,U+695e,U+69ad,U+6a80,U+6a90,U+6b83,U+6be1,U+6c30,U+6cad,U+6cb1,U+6cf1,U+6d31,U+6d93,U+6dae,U+6dbf,U+6dc6-6dc7,U+6e0d,U+6e32,U+6e3a,U+6e85,U+6eba,U+6f3e,U+6f5e,U+6f7c,U+6fee,U+71ee,U+722a,U+72b7,U+72e9,U+73ba,U+73d1,U+7409,U+7435-7436,U+7459-745a,U+747e,U+7487,U+74e2,U+7504,U+752c-752d,U+7599,U+759f,U+75a1,U+75ca,U+75f0,U+761f,U+7629,U+777f,U+7785,U+77a5,U+77bf,U+78d5,U+7934,U+7940,U+79a7,U+7b19,U+7c38,U+7c95,U+7cb1,U+7ce0,U+7eca,U+7ef7,U+7f2b,U+7f81,U+7fcc,U+8046,U+8148,U+8165,U+819b,U+81ba,U+828b,U+82ae,U+82b7,U+82d3,U+8301,U+830e,U+831c,U+8338,U+837c,U+8393,U+8398,U+83ba,U+83e0,U+83e9,U+853c,U+8654,U+86df,U+8712,U+873f,U+874e,U+8783,U+8859,U+88a4,U+8925,U+8bb7,U+8bff,U+8c19,U+8c1b,U+8c24,U+8c2c,U+8d61,U+8db4,U+8e6c,U+8f8a,U+8fe5,U+8ff8,U+901e,U+90f4,U+912f,U+9163,U+9170,U+91dc,U+949b,U+94a8,U+94b3,U+94c0,U+94e8,U+9525,U+9530,U+9539,U+954c-954d,U+9550,U+955b,U+962a,U+9685,U+96cc,U+9776,U+988d,U+9975,U+9985,U+9a6f,U+9aa5,U+9ab8,U+9c7f,U+9ca4,U+9cb8,U+9e25,U+9e35,U+9e4a"}},{uri:Hy,descriptors:{unicodeRange:"U+4ea2,U+4ea5,U+4f36,U+4f84,U+4f8d,U+501a,U+5029,U+516e,U+51a5,U+51c4,U+51f8,U+5201,U+527f,U+5321,U+5352,U+5366,U+53e9,U+54c7,U+5632,U+5676,U+56b7,U+56bc,U+56da,U+56e4,U+5703,U+5729,U+5742,U+57a2-57a3,U+5815,U+58d1,U+5919,U+592d,U+5955,U+5a05,U+5a25,U+5a34,U+5b70,U+5b75,U+5bdd,U+5bf0,U+5c41,U+5c79,U+5c91,U+5c94,U+5ce6,U+5ced,U+5d69,U+5dc5,U+5e16,U+5e27,U+5f27,U+5f95,U+5ffb,U+6020,U+604d,U+6055,U+60e6,U+60eb,U+6123,U+618b,U+61a8,U+620d,U+62c7,U+62ce,U+62d9,U+631f,U+634d,U+6452,U+6479,U+64ce,U+64d2,U+655b,U+660a,U+6726,U+67c4,U+6809,U+6853,U+68e3,U+68f1,U+68fa,U+693f,U+6942,U+6995,U+69a8,U+69b4,U+6a71,U+6b89,U+6bcb,U+6bd3,U+6bd9,U+6c40,U+6cf8,U+6cfe,U+6d85,U+6da3,U+6daa,U+6e0e,U+6e43-6e44,U+6f88,U+7078,U+7099,U+70bd,U+70d9,U+70fd,U+7109,U+7184,U+7239,U+733f,U+73f2,U+748b,U+749c,U+749e,U+759a,U+75d2,U+75eb,U+7620,U+766b,U+7693,U+76cf,U+7738,U+773a,U+776b,U+778e,U+77aa,U+7852,U+78be,U+7948,U+795b,U+7960,U+796f,U+79ba,U+7a20,U+7a96,U+7aa5,U+7b03,U+7b28,U+7b50,U+7b77,U+7bc6,U+7bf1,U+7c27,U+7d0a,U+7ead,U+7ec5,U+7ee2,U+7ef0,U+7efd,U+7f0e,U+7f2e,U+7f79,U+7f9a,U+8098,U+80da,U+80e7,U+80f0,U+80f3,U+80fa,U+818a,U+81e7,U+8237-8238,U+8299,U+82b8,U+82ce,U+837b,U+83bd,U+83cf,U+8426,U+8475,U+85c9,U+85d5,U+85dc,U+85e9,U+871a,U+8747,U+8749,U+888d,U+8910,U+891a,U+8bb4,U+8be3,U+8bec,U+8bf2,U+8c06,U+8c0d,U+8d31,U+8d48,U+8de4,U+8e1e,U+8e4a,U+8e66,U+8f84,U+8f97,U+9083,U+90e1,U+9165,U+91c9,U+94b0,U+94f5,U+9504,U+9532,U+956d,U+95f5,U+95fa,U+9668,U+9698,U+96bd,U+9704,U+9773,U+9890,U+996a,U+997a,U+9a74,U+9a8b,U+9cc4,U+9ccc"}},{uri:Xy,descriptors:{unicodeRange:"U+4ea8,U+4f1e,U+4f51,U+4f63,U+4f7c,U+4f83,U+4fa0,U+4fd1,U+4ffa,U+5018,U+5026,U+508d,U+50bb,U+50f5,U+50fb,U+5162,U+5319,U+5320,U+538c,U+5413,U+541f,U+5475,U+54bd,U+54d1,U+5589,U+5598,U+575f,U+57ae,U+57e0,U+5937,U+5974,U+5978,U+59ae,U+5a1f,U+5a49,U+5ab3,U+5b99,U+5b9b,U+5ba0,U+5be1,U+5be5,U+5c09,U+5c27,U+5de2,U+5e9a,U+5f26,U+5f8a,U+5f98,U+6021,U+606d,U+60bc,U+60d5,U+60e7,U+611a,U+614c,U+6254,U+626f,U+6292,U+6296,U+62b9,U+62e2,U+631a,U+631d,U+6320,U+6346,U+63ba,U+6467,U+64bc,U+658b,U+663c,U+6643,U+6652,U+6656,U+6687,U+66d9,U+66dd,U+66f0,U+673d,U+67ab,U+6816-6817,U+68a7,U+68ad,U+68cd,U+68e0,U+6986,U+69fd,U+6b47,U+6bd7,U+6c1f,U+6c2e-6c2f,U+6cbe,U+6de4,U+6e1d,U+6e83,U+6e9c,U+6ed4-6ed5,U+6f4d,U+70f9,U+7130,U+716e,U+718f,U+71ac,U+71e5,U+72fc,U+731c,U+7334,U+73ca,U+7422,U+7426,U+745f,U+7470,U+75af,U+75f4,U+762b,U+763e,U+7696,U+7737,U+7741,U+77a7,U+77bb,U+77ee,U+785d,U+788c,U+78ca,U+7901,U+796d,U+7985,U+79fd,U+7a3c,U+7a57,U+7a74,U+7b5b,U+7caa,U+7cb9,U+7cd5,U+7eac,U+7eb6,U+7ed1,U+7ee5,U+7f20,U+7f2a,U+7f38,U+7f69,U+7fa1,U+8018,U+8038,U+803f,U+804b,U+80a2,U+80be,U+80d6,U+817a,U+81fb,U+820c,U+82ad,U+82af,U+82bd,U+8327,U+8354,U+835f,U+8367,U+836b,U+840c,U+841d,U+8471,U+849c,U+84b2,U+84c9,U+8517,U+851a,U+8549,U+8681,U+8721,U+8776,U+88d9,U+88f9,U+89c5,U+8c1c,U+8c34,U+8d81,U+8d9f,U+8e0a,U+8e72,U+8eb2,U+8fed,U+901b,U+902e,U+906e,U+9091,U+90aa,U+90af,U+915d,U+9171,U+946b,U+9489,U+9499,U+94a5,U+9508,U+9524,U+952d,U+9551,U+9576,U+95f7,U+9600,U+96b6,U+96c0,U+9756,U+97f6,U+98a0,U+98a4,U+997f,U+9a73,U+9a86,U+9ad3,U+9e3d,U+9ed4"}},{uri:Wy,descriptors:{unicodeRange:"U+4e4d,U+4e5e,U+4ec7,U+4ed5,U+50da,U+50e7,U+515c,U+51a4,U+51ff,U+5203,U+5254,U+5300,U+533e,U+5375,U+53ee,U+5435,U+543b,U+5455,U+548b,U+548f,U+54d7,U+54fa,U+5578,U+5587,U+55a7,U+560e,U+5760,U+576f,U+5777,U+5830,U+58a9,U+5962,U+59e8,U+5a07,U+5a23,U+5a3c,U+5b5a,U+5bb5,U+5bc5,U+5bde,U+5c7f,U+5cb1,U+5ce8,U+5cea,U+5d29,U+5d4c,U+5e18,U+5f57,U+5f5d,U+5f87,U+5ff1,U+6016,U+601c,U+6064,U+6177,U+61d2,U+625b,U+62e3,U+62f1,U+634f,U+63a0,U+6401,U+6405,U+6495,U+64c2,U+6512,U+6577,U+6590,U+65a7,U+65a9,U+65f7,U+6627,U+6655,U+6714,U+6795,U+67d1,U+67ff,U+68b3,U+68d5,U+68d8,U+6930,U+6960,U+6977,U+69bb,U+69d0,U+6a31,U+6b7c,U+6bb4,U+6c22,U+6c72,U+6c79,U+6c7e,U+6c81,U+6c93,U+6ca5,U+6cbc,U+6ce3,U+6cfb,U+6d3c,U+6da9,U+6df3,U+6e2d,U+6eaf,U+6ec7,U+6f13,U+6f33,U+6f62,U+6fa1,U+7011,U+707c,U+708a,U+70c1,U+70d8,U+70eb,U+711a,U+7194,U+7281,U+7316,U+7357,U+7384,U+7405,U+742a,U+745b,U+7574,U+7578,U+75ea,U+7682,U+7792,U+77d7,U+77e9,U+77eb,U+77f6,U+780c,U+78c5,U+7941,U+79e4,U+7a1a,U+7a9c,U+7ad6,U+7b5d,U+7bf7,U+7c07,U+7c3f,U+7c9f,U+7ca5,U+7cdf,U+7e82,U+7eab,U+7ece,U+7eda,U+7f09,U+7f15,U+7f9e,U+7fdf,U+7fe9,U+803b,U+803d,U+80aa,U+80b4,U+813e,U+8155,U+817b,U+819d,U+821c,U+82b9,U+82df,U+82ef,U+8304,U+83b9,U+8446,U+853d,U+85af,U+85fb,U+8650,U+865e,U+86d9,U+86ee,U+8700,U+8862,U+889c,U+88d4,U+88f8,U+895f,U+8a79,U+8bb3,U+8bb6,U+8bc0,U+8beb,U+8bf5,U+8c23,U+8c79,U+8d1e,U+8dcb,U+8e29,U+8e44,U+8e81,U+8eac,U+8eaf,U+8f8d,U+9050,U+90f8,U+914b,U+948a,U+94be,U+94ee,U+950c,U+9540,U+962e,U+9647,U+9661,U+9699,U+96cf,U+9716,U+9761,U+97a0,U+97e7,U+9a7c,U+9a8f,U+9ae6,U+9cd6,U+9e26"}},{uri:Gy,descriptors:{unicodeRange:"U+4fa3,U+4fae,U+4fd8,U+4fef,U+50a3,U+5189,U+5195,U+51db,U+51f3,U+51f9,U+5220,U+5228,U+5288,U+52ff,U+532e,U+533f,U+5351,U+53db,U+53ed,U+5450,U+5484,U+5490,U+54c9,U+54e9,U+5501,U+5507,U+5543,U+55d3,U+56a3,U+575e,U+589f,U+5984,U+59ec,U+5a04,U+5a36,U+5a77,U+5a9a-5a9b,U+5ab2,U+5ac2,U+5ad6,U+5bc7,U+5c2c,U+5c34,U+5c51,U+5cd9,U+5d0e,U+5deb,U+5e3c,U+5e87,U+5ed3,U+5f13,U+5f64,U+5fe1,U+606a,U+6096,U+60df,U+60f6,U+60f9,U+6151,U+620e,U+6241,U+6252,U+6273,U+627c,U+6289,U+62c2,U+62cc,U+62ef,U+6361,U+6363,U+63b7,U+63e3,U+6518,U+66ae,U+6756,U+6789,U+6813,U+6829,U+6862,U+6866,U+6893,U+6897,U+690e,U+6984,U+69cc,U+6a1f,U+6a44,U+6a59,U+6ba1,U+6c13,U+6c90,U+6ca6,U+6cbd,U+6ccc,U+6cd3,U+6cd7,U+6d4a,U+6d4f,U+6d5a,U+6d9f,U+6da1,U+6dcc,U+6ea5,U+6ee4,U+6ee6,U+6f2f,U+6f8e,U+701a,U+7095,U+709c,U+70af,U+70db,U+70e8,U+714e,U+715e,U+71a0,U+71ce,U+7235,U+7280,U+72d0,U+72f8,U+73ab,U+7410,U+745c,U+7480,U+74a7-74a8,U+74e3,U+75ae,U+75f9,U+76b1,U+76ce,U+7736,U+77e2-77e3,U+781a,U+789f,U+797a,U+79be,U+79c3,U+79c6,U+79f8,U+7a8d,U+7a98,U+7aa6,U+7aff,U+7b1b,U+7cd9,U+7d6e,U+7ede,U+7eee,U+7f00,U+7f24,U+7f2d,U+7fd8,U+800d,U+8116,U+8151,U+81b3,U+8205,U+82c7,U+82db,U+832c,U+8335,U+8339,U+8386,U+846b,U+8587,U+8611,U+8682,U+868a,U+868c,U+8774,U+88d8,U+88f4,U+8912,U+8b6c,U+8bbd,U+8c0e,U+8c41,U+8d26,U+8d3b-8d3c,U+8d50,U+8dea,U+8e35,U+8f99,U+8fe2,U+8fe9,U+9017,U+914c,U+916f,U+9175-9176,U+918b,U+94a0,U+94ae,U+94ce,U+94f2,U+951a,U+952f,U+9541,U+9640,U+9672,U+968b,U+96cd,U+96ef,U+9713,U+97ec,U+9885,U+9992,U+9a6d,U+9a79,U+9a85,U+9cbb,U+9cd7,U+9cde,U+9e93,U+9f9f"}},{uri:Vy,descriptors:{unicodeRange:"U+4e11,U+4ed7,U+4fcf,U+4fe9,U+4fed,U+50ac,U+50b2,U+5112,U+5180,U+5188,U+51f6,U+522e,U+5265,U+52cb,U+52df,U+5349,U+5367,U+5378,U+537f,U+5395,U+5398,U+53d4,U+543e,U+5440,U+5446,U+54b8,U+5565-5566,U+5580,U+55bb,U+56ca,U+572d,U+573e,U+574e,U+5782-5784,U+58f3,U+5938-5939,U+5948,U+594e,U+5a1c,U+5a74,U+5ae9,U+5b55,U+5b5c,U+5bb0,U+5bd3,U+5bf8,U+5c3f,U+5d14,U+5d2d,U+5df7,U+5dfe,U+5e05-5e06,U+5e1c,U+5e62,U+5e7b,U+5e7d,U+5ed6,U+5f2f,U+5f66,U+5f6c,U+5fa1,U+604b,U+609f,U+60a6,U+60e8,U+6101,U+6124,U+6127,U+6148,U+61be,U+6247,U+62d8,U+62da,U+633d,U+635e,U+6367,U+6380,U+638f,U+63a9,U+63fd,U+641c,U+64e6,U+655e,U+6572,U+6591,U+65a5,U+6691,U+6735,U+67a2-67a3,U+67ef,U+680b,U+6876,U+6905,U+6a0a,U+6a61,U+6b79,U+6bb7,U+6bbf,U+6c41,U+6c55,U+6c83,U+6c9b,U+6ca7,U+6cfc,U+6d46,U+6d51,U+6d74,U+6d9d,U+6daf,U+6dc0,U+6deb,U+6e17,U+6e24,U+6e89,U+6ea2,U+6ef4,U+6f6d,U+707f,U+70b3,U+70e4,U+70ef,U+710a,U+722c,U+725f,U+7261,U+72ee,U+72f1,U+730e,U+732b,U+7433,U+7538,U+75bc,U+7624,U+7709,U+7750,U+7779,U+7802,U+7898,U+78a7,U+78b1,U+78cb,U+78f7,U+7984,U+7a83,U+7aed,U+7b3c,U+7b4b,U+7c92,U+7c98,U+7ca4,U+7eb9,U+7ee3,U+7ef3,U+7ef5,U+7f05,U+7f55,U+7f62,U+7fc1,U+7fd4,U+7fe0,U+8042,U+806a,U+80a0,U+80a4,U+80c3,U+8102,U+8106,U+814a,U+8154,U+8247,U+8258,U+82cd,U+8328,U+832b,U+8389,U+83ca,U+845b,U+846c,U+84b8,U+8574,U+859b,U+8680,U+8695,U+86c7,U+8702,U+886c,U+8896,U+88b1,U+88e4,U+8bc8,U+8c10,U+8c26,U+8c28,U+8c2d,U+8d4c,U+8d63,U+8f67,U+8f74,U+8fc4,U+9006,U+9063,U+90a2,U+90b1,U+90c1,U+9177,U+9189,U+9493,U+949e,U+94fe,U+9610,U+961c,U+96a7,U+96fe,U+978d,U+97f5,U+9888,U+997c,U+9a84,U+9b3c,U+9b44-9b45,U+9b54,U+9e64,U+9f0e,U+9f9a"}},{uri:Yy,descriptors:{unicodeRange:"U+4e19,U+4e38,U+4e53,U+4e7e,U+4e9f,U+4ec6,U+4f50,U+4fde,U+502a,U+5154,U+517d,U+51d1,U+51f0,U+5239,U+5256,U+52c9,U+52fe,U+5308,U+532a,U+535c,U+5384,U+53a2,U+53a8,U+53c9,U+53e0,U+5496,U+54ac,U+54c0,U+54c4,U+54e8,U+5561,U+5582,U+561b,U+5631,U+566a,U+5764,U+576a,U+5792,U+57ab,U+584c,U+5885,U+58f6,U+59a8,U+5acc,U+5bc2,U+5c38-5c39,U+5c60,U+5c6f,U+5c82,U+5c90,U+5d16,U+5dcd,U+5e37,U+5e90,U+5eb8,U+5f6a,U+5fcc,U+6012,U+6068,U+6073,U+607c,U+6094,U+6109,U+621a,U+626e,U+6284,U+62d0,U+62e6,U+62fe,U+6321,U+6328,U+632b,U+6349,U+6454,U+65ed,U+660f,U+6674,U+66a8,U+6749,U+674f,U+6760,U+67af,U+6850,U+6854,U+6869,U+68a8,U+68d2,U+68f5,U+6912,U+6b49,U+6b6a,U+6bef,U+6c28,U+6c5d,U+6c82,U+6cab,U+6cb8,U+6cc4,U+6cf5,U+6d47,U+6d78,U+6da4,U+6dc4,U+6dcb,U+6df9,U+6e0a,U+6e23,U+6e5b,U+6eb6,U+6f06,U+6f47,U+6f84,U+6f9c,U+6fd2,U+7076,U+70ac,U+7199,U+723d,U+72ac,U+72ed,U+7476,U+7529,U+752b,U+754f,U+7554,U+75d5,U+7626,U+76ef,U+7720,U+7766,U+7784,U+77ac,U+780d,U+7838,U+7845,U+786b,U+78b3,U+7978,U+79b9,U+79c9,U+79e7,U+7a3d,U+7a84,U+7a9f,U+7b0b,U+7b52,U+7c7d,U+7f1a,U+7fc5,U+7ff0,U+804a,U+8086-8087,U+808c,U+809a,U+80ba,U+810a,U+8180,U+818f,U+81c2,U+81ed,U+8231,U+8292,U+829c,U+82a6,U+82d1,U+8346,U+838e,U+839e,U+83c7,U+83f1,U+8403,U+840e,U+8513,U+857e,U+85e4,U+867e,U+871c,U+87ba,U+87f9,U+884d,U+8944,U+8a93,U+8c05,U+8d2c,U+8d2e,U+8d42-8d43,U+8dfb,U+8e22,U+8eba,U+8f69,U+8f9c,U+8fa3,U+8fa8,U+8fb1,U+900a,U+9038,U+903b,U+9042,U+904f,U+90b5,U+90dd,U+9102,U+9187,U+94a7,U+94c5,U+9523,U+95f8,U+95fd,U+960e,U+964b-964c,U+96c1,U+9709,U+971c,U+97ad,U+9882,U+9965,U+9976,U+9988,U+99a8,U+9a82,U+9a9a,U+9b41,U+9c8d,U+9e45,U+9e70,U+9e9f,U+9f3b,U+9f7f"}},{uri:jy,descriptors:{unicodeRange:"U+4e08,U+4e18,U+4e1b,U+4e22,U+4e27,U+4e32,U+4e52,U+4e73,U+4ead,U+4ed4,U+4ed9,U+4ef0,U+4fa6,U+5076,U+5179,U+51bb,U+51c9,U+51ef,U+51fd,U+524a,U+526a,U+529d,U+52ab,U+5306,U+5339,U+53d9,U+540a,U+5410,U+541e,U+5439,U+54b1,U+54ed,U+5564,U+558a,U+55b7,U+5634,U+574a,U+5751,U+57a6,U+57cb,U+57d4,U+5824,U+582a,U+5835,U+5858,U+5893,U+58e4,U+5951,U+5986,U+59da,U+59fb,U+59ff,U+5a03,U+5a46,U+5ac1,U+5b5d,U+5bfa,U+5c18,U+5c3a,U+5c48,U+5c4f,U+5c61,U+5cb3,U+5d1b,U+5e15,U+5e3d,U+5e99,U+5e9e,U+5eca,U+5f0a,U+5f17-5f18,U+5f25,U+5f7c,U+5fcd,U+6028,U+60a0,U+60ac,U+60d1,U+614e,U+6155,U+6168,U+61c8,U+6208,U+6212,U+6251,U+629a-629b,U+62ab-62ac,U+62fc,U+6323,U+632a,U+63d2,U+643a,U+6491-6492,U+649e,U+64b0,U+64c5,U+659c,U+6614,U+662d,U+6664,U+6670,U+6676,U+6746,U+67cf,U+67d4,U+682a,U+6843,U+6846,U+68da,U+6b3a,U+6b67,U+6c27,U+6c5b,U+6c64,U+6c70,U+6caa,U+6cca,U+6ce1,U+6d12,U+6d45,U+6dd1,U+6dd8,U+6e34,U+6e7f,U+6ee5,U+6f02,U+7092,U+70c2,U+70e6,U+7115,U+7237,U+7272,U+727a,U+72c2,U+739b,U+73b2,U+743c,U+751c,U+758f,U+75b2,U+7686,U+76c6,U+76d2,U+76fc,U+775b,U+77a9,U+7816,U+788e,U+7897,U+78b0,U+79bd,U+7a0d,U+7a91,U+7a9d,U+7ae3,U+7bad,U+7cca,U+7d2b,U+7eb1,U+7f06,U+7f14,U+7f1d,U+7f50,U+7ffc,U+8036,U+80bf,U+80c1,U+80ce,U+80f8,U+8109,U+810f,U+8170,U+8179,U+819c,U+821f,U+8230,U+8236,U+8273,U+829d,U+82f9,U+8305,U+8350,U+83b2,U+83cc,U+8404,U+840d,U+8427,U+8482,U+8679,U+8854,U+886b,U+8bbc,U+8be6,U+8c31,U+8c6b,U+8d4b,U+8dcc,U+8e2a,U+8e48,U+8f90,U+8fb0,U+9022,U+903c,U+903e,U+9065,U+916c,U+917f,U+94a9,U+94c3,U+94dd,U+94ed,U+9510,U+953b,U+96c7,U+970d,U+9738,U+9877,U+987d,U+989c,U+98d8,U+9a70,U+9a91,U+9aa4,U+9b42,U+9b4f,U+9e2d,U+9e3f,U+9e7f,U+9f20"}},{uri:Zy,descriptors:{unicodeRange:"U+4e59,U+4ed3,U+4f0f,U+4f38,U+4f69,U+4fa7,U+4faf,U+4ff1,U+5077,U+5085,U+5144,U+5151,U+51af,U+51b6,U+51cc,U+523a,U+5251,U+5269,U+5272,U+52d8,U+5353,U+5389,U+53f9,U+5401,U+5415,U+541b,U+54f2,U+5524,U+554a,U+559d,U+5609,U+5740,U+575d,U+5806,U+5821,U+586b,U+5915,U+594f,U+5960,U+5999,U+59a5,U+59b9,U+59c6,U+59d1,U+59dc,U+5b5f,U+5b64,U+5b87,U+5bb4,U+5bbf,U+5c16,U+5c1d,U+5c3e,U+5c9a,U+5ca9,U+5cad,U+5cfb,U+5de1,U+5de7,U+5de9,U+5ef7,U+5f04,U+5f70,U+5f79,U+5fc6,U+602a,U+6050,U+6052,U+6070,U+6084,U+60b2,U+60dc,U+60e9,U+6167,U+6170,U+61c2,U+6270,U+6291,U+62b1,U+62bc,U+62dc,U+62df,U+62f3,U+6324,U+633a,U+6377,U+6398,U+63cf,U+640f,U+642c-642d,U+6458,U+6478,U+6500,U+654c,U+6566,U+658c,U+65c1,U+65cb,U+65e8,U+65ec,U+6696-6697,U+6734,U+679a,U+679d,U+67dc,U+67f3-67f4,U+680f,U+683d,U+684c,U+68af,U+699c,U+6bc1,U+6c0f,U+6c1b,U+6c57,U+6c6a,U+6d3d,U+6d6e,U+6d82,U+6db5,U+6dee,U+6e58,U+6eaa,U+6ecb,U+6ede,U+6ee9,U+6f0f,U+6f20,U+6f58,U+704c,U+7070,U+70b8,U+718a,U+7238,U+7262,U+7275,U+72b9,U+72d7,U+72e0,U+741b,U+7434,U+7483,U+74f6-74f7,U+75ab,U+764c,U+7761,U+7855,U+7891,U+78c1,U+79d2,U+7a00,U+7a3b,U+7c97,U+7ea4,U+7eb2,U+7ed2,U+7eea,U+7ef8,U+7f18,U+7fbd,U+8000,U+8010,U+8096,U+809d,U+80a9,U+817f,U+81e3,U+8206,U+8212,U+82ac,U+8302,U+8361,U+8377,U+83f2,U+8461,U+848b,U+84ec,U+8521,U+85aa,U+8870,U+8877,U+8881,U+888b,U+88ad,U+88c2,U+8986,U+8bd1,U+8bf1,U+8d24,U+8d2a,U+8d3e-8d3f,U+8d41,U+8d56,U+8d64,U+8d6b,U+8e0f,U+8f70,U+8f85,U+8f88,U+8fa9,U+9003,U+901d,U+90b9,U+90ce,U+94a6,U+94f8,U+9505,U+95ea,U+95ef,U+95f2,U+95f9,U+9601,U+9605,U+9634,U+966a,U+9677,U+9690,U+9694,U+96d5,U+971e,U+9896-9897,U+9972,U+9a71,U+9a76,U+9a7e,U+9e1f,U+9e23"}},{uri:Ky,descriptors:{unicodeRange:"U+4e01,U+4e43,U+4ea6,U+4ef2,U+4eff,U+4f26,U+4f2a,U+4f2f,U+4f5b,U+4fa8,U+4fca,U+4fd7,U+5021,U+504f,U+5141,U+51c0,U+51dd,U+51e4,U+51ed,U+5200,U+5237,U+5427,U+5448,U+54a8,U+5706,U+5708,U+5723,U+575b,U+57c3,U+5899,U+58a8,U+58c1,U+5976,U+5988,U+59bb,U+59d0,U+59d3,U+5a18,U+5a31,U+5a92,U+5b54,U+5b85,U+5baa-5bab,U+5bc4,U+5bd2,U+5be8,U+5bff,U+5c65,U+5d07,U+5e1d,U+5e78,U+5e7c,U+5f03,U+5f1f,U+5f39,U+5f6d,U+5f92,U+5faa,U+5fbd,U+5fe7,U+5ffd,U+60a8,U+60ef,U+6108,U+6162,U+622a,U+6234,U+626b,U+626d,U+62c6,U+62d2,U+62d4,U+62d6,U+62e8,U+6316,U+6355,U+63ed,U+6447,U+64a4,U+65f1,U+6606,U+6628,U+664b,U+6668,U+6682,U+66f9,U+66fc,U+66ff,U+6717,U+6740,U+676d,U+67aa,U+67ec,U+67f1,U+6842,U+6851,U+695a,U+6982,U+6a2a,U+6b20,U+6b23,U+6b32,U+6b96,U+6bc5,U+6beb,U+6c60,U+6c9f,U+6cea,U+6cf3,U+6d1e,U+6d53,U+6d66,U+6d69,U+6d8c,U+6d9b,U+6db2,U+6de1,U+6dfb,U+6e14,U+6ed1,U+6eda,U+6ee8,U+6f2b,U+706d,U+7089,U+708e,U+70ad-70ae,U+70e7,U+7126,U+714c,U+71c3,U+71d5,U+7206,U+7259,U+731b,U+73a9,U+73bb,U+74dc,U+7532,U+7545,U+755c,U+75c7,U+7687,U+76d7,U+76f2,U+788d,U+78e8,U+79e6,U+79e9,U+7a3f,U+7a46,U+7a97,U+7af9,U+7bee,U+7c4d,U+7c89,U+7cd6,U+7eb5,U+7ebd,U+7ed8,U+8017,U+8033,U+80c0,U+80de,U+80f6,U+8138,U+817e,U+81a8,U+820d,U+827e,U+82b3,U+82d7,U+83b1,U+84c4,U+84dd,U+8584,U+864e,U+865a,U+866b,U+86cb,U+88d5,U+89e6,U+8bca,U+8bde,U+8bfa,U+8c0a,U+8c37,U+8c46,U+8c6a,U+8c8c,U+8d1d,U+8d29,U+8d4f,U+8d54,U+8d5a,U+8d60,U+8d62,U+8f7f,U+8f96,U+8f9e-8f9f,U+8fc1,U+8fdf,U+8fea,U+8ff7,U+9012,U+906d,U+9075,U+90a6,U+90bb,U+90ca,U+9178,U+9192,U+91ca,U+94bb,U+94dc,U+94fa,U+9501,U+950b,U+9521,U+955c,U+963b,U+9655,U+9675-9676,U+9887,U+9891,U+9971,U+9a97,U+9ece,U+9ed8"}},{uri:qy,descriptors:{unicodeRange:"U+4e1d,U+4e39,U+4e4c,U+4e4f,U+4e54,U+4e58,U+4e95,U+4ea1,U+4eab,U+4eae,U+4ec1,U+4f10,U+4f19,U+4f30,U+4f34,U+4fb5,U+503e,U+518c,U+5192,U+51a0,U+51ac,U+51b0,U+51e1,U+5211,U+5242,U+52a3,U+52b2,U+52c3,U+52c7,U+52d2,U+52e4,U+5377,U+539a,U+53a6,U+53e5,U+5417,U+5510,U+552f,U+5531,U+574f-5750,U+5761,U+5851,U+5854,U+58ee,U+593a,U+5949,U+5954,U+5a5a,U+5b8b,U+5bbd,U+5c04,U+5c0a,U+5c4b,U+5ce1,U+5cf0,U+5e10,U+5e8a,U+5e9f,U+5ec9,U+5f31,U+5f84,U+5fd8-5fd9,U+5fe0,U+6015,U+6062,U+6069,U+6076,U+6089,U+60a3,U+60ca,U+620f,U+624e,U+6263,U+6298,U+62a2,U+62bd,U+6311,U+6350,U+6389,U+638c,U+63f4,U+6446,U+644a,U+6469,U+64cd,U+654f,U+6562,U+656c,U+65d7,U+65e6,U+65fa,U+660c,U+6653,U+66b4,U+670b,U+672b,U+676f-6770,U+6881,U+6885,U+68a6,U+68cb,U+68ee,U+6b8a,U+6c88-6c89,U+6cc9,U+6ce5,U+6d01,U+6d17,U+6d1b,U+6d59,U+6d6a,U+6da8,U+6df7,U+6e10,U+6e20-6e21,U+6f5c,U+706f,U+70bc,U+719f,U+7267,U+732a,U+73cd,U+7518,U+756a,U+7586,U+7591,U+75db,U+76c8,U+76d0,U+76d6,U+76d8,U+76df,U+76fe,U+77db,U+7801,U+786c,U+795d,U+7965,U+79cb,U+7a77,U+7a7f,U+7aef,U+7b11,U+7bb1,U+7bc7,U+7ea0,U+7eaf,U+7ed5,U+7edc,U+7f13,U+7f29,U+7f34,U+7f8a,U+7ffb,U+8015,U+8058,U+805a,U+8083,U+80af,U+80c6,U+80cc,U+811a,U+8150,U+82e5,U+8336,U+8352,U+83ab,U+8428,U+8463,U+852c,U+8861,U+89c8,U+8bcd,U+8bd7,U+8bda,U+8be2,U+8bef,U+8bf8,U+8c0b,U+8c13,U+8d34,U+8d3a,U+8d74,U+8d76,U+8da3,U+8dd1,U+8ddd,U+8ddf,U+8df3,U+8f68,U+8f6f,U+8f7d,U+8f91,U+8f9b,U+8fbd,U+8fc8,U+8fd4,U+8feb,U+8ff9,U+900f,U+9057,U+907f-9080,U+90d1,U+90ed,U+91ce,U+9519,U+9526,U+95ed,U+9614,U+9635,U+9644,U+9686,U+96c5,U+96ea,U+9707,U+9732,U+9759,U+978b,U+9876,U+9881,U+9910,U+996e,U+9970,U+9c81,U+9e21,U+9ebb,U+9f84"}},{uri:Jy,descriptors:{unicodeRange:"U+4e3d,U+4e4e,U+4e71,U+4e8f,U+4ed8,U+4eea,U+4f0a,U+4f0d,U+4f11,U+4f1f,U+4f24,U+4f3c,U+4f73,U+4fc4,U+500d,U+5012,U+501f,U+503a,U+505c,U+507f,U+50a8,U+514d,U+5178,U+517c,U+51b2,U+51b7,U+520a,U+5238,U+523b,U+52b1,U+535a,U+5371,U+5385,U+53eb-53ec,U+53f3,U+53f6,U+5409,U+542b,U+542f,U+5434,U+5462,U+5473,U+547c,U+54c8,U+54ea,U+56fa,U+5733,U+5757,U+5766,U+5802,U+585e,U+590f,U+591c,U+591f,U+5947,U+594b,U+5987,U+5a01,U+5b59,U+5b63,U+5b88,U+5b97,U+5b9c,U+5bbe,U+5bfb,U+5c01,U+5c1a,U+5c24,U+5c3c,U+5c97,U+5c9b,U+5cb8,U+5de6,U+5e01,U+5e2e,U+5e45,U+5e55,U+5e84,U+5ef6,U+5f02,U+5f52,U+5f69,U+5f7b,U+5f90,U+5fae,U+6000,U+600e,U+6025,U+60e0,U+6276,U+6297,U+62b5,U+62cd,U+62d3,U+62e5,U+62e9,U+62ff,U+6302,U+632f,U+63e1,U+6444,U+64ad,U+653b,U+6551,U+6563,U+65a4,U+65e7,U+6620,U+667a,U+66f2,U+671d,U+6731,U+6742,U+675f,U+6768,U+677e-677f,U+6790,U+67b6,U+67d3,U+6863,U+68b0,U+68c9,U+690d,U+6b8b,U+6bcd,U+6bd2,U+6bd5,U+6c38,U+6c61,U+6cbf,U+6cdb,U+6cf0,U+6d2a,U+6d89,U+6da6,U+6f6e,U+6fb3,U+7075,U+707e,U+70df,U+7164,U+7236,U+725b,U+7389,U+73e0,U+745e,U+74e6,U+751a,U+7537,U+75be,U+76ae,U+76db,U+793c,U+7956,U+7981,U+79d8,U+79df,U+79fb,U+7adf,U+7ae5,U+7b14,U+7b26,U+7b54,U+7b79,U+7d2f,U+7eb8,U+7eba,U+7ec6,U+7ee9,U+7eff,U+7f5a,U+7f6a,U+7f72,U+8089,U+80a5,U+80e1,U+8111,U+8131,U+821e,U+822c,U+8270,U+8499,U+8651,U+867d,U+8840,U+8857,U+8863,U+88c1,U+89c9,U+89d2,U+8a89,U+8bed,U+8bfe,U+8c01,U+8c22,U+8d21,U+8d25,U+8d2f,U+8d5e,U+8d75,U+8d8b,U+8dc3,U+8de8,U+8df5,U+8f6e,U+8f86,U+8f89,U+8fc5,U+8ff0,U+8ffd,U+9014,U+904d,U+90ae,U+9274,U+949f,U+952e,U+969c,U+96c4,U+96e8,U+96f6-96f7,U+97e9,U+987f,U+996d,U+9a7b,U+9aa8,U+9c7c,U+9c9c,U+9e4f,U+9f13,U+9f50"}},{uri:Qy,descriptors:{unicodeRange:"U+4e13,U+4e16,U+4e1c,U+4e24,U+4e3e,U+4e49,U+4e61,U+4e66,U+4e89,U+4e8c,U+4e94,U+4e9b,U+4ea4,U+4eac,U+4ebf,U+4eca,U+4ef6-4ef7,U+4efb,U+4f18,U+4f20,U+4f46,U+4f7f,U+4fe1,U+503c,U+505a,U+5146,U+5148,U+515a,U+5171,U+5177,U+519b,U+51b3,U+51c6,U+51e0,U+5212,U+521b,U+522b,U+529e,U+52bf,U+534e-534f,U+5355,U+5357,U+5382,U+539f,U+53bb,U+53bf,U+53c2,U+53c8,U+53ca,U+53d6-53d8,U+53e3,U+53ea,U+53f0,U+540d,U+5411,U+56db,U+56de,U+56e0,U+56e2,U+578b,U+57ce,U+57fa,U+589e,U+5904,U+5934,U+5982,U+5b89,U+5b8c,U+5bfc,U+5c06,U+5c11,U+5c40,U+5c71,U+5e38,U+5e72,U+5e76,U+5e7f,U+5e94,U+5e9c,U+5f0f,U+5f15,U+5f20,U+5f3a,U+5f62,U+5f88,U+5fc5,U+5fd7,U+5feb,U+601d,U+6027,U+60c5,U+60f3,U+610f,U+6216,U+6218,U+624b,U+624d,U+6279,U+628a,U+6295,U+6301,U+6307,U+636e,U+63a5,U+63a8,U+652f,U+6536,U+653e,U+6548,U+6559,U+6570,U+65bd,U+65e0,U+6602,U+660e,U+6613,U+66f4,U+6700,U+670d,U+671f,U+672f,U+6743,U+674e,U+6751,U+6761,U+6784,U+6797,U+679c,U+67e5,U+6807,U+6837,U+683c,U+6b21,U+6b63-6b65,U+6bcf,U+6bd4,U+6c42,U+6c5f,U+6ca1,U+6cbb,U+6d3b,U+6d41,U+6d88,U+6df1,U+70b9,U+7136,U+7269,U+7279,U+7531,U+754c,U+767e,U+76ca,U+76f8,U+770b,U+7740,U+7814,U+79ef,U+7a0b,U+7a0e,U+7a76,U+7b80,U+7cbe,U+7cfb,U+7e41,U+7ea7,U+7ec4,U+7ec7,U+7ed3,U+7ed9,U+7edf,U+7f8e,U+8001,U+804c,U+8054,U+80b2,U+81f3,U+8425,U+8868,U+88ab,U+897f,U+89c1-89c2,U+89c4,U+89c6,U+89e3,U+8ba1,U+8ba4,U+8bae,U+8bb0,U+8bba,U+8bc1,U+8c03,U+8d28,U+8d39,U+8def,U+8f66,U+8f6c,U+8fd0-8fd1,U+9020,U+9053,U+90a3,U+90fd,U+91cc,U+9500,U+9547,U+95e8,U+95f4,U+961f,U+9645,U+9662,U+96be,U+96c6,U+9700,U+9769,U+97e6,U+9875,U+9879,U+9886,U+9898,U+98ce,U+9996,U+2b5af,U+2cc56,U+2e9f5,U+30edd-30ede"}},{uri:ev,descriptors:{unicodeRange:"U+4e03,U+4e30,U+4e34,U+4e45,U+4e60,U+4e70,U+4e88,U+4e91-4e92,U+4ea9,U+4eb2,U+4ec0,U+4ecb,U+4ecd,U+4ee4,U+4fee,U+5019,U+5047,U+50cf,U+5145,U+516d,U+5170,U+5175,U+5199,U+51cf,U+51fb,U+521a,U+5224,U+5267,U+52aa,U+5347-5348,U+534a,U+5356,U+5361,U+536b,U+5370,U+538b,U+53e4,U+53e6,U+5403,U+5426,U+5428,U+542c,U+5438,U+5668,U+56ed,U+56f4,U+56fe,U+57df,U+592a,U+5957,U+5b69,U+5b81,U+5b8f,U+5b98,U+5b9d,U+5ba1,U+5ba4,U+5bb3,U+5bc6,U+5bdf,U+5c3d,U+5c5e,U+5c81,U+5ddd,U+5de8,U+5dee,U+5e0c,U+5e86,U+5e8f,U+5e93,U+5e95,U+5e97,U+5ea7,U+5ead,U+5eb7,U+5f55,U+5f81,U+5f85,U+5ff5,U+6001,U+613f,U+6258,U+6267,U+6269,U+626c,U+627e,U+62db,U+62ec,U+6325,U+635f,U+6362,U+6388,U+6392,U+63a2,U+63a7,U+63aa,U+641e,U+6545,U+6597,U+65e2,U+65e9,U+661f,U+665a,U+666e-666f,U+66fe,U+6728,U+67d0,U+6811,U+6838,U+6865,U+697c,U+6b22,U+6b27,U+6b4c,U+6b62,U+6b66,U+6b7b,U+6bdb,U+6c47,U+6c49,U+6c7d,U+6c99,U+6cfd,U+6d0b,U+6d25,U+6d32,U+6d3e,U+6d4b,U+6e29,U+6e56,U+6e7e,U+6f14,U+6fc0,U+706b,U+70c8,U+7247,U+72af,U+72b6,U+72ec,U+732e,U+73ed,U+7403,U+7533,U+753b,U+7559,U+7565,U+7597,U+767b,U+773c,U+7763,U+77ed,U+77ff,U+7968,U+798f,U+79bb,U+79c0-79c1,U+7ad9,U+7ae0,U+7b51,U+7b7e,U+7cae,U+7d22,U+7ea2,U+7eb3,U+7eb7,U+7ec3,U+7ec8,U+7ecd,U+7edd,U+7efc,U+7f16,U+7f3a,U+7f51,U+7f57,U+7f6e,U+80dc,U+822a,U+8239,U+826f,U+82cf,U+82e6,U+8349,U+8363,U+83dc,U+8457,U+85cf,U+878d,U+8865,U+8a00,U+8b66,U+8ba2,U+8ba8,U+8bad,U+8bb2,U+8bc9,U+8bd5,U+8bfb,U+8d2b,U+8d35,U+8d37,U+8f7b,U+8f93,U+8fce,U+8fdd,U+9000-9002,U+9010,U+9047,U+9093,U+9152,U+9488,U+94a2,U+9633,U+9636,U+963f,U+9646,U+9648,U+964d,U+9664,U+9669,U+9760,U+97f3,U+987a,U+987e,U+9884,U+98de,U+9986,U+9ed1"}},{uri:tv,descriptors:{unicodeRange:"U+4e14,U+4e25,U+4e48,U+4e50,U+4e5d,U+4e9a,U+4ec5,U+4efd,U+4f17,U+4f4e-4f4f,U+4f55,U+4f59,U+4f60,U+4f8b,U+4f9b,U+4f9d,U+4fbf,U+4fc3,U+5065,U+513f,U+5149,U+514b,U+516b,U+5174,U+517b,U+518d,U+51b5,U+5207,U+5217-5219,U+521d,U+526f,U+529f,U+52a9,U+52b3,U+5305,U+533b,U+5343,U+5360,U+5373-5374,U+5386,U+53cb-53cd,U+53f2,U+53f7,U+544a,U+5468,U+547d,U+54cd,U+552e,U+5584,U+56f0,U+571f,U+5747,U+575a,U+57f9,U+5883,U+58eb,U+58f0,U+5907,U+590d,U+592e,U+5931,U+5956,U+5965,U+5973,U+5979,U+59cb,U+5b57-5b58,U+5b83,U+5ba2-5ba3,U+5bb9,U+5bcc,U+5c42,U+5c45,U+5c4a,U+5dde,U+5df1,U+5df4,U+5e03,U+5e08,U+5e26,U+5e2d,U+5f71,U+5f80,U+5f8b,U+5fb7,U+606f,U+611f,U+6237,U+623f,U+6253,U+627f,U+6293,U+62a4,U+62c5,U+62c9,U+6309,U+6574,U+6599,U+65ad,U+65af,U+65c5,U+65cf,U+6625,U+663e,U+671b,U+672a,U+6750,U+6781,U+6821,U+6839,U+6848,U+68c0,U+6a21,U+6b3e,U+6bb5,U+6c14,U+6cb3,U+6cb9,U+6ce8,U+6e05,U+6e2f,U+6e38,U+6e90,U+6ee1,U+70ed,U+7167,U+7231,U+7248,U+724c,U+7387,U+738b,U+73af,U+7530,U+75c5,U+767d,U+76d1,U+76f4,U+771f,U+77e5,U+77f3,U+7834,U+7840,U+786e,U+793a,U+795e,U+79f0,U+7a33,U+7a7a,U+7a81,U+7ade,U+7b56,U+7b97,U+7c73,U+7c7b,U+7d20,U+7d27,U+7ea6,U+7eaa,U+7ebf,U+7ee7,U+7eed,U+7ef4,U+7fa4,U+8003,U+80a1,U+81f4,U+8272,U+827a,U+8282,U+82b1,U+82f1,U+8303,U+836f,U+83b7,U+843d,U+88c5,U+8ba9,U+8baf,U+8bb8,U+8bbf,U+8bc4,U+8bc6,U+8bdd,U+8be5,U+8bf7,U+8c08,U+8c61,U+8d1f,U+8d22-8d23,U+8d27,U+8d2d,U+8d38,U+8d5b,U+8d70,U+8d85,U+8d8a,U+8db3,U+8eab,U+8f83,U+8fb9,U+8fdc,U+8fde,U+9009,U+901f,U+914d,U+91c7,U+94b1,U+94c1,U+94f6,U+95fb,U+9632,U+9650,U+968f,U+9752,U+975e,U+987b,U+989d,U+98df,U+9999,U+9a6c,U+9a8c,U+9ec4,U+9feb-9fec"}},{uri:av,descriptors:{unicodeRange:"U+98fb-990c,U+990e-990f,U+9911-992d,U+992f-9953,U+9956-9962,U+9964,U+9966,U+9973,U+9978-9979,U+997b,U+997e,U+9982-9983,U+9989,U+998c,U+998e,U+999a-99a4,U+99a6-99a7,U+99a9-99c8"}},{uri:nv,descriptors:{unicodeRange:"U+8e4c-8e50,U+8e53-8e58,U+8e5a-8e65,U+8e67-8e68,U+8e6a-8e6b,U+8e6e,U+8e71,U+8e73,U+8e75,U+8e77-8e7b,U+8e7d-8e7e,U+8e80,U+8e82-8e84,U+8e86,U+8e88-8e8e,U+8e91-8e93,U+8e95-8e9b,U+8e9d,U+8e9f-8eaa,U+8ead-8eae,U+8eb0-8eb1,U+8eb3-8eb9,U+8ebb-8ecd,U+8ecf-8f02"}},{uri:iv,descriptors:{unicodeRange:"U+2e3a,U+3001-3002,U+3008-3011,U+3014-3017,U+301d-301f,U+4dae,U+4e00,U+4e07,U+4e09-4e0b,U+4e0d-4e0e,U+4e1a,U+4e2a,U+4e2d,U+4e3a-4e3b,U+4e4b,U+4e5f,U+4e86,U+4e8b,U+4e8e,U+4ea7,U+4eba,U+4ece,U+4ed1,U+4ed6,U+4ee3,U+4ee5,U+4eec,U+4f01,U+4f1a,U+4f4d,U+4f53,U+4f5c,U+4fdd,U+5143,U+5165,U+5168,U+516c,U+5173,U+5176,U+5185,U+519c,U+51fa,U+5206,U+5229,U+5230,U+5236,U+524d,U+529b,U+52a0-52a1,U+52a8,U+5316-5317,U+533a,U+5341,U+5362,U+53d1,U+53ef,U+53f8,U+5404,U+5408,U+540c,U+540e,U+5458,U+548c,U+54c1,U+54e5,U+5546,U+559c,U+56fd,U+5728,U+5730,U+573a,U+5916,U+591a,U+5927,U+5929,U+592b,U+597d,U+59d4,U+5b50,U+5b66,U+5b9a,U+5b9e,U+5bb6,U+5bf9,U+5c0f,U+5c14,U+5c31,U+5c55,U+5de5,U+5df2,U+5e02,U+5e73-5e74,U+5ea6,U+5efa,U+5f00,U+5f53,U+5f97,U+5fc3,U+603b,U+6210-6211,U+6240,U+6280,U+62a5,U+63d0,U+6539,U+653f,U+6587,U+65b0,U+65b9,U+65e5,U+65f6,U+662f,U+6708-6709,U+672c,U+673a,U+675c,U+6765,U+6c11,U+6c34,U+6cd5,U+6ce2,U+6d4e,U+6d77,U+73b0,U+7406,U+751f,U+7528,U+7535,U+7684,U+76ee,U+793e,U+79cd,U+79d1,U+7acb,U+7b2c,U+7b49,U+7ba1,U+7ecf,U+8005,U+800c,U+80fd,U+81ea,U+884c,U+8981,U+8bbe,U+8bf4,U+8d44,U+8d77,U+8fbe,U+8fc7,U+8fd8-8fd9,U+8fdb,U+901a,U+90e8,U+91cd,U+91cf,U+91d1,U+9485,U+957f,U+95ee,U+9762,U+9ad8,U+9ea6,U+9f99,U+9fcf,U+9fd4,U+9fed,U+fe10-fe19,U+fe30-fe31,U+fe33-fe44,U+ff01,U+ff0c,U+ff1f,U+2b4e7,U+2b7f7,U+2b7fc,U+2cb2d,U+2cb3b,U+2cb4a,U+2cb5b,U+2cb73"}},{uri:lv,descriptors:{unicodeRange:"U+6490,U+6493-6494,U+6497-6498,U+649a-649d,U+649f-64a3,U+64a5-64a8,U+64aa-64ab,U+64af,U+64b1-64b4,U+64b6,U+64b9,U+64bb,U+64bd-64bf,U+64c1,U+64c3-64c4,U+64c6-64cc,U+64cf,U+64d1,U+64d3-64d6,U+64d9-64dd,U+64df-64e1,U+64e3,U+64e5,U+64e7-64ff,U+6501-6508,U+650a-6511,U+6513-6517,U+6519-6524,U+6526-652a,U+652c-652d,U+6530-6533,U+6537,U+653a,U+653c-653d,U+6540-6544,U+6546-6547,U+654a-654b,U+654d-654e,U+6550,U+6552-6554,U+6557-6558,U+655a,U+655c,U+655f-6561,U+6564-6565,U+6567-6568"}},{uri:rv,descriptors:{unicodeRange:"U+9695-9696,U+969a-969b,U+969d-96a6,U+96a8-96af,U+96b1-96b2,U+96b4-96b5,U+96b7-96b8,U+96ba-96bb,U+96bf,U+96c2-96c3,U+96c8,U+96ca-96cb,U+96d0-96d1,U+96d3-96d4,U+96d6-96df,U+96e1-96e7,U+96eb-96ee,U+96f0-96f2,U+96f4-96f5,U+96f8,U+96fa-96fd,U+96ff,U+9702-9703,U+9705,U+970a-970c,U+9710-9712,U+9714-9715,U+9717-971b,U+971d,U+971f-9729,U+972b-972c,U+972e-972f,U+9731,U+9733-9737,U+973a-973d,U+973f-9751,U+9754-9755,U+9757-9758,U+975a,U+975c-975d,U+975f,U+9763-9764,U+9766-9768,U+976a-9770"}},{uri:sv,descriptors:{unicodeRange:"U+6af0-6b1f,U+6b25-6b26,U+6b28-6b31,U+6b33-6b36,U+6b38,U+6b3b-6b3d,U+6b3f-6b42,U+6b44-6b45,U+6b48,U+6b4a-6b4b,U+6b4d-6b58,U+6b5a-6b61,U+6b68-6b69,U+6b6b-6b78,U+6b7a,U+6b7d-6b80,U+6b85,U+6b88,U+6b8c,U+6b8e-6b91,U+6b94-6b95,U+6b97-6b99,U+6b9c-6ba0,U+6ba2-6ba9,U+6bab-6bb2,U+6bb6,U+6bb8-6bba"}},{uri:ov,descriptors:{unicodeRange:"U+430e-439a,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29f7e,U+29f83,U+29f8c,U+29fce,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a38c"}},{uri:dv,descriptors:{unicodeRange:"U+92ef-933d,U+933f-9369,U+936b-9388"}},{uri:cv,descriptors:{unicodeRange:"U+4512-458d,U+2b300,U+2b363,U+2b36f,U+2b372,U+2b37d,U+2b404,U+2b410,U+2b413,U+2b461,U+2b4ef,U+2b4f6,U+2b4f9,U+2b50d-2b50e,U+2b536,U+2b5ae,U+2b5b3,U+2b5e7,U+2b5f4,U+2b61c-2b61d,U+2b626-2b628,U+2b62a,U+2b62c,U+2b695-2b696,U+2b6ad,U+2b6ed"}},{uri:hv,descriptors:{unicodeRange:"U+88bd-88c0,U+88c3-88c4,U+88c7-88c8,U+88ca-88cd,U+88cf-88d1,U+88d3,U+88d6-88d7,U+88da-88de,U+88e0-88e1,U+88e6-88e7,U+88e9-88ef,U+88f2,U+88f5-88f7,U+88fa-88fb,U+88fd,U+88ff-8901,U+8903-8909,U+890b-890f,U+8911,U+8914-8918,U+891c-8920,U+8922-8924,U+8926-8929,U+892c-892f,U+8931-8933,U+8935,U+8937-8940,U+8942-8943,U+8945-895d,U+8960-8965,U+8967-897a,U+897c-897e,U+8980,U+8982,U+8984-8985"}},{uri:uv,descriptors:{unicodeRange:"U+4b0b-4ba0"}},{uri:Uv,descriptors:{unicodeRange:"U+7179,U+717b-717c,U+717e-7183,U+7185-7189,U+718b-718e,U+7190-7193,U+7195-7197,U+719a-719e,U+71a1-71a7,U+71a9-71ab,U+71ad-71b2,U+71b4,U+71b6-71b8,U+71ba-71c2,U+71c4-71cd,U+71cf-71d3,U+71d6-71df,U+71e1-71e4,U+71e6,U+71e8-71ed,U+71ef-71f8,U+71fa-7205,U+7207-721c,U+721e-7227,U+7229,U+722b,U+722d"}},{uri:fv,descriptors:{unicodeRange:"U+982e-9874,U+988b,U+988e,U+9892,U+9895,U+9899,U+98a3,U+98a8-98cd,U+98cf-98d0,U+98d4,U+98d6-98d7,U+98db-98dd,U+98e0-98e6,U+98e9-98fa"}},{uri:pv,descriptors:{unicodeRange:"U+7c14-7c15,U+7c17-7c1e,U+7c20-7c25,U+7c28-7c29,U+7c2b-7c37,U+7c39-7c3e,U+7c42-7c4c,U+7c4e-7c72,U+7c75-7c7a,U+7c7e-7c88,U+7c8a-7c90,U+7c93-7c94,U+7c96,U+7c99-7c9b,U+7ca0-7ca1,U+7ca3,U+7ca6-7ca9,U+7cab-7cad,U+7caf-7cb0,U+7cb4-7cb8,U+7cba-7cbb,U+7cbf-7cc0,U+7cc2-7cc4,U+7cc6,U+7cc9,U+7ccb,U+7cce-7cd4"}},{uri:mv,descriptors:{unicodeRange:"U+7d95-7da5,U+7da7-7dad,U+7daf-7e2a"}},{uri:gv,descriptors:{unicodeRange:"U+4a78-4b0a"}},{uri:bv,descriptors:{unicodeRange:"U+9b30-9b31,U+9b33-9b3a,U+9b3d-9b40,U+9b46,U+9b4a-9b4c,U+9b4e,U+9b50,U+9b52-9b53,U+9b55-9bcf"}},{uri:yv,descriptors:{unicodeRange:"U+6a4b-6a4f,U+6a51-6a57,U+6a5a,U+6a5c-6a60,U+6a62-6a64,U+6a66-6a70,U+6a72-6a78,U+6a7a-6a7b,U+6a7d-6a7f,U+6a81-6a83,U+6a85-6a8d,U+6a8f,U+6a92-6a96,U+6a98-6a9f,U+6aa1-6aa8,U+6aaa,U+6aad-6aef"}},{uri:vv,descriptors:{unicodeRange:"U+99c9-9a53"}},{uri:wv,descriptors:{unicodeRange:"U+8550-8555,U+8557-8558,U+855a-855d,U+855f-8563,U+8565-8567,U+8569-8571,U+8573,U+8575-8578,U+857c-857d,U+857f-8583,U+8586,U+8588-858e,U+8590-859a,U+859d-85a3,U+85a5-85a7,U+85a9,U+85ab-85ad,U+85b1-85b6,U+85b8,U+85ba-85c0,U+85c2-85c8,U+85ca-85ce,U+85d1-85d2,U+85d4,U+85d6-85db,U+85dd-85e3,U+85e5-85e8,U+85ea-85fa,U+85fc-85fe,U+8600-8603"}},{uri:Ev,descriptors:{unicodeRange:"U+6fb2,U+6fb4-6fb5,U+6fb7-6fb8,U+6fba-6fbf,U+6fc1,U+6fc3-6fc8,U+6fca-6fd0,U+6fd3-6fdd,U+6fdf,U+6fe2-6fed,U+6ff0-7010,U+7012-7019,U+701c-7022,U+7024-7034,U+7036-7038,U+703a-704b,U+704d-704e,U+7050-7053"}},{uri:xv,descriptors:{unicodeRange:"U+4ba1-4c2c"}},{uri:Sv,descriptors:{unicodeRange:"U+9a54-9a6b,U+9a72,U+9a83,U+9a89,U+9a8d-9a8e,U+9a94-9a95,U+9a99,U+9aa6,U+9aa9-9aaf,U+9ab2-9ab5,U+9ab9,U+9abb,U+9abd-9abf,U+9ac3-9ac4,U+9ac6-9aca,U+9acd-9ad0,U+9ad2,U+9ad4-9ad7,U+9ad9-9ade,U+9ae0,U+9ae2-9ae5,U+9ae7-9aea,U+9aec,U+9aee,U+9af0-9af8,U+9afa,U+9afc-9b02,U+9b04-9b07,U+9b09-9b0e,U+9b10-9b12,U+9b14-9b1e,U+9b20-9b22,U+9b24-9b2e"}},{uri:Mv,descriptors:{unicodeRange:"U+9d1a-9da1"}},{uri:Cv,descriptors:{unicodeRange:"U+9e13-9e1e,U+9e24,U+9e27,U+9e2e,U+9e30,U+9e34,U+9e3b-9e3c,U+9e40,U+9e4d,U+9e50,U+9e52-9e54,U+9e56,U+9e59,U+9e5d,U+9e5f-9e62,U+9e65,U+9e6e-9e6f,U+9e72,U+9e74-9e7d,U+9e80-9e81,U+9e83-9e86,U+9e89-9e8a,U+9e8c-9e91,U+9e94-9e9c,U+9e9e,U+9ea0-9ea5,U+9ea7-9eb3,U+9eb5-9eb7,U+9eb9-9eba,U+9ebc,U+9ebf-9ec3,U+9ec5-9ec8,U+9eca-9ecc,U+9ed0,U+9ed2-9ed3,U+9ed5-9ed7,U+9ed9-9eda,U+9ede,U+9ee1,U+9ee3-9ee4,U+9ee6,U+9ee8,U+9eeb-9eee,U+9ef0-9ef8"}},{uri:kv,descriptors:{unicodeRange:"U+8b1c-8b25,U+8b27-8b65,U+8b67-8b6b,U+8b6d-8b9f,U+8bac,U+8bb1,U+8bbb,U+8bc7,U+8bd0"}},{uri:Iv,descriptors:{unicodeRange:"U+4cad-4d2f"}},{uri:Tv,descriptors:{unicodeRange:"U+9c4b-9c7b,U+9c7d-9c7e,U+9c80,U+9c83-9c84,U+9c89-9c8a,U+9c8c,U+9c8f,U+9c93,U+9c96-9c99,U+9c9d,U+9caa,U+9cac,U+9caf,U+9cb9,U+9cbe-9cc2,U+9cc8-9cc9,U+9cd1-9cd2,U+9cda-9cdb,U+9ce0-9ce1,U+9ce3-9d19"}},{uri:Lv,descriptors:{unicodeRange:"U+9389-938e,U+9390-93c9,U+93cb-93d5,U+93d7-9410"}},{uri:Dv,descriptors:{unicodeRange:"U+20a0-20b5,U+20b9-20ba,U+20bc-20bd,U+4e2c,U+5107,U+5216,U+5293,U+54f3,U+5523,U+5819,U+5adc,U+5c88,U+5e3b,U+5fee,U+62f6,U+63be,U+6484,U+6499,U+67d9,U+67dd,U+6d5e,U+6f46,U+717a,U+71e0,U+72c1,U+73e7,U+75b0,U+7603,U+7722,U+7809,U+7811,U+7946,U+7967,U+799a,U+7b45,U+7ba2,U+8014,U+80d9,U+8159,U+817d,U+81a3,U+81aa,U+8201,U+833c,U+836e,U+83e5,U+8459,U+84f0,U+8729,U+8753,U+87d3,U+89dc,U+8bf6,U+8c2e,U+8e2c,U+8e9c,U+8e9e,U+8ece,U+8fee,U+9139,U+914f,U+9174,U+9191,U+960c,U+9622,U+9a98,U+9b48,U+9ca6,U+9cb0,U+9da2-9e12,U+9e88,U+9f44,U+9f86"}},{uri:Av,descriptors:{unicodeRange:"U+9bd0-9c4a"}},{uri:Rv,descriptors:{unicodeRange:"U+4c2d-4cac"}},{uri:Nv,descriptors:{unicodeRange:"U+4d30-4dab"}},{uri:Pv,descriptors:{unicodeRange:"U+9411-943d,U+943f-946a,U+946c-9484"}},{uri:_v,descriptors:{unicodeRange:"U+9efa,U+9efd,U+9eff-9f0a,U+9f0c,U+9f0f,U+9f11-9f12,U+9f14-9f16,U+9f18,U+9f1a-9f1f,U+9f21,U+9f23-9f2b,U+9f2d-9f2e,U+9f30-9f36,U+9f38,U+9f3a,U+9f3c,U+9f3f-9f43,U+9f45-9f4f,U+9f52-9f7e,U+9f81-9f82,U+9f8d-9f94"}},{uri:Ov,descriptors:{unicodeRange:"U+7e2b-7e3a,U+7e3c-7e40,U+7e42-7e46,U+7e48-7e81,U+7e83-7e9a,U+7e9c-7e9e,U+7eae,U+7eb4,U+7ebb-7ebc,U+7ed6,U+7ee4,U+7eec,U+7ef9,U+7f0a,U+7f10,U+7f1e,U+7f37,U+7f39,U+7f3b"}}],oi=class Fe{constructor(t){I(this,"scene"),I(this,"getSceneFamilies",()=>Fe.getUniqueFamilies(this.scene.getNonDeletedElements())),I(this,"onLoaded",a=>{let n=!0;for(let r of a){let o=`${r.family}-${r.style}-${r.weight}-${r.unicodeRange}`;Fe.loadedFontsCache.has(o)||(Fe.loadedFontsCache.add(o),n=!1)}if(n)return;let i=!1,l=this.scene.getNonDeletedElementsMap();for(let r of this.scene.getNonDeletedElements())if(j(r)){i=!0,Qe.delete(r),pr.clearCache(Oe(r));let o=Tt(r,l);o&&Qe.delete(o)}i&&this.scene.triggerUpdate()}),I(this,"loadSceneFonts",async()=>{let a=this.getSceneFamilies(),n=Fe.getCharsPerFamily(this.scene.getNonDeletedElements());return Fe.loadFontFaces(a,n)}),this.scene=t}static get registered(){return Fe._registered?Fe._initialized||(Fe._registered=new Map([...Fe.init().entries(),...Fe._registered.entries()])):Fe._registered=Fe.init(),Fe._registered}get registered(){return Fe.registered}static async generateFontFaceDeclarations(t){let a=Fe.getUniqueFamilies(t),n=Fe.getCharsPerFamily(t),i=a.find(d=>vu(d).includes(cl));if(i){let d=Fe.getCharacters(n,i);if(r8(d)){let u=hl[cl];n[u]=new Set(d),a.unshift(hl[cl])}}let l=Fe.fontFacesStylesGenerator(a,n),r=3,o=await new qu(l,r).all();return Array.from(new Set(o))}static async loadFontFaces(t,a){for(let{fontFaces:l,metadata:r}of Fe.registered.values())if(!r.local)for(let{fontFace:o}of l)window.document.fonts.has(o)||window.document.fonts.add(o);let n=Fe.fontFacesLoader(t,a),i=10;return(await new qu(n,i).all()).flat().filter(Boolean)}static*fontFacesLoader(t,a){for(let[n,i]of t.entries()){let l=Oe({fontFamily:i,fontSize:16}),r=Fe.getCharacters(a,i);window.document.fonts.check(l,r)||(yield ri(async()=>{try{let o=await window.document.fonts.load(l,r);return[n,o]}catch(o){console.error(`Failed to load font "${l}" from urls "${Fe.registered.get(i)?.fontFaces.map(d=>d.urls)}"`,o)}}))}}static*fontFacesStylesGenerator(t,a){for(let[n,i]of t.entries()){let{fontFaces:l,metadata:r}=Fe.registered.get(i)??{};if(!Array.isArray(l)){console.error(`Couldn't find registered fonts for font-family "${i}"`,Fe.registered);continue}if(!r?.local)for(let[o,d]of l.entries())yield ri(async()=>{try{let u=Fe.getCharacters(a,i),s=await d.toCSS(u);return s?[n*1e4+o,s]:void 0}catch(u){console.error(`Couldn't transform font-face to css for family "${d.fontFace.family}"`,u)}})}}static register(t,a,...n){let i=Ke[t]??hl[t];return this.registered.get(i)||this.registered.set(i,{metadata:a,fontFaces:n.map(({uri:l,descriptors:r})=>new fb(t,l,r))}),this.registered}static init(){let t={registered:new Map},a=(n,...i)=>{let l=Ke[n]??hl[n],r=Js[l]??Js[Ke.Excalifont];Fe.register.call(t,n,r,...i)};return a("Cascadia",...mb),a("Comic Shanns",...wb),a("Excalifont",...Lb),a("Helvetica",...Db),a("Liberation Sans",...Rb),a("Lilita One",..._b),a("Nunito",...Hb),a("Virgil",...Wb),a(cl,...Bv),a(er,...Eb),Fe._initialized=!0,t.registered}static getUniqueFamilies(t){return Array.from(t.reduce((a,n)=>(j(n)&&a.add(n.fontFamily),a),new Set))}static getCharsPerFamily(t){let a={};for(let n of t)if(j(n))for(let i of n.originalText)a[n.fontFamily]||(a[n.fontFamily]=new Set),a[n.fontFamily].add(i);return a}static getCharacters(t,a){return t[a]?Array.from(t[a]).join(""):""}static getAllFamilies(){return Array.from(Fe.registered.keys())}};I(oi,"loadedFontsCache",new Set),I(oi,"_registered"),I(oi,"_initialized",!1),I(oi,"loadElementsFonts",async e=>{let t=oi.getUniqueFamilies(e),a=oi.getCharsPerFamily(e);return oi.loadFontFaces(t,a)});var An=oi,ZU=(e,t,a)=>{let{unitsPerEm:n,ascender:i,descender:l}=An.registered.get(e)?.metadata.metrics||Js[Ke.Virgil].metrics,r=t/n,o=(a-r*i+r*l)/2;return r*i+o},Hi=e=>{let{lineHeight:t}=An.registered.get(e)?.metadata.metrics||Js[Ke.Excalifont].metrics;return t},KU=e=>{let{angle:t,width:a,height:n,x:i,y:l}=e,r=i+a/2,o=l+n/2,d=w(r,o),u;return e.type==="diamond"?u=Ou(O(w(r,l),d,t),O(w(i+a,o),d,t),O(w(r,l+n),d,t),O(w(i,o),d,t)):u=Ou(O(w(i,l),d,t),O(w(i+a,l),d,t),O(w(i+a,l+n),d,t),O(w(i,l+n),d,t)),{type:"polygon",data:u}},zv=(e,t,a=10)=>{let[n,i,l,r,o,d]=Ue(e,t,!0);n-=a,l+=a,i-=a,r+=a;let u=w(o,d),s=O(w(n,i),u,e.angle),c=O(w(l,i),u,e.angle),U=O(w(n,r),u,e.angle),f=O(w(l,r),u,e.angle);return{type:"polygon",data:[s,c,f,U]}},Fv=e=>{let{width:t,height:a,angle:n,x:i,y:l}=e;return{type:"ellipse",data:{center:w(i+t/2,l+a/2),angle:n,halfWidth:t/2,halfHeight:a/2}}},di=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops},$v=(e,t=w(0,0),a,n)=>{let i=d=>O(w(d[0]+t[0],d[1]+t[1]),n,a),l=di(e),r=[],o=w(0,0);for(let d of l){if(d.op==="move"){let u=Fd(d.data);Bt(u!=null,"Ops data is not a point"),o=i(u)}if(d.op==="bcurveTo"){let u=i(w(d.data[0],d.data[1])),s=i(w(d.data[2],d.data[3])),c=i(w(d.data[4],d.data[5]));r.push(kn(o,u,s,c)),o=c}}return{type:"polycurve",data:r}},Hv=e=>{let t=e[0],a=[];for(let n=1;n<e.length;n++){let i=e[n];a.push(le(t,i)),t=i}return a},Xv=(e,t,a=!1)=>{let n=l=>O(Ee(li(ie(l),Dt(e.x,e.y))),t,e.angle),i=Hv(e.points.map(l=>n(l)));return a?{type:"polygon",data:Rs(i.flat())}:{type:"polyline",data:i}},Wv=(e,t,a=w(0,0),n,i)=>{let l=s=>O(w(s[0]+a[0],s[1]+a[1]),i,n);if(e.roundness===null)return{type:"polygon",data:Rs(e.points.map(s=>l(s)))};let r=di(t),o=[],d=!1;for(let s of r)s.op==="move"?(d=!d,d&&o.push(w(s.data[0],s.data[1]))):s.op==="bcurveTo"?d&&(o.push(w(s.data[0],s.data[1])),o.push(w(s.data[2],s.data[3])),o.push(w(s.data[4],s.data[5]))):s.op==="lineTo"&&d&&o.push(w(s.data[0],s.data[1]));let u=q5(o,10,5).map(s=>l(s));return{type:"polygon",data:Rs(u)}},Gv=(e,t)=>{let{angle:a,halfWidth:n,halfHeight:i,center:l}=t,r=n,o=i,d=li(ie(e),it(ie(l),-1)),[u,s]=O(Ee(d),w(0,0),-a),c=Math.abs(u),U=Math.abs(s),f=.707,p=.707;for(let y=0;y<3;y++){let v=r*f,b=o*p,x=(r*r-o*o)*f**3/r,S=(o*o-r*r)*p**3/o,C=v-x,T=b-S,k=c-x,R=U-S,D=Math.hypot(T,C),A=Math.hypot(R,k);f=Math.min(1,Math.max(0,(k*D/A+x)/r)),p=Math.min(1,Math.max(0,(R*D/A+S)/o));let P=Math.hypot(p,f);f/=P,p/=P}let[m,g]=[r*f*Math.sign(u),o*p*Math.sign(s)];return Te(w(u,s),w(m,g))},Vv=(e,t,a=1e-4)=>Gv(e,t)<=a,Yv=(e,t)=>{let{center:a,angle:n,halfWidth:i,halfHeight:l}=t,r=li(ie(e),it(ie(a),-1)),[o,d]=O(Ee(r),w(0,0),-n);return o/i*(o/i)+d/l*(d/l)<=1},gc=(e,t,a=0)=>{switch(t.type){case"polygon":return L7(e,t.data,a);case"ellipse":return Vv(e,t.data,a);case"line":return Ti(e,t.data,a);case"polyline":return JU(e,t.data,a);case"curve":return qU(e,t.data,a);case"polycurve":return jv(e,t.data,a);default:throw Error(`shape ${t} is not implemented`)}},eo=(e,t)=>{switch(t.type){case"polygon":return Bu(e,t.data);case"line":return!1;case"curve":return!1;case"ellipse":return Yv(e,t.data);case"polyline":{let a=Rs(t.data.flat());return Bu(e,a)}case"polycurve":return!1;default:throw Error(`shape ${t} is not implemented`)}},jv=(e,t,a)=>t.some(n=>qU(e,n,a)),Zv=e=>{let[t,a,n,i]=e;return(l,r)=>Math.pow(1-l,3)*i[r]+3*l*Math.pow(1-l,2)*n[r]+3*Math.pow(l,2)*(1-l)*a[r]+t[r]*Math.pow(l,3)},Kv=(e,t=10)=>{let a=Zv(e),n=[a(0,0),a(0,1)],i=[],l=0,r=1/t;for(let o=0;o<t;o++)if(l+=r,l<=1){let d=w(a(l,0),a(l,1));i.push(le(n,d)),n=d}return i},qU=(e,t,a)=>JU(e,Kv(t),a),JU=(e,t,a=1e-4)=>t.some(n=>Ti(e,n,a));function QU(e,t,a){return{center:e,halfWidth:t,halfHeight:a}}var qv=(e,t)=>{let{halfWidth:a,halfHeight:n,center:i}=t,l=a,r=n,o=li(ie(e),it(ie(i),-1)),d=Math.abs(o[0]),u=Math.abs(o[1]),s=.707,c=.707;for(let p=0;p<3;p++){let m=l*s,g=r*c,y=(l*l-r*r)*s**3/l,v=(r*r-l*l)*c**3/r,b=m-y,x=g-v,S=d-y,C=u-v,T=Math.hypot(x,b),k=Math.hypot(C,S);s=Math.min(1,Math.max(0,(S*T/k+y)/l)),c=Math.min(1,Math.max(0,(C*T/k+v)/r));let R=Math.hypot(c,s);s/=R,c/=R}let[U,f]=[l*s*Math.sign(o[0]),r*c*Math.sign(o[1])];return Te(Ee(o),w(U,f))};function Jv({center:e,halfWidth:t,halfHeight:a},[n,i]){let[l,r]=e,o=n[0]-l,d=n[1]-r,u=i[0]-l,s=i[1]-r,c=Math.pow(u-o,2)/Math.pow(t,2)+Math.pow(s-d,2)/Math.pow(a,2),U=2*(o*(u-o)/Math.pow(t,2)+d*(s-d)/Math.pow(a,2)),f=Math.pow(o,2)/Math.pow(t,2)+Math.pow(d,2)/Math.pow(a,2)-1,p=(-U+Math.sqrt(Math.pow(U,2)-4*c*f))/(2*c),m=(-U-Math.sqrt(Math.pow(U,2)-4*c*f))/(2*c),g=[w(o+p*(u-o)+l,d+p*(s-d)+r),w(o+m*(u-o)+l,d+m*(s-d)+r)].filter(y=>!isNaN(y[0])&&!isNaN(y[1]));return g.length===2&&Ra(g[0],g[1])?[g[0]]:g}function ef(e,t=0){let a=Ba(Math.min(e.width,e.height),e);if(a<=0){let c=Xd(w(e.x-t,e.y-t),w(e.x+e.width+t,e.y+e.height+t)),U=le(w(c[0][0]+a,c[0][1]),w(c[1][0]-a,c[0][1])),f=le(w(c[1][0],c[0][1]+a),w(c[1][0],c[1][1]-a)),p=le(w(c[0][0]+a,c[1][1]),w(c[1][0]-a,c[1][1])),m=le(w(c[0][0],c[1][1]-a),w(c[0][0],c[0][1]+a));return[[U,f,p,m],[]]}let n=w(e.x+e.width/2,e.y+e.height/2),i=Xd(w(e.x,e.y),w(e.x+e.width,e.y+e.height)),l=le(w(i[0][0]+a,i[0][1]),w(i[1][0]-a,i[0][1])),r=le(w(i[1][0],i[0][1]+a),w(i[1][0],i[1][1]-a)),o=le(w(i[0][0]+a,i[1][1]),w(i[1][0]-a,i[1][1])),d=le(w(i[0][0],i[1][1]-a),w(i[0][0],i[0][1]+a)),u=[it(Pt(ie(w(i[0][0]-t,i[0][1]-t),n)),t),it(Pt(ie(w(i[1][0]+t,i[0][1]-t),n)),t),it(Pt(ie(w(i[1][0]+t,i[1][1]+t),n)),t),it(Pt(ie(w(i[0][0]-t,i[1][1]+t),n)),t)],s=[kn(Ee(u[0],d[1]),Ee(u[0],w(d[1][0]+2/3*(i[0][0]-d[1][0]),d[1][1]+2/3*(i[0][1]-d[1][1]))),Ee(u[0],w(l[0][0]+2/3*(i[0][0]-l[0][0]),l[0][1]+2/3*(i[0][1]-l[0][1]))),Ee(u[0],l[0])),kn(Ee(u[1],l[1]),Ee(u[1],w(l[1][0]+2/3*(i[1][0]-l[1][0]),l[1][1]+2/3*(i[0][1]-l[1][1]))),Ee(u[1],w(r[0][0]+2/3*(i[1][0]-r[0][0]),r[0][1]+2/3*(i[0][1]-r[0][1]))),Ee(u[1],r[0])),kn(Ee(u[2],r[1]),Ee(u[2],w(r[1][0]+2/3*(i[1][0]-r[1][0]),r[1][1]+2/3*(i[1][1]-r[1][1]))),Ee(u[2],w(o[1][0]+2/3*(i[1][0]-o[1][0]),o[1][1]+2/3*(i[1][1]-o[1][1]))),Ee(u[2],o[1])),kn(Ee(u[3],o[0]),Ee(u[3],w(o[0][0]+2/3*(i[0][0]-o[0][0]),o[0][1]+2/3*(i[1][1]-o[0][1]))),Ee(u[3],w(d[0][0]+2/3*(i[0][0]-d[0][0]),d[0][1]+2/3*(i[1][1]-d[0][1]))),Ee(u[3],d[0]))];return[[le(s[0][3],s[1][0]),le(s[1][3],s[2][0]),le(s[2][3],s[3][0]),le(s[3][3],s[0][0])],s]}function tf(e,t=0){let[a,n,i,l,r,o,d,u]=Tf(e),s=Ba(Math.abs(a-d),e),c=Ba(Math.abs(l-n),e);if(e.roundness?.type==null){let[b,x,S,C]=[w(e.x+a,e.y+n-t),w(e.x+i+t,e.y+l),w(e.x+r,e.y+o+t),w(e.x+d-t,e.y+u)],T=le(w(b[0]+s,b[1]+c),w(x[0]-s,x[1]-c)),k=le(w(x[0]-s,x[1]+c),w(S[0]+s,S[1]-c)),R=le(w(S[0]-s,S[1]-c),w(C[0]+s,C[1]+c)),D=le(w(C[0]+s,C[1]-c),w(b[0]-s,b[1]+c));return[[T,k,R,D],[]]}let U=w(e.x+e.width/2,e.y+e.height/2),[f,p,m,g]=[w(e.x+a,e.y+n),w(e.x+i,e.y+l),w(e.x+r,e.y+o),w(e.x+d,e.y+u)],y=[it(Pt(ie(p,U)),t),it(Pt(ie(m,U)),t),it(Pt(ie(g,U)),t),it(Pt(ie(f,U)),t)],v=[kn(Ee(y[0],w(p[0]-s,p[1]-c)),Ee(y[0],p),Ee(y[0],p),Ee(y[0],w(p[0]-s,p[1]+c))),kn(Ee(y[1],w(m[0]+s,m[1]-c)),Ee(y[1],m),Ee(y[1],m),Ee(y[1],w(m[0]-s,m[1]-c))),kn(Ee(y[2],w(g[0]+s,g[1]+c)),Ee(y[2],g),Ee(y[2],g),Ee(y[2],w(g[0]+s,g[1]-c))),kn(Ee(y[3],w(f[0]-s,f[1]+c)),Ee(y[3],f),Ee(y[3],f),Ee(y[3],w(f[0]+s,f[1]+c)))];return[[le(v[0][3],v[1][0]),le(v[1][3],v[2][0]),le(v[2][3],v[3][0]),le(v[3][3],v[0][0])],v]}var bc=e=>{if(e.type==="arrow")return!1;let t=!Pa(e.backgroundColor)||wa(e)||ya(e)||j(e);return e.type==="line"||e.type==="freedraw"?t&&Nn(e.points):t||Le(e)},Sl=({x:e,y:t,element:a,shape:n,threshold:i=10,frameNameBound:l=null})=>{let r=bc(a)&&eo(w(e,t),n)||gc(w(e,t),n,i);return!r&&l&&(r=eo(w(e,t),{type:"polygon",data:KU(l).data})),r},yc=(e,t,a,n,i=0)=>{let[l,r,o,d]=za(a,n);return l-=i,r-=i,o+=i,d+=i,Ru(w(l,r),w(e,t),w(o,d))},Qv=(e,t)=>!Sl(e)&&!af(e.x,e.y,lf(e.element,t))&&yc(e.x,e.y,e.element,t),af=(e,t,a)=>!!a&&eo(w(e,t),a),nf=(e,t,a=0)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return ew(e,t,a);case"diamond":return tw(e,t,a);case"ellipse":return aw(e,t,a);default:throw new Error(`Unimplemented element type '${e.type}'`)}},ew=(e,t,a=0)=>{let n=w(e.x+e.width/2,e.y+e.height/2),i=O(t[0],n,-e.angle),l=O(t[1],n,-e.angle),[r,o]=ef(e,a);return[...r.map(d=>dr(le(i,l),d)).filter(d=>d!=null).map(d=>O(d,n,e.angle)),...o.flatMap(d=>Pu(d,le(i,l))).filter(d=>d!=null).map(d=>O(d,n,e.angle))].filter((d,u,s)=>s.findIndex(c=>Ra(d,c))===u)},tw=(e,t,a=0)=>{let n=w(e.x+e.width/2,e.y+e.height/2),i=O(t[0],n,-e.angle),l=O(t[1],n,-e.angle),[r,o]=tf(e,a);return[...r.map(d=>dr(le(i,l),d)).filter(d=>d!=null).map(d=>O(d,n,e.angle)),...o.flatMap(d=>Pu(d,le(i,l))).filter(d=>d!=null).map(d=>O(d,n,e.angle))].filter((d,u,s)=>s.findIndex(c=>Ra(d,c))===u)},aw=(e,t,a=0)=>{let n=w(e.x+e.width/2,e.y+e.height/2),i=O(t[0],n,-e.angle),l=O(t[1],n,-e.angle);return Jv(QU(n,e.width/2+a,e.height/2+a),$d(i,l)).map(r=>O(r,n,e.angle))},ke={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},L={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:en?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SLASH:"/",A:"a",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},nw=new Map([[L.Z,ke.Z],[L.Y,ke.Y]]),iw=e=>/^[a-z]$/.test(e.toLowerCase()),vc=(e,t)=>{if(t===e.key.toLowerCase())return!0;let a=nw.get(t);return!!(a&&!iw(e.key)&&e.code===a)},gr=e=>e===L.ARROW_LEFT||e===L.ARROW_RIGHT||e===L.ARROW_DOWN||e===L.ARROW_UP,wc=e=>e.altKey,br=e=>e.shiftKey,yr=e=>e.shiftKey,Ec=[{icon:x8,value:"selection",key:L.V,numericKey:L[1],fillable:!0},{icon:S8,value:"rectangle",key:L.R,numericKey:L[2],fillable:!0},{icon:M8,value:"diamond",key:L.D,numericKey:L[3],fillable:!0},{icon:C8,value:"ellipse",key:L.O,numericKey:L[4],fillable:!0},{icon:k8,value:"arrow",key:L.A,numericKey:L[5],fillable:!0},{icon:I8,value:"line",key:L.L,numericKey:L[6],fillable:!0},{icon:mr,value:"freedraw",key:[L.P,L.X],numericKey:L[7],fillable:!1},{icon:sU,value:"text",key:L.T,numericKey:L[8],fillable:!1},{icon:L8,value:"image",key:null,numericKey:L[9],fillable:!1},{icon:D8,value:"eraser",key:L.E,numericKey:L[0],fillable:!1}],lw=e=>Ec.find((t,a)=>t.numericKey!=null&&e===t.numericKey.toString()||t.key&&(typeof t.key=="string"?t.key===e:t.key.includes(e)))?.value||null,Rn=(e,t)=>{switch(e.type){case"rectangle":case"diamond":case"frame":case"magicframe":case"embeddable":case"image":case"iframe":case"text":case"selection":return KU(e);case"arrow":case"line":{let a=Qe.get(e)?.[0]??Qe.generateElementShape(e,null)[0],[,,,,n,i]=Ue(e,t);return bc(e)?Wv(e,a,w(e.x,e.y),e.angle,w(n,i)):$v(a,w(e.x,e.y),e.angle,w(n,i))}case"ellipse":return Fv(e);case"freedraw":{let[,,,,a,n]=Ue(e,t);return Xv(e,w(a,n),bc(e))}}},lf=(e,t)=>{let a=pe(e,t);return a?e.type==="arrow"?Rn({...a,...Z.getBoundTextElementPosition(e,a,t)},t):Rn(a,t):null},rf=(e,t)=>{let a=Qe.generateElementShape(e,null);if(!a)return null;let n=di(a[0]),i=w(0,0),l=0,r=1/0,o=null;for(;l<n.length;){let{op:d,data:u}=n[l];if(d==="move"&&(Bt(S7(u),"The returned ops is not compatible with a point"),i=u),d==="bcurveTo"){let s=i,c=w(u[0],u[1]),U=w(u[2],u[3]),f=w(u[4],u[5]),p=Te(f,t);p<r&&(r=p,o=[s,c,U,f]),i=f}l++}return o},sf=(e,t,a,n,i)=>{let l=(d,u)=>Math.pow(1-d,3)*n[u]+3*d*Math.pow(1-d,2)*a[u]+3*Math.pow(d,2)*(1-d)*t[u]+e[u]*Math.pow(d,3),r=l(i,0),o=l(i,1);return w(r,o)},rw=(e,t)=>{let a=rf(e,t);if(!a)return[];let n=[],i=1;for(;i>0;){let l=sf(a[0],a[1],a[2],a[3],i);n.push(w(l[0],l[1])),i-=.05}return n.length&&Ra(n.at(-1),t)&&n.push(w(t[0],t[1])),n},of=(e,t)=>{let a=[];a[0]=0;let n=rw(e,t),i=0,l=0;for(;i<n.length-1;){let r=Te(n[i],n[i+1]);l+=r,a.push(l),i++}return a},sw=(e,t)=>of(e,t).at(-1),ow=(e,t,a)=>{let n=of(e,t),i=n.length-1,l=n.at(-1),r=a*l,o=0,d=i,u=0;for(;o<d;)u=Math.floor(o+(d-o)/2),n[u]<r?o=u+1:d=u;return n[u]>r&&u--,n[u]===r?u/i:1-(u+(r-n[u])/(n[u+1]-n[u]))/i},rn=(e,t)=>{let a={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,midX:e.x+e.width/2,midY:e.y+e.height/2},n=w(a.midX,a.midY),[i,l]=O(w(a.minX,a.minY),n,e.angle),[r,o]=O(w(a.maxX,a.minY),n,e.angle),[d,u]=O(w(a.maxX,a.maxY),n,e.angle),[s,c]=O(w(a.minX,a.maxY),n,e.angle),U=[Math.min(i,r,d,s),Math.min(l,o,u,c),Math.max(i,r,d,s),Math.max(l,o,u,c)];if(t){let[f,p,m,g]=t;return[U[0]-g,U[1]-f,U[2]+p,U[3]+m]}return U},Ml=(e,t)=>e[0]>t[0]&&e[0]<t[2]&&e[1]>t[1]&&e[1]<t[3],Ba=(e,t)=>{if(t.roundness?.type===Ut.PROPORTIONAL_RADIUS||t.roundness?.type===Ut.LEGACY)return e*Bd;if(t.roundness?.type===Ut.ADAPTIVE_RADIUS){let a=t.roundness?.value??p7,n=a/Bd;return e<=n?e*Bd:a}return 0},Nn=(e,t=1)=>{if(e.length>=3){let[a,n]=[e[0],e[e.length-1]];return Te(a,n)<=ys/t}return!1},kt=10,dw=(e,t,a,n,i,l,r)=>{let{width:o,height:d}=Pn(e),u=a/o,s=n/d,c=(e.crop?.x??0)/u,U=(e.crop?.y??0)/s,f=O(w(i,l),w(e.x+e.width/2,e.y+e.height/2),-e.angle);i=f[0],l=f[1];let p=e.width,m=e.height,g=e.crop??{x:0,y:0,width:a,height:n,naturalWidth:a,naturalHeight:n},y=g.height,v=g.width,b=e.scale[0]===-1,x=e.scale[1]===-1,S=l-e.y,C=i-e.x;t.includes("n")&&(m=we(e.height-S,kt,x?d-U:e.height+U)),t.includes("s")&&(S=l-e.y-e.height,m=we(e.height+S,kt,x?e.height+U:d-U)),t.includes("e")&&(C=i-e.x-e.width,p=we(e.width+C,kt,b?e.width+c:o-c)),t.includes("w")&&(p=we(e.width-C,kt,b?o-c:e.width+c));let T=D=>{D.height=m*s,D.width=p*u};T(g);let k=(D,A)=>{T(A),D.includes("n")&&(x||(A.y+=y-A.height)),D.includes("s")&&x&&(A.y+=y-A.height),D.includes("e")&&b&&(A.x+=v-A.width),D.includes("w")&&(b||(A.x+=v-A.width))};switch(t){case"n":{if(r){let D=c+e.width/2,A=o-c-e.width/2,P=Math.min(D,A)*2;p=we(m*r,kt,P),m=p/r}k(t,g),r&&(g.x+=(v-g.width)/2);break}case"s":{if(r){let D=c+e.width/2,A=o-c-e.width/2,P=Math.min(D,A)*2;p=we(m*r,kt,P),m=p/r}k(t,g),r&&(g.x+=(v-g.width)/2);break}case"w":{if(r){let D=U+e.height/2,A=d-U-e.height/2,P=Math.min(D,A)*2;m=we(p/r,kt,P),p=m*r}k(t,g),r&&(g.y+=(y-g.height)/2);break}case"e":{if(r){let D=U+e.height/2,A=d-U-e.height/2,P=Math.min(D,A)*2;m=we(p/r,kt,P),p=m*r}k(t,g),r&&(g.y+=(y-g.height)/2);break}case"ne":{if(r)if(C>-S){let D=x?d-U:U+e.height;m=we(p/r,kt,D),p=m*r}else{let D=b?c+e.width:o-c;p=we(m*r,kt,D),m=p/r}k(t,g);break}case"nw":{if(r)if(C<S){let D=x?d-U:U+e.height;m=we(p/r,kt,D),p=m*r}else{let D=b?o-c:c+e.width;p=we(m*r,kt,D),m=p/r}k(t,g);break}case"se":{if(r)if(C>S){let D=x?U+e.height:d-U;m=we(p/r,kt,D),p=m*r}else{let D=b?c+e.width:o-c;p=we(m*r,kt,D),m=p/r}k(t,g);break}case"sw":{if(r)if(-C>S){let D=x?U+e.height:d-U;m=we(p/r,kt,D),p=m*r}else{let D=b?o-c:c+e.width;p=we(m*r,kt,D),m=p/r}k(t,g);break}}let R=cw(e,t,p,m,!!r);return Du(g.width,g.naturalWidth)&&Du(g.height,g.naturalHeight)&&(g=null),{x:R[0],y:R[1],width:p,height:m,crop:g}},cw=(e,t,a,n,i)=>{let[l,r,o,d]=ci(e,e.width,e.height,!0),u=w(l,r),s=w(o,d),c=sr(u,s),[U,f,p,m]=ci(e,a,n,!0),g=p-U,y=m-f,v=[...u];if(["n","w","nw"].includes(t)&&(v=[s[0]-Math.abs(g),s[1]-Math.abs(y)]),t==="ne"){let k=[u[0],s[1]];v=[k[0],k[1]-Math.abs(y)]}if(t==="sw"){let k=[s[0],u[1]];v=[k[0]-Math.abs(g),k[1]]}i&&(["s","n"].includes(t)&&(v[0]=c[0]-g/2),["e","w"].includes(t)&&(v[1]=c[1]-y/2));let b=e.angle,x=O(v,c,b),S=[v[0]+Math.abs(g)/2,v[1]+Math.abs(y)/2],C=O(S,c,b);v=O(x,C,-b);let T=[...v];return T[0]+=e.x-U,T[1]+=e.y-f,T},hw=(e,t)=>{if(e.crop){let{width:a,height:n}=Pn(e),[i,l,r,o,d,u]=Ue(e,t),s=ie(O(w(i,l),w(d,u),e.angle)),c=ie(O(w(r,l),w(d,u),e.angle)),U=Pt(Ds(c,s)),f=ie(O(w(i,o),w(d,u),e.angle)),p=Ds(f,s),m=Pt(p),{cropX:g,cropY:y}=uw(e.crop,e.scale),v=li(li(s,it(U,-g*a/e.crop.naturalWidth)),it(m,-y*n/e.crop.naturalHeight)),b=Ee(li(li(v,it(U,a/2)),it(m,n/2))),x=O(Ee(v),b,-e.angle);return{...e,x:x[0],y:x[1],width:a,height:n,crop:null}}return e},Pn=e=>{if(e.crop){let t=e.width/(e.crop.width/e.crop.naturalWidth),a=e.height/(e.crop.height/e.crop.naturalHeight);return{width:t,height:a}}return{width:e.width,height:e.height}},uw=(e,t)=>{let a=e.x,n=e.y,i=t[0]===-1,l=t[1]===-1;return i&&(a=e.naturalWidth-Math.abs(a)-e.width),l&&(n=e.naturalHeight-Math.abs(n)-e.height),{cropX:a,cropY:n}},Uw=(e,t=!1)=>{let a=e.crop;if(!a)return null;let n=e.scale[0]===-1,i=e.scale[1]===-1,l=a.x,r=a.y;if(n&&(l=a.naturalWidth-a.width-a.x),i&&(r=a.naturalHeight-a.height-a.y),t)return{x:l,y:r};let{width:o,height:d}=Pn(e);return{x:l/(a.naturalWidth/o),y:r/(a.naturalHeight/d)}},df="invert(100%) hue-rotate(180deg) saturate(1.25)",fw=tn(),cf=(e,t)=>ba(e)&&!t.imageCache.has(e.fileId),hf=(e,t,a)=>a.theme===Se.DARK&&ba(e)&&!cf(e,t)&&t.imageCache.get(e.fileId)?.mimeType!==ne.svg,to=e=>{switch(e.type){case"freedraw":return e.strokeWidth*12;case"text":return e.fontSize/2;default:return 20}},uf=(e,t,a,n,i=1)=>{let l=(t?.opacity??100)*e.opacity/1e4*i;return(a.has(e.id)||n&&n.some(r=>r.id===e.id)||t&&a.has(t.id))&&(l*=f7/100),l},pw=(e,t,a)=>{let n=to(e),[i,l,r,o]=Ue(e,t),d=he(e)||va(e)?Ot(i,r):e.width,u=he(e)||va(e)?Ot(l,o):e.height,s=d*window.devicePixelRatio+n*2,c=u*window.devicePixelRatio+n*2,U=a.value;return(s*U>32767||c*U>32767)&&(U=Math.min(32767/s,32767/c)),s*c*U*U>16777216&&(U=Math.sqrt(16777216/(s*c))),s=Math.floor(s*U),c=Math.floor(c*U),{width:s,height:c,scale:U}},Uf=(e,t,a,n,i)=>{let l=document.createElement("canvas"),r=l.getContext("2d"),o=to(e),{width:d,height:u,scale:s}=pw(e,t,a);if(!d||!u)return null;l.width=d,l.height=u;let c=-100,U=0;if(he(e)||va(e)){let[y,v]=Ue(e,t);c=e.x>y?Ot(e.x,y)*window.devicePixelRatio*s:0,U=e.y>v?Ot(e.y,v)*window.devicePixelRatio*s:0,r.translate(c,U)}r.save(),r.translate(o*s,o*s),r.scale(window.devicePixelRatio*s,window.devicePixelRatio*s);let f=Jn.canvas(l);hf(e,n,i)&&(r.filter=df),ao(e,f,r,n),r.restore();let p=pe(e,t),m=document.createElement("canvas"),g=m.getContext("2d");if(ge(e)&&p){let[y,v,b,x]=Ue(e,t),S=Math.max(Ot(y,b),Ot(v,x));m.width=S*window.devicePixelRatio*s+o*s*10,m.height=S*window.devicePixelRatio*s+o*s*10,g.translate(m.width/2,m.height/2),g.rotate(e.angle),g.drawImage(l,-l.width/2,-l.height/2,l.width,l.height);let[,,,,C,T]=Ue(p,t);g.rotate(-e.angle);let k=(m.width-l.width)/2,R=(m.height-l.height)/2,D=m.width/2-(C-y)*window.devicePixelRatio*s-k-o*s,A=m.height/2-(T-v)*window.devicePixelRatio*s-R-o*s;g.translate(-D,-A),g.clearRect(-(p.width/2+gt)*window.devicePixelRatio*s,-(p.height/2+gt)*window.devicePixelRatio*s,(p.width+gt*2)*window.devicePixelRatio*s,(p.height+gt*2)*window.devicePixelRatio*s)}return{element:e,canvas:l,theme:i.theme,scale:s,zoomValue:a.value,canvasOffsetX:c,canvasOffsetY:U,boundTextElementVersion:pe(e,t)?.version||null,containingFrameOpacity:ra(e,t)?.opacity||100,boundTextCanvas:m,angle:e.angle,imageCrop:Le(e)?e.crop:null}},mw=14,ff=document.createElement("img");ff.src=`data:${ne.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 pf=document.createElement("img");pf.src=`data:${ne.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 gw=(e,t)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);let a=Math.min(e.width,e.height),n=Math.min(a,Math.min(a*.4,100));t.drawImage(e.status==="error"?pf:ff,e.width/2-n/2,e.height/2-n/2,n,n)},ao=(e,t,a,n,i)=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":{a.lineJoin="round",a.lineCap="round",t.draw(Qe.get(e));break}case"arrow":case"line":{a.lineJoin="round",a.lineCap="round",Qe.get(e).forEach(l=>{t.draw(l)});break}case"freedraw":{a.save(),a.fillStyle=e.strokeColor;let l=vw(e),r=Qe.get(e);r&&t.draw(r),a.fillStyle=e.strokeColor,a.fill(l),a.restore();break}case"image":{let l=ba(e)?n.imageCache.get(e.fileId)?.image:void 0;if(l!=null&&!(l instanceof Promise)){e.roundness&&a.roundRect&&(a.beginPath(),a.roundRect(0,0,e.width,e.height,Ba(Math.min(e.width,e.height),e)),a.clip());let{x:r,y:o,width:d,height:u}=e.crop?e.crop:{x:0,y:0,width:l.naturalWidth,height:l.naturalHeight};a.drawImage(l,r,o,d,u,0,0,e.width,e.height)}else gw(e,a);break}default:if(j(e)){let l=Hu(e.text),r=l&&!a.canvas.isConnected;r&&document.body.appendChild(a.canvas),a.canvas.setAttribute("dir",l?"rtl":"ltr"),a.save(),a.font=Oe(e),a.fillStyle=e.strokeColor,a.textAlign=e.textAlign;let o=e.text.replace(/\r\n?/g,`
`).split(`
`),d=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,u=fr(e.fontSize,e.lineHeight),s=ZU(e.fontFamily,e.fontSize,u);for(let c=0;c<o.length;c++)a.fillText(o[c],d,c*u+s);a.restore(),r&&a.canvas.remove()}else throw new Error(`Unimplemented type ${e.type}`)}},xc=new WeakMap,mf=(e,t,a,n)=>{let i=a?n.zoom:fw.zoom,l=xc.get(e),r=l&&l.zoomValue!==i.value&&!n?.shouldCacheIgnoreZoom,o=pe(e,t),d=o?.version||null,u=Le(e)?e.crop:null,s=ra(e,t)?.opacity||100;if(!l||r||l.theme!==n.theme||l.boundTextElementVersion!==d||l.imageCrop!==u||l.containingFrameOpacity!==s||ge(e)&&o&&e.angle!==l.angle){let c=Uf(e,t,i,a,n);return c?(xc.set(e,c),c):null}return l},Sc=(e,t,a,n,i)=>{let l=e.element,r=to(l),o=e.scale,[d,u,s,c]=Ue(l,i),U=((d+s)/2+n.scrollX)*window.devicePixelRatio,f=((u+c)/2+n.scrollY)*window.devicePixelRatio;t.save(),t.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);let p=pe(l,i);if(ge(l)&&p){let m=(e.boundTextCanvas.width-e.canvas.width)/2,g=(e.boundTextCanvas.height-e.canvas.height)/2;t.translate(U,f),t.drawImage(e.boundTextCanvas,-(s-d)/2*window.devicePixelRatio-m/o-r,-(c-u)/2*window.devicePixelRatio-g/o-r,e.boundTextCanvas.width/o,e.boundTextCanvas.height/o)}else t.translate(U,f),t.rotate(l.angle),"scale"in e.element&&!cf(l,a)&&t.scale(e.element.scale[0],e.element.scale[1]),t.translate(-U,-f),t.drawImage(e.canvas,(d+n.scrollX)*window.devicePixelRatio-r*e.scale/e.scale,(u+n.scrollY)*window.devicePixelRatio-r*e.scale/e.scale,e.canvas.width/e.scale,e.canvas.height/e.scale),me.VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX;t.restore()},bw=(e,t,a,n)=>{t.save(),t.translate(e.x+a.scrollX,e.y+a.scrollY),t.fillStyle="rgba(0, 0, 200, 0.04)";let i=.5/a.zoom.value;t.fillRect(i,i,e.width,e.height),t.lineWidth=1/a.zoom.value,t.strokeStyle=n,t.strokeRect(i,i,e.width,e.height),t.restore()},Xi=(e,t,a,n,i,l,r)=>{let o=r.openDialog?.name==="elementLinkSelector"&&!r.selectedElementIds[e.id]&&!r.hoveredElementIds[e.id];switch(i.globalAlpha=uf(e,ra(e,t),l.elementsPendingErasure,l.pendingFlowchartNodes,o?ku:1),e.type){case"magicframe":case"frame":{r.frameRendering.enabled&&r.frameRendering.outline&&(i.save(),i.translate(e.x+r.scrollX,e.y+r.scrollY),i.fillStyle="rgba(0, 0, 200, 0.04)",i.lineWidth=qe.strokeWidth/r.zoom.value,i.strokeStyle=qe.strokeColor,Hs(e)&&(i.strokeStyle=r.theme===Se.LIGHT?"#7affd7":"#1d8264"),i.roundRect?(i.beginPath(),i.roundRect(0,0,e.width,e.height,qe.radius/r.zoom.value),i.stroke(),i.closePath()):i.strokeRect(0,0,e.width,e.height),i.restore());break}case"freedraw":{if(Qe.generateElementShape(e,null),l.isExporting){let[d,u,s,c]=Ue(e,t),U=(d+s)/2+r.scrollX,f=(u+c)/2+r.scrollY,p=(s-d)/2-(e.x-d),m=(c-u)/2-(e.y-u);i.save(),i.translate(U,f),i.rotate(e.angle),i.translate(-p,-m),ao(e,n,i,l),i.restore()}else{let d=mf(e,a,l,r);if(!d)return;Sc(d,i,l,r,a)}break}case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":case"iframe":case"embeddable":{if(Qe.generateElementShape(e,l),l.isExporting){let[d,u,s,c]=Ue(e,t),U=(d+s)/2+r.scrollX,f=(u+c)/2+r.scrollY,p=(s-d)/2-(e.x-d),m=(c-u)/2-(e.y-u);if(j(e)){let y=Tt(e,t);if(ge(y)){let v=Z.getBoundTextElementPosition(y,e,t);p=(s-d)/2-(v.x-d),m=(c-u)/2-(v.y-u)}}i.save(),i.translate(U,f),hf(e,l,r)&&(i.filter="none");let g=pe(e,t);if(ge(e)&&g){let y=document.createElement("canvas"),v=y.getContext("2d"),b=Math.max(Ot(d,s),Ot(u,c)),x=to(e);y.width=b*r.exportScale+x*10*r.exportScale,y.height=b*r.exportScale+x*10*r.exportScale,v.translate(y.width/2,y.height/2),v.scale(r.exportScale,r.exportScale),p=e.width/2-(e.x-d),m=e.height/2-(e.y-u),v.rotate(e.angle);let S=Jn.canvas(y);v.translate(-p,-m),ao(e,S,v,l),v.translate(p,m),v.rotate(-e.angle);let[,,,,C,T]=Ue(g,t),k=(d+s)/2-C,R=(u+c)/2-T;v.translate(-k,-R),v.clearRect(-g.width/2,-g.height/2,g.width,g.height),i.scale(1/r.exportScale,1/r.exportScale),i.drawImage(y,-y.width/2,-y.height/2,y.width,y.height)}else i.rotate(e.angle),e.type==="image"&&i.scale(e.scale[0],e.scale[1]),i.translate(-p,-m),ao(e,n,i,l);i.restore()}else{let d=mf(e,a,l,r);if(!d)return;let u=i.imageSmoothingEnabled;if(!r?.shouldCacheIgnoreZoom&&(!e.angle||w7(e.angle))&&(i.imageSmoothingEnabled=!1),e.id===r.croppingElementId&&Le(d.element)&&d.element.crop!==null){i.save(),i.globalAlpha=.1;let s=Uf(hw(d.element,t),a,r.zoom,l,r);s&&Sc(s,i,l,r,a),i.restore()}Sc(d,i,l,r,a),i.imageSmoothingEnabled=u}break}default:throw new Error(`Unimplemented type ${e.type}`)}i.globalAlpha=1},gf=new WeakMap([]);function yw(e){let t=Mc(e),a=new Path2D(t);return gf.set(e,a),a}function vw(e){return gf.get(e)}function Mc(e){let t=e.simulatePressure?e.points:e.points.length?e.points.map(([n,i],l)=>[n,i,e.pressures[l]]):[[0,0,.5]],a={simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:n=>Math.sin(n*Math.PI/2),last:!!e.lastCommittedPoint};return Ew(G5(t,a))}function bf(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var ww=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;function Ew(e){if(!e.length)return"";let t=e.length-1;return e.reduce((a,n,i,l)=>(i===t?a.push(n,bf(n,l[0]),"L",l[0],"Z"):a.push(n,bf(n,l[i+1])),a),["M",e[0],"Q"]).join(" ").replace(ww,"$1")}var Cl=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="line"||e==="freedraw",Cc=e=>e!=="image"&&e!=="frame"&&e!=="magicframe",yf=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line",vf=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="arrow"||e==="line",kc=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image",wf=e=>e==="arrow",no=e=>e==="arrow",lt=[1,0],It=[0,1],ta=[-1,0],aa=[0,-1],io=(e,t)=>{let a=rr(Math.atan2(t[1]-e[1],t[0]-e[0]));return a>=315||a<45?aa:a>=45&&a<135?lt:a>=135&&a<225?It:ta},Wi=e=>{let[t,a]=e,n=Math.abs(t),i=Math.abs(a);return t>i?lt:t<=-i?ta:a>n?It:aa},vr=(e,t)=>Wi(ie(e,t)),_n=(e,t)=>On(vr(e,t)),rt=(e,t)=>e[0]===t[0]&&e[1]===t[1],On=e=>rt(e,lt)||rt(e,ta),Ef=(e,t,a)=>{let n=Lc(t);if(e.type==="diamond"){if(a[0]<e.x)return ta;if(a[1]<e.y)return aa;if(a[0]>e.x+e.width)return lt;if(a[1]>e.y+e.height)return It;let d=O(Cn(w(e.x+e.width/2,e.y),n,2),n,e.angle),u=O(Cn(w(e.x+e.width,e.y+e.height/2),n,2),n,e.angle),s=O(Cn(w(e.x+e.width/2,e.y+e.height),n,2),n,e.angle),c=O(Cn(w(e.x,e.y+e.height/2),n,2),n,e.angle);return gl([d,u,n],a)?io(d,u):gl([u,s,n],a)?io(u,s):gl([s,c,n],a)?io(s,c):io(c,d)}let i=Cn(w(t[0],t[1]),n,2),l=Cn(w(t[2],t[1]),n,2),r=Cn(w(t[0],t[3]),n,2),o=Cn(w(t[2],t[3]),n,2);return gl([i,l,n],a)?aa:gl([l,o,n],a)?lt:gl([o,r,n],a)?It:ta},xf=e=>[e[0]===0?0:e[0]>0?-1:1,e[1]===0?0:e[1]>0?-1:1],xw=e=>[8,8+e],Sf=e=>[1.5,6+e];function Sw(e){let t=e.roughness,a=Math.max(e.width,e.height),n=Math.min(e.width,e.height);return n>=20&&a>=50||n>=15&&e.roundness&&kc(e.type)||he(e)&&a>=50?t:Math.min(t/(a<10?3:2),2.5)}var ha=(e,t=!1)=>{let a={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?xw(e.strokeWidth):e.strokeStyle==="dotted"?Sf(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:Sw(e),stroke:e.strokeColor,preserveVertices:t||e.roughness<Su.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return a.fillStyle=e.fillStyle,a.fill=Pa(e.backgroundColor)?void 0:e.backgroundColor,e.type==="ellipse"&&(a.curveFitting=1),a;case"line":case"freedraw":return Nn(e.points)&&(a.fillStyle=e.fillStyle,a.fill=e.backgroundColor==="transparent"?void 0:e.backgroundColor),a;case"arrow":return a;default:throw new Error(`Unimplemented type ${e.type}`)}},Mf=(e,t,a)=>ya(e)&&(t||ea(e)&&a?.get(e.id)!==!0)&&Pa(e.backgroundColor)&&Pa(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:si(e)?{...e,strokeColor:Pa(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:Pa(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,Cf=(e,t,a,n,i,l,r)=>{let o=Af(e,t,a,n);if(o===null)return[];let d=(u,s)=>{if(u===null)return[];let[,,c,U,f,p]=u;return[i.line(c,U,f,p,s)]};switch(n){case"dot":case"circle":case"circle_outline":{let[u,s,c]=o;return delete l.strokeLineDash,[i.circle(u,s,c,{...l,fill:n==="circle_outline"?r:e.strokeColor,fillStyle:"solid",stroke:e.strokeColor,roughness:Math.min(.5,l.roughness||0)})]}case"triangle":case"triangle_outline":{let[u,s,c,U,f,p]=o;return delete l.strokeLineDash,[i.polygon([[u,s],[c,U],[f,p],[u,s]],{...l,fill:n==="triangle_outline"?r:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,l.roughness||0)})]}case"diamond":case"diamond_outline":{let[u,s,c,U,f,p,m,g]=o;return delete l.strokeLineDash,[i.polygon([[u,s],[c,U],[f,p],[m,g],[u,s]],{...l,fill:n==="diamond_outline"?r:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,l.roughness||0)})]}case"crowfoot_one":return d(o,l);default:{let[u,s,c,U,f,p]=o;if(e.strokeStyle==="dotted"){let m=Sf(e.strokeWidth-1);l.strokeLineDash=[m[0],m[1]-1]}else delete l.strokeLineDash;return l.roughness=Math.min(1,l.roughness||0),[i.line(c,U,u,s,l),i.line(f,p,u,s,l),...n==="crowfoot_one_or_many"?d(Af(e,t,a,"crowfoot_one"),l):[]]}}},Mw=(e,t,{isExporting:a,canvasBackgroundColor:n,embedsValidationStatus:i})=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":{let l;if(e.roundness){let r=e.width,o=e.height,d=Ba(Math.min(r,o),e);l=t.path(`M ${d} 0 L ${r-d} 0 Q ${r} 0, ${r} ${d} L ${r} ${o-d} Q ${r} ${o}, ${r-d} ${o} L ${d} ${o} Q 0 ${o}, 0 ${o-d} L 0 ${d} Q 0 0, ${d} 0`,ha(Mf(e,a,i),!0))}else l=t.rectangle(0,0,e.width,e.height,ha(Mf(e,a,i),!1));return l}case"diamond":{let l,[r,o,d,u,s,c,U,f]=Tf(e);if(e.roundness){let p=Ba(Math.abs(r-U),e),m=Ba(Math.abs(u-o),e);l=t.path(`M ${r+p} ${o+m} L ${d-p} ${u-m}
            C ${d} ${u}, ${d} ${u}, ${d-p} ${u+m}
            L ${s+p} ${c-m}
            C ${s} ${c}, ${s} ${c}, ${s-p} ${c-m}
            L ${U+p} ${f+m}
            C ${U} ${f}, ${U} ${f}, ${U+p} ${f-m}
            L ${r-p} ${o+m}
            C ${r} ${o}, ${r} ${o}, ${r+p} ${o+m}`,ha(e,!0))}else l=t.polygon([[r,o],[d,u],[s,c],[U,f]],ha(e));return l}case"ellipse":return t.ellipse(e.width/2,e.height/2,e.width,e.height,ha(e));case"line":case"arrow":{let l,r=ha(e),o=e.points.length?e.points:[w(0,0)];if(q(e)?o.every(d=>Math.abs(d[0])<=1e6&&Math.abs(d[1])<=1e6)?l=[t.path(Cw(o,16),ha(e,!0))]:(console.error("Elbow arrow with extreme point positions detected. Arrow not rendered.",e.id,JSON.stringify(o)),l=[]):e.roundness?l=[t.curve(o,r)]:r.fill?l=[t.polygon(o,r)]:l=[t.linearPath(o,r)],e.type==="arrow"){let{startArrowhead:d=null,endArrowhead:u="arrow"}=e;if(d!==null){let s=Cf(e,l,"start",d,t,r,n);l.push(...s)}if(u!==null){let s=Cf(e,l,"end",u,t,r,n);l.push(...s)}}return l}case"freedraw":{let l;if(yw(e),Nn(e.points)){let r=J5(e.points,.75);l=t.curve(r,{...ha(e),stroke:"none"})}else l=null;return l}case"frame":case"magicframe":case"text":case"image":return null;default:return Ri(e,`generateElementShape(): Unimplemented type ${e?.type}`),null}},Cw=(e,t)=>{let a=[];for(let i=1;i<e.length-1;i+=1){let l=e[i-1],r=e[i+1],o=e[i],d=_n(o,l),u=_n(r,o),s=Math.min(t,Te(e[i],r)/2,Te(e[i],l)/2);d?l[0]<o[0]?a.push([e[i][0]-s,e[i][1]]):a.push([e[i][0]+s,e[i][1]]):l[1]<o[1]?a.push([e[i][0],e[i][1]-s]):a.push([e[i][0],e[i][1]+s]),a.push(e[i]),u?r[0]<o[0]?a.push([e[i][0]-s,e[i][1]]):a.push([e[i][0]+s,e[i][1]]):r[1]<o[1]?a.push([e[i][0],e[i][1]-s]):a.push([e[i][0],e[i][1]+s])}let n=[`M ${e[0][0]} ${e[0][1]}`];for(let i=0;i<a.length;i+=3)n.push(`L ${a[i][0]} ${a[i][1]}`),n.push(`Q ${a[i+1][0]} ${a[i+1][1]}, ${a[i+2][0]} ${a[i+2][1]}`);return n.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),n.join(" ")},kl=e=>{let t=e.map(n=>n[0]),a=e.map(n=>n[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...a)-Math.min(...a)}},lo=(e,t,a,n)=>{let i=a.map(U=>U[e]),l=Math.max(...i),r=Math.min(...i),o=l-r,d=o===0?1:t/o,u=1/0,s=a.map(U=>{let f=U[e]*d,p=[...U];return p[e]=f,f<u&&(u=f),p});if(!n||s.length===2)return s;let c=r-u;return s.map(U=>U.map((f,p)=>p===e?f+c:f))},kf=class wd{static getBounds(t,a){let n=wd.boundsCache.get(t);if(n?.version&&n.version===t.version&&!Ye(t))return n.bounds;let i=wd.calculateBounds(t,a);return wd.boundsCache.set(t,{version:t.version,bounds:i}),i}static calculateBounds(t,a){let n,[i,l,r,o,d,u]=Ue(t,a);if(va(t)){let[s,c,U,f]=Ic(t.points.map(([p,m])=>O(w(p,m),w(d-t.x,u-t.y),t.angle)));return[s+t.x,c+t.y,U+t.x,f+t.y]}else if(he(t))n=Rw(t,d,u,a);else if(t.type==="diamond"){let[s,c]=O(w(d,l),w(d,u),t.angle),[U,f]=O(w(d,o),w(d,u),t.angle),[p,m]=O(w(i,u),w(d,u),t.angle),[g,y]=O(w(r,u),w(d,u),t.angle),v=Math.min(s,U,p,g),b=Math.min(c,f,m,y),x=Math.max(s,U,p,g),S=Math.max(c,f,m,y);n=[v,b,x,S]}else if(t.type==="ellipse"){let s=(r-i)/2,c=(o-l)/2,U=Math.cos(t.angle),f=Math.sin(t.angle),p=Math.hypot(s*U,c*f),m=Math.hypot(c*U,s*f);n=[d-p,u-m,d+p,u+m]}else{let[s,c]=O(w(i,l),w(d,u),t.angle),[U,f]=O(w(i,o),w(d,u),t.angle),[p,m]=O(w(r,o),w(d,u),t.angle),[g,y]=O(w(r,l),w(d,u),t.angle),v=Math.min(s,U,p,g),b=Math.min(c,f,m,y),x=Math.max(s,U,p,g),S=Math.max(c,f,m,y);n=[v,b,x,S]}return n}};I(kf,"boundsCache",new WeakMap);var kw=kf,Ue=(e,t,a=!1)=>{if(va(e))return Tw(e);if(he(e))return Z.getElementAbsoluteCoords(e,t,a);if(j(e)){let n=t?Tt(e,t):null;if(ge(n)){let{x:i,y:l}=Z.getBoundTextElementPosition(n,e,t);return[i,l,i+e.width,l+e.height,i+e.width/2,l+e.height/2]}}return[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2]},If=(e,t)=>{let[a,n,i,l,r,o]=Ue(e,t),d=w(r,o);if(he(e)||va(e)){let y=[],v=0;for(;v<e.points.length-1;)y.push(le(O(w(e.points[v][0]+e.x,e.points[v][1]+e.y),d,e.angle),O(w(e.points[v+1][0]+e.x,e.points[v+1][1]+e.y),d,e.angle))),v++;return y}let[u,s,c,U,f,p,m,g]=[[a,n],[i,n],[a,l],[i,l],[r,n],[r,l],[a,o],[i,o]].map(y=>O(y,d,e.angle));return e.type==="diamond"?[le(f,m),le(f,g),le(p,m),le(p,g)]:e.type==="ellipse"?[le(f,m),le(f,g),le(p,m),le(p,g),le(f,m),le(f,g),le(p,m),le(p,g)]:[le(u,s),le(c,U),le(u,c),le(s,U),le(u,g),le(c,g),le(s,m),le(U,m)]},Tf=e=>{let t=Math.floor(e.width/2)+1,a=0,n=e.width,i=Math.floor(e.height/2)+1,l=t,r=e.height;return[t,a,n,i,l,r,0,i]},Lf=(e,t,a,n,i)=>{let l=1-e;return Math.pow(l,3)*t+3*Math.pow(l,2)*e*a+3*l*Math.pow(e,2)*n+Math.pow(e,3)*i},Df=(e,t,a,n)=>{let i=t-e,l=a-t,r=n-a,o=3*i-6*l+3*r,d=6*l-6*i,u=3*i,s=d*d-4*o*u;if(!(s>=0))return!1;let c=null,U=null,f=1/0,p=1/0;return o===0?f=p=-u/d:(f=(-d+Math.sqrt(s))/(2*o),p=(-d-Math.sqrt(s))/(2*o)),f>=0&&f<=1&&(c=Lf(f,e,t,a,n)),p>=0&&p<=1&&(U=Lf(p,e,t,a,n)),[c,U]},Iw=(e,t,a,n)=>{let i=Df(e[0],t[0],a[0],n[0]),l=Df(e[1],t[1],a[1],n[1]),r=Math.min(e[0],n[0]),o=Math.max(e[0],n[0]);if(i){let s=i.filter(c=>c!==null);r=Math.min(r,...s),o=Math.max(o,...s)}let d=Math.min(e[1],n[1]),u=Math.max(e[1],n[1]);if(l){let s=l.filter(c=>c!==null);d=Math.min(d,...s),u=Math.max(u,...s)}return[r,d,o,u]},ro=(e,t)=>{let a=w(0,0),{minX:n,minY:i,maxX:l,maxY:r}=e.reduce((o,{op:d,data:u})=>{if(d==="move"){let s=Fd(u);Bt(s!=null,"Op data is not a point"),a=s}else if(d==="bcurveTo"){let s=w(u[0],u[1]),c=w(u[2],u[3]),U=w(u[4],u[5]),f=t?t(s):s,p=t?t(c):c,m=t?t(U):U,g=t?t(a):a;a=U;let[y,v,b,x]=Iw(g,f,p,m);o.minX=Math.min(o.minX,y),o.minY=Math.min(o.minY,v),o.maxX=Math.max(o.maxX,b),o.maxY=Math.max(o.maxY,x)}return o},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[n,i,l,r]},Ic=e=>{let t=1/0,a=1/0,n=-1/0,i=-1/0;for(let[l,r]of e)t=Math.min(t,l),a=Math.min(a,r),n=Math.max(n,l),i=Math.max(i,r);return[t,a,n,i]},Tw=e=>{let[t,a,n,i]=Ic(e.points),l=t+e.x,r=a+e.y,o=n+e.x,d=i+e.y;return[l,r,o,d,(l+o)/2,(r+d)/2]},Lw=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}},Dw=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},Af=(e,t,a,n)=>{if(t.length<1)return null;let i=di(t[0]);if(i.length<1)return null;let l=a==="start"?1:i.length-1,r=i[l].data;Bt(r.length===6,"Op data length is not 6");let o=w(r[4],r[5]),d=w(r[2],r[3]),u=w(r[0],r[1]),s=i[l-1],c=w(0,0);if(s.op==="move"){let X=Fd(s.data);Bt(X!=null,"Op data is not a point"),c=X}else s.op==="bcurveTo"&&(c=w(s.data[4],s.data[5]));let U=(X,_)=>Math.pow(1-X,3)*o[_]+3*X*Math.pow(1-X,2)*d[_]+3*Math.pow(X,2)*(1-X)*u[_]+c[_]*Math.pow(X,3),[f,p]=a==="start"?c:o,[m,g]=[U(.3,0),U(.3,1)],y=Math.hypot(f-m,p-g),v=(f-m)/y,b=(p-g)/y,x=Lw(n),S=0;{let[X,_]=a==="end"?e.points[e.points.length-1]:e.points[0],[H,W]=e.points.length>1?a==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];S=Math.hypot(X-H,_-W)}let C=Math.min(x,S*(n==="diamond"||n==="diamond_outline"?.25:.5)),T=f-v*C,k=p-b*C;if(n==="dot"||n==="circle"||n==="circle_outline"){let X=Math.hypot(k-p,T-f)+e.strokeWidth-2;return[f,p,X]}let R=Dw(n);if(n==="crowfoot_many"||n==="crowfoot_one_or_many"){let[X,_]=O(w(f,p),w(T,k),Ii(-R)),[H,W]=O(w(f,p),w(T,k),Ii(R));return[T,k,X,_,H,W]}let[D,A]=O(w(T,k),w(f,p),-R*Math.PI/180),[P,$]=O(w(T,k),w(f,p),Ii(R));if(n==="diamond"||n==="diamond_outline"){let X,_;if(a==="start"){let[H,W]=e.points.length>1?e.points[1]:[0,0];[X,_]=O(w(f+C*2,p),w(f,p),Math.atan2(W-p,H-f))}else{let[H,W]=e.points.length>1?e.points[e.points.length-2]:[0,0];[X,_]=O(w(f-C*2,p),w(f,p),Math.atan2(p-W,f-H))}return[f,p,D,A,X,_,P,$]}return[f,p,D,A,P,$]},Aw=e=>{let t=Jn.generator(),a=ha(e),n=e.roundness?"curve":a.fill?"polygon":"linearPath";return t[n](e.points,a)},Rw=(e,t,a,n)=>{let i=pe(e,n);if(e.points.length<2){let[u,s]=e.points[0],[c,U]=O(w(e.x+u,e.y+s),w(t,a),e.angle),f=[c,U,c,U];if(i){let p=Z.getMinMaxXYWithBoundText(e,n,[c,U,c,U],i);f=[p[0],p[1],p[2],p[3]]}return f}let l=Qe.get(e)?.[0]??Aw(e),r=di(l),o=ro(r,([u,s])=>O(w(e.x+u,e.y+s),w(t,a),e.angle)),d=[o[0],o[1],o[2],o[3]];if(i){let u=Z.getMinMaxXYWithBoundText(e,n,d,i);d=[u[0],u[1],u[2],u[3]]}return d},za=(e,t)=>kw.getBounds(e,t),De=(e,t)=>{if(!e.length)return[0,0,0,0];let a=1/0,n=-1/0,i=1/0,l=-1/0,r=t||oe(e);return e.forEach(o=>{let[d,u,s,c]=za(o,r);a=Math.min(a,d),i=Math.min(i,u),n=Math.max(n,s),l=Math.max(l,c)}),[a,i,n,l]},Tc=(e,t)=>{let[a,n,i,l]=De(e);return[a+t.x,n+t.y,i+t.x,l+t.y]},ci=(e,t,a,n)=>{if(!(he(e)||va(e)))return[e.x,e.y,e.x+t,e.y+a];let i=lo(0,t,lo(1,a,e.points,n),n),l;if(va(e))l=Ic(i);else{let s=Jn.generator(),c=e.roundness?s.curve(i,ha(e)):s.linearPath(i,ha(e)),U=di(c);l=ro(U)}let[r,o,d,u]=l;return[r+e.x,o+e.y,d+e.x,u+e.y]},Rf=(e,t)=>{let a=Jn.generator(),n=e.roundness==null?a.linearPath(t,ha(e)):a.curve(t,ha(e)),i=di(n),[l,r,o,d]=ro(i);return[l+e.x,r+e.y,o+e.x,d+e.y]},Nw=(e,t)=>{if(!e.length)return[0,0,0,0];let a=1/0,n=e[0],i=oe(e);return e.forEach(l=>{let[r,o,d,u]=za(l,i),s=Te(w((r+d)/2,(o+u)/2),w(t.x,t.y));s<a&&(a=s,n=l)}),za(n,i)},Fa=e=>{let[t,a,n,i]=De(e);return{minX:t,minY:a,maxX:n,maxY:i,width:n-t,height:i-a,midX:(t+n)/2,midY:(a+i)/2}},Nf=({scrollX:e,scrollY:t,width:a,height:n,zoom:i})=>[-e,-t,-e+a/i.value,-t+n/i.value],Lc=e=>w(e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2),Pw=(e,t)=>{if(e==null||t==null)return!1;let[a,n,i,l]=e,[r,o,d,u]=t;return a<d&&i>r&&n<u&&l>o},so=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return _w(e,t);case"diamond":return Ow(e,t);case"ellipse":return Bw(e,t)}},_w=(e,t)=>{let a=w(e.x+e.width/2,e.y+e.height/2),n=O(t,a,-e.angle),[i,l]=ef(e);return Math.min(...i.map(r=>Hd(n,r)),...l.map(r=>_u(r,n)).filter(r=>r!==null))},Ow=(e,t)=>{let a=w(e.x+e.width/2,e.y+e.height/2),n=O(t,a,-e.angle),[i,l]=tf(e);return Math.min(...i.map(r=>Hd(n,r)),...l.map(r=>_u(r,n)).filter(r=>r!==null))},Bw=(e,t)=>{let a=w(e.x+e.width/2,e.y+e.height/2);return qv(O(t,a,-e.angle),QU(a,e.width/2,e.height/2))},zw=e=>!e[L.CTRL_OR_CMD],Gi=e=>e.isBindingEnabled,He=5,Dc=10,Ac=4,Fw=(e,t)=>{let a=[];return t.forEach(n=>{let i=e.getNonDeletedElement(n);i!=null&&a.push(i)}),a},oo=(e,t,a,n,i)=>{let l=new Set,r=new Set;Pf(e,t,a,"start",l,r,n),Pf(e,a,t,"end",l,r,n);let o=Array.from(r).filter(d=>!l.has(d));Fw(i,o).forEach(d=>{F(d,{boundElements:d.boundElements?.filter(u=>u.type!=="arrow"||u.id!==e.id)})})},Pf=(e,t,a,n,i,l,r)=>{if(t!=="keep"){if(t===null){let o=Gw(e,n);o!=null&&l.add(o);return}zf(e)?(a==null||(a==="keep"?!Of(e,t,n):n==="start"||a.id!==t.id))&&(sn(e,t,n,r),i.add(t.id)):(sn(e,t,n,r),i.add(t.id))}},$w=(e,t,a,n)=>{let i=$f(e,t,a),l=t==="start"?e.startBinding?.elementId:e.endBinding?.elementId;if(l){let r=a.get(l);if(_a(r)&&uo(r,i,a,n))return r}return null},_f=(e,t,a)=>["start","end"].map(n=>$w(e,n,t,a)),Hw=(e,t,a,n,i,l)=>{let r=e.points.length-1,o=a.findIndex(c=>c===0)>-1,d=a.findIndex(c=>c===r)>-1,u=o?t?Il(e,"start",n,i,l):null:q(e)?"keep":Il(e,"start",n,i,l),s=d?t?Il(e,"end",n,i,l):null:q(e)?"keep":Il(e,"end",n,i,l);return[u,s]},Xw=(e,t,a,n,i)=>{if(q(e))return["keep","keep"];let[l,r]=_f(e,t,i),o=l&&n?Il(e,"start",t,a,i):null,d=r&&n?Il(e,"end",t,a,i):null;return[o,d]},co=(e,t,a,n,i,l,r)=>{e.forEach(o=>{let[d,u]=l?.length?Hw(o,i,l??[],t,a,r):Xw(o,t,a,i,r);oo(o,d,u,t,n)})},Rc=(e,t,a)=>e.length>50?[]:e.filter(he).flatMap(n=>_f(n,t,a)).filter(n=>n!==null).filter(n=>e.filter(i=>i.id===n?.id).length===0),Nc=(e,t,a,n,i)=>{t.startBoundElement!=null&&sn(e,t.startBoundElement,"start",n);let l=$a(a,i,n,t.zoom,q(e),q(e));l!==null&&(Of(e,l,"end")||sn(e,l,"end",n))},Ww=(e,t)=>{let a=e.gap,n=xr(t,t.width,t.height);return a>n&&(a=Dc+Ac),{...e,gap:a}},sn=(e,t,a,n)=>{if(!ge(e))return;let i={elementId:t.id,...q(e)?{...ho(e,t,a),focus:0,gap:0}:{...Ww(jw(e,t,a,n),t)}};F(e,{[a==="start"?"startBinding":"endBinding"]:i}),oe(t.boundElements||[]).has(e.id)||F(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Of=(e,t,a)=>{let n=e[a==="start"?"endBinding":"startBinding"];return Bf(e,n?.elementId,t)},Bf=(e,t,a)=>t===a.id&&zf(e),zf=e=>e.points.length<3,Gw=(e,t)=>{let a=t==="start"?"startBinding":"endBinding",n=e[a];return n==null?null:(F(e,{[a]:null}),n.elementId)},$a=(e,t,a,n,i,l)=>{if(l){let r=!1,o=Yw(t,u=>_a(u,!1)&&uo(u,e,a,n,(i||!Gd(u))&&!de(u))).filter(u=>r?!1:(Gd(u)||(r=!0),!0));if(!o||o.length===0)return null;if(o.length===1)return o[0];let d=o.filter(u=>uo(u,e,a,n,!1));return d.length===1?d[0]:o.sort((u,s)=>s.width**2+s.height**2-(u.width**2+u.height**2)).pop()}return Vw(t,r=>_a(r,!1)&&uo(r,e,a,n,(i||!Gd(r))&&!de(r)))},Vw=(e,t)=>{let a=null;for(let n=e.length-1;n>=0;--n){let i=e[n];if(!i.isDeleted&&t(i)){a=i;break}}return a},Yw=(e,t)=>{let a=[];for(let n=e.length-1;n>=0;--n){let i=e[n];i.isDeleted||t(i)&&a.push(i)}return a},jw=(e,t,a,n)=>{let i=a==="start"?-1:1,l=i===-1?0:e.points.length-1,r=l-i,o=Z.getPointAtIndexGlobalCoordinates(e,l,n),d=Z.getPointAtIndexGlobalCoordinates(e,r,n);return{focus:nE(t,d,o),gap:Math.max(1,so(t,o))}},na=(e,t,a)=>{let{newSize:n,simultaneouslyUpdated:i}=a??{},l=Kw(i);_a(e)&&Uo(t,e,r=>{if(!he(r)||r.isDeleted||!Zw(r,e))return;let o=r.startBinding?t.get(r.startBinding.elementId):null,d=r.endBinding?t.get(r.endBinding.elementId):null,u=null,s=null;o&&d&&(u=za(o,t),s=za(d,t));let c={startBinding:Ff(e,r.startBinding,n),endBinding:Ff(e,r.endBinding,n)};if(l.has(r.id)){F(r,c,!0);return}let U=fo(t,r,(p,m)=>{if(p&&_a(p)&&(m==="startBinding"||m==="endBinding")&&(e.id===r[m]?.elementId||e.id===r[m==="startBinding"?"endBinding":"startBinding"]?.elementId&&!Pw(u,s))){let g=aE(r,m,c[m],p,t);if(g)return{index:m==="startBinding"?0:r.points.length-1,point:g}}return null}).filter(p=>p!==null);Z.movePoints(r,U,{...e.id===r.startBinding?.elementId?{startBinding:c.startBinding}:{},...e.id===r.endBinding?.elementId?{endBinding:c.endBinding}:{}});let f=pe(r,t);f&&!f.isDeleted&&Ir(r,t,!1)})},Zw=(e,t)=>e.startBinding?.elementId===t.id||e.endBinding?.elementId===t.id,Kw=e=>new Set((e||[]).map(t=>t.id)),qw=(e,t,a,n,i,l,r)=>{let o=Wi(ie(t,e));return!a||!n?o:Jw(l,a,i,r)?Ef(a,n,e):Wi(ie(e,w(a.x+a.width/2,a.y+a.height/2)))},Jw=(e,t,a,n)=>{let i=so(t,e),l=xr(t,t.width,t.height,n);return i>l?null:i},wr=(e,t,a)=>{let n=t&&rn(t),i=e.points[a==="start"?0:e.points.length-1],l=w(e.x+i[0],e.y+i[1]),r=q7(t)?eE(t,l):l;if(t&&n){let o=Lc(n),d=nf(t,le(o,Ee(it(Pt(ie(r,o)),Math.max(t.width,t.height)),o)))[0],u=Te(r,o),s=Math.max(Te(d??r,o),1e-4),c=nn(u/s,6);return!0===c>.9?u-s>He||or(r,d)<1e-4?r:Ee(it(Pt(ie(r,d??o)),c>1?He:-He),d??o):Qw(r,t,n)}return r},Qw=(e,t,a)=>{let n=Lc(a),i=Wi(ie(e,n));switch(!0){case rt(i,aa):return O(w((a[0]+a[2])/2+.1,a[1]),n,t.angle);case rt(i,lt):return O(w(a[2],(a[1]+a[3])/2+.1),n,t.angle);case rt(i,It):return O(w((a[0]+a[2])/2-.1,a[3]),n,t.angle);default:return O(w(a[0],(a[1]+a[3])/2-.1),n,t.angle)}},eE=(e,t)=>{let a=w(e.x+e.width/2,e.y+e.height/2),n=O(t,a,-e.angle);return n[0]<e.x&&n[1]<e.y?n[1]-e.y>-He?O(w(e.x-He,e.y),a,e.angle):O(w(e.x,e.y-He),a,e.angle):n[0]<e.x&&n[1]>e.y+e.height?n[0]-e.x>-He?O(w(e.x,e.y+e.height+He),a,e.angle):O(w(e.x-He,e.y+e.height),a,e.angle):n[0]>e.x+e.width&&n[1]>e.y+e.height?n[0]-e.x<e.width+He?O(w(e.x+e.width,e.y+e.height+He),a,e.angle):O(w(e.x+e.width+He,e.y+e.height),a,e.angle):n[0]>e.x+e.width&&n[1]<e.y?n[0]-e.x<e.width+He?O(w(e.x+e.width,e.y-He),a,e.angle):O(w(e.x+e.width+He,e.y),a,e.angle):t},tE=(e,t,a=.05)=>{let{x:n,y:i,width:l,height:r,angle:o}=e,d=w(n+l/2-.1,i+r/2-.1),u=O(t,d,-o),s=we(a*r,5,80),c=we(a*l,5,80);return u[0]<=n+l/2&&u[1]>d[1]-s&&u[1]<d[1]+s?O(w(n-He,d[1]),d,o):u[1]<=i+r/2&&u[0]>d[0]-c&&u[0]<d[0]+c?O(w(d[0],i-He),d,o):u[0]>=n+l/2&&u[1]>d[1]-s&&u[1]<d[1]+s?O(w(n+l+He,d[1]),d,o):u[1]>=i+r/2&&u[0]>d[0]-c&&u[0]<d[0]+c?O(w(d[0],i+r+He),d,o):t},aE=(e,t,a,n,i)=>{if(a==null||a.elementId!==n.id&&e.points.length>2)return null;let l=t==="startBinding"?-1:1,r=l===-1?0:e.points.length-1;if(q(e)&&Ws(a)){let c=po(a.fixedPoint)??ho(e,n,t==="startBinding"?"start":"end").fixedPoint,U=w(n.x+n.width/2,n.y+n.height/2),f=w(n.x+c[0]*n.width,n.y+c[1]*n.height),p=O(f,U,n.angle);return Z.pointFromAbsoluteCoords(e,p,i)}let o=r-l,d=Z.getPointAtIndexGlobalCoordinates(e,o,i),u=iE(n,a.focus,d),s;if(a.gap===0)s=u;else{let c=Z.getPointAtIndexGlobalCoordinates(e,r,i),U=w(n.x+n.width/2,n.y+n.height/2),f=Te(d,c)+Te(d,U)+Math.max(n.width,n.height)*2,p=nf(n,le(d,Ee(it(Pt(ie(u,d)),f),d)),a.gap).sort((m,g)=>or(m,d)-or(g,d));p.length>1?s=p[0]:p.length===1?s=u:s=c}return Z.pointFromAbsoluteCoords(e,s,i)},ho=(e,t,a,n)=>{let i=[t.x,t.y,t.x+t.width,t.y+t.height],l=wr(e,t,a),r=w(i[0]+(i[2]-i[0])/2,i[1]+(i[3]-i[1])/2),o=O(l,r,-t.angle);return{fixedPoint:po([(o[0]-t.x)/t.width,(o[1]-t.y)/t.height])}},Ff=(e,t,a)=>{if(t==null||a==null)return t;let{width:n,height:i}=a,{width:l,height:r}=e,o=Math.max(1,Math.min(xr(e,n,i),t.gap*(n<i?n/l:i/r)));return{...t,gap:o}},Il=(e,t,a,n,i)=>$a($f(e,t,a),n,a,i,q(e),q(e)),$f=(e,t,a)=>{let n=t==="start"?0:-1;return Na(Z.getPointAtIndexGlobalCoordinates(e,n,a))},Hf=(e,t,a,n)=>{let i=new Set,l=new Set,r=n==="duplicatesServeAsOld",o=new Map([...a].map(([d,u])=>[u,d]));t.forEach(d=>{let{boundElements:u}=d;if(u!=null&&u.length>0&&(u.forEach(s=>{r&&!a.has(s.id)&&i.add(s.id)}),l.add(a.get(d.id))),ln(d)){if(d.startBinding!=null){let{elementId:s}=d.startBinding;r&&!a.has(s)&&l.add(s)}if(d.endBinding!=null){let{elementId:s}=d.endBinding;r&&!a.has(s)&&l.add(s)}(d.startBinding!=null||d.endBinding!=null)&&i.add(a.get(d.id))}}),e.filter(({id:d})=>i.has(d)).forEach(d=>{let{startBinding:u,endBinding:s}=d;F(d,{startBinding:Xf(u,a),endBinding:Xf(s,a)})}),e.filter(({id:d})=>l.has(d)).forEach(d=>{let u=o.get(d.id),s=e.find(({id:c})=>c===u)?.boundElements;s&&s.length>0&&F(d,{boundElements:s.map(c=>a.has(c.id)?{id:a.get(c.id),type:c.type}:c)})})},Xf=(e,t)=>e==null?null:{...e,elementId:t.get(e.elementId)??e.elementId},Wf=(e,t)=>{let a=oe(e);for(let n of t)Tl.unbindAffected(a,n,F),Ll.unbindAffected(a,n,F)},Er=(e,t,a=[])=>{if(!e)return null;let n=e.filter(i=>!t.has(i.id));return n.push(...a.map(i=>({id:i.id,type:i.type}))),n},uo=(e,{x:t,y:a},n,i,l)=>{let r=xr(e,e.width,e.height,i),o=Rn(e,n);return gc(w(t,a),o,r)||l===!0&&Ml(w(t,a),rn(e))},xr=(e,t,a,n)=>{let i=n?.value&&n.value<1?n.value:1,l=(e.type==="diamond"?1/Math.sqrt(2):1)*Math.min(t,a);return Math.max(16,Math.min(.25*l,32),Dc/i+Ac)},nE=(e,t,a)=>{let n=w(e.x+e.width/2,e.y+e.height/2);if(Ra(t,a))return 0;let i=O(t,n,-e.angle),l=O(a,n,-e.angle),r=Math.sign(xt(ie(l,t),ie(l,n)))*-1,o=le(l,Ee(it(Pt(ie(l,i)),Math.max(e.width*2,e.height*2)),l)),d=e.type==="diamond"?[le(w(e.x+e.width/2,e.y),w(e.x+e.width/2,e.y+e.height)),le(w(e.x,e.y+e.height/2),w(e.x+e.width,e.y+e.height/2))]:[le(w(e.x,e.y),w(e.x+e.width,e.y+e.height)),le(w(e.x+e.width,e.y),w(e.x,e.y+e.height))],u=e.type==="diamond"?[le(w(e.x+e.width/2,e.y-e.height),w(e.x+e.width/2,e.y+e.height*2)),le(w(e.x-e.width,e.y+e.height/2),w(e.x+e.width*2,e.y+e.height/2))]:[le(w(e.x-e.width,e.y-e.height),w(e.x+e.width*2,e.y+e.height*2)),le(w(e.x+e.width*2,e.y-e.height),w(e.x-e.width,e.y+e.height*2))];return[dr(o,u[0]),dr(o,u[1])].filter(s=>s!==null).sort((s,c)=>or(s,a)-or(c,a)).map((s,c)=>r*Te(n,s)/(e.type==="diamond"?Te(d[c][0],d[c][1])/2:Math.sqrt(e.width**2+e.height**2)/2)).sort((s,c)=>Math.abs(s)-Math.abs(c))[0]??0},iE=(e,t,a)=>{let n=w(e.x+e.width/2,e.y+e.height/2);if(t===0)return n;let i=(e.type==="diamond"?[w(e.x,e.y+e.height/2),w(e.x+e.width/2,e.y),w(e.x+e.width,e.y+e.height/2),w(e.x+e.width/2,e.y+e.height)]:[w(e.x,e.y),w(e.x+e.width,e.y),w(e.x+e.width,e.y+e.height),w(e.x,e.y+e.height)]).map(r=>Ee(it(ie(r,n),Math.abs(t)),n)).map(r=>O(r,n,e.angle)),l=[xt(ie(a,i[0]),ie(i[1],i[0]))>0&&(t>0?xt(ie(a,i[1]),ie(i[2],i[1]))<0:xt(ie(a,i[3]),ie(i[0],i[3]))<0),xt(ie(a,i[1]),ie(i[2],i[1]))>0&&(t>0?xt(ie(a,i[2]),ie(i[3],i[2]))<0:xt(ie(a,i[0]),ie(i[1],i[0]))<0),xt(ie(a,i[2]),ie(i[3],i[2]))>0&&(t>0?xt(ie(a,i[3]),ie(i[0],i[3]))<0:xt(ie(a,i[1]),ie(i[2],i[1]))<0),xt(ie(a,i[3]),ie(i[0],i[3]))>0&&(t>0?xt(ie(a,i[0]),ie(i[1],i[0]))<0:xt(ie(a,i[2]),ie(i[3],i[2]))<0)];return l[0]?t>0?i[1]:i[0]:l[1]?t>0?i[2]:i[1]:l[2]?t>0?i[3]:i[2]:t>0?i[0]:i[3]},lE=new Set(["boundElements","frameId","containerId","startBinding","endBinding"]),Uo=(e,t,a)=>{_a(t)&&(t.boundElements?.slice()??[]).forEach(({id:n})=>{a(e.get(n),"boundElements",n)})},fo=(e,t,a)=>{let n=[];if(t.frameId){let i=t.frameId;n.push(a(e.get(i),"frameId",i))}if(Ye(t)){let i=t.containerId;n.push(a(e.get(i),"containerId",i))}if(ge(t)){if(t.startBinding){let i=t.startBinding.elementId;n.push(a(e.get(i),"startBinding",i))}if(t.endBinding){let i=t.endBinding.elementId;n.push(a(e.get(i),"endBinding",i))}}return n},Tl=class{static unbindAffected(e,t,a){t&&fo(e,t,n=>{!n||n.isDeleted||Uo(e,n,(i,l,r)=>{r===t.id&&a(n,{boundElements:Er(n.boundElements,new Set([r]))})})})}};I(Tl,"rebindAffected",(e,t,a)=>{!t||t.isDeleted||fo(e,t,(n,i)=>{if(!n||n.isDeleted){a(t,{[i]:null});return}i!=="frameId"&&(n.boundElements?.find(l=>l.id===t.id)||(ge(t)&&a(n,{boundElements:Er(n.boundElements,new Set,new Array(t))}),j(t)&&(n.boundElements?.find(l=>l.type==="text")?a(t,{[i]:null}):a(n,{boundElements:Er(n.boundElements,new Set,new Array(t))}))))})});var Ll=class{static unbindAffected(e,t,a){t&&Uo(e,t,n=>{!n||n.isDeleted||fo(e,n,(i,l,r)=>{r===t.id&&a(n,{[l]:null})})})}};I(Ll,"rebindAffected",(e,t,a)=>{!t||t.isDeleted||Uo(e,t,(n,i,l)=>{if(!n||n.isDeleted){a(t,{boundElements:Er(t.boundElements,new Set([l]))});return}j(n)&&((t.boundElements?.slice()??[]).reverse().find(r=>r.type==="text")?.id===n.id?n.containerId!==t.id&&a(n,{containerId:t.id}):(n.containerId!==null&&a(n,{containerId:null}),a(t,{boundElements:Er(t.boundElements,new Set([n.id]))})))})});var Pc=(e,t)=>{let[a,n]=po(e);return O(w(t.x+t.width*a,t.y+t.height*n),w(t.x+t.width/2,t.y+t.height/2),t.angle)},rE=(e,t)=>{let a=e.startBinding&&t.get(e.startBinding.elementId),n=e.endBinding&&t.get(e.endBinding.elementId),i=a&&e.startBinding?Pc(e.startBinding.fixedPoint,a):w(e.x+e.points[0][0],e.y+e.points[0][1]),l=n&&e.endBinding?Pc(e.endBinding.fixedPoint,n):w(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]);return[i,l]},sE=(e,t)=>{let[a,n]=rE(e,t);return[Z.pointFromAbsoluteCoords(e,a,t),Z.pointFromAbsoluteCoords(e,n,t)]},po=e=>e&&(Math.abs(e[0]-.5)<1e-4||Math.abs(e[1]-.5)<1e-4)?e.map(t=>Math.abs(t-.5)<1e-4?.5001:t):e,oE=(e,t)=>{let[a,n,i,l]=t,{x:r,y:o}=ma({sceneX:a,sceneY:n},e),{x:d,y:u}=ma({sceneX:i,sceneY:l},e);return d-r>e.width||u-o>e.height},Gf=({scenePoint:e,viewportDimensions:t,zoom:a,offsets:n})=>{let i=(t.width-(n?.right??0))/2/a.value-e.x;i+=(n?.left??0)/2/a.value;let l=(t.height-(n?.bottom??0))/2/a.value-e.y;return l+=(n?.top??0)/2/a.value,{scrollX:i,scrollY:l}},Sr=(e,t)=>{if(e=IS(e),!e.length)return{scrollX:0,scrollY:0};let[a,n,i,l]=De(e);oE(t,[a,n,i,l])&&([a,n,i,l]=Nw(e,$e({clientX:t.scrollX,clientY:t.scrollY},t)));let r=(a+i)/2,o=(n+l)/2;return Gf({scenePoint:{x:r,y:o},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},Bn=e=>we(nn(e,6),Ad,Rd),dE=e=>we(Math.round(e),1,100),Vf=e=>we(Math.round(e),1,100),Yf=(e,t,a)=>{let n=a.reduce((i,l)=>(l.groupIds.includes(e)&&(i[l.id]=!0),i),{});return Object.keys(n).length<2?t.selectedGroupIds[e]||t.editingGroupId===e?{selectedElementIds:t.selectedElementIds,selectedGroupIds:{...t.selectedGroupIds,[e]:!1},editingGroupId:null}:t:{editingGroupId:t.editingGroupId,selectedGroupIds:{...t.selectedGroupIds,[e]:!0},selectedElementIds:{...t.selectedElementIds,...n}}},Xt=(function(){let e=null,t=null,a=null,n=(l,r,o,d)=>{if(a!==void 0&&r===t&&l===e&&o.editingGroupId===a?.editingGroupId)return a;let u={};for(let U of l){let f=U.groupIds;if(o.editingGroupId){let p=f.indexOf(o.editingGroupId);p>-1&&(f=f.slice(0,p))}if(f.length>0){let p=f[f.length-1];u[p]=!0}}let s={},c=r.reduce((U,f)=>{if(f.isDeleted)return U;let p=f.groupIds.find(m=>u[m]);return p&&(U[f.id]=!0,Array.isArray(s[p])?s[p].push(f.id):s[p]=[f.id]),U},{});for(let U of Object.keys(s))s[U].length<2&&u[U]&&(u[U]=!1);return t=r,e=l,a={editingGroupId:o.editingGroupId,selectedGroupIds:u,selectedElementIds:Ae({...o.selectedElementIds,...c},d)},a},i=(l,r,o,d)=>{let u=d?d.scene.getSelectedElements({selectedElementIds:l.selectedElementIds,elements:r}):be(r,l);return u.length?n(u,r,l,o):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:Ae(l.selectedElementIds,o)}};return i.clearCache=()=>{t=null,e=null,a=null},i})(),jf=(e,t)=>Zf(e,t)!=null,Zf=(e,t)=>t.groupIds.filter(a=>a!==e.editingGroupId).find(a=>e.selectedGroupIds[a]),Vi=e=>Object.entries(e.selectedGroupIds).filter(([t,a])=>a).map(([t,a])=>t),Kf=(e,t)=>{let a={...t,selectedGroupIds:{}};for(let n of e){let i=n.groupIds;if(t.editingGroupId){let l=i.indexOf(t.editingGroupId);l>-1&&(i=i.slice(0,l))}if(i.length>0){let l=i[i.length-1];a={...a,...Yf(l,a,e)}}}return a.selectedGroupIds},cE=(e,t)=>({...e,editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[t.id]:!0}}),Mr=(e,t)=>e.groupIds.includes(t),je=(e,t)=>{let a=[];for(let n of e.values())Mr(n,t)&&a.push(n);return a},hE=(e,t)=>e.groupIds.find(a=>t[a]),uE=(e,t,a)=>{let n=[...e],i=t?e.indexOf(t):-1,l=i>-1?i:e.length;for(let r=0;r<l;r++)n[r]=a(n[r]);return n},UE=(e,t,a)=>{let n=[...e],i=a?n.indexOf(a):-1,l=i>-1?i:n.length;return n.splice(l,0,t),n},fE=(e,t)=>e.filter(a=>!t[a]),mo=(e,t)=>{let a=new Map;return e.forEach(n=>{let i=n.groupIds.length===0?n.id:n.groupIds[n.groupIds.length-1],l=a.get(i)||[],r=pe(n,t);r&&l.push(r),a.set(i,[...l,n])}),Array.from(a.values())},pE=e=>{let t=new Set;for(let[,a]of e)if(!a.isDeleted)for(let n of a.groupIds??[])t.add(n);return t},qf=e=>{let t=e.flatMap(i=>i.groupIds),a=new Map,n=0;for(let i of t)a.set(i,(a.get(i)??0)+1),a.get(i)>n&&(n=a.get(i));return n===e.length},Dl=e=>e.groupIds.length>0,mE=8,Jf=99999,go=e=>mE/e,ia=class{};I(ia,"referenceSnapPoints",null),I(ia,"visibleGaps",null),I(ia,"setReferenceSnapPoints",e=>{ia.referenceSnapPoints=e}),I(ia,"getReferenceSnapPoints",()=>ia.referenceSnapPoints),I(ia,"setVisibleGaps",e=>{ia.visibleGaps=e}),I(ia,"getVisibleGaps",()=>ia.visibleGaps),I(ia,"destroy",()=>{ia.referenceSnapPoints=null,ia.visibleGaps=null});var zn=ia,Cr=e=>e.props.gridModeEnabled??e.state.gridModeEnabled,hi=({event:e,app:t,selectedElements:a})=>e?t.state.objectsSnapModeEnabled&&!e[L.CTRL_OR_CMD]||!t.state.objectsSnapModeEnabled&&e[L.CTRL_OR_CMD]&&!Cr(t):a.length===1&&a[0].type==="arrow"?!1:t.state.objectsSnapModeEnabled,gE=(e,t,a=.01)=>Math.abs(e-t)<=a,kr=(e,t,{omitCenter:a,boundingBoxCorners:n,dragOffset:i}={omitCenter:!1,boundingBoxCorners:!1})=>{let l=[];if(e.length===1){let r=e[0],[o,d,u,s,c,U]=Ue(r,t);i&&(o+=i.x,u+=i.x,c+=i.x,d+=i.y,s+=i.y,U+=i.y);let f=(u-o)/2,p=(s-d)/2;if((r.type==="diamond"||r.type==="ellipse")&&!n){let m=O(w(o,d+p),w(c,U),r.angle),g=O(w(o+f,d),w(c,U),r.angle),y=O(w(u,d+p),w(c,U),r.angle),v=O(w(o+f,s),w(c,U),r.angle),b=w(c,U);l=a?[m,g,y,v]:[m,g,y,v,b]}else{let m=O(w(o,d),w(c,U),r.angle),g=O(w(u,d),w(c,U),r.angle),y=O(w(o,s),w(c,U),r.angle),v=O(w(u,s),w(c,U),r.angle),b=w(c,U);l=a?[m,g,y,v]:[m,g,y,v,b]}}else if(e.length>1){let[r,o,d,u]=Tc(e,i??{x:0,y:0}),s=d-r,c=u-o,U=w(r,o),f=w(d,o),p=w(r,u),m=w(d,u),g=w(r+s/2,o+c/2);l=a?[U,f,p,m]:[U,f,p,m,g]}return l.map(r=>w(et(r[0]),et(r[1])))},Qf=(e,t,a,n)=>{let i=t.filter(l=>de(l)).map(l=>l.id);return Dp(e,t,a,n).filter(l=>!(l.frameId&&i.includes(l.frameId)))},bE=(e,t,a,n)=>{let i=Qf(e,t,a,n),l=mo(i,n).filter(c=>!(c.length===1&&Ye(c[0]))).map(c=>De(c).map(U=>et(U))),r=l.sort((c,U)=>c[0]-U[0]),o=[],d=0;e:for(let c=0;c<r.length;c++){let U=r[c];for(let f=c+1;f<r.length;f++){if(++d>Jf)break e;let p=r[f],[,m,g,y]=U,[v,b,,x]=p;g<v&&Ns(_t(m,y),_t(b,x))&&o.push({startBounds:U,endBounds:p,startSide:[w(g,m),w(g,y)],endSide:[w(v,b),w(v,x)],length:v-g,overlap:Ps(_t(m,y),_t(b,x))})}}let u=l.sort((c,U)=>c[1]-U[1]),s=[];d=0;e:for(let c=0;c<u.length;c++){let U=u[c];for(let f=c+1;f<u.length;f++){if(++d>Jf)break e;let p=u[f],[m,,g,y]=U,[v,b,x]=p;y<b&&Ns(_t(m,g),_t(v,x))&&s.push({startBounds:U,endBounds:p,startSide:[w(m,y),w(g,y)],endSide:[w(v,b),w(x,b)],length:b-y,overlap:Ps(_t(m,g),_t(v,x))})}}return{horizontalGaps:o,verticalGaps:s}},e0=(e,t,a,n,i,l,r)=>{if(!hi({app:a,event:n,selectedElements:e}))return[];if(e.length===0)return[];let o=zn.getVisibleGaps();if(o){let{horizontalGaps:d,verticalGaps:u}=o,[s,c,U,f]=Tc(e,t).map(g=>et(g)),p=(s+U)/2,m=(c+f)/2;for(let g of d){if(!Ns(_t(c,f),g.overlap))continue;let y=g.startSide[0][0]+g.length/2,v=et(y-p);if(g.length>U-s&&Math.abs(v)<=r.x){Math.abs(v)<r.x&&(i.length=0),r.x=Math.abs(v);let R={type:"gap",direction:"center_horizontal",gap:g,offset:v};i.push(R);continue}let[,,b]=g.endBounds,x=s-b,S=et(g.length-x);if(Math.abs(S)<=r.x){Math.abs(S)<r.x&&(i.length=0),r.x=Math.abs(S);let R={type:"gap",direction:"side_right",gap:g,offset:S};i.push(R);continue}let[C,,,]=g.startBounds,T=C-U,k=et(T-g.length);if(Math.abs(k)<=r.x){Math.abs(k)<r.x&&(i.length=0),r.x=Math.abs(k);let R={type:"gap",direction:"side_left",gap:g,offset:k};i.push(R);continue}}for(let g of u){if(!Ns(_t(s,U),g.overlap))continue;let y=g.startSide[0][1]+g.length/2,v=et(y-m);if(g.length>f-c&&Math.abs(v)<=r.y){Math.abs(v)<r.y&&(l.length=0),r.y=Math.abs(v);let R={type:"gap",direction:"center_vertical",gap:g,offset:v};l.push(R);continue}let[,b,,]=g.startBounds,x=b-f,S=et(x-g.length);if(Math.abs(S)<=r.y){Math.abs(S)<r.y&&(l.length=0),r.y=Math.abs(S);let R={type:"gap",direction:"side_top",gap:g,offset:S};l.push(R);continue}let[,,,C]=g.endBounds,T=et(c-C),k=g.length-T;if(Math.abs(k)<=r.y){Math.abs(k)<r.y&&(l.length=0),r.y=Math.abs(k);let R={type:"gap",direction:"side_bottom",gap:g,offset:k};l.push(R);continue}}}},yE=(e,t,a,n)=>{let i=Qf(e,t,a,n);return mo(i,n).filter(l=>!(l.length===1&&Ye(l[0]))).flatMap(l=>kr(l,n))},Al=(e,t,a,n,i,l,r)=>{if(!hi({app:a,event:n,selectedElements:e})||e.length===0&&t.length===0)return[];let o=zn.getReferenceSnapPoints();if(o)for(let d of t)for(let u of o){let s=u[0]-d[0],c=u[1]-d[1];Math.abs(s)<=r.x&&(Math.abs(s)<r.x&&(i.length=0),i.push({type:"point",points:[d,u],offset:s}),r.x=Math.abs(s)),Math.abs(c)<=r.y&&(Math.abs(c)<r.y&&(l.length=0),l.push({type:"point",points:[d,u],offset:c}),r.y=Math.abs(c))}},vE=(e,t,a,n,i)=>{let l=a.state,r=be(e,l);if(!hi({app:a,event:n,selectedElements:r})||r.length===0)return{snapOffset:{x:0,y:0},snapLines:[]};t.x=et(t.x),t.y=et(t.y);let o=[],d=[],u=go(l.zoom.value),s={x:u,y:u},c=kr(r,i,{dragOffset:t});Al(r,c,a,n,o,d,s),e0(r,t,a,n,o,d,s);let U={x:o[0]?.offset??0,y:d[0]?.offset??0};s.x=0,s.y=0,o.length=0,d.length=0;let f={x:et(t.x+U.x),y:et(t.y+U.y)};Al(r,kr(r,i,{dragOffset:f}),a,n,o,d,s),e0(r,f,a,n,o,d,s);let p=_c(o,d),m=EE(r,f,[...o,...d].filter(g=>g.type==="gap"));return{snapOffset:U,snapLines:[...p,...m]}},et=e=>Math.round(e*10**6)/10**6,t0=e=>{let t=new Map;for(let a of e){let n=a.join(",");t.has(n)||t.set(n,a)}return Array.from(t.values())},_c=(e,t)=>{let a={},n={};if(e.length>0){for(let i of e)if(i.type==="point"){let l=et(i.points[0][0]);a[l]||(a[l]=[]),a[l].push(...i.points.map(r=>w(et(r[0]),et(r[1]))))}}if(t.length>0){for(let i of t)if(i.type==="point"){let l=et(i.points[0][1]);n[l]||(n[l]=[]),n[l].push(...i.points.map(r=>w(et(r[0]),et(r[1]))))}}return Object.entries(a).map(([i,l])=>({type:"points",points:t0(l.map(r=>w(Number(i),r[1])).sort((r,o)=>r[1]-o[1]))})).concat(Object.entries(n).map(([i,l])=>({type:"points",points:t0(l.map(r=>w(r[0],Number(i))).sort((r,o)=>r[0]-o[0]))})))},wE=e=>{let t=new Map;for(let a of e){let n=a.points.flat().map(i=>[et(i)]).join(",");t.has(n)||t.set(n,a)}return Array.from(t.values())},EE=(e,t,a)=>{let[n,i,l,r]=Tc(e,t),o=[];for(let d of a){let[u,s,c,U]=d.gap.startBounds,[f,p,m,g]=d.gap.endBounds,y=Ps(_t(i,r),d.gap.overlap),v=Ps(_t(n,l),d.gap.overlap);switch(d.direction){case"center_horizontal":{if(y){let b=(y[0]+y[1])/2;o.push({type:"gap",direction:"horizontal",points:[w(d.gap.startSide[0][0],b),w(n,b)]},{type:"gap",direction:"horizontal",points:[w(l,b),w(d.gap.endSide[0][0],b)]})}break}case"center_vertical":{if(v){let b=(v[0]+v[1])/2;o.push({type:"gap",direction:"vertical",points:[w(b,d.gap.startSide[0][1]),w(b,i)]},{type:"gap",direction:"vertical",points:[w(b,r),w(b,d.gap.endSide[0][1])]})}break}case"side_right":{if(y){let b=(y[0]+y[1])/2;o.push({type:"gap",direction:"horizontal",points:[w(c,b),w(f,b)]},{type:"gap",direction:"horizontal",points:[w(m,b),w(n,b)]})}break}case"side_left":{if(y){let b=(y[0]+y[1])/2;o.push({type:"gap",direction:"horizontal",points:[w(l,b),w(u,b)]},{type:"gap",direction:"horizontal",points:[w(c,b),w(f,b)]})}break}case"side_top":{if(v){let b=(v[0]+v[1])/2;o.push({type:"gap",direction:"vertical",points:[w(b,r),w(b,s)]},{type:"gap",direction:"vertical",points:[w(b,U),w(b,p)]})}break}case"side_bottom":{if(v){let b=(v[0]+v[1])/2;o.push({type:"gap",direction:"vertical",points:[w(b,U),w(b,p)]},{type:"gap",direction:"vertical",points:[w(b,g),w(b,i)]})}break}}}return wE(o.map(d=>({...d,points:d.points.map(u=>w(et(u[0]),et(u[1])))})))},a0=(e,t,a,n,i,l)=>{if(!hi({event:n,selectedElements:e,app:a})||e.length===0||e.length===1&&!gE(e[0].angle,0))return{snapOffset:{x:0,y:0},snapLines:[]};let[r,o,d,u]=De(t);l&&(l.includes("e")?d+=i.x:l.includes("w")&&(r+=i.x),l.includes("n")?o+=i.y:l.includes("s")&&(u+=i.y));let s=[];if(l)switch(l){case"e":{s.push(w(d,o),w(d,u));break}case"w":{s.push(w(r,o),w(r,u));break}case"n":{s.push(w(r,o),w(d,o));break}case"s":{s.push(w(r,u),w(d,u));break}case"ne":{s.push(w(d,o));break}case"nw":{s.push(w(r,o));break}case"se":{s.push(w(d,u));break}case"sw":{s.push(w(r,u));break}}let c=go(a.state.zoom.value),U={x:c,y:c},f=[],p=[];Al(t,s,a,n,f,p,U);let m={x:f[0]?.offset??0,y:p[0]?.offset??0};U.x=0,U.y=0,f.length=0,p.length=0;let[g,y,v,b]=De(e).map(C=>et(C)),x=[w(g,y),w(g,b),w(v,y),w(v,b)];Al(e,x,a,n,f,p,U);let S=_c(f,p);return{snapOffset:m,snapLines:S}},xE=(e,t,a,n,i,l)=>{if(!hi({event:a,selectedElements:[e],app:t}))return{snapOffset:{x:0,y:0},snapLines:[]};let r=[w(n.x+i.x,n.y+i.y)],o=go(t.state.zoom.value),d={x:o,y:o},u=[],s=[];Al([e],r,t,a,u,s,d);let c={x:u[0]?.offset??0,y:s[0]?.offset??0};d.x=0,d.y=0,u.length=0,s.length=0;let U=kr([e],l,{boundingBoxCorners:!0,omitCenter:!0});Al([e],U,t,a,u,s,d);let f=_c(u,s);return{snapOffset:c,snapLines:f}},SE=(e,t,a,n,i)=>{if(!hi({event:n,selectedElements:[],app:t}))return{originOffset:{x:0,y:0},snapLines:[]};let l=Dp(e,[],t.state,i),r=go(t.state.zoom.value),o={x:r,y:r},d=[],u=[];for(let s of l){let c=kr([s],i);for(let U of c){let f=U[0]-a.x;Math.abs(f)<=Math.abs(o.x)&&(Math.abs(f)<Math.abs(o.x)&&(u.length=0),u.push({type:"pointer",points:[U,w(U[0],a.y)],direction:"vertical"}),o.x=f);let p=U[1]-a.y;Math.abs(p)<=Math.abs(o.y)&&(Math.abs(p)<Math.abs(o.y)&&(d.length=0),d.push({type:"pointer",points:[U,w(a.x,U[1])],direction:"horizontal"}),o.y=p)}}return{originOffset:{x:u.length>0?u[0].points[0][0]-a.x:0,y:d.length>0?d[0].points[0][1]-a.y:0},snapLines:[...u,...d]}},ME=e=>e===Et.rectangle||e===Et.ellipse||e===Et.diamond||e===Et.frame||e===Et.magicframe||e===Et.image||e===Et.text,bt=(e,t,a)=>a?[Math.round(e/a)*a,Math.round(t/a)*a]:[e,t],ui={version:null,points:[],zoom:null},ct=class ve{constructor(t){I(this,"elementId"),I(this,"selectedPointsIndices"),I(this,"pointerDownState"),I(this,"isDragging"),I(this,"lastUncommittedPoint"),I(this,"pointerOffset"),I(this,"startBindingElement"),I(this,"endBindingElement"),I(this,"hoverPointIndex"),I(this,"segmentMidPointHoveredCoords"),I(this,"elbowed"),this.elementId=t.id,Ra(t.points[0],w(0,0))||console.error("Linear element is not normalized",Error().stack),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:null,segmentMidpoint:{value:null,index:null,added:!1}},this.hoverPointIndex=-1,this.segmentMidPointHoveredCoords=null,this.elbowed=q(t)&&t.elbowed}static getElement(t,a){return a.get(t)||null}static handleBoxSelection(t,a,n,i){if(!a.editingLinearElement||!a.selectionElement)return!1;let{editingLinearElement:l}=a,{selectedPointsIndices:r,elementId:o}=l,d=ve.getElement(o,i);if(!d)return!1;let[u,s,c,U]=Ue(a.selectionElement,i),f=ve.getPointsGlobalCoordinates(d,i).reduce((p,m,g)=>((m[0]>=u&&m[0]<=c&&m[1]>=s&&m[1]<=U||t.shiftKey&&r?.includes(g))&&p.push(g),p),[]).filter(p=>!(q(d)&&p!==0&&p!==d.points.length-1));n({editingLinearElement:{...l,selectedPointsIndices:f.length?f:null}})}static handlePointDragging(t,a,n,i,l,r,o){if(!r)return!1;let{elementId:d}=r,u=o.getNonDeletedElementsMap(),s=ve.getElement(d,u);if(!s||q(s)&&!r.pointerDownState.lastClickedIsEndPoint&&r.pointerDownState.lastClickedPoint!==0)return!1;let c=q(s)?r.selectedPointsIndices?.reduce((p,m)=>m===0?[0,p[1]]:[p[0],s.points.length-1],[!1,!1]).filter(p=>typeof p=="number"):r.selectedPointsIndices,U=q(s)?r.pointerDownState.lastClickedPoint>0?s.points.length-1:0:r.pointerDownState.lastClickedPoint,f=s.points[U];if(c&&f){if(yr(t)&&c.length===1&&s.points.length>1){let p=c[0],m=s.points[p===0?1:p-1],[g,y]=ve._getShiftLockedDelta(s,u,m,w(n,i),t[L.CTRL_OR_CMD]?null:a.getEffectiveGridSize());ve.movePoints(s,[{index:p,point:w(g+m[0],y+m[1]),isDragging:p===U}])}else{let p=ve.createPointAt(s,u,n-r.pointerOffset.x,i-r.pointerOffset.y,t[L.CTRL_OR_CMD]?null:a.getEffectiveGridSize()),m=p[0]-f[0],g=p[1]-f[1];ve.movePoints(s,c.map(y=>{let v=y===U?ve.createPointAt(s,u,n-r.pointerOffset.x,i-r.pointerOffset.y,t[L.CTRL_OR_CMD]?null:a.getEffectiveGridSize()):w(s.points[y][0]+m,s.points[y][1]+g);return{index:y,point:v,isDragging:y===U}}))}if(pe(s,u)&&Ir(s,u,!1),ln(s,!1)){let p=[];c[0]===0&&p.push(Na(ve.getPointGlobalCoordinates(s,s.points[0],u)));let m=c[c.length-1];m===s.points.length-1&&p.push(Na(ve.getPointGlobalCoordinates(s,s.points[m],u))),p.length&&l(s,p)}return!0}return!1}static handlePointerUp(t,a,n,i){let l=i.getNonDeletedElementsMap(),r=i.getNonDeletedElements(),{elementId:o,selectedPointsIndices:d,isDragging:u,pointerDownState:s}=a,c=ve.getElement(o,l);if(!c)return a;let U={};if(u&&d){for(let f of d)if(f===0||f===c.points.length-1){Nn(c.points,n.zoom.value)&&ve.movePoints(c,[{index:f,point:f===0?c.points[c.points.length-1]:c.points[0]}]);let p=Gi(n)?$a(Na(ve.getPointAtIndexGlobalCoordinates(c,f,l)),r,l,n.zoom,q(c),q(c)):null;U[f===0?"startBindingElement":"endBindingElement"]=p}}return{...a,...U,selectedPointsIndices:u||t.shiftKey?!u&&t.shiftKey&&s.prevSelectedPointsIndices?.includes(s.lastClickedPoint)?d&&d.filter(f=>f!==s.lastClickedPoint):d:d?.includes(s.lastClickedPoint)?[s.lastClickedPoint]:d,isDragging:!1,pointerOffset:{x:0,y:0}}}static isSegmentTooShort(t,a,n,i,l){if(q(t))return i>=0&&i<t.points.length?Te(a,n)*l.value<ve.POINT_HANDLE_SIZE/2:!1;let r=Te(a,n);return t.points.length>2&&t.roundness&&(r=sw(t,n)),r*l.value<ve.POINT_HANDLE_SIZE*4}static getSegmentMidPoint(t,a,n,i,l){let r=sr(a,n);if(t.points.length>2&&t.roundness){let o=rf(t,t.points[i]);if(o){let d=ow(t,t.points[i],.5);r=ve.getPointGlobalCoordinates(t,sf(o[0],o[1],o[2],o[3],d),l)}}return r}static getSegmentMidPointIndex(t,a,n,i){let l=ve.getElement(t.elementId,i);if(!l)return-1;let r=ve.getEditorMidPoints(l,i,a),o=0;for(;o<r.length;){if(ve.arePointsEqual(n,r[o]))return o+1;o++}return-1}static handlePointerDown(t,a,n,i,l,r){let o=a.state,d=r.getNonDeletedElementsMap(),u=r.getNonDeletedElements(),s={didAddPoint:!1,hitElement:null,linearElementEditor:null};if(!l)return s;let{elementId:c}=l,U=ve.getElement(c,d);if(!U)return s;let f=ve.getSegmentMidpointHitCoords(l,i,o,d),p=null;if(f)p=ve.getSegmentMidPointIndex(l,o,f,d);else if(t.altKey&&o.editingLinearElement)return l.lastUncommittedPoint==null&&(F(U,{points:[...U.points,ve.createPointAt(U,d,i.x,i.y,t[L.CTRL_OR_CMD]?null:a.getEffectiveGridSize())]}),s.didAddPoint=!0),n.shouldCaptureIncrement(),s.linearElementEditor={...l,pointerDownState:{prevSelectedPointsIndices:l.selectedPointsIndices,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:f,index:p,added:!1}},selectedPointsIndices:[U.points.length-1],lastUncommittedPoint:null,endBindingElement:$a(i,u,d,a.state.zoom,l.elbowed)},s.didAddPoint=!0,s;let m=ve.getPointIndexUnderCursor(U,d,o.zoom,i.x,i.y);if(m>=0||f)s.hitElement=U;else{let{startBindingElement:k,endBindingElement:R}=l;Gi(o)&&ln(U)&&oo(U,k,R,d,r)}let[g,y,v,b]=Ue(U,d),x=(g+v)/2,S=(y+b)/2,C=m>-1&&O(w(U.x+U.points[m][0],U.y+U.points[m][1]),w(x,S),U.angle),T=m>-1||t.shiftKey?t.shiftKey||l.selectedPointsIndices?.includes(m)?CE([...l.selectedPointsIndices||[],m]):[m]:null;return s.linearElementEditor={...l,pointerDownState:{prevSelectedPointsIndices:l.selectedPointsIndices,lastClickedPoint:m,lastClickedIsEndPoint:m===U.points.length-1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:f,index:p,added:!1}},selectedPointsIndices:T,pointerOffset:C?{x:i.x-C[0],y:i.y-C[1]}:{x:0,y:0}},s}static arePointsEqual(t,a){return!t&&!a?!0:!t||!a?!1:Ra(t,a)}static handlePointerMove(t,a,n,i,l){let r=i.state;if(!r.editingLinearElement)return null;let{elementId:o,lastUncommittedPoint:d}=r.editingLinearElement,u=ve.getElement(o,l);if(!u)return r.editingLinearElement;let{points:s}=u,c=s[s.length-1];if(!t.altKey)return c===d&&ve.deletePoints(u,[s.length-1]),{...r.editingLinearElement,lastUncommittedPoint:null};let U;if(yr(t)&&s.length>=2){let f=s[s.length-2],[p,m]=ve._getShiftLockedDelta(u,l,f,w(a,n),t[L.CTRL_OR_CMD]?null:i.getEffectiveGridSize());U=w(p+f[0],m+f[1])}else U=ve.createPointAt(u,l,a-r.editingLinearElement.pointerOffset.x,n-r.editingLinearElement.pointerOffset.y,t[L.CTRL_OR_CMD]||q(u)?null:i.getEffectiveGridSize());return c===d?ve.movePoints(u,[{index:u.points.length-1,point:U}]):ve.addPoints(u,[{point:U}]),{...r.editingLinearElement,lastUncommittedPoint:u.points[u.points.length-1]}}static getPointGlobalCoordinates(t,a,n){let[i,l,r,o]=Ue(t,n),d=(i+r)/2,u=(l+o)/2,{x:s,y:c}=t;return O(w(s+a[0],c+a[1]),w(d,u),t.angle)}static getPointsGlobalCoordinates(t,a){let[n,i,l,r]=Ue(t,a),o=(n+l)/2,d=(i+r)/2;return t.points.map(u=>{let{x:s,y:c}=t;return O(w(s+u[0],c+u[1]),w(o,d),t.angle)})}static getPointAtIndexGlobalCoordinates(t,a,n){let i=a<0?t.points.length+a:a,[l,r,o,d]=Ue(t,n),u=(l+o)/2,s=(r+d)/2,c=t.points[i],{x:U,y:f}=t;return O(c?w(U+c[0],f+c[1]):w(U,f),w(u,s),t.angle)}static pointFromAbsoluteCoords(t,a,n){if(q(t))return w(a[0]-t.x,a[1]-t.y);let[i,l,r,o]=Ue(t,n),d=(i+r)/2,u=(l+o)/2,[s,c]=O(w(a[0],a[1]),w(d,u),-t.angle);return w(s-t.x,c-t.y)}static getPointIndexUnderCursor(t,a,n,i,l){let r=ve.getPointsGlobalCoordinates(t,a),o=r.length;for(;--o>-1;){let d=r[o];if(Te(w(i,l),w(d[0],d[1]))*n.value<ve.POINT_HANDLE_SIZE+1)return o}return-1}static createPointAt(t,a,n,i,l){let r=bt(n,i,l),[o,d,u,s]=Ue(t,a),c=(o+u)/2,U=(d+s)/2,[f,p]=O(w(r[0],r[1]),w(c,U),-t.angle);return w(f-t.x,p-t.y)}static getNormalizedPoints(t){let{points:a}=t,n=a[0][0],i=a[0][1];return{points:a.map(l=>w(l[0]-n,l[1]-i)),x:t.x+n,y:t.y+i}}static normalizePoints(t){F(t,ve.getNormalizedPoints(t))}static duplicateSelectedPoints(t,a){Bt(t.editingLinearElement,"Not currently editing a linear element");let{selectedPointsIndices:n,elementId:i}=t.editingLinearElement,l=ve.getElement(i,a);Bt(l,"The linear element does not exist in the provided Scene"),Bt(n!=null,"There are no selected points to duplicate");let{points:r}=l,o=[],d=!1,u=-1,s=r.reduce((c,U,f)=>{if(++u,c.push(U),n.includes(f)){let p=r[f+1];p||(d=!0),c.push(p?w((U[0]+p[0])/2,(U[1]+p[1])/2):w(U[0],U[1])),o.push(u+1),++u}return c},[]);if(F(l,{points:s}),d){let c=l.points[l.points.length-1];ve.movePoints(l,[{index:l.points.length-1,point:w(c[0]+30,c[1]+30)}])}return{...t,editingLinearElement:{...t.editingLinearElement,selectedPointsIndices:o}}}static deletePoints(t,a){let n=0,i=0;if(a.includes(0)){let r=t.points.find((o,d)=>!a.includes(d));r&&(n=r[0],i=r[1])}let l=t.points.reduce((r,o,d)=>(a.includes(d)||r.push(r.length?w(o[0]-n,o[1]-i):w(0,0)),r),[]);ve._updatePoints(t,l,n,i)}static addPoints(t,a){let n=[...t.points,...a.map(i=>i.point)];ve._updatePoints(t,n,0,0)}static movePoints(t,a,n){let{points:i}=t,[l,r]=a.find(({index:s})=>s===0)?.point??w(0,0),[o,d]=w(l-i[0][0],r-i[0][1]),u=q(t)?[a.find(s=>s.index===0)?.point??i[0],a.find(s=>s.index===i.length-1)?.point??i[i.length-1]]:i.map((s,c)=>{let U=a.find(f=>f.index===c)?.point??s;return w(U[0]-o,U[1]-d)});ve._updatePoints(t,u,o,d,n,{isDragging:a.reduce((s,c)=>s||c.isDragging===!0,!1)})}static shouldAddMidpoint(t,a,n,i){let l=ve.getElement(t.elementId,i);if(l&&q(l)||!l)return!1;let{segmentMidpoint:r}=t.pointerDownState;if(r.added||r.value===null||r.index===null||t.pointerDownState.origin===null)return!1;let o=t.pointerDownState.origin,d=Te(w(o.x,o.y),w(a.x,a.y));return!(!n.editingLinearElement&&d<Ci/n.zoom.value)}static addMidpoint(t,a,n,i,l){let r=ve.getElement(t.elementId,l);if(!r)return;let{segmentMidpoint:o}=t.pointerDownState,d={pointerDownState:t.pointerDownState,selectedPointsIndices:t.selectedPointsIndices},u=ve.createPointAt(r,l,a.x,a.y,i&&!q(r)?n.getEffectiveGridSize():null),s=[...r.points.slice(0,o.index),u,...r.points.slice(o.index)];return F(r,{points:s}),d.pointerDownState={...t.pointerDownState,segmentMidpoint:{...t.pointerDownState.segmentMidpoint,added:!0},lastClickedPoint:o.index},d.selectedPointsIndices=[o.index],d}static _updatePoints(t,a,n,i,l,r){if(q(t)){let o={};l?.startBinding!==void 0&&(o.startBinding=l.startBinding!==null&&Ws(l.startBinding)?l.startBinding:null),l?.endBinding!==void 0&&(o.endBinding=l.endBinding!==null&&Ws(l.endBinding)?l.endBinding:null),o.points=Array.from(a),F(t,o,!0,{isDragging:r?.isDragging})}else{let o=Rf(t,a),d=Rf(t,t.points),u=(o[0]+o[2])/2,s=(o[1]+o[3])/2,c=(d[0]+d[2])/2,U=(d[1]+d[3])/2,f=c-u,p=U-s,m=O(w(n,i),w(f,p),t.angle);F(t,{...l,points:a,x:t.x+m[0],y:t.y+m[1]})}}static _getShiftLockedDelta(t,a,n,i,l){let r=ve.getPointGlobalCoordinates(t,n,a);if(q(t))return[i[0]-r[0],i[1]-r[1]];let[o,d]=bt(i[0],i[1],l),{width:u,height:s}=xh(r[0],r[1],o,d);return O(w(u,s),w(0,0),-t.angle)}static moveFixedSegment(t,a,n,i,l){let r=ve.getElement(t.elementId,l);if(!r||!q(r))return t;if(a&&a>0&&a<r.points.length){let o=On(Wi(ie(r.points[a],r.points[a-1]))),d=(r.fixedSegments??[]).reduce((U,f)=>(U[f.index]=f,U),{});d[a]={index:a,start:w(o?r.points[a-1][0]:n-r.x,o?i-r.y:r.points[a-1][1]),end:w(o?r.points[a][0]:n-r.x,o?i-r.y:r.points[a][1])};let u=Object.values(d).sort((U,f)=>U.index-f.index),s=u.map(U=>U.index).reduce((U,f)=>f<a?U+1:U,0);F(r,{fixedSegments:u});let c=w(r.x+(r.fixedSegments[s].start[0]+r.fixedSegments[s].end[0])/2,r.y+(r.fixedSegments[s].start[1]+r.fixedSegments[s].end[1])/2);return{...t,segmentMidPointHoveredCoords:c,pointerDownState:{...t.pointerDownState,segmentMidpoint:{added:!1,index:r.fixedSegments[s].index,value:c}}}}return t}static deleteFixedSegment(t,a){F(t,{fixedSegments:t.fixedSegments?.filter(n=>n.index!==a)}),F(t,{},!0)}};I(ct,"POINT_HANDLE_SIZE",10),I(ct,"getEditorMidPoints",(e,t,a)=>{let n=pe(e,t);return!q(e)&&!a.editingLinearElement&&e.points.length>2&&!n?[]:(ui.version===e.version&&ui.zoom===a.zoom.value||ct.updateEditorMidPointsCache(e,t,a),ui.points)}),I(ct,"updateEditorMidPointsCache",(e,t,a)=>{let n=ct.getPointsGlobalCoordinates(e,t),i=0,l=[];for(;i<n.length-1;){if(ct.isSegmentTooShort(e,e.points[i],e.points[i+1],i,a.zoom)){l.push(null),i++;continue}let r=ct.getSegmentMidPoint(e,n[i],n[i+1],i+1,t);l.push(r),i++}ui.points=l,ui.version=e.version,ui.zoom=a.zoom.value}),I(ct,"getSegmentMidpointHitCoords",(e,t,a,n)=>{let{elementId:i}=e,l=ct.getElement(i,n);if(!l)return null;let r=ct.getPointIndexUnderCursor(l,n,a.zoom,t.x,t.y);if(!q(l)&&r>=0||ct.getPointsGlobalCoordinates(l,n).length>=3&&!a.editingLinearElement&&!q(l))return null;let o=(ct.POINT_HANDLE_SIZE+1)/a.zoom.value,d=e.segmentMidPointHoveredCoords;if(d&&Te(w(d[0],d[1]),w(t.x,t.y))<=o)return d;let u=0,s=ct.getEditorMidPoints(l,n,a);for(;u<s.length;){if(s[u]!==null&&Te(s[u],w(t.x,t.y))<=o)return s[u];u++}return null}),I(ct,"getBoundTextElementPosition",(e,t,a)=>{let n=ct.getPointsGlobalCoordinates(e,a);n.length<2&&F(t,{isDeleted:!0});let i=0,l=0;if(e.points.length%2===1){let r=Math.floor(e.points.length/2),o=ct.getPointGlobalCoordinates(e,e.points[r],a);i=o[0]-t.width/2,l=o[1]-t.height/2}else{let r=e.points.length/2-1,o=ui.points[r];e.points.length===2&&(o=sr(n[0],n[1])),(!o||ui.version!==e.version)&&(o=ct.getSegmentMidPoint(e,n[r],n[r+1],r+1,a)),i=o[0]-t.width/2,l=o[1]-t.height/2}return{x:i,y:l}}),I(ct,"getMinMaxXYWithBoundText",(e,t,a,n)=>{let[i,l,r,o]=a,d=(i+r)/2,u=(l+o)/2,{x:s,y:c}=ct.getBoundTextElementPosition(e,n,t),U=s+n.width,f=c+n.height,p=w(d,u),m=O(w(i,l),p,e.angle),g=O(w(r,l),p,e.angle),y=O(w(s,c),p,-e.angle),v=O(w(U,c),p,-e.angle),b=O(w(s,f),p,-e.angle),x=O(w(U,f),p,-e.angle);return m[0]<g[0]&&m[1]>=g[1]?(i=Math.min(i,b[0]),r=Math.max(r,Math.max(v[0],x[0])),l=Math.min(l,y[1]),o=Math.max(o,x[1])):m[0]>=g[0]&&m[1]>g[1]?(i=Math.min(i,x[0]),r=Math.max(r,Math.max(y[0],v[0])),l=Math.min(l,b[1]),o=Math.max(o,v[1])):m[0]>=g[0]?(i=Math.min(i,v[0]),r=Math.max(r,b[0]),l=Math.min(l,x[1]),o=Math.max(o,y[1])):m[1]<=g[1]&&(i=Math.min(i,Math.min(v[0],y[0])),r=Math.max(r,x[0]),l=Math.min(l,v[1]),o=Math.max(o,b[1])),[i,l,r,o,d,u]}),I(ct,"getElementAbsoluteCoords",(e,t,a=!1)=>{let n,i,l,r,o;if(e.points.length<2||!Qe.get(e)){let{minX:c,minY:U,maxX:f,maxY:p}=e.points.reduce((m,[g,y])=>(m.minY=Math.min(m.minY,y),m.minX=Math.min(m.minX,g),m.maxX=Math.max(m.maxX,g),m.maxY=Math.max(m.maxY,y),m),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});i=c+e.x,l=U+e.y,r=f+e.x,o=p+e.y}else{let c=Qe.generateElementShape(e,null),U=di(c[0]),[f,p,m,g]=ro(U);i=f+e.x,l=p+e.y,r=m+e.x,o=g+e.y}let d=(i+r)/2,u=(l+o)/2;if(n=[i,l,r,o,d,u],!a)return n;let s=pe(e,t);return s&&(n=ct.getMinMaxXYWithBoundText(e,t,[i,l,r,o],s)),n});var Z=ct,CE=e=>{let t=[...new Set(e.filter(a=>a!==null&&a!==-1))];return t=t.sort((a,n)=>a-n),t.length?t:null},Rl={},bo=(e,t)=>{let a=Rl[e]||(Rl[e]={height:t});return a.height=t,a},n0=e=>{Rl[e]&&delete Rl[e]},kE=e=>Rl[e]?.height??null,Wt=(e,t,a,n=!0)=>{let i,l={x:e.x,y:e.y,text:e.text,width:e.width,height:e.height,angle:t?.angle??e.angle};l.text=e.text,(t||!e.autoResize)&&(i=t?$n(t,e):e.width,l.text=Oi(e.originalText,Oe(e),i));let r=zt(l.text,Oe(e),e.lineHeight);if(e.autoResize&&(l.width=r.width),l.height=r.height,t){let o=vo(t,e),d=$n(t,e);if(!ge(t)&&r.height>o){let U=Yi(r.height,t.type);F(t,{height:U},n),bo(t.id,U)}if(r.width>d){let U=Yi(r.width,t.type);F(t,{width:U},n)}let u={...e,...l},{x:s,y:c}=yo(t,u,a);l.x=s,l.y=c}F(e,l,n)},i0=(e,t,a)=>{let n=oe(e);t.forEach(i=>{let l=a.get(i.id),r=Fn(i);if(r){let o=a.get(r);if(o){let d=n.get(l);d&&F(d,{boundElements:(i.boundElements||[]).filter(s=>s.id!==o&&s.id!==r).concat({type:"text",id:o})});let u=n.get(o);u&&j(u)&&F(u,{containerId:d?l:null})}}})},Ir=(e,t,a,n=!1)=>{if(!Fn(e))return;n0(e.id);let i=pe(e,t);if(i&&i.text){if(!e)return;let l=i.text,r=i.height,o=i.width,d=$n(e,i),u=vo(e,i),s=e.height;if(n||a!=="n"&&a!=="s"){l&&(l=Oi(i.originalText,Oe(i),d));let c=zt(l,Oe(i),i.lineHeight);r=c.height,o=c.width}if(r>u){s=Yi(r,e.type);let c=s-e.height,U=!ge(e)&&(a==="ne"||a==="nw"||a==="n")?e.y-c:e.y;F(e,{height:s,y:U})}F(i,{text:l,width:o,height:r}),ge(e)||F(i,yo(e,i,t))}},yo=(e,t,a)=>{if(ge(e))return Z.getBoundTextElementPosition(e,t,a);let n=IE(e),i=vo(e,t),l=$n(e,t),r,o;return t.verticalAlign===ca.TOP?o=n.y:t.verticalAlign===ca.BOTTOM?o=n.y+(i-t.height):o=n.y+(i/2-t.height/2),t.textAlign===nr.LEFT?r=n.x:t.textAlign===nr.RIGHT?r=n.x+(l-t.width):r=n.x+(l/2-t.width/2),{x:r,y:o}},Fn=e=>e?.boundElements?.length&&e?.boundElements?.find(t=>t.type==="text")?.id||null,pe=(e,t)=>{if(!e)return null;let a=Fn(e);return a&&t.get(a)||null},Tt=(e,t)=>e&&e.containerId&&t.get(e.containerId)||null,Oc=(e,t,a)=>{if(!ge(e))return{x:e.x+e.width/2,y:e.y+e.height/2};let n=Z.getPointsGlobalCoordinates(e,a);if(n.length%2===1){let r=Math.floor(e.points.length/2),o=Z.getPointGlobalCoordinates(e,e.points[r],a);return{x:o[0],y:o[1]}}let i=e.points.length/2-1,l=Z.getEditorMidPoints(e,a,t)[i];return l||(l=Z.getSegmentMidPoint(e,n[i],n[i+1],i+1,a)),{x:l[0],y:l[1]}},IE=e=>{let t=gt,a=gt;return e.type==="ellipse"&&(t+=e.width/2*(1-Math.sqrt(2)/2),a+=e.height/2*(1-Math.sqrt(2)/2)),e.type==="diamond"&&(t+=e.width/4,a+=e.height/4),{x:e.x+t,y:e.y+a}},TE=(e,t)=>!t||ge(t)?e.angle:t.angle,LE=(e,t)=>e.some(a=>{if(Ye(a)){let n=Tt(a,t);return!ge(n)}return!1}),DE=(e,t)=>e.some(a=>{if(Ye(a)){let n=Tt(a,t);return!ge(n)}return j(a)}),AE=new Set(["rectangle","ellipse","diamond","arrow"]),RE=e=>AE.has(e.type),Yi=(e,t)=>{e=Math.ceil(e);let a=gt*2;return t==="ellipse"?Math.round((e+a)/Math.sqrt(2)*2):t==="arrow"?e+a*8:t==="diamond"?2*(e+a):e+a},$n=(e,t)=>{let{width:a}=e;if(ge(e)){let n=(t?.fontSize??Mn)*U7;return Math.max(u7*a,n)}return e.type==="ellipse"?Math.round(a/2*Math.sqrt(2))-gt*2:e.type==="diamond"?Math.round(a/2)-gt*2:a-gt*2},vo=(e,t)=>{let{height:a}=e;return ge(e)?a-gt*8*2<=0?t.height:a:e.type==="ellipse"?Math.round(a/2*Math.sqrt(2))-gt*2:e.type==="diamond"?Math.round(a/2)-gt*2:a-gt*2},l0=(e,t=`

`)=>e.reduce((a,n)=>(j(n)&&a.push(n.text),a),[]).join(t),la=e=>(e=e.trim(),e&&Q5($s(e))),r0=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),Bc=e=>{if(e=la(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e},zc=[],V=e=>(zc=zc.concat(e),e),s0='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',NE='<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"/>',o0='<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"/>',PE=`data:${ne.svg},${encodeURIComponent(`${s0}${o0}</svg>`)}`,_E=`data:${ne.svg},${encodeURIComponent(`${s0}${NE}${o0}</svg>`)}`,Ha=e=>{e&&(e.style.cursor="")},Be=(e,t)=>{e&&(e.style.cursor=t)},on,d0,c0=(e,t)=>{let a=()=>{let n=t===Se.DARK;on=document.createElement("canvas"),on.theme=t,on.height=20,on.width=20;let i=on.getContext("2d");i.lineWidth=1,i.beginPath(),i.arc(on.width/2,on.height/2,5,0,2*Math.PI),i.fillStyle=n?Mt.black:Mt.white,i.fill(),i.strokeStyle=n?Mt.white:Mt.black,i.stroke(),d0=on.toDataURL(ne.svg)};(!on||on.theme!==t)&&a(),Be(e,`url(${d0}) ${20/2} ${20/2}, auto`)},dn=(e,t)=>{if(e)if(t.activeTool.type==="selection")Ha(e);else if(ml(t))e.style.cursor=Pe.GRAB;else if(an(t))c0(e,t.theme);else if(t.activeTool.type==="laser"){let a=t.theme===Se.LIGHT?PE:_E;e.style.cursor=`url(${a}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=Pe.AUTO):e.style.cursor=Pe.CROSSHAIR},OE=new eg(Date.now()),BE=0,cn=()=>Math.floor(OE.next()*2**31),xa=()=>Tn()?`id${BE++}`:Sd(),Xa=(e,{x:t,y:a,strokeColor:n=nt.strokeColor,backgroundColor:i=nt.backgroundColor,fillStyle:l=nt.fillStyle,strokeWidth:r=nt.strokeWidth,strokeStyle:o=nt.strokeStyle,roughness:d=nt.roughness,opacity:u=nt.opacity,width:s=0,height:c=0,angle:U=0,groupIds:f=[],frameId:p=null,index:m=null,roundness:g=null,boundElements:y=null,link:v=null,locked:b=nt.locked,...x})=>((t<-1e6||t>1e6||a<-1e6||a>1e6||s<-1e6||s>1e6||c<-1e6||c>1e6)&&console.error("New element size or position is too large",{x:t,y:a,width:s,height:c,points:x.points}),{id:x.id||xa(),type:e,x:t,y:a,width:s,height:c,angle:U,strokeColor:n,backgroundColor:i,fillStyle:l,strokeWidth:r,strokeStyle:o,roughness:d,opacity:u,groupIds:f,frameId:p,index:m,roundness:g,seed:x.seed??cn(),version:x.version||1,versionNonce:x.versionNonce??0,isDeleted:!1,boundElements:y,updated:vl(),link:v,locked:b,customData:x.customData}),hn=e=>Xa(e.type,e),h0=e=>Xa("embeddable",e),zE=e=>({...Xa("iframe",e)}),Fc=e=>fe({...Xa("frame",e),type:"frame",name:e?.name||null},{}),$c=e=>fe({...Xa("magicframe",e),type:"magicframe",name:e?.name||null},{}),u0=(e,t)=>({x:e.textAlign==="center"?t.width/2:e.textAlign==="right"?t.width:0,y:e.verticalAlign==="middle"?t.height/2:0}),ua=e=>{let t=e.fontFamily||ii,a=e.fontSize||Mn,n=e.lineHeight||Hi(t),i=El(e.text),l=zt(i,Oe({fontFamily:t,fontSize:a}),n),r=e.textAlign||tr,o=e.verticalAlign||ws,d=u0({textAlign:r,verticalAlign:o},l),u={...Xa("text",e),text:i,fontSize:a,fontFamily:t,textAlign:r,verticalAlign:o,x:e.x-d.x,y:e.y-d.y,width:l.width,height:l.height,containerId:e.containerId||null,originalText:e.originalText??i,autoResize:e.autoResize??!0,lineHeight:n};return fe(u,{})},FE=(e,t,a)=>{let{width:n,height:i}=zt(a,Oe(e),e.lineHeight);e.autoResize||(n=e.width);let{textAlign:l,verticalAlign:r}=e,o,d;if(l==="center"&&r===ca.MIDDLE&&!e.containerId&&e.autoResize){let u=zt(e.text,Oe(e),e.lineHeight),s=u0(e,{width:n-u.width,height:i-u.height});o=e.x-s.x,d=e.y-s.y}else{let[u,s,c,U]=Ue(e,t),[f,p,m,g]=ci(e,n,i,!1),y=(u-f)/2,v=(s-p)/2,b=(c-m)/2,x=(U-g)/2;[o,d]=$E({s:!0,e:l==="center"||l==="left",w:l==="center"||l==="right"},e.x,e.y,e.angle,y,v,b,x)}return{width:n,height:i,x:Number.isFinite(o)?o:e.x,y:Number.isFinite(d)?d:e.y}},$E=(e,t,a,n,i,l,r,o)=>{let d=Math.cos(n),u=Math.sin(n);return e.e&&e.w?t+=i+r:e.e?(t+=i*(1+d),a+=i*u,t+=r*(1-d),a+=r*-u):e.w&&(t+=i*(1-d),a+=i*-u,t+=r*(1+d),a+=r*u),e.n&&e.s?a+=l+o:e.n?(t+=l*u,a+=l*(1-d),t+=o*-u,a+=o*(1+d)):(t+=l*-u,a+=l*(1+d),t+=o*u,a+=o*(1-d)),[t,a]},U0=(e,t,a,n=e.text)=>{if(e.isDeleted)return;(t||!e.autoResize)&&(n=Oi(n,Oe(e),t?$n(t,e):e.width));let i=FE(e,a,n);return{text:n,...i}},HE=e=>({...Xa(e.type,e),points:e.points||[],pressures:e.pressures||[],simulatePressure:e.simulatePressure,lastCommittedPoint:null}),ji=e=>({...Xa(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:null,endArrowhead:null}),Hc=e=>e.elbowed?{...Xa(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!0,fixedSegments:e.fixedSegments||[],startIsSpecial:!1,endIsSpecial:!1}:{...Xa(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!1},f0=e=>({...Xa("image",e),strokeColor:"transparent",status:e.status??"pending",fileId:e.fileId??null,scale:e.scale??[1,1],crop:e.crop??null}),wo=(e,t=0)=>{if(e==null||typeof e!="object")return e;let a=Object.prototype.toString.call(e);if(a==="[object Object]"){let n=typeof e.constructor=="function"?Object.create(Object.getPrototypeOf(e)):{};for(let i in e)if(e.hasOwnProperty(i)){if(t===0&&(i==="shape"||i==="canvas"))continue;n[i]=wo(e[i],t+1)}return n}if(Array.isArray(e)){let n=e.length,i=new Array(n);for(;n--;)i[n]=wo(e[n],t+1);return i}return me.DEV&&a!=="[object Object]"&&a!=="[object Array]"&&a.startsWith("[object ")&&console.warn(`_deepCloneElement: unexpected object type ${a}. This value will not be cloned!`),e},Zi=e=>wo(e),p0=(e,t)=>{Object.defineProperty(e,m7,{value:t,writable:!1,enumerable:!1})},Eo=()=>xa(),m0=(e,t,a,n)=>{let i=Zi(a);return Tn()&&p0(i,a.id),i.id=Eo(),i.boundElements=null,i.updated=vl(),i.seed=cn(),i.groupIds=uE(i.groupIds,e,l=>(t.has(l)||t.set(l,Eo()),t.get(l))),n&&(i=Object.assign(i,n)),i},g0=(e,t)=>{let a=[],n=oe(e),i=new Map,l=o=>{if(i.has(o))return i.get(o);if(n.has(o)){let d=Eo();return i.set(o,d),d}return null},r=new Map;for(let o of e){let d=wo(o);if(d.id=l(o.id),Tn()&&p0(d,o.id),t?.randomizeSeed&&(d.seed=cn(),Hr(d)),d.groupIds&&(d.groupIds=d.groupIds.map(u=>(r.has(u)||r.set(u,Eo()),r.get(u)))),"containerId"in d&&d.containerId){let u=l(d.containerId);d.containerId=u}if("boundElements"in d&&d.boundElements&&(d.boundElements=d.boundElements.reduce((u,s)=>{let c=l(s.id);return c&&u.push({...s,id:c}),u},[])),"endBinding"in d&&d.endBinding){let u=l(d.endBinding.elementId);d.endBinding=u?{...d.endBinding,elementId:u}:null}if("startBinding"in d&&d.startBinding){let u=l(d.startBinding.elementId);d.startBinding=u?{...d.startBinding,elementId:u}:null}d.frameId&&(d.frameId=l(d.frameId)),a.push(d)}return a},Xc=(e,{shouldThrow:t=!1,includeBoundTextValidation:a=!1,ignoreLogs:n,reconciliationContext:i})=>{let l=[],r=d=>`${d?.index}:${d?.id}:${d?.type}:${d?.isDeleted}:${d?.version}:${d?.versionNonce}`,o=e.map(d=>d.index);for(let[d,u]of o.entries()){let s=o[d-1],c=o[d+1];if(Wc(u,s,c)||l.push(`Fractional indices invariant has been compromised: "${r(e[d-1])}", "${r(e[d])}", "${r(e[d+1])}"`),a&&wa(e[d])){let U=e[d],f=pe(U,oe(e));f&&f.index<=U.index&&l.push(`Fractional indices invariant for bound elements has been compromised: "${r(f)}", "${r(U)}"`)}}if(l.length){let d=new sb,u=[];if(i&&(u.push("Additional reconciliation context:"),u.push(i.localElements.map(s=>r(s))),u.push(i.remoteElements.map(s=>r(s)))),n||console.error(l.join(`

`),d.stack,e.map(s=>r(s)),...u),t)throw d}},b0=e=>e.sort((t,a)=>v0(t)&&v0(a)?t.index<a.index?-1:t.index>a.index?1:t.id<a.id?-1:1:1),un=(e,t)=>{try{let a=XE(e,t),n=y0(e,a),i=e.map(l=>n.has(l)?{...l,...n.get(l)}:l);Xc(i,{includeBoundTextValidation:!1,shouldThrow:!0,ignoreLogs:!0});for(let[l,r]of n)F(l,r,!1)}catch{Un(e)}return e},Un=e=>{let t=WE(e),a=y0(e,t);for(let[n,i]of a)F(n,i,!1);return e},XE=(e,t)=>{let a=[],n=0;for(;n<e.length;)if(t.has(e[n].id)){let i=[n-1,n];for(;++n<e.length&&t.has(e[n].id);)i.push(n);i.push(n),a.push(i)}else n++;return a},WE=e=>{let t=[],a,n,i=-1,l=0,r=u=>{let s=e[i]?e[i].index:void 0,c=e[u-1]?.index;return!s&&c||s&&c&&c>s?[c,u-1]:[s,i]},o=u=>{let s=e[l]?e[l].index:void 0;if(s&&u<l)return[s,l];let c=l;for(;++c<e.length;){let U=e[c]?.index;if(!s&&U||s&&U&&U>s)return[U,c]}return[void 0,c]},d=0;for(;d<e.length;){let u=e[d].index;if([a,i]=r(d),[n,l]=o(d),Wc(u,a,n))d++;else{let s=[i,d];for(;++d<e.length;){let c=e[d].index,[U,f]=r(d),[p,m]=o(d);if(Wc(c,U,p))break;[a,i]=[U,f],[n,l]=[p,m],s.push(d)}s.push(l),t.push(s)}}return t},Wc=(e,t,a)=>e?t&&a?t<e&&e<a:!t&&a?e<a:t&&!a?t<e:!!e:!1,y0=(e,t)=>{let a=new Map;for(let n of t){let i=n.shift(),l=n.pop(),r=tg(e[i]?.index,e[l]?.index,n.length);for(let o=0;o<n.length;o++){let d=e[n[o]];a.set(d,{index:r[o]})}}return a},v0=e=>!!e.index,pt=class wn{constructor(t,a){this.deleted=t,this.inserted=a}static create(t,a,n,i){let l=n&&i!=="inserted"?n(t):t,r=n&&i!=="deleted"?n(a):a;return new wn(l,r)}static calculate(t,a,n,i){if(t===a)return wn.empty();let l={},r={};for(let u of this.distinctKeysIterator("full",t,a))l[u]=t[u],r[u]=a[u];let[o,d]=i?i(l,r):[l,r];return wn.create(o,d,n)}static empty(){return new wn({},{})}static isEmpty(t){return!Object.keys(t.deleted).length&&!Object.keys(t.inserted).length}static mergeObjects(t,a,n){let i={...t};for(let l of Object.keys(n))delete i[l];return{...i,...a}}static mergeArrays(t,a,n,i){return Object.values(wn.mergeObjects(In(t??[],i),In(a??[],i),In(n??[],i)))}static diffObjects(t,a,n,i){if(!(!t[n]&&!a[n])&&(typeof t[n]=="object"||typeof a[n]=="object")){let l=t[n]??{},r=a[n]??{},o=wn.getLeftDifferences(l,r).reduce((u,s)=>(u[s]=i(l[s]),u),{}),d=wn.getRightDifferences(l,r).reduce((u,s)=>(u[s]=i(r[s]),u),{});Object.keys(o).length||Object.keys(d).length?(Reflect.set(t,n,o),Reflect.set(a,n,d)):(Reflect.deleteProperty(t,n),Reflect.deleteProperty(a,n))}}static diffArrays(t,a,n,i){if(!(!t[n]&&!a[n])&&(Array.isArray(t[n])||Array.isArray(a[n]))){let l=Array.isArray(t[n])?t[n]:[],r=Array.isArray(a[n])?a[n]:[],o=In(wn.getLeftDifferences(In(l,i),In(r,i))),d=In(wn.getRightDifferences(In(l,i),In(r,i)));if(Object.keys(o).length||Object.keys(d).length){let u=l.filter(c=>o[i?i(c):String(c)]),s=r.filter(c=>d[i?i(c):String(c)]);Reflect.set(t,n,u),Reflect.set(a,n,s)}else Reflect.deleteProperty(t,n),Reflect.deleteProperty(a,n)}}static isLeftDifferent(t,a,n=!1){return!!this.distinctKeysIterator("left",t,a,n).next().value}static isRightDifferent(t,a,n=!1){return!!this.distinctKeysIterator("right",t,a,n).next().value}static getLeftDifferences(t,a,n=!1){return Array.from(this.distinctKeysIterator("left",t,a,n))}static getRightDifferences(t,a,n=!1){return Array.from(this.distinctKeysIterator("right",t,a,n))}static*distinctKeysIterator(t,a,n,i=!1){if(a===n)return;let l=[];t==="left"?l=Object.keys(a):t==="right"?l=Object.keys(n):t==="full"?l=Array.from(new Set([...Object.keys(a),...Object.keys(n)])):Ri(t,`Unknown distinctKeysIterator's join param "${t}"`,!0);for(let r of l){let o=a[r],d=n[r];if(o!==d){if(!i&&typeof o=="object"&&typeof d=="object"&&o!==null&&d!==null&&At(o,d))continue;yield r}}}},w0=class oa{constructor(t){this.delta=t}static calculate(t,a){let n=pt.calculate(t,a,void 0,oa.postProcess);return new oa(n)}static empty(){return new oa(pt.create({},{}))}inverse(){let t=pt.create(this.delta.inserted,this.delta.deleted);return new oa(t)}applyTo(t,a){try{let{selectedElementIds:n={},selectedGroupIds:i={}}=this.delta.deleted,{selectedElementIds:l={},selectedGroupIds:r={},selectedLinearElementId:o,editingLinearElementId:d,...u}=this.delta.inserted,s=pt.mergeObjects(t.selectedElementIds,l,n),c=pt.mergeObjects(t.selectedGroupIds,r,i),U=o&&a.has(o)?new Z(a.get(o)):null,f=d&&a.has(d)?new Z(a.get(d)):null,p={...t,...u,selectedElementIds:s,selectedGroupIds:c,selectedLinearElement:typeof o<"u"?U:t.selectedLinearElement,editingLinearElement:typeof d<"u"?f:t.editingLinearElement},m=this.filterInvisibleChanges(t,p,a);return[p,m]}catch(n){if(console.error("Couldn't apply appstate change",n),me.DEV||me.MODE===Qt.TEST)throw n;return[t,!1]}}isEmpty(){return pt.isEmpty(this.delta)}static postProcess(t,a){try{pt.diffObjects(t,a,"selectedElementIds",n=>!0),pt.diffObjects(t,a,"selectedGroupIds",n=>n??!1)}catch(n){if(console.error("Couldn't postprocess appstate change deltas."),me.DEV||me.MODE===Qt.TEST)throw n}finally{return[t,a]}}filterInvisibleChanges(t,a,n){let i=xo(t),l=xo(a),r=pt.isRightDifferent(oa.stripElementsProps(i),oa.stripElementsProps(l)),o=pt.isRightDifferent(oa.stripStandaloneProps(i),oa.stripStandaloneProps(l));if(!r&&!o)return!1;let d={value:r};if(o){let u=pt.getRightDifferences(oa.stripStandaloneProps(i),oa.stripStandaloneProps(l)),s=new Set;(u.includes("editingGroupId")||u.includes("selectedGroupIds"))&&(s=pE(n));for(let c of u)switch(c){case"selectedElementIds":a[c]=oa.filterSelectedElements(a[c],n,d);break;case"selectedGroupIds":a[c]=oa.filterSelectedGroups(a[c],s,d);break;case"croppingElementId":{let m=a[c],g=m&&n.get(m);g&&!g.isDeleted?d.value=!0:a[c]=null;break}case"editingGroupId":let U=a[c];U?s.has(U)?d.value=!0:a[c]=null:d.value=!0;break;case"selectedLinearElementId":case"editingLinearElementId":let f=oa.convertToAppStateKey(c),p=a[f];if(!p)d.value=!0;else{let m=n.get(p.elementId);m&&!m.isDeleted?d.value=!0:a[f]=null}break;default:Ri(c,`Unknown ObservedElementsAppState's key "${c}"`,!0)}}return d.value}static convertToAppStateKey(t){switch(t){case"selectedLinearElementId":return"selectedLinearElement";case"editingLinearElementId":return"editingLinearElement"}}static filterSelectedElements(t,a,n){let i=Object.keys(t);if(!i.length)return n.value=!0,t;let l={...t};for(let r of i){let o=a.get(r);o&&!o.isDeleted?n.value=!0:delete l[r]}return l}static filterSelectedGroups(t,a,n){if(!Object.keys(t).length)return n.value=!0,t;let i={...t};for(let l of Object.keys(i))a.has(l)?n.value=!0:delete i[l];return i}static stripElementsProps(t){let{editingGroupId:a,selectedGroupIds:n,selectedElementIds:i,editingLinearElementId:l,selectedLinearElementId:r,croppingElementId:o,...d}=t;return d}static stripStandaloneProps(t){let{name:a,viewBackgroundColor:n,...i}=t;return i}},Ui=class tt{constructor(t,a,n){this.added=t,this.removed=a,this.updated=n}static create(t,a,n,i={shouldRedistribute:!1}){let l;if(i.shouldRedistribute){let r=new Map,o=new Map,d=new Map,u=[...t,...a,...n];for(let[s,c]of u)this.satisfiesAddition(c)?r.set(s,c):this.satisfiesRemoval(c)?o.set(s,c):d.set(s,c);l=new tt(r,o,d)}else l=new tt(t,a,n);return(me.DEV||me.MODE===Qt.TEST)&&(tt.validate(l,"added",this.satisfiesAddition),tt.validate(l,"removed",this.satisfiesRemoval),tt.validate(l,"updated",this.satisfiesUpdate)),l}static validate(t,a,n){for(let[i,l]of t[a].entries())if(!n(l))throw console.error(`Broken invariant for "${a}" delta, element "${i}", delta:`,l),new Error(`ElementsChange invariant broken for element "${i}".`)}static calculate(t,a){if(t===a)return tt.empty();let n=new Map,i=new Map,l=new Map;for(let r of t.values())if(!a.get(r.id)){let o={...r,isDeleted:!1},d={isDeleted:!0},u=pt.create(o,d,tt.stripIrrelevantProps);i.set(r.id,u)}for(let r of a.values()){let o=t.get(r.id);if(!o){let d={isDeleted:!0},u={...r,isDeleted:!1},s=pt.create(d,u,tt.stripIrrelevantProps);n.set(r.id,s);continue}if(o.versionNonce!==r.versionNonce){let d=pt.calculate(o,r,tt.stripIrrelevantProps,tt.postProcess);if(typeof o.isDeleted=="boolean"&&typeof r.isDeleted=="boolean"&&o.isDeleted!==r.isDeleted){o.isDeleted&&!r.isDeleted?n.set(r.id,d):i.set(r.id,d);continue}pt.isEmpty(d)||l.set(r.id,d)}}return tt.create(n,i,l)}static empty(){return tt.create(new Map,new Map,new Map)}inverse(){let t=l=>{let r=new Map;for(let[o,d]of l.entries())r.set(o,pt.create(d.inserted,d.deleted));return r},a=t(this.added),n=t(this.removed),i=t(this.updated);return tt.create(n,a,i)}isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}applyLatestChanges(t){let a=o=>d=>{let u={};for(let s of Object.keys(d))s==="boundElements"?u[s]=d[s]:u[s]=o[s];return u},n=o=>{let d=new Map;for(let[u,s]of o.entries()){let c=t.get(u);if(c){let U=pt.create(s.deleted,s.inserted,a(c),"inserted");d.set(u,U)}else d.set(u,s)}return d},i=n(this.added),l=n(this.removed),r=n(this.updated);return tt.create(i,l,r,{shouldRedistribute:!0})}applyTo(t,a){let n=ga(new Map(t)),i,l={containsVisibleDifference:!1,containsZindexDifference:!1};try{let r=tt.createApplier(n,a,l),o=r(this.added),d=r(this.removed),u=r(this.updated),s=this.resolveConflicts(t,n);i=new Map([...o,...d,...u,...s])}catch(r){if(console.error("Couldn't apply elements change",r),me.DEV||me.MODE===Qt.TEST)throw r;return[t,!0]}try{tt.redrawTextBoundingBoxes(n,i),n=tt.reorderElements(n,i,l),tt.redrawBoundArrows(n,i)}catch(r){if(console.error("Couldn't mutate elements after applying elements change",r),me.DEV||me.MODE===Qt.TEST)throw r}finally{return[n,l.containsVisibleDifference]}}static applyDelta(t,a,n={containsVisibleDifference:!0,containsZindexDifference:!0}){let{boundElements:i,...l}=a.inserted;if(a.deleted.boundElements?.length||a.inserted.boundElements?.length){let r=pt.mergeArrays(t.boundElements,a.inserted.boundElements,a.deleted.boundElements,o=>o.id);Object.assign(l,{boundElements:r})}if(Le(t)){let r=a;(r.deleted.crop||r.inserted.crop)&&Object.assign(l,{crop:r.inserted.crop??null})}if(!n.containsVisibleDifference){let{index:r,...o}=l,d=tt.checkForVisibleDifference(t,o);n.containsVisibleDifference=d}return n.containsZindexDifference||(n.containsZindexDifference=a.deleted.index!==a.inserted.index),fe(t,l)}static checkForVisibleDifference(t,a){return t.isDeleted&&a.isDeleted!==!1?!1:t.isDeleted&&a.isDeleted===!1||t.isDeleted===!1&&a.isDeleted?!0:pt.isRightDifferent(t,a)}resolveConflicts(t,a){let n=new Map,i=(u,s)=>{let c=a.get(u.id);if(!c)return;let U;t.get(u.id)===c?U=fe(c,s):U=F(c,s),n.set(U.id,U),a.set(U.id,U)};for(let[u]of this.removed)tt.unbindAffected(t,a,u,i);for(let[u]of this.added)tt.rebindAffected(t,a,u,i);for(let[u]of Array.from(this.updated).filter(([s,c])=>Object.keys({...c.deleted,...c.inserted}).find(U=>lE.has(U)))){let s=a.get(u);!s||s.isDeleted||tt.rebindAffected(t,a,u,i)}let l=new Map(Array.from(t).filter(([u])=>n.has(u))),{added:r,removed:o,updated:d}=tt.calculate(l,n);for(let[u,s]of r)this.added.set(u,s);for(let[u,s]of o)this.removed.set(u,s);for(let[u,s]of d)this.updated.set(u,s);return n}static unbindAffected(t,a,n,i){let l=()=>t.get(n),r=()=>a.get(n);Tl.unbindAffected(a,l(),i),Tl.unbindAffected(a,r(),i),Ll.unbindAffected(a,l(),i),Ll.unbindAffected(a,r(),i)}static rebindAffected(t,a,n,i){let l=()=>t.get(n),r=()=>a.get(n);Tl.unbindAffected(a,l(),i),Tl.rebindAffected(a,r(),i),Ll.unbindAffected(a,l(),(o,d)=>{j(o)&&i(o,d)}),Ll.rebindAffected(a,r(),i)}static redrawTextBoundingBoxes(t,a){let n=new Map;for(let i of a.values()){if(Ye(i)){let{containerId:l}=i,r=l?t.get(l):void 0;r&&n.set(r.id,{container:r,boundText:i})}if(wa(i)){let l=Fn(i),r=l?t.get(l):void 0;r&&n.set(i.id,{container:i,boundText:r})}}for(let{container:i,boundText:l}of n.values())i.isDeleted||l.isDeleted||Wt(l,i,t,!1)}static redrawBoundArrows(t,a){for(let n of a.values())!n.isDeleted&&_a(n)&&na(n,t,{})}static reorderElements(t,a,n){if(!n.containsZindexDifference)return t;let i=Array.from(t.values()),l=b0([...i]),r=pt.getRightDifferences(i,l,!0).reduce((o,d)=>{let u=i[Number(d)];return u&&a.has(u.id)&&o.set(u.id,u),o},new Map);return!n.containsVisibleDifference&&r.size&&(n.containsVisibleDifference=!0),oe(un(l,r))}static postProcess(t,a){try{pt.diffArrays(t,a,"boundElements",n=>n.id)}catch(n){if(console.error("Couldn't postprocess elements change deltas."),me.DEV||me.MODE===Qt.TEST)throw n}finally{return[t,a]}}static stripIrrelevantProps(t){let{id:a,updated:n,version:i,versionNonce:l,seed:r,...o}=t;return o}};I(Ui,"satisfiesAddition",({deleted:e,inserted:t})=>e.isDeleted===!0&&!t.isDeleted),I(Ui,"satisfiesRemoval",({deleted:e,inserted:t})=>!e.isDeleted&&t.isDeleted===!0),I(Ui,"satisfiesUpdate",({deleted:e,inserted:t})=>!!e.isDeleted==!!t.isDeleted),I(Ui,"createApplier",(e,t,a)=>{let n=Ui.createGetter(e,t,a);return i=>Array.from(i.entries()).reduce((l,[r,o])=>{let d=n(r,o.inserted);if(d){let u=Ui.applyDelta(d,o,a);e.set(u.id,u),l.set(u.id,u)}return l},new Map)}),I(Ui,"createGetter",(e,t,a)=>(n,i)=>{let l=e.get(n);return l||(l=t.get(n),l&&(a.containsZindexDifference=!0,(i.isDeleted===!1||i.isDeleted!==!0&&l.isDeleted===!1)&&(a.containsVisibleDifference=!0))),l});var E0=Ui,fn=class{constructor(){I(this,"subscribers",[])}on(...e){let t=e.flat().filter(a=>typeof a=="function");return this.subscribers.push(...t),()=>this.off(t)}once(...e){let t=e.flat().filter(n=>typeof n=="function");t.push(()=>a());let a=this.on(...t);return a}off(...e){let t=e.flat();this.subscribers=this.subscribers.filter(a=>!t.includes(a))}trigger(...e){for(let t of this.subscribers)t(...e);return this}clear(){this.subscribers=[]}},x0="__observedAppState",xo=e=>{let t={name:e.name,editingGroupId:e.editingGroupId,viewBackgroundColor:e.viewBackgroundColor,selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,editingLinearElementId:e.editingLinearElement?.elementId||null,selectedLinearElementId:e.selectedLinearElement?.elementId||null,croppingElementId:e.croppingElementId};return Reflect.defineProperty(t,x0,{value:!0,enumerable:!1}),t},GE=e=>!!Reflect.get(e,x0),B={IMMEDIATELY:"IMMEDIATELY",NEVER:"NEVER",EVENTUALLY:"EVENTUALLY"},VE=class{constructor(e,t){this.elementsChange=e,this.appStateChange=t}},YE=class{constructor(){I(this,"onStoreIncrementEmitter",new fn),I(this,"scheduledActions",new Set),I(this,"_snapshot",S0.empty()),I(this,"shouldCaptureIncrement",()=>{this.scheduleAction(B.IMMEDIATELY)}),I(this,"shouldUpdateSnapshot",()=>{this.scheduleAction(B.NEVER)}),I(this,"scheduleAction",e=>{this.scheduledActions.add(e),this.satisfiesScheduledActionsInvariant()}),I(this,"commit",(e,t)=>{try{this.scheduledActions.has(B.IMMEDIATELY)?this.captureIncrement(e,t):this.scheduledActions.has(B.NEVER)&&this.updateSnapshot(e,t)}finally{this.satisfiesScheduledActionsInvariant(),this.scheduledActions=new Set}}),I(this,"captureIncrement",(e,t)=>{let a=this.snapshot,n=this.snapshot.maybeClone(e,t);if(a!==n){let i=n.meta.didElementsChange?E0.calculate(a.elements,n.elements):E0.empty(),l=n.meta.didAppStateChange?w0.calculate(a.appState,n.appState):w0.empty();(!i.isEmpty()||!l.isEmpty())&&this.onStoreIncrementEmitter.trigger(new VE(i,l)),this.snapshot=n}}),I(this,"updateSnapshot",(e,t)=>{let a=this.snapshot.maybeClone(e,t);this.snapshot!==a&&(this.snapshot=a)}),I(this,"filterUncomittedElements",(e,t)=>{for(let[a,n]of e.entries()){if(!t.get(a))continue;let i=this.snapshot.elements.get(a);i?i.version<n.version&&t.set(a,i):t.delete(a)}return t}),I(this,"clear",()=>{this.snapshot=S0.empty(),this.scheduledActions=new Set}),I(this,"satisfiesScheduledActionsInvariant",()=>{if(!(this.scheduledActions.size>=0&&this.scheduledActions.size<=3)){let e=`There can be at most three store actions scheduled at the same time, but there are "${this.scheduledActions.size}".`;if(console.error(e,this.scheduledActions.values()),me.DEV||me.MODE===Qt.TEST)throw new Error(e)}})}get snapshot(){return this._snapshot}set snapshot(e){this._snapshot=e}},S0=class q1{constructor(t,a,n={didElementsChange:!1,didAppStateChange:!1,isEmpty:!1}){this.elements=t,this.appState=a,this.meta=n}static empty(){return new q1(new Map,xo(tn()),{didElementsChange:!1,didAppStateChange:!1,isEmpty:!0})}isEmpty(){return this.meta.isEmpty}maybeClone(t,a){let n=this.maybeCreateElementsSnapshot(t),i=this.maybeCreateAppStateSnapshot(a),l=!1,r=!1;return this.elements!==n&&(l=!0),this.appState!==i&&(r=!0),!l&&!r?this:new q1(n,i,{didElementsChange:l,didAppStateChange:r})}maybeCreateAppStateSnapshot(t){if(!t)return this.appState;let a=GE(t)?t:xo(t);return this.detectChangedAppState(a)?a:this.appState}detectChangedAppState(t){return!At(this.appState,t,{selectedElementIds:At,selectedGroupIds:At})}maybeCreateElementsSnapshot(t){return t?this.detectChangedElements(t)?this.createElementsSnapshot(t):this.elements:this.elements}detectChangedElements(t){if(this.elements===t)return!1;if(this.elements.size!==t.size)return!0;let a=Array.from(t.keys());for(let n=a.length-1;n>=0;n--){let i=this.elements.get(a[n]),l=t.get(a[n]);if(!i||!l||i.id!==l.id||i.versionNonce!==l.versionNonce)return!0}return!1}createElementsSnapshot(t){let a=new Map;for(let[n,i]of this.elements.entries())t.get(n)?a.set(n,i):a.set(n,fe(i,{isDeleted:!0}));for(let[n,i]of t.entries()){let l=a.get(n);(!l||l&&l.versionNonce!==i.versionNonce)&&a.set(n,Zi(i))}return a}},pn=new Map,jE=/^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)(?:\?t=|&t=|\?start=|&start=)?([a-zA-Z0-9_-]+)?[^\s]*$/,ZE=/^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/,KE=/^https:\/\/(?:www\.)?figma\.com/,M0=/^https:\/\/gist\.github\.com\/([\w_-]+)\/([\w_-]+)/,qE=/^<script[\s\S]*?\ssrc=["'](https:\/\/gist\.github\.com\/.*?)\.js["']/i,C0=/(?:https?:\/\/)?(?:(?:w){3}\.)?(?:twitter|x)\.com\/[^/]+\/status\/(\d+)/,JE=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:twitter|x)\.com\/[^"']*)/i,QE=/^https:\/\/(?:www\.)?val\.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/,ex=/^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i,k0=/giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/,I0=/^(?:http(?:s)?:\/\/)?(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)\/?(?:\?[^#\s]*)?(?:#[^\s]*)?$/,tx=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:www\.)?reddit\.com\/[^"']*)/i,Gc=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","link.excalidraw.com","gist.github.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","val.town","giphy.com","reddit.com"]),T0=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","reddit.com"]),Tr=e=>`<html><body>${e}</body></html>`,Nl=e=>{if(!e)return null;if(pn.has(e))return pn.get(e);let t=e,a=T0.has(Vc(e,T0)||""),n="generic",i={w:560,h:840},l=e.match(jE);if(l?.[2]){let d=l[3]?`&start=${l[3]}`:"",u=e.includes("shorts");switch(n="video",l[1]){case"embed/":case"watch?v=":case"shorts/":e=`https://www.youtube.com/embed/${l[2]}?enablejsapi=1${d}`;break;case"playlist?list=":case"embed/videoseries?list=":e=`https://www.youtube.com/embed/videoseries?list=${l[2]}&enablejsapi=1${d}`;break;default:e=`https://www.youtube.com/embed/${l[2]}?enablejsapi=1${d}`;break}return i=u?{w:315,h:560}:{w:560,h:315},pn.set(t,{link:e,intrinsicSize:i,type:n,sandbox:{allowSameOrigin:a}}),{link:e,intrinsicSize:i,type:n,sandbox:{allowSameOrigin:a}}}let r=e.match(ZE);if(r?.[1]){let d=r?.[1],u=/^\d+$/.test(d)?void 0:new URIError("Invalid embed link format");return n="video",e=`https://player.vimeo.com/video/${d}?api=1`,i={w:560,h:315},pn.set(t,{link:e,intrinsicSize:i,type:n,sandbox:{allowSameOrigin:a}}),{link:e,intrinsicSize:i,type:n,error:u,sandbox:{allowSameOrigin:a}}}if(e.match(KE))return n="generic",e=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(e)}`,i={w:550,h:550},pn.set(t,{link:e,intrinsicSize:i,type:n,sandbox:{allowSameOrigin:a}}),{link:e,intrinsicSize:i,type:n,sandbox:{allowSameOrigin:a}};let o=e.match(QE);if(o)return e=o[1]==="embed"?o[0]:o[0].replace("/v","/embed"),pn.set(t,{link:e,intrinsicSize:i,type:n,sandbox:{allowSameOrigin:a}}),{link:e,intrinsicSize:i,type:n,sandbox:{allowSameOrigin:a}};if(C0.test(e)){let d=e.match(C0)[1],u=$s(`https://twitter.com/x/status/${d}`),s={type:"document",srcdoc:c=>Tr(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${c}"><a href="${u}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:a}};return pn.set(t,s),s}if(I0.test(e)){let[,d,u,s]=e.match(I0),c=$s(`https://reddit.com/r/${d}/comments/${u}/${s}`),U={type:"document",srcdoc:f=>Tr(`<blockquote class="reddit-embed-bq" data-embed-theme="${f}"><a href="${c}"></a><br></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:a}};return pn.set(t,U),U}if(M0.test(e)){let[,d,u]=e.match(M0),s=$s(`https://gist.github.com/${d}/${u}`),c={type:"document",srcdoc:()=>Tr(`
          <script src="${s}.js"><\/script>
          <style type="text/css">
            * { margin: 0px; }
            table, .gist { height: 100%; }
            .gist .gist-file { height: calc(100vh - 2px); padding: 0px; display: grid; grid-template-rows: 1fr auto; }
          </style>
        `),intrinsicSize:{w:550,h:720},sandbox:{allowSameOrigin:a}};return pn.set(e,c),c}return pn.set(e,{link:e,intrinsicSize:i,type:n,sandbox:{allowSameOrigin:a}}),{link:e,intrinsicSize:i,type:n,sandbox:{allowSameOrigin:a}}},L0=e=>{let t;si(e)?t="IFrame element":t=!e.link||e?.link===""?"Empty Web-Embed":e.link;let a=Math.max(Math.min(e.width/2,e.width/t.length),e.width/30),n=Ke.Helvetica,i=Oe({fontSize:a,fontFamily:n});return ua({x:e.x+e.width/2,y:e.y+e.height/2,strokeColor:e.strokeColor!=="transparent"?e.strokeColor:"black",backgroundColor:"transparent",fontFamily:n,fontSize:a,text:Oi(t,i,e.width-20),textAlign:"center",verticalAlign:ca.MIDDLE,angle:e.angle??0})};V({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,a,n)=>{let i=ft(t,{type:"embeddable"});return dn(n.canvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:ft(t,{type:"embeddable"})},captureUpdate:B.EVENTUALLY}}});var Vc=(e,t)=>{try{let{hostname:a}=new URL(e),n=a.replace(/^www\./,"");if(t instanceof Set){if(Gc.has(n))return n;let l=n.replace(/^([^.]+)/,"*");return Gc.has(l)?l:null}let i=t.replace(/^www\./,"");if(n===i)return i}catch{}return null},ax=e=>{let t=e.match(JE);if(t&&t.length===2)return t[1];let a=e.match(tx);if(a&&a.length===2)return a[1];let n=e.match(qE);if(n&&n.length===2)return n[1];if(k0.test(e))return`https://giphy.com/embed/${k0.exec(e)[1]}`;let i=e.match(ex);return i&&i.length===2?i[1]:e},So=(e,t)=>{if(!e)return!1;if(t!=null)if(typeof t=="function"){let a=t(e);if(typeof a=="boolean")return a}else{if(typeof t=="boolean")return t;if(t instanceof RegExp)return t.test(e);if(Array.isArray(t)){for(let a of t)if(a instanceof RegExp){if(e.match(a))return!0}else if(Vc(e,a))return!0;return!1}}return!!Vc(e,Gc)},Lr=(e,t,a)=>{let n={sets:t.sets,shape:t.shape,options:{...t.options,fixedDecimalPlaceDigits:a}};return e.draw(n)},Dr=(e,t,a,n,i)=>{if(!n.enabled||!n.clip)return null;let l=ra(e,i);if(l){let r=t.ownerDocument.createElementNS(Ie,"g");return r.setAttributeNS(Ie,"clip-path",`url(#${l.id})`),a.forEach(o=>r.appendChild(o)),r}return null},Mo=(e,t,a,n,i,l,r,o)=>{let d={x:l,y:r},[u,s,c,U]=Ue(e,t),f=(c-u)/2-(e.x-u),p=(U-s)/2-(e.y-s);if(j(e)){let b=Tt(e,t);if(ge(b)){let[x,S,C,T]=Ue(b,t),k=Z.getBoundTextElementPosition(b,e,t);f=(C-x)/2-(k.x-x),p=(T-S)/2-(k.y-S),l=l+k.x-e.x,r=r+k.y-e.y}}let m=180*e.angle/Math.PI,g=n;if(e.link){let b=n.ownerDocument.createElementNS(Ie,"a");b.setAttribute("href",la(e.link)),g.appendChild(b),g=b}let y=(b,x)=>{Tn()&&b.setAttribute("data-id",x.id),g.appendChild(b)},v=(ra(e,t)?.opacity??100)*e.opacity/1e4;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{let b=Qe.generateElementShape(e,null),x=Lr(a,b,ar);v!==1&&(x.setAttribute("stroke-opacity",`${v}`),x.setAttribute("fill-opacity",`${v}`)),x.setAttribute("stroke-linecap","round"),x.setAttribute("transform",`translate(${l||0} ${r||0}) rotate(${m} ${f} ${p})`);let S=Dr(e,g,[x],o.frameRendering,t);y(S||x,e);break}case"iframe":case"embeddable":{let b=Qe.generateElementShape(e,o),x=Lr(a,b,ar),S=e.opacity/100;S!==1&&(x.setAttribute("stroke-opacity",`${S}`),x.setAttribute("fill-opacity",`${S}`)),x.setAttribute("stroke-linecap","round"),x.setAttribute("transform",`translate(${l||0} ${r||0}) rotate(${m} ${f} ${p})`),y(x,e);let C=L0(e);Mo(C,t,a,g,i,C.x+d.x-e.x,C.y+d.y-e.y,o);let T=Lr(a,b,ar);for(T.setAttribute("stroke-linecap","round"),T.setAttribute("transform",`translate(${l||0} ${r||0}) rotate(${m} ${f} ${p})`);T.firstChild;)T.removeChild(T.firstChild);let k=Ba(Math.min(e.width,e.height),e),R=Nl(Bc(e.link||""));if(o.renderEmbeddables===!1||R?.type==="document"){let D=n.ownerDocument.createElementNS(Ie,"a");D.setAttribute("href",la(e.link||"")),D.setAttribute("target","_blank"),D.setAttribute("rel","noopener noreferrer"),D.style.borderRadius=`${k}px`,T.appendChild(D)}else{let D=n.ownerDocument.createElementNS(Ie,"foreignObject");D.style.width=`${e.width}px`,D.style.height=`${e.height}px`,D.style.border="none";let A=D.ownerDocument.createElementNS(Ie,"div");A.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),A.style.width="100%",A.style.height="100%";let P=A.ownerDocument.createElement("iframe");P.src=R?.link??"",P.style.width="100%",P.style.height="100%",P.style.border="none",P.style.borderRadius=`${k}px`,P.style.top="0",P.style.left="0",P.allowFullscreen=!0,A.appendChild(P),D.appendChild(A),T.appendChild(D)}y(T,e);break}case"line":case"arrow":{let b=pe(e,t),x=n.ownerDocument.createElementNS(Ie,"mask");if(b){x.setAttribute("id",`mask-${e.id}`);let T=n.ownerDocument.createElementNS(Ie,"rect");l=l||0,r=r||0,T.setAttribute("x","0"),T.setAttribute("y","0"),T.setAttribute("fill","#fff"),T.setAttribute("width",`${e.width+100+l}`),T.setAttribute("height",`${e.height+100+r}`),x.appendChild(T);let k=n.ownerDocument.createElementNS(Ie,"rect"),R=Z.getBoundTextElementPosition(e,b,t),D=l+R.x-e.x,A=r+R.y-e.y;k.setAttribute("x",D.toString()),k.setAttribute("y",A.toString()),k.setAttribute("fill","#000"),k.setAttribute("width",`${b.width}`),k.setAttribute("height",`${b.height}`),k.setAttribute("opacity","1"),x.appendChild(k)}let S=n.ownerDocument.createElementNS(Ie,"g");b&&S.setAttribute("mask",`url(#mask-${e.id})`),S.setAttribute("stroke-linecap","round"),Qe.generateElementShape(e,o).forEach(T=>{let k=Lr(a,T,ar);v!==1&&(k.setAttribute("stroke-opacity",`${v}`),k.setAttribute("fill-opacity",`${v}`)),k.setAttribute("transform",`translate(${l||0} ${r||0}) rotate(${m} ${f} ${p})`),e.type==="line"&&Nn(e.points)&&e.backgroundColor!=="transparent"&&k.setAttribute("fill-rule","evenodd"),S.appendChild(k)});let C=Dr(e,g,[S,x],o.frameRendering,t);C?(y(C,e),g.appendChild(C)):(y(S,e),g.append(x));break}case"freedraw":{let b=Qe.generateElementShape(e,o),x=b?Lr(a,b,ar):n.ownerDocument.createElementNS(Ie,"g");v!==1&&(x.setAttribute("stroke-opacity",`${v}`),x.setAttribute("fill-opacity",`${v}`)),x.setAttribute("transform",`translate(${l||0} ${r||0}) rotate(${m} ${f} ${p})`),x.setAttribute("stroke","none");let S=n.ownerDocument.createElementNS(Ie,"path");S.setAttribute("fill",e.strokeColor),S.setAttribute("d",Mc(e)),x.appendChild(S);let C=Dr(e,g,[x],o.frameRendering,t);y(C||x,e);break}case"image":{let b=Math.round(e.width),x=Math.round(e.height),S=ba(e)&&i[e.fileId];if(S){let{reuseImages:C=!0}=o,T=`image-${S.id}`,k=e.width,R=e.height;e.crop&&({width:k,height:R}=Pn(e),T=`image-crop-${S.id}-${Ah(`${k}x${R}`)}`),C||(T=`image-${e.id}`);let D=n.querySelector(`#${T}`);if(!D){D=n.ownerDocument.createElementNS(Ie,"symbol"),D.id=T;let K=n.ownerDocument.createElementNS(Ie,"image");K.setAttribute("href",S.dataURL),K.setAttribute("preserveAspectRatio","none"),e.crop||!C?(K.setAttribute("width",`${k}`),K.setAttribute("height",`${R}`)):(K.setAttribute("width","100%"),K.setAttribute("height","100%")),D.appendChild(K),(g.querySelector("defs")||g).prepend(D)}let A=n.ownerDocument.createElementNS(Ie,"use");A.setAttribute("href",`#${T}`),o.exportWithDarkMode&&S.mimeType!==ne.svg&&A.setAttribute("filter",df);let P=0,$=0;if(e.crop){let{width:K,height:G}=Pn(e);P=e.crop.x/(e.crop.naturalWidth/K),$=e.crop.y/(e.crop.naturalHeight/G)}let X=f+P,_=p+$;A.setAttribute("width",`${b+P}`),A.setAttribute("height",`${x+$}`),A.setAttribute("opacity",`${v}`),(e.scale[0]!==1||e.scale[1]!==1)&&A.setAttribute("transform",`translate(${X} ${_}) scale(${e.scale[0]} ${e.scale[1]}) translate(${-X} ${-_})`);let H=n.ownerDocument.createElementNS(Ie,"g");if(e.crop){let K=n.ownerDocument.createElementNS(Ie,"mask");K.setAttribute("id",`mask-image-crop-${e.id}`),K.setAttribute("fill","#fff");let G=n.ownerDocument.createElementNS(Ie,"rect");G.setAttribute("x",`${P}`),G.setAttribute("y",`${$}`),G.setAttribute("width",`${b}`),G.setAttribute("height",`${x}`),K.appendChild(G),g.appendChild(K),H.setAttribute("mask",`url(#${K.id})`)}if(H.appendChild(A),H.setAttribute("transform",`translate(${l-P} ${r-$}) rotate(${m} ${X} ${_})`),e.roundness){let K=n.ownerDocument.createElementNS(Ie,"clipPath");K.id=`image-clipPath-${e.id}`;let G=n.ownerDocument.createElementNS(Ie,"rect"),ce=Ba(Math.min(e.width,e.height),e);G.setAttribute("width",`${e.width}`),G.setAttribute("height",`${e.height}`),G.setAttribute("rx",`${ce}`),G.setAttribute("ry",`${ce}`),K.appendChild(G),y(K,e),H.setAttributeNS(Ie,"clip-path",`url(#${K.id})`)}let W=Dr(e,g,[H],o.frameRendering,t);y(W||H,e)}break}case"frame":case"magicframe":{if(o.frameRendering.enabled&&o.frameRendering.outline){let b=document.createElementNS(Ie,"rect");b.setAttribute("transform",`translate(${l||0} ${r||0}) rotate(${m} ${f} ${p})`),b.setAttribute("width",`${e.width}px`),b.setAttribute("height",`${e.height}px`),b.setAttribute("rx",qe.radius.toString()),b.setAttribute("ry",qe.radius.toString()),b.setAttribute("fill","none"),b.setAttribute("stroke",qe.strokeColor),b.setAttribute("stroke-width",qe.strokeWidth.toString()),y(b,e)}break}default:if(j(e)){let b=n.ownerDocument.createElementNS(Ie,"g");v!==1&&(b.setAttribute("stroke-opacity",`${v}`),b.setAttribute("fill-opacity",`${v}`)),b.setAttribute("transform",`translate(${l||0} ${r||0}) rotate(${m} ${f} ${p})`);let x=e.text.replace(/\r\n?/g,`
`).split(`
`),S=fr(e.fontSize,e.lineHeight),C=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,T=ZU(e.fontFamily,e.fontSize,S),k=Hu(e.text)?"rtl":"ltr",R=e.textAlign==="center"?"middle":e.textAlign==="right"||k==="rtl"?"end":"start";for(let A=0;A<x.length;A++){let P=n.ownerDocument.createElementNS(Ie,"text");P.textContent=x[A],P.setAttribute("x",`${C}`),P.setAttribute("y",`${A*S+T}`),P.setAttribute("font-family",bl(e)),P.setAttribute("font-size",`${e.fontSize}px`),P.setAttribute("fill",e.strokeColor),P.setAttribute("text-anchor",R),P.setAttribute("style","white-space: pre;"),P.setAttribute("direction",k),P.setAttribute("dominant-baseline","alphabetic"),b.appendChild(P)}let D=Dr(e,g,[b],o.frameRendering,t);y(D||b,e)}else throw new Error(`Unimplemented type ${e.type}`)}},nx=(e,t,a,n,i,l)=>{n&&(e.filter(r=>!ya(r)).forEach(r=>{if(!r.isDeleted){if(j(r)&&r.containerId&&t.has(r.containerId))return;try{Mo(r,t,a,n,i,r.x+l.offsetX,r.y+l.offsetY,l);let o=pe(r,t);o&&Mo(o,t,a,n,i,o.x+l.offsetX,o.y+l.offsetY,l)}catch(o){console.error(o)}}}),e.filter(r=>ya(r)).forEach(r=>{if(!r.isDeleted)try{Mo(r,t,a,n,i,r.x+l.offsetX,r.y+l.offsetY,l)}catch(o){console.error(o)}}))},D0=500,Yc=e=>{let t=e.extensions?.reduce((n,i)=>(n.push(ne[i]),n),[]),a=e.extensions?.reduce((n,i)=>i==="jpg"?n.concat(".jpg",".jpeg"):n.concat(`.${i}`),[]);return ag({description:e.description,extensions:a,mimeTypes:t,multiple:e.multiple??!1,legacySetup:(n,i,l)=>{let r=yl(i,D0),o=()=>{d(),document.addEventListener("keyup",r),document.addEventListener("pointerup",r),r()},d=()=>{if(l.files?.length){let s=e.multiple?[...l.files]:l.files[0];n(s)}};requestAnimationFrame(()=>{window.addEventListener("focus",o)});let u=window.setInterval(()=>{d()},D0);return s=>{clearInterval(u),r.cancel(),window.removeEventListener("focus",o),document.removeEventListener("keyup",r),document.removeEventListener("pointerup",r),s&&(console.warn("Opening the file was canceled (legacy-fs)."),s(new Qs))}}})},Co=(e,t)=>ng(e,{fileName:`${t.name}.${t.extension}`,description:t.description,extensions:[`.${t.extension}`],mimeTypes:t.mimeTypes},t.fileHandle),ix=(e,t)=>{let a={};for(let n of e)!n.isDeleted&&"fileId"in n&&n.fileId&&t[n.fileId]&&(a[n.fileId]=t[n.fileId]);return a},Ar=(e,t,a,n)=>{let i={type:Da.excalidraw,version:Cs.excalidraw,source:Dd,elements:n==="local"?qp(e):TS(e),appState:n==="local"?Lu(t):y7(t),files:n==="local"?ix(e,a):void 0};return JSON.stringify(i,null,2)},A0=async(e,t,a,n=t.name||Cu)=>{let i=Ar(e,t,a,"local"),l=new Blob([i],{type:ne.excalidraw});return{fileHandle:await Co(l,{name:n,extension:"excalidraw",description:"Excalidraw file",fileHandle:Nh(t.fileHandle)?null:t.fileHandle})}},lx=async(e,t)=>{let a=await Yc({description:"Excalidraw files"});return _h(await zh(a),e,t,a.handle)},rx=e=>e?.type===Da.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||typeof e.appState=="object")),R0=e=>typeof e=="object"&&e&&e.type===Da.excalidrawLibrary&&(e.version===1||e.version===2),jc=e=>{let t={type:Da.excalidrawLibrary,version:Cs.excalidrawLibrary,source:Dd,libraryItems:e};return JSON.stringify(t,null,2)},sx=async e=>{let t=jc(e);await Co(new Blob([t],{type:ne.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})},N0=e=>new Promise((t,a)=>{let n=new Image;n.onload=()=>{t(n)},n.onerror=i=>{a(i)},n.src=e}),P0=async({fileIds:e,files:t,imageCache:a})=>{let n=new Map,i=new Map;return await Promise.all(e.reduce((l,r)=>{let o=t[r];return o&&!n.has(r)?(n.set(r,!0),l.concat((async()=>{try{if(o.mimeType===ne.binary)throw new Error("Only images can be added to ImageCache");let d=N0(o.dataURL),u={image:d,mimeType:o.mimeType};a.set(r,u);let s=await d;a.set(r,{...u,image:s})}catch{i.set(r,!0)}})())):l},[])),{imageCache:a,updatedFiles:n,erroredFiles:i}},_0=e=>e.filter(t=>ba(t)),ox=e=>e?.nodeName.toLowerCase()==="svg",O0=e=>{let t=new DOMParser().parseFromString(e,ne.svg),a=t.querySelector("svg");if(t.querySelector("parsererror")||!ox(a))throw new Error("Invalid SVG");{a.hasAttribute("xmlns")||a.setAttribute("xmlns",Ie);let n=a.getAttribute("width"),i=a.getAttribute("height");(n?.includes("%")||n==="auto")&&(n=null),(i?.includes("%")||i==="auto")&&(i=null);let l=a.getAttribute("viewBox");if(!n||!i){if(n=n||"50",i=i||"50",l){let r=l.match(/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/);r&&([,n,i]=r)}a.setAttribute("width",n),a.setAttribute("height",i)}return l||a.setAttribute("viewBox",`0 0 ${n} ${i}`),a.outerHTML}},B0=document.createElement("img");B0.src=`data:${ne.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>')}`;var z0=document.createElement("img");z0.src=`data:${ne.svg}, ${encodeURIComponent('<svg  xmlns="http://www.w3.org/2000/svg"  width="16"  height="16"  viewBox="0 0 24 24"  fill="none"  stroke="#1971c2"  stroke-width="2"  stroke-linecap="round"  stroke-linejoin="round"  class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-big-right-line"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 9v-3.586a1 1 0 0 1 1.707 -.707l6.586 6.586a1 1 0 0 1 0 1.414l-6.586 6.586a1 1 0 0 1 -1.707 -.707v-3.586h-6v-6h6z" /><path d="M3 9v6" /></svg>')}`;var Zc=([e,t,a,n],i,l)=>{let r=mw,o=r/l.zoom.value,d=r/l.zoom.value,u=r/l.zoom.value,s=(e+a)/2,c=(t+n)/2,U=(r-8)/(2*l.zoom.value),f=4/l.zoom.value,p=a+f-U,m=t-f-u+U,[g,y]=O(w(p+o/2,m+d/2),w(s,c),i);return[g-o/2,y-d/2,o,d]},F0=(e,t,a,[n,i])=>{let l=4/a.zoom.value,[r,o,d,u]=Ue(e,t),[s,c,U,f]=Zc([r,o,d,u],e.angle,a);return n>s-l&&n<s+l+U&&i>c-l&&i<c+f+l},Kc=(e,t,a,[n,i],l)=>!e.link||a.selectedElementIds[e.id]?!1:!l&&a.viewModeEnabled&&yc(n,i,e,t)?!0:F0(e,t,a,w(n,i)),ko=(e,t,a,n,i=!0)=>{e.beginPath(),e.arc(t,a,n,0,Math.PI*2),e.fill(),i&&e.stroke()},qc=(e,t)=>[e.width/t,e.height/t],Jc=({canvas:e,scale:t,normalizedWidth:a,normalizedHeight:n,theme:i,isExporting:l,viewBackgroundColor:r})=>{let o=e.getContext("2d");return o.setTransform(1,0,0,1,0,0),o.scale(t,t),l&&i===Se.DARK&&(o.filter=Nd),typeof r=="string"?((r==="transparent"||r.length===5||r.length===9||/(hsla|rgba)\(/.test(r))&&o.clearRect(0,0,a,n),o.save(),o.fillStyle=r,o.fillRect(0,0,a,n),o.restore()):o.clearRect(0,0,a,n),o},$0=(e,t)=>{let a=window.location.href;try{let n=new URL(a);return n.searchParams.set(Is,e),la(n.toString())}catch(n){console.error(n)}return la(a)},H0=(e,t)=>{if(e.length>0&&Io(e)){if(e.length===1)return{id:e[0].id,type:"element"};if(e.length>1){let a=Object.keys(t.selectedGroupIds)[0];return a?{id:a,type:"group"}:{id:e[0].groupIds[0],type:"group"}}}return null},Io=e=>!!(e.length===1||e.length>1&&qf(e)),Pl=e=>{try{let t=new URL(e);return t.searchParams.has(Is)&&t.host===window.location.host}catch{return!1}},dx=e=>{try{let{searchParams:t}=new URL(e);if(t.has(Is))return t.get(Is)}catch{}return null},To={Bold:"#dddddd",Regular:"#e5e5e5"},cx=(e,t,a,n,i,l,r,o)=>{let d=n%t-t,u=i%t-t,s=t*l.value,c=1/l.value;e.save(),l.value===1&&e.translate(d%1?0:.5,u%1?0:.5);for(let U=d;U<d+r+t*2;U+=t){let f=a>1&&Math.round(U-n)%(a*t)===0;if(!f&&s<10)continue;let p=Math.min(1/l.value,f?4:1);e.lineWidth=p;let m=[p*3,c+(p+c)];e.beginPath(),e.setLineDash(f?[]:m),e.strokeStyle=f?To.Bold:To.Regular,e.moveTo(U,u-t),e.lineTo(U,Math.ceil(u+o+t*2)),e.stroke()}for(let U=u;U<u+o+t*2;U+=t){let f=a>1&&Math.round(U-i)%(a*t)===0;if(!f&&s<10)continue;let p=Math.min(1/l.value,f?4:1);e.lineWidth=p;let m=[p*3,c+(p+c)];e.beginPath(),e.setLineDash(f?[]:m),e.strokeStyle=f?To.Bold:To.Regular,e.moveTo(d-t,U),e.lineTo(Math.ceil(d+r+t*2),U),e.stroke()}e.restore()},X0=(e,t,a,n)=>{t.translate(e.x+n.scrollX,e.y+n.scrollY),t.beginPath(),t.roundRect?t.roundRect(0,0,e.width,e.height,qe.radius/n.zoom.value):t.rect(0,0,e.width,e.height),t.clip(),t.translate(-(e.x+n.scrollX),-(e.y+n.scrollY))},W0={regularLink:null,elementLink:null},G0=(e,t,a,n)=>{if(e.link&&!a.selectedElementIds[e.id]){let[i,l,r,o]=Ue(e,n),[d,u,s,c]=Zc([i,l,r,o],e.angle,a),U=d+s/2,f=u+c/2;t.save(),t.translate(a.scrollX+U,a.scrollY+f),t.rotate(e.angle);let p=Pl(e.link)?"elementLink":"regularLink",m=W0[p];if(!m||m.zoom!==a.zoom.value){m=Object.assign(document.createElement("canvas"),{zoom:a.zoom.value}),m.width=s*window.devicePixelRatio*a.zoom.value,m.height=c*window.devicePixelRatio*a.zoom.value,W0[p]=m;let g=m.getContext("2d");g.scale(window.devicePixelRatio*a.zoom.value,window.devicePixelRatio*a.zoom.value),g.fillStyle="#fff",g.fillRect(0,0,s,c),p==="elementLink"?g.drawImage(z0,0,0,s,c):g.drawImage(B0,0,0,s,c),g.restore()}t.drawImage(m,d-U,u-f,s,c),t.restore()}},V0=({canvas:e,rc:t,elementsMap:a,allElementsMap:n,visibleElements:i,scale:l,appState:r,renderConfig:o})=>{if(e===null)return;let{renderGrid:d=!0,isExporting:u}=o,[s,c]=qc(e,l),U=Jc({canvas:e,scale:l,normalizedWidth:s,normalizedHeight:c,theme:r.theme,isExporting:u,viewBackgroundColor:r.viewBackgroundColor});U.scale(r.zoom.value,r.zoom.value),d&&cx(U,r.gridSize,r.gridStep,r.scrollX,r.scrollY,r.zoom,s/r.zoom.value,c/r.zoom.value);let f=new Set;i.forEach(m=>{m.groupIds.length>0&&r.frameToHighlight&&r.selectedElementIds[m.id]&&(bi(m,r.frameToHighlight,a)||m.groupIds.find(g=>f.has(g)))&&m.groupIds.forEach(g=>f.add(g))});let p=new Map;i.filter(m=>!ya(m)).forEach(m=>{try{let g=m.frameId||r.frameToHighlight?.id;if(j(m)&&m.containerId&&a.has(m.containerId))return;if(U.save(),g&&r.frameRendering.enabled&&r.frameRendering.clip){let v=bh(m,a,r);v&&Ip(m,v,r,a,p)&&X0(v,U,o,r),Xi(m,a,n,t,U,o,r)}else Xi(m,a,n,t,U,o,r);let y=pe(m,a);y&&Xi(y,a,n,t,U,o,r),U.restore(),u||G0(m,U,r,a)}catch(g){console.error(g,m.id,m.x,m.y,m.width,m.height)}}),i.filter(m=>ya(m)).forEach(m=>{try{let g=()=>{if(Xi(m,a,n,t,U,o,r),ya(m)&&(u||ea(m)&&o.embedsValidationStatus.get(m.id)!==!0)&&m.width&&m.height){let y=L0(m);Xi(y,a,n,t,U,o,r)}u||G0(m,U,r,a)};if((m.frameId||r.frameToHighlight?.id)&&r.frameRendering.enabled&&r.frameRendering.clip){U.save();let y=bh(m,a,r);y&&Ip(m,y,r,a,p)&&X0(y,U,o,r),g(),U.restore()}else g()}catch(g){console.error(g)}}),o.pendingFlowchartNodes?.forEach(m=>{try{Xi(m,a,n,t,U,o,r)}catch(g){console.error(g)}})},Y0=Os(e=>{V0(e)},{trailing:!0}),j0=(e,t)=>{if(t){Y0(e);return}V0(e)},hx=(e,t)=>{if(e.width<=t)return e;let a=document.createElement("canvas").getContext("2d");a.font=Oe({fontFamily:e.fontFamily,fontSize:e.fontSize});let n=e.text;if(a.measureText(n).width>t)for(let i=n.length;i>0;i--){let l=`${n.slice(0,i)}...`;if(a.measureText(l).width<=t){n=l;break}}return fe(e,{text:n,width:t})},ux=(e,t)=>{let a=[];for(let n of e){if(de(n)){let i=ua({x:n.x,y:n.y-qe.nameOffsetY,fontFamily:Ke.Helvetica,fontSize:qe.nameFontSize,lineHeight:qe.nameLineHeight,strokeColor:t.exportWithDarkMode?qe.nameColorDarkTheme:qe.nameColorLightTheme,text:Tp(n)});i.y-=i.height,i=hx(i,n.width),a.push(i)}a.push(n)}return a},Z0=(e,t)=>(t=t||tn().frameRendering,{enabled:e?!0:t.enabled,outline:e?!1:t.outline,name:e?!1:t.name,clip:e?!0:t.clip}),K0=({elements:e,exportingFrame:t,frameRendering:a,exportWithDarkMode:n})=>{let i;return t?i=yh(e,t):a.enabled&&a.name?i=ux(e,{exportWithDarkMode:n}):i=e,i},q0=async(e,t,a,{exportBackground:n,exportPadding:i=Ul,viewBackgroundColor:l,exportingFrame:r},o=(u,s)=>{let c=document.createElement("canvas");return c.width=u*t.exportScale,c.height=s*t.exportScale,{canvas:c,scale:t.exportScale}},d=async()=>{await An.loadElementsFonts(e)})=>{await d();let u=Z0(r??null,t.frameRendering??null);r&&(u.clip=!1);let s=K0({elements:e,exportingFrame:r,exportWithDarkMode:t.exportWithDarkMode,frameRendering:u});r&&(i=0);let[c,U,f,p]=eh(r?[r]:gh(s),i),{canvas:m,scale:g=1}=o(f,p),y=tn(),{imageCache:v}=await P0({imageCache:new Map,fileIds:_0(s).map(b=>b.fileId),files:a});return j0({canvas:m,rc:Jn.canvas(m),elementsMap:ga(oe(s)),allElementsMap:ga(oe(Un(e))),visibleElements:s,scale:g,appState:{...t,frameRendering:u,viewBackgroundColor:n?l:null,scrollX:-c+i,scrollY:-U+i,zoom:y.zoom,shouldCacheIgnoreZoom:!1,theme:t.exportWithDarkMode?Se.DARK:Se.LIGHT},renderConfig:{canvasBackgroundColor:l,imageCache:v,renderGrid:!1,isExporting:!0,embedsValidationStatus:new Map,elementsPendingErasure:new Set,pendingFlowchartNodes:null}}),m},Rr=e=>document.createComment(` ${e} `),Qc=async(e,t,a,n)=>{let i=Z0(n?.exportingFrame??null,t.frameRendering??null),{exportPadding:l=Ul,exportWithDarkMode:r=!1,viewBackgroundColor:o,exportScale:d=1,exportEmbedScene:u}=t,{exportingFrame:s=null}=n||{},c=K0({elements:e,exportingFrame:s,exportWithDarkMode:r,frameRendering:i});s&&(l=0);let[U,f,p,m]=eh(s?[s]:gh(c),l),g=-U+l,y=-f+l,v=document.createElementNS(Ie,"svg");v.setAttribute("version","1.1"),v.setAttribute("xmlns",Ie),v.setAttribute("viewBox",`0 0 ${p} ${m}`),v.setAttribute("width",`${p*d}`),v.setAttribute("height",`${m*d}`),r&&v.setAttribute("filter",Nd);let b=v.ownerDocument.createElementNS(Ie,"defs"),x=v.ownerDocument.createElementNS(Ie,"metadata");if(v.appendChild(Rr("svg-source:excalidraw")),v.appendChild(x),v.appendChild(b),u)try{Ux({metadataElement:x,payload:Ar(e,t,a||{},"local")})}catch(A){console.error(A)}let S=mh(e);if(S.length){let A=oe(e);for(let P of S){let $=v.ownerDocument.createElementNS(Ie,"clipPath");$.setAttribute("id",P.id);let[X,_,H,W]=Ue(P,A),K=(H-X)/2-(P.x-X),G=(W-_)/2-(P.y-_),ce=v.ownerDocument.createElementNS(Ie,"rect");ce.setAttribute("transform",`translate(${P.x+g} ${P.y+y}) rotate(${P.angle} ${K} ${G})`),ce.setAttribute("width",`${P.width}`),ce.setAttribute("height",`${P.height}`),s||(ce.setAttribute("rx",`${qe.radius}`),ce.setAttribute("ry",`${qe.radius}`)),$.appendChild(ce),b.appendChild($)}}let C=n?.skipInliningFonts?[]:await An.generateFontFaceDeclarations(e),T=`
      `,k=v.ownerDocument.createElementNS(Ie,"style");if(k.classList.add("style-fonts"),k.appendChild(document.createTextNode(`${T}${C.join(T)}`)),b.appendChild(k),t.exportBackground&&o){let A=v.ownerDocument.createElementNS(Ie,"rect");A.setAttribute("x","0"),A.setAttribute("y","0"),A.setAttribute("width",`${p}`),A.setAttribute("height",`${m}`),A.setAttribute("fill",o),v.appendChild(A)}let R=Jn.svg(v),D=n?.renderEmbeddables??!1;return nx(c,ga(oe(c)),R,v,a||{},{offsetX:g,offsetY:y,isExporting:!0,exportWithDarkMode:r,renderEmbeddables:D,frameRendering:i,canvasBackgroundColor:o,embedsValidationStatus:D?new Map(c.filter(A=>de(A)).map(A=>[A.id,!0])):new Map,reuseImages:n?.reuseImages??!0}),v},Ux=({payload:e,metadataElement:t})=>{let a=s2(JSON.stringify(d2({text:e})),!0);t.appendChild(Rr(`payload-type:${ne.excalidraw}`)),t.appendChild(Rr("payload-version:2")),t.appendChild(Rr("payload-start")),t.appendChild(document.createTextNode(a)),t.appendChild(Rr("payload-end"))},fx=({svg:e})=>{if(e.includes(`payload-type:${ne.excalidraw}`)){let t=e.match(/<!-- payload-start -->\s*(.+?)\s*<!-- payload-end -->/);if(!t)throw new Error("INVALID");let a=(e.match(/<!-- payload-version:(\d+) -->/)?.[1]||"1")!=="1";try{let n=o2(t[1],a),i=JSON.parse(n);if(!("encoded"in i)){if("type"in i&&i.type===Da.excalidraw)return n;throw new Error("FAILED")}return BS(i)}catch(n){throw console.error(n),new Error("FAILED")}}throw new Error("INVALID")},eh=(e,t)=>{let[a,n,i,l]=De(e),r=Ot(a,i)+t*2,o=Ot(n,l)+t*2;return[a,n,r,o]},px=(e,t,a)=>{let[,,n,i]=eh(e,t).map(l=>Math.trunc(l*a));return[n,i]},mx=class{constructor(t){this.scoreFunction=t,I(this,"content",[])}sinkDown(t){let a=this.content[t];for(;t>0;){let n=(t+1>>1)-1,i=this.content[n];if(this.scoreFunction(a)<this.scoreFunction(i))this.content[n]=a,this.content[t]=i,t=n;else break}}bubbleUp(t){let a=this.content.length,n=this.content[t],i=this.scoreFunction(n);for(;;){let l=t+1<<1,r=l-1,o=null,d=0;if(r<a){let u=this.content[r];d=this.scoreFunction(u),d<i&&(o=r)}if(l<a){let u=this.content[l];this.scoreFunction(u)<(o===null?i:d)&&(o=l)}if(o!==null)this.content[t]=this.content[o],this.content[o]=n,t=o;else break}}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],a=this.content.pop();return this.content.length>0&&(this.content[0]=a,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let a=this.content.indexOf(t),n=this.content.pop();a<this.content.length&&(this.content[a]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(a):this.bubbleUp(a))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}},th=1,_e=40,gx=(e,t)=>{let a=e.fixedSegments?e.fixedSegments.slice():null;if(a){let n=[];e.points.map(r=>w(e.x+r[0],e.y+r[1])).forEach((r,o,d)=>{if(o<2)return n.push(r);let u=vr(r,d[o-1]),s=vr(d[o-1],d[o-2]);if(rt(u,s)){let c=a?.findIndex(f=>f.index===o-1)??-1,U=a?.findIndex(f=>f.index===o)??-1;U!==-1&&(a[U].start=w(d[o-2][0]-e.x,d[o-2][1]-e.y)),c!==-1&&a.splice(c,1),n.splice(-1,1),a.forEach(f=>{f.index>o-1&&(f.index-=1)})}return n.push(r)});let i=[];n.forEach((r,o,d)=>{if(o<3)return i.push(r);if(Te(d[o-2],d[o-1])<th){let u=a?.findIndex(U=>U.index===o-2)??-1,s=a?.findIndex(U=>U.index===o-1)??-1;s!==-1&&a.splice(s,1),u!==-1&&a.splice(u,1),i.splice(-2,2),a.forEach(U=>{U.index>o-2&&(U.index-=2)});let c=_n(r,d[o-1]);return i.push(w(c?r[0]:d[o-2][0],c?d[o-2][1]:r[1]))}i.push(r)});let l=a.filter(r=>r.index!==1&&r.index!==i.length-1);return l.length===0?pi(rh(sh(ih(e,nh(e,t,i.map(r=>w(r[0]-e.x,r[1]-e.y)),e.startBinding&&_l(e.startBinding.elementId,t),e.endBinding&&_l(e.endBinding.elementId,t)))??[])),l,null,null):(me.DEV&&Bt(oh(i),"Invalid elbow points with fixed segments"),pi(i,l,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},bx=(e,t,a)=>{let n=t.map(k=>k.index),i=(e.fixedSegments?.map(k=>k.index)??[]).findIndex(k=>!n.includes(k));if(i===-1||!e.fixedSegments?.[i])return{points:e.points};let l=e.fixedSegments[i].index,r=e.fixedSegments[i-1],o=e.fixedSegments[i+1],d=e.x+(r?r.end[0]:0),u=e.y+(r?r.end[1]:0),s=r?null:e.startBinding,c=o?null:e.endBinding,{startHeading:U,endHeading:f,startGlobalPoint:p,endGlobalPoint:m,hoveredStartElement:g,hoveredEndElement:y,...v}=nh({x:d,y:u,startBinding:s,endBinding:c,startArrowhead:null,endArrowhead:null,points:e.points},a,[w(0,0),w(e.x+(o?.start[0]??e.points[e.points.length-1][0])-d,e.y+(o?.start[1]??e.points[e.points.length-1][1])-u)],s&&_l(s.elementId,a),c&&_l(c.elementId,a),{isDragging:!1}),{points:b}=pi(rh(sh(ih(e,{startHeading:U,endHeading:f,startGlobalPoint:p,endGlobalPoint:m,hoveredEndElement:y,...v})??[])),t,null,null),x=[];if(r)for(let k=0;k<r.index;k++)x.push(w(e.x+e.points[k][0],e.y+e.points[k][1]));if(b.forEach(k=>{x.push(w(e.x+(r?r.end[0]:0)+k[0],e.y+(r?r.end[1]:0)+k[1]))}),o)for(let k=o.index;k<e.points.length;k++)x.push(w(e.x+e.points[k][0],e.y+e.points[k][1]));let S=(o?.index??e.points.length)-(r?.index??0)-1,C=t.map(k=>k.index>l?{...k,index:k.index-S+(b.length-1)}:k),T=x.flatMap((k,R)=>{let D=x[R-1],A=x[R+1];if(D&&A){let P=vr(k,D),$=vr(A,k);if(rt(P,$))return C.forEach(X=>{X.index>R&&(X.index-=1)}),[];if(rt(P,xf($)))return C.forEach(X=>{X.index>R&&(X.index+=1)}),[k,k]}return[k]});return pi(T,C,!1,!1)},yx=(e,t,a,n,i,l)=>{let r=t.map((S,C)=>e.fixedSegments==null||e.fixedSegments[C]===void 0||e.fixedSegments[C].index!==S.index||(S.start[0]!==e.fixedSegments[C].start[0]&&S.end[0]!==e.fixedSegments[C].end[0])!=(S.start[1]!==e.fixedSegments[C].start[1]&&S.end[1]!==e.fixedSegments[C].end[1])?C:null).filter(S=>S!==null).shift();if(r==null)return{points:e.points};let o=e.fixedSegments?.findIndex(S=>S.index===1)??-1,d=e.fixedSegments?.findIndex(S=>S.index===e.points.length-1)??-1,u=Te(t[r].start,t[r].end),s=u<_e+5;if(o===-1&&t[r].index===1&&i){let S=On(a),C=(S?rt(a,lt):rt(a,It))?s?u/2:_e:s?-u/2:-_e;t[r].start=w(t[r].start[0]+(S?C:0),t[r].start[1]+(S?0:C))}if(d===-1&&t[r].index===e.points.length-1&&l){let S=On(n),C=(S?rt(n,lt):rt(n,It))?s?u/2:_e:s?-u/2:-_e;t[r].end=w(t[r].end[0]+(S?C:0),t[r].end[1]+(S?0:C))}let c=t.map(S=>({...S,start:w(e.x+S.start[0],e.y+S.start[1]),end:w(e.x+S.end[0],e.y+S.end[1])})),U=e.points.map((S,C)=>w(e.x+S[0],e.y+S[1])),f=c[r].index-1,p=c[r].index,m=c[r].start,g=c[r].end,y=U[f-1]&&!Ra(U[f],U[f-1])?_n(U[f-1],U[f]):void 0,v=U[p+1]&&!Ra(U[p],U[p+1])?_n(U[p+1],U[p]):void 0;if(y!==void 0){let S=y?1:0;U[f-1][S]=m[S]}if(U[f]=m,U[p]=g,v!==void 0){let S=v?1:0;U[p+1][S]=g[S]}let b=c.findIndex(S=>S.index===f);if(b!==-1){let S=_n(c[b].end,c[b].start)?1:0;c[b].start[S]=m[S],c[b].end=m}let x=c.findIndex(S=>S.index===p+1);if(x!==-1){let S=_n(c[x].end,c[x].start)?1:0;c[x].end[S]=g[S],c[x].start=g}if(o===-1&&f===0){let S=i?On(a):_n(U[1],U[0]);U.unshift(w(S?m[0]:e.x+e.points[0][0],S?e.y+e.points[0][1]:m[1])),i&&U.unshift(w(e.x+e.points[0][0],e.y+e.points[0][1]));for(let C of c)C.index+=i?2:1}if(d===-1&&p===e.points.length-1){let S=On(n);U.push(w(S?g[0]:e.x+e.points[e.points.length-1][0],S?e.y+e.points[e.points.length-1][1]:g[1])),l&&U.push(w(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return pi(U,c.map(S=>({...S,start:w(S.start[0]-e.x,S.start[1]-e.y),end:w(S.end[0]-e.x,S.end[1]-e.y)})),!1,!1)},vx=(e,t,a,n,i,l,r,o,d)=>{let u=e.startIsSpecial??null,s=e.endIsSpecial??null,c=t.map((g,y)=>y===0||y===t.length-1?w(e.x+g[0],e.y+g[1]):w(e.x+e.points[y][0],e.y+e.points[y][1])),U=a.map(g=>({...g,start:w(e.x+(g.start[0]-t[0][0]),e.y+(g.start[1]-t[0][1])),end:w(e.x+(g.end[0]-t[0][0]),e.y+(g.end[1]-t[0][1]))})),f=[],p=2+(u?1:0),m=2+(s?1:0);for(;f.length+p<c.length-m;)f.push(c[f.length+p]);{let g=c[u?2:1],y=c[u?3:2],v=On(n),b=On(Wi(ie(g,y)));if(o&&v===b){let x=v?rt(n,lt):rt(n,It);if(f.unshift(w(b?l[0]+(x?_e:-_e):y[0],b?y[1]:l[1]+(x?_e:-_e))),f.unshift(w(v?l[0]+(x?_e:-_e):l[0],v?l[1]:l[1]+(x?_e:-_e))),!u){u=!0;for(let S of U)S.index>1&&(S.index+=1)}}else if(f.unshift(w(b?l[0]:g[0],b?g[1]:l[1])),u){u=!1;for(let x of U)x.index>1&&(x.index-=1)}f.unshift(l)}{let g=c[c.length-(s?3:2)],y=c[c.length-(s?4:3)],v=On(i),b=_n(y,g);if(d&&v===b){let x=v?rt(i,lt):rt(i,It);f.push(w(b?r[0]+(x?_e:-_e):y[0],b?y[1]:r[1]+(x?_e:-_e))),f.push(w(v?r[0]+(x?_e:-_e):r[0],v?r[1]:r[1]+(x?_e:-_e))),s||(s=!0)}else f.push(w(b?r[0]:g[0],b?g[1]:r[1])),s&&(s=!1)}return f.push(r),pi(f,U.map(({index:g})=>({index:g,start:f[g-1],end:f[g]})).map(g=>({...g,start:w(g.start[0]-l[0],g.start[1]-l[1]),end:w(g.end[0]-l[0],g.end[1]-l[1])})),u,s)},Xe=1e6,ah=(e,t,a,n)=>{if(e.points.length<2)return{points:a.points??e.points};(e.x<-Xe||e.x>Xe||e.y<-Xe||e.y>Xe||e.x+(a?.points?.[a?.points?.length-1]?.[0]??0)<-Xe||e.x+(a?.points?.[a?.points?.length-1]?.[0]??0)>Xe||e.y+(a?.points?.[a?.points?.length-1]?.[1]??0)<-Xe||e.y+(a?.points?.[a?.points?.length-1]?.[1]??0)>Xe||e.x+(e?.points?.[e?.points?.length-1]?.[0]??0)<-Xe||e.x+(e?.points?.[e?.points?.length-1]?.[0]??0)>Xe||e.y+(e?.points?.[e?.points?.length-1]?.[1]??0)<-Xe||e.y+(e?.points?.[e?.points?.length-1]?.[1]??0)>Xe)&&console.error("Elbow arrow (or update) is outside reasonable bounds (> 1e6)",{arrow:e,updates:a}),e.x=we(e.x,-Xe,Xe),e.y=we(e.y,-Xe,Xe),a.points&&(a.points=a.points.map(([y,v])=>w(we(y,-Xe,Xe),we(v,-Xe,Xe))));let i=a.points?a.points&&a.points.length===2?e.points.map((y,v)=>v===0?a.points[0]:v===e.points.length-1?a.points[1]:y):a.points.slice():e.points.slice(),l=typeof a.startBinding<"u"?a.startBinding:e.startBinding,r=typeof a.endBinding<"u"?a.endBinding:e.endBinding,o=l&&_l(l.elementId,t),d=r&&_l(r.elementId,t);if(t.size===0&&oh(i)||o?.id!==l?.elementId||d?.id!==r?.elementId)return pi(i.map(y=>w(e.x+y[0],e.y+y[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:u,endHeading:s,startGlobalPoint:c,endGlobalPoint:U,hoveredStartElement:f,hoveredEndElement:p,...m}=nh({x:e.x,y:e.y,startBinding:l,endBinding:r,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,i,o,d,n),g=a.fixedSegments??e.fixedSegments??[];return!a.points&&!a.fixedSegments&&!a.startBinding&&!a.endBinding?gx(e,t):a.startBinding===e.startBinding&&a.endBinding===e.endBinding&&(a.points??[]).every((y,v)=>Ra(y,e.points[v]??w(1/0,1/0)))?{}:g.length===0?pi(rh(sh(ih(e,{startHeading:u,endHeading:s,startGlobalPoint:c,endGlobalPoint:U,hoveredEndElement:p,...m})??[])),g,null,null):(e.fixedSegments?.length??0)>g.length?bx(e,g,t):a.points?a.points&&a.fixedSegments?a:vx(e,i,g,u,s,c,U,f,p):yx(e,g,u,s,f,p)},nh=(e,t,a,n,i,l)=>{let r=As(a[0],Dt(e.x,e.y)),o=As(a[a.length-1],Dt(e.x,e.y)),d=n,u=i;if(l?.isDragging){let T=Array.from(t.values());d=ap(r,t,T,l?.zoom)||n,u=ap(o,t,T,l?.zoom)||i}let s=ep({...e,points:a},"start",e.startBinding?.fixedPoint,r,n,d,l?.isDragging),c=ep({...e,points:a},"end",e.endBinding?.fixedPoint,o,i,u,l?.isDragging),U=tp(s,c,t,d,r),f=tp(c,s,t,u,o),p=[s[0]-2,s[1]-2,s[0]+2,s[1]+2],m=[c[0]-2,c[1]-2,c[0]+2,c[1]+2],g=d?rn(d,fi(U,e.startArrowhead?He*6:He*2,1)):p,y=u?rn(u,fi(f,e.endArrowhead?He*6:He*2,1)):m,v=Ml(s,u?rn(u,fi(f,_e,_e)):m)||Ml(c,d?rn(d,fi(U,_e,_e)):p),b=Q0(v?[p,m]:[g,y]),x=xx(v?p:g,v?m:y,b,v?fi(U,!d&&!u?0:_e,0):fi(U,!d&&!u?0:_e-(e.startArrowhead?He*6:He*2),_e),v?fi(f,!d&&!u?0:_e,0):fi(f,!d&&!u?0:_e-(e.endArrowhead?He*6:He*2),_e),v,d&&rn(d),u&&rn(u)),S=J0(x[0],U,s),C=J0(x[1],f,c);return{dynamicAABBs:x,startDonglePosition:S,startGlobalPoint:s,startHeading:U,endDonglePosition:C,endGlobalPoint:c,endHeading:f,commonBounds:b,hoveredStartElement:d,hoveredEndElement:u,boundsOverlap:v,startElementBounds:g,endElementBounds:y}},ih=(e,t)=>{let{dynamicAABBs:a,startDonglePosition:n,startGlobalPoint:i,startHeading:l,endDonglePosition:r,endGlobalPoint:o,endHeading:d,commonBounds:u,hoveredEndElement:s}=t,c=Sx(a,n||i,l,r||o,d,u),U=n&&Lo(n,c),f=r&&Lo(r,c),p=Lo(o,c);p&&s&&(p.closed=!0);let m=Lo(i,c);m&&e.startBinding&&(m.closed=!0);let g=U&&f&&(Ml(U.pos,a[1])||Ml(f.pos,a[0])),y=wx(U||m,f||p,c,l||lt,d||lt,g?[]:a);if(y){let v=y.map(b=>[b.pos[0],b.pos[1]]);return U&&v.unshift(i),f&&v.push(o),v}return null},fi=(e,t,a)=>{switch(e){case aa:return[t,a,a,a];case lt:return[a,t,a,a];case It:return[a,a,t,a]}return[a,a,a,t]},wx=(e,t,a,n,i,l)=>{let r=lh(e.pos,t.pos),o=new mx(d=>d.f);for(o.push(e);o.size()>0;){let d=o.pop();if(!d||d.closed)continue;if(d===t)return Ex(e,d);d.closed=!0;let u=Cx(d.addr,a);for(let s=0;s<4;s++){let c=u[s];if(!c||c.closed)continue;let U=Cn(c.pos,d.pos,.5);if(Z7(...l.map(b=>Ml(U,b))))continue;let f=kx(s),p=d.parent?Wi(ie(d.pos,d.parent.pos)):n,m=xf(p);if(rt(m,f)||np(e.addr,c.addr)&&rt(f,n)||np(t.addr,c.addr)&&rt(f,i))continue;let g=p!==f,y=d.g+lh(c.pos,d.pos)+(g?Math.pow(r,3):0),v=c.visited;if(!v||y<c.g){let b=Mx(c,t,f,i);c.visited=!0,c.parent=d,c.h=lh(t.pos,c.pos)+b*Math.pow(r,2),c.g=y,c.f=c.g+c.h,v?o.rescoreElement(c):o.push(c)}}}return null},Ex=(e,t)=>{let a=t,n=[];for(;a.parent;)n.unshift(a),a=a.parent;return n.unshift(e),n},lh=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),xx=(e,t,a,n,i,l,r,o)=>{let d=r??e,u=o??t,[s,c,U,f]=n??[0,0,0,0],[p,m,g,y]=i??[0,0,0,0],v=[e[0]>t[2]?e[1]>t[3]||e[3]<t[1]?Math.min((d[0]+u[2])/2,e[0]-f):(d[0]+u[2])/2:e[0]>t[0]?e[0]-f:a[0]-f,e[1]>t[3]?e[0]>t[2]||e[2]<t[0]?Math.min((d[1]+u[3])/2,e[1]-s):(d[1]+u[3])/2:e[1]>t[1]?e[1]-s:a[1]-s,e[2]<t[0]?e[1]>t[3]||e[3]<t[1]?Math.max((d[2]+u[0])/2,e[2]+c):(d[2]+u[0])/2:e[2]<t[2]?e[2]+c:a[2]+c,e[3]<t[1]?e[0]>t[2]||e[2]<t[0]?Math.max((d[3]+u[1])/2,e[3]+U):(d[3]+u[1])/2:e[3]<t[3]?e[3]+U:a[3]+U],b=[t[0]>e[2]?t[1]>e[3]||t[3]<e[1]?Math.min((u[0]+d[2])/2,t[0]-y):(u[0]+d[2])/2:t[0]>e[0]?t[0]-y:a[0]-y,t[1]>e[3]?t[0]>e[2]||t[2]<e[0]?Math.min((u[1]+d[3])/2,t[1]-p):(u[1]+d[3])/2:t[1]>e[1]?t[1]-p:a[1]-p,t[2]<e[0]?t[1]>e[3]||t[3]<e[1]?Math.max((u[2]+d[0])/2,t[2]+m):(u[2]+d[0])/2:t[2]<e[2]?t[2]+m:a[2]+m,t[3]<e[1]?t[0]>e[2]||t[2]<e[0]?Math.max((u[3]+d[1])/2,t[3]+g):(u[3]+d[1])/2:t[3]<e[3]?t[3]+g:a[3]+g],x=Q0([v,b]);if(!l&&v[2]-v[0]+b[2]-b[0]>x[2]-x[0]+1e-11&&v[3]-v[1]+b[3]-b[1]>x[3]-x[1]+1e-11){let[S,C]=[(b[0]+b[2])/2,(b[1]+b[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let T=v[2]+(b[0]-v[2])/2,k=b[3]+(v[1]-b[3])/2;return xt(Dt(e[2]-S,e[1]-C),Dt(e[0]-S,e[3]-C))>0?[[v[0],v[1],T,v[3]],[T,b[1],b[2],b[3]]]:[[v[0],k,v[2],v[3]],[b[0],b[1],b[2],k]]}else if(e[2]<t[0]&&e[3]<t[1]){let T=v[2]+(b[0]-v[2])/2,k=v[3]+(b[1]-v[3])/2;return xt(Dt(e[0]-S,e[1]-C),Dt(e[2]-S,e[3]-C))>0?[[v[0],v[1],v[2],k],[b[0],k,b[2],b[3]]]:[[v[0],v[1],T,v[3]],[T,b[1],b[2],b[3]]]}else if(e[0]>t[2]&&e[3]<t[1]){let T=b[2]+(v[0]-b[2])/2,k=v[3]+(b[1]-v[3])/2;return xt(Dt(e[2]-S,e[1]-C),Dt(e[0]-S,e[3]-C))>0?[[T,v[1],v[2],v[3]],[b[0],b[1],T,b[3]]]:[[v[0],v[1],v[2],k],[b[0],k,b[2],b[3]]]}else if(e[0]>t[2]&&e[1]>t[3]){let T=b[2]+(v[0]-b[2])/2,k=b[3]+(v[1]-b[3])/2;return xt(Dt(e[0]-S,e[1]-C),Dt(e[2]-S,e[3]-C))>0?[[T,v[1],v[2],v[3]],[b[0],b[1],T,b[3]]]:[[v[0],k,v[2],v[3]],[b[0],b[1],b[2],k]]}}return[v,b]},Sx=(e,t,a,n,i,l)=>{let r=new Set,o=new Set;a===ta||a===lt?o.add(t[1]):r.add(t[0]),i===ta||i===lt?o.add(n[1]):r.add(n[0]),e.forEach(s=>{r.add(s[0]),r.add(s[2]),o.add(s[1]),o.add(s[3])}),r.add(l[0]),r.add(l[2]),o.add(l[1]),o.add(l[3]);let d=Array.from(o).sort((s,c)=>s-c),u=Array.from(r).sort((s,c)=>s-c);return{row:d.length,col:u.length,data:d.flatMap((s,c)=>u.map((U,f)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[f,c],pos:[U,s]})))}},J0=(e,t,a)=>{switch(t){case aa:return w(a[0],e[1]);case lt:return w(e[2],a[1]);case It:return w(a[0],e[3])}return w(e[0],a[1])},Mx=(e,t,a,n)=>{if(n===lt)switch(a){case lt:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case aa:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case It:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case ta:return e.pos[1]===t.pos[1]?4:2}else if(n===ta)switch(a){case lt:return e.pos[1]===t.pos[1]?4:2;case aa:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case It:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case ta:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(n===aa)switch(a){case lt:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case aa:return e.pos[1]>=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case It:return e.pos[0]===t.pos[0]?4:2;case ta:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(n===It)switch(a){case lt:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case aa:return e.pos[0]===t.pos[0]?4:2;case It:return e.pos[1]<=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case ta:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3}return 0},Cx=([e,t],a)=>[Nr([e,t-1],a),Nr([e+1,t],a),Nr([e,t+1],a),Nr([e-1,t],a)],Nr=([e,t],a)=>e<0||e>=a.col||t<0||t>=a.row?null:a.data[t*a.col+e]??null,Lo=(e,t)=>{for(let a=0;a<t.col;a++)for(let n=0;n<t.row;n++){let i=Nr([a,n],t);if(i&&e[0]===i.pos[0]&&e[1]===i.pos[1])return i}return null},Q0=e=>[Math.min(...e.map(t=>t[0])),Math.min(...e.map(t=>t[1])),Math.max(...e.map(t=>t[2])),Math.max(...e.map(t=>t[3]))],_l=(e,t)=>{let a=t.get(e);return a&&_a(a)?a:null},pi=(e,t,a,n)=>{let i=e[0][0],l=e[0][1],r=e.map(o=>As(o,it(ie(e[0]),-1)));return(i<-Xe||i>Xe||l<-Xe||l>Xe||i+r[r.length-1][0]<-Xe||l+r[r.length-1][0]>Xe||i+r[r.length-1][1]<-Xe||l+r[r.length-1][1]>Xe)&&console.error("Elbow arrow normalization is outside reasonable bounds (> 1e6)",{x:i,y:l,points:r,...kl(r)}),r=r.map(([o,d])=>w(we(o,-1e6,1e6),we(d,-1e6,1e6))),{points:r,x:we(i,-1e6,1e6),y:we(l,-1e6,1e6),fixedSegments:(t?.length??0)>0?t:null,...kl(r),startIsSpecial:a,endIsSpecial:n}},rh=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1])<Math.abs(e[0][0]-e[1][0]);return e.filter((a,n)=>{if(n===0||n===e.length-1)return!0;let i=e[n+1],l=Math.abs(a[1]-i[1])<Math.abs(a[0]-i[0]);return t===l?(t=l,!1):(t=l,!0)})}return e},sh=e=>e.length>=4?e.filter((t,a)=>{if(a===0||a===e.length-1)return!0;let n=e[a-1];return Te(n,t)>th}):e,kx=e=>{switch(e){case 0:return aa;case 1:return lt;case 2:return It}return ta},ep=(e,t,a,n,i,l,r)=>{if(r){if(l){let o=wr(e,l,t);return tE(l,o)}return n}if(i){let o=Pc(a||[0,0],i);return Math.abs(so(i,o)-He)>.01?wr(e,i,t):o}return n},tp=(e,t,a,n,i)=>qw(e,t,n,n&&rn(n,Array(4).fill(so(n,e))),a,i),ap=(e,t,a,n)=>$a(Na(e),a,t,n,!0,!0),np=(e,t)=>e[0]===t[0]&&e[1]===t[1],oh=(e,t=th)=>e.slice(1).map((a,n)=>Math.abs(a[0]-e[n][0])<t||Math.abs(a[1]-e[n][1])<t).every(Boolean),Ix={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1,custom:!0,frame:!0,embeddable:!0,hand:!0,laser:!1,magicframe:!1},Tx=e=>Object.keys(Ke).includes(e)?Ke[e]:ii,Ol=(e,t)=>{if(!t)return null;let a=t.focus||0;return q(e)?Ws(t)?{...t,focus:a,fixedPoint:po(t.fixedPoint??[0,0])}:null:{...t,focus:a}},mi=(e,t)=>{let a={type:t.type||e.type,version:e.version||1,versionNonce:e.versionNonce??0,index:e.index??null,isDeleted:e.isDeleted??!1,id:e.id||xa(),fillStyle:e.fillStyle||nt.fillStyle,strokeWidth:e.strokeWidth||nt.strokeWidth,strokeStyle:e.strokeStyle??nt.strokeStyle,roughness:e.roughness??nt.roughness,opacity:e.opacity==null?nt.opacity:e.opacity,angle:e.angle||0,x:t.x??e.x??0,y:t.y??e.y??0,strokeColor:e.strokeColor||nt.strokeColor,backgroundColor:e.backgroundColor||nt.backgroundColor,width:e.width||0,height:e.height||0,seed:e.seed??1,groupIds:e.groupIds??[],frameId:e.frameId??null,roundness:e.roundness?e.roundness:e.strokeSharpness==="round"?{type:wl(e.type)?Ut.LEGACY:Ut.PROPORTIONAL_RADIUS}:null,boundElements:e.boundElementIds?e.boundElementIds.map(n=>({type:"arrow",id:n})):e.boundElements??[],updated:e.updated??vl(),link:e.link?la(e.link):null,locked:e.locked??!1};return("customData"in e||"customData"in t)&&(a.customData="customData"in t?t.customData:e.customData),{...e,...a,..._p(a),...t}},Lx=e=>{switch(e={...e},e.type){case"text":delete e.rawText;let t=e.fontSize,a=e.fontFamily;if("font"in e){let[s,c]=e.font.split(" ");t=parseFloat(s),a=Tx(c)}let n=typeof e.text=="string"&&e.text||"",i=e.lineHeight||(e.height?t8(e):Hi(e.fontFamily));return e=mi(e,{fontSize:t,fontFamily:a,text:n,textAlign:e.textAlign||tr,verticalAlign:e.verticalAlign||ws,containerId:e.containerId??null,originalText:e.originalText||n,autoResize:e.autoResize??!0,lineHeight:i}),!n&&!e.isDeleted&&(e={...e,originalText:n,isDeleted:!0},e=Hr(e)),e;case"freedraw":return mi(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return mi(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1],crop:e.crop??null});case"line":case"draw":let{startArrowhead:l=null,endArrowhead:r=null}=e,o=e.x,d=e.y,u=!Array.isArray(e.points)||e.points.length<2?[w(0,0),w(e.width,e.height)]:e.points;return(u[0][0]!==0||u[0][1]!==0)&&({points:u,x:o,y:d}=Z.getNormalizedPoints(e)),mi(e,{type:e.type==="draw"?"line":e.type,startBinding:Ol(e,e.startBinding),endBinding:Ol(e,e.endBinding),lastCommittedPoint:null,startArrowhead:l,endArrowhead:r,points:u,x:o,y:d,...kl(u)});case"arrow":{let{startArrowhead:s=null,endArrowhead:c="arrow"}=e,U=e.x,f=e.y,p=!Array.isArray(e.points)||e.points.length<2?[w(0,0),w(e.width,e.height)]:e.points;(p[0][0]!==0||p[0][1]!==0)&&({points:p,x:U,y:f}=Z.getNormalizedPoints(e));let m={type:e.type,startBinding:Ol(e,e.startBinding),endBinding:Ol(e,e.endBinding),lastCommittedPoint:null,startArrowhead:s,endArrowhead:c,points:p,x:U,y:f,elbowed:e.elbowed,...kl(p)};return q(e)?mi(e,{...m,elbowed:!0,startBinding:Ol(e,e.startBinding),endBinding:Ol(e,e.endBinding),fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}):mi(e,m)}case"ellipse":case"rectangle":case"diamond":case"iframe":case"embeddable":return mi(e,{});case"magicframe":case"frame":return mi(e,{name:e.name??null})}return null},Dx=(e,t)=>{if(e.boundElements){let a=e.boundElements.slice(),n=new Set;e.boundElements=a.reduce((i,l)=>{let r=t.get(l.id);if(r&&!n.has(l.id)){if(n.add(l.id),r.isDeleted)return i;i.push(l),j(r)&&!r.containerId&&(r.containerId=e.id)}return i},[])}},Ax=(e,t)=>{let a=e.containerId?t.get(e.containerId):null;if(!a){e.containerId=null;return}if(!e.isDeleted&&a.boundElements&&!a.boundElements.find(n=>n.id===e.id)){let n=(a.boundElements||(a.boundElements=[])).slice();n.push({type:"text",id:e.id}),a.boundElements=n}},Rx=(e,t)=>{e.frameId&&(t.get(e.frameId)||(e.frameId=null))},Do=(e,t,a)=>{let n=new Set,i=t?oe(t):null,l=Un((e||[]).reduce((o,d)=>{if(d.type!=="selection"&&!qi(d)){let u=Lx(d);if(u){let s=i?.get(d.id);s&&s.version>u.version&&(u=Hr(u,s.version)),n.has(u.id)&&(u={...u,id:xa()}),n.add(u.id),o.push(u)}}return o},[]));if(!a?.repairBindings)return l;let r=oe(l);for(let o of l)o.frameId&&Rx(o,r),j(o)&&o.containerId?Ax(o,r):o.boundElements&&Dx(o,r),a.refreshDimensions&&j(o)&&Object.assign(o,U0(o,Tt(o,r),r)),he(o)&&(o.startBinding&&(!r.has(o.startBinding.elementId)||!ge(o))&&(o.startBinding=null),o.endBinding&&(!r.has(o.endBinding.elementId)||!ge(o))&&(o.endBinding=null));return l.map(o=>{if(q(o)&&o.startBinding==null&&o.endBinding==null&&!oh(o.points))return{...o,...ah(o,r,{points:[w(0,0),o.points[o.points.length-1]]}),index:o.index};if(q(o)&&o.startBinding&&o.endBinding&&o.startBinding.elementId===o.endBinding.elementId&&o.points.length>1&&o.points.some(([d,u])=>Math.abs(d)>1e6||Math.abs(u)>1e6)){console.error("Fixing self-bound elbow arrow",o.id);let d=r.get(o.startBinding.elementId);return d?{...o,x:d.x+d.width/2,y:d.y-5,width:d.width,height:d.height,points:[w(0,0),w(0,-10),w(d.width/2+5,-10),w(d.width/2+5,d.height/2+5)]}:(console.error("Bound element not found",o.startBinding.elementId),o)}return o})},Nx=(e,t,a)=>{let n=t[e];return n!==void 0?n:a[e]},ip={isSidebarDocked:(e,t)=>["defaultSidebarDockedPreference",e.isSidebarDocked??Nx("defaultSidebarDockedPreference",e,t)]},lp=(e,t)=>{e=e||{};let a=tn(),n={};for(let i of Object.keys(ip))if(i in e){let[l,r]=ip[i](e,a);n[l]=r}for(let[i,l]of Object.entries(a)){let r=e[i],o=t?t[i]:void 0;n[i]=r!==void 0?r:o!==void 0?o:l}return{...n,cursorButton:t?.cursorButton||"up",penDetected:t?.penDetected??(e.penMode?e.penDetected??!1:!1),activeTool:{...ft(a,n.activeTool.type&&Ix[n.activeTool.type]?n.activeTool:{type:"selection"}),lastActiveTool:null,locked:n.activeTool.locked??!1},zoom:{value:Bn(lr(e.zoom)?e.zoom:e.zoom?.value??a.zoom.value)},openSidebar:typeof e.openSidebar=="string"?{name:Aa.name}:n.openSidebar,gridSize:dE(lr(e.gridSize)?e.gridSize:Ss),gridStep:Vf(lr(e.gridStep)?e.gridStep:wu),editingFrame:null}},Pr=(e,t,a,n)=>({elements:Do(e?.elements,a,n),appState:lp(e?.appState,t||null),files:e?.files||{}}),rp=e=>{let t=Do(ze(e.elements),null);return t.length?{...e,elements:t}:null},_r=(e=[],t)=>{let a=[];for(let n of e)if(Array.isArray(n)){let i=rp({status:t,elements:n,id:xa(),created:Date.now()});i&&a.push(i)}else{let i=n,l=rp({...i,id:i.id||xa(),status:i.status||t,created:i.created||Date.now()});l&&a.push(l)}return a},Wa=32,We=12,gi=256,sp=50,Ki="NOT_SPREADSHEET",Or="VALID_SPREADSHEET",Br=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},dh=(e,t)=>e.slice(1).every(a=>Br(a[t])!==null),op=e=>{let t=e[0].length;if(t>2)return{type:Ki,reason:"More than 2 columns"};if(t===1){if(!dh(e,0))return{type:Ki,reason:"Value is not numeric"};let d=Br(e[0][0])===null,u=(d?e.slice(1):e).map(s=>Br(s[0]));return u.length<2?{type:Ki,reason:"Less than two rows"}:{type:Or,spreadsheet:{title:d?e[0][0]:null,labels:null,values:u}}}let a=dh(e,0),n=dh(e,1);if(!a&&!n)return{type:Ki,reason:"Value is not numeric"};let[i,l]=n?[0,1]:[1,0],r=Br(e[0][l])===null,o=r?e.slice(1):e;return o.length<2?{type:Ki,reason:"Less than 2 rows"}:{type:Or,spreadsheet:{title:r?e[0][l]:null,labels:o.map(d=>d[i]),values:o.map(d=>Br(d[l]))}}},Px=e=>{let t=[];for(let a=0;a<e[0].length;a++){let n=[];for(let i=0;i<e.length;i++)n.push(e[i][a]);t.push(n)}return t},_x=e=>{let t=e.trim().split(`
`).map(i=>i.trim().split("	"));if(t.length&&t[0].length!==2&&(t=e.trim().split(`
`).map(i=>i.trim().split(","))),t.length===0)return{type:Ki,reason:"No values"};let a=t[0].length;if(!t.every(i=>i.length===a))return{type:Ki,reason:"All rows don't have same number of columns"};let n=op(t);if(n.type!==Or){let i=op(Px(t));if(i.type===Or)return i}return n},Ao=Hg(zg),Sa={fillStyle:"hachure",fontFamily:ii,fontSize:Mn,opacity:100,roughness:1,strokeColor:ye.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:ca.MIDDLE,locked:!1},dp=e=>{let t=(Wa+We)*e.values.length+We,a=gi+We*2;return{chartWidth:t,chartHeight:a}},Ox=(e,t,a,n,i)=>e.labels?.map((l,r)=>ua({groupIds:[n],backgroundColor:i,...Sa,text:l.length>8?`${l.slice(0,5)}...`:l,x:t+r*(Wa+We)+We*2,y:a+We/2,width:Wa,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))||[],Bx=(e,t,a,n,i)=>{let l=ua({groupIds:[n],backgroundColor:i,...Sa,x:t-We,y:a-We,text:"0",textAlign:"right"}),r=ua({groupIds:[n],backgroundColor:i,...Sa,x:t-We,y:a-gi-l.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[l,r]},zx=(e,t,a,n,i)=>{let{chartWidth:l,chartHeight:r}=dp(e),o=ji({backgroundColor:i,groupIds:[n],...Sa,type:"line",x:t,y:a,width:l,points:[w(0,0),w(l,0)]}),d=ji({backgroundColor:i,groupIds:[n],...Sa,type:"line",x:t,y:a,height:r,points:[w(0,0),w(0,-r)]}),u=ji({backgroundColor:i,groupIds:[n],...Sa,type:"line",x:t,y:a-gi-We,strokeStyle:"dotted",width:l,opacity:sp,points:[w(0,0),w(l,0)]});return[o,d,u]},cp=(e,t,a,n,i,l)=>{let{chartWidth:r,chartHeight:o}=dp(e),d=e.title?ua({backgroundColor:i,groupIds:[n],...Sa,text:e.title,x:t+r/2,y:a-gi-We*2-Mn,roundness:null,textAlign:"center"}):null,u=l?hn({backgroundColor:i,groupIds:[n],...Sa,type:"rectangle",x:t,y:a-o,width:r,height:o,strokeColor:ye.black,fillStyle:"solid",opacity:6}):null;return[...u?[u]:[],...d?[d]:[],...Ox(e,t,a,n,i),...Bx(e,t,a,n,i),...zx(e,t,a,n,i)]},Fx=(e,t,a)=>{let n=Math.max(...e.values),i=xa(),l=Ao[Math.floor(Math.random()*Ao.length)];return[...e.values.map((r,o)=>{let d=r/n*gi;return hn({backgroundColor:l,groupIds:[i],...Sa,type:"rectangle",x:t+o*(Wa+We)+We,y:a-d-We,width:Wa,height:d})}),...cp(e,t,a,i,l,me.DEV)]},$x=(e,t,a)=>{let n=Math.max(...e.values),i=xa(),l=Ao[Math.floor(Math.random()*Ao.length)],r=0,o=[];for(let m of e.values){let g=r*(Wa+We),y=-(m/n)*gi;o.push([g,y]),r++}let d=Math.max(...o.map(m=>m[0])),u=Math.max(...o.map(m=>m[1])),s=Math.min(...o.map(m=>m[0])),c=Math.min(...o.map(m=>m[1])),U=ji({backgroundColor:l,groupIds:[i],...Sa,type:"line",x:t+We+Wa/2,y:a-We,height:u-c,width:d-s,strokeWidth:2,points:o}),f=e.values.map((m,g)=>{let y=g*(Wa+We)+We/2,v=-(m/n)*gi+We/2;return hn({backgroundColor:l,groupIds:[i],...Sa,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+y+Wa/2,y:a+v-We*2,width:We,height:We})}),p=e.values.map((m,g)=>{let y=g*(Wa+We)+We/2,v=m/n*gi+We/2+We;return ji({backgroundColor:l,groupIds:[i],...Sa,type:"line",x:t+y+Wa/2+We/2,y:a-v,height:v,strokeStyle:"dotted",opacity:sp,points:[w(0,0),w(0,v)]})});return[...cp(e,t,a,i,l,me.DEV),U,...p,...f]},Hx=(e,t,a,n)=>e==="line"?$x(t,a,n):Fx(t,a,n),ch="clipboard"in navigator&&"writeText"in navigator.clipboard,hh="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,Xx=e=>!!([Da.excalidraw,Da.excalidrawClipboard,Da.excalidrawClipboardWithAPI].includes(e?.type)&&Array.isArray(e.elements)),Wx=({types:e,files:t})=>{!e&&!t&&console.warn("createPasteEvent: no types or files provided");let a=new ClipboardEvent("paste",{clipboardData:new DataTransfer});if(e)for(let[n,i]of Object.entries(e)){if(typeof i!="string"){t=t||[],t.push(i);continue}try{if(a.clipboardData?.setData(n,i),a.clipboardData?.getData(n)!==i)throw new Error(`Failed to set "${n}" as clipboardData item`)}catch(l){throw new Error(l.message)}}if(t){let n=-1;for(let i of t){n++;try{if(a.clipboardData?.items.add(i),a.clipboardData?.files[n]!==i)throw new Error(`Failed to set file "${i.name}" as clipboardData item`)}catch(l){throw new Error(l.message)}}}return a},Gx=({elements:e,files:t})=>{let a=oe(e),n=new Set(e.filter(o=>de(o))),i=!1,l=e.reduce((o,d)=>(ba(d)&&(i=!0,t&&t[d.fileId]&&(o[d.fileId]=t[d.fileId])),o),{});i&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let r={type:Da.excalidrawClipboard,elements:e.map(o=>{if(ra(o,a)&&!n.has(ra(o,a))){let d=Zi(o);return F(d,{frameId:null}),d}return o}),files:t?l:void 0};return JSON.stringify(r)},hp=async(e,t,a)=>{await Bl(Gx({elements:e,files:t}),a)},Vx=e=>{let t=_x(e);return t.type===Or?{spreadsheet:t.spreadsheet}:null};function up(e){let t=[];for(let a of e.childNodes)if(a.nodeType===3){let n=a.textContent?.trim();n&&t.push({type:"text",value:n})}else if(a instanceof HTMLImageElement){let n=a.getAttribute("src");n&&n.startsWith("http")&&t.push({type:"imageUrl",value:n})}else t=t.concat(up(a));return t}var Yx=e=>{let t=e.clipboardData?.getData(ne.html);if(!t)return null;try{let a=new DOMParser().parseFromString(t,ne.html),n=up(a.body);if(n.length)return{type:"mixedContent",value:n}}catch(a){console.error(`error in parseHTMLFromPaste: ${a.message}`)}return null},jx=async()=>{let e={},t;try{t=await navigator.clipboard?.read()}catch(a){try{if(navigator.clipboard?.readText){console.warn(`navigator.clipboard.readText() failed (${a.message}). Failling back to navigator.clipboard.read()`);let n=await navigator.clipboard?.readText();if(n)return{[ne.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 a}for(let a of t)for(let n of a.types)if(Zu(t7,n))try{if(n===ne.text||n===ne.html)e[n]=await(await a.getType(n)).text();else if(e2(n)){let i=await a.getType(n),l=Vr(i,n,void 0);e[n]=l}else throw new VU(`Unsupported clipboard type: ${n}`)}catch(i){console.warn(i instanceof VU?i.message:`Cannot retrieve ${n} from clipboardItem: ${i.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},Zx=async(e,t=!1)=>{try{let a=!t&&e&&Yx(e);return a?a.value.every(n=>n.type==="text")?{type:"text",value:e.clipboardData?.getData(ne.text)||a.value.map(n=>n.value).join(`
`).trim()}:a:{type:"text",value:(e.clipboardData?.getData(ne.text)||"").trim()}}catch{return{type:"text",value:""}}},Up=async(e,t=!1)=>{let a=await Zx(e,t);if(a.type==="mixedContent")return{mixedContent:a.value};try{let n=!t&&Vx(a.value);if(n)return n}catch(n){console.error(n)}try{let n=JSON.parse(a.value),i=n.type===Da.excalidrawClipboardWithAPI;if(Xx(n))return{elements:n.elements,files:n.files,text:t?JSON.stringify(n.elements,null,2):void 0,programmaticAPI:i}}catch{}return{text:a.value}},fp=async e=>{try{await navigator.clipboard.write([new window.ClipboardItem({[ne.png]:e})])}catch(t){if(ur(e))await navigator.clipboard.write([new window.ClipboardItem({[ne.png]:await e})]);else throw t}},Bl=async(e,t)=>{if(ch)try{await navigator.clipboard.writeText(e||"");return}catch(a){console.error(a)}try{if(t){if(t.clipboardData?.setData(ne.text,e||""),t.clipboardData?.getData(ne.text)!==e)throw new Error("Failed to setData on clipboardEvent");return}}catch(a){console.error(a)}if(!Kx(e))throw new Error("Error copying to clipboard.")},Kx=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",a=document.createElement("textarea");a.style.border="0",a.style.padding="0",a.style.margin="0",a.style.position="absolute",a.style[t?"right":"left"]="-9999px";let n=window.pageYOffset||document.documentElement.scrollTop;a.style.top=`${n}px`,a.style.fontSize="12pt",a.setAttribute("readonly",""),a.value=e,document.body.appendChild(a);let i=!1;try{a.select(),a.setSelectionRange(0,a.value.length),i=document.execCommand("copy")}catch(l){console.error(l)}return a.remove(),i},zr=({elements:e,appState:t,files:a,maxWidthOrHeight:n,getDimensions:i,exportPadding:l,exportingFrame:r})=>{let{elements:o,appState:d}=Pr({elements:e,appState:t},null,null),{exportBackground:u,viewBackgroundColor:s}=d;return q0(o,{...d,offsetTop:0,offsetLeft:0,width:0,height:0},a||{},{exportBackground:u,exportPadding:l,viewBackgroundColor:s,exportingFrame:r},(c,U)=>{let f=document.createElement("canvas");if(n){typeof i=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let m=Math.max(c,U),g=n<m?n/m:t?.exportScale??1;return f.width=c*g,f.height=U*g,{canvas:f,scale:g}}let p=i?.(c,U)||{width:c,height:U};return f.width=p.width,f.height=p.height,{canvas:f,scale:p.scale??1}})},pp=async e=>{let{mimeType:t=ne.png,quality:a}=e;t===ne.png&&typeof a=="number"&&console.warn(`"quality" will be ignored for "${ne.png}" mimeType`),t==="image/jpg"&&(t=ne.jpg),t===ne.jpg&&!e.appState?.exportBackground&&(console.warn(`Defaulting "exportBackground" to "true" for "${ne.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let n=await zr(e);return a=a||(/image\/jpe?g/.test(t)?.92:.8),new Promise((i,l)=>{n.toBlob(async r=>{if(!r)return l(new Error("couldn't export to blob"));r&&t===ne.png&&e.appState?.exportEmbedScene&&(r=await zS({blob:r,metadata:Ar(e.elements,e.appState,e.files||{},"local")})),i(r)},t,a)})},Ro=async({elements:e,appState:t=tn(),files:a={},exportPadding:n,renderEmbeddables:i,exportingFrame:l,skipInliningFonts:r,reuseImages:o})=>{let{elements:d,appState:u}=Pr({elements:e,appState:t},null,null),s={...u,exportPadding:n};return Qc(d,s,a,{exportingFrame:l,renderEmbeddables:i,skipInliningFonts:r,reuseImages:o})},qx=async e=>{if(e.type==="svg"){let t=await Ro(e);await Bl(t.outerHTML)}else if(e.type==="png")await fp(pp(e));else if(e.type==="json")await hp(e.elements,e.files);else throw new Error("Invalid export type")},Jx=e=>e.type==="diamond"?[w(e.width/2,0),w(e.width,e.height/2),w(e.width/2,e.height),w(0,e.height/2)]:[w(0,0),w(0+e.width,0),w(0+e.width,e.height),w(0,e.height)],Qx=e=>he(e)||va(e)?e.points:Jx(e),mp=e=>{let t=e.reduce((a,[n,i])=>(a.minY=Math.min(a.minY,i),a.minX=Math.min(a.minX,n),a.maxX=Math.max(a.maxX,n),a.maxY=Math.max(a.maxY,i),a),{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},gp=e=>{let t=Qx(e),{cx:a,cy:n}=mp(t),i=w(a,n),l=t.map(s=>O(s,i,e.angle)),{minX:r,minY:o,maxX:d,maxY:u}=mp(l);return[r+e.x,o+e.y,d+e.x,u+e.y]},uh=(e,t,a=!1)=>{let n=gp(e),i=t[0]<=n[0]&&t[2]>=n[2]&&t[1]<=n[1]&&t[3]>=n[3];return a?i?!0:n[0]<=t[0]&&n[2]>=t[2]&&n[1]<=t[1]&&n[3]>=t[3]:i},bp=(e,t)=>{let a=gp(e);return(_s(a[0],_t(t[0],t[2]))||_s(t[0],_t(a[0],a[2])))&&(_s(a[1],_t(t[1],t[3]))||_s(t[1],_t(a[1],a[3])))},yp=({elements:e,bounds:t,type:a,errorMargin:n=0})=>{tU(t)&&(t=za(t,oe(e)));let i=[t[0]-n,t[1]-n,t[2]+n,t[3]+n],l=new Set;for(let r of e)if(!l.has(r.id)&&(a==="overlap"?bp(r,i):a==="inside"?uh(r,i):uh(r,i,!0))){if(l.add(r.id),r.boundElements)for(let o of r.boundElements)l.add(o.id);j(r)&&r.containerId&&l.add(r.containerId),ge(r)&&(r.startBinding&&l.add(r.startBinding.elementId),r.endBinding&&l.add(r.endBinding?.elementId))}return e.filter(r=>l.has(r.id))};function vp(e){return[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])]}function eS(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}var tS=1e-6;function wp(e,t){let a=ie(e[1],e[0]),n=ie(t,e[0]),i=xt(a,n);return Math.abs(i)<tS}function Uh(e,t){let a=ie(e[1],e[0]),n=ie(t,e[0]);return xt(a,n)<0}function Ep(e,t){return wp(e,t[0])||wp(e,t[1])||(Uh(e,t[0])?!Uh(e,t[1]):Uh(e,t[1]))}function aS(e,t){return eS(vp(e),vp(t))&&Ep(e,t)&&Ep(t,e)}var xp=(e,t,a)=>{let n=oe(e);for(let i of t)if(i.frameId){let l=a.get(i.id),r=a.get(i.frameId);if(l){let o=n.get(l);o&&F(o,{frameId:r??i.frameId},!1)}}};function fh(e,t,a){let n=If(t,a),i=If(e,a);return n.some(l=>i.some(r=>aS(l,r)))}var Sp=(e,t,a)=>_o(wh(e,t,a,!1)).filter(n=>!de(n)&&!n.frameId||n.frameId===t.id),ph=(e,t,a)=>wh([t],e,a).some(n=>n.id===t.id),Fr=(e,t,a)=>{let[n,i,l,r]=Ue(t,a),[o,d,u,s]=De(e);return n<=o&&i<=d&&l>=u&&r>=s},bi=(e,t,a)=>Fr([e],t,a)||fh(e,t,a)||ph(e,t,a),Mp=(e,t,a)=>{let[n,i,l,r]=Ue(t,a);return Ru(w(n,i),w(e.x,e.y),w(l,r))},nS=e=>{let t=new Map;for(let a of e){let n=de(a)?a.id:a.frameId;n&&!t.has(n)&&t.set(n,mn(e,n))}return t},mn=(e,t)=>{let a=[];for(let n of e.values())n.frameId===t&&a.push(n);return a},mh=e=>e.filter(t=>de(t)),gh=e=>{let t=oe(mh(e));return e.filter(a=>t.has(a.id)||!a.frameId||!t.has(a.frameId))},No=(e,t,a,n)=>{let i=mn(e,t.id),l=new Set(i),r=new Set([...Sp(e,t,n),...i.filter(U=>ph(U,t,n))]),o=i.filter(U=>!r.has(U)),d=new Set(Array.from(r).flatMap(U=>U.groupIds));for(let U of o)if(!fh(U,t,n))U.groupIds.length===0&&l.delete(U);else if(U.groupIds.length>0)for(let f of U.groupIds)d.add(f);for(let U of o)if(U.groupIds.length>0){let f=!0;for(let p of U.groupIds)d.has(p)&&(f=!1);f&&l.delete(U)}let u=Array.from(r).filter(U=>U.groupIds.length===0);for(let U of u)l.add(U);let s=Array.from(r).filter(U=>U.groupIds.length>0),c=Kf(s,a);for(let[U,f]of Object.entries(c))if(f){let p=je(e,U);if(Fr(p,t,n))for(let m of p)l.add(m)}return[...l].filter(U=>!(j(U)&&U.containerId))},iS=(e,t,a)=>lS(_o(e,Sp(e,t,a)),t,a),lS=(e,t,a)=>{let n=[],i=new Map;for(let l of e){let r=!1;if(l.groupIds.length>0){if(l.groupIds.some(o=>i.get(o)))r=!0;else{let o=new Set(l.groupIds.flatMap(d=>je(a,d)));r=!Fr(Array.from(o),t,a)}l.groupIds.forEach(o=>{i.set(o,r)})}r||n.push(l)}return n},ra=(e,t)=>e.frameId&&t.get(e.frameId)||null,rS=(e,t)=>{let a=new Set,n=oe(e);e=_o(e);for(let r of e)de(r)&&r.id!==t.id&&a.add(r.id);let i=new Set,l=[];for(let r of e)if(!(de(r)||r.frameId&&a.has(r.frameId)))if(r.groupIds.length){let o=r.groupIds.at(-1);if(!i.has(o)){i.add(o);let d=je(e,o);if(d.some(u=>bi(u,t,n)))for(let u of d)l.push(u)}}else bi(r,t,n)&&l.push(r);return l},$r=(e,t,a,n)=>{let i=oe(e),l=new Map;for(let u of e.values())u.frameId===a.id&&l.set(u.id,!0);let r=new Set(t.map(u=>u.id)),o=[],d=new Set;for(let u of t)de(u)&&u.id!==a.id&&d.add(u.id);for(let u of _o(e,t)){if(de(u)||u.frameId&&d.has(u.frameId)||u.frameId&&n.selectedElementIds[u.id]&&n.selectedElementIds[u.frameId])continue;l.has(u.id)||o.push(u);let s=pe(u,i);s&&!r.has(s.id)&&!l.has(s.id)&&o.push(s)}for(let u of o)F(u,{frameId:a.id},!1);return e},Po=(e,t)=>{let a=new Map,n=new Map;for(let i of e)if(i.frameId){a.set(i.id,i);let l=n.get(i.frameId)||[];l.push(i);let r=pe(i,t);r&&(a.set(r.id,r),l.push(r)),n.set(i.frameId,l)}for(let[,i]of a)F(i,{frameId:null},!1)},Cp=(e,t)=>{let a=mn(e,t.id);return Po(a,oe(e)),e},kp=(e,t,a,n)=>$r(Cp(e,a),t,a,n.state).slice(),zl=(e,t,a)=>{let n=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),i=new Set(n);if(t.editingGroupId)for(let o of n)o.groupIds.length===0?i.add(o):o.groupIds.flatMap(d=>je(e,d)).forEach(d=>i.add(d));let l=new Set,r=oe(e);return i.forEach(o=>{o.frameId&&!de(o)&&!Oo(o,r,t)&&l.add(o)}),l.size>0&&Po(l,r),e},_o=(e,t)=>{let a=new Set,n=t||e;for(let r of n.values()){let o=r.groupIds[r.groupIds.length-1];o&&a.add(o)}let i=new Set;for(let r of a)je(e,r).some(o=>de(o))&&i.add(r);let l=[];for(let r of n.values())i.has(r.groupIds[r.groupIds.length-1])||l.push(r);return l},bh=(e,t,a)=>{let n=j(e)&&Tt(e,t)||e;return n.frameId&&a.selectedElementIds[n.id]&&a.selectedElementIds[n.frameId]?ra(n,t):a.selectedElementIds[n.id]&&a.selectedElementsAreBeingDragged?a.frameToHighlight:ra(n,t)},Oo=(e,t,a,n)=>{let i=n?.targetFrame??bh(e,t,a);if(!i)return!1;let l=j(e)&&Tt(e,t)||e,r=d=>{n?.checkedGroups&&l.groupIds.forEach(u=>{n.checkedGroups?.set(u,d)})};if(!a.selectedElementIds[l.id]||!a.selectedElementsAreBeingDragged||a.selectedElementIds[l.id]&&a.selectedElementIds[i.id])return!0;if(l.groupIds.length===0)return bi(l,i,t);for(let d of l.groupIds)if(n?.checkedGroups?.has(d))return n.checkedGroups.get(d);let o=new Set(l.groupIds.filter(d=>n?.checkedGroups?!n.checkedGroups.has(d):!0).flatMap(d=>je(t,d)));if(a.editingGroupId&&a.selectedElementsAreBeingDragged){let d=new Set(be(t,a));if(a.frameToHighlight!==null)return!0;d.forEach(u=>{o.delete(u)})}for(let d of o)if(de(d))return r(!1),!1;for(let d of o)if(bi(d,i,t))return r(!0),!0;return!1},Ip=(e,t,a,n,i)=>{if(!a.frameRendering||!a.frameRendering.clip)return!1;let l=fh(e,t,n)||ph(e,t,n);if(l){for(let r of e.groupIds)i?.set(r,!0);return!0}if(!l&&e.groupIds.length>0&&!Fr([e],t,n)){let r=!1;if(a.selectedElementsAreBeingDragged)r=Oo(e,n,a,{targetFrame:t,checkedGroups:i});else{r=e.frameId===t.id;for(let o of e.groupIds)i?.set(o,r)}for(let o of e.groupIds)i?.set(o,r);return r}return!1},Tp=e=>e.name===null?Qu(e)?"Frame":"AI Frame":e.name,yh=(e,t)=>yp({elements:e,bounds:t,type:"overlap"}).filter(a=>!a.frameId||a.frameId===t.id),Lp=e=>{let t=oe(e);return e.length>1&&e.some(a=>a.frameId&&t.has(a.frameId))},vh=e=>{let t=new Set;return e.forEach(a=>{de(a)&&t.add(a.id)}),e.filter(a=>!(a.frameId&&t.has(a.frameId)))},wh=(e,t,a,n=!0)=>{let[i,l,r,o]=Ue(t,a),d=e.filter(u=>{let[s,c,U,f]=za(u,a),p=ra(u,a);if(p){let[m,g,y,v]=za(p,a);s=Math.max(m,s),c=Math.max(g,c),U=Math.min(y,U),f=Math.min(v,f)}return u.locked===!1&&u.type!=="selection"&&!Ye(u)&&i<=s&&l<=c&&r>=U&&o>=f});return d=n?vh(d):d,d=d.filter(u=>{let s=ra(u,a);return s?bi(u,s,a):!0}),d},Dp=(e,t,a,n)=>{let i=new Set(t.map(l=>l.id));return e.filter(l=>{let r=Bo(l,a.width,a.height,a,n);return!i.has(l.id)&&r})},yt=(function(){let e=null,t=null,a=null,n=(i,l)=>(a!=null&&i===e&&l.selectedElementIds===t||(a=i.some(r=>l.selectedElementIds[r.id]),e=i,t=l.selectedElementIds),a);return n.clearCache=()=>{e=null,t=null,a=null},n})(),sS=(e,t,a)=>{let n=Array.from(new Set(be(e,t).map(i=>a(i))));return n.length===1?n[0]:null},be=(e,t,a)=>{let n=new Set,i=[];for(let l of e.values()){if(t.selectedElementIds[l.id]){i.push(l),n.add(l.id);continue}if(a?.includeBoundTextElement&&Ye(l)&&t.selectedElementIds[l?.containerId]){i.push(l),n.add(l.id);continue}}if(a?.includeElementsInFrames){let l=[];return i.forEach(r=>{de(r)&&mn(e,r.id).forEach(o=>!n.has(o.id)&&l.push(o)),l.push(r)}),l}return i},Ap=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:be(e,t,{includeBoundTextElement:!0}),Ae=(e,t)=>At(t.selectedElementIds,e)?t.selectedElementIds:e,Rp=e=>{let t=new Map,a=[];for(let n of e)n.isDeleted||(a.push(n),t.set(n.id,n));return{elementsMap:t,elements:a}},oS=Kl(e=>{(me.DEV||me.MODE===Qt.TEST||window?.DEBUG_FRACTIONAL_INDICES)&&Xc(e,{shouldThrow:me.DEV||me.MODE===Qt.TEST,includeBoundTextValidation:!0})},1e3*60,{leading:!0,trailing:!1}),dS=e=>{let t=["includeBoundTextElement","includeElementsInFrames"],a="";for(let n of t)a+=`${n}:${e[n]?"1":"0"}`;return a},Np=e=>typeof e=="string",Eh=class Ed{constructor(){I(this,"callbacks",new Set),I(this,"nonDeletedElements",[]),I(this,"nonDeletedElementsMap",ga(new Map)),I(this,"elements",[]),I(this,"nonDeletedFramesLikes",[]),I(this,"frames",[]),I(this,"elementsMap",ga(new Map)),I(this,"selectedElementsCache",{selectedElementIds:null,elements:null,cache:new Map}),I(this,"sceneNonce"),I(this,"insertElement",t=>{let a=t.frameId?this.getElementIndex(t.frameId):this.elements.length;this.insertElementAtIndex(t,a)}),I(this,"insertElements",t=>{if(!t.length)return;let a=t[0]?.frameId?this.getElementIndex(t[0].frameId):this.elements.length;this.insertElementsAtIndex(t,a)}),I(this,"getContainerElement",t=>t&&t.containerId&&this.getElement(t.containerId)||null),I(this,"getElementsFromId",t=>{let a=this.getNonDeletedElementsMap(),n=a.get(t);return n?[n]:je(a,t)})}static mapElementToScene(t,a){Np(t)?this.sceneMapById.set(t,a):(this.sceneMapByElement.set(t,a),this.sceneMapById.set(t.id,a))}static getScene(t){return Np(t)?this.sceneMapById.get(t)||null:this.sceneMapByElement.get(t)||null}getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}getSelectedElements(t){let a=dS(t),n=t?.elements||this.nonDeletedElements;if(this.selectedElementsCache.elements===n&&this.selectedElementsCache.selectedElementIds===t.selectedElementIds){let l=this.selectedElementsCache.cache.get(a);if(l)return l}else t?.elements==null&&this.selectedElementsCache.cache.clear();let i=be(n,{selectedElementIds:t.selectedElementIds},t);return t?.elements==null&&(this.selectedElementsCache.selectedElementIds=t.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(a,i)),i}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(t){return this.elementsMap.get(t)||null}getNonDeletedElement(t){let a=this.getElement(t);return a&&Rh(a)?a:null}mapElements(t){let a=!1,n=this.elements.map(i=>{let l=t(i);return l!==i&&(a=!0),l});return a&&this.replaceAllElements(n),a}replaceAllElements(t){let a=t instanceof Array?t:Array.from(t.values()),n=[];oS(a),this.elements=Un(a),this.elementsMap.clear(),this.elements.forEach(l=>{de(l)&&n.push(l),this.elementsMap.set(l.id,l),Ed.mapElementToScene(l,this)});let i=Rp(this.elements);this.nonDeletedElements=i.elements,this.nonDeletedElementsMap=i.elementsMap,this.frames=n,this.nonDeletedFramesLikes=Rp(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=cn();for(let t of Array.from(this.callbacks))t()}onUpdate(t){if(this.callbacks.has(t))throw new Error;return this.callbacks.add(t),()=>{if(!this.callbacks.has(t))throw new Error;this.callbacks.delete(t)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),Ed.sceneMapById.forEach((t,a)=>{t===this&&Ed.sceneMapById.delete(a)}),this.callbacks.clear()}insertElementAtIndex(t,a){if(!Number.isFinite(a)||a<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let n=[...this.elements.slice(0,a),t,...this.elements.slice(a)];un(n,oe([t])),this.replaceAllElements(n)}insertElementsAtIndex(t,a){if(!t.length)return;if(!Number.isFinite(a)||a<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let n=[...this.elements.slice(0,a),...t,...this.elements.slice(a)];un(n,oe(t)),this.replaceAllElements(n)}getElementIndex(t){return this.elements.findIndex(a=>a.id===t)}};I(Eh,"sceneMapByElement",new WeakMap),I(Eh,"sceneMapById",new Map);var cS=Eh,Hn=cS,F=(e,t,a=!0,n)=>{let i=!1,{points:l,fixedSegments:r,fileId:o,startBinding:d,endBinding:u}=t;if(q(e)&&(Object.keys(t).length===0||typeof l<"u"||typeof r<"u"||typeof d<"u"||typeof u<"u")){let s=ga(Hn.getScene(e)?.getNonDeletedElementsMap()??new Map);t={...t,angle:0,...ah({...e,x:t.x||e.x,y:t.y||e.y},s,{fixedSegments:r,points:l,startBinding:d,endBinding:u},{isDragging:n?.isDragging})}}else typeof l<"u"&&(t={...kl(l),...t});for(let s in t){let c=t[s];if(typeof c<"u"){if(e[s]===c&&(typeof c!="object"||c===null||s==="groupIds"||s==="scale"))continue;if(s==="scale"){let U=e[s],f=c;if(U[0]===f[0]&&U[1]===f[1])continue}else if(s==="points"){let U=e[s],f=c;if(U.length===f.length){let p=!1,m=U.length;for(;--m;){let g=U[m],y=f[m];if(g[0]!==y[0]||g[1]!==y[1]){p=!0;break}}if(!p)continue}}e[s]=c,i=!0}}return i&&((typeof t.height<"u"||typeof t.width<"u"||typeof o<"u"||typeof l<"u")&&Qe.delete(e),e.version++,e.versionNonce=cn(),e.updated=vl(),a&&Hn.getScene(e)?.triggerUpdate()),e},fe=(e,t,a=!1)=>{let n=!1;for(let i in t){let l=t[i];if(typeof l<"u"){if(e[i]===l&&(typeof l!="object"||l===null))continue;n=!0}}return!n&&!a?e:{...e,...t,updated:vl(),version:e.version+1,versionNonce:cn()}},Hr=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=cn(),e.updated=vl(),e),qi=e=>he(e)||va(e)?e.points.length<2:e.width===0&&e.height===0,Bo=(e,t,a,n,i)=>{let[l,r,o,d]=za(e,i),u=$e({clientX:n.offsetLeft,clientY:n.offsetTop},n),s=$e({clientX:n.offsetLeft+t,clientY:n.offsetTop+a},n);return u.x<=o&&u.y<=d&&s.x>=l&&s.y>=r},zo=(e,t,a,n,i,l)=>{let[r,o,d,u]=De(e,i),s=$e({clientX:n.offsetLeft+(l?.left||0),clientY:n.offsetTop+(l?.top||0)},n),c=$e({clientX:n.offsetLeft+t-(l?.right||0),clientY:n.offsetTop+a-(l?.bottom||0)},n);return r>=s.x&&o>=s.y&&d<=c.x&&u<=c.y},Pp=(e,t,a)=>{let n=Math.abs(t),i=Math.abs(a);if(e==="line"||e==="arrow"||e==="freedraw"){let l=Math.round(Math.atan(i/n)/ai)*ai;l===0?a=0:l===Math.PI/2?t=0:a=n*Math.tan(l)*Math.sign(a)||a}else e!=="selection"&&(a=n*Math.sign(a));return{width:t,height:a}},xh=(e,t,a,n)=>{let i=a-e,l=n-t,r=Math.round(Math.atan(l/i)/ai)*ai;if(r===0)l=0;else if(r===Math.PI/2)i=0;else{let o=Math.tan(r),d=-1,u=t-o*e,s=-1/o,c=-1,U=n-s*a,f=(d*U-c*u)/(o*c-s*d),p=(u*s-U*o)/(o*c-s*d);i=f-e,l=p-t}return{width:i,height:l}},_p=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let a=Math.abs(e.width);t.width=a,t.x=e.x-a}if(e.height<0){let a=Math.abs(e.height);t.height=a,t.y=e.y-a}return t},Op={mouse:8,pen:16,touch:28},hS=16,Bp={e:!0,s:!0,n:!0,w:!0},zp={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},Sh={e:!0,s:!0,n:!0,w:!0},Xn=(e,t,a,n,i,l,r)=>{let[o,d]=O(w(e+a/2,t+n/2),w(i,l),r);return[o-a/2,d-n/2,a,n]},Mh=e=>!(e.viewport.isMobile||e.isTouchScreen&&(Wg||gu)),Xr=e=>Mh(e)?Bp:{},Ch=([e,t,a,n,i,l],r,o,d,u={},s=4,c=ki)=>{let U=Op[d],f=U/o.value,p=U/o.value,m=U/o.value,g=U/o.value,y=a-e,v=n-t,b=s/o.value,x=(U-c*2)/(2*o.value),S={nw:u.nw?void 0:Xn(e-b-m+x,t-b-g+x,f,p,i,l,r),ne:u.ne?void 0:Xn(a+b-x,t-b-g+x,f,p,i,l,r),sw:u.sw?void 0:Xn(e-b-m+x,n+b-x,f,p,i,l,r),se:u.se?void 0:Xn(a+b-x,n+b-x,f,p,i,l,r),rotation:u.rotation?void 0:Xn(e+y/2-f/2,t-b-g+x-hS/o.value,f,p,i,l,r)},C=5*Op.mouse/o.value;return Math.abs(y)>C&&(u.n||(S.n=Xn(e+y/2-f/2,t-b-g+x,f,p,i,l,r)),u.s||(S.s=Xn(e+y/2-f/2,n+b-x,f,p,i,l,r))),Math.abs(v)>C&&(u.w||(S.w=Xn(e-b-m+x,t+v/2-p/2,f,p,i,l,r)),u.e||(S.e=Xn(a+b-x,t+v/2-p/2,f,p,i,l,r))),S},Fp=(e,t,a,n="mouse",i=Bp)=>{if(e.locked||q(e))return{};if(e.type==="freedraw"||he(e)){if(e.points.length===2){let[,r]=e.points;r[0]===0||r[1]===0?i=Sh:r[0]>0&&r[1]<0?i=zp:r[0]>0&&r[1]>0?i=Sh:r[0]<0&&r[1]>0?i=zp:r[0]<0&&r[1]<0&&(i=Sh)}}else de(e)&&(i={...i,rotation:!0});let l=he(e)?ki+8:Le(e)?0:ki;return Ch(Ue(e,a,!0),e.angle,t,n,i,l,Le(e)?0:void 0)},$p=(e,t)=>{if(t.editingLinearElement)return!1;if(e.length>1)return!0;let a=e[0];return q(a)?!1:he(a)?a.points.length>2:!0},kh=(e,t,a)=>t>=e[0]&&t<=e[0]+e[2]&&a>=e[1]&&a<=e[1]+e[3],uS=(e,t,a,n,i,l,r,o)=>{if(!a.selectedElementIds[e.id])return!1;let{rotation:d,...u}=Fp(e,l,t,r,Xr(o));if(d&&kh(d,n,i))return"rotation";let s=Object.keys(u).filter(c=>{let U=u[c];return U?kh(U,n,i):!1});if(s.length>0)return s[0];if(Mh(o)){let[c,U,f,p,m,g]=Ue(e,t);if(!(he(e)&&e.points.length<=2)){let y=Le(e)?0:Es/l.value,v=Es/l.value,b=Gp(w(c-y,U-y),w(f+y,p+y),w(m,g),e.angle);for(let[x,S]of Object.entries(b))if(Ti(w(n,i),S,v))return x}}return!1},Hp=(e,t,a,n,i,l,r,o)=>e.reduce((d,u)=>{if(d)return d;let s=uS(u,r,t,a,n,i,l,o);return s?{element:u,transformHandleType:s}:null},null),Xp=([e,t,a,n],i,l,r,o,d)=>{let u=Ch([e,t,a,n,(e+a)/2,(t+n)/2],0,r,o,Xr(d)),s=Object.keys(u).find(c=>{let U=u[c];return U&&kh(U,i,l)});if(s)return s;if(Mh(d)){let c=(e+a)/2,U=(t+n)/2,f=Es/r.value,p=Gp(w(e-f,t-f),w(a+f,n+f),w(c,U),0);for(let[m,g]of Object.entries(p))if(Ti(w(i,l),g,f))return m}return!1},Ih=["ns","nesw","ew","nwse"],US=(e,t)=>{let a=Ih.indexOf(e);if(a>=0){let n=Math.round(t/(Math.PI/4));e=Ih[(a+n)%Ih.length]}return e},Wp=e=>{let{element:t,transformHandleType:a}=e,n=t&&Math.sign(t.height)*Math.sign(t.width)===-1,i=null;switch(a){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":n?i="nesw":i="nwse";break;case"ne":case"sw":n?i="nwse":i="nesw";break;case"rotation":return"grab"}return i&&t&&(i=US(i,t.angle)),i?`${i}-resize`:""},Gp=([e,t],[a,n],i,l)=>{let r=O(w(e,t),i,l),o=O(w(a,t),i,l),d=O(w(e,n),i,l),u=O(w(a,n),i,l);return{n:[r,o],e:[o,u],s:[u,d],w:[d,r]}},fS=(e,t,a,n,i,l,r,o,d,u,s,c)=>{if(a.length===1){let[U]=a;if(t==="rotation")q(U)||(pS(U,n,i,d,u,l),na(U,n));else{if(j(U)&&t)return mS(e,U,n,t,r,d,u),na(U,n),!0;if(t){let f=a[0].id,p=n.get(f),m=e.get(f);if(p&&m){let{nextWidth:g,nextHeight:y}=ES(p,m,n,e,t,d,u,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:r});Wr(g,y,p,m,n,e,t,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:r})}}}return!0}else if(a.length>1){if(t==="rotation")return gS(e,a,n,i,d,u,l,s,c),!0;if(t){let{nextWidth:U,nextHeight:f,flipByX:p,flipByY:m,originalBoundingBox:g}=xS(a,e,n,t,d,u,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:r});return Vp(a,n,t,i,e,{shouldResizeFromCenter:r,shouldMaintainAspectRatio:o,flipByX:p,flipByY:m,nextWidth:U,nextHeight:f,originalBoundingBox:g}),!0}}return!1},pS=(e,t,a,n,i,l)=>{let[r,o,d,u]=Ue(e,t),s=(r+d)/2,c=(o+u)/2,U;de(e)?U=0:(U=5*Math.PI/2+Math.atan2(i-c,n-s),l&&(U=U+ai/2,U=U-U%ai),U=Ls(U));let f=Fn(e);if(F(e,{angle:U}),f){let p=a.getElement(f);p&&!ge(e)&&F(p,{angle:U})}},Th=(e,t,a,n)=>he(e)||va(e)?{points:lo(0,t,lo(1,a,e.points,n),n)}:{},Lh=(e,t,a)=>{let n=e.width;if(Ye(e)){let l=Tt(e,t);l&&(n=$n(l,e))}let i=e.fontSize*(a/n);return i<Td?null:{size:i}},mS=(e,t,a,n,i,l,r)=>{let[o,d,u,s,c,U]=Ue(t,a),[f,p]=O(w(l,r),w(c,U),-t.angle),m=0,g=0;n!=="e"&&n!=="w"&&(n.includes("e")&&(m=(f-o)/(u-o)),n.includes("w")&&(m=(u-f)/(u-o)),n.includes("n")&&(g=(s-p)/(s-d)),n.includes("s")&&(g=(p-d)/(s-d)));let y=Math.max(m,g);if(y>0){let v=t.width*y,b=t.height*y,x=Lh(t,a,v);if(x===null)return;let S=[o,d],C=[u,s],T=[c,U],k=w(o,d);if(["n","w","nw"].includes(n)&&(k=w(C[0]-Math.abs(v),C[1]-Math.abs(b))),n==="ne"){let _=[S[0],C[1]];k=w(_[0],_[1]-Math.abs(b))}if(n==="sw"){let _=[C[0],S[1]];k=w(_[0]-Math.abs(v),_[1])}["s","n"].includes(n)&&(k[0]=T[0]-v/2),["e","w"].includes(n)&&(k[1]=T[1]-b/2),i&&(k[0]=T[0]-Math.abs(v)/2,k[1]=T[1]-Math.abs(b)/2);let R=t.angle,D=O(k,w(c,U),R),A=w(k[0]+Math.abs(v)/2,k[1]+Math.abs(b)/2),P=O(A,w(c,U),R);k=O(D,P,-R);let[$,X]=k;F(t,{fontSize:x.size,width:v,height:b,x:$,y:X})}if(n==="e"||n==="w"){let v=e.get(t.id),[b,x,S,C]=ci(v,v.width,v.height,!0),T=w(b,x),k=w(S,C),R=sr(T,k),D=O(w(l,r),R,-v.angle),[A,,P]=ci(t,t.width,t.height,!0),$=P-A,X=k[0]-T[0],_=jd(Oe({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),H=X/$;n.includes("e")&&(H=(D[0]-T[0])/$),n.includes("w")&&(H=(k[0]-D[0])/$);let W=t.width*H<_?_:t.width*H,K=Oi(t.originalText,Oe(t),Math.abs(W)),G=zt(K,Oe(t),t.lineHeight),ce=G.height,[xe,Ce,ut,Zt]=ci(v,W,ce,!0),fa=ut-xe,En=Zt-Ce,Kt=[...T];["n","w","nw"].includes(n)&&(Kt=[k[0]-Math.abs(fa),T[1]]);let jn=v.angle,Zn=O(Kt,R,jn),qt=w(Kt[0]+Math.abs(fa)/2,Kt[1]+Math.abs(En)/2),Kn=O(qt,R,jn);Kt=O(Zn,Kn,-jn);let da={width:Math.abs(W),height:Math.abs(G.height),x:Kt[0],y:Kt[1],text:K,autoResize:!1};F(t,da)}},gS=(e,t,a,n,i,l,r,o,d)=>{let u=5*Math.PI/2+Math.atan2(l-d,i-o);r&&(u+=ai/2,u-=u%ai);for(let s of t)if(!de(s)){let[c,U,f,p]=Ue(s,a),m=(c+f)/2,g=(U+p)/2,y=e.get(s.id)?.angle??s.angle,[v,b]=O(w(m,g),w(o,d),u+y-s.angle);q(s)?F(s,{points:sE(s,a)}):F(s,{x:s.x+(v-m),y:s.y+(b-g),angle:Ls(u+y)},!1),na(s,a,{simultaneouslyUpdated:t});let x=pe(s,a);x&&!ge(s)&&F(x,{x:x.x+(v-m),y:x.y+(b-g),angle:Ls(u+y)},!1)}n.triggerUpdate()},bS=(e,t,a,n,i)=>{let[l,r,o,d]=t.length===1?Ue(t[0],a):De(t),u=(l+o)/2,s=(r+d)/2,c=t.length===1?t[0].angle:0;switch([n,i]=O(w(n,i),w(u,s),-c),e){case"n":return O(w(n-(l+o)/2,i-r),w(0,0),c);case"s":return O(w(n-(l+o)/2,i-d),w(0,0),c);case"w":return O(w(n-l,i-(r+d)/2),w(0,0),c);case"e":return O(w(n-o,i-(r+d)/2),w(0,0),c);case"nw":return O(w(n-l,i-r),w(0,0),c);case"ne":return O(w(n-o,i-r),w(0,0),c);case"sw":return O(w(n-l,i-d),w(0,0),c);case"se":return O(w(n-o,i-d),w(0,0),c);default:return[0,0]}},yS=(e,t)=>{let[,[a,n]]=t.points;return e==="nw"&&(a<0||n<0)||e==="ne"&&a>=0||e==="sw"&&a<=0||e==="se"&&(a>0||n>0)?"end":"origin"},vS=(e,t,a)=>{if(a)return"center";if(t)switch(e){case"n":return"south-side";case"e":return"west-side";case"s":return"north-side";case"w":return"east-side";case"ne":return"bottom-left";case"nw":return"bottom-right";case"se":return"top-left";case"sw":return"top-right"}return["e","se","s"].includes(e)?"top-left":["n","nw","w"].includes(e)?"bottom-right":e==="ne"?"bottom-left":"top-right"},wS=(e,t,a,n,i,l,r,o,d)=>{let u=vS(r,o,d),[s,c]=e;switch(u){case"top-left":return{x:s+(t-n)/2+(n-t)/2*Math.cos(l)+(a-i)/2*Math.sin(l),y:c+(a-i)/2+(n-t)/2*Math.sin(l)+(i-a)/2*Math.cos(l)};case"top-right":return{x:s+(t-n)/2*(Math.cos(l)+1)+(a-i)/2*Math.sin(l),y:c+(a-i)/2+(t-n)/2*Math.sin(l)+(i-a)/2*Math.cos(l)};case"bottom-left":return{x:s+(t-n)/2*(1-Math.cos(l))+(i-a)/2*Math.sin(l),y:c+(a-i)/2*(Math.cos(l)+1)+(n-t)/2*Math.sin(l)};case"bottom-right":return{x:s+(t-n)/2*(Math.cos(l)+1)+(i-a)/2*Math.sin(l),y:c+(a-i)/2*(Math.cos(l)+1)+(t-n)/2*Math.sin(l)};case"center":return{x:s-(n-t)/2,y:c-(i-a)/2};case"east-side":return{x:s+(t-n)/2*(Math.cos(l)+1),y:c+(t-n)/2*Math.sin(l)+(a-i)/2};case"west-side":return{x:s+(t-n)/2*(1-Math.cos(l)),y:c+(n-t)/2*Math.sin(l)+(a-i)/2};case"north-side":return{x:s+(t-n)/2+(a-i)/2*Math.sin(l),y:c+(i-a)/2*(Math.cos(l)-1)};case"south-side":return{x:s+(t-n)/2+(i-a)/2*Math.sin(l),y:c+(a-i)/2*(Math.cos(l)+1)}}},Wr=(e,t,a,n,i,l,r,{shouldInformMutation:o=!0,shouldMaintainAspectRatio:d=!1,shouldResizeFromCenter:u=!1}={})=>{let s={},c=pe(a,i);if(c){let m=l.get(c.id);if(m&&(s={fontSize:m.fontSize}),d){let g={...a,width:e},y=Lh(c,i,$n(g,c));if(y===null)return;s={fontSize:y.size}}else{let g=iU(Oe(c),c.lineHeight),y=lU(c.fontSize,c.lineHeight);e=Math.max(e,g),t=Math.max(t,y)}}let U=Th(n,e,t,!0),f=w(n.x,n.y);if(he(n)){let[m,g]=za(n,l);f=w(m,g)}let p=wS(f,n.width,n.height,e,t,n.angle,r,d,u);if(he(n)&&U.points){let m=n.x-f[0],g=n.y-f[1];p.x+=m,p.y+=g;let y=U.points[0][0],v=U.points[0][1];p.x+=y,p.y+=v,U.points=U.points.map(b=>w(b[0]-y,b[1]-v))}if(e<0&&(p.x=p.x+e),t<0&&(p.y=p.y+t),"scale"in a&&"scale"in n&&F(a,{scale:[(Math.sign(e)||n.scale[0])*n.scale[0],(Math.sign(t)||n.scale[1])*n.scale[1]]}),ge(a)&&c&&d){let m=e/a.width*c.fontSize;if(m<Td)return;s.fontSize=m}if(e!==0&&t!==0&&Number.isFinite(p.x)&&Number.isFinite(p.y)){let m={...p,width:Math.abs(e),height:Math.abs(t),...U};F(a,m,o),na(a,i,{newSize:{width:e,height:t}}),c&&s!=null&&F(c,{fontSize:s.fontSize}),Ir(a,i,r,d)}},ES=(e,t,a,n,i,l,r,{shouldMaintainAspectRatio:o=!1,shouldResizeFromCenter:d=!1}={})=>{let[u,s,c,U]=ci(t,t.width,t.height,!0),f=w(u,s),p=w(c,U),m=sr(f,p),g=O(w(l,r),m,-t.angle),[y,v,b,x]=ci(e,e.width,e.height,!0),S=b-y,C=x-v,T=p[0]-f[0],k=p[1]-f[1],R=T/S,D=k/C;i.includes("e")&&(R=(g[0]-f[0])/S),i.includes("s")&&(D=(g[1]-f[1])/C),i.includes("w")&&(R=(p[0]-g[0])/S),i.includes("n")&&(D=(p[1]-g[1])/C);let A=e.width*R,P=e.height*D;if(d&&(A=2*A-t.width,P=2*P-t.height),o){let $=Math.abs(A)/t.width,X=Math.abs(P)/t.height;if(i.length===1&&(P*=$,A*=X),i.length===2){let _=Math.max($,X);A=t.width*_*Math.sign(A),P=t.height*_*Math.sign(P)}}return{nextWidth:A,nextHeight:P}},xS=(e,t,a,n,i,l,{shouldMaintainAspectRatio:r=!1,shouldResizeFromCenter:o=!1}={})=>{let d=e.map($=>t.get($.id)),u=d.reduce(($,X)=>{if(!he(X))return $;let _=Fn(X);if(!_)return $;let H=t.get(_)??null;return Ye(H)?[...$,{...H,...Z.getBoundTextElementPosition(X,H,a)}]:$},[]),s=Fa(d.map($=>$).concat(u)),{minX:c,minY:U,maxX:f,maxY:p,midX:m,midY:g}=s,y=f-c,v=p-U,b={ne:[c,p],se:[c,U],sw:[f,U],nw:[f,p],e:[c,U+v/2],w:[f,U+v/2],n:[c+y/2,p],s:[c+y/2,U]},[x,S]=o?[m,g]:b[n],C=o?2:1,T=Math.max(Math.abs(i-x)/y||0,Math.abs(l-S)/v||0)*C,k=n.includes("e")||n.includes("w")?Math.abs(i-x)*C:y,R=n.includes("n")||n.includes("s")?Math.abs(l-S)*C:v;r&&(k=y*T*Math.sign(i-x),R=v*T*Math.sign(l-S));let D={ne:[i<x,l>S],se:[i<x,l<S],sw:[i>x,l<S],nw:[i>x,l>S],e:[i<x,!1],w:[i>x,!1],n:[!1,l>S],s:[!1,l<S]},[A,P]=D[n].map($=>$);return{originalBoundingBox:s,nextWidth:k,nextHeight:R,flipByX:A,flipByY:P}},Vp=(e,t,a,n,i,{shouldMaintainAspectRatio:l=!1,shouldResizeFromCenter:r=!1,flipByX:o=!1,flipByY:d=!1,nextHeight:u,nextWidth:s,originalBoundingBox:c}={})=>{if(s===void 0&&u===void 0&&o===void 0&&d===void 0||u===0||s===0)return;i||(i=t);let U=e.reduce((C,T)=>{let k=i.get(T.id);return k&&C.push({orig:k,latest:T}),C},[]),f;if(c)f=c;else{let C=U.reduce((T,{orig:k})=>{if(!he(k))return T;let R=Fn(k);if(!R)return T;let D=i.get(R)??null;return Ye(D)?[...T,{...D,...Z.getBoundTextElementPosition(k,D,t)}]:T},[]);f=Fa(U.map(({orig:T})=>T).concat(C))}let{minX:p,minY:m,maxX:g,maxY:y,midX:v,midY:b}=f,x=g-p,S=y-m;if(s===void 0&&u===void 0&&(s=x,u=S),l&&(s===void 0?s=u*(x/S):u===void 0?u=s*(S/x):Math.abs(s/u-x/S)>.001&&(s=u*(x/S))),s&&u){let C=a.includes("e")||a.includes("w")?Math.abs(s)/x:1,T=a.includes("n")||a.includes("s")?Math.abs(u)/S:1,k;a.length===1?k=a.includes("e")||a.includes("w")?C:T:k=Math.max(Math.abs(s)/x||0,Math.abs(u)/S||0);let R={ne:[p,y],se:[p,m],sw:[g,m],nw:[g,y],e:[p,m+S/2],w:[g,m+S/2],n:[p+x/2,y],s:[p+x/2,m]},[D,A]=r?[v,b]:R[a],P=l||U.some(W=>W.latest.angle!==0||j(W.latest)||Dl(W.latest));P&&(C=k,T=k);let[$,X]=[o?-1:1,d?-1:1],_=[];for(let{orig:W,latest:K}of U){if(j(W)&&Ye(W))continue;let G=W.width*C,ce=W.height*T,xe=Ls(W.angle*$*X),Ce=he(W)||va(W),ut=W.x-D,Zt=W.y-A,fa=o&&!Ce?G:0,En=d&&!Ce?ce:0,Kt=D+$*(ut*C+fa),jn=A+X*(Zt*T+En),Zn=Th(W,G*$,ce*X,!1),qt={x:Kt,y:jn,width:G,height:ce,angle:xe,...Zn};if(q(W)&&(W.startBinding&&(qt.startBinding={...W.startBinding,fixedPoint:[o?-W.startBinding.fixedPoint[0]+1:W.startBinding.fixedPoint[0],d?-W.startBinding.fixedPoint[1]+1:W.startBinding.fixedPoint[1]]}),W.endBinding&&(qt.endBinding={...W.endBinding,fixedPoint:[o?-W.endBinding.fixedPoint[0]+1:W.endBinding.fixedPoint[0],d?-W.endBinding.fixedPoint[1]+1:W.endBinding.fixedPoint[1]]}),W.fixedSegments&&Zn.points&&(qt.fixedSegments=W.fixedSegments.map(da=>({...da,start:Zn.points[da.index-1],end:Zn.points[da.index]})))),Le(W)&&(qt.scale=[W.scale[0]*$,W.scale[1]*X]),j(W)){let da=Lh(W,t,G);if(!da)return;qt.fontSize=da.size}let Kn=i.get(Fn(W)??"");if(Kn)if(P){let da=Kn.fontSize*k;if(da<Td)return;qt.boundTextFontSize=da}else qt.boundTextFontSize=Kn.fontSize;_.push({element:K,update:qt})}let H=_.map(({element:W})=>W);for(let{element:W,update:{boundTextFontSize:K,...G}}of _){let{width:ce,height:xe,angle:Ce}=G;F(W,G,!1,{isDragging:!0}),na(W,t,{simultaneouslyUpdated:H,newSize:{width:ce,height:xe}});let ut=pe(W,t);ut&&K&&(F(ut,{fontSize:K,angle:he(W)?void 0:Ce},!1),Ir(W,t,a,!0))}n.triggerUpdate()}},SS=(e,t,a,n,i,l)=>{if(t.length===1&&q(t[0])&&(t[0].startBinding||t[0].endBinding))return;let r=t.filter(c=>{if(q(c)&&c.startBinding&&c.endBinding){let U=t.find(p=>p.id===c.startBinding?.elementId),f=t.find(p=>p.id===c.endBinding?.elementId);return U&&f}return!0}),o=new Set(r),d=r.filter(c=>de(c)).map(c=>c.id);if(d.length>0)for(let c of n.getNonDeletedElements())c.frameId!==null&&d.includes(c.frameId)&&o.add(c);let u=De(Array.from(o).map(c=>e.originalElements.get(c.id)??c)),s=MS(u,a,i,l);o.forEach(c=>{if(Yp(e,c,s),!ge(c)){let U=pe(c,n.getNonDeletedElementsMap());U&&Yp(e,U,s),na(c,n.getElementsMapIncludingDeleted(),{simultaneouslyUpdated:Array.from(o)})}})},MS=(e,t,a,n)=>{let[i,l]=e,r=i+t.x+a.x,o=l+t.y+a.y;if(a.x===0||a.y===0){let[d,u]=bt(i+t.x,l+t.y,n);a.x===0&&(r=d),a.y===0&&(o=u)}return{x:r-i,y:o-l}},Yp=(e,t,a)=>{let n=e.originalElements.get(t.id)??t,i=n.x+a.x,l=n.y+a.y;F(t,{x:i,y:l})},CS=(e,t,a)=>{let[n,i]=De(e);return[t-n,a-i]},jp=({newElement:e,elementType:t,originX:a,originY:n,x:i,y:l,width:r,height:o,shouldMaintainAspectRatio:d,shouldResizeFromCenter:u,zoom:s,widthAspectRatio:c=null,originOffset:U=null,informMutation:f=!0})=>{d&&e.type!=="selection"&&(c?o=r/c:(Math.abs(l-n)>Math.abs(i-a)?{width:r,height:o}=Pp(t,o,i<a?-r:r):{width:r,height:o}=Pp(t,r,l<n?-o:o),o<0&&(o=-o)));let p=i<a?a-r:a,m=l<n?n-o:n;u&&(r+=r,o+=o,p=a-r/2,m=n-o/2);let g=null;if(j(e)){o=e.height;let y=jd(Oe({fontSize:e.fontSize,fontFamily:e.fontFamily}),e.lineHeight);r=Math.max(r,y),Math.abs(i-a)>jg/s&&(g={autoResize:!1}),m=n,u&&(p=a-r/2)}if(r!==0&&o!==0){let y=null;Le(e)&&(y={initialWidth:r,initialHeight:o}),F(e,{x:p+(U?.x??0),y:m+(U?.y??0),width:r,height:o,...g,...y},f)}},Dh=(e,t)=>!!(!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&(e.activeTool.type!=="custom"&&(e.editingTextElement||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser")||be(t,e).length)),kS=e=>e.reduce((t,a)=>t+a.version,0),Zp=e=>{let t=5381;for(let a=0;a<e.length;a++)t=(t<<5)+t+e[a].versionNonce;return t>>>0},Ah=e=>{let t=5381;for(let a=0;a<e.length;a++){let n=e.charCodeAt(a);t=(t<<5)+t+n}return t>>>0},IS=e=>e.filter(t=>!t.isDeleted&&!qi(t)),ze=e=>e.filter(t=>!t.isDeleted),Rh=e=>!e.isDeleted,Kp=e=>ze(e).map(t=>Yd(t.type)?{...t,lastCommittedPoint:null}:t),TS=e=>Kp(e),qp=e=>Kp(e),Jp=async e=>{let t;if(e.type===ne.png)try{return await(await import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/data/image-GAAHSSAO.js/+esm")).decodePngMetadata(e)}catch(a){throw a.message==="INVALID"?new $i("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new $i("Error: cannot restore image")}else if("text"in Blob?t=await e.text():t=await new Promise(a=>{let n=new FileReader;n.readAsText(e,"utf8"),n.onloadend=()=>{n.readyState===FileReader.DONE&&a(n.result)}}),e.type===ne.svg)try{return fx({svg:t})}catch(a){throw a.message==="INVALID"?new $i("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new $i("Error: cannot restore image")}return t},Qp=e=>e&&e.name.match(/\.(json|excalidraw|png|svg)$/)?.[1]||null,LS=e=>e==="png"||e==="svg",Nh=e=>{let t=Qp(e);return t==="png"||t==="svg"},e2=e=>!!e&&Object.values(ul).includes(e),Ji=e=>{let{type:t}=e||{};return e2(t)},Ph=async(e,t,a,n)=>{let i=await Jp(e),l;try{try{l=JSON.parse(i)}catch(r){throw Ji(e)?new $i("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):r}if(rx(l))return{type:ne.excalidraw,data:Pr({elements:qp(l.elements||[]),appState:{theme:t?.theme,fileHandle:n||e.handle||null,...Lu(l.appState||{}),...t?Sr(l.elements||[],t):{}},files:l.files},t,a,{repairBindings:!0,refreshDimensions:!1})};if(R0(l))return{type:ne.excalidrawlib,data:l};throw new Error("Error: invalid file")}catch(r){throw r instanceof $i?r:new Error("Error: invalid file")}},_h=async(e,t,a,n)=>{let i=await Ph(e,t,a,n);if(i.type!==ne.excalidraw)throw new Error("Error: invalid file");return i.data},t2=(e,t="unpublished")=>{let a=JSON.parse(e);if(!R0(a))throw new Error("Invalid library");let n=a.libraryItems||a.library;return _r(n,t)},a2=async(e,t="unpublished")=>t2(await Jp(e),t),Gr=async e=>new Promise(async(t,a)=>{try{ur(e)&&(e=await e),e.toBlob(n=>{if(!n)return a(new rb("Error: Canvas too big","CANVAS_POSSIBLY_TOO_BIG"));t(n)})}catch(n){a(n)}}),DS=async e=>{try{let t=await window.crypto.subtle.digest("SHA-1",await Fl(e));return H7(new Uint8Array(t))}catch(t){return console.error(t),Sd(40)}},Oh=async e=>new Promise((t,a)=>{let n=new FileReader;n.onload=()=>{let i=n.result;t(i)},n.onerror=i=>a(i),n.readAsDataURL(e)}),AS=(e,t)=>`data:${t};base64,${s2(Fo(e),!0)}`,RS=(e,t="")=>{let a=e.indexOf(","),n=atob(e.slice(a+1)),i=e.slice(0,a).split(":")[1].split(";")[0],l=new ArrayBuffer(n.length),r=new Uint8Array(l);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return new File([l],t,{type:i})},NS=e=>o2(e.slice(e.indexOf(",")+1)),Bh=async(e,t)=>{if(e.type===ne.svg)return e;let[a,n]=await Promise.all([import("/npm/pica@7.1.1/+esm").then(l=>l.default),import("/npm/image-blob-reduce@3.0.1/+esm").then(l=>l.default)]),i=n({pica:a({features:["js","wasm"]})});if(t.outputType){let{outputType:l}=t;i._create_blob=function(r){return this.pica.toBlob(r.out_canvas,l,.8).then(o=>(r.out_blob=o,r))}}if(!Ji(e))throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"});return new File([await i.toBlob(e,{max:t.maxWidthOrHeight,alpha:!0})],e.name,{type:t.outputType||e.type})},n2=(e,t="")=>new File([new TextEncoder().encode(e)],t,{type:ne.svg}),PS=async(e,t="")=>{let a;try{a=await fetch(e)}catch{throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"})}if(!a.ok)throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"});let n=await a.blob();if(n.type&&Ji(n)){let i=t||n.name||"";return new File([n],i,{type:n.type})}throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"})},_S=async e=>{let t=e.dataTransfer.files.item(0),a=await OS(e);return{file:t?await zh(t):null,fileHandle:a}},OS=async e=>{if(gs)try{return await e.dataTransfer.items[0].getAsFileSystemHandle()||null}catch(t){return console.warn(t.name,t.message),null}return null},i2=e=>{let t=null,a=`${[...new Uint8Array(e).slice(0,8)].join(" ")} `,n={png:"137 80 78 71 13 10 26 10 ",jpg:"255 216 255 ",gif:"71 73 70 56 57 97 "};return a===n.png?t=ne.png:a.startsWith(n.jpg)?t=ne.jpg:a.startsWith(n.gif)&&(t=ne.gif),t},Vr=(e,t,a)=>new File([e],a||"",{type:t}),zh=async e=>{if(e.type){if(Ji(e)){let t=await Fl(e),a=i2(t);a&&a!==e.type&&(e=Vr(t,a,e.name))}}else if(e?.name?.endsWith(".excalidrawlib"))e=Vr(await Fl(e),ne.excalidrawlib,e.name);else if(e?.name?.endsWith(".excalidraw"))e=Vr(await Fl(e),ne.excalidraw,e.name);else{let t=await Fl(e),a=i2(t);a&&(e=Vr(t,a,e.name))}return e},Fl=e=>"arrayBuffer"in e?e.arrayBuffer():new Promise((t,a)=>{let n=new FileReader;n.onload=i=>{if(!i.target?.result)return a(new Error("Couldn't convert blob to ArrayBuffer"));t(i.target.result)},n.readAsArrayBuffer(e)}),Fo=e=>{let t=typeof e=="string"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e),a="";for(let n of t)a+=String.fromCharCode(n);return a},l2=e=>{let t=new ArrayBuffer(e.length),a=new Uint8Array(t);for(let n=0,i=e.length;n<i;n++)a[n]=e.charCodeAt(n);return t},r2=e=>new TextDecoder("utf-8").decode(l2(e)),s2=(e,t=!1)=>t?window.btoa(e):window.btoa(Fo(e)),o2=(e,t=!1)=>t?window.atob(e):r2(window.atob(e)),d2=({text:e,compress:t})=>{let a;if(t!==!1)try{a=Fo(H5(e))}catch(n){console.error("encode: cannot deflate",n)}return{version:"1",encoding:"bstring",compressed:!!a,encoded:a||Fo(e)}},BS=e=>{let t;if(e.encoding==="bstring")t=e.compressed?e.encoded:r2(e.encoded);else throw new Error(`decode: unknown encoding "${e.encoding}"`);return e.compressed?X5(new Uint8Array(l2(t)),{to:"string"}):t},zS=async({blob:e,metadata:t})=>{let a=z5(new Uint8Array(await Fl(e))),n=F5.encode(ne.excalidraw,JSON.stringify(d2({text:t,compress:!0})));return a.splice(-1,0,n),new Blob([$5(a)],{type:ne.png})},FS={paste:"Paste",pasteAsPlaintext:"Paste as plaintext",pasteCharts:"Paste charts",selectAll:"Select all",multiSelect:"Add element to selection",moveCanvas:"Move canvas",cut:"Cut",copy:"Copy",copyAsPng:"Copy to clipboard as PNG",copyAsSvg:"Copy to clipboard as SVG",copyText:"Copy to clipboard as text",copySource:"Copy source to clipboard",convertToCode:"Convert to code",bringForward:"Bring forward",sendToBack:"Send to back",bringToFront:"Bring to front",sendBackward:"Send backward",delete:"Delete",copyStyles:"Copy styles",pasteStyles:"Paste styles",stroke:"Stroke",changeStroke:"Change stroke color",background:"Background",changeBackground:"Change background color",fill:"Fill",strokeWidth:"Stroke width",strokeStyle:"Stroke style",strokeStyle_solid:"Solid",strokeStyle_dashed:"Dashed",strokeStyle_dotted:"Dotted",sloppiness:"Sloppiness",opacity:"Opacity",textAlign:"Text align",edges:"Edges",sharp:"Sharp",round:"Round",arrowheads:"Arrowheads",arrowhead_none:"None",arrowhead_arrow:"Arrow",arrowhead_bar:"Bar",arrowhead_circle:"Circle",arrowhead_circle_outline:"Circle (outline)",arrowhead_triangle:"Triangle",arrowhead_triangle_outline:"Triangle (outline)",arrowhead_diamond:"Diamond",arrowhead_diamond_outline:"Diamond (outline)",arrowhead_crowfoot_many:"Crow's foot (many)",arrowhead_crowfoot_one:"Crow's foot (one)",arrowhead_crowfoot_one_or_many:"Crow's foot (one or many)",more_options:"More options",arrowtypes:"Arrow type",arrowtype_sharp:"Sharp arrow",arrowtype_round:"Curved arrow",arrowtype_elbowed:"Elbow arrow",fontSize:"Font size",fontFamily:"Font family",addWatermark:'Add "Made with Excalidraw"',handDrawn:"Hand-drawn",normal:"Normal",code:"Code",small:"Small",medium:"Medium",large:"Large",veryLarge:"Very large",solid:"Solid",hachure:"Hachure",zigzag:"Zigzag",crossHatch:"Cross-hatch",thin:"Thin",bold:"Bold",left:"Left",center:"Center",right:"Right",extraBold:"Extra bold",architect:"Architect",artist:"Artist",cartoonist:"Cartoonist",fileTitle:"File name",colorPicker:"Color picker",canvasColors:"Used on canvas",canvasBackground:"Canvas background",drawingCanvas:"Drawing canvas",clearCanvas:"Clear canvas",layers:"Layers",actions:"Actions",language:"Language",liveCollaboration:"Live collaboration...",duplicateSelection:"Duplicate",untitled:"Untitled",name:"Name",yourName:"Your name",madeWithExcalidraw:"Made with Excalidraw",group:"Group selection",ungroup:"Ungroup selection",collaborators:"Collaborators",toggleGrid:"Toggle grid",addToLibrary:"Add to library",removeFromLibrary:"Remove from library",libraryLoadingMessage:"Loading library\u2026",libraries:"Browse libraries",loadingScene:"Loading scene\u2026",loadScene:"Load scene from file",align:"Align",alignTop:"Align top",alignBottom:"Align bottom",alignLeft:"Align left",alignRight:"Align right",centerVertically:"Center vertically",centerHorizontally:"Center horizontally",distributeHorizontally:"Distribute horizontally",distributeVertically:"Distribute vertically",flipHorizontal:"Flip horizontal",flipVertical:"Flip vertical",viewMode:"View mode",share:"Share",showStroke:"Show stroke color picker",showBackground:"Show background color picker",showFonts:"Show font picker",toggleTheme:"Toggle light/dark theme",theme:"Theme",personalLib:"Personal Library",excalidrawLib:"Excalidraw Library",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",unbindText:"Unbind text",bindText:"Bind text to the container",createContainerFromText:"Wrap text in a container",link:{edit:"Edit link",editEmbed:"Edit embeddable link",create:"Add link",label:"Link",labelEmbed:"Link & embed",empty:"No link is set",hint:"Type or paste your link here",goToElement:"Go to target element"},lineEditor:{edit:"Edit line",editArrow:"Edit arrow"},elementLock:{lock:"Lock",unlock:"Unlock",lockAll:"Lock all",unlockAll:"Unlock all"},statusPublished:"Published",sidebarLock:"Keep sidebar open",selectAllElementsInFrame:"Select all elements in frame",removeAllElementsFromFrame:"Remove all elements from frame",eyeDropper:"Pick color from canvas",textToDiagram:"Text to diagram",prompt:"Prompt",followUs:"Follow us",discordChat:"Discord chat",zoomToFitViewport:"Zoom to fit in viewport",zoomToFitSelection:"Zoom to fit selection",zoomToFit:"Zoom to fit all elements",installPWA:"Install Excalidraw locally (PWA)",autoResize:"Enable text auto-resizing",imageCropping:"Image cropping",unCroppedDimension:"Uncropped dimension",copyElementLink:"Copy link to object",linkToElement:"Link to object",wrapSelectionInFrame:"Wrap selection in frame"},$S={title:"Link to object",desc:"Click on a shape on canvas or paste a link.",notFound:"Linked object wasn't found on canvas."},HS={noItems:"No items added yet...",hint_emptyLibrary:"Select an item on canvas to add it here, or install a library from the public repository, below.",hint_emptyPrivateLibrary:"Select an item on canvas to add it here."},XS={title:"Find on canvas",noMatch:"No matches found...",singleResult:"result",multipleResults:"results",placeholder:"Find text on canvas..."},WS={clearReset:"Reset the canvas",exportJSON:"Export to file",exportImage:"Export image...",export:"Save to...",copyToClipboard:"Copy to clipboard",copyLink:"Copy link",save:"Save to current file",saveAs:"Save as",load:"Open",getShareableLink:"Get shareable link",close:"Close",selectLanguage:"Select language",scrollBackToContent:"Scroll back to content",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",menu:"Menu",done:"Done",edit:"Edit",undo:"Undo",redo:"Redo",resetLibrary:"Reset library",createNewRoom:"Create new room",fullScreen:"Full screen",darkMode:"Dark mode",lightMode:"Light mode",systemMode:"System mode",zenMode:"Zen mode",objectsSnapMode:"Snap to objects",exitZenMode:"Exit zen mode",cancel:"Cancel",clear:"Clear",remove:"Remove",embed:"Toggle embedding",publishLibrary:"Publish",submit:"Submit",confirm:"Confirm",embeddableInteractionButton:"Click to interact"},GS={clearReset:"This will clear the whole canvas. Are you sure?",couldNotCreateShareableLink:"Couldn't create shareable link.",couldNotCreateShareableLinkTooBig:"Couldn't create shareable link: the scene is too big",couldNotLoadInvalidFile:"Couldn't load invalid file",importBackendFailed:"Importing from backend failed.",cannotExportEmptyCanvas:"Cannot export empty canvas.",couldNotCopyToClipboard:"Couldn't copy to clipboard.",decryptFailed:"Couldn't decrypt data.",uploadedSecurly:"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can't read the content.",loadSceneOverridePrompt:"Loading external drawing will replace your existing content. Do you wish to continue?",collabStopOverridePrompt:`Stopping the session will overwrite your previous, locally stored drawing. Are you sure?

(If you want to keep your local drawing, simply close the browser tab instead.)`,errorAddingToLibrary:"Couldn't add item to the library",errorRemovingFromLibrary:"Couldn't remove item from the library",confirmAddLibrary:"This will add {{numShapes}} shape(s) to your library. Are you sure?",imageDoesNotContainScene:"This image does not seem to contain any scene data. Have you enabled scene embedding during export?",cannotRestoreFromImage:"Scene couldn't be restored from this image file",invalidSceneUrl:"Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",resetLibrary:"This will clear your library. Are you sure?",removeItemsFromsLibrary:"Delete {{count}} item(s) from library?",invalidEncryptionKey:"Encryption key must be of 22 characters. Live collaboration is disabled.",collabOfflineWarning:`No internet connection available.
Your changes will not be saved!`},VS={unsupportedFileType:"Unsupported file type.",imageInsertError:"Couldn't insert image. Try again later...",fileTooBig:"File is too big. Maximum allowed size is {{maxSize}}.",svgImageInsertError:"Couldn't insert SVG image. The SVG markup looks invalid.",failedToFetchImage:"Failed to fetch image.",cannotResolveCollabServer:"Couldn't connect to the collab server. Please reload the page and try again.",importLibraryError:"Couldn't load library",saveLibraryError:"Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.",collabSaveFailed:"Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.",collabSaveFailed_sizeExceeded:"Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.",imageToolNotSupported:"Images are disabled.",brave_measure_text_error:{line1:"Looks like you are using Brave browser with the <bold>Aggressively Block Fingerprinting</bold> setting enabled.",line2:"This could result in breaking the <bold>Text Elements</bold> in your drawings.",line3:"We strongly recommend disabling this setting. You can follow <link>these steps</link> on how to do so.",line4:"If disabling this setting doesn't fix the display of text elements, please open an <issueLink>issue</issueLink> on our GitHub, or write us on <discordLink>Discord</discordLink>"},libraryElementTypeError:{embeddable:"Embeddable elements cannot be added to the library.",iframe:"IFrame elements cannot be added to the library.",image:"Support for adding images to the library coming soon!"},asyncPasteFailedOnRead:"Couldn't paste (couldn't read from system clipboard).",asyncPasteFailedOnParse:"Couldn't paste.",copyToSystemClipboardFailed:"Couldn't copy to clipboard."},YS={selection:"Selection",image:"Insert image",rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Draw",text:"Text",library:"Library",lock:"Keep selected tool active after drawing",penMode:"Pen mode - prevent touch",link:"Add / Update link for a selected shape",eraser:"Eraser",frame:"Frame tool",magicframe:"Wireframe to code",embeddable:"Web Embed",laser:"Laser pointer",hand:"Hand (panning tool)",extraTools:"More tools",mermaidToExcalidraw:"Mermaid to Excalidraw"},jS={rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Freedraw",text:"Text",image:"Image",group:"Group",frame:"Frame",magicframe:"Wireframe to code",embeddable:"Web Embed",selection:"Selection",iframe:"IFrame"},ZS={canvasActions:"Canvas actions",selectedShapeActions:"Selected shape actions",shapes:"Shapes"},KS={dismissSearch:"Escape to dismiss search",canvasPanning:"To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool",linearElement:"Click to start multiple points, drag for single line",arrowTool:"Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.",freeDraw:"Click and drag, release when you're finished",text:"Tip: you can also add text by double-clicking anywhere with the selection tool",embeddable:"Click-drag to create a website embed",text_selected:"Double-click or press ENTER to edit text",text_editing:"Press Escape or CtrlOrCmd+ENTER to finish editing",linearElementMulti:"Click on last point or press Escape or Enter to finish",lockAngle:"You can constrain angle by holding SHIFT",resize:`You can constrain proportions by holding SHIFT while resizing,
hold ALT to resize from the center`,resizeImage:`You can resize freely by holding SHIFT,
hold ALT to resize from the center`,rotate:"You can constrain angles by holding SHIFT while rotating",lineEditor_info:"Hold CtrlOrCmd and Double-click or press CtrlOrCmd + Enter to edit points",lineEditor_pointSelected:`Press Delete to remove point(s),
CtrlOrCmd+D to duplicate, or drag to move`,lineEditor_nothingSelected:`Select a point to edit (hold SHIFT to select multiple),
or hold Alt and click to add new points`,placeImage:"Click to place the image, or click and drag to set its size manually",publishLibrary:"Publish your own library",bindTextToElement:"Press enter to add text",createFlowchart:"Hold CtrlOrCmd and Arrow key to create a flowchart",deepBoxSelect:"Hold CtrlOrCmd to deep select, and to prevent dragging",eraserRevert:"Hold Alt to revert the elements marked for deletion",firefox_clipboard_write:'This feature can likely be enabled by setting the "dom.events.asyncClipboard.clipboardItem" flag to "true". To change the browser flags in Firefox, visit the "about:config" page.',disableSnapping:"Hold CtrlOrCmd to disable snapping",enterCropEditor:"Double click the image or press ENTER to crop the image",leaveCropEditor:"Click outside the image or press ENTER or ESCAPE to finish cropping"},qS={cannotShowPreview:"Cannot show preview",canvasTooBig:"The canvas may be too big.",canvasTooBigTip:"Tip: try moving the farthest elements a bit closer together."},JS={headingMain:"Encountered an error. Try <button>reloading the page</button>.",clearCanvasMessage:"If reloading doesn't work, try <button>clearing the canvas</button>.",clearCanvasCaveat:" This will result in loss of work ",trackedToSentry:"The error with identifier {{eventId}} was tracked on our system.",openIssueMessage:"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our <button>bug tracker</button>. Please include information below by copying and pasting into the GitHub issue.",sceneContent:"Scene content:"},QS={or:"Or"},eM={desc_intro:"Invite people to collaborate on your drawing.",desc_privacy:"Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.",button_startSession:"Start session",button_stopSession:"Stop session",desc_inProgressIntro:"Live-collaboration session is now in progress.",desc_shareLink:"Share this link with anyone you want to collaborate with:",desc_exitSession:"Stopping the session will disconnect you from the room, but you'll be able to continue working with the scene, locally. Note that this won't affect other people, and they'll still be able to collaborate on their version.",shareTitle:"Join a live collaboration session on Excalidraw"},tM={title:"Error"},aM={disk_title:"Save to disk",disk_details:"Export the scene data to a file from which you can import later.",disk_button:"Save to file",link_title:"Shareable link",link_details:"Export as a read-only link.",link_button:"Export to Link",excalidrawplus_description:"Save the scene to your Excalidraw+ workspace.",excalidrawplus_button:"Export",excalidrawplus_exportError:"Couldn't export to Excalidraw+ at this moment..."},nM={blog:"Read our blog",click:"click",deepSelect:"Deep select",deepBoxSelect:"Deep select within box, and prevent dragging",createFlowchart:"Create a flowchart from a generic element",navigateFlowchart:"Navigate a flowchart",curvedArrow:"Curved arrow",curvedLine:"Curved line",documentation:"Documentation",doubleClick:"double-click",drag:"drag",editor:"Editor",editLineArrowPoints:"Edit line/arrow points",editText:"Edit text / add label",github:"Found an issue? Submit",howto:"Follow our guides",or:"or",preventBinding:"Prevent arrow binding",tools:"Tools",shortcuts:"Keyboard shortcuts",textFinish:"Finish editing (text editor)",textNewLine:"Add new line (text editor)",title:"Help",view:"View",zoomToFit:"Zoom to fit all elements",zoomToSelection:"Zoom to selection",toggleElementLock:"Lock/unlock selection",movePageUpDown:"Move page up/down",movePageLeftRight:"Move page left/right",cropStart:"Crop image",cropFinish:"Finish image cropping"},iM={title:"Clear canvas"},lM={title:"Publish library",itemName:"Item name",authorName:"Author name",githubUsername:"GitHub username",twitterUsername:"Twitter username",libraryName:"Library name",libraryDesc:"Library description",website:"Website",placeholder:{authorName:"Your name or username",libraryName:"Name of your library",libraryDesc:"Description of your library to help people understand its usage",githubHandle:"GitHub handle (optional), so you can edit the library once submitted for review",twitterHandle:"Twitter username (optional), so we know who to credit when promoting over Twitter",website:"Link to your personal website or elsewhere (optional)"},errors:{required:"Required",website:"Enter a valid URL"},noteDescription:"Submit your library to be included in the <link>public library repository</link> for other people to use in their drawings.",noteGuidelines:"The library needs to be manually approved first. Please read the <link>guidelines</link> before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required.",noteLicense:"By submitting, you agree the library will be published under the <link>MIT License</link>, which in short means anyone can use them without restrictions.",noteItems:"Each library item must have its own name so it's filterable. The following library items will be included:",atleastOneLibItem:"Please select at least one library item to get started",republishWarning:"Note: some of the selected items are marked as already published/submitted. You should only resubmit items when updating an existing library or submission."},rM={title:"Library submitted",content:"Thank you {{authorName}}. Your library has been submitted for review. You can track the status <link>here</link>"},sM={resetLibrary:"Reset library",removeItemsFromLib:"Remove selected items from library"},oM={header:"Export image",label:{withBackground:"Background",onlySelected:"Only selected",darkMode:"Dark mode",embedScene:"Embed scene",scale:"Scale",padding:"Padding"},tooltip:{embedScene:`Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.
Will increase exported file size.`},title:{exportToPng:"Export to PNG",exportToSvg:"Export to SVG",copyPngToClipboard:"Copy PNG to clipboard"},button:{exportToPng:"PNG",exportToSvg:"SVG",copyPngToClipboard:"Copy to clipboard"}},dM={tooltip:"Your drawings are end-to-end encrypted so Excalidraw's servers will never see them.",link:"Blog post on end-to-end encryption in Excalidraw"},cM={angle:"Angle",shapes:"Shapes",height:"Height",scene:"Scene",selected:"Selected",storage:"Storage",fullTitle:"Canvas & Shape properties",title:"Properties",generalStats:"General",elementProperties:"Shape properties",total:"Total",version:"Version",versionCopy:"Click to copy",versionNotAvailable:"Version not available",width:"Width"},hM={addedToLibrary:"Added to library",copyStyles:"Copied styles.",copyToClipboard:"Copied to clipboard.",copyToClipboardAsPng:`Copied {{exportSelection}} to clipboard as PNG
({{exportColorScheme}})`,copyToClipboardAsSvg:`Copied {{exportSelection}} to clipboard as SVG
({{exportColorScheme}})`,fileSaved:"File saved.",fileSavedToFilename:"Saved to {filename}",canvas:"canvas",selection:"selection",pasteAsSingleElement:`Use {{shortcut}} to paste as a single element,
or paste into an existing text editor`,unableToEmbed:"Embedding this url is currently not allowed. Raise an issue on GitHub to request the url whitelisted",unrecognizedLinkFormat:"The link you embedded does not match the expected format. Please try to paste the 'embed' string provided by the source site",elementLinkCopied:"Link copied to clipboard"},uM={transparent:"Transparent",black:"Black",white:"White",red:"Red",pink:"Pink",grape:"Grape",violet:"Violet",gray:"Gray",blue:"Blue",cyan:"Cyan",teal:"Teal",green:"Green",yellow:"Yellow",orange:"Orange",bronze:"Bronze"},UM={app:{center_heading:"All your data is saved locally in your browser.",center_heading_plus:"Did you want to go to the Excalidraw+ instead?",menuHint:"Export, preferences, languages, ..."},defaults:{menuHint:"Export, preferences, and more...",center_heading:"Diagrams. Made. Simple.",toolbarHint:"Pick a tool & Start drawing!",helpHint:"Shortcuts & help"}},fM={mostUsedCustomColors:"Most used custom colors",colors:"Colors",shades:"Shades",hexCode:"Hex code",noShades:"No shades available for this color"},pM={action:{exportToImage:{title:"Export as image",button:"Export as image",description:"Export the scene data as an image from which you can import later."},saveToDisk:{title:"Save to disk",button:"Save to disk",description:"Export the scene data to a file from which you can import later."},excalidrawPlus:{title:"Excalidraw+",button:"Export to Excalidraw+",description:"Save the scene to your Excalidraw+ workspace."}},modal:{loadFromFile:{title:"Load from file",button:"Load from file",description:"Loading from a file will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first using one of the options below."},shareableLink:{title:"Load from link",button:"Replace my content",description:"Loading external drawing will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first by using one of the options below."}}},mM={title:"Mermaid to Excalidraw",button:"Insert",description:"Currently only <flowchartLink>Flowchart</flowchartLink>,<sequenceLink> Sequence, </sequenceLink> and <classLink>Class </classLink>Diagrams are supported. The other types will be rendered as image in Excalidraw.",syntax:"Mermaid Syntax",preview:"Preview"},gM={placeholder:"Quick search"},bM={badge:{old:"old"},sceneFonts:"In this scene",availableFonts:"Available fonts",empty:"No fonts found"},yM={empty:"No users found",hint:{text:"Click on user to follow",followStatus:"You're currently following this user",inCall:"User is in a voice call",micMuted:"User's microphone is muted",isSpeaking:"User is speaking"}},vM={title:"Command palette",shortcuts:{select:"Select",confirm:"Confirm",close:"Close"},recents:"Recently used",search:{placeholder:"Search menus, commands, and discover hidden gems",noMatch:"No matching commands..."},itemNotAvailable:"Command is not available...",shortcutHint:"For Command palette, use {{shortcut}}"},c2={labels:FS,elementLink:$S,library:HS,search:XS,buttons:WS,alerts:GS,errors:VS,toolBar:YS,element:jS,headings:ZS,hints:KS,canvasError:qS,errorSplash:JS,shareDialog:QS,roomDialog:eM,errorDialog:tM,exportDialog:aM,helpDialog:nM,clearCanvasDialog:iM,publishDialog:lM,publishSuccessDialog:rM,confirmDialog:sM,imageExportDialog:oM,encrypted:dM,stats:cM,toast:hM,colors:uM,welcomeScreen:UM,colorPicker:fM,overwriteConfirm:pM,mermaid:mM,quickSearch:gM,fontList:bM,userList:yM,commandPalette:vM},wM=100,EM=36,xM={"ar-SA":94,"az-AZ":17,"bg-BG":71,"bn-BD":52,"ca-ES":83,"cs-CZ":86,"da-DK":61,"de-DE":100,"el-GR":80,en:wM,"es-ES":96,"eu-ES":97,"fa-IR":84,"fi-FI":76,"fr-FR":99,"gl-ES":86,"he-IL":77,"hi-IN":76,"hu-HU":76,"id-ID":91,"it-IT":98,"ja-JP":90,kaa:EM,"kab-KAB":76,"kk-KZ":18,"km-KH":83,"ko-KR":100,"ku-TR":87,"lt-LT":48,"lv-LV":77,"mr-IN":98,"my-MM":35,"nb-NO":93,"nl-NL":75,"nn-NO":67,"oc-FR":92,"pa-IN":78,"pl-PL":99,"pt-BR":91,"pt-PT":83,"ro-RO":99,"ru-RU":92,"si-LK":7,"sk-SK":100,"sl-SI":100,"sv-SE":100,"ta-IN":81,"th-TH":44,"tr-TR":87,"uk-UA":93,"vi-VN":49,"zh-CN":100,"zh-HK":22,"zh-TW":100},h2=au(),{useAtom:st,useSetAtom:$o,useAtomValue:u2,useStore:pA}=h2,SM=h2.Provider,Ga=ig(),MM=_g({"./locales/ar-SA.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/ar-SA-G6X2FPQ2.js/+esm"),"./locales/az-AZ.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/az-AZ-76LH7QW2.js/+esm"),"./locales/bg-BG.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/bg-BG-XCXSNQG7.js/+esm"),"./locales/bn-BD.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/bn-BD-2XOGV67Q.js/+esm"),"./locales/ca-ES.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/ca-ES-6MX7JW3Y.js/+esm"),"./locales/cs-CZ.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/cs-CZ-2BRQDIVT.js/+esm"),"./locales/da-DK.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/da-DK-5WZEPLOC.js/+esm"),"./locales/de-DE.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/de-DE-XR44H4JA.js/+esm"),"./locales/el-GR.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/el-GR-BZB4AONW.js/+esm"),"./locales/en.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/en-B4ZKOASM.js/+esm"),"./locales/es-ES.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/es-ES-U4NZUMDT.js/+esm"),"./locales/eu-ES.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/eu-ES-A7QVB2H4.js/+esm"),"./locales/fa-IR.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/fa-IR-HGAKTJCU.js/+esm"),"./locales/fi-FI.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/fi-FI-Z5N7JZ37.js/+esm"),"./locales/fr-FR.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/fr-FR-RHASNOE6.js/+esm"),"./locales/gl-ES.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/gl-ES-HMX3MZ6V.js/+esm"),"./locales/he-IL.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/he-IL-6SHJWFNN.js/+esm"),"./locales/hi-IN.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/hi-IN-IWLTKZ5I.js/+esm"),"./locales/hu-HU.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/hu-HU-A5ZG7DT2.js/+esm"),"./locales/id-ID.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/id-ID-SAP4L64H.js/+esm"),"./locales/it-IT.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/it-IT-JPQ66NNP.js/+esm"),"./locales/ja-JP.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/ja-JP-DBVTYXUO.js/+esm"),"./locales/kaa.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/kaa-6HZHGXH3.js/+esm"),"./locales/kab-KAB.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/kab-KAB-ZGHBKWFO.js/+esm"),"./locales/kk-KZ.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/kk-KZ-P5N5QNE5.js/+esm"),"./locales/km-KH.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/km-KH-HSX4SM5Z.js/+esm"),"./locales/ko-KR.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/ko-KR-MTYHY66A.js/+esm"),"./locales/ku-TR.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/ku-TR-6OUDTVRD.js/+esm"),"./locales/lt-LT.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/lt-LT-XHIRWOB4.js/+esm"),"./locales/lv-LV.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/lv-LV-5QDEKY6T.js/+esm"),"./locales/mr-IN.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/mr-IN-CRQNXWMA.js/+esm"),"./locales/my-MM.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/my-MM-5M5IBNSE.js/+esm"),"./locales/nb-NO.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/nb-NO-T6EIAALU.js/+esm"),"./locales/nl-NL.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/nl-NL-IS3SIHDZ.js/+esm"),"./locales/nn-NO.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/nn-NO-6E72VCQL.js/+esm"),"./locales/oc-FR.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/oc-FR-POXYY2M6.js/+esm"),"./locales/pa-IN.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/pa-IN-N4M65BXN.js/+esm"),"./locales/percentages.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/percentages-BXMCSKIN.js/+esm"),"./locales/pl-PL.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/pl-PL-T2D74RX3.js/+esm"),"./locales/pt-BR.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/pt-BR-5N22H2LF.js/+esm"),"./locales/pt-PT.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/pt-PT-UZXXM6DQ.js/+esm"),"./locales/ro-RO.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/ro-RO-JPDTUUEW.js/+esm"),"./locales/ru-RU.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/ru-RU-B4JR7IUQ.js/+esm"),"./locales/si-LK.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/si-LK-N5RQ5JYF.js/+esm"),"./locales/sk-SK.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/sk-SK-C5VTKIMK.js/+esm"),"./locales/sl-SI.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/sl-SI-NN7IZMDC.js/+esm"),"./locales/sv-SE.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/sv-SE-XGPEYMSR.js/+esm"),"./locales/ta-IN.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/ta-IN-2NMHFXQM.js/+esm"),"./locales/th-TH.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/th-TH-HPSO5L25.js/+esm"),"./locales/tr-TR.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/tr-TR-DEFEU3FU.js/+esm"),"./locales/uk-UA.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/uk-UA-QMV73CPH.js/+esm"),"./locales/vi-VN.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/vi-VN-M7AON7JQ.js/+esm"),"./locales/zh-CN.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/zh-CN-LNUGB5OW.js/+esm"),"./locales/zh-HK.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/zh-HK-E62DVLB3.js/+esm"),"./locales/zh-TW.json":()=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/locales/zh-TW-RAJ6MFWO.js/+esm")}),CM=85,Qi={code:"en",label:"English"},Ho=[Qi,...[{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=>xM[e.code]>=CM).sort((e,t)=>e.label>t.label?1:-1)],Xo="__test__";me.DEV&&Ho.unshift({code:Xo,label:"test language"},{code:`${Xo}.rtl`,label:"\u202Atest language (rtl)\u202C",rtl:!0});var $l=Qi,Wo={},U2=async e=>{if($l=e,document.documentElement.dir=$l.rtl?"rtl":"ltr",document.documentElement.lang=$l.code,e.code.startsWith(Xo))Wo={};else try{Wo=await MM(`./locales/${$l.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),Wo=c2}Ga.set(p2,e.code)},Yr=()=>$l,f2=(e,t)=>{for(let a=0;a<t.length;++a){let n=t[a];if(e[n]===void 0)return;e=e[n]}if(typeof e=="string")return e},E=(e,t,a)=>{if($l.code.startsWith(Xo))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let n=e.split("."),i=f2(Wo,n)||f2(c2,n)||a;if(i===void 0){let l=`Can't find translation for ${e}`;return console.warn(l),""}if(t)for(let l in t)i=i.replace(`{{${l}}}`,String(t[l]));return i},p2=Lt(Qi.code),Rt=()=>{let e=u2(p2);return{t:E,langCode:e}},kM=({size:e="1em",circleWidth:t=8,synchronized:a=!1,className:n=""})=>{let i=-(ee.useRef(Date.now()).current%1600);return h("div",{className:`Spinner ${n}`,children:h("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":a?`${i}ms`:0},children:h("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},Wn=kM,m2=({delay:e,theme:t})=>{let[a,n]=se(!!e);return ae(()=>{if(!e)return;let i=setTimeout(()=>{n(!1)},e);return()=>clearTimeout(i)},[e]),a?null:M("div",{className:Q("LoadingMessage",{"LoadingMessage--dark":t===Se.DARK}),children:[h("div",{children:h(Wn,{})}),h("div",{className:"LoadingMessage-text",children:E("labels.loadingScene")})]})},IM=e=>{let[t,a]=se(!0);return ae(()=>{let n=async()=>{await U2(i),a(!1)},i=Ho.find(l=>l.code===e.langCode)||Qi;n()},[e.langCode]),t?h(m2,{theme:e.theme}):e.children},Me=ee.forwardRef(({size:e="medium",visible:t=!0,className:a="",...n},i)=>{let{id:l}=vn(),r=ee.useRef(null);ee.useImperativeHandle(i,()=>r.current);let o=`ToolIcon_size_${e}`,[d,u]=se(!1),s=re(!0),c=async f=>{let p="onClick"in n&&n.onClick?.(f);if(ur(p))try{u(!0),await p}catch(m){if(m instanceof Qs)console.warn(m);else throw m}finally{s.current&&u(!1)}};ae(()=>(s.current=!0,()=>{s.current=!1}),[]);let U=re(null);if(n.type==="button"||n.type==="icon"||n.type==="submit"){let f=n.type==="icon"?"button":n.type;return M("button",{className:Q("ToolIcon_type_button",o,a,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:f,onClick:c,ref:r,disabled:d||n.isLoading||!!n.disabled,children:[(n.icon||n.label)&&M("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!n.disabled,children:[n.icon||n.label,n.keyBindingLabel&&h("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel}),n.isLoading&&h(Wn,{})]}),n.showAriaLabel&&M("div",{className:"ToolIcon__label",children:[n["aria-label"]," ",d&&h(Wn,{})]}),n.children]})}return M("label",{className:Q("ToolIcon",a),title:n.title,onPointerDown:f=>{U.current=f.pointerType||null,n.onPointerDown?.({pointerType:f.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{U.current=null})},children:[h("input",{className:`ToolIcon_type_radio ${o}`,type:"radio",name:n.name,"aria-label":n["aria-label"],"aria-keyshortcuts":n["aria-keyshortcuts"],"data-testid":n["data-testid"],id:`${l}-${n.id}`,onChange:()=>{n.onChange?.({pointerType:U.current})},checked:n.checked,ref:r}),M("div",{className:"ToolIcon__icon",children:[n.icon,n.keyBindingLabel&&h("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel})]})]})});Me.displayName="ToolButton";var TM=(e,t,a)=>{let n=new Set(be(e.filter(s=>de(s)),t).map(s=>s.id)),i={},l=a.scene.getNonDeletedElementsMap(),r=new Set;for(let s of n){let c=mn(e,s);for(let U of c)if(!r.has(U.id)){if(Ye(U)){let f=Tt(U,l);f&&(i[f.id]=!0)}else i[U.id]=!0;r.add(U.id)}}let o=!0,d=e.map(s=>{if(t.selectedElementIds[s.id]){let c=Ye(s)?Tt(s,l):null;return s.frameId&&n.has(s.frameId)?(o=!1,i[s.id]=!0,s):c?.frameId&&n.has(c?.frameId)?s:(s.boundElements&&s.boundElements.forEach(U=>{let f=a.scene.getNonDeletedElementsMap().get(U.id);f&&q(f)&&(F(f,{startBinding:s.id===f.startBinding?.elementId?null:f.startBinding,endBinding:s.id===f.endBinding?.elementId?null:f.endBinding}),F(f,{points:f.points}))}),fe(s,{isDeleted:!0}))}return s.frameId&&n.has(s.frameId)?(o=!1,Ye(s)||(i[s.id]=!0),fe(s,{frameId:null})):Ye(s)&&t.selectedElementIds[s.containerId]?fe(s,{isDeleted:!0}):s}),u=t.editingGroupId;if(o&&t.editingGroupId){let s=je(d,t.editingGroupId).filter(c=>!c.isDeleted);if(s.length>1)s[0]&&(i[s[0].id]=!0);else{u=null,s[0]&&(i[s[0].id]=!0);let c=s[0];if(c){let U=c.groupIds.findIndex(p=>p===t.editingGroupId),f=c.groupIds[U+1];if(f){let p=je(d,f).filter(m=>!m.isDeleted);p.length>1&&(u=f,p.forEach(m=>{i[m.id]=!0}))}}}}return{elements:d,appState:{...t,...Xt({selectedElementIds:i,editingGroupId:u},d,t,null)}}},g2=(e,t)=>{if(e.editingGroupId){let a=je(ze(t),e.editingGroupId);if(a.length)return{...e,selectedElementIds:{[a[0].id]:!0}}}return e},b2=V({name:"deleteSelectedElements",label:"labels.delete",icon:Bi,trackEvent:{category:"element",action:"delete"},perform:(e,t,a,n)=>{if(t.editingLinearElement){let{elementId:r,selectedPointsIndices:o,startBindingElement:d,endBindingElement:u}=t.editingLinearElement,s=n.scene.getNonDeletedElementsMap(),c=Z.getElement(r,s);if(!c||o==null)return!1;if(c.points.length<2){let f=e.map(m=>m.id===c.id?fe(m,{isDeleted:!0}):m),p=g2(t,f);return{elements:f,appState:{...p,editingLinearElement:null},captureUpdate:B.IMMEDIATELY}}let U={startBindingElement:o?.includes(0)?null:d,endBindingElement:o?.includes(c.points.length-1)?null:u};return Z.deletePoints(c,o),{elements:e,appState:{...t,editingLinearElement:{...t.editingLinearElement,...U,selectedPointsIndices:o?.[0]>0?[o[0]-1]:[0]}},captureUpdate:B.IMMEDIATELY}}let{elements:i,appState:l}=TM(e,t,n);return Wf(i,i.filter(r=>r.isDeleted)),l=g2(l,i),{elements:i,appState:{...l,activeTool:ft(t,{type:"selection"}),multiElement:null,activeEmbeddable:null},captureUpdate:yt(ze(e),t)?B.IMMEDIATELY:B.EVENTUALLY}},keyTest:(e,t,a)=>(e.key===L.BACKSPACE||e.key===L.DELETE)&&!e[L.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:a})=>h(Me,{type:"button",icon:Bi,title:E("labels.delete"),"aria-label":E("labels.delete"),onClick:()=>a(null),visible:yt(ze(e),t)})}),Fh=(e,t)=>e.frameId===t||e.id===t,y2=(e,t,a)=>{let n=[],i=[],l=null,r=-1,o=oe(a||be(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++r<e.length;){let d=e[r];o.get(d.id)?(i.length&&(n=n.concat(i),i=[]),n.push(r),l=r+1):d.isDeleted&&l===r?(l=r+1,i.push(r)):i=[]}return n},LM=e=>{let t=0;return e.reduce((a,n,i)=>(i>0&&e[i-1]!==n-1&&(t=++t),(a[t]||(a[t]=[])).push(n),a),[])},v2=(e,t,a)=>{if("containerId"in e&&e.containerId){let n=Hn.getScene(e).getElement(e.containerId);if(n)return a==="left"?Math.min(t.indexOf(n),t.indexOf(e)):Math.max(t.indexOf(n),t.indexOf(e))}else{let n=e.boundElements?.find(i=>i.type!=="arrow")?.id;if(n){let i=Hn.getScene(e).getElement(n);if(i)return a==="left"?Math.min(t.indexOf(i),t.indexOf(e)):Math.max(t.indexOf(i),t.indexOf(e))}}},DM=(e,t)=>{let a=-1,n=-1;return e.forEach((i,l)=>{Fh(i,t)&&(a===-1&&(a=l),n=l)}),a===-1?[]:e.slice(a,n+1)},AM=(e,t,a,n,i)=>{let l=t[a],r=c=>c.isDeleted?!1:i?c.frameId===i:e.editingGroupId?c.groupIds.includes(e.editingGroupId):!0,o=n==="left"?Ai(t,c=>r(c),Math.max(0,a-1)):Wu(t,c=>r(c),a+1),d=t[o];if(!d)return-1;if(e.editingGroupId){if(l?.groupIds.join("")===d?.groupIds.join(""))return v2(d,t,n)??o;if(!d?.groupIds.includes(e.editingGroupId))return-1}if(!i&&(d.frameId||de(d))){let c=DM(t,d.frameId||d.id);return n==="left"?t.indexOf(c[0]):t.indexOf(c[c.length-1])}if(!d.groupIds.length)return v2(d,t,n)??o;let u=e.editingGroupId?d.groupIds[d.groupIds.indexOf(e.editingGroupId)-1]:d.groupIds[d.groupIds.length-1],s=je(t,u);return s.length?n==="left"?t.indexOf(s[0]):t.indexOf(s[s.length-1]):o},w2=(e,t)=>t.reduce((a,n)=>{let i=e[n];return a.set(i.id,i),a},new Map),E2=(e,t,a)=>{let n=y2(e,t),i=w2(e,n),l=LM(n);a==="right"&&(l=l.reverse());let r=new Set(n.filter(o=>de(e[o])).map(o=>e[o].id));return l.forEach((o,d)=>{let u=o[0],s=o[o.length-1],c=a==="left"?u:s,U=o.some(v=>{let b=e[v];return b.frameId&&r.has(b.frameId)})?null:e[c]?.frameId,f=AM(t,e,c,a,U);if(f===-1||c===f)return;let p=a==="left"?e.slice(0,f):e.slice(0,u),m=e.slice(u,s+1),g=a==="left"?e.slice(f,u):e.slice(s+1,f+1),y=a==="left"?e.slice(s+1):e.slice(f+1);e=a==="left"?[...p,...m,...g,...y]:[...p,...g,...m,...y]}),un(e,i),e},x2=(e,t,a,n,i)=>{let l=y2(e,t,i),r=w2(e,l),o=[],d,u;if(a==="left"){if(n)d=Wu(e,p=>Fh(p,n));else if(t.editingGroupId){let p=je(e,t.editingGroupId);if(!p.length)return e;d=e.indexOf(p[0])}else d=0;u=l[l.length-1]}else{if(n)u=Ai(e,p=>Fh(p,n));else if(t.editingGroupId){let p=je(e,t.editingGroupId);if(!p.length)return e;u=e.indexOf(p[p.length-1])}else u=e.length-1;d=l[0]}d===-1&&(d=0);for(let p=d;p<u+1;p++)l.includes(p)||o.push(e[p]);let s=Array.from(r.values()),c=e.slice(0,d),U=e.slice(u+1),f=a==="left"?[...c,...s,...o,...U]:[...c,...o,...s,...U];return un(f,r),f};function S2(e,t,a,n){let i=oe(be(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),l={regularElements:[],frameChildren:new Map},r=new Set;for(let u of e)i.has(u.id)&&de(u)&&r.add(u.id);for(let u of e)if(i.has(u.id))if(de(u)||u.frameId&&r.has(u.frameId))l.regularElements.push(u);else if(!u.frameId)l.regularElements.push(u);else{let s=l.frameChildren.get(u.frameId)||[];s.push(u),l.frameChildren.set(u.frameId,s)}let o=e,d=Array.from(l.frameChildren.entries());for(let[u,s]of d)o=n(e,t,a,u,s);return n(o,t,a,null,l.regularElements)}var RM=(e,t)=>E2(e,t,"left"),NM=(e,t)=>E2(e,t,"right"),PM=(e,t)=>S2(e,t,"left",x2),_M=(e,t)=>S2(e,t,"right",x2),OM=V({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:yU,trackEvent:{category:"element"},perform:(e,t)=>({elements:RM(e,t),appState:t,captureUpdate:B.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[L.CTRL_OR_CMD]&&!e.shiftKey&&e.code===ke.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>h("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${E("labels.sendBackward")} \u2014 ${z("CtrlOrCmd+[")}`,children:yU})}),BM=V({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:bU,trackEvent:{category:"element"},perform:(e,t)=>({elements:NM(e,t),appState:t,captureUpdate:B.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[L.CTRL_OR_CMD]&&!e.shiftKey&&e.code===ke.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>h("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${E("labels.bringForward")} \u2014 ${z("CtrlOrCmd+]")}`,children:bU})}),zM=V({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:wU,trackEvent:{category:"element"},perform:(e,t)=>({elements:PM(e,t),appState:t,captureUpdate:B.IMMEDIATELY}),keyTest:e=>en?e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.BRACKET_LEFT:e[L.CTRL_OR_CMD]&&e.shiftKey&&e.code===ke.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>h("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${E("labels.sendToBack")} \u2014 ${z(en?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")}`,children:wU})}),FM=V({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:vU,trackEvent:{category:"element"},perform:(e,t)=>({elements:_M(e,t),appState:t,captureUpdate:B.IMMEDIATELY}),keyTest:e=>en?e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.BRACKET_RIGHT:e[L.CTRL_OR_CMD]&&e.shiftKey&&e.code===ke.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>h("button",{type:"button",className:"zIndexButton",onClick:a=>e(null),title:`${E("labels.bringToFront")} \u2014 ${z(en?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")}`,children:vU})}),$M=V({name:"selectAll",label:"labels.selectAll",icon:X3,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,a,n)=>{if(t.editingLinearElement)return!1;let i=e.filter(l=>!l.isDeleted&&!(j(l)&&l.containerId)&&!l.locked).reduce((l,r)=>(l[r.id]=!0,l),{});return{appState:{...t,...Xt({editingGroupId:null,selectedElementIds:i},ze(e),t,n),selectedLinearElement:Object.keys(i).length===1&&he(e[0])?new Z(e[0]):null},captureUpdate:B.IMMEDIATELY}},keyTest:e=>e[L.CTRL_OR_CMD]&&e.key===L.A}),HM=e=>{let t=e.slice(),a=new Set,n=l=>{let r=l[0]?.groupIds?.join(""),o=[l[0]],d=[];for(let u of l.slice(1))u.groupIds?.join("")===r?o.push(u):d.push(u);return d.length?[...o,...n(d)]:o},i=new Map;return t.forEach((l,r)=>{if(!i.has(l.id))if(l.groupIds?.length){let o=l.groupIds[l.groupIds.length-1],d=t.slice(r).filter(u=>{let s=u?.groupIds?.some(c=>c===o);return s&&i.set(u.id,!0),s});for(let u of n(d))a.add(u)}else a.add(l)}),a.size!==e.length?(console.error("normalizeGroupElementOrder: lost some elements... bailing!"),e):[...a]},XM=e=>{let t=X7(e),a=e.slice(),n=new Set;return a.forEach((i,l)=>{i&&(i.boundElements?.length?(n.add(i),a[l]=null,i.boundElements.forEach(r=>{let o=t.get(r.id);o&&r.type==="text"&&(n.add(o[0]),a[o[1]]=null)})):i.type==="text"&&i.containerId&&t.get(i.containerId)?.[0].boundElements?.find(r=>r.id===i.id)||(n.add(i),a[l]=null))}),n.size!==e.length?(console.error("normalizeBoundElementsOrder: lost some elements... bailing!"),e):[...n]},WM=e=>XM(HM(e)),GM=V({name:"duplicateSelection",label:"labels.duplicateSelection",icon:ac,trackEvent:{category:"element"},perform:(e,t,a,n)=>{if(t.editingLinearElement)try{let l=Z.duplicateSelectedPoints(t,n.scene.getNonDeletedElementsMap());return{elements:e,appState:l,captureUpdate:B.IMMEDIATELY}}catch{return!1}let i=VM(e,t);if(n.props.onDuplicate&&i.elements){let l=n.props.onDuplicate(i.elements,e);l&&(i.elements=l)}return{...i,captureUpdate:B.IMMEDIATELY}},keyTest:e=>e[L.CTRL_OR_CMD]&&e.key===L.D,PanelComponent:({elements:e,appState:t,updateData:a})=>h(Me,{type:"button",icon:ac,title:`${E("labels.duplicateSelection")} \u2014 ${z("CtrlOrCmd+D")}`,"aria-label":E("labels.duplicateSelection"),onClick:()=>a(null),visible:yt(ze(e),t)})}),VM=(e,t)=>{let a=new Map,n=[],i=[],l=new Map,r=new Map,o=oe(e),d=m=>{let g=Ju(m).reduce((y,v)=>{if(s.has(v.id))return y;s.set(v.id,!0);let b=m0(t.editingGroupId,a,v,{x:v.x+Ss/2,y:v.y+Ss/2});return s.set(b.id,!0),r.set(b.id,b),l.set(v.id,b.id),i.push(v),n.push(b),y.push(b),y},[]);return Array.isArray(m)?g:g[0]||null};e=WM(e);let u=oe(be(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),s=new Map,c=e.slice(),U=(m,g)=>{Bt(m!==-1,"targetIndex === -1 "),!(!Array.isArray(g)&&!g)&&c.splice(m+1,0,...Ju(g))},f=new Set(e.filter(m=>u.has(m.id)&&de(m)).map(m=>m.id));for(let m of e){if(s.has(m.id)||!u.has(m.id))continue;let g=Zf(t,m);if(g){let y=je(e,g).flatMap(b=>de(b)?[...mn(e,b.id),b]:[b]),v=Ai(c,b=>b.groupIds?.includes(g));U(v,d(y));continue}if(!(m.frameId&&f.has(m.frameId))){if(de(m)){let y=m.id,v=mn(e,y),b=Ai(c,x=>x.frameId===y||x.id===y);U(b,d([...v,m]));continue}if(wa(m)){let y=pe(m,o),v=Ai(c,b=>b.id===m.id||"containerId"in b&&b.containerId===m.id);y?U(v,d([m,y])):U(v,d(m));continue}if(Ye(m)){let y=Tt(m,o),v=Ai(c,b=>b.id===m.id||b.id===y?.id);y?U(v,d([y,m])):U(v,d(m));continue}U(Ai(c,y=>y.id===m.id),d(m))}}i0(c,i,l),Hf(c,i,l),xp(c,i,l);let p=vh(n);return{elements:c,appState:{...t,...Xt({editingGroupId:t.editingGroupId,selectedElementIds:p.reduce((m,g)=>(Ye(g)||(m[g.id]=!0),m),{})},ze(c),t,null)}}},YM=new Set(["command_palette","export"]),Ge=(e,t,a,n)=>{try{if(typeof window>"u"||me.VITE_WORKER_ID||me.VITE_APP_ENABLE_TRACKING!=="true"||!YM.has(e)||me.DEV)return;me.PROD||console.info("trackEvent",{category:e,action:t,label:a,value:n}),window.sa_event&&window.sa_event(t,{category:e,label:a,value:n})}catch(i){console.error("error during analytics",i)}},M2=xi((e,t)=>{let{title:a,className:n,testId:i,active:l,standalone:r,icon:o,onClick:d}=e;return h("button",{type:"button",ref:t,title:a,"data-testid":i,className:Q(n,{standalone:r,active:l}),onClick:d,children:o},a)}),gn=e=>h("div",{className:"buttonList",children:e.options.map(t=>e.type==="button"?h(M2,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:a=>e.onClick(t.value,a)},t.text):M("label",{className:Q({active:e.value===t.value}),title:t.text,children:[h("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))}),jM=({onChange:e,type:t,activeColor:a,topPicks:n})=>{let i;return t==="elementStroke"&&(i=Uu),t==="elementBackground"&&(i=fu),t==="canvasBackground"&&(i=pu),n&&(i=n),i?h("div",{className:"color-picker__top-picks",children:i.map(l=>h("button",{className:Q("color-picker__button",{active:l===a,"is-transparent":l==="transparent"||!l}),style:{"--swatch-color":l},type:"button",title:l,onClick:()=>e(l),"data-testid":`color-top-pick-${l}`,children:h("div",{className:"color-picker__button-outline"})},l))}):(console.error("Invalid type for TopPicks"),null)},C2=()=>h("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}}),Go=({palette:e,color:t})=>{for(let[a,n]of Object.entries(e))if(Array.isArray(n)){let i=n.indexOf(t);if(i>-1)return{colorName:a,shade:i}}else if(n===t)return{colorName:a,shade:null};return null},$h=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),k2=({color:e,palette:t})=>!Object.values(t).flat().includes(e),ZM=(e,t,a)=>{let n={elementBackground:"backgroundColor",elementStroke:"strokeColor"},i=e.filter(r=>{if(r.isDeleted)return!1;let o=r[n[t]];return k2({color:o,palette:a})}),l=new Map;return i.forEach(r=>{let o=r[n[t]];l.has(o)?l.set(o,l.get(o)+1):l.set(o,1)}),[...l.entries()].sort((r,o)=>o[1]-r[1]).map(r=>r[0]).slice(0,Bg)},Hl=Lt(null),I2=(e,t,a)=>(e*299+t*587+a*114)/1e3>=160?"black":"white",KM=(e,t)=>{if(t){let l=new Option().style;if(l.color=e,l.color){let r=l.color.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(","),o=parseInt(r[0]),d=parseInt(r[1]),u=parseInt(r[2]);return I2(o,d,u)}}if(e==="transparent")return"black";let a=parseInt(e.substring(1,3),16),n=parseInt(e.substring(3,5),16),i=parseInt(e.substring(5,7),16);return I2(a,n,i)},qM=({color:e,keyLabel:t,isCustomColor:a=!1,isShade:n=!1})=>M("div",{className:"color-picker__button__hotkey-label",style:{color:KM(e,a)},children:[n&&"\u21E7",t]}),Hh=qM,JM=({hex:e,onChange:t,palette:a})=>{let n=Go({color:e||"transparent",palette:a}),[i,l]=st(Hl),r=re(null);if(ae(()=>{r.current&&i==="shades"&&r.current.focus()},[n,i]),n){let{colorName:o,shade:d}=n,u=a[o];if(Array.isArray(u))return h("div",{className:"color-picker-content--default shades",children:u.map((s,c)=>M("button",{ref:c===d&&i==="shades"?r:void 0,tabIndex:-1,type:"button",className:Q("color-picker__button color-picker__button--large",{active:c===d}),"aria-label":"Shade",title:`${o} - ${c+1}`,style:s?{"--swatch-color":s}:void 0,onClick:()=>{t(s),l("shades")},children:[h("div",{className:"color-picker__button-outline"}),h(Hh,{color:s,keyLabel:c+1,isShade:!0})]},c))})}return M("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[h("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),h("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:E("colorPicker.noShades")})]})},QM=({palette:e,color:t,onChange:a,label:n,activeShade:i})=>{let l=Go({color:t||"transparent",palette:e}),[r,o]=st(Hl),d=re(null);return ae(()=>{d.current&&r==="baseColors"&&d.current.focus()},[l?.colorName,r]),h("div",{className:"color-picker-content--default",children:Object.entries(e).map(([u,s],c)=>{let U=(Array.isArray(s)?s[i]:s)||"transparent",f=$h[c],p=E(`colors.${u.replace(/\d+/,"")}`,null,"");return M("button",{ref:l?.colorName===u?d:void 0,tabIndex:-1,type:"button",className:Q("color-picker__button color-picker__button--large",{active:l?.colorName===u,"is-transparent":U==="transparent"||!U}),onClick:()=>{a(U),o("baseColors")},title:`${p}${U.startsWith("#")?` ${U}`:""} \u2014 ${f}`,"aria-label":`${p} \u2014 ${f}`,style:{"--swatch-color":U},"data-testid":`color-${u}`,children:[h("div",{className:"color-picker__button-outline"}),h(Hh,{color:U,keyLabel:f})]},u)})})},eC=QM,tC=({colors:e,color:t,onChange:a,label:n})=>{let[i,l]=st(Hl),r=re(null);return ae(()=>{r.current&&r.current.focus()},[t,i]),h("div",{className:"color-picker-content--default",children:e.map((o,d)=>M("button",{ref:t===o?r:void 0,tabIndex:-1,type:"button",className:Q("color-picker__button color-picker__button--large",{active:t===o,"is-transparent":o==="transparent"||!o}),onClick:()=>{a(o),l("custom")},title:o,"aria-label":n,style:{"--swatch-color":o},children:[h("div",{className:"color-picker__button-outline"}),h(Hh,{color:o,keyLabel:d+1,isCustomColor:!0})]},d))})},Xh=(e,t,a)=>{let n=Math.ceil(a/sl);switch(t=t??-1,e){case"ArrowLeft":{let i=t-1;return i<0?a-1:i}case"ArrowRight":return(t+1)%a;case"ArrowDown":{let i=t+sl;return i>=a?t%sl:i}case"ArrowUp":{let i=t-sl,l=i<0?sl*n+i:i;return l>=a?void 0:l}}},aC=({e,colorObj:t,onChange:a,palette:n,customColors:i,setActiveColorPickerSection:l,activeShade:r})=>{if(t?.shade!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let o=Number(e.code.slice(-1))-1;return a(n[t.colorName][o]),l("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&i[Number(e.key)-1])return a(i[Number(e.key)-1]),l("custom"),!0;if($h.includes(e.key)){let o=$h.indexOf(e.key),d=Object.keys(n)[o],u=n[d],s=Array.isArray(u)?u[r]:u;return a(s),l("baseColors"),!0}return!1},nC=({event:e,activeColorPickerSection:t,palette:a,color:n,onChange:i,customColors:l,setActiveColorPickerSection:r,updateData:o,activeShade:d,onEyeDropperToggle:u,onEscape:s})=>{if(e[L.CTRL_OR_CMD])return!1;if(e.key===L.ESCAPE)return s(e),!0;if(e.key===L.ALT)return u(!0),!0;if(e.key===L.I)return u(),!0;let c=Go({color:n,palette:a});if(e.key===L.TAB){let U={custom:!!l.length,baseColors:!0,shades:c?.shade!=null,hex:!0},f=Object.entries(U).reduce((v,[b,x])=>(x&&v.push(b),v),[]),p=f.indexOf(t),m=e.shiftKey?-1:1,g=p+m>f.length-1?0:p+m<0?f.length-1:p+m,y=f[g];return y&&r(y),y==="custom"?i(l[0]):y==="baseColors"&&(Object.entries(a).find(([v,b])=>Array.isArray(b)?b.includes(n):b===n?v:null)||i(ye.black)),e.preventDefault(),e.stopPropagation(),!0}if(aC({e,colorObj:c,onChange:i,palette:a,customColors:l,setActiveColorPickerSection:r,activeShade:d}))return!0;if(t==="shades"&&c){let{shade:U}=c,f=Xh(e.key,U,sl);if(f!==void 0)return i(a[c.colorName][f]),!0}if(t==="baseColors"&&c){let{colorName:U}=c,f=Object.keys(a),p=f.indexOf(U),m=Xh(e.key,p,f.length);if(m!==void 0){let g=f[m],y=a[g];return i(Array.isArray(y)?y[d]:y),!0}}if(t==="custom"){let U=l.indexOf(n),f=Xh(e.key,U,l.length);if(f!==void 0){let p=l[f];return i(p),!0}}return!1},iC=({children:e})=>h("div",{className:"color-picker__heading",children:e}),Vo=iC,lC=({color:e,onChange:t,label:a,type:n,elements:i,palette:l,updateData:r,children:o,onEyeDropperToggle:d,onEscape:u})=>{let[s]=ee.useState(()=>n==="canvasBackground"?[]:ZM(i,n,l)),[c,U]=st(Hl),f=Go({color:e,palette:l});ae(()=>{if(!c){let y=k2({color:e,palette:l}),v=y&&!s.includes(e);U(v?"hex":y?"custom":f?.shade!=null?"shades":"baseColors")}},[c,e,l,U,f,s]);let[p,m]=se(f?.shade??(n==="elementBackground"?Jl:ql));ae(()=>{f?.shade!=null&&m(f.shade);let y=v=>{v.key===L.ALT&&d(!1)};return document.addEventListener("keyup",y,{capture:!0}),()=>{document.removeEventListener("keyup",y,{capture:!0})}},[f,d]);let g=ee.useRef(null);return h("div",{role:"dialog","aria-modal":"true","aria-label":E("labels.colorPicker"),children:M("div",{ref:g,onKeyDown:y=>{nC({event:y,activeColorPickerSection:c,palette:l,color:e,onChange:t,onEyeDropperToggle:d,customColors:s,setActiveColorPickerSection:U,updateData:r,activeShade:p,onEscape:u})&&(y.preventDefault(),y.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[!!s.length&&M("div",{children:[h(Vo,{children:E("colorPicker.mostUsedCustomColors")}),h(tC,{colors:s,color:e,label:E("colorPicker.mostUsedCustomColors"),onChange:t})]}),M("div",{children:[h(Vo,{children:E("colorPicker.colors")}),h(eC,{color:e,label:a,palette:l,onChange:t,activeShade:p})]}),M("div",{children:[h(Vo,{children:E("colorPicker.shades")}),h(JM,{hex:e,onChange:t,palette:l})]}),o]})})},T2=ee.createContext(null),Nt=()=>ee.useContext(T2),L2=e=>{let[t,a]=se(null),n=vt(),{theme:i}=Nt(),{container:l}=vn();return Ia(()=>{t&&(t.className="",t.classList.add("excalidraw",...e?.className?.split(/\s+/)||[]),t.classList.toggle("excalidraw--mobile",n.editor.isMobile),t.classList.toggle("theme--dark",i===Se.DARK))},[t,i,n.editor.isMobile,e?.className]),Ia(()=>{let r=e?.parentSelector?l?.querySelector(e.parentSelector):document.body;if(!r)return;let o=document.createElement("div");return r.appendChild(o),a(o),()=>{r.removeChild(o)}},[l,e?.parentSelector]),t};function Wh(e,t,a){ae(()=>{function n(i){let l=i;if(!e.current)return;let r=a?.(l,e.current);if(r!==!0){if(r===!1)return t(l);e.current.contains(l.target)||!document.documentElement.contains(l.target)||l.target.closest("[data-radix-portal]")||l.target===document.documentElement&&document.body.style.pointerEvents==="none"||l.target.closest("[data-prevent-outside-click]")||t(l)}}return document.addEventListener("pointerdown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("pointerdown",n),document.removeEventListener("touchstart",n)}},[e,t,a])}var Yo=e=>{let t=re(e);return Object.assign(t.current,e),t.current},jo=Lt(null),rC=({onCancel:e,onChange:t,onSelect:a,colorPickerType:n})=>{let i=L2({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),l=Nt(),r=gd(),o=Ka(),d=be(r,l),u=Yo({app:o,onCancel:e,onChange:t,onSelect:a,selectedElements:d}),{container:s}=vn();ae(()=>{let U=c.current;if(!U||!o.canvas||!i)return;let f=!1,p=o.canvas.getContext("2d"),m=({clientX:C,clientY:T})=>{let k=p.getImageData((C-l.offsetLeft)*window.devicePixelRatio,(T-l.offsetTop)*window.devicePixelRatio,1,1).data;return Xg(k[0],k[1],k[2])},g=({clientX:C,clientY:T,altKey:k})=>{U.style.top=`${T+20}px`,U.style.left=`${C+20}px`;let R=m({clientX:C,clientY:T});f&&u.onChange(n,R,u.selectedElements,{altKey:k}),U.style.background=R},y=()=>{u.onCancel()},v=(C,T)=>{u.onSelect(C,T)},b=C=>{f=!0,C.stopImmediatePropagation()},x=C=>{f=!1,s?.focus(),C.stopImmediatePropagation(),C.preventDefault(),v(m(C),C)},S=C=>{C.key===L.ESCAPE&&(C.preventDefault(),C.stopImmediatePropagation(),y())};return i.tabIndex=-1,i.focus(),g({clientX:u.app.lastViewportPosition.x,clientY:u.app.lastViewportPosition.y,altKey:!1}),i.addEventListener("keydown",S),i.addEventListener("pointerdown",b),i.addEventListener("pointerup",x),window.addEventListener("pointermove",g,{passive:!0}),window.addEventListener("blur",y),()=>{f=!1,i.removeEventListener("keydown",S),i.removeEventListener("pointerdown",b),i.removeEventListener("pointerup",x),window.removeEventListener("pointermove",g),window.removeEventListener("blur",y)}},[u,o.canvas,i,n,s,l.offsetLeft,l.offsetTop]);let c=re(null);return Wh(c,()=>{e()},U=>!!U.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),i?nu(h("div",{ref:c,className:"excalidraw-eye-dropper-preview"}),i):null},sC=({color:e,onChange:t,label:a,colorPickerType:n})=>{let i=vt(),[l,r]=se(e),[o,d]=st(Hl);ae(()=>{r(e)},[e]);let u=at(p=>{let m=p.toLowerCase(),g=oC(m);g&&t(g),r(m)},[t]),s=re(null),c=re(null);ae(()=>{s.current&&s.current.focus()},[o]);let[U,f]=st(jo);return ae(()=>()=>{f(null)},[f]),M("div",{className:"color-picker__input-label",children:[h("div",{className:"color-picker__input-hash",children:"#"}),h("input",{ref:o==="hex"?s:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":a,onChange:p=>{u(p.target.value)},value:(l||"").replace(/^#/,""),onBlur:()=>{r(e)},tabIndex:-1,onFocus:()=>d("hex"),onKeyDown:p=>{p.key!==L.TAB&&(p.key===L.ESCAPE&&c.current?.focus(),p.stopPropagation())}}),!i.editor.isMobile&&M(te,{children:[h("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),h("div",{ref:c,className:Q("excalidraw-eye-dropper-trigger",{selected:U}),onClick:()=>f(p=>p?null:{keepOpenOnAlt:!1,onSelect:m=>t(m),colorPickerType:n}),title:`${E("labels.eyeDropper")} \u2014 ${L.I.toLocaleUpperCase()} or ${z("Alt")} `,children:N3})]})]})},Va=ee.forwardRef(({children:e,padding:t,className:a,style:n},i)=>h("div",{className:Q("Island",a),style:{"--padding":t,...n},ref:i,children:e})),D2=ee.forwardRef(({className:e,container:t,children:a,style:n,onClose:i,onKeyDown:l,onFocusOutside:r,onPointerLeave:o,onPointerDownOutside:d},u)=>{let s=vt();return h(Jt.Portal,{container:t,children:M(Jt.Content,{ref:u,className:Q("focus-visible-none",e),"data-prevent-outside-click":!0,side:s.editor.isMobile&&!s.viewport.isLandscape?"bottom":"right",align:s.editor.isMobile&&!s.viewport.isLandscape?"center":"start",alignOffset:-16,sideOffset:20,style:{zIndex:"var(--zIndex-popup)"},onPointerLeave:o,onKeyDown:l,onFocusOutside:r,onPointerDownOutside:d,onCloseAutoFocus:c=>{c.stopPropagation(),c.preventDefault(),t&&!R7(document.activeElement)&&t.focus(),i()},children:[h(Va,{padding:3,style:n,children:a}),h(Jt.Arrow,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})}),A2=e=>{let t=new Option().style;return t.color=e,!!t.color},oC=e=>Pa(e)?e:A2(`#${e}`)?`#${e}`:A2(e)?e:null,dC=({type:e,color:t,onChange:a,label:n,elements:i,palette:l=ye,updateData:r})=>{let{container:o}=vn(),[,d]=st(Hl),[u,s]=st(jo),c=M("div",{children:[h(Vo,{children:E("colorPicker.hexCode")}),h(sC,{color:t,label:n,onChange:p=>{a(p)},colorPickerType:e})]}),U=re(null),f=()=>{U.current?.querySelector(".color-picker-content")?.focus()};return h(D2,{container:o,style:{maxWidth:"13rem"},onFocusOutside:p=>{f(),p.preventDefault()},onPointerDownOutside:p=>{u&&p.preventDefault()},onClose:()=>{r({openPopup:null}),d(null)},children:l?h(lC,{palette:l,color:t,onChange:p=>{a(p)},onEyeDropperToggle:p=>{s(m=>p?(m=m||{keepOpenOnAlt:!0,onSelect:a,colorPickerType:e},m.keepOpenOnAlt=!0,m):p===!1||m?null:{keepOpenOnAlt:!1,onSelect:a,colorPickerType:e})},onEscape:p=>{u?s(null):r({openPopup:null})},label:n,type:e,elements:i,updateData:r,children:c}):c})},cC=({label:e,color:t,type:a})=>h(Jt.Trigger,{type:"button",className:Q("color-picker__button active-color properties-trigger",{"is-transparent":t==="transparent"||!t}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:E(a==="elementStroke"?"labels.showStroke":"labels.showBackground"),children:h("div",{className:"color-picker__button-outline"})}),Gh=({type:e,color:t,onChange:a,label:n,elements:i,palette:l=ye,topPicks:r,updateData:o,appState:d})=>h("div",{children:M("div",{role:"dialog","aria-modal":"true",className:"color-picker-container",children:[h(jM,{activeColor:t,onChange:a,type:e,topPicks:r}),h(C2,{}),M(Jt.Root,{open:d.openPopup===e,onOpenChange:u=>{o({openPopup:u?e:null})},children:[h(cC,{color:t,label:n,type:e}),d.openPopup===e&&h(dC,{type:e,color:t,onChange:a,label:n,elements:i,palette:l,updateData:o})]})]})}),Zo=({icon:e})=>h("span",{style:{width:"1em",margin:"0 0.5ex 0 0.5ex",display:"inline-block",lineHeight:0,verticalAlign:"middle"},children:e}),hC=({label:e,open:t,openTrigger:a,children:n,className:i})=>M(te,{children:[M("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:i,onClick:a,children:[e,h(Zo,{icon:t?ib:$U})]}),t&&h("div",{style:{display:"flex",flexDirection:"column"},children:n})]}),Vh=hC,uC=Lt(!1);function UC({options:e,value:t,label:a,onChange:n,onClose:i,numberOfOptionsToAlwaysShow:l=e.length}){let r=vt(),o=f=>{let p=e.find(m=>m.keyBinding===f.key.toLowerCase());if(!(f.metaKey||f.altKey||f.ctrlKey)&&p)n(p.value),f.preventDefault();else if(f.key===L.TAB){let m=e.findIndex(y=>y.value===t),g=f.shiftKey?(e.length+m-1)%e.length:(m+1)%e.length;n(e[g].value)}else if(gr(f.key)){let m=Yr().rtl,g=e.findIndex(y=>y.value===t);if(g!==-1){let y=e.length,v=g;switch(f.key){case(m?L.ARROW_LEFT:L.ARROW_RIGHT):v=(g+1)%y;break;case(m?L.ARROW_RIGHT:L.ARROW_LEFT):v=(y+g-1)%y;break;case L.ARROW_DOWN:{v=(g+(l??1))%y;break}case L.ARROW_UP:{v=(y+g-(l??1))%y;break}}n(e[v].value)}f.preventDefault()}else(f.key===L.ESCAPE||f.key===L.ENTER)&&(f.preventDefault(),i());f.nativeEvent.stopImmediatePropagation(),f.stopPropagation()},[d,u]=st(uC),s=ee.useMemo(()=>e.slice(0,l),[e,l]),c=ee.useMemo(()=>e.slice(l),[e,l]);ae(()=>{s.some(f=>f.value===t)||u(!0)},[t,s,u]);let U=f=>h("div",{className:"picker-content",children:f.map((p,m)=>M("button",{type:"button",className:Q("picker-option",{active:t===p.value}),onClick:g=>{n(p.value)},title:`${p.text} ${p.keyBinding&&`\u2014 ${p.keyBinding.toUpperCase()}`}`,"aria-label":p.text||"none","aria-keyshortcuts":p.keyBinding||void 0,ref:g=>{t===p.value&&setTimeout(()=>{g?.focus()},0)},children:[p.icon,p.keyBinding&&h("span",{className:"picker-keybinding",children:p.keyBinding})]},p.text))});return h(Jt.Content,{side:r.editor.isMobile&&!r.viewport.isLandscape?"top":"bottom",align:"start",sideOffset:12,style:{zIndex:"var(--zIndex-popup)"},onKeyDown:o,children:M("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":a,children:[U(s),c.length>0&&h(Vh,{label:E("labels.more_options"),open:d,openTrigger:()=>{u(f=>!f)},className:"picker-collapsible",children:U(c)})]})})}function R2({value:e,label:t,options:a,onChange:n,group:i="",numberOfOptionsToAlwaysShow:l}){let[r,o]=ee.useState(!1),d=ee.useRef(null);return h("div",{children:M(Jt.Root,{open:r,onOpenChange:u=>o(u),children:[h(Jt.Trigger,{name:i,type:"button","aria-label":t,onClick:()=>o(!r),ref:d,className:r?"active":"",children:a.find(u=>u.value===e)?.icon}),r&&h(UC,{options:a,value:e,label:t,onChange:n,onClose:()=>{o(!1)},numberOfOptionsToAlwaysShow:l})]})})}var N2=ee.forwardRef(({className:e,placeholder:t,onChange:a},n)=>M("div",{className:Q("QuickSearch__wrapper",e),children:[zi,h("input",{ref:n,className:"QuickSearch__input",type:"text",placeholder:t,onChange:i=>a(i.target.value.trim().toLowerCase())})]})),P2=({className:e,placeholder:t,children:a})=>{let n=!j5.count(a);return h("div",{className:Q("ScrollableList__wrapper",e),role:"menu",children:n?h("div",{className:"empty",children:t}):a})},_2=({children:e,className:t="",style:a,title:n})=>M("div",{className:`dropdown-menu-group ${t}`,style:a,children:[n&&h("p",{className:"dropdown-menu-group-title",children:n}),e]}),Yh=_2;_2.displayName="DropdownMenuGroup";var O2=ee.createContext({}),B2=(e="",t=!1,a=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e}
  ${t?"dropdown-menu-item--selected":""} ${a?"dropdown-menu-item--hovered":""}`.trim(),z2=(e,t)=>{let a=Ja(O2);return Fs(e,n=>{let i=new CustomEvent("menu.itemSelect",{bubbles:!0,cancelable:!0});t?.(i),i.defaultPrevented||a.onSelect?.(i)})},fC=({textStyle:e,icon:t,shortcut:a,children:n})=>{let i=vt();return M(te,{children:[t&&h("div",{className:"dropdown-menu-item__icon",children:t}),h("div",{style:e,className:"dropdown-menu-item__text",children:n}),a&&!i.editor.isMobile&&h("div",{className:"dropdown-menu-item__shortcut",children:a})]})},F2=fC,jh=({icon:e,value:t,order:a,children:n,shortcut:i,className:l,hovered:r,selected:o,textStyle:d,onSelect:u,onClick:s,...c})=>{let U=z2(s,u),f=re(null);return ae(()=>{r&&(a===0?f.current?.scrollIntoView({block:"end"}):f.current?.scrollIntoView({block:"nearest"}))},[r,a]),h("button",{...c,ref:f,value:t,onClick:U,className:B2(l,o,r),title:c.title??c["aria-label"],children:h(F2,{textStyle:d,icon:e,shortcut:i,children:n})})};jh.displayName="DropdownMenuItem";var jr={GREEN:"green",RED:"red",BLUE:"blue"},Zh=({type:e=jr.BLUE,children:t})=>{let{theme:a}=ds(),n={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:a===Se.LIGHT?"1.5px solid white":"none"};switch(e){case jr.GREEN:Object.assign(n,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case jr.RED:Object.assign(n,{backgroundColor:"pink",color:"darkred"});break;case jr.BLUE:default:Object.assign(n,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return h("div",{className:"DropDownMenuItemBadge",style:n,children:t})};Zh.displayName="DropdownMenuItemBadge",jh.Badge=Zh;var Ma=jh,pC=({event:e,inputRef:t,hoveredFont:a,filteredFonts:n,onClose:i,onSelect:l,onHover:r})=>{if(!e[L.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===L.F)return t.current?.focus(),!0;if(e.key===L.ESCAPE)return i(),!0;if(e.key===L.ENTER)return a?.value&&l(a.value),!0;if(e.key===L.ARROW_DOWN)return a?.next?r(a.next.value):n[0]?.value&&r(n[0].value),!0;if(e.key===L.ARROW_UP)return a?.prev?r(a.prev.value):n[n.length-1]?.value&&r(n[n.length-1].value),!0},mC=ee.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:a,onHover:n,onLeave:i,onOpen:l,onClose:r})=>{let{container:o}=vn(),{fonts:d}=Ka(),{showDeprecatedFonts:u}=os(),[s,c]=se(""),U=re(null),f=mt(()=>Array.from(An.registered.entries()).filter(([k,{metadata:R}])=>!R.serverSide&&!R.fallback).map(([k,{metadata:R,fontFaces:D}])=>{let A={value:k,icon:R.icon??Ks,text:D[0]?.fontFace?.family??"Unknown"};return R.deprecated&&Object.assign(A,{deprecated:R.deprecated,badge:{type:jr.RED,placeholder:E("fontList.badge.old")}}),A}).sort((k,R)=>k.text.toLowerCase()>R.text.toLowerCase()?1:-1),[]),p=mt(()=>new Set(d.getSceneFamilies()),[e]),m=mt(()=>f.filter(k=>p.has(k.value)),[f,p]),g=mt(()=>f.filter(k=>!p.has(k.value)&&(u||!k.deprecated)),[f,p,u]),y=mt(()=>W7([...m,...g].filter(k=>k.text?.toLowerCase().includes(s))),[m,g,s]),v=mt(()=>{let k;return t?k=y.find(R=>R.value===t):e&&(k=y.find(R=>R.value===e)),!k&&s&&(y[0]?.value?n(y[0].value):i()),k},[t,e,s,y,n,i]),b=at(k=>{pC({event:k,inputRef:U,hoveredFont:v,filteredFonts:y,onSelect:a,onHover:n,onClose:r})&&(k.preventDefault(),k.stopPropagation())},[v,y,a,n,r]);ae(()=>(l(),()=>{r()}),[]);let x=mt(()=>y.filter(k=>p.has(k.value)),[y,p]),S=mt(()=>y.filter(k=>!p.has(k.value)),[y,p]),C=(k,R)=>M(Ma,{icon:k.icon,value:k.value,order:R,textStyle:{fontFamily:bl({fontFamily:k.value})},hovered:k.value===v?.value,selected:k.value===e,tabIndex:k.value===e?0:-1,onClick:D=>{a(Number(D.currentTarget.value))},onMouseMove:()=>{v?.value!==k.value&&n(k.value)},children:[k.text,k.badge&&h(Zh,{type:k.badge.type,children:k.badge.placeholder})]},k.value),T=[];return x.length&&T.push(h(Yh,{title:E("fontList.sceneFonts"),children:x.map(C)},"group_1")),S.length&&T.push(h(Yh,{title:E("fontList.availableFonts"),children:S.map((k,R)=>C(k,R+x.length))},"group_2")),M(D2,{className:"properties-content",container:o,style:{width:"15rem"},onClose:r,onPointerLeave:i,onKeyDown:b,children:[h(N2,{ref:U,placeholder:E("quickSearch.placeholder"),onChange:yl(c,20)}),h(P2,{className:"dropdown-menu fonts manual-hover",placeholder:E("fontList.empty"),children:T.length?T:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),gC=({selectedFontFamily:e})=>{let t=mt(()=>!!(e&&!yC(e)),[e]);return h(Jt.Trigger,{asChild:!0,children:h("div",{children:h(M2,{standalone:!0,icon:sU,title:E("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{}})})})},$2=[{value:Ke.Excalifont,icon:mr,text:E("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:Ke.Nunito,icon:Ks,text:E("labels.normal"),testId:"font-family-normal"},{value:Ke["Comic Shanns"],icon:dc,text:E("labels.code"),testId:"font-family-code"}],bC=new Set($2.map(e=>e.value)),yC=e=>e?bC.has(e):!1,vC=ee.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:a,onSelect:n,onHover:i,onLeave:l,onPopupChange:r})=>{let o=mt(()=>$2,[]),d=at(u=>{u&&n(u)},[n]);return M("div",{role:"dialog","aria-modal":"true",className:"FontPicker__container",children:[h(gn,{type:"button",options:o,value:t,onClick:d}),h(C2,{}),M(Jt.Root,{open:e,onOpenChange:r,children:[h(gC,{selectedFontFamily:t}),e&&h(mC,{selectedFontFamily:t,hoveredFontFamily:a,onSelect:d,onHover:i,onLeave:l,onOpen:()=>r(!0),onClose:()=>r(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),wC=({updateData:e,appState:t,elements:a,testId:n})=>{let i=ee.useRef(null),l=ee.useRef(null),r=Vt(a,t,o=>o.opacity,!0,t.currentItemOpacity);return ae(()=>{if(i.current&&l.current){let o=i.current,d=l.current,u=o.offsetWidth,s=15,c=r/100*(u-s)+s/2;d.style.left=`${c}px`,o.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${r}%, var(--button-bg) ${r}%, var(--button-bg) 100%)`}},[r]),M("label",{className:"control-label",children:[E("labels.opacity"),M("div",{className:"range-wrapper",children:[h("input",{ref:i,type:"range",min:"0",max:"100",step:"10",onChange:o=>{e(+o.target.value)},value:r,className:"range-input","data-testid":n}),h("div",{className:"value-bubble",ref:l,children:r!==0?r:null}),h("div",{className:"zero-label",children:"0"})]})]})},H2=.1,Gt=(e,t,a,n=!1)=>{let i=oe(be(e,t,{includeBoundTextElement:n}));return e.map(l=>i.get(l.id)||l.id===t.editingTextElement?.id?a(l):l)},Vt=function(e,t,a,n,i){let l=t.editingTextElement,r=ze(e),o=null;return l&&(o=a(l)),o||(yt(r,t)?o=sS(n===!0?r:r.filter(d=>n(d)),t,a)??(typeof i=="function"?i(!0):i):o=typeof i=="function"?i(!1):i),o},EC=(e,t)=>Ye(t)||!t.autoResize?t:F(t,{x:e.textAlign==="left"?e.x:e.x+(e.width-t.width)/(e.textAlign==="center"?2:1),y:e.y+(e.height-t.height)/2},!1),Kh=(e,t,a,n,i)=>{let l=new Set,r=Gt(e,t,d=>{if(j(d)){let u=n(d);l.add(u);let s=fe(d,{fontSize:u});return Wt(s,a.scene.getContainerElement(d),a.scene.getNonDeletedElementsMap()),s=EC(d,s),s}return d},!0),o=oe(r);return be(e,t,{includeBoundTextElement:!0}).forEach(d=>{j(d)&&na(d,o)}),{elements:r,appState:{...t,currentItemFontSize:l.size===1?[...l][0]:i??t.currentItemFontSize},captureUpdate:B.IMMEDIATELY}};V({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,a)=>({...a.currentItemStrokeColor&&{elements:Gt(e,t,n=>Cc(n.type)?fe(n,{strokeColor:a.currentItemStrokeColor}):n,!0)},appState:{...t,...a},captureUpdate:a.currentItemStrokeColor?B.IMMEDIATELY:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:a,appProps:n})=>M(te,{children:[h("h3",{"aria-hidden":"true",children:E("labels.stroke")}),h(Gh,{topPicks:Uu,palette:Fg,type:"elementStroke",label:E("labels.stroke"),color:Vt(e,t,i=>i.strokeColor,!0,t.currentItemStrokeColor),onChange:i=>a({currentItemStrokeColor:i}),elements:e,appState:t,updateData:a})]})}),V({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,a)=>({...a.currentItemBackgroundColor&&{elements:Gt(e,t,n=>fe(n,{backgroundColor:a.currentItemBackgroundColor}))},appState:{...t,...a},captureUpdate:a.currentItemBackgroundColor?B.IMMEDIATELY:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:a,appProps:n})=>M(te,{children:[h("h3",{"aria-hidden":"true",children:E("labels.background")}),h(Gh,{topPicks:fu,palette:$g,type:"elementBackground",label:E("labels.background"),color:Vt(e,t,i=>i.backgroundColor,!0,t.currentItemBackgroundColor),onChange:i=>a({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:a})]})}),V({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,a,n)=>(Ge("element","changeFillStyle",`${a} (${n.device.editor.isMobile?"mobile":"desktop"})`),{elements:Gt(e,t,i=>fe(i,{fillStyle:a})),appState:{...t,currentItemFillStyle:a},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a})=>{let n=be(e,t),i=n.length>0&&n.every(l=>l.fillStyle==="zigzag");return M("fieldset",{children:[h("legend",{children:E("labels.fill")}),h(gn,{type:"button",options:[{value:"hachure",text:`${E(i?"labels.zigzag":"labels.hachure")} (${z("Alt-Click")})`,icon:i?Y8:j8,active:i?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:E("labels.crossHatch"),icon:Z8,testId:"fill-cross-hatch"},{value:"solid",text:E("labels.solid"),icon:K8,testId:"fill-solid"}],value:Vt(e,t,l=>l.fillStyle,l=>l.hasOwnProperty("fillStyle"),l=>l?null:t.currentItemFillStyle),onClick:(l,r)=>{let o=r.altKey&&l==="hachure"&&n.every(d=>d.fillStyle==="hachure")?"zigzag":l;a(o)}})]})}}),V({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,a)=>({elements:Gt(e,t,n=>fe(n,{strokeWidth:a})),appState:{...t,currentItemStrokeWidth:a},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a})=>M("fieldset",{children:[h("legend",{children:E("labels.strokeWidth")}),h(gn,{group:"stroke-width",options:[{value:zd.thin,text:E("labels.thin"),icon:DU,testId:"strokeWidth-thin"},{value:zd.bold,text:E("labels.bold"),icon:q8,testId:"strokeWidth-bold"},{value:zd.extraBold,text:E("labels.extraBold"),icon:J8,testId:"strokeWidth-extraBold"}],value:Vt(e,t,n=>n.strokeWidth,n=>n.hasOwnProperty("strokeWidth"),n=>n?null:t.currentItemStrokeWidth),onChange:n=>a(n)})]})}),V({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,a)=>({elements:Gt(e,t,n=>fe(n,{seed:cn(),roughness:a})),appState:{...t,currentItemRoughness:a},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a})=>M("fieldset",{children:[h("legend",{children:E("labels.sloppiness")}),h(gn,{group:"sloppiness",options:[{value:0,text:E("labels.architect"),icon:t3},{value:1,text:E("labels.artist"),icon:a3},{value:2,text:E("labels.cartoonist"),icon:n3}],value:Vt(e,t,n=>n.roughness,n=>n.hasOwnProperty("roughness"),n=>n?null:t.currentItemRoughness),onChange:n=>a(n)})]})}),V({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,a)=>({elements:Gt(e,t,n=>fe(n,{strokeStyle:a})),appState:{...t,currentItemStrokeStyle:a},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a})=>M("fieldset",{children:[h("legend",{children:E("labels.strokeStyle")}),h(gn,{group:"strokeStyle",options:[{value:"solid",text:E("labels.strokeStyle_solid"),icon:DU},{value:"dashed",text:E("labels.strokeStyle_dashed"),icon:Q8},{value:"dotted",text:E("labels.strokeStyle_dotted"),icon:e3}],value:Vt(e,t,n=>n.strokeStyle,n=>n.hasOwnProperty("strokeStyle"),n=>n?null:t.currentItemStrokeStyle),onChange:n=>a(n)})]})}),V({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,a)=>({elements:Gt(e,t,n=>fe(n,{opacity:a}),!0),appState:{...t,currentItemOpacity:a},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a})=>h(wC,{updateData:a,elements:e,appState:t,testId:"opacity"})}),V({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,a,n)=>Kh(e,t,n,()=>a,a),PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>M("fieldset",{children:[h("legend",{children:E("labels.fontSize")}),h(gn,{group:"font-size",options:[{value:16,text:E("labels.small"),icon:b3,testId:"fontSize-small"},{value:20,text:E("labels.medium"),icon:y3,testId:"fontSize-medium"},{value:28,text:E("labels.large"),icon:v3,testId:"fontSize-large"},{value:36,text:E("labels.veryLarge"),icon:w3,testId:"fontSize-veryLarge"}],value:Vt(e,t,i=>{if(j(i))return i.fontSize;let l=pe(i,n.scene.getNonDeletedElementsMap());return l?l.fontSize:null},i=>j(i)||pe(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||Mn),onChange:i=>a(i)})]})});var X2=V({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:Zs,trackEvent:!1,perform:(e,t,a,n)=>Kh(e,t,n,i=>Math.round(1/(1+H2)*i.fontSize)),keyTest:e=>e[L.CTRL_OR_CMD]&&e.shiftKey&&(e.key===L.CHEVRON_LEFT||e.key===L.COMMA)}),W2=V({name:"increaseFontSize",label:"labels.increaseFontSize",icon:Zs,trackEvent:!1,perform:(e,t,a,n)=>Kh(e,t,n,i=>Math.round(i.fontSize*(1+H2))),keyTest:e=>e[L.CTRL_OR_CMD]&&e.shiftKey&&(e.key===L.CHEVRON_RIGHT||e.key===L.PERIOD)});V({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,a,n)=>{let{cachedElements:i,resetAll:l,resetContainers:r,...o}=a;if(l)return{elements:Gt(e,t,p=>{let m=i?.get(p.id);return m?fe(p,{...m}):p},!0),appState:{...t,...o},captureUpdate:B.NEVER};let{currentItemFontFamily:d,currentHoveredFontFamily:u}=a,s=B.EVENTUALLY,c,U=!1;if(d)c=d,s=B.IMMEDIATELY;else if(u){c=u,s=B.EVENTUALLY;let p=be(e,t,{includeBoundTextElement:!0}).filter(m=>j(m));if(p.length>200)U=!0;else{let m=0,g=0;for(;m<p.length&&g<5e3;){let y=p[m];g+=y?.originalText.length||0,m++}g>5e3&&(U=!0)}}let f={appState:{...t,...o},captureUpdate:s};if(c&&!U){let p=new Map,m=new Set,g=!1,y=Array.from(An.loadedFontsCache.values()),v=Object.entries(Ke).find(([S,C])=>C===c)?.[0];u&&v&&y.some(S=>S.startsWith(v))&&(g=!0),Object.assign(f,{elements:Gt(e,t,S=>{if(j(S)&&(S.fontFamily!==c||d)){let C=fe(S,{fontFamily:c,lineHeight:Hi(c)}),T=i?.get(S.containerId||"")||{},k=n.scene.getContainerElement(S);return r&&k&&T&&F(k,{...T},!1),g||(m=new Set([...m,...Array.from(C.originalText)])),p.set(C,k),C}return S},!0)});let b=`10px ${bl({fontFamily:c})}`,x=Array.from(m.values()).join();if(g||window.document.fonts.check(b,x))for(let[S,C]of p)Wt(S,C,n.scene.getNonDeletedElementsMap(),!1);else window.document.fonts.load(b,x).then(S=>{for(let[C,T]of p){let k=n.scene.getElement(C.id),R=T?n.scene.getElement(T.id):null;k&&Wt(k,R,n.scene.getNonDeletedElementsMap(),!1)}n.fonts.onLoaded(S)})}return f},PanelComponent:({elements:e,appState:t,app:a,updateData:n})=>{let i=re(new Map),l=re(null),[r,o]=se({}),d=re(!0),u=mt(()=>{let s=(c,U)=>Vt(c,t,f=>{if(j(f))return f.fontFamily;let p=pe(f,U);return p?p.fontFamily:null},f=>j(f)||pe(f,U)!==null,f=>f?null:t.currentItemFontFamily||ii);return r.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?s(Array.from(i.current?.values()??[]),i.current):!r.openPopup&&t.openPopup!=="fontFamily"?s(e,a.scene.getNonDeletedElementsMap()):l.current},[r.openPopup,t,e,a.scene]);return ae(()=>{l.current=u},[u]),ae(()=>{Object.keys(r).length&&(n(r),o({}))},[r]),ae(()=>(d.current=!1,()=>{d.current=!0}),[]),M("fieldset",{children:[h("legend",{children:E("labels.fontFamily")}),h(vC,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:u,hoveredFontFamily:t.currentHoveredFontFamily,onSelect:s=>{o({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:s}),i.current.clear()},onHover:s=>{o({currentHoveredFontFamily:s,cachedElements:new Map(i.current),resetContainers:!0})},onLeave:()=>{o({currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0})},onPopupChange:s=>{if(s){i.current.clear();let{editingTextElement:c}=t;if(c?.type==="text"){let U=a.scene.getElement(c.id);i.current.set(c.id,fe(U||c,{},!0))}else{let U=be(e,t,{includeBoundTextElement:!0});for(let f of U)i.current.set(f.id,fe(f,{},!0))}o({openPopup:"fontFamily"})}else{let c={openPopup:null,currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0};d.current?n({...r,...c}):o(c),i.current.clear()}}})]})}}),V({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,a,n)=>({elements:Gt(e,t,i=>{if(j(i)){let l=fe(i,{textAlign:a});return Wt(l,n.scene.getContainerElement(i),n.scene.getNonDeletedElementsMap()),l}return i},!0),appState:{...t,currentItemTextAlign:a},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>{let i=n.scene.getNonDeletedElementsMap();return M("fieldset",{children:[h("legend",{children:E("labels.textAlign")}),h(gn,{group:"text-align",options:[{value:"left",text:E("labels.left"),icon:x3,testId:"align-left"},{value:"center",text:E("labels.center"),icon:S3,testId:"align-horizontal-center"},{value:"right",text:E("labels.right"),icon:M3,testId:"align-right"}],value:Vt(e,t,l=>{if(j(l))return l.textAlign;let r=pe(l,i);return r?r.textAlign:null},l=>j(l)||pe(l,i)!==null,l=>l?null:t.currentItemTextAlign),onChange:l=>a(l)})]})}}),V({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,a,n)=>({elements:Gt(e,t,i=>{if(j(i)){let l=fe(i,{verticalAlign:a});return Wt(l,n.scene.getContainerElement(i),n.scene.getNonDeletedElementsMap()),l}return i},!0),appState:{...t},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h("fieldset",{children:h(gn,{group:"text-align",options:[{value:ca.TOP,text:E("labels.alignTop"),icon:h(C3,{theme:t.theme}),testId:"align-top"},{value:ca.MIDDLE,text:E("labels.centerVertically"),icon:h(I3,{theme:t.theme}),testId:"align-middle"},{value:ca.BOTTOM,text:E("labels.alignBottom"),icon:h(k3,{theme:t.theme}),testId:"align-bottom"}],value:Vt(e,t,i=>{if(j(i)&&i.containerId)return i.verticalAlign;let l=pe(i,n.scene.getNonDeletedElementsMap());return l?l.verticalAlign:null},i=>j(i)||pe(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:ca.MIDDLE),onChange:i=>a(i)})})}),V({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,a)=>({elements:Gt(e,t,n=>q(n)?n:fe(n,{roundness:a==="round"?{type:wl(n.type)?Ut.ADAPTIVE_RADIUS:Ut.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:a},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a})=>{let n=Ap(ze(e),t).some(i=>i.roundness?.type===Ut.LEGACY);return M("fieldset",{children:[h("legend",{children:E("labels.edges")}),h(gn,{group:"edges",options:[{value:"sharp",text:E("labels.sharp"),icon:i3},{value:"round",text:E("labels.round"),icon:l3}],value:Vt(e,t,i=>n?null:i.roundness?"round":"sharp",i=>!ge(i)&&i.hasOwnProperty("roundness"),i=>i?null:t.currentItemRoundness),onChange:i=>a(i)})]})}});var G2=e=>[{value:null,text:E("labels.arrowhead_none"),keyBinding:"q",icon:r3},{value:"arrow",text:E("labels.arrowhead_arrow"),keyBinding:"w",icon:h(s3,{flip:e})},{value:"triangle",text:E("labels.arrowhead_triangle"),icon:h(h3,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:E("labels.arrowhead_triangle_outline"),icon:h(u3,{flip:e}),keyBinding:"r"},{value:"circle",text:E("labels.arrowhead_circle"),keyBinding:"a",icon:h(o3,{flip:e})},{value:"circle_outline",text:E("labels.arrowhead_circle_outline"),keyBinding:"s",icon:h(d3,{flip:e})},{value:"diamond",text:E("labels.arrowhead_diamond"),icon:h(U3,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:E("labels.arrowhead_diamond_outline"),icon:h(f3,{flip:e}),keyBinding:"f"},{value:"bar",text:E("labels.arrowhead_bar"),keyBinding:"z",icon:h(c3,{flip:e})},{value:"crowfoot_one",text:E("labels.arrowhead_crowfoot_one"),icon:h(m3,{flip:e}),keyBinding:"c"},{value:"crowfoot_many",text:E("labels.arrowhead_crowfoot_many"),icon:h(p3,{flip:e}),keyBinding:"x"},{value:"crowfoot_one_or_many",text:E("labels.arrowhead_crowfoot_one_or_many"),icon:h(g3,{flip:e}),keyBinding:"v"}];V({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,a)=>({elements:Gt(e,t,n=>{if(he(n)){let{position:i,type:l}=a;if(i==="start")return fe(n,{startArrowhead:l});if(i==="end")return fe(n,{endArrowhead:l})}return n}),appState:{...t,[a.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:a.type},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a})=>{let n=Yr().rtl;return M("fieldset",{children:[h("legend",{children:E("labels.arrowheads")}),M("div",{className:"iconSelectList buttonList",children:[h(R2,{label:"arrowhead_start",options:G2(!n),value:Vt(e,t,i=>he(i)&&no(i.type)?i.startArrowhead:t.currentItemStartArrowhead,!0,t.currentItemStartArrowhead),onChange:i=>a({position:"start",type:i}),numberOfOptionsToAlwaysShow:4}),h(R2,{label:"arrowhead_end",group:"arrowheads",options:G2(!!n),value:Vt(e,t,i=>he(i)&&no(i.type)?i.endArrowhead:t.currentItemEndArrowhead,!0,t.currentItemEndArrowhead),onChange:i=>a({position:"end",type:i}),numberOfOptionsToAlwaysShow:4})]})]})}}),V({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,a,n)=>{let i=Gt(e,t,o=>{if(!ge(o))return o;let d=fe(o,{roundness:a===Ct.round?{type:Ut.PROPORTIONAL_RADIUS}:null,elbowed:a===Ct.elbow,points:a===Ct.elbow||o.elbowed?[o.points[0],o.points[o.points.length-1]]:o.points});if(q(d)){let u=n.scene.getNonDeletedElementsMap();n.dismissLinearEditor();let s=Z.getPointAtIndexGlobalCoordinates(d,0,u),c=Z.getPointAtIndexGlobalCoordinates(d,-1,u),U=!d.startBinding&&$a(Na(s),e,u,t.zoom,!1,!0),f=!d.endBinding&&$a(Na(c),e,u,t.zoom,!1,!0),p=U||d.startBinding&&u.get(d.startBinding.elementId),m=f||d.endBinding&&u.get(d.endBinding.elementId),g=U?wr(d,U,"start"):s,y=f?wr(d,f,"end"):c;U&&sn(d,U,"start",u),f&&sn(d,f,"end",u),F(d,{points:[g,y].map(v=>w(v[0]-d.x,v[1]-d.y)),...p&&d.startBinding?{startBinding:{...d.startBinding,...ho(d,p,"start")}}:{},...m&&d.endBinding?{endBinding:{...d.endBinding,...ho(d,m,"end")}}:{}}),Z.updateEditorMidPointsCache(d,u,n.state)}return d}),l={...t,currentItemArrowType:a},r=t.selectedLinearElement?.elementId;if(r){let o=i.find(d=>d.id===r);o&&(l.selectedLinearElement=new Z(o))}return{elements:i,appState:l,captureUpdate:B.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:a})=>M("fieldset",{children:[h("legend",{children:E("labels.arrowtypes")}),h(gn,{group:"arrowtypes",options:[{value:Ct.sharp,text:E("labels.arrowtype_sharp"),icon:tb,testId:"sharp-arrow"},{value:Ct.round,text:E("labels.arrowtype_round"),icon:nb,testId:"round-arrow"},{value:Ct.elbow,text:E("labels.arrowtype_elbowed"),icon:ab,testId:"elbow-arrow"}],value:Vt(e,t,n=>ge(n)?n.elbowed?Ct.elbow:n.roundness?Ct.round:Ct.sharp:null,n=>ge(n),n=>n?null:t.currentItemArrowType),onChange:n=>a(n)})]})});var el=({viewportX:e,viewportY:t,nextZoom:a},n)=>{let i=e-n.offsetLeft,l=t-n.offsetTop,r=n.zoom.value,o=n.scrollX+(i-i/r),d=n.scrollY+(l-l/r),u=-(i-i/a),s=-(l-l/a);return{scrollX:o+u,scrollY:d+s,zoom:{value:a}}},Zr=()=>{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},V2=(e,t,a="bottom")=>{let n=e.getBoundingClientRect(),i=window.innerWidth,l=window.innerHeight,r=5,o=t.left+t.width/2-n.width/2;o<0?o=r:o+n.width>=i&&(o=i-n.width-r);let d;a==="bottom"?(d=t.top+t.height+r,d+n.height>=l&&(d=t.top-n.height-r)):(d=t.top-n.height-r,d<0&&(d=t.top+t.height+r)),Object.assign(e.style,{top:`${d}px`,left:`${o}px`})},xC=(e,t,a,n)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=n?"50ch":"10ch",t.style.maxWidth=n?"50ch":"15ch",t.textContent=a;let i=e.getBoundingClientRect();V2(t,i)},tl=({children:e,label:t,long:a=!1,style:n,disabled:i})=>(ae(()=>()=>Zr().classList.remove("excalidraw-tooltip--visible"),[]),i?null:h("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:l=>xC(l.currentTarget,Zr(),t,a),onPointerLeave:()=>Zr().classList.remove("excalidraw-tooltip--visible"),style:n,children:e}));V({name:"changeViewBackgroundColor",label:"labels.canvasBackground",paletteName:"Change canvas background color",trackEvent:!1,predicate:(e,t,a,n)=>!!n.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,a)=>({appState:{...t,...a},captureUpdate:a.viewBackgroundColor?B.IMMEDIATELY:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:a,appProps:n})=>h(Gh,{palette:null,topPicks:pu,label:E("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:i=>a({viewBackgroundColor:i}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:a})});var Kr=V({name:"clearCanvas",label:"labels.clearCanvas",paletteName:"Clear canvas",icon:Bi,trackEvent:{category:"canvas"},predicate:(e,t,a,n)=>!!n.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector",perform:(e,t,a,n)=>(n.imageCache.clear(),{elements:e.map(i=>fe(i,{isDeleted:!0})),appState:{...tn(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:"selection"}:t.activeTool},captureUpdate:B.IMMEDIATELY})}),Y2=V({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:oU,trackEvent:{category:"canvas"},perform:(e,t,a,n)=>({appState:{...t,...el({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Bn(t.zoom.value+Ms)},t),userToFollow:null},captureUpdate:B.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>h(Me,{type:"button",className:"zoom-in-button zoom-button",icon:oU,title:`${E("buttons.zoomIn")} \u2014 ${z("CtrlOrCmd++")}`,"aria-label":E("buttons.zoomIn"),disabled:t.zoom.value>=Rd,onClick:()=>{e(null)}}),keyTest:e=>(e.code===ke.EQUAL||e.code===ke.NUM_ADD)&&(e[L.CTRL_OR_CMD]||e.shiftKey)}),j2=V({name:"zoomOut",label:"buttons.zoomOut",icon:dU,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,a,n)=>({appState:{...t,...el({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Bn(t.zoom.value-Ms)},t),userToFollow:null},captureUpdate:B.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>h(Me,{type:"button",className:"zoom-out-button zoom-button",icon:dU,title:`${E("buttons.zoomOut")} \u2014 ${z("CtrlOrCmd+-")}`,"aria-label":E("buttons.zoomOut"),disabled:t.zoom.value<=Ad,onClick:()=>{e(null)}}),keyTest:e=>(e.code===ke.MINUS||e.code===ke.NUM_SUBTRACT)&&(e[L.CTRL_OR_CMD]||e.shiftKey)}),Z2=V({name:"resetZoom",label:"buttons.resetZoom",icon:A8,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,a,n)=>({appState:{...t,...el({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Bn(1)},t),userToFollow:null},captureUpdate:B.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>h(tl,{label:E("buttons.resetZoom"),style:{height:"100%"},children:M(Me,{type:"button",className:"reset-zoom-button zoom-button",title:E("buttons.resetZoom"),"aria-label":E("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===ke.ZERO||e.code===ke.NUM_ZERO)&&(e[L.CTRL_OR_CMD]||e.shiftKey)}),SC=(e,t,a=1)=>{let[n,i,l,r]=e,o=l-n,d=t.width/o,u=r-i,s=t.height/u,c=Math.min(d,s)*we(a,.1,1);return Math.min(c,1)},K2=({bounds:e,appState:t,canvasOffsets:a,fitToViewport:n=!1,viewportZoomFactor:i=1,minZoom:l=-1/0,maxZoom:r=1/0})=>{i=we(i,Ad,Rd);let[o,d,u,s]=e,c=(o+u)/2,U=(d+s)/2,f=a?.left??0,p=a?.top??0,m=a?.right??0,g=a?.bottom??0,y=t.width-f-m,v=t.height-p-g,b;if(n){let C=u-o,T=s-d;b=Math.min(y/C,v/T)*i}else b=SC(e,{width:y,height:v},i);let x=Bn(we(v7(b,Ms,"floor"),l,r)),S=Gf({scenePoint:{x:c,y:U},viewportDimensions:{width:t.width,height:t.height},offsets:a,zoom:{value:x}});return{appState:{...t,scrollX:S.scrollX,scrollY:S.scrollY,zoom:{value:x}},captureUpdate:B.EVENTUALLY}},Ko=({canvasOffsets:e,targetElements:t,appState:a,fitToViewport:n,viewportZoomFactor:i,minZoom:l,maxZoom:r})=>{let o=De(ze(t));return K2({canvasOffsets:e,bounds:o,appState:a,fitToViewport:n,viewportZoomFactor:i,minZoom:l,maxZoom:r})};V({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:uc,trackEvent:{category:"canvas"},perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t);return Ko({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===ke.TWO&&e.shiftKey&&!e.altKey&&!e[L.CTRL_OR_CMD]}),V({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:uc,trackEvent:{category:"canvas"},perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t);return Ko({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===ke.THREE&&e.shiftKey&&!e.altKey&&!e[L.CTRL_OR_CMD]}),V({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:uc,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,a,n)=>Ko({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()}),keyTest:e=>e.code===ke.ONE&&e.shiftKey&&!e.altKey&&!e[L.CTRL_OR_CMD]});var qo=V({name:"toggleTheme",label:(e,t)=>t.theme===Se.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:e=>e.theme===Se.LIGHT?nc:ic,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,a)=>({appState:{...t,theme:a||(t.theme===Se.LIGHT?Se.DARK:Se.LIGHT)},captureUpdate:B.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===ke.D,predicate:(e,t,a,n)=>!!n.props.UIOptions.canvasActions.toggleTheme});V({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t)=>{let a;return an(t)?a=ft(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):a=ft(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:a},captureUpdate:B.IMMEDIATELY}},keyTest:e=>e.key===L.E});var MC=V({name:"toggleHandTool",label:"toolBar.hand",paletteName:"Toggle hand tool",trackEvent:{category:"toolbar"},icon:RU,viewMode:!1,perform:(e,t,a,n)=>{let i;return ml(t)?i=ft(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(i=ft(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),Be(n.interactiveCanvas,Pe.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:i},captureUpdate:B.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[L.CTRL_OR_CMD]&&e.key===L.H}),Ya=V({name:"finalize",label:"",trackEvent:!1,perform:(e,t,a,n)=>{let{interactiveCanvas:i,focusContainer:l,scene:r}=n,o=r.getNonDeletedElementsMap();if(t.editingLinearElement){let{elementId:U,startBindingElement:f,endBindingElement:p}=t.editingLinearElement,m=Z.getElement(U,o);if(m)return ln(m)&&oo(m,f,p,o,r),{elements:m.points.length<2||qi(m)?e.filter(g=>g.id!==m.id):void 0,appState:{...t,cursorButton:"up",editingLinearElement:null},captureUpdate:B.IMMEDIATELY}}let d=e,u=t.pendingImageElementId&&r.getElement(t.pendingImageElementId);u&&F(u,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&l();let s=t.multiElement?t.multiElement:t.newElement?.type==="freedraw"?t.newElement:null;if(s){if(s.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:f,lastCommittedPoint:p}=s;(!p||f[f.length-1]!==p)&&F(s,{points:s.points.slice(0,-1)})}qi(s)&&(d=d.filter(f=>f.id!==s.id));let U=Nn(s.points,t.zoom.value);if((s.type==="line"||s.type==="freedraw")&&U){let f=s.points,p=f[0];F(s,{points:f.map((m,g)=>g===f.length-1?w(p[0],p[1]):m)})}if(ln(s)&&!U&&s.points.length>1){let[f,p]=Z.getPointAtIndexGlobalCoordinates(s,-1,oe(e));Nc(s,t,{x:f,y:p},o,e)}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!s)&&Ha(i);let c;return t.activeTool.type==="eraser"?c=ft(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):c=ft(t,{type:"selection"}),{elements:d,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&s?t.activeTool:c,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:s&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[s.id]:!0}:t.selectedElementIds,selectedLinearElement:s&&he(s)?new Z(s):t.selectedLinearElement,pendingImageElementId:null},captureUpdate:B.IMMEDIATELY}},keyTest:(e,t)=>e.key===L.ESCAPE&&(t.editingLinearElement!==null||!t.newElement&&t.multiElement===null)||(e.key===L.ESCAPE||e.key===L.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:a})=>h(Me,{type:"button",icon:H8,title:E("buttons.done"),"aria-label":E("buttons.done"),onClick:t,visible:e.multiElement!=null,size:a?.size||"medium",style:{pointerEvents:"all"}})}),CC=e=>{let{id:t}=vn(),[a,n]=se(e.value),i=r=>{e.ignoreFocus||F7(r.target);let o=r.target.value;o!==e.value&&e.onChange(o)},l=r=>{if(r.key===L.ENTER){if(r.preventDefault(),r.nativeEvent.isComposing||r.keyCode===229)return;r.currentTarget.blur()}};return M("div",{className:"ProjectName",children:[h("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),h("input",{type:"text",className:"TextInput",onBlur:i,onKeyDown:l,id:`${t}-filename`,value:a,onChange:r=>n(r.target.value)})]})},kC=e=>{let t=e.title||(e.value===Se.DARK?E("buttons.lightMode"):E("buttons.darkMode"));return h(Me,{type:"icon",icon:e.value===Se.LIGHT?q2.MOON:q2.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===Se.DARK?Se.LIGHT:Se.DARK),"data-testid":"toggle-dark-mode"})},q2={SUN:h("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:h("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:h("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:h("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"})})},Jo=(e,{selectedElementIds:t},a)=>{e=ze(e);let n=a&&yt(e,{selectedElementIds:t}),i=null,l=n?be(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return n&&(l.length===1&&de(l[0])?(i=l[0],l=yh(e,i)):l.length>1&&(l=be(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:i,exportedElements:Ln(l)}},Qo=async(e,t,a,n,{exportBackground:i,exportPadding:l=Ul,viewBackgroundColor:r,name:o=a.name||Cu,fileHandle:d=null,exportingFrame:u=null})=>{if(t.length===0)throw new Error(E("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let c=Qc(t,{exportBackground:i,exportWithDarkMode:a.exportWithDarkMode,viewBackgroundColor:r,exportPadding:l,exportScale:a.exportScale,exportEmbedScene:a.exportEmbedScene&&e==="svg"},n,{exportingFrame:u});if(e==="svg")return Co(c.then(U=>new Blob([U.outerHTML],{type:ne.svg})),{description:"Export to SVG",name:o,extension:a.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[ul.svg],fileHandle:d});if(e==="clipboard-svg"){let U=await c.then(f=>f.outerHTML);try{await Bl(U)}catch{throw new Error(E("errors.copyToSystemClipboardFailed"))}return}}let s=q0(t,a,n,{exportBackground:i,viewBackgroundColor:r,exportPadding:l,exportingFrame:u});if(e==="png"){let c=Gr(s);return a.exportEmbedScene&&(c=c.then(U=>import("/npm/@excalidraw/excalidraw@0.18.1/dist/prod/data/image-GAAHSSAO.js/+esm").then(({encodePngMetadata:f})=>f({blob:U,metadata:Ar(t,a,n,"local")})))),Co(c,{description:"Export to PNG",name:o,extension:a.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[ul.png],fileHandle:d})}else if(e==="clipboard")try{let c=Gr(s);await fp(c)}catch(c){throw console.warn(c),c.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(E("canvasError.canvasTooBig")):Ql&&c.name==="TypeError"?new Error(`${E("alerts.couldNotCopyToClipboard")}

${E("hints.firefox_clipboard_write")}`):new Error(E("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")},IC=async(e,t,a,n)=>{let{exportBackground:i,viewBackgroundColor:l,fileHandle:r}=t,o=Qp(r);if(!r||!LS(o))throw new Error("fileHandle should exist and should be of type svg or png when resaving");t={...t,exportEmbedScene:!0};let{exportedElements:d,exportingFrame:u}=Jo(e,t,!1);return await Qo(o,d,t,a,{exportBackground:i,viewBackgroundColor:l,name:n,fileHandle:r,exportingFrame:u}),{fileHandle:r}},qh=({children:e,checked:t,onChange:a,className:n})=>M("div",{className:Q("Checkbox",n,{"is-checked":t}),onClick:i=>{a(!t,i),i.currentTarget.querySelector(".Checkbox-box").focus()},children:[h("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:O8}),h("div",{className:"Checkbox-label",children:e})]}),TC=V({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,a)=>({appState:{...t,name:a},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:a,data:n,app:i})=>h(CC,{label:E("labels.fileTitle"),value:i.getName(),onChange:l=>t(l),ignoreFocus:n?.ignoreFocus??!1})}),LC=V({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,a)=>({appState:{...t,exportScale:a},captureUpdate:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:a})=>{let n=ze(e),i=yt(n,t)?be(n,t):n;return h(te,{children:Od.map(l=>{let[r,o]=px(i,Ul,l),d=`${E("imageExportDialog.label.scale")} ${l}x (${r}x${o})`;return h(Me,{size:"small",type:"radio",icon:`${l}x`,name:"export-canvas-scale",title:d,"aria-label":d,id:"export-canvas-scale",checked:l===t.exportScale,onChange:()=>a(l)},l)})})}}),DC=V({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,a)=>({appState:{...t,exportBackground:a},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>h(qh,{checked:e.exportBackground,onChange:a=>t(a),children:E("imageExportDialog.label.withBackground")})}),J2=V({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,a)=>({appState:{...t,exportEmbedScene:a},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>M(qh,{checked:e.exportEmbedScene,onChange:a=>t(a),children:[E("imageExportDialog.label.embedScene"),h(tl,{label:E("imageExportDialog.tooltip.embedScene"),long:!0,children:h("div",{className:"excalidraw-tooltip-icon",children:X8})})]})}),Q2=V({name:"saveToActiveFile",label:"buttons.save",icon:js,trackEvent:{category:"export"},predicate:(e,t,a,n)=>!!n.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,a,n)=>{let i=!!t.fileHandle;try{let{fileHandle:l}=Nh(t.fileHandle)?await IC(e,t,n.files,n.getName()):await A0(e,t,n.files,n.getName());return{captureUpdate:B.EVENTUALLY,appState:{...t,fileHandle:l,toast:i?{message:l?.name?E("toast.fileSavedToFilename").replace("{filename}",`"${l.name}"`):E("toast.fileSaved")}:null}}}catch(l){return l?.name!=="AbortError"?console.error(l):console.warn(l),{captureUpdate:B.EVENTUALLY}}},keyTest:e=>e.key===L.S&&e[L.CTRL_OR_CMD]&&!e.shiftKey}),em=V({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:js,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,a,n)=>{try{let{fileHandle:i}=await A0(e,{...t,fileHandle:null},n.files,n.getName());return{captureUpdate:B.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:i,toast:{message:E("toast.fileSaved")}}}}catch(i){return i?.name!=="AbortError"?console.error(i):console.warn(i),{captureUpdate:B.EVENTUALLY}}},keyTest:e=>e.key===L.S&&e.shiftKey&&e[L.CTRL_OR_CMD],PanelComponent:({updateData:e})=>h(Me,{type:"button",icon:z8,title:E("buttons.saveAs"),"aria-label":E("buttons.saveAs"),showAriaLabel:vt().editor.isMobile,hidden:!gs,onClick:()=>e(null),"data-testid":"save-as-button"})}),Jh=V({name:"loadScene",label:"buttons.load",trackEvent:{category:"export"},predicate:(e,t,a,n)=>!!n.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,a,n)=>{try{let{elements:i,appState:l,files:r}=await lx(t,e);return{elements:i,appState:l,files:r,captureUpdate:B.IMMEDIATELY}}catch(i){return i?.name==="AbortError"?(console.warn(i),!1):{elements:e,appState:{...t,errorMessage:i.message},files:n.files,captureUpdate:B.EVENTUALLY}}},keyTest:e=>e[L.CTRL_OR_CMD]&&e.key===L.O}),AC=V({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,a)=>({appState:{...t,exportWithDarkMode:a},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>h("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:h(kC,{value:e.exportWithDarkMode?Se.DARK:Se.LIGHT,onChange:a=>{t(a===Se.DARK)},title:E("imageExportDialog.label.darkMode")})})}),tm="{}",RC=V({name:"copyStyles",label:"labels.copyStyles",icon:FU,trackEvent:{category:"element"},perform:(e,t,a,n)=>{let i=[],l=e.find(r=>t.selectedElementIds[r.id]);if(i.push(l),l&&wa(l)){let r=pe(l,n.scene.getNonDeletedElementsMap());i.push(r)}return l&&(tm=JSON.stringify(i)),{appState:{...t,toast:{message:E("toast.copyStyles")}},captureUpdate:B.EVENTUALLY}},keyTest:e=>e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.C}),NC=V({name:"pasteStyles",label:"labels.pasteStyles",icon:FU,trackEvent:{category:"element"},perform:(e,t,a,n)=>{let i=JSON.parse(tm),l=i[0],r=i[1];if(!tU(l))return{elements:e,captureUpdate:B.EVENTUALLY};let o=be(e,t,{includeBoundTextElement:!0}),d=o.map(u=>u.id);return{elements:e.map(u=>{if(d.includes(u.id)){let s=l;if(j(u)&&u.containerId&&(s=r),!s)return u;let c=fe(u,{backgroundColor:s?.backgroundColor,strokeWidth:s?.strokeWidth,strokeColor:s?.strokeColor,strokeStyle:s?.strokeStyle,fillStyle:s?.fillStyle,opacity:s?.opacity,roughness:s?.roughness,roundness:s.roundness?J7(s.roundness.type,u)?s.roundness:Q7(u):null});if(j(c)){let U=s.fontSize||Mn,f=s.fontFamily||ii;c=fe(c,{fontSize:U,fontFamily:f,textAlign:s.textAlign||tr,lineHeight:s.lineHeight||Hi(f)});let p=null;c.containerId&&(p=o.find(m=>j(c)&&m.id===c.containerId)||null),Wt(c,p,n.scene.getNonDeletedElementsMap())}return c.type==="arrow"&&ge(s)&&(c=fe(c,{startArrowhead:s.startArrowhead,endArrowhead:s.endArrowhead})),de(u)&&(c=fe(c,{roundness:null,backgroundColor:"transparent"})),c}return u}),captureUpdate:B.IMMEDIATELY}},keyTest:e=>e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.V});V({name:"toggleCanvasMenu",label:"buttons.menu",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="canvas"?null:"canvas"},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>h(Me,{type:"button",icon:cU,"aria-label":E("buttons.menu"),onClick:t,selected:e.openMenu==="canvas"})}),V({name:"toggleEditMenu",label:"buttons.edit",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="shape"?null:"shape"},captureUpdate:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:a})=>h(Me,{visible:Dh(t,ze(e)),type:"button",icon:F8,"aria-label":E("buttons.edit"),onClick:a,selected:t.openMenu==="shape"})});var Qh=V({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:N8,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,a,{focusContainer:n})=>(t.openDialog?.name==="help"&&n(),{appState:{...t,openDialog:t.openDialog?.name==="help"?null:{name:"help"}},captureUpdate:B.EVENTUALLY}),keyTest:e=>e.key===L.QUESTION_MARK}),PC=e=>{if(e.length>=2){let t=e[0].groupIds;for(let a of t)if(e.reduce((n,i)=>n&&Mr(i,a),!0))return!0}return!1},am=(e,t,a)=>{let n=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return n.length>=2&&!PC(n)&&!Lp(n)},_C=V({name:"group",label:"labels.group",icon:e=>h(TU,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,a,n)=>{let i=gh(n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(i.length<2)return{appState:t,elements:e,captureUpdate:B.EVENTUALLY};let l=Vi(t);if(l.length===1){let m=l[0],g=new Set(je(e,m).map(v=>v.id)),y=new Set(i.map(v=>v.id));if(new Set([...Array.from(g),...Array.from(y)]).size===g.size)return{appState:t,elements:e,captureUpdate:B.EVENTUALLY}}let r=[...e];new Set(i.map(m=>m.frameId)).size>1&&nS(i).forEach((m,g)=>{Po(m,n.scene.getNonDeletedElementsMap())});let o=xa(),d=oe(i);r=r.map(m=>d.get(m.id)?fe(m,{groupIds:UE(m.groupIds,o,t.editingGroupId)}):m);let u=je(r,o),s=u[u.length-1],c=r.lastIndexOf(s),U=r.slice(c+1),f=r.slice(0,c).filter(m=>!Mr(m,o)),p=un([...f,...u,...U],oe(u));return{appState:{...t,...Yf(o,{...t,selectedGroupIds:{}},ze(r))},elements:p,captureUpdate:B.IMMEDIATELY}},predicate:(e,t,a,n)=>am(e,t,n),keyTest:e=>!e.shiftKey&&e[L.CTRL_OR_CMD]&&e.key===L.G,PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h(Me,{hidden:!am(e,t,n),type:"button",icon:h(TU,{theme:t.theme}),onClick:()=>a(null),title:`${E("labels.group")} \u2014 ${z("CtrlOrCmd+G")}`,"aria-label":E("labels.group"),visible:yt(ze(e),t)})}),OC=V({name:"ungroup",label:"labels.ungroup",icon:e=>h(LU,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,a,n)=>{let i=Vi(t),l=oe(e);if(i.length===0)return{appState:t,elements:e,captureUpdate:B.EVENTUALLY};let r=[...e],o=[];r=r.map(c=>{Ye(c)&&o.push(c.id);let U=fE(c.groupIds,t.selectedGroupIds);return U.length===c.groupIds.length?c:fe(c,{groupIds:U})});let d=Xt(t,ze(r),t,null),u=n.scene.getSelectedElements(t),s=new Set(u.filter(c=>c.frameId).map(c=>c.frameId));return mh(e).filter(c=>s.has(c.id)).forEach(c=>{c&&(r=kp(r,No(r,c,t,l),c,n))}),d.selectedElementIds=Object.entries(d.selectedElementIds).reduce((c,[U,f])=>(f&&!o.includes(U)&&(c[U]=!0),c),{}),{appState:{...t,...d},elements:r,captureUpdate:B.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[L.CTRL_OR_CMD]&&e.key===L.G.toUpperCase(),predicate:(e,t)=>Vi(t).length>0,PanelComponent:({elements:e,appState:t,updateData:a})=>h(Me,{type:"button",hidden:Vi(t).length===0,icon:h(LU,{theme:t.theme}),onClick:()=>a(null),title:`${E("labels.ungroup")} \u2014 ${z("CtrlOrCmd+Shift+G")}`,"aria-label":E("labels.ungroup"),visible:yt(ze(e),t)})}),nm=(e,t,a,n,i,l,r)=>{e.beginPath(),e.moveTo(t+l,a),e.lineTo(t+n-l,a),e.quadraticCurveTo(t+n,a,t+n,a+l),e.lineTo(t+n,a+i-l),e.quadraticCurveTo(t+n,a+i,t+n-l,a+i),e.lineTo(t+l,a+i),e.quadraticCurveTo(t,a+i,t,a+i-l),e.lineTo(t,a+l),e.quadraticCurveTo(t,a,t+l,a),e.closePath(),e.fill(),r&&(e.strokeStyle=r),e.stroke()};function BC(e){let t=0;if(e.length===0)return t;for(let a=0;a<e.length;a++){let n=e.charCodeAt(a);t=(t<<5)-t+n}return t}var ed=(e,t)=>`hsl(${Math.abs(BC(t?.id||e))%37*10}, 100%, 83%)`,zC=e=>{let t=e?.trim()?.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},FC=({context:e,renderConfig:t,appState:a,normalizedWidth:n,normalizedHeight:i})=>{for(let[l,r]of t.remotePointerViewportCoords){let{x:o,y:d}=r,u=a.collaborators.get(l);o-=a.offsetLeft,d-=a.offsetTop;let s=11,c=14,U=o<0||o>n-s||d<0||d>i-c;o=Math.max(o,0),o=Math.min(o,n-s),d=Math.max(d,0),d=Math.min(d,i-c);let f=ed(l,u);e.save(),e.strokeStyle=f,e.fillStyle=f;let p=t.remotePointerUserStates.get(l),m=U||p==="idle"||p==="away";m&&(e.globalAlpha=.3),t.remotePointerButton.get(l)==="down"&&(e.beginPath(),e.arc(o,d,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(o,d,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=f,e.stroke(),e.closePath());let g=a.theme===Se.DARK?"#2f6330":e7,y=u?.isSpeaking;y&&(e.fillStyle=g,e.strokeStyle=g,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(o,d),e.lineTo(o+0,d+14),e.lineTo(o+4,d+9),e.lineTo(o+11,d+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=xs,e.strokeStyle=xs,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(o,d),e.lineTo(o+0,d+14),e.lineTo(o+4,d+9),e.lineTo(o+11,d+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=f,e.strokeStyle=f,e.lineWidth=2,e.lineJoin="round",e.beginPath(),m?(e.moveTo(o-1,d-1),e.lineTo(o-1,d+15),e.lineTo(o+5,d+10),e.lineTo(o+12,d+9),e.closePath(),e.fill()):(e.moveTo(o,d),e.lineTo(o+0,d+14),e.lineTo(o+4,d+9),e.lineTo(o+11,d+8),e.closePath(),e.fill(),e.stroke());let v=t.remotePointerUsernames.get(l)||"";if(!U&&v){e.font="600 12px sans-serif";let b=(y?o+0:o)+s/2,x=(y?d+0:d)+c+2,S=5,C=3,T=e.measureText(v),k=T.actualBoundingBoxDescent+T.actualBoundingBoxAscent,R=Math.max(k,12),D=b-1,A=x-1,P=T.width+2+S*2+2,$=R+2+C*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(D,A,P,$,8),e.fillStyle=f,e.fill(),e.strokeStyle=xs,e.stroke(),y&&(e.beginPath(),e.roundRect(D-2,A-2,P+4,$+4,8),e.strokeStyle=g,e.stroke())):nm(e,D,A,P,$,8,xs),e.fillStyle=Qg,e.fillText(v,b+S+1,x+C+T.actualBoundingBoxAscent+Math.floor((R-k)/2)+2),y){e.fillStyle=g;let X=8,_=8,H=5;e.fillRect(D+P+_,A+($/2-X/2),2,X),e.fillRect(D+P+_+H,A+($/2-X*2/2),2,X*2),e.fillRect(D+P+_+H*2,A+($/2-X/2),2,X)}}e.restore(),e.closePath()}},im=({color:e,onClick:t,name:a,src:n,className:i})=>{let l=zC(a),[r,o]=se(!1),d=!r&&n,u=d?void 0:{background:e};return h("div",{className:Q("Avatar",i),style:u,onClick:t,children:d?h("img",{className:"Avatar-img",src:n,alt:l,referrerPolicy:"no-referrer",onError:()=>o(!0)}):l})};V({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,a)=>!a.socketId||t.userToFollow?.socketId===a.socketId||a.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:B.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:a.socketId,username:a.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:B.EVENTUALLY},PanelComponent:({updateData:e,data:t,appState:a})=>{let{socketId:n,collaborator:i,withName:l,isBeingFollowed:r}=t,o=ed(n,i),d=Q({"is-followed":r,"is-current-user":i.isCurrentUser===!0,"is-speaking":i.isSpeaking,"is-in-call":i.isInCall,"is-muted":i.isMuted}),u=i.isInCall?i.isSpeaking?M("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:E("userList.hint.isSpeaking"),children:[h("div",{}),h("div",{}),h("div",{})]}):i.isMuted?h("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:E("userList.hint.micMuted"),children:H3}):h("div",{title:E("userList.hint.inCall"),children:$3}):null;return l?M("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${d}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(i),children:[h(im,{color:o,onClick:()=>{},name:i.username||"",src:i.avatarUrl,className:d}),h("div",{className:"UserList__collaborator-name",children:i.username}),M("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[r&&h("div",{className:"UserList__collaborator-status-icon-is-followed",title:E("userList.hint.followStatus"),children:hc}),u]})]}):M("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${d}`,children:[h(im,{color:o,onClick:()=>{e(i)},name:i.username||"",src:i.avatarUrl,className:d}),u&&h("div",{className:"UserList__collaborator-status-icon",children:u})]})}});var $C=V({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let l of Mu)if(i.some(r=>r.type===l))return{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:E(`errors.libraryElementTypeError.${l}`)}};return n.library.getLatestLibrary().then(l=>n.library.setLibrary([{id:xa(),status:"unpublished",elements:i.map(Zi),created:Date.now()},...l])).then(()=>({captureUpdate:B.EVENTUALLY,appState:{...t,toast:{message:E("toast.addedToLibrary")}}})).catch(l=>({captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:l.message}}))},label:"labels.addToLibrary"}),HC=(e,t,a,n)=>{let i=mo(e,t),l=Fa(e);return i.flatMap(r=>{let o=XC(r,l,a);return r.map(d=>{let u=F(d,{x:d.x+o.x,y:d.y+o.y});return na(d,n.getNonDeletedElementsMap(),{simultaneouslyUpdated:r}),u})})},XC=(e,t,{axis:a,position:n})=>{let i=Fa(e),[l,r]=a==="x"?["minX","maxX"]:["minY","maxY"],o={x:0,y:0};return n==="start"?{...o,[a]:t[l]-i[l]}:n==="end"?{...o,[a]:t[r]-i[r]}:{...o,[a]:(t[l]+t[r])/2-(i[l]+i[r])/2}},Ua=(e,t)=>{let a=t.scene.getSelectedElements(e);return a.length>1&&!a.some(n=>de(n))},Xl=(e,t,a,n)=>{let i=a.scene.getSelectedElements(t),l=oe(e),r=HC(i,l,n,a.scene),o=oe(r);return zl(e.map(d=>o.get(d.id)||d),t,a)};V({name:"alignTop",label:"labels.alignTop",icon:EU,trackEvent:{category:"element"},predicate:(e,t,a,n)=>Ua(t,n),perform:(e,t,a,n)=>({appState:t,elements:Xl(e,t,n,{position:"start",axis:"y"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>e[L.CTRL_OR_CMD]&&e.shiftKey&&e.key===L.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h(Me,{hidden:!Ua(t,n),type:"button",icon:EU,onClick:()=>a(null),title:`${E("labels.alignTop")} \u2014 ${z("CtrlOrCmd+Shift+Up")}`,"aria-label":E("labels.alignTop"),visible:yt(ze(e),t)})}),V({name:"alignBottom",label:"labels.alignBottom",icon:xU,trackEvent:{category:"element"},predicate:(e,t,a,n)=>Ua(t,n),perform:(e,t,a,n)=>({appState:t,elements:Xl(e,t,n,{position:"end",axis:"y"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>e[L.CTRL_OR_CMD]&&e.shiftKey&&e.key===L.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h(Me,{hidden:!Ua(t,n),type:"button",icon:xU,onClick:()=>a(null),title:`${E("labels.alignBottom")} \u2014 ${z("CtrlOrCmd+Shift+Down")}`,"aria-label":E("labels.alignBottom"),visible:yt(ze(e),t)})}),V({name:"alignLeft",label:"labels.alignLeft",icon:SU,trackEvent:{category:"element"},predicate:(e,t,a,n)=>Ua(t,n),perform:(e,t,a,n)=>({appState:t,elements:Xl(e,t,n,{position:"start",axis:"x"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>e[L.CTRL_OR_CMD]&&e.shiftKey&&e.key===L.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h(Me,{hidden:!Ua(t,n),type:"button",icon:SU,onClick:()=>a(null),title:`${E("labels.alignLeft")} \u2014 ${z("CtrlOrCmd+Shift+Left")}`,"aria-label":E("labels.alignLeft"),visible:yt(ze(e),t)})}),V({name:"alignRight",label:"labels.alignRight",icon:MU,trackEvent:{category:"element"},predicate:(e,t,a,n)=>Ua(t,n),perform:(e,t,a,n)=>({appState:t,elements:Xl(e,t,n,{position:"end",axis:"x"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>e[L.CTRL_OR_CMD]&&e.shiftKey&&e.key===L.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h(Me,{hidden:!Ua(t,n),type:"button",icon:MU,onClick:()=>a(null),title:`${E("labels.alignRight")} \u2014 ${z("CtrlOrCmd+Shift+Right")}`,"aria-label":E("labels.alignRight"),visible:yt(ze(e),t)})}),V({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:CU,trackEvent:{category:"element"},predicate:(e,t,a,n)=>Ua(t,n),perform:(e,t,a,n)=>({appState:t,elements:Xl(e,t,n,{position:"center",axis:"y"}),captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h(Me,{hidden:!Ua(t,n),type:"button",icon:CU,onClick:()=>a(null),title:E("labels.centerVertically"),"aria-label":E("labels.centerVertically"),visible:yt(ze(e),t)})}),V({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:kU,trackEvent:{category:"element"},predicate:(e,t,a,n)=>Ua(t,n),perform:(e,t,a,n)=>({appState:t,elements:Xl(e,t,n,{position:"center",axis:"x"}),captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h(Me,{hidden:!Ua(t,n),type:"button",icon:kU,onClick:()=>a(null),title:E("labels.centerHorizontally"),"aria-label":E("labels.centerHorizontally"),visible:yt(ze(e),t)})});var WC=(e,t,a)=>{let[n,i,l,r]=a.axis==="x"?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],o=Fa(e),d=mo(e,t).map(U=>[U,Fa(U)]).sort((U,f)=>U[1][i]-f[1][i]),u=0;for(let U of d)u+=U[1][r];let s=(o[r]-u)/(d.length-1);if(s<0){let U=d.findIndex(g=>g[1][n]===o[n]),f=d.findIndex(g=>g[1][l]===o[l]),p=(d[f][1][i]-d[U][1][i])/(d.length-1),m=d[U][1][i];return d.flatMap(([g,y],v)=>{let b={x:0,y:0};return v!==U&&v!==f&&(m+=p,b[a.axis]=m-y[i]),g.map(x=>fe(x,{x:x.x+b.x,y:x.y+b.y}))})}let c=o[n];return d.flatMap(([U,f])=>{let p={x:0,y:0};return p[a.axis]=c-f[n],c+=s,c+=f[r],U.map(m=>fe(m,{x:m.x+p.x,y:m.y+p.y}))})},lm=(e,t)=>{let a=t.scene.getSelectedElements(e);return a.length>1&&!a.some(n=>de(n))},rm=(e,t,a,n)=>{let i=a.scene.getSelectedElements(t),l=WC(i,a.scene.getNonDeletedElementsMap(),n),r=oe(l);return zl(e.map(o=>r.get(o.id)||o),t,a)};V({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,a,n)=>({appState:t,elements:rm(e,t,n,{axis:"x"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>!e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.H,PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h(Me,{hidden:!lm(t,n),type:"button",icon:G8,onClick:()=>a(null),title:`${E("labels.distributeHorizontally")} \u2014 ${z("Alt+H")}`,"aria-label":E("labels.distributeHorizontally"),visible:yt(ze(e),t)})}),V({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,a,n)=>({appState:t,elements:rm(e,t,n,{axis:"y"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>!e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.V,PanelComponent:({elements:e,appState:t,updateData:a,app:n})=>h(Me,{hidden:!lm(t,n),type:"button",icon:V8,onClick:()=>a(null),title:`${E("labels.distributeVertically")} \u2014 ${z("Alt+V")}`,"aria-label":E("labels.distributeVertically"),visible:yt(ze(e),t)})});var GC=V({name:"flipHorizontal",label:"labels.flipHorizontal",icon:V3,trackEvent:{category:"element"},perform:(e,t,a,n)=>({elements:zl(sm(e,n.scene.getNonDeletedElementsMap(),t,"horizontal",n),t,n),appState:t,captureUpdate:B.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===ke.H}),VC=V({name:"flipVertical",label:"labels.flipVertical",icon:G3,trackEvent:{category:"element"},perform:(e,t,a,n)=>({elements:zl(sm(e,n.scene.getNonDeletedElementsMap(),t,"vertical",n),t,n),appState:t,captureUpdate:B.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===ke.V&&!e[L.CTRL_OR_CMD]}),sm=(e,t,a,n,i)=>{let l=be(ze(e),a,{includeBoundTextElement:!0,includeElementsInFrames:!0}),r=YC(l,t,a,n,i),o=oe(r);return e.map(d=>o.get(d.id)||d)},YC=(e,t,a,n,i)=>{if(e.every(f=>ge(f)&&(f.startBinding||f.endBinding)))return e.map(f=>{let p=f;return fe(p,{startArrowhead:p.endArrowhead,endArrowhead:p.startArrowhead})});let{midX:l,midY:r}=Fa(e);Vp(e,t,"nw",i.scene,new Map(Array.from(t.values()).map(f=>[f.id,Zi(f)])),{flipByX:n==="horizontal",flipByY:n==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),co(e.filter(he),t,i.scene.getNonDeletedElements(),i.scene,Gi(a),[],a.zoom);let{elbowArrows:o,otherElements:d}=e.reduce((f,p)=>q(p)?{...f,elbowArrows:f.elbowArrows.concat(p)}:{...f,otherElements:f.otherElements.concat(p)},{elbowArrows:[],otherElements:[]}),{midX:u,midY:s}=Fa(e),[c,U]=[l-u,r-s];return d.forEach(f=>F(f,{x:f.x+c,y:f.y+U})),o.forEach(f=>F(f,{x:f.x+c,y:f.y+U})),e},td=V({name:"copy",label:"labels.copy",icon:ac,trackEvent:{category:"element"},perform:async(e,t,a,n)=>{let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await hp(i,n.files,a)}catch(l){return{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:l.message}}}return{captureUpdate:B.EVENTUALLY}},keyTest:void 0}),om=V({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,a,n)=>{let i;try{i=await jx()}catch(l){return l.name==="AbortError"||l.name==="NotAllowedError"?!1:(console.error(`actionPaste ${l.name}: ${l.message}`),Ql?{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:E("hints.firefox_clipboard_write")}}:{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:E("errors.asyncPasteFailedOnRead")}})}try{n.pasteFromClipboard(Wx({types:i}))}catch(l){return console.error(l),{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:E("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:B.EVENTUALLY}},keyTest:void 0}),dm=V({name:"cut",label:"labels.cut",icon:L3,trackEvent:{category:"element"},perform:(e,t,a,n)=>(td.perform(e,t,a,n),b2.perform(e,t,null,n)),keyTest:e=>e[L.CTRL_OR_CMD]&&e.key===L.X}),cm=V({name:"copyAsSvg",label:"labels.copyAsSvg",icon:Y3,trackEvent:{category:"element"},perform:async(e,t,a,n)=>{if(!n.canvas)return{captureUpdate:B.EVENTUALLY};let{exportedElements:i,exportingFrame:l}=Jo(e,t,!0);try{await Qo("clipboard-svg",i,t,n.files,{...t,exportingFrame:l,name:n.getName()});let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:E("toast.copyToClipboardAsSvg",{exportSelection:r.length?E("toast.selection"):E("toast.canvas"),exportColorScheme:t.exportWithDarkMode?E("buttons.darkMode"):E("buttons.lightMode")})}},captureUpdate:B.EVENTUALLY}}catch(r){return console.error(r),{appState:{errorMessage:r.message},captureUpdate:B.EVENTUALLY}}},predicate:e=>ch&&e.length>0,keywords:["svg","clipboard","copy"]}),hm=V({name:"copyAsPng",label:"labels.copyAsPng",icon:j3,trackEvent:{category:"element"},perform:async(e,t,a,n)=>{if(!n.canvas)return{captureUpdate:B.EVENTUALLY};let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:l,exportingFrame:r}=Jo(e,t,!0);try{return await Qo("clipboard",l,t,n.files,{...t,exportingFrame:r,name:n.getName()}),{appState:{...t,toast:{message:E("toast.copyToClipboardAsPng",{exportSelection:i.length?E("toast.selection"):E("toast.canvas"),exportColorScheme:t.exportWithDarkMode?E("buttons.darkMode"):E("buttons.lightMode")})}},captureUpdate:B.EVENTUALLY}}catch(o){return console.error(o),{appState:{...t,errorMessage:o.message},captureUpdate:B.EVENTUALLY}}},predicate:e=>hh&&e.length>0,keyTest:e=>e.code===ke.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),um=V({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{Bl(l0(i))}catch{throw new Error(E("errors.copyToSystemClipboardFailed"))}return{captureUpdate:B.EVENTUALLY}},predicate:(e,t,a,n)=>ch&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(j),keywords:["text","clipboard","copy"]}),Um=V({name:"gridMode",icon:Q3,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:B.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,a)=>a.gridModeEnabled===void 0,keyTest:e=>e[L.CTRL_OR_CMD]&&e.code===ke.QUOTE}),e1=V({name:"zenMode",label:"buttons.zenMode",icon:K3,paletteName:"Toggle zen mode",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:B.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,a)=>typeof a.zenModeEnabled>"u",keyTest:e=>!e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.Z}),jC=V({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:Z3,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:B.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,a)=>typeof a.objectsSnapModeEnabled>"u",keyTest:e=>!e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.S}),t1=V({name:"stats",label:"stats.fullTitle",icon:W3,paletteName:"Toggle stats",viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:B.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.SLASH}),ZC=V({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,a,n)=>n.scene.getSelectedElements(t).some(i=>wa(i)),perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t),l=n.scene.getNonDeletedElementsMap();return i.forEach(r=>{let o=pe(r,l);if(o){let{width:d,height:u}=zt(o.originalText,Oe(o),o.lineHeight),s=kE(r.id);n0(r.id);let{x:c,y:U}=yo(r,o,l);F(o,{containerId:null,width:d,height:u,text:o.originalText,x:c,y:U}),F(r,{boundElements:r.boundElements?.filter(f=>f.id!==o.id),height:s||r.height})}}),{elements:e,appState:t,captureUpdate:B.IMMEDIATELY}}}),KC=V({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t);if(i.length===2){let l=j(i[0])||j(i[1]),r;if(Ni(i[0])?r=i[0]:Ni(i[1])&&(r=i[1]),l&&r&&pe(r,n.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t),l,r;j(i[0])&&Ni(i[1])?(l=i[0],r=i[1]):(l=i[1],r=i[0]),F(l,{containerId:r.id,verticalAlign:ca.MIDDLE,textAlign:nr.CENTER,autoResize:!0}),F(r,{boundElements:(r.boundElements||[]).concat({type:"text",id:l.id})});let o=r.height;return Wt(l,r,n.scene.getNonDeletedElementsMap()),bo(r.id,o),{elements:qC(e,r,l),appState:{...t,selectedElementIds:{[r.id]:!0}},captureUpdate:B.IMMEDIATELY}}}),qC=(e,t,a)=>{let n=e.slice(),i=n.findIndex(r=>r.id===a.id);n.splice(i,1);let l=n.findIndex(r=>r.id===t.id);return n.splice(l+1,0,a),un(n,oe([t,a])),n},JC=(e,t,a)=>{let n=e.slice(),i=n.findIndex(r=>r.id===t.id);n.splice(i,1);let l=n.findIndex(r=>r.id===a.id);return n.splice(l,0,t),un(n,oe([t,a])),n},QC=V({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t),l=i.every(r=>j(r));return i.length>0&&l},perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t),l=e.slice(),r={};for(let o of i)if(j(o)){let d=hn({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...o.boundElements||[],{id:o.id,type:"text"}],angle:o.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:wl("rectangle")?Ut.ADAPTIVE_RADIUS:Ut.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:o.x-gt,y:o.y-gt,width:Yi(o.width,"rectangle"),height:Yi(o.height,"rectangle"),groupIds:o.groupIds,frameId:o.frameId});if(o.boundElements?.length){let u=o.boundElements.filter(s=>s.type==="arrow").map(s=>s.id);l.filter(s=>u.includes(s.id)).forEach(s=>{let c=s.startBinding,U=s.endBinding;c?.elementId===o.id&&(c={...c,elementId:d.id}),U?.elementId===o.id&&(U={...U,elementId:d.id}),(c||U)&&F(s,{startBinding:c,endBinding:U},!1)})}F(o,{containerId:d.id,verticalAlign:ca.MIDDLE,boundElements:null,textAlign:nr.CENTER,autoResize:!0},!1),Wt(o,d,n.scene.getNonDeletedElementsMap()),l=JC([...l,d],d,o),r[d.id]=!0}return{elements:l,appState:{...t,selectedElementIds:r},captureUpdate:B.IMMEDIATELY}}}),a1=380,ek=42,n1=5,fm=85,tk=500,i1=!1,ad=new Map,ak=({element:e,elementsMap:t,setAppState:a,onLinkOpen:n,setToast:i,updateEmbedValidationStatus:l})=>{let r=ds(),o=os(),d=vt(),u=e.link||"",[s,c]=se(u),U=re(null),f=r.showHyperlinkPopup==="editor",p=at(()=>{if(!U.current)return;let b=la(U.current.value)||null;if(!e.link&&b&&Ge("hyperlink","create"),ea(e)){if(r.activeEmbeddable?.element===e&&a({activeEmbeddable:null}),!b){F(e,{link:null}),l(e,!1);return}if(!So(b,o.validateEmbeddable))b&&i({message:E("toast.unableToEmbed"),closable:!0}),e.link&&ad.set(e.id,e.link),F(e,{link:b}),l(e,!1);else{let{width:x,height:S}=e,C=Nl(b);C?.error instanceof URIError&&i({message:E("toast.unrecognizedLinkFormat"),closable:!0});let T=C?C.intrinsicSize.w/C.intrinsicSize.h:1,k=ad.get(e.id)!==e.link;F(e,{...k?{width:C?.type==="video"?x>S?x:S*T:x,height:C?.type==="video"&&x>S?x/T:S}:{},link:b}),l(e,!0),ad.has(e.id)&&ad.delete(e.id)}}else F(e,{link:b})},[e,i,o.validateEmbeddable,r.activeEmbeddable,a,l]);Ia(()=>()=>{p()},[p]),ae(()=>{f&&U?.current&&!(d.viewport.isMobile||d.isTouchScreen)&&U.current.select()},[f,d.viewport.isMobile,d.isTouchScreen]),ae(()=>{let b=null,x=S=>{f||(b&&clearTimeout(b),lk(e,t,r,w(S.clientX,S.clientY))&&(b=window.setTimeout(()=>{a({showHyperlinkPopup:!1})},tk)))};return window.addEventListener("pointermove",x,!1),()=>{window.removeEventListener("pointermove",x,!1),b&&clearTimeout(b)}},[r,e,f,a,t]);let m=at(()=>{Ge("hyperlink","delete"),F(e,{link:null}),a({showHyperlinkPopup:!1})},[a,e]),g=()=>{Ge("hyperlink","edit","popup-ui"),a({showHyperlinkPopup:"editor"})},{x:y,y:v}=pm(e,r,t);return r.contextMenu||r.selectedElementsAreBeingDragged||r.resizingElement||r.isRotating||r.openMenu||r.viewModeEnabled?null:M("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${v}px`,left:`${y}px`,width:a1,padding:n1},children:[f?h("input",{className:Q("excalidraw-hyperlinkContainer-input"),placeholder:E("labels.link.hint"),ref:U,value:s,onChange:b=>c(b.target.value),autoFocus:!0,onKeyDown:b=>{b.stopPropagation(),b[L.CTRL_OR_CMD]&&b.key===L.K&&b.preventDefault(),(b.key===L.ENTER||b.key===L.ESCAPE)&&(p(),a({showHyperlinkPopup:"info"}))}}):e.link?h("a",{href:la(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:r0(e.link)?"_self":"_blank",onClick:b=>{if(e.link&&n){let x=Yu("excalidraw-link",b.nativeEvent);n({...e,link:la(e.link)},x),x.defaultPrevented&&b.preventDefault()}},rel:"noopener noreferrer",children:e.link}):h("div",{className:"excalidraw-hyperlinkContainer-link",children:E("labels.link.empty")}),M("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!f&&h(Me,{type:"button",title:E("buttons.edit"),"aria-label":E("buttons.edit"),label:E("buttons.edit"),onClick:g,className:"excalidraw-hyperlinkContainer--edit",icon:mr}),h(Me,{type:"button",title:E("labels.linkToElement"),"aria-label":E("labels.linkToElement"),label:E("labels.linkToElement"),onClick:()=>{a({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:XU}),u&&!ea(e)&&h(Me,{type:"button",title:E("buttons.remove"),"aria-label":E("buttons.remove"),label:E("buttons.remove"),onClick:m,className:"excalidraw-hyperlinkContainer--remove",icon:Bi})]})]})},pm=(e,t,a)=>{let[n,i]=Ue(e,a),{x:l,y:r}=ma({sceneX:n+e.width/2,sceneY:i},t),o=l-t.offsetLeft-a1/2,d=r-t.offsetTop-fm;return{x:o,y:d}},mm=(e,t)=>{let a=be(e,t);return ea(a[0])?"labels.link.editEmbed":a[0]?.link?"labels.link.edit":"labels.link.create"},qr=null,nk=(e,t,a)=>{qr&&clearTimeout(qr),qr=window.setTimeout(()=>ik(e,t,a),r7)},ik=(e,t,a)=>{if(!e.link)return;let n=Zr();n.classList.add("excalidraw-tooltip--visible"),n.style.maxWidth="20rem",n.textContent=Pl(e.link)?E("labels.link.goToElement"):e.link;let[i,l,r,o]=Ue(e,a),[d,u,s,c]=Zc([i,l,r,o],e.angle,t),U=ma({sceneX:d,sceneY:u},t);V2(n,{left:U.x,top:U.y,width:s,height:c},"top"),Ge("hyperlink","tooltip","link-icon"),i1=!0},gm=()=>{qr&&clearTimeout(qr),i1&&(i1=!1,Zr().classList.remove("excalidraw-tooltip--visible"))},lk=(e,t,a,[n,i])=>{let{x:l,y:r}=$e({clientX:n,clientY:i},a),o=15/a.zoom.value;if(yc(l,r,e,t))return!1;let[d,u,s]=Ue(e,t);if(l>=d&&l<=s&&r>=u-fm&&r<=u)return!1;let{x:c,y:U}=pm(e,a,t);return!(n>=c-o&&n<=c+a1+n1*2+o&&i>=U-o&&i<=U+o+n1*2+ek)},bm=V({name:"hyperlink",label:(e,t)=>mm(e,t),icon:rc,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:B.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[L.CTRL_OR_CMD]&&e.key===L.K,predicate:(e,t)=>be(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:a})=>{let n=be(e,t);return h(Me,{type:"button",icon:rc,"aria-label":E(mm(e,t)),title:`${ea(e[0])?E("labels.link.labelEmbed"):E("labels.link.label")} - ${z("CtrlOrCmd+K")}`,onClick:()=>a(null),selected:n.length===1&&!!n[0].link})}}),l1=e=>e.every(t=>!t.locked),rk=V({name:"toggleElementLock",label:(e,t,a)=>{let n=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return n.length===1&&!de(n[0])?n[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock":l1(n)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll"},icon:(e,t)=>{let a=be(t,e);return l1(a)?tc:Ys},trackEvent:{category:"element"},predicate:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t);return i.length>0&&!i.some(l=>l.locked&&l.frameId)},perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!i.length)return!1;let l=l1(i),r=oe(i);return{elements:e.map(o=>r.has(o.id)?fe(o,{locked:l}):o),appState:{...t,selectedLinearElement:l?null:t.selectedLinearElement},captureUpdate:B.IMMEDIATELY}},keyTest:(e,t,a,n)=>e.key.toLocaleLowerCase()===L.L&&e[L.CTRL_OR_CMD]&&e.shiftKey&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),sk=V({name:"unlockAllElements",paletteName:"Unlock all elements",trackEvent:{category:"canvas"},viewMode:!1,icon:Ys,predicate:(e,t)=>be(e,t).length===0&&e.some(a=>a.locked),perform:(e,t)=>{let a=e.filter(n=>n.locked);return{elements:e.map(n=>n.locked?fe(n,{locked:!1}):n),appState:{...t,selectedElementIds:Object.fromEntries(a.map(n=>[n.id,!0]))},captureUpdate:B.IMMEDIATELY}},label:"labels.elementLock.unlockAll"}),ok=()=>{let[e,t]=se(null),a=at(n=>t(n),[]);return[e,a]},dk=e=>{let{closeOnClickOutside:t=!0}=e,a=L2({className:"excalidraw-modal-container"}),n=re(document.body.classList.contains("excalidraw-animations-disabled"));if(!a)return null;let i=l=>{l.key===L.ESCAPE&&(l.nativeEvent.stopImmediatePropagation(),l.stopPropagation(),e.onCloseRequest())};return nu(M("div",{className:Q("Modal",e.className,{"animations-disabled":n.current}),role:"dialog","aria-modal":"true",onKeyDown:i,"aria-labelledby":e.labelledBy,"data-prevent-outside-click":!0,children:[h("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),h("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),a)},ym=Lt(new Map),vm=async e=>await Ro({elements:e,appState:{exportBackground:!1,viewBackgroundColor:ye.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),ck=(e,t,a)=>{let[n,i]=se();return ae(()=>{if(t)if(e){let l=a.get(e);l?i(l):(async()=>{let r=await vm(t);r.querySelector(".style-fonts")?.remove(),r&&(a.set(e,r),i(r))})()}else(async()=>{let l=await vm(t);i(l)})()},[e,t,a,i]),n},wm=()=>{let[e]=st(ym);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:t=>{t.forEach(a=>e.delete(a))},svgCache:e}},hk=class{constructor(){I(this,"jobs",[]),I(this,"running",!1)}tick(){if(this.running)return;let e=this.jobs.shift();e?(this.running=!0,e.promise.resolve(ri(e.jobFactory,...e.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(e,...t){let a=Gu();return this.jobs.push({jobFactory:e,promise:a,args:t}),this.tick(),a}},uk=["excalidraw.com","raw.githubusercontent.com/excalidraw/excalidraw-libraries"],Em=new fn,Jr=Lt({status:"loaded",isInitialized:!1,libraryItems:[]}),Qr=e=>Ln(e),Uk=(e,t)=>!e.find(a=>a.elements.length!==t.elements.length?!1:a.elements.every((n,i)=>n.id===t.elements[i].id&&n.versionNonce===t.elements[i].versionNonce)),xm=(e,t)=>{let a=[];for(let n of t)Uk(e,n)&&a.push(n);return[...a,...e]},Sm=(e,t)=>{let a=oe(t),n={deletedItems:new Map,addedItems:new Map};for(let l of e)a.has(l.id)||n.deletedItems.set(l.id,l);let i=oe(e);for(let l of t)i.has(l.id)||n.addedItems.set(l.id,l);return n},fk=class{constructor(e){I(this,"currLibraryItems",[]),I(this,"prevLibraryItems",Qr(this.currLibraryItems)),I(this,"app"),I(this,"updateQueue",[]),I(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]),I(this,"notifyListeners",()=>{if(this.updateQueue.length>0)Ga.set(Jr,t=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:t.isInitialized}));else{Ga.set(Jr,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let t=this.prevLibraryItems;this.prevLibraryItems=Qr(this.currLibraryItems);let a=Qr(this.currLibraryItems);this.app.props.onLibraryChange?.(a),Em.trigger(Sm(t,a),a)}catch(t){console.error(t)}}}),I(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],Ga.set(ym,new Map)}),I(this,"resetLibrary",()=>this.setLibrary([])),I(this,"getLatestLibrary",()=>new Promise(async t=>{try{let a=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(Qr(a))}catch{return t(this.currLibraryItems)}})),I(this,"updateLibrary",async({libraryItems:t,prompt:a=!1,merge:n=!1,openLibraryMenu:i=!1,defaultStatus:l="unpublished"})=>(i&&this.app.setState({openSidebar:{name:Aa.name,tab:ks}}),this.setLibrary(()=>new Promise(async(r,o)=>{try{let d=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),u;d instanceof Blob?u=await a2(d,l):u=_r(d,l),!a||window.confirm(E("alerts.confirmAddLibrary",{numShapes:u.length}))?(a&&this.app.focusContainer(),r(n?xm(this.currLibraryItems,u):u)):o(new Qs)}catch(d){o(d)}})))),I(this,"setLibrary",t=>{let a=new Promise(async(n,i)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=Qr(await t),n(this.currLibraryItems)}catch(l){i(l)}}).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!==a),this.notifyListeners()});return this.updateQueue.push(a),this.notifyListeners(),a}),this.app=e}},pk=fk,Mm=e=>{let t=Math.ceil(Math.sqrt(e.length)),a=[],n=U=>e.slice(U*t,U*t+t).reduce((f,p)=>{let{height:m}=Fa(p.elements);return Math.max(f,m)},0),i=U=>{let f=0,p=0,m=0;for(let g of e){if(f%t===0&&(p=0),p===U){let{width:y}=Fa(g.elements);m=Math.max(m,y)}f++,p++}return m},l=0,r=0,o=0,d=0,u=0,s=0,c=0;for(let U of e){u&&u%t===0&&(r+=o+50,l=0,s=0,c++),s===0&&(o=n(c)),d=i(s);let{minX:f,minY:p,width:m,height:g}=Fa(U.elements),y=(d-m)/2,v=(o-g)/2;a.push(...U.elements.map(b=>({...b,x:b.x+l+y-f,y:b.y+r+v-p}))),l+=d+50,u++,s++}return a},mk=(e,t=uk)=>{if(typeof t=="function"?t(e):t.some(a=>{let n=new URL(`https://${a.replace(/^https?:\/\//,"")}`),{hostname:i,pathname:l}=new URL(e);return new RegExp(`(^|\\.)${n.hostname}$`).test(i)&&new RegExp(`^${n.pathname.replace(/\/+$/,"")}(/+|$)`).test(l)}))return!0;throw new Error(`Invalid or disallowed library URL: "${e}"`)},r1=()=>{let e=new URLSearchParams(window.location.hash.slice(1)).get(_d.addLibrary)||new URLSearchParams(window.location.search).get(Pd.addLibrary),t=e?new URLSearchParams(window.location.hash.slice(1)).get("token"):null;return e?{libraryUrl:e,idToken:t}:null},es=class J1{constructor(t){I(this,"adapter"),this.adapter=t}static async getLibraryItems(t,a,n=!0){let i=()=>new Promise(async(l,r)=>{try{let o=await t.load({source:a});l(_r(o?.libraryItems||[],"published"))}catch(o){r(o)}});return n?J1.queue.push(i):i()}getLibraryItems(t){return J1.getLibraryItems(this.adapter,t,!1)}};I(es,"queue",new hk),I(es,"run",async(e,t)=>{let a=new es(e);return es.queue.push(()=>t(a))});var nd=es,ts=0,id=0,ld=e=>Ah(e.map(t=>`${t.id}:${Zp(t.elements)}`).sort().join()),Cm=async(e,t)=>{try{return id++,await nd.run(e,async a=>{let n=oe(await a.getLibraryItems("save"));for(let[o]of t.deletedItems)n.delete(o);let i=[];for(let[o,d]of t.addedItems)n.has(o)?n.set(o,d):i.push(d);let l=i.concat(Array.from(n.values())),r=ld(l);return r!==ts&&await e.save({libraryItems:l}),ts=r,l})}finally{id--}},gk=e=>{let{excalidrawAPI:t}=e,a=re(e);a.current=e;let n=re(!1);ae(()=>{if(!t)return;n.current=!1;let i=async({libraryUrl:o,idToken:d})=>{let u=new Promise(async(c,U)=>{try{o=decodeURIComponent(o),o=Bc(o),mk(o,a.current.validateLibraryUrl);let f=await(await fetch(o)).blob();c(f)}catch(f){U(f)}}),s=d!==t.id;await(s&&document.hidden?new Promise(c=>{window.addEventListener("focus",()=>c(),{once:!0})}):null);try{await t.updateLibrary({libraryItems:u,prompt:s,merge:!0,defaultStatus:"published",openLibraryMenu:!0})}catch(c){throw t.updateScene({appState:{errorMessage:c.message}}),c}finally{if(window.location.hash.includes(_d.addLibrary)){let c=new URLSearchParams(window.location.hash.slice(1));c.delete(_d.addLibrary),window.history.replaceState({},Id,`#${c.toString()}`)}else if(window.location.search.includes(Pd.addLibrary)){let c=new URLSearchParams(window.location.search);c.delete(Pd.addLibrary),window.history.replaceState({},Id,`?${c.toString()}`)}}},l=o=>{o.preventDefault();let d=r1();d&&(o.stopImmediatePropagation(),window.history.replaceState({},"",o.oldURL),i(d))},r=r1();if(r&&i(r),"getInitialLibraryItems"in a.current&&a.current.getInitialLibraryItems&&(console.warn("useHandleLibrar `opts.getInitialLibraryItems` is deprecated. Use `opts.adapter` instead."),Promise.resolve(a.current.getInitialLibraryItems()).then(o=>{t.updateLibrary({libraryItems:o,merge:!0})}).catch(o=>{console.error(`UseHandeLibrary getInitialLibraryItems failed: ${o?.message}`)})),"adapter"in a.current&&a.current.adapter){let o=a.current.adapter,d=a.current.migrationAdapter,u=Gu();d?u.resolve(ri(d.load).then(async s=>{let c=null;try{if(!s)return nd.getLibraryItems(o,"load");c=_r(s.libraryItems||[],"published");let U=await Cm(o,Sm([],c));try{await d.clear()}catch(f){console.error(`couldn't delete legacy library data: ${f.message}`)}return U}catch(U){return console.error(`couldn't migrate legacy library data: ${U.message}`),c}}).catch(s=>(console.error(`error during library migration: ${s.message}`),nd.getLibraryItems(o,"load")))):u.resolve(ri(nd.getLibraryItems,o,"load")),t.updateLibrary({libraryItems:u.then(s=>{let c=s||[];return ts=ld(c),c}),merge:!0}).finally(()=>{n.current=!0})}return window.addEventListener("hashchange",l),()=>{window.removeEventListener("hashchange",l)}},[t]),ae(()=>{let i=Em.on(async(r,o)=>{let d=n.current,u="adapter"in a.current&&a.current.adapter||null;try{u&&ts!==ld(o)&&await Cm(u,r)}catch(s){console.error(`couldn't persist library update: ${s.message}`,r),d&&a.current.excalidrawAPI&&a.current.excalidrawAPI.updateScene({appState:{errorMessage:E("errors.saveLibraryError")}})}}),l=r=>{id&&$7(r)};return window.addEventListener("beforeunload",l),()=>{window.removeEventListener("beforeunload",l),i(),ts=0,id=0}},[])},bk=xi(({children:e,gap:t,align:a,justifyContent:n,className:i,style:l},r)=>h("div",{className:Q("Stack Stack_horizontal",i),style:{"--gap":t,alignItems:a,justifyContent:n,...l},ref:r,children:e})),yk=xi(({children:e,gap:t,align:a,justifyContent:n,className:i,style:l},r)=>h("div",{className:Q("Stack Stack_vertical",i),style:{"--gap":t,justifyItems:a,justifyContent:n,...l},ref:r,children:e})),Ca={Row:bk,Col:yk},vk=({theme:e,id:t,libraryReturnUrl:a})=>{let n=a||window.location.origin+window.location.pathname;return h("a",{className:"library-menu-browse-button",href:`${me.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${n}&useHash=true&token=${t}&theme=${e}&version=${Cs.excalidrawLibrary}`,target:"_excalidraw_libraries",children:E("labels.libraries")})},wk=vk,km=({libraryReturnUrl:e,theme:t,id:a,style:n,children:i,className:l})=>M("div",{className:Q("library-menu-control-buttons",l),style:n,children:[h(wk,{id:a,libraryReturnUrl:e,theme:t}),i]}),Ek=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,xk=/{{([\w-]+)}}/,Sk=/<([\w-]+)>/,Mk=/<\/([\w-]+)>/,Ck=(e,t)=>{let a=[{name:"",children:[]}];return e.split(Ek).filter(Boolean).forEach(n=>{let i=n.match(Sk),l=n.match(Mk),r=n.match(xk);if(i!==null){let o=i[1];t.hasOwnProperty(o)?a.push({name:o,children:[]}):console.warn(`Trans: missed to pass in prop ${o} for interpolating ${e}`)}else if(l!==null)if(l[1]===a[a.length-1].name){let o=a.pop(),d=ee.createElement(ee.Fragment,{},...o.children),u=t[o.name];typeof u=="function"&&a[a.length-1].children.push(u(d))}else console.warn(`Trans: unexpected end tag ${n} for interpolating ${e}`);else if(r!==null){let o=r[1];t.hasOwnProperty(o)?a[a.length-1].children.push(t[o]):console.warn(`Trans: key ${o} not in props for interpolating ${e}`)}else a[a.length-1].children.push(n)}),a.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),a[0].children},kk=({i18nKey:e,children:t,...a})=>{let{t:n}=Rt();return ee.createElement(ee.Fragment,{},...Ck(n(e),a))},bn=kk,Ik=({label:e,onClick:t,className:a,children:n,actionType:i,type:l="button",isLoading:r,...o})=>{let d=i?`Dialog__action-button--${i}`:"";return M("button",{className:Q("Dialog__action-button",d,a),type:l,"aria-label":e,onClick:t,...o,children:[n&&h("div",{style:r?{visibility:"hidden"}:{},children:n}),h("div",{style:r?{visibility:"hidden"}:{},children:e}),r&&h("div",{style:{position:"absolute",inset:0},children:h(Wn,{})})]})},Wl=Ik,Tk=e=>{let{onConfirm:t,onCancel:a,children:n,confirmText:i=E("buttons.confirm"),cancelText:l=E("buttons.cancel"),className:r="",...o}=e,d=wt(),u=$o(o1),{container:s}=vn();return M(ja,{onCloseRequest:a,size:"small",...o,className:`confirm-dialog ${r}`,children:[n,M("div",{className:"confirm-dialog-buttons",children:[h(Wl,{label:l,onClick:()=>{d({openMenu:null}),u(!1),xn(()=>{a()}),s?.focus()}}),h(Wl,{label:i,onClick:()=>{d({openMenu:null}),u(!1),xn(()=>{t()}),s?.focus()},actionType:"danger"})]})]})},Im=Tk,al=class{static has(e){try{return!!window.localStorage.getItem(e)}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),!1}}static get(e){try{let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),null}}};I(al,"set",(e,t)=>{try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(a){return console.warn(`localStorage.setItem error: ${a.message}`),!1}}),I(al,"delete",e=>{try{window.localStorage.removeItem(e)}catch(t){console.warn(`localStorage.removeItem error: ${t.message}`)}});var Lk=async e=>{let t=Math.round(8),a=Math.max(Math.round(128/64),2),n=P7(e,6),i=document.createElement("canvas");i.width=n[0].length*128+(n[0].length+1)*(t*2)-t*2,i.height=n.length*128+(n.length+1)*(t*2)-t*2;let l=i.getContext("2d");l.fillStyle=Mt.white,l.fillRect(0,0,i.width,i.height);for(let[r,o]of e.entries()){let d=await zr({elements:o.elements,files:null,maxWidthOrHeight:128}),{width:u,height:s}=d,c=Math.floor(r/6)*(128+t*2),U=r%6*(128+t*2);l.drawImage(d,U+(128-u)/2+t,c+(128-s)/2+t),l.lineWidth=a,l.strokeStyle=Mt.gray[4],l.strokeRect(U+t/2,c+t/2,128+t,128+t)}return await Bh(new File([await Gr(i)],"preview",{type:ne.png}),{outputType:ne.jpg,maxWidthOrHeight:5e3})},Dk=({libItem:e,appState:t,index:a,onChange:n,onRemove:i})=>{let l=re(null),r=re(null);return ae(()=>{let o=l.current;o&&(async()=>{let d=await Ro({elements:e.elements,appState:{...t,viewBackgroundColor:Mt.white,exportBackground:!0},files:null,skipInliningFonts:!0});o.innerHTML=d.outerHTML})()},[e.elements,t]),M("div",{className:"single-library-item",children:[e.status==="published"&&h("span",{className:"single-library-item-status",children:E("labels.statusPublished")}),h("div",{ref:l,className:"single-library-item__svg"}),h(Me,{"aria-label":E("buttons.remove"),type:"button",icon:xl,className:"single-library-item--remove",onClick:i.bind(null,e.id),title:E("buttons.remove")}),M("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[M("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[M("div",{style:{padding:"0.5em 0"},children:[h("span",{style:{fontWeight:500,color:Mt.gray[6]},children:E("publishDialog.itemName")}),h("span",{"aria-hidden":"true",className:"required",children:"*"})]}),h("input",{type:"text",ref:r,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:o=>{n(o.target.value,a)}})]}),h("span",{className:"error",children:e.error})]})]})},Ak=({onClose:e,libraryItems:t,appState:a,onSuccess:n,onError:i,updateItemsInStorage:l,onRemove:r})=>{let[o,d]=se({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[u,s]=se(!1);ae(()=>{let b=al.get(ir.PUBLISH_LIBRARY);b&&d(b)},[]);let[c,U]=se(t.slice());ae(()=>{U(t.slice())},[t]);let f=b=>{d({...o,[b.target.name]:b.target.value})},p=async b=>{b.preventDefault(),s(!0);let x=[],S=!1;if(c.forEach(A=>{let P="";A.name||(P=E("publishDialog.errors.required"),S=!0),x.push({...A,error:P})}),S){U(x),s(!1);return}let C=await Lk(c),T={type:Da.excalidrawLibrary,version:Cs.excalidrawLibrary,source:Dd,libraryItems:c},k=JSON.stringify(T,null,2),R=new Blob([k],{type:"application/json"}),D=new FormData;D.append("excalidrawLib",R),D.append("previewImage",C),D.append("previewImageType",C.type),D.append("title",o.name),D.append("authorName",o.authorName),D.append("githubHandle",o.githubHandle),D.append("name",o.name),D.append("description",o.description),D.append("twitterHandle",o.twitterHandle),D.append("website",o.website),fetch(`${me.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:D}).then(A=>A.ok?A.json().then(({url:P})=>{al.delete(ir.PUBLISH_LIBRARY),n({url:P,authorName:o.authorName,items:c})}):A.json().catch(()=>{throw new Error(A.statusText||"something went wrong")}).then(P=>{throw new Error(P.message||A.statusText||"something went wrong")}),A=>{console.error(A),i(A),s(!1)}).catch(A=>{console.error(A),i(A),s(!1)})},m=()=>{let b=[];return c.forEach((x,S)=>{b.push(h("div",{className:"single-library-item-wrapper",children:h(Dk,{libItem:x,appState:a,index:S,onChange:(C,T)=>{let k=c.slice();k[T].name=C,U(k)},onRemove:r})},S))}),h("div",{className:"selected-library-items",children:b})},g=at(()=>{l(c),al.set(ir.PUBLISH_LIBRARY,o),e()},[c,e,l,o]),y=!!t.length,v=t.some(b=>b.status==="published");return h(ja,{onCloseRequest:g,title:E("publishDialog.title"),className:"publish-library",children:y?M("form",{onSubmit:p,children:[h("div",{className:"publish-library-note",children:h(bn,{i18nKey:"publishDialog.noteDescription",link:b=>h("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b})})}),h("span",{className:"publish-library-note",children:h(bn,{i18nKey:"publishDialog.noteGuidelines",link:b=>h("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:b})})}),h("div",{className:"publish-library-note",children:E("publishDialog.noteItems")}),v&&h("span",{className:"publish-library-note publish-library-warning",children:E("publishDialog.republishWarning")}),m(),M("div",{className:"publish-library__fields",children:[M("label",{children:[M("div",{children:[h("span",{children:E("publishDialog.libraryName")}),h("span",{"aria-hidden":"true",className:"required",children:"*"})]}),h("input",{type:"text",name:"name",required:!0,value:o.name,onChange:f,placeholder:E("publishDialog.placeholder.libraryName")})]}),M("label",{style:{alignItems:"flex-start"},children:[M("div",{children:[h("span",{children:E("publishDialog.libraryDesc")}),h("span",{"aria-hidden":"true",className:"required",children:"*"})]}),h("textarea",{name:"description",rows:4,required:!0,value:o.description,onChange:f,placeholder:E("publishDialog.placeholder.libraryDesc")})]}),M("label",{children:[M("div",{children:[h("span",{children:E("publishDialog.authorName")}),h("span",{"aria-hidden":"true",className:"required",children:"*"})]}),h("input",{type:"text",name:"authorName",required:!0,value:o.authorName,onChange:f,placeholder:E("publishDialog.placeholder.authorName")})]}),M("label",{children:[h("span",{children:E("publishDialog.githubUsername")}),h("input",{type:"text",name:"githubHandle",value:o.githubHandle,onChange:f,placeholder:E("publishDialog.placeholder.githubHandle")})]}),M("label",{children:[h("span",{children:E("publishDialog.twitterUsername")}),h("input",{type:"text",name:"twitterHandle",value:o.twitterHandle,onChange:f,placeholder:E("publishDialog.placeholder.twitterHandle")})]}),M("label",{children:[h("span",{children:E("publishDialog.website")}),h("input",{type:"text",name:"website",pattern:"https?://.+",title:E("publishDialog.errors.website"),value:o.website,onChange:f,placeholder:E("publishDialog.placeholder.website")})]}),h("span",{className:"publish-library-note",children:h(bn,{i18nKey:"publishDialog.noteLicense",link:b=>h("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:b})})})]}),M("div",{className:"publish-library__buttons",children:[h(Wl,{label:E("buttons.cancel"),onClick:g,"data-testid":"cancel-clear-canvas-button"}),h(Wl,{type:"submit",label:E("buttons.submit"),actionType:"primary",isLoading:u})]})]}):h("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:E("publishDialog.atleastOneLibItem")})})},Rk=Ak,Tm=({className:e="",children:t,onToggle:a,title:n,...i})=>{let l=vt(),r=Q(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":l.editor.isMobile}).trim();return h("button",{"data-prevent-outside-click":!0,className:r,onClick:a,type:"button","data-testid":"dropdown-menu-button",title:n,...i,children:t})},Nk=Tm;Tm.displayName="DropdownMenuTrigger";var Lm=()=>h("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:".5rem 0"}}),Pk=Lm;Lm.displayName="DropdownMenuSeparator";var Dm=({children:e,onClickOutside:t,className:a="",onSelect:n,style:i})=>{let l=vt(),r=re(null),o=Yo({onClickOutside:t});Wh(r,()=>{o.onClickOutside?.()}),ae(()=>{let u=c=>{c.key===L.ESCAPE&&(c.stopImmediatePropagation(),o.onClickOutside?.())},s={capture:!0};return document.addEventListener("keydown",u,s),()=>{document.removeEventListener("keydown",u,s)}},[o]);let d=Q(`dropdown-menu ${a}`,{"dropdown-menu--mobile":l.editor.isMobile}).trim();return h(O2.Provider,{value:{onSelect:n},children:h("div",{ref:r,className:d,style:i,"data-testid":"dropdown-menu",children:l.editor.isMobile?h(Ca.Col,{className:"dropdown-menu-container",children:e}):h(Va,{className:"dropdown-menu-container",padding:2,style:{zIndex:2},children:e})})})};Dm.displayName="DropdownMenuContent";var _k=Dm,Am=({icon:e,shortcut:t,href:a,children:n,onSelect:i,className:l="",selected:r,rel:o="noreferrer",...d})=>{let u=z2(d.onClick,i);return h("a",{...d,href:a,target:"_blank",rel:"noreferrer",className:B2(l,r),title:d.title??d["aria-label"],onClick:u,children:h(F2,{icon:e,shortcut:t,children:n})})},rd=Am;Am.displayName="DropdownMenuItemLink";var Ok=({children:e,className:t="",selected:a,...n})=>h("div",{...n,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${a?"dropdown-menu-item--selected":""}`.trim(),children:e}),Bk=Ok,zk=e=>ee.Children.toArray(e).find(a=>ee.isValidElement(a)&&typeof a.type!="string"&&a?.type.displayName&&a.type.displayName==="DropdownMenuTrigger")||null,Fk=e=>ee.Children.toArray(e).find(a=>ee.isValidElement(a)&&typeof a.type!="string"&&a?.type.displayName&&a.type.displayName==="DropdownMenuContent")||null,Gn=({children:e,open:t})=>{let a=zk(e),n=Fk(e);return M(te,{children:[a,t&&n]})};Gn.Trigger=Nk,Gn.Content=_k,Gn.Item=Ma,Gn.ItemLink=rd,Gn.ItemCustom=Bk,Gn.Group=Yh,Gn.Separator=Pk;var Ve=Gn;Gn.displayName="DropdownMenu";var $k=(e,t)=>e.filter(a=>t.includes(a.id)),Hk=({setAppState:e,selectedItems:t,library:a,onRemoveFromLibrary:n,resetLibrary:i,onSelectItems:l,appState:r,className:o})=>{let[d]=st(Jr),[u,s]=st(o1),c=()=>{let D=t.length?E("alerts.removeItemsFromsLibrary",{count:t.length}):E("alerts.resetLibrary"),A=t.length?E("confirmDialog.removeItemsFromLib"):E("confirmDialog.resetLibrary");return h(Im,{onConfirm:()=>{t.length?n():i(),f(!1)},onCancel:()=>{f(!1)},title:A,children:h("p",{children:D})})},[U,f]=se(!1),p=!!t.length,m=p?d.libraryItems.filter(D=>t.includes(D.id)):d.libraryItems,g=E(p?"buttons.remove":"buttons.resetLibrary"),[y,v]=se(!1),[b,x]=se(null),S=at(()=>M(ja,{onCloseRequest:()=>x(null),title:E("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[h("p",{children:h(bn,{i18nKey:"publishSuccessDialog.content",authorName:b.authorName,link:D=>h("a",{href:b?.url,target:"_blank",rel:"noopener noreferrer",children:D})})}),h(Me,{type:"button",title:E("buttons.close"),"aria-label":E("buttons.close"),label:E("buttons.close"),onClick:()=>x(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[x,b]),C=(D,A)=>{v(!1),x({url:D.url,authorName:D.authorName});let P=A.slice();P.forEach($=>{t.includes($.id)&&($.status="published")}),a.setLibrary(P)},T=async()=>{try{await a.updateLibrary({libraryItems:Yc({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(D){if(D?.name==="AbortError"){console.warn(D);return}e({errorMessage:E("errors.importLibraryError")})}},k=async()=>{let D=p?m:await a.getLatestLibrary();sx(D).catch(Xu).catch(A=>{e({errorMessage:A.message})})},R=()=>M(Ve,{open:u,children:[h(Ve.Trigger,{onToggle:()=>s(!u),children:b8}),M(Ve.Content,{onClickOutside:()=>s(!1),onSelect:()=>s(!1),className:"library-menu",children:[!p&&h(Ve.Item,{onSelect:T,icon:sc,"data-testid":"lib-dropdown--load",children:E("buttons.load")}),!!m.length&&h(Ve.Item,{onSelect:k,icon:js,"data-testid":"lib-dropdown--export",children:E("buttons.export")}),!!m.length&&h(Ve.Item,{onSelect:()=>f(!0),icon:Bi,children:g}),p&&h(Ve.Item,{icon:T3,onSelect:()=>v(!0),"data-testid":"lib-dropdown--remove",children:E("buttons.publishLibrary")})]})]});return M("div",{className:Q("library-menu-dropdown-container",o),children:[R(),t.length>0&&h("div",{className:"library-actions-counter",children:t.length}),U&&c(),y&&h(Rk,{onClose:()=>v(!1),libraryItems:$k(d.libraryItems,t),appState:r,onSuccess:D=>C(D,d.libraryItems),onError:D=>window.alert(D),updateItemsInStorage:()=>a.setLibrary(d.libraryItems),onRemove:D=>l(t.filter(A=>A!==D))}),b&&S()]})},Rm=({selectedItems:e,onSelectItems:t,className:a})=>{let{library:n}=Ka(),{clearLibraryCache:i,deleteItemsFromLibraryCache:l}=wm(),r=Nt(),o=wt(),[d]=st(Jr),u=async s=>{let c=s.filter(U=>!e.includes(U.id));n.setLibrary(c).catch(()=>{o({errorMessage:E("alerts.errorRemovingFromLibrary")})}),l(e),t([])};return h(Hk,{appState:r,setAppState:o,selectedItems:e,onSelectItems:t,library:n,onRemoveFromLibrary:()=>u(d.libraryItems),resetLibrary:()=>{n.resetLibrary(),i()},className:a})},Xk=il(({id:e,elements:t,isPending:a,onClick:n,selected:i,onToggle:l,onDrag:r,svgCache:o})=>{let d=re(null),u=ck(e,t,o);ae(()=>{let p=d.current;if(p)return u&&(p.innerHTML=u.outerHTML),()=>{p.innerHTML=""}},[u]);let[s,c]=se(!1),U=vt().editor.isMobile,f=a&&h("div",{className:"library-unit__adder",children:g8});return M("div",{className:Q("library-unit",{"library-unit__active":t,"library-unit--hover":t&&s,"library-unit--selected":i,"library-unit--skeleton":!u}),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[h("div",{className:Q("library-unit__dragger",{"library-unit__pulse":!!a}),ref:d,draggable:!!t,onClick:t||a?p=>{e&&p.shiftKey?l(e,p):n(e)}:void 0,onDragStart:p=>{if(!e){p.preventDefault();return}c(!1),r(e,p)}}),f,e&&t&&(s||U||i)&&h(qh,{checked:i,onChange:(p,m)=>l(e,m),className:"library-unit__checkbox"})]})}),Wk=()=>h("div",{className:"library-unit library-unit--skeleton"});function Gk(){return[!1,at(e=>e(),[])]}var Vk=ee.useTransition||Gk,Nm=({children:e})=>h("div",{className:"library-menu-items-container__grid",children:e}),s1=il(({items:e,onItemSelectToggle:t,onItemDrag:a,isItemSelected:n,onClick:i,svgCache:l,itemsRenderedPerBatch:r})=>{let[,o]=Vk(),[d,u]=se(0);return ae(()=>{d<e.length&&o(()=>{u(d+r)})},[d,e.length,o,r]),h(te,{children:e.map((s,c)=>c<d?h(Xk,{elements:s?.elements,isPending:!s?.id&&!!s?.elements,onClick:i,svgCache:l,id:s?.id,selected:n(s.id),onToggle:t,onDrag:a},s?.id??c):h(Wk,{},c))})}),Yk=Lt(0),jk=e=>{let[t,a]=st(Yk);return ae(()=>{let{current:n}=e;if(!n)return;let i=Kl(()=>{let{scrollTop:l}=n;a(l)},200);return n.addEventListener("scroll",i),()=>{i.cancel(),n.removeEventListener("scroll",i)}},[e,a]),t},Zk=17,Kk=64;function qk({isLoading:e,libraryItems:t,onAddToLibrary:a,onInsertLibraryItems:n,pendingElements:i,theme:l,id:r,libraryReturnUrl:o,onSelectItems:d,selectedItems:u}){let s=re(null),c=jk(s);ae(()=>{c>0&&s.current?.scrollTo(0,c)},[]);let{svgCache:U}=wm(),f=mt(()=>t.filter(D=>D.status!=="published"),[t]),p=mt(()=>t.filter(D=>D.status==="published"),[t]),m=!t.length&&!i.length,g=!i.length&&!f.length&&!p.length,[y,v]=se(null),b=at((D,A)=>{let P=!u.includes(D),$=[...f,...p];if(P){if(A.shiftKey&&y){let X=$.findIndex(K=>K.id===y),_=$.findIndex(K=>K.id===D);if(X===-1||_===-1){d([...u,D]);return}let H=oe(u),W=$.reduce((K,G,ce)=>((ce>=X&&ce<=_||H.has(G.id))&&K.push(G.id),K),[]);d(W)}else d([...u,D]);v(D)}else v(null),d(u.filter(X=>X!==D))},[y,d,p,u,f]),x=at(D=>{let A;return u.includes(D)?A=t.filter(P=>u.includes(P.id)):A=t.filter(P=>P.id===D),A.map(P=>({...P,elements:g0(P.elements,{randomizeSeed:!0})}))},[t,u]),S=at((D,A)=>{A.dataTransfer.setData(ne.excalidrawlib,jc(x(D)))},[x]),C=at(D=>D?u.includes(D):!1,[u]),T=at(()=>{a(i)},[i,a]),k=at(D=>{D&&n(x(D))},[x,n]),R=U.size>=t.length?Kk:Zk;return M("div",{className:"library-menu-items-container",style:i.length||f.length||p.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[!g&&h(Rm,{selectedItems:u,onSelectItems:d,className:"library-menu-dropdown-container--in-heading"}),M(Ca.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:p.length>0?1:"0 1 auto",marginBottom:0},ref:s,children:[M(te,{children:[!g&&h("div",{className:"library-menu-items-container__header",children:E("labels.personalLib")}),e&&h("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:h(Wn,{})}),!i.length&&!f.length?M("div",{className:"library-menu-items__no-items",children:[h("div",{className:"library-menu-items__no-items__label",children:E("library.noItems")}),h("div",{className:"library-menu-items__no-items__hint",children:p.length>0?E("library.hint_emptyPrivateLibrary"):E("library.hint_emptyLibrary")})]}):M(Nm,{children:[i.length>0&&h(s1,{itemsRenderedPerBatch:R,items:[{id:null,elements:i}],onItemSelectToggle:b,onItemDrag:S,onClick:T,isItemSelected:C,svgCache:U}),h(s1,{itemsRenderedPerBatch:R,items:f,onItemSelectToggle:b,onItemDrag:S,onClick:k,isItemSelected:C,svgCache:U})]})]}),M(te,{children:[(p.length>0||i.length>0||f.length>0)&&h("div",{className:"library-menu-items-container__header library-menu-items-container__header--excal",children:E("labels.excalidrawLib")}),p.length>0?h(Nm,{children:h(s1,{itemsRenderedPerBatch:R,items:p,onItemSelectToggle:b,onItemDrag:S,onClick:k,isItemSelected:C,svgCache:U})}):f.length>0?h("div",{style:{margin:"1rem 0",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",fontSize:".9rem"},children:E("library.noItems")}):null]}),m&&h(km,{style:{padding:"16px 0",width:"100%"},id:r,libraryReturnUrl:o,theme:l,children:h(Rm,{selectedItems:u,onSelectItems:d})})]})]})}var o1=Lt(!1),Pm=({children:e})=>h("div",{className:"layer-ui__library",children:e}),Jk=il(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:a,setAppState:n,libraryReturnUrl:i,library:l,id:r,theme:o,selectedItems:d,onSelectItems:u})=>{let[s]=st(Jr),c=at(p=>{(async(m,g)=>{Ge("element","addToLibrary","ui");for(let v of Mu)if(m.some(b=>b.type===v))return n({errorMessage:E(`errors.libraryElementTypeError.${v}`)});let y=[{status:"unpublished",elements:m,id:xa(),created:Date.now()},...g];a(),l.setLibrary(y).catch(()=>{n({errorMessage:E("alerts.errorAddingToLibrary")})})})(p,s.libraryItems)},[a,l,n,s.libraryItems]),U=mt(()=>s.libraryItems,[s]);if(s.status==="loading"&&!s.isInitialized)return h(Pm,{children:h("div",{className:"layer-ui__library-message",children:M("div",{children:[h(Wn,{size:"2em"}),h("span",{children:E("labels.libraryLoadingMessage")})]})})});let f=s.libraryItems.length>0||t.length>0;return M(Pm,{children:[h(qk,{isLoading:s.status==="loading",libraryItems:U,onAddToLibrary:c,onInsertLibraryItems:e,pendingElements:t,id:r,libraryReturnUrl:i,theme:o,onSelectItems:u,selectedItems:d}),f&&h(km,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:r,libraryReturnUrl:i,theme:o})]})}),d1=(e,t)=>({elements:e,pending:be(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),Qk=(e,t)=>{let a=gd(),[n,i]=se(()=>d1(a,e.selectedElementIds)),l=re(new Map);return ae(()=>{for(let r of n.pending)l.current.set(r.id,r.version)},[n.pending]),ae(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&i(r=>{if(!At(r.selectedElementIds,e.selectedElementIds))return l.current.clear(),d1(a,e.selectedElementIds);let o=t.scene.getNonDeletedElementsMap();for(let d of Object.keys(e.selectedElementIds)){let u=o.get(d)?.version;if(u&&u!==l.current.get(d))return d1(a,e.selectedElementIds)}return r})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,a]),n.pending},eI=il(()=>{let e=Ka(),{onInsertElements:t}=e,a=os(),n=Nt(),i=wt(),[l,r]=se([]),o=mt(()=>e.library,[e.library]),d=Qk(n,e),u=at(c=>{t(Mm(c))},[t]),s=at(()=>{i({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[i]);return h(Jk,{pendingElements:d,onInsertLibraryItems:u,onAddToLibrary:s,setAppState:i,libraryReturnUrl:a.libraryReturnUrl,library:o,id:e.id,theme:n.theme,selectedItems:l,onSelectItems:r})});function tI(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;default:return 800}}var ja=e=>{let[t,a]=ok(),[n]=se(document.activeElement),{id:i}=vn(),l=vt().viewport.isMobile;ae(()=>{if(!t)return;let u=Vd(t);setTimeout(()=>{u.length>0&&e.autofocus!==!1&&(u[1]||u[0]).focus()});let s=c=>{if(c.key===L.TAB){let U=Vd(t),{activeElement:f}=document,p=U.findIndex(m=>m===f);p===0&&c.shiftKey?(U[U.length-1].focus(),c.preventDefault()):p===U.length-1&&!c.shiftKey&&(U[0].focus(),c.preventDefault())}};return t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s)},[t,e.autofocus]);let r=wt(),o=$o(o1),d=()=>{r({openMenu:null}),o(!1),n.focus(),e.onCloseRequest()};return h(dk,{className:Q("Dialog",e.className,{"Dialog--fullscreen":l}),labelledBy:"dialog-title",maxWidth:tI(e.size),onCloseRequest:d,closeOnClickOutside:e.closeOnClickOutside,children:M(Va,{ref:a,children:[e.title&&h("h2",{id:`${i}-dialog-title`,className:"Dialog__title",children:h("span",{className:"Dialog__titleContent",children:e.title})}),l&&h("button",{className:"Dialog__close",onClick:d,title:E("buttons.close"),"aria-label":E("buttons.close"),type:"button",children:xl}),h("div",{className:"Dialog__content",children:e.children})]})})},yi=({type:e="button",onSelect:t,selected:a,children:n,className:i="",...l})=>h("button",{onClick:Fs(l.onClick,r=>{t()}),type:e,className:Q("excalidraw-button",i,{selected:a}),...l,children:n}),c1=xi(({onChange:e,label:t,fullWidth:a,placeholder:n,readonly:i,selectOnRender:l,onKeyDown:r,isRedacted:o=!1,icon:d,className:u,...s},c)=>{let U=re(null);eu(c,()=>U.current),Ia(()=>{l&&(U.current?.focus(),U.current?.select())},[l]);let[f,p]=se(!1);return M("div",{className:Q("ExcTextField",u,{"ExcTextField--fullWidth":a,"ExcTextField--hasIcon":!!d}),onClick:()=>{U.current?.focus()},children:[d,t&&h("div",{className:"ExcTextField__label",children:t}),M("div",{className:Q("ExcTextField__input",{"ExcTextField__input--readonly":i}),children:[h("input",{className:Q({"is-redacted":"value"in s&&s.value&&o&&!f}),readOnly:i,value:"value"in s?s.value:void 0,defaultValue:"defaultValue"in s?s.defaultValue:void 0,placeholder:n,ref:U,onChange:m=>e?.(m.target.value),onKeyDown:r}),o&&h(yi,{onSelect:()=>p(!f),style:{border:0,userSelect:"none"},children:f?O3:hc})]})]})}),aI={toggleTheme:[z("Shift+Alt+D")],saveScene:[z("CtrlOrCmd+S")],loadScene:[z("CtrlOrCmd+O")],clearCanvas:[z("CtrlOrCmd+Delete")],imageExport:[z("CtrlOrCmd+Shift+E")],commandPalette:[z("CtrlOrCmd+/"),z("CtrlOrCmd+Shift+P")],cut:[z("CtrlOrCmd+X")],copy:[z("CtrlOrCmd+C")],paste:[z("CtrlOrCmd+V")],copyStyles:[z("CtrlOrCmd+Alt+C")],pasteStyles:[z("CtrlOrCmd+Alt+V")],selectAll:[z("CtrlOrCmd+A")],deleteSelectedElements:[z("Delete")],duplicateSelection:[z("CtrlOrCmd+D"),z(`Alt+${E("helpDialog.drag")}`)],sendBackward:[z("CtrlOrCmd+[")],bringForward:[z("CtrlOrCmd+]")],sendToBack:[z(en?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[z(en?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[z("Shift+Alt+C")],group:[z("CtrlOrCmd+G")],ungroup:[z("CtrlOrCmd+Shift+G")],gridMode:[z("CtrlOrCmd+'")],zenMode:[z("Alt+Z")],objectsSnapMode:[z("Alt+S")],stats:[z("Alt+/")],addToLibrary:[],flipHorizontal:[z("Shift+H")],flipVertical:[z("Shift+V")],viewMode:[z("Alt+R")],hyperlink:[z("CtrlOrCmd+K")],toggleElementLock:[z("CtrlOrCmd+Shift+L")],resetZoom:[z("CtrlOrCmd+0")],zoomOut:[z("CtrlOrCmd+-")],zoomIn:[z("CtrlOrCmd++")],zoomToFitSelection:[z("Shift+3")],zoomToFit:[z("Shift+1")],zoomToFitSelectionInViewport:[z("Shift+2")],toggleEraserTool:[z("E")],toggleHandTool:[z("H")],setFrameAsActiveTool:[z("F")],saveFileToDisk:[z("CtrlOrCmd+S")],saveToActiveFile:[z("CtrlOrCmd+S")],toggleShortcuts:[z("?")],searchMenu:[z("CtrlOrCmd+F")],wrapSelectionInFrame:[]},Ft=(e,t=0)=>{let a=aI[e];return a&&a.length>0?a[t]||a[0]:""},nI="\\u0300-\\u036f",iI="\\ufe20-\\ufe2f",lI="\\u20d0-\\u20ff",rI=nI+iI+lI,sI=`[${rI}]`,oI=RegExp(sI,"g"),dI=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,cI={\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"},_m=e=>e.replace(dI,t=>cI[t]||t).replace(oI,""),Om=ee.createContext(null),Yt=()=>ee.useContext(Om),hI=au(),uI=()=>ee.useMemo(()=>({MainMenuTunnel:Qa(),WelcomeScreenMenuHintTunnel:Qa(),WelcomeScreenToolbarHintTunnel:Qa(),WelcomeScreenHelpHintTunnel:Qa(),WelcomeScreenCenterTunnel:Qa(),FooterCenterTunnel:Qa(),DefaultSidebarTriggerTunnel:Qa(),DefaultSidebarTabTriggersTunnel:Qa(),OverwriteConfirmDialogTunnel:Qa(),TTDDialogTriggerTunnel:Qa(),tunnelsJotai:hI}),[]),Bm=(e,t)=>{let a=t[0]?.type||null;for(let n of t)if(n.type!==a){a=null;break}return Cc(e.activeTool.type)&&e.activeTool.type!=="image"&&a!=="image"&&a!=="frame"&&a!=="magicframe"||t.some(n=>Cc(n.type))},zm=(e,t)=>Cl(e.activeTool.type)||t.some(a=>Cl(a.type)),Fm=({appState:e,elementsMap:t,renderAction:a,app:n})=>{let i=Ap(t,e),l=!1;i.length===2&&(wa(i[0])||wa(i[1]))&&(l=!0);let r=!!(e.editingTextElement||e.newElement),o=vt(),d=document.documentElement.getAttribute("dir")==="rtl",u=Cl(e.activeTool.type)&&!Pa(e.currentItemBackgroundColor)||i.some(p=>Cl(p.type)&&!Pa(p.backgroundColor)),s=i.length===1||l,c=!e.editingLinearElement&&i.length===1&&he(i[0])&&!q(i[0]),U=!e.croppingElementId&&i.length===1&&Le(i[0]),f=!l&&Ua(e,n);return M("div",{className:"panelColumn",children:[h("div",{children:Bm(e,i)&&a("changeStrokeColor")}),zm(e,i)&&h("div",{children:a("changeBackgroundColor")}),u&&a("changeFillStyle"),(yf(e.activeTool.type)||i.some(p=>yf(p.type)))&&a("changeStrokeWidth"),(e.activeTool.type==="freedraw"||i.some(p=>p.type==="freedraw"))&&a("changeStrokeShape"),(vf(e.activeTool.type)||i.some(p=>vf(p.type)))&&M(te,{children:[a("changeStrokeStyle"),a("changeSloppiness")]}),(kc(e.activeTool.type)||i.some(p=>kc(p.type)))&&h(te,{children:a("changeRoundness")}),(wf(e.activeTool.type)||i.some(p=>wf(p.type)))&&h(te,{children:a("changeArrowType")}),(e.activeTool.type==="text"||i.some(j))&&M(te,{children:[a("changeFontFamily"),a("changeFontSize"),(e.activeTool.type==="text"||DE(i,t))&&a("changeTextAlign")]}),LE(i,t)&&a("changeVerticalAlign"),(no(e.activeTool.type)||i.some(p=>no(p.type)))&&h(te,{children:a("changeArrowhead")}),a("changeOpacity"),M("fieldset",{children:[h("legend",{children:E("labels.layers")}),M("div",{className:"buttonList",children:[a("sendToBack"),a("sendBackward"),a("bringForward"),a("bringToFront")]})]}),f&&!l&&M("fieldset",{children:[h("legend",{children:E("labels.align")}),M("div",{className:"buttonList",children:[d?M(te,{children:[a("alignRight"),a("alignHorizontallyCentered"),a("alignLeft")]}):M(te,{children:[a("alignLeft"),a("alignHorizontallyCentered"),a("alignRight")]}),i.length>2&&a("distributeHorizontally"),h("div",{style:{flexBasis:"100%",height:0}}),M("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[a("alignTop"),a("alignVerticallyCentered"),a("alignBottom"),i.length>2&&a("distributeVertically")]})]})]}),!r&&i.length>0&&M("fieldset",{children:[h("legend",{children:E("labels.actions")}),M("div",{className:"buttonList",children:[!o.editor.isMobile&&a("duplicateSelection"),!o.editor.isMobile&&a("deleteSelectedElements"),a("group"),a("ungroup"),s&&a("hyperlink"),U&&a("cropEditor"),c&&a("toggleLinearEditor")]})]})]})},$m=({activeTool:e,appState:t,app:a,UIOptions:n})=>{let[i,l]=se(!1),r=e.type==="frame",o=e.type==="laser",d=e.type==="embeddable",{TTDDialogTriggerTunnel:u}=Yt();return M(te,{children:[Ec.map(({value:s,icon:c,key:U,numericKey:f,fillable:p},m)=>{if(n.tools?.[s]===!1)return null;let g=E(`toolBar.${s}`),y=U&&hr(typeof U=="string"?U:U[0]),v=y?`${y} ${E("helpDialog.or")} ${f}`:`${f}`;return h(Me,{className:Q("Shape",{fillable:p}),type:"radio",icon:c,checked:e.type===s,name:"editor-current-shape",title:`${hr(g)} \u2014 ${v}`,keyBindingLabel:f||y,"aria-label":hr(g),"aria-keyshortcuts":v,"data-testid":`toolbar-${s}`,onPointerDown:({pointerType:b})=>{!t.penDetected&&b==="pen"&&a.togglePenMode(!0)},onChange:({pointerType:b})=>{t.activeTool.type!==s&&Ge("toolbar",s,"ui"),s==="image"?a.setActiveTool({type:s,insertOnCanvasDirectly:b!=="mouse"}):a.setActiveTool({type:s})}},s)}),h("div",{className:"App-toolbar__divider"}),M(Ve,{open:i,children:[h(Ve.Trigger,{className:Q("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":r||d||o&&!a.props.isCollaborating}),onToggle:()=>l(!i),title:E("toolBar.extraTools"),children:P3}),M(Ve.Content,{onClickOutside:()=>l(!1),onSelect:()=>l(!1),className:"App-toolbar__extra-tools-dropdown",children:[h(Ve.Item,{onSelect:()=>a.setActiveTool({type:"frame"}),icon:PU,shortcut:L.F.toLocaleUpperCase(),"data-testid":"toolbar-frame",selected:r,children:E("toolBar.frame")}),h(Ve.Item,{onSelect:()=>a.setActiveTool({type:"embeddable"}),icon:R8,"data-testid":"toolbar-embeddable",selected:d,children:E("toolBar.embeddable")}),h(Ve.Item,{onSelect:()=>a.setActiveTool({type:"laser"}),icon:OU,"data-testid":"toolbar-laser",selected:o,shortcut:L.K.toLocaleUpperCase(),children:E("toolBar.laser")}),h("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),a.props.aiEnabled!==!1&&h(u.Out,{}),h(Ve.Item,{onSelect:()=>a.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:_U,"data-testid":"toolbar-embeddable",children:E("toolBar.mermaidToExcalidraw")}),a.props.aiEnabled!==!1&&a.plugins.diagramToCode&&h(te,{children:M(Ve.Item,{onSelect:()=>a.onMagicframeToolSelect(),icon:BU,"data-testid":"toolbar-magicframe",children:[E("toolBar.magicframe"),h(Ve.Item.Badge,{children:"AI"})]})})]})]})]})},UI=({renderAction:e,zoom:t})=>h(Ca.Col,{gap:1,className:dl.ZOOM_ACTIONS,children:M(Ca.Row,{align:"center",children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]})}),fI=({renderAction:e,className:t})=>M("div",{className:`undo-redo-buttons ${t}`,children:[h("div",{className:"undo-button-container",children:h(tl,{label:E("buttons.undo"),children:e("undo")})}),h("div",{className:"redo-button-container",children:M(tl,{label:E("buttons.redo"),children:[" ",e("redo")]})})]}),pI=({actionManager:e,showExitZenModeBtn:t})=>h("button",{type:"button",className:Q("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(e1),children:E("buttons.exitZenMode")}),mI=({renderAction:e,className:t})=>h("div",{className:`finalize-button ${t}`,children:e("finalize",{size:"small"})}),Hm=e=>{let t=re({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...a)=>t.current.userFn(...a)),t.current.stableFn},sd=Lt(null),gI=()=>{let[e,t]=st(sd),a=sa();return e&&e==="clearCanvas"?h(Im,{onConfirm:()=>{a.executeAction(Kr),t(null)},onCancel:()=>t(null),title:E("clearCanvasDialog.title"),children:M("p",{className:"clear-canvas__content",children:[" ",E("alerts.clearReset")]})}):null},Xm={};hu(Xm,{toggleTheme:()=>bI});var bI={...qo,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(qo,"commandPalette")}},Wm=V({name:"copyElementLink",label:"labels.copyElementLink",icon:cc,trackEvent:{category:"element"},perform:async(e,t,a,n)=>{let i=be(e,t);try{if(window.location){let l=H0(i,t);return l?(await Bl(n.props.generateLinkForSelection?n.props.generateLinkForSelection(l.id,l.type):$0(l.id,l.type)),{appState:{toast:{message:E("toast.elementLinkCopied"),closable:!0}},captureUpdate:B.EVENTUALLY}):{appState:t,elements:e,app:n,captureUpdate:B.EVENTUALLY}}}catch(l){console.error(l)}return{appState:t,elements:e,app:n,captureUpdate:B.EVENTUALLY}},predicate:(e,t)=>Io(be(e,t))}),yI=V({name:"linkToElement",label:"labels.linkToElement",icon:XU,perform:(e,t,a,n)=>{let i=be(e,t);return i.length!==1||!Io(i)?{elements:e,appState:t,app:n,captureUpdate:B.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:be(e,t)[0].id}},captureUpdate:B.IMMEDIATELY}},predicate:(e,t,a,n)=>{let i=be(e,t);return t.openDialog?.name!=="elementLinkSelector"&&i.length===1&&Io(i)},trackEvent:!1}),vI=Lt(null),ht={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links"},wI=e=>{switch(e){case ht.app:return 1;case ht.export:return 2;case ht.editor:return 3;case ht.tools:return 4;case ht.elements:return 5;case ht.links:return 6;default:return 10}},od=({shortcut:e,className:t,children:a})=>{let n=e.replace("++","+$").split("+");return M("div",{className:Q("shortcut",t),children:[n.map((i,l)=>h("div",{className:"shortcut-wrapper",children:h("div",{className:"shortcut-key",children:i==="$"?"+":i})},i)),h("div",{className:"shortcut-desc",children:a})]})},Gm=e=>!e.altKey&&e[L.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===L.P||e.key===L.SLASH);Object.assign(e=>{let t=Nt(),a=wt();return ae(()=>{let n=i=>{Gm(i)&&(i.preventDefault(),i.stopPropagation(),a(l=>{let r=l.openDialog?.name==="commandPalette"?null:{name:"commandPalette"};return r&&Ge("command_palette","open","shortcut"),{openDialog:r}}))};return window.addEventListener("keydown",n,{capture:!0}),()=>window.removeEventListener("keydown",n,{capture:!0})},[a]),t.openDialog?.name!=="commandPalette"?null:h(EI,{...e})},{defaultItems:Xm});function EI({customCommandPaletteItems:e}){let t=Ka(),a=Nt(),n=wt(),i=os(),l=sa(),[r,o]=st(vI),[d,u]=se(null),s=re(null),c=Yo({uiAppState:a,customCommandPaletteItems:e,appProps:i});ae(()=>{let{uiAppState:C,customCommandPaletteItems:T,appProps:k}=c,R=$=>{let X="";return $.label&&(typeof $.label=="function"?X=E($.label(t.scene.getNonDeletedElements(),C,t)):X=E($.label)),X},D=$=>typeof $.icon=="function"?$.icon(C,t.scene.getNonDeletedElements()):$.icon,A=[],P=($,X,_)=>{let H={label:R($),icon:D($),category:X,shortcut:Ft($.name),keywords:$.keywords,predicate:$.predicate,viewMode:$.viewMode,perform:()=>{l.executeAction($,"commandPalette")}};return _?_(H,$):H};if(C&&t.scene&&l){let $=[l.actions.group,l.actions.ungroup,l.actions.cut,l.actions.copy,l.actions.deleteSelectedElements,l.actions.wrapSelectionInFrame,l.actions.copyStyles,l.actions.pasteStyles,l.actions.bringToFront,l.actions.bringForward,l.actions.sendBackward,l.actions.sendToBack,l.actions.alignTop,l.actions.alignBottom,l.actions.alignLeft,l.actions.alignRight,l.actions.alignVerticallyCentered,l.actions.alignHorizontallyCentered,l.actions.duplicateSelection,l.actions.flipHorizontal,l.actions.flipVertical,l.actions.zoomToFitSelection,l.actions.zoomToFitSelectionInViewport,l.actions.increaseFontSize,l.actions.decreaseFontSize,l.actions.toggleLinearEditor,l.actions.cropEditor,bm,Wm,yI].map(G=>P(G,ht.elements,(ce,xe)=>({...ce,predicate:xe.predicate?xe.predicate:(Ce,ut,Zt,fa)=>be(Ce,ut).length>0}))),X=[l.actions.toggleHandTool,l.actions.setFrameAsActiveTool].map(G=>P(G,ht.tools)),_=[l.actions.undo,l.actions.redo,l.actions.zoomIn,l.actions.zoomOut,l.actions.resetZoom,l.actions.zoomToFit,l.actions.zenMode,l.actions.viewMode,l.actions.gridMode,l.actions.objectsSnapMode,l.actions.toggleShortcuts,l.actions.selectAll,l.actions.toggleElementLock,l.actions.unlockAllElements,l.actions.stats].map(G=>P(G,ht.editor)),H=[l.actions.saveToActiveFile,l.actions.saveFileToDisk,l.actions.copyAsPng,l.actions.copyAsSvg].map(G=>P(G,ht.export));A=[...$,..._,{label:R(Kr),icon:D(Kr),shortcut:Ft(Kr.name),category:ht.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{Ga.set(sd,"clearCanvas")}},{label:E("buttons.exportImage"),category:ht.export,icon:UU,shortcut:Ft("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{n({openDialog:{name:"imageExport"}})}},...H];let W=[{label:E("toolBar.library"),category:ht.app,icon:ec,viewMode:!1,perform:()=>{C.openSidebar?n({openSidebar:null}):n({openSidebar:{name:Aa.name,tab:Aa.defaultTab}})}},{label:E("search.title"),category:ht.app,icon:zi,viewMode:!0,perform:()=>{l.executeAction(Ym)}},{label:E("labels.changeStroke"),keywords:["color","outline"],category:ht.elements,icon:oc,viewMode:!1,predicate:(G,ce)=>{let xe=be(G,ce);return xe.length>0&&Bm(ce,xe)},perform:()=>{n(G=>({openMenu:G.openMenu==="shape"?null:"shape",openPopup:"elementStroke"}))}},{label:E("labels.changeBackground"),keywords:["color","fill"],icon:oc,category:ht.elements,viewMode:!1,predicate:(G,ce)=>{let xe=be(G,ce);return xe.length>0&&zm(ce,xe)},perform:()=>{n(G=>({openMenu:G.openMenu==="shape"?null:"shape",openPopup:"elementBackground"}))}},{label:E("labels.canvasBackground"),keywords:["color"],icon:oc,category:ht.editor,viewMode:!1,perform:()=>{n(G=>({openMenu:G.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...Ec.reduce((G,ce)=>{let{value:xe,icon:Ce,key:ut,numericKey:Zt}=ce;if(k.UIOptions.tools?.[xe]===!1)return G;let fa=ut&&hr(typeof ut=="string"?ut:ut[0])||Zt,En={label:E(`toolBar.${xe}`),category:ht.tools,shortcut:fa,icon:Ce,keywords:["toolbar"],viewMode:!1,perform:({event:Kt})=>{xe==="image"?t.setActiveTool({type:xe,insertOnCanvasDirectly:Kt.type==="keydown"}):t.setActiveTool({type:xe})}};return G.push(En),G},[]),...X,{label:E("toolBar.lock"),category:ht.tools,icon:C.activeTool.locked?tc:Ys,shortcut:L.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${E("labels.textToDiagram")}...`,category:ht.tools,icon:z3,viewMode:!1,predicate:k.aiEnabled,perform:()=>{n(G=>({...G,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${E("toolBar.mermaidToExcalidraw")}...`,category:ht.tools,icon:_U,viewMode:!1,predicate:k.aiEnabled,perform:()=>{n(G=>({...G,openDialog:{name:"ttd",tab:"mermaid"}}))}}],K=[...A,...W,...T||[]].map(G=>({...G,icon:G.icon||zU,order:G.order??wI(G.category),haystack:`${_m(G.label.toLocaleLowerCase())} ${G.keywords?.join(" ")||""}`}));u(K),o(K.find(G=>G.label===r?.label)??null)}},[c,t,l,u,r?.label,o,n]);let[U,f]=se(""),[p,m]=se(null),[g,y]=se({}),v=C=>{n({openDialog:null},C),f("")},b=(C,T)=>{a.openDialog?.name==="commandPalette"&&(T.stopPropagation(),T.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),v(()=>{C.perform({actionManager:l,event:T}),o(C),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},x=Hm(C=>C.viewMode===!1&&a.viewModeEnabled?!1:typeof C.predicate=="function"?C.predicate(t.scene.getNonDeletedElements(),a,i,t):C.predicate===void 0||C.predicate),S=Hm(C=>{let T=Li(C.target)||Gm(C)||C.key===L.ESCAPE;if(T&&C.key!==L.ARROW_UP&&C.key!==L.ARROW_DOWN&&C.key!==L.ENTER)return;let k=Object.values(g).flat(),R=r&&!U&&x(r);if(C.key===L.ARROW_UP){C.preventDefault();let D=k.findIndex($=>$.label===p?.label);if(R){if(D===0){m(r);return}if(p===r){let $=k[k.length-1];$&&m($);return}}let A;D===-1?A=k.length-1:A=D===0?k.length-1:(D-1)%k.length;let P=k[A];P&&m(P);return}if(C.key===L.ARROW_DOWN){C.preventDefault();let D=k.findIndex($=>$.label===p?.label);if(R){if(!p||D===k.length-1){m(r);return}if(p===r){let $=k[0];$&&m($);return}}let A=(D+1)%k.length,P=k[A];P&&m(P);return}if(C.key===L.ENTER&&p&&setTimeout(()=>{b(p,C)}),!T){if(C.stopPropagation(),/^[a-zA-Z0-9]$/.test(C.key)){s?.current?.focus();return}C.preventDefault()}});return ae(()=>(window.addEventListener("keydown",S,{capture:!0}),()=>window.removeEventListener("keydown",S,{capture:!0})),[S]),ae(()=>{if(!d)return;let C=D=>{let A={};for(let P of D)A[P.category]?A[P.category].push(P):A[P.category]=[P];return A},T=d.filter(x).sort((D,A)=>D.order-A.order),k=!U&&r&&x(r);if(!U){y(C(k?T.filter(D=>D.label!==r?.label):T)),m(k?r:T[0]||null);return}let R=_m(U.toLocaleLowerCase().replace(/[<>_| -]/g,""));T=lg.filter(R,T,{extract:D=>D.haystack}).sort((D,A)=>A.score-D.score).map(D=>D.original),y(C(T)),m(T[0]??null)},[U,d,x,r]),M(ja,{onCloseRequest:()=>v(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[h(c1,{value:U,placeholder:E("commandPalette.search.placeholder"),onChange:C=>{f(C)},selectOnRender:!0,ref:s}),!t.device.viewport.isMobile&&M("div",{className:"shortcuts-wrapper",children:[h(od,{shortcut:"\u2191\u2193",children:E("commandPalette.shortcuts.select")}),h(od,{shortcut:"\u21B5",children:E("commandPalette.shortcuts.confirm")}),h(od,{shortcut:z("Esc"),children:E("commandPalette.shortcuts.close")})]}),M("div",{className:"commands",children:[r&&!U&&M("div",{className:"command-category",children:[M("div",{className:"command-category-title",children:[E("commandPalette.recents"),h("div",{className:"icon",style:{marginLeft:"6px"},children:F3})]}),h(Vm,{command:r,isSelected:r.label===p?.label,onClick:C=>b(r,C),disabled:!x(r),onMouseMove:()=>m(r),showShortcut:!t.device.viewport.isMobile,appState:a})]}),Object.keys(g).length>0?Object.keys(g).map((C,T)=>M("div",{className:"command-category",children:[h("div",{className:"command-category-title",children:C}),g[C].map(k=>h(Vm,{command:k,isSelected:k.label===p?.label,onClick:R=>b(k,R),onMouseMove:()=>m(k),showShortcut:!t.device.viewport.isMobile,appState:a},k.label))]},C)):d?M("div",{className:"no-match",children:[h("div",{className:"icon",children:zi})," ",E("commandPalette.search.noMatch")]}):null]})]})}var Vm=({command:e,isSelected:t,disabled:a,onMouseMove:n,onClick:i,showShortcut:l,appState:r})=>{let o=()=>{};return M("div",{className:Q("command-item",{"item-selected":t,"item-disabled":a}),ref:d=>{t&&!a&&d?.scrollIntoView?.({block:"nearest"})},onClick:a?o:i,onMouseMove:a?o:n,title:a?E("commandPalette.itemNotAvailable"):"",children:[M("div",{className:"name",children:[e.icon&&h(Zo,{icon:typeof e.icon=="function"?e.icon(r):e.icon}),e.label]}),l&&e.shortcut&&h(od,{shortcut:e.shortcut})]})},xI=V({name:"toggleLinearEditor",category:ht.elements,label:(e,t,a)=>a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds})[0]?.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit",keywords:["line"],trackEvent:{category:"element"},predicate:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t);return!!(!t.editingLinearElement&&i.length===1&&he(i[0])&&!q(i[0]))},perform(e,t,a,n){let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0],l=t.editingLinearElement?.elementId===i.id?null:new Z(i);return{appState:{...t,editingLinearElement:l},captureUpdate:B.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:a})=>{let n=a.scene.getSelectedElements({selectedElementIds:e.selectedElementIds})[0],i=E(n.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit");return h(Me,{type:"button",icon:eb,title:i,"aria-label":i,onClick:()=>t(null)})}}),Ym=V({name:"searchMenu",icon:zi,keywords:["search","find"],label:"search.title",viewMode:!0,trackEvent:{category:"search_menu",action:"toggle",predicate:e=>e.gridModeEnabled},perform(e,t,a,n){if(t.openSidebar?.name===Aa.name&&t.openSidebar.tab===fl){let i=n.excalidrawContainerValue.container?.querySelector(`.${dl.SEARCH_MENU_INPUT_WRAPPER} input`);return i?.matches(":focus")?{appState:{...t,openSidebar:null},captureUpdate:B.EVENTUALLY}:(i?.focus(),i?.select(),!1)}return{appState:{...t,openSidebar:{name:Aa.name,tab:fl},openDialog:null},captureUpdate:B.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,a)=>a.gridModeEnabled===void 0,keyTest:e=>e[L.CTRL_OR_CMD]&&e.key===L.F}),SI=V({name:"cropEditor",label:"helpDialog.cropStart",icon:HU,viewMode:!0,trackEvent:{category:"menu"},keywords:["image","crop"],perform(e,t,a,n){let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];return{appState:{...t,isCropping:!1,croppingElementId:i.id},captureUpdate:B.IMMEDIATELY}},predicate:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t);return!!(!t.croppingElementId&&i.length===1&&Le(i[0]))},PanelComponent:({appState:e,updateData:t,app:a})=>{let n=E("helpDialog.cropStart");return h(Me,{type:"button",icon:HU,title:n,"aria-label":n,onClick:()=>t(null)})}}),dd=class{constructor(e=!0,t=!0){this.isUndoStackEmpty=e,this.isRedoStackEmpty=t}},jm=class ps{constructor(){I(this,"onHistoryChangedEmitter",new fn),I(this,"undoStack",[]),I(this,"redoStack",[])}get isUndoStackEmpty(){return this.undoStack.length===0}get isRedoStackEmpty(){return this.redoStack.length===0}clear(){this.undoStack.length=0,this.redoStack.length=0}record(t,a){let n=MI.create(a,t);n.isEmpty()||(this.undoStack.push(n.inverse()),n.elementsChange.isEmpty()||(this.redoStack.length=0),this.onHistoryChangedEmitter.trigger(new dd(this.isUndoStackEmpty,this.isRedoStackEmpty)))}undo(t,a,n){return this.perform(t,a,n,()=>ps.pop(this.undoStack),i=>ps.push(this.redoStack,i,t))}redo(t,a,n){return this.perform(t,a,n,()=>ps.pop(this.redoStack),i=>ps.push(this.undoStack,i,t))}perform(t,a,n,i,l){try{let r=i();if(r===null)return;let o=t,d=a,u=!1;for(;r;){try{[o,d,u]=r.applyTo(o,d,n)}finally{l(r)}if(u)break;r=i()}return[o,d]}finally{this.onHistoryChangedEmitter.trigger(new dd(this.isUndoStackEmpty,this.isRedoStackEmpty))}}static pop(t){if(!t.length)return null;let a=t.pop();return a!==void 0?a:null}static push(t,a,n){let i=a.inverse().applyLatestChanges(n);return t.push(i)}},MI=class xd{constructor(t,a){this.appStateChange=t,this.elementsChange=a}static create(t,a){return new xd(t,a)}inverse(){return new xd(this.appStateChange.inverse(),this.elementsChange.inverse())}applyTo(t,a,n){let[i,l]=this.elementsChange.applyTo(t,n.elements),[r,o]=this.appStateChange.applyTo(a,i);return[i,r,l||o]}applyLatestChanges(t){let a=this.elementsChange.applyLatestChanges(t);return xd.create(this.appStateChange,a)}isEmpty(){return this.appStateChange.isEmpty()&&this.elementsChange.isEmpty()}},Zm=(e,t)=>{let[a,n]=se(t);return ae(()=>{let i=e.on(l=>{n(l)});return()=>{i()}},[e]),a},Km=(e,t,a)=>{if(!t.multiElement&&!t.resizingElement&&!t.editingTextElement&&!t.newElement&&!t.selectedElementsAreBeingDragged&&!t.selectionElement&&!e.flowChartCreator.isCreatingChart){let n=a();if(!n)return{captureUpdate:B.EVENTUALLY};let[i,l]=n,r=Array.from(i.values());return{appState:l,elements:r,captureUpdate:B.NEVER}}return{captureUpdate:B.EVENTUALLY}},CI=(e,t)=>({name:"undo",label:"buttons.undo",icon:fU,trackEvent:{category:"history"},viewMode:!1,perform:(a,n,i,l)=>Km(l,n,()=>e.undo(oe(a),n,t.snapshot)),keyTest:a=>a[L.CTRL_OR_CMD]&&vc(a,L.Z)&&!a.shiftKey,PanelComponent:({updateData:a,data:n})=>{let{isUndoStackEmpty:i}=Zm(e.onHistoryChangedEmitter,new dd(e.isUndoStackEmpty,e.isRedoStackEmpty));return h(Me,{type:"button",icon:fU,"aria-label":E("buttons.undo"),onClick:a,size:n?.size||"medium",disabled:i,"data-testid":"button-undo"})}}),kI=(e,t)=>({name:"redo",label:"buttons.redo",icon:pU,trackEvent:{category:"history"},viewMode:!1,perform:(a,n,i,l)=>Km(l,n,()=>e.redo(oe(a),n,t.snapshot)),keyTest:a=>a[L.CTRL_OR_CMD]&&a.shiftKey&&vc(a,L.Z)||mu&&a.ctrlKey&&!a.shiftKey&&vc(a,L.Y),PanelComponent:({updateData:a,data:n})=>{let{isRedoStackEmpty:i}=Zm(e.onHistoryChangedEmitter,new dd(e.isUndoStackEmpty,e.isRedoStackEmpty));return h(Me,{type:"button",icon:pU,"aria-label":E("buttons.redo"),onClick:a,size:n?.size||"medium",disabled:i,"data-testid":"button-redo"})}}),h1=(e,t,a,n,i,l)=>{if(e.trackEvent)try{typeof e.trackEvent=="object"&&(!e.trackEvent.predicate||e.trackEvent.predicate(a,n,l))&&Ge(e.trackEvent.category,e.trackEvent.action||e.name,`${t} (${i.device.editor.isMobile?"mobile":"desktop"})`)}catch(r){console.error("error while logging action:",r)}},II=class{constructor(e,t,a,n){I(this,"actions",{}),I(this,"updater"),I(this,"getAppState"),I(this,"getElementsIncludingDeleted"),I(this,"app"),I(this,"renderAction",(i,l)=>{let r=this.app.props.UIOptions.canvasActions;if(this.actions[i]&&"PanelComponent"in this.actions[i]&&(!(i in r)||r[i])){let o=this.actions[i],d=o.PanelComponent;d.displayName="PanelComponent";let u=this.getElementsIncludingDeleted(),s=this.getAppState(),c=U=>{h1(o,"ui",s,u,this.app,U),this.updater(o.perform(this.getElementsIncludingDeleted(),this.getAppState(),U,this.app))};return h(d,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:c,appProps:this.app.props,app:this.app,data:l})}return null}),I(this,"isActionEnabled",i=>{let l=this.getElementsIncludingDeleted(),r=this.getAppState();return!i.predicate||i.predicate(l,r,this.app.props,this.app)}),this.updater=i=>{if(ur(i))i.then(l=>e(l));else return e(i)},this.getAppState=t,this.getElementsIncludingDeleted=a,this.app=n}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach(t=>this.registerAction(t))}handleKeyDown(e){let t=this.app.props.UIOptions.canvasActions,a=Object.values(this.actions).sort((o,d)=>(d.keyPriority||0)-(o.keyPriority||0)).filter(o=>(o.name in t?t[o.name]:!0)&&o.keyTest&&o.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted(),this.app));if(a.length!==1)return a.length>1&&console.warn("Canceling as multiple actions match this shortcut",a),!1;let n=a[0];if(this.getAppState().viewModeEnabled&&n.viewMode!==!0)return!1;let i=this.getElementsIncludingDeleted(),l=this.getAppState();return h1(n,"keyboard",l,i,this.app,null),e.preventDefault(),e.stopPropagation(),this.updater(a[0].perform(i,l,null,this.app)),!0}executeAction(e,t="api",a=null){let n=this.getElementsIncludingDeleted(),i=this.getAppState();h1(e,t,i,n,this.app,a),this.updater(e.perform(n,i,a,this.app))}},qm=e=>{let t=Array.from(e.values());return{x:Qm(t,a=>a.x)/t.length,y:Qm(t,a=>a.y)/t.length}},Jm=([e,t])=>Math.hypot(e.x-t.x,e.y-t.y),Qm=(e,t)=>e.reduce((a,n)=>a+t(n),0),TI=({children:e,left:t,top:a,onCloseRequest:n,fitInViewport:i=!1,offsetLeft:l=0,offsetTop:r=0,viewportWidth:o=window.innerWidth,viewportHeight:d=window.innerHeight})=>{let u=re(null);ae(()=>{let c=u.current;if(!c)return;c.contains(document.activeElement)||c.focus();let U=f=>{if(f.key===L.TAB){let p=Vd(c),{activeElement:m}=document,g=p.findIndex(y=>y===m);m===c?(f.shiftKey?p[p.length-1]?.focus():p[0].focus(),f.preventDefault(),f.stopImmediatePropagation()):g===0&&f.shiftKey?(p[p.length-1]?.focus(),f.preventDefault(),f.stopImmediatePropagation()):g===p.length-1&&!f.shiftKey&&(p[0]?.focus(),f.preventDefault(),f.stopImmediatePropagation())}};return c.addEventListener("keydown",U),()=>c.removeEventListener("keydown",U)},[]);let s=re(null);return Ia(()=>{if(i&&u.current&&a!=null&&t!=null){let c=u.current,{width:U,height:f}=c.getBoundingClientRect();if(s.current?.top===a&&s.current?.left===t)return;s.current={top:a,left:t},U>=o?(c.style.width=`${o}px`,c.style.left="0px",c.style.overflowX="scroll"):t+U-l>o?c.style.left=`${o-U-10}px`:c.style.left=`${t}px`,f>=d?(c.style.height=`${d-20}px`,c.style.top="10px",c.style.overflowY="scroll"):a+f-r>d?c.style.top=`${d-f}px`:c.style.top=`${a}px`}},[a,t,i,o,d,l,r]),ae(()=>{if(n){let c=U=>{u.current?.contains(U.target)||Md(()=>n(U))};return document.addEventListener("pointerdown",c,!1),()=>document.removeEventListener("pointerdown",c,!1)}},[n]),h("div",{className:"popover",ref:u,tabIndex:-1,children:e})},St="separator",LI=ee.memo(({actionManager:e,items:t,top:a,left:n,onClose:i})=>{let l=ds(),r=gd(),o=t.reduce((d,u)=>(u&&(u===St||!u.predicate||u.predicate(r,l,e.app.props,e.app))&&d.push(u),d),[]);return h(TI,{onCloseRequest:()=>{i()},top:a,left:n,fitInViewport:!0,offsetLeft:l.offsetLeft,offsetTop:l.offsetTop,viewportWidth:l.width,viewportHeight:l.height,children:h("ul",{className:"context-menu",onContextMenu:d=>d.preventDefault(),children:o.map((d,u)=>{if(d===St)return!o[u-1]||o[u-1]===St?null:h("hr",{className:"context-menu-item-separator"},u);let s=d.name,c="";return d.label&&(typeof d.label=="function"?c=E(d.label(r,l,e.app)):c=E(d.label)),h("li",{"data-testid":s,onClick:()=>{i(()=>{e.executeAction(d,"contextMenu")})},children:M("button",{type:"button",className:Q("context-menu-item",{dangerous:s==="deleteSelectedElements",checkmark:d.checked?.(l)}),children:[h("div",{className:"context-menu-item__label",children:c}),h("kbd",{className:"context-menu-item__shortcut",children:s?Ft(s):""})]})},u)})})})}),DI=({children:e,onClose:t})=>{let[a,n]=se(!!e),{container:i}=vn(),l=ee.useCallback(()=>{n(!1),t&&t(),i?.focus()},[t,i]);return h(te,{children:a&&h(ja,{size:"small",onCloseRequest:l,title:E("errorDialog.title"),children:h("div",{style:{whiteSpace:"pre-wrap"},children:e})})})},e6=function({onChange:e,value:t,choices:a,name:n}){return h("div",{className:"RadioGroup",children:a.map(i=>M("div",{className:Q("RadioGroup__choice",{active:i.value===t}),title:i.ariaLabel,children:[h("input",{name:n,type:"radio",checked:i.value===t,onChange:()=>e(i.value),"aria-label":i.ariaLabel}),i.label]},String(i.value)))})},cd=({title:e,name:t,checked:a,onChange:n,disabled:i=!1})=>h("div",{className:Q("Switch",{toggled:a,disabled:i}),children:h("input",{name:t,id:t,title:e,type:"checkbox",checked:a,disabled:i,onChange:()=>n(!a),onKeyDown:l=>{l.key===" "&&n(!a)}})}),as=xi(({children:e,icon:t,onClick:a,label:n,variant:i="filled",color:l="primary",size:r="medium",fullWidth:o,className:d,status:u},s)=>{let[c,U]=se(!1),f=async m=>{let g=a?.(m);if(ur(g)){let y=window.setTimeout(()=>{U(!0)},50);try{await g}catch(v){if(v instanceof Qs)console.warn(v);else throw v}finally{clearTimeout(y),U(!1)}}},p=c?"loading":u;return l=p==="success"?"success":l,h("button",{className:Q("ExcButton",`ExcButton--color-${l}`,`ExcButton--variant-${i}`,`ExcButton--size-${r}`,`ExcButton--status-${p}`,{"ExcButton--fullWidth":o},d),onClick:f,type:"button","aria-label":n,ref:s,disabled:p==="loading"||p==="success",children:M("div",{className:"ExcButton__contents",children:[p==="loading"?h(Wn,{className:"ExcButton__statusIcon"}):p==="success"&&h("div",{className:"ExcButton__statusIcon",children:A3}),t&&h("div",{className:"ExcButton__icon","aria-hidden":!0,children:t}),i!=="icon"&&(e??n)]})})}),AI=2e3,RI=()=>{let[e,t]=se(null),a=re(0),n=()=>{clearTimeout(a.current),t("success"),a.current=window.setTimeout(()=>{t(null)},AI)},i=at(()=>{t(null)},[]);return{copyStatus:e,resetCopyStatus:i,onCopy:n}},NI="filter"in document.createElement("canvas").getContext("2d"),PI=()=>M("div",{children:[h("h3",{children:E("canvasError.cannotShowPreview")}),h("p",{children:h("span",{children:E("canvasError.canvasTooBig")})}),M("em",{children:["(",E("canvasError.canvasTooBigTip"),")"]})]}),_I=({appStateSnapshot:e,elementsSnapshot:t,files:a,actionManager:n,onExportImage:i,name:l})=>{let r=yt(t,e),[o,d]=se(l),[u,s]=se(r),[c,U]=se(e.exportBackground),[f,p]=se(e.exportWithDarkMode),[m,g]=se(e.exportEmbedScene),[y,v]=se(e.exportScale),b=re(null),[x,S]=se(null),{onCopy:C,copyStatus:T,resetCopyStatus:k}=RI();ae(()=>{k()},[o,c,f,y,m,k]);let{exportedElements:R,exportingFrame:D}=Jo(t,e,u);return ae(()=>{let A=b.current;if(!A)return;let P=A.offsetWidth,$=A.offsetHeight;P&&zr({elements:R,appState:{...e,name:o,exportBackground:c,exportWithDarkMode:f,exportScale:y,exportEmbedScene:m},files:a,exportPadding:Ul,maxWidthOrHeight:Math.max(P,$),exportingFrame:D}).then(X=>(S(null),Gr(X).then(()=>{A.replaceChildren(X)}).catch(_=>{throw _.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(E("canvasError.canvasTooBig")):_}))).catch(X=>{console.error(X),S(X)})},[e,a,R,D,o,c,f,y,m]),M("div",{className:"ImageExportModal",children:[h("h3",{children:E("imageExportDialog.header")}),M("div",{className:"ImageExportModal__preview",children:[h("div",{className:"ImageExportModal__preview__canvas",ref:b,children:x&&h(PI,{})}),h("div",{className:"ImageExportModal__preview__filename",children:!gs&&h("input",{type:"text",className:"TextInput",value:o,style:{width:"30ch"},onChange:A=>{d(A.target.value),n.executeAction(TC,"ui",A.target.value)}})})]}),M("div",{className:"ImageExportModal__settings",children:[h("h3",{children:E("imageExportDialog.header")}),r&&h(ns,{label:E("imageExportDialog.label.onlySelected"),name:"exportOnlySelected",children:h(cd,{name:"exportOnlySelected",checked:u,onChange:A=>{s(A)}})}),h(ns,{label:E("imageExportDialog.label.withBackground"),name:"exportBackgroundSwitch",children:h(cd,{name:"exportBackgroundSwitch",checked:c,onChange:A=>{U(A),n.executeAction(DC,"ui",A)}})}),NI&&h(ns,{label:E("imageExportDialog.label.darkMode"),name:"exportDarkModeSwitch",children:h(cd,{name:"exportDarkModeSwitch",checked:f,onChange:A=>{p(A),n.executeAction(AC,"ui",A)}})}),h(ns,{label:E("imageExportDialog.label.embedScene"),tooltip:E("imageExportDialog.tooltip.embedScene"),name:"exportEmbedSwitch",children:h(cd,{name:"exportEmbedSwitch",checked:m,onChange:A=>{g(A),n.executeAction(J2,"ui",A)}})}),h(ns,{label:E("imageExportDialog.label.scale"),name:"exportScale",children:h(e6,{name:"exportScale",value:y,onChange:A=>{v(A),n.executeAction(LC,"ui",A)},choices:Od.map(A=>({value:A,label:`${A}\xD7`}))})}),M("div",{className:"ImageExportModal__settings__buttons",children:[h(as,{className:"ImageExportModal__settings__buttons__button",label:E("imageExportDialog.title.exportToPng"),onClick:()=>i(Ld.png,R,{exportingFrame:D}),icon:NU,children:E("imageExportDialog.button.exportToPng")}),h(as,{className:"ImageExportModal__settings__buttons__button",label:E("imageExportDialog.title.exportToSvg"),onClick:()=>i(Ld.svg,R,{exportingFrame:D}),icon:NU,children:E("imageExportDialog.button.exportToSvg")}),(hh||Ql)&&h(as,{className:"ImageExportModal__settings__buttons__button",label:E("imageExportDialog.title.copyPngToClipboard"),status:T,onClick:async()=>{await i(Ld.clipboard,R,{exportingFrame:D}),C()},icon:cc,children:E("imageExportDialog.button.copyPngToClipboard")})]})]})]})},ns=({label:e,children:t,tooltip:a,name:n})=>M("div",{className:"ImageExportModal__settings__setting",title:e,children:[M("label",{htmlFor:n,className:"ImageExportModal__settings__setting__label",children:[e,a&&h(tl,{label:a,long:!0,children:D3})]}),h("div",{className:"ImageExportModal__settings__setting__content",children:t})]}),OI=({elements:e,appState:t,files:a,actionManager:n,onExportImage:i,onCloseRequest:l,name:r})=>{let[{appStateSnapshot:o,elementsSnapshot:d}]=se(()=>({appStateSnapshot:Ln(t),elementsSnapshot:Ln(e)}));return h(ja,{onCloseRequest:l,size:"wide",title:!1,children:h(_I,{elementsSnapshot:d,appStateSnapshot:o,files:a,actionManager:n,onExportImage:i,name:r})})},t6=({children:e,side:t,className:a})=>h("div",{className:Q("FixedSideContainer",`FixedSideContainer_side_${t}`,a),children:e}),Gl=100,Vl=100,a6=e=>{switch(e){case L.ARROW_UP:return"up";case L.ARROW_DOWN:return"down";case L.ARROW_RIGHT:return"right";case L.ARROW_LEFT:return"left";default:return"right"}},n6=(e,t,a,n)=>{let i=[...a.values()].reduce((l,r)=>{let o;if(q(r)&&(o=r[e==="predecessors"?"startBinding":"endBinding"])&&r[e==="predecessors"?"endBinding":"startBinding"]?.elementId===t.id){let d=a.get(o.elementId);if(!d)return l;Bt(_a(d),"not an ExcalidrawBindableElement");let u=e==="predecessors"?r.points[r.points.length-1]:[0,0],s=Ef(t,rn(t),[u[0]+r.x,u[1]+r.y]);l.push({relative:d,heading:s})}return l},[]);switch(n){case"up":return i.filter(l=>rt(l.heading,aa)).map(l=>l.relative);case"down":return i.filter(l=>rt(l.heading,It)).map(l=>l.relative);case"right":return i.filter(l=>rt(l.heading,lt)).map(l=>l.relative);case"left":return i.filter(l=>rt(l.heading,ta)).map(l=>l.relative)}},u1=(e,t,a)=>n6("successors",e,t,a),U1=(e,t,a)=>n6("predecessors",e,t,a),BI=(e,t,a)=>{let n=Vl+e.width;if(a==="up"||a==="down"){let o=Gl+e.height,d=e.x,u=e.x+e.width;if(t.every(s=>s.x+s.width<d||s.x>u))return{x:0,y:o*(a==="up"?-1:1)}}else if(a==="right"||a==="left"){let o=e.y,d=e.y+e.height;if(t.every(u=>u.y+u.height<o||u.y>d))return{x:(Vl+e.width)*(a==="left"?-1:1),y:0}}if(a==="up"||a==="down"){let o=Gl+e.height,d=(t.length,o),u=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*n:t.length/2*n*-1;return a==="up"?{x:u,y:d*-1}:{x:u,y:d}}let i=Gl+e.height,l=(t.length,Vl+e.width),r=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*i:t.length/2*i*-1;return a==="left"?{x:l*-1,y:r}:{x:l,y:r}},zI=(e,t,a,n)=>{let i=u1(e,t,n),l=U1(e,t,n),r=BI(e,[...i,...l],n),o=hn({type:e.type,x:e.x+r.x,y:e.y+r.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});Bt(Xs(o),"not an ExcalidrawFlowchartNodeElement");let d=i6(e,o,t,n,a);return{nextNode:o,bindingArrow:d}},FI=(e,t,a,n,i)=>{let l=[];for(let r=0;r<i;r++){let o,d;if(n==="left"||n==="right"){let c=Gl*(i-1)+i*e.height,U=e.y+e.height/2-c/2,f=Vl+e.width;n==="left"&&(f*=-1),o=e.x+f;let p=(Gl+e.height)*r;d=U+p}else{let c=Vl*(i-1)+i*e.width,U=e.x+e.width/2-c/2,f=Gl+e.height;n==="up"&&(f*=-1),d=e.y+f;let p=(Vl+e.width)*r;o=U+p}let u=hn({type:e.type,x:o,y:d,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});Bt(Xs(u),"not an ExcalidrawFlowchartNodeElement");let s=i6(e,u,t,n,a);l.push(u),l.push(s)}return l},i6=(e,t,a,n,i)=>{let l,r;switch(n){case"up":{l=e.x+e.width/2,r=e.y-6;break}case"down":{l=e.x+e.width/2,r=e.y+e.height+6;break}case"right":{l=e.x+e.width+6,r=e.y+e.height/2;break}case"left":{l=e.x-6,r=e.y+e.height/2;break}}let o,d;switch(n){case"up":{o=t.x+t.width/2-l,d=t.y+t.height-r+6;break}case"down":{o=t.x+t.width/2-l,d=t.y-r-6;break}case"right":{o=t.x-l-6,d=t.y-r+t.height/2;break}case"left":{o=t.x+t.width-l+6,d=t.y-r+t.height/2;break}}let u=Hc({type:"arrow",x:l,y:r,startArrowhead:null,endArrowhead:i.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[w(0,0),w(o,d)],elbowed:!0});sn(u,e,"start",a),sn(u,t,"end",a);let s=new Map;s.set(e.id,e),s.set(t.id,t),s.set(u.id,u),Z.movePoints(u,[{index:1,point:u.points[1]}]);let c=ah(u,ga(new Map([...a.entries(),[e.id,e],[t.id,t],[u.id,u]])),{points:u.points});return{...u,...c}},$I=class{constructor(){I(this,"isExploring",!1),I(this,"sameLevelNodes",[]),I(this,"sameLevelIndex",0),I(this,"direction",null),I(this,"visitedNodes",new Set)}clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(e,t,a){if(!_a(e))return null;if(a!==this.direction&&this.clear(),this.visitedNodes.has(e.id)||this.visitedNodes.add(e.id),this.isExploring&&a===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let n=[...u1(e,t,a),...U1(e,t,a)];if(n.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=n,this.direction=a,this.visitedNodes.add(n[0].id),n[0].id;if(a===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(e.id);let i=["up","right","down","left"].filter(l=>l!==a).map(l=>[...u1(e,t,l),...U1(e,t,l)]).flat().filter(l=>!this.visitedNodes.has(l.id));for(let l of i)if(!this.visitedNodes.has(l.id))return this.visitedNodes.add(l.id),this.isExploring=!0,this.direction=a,l.id}return null}},HI=class{constructor(){I(this,"isCreatingChart",!1),I(this,"numberOfNodes",0),I(this,"direction","right"),I(this,"pendingNodes",null)}createNodes(e,t,a,n){if(n!==this.direction){let{nextNode:i,bindingArrow:l}=zI(e,t,a,n);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=n,this.pendingNodes=[i,l]}else{this.numberOfNodes+=1;let i=FI(e,t,a,n,this.numberOfNodes);this.isCreatingChart=!0,this.direction=n,this.pendingNodes=i}if(e.frameId){let i=t.get(e.frameId);Bt(i&&Qu(i),"not an ExcalidrawFrameElement"),i&&this.pendingNodes.every(l=>Fr([l],i,t)||bi(l,i,t))&&(this.pendingNodes=this.pendingNodes.map(l=>F(l,{frameId:e.frameId},!1)))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},XI=(e,t)=>{for(let[,a]of t)if(a.type==="arrow"&&(a.startBinding?.elementId===e.id||a.endBinding?.elementId===e.id))return!0;return!1},WI=({appState:e,isMobile:t,device:a,app:n})=>{let{activeTool:i,isResizing:l,isRotating:r,lastPointerDownWith:o}=e,d=e.multiElement!==null;if(e.openSidebar?.name===Aa.name&&e.openSidebar.tab===fl&&e.searchMatches?.length)return E("hints.dismissSearch");if(e.openSidebar&&!a.editor.canFitSidebar)return null;if(an(e))return E("hints.eraserRevert");if(i.type==="arrow"||i.type==="line")return d?E("hints.linearElementMulti"):i.type==="arrow"?E("hints.arrowTool",{arrowShortcut:z("A")}):E("hints.linearElement");if(i.type==="freedraw")return E("hints.freeDraw");if(i.type==="text")return E("hints.text");if(i.type==="embeddable")return E("hints.embeddable");if(e.activeTool.type==="image"&&e.pendingImageElementId)return E("hints.placeImage");let u=n.scene.getSelectedElements(e);if(l&&o==="mouse"&&u.length===1){let s=u[0];return he(s)&&s.points.length===2?E("hints.lockAngle"):Le(s)?E("hints.resizeImage"):E("hints.resize")}if(r&&o==="mouse")return E("hints.rotate");if(u.length===1&&j(u[0]))return E("hints.text_selected");if(e.editingTextElement)return E("hints.text_editing");if(e.croppingElementId)return E("hints.leaveCropEditor");if(u.length===1&&Le(u[0]))return E("hints.enterCropEditor");if(i.type==="selection"){if(e.selectionElement&&!u.length&&!e.editingTextElement&&!e.editingLinearElement)return E("hints.deepBoxSelect");if(Cr(n)&&e.selectedElementsAreBeingDragged)return E("hints.disableSnapping");if(!u.length&&!t)return E("hints.canvasPanning");if(u.length===1){if(he(u[0]))return e.editingLinearElement?e.editingLinearElement.selectedPointsIndices?E("hints.lineEditor_pointSelected"):E("hints.lineEditor_nothingSelected"):E("hints.lineEditor_info");if(!e.newElement&&!e.selectedElementsAreBeingDragged&&Ni(u[0]))return Xs(u[0])?XI(u[0],n.scene.getNonDeletedElementsMap())?[E("hints.bindTextToElement"),E("hints.createFlowchart")]:[E("hints.bindTextToElement"),E("hints.createFlowchart")]:E("hints.bindTextToElement")}}return null},l6=({appState:e,isMobile:t,device:a,app:n})=>{let i=WI({appState:e,isMobile:t,device:a,app:n});if(!i)return null;let l=Array.isArray(i)?i.map(r=>z(r).replace(/\. ?$/,"")).join(". "):z(i);return h("div",{className:"HintViewer",children:h("span",{children:l})})},GI="medium",r6={CHECKED:tc,UNCHECKED:Ys},s6=e=>M("label",{className:Q("ToolIcon ToolIcon__lock",`ToolIcon_size_${GI}`,{"is-mobile":e.isMobile}),title:`${e.title} \u2014 Q`,children:[h("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-lock"}),h("div",{className:"ToolIcon__icon",children:e.checked?r6.CHECKED:r6.UNCHECKED})]}),is=({heading:e,children:t,...a})=>{let{id:n}=vn(),i=h("h2",{className:"visually-hidden",id:`${n}-${e}-title`,children:E(`headings.${e}`)});return h("section",{...a,"aria-labelledby":`${n}-${e}-title`,children:typeof t=="function"?t(i):M(te,{children:[i,t]})})},yn=4,vi=6,VI="rgba(0,0,0,0.3)",YI=(e,t,a,n)=>{if(!e.length)return{horizontal:null,vertical:null};let[i,l,r,o]=De(e),d=t/n.zoom.value,u=a/n.zoom.value,s=t-d,c=a-u,U={top:parseInt(Bs("sat"))||0,bottom:parseInt(Bs("sab"))||0,left:parseInt(Bs("sal"))||0,right:parseInt(Bs("sar"))||0},f=Yr().rtl,p=-n.scrollX+s/2+U.left,m=-n.scrollY+c/2+U.top,g=p+d-U.right,y=m+u-U.bottom,v=Math.min(i,p),b=Math.min(l,m),x=Math.max(r,g),S=Math.max(o,y);return{horizontal:p===v&&g===x?null:{x:Math.max(U.left,yn)+(p-v)/(x-v)*t,y:a-vi-Math.max(yn,U.bottom),width:(g-p)/(x-v)*t-Math.max(yn*2,U.left+U.right),height:vi},vertical:m===b&&y===S?null:{x:f?Math.max(U.left,yn):t-vi-Math.max(U.right,yn),y:(m-b)/(S-b)*a+Math.max(U.top,yn),width:vi,height:(y-m)/(S-b)*a-Math.max(yn*2,U.top+U.bottom)}}},o6=(e,t,a)=>{let[n,i]=[e.horizontal,e.vertical].map(l=>l!=null&&l.x<=t&&t<=l.x+l.width&&l.y<=a&&a<=l.y+l.height);return{isOverEither:n||i,isOverHorizontal:n,isOverVertical:i}},jI="medium",d6=e=>e.penDetected?M("label",{className:Q("ToolIcon ToolIcon__penMode",`ToolIcon_size_${jI}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[h("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),h("div",{className:"ToolIcon__icon",children:T8})]}):null,c6=e=>h(Me,{className:Q("Shape",{fillable:!1}),type:"radio",icon:RU,name:"editor-current-shape",checked:e.checked,title:`${e.title} \u2014 H`,keyBindingLabel:e.isMobile?void 0:L.H.toLocaleUpperCase(),"aria-label":`${e.title} \u2014 H`,"aria-keyshortcuts":L.H,"data-testid":"toolbar-hand",onChange:()=>e.onChange?.()}),ZI=({appState:e,elements:t,actionManager:a,setAppState:n,onLockToggle:i,onHandToolToggle:l,onPenModeToggle:r,renderTopRightUI:o,renderCustomStats:d,renderSidebars:u,device:s,renderWelcomeScreen:c,UIOptions:U,app:f})=>{let{WelcomeScreenCenterTunnel:p,MainMenuTunnel:m,DefaultSidebarTriggerTunnel:g}=Yt(),y=()=>M(t6,{side:"top",className:"App-top-bar",children:[c&&h(p.Out,{}),h(is,{heading:"shapes",children:b=>h(Ca.Col,{gap:4,align:"center",children:M(Ca.Row,{gap:1,className:"App-toolbar-container",children:[M(Va,{padding:1,className:"App-toolbar App-toolbar--mobile",children:[b,h(Ca.Row,{gap:1,children:h($m,{appState:e,activeTool:e.activeTool,UIOptions:U,app:f})})]}),o&&o(!0,e),M("div",{className:"mobile-misc-tools-container",children:[!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&h(g.Out,{}),h(d6,{checked:e.penMode,onChange:()=>r(null),title:E("toolBar.penMode"),isMobile:!0,penDetected:e.penDetected}),h(s6,{checked:e.activeTool.locked,onChange:i,title:E("toolBar.lock"),isMobile:!0}),h(c6,{checked:ml(e),onChange:()=>l(),title:E("toolBar.hand"),isMobile:!0})]})]})})}),h(l6,{appState:e,isMobile:!0,device:s,app:f})]}),v=()=>e.viewModeEnabled||e.openDialog?.name==="elementLinkSelector"?h("div",{className:"App-toolbar-content",children:h(m.Out,{})}):M("div",{className:"App-toolbar-content",children:[h(m.Out,{}),a.renderAction("toggleEditMenu"),a.renderAction(e.multiElement?"finalize":"duplicateSelection"),a.renderAction("deleteSelectedElements"),M("div",{children:[a.renderAction("undo"),a.renderAction("redo")]})]});return M(te,{children:[u(),!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&y(),h("div",{className:"App-bottom-bar",style:{marginBottom:vi+yn*2,marginLeft:vi+yn*2,marginRight:vi+yn*2},children:M(Va,{padding:0,children:[e.openMenu==="shape"&&!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&Dh(e,t)?h(is,{className:"App-mobile-menu",heading:"selectedShapeActions",children:h(Fm,{appState:e,elementsMap:f.scene.getNonDeletedElementsMap(),renderAction:a.renderAction,app:f})}):null,M("footer",{className:"App-toolbar",children:[v(),e.scrolledOutside&&!e.openMenu&&!e.openSidebar&&h("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{n(b=>({...Sr(t,b)}))},children:E("buttons.scrollBackToContent")})]})]})})]})},h6=e=>{let t=re(null),[a,n]=se(null);return Ia(()=>{if(!e.spreadsheet)return;let i=Hx(e.chartType,e.spreadsheet,0,0);n(i);let l,r=t.current;return(async()=>(l=await Qc(i,{exportBackground:!1,viewBackgroundColor:Mt.white},null,{skipInliningFonts:!0}),l.querySelector(".style-fonts")?.remove(),r.replaceChildren(),r.appendChild(l),e.selected&&r.parentNode.focus()))(),()=>{r.replaceChildren()}},[e.spreadsheet,e.chartType,e.selected]),h("button",{type:"button",className:"ChartPreview",onClick:()=>{a&&e.onClick(e.chartType,a)},children:h("div",{ref:t})})},KI=({setAppState:e,appState:t,onClose:a})=>{let{onInsertElements:n}=Ka(),i=ee.useCallback(()=>{a&&a()},[a]),l=(r,o)=>{n(o),Ge("paste","chart",r),e({currentChartType:r,pasteDialog:{shown:!1,data:null}})};return h(ja,{size:"small",onCloseRequest:i,title:E("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:M("div",{className:"container",children:[h(h6,{chartType:"bar",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="bar",onClick:l}),h(h6,{chartType:"line",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="line",onClick:l})]})})},qI=()=>M("div",{className:"HelpDialog__header",children:[M("a",{className:"HelpDialog__btn",href:"https://docs.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:[h("div",{className:"HelpDialog__link-icon",children:hU}),E("helpDialog.documentation")]}),M("a",{className:"HelpDialog__btn",href:"https://plus.excalidraw.com/blog",target:"_blank",rel:"noopener noreferrer",children:[h("div",{className:"HelpDialog__link-icon",children:hU}),E("helpDialog.blog")]}),M("a",{className:"HelpDialog__btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:[h("div",{className:"HelpDialog__link-icon",children:uU}),E("helpDialog.github")]}),M("a",{className:"HelpDialog__btn",href:"https://youtube.com/@excalidraw",target:"_blank",rel:"noopener noreferrer",children:[h("div",{className:"HelpDialog__link-icon",children:J3}),"YouTube"]})]}),JI=e=>M(te,{children:[h("h3",{children:e.title}),h("div",{className:"HelpDialog__islands-container",children:e.children})]}),f1=e=>M("div",{className:`HelpDialog__island ${e.className}`,children:[h("h4",{className:"HelpDialog__island-title",children:e.caption}),h("div",{className:"HelpDialog__island-content",children:e.children})]});function*QI(e,t){let a=!0;for(let n of e)a||(yield t),a=!1,yield n}var eT=e=>e.replace(/\b[a-z]\b/,t=>t.toUpperCase()),J=({label:e,shortcuts:t,isOr:a=!0})=>{let n=t.map(i=>(i.endsWith("++")?[...i.slice(0,-2).split("+"),"+"]:i.split("+")).map(l=>h(tT,{children:eT(l)},l)));return M("div",{className:"HelpDialog__shortcut",children:[h("div",{children:e}),h("div",{className:"HelpDialog__key-container",children:[...QI(n,a?E("helpDialog.or"):null)]})]})},tT=e=>h("kbd",{className:"HelpDialog__key",...e}),aT=({onClose:e})=>{let t=ee.useCallback(()=>{e&&e()},[e]);return h(te,{children:M(ja,{onCloseRequest:t,title:E("helpDialog.title"),className:"HelpDialog",children:[h(qI,{}),M(JI,{title:E("helpDialog.shortcuts"),children:[M(f1,{className:"HelpDialog__island--tools",caption:E("helpDialog.tools"),children:[h(J,{label:E("toolBar.hand"),shortcuts:[L.H]}),h(J,{label:E("toolBar.selection"),shortcuts:[L.V,L[1]]}),h(J,{label:E("toolBar.rectangle"),shortcuts:[L.R,L[2]]}),h(J,{label:E("toolBar.diamond"),shortcuts:[L.D,L[3]]}),h(J,{label:E("toolBar.ellipse"),shortcuts:[L.O,L[4]]}),h(J,{label:E("toolBar.arrow"),shortcuts:[L.A,L[5]]}),h(J,{label:E("toolBar.line"),shortcuts:[L.L,L[6]]}),h(J,{label:E("toolBar.freedraw"),shortcuts:[L.P,L[7]]}),h(J,{label:E("toolBar.text"),shortcuts:[L.T,L[8]]}),h(J,{label:E("toolBar.image"),shortcuts:[L[9]]}),h(J,{label:E("toolBar.eraser"),shortcuts:[L.E,L[0]]}),h(J,{label:E("toolBar.frame"),shortcuts:[L.F]}),h(J,{label:E("toolBar.laser"),shortcuts:[L.K]}),h(J,{label:E("labels.eyeDropper"),shortcuts:[L.I,"Shift+S","Shift+G"]}),h(J,{label:E("helpDialog.editLineArrowPoints"),shortcuts:[z("CtrlOrCmd+Enter")]}),h(J,{label:E("helpDialog.editText"),shortcuts:[z("Enter")]}),h(J,{label:E("helpDialog.textNewLine"),shortcuts:[z("Enter"),z("Shift+Enter")]}),h(J,{label:E("helpDialog.textFinish"),shortcuts:[z("Esc"),z("CtrlOrCmd+Enter")]}),h(J,{label:E("helpDialog.curvedArrow"),shortcuts:["A",E("helpDialog.click"),E("helpDialog.click"),E("helpDialog.click")],isOr:!1}),h(J,{label:E("helpDialog.curvedLine"),shortcuts:["L",E("helpDialog.click"),E("helpDialog.click"),E("helpDialog.click")],isOr:!1}),h(J,{label:E("helpDialog.cropStart"),shortcuts:[E("helpDialog.doubleClick"),z("Enter")],isOr:!0}),h(J,{label:E("helpDialog.cropFinish"),shortcuts:[z("Enter"),z("Escape")],isOr:!0}),h(J,{label:E("toolBar.lock"),shortcuts:[L.Q]}),h(J,{label:E("helpDialog.preventBinding"),shortcuts:[z("CtrlOrCmd")]}),h(J,{label:E("toolBar.link"),shortcuts:[z("CtrlOrCmd+K")]})]}),M(f1,{className:"HelpDialog__island--view",caption:E("helpDialog.view"),children:[h(J,{label:E("buttons.zoomIn"),shortcuts:[z("CtrlOrCmd++")]}),h(J,{label:E("buttons.zoomOut"),shortcuts:[z("CtrlOrCmd+-")]}),h(J,{label:E("buttons.resetZoom"),shortcuts:[z("CtrlOrCmd+0")]}),h(J,{label:E("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),h(J,{label:E("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),h(J,{label:E("helpDialog.movePageUpDown"),shortcuts:["PgUp/PgDn"]}),h(J,{label:E("helpDialog.movePageLeftRight"),shortcuts:["Shift+PgUp/PgDn"]}),h(J,{label:E("buttons.zenMode"),shortcuts:[z("Alt+Z")]}),h(J,{label:E("buttons.objectsSnapMode"),shortcuts:[z("Alt+S")]}),h(J,{label:E("labels.toggleGrid"),shortcuts:[z("CtrlOrCmd+'")]}),h(J,{label:E("labels.viewMode"),shortcuts:[z("Alt+R")]}),h(J,{label:E("labels.toggleTheme"),shortcuts:[z("Alt+Shift+D")]}),h(J,{label:E("stats.fullTitle"),shortcuts:[z("Alt+/")]}),h(J,{label:E("search.title"),shortcuts:[Ft("searchMenu")]}),h(J,{label:E("commandPalette.title"),shortcuts:Ql?[Ft("commandPalette")]:[Ft("commandPalette"),Ft("commandPalette",1)]})]}),M(f1,{className:"HelpDialog__island--editor",caption:E("helpDialog.editor"),children:[h(J,{label:E("helpDialog.createFlowchart"),shortcuts:[z("CtrlOrCmd+Arrow Key")],isOr:!0}),h(J,{label:E("helpDialog.navigateFlowchart"),shortcuts:[z("Alt+Arrow Key")],isOr:!0}),h(J,{label:E("labels.moveCanvas"),shortcuts:[z(`Space+${E("helpDialog.drag")}`),z(`Wheel+${E("helpDialog.drag")}`)],isOr:!0}),h(J,{label:E("buttons.clearReset"),shortcuts:[z("CtrlOrCmd+Delete")]}),h(J,{label:E("labels.delete"),shortcuts:[z("Delete")]}),h(J,{label:E("labels.cut"),shortcuts:[z("CtrlOrCmd+X")]}),h(J,{label:E("labels.copy"),shortcuts:[z("CtrlOrCmd+C")]}),h(J,{label:E("labels.paste"),shortcuts:[z("CtrlOrCmd+V")]}),h(J,{label:E("labels.pasteAsPlaintext"),shortcuts:[z("CtrlOrCmd+Shift+V")]}),h(J,{label:E("labels.selectAll"),shortcuts:[z("CtrlOrCmd+A")]}),h(J,{label:E("labels.multiSelect"),shortcuts:[z(`Shift+${E("helpDialog.click")}`)]}),h(J,{label:E("helpDialog.deepSelect"),shortcuts:[z(`CtrlOrCmd+${E("helpDialog.click")}`)]}),h(J,{label:E("helpDialog.deepBoxSelect"),shortcuts:[z(`CtrlOrCmd+${E("helpDialog.drag")}`)]}),(hh||Ql)&&h(J,{label:E("labels.copyAsPng"),shortcuts:[z("Shift+Alt+C")]}),h(J,{label:E("labels.copyStyles"),shortcuts:[z("CtrlOrCmd+Alt+C")]}),h(J,{label:E("labels.pasteStyles"),shortcuts:[z("CtrlOrCmd+Alt+V")]}),h(J,{label:E("labels.sendToBack"),shortcuts:[z(en?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),h(J,{label:E("labels.bringToFront"),shortcuts:[z(en?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),h(J,{label:E("labels.sendBackward"),shortcuts:[z("CtrlOrCmd+[")]}),h(J,{label:E("labels.bringForward"),shortcuts:[z("CtrlOrCmd+]")]}),h(J,{label:E("labels.alignTop"),shortcuts:[z("CtrlOrCmd+Shift+Up")]}),h(J,{label:E("labels.alignBottom"),shortcuts:[z("CtrlOrCmd+Shift+Down")]}),h(J,{label:E("labels.alignLeft"),shortcuts:[z("CtrlOrCmd+Shift+Left")]}),h(J,{label:E("labels.alignRight"),shortcuts:[z("CtrlOrCmd+Shift+Right")]}),h(J,{label:E("labels.duplicateSelection"),shortcuts:[z("CtrlOrCmd+D"),z(`Alt+${E("helpDialog.drag")}`)]}),h(J,{label:E("helpDialog.toggleElementLock"),shortcuts:[z("CtrlOrCmd+Shift+L")]}),h(J,{label:E("buttons.undo"),shortcuts:[z("CtrlOrCmd+Z")]}),h(J,{label:E("buttons.redo"),shortcuts:mu?[z("CtrlOrCmd+Y"),z("CtrlOrCmd+Shift+Z")]:[z("CtrlOrCmd+Shift+Z")]}),h(J,{label:E("labels.group"),shortcuts:[z("CtrlOrCmd+G")]}),h(J,{label:E("labels.ungroup"),shortcuts:[z("CtrlOrCmd+Shift+G")]}),h(J,{label:E("labels.flipHorizontal"),shortcuts:[z("Shift+H")]}),h(J,{label:E("labels.flipVertical"),shortcuts:[z("Shift+V")]}),h(J,{label:E("labels.showStroke"),shortcuts:[z("S")]}),h(J,{label:E("labels.showBackground"),shortcuts:[z("G")]}),h(J,{label:E("labels.showFonts"),shortcuts:[z("Shift+F")]}),h(J,{label:E("labels.decreaseFontSize"),shortcuts:[z("CtrlOrCmd+Shift+<")]}),h(J,{label:E("labels.increaseFontSize"),shortcuts:[z("CtrlOrCmd+Shift+>")]})]})]})]})})},nT=4,iT=8,lT=({shouldWrap:e,children:t,username:a})=>e?h(tl,{label:a||"Unknown user",children:t}):h(te,{children:t}),p1=({actionManager:e,collaborator:t,socketId:a,withName:n=!1,shouldWrapWithTooltip:i=!1,isBeingFollowed:l})=>{let r={socketId:a,collaborator:t,withName:n,isBeingFollowed:l},o=e.renderAction("goToCollaborator",r);return h(lT,{username:t.username,shouldWrap:i,children:o},a)},rT=["avatarUrl","id","socketId","username","isInCall","isSpeaking","isMuted"],u6=ee.memo(({className:e,mobile:t,collaborators:a,userToFollow:n})=>{let i=sa(),l=new Map;a.forEach((p,m)=>{let g=p.id||m;l.set(g,{...p,socketId:m})});let r=Array.from(l.values()).filter(p=>p.username?.trim()),[o,d]=ee.useState(""),u=r.filter(p=>p.username?.toLowerCase().includes(o)),s=ee.useRef(null);Ia(()=>{if(s.current){let p=g=>{let y=Math.max(1,Math.min(8,Math.floor(g/38)));U(y)};if(p(s.current.clientWidth),!kd)return;let m=new ResizeObserver(g=>{for(let y of g){let{width:v}=y.contentRect;p(v)}});return m.observe(s.current),()=>{m.disconnect()}}},[]);let[c,U]=ee.useState(nT),f=r.slice(0,c-1).map(p=>p1({actionManager:i,collaborator:p,socketId:p.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:p.socketId===n}));return t?h("div",{className:Q("UserList UserList_mobile",e),children:r.map(p=>p1({actionManager:i,collaborator:p,socketId:p.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:p.socketId===n}))}):h("div",{className:"UserList__wrapper",ref:s,children:M("div",{className:Q("UserList",e),style:{"--max-avatars":c},children:[f,r.length>c-1&&M(Jt.Root,{children:[M(Jt.Trigger,{className:"UserList__more",children:["+",r.length-c+1]}),h(Jt.Content,{style:{zIndex:2,width:"15rem",textAlign:"left"},align:"end",sideOffset:10,children:M(Va,{padding:2,children:[r.length>=iT&&h(N2,{placeholder:E("quickSearch.placeholder"),onChange:d}),h(P2,{className:"dropdown-menu UserList__collaborators",placeholder:E("userList.empty"),children:u.length>0?[h("div",{className:"hint",children:E("userList.hint.text")}),u.map(p=>p1({actionManager:i,collaborator:p,socketId:p.socketId,withName:!0,isBeingFollowed:p.socketId===n}))]:[]}),h(Jt.Arrow,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})]})]})})},(e,t)=>{if(e.collaborators.size!==t.collaborators.size||e.mobile!==t.mobile||e.className!==t.className||e.userToFollow!==t.userToFollow)return!1;let a=t.collaborators.keys();for(let[n,i]of e.collaborators){let l=t.collaborators.get(n);if(!l||n!==a.next().value||!At(i,l,rT))return!1}return!0}),U6=({children:e,color:t})=>h("div",{className:"Card",style:{"--card-color":t==="primary"?"var(--color-primary)":Mt[t][7],"--card-color-darker":t==="primary"?"var(--color-primary-darker)":Mt[t][8],"--card-color-darkest":t==="primary"?"var(--color-primary-darkest)":Mt[t][9]},children:e}),sT=({elements:e,appState:t,setAppState:a,files:n,actionManager:i,exportOpts:l,canvas:r,onCloseRequest:o})=>{let{onExportToBackend:d}=l;return h("div",{className:"ExportDialog ExportDialog--json",children:M("div",{className:"ExportDialog-cards",children:[l.saveFileToDisk&&M(U6,{color:"lime",children:[h("div",{className:"Card-icon",children:$8}),h("h2",{children:E("exportDialog.disk_title")}),M("div",{className:"Card-details",children:[E("exportDialog.disk_details"),!gs&&i.renderAction("changeProjectName")]}),h(Me,{className:"Card-button",type:"button",title:E("exportDialog.disk_button"),"aria-label":E("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(em,"ui")}})]}),d&&M(U6,{color:"pink",children:[h("div",{className:"Card-icon",children:rc}),h("h2",{children:E("exportDialog.link_title")}),h("div",{className:"Card-details",children:E("exportDialog.link_details")}),h(Me,{className:"Card-button",type:"button",title:E("exportDialog.link_button"),"aria-label":E("exportDialog.link_button"),showAriaLabel:!0,onClick:async()=>{try{Ge("export","link",`ui (${V7()})`),await d(e,t,n),o()}catch(u){a({errorMessage:u.message})}}})]}),l.renderCustomUI&&l.renderCustomUI(e,t,n,r)]})})},oT=({elements:e,appState:t,files:a,actionManager:n,exportOpts:i,canvas:l,setAppState:r})=>{let o=ee.useCallback(()=>{r({openDialog:null})},[r]);return h(te,{children:t.openDialog?.name==="jsonExport"&&h(ja,{onCloseRequest:o,title:E("buttons.export"),children:h(sT,{elements:e,appState:t,setAppState:r,files:a,actionManager:n,onCloseRequest:o,exportOpts:i,canvas:l})})})},dT=e=>h("button",{className:"help-icon",onClick:e.onClick,type:"button",title:`${E("helpDialog.title")} \u2014 ?`,"aria-label":E("helpDialog.title"),children:lc}),f6=({appState:e,actionManager:t,showExitZenModeBtn:a,renderWelcomeScreen:n})=>{let{FooterCenterTunnel:i,WelcomeScreenHelpHintTunnel:l}=Yt(),r=vt(),o=!e.viewModeEnabled&&e.multiElement&&r.isTouchScreen;return M("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[h("div",{className:Q("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled}),children:h(Ca.Col,{gap:2,children:M(is,{heading:"canvasActions",children:[h(UI,{renderAction:t.renderAction,zoom:e.zoom}),!e.viewModeEnabled&&h(fI,{renderAction:t.renderAction,className:Q("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":e.zenModeEnabled})}),o&&h(mI,{renderAction:t.renderAction,className:Q("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled})})]})})}),h(i.Out,{}),h("div",{className:Q("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right":e.zenModeEnabled}),children:M("div",{style:{position:"relative"},children:[n&&h(l.Out,{}),h(dT,{onClick:()=>t.executeAction(Qh)})]})}),h(pI,{actionManager:t,showExitZenModeBtn:a})]})},cT=f6;f6.displayName="Footer";var p6=ee.createContext({}),m6=({children:e,className:t})=>{let a=vt(),n=Ja(p6),i=!!(a.editor.canFitSidebar&&n.shouldRenderDockButton);return M("div",{className:Q("sidebar__header",t),"data-testid":"sidebar-header",children:[e,M("div",{className:"sidebar__header__buttons",children:[i&&h(tl,{label:E("labels.sidebarLock"),children:h(yi,{onSelect:()=>n.onDock?.(!n.docked),selected:!!n.docked,className:"sidebar__dock","data-testid":"sidebar-dock","aria-label":E("labels.sidebarLock"),children:y8})}),h(yi,{"data-testid":"sidebar-close",className:"sidebar__close",onSelect:n.onCloseRequest,"aria-label":E("buttons.close"),children:xl})]})]})};m6.displayName="SidebarHeader";var g6=({name:e,tab:t,icon:a,title:n,children:i,onToggle:l,className:r,style:o})=>{let d=wt(),u=Nt();return M("label",{title:n,className:"sidebar-trigger__label-element",children:[h("input",{className:"ToolIcon_type_checkbox",type:"checkbox",onChange:s=>{document.querySelector(".layer-ui__wrapper")?.classList.remove("animate");let c=s.target.checked;d({openSidebar:c?{name:e,tab:t}:null}),l?.(c)},checked:u.openSidebar?.name===e,"aria-label":n,"aria-keyshortcuts":"0"}),M("div",{className:Q("sidebar-trigger",r),style:o,children:[a&&h("div",{children:a}),i&&h("div",{className:"sidebar-trigger__label",children:i})]})]})};g6.displayName="SidebarTrigger";var b6=({children:e,...t})=>h(Qn.List,{className:"sidebar-triggers",...t,children:e});b6.displayName="SidebarTabTriggers";var y6=({children:e,tab:t,onSelect:a,...n})=>h(Qn.Trigger,{value:t,asChild:!0,onSelect:a,children:h("button",{type:"button",className:"excalidraw-button sidebar-tab-trigger",...n,children:e})});y6.displayName="SidebarTabTrigger";var v6=({children:e,...t})=>{let a=Nt(),n=wt();if(!a.openSidebar)return null;let{name:i}=a.openSidebar;return h(Qn.Root,{className:"sidebar-tabs-root",value:a.openSidebar.tab,onValueChange:l=>n(r=>({...r,openSidebar:{...r.openSidebar,name:i,tab:l}})),...t,children:e})};v6.displayName="SidebarTabs";var w6=({tab:e,children:t,...a})=>h(Qn.Content,{...a,value:e,"data-testid":e,children:t});w6.displayName="SidebarTab";var m1=Lt(!1),E6=xi(({name:e,children:t,onDock:a,docked:n,className:i,...l},r)=>{me.DEV&&a&&n==null&&console.warn("Sidebar: `docked` must be set when `onDock` is supplied for the sidebar to be user-dockable. To hide this message, either pass `docked` or remove `onDock`");let o=wt(),d=$o(m1);Ia(()=>(d(!!n),()=>{d(!1)}),[d,n]);let u=re({});u.current.onCloseRequest=()=>{o({openSidebar:null})},u.current.onDock=f=>a?.(f),u.current=zs(u.current,{docked:n,shouldRenderDockButton:!!a&&n!=null});let s=re(null);eu(r,()=>s.current);let c=vt(),U=at(()=>{document.querySelector(".Dialog")||o({openSidebar:null})},[o]);return Wh(s,at(f=>{f.target.closest(".sidebar-trigger")||(!n||!c.editor.canFitSidebar)&&U()},[U,n,c.editor.canFitSidebar])),ae(()=>{let f=p=>{p.key===L.ESCAPE&&(!n||!c.editor.canFitSidebar)&&U()};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[U,n,c.editor.canFitSidebar]),h(Va,{...l,className:Q("sidebar",{"sidebar--docked":n},i),ref:s,children:h(p6.Provider,{value:u.current,children:t})})});E6.displayName="SidebarInner";var Za=Object.assign(xi((e,t)=>{let a=Nt(),{onStateChange:n}=e,i=re(a.openSidebar);ae(()=>{(!a.openSidebar&&i?.current?.name===e.name||a.openSidebar?.name===e.name&&i?.current?.name!==e.name||i.current?.name===e.name)&&a.openSidebar!==i.current&&n?.(a.openSidebar?.name!==e.name?null:a.openSidebar),i.current=a.openSidebar},[a.openSidebar,n,e.name]);let[l,r]=se(!1);return Ia(()=>(r(!0),()=>r(!1)),[]),l&&a.openSidebar?.name===e.name?tu(E6,{...e,ref:t,key:e.name}):null}),{Header:m6,TabTriggers:b6,TabTrigger:y6,Tabs:v6,Tab:w6,Trigger:g6});Za.displayName="Sidebar";var x6={};hu(x6,{ChangeCanvasBackground:()=>N6,ClearCanvas:()=>A6,CommandPalette:()=>T6,Export:()=>P6,Help:()=>D6,LiveCollaborationTrigger:()=>O6,LoadScene:()=>C6,SaveAsImage:()=>I6,SaveToActiveFile:()=>k6,SearchMenu:()=>L6,Socials:()=>_6,ToggleTheme:()=>R6});var S6=Lt({active:!1});async function hT({title:e,description:t,actionLabel:a,color:n}){return new Promise(i=>{Ga.set(S6,{active:!0,onConfirm:()=>i(!0),onClose:()=>i(!1),onReject:()=>i(!1),title:e,description:t,actionLabel:a,color:n})})}var M6=({value:e,shortcut:t,onChange:a,choices:n,children:i,name:l})=>{let r=vt();return M(te,{children:[M("div",{className:"dropdown-menu-item-base dropdown-menu-item-bare",children:[h("label",{className:"dropdown-menu-item__text",htmlFor:l,children:i}),h(e6,{name:l,value:e,onChange:a,choices:n})]}),t&&!r.editor.isMobile&&h("div",{className:"dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned",children:t})]})};M6.displayName="DropdownMenuItemContentRadio";var uT=M6,C6=()=>{let{t:e}=Rt(),t=sa(),a=gd();return t.isActionEnabled(Jh)?h(Ma,{icon:sc,onSelect:async()=>{(!a.length||await hT({title:e("overwriteConfirm.modal.loadFromFile.title"),actionLabel:e("overwriteConfirm.modal.loadFromFile.button"),color:"warning",description:h(bn,{i18nKey:"overwriteConfirm.modal.loadFromFile.description",bold:n=>h("strong",{children:n}),br:()=>h("br",{})})}))&&t.executeAction(Jh)},"data-testid":"load-button",shortcut:Ft("loadScene"),"aria-label":e("buttons.load"),children:e("buttons.load")}):null};C6.displayName="LoadScene";var k6=()=>{let{t:e}=Rt(),t=sa();return t.isActionEnabled(Q2)?h(Ma,{shortcut:Ft("saveScene"),"data-testid":"save-button",onSelect:()=>t.executeAction(Q2),icon:B8,"aria-label":`${e("buttons.save")}`,children:`${e("buttons.save")}`}):null};k6.displayName="SaveToActiveFile";var I6=()=>{let e=wt(),{t}=Rt();return h(Ma,{icon:UU,"data-testid":"image-export-button",onSelect:()=>e({openDialog:{name:"imageExport"}}),shortcut:Ft("imageExport"),"aria-label":t("buttons.exportImage"),children:t("buttons.exportImage")})};I6.displayName="SaveAsImage";var T6=e=>{let t=wt(),{t:a}=Rt();return h(Ma,{icon:zU,"data-testid":"command-palette-button",onSelect:()=>{Ge("command_palette","open","menu"),t({openDialog:{name:"commandPalette"}})},shortcut:Ft("commandPalette"),"aria-label":a("commandPalette.title"),className:e?.className,children:a("commandPalette.title")})};T6.displayName="CommandPalette";var L6=e=>{let{t}=Rt(),a=sa();return h(Ma,{icon:zi,"data-testid":"search-menu-button",onSelect:()=>{a.executeAction(Ym)},shortcut:Ft("searchMenu"),"aria-label":t("search.title"),className:e?.className,children:t("search.title")})};L6.displayName="SearchMenu";var D6=()=>{let{t:e}=Rt(),t=sa();return h(Ma,{"data-testid":"help-menu-item",icon:lc,onSelect:()=>t.executeAction(Qh),shortcut:"?","aria-label":e("helpDialog.title"),children:e("helpDialog.title")})};D6.displayName="Help";var A6=()=>{let{t:e}=Rt(),t=$o(sd);return sa().isActionEnabled(Kr)?h(Ma,{icon:Bi,onSelect:()=>t("clearCanvas"),"data-testid":"clear-canvas-button","aria-label":e("buttons.clearReset"),children:e("buttons.clearReset")}):null};A6.displayName="ClearCanvas";var R6=e=>{let{t}=Rt(),a=Nt(),n=sa(),i=Ft("toggleTheme");return n.isActionEnabled(qo)?e?.allowSystemTheme?h(uT,{name:"theme",value:e.theme,onChange:l=>e.onSelect(l),choices:[{value:Se.LIGHT,label:ic,ariaLabel:`${t("buttons.lightMode")} - ${i}`},{value:Se.DARK,label:nc,ariaLabel:`${t("buttons.darkMode")} - ${i}`},{value:"system",label:q3,ariaLabel:t("buttons.systemMode")}],children:t("labels.theme")}):h(Ma,{onSelect:l=>{if(l.preventDefault(),e?.onSelect)e.onSelect(a.theme===Se.DARK?Se.LIGHT:Se.DARK);else return n.executeAction(qo)},icon:a.theme===Se.DARK?ic:nc,"data-testid":"toggle-dark-mode",shortcut:i,"aria-label":a.theme===Se.DARK?t("buttons.lightMode"):t("buttons.darkMode"),children:a.theme===Se.DARK?t("buttons.lightMode"):t("buttons.darkMode")}):null};R6.displayName="ToggleTheme";var N6=()=>{let{t:e}=Rt(),t=Nt(),a=sa(),n=os();return t.viewModeEnabled||!n.UIOptions.canvasActions.changeViewBackgroundColor?null:M("div",{style:{marginTop:"0.5rem"},children:[h("div",{"data-testid":"canvas-background-label",style:{fontSize:".75rem",marginBottom:".5rem"},children:e("labels.canvasBackground")}),h("div",{style:{padding:"0 0.625rem"},children:a.renderAction("changeViewBackgroundColor")})]})};N6.displayName="ChangeCanvasBackground";var P6=()=>{let{t:e}=Rt(),t=wt();return h(Ma,{icon:js,onSelect:()=>{t({openDialog:{name:"jsonExport"}})},"data-testid":"json-export-button","aria-label":e("buttons.export"),children:e("buttons.export")})};P6.displayName="Export";var _6=()=>{let{t:e}=Rt();return M(te,{children:[h(rd,{icon:uU,href:"https://github.com/excalidraw/excalidraw","aria-label":"GitHub",children:"GitHub"}),h(rd,{icon:_8,href:"https://x.com/excalidraw","aria-label":"X",children:e("labels.followUs")}),h(rd,{icon:P8,href:"https://discord.gg/UexuTaE","aria-label":"Discord",children:e("labels.discordChat")})]})};_6.displayName="Socials";var O6=({onSelect:e,isCollaborating:t})=>{let{t:a}=Rt();return h(Ma,{"data-testid":"collab-button",icon:IU,className:Q({"active-collab":t}),onSelect:e,children:a("labels.liveCollaboration")})};O6.displayName="LiveCollaborationTrigger";var ls=(e,t)=>{let a=Lt(0),n=i=>{let{tunnelsJotai:{useAtom:l}}=Yt(),[,r]=l(a),o=re({preferHost:!1,counter:0});return Ia(()=>{let d=o.current;return r(u=>{let s=u+1;return d.counter=s,s}),()=>{r(u=>{let s=u-1;return d.counter=s,s||(d.preferHost=!1),s})}},[r]),i.__fallback||(o.current.preferHost=!0),!o.current.counter&&i.__fallback&&o.current.preferHost||o.current.counter>1&&i.__fallback?null:h(t,{...i})};return n.displayName=e,n},UT=Object.assign(ls("MainMenu",({children:e,onSelect:t})=>{let{MainMenuTunnel:a}=Yt(),n=vt(),i=Nt(),l=wt(),r=n.editor.isMobile?void 0:()=>l({openMenu:null});return h(a.In,{children:M(Ve,{open:i.openMenu==="canvas",children:[h(Ve.Trigger,{onToggle:()=>{l({openMenu:i.openMenu==="canvas"?null:"canvas"})},"data-testid":"main-menu-trigger",className:"main-menu-trigger",children:cU}),M(Ve.Content,{onClickOutside:r,onSelect:Fs(t,()=>{l({openMenu:null})}),children:[e,n.editor.isMobile&&i.collaborators.size>0&&M("fieldset",{className:"UserList-Wrapper",children:[h("legend",{children:E("labels.collaborators")}),h(u6,{mobile:!0,collaborators:i.collaborators,userToFollow:i.userToFollow?.socketId||null})]})]})]})})}),{Trigger:Ve.Trigger,Item:Ve.Item,ItemLink:Ve.ItemLink,ItemCustom:Ve.ItemCustom,Group:Ve.Group,Separator:Ve.Separator,DefaultItems:x6}),jt=UT,g1=({title:e,children:t,actionLabel:a,onClick:n})=>M("div",{className:"OverwriteConfirm__Actions__Action",children:[h("h4",{children:e}),h("div",{className:"OverwriteConfirm__Actions__Action__content",children:t}),h(as,{variant:"outlined",color:"muted",label:a,size:"large",fullWidth:!0,onClick:n})]}),fT=()=>{let{t:e}=Rt(),t=sa(),a=wt();return h(g1,{title:e("overwriteConfirm.action.exportToImage.title"),actionLabel:e("overwriteConfirm.action.exportToImage.button"),onClick:()=>{t.executeAction(J2,"ui",!0),a({openDialog:{name:"imageExport"}})},children:e("overwriteConfirm.action.exportToImage.description")})},pT=()=>{let{t:e}=Rt(),t=sa();return h(g1,{title:e("overwriteConfirm.action.saveToDisk.title"),actionLabel:e("overwriteConfirm.action.saveToDisk.button"),onClick:()=>{t.executeAction(em,"ui")},children:e("overwriteConfirm.action.saveToDisk.description")})},B6=Object.assign(({children:e})=>h("div",{className:"OverwriteConfirm__Actions",children:e}),{ExportToImage:fT,SaveToDisk:pT}),b1=Object.assign(ls("OverwriteConfirmDialog",({children:e})=>{let{OverwriteConfirmDialogTunnel:t}=Yt(),[a,n]=st(S6);if(!a.active)return null;let i=()=>{a.onClose(),n(r=>({...r,active:!1}))},l=()=>{a.onConfirm(),n(r=>({...r,active:!1}))};return h(t.In,{children:h(ja,{onCloseRequest:i,title:!1,size:916,children:M("div",{className:"OverwriteConfirm",children:[h("h3",{children:a.title}),M("div",{className:`OverwriteConfirm__Description OverwriteConfirm__Description--color-${a.color}`,children:[h("div",{className:"OverwriteConfirm__Description__icon",children:R3}),h("div",{children:a.description}),h("div",{className:"OverwriteConfirm__Description__spacer"}),h(as,{color:a.color,size:"large",label:a.actionLabel,onClick:l})]}),h(B6,{children:e})]})})})}),{Actions:B6,Action:g1}),mT=Lt(""),z6=Lt(null),gT=350,bT=()=>{let e=Ka(),t=wt(),a=re(null),[n,i]=st(mT),l=n.trim(),[r,o]=se(!1),[d,u]=se({nonce:null,items:[]}),s=re(null),c=re(void 0),[U,f]=st(z6),p=e.scene.getNonDeletedElementsMap();ae(()=>{r||(l!==s.current||e.scene.getSceneNonce()!==c.current)&&(s.current=null,F6(l,e,(b,x)=>{u({nonce:cn(),items:b}),s.current=l,c.current=e.scene.getSceneNonce(),t({searchMatches:b.map(S=>({id:S.textElement.id,focus:!1,matchedLines:S.matchedLines}))})}))},[r,l,p,e,t,f,c]);let m=()=>{d.items.length>0&&f(b=>b===null?0:(b+1)%d.items.length)},g=()=>{d.items.length>0&&f(b=>b===null?0:b-1<0?d.items.length-1:b-1)};ae(()=>{t(b=>({searchMatches:b.searchMatches.map((x,S)=>S===U?{...x,focus:!0}:{...x,focus:!1})}))},[U,t]),ae(()=>{if(d.items.length>0&&U!==null){let b=d.items[U];if(b){let x=e.state.zoom.value,S=ua({text:b.searchQuery,x:b.textElement.x+(b.matchedLines[0]?.offsetX??0),y:b.textElement.y+(b.matchedLines[0]?.offsetY??0),width:b.matchedLines[0]?.width,height:b.matchedLines[0]?.height,fontSize:b.textElement.fontSize,fontFamily:b.textElement.fontFamily}),C=14,T=b.textElement.fontSize,k=T*x<C;if(!zo([S],e.canvas.width/window.devicePixelRatio,e.canvas.height/window.devicePixelRatio,{offsetLeft:e.state.offsetLeft,offsetTop:e.state.offsetTop,scrollX:e.state.scrollX,scrollY:e.state.scrollY,zoom:e.state.zoom},e.scene.getNonDeletedElementsMap(),e.getEditorUIOffsets())||k){let R;k?T>=C?R={fitToContent:!0}:R={fitToViewport:!0,maxZoom:nn(C/T,1)}:R={fitToContent:!0},e.scrollToContent(S,{animate:!0,duration:300,...R,canvasOffsets:e.getEditorUIOffsets()})}}}},[U,d,e]),ae(()=>()=>{f(null),s.current=null,c.current=void 0,t({searchMatches:[]}),o(!1)},[t,f]);let y=Yo({goToNextItem:m,goToPreviousItem:g,searchMatches:d});ae(()=>Je(window,"keydown",x=>{if(x.key===L.ESCAPE&&!e.state.openDialog&&!e.state.openPopup){x.preventDefault(),x.stopPropagation(),t({openSidebar:null});return}x[L.CTRL_OR_CMD]&&x.key===L.F&&(x.preventDefault(),x.stopPropagation(),a.current?.matches(":focus")?t({openSidebar:null}):(e.state.openDialog&&t({openDialog:null}),a.current?.focus(),a.current?.select())),x.target instanceof HTMLElement&&x.target.closest(".layer-ui__search")&&y.searchMatches.items.length&&(x.key===L.ENTER&&(x.stopPropagation(),y.goToNextItem()),x.key===L.ARROW_UP?(x.stopPropagation(),y.goToPreviousItem()):x.key===L.ARROW_DOWN&&(x.stopPropagation(),y.goToNextItem()))},{capture:!0,passive:!1}),[t,y,e]);let v=`${d.items.length} ${d.items.length===1?E("search.singleResult"):E("search.multipleResults")}`;return M("div",{className:"layer-ui__search",children:[h("div",{className:"layer-ui__search-header",children:h(c1,{className:dl.SEARCH_MENU_INPUT_WRAPPER,value:n,ref:a,placeholder:E("search.placeholder"),icon:zi,onChange:b=>{i(b),o(!0);let x=b.trim();F6(x,e,(S,C)=>{u({nonce:cn(),items:S}),f(C),s.current=x,c.current=e.scene.getSceneNonce(),t({searchMatches:S.map(T=>({id:T.textElement.id,focus:!1,matchedLines:T.matchedLines}))}),o(!1)})},selectOnRender:!0})}),M("div",{className:"layer-ui__search-count",children:[d.items.length>0&&M(te,{children:[U!==null&&U>-1?M("div",{children:[U+1," / ",v]}):h("div",{children:v}),M("div",{className:"result-nav",children:[h(yi,{onSelect:()=>{m()},className:"result-nav-btn",children:$U}),h(yi,{onSelect:()=>{g()},className:"result-nav-btn",children:lb})]})]}),d.items.length===0&&l&&s.current&&h("div",{style:{margin:"1rem auto"},children:E("search.noMatch")})]}),h(ET,{matches:d,onItemClick:f,focusIndex:U,searchQuery:l})]})},yT=e=>{let t=[e.preview.moreBefore?"...":"",e.preview.previewText.slice(0,e.preview.indexInSearchQuery),e.preview.previewText.slice(e.preview.indexInSearchQuery,e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.previewText.slice(e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.moreAfter?"...":""];return h("div",{tabIndex:-1,className:Q("layer-ui__result-item",{active:e.highlighted}),onClick:e.onClick,ref:a=>{e.highlighted&&a?.scrollIntoView({behavior:"auto",block:"nearest"})},children:h("div",{className:"preview-text",children:t.flatMap((a,n)=>h(Z5,{children:n===2?h("b",{children:a}):a},n))})})},vT=e=>h("div",{className:"layer-ui__search-result-container",children:e.matches.items.map((t,a)=>h(yT,{searchQuery:e.searchQuery,preview:t.preview,highlighted:a===e.focusIndex,onClick:()=>e.onItemClick(a)},t.textElement.id+t.index))}),wT=(e,t)=>e.matches.nonce===t.matches.nonce&&e.focusIndex===t.focusIndex,ET=il(vT,wT),xT=(e,t,a)=>{let n=e.slice(0,t),i=n.split(/\s+/),l=n.endsWith(" "),r=i.length-2-1-(l?0:1),o=i.slice(r<=0?0:r).join(" ")+(l?" ":""),d=20;o=o.length>d?o.slice(-d):o;let u=e.slice(t+a.length),s=u.split(/\s+/),c=!u.startsWith(" "),U=c?6:5,f=(c?"":" ")+s.slice(0,U).join(" ");return{indexInSearchQuery:o.length,previewText:o+a+f,moreBefore:r>0,moreAfter:s.length>U}},ST=(e,t)=>{let a=e.split(`
`),n=[],i=0;for(let l=0;l<a.length;l++){let r=a[l],o=a[l+1];if(o){let d=t.indexOf(o,i);if(d>r.length+i){let u=d-(r.length+i);for(;u>0;)r+=" ",u--}}n.push(r),i=i+r.length}return n.join(`
`)},MT=(e,t,a)=>{let n=ST(e.text,e.originalText).split(`
`),i=[],l=0,r=0;for(let s of n){let c=l,U=c+s.length-1;i.push({line:s,startIndex:c,endIndex:U,lineNumber:r}),l=U+1,r++}let o=a,d=e.originalText.slice(a,a+t.length),u=[];for(let s of i){if(d==="")break;if(o>=s.startIndex&&o<=s.endIndex){let c=s.endIndex+1-o,U=s.line.slice(0,o-s.startIndex),f=d.slice(0,c);d=d.slice(c);let p=zt(U,Oe(e),e.lineHeight);if(U===""&&(p.width=0),e.textAlign!=="left"&&s.line.length>0){let b=zt(s.line,Oe(e),e.lineHeight),x=e.textAlign==="center"?(e.width-b.width)/2:e.width-b.width;p.width+=x}let{width:m,height:g}=zt(f,Oe(e),e.lineHeight),y=p.width,v=s.lineNumber*p.height;u.push({offsetX:y,offsetY:v,width:m,height:g}),o+=c}}return u},CT=e=>e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),F6=rg((e,t,a)=>{if(!e||e===""){a([],null);return}let n=t.scene.getNonDeletedElements().filter(d=>j(d));n.sort((d,u)=>d.y-u.y);let i=[],l=new RegExp(CT(e),"gi");for(let d of n){let u=null,s=d.originalText;for(;(u=l.exec(s))!==null;){let c=xT(s,u.index,e),U=MT(d,e,u.index);U.length>0&&i.push({textElement:d,searchQuery:e,preview:c,index:u.index,matchedLines:U})}}let r=new Set(t.visibleElements.map(d=>d.id)),o=i.findIndex(d=>r.has(d.textElement.id))??null;a(i,o)},gT),$6=ls("DefaultSidebarTrigger",e=>{let{DefaultSidebarTriggerTunnel:t}=Yt();return h(t.In,{children:h(Za.Trigger,{...e,className:"default-sidebar-trigger",name:Aa.name})})});$6.displayName="DefaultSidebarTrigger";var H6=({children:e})=>{let{DefaultSidebarTabTriggersTunnel:t}=Yt();return h(t.In,{children:e})};H6.displayName="DefaultTabTriggers";var y1=Object.assign(ls("DefaultSidebar",({children:e,className:t,onDock:a,docked:n,...i})=>{let l=Nt(),r=wt(),{DefaultSidebarTabTriggersTunnel:o}=Yt(),d=l.openSidebar?.tab===fl;return tu(Za,{...i,name:"default",key:"default",className:Q("default-sidebar",t),docked:d||(n??l.defaultSidebarDockedPreference),onDock:d||a===!1||!a&&n!=null?void 0:Fs(a,u=>{r({defaultSidebarDockedPreference:u})})},M(Za.Tabs,{children:[h(Za.Header,{children:M(Za.TabTriggers,{children:[h(Za.TabTrigger,{tab:fl,children:zi}),h(Za.TabTrigger,{tab:ks,children:ec}),h(o.Out,{})]})}),h(Za.Tab,{tab:ks,children:h(eI,{})}),h(Za.Tab,{tab:fl,children:h(bT,{})}),e]}))}),{Trigger:$6,TabTriggers:H6}),kT="small",IT=e=>M("label",{className:Q("ToolIcon ToolIcon__LaserPointer",`ToolIcon_size_${kT}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[h("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-LaserPointer"}),h("div",{className:"ToolIcon__icon",children:OU})]}),TT=({canvasRef:e,setError:t})=>{let a=e.current;if(!a)return;let n=a.parentElement;n&&(n.style.background="",t(null),a.replaceChildren())},X6=async({canvasRef:e,mermaidToExcalidrawLib:t,mermaidDefinition:a,setError:n,data:i})=>{let l=e.current,r=l?.parentElement;if(!(!l||!r)){if(!a){TT({canvasRef:e,setError:n});return}try{let o=await t.api,d;try{d=await o.parseMermaidToExcalidraw(a)}catch{d=await o.parseMermaidToExcalidraw(a.replace(/"/g,"'"))}let{elements:u,files:s={}}=d;n(null),i.current={elements:md(u,{regenerateIds:!0}),files:s};let c=await zr({elements:i.current.elements,files:i.current.files,exportPadding:Ul,maxWidthOrHeight:Math.max(r.offsetWidth,r.offsetHeight)*window.devicePixelRatio});try{await Gr(c)}catch(U){throw U.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(E("canvasError.canvasTooBig")):U}r.style.background="var(--default-bg-color)",l.replaceChildren(c)}catch(o){throw r.style.background="var(--default-bg-color)",a&&n(o),o}}},v1=e=>{al.set(ir.MERMAID_TO_EXCALIDRAW,e)},W6=({app:e,data:t,text:a,shouldSaveMermaidDataToStorage:n})=>{let{elements:i,files:l}=t.current;i.length&&(e.addElementsFromPasteOrLibrary({elements:i,files:l,position:"center",fitToContent:!0}),e.setOpenDialog(null),n&&a&&v1(a))},G6=({children:e})=>h("div",{className:"ttd-dialog-panels",children:e}),hd=({label:e,children:t,panelAction:a,panelActionDisabled:n=!1,onTextSubmitInProgess:i,renderTopRight:l,renderSubmitShortcut:r,renderBottomRight:o})=>M("div",{className:"ttd-dialog-panel",children:[M("div",{className:"ttd-dialog-panel__header",children:[h("label",{children:e}),l?.()]}),t,M("div",{className:Q("ttd-dialog-panel-button-container",{invisible:!a}),style:{display:"flex",alignItems:"center"},children:[M(yi,{className:"ttd-dialog-panel-button",onSelect:a?a.action:()=>{},disabled:n||i,children:[M("div",{className:Q({invisible:i}),children:[a?.label,a?.icon&&h("span",{children:a.icon})]}),i&&h(Wn,{})]}),!n&&!i&&r?.(),o?.()]})]}),V6=({input:e,placeholder:t,onChange:a,onKeyboardSubmit:n})=>{let i=re(null),l=re(n);return l.current=n,ae(()=>{if(!l.current)return;let r=i.current;if(r){let o=d=>{d[L.CTRL_OR_CMD]&&d.key===L.ENTER&&(d.preventDefault(),l.current?.())};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}}},[]),h("textarea",{className:"ttd-dialog-input",onChange:a,value:e,placeholder:t,autoFocus:!0,ref:i})},LT=({error:e})=>M("div",{"data-testid":"ttd-dialog-output-error",className:"ttd-dialog-output-error",children:["Error! ",h("p",{children:e})]}),Y6=({error:e,canvasRef:t,loaded:a})=>M("div",{className:"ttd-dialog-output-wrapper",children:[e&&h(LT,{error:e.message}),a?h("div",{ref:t,style:{opacity:e?"0.15":1},className:"ttd-dialog-output-canvas-container"}):h(Wn,{size:"2rem"})]}),j6=()=>M("div",{className:"ttd-dialog-submit-shortcut",children:[h("div",{className:"ttd-dialog-submit-shortcut__key",children:z("CtrlOrCmd")}),h("div",{className:"ttd-dialog-submit-shortcut__key",children:z("Enter")})]}),DT=`flowchart TD
 A[Christmas] -->|Get money| B(Go shopping)
 B --> C{Let me think}
 C -->|One| D[Laptop]
 C -->|Two| E[iPhone]
 C -->|Three| F[Car]`,Z6=yl(v1,300),AT=({mermaidToExcalidrawLib:e})=>{let[t,a]=se(()=>al.get(ir.MERMAID_TO_EXCALIDRAW)||DT),n=K5(t.trim()),[i,l]=se(null),r=re(null),o=re({elements:[],files:null}),d=Ka();ae(()=>{X6({canvasRef:r,data:o,mermaidToExcalidrawLib:e,setError:l,mermaidDefinition:n}).catch(s=>{Vu()&&console.error("Failed to parse mermaid definition",s)}),Z6(n)},[n,e]),ae(()=>()=>{Z6.flush()},[]);let u=()=>{W6({app:d,data:o,text:t,shouldSaveMermaidDataToStorage:!0})};return M(te,{children:[h("div",{className:"ttd-dialog-desc",children:h(bn,{i18nKey:"mermaid.description",flowchartLink:s=>h("a",{href:"https://mermaid.js.org/syntax/flowchart.html",children:s}),sequenceLink:s=>h("a",{href:"https://mermaid.js.org/syntax/sequenceDiagram.html",children:s}),classLink:s=>h("a",{href:"https://mermaid.js.org/syntax/classDiagram.html",children:s})})}),M(G6,{children:[h(hd,{label:E("mermaid.syntax"),children:h(V6,{input:t,placeholder:"Write Mermaid diagram defintion here...",onChange:s=>a(s.target.value),onKeyboardSubmit:()=>{u()}})}),h(hd,{label:E("mermaid.preview"),panelAction:{action:()=>{u()},label:E("mermaid.button"),icon:qs},renderSubmitShortcut:()=>h(j6,{}),children:h(Y6,{canvasRef:r,loaded:e.loaded,error:i})})]})]})},RT=AT,K6=e=>{let t=wt(),a=re(null),n=re(0);return h(Qn.Root,{ref:a,className:"ttd-dialog-tabs-root",value:e.tab,onValueChange:i=>{if(!i)return;let l=a.current?.closest(".Modal__content");if(l){let r=l.offsetHeight||0;r>n.current&&(n.current=r,l.style.minHeight=`min(${n.current}px, 100%)`)}e.dialog==="ttd"&&Zu(["text-to-diagram","mermaid"],i)&&t({openDialog:{name:e.dialog,tab:i}})},children:e.children})};K6.displayName="TTDDialogTabs";var NT=K6,q6=({children:e,...t})=>h(Qn.List,{className:"ttd-dialog-triggers",...t,children:e});q6.displayName="TTDDialogTabTriggers";var w1=({children:e,tab:t,onSelect:a,...n})=>h(Qn.Trigger,{value:t,asChild:!0,onSelect:a,children:h("button",{type:"button",className:"ttd-dialog-tab-trigger",...n,children:e})});w1.displayName="TTDDialogTabTrigger";var E1=({tab:e,children:t,...a})=>h(Qn.Content,{...a,value:e,children:t});E1.displayName="TTDDialogTab";var x1=3,Yl=1e3,PT=Lt(null),_T=Lt(null),J6=e=>{let t=Nt();return t.openDialog?.name!=="ttd"?null:h(OT,{...e,tab:t.openDialog.tab})},OT=ls("TTDDialogBase",({tab:e,...t})=>{let a=Ka(),n=wt(),i=re(null),[l,r]=st(_T),[o,d]=se(l?.prompt??""),u=o.trim(),s=C=>{d(C.target.value),r(T=>({generatedResponse:T?.generatedResponse??null,prompt:C.target.value}))},[c,U]=se(!1),[f,p]=st(PT),m=async()=>{if(u.length>Yl||u.length<x1||c||f?.rateLimitRemaining===0||"__fallback"in t){u.length<x1&&S(new Error(`Prompt is too short (min ${x1} characters)`)),u.length>Yl&&S(new Error(`Prompt is too long (max ${Yl} characters)`));return}try{U(!0),Ge("ai","generate","ttd");let{generatedResponse:C,error:T,rateLimit:k,rateLimitRemaining:R}=await t.onTextSubmit(u);if(typeof C=="string"&&r(D=>({generatedResponse:C,prompt:D?.prompt??null})),lr(k)&&lr(R)&&p({rateLimit:k,rateLimitRemaining:R}),T){S(T);return}if(!C){S(new Error("Generation failed"));return}try{await X6({canvasRef:i,data:b,mermaidToExcalidrawLib:y,setError:S,mermaidDefinition:C}),Ge("ai","mermaid parse success","ttd")}catch(D){console.info(`%cTTD mermaid render errror: ${D.message}`,"color: red"),console.info(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
TTD mermaid definition render errror: ${D.message}`,"color: yellow"),Ge("ai","mermaid parse failed","ttd"),S(new Error("Generated an invalid diagram :(. You may also try a different prompt."))}}catch(C){let T=C.message;(!T||T==="Failed to fetch")&&(T="Request failed"),S(new Error(T))}finally{U(!1)}},g=re(m);g.current=m;let[y,v]=se({loaded:!1,api:import("/npm/@excalidraw/mermaid-to-excalidraw@2.2.2/+esm")});ae(()=>{(async()=>(await y.api,v(C=>({...C,loaded:!0}))))()},[y.api]);let b=re({elements:[],files:null}),[x,S]=se(null);return h(ja,{className:"ttd-dialog",onCloseRequest:()=>{a.setOpenDialog(null)},size:1200,title:!1,...t,autofocus:!1,children:M(NT,{dialog:"ttd",tab:e,children:["__fallback"in t&&t.__fallback?h("p",{className:"dialog-mermaid-title",children:E("mermaid.title")}):M(q6,{children:[h(w1,{tab:"text-to-diagram",children:M("div",{style:{display:"flex",alignItems:"center"},children:[E("labels.textToDiagram"),h("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"1px 6px",marginLeft:"10px",fontSize:10,borderRadius:"12px",background:"var(--color-promo)",color:"var(--color-surface-lowest)"},children:"AI Beta"})]})}),h(w1,{tab:"mermaid",children:"Mermaid"})]}),h(E1,{className:"ttd-dialog-content",tab:"mermaid",children:h(RT,{mermaidToExcalidrawLib:y})}),!("__fallback"in t)&&M(E1,{className:"ttd-dialog-content",tab:"text-to-diagram",children:[h("div",{className:"ttd-dialog-desc",children:"Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar."}),M(G6,{children:[h(hd,{label:E("labels.prompt"),panelAction:{action:m,label:"Generate",icon:qs},onTextSubmitInProgess:c,panelActionDisabled:u.length>Yl||f?.rateLimitRemaining===0,renderTopRight:()=>f?M("div",{className:"ttd-dialog-rate-limit",style:{fontSize:12,marginLeft:"auto",color:f.rateLimitRemaining===0?"var(--color-danger)":void 0},children:[f.rateLimitRemaining," requests left today"]}):null,renderSubmitShortcut:()=>h(j6,{}),renderBottomRight:()=>{if(typeof l?.generatedResponse=="string")return M("div",{className:"excalidraw-link",style:{marginLeft:"auto",fontSize:14},onClick:()=>{typeof l?.generatedResponse=="string"&&(v1(l.generatedResponse),n({openDialog:{name:"ttd",tab:"mermaid"}}))},children:["View as Mermaid",h(Zo,{icon:qs})]});let C=u.length/Yl;return C>.8?M("div",{style:{marginLeft:"auto",fontSize:12,fontFamily:"monospace",color:C>1?"var(--color-danger)":void 0},children:["Length: ",u.length,"/",Yl]}):null},children:h(V6,{onChange:s,input:o,placeholder:"Describe what you want to see...",onKeyboardSubmit:()=>{g.current()}})}),h(hd,{label:"Preview",panelAction:{action:()=>{console.info("Panel action clicked"),W6({app:a,data:b})},label:"Insert",icon:qs},children:h(Y6,{canvasRef:i,error:x,loaded:y.loaded})})]})]})]})})}),BT=.01,Vn=(e,t)=>!(t==="height"&&j(e)||t==="width"&&j(e)||t==="angle"&&de(e)),$t=(e,t)=>{let a=e+t/2;return a-a%t},ud=(e,t,a)=>Object.keys(e).map(n=>({original:(a??t).get(n),latest:t.get(n)})).filter(n=>n.original!==void 0&&n.latest!==void 0),rs=(e,t,a,n,i,l,r,o=!0)=>{let d=n.get(a.id);if(!d)return;let[u,s]=[a.x+a.width/2,a.y+a.height/2],[c,U]=O(w(a.x,a.y),w(u,s),a.angle),f=e-c,p=t-U,[m,g]=O(w(e,t),w(u+f,s+p),-a.angle);F(d,{x:m,y:g},o),M1(d,n,i,l);let y=pe(a,r);if(y){let v=n.get(y.id);v&&F(v,{x:y.x+f,y:y.y+p},o)}},S1=(e,t)=>{let a=Vi(t).map(n=>je(e,n).reduce((i,l)=>(i[l.id]=!0,i),{}));return e.filter(n=>!Dl(n)).forEach(n=>{a.push({[n.id]:!0})}),a},M1=(e,t,a,n,i)=>{he(e)?co([e],t,a,n,!0,[],i?.zoom):na(e,t,i)},zT=({label:e,icon:t,dragInputCallback:a,value:n,elements:i,editable:l=!0,shouldKeepAspectRatio:r,property:o,scene:d,appState:u,sensitivity:s=1})=>{let c=Ka(),U=re(null),f=re(null),[p,m]=se(n.toString()),g=re(null);g.current||(g.current={originalAppState:Ln(u),originalElements:i,lastUpdatedValue:p,updatePending:!1}),ae(()=>{let b=n.toString();m(b),g.current.lastUpdatedValue=b},[n]);let y=(b,x,S)=>{if(!g.current.updatePending)return!1;g.current.updatePending=!1;let C=Number(b);if(isNaN(C)){m(n.toString());return}let T=Number(C.toFixed(2)),k=Number(n);(isNaN(k)||Math.abs(T-k)>=BT)&&(g.current.lastUpdatedValue=b,a({accumulatedChange:0,instantChange:0,originalElements:x,originalElementsMap:c.scene.getNonDeletedElementsMap(),shouldKeepAspectRatio:r,shouldChangeByStepSize:!1,scene:d,nextValue:T,property:o,originalAppState:S,setInputValue:R=>m(String(R))}),c.syncActionResult({captureUpdate:B.IMMEDIATELY}))},v=re({});return v.current.handleInputValue=y,ae(()=>{let b=U.current,x=v.current;return()=>{let S=b?.value;S&&x.handleInputValue?.(S,g.current.originalElements,g.current.originalAppState),window.removeEventListener("pointermove",x.onPointerMove,!1),window.removeEventListener("pointerup",x.onPointerUp,!1)}},[l]),l?M("div",{className:Q("drag-input-container",!l&&"disabled"),"data-testid":e,children:[h("div",{className:"drag-input-label",ref:f,onPointerDown:b=>{if(U.current&&l){document.body.classList.add("excalidraw-cursor-resize"),Number(U.current.value);let x=null,S=c.scene.getNonDeletedElements().reduce((P,$)=>(P.set($.id,Zi($)),P),new Map),C=i.map(P=>S.get(P.id)),T=Ln(u),k=0,R=0,D=P=>{if(x&&S!==null&&C!==null){let $=P.clientX-x.x;$!==0&&(R+=$,Math.abs(R)>=s&&(R=Math.sign(R)*Math.floor(Math.abs(R)/s),k+=R,a({accumulatedChange:k,instantChange:R,originalElements:C,originalElementsMap:S,shouldKeepAspectRatio:r,shouldChangeByStepSize:P.shiftKey,property:o,scene:d,originalAppState:T,setInputValue:X=>m(String(X))}),R=0))}x={x:P.clientX,y:P.clientY}},A=()=>{window.removeEventListener("pointermove",D,!1),c.syncActionResult({captureUpdate:B.IMMEDIATELY}),x=null,k=0,R=0,C=null,S=null,document.body.classList.remove("excalidraw-cursor-resize"),window.removeEventListener("pointerup",A,!1)};v.current.onPointerMove=D,v.current.onPointerUp=A,window.addEventListener("pointermove",D,!1),window.addEventListener("pointerup",A,!1)}},onPointerEnter:()=>{f.current&&(f.current.style.cursor="ew-resize")},children:t?h(Zo,{icon:t}):e}),h("input",{className:"drag-input",autoComplete:"off",spellCheck:"false",onKeyDown:b=>{if(l){let x=b.target;x instanceof HTMLInputElement&&b.key===L.ENTER&&(y(x.value,i,u),c.focusContainer())}},ref:U,value:p,onChange:b=>{g.current.updatePending=!0,m(b.target.value)},onFocus:b=>{b.target.select(),g.current.originalElements=i,g.current.originalAppState=Ln(u)},onBlur:b=>{p?l&&y(b.target.value,g.current.originalElements,g.current.originalAppState):m(n.toString())},disabled:!l})]}):null},Yn=zT,Q6=10,FT=e=>e.type==="image",$T=({accumulatedChange:e,originalElements:t,originalElementsMap:a,shouldKeepAspectRatio:n,shouldChangeByStepSize:i,nextValue:l,property:r,originalAppState:o,instantChange:d,scene:u})=>{let s=u.getNonDeletedElementsMap(),c=t[0],U=s.get(c.id);if(c&&U){let f=n||FT(c),p=c.width/c.height;if(o.croppingElementId===c.id){let b=s.get(c.id);if(!b||!Le(b)||!b.crop)return;let x=b.crop,S={...x},C=b.scale[0]===-1,T=b.scale[1]===-1,{width:k,height:R}=Pn(b),D=x.naturalWidth/k,A=x.naturalHeight/R,P=C?x.width+x.x:x.naturalWidth-x.x,$=T?x.height+x.y:x.naturalHeight-x.y,X=kt*D,_=kt*A;if(l!==void 0){if(r==="width"){let ce=l*D,xe=we(ce,X,P);S={...S,width:xe,x:C?x.x+x.width-xe:x.x}}else if(r==="height"){let ce=l*A,xe=we(ce,_,$);S={...S,height:xe,y:T?x.y+x.height-xe:x.y}}F(b,{crop:S,width:S.width/(x.naturalWidth/k),height:S.height/(x.naturalHeight/R)});return}let H=r==="width"?d:0,W=r==="height"?d:0,K=we(x.width+H,X,P),G=we(x.height+W,X,$);S={...x,x:C?x.x+x.width-K:x.x,y:T?x.y+x.height-G:x.y,width:K,height:G},F(b,{crop:S,width:S.width/(x.naturalWidth/k),height:S.height/(x.naturalHeight/R)});return}if(l!==void 0){let b=Math.max(r==="width"?l:f?l*p:c.width,pa),x=Math.max(r==="height"?l:f?l/p:c.height,pa);Wr(b,x,U,c,s,a,r==="width"?"e":"s",{shouldMaintainAspectRatio:f});return}let m=r==="width"?e:0,g=r==="height"?e:0,y=Math.max(0,c.width+m);r==="width"&&(i?y=$t(y,Q6):y=Math.round(y));let v=Math.max(0,c.height+g);r==="height"&&(i?v=$t(v,Q6):v=Math.round(v)),f&&(r==="width"?v=Math.round(y/p*100)/100:y=Math.round(v*p*100)/100),v=Math.max(pa,v),y=Math.max(pa,y),Wr(y,v,U,c,s,a,r==="width"?"e":"s",{shouldMaintainAspectRatio:f})}},HT=({property:e,element:t,scene:a,appState:n})=>{let i=nn(e==="width"?t.width:t.height,2);if(n.croppingElementId&&n.croppingElementId===t.id&&Le(t)&&t.crop){let{width:l,height:r}=Pn(t);if(e==="width"){let o=l/t.crop.naturalWidth;i=nn(t.crop.width*o,2)}if(e==="height"){let o=r/t.crop.naturalHeight;i=nn(t.crop.height*o,2)}}return h(Yn,{label:e==="width"?"W":"H",elements:[t],dragInputCallback:$T,value:i,editable:Vn(t,e),scene:a,appState:n,property:e})},e5=HT,XT=15,WT=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:a,nextValue:n,scene:i})=>{let l=i.getNonDeletedElementsMap(),r=i.getNonDeletedElements(),o=t[0];if(o&&!q(o)){let d=l.get(o.id);if(!d)return;if(n!==void 0){let p=Ii(n);F(d,{angle:p}),M1(d,l,r,i);let m=pe(d,l);m&&!ge(d)&&F(m,{angle:p});return}let u=Math.round(rr(o.angle)*100)/100,s=Math.round(e),c=(u+s)%360;a&&(c=$t(c,XT)),c=c<0?c+360:c;let U=Ii(c);F(d,{angle:U}),M1(d,l,r,i);let f=pe(d,l);f&&!ge(d)&&F(f,{angle:U})}},GT=({element:e,scene:t,appState:a,property:n})=>h(Yn,{label:"A",icon:AU,value:Math.round(rr(e.angle)%360*100)/100,elements:[e],dragInputCallback:WT,editable:Vn(e,"angle"),scene:t,appState:a,property:n}),VT=GT,t5=4,YT=4,jT=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:a,nextValue:n,scene:i})=>{let l=i.getNonDeletedElementsMap(),r=t[0];if(r){let o=l.get(r.id);if(!o||!j(o))return;let d;if(n!==void 0)d=Math.max(Math.round(n),t5);else if(r.type==="text"){let u=Math.round(r.fontSize),s=Math.round(e);d=Math.max(u+s,t5),a&&(d=$t(d,YT))}d&&(F(o,{fontSize:d}),Wt(o,i.getContainerElement(o),i.getNonDeletedElementsMap()))}},ZT=({element:e,scene:t,appState:a,property:n})=>{let i=j(e)?e:wa(e)?pe(e,t.getNonDeletedElementsMap()):null;return i?h(Yn,{label:"F",value:Math.round(i.fontSize*10)/10,elements:[i],dragInputCallback:jT,icon:Zs,appState:a,scene:t,property:n}):null},KT=ZT,jl=10,qT=(e,t,a,n)=>{let i=n.x-e,l=n.y-t,r=n.width*a,o=n.height*a,d=e+i*a,u=t+l*a;return{width:r,height:o,x:d,y:u,...Th(n,r,o,!1),...j(n)?{fontSize:n.fontSize*a}:{}}},JT=(e,t,a,n,i,l,r,o)=>{let d=qT(e,t,n,l);F(i,d,!1);let u=pe(l,o);if(u){let s=u.fontSize*n;na(i,r,{newSize:{width:d.width,height:d.height}});let c=r.get(u.id);c&&j(c)&&(F(c,{fontSize:s},!1),Ir(i,r,a==="width"?"e":"s",!0))}},a5=(e,t,a,n,i,l,r,o,d,u)=>{l==="width"?t=Math.round(e/n*100)/100:e=Math.round(t*n*100)/100;let s=t/a;for(let c=0;c<o.length;c++){let U=o[c],f=r[c];JT(i[0],i[1],l,s,f,U,d,u)}},QT=({accumulatedChange:e,originalElements:t,originalElementsMap:a,originalAppState:n,shouldChangeByStepSize:i,nextValue:l,scene:r,property:o})=>{let d=r.getNonDeletedElementsMap(),u=S1(t,n);if(l!==void 0){for(let U of u){let f=ud(U,d,a);if(f.length>1){let p=f.map(R=>R.latest),m=f.map(R=>R.original),[g,y,v,b]=De(m),x=v-g,S=b-y,C=x/S,T=Math.max(pa,o==="width"?Math.max(0,l):x),k=Math.max(pa,o==="height"?Math.max(0,l):S);a5(T,k,S,C,w(g,y),o,p,m,d,a)}else{let[p]=f,m=p?.latest,g=p?.original;if(m&&g&&Vn(m,o)){let y=o==="width"?Math.max(0,l):m.width;o==="width"&&(i?y=$t(y,jl):y=Math.round(y));let v=o==="height"?Math.max(0,l):m.height;o==="height"&&(i?v=$t(v,jl):v=Math.round(v)),y=Math.max(pa,y),v=Math.max(pa,v),Wr(y,v,m,g,d,a,o==="width"?"e":"s",{shouldInformMutation:!1})}}}r.triggerUpdate();return}let s=o==="width"?e:0,c=o==="height"?e:0;for(let U of u){let f=ud(U,d,a);if(f.length>1){let p=f.map(R=>R.latest),m=f.map(R=>R.original),[g,y,v,b]=De(m),x=v-g,S=b-y,C=x/S,T=Math.max(0,x+s);o==="width"&&(i?T=$t(T,jl):T=Math.round(T));let k=Math.max(0,S+c);o==="height"&&(i?k=$t(k,jl):k=Math.round(k)),T=Math.max(pa,T),k=Math.max(pa,k),a5(T,k,S,C,w(g,y),o,p,m,d,a)}else{let[p]=f,m=p?.latest,g=p?.original;if(m&&g&&Vn(m,o)){let y=Math.max(0,g.width+s);o==="width"&&(i?y=$t(y,jl):y=Math.round(y));let v=Math.max(0,g.height+c);o==="height"&&(i?v=$t(v,jl):v=Math.round(v)),y=Math.max(pa,y),v=Math.max(pa,v),Wr(y,v,m,g,d,a,o==="width"?"e":"s",{shouldInformMutation:!1})}}}r.triggerUpdate()},eL=({property:e,elements:t,elementsMap:a,atomicUnits:n,scene:i,appState:l})=>{let r=mt(()=>n.map(u=>{let s=ud(u,a);if(s.length>1){let[U,f,p,m]=De(s.map(g=>g.latest));return Math.round((e==="width"?p-U:m-f)*100)/100}let[c]=s;return Math.round((e==="width"?c.latest.width:c.latest.height)*100)/100}),[a,n,e]),o=new Set(r).size===1?Math.round(r[0]*100)/100:"Mixed",d=r.length>0;return h(Yn,{label:e==="width"?"W":"H",elements:t,dragInputCallback:QT,value:o,editable:d,appState:l,property:e,scene:i})},n5=eL,tL=15,aL=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:a,nextValue:n,property:i,scene:l})=>{let r=l.getNonDeletedElementsMap(),o=t.map(u=>r.get(u.id)).filter(u=>u&&!Dl(u)&&Vn(u,i)),d=t.filter(u=>!Dl(u)&&Vn(u,i));if(n!==void 0){let u=Ii(n);for(let s of o){if(!s)continue;F(s,{angle:u},!1);let c=pe(s,r);c&&!ge(s)&&F(c,{angle:u},!1)}l.triggerUpdate();return}for(let u=0;u<o.length;u++){let s=o[u];if(!s)continue;let c=d[u],U=Math.round(rr(c.angle)*100)/100,f=Math.round(e),p=(U+f)%360;a&&(p=$t(p,tL)),p=p<0?p+360:p;let m=Ii(p);F(s,{angle:m},!1);let g=pe(s,r);g&&!ge(s)&&F(g,{angle:m},!1)}l.triggerUpdate()},nL=({elements:e,scene:t,appState:a,property:n})=>{let i=e.filter(d=>!Dl(d)&&Vn(d,"angle")),l=i.map(d=>Math.round(rr(d.angle)%360*100)/100),r=new Set(l).size===1?l[0]:"Mixed",o=i.some(d=>Vn(d,"angle"));return h(Yn,{label:"A",icon:AU,value:r,elements:e,dragInputCallback:aL,editable:o,appState:a,scene:t,property:n})},iL=nL,i5=4,lL=4,rL=(e,t)=>e.reduce((a,n)=>{if(!n||Dl(n))return a;if(j(n))return a.push(n),a;if(wa(n)){let i=pe(n,t);if(i)return a.push(i),a}return a},[]),sL=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:a,nextValue:n,scene:i})=>{let l=i.getNonDeletedElementsMap(),r=t.map(d=>l.get(d.id)),o;if(n){o=Math.max(Math.round(n),i5);for(let d of r)F(d,{fontSize:o},!1),Wt(d,i.getContainerElement(d),l,!1);i.triggerUpdate()}else{let d=t;for(let u=0;u<r.length;u++){let s=r[u],c=d[u],U=Math.round(c.fontSize),f=Math.round(e),p=Math.max(U+f,i5);a&&(p=$t(p,lL)),F(s,{fontSize:p},!1),Wt(s,i.getContainerElement(s),l,!1)}i.triggerUpdate()}},oL=({elements:e,scene:t,appState:a,property:n,elementsMap:i})=>{let l=rL(e,i);if(!l.length)return null;let r=l.map(u=>Math.round(u.fontSize*10)/10),o=new Set(r).size===1?r[0]:"Mixed",d=r.length>0;return h(Yn,{label:"F",icon:Zs,elements:l,dragInputCallback:sL,value:o,editable:d,scene:t,property:n,appState:a})},dL=oL,l5=10,cL=({accumulatedChange:e,instantChange:t,originalElements:a,originalElementsMap:n,shouldChangeByStepSize:i,nextValue:l,property:r,scene:o,originalAppState:d})=>{let u=o.getNonDeletedElementsMap(),s=o.getNonDeletedElements(),c=a[0],[U,f]=[c.x+c.width/2,c.y+c.height/2],[p,m]=O(w(c.x,c.y),w(U,f),c.angle);if(d.croppingElementId===c.id){let x=u.get(c.id);if(!x||!Le(x)||!x.crop)return;let S=x.crop,C=S,T=x.scale[0]===-1,k=x.scale[1]===-1,{width:R,height:D}=Pn(x);if(l!==void 0){if(r==="x"){let $=l*(S.naturalWidth/R);T?C={...S,x:we(S.naturalWidth-$-S.width,0,S.naturalWidth-S.width)}:C={...S,x:we(l*(S.naturalWidth/R),0,S.naturalWidth-S.width)}}r==="y"&&(C={...S,y:we(l*(S.naturalHeight/D),0,S.naturalHeight-S.height)}),F(x,{crop:C});return}let A=(r==="x"?t:0)*(T?-1:1),P=(r==="y"?t:0)*(k?-1:1);C={...S,x:we(S.x+A,0,S.naturalWidth-S.width),y:we(S.y+P,0,S.naturalHeight-S.height)},F(x,{crop:C});return}if(l!==void 0){rs(r==="x"?l:p,r==="y"?l:m,c,u,s,o,n);return}let g=r==="x"?e:0,y=r==="y"?e:0,v=r==="x"?Math.round(i?$t(c.x+g,l5):p+g):p,b=r==="y"?Math.round(i?$t(c.y+y,l5):m+y):m;rs(v,b,c,u,s,o,n)},hL=({property:e,element:t,elementsMap:a,scene:n,appState:i})=>{let[l,r]=O(w(t.x,t.y),w(t.x+t.width/2,t.y+t.height/2),t.angle),o=nn(e==="x"?l:r,2);if(i.croppingElementId===t.id&&Le(t)&&t.crop){let d=Uw(t);d&&(o=nn(e==="x"?d.x:d.y,2))}return h(Yn,{label:e==="x"?"X":"Y",elements:[t],dragInputCallback:cL,scene:n,value:o,property:e,appState:i})},r5=hL,uL=10,UL=(e,t,a,n,i,l,r,o)=>{for(let d=0;d<n.length;d++){let u=i[d],[s,c]=[u.x+u.width/2,u.y+u.height/2],[U,f]=O(w(u.x,u.y),w(s,c),u.angle),p=e==="x"?Math.round(U+t):U,m=e==="y"?Math.round(f+a):f;rs(p,m,u,l,n,o,r,!1)}},fL=(e,t,a,n,i,l,r)=>{let[o,d,,]=De(a),u=e-o,s=t-d;for(let c=0;c<a.length;c++){let U=a[c],f=n.get(U.id);if(f&&(!j(f)||!f.containerId)){let[p,m]=[f.x+f.width/2,f.y+f.height/2],[g,y]=O(w(f.x,f.y),w(p,m),f.angle);rs(g+u,y+s,U,n,i,r,l,!1)}}},pL=({accumulatedChange:e,originalElements:t,originalElementsMap:a,shouldChangeByStepSize:n,nextValue:i,property:l,scene:r,originalAppState:o})=>{let d=r.getNonDeletedElementsMap(),u=r.getNonDeletedElements();if(i!==void 0){for(let c of S1(t,o)){let U=ud(c,d,a);if(U.length>1){let[f,p,,]=De(U.map(m=>m.latest));fL(l==="x"?i:f,l==="y"?i:p,U.map(m=>m.original),d,u,a,r)}else{let f=U[0]?.original,p=U[0]?.latest;if(f&&p&&Vn(p,l)){let[m,g]=[f.x+f.width/2,f.y+f.height/2],[y,v]=O(w(f.x,f.y),w(m,g),f.angle);rs(l==="x"?i:y,l==="y"?i:v,f,d,u,r,a,!1)}}}r.triggerUpdate();return}let s=n?$t(e,uL):e;UL(l,l==="x"?s:0,l==="y"?s:0,t,t,d,a,r),r.triggerUpdate()},mL=({property:e,elements:t,elementsMap:a,atomicUnits:n,scene:i,appState:l})=>{let r=mt(()=>n.map(d=>{let u=Object.keys(d).map(m=>a.get(m)).filter(m=>m!==void 0);if(u.length>1){let[m,g]=De(u);return Math.round((e==="x"?m:g)*100)/100}let[s]=u,[c,U]=[s.x+s.width/2,s.y+s.height/2],[f,p]=O(w(s.x,s.y),w(c,U),s.angle);return Math.round((e==="x"?f:p)*100)/100}),[n,a,e]),o=new Set(r).size===1?r[0]:"Mixed";return h(Yn,{label:e==="x"?"X":"Y",elements:t,dragInputCallback:pL,value:o,property:e,scene:i,appState:l})},s5=mL,o5=5,gL=({property:e,scene:t,appState:a,setAppState:n})=>h(Yn,{label:"Grid step",sensitivity:8,elements:[],dragInputCallback:({nextValue:i,instantChange:l,shouldChangeByStepSize:r,setInputValue:o})=>{n(d=>{let u;return i?u=i:l&&(u=r?$t(d.gridStep+o5*Math.sign(l),o5):d.gridStep+l),u?(u=Vf(u),o(u),{gridStep:u}):(o(d.gridStep),null)})},scene:t,value:a.gridStep,property:e,appState:a}),bL=gL,yL=50,Ud=e=>{let t=ds(),a=e.app.scene.getSceneNonce()||1,n=e.app.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}),i=Cr(e.app);return h(vL,{...e,appState:t,sceneNonce:a,selectedElements:n,gridModeEnabled:i})},Ze=({children:e,columns:t=1,heading:a,style:n,...i})=>h("div",{className:Q("exc-stats__row",{"exc-stats__row--heading":a}),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,...n},...i,children:e});Ze.displayName="StatsRow";var fd=({children:e,order:t,style:a,...n})=>h("div",{className:"exc-stats__rows",style:{order:t,...a},...n,children:e});fd.displayName="StatsRows",Ud.StatsRow=Ze,Ud.StatsRows=fd;var vL=il(({app:e,onClose:t,renderCustomStats:a,selectedElements:n,appState:i,sceneNonce:l,gridModeEnabled:r})=>{let o=e.scene,d=o.getNonDeletedElements(),u=o.getNonDeletedElementsMap(),s=wt(),c=n.length===1?n[0]:null,U=n.length>1?n:null,f=i.croppingElementId&&Le(c),p=f?Pn(c):null,[m,g]=se({width:0,height:0}),y=mt(()=>Kl(x=>{let S=De(x);g({width:Math.round(S[2])-Math.round(S[0]),height:Math.round(S[3])-Math.round(S[1])})},yL),[]);ae(()=>{y(d)},[l,d,y]),ae(()=>()=>y.cancel(),[y]);let v=mt(()=>S1(n,i),[n,i]),b=mt(()=>Lp(n),[n]);return h("div",{className:"exc-stats",children:M(Va,{padding:3,children:[M("div",{className:"title",children:[h("h2",{children:E("stats.title")}),h("div",{className:"close",onClick:t,children:xl})]}),M(Vh,{label:h("h3",{children:E("stats.generalStats")}),open:!!(i.stats.panels&pl.generalStats),openTrigger:()=>s(x=>({stats:{open:!0,panels:x.stats.panels^pl.generalStats}})),children:[M(fd,{children:[h(Ze,{heading:!0,children:E("stats.scene")}),M(Ze,{columns:2,children:[h("div",{children:E("stats.shapes")}),h("div",{children:d.length})]}),M(Ze,{columns:2,children:[h("div",{children:E("stats.width")}),h("div",{children:m.width})]}),M(Ze,{columns:2,children:[h("div",{children:E("stats.height")}),h("div",{children:m.height})]}),r&&M(te,{children:[h(Ze,{heading:!0,children:"Canvas"}),h(Ze,{children:h(bL,{property:"gridStep",scene:o,appState:i,setAppState:s})})]})]}),a?.(d,i)]}),!b&&n.length>0&&h("div",{id:"elementStats",style:{marginTop:12},children:h(Vh,{label:h("h3",{children:E("stats.elementProperties")}),open:!!(i.stats.panels&pl.elementProperties),openTrigger:()=>s(x=>({stats:{open:!0,panels:x.stats.panels^pl.elementProperties}})),children:M(fd,{children:[c&&M(te,{children:[f&&h(Ze,{heading:!0,children:E("labels.unCroppedDimension")}),i.croppingElementId&&Le(c)&&p&&M(Ze,{columns:2,children:[h("div",{children:E("stats.width")}),h("div",{children:nn(p.width,2)})]}),i.croppingElementId&&Le(c)&&p&&M(Ze,{columns:2,children:[h("div",{children:E("stats.height")}),h("div",{children:nn(p.height,2)})]}),h(Ze,{heading:!0,"data-testid":"stats-element-type",children:i.croppingElementId?E("labels.imageCropping"):E(`element.${c.type}`)}),h(Ze,{children:h(r5,{element:c,property:"x",elementsMap:u,scene:o,appState:i})}),h(Ze,{children:h(r5,{element:c,property:"y",elementsMap:u,scene:o,appState:i})}),h(Ze,{children:h(e5,{property:"width",element:c,scene:o,appState:i})}),h(Ze,{children:h(e5,{property:"height",element:c,scene:o,appState:i})}),!q(c)&&h(Ze,{children:h(VT,{property:"angle",element:c,scene:o,appState:i})}),h(Ze,{children:h(KT,{property:"fontSize",element:c,scene:o,appState:i})})]}),U&&M(te,{children:[qf(U)&&h(Ze,{heading:!0,children:E("element.group")}),M(Ze,{columns:2,style:{margin:"0.3125rem 0"},children:[h("div",{children:E("stats.shapes")}),h("div",{children:n.length})]}),h(Ze,{children:h(s5,{property:"x",elements:U,elementsMap:u,atomicUnits:v,scene:o,appState:i})}),h(Ze,{children:h(s5,{property:"y",elements:U,elementsMap:u,atomicUnits:v,scene:o,appState:i})}),h(Ze,{children:h(n5,{property:"width",elements:U,elementsMap:u,atomicUnits:v,scene:o,appState:i})}),h(Ze,{children:h(n5,{property:"height",elements:U,elementsMap:u,atomicUnits:v,scene:o,appState:i})}),h(Ze,{children:h(iL,{property:"angle",elements:U,scene:o,appState:i})}),h(Ze,{children:h(dL,{property:"fontSize",elements:U,scene:o,appState:i,elementsMap:u})})]})]})})})]})})},(e,t)=>e.sceneNonce===t.sceneNonce&&e.selectedElements===t.selectedElements&&e.appState.stats.panels===t.appState.stats.panels&&e.gridModeEnabled===t.gridModeEnabled&&e.appState.gridStep===t.appState.gridStep&&e.appState.croppingElementId===t.appState.croppingElementId),wL=({sourceElementId:e,onClose:t,elementsMap:a,appState:n,generateLinkForSelection:i=$0})=>{let l=a.get(e)?.link??null,[r,o]=se(l),[d,u]=se(!1);ae(()=>{let c=be(a,n),U=l;if(c.length>0&&i){let f=H0(c,n);f&&(U=la(i(f.id,f.type)))}o(U)},[a,n,n.selectedElementIds,l,i]);let s=at(()=>{if(r&&r!==a.get(e)?.link){let c=a.get(e);c&&F(c,{link:r})}if(!r&&d&&e){let c=a.get(e);c&&F(c,{link:null})}t?.()},[e,r,a,d,t]);return ae(()=>{let c=U=>{n.openDialog?.name==="elementLinkSelector"&&U.key===L.ENTER&&s(),n.openDialog?.name==="elementLinkSelector"&&U.key===L.ESCAPE&&t?.()};return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[n,t,s]),M("div",{className:"ElementLinkDialog",children:[M("div",{className:"ElementLinkDialog__header",children:[h("h2",{children:E("elementLink.title")}),h("p",{children:E("elementLink.desc")})]}),M("div",{className:"ElementLinkDialog__input",children:[h(c1,{value:r??"",onChange:c=>{d||u(!0),o(c)},onKeyDown:c=>{c.key===L.ENTER&&s()},className:"ElementLinkDialog__input-field",selectOnRender:!0}),l&&r&&h(Me,{type:"button",title:E("buttons.remove"),"aria-label":E("buttons.remove"),label:E("buttons.remove"),onClick:()=>{o(null),u(!0)},className:"ElementLinkDialog__remove",icon:Bi})]}),M("div",{className:"ElementLinkDialog__actions",children:[h(Wl,{label:E("buttons.cancel"),onClick:()=>{t?.()},style:{marginRight:10}}),h(Wl,{label:E("buttons.confirm"),onClick:s,actionType:"primary"})]})]})},EL=wL,xL=({UIOptions:e})=>M(jt,{__fallback:!0,children:[h(jt.DefaultItems.LoadScene,{}),h(jt.DefaultItems.SaveToActiveFile,{}),e.canvasActions.export&&h(jt.DefaultItems.Export,{}),e.canvasActions.saveAsImage&&h(jt.DefaultItems.SaveAsImage,{}),h(jt.DefaultItems.SearchMenu,{}),h(jt.DefaultItems.Help,{}),h(jt.DefaultItems.ClearCanvas,{}),h(jt.Separator,{}),h(jt.Group,{title:"Excalidraw links",children:h(jt.DefaultItems.Socials,{})}),h(jt.Separator,{}),h(jt.DefaultItems.ToggleTheme,{}),h(jt.DefaultItems.ChangeCanvasBackground,{})]}),SL=()=>M(b1,{__fallback:!0,children:[h(b1.Actions.SaveToDisk,{}),h(b1.Actions.ExportToImage,{})]}),ML=({actionManager:e,appState:t,files:a,setAppState:n,elements:i,canvas:l,onLockToggle:r,onHandToolToggle:o,onPenModeToggle:d,showExitZenModeBtn:u,renderTopRightUI:s,renderCustomStats:c,UIOptions:U,onExportImage:f,renderWelcomeScreen:p,children:m,app:g,isCollaborating:y,generateLinkForSelection:v})=>{let b=vt(),x=uI(),S=x.tunnelsJotai.Provider,[C,T]=st(jo),k=()=>U.canvasActions.export?h(oT,{elements:i,appState:t,files:a,actionManager:e,exportOpts:U.canvasActions.export,canvas:l,setAppState:n}):null,R=()=>!U.canvasActions.saveAsImage||t.openDialog?.name!=="imageExport"?null:h(OI,{elements:i,appState:t,files:a,actionManager:e,onExportImage:f,onCloseRequest:()=>n({openDialog:null}),name:g.getName()}),D=()=>M("div",{style:{position:"relative"},children:[h(x.MainMenuTunnel.Out,{}),p&&h(x.WelcomeScreenMenuHintTunnel.Out,{})]}),A=()=>h(is,{heading:"selectedShapeActions",className:Q("selected-shape-actions zen-mode-transition",{"transition-left":t.zenModeEnabled}),children:h(Va,{className:dl.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:`${t.height-166}px`},children:h(Fm,{appState:t,elementsMap:g.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:g})})}),P=()=>{let H=Dh(t,i),W=t.stats.open&&!t.zenModeEnabled&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector";return h(t6,{side:"top",children:M("div",{className:"App-menu App-menu_top",children:[M(Ca.Col,{gap:6,className:Q("App-menu_top__left"),children:[D(),H&&A()]}),!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector"&&h(is,{heading:"shapes",className:"shapes-section",children:K=>M("div",{style:{position:"relative"},children:[p&&h(x.WelcomeScreenToolbarHintTunnel.Out,{}),h(Ca.Col,{gap:4,align:"start",children:M(Ca.Row,{gap:1,className:Q("App-toolbar-container",{"zen-mode":t.zenModeEnabled}),children:[M(Va,{padding:1,className:Q("App-toolbar",{"zen-mode":t.zenModeEnabled}),children:[h(l6,{appState:t,isMobile:b.editor.isMobile,device:b,app:g}),K,M(Ca.Row,{gap:1,children:[h(d6,{zenModeEnabled:t.zenModeEnabled,checked:t.penMode,onChange:()=>d(null),title:E("toolBar.penMode"),penDetected:t.penDetected}),h(s6,{checked:t.activeTool.locked,onChange:r,title:E("toolBar.lock")}),h("div",{className:"App-toolbar__divider"}),h(c6,{checked:ml(t),onChange:()=>o(),title:E("toolBar.hand"),isMobile:!0}),h($m,{appState:t,activeTool:t.activeTool,UIOptions:U,app:g})]})]}),y&&h(Va,{style:{marginLeft:8,alignSelf:"center",height:"fit-content"},children:h(IT,{title:E("toolBar.laser"),checked:t.activeTool.type===Et.laser,onChange:()=>g.setActiveTool({type:Et.laser}),isMobile:!0})})]})})]})}),M("div",{className:Q("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":t.zenModeEnabled}),children:[t.collaborators.size>0&&h(u6,{collaborators:t.collaborators,userToFollow:t.userToFollow?.socketId||null}),s?.(b.editor.isMobile,t),!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector"&&(!X||t.openSidebar?.name!==Aa.name)&&h(x.DefaultSidebarTriggerTunnel.Out,{}),W&&h(Ud,{app:g,onClose:()=>{e.executeAction(t1)},renderCustomStats:c})]})]})})},$=()=>h(y1,{__fallback:!0,onDock:H=>{Ge("sidebar",`toggleDock (${H?"dock":"undock"})`,`(${b.editor.isMobile?"mobile":"desktop"})`)}}),X=u2(m1),_=M(te,{children:[m,h(xL,{UIOptions:U}),h(y1.Trigger,{__fallback:!0,icon:ec,title:hr(E("toolBar.library")),onToggle:H=>{H&&Ge("sidebar",`${Aa.name} (open)`,`button (${b.editor.isMobile?"mobile":"desktop"})`)},tab:Aa.defaultTab,children:E("toolBar.library")}),h(SL,{}),t.openDialog?.name==="ttd"&&h(J6,{__fallback:!0}),t.isLoading&&h(m2,{delay:250}),t.errorMessage&&h(DI,{onClose:()=>n({errorMessage:null}),children:t.errorMessage}),C&&!b.editor.isMobile&&h(rC,{colorPickerType:C.colorPickerType,onCancel:()=>{T(null)},onChange:(H,W,K,{altKey:G})=>{if(!(H!=="elementBackground"&&H!=="elementStroke"))if(K.length){for(let ce of K)F(ce,{[G&&C.swapPreviewOnAlt?H==="elementBackground"?"strokeColor":"backgroundColor":H==="elementBackground"?"backgroundColor":"strokeColor"]:W},!1),Qe.delete(ce);Hn.getScene(K[0])?.triggerUpdate()}else n(H==="elementBackground"?{currentItemBackgroundColor:W}:{currentItemStrokeColor:W})},onSelect:(H,W)=>{T(K=>K?.keepOpenOnAlt&&W.altKey?K:null),C?.onSelect?.(H,W)}}),t.openDialog?.name==="help"&&h(aT,{onClose:()=>{n({openDialog:null})}}),h(gI,{}),t.openDialog?.name==="elementLinkSelector"&&h(EL,{sourceElementId:t.openDialog.sourceElementId,onClose:()=>{n({openDialog:null})},elementsMap:g.scene.getNonDeletedElementsMap(),appState:t,generateLinkForSelection:v}),h(x.OverwriteConfirmDialogTunnel.Out,{}),R(),k(),t.pasteDialog.shown&&h(KI,{setAppState:n,appState:t,onClose:()=>n({pasteDialog:{shown:!1,data:null}})}),b.editor.isMobile&&h(ZI,{app:g,appState:t,elements:i,actionManager:e,renderJSONExportDialog:k,renderImageExportDialog:R,setAppState:n,onLockToggle:r,onHandToolToggle:o,onPenModeToggle:d,renderTopRightUI:s,renderCustomStats:c,renderSidebars:$,device:b,renderWelcomeScreen:p,UIOptions:U}),!b.editor.isMobile&&M(te,{children:[M("div",{className:"layer-ui__wrapper",style:t.openSidebar&&X&&b.editor.canFitSidebar?{width:"calc(100% - var(--right-sidebar-width))"}:{},children:[p&&h(x.WelcomeScreenCenterTunnel.Out,{}),P(),h(cT,{appState:t,actionManager:e,showExitZenModeBtn:u,renderWelcomeScreen:p}),t.scrolledOutside&&h("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{n(H=>({...Sr(i,H)}))},children:E("buttons.scrollBackToContent")})]}),$()]})]});return h(T2.Provider,{value:t,children:h(S,{children:h(Om.Provider,{value:x,children:_})})})},d5=e=>{let{suggestedBindings:t,startBoundElement:a,cursorButton:n,scrollX:i,scrollY:l,...r}=e;return r},CL=(e,t)=>{if(e.children!==t.children)return!1;let{canvas:a,appState:n,...i}=e,{canvas:l,appState:r,...o}=t;return At(d5(n),d5(r),{selectedElementIds:At,selectedGroupIds:At})&&At(i,o)},kL=ee.memo(ML,CL),IL=5e3,TL=({message:e,onClose:t,closable:a=!1,duration:n=IL,style:i})=>{let l=re(0),r=n!==1/0,o=at(()=>{r&&(l.current=window.setTimeout(()=>t(),n))},[t,n,r]);return ae(()=>{if(r)return o(),()=>clearTimeout(l.current)},[o,e,n,r]),M("div",{className:"Toast",onMouseEnter:r?()=>clearTimeout(l?.current):void 0,onMouseLeave:r?o:void 0,style:i,children:[h("p",{className:"Toast__message",children:e}),a&&h(Me,{icon:xl,"aria-label":"close",type:"icon",onClick:t,className:"close"})]})},c5=V({name:"viewMode",label:"labels.viewMode",paletteName:"Toggle view mode",icon:hc,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:B.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,a)=>typeof a.viewModeEnabled>"u",keyTest:e=>!e[L.CTRL_OR_CMD]&&e.altKey&&e.code===ke.R}),h5=(e,t)=>{let a=t.scene.getSelectedElements(e);return a.length===1&&de(a[0])},LL=V({name:"selectAllElementsInFrame",label:"labels.selectAllElementsInFrame",trackEvent:{category:"canvas"},perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t).at(0)||null;if(de(i)){let l=mn(ze(e),i.id).filter(r=>!(r.type==="text"&&r.containerId));return{elements:e,appState:{...t,selectedElementIds:l.reduce((r,o)=>(r[o.id]=!0,r),{})},captureUpdate:B.IMMEDIATELY}}return{elements:e,appState:t,captureUpdate:B.EVENTUALLY}},predicate:(e,t,a,n)=>h5(t,n)}),DL=V({name:"removeAllElementsFromFrame",label:"labels.removeAllElementsFromFrame",trackEvent:{category:"history"},perform:(e,t,a,n)=>{let i=n.scene.getSelectedElements(t).at(0)||null;return de(i)?{elements:Cp(e,i),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:B.IMMEDIATELY}:{elements:e,appState:t,captureUpdate:B.EVENTUALLY}},predicate:(e,t,a,n)=>h5(t,n)});V({name:"updateFrameRendering",label:"labels.updateFrameRendering",viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t)=>({elements:e,appState:{...t,frameRendering:{...t.frameRendering,enabled:!t.frameRendering.enabled}},captureUpdate:B.EVENTUALLY}),checked:e=>e.frameRendering.enabled}),V({name:"setFrameAsActiveTool",label:"toolBar.frame",trackEvent:{category:"toolbar"},icon:PU,viewMode:!1,perform:(e,t,a,n)=>{let i=ft(t,{type:"frame"});return dn(n.interactiveCanvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:ft(t,{type:"frame"})},captureUpdate:B.EVENTUALLY}},keyTest:e=>!e[L.CTRL_OR_CMD]&&!e.shiftKey&&!e.altKey&&e.key.toLocaleLowerCase()===L.F});var AL=V({name:"wrapSelectionInFrame",label:"labels.wrapSelectionInFrame",trackEvent:{category:"element"},predicate:(e,t,a,n)=>{let i=be(e,t);return i.length>0&&!i.some(l=>de(l))},perform:(e,t,a,n)=>{let i=be(e,t),[l,r,o,d]=De(i,n.scene.getNonDeletedElementsMap()),u=16,s=Fc({x:l-u,y:r-u,width:o-l+u*2,height:d-r+u*2});if(t.editingGroupId){let c=je(i,t.editingGroupId);for(let U of c){let f=U.groupIds.indexOf(t.editingGroupId);F(U,{groupIds:U.groupIds.slice(0,f)},!1)}}return{elements:$r([...n.scene.getElementsIncludingDeleted(),s],i,s,t),appState:{selectedElementIds:{[s.id]:!0}},captureUpdate:B.IMMEDIATELY}}}),RL=()=>M("div",{"data-testid":"brave-measure-text-error",children:[h("p",{children:h(bn,{i18nKey:"errors.brave_measure_text_error.line1",bold:e=>h("span",{style:{fontWeight:600},children:e})})}),h("p",{children:h(bn,{i18nKey:"errors.brave_measure_text_error.line2",bold:e=>h("span",{style:{fontWeight:600},children:e})})}),h("p",{children:h(bn,{i18nKey:"errors.brave_measure_text_error.line3",link:e=>h("a",{href:"http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser",children:e})})}),h("p",{children:h(bn,{i18nKey:"errors.brave_measure_text_error.line4",issueLink:e=>h("a",{href:"https://github.com/excalidraw/excalidraw/issues/new",children:e}),discordLink:e=>M("a",{href:"https://discord.gg/UexuTaE",children:[e,"."]})})})]}),NL=RL,pd={width:100,height:0},wi=100,PL=(e,t,a)=>{let n=ua({x:0,y:0,textAlign:nr.CENTER,verticalAlign:ca.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:n.id})}),Wt(n,e,a),[e,n]},u5=(e,t,a,n,i)=>{let l,r;if(Object.assign(e,{startBinding:e?.startBinding||null,endBinding:e.endBinding||null}),t){let s=t?.width??wi,c=t?.height??wi,U;t.id&&(U=n.getElement(t.id),U||console.error(`No element for start binding with id ${t.id} found`));let f=t.x||e.x-s,p=t.y||e.y-c/2,m=U?U.type:t.type;if(m){if(m==="text"){let g="";U&&U.type==="text"?g=U.text:t.type==="text"&&(g=t.text),g||console.error(`No text found for start binding text element for ${e.id}`),l=ua({x:f,y:p,type:"text",...U,...t,text:g}),Object.assign(l,{x:t.x||e.x-l.width,y:t.y||e.y-l.height/2})}else switch(m){case"rectangle":case"ellipse":case"diamond":{l=hn({x:f,y:p,width:s,height:c,...U,...t,type:m});break}default:Ri(e,`Unhandled element start type "${t.type}"`,!0)}sn(e,l,"start",i)}}if(a){let s=a?.height??wi,c=a?.width??wi,U;a.id&&(U=n.getElement(a.id),U||console.error(`No element for end binding with id ${a.id} found`));let f=a.x||e.x+e.width,p=a.y||e.y-s/2,m=U?U.type:a.type;if(m){if(m==="text"){let g="";U&&U.type==="text"?g=U.text:a.type==="text"&&(g=a.text),g||console.error(`No text found for end binding text element for ${e.id}`),r=ua({x:f,y:p,type:"text",...U,...a,text:g}),Object.assign(r,{y:a.y||e.y-r.height/2})}else switch(m){case"rectangle":case"ellipse":case"diamond":{r=hn({x:f,y:p,width:c,height:s,...U,...a,type:m});break}default:Ri(e,`Unhandled element end type "${m}"`,!0)}sn(e,r,"end",i)}}if(e.points.length<2)return{linearElement:e,startBoundElement:l,endBoundElement:r};let o=e.points.length-1,d=.5,u=Ln(e.points);return e.points[o][0]>e.points[o-1][0]&&(u[0][0]=d,u[o][0]-=d),e.points[o][0]<e.points[o-1][0]&&(u[0][0]=-d,u[o][0]+=d),e.points[o][1]>e.points[o-1][1]&&(u[0][1]=d,u[o][1]-=d),e.points[o][1]<e.points[o-1][1]&&(u[0][1]=-d,u[o][1]+=d),Object.assign(e,{points:u}),{linearElement:e,startBoundElement:l,endBoundElement:r}},_L=class{constructor(){I(this,"excalidrawElements",new Map),I(this,"add",e=>{e&&this.excalidrawElements.set(e.id,e)}),I(this,"getElements",()=>Un(Array.from(this.excalidrawElements.values()))),I(this,"getElementsMap",()=>ga(oe(this.getElements()))),I(this,"getElement",e=>this.excalidrawElements.get(e))}},md=(e,t)=>{if(!e)return[];let a=Ln(e),n=new _L,i=new Map,l=new Map;for(let o of a){let d,u=o.id;switch(t?.regenerateIds!==!1&&Object.assign(o,{id:xa()}),o.type){case"rectangle":case"ellipse":case"diamond":{let s=o?.label?.text&&o.width===void 0?0:o?.width||wi,c=o?.label?.text&&o.height===void 0?0:o?.height||wi;d=hn({...o,width:s,height:c});break}case"line":{let s=o.width||pd.width,c=o.height||pd.height;d=ji({width:s,height:c,points:[w(0,0),w(s,c)],...o});break}case"arrow":{let s=o.width||pd.width,c=o.height||pd.height;d=Hc({width:s,height:c,endArrowhead:"arrow",points:[w(0,0),w(s,c)],...o,type:"arrow"}),Object.assign(d,kl(d.points));break}case"text":{let s=o?.fontFamily||ii,c=o?.fontSize||Mn,U=o?.lineHeight||Hi(s),f=o.text??"",p=El(f),m=zt(p,Oe({fontFamily:s,fontSize:c}),U);d=ua({width:m.width,height:m.height,fontFamily:s,fontSize:c,...o});break}case"image":{d=f0({width:o?.width||wi,height:o?.height||wi,...o});break}case"frame":{d=Fc({x:0,y:0,...o});break}case"magicframe":{d=$c({x:0,y:0,...o});break}case"freedraw":case"iframe":case"embeddable":{d=o;break}default:d=o,Ri(o,`Unhandled element type "${o.type}"`,!0)}n.getElement(d.id)?console.error(`Duplicate id found for ${d.id}`):(n.add(d),i.set(d.id,o),u&&l.set(u,d.id))}let r=n.getElementsMap();for(let[o,d]of i){let u=n.getElement(o);switch(d.type){case"rectangle":case"ellipse":case"diamond":case"arrow":{if(d.label?.text){let[s,c]=PL(u,d?.label,r);if(n.add(s),n.add(c),ge(s)){let U=d.type==="arrow"?d?.start:void 0,f=d.type==="arrow"?d?.end:void 0;if(U&&U.id){let y=l.get(U.id);y&&Object.assign(U,{id:y})}if(f&&f.id){let y=l.get(f.id);y&&Object.assign(f,{id:y})}let{linearElement:p,startBoundElement:m,endBoundElement:g}=u5(s,U,f,n,r);s=p,n.add(p),n.add(m),n.add(g)}}else switch(d.type){case"arrow":{let{start:s,end:c}=d;if(s&&s.id){let m=l.get(s.id);Object.assign(s,{id:m})}if(c&&c.id){let m=l.get(c.id);Object.assign(c,{id:m})}let{linearElement:U,startBoundElement:f,endBoundElement:p}=u5(u,s,c,n,r);n.add(U),n.add(f),n.add(p);break}}break}}}for(let[o,d]of i){if(d.type!=="frame"&&d.type!=="magicframe")continue;let u=n.getElement(o);if(!u)throw new Error(`Excalidraw element with id ${o} doesn't exist`);let s=[];d.children.forEach(x=>{let S=l.get(x);if(!S)throw new Error(`Element with ${x} wasn't mapped correctly`);let C=n.getElement(S);if(!C)throw new Error(`Frame element with id ${S} doesn't exist`);Object.assign(C,{frameId:u.id}),C?.boundElements?.forEach(T=>{let k=n.getElement(T.id);if(!k)throw new Error(`Bound element with id ${T.id} doesn't exist`);Object.assign(k,{frameId:u.id}),s.push(k)}),s.push(C)});let[c,U,f,p]=De(s),m=10;c=c-m,U=U-m,f=f+m,p=p+m;let g=u?.x||c,y=u?.y||U,v=u?.width||f-c,b=u?.height||p-U;Object.assign(u,{x:g,y,width:v,height:b}),Vu()&&d.children.length&&(u?.x||u?.y||u?.width||u?.height)&&console.info("User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically")}return n.getElements()},ot=e=>t=>{Md(e,t)},C1=e=>Os(t=>{Md(e,t)}),k1=(()=>{let e;try{let a=Y5.split(".");e=Number(a[0])>17}catch{e=!1}let t=!1;return()=>window.EXCALIDRAW_THROTTLE_RENDER===!0?e?!0:(t||(t=!0,console.warn("Excalidraw: render throttling is disabled on React versions < 18.")),!1):!1})(),OL="#ff6b6b",BL="#ff0000",U5=1,f5=2,zL=(e,t)=>{if(!t.snapLines.length)return;let a=t.theme===Se.LIGHT||t.zenModeEnabled?OL:BL,n=(t.zenModeEnabled?U5*1.5:U5)/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY);for(let i of t.snapLines)i.type==="pointer"?(e.lineWidth=n,e.strokeStyle=a,$L(i,e,t)):i.type==="gap"?(e.lineWidth=n,e.strokeStyle=a,HL(i.points[0],i.points[1],i.direction,t,e)):i.type==="points"&&(e.lineWidth=n,e.strokeStyle=a,FL(i,e,t));e.restore()},FL=(e,t,a)=>{if(!a.zenModeEnabled){let n=e.points[0],i=e.points[e.points.length-1];ka(n,i,t)}for(let n of e.points)p5(n,a,t)},$L=(e,t,a)=>{p5(e.points[0],a,t),a.zenModeEnabled||ka(e.points[0],e.points[1],t)},p5=([e,t],a,n)=>{n.save();let i=(a.zenModeEnabled?f5*1.5:f5)/a.zoom.value;n.beginPath(),n.moveTo(e-i,t-i),n.lineTo(e+i,t+i),n.moveTo(e+i,t-i),n.lineTo(e-i,t+i),n.stroke(),n.restore()},ka=(e,t,a)=>{a.beginPath(),a.lineTo(e[0],e[1]),a.lineTo(t[0],t[1]),a.stroke()},HL=(e,t,a,n,i)=>{let l=8/n.zoom.value,r=l/2,o=l/4;if(a==="horizontal"){let d=[(e[0]+t[0])/2,e[1]];n.zenModeEnabled||ka(w(e[0],e[1]-l),w(e[0],e[1]+l),i),ka(w(d[0]-o,d[1]-r),w(d[0]-o,d[1]+r),i),ka(w(d[0]+o,d[1]-r),w(d[0]+o,d[1]+r),i),n.zenModeEnabled||(ka(w(t[0],t[1]-l),w(t[0],t[1]+l),i),ka(e,t,i))}else{let d=[e[0],(e[1]+t[1])/2];n.zenModeEnabled||ka(w(e[0]-l,e[1]),w(e[0]+l,e[1]),i),ka(w(d[0]-r,d[1]-o),w(d[0]+r,d[1]-o),i),ka(w(d[0]-r,d[1]+o),w(d[0]+r,d[1]+o),i),n.zenModeEnabled||(ka(w(t[0]-l,t[1]),w(t[0]+l,t[1]),i),ka(e,t,i))}},XL=(e,t)=>{Bt(t.selectedLinearElement,"selectedLinearElement is null");let{segmentMidPointHoveredCoords:a}=t.selectedLinearElement;Bt(a,"midPointCoords is null"),e.save(),e.translate(t.scrollX,t.scrollY),m5(a,e,t),e.restore()},WL=(e,t,a)=>{let{elementId:n,hoverPointIndex:i}=t.selectedLinearElement;if(t.editingLinearElement?.selectedPointsIndices?.includes(i))return;let l=Z.getElement(n,a);if(!l)return;let r=Z.getPointAtIndexGlobalCoordinates(l,i,a);e.save(),e.translate(t.scrollX,t.scrollY),m5(r,e,t),e.restore()},m5=(e,t,a)=>{t.fillStyle="rgba(105, 101, 219, 0.4)",ko(t,e[0],e[1],Z.POINT_HANDLE_SIZE/a.zoom.value,!1)},ss=(e,t,a,n,i,l,r,o,d=!1,u=0)=>{e.save(),e.translate(l,r),e.rotate(o),d&&e.fillRect(t-l,a-r,n,i),u&&e.roundRect?(e.beginPath(),e.roundRect(t-l,a-r,n,i,u),e.stroke(),e.closePath()):e.strokeRect(t-l,a-r,n,i),e.restore()},GL=(e,t,a,n,i,l)=>{e.save(),e.translate(n,i),e.rotate(l),e.beginPath(),e.moveTo(0,a/2),e.lineTo(t/2,0),e.lineTo(0,-a/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()},I1=(e,t,a,n,i,l=!1)=>{e.strokeStyle="#5e5ad8",e.setLineDash([]),e.fillStyle="rgba(255, 255, 255, 0.9)",i?e.fillStyle="rgba(134, 131, 226, 0.9)":l&&(e.fillStyle="rgba(177, 151, 252, 0.7)"),ko(e,a[0],a[1],n/t.zoom.value,!l)},VL=(e,t,a,n,i,l)=>{e.beginPath(),e.ellipse(n,i,t/2,a/2,l,0,Math.PI*2),e.stroke()},YL=(e,t,a,n)=>{let[i,l,r,o]=Ue(t,a),d=r-i,u=o-l;e.strokeStyle="rgba(0,0,0,.05)";let s=n.value<1?n.value:1;e.lineWidth=Dc/s;let c=e.lineWidth/2+Ac,U=Ba(Math.min(t.width,t.height),t);switch(t.type){case"rectangle":case"text":case"image":case"iframe":case"embeddable":case"frame":case"magicframe":ss(e,i-c,l-c,d+c*2,u+c*2,i+d/2,l+u/2,t.angle,void 0,U);break;case"diamond":let f=Math.hypot(d,u),p=c*f/u,m=c*f/d;GL(e,d+p*2,u+m*2,i+d/2,l+u/2,t.angle);break;case"ellipse":VL(e,d+c*2,u+c*2,i+d/2,l+u/2,t.angle);break}},jL=(e,t,a,n)=>{let[i,l,r]=t,o=xr(r,r.width,r.height,n);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",(l==="both"?[0,-1]:l==="start"?[0]:[-1]).forEach(d=>{let[u,s]=Z.getPointAtIndexGlobalCoordinates(i,d,a);ko(e,u,s,o)})},g5=(e,t,a)=>{let{angle:n,x1:i,y1:l,x2:r,y2:o,selectionColors:d,cx:u,cy:s,dashed:c,activeEmbeddable:U}=a,f=r-i,p=o-l,m=(a.padding??ki*2)/t.zoom.value,g=8/t.zoom.value,y=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=(U?4:1)/t.zoom.value;let v=d.length;for(let b=0;b<v;++b)e.strokeStyle=d[b],c&&e.setLineDash([g,y+(g+y)*(v-1)]),e.lineDashOffset=(g+y)*b,ss(e,i-m,l-m,f+m*2,p+m*2,u,s,n);e.restore()},ZL=(e,t,a,n)=>{let i=Array.isArray(a)?jL:YL;e.save(),e.translate(t.scrollX,t.scrollY),i(e,a,n,t.zoom),e.restore()},KL=(e,t,a,n)=>{let[i,l,r,o]=Ue(a,n),d=r-i,u=o-l;e.strokeStyle="rgb(0,118,255)",e.lineWidth=qe.strokeWidth/t.zoom.value,e.save(),e.translate(t.scrollX,t.scrollY),ss(e,i,l,d,u,i+d/2,l+u/2,a.angle,!1,qe.radius/t.zoom.value),e.restore()},qL=(e,t,a)=>{let n=a.filter(o=>o.groupIds.length===0),i=a.filter(o=>o.groupIds.length>0),l=o=>{let[d,u,s,c]=De(o);return{angle:0,x1:d,x2:s,y1:u,y2:c,selectionColors:["rgb(0,118,255)"],dashed:!1,cx:d+(s-d)/2,cy:u+(c-u)/2,activeEmbeddable:!1}},r=o=>{let d=je(a,o);return l(d)};Object.entries(Kf(i,t)).filter(([o,d])=>d).map(([o,d])=>o).map(o=>r(o)).concat(n.map(o=>l([o]))).forEach(o=>g5(e,t,o))},T1=(e,t,a,n)=>{if(!t.selectedLinearElement)return;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;let i=Z.getPointsGlobalCoordinates(a,n),{POINT_HANDLE_SIZE:l}=Z,r=t.editingLinearElement?l:l/2;if(i.forEach((o,d)=>{if(q(a)&&d!==0&&d!==i.length-1)return;let u=!!t.editingLinearElement?.selectedPointsIndices?.includes(d);I1(e,t,o,r,u)}),q(a)){let o=a.fixedSegments?.map(d=>d.index)||[];i.slice(0,-1).forEach((d,u)=>{Z.isSegmentTooShort(a,i[u+1],i[u],u,t.zoom)||I1(e,t,w((d[0]+i[u+1][0])/2,(d[1]+i[u+1][1])/2),l/2,!1,!o.includes(u+1))})}else Z.getEditorMidPoints(a,n,t).filter((o,d,u)=>o!==null&&!(q(a)&&(d===0||d===u.length-1))).forEach(o=>{(t.editingLinearElement||i.length===2)&&I1(e,t,o,l/2,!1,!0)});e.restore()},b5=(e,t,a,n,i)=>{Object.keys(n).forEach(l=>{let r=n[l];if(r!==void 0){let[o,d,u,s]=r;e.save(),e.lineWidth=1/a.zoom.value,t.selectionColor&&(e.strokeStyle=t.selectionColor),l==="rotation"?ko(e,o+u/2,d+s/2,u/2):e.roundRect?(e.beginPath(),e.roundRect(o,d,u,s,2/a.zoom.value),e.fill(),e.stroke()):ss(e,o,d,u,s,o+u/2,d+s/2,i,!0),e.restore()}})},JL=(e,t,a,n,i)=>{let[l,r,,,o,d]=Ue(n,i),u=3,s=20,c=u/a.zoom.value,U=c/2,f=o-l+c,p=d-r+c,m=Math.min(s/a.zoom.value,f),g=Math.min(s/a.zoom.value,p);e.save(),e.fillStyle=t.selectionColor,e.strokeStyle=t.selectionColor,e.lineWidth=c,[[[-f,-p],[0,U],[m,U],[U,0],[U,g]],[[f-U,-p],[U,U],[-m+U,U],[0,0],[0,g]],[[-f,p],[0,-U],[m,-U],[U,0],[U,-g]],[[f-U,p],[U,-U],[-m+U,-U],[0,0],[0,-g]]].forEach(y=>{let[[v,b],[x,S],[C,T],[k,R],[D,A]]=y;e.save(),e.translate(o,d),e.rotate(n.angle),e.beginPath(),e.moveTo(v+x,b+S),e.lineTo(v+C,b+T),e.stroke(),e.beginPath(),e.moveTo(v+k,b+R),e.lineTo(v+D,b+A),e.stroke(),e.restore()}),e.restore()},QL=(e,t,a,n)=>{t.save();let i=ki*2/a.zoom.value,l=e.width+i*2,r=e.height+i*2,o=e.x+l/2,d=e.y+r/2,u=-(l/2+i),s=-(r/2+i);t.translate(o+a.scrollX,d+a.scrollY),t.rotate(e.angle),t.lineWidth=1/a.zoom.value,t.strokeStyle=n,t.strokeRect(u,s,l,r),t.restore()},y5=({canvas:e,elementsMap:t,visibleElements:a,selectedElements:n,allElementsMap:i,scale:l,appState:r,renderConfig:o,device:d})=>{if(e===null)return{atLeastOneVisibleElement:!1,elementsMap:t};let[u,s]=qc(e,l),c=Jc({canvas:e,scale:l,normalizedWidth:u,normalizedHeight:s});c.save(),c.scale(r.zoom.value,r.zoom.value);let U;if(a.forEach(m=>{r.editingLinearElement?.elementId===m.id&&m&&(U=m)}),U&&T1(c,r,U,t),r.selectionElement&&!r.isCropping)try{bw(r.selectionElement,c,r,o.selectionColor)}catch(m){console.error(m)}if(r.editingTextElement&&j(r.editingTextElement)){let m=i.get(r.editingTextElement.id);m&&!m.autoResize&&QL(m,c,r,o.selectionColor)}r.isBindingEnabled&&r.suggestedBindings.filter(m=>m!=null).forEach(m=>{ZL(c,r,m,t)}),r.frameToHighlight&&KL(c,r,r.frameToHighlight,t),r.elementsToHighlight&&qL(c,r,r.elementsToHighlight);let f=n.some(m=>de(m));if(n.length===1&&r.editingLinearElement?.elementId===n[0].id&&T1(c,r,n[0],t),q(n[0])&&r.selectedLinearElement&&r.selectedLinearElement.segmentMidPointHoveredCoords?XL(c,r):r.selectedLinearElement&&r.selectedLinearElement.hoverPointIndex>=0&&!(q(n[0])&&r.selectedLinearElement.hoverPointIndex>0&&r.selectedLinearElement.hoverPointIndex<n[0].points.length-1)&&WL(c,r,t),!r.multiElement&&!r.editingLinearElement){let m=$p(n,r),g=n.length===1&&he(n[0]);g&&r.selectedLinearElement?.elementId===n[0].id&&!n[0].locked&&T1(c,r,n[0],t);let y=o.selectionColor||Mt.black;if(m){let v=oe(n),b=[];for(let S of t.values()){let C=[],T=o.remoteSelectedElementIds.get(S.id);if(g&&q(S)&&(S.startBinding||S.endBinding)||(v.has(S.id)&&!jf(r,S)&&C.push(y),T&&C.push(...T.map(k=>ed(k,r.collaborators.get(k))))),C.length){let[k,R,D,A,P,$]=Ue(S,t,!0);b.push({angle:S.angle,x1:k,y1:R,x2:D,y2:A,selectionColors:C,dashed:!!T,cx:P,cy:$,activeEmbeddable:r.activeEmbeddable?.element===S&&r.activeEmbeddable.state==="active",padding:S.id===r.croppingElementId||Le(S)?0:void 0})}}let x=S=>{let C=je(t,S),[T,k,R,D]=De(C);b.push({angle:0,x1:T,x2:R,y1:k,y2:D,selectionColors:[Mt.black],dashed:!0,cx:T+(R-T)/2,cy:k+(D-k)/2,activeEmbeddable:!1})};for(let S of Vi(r))x(S);r.editingGroupId&&x(r.editingGroupId),b.forEach(S=>g5(c,r,S))}if(c.save(),c.translate(r.scrollX,r.scrollY),n.length===1){c.fillStyle=Mt.white;let v=Fp(n[0],r.zoom,t,"mouse",Xr(d));if(!r.viewModeEnabled&&m&&!j(r.editingTextElement)&&!r.croppingElementId&&b5(c,o,r,v,n[0].angle),r.croppingElementId&&!r.isCropping){let b=t.get(r.croppingElementId);b&&Le(b)&&JL(c,o,r,b,t)}}else if(n.length>1&&!r.isRotating){let v=ki*2/r.zoom.value;c.fillStyle=Mt.white;let[b,x,S,C]=De(n),T=c.getLineDash();c.setLineDash([2/r.zoom.value]);let k=c.lineWidth;c.lineWidth=1/r.zoom.value,c.strokeStyle=y,ss(c,b-v,x-v,S-b+v*2,C-x+v*2,(b+S)/2,(x+C)/2,0),c.lineWidth=k,c.setLineDash(T);let R=Ch([b,x,S,C,(b+S)/2,(x+C)/2],0,r.zoom,"mouse",f?{...Xr(d),rotation:!0}:Xr(d));n.some(D=>!D.locked)&&b5(c,o,r,R,0)}c.restore()}r.searchMatches.forEach(({id:m,focus:g,matchedLines:y})=>{let v=t.get(m);if(v&&j(v)){let[b,x,,,S,C]=Ue(v,t,!0);c.save(),r.theme===Se.LIGHT?g?c.fillStyle="rgba(255, 124, 0, 0.4)":c.fillStyle="rgba(255, 226, 0, 0.4)":g?c.fillStyle="rgba(229, 82, 0, 0.4)":c.fillStyle="rgba(99, 52, 0, 0.4)",c.translate(r.scrollX,r.scrollY),c.translate(S,C),c.rotate(v.angle),y.forEach(T=>{c.fillRect(b+T.offsetX-S,x+T.offsetY-C,T.width,T.height)}),c.restore()}}),zL(c,r),c.restore(),FC({context:c,renderConfig:o,appState:r,normalizedWidth:u,normalizedHeight:s});let p;return o.renderScrollbars&&(p=YI(a,u,s,r),c.save(),c.fillStyle=VI,c.strokeStyle="rgba(255,255,255,0.8)",[p.horizontal,p.vertical].forEach(m=>{m&&nm(c,m.x,m.y,m.width,m.height,vi/2)}),c.restore()),{scrollBars:p,atLeastOneVisibleElement:a.length>0,elementsMap:t}},v5=Os(e=>{let t=y5(e);e.callback?.(t)},{trailing:!0}),eD=(e,t)=>{if(t){v5(e);return}let a=y5(e);return e.callback(a),a},tD=e=>{let t=re(!1);return ae(()=>{if(!t.current){t.current=!0;return}let a=new Map,n=new Map,i=new Map,l=new Map,r=new Map;e.appState.collaborators.forEach((d,u)=>{if(d.selectedElementIds)for(let s of Object.keys(d.selectedElementIds))i.has(s)||i.set(s,[]),i.get(s).push(u);!d.pointer||d.pointer.renderCursor===!1||(d.username&&l.set(u,d.username),d.userState&&r.set(u,d.userState),n.set(u,ma({sceneX:d.pointer.x,sceneY:d.pointer.y},e.appState)),a.set(u,d.button))});let o=e.containerRef?.current&&getComputedStyle(e.containerRef.current).getPropertyValue("--color-selection")||"#6965db";eD({canvas:e.canvas,elementsMap:e.elementsMap,visibleElements:e.visibleElements,selectedElements:e.selectedElements,allElementsMap:e.allElementsMap,scale:window.devicePixelRatio,appState:e.appState,renderConfig:{remotePointerViewportCoords:n,remotePointerButton:a,remoteSelectedElementIds:i,remotePointerUsernames:l,remotePointerUserStates:r,selectionColor:o,renderScrollbars:!1},device:e.device,callback:e.renderInteractiveSceneCallback},k1())}),h("canvas",{className:"excalidraw__canvas interactive",style:{width:e.appState.width,height:e.appState.height,cursor:e.appState.viewModeEnabled?Pe.GRAB:Pe.AUTO},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:e.handleCanvasRef,onContextMenu:e.onContextMenu,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.onPointerCancel,onTouchMove:e.onTouchMove,onPointerDown:e.onPointerDown,onDoubleClick:e.appState.viewModeEnabled?void 0:e.onDoubleClick,children:E("labels.drawingCanvas")})},w5=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,editingGroupId:e.editingGroupId,editingLinearElement:e.editingLinearElement,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,selectionElement:e.selectionElement,selectedGroupIds:e.selectedGroupIds,selectedLinearElement:e.selectedLinearElement,multiElement:e.multiElement,isBindingEnabled:e.isBindingEnabled,suggestedBindings:e.suggestedBindings,isRotating:e.isRotating,elementsToHighlight:e.elementsToHighlight,collaborators:e.collaborators,activeEmbeddable:e.activeEmbeddable,snapLines:e.snapLines,zenModeEnabled:e.zenModeEnabled,editingTextElement:e.editingTextElement,isCropping:e.isCropping,croppingElementId:e.croppingElementId,searchMatches:e.searchMatches}),aD=(e,t)=>e.selectionNonce!==t.selectionNonce||e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements||e.selectedElements!==t.selectedElements?!1:At(w5(e.appState),w5(t.appState)),nD=ee.memo(tD,aD),iD=e=>{let t=re(null),a=re(!1);return ae(()=>{let n=t.current;if(!n)return;let i=e.canvas;a.current||(a.current=!0,n.replaceChildren(i),i.classList.add("excalidraw__canvas","static"));let l=`${e.appState.width}px`,r=`${e.appState.height}px`;i.style.width!==l&&(i.style.width=l),i.style.height!==r&&(i.style.height=r);let o=e.appState.width*e.scale,d=e.appState.height*e.scale;i.width!==o&&(i.width=o),i.height!==d&&(i.height=d),j0({canvas:i,rc:e.rc,scale:e.scale,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,visibleElements:e.visibleElements,appState:e.appState,renderConfig:e.renderConfig},k1())}),h("div",{className:"excalidraw__canvas-wrapper",ref:t})},E5=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,hoveredElementIds:e.hoveredElementIds,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,shouldCacheIgnoreZoom:e.shouldCacheIgnoreZoom,viewBackgroundColor:e.viewBackgroundColor,exportScale:e.exportScale,selectedElementsAreBeingDragged:e.selectedElementsAreBeingDragged,gridSize:e.gridSize,gridStep:e.gridStep,frameRendering:e.frameRendering,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,editingGroupId:e.editingGroupId,currentHoveredFontFamily:e.currentHoveredFontFamily,croppingElementId:e.croppingElementId}),lD=(e,t)=>e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements?!1:At(E5(e.appState),E5(t.appState))&&At(e.renderConfig,t.renderConfig),rD=ee.memo(iD,lD),x5=class{constructor(e){I(this,"scene"),I(this,"getRenderableElements",(()=>{let t=({elementsMap:n,zoom:i,offsetLeft:l,offsetTop:r,scrollX:o,scrollY:d,height:u,width:s})=>{let c=[];for(let U of n.values())Bo(U,s,u,{zoom:i,offsetLeft:l,offsetTop:r,scrollX:o,scrollY:d},n)&&c.push(U);return c},a=({elements:n,editingTextElement:i,newElementId:l,pendingImageElementId:r})=>{let o=ga(new Map);for(let d of n)Le(d)&&r===d.id||l!==d.id&&(!i||i.type!=="text"||d.id!==i.id)&&o.set(d.id,d);return o};return Y7(({zoom:n,offsetLeft:i,offsetTop:l,scrollX:r,scrollY:o,height:d,width:u,editingTextElement:s,newElementId:c,pendingImageElementId:U,sceneNonce:f})=>{let p=this.scene.getNonDeletedElements(),m=a({elements:p,editingTextElement:s,newElementId:c,pendingImageElementId:U}),g=t({elementsMap:m,zoom:n,offsetLeft:i,offsetTop:l,scrollX:r,scrollY:o,height:d,width:u});return{elementsMap:m,visibleElements:g}})})()),this.scene=e}destroy(){v5.cancel(),Y0.cancel(),this.getRenderableElements.clear()}},sD=({trails:e})=>{let t=re(null);return ae(()=>{if(t.current)for(let a of e)a.start(t.current);return()=>{for(let a of e)a.stop()}},e),h("div",{className:"SVGLayer",children:h("svg",{ref:t})})},oD=5,dD=(e,t,a)=>{let[n,i]=Ue(e,a),{x:l,y:r}=ma({sceneX:n+e.width,sceneY:i},t),o=l-t.offsetLeft+10,d=r-t.offsetTop;return{x:o,y:d}},S5=({children:e,element:t,elementsMap:a})=>{let n=ds();if(n.contextMenu||n.newElement||n.resizingElement||n.isRotating||n.openMenu||n.viewModeEnabled)return null;let{x:i,y:l}=dD(t,n,a);return h("div",{className:"excalidraw-canvas-buttons",style:{top:`${l}px`,left:`${i}px`,padding:oD},children:e})},cD="small",L1=e=>M("label",{className:Q("ToolIcon ToolIcon__MagicButton",`ToolIcon_size_${cD}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[h("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),h("div",{className:"ToolIcon__icon",children:e.icon})]}),hD=({height:e,width:t,userToFollow:a,onDisconnect:n})=>h("div",{className:"follow-mode",style:{width:t,height:e},children:M("div",{className:"follow-mode__badge",children:[M("div",{className:"follow-mode__badge__label",children:["Following"," ",h("span",{className:"follow-mode__badge__username",title:a.username,children:a.username})]}),h("button",{type:"button",onClick:n,className:"follow-mode__disconnect-btn",children:xl})]})}),uD=hD,UD=class{constructor(){I(this,"targets",new WeakMap),I(this,"rafIds",new WeakMap)}register(e,t){this.targets.set(e,{callback:t,stopped:!0})}start(e){let t=this.targets.get(e);t&&(this.rafIds.has(e)||(this.targets.set(e,{...t,stopped:!1}),this.scheduleFrame(e)))}stop(e){let t=this.targets.get(e);t&&!t.stopped&&this.targets.set(e,{...t,stopped:!0}),this.cancelFrame(e)}constructFrame(e){return t=>{let a=this.targets.get(e);if(!a)return;let n=this.onFrame(a,t);!a.stopped&&!n?this.scheduleFrame(e):this.cancelFrame(e)}}scheduleFrame(e){let t=requestAnimationFrame(this.constructFrame(e));this.rafIds.set(e,t)}cancelFrame(e){if(this.rafIds.has(e)){let t=this.rafIds.get(e);cancelAnimationFrame(t)}this.rafIds.delete(e)}onFrame(e,t){return e.callback(t)??!1}},D1=class{constructor(e,t,a){this.animationFrameHandler=e,this.app=t,this.options=a,I(this,"currentTrail"),I(this,"pastTrails",[]),I(this,"container"),I(this,"trailElement"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.trailElement=document.createElementNS(Ie,"path")}get hasCurrentTrail(){return!!this.currentTrail}hasLastPoint(e,t){if(this.currentTrail){let a=this.currentTrail.originalPoints.length;return this.currentTrail.originalPoints[a-1][0]===e&&this.currentTrail.originalPoints[a-1][1]===t}return!1}start(e){e&&(this.container=e),this.trailElement.parentNode!==this.container&&this.container&&this.container.appendChild(this.trailElement),this.animationFrameHandler.start(this)}stop(){this.animationFrameHandler.stop(this),this.trailElement.parentNode===this.container&&this.container?.removeChild(this.trailElement)}startPath(e,t){this.currentTrail=new sg(this.options),this.currentTrail.addPoint([e,t,performance.now()]),this.update()}addPointToPath(e,t){this.currentTrail&&(this.currentTrail.addPoint([e,t,performance.now()]),this.update())}endPath(){this.currentTrail&&(this.currentTrail.close(),this.currentTrail.options.keepHead=!1,this.pastTrails.push(this.currentTrail),this.currentTrail=void 0,this.update())}update(){this.start()}onFrame(){let e=[];for(let a of this.pastTrails)e.push(this.drawTrail(a,this.app.state));if(this.currentTrail){let a=this.drawTrail(this.currentTrail,this.app.state);e.push(a)}this.pastTrails=this.pastTrails.filter(a=>a.getStrokeOutline().length!==0),e.length===0&&this.stop();let t=e.join(" ").trim();this.trailElement.setAttribute("d",t),this.trailElement.setAttribute("fill",(this.options.fill??(()=>"black"))(this))}drawTrail(e,t){let a=e.getStrokeOutline(e.options.size/t.zoom.value).map(([n,i])=>{let l=ma({sceneX:n,sceneY:i},t);return[l.x,l.y]});return j7(a,!0)}},fD=class{constructor(e,t){this.animationFrameHandler=e,this.app=t,I(this,"localTrail"),I(this,"collabTrails",new Map),I(this,"container"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.localTrail=new D1(e,t,{...this.getTrailOptions(),fill:()=>yu})}getTrailOptions(){return{simplify:0,streamline:.4,sizeMapping:e=>{let t=Math.max(0,1-(performance.now()-e.pressure)/1e3),a=(50-Math.min(50,e.totalLength-e.currentIndex))/50;return Math.min(Di(a),Di(t))}}}startPath(e,t){this.localTrail.startPath(e,t)}addPointToPath(e,t){this.localTrail.addPointToPath(e,t)}endPath(){this.localTrail.endPath()}start(e){this.container=e,this.animationFrameHandler.start(this),this.localTrail.start(e)}stop(){this.animationFrameHandler.stop(this),this.localTrail.stop()}onFrame(){this.updateCollabTrails()}updateCollabTrails(){if(!(!this.container||this.app.state.collaborators.size===0)){for(let[e,t]of this.app.state.collaborators.entries()){let a;this.collabTrails.has(e)?a=this.collabTrails.get(e):(a=new D1(this.animationFrameHandler,this.app,{...this.getTrailOptions(),fill:()=>t.pointer?.laserColor||ed(e,t)}),a.start(this.container),this.collabTrails.set(e,a)),t.pointer&&t.pointer.tool==="laser"&&(t.button==="down"&&!a.hasCurrentTrail&&a.startPath(t.pointer.x,t.pointer.y),t.button==="down"&&a.hasCurrentTrail&&!a.hasLastPoint(t.pointer.x,t.pointer.y)&&a.addPointToPath(t.pointer.x,t.pointer.y),t.button==="up"&&a.hasCurrentTrail&&(a.addPointToPath(t.pointer.x,t.pointer.y),a.endPath()))}for(let e of this.collabTrails.keys())this.app.state.collaborators.has(e)||(this.collabTrails.get(e).stop(),this.collabTrails.delete(e))}}},pD=(e,t,a,n,i,l)=>{let{zoom:r}=n,o=180*a/Math.PI,d=e*(r.value-1)/2,u=t*(r.value-1)/2;return e>i&&r.value!==1&&(d=i*(r.value-1)/2),t>l&&r.value!==1&&(u=l*(r.value-1)/2),`translate(${d}px, ${u}px) scale(${r.value}) rotate(${o}deg)`},mD=({id:e,onChange:t,onSubmit:a,getViewportCoords:n,element:i,canvas:l,excalidrawContainer:r,app:o,autoSelect:d=!0})=>{let u=(_,H)=>{if(!H.style.fontFamily||!H.style.fontSize)return!1;let W=H.style.fontFamily.replace(/"/g,"");return bl({fontFamily:_.fontFamily})!==W||`${_.fontSize}px`!==H.style.fontSize},s=()=>{let _=o.state,H=Hn.getScene(i)?.getElement(e);if(!H)return;let{textAlign:W,verticalAlign:K}=H,G=o.scene.getNonDeletedElementsMap();if(H&&j(H)){let ce=H.x,xe=H.y,Ce=Tt(H,o.scene.getNonDeletedElementsMap()),ut=H.width,Zt=H.height,fa=H.width,En=H.height;if(Ce&&H.containerId){if(ge(Ce)){let qn=Z.getBoundTextElementPosition(Ce,H,G);ce=qn.x,xe=qn.y}let ms=u(H,c),Zl;if(ms?Zl=bo(Ce.id,Ce.height):(Zl=Rl[Ce.id],Zl||(Zl=bo(Ce.id,Ce.height))),fa=$n(Ce,H),En=vo(Ce,H),!ge(Ce)&&Zt>En){let qn=Yi(Zt,Ce.type);F(Ce,{height:qn});return}else if(!ge(Ce)&&Ce.height>Zl.height&&Zt<En){let qn=Yi(Zt,Ce.type);F(Ce,{height:qn})}else{let{y:qn}=yo(Ce,H,G);xe=qn}}let[Kt,jn]=n(ce,xe),Zn=c.selectionStart,qt=c.selectionEnd,Kn=c.value.length;if(Zn===qt&&qt!==Kn){let ms=Kn-qt;c.selectionStart=c.value.length-ms,c.selectionEnd=c.value.length-ms}Ce?ut+=.5:(fa=(_.width-8-Kt)/_.zoom.value,ut=Math.min(ut,fa)),Zt*=1.05;let da=Oe(H),Q1=(_.height-jn)/_.zoom.value;Object.assign(c.style,{font:da,lineHeight:H.lineHeight,width:`${ut}px`,height:`${Zt}px`,left:`${Kt}px`,top:`${jn}px`,transform:pD(ut,Zt,TE(H,Ce),_,fa,Q1),textAlign:W,verticalAlign:K,color:H.strokeColor,opacity:H.opacity/100,filter:"var(--theme-filter)",maxHeight:`${Q1}px`}),c.scrollTop=0,Tn()&&(c.style.fontFamily=bl(H)),F(H,{x:ce,y:xe})}},c=document.createElement("textarea");c.dir="auto",c.tabIndex=0,c.dataset.type="wysiwyg",c.wrap="off",c.classList.add("excalidraw-wysiwyg");let U="pre",f="normal";(Ye(i)||!i.autoResize)&&(U="pre-wrap",f="break-word"),Object.assign(c.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:f,whiteSpace:U,overflowWrap:"break-word",boxSizing:"content-box"}),c.value=i.originalText,s(),t&&(c.onpaste=async _=>{let H=await Up(_,!0);if(!H.text)return;let W=El(H.text);if(!W)return;let K=Tt(i,o.scene.getNonDeletedElementsMap()),G=Oe({fontSize:o.state.currentItemFontSize,fontFamily:o.state.currentItemFontFamily});if(K){let ce=pe(K,o.scene.getNonDeletedElementsMap()),xe=Oi(`${c.value}${W}`,G,$n(K,ce)),Ce=Kd(xe,G);c.style.width=`${Ce}px`}},c.oninput=()=>{let _=El(c.value);if(c.value!==_){let H=c.selectionStart;c.value=_,c.selectionStart=H,c.selectionEnd=H}t(c.value)}),c.onkeydown=_=>{if(!_.shiftKey&&Y2.keyTest(_))_.preventDefault(),o.actionManager.executeAction(Y2),s();else if(!_.shiftKey&&j2.keyTest(_))_.preventDefault(),o.actionManager.executeAction(j2),s();else if(!_.shiftKey&&Z2.keyTest(_))_.preventDefault(),o.actionManager.executeAction(Z2),s();else if(X2.keyTest(_))o.actionManager.executeAction(X2);else if(W2.keyTest(_))o.actionManager.executeAction(W2);else if(_.key===L.ESCAPE)_.preventDefault(),S=!0,C();else if(_.key===L.ENTER&&_[L.CTRL_OR_CMD]){if(_.preventDefault(),_.isComposing||_.keyCode===229)return;S=!0,C()}else if(_.key===L.TAB||_[L.CTRL_OR_CMD]&&(_.code===ke.BRACKET_LEFT||_.code===ke.BRACKET_RIGHT)){if(_.preventDefault(),_.isComposing)return;_.shiftKey||_.code===ke.BRACKET_LEFT?v():y(),c.dispatchEvent(new Event("input"))}};let p=4,m=" ".repeat(p),g=new RegExp(`^ {1,${p}}`),y=()=>{let{selectionStart:_,selectionEnd:H}=c,W=b(),K=c.value;W.forEach(G=>{let ce=K.slice(0,G),xe=K.slice(G);K=`${ce}${m}${xe}`}),c.value=K,c.selectionStart=_+p,c.selectionEnd=H+p*W.length},v=()=>{let{selectionStart:_,selectionEnd:H}=c,W=b(),K=[],G=c.value;W.forEach(ce=>{let xe=G.slice(ce,ce+p).match(g);if(xe){let Ce=G.slice(0,ce),ut=G.slice(ce+xe[0].length);G=`${Ce}${ut}`,K.push(ce)}}),c.value=G,K.length&&(_>K[K.length-1]?c.selectionStart=Math.max(_-p,K[K.length-1]):c.selectionStart=_,c.selectionEnd=Math.max(c.selectionStart,H-p*K.length))},b=()=>{let{selectionStart:_,selectionEnd:H,value:W}=c,K=W.slice(0,_).match(/[^\n]*$/)[0].length;return _=_-K,W.slice(_,H).split(`
`).reduce((G,ce,xe,Ce)=>G.concat(xe?G[xe-1]+Ce[xe-1].length+1:_),[]).reverse()},x=_=>{_.target instanceof HTMLCanvasElement&&(_.preventDefault(),_.stopPropagation())},S=!1,C=()=>{if($)return;$=!0,T();let _=Hn.getScene(i)?.getElement(i.id);if(!_)return;let H=Tt(_,o.scene.getNonDeletedElementsMap());if(H){if(c.value.trim()){let W=Fn(H);!W||W!==i.id?F(H,{boundElements:(H.boundElements||[]).concat({type:"text",id:i.id})}):ge(H)&&Hr(H)}else F(H,{boundElements:H.boundElements?.filter(W=>!j(W))});Wt(_,H,o.scene.getNonDeletedElementsMap())}a({viaKeyboard:S,nextOriginalText:c.value})},T=()=>{c.onblur=null,c.oninput=null,c.onkeydown=null,X&&X.disconnect(),window.removeEventListener("resize",s),window.removeEventListener("wheel",x,!0),window.removeEventListener("pointerdown",D),window.removeEventListener("pointerup",k),window.removeEventListener("blur",C),window.removeEventListener("beforeunload",C),A(),P(),c.remove()},k=_=>{window.removeEventListener("pointerup",k);let H=_?.target,W=H instanceof HTMLElement&&H.classList.contains("properties-trigger");setTimeout(()=>{c.onblur=C,W||c.focus()})},R=()=>{c.onblur=null,window.addEventListener("pointerup",k),window.addEventListener("blur",C)},D=_=>{let H=_?.target;if(_.button===ni.WHEEL){H instanceof HTMLTextAreaElement&&(_.preventDefault(),o.handleCanvasPanUsingWheelOrSpaceDrag(_)),R();return}let W=H instanceof HTMLElement&&H.classList.contains("properties-trigger");(_.target instanceof HTMLElement||_.target instanceof SVGElement)&&_.target.closest(`.${dl.SHAPE_ACTIONS_MENU}, .${dl.ZOOM_ACTIONS}`)&&!Li(_.target)||W?R():_.target instanceof HTMLCanvasElement&&!Tn()&&requestAnimationFrame(()=>{C()})},A=o.scene.onUpdate(()=>{s(),document.activeElement?.closest(".properties-content")||c.focus()}),P=o.onScrollChangeEmitter.on(()=>{s()}),$=!1;d&&c.select(),k();let X=null;l&&"ResizeObserver"in window?(X=new window.ResizeObserver(()=>{s()}),X.observe(l)):window.addEventListener("resize",s),c.onpointerdown=_=>_.stopPropagation(),requestAnimationFrame(()=>{window.addEventListener("pointerdown",D,{capture:!0})}),window.addEventListener("beforeunload",C),r?.querySelector(".excalidraw-textEditorContainer").appendChild(c)},gD=V({name:"autoResize",label:"labels.autoResize",icon:null,trackEvent:{category:"element"},predicate:(e,t,a,n)=>{let i=be(e,t);return i.length===1&&j(i[0])&&!i[0].autoResize},perform:(e,t,a,n)=>{let i=be(e,t);return{appState:t,elements:e.map(l=>{if(l.id===i[0].id&&j(l)){let r=zt(l.originalText,Oe(l),l.lineHeight);return fe(l,{autoResize:!0,width:r.width,height:r.height,text:l.originalText})}return l}),captureUpdate:B.IMMEDIATELY}}}),bD=e=>{let t=["flowchart","graph","sequenceDiagram","classDiagram","stateDiagram","stateDiagram-v2","erDiagram","journey","gantt","pie","quadrantChart","requirementDiagram","gitGraph","C4Context","mindmap","timeline","zenuml","sankey","xychart","block"];return new RegExp(`^(?:%%{.*?}%%[\\s\\n]*)?\\b(?:${t.map(a=>`\\s*${a}(-beta)?`).join("|")})\\b`).test(e.trim())},M5=({canvas:e,rc:t,newElement:a,elementsMap:n,allElementsMap:i,scale:l,appState:r,renderConfig:o})=>{if(e){let[d,u]=qc(e,l),s=Jc({canvas:e,scale:l,normalizedWidth:d,normalizedHeight:u});s.save(),s.scale(r.zoom.value,r.zoom.value),a&&a.type!=="selection"?Xi(a,n,i,t,s,o,r):s.clearRect(0,0,d,u)}},yD=Os(e=>{M5(e)},{trailing:!0}),vD=(e,t)=>{if(t){yD(e);return}M5(e)},wD=e=>{let t=re(null);return ae(()=>{t.current&&vD({canvas:t.current,scale:e.scale,newElement:e.appState.newElement,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,rc:e.rc,renderConfig:e.renderConfig,appState:e.appState},k1())}),h("canvas",{className:"excalidraw__canvas",style:{width:e.appState.width,height:e.appState.height},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:t})},ED=wD,C5=ee.createContext(null),k5=ee.createContext(null),I5={viewport:{isMobile:!1,isLandscape:!1},editor:{isMobile:!1,canFitSidebar:!1},isTouchScreen:!1},A1=ee.createContext(I5);A1.displayName="DeviceContext";var R1=ee.createContext({container:null,id:null});R1.displayName="ExcalidrawContainerContext";var N1=ee.createContext([]);N1.displayName="ExcalidrawElementsContext";var P1=ee.createContext({...tn(),width:0,height:0,offsetLeft:0,offsetTop:0});P1.displayName="ExcalidrawAppStateContext";var _1=ee.createContext(()=>{console.warn("Uninitialized ExcalidrawSetAppStateContext context!")});_1.displayName="ExcalidrawSetAppStateContext";var O1=ee.createContext(null);O1.displayName="ExcalidrawActionManagerContext";var Ka=()=>Ja(C5),os=()=>Ja(k5),vt=()=>Ja(A1),vn=()=>Ja(R1),gd=()=>Ja(N1),ds=()=>Ja(P1),wt=()=>Ja(_1),sa=()=>Ja(O1),cs=!1,B1=0,nl=!1,hs=!1,z1=!1,F1={horizontal:null,vertical:null},Ei=0,us=!1,$1=new Map,bd=!1,T5=0,L5=!1,Us=null,Re={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},xD=class B5 extends ee.Component{constructor(t){super(t),I(this,"canvas"),I(this,"interactiveCanvas",null),I(this,"rc"),I(this,"unmounted",!1),I(this,"actionManager"),I(this,"device",I5),I(this,"excalidrawContainerRef",ee.createRef()),I(this,"scene"),I(this,"fonts"),I(this,"renderer"),I(this,"visibleElements"),I(this,"resizeObserver"),I(this,"nearestScrollableContainer"),I(this,"library"),I(this,"libraryItemsFromStorage"),I(this,"id"),I(this,"store"),I(this,"history"),I(this,"excalidrawContainerValue"),I(this,"files",{}),I(this,"imageCache",new Map),I(this,"iFrameRefs",new Map),I(this,"embedsValidationStatus",new Map),I(this,"initializedEmbeds",new Set),I(this,"elementsPendingErasure",new Set),I(this,"flowChartCreator",new HI),I(this,"flowChartNavigator",new $I),I(this,"hitLinkElement"),I(this,"lastPointerDownEvent",null),I(this,"lastPointerUpEvent",null),I(this,"lastPointerMoveEvent",null),I(this,"lastPointerMoveCoords",null),I(this,"lastViewportPosition",{x:0,y:0}),I(this,"animationFrameHandler",new UD),I(this,"laserTrails",new fD(this.animationFrameHandler,this)),I(this,"eraserTrail",new D1(this.animationFrameHandler,this,{streamline:.2,size:5,keepHead:!0,sizeMapping:s=>{let c=Math.max(0,1-(performance.now()-s.pressure)/200),U=(10-Math.min(10,s.totalLength-s.currentIndex))/10;return Math.min(Di(U),Di(c))},fill:()=>this.state.theme===Se.LIGHT?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.2)"})),I(this,"onChangeEmitter",new fn),I(this,"onPointerDownEmitter",new fn),I(this,"onPointerUpEmitter",new fn),I(this,"onUserFollowEmitter",new fn),I(this,"onScrollChangeEmitter",new fn),I(this,"missingPointerEventCleanupEmitter",new fn),I(this,"onRemoveEventListenersEmitter",new fn),I(this,"getEffectiveGridSize",()=>Cr(this)?this.state.gridSize:null),I(this,"updateEmbedValidationStatus",(s,c)=>{this.embedsValidationStatus.set(s.id,c),Qe.delete(s)}),I(this,"updateEmbeddables",()=>{let s=new Set,c=!1;this.scene.getNonDeletedElements().filter(U=>{if(ea(U)){if(s.add(U.id),!this.embedsValidationStatus.has(U.id)){c=!0;let f=So(U.link,this.props.validateEmbeddable);this.updateEmbedValidationStatus(U,f)}}else si(U)&&s.add(U.id);return!1}),c&&this.scene.triggerUpdate(),this.iFrameRefs.forEach((U,f)=>{s.has(f)||this.iFrameRefs.delete(f)})}),I(this,"getFrameNameDOMId",s=>`${this.id}-frame-name-${s.id}`),I(this,"frameNameBoundsCache",{get:s=>{let c=this.frameNameBoundsCache._cache.get(s.id);if(!c||c.zoom!==this.state.zoom.value||c.versionNonce!==s.versionNonce){let U=document.getElementById(this.getFrameNameDOMId(s));if(U){let f=U.getBoundingClientRect(),p=$e({clientX:f.x,clientY:f.y},this.state),m=$e({clientX:f.right,clientY:f.bottom},this.state);return c={x:p.x,y:p.y,width:m.x-p.x,height:m.y-p.y,angle:0,zoom:this.state.zoom.value,versionNonce:s.versionNonce},this.frameNameBoundsCache._cache.set(s.id,c),c}return null}return c},_cache:new Map}),I(this,"resetEditingFrame",s=>{s&&F(s,{name:s.name?.trim()||null}),this.setState({editingFrame:null})}),I(this,"renderFrameNames",()=>{if(!this.state.frameRendering.enabled||!this.state.frameRendering.name)return this.state.editingFrame&&this.resetEditingFrame(null),null;let s=this.state.theme===Se.DARK;return this.scene.getNonDeletedFramesLikes().map(c=>{if(!Bo(c,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap()))return this.state.editingFrame===c.id&&this.resetEditingFrame(c),null;let{x:U,y:f}=ma({sceneX:c.x,sceneY:c.y},this.state),p=6,m,g=Tp(c);if(c.id===this.state.editingFrame){let y=g;m=h("input",{autoFocus:!0,value:y,onChange:v=>{F(c,{name:v.target.value})},onFocus:v=>v.target.select(),onBlur:()=>this.resetEditingFrame(c),onKeyDown:v=>{(v.key===L.ESCAPE||v.key===L.ENTER)&&this.resetEditingFrame(c)},style:{background:this.state.viewBackgroundColor,filter:s?Nd:"none",zIndex:2,border:"none",display:"block",padding:`${p}px`,borderRadius:4,boxShadow:"inset 0 0 0 1px var(--color-primary)",fontFamily:"Assistant",fontSize:"14px",transform:`translate(-${p}px, ${p}px)`,color:"var(--color-gray-80)",overflow:"hidden",maxWidth:`${document.body.clientWidth-U-p}px`},size:y.length+1||1,dir:"auto",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off"})}else m=g;return h("div",{id:this.getFrameNameDOMId(c),style:{position:"absolute",bottom:`${this.state.height+qe.nameOffsetY-f+this.state.offsetTop}px`,left:`${U-this.state.offsetLeft}px`,zIndex:2,fontSize:qe.nameFontSize,color:s?qe.nameColorDarkTheme:qe.nameColorLightTheme,lineHeight:qe.nameLineHeight,width:"max-content",maxWidth:`${c.width}px`,overflow:c.id===this.state.editingFrame?"visible":"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:Pe.MOVE,pointerEvents:this.state.viewModeEnabled?ol.disabled:ol.enabled},onPointerDown:y=>this.handleCanvasPointerDown(y),onWheel:y=>this.handleWheel(y),onContextMenu:this.handleCanvasContextMenu,onDoubleClick:()=>{this.setState({editingFrame:c.id})},children:m},c.id)})}),I(this,"focusContainer",()=>{this.excalidrawContainerRef.current?.focus()}),I(this,"getSceneElementsIncludingDeleted",()=>this.scene.getElementsIncludingDeleted()),I(this,"getSceneElements",()=>this.scene.getNonDeletedElements()),I(this,"onInsertElements",s=>{this.addElementsFromPasteOrLibrary({elements:s,position:"center",files:null})}),I(this,"onExportImage",async(s,c,U)=>{Ge("export",s,"ui");let f=await Qo(s,c,this.state,this.files,{exportBackground:this.state.exportBackground,name:this.getName(),viewBackgroundColor:this.state.viewBackgroundColor,exportingFrame:U.exportingFrame}).catch(Xu).catch(p=>{console.error(p),this.setState({errorMessage:p.message})});this.state.exportEmbedScene&&f&&Nh(f)&&this.setState({fileHandle:f})}),I(this,"magicGenerations",new Map),I(this,"updateMagicGeneration",({frameElement:s,data:c})=>{c.status==="pending"?F(s,{customData:{generationData:void 0}},!1):F(s,{customData:{generationData:c}},!1),this.magicGenerations.set(s.id,c),this.triggerRender()}),I(this,"plugins",{}),I(this,"onMagicframeToolSelect",()=>{let s=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds});if(s.length===0)this.setActiveTool({type:Et.magicframe}),Ge("ai","tool-select (empty-selection)","d2c");else{let c=s.length===1&&Hs(s[0])&&s[0];if(!c&&s.some(f=>de(f)||f.frameId)){this.setActiveTool({type:Et.magicframe});return}Ge("ai","tool-select (existing selection)","d2c");let U;if(c)U=c;else{let[f,p,m,g]=De(s),y=50;U=$c({...qe,x:f-y,y:p-y,width:m-f+y*2,height:g-p+y*2,opacity:100,locked:!1}),this.scene.insertElement(U);for(let v of s)F(v,{frameId:U.id});this.setState({selectedElementIds:{[U.id]:!0}})}this.onMagicFrameGenerate(U,"upstream")}}),I(this,"openEyeDropper",({type:s})=>{Ga.set(jo,{swapPreviewOnAlt:!0,colorPickerType:s==="stroke"?"elementStroke":"elementBackground",onSelect:(c,U)=>{let f=s==="background"&&U.altKey||s==="stroke"&&!U.altKey;!this.scene.getSelectedElements(this.state).length||this.state.activeTool.type!=="selection"?f?this.syncActionResult({appState:{...this.state,currentItemStrokeColor:c},captureUpdate:B.IMMEDIATELY}):this.syncActionResult({appState:{...this.state,currentItemBackgroundColor:c},captureUpdate:B.IMMEDIATELY}):this.updateScene({elements:this.scene.getElementsIncludingDeleted().map(p=>this.state.selectedElementIds[p.id]?fe(p,{[f?"strokeColor":"backgroundColor"]:c}):p),captureUpdate:B.IMMEDIATELY})},keepOpenOnAlt:!1})}),I(this,"dismissLinearEditor",()=>{setTimeout(()=>{this.setState({editingLinearElement:null})})}),I(this,"syncActionResult",ot(s=>{if(this.unmounted||s===!1)return;s.captureUpdate===B.NEVER?this.store.shouldUpdateSnapshot():s.captureUpdate===B.IMMEDIATELY&&this.store.shouldCaptureIncrement();let c=!1,U=null;if(s.elements&&(this.scene.replaceAllElements(s.elements),c=!0),s.files&&(this.addMissingFiles(s.files,s.replaceFiles),this.addNewImagesToImageCache()),s.appState||U||this.state.contextMenu){let f=s?.appState?.viewModeEnabled||!1,p=s?.appState?.zenModeEnabled||!1,m=s?.appState?.theme||this.props.theme||Se.LIGHT,g=s?.appState?.name??this.state.name,y=s?.appState?.errorMessage??this.state.errorMessage;typeof this.props.viewModeEnabled<"u"&&(f=this.props.viewModeEnabled),typeof this.props.zenModeEnabled<"u"&&(p=this.props.zenModeEnabled),U=s.appState?.editingTextElement||null,s.elements&&U&&s.elements.forEach(v=>{U?.id===v.id&&U!==v&&Rh(v)&&j(v)&&(U=v)}),U?.isDeleted&&(U=null),this.setState(v=>{let b=s.appState||{};return{...v,...b,contextMenu:null,editingTextElement:U,viewModeEnabled:f,zenModeEnabled:p,theme:m,name:g,errorMessage:y}}),c=!0}!c&&s.captureUpdate!==B.EVENTUALLY&&this.scene.triggerUpdate()})),I(this,"onBlur",ot(()=>{nl=!1,this.setState({isBindingEnabled:!0})})),I(this,"onUnload",()=>{this.onBlur()}),I(this,"disableEvent",s=>{s.preventDefault()}),I(this,"resetHistory",()=>{this.history.clear()}),I(this,"resetStore",()=>{this.store.clear()}),I(this,"resetScene",ot(s=>{this.scene.replaceAllElements([]),this.setState(c=>({...tn(),isLoading:s?.resetLoadingState?!1:c.isLoading,theme:this.state.theme})),this.resetStore(),this.resetHistory()})),I(this,"initializeScene",async()=>{"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(async U=>{if(!U.files.length)return;let f=U.files[0],p=await f.getFile();this.loadFileToCanvas(new File([p],p.name||"",{type:p.type}),f)}),this.props.theme&&this.setState({theme:this.props.theme}),this.state.isLoading||this.setState({isLoading:!0});let s=null;try{typeof this.props.initialData=="function"?s=await this.props.initialData()||null:s=await this.props.initialData||null,s?.libraryItems&&this.library.updateLibrary({libraryItems:s.libraryItems,merge:!0}).catch(U=>{console.error(U)})}catch(U){console.error(U),s={appState:{errorMessage:U.message||"Encountered an error during importing or restoring scene data"}}}let c=Pr(s,null,null,{repairBindings:!0});c.appState={...c.appState,theme:this.props.theme||c.appState.theme,openSidebar:c.appState?.openSidebar||this.state.openSidebar,activeTool:c.appState.activeTool.type==="image"?{...c.appState.activeTool,type:"selection"}:c.appState.activeTool,isLoading:!1,toast:this.state.toast},s?.scrollToContent&&(c.appState={...c.appState,...Sr(c.elements,{...c.appState,width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})}),this.resetStore(),this.resetHistory(),this.syncActionResult({...c,captureUpdate:B.NEVER}),this.clearImageShapeCache(),this.fonts.loadSceneFonts().then(U=>{this.fonts.onLoaded(U)}),Pl(window.location.href)&&this.scrollToContent(window.location.href,{animate:!1})}),I(this,"isMobileBreakpoint",(s,c)=>s<s7||c<d7&&s<o7),I(this,"refreshViewportBreakpoints",()=>{if(!this.excalidrawContainerRef.current)return;let{clientWidth:s,clientHeight:c}=document.body,U=this.device.viewport,f=zs(U,{isLandscape:s>c,isMobile:this.isMobileBreakpoint(s,c)});return U!==f?(this.device={...this.device,viewport:f},!0):!1}),I(this,"refreshEditorBreakpoints",()=>{let s=this.excalidrawContainerRef.current;if(!s)return;let{width:c,height:U}=s.getBoundingClientRect(),f=this.props.UIOptions.dockedSidebarBreakpoint!=null?this.props.UIOptions.dockedSidebarBreakpoint:c7,p=this.device.editor,m=zs(p,{isMobile:this.isMobileBreakpoint(c,U),canFitSidebar:c>f});return p!==m?(this.device={...this.device,editor:m},!0):!1}),I(this,"onResize",ot(()=>{this.scene.getElementsIncludingDeleted().forEach(s=>Qe.delete(s)),this.refreshViewportBreakpoints(),this.updateDOMRect(),kd||this.refreshEditorBreakpoints(),this.setState({})})),I(this,"onFullscreenChange",()=>{!document.fullscreenElement&&this.state.activeEmbeddable?.state==="active"&&this.setState({activeEmbeddable:null})}),I(this,"renderInteractiveSceneCallback",({atLeastOneVisibleElement:s,scrollBars:c,elementsMap:U})=>{c&&(F1=c);let f=this.state.editingTextElement?!1:!s&&U.size>0;this.state.scrolledOutside!==f&&this.setState({scrolledOutside:f}),this.scheduleImageRefresh()}),I(this,"onScroll",yl(()=>{let{offsetTop:s,offsetLeft:c}=this.getCanvasOffsets();this.setState(U=>U.offsetLeft===c&&U.offsetTop===s?null:{offsetTop:s,offsetLeft:c})},l7)),I(this,"onCut",ot(s=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||Li(s.target)||(this.actionManager.executeAction(dm,"keyboard",s),s.preventDefault(),s.stopPropagation())})),I(this,"onCopy",ot(s=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||Li(s.target)||(this.actionManager.executeAction(td,"keyboard",s),s.preventDefault(),s.stopPropagation())})),I(this,"onTouchStart",s=>{if(gu&&s.preventDefault(),!cs){cs=!0,clearTimeout(B1),B1=window.setTimeout(B5.resetTapTwice,n7);return}if(cs&&s.touches.length===1){let c=s.touches[0];this.handleCanvasDoubleClick({clientX:c.clientX,clientY:c.clientY}),cs=!1,clearTimeout(B1)}s.touches.length===2&&this.setState({selectedElementIds:Ae({},this.state),activeEmbeddable:null})}),I(this,"onTouchEnd",s=>{this.resetContextMenuTimer(),s.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:Ae(this.state.previousSelectedElementIds,this.state)}):Re.pointers.clear()}),I(this,"pasteFromClipboard",ot(async s=>{let c=!!bd,U=document.activeElement,f=this.excalidrawContainerRef.current?.contains(U);if(s&&!f)return;let p=document.elementFromPoint(this.lastViewportPosition.x,this.lastViewportPosition.y);if(s&&(!(p instanceof HTMLCanvasElement)||Li(U)))return;let{x:m,y:g}=$e({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),y=s?.clipboardData?.files[0],v=await Up(s,c);if(!y&&!c){if(v.mixedContent)return this.addElementsFromMixedContentPaste(v.mixedContent,{isPlainPaste:c,sceneX:m,sceneY:g});if(v.text){let b=v.text.trim();b.startsWith("<svg")&&b.endsWith("</svg>")&&(y=n2(b))}}if(Ji(y)&&!v.spreadsheet){if(!this.isToolSupported("image")){this.setState({errorMessage:E("errors.imageToolNotSupported")});return}let b=this.createImageElement({sceneX:m,sceneY:g});this.insertImageElement(b,y),this.initializeImageDimensions(b),this.setState({selectedElementIds:Ae({[b.id]:!0},this.state)});return}if(this.props.onPaste)try{if(await this.props.onPaste(v,s)===!1)return}catch(b){console.error(b)}if(v.errorMessage)this.setState({errorMessage:v.errorMessage});else if(v.spreadsheet&&!c)this.setState({pasteDialog:{data:v.spreadsheet,shown:!0}});else if(v.elements){let b=v.programmaticAPI?md(v.elements):v.elements;this.addElementsFromPasteOrLibrary({elements:b,files:v.files||null,position:"cursor",retainSeed:c})}else if(v.text){if(v.text&&bD(v.text)){let S=await import("/npm/@excalidraw/mermaid-to-excalidraw@2.2.2/+esm");try{let{elements:C,files:T={}}=await S.parseMermaidToExcalidraw(v.text),k=md(C,{regenerateIds:!0});this.addElementsFromPasteOrLibrary({elements:k,files:T,position:"cursor"});return}catch(C){console.warn(`parsing pasted text as mermaid definition failed: ${C.message}`)}}let b=Ku(v.text).split(/\n+/).map(S=>S.trim()).filter(Boolean),x=b.map(S=>ax(S)).filter(S=>So(S,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(S)||Nl(S)?.type==="video"));if(!bd&&x.length>0&&x.length===b.length){let S=[];for(let C of x){let T=S[S.length-1],k=this.insertEmbeddableElement({sceneX:T?T.x+T.width+20:m,sceneY:g,link:la(C)});k&&S.push(k)}S.length&&this.setState({selectedElementIds:Object.fromEntries(S.map(C=>[C.id,!0]))});return}this.addTextFromPaste(v.text,c)}this.setActiveTool({type:"selection"}),s?.preventDefault()})),I(this,"addElementsFromPasteOrLibrary",s=>{let c=Do(s.elements,null,void 0),[U,f,p,m]=De(c),g=Ot(U,p)/2,y=Ot(f,m)/2,v=typeof s.position=="object"?s.position.clientX:s.position==="cursor"?this.lastViewportPosition.x:this.state.width/2+this.state.offsetLeft,b=typeof s.position=="object"?s.position.clientY:s.position==="cursor"?this.lastViewportPosition.y:this.state.height/2+this.state.offsetTop,{x,y:S}=$e({clientX:v,clientY:b},this.state),C=x-g,T=S-y,[k,R]=bt(C,T,this.getEffectiveGridSize()),D=g0(c.map(_=>fe(_,{x:_.x+k-U,y:_.y+R-f})),{randomizeSeed:!s.retainSeed}),A=this.scene.getElementsIncludingDeleted(),P=[...A,...D];P=this.props.onDuplicate?.(P,A)||P,un(P,oe(D));let $=this.getTopLayerFrameAtSceneCoords({x,y:S});if($){let _=rS(D,$);$r(P,_,$,this.state)}this.scene.replaceAllElements(P),D.forEach(_=>{if(j(_)&&Ye(_)){let H=Tt(_,this.scene.getElementsMapIncludingDeleted());Wt(_,H,this.scene.getElementsMapIncludingDeleted())}}),Vg&&An.loadElementsFonts(D).then(_=>{this.fonts.onLoaded(_)}),s.files&&this.addMissingFiles(s.files),this.store.shouldCaptureIncrement();let X=vh(D);this.setState({...this.state,openSidebar:this.state.openSidebar&&this.device.editor.canFitSidebar&&Ga.get(m1)?this.state.openSidebar:null,...Xt({editingGroupId:null,selectedElementIds:X.reduce((_,H)=>(Ye(H)||(_[H.id]=!0),_),{})},this.scene.getNonDeletedElements(),this.state,this)},()=>{s.files&&this.addNewImagesToImageCache()}),this.setActiveTool({type:"selection"}),s.fitToContent&&this.scrollToContent(D,{fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()})}),I(this,"setAppState",(s,c)=>{this.setState(s,c)}),I(this,"removePointer",s=>{Ei&&this.resetContextMenuTimer(),Re.pointers.delete(s.pointerId)}),I(this,"toggleLock",(s="ui")=>{this.state.activeTool.locked||Ge("toolbar","toggleLock",`${s} (${this.device.editor.isMobile?"mobile":"desktop"})`),this.setState(c=>({activeTool:{...c.activeTool,...ft(this.state,c.activeTool.locked?{type:"selection"}:c.activeTool),locked:!c.activeTool.locked}}))}),I(this,"updateFrameRendering",s=>{this.setState(c=>{let U=typeof s=="function"?s(c.frameRendering):s;return{frameRendering:{enabled:U?.enabled??c.frameRendering.enabled,clip:U?.clip??c.frameRendering.clip,name:U?.name??c.frameRendering.name,outline:U?.outline??c.frameRendering.outline}}})}),I(this,"togglePenMode",s=>{this.setState(c=>({penMode:s??!c.penMode,penDetected:!0}))}),I(this,"onHandToolToggle",()=>{this.actionManager.executeAction(MC)}),I(this,"zoomCanvas",s=>{this.setState({...el({viewportX:this.state.width/2+this.state.offsetLeft,viewportY:this.state.height/2+this.state.offsetTop,nextZoom:Bn(s)},this.state)})}),I(this,"cancelInProgressAnimation",null),I(this,"scrollToContent",(s=this.scene.getNonDeletedElements(),c)=>{if(typeof s=="string"){let g;if(Pl(s)?g=dx(s):g=s,g){let y=this.scene.getElementsFromId(g);y?.length?this.scrollToContent(y,{fitToContent:c?.fitToContent??!0,animate:c?.animate??!0}):Pl(s)&&this.setState({toast:{message:E("elementLink.notFound"),duration:3e3,closable:!0}})}return}this.cancelInProgressAnimation?.();let U=Array.isArray(s)?s:[s],f=this.state.zoom,p=this.state.scrollX,m=this.state.scrollY;if(c?.fitToContent||c?.fitToViewport){let{appState:g}=Ko({canvasOffsets:c.canvasOffsets,targetElements:U,appState:this.state,fitToViewport:!!c?.fitToViewport,viewportZoomFactor:c?.viewportZoomFactor,minZoom:c?.minZoom,maxZoom:c?.maxZoom});f=g.zoom,p=g.scrollX,m=g.scrollY}else{let g=Sr(U,this.state);p=g.scrollX,m=g.scrollY}if(c?.animate){let g=this.state.scrollX,y=this.state.scrollY,v=this.state.zoom.value,b=N7({fromValues:{scrollX:g,scrollY:y,zoom:v},toValues:{scrollX:p,scrollY:m,zoom:f.value},interpolateValue:(x,S,C,T)=>{if(T==="zoom")return x*Math.pow(S/x,Di(C))},onStep:({scrollX:x,scrollY:S,zoom:C})=>{this.setState({scrollX:x,scrollY:S,zoom:{value:C}})},onStart:()=>{this.setState({shouldCacheIgnoreZoom:!0})},onEnd:()=>{this.setState({shouldCacheIgnoreZoom:!1})},onCancel:()=>{this.setState({shouldCacheIgnoreZoom:!1})},duration:c?.duration??500});this.cancelInProgressAnimation=()=>{b(),this.cancelInProgressAnimation=null}}else this.setState({scrollX:p,scrollY:m,zoom:f})}),I(this,"maybeUnfollowRemoteUser",()=>{this.state.userToFollow&&this.setState({userToFollow:null})}),I(this,"translateCanvas",s=>{this.cancelInProgressAnimation?.(),this.maybeUnfollowRemoteUser(),this.setState(s)}),I(this,"setToast",s=>{this.setState({toast:s})}),I(this,"restoreFileFromShare",async()=>{try{let s=await caches.open("web-share-target"),c=await s.match("shared-file");if(c){let U=await c.blob(),f=new File([U],U.name||"",{type:U.type});this.loadFileToCanvas(f,null),await s.delete("shared-file"),window.history.replaceState(null,Id,window.location.pathname)}}catch(s){this.setState({errorMessage:s.message})}}),I(this,"addFiles",ot(s=>{let{addedFiles:c}=this.addMissingFiles(s);this.clearImageShapeCache(c),this.scene.triggerUpdate(),this.addNewImagesToImageCache()})),I(this,"addMissingFiles",(s,c=!1)=>{let U=c?{}:{...this.files},f={},p=Array.isArray(s)?s:Object.values(s);for(let m of p)if(!U[m.id]&&(f[m.id]=m,U[m.id]=m,m.mimeType===ne.svg))try{let g=AS(O0(NS(m.dataURL)),ne.svg);m.dataURL!==g&&(m.version=(m.version??1)+1,m.dataURL=g)}catch(g){console.error(g)}return this.files=U,{addedFiles:f}}),I(this,"updateScene",ot(s=>{let c=Un(s.elements??[]);if(s.captureUpdate&&s.captureUpdate!==B.EVENTUALLY){let U=this.store.snapshot.appState,f=this.store.snapshot.elements,p=s.appState?Object.assign({},U,s.appState):U,m=s.elements?this.store.filterUncomittedElements(this.scene.getElementsMapIncludingDeleted(),oe(c)):f;s.captureUpdate===B.IMMEDIATELY?this.store.captureIncrement(m,p):s.captureUpdate===B.NEVER&&this.store.updateSnapshot(m,p)}s.appState&&this.setState(s.appState),s.elements&&this.scene.replaceAllElements(c),s.collaborators&&this.setState({collaborators:s.collaborators})})),I(this,"triggerRender",s=>{s===!0?this.scene.triggerUpdate():this.setState({})}),I(this,"toggleSidebar",({name:s,tab:c,force:U})=>{let f;U===void 0?f=this.state.openSidebar?.name===s&&this.state.openSidebar?.tab===c?null:s:f=U?s:null;let p=f?{name:f}:null;return p&&c&&(p.tab=c),this.setState({openSidebar:p}),!!f}),I(this,"updateCurrentCursorPosition",ot(s=>{this.lastViewportPosition.x=s.clientX,this.lastViewportPosition.y=s.clientY})),I(this,"getEditorUIOffsets",()=>{let s=this.excalidrawContainerRef?.current?.querySelector(".App-toolbar")?.getBoundingClientRect()?.bottom??0,c=this.excalidrawContainerRef?.current?.querySelector(".sidebar")?.getBoundingClientRect(),U=this.excalidrawContainerRef?.current?.querySelector(".App-menu__left")?.getBoundingClientRect(),f=16;return Yr().rtl?{top:s+f,right:Math.max(this.state.width-(U?.left??this.state.width),0)+f,bottom:f,left:Math.max(c?.right??0,0)+f}:{top:s+f,right:Math.max(this.state.width-(c?.left??this.state.width)+f,0),bottom:f,left:Math.max(U?.right??0,0)+f}}),I(this,"onKeyDown",ot(s=>{if("Proxy"in window&&(!s.shiftKey&&/^[A-Z]$/.test(s.key)||s.shiftKey&&/^[a-z]$/.test(s.key))&&(s=new Proxy(s,{get(p,m){let g=p[m];return typeof g=="function"?g.bind(p):m==="key"?s.shiftKey?p.key.toUpperCase():p.key.toLowerCase():g}})),!Wd(s.target)){if((s.key===L.ESCAPE||s.key===L.ENTER)&&this.state.croppingElementId){this.finishImageCropping();return}let p=be(this.scene.getNonDeletedElementsMap(),this.state);if(p.length===1&&Le(p[0])&&s.key===L.ENTER){this.startImageCropping(p[0]);return}if(s.key===L.ESCAPE&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.clear(),this.triggerRender(!0);return}let m=gr(s.key);if(s[L.CTRL_OR_CMD]&&m&&!s.shiftKey){s.preventDefault();let g=be(this.scene.getNonDeletedElementsMap(),this.state);g.length===1&&Xs(g[0])&&this.flowChartCreator.createNodes(g[0],this.scene.getNonDeletedElementsMap(),this.state,a6(s.key)),this.flowChartCreator.pendingNodes?.length&&!zo(this.flowChartCreator.pendingNodes,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(this.flowChartCreator.pendingNodes,{animate:!0,duration:300,fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()});return}if(s.altKey){let g=be(this.scene.getNonDeletedElementsMap(),this.state);if(g.length===1&&m){s.preventDefault();let y=this.flowChartNavigator.exploreByDirection(g[0],this.scene.getNonDeletedElementsMap(),a6(s.key));if(y){this.setState(b=>({selectedElementIds:Ae({[y]:!0},b)}));let v=this.scene.getNonDeletedElementsMap().get(y);v&&!zo([v],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(v,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})}return}}}if(s[L.CTRL_OR_CMD]&&s.key===L.P&&!s.shiftKey&&!s.altKey){this.setToast({message:E("commandPalette.shortcutHint",{shortcut:Ft("commandPalette")})}),s.preventDefault();return}if(s[L.CTRL_OR_CMD]&&s.key.toLowerCase()===L.V&&(bd=s.shiftKey,clearTimeout(T5),T5=window.setTimeout(()=>{bd=!1},100)),s[L.CTRL_OR_CMD]&&Li(s.target)&&(s.code===ke.MINUS||s.code===ke.EQUAL)){s.preventDefault();return}if(Li(s.target)&&s.key!==L.ESCAPE||gr(s.key)&&Wd(s.target))return;if(s.key===L.QUESTION_MARK){this.setState({openDialog:{name:"help"}});return}else if(s.key.toLowerCase()===L.E&&s.shiftKey&&s[L.CTRL_OR_CMD]){s.preventDefault(),this.setState({openDialog:{name:"imageExport"}});return}if(s.key===L.PAGE_UP||s.key===L.PAGE_DOWN){let p=(s.shiftKey?this.state.width:this.state.height)/this.state.zoom.value;s.key===L.PAGE_DOWN&&(p=-p),s.shiftKey?this.translateCanvas(m=>({scrollX:m.scrollX+p})):this.translateCanvas(m=>({scrollY:m.scrollY+p}))}if(this.state.openDialog?.name==="elementLinkSelector"||this.actionManager.handleKeyDown(s)||this.state.viewModeEnabled)return;if(s[L.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),gr(s.key)){let p=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),m=p.find(q),g=new Set;p.filter(q).filter(x=>{let S=x.startBinding&&!p.some(T=>T.id===x.startBinding?.elementId),C=x.endBinding&&!p.some(T=>T.id===x.endBinding?.elementId);return S||C}).forEach(x=>g.add(x.id)),p=p.filter(x=>!g.has(x.id));let y=this.getEffectiveGridSize()&&(s.shiftKey?bu:this.getEffectiveGridSize())||(s.shiftKey?Zg:bu),v=0,b=0;s.key===L.ARROW_LEFT?v=-y:s.key===L.ARROW_RIGHT?v=y:s.key===L.ARROW_UP?b=-y:s.key===L.ARROW_DOWN&&(b=y),p.forEach(x=>{F(x,{x:x.x+v,y:x.y+b},!1),na(x,this.scene.getNonDeletedElementsMap(),{simultaneouslyUpdated:p})}),this.setState({suggestedBindings:Rc(p.filter(x=>x.id!==m?.id||y!==0),this.scene.getNonDeletedElementsMap(),this.state.zoom)}),this.scene.triggerUpdate(),s.preventDefault()}else if(s.key===L.ENTER){let p=this.scene.getSelectedElements(this.state);if(p.length===1){let m=p[0];if(s[L.CTRL_OR_CMD])he(m)&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==p[0].id)&&(this.store.shouldCaptureIncrement(),q(m)||this.setState({editingLinearElement:new Z(m)}));else if(j(m)||RE(m)){let g;j(m)||(g=m);let y=Oc(m,this.state,this.scene.getNonDeletedElementsMap()),v=y.x,b=y.y;this.startTextEditing({sceneX:v,sceneY:b,container:g}),s.preventDefault();return}else de(m)&&this.setState({editingFrame:m.id})}}else if(!s.ctrlKey&&!s.altKey&&!s.metaKey&&!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged){let p=lw(s.key);p?(this.state.activeTool.type!==p&&Ge("toolbar",p,`keyboard (${this.device.editor.isMobile?"mobile":"desktop"})`),p==="arrow"&&this.state.activeTool.type==="arrow"&&this.setState(m=>({currentItemArrowType:m.currentItemArrowType===Ct.sharp?Ct.round:m.currentItemArrowType===Ct.round?Ct.elbow:Ct.sharp})),this.setActiveTool({type:p}),s.stopPropagation()):s.key===L.Q&&(this.toggleLock("keyboard"),s.stopPropagation())}if(s.key===L.SPACE&&Re.pointers.size===0&&(nl=!0,Be(this.interactiveCanvas,Pe.GRAB),s.preventDefault()),(s.key===L.G||s.key===L.S)&&!s.altKey&&!s[L.CTRL_OR_CMD]){let p=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!p.length)return;s.key===L.G&&(Cl(this.state.activeTool.type)||p.some(m=>Cl(m.type)))&&(this.setState({openPopup:"elementBackground"}),s.stopPropagation()),s.key===L.S&&(this.setState({openPopup:"elementStroke"}),s.stopPropagation())}if(!s[L.CTRL_OR_CMD]&&s.shiftKey&&s.key.toLowerCase()===L.F){let p=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!p.length)return;(this.state.activeTool.type==="text"||p.find(m=>j(m)||pe(m,this.scene.getNonDeletedElementsMap())))&&(s.preventDefault(),this.setState({openPopup:"fontFamily"}))}if(s.key===L.K&&!s.altKey&&!s[L.CTRL_OR_CMD]){this.state.activeTool.type==="laser"?this.setActiveTool({type:"selection"}):this.setActiveTool({type:"laser"});return}s[L.CTRL_OR_CMD]&&(s.key===L.BACKSPACE||s.key===L.DELETE)&&Ga.set(sd,"clearCanvas");let c=s.key.toLocaleLowerCase(),U=c===L.S&&s.shiftKey,f=s.key===L.I||c===L.G&&s.shiftKey;(U||f)&&this.openEyeDropper({type:U?"stroke":"background"})})),I(this,"onKeyUp",ot(s=>{if(s.key===L.SPACE&&(this.state.viewModeEnabled||this.state.openDialog?.name==="elementLinkSelector"?Be(this.interactiveCanvas,Pe.GRAB):this.state.activeTool.type==="selection"?Ha(this.interactiveCanvas):(dn(this.interactiveCanvas,this.state),this.setState({selectedElementIds:Ae({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})),nl=!1),!s[L.CTRL_OR_CMD]&&!this.state.isBindingEnabled&&this.setState({isBindingEnabled:!0}),gr(s.key)&&(co(this.scene.getSelectedElements(this.state).filter(he),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,Gi(this.state),this.state.selectedLinearElement?.selectedPointsIndices??[],this.state.zoom),this.setState({suggestedBindings:[]})),s.altKey||this.flowChartNavigator.isExploring&&(this.flowChartNavigator.clear(),this.syncActionResult({captureUpdate:B.IMMEDIATELY})),!s[L.CTRL_OR_CMD]&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.pendingNodes?.length&&this.scene.insertElements(this.flowChartCreator.pendingNodes);let c=this.flowChartCreator.pendingNodes?.[0];c&&(this.setState(U=>({selectedElementIds:Ae({[c.id]:!0},U)})),zo([c],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())||this.scrollToContent(c,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})),this.flowChartCreator.clear(),this.syncActionResult({captureUpdate:B.IMMEDIATELY})}})),I(this,"isToolSupported",s=>this.props.UIOptions.tools?.[s]!==!1),I(this,"setActiveTool",s=>{if(!this.isToolSupported(s.type)){console.warn(`"${s.type}" tool is disabled via "UIOptions.canvasActions.tools.${s.type}"`);return}let c=ft(this.state,s);c.type==="hand"?Be(this.interactiveCanvas,Pe.GRAB):nl||dn(this.interactiveCanvas,{...this.state,activeTool:c}),A7(document.activeElement)&&this.focusContainer(),Yd(c.type)||this.setState({suggestedBindings:[]}),c.type==="image"&&this.onImageAction({insertOnCanvasDirectly:(s.type==="image"&&s.insertOnCanvasDirectly)??!1}),this.setState(U=>{let f={snapLines:U.snapLines.length?[]:U.snapLines,originSnapOffset:null,activeEmbeddable:null};return c.type==="freedraw"&&this.store.shouldCaptureIncrement(),c.type!=="selection"?{...U,activeTool:c,selectedElementIds:Ae({},U),selectedGroupIds:Ae({},U),editingGroupId:null,multiElement:null,...f}:{...U,activeTool:c,...f}})}),I(this,"setOpenDialog",s=>{this.setState({openDialog:s})}),I(this,"setCursor",s=>{Be(this.interactiveCanvas,s)}),I(this,"resetCursor",()=>{Ha(this.interactiveCanvas)}),I(this,"isTouchScreenMultiTouchGesture",()=>Re.pointers.size>=2),I(this,"getName",()=>this.state.name||this.props.name||`${E("labels.untitled")}-${Fu()}`),I(this,"onGestureStart",ot(s=>{s.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({selectedElementIds:Ae({},this.state),activeEmbeddable:null}),Re.initialScale=this.state.zoom.value})),I(this,"onGestureChange",ot(s=>{if(s.preventDefault(),this.isTouchScreenMultiTouchGesture())return;let c=Re.initialScale;c&&this.setState(U=>({...el({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:Bn(c*s.scale)},U)}))})),I(this,"onGestureEnd",ot(s=>{s.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({previousSelectedElementIds:{},selectedElementIds:Ae(this.state.previousSelectedElementIds,this.state)}),Re.initialScale=null})),I(this,"startTextEditing",({sceneX:s,sceneY:c,insertAtParentCenter:U=!0,container:f,autoEdit:p=!0})=>{let m=!1,g=U&&this.getTextWysiwygSnappedToCenterPosition(s,c,this.state,f);f&&g&&(pe(f,this.scene.getNonDeletedElementsMap())||(m=!0));let y=null,v=this.scene.getSelectedElements(this.state);v.length===1?j(v[0])?y=v[0]:f?y=pe(v[0],this.scene.getNonDeletedElementsMap()):y=this.getTextElementAtPosition(s,c):y=this.getTextElementAtPosition(s,c);let b=y?.fontFamily||this.state.currentItemFontFamily,x=y?.lineHeight||Hi(b),S=this.state.currentItemFontSize;if(!y&&m&&f&&!ge(f)){let k=iU(Oe({fontSize:S,fontFamily:b}),x),R=lU(S,x),D=Math.max(f.height,R),A=Math.max(f.width,k);F(f,{height:D,width:A}),s=f.x+A/2,c=f.y+D/2,g&&(g=this.getTextWysiwygSnappedToCenterPosition(s,c,this.state,f))}let C=this.getTopLayerFrameAtSceneCoords({x:s,y:c}),T=y||ua({x:g?g.elementCenterX:s,y:g?g.elementCenterY:c,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:"",fontSize:S,fontFamily:b,textAlign:g?"center":this.state.currentItemTextAlign,verticalAlign:g?ca.MIDDLE:ws,containerId:m?f?.id:void 0,groupIds:f?.groupIds??[],lineHeight:x,angle:f?.angle??0,frameId:C?C.id:null});if(!y&&m&&f&&F(f,{boundElements:(f.boundElements||[]).concat({type:"text",id:T.id})}),this.setState({editingTextElement:T}),!y)if(f&&m){let k=this.scene.getElementIndex(f.id);this.scene.insertElementAtIndex(T,k+1)}else this.scene.insertElement(T);p||y||f?this.handleTextWysiwyg(T,{isExistingElement:!!y}):this.setState({newElement:T,multiElement:null})}),I(this,"startImageCropping",s=>{this.store.shouldCaptureIncrement(),this.setState({croppingElementId:s.id})}),I(this,"finishImageCropping",()=>{this.state.croppingElementId&&(this.store.shouldCaptureIncrement(),this.setState({croppingElementId:null}))}),I(this,"handleCanvasDoubleClick",s=>{if(this.state.multiElement||this.state.activeTool.type!=="selection")return;let c=this.scene.getSelectedElements(this.state),{x:U,y:f}=$e(s,this.state);if(c.length===1&&he(c[0])){if(s[L.CTRL_OR_CMD]&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==c[0].id)&&!q(c[0])){this.store.shouldCaptureIncrement(),this.setState({editingLinearElement:new Z(c[0])});return}else if(this.state.selectedLinearElement&&q(c[0])){let p=Z.getSegmentMidpointHitCoords(this.state.selectedLinearElement,{x:U,y:f},this.state,this.scene.getNonDeletedElementsMap()),m=p?Z.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,p,this.scene.getNonDeletedElementsMap()):-1;if(m&&m>-1){this.store.shouldCaptureIncrement(),Z.deleteFixedSegment(c[0],m);let g=Z.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:U,y:f},this.state,this.scene.getNonDeletedElementsMap()),y=g?Z.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,g,this.scene.getNonDeletedElementsMap()):null;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:{...this.state.selectedLinearElement.pointerDownState,segmentMidpoint:{index:y,value:p,added:!1}},segmentMidPointHoveredCoords:g}});return}}}if(c.length===1&&Le(c[0])){this.startImageCropping(c[0]);return}if(Ha(this.interactiveCanvas),Vi(this.state).length>0){let p=this.getElementAtPosition(U,f),m=p&&hE(p,this.state.selectedGroupIds);if(m){this.store.shouldCaptureIncrement(),this.setState(g=>({...g,...Xt({editingGroupId:m,selectedElementIds:{[p.id]:!0}},this.scene.getNonDeletedElements(),g,this)}));return}}if(Ha(this.interactiveCanvas),!s[L.CTRL_OR_CMD]&&!this.state.viewModeEnabled){let p=this.getElementAtPosition(U,f);if(ya(p)){this.setState({activeEmbeddable:{element:p,state:"active"}});return}let m=this.getTextBindableContainerAtPosition(U,f);if(m&&(wa(m)||!Pa(m.backgroundColor)||Sl({x:U,y:f,element:m,shape:Rn(m,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()}))){let g=Oc(m,this.state,this.scene.getNonDeletedElementsMap());U=g.x,f=g.y}this.startTextEditing({sceneX:U,sceneY:f,insertAtParentCenter:!s.altKey,container:m})}}),I(this,"getElementLinkAtPosition",(s,c)=>{let U=this.scene.getNonDeletedElements(),f=-1;for(let p=U.length-1;p>=0;p--){let m=U[p];if(c&&m.id===c.id&&(f=p),m.link&&p>=f&&Kc(m,this.scene.getNonDeletedElementsMap(),this.state,w(s.x,s.y),this.device.editor.isMobile))return m}}),I(this,"redirectToLink",(s,c)=>{let U=Te(w(this.lastPointerDownEvent.clientX,this.lastPointerDownEvent.clientY),w(this.lastPointerUpEvent.clientX,this.lastPointerUpEvent.clientY));if(!this.hitLinkElement||U>Ci)return;let f=$e(this.lastPointerDownEvent,this.state),p=this.scene.getNonDeletedElementsMap(),m=Kc(this.hitLinkElement,p,this.state,w(f.x,f.y),this.device.editor.isMobile),g=$e(this.lastPointerUpEvent,this.state),y=Kc(this.hitLinkElement,p,this.state,w(g.x,g.y),this.device.editor.isMobile);if(m&&y){gm();let v=this.hitLinkElement.link;if(v){v=la(v);let b;if(this.props.onLinkOpen&&(b=Yu("excalidraw-link",s.nativeEvent),this.props.onLinkOpen({...this.hitLinkElement,link:v},b)),!b?.defaultPrevented){let x=r0(v)?"_self":"_blank",S=window.open(void 0,x);S&&(S.opener=null,S.location=v)}}}}),I(this,"getTopLayerFrameAtSceneCoords",s=>{let c=this.scene.getNonDeletedElementsMap(),U=this.scene.getNonDeletedFramesLikes().filter(f=>Mp(s,f,c));return U.length?U[U.length-1]:null}),I(this,"handleCanvasPointerMove",s=>{this.savePointer(s.clientX,s.clientY,this.state.cursorButton),this.lastPointerMoveEvent=s.nativeEvent,Re.pointers.has(s.pointerId)&&Re.pointers.set(s.pointerId,{x:s.clientX,y:s.clientY});let c=Re.initialScale;if(Re.pointers.size===2&&Re.lastCenter&&c&&Re.initialDistance){let b=qm(Re.pointers),x=b.x-Re.lastCenter.x,S=b.y-Re.lastCenter.y;Re.lastCenter=b;let C=Jm(Array.from(Re.pointers.values())),T=this.state.activeTool.type==="freedraw"&&this.state.penMode?1:C/Re.initialDistance,k=T?Bn(c*T):this.state.zoom.value;this.setState(R=>{let D=el({viewportX:b.x,viewportY:b.y,nextZoom:k},R);this.translateCanvas({zoom:D.zoom,scrollX:D.scrollX+2*(x/k),scrollY:D.scrollY+2*(S/k),shouldCacheIgnoreZoom:!0})}),this.resetShouldCacheIgnoreZoomDebounced()}else Re.lastCenter=Re.initialDistance=Re.initialScale=null;if(nl||hs||z1||ml(this.state))return;let U=o6(F1,s.clientX-this.state.offsetLeft,s.clientY-this.state.offsetTop).isOverEither;!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.multiElement&&(U?Ha(this.interactiveCanvas):dn(this.interactiveCanvas,this.state));let f=$e(s,this.state),{x:p,y:m}=f;if(!this.state.newElement&&ME(this.state.activeTool.type)){let{originOffset:b,snapLines:x}=SE(this.scene.getNonDeletedElements(),this,{x:p,y:m},s,this.scene.getNonDeletedElementsMap());this.setState(S=>{let C=Ur(S.snapLines,x),T=S.originSnapOffset?Ur(S.originSnapOffset,b):b;return S.snapLines===C&&S.originSnapOffset===T?null:{snapLines:C,originSnapOffset:T}})}else!this.state.newElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.selectionElement&&this.setState(b=>b.snapLines.length?{snapLines:[]}:null);if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){let b=Z.handlePointerMove(s,p,m,this,this.scene.getNonDeletedElementsMap());b&&b!==this.state.editingLinearElement&&xn(()=>{this.setState({editingLinearElement:b})}),b?.lastUncommittedPoint!=null?this.maybeSuggestBindingAtCursor(f,b.elbowed):xn(()=>{this.setState({suggestedBindings:[]})})}if(eU(this.state.activeTool.type)){let{newElement:b}=this.state;ln(b,!1)?this.maybeSuggestBindingsForLinearElementAtCoords(b,[f],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(f,!1)}if(this.state.multiElement){let{multiElement:b}=this.state,{x,y:S}=b,{points:C,lastCommittedPoint:T}=b,k=C[C.length-1];if(dn(this.interactiveCanvas,this.state),k===T)Te(w(p-x,m-S),k)>=ys?F(b,{points:[...C,w(p-x,m-S)]},!1):Be(this.interactiveCanvas,Pe.POINTER);else if(C.length>2&&T&&Te(w(p-x,m-S),T)<ys)Be(this.interactiveCanvas,Pe.POINTER),F(b,{points:C.slice(0,-1)},!1);else{let[R,D]=bt(p,m,s[L.CTRL_OR_CMD]||q(b)?null:this.getEffectiveGridSize()),[A,P]=b?.lastCommittedPoint??[0,0],$=R-x-A,X=D-S-P;yr(s)&&({width:$,height:X}=xh(A+x,P+S,R,D)),Nn(C,this.state.zoom.value)&&Be(this.interactiveCanvas,Pe.POINTER),F(b,{points:[...C.slice(0,-1),w(A+$,P+X)]},!1,{isDragging:!0}),this.triggerRender(!1)}return}if(s.buttons||this.state.activeTool.type!=="selection"&&this.state.activeTool.type!=="text"&&this.state.activeTool.type!=="eraser")return;let g=this.scene.getNonDeletedElements(),y=this.scene.getSelectedElements(this.state);if(y.length===1&&!U&&!this.state.editingLinearElement){if(this.state.selectedLinearElement&&this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,p,m),(!this.state.selectedLinearElement||this.state.selectedLinearElement.hoverPointIndex===-1)&&this.state.openDialog?.name!=="elementLinkSelector"&&!(y.length===1&&q(y[0]))){let b=Hp(g,this.state,p,m,this.state.zoom,s.pointerType,this.scene.getNonDeletedElementsMap(),this.device);if(b&&b.transformHandleType){Be(this.interactiveCanvas,Wp(b));return}}}else if(y.length>1&&!U&&this.state.openDialog?.name!=="elementLinkSelector"){let b=Xp(De(y),p,m,this.state.zoom,s.pointerType,this.device);if(b){Be(this.interactiveCanvas,Wp({transformHandleType:b}));return}}let v=this.getElementAtPosition(f.x,f.y);this.hitLinkElement=this.getElementLinkAtPosition(f,v),!an(this.state)&&(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?(Be(this.interactiveCanvas,Pe.POINTER),nk(this.hitLinkElement,this.state,this.scene.getNonDeletedElementsMap())):(gm(),v&&(v.link||ea(v))&&this.state.selectedElementIds[v.id]&&!this.state.contextMenu&&!this.state.showHyperlinkPopup?this.setState({showHyperlinkPopup:"info"}):this.state.activeTool.type==="text"?Be(this.interactiveCanvas,j(v)?Pe.TEXT:Pe.CROSSHAIR):this.state.viewModeEnabled?Be(this.interactiveCanvas,Pe.GRAB):this.state.openDialog?.name==="elementLinkSelector"?Be(this.interactiveCanvas,Pe.AUTO):U?Be(this.interactiveCanvas,Pe.AUTO):this.state.selectedLinearElement?this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,p,m):s[L.CTRL_OR_CMD]?Be(this.interactiveCanvas,Pe.AUTO):(v||this.isHittingCommonBoundingBoxOfSelectedElements(f,y))&&!v?.locked&&(v&&ya(v)&&this.isIframeLikeElementCenter(v,s,p,m)?(Be(this.interactiveCanvas,Pe.POINTER),this.setState({activeEmbeddable:{element:v,state:"hover"}})):(!v||!q(v))&&(Be(this.interactiveCanvas,Pe.MOVE),this.state.activeEmbeddable?.state==="hover"&&this.setState({activeEmbeddable:null})))),this.state.openDialog?.name==="elementLinkSelector"&&v?this.setState(b=>({hoveredElementIds:Ur(b.hoveredElementIds,Xt({editingGroupId:b.editingGroupId,selectedElementIds:{[v.id]:!0}},this.scene.getNonDeletedElements(),b,this).selectedElementIds)})):this.state.openDialog?.name==="elementLinkSelector"&&!v&&this.setState(b=>({hoveredElementIds:Ur(b.hoveredElementIds,{})})))}),I(this,"handleEraser",(s,c,U)=>{this.eraserTrail.addPointToPath(U.x,U.y);let f=!1,p=new Set,m=this.scene.getNonDeletedElements(),g=S=>{for(let C of S){if(C.locked)return;if(s.altKey?this.elementsPendingErasure.delete(C.id)&&(f=!0):this.elementsPendingErasure.has(C.id)||(f=!0,this.elementsPendingErasure.add(C.id)),f&&C.groupIds?.length){let T=C.groupIds.at(-1);if(!p.has(T)){p.add(T);let k=je(m,T);for(let R of k)s.altKey?this.elementsPendingErasure.delete(R.id):this.elementsPendingErasure.add(R.id)}}}},y=Te(w(c.lastCoords.x,c.lastCoords.y),w(U.x,U.y)),v=this.getElementHitThreshold(),b={...c.lastCoords},x=0;for(;x<=y;){let S=this.getElementsAtPosition(b.x,b.y);if(g(S),x===y)break;x=Math.min(x+v,y);let C=x/y,T=(1-C)*b.x+C*U.x,k=(1-C)*b.y+C*U.y;b.x=T,b.y=k}if(c.lastCoords.x=U.x,c.lastCoords.y=U.y,f){for(let S of this.scene.getNonDeletedElements())Ye(S)&&(this.elementsPendingErasure.has(S.id)||this.elementsPendingErasure.has(S.containerId))&&(s.altKey?(this.elementsPendingErasure.delete(S.id),this.elementsPendingErasure.delete(S.containerId)):(this.elementsPendingErasure.add(S.id),this.elementsPendingErasure.add(S.containerId)));this.elementsPendingErasure=new Set(this.elementsPendingErasure),this.triggerRender()}}),I(this,"handleTouchMove",s=>{us=!0}),I(this,"handleCanvasPointerDown",s=>{let c=s.target;if(c.setPointerCapture&&c.setPointerCapture(s.pointerId),this.maybeCleanupAfterMissingPointerUp(s.nativeEvent),this.maybeUnfollowRemoteUser(),this.state.searchMatches&&(this.setState(v=>({searchMatches:v.searchMatches.map(b=>({...b,focus:!1}))})),Ga.set(z6,null)),this.state.contextMenu&&this.setState({contextMenu:null}),this.state.snapLines&&this.setAppState({snapLines:[]}),this.updateGestureOnPointerDown(s),s.pointerType==="touch"&&this.state.newElement&&this.state.newElement.type==="freedraw"){let v=this.state.newElement;this.updateScene({...v.points.length<10?{elements:this.scene.getElementsIncludingDeleted().filter(b=>b.id!==v.id)}:{},appState:{newElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:Ae(Object.keys(this.state.selectedElementIds).filter(b=>b!==v.id).reduce((b,x)=>(b[x]=this.state.selectedElementIds[x],b),{}),this.state)},captureUpdate:this.state.openDialog?.name==="elementLinkSelector"?B.EVENTUALLY:B.NEVER});return}let U=document.getSelection();if(U?.anchorNode&&U.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(s),!this.state.penDetected&&s.pointerType==="pen"&&this.setState(v=>({penMode:!0,penDetected:!0})),!this.device.isTouchScreen&&["pen","touch"].includes(s.pointerType)&&(this.device=zs(this.device,{isTouchScreen:!0})),hs||(this.lastPointerDownEvent=s,this.handleCanvasPanUsingWheelOrSpaceDrag(s)))return;if(this.setState({lastPointerDownWith:s.pointerType,cursorButton:"down"}),this.savePointer(s.clientX,s.clientY,"down"),s.button===ni.ERASER&&this.state.activeTool.type!==Et.eraser){this.setState({activeTool:ft(this.state,{type:Et.eraser,lastActiveToolBeforeEraser:this.state.activeTool})},()=>{this.handleCanvasPointerDown(s);let v=()=>{b(),x?.(),an(this.state)&&this.setState({activeTool:ft(this.state,{...this.state.activeTool.lastActiveTool||{type:Et.selection},lastActiveToolBeforeEraser:null})})},b=Je(window,"pointerup",v,{once:!0}),x;requestAnimationFrame(()=>{x=this.missingPointerEventCleanupEmitter.once(v)})});return}if(s.button!==ni.MAIN&&s.button!==ni.TOUCH&&s.button!==ni.ERASER||Re.pointers.size>1)return;let f=this.initialPointerDownState(s);if(this.setState({selectedElementsAreBeingDragged:!1}),this.handleDraggingScrollBar(s,f)||(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(s),this.handleSelectionOnPointerDown(s,f))||!(!this.state.penMode||s.pointerType!=="touch"||this.state.activeTool.type==="selection"||this.state.activeTool.type==="text"||this.state.activeTool.type==="image"))return;if(this.state.activeTool.type==="text")this.handleTextOnPointerDown(s,f);else if(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")this.handleLinearElementOnPointerDown(s,this.state.activeTool.type,f);else if(this.state.activeTool.type==="image"){Be(this.interactiveCanvas,Pe.CROSSHAIR);let v=this.state.pendingImageElementId&&this.scene.getElement(this.state.pendingImageElementId);if(!v)return;this.setState({newElement:v,pendingImageElementId:null,multiElement:null});let{x:b,y:x}=$e(s,this.state),S=this.getTopLayerFrameAtSceneCoords({x:b,y:x});F(v,{x:b,y:x,frameId:S?S.id:null})}else this.state.activeTool.type==="freedraw"?this.handleFreeDrawElementOnPointerDown(s,this.state.activeTool.type,f):this.state.activeTool.type==="custom"?dn(this.interactiveCanvas,this.state):this.state.activeTool.type===Et.frame||this.state.activeTool.type===Et.magicframe?this.createFrameElementOnPointerDown(f,this.state.activeTool.type):this.state.activeTool.type==="laser"?this.laserTrails.startPath(f.lastCoords.x,f.lastCoords.y):this.state.activeTool.type!=="eraser"&&this.state.activeTool.type!=="hand"&&this.createGenericElementOnPointerDown(this.state.activeTool.type,f);this.props?.onPointerDown?.(this.state.activeTool,f),this.onPointerDownEmitter.trigger(this.state.activeTool,f,s),this.state.activeTool.type==="eraser"&&this.eraserTrail.startPath(f.lastCoords.x,f.lastCoords.y);let p=this.onPointerMoveFromPointerDownHandler(f),m=this.onPointerUpFromPointerDownHandler(f),g=this.onKeyDownFromPointerDownHandler(f),y=this.onKeyUpFromPointerDownHandler(f);this.missingPointerEventCleanupEmitter.once(v=>m(v||s.nativeEvent)),(!this.state.viewModeEnabled||this.state.activeTool.type==="laser")&&(window.addEventListener("pointermove",p),window.addEventListener("pointerup",m),window.addEventListener("keydown",g),window.addEventListener("keyup",y),f.eventListeners.onMove=p,f.eventListeners.onUp=m,f.eventListeners.onKeyUp=y,f.eventListeners.onKeyDown=g)}),I(this,"handleCanvasPointerUp",s=>{this.removePointer(s),this.lastPointerUpEvent=s;let c=$e({clientX:s.clientX,clientY:s.clientY},this.state),U=s.timeStamp-(this.lastPointerDownEvent?.timeStamp??0);if(this.device.editor.isMobile&&U<300){let f=this.getElementAtPosition(c.x,c.y);if(ya(f)&&this.isIframeLikeElementCenter(f,s,c.x,c.y)){this.handleEmbeddableCenterClick(f);return}}if(this.device.isTouchScreen){let f=this.getElementAtPosition(c.x,c.y);this.hitLinkElement=this.getElementLinkAtPosition(c,f)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?U<300&&ya(this.hitLinkElement)&&!F0(this.hitLinkElement,this.scene.getNonDeletedElementsMap(),this.state,w(c.x,c.y))?this.handleEmbeddableCenterClick(this.hitLinkElement):this.redirectToLink(s,this.device.isTouchScreen):this.state.viewModeEnabled&&this.setState({activeEmbeddable:null,selectedElementIds:{}})}),I(this,"maybeOpenContextMenuAfterPointerDownOnTouchDevices",s=>{s.pointerType==="touch"&&(us=!1,Ei?us=!0:Ei=window.setTimeout(()=>{Ei=0,us||this.handleCanvasContextMenu(s)},i7))}),I(this,"resetContextMenuTimer",()=>{clearTimeout(Ei),Ei=0,us=!1}),I(this,"maybeCleanupAfterMissingPointerUp",s=>{Us?.(),this.missingPointerEventCleanupEmitter.trigger(s).clear()}),I(this,"handleCanvasPanUsingWheelOrSpaceDrag",s=>{if(!(Re.pointers.size<=1&&(s.button===ni.WHEEL||s.button===ni.MAIN&&nl||ml(this.state)||this.state.viewModeEnabled)))return!1;hs=!0,this.focusContainer(),this.state.editingTextElement||s.preventDefault();let c=!1,U=typeof window===void 0?!1:/Linux/.test(window.navigator.platform);Be(this.interactiveCanvas,Pe.GRABBING);let{clientX:f,clientY:p}=s,m=C1(y=>{let v=f-y.clientX,b=p-y.clientY;if(f=y.clientX,p=y.clientY,U&&!c&&(Math.abs(v)>1||Math.abs(b)>1)){c=!0;let x=C=>{document.body.removeEventListener("paste",x),C.stopPropagation()},S=()=>{setTimeout(()=>{document.body.removeEventListener("paste",x),window.removeEventListener("pointerup",S)},100)};document.body.addEventListener("paste",x),window.addEventListener("pointerup",S)}this.translateCanvas({scrollX:this.state.scrollX-v/this.state.zoom.value,scrollY:this.state.scrollY-b/this.state.zoom.value})}),g=ot(Us=()=>{Us=null,hs=!1,nl||(this.state.viewModeEnabled?Be(this.interactiveCanvas,Pe.GRAB):dn(this.interactiveCanvas,this.state)),this.setState({cursorButton:"up"}),this.savePointer(s.clientX,s.clientY,"up"),window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",g),window.removeEventListener("blur",g),m.flush()});return window.addEventListener("blur",g),window.addEventListener("pointermove",m,{passive:!0}),window.addEventListener("pointerup",g),!0}),I(this,"clearSelectionIfNotUsingSelection",()=>{this.state.activeTool.type!=="selection"&&this.setState({selectedElementIds:Ae({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}),I(this,"handleSelectionOnPointerDown",(s,c)=>{if(this.state.activeTool.type==="selection"){let U=this.scene.getNonDeletedElements(),f=this.scene.getNonDeletedElementsMap(),p=this.scene.getSelectedElements(this.state);if(p.length===1&&!this.state.editingLinearElement&&!q(p[0])&&!(this.state.selectedLinearElement&&this.state.selectedLinearElement.hoverPointIndex!==-1)){let m=Hp(U,this.state,c.origin.x,c.origin.y,this.state.zoom,s.pointerType,this.scene.getNonDeletedElementsMap(),this.device);m!=null&&(m.transformHandleType==="rotation"?(this.setState({resizingElement:m.element}),c.resize.handleType=m.transformHandleType):(this.state.croppingElementId||this.setState({resizingElement:m.element}),c.resize.handleType=m.transformHandleType))}else p.length>1&&(c.resize.handleType=Xp(De(p),c.origin.x,c.origin.y,this.state.zoom,s.pointerType,this.device));if(c.resize.handleType)c.resize.isResizing=!0,c.resize.offset=Na(bS(c.resize.handleType,p,f,c.origin.x,c.origin.y)),p.length===1&&he(p[0])&&p[0].points.length===2&&(c.resize.arrowDirection=yS(c.resize.handleType,p[0]));else{if(this.state.selectedLinearElement){let y=this.state.editingLinearElement||this.state.selectedLinearElement,v=Z.handlePointerDown(s,this,this.store,c.origin,y,this.scene);if(v.hitElement&&(c.hit.element=v.hitElement),v.linearElementEditor&&(this.setState({selectedLinearElement:v.linearElementEditor}),this.state.editingLinearElement&&this.setState({editingLinearElement:v.linearElementEditor})),v.didAddPoint)return!0}if(c.hit.element=c.hit.element??this.getElementAtPosition(c.origin.x,c.origin.y),this.hitLinkElement=this.getElementLinkAtPosition(c.origin,c.hit.element),this.hitLinkElement)return!0;if(this.state.croppingElementId&&c.hit.element?.id!==this.state.croppingElementId&&this.finishImageCropping(),c.hit.element&&this.getElementLinkAtPosition({x:c.origin.x,y:c.origin.y},c.hit.element))return!1;c.hit.allHitElements=this.getElementsAtPosition(c.origin.x,c.origin.y);let m=c.hit.element,g=c.hit.allHitElements.some(y=>this.isASelectedElement(y));if((m===null||!g)&&!s.shiftKey&&!c.hit.hasHitCommonBoundingBoxOfSelectedElements&&this.clearSelection(m),this.state.editingLinearElement)this.setState({selectedElementIds:Ae({[this.state.editingLinearElement.elementId]:!0},this.state)});else if(m!=null){if(s[L.CTRL_OR_CMD])return this.state.selectedElementIds[m.id]||(c.hit.wasAddedToSelection=!0),this.setState(y=>({...cE(y,m),previousSelectedElementIds:this.state.selectedElementIds})),!1;this.state.selectedElementIds[m.id]||(this.state.editingGroupId&&!Mr(m,this.state.editingGroupId)&&this.setState({selectedElementIds:Ae({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),!g&&!c.hit.hasHitCommonBoundingBoxOfSelectedElements&&(this.setState(y=>{let v={...y.selectedElementIds,[m.id]:!0},b=[];if(Object.keys(y.selectedElementIds).forEach(x=>{let S=this.scene.getElement(x);S&&b.push(S)}),de(m))mn(b,m.id).forEach(x=>{delete v[x.id]});else if(m.frameId)v[m.frameId]&&delete v[m.id];else{let x=m.groupIds,S=new Set(x.flatMap(C=>je(this.scene.getNonDeletedElements(),C)).filter(C=>de(C)).map(C=>C.id));S.size>0&&b.forEach(C=>{C.frameId&&S.has(C.frameId)&&(delete v[C.id],C.groupIds.flatMap(T=>je(this.scene.getNonDeletedElements(),T)).forEach(T=>{delete v[T.id]}))})}return y.openDialog?.name==="elementLinkSelector"&&(m.groupIds.some(x=>y.selectedGroupIds[x])||(v={[m.id]:!0})),{...Xt({editingGroupId:y.editingGroupId,selectedElementIds:v},this.scene.getNonDeletedElements(),y,this),showHyperlinkPopup:m.link||ea(m)?"info":!1}}),c.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1}),I(this,"handleTextOnPointerDown",(s,c)=>{if(this.state.editingTextElement)return;let U=c.origin.x,f=c.origin.y,p=this.getElementAtPosition(U,f,{includeBoundTextElement:!0}),m=this.getTextBindableContainerAtPosition(U,f);wa(p)&&(m=p,U=p.x+p.width/2,f=p.y+p.height/2),this.startTextEditing({sceneX:U,sceneY:f,insertAtParentCenter:!s.altKey,container:m,autoEdit:!1}),Ha(this.interactiveCanvas),this.state.activeTool.locked||this.setState({activeTool:ft(this.state,{type:"selection"})})}),I(this,"handleFreeDrawElementOnPointerDown",(s,c,U)=>{let[f,p]=bt(U.origin.x,U.origin.y,null),m=this.getTopLayerFrameAtSceneCoords({x:f,y:p}),g=s.pressure===.5,y=HE({type:c,x:f,y:p,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:null,simulatePressure:g,locked:!1,frameId:m?m.id:null,points:[w(0,0)],pressures:g?[]:[s.pressure]});this.scene.insertElement(y),this.setState(b=>{let x={...b.selectedElementIds};return delete x[y.id],{selectedElementIds:Ae(x,b)}});let v=$a(U.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom);this.setState({newElement:y,startBoundElement:v,suggestedBindings:[]})}),I(this,"insertIframeElement",({sceneX:s,sceneY:c,width:U,height:f})=>{let[p,m]=bt(s,c,this.lastPointerDownEvent?.[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=zE({type:"iframe",x:p,y:m,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("iframe"),opacity:this.state.currentItemOpacity,locked:!1,width:U,height:f});return this.scene.insertElement(g),g}),I(this,"insertEmbeddableElement",({sceneX:s,sceneY:c,link:U})=>{let[f,p]=bt(s,c,this.lastPointerDownEvent?.[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=Nl(U);if(!m)return;m.error instanceof URIError&&this.setToast({message:E("toast.unrecognizedLinkFormat"),closable:!0});let g=h0({type:"embeddable",x:f,y:p,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("embeddable"),opacity:this.state.currentItemOpacity,locked:!1,width:m.intrinsicSize.w,height:m.intrinsicSize.h,link:U});return this.scene.insertElement(g),g}),I(this,"createImageElement",({sceneX:s,sceneY:c,addToFrameUnderCursor:U=!0})=>{let[f,p]=bt(s,c,this.lastPointerDownEvent?.[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=U?this.getTopLayerFrameAtSceneCoords({x:f,y:p}):null;return f0({type:"image",x:f,y:p,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:null,opacity:this.state.currentItemOpacity,locked:!1,frameId:m?m.id:null})}),I(this,"handleLinearElementOnPointerDown",(s,c,U)=>{if(this.state.multiElement){let{multiElement:f}=this.state;if(f.type==="line"&&Nn(f.points,this.state.zoom.value)){F(f,{lastCommittedPoint:f.points[f.points.length-1]}),this.actionManager.executeAction(Ya);return}if(q(f)&&f.points.length>1){F(f,{lastCommittedPoint:f.points[f.points.length-1]}),this.actionManager.executeAction(Ya);return}let{x:p,y:m,lastCommittedPoint:g}=f;if(f.points.length>1&&g&&Te(w(U.origin.x-p,U.origin.y-m),g)<ys){this.actionManager.executeAction(Ya);return}this.setState(y=>({selectedElementIds:Ae({...y.selectedElementIds,[f.id]:!0},y)})),F(f,{lastCommittedPoint:f.points[f.points.length-1]}),Be(this.interactiveCanvas,Pe.POINTER)}else{let[f,p]=bt(U.origin.x,U.origin.y,s[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=this.getTopLayerFrameAtSceneCoords({x:f,y:p}),{currentItemStartArrowhead:g,currentItemEndArrowhead:y}=this.state,[v,b]=c==="arrow"?[g,y]:[null,null],x=c==="arrow"?Hc({type:c,x:f,y:p,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemArrowType===Ct.round?{type:Ut.PROPORTIONAL_RADIUS}:null,startArrowhead:v,endArrowhead:b,locked:!1,frameId:m?m.id:null,elbowed:this.state.currentItemArrowType===Ct.elbow,fixedSegments:this.state.currentItemArrowType===Ct.elbow?[]:null}):ji({type:c,x:f,y:p,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemRoundness==="round"?{type:Ut.PROPORTIONAL_RADIUS}:null,locked:!1,frameId:m?m.id:null});this.setState(C=>{let T={...C.selectedElementIds};return delete T[x.id],{selectedElementIds:Ae(T,C)}}),F(x,{points:[...x.points,w(0,0)]});let S=$a(U.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,q(x),q(x));this.scene.insertElement(x),this.setState({newElement:x,startBoundElement:S,suggestedBindings:[]})}}),I(this,"createGenericElementOnPointerDown",(s,c)=>{let[U,f]=bt(c.origin.x,c.origin.y,this.lastPointerDownEvent?.[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),p=this.getTopLayerFrameAtSceneCoords({x:U,y:f}),m={x:U,y:f,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.getCurrentItemRoundness(s),locked:!1,frameId:p?p.id:null},g;s==="embeddable"?g=h0({type:"embeddable",...m}):g=hn({type:s,...m}),g.type==="selection"?this.setState({selectionElement:g}):(this.scene.insertElement(g),this.setState({multiElement:null,newElement:g}))}),I(this,"createFrameElementOnPointerDown",(s,c)=>{let[U,f]=bt(s.origin.x,s.origin.y,this.lastPointerDownEvent?.[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),p={x:U,y:f,opacity:this.state.currentItemOpacity,locked:!1,...qe},m=c===Et.magicframe?$c(p):Fc(p);this.scene.insertElement(m),this.setState({multiElement:null,newElement:m})}),I(this,"restoreReadyToEraseElements",()=>{this.elementsPendingErasure=new Set,this.triggerRender()}),I(this,"eraseElements",()=>{let s=!1,c=this.scene.getElementsIncludingDeleted().map(U=>this.elementsPendingErasure.has(U.id)||U.frameId&&this.elementsPendingErasure.has(U.frameId)||Ye(U)&&this.elementsPendingErasure.has(U.containerId)?(s=!0,fe(U,{isDeleted:!0})):U);this.elementsPendingErasure=new Set,s&&(this.store.shouldCaptureIncrement(),this.scene.replaceAllElements(c))}),I(this,"initializeImage",async({imageFile:s,imageElement:c,showCursorImagePreview:U=!1})=>{if(!Ji(s))throw new Error(E("errors.unsupportedFileType"));let f=s.type;if(Be(this.interactiveCanvas,"wait"),f===ne.svg)try{s=n2(O0(await s.text()),s.name)}catch(y){throw console.warn(y),new Error(E("errors.svgImageInsertError"))}let p=await(this.props.generateIdForFile?.(s)||DS(s));if(!p)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(E("errors.imageInsertError"));if(!this.files[p]?.dataURL){try{s=await Bh(s,{maxWidthOrHeight:h7})}catch(y){console.error("Error trying to resizing image file on insertion",y)}if(s.size>xu)throw new Error(E("errors.fileTooBig",{maxSize:`${Math.trunc(xu/1024/1024)}MB`}))}if(U){let y=this.files[p]?.dataURL,v=y&&RS(y);this.setImagePreviewCursor(v||s)}let m=this.files[p]?.dataURL||await Oh(s),g=F(c,{fileId:p},!1);return new Promise(async(y,v)=>{try{this.addMissingFiles([{mimeType:f,id:p,dataURL:m,created:Date.now(),lastRetrieved:Date.now()}]);let b=this.imageCache.get(p);b||(this.addNewImagesToImageCache(),await this.updateImageCache([g])),b?.image instanceof Promise&&await b.image,this.state.pendingImageElementId!==g.id&&this.state.newElement?.id!==g.id&&this.initializeImageDimensions(g,!0),y(g)}catch(b){console.error(b),v(new Error(E("errors.imageInsertError")))}finally{U||Ha(this.interactiveCanvas)}})}),I(this,"insertImageElement",async(s,c,U)=>{if(!this.isToolSupported("image")){this.setState({errorMessage:E("errors.imageToolNotSupported")});return}this.scene.insertElement(s);try{return await this.initializeImage({imageFile:c,imageElement:s,showCursorImagePreview:U})}catch(f){return F(s,{isDeleted:!0}),this.actionManager.executeAction(Ya),this.setState({errorMessage:f.message||E("errors.imageInsertError")}),null}}),I(this,"setImagePreviewCursor",async s=>{let c;try{c=await Bh(s,{maxWidthOrHeight:96})}catch(f){throw f.cause==="UNSUPPORTED"?new Error(E("errors.unsupportedFileType")):f}let U=await Oh(c);if(s.type===ne.svg){let f=await N0(U),p=Math.min(f.height,96),m=p*(f.width/f.height);m>96&&(m=96,p=m*(f.height/f.width));let g=document.createElement("canvas");g.height=p,g.width=m,g.getContext("2d").drawImage(f,0,0,m,p),U=g.toDataURL(ne.svg)}this.state.pendingImageElementId&&Be(this.interactiveCanvas,`url(${U}) 4 4, auto`)}),I(this,"onImageAction",async({insertOnCanvasDirectly:s})=>{try{let c=this.state.width/2+this.state.offsetLeft,U=this.state.height/2+this.state.offsetTop,{x:f,y:p}=$e({clientX:c,clientY:U},this.state),m=await Yc({description:"Image",extensions:Object.keys(ul)}),g=this.createImageElement({sceneX:f,sceneY:p,addToFrameUnderCursor:!1});s?(this.insertImageElement(g,m),this.initializeImageDimensions(g),this.setState({selectedElementIds:Ae({[g.id]:!0},this.state)},()=>{this.actionManager.executeAction(Ya)})):this.setState({pendingImageElementId:g.id},()=>{this.insertImageElement(g,m,!0)})}catch(c){c.name!=="AbortError"?console.error(c):console.warn(c),this.setState({pendingImageElementId:null,newElement:null,activeTool:ft(this.state,{type:"selection"})},()=>{this.actionManager.executeAction(Ya)})}}),I(this,"initializeImageDimensions",(s,c=!1)=>{let U=ba(s)&&this.imageCache.get(s.fileId)?.image;if(!U||U instanceof Promise){if(s.width<Ci/this.state.zoom.value&&s.height<Ci/this.state.zoom.value){let f=100/this.state.zoom.value;F(s,{x:s.x-f/2,y:s.y-f/2,width:f,height:f})}return}if(c||s.width<Ci/this.state.zoom.value&&s.height<Ci/this.state.zoom.value){let f=Math.max(this.state.height-120,160),p=Math.min(f,Math.floor(this.state.height*.5)/this.state.zoom.value),m=Math.min(U.naturalHeight,p),g=m*(U.naturalWidth/U.naturalHeight),y=s.x+s.width/2-g/2,v=s.y+s.height/2-m/2;F(s,{x:y,y:v,width:g,height:m,crop:null})}}),I(this,"updateImageCache",async(s,c=this.files)=>{let{updatedFiles:U,erroredFiles:f}=await P0({imageCache:this.imageCache,fileIds:s.map(p=>p.fileId),files:c});if(U.size||f.size)for(let p of s)U.has(p.fileId)&&Qe.delete(p);return f.size&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(p=>ba(p)&&f.has(p.fileId)?fe(p,{status:"error"}):p)),{updatedFiles:U,erroredFiles:f}}),I(this,"addNewImagesToImageCache",async(s=_0(this.scene.getNonDeletedElements()),c=this.files)=>{let U=s.filter(f=>!f.isDeleted&&!this.imageCache.has(f.fileId));if(U.length){let{updatedFiles:f}=await this.updateImageCache(U,c);f.size&&this.scene.triggerUpdate()}}),I(this,"scheduleImageRefresh",Kl(()=>{this.addNewImagesToImageCache()},a7)),I(this,"updateBindingEnabledOnPointerMove",s=>{let c=zw(s);this.state.isBindingEnabled!==c&&this.setState({isBindingEnabled:c})}),I(this,"maybeSuggestBindingAtCursor",(s,c)=>{let U=$a(s,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,!1,c);this.setState({suggestedBindings:U!=null?[U]:[]})}),I(this,"maybeSuggestBindingsForLinearElementAtCoords",(s,c,U)=>{if(!c.length)return;let f=c.reduce((p,m)=>{let g=$a(m,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,q(s),q(s));return g!=null&&!Bf(s,U?.id,g)&&p.push(g),p},[]);this.setState({suggestedBindings:f})}),I(this,"handleInteractiveCanvasRef",s=>{s!==null?(this.interactiveCanvas=s,this.interactiveCanvas.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.interactiveCanvas.addEventListener("touchend",this.onTouchEnd)):(this.interactiveCanvas?.removeEventListener("touchstart",this.onTouchStart),this.interactiveCanvas?.removeEventListener("touchend",this.onTouchEnd))}),I(this,"handleAppOnDrop",async s=>{let{file:c,fileHandle:U}=await _S(s),{x:f,y:p}=$e(s,this.state);try{if(Ji(c)&&this.isToolSupported("image")){if(c?.type===ne.png||c?.type===ne.svg)try{let y=await _h(c,this.state,this.scene.getElementsIncludingDeleted(),U);this.syncActionResult({...y,appState:{...y.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:B.IMMEDIATELY});return}catch(y){if(y.name!=="EncodingError")throw new Error(E("alerts.couldNotLoadInvalidFile"))}let g=this.createImageElement({sceneX:f,sceneY:p});this.insertImageElement(g,c),this.initializeImageDimensions(g),this.setState({selectedElementIds:Ae({[g.id]:!0},this.state)});return}}catch(g){return this.setState({isLoading:!1,errorMessage:g.message})}let m=s.dataTransfer.getData(ne.excalidrawlib);if(m&&typeof m=="string"){try{let g=t2(m);this.addElementsFromPasteOrLibrary({elements:Mm(g),position:s,files:null})}catch(g){this.setState({errorMessage:g.message})}return}if(c&&await this.loadFileToCanvas(c,U),s.dataTransfer?.types?.includes("text/plain")){let g=s.dataTransfer?.getData("text");if(g&&So(g,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(g)||Nl(g)?.type==="video")){let y=this.insertEmbeddableElement({sceneX:f,sceneY:p,link:la(g)});y&&this.setState({selectedElementIds:{[y.id]:!0}})}}}),I(this,"loadFileToCanvas",async(s,c)=>{s=await zh(s);try{let U=this.scene.getElementsIncludingDeleted(),f;try{f=await Ph(s,this.state,U,c)}catch(p){let m=p instanceof $i;if(m&&p.code==="IMAGE_NOT_CONTAINS_SCENE_DATA"&&!this.isToolSupported("image")){this.setState({isLoading:!1,errorMessage:E("errors.imageToolNotSupported")});return}let g=E(m?"alerts.cannotRestoreFromImage":"alerts.couldNotLoadInvalidFile");this.setState({isLoading:!1,errorMessage:g})}if(!f)return;f.type===ne.excalidraw?(Un(U.concat(f.data.elements)),this.store.updateSnapshot(oe(U),this.state),this.setState({isLoading:!0}),this.syncActionResult({...f.data,appState:{...f.data.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:B.IMMEDIATELY})):f.type===ne.excalidrawlib&&await this.library.updateLibrary({libraryItems:s,merge:!0,openLibraryMenu:!0}).catch(p=>{console.error(p),this.setState({errorMessage:E("errors.importLibraryError")})})}catch(U){this.setState({isLoading:!1,errorMessage:U.message})}}),I(this,"handleCanvasContextMenu",s=>{if(s.preventDefault(),("pointerType"in s.nativeEvent&&s.nativeEvent.pointerType==="touch"||"pointerType"in s.nativeEvent&&s.nativeEvent.pointerType==="pen"&&s.button!==ni.SECONDARY)&&this.state.activeTool.type!=="selection")return;let{x:c,y:U}=$e(s,this.state),f=this.getElementAtPosition(c,U,{preferSelected:!0,includeLockedElements:!0}),p=this.scene.getSelectedElements(this.state),m=this.isHittingCommonBoundingBoxOfSelectedElements({x:c,y:U},p),g=f||m?"element":"canvas",y=this.excalidrawContainerRef.current,{top:v,left:b}=y.getBoundingClientRect(),x=s.clientX-b,S=s.clientY-v;Ge("contextMenu","openContextMenu",g),this.setState({...f&&!this.state.selectedElementIds[f.id]?{...this.state,...Xt({editingGroupId:this.state.editingGroupId,selectedElementIds:{[f.id]:!0}},this.scene.getNonDeletedElements(),this.state,this),selectedLinearElement:he(f)?new Z(f):null}:this.state,showHyperlinkPopup:!1},()=>{this.setState({contextMenu:{top:S,left:x,items:this.getContextMenuItems(g)}})})}),I(this,"maybeDragNewGenericElement",(s,c,U=!0)=>{let f=this.state.selectionElement,p=s.lastCoords;if(f&&this.state.activeTool.type!=="eraser"){jp({newElement:f,elementType:this.state.activeTool.type,originX:s.origin.x,originY:s.origin.y,x:p.x,y:p.y,width:Ot(s.origin.x,p.x),height:Ot(s.origin.y,p.y),shouldMaintainAspectRatio:br(c),shouldResizeFromCenter:wc(c),zoom:this.state.zoom.value,informMutation:U});return}let m=this.state.newElement;if(!m)return;let[g,y]=bt(p.x,p.y,c[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=ba(m)&&this.imageCache.get(m.fileId)?.image,b=v&&!(v instanceof Promise)?v.width/v.height:null;this.maybeCacheReferenceSnapPoints(c,[m]);let{snapOffset:x,snapLines:S}=xE(m,this,c,{x:s.originInGrid.x+(this.state.originSnapOffset?.x??0),y:s.originInGrid.y+(this.state.originSnapOffset?.y??0)},{x:g-s.originInGrid.x,y:y-s.originInGrid.y},this.scene.getNonDeletedElementsMap());g+=x.x,y+=x.y,this.setState({snapLines:S}),jp({newElement:m,elementType:this.state.activeTool.type,originX:s.originInGrid.x,originY:s.originInGrid.y,x:g,y,width:Ot(s.originInGrid.x,g),height:Ot(s.originInGrid.y,y),shouldMaintainAspectRatio:Le(m)?!br(c):br(c),shouldResizeFromCenter:wc(c),zoom:this.state.zoom.value,widthAspectRatio:b,originOffset:this.state.originSnapOffset,informMutation:U}),this.setState({newElement:m}),(this.state.activeTool.type===Et.frame||this.state.activeTool.type===Et.magicframe)&&this.setState({elementsToHighlight:No(this.scene.getNonDeletedElements(),m,this.state,this.scene.getNonDeletedElementsMap())})}),I(this,"maybeHandleCrop",(s,c)=>{if(!this.state.croppingElementId)return!1;let U=s.resize.handleType,f=s.lastCoords,[p,m]=bt(f.x-s.resize.offset.x,f.y-s.resize.offset.y,c[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(U&&g&&Le(g)){let y=s.originalElements.get(g.id),v=ba(g)&&this.imageCache.get(g.fileId)?.image;if(y&&Le(y)&&v&&!(v instanceof Promise)){let[b,x]=bt(f.x,f.y,c[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),S={x:b-s.originInGrid.x,y:x-s.originInGrid.y};this.maybeCacheReferenceSnapPoints(c,[g]);let{snapOffset:C,snapLines:T}=a0([g],[y],this,c,S,U);F(g,dw(g,U,v.naturalWidth,v.naturalHeight,p+C.x,m+C.y,c.shiftKey?y.width/y.height:void 0)),na(g,this.scene.getNonDeletedElementsMap(),{newSize:{width:g.width,height:g.height}}),this.setState({isCropping:U&&U!=="rotation",snapLines:T})}return!0}return!1}),I(this,"maybeHandleResize",(s,c)=>{let U=this.scene.getSelectedElements(this.state),f=U.filter(b=>de(b)),p=s.resize.handleType;if(f.length>0&&p==="rotation"||U.length===1&&q(U[0])||this.state.croppingElementId)return!1;this.setState({isResizing:p&&p!=="rotation",isRotating:p==="rotation",activeEmbeddable:null});let m=s.lastCoords,[g,y]=bt(m.x-s.resize.offset.x,m.y-s.resize.offset.y,c[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=new Map;if(f.forEach(b=>{mn(this.scene.getNonDeletedElements(),b.id).forEach(x=>{v.set(b.id+x.id,{x:x.x-b.x,y:x.y-b.y})})}),!this.state.selectedElementsAreBeingDragged){let[b,x]=bt(m.x,m.y,c[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),S={x:b-s.originInGrid.x,y:x-s.originInGrid.y},C=[...s.originalElements.values()];this.maybeCacheReferenceSnapPoints(c,U);let{snapOffset:T,snapLines:k}=a0(U,be(C,this.state),this,c,S,p);g+=T.x,y+=T.y,this.setState({snapLines:k})}if(fS(s.originalElements,p,U,this.scene.getElementsMapIncludingDeleted(),this.scene,yr(c),wc(c),U.some(b=>Le(b))?!br(c):br(c),g,y,s.resize.center.x,s.resize.center.y)){let b=Rc(U,this.scene.getNonDeletedElementsMap(),this.state.zoom),x=new Set;return f.forEach(S=>{No(this.scene.getNonDeletedElements(),S,this.state,this.scene.getNonDeletedElementsMap()).forEach(C=>x.add(C))}),this.setState({elementsToHighlight:[...x],suggestedBindings:b}),!0}return!1}),I(this,"getContextMenuItems",s=>{let c=[];return c.push(hm,cm),s==="canvas"?this.state.viewModeEnabled?[...c,Um,e1,c5,t1]:[om,St,hm,cm,um,St,$M,sk,St,Um,jC,e1,c5,t1]:(c.push(um),this.state.viewModeEnabled?[td,...c]:[St,dm,td,om,St,LL,DL,AL,St,SI,St,...c,St,RC,NC,St,_C,gD,ZC,KC,QC,OC,St,$C,St,OM,BM,zM,FM,St,GC,VC,St,xI,St,bm,Wm,St,GM,rk,St,b2])}),I(this,"handleWheel",ot(s=>{if(!(s.target instanceof HTMLCanvasElement||s.target instanceof HTMLTextAreaElement||s.target instanceof HTMLIFrameElement)){s[L.CTRL_OR_CMD]&&s.preventDefault();return}if(s.preventDefault(),hs)return;let{deltaX:c,deltaY:U}=s;if(s.metaKey||s.ctrlKey){let f=Math.sign(U),p=Ms*100,m=Math.abs(U),g=U;m>p&&(g=p*f);let y=this.state.zoom.value-g/100;y+=Math.log10(Math.max(1,this.state.zoom.value))*-f*Math.min(1,m/20),this.translateCanvas(v=>({...el({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:Bn(y)},v),shouldCacheIgnoreZoom:!0})),this.resetShouldCacheIgnoreZoomDebounced();return}if(s.shiftKey){this.translateCanvas(({zoom:f,scrollX:p})=>({scrollX:p-(U||c)/f.value}));return}this.translateCanvas(({zoom:f,scrollX:p,scrollY:m})=>({scrollX:p-c/f.value,scrollY:m-U/f.value}))})),I(this,"savePointer",(s,c,U)=>{if(!s||!c)return;let{x:f,y:p}=$e({clientX:s,clientY:c},this.state),m={x:f,y:p,tool:this.state.activeTool.type==="laser"?"laser":"pointer"};this.props.onPointerUpdate?.({pointer:m,button:U,pointersMap:Re.pointers})}),I(this,"resetShouldCacheIgnoreZoomDebounced",yl(()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})},300)),I(this,"updateDOMRect",s=>{if(this.excalidrawContainerRef?.current){let c=this.excalidrawContainerRef.current,{width:U,height:f,left:p,top:m}=c.getBoundingClientRect(),{width:g,height:y,offsetTop:v,offsetLeft:b}=this.state;if(U===g&&f===y&&p===b&&m===v){s&&s();return}this.setState({width:U,height:f,offsetLeft:p,offsetTop:m},()=>{s&&s()})}}),I(this,"refresh",()=>{this.setState({...this.getCanvasOffsets()})});let a=tn(),{excalidrawAPI:n,viewModeEnabled:i=!1,zenModeEnabled:l=!1,gridModeEnabled:r=!1,objectsSnapModeEnabled:o=!1,theme:d=a.theme,name:u=`${E("labels.untitled")}-${Fu()}`}=t;if(this.state={...a,theme:d,isLoading:!0,...this.getCanvasOffsets(),viewModeEnabled:i,zenModeEnabled:l,objectsSnapModeEnabled:o,gridModeEnabled:r??a.gridModeEnabled,name:u,width:window.innerWidth,height:window.innerHeight},this.id=Sd(),this.library=new pk(this),this.actionManager=new II(this.syncActionResult,()=>this.state,()=>this.scene.getElementsIncludingDeleted(),this),this.scene=new Hn,this.canvas=document.createElement("canvas"),this.rc=Jn.canvas(this.canvas),this.renderer=new x5(this.scene),this.visibleElements=[],this.store=new YE,this.history=new jm,n){let s={updateScene:this.updateScene,updateLibrary:this.library.updateLibrary,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,getName:this.getName,registerAction:c=>{this.actionManager.registerAction(c)},refresh:this.refresh,setToast:this.setToast,id:this.id,setActiveTool:this.setActiveTool,setCursor:this.setCursor,resetCursor:this.resetCursor,updateFrameRendering:this.updateFrameRendering,toggleSidebar:this.toggleSidebar,onChange:c=>this.onChangeEmitter.on(c),onPointerDown:c=>this.onPointerDownEmitter.on(c),onPointerUp:c=>this.onPointerUpEmitter.on(c),onScrollChange:c=>this.onScrollChangeEmitter.on(c),onUserFollow:c=>this.onUserFollowEmitter.on(c)};typeof n=="function"?n(s):console.error("excalidrawAPI should be a function!")}this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.fonts=new An(this.scene),this.history=new jm,this.actionManager.registerAll(zc),this.actionManager.registerAction(CI(this.history,this.store)),this.actionManager.registerAction(kI(this.history,this.store))}onWindowMessage(t){if(t.origin!=="https://player.vimeo.com"&&t.origin!=="https://www.youtube.com")return;let a=null;try{a=JSON.parse(t.data)}catch{}if(a)switch(t.origin){case"https://player.vimeo.com":if(a.method==="paused"){let n=null,i=document.body.querySelectorAll("iframe.excalidraw__embeddable");if(!i)break;for(let l of i)l.contentWindow===t.source&&(n=l.contentWindow);n?.postMessage(JSON.stringify({method:a.value?"play":"pause",value:!0}),"*")}break;case"https://www.youtube.com":if(a.event==="infoDelivery"&&a.info&&a.id&&typeof a.info.playerState=="number"){let n=a.id,i=a.info.playerState;Object.values(vs).includes(i)&&$1.set(n,i)}break}}cacheEmbeddableRef(t,a){a&&this.iFrameRefs.set(t.id,a)}getHTMLIFrameElement(t){return this.iFrameRefs.get(t.id)}handleEmbeddableCenterClick(t){if(this.state.activeEmbeddable?.element===t&&this.state.activeEmbeddable?.state==="active"||(setTimeout(()=>{this.setState({activeEmbeddable:{element:t,state:"active"},selectedElementIds:{[t.id]:!0},newElement:null,selectionElement:null})},100),si(t)))return;let a=this.getHTMLIFrameElement(t);if(a?.contentWindow){if(a.src.includes("youtube")){let n=$1.get(t.id);switch(n||($1.set(t.id,vs.UNSTARTED),a.contentWindow.postMessage(JSON.stringify({event:"listening",id:t.id}),"*")),n){case vs.PLAYING:case vs.BUFFERING:a.contentWindow?.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*");break;default:a.contentWindow?.postMessage(JSON.stringify({event:"command",func:"playVideo",args:""}),"*")}}a.src.includes("player.vimeo.com")&&a.contentWindow.postMessage(JSON.stringify({method:"paused"}),"*")}}isIframeLikeElementCenter(t,a,n,i){return t&&!a.altKey&&!a.shiftKey&&!a.metaKey&&!a.ctrlKey&&(this.state.activeEmbeddable?.element!==t||this.state.activeEmbeddable?.state==="hover"||!this.state.activeEmbeddable)&&n>=t.x+t.width/3&&n<=t.x+2*t.width/3&&i>=t.y+t.height/3&&i<=t.y+2*t.height/3}renderEmbeddables(){let t=this.state.zoom.value,a=this.state.width,n=this.state.height,i=this.scene.getNonDeletedElements().filter(l=>ea(l)&&this.embedsValidationStatus.get(l.id)===!0||si(l));return h(te,{children:i.map(l=>{let{x:r,y:o}=ma({sceneX:l.x,sceneY:l.y},this.state),d=Bo(l,a,n,this.state,this.scene.getNonDeletedElementsMap()),u=this.initializedEmbeds.has(l.id);if(d&&!u&&this.initializedEmbeds.add(l.id),!(d||u))return null;let s;if(si(l)){s=null;let f=(l.customData?.generationData??this.magicGenerations.get(l.id))||{status:"error",message:"No generation data",code:"ERR_NO_GENERATION_DATA"};if(f.status==="done"){let p=f.html;s={intrinsicSize:{w:l.width,h:l.height},type:"document",srcdoc:()=>p}}else if(f.status==="pending")s={intrinsicSize:{w:l.width,h:l.height},type:"document",srcdoc:()=>Tr(`
                    <style>
                      html, body {
                        width: 100%;
                        height: 100%;
                        color: ${this.state.theme===Se.DARK?"white":"black"};
                      }
                      body {
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        flex-direction: column;
                        gap: 1rem;
                      }

                      .Spinner {
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        margin-left: auto;
                        margin-right: auto;
                      }

                      .Spinner svg {
                        animation: rotate 1.6s linear infinite;
                        transform-origin: center center;
                        width: 40px;
                        height: 40px;
                      }

                      .Spinner circle {
                        stroke: currentColor;
                        animation: dash 1.6s linear 0s infinite;
                        stroke-linecap: round;
                      }

                      @keyframes rotate {
                        100% {
                          transform: rotate(360deg);
                        }
                      }

                      @keyframes dash {
                        0% {
                          stroke-dasharray: 1, 300;
                          stroke-dashoffset: 0;
                        }
                        50% {
                          stroke-dasharray: 150, 300;
                          stroke-dashoffset: -200;
                        }
                        100% {
                          stroke-dasharray: 1, 300;
                          stroke-dashoffset: -280;
                        }
                      }
                    </style>
                    <div class="Spinner">
                      <svg
                        viewBox="0 0 100 100"
                      >
                        <circle
                          cx="50"
                          cy="50"
                          r="46"
                          stroke-width="8"
                          fill="none"
                          stroke-miter-limit="10"
                        />
                      </svg>
                    </div>
                    <div>Generating...</div>
                  `)};else{let p;f.code==="ERR_GENERATION_INTERRUPTED"?p="Generation was interrupted...":p=f.message||"Generation failed",s={intrinsicSize:{w:l.width,h:l.height},type:"document",srcdoc:()=>Tr(`
                    <style>
                    html, body {
                      height: 100%;
                    }
                      body {
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        justify-content: center;
                        color: ${ye.red[3]};
                      }
                      h1, h3 {
                        margin-top: 0;
                        margin-bottom: 0.5rem;
                      }
                    </style>
                    <h1>Error!</h1>
                    <h3>${p}</h3>
                  `)}}}else s=Nl(Bc(l.link||""));let c=this.state.activeEmbeddable?.element===l&&this.state.activeEmbeddable?.state==="active",U=this.state.activeEmbeddable?.element===l&&this.state.activeEmbeddable?.state==="hover";return h("div",{className:Q("excalidraw__embeddable-container",{"is-hovered":U}),style:{transform:d?`translate(${r-this.state.offsetLeft}px, ${o-this.state.offsetTop}px) scale(${t})`:"none",display:d?"block":"none",opacity:uf(l,ra(l,this.scene.getNonDeletedElementsMap()),this.elementsPendingErasure,null,this.state.openDialog?.name==="elementLinkSelector"?ku:1),"--embeddable-radius":`${Ba(Math.min(l.width,l.height),l)}px`},children:M("div",{className:"excalidraw__embeddable-container__inner",style:{width:d?`${l.width}px`:0,height:d?`${l.height}px`:0,transform:d?`rotate(${l.angle}rad)`:"none",pointerEvents:c?ol.enabled:ol.disabled},children:[U&&h("div",{className:"excalidraw__embeddable-hint",children:E("buttons.embeddableInteractionButton")}),h("div",{className:"excalidraw__embeddable__outer",style:{padding:`${l.strokeWidth}px`},children:(ea(l)?this.props.renderEmbeddable?.(l,this.state):null)??h("iframe",{ref:f=>this.cacheEmbeddableRef(l,f),className:"excalidraw__embeddable",srcDoc:s?.type==="document"?s.srcdoc(this.state.theme):void 0,src:s?.type!=="document"?s?.link??"":void 0,scrolling:"no",referrerPolicy:"no-referrer-when-downgrade",title:"Excalidraw Embedded Content",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sandbox:`${s?.sandbox?.allowSameOrigin?"allow-same-origin":""} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`})})]})},l.id)})})}toggleOverscrollBehavior(t){document.documentElement.style.overscrollBehaviorX=t.type==="pointerenter"?"none":"auto"}render(){let t=this.scene.getSelectedElements(this.state),{renderTopRightUI:a,renderCustomStats:n}=this.props,i=this.scene.getSceneNonce(),{elementsMap:l,visibleElements:r}=this.renderer.getRenderableElements({sceneNonce:i,zoom:this.state.zoom,offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,height:this.state.height,width:this.state.width,editingTextElement:this.state.editingTextElement,newElementId:this.state.newElement?.id,pendingImageElementId:this.state.pendingImageElementId});this.visibleElements=r;let o=this.scene.getNonDeletedElementsMap(),d="setPointerCapture"in HTMLElement.prototype?!1:this.state.selectionElement||this.state.newElement||this.state.selectedElementsAreBeingDragged||this.state.resizingElement||this.state.activeTool.type==="laser"&&this.state.cursorButton==="down",u=t[0];return h("div",{className:Q("excalidraw excalidraw-container",{"excalidraw--view-mode":this.state.viewModeEnabled||this.state.openDialog?.name==="elementLinkSelector","excalidraw--mobile":this.device.editor.isMobile}),style:{"--ui-pointerEvents":d?ol.disabled:ol.enabled,"--right-sidebar-width":"302px"},ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,onPointerEnter:this.toggleOverscrollBehavior,onPointerLeave:this.toggleOverscrollBehavior,children:h(C5.Provider,{value:this,children:h(k5.Provider,{value:this.props,children:h(R1.Provider,{value:this.excalidrawContainerValue,children:h(A1.Provider,{value:this.device,children:h(_1.Provider,{value:this.setAppState,children:h(P1.Provider,{value:this.state,children:M(N1.Provider,{value:this.scene.getNonDeletedElements(),children:[M(O1.Provider,{value:this.actionManager,children:[h(kL,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getNonDeletedElements(),onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onHandToolToggle:this.onHandToolToggle,langCode:Yr().code,renderTopRightUI:a,renderCustomStats:n,showExitZenModeBtn:typeof this.props?.zenModeEnabled>"u"&&this.state.zenModeEnabled,UIOptions:this.props.UIOptions,onExportImage:this.onExportImage,renderWelcomeScreen:!this.state.isLoading&&this.state.showWelcomeScreen&&this.state.activeTool.type==="selection"&&!this.state.zenModeEnabled&&!this.scene.getElementsIncludingDeleted().length,app:this,isCollaborating:this.props.isCollaborating,generateLinkForSelection:this.props.generateLinkForSelection,children:this.props.children}),h("div",{className:"excalidraw-textEditorContainer"}),h("div",{className:"excalidraw-contextMenuContainer"}),h("div",{className:"excalidraw-eye-dropper-container"}),h(sD,{trails:[this.laserTrails,this.eraserTrail]}),t.length===1&&this.state.openDialog?.name!=="elementLinkSelector"&&this.state.showHyperlinkPopup&&h(ak,{element:u,elementsMap:o,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen,setToast:this.setToast,updateEmbedValidationStatus:this.updateEmbedValidationStatus},u.id),this.props.aiEnabled!==!1&&t.length===1&&Hs(u)&&h(S5,{element:u,elementsMap:l,children:h(L1,{title:E("labels.convertToCode"),icon:BU,checked:!1,onChange:()=>this.onMagicFrameGenerate(u,"button")})}),t.length===1&&si(u)&&u.customData?.generationData?.status==="done"&&M(S5,{element:u,elementsMap:l,children:[h(L1,{title:E("labels.copySource"),icon:cc,checked:!1,onChange:()=>this.onIframeSrcCopy(u)}),h(L1,{title:"Enter fullscreen",icon:_3,checked:!1,onChange:()=>{let s=this.getHTMLIFrameElement(u);if(s)try{s.requestFullscreen(),this.setState({activeEmbeddable:{element:u,state:"active"},selectedElementIds:{[u.id]:!0},newElement:null,selectionElement:null})}catch(c){console.warn(c),this.setState({errorMessage:"Couldn't enter fullscreen"})}}})]}),this.state.toast!==null&&h(TL,{message:this.state.toast.message,onClose:()=>this.setToast(null),duration:this.state.toast.duration,closable:this.state.toast.closable}),this.state.contextMenu&&h(LI,{items:this.state.contextMenu.items,top:this.state.contextMenu.top,left:this.state.contextMenu.left,actionManager:this.actionManager,onClose:s=>{this.setState({contextMenu:null},()=>{this.focusContainer(),s?.()})}}),h(rD,{canvas:this.canvas,rc:this.rc,elementsMap:l,allElementsMap:o,visibleElements:r,sceneNonce:i,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:Cr(this),canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:this.flowChartCreator.pendingNodes}}),this.state.newElement&&h(ED,{appState:this.state,scale:window.devicePixelRatio,rc:this.rc,elementsMap:l,allElementsMap:o,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:!1,canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:null}}),h(nD,{containerRef:this.excalidrawContainerRef,canvas:this.interactiveCanvas,elementsMap:l,visibleElements:r,allElementsMap:o,selectedElements:t,sceneNonce:i,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,device:this.device,renderInteractiveSceneCallback:this.renderInteractiveSceneCallback,handleCanvasRef:this.handleInteractiveCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick}),this.state.userToFollow&&h(uD,{width:this.state.width,height:this.state.height,userToFollow:this.state.userToFollow,onDisconnect:this.maybeUnfollowRemoteUser}),this.renderFrameNames()]}),this.renderEmbeddables()]})})})})})})})})}setPlugins(t){Object.assign(this.plugins,t)}async onMagicFrameGenerate(t,a){let n=this.plugins.diagramToCode?.generate;if(!n){this.setState({errorMessage:"No diagram to code plugin found"});return}let i=yh(this.scene.getNonDeletedElements(),t).filter(r=>!Hs(r));if(!i.length){a==="button"?(this.setState({errorMessage:"Cannot generate from an empty frame"}),Ge("ai","generate (no-children)","d2c")):this.setActiveTool({type:"magicframe"});return}let l=this.insertIframeElement({sceneX:t.x+t.width+30,sceneY:t.y,width:t.width,height:t.height});if(l){this.updateMagicGeneration({frameElement:l,data:{status:"pending"}}),this.setState({selectedElementIds:{[l.id]:!0}}),Ge("ai","generate (start)","d2c");try{let{html:r}=await n({frame:t,children:i});if(Ge("ai","generate (success)","d2c"),!r.trim()){this.updateMagicGeneration({frameElement:l,data:{status:"error",code:"ERR_OAI",message:"Nothing genereated :("}});return}let o=r.includes("<!DOCTYPE html>")&&r.includes("</html>")?r.slice(r.indexOf("<!DOCTYPE html>"),r.indexOf("</html>")+7):r;this.updateMagicGeneration({frameElement:l,data:{status:"done",html:o}})}catch(r){Ge("ai","generate (failed)","d2c"),this.updateMagicGeneration({frameElement:l,data:{status:"error",code:"ERR_OAI",message:r.message||"Unknown error during generation"}})}}}onIframeSrcCopy(t){t.customData?.generationData?.status==="done"&&(Bl(t.customData.generationData.html),this.setToast({message:"copied to clipboard",closable:!1,duration:1500}))}clearImageShapeCache(t){let a=t??this.files;this.scene.getNonDeletedElements().forEach(n=>{ba(n)&&a[n.fileId]&&(this.imageCache.delete(n.fileId),Qe.delete(n))})}async componentDidMount(){this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,(me.MODE===Qt.TEST||me.DEV)&&(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:(...t)=>this.setState(...t)},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history},store:{configurable:!0,value:this.store},fonts:{configurable:!0,value:this.fonts}})),this.store.onStoreIncrementEmitter.on(t=>{this.history.record(t.elementsChange,t.appStateChange)}),this.scene.onUpdate(this.triggerRender),this.addEventListeners(),this.props.autoFocus&&this.excalidrawContainerRef.current&&this.focusContainer(),Tn()||(this.refreshViewportBreakpoints(),this.refreshEditorBreakpoints()),kd&&this.excalidrawContainerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this.refreshEditorBreakpoints(),this.updateDOMRect()}),this.resizeObserver?.observe(this.excalidrawContainerRef.current)),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene),Yg()&&!e8()&&this.setState({errorMessage:h(NL,{})})}componentWillUnmount(){window.launchQueue?.setConsumer(()=>{}),this.renderer.destroy(),this.scene.destroy(),this.scene=new Hn,this.fonts=new An(this.scene),this.renderer=new x5(this.scene),this.files={},this.imageCache.clear(),this.resizeObserver?.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.library.destroy(),this.laserTrails.stop(),this.eraserTrail.stop(),this.onChangeEmitter.clear(),this.store.onStoreIncrementEmitter.clear(),Qe.destroy(),zn.destroy(),clearTimeout(Ei),yt.clearCache(),Xt.clearCache(),Ei=0,document.documentElement.style.overscrollBehaviorX=""}removeEventListeners(){this.onRemoveEventListenersEmitter.trigger()}addEventListeners(){this.removeEventListeners(),this.props.handleKeyboardGlobally&&this.onRemoveEventListenersEmitter.once(Je(document,"keydown",this.onKeyDown,!1)),this.onRemoveEventListenersEmitter.once(Je(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),Je(window,"message",this.onWindowMessage,!1),Je(document,"pointerup",this.removePointer,{passive:!1}),Je(document,"copy",this.onCopy,{passive:!1}),Je(document,"keyup",this.onKeyUp,{passive:!0}),Je(document,"pointermove",this.updateCurrentCursorPosition,{passive:!1}),Je(document.fonts,"loadingdone",t=>{let a=t.fontfaces;this.fonts.onLoaded(a)},{passive:!1}),Je(document,"gesturestart",this.onGestureStart,!1),Je(document,"gesturechange",this.onGestureChange,!1),Je(document,"gestureend",this.onGestureEnd,!1),Je(window,"focus",()=>{this.maybeCleanupAfterMissingPointerUp(null),this.triggerRender(!0)},{passive:!1})),!this.state.viewModeEnabled&&(this.onRemoveEventListenersEmitter.once(Je(document,"fullscreenchange",this.onFullscreenChange,{passive:!1}),Je(document,"paste",this.pasteFromClipboard,{passive:!1}),Je(document,"cut",this.onCut,{passive:!1}),Je(window,"resize",this.onResize,!1),Je(window,"unload",this.onUnload,!1),Je(window,"blur",this.onBlur,!1),Je(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),Je(this.excalidrawContainerRef.current,"dragover",this.disableEvent,!1),Je(this.excalidrawContainerRef.current,"drop",this.disableEvent,!1)),this.props.detectScroll&&this.onRemoveEventListenersEmitter.once(Je(z7(this.excalidrawContainerRef.current),"scroll",this.onScroll,{passive:!1})))}componentDidUpdate(t,a){this.updateEmbeddables();let n=this.scene.getElementsIncludingDeleted(),i=this.scene.getElementsMapIncludingDeleted(),l=this.scene.getNonDeletedElementsMap();!this.state.showWelcomeScreen&&!n.length&&this.setState({showWelcomeScreen:!0}),t.UIOptions.dockedSidebarBreakpoint!==this.props.UIOptions.dockedSidebarBreakpoint&&this.refreshEditorBreakpoints(),a.userToFollow&&!this.state.collaborators.has(a.userToFollow.socketId)&&this.maybeUnfollowRemoteUser(),(a.zoom.value!==this.state.zoom.value||a.scrollX!==this.state.scrollX||a.scrollY!==this.state.scrollY)&&(this.props?.onScrollChange?.(this.state.scrollX,this.state.scrollY,this.state.zoom),this.onScrollChangeEmitter.trigger(this.state.scrollX,this.state.scrollY,this.state.zoom)),a.userToFollow!==this.state.userToFollow&&(a.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:a.userToFollow,action:"UNFOLLOW"}),this.state.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:this.state.userToFollow,action:"FOLLOW"})),Object.keys(this.state.selectedElementIds).length&&an(this.state)&&this.setState({activeTool:ft(this.state,{type:"selection"})}),this.state.activeTool.type==="eraser"&&a.theme!==this.state.theme&&c0(this.interactiveCanvas,this.state.theme),a.activeTool.type==="selection"&&this.state.activeTool.type!=="selection"&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),t.langCode!==this.props.langCode&&this.updateLanguage(),an(a)&&!an(this.state)&&this.eraserTrail.endPath(),t.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),a.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),(a.openDialog?.name==="elementLinkSelector"||this.state.openDialog?.name==="elementLinkSelector")&&a.openDialog?.name!==this.state.openDialog?.name&&(this.deselectElements(),this.setState({hoveredElementIds:{}})),t.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),t.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),this.excalidrawContainerRef.current?.classList.toggle("theme--dark",this.state.theme===Se.DARK),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(()=>{this.state.editingLinearElement&&this.actionManager.executeAction(Ya)}),this.state.editingTextElement?.isDeleted&&this.setState({editingTextElement:null}),this.state.selectedLinearElement&&!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]&&this.setState({selectedLinearElement:null});let{multiElement:r}=a;a.activeTool!==this.state.activeTool&&r!=null&&Gi(this.state)&&ln(r,!1)&&Nc(r,this.state,Na(Z.getPointAtIndexGlobalCoordinates(r,-1,l)),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.store.commit(i,this.state),this.state.isLoading||(this.props.onChange?.(n,this.state,this.files),this.onChangeEmitter.trigger(n,this.state,this.files))}static resetTapTwice(){cs=!1}async addElementsFromMixedContentPaste(t,{isPlainPaste:a,sceneX:n,sceneY:i}){if(!a&&t.some(l=>l.type==="imageUrl")&&this.isToolSupported("image")){let l=t.filter(c=>c.type==="imageUrl").map(c=>c.value),r=await Promise.all(l.map(async c=>{try{return{file:await PS(c)}}catch(U){let f=U.message;return U.cause==="FETCH_ERROR"?f=E("errors.failedToFetchImage"):U.cause==="UNSUPPORTED"&&(f=E("errors.unsupportedFileType")),{errorMessage:f}}})),o=i,d=!1,u={};for(let c of r)if(c.file){let U=this.createImageElement({sceneX:n,sceneY:o}),f=await this.insertImageElement(U,c.file);f&&(d||(d=!0,o-=f.height/2),F(f,{y:o},!1),o=U.y+U.height+25,u[U.id]=!0)}this.setState({selectedElementIds:Ae(u,this.state)});let s=r.find(c=>!!c.errorMessage);s&&s.errorMessage&&this.setState({errorMessage:s.errorMessage})}else{let l=t.filter(r=>r.type==="text");l.length&&this.addTextFromPaste(l.map(r=>r.value).join(`

`),a)}}addTextFromPaste(t,a=!1){let{x:n,y:i}=$e({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),l={x:n,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roundness:null,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:t,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:tr,verticalAlign:ws,locked:!1},r=Oe({fontSize:l.fontSize,fontFamily:l.fontFamily}),o=Hi(l.fontFamily),[d,,u]=Nf(this.state),s=Math.max(Math.min((u-d)*.5,800),200),c=10,U=i,f=a?[t]:t.split(`
`),p=f.reduce((m,g,y)=>{let v=El(g).trim();if(v.length){let b=this.getTopLayerFrameAtSceneCoords({x:n,y:U}),x=zt(v,r,o),S=x.width>s,C=S?Oi(v,r,s):v;x=S?zt(C,r,o):x;let T=n-x.width/2,k=U-x.height/2,R=ua({...l,x:T,y:k,text:C,originalText:v,lineHeight:o,autoResize:!S,frameId:b?b.id:null});m.push(R),U+=R.height+c}else f[y-1]?.trim()&&(U+=fr(l.fontSize,o)+c);return m},[]);p.length!==0&&(this.scene.insertElements(p),this.setState({selectedElementIds:Ae(Object.fromEntries(p.map(m=>[m.id,!0])),this.state)}),!a&&p.length>1&&L5===!1&&!this.device.editor.isMobile&&(this.setToast({message:E("toast.pasteAsSingleElement",{shortcut:z("CtrlOrCmd+Shift+V")}),duration:5e3}),L5=!0),this.store.shouldCaptureIncrement())}handleTextWysiwyg(t,{isExistingElement:a=!1}){let n=this.scene.getElementsMapIncludingDeleted(),i=(l,r)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(o=>o.id===t.id&&j(o)?fe(o,{originalText:l,isDeleted:r??o.isDeleted,...U0(o,Tt(o,n),n,l)}):o)])};mD({id:t.id,canvas:this.canvas,getViewportCoords:(l,r)=>{let{x:o,y:d}=ma({sceneX:l,sceneY:r},this.state);return[o-this.state.offsetLeft,d-this.state.offsetTop]},onChange:ot(l=>{i(l,!1),Rh(t)&&na(t,this.scene.getNonDeletedElementsMap())}),onSubmit:ot(({viaKeyboard:l,nextOriginalText:r})=>{let o=!r.trim();if(i(r,o),!o&&l){let d=t.containerId?t.containerId:t.id;xn(()=>{this.setState(u=>({selectedElementIds:Ae({...u.selectedElementIds,[d]:!0},u)}))})}o&&Wf(this.scene.getNonDeletedElements(),[t]),(!o||a)&&this.store.shouldCaptureIncrement(),xn(()=>{this.setState({newElement:null,editingTextElement:null})}),this.state.activeTool.locked&&dn(this.interactiveCanvas,this.state),this.focusContainer()}),element:t,excalidrawContainer:this.excalidrawContainerRef.current,app:this,autoSelect:!this.device.isTouchScreen}),this.deselectElements(),i(t.originalText,!1)}deselectElements(){this.setState({selectedElementIds:Ae({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}getTextElementAtPosition(t,a){let n=this.getElementAtPosition(t,a,{includeBoundTextElement:!0});return n&&j(n)&&!n.isDeleted?n:null}getElementAtPosition(t,a,n){let i=this.getElementsAtPosition(t,a,n?.includeBoundTextElement,n?.includeLockedElements);if(i.length>1){if(n?.preferSelected){for(let r=i.length-1;r>-1;r--)if(this.state.selectedElementIds[i[r].id])return i[r]}let l=i[i.length-1];return Sl({x:t,y:a,element:l,shape:Rn(l,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()/2,frameNameBound:de(l)?this.frameNameBoundsCache.get(l):null})?l:i[i.length-2]}return i.length===1?i[0]:null}getElementsAtPosition(t,a,n=!1,i=!1){let l=[],r=this.scene.getNonDeletedElementsMap();return(n&&i?this.scene.getNonDeletedElements():this.scene.getNonDeletedElements().filter(o=>(i||!o.locked)&&(n||!(j(o)&&o.containerId)))).filter(o=>this.hitElement(t,a,o)).filter(o=>{let d=ra(o,r);return d&&this.state.frameRendering.enabled&&this.state.frameRendering.clip?Mp({x:t,y:a},d,r):!0}).filter(o=>si(o)?(l.push(o),!1):!0).concat(l)}getElementHitThreshold(){return Jg/this.state.zoom.value}hitElement(t,a,n,i=!0){if(i&&this.state.selectedElementIds[n.id]&&$p([n],this.state)){let l=zv(n,this.scene.getNonDeletedElementsMap(),Le(n)?0:this.getElementHitThreshold());if(eo(w(t,a),l))return!0}return af(t,a,lf(n,this.scene.getNonDeletedElementsMap()))?!0:Sl({x:t,y:a,element:n,shape:Rn(n,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:de(n)?this.frameNameBoundsCache.get(n):null})}getTextBindableContainerAtPosition(t,a){let n=this.scene.getNonDeletedElements(),i=this.scene.getSelectedElements(this.state);if(i.length===1)return Ni(i[0],!1)?i[0]:null;let l=null;for(let r=n.length-1;r>=0;--r){if(n[r].isDeleted)continue;let[o,d,u,s]=Ue(n[r],this.scene.getNonDeletedElementsMap());if(ge(n[r])&&Sl({x:t,y:a,element:n[r],shape:Rn(n[r],this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()})){l=n[r];break}else if(o<t&&t<u&&d<a&&a<s){l=n[r];break}}return Ni(l,!1)?l:null}handleHoverSelectedLinearElement(t,a,n){let i=this.scene.getNonDeletedElementsMap(),l=Z.getElement(t.elementId,i);if(l)if(this.state.selectedLinearElement){let r=-1,o=null;Sl({x:a,y:n,element:l,shape:Rn(l,this.scene.getNonDeletedElementsMap())})?(r=Z.getPointIndexUnderCursor(l,i,this.state.zoom,a,n),o=Z.getSegmentMidpointHitCoords(t,{x:a,y:n},this.state,this.scene.getNonDeletedElementsMap()),(q(l)?r===0||r===l.points.length-1:r>=0)||o?Be(this.interactiveCanvas,Pe.POINTER):this.hitElement(a,n,l)&&Be(this.interactiveCanvas,Pe.MOVE)):this.hitElement(a,n,l)&&(!q(l)||!(l.startBinding||l.endBinding))&&Be(this.interactiveCanvas,Pe.MOVE),this.state.selectedLinearElement.hoverPointIndex!==r&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,hoverPointIndex:r}}),Z.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords,o)||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:o}})}else Be(this.interactiveCanvas,Pe.AUTO)}updateGestureOnPointerDown(t){Re.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),Re.pointers.size===2&&(Re.lastCenter=qm(Re.pointers),Re.initialScale=this.state.zoom.value,Re.initialDistance=Jm(Array.from(Re.pointers.values())))}initialPointerDownState(t){let a=$e(t,this.state),n=this.scene.getSelectedElements(this.state),[i,l,r,o]=De(n),d=n.findIndex(q)===0;return{origin:a,withCmdOrCtrl:t[L.CTRL_OR_CMD],originInGrid:Na(bt(a.x,a.y,t[L.CTRL_OR_CMD]||d?null:this.getEffectiveGridSize())),scrollbars:o6(F1,t.clientX-this.state.offsetLeft,t.clientY-this.state.offsetTop),lastCoords:{...a},originalElements:this.scene.getNonDeletedElements().reduce((u,s)=>(u.set(s.id,Zi(s)),u),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(r+i)/2,y:(o+l)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(a,n)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(t,a){if(!(a.scrollbars.isOverEither&&!this.state.multiElement))return!1;z1=!0,a.lastCoords.x=t.clientX,a.lastCoords.y=t.clientY;let n=C1(l=>{l.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(l,a)}),i=ot(()=>{Us=null,z1=!1,dn(this.interactiveCanvas,this.state),this.setState({cursorButton:"up"}),this.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",i),n.flush()});return Us=i,window.addEventListener("pointermove",n),window.addEventListener("pointerup",i),!0}isASelectedElement(t){return t!=null&&this.state.selectedElementIds[t.id]}isHittingCommonBoundingBoxOfSelectedElements(t,a){if(a.length<2)return!1;let n=this.getElementHitThreshold(),[i,l,r,o]=De(a);return t.x>i-n&&t.x<r+n&&t.y>l-n&&t.y<o+n}getCurrentItemRoundness(t){return this.state.currentItemRoundness==="round"?{type:wl(t)?Ut.ADAPTIVE_RADIUS:Ut.PROPORTIONAL_RADIUS}:null}maybeCacheReferenceSnapPoints(t,a,n=!1){hi({event:t,app:this,selectedElements:a})&&(n||!zn.getReferenceSnapPoints())&&zn.setReferenceSnapPoints(yE(this.scene.getNonDeletedElements(),a,this.state,this.scene.getNonDeletedElementsMap()))}maybeCacheVisibleGaps(t,a,n=!1){hi({event:t,app:this,selectedElements:a})&&(n||!zn.getVisibleGaps())&&zn.setVisibleGaps(bE(this.scene.getNonDeletedElements(),a,this.state,this.scene.getNonDeletedElementsMap()))}onKeyDownFromPointerDownHandler(t){return ot(a=>{this.maybeHandleResize(t,a)||this.maybeDragNewGenericElement(t,a)})}onKeyUpFromPointerDownHandler(t){return ot(a=>{a.key===L.ALT&&a.preventDefault(),!this.maybeHandleResize(t,a)&&this.maybeDragNewGenericElement(t,a)})}onPointerMoveFromPointerDownHandler(t){return C1(a=>{if(this.state.openDialog?.name==="elementLinkSelector")return;let n=$e(a,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.elbowed&&this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index){let[s,c]=bt(n.x,n.y,a[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),U=this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;if(U<0){let p=Z.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:s,y:c},this.state,this.scene.getNonDeletedElementsMap());U=p?Z.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,p,this.scene.getNonDeletedElementsMap()):-1}let f=Z.moveFixedSegment(this.state.selectedLinearElement,U,s,c,this.scene.getNonDeletedElementsMap());xn(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:f.segmentMidPointHoveredCoords,pointerDownState:f.pointerDownState}})});return}let i=this.lastPointerMoveCoords??t.origin;if(this.lastPointerMoveCoords=n,t.drag.offset===null&&(t.drag.offset=Na(CS(this.scene.getSelectedElements(this.state),t.origin.x,t.origin.y))),!(a.target instanceof HTMLElement)||this.handlePointerMoveOverScrollbars(a,t))return;if(an(this.state)){this.handleEraser(a,t,n);return}this.state.activeTool.type==="laser"&&this.laserTrails.addPointToPath(n.x,n.y);let[l,r]=bt(n.x,n.y,a[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize());if(!t.drag.hasOccurred&&(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")&&Te(w(n.x,n.y),w(t.origin.x,t.origin.y))<Ci)return;if(t.resize.isResizing&&(t.lastCoords.x=n.x,t.lastCoords.y=n.y,this.maybeHandleCrop(t,a)||this.maybeHandleResize(t,a)))return!0;let o=this.scene.getNonDeletedElementsMap();if(this.state.selectedLinearElement){let s=this.state.editingLinearElement||this.state.selectedLinearElement;if(Z.shouldAddMidpoint(this.state.selectedLinearElement,n,this.state,o)){let c=Z.addMidpoint(this.state.selectedLinearElement,n,this,!a[L.CTRL_OR_CMD],o);if(!c)return;xn(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:c.pointerDownState,selectedPointsIndices:c.selectedPointsIndices}}),this.state.editingLinearElement&&this.setState({editingLinearElement:{...this.state.editingLinearElement,pointerDownState:c.pointerDownState,selectedPointsIndices:c.selectedPointsIndices}})});return}else if(s.pointerDownState.segmentMidpoint.value!==null&&!s.pointerDownState.segmentMidpoint.added)return;if(Z.handlePointDragging(a,this,n.x,n.y,(c,U)=>{this.maybeSuggestBindingsForLinearElementAtCoords(c,U)},s,this.scene)){t.lastCoords.x=n.x,t.lastCoords.y=n.y,t.drag.hasOccurred=!0,this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging&&this.setState({editingLinearElement:{...this.state.editingLinearElement,isDragging:!0}}),this.state.selectedLinearElement.isDragging||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!0}});return}}let d=t.hit.allHitElements.some(s=>this.isASelectedElement(s)),u=this.state.editingLinearElement&&a.shiftKey&&this.state.editingLinearElement.elementId===t.hit.element?.id;if((d||t.hit.hasHitCommonBoundingBoxOfSelectedElements)&&!u){let s=this.scene.getSelectedElements(this.state);if(s.every(p=>p.locked))return;let c=s.find(p=>de(p)),U=this.getTopLayerFrameAtSceneCoords(n),f=U&&!c?U:null;if(this.state.frameToHighlight!==f&&xn(()=>{this.setState({frameToHighlight:f})}),t.drag.hasOccurred=!0,s.length>0&&!t.withCmdOrCtrl&&!this.state.editingTextElement&&this.state.activeEmbeddable?.state!=="active"){let p={x:n.x-t.origin.x,y:n.y-t.origin.y},m=[...t.originalElements.values()],g=a.shiftKey;if(g){let b=Math.abs(p.x),x=Math.abs(p.y),S=g&&b<x,C=g&&b>x;S&&(p.x=0),C&&(p.y=0)}if(this.state.croppingElementId){let b=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(b&&Le(b)&&b.crop!==null&&t.hit.element===b){let x=b.crop,S=ba(b)&&this.imageCache.get(b.fileId)?.image;if(S&&!(S instanceof Promise)){let C=it(Dt(n.x-i.x,n.y-i.y),Math.max(this.state.zoom.value,2)),[T,k,R,D,A,P]=Ue(b,o),$=ie(O(w(T,k),w(A,P),b.angle)),X=ie(O(w(R,k),w(A,P),b.angle)),_=ie(O(w(T,D),w(A,P),b.angle)),H=Pt(Ds(X,$)),W=Pt(Ds(_,$)),K=Dt(Au(C,H),Au(C,W)),G={...x,x:we(x.x-K[0]*Math.sign(b.scale[0]),0,S.naturalWidth-x.width),y:we(x.y-K[1]*Math.sign(b.scale[1]),0,S.naturalHeight-x.height)};F(b,{crop:G});return}}}this.maybeCacheVisibleGaps(a,s),this.maybeCacheReferenceSnapPoints(a,s);let{snapOffset:y,snapLines:v}=vE(m,p,this,a,this.scene.getNonDeletedElementsMap());if(this.setState({snapLines:v}),this.state.editingFrame||SS(t,s,p,this.scene,y,a[L.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),this.setState({selectedElementsAreBeingDragged:!0,selectionElement:null}),(s.length!==1||!q(s[0]))&&this.setState({suggestedBindings:Rc(s,this.scene.getNonDeletedElementsMap(),this.state.zoom)}),a.altKey&&!t.hit.hasBeenDuplicated){t.hit.hasBeenDuplicated=!0;let b=[],x=[],S=new Map,C=new Map,T=t.hit.element,k=new Set(this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}).map(A=>A.id)),R=this.scene.getElementsIncludingDeleted();for(let A of R){let P=k.has(A.id)||A.id===T?.id&&t.hit.wasAddedToSelection;if(Math.abs(A.x)>1e7||Math.abs(A.x)>1e7||Math.abs(A.width)>1e7||Math.abs(A.height)>1e7){console.error("Alt+dragging element in scene with invalid dimensions",A.x,A.y,A.width,A.height,P);return}if(P){let $=m0(this.state.editingGroupId,S,A);if(Math.abs($.x)>1e7||Math.abs($.x)>1e7||Math.abs($.width)>1e7||Math.abs($.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",$.x,$.y,$.width,$.height);return}let X=t.originalElements.get(A.id);if(Math.abs(X.x)>1e7||Math.abs(X.x)>1e7||Math.abs(X.width)>1e7||Math.abs(X.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",X.x,X.y,X.width,X.height);return}F($,{x:X.x,y:X.y}),t.originalElements.set($.id,$),b.push($),x.push(A),C.set(A.id,$.id)}else b.push(A)}let D=[...b,...x];D=this.props.onDuplicate?.(D,R)||D,un(D,oe(x)),i0(b,x,C),Hf(D,x,C,"duplicatesServeAsOld"),xp(D,x,C),this.scene.replaceAllElements(D),this.maybeCacheVisibleGaps(a,s,!0),this.maybeCacheReferenceSnapPoints(a,s,!0)}return}}if(this.state.selectionElement)t.lastCoords.x=n.x,t.lastCoords.y=n.y,this.maybeDragNewGenericElement(t,a);else{let s=this.state.newElement;if(!s)return;if(s.type==="freedraw"){let c=s.points,U=n.x-s.x,f=n.y-s.y,p=c.length>0&&c[c.length-1];if(!(p&&p[0]===U&&p[1]===f)){let m=s.simulatePressure?s.pressures:[...s.pressures,a.pressure];F(s,{points:[...c,w(U,f)],pressures:m},!1),this.setState({newElement:s})}}else if(he(s)){t.drag.hasOccurred=!0;let c=s.points,U=l-s.x,f=r-s.y;yr(a)&&c.length===2&&({width:U,height:f}=xh(s.x,s.y,n.x,n.y)),c.length===1?F(s,{points:[...c,w(U,f)]},!1):(c.length===2||c.length>1&&q(s))&&F(s,{points:[...c.slice(0,-1),w(U,f)]},!1,{isDragging:!0}),this.setState({newElement:s}),ln(s,!1)&&this.maybeSuggestBindingsForLinearElementAtCoords(s,[n],this.state.startBoundElement)}else t.lastCoords.x=n.x,t.lastCoords.y=n.y,this.maybeDragNewGenericElement(t,a,!1)}if(this.state.activeTool.type==="selection"){t.boxSelection.hasOccurred=!0;let s=this.scene.getNonDeletedElements();if(this.state.editingLinearElement)Z.handleBoxSelection(a,this.state,this.setState.bind(this),this.scene.getNonDeletedElementsMap());else{let c=!0;!a.shiftKey&&yt(s,this.state)&&(t.withCmdOrCtrl&&t.hit.element?this.setState(f=>Xt({...f,selectedElementIds:{[t.hit.element.id]:!0}},this.scene.getNonDeletedElements(),f,this)):c=!1);let U=this.state.selectionElement?wh(s,this.state.selectionElement,this.scene.getNonDeletedElementsMap(),!1):[];this.setState(f=>{let p={...c&&f.selectedElementIds,...U.reduce((m,g)=>(m[g.id]=!0,m),{})};return t.hit.element&&(U.length?delete p[t.hit.element.id]:p[t.hit.element.id]=!0),f=c?f:{...f,selectedGroupIds:{},editingGroupId:null},{...Xt({editingGroupId:f.editingGroupId,selectedElementIds:p},this.scene.getNonDeletedElements(),f,this),selectedLinearElement:U.length===1&&he(U[0])?new Z(U[0]):null,showHyperlinkPopup:U.length===1&&(U[0].link||ea(U[0]))?"info":!1}})}}})}handlePointerMoveOverScrollbars(t,a){if(a.scrollbars.isOverHorizontal){let n=t.clientX,i=n-a.lastCoords.x;return this.translateCanvas({scrollX:this.state.scrollX-i/this.state.zoom.value}),a.lastCoords.x=n,!0}if(a.scrollbars.isOverVertical){let n=t.clientY,i=n-a.lastCoords.y;return this.translateCanvas({scrollY:this.state.scrollY-i/this.state.zoom.value}),a.lastCoords.y=n,!0}return!1}onPointerUpFromPointerDownHandler(t){return ot(a=>{this.removePointer(a),t.eventListeners.onMove&&t.eventListeners.onMove.flush();let{newElement:n,resizingElement:i,croppingElementId:l,multiElement:r,activeTool:o,isResizing:d,isRotating:u,isCropping:s}=this.state;this.setState(m=>({isResizing:!1,isRotating:!1,isCropping:!1,resizingElement:null,selectionElement:null,frameToHighlight:null,elementsToHighlight:null,cursorButton:"up",snapLines:Ur(m.snapLines,[]),originSnapOffset:null})),this.lastPointerMoveCoords=null,zn.setReferenceSnapPoints(null),zn.setVisibleGaps(null),this.savePointer(a.clientX,a.clientY,"up"),this.setState({selectedElementsAreBeingDragged:!1});let c=this.scene.getNonDeletedElementsMap();if(t.drag.hasOccurred&&t.hit?.element?.id){let m=c.get(t.hit.element.id);_a(m)&&m.boundElements?.filter(g=>g.type==="arrow").map(g=>c.get(g.id)).filter(g=>q(g)).forEach(g=>{g&&F(g,{},!0)})}if(this.state.editingLinearElement)if(!t.boxSelection.hasOccurred&&t.hit?.element?.id!==this.state.editingLinearElement.elementId)this.actionManager.executeAction(Ya);else{let m=Z.handlePointerUp(a,this.state.editingLinearElement,this.state,this.scene);m!==this.state.editingLinearElement&&this.setState({editingLinearElement:m,suggestedBindings:[]})}else if(this.state.selectedLinearElement){if(this.state.selectedLinearElement.elbowed){let m=Z.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());m&&F(m,{},!0)}if(t.hit?.element?.id!==this.state.selectedLinearElement.elementId)this.scene.getSelectedElements(this.state).length>1&&this.setState({selectedLinearElement:null});else{let m=Z.handlePointerUp(a,this.state.selectedLinearElement,this.state,this.scene),{startBindingElement:g,endBindingElement:y}=m,v=this.scene.getElement(m.elementId);ln(v)&&oo(v,g,y,c,this.scene),m!==this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...m,selectedPointsIndices:null},suggestedBindings:[]})}}if(this.missingPointerEventCleanupEmitter.clear(),window.removeEventListener("pointermove",t.eventListeners.onMove),window.removeEventListener("pointerup",t.eventListeners.onUp),window.removeEventListener("keydown",t.eventListeners.onKeyDown),window.removeEventListener("keyup",t.eventListeners.onKeyUp),this.state.pendingImageElementId&&this.setState({pendingImageElementId:null}),this.props?.onPointerUp?.(o,t),this.onPointerUpEmitter.trigger(this.state.activeTool,t,a),n?.type==="freedraw"){let m=$e(a,this.state),g=n.points,y=m.x-n.x,v=m.y-n.y;y===g[0][0]&&v===g[0][1]&&(v+=1e-4,y+=1e-4);let b=n.simulatePressure?[]:[...n.pressures,a.pressure];F(n,{points:[...g,w(y,v)],pressures:b,lastCommittedPoint:w(y,v)}),this.actionManager.executeAction(Ya);return}if(Le(n)){let m=n;try{this.initializeImageDimensions(m),this.setState({selectedElementIds:Ae({[m.id]:!0},this.state)},()=>{this.actionManager.executeAction(Ya)})}catch(g){console.error(g),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter(y=>y.id!==m.id)),this.actionManager.executeAction(Ya)}return}if(he(n)){n.points.length>1&&this.store.shouldCaptureIncrement();let m=$e(a,this.state);!t.drag.hasOccurred&&n&&!r?(F(n,{points:[...n.points,w(m.x-n.x,m.y-n.y)]}),this.setState({multiElement:n,newElement:n})):t.drag.hasOccurred&&!r&&(Gi(this.state)&&ln(n,!1)&&Nc(n,this.state,m,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.setState({suggestedBindings:[],startBoundElement:null}),o.locked?this.setState(g=>({newElement:null})):(Ha(this.interactiveCanvas),this.setState(g=>({newElement:null,activeTool:ft(this.state,{type:"selection"}),selectedElementIds:Ae({...g.selectedElementIds,[n.id]:!0},g),selectedLinearElement:new Z(n)}))),this.scene.triggerUpdate());return}if(j(n)){let m=jd(Oe({fontSize:n.fontSize,fontFamily:n.fontFamily}),n.lineHeight);n.width<m&&F(n,{autoResize:!0}),this.resetCursor(),this.handleTextWysiwyg(n,{isExistingElement:!0})}if(o.type!=="selection"&&n&&qi(n)){this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(m=>m.id!==n.id),appState:{newElement:null},captureUpdate:B.NEVER});return}if(de(n)){let m=iS(this.scene.getElementsIncludingDeleted(),n,this.scene.getNonDeletedElementsMap());this.scene.replaceAllElements($r(this.scene.getElementsMapIncludingDeleted(),m,n,this.state))}if(n&&(F(n,_p(n)),this.scene.triggerUpdate()),t.drag.hasOccurred){let m=$e(a,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.isDragging){let g=this.scene.getElement(this.state.selectedLinearElement.elementId);if(g?.frameId){let y=ra(g,c);y&&g&&(bi(g,y,this.scene.getNonDeletedElementsMap())||(F(g,{groupIds:[]}),Po([g],this.scene.getNonDeletedElementsMap()),this.scene.triggerUpdate()))}}else{let g=this.getTopLayerFrameAtSceneCoords(m),y=this.scene.getSelectedElements(this.state),v=this.scene.getElementsMapIncludingDeleted(),b=x=>{if(x.length>0){for(let S of x){let C=S.groupIds.indexOf(this.state.editingGroupId);F(S,{groupIds:S.groupIds.slice(0,C)},!1)}v.forEach(S=>{S.groupIds.length&&je(v,S.groupIds[S.groupIds.length-1]).length<2&&F(S,{groupIds:[]},!1)}),this.setState({editingGroupId:null})}};if(g&&!this.state.selectedElementIds[g.id]){let x=y.filter(S=>S.frameId!==g.id&&Oo(S,v,this.state));this.state.editingGroupId&&b(x),v=$r(v,x,g,this.state)}else if(!g&&this.state.editingGroupId){let x=y.filter(S=>S.frameId&&!Oo(S,v,this.state));b(x)}v=zl(v,this.state,this),this.scene.replaceAllElements(v)}}if(i&&this.store.shouldCaptureIncrement(),i&&qi(i)&&this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(m=>m.id!==i.id),captureUpdate:B.NEVER}),t.resize.isResizing){let m=zl(this.scene.getElementsIncludingDeleted(),this.state,this),g=this.scene.getSelectedElements(this.state).filter(y=>de(y));for(let y of g)m=kp(m,No(this.scene.getElementsIncludingDeleted(),y,this.state,c),y,this);this.scene.replaceAllElements(m)}let U=t.hit.element;this.state.selectedLinearElement?.elementId!==U?.id&&he(U)&&this.scene.getSelectedElements(this.state).length===1&&this.setState({selectedLinearElement:new Z(U)}),(!l||l&&(!U&&!s||U&&U.id!==l))&&this.finishImageCropping();let f=this.lastPointerDownEvent,p=this.lastPointerUpEvent||this.lastPointerMoveEvent;if(an(this.state)&&f&&p){if(this.eraserTrail.endPath(),Te(w(f.clientX,f.clientY),w(p.clientX,p.clientY))===0){let m=$e({clientX:p.clientX,clientY:p.clientY},this.state);this.getElementsAtPosition(m.x,m.y).forEach(g=>this.elementsPendingErasure.add(g.id))}this.eraseElements();return}else this.elementsPendingErasure.size&&this.restoreReadyToEraseElements();if(U&&!t.drag.hasOccurred&&!t.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!t.boxSelection.hasOccurred)&&(a.shiftKey&&!this.state.editingLinearElement?this.state.selectedElementIds[U.id]?jf(this.state,U)?this.setState(m=>{let g={...m.selectedElementIds};for(let y of U.groupIds.flatMap(v=>je(this.scene.getNonDeletedElements(),v)))delete g[y.id];return{selectedGroupIds:{...m.selectedElementIds,...U.groupIds.map(y=>({[y]:!1})).reduce((y,v)=>({...y,...v}),{})},selectedElementIds:Ae(g,m)}}):this.state.selectedLinearElement?.isDragging||this.setState(m=>{let g={...m.selectedElementIds};delete g[U.id];let y=be(this.scene.getNonDeletedElements(),{selectedElementIds:g});return{...Xt({editingGroupId:m.editingGroupId,selectedElementIds:g},this.scene.getNonDeletedElements(),m,this),selectedLinearElement:y.length===1&&he(y[0])?new Z(y[0]):m.selectedLinearElement}}):U.frameId&&this.state.selectedElementIds[U.frameId]?this.setState(m=>{let g={...m.selectedElementIds,[U.id]:!0};return delete g[U.frameId],(this.scene.getElement(U.frameId)?.groupIds??[]).flatMap(y=>je(this.scene.getNonDeletedElements(),y)).forEach(y=>{delete g[y.id]}),{...Xt({editingGroupId:m.editingGroupId,selectedElementIds:g},this.scene.getNonDeletedElements(),m,this),showHyperlinkPopup:U.link||ea(U)?"info":!1}}):this.setState(m=>({selectedElementIds:Ae({...m.selectedElementIds,[U.id]:!0},m)})):this.setState(m=>({...Xt({editingGroupId:m.editingGroupId,selectedElementIds:{[U.id]:!0}},this.scene.getNonDeletedElements(),m,this),selectedLinearElement:he(U)&&m.selectedLinearElement?.elementId!==U.id?new Z(U):m.selectedLinearElement}))),!(U&&q(U))&&!t.drag.hasOccurred&&!this.state.isResizing&&(U&&Qv({x:t.origin.x,y:t.origin.y,element:U,shape:Rn(U,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:de(U)?this.frameNameBoundsCache.get(U):null},c)||!U&&t.hit.hasHitCommonBoundingBoxOfSelectedElements)){this.state.editingLinearElement?this.setState({editingLinearElement:null}):this.setState({selectedElementIds:Ae({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),Be(this.interactiveCanvas,Pe.AUTO);return}if(!o.locked&&o.type!=="freedraw"&&n&&this.setState(m=>({selectedElementIds:Ae({...m.selectedElementIds,[n.id]:!0},m),showHyperlinkPopup:ea(n)&&!n.link?"editor":m.showHyperlinkPopup})),(o.type!=="selection"||yt(this.scene.getNonDeletedElements(),this.state)||!At(this.state.previousSelectedElementIds,this.state.selectedElementIds))&&this.store.shouldCaptureIncrement(),t.drag.hasOccurred||d||u||s){let m=this.scene.getSelectedElements(this.state).filter(he);co(m,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,Gi(this.state),this.state.selectedLinearElement?.selectedPointsIndices??[],this.state.zoom)}if(o.type==="laser"){this.laserTrails.endPath();return}!o.locked&&o.type!=="freedraw"?(Ha(this.interactiveCanvas),this.setState({newElement:null,suggestedBindings:[],activeTool:ft(this.state,{type:"selection"})})):this.setState({newElement:null,suggestedBindings:[]}),U&&this.lastPointerUpEvent&&this.lastPointerDownEvent&&this.lastPointerUpEvent.timeStamp-this.lastPointerDownEvent.timeStamp<300&&Re.pointers.size<=1&&ya(U)&&this.isIframeLikeElementCenter(U,this.lastPointerUpEvent,t.origin.x,t.origin.y)&&this.handleEmbeddableCenterClick(U)})}clearSelection(t){this.setState(a=>({selectedElementIds:Ae({},a),activeEmbeddable:null,selectedGroupIds:{},editingGroupId:a.editingGroupId&&t!=null&&Mr(t,a.editingGroupId)?a.editingGroupId:null})),this.setState({selectedElementIds:Ae({},this.state),activeEmbeddable:null,previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(t,a,n,i){if(i){let l=i.x+i.width/2,r=i.y+i.height/2,o=Oc(i,n,this.scene.getNonDeletedElementsMap());if(o&&(l=o.x,r=o.y),Math.hypot(t-l,a-r)<Kg){let{x:d,y:u}=ma({sceneX:l,sceneY:r},n);return{viewportX:d,viewportY:u,elementCenterX:l,elementCenterY:r}}}}getCanvasOffsets(){if(this.excalidrawContainerRef?.current){let t=this.excalidrawContainerRef.current,{left:a,top:n}=t.getBoundingClientRect();return{offsetLeft:a,offsetTop:n}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){let t=Ho.find(a=>a.code===this.props.langCode)||Qi;await U2(t),this.setAppState({})}},SD=()=>{(me.MODE===Qt.TEST||me.DEV)&&(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app?.scene.getElementsIncludingDeleted()},set(e){return this.app?.scene.replaceAllElements(Un(e))}},scene:{configurable:!0,get(){return this.app?.scene}}}))};SD();var MD=xD,CD=()=>{Array.prototype.at||Object.defineProperty(Array.prototype,"at",{value:function(e){if(e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]},writable:!0,enumerable:!1,configurable:!0}),Element.prototype.replaceChildren||(Element.prototype.replaceChildren=function(...e){this.innerHTML="",this.append(...e)})},kD=CD,D5=({children:e})=>{let{FooterCenterTunnel:t}=Yt(),a=Nt();return h(t.In,{children:h("div",{className:Q("footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":a.zenModeEnabled}),children:e})})},ID=D5;D5.displayName="FooterCenter";var TD=()=>h("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ExcalidrawLogo-icon",children:h("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"})}),LD=()=>M("svg",{viewBox:"0 0 450 55",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"ExcalidrawLogo-text",children:[h("path",{d:"M429.27 96.74c2.47-1.39 4.78-3.02 6.83-4.95 1.43-1.35 2.73-2.86 3.81-4.51-.66.9-1.4 1.77-2.23 2.59-2.91 2.84-5.72 5.09-8.42 6.87h.01ZM343.6 69.36c.33 3.13.58 6.27.79 9.4.09 1.37.18 2.75.25 4.12-.12-4.46-.27-8.93-.5-13.39-.11-2.08-.24-4.16-.4-6.24-.06 1.79-.11 3.85-.13 6.11h-.01ZM378.47 98.34c.01-.37.07-1.13.01-6.51-.11 1.9-.22 3.81-.31 5.71-.07 1.42-.22 2.91-.16 4.35.39.03.78.07 1.17.1-.92-.85-.76-2.01-.72-3.66l.01.01ZM344.09 86.12c-.09-2.41-.22-4.83-.39-7.24v12.21c.15-.05.32-.09.47-.14.05-1.61-.03-3.23-.09-4.83h.01ZM440.69 66.79c-.22-.34-.45-.67-.69-.99-3.71-4.87-9.91-7.14-15.65-8.55-1.05-.26-2.12-.49-3.18-.71 2.29.59 4.48 1.26 6.64 2.02 7.19 2.54 10.57 5.41 12.88 8.23ZM305.09 72.46l1.2 3.6c.84 2.53 1.67 5.06 2.46 7.61.24.78.5 1.57.73 2.36.22-.04.44-.08.67-.12a776.9 776.9 0 0 1-5.01-13.57c-.02.04-.03.09-.05.13v-.01ZM345.49 90.25v.31c1.48-.42 3.05-.83 4.66-1.2-1.56.25-3.12.52-4.66.89ZM371.02 90.22c0-.57-.04-1.14-.11-1.71-.06-.02-.12-.04-.19-.05-.21-.05-.43-.08-.65-.11.42.16.74.88.95 1.87ZM398.93 54.23c-.13 0-.27-.01-.4-.02l.03.4c.11-.15.23-.27.37-.38ZM401.57 62.28v-.15c-1.22-.24-2.86-.61-3.23-1.25-.09-.15-.18-.51-.27-.98-.09.37-.2.73-.33 1.09 1.24.56 2.52.98 3.83 1.29ZM421.73 88.68c-2.97 1.65-6.28 3.12-9.69 3.68v.18c4.72-.14 11.63-3.85 16.33-8.38-2.04 1.75-4.33 3.24-6.63 4.53l-.01-.01ZM411.28 80.92c-.05-1.2-.09-2.4-.15-3.6-.21 5.66-.46 11.38-.47 14.51.24-.02.48-.04.71-.07.15-3.61.05-7.23-.09-10.83v-.01Z",transform:"translate(-144.023 -51.76)"}),h("path",{d:"M425.38 67.41c-3.5-1.45-7.19-2.57-14.06-3.62.09 1.97.06 4.88-.03 8.12.03.04.06.09.06.15.19 1.36.28 2.73.37 4.1.25 3.77.39 7.55.41 11.33 0 1.38-.01 2.76-.07 4.13 1.4-.25 2.78-.65 4.12-1.15 4.07-1.5 7.94-3.78 11.28-6.54 2.33-1.92 5.13-4.49 5.88-7.58.63-3.53-2.45-6.68-7.97-8.96l.01.02ZM411.35 92.53v-.06l-.34.03c.11.01.22.03.34.03ZM314.26 64.06c-.23-.59-.47-1.17-.7-1.75.57 1.62 1.11 3.25 1.6 4.9l.15.54 2.35 6.05c.32.82.66 1.64.98 2.46-1.38-4.1-2.83-8.17-4.39-12.2h.01ZM156.82 103.07c-.18.13-.38.23-.58.33 1.32-.03 2.66-.2 3.93-.34.86-.09 1.72-.22 2.58-.33-2.12.1-4.12.17-5.94.34h.01ZM210.14 68.88s.03.04.05.07c.18-.31.39-.64.58-.96-.21.3-.42.6-.64.89h.01ZM201.65 82.8c-.5.77-1.02 1.56-1.49 2.37 1.11-1.55 2.21-3.1 3.2-4.59-.23.23-.49.51-.75.79-.32.47-.65.95-.96 1.43ZM194.03 98.66c-.33-.4-.65-.84-1.05-1.17-.24-.2-.07-.49.17-.56-.23-.26-.42-.5-.63-.75 1.51-2.55 3.93-5.87 6.4-9.28-.17-.08-.29-.28-.2-.49.04-.09.09-.17.13-.26-1.21 1.78-2.42 3.55-3.61 5.33-.87 1.31-1.74 2.64-2.54 4-.29.5-.63 1.04-.87 1.61.81.65 1.63 1.27 2.47 1.88-.09-.11-.18-.21-.27-.32v.01ZM307.79 82.93c-1-3.17-2.05-6.32-3.1-9.48-1.62 4.08-3.69 9.17-6.16 15.19 3.32-1.04 6.77-1.87 10.27-2.5-.32-1.08-.67-2.15-1.01-3.21ZM149.5 80.7c.05-1.71.04-3.43 0-5.14-.1 2.26-.16 4.51-.22 6.77-.02.73-.03 1.46-.04 2.19.14-1.27.2-2.55.24-3.82h.02ZM228.98 98.3c.39 1.25.91 3.03.94 3.91.06-.03.12-.07.17-.1.08-1.29-.55-2.65-1.11-3.81ZM307.72 53.36c.81.5 1.53 1.04 2.07 1.49-.38-.8-.78-1.58-1.21-2.35-.17.03-.34.06-.51.11-.43.12-.86.26-1.29.41.35-.01.53.1.94.34ZM283.69 96.14c3.91-7.25 6.89-13.35 8.88-18.15l1.1-2.66c-1.27 2.64-2.56 5.27-3.83 7.9-1.53 3.15-3.06 6.31-4.58 9.47-.87 1.81-1.76 3.62-2.54 5.47.04.02.07.04.11.07.05.05.1.09.15.14.05-.73.27-1.48.71-2.24ZM289.92 103.23s-.04.01-.05.03c0-.02.04-.03.05-.04.05-.05.11-.1.16-.15l.21-.21c-.55 0-1.5-.27-2.55-.72.4.26.8.51 1.22.74.24.13.48.26.73.37.05.02.1.03.14.05a.27.27 0 0 1 .08-.07h.01ZM269.23 68.49c-.39-.19-.82-.48-1.33-.87-3.06-1.56-6.31-2.78-9.36-2.35-3.5.49-5.7 1.11-7.74 2.44 5.71-2.6 12.82-2.07 18.44.79l-.01-.01ZM177.87 53.69l1.06.03c-.96-.22-2-.25-2.89-.3-4.95-.26-9.99.33-14.86 1.19-2.44.43-4.88.95-7.28 1.59 9.09-1.76 15.69-2.77 23.97-2.51ZM219.85 55.51c-.18.12-.36.27-.56.45-.45.53-.86 1.11-1.26 1.66-1.91 2.61-3.71 5.31-5.57 7.95l-.12.18 8.05-10.11c-.18-.05-.36-.1-.55-.13h.01ZM510.71 54.1c.12-.15.29-.3.53-.45.69-.4 3.72-.63 5.87-.74-.36-.02-.73-.04-1.09-.05-1.84-.03-3.67.09-5.49.35.05.3.12.59.18.88v.01ZM510.76 86.02c1.37-3.07 2.49-6.27 3.57-9.46.55-1.64 1.12-3.3 1.6-4.97-1.59 4.01-3.67 9.14-6.2 15.3.24-.08.5-.14.74-.22.1-.22.19-.44.29-.65ZM566.95 75.76c.11-.02.23.03.31.11-.05-.13-.09-.26-.14-.39-.05.09-.11.18-.17.28ZM511.33 86.41c3.08-.89 6.24-1.62 9.46-2.14-1.51-3.98-2.98-7.96-4.39-11.87-.05.15-.09.31-.14.46-1.02 3.32-2.15 6.61-3.39 9.85-.48 1.25-.98 2.49-1.53 3.7h-.01ZM578.24 74.45c.11-.44.23-.87.35-1.31-.31.7-.64 1.39-.97 2.08.09.21.19.4.28.61.12-.46.23-.92.35-1.38h-.01ZM520.62 53.11c-.09 0-.18-.01-.28-.02.38.34.29 1.08.93 2.53l6.65 17.15c2.2 5.68 4.69 11.36 7.41 16.87l1.06 2.17c-2.95-7.05-5.92-14.08-8.87-21.13-1.58-3.79-3.16-7.59-4.7-11.4-.78-1.92-1.73-3.89-2.25-5.91-.03-.1 0-.19.04-.26h.01ZM578.78 77.87c1.45-5.77 3.07-10.43 3.58-13.36.05-.34.16-.88.31-1.55-.67 1.79-1.37 3.56-2.08 5.33-.12.43-.23.86-.35 1.29-.65 2.43-1.29 4.86-1.9 7.3.14.33.29.65.43 1l.01-.01ZM545.3 94.66c.02-.44.03-.83.05-1.12.02-1.01.05-2.02.11-3.02.03-6.66-.46-14.33-1.46-22.8-.13-.42-.27-1.24-.56-2.89 0-.02 0-.04-.01-.06.62 6.61.95 13.25 1.32 19.87.17 3.08.33 6.16.52 9.23.02.25.03.52.04.78l-.01.01ZM580.77 102.81c.13.2.27.38.37.49.27-.11.53-.22.8-.32-.43.09-.82.05-1.17-.16v-.01ZM530.48 104.07h.33c-.36-.13-.71-.32-1.04-.56.14.24.3.47.45.7.06-.08.14-.13.26-.13v-.01ZM542.63 58.82c.06.23.11.47.15.71.14-.33.36-.62.7-.86-.28.05-.57.11-.85.15ZM583.81 57.87c.15-.7.29-1.41.42-2.11-.14.45-.28.9-.42 1.34-.46 1.44-.89 2.89-1.31 4.34.44-1.19.88-2.37 1.31-3.57ZM523.62 91.48c-4.66 1.17-9.05 2.89-14.02 5.27 4.65-1.84 9.48-3.29 14.28-4.63-.09-.22-.17-.41-.26-.64ZM460.64 78.3c-.04-2.9-.11-5.81-.28-8.71-.1-1.68-.17-3.43-.5-5.09-.07.02-.14.03-.2.05.3 6.54.45 12.17.51 17.12.17-.07.34-.14.51-.2 0-1.06-.01-2.11-.03-3.17h-.01ZM470.63 63.24c-3.38-.26-6.81.32-10.1 1.1.41 2.01.47 4.14.57 6.18.18 3.55.25 7.11.27 10.67 3.31-1.38 6.5-3.12 9.3-5.35 1.96-1.56 3.86-3.41 5.02-5.66.73-1.41 1.19-3.22.26-4.65-1.09-1.7-3.46-2.14-5.32-2.29ZM460.29 63.68c1-.24 2.01-.46 3.04-.65-1.15.16-2.37.38-3.71.69v.13c.07-.02.15-.04.22-.05.11-.13.3-.18.45-.11v-.01ZM457.24 100.96c.43-.03.86-.07 1.29-.11.14-.49.27-.99.38-1.49-.44.7-1 1.23-1.67 1.6ZM482.88 104.98c-.18.23-.36.38-.55.47.14.09.27.19.4.28a70.76 70.76 0 0 0 4.37-4.63c.76-.89 1.52-1.81 2.19-2.77-.3-.27-.61-.53-.92-.79-.07 1.94-4.62 6.32-5.49 7.45v-.01Z",transform:"translate(-144.023 -51.76)"}),h("path",{d:"M474.36 63.31c-.4-.16-.84-.27-1.29-.37 1.56.42 3.08 1.22 3.76 2.74.62 1.4.32 2.95-.28 4.32.7-1.22.94-2.34.74-3.47-.24-1.33-1.19-2.54-2.93-3.21v-.01ZM477.34 89.18c-1.2-.81-2.4-1.62-3.6-2.42-.14.1-.26.19-.4.29 1.4.67 2.73 1.39 4 2.13ZM465.88 93.85c.37.25.74.5 1.1.75.46.32.92.65 1.38.97-1.57-1.2-2.01-1.61-2.49-1.72h.01ZM574.92 90.06c-2.28-5.21-4.93-11.13-5.67-12.26-.1-.15-1.57-3.01-1.63-3.08 0 0-.01.02-.02.02.4 1.37 1.09 2.69 1.65 3.99 2.14 4.95 4.36 9.86 6.67 14.73.6 1.26 1.21 2.52 1.83 3.78-.75-2.01-1.64-4.45-2.83-7.18ZM448.73 65.29c.1.2.22.38.34.57.22-.02.43-.06.65-.08v-.08c-.14-.05-.25 0-.99-.41ZM460.16 94.81c-.02.31-.06.59-.1.89-.03 1.71-.33 3.43-.79 5.07.15-.02.3-.03.45-.05.01-.04.02-.08.03-.11.09-.34.15-.69.2-1.03.17-1.07.25-2.16.33-3.24.05-.69.08-1.39.12-2.08-.27.1-.27.26-.24.57v-.02Z",transform:"translate(-144.023 -51.76)"}),h("path",{d:"m328.67 98.12-3.22-6.58c-1.29-2.63-2.53-5.29-3.72-7.97-.25-.85-.52-1.69-.79-2.53-.81-2.57-1.67-5.12-2.55-7.67-1.92-5.53-3.9-11.08-6.32-16.41-.72-1.58-1.46-3.44-2.63-4.79-.03-.17-.16-.29-.34-.36a.282.282 0 0 0-.23-.04c-.06-.01-.12 0-.18.01-.74.06-1.5.38-2.19.61-2.22.77-4.4 1.64-6.63 2.38-.03-.08-.06-.16-.09-.25-.15-.42-.82-.24-.67.19.03.09.07.19.1.28l-.18.06c-.36.11-.28.6 0 .68.18 1.18.63 2.36.98 3.49.03.09.06.17.08.26-.08.23-.17.46-.24.64-.37.98-.79 1.94-1.21 2.9-1.27 2.89-2.62 5.75-3.98 8.6-3.18 6.67-6.44 13.31-9.64 19.97-1.08 2.25-2.2 4.5-3.15 6.81-.13.32.24.5.5.37 1.34 1.33 2.84 2.5 4.4 3.57.65.44 1.31.87 2.01 1.24.4.22.86.48 1.33.5.24.01.35-.19.33-.37.11-.1.21-.21.28-.28.41-.41.81-.84 1.2-1.26.85-.92 1.69-1.87 2.5-2.84 6.31-2.34 12.6-4.31 18.71-5.84 2.14 5.3 3.43 8.43 3.97 9.58.55 1.05 1.15 1.88 1.82 2.52 1.32.56 6.96-.03 9.23-1.96.87-1.28 1.19-2.67.93-4.15-.09-.5-.22-.95-.4-1.33l-.01-.03Zm-20.09-45.61c.43.77.83 1.56 1.21 2.35-.54-.45-1.27-.99-2.07-1.49-.42-.24-.6-.35-.94-.34.43-.15.85-.29 1.29-.41.17-.05.34-.08.51-.11Zm-25.86 45.66c.78-1.85 1.67-3.66 2.54-5.47 1.51-3.16 3.05-6.31 4.58-9.47 1.28-2.63 2.56-5.26 3.83-7.9l-1.1 2.66c-1.99 4.79-4.97 10.9-8.88 18.15-.43.76-.66 1.51-.71 2.24-.05-.05-.1-.09-.15-.14a.259.259 0 0 0-.11-.07Zm6.24 4.71c-.42-.23-.82-.48-1.22-.74 1.05.45 2 .72 2.55.72l-.21.21c-.05.05-.11.1-.16.15-.01.01-.04.03-.05.04 0-.02.03-.02.05-.03a.27.27 0 0 0-.08.07c-.05-.02-.1-.03-.14-.05-.25-.1-.49-.24-.73-.37h-.01Zm15.73-29.43c1.05 3.15 2.1 6.31 3.1 9.48.34 1.06.69 2.13 1.01 3.21-3.5.63-6.95 1.46-10.27 2.5 2.48-6.03 4.54-11.11 6.16-15.19Zm4.79 12.57c-.23-.79-.49-1.58-.73-2.36-.79-2.54-1.63-5.08-2.46-7.61l-1.2-3.6c.02-.04.04-.09.05-.13 1.6 4.45 3.28 9 5.01 13.57l-.67.12v.01Zm5.83-18.27-.15-.54c-.49-1.64-1.03-3.28-1.6-4.9.23.58.47 1.17.7 1.75 1.56 4.03 3.01 8.1 4.39 12.2-.33-.82-.67-1.64-.98-2.46l-2.35-6.05h-.01ZM390.43 79.37c-.13-10.43-.22-17.5-.24-19.97-.24-1.6.21-2.88-.65-3.65-.14-.13-.32-.23-.52-.32h.03c.45 0 .45-.69 0-.7-1.75-.03-3.5-.04-5.25-.14-1.38-.08-2.76-.21-4.15-.31-.07 0-.12.01-.17.04-.21-.07-.47.03-.45.31l.03.45c-.11.14-.19.3-.22.5-.21 1.26-.32 13.67-.36 23.59-.32 5.79-.67 11.57-.97 17.36-.09 1.73-.29 3.54-.21 5.3-.39.02-.38.64.04.69v.12c.05.44.74.45.7 0v-.06c1.1.09 2.2.21 3.3.3 1.14.19 2.44.2 3.29.17 1.73-.05 2.92-.05 3.8-.37.45-.05.9-.11 1.35-.17.44-.06.25-.73-.19-.67h-.01c.24-.32.45-.72.62-1.25.66-1.84.41-6.36.34-11.33l-.13-9.9.02.01Zm-12.26 18.17c.09-1.91.2-3.81.31-5.71.06 5.38 0 6.14-.01 6.51-.05 1.65-.21 2.81.72 3.66-.39-.04-.78-.07-1.17-.1-.06-1.44.09-2.93.16-4.35l-.01-.01ZM588.97 53.85c-2.06-.25-3.17-.51-3.76-.6a.3.3 0 0 1 .04-.08c.22-.39-.39-.75-.6-.35-.56 1.02-.9 2.19-1.26 3.29-.61 1.88-1.17 3.78-1.72 5.68-.63 2.19-1.24 4.39-1.83 6.59-.81 2.03-1.67 4.05-2.61 6.03-1.7-3.64-3.11-6.04-4.03-7.57-2.26-3.74-2.85-5.48-3.57-6.08l.31-.09c.43-.12.25-.8-.19-.67-1.06.3-2.12.6-3.17.95-.93.32-1.85.69-2.76 1.07-.13.05-.19.16-.22.27-.04.02-.08.05-.11.07-.04-.06-.07-.12-.11-.18a.354.354 0 0 0-.48-.12c-.16.09-.22.32-.13.48l.33.54c0 .09.02.18.06.28.51 1.16.78 1.38.72 1.47-2.42 3.44-5.41 7.86-6.2 9.1-1.27 1.97-2.01 3.14-2.45 3.84l-.91-6.56-.43-4.1c-.19-1.85-.37-3.23-.53-4.13-.19-1.1-.3-2.15-.45-3.16-.2-1.36-.29-2.06-.47-2.42h.04c.45.02.45-.68 0-.7-3.43-.16-6.81.94-10.17 1.48-.24-.22-.73-.04-.58.32.24.59.33 1.25.43 1.87.17 1.06.29 2.13.4 3.2.32 3.09.53 6.2.74 9.3.44 6.75.77 13.51 1.17 20.26.11 1.95.13 3.96.46 5.89.05.3.37.31.55.14.74 1.71 2.87 1.27 6.13 1.27 1.34 0 2.39.04 2.99-.11.02.32.48.53.63.18 3.61-8.26 7.41-16.46 12.05-24.2.03-.05.04-.1.05-.15.3.73.64 1.45.94 2.16.97 2.26 1.97 4.52 2.98 6.76 2.26 5.03 4.54 10.07 7.09 14.96.47.9.94 1.79 1.47 2.65.2.32.4.67.66.96-.18.25 0 .68.34.54.91-.38 1.82-.75 2.76-1.07 1.04-.35 2.11-.65 3.17-.95.39-.11.28-.66-.07-.68.62-.4.95-.96.87-1.91-.3-3.34.72-7.47.86-8.52l2.14-11.43c1.75-10.74 3.13-17.51 3.23-20.86.02-.49.08-2.84.13-3.24.17-1.25.48-1-4.96-1.65l.03-.02Zm-46.19 5.67c-.04-.24-.09-.48-.15-.71l.85-.15c-.34.24-.56.53-.7.86Zm1.95 25.12c-.36-6.63-.7-13.26-1.32-19.87 0 .02 0 .04.01.06.29 1.65.44 2.47.56 2.89 1 8.46 1.5 16.14 1.46 22.8-.06.99-.1 2-.11 3.02-.01.29-.03.68-.05 1.12-.01-.26-.03-.53-.04-.78-.19-3.08-.35-6.16-.52-9.23l.01-.01Zm36.4 18.66c-.11-.11-.24-.29-.37-.49.35.21.74.26 1.17.16-.27.11-.53.22-.8.32v.01Zm-.89-33.72c.12-.43.23-.86.35-1.29.71-1.77 1.41-3.55 2.08-5.33-.15.68-.26 1.22-.31 1.55-.5 2.94-2.13 7.59-3.58 13.36-.15-.35-.29-.66-.43-1 .61-2.44 1.25-4.87 1.9-7.3l-.01.01Zm3.56-12.48c.14-.44.28-.89.42-1.34-.13.7-.27 1.41-.42 2.11-.43 1.19-.86 2.38-1.31 3.57.42-1.45.85-2.9 1.31-4.34Zm-5.22 16.05c-.11.44-.23.87-.35 1.31-.12.46-.23.92-.35 1.38-.1-.22-.19-.4-.28-.61.34-.69.66-1.38.97-2.08h.01Zm-11.64 2.62c.06-.1.12-.19.17-.28.05.13.09.26.14.39a.398.398 0 0 0-.31-.11Zm2.3 2.98c-.56-1.3-1.25-2.63-1.65-3.99 0 0 .01-.02.02-.02.06.08 1.52 2.93 1.63 3.08.73 1.13 3.38 7.04 5.67 12.26 1.2 2.73 2.08 5.17 2.83 7.18-.62-1.25-1.23-2.51-1.83-3.78-2.31-4.87-4.53-9.78-6.67-14.73ZM275.92 87.03c-1.06-2.18-1.13-3.45-2.44-2.93-1.52.57-2.94 1.3-4.5 2.1-1.4.72-2.68 1.44-3.92 2.12.01-.25-.24-.5-.51-.34-4.8 2.93-12.41 4.7-17.28 1.31-1.98-1.77-3.32-4.15-3.97-5.78-.29-.95-.49-1.94-.63-2.93-.14-3.34 1.58-6.53 3.9-9.12.8-.79 1.68-1.51 2.66-2.12 3.7-2.3 8.22-3.07 12.51-2.51 2.71.35 5.32 1.24 7.71 2.55.39.22.75-.39.35-.6-.18-.1-.37-.18-.55-.27.56.27 1.03.33 1.51.19l-.48.39c-.15.11-.23.3-.13.48.09.15.33.24.48.13 1.3-.97 2.46-2.09 3.45-3.37.37-.29.64-.6.65-.97v-.02c.08-.33-.03-.7-.21-1.08-.31-.87-.98-2.01-2.19-3.26-2.43-2.52-3.79-3.45-5.68-4.26-1.14-.49-3.12-1.06-4.42-1.23-3.28-.42-10.64-1.21-18.18 4.11-7.74 5.46-11.94 12.3-12.23 20.61-.08 2.06.04 3.98.34 5.71.74 4.18 2.57 8 5.44 11.34 4.26 4.99 9.76 7.52 16.34 7.52 4.85 0 9.69-1.77 14.89-4.62.23-.12.45-.23.68-.35 2.19-1.1 4.37-2.23 6.46-3.5.49-.3 1.03-.61 1.5-.98 1.47-.87 1.11-1.12.49-2.95-.39-1.14-.76-2.7-2.06-5.36l.02-.01Zm-17.38-21.76c3.05-.42 6.31.79 9.36 2.35.51.39.94.68 1.33.87-5.61-2.86-12.72-3.39-18.44-.79 2.05-1.33 4.24-1.95 7.74-2.44l.01.01ZM443.67 72.67c-.4-2.2-1.15-4.33-2.37-6.22-1.49-2.32-3.58-4.19-5.91-5.64-6.17-3.81-13.75-5.11-20.83-6.01-3.23-.41-6.47-.69-9.72-.92l-1.39-.12c-.85-.07-1.52-.1-2.05-.1-1.08-.06-2.17-.12-3.25-.17-.08 0-.14.02-.19.05-.1.05-.18.14-.16.3.27 2.55-.01 5.12-.92 7.52-.15.38.4.56.62.28 1.32.59 2.68 1.05 4.08 1.37 0 2.78-.14 7.58-.33 12.91 0 0 0 .02-.01.03-.61 3.66-.79 7.42-1 11.12-.23 4.01-.43 8.03-.44 12.05 0 .64 0 1.28.03 1.93.02.31 0 .68.15.96.06.11.14.16.24.17-.2.17-.21.54.11.59 3.83.67 7.78.71 11.68.25 2.3-.19 4.87-.65 7.65-1.56 1.85-.54 3.67-1.18 5.43-1.91 7.2-3.02 14.31-8.07 17.35-15.53.76-1.86 1.17-3.8 1.31-5.75.3-1.93.28-3.82-.09-5.58l.01-.02Zm-19.32-15.42c5.74 1.41 11.94 3.68 15.65 8.55.25.32.47.65.69.99-2.3-2.82-5.68-5.69-12.88-8.23-2.16-.76-4.35-1.43-6.64-2.02 1.06.21 2.13.45 3.18.71Zm-25.82-3.04c.13 0 .27.01.4.02-.14.1-.26.23-.37.38 0-.13-.02-.26-.03-.4Zm34.82 22.17c-.75 3.09-3.55 5.66-5.88 7.58-3.35 2.76-7.21 5.03-11.28 6.54-1.33.49-2.71.9-4.12 1.15.06-1.38.08-2.76.07-4.13-.02-3.78-.16-7.56-.41-11.33-.09-1.37-.18-2.74-.37-4.1 0-.06-.03-.11-.06-.15.09-3.25.12-6.16.03-8.12 6.86 1.05 10.56 2.17 14.06 3.62 5.52 2.28 8.59 5.44 7.97 8.96l-.01-.02Zm-22 16.15c-.12 0-.23-.02-.34-.03l.34-.03v.06Zm-.69-.7c0-3.13.26-8.84.47-14.51.06 1.2.11 2.41.15 3.6.15 3.6.25 7.23.09 10.83-.24.03-.48.05-.71.07v.01Zm-12.33-30.94c.37.63 2.01 1.01 3.23 1.25v.15c-1.31-.31-2.59-.73-3.83-1.29.12-.36.23-.72.33-1.09.08.48.18.84.27.98Zm13.7 31.65v-.18c3.41-.56 6.71-2.02 9.69-3.68 2.31-1.28 4.59-2.78 6.63-4.53-4.69 4.53-11.61 8.24-16.33 8.38l.01.01Zm24.07-.75c-2.05 1.93-4.37 3.56-6.83 4.95 2.7-1.78 5.52-4.03 8.42-6.87.82-.82 1.56-1.69 2.23-2.59-1.08 1.65-2.38 3.16-3.81 4.51h-.01ZM187.16 92.14c-.79-2.47-2.1-7.12-3.1-6.87-.19-.01-2.09.77-4.08 1.54-3.06 1.18-5.91 2.13-10.09 2.82-2.74.42-5.87 1.01-10.61 1.06.04-3.34.05-6.01.05-7.99 7.97-.65 12.33-2.11 16.37-3.55 1.11-.39 2.69-1.01 2.63-1.8-.08-.35-.55-1.39-1.17-2.61-.47-1.16-.98-2.31-1.61-3.38-.42-.71-1.04-1.69-1.86-2.06-.11-.08-.22-.13-.29-.12-.02 0-.04 0-.07.01-.19-.04-.39-.05-.6-.01-.17.03-.24.15-.25.28-.04.02-.09.04-.14.05-4.33 1.48-8.85 2.33-13.24 3.61a499.1 499.1 0 0 0-.31-8.19c4.51-.99 8.88-1.38 13.11-1.82 3.68-.38 6.28.12 7.47.34.59.11.9.16 1.16.18h.1c-.1.37.44.66.62.28.02-.04.03-.08.05-.13.15.2.53.22.62-.1.17-.58.19-1.21.21-1.81v-.36c.03-.15.05-.3.07-.45.52-2.47.33-5.09-.64-7.44-.11-.27-.44-.28-.6-.14-.08-.21-.15-.42-.24-.62-.19-.41-.79-.05-.6.35.03.07.05.15.09.22-.98-.42-2.15-.54-3.17-.63-2.17-.19-4.37-.14-6.54 0-5.7.35-11.4 1.3-16.91 2.79-2.08.56-4.13 1.22-6.14 2-4.54 1.05-3.79 1.51-2.17 6.07.18.51.46 1.68.54 1.94.82 2.47 1.08 2.13 3.1 2.13s0 .05 0 .08h.52c-.48 2.66-.51 5.45-.62 8.13-.15 3.48-.22 6.96-.28 10.45 0 .41-.01.82-.02 1.23-.16.29-.33.57-.51.85-.05.38-.09.77-.14 1.18-.42 3.52-.59 6.48-.52 8.8v.34c.02.47.05.76.06.87.16 1.57-.26 3.47 1.35 3.79 1.61.32 3.5.55 4.85.55.11 0 .22-.02.33-.02 1.79.24 3.67.05 5.45-.12 2.85-.28 5.69-.7 8.51-1.19 3.03-.53 6.05-1.14 9.04-1.86 2.4-.58 4.82-1.19 7.13-2.06.51-.19 1.73-.57 2.46-1.14 1.81-.68 2.18-1 1.57-2.67-.23-.62-.48-1.49-.91-2.78l-.03-.02Zm-11.12-38.71c.89.05 1.93.08 2.89.3-.33 0-.68-.02-1.06-.03-8.28-.26-14.88.75-23.97 2.51 2.41-.64 4.85-1.16 7.28-1.59 4.87-.86 9.91-1.45 14.86-1.19Zm-26.53 22.13c.03 1.71.04 3.43 0 5.14-.04 1.27-.11 2.55-.24 3.82 0-.73.02-1.46.04-2.19.05-2.26.12-4.51.22-6.77h-.02Zm6.73 27.85c.2-.1.4-.21.58-.33 1.82-.17 3.82-.24 5.94-.34-.86.11-1.72.24-2.58.33-1.27.14-2.61.31-3.93.34h-.01ZM534.48 85.44c-3.52-8.38-7.07-16.75-10.5-25.17-.63-1.54-1.25-3.09-1.86-4.65-.31-.8-.65-1.6-.87-2.43-.04-.17-.17-.24-.31-.25.1-.2 0-.51-.29-.53-1.59-.08-3.18-.22-4.78-.25-1.96-.03-3.91.13-5.84.42-.31.05-.31.38-.13.56-.03.06-.05.14-.04.22.23 1.54.63 3.06 1.16 4.53.13.35.27.7.41 1.06l-2.68 6.18c-.11.03-.2.09-.25.22-.67 1.9-1.52 3.73-2.34 5.56a536.85 536.85 0 0 1-3.9 8.45c-2.64 5.64-5.34 11.25-7.91 16.93-.44.97-.88 1.94-1.29 2.93-.2.48-.47 1-.55 1.52v.05c-.02.12.02.26.16.34 1.19.73 2.41 1.41 3.66 2.05 1.2.62 2.45 1.25 3.76 1.61.43.12.62-.55.19-.67-1.13-.31-2.2-.83-3.24-1.36 1.09.36 2.1.69 2.75.93 2.82 1.01 2.38 1.1 4.3-3.75 2.1-1.09 4.34-1.96 6.53-2.79 4.35-1.64 8.8-3.03 13.27-4.29.82 2.01 1.77 3.97 2.72 5.92.35.83.62 1.45.79 1.82.22.42.45.8.69 1.15.17.33.33.67.5 1 .42.8.84 1.63 1.4 2.35.23.29.6 0 .55-.31 1.53-.02 3.06-.07 4.58-.27.92-.12 1.82-.32 2.71-.54 1.39-.27 3.85-1.11 3.74-1.42-.67-1.96-1.55-3.87-2.34-5.78-1.57-3.78-3.16-7.56-4.75-11.33v-.01Zm-11.65-26.16c1.54 3.81 3.12 7.6 4.7 11.4 2.94 7.05 5.91 14.09 8.87 21.13l-1.06-2.17c-2.71-5.51-5.2-11.19-7.41-16.87l-6.65-17.15c-.65-1.45-.55-2.19-.93-2.53.09 0 .18.01.28.02a.29.29 0 0 0-.04.26c.52 2.02 1.47 3.98 2.25 5.91h-.01Zm-6.58 13.58c.05-.15.09-.31.14-.46 1.41 3.92 2.88 7.9 4.39 11.87-3.22.52-6.38 1.25-9.46 2.14.55-1.22 1.05-2.46 1.53-3.7 1.24-3.24 2.37-6.53 3.39-9.85h.01Zm-.23-20c.36 0 .73.03 1.09.05-2.15.1-5.18.33-5.87.74-.24.15-.41.3-.53.45-.06-.29-.13-.58-.18-.88 1.82-.26 3.65-.39 5.49-.35v-.01Zm-.09 18.72c-.49 1.67-1.05 3.33-1.6 4.97-1.07 3.19-2.19 6.38-3.57 9.46-.09.21-.19.43-.29.65-.25.07-.5.14-.74.22 2.53-6.16 4.61-11.29 6.2-15.3Zm-6.34 25.16c4.97-2.38 9.37-4.1 14.02-5.27l.26.64c-4.8 1.35-9.63 2.8-14.28 4.63Zm20.17 6.76c.33.23.68.42 1.04.56h-.33c-.12 0-.21.06-.26.13-.15-.23-.31-.45-.45-.7v.01ZM226.57 91.75c-3.55-4.74-6.68-9.11-9.31-12.99 9.2-15.25 10.05-17.81 10.35-18.38.17-.34 1.09-2.27.64-2.53-1.13-.65-1.03-.65-2.97-1.71-1.19-.65-3.04-1.61-4.53-2.12-1.71-.59-1.24-.36-3 2.77-.06.1-.11.2-.17.3-.75 1.02-1.48 2.05-2.2 3.09-1.88 2.71-3.73 5.45-5.69 8.1-3.68-4.91-6.88-8.76-9.51-11.43-.15-.15-.3-.29-.46-.42-1.27-1.28-7.24 3.53-7.93 5.58-.09.09-.19.16-.28.25-.27.26.03.64.33.58.19.65.5 1.29.94 1.91 3.85 5.06 7.19 9.76 9.94 14-1.23 2.61-3.06 5-4.67 7.38l-2.28 3.33c-.5.66-.93 1.23-1.29 1.69-.67.93-2.09 2.61-2.3 3.87-.51.85-1.16 1.84-1.29 2.83-.06.44.61.63.67.19.01-.08.04-.15.06-.22 1.36 1.08 2.76 2.11 4.19 3.11 1.3.91 2.62 1.85 4.04 2.56.21.1.4 0 .48-.17.24.07.48.14.72.2.44.1.62-.57.19-.67-2.02-.48-3.77-1.57-5.23-3.02-.47-.46-.9-.96-1.32-1.46 1.74 1.35 4.2 2.89 5.89 4.14 1.39 1.03 2.85-2.27 4.22-4.2 1.86-2.64 3.96-5.86 5.52-8.29l10.39 14.51c.67.81 1.14 1.21 1.57 1.36-.05.24.12.51.41.4 1.53-.58 3.05-1.19 4.54-1.87 1.52-.69 3.06-1.45 4.36-2.5a.28.28 0 0 0 .12-.23c1.66-1.1.81-1.74-1.41-4.91-1.13-1.58-1.71-2.36-3.7-5.01l-.03-.02Zm2.41 6.54c.56 1.15 1.19 2.52 1.11 3.81-.06.04-.12.07-.17.1-.03-.88-.55-2.66-.94-3.91Zm-16.51-32.73c1.86-2.65 3.65-5.35 5.57-7.95.4-.55.81-1.13 1.26-1.66.19-.18.38-.33.56-.45.18.03.36.08.55.13l-8.05 10.11.12-.18h-.01ZM192.7 95.48c.79-1.37 1.66-2.69 2.54-4 1.19-1.79 2.4-3.56 3.61-5.33-.04.09-.09.17-.13.26-.1.22.03.41.2.49-2.47 3.42-4.89 6.73-6.4 9.28.21.24.4.48.63.75-.24.07-.4.36-.17.56.4.33.72.77 1.05 1.17.09.11.18.21.27.32-.84-.61-1.66-1.24-2.47-1.88.24-.57.58-1.11.87-1.61v-.01Zm7.46-10.32c.47-.81.98-1.59 1.49-2.37.31-.48.64-.95.96-1.43.26-.29.52-.56.75-.79-.99 1.48-2.09 3.03-3.2 4.59Zm10.03-16.22s-.03-.05-.05-.07c.22-.29.43-.59.64-.89-.2.32-.4.65-.58.96h-.01ZM371.54 87.96c-.01-.08-.01-.16-.03-.23-.06-.38-.58-.29-.66.03-.3-.05-.6-.08-.81-.11-1.14-.15-2.29-.19-3.44-.2 1.04-.09 2.09-.18 3.14-.23.45-.02.45-.72 0-.7-6.57.35-13.14 1.23-19.65 2.11-1.53.21-3.05.42-4.57.68-.01 0-.02.01-.04.01-.04-3.33-.13-6.66-.24-9.99-.19-5.7-.4-11.41-.88-17.1-.13-1.51-.23-3.07-.49-4.58 0-.25 0-.48-.02-.68-.06-1.19-.04-2.61-.68-2.78-.16-.07-.72-.16-1.5-.24.22-.17.16-.62-.2-.63-1.19-.04-2.39.09-3.57.23-1.2.14-2.41.32-3.59.6-.16-.1-.41-.06-.5.12-.06.02-.13.03-.19.05-.35.1-.29.55-.03.66-.26.6-.19 2.27-.21 3-.02.66-.66 33.73-.9 40.3-.03.65.06 1.12.04 1.45-.16 3.05.87 4.96 6.34 3.93 1.09-.08 2.75-.77 5.36-1.43 4.13-1.04 5.78-1.52 6.2-1.65 6.43-1.69 6.78-1.97 11.72-2.43.55-.05 4.8-.38 6.03-.3.64.04 1.19.07 1.65.1.09 0 .16-.03.24-.05.1.27.56.33.66-.02.39-1.32.61-2.71.78-4.08.2-1.61.29-3.24.15-4.86.24.03.52-.23.38-.53-.09-.2-.27-.33-.49-.43v-.02Zm-.63.56c.07.57.11 1.14.11 1.71-.21-.99-.53-1.71-.95-1.87.22.03.44.06.65.11.06.01.12.04.19.05Zm-25.41 1.73c1.54-.36 3.1-.64 4.66-.89-1.61.37-3.18.77-4.66 1.2v-.31Zm-.86-7.37c-.07-1.37-.16-2.75-.25-4.12-.21-3.13-.45-6.27-.79-9.4.02-2.25.08-4.31.13-6.11.16 2.08.29 4.16.4 6.24.23 4.46.38 8.93.5 13.39h.01Zm-.94-4c.16 2.41.29 4.83.39 7.24.06 1.6.14 3.22.09 4.83-.15.05-.32.09-.47.14V78.88h-.01ZM483.72 92.83c-3.05-2.28-6.22-4.4-9.38-6.51 8.86-6.49 13.49-12.95 13.73-19.23.04-.76 0-1.5-.13-2.2-.67-3.82-3.5-6.68-8.39-8.48.13.04.27.08.4.13 3.92 1.39 7.74 4.23 8.5 8.56.34 1.95-.05 3.96-.98 5.69-.21.4.39.75.6.35 1.86-3.46 1.46-7.55-.97-10.63-3.53-4.47-9.76-5.88-15.16-6.16-2.32-.12-4.64-.04-6.95.19-6 .32-12.71 1.68-17.63 3.21-.37.11-.67.23-.92.35-.2-.17-.62.02-.57.37v.03c-.64.68-.18 1.64.48 3.21.38.91.67 1.89 1.15 2.58.32.76.68 1.51 1.13 2.19.14.21.38.19.53.07.19-.02.38-.05.57-.08v1.57c-.06.06-.1.13-.11.23-.27 4.18-.34 8.38-.48 12.57l-.3 9.03c-.24 3.91-.44 6.77-.46 7.26-.05.88-.11 1.95.07 2.81-.01.22-.02.43-.04.65 0 .11-.02.23-.03.35 0 .05-.03.27-.01.16-.05.4.5.59.64.28.05.04.12.08.2.08 1.75.13 3.5.28 5.25.3 1.69.02 3.38-.12 5.06-.32.08.23.36.39.55.15.06-.08.11-.17.16-.26.18-.09.24-.32.18-.48.05-.2.1-.4.13-.6.16-.86.25-1.74.33-2.62.11-1.17.17-2.34.23-3.51.15-.01.32-.03.52-.04.36-.03 1.73-.15 2.06-.15.39 0 .7-.02.95-.04 1.76 1.11 3.45 2.35 5.14 3.55 2.83 2.01 5.64 4.04 8.47 6.04 1.42 1 2.85 2 4.29 2.97.1.06.19.07.27.04.08 0 .17-.02.25-.1 1.61-1.56 3.15-3.18 4.6-4.88.75-.88 1.49-1.78 2.15-2.73.01.01.03.02.04.03.34.3.83-.2.49-.49-2.16-1.9-4.34-3.76-6.64-5.48l.03-.01Zm-6.38-3.65a55.72 55.72 0 0 0-4-2.13c.14-.1.26-.19.4-.29 1.2.81 2.4 1.61 3.6 2.42Zm-20.1 11.78c.67-.37 1.23-.91 1.67-1.6-.11.5-.24 1-.38 1.49-.43.04-.86.08-1.29.11Zm2.38-37.24c1.34-.31 2.56-.52 3.71-.69-1.03.19-2.04.41-3.04.65-.14-.07-.34-.02-.45.11-.07.02-.15.04-.22.05v-.13.01Zm.04.84c.07-.02.14-.03.2-.05.34 1.66.41 3.41.5 5.09.17 2.9.24 5.81.28 8.71l.03 3.17c-.17.07-.34.14-.51.2-.06-4.96-.21-10.58-.51-17.12h.01Zm16.04 5.62c-1.16 2.25-3.06 4.1-5.02 5.66-2.8 2.23-5.99 3.97-9.3 5.35-.01-3.56-.09-7.12-.27-10.67-.1-2.04-.16-4.16-.57-6.18 3.3-.78 6.72-1.36 10.1-1.1 1.85.14 4.23.59 5.32 2.29.92 1.43.46 3.24-.26 4.65Zm.85-.18c.6-1.37.9-2.92.28-4.32-.67-1.52-2.2-2.32-3.76-2.74.46.1.89.21 1.29.37 1.74.67 2.69 1.88 2.93 3.21.2 1.13-.05 2.25-.74 3.47V70Zm-27.47-4.14c-.12-.19-.23-.38-.34-.57.74.42.85.36.99.41v.08c-.22.03-.43.06-.65.08Zm11.21 30.46c-.08 1.08-.16 2.17-.33 3.24-.05.35-.11.69-.2 1.03 0 .04-.02.07-.03.11-.15.02-.3.04-.45.05.45-1.64.76-3.36.79-5.07.03-.29.08-.57.1-.89-.03-.31-.03-.47.24-.57-.04.69-.07 1.39-.12 2.08v.02Zm5.6-2.47c.48.11.92.52 2.49 1.72-.46-.32-.92-.65-1.38-.97-.37-.25-.73-.5-1.1-.75h-.01Zm21.23 7.24a70.76 70.76 0 0 1-4.37 4.63c-.14-.09-.27-.19-.4-.28.19-.09.37-.24.55-.47.87-1.14 5.43-5.51 5.49-7.45.31.26.62.53.92.79-.67.97-1.42 1.88-2.19 2.77v.01Z",fill:"currentColor",transform:"translate(-144.023 -51.76)"})]}),DD=({style:e,size:t="small",withText:a})=>M("div",{className:`ExcalidrawLogo is-${t}`,style:e,children:[h(TD,{}),a&&h(LD,{})]}),H1=({icon:e,shortcut:t,children:a})=>{let n=vt();return M(te,{children:[h("div",{className:"welcome-screen-menu-item__icon",children:e}),h("div",{className:"welcome-screen-menu-item__text",children:a}),t&&!n.editor.isMobile&&h("div",{className:"welcome-screen-menu-item__shortcut",children:t})]})};H1.displayName="WelcomeScreenMenuItemContent";var fs=({onSelect:e,children:t,icon:a,shortcut:n,className:i="",...l})=>h("button",{...l,type:"button",className:`welcome-screen-menu-item ${i}`,onClick:e,children:h(H1,{icon:a,shortcut:n,children:t})});fs.displayName="WelcomeScreenMenuItem";var A5=({children:e,href:t,icon:a,shortcut:n,className:i="",...l})=>h("a",{...l,className:`welcome-screen-menu-item ${i}`,href:t,target:"_blank",rel:"noreferrer",children:h(H1,{icon:a,shortcut:n,children:e})});A5.displayName="WelcomeScreenMenuItemLink";var qa=({children:e})=>{let{WelcomeScreenCenterTunnel:t}=Yt();return h(t.In,{children:h("div",{className:"welcome-screen-center",children:e||M(te,{children:[h(X1,{}),h(W1,{children:E("welcomeScreen.defaults.center_heading")}),M(G1,{children:[h(Y1,{}),h(V1,{})]})]})})})};qa.displayName="Center";var X1=({children:e})=>h("div",{className:"welcome-screen-center__logo excalifont welcome-screen-decor",children:e||h(DD,{withText:!0})});X1.displayName="Logo";var W1=({children:e})=>h("div",{className:"welcome-screen-center__heading welcome-screen-decor excalifont",children:e});W1.displayName="Heading";var G1=({children:e})=>h("div",{className:"welcome-screen-menu",children:e});G1.displayName="Menu";var V1=()=>{let e=sa();return h(fs,{onSelect:()=>e.executeAction(Qh),shortcut:"?",icon:lc,children:E("helpDialog.title")})};V1.displayName="MenuItemHelp";var Y1=()=>{let e=Nt(),t=sa();return e.viewModeEnabled?null:h(fs,{onSelect:()=>t.executeAction(Jh),shortcut:Ft("loadScene"),icon:sc,children:E("buttons.load")})};Y1.displayName="MenuItemLoadScene";var R5=({onSelect:e})=>{let{t}=Rt();return h(fs,{shortcut:null,onSelect:e,icon:IU,children:t("labels.liveCollaboration")})};R5.displayName="MenuItemLiveCollaborationTrigger",qa.Logo=X1,qa.Heading=W1,qa.Menu=G1,qa.MenuItem=fs,qa.MenuItemLink=A5,qa.MenuItemHelp=V1,qa.MenuItemLoadScene=Y1,qa.MenuItemLiveCollaborationTrigger=R5;var j1=({children:e})=>{let{WelcomeScreenMenuHintTunnel:t}=Yt();return h(t.In,{children:M("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--menu",children:[v8,h("div",{className:"welcome-screen-decor-hint__label",children:e||E("welcomeScreen.defaults.menuHint")})]})})};j1.displayName="MenuHint";var Z1=({children:e})=>{let{WelcomeScreenToolbarHintTunnel:t}=Yt();return h(t.In,{children:M("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar",children:[h("div",{className:"welcome-screen-decor-hint__label",children:e||E("welcomeScreen.defaults.toolbarHint")}),E8]})})};Z1.displayName="ToolbarHint";var K1=({children:e})=>{let{WelcomeScreenHelpHintTunnel:t}=Yt();return h(t.In,{children:M("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--help",children:[h("div",{children:e||E("welcomeScreen.defaults.helpHint")}),w8]})})};K1.displayName="HelpHint";var yd=e=>h(te,{children:e.children||M(te,{children:[h(qa,{}),h(j1,{}),h(Z1,{}),h(K1,{})]})});yd.displayName="WelcomeScreen",yd.Center=qa,yd.Hints={MenuHint:j1,ToolbarHint:Z1,HelpHint:K1};var AD=yd,N5=({isCollaborating:e,onSelect:t,...a})=>{let n=Nt(),i=n.width<830;return M(yi,{...a,className:Q("collab-button",{active:e}),type:"button",onSelect:t,style:{position:"relative",width:i?void 0:"auto"},title:E("labels.liveCollaboration"),children:[i?W8:E("labels.share"),n.collaborators.size>0&&h("div",{className:"CollabButton-collaborators",children:n.collaborators.size})]})},RD=N5;N5.displayName="LiveCollaborationTrigger";var ND=(e,t,a)=>!!(t&&(t.id===e.editingTextElement?.id||t.id===e.resizingElement?.id||t.id===e.newElement?.id||t.version>a.version||t.version===a.version&&t.versionNonce<a.versionNonce)),PD=Kl((e,t,a)=>{if(me.DEV||me.MODE===Qt.TEST||window?.DEBUG_FRACTIONAL_INDICES){let n=Un(e.map(i=>({...i})));Xc(n,{shouldThrow:me.DEV||me.MODE===Qt.TEST,includeBoundTextValidation:!0,reconciliationContext:{localElements:t,remoteElements:a}})}},1e3*60,{leading:!0,trailing:!1}),_D=(e,t,a)=>{let n=oe(e),i=[],l=new Set;for(let o of t)if(!l.has(o.id)){let d=n.get(o.id),u=ND(a,d,o);d&&u?(i.push(d),l.add(d.id)):(i.push(o),l.add(o.id))}for(let o of e)l.has(o.id)||(i.push(o),l.add(o.id));let r=b0(i);return PD(r,e,t),Un(r),r},P5=({children:e,icon:t})=>{let{TTDDialogTriggerTunnel:a}=Yt(),n=wt();return h(a.In,{children:M(Ve.Item,{onSelect:()=>{Ge("ai","dialog open","ttd"),n({openDialog:{name:"ttd",tab:"text-to-diagram"}})},icon:t??B3,children:[e??E("labels.textToDiagram"),h(Ve.Item.Badge,{children:"AI"})]})})};P5.displayName="TTDDialogTrigger";var OD=e=>{let t=Ka();return Ia(()=>{t.setPlugins({diagramToCode:{generate:e.generate}})},[t,e.generate]),null};kD();var BD=e=>{let{onChange:t,initialData:a,excalidrawAPI:n,isCollaborating:i=!1,onPointerUpdate:l,renderTopRightUI:r,langCode:o=Qi.code,viewModeEnabled:d,zenModeEnabled:u,gridModeEnabled:s,libraryReturnUrl:c,theme:U,name:f,renderCustomStats:p,onPaste:m,detectScroll:g=!0,handleKeyboardGlobally:y=!1,onLibraryChange:v,autoFocus:b=!1,generateIdForFile:x,onLinkOpen:S,generateLinkForSelection:C,onPointerDown:T,onPointerUp:k,onScrollChange:R,onDuplicate:D,children:A,validateEmbeddable:P,renderEmbeddable:$,aiEnabled:X,showDeprecatedFonts:_}=e,H=e.UIOptions?.canvasActions,W={...e.UIOptions,canvasActions:{...Eu.canvasActions,...H},tools:{image:e.UIOptions?.tools?.image??!0}};return H?.export&&(W.canvasActions.export.saveFileToDisk=H.export?.saveFileToDisk??Eu.canvasActions.export.saveFileToDisk),W.canvasActions.toggleTheme===null&&typeof U>"u"&&(W.canvasActions.toggleTheme=!0),ae(()=>{(async()=>await import("/npm/canvas-roundrect-polyfill@0.0.1/+esm"))();let K=G=>{typeof G.scale=="number"&&G.scale!==1&&G.preventDefault()};return document.addEventListener("touchmove",K,{passive:!1}),()=>{document.removeEventListener("touchmove",K)}},[]),h(SM,{store:Ga,children:h(IM,{langCode:o,theme:U,children:h(MD,{onChange:t,initialData:a,excalidrawAPI:n,isCollaborating:i,onPointerUpdate:l,renderTopRightUI:r,langCode:o,viewModeEnabled:d,zenModeEnabled:u,gridModeEnabled:s,libraryReturnUrl:c,theme:U,name:f,renderCustomStats:p,UIOptions:W,onPaste:m,detectScroll:g,handleKeyboardGlobally:y,onLibraryChange:v,autoFocus:b,generateIdForFile:x,onLinkOpen:S,generateLinkForSelection:C,onPointerDown:T,onPointerUp:k,onScrollChange:R,onDuplicate:D,validateEmbeddable:P,renderEmbeddable:$,aiEnabled:X!==!1,showDeprecatedFonts:_,children:A})})})},zD=(e,t)=>{if(e.children!==t.children)return!1;let{initialData:a,UIOptions:n={},...i}=e,{initialData:l,UIOptions:r={},...o}=t,d=Object.keys(n),u=Object.keys(r);return d.length!==u.length?!1:d.every(s=>s==="canvasActions"?Object.keys(n.canvasActions).every(c=>c==="export"&&n?.canvasActions?.export&&r?.canvasActions?.export?n.canvasActions.export.saveFileToDisk===r.canvasActions.export.saveFileToDisk:n?.canvasActions?.[c]===r?.canvasActions?.[c]):n[s]===r[s])&&At(i,o)},_5=ee.memo(BD,zD);_5.displayName="Excalidraw";export{yi as Button,B as CaptureUpdateAction,yu as DEFAULT_LASER_COLOR,y1 as DefaultSidebar,OD as DiagramToCodePlugin,_5 as Excalidraw,Ke as FONT_FAMILY,ID as Footer,RD as LiveCollaborationTrigger,ne as MIME_TYPES,jt as MainMenu,Ut as ROUNDNESS,Za as Sidebar,Ud as Stats,Se as THEME,J6 as TTDDialog,P5 as TTDDialogTrigger,Iu as UserIdleState,AD as WelcomeScreen,Hr as bumpVersion,md as convertToExcalidrawElements,Qi as defaultLang,bp as elementPartiallyOverlapsWithOrContainsBBox,yp as elementsOverlappingBBox,pp as exportToBlob,zr as exportToCanvas,qx as exportToClipboard,Ro as exportToSvg,De as getCommonBounds,Oh as getDataURL,Mc as getFreeDrawSvgPath,ld as getLibraryItemsHash,ze as getNonDeletedElements,kS as getSceneVersion,l0 as getTextFromElements,Nf as getVisibleSceneBounds,Zp as hashElementsVersion,Ah as hashString,uh as isElementInsideBBox,Pl as isElementLink,qi as isInvisiblySmallElement,he as isLinearElement,Ho as languages,_h as loadFromBlob,a2 as loadLibraryFromBlob,Ph as loadSceneOrLibraryFromBlob,xm as mergeLibraryItems,F as mutateElement,fe as newElementWith,la as normalizeLink,r1 as parseLibraryTokensFromUrl,_D as reconcileElements,Pr as restore,lp as restoreAppState,Do as restoreElements,_r as restoreLibraryItems,ma as sceneCoordsToViewportCoords,Ar as serializeAsJSON,jc as serializeLibraryAsJSON,a8 as setCustomTextMetricsProvider,vt as useDevice,gk as useHandleLibrary,Rt as useI18n,$e as viewportCoordsToSceneCoords,K2 as zoomToFitBounds};
//# sourceMappingURL=/sm/de591f1c8746893d949b0e9a5a2705f089ed3e4fa5d59e7dea37c41d74dd1552.map