telva 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,16 +1,16 @@
1
- var Rs=Object.defineProperty,Lu=Object.defineProperties,Au=Object.getOwnPropertyDescriptor,Vu=Object.getOwnPropertyDescriptors,Hu=Object.getOwnPropertyNames,Zr=Object.getOwnPropertySymbols;var Ds=Object.prototype.hasOwnProperty,al=Object.prototype.propertyIsEnumerable;var Ps=(i,o,e)=>o in i?Rs(i,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[o]=e,S=(i,o)=>{for(var e in o||(o={}))Ds.call(o,e)&&Ps(i,e,o[e]);if(Zr)for(var e of Zr(o))al.call(o,e)&&Ps(i,e,o[e]);return i},w=(i,o)=>Lu(i,Vu(o));var Be=(i,o)=>{var e={};for(var t in i)Ds.call(i,t)&&o.indexOf(t)<0&&(e[t]=i[t]);if(i!=null&&Zr)for(var t of Zr(i))o.indexOf(t)<0&&al.call(i,t)&&(e[t]=i[t]);return e};var zu=(i,o)=>()=>(i&&(o=i(i=0)),o);var ll=(i,o)=>{for(var e in o)Rs(i,e,{get:o[e],enumerable:!0})},sl=(i,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of Hu(o))!Ds.call(i,n)&&n!==e&&Rs(i,n,{get:()=>o[n],enumerable:!(t=Au(o,n))||t.enumerable});return i},qr=(i,o,e)=>(sl(i,o,"default"),e&&sl(e,o,"default"));var d=(i,o,e)=>(Ps(i,typeof o!="symbol"?o+"":o,e),e);var z=(i,o,e)=>new Promise((t,n)=>{var r=a=>{try{l(e.next(a))}catch(c){n(c)}},s=a=>{try{l(e.throw(a))}catch(c){n(c)}},l=a=>a.done?t(a.value):Promise.resolve(a.value).then(r,s);l((e=e.apply(i,o)).next())});var qi={};ll(qi,{fetchGoogleFonts:()=>sp,getGoogleFontCategories:()=>Fy,initGoogleFonts:()=>Aa,loadGoogleFont:()=>dp,searchGoogleFonts:()=>zy,setGoogleFontsApiKey:()=>La});function La(i){let o=i.replace(/["']/g,"").trim();o!==Hr&&(Hr=o,io=[],Vr=null)}function sp(){return z(this,null,function*(){return io.length>0?io:Vr||(Vr=(()=>z(this,null,function*(){var i;try{if(!Hr)return console.warn("[Google Fonts] No API key provided. Pass googleFontsApiKey to the <Telva> component."),[];let o=`https://www.googleapis.com/webfonts/v1/webfonts?key=${Hr}&sort=popularity`,e=yield fetch(o);if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);io=(i=(yield e.json()).items)!=null?i:[]}catch(o){console.error("[Google Fonts] Failed to fetch font list",o),io=[]}return io}))(),Vr)})}function zy(i,o){let e=io;if(o&&(e=e.filter(n=>n.category===o)),!i)return e.slice(0,100);let t=i.toLowerCase();return e.filter(n=>n.family.toLowerCase().includes(t)).slice(0,100)}function Fy(){return Array.from(new Set(io.map(i=>i.category))).filter(Boolean)}function lp(){var i;try{return JSON.parse((i=localStorage.getItem(ap))!=null?i:"[]")}catch(o){return[]}}function Oy(i){try{let o=lp();o.includes(i)||(o.push(i),localStorage.setItem(ap,JSON.stringify(o)))}catch(o){}}function dp(i,o){let e=`gfont-${i.replace(/\s+/g,"-")}`;if(document.getElementById(e))return;let t=i.replace(/\s+/g,"+"),n=document.createElement("link");n.id=e,n.rel="stylesheet",n.href=`https://fonts.googleapis.com/css?family=${t}:400,400i,700,700i&display=swap`,document.head.appendChild(n),Oy(i)}function $y(){typeof window!="undefined"&&lp().forEach(i=>dp(i))}function Aa(){$y(),typeof window!="undefined"&&Hr&&sp()}var Hr,io,Vr,ap,zr=zu(()=>{"use strict";Hr="",io=[],Vr=null;ap="telva-loaded-google-fonts"});import"@fontsource/caveat-brush";import"@fontsource/crimson-pro";import"@fontsource/dm-sans";import"@fontsource/recursive";import"@fontsource/source-code-pro";import"@fontsource/source-sans-pro";import*as ge from"react";import{ErrorBoundary as aT}from"react-error-boundary";import{IntlProvider as lT}from"react-intl";import{Renderer as Bu}from"telva-core";import{ArrowTopRightIcon as Vh,CursorArrowIcon as Hh,ImageIcon as zh,Pencil1Icon as Fh,Pencil2Icon as Oh,TextIcon as $h}from"@radix-ui/react-icons";import*as Ft from"react";import{useIntl as Gh}from"react-intl";import{jsx as bT}from"react/jsx-runtime";import{jsx as dl}from"react/jsx-runtime";function Es(i){let t=i,{size:o=16}=t,e=Be(t,["size"]);return dl("svg",w(S({width:24,height:24},e),{children:dl("circle",{cx:12,cy:12,r:o/2})}))}import{jsx as cl}from"react/jsx-runtime";function pl(){return cl("svg",{width:"24",height:"24",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:cl("circle",{cx:12,cy:12,r:8,fill:"none",strokeWidth:2.5,strokeLinecap:"round",strokeDasharray:50.26548*.1})})}import{jsx as ul}from"react/jsx-runtime";var Fu=`${50.26548*.025} ${50.26548*.1}`;function hl(){return ul("svg",{width:"24",height:"24",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:ul("circle",{cx:12,cy:12,r:8,fill:"none",strokeWidth:2.5,strokeLinecap:"round",strokeDasharray:Fu})})}import{jsx as ml}from"react/jsx-runtime";function gl(){return ml("svg",{width:"24",height:"24",viewBox:"1 1.5 21 22",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:ml("path",{d:"M10.0162 19.2768C10.0162 19.2768 9.90679 19.2517 9.6879 19.2017C9.46275 19.1454 9.12816 19.0422 8.68413 18.8921C8.23384 18.7358 7.81482 18.545 7.42707 18.3199C7.03307 18.101 6.62343 17.7883 6.19816 17.3818C5.77289 16.9753 5.33511 16.3718 4.88482 15.5713C4.43453 14.7645 4.1531 13.8545 4.04053 12.8414C3.92795 11.822 4.04991 10.8464 4.40639 9.91451C4.76286 8.98266 5.39452 8.10084 6.30135 7.26906C7.21444 6.44353 8.29325 5.83377 9.5378 5.43976C10.7823 5.05202 11.833 4.92068 12.6898 5.04576C13.5466 5.16459 14.3878 5.43664 15.2133 5.86191C16.0388 6.28718 16.7768 6.8688 17.4272 7.60678C18.0714 8.34475 18.5404 9.21406 18.8344 10.2147C19.1283 11.2153 19.1721 12.2598 18.9657 13.348C18.7593 14.4299 18.2872 15.4337 17.5492 16.3593C16.8112 17.2849 15.9263 18.0072 14.8944 18.5263C13.8624 19.0391 12.9056 19.3174 12.0238 19.3612C11.142 19.405 10.2101 19.2705 9.22823 18.9578C8.24635 18.6451 7.35828 18.151 6.56402 17.4756C5.77601 16.8002 6.08871 16.8658 7.50212 17.6726C8.90927 18.4731 10.1444 18.8484 11.2076 18.7983C12.2645 18.7545 13.2965 18.4825 14.3034 17.9822C15.3102 17.4819 16.1264 16.8221 16.7518 16.0028C17.3772 15.1835 17.7681 14.3111 17.9244 13.3855C18.0808 12.4599 18.0401 11.5781 17.8025 10.74C17.5586 9.902 17.1739 9.15464 16.6486 8.49797C16.1233 7.8413 15.2289 7.27844 13.9656 6.80939C12.7086 6.34034 11.4203 6.20901 10.1007 6.41539C8.78732 6.61552 7.69599 7.06893 6.82669 7.77564C5.96363 8.48859 5.34761 9.26409 4.97863 10.1021C4.60964 10.9402 4.45329 11.8376 4.50958 12.7945C4.56586 13.7513 4.79101 14.6238 5.18501 15.4118C5.57276 16.1998 5.96363 16.8002 6.35764 17.2129C6.75164 17.6257 7.13313 17.9509 7.50212 18.1886C7.87736 18.4325 8.28074 18.642 8.71227 18.8171C9.15005 18.9922 9.47839 19.111 9.69728 19.1736C9.91617 19.2361 10.0256 19.2705 10.0256 19.2768H10.0162Z",strokeWidth:"2"})})}import{jsx as fl}from"react/jsx-runtime";function Sl(){return fl("svg",{width:"24",height:"24",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:fl("circle",{cx:12,cy:12,r:8,fill:"none",strokeWidth:2,strokeLinecap:"round"})})}import{jsx as IT,jsxs as PT}from"react/jsx-runtime";import{jsx as yl}from"react/jsx-runtime";function Bs(e){var t=e,{flipHorizontal:i}=t,o=Be(t,["flipHorizontal"]);return yl("svg",w(S({width:24,height:24,viewBox:"0 0 15 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:{transform:i?"scale(-1, 1)":"scale(1, 1)"}},o),{children:yl("path",{d:"M10.6707 8.5081C10.6707 10.1923 9.3004 11.5625 7.61631 11.5625H6.5351C6.35593 11.5625 6.21074 11.4173 6.21074 11.2382V11.13C6.21074 10.9508 6.35591 10.8057 6.5351 10.8057H7.61631C8.88313 10.8057 9.91387 9.77492 9.91387 8.5081C9.91387 7.24128 8.88313 6.21054 7.61631 6.21054H5.62155L6.99534 7.58433C7.14289 7.73183 7.14289 7.97195 6.99534 8.11944C6.85216 8.26251 6.60298 8.2623 6.46013 8.11944L4.44045 6.09971C4.36898 6.02824 4.32959 5.93321 4.32959 5.8321C4.32959 5.73106 4.36898 5.63598 4.44045 5.56454L6.46024 3.54472C6.60309 3.40176 6.85248 3.40176 6.99535 3.54472C7.14291 3.69218 7.14291 3.93234 6.99535 4.07979L5.62156 5.45368H7.61631C9.3004 5.45368 10.6707 6.82393 10.6707 8.5081Z"})}))}import{jsx as bl}from"react/jsx-runtime";function vl(i){return bl("svg",w(S({width:24,height:24,viewBox:"-2 -2 28 28",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},i),{children:bl("path",{d:"M12.4239 4.62C13.3572 4.62 14.1572 4.73333 14.8239 4.96C15.4906 5.17333 15.9772 5.43333 16.2839 5.74C16.3639 5.82 16.4039 5.94 16.4039 6.1V8.86H14.0639C13.9172 8.86 13.8439 8.78666 13.8439 8.64V7.26C13.4306 7.12666 12.9572 7.06 12.4239 7.06C11.6506 7.06 11.0639 7.18 10.6639 7.42C10.2639 7.66 10.0639 8.04666 10.0639 8.58V9C10.0639 9.38666 10.1639 9.69333 10.3639 9.92C10.5772 10.1333 11.0306 10.3467 11.7239 10.56L13.6439 11.14C14.4706 11.38 15.1172 11.66 15.5839 11.98C16.0506 12.3 16.3772 12.68 16.5639 13.12C16.7639 13.5467 16.8639 14.0733 16.8639 14.7V15.62C16.8639 16.7933 16.4039 17.7133 15.4839 18.38C14.5639 19.0467 13.2839 19.38 11.6439 19.38C10.6706 19.38 9.79723 19.2867 9.0239 19.1C8.2639 18.9133 7.71056 18.6533 7.3639 18.32C7.3239 18.28 7.29056 18.24 7.2639 18.2C7.25056 18.1467 7.2439 18.06 7.2439 17.94V15.74H7.6239C8.2239 16.1533 8.85056 16.4533 9.5039 16.64C10.1572 16.8267 10.9306 16.92 11.8239 16.92C12.6506 16.92 13.2506 16.7867 13.6239 16.52C14.0106 16.2533 14.2039 15.9333 14.2039 15.56V14.88C14.2039 14.6667 14.1639 14.48 14.0839 14.32C14.0172 14.16 13.8706 14.0133 13.6439 13.88C13.4172 13.7467 13.0572 13.6067 12.5639 13.46L10.6639 12.88C9.7839 12.6133 9.11056 12.3 8.6439 11.94C8.17723 11.58 7.85056 11.18 7.6639 10.74C7.49056 10.3 7.4039 9.83333 7.4039 9.34V8.38C7.4039 7.64666 7.61056 7 8.0239 6.44C8.43723 5.88 9.01723 5.44 9.7639 5.12C10.5239 4.78666 11.4106 4.62 12.4239 4.62Z"})}))}import{jsx as Tl}from"react/jsx-runtime";function xl(i){return Tl("svg",w(S({width:24,height:24,viewBox:"-2 -2 28 28",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},i),{children:Tl("path",{d:"M8.16191 19H5.68191C5.53525 19 5.46191 18.9267 5.46191 18.78V5H8.76191C8.88191 5 8.97525 5.03333 9.04191 5.1C9.10858 5.15333 9.17525 5.27333 9.24191 5.46C9.72191 6.59333 10.1686 7.7 10.5819 8.78C11.0086 9.84667 11.4352 10.98 11.8619 12.18H12.1619C12.6019 10.9667 13.0352 9.79333 13.4619 8.66C13.8886 7.52667 14.3552 6.30667 14.8619 5H18.3219C18.4686 5 18.5419 5.07333 18.5419 5.22V19H16.0619C15.9152 19 15.8419 18.9267 15.8419 18.78V16.26C15.8419 15.5267 15.8486 14.8133 15.8619 14.12C15.8886 13.4267 15.9286 12.6867 15.9819 11.9C16.0486 11.1 16.1419 10.1933 16.2619 9.18H15.9019C15.4352 10.3533 14.9486 11.5667 14.4419 12.82C13.9486 14.06 13.4819 15.2333 13.0419 16.34H11.1019C11.0619 16.34 11.0152 16.3333 10.9619 16.32C10.9219 16.2933 10.8886 16.2467 10.8619 16.18C10.4619 15.18 10.0086 14.06 9.50191 12.82C9.00858 11.58 8.53525 10.3667 8.08191 9.18H7.70191C7.83525 10.18 7.93525 11.0733 8.00191 11.86C8.06858 12.6467 8.10858 13.3933 8.12191 14.1C8.14858 14.8067 8.16191 15.5267 8.16191 16.26V19Z"})}))}import{jsx as kl}from"react/jsx-runtime";function Cl(i){return kl("svg",w(S({width:24,height:24,viewBox:"-2 -2 28 28",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},i),{children:kl("path",{d:"M7.68191 19C7.53525 19 7.46191 18.9267 7.46191 18.78V5H10.1219C10.2686 5 10.3419 5.07333 10.3419 5.22V16.56H13.4419V15.02H15.7619C15.9086 15.02 15.9819 15.0933 15.9819 15.24V19H7.68191Z"})}))}import{jsx as Ms,jsxs as Ou}from"react/jsx-runtime";function wl(){return Ou("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ms("path",{d:"M1.72838 9.33987L8.84935 2.34732C9.23874 1.96494 9.86279 1.96539 10.2516 2.34831L13.5636 5.60975C13.9655 6.00555 13.9607 6.65526 13.553 7.04507L8.13212 12.2278C7.94604 12.4057 7.69851 12.505 7.44107 12.505L6.06722 12.505L3.83772 12.505C3.5673 12.505 3.30842 12.3954 3.12009 12.2014L1.7114 10.7498C1.32837 10.3551 1.33596 9.72521 1.72838 9.33987Z",stroke:"currentColor"}),Ms("line",{x1:"6.01807",y1:"12.5",x2:"10.7959",y2:"12.5",stroke:"currentColor",strokeLinecap:"round"}),Ms("line",{x1:"5.50834",y1:"5.74606",x2:"10.1984",y2:"10.4361",stroke:"currentColor"})]})}import{jsx as AT}from"react/jsx-runtime";import{jsx as Il}from"react/jsx-runtime";function Pl(){return Il("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:Il("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L11.1464 3.14645C11.3417 2.95118 11.6583 2.95118 11.8536 3.14645C12.0488 3.34171 12.0488 3.65829 11.8536 3.85355L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z"})})}import*as Xn from"@radix-ui/react-dropdown-menu";import{CircleIcon as Dh,SquareIcon as Eh,VercelLogoIcon as Bh}from"@radix-ui/react-icons";import*as Sn from"react";import{useIntl as Mh}from"react-intl";import{createStitches as $u,defaultThemeMap as Gu}from"@stitches/react";var{styled:P,createTheme:ju}=$u({themeMap:S({},Gu),theme:{colors:{bounds:"rgba(13, 153, 255, 1)",boundsBg:"rgba(13, 153, 255, 0.05)",hover:"#3a3a3a",overlay:"rgba(0, 0, 0, 0.25)",overlayContrast:"rgba(255, 255, 255, 0.1)",panel:"#2C2C2C",panelContrast:"#444444",selected:"rgba(13, 153, 255, 1)",selectedContrast:"#ffffff",text:"#E8EAED",tooltip:"#1a1a1a",tooltipContrast:"#ffffff",warn:"rgba(255, 100, 100, 1)",canvas:"#ffffffff",separator:"#444444",inputBg:"#383838",inputBorder:"#555555",textSecondary:"#9AA0A6",accent:"#0D99FF"},shadows:{2:"0px 1px 2px rgba(0, 0, 0, 0.3)",3:"0px 2px 4px rgba(0, 0, 0, 0.3)",4:"0px 4px 8px rgba(0, 0, 0, 0.3)",8:"0px 8px 16px rgba(0, 0, 0, 0.3)",12:"0px 12px 24px rgba(0, 0, 0, 0.3)",24:"0px 24px 48px rgba(0, 0, 0, 0.3)",key:"1px 1px rgba(0,0,0,1)",panel:`0px 0px 12px -2px rgba(0, 0, 0, 0.3),
2
- 0px 0px 8px -4px rgba(0, 0, 0, 0.2)`},space:{0:"2px",1:"3px",2:"4px",3:"8px",4:"12px",5:"16px",6:"32px",7:"48px"},fontSizes:{0:"10px",1:"11px",2:"12px",3:"13px",4:"16px"},fonts:{ui:'"DM Sans", system-ui, -apple-system, sans-serif',body:'"DM Sans", system-ui, -apple-system, sans-serif',mono:'"Source Code Pro", monospace'},fontWeights:{},lineHeights:{},letterSpacings:{},sizes:{},borderWidths:{0:"$1"},borderStyles:{},radii:{0:"4px",1:"6px",2:"8px",3:"10px",4:"14px",pill:"9999px"},zIndices:{},transitions:{}},media:{micro:"(max-width: 370px)",sm:"(min-width: 640px)",md:"(min-width: 768px)",lg:"(min-width: 1024px)"},utils:{zStrokeWidth:()=>i=>Array.isArray(i)?{strokeWidth:`calc(${i[0]}px / var(--tv-zoom))`}:{strokeWidth:`calc(${i}px / var(--tv-zoom))`}}}),Ls=ju({colors:{bounds:"rgba(13, 153, 255, 1)",boundsBg:"rgba(13, 153, 255, 0.05)",hover:"#444A50",overlay:"rgba(0, 0, 0, 0.2)",overlayContrast:"rgba(255, 255, 255, 0.1)",panel:"#1E1E1E",panelContrast:"#444444",selected:"rgba(13, 153, 255, 1)",selectedContrast:"#ffffff",text:"#E8EAED",tooltip:"#111111",tooltipContrast:"#ffffff",canvas:"#141414",separator:"#333333",inputBg:"#2A2A2A",inputBorder:"#444444",textSecondary:"#888888",accent:"#0D99FF"},shadows:{2:"0px 1px 2px rgba(0, 0, 0, 0.4)",3:"0px 2px 4px rgba(0, 0, 0, 0.4)",4:"0px 4px 8px rgba(0, 0, 0, 0.4)",8:"0px 8px 16px rgba(0, 0, 0, 0.4)",12:"0px 12px 24px rgba(0, 0, 0, 0.4)",24:"0px 24px 48px rgba(0, 0, 0, 0.4)",panel:`0px 0px 12px -2px rgba(0, 0, 0, 0.4),
3
- 0px 0px 8px -4px rgba(0, 0, 0, 0.3)`}});var mr=P("div",{backgroundColor:"$panel",display:"flex",alignItems:"center",flexDirection:"row",padding:"$2",border:"1px solid $panelContrast",gap:0,overflow:"hidden",variants:{side:{center:{borderRadius:9},left:{padding:0,borderTop:0,borderLeft:0,borderTopRightRadius:0,borderBottomRightRadius:9,borderBottomLeftRadius:0},right:{padding:0,borderTop:0,borderRight:0,borderTopLeftRadius:0,borderBottomLeftRadius:9,borderBottomRightRadius:0}}},"& hr":{height:10,width:"100%",backgroundColor:"red",border:"none"}});import*as Sr from"react";import*as gn from"@radix-ui/react-tooltip";import{Utils as Wu}from"telva-core";import{jsx as Rl}from"react/jsx-runtime";var Nu=()=>Wu.isDarwin()?"\u2318":"Ctrl";function Jr({variant:i,children:o}){return Rl(Uu,{variant:i,children:o.split("").map((e,t)=>Rl("span",{children:e.replace("#",Nu())},t))})}var Uu=P("kbd",{marginLeft:"$3",textShadow:"$2",textAlign:"center",fontSize:"$0",fontFamily:"$ui",color:"$text",background:"none",fontWeight:400,gap:"$1",display:"flex",alignItems:"center","& > span":{padding:"$0",borderRadius:"$0",display:"flex",alignItems:"center",justifyContent:"center"},variants:{variant:{tooltip:{"& > span":{color:"$tooltipContrast",background:"$overlayContrast",boxShadow:"$key",width:"20px",height:"20px"}},menu:{}}}});import{jsx as Ro,jsxs as Dl}from"react/jsx-runtime";function Qr({children:i,label:o,kbd:e,id:t,side:n="top"}){return Ro("span",{id:t,children:Ro(gn.Provider,{children:Dl(gn.Root,{children:[Ro(gn.Trigger,{dir:"ltr",asChild:!0,children:Ro("span",{children:i})}),Dl(Ku,{dir:"ltr",side:n,sideOffset:8,children:[o,e?Ro(Jr,{variant:"tooltip",children:e}):null,Ro(_u,{})]})]})})})}var Ku=P(gn.Content,{borderRadius:3,padding:"$3 $3 $3 $3",fontSize:"$1",backgroundColor:"$tooltip",color:"$tooltipContrast",boxShadow:"$3",display:"flex",alignItems:"center",fontFamily:"$ui",userSelect:"none",WebkitUserSelect:"none"}),_u=P(gn.Arrow,{fill:"$tooltip",margin:"0 8px"});var nn={"@initial":"mobile","@micro":"micro","@sm":"small","@md":"medium","@lg":"large"};import*as Do from"react";function Yu(){let i=Do.useCallback((r,s)=>z(this,null,function*(){s(r.fileSystemHandle?"saveFirstTime":"saveAgain",()=>z(this,null,function*(){try{yield r.saveProject(),r.newProject()}catch(l){}}),()=>z(this,null,function*(){r.newProject()}),()=>z(this,null,function*(){}))}),[]),o=Do.useCallback((r,s)=>z(this,null,function*(){if(!r.fileSystemHandle&&!r.isDirty){r.openProject();return}s(r.fileSystemHandle?"saveFirstTime":"saveAgain",()=>z(this,null,function*(){try{yield r.saveProject(),yield r.openProject()}catch(l){}}),()=>z(this,null,function*(){r.openProject()}),()=>z(this,null,function*(){}))}),[]),e=Do.useCallback(r=>{r.saveProject()},[]),t=Do.useCallback(r=>{r.saveProjectAs()},[]),n=Do.useCallback(r=>z(this,null,function*(){var s;(s=r.openAsset)==null||s.call(r)}),[]);return{onNewProject:i,onSaveProject:e,onSaveProjectAs:t,onOpenProject:o,onOpenMedia:n}}import*as Eo from"react";function ei(){let i=N(),{openDialog:o}=ti(),e=Eo.useCallback(l=>z(this,null,function*(){var a,c;l&&i.callbacks.onOpenProject&&l.preventDefault(),(c=(a=i.callbacks).onNewProject)==null||c.call(a,i,o)}),[i,o]),t=Eo.useCallback(l=>{var a,c;l&&i.callbacks.onOpenProject&&l.preventDefault(),(c=(a=i.callbacks).onSaveProject)==null||c.call(a,i)},[i]),n=Eo.useCallback(l=>{var a,c;l&&i.callbacks.onOpenProject&&l.preventDefault(),(c=(a=i.callbacks).onSaveProjectAs)==null||c.call(a,i)},[i]),r=Eo.useCallback(l=>z(this,null,function*(){var a,c;l&&i.callbacks.onOpenProject&&l.preventDefault(),(c=(a=i.callbacks).onOpenProject)==null||c.call(a,i,o)}),[i,o]),s=Eo.useCallback(l=>z(this,null,function*(){var a,c;l&&i.callbacks.onOpenMedia&&l.preventDefault(),(c=(a=i.callbacks).onOpenMedia)==null||c.call(a,i)}),[i]);return{onNewProject:e,onSaveProject:t,onSaveProjectAs:n,onOpenProject:r,onOpenMedia:s}}import*as ai from"react";import{useHotkeys as j}from"react-hotkeys-hook";var ni=class{constructor(){d(this,"onPinchStart");d(this,"onPinchEnd");d(this,"onPinch");d(this,"onKeyDown");d(this,"onKeyUp");d(this,"onPointerMove");d(this,"onPointerUp");d(this,"onPan");d(this,"onZoom");d(this,"onPointerDown");d(this,"onPointCanvas");d(this,"onDoubleClickCanvas");d(this,"onRightPointCanvas");d(this,"onDragCanvas");d(this,"onReleaseCanvas");d(this,"onPointShape");d(this,"onDoubleClickShape");d(this,"onRightPointShape");d(this,"onDragShape");d(this,"onHoverShape");d(this,"onUnhoverShape");d(this,"onReleaseShape");d(this,"onPointBounds");d(this,"onDoubleClickBounds");d(this,"onRightPointBounds");d(this,"onDragBounds");d(this,"onHoverBounds");d(this,"onUnhoverBounds");d(this,"onReleaseBounds");d(this,"onPointBoundsHandle");d(this,"onDoubleClickBoundsHandle");d(this,"onRightPointBoundsHandle");d(this,"onDragBoundsHandle");d(this,"onHoverBoundsHandle");d(this,"onUnhoverBoundsHandle");d(this,"onReleaseBoundsHandle");d(this,"onPointHandle");d(this,"onDoubleClickHandle");d(this,"onRightPointHandle");d(this,"onDragHandle");d(this,"onHoverHandle");d(this,"onUnhoverHandle");d(this,"onReleaseHandle");d(this,"onShapeBlur");d(this,"onShapeClone")}},El=(n=>(n.Idle="idle",n.Connecting="connecting",n.Connected="connected",n.Disconnected="disconnected",n))(El||{}),Ve=(u=>(u.Transform="transform",u.Translate="translate",u.TransformSingle="transformSingle",u.Brush="brush",u.Arrow="arrow",u.Draw="draw",u.Erase="erase",u.Rotate="rotate",u.Handle="handle",u.Grid="grid",u.Edit="edit",u))(Ve||{}),Ht=(g=>(g.Idle="idle",g.PointingHandle="pointingHandle",g.PointingBounds="pointingBounds",g.PointingBoundsHandle="pointingBoundsHandle",g.TranslatingLabel="translatingLabel",g.TranslatingHandle="translatingHandle",g.Translating="translating",g.Transforming="transforming",g.Rotating="rotating",g.Pinching="pinching",g.Brushing="brushing",g.Creating="creating",g.EditingText="editing-text",g))(Ht||{}),As=(n=>(n.Backward="backward",n.Forward="forward",n.ToFront="toFront",n.ToBack="toBack",n))(As||{}),oi=(s=>(s.Top="top",s.CenterVertical="centerVertical",s.Bottom="bottom",s.Left="left",s.CenterHorizontal="centerHorizontal",s.Right="right",s))(oi||{}),ri=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(ri||{}),ii=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(ii||{}),Vs=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(Vs||{}),ne=(g=>(g.Sticky="sticky",g.Ellipse="ellipse",g.Rectangle="rectangle",g.Triangle="triangle",g.Draw="draw",g.Arrow="arrow",g.Line="line",g.Text="text",g.Group="group",g.Image="image",g.Video="video",g.ReactComponent="reactComponent",g.Pen="pen",g))(ne||{}),gr=(o=>(o.Arrow="arrow",o))(gr||{}),Hs=(h=>(h.White="white",h.LightGray="lightGray",h.Gray="gray",h.Black="black",h.Green="green",h.Cyan="cyan",h.Blue="blue",h.Indigo="indigo",h.Violet="violet",h.Red="red",h.Orange="orange",h.Yellow="yellow",h))(Hs||{}),si=(t=>(t.Small="small",t.Medium="medium",t.Large="large",t))(si||{}),on=(n=>(n.Draw="draw",n.Solid="solid",n.Dashed="dashed",n.Dotted="dotted",n))(on||{}),Xu=(n=>(n.Small="small",n.Medium="medium",n.Large="large",n.ExtraLarge="extraLarge",n))(Xu||{}),zt=(n=>(n.Start="start",n.Middle="middle",n.End="end",n.Justify="justify",n))(zt||{}),Bo=(n=>(n.Script="script",n.Sans="sans",n.Serif="serif",n.Mono="mono",n))(Bo||{});function Mo(i){let o=i.stops.map(e=>{let t=e.color.slice(0,7),[n,r,s]=[1,3,5].map(l=>parseInt(t.slice(l,l+2),16));return`rgba(${n},${r},${s},${e.opacity}) ${e.position}%`}).join(", ");switch(i.type){case"linear":return`linear-gradient(${i.angle}deg, ${o})`;case"radial":return`radial-gradient(circle at ${i.centerX}% ${i.centerY}%, ${o})`;case"conic":case"diamond":return`conic-gradient(from ${i.angle}deg at ${i.centerX}% ${i.centerY}%, ${o})`;default:return`linear-gradient(90deg, ${o})`}}var zs=(e=>(e.Image="image",e.Video="video",e))(zs||{}),go=(r=>(r.PNG="png",r.JPG="jpeg",r.WEBP="webp",r.SVG="svg",r.JSON="json",r))(go||{}),fr=(n=>(n.Transparent="transparent",n.Auto="auto",n.Light="light",n.Dark="dark",n))(fr||{});function Bl(i){let o=N(),e=ai.useCallback((a=!1)=>{let c=i.current;return a&&(o.isMenuOpen||o.settings.keepStyleMenuOpen)?!0:c&&(document.activeElement===c||c.contains(document.activeElement))},[i]);ai.useEffect(()=>{if(!o)return;let a=u=>{if(!!e(!0)){if(o.readOnly){o.copy(void 0,u);return}o.cut(void 0,u)}},c=u=>{!e(!0)||o.copy(void 0,u)},p=u=>{!e(!0)||o.readOnly||o.paste(void 0,u)};return document.addEventListener("cut",a),document.addEventListener("copy",c),document.addEventListener("paste",p),()=>{document.removeEventListener("cut",a),document.removeEventListener("copy",c),document.removeEventListener("paste",p)}},[o]),j("v,1",()=>{!e(!0)||o.selectTool("select")},[o,i.current]),j("d,2",()=>{!e(!0)||o.selectTool("draw")},void 0,[o]),j("p",()=>{!e(!0)||o.selectTool("pen")},void 0,[o]),j("e,3",()=>{!e(!0)||o.selectTool("erase")},void 0,[o]),j("r,4",()=>{!e(!0)||o.selectTool("rectangle")},void 0,[o]),j("o,5",()=>{!e(!0)||o.selectTool("ellipse")},void 0,[o]),j("g,6",()=>{!e()||o.selectTool("triangle")},void 0,[o]),j("l,7",()=>{!e(!0)||o.selectTool("line")},void 0,[o]),j("a,8",()=>{!e(!0)||o.selectTool("arrow")},void 0,[o]),j("t,9",()=>{!e(!0)||o.selectTool("text")},void 0,[o]),j("s,0",()=>{!e(!0)||o.selectTool("sticky")},void 0,[o]),j("ctrl+shift+d,\u2318+shift+d",a=>{!e(!0)||(o.toggleDarkMode(),a.preventDefault())},void 0,[o]),j("ctrl+.,\u2318+.",()=>{!e(!0)||o.toggleFocusMode()},void 0,[o]),j("ctrl+shift+g,\u2318+shift+g",()=>{!e(!0)||o.toggleGrid()},void 0,[o]);let{onNewProject:t,onOpenProject:n,onSaveProject:r,onSaveProjectAs:s,onOpenMedia:l}=ei();j("ctrl+n,\u2318+n",a=>{a.preventDefault(),e()&&t(a)},void 0,[o]),j("ctrl+s,\u2318+s",a=>{!e()||r(a)},void 0,[o]),j("ctrl+shift+s,\u2318+shift+s",a=>{!e()||s(a)},void 0,[o]),j("ctrl+alt+1,\u2318+alt+1",a=>{!e()||o.exportImage("svg",{scale:2,quality:1})},void 0,[o]),j("ctrl+alt+2,\u2318+alt+2",a=>{!e()||o.exportImage("png",{scale:2,quality:1})},void 0,[o]),j("ctrl+alt+3,\u2318+alt+3",a=>{!e()||o.exportImage("jpeg",{scale:2,quality:1})},void 0,[o]),j("ctrl+alt+4,\u2318+alt+4",a=>{!e()||o.exportImage("webp",{scale:2,quality:1})},void 0,[o]),j("ctrl+alt+5,\u2318+alt+5",a=>{!e()||o.exportJson()},void 0,[o]),j("ctrl+o,\u2318+o",a=>{!e()||n(a)},void 0,[o]),j("ctrl+u,\u2318+u",a=>{!e()||l(a)},void 0,[o]),j("\u2318+z,ctrl+z",a=>{a.preventDefault(),e(!0)&&(o.session?o.cancelSession():o.undo())},void 0,[o]),j("ctrl+shift+z,\u2318+shift+z",()=>{!e(!0)||(o.session?o.cancelSession():o.redo())},void 0,[o]),j("\u2318+u,ctrl+u",()=>{!e()||o.undoSelect()},void 0,[o]),j("ctrl+shift-u,\u2318+shift+u",()=>{!e()||o.redoSelect()},void 0,[o]),j("ctrl+=,\u2318+=,ctrl+num_add,\u2318+num_add",a=>{!e(!0)||(o.zoomIn(),a.preventDefault())},void 0,[o]),j("ctrl+-,\u2318+-,ctrl+num_subtract,\u2318+num_subtract",a=>{!e(!0)||(o.zoomOut(),a.preventDefault())},void 0,[o]),j("shift+0,ctrl+numpad_0,\u2318+numpad_0",()=>{!e(!0)||o.resetZoom()},void 0,[o]),j("shift+1",()=>{!e(!0)||o.zoomToFit()},void 0,[o]),j("shift+2",()=>{!e(!0)||o.zoomToSelection()},void 0,[o]),j("ctrl+d,\u2318+d",a=>{!e()||(o.duplicate(),a.preventDefault())},void 0,[o]),j("shift+h",()=>{!e(!0)||o.flipHorizontal()},void 0,[o]),j("shift+v",()=>{!e(!0)||o.flipVertical()},void 0,[o]),j("escape",()=>{!e(!0)||o.cancel()},void 0,[o]),j("backspace,del",()=>{!e()||o.delete()},void 0,[o]),j("\u2318+a,ctrl+a",()=>{!e(!0)||o.selectAll()},void 0,[o]),j("up",()=>{!e()||o.nudge([0,-1],!1)},void 0,[o]),j("right",()=>{!e()||o.nudge([1,0],!1)},void 0,[o]),j("down",()=>{!e()||o.nudge([0,1],!1)},void 0,[o]),j("left",()=>{!e()||o.nudge([-1,0],!1)},void 0,[o]),j("shift+up",()=>{!e()||o.nudge([0,-1],!0)},void 0,[o]),j("shift+right",()=>{!e()||o.nudge([1,0],!0)},void 0,[o]),j("shift+down",()=>{!e()||o.nudge([0,1],!0)},void 0,[o]),j("shift+left",()=>{!e()||o.nudge([-1,0],!0)},void 0,[o]),j("\u2318+shift+l,ctrl+shift+l",()=>{!e()||o.toggleLocked()},void 0,[o]),j("\u2318+shift+c,ctrl+shift+c",a=>{!e()||(o.copySvg(),a.preventDefault())},void 0,[o]),j("\u2318+g,ctrl+g",a=>{!e()||(o.group(),a.preventDefault())},void 0,[o]),j("\u2318+shift+g,ctrl+shift+g",a=>{!e()||(o.ungroup(),a.preventDefault())},void 0,[o]),j("[",()=>{!e(!0)||o.moveBackward()},void 0,[o]),j("]",()=>{!e(!0)||o.moveForward()},void 0,[o]),j("shift+[",()=>{!e(!0)||o.moveToBack()},void 0,[o]),j("shift+]",()=>{!e(!0)||o.moveToFront()},void 0,[o]),j("ctrl+shift+backspace,\u2318+shift+backspace",a=>{!e()||(o.settings.isDebugMode&&o.resetDocument(),a.preventDefault())},void 0,[o]),j("alt+command+l,alt+ctrl+l",a=>{!e(!0)||(o.style({textAlign:"start"}),a.preventDefault())},void 0,[o]),j("alt+command+t,alt+ctrl+t",a=>{!e(!0)||(o.style({textAlign:"middle"}),a.preventDefault())},void 0,[o]),j("alt+command+r,alt+ctrl+r",a=>{!e(!0)||(o.style({textAlign:"end"}),a.preventDefault())},void 0,[o])}import*as fn from"react";var Fs=fn.createContext({}),Zu=()=>{let[i,o]=fn.useState(0);fn.useEffect(()=>o(1))};function N(){return fn.useContext(Fs)}var Os=fn.createContext({});function rn(){let i=fn.useContext(Os);return Zu(),i}import*as dd from"react";var Ml={"style.menu.color":"\u0627\u0644\u0644\u0648\u0646","style.menu.fill":"\u064A\u0645\u0644\u0623","style.menu.dash":"\u0645\u062A\u0642\u0637\u0639","style.menu.size":"\u062D\u062C\u0645","style.menu.keep.open":"\u062A\u0628\u0642\u0649 \u0645\u0641\u062A\u0648\u062D\u0629","style.menu.font":"\u0627\u0644\u062E\u0637","style.menu.align":"\u0645\u062D\u0627\u0630\u0627\u0629",styles:"\u0627\u0644\u0623\u0646\u0645\u0627\u0637","zoom.in":"\u062A\u0643\u0628\u064A\u0631","zoom.out":"\u062A\u0635\u063A\u064A\u0631",to:"\u0625\u0644\u0649","menu.tools":"\u0623\u062F\u0648\u0627\u062A","menu.transform":"\u0627\u0644\u062A\u062D\u0648\u064A\u0644\u0627\u062A","menu.file":"\u0645\u0644\u0641","menu.edit":"\u062A\u062D\u0631\u064A\u0631","menu.view":"\u0645\u0639\u0627\u064A\u0646\u0629","menu.preferences":"\u0627\u0644\u062A\u0641\u0636\u064A\u0644\u0627\u062A","menu.sign.in":"\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644","menu.sign.out":"\u062E\u0631\u0648\u062C","become.a.sponsor":"\u0643\u0646 \u0631\u0627\u0639\u064A\u0627\u064B","zoom.to.content":"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0645\u062D\u062A\u0648\u0649","zoom.to.selection":"\u062A\u0643\u0628\u064A\u0631 \u0644\u0644\u062A\u062D\u062F\u064A\u062F","zoom.to.fit":"\u062A\u0643\u0628\u064A\u0631 \u0644\u062A\u0646\u0627\u0633\u0628","zoom.to":"\u062A\u0643\u0628\u064A\u0631 \u0625\u0644\u0649","preferences.dark.mode":"\u0627\u0644\u0648\u0636\u0639 \u0627\u0644\u062F\u0627\u0643\u0646","preferences.focus.mode":"\u0648\u0636\u0639 \u0627\u0644\u062A\u0631\u0643\u064A\u0632","preferences.debug.mode":"\u0648\u0636\u0639 \u0627\u0644\u062A\u0635\u062D\u064A\u062D","preferences.show.grid":"\u0627\u0638\u0647\u0631 \u0627\u0644\u0634\u0628\u0643\u0629","preferences.use.cad.selection":"\u0627\u0633\u062A\u062E\u062F\u0627\u0645 \u0627\u0644\u062A\u062D\u062F\u064A\u062F CAD","preferences.keep.stylemenu.open":"\u0627\u0644\u0627\u062D\u062A\u0641\u0627\u0638 \u0628\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0646\u0645\u0637 \u0645\u0641\u062A\u0648\u062D\u0629","preferences.always.show.snaps":"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0644\u0642\u0637\u0627\u062A \u062F\u0627\u0626\u0645\u064B\u0627","preferences.rotate.handles":"\u062A\u062F\u0648\u064A\u0631 \u0627\u0644\u0645\u0642\u0627\u0628\u0636","preferences.binding.handles":"\u0645\u0642\u0627\u0628\u0636 \u0645\u0644\u0632\u0645\u0629","preferences.clone.handles":"\u0645\u0642\u0627\u0628\u0636 \u0627\u0633\u062A\u0646\u0633\u0627\u062E",undo:"\u0627\u0644\u063A\u0627\u0621",redo:"\u0625\u0639\u0627\u062F\u0629",cut:"\u0642\u0637\u0639",copy:"\u0646\u0633\u062D",paste:"\u0644\u0635\u0642","copy.as":"\u0646\u0633\u062E \u0627\u0644\u0649","export.as":"\u0635\u062F\u0631 \u0627\u0644\u0649","select.all":"\u0627\u062E\u062A\u0631 \u0627\u0644\u0643\u0644","select.none":"\u0644\u0627 \u062A\u062E\u062A\u0631 \u0634\u064A\u0621",delete:"\u062D\u0630\u0641","new.project":"\u0645\u0634\u0631\u0648\u0639 \u062C\u062F\u064A\u062F",open:"\u0641\u062A\u062D",save:"\u062D\u0641\u0638","save.as":"\u062D\u0641\u0638 \u0628\u0627\u0633\u0645","upload.media":"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0648\u0633\u0627\u0626\u0637","create.page":"\u0625\u0646\u0634\u0627\u0621 \u0635\u0641\u062D\u0629","new.page":"\u0635\u0641\u062D\u0629 \u062C\u062F\u064A\u062F\u0629","page.name":"\u0627\u0633\u0645 \u0627\u0644\u0635\u0641\u062D\u0629",duplicate:"\u0646\u0633\u062E",cancel:"\u0627\u0644\u063A\u0627\u0621","copy.invite.link":"\u0646\u0633\u062E \u0631\u0627\u0628\u0637 \u0627\u0644\u062F\u0639\u0648\u0629","copy.readonly.link":"\u0646\u0633\u062E \u0631\u0627\u0628\u0637 \u062F\u0639\u0648\u0629 \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0641\u0642\u0637","create.multiplayer.project":"\u0642\u0645 \u0628\u0625\u0646\u0634\u0627\u0621 \u0645\u0634\u0631\u0648\u0639 \u0645\u062A\u0639\u062F\u062F \u0627\u0644\u0644\u0627\u0639\u0628\u064A\u0646","copy.multiplayer.project":"\u0646\u0633\u062E \u0625\u0644\u0649 \u0645\u0634\u0631\u0648\u0639 \u0645\u062A\u0639\u062F\u062F \u0627\u0644\u0644\u0627\u0639\u0628\u064A\u0646",select:"\u0627\u062E\u062A\u0631",eraser:"\u0645\u0645\u062D\u0627\u0629",draw:"\u0631\u0633\u0645",arrow:"\u0633\u0647\u0645",text:"\u0646\u0635",sticky:"\u0644\u0627\u0635\u0642",rectangle:"\u0645\u0631\u0628\u0639",ellipse:"\u0628\u064A\u0636\u0627\u0648\u064A",triangle:"\u0645\u062B\u0644\u062B",line:"\u062E\u0637",rotate:"\u062F\u0648\u0651\u0631","lock.aspect.ratio":"\u0642\u0641\u0644 \u0646\u0633\u0628\u0629 \u0627\u0644\u0627\u0628\u0639\u0627\u062F","unlock.aspect.ratio":"\u0641\u062A\u062D \u0642\u0641\u0644 \u0646\u0633\u0628\u0629 \u0627\u0644\u0627\u0628\u0639\u0627\u062F",group:"\u062C\u0645\u0651\u0639",ungroup:"\u0641\u0643 \u0627\u0644\u062A\u062C\u0645\u0639","move.to.back":"\u0627\u0646\u062A\u0642\u0644 \u0625\u0644\u0649 \u0627\u0644\u062E\u0644\u0641","move.backward":"\u062A\u062D\u0631\u064A\u0643 \u0644\u0644\u062E\u0644\u0641","move.forward":"\u062A\u062D\u0631\u064A\u0643 \u0644\u0644\u0623\u0645\u0627\u0645","move.to.front":"\u062A\u062D\u0631\u0643 \u0644\u0644\u0623\u0645\u0627\u0645","reset.angle":"\u0625\u0639\u0627\u062F\u0629 \u0636\u0628\u0637 \u0627\u0644\u0632\u0627\u0648\u064A\u0629",lock:"\u0642\u0641\u0644",unlock:"\u0627\u0644\u063A\u0627\u0621 \u0627\u0644\u0642\u0641\u0644","move.to.page":"\u0627\u0646\u0642\u0644 \u0625\u0644\u0649 \u0627\u0644\u0635\u0641\u062D\u0629","flip.horizontal":"\u0627\u0646\u0639\u0643\u0627\u0633 \u0623\u0641\u0642\u064A","flip.vertical":"\u0627\u0646\u0639\u0643\u0627\u0633 \u0639\u0645\u0648\u062F\u064A",move:"\u062D\u0631\u0651\u0643","to.front":"\u0644\u0644\u0627\u0645\u0627\u0645",forward:"\u0644\u0644\u062E\u0644\u0641",backward:"\u0644\u0644\u0648\u0631\u0627\u0621",back:"\u062E\u0644\u0641",language:"\u0644\u063A\u0629","translation.link":"\u0644\u0644\u0645\u0632\u064A\u062F","dock.position":"\u0645\u0648\u0642\u0639 \u0627\u0644\u0627\u062F\u0648\u0627\u062A",bottom:"\u0627\u0633\u0641\u0644",left:"\u064A\u0633\u0627\u0631",right:"\u064A\u0645\u064A\u0646",top:"\u0623\u0639\u0644\u0649",page:"\u0635\u0641\u062D\u0629","keyboard.shortcuts":"\u0627\u062E\u062A\u0635\u0627\u0631\u0627\u062A \u0644\u0648\u062D\u0629 \u0627\u0644\u0645\u0641\u0627\u062A\u064A\u062D",search:"\u0628\u062D\u062B",loading:"{dots}\u062A\u062D\u0645\u064A\u0644 ","export.background":"\u062A\u0635\u062F\u064A\u0631 \u0627\u0644\u062E\u0644\u0641\u064A\u0629",transparent:"\u0634\u0640\u0641\u0627\u0641",auto:"\u0630\u0627\u062A\u064A",light:"\u062E\u0641\u064A\u0641",dark:"\u063A\u0627\u0645\u0642","dialog.save.firsttime":"\u0647\u0644 \u062A\u0631\u064A\u062F \u062D\u0641\u0638 \u0627\u0644\u062A\u063A\u064A\u064A\u0631\u0627\u062A \u0639\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u0645\u0634\u0631\u0648\u0639\u061F","dialog.save.again":"\u0647\u0644 \u062A\u0631\u064A\u062F \u062D\u0641\u0638 \u0627\u0644\u062A\u063A\u064A\u064A\u0631\u0627\u062A \u0639\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u0645\u0634\u0631\u0648\u0639\u061F","dialog.cancel":"\u0625\u0644\u063A\u0627\u0621","dialog.no":"\u0644\u0627","dialog.yes":"\u0646\u0639\u0645","enter.file.name":"\u0623\u062F\u062E\u0644 \u0627\u0633\u0645 \u0627\u0644\u0645\u0644\u0641",image:"\u0635\u0648\u0631\u0629","align.left":"\u0635\u0641\u0651 \u0644\u0644\u064A\u0633\u0627\u0631","align.center.x":"\u0635\u0641\u0651 \u0627\u0644\u0645\u062D\u0648\u0631 \u0627\u0644\u0623\u0641\u0642\u064A \u0644\u0644\u0648\u0633\u0637","align.right":"\u0635\u0641\u0651 \u0644\u0644\u064A\u0645\u064A\u0646","align.top":"\u0635\u0641\u0651 \u0644\u0644\u0623\u0639\u0644\u0649","align.center.y":"\u0635\u0641\u0651 \u0627\u0644\u0645\u062D\u0648\u0631 \u0627\u0644\u0639\u0645\u0648\u062F\u064A \u0644\u0644\u0648\u0633\u0637","align.bottom":"\u0635\u0641\u0651 \u0644\u0644\u0623\u0633\u0641\u0644","distribute.x":"\u062A\u0648\u0632\u064A\u0639 \u0623\u0641\u0642\u064A","distribute.y":"\u062A\u0648\u0632\u064A\u0639 \u0639\u0645\u0648\u062F\u064A","stretch.x":"\u062A\u0645\u062F\u064A\u062F \u0623\u0641\u0642\u064A","stretch.y":"\u062A\u0645\u062F\u064A\u062F \u0639\u0645\u0648\u062F\u064A"};var Ll={"style.menu.color":"Farve","style.menu.fill":"Fyld","style.menu.dash":"Streg","style.menu.size":"St\xF8rrelse","style.menu.keep.open":"Hold \xE5ben","style.menu.font":"Skrifttype","style.menu.align":"Juster",styles:"Format","zoom.in":"Zoom ind","zoom.out":"Zoom ud",to:"til","menu.tools":"V\xE6rkt\xF8jer","menu.transform":"Transformer","menu.file":"Fil","menu.edit":"Rediger","menu.view":"Vis","menu.preferences":"Indstillinger","menu.sign.in":"Log ind","menu.sign.out":"Log ud","become.a.sponsor":"Bliv sponsor","zoom.to.selection":"Zoom til valgte","zoom.to.fit":"Zoom til l\xE6rred","zoom.to":"Zoom til","zoom.to.content":"Zoom til indhold","preferences.dark.mode":"M\xF8rkt udseende","preferences.focus.mode":"Fokus tilstand","preferences.debug.mode":"Debug tilstand","preferences.show.grid":"Vis net","preferences.use.cad.selection":"Brug CAD udv\xE6lgelse","preferences.keep.stylemenu.open":"Hold formatmenuen \xE5ben","preferences.always.show.snaps":"Vis altid snaps","preferences.rotate.handles":"Roteringsh\xE5ndtag","preferences.binding.handles":"Bindingsh\xE5ndtag","preferences.clone.handles":"Kloningsh\xE5ndtag",undo:"Fortryd",redo:"Gentag",cut:"Klip",copy:"Kopier",paste:"Inds\xE6t","copy.as":"Kopier som","export.as":"Eksporter som","select.all":"V\xE6lg alt","select.none":"Frav\xE6lg alt",delete:"Slet","new.project":"Nyt projekt",open:"\xC5ben",save:"Gem","save.as":"Gem som","upload.media":"Upload medie","create.page":"Opret side","new.page":"Ny side","page.name":"Sidenavn",duplicate:"Dupliker",cancel:"Fortryd","copy.invite.link":"Kopier invitationslink","create.multiplayer.project":"Opret multiplayer projekt","copy.multiplayer.project":"Kopier til multiplayer projekt",select:"V\xE6lg",eraser:"Viskel\xE6der",draw:"Tegn",arrow:"Pil",text:"Tekst",sticky:"Note",rectangle:"Rektangel",ellipse:"Ellipse",triangle:"Trekant",line:"Linje",rotate:"Roter","lock.aspect.ratio":"L\xE5s billedformat","unlock.aspect.ratio":"Frig\xF8r billedformat",group:"Grupper",ungroup:"Opdel gruppe","move.to.back":"Placer bagerst","move.backward":"Flyt tilbage","move.forward":"Flyt frem","move.to.front":"L\xE6g forrest","reset.angle":"Nulstil vinkel",lock:"L\xE5s",unlock:"L\xE5s op","move.to.page":"Flyt til side","flip.horizontal":"Vend vandret","flip.vertical":"Vend lodret",move:"Flyt","to.front":"Forrest",forward:"Frem",backward:"Tilbage",back:"Bagerst",language:"Sprog","align.bottom":"Justering nederst","align.center.x":"Vandret justering centreret","align.center.y":"Lodret justering centreret","align.distribute":"Juster / distribuer","align.left":"Justering til venstre","align.right":"Justering til h\xF8jre","align.top":"Justering \xF8verst","copy.readonly.link":"Kopier skrivebeskyttet link","dialog.save.again":"Vil du gemme \xE6ndringerne til dit projekt?","dialog.save.firsttime":"Vil du gemme dit projekt?","dialog.yes":"Ja","dialog.no":"Nej","dialog.cancel":"Fortryd","enter.file.name":"Skriv filnavn","distribute.x":"Vandret distribuering","distribute.y":"Lodret distribuering","dock.position":"Placering af v\xE6rkt\xF8jslinje",bottom:"Nederst",left:"Venstre",right:"H\xF8jre",top:"\xD8verst","export.background":"Baggrund ved eksport",auto:"Automatisk",light:"Lys",dark:"M\xF8rk",image:"Billede","keyboard.shortcuts":"Tastaturgenveje",loading:"Indl\xE6ser",page:"Side",search:"S\xF8g","stretch.x":"Str\xE6k vandret","stretch.y":"Str\xE6k lodret","translation.link":"L\xE6r mere",transparent:"Gennemsigtig"};var Al={"style.menu.color":"Farbe","style.menu.fill":"F\xFCllen","style.menu.dash":"Strich","style.menu.size":"Gr\xF6\xDFe","style.menu.keep.open":"Offen halten","style.menu.font":"Schriftart","style.menu.align":"Ausrichten",styles:"Stile","zoom.in":"Heranzoomen","zoom.out":"Herauszoomen",to:"zu","menu.tools":"Werkzeuge","menu.transform":"Transformieren","menu.file":"Datei","menu.edit":"Bearbeiten","menu.view":"Ansicht","menu.preferences":"Pr\xE4ferenzen","menu.sign.in":"Einloggen","menu.sign.out":"Ausloggen","become.a.sponsor":"Sponsor werden","zoom.to.content":"Zur\xFCck zum Inhalt","zoom.to.selection":"Zur Auswahl zoomen","zoom.to.fit":"Zoom anpassen","zoom.to":"Zoomen nach","preferences.dark.mode":"Dunkler Modus","preferences.focus.mode":"Fokus Modus","preferences.debug.mode":"Debug Modus","preferences.show.grid":"Gitter anzeigen","preferences.use.cad.selection":"CAD Auswahl verwenden","preferences.keep.stylemenu.open":"Stilmen\xFC offen halten","preferences.always.show.snaps":"Hilfslinien immer anzeigen","preferences.rotate.handles":"Rotiergriffe","preferences.binding.handles":"Bindegriffe","preferences.clone.handles":"Klongriffe",undo:"R\xFCckg\xE4ngig machen",redo:"Wiederherstellen",cut:"Ausschneiden",copy:"Kopieren",paste:"Einf\xFCgen","copy.as":"Kopieren als","export.as":"Exportieren als","select.all":"Alles ausw\xE4hlen","select.none":"Nichts ausw\xE4hlen",delete:"L\xF6schen","new.project":"Neues Projekt",open:"\xD6ffnen",save:"Speichern","save.as":"Speichern als","upload.media":"Medien hochladen","create.page":"Seite erstellen","new.page":"Neue Seite","page.name":"Seitenname",duplicate:"Duplizieren","shape.options":"Form Optionen",shapes:"Fromen",cancel:"Abbrechen","copy.invite.link":"Einladungslink kopieren","copy.readonly.link":"Schreibgesch\xFCtzten Link kopieren","create.multiplayer.project":"Geteiltes Projekt erstellen","copy.multiplayer.project":"In ein Geteiltes Projekt kopieren",select:"Ausw\xE4hlen",eraser:"Radierer",draw:"Malen",arrow:"Pfeil",text:"Text",sticky:"Notiz",rectangle:"Rechteck",ellipse:"Ellipse",triangle:"Dreieck",line:"Linie",rotate:"Drehen","lock.aspect.ratio":"Seitenverh\xE4ltnis sperren","unlock.aspect.ratio":"Seitenverh\xE4ltnis entsperren",group:"Gruppieren",ungroup:"Gruppierung aufheben","move.to.back":"Nach Hinten verschieben","move.backward":"R\xFCckw\xE4rts schieben","move.forward":"Vorw\xE4rts schieben","move.to.front":"Nach Vorne verschieben","reset.angle":"Winkel zur\xFCcksetzen",lock:"Sperren",unlock:"Entsperren","align.distribute":"Ausrichten / Verteilen","move.to.page":"Zu Seite verschieben","flip.horizontal":"Horizontal spiegeln","flip.vertical":"Vertikal spiegeln",move:"Verschieben","to.front":"Nach Vorne",forward:"Vorw\xE4rts",backward:"R\xFCckw\xE4rts",back:"Hinten",language:"Sprache","translation.link":"Mehr erfahren","dock.position":"Dock Position",bottom:"Unten",left:"Links",right:"Rechts",top:"Oben",page:"Seite","keyboard.shortcuts":"Tastaturkurzbefehle",search:"Suche",loading:"Laden{dots}","export.background":"Hintergrund Exportieren",transparent:"Transparent",auto:"Auto",light:"Hell",dark:"Dunkel",github:"Github",twitter:"Twitter",discord:"Discord",image:"Bild","align.left":"Links ausrichten","align.center.x":"Horizontal mittig ausrichten","align.right":"Rechts ausrichten","align.top":"Oben ausrichten","align.center.y":"Vertikal mittig ausrichten","align.bottom":"Unten ausrichten","distribute.x":"Horizontal verteilen","distribute.y":"Vertikal verteilen","stretch.x":"Horizontal strecken","stretch.y":"Vertikal strecken","dialog.save.firsttime":"M\xF6chten Sie Ihr aktuelles Projekt speichern?","dialog.save.again":"M\xF6chten Sie die \xC4nderungen an Ihrem aktuellen Projekt speichern?","dialog.cancel":"Abbrechen","dialog.no":"Nein","dialog.yes":"Ja","enter.file.name":"Dateiname eingeben","telva-beta":"Probieren Sie das neue telva",white:"Wei\xDF",lightGray:"hellgrau",gray:"Frau",black:"Schwarz",green:"Gr\xFCn",cyan:"Cyan",blue:"Blau",indigo:"Indigo",violet:"Violett",red:"Rot",orange:"Orange",yellow:"Gelb",solid:"Durchgehend",dashed:"Gestrichelt",dotted:"Gepunktet",small:"Klein",medium:"Mittel",large:"Gro\xDF"};var Vl={};var Hl={"style.menu.color":"Color","style.menu.fill":"Relleno","style.menu.dash":"L\xEDnea","style.menu.size":"Tama\xF1o","style.menu.keep.open":"Mantener abierto","style.menu.font":"Fuente","style.menu.align":"Alineaci\xF3n",styles:"Estilos","zoom.in":"Acercar","zoom.out":"Alejar",to:"A","menu.tools":"Herramientas","menu.transform":"Transformar","menu.file":"Archivo","menu.edit":"Editar","menu.view":"Ver","menu.preferences":"Preferencias","menu.sign.in":"Iniciar sesi\xF3n","menu.sign.out":"Cerrar sesi\xF3n","become.a.sponsor":"Convi\xE9rtete en patrocinador","zoom.to.content":"Acercar al contenido","zoom.to.selection":"Acercar a la selecci\xF3n","zoom.to.fit":"Ajustar a la ventana","zoom.to":"Acercar a","preferences.dark.mode":"Modo oscuro","preferences.focus.mode":"Modo concentraci\xF3n","preferences.debug.mode":"Modo depuraci\xF3n","preferences.show.grid":"Mostrar cuadr\xEDcula","preferences.use.cad.selection":"Usar selecci\xF3n CAD","preferences.keep.stylemenu.open":"Mantener men\xFA de estilos abierto","preferences.always.show.snaps":"Mostrar puntos de ajuste","preferences.rotate.handles":"Control de rotaci\xF3n","preferences.binding.handles":"Control de vinculaci\xF3n","preferences.clone.handles":"Control de clonaci\xF3n",undo:"Deshacer",redo:"Rehacer",cut:"Cortar",copy:"Copiar",paste:"Pegar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todo","select.none":"Selecionar nada",delete:"Borrar","new.project":"Nuevo Proyecto",open:"Abrir",save:"Guardar","save.as":"Guardar como","upload.media":"Subir medios","create.page":"Crear p\xE1gina","new.page":"Nueva p\xE1gina","page.name":"Nombre de p\xE1gina",duplicate:"Duplicar","shape.options":"Opciones de formas",shapes:"Formas",cancel:"Cancelar","copy.invite.link":"Copiar invitaci\xF3n","copy.readonly.link":"Copiar invitaci\xF3n (solo lectura)","create.multiplayer.project":"Crear proyecto multijugador","copy.multiplayer.project":"Copiar proyecto multijugador",select:"Seleccionar",eraser:"Borrador",draw:"Dibujar",arrow:"Flecha",text:"Texto",sticky:"Pegatina",rectangle:"Rect\xE1ngulo",ellipse:"Elipse",triangle:"Tri\xE1ngulo",line:"L\xEDnea",rotate:"Rotar","lock.aspect.ratio":"Bloquear relaci\xF3n de aspecto","unlock.aspect.ratio":"Desbloquear relaci\xF3n de aspecto",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Mover al fondo","move.backward":"Mover atr\xE1s","move.forward":"Mover adelante","move.to.front":"Mover al frente","reset.angle":"Restablecer \xE1ngulo",lock:"Bloquear",unlock:"Desbloquear","align.distribute":"Alinear / Distribuir","move.to.page":"Mover a p\xE1gina","flip.horizontal":"Voltear horizontalmente","flip.vertical":"Voltear verticalmente",move:"Mover","to.front":"Al frente",forward:"Adelante",backward:"Atr\xE1s",back:"Fondo",language:"Idioma","translation.link":"Saber m\xE1s","dock.position":"Posici\xF3n del dock",bottom:"Abajo",left:"Izquierda",right:"Derecha",top:"Arriba",page:"P\xE1gina","keyboard.shortcuts":"Atajos de teclado",search:"Buscar",loading:"Cargando{dots}","export.background":"Exportar fondo",transparent:"Transparente",auto:"Auto",light:"Claro",dark:"Oscuro",github:"Github",twitter:"Twitter",discord:"Discord",image:"Imagen","align.left":"Alinear a la izquierda","align.center.x":"Alinear al centro horizontalmente","align.right":"Alinear a la derecha","align.top":"Alinear arriba","align.center.y":"Alinear al centro verticalmente","align.bottom":"Alinear abajo","distribute.x":"Distribuir horizontalmente","distribute.y":"Distribuir verticalmente","stretch.x":"Estirar horizontalmente","stretch.y":"Estirar verticalmente","dialog.save.firsttime":"\xBFQuieres guardar el proyecto actual?","dialog.save.again":"\xBFQuieres guardar los cambios en el proyecto actual?","dialog.cancel":"Cancelar","dialog.no":"No","dialog.yes":"S\xED","enter.file.name":"Introduce el nombre del arquivo","telva-beta":"Prueba el nuevo telva",white:"Blanco",lightGray:"Gris claro",gray:"Gris",black:"Negro",green:"Verde",cyan:"Cian",blue:"Azul",indigo:"Indigo",violet:"Violeta",red:"Rojo",orange:"Naranja",yellow:"Amarillo",solid:"Cont\xEDnuo",dashed:"Discont\xEDnuo",dotted:"Punteado",small:"Peque\xF1o",medium:"Mediano",large:"Grande"};var zl={"style.menu.color":"\u0631\u0646\u06AF","style.menu.fill":"\u062A\u0648\u067E\u064F\u0631","style.menu.dash":"\u062E\u0637\u200C\u0686\u06CC\u0646","style.menu.size":"\u0627\u0646\u062F\u0627\u0632\u0647","style.menu.keep.open":"\u0628\u0627\u0632 \u0646\u06AF\u0647\u200C\u062F\u0627\u0634\u062A\u0646","style.menu.font":"\u0642\u0644\u0645","style.menu.align":"\u062A\u0631\u0627\u0632",styles:"\u0633\u0628\u06A9\u200C\u0647\u0627","zoom.in":"\u0628\u0632\u0631\u06AF\u200C\u0646\u0645\u0627\u06CC\u06CC","zoom.out":"\u06A9\u0648\u0686\u06A9\u200C\u0646\u0645\u0627\u06CC\u06CC",to:"\u0628\u0647","menu.tools":"\u0627\u0628\u0632\u0627\u0631\u0647\u0627","menu.transform":"\u062A\u063A\u06CC\u06CC\u0631 \u0634\u06A9\u0644","menu.file":"\u067E\u0631\u0648\u0646\u062F\u0647","menu.edit":"\u0648\u06CC\u0631\u0627\u06CC\u0634","menu.view":"\u0646\u0645\u0627\u06CC\u0634","menu.preferences":"\u062A\u0631\u062C\u06CC\u062D\u0627\u062A","menu.sign.in":"\u0648\u0631\u0648\u062F","menu.sign.out":"\u062E\u0631\u0648\u062C","become.a.sponsor":"\u062D\u0645\u0627\u06CC\u062A\u200C\u06A9\u0646\u0646\u062F\u0647 \u0634\u0648\u06CC\u062F","zoom.to.content":"\u0628\u0627\u0632\u06AF\u0634\u062A \u0628\u0647 \u0645\u062D\u062A\u0648\u0627","zoom.to.selection":"\u0628\u0632\u0631\u06AF\u200C\u0646\u0645\u0627\u06CC\u06CC \u0628\u0647 \u0646\u0627\u062D\u06CC\u0647 \u0627\u0646\u062A\u062E\u0627\u0628\u200C\u0634\u062F\u0647","zoom.to.fit":"\u0628\u0632\u0631\u06AF\u200C\u0646\u0645\u0627\u06CC\u06CC \u0645\u062A\u0646\u0627\u0633\u0628 \u0628\u0627 \u0635\u0641\u062D\u0647","zoom.to":"\u0628\u0632\u0631\u06AF\u200C\u0646\u0645\u0627\u06CC\u06CC \u0628\u0647","preferences.dark.mode":"\u062D\u0627\u0644\u062A \u062A\u0627\u0631\u06CC\u06A9","preferences.focus.mode":"\u062D\u0627\u0644\u062A \u062A\u0645\u0631\u06A9\u0632","preferences.debug.mode":"\u062D\u0627\u0644\u062A \u0639\u06CC\u0628\u200C\u06CC\u0627\u0628\u06CC","preferences.show.grid":"\u0646\u0645\u0627\u06CC\u0634 \u062E\u0637\u0648\u0637 \u0631\u0627\u0647\u0646\u0645\u0627","preferences.use.cad.selection":"\u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0627\u0632 \u062D\u0627\u0644\u062A \u0627\u0646\u062A\u062E\u0627\u0628 CAD","preferences.keep.stylemenu.open":"\u0628\u0627\u0632 \u0646\u06AF\u0647\u200C\u062F\u0627\u0634\u062A\u0646 \u0645\u0646\u0648\u06CC \u0633\u0628\u06A9\u200C\u0647\u0627","preferences.always.show.snaps":"\u0647\u0645\u06CC\u0634\u0647 \u0646\u0642\u0627\u0637 \u0686\u0633\u0628\u0627\u0646 \u0631\u0627 \u0646\u0634\u0627\u0646 \u0628\u062F\u0647","preferences.rotate.handles":"\u062F\u0633\u062A\u06AF\u06CC\u0631\u0647\u200C\u0647\u0627\u06CC \u0686\u0631\u062E\u0634","preferences.binding.handles":"\u062F\u0633\u062A\u06AF\u06CC\u0631\u0647\u200C\u0647\u0627\u06CC \u0627\u062A\u0635\u0627\u0644\u200C\u062F\u0647\u0646\u062F\u0647","preferences.clone.handles":"\u062F\u0633\u062A\u06AF\u06CC\u0631\u0647\u200C\u0647\u0627\u06CC \u062A\u06A9\u062B\u06CC\u0631",undo:"\u0648\u0627\u06AF\u0631\u062F\u0627\u0646\u06CC",redo:"\u0627\u0646\u062C\u0627\u0645 \u062F\u0648\u0628\u0627\u0631\u0647",cut:"\u0628\u0631\u06CC\u062F\u0646",copy:"\u06A9\u067E\u06CC",paste:"\u062C\u0627\u06CC\u200C\u06AF\u0630\u0627\u0631\u06CC","copy.as":"\u06A9\u067E\u06CC \u0628\u0647\u200C\u0639\u0646\u0648\u0627\u0646","export.as":"\u062E\u0631\u0648\u062C\u06CC\u200C\u06AF\u0631\u0641\u062A\u0646 \u0628\u0647\u200C\u0639\u0646\u0648\u0627\u0646","select.all":"\u0627\u0646\u062A\u062E\u0627\u0628 \u0647\u0645\u0647","select.none":"\u0627\u0646\u062A\u062E\u0627\u0628 \u0647\u06CC\u0686\u200C\u06CC\u06A9",delete:"\u062D\u0630\u0641","new.project":"\u067E\u0631\u0648\u0698\u0647 \u062C\u062F\u06CC\u062F",open:"\u0628\u0627\u0632\u06A9\u0631\u062F\u0646",save:"\u0630\u062E\u06CC\u0631\u0647","save.as":"\u0630\u062E\u06CC\u0631\u0647 \u0628\u0647\u200C\u0639\u0646\u0648\u0627\u0646","upload.media":"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u0631\u0633\u0627\u0646\u0647","create.page":"\u0627\u06CC\u062C\u0627\u062F \u0628\u0631\u06AF\u0647","new.page":"\u0628\u0631\u06AF\u0647 \u062C\u062F\u06CC\u062F","page.name":"\u0646\u0627\u0645 \u0628\u0631\u06AF\u0647",duplicate:"\u062A\u06A9\u062B\u06CC\u0631\u06A9\u0631\u062F\u0646","shape.options":"\u06AF\u0632\u06CC\u0646\u0647\u200C\u0647\u0627\u06CC \u0634\u06A9\u0644",shapes:"\u0634\u06A9\u0644\u200C\u0647\u0627",cancel:"\u0644\u063A\u0648","copy.invite.link":"\u06A9\u067E\u06CC\u200C\u06A9\u0631\u062F\u0646 \u067E\u06CC\u0648\u0646\u062F \u062F\u0639\u0648\u062A","copy.readonly.link":"\u06A9\u067E\u06CC\u200C\u06A9\u0631\u062F\u0646 \u067E\u06CC\u0648\u0646\u062F \u063A\u06CC\u0631\u0642\u0627\u0628\u0644 \u0648\u06CC\u0631\u0627\u06CC\u0634","create.multiplayer.project":"\u0627\u06CC\u062C\u0627\u062F \u06CC\u06A9 \u067E\u0631\u0648\u0698\u0647 \u0686\u0646\u062F\u0646\u0641\u0631\u0647","copy.multiplayer.project":"\u06A9\u067E\u06CC \u0628\u0647 \u067E\u0631\u0648\u0698\u0647 \u0686\u0646\u062F\u0646\u0641\u0631\u0647",select:"\u0627\u0646\u062A\u062E\u0627\u0628",eraser:"\u067E\u0627\u06A9\u200C\u06A9\u0646",draw:"\u0631\u0633\u0645",arrow:"\u0641\u0650\u0644\u0650\u0634",text:"\u0645\u062A\u0646",sticky:"\u0628\u0631\u06AF\u0647 \u0686\u0633\u0628\u0627\u0646",rectangle:"\u0686\u0647\u0627\u0631\u06AF\u0648\u0634",ellipse:"\u06AF\u0631\u062F\u06CC",triangle:"\u0633\u0647\u200C\u06AF\u0648\u0634",line:"\u062E\u0637",rotate:"\u0686\u0631\u062E\u0627\u0646\u062F\u0646","lock.aspect.ratio":"\u0642\u0641\u0644\u200C\u06A9\u0631\u062F\u0646 \u0646\u0633\u0628\u062A \u0627\u0628\u0639\u0627\u062F","unlock.aspect.ratio":"\u0627\u062C\u0627\u0632\u0647 \u062A\u063A\u06CC\u06CC\u0631 \u0646\u0633\u0628\u062A \u0627\u0628\u0639\u0627\u062F",group:"\u06AF\u0631\u0648\u0647\u200C\u0628\u0646\u062F\u06CC",ungroup:"\u0644\u063A\u0648 \u06AF\u0631\u0648\u0647\u200C\u0628\u0646\u062F\u06CC","move.to.back":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u0639\u0642\u0628","move.backward":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u0633\u0645\u062A \u0639\u0642\u0628","move.forward":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u0633\u0645\u062A \u062C\u0644\u0648","move.to.front":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u062C\u0644\u0648","reset.angle":"\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u06CC \u0632\u0627\u0648\u06CC\u0647",lock:"\u0642\u0641\u0644",unlock:"\u0628\u0627\u0632\u06A9\u0631\u062F\u0646 \u0642\u0641\u0644","align.distribute":"\u062A\u0631\u0627\u0632 / \u067E\u062E\u0634\u200C\u06A9\u0631\u062F\u0646","move.to.page":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u0628\u0631\u06AF\u0647","flip.horizontal":"\u0648\u0627\u0631\u0648\u0646\u0647\u200C\u0633\u0627\u0632\u06CC \u0627\u0641\u0642\u06CC","flip.vertical":"\u0648\u0627\u0631\u0648\u0646\u0647\u200C\u0633\u0627\u0632\u06CC \u0639\u0645\u0648\u062F\u06CC",move:"\u062D\u0631\u06A9\u062A\u200C\u062F\u0627\u062F\u0646","to.front":"\u0628\u0647 \u062C\u0644\u0648",forward:"\u0628\u0647 \u0633\u0645\u062A \u062C\u0644\u0648",backward:"\u0628\u0647 \u0633\u0645\u062A \u0639\u0642\u0628",back:"\u0628\u0647 \u0639\u0642\u0628",language:"\u0632\u0628\u0627\u0646","translation.link":"\u06CC\u0627\u062F\u06AF\u06CC\u0631\u06CC \u0628\u06CC\u0634\u062A\u0631","dock.position":"\u0645\u0648\u0642\u0639\u06CC\u062A \u0646\u0648\u0627\u0631 \u0627\u0628\u0632\u0627\u0631",bottom:"\u067E\u0627\u06CC\u06CC\u0646",left:"\u0686\u067E",right:"\u0631\u0627\u0633\u062A",top:"\u0628\u0627\u0644\u0627",page:"\u0628\u0631\u06AF\u0647","keyboard.shortcuts":"\u0645\u06CC\u0627\u0646\u200C\u0628\u0631\u0647\u0627\u06CC \u0635\u0641\u062D\u0647\u200C\u06A9\u0644\u06CC\u062F",search:"\u062C\u0633\u062A\u062C\u0648",loading:"\u0628\u0627\u0631\u06AF\u06CC\u0631\u06CC{dots}","export.background":"\u062E\u0631\u0648\u062C\u06CC\u200C\u06AF\u0631\u0641\u062A\u0646 \u067E\u0633\u200C\u0632\u0645\u06CC\u0646\u0647",transparent:"\u0634\u0641\u0627\u0641",auto:"\u062E\u0648\u062F\u06A9\u0627\u0631",light:"\u0631\u0648\u0634\u0646",dark:"\u062A\u0627\u0631\u06CC\u06A9",github:"\u06AF\u06CC\u062A\u200C\u0647\u0627\u0628",twitter:"\u062A\u0648\u06CC\u06CC\u062A\u0631",discord:"\u062F\u06CC\u0633\u06A9\u0648\u0631\u062F",image:"\u062A\u0635\u0648\u06CC\u0631","align.left":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0686\u067E","align.center.x":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0645\u0631\u06A9\u0632 \u0627\u0641\u0642\u06CC","align.right":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0631\u0627\u0633\u062A","align.top":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0628\u0627\u0644\u0627","align.center.y":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0645\u0631\u06A9\u0632 \u0639\u0645\u0648\u062F\u06CC","align.bottom":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u067E\u0627\u06CC\u06CC\u0646","distribute.x":"\u067E\u062E\u0634\u200C\u06A9\u0631\u062F\u0646 \u0627\u0641\u0642\u06CC","distribute.y":"\u067E\u062E\u0634\u200C\u06A9\u0631\u062F\u0646 \u0639\u0645\u0648\u062F\u06CC","stretch.x":"\u06A9\u0634\u200C\u0622\u0648\u0631\u062F\u0646 \u0627\u0641\u0642\u06CC","stretch.y":"\u06A9\u0634\u200C\u0622\u0648\u0631\u062F\u0646 \u0639\u0645\u0648\u062F\u06CC","dialog.save.firsttime":"\u0622\u06CC\u0627 \u0645\u06CC\u200C\u062E\u0648\u0627\u0647\u06CC\u062F \u067E\u0631\u0648\u0698\u0647 \u0641\u0639\u0644\u06CC \u062E\u0648\u062F \u0631\u0627 \u0630\u062E\u06CC\u0631\u0647 \u06A9\u0646\u06CC\u062F\u061F","dialog.save.again":"\u0622\u06CC\u0627 \u0645\u06CC\u200C\u062E\u0648\u0627\u0647\u06CC\u062F \u06A9\u0647 \u062A\u063A\u06CC\u06CC\u0631\u0627\u062A \u0631\u0627 \u062F\u0631 \u067E\u0631\u0648\u0698\u0647 \u0641\u0639\u0644\u06CC \u062E\u0648\u062F \u0630\u062E\u06CC\u0631\u0647 \u06A9\u0646\u06CC\u062F\u061F","dialog.cancel":"\u0644\u063A\u0648","dialog.no":"\u062E\u06CC\u0631","dialog.yes":"\u0628\u0644\u0647","enter.file.name":"\u0646\u0627\u0645 \u067E\u0631\u0648\u0646\u062F\u0647 \u0631\u0627 \u0648\u0627\u0631\u062F \u06A9\u0646\u06CC\u062F","telva-beta":"\u0627\u0645\u062A\u062D\u0627\u0646\u200C\u06A9\u0631\u062F\u0646 telva \u062C\u062F\u06CC\u062F",white:"\u0633\u0641\u06CC\u062F",lightGray:"\u062E\u0627\u06A9\u0633\u062A\u0631\u06CC \u0631\u0648\u0634\u0646",gray:"\u062E\u0627\u06A9\u0633\u062A\u0631\u06CC",black:"\u0645\u0634\u06A9\u06CC",green:"\u0633\u0628\u0632",cyan:"\u0641\u06CC\u0631\u0648\u0632\u0647\u200C\u0627\u06CC",blue:"\u0622\u0628\u06CC",indigo:"\u0646\u06CC\u0644\u06CC",violet:"\u0628\u0646\u0641\u0634",red:"\u0642\u0631\u0645\u0632",orange:"\u0646\u0627\u0631\u0646\u062C\u06CC",yellow:"\u0632\u0631\u062F",solid:"\u062A\u0648\u067E\u064F\u0631",dashed:"\u062E\u0637\u200C\u0686\u06CC\u0646",dotted:"\u0646\u0642\u0637\u0647\u200C\u0686\u06CC\u0646",small:"\u06A9\u0648\u0686\u06A9",medium:"\u0645\u062A\u0648\u0633\u0637",large:"\u0628\u0632\u0631\u06AF"};var Fl={"style.menu.color":"Couleur","style.menu.fill":"Remplir","style.menu.dash":"Bordure","style.menu.size":"Taille","style.menu.keep.open":"Toujours afficher le menu","style.menu.font":"Police","style.menu.align":"Alignement",styles:"Styles","zoom.in":"Zoom avant","zoom.out":"Zoom arri\xE8re",to:"\xC0","menu.tools":"Outils","menu.transform":"Transformation","menu.file":"Fichier","menu.edit":"\xC9dition","menu.view":"Afficher","menu.preferences":"Pr\xE9f\xE9rences","menu.sign.in":"S'authentifier","menu.sign.out":"Se d\xE9connecter","become.a.sponsor":"Devenir un sponsor","zoom.to.content":"Retour au contenu","zoom.to.selection":"Ajuster le zoom \xE0 la s\xE9lection","zoom.to.fit":"Adapter le zoom au contenu","zoom.to":"R\xE9tablir le zoom \xE0","preferences.dark.mode":"Mode sombre","preferences.focus.mode":"Mode focus","preferences.debug.mode":"Afficher la barre d\xE9veloppeur","preferences.show.grid":"Afficher la grille","preferences.use.cad.selection":"Utiliser la s\xE9lection CAD","preferences.keep.stylemenu.open":"Toujours afficher le menu styles","preferences.always.show.snaps":"Afficher les rep\xE8res dynamiques","preferences.rotate.handles":"Manier la rotation","preferences.binding.handles":"Manier les liaisons","preferences.clone.handles":"Manier le clonage",undo:"Annuler",redo:"R\xE9tablir",cut:"Couper",copy:"Copier",paste:"Coller","copy.as":"Copier au format","export.as":"Exporter au format","select.all":"Tout s\xE9lectionner","select.none":"Tout d\xE9s\xE9lectionner",delete:"Supprimer","new.project":"Nouveau project",open:"Ouvrir",save:"Enregistrer","save.as":"Enregistrer sous","upload.media":"Importer un m\xE9dia","create.page":"Cr\xE9er une page","new.page":"Nouvelle Page","page.name":"Nom de la page",duplicate:"Dupliquer",cancel:"Annuler","copy.invite.link":"Copier le lien d'invitation","copy.readonly.link":"Copier le lien en lecture seule d'invitation","create.multiplayer.project":"Cr\xE9er un project multi-joueurs","copy.multiplayer.project":"Copier dans un projet multi-joueurs",select:"S\xE9lection",eraser:"Gomme",draw:"Crayon",arrow:"Fl\xE8che",text:"Texte",sticky:"Note",rectangle:"Rectangle",ellipse:"Cercle",triangle:"Triangle",line:"Ligne",rotate:"Rotation","lock.aspect.ratio":"Verrouiller les proportions","unlock.aspect.ratio":"D\xE9verrouiller les proportions",group:"Grouper",ungroup:"D\xE9grouper","move.to.back":"D\xE9placer \xE0 l'arri\xE8re-plan","move.backward":"Reculer d'un plan","move.forward":"Avancer d'un plan","move.to.front":"Placer au premier plan","reset.angle":"R\xE9initialiser la rotation",lock:"Verrouiller",unlock:"D\xE9verrouiller","align.distribute":"Alignement / R\xE9partion","move.to.page":"D\xE9placer vers la page","flip.horizontal":"Retourner horizontalement","flip.vertical":"Retourner verticalement",move:"Disposition","to.front":"Placer au premier plan",forward:"Avancer d'un plan",backward:"Reculer d'un plan",back:"D\xE9placer \xE0 l'arri\xE8re-plan",language:"Langage","translation.link":"En savoir plus","dock.position":"Position du dock",bottom:"En bas",left:"\xC0 gauche",right:"\xC0 droite",top:"En haut",page:"Page","keyboard.shortcuts":"Raccourcis clavier",search:"Rechercher",loading:"Chargement{dots}","export.background":"Couleur d'arri\xE8re-plan de l'export",transparent:"Transparent",auto:"Automatique",light:"Clair",dark:"Sombre"};var Ol={"style.menu.color":"Cor","style.menu.fill":"Recheo","style.menu.dash":"Li\xF1a","style.menu.size":"Tama\xF1o","style.menu.keep.open":"Manter aberto","style.menu.font":"Fonte","style.menu.align":"Ali\xF1amento",styles:"Estilos","zoom.in":"Achegar","zoom.out":"Afastar",to:"A","menu.tools":"Ferramentas","menu.transform":"Transformar","menu.file":"Arquivo","menu.edit":"Editar","menu.view":"Ver","menu.preferences":"Preferencias","menu.sign.in":"Iniciar sesi\xF3n","menu.sign.out":"Pechar sesi\xF3n","become.a.sponsor":"Conv\xEDrtete en patrocinador","zoom.to.content":"Achegar ao contido","zoom.to.selection":"Achegar \xE1 selecci\xF3n","zoom.to.fit":"Axustar \xE1 vent\xE1","zoom.to":"Achegar a","preferences.dark.mode":"Modo escuro","preferences.focus.mode":"Modo concentraci\xF3n","preferences.debug.mode":"Modo depuraci\xF3n","preferences.show.grid":"Amosar cuadr\xEDcula","preferences.use.cad.selection":"Usar selecci\xF3n CAD","preferences.keep.stylemenu.open":"Manter men\xFA de estilos aberto","preferences.always.show.snaps":"Amosar puntos de axuste","preferences.rotate.handles":"Control de rotaci\xF3n","preferences.binding.handles":"Control de vinculaci\xF3n","preferences.clone.handles":"Control de clonaci\xF3n",undo:"Desfacer",redo:"Refacer",cut:"Cortar",copy:"Copiar",paste:"Pegar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todo","select.none":"Selecionar nada",delete:"Borrar","new.project":"Novo Proxecto",open:"Abrir",save:"Gardar","save.as":"Gardar como","upload.media":"Subir medios","create.page":"Crear p\xE1xina","new.page":"Nova p\xE1xina","page.name":"Nome de p\xE1xina",duplicate:"Duplicar","shape.options":"Opci\xF3ns de formas",shapes:"Formas",cancel:"Cancelar","copy.invite.link":"Copiar invitaci\xF3n","copy.readonly.link":"Copiar invitaci\xF3n (s\xF3 lectura)","create.multiplayer.project":"Crear proxecto multixogador","copy.multiplayer.project":"Copiar proxecto multixogador",select:"Seleccionar",eraser:"Borrador",draw:"Debuxar",arrow:"Frecha",text:"Texto",sticky:"Pegatina",rectangle:"Rect\xE1ngulo",ellipse:"Elipse",triangle:"Tri\xE1ngulo",line:"Li\xF1a",rotate:"Rotar","lock.aspect.ratio":"Bloquear relaci\xF3n de aspecto","unlock.aspect.ratio":"Desbloquear relaci\xF3n de aspecto",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Mover ao fondo","move.backward":"Mover atr\xE1s","move.forward":"Mover adiante","move.to.front":"Mover ao fronte","reset.angle":"Restablecer \xE1ngulo",lock:"Bloquear",unlock:"Desbloquear","align.distribute":"Ali\xF1ar / Distribu\xEDr","move.to.page":"Mover \xE1 p\xE1xina","flip.horizontal":"Voltear horizontalmente","flip.vertical":"Voltear verticalmente",move:"Mover","to.front":"Ao fronte",forward:"Adilante",backward:"Atr\xE1s",back:"Fondo",language:"Idioma","translation.link":"Saber m\xE1is","dock.position":"Posici\xF3n do dock",bottom:"Abaixo",left:"Esquerda",right:"Dereita",top:"Arriba",page:"P\xE1xina","keyboard.shortcuts":"Atallos de teclado",search:"Buscar",loading:"Cargando{dots}","export.background":"Exportar fondo",transparent:"Transparente",auto:"Auto",light:"Claro",dark:"Escuro",github:"Github",twitter:"Twitter",discord:"Discord",image:"Imaxe","align.left":"Ali\xF1ar \xE1 esquerda","align.center.x":"Ali\xF1ar ao centro horizontalmente","align.right":"Ali\xF1ar \xE1 dereita","align.top":"Ali\xF1ar arriba","align.center.y":"Ali\xF1ar ao centro verticalmente","align.bottom":"Ali\xF1ar abaixo","distribute.x":"Distribu\xEDr horizontalmente","distribute.y":"Distribu\xEDr verticalmente","stretch.x":"Estirar horizontalmente","stretch.y":"Estirar verticalmente","dialog.save.firsttime":"Queres gardar o proxecto actual?","dialog.save.again":"Queres gardar os cambios ao proxecto actual?","dialog.cancel":"Cancelar","dialog.no":"No","dialog.yes":"S\xED","enter.file.name":"Introduce o nome do arquivo","telva-beta":"Proba o novo telva",white:"Branco",lightGray:"Gris claro",gray:"Gris",black:"Negro",green:"Verde",cyan:"Cian",blue:"Azul",indigo:"Indigo",violet:"Violeta",red:"Vermello",orange:"Laranxa",yellow:"Amarelo",solid:"Cont\xEDnuo",dashed:"Discont\xEDnuo",dotted:"Punteado",small:"Pequeno",medium:"Mediano",large:"Grande"};var $l={"style.menu.color":"\u05E6\u05D1\u05E2","style.menu.fill":"\u05DE\u05DC\u05D0","style.menu.dash":"\u05D2\u05D1\u05D5\u05DC","style.menu.size":"\u05D2\u05D5\u05D3\u05DC","style.menu.keep.open":"\u05D4\u05E9\u05D0\u05E8 \u05E4\u05EA\u05D5\u05D7","style.menu.font":"\u05D2\u05D5\u05E4\u05DF","style.menu.align":"\u05D9\u05D9\u05E9\u05D5\u05E8",styles:"\u05E2\u05D9\u05E6\u05D5\u05D1","zoom.in":"\u05D4\u05D2\u05D3\u05DC \u05EA\u05E6\u05D5\u05D2\u05D4","zoom.out":"\u05D4\u05E7\u05D8\u05DF \u05EA\u05E6\u05D5\u05D2\u05D4",to:"\u05DC","menu.file":"\u05E7\u05D5\u05D1\u05E5","menu.edit":"\u05E2\u05E8\u05D9\u05DB\u05D4","menu.view":"\u05EA\u05E6\u05D5\u05D2\u05D4","menu.preferences":"\u05DE\u05D0\u05E4\u05D9\u05D9\u05E0\u05D9\u05DD","menu.sign.in":"\u05D4\u05D9\u05E8\u05E9\u05DD","menu.sign.out":"\u05D4\u05EA\u05E0\u05EA\u05E7","become.a.sponsor":"\u05DE\u05EA\u05DF \u05D7\u05E1\u05D5\u05EA","zoom.to.selection":"\u05D6\u05D5\u05DD \u05DC\u05D1\u05D7\u05D9\u05E8\u05D4","zoom.to.fit":"\u05D6\u05D5\u05DD \u05DC\u05D4\u05EA\u05D0\u05DE\u05D4","zoom.to":"\u05D6\u05D5\u05DD \u05DC","preferences.dark.mode":"\u05DE\u05E6\u05D1 \u05D7\u05E9\u05D5\u05DA","preferences.focus.mode":"\u05DE\u05E6\u05D1 \u05E4\u05D5\u05E7\u05D5\u05E1","preferences.debug.mode":"\u05DE\u05E6\u05D1 \u05D3\u05D9\u05D1\u05D0\u05D2","preferences.show.grid":"(\u05D2\u05E8\u05D9\u05D3)\u05D4\u05E8\u05D0\u05D4 \u05E8\u05E9\u05EA \u05E2\u05D9\u05DE\u05D5\u05D3","preferences.use.cad.selection":"\u05E1\u05D9\u05DE\u05D5\u05DF CAD","preferences.keep.stylemenu.open":"\u05D4\u05E9\u05D0\u05E8 \u05EA\u05E4\u05E8\u05D9\u05D8 \u05E2\u05D9\u05E6\u05D5\u05D1 \u05E4\u05EA\u05D5\u05D7","preferences.always.show.snaps":"\u05D4\u05E8\u05D0\u05D4 \u05E7\u05D5\u05D5\u05D9 \u05DE\u05EA\u05D0\u05E8","preferences.rotate.handles":"\u05D4\u05E8\u05D0\u05D4 \u05D9\u05D3\u05D9\u05D5\u05EA \u05E1\u05D9\u05D1\u05D5\u05D1","preferences.binding.handles":"\u05D4\u05E8\u05D0\u05D4 \u05D9\u05D3\u05D9\u05D5\u05EA \u05E7\u05E9\u05D9\u05E8\u05D4","preferences.clone.handles":"\u05D4\u05E8\u05D0\u05D4 \u05D9\u05D3\u05D9\u05D5\u05EA \u05E9\u05D9\u05DB\u05E4\u05D5\u05DC",undo:"\u05D1\u05D8\u05DC",redo:"\u05E2\u05E9\u05D4 \u05DE\u05D7\u05D3\u05E9",cut:"\u05D2\u05D6\u05D5\u05E8",copy:"\u05D4\u05E2\u05EA\u05E7",paste:"\u05D4\u05D3\u05D1\u05E7","copy.as":"\u05D4\u05E2\u05EA\u05E7 \u05DB","export.as":"\u05D9\u05D9\u05E6\u05D0 \u05DB","select.all":"\u05D1\u05D7\u05E8 \u05D4\u05DB\u05DC","select.none":"\u05D1\u05D8\u05DC \u05D1\u05D7\u05D9\u05E8\u05D4",delete:"\u05DE\u05D7\u05E7","new.project":"\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8 \u05D7\u05D3\u05E9",open:"\u05E4\u05EA\u05D7",save:"\u05E9\u05DE\u05D5\u05E8","save.as":"\u05E9\u05DE\u05D5\u05E8 \u05DB","upload.media":"\u05D4\u05E2\u05DC\u05D0\u05EA \u05DE\u05D3\u05D9\u05D4","create.page":"\u05E6\u05D5\u05E8 \u05D3\u05E3","new.page":"\u05D3\u05E3 \u05D7\u05D3\u05E9","page.name":"\u05E9\u05DD \u05D4\u05D3\u05E3",duplicate:"\u05E9\u05DB\u05E4\u05DC",cancel:"\u05D1\u05D8\u05DC","copy.invite.link":"\u05D4\u05E2\u05EA\u05E7 \u05E7\u05D9\u05E9\u05D5\u05E8 \u05D4\u05D6\u05DE\u05E0\u05D4","create.multiplayer.project":"\u05E6\u05D5\u05E8 \u05E4\u05E8\u05D5\u05D9\u05E7\u05D8 \u05E8\u05D1 \u05DE\u05E9\u05EA\u05EA\u05E4\u05D9\u05DD","copy.multiplayer.project":"\u05D4\u05E2\u05EA\u05E7 \u05DC\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8 \u05E8\u05D1 \u05DE\u05E9\u05EA\u05EA\u05E4\u05D9\u05DD",select:"\u05E1\u05DE\u05DF",eraser:"\u05DE\u05D7\u05E7",draw:"\u05E6\u05D9\u05D9\u05E8",arrow:"\u05D7\u05E5",text:"\u05D8\u05E7\u05E1\u05D8",sticky:"\u05D3\u05D1\u05D9\u05E7\u05D9",rectangle:"\u05DE\u05E8\u05D5\u05D1\u05E2",ellipse:"\u05D0\u05DC\u05D9\u05E4\u05E1\u05D4",triangle:"\u05DE\u05E9\u05D5\u05DC\u05E9",line:"\u05E7\u05D5",rotate:"\u05E1\u05D5\u05D1\u05D1","lock.aspect.ratio":"\u05E0\u05E2\u05DC \u05D9\u05D7\u05E1 \u05E8\u05D5\u05D7\u05D1-\u05D2\u05D5\u05D1\u05D4","unlock.aspect.ratio":"\u05E9\u05D7\u05E8\u05E8 \u05E0\u05E2\u05D9\u05DC\u05EA \u05D9\u05D7\u05E1 \u05E8\u05D5\u05D7\u05D1-\u05D2\u05D5\u05D1\u05D4",group:"\u05E7\u05D1\u05E5",ungroup:"\u05D1\u05D8\u05DC \u05E7\u05D9\u05D1\u05D5\u05E5","move.to.back":"\u05D4\u05D1\u05D0 \u05DC\u05EA\u05D7\u05EA\u05D9\u05EA","move.backward":"\u05D4\u05D6\u05D6 \u05D0\u05D7\u05D5\u05E8\u05D4","move.forward":"\u05D4\u05D6\u05D6 \u05E7\u05D3\u05D9\u05DE\u05D4","move.to.front":"\u05D4\u05D1\u05D0 \u05DC\u05D7\u05D6\u05D9\u05EA","reset.angle":"\u05D0\u05E4\u05E1 \u05D6\u05D5\u05D5\u05D9\u05EA",lock:"\u05E0\u05E2\u05DC",unlock:"\u05E9\u05D7\u05E8\u05E8 \u05E0\u05E2\u05D9\u05DC\u05D4","move.to.page":"\u05D4\u05D6\u05D6 \u05DC\u05D3\u05E3","flip.horizontal":"\u05D4\u05E4\u05D5\u05DA \u05D0\u05D5\u05E4\u05E7\u05D9\u05EA","flip.vertical":"\u05D4\u05E4\u05D5\u05DA \u05D0\u05E0\u05DB\u05D9\u05EA",move:"\u05D4\u05D6\u05D6","to.front":"\u05D4\u05D1\u05D0 \u05DC\u05E7\u05D3\u05D9\u05DE\u05D4",forward:"\u05E7\u05D3\u05D9\u05DE\u05D4",backward:"\u05D0\u05D7\u05D5\u05E8\u05D4",back:"\u05D1\u05D7\u05D6\u05E8\u05D4",language:"\u05E9\u05E4\u05D4"};var Gl={"style.menu.color":"Colore","style.menu.fill":"Riempi","style.menu.dash":"Tratteggo","style.menu.size":"Dimensione","style.menu.keep.open":"Mantieni aperto","style.menu.font":"Font","style.menu.align":"Allineamento",styles:"Stile","zoom.in":"Ingrandisci","zoom.out":"Rimpicciolisci",to:"Imposta","menu.file":"File","menu.edit":"Modifica","menu.view":"Visualizzazione","menu.preferences":"Preferenze","menu.sign.in":"Accedi","menu.sign.out":"Esci","become.a.sponsor":"Sponsorizza","zoom.to.selection":"Adatta alla selezione","zoom.to.fit":"Adatta","zoom.to":"Ingrandisci","preferences.dark.mode":"Modalit\xE0 scura","preferences.focus.mode":"Modalit\xE0 zen","preferences.debug.mode":"Modalit\xE0 sviluppatore","preferences.show.grid":"Mostra griglia","preferences.use.cad.selection":"Selezione CAD","preferences.keep.stylemenu.open":"Mantieni menu stile aperto","preferences.always.show.snaps":"Mostra sempre le guide","preferences.rotate.handles":"Controlli d'inclinazione","preferences.binding.handles":"Controlli d'associazione","preferences.clone.handles":"Controlli di clonazione",undo:"Annulla",redo:"Ripristina",cut:"Taglia",copy:"Copia",paste:"Incolla","copy.as":"Copia come","export.as":"Esporta come","select.all":"Seleziona tutto","select.none":"Deseleziona tutto",delete:"Elimina","new.project":"Nuovo progetto",open:"Apri",save:"Salva","save.as":"Salva come","upload.media":"Carica contenuti multimediali","create.page":"Crea nuova pagina","new.page":"Nuova pagina","page.name":"Nome pagina",page:"Pagina",duplicate:"Duplica",cancel:"Chiudi","copy.invite.link":"Copia link invito","create.multiplayer.project":"Crea progetto multiplayer","copy.multiplayer.project":"Trasforma in progetto multiplayer",select:"Seleziona",eraser:"Gomma",draw:"Matita",arrow:"Freccia",text:"Casella di testo",sticky:"Post-it",rectangle:"Rettangolo",ellipse:"Ellisse",triangle:"Triangolo",line:"Linea",rotate:"Ruota","lock.aspect.ratio":"Blocca rapporto lati","unlock.aspect.ratio":"Sblocca rapporto lati",group:"Raggruppa",ungroup:"Separa","move.to.back":"Muovi in fondo","move.backward":"Sposta indietro","move.forward":"Sposta avanti","move.to.front":"Muovi in fronte","reset.angle":"Reimposta angolo",lock:"Blocca",unlock:"Sblocca","move.to.page":"Trasferisci a pagina","flip.horizontal":"Ribalta orizzontalmente","flip.vertical":"Ribalta verticalmente",move:"Sposta","to.front":"In primo piano",forward:"Sposta avanti",backward:"Sposta indietro",back:"In fondo",language:"Lingua","dock.position":"Posizione dock",bottom:"In basso",left:"Sinistra",right:"Destra",top:"In Alto"};var jl={"style.menu.color":"\u8272","style.menu.fill":"\u5857\u308A\u3064\u3076\u3057","style.menu.dash":"\u7DDA","style.menu.size":"\u592A\u3055/\u30B5\u30A4\u30BA","style.menu.keep.open":"\u5E38\u306B\u8868\u793A","style.menu.font":"\u30D5\u30A9\u30F3\u30C8","style.menu.align":"\u914D\u7F6E",styles:"\u30B9\u30BF\u30A4\u30EB","zoom.in":"\u62E1\u5927","zoom.out":"\u7E2E\u5C0F",to:" ","menu.file":"\u30D5\u30A1\u30A4\u30EB","menu.edit":"\u7DE8\u96C6","menu.view":"\u8868\u793A","menu.preferences":"\u8A2D\u5B9A","menu.sign.in":"\u30B5\u30A4\u30F3\u30A4\u30F3","menu.sign.out":"\u30B5\u30A4\u30F3\u30A2\u30A6\u30C8","become.a.sponsor":"\u652F\u63F4\u3059\u308B","zoom.to.selection":"\u9078\u629E\u3057\u305F\u30A2\u30A4\u30C6\u30E0\u306B\u5408\u308F\u305B\u3066\u62E1\u5927","zoom.to.fit":"\u62E1\u5927\u3057\u3066\u3059\u3079\u3066\u3092\u8868\u793A","zoom.to":"\u62E1\u5927\u7387","preferences.dark.mode":"\u30C0\u30FC\u30AF\u30E2\u30FC\u30C9","preferences.focus.mode":"\u30D5\u30A9\u30FC\u30AB\u30B9\u30E2\u30FC\u30C9","preferences.debug.mode":"\u30C7\u30D0\u30C3\u30B0\u30E2\u30FC\u30C9","preferences.show.grid":"\u30B0\u30EA\u30C3\u30C9\u3092\u8868\u793A","preferences.use.cad.selection":"CAD\u306E\u9078\u629E\u6CD5\u3092\u4F7F\u7528","preferences.keep.stylemenu.open":"\u30B9\u30BF\u30A4\u30EB\u30E1\u30CB\u30E5\u30FC\u3092\u5E38\u306B\u8868\u793A","preferences.always.show.snaps":"\u30B9\u30CA\u30C3\u30D7\u3092\u5E38\u306B\u8868\u793A","preferences.rotate.handles":"\u56DE\u8EE2\u30CF\u30F3\u30C9\u30EB\u3092\u8868\u793A","preferences.binding.handles":"\u7D50\u5408\u30CF\u30F3\u30C9\u30EB\u3092\u8868\u793A","preferences.clone.handles":"\u30AF\u30ED\u30FC\u30F3\u30CF\u30F3\u30C9\u30EB\u3092\u8868\u793A",undo:"\u5143\u306B\u623B\u3059",redo:"\u3084\u308A\u76F4\u3057",cut:"\u5207\u308A\u53D6\u308A",copy:"\u30B3\u30D4\u30FC",paste:"\u8CBC\u308A\u4ED8\u3051","copy.as":"\u5F62\u5F0F\u3092\u9078\u629E\u3057\u3066\u30B3\u30D4\u30FC","export.as":"\u5F62\u5F0F\u3092\u9078\u629E\u3057\u3066\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","select.all":"\u3059\u3079\u3066\u9078\u629E","select.none":"\u9078\u629E\u3092\u89E3\u9664",delete:"\u524A\u9664","new.project":"\u65B0\u3057\u3044\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8",open:"\u958B\u304F",save:"\u4FDD\u5B58","save.as":"\u540D\u524D\u3092\u3064\u3051\u3066\u4FDD\u5B58","upload.media":"\u30E1\u30C7\u30A3\u30A2\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9","create.page":"\u30DA\u30FC\u30B8\u3092\u4F5C\u6210","new.page":"\u65B0\u898F\u30DA\u30FC\u30B8","page.name":"\u30DA\u30FC\u30B8\u540D",duplicate:"\u8907\u88FD",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB","copy.invite.link":"\u5171\u6709\u30EA\u30F3\u30AF\u3092\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u306B\u30B3\u30D4\u30FC","create.multiplayer.project":"\u30DE\u30EB\u30C1\u30D7\u30EC\u30A4\u30E4\u30FC\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u4F5C\u6210","copy.multiplayer.project":"\u30DE\u30EB\u30C1\u30D7\u30EC\u30A4\u30E4\u30FC\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u30B3\u30D4\u30FC",select:"\u9078\u629E",eraser:"\u6D88\u3057\u30B4\u30E0",draw:"\u63CF\u753B",arrow:"\u77E2\u5370",text:"\u30C6\u30AD\u30B9\u30C8",sticky:"\u3075\u305B\u3093",rectangle:"\u9577\u65B9\u5F62",ellipse:"\u6955\u5186\u5F62",triangle:"\u4E09\u89D2\u5F62",line:"\u7DDA",rotate:"\u56DE\u8EE2","lock.aspect.ratio":"\u7E26\u6A2A\u6BD4\u3092\u56FA\u5B9A","unlock.aspect.ratio":"\u7E26\u6A2A\u6BD4\u306E\u56FA\u5B9A\u3092\u89E3\u9664",group:"\u30B0\u30EB\u30FC\u30D4\u30F3\u30B0",ungroup:"\u30B0\u30EB\u30FC\u30D7\u89E3\u9664","move.to.back":"\u6700\u80CC\u9762\u306B\u79FB\u52D5","move.backward":"\u3072\u3068\u3064\u5F8C\u308D\u306B\u79FB\u52D5","move.forward":"\u3072\u3068\u3064\u524D\u306B\u79FB\u52D5","move.to.front":"\u6700\u524D\u9762\u306B\u79FB\u52D5","reset.angle":"\u89D2\u5EA6\u3092\u521D\u671F\u5316",lock:"\u30ED\u30C3\u30AF",unlock:"\u30A2\u30F3\u30ED\u30C3\u30AF","move.to.page":"\u30DA\u30FC\u30B8\u3078\u79FB\u52D5","flip.horizontal":"\u6C34\u5E73\u65B9\u5411\u306B\u53CD\u8EE2","flip.vertical":"\u5782\u76F4\u65B9\u5411\u306B\u53CD\u8EE2",move:"\u79FB\u52D5","to.front":"\u6700\u524D\u9762\u3078",forward:"\u3072\u3068\u3064\u524D\u3078",backward:"\u3072\u3068\u3064\u5F8C\u308D\u3078",back:"\u6700\u80CC\u9762\u3078",language:"\u8A00\u8A9E"};var Wl={"style.menu.color":"\uC0C9\uAE54","style.menu.fill":"\uCC44\uC6B0\uAE30","style.menu.dash":"\uD14C\uB450\uB9AC","style.menu.size":"\uD06C\uAE30","style.menu.keep.open":"\uD56D\uC0C1 \uC5F4\uAE30","style.menu.font":"\uAE00\uAF34","style.menu.align":"\uC815\uB82C",styles:"\uC2A4\uD0C0\uC77C","zoom.in":"\uD655\uB300","zoom.out":"\uCD95\uC18C",to:"To","menu.tools":"\uB3C4\uAD6C","menu.transform":"\uBCC0\uD658","menu.file":"\uD30C\uC77C","menu.edit":"\uD3B8\uC9D1","menu.view":"\uBCF4\uAE30","menu.preferences":"\uC124\uC815","menu.sign.in":"\uB85C\uADF8\uC778","menu.sign.out":"\uB85C\uADF8\uC544\uC6C3","become.a.sponsor":"\uD6C4\uC6D0\uC790 \uB418\uAE30","zoom.to.content":"\uCEE8\uD150\uCE20\uB85C \uB3CC\uC544\uAC00\uAE30","zoom.to.selection":"\uC120\uD0DD \uC694\uC18C\uC5D0 \uB9DE\uCD94\uAE30","zoom.to.fit":"\uC804\uCCB4\uC5D0 \uB9DE\uCD94\uAE30","zoom.to":"\uB9DE\uCD94\uAE30","preferences.dark.mode":"\uB2E4\uD06C \uBAA8\uB4DC","preferences.focus.mode":"\uC9D1\uC911 \uBAA8\uB4DC","preferences.debug.mode":"\uB514\uBC84\uADF8 \uBAA8\uB4DC","preferences.show.grid":"\uACA9\uC790 \uBCF4\uAE30","preferences.use.cad.selection":"CAD \uC120\uD0DD \uC0AC\uC6A9","preferences.keep.stylemenu.open":"\uC2A4\uD0C0\uC77C \uBA54\uB274 \uD56D\uC0C1 \uC5F4\uAE30","preferences.always.show.snaps":"Snap \uD56D\uC0C1 \uC5F4\uAE30","preferences.rotate.handles":"\uD68C\uC804 \uBCF4\uC774\uAE30","preferences.binding.handles":"\uBC14\uC778\uB529 \uBCF4\uC774\uAE30","preferences.clone.handles":"\uBCF5\uC81C \uBCF4\uC774\uAE30",undo:"\uC2E4\uD589\uCDE8\uC18C",redo:"\uC7AC\uC2E4\uD589",cut:"\uC790\uB974\uAE30",copy:"\uBCF5\uC0AC",paste:"\uBD99\uC5EC\uB123\uAE30","copy.as":"\uC774\uBBF8\uC9C0\uB85C \uBCF5\uC0AC","export.as":"\uB0B4\uBCF4\uB0B4\uAE30","select.all":"\uC804\uCCB4 \uC120\uD0DD","select.none":"\uC120\uD0DD \uD574\uC81C",delete:"\uC0AD\uC81C","new.project":"\uC0C8 \uD504\uB85C\uC81D\uD2B8",open:"\uC5F4\uAE30",save:"\uC800\uC7A5","save.as":"\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5","upload.media":"\uBBF8\uB514\uC5B4 \uC5C5\uB85C\uB4DC","create.page":"\uC0C8 \uD398\uC774\uC9C0 \uC0DD\uC131","new.page":"\uC0C8 \uD398\uC774\uC9C0","page.name":"\uD398\uC774\uC9C0 \uC774\uB984",duplicate:"\uBCF5\uC81C",cancel:"\uCDE8\uC18C","copy.invite.link":"\uCD08\uB300 \uB9C1\uD06C \uBCF5\uC0AC","copy.readonly.link":"\uC77D\uAE30 \uC804\uC6A9 \uB9C1\uD06C \uBCF5\uC0AC","create.multiplayer.project":"\uC2E4\uC2DC\uAC04 \uD611\uC5C5 \uD504\uB85C\uC81D\uD2B8 \uC0DD\uC131","copy.multiplayer.project":"\uC2E4\uC2DC\uAC04 \uD611\uC5C5 \uD504\uB85C\uC81D\uD2B8\uB85C \uBCF5\uC81C",select:"\uC120\uD0DD",eraser:"\uC9C0\uC6B0\uAC1C",draw:"\uD39C",arrow:"\uD654\uC0B4\uD45C",text:"\uD14D\uC2A4\uD2B8",sticky:"\uC2A4\uD2F0\uD0A4\uB178\uD2B8",rectangle:"\uC0AC\uAC01\uD615",ellipse:"\uC6D0",triangle:"\uC0BC\uAC01\uD615",line:"\uC120",rotate:"\uD68C\uC804","lock.aspect.ratio":"\uBE44\uC728 \uC7A0\uAE08","unlock.aspect.ratio":"\uBE44\uC728 \uC7A0\uAE08 \uD574\uC81C",group:"\uADF8\uB8F9\uD654",ungroup:"\uADF8\uB8F9\uD654 \uD574\uC81C","move.to.back":"\uB9E8 \uB4A4\uB85C \uBCF4\uB0B4\uAE30","move.backward":"\uB4A4\uB85C \uBCF4\uB0B4\uAE30","move.forward":"\uC55E\uC73C\uB85C \uAC00\uC838\uC624\uAE30","move.to.front":"\uB9E8 \uC55E\uC73C\uB85C \uAC00\uC838\uC624\uAE30","reset.angle":"\uD68C\uC804 \uCD08\uAE30\uD654",lock:"\uC7A0\uAE08",unlock:"\uC7A0\uAE08 \uD574\uC81C","align.distribute":"\uC815\uB82C / \uAC04\uACA9 \uB9DE\uCD94\uAE30","move.to.page":"\uD398\uC774\uC9C0\uB85C \uC774\uB3D9","flip.horizontal":"\uC88C\uC6B0 \uB300\uCE6D","flip.vertical":"\uC0C1\uD558 \uB300\uCE6D",move:"\uC21C\uC11C","to.front":"\uB9E8 \uC55E\uC73C\uB85C",forward:"\uC55E\uC73C\uB85C",backward:"\uB4A4\uB85C",back:"\uB9E8 \uB4A4\uB85C",language:"\uC5B8\uC5B4","translation.link":"\uB354 \uC54C\uC544\uBCF4\uAE30","dock.position":"\uB3C5 \uC704\uCE58",bottom:"\uD558\uB2E8",left:"\uC67C\uCABD",right:"\uC624\uB978\uCABD",top:"\uC0C1\uB2E8",page:"\uD398\uC774\uC9C0","keyboard.shortcuts":"\uD0A4\uBCF4\uB4DC \uB2E8\uCD95\uD0A4",search:"\uAC80\uC0C9",loading:"\uB85C\uB529{dots}","export.background":"\uBC30\uACBD \uB0B4\uBCF4\uB0B4\uAE30",transparent:"\uD22C\uBA85",auto:"\uC790\uB3D9",light:"\uB77C\uC774\uD2B8",dark:"\uB2E4\uD06C",github:"Github",twitter:"Twitter",discord:"Discord",image:"\uC774\uBBF8\uC9C0","align.left":"\uC67C\uCABD \uC815\uB82C","align.center.x":"\uC218\uD3C9 \uC911\uC559 \uC815\uB82C","align.right":"\uC624\uB978\uCABD \uC815\uB82C","align.top":"\uC0C1\uB2E8 \uC815\uB82C","align.center.y":"\uC218\uC9C1 \uC911\uC559 \uC815\uB82C","align.bottom":"\uD558\uB2E8 \uC815\uB82C","distribute.x":"\uAC00\uB85C \uAC04\uACA9 \uB9DE\uCD94\uAE30","distribute.y":"\uC138\uB85C \uAC04\uACA9 \uB9DE\uCD94\uAE30","stretch.x":"\uC218\uD3C9\uC73C\uB85C \uB298\uB9AC\uAE30","stretch.y":"\uC218\uC9C1\uC73C\uB85C \uB298\uB9AC\uAE30","dialog.save.firsttime":"\uD604\uC7AC \uD504\uB85C\uC81D\uD2B8\uB97C \uC800\uC7A5\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","dialog.save.again":"\uBCC0\uACBD\uC0AC\uD56D\uC744 \uD604\uC7AC \uD504\uB85C\uC81D\uD2B8\uC5D0 \uC800\uC7A5\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","dialog.cancel":"\uCDE8\uC18C","dialog.no":"\uC544\uB2C8\uC624","dialog.yes":"\uB124","enter.file.name":"\uD30C\uC77C \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694","telva-beta":"\uC0C8\uB85C\uC6B4 telva\uB97C \uC0AC\uC6A9\uD574\uBCF4\uC138\uC694"};var Nl={"style.menu.color":"\u0631\u06D5\u0646\u06AF","style.menu.fill":"\u067E\u0695\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5","style.menu.dash":"\u0644\u06D5\u062A \u0644\u06D5\u062A","style.menu.size":"\u0642\u06D5\u0628\u0627\u0631\u06D5","style.menu.keep.open":"\u0628\u06D5 \u06A9\u0631\u0627\u0648\u06D5\u06CC\u06CC \u0628\u0645\u06CE\u0646\u06D5\u0631\u06D5\u0648\u06D5","style.menu.font":"\u0647\u06CE\u06B5","style.menu.align":"\u0695\u06CE\u06A9\u062E\u0633\u062A\u0646",styles:"\u0646\u06D5\u062E\u0634\u06D5\u06A9\u0627\u0646","zoom.in":"\u0647\u06CE\u0646\u0627\u0646\u06D5 \u067E\u06CE\u0634\u06D5\u0648\u06D5","zoom.out":"\u062F\u0648\u0648\u0631 \u062E\u0633\u062A\u0646\u06D5\u0648\u06D5",to:"\u0628\u06C6","menu.tools":"\u0626\u0627\u0645\u0631\u0627\u0632\u06D5\u06A9\u0627\u0646","menu.transform":"\u06AF\u06C6\u0695\u06CC\u0646","menu.file":"\u0641\u0627\u06CC\u0644\u06CE\u06A9","menu.edit":"\u062F\u06D5\u0633\u062A\u06A9\u0627\u0631\u06CC","menu.view":"\u062F\u06CC\u0645\u06D5\u0646","menu.preferences":"\u062E\u0648\u0627\u0633\u062A","menu.sign.in":"\u0686\u0648\u0648\u0646\u06D5 \u0698\u0648\u0648\u0631\u06D5\u0648\u06D5","menu.sign.out":"\u062F\u06D5\u0631\u0686\u0648\u0648\u0646","become.a.sponsor":"\u0633\u067E\u06C6\u0646\u0633\u06D5\u0631 \u0628\u06D5","zoom.to.content":"\u0632\u0648\u0648\u0645 \u0628\u06A9\u06D5 \u0628\u06C6 \u0646\u0627\u0648\u06D5\u0695\u06C6\u06A9","zoom.to.selection":"\u0632\u0648\u0648\u0645 \u0628\u06A9\u06D5 \u0628\u06C6 \u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u0646","zoom.to.fit":"\u0632\u0648\u0648\u0645 \u0628\u06A9\u06D5 \u0628\u06C6 \u0626\u06D5\u0648\u06D5\u06CC \u0644\u06D5\u06AF\u06D5\u06B5\u06CC\u062F\u0627 \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A","zoom.to":"\u0632\u0648\u0648\u0645 \u0628\u06A9\u06D5 \u0628\u06C6","preferences.dark.mode":"\u062F\u06C6\u062E\u06CC \u062A\u0627\u0631\u06CC\u06A9","preferences.focus.mode":"\u062F\u06C6\u062E\u06CC \u0641\u06C6\u06A9\u06D5\u0633","preferences.debug.mode":"\u0645\u06C6\u062F\u06CC \u0647\u06D5\u06B5\u06D5\u062F\u06C6\u0632\u06CC\u0646","preferences.show.grid":"\u062A\u06C6\u0695\u06CC \u067E\u06CC\u0634\u0627\u0646 \u0628\u062F\u06D5","preferences.use.cad.selection":"\u0628\u06D5\u06A9\u0627\u0631\u0628\u0647\u06CE\u0646\u06D5 CAD \u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u0646\u06CC","preferences.keep.stylemenu.open":"\u0645\u06CE\u0646\u06C6\u06CC \u0633\u062A\u0627\u06CC\u0644 \u0628\u06D5 \u06A9\u0631\u0627\u0648\u06D5\u06CC\u06CC \u0628\u0647\u06CE\u06B5\u06D5\u0631\u06D5\u0648\u06D5","preferences.always.show.snaps":"\u0647\u06D5\u0645\u06CC\u0634\u06D5 \u0648\u06CE\u0646\u06D5\u06CC \u062E\u06CE\u0631\u0627 \u067E\u06CC\u0634\u0627\u0646 \u0628\u062F\u06D5","preferences.rotate.handles":"\u0633\u0648\u0631\u0627\u0646\u06D5\u0648\u06D5\u06CC \u062F\u06D5\u0633\u062A\u06D5\u06A9\u0627\u0646","preferences.binding.handles":"\u0628\u06D5\u0633\u062A\u0646\u06D5\u0648\u06D5\u06CC \u062F\u06D5\u0633\u062A\u06D5\u06A9\u0627\u0646","preferences.clone.handles":"\u06A9\u0644\u06C6\u0646 \u06A9\u0631\u062F\u0646\u06CC \u062F\u06D5\u0633\u062A\u06D5\u06A9\u0627\u0646",undo:"\u067E\u0627\u0634\u06D5\u06A9\u0634\u06D5 \u0628\u06A9\u06D5",redo:"\u062F\u0648\u0648\u0628\u0627\u0631\u06D5 \u0628\u06CC\u06A9\u06D5\u0631\u06D5\u0648\u06D5",cut:"\u0628\u0695\u06CC\u0646",copy:"\u06A9\u06C6\u067E\u06CC \u0628\u06A9\u06D5",paste:"\u067E\u06D5\u06CC\u0633\u062A \u0628\u06A9\u06D5","copy.as":"\u06A9\u06C6\u067E\u06CC \u0648\u06D5\u06A9","export.as":"\u0647\u06D5\u0646\u0627\u0631\u062F\u06D5\u06A9\u0631\u062F\u0646 \u0648\u06D5\u06A9","select.all":"\u0647\u06D5\u0645\u0648\u0648\u06CC\u0627\u0646 \u0647\u06D5\u06B5\u0628\u0698\u06CE\u0631\u0647","select.none":"\u0647\u06CC\u0686 \u0647\u0647\u200C\u06B5\u0645\u0647\u200C\u0628\u0698\u06CE\u0631\u0647\u200C",delete:"\u0633\u0695\u06CC\u0646\u06D5\u0648\u06D5","new.project":"\u067E\u0695\u06C6\u0698\u06D5\u06CC \u0646\u0648\u06CE",open:"\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5",save:"\u0647\u06D5\u06B5\u06AF\u0631\u062A\u0646","save.as":"\u0647\u06D5\u06B5\u06AF\u0631\u062A\u0646 \u0648\u06D5\u06A9","upload.media":"\u062F\u0627\u06AF\u0631\u062A\u0646\u06CC \u0645\u06CC\u062F\u06CC\u0627","create.page":"\u062F\u0631\u0648\u0633\u062A\u06A9\u0631\u062F\u0646\u06CC \u0644\u0627\u067E\u06D5\u0695\u06D5","new.page":"\u0644\u0627\u067E\u06D5\u0695\u06D5\u06CC \u0646\u0648\u06CE","page.name":"\u0646\u0627\u0648\u06CC \u0644\u0627\u067E\u06D5\u0695\u06D5",duplicate:"\u062F\u0648\u0648\u0628\u0627\u0631\u06D5\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5",cancel:"\u0695\u06D5\u062A\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5","copy.invite.link":"\u0644\u06CC\u0646\u06A9\u06CC \u0628\u0627\u0646\u06AF\u0647\u06CE\u0634\u062A\u06A9\u0631\u062F\u0646 \u06A9\u06C6\u067E\u06CC \u0628\u06A9\u06D5","copy.readonly.link":"\u0628\u06D5 \u0634\u06CE\u0648\u06D5\u06CC\u06D5\u06A9\u06CC \u0647\u06D5\u0695\u06D5\u0645\u06D5\u06A9\u06CC \u06A9\u06C6\u067E\u06CC \u0628\u06A9\u06D5","create.multiplayer.project":"\u062F\u0631\u0648\u0633\u062A\u06A9\u0631\u062F\u0646\u06CC \u067E\u0631\u06C6\u0698\u06D5\u06CC \u0641\u0631\u06D5 \u0628\u06D5\u06A9\u0627\u0631\u0647\u06CE\u0646\u06D5\u0631","copy.multiplayer.project":"\u06A9\u06C6\u067E\u06CC \u0628\u06A9\u06D5 \u0628\u06C6 \u067E\u0695\u06C6\u0698\u06D5\u06CC\u06D5\u06A9\u06CC \u0641\u0631\u06D5 \u0628\u06D5\u06A9\u0627\u0631\u0647\u06CE\u0646\u06D5\u0631",select:"\u062F\u06D5\u0633\u0646\u06CC\u0627\u0634\u0646\u06A9\u0631\u062F\u0646",eraser:"\u0633\u0695\u06D5\u0631\u06D5\u0648\u06D5",draw:"\u0648\u06CE\u0646\u06D5\u06A9\u06CE\u0634\u0627\u0646",arrow:"\u062A\u06CC\u0631",text:"\u062F\u06D5\u0642",sticky:"\u0686\u06D5\u0633\u067E\u0627\u0648",rectangle:"\u0644\u0627\u06A9\u06CE\u0634\u06D5",ellipse:"\u0628\u06CC\u0628\u0644\u06CC",triangle:"\u0633\u06CE\u06AF\u06C6\u0634\u06D5",line:"\u0647\u06CE\u06B5",rotate:"\u0633\u0648\u0695\u0627\u0646\u06D5\u0648\u06D5","lock.aspect.ratio":"\u0642\u0641\u06B5\u06A9\u0631\u062F\u0646\u06CC \u0695\u06CE\u0698\u06D5\u06CC \u0695\u0648\u0648\u0628\u06D5\u0631\u06CC","unlock.aspect.ratio":"\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5\u06CC \u0695\u06CE\u0698\u06D5\u06CC \u0695\u0648\u0648\u0628\u06D5\u0631\u06CC",group:"\u06A9\u06C6\u0645\u06D5\u06B5\u06D5",ungroup:"\u0644\u0627\u0628\u0631\u062F\u0646\u06CC \u06A9\u06C6\u0645\u06D5\u06B5\u06D5","move.to.back":"\u0628\u0686\u06C6 \u0628\u06C6 \u067E\u0634\u062A\u06D5\u0648\u06D5","move.backward":"\u0628\u06D5\u0631\u06D5\u0648 \u062F\u0648\u0627\u0648\u06D5","move.forward":"\u0628\u0695\u06C6 \u067E\u06CE\u0634\u06D5\u0648\u06D5","move.to.front":"\u0628\u06AF\u0648\u0627\u0632\u0631\u06CE\u062A\u06D5\u0648\u06D5 \u0628\u06C6 \u067E\u06CE\u0634\u06D5\u0648\u06D5","reset.angle":"\u06AF\u06C6\u0634\u06D5\u06CC \u067E\u0634\u0648\u0648\u062F\u0627\u0646",lock:"\u0642\u0648\u0641\u06B5",unlock:"\u0644\u0627\u0628\u0631\u062F\u0646\u06CC \u0642\u0648\u0641\u06B5","move.to.page":"\u0628\u0686\u06C6 \u0628\u06C6 \u0644\u0627\u067E\u06D5\u0695\u06D5","flip.horizontal":"\u0626\u0627\u0633\u06C6\u06CC\u06CC \u0648\u06D5\u0631\u06AF\u06D5\u0695\u0627\u0646\u062F\u0646","flip.vertical":"\u0633\u062A\u0648\u0646\u06CC \u0648\u06D5\u0631\u06AF\u06D5\u0695\u0627\u0646\u062F\u0646",move:"\u062C\u0648\u0648\u06B5\u06D5","to.front":"\u0628\u06C6 \u067E\u06CE\u0634\u06D5\u0648\u06D5",forward:"\u0628\u06C6\u067E\u0634\u062A\u06D5\u0648\u06D5",backward:"\u0628\u06C6\u062F\u0648\u0627\u0648\u06D5",back:"\u06AF\u06D5\u0695\u0627\u0646\u06D5\u0648\u06D5",language:"\u0632\u0645\u0627\u0646","translation.link":"\u0628\u06D5\u0633\u062A\u06D5\u0631\u06CC \u0648\u06D5\u0631\u06AF\u06CE\u0695\u0627\u0646","dock.position":"\u0634\u0648\u06CE\u0646\u06CC \u062F\u06C6\u06A9",bottom:"\u062E\u0648\u0627\u0631\u06D5\u0648\u06D5",left:"\u0686\u06D5\u067E",right:"\u0695\u0627\u0633\u062A",top:"\u0633\u06D5\u0631\u0648\u0648",page:"\u0644\u0627\u067E\u06D5\u0695\u06D5","keyboard.shortcuts":"\u06A9\u0648\u0631\u062A\u06A9\u0631\u0627\u0648\u06D5\u06A9\u0627\u0646\u06CC \u062A\u06D5\u062E\u062A\u06D5\u06A9\u0644\u06CC\u0644",search:"\u06AF\u06D5\u0695\u0627\u0646",loading:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646","export.background":"\u067E\u0627\u0634\u062E\u0627\u0646\u06CC \u0647\u06D5\u0646\u0627\u0631\u062F\u06D5\u06A9\u0631\u062F\u0646",transparent:"\u0695\u0648\u0648\u0646",auto:"\u0626\u06C6\u062A\u06C6\u0645\u0627\u062A\u06CC\u06A9\u06CC",light:"\u0631\u0648\u0648\u0646\u0627\u06A9",dark:"\u062A\u0627\u0631\u06CC\u06A9"};var Ul={"style.menu.color":"Color","style.menu.fill":"Fill","style.menu.dash":"Dash","style.menu.size":"Size","style.menu.keep.open":"Keep Open","style.menu.font":"Font","style.menu.align":"Align",styles:"Styles","zoom.in":"Zoom In","zoom.out":"Zoom Out",to:"To","menu.tools":"Tools","menu.transform":"Transform","menu.file":"File","menu.edit":"Edit","menu.view":"View","menu.preferences":"Preferences","menu.sign.in":"Sign In","menu.sign.out":"Sign Out","become.a.sponsor":"Become a Sponsor","zoom.to.content":"Back to content","zoom.to.selection":"Zoom to Selection","zoom.to.fit":"Zoom to Fit","zoom.to":"Zoom to","preferences.dark.mode":"Dark Mode","preferences.focus.mode":"Focus Mode","preferences.debug.mode":"Debug Mode","preferences.show.grid":"Show Grid","preferences.use.cad.selection":"Use CAD Selection","preferences.keep.stylemenu.open":"Keep Style Menu Open","preferences.always.show.snaps":"Always Show Snaps","preferences.rotate.handles":"Rotate Handles","preferences.binding.handles":"Binding Handles","preferences.clone.handles":"Clone Handles",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste","copy.as":"Copy As","export.as":"Export As","select.all":"Select All","select.none":"Select None",delete:"Delete","new.project":"New Project",open:"Open",save:"Save","save.as":"Save As","upload.media":"Upload Media","create.page":"Create Page","new.page":"New Page","page.name":"Page Name",duplicate:"Duplicate","shape.options":"Shape Options",shapes:"Shapes",cancel:"Cancel","copy.invite.link":"Copy Invite Link","copy.readonly.link":"Copy ReadOnly Link","create.multiplayer.project":"Create a Multiplayer Project","copy.multiplayer.project":"Copy to Multiplayer Project",select:"Select",eraser:"Eraser",draw:"Draw",arrow:"Arrow",text:"Text",sticky:"Sticky",rectangle:"Rectangle",ellipse:"Ellipse",triangle:"Triangle",line:"Line",rotate:"Rotate","lock.aspect.ratio":"Lock Aspect Ratio","unlock.aspect.ratio":"Unlock Aspect Ratio",group:"Group",ungroup:"Ungroup","move.to.back":"Move to Back","move.backward":"Move Backward","move.forward":"Move Forward","move.to.front":"Move to Front","reset.angle":"Reset Angle",lock:"Lock",unlock:"Unlock","align.distribute":"Align / Distribute","move.to.page":"Move to Page","flip.horizontal":"Flip Horizontal","flip.vertical":"Flip Vertical",move:"Move","to.front":"To Front",forward:"Forward",backward:"Backward",back:"To Back",language:"Language","translation.link":"Learn More","dock.position":"Dock Position",bottom:"Bottom",left:"Left",right:"Right",top:"Top",page:"Page","keyboard.shortcuts":"Keyboard shortcuts",search:"Search",loading:"Loading{dots}","export.background":"Export Background",transparent:"Transparent",auto:"Auto",light:"Light",dark:"Dark",github:"Github",twitter:"Twitter",discord:"Discord",image:"Image","align.left":"Align Left","align.center.x":"Align Horizontal Center","align.right":"Align Right","align.top":"Align Top","align.center.y":"Align Vertical Center","align.bottom":"Align Bottom","distribute.x":"Distribute Horizontal","distribute.y":"Distribute Vertical","stretch.x":"Stretch Horizontal","stretch.y":"Stretch Vertical","dialog.save.firsttime":"Do you want to save your current project?","dialog.save.again":"Do you want to save changes to your current project?","dialog.cancel":"Cancel","dialog.no":"No","dialog.yes":"Yes","enter.file.name":"Enter file name","telva-beta":"Try the new telva",white:"White",lightGray:"Light gray",gray:"Gray",black:"Black",green:"Green",cyan:"Cyan",blue:"Blue",indigo:"Indigo",violet:"Violet",red:"Red",orange:"Orange",yellow:"Yellow",solid:"Solid",dashed:"Dashed",dotted:"Dotted",small:"Small",medium:"Medium",large:"Large"};var Kl={"style.menu.color":"\u1021\u101B\u1031\u102C\u1004\u103A","style.menu.fill":"\u1021\u101B\u1031\u102C\u1004\u103A \u1011\u100A\u103A\u1037\u1019\u100A\u103A","style.menu.dash":"\u1019\u103B\u1025\u103A\u1038\u1005\u1000\u103A","style.menu.size":"\u1021\u101B\u103D\u101A\u103A\u1021\u1005\u102C\u1038","style.menu.keep.open":"\u1016\u103D\u1004\u103A\u1037\u1011\u102C\u1038\u1019\u100A\u103A","style.menu.font":"\u1005\u102C\u101E\u102C\u1038\u1016\u1031\u102C\u1004\u103A\u1037","style.menu.align":"\u1021\u1011\u102C\u1038\u1021\u101E\u102D\u102F",styles:"\u1005\u1010\u102D\u102F\u1004\u103A","zoom.in":"\u1021\u1000\u103C\u102E\u1038\u1001\u103B\u1032\u1037\u1019\u100A\u103A","zoom.out":"\u1015\u103C\u1014\u103A\u1000\u103B\u1025\u103A\u1038\u1019\u100A\u103A",to:"\u101E\u102D\u102F\u1037","menu.tools":"\u1000\u102D\u101B\u102D\u101A\u102C\u1019\u103B\u102C\u1038","menu.transform":"\u1015\u103C\u1031\u102C\u1004\u103A\u1038\u101C\u100A\u103A\u101B\u1014\u103A","menu.file":"\u1016\u102D\u102F\u1004\u103A","menu.edit":"\u1015\u103C\u102F\u1015\u103C\u1004\u103A","menu.view":"\u1021\u1019\u103C\u1004\u103A","menu.preferences":"\u1006\u1000\u103A\u1010\u1004\u103A","menu.sign.in":"\u101D\u1004\u103A\u1019\u100A\u103A","menu.sign.out":"\u1011\u103D\u1000\u103A\u1019\u100A\u103A","become.a.sponsor":"\u1004\u103D\u1031\u1000\u103C\u1031\u1038\u1011\u1031\u102C\u1000\u103A\u1015\u1036\u1019\u100A\u103A","zoom.to.content":"\u1015\u1004\u103A\u1019\u1014\u1031\u101B\u102C\u101E\u102D\u102F\u1037 \u1015\u103C\u1014\u103A\u101E\u103D\u102C\u1038\u1019\u100A\u103A","zoom.to.selection":"\u101B\u103D\u1031\u1038\u1011\u102C\u1038\u101E\u1031\u102C \u1014\u1031\u101B\u102C\u101E\u102D\u102F\u1037 \u1021\u102C\u101B\u102F\u1036\u1015\u103C\u102F\u1019\u100A\u103A","zoom.to.fit":"\u1021\u1036\u1000\u102D\u102F\u1000\u103A\u1016\u103C\u1005\u103A\u1021\u1031\u102C\u1004\u103A \u1001\u103B\u1032\u1037\u1019\u100A\u103A","zoom.to":"\u1015\u102F\u1036\u1019\u103E\u1014\u103A\u1006\u102D\u102F\u1012\u103A\u101E\u102D\u102F\u1037 \u1001\u103B\u1032\u1037\u1019\u100A\u103A","preferences.dark.mode":"\u1021\u1019\u103E\u1031\u102C\u1004\u103A \u1019\u102F\u1012\u103A","preferences.focus.mode":"\u101B\u103E\u1004\u103A\u1038\u101B\u103E\u1004\u103A\u1038\u101C\u1004\u103A\u1038\u101C\u1004\u103A\u1038 \u1019\u102F\u1012\u103A","preferences.debug.mode":"\u1005\u1019\u103A\u1038\u101E\u1015\u103A \u1019\u102F\u1012\u103A","preferences.show.grid":"\u1014\u1031\u102C\u1000\u103A\u1001\u1036 \u1007\u101A\u102C\u1038\u1000\u103D\u1000\u103A\u1015\u103C\u101B\u1014\u103A","preferences.use.cad.selection":"CAD \u1000\u1032\u1037\u101E\u102D\u102F\u1037 \u101B\u103D\u1031\u1038\u1001\u103B\u101A\u103A\u1019\u103E\u102F \u1015\u103C\u102F\u101C\u102F\u1015\u103A\u1019\u100A\u103A","preferences.keep.stylemenu.open":"\u1005\u1010\u102D\u102F\u1004\u103A\u101C\u103A \u1019\u102E\u1014\u1030\u1038\u1000\u102D\u102F \u1021\u1019\u103C\u1032\u1016\u103D\u1004\u103A\u1037\u1011\u102C\u1038\u1019\u100A\u103A","preferences.always.show.snaps":"Always Show Snaps","preferences.rotate.handles":"Rotate Handles","preferences.binding.handles":"Binding Handles","preferences.clone.handles":"Clone Handles",undo:"\u1014\u1002\u102D\u102F\u1019\u1030\u101C\u101E\u102D\u102F\u1037 \u1015\u103C\u1014\u103A\u101C\u102F\u1015\u103A\u101B\u1014\u103A",redo:"\u1015\u103C\u1014\u103A\u101C\u102F\u1015\u103A\u101B\u1014\u103A",cut:"\u1016\u103C\u1010\u103A\u101A\u1030",copy:"\u1000\u1030\u1038\u101A\u1030",paste:"\u1000\u1030\u1038\u101E\u103D\u1004\u103A\u1038","copy.as":"\u1000\u1030\u1038\u101A\u1030\u1019\u100A\u103A\u1037 \u1015\u102F\u1036\u1005\u1036","export.as":"\u1011\u102F\u1010\u103A\u1001\u103B\u1004\u103A\u101E\u100A\u103A\u1037 \u1015\u102F\u1036\u1005\u1036","select.all":"\u1021\u102C\u1038\u101C\u102F\u1036\u1038\u1000\u102D\u102F \u101B\u103D\u1031\u1038\u1001\u103B\u101A\u103A\u101B\u1014\u103A","select.none":"\u1010\u1005\u103A\u1001\u102F\u1019\u103E \u1019\u101B\u103D\u1031\u1038\u1010\u1031\u102C\u1037\u1015\u102B",delete:"\u1016\u103B\u1000\u103A\u1019\u100A\u103A","new.project":"\u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A \u1021\u101E\u1005\u103A",open:"\u1016\u103D\u1004\u103A\u1037\u1019\u100A\u103A",save:"\u101E\u102D\u1019\u103A\u1038\u1019\u100A\u103A","save.as":"\u1021\u1001\u103C\u102C\u1038\u101E\u1031\u102C \u1015\u102F\u1036\u1005\u1036\u1016\u103C\u1004\u103A\u1037 \u101E\u102D\u1019\u103A\u1038\u1019\u100A\u103A","upload.media":"\u1019\u102E\u1012\u102E\u101A\u102C\u1016\u102D\u102F\u1004\u103A\u1019\u103B\u102C\u1038 \u1010\u1004\u103A\u1019\u100A\u103A","create.page":"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C \u1021\u101E\u1005\u103A\u1016\u103D\u1004\u103A\u1037\u1019\u100A\u103A","new.page":"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C \u1021\u101E\u1005\u103A","page.name":"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C \u1021\u1019\u100A\u103A",duplicate:"\u1015\u103D\u102C\u1038\u1019\u100A\u103A",cancel:"\u1019\u101C\u102F\u1015\u103A\u1010\u1031\u102C\u1037\u1015\u102B","copy.invite.link":"\u1016\u102D\u1010\u103A\u1000\u103C\u102C\u1038\u101B\u1014\u103A \u101C\u1004\u103A\u1037\u1001\u103A\u1000\u1030\u1038\u101A\u1030\u1019\u100A\u103A","copy.readonly.link":"\u1000\u103C\u100A\u103A\u1037\u101B\u1030\u101B\u1014\u103A\u1021\u1010\u103D\u1000\u103A\u101E\u102C \u101C\u1004\u103A\u1037\u1001\u103A\u1000\u1030\u1038\u101A\u1030\u1019\u100A\u103A","create.multiplayer.project":"\u1021\u1019\u103B\u102C\u1038\u101E\u102F\u1036\u1038 \u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A\u1021\u1016\u103C\u1005\u103A \u1021\u101E\u1005\u103A\u1016\u1014\u103A\u1010\u102E\u1038\u1019\u100A\u103A","copy.multiplayer.project":"\u1021\u1019\u103B\u102C\u1038\u101E\u102F\u1036\u1038 \u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A\u1021\u1016\u103C\u1005\u103A\u101E\u102D\u102F\u1037 \u1000\u1030\u1038\u101A\u1030\u1019\u100A\u103A",select:"\u101B\u103D\u1031\u1038\u1001\u103B\u101A\u103A\u1019\u103E\u102F",eraser:"\u1001\u1032\u1016\u103B\u1000\u103A",draw:"\u1001\u1032\u1010\u1036",arrow:"\u1019\u103C\u103E\u102C\u1038",text:"\u1005\u102C\u101E\u102C\u1038",sticky:"\u1000\u1015\u103A\u1001\u103D\u102C\u1019\u103E\u1010\u103A\u1005\u102F",rectangle:"\u101C\u1031\u1011\u1031\u102C\u1004\u103A\u1037",ellipse:"\u1018\u1032\u1025",triangle:"\u1010\u103C\u102D\u1002\u1036",line:"\u1019\u103B\u1025\u103A\u1038",rotate:"\u101C\u103E\u100A\u103A\u1037\u1019\u100A\u103A","lock.aspect.ratio":"\u1021\u1001\u103B\u102D\u102F\u1038\u1021\u1005\u102C\u1038 \u1011\u102D\u1014\u103A\u1038\u1011\u102C\u1038\u1019\u100A\u103A","unlock.aspect.ratio":"\u1021\u1001\u103B\u102D\u102F\u1038\u1021\u1005\u102C\u1038 \u1019\u1011\u102D\u1014\u103A\u1038\u1010\u1031\u102C\u1037\u1015\u102B",group:"\u1021\u102F\u1015\u103A\u1005\u102F\u1016\u103D\u1032\u1037",ungroup:"\u1021\u102F\u1015\u103A\u1005\u102F\u1001\u103D\u1032","move.to.back":"\u1014\u1031\u102C\u1000\u103A\u1006\u102F\u1036\u1038\u101E\u102D\u102F\u1037 \u1015\u102D\u102F\u1037\u1019\u100A\u103A","move.backward":"\u1014\u1031\u102C\u1000\u103A\u101E\u102D\u102F\u1037 \u1010\u1005\u103A\u1006\u1004\u103A\u1037\u1015\u102D\u102F\u1037\u1019\u100A\u103A","move.forward":"\u101B\u103E\u1031\u1037\u101E\u102D\u102F\u1037 \u1010\u1005\u103A\u1006\u1004\u103A\u1037\u1015\u102D\u102F\u1037\u1019\u100A\u103A","move.to.front":"\u101B\u103E\u1031\u1037\u1006\u102F\u1036\u1038\u101E\u102D\u102F\u1037 \u1015\u102D\u102F\u1037\u1019\u100A\u103A","reset.angle":"\u1014\u1002\u102D\u102F\u1019\u1030\u101C \u1011\u1031\u102C\u1004\u103A\u1037\u1001\u103B\u102D\u102F\u1038\u1005\u102C\u1038\u101E\u102D\u102F\u1037\u1015\u103C\u1031\u102C\u1004\u103A\u1038\u1019\u100A\u103A",lock:"\u1001\u1010\u103A\u1011\u102C\u1038\u1019\u100A\u103A",unlock:"\u1016\u103D\u1004\u103A\u1037\u1011\u102C\u1038\u1019\u100A\u103A","align.distribute":"\u1014\u1031\u101B\u102C \u1021\u1011\u102C\u1038\u1021\u101E\u102D\u102F/ \u1021\u1006\u1014\u103A\u1037\u1021\u1000\u103B\u102F\u1036\u1037","move.to.page":"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C\u1010\u1005\u103A\u1001\u102F\u101E\u102D\u102F\u1037 \u101B\u103D\u1031\u1038\u1019\u100A\u103A","flip.horizontal":"\u1021\u101C\u103B\u102C\u1038\u101C\u102D\u102F\u1000\u103A \u101C\u103E\u1014\u103A\u1019\u100A\u103A","flip.vertical":"\u1012\u1031\u102B\u1004\u103A\u101C\u102D\u102F\u1000\u103A \u101C\u103E\u1014\u103A\u1019\u100A\u103A",move:"\u101B\u103D\u1031\u1037\u1019\u100A\u103A","to.front":"\u101B\u103E\u1031\u1037\u1006\u102F\u1036\u1038\u101E\u102D\u102F\u1037",forward:"\u101B\u103E\u1031\u1037\u1010\u1005\u103A\u1006\u1004\u103A\u1037",backward:"\u1014\u1031\u102C\u1000\u103A\u1010\u1005\u103A\u1006\u1004\u103A\u1037",back:"\u1014\u1031\u102C\u1000\u103A\u1006\u102F\u1036\u1038\u101E\u102D\u102F\u1037",language:"\u1018\u102C\u101E\u102C\u1005\u1000\u102C\u1038","translation.link":"\u1015\u102D\u102F\u1019\u102D\u102F\u104D \u101C\u1031\u1037\u101C\u102C\u101B\u1014\u103A","dock.position":"\u1000\u102D\u101B\u102D\u101A\u102C \u1021\u1014\u1031\u1021\u1011\u102C\u1038",bottom:"\u1021\u1031\u102C\u1000\u103A",left:"\u1018\u101A\u103A",right:"\u100A\u102C",top:"\u1011\u102D\u1015\u103A",page:"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C","keyboard.shortcuts":"Keyboard shortcuts",search:"\u101B\u103E\u102C\u1016\u103D\u1031\u101B\u1014\u103A",loading:"\u1001\u100F\u1005\u1031\u102C\u1004\u103A\u1037\u1015\u1031\u1038\u101B\u1014\u103A{dots}","export.background":"\u1014\u1031\u102C\u1000\u103A\u1001\u1036 \u1011\u102F\u1010\u103A\u101A\u1030\u1019\u100A\u103A",transparent:"\u1014\u1031\u102C\u1000\u103A\u1001\u1036 \u1021\u1000\u103C\u100A\u103A",auto:"Auto",light:"\u1021\u101C\u1004\u103A\u1038",dark:"\u1021\u1019\u103E\u1031\u102C\u1004\u103A",github:"Github",twitter:"Twitter",discord:"Discord",image:"\u1013\u102C\u1010\u103A\u1015\u102F\u1036","align.left":"\u1018\u101A\u103A\u1016\u1000\u103A\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.center.x":"\u1021\u101C\u103B\u102C\u1038\u101C\u102D\u102F\u1000\u103A \u1017\u101F\u102D\u102F\u1006\u102E\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.right":"\u100A\u102C\u1016\u1000\u103A\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.top":"\u1021\u1015\u1031\u102B\u103A\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.center.y":"\u1012\u1031\u102B\u1004\u103A\u101C\u102D\u102F\u1000\u103A \u1017\u101F\u102D\u102F\u1006\u102E\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.bottom":"\u1021\u1031\u102C\u1000\u103A\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","distribute.x":"\u1021\u101C\u103B\u102C\u1038\u101C\u102D\u102F\u1000\u103A \u1016\u103C\u1014\u103A\u1037\u101B\u1014\u103A","distribute.y":"\u1012\u1031\u102B\u1004\u103A\u101C\u102D\u102F\u1000\u103A \u1016\u103C\u1014\u103A\u1037\u101B\u1014\u103A","stretch.x":"\u1021\u101C\u103B\u102C\u1038\u101C\u102D\u102F\u1000\u103A \u1006\u103D\u1032\u1006\u1014\u103A\u1037\u101B\u1014\u103A","stretch.y":"\u1012\u1031\u102B\u1004\u103A\u101C\u102D\u102F\u1000\u103A \u1006\u103D\u1032\u1006\u1014\u103A\u1037\u101B\u1014\u103A","dialog.save.firsttime":"\u101A\u1001\u102F \u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A\u1000\u102D\u102F \u101E\u102D\u1019\u103A\u1038\u1006\u100A\u103A\u101C\u102D\u102F\u1015\u102B\u101E\u101C\u102C\u1038 ?","dialog.save.again":"\u101A\u1001\u102F \u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A\u1010\u103D\u1004\u103A \u1015\u103C\u1004\u103A\u1011\u102C\u1038\u101E\u1031\u102C \u1021\u1015\u103C\u1031\u102C\u1004\u103A\u1038\u1021\u101C\u100A\u103A\u1019\u103B\u102C\u1038\u1000\u102D\u102F \u1021\u1010\u100A\u103A\u1015\u103C\u102F \u101E\u102D\u1019\u103A\u1038\u1006\u100A\u103A\u101C\u102D\u102F\u1015\u102B\u101E\u101C\u102C\u1038?","dialog.cancel":"\u1018\u102C\u1019\u103E \u1019\u101C\u102F\u1015\u103A\u1010\u1031\u102C\u1037\u1015\u102B","dialog.no":"\u1019\u101C\u102D\u102F\u1010\u1031\u102C\u1037\u1015\u102B","dialog.yes":"\u101C\u102D\u102F\u1015\u102B\u101E\u100A\u103A","enter.file.name":"\u1016\u102D\u102F\u1004\u103A\u1014\u102C\u1019\u100A\u103A \u1011\u100A\u103A\u1037\u101E\u103D\u1004\u103A\u1038\u101B\u1014\u103A","telva-beta":"telva \u1021\u101E\u1005\u103A\u1005\u1019\u103A\u1038\u101E\u102F\u1036\u1038\u1000\u103C\u100A\u103A\u1037\u101B\u1014\u103A"};var _l={"style.menu.color":"Farge","style.menu.fill":"Fyll","style.menu.dash":"Linje","style.menu.size":"St\xF8rrelse","style.menu.keep.open":"Hold \xE5pen","style.menu.font":"Teksttype","style.menu.align":"Juster",styles:"Stiler","zoom.in":"Zoom inn","zoom.out":"Zoom ut",to:"til","menu.file":"Fil","menu.edit":"Rediger","menu.view":"Vis","menu.preferences":"Preferanser","menu.sign.in":"Logg inn","menu.sign.out":"Logg ut","become.a.sponsor":"Bli en sponsor","zoom.to.selection":"Zoom til valg","zoom.to.fit":"Zoom for \xE5 passe","zoom.to":"Zoom til","preferences.dark.mode":"M\xF8rk modus","preferences.focus.mode":"Fokus modus","preferences.debug.mode":"Debug modus","preferences.show.grid":"Vis rutenett","preferences.use.cad.selection":"Bruk CAD seleksjon","preferences.keep.stylemenu.open":"Hold stilmeny \xE5pen","preferences.always.show.snaps":"Vis alltid snaps","preferences.rotate.handles":"Vis roteringsh\xE5ndtak","preferences.binding.handles":"Vis bindingsh\xE5ndtak","preferences.clone.handles":"Vis kloningsh\xE5ndtak",undo:"Angre",redo:"Gj\xF8r om",cut:"Klipp ut",copy:"Kopier",paste:"Lim inn","copy.as":"Kopier som","export.as":"Eksporter som","select.all":"Velg alle","select.none":"Velg ingen",delete:"Slett","new.project":"Nytt prosjekt",open:"\xC5pne",save:"Lagre","save.as":"Lagre som","upload.media":"Last opp media","create.page":"Opprett side","new.page":"Ny side","page.name":"Sidenavn",duplicate:"Dupliser",cancel:"Avbryt","copy.invite.link":"Kopier invitasjonslink","create.multiplayer.project":"Opprett et flerspiller prosjekt","copy.multiplayer.project":"Kopier til flerspiller prosjekt",select:"Velg",eraser:"Viskel\xE6r",draw:"Tegn",arrow:"Pil",text:"Tekst",sticky:"Lapp",rectangle:"Rektangel",ellipse:"Ellipse",triangle:"Trekant",line:"Linje",rotate:"Roter","lock.aspect.ratio":"L\xE5s st\xF8rrelsesforhold","unlock.aspect.ratio":"L\xE5s opp st\xF8rrelsesforhold",group:"Grupper",ungroup:"Avgrupper","move.to.back":"Flytt bakerst","move.backward":"Flytt bakover","move.forward":"Flytt forover","move.to.front":"Flytt til front","reset.angle":"Tilbakestill vinkel",lock:"L\xE5s",unlock:"L\xE5s opp","move.to.page":"Flytt til side","flip.horizontal":"Snu horisontalt","flip.vertical":"Snu vertikalt",move:"Flytt","to.front":"Foran",forward:"Framover",backward:"Bakover",back:"Bakerst",language:"Spr\xE5k"};var Yl={"style.menu.color":"\u0930\u0902\u0917","style.menu.fill":"\u092D\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","style.menu.dash":"\u0927\u0930\u094D\u0915\u093E","style.menu.size":"\u0906\u0915\u093E\u0930","style.menu.keep.open":"\u0916\u0941\u0932\u093E \u0930\u093E\u0916\u094D\u0928\u0941\u0939\u094B\u0938\u094D","style.menu.font":"\u092B\u0928\u094D\u091F","style.menu.align":"\u092A\u0919\u094D\u0915\u094D\u0924\u093F\u092C\u0926\u094D\u0927",styles:"\u0936\u0948\u0932\u0940\u0939\u0930\u0942","zoom.in":"\u091C\u0941\u092E \u0907\u0928","zoom.out":"\u091C\u0941\u092E \u0906\u0909\u091F",to:"\u091F\u0941","menu.file":"\u092B\u093E\u0907\u0932","menu.edit":"\u0938\u092E\u094D\u092A\u093E\u0926\u0928 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","menu.view":"\u092D\u094D\u092F\u0942","menu.preferences":"\u092A\u094D\u0930\u093E\u0925\u092E\u093F\u0915\u0924\u093E\u0939\u0930\u0942","menu.sign.in":"\u0938\u093E\u0907\u0928 \u0907\u0928 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","menu.sign.out":"\u0938\u093E\u0907\u0928 \u0906\u0909\u091F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","become.a.sponsor":"\u092A\u094D\u0930\u093E\u092F\u094B\u091C\u0915 \u092C\u0928\u094D\u0928\u0941\u0939\u094B\u0938\u094D","zoom.to.selection":"\u091C\u0941\u092E \u091F\u0941 \u0938\u0947\u0932\u0947\u0915\u094D\u0938\u0928","zoom.to.fit":"\u091C\u0941\u092E \u091F\u0941 \u092B\u093F\u091F","zoom.to":"\u091C\u0941\u092E \u091F\u0941","preferences.dark.mode":"\u0905\u0901\u0927\u094D\u092F\u093E\u0930\u094B \u092E\u094B\u0921","preferences.focus.mode":"\u092B\u094B\u0915\u0938 \u092E\u094B\u0921","preferences.debug.mode":"\u0921\u093F\u092C\u0917 \u092E\u094B\u0921","preferences.show.grid":"\u0917\u094D\u0930\u093F\u0921 \u0926\u0947\u0916\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","preferences.use.cad.selection":"CAD \u0938\u0947\u0932\u0947\u0915\u094D\u0938\u0928 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","preferences.keep.stylemenu.open":"\u0938\u094D\u091F\u093E\u0907\u0932 \u092E\u0947\u0928\u0941 \u0916\u0941\u0932\u093E \u0930\u093E\u0916\u094D\u0928\u0941\u0939\u094B\u0938\u094D","preferences.always.show.snaps":"\u0938\u0927\u0948\u0901 \u0938\u094D\u0928\u094D\u092F\u093E\u092A\u0939\u0930\u0942 \u0926\u0947\u0916\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","preferences.rotate.handles":"\u0939\u094D\u092F\u093E\u0928\u094D\u0921\u0932\u0939\u0930\u0942 \u0918\u0941\u092E\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","preferences.binding.handles":"\u092C\u093E\u0907\u0928\u094D\u0921\u093F\u0919 \u0939\u094D\u092F\u093E\u0928\u094D\u0921\u0932\u0939\u0930\u0942","preferences.clone.handles":"\u0915\u094D\u0932\u094B\u0928 \u0939\u094D\u092F\u093E\u0928\u094D\u0921\u0932\u0939\u0930\u0942",undo:"\u092A\u0942\u0930\u094D\u0935\u0935\u0924 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",redo:"\u092A\u0941\u0928\u0903 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",cut:"\u0915\u091F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",copy:"\u0915\u092A\u093F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",paste:"\u092A\u0947\u0938\u094D\u091F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","copy.as":"\u0915\u092A\u093F \u090F\u091C","export.as":"\u090F\u0915\u094D\u0938\u092A\u094B\u0930\u094D\u091F \u090F\u091C","select.all":"\u0938\u092C\u0948 \u091B\u093E\u0928\u094D\u0928\u0941\u0939\u094B\u0938\u094D","select.none":"\u0915\u0947\u0939\u093F \u092A\u0928\u093F \u0938\u0947\u0932\u0947\u0915\u094D\u091F \u0928\u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",delete:"\u092E\u0947\u091F\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","new.project":"\u0928\u092F\u093E\u0901 \u092A\u0930\u093F\u092F\u094B\u091C\u0928\u093E",open:"\u0916\u094B\u0932\u094D\u0928\u0941\u0939\u094B\u0938\u094D",save:"\u0938\u0941\u0930\u0915\u094D\u0937\u093F\u0924 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","save.as":"\u0938\u0947\u092D \u090F\u091C","upload.media":"\u092E\u093F\u0921\u093F\u092F\u093E \u0905\u092A\u0932\u094B\u0921 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","create.page":"\u092A\u0943\u0937\u094D\u0920 \u0938\u093F\u0930\u094D\u091C\u0928\u093E \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","new.page":"\u0928\u092F\u093E\u0901 \u092A\u0943\u0937\u094D\u0920 \u0938\u093F\u0930\u094D\u091C\u0928\u093E \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","page.name":"\u092A\u0943\u0937\u094D\u0920\u0915\u094B \u0928\u093E\u092E",duplicate:"\u0905\u0928\u0941\u0932\u093F\u092A\u093F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",cancel:"\u0930\u0926\u094D\u0926 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","copy.invite.link":"\u0928\u093F\u092E\u0928\u094D\u0924\u094D\u0930\u0923\u093E \u0932\u093F\u0919\u094D\u0915 \u0915\u092A\u093F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","create.multiplayer.project":"\u092E\u0932\u094D\u091F\u093F\u092A\u094D\u0932\u0947\u092F\u0930 \u092A\u0930\u093F\u092F\u094B\u091C\u0928\u093E \u0938\u093F\u0930\u094D\u091C\u0928\u093E \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","copy.multiplayer.project":"\u092E\u0932\u094D\u091F\u093F\u092A\u094D\u0932\u0947\u092F\u0930 \u092A\u094D\u0930\u094B\u091C\u0947\u0915\u094D\u091F\u092E\u093E \u0915\u092A\u093F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",select:"\u0938\u0947\u0932\u0947\u0915\u094D\u091F",eraser:"\u0907\u0930\u0947\u091C\u0930",draw:"\u091A\u093F\u0924\u094D\u0930 \u092C\u0928\u093E\u0909\u0928\u0941",arrow:"\u0924\u0940\u0930",text:"\u0936\u092C\u094D\u0926",sticky:"\u091F\u093E\u0901\u0938\u093F\u0928\u0947",rectangle:"\u0906\u092F\u0924",ellipse:"\u0926\u0940\u0930\u094D\u0918\u0935\u0943\u0924\u094D\u0924",triangle:"\u0924\u094D\u0930\u093F\u092D\u0941\u091C",line:"\u0930\u0947\u0916\u093E",rotate:"\u0918\u0941\u092E\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","lock.aspect.ratio":"\u0906\u0915\u093E\u0930 \u0905\u0928\u0941\u092A\u093E\u0924 \u0932\u0915 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","unlock.aspect.ratio":"\u0906\u0915\u093E\u0930 \u0905\u0928\u0941\u092A\u093E\u0924 \u0905\u0928\u0932\u0915 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",group:"\u0938\u092E\u0942\u0939",ungroup:"\u0938\u092E\u0942\u0939 \u0930\u0926\u094D\u0926 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.to.back":"\u092A\u091B\u093E\u0921\u093F \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.backward":"\u0925\u092A \u092A\u091B\u093E\u0921\u093F \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.forward":"\u0905\u0917\u093E\u0921\u093F \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.to.front":"\u0925\u092A \u0905\u0917\u093E\u0921\u093F \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","reset.angle":"\u0915\u094B\u0923 \u0930\u093F\u0938\u0947\u091F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",lock:"\u0932\u0915 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",unlock:"\u0905\u0928\u0932\u0915 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.to.page":"\u092A\u0943\u0937\u094D\u0920\u092E\u093E \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","flip.horizontal":"\u0924\u0947\u0930\u094D\u0938\u094B \u092B\u094D\u0932\u093F\u092A \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","flip.vertical":"\u0920\u093E\u0921\u094B \u092B\u094D\u0932\u093F\u092A \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",move:"\u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","to.front":"\u0925\u092A \u0905\u0917\u093E\u0921\u093F",forward:"\u0905\u0917\u093E\u0921\u093F",backward:"\u092A\u091B\u093E\u0921\u093F",back:"\u0925\u092A \u092A\u091B\u093E\u0921\u093F",language:"\u092D\u093E\u0937\u093E"};var Xl={"style.menu.color":"Farge","style.menu.fill":"Fyll","style.menu.dash":"Line","style.menu.size":"Storleik","style.menu.keep.open":"Hald open","style.menu.font":"Teksttype","style.menu.align":"Tilpass",styles:"Stilar","zoom.in":"Zoom inn","zoom.out":"Zoom ut",to:"til","menu.file":"Fil","menu.edit":"Rediger","menu.view":"Vis","menu.preferences":"Innstillingar","menu.sign.in":"Logg inn","menu.sign.out":"Logg ut","become.a.sponsor":"Vert sponsor","zoom.to.content":"Zoom til innhald","zoom.to.selection":"Zoom til valte element","zoom.to.fit":"Zoom for \xE5 passe","zoom.to":"Zoom til","preferences.dark.mode":"M\xF8rkmodus","preferences.focus.mode":"Fokusmodus","preferences.debug.mode":"Debugmodus","preferences.show.grid":"Vis rutenett","preferences.use.cad.selection":"Bruk CAD-val","preferences.keep.stylemenu.open":"Hald stilmeny open","preferences.always.show.snaps":"Vis alltid snaps","preferences.rotate.handles":"Vis roteringshandtak","preferences.binding.handles":"Vis bindingshandtak","preferences.clone.handles":"Vis kloningshandtak",undo:"Angre",redo:"Gjer om",cut:"Klipp ut",copy:"Kopier",paste:"Lim inn","copy.as":"Kopier som","export.as":"Eksporter som","select.all":"Vel alle","select.none":"Vel ingen",delete:"Slett","new.project":"Nytt prosjekt",open:"Opne",save:"Lagre","save.as":"Lagre som","upload.media":"Last opp media","create.page":"Opprett side","new.page":"Ny side","page.name":"Sidenamn",duplicate:"Dupliser",cancel:"Avbryt","copy.invite.link":"Kopier invitasjonslenke","copy.readonly.link":"Kopier invitasjonslenke (skrivebeskytta)","create.multiplayer.project":"Lag samarbeidsprosjekt","copy.multiplayer.project":"Kopier til samarbeidsprosjekt",select:"Vel",eraser:"Viskel\xEAr",draw:"Teikn",arrow:"Pil",text:"Tekst",sticky:"Lapp",rectangle:"Rektangel",ellipse:"Runding",triangle:"Trekant",line:"Line",rotate:"Roter","lock.aspect.ratio":"L\xE5s storleiksforhold","unlock.aspect.ratio":"L\xE5s opp storleiksforhold",group:"Grupper",ungroup:"Avgrupper","move.to.back":"Flytt bakarst","move.backward":"Flytt bakover","move.forward":"Flytt framover","move.to.front":"Flytt til front","reset.angle":"Tilbakestill vinkel",lock:"L\xE5s",unlock:"L\xE5s opp","move.to.page":"Flytt til side","flip.horizontal":"Snu horisontalt","flip.vertical":"Snu vertikalt",move:"Flytt","to.front":"Framme",forward:"Framover",backward:"Bakover",back:"Bakarst",language:"Spr\xE5k","translation.link":"Les meir","dock.position":"Dokkplassering",bottom:"Nede",left:"Venstre",right:"H\xF8gre",top:"Oppe",page:"Side","keyboard.shortcuts":"Sn\xF8ggtastar",search:"S\xF8k",loading:"Lastar{dots}","export.background":"Eksporter bakgrunn",transparent:"Gjennomsiktig",auto:"Auto",light:"Lys",dark:"M\xF8rk",github:"Github",twitter:"Twitter",discord:"Discord",image:"Bilete","align.left":"Venstrestill","align.center.x":"Midtstill horisontalt","align.right":"H\xF8grestill","align.top":"Still til toppen","align.center.y":"Midtstill vertikalt","align.bottom":"Still til botnen","distribute.x":"Distribuer horisontalt","distribute.y":"Distribuer vertikalt","stretch.x":"Strekk horisontalt","stretch.y":"Strekk vertikalt","dialog.save.firsttime":"Vil du lagre det noverande prosjektet ditt?","dialog.save.again":"Vil du lagre endringane i det noverande prosjektet ditt?","dialog.cancel":"Avbryt","dialog.no":"Nei","dialog.yes":"Ja","enter.file.name":"Fyll inn filnamn","telva-beta":"Pr\xF8v den nye telva",white:"Kvit",lightGray:"Lys gr\xE5",gray:"Gr\xE5",black:"Svart",green:"Gr\xF8n",cyan:"Cyan",blue:"Bk\xE5",indigo:"Indigo",violet:"Fiol",red:"Raud",orange:"Oransj",yellow:"Gul",solid:"Heil",dashed:"Stipla",dotted:"Prikka",small:"Liten",medium:"Mellomstor",large:"Stor"};var Zl={"style.menu.color":"Kolor","style.menu.fill":"Wype\u0142nienie","style.menu.dash":"Linia","style.menu.size":"Rozmiar","style.menu.keep.open":"Zachowaj otwarte","style.menu.font":"Czcionka","style.menu.align":"Wyr\xF3wnanie",styles:"Style","zoom.in":"Przybli\u017C","zoom.out":"Oddal",to:"do","menu.file":"Plik","menu.edit":"Edycja","menu.view":"Widok","menu.preferences":"Preferencje","menu.sign.in":"Zaloguj","menu.sign.out":"Wyloguj","become.a.sponsor":"Zosta\u0144 sponsorem","zoom.to.selection":"Przybli\u017C do zaznaczenia","zoom.to.fit":"Wype\u0142nij ekran","zoom.to":"Przybli\u017C do","preferences.dark.mode":"Tryb ciemny","preferences.focus.mode":"Tryb skupienia","preferences.debug.mode":"Tryb debugowania","preferences.show.grid":"Poka\u017C siatk\u0119","preferences.use.cad.selection":"U\u017Cyj zaznaczania CAD","preferences.keep.stylemenu.open":"Zachowaj menu styli otwarte","preferences.always.show.snaps":"Przyci\u0105gaj obiekty","preferences.rotate.handles":"Uchwyty obrotu","preferences.binding.handles":"Uchwyty powi\u0105zania","preferences.clone.handles":"Uchwyty klonuj\u0105ce",undo:"Cofnij",redo:"Powt\xF3rz",cut:"Wytnij",copy:"Kopiuj",paste:"Wklej","copy.as":"Kopiuj jako","export.as":"Eksportuj jako","select.all":"Zaznacz wszystko","select.none":"Odznacz wszystko",delete:"Usu\u0144","new.project":"Nowy projekt",open:"Otw\xF3rz",save:"Zapisz","save.as":"Zapisz jako","upload.media":"Za\u0142aduj multimedia","create.page":"Utw\xF3rz stron\u0119","new.page":"Nowa strona","page.name":"Nazwa strony",duplicate:"Powiel",cancel:"Anuluj","copy.invite.link":"Kopiuj link zaproszenia","create.multiplayer.project":"Stw\xF3rz projekt wieloosobowy","copy.multiplayer.project":"Kopiuj do projektu wieloosobowego",select:"Zaznacz",eraser:"Gumka",draw:"Rysuj",arrow:"Strza\u0142ka",text:"Tekst",sticky:"Naklejka",rectangle:"Prostok\u0105t",ellipse:"Elipsa",triangle:"Tr\xF3jk\u0105t",line:"Linia",rotate:"Obr\xF3\u0107","lock.aspect.ratio":"Zablokuj proporcje","unlock.aspect.ratio":"Odblokuj proporcje",group:"Grupuj",ungroup:"Rozgrupuj","move.to.back":"Przenie\u015B na ty\u0142","move.backward":"Przesu\u0144 do ty\u0142u","move.forward":"Przesu\u0144 do przodu","move.to.front":"Przenie\u015B na prz\xF3d","reset.angle":"Resetuj k\u0105t",lock:"Zablokuj",unlock:"Odblokuj","move.to.page":"Przenie\u015B na stron\u0119","flip.horizontal":"Odwr\xF3\u0107 w poziomie","flip.vertical":"Odwr\xF3\u0107 w pionie",move:"Przenie\u015B","to.front":"Na wierzch",forward:"Do przodu",backward:"Do ty\u0142u",back:"Na sp\xF3d",language:"J\u0119zyk","translation.link":"Czytaj wi\u0119cej","dock.position":"Pozycja przybornika",bottom:"D\xF3\u0142",left:"Lewa",right:"Prawa",top:"G\xF3ra",page:"Strona","keyboard.shortcuts":"Skr\xF3ty klawiszowe",search:"Szukaj",loading:"\u0141adowanie{dots}","export.background":"Eksportuj t\u0142o",transparent:"Przezroczyste",auto:"Automatyczny",light:"Jasny",dark:"Ciemny",github:"Github",twitter:"Twitter",discord:"Discord",image:"Obraz","align.left":"Wyr\xF3wnaj do lewej","align.center.x":"Wycentruj poziomo","align.right":"Wyr\xF3wnaj do prawej","align.top":"Wyr\xF3wnaj do g\xF3ry","align.center.y":"Wycentruj pionowo","align.bottom":"Wyr\xF3wnaj do do\u0142u","distribute.x":"Roz\u0142\xF3\u017C poziomo","distribute.y":"Roz\u0142\xF3\u017C pionowo","stretch.x":"Rozci\u0105gnij poziomo","stretch.y":"Rozci\u0105gnij pionowo","dialog.save.firsttime":"Czy chcesz zapisa\u0107 bie\u017C\u0105cy projekt?","dialog.save.again":"Czy chcesz zapisa\u0107 zmiany w bie\u017C\u0105cym projekcie?","dialog.cancel":"Anuluj","dialog.no":"Nie","dialog.yes":"Tak","enter.file.name":"Podaj nazw\u0119 pliku","telva-beta":"Wypr\xF3buj nowy telva"};var ql={"style.menu.color":"Cor","style.menu.fill":"Preencher","style.menu.dash":"Tra\xE7o","style.menu.size":"Tamanho","style.menu.keep.open":"Manter aberto","style.menu.font":"Fonte","style.menu.align":"Alinhamento",styles:"Estilos","zoom.in":"Aumentar zoom","zoom.out":"Diminuir zoom",to:"para","menu.file":"Arquivo","menu.edit":"Editar","menu.view":"Visualizar","menu.preferences":"Prefer\xEAncias","menu.sign.in":"Entrar","menu.sign.out":"Sair","become.a.sponsor":"Torne-se um patrocinador","zoom.to.selection":"Zoom para a sele\xE7\xE3o","zoom.to.fit":"Zoom para ajuste","zoom.to":"Zoom para","preferences.dark.mode":"Modo Escuro","preferences.focus.mode":"Modo Foco","preferences.debug.mode":"Modo Debug","preferences.show.grid":"Mostrar Grade","preferences.use.cad.selection":"Usar sele\xE7\xE3o CAD","preferences.keep.stylemenu.open":"Manter Menu de Estilos Aberto","preferences.always.show.snaps":"Mostrar Pontos de Ajuste","preferences.rotate.handles":"Controle de Rota\xE7\xE3o","preferences.binding.handles":"Controle de V\xEDnculos","preferences.clone.handles":"Controle de Clone",undo:"Desfazer",redo:"Refazer",cut:"Cortar",copy:"Copiar",paste:"Colar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todos","select.none":"Selecionar nenhum",delete:"Deletar","new.project":"Novo Projeto",open:"Abrir",save:"Salvar","save.as":"Salvar Como","upload.media":"Carregar M\xEDdia",page:"P\xE1gina",search:"Procurar",loading:"Carregando{dots}","export.background":"Exportar Fundo",transparent:"Transparente",auto:"Autom\xE1tico",light:"Claro",dark:"Escuro","menu.tools":"Ferramentas","menu.transform":"Transformar","zoom.to.content":"Voltar ao Conte\xFAdo","translation.link":"Saiba Mais","copy.readonly.link":"Copiar Link ReadOnly","align.distribute":"Alinhar / Distribuir","create.page":"Criar P\xE1gina","new.page":"Nova P\xE1gina","page.name":"Nome da P\xE1gina",duplicate:"Duplicar",cancel:"Cancelar","copy.invite.link":"Copiar Link de Convite","create.multiplayer.project":"Criar um Projeto Multijogador","copy.multiplayer.project":"Copiar para Projeto Multijogador",select:"Selecionar",eraser:"Borracha",draw:"Desenhar",arrow:"Seta",text:"Texto",sticky:"Adesivo",rectangle:"Ret\xE2ngulo",ellipse:"Elipse",triangle:"Tri\xE2ngulo",line:"Linha",rotate:"Rotacionar","lock.aspect.ratio":"Travar Propor\xE7\xE3o da Tela","unlock.aspect.ratio":"Destravar Propor\xE7\xE3o da Tela",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Recuar","move.backward":"Enviar para Tr\xE1s","move.forward":"Avan\xE7ar","move.to.front":"Trazer para Frente","reset.angle":"Reiniciar \xC2ngulo",lock:"Travar",unlock:"Destravar","move.to.page":"Mover para P\xE1gina","flip.horizontal":"Virar Horizontalmente","flip.vertical":"Virar Verticalmente",move:"Mover","to.front":"Para Frente",forward:"Avan\xE7ar",backward:"Recuar",back:"Voltar",language:"Idioma",image:"Imagem","keyboard.shortcuts":"Atalhos de Teclado","dock.position":"Posi\xE7\xE3o de Ferramentas",bottom:"Inferior",top:"Superior",right:"Direita",left:"Esquerda","align.left":"Alinhar \xE0 esquerda","align.center.x":"Alinhar ao centro na horizontal","align.right":"Alinhar \xE0 direita","align.top":"Alinhas em cima","align.center.y":"Alinhar ao centro na vertical","align.bottom":"Alinhar embaixo","distribute.x":"Distruibuir na horizontal","distribute.y":"Distruibuir na vertical","stretch.x":"Esticar na horizontal","stretch.y":"Esticar na vertical","dialog.save.firsttime":"Voc\xEA deseja salvar seu projeto atual?","dialog.save.again":"Voc\xEA deseja salvar as mudan\xE7as ao projeto atual?","dialog.cancel":"Cancelar","dialog.no":"N\xE3o","dialog.yes":"Sim","enter.file.name":"Insira o nome do arquivo"};var Jl={"style.menu.color":"Cor","style.menu.fill":"Preencher","style.menu.dash":"Tra\xE7o","style.menu.size":"Tamanho","style.menu.keep.open":"Manter aberto","style.menu.font":"Fonte","style.menu.align":"Alinhamento",styles:"Estilos","zoom.in":"Aumentar zoom","zoom.out":"Diminuir zoom",to:"para","menu.file":"Ficheiro","menu.edit":"Editar","menu.view":"Visualizar","menu.preferences":"Prefer\xEAncias","menu.sign.in":"Entrar","menu.sign.out":"Sair","become.a.sponsor":"Torne-se um patrocinador","zoom.to.selection":"Zoom na sele\xE7\xE3o","zoom.to.fit":"Zoom para caber","zoom.to":"Zoom para","preferences.dark.mode":"Modo Escuro","preferences.focus.mode":"Modo Foco","preferences.debug.mode":"Modo Debug","preferences.show.grid":"Mostrar Grelha","preferences.use.cad.selection":"Usar sele\xE7\xE3o CAD","preferences.keep.stylemenu.open":"Manter Menu de Estilos Aberto","preferences.always.show.snaps":"Mostrar Pontos de Ajuste","preferences.rotate.handles":"Controlo de Rota\xE7\xE3o","preferences.binding.handles":"Controlo de Binds","preferences.clone.handles":"Controlo de Clone",undo:"Desfazer",redo:"Refazer",cut:"Cortar",copy:"Copiar",paste:"Colar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todos","select.none":"Selecionar nenhum",delete:"Apagar","new.project":"Novo Projeto",open:"Abrir",save:"Salvar","save.as":"Salvar Como","upload.media":"Upload M\xE9dia","create.page":"Criar P\xE1gina","new.page":"Nova P\xE1gina","page.name":"Nome da P\xE1gina",duplicate:"Duplicar",cancel:"Cancelar","copy.invite.link":"Copiar Link de Convite","create.multiplayer.project":"Criar um Projeto Multi-Utilizador","copy.multiplayer.project":"Copiar num Projeto Multi-Utilizador",select:"Selecionar",eraser:"Borracha",draw:"Desenhar",arrow:"Seta",text:"Texto",sticky:"Post-it",rectangle:"Ret\xE2ngulo",ellipse:"Elipse",triangle:"Tri\xE2ngulo",line:"Linha",rotate:"Rodar","lock.aspect.ratio":"Trancar a Propor\xE7\xE3o","unlock.aspect.ratio":"Destrancar a Propor\xE7\xE3o",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Colocar no Fundo","move.backward":"Mover abaixo","move.forward":"Mover acima","move.to.front":"Colocar \xE0 Frente","reset.angle":"Reiniciar \xC2ngulo",lock:"Trancar",unlock:"Destrancar","move.to.page":"Mover para P\xE1gina","flip.horizontal":"Inverter Horizontalmente","flip.vertical":"Inverter Verticalmente",move:"Mover","to.front":"Para Frente",forward:"Avan\xE7ar",backward:"Recuar",back:"Voltar",language:"L\xEDngua"};var Ql={"style.menu.color":"\u0426\u0432\u0435\u0442","style.menu.fill":"\u0417\u0430\u043F\u043E\u043B\u043D\u044F\u0442\u044C","style.menu.dash":"\u0428\u0442\u0440\u0438\u0445","style.menu.size":"\u0420\u0430\u0437\u043C\u0435\u0440","style.menu.keep.open":"\u0414\u0435\u0440\u0436\u0430\u0442\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C","style.menu.font":"\u0428\u0440\u0438\u0444\u0442","style.menu.align":"\u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435",styles:"\u0421\u0442\u0438\u043B\u044C","zoom.in":"\u0423\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C","zoom.out":"\u0423\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C",to:"\u043A","menu.tools":"\u0418\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u044B","menu.transform":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435","menu.file":"\u0424\u0430\u0439\u043B","menu.edit":"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435","menu.view":"\u0412\u0438\u0434","menu.preferences":"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438","menu.sign.in":"\u0412\u043E\u0439\u0442\u0438","menu.sign.out":"\u0412\u044B\u0439\u0442\u0438","become.a.sponsor":"\u0421\u0442\u0430\u0442\u044C \u0441\u043F\u043E\u043D\u0441\u043E\u0440\u043E\u043C","zoom.to.content":"\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043A \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443","zoom.to.selection":"\u041C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044E","zoom.to.fit":"\u041C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0443 \u044D\u043A\u0440\u0430\u043D\u0430","zoom.to":"\u041C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A","preferences.dark.mode":"\u0422\u0451\u043C\u043D\u0430\u044F \u0442\u0435\u043C\u0430","preferences.focus.mode":"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C","preferences.debug.mode":"\u0420\u0435\u0436\u0438\u043C \u043E\u0442\u043B\u0430\u0434\u043A\u0438","preferences.show.grid":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u0435\u0442\u043A\u0443","preferences.use.cad.selection":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C CAD \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u0435","preferences.keep.stylemenu.open":"\u0414\u0435\u0440\u0436\u0430\u0442\u044C \u043C\u0435\u043D\u044E \u0441\u0442\u0438\u043B\u0435\u0439 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C","preferences.always.show.snaps":"\u0412\u0441\u0435\u0433\u0434\u0430 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0438","preferences.rotate.handles":"\u0420\u0443\u0447\u043A\u0438 \u0432\u0440\u0430\u0449\u0435\u043D\u0438\u044F","preferences.binding.handles":"\u0420\u0443\u0447\u043A\u0438 \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0438","preferences.clone.handles":"\u0420\u0443\u0447\u043A\u0438 \u043A\u043B\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",undo:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",redo:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",cut:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C",copy:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",paste:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C","copy.as":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u0430\u043A","export.as":"\u042D\u043A\u0441\u043F\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u0430\u043A","select.all":"\u0412\u044B\u0434\u0435\u043B\u0438\u0442\u044C \u0432\u0441\u0451","select.none":"\u0421\u043D\u044F\u0442\u044C \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u0435",delete:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","new.project":"\u041D\u043E\u0432\u044B\u0439 \u043F\u0440\u043E\u0435\u043A\u0442",open:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C",save:"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C","save.as":"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043A\u0430\u043A","upload.media":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043C\u0435\u0434\u0438\u0430\u0444\u0430\u0439\u043B","create.page":"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443","new.page":"\u041D\u043E\u0432\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430","page.name":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",duplicate:"\u0414\u0443\u0431\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C",cancel:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C","copy.invite.link":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u043F\u0440\u0438\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F","copy.readonly.link":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F","create.multiplayer.project":"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043C\u043D\u043E\u0433\u043E\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442","copy.multiplayer.project":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 \u043C\u043D\u043E\u0433\u043E\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442",select:"\u0412\u044B\u0434\u0435\u043B\u0438\u0442\u044C",eraser:"\u041B\u0430\u0441\u0442\u0438\u043A",draw:"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C",arrow:"\u0421\u0442\u0440\u0435\u043B\u043A\u0430",text:"\u0422\u0435\u043A\u0441\u0442",sticky:"\u0417\u0430\u043C\u0435\u0442\u043A\u0430",rectangle:"\u041F\u0440\u044F\u043C\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A",ellipse:"\u042D\u043B\u043B\u0438\u043F\u0441",triangle:"\u0422\u0440\u0435\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A",line:"\u041B\u0438\u043D\u0438\u044F",rotate:"\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u044C","lock.aspect.ratio":"\u0417\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043E\u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0435 \u0441\u0442\u043E\u0440\u043E\u043D","unlock.aspect.ratio":"\u0420\u0430\u0437\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043E\u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0435 \u0441\u0442\u043E\u0440\u043E\u043D",group:"\u0421\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",ungroup:"\u0420\u0430\u0437\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","move.to.back":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043D\u0430\u0437\u0430\u0434","move.backward":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043D\u0430 \u0437\u0430\u0434\u043D\u0438\u0439 \u043F\u043B\u0430\u043D","move.forward":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0432\u043F\u0435\u0440\u0451\u0434","move.to.front":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0438\u0439 \u043F\u043B\u0430\u043D","reset.angle":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0443\u0433\u043E\u043B",lock:"\u0411\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C",unlock:"\u0420\u0430\u0437\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C","align.distribute":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C / \u0440\u0430\u0441\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C","move.to.page":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443","flip.horizontal":"\u041F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","flip.vertical":"\u041F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E",move:"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C","to.front":"\u041D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0438\u0439 \u043F\u043B\u0430\u043D",forward:"\u0412\u043F\u0435\u0440\u0435\u0434",backward:"\u041D\u0430 \u0437\u0430\u0434\u043D\u0438\u0439 \u043F\u043B\u0430\u043D",back:"\u041D\u0430\u0437\u0430\u0434",language:"\u042F\u0437\u044B\u043A","translation.link":"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435","dock.position":"\u0420\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0430\u043D\u0435\u043B\u0438 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432",bottom:"\u0421\u043D\u0438\u0437\u0443",left:"\u0421\u043B\u0435\u0432\u0430",right:"\u0421\u043F\u0440\u0430\u0432\u0430",top:"\u0421\u0432\u0435\u0440\u0445\u0443",page:"\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430","keyboard.shortcuts":"\u0421\u043E\u0447\u0435\u0442\u0430\u043D\u0438\u044F \u043A\u043B\u0430\u0432\u0438\u0448",search:"\u041F\u043E\u0438\u0441\u043A",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430","export.background":"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0444\u043E\u043D\u0430",transparent:"\u041F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u044B\u0439",auto:"\u0410\u0432\u0442\u043E",light:"\u0421\u0432\u0435\u0442\u043B\u044B\u0439",dark:"\u0422\u0451\u043C\u043D\u044B\u0439",image:"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435","align.left":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u043B\u0435\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E","align.center.x":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","align.right":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E","align.top":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E","align.center.y":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E","align.bottom":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u043D\u0438\u0436\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E","distribute.x":"\u0420\u0430\u0441\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","distribute.y":"\u0420\u0430\u0441\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E","stretch.x":"\u0420\u0430\u0441\u0442\u044F\u043D\u0443\u0442\u044C \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","stretch.y":"\u0420\u0430\u0441\u0442\u044F\u043D\u0443\u0442\u044C \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E",share:"\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u044C\u0441\u044F","copy.current.page.link":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443","copy.project.link":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u043F\u0440\u043E\u0435\u043A\u0442","data.too.big.encoded":"\u0414\u0430\u043D\u043D\u044B\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0432\u0435\u043B\u0438\u043A\u0438, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0438\u0445 \u0432 \u0441\u0441\u044B\u043B\u043A\u0435. \u041D\u0435 \u0432\u043A\u043B\u044E\u0447\u0430\u0439\u0442\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0438\u043B\u0438 \u0432\u0438\u0434\u0435\u043E!","dialog.save.firsttime":"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442?","dialog.save.again":"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u0435?","dialog.cancel":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C","dialog.no":"\u041D\u0435\u0442","dialog.yes":"\u0414\u0430","enter.file.name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043C\u044F \u0444\u0430\u0439\u043B\u0430"};var ed={"style.menu.color":"F\xE4rg","style.menu.fill":"Ifylld","style.menu.dash":"Streck","style.menu.size":"Storlek","style.menu.keep.open":"H\xE5ll stilmenyn \xF6ppen","style.menu.font":"Typsnitt","style.menu.align":"Justera",styles:"Utseende","zoom.in":"Zooma in","zoom.out":"Zooma ut",to:"Till","menu.tools":"Verktyg","menu.transform":"Transform","menu.file":"Arkiv","menu.edit":"Redigera","menu.view":"Inneh\xE5ll","menu.preferences":"Inst\xE4llningar","menu.sign.in":"Logga in","menu.sign.out":"Logga ut","become.a.sponsor":"Bli en sponsor","zoom.to.content":"Anpassa zoom till inneh\xE5ll","zoom.to.selection":"Anpassa zoom till urval","zoom.to.fit":"Anpassa zoom till sk\xE4rm","zoom.to":"Zooma till","preferences.dark.mode":"M\xF6rkt l\xE4ge","preferences.focus.mode":"Fokusl\xE4ge","preferences.debug.mode":"Debugl\xE4ge","preferences.show.grid":"Visa rutn\xE4t","preferences.use.cad.selection":"V\xE4lj som i CAD-mjukvara","preferences.keep.stylemenu.open":"H\xE5ll stilmenyn \xF6ppen","preferences.always.show.snaps":"Visa alltid f\xE4stpunkter","preferences.rotate.handles":"Rotationshandtag","preferences.binding.handles":"Bindningshandtag","preferences.clone.handles":"Kloningshandtag",undo:"\xC5ngra",redo:"G\xF6r om",cut:"Klipp ut",copy:"Kopiera",paste:"Klistra in","copy.as":"Kopiera som","export.as":"Exportera till","select.all":"V\xE4lj alla","select.none":"V\xE4lj ingen",delete:"Radera","new.project":"Nytt projekt",open:"\xD6ppna",save:"Spara","save.as":"Spara som","upload.media":"Ladda upp media","create.page":"Skapa sida","new.page":"Ny sida","page.name":"Sidnamn",duplicate:"Duplicera",cancel:"Avbryt","copy.invite.link":"Kopiera l\xE4nk med redigeringsr\xE4ttigheter","copy.readonly.link":"Kopiera l\xE4nk med l\xE4sr\xE4ttigheter","create.multiplayer.project":"Skapa ett Multiplayer-projekt","copy.multiplayer.project":"Kopiera till Multiplayer-project",select:"V\xE4lj",eraser:"Radera",draw:"Rita",arrow:"Pil",text:"Text",sticky:"Klisterlapp",rectangle:"Rektangel",ellipse:"Ellips",triangle:"Triangel",line:"Linje",rotate:"Rotera","lock.aspect.ratio":"L\xE5s storleksf\xF6rh\xE5llande","unlock.aspect.ratio":"L\xE5s upp storleksf\xF6rh\xE5llande",group:"Gruppera",ungroup:"Avgruppera","move.to.back":"Placera l\xE4ngst bak","move.backward":"Flytta bak\xE5t","move.forward":"Flytta fram\xE5t","move.to.front":"Placera l\xE4ngst fram","reset.angle":"\xC5terst\xE4ll vinkel",lock:"L\xE5s",unlock:"L\xE5s upp","align.distribute":"Justera / Placera","move.to.page":"Flytta till sida","flip.horizontal":"V\xE4nd horisontellt","flip.vertical":"V\xE4nd vertikalt",move:"Flytta","to.front":"Till l\xE4ngst fram",forward:"Fram\xE5t",backward:"Bak\xE5t",back:"Till l\xE4ngst bak",language:"Spr\xE5k","translation.link":"Mer information","dock.position":"Dockningsposition",bottom:"Botten",left:"V\xE4nster",right:"H\xF6ger",top:"Topp",page:"Sida","keyboard.shortcuts":"Tangentbordsgenv\xE4gar",search:"S\xF6k",loading:"Laddar{dots}","export.background":"Exportbakgrund",transparent:"Transparent",auto:"Auto",light:"Ljus",dark:"M\xF6rk",github:"Github",twitter:"Twitter",discord:"Discord",image:"Bild"};var td={"style.menu.color":"\u0C30\u0C02\u0C17\u0C41","style.menu.fill":"\u0C28\u0C3F\u0C02\u0C2A\u0C41","style.menu.dash":"\u0C05\u0C21\u0C4D\u0C21 \u0C17\u0C40\u0C24","style.menu.size":"\u0C2A\u0C30\u0C3F\u0C2E\u0C3E\u0C23\u0C02","style.menu.keep.open":"\u0C24\u0C46\u0C30\u0C3F\u0C1A\u0C3F \u0C09\u0C02\u0C1A\u0C41","style.menu.font":"\u0C05\u0C15\u0C4D\u0C37\u0C30\u0C3E\u0C15\u0C43\u0C24\u0C3F","style.menu.align":"\u0C38\u0C30\u0C3F\u0C2A\u0C30\u0C1A\u0C41",styles:"\u0C35\u0C3F\u0C27\u0C2E\u0C41\u0C32\u0C41","zoom.in":"\u0C26\u0C17\u0C4D\u0C17\u0C30\u0C17\u0C3E \u0C1A\u0C42\u0C2A\u0C41","zoom.out":"\u0C26\u0C42\u0C30\u0C02\u0C17\u0C3E \u0C1A\u0C42\u0C2A\u0C41",to:"\u0C35\u0C26\u0C4D\u0C26\u0C15\u0C41","menu.tools":"\u0C2A\u0C30\u0C3F\u0C15\u0C30\u0C3E\u0C32\u0C41","menu.transform":"\u0C2E\u0C3E\u0C30\u0C4D\u0C1A\u0C41","menu.file":"\u0C2B\u0C48\u0C32\u0C4D","menu.edit":"\u0C2A\u0C30\u0C3F\u0C37\u0C4D\u0C15\u0C30\u0C3F\u0C02\u0C1A\u0C41","menu.view":"\u0C1A\u0C42\u0C2A\u0C41","menu.preferences":"\u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C4A\u0C28\u0C4D\u0C28\u0C35\u0C3F","menu.sign.in":"\u0C2A\u0C4D\u0C30\u0C35\u0C47\u0C36\u0C3F\u0C02\u0C1A\u0C41","menu.sign.out":"\u0C28\u0C3F\u0C37\u0C4D\u0C15\u0C4D\u0C30\u0C2E\u0C23","become.a.sponsor":"\u0C35\u0C3F\u0C30\u0C3E\u0C33\u0C26\u0C3E\u0C30\u0C41\u0C32\u0C41 \u0C05\u0C35\u0C4D\u0C35\u0C02\u0C21\u0C3F","zoom.to.content":"\u0C35\u0C3F\u0C37\u0C2F\u0C3E\u0C28\u0C4D\u0C28\u0C47 \u0C1A\u0C42\u0C2A\u0C41","zoom.to.selection":"\u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C41\u0C28\u0C4D\u0C28 \u0C35\u0C3F\u0C37\u0C2F\u0C3E\u0C28\u0C4D\u0C28\u0C47 \u0C1A\u0C42\u0C2A\u0C41","zoom.to.fit":"\u0C38\u0C30\u0C3F\u0C2A\u0C46\u0C1F\u0C4D\u0C1F\u0C3F \u0C1A\u0C42\u0C2A\u0C41","zoom.to":"\u0C1A\u0C42\u0C2A\u0C41","preferences.dark.mode":"\u0C1A\u0C40\u0C15\u0C1F\u0C48\u0C28 \u0C15\u0C4D\u0C30\u0C2E\u0C02","preferences.focus.mode":"\u0C24\u0C40\u0C15\u0C4D\u0C37\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02","preferences.debug.mode":"\u0C24\u0C2A\u0C4D\u0C2A\u0C41\u0C32\u0C47\u0C30\u0C41 \u0C15\u0C4D\u0C30\u0C2E\u0C02","preferences.show.grid":"\u0C1A\u0C1F\u0C4D\u0C30\u0C02 \u0C1A\u0C42\u0C2A\u0C41","preferences.use.cad.selection":"CAD\u0C28\u0C3F \u0C35\u0C3E\u0C21\u0C41","preferences.keep.stylemenu.open":"\u0C35\u0C3F\u0C27\u0C2E\u0C41\u0C32 \u0C2A\u0C24\u0C4D\u0C24\u0C3F \u0C24\u0C46\u0C30\u0C3F\u0C1A\u0C3F\u0C35\u0C41\u0C02\u0C1A\u0C41","preferences.always.show.snaps":"\u0C0E\u0C2A\u0C4D\u0C2A\u0C41\u0C21\u0C42 \u0C26\u0C43\u0C36\u0C4D\u0C2F\u0C2D\u0C3E\u0C17\u0C02 \u0C1A\u0C42\u0C2A\u0C41","preferences.rotate.handles":"\u0C39\u0C4D\u0C2F\u0C3E\u0C02\u0C21\u0C3F\u0C32\u0C4D\u0C38\u0C4D \u0C24\u0C3F\u0C2A\u0C4D\u0C2A\u0C41","preferences.binding.handles":"\u0C2F\u0C3E\u0C02\u0C21\u0C3F\u0C32\u0C4D\u0C38\u0C4D \u0C15\u0C1F\u0C4D\u0C1F\u0C41","preferences.clone.handles":"\u0C2F\u0C3E\u0C02\u0C21\u0C3F\u0C32\u0C4D\u0C38\u0C4D \u0C28\u0C15\u0C32\u0C41",undo:"\u0C2E\u0C3E\u0C30\u0C4D\u0C2A\u0C41\u0C28\u0C3F \u0C24\u0C3F\u0C30\u0C41\u0C17\u0C17\u0C4A\u0C1F\u0C4D\u0C1F\u0C41",redo:"\u0C2E\u0C33\u0C4D\u0C33\u0C40 \u0C2E\u0C3E\u0C30\u0C4D\u0C1A\u0C41",cut:"\u0C15\u0C24\u0C4D\u0C24\u0C3F\u0C30\u0C3F\u0C02\u0C1A\u0C41",copy:"\u0C28\u0C15\u0C32\u0C41",paste:"\u0C05\u0C24\u0C3F\u0C15\u0C3F\u0C02\u0C1A\u0C41","copy.as":"\u0C28\u0C15\u0C32\u0C41\u0C2A\u0C4D\u0C30\u0C24\u0C3F\u0C17\u0C3E \u0C07\u0C15\u0C4D\u0C15\u0C21\u0C3F\u0C15\u0C3F","export.as":"\u0C0E\u0C17\u0C41\u0C2E\u0C24\u0C3F \u0C07\u0C15\u0C4D\u0C15\u0C21\u0C3F\u0C15\u0C3F","select.all":"\u0C05\u0C28\u0C4D\u0C28\u0C40 \u0C0E\u0C02\u0C2A\u0C3F\u0C15\u0C1A\u0C46\u0C2F\u0C4D\u0C2F\u0C3F","select.none":"\u0C0E\u0C26\u0C40 \u0C0E\u0C02\u0C2A\u0C3F\u0C15\u0C1A\u0C46\u0C2F\u0C4D\u0C2F\u0C35\u0C26\u0C4D\u0C26\u0C41",delete:"\u0C24\u0C4A\u0C32\u0C17\u0C3F\u0C02\u0C1A\u0C41","new.project":"\u0C15\u0C4A\u0C24\u0C4D\u0C24 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C41",open:"\u0C24\u0C46\u0C30\u0C41\u0C35\u0C41",save:"\u0C26\u0C3E\u0C2F\u0C3F","save.as":"\u0C07\u0C32\u0C3E \u0C26\u0C3E\u0C2F\u0C3F","upload.media":"\u0C0E\u0C17\u0C41\u0C2E\u0C24\u0C3F \u0C2E\u0C3E\u0C27\u0C4D\u0C2F\u0C02","create.page":"\u0C2A\u0C41\u0C1F \u0C15\u0C32\u0C4D\u0C2A\u0C3F\u0C02\u0C1A\u0C41","new.page":"\u0C15\u0C4A\u0C24\u0C4D\u0C24 \u0C2A\u0C41\u0C1F","page.name":"\u0C2A\u0C41\u0C1F \u0C2A\u0C47\u0C30\u0C41",duplicate:"\u0C2E\u0C3E\u0C30\u0C41\u0C2A\u0C4D\u0C30\u0C24\u0C3F",cancel:"\u0C30\u0C26\u0C4D\u0C26\u0C41\u0C1A\u0C47\u0C2F\u0C3F","copy.invite.link":"\u0C05\u0C39\u0C4D\u0C35\u0C3E\u0C28 \u0C32\u0C3F\u0C02\u0C15\u0C41 \u0C30\u0C3E\u0C2F\u0C3F","copy.readonly.link":"\u0C2E\u0C3E\u0C30\u0C28\u0C3F\u0C2A\u0C4D\u0C30\u0C24\u0C3F \u0C32\u0C3F\u0C02\u0C15\u0C41 \u0C30\u0C3E\u0C2F\u0C3F","create.multiplayer.project":"\u0C2C\u0C39\u0C41\u0C15\u0C30\u0C4D\u0C24\u0C32 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C41 \u0C15\u0C32\u0C4D\u0C2A\u0C3F\u0C02\u0C1A\u0C41","copy.multiplayer.project":"\u0C2C\u0C39\u0C41\u0C15\u0C30\u0C4D\u0C24\u0C32 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C41\u0C15\u0C41 \u0C30\u0C3E\u0C2F\u0C3F",select:"\u0C0E\u0C02\u0C2A\u0C3F\u0C15\u0C1A\u0C46\u0C2F\u0C4D\u0C2F\u0C3F",eraser:"Eraser",draw:"\u0C17\u0C40\u0C2F\u0C4D\u0C2F\u0C3F",arrow:"\u0C2C\u0C3E\u0C23\u0C02",text:"\u0C05\u0C15\u0C4D\u0C37\u0C30\u0C2E\u0C41\u0C32\u0C41",sticky:"\u0C05\u0C24\u0C41\u0C15\u0C4D\u0C15\u0C41\u0C28\u0C47",rectangle:"\u0C26\u0C40\u0C30\u0C4D\u0C18\u0C1A\u0C24\u0C41\u0C30\u0C38\u0C4D\u0C30\u0C02",ellipse:"\u0C26\u0C40\u0C30\u0C4D\u0C18\u0C35\u0C43\u0C24\u0C4D\u0C24\u0C02",triangle:"\u0C24\u0C4D\u0C30\u0C3F\u0C2D\u0C41\u0C1C\u0C02",line:"\u0C17\u0C40\u0C24",rotate:"\u0C24\u0C3F\u0C2A\u0C4D\u0C2A\u0C41","lock.aspect.ratio":"\u0C06\u0C38\u0C4D\u0C2A\u0C46\u0C15\u0C4D\u0C1F\u0C4D \u0C28\u0C3F\u0C37\u0C4D\u0C2A\u0C24\u0C4D\u0C24\u0C3F\u0C15\u0C3F \u0C24\u0C3E\u0C33\u0C02\u0C2A\u0C46\u0C1F\u0C4D\u0C1F\u0C41","unlock.aspect.ratio":"\u0C06\u0C38\u0C4D\u0C2A\u0C46\u0C15\u0C4D\u0C1F\u0C4D \u0C28\u0C3F\u0C37\u0C4D\u0C2A\u0C24\u0C4D\u0C24\u0C3F \u0C24\u0C3E\u0C33\u0C02\u0C24\u0C46\u0C30\u0C41\u0C35\u0C41",group:"\u0C17\u0C41\u0C02\u0C2A\u0C41\u0C17\u0C3E \u0C0F\u0C30\u0C4D\u0C2A\u0C30\u0C1A\u0C41",ungroup:"\u0C17\u0C41\u0C02\u0C2A\u0C41\u0C28\u0C41 \u0C1A\u0C46\u0C26\u0C30\u0C17\u0C4A\u0C1F\u0C4D\u0C1F\u0C41","move.to.back":"\u0C06\u0C16\u0C30\u0C3F\u0C15\u0C3F \u0C1C\u0C30\u0C41\u0C2A\u0C41","move.backward":"\u0C35\u0C46\u0C28\u0C41\u0C15\u0C15\u0C41 \u0C1C\u0C30\u0C41\u0C2A\u0C41","move.forward":"\u0C2E\u0C41\u0C02\u0C26\u0C41\u0C15\u0C41 \u0C1C\u0C30\u0C41\u0C2A\u0C41","move.to.front":"\u0C2E\u0C4A\u0C26\u0C1F\u0C3F\u0C15\u0C3F \u0C1C\u0C30\u0C41\u0C2A\u0C41","reset.angle":"\u0C15\u0C4B\u0C23\u0C02 \u0C30\u0C40\u0C38\u0C46\u0C1F\u0C4D",lock:"\u0C24\u0C3E\u0C33\u0C02 \u0C35\u0C46\u0C2F\u0C4D\u0C2F\u0C3F",unlock:"\u0C24\u0C3E\u0C33\u0C02 \u0C24\u0C3F\u0C2F\u0C4D\u0C2F\u0C3F","align.distribute":" \u0C38\u0C30\u0C3F\u0C2A\u0C30\u0C1A\u0C41/\u0C35\u0C46\u0C26\u0C1C\u0C32\u0C4D\u0C32\u0C41","move.to.page":"\u0C2A\u0C41\u0C1F\u0C32\u0C4B\u0C15\u0C3F \u0C1C\u0C30\u0C41\u0C2A\u0C41","flip.horizontal":"\u0C05\u0C21\u0C4D\u0C21\u0C02\u0C17\u0C3E \u0C2A\u0C32\u0C4D\u0C1F\u0C40","flip.vertical":"\u0C28\u0C3F\u0C32\u0C41\u0C35\u0C41\u0C17\u0C3E \u0C2A\u0C32\u0C4D\u0C1F\u0C40",move:"\u0C1C\u0C30\u0C41\u0C2A\u0C41","to.front":"\u0C2E\u0C4A\u0C26\u0C1F\u0C3F\u0C15\u0C3F",forward:"\u0C2E\u0C41\u0C02\u0C26\u0C41\u0C15\u0C41",backward:"\u0C35\u0C46\u0C28\u0C41\u0C15\u0C15\u0C41",back:"\u0C06\u0C16\u0C30\u0C3F\u0C15\u0C3F",language:"\u0C2D\u0C3E\u0C37","translation.link":"\u0C2E\u0C30\u0C3F \u0C15\u0C4A\u0C28\u0C4D\u0C28\u0C3F \u0C35\u0C3F\u0C37\u0C2F\u0C3E\u0C32\u0C41","dock.position":"\u0C2E\u0C02\u0C1A \u0C38\u0C4D\u0C25\u0C3E\u0C28\u0C02",bottom:"\u0C05\u0C21\u0C41\u0C17\u0C41\u0C28",left:"\u0C0E\u0C21\u0C2E\u0C35\u0C48\u0C2A\u0C41",right:"\u0C15\u0C41\u0C21\u0C3F\u0C35\u0C48\u0C2A\u0C41",top:"\u0C2A\u0C48\u0C28",page:"\u0C2A\u0C41\u0C24","keyboard.shortcuts":"\u0C15\u0C40\u0C2C\u0C4B\u0C30\u0C4D\u0C21\u0C4D \u0C38\u0C24\u0C4D\u0C35\u0C30\u0C2E\u0C3E\u0C30\u0C4D\u0C17\u0C02",search:"\u0C35\u0C46\u0C24\u0C41\u0C15\u0C41",loading:"Loading{dots}","export.background":"\u0C28\u0C47\u0C2A\u0C25\u0C4D\u0C2F\u0C02 \u0C0E\u0C17\u0C41\u0C2E\u0C24\u0C3F",transparent:"\u0C15\u0C3E\u0C02\u0C24\u0C3F \u0C2D\u0C47\u0C26\u0C4D\u0C2F\u0C2E\u0C41",auto:"\u0C38\u0C4D\u0C35\u0C2F\u0C02\u0C15\u0C43\u0C24\u0C02",light:"\u0C35\u0C46\u0C32\u0C41\u0C24\u0C41\u0C30\u0C41",dark:"\u0C1A\u0C40\u0C15\u0C1F\u0C3F",github:"Github",twitter:"Twitter",discord:"Discord",image:"\u0C1A\u0C3F\u0C24\u0C4D\u0C30\u0C02","align.left":"\u0C0E\u0C21\u0C2E\u0C35\u0C48\u0C2A\u0C41\u0C15\u0C41 \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.center.x":"\u0C05\u0C21\u0C4D\u0C21\u0C02\u0C17\u0C3E \u0C2E\u0C27\u0C4D\u0C2F\u0C32\u0C4B \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.right":"\u0C15\u0C41\u0C21\u0C3F\u0C35\u0C48\u0C2A\u0C41\u0C15\u0C41 \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.top":"\u0C2A\u0C48\u0C15\u0C3F \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.center.y":"\u0C28\u0C3F\u0C32\u0C41\u0C35\u0C41\u0C17\u0C3E \u0C2E\u0C27\u0C4D\u0C2F\u0C32\u0C4B \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.bottom":"\u0C05\u0C21\u0C41\u0C17\u0C41\u0C28 \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","distribute.x":"\u0C05\u0C21\u0C4D\u0C21\u0C02\u0C17\u0C3E \u0C2A\u0C02\u0C1A\u0C41","distribute.y":"\u0C28\u0C3F\u0C32\u0C41\u0C35\u0C41\u0C17\u0C3E \u0C2A\u0C02\u0C1A\u0C41","stretch.x":"\u0C05\u0C21\u0C4D\u0C21\u0C02\u0C17\u0C3E \u0C32\u0C3E\u0C17\u0C41","stretch.y":"\u0C28\u0C3F\u0C32\u0C41\u0C35\u0C41\u0C17\u0C3E \u0C32\u0C3E\u0C17\u0C41","dialog.save.firsttime":"\u0C2E\u0C40\u0C30\u0C41 \u0C08 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C4D \u0C2D\u0C26\u0C4D\u0C30\u0C2A\u0C30\u0C1A\u0C41\u0C15\u0C4B\u0C35\u0C3E\u0C32\u0C28\u0C3F \u0C05\u0C28\u0C41\u0C15\u0C41\u0C02\u0C1F\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C30\u0C3E?","dialog.save.again":"\u0C2E\u0C40\u0C30\u0C41 \u0C08 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C4D \u0C2D\u0C26\u0C4D\u0C30\u0C2A\u0C30\u0C1A\u0C41\u0C15\u0C4B\u0C35\u0C3E\u0C32\u0C28\u0C3F \u0C05\u0C28\u0C41\u0C15\u0C41\u0C02\u0C1F\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C30\u0C3E?","dialog.cancel":"\u0C30\u0C26\u0C4D\u0C26\u0C41\u0C1A\u0C46\u0C2F\u0C4D\u0C2F\u0C3F","dialog.no":"\u0C35\u0C26\u0C4D\u0C26\u0C41","dialog.yes":"\u0C38\u0C30\u0C47","enter.file.name":"\u0C2B\u0C48\u0C32\u0C4D \u0C2A\u0C46\u0C30\u0C41 \u0C1A\u0C46\u0C2A\u0C4D\u0C2A\u0C02\u0C21\u0C3F"};var nd={"style.menu.color":"\u0E2A\u0E35","style.menu.fill":"\u0E40\u0E15\u0E34\u0E21","style.menu.dash":"\u0E01\u0E23\u0E2D\u0E1A","style.menu.size":"\u0E02\u0E19\u0E32\u0E14","style.menu.keep.open":"\u0E40\u0E1B\u0E34\u0E14\u0E17\u0E34\u0E49\u0E07\u0E44\u0E27\u0E49","style.menu.font":"\u0E41\u0E1A\u0E1A\u0E2D\u0E31\u0E01\u0E29\u0E23","style.menu.align":"\u0E08\u0E31\u0E14\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07",styles:"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A","zoom.in":"\u0E0B\u0E39\u0E21\u0E40\u0E02\u0E49\u0E32","zoom.out":"\u0E0B\u0E39\u0E21\u0E2D\u0E2D\u0E01",to:"\u0E0B\u0E39\u0E21\u0E44\u0E1B\u0E17\u0E35\u0E48","menu.tools":"\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E21\u0E37\u0E2D","menu.transform":"\u0E41\u0E1B\u0E25\u0E07","menu.file":"\u0E44\u0E1F\u0E25\u0E4C","menu.edit":"\u0E41\u0E01\u0E49\u0E44\u0E02","menu.view":"\u0E21\u0E38\u0E21\u0E21\u0E2D\u0E07","menu.preferences":"\u0E01\u0E32\u0E23\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32","menu.sign.in":"\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A","menu.sign.out":"\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A","become.a.sponsor":"\u0E23\u0E48\u0E27\u0E21\u0E40\u0E1B\u0E47\u0E19\u0E2A\u0E1B\u0E2D\u0E19\u0E40\u0E0B\u0E2D\u0E23\u0E4C","zoom.to.content":"\u0E01\u0E25\u0E31\u0E1A\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32","zoom.to.selection":"\u0E0B\u0E39\u0E21\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E2A\u0E48\u0E27\u0E19\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01","zoom.to.fit":"\u0E0B\u0E39\u0E21\u0E43\u0E2B\u0E49\u0E40\u0E15\u0E47\u0E21\u0E1E\u0E2D\u0E14\u0E35","zoom.to":"\u0E0B\u0E39\u0E21\u0E44\u0E1B\u0E17\u0E35\u0E48","preferences.dark.mode":"\u0E42\u0E2B\u0E21\u0E14\u0E21\u0E37\u0E14","preferences.focus.mode":"\u0E42\u0E2B\u0E21\u0E14\u0E42\u0E1F\u0E01\u0E31\u0E2A","preferences.debug.mode":"\u0E42\u0E2B\u0E21\u0E14\u0E14\u0E35\u0E1A\u0E31\u0E01","preferences.show.grid":"\u0E41\u0E2A\u0E14\u0E07\u0E15\u0E32\u0E23\u0E32\u0E07","preferences.use.cad.selection":"\u0E01\u0E32\u0E23\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E1A\u0E1A CAD","preferences.keep.stylemenu.open":"\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E34\u0E49\u0E07\u0E44\u0E27\u0E49","preferences.always.show.snaps":"\u0E41\u0E2A\u0E14\u0E07\u0E2A\u0E41\u0E19\u0E1B\u0E15\u0E25\u0E2D\u0E14","preferences.rotate.handles":"\u0E41\u0E2A\u0E14\u0E07\u0E08\u0E38\u0E14\u0E08\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E2B\u0E21\u0E38\u0E19","preferences.binding.handles":"\u0E41\u0E2A\u0E14\u0E07\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07","preferences.clone.handles":"\u0E41\u0E2A\u0E14\u0E07\u0E15\u0E31\u0E27\u0E42\u0E04\u0E25\u0E19",undo:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",redo:"\u0E17\u0E33\u0E0B\u0E49\u0E33",cut:"\u0E15\u0E31\u0E14",copy:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",paste:"\u0E27\u0E32\u0E07","copy.as":"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E40\u0E1B\u0E47\u0E19","export.as":"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01\u0E40\u0E1B\u0E47\u0E19","select.all":"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14","select.none":"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E2A\u0E34\u0E48\u0E07\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",delete:"\u0E25\u0E1A","new.project":"\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E01\u0E15\u0E4C\u0E43\u0E2B\u0E21\u0E48",open:"\u0E40\u0E1B\u0E34\u0E14",save:"\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01","save.as":"\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E40\u0E1B\u0E47\u0E19","upload.media":"\u0E2D\u0E31\u0E1E\u0E42\u0E2B\u0E25\u0E14\u0E21\u0E35\u0E40\u0E14\u0E35\u0E22","create.page":"\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E2B\u0E19\u0E49\u0E32","new.page":"\u0E2B\u0E19\u0E49\u0E32\u0E43\u0E2B\u0E21\u0E48","page.name":"\u0E0A\u0E37\u0E48\u0E2D\u0E2B\u0E19\u0E49\u0E32",duplicate:"\u0E2A\u0E33\u0E40\u0E19\u0E32",cancel:"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01","copy.invite.link":"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E40\u0E0A\u0E34\u0E0D","copy.readonly.link":"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E41\u0E1A\u0E1A\u0E43\u0E2B\u0E49\u0E2D\u0E48\u0E32\u0E19\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E40\u0E14\u0E35\u0E22\u0E27","create.multiplayer.project":"\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E01\u0E15\u0E4C\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E2B\u0E25\u0E32\u0E22\u0E04\u0E19","copy.multiplayer.project":"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E01\u0E15\u0E4C\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E2B\u0E25\u0E32\u0E22\u0E04\u0E19",select:"\u0E40\u0E25\u0E37\u0E2D\u0E01",eraser:"\u0E22\u0E32\u0E07\u0E25\u0E1A",draw:"\u0E27\u0E32\u0E14",arrow:"\u0E25\u0E39\u0E01\u0E28\u0E23",text:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",sticky:"\u0E01\u0E23\u0E30\u0E14\u0E32\u0E29\u0E42\u0E19\u0E4A\u0E15",rectangle:"\u0E2A\u0E35\u0E48\u0E40\u0E2B\u0E25\u0E35\u0E48\u0E22\u0E21\u0E1C\u0E37\u0E19\u0E1C\u0E49\u0E32",ellipse:"\u0E27\u0E07\u0E23\u0E35",triangle:"\u0E2A\u0E32\u0E21\u0E40\u0E2B\u0E25\u0E35\u0E48\u0E22\u0E21",line:"\u0E40\u0E2A\u0E49\u0E19",rotate:"\u0E2B\u0E21\u0E38\u0E19","lock.aspect.ratio":"\u0E25\u0E47\u0E2D\u0E04\u0E2D\u0E31\u0E15\u0E23\u0E32\u0E2A\u0E48\u0E27\u0E19\u0E20\u0E32\u0E1E","unlock.aspect.ratio":"\u0E1B\u0E25\u0E14\u0E25\u0E47\u0E2D\u0E01\u0E2D\u0E31\u0E15\u0E23\u0E32\u0E2A\u0E48\u0E27\u0E19\u0E20\u0E32\u0E1E",group:"\u0E01\u0E25\u0E38\u0E48\u0E21",ungroup:"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E01\u0E25\u0E38\u0E48\u0E21","move.to.back":"\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07","move.backward":"\u0E02\u0E22\u0E31\u0E1A\u0E16\u0E2D\u0E22\u0E2B\u0E25\u0E31\u0E07","move.forward":"\u0E02\u0E22\u0E31\u0E1A\u0E44\u0E1B\u0E2B\u0E19\u0E49\u0E32","move.to.front":"\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32","reset.angle":"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E21\u0E38\u0E21",lock:"\u0E25\u0E47\u0E2D\u0E04",unlock:"\u0E1B\u0E25\u0E14\u0E25\u0E47\u0E2D\u0E04","align.distribute":"\u0E08\u0E31\u0E14\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07 / \u0E01\u0E23\u0E30\u0E08\u0E32\u0E22","move.to.page":"\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E2B\u0E19\u0E49\u0E32","flip.horizontal":"\u0E1E\u0E25\u0E34\u0E01\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19","flip.vertical":"\u0E1E\u0E25\u0E34\u0E01\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07",move:"\u0E22\u0E49\u0E32\u0E22","to.front":"\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32",forward:"\u0E02\u0E49\u0E32\u0E07\u0E2B\u0E19\u0E49\u0E32",backward:"\u0E02\u0E49\u0E32\u0E07\u0E2B\u0E25\u0E31\u0E07",back:"\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07",language:"\u0E20\u0E32\u0E29\u0E32","translation.link":"\u0E40\u0E23\u0E35\u0E22\u0E19\u0E23\u0E39\u0E49\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21","dock.position":"\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07\u0E41\u0E16\u0E1A\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E21\u0E37\u0E2D",bottom:"\u0E02\u0E49\u0E32\u0E07\u0E25\u0E48\u0E32\u0E07",left:"\u0E02\u0E49\u0E32\u0E07\u0E0B\u0E49\u0E32\u0E22",right:"\u0E02\u0E49\u0E32\u0E07\u0E02\u0E27\u0E32",top:"\u0E02\u0E49\u0E32\u0E07\u0E1A\u0E19",page:"\u0E2B\u0E19\u0E49\u0E32","keyboard.shortcuts":"\u0E41\u0E1B\u0E49\u0E19\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E25\u0E31\u0E14",search:"\u0E04\u0E49\u0E19\u0E2B\u0E32",loading:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14{dots}","export.background":"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01\u0E1E\u0E37\u0E49\u0E19\u0E2B\u0E25\u0E31\u0E07",transparent:"\u0E42\u0E1B\u0E23\u0E48\u0E07\u0E43\u0E2A",auto:"\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",light:"\u0E2A\u0E27\u0E48\u0E32\u0E07",dark:"\u0E21\u0E37\u0E14",github:"Github",twitter:"Twitter",discord:"Discord",image:"\u0E20\u0E32\u0E1E","align.left":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E0A\u0E34\u0E14\u0E0B\u0E49\u0E32\u0E22","align.center.x":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E2D\u0E22\u0E39\u0E48\u0E01\u0E36\u0E48\u0E07\u0E01\u0E25\u0E32\u0E07\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19","align.right":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E0A\u0E34\u0E14\u0E02\u0E27\u0E32","align.top":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E2D\u0E22\u0E39\u0E48\u0E14\u0E49\u0E32\u0E19\u0E1A\u0E19","align.center.y":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E2D\u0E22\u0E39\u0E48\u0E01\u0E36\u0E48\u0E07\u0E01\u0E25\u0E32\u0E07\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07","align.bottom":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E2D\u0E22\u0E39\u0E48\u0E14\u0E49\u0E32\u0E19\u0E25\u0E48\u0E32\u0E07","distribute.x":"\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19","distribute.y":"\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07","stretch.x":"\u0E22\u0E37\u0E14\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19","stretch.y":"\u0E22\u0E37\u0E14\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07","dialog.save.firsttime":"\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E47\u0E01\u0E15\u0E4C\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48?","dialog.save.again":"\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07\u0E43\u0E19\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E47\u0E01\u0E15\u0E4C\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48?","dialog.cancel":"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01","dialog.no":"\u0E44\u0E21\u0E48","dialog.yes":"\u0E43\u0E0A\u0E48","enter.file.name":"\u0E01\u0E23\u0E2D\u0E01\u0E0A\u0E37\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"};var od={"style.menu.color":"Renk","style.menu.fill":"Doldur","style.menu.dash":"\xC7izgi","style.menu.size":"Boyut","style.menu.keep.open":"A\xE7\u0131k Tut","style.menu.font":"Yaz\u0131 Tipi","style.menu.align":"Hizala",styles:"Stiller","zoom.in":"Yak\u0131nla\u015Ft\u0131r","zoom.out":"Uzakla\u015Ft\u0131r",to:"","menu.file":"Dosya","menu.edit":"D\xFCzenle","menu.view":"G\xF6r\xFCnt\xFC","menu.preferences":"Tercihler","menu.sign.in":"Giri\u015F Yap","menu.sign.out":"Oturumu Kapat","become.a.sponsor":"Sponsor Ol","zoom.to.selection":"Se\xE7ime Yak\u0131nla\u015Ft\u0131r","zoom.to.fit":"S\u0131\u011Fd\u0131rmak i\xE7in Yak\u0131nla\u015Ft\u0131r","zoom.to":"Yak\u0131nla\u015Ft\u0131r","preferences.dark.mode":"Karanl\u0131k Mod","preferences.focus.mode":"Odak Modu","preferences.debug.mode":"Debug Modu","preferences.show.grid":"Izgaray\u0131 G\xF6ster","preferences.use.cad.selection":"CAD Se\xE7imi Kullan","preferences.keep.stylemenu.open":"Stil Men\xFCs\xFCn\xFC A\xE7\u0131k Tut","preferences.always.show.snaps":"Hiza \xC7izgilerini Hep G\xF6ster","preferences.rotate.handles":"Rotasyon Kontrolc\xFCleri","preferences.binding.handles":"Ba\u011Flama Kontrolc\xFCleri","preferences.clone.handles":"Klon Kontrolc\xFCleri",undo:"Geri Al",redo:"Yinele",cut:"Kes",copy:"Kopyala",paste:"Yap\u0131\u015Ft\u0131r","copy.as":"Olarak Kopyala","export.as":"Olarak D\u0131\u015Far\u0131 Aktar","select.all":"Hepsini Se\xE7","select.none":"Hi\xE7birini Se\xE7me",delete:"Sil","new.project":"Yeni Proje",open:"A\xE7",save:"Kaydet","save.as":"Farkl\u0131 Kaydet","upload.media":"Medya Y\xFCkle","create.page":"Sayfa Olu\u015Ftur","new.page":"Yeni Sayfa","page.name":"Sayfa \u0130smi",duplicate:"Kopya Olu\u015Ftur",cancel:"\u0130ptal","copy.invite.link":"Davet Linkini Kopyala","create.multiplayer.project":"\xC7ok Oyunculu Proje Olu\u015Ftur","copy.multiplayer.project":"\xC7ok Oyunculu Projeye Kopyala",select:"Se\xE7",eraser:"Silgi",draw:"\xC7izim",arrow:"Ok",text:"Yaz\u0131",sticky:"Yap\u0131\u015Fkan",rectangle:"Dikd\xF6rtgen",ellipse:"Elips",triangle:"\xDC\xE7gen",line:"\xC7izgi",rotate:"D\xF6nd\xFCr","lock.aspect.ratio":"En Boy Oran\u0131n\u0131 Kilitle","unlock.aspect.ratio":"En Boy Oran\u0131 Kilidini A\xE7",group:"Grupla",ungroup:"Gruplamay\u0131 Kald\u0131r","move.to.back":"Arkaya Ta\u015F\u0131","move.backward":"En Arkaya Ta\u015F\u0131","move.forward":"En \xD6ne Ta\u015F\u0131","move.to.front":"\xD6ne Ta\u015F\u0131","reset.angle":"A\xE7\u0131y\u0131 S\u0131f\u0131rla",lock:"Kilitle",unlock:"Kilidini A\xE7","move.to.page":"Sayfaya Ta\u015F\u0131","flip.horizontal":"Yatay \xC7evir","flip.vertical":"Dikey \xC7evir",move:"Ta\u015F\u0131","to.front":"\xD6ne",forward:"En \xD6ne",backward:"En Arkaya",back:"Arkaya",language:"Dil"};var rd={"style.menu.color":"\u041A\u043E\u043B\u0456\u0440","style.menu.fill":"\u0417\u0430\u043F\u043E\u0432\u043D\u044E\u0432\u0430\u0442\u0438","style.menu.dash":"\u0428\u0442\u0440\u0438\u0445","style.menu.size":"\u0420\u043E\u0437\u043C\u0456\u0440","style.menu.keep.open":"\u0422\u0440\u0438\u043C\u0430\u0442\u0438 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438\u043C","style.menu.font":"\u0428\u0440\u0438\u0444\u0442","style.menu.align":"\u0412\u0438\u0440\u0456\u0432\u043D\u044F\u0442\u0438",styles:"\u0421\u0442\u0438\u043B\u044C","zoom.in":"\u0417\u0431\u0456\u043B\u044C\u0448\u0438\u0442\u0438","zoom.out":"\u0417\u043C\u0435\u043D\u0448\u0438\u0442\u0438",to:"\u0434\u043E","menu.file":"\u0424\u0430\u0439\u043B","menu.edit":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F","menu.view":"\u0412\u0438\u0433\u043B\u044F\u0434","menu.preferences":"\u041D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F","menu.sign.in":"\u0423\u0432\u0456\u0439\u0442\u0438","menu.sign.out":"\u0412\u0438\u0439\u0442\u0438","become.a.sponsor":"\u0421\u0442\u0430\u0442\u0438 \u0441\u043F\u043E\u043D\u0441\u043E\u0440\u043E\u043C","zoom.to.selection":"\u041D\u0430\u0431\u043B\u0438\u0437\u0438\u0442\u0438 \u0434\u043E \u0432\u0438\u0434\u0456\u043B\u0435\u043D\u043D\u044F","zoom.to.fit":"\u0417\u0431\u0456\u043B\u044C\u0448\u0438\u0442\u0438 \u0437\u0430 \u0440\u043E\u0437\u043C\u0456\u0440\u043E\u043C \u0435\u043A\u0440\u0430\u043D\u0443","zoom.to":"\u041D\u0430\u0431\u043B\u0438\u0437\u0438\u0442\u0438 \u0434\u043E","preferences.dark.mode":"\u0422\u0435\u043C\u043D\u0430 \u0442\u0435\u043C\u0430","preferences.focus.mode":"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u0456\u0441\u0442\u0438\u0447\u043D\u0438\u0439 \u0440\u0435\u0436\u0438\u043C","preferences.debug.mode":"\u0420\u0435\u0436\u0438\u043C \u043D\u0430\u043B\u0430\u0433\u043E\u0434\u0436\u0435\u043D\u043D\u044F","preferences.show.grid":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u0438 \u0441\u0456\u0442\u043A\u0443","preferences.use.cad.selection":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0432\u0430\u0442\u0438 CAD \u0432\u0438\u0434\u0456\u043B\u0435\u043D\u043D\u044F","preferences.keep.stylemenu.open":"\u0422\u0440\u0438\u043C\u0430\u0442\u0438 \u043C\u0435\u043D\u044E \u0441\u0442\u0438\u043B\u0456\u0432 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438\u043C","preferences.always.show.snaps":"\u0417\u0430\u0432\u0436\u0434\u0438 \u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043F\u0440\u0438\u0432'\u044F\u0437\u043A\u0438","preferences.rotate.handles":"\u0420\u0443\u0447\u043A\u0438 \u043E\u0431\u0435\u0440\u0442\u0430\u043D\u043D\u044F","preferences.binding.handles":"\u0420\u0443\u0447\u043A\u0438 \u043F\u0440\u0438\u0432'\u044F\u0437\u043A\u0438","preferences.clone.handles":"\u0420\u0443\u0447\u043A\u0438 \u043A\u043B\u043E\u043D\u0443\u0432\u0430\u043D\u043D\u044F",undo:"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438",redo:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438",cut:"\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438",copy:"\u0421\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438",paste:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438","copy.as":"\u0421\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u044F\u043A","export.as":"\u0415\u043A\u0441\u043F\u043E\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u044F\u043A","select.all":"\u041E\u0431\u0440\u0430\u0442\u0438 \u0432\u0441\u0435","select.none":"\u0417\u043D\u044F\u0442\u0438 \u0432\u0438\u0434\u0456\u043B\u0435\u043D\u043D\u044F",delete:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438","new.project":"\u041D\u043E\u0432\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442",open:"\u0412\u0456\u0434\u043A\u0440\u0438\u0442\u0438",save:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438","save.as":"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u044F\u043A","upload.media":"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043C\u0435\u0434\u0456\u0430","create.page":"\u0421\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443","new.page":"\u041D\u043E\u0432\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430","page.name":"\u041D\u0430\u0437\u0432\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438",duplicate:"\u0414\u0443\u0431\u043B\u044E\u0432\u0430\u0442\u0438",cancel:"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438","copy.invite.link":"\u0421\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044F","create.multiplayer.project":"\u0421\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u0431\u0430\u0433\u0430\u0442\u043E\u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044C\u043A\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442","copy.multiplayer.project":"\u0421\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u0432 \u0431\u0430\u0433\u0430\u0442\u043E\u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044C\u043A\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442",select:"\u0412\u0438\u0431\u0438\u0440\u0430\u0442\u0438",eraser:"\u041B\u0430\u0441\u0442\u0438\u043A",draw:"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438",arrow:"\u0421\u0442\u0440\u0456\u043B\u043A\u0430",text:"\u0422\u0435\u043A\u0441\u0442",sticky:"\u041D\u043E\u0442\u0430\u0442\u043A\u0430",rectangle:"\u041F\u0440\u044F\u043C\u043E\u043A\u0443\u0442\u043D\u0438\u043A",ellipse:"\u0415\u043B\u0456\u043F\u0441",triangle:"\u0422\u0440\u0438\u043A\u0443\u0442\u043D\u0438\u043A",line:" \u041B\u0456\u043D\u0456\u044F",rotate:"\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u0438","lock.aspect.ratio":"\u0417\u0430\u0431\u043B\u043E\u043A\u0443\u0432\u0430\u0442\u0438 \u0441\u043F\u0456\u0432\u0432\u0456\u0434\u043D\u043E\u0448\u0435\u043D\u043D\u044F \u0441\u0442\u043E\u0440\u0456\u043D","unlock.aspect.ratio":" \u0420\u043E\u0437\u0431\u043B\u043E\u043A\u0443\u0432\u0430\u0442\u0438 \u0441\u043F\u0456\u0432\u0432\u0456\u0434\u043D\u043E\u0448\u0435\u043D\u043D\u044F \u0441\u0442\u043E\u0440\u0456\u043D",group:"\u0417\u0433\u0440\u0443\u043F\u0443\u0432\u0430\u0442\u0438",ungroup:" \u0420\u043E\u0437\u0433\u0440\u0443\u043F\u0443\u0432\u0430\u0442\u0438","move.to.back":"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u043D\u0430\u0437\u0430\u0434","move.backward":"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u043D\u0430 \u0437\u0430\u0434\u043D\u0456\u0439 \u043F\u043B\u0430\u043D","move.forward":"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u0432\u043F\u0435\u0440\u0435\u0434","move.to.front":"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u043D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0456\u0439 \u043F\u043B\u0430\u043D","reset.angle":"\u0421\u043A\u0438\u0434\u0430\u043D\u043D\u044F \u043A\u0443\u0442\u0430",lock:"\u0411\u043B\u043E\u043A\u0443\u0432\u0430\u043D\u043D\u044F",unlock:" \u0420\u043E\u0437\u0431\u043B\u043E\u043A\u0443\u0432\u0430\u043D\u043D\u044F","move.to.page":"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443","flip.horizontal":"\u041F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0443\u0442\u0438 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","flip.vertical":"\u041F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0443\u0442\u0438 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E",move:"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438","to.front":"\u041D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0456\u0439 \u043F\u043B\u0430\u043D",forward:" \u0412\u043F\u0435\u0440\u0435\u0434",backward:"\u041D\u0430 \u0437\u0430\u0434\u043D\u0456\u0439 \u043F\u043B\u0430\u043D",back:"\u041D\u0430\u0437\u0430\u0434",language:"\u041C\u043E\u0432\u0430"};var id={"style.menu.color":"\u989C\u8272","style.menu.fill":"\u586B\u5145","style.menu.dash":"\u8FB9\u6846","style.menu.size":"\u5C3A\u5BF8","style.menu.keep.open":"\u4FDD\u6301\u5E38\u5F00","style.menu.font":"\u5B57\u4F53","style.menu.align":"\u5BF9\u9F50",styles:"\u6837\u5F0F","zoom.in":"\u653E\u5927","zoom.out":"\u7F29\u5C0F",to:"\u7F29\u653E\u81F3","menu.tools":"\u5DE5\u5177","menu.transform":"\u8F6C\u6362","menu.file":"\u6587\u4EF6","menu.edit":"\u7F16\u8F91","menu.view":"\u89C6\u56FE","menu.preferences":"\u504F\u597D","menu.sign.in":"\u767B\u5F55","menu.sign.out":"\u767B\u51FA",search:"\u641C\u7D22","become.a.sponsor":"\u6210\u4E3A\u8D5E\u52A9\u8005","zoom.to.selection":"\u7F29\u653E\u9009\u4E2D","zoom.to.fit":"\u81EA\u9002\u5E94\u7F29\u653E","zoom.to":"\u7F29\u653E\u81F3","zoom.to.content":"\u7F29\u653E\u81F3\u5185\u5BB9","preferences.dark.mode":"\u6697\u9ED1\u6A21\u5F0F","preferences.focus.mode":"\u4E13\u6CE8\u6A21\u5F0F","preferences.debug.mode":"\u8C03\u8BD5\u6A21\u5F0F","preferences.show.grid":"\u663E\u793A\u7F51\u683C","preferences.use.cad.selection":"\u4F7F\u7528 CAD \u9009\u62E9","preferences.keep.stylemenu.open":"\u4FDD\u6301\u6837\u5F0F\u83DC\u5355\u5E38\u5F00","preferences.always.show.snaps":"\u603B\u662F\u5C55\u793A\u5BF9\u9F50\u7EBF","preferences.rotate.handles":"\u65CB\u8F6C\u624B\u67C4","preferences.binding.handles":"\u6346\u7ED1\u624B\u67C4","preferences.clone.handles":"\u514B\u9686\u624B\u67C4",undo:"\u64A4\u9500",redo:"\u91CD\u505A",cut:"\u526A\u5207",copy:"\u590D\u5236",paste:"\u7C98\u8D34","copy.as":"\u590D\u5236\u4E3A","export.as":"\u5BFC\u51FA\u4E3A","select.all":"\u9009\u4E2D\u5168\u90E8","select.none":"\u53D6\u6D88\u9009\u4E2D",delete:"\u5220\u9664","new.project":"\u65B0\u9879\u76EE",open:"\u6253\u5F00",save:"\u4FDD\u5B58","save.as":"\u4FDD\u5B58\u4E3A","upload.media":"\u4E0A\u4F20\u5A92\u4F53\u6587\u4EF6","create.page":"\u521B\u5EFA\u9875\u9762","new.page":"\u65B0\u9875\u9762","page.name":"\u9875\u9762\u540D\u79F0",duplicate:"\u590D\u5236",cancel:"\u53D6\u6D88","copy.invite.link":"\u590D\u5236\u9080\u8BF7\u94FE\u63A5","create.multiplayer.project":"\u521B\u5EFA\u591A\u4EBA\u9879\u76EE","copy.multiplayer.project":"\u590D\u5236\u5230\u591A\u4EBA\u9879\u76EE",select:"\u9009\u62E9",eraser:"\u6A61\u76AE",draw:"\u753B\u7B14",arrow:"\u7BAD\u5934",text:"\u6587\u672C",sticky:"\u4FBF\u5229\u8D34",rectangle:"\u77E9\u5F62",ellipse:"\u692D\u5706\u5F62",triangle:"\u4E09\u89D2\u5F62",line:"\u76F4\u7EBF",rotate:"\u65CB\u8F6C","lock.aspect.ratio":"\u9501\u5B9A\u5BBD\u9AD8\u6BD4","unlock.aspect.ratio":"\u89E3\u9501\u5BBD\u9AD8\u6BD4",group:"\u5206\u7EC4",ungroup:"\u53D6\u6D88\u5206\u7EC4","move.to.back":"\u7F6E\u5E95","move.backward":"\u4E0B\u79FB\u4E00\u5C42","move.forward":"\u4E0A\u79FB\u4E00\u5C42","move.to.front":"\u7F6E\u9876","reset.angle":"\u91CD\u7F6E\u65CB\u8F6C\u89D2\u5EA6",lock:"\u9501\u5B9A",unlock:"\u89E3\u9501","move.to.page":"\u79FB\u52A8\u5230\u9875\u9762","flip.horizontal":"\u6C34\u5E73\u7FFB\u8F6C","flip.vertical":"\u5782\u76F4\u7FFB\u8F6C",move:"\u79FB\u52A8","to.front":"\u7F6E\u9876",forward:"\u4E0A\u4E00\u5C42",backward:"\u4E0B\u4E00\u5C42",back:"\u7F6E\u5E95",language:"\u8BED\u8A00","keyboard.shortcuts":"\u952E\u76D8\u5FEB\u6377\u952E","translation.link":"\u4E86\u89E3\u66F4\u591A",page:"\u9875\u9762","dock.position":"\u951A\u70B9\u4F4D\u7F6E",bottom:"\u4E0B\u9762",left:"\u5DE6\u9762",right:"\u53F3\u9762",top:"\u4E0A\u9762","export.background":"\u5BFC\u51FA\u80CC\u666F\u8272",transparent:"\u900F\u660E",auto:"\u81EA\u52A8",light:"\u660E\u4EAE",dark:"\u6697\u9ED1","copy.readonly.link":"\u590D\u5236\u53EA\u8BFB\u94FE\u63A5",image:"\u56FE\u7247","align.distribute":"\u5BF9\u9F50 / \u5206\u6563","dialog.save.firsttime":"\u60A8\u662F\u5426\u60F3\u4FDD\u5B58\u5F53\u524D\u7684\u9879\u76EE\uFF1F","dialog.save.again":"\u60A8\u662F\u5426\u60F3\u4FDD\u5B58\u5BF9\u5F53\u524D\u9879\u76EE\u7684\u66F4\u6539\uFF1F","dialog.cancel":"\u53D6\u6D88","dialog.no":"\u5426","dialog.yes":"\u662F"};var sd={"style.menu.color":"\u984F\u8272","style.menu.fill":"\u586B\u5145","style.menu.dash":"\u865B\u7DDA","style.menu.size":"\u5927\u5C0F","style.menu.keep.open":"\u4FDD\u6301\u958B\u555F","style.menu.font":"\u5B57\u578B","style.menu.align":"\u5C0D\u9F4A",styles:"\u6A23\u5F0F","zoom.in":"\u653E\u5927","zoom.out":"\u7E2E\u5C0F",to:"\u81F3","menu.file":"\u6A94\u6848","menu.edit":"\u7DE8\u8F2F","menu.view":"\u6AA2\u8996","menu.preferences":"\u9078\u9805","menu.sign.in":"\u767B\u5165","menu.sign.out":"\u767B\u51FA","become.a.sponsor":"\u6210\u70BA\u8D0A\u52A9\u8005","zoom.to.selection":"\u7E2E\u653E\u81F3\u9078\u53D6\u7BC4\u570D","zoom.to.fit":"\u7E2E\u653E\u81F3\u9069\u7576\u5927\u5C0F","zoom.to":"\u7E2E\u653E\u81F3","preferences.dark.mode":"\u6DF1\u8272\u6A21\u5F0F","preferences.focus.mode":"\u5C08\u6CE8\u6A21\u5F0F","preferences.debug.mode":"\u9664\u932F\u6A21\u5F0F","preferences.show.grid":"\u986F\u793A\u7DB2\u683C","preferences.use.cad.selection":"\u4F7F\u7528 CAD \u9078\u53D6","preferences.keep.stylemenu.open":"\u6A23\u5F0F\u9078\u55AE\u4FDD\u6301\u958B\u555F","preferences.always.show.snaps":"\u6C38\u9060\u986F\u793A\u5C0D\u9F4A\u7DDA","preferences.rotate.handles":"\u65CB\u8F49\u63A7\u9EDE","preferences.binding.handles":"\u7D81\u5B9A\u63A7\u9EDE","preferences.clone.handles":"\u8907\u88FD\u63A7\u9EDE",undo:"\u5FA9\u539F",redo:"\u53D6\u6D88\u5FA9\u539F",cut:"\u526A\u4E0B",copy:"\u8907\u88FD",paste:"\u8CBC\u4E0A","copy.as":"\u8907\u88FD\u6210","export.as":"\u532F\u51FA\u6210","select.all":"\u5168\u9078","select.none":"\u53D6\u6D88\u9078\u53D6",delete:"\u522A\u9664","new.project":"\u65B0\u5C08\u6848",open:"\u958B\u555F",save:"\u5132\u5B58","save.as":"\u53E6\u5B58\u70BA","upload.media":"\u4E0A\u50B3\u5A92\u9AD4","create.page":"\u5EFA\u7ACB\u9801\u9762","new.page":"\u65B0\u9801\u9762","page.name":"\u9801\u9762\u540D\u7A31",duplicate:"\u8907\u88FD",cancel:"\u53D6\u6D88","copy.invite.link":"\u8907\u88FD\u9080\u8ACB\u9023\u7D50","copy.readonly.link":"\u8907\u88FD\u552F\u8B80\u9023\u7D50","create.multiplayer.project":"\u5EFA\u7ACB\u591A\u4EBA\u5C08\u6848","copy.multiplayer.project":"\u8907\u88FD\u81F3\u591A\u4EBA\u5C08\u6848",select:"\u9078\u53D6",eraser:"\u6A61\u76AE\u64E6",draw:"\u624B\u7E6A",arrow:"\u7BAD\u982D",text:"\u6587\u5B57",sticky:"\u4FBF\u5229\u8CBC",rectangle:"\u9577\u65B9\u5F62",ellipse:"\u6A62\u5713\u5F62",triangle:"\u4E09\u89D2\u5F62",line:"\u76F4\u7DDA",rotate:"\u65CB\u8F49","lock.aspect.ratio":"\u9396\u5B9A\u9577\u5BEC\u6BD4","unlock.aspect.ratio":"\u89E3\u9396\u9577\u5BEC\u6BD4",group:"\u7D44\u6210\u7FA4\u7D44",ungroup:"\u53D6\u6D88\u7FA4\u7D44","move.to.back":"\u79FB\u5230\u6700\u4E0B\u5C64","move.backward":"\u4E0B\u79FB\u4E00\u5C64","move.forward":"\u4E0A\u79FB\u4E00\u5C64","move.to.front":"\u79FB\u5230\u6700\u4E0A\u5C64","reset.angle":"\u91CD\u8A2D\u89D2\u5EA6",lock:"\u9396\u5B9A",unlock:"\u89E3\u9396","move.to.page":"\u79FB\u81F3\u9801\u9762","flip.horizontal":"\u6C34\u5E73\u7FFB\u8F49","flip.vertical":"\u5782\u76F4\u7FFB\u8F49",move:"\u79FB\u52D5","to.front":"\u5230\u6700\u4E0A\u5C64",forward:"\u5230\u4E0A\u4E00\u5C64",backward:"\u5230\u4E0B\u4E00\u5C64",back:"\u5230\u6700\u4E0B\u5C64",language:"\u8A9E\u8A00","translation.link":"\u4E86\u89E3\u8A73\u60C5","dock.position":"\u5DE5\u5177\u5217\u4F4D\u7F6E",bottom:"\u4E0B\u65B9",left:"\u5DE6\u5074",right:"\u53F3\u5074",top:"\u4E0A\u65B9",page:"\u9801\u9762"};var ad=[{locale:"ar",label:"\u0639\u0631\u0628\u064A",messages:Ml},{locale:"da",label:"Danish",messages:Ll},{locale:"de",label:"Deutsch",messages:Al},{locale:"en",label:"English",messages:Vl},{locale:"es",label:"Espa\xF1ol",messages:Hl},{locale:"fa",label:"\u0641\u0627\u0631\u0633\u06CC",messages:zl},{locale:"fr",label:"Fran\xE7ais",messages:Fl},{locale:"gl",label:"Galego",messages:Ol},{locale:"he",label:"\u05E2\u05D1\u05E8\u05D9\u05EA",messages:$l},{locale:"it",label:"Italiano",messages:Gl},{locale:"ja",label:"\u65E5\u672C\u8A9E",messages:jl},{locale:"ko-kr",label:"\uD55C\uAD6D\uC5B4",messages:Wl},{locale:"my",label:"\u1019\u103C\u1014\u103A\u1019\u102C\u1005\u102C",messages:Kl},{locale:"nb-no",label:"Norwegian Bokm\xE5l",messages:_l},{locale:"ne",label:"\u0928\u0947\u092A\u093E\u0932\u0940",messages:Yl},{locale:"nn-no",label:"Norwegian Nynorsk",messages:Xl},{locale:"pl",label:"Polski",messages:Zl},{locale:"pt",label:"Portugu\xEAs - Europeu",messages:Jl},{locale:"pt-br",label:"Portugu\xEAs - Brasil",messages:ql},{locale:"ru",label:"Russian",messages:Ql},{locale:"sv",label:"Svenska",messages:ed},{locale:"te",label:"\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41",messages:td},{locale:"tr",label:"T\xFCrk\xE7e",messages:od},{locale:"uk",label:"Ukrainian",messages:rd},{locale:"zh-ch",label:"\u7B80\u4F53\u4E2D\u6587",messages:id},{locale:"zh-tw",label:"\u7E41\u9AD4\u4E2D\u6587 (\u53F0\u7063)",messages:sd},{locale:"th",label:"\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22",messages:nd},{locale:"ku",label:"\u06A9\u0648\u0631\u062F\u06CC",messages:Nl}];ad.sort((i,o)=>i.locale<o.locale?-1:1);function ld(i){var e;let o=ad.find(t=>t.locale===i);return{locale:i,label:(e=o==null?void 0:o.label)!=null?e:i,messages:S(S({},Ul),o==null?void 0:o.messages)}}function cd(i){return dd.useMemo(()=>{let o=typeof navigator!="undefined"?navigator.language.split(/[-_]/)[0]:"en";return ld(i!=null?i:o)},[i])}import*as li from"react";var $s=li.createContext({}),ti=()=>{let i=li.useContext($s);if(!i)throw new Error("useCtx must be inside a Provider with a value");return i};import{jsx as di,jsxs as Rh}from"react/jsx-runtime";var xt=Sr.forwardRef((h,u)=>{var g=h,{onSelect:i,onClick:o,onDoubleClick:e,variant:t,children:n,isToolLocked:r=!1,disabled:s=!1,isActive:l=!1,onKeyDown:a,id:c}=g,p=Be(g,["onSelect","onClick","onDoubleClick","variant","children","isToolLocked","disabled","isActive","onKeyDown","id"]);return Rh(Ih,w(S({ref:u,isActive:l,variant:t,onClick:o,disabled:s,onPointerDown:i,onDoubleClick:e,onKeyDown:a,bp:nn,id:c},p),{children:[di(sn,{children:n}),r&&di(Ph,{})]}))});function Gs(r){var s=r,{label:i,kbd:o,variant:e,isLocked:t}=s,n=Be(s,["label","kbd","variant","isLocked"]);let l=N(),a=Sr.useCallback(()=>{l.toggleToolLock()},[]),c=Sr.useCallback(p=>{p.key===" "&&l.isForcePanning&&p.preventDefault()},[]);return di(Qr,{label:i[0].toUpperCase()+i.slice(1),kbd:o,children:di(xt,w(S({},n),{variant:e,isToolLocked:t&&n.isActive,onDoubleClick:a,onKeyDown:c,"aria-label":i[0].toUpperCase()+i.slice(1)}))})}var sn=P("div",{position:"relative",height:"100%",width:"100%",backgroundColor:"$panel",borderRadius:"$2",margin:"0",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"$ui",color:"inherit",userSelect:"none",WebkitUserSelect:"none",boxSizing:"border-box",border:"1px solid transparent","-webkit-tap-highlight-color":"transparent","tap-highlight-color":"transparent"}),Ih=P("button",{position:"relative",color:"$text",fontSize:"$0",background:"none",margin:"0",padding:"$2",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",cursor:"pointer",pointerEvents:"all",height:"40px",width:"40px",border:"1px solid $panel","-webkit-tap-highlight-color":"transparent","tap-highlight-color":"transparent",[`&:disabled ${sn}`]:{opacity:.618},variants:{variant:{primary:{marginTop:"0"},icon:{[`& ${sn}`]:{display:"grid","& > *":{gridRow:1,gridColumn:1}}},text:{width:"auto",[`& ${sn}`]:{fontSize:"$1",padding:"0 $3",gap:"$3"}},circle:{padding:0,height:32,width:32,border:"none",[`& ${sn}`]:{border:"1px solid $panelContrast",borderRadius:"100%",boxShadow:"$panel"},[`& ${sn} > svg`]:{width:14,height:14}}},isActive:{true:{},false:{}},bp:{mobile:{padding:0},small:{}}},compoundVariants:[{variant:"primary",bp:"mobile",css:{height:40,width:36,[`& ${sn} > svg`]:{width:16,height:16}}},{variant:"primary",bp:"small",css:{height:"40px",width:"40px",[`& ${sn} > svg`]:{width:20,height:20}}},{isActive:!0,css:{[`${sn}`]:{backgroundColor:"$selected",color:"$selectedContrast"}}},{isActive:!1,bp:"small",css:{[`&:hover:not(:disabled) ${sn}`]:{backgroundColor:"$hover"},[`&:focus:not(:disabled) ${sn}`]:{backgroundColor:"$hover"}}}]}),Ph=P("div",{position:"absolute",width:10,height:10,backgroundColor:"$selected",borderRadius:"100%",bottom:-2,border:"2px solid $panel",zIndex:100});import{jsx as an,jsxs as Ah}from"react/jsx-runtime";var js=["rectangle","ellipse","triangle","line"],pd={["rectangle"]:an(Eh,{}),["ellipse"]:an(Dh,{}),["triangle"]:an(Bh,{}),["line"]:an(Pl,{})},Lh=i=>i.settings.dockPosition,ud=Sn.memo(function({activeTool:o,isToolLocked:e}){let t=N(),n=Mh(),r=t.useStore(Lh),[s,l]=Sn.useState("rectangle");Sn.useEffect(()=>{js.includes(o)&&s!==o&&l(o)},[o]);let a=Sn.useCallback(()=>{t.selectTool(s)},[o,t]),c=Sn.useCallback(()=>{t.toggleToolLock()},[t]),p=Sn.useCallback(m=>{m.key===" "&&t.shiftKey&&m.preventDefault()},[]),u=js.includes(o),h=r==="bottom"||r==="top"?"top":r,g=r==="bottom"||r==="top"?"row":"column";return Ah(Xn.Root,{dir:"ltr",onOpenChange:a,children:[an(Xn.Trigger,{dir:"ltr",asChild:!0,id:"TD-PrimaryTools-Shapes",children:an(xt,{disabled:u&&t.shiftKey,variant:"primary",onDoubleClick:c,isToolLocked:u&&e,isActive:u,onKeyDown:p,"aria-label":n.formatMessage({id:"shapes"}),children:pd[s]})}),an(Xn.Content,{asChild:!0,side:h,sideOffset:12,children:an(mr,{side:"center",style:{flexDirection:g},children:js.map((m,f)=>an(Qr,{label:n.formatMessage({id:m}),kbd:(4+f).toString(),id:`TD-PrimaryTools-Shapes-${m}`,children:an(Xn.Item,{asChild:!0,children:an(xt,{"aria-label":n.formatMessage({id:m}),variant:"primary",onClick:()=>{t.selectTool(m),l(m)},children:pd[m]})})},m))})})]})});import{jsx as ye,jsxs as hd}from"react/jsx-runtime";var jh=i=>i.appState.activeTool,Wh=i=>i.appState.isToolLocked,Nh=i=>i.settings.canvasMode,md=Ft.memo(function(){let o=N(),e=Gh(),t=o.useStore(jh),n=o.useStore(Wh),r=o.useStore(Nh),s=Ft.useCallback(()=>o.selectTool("select"),[o]),l=Ft.useCallback(()=>o.selectTool("erase"),[o]),a=Ft.useCallback(()=>o.selectTool("draw"),[o]),c=Ft.useCallback(()=>o.selectTool("pen"),[o]),p=Ft.useCallback(()=>o.selectTool("arrow"),[o]),u=Ft.useCallback(()=>o.selectTool("text"),[o]),h=Ft.useCallback(()=>o.selectTool("sticky"),[o]),g=Ft.useCallback(()=>z(this,null,function*(){return o.openAsset()}),[o]),m=Ft.useCallback(()=>o.toggleCanvasMode(),[o]),f=Ft.useCallback(v=>{v.stopPropagation()},[]);return ye(Uh,{onPointerDown:f,children:hd(Kh,{children:[ye(Mn,{onClick:s,isActive:t==="select",title:e.formatMessage({id:"select"}),children:ye(Hh,{})}),ye(Ws,{}),ye(Mn,{onClick:a,isActive:t==="draw",title:e.formatMessage({id:"draw"}),children:ye(Fh,{})}),ye(Mn,{onClick:c,isActive:t==="pen",title:"Pen",children:ye(Oh,{})}),ye(Mn,{onClick:l,isActive:t==="erase",title:e.formatMessage({id:"eraser"}),children:ye(wl,{})}),ye(Ws,{}),ye(_h,{children:ye(ud,{activeTool:t,isToolLocked:n})}),ye(Mn,{onClick:p,isActive:t==="arrow",title:e.formatMessage({id:"arrow"}),children:ye(Vh,{})}),ye(Mn,{onClick:u,isActive:t==="text",title:e.formatMessage({id:"text"}),children:ye($h,{})}),ye(Mn,{onClick:h,isActive:t==="sticky",title:"Sticky Note",children:hd("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:[ye("rect",{x:"2",y:"2",width:"11",height:"11",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),ye("line",{x1:"5",y1:"6",x2:"10",y2:"6",stroke:"currentColor",strokeWidth:"1"}),ye("line",{x1:"5",y1:"9",x2:"8",y2:"9",stroke:"currentColor",strokeWidth:"1"})]})}),ye(Mn,{onClick:g,title:e.formatMessage({id:"image"}),children:ye(zh,{})}),ye(Ws,{}),ye(Mn,{onClick:m,isActive:r==="straight",title:r==="freehand"?"Straight mode":"Freehand mode",children:r==="freehand"?ye("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:ye("path",{d:"M2 12C4 8 6 4 8 6C10 8 11 3 13 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"})}):ye("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:ye("path",{d:"M2 12L7.5 3L13 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})})})]})})}),Uh=P("div",{position:"absolute",bottom:"16px",left:"50%",transform:"translateX(-50%)",zIndex:300,pointerEvents:"all"}),Kh=P("div",{display:"flex",alignItems:"center",gap:"2px",padding:"6px 8px",background:"$panel",borderRadius:"$pill",boxShadow:"0 2px 16px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.06)",backdropFilter:"blur(12px)"}),Mn=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",borderRadius:"$2",color:"$textSecondary",cursor:"pointer",transition:"all 0.12s ease",flexShrink:0,"& svg":{width:"16px",height:"16px"},"&:hover":{background:"$hover",color:"$text"},variants:{isActive:{true:{background:"$accent",color:"white","&:hover":{background:"$accent",color:"white"}}}}}),Ws=P("div",{width:"1px",height:"20px",background:"$separator",margin:"0 4px",flexShrink:0,opacity:.5}),_h=P("div",{display:"flex","& button":{width:"36px",height:"36px",padding:0,borderRadius:"$2",border:"none"},'& [class*="StyledToolButtonInner"]':{borderRadius:"$2",background:"transparent"}});import*as Ce from"@radix-ui/react-context-menu";import{AlignBottomIcon as Qh,AlignCenterHorizontallyIcon as em,AlignCenterVerticallyIcon as tm,AlignLeftIcon as nm,AlignRightIcon as om,AlignTopIcon as rm,SpaceEvenlyHorizontallyIcon as im,SpaceEvenlyVerticallyIcon as sm,StretchHorizontallyIcon as am,StretchVerticallyIcon as lm}from"@radix-ui/react-icons";import*as de from"react";import{FormattedMessage as We,useIntl as dm}from"react-intl";var ve=P("hr",{height:0,paddingTop:1,width:"calc(100%+8px)",backgroundColor:"$hover",border:"none",margin:"$2 -4px"});var Ln=P("div",{position:"relative",overflow:"hidden",userSelect:"none",WebkitUserSelect:"none",display:"flex",flexDirection:"column",zIndex:99997,minWidth:180,pointerEvents:"all",backgroundColor:"$panel",border:"1px solid $panelContrast",boxShadow:"$panel",padding:"$2 $2",borderRadius:"$3",font:"$ui",maxHeight:"100vh",overflowY:"auto",overflowX:"hidden","&::webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none",variants:{size:{small:{minWidth:72}},overflow:{true:{maxHeight:"60vh"}}}});import{ItemIndicator as Yh}from"@radix-ui/react-dropdown-menu";import{CheckIcon as Xh,ChevronRightIcon as Zh}from"@radix-ui/react-icons";import*as gd from"react";var Rt=P("div",{height:"100%",borderRadius:"4px",marginRight:"1px",width:"fit-content",display:"grid",alignItems:"center",justifyContent:"center",outline:"none",border:"none",pointerEvents:"all",cursor:"pointer",color:"currentColor","& svg":{height:16,width:16,strokeWidth:1},"& > *":{gridRow:1,gridColumn:1}});import{jsx as fo,jsxs as Jh}from"react/jsx-runtime";var Je=gd.forwardRef((u,p)=>{var h=u,{onClick:i,isActive:o=!1,isWarning:e=!1,hasIndicator:t=!1,hasArrow:n=!1,disabled:r=!1,variant:s,kbd:l,children:a}=h,c=Be(h,["onClick","isActive","isWarning","hasIndicator","hasArrow","disabled","variant","kbd","children"]);return fo(qh,w(S({ref:p,bp:nn,isWarning:e,isActive:o,disabled:r,onClick:i,variant:s},c),{children:Jh(fd,{children:[a,l?fo(Jr,{variant:"menu",children:l}):void 0,t&&fo(Yh,{dir:"ltr",children:fo(Rt,{children:fo(Xh,{})})}),n&&fo(Rt,{children:fo(Zh,{})})]})}))}),fd=P("div",{height:"100%",width:"100%",backgroundColor:"$panel",borderRadius:"$2",display:"flex",gap:"$1",flexDirection:"row",alignItems:"center",padding:"0 $3",justifyContent:"space-between",border:"1px solid transparent","& svg":{position:"relative",stroke:"$overlay",strokeWidth:1,zIndex:1},[`& > ${Rt}`]:{paddingLeft:"$3"}}),qh=P("button",{position:"relative",width:"100%",background:"none",border:"none",cursor:"pointer",height:32,minHeight:32,outline:"none",color:"$text",fontFamily:"$ui",fontWeight:400,fontSize:"$1",borderRadius:4,userSelect:"none",WebkitUserSelect:"none",margin:0,padding:"0 0","&[data-disabled]":{opacity:.3},"&:disabled":{opacity:.3},[`&:focus:not(:disabled) ${fd}`]:{backgroundColor:"$hover"},"& a":{textDecoration:"none",color:"$text"},variants:{bp:{mobile:{},small:{}},variant:{styleMenu:{margin:"$1 0 $1 0"},wide:{gridColumn:"1 / span 4"}},size:{icon:{padding:"4px ",width:"auto"}},isWarning:{true:{color:"$warn"}},isActive:{true:{backgroundColor:"$hover"},false:{}}}});import{Fragment as pi,jsx as V,jsxs as kt}from"react/jsx-runtime";var cm=i=>i.document.pageStates[i.appState.currentPageId].selectedIds.length,pm=i=>i.settings.isDebugMode,um=i=>i.document.pageStates[i.appState.currentPageId].selectedIds.some(o=>i.document.pages[i.appState.currentPageId].shapes[o].children!==void 0),hm=i=>i.stopPropagation(),mm=({onBlur:i,children:o})=>{let e=rn();return kt(Ce.Root,{dir:"ltr",children:[V(Ce.Trigger,{dir:"ltr",children:o}),V(Ce.Portal,{container:e.current,children:V(Ce.Content,{onEscapeKeyDown:hm,tabIndex:-1,onBlur:i,asChild:!0,children:V(Ln,{id:"TD-ContextMenu",children:V(gm,{})})})})]})},gm=de.memo(function(){let o=N(),e=dm(),t=o.useStore(cm),n=o.useStore(pm),r=o.useStore(um),s=de.useCallback(()=>{o.flipHorizontal()},[o]),l=de.useCallback(()=>{o.flipVertical()},[o]),a=de.useCallback(()=>{o.duplicate()},[o]),c=de.useCallback(()=>{o.toggleLocked()},[o]),p=de.useCallback(()=>{o.group()},[o]),u=de.useCallback(()=>{o.moveToBack()},[o]),h=de.useCallback(()=>{o.moveBackward()},[o]),g=de.useCallback(()=>{o.moveForward()},[o]),m=de.useCallback(()=>{o.moveToFront()},[o]),f=de.useCallback(()=>{o.delete()},[o]),v=de.useCallback(()=>{o.cut()},[o]),b=de.useCallback(()=>{o.copy()},[o]),T=de.useCallback(()=>{o.paste()},[o]),y=de.useCallback(()=>{o.copyImage("svg",{scale:1,quality:1,transparentBackground:!1})},[o]),x=de.useCallback(()=>{o.copyImage("png",{scale:2,quality:1,transparentBackground:!0})},[o]),I=de.useCallback(()=>{o.undo()},[o]),k=de.useCallback(()=>{o.redo()},[o]),R=de.useCallback(()=>z(this,null,function*(){o.exportImage("png",{scale:2,quality:1})}),[o]),C=de.useCallback(()=>z(this,null,function*(){o.exportImage("jpeg",{scale:2,quality:1})}),[o]),E=de.useCallback(()=>z(this,null,function*(){o.exportImage("webp",{scale:2,quality:1})}),[o]),M=de.useCallback(()=>z(this,null,function*(){o.exportImage("svg",{scale:1,quality:1})}),[o]),L=de.useCallback(()=>z(this,null,function*(){o.copyJson()}),[o]),A=de.useCallback(()=>z(this,null,function*(){o.exportJson()}),[o]),K=de.useCallback(()=>z(this,null,function*(){o.convertToImage()}),[o]),re=t>0,F=t>1,ee=t>2,pe=t===1?o.getShape(o.selectedIds[0],o.currentPageId):null,he=(pe==null?void 0:pe.type)==="reactComponent";return V(pi,{children:re?kt(pi,{children:[V(me,{onClick:a,kbd:"#D",id:"TD-ContextMenu-Duplicate",children:V(We,{id:"duplicate"})}),V(me,{onClick:s,kbd:"\u21E7H",id:"TD-ContextMenu-Flip_Horizontal",children:V(We,{id:"flip.horizontal"})}),V(me,{onClick:l,kbd:"\u21E7V",id:"TD-ContextMenu-Flip_Vertical",children:V(We,{id:"flip.vertical"})}),kt(me,{onClick:c,kbd:"#\u21E7L",id:"TD-ContextMenu- Lock_Unlock",children:[V(We,{id:"lock"})," / ",V(We,{id:"unlock"})]}),(F||r)&&V(ve,{}),F&&V(me,{onClick:p,kbd:"#G",id:"TD-ContextMenu-Group",children:V(We,{id:"group"})}),r&&V(me,{onClick:p,kbd:"#G",id:"TD-ContextMenu-Ungroup",children:V(We,{id:"ungroup"})}),V(ve,{}),kt(ci,{label:e.formatMessage({id:"move"}),id:"TD-ContextMenu-Move",children:[V(me,{onClick:m,kbd:"\u21E7]",id:"TD-ContextMenu-Move-To_Front",children:V(We,{id:"to.front"})}),V(me,{onClick:g,kbd:"]",id:"TD-ContextMenu-Move-Forward",children:V(We,{id:"forward"})}),V(me,{onClick:h,kbd:"[",id:"TD-ContextMenu-Move-Backward",children:V(We,{id:"backward"})}),V(me,{onClick:u,kbd:"\u21E7[",id:"TD-ContextMenu-Move-To_Back",children:V(We,{id:"back"})})]}),V(vm,{}),F&&V(fm,{hasTwoOrMore:F,hasThreeOrMore:ee}),V(ve,{}),V(me,{onClick:v,kbd:"#X",id:"TD-ContextMenu-Cut",children:V(We,{id:"cut"})}),V(me,{onClick:b,kbd:"#C",id:"TD-ContextMenu-Copy",children:V(We,{id:"copy"})}),V(me,{onClick:T,kbd:"#V",id:"TD-ContextMenu-Paste",children:V(We,{id:"paste"})}),V(ve,{}),kt(ci,{label:`${e.formatMessage({id:"copy.as"})}...`,size:"small",id:"TD-ContextMenu-Copy-As",children:[V(me,{onClick:y,id:"TD-ContextMenu-Copy-as-SVG",children:"SVG"}),V(me,{onClick:x,id:"TD-ContextMenu-Copy-As-PNG",children:"PNG"}),n&&V(me,{onClick:L,id:"TD-ContextMenu-Copy_as_JSON",children:"JSON"})]}),kt(ci,{label:`${e.formatMessage({id:"export.as"})}...`,size:"small",id:"TD-ContextMenu-Export",children:[V(me,{onClick:M,id:"TD-ContextMenu-Export-SVG",children:"SVG"}),V(me,{onClick:R,id:"TD-ContextMenu-Export-PNG",children:"PNG"}),V(me,{onClick:C,id:"TD-ContextMenu-Export-JPG",children:"JPG"}),V(me,{onClick:E,id:"TD-ContextMenu-Export-WEBP",children:"WEBP"}),n&&V(me,{onClick:A,id:"TD-ContextMenu-Export-JSON",children:"JSON"})]}),V(ve,{}),he&&kt(pi,{children:[V(me,{onClick:K,id:"TD-ContextMenu-Convert-To-Image",children:"Convert to Image"}),V(ve,{})]}),V(me,{onClick:f,kbd:"\u232B",id:"TD-ContextMenu-Delete",children:V(We,{id:"delete"})})]}):kt(pi,{children:[V(me,{onClick:T,kbd:"#V",id:"TD-ContextMenu-Paste",children:V(We,{id:"paste"})}),V(me,{onClick:I,kbd:"#Z",id:"TD-ContextMenu-Undo",children:V(We,{id:"undo"})}),V(me,{onClick:k,kbd:"#\u21E7Z",id:"TD-ContextMenu-Redo",children:V(We,{id:"redo"})}),kt(ci,{label:`${e.formatMessage({id:"export.as"})}...`,size:"small",id:"TD-ContextMenu-Export",children:[V(me,{onClick:M,id:"TD-ContextMenu-Export-SVG",children:"SVG"}),V(me,{onClick:R,id:"TD-ContextMenu-Export-PNG",children:"PNG"}),V(me,{onClick:C,id:"TD-ContextMenu-Export-JPG",children:"JPG"}),V(me,{onClick:E,id:"TD-ContextMenu-Export-WEBP",children:"WEBP"}),n&&V(me,{onClick:A,id:"TD-ContextMenu-Export-JSON",children:"JSON"})]})]})})});function fm({hasThreeOrMore:i}){let o=N(),e=de.useCallback(()=>{o.align("top")},[o]),t=de.useCallback(()=>{o.align("centerVertical")},[o]),n=de.useCallback(()=>{o.align("bottom")},[o]),r=de.useCallback(()=>{o.stretch("vertical")},[o]),s=de.useCallback(()=>{o.distribute("vertical")},[o]),l=de.useCallback(()=>{o.align("left")},[o]),a=de.useCallback(()=>{o.align("centerHorizontal")},[o]),c=de.useCallback(()=>{o.align("right")},[o]),p=de.useCallback(()=>{o.stretch("horizontal")},[o]),u=de.useCallback(()=>{o.distribute("horizontal")},[o]),h=rn();return kt(Ce.Sub,{children:[V(Us,{id:"TD-ContextMenu-Align-Distribute-Trigger",children:V(We,{id:"align.distribute"})}),V(Ce.Portal,{container:h.current,children:V(Ce.SubContent,{asChild:!0,sideOffset:4,alignOffset:-2,children:kt(Sm,{numberOfSelected:i?"threeOrMore":"twoOrMore",children:[V(yn,{onClick:l,id:"TD-ContextMenu-Align_Distribute-AlignLeft",children:V(nm,{})}),V(yn,{onClick:a,id:"TD-ContextMenu-Align_Distribute-AlignCenterHorizontal",children:V(em,{})}),V(yn,{onClick:c,id:"TD-ContextMenu-Align_Distribute-AlignRight",children:V(om,{})}),V(yn,{onClick:p,id:"TD-ContextMenu-Align_Distribute-StretchHorizontal",children:V(am,{})}),i&&V(yn,{onClick:u,id:"TD-ContextMenu-Align_Distribute-SpaceEvenlyHorizontal",children:V(im,{})}),V(yn,{onClick:e,id:"TD-ContextMenu-Align_Distribute-AlignTop",children:V(rm,{})}),V(yn,{onClick:t,id:"TD-ContextMenu-Align_Distribute-AlignCenterVertical",children:V(tm,{})}),V(yn,{onClick:n,id:"TD-ContextMenu-Align_Distribute-AlignBottom",children:V(Qh,{})}),V(yn,{onClick:r,id:"TD-ContextMenu-Align_Distribute-StretchVertical",children:V(lm,{})}),i&&V(yn,{onClick:s,id:"TD-ContextMenu-Align_Distribute-SpaceEvenlyVertical",children:V(sm,{})}),V(Ns,{offset:13})]})})})]})}var Sm=P(Ln,{display:"grid",variants:{numberOfSelected:{threeOrMore:{gridTemplateColumns:"repeat(5, auto)"},twoOrMore:{gridTemplateColumns:"repeat(4, auto)"}}}}),ym=i=>i.appState.currentPageId,bm=i=>i.document.pages;function vm(){let i=N(),o=i.useStore(ym),e=i.useStore(bm),t=Object.values(e).sort((r,s)=>(r.childIndex||0)-(s.childIndex||0)).filter(r=>r.id!==o),n=rn();return t.length===0?null:kt(Ce.Sub,{children:[V(Us,{children:V(We,{id:"move.to.page"})}),V(Ce.Portal,{container:n.current,children:V(Ce.SubContent,{sideOffset:4,alignOffset:-2,asChild:!0,children:kt(Ln,{children:[t.map(({id:r,name:s},l)=>V(me,{disabled:r===o,onClick:()=>i.moveToPage(r),children:s||`Page ${l}`},r)),V(Ns,{offset:13})]})})})]})}function ci({children:i,label:o,size:e,id:t}){let n=rn();return kt(Ce.Sub,{children:[V(Us,{children:o}),V(Ce.Portal,{container:n.current,children:V(Ce.SubContent,{sideOffset:4,alignOffset:-2,asChild:!0,children:kt(Ln,{size:e,children:[i,V(Ns,{offset:13})]})})})]})}var Ns=P(Ce.ContextMenuArrow,{fill:"$panel"});function yn(e){var t=e,{onSelect:i}=t,o=Be(t,["onSelect"]);return V(Ce.ContextMenuItem,{dir:"ltr",onSelect:i,asChild:!0,children:V(xt,S({},o))})}var me=e=>{var t=e,{id:i}=t,o=Be(t,["id"]);return V(Ce.ContextMenuItem,{asChild:!0,id:i,children:V(Je,S({},o))})},Us=e=>{var t=e,{id:i}=t,o=Be(t,["id"]);return V(Ce.SubTrigger,{asChild:!0,id:i,children:V(Je,S({hasArrow:!0},o))})},Ks=de.memo(mm);import{jsx as An,jsxs as _s}from"react/jsx-runtime";function Ys({error:i,resetErrorBoundary:o}){let e=N(),t=()=>{window.location.reload(),o()},n=()=>{let l=document.createElement("textarea");l.value=i.message,document.body.appendChild(l),l.select(),document.execCommand("copy"),l.remove()},r=()=>{e.saveProjectAs()},s=()=>{e.resetDocument(),o()};return An(Tm,{children:_s(xm,{children:[An("div",{children:"We've encountered an error!"}),An("pre",{children:An("code",{children:i.message})}),_s(km,{children:[An(Je,{onClick:n,children:"Copy Error"}),An(Je,{onClick:t,children:"Refresh Page"})]}),An(ve,{}),_s("p",{children:["Keep getting this error?"," ",An("a",{onClick:r,title:"Download your project",children:"Download your project"})," ","as a backup and then"," ",An("a",{onClick:s,title:"Reset the document",children:"reset the document"}),"."]})]})})}var Tm=P("div",{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"$canvas"}),xm=P("div",{backgroundColor:"$panel",border:"1px solid $panelContrast",padding:"$5",borderRadius:8,boxShadow:"$panel",maxWidth:320,color:"$text",fontFamily:"$ui",fontSize:"$2",textAlign:"center",display:"flex",flexDirection:"column",gap:"$3","& > pre":{marginTop:"$3",marginBottom:"$3",textAlign:"left",whiteSpace:"pre-wrap",backgroundColor:"$hover",padding:"$4",borderRadius:"$2",fontFamily:'"Menlo", "Monaco", monospace',fontWeight:500},"& p":{fontFamily:"$body",lineHeight:1.7,padding:"$5",margin:0},"& a":{color:"$text",cursor:"pointer",textDecoration:"underline"},"& hr":{marginLeft:"-$5",marginRight:"-$5"}}),km=P("div",{display:"flex","& > button > div":{justifyContent:"center",textAlign:"center"}});import{ChevronDownIcon as Vm,ChevronRightIcon as Hm,EyeClosedIcon as zm,EyeOpenIcon as Fm,LockClosedIcon as Om,LockOpen1Icon as $m}from"@radix-ui/react-icons";import*as ut from"react";import*as Lo from"react";import{Utils as Cm}from"telva-core";import*as ui from"react";var Xs=ui.createContext([]);function hi(){return ui.useContext(Xs)}import{jsx as Vn,jsxs as yr}from"react/jsx-runtime";var Sd=Lo.memo(function(){let o=N(),e=hi(),[t,n]=Lo.useState(null),r=Lo.useCallback(s=>{n(s.id);try{let[l,a]=s.defaultSize,c=o.getPagePoint([window.innerWidth/2-l/2,window.innerHeight/2-a/2]),p=Cm.uniqueId();o.createShapes({id:p,type:"reactComponent",name:s.name,point:c,size:[l,a],componentId:s.id,style:{color:"black",size:"small",dash:"draw"}}),o.select(p)}catch(l){console.error("Failed to import component:",l)}finally{n(null)}},[o]);return yr(wm,{children:[e.length===0?yr(Im,{children:["No components registered.",Vn("br",{}),"Add components in ",Vn("code",{children:"apps/www/react/registry.tsx"})]}):e.map(s=>yr(Pm,{children:[Vn(Rm,{style:{background:s.previewColor||"#6366f1"},children:Vn("span",{children:"<"+s.name+" />"})}),yr(Dm,{children:[Vn(Em,{children:s.name}),Vn(Bm,{children:s.description}),Vn(Mm,{children:s.sourcePath})]}),Vn(Lm,{onClick:()=>r(s),disabled:t===s.id,children:t===s.id?"...":"Import"})]},s.id)),yr(Am,{children:["Components render LIVE on your canvas.",Vn("br",{})]})]})}),wm=P("div",{flex:1,padding:"6px",overflowY:"auto","&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{background:"$separator",borderRadius:"2px"}}),Im=P("div",{padding:"16px 8px",fontSize:"10px",color:"$textSecondary",textAlign:"center",lineHeight:1.5,"& code":{fontSize:"9px",background:"$inputBg",padding:"1px 4px",borderRadius:"$0"}}),Pm=P("div",{display:"flex",alignItems:"center",gap:"6px",padding:"6px",borderRadius:"$2",border:"1px solid $separator",marginBottom:"4px",transition:"background 0.08s","&:hover":{background:"$hover"}}),Rm=P("div",{width:"36px",height:"36px",borderRadius:"$1",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& span":{fontSize:"7px",color:"rgba(255,255,255,0.8)",fontFamily:"$mono"}}),Dm=P("div",{flex:1,minWidth:0}),Em=P("div",{fontSize:"10px",fontWeight:600,color:"$text",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),Bm=P("div",{fontSize:"9px",color:"$textSecondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),Mm=P("div",{fontSize:"8px",color:"$textSecondary",opacity:.6,fontFamily:"$mono",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),Lm=P("button",{all:"unset",fontSize:"9px",fontWeight:600,color:"white",background:"$accent",padding:"3px 8px",borderRadius:"$1",cursor:"pointer",flexShrink:0,transition:"opacity 0.1s","&:hover":{opacity:.85},"&:disabled":{opacity:.5,cursor:"not-allowed"}}),Am=P("div",{padding:"10px 6px",fontSize:"8px",color:"$textSecondary",lineHeight:1.4,borderTop:"1px solid $separator",marginTop:"6px","& code":{fontSize:"8px",background:"$inputBg",padding:"1px 3px",borderRadius:"$0"}});import{Fragment as eg,jsx as oe,jsxs as Hn}from"react/jsx-runtime";var Gm=i=>{let o=i.document.pages[i.appState.currentPageId];return Object.values(o.shapes).sort((e,t)=>t.childIndex-e.childIndex)},jm=i=>i.document.pageStates[i.appState.currentPageId].selectedIds,yd={["draw"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("path",{d:"M2 12C4 8 8 4 10 6C12 8 13 3 13 3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",fill:"none"})}),["rectangle"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("rect",{x:"2",y:"3",width:"11",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})}),["ellipse"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("ellipse",{cx:"7.5",cy:"7.5",rx:"5.5",ry:"4.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})}),["triangle"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("path",{d:"M7.5 2L13 13H2L7.5 2Z",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})}),["arrow"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("path",{d:"M3 12L12 3M12 3H6M12 3V9",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}),["text"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("path",{d:"M3 3H12M7.5 3V12",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})}),["sticky"]:Hn("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:[oe("rect",{x:"2",y:"2",width:"11",height:"11",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),oe("path",{d:"M5 6H10M5 9H8",stroke:"currentColor",strokeWidth:"0.8"})]}),["line"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("line",{x1:"2",y1:"13",x2:"13",y2:"2",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})}),["image"]:Hn("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:[oe("rect",{x:"2",y:"3",width:"11",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),oe("circle",{cx:"5",cy:"6",r:"1",fill:"currentColor"})]}),["video"]:Hn("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:[oe("rect",{x:"2",y:"3",width:"11",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),oe("path",{d:"M6 6V9L9 7.5L6 6Z",fill:"currentColor"})]}),["group"]:Hn("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:[oe("rect",{x:"1",y:"4",width:"8",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1",fill:"none"}),oe("rect",{x:"5",y:"2",width:"8",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1",fill:"none"})]})},Zs=ut.memo(function(){let[o,e]=ut.useState("layers");return Hn(Nm,{onPointerDown:t=>t.stopPropagation(),onPointerUp:t=>t.stopPropagation(),onClick:t=>t.stopPropagation(),children:[Hn(Um,{children:[oe(bd,{isActive:o==="layers",onClick:()=>e("layers"),children:"Layers"}),oe(bd,{isActive:o==="components",onClick:()=>e("components"),children:"Components"})]}),o==="layers"?oe(Wm,{}):oe(Sd,{})]})});function Wm(){let i=N(),o=i.useStore(Gm),e=i.useStore(jm),[t,n]=ut.useState(null),r=ut.useRef(null),s=ut.useMemo(()=>o.filter(a=>a.parentId===i.currentPageId),[o,i.currentPageId]),l=ut.useCallback((a,c,p)=>{if(a===c)return;let u=[...s],h=u.findIndex(T=>T.id===a);if(h===-1)return;let g=u.filter(T=>T.id!==a),m=g.findIndex(T=>T.id===c);if(m===-1)return;let f=p==="before"?m:m+1;g.splice(f,0,u[h]);let v=g.length,b={};g.forEach((T,y)=>{b[T.id]={childIndex:v-y}}),i.patchState({document:{pages:{[i.currentPageId]:{shapes:b}}}},"reorder_layers")},[s,i]);return oe(Km,{onDragOver:a=>a.preventDefault(),onDrop:()=>{r.current=null,n(null)},children:s.length===0?oe(_m,{children:"No elements on canvas"}):s.map(a=>oe(Td,{shape:a,allShapes:o,selectedIds:e,app:i,depth:0,dragOverInfo:t,onLayerDragStart:c=>{r.current=c},onLayerDragOver:(c,p)=>n({id:c,position:p}),onLayerDrop:(c,p)=>{r.current&&l(r.current,c,p),r.current=null,n(null)},onLayerDragEnd:()=>{r.current=null,n(null)}},a.id))})}function Td({shape:i,allShapes:o,selectedIds:e,app:t,depth:n,dragOverInfo:r,onLayerDragStart:s,onLayerDragOver:l,onLayerDrop:a,onLayerDragEnd:c}){let p=e.includes(i.id),h=i.type==="group"?i.children||[]:[],g=h.length>0,[m,f]=ut.useState(!0),v=ut.useCallback(C=>{C.stopPropagation(),C.shiftKey?p?t.deselect(i.id):t.select(...e,i.id):t.select(i.id)},[t,i.id,e,p]),b=ut.useCallback(C=>{C.stopPropagation(),t.toggleHidden([i.id])},[t,i.id]),T=ut.useCallback(C=>{C.stopPropagation(),t.toggleLocked([i.id])},[t,i.id]),y=yd[i.type]||yd["rectangle"],x=i.name||i.type,I=ut.useMemo(()=>g?h.map(C=>o.find(E=>E.id===C)).filter(Boolean):[],[g,h,o]),R=(r==null?void 0:r.id)===i.id?r.position==="before"?{borderTop:"2px solid #0D99FF"}:{borderBottom:"2px solid #0D99FF"}:{};return Hn(eg,{children:[Hn(xd,{draggable:!!s,onClick:v,isSelected:p,style:S({paddingLeft:`${8+n*14}px`,cursor:s?"grab":"pointer"},R),onDragStart:C=>{C.stopPropagation(),C.dataTransfer.effectAllowed="move",s==null||s(i.id)},onDragOver:C=>{C.preventDefault(),C.stopPropagation();let E=C.currentTarget.getBoundingClientRect(),M=C.clientY<E.top+E.height/2?"before":"after";l==null||l(i.id,M)},onDrop:C=>{C.preventDefault(),C.stopPropagation();let E=C.currentTarget.getBoundingClientRect(),M=C.clientY<E.top+E.height/2?"before":"after";a==null||a(i.id,M)},onDragEnd:C=>{C.stopPropagation(),c==null||c()},children:[g?oe(Ym,{onClick:C=>{C.stopPropagation(),f(!m)},children:m?oe(Vm,{}):oe(Hm,{})}):oe(Xm,{}),oe(Zm,{children:y}),oe(qm,{children:x}),Hn(Jm,{children:[oe(vd,{onClick:b,children:i.isHidden?oe(zm,{}):oe(Fm,{})}),oe(vd,{onClick:T,children:i.isLocked?oe(Om,{}):oe($m,{})})]})]}),g&&m&&oe(Qm,{children:I.map(C=>oe(Td,{shape:C,allShapes:o,selectedIds:e,app:t,depth:n+1},C.id))})]})}var Nm=P("div",{display:"flex",flexDirection:"column",flex:1,minHeight:0,overflow:"hidden"}),Um=P("div",{display:"flex",borderBottom:"1px solid $separator",flexShrink:0}),bd=P("button",{all:"unset",flex:1,padding:"6px 0",fontSize:"9px",fontWeight:600,textAlign:"center",color:"$textSecondary",cursor:"pointer",textTransform:"uppercase",letterSpacing:"0.06em",transition:"all 0.1s",borderBottom:"2px solid transparent","&:hover":{color:"$text"},variants:{isActive:{true:{color:"$accent",borderBottomColor:"$accent"}}}}),Km=P("div",{flex:1,overflowY:"auto",overflowX:"hidden","&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{background:"$separator",borderRadius:"2px"}}),_m=P("div",{padding:"16px 12px",fontSize:"10px",color:"$textSecondary",fontStyle:"italic",textAlign:"center"}),xd=P("div",{display:"flex",alignItems:"center",gap:"4px",height:"26px",paddingRight:"6px",cursor:"pointer",transition:"background 0.08s","&:hover":{background:"$hover"},variants:{isSelected:{true:{background:"rgba(13, 153, 255, 0.15)","&:hover":{background:"rgba(13, 153, 255, 0.2)"}}}}}),Ym=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",cursor:"pointer",color:"$textSecondary",flexShrink:0,"& svg":{width:"10px",height:"10px"},"&:hover":{color:"$text"}}),Xm=P("div",{width:"14px",flexShrink:0}),Zm=P("div",{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",color:"$textSecondary",flexShrink:0}),qm=P("span",{fontSize:"10px",color:"$text",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1,fontWeight:500}),Jm=P("div",{display:"flex",gap:"1px",opacity:0,transition:"opacity 0.1s",[`${xd}:hover &`]:{opacity:1}}),vd=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"$0",color:"$textSecondary",cursor:"pointer","& svg":{width:"10px",height:"10px"},"&:hover":{color:"$text",background:"$hover"}}),Qm=P("div",{borderLeft:"1px solid $separator",marginLeft:"18px"});import*as Cd from"react";import{jsx as kd}from"react/jsx-runtime";var qs=Cd.memo(function(){return kd(tg,{children:kd(Zs,{})})}),tg=P("div",{display:"flex",flexDirection:"column",width:"200px",height:"100%",background:"$panel",borderRight:"1px solid $separator",zIndex:200,pointerEvents:"all",overflow:"hidden",flexShrink:0});import{FormattedMessage as ng}from"react-intl";import{jsx as wd}from"react/jsx-runtime";var og=i=>i.appState.isLoading;function Js(){let o=N().useStore(og);return wd(rg,{hidden:!o,children:wd(ng,{id:"loading",values:{dots:"..."}})})}var rg=P("div",{position:"absolute",top:0,left:"50%",transform:"translate(-50%, 0)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px",padding:"8px 16px",fontFamily:"var(--fonts-ui)",fontSize:"var(--fontSizes-1)",boxShadow:"var(--shadows-panel)",backgroundColor:"white",zIndex:200,pointerEvents:"none","& > div > *":{pointerEvents:"all"},variants:{transform:{hidden:{transform:"translate(-50%, 100%)"},visible:{transform:"translate(-50%, 0%)"}}}});import*as ot from"@radix-ui/react-alert-dialog";import{FormattedMessage as mi,useIntl as ig}from"react-intl";import{jsx as Dt,jsxs as br}from"react/jsx-runtime";function sg({children:i,onClose:o,container:e}){return br(ot.Portal,{container:e,children:[Dt(ug,{}),Dt(hg,{onKeyDown:n=>{switch(n.key){case"Escape":o==null||o();break}},children:i})]})}var ag=P(ot.Description,{marginBottom:20,color:"$text",fontSize:"$2",lineHeight:1.5,textAlign:"center",maxWidth:"62%",minWidth:0,alignSelf:"center"}),lg=ot.Root,dg=sg,cg=ag,Id=ot.Action,pg=ot.Cancel,Pd=({container:i})=>{let{setDialogState:o,dialogState:e,onCancel:t,onNo:n,onYes:r}=ti(),s=ig(),l={saveFirstTime:s.formatMessage({id:"dialog.save.firsttime"}),saveAgain:s.formatMessage({id:"dialog.save.again"})};return br(lg,{open:e!==null,children:[Dt(ot.AlertDialogTitle,{children:Dt(mi,{id:"dialog.confirm"})}),br(dg,{onClose:()=>o(null),container:i,children:[e&&Dt(cg,{children:l[e]}),br("div",{style:{width:"100%",gap:"$6",display:"flex",justifyContent:"space-between"},children:[t&&Dt(pg,{asChild:!0,children:Dt(Ao,{css:{color:"$text"},onClick:()=>{t(),o(null)},children:Dt(mi,{id:"dialog.cancel"})})}),br("div",{style:{flexShrink:0},children:[n&&Dt(Id,{asChild:!0,children:Dt(Ao,{onClick:()=>{n(),o(null)},children:Dt(mi,{id:"dialog.no"})})}),r&&Dt(Id,{asChild:!0,children:Dt(Ao,{css:{backgroundColor:"#2F80ED",color:"White"},onClick:()=>{r(),o(null)},children:Dt(mi,{id:"dialog.yes"})})})]})]})]})]})},ug=P(ot.Overlay,{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, .15)",pointerEvents:"all"}),Wk=P(ot.Overlay,{backgroundColor:"rgba(0, 0, 0, .15)",position:"absolute",pointerEvents:"all",inset:0}),hg=P(ot.Content,{position:"fixed",font:"$ui",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"max-content",padding:"$3",pointerEvents:"all",backgroundColor:"$panel",borderRadius:"$3",display:"flex",flexDirection:"column",justifyContent:"center",fontFamily:"$ui",border:"1px solid $panelContrast",boxShadow:"$panel"}),Ao=P("button",{all:"unset",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"$2",padding:"0 15px",fontSize:"$1",lineHeight:1,fontWeight:"normal",height:36,color:"$text",cursor:"pointer",minWidth:48});import*as ln from"@radix-ui/react-alert-dialog";import{Pencil1Icon as yg}from"@radix-ui/react-icons";import*as Vo from"react";import{FormattedMessage as Ed,useIntl as bg}from"react-intl";import*as Dd from"react";import{jsx as Rd,jsxs as Sg}from"react/jsx-runtime";var gi=Dd.forwardRef((t,e)=>{var n=t,{icon:i}=n,o=Be(n,["icon"]);return Sg(mg,{children:[Rd(gg,w(S({},o),{ref:e})),i?Rd(fg,{children:i}):null]})}),mg=P("div",{position:"relative",width:"100%",height:"min-content"}),gg=P("input",{color:"$text",border:"none",textAlign:"left",width:"100%",paddingLeft:"$3",paddingRight:"$6",backgroundColor:"$background",height:"32px",outline:"none",fontFamily:"$ui",fontSize:"$1","&:focus":{backgroundColor:"$hover"},borderRadius:"$2"}),fg=P(Rt,{top:0,right:0,position:"absolute",paddingLeft:"$3",paddingRight:"$3",pointerEvents:"none",color:"$text"});import{jsx as Ot,jsxs as fi}from"react/jsx-runtime";var Md=({isOpen:i,onClose:o})=>{let e=N(),t=rn(),n=bg(),[r,s]=Vo.useState(e.document.name),[l,a]=Vo.useState("tldr"),c=Vo.useCallback(h=>{let g=h.target.value.trimStart();s(g)},[]);function p(h){h.stopPropagation()}let u=Vo.useCallback(h=>{switch(h.key){case"Enter":{let g=r.trim().replace(/\.(tldr|tld)$/,"");e.saveProjectAs(g,l),o();break}case"Escape":{o();break}}},[r,l]);return Ot(ln.Root,{open:i,children:fi(ln.Portal,{container:t.current,children:[Ot(Tg,{onPointerDown:o}),fi(vg,{dir:"ltr",onKeyDown:p,onKeyUp:p,children:[Ot(kg,{placeholder:n.formatMessage({id:"enter.file.name"}),value:r,onChange:c,onKeyDown:u,icon:Ot(yg,{})}),fi(Cg,{children:[Ot(wg,{children:"Format:"}),Ot(Bd,{active:l==="tldr",onClick:()=>a("tldr"),children:".tldr"}),Ot(Bd,{active:l==="tld",onClick:()=>a("tld"),children:".tld"})]}),fi(xg,{children:[Ot(ln.Action,{asChild:!0,children:Ot(Ao,{onClick:o,children:Ot(Ed,{id:"cancel"})})}),Ot(ln.Action,{asChild:!0,children:Ot(Ao,{css:{backgroundColor:"#2F80ED",color:"White"},onClick:()=>{let h=r.trim().replace(/\.(tldr|tld)$/,"");e.saveProjectAs(h,l),o()},children:Ot(Ed,{id:"save"})})})]})]})]})})},vg=P(ln.Content,{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",minWidth:300,maxWidth:"fit-content",maxHeight:"85vh",marginTop:"-5vh",pointerEvents:"all",backgroundColor:"$panel",padding:"$3",borderRadius:"$2",font:"$ui",zIndex:999999,"&:focus":{outline:"none"}}),Tg=P(ln.Overlay,{backgroundColor:"rgba(0, 0, 0, .15)",position:"absolute",pointerEvents:"all",inset:0,zIndex:999998}),xg=P("div",{width:"100%",display:"flex",alignItems:"center",gap:8,justifyContent:"flex-end",marginTop:10}),kg=P(gi,{background:"$hover"}),Cg=P("div",{display:"flex",alignItems:"center",gap:6,marginTop:8}),wg=P("span",{fontSize:11,color:"$textSecondary",flexShrink:0}),Bd=P("button",{all:"unset",padding:"3px 10px",borderRadius:4,fontSize:11,fontFamily:"monospace",cursor:"pointer",border:"1px solid $separator",color:"$textSecondary",transition:"all 0.1s","&:hover":{background:"$hover",color:"$text"},variants:{active:{true:{background:"#2F80ED",borderColor:"#2F80ED",color:"white","&:hover":{background:"#2F80ED",color:"white"}}}}});import*as yp from"react";import*as Ie from"react";import{Utils as Ji}from"telva-core";import{Utils as Ld}from"telva-core";function Et(i,o){let e=Ld.getFromCache(o,i,()=>{let[t,n]=i.size;return{minX:0,maxX:t,minY:0,maxY:n,width:t,height:n}});return Ld.translateBounds(e,i.point)}var Ig={["start"]:"left",["middle"]:"center",["end"]:"right",["justify"]:"justify"};function Ad(i="start"){return Ig[i]}var Ut="-0.03em";var Ho=[.5,.5],uC=Math.PI*2,Qs=".tldr",So={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>i*(2-i),easeInOutQuad:i=>i<.5?2*i*i:-1+(4-2*i)*i,easeInCubic:i=>i*i*i,easeOutCubic:i=>--i*i*i+1,easeInOutCubic:i=>i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1,easeInQuart:i=>i*i*i*i,easeOutQuart:i=>1- --i*i*i*i,easeInOutQuart:i=>i<.5?8*i*i*i*i:1-8*--i*i*i*i,easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>1+--i*i*i*i*i,easeInOutQuint:i=>i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i,easeInSine:i=>1-Math.cos(i*Math.PI/2),easeOutSine:i=>Math.sin(i*Math.PI/2),easeInOutSine:i=>-(Math.cos(Math.PI*i)-1)/2,easeInExpo:i=>i<=0?0:Math.pow(2,10*i-10),easeOutExpo:i=>i>=1?1:1-Math.pow(2,-10*i),easeInOutExpo:i=>i<=0?0:i>=1?1:i<.5?Math.pow(2,20*i-10)/2:(2-Math.pow(2,-20*i+10))/2};var Si=["#EC5E41","#F2555A","#F04F88","#E34BA9","#BD54C6","#9D5BD2","#7B66DC","#02B1CC","#11B3A3","#39B178","#55B467","#FF802B"],Pg=typeof Window=="undefined"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Vd=typeof Window=="undefined"?!1:/linux/i.test(navigator.userAgent),yi=[".png",".svg",".jpg",".jpeg",".gif"],bi=Pg?[]:[".mp4",".webm"];var Bt;function Rg(){var o;(o=document.getElementById("__textLabelMeasure"))==null||o.remove();let i=document.createElement("pre");return i.id="__textLabelMeasure",Object.assign(i.style,{whiteSpace:"pre",width:"auto",border:"1px solid transparent",padding:"4px",margin:"0px",letterSpacing:Ut,opacity:"0",position:"absolute",top:"-500px",left:"0px",zIndex:"9999",pointerEvents:"none",userSelect:"none","-webkit-user-select":"none",alignmentBaseline:"mathematical",dominantBaseline:"mathematical"}),i.tabIndex=-1,document.body.appendChild(i),i}typeof window!="undefined"&&(Bt=Rg());var Dg="";function Hd(){Dg=""}function Zn(i,o,e){if(!i)return[16,32];if(!Bt)return[10,10];Bt.parent||document.body.appendChild(Bt),Bt.textContent=i,Bt.style.font=o,e?(Bt.style.whiteSpace="pre-wrap",Bt.style.wordBreak="break-word",Bt.style.width=`${e}px`):(Bt.style.whiteSpace="pre",Bt.style.wordBreak="normal",Bt.style.width="auto");let t=Bt.offsetWidth||1,n=Bt.offsetHeight||1;return[t,n]}var Eg=new RegExp(`${[32,160,4961,65792,65793,4153,4241].map(i=>String.fromCodePoint(i)).join("|")}`);function qn(i,o,e,t,n,r=!1){let s="normal",a=Ut,c=Bg({text:i,wrap:r,width:n,fontSize:o,fontWeight:s,fontFamily:e,fontStyle:"normal",textAlign:"left",letterSpacing:Ut,lineHeight:1}),p=document.createElementNS("http://www.w3.org/2000/svg","text");p.setAttribute("font-size",o+"px"),p.setAttribute("font-family",e),p.setAttribute("font-weight",s),p.setAttribute("line-height",1*o+"px"),p.setAttribute("letter-spacing",a),p.setAttribute("text-align",t!=null?t:"left"),p.setAttribute("dominant-baseline","mathematical"),p.setAttribute("alignment-baseline","mathematical");let u=c.map((h,g)=>{let m=document.createElementNS("http://www.w3.org/2000/svg","tspan");return m.textContent=h+`
1
+ var Ps=Object.defineProperty,Lu=Object.defineProperties,Au=Object.getOwnPropertyDescriptor,Vu=Object.getOwnPropertyDescriptors,Hu=Object.getOwnPropertyNames,Xr=Object.getOwnPropertySymbols;var Rs=Object.prototype.hasOwnProperty,al=Object.prototype.propertyIsEnumerable;var Is=(i,o,e)=>o in i?Ps(i,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[o]=e,S=(i,o)=>{for(var e in o||(o={}))Rs.call(o,e)&&Is(i,e,o[e]);if(Xr)for(var e of Xr(o))al.call(o,e)&&Is(i,e,o[e]);return i},w=(i,o)=>Lu(i,Vu(o));var Be=(i,o)=>{var e={};for(var t in i)Rs.call(i,t)&&o.indexOf(t)<0&&(e[t]=i[t]);if(i!=null&&Xr)for(var t of Xr(i))o.indexOf(t)<0&&al.call(i,t)&&(e[t]=i[t]);return e};var zu=(i,o)=>()=>(i&&(o=i(i=0)),o);var ll=(i,o)=>{for(var e in o)Ps(i,e,{get:o[e],enumerable:!0})},sl=(i,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of Hu(o))!Rs.call(i,n)&&n!==e&&Ps(i,n,{get:()=>o[n],enumerable:!(t=Au(o,n))||t.enumerable});return i},Zr=(i,o,e)=>(sl(i,o,"default"),e&&sl(e,o,"default"));var d=(i,o,e)=>(Is(i,typeof o!="symbol"?o+"":o,e),e);var z=(i,o,e)=>new Promise((t,n)=>{var r=a=>{try{l(e.next(a))}catch(c){n(c)}},s=a=>{try{l(e.throw(a))}catch(c){n(c)}},l=a=>a.done?t(a.value):Promise.resolve(a.value).then(r,s);l((e=e.apply(i,o)).next())});var Zi={};ll(Zi,{fetchGoogleFonts:()=>sp,getGoogleFontCategories:()=>Fy,initGoogleFonts:()=>Aa,loadGoogleFont:()=>dp,searchGoogleFonts:()=>zy,setGoogleFontsApiKey:()=>La});function La(i){let o=i.replace(/["']/g,"").trim();o!==Vr&&(Vr=o,io=[],Ar=null)}function sp(){return z(this,null,function*(){return io.length>0?io:Ar||(Ar=(()=>z(this,null,function*(){var i;try{if(!Vr)return console.warn("[Google Fonts] No API key provided. Pass googleFontsApiKey to the <Telva> component."),[];let o=`https://www.googleapis.com/webfonts/v1/webfonts?key=${Vr}&sort=popularity`,e=yield fetch(o);if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);io=(i=(yield e.json()).items)!=null?i:[]}catch(o){console.error("[Google Fonts] Failed to fetch font list",o),io=[]}return io}))(),Ar)})}function zy(i,o){let e=io;if(o&&(e=e.filter(n=>n.category===o)),!i)return e.slice(0,100);let t=i.toLowerCase();return e.filter(n=>n.family.toLowerCase().includes(t)).slice(0,100)}function Fy(){return Array.from(new Set(io.map(i=>i.category))).filter(Boolean)}function lp(){var i;try{return JSON.parse((i=localStorage.getItem(ap))!=null?i:"[]")}catch(o){return[]}}function Oy(i){try{let o=lp();o.includes(i)||(o.push(i),localStorage.setItem(ap,JSON.stringify(o)))}catch(o){}}function dp(i,o){let e=`gfont-${i.replace(/\s+/g,"-")}`;if(document.getElementById(e))return;let t=i.replace(/\s+/g,"+"),n=document.createElement("link");n.id=e,n.rel="stylesheet",n.href=`https://fonts.googleapis.com/css?family=${t}:400,400i,700,700i&display=swap`,document.head.appendChild(n),Oy(i)}function $y(){typeof window!="undefined"&&lp().forEach(i=>dp(i))}function Aa(){$y(),typeof window!="undefined"&&Vr&&sp()}var Vr,io,Ar,ap,Hr=zu(()=>{"use strict";Vr="",io=[],Ar=null;ap="telva-loaded-google-fonts"});import"@fontsource/caveat-brush";import"@fontsource/crimson-pro";import"@fontsource/dm-sans";import"@fontsource/recursive";import"@fontsource/source-code-pro";import"@fontsource/source-sans-pro";import*as ge from"react";import{ErrorBoundary as aT}from"react-error-boundary";import{IntlProvider as lT}from"react-intl";import{Renderer as Bu}from"telva-core";import{ArrowTopRightIcon as Vh,CursorArrowIcon as Hh,ImageIcon as zh,Pencil1Icon as Fh,Pencil2Icon as Oh,TextIcon as $h}from"@radix-ui/react-icons";import*as zt from"react";import{useIntl as Gh}from"react-intl";import{jsx as bT}from"react/jsx-runtime";import{jsx as dl}from"react/jsx-runtime";function Ds(i){let t=i,{size:o=16}=t,e=Be(t,["size"]);return dl("svg",w(S({width:24,height:24},e),{children:dl("circle",{cx:12,cy:12,r:o/2})}))}import{jsx as cl}from"react/jsx-runtime";function pl(){return cl("svg",{width:"24",height:"24",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:cl("circle",{cx:12,cy:12,r:8,fill:"none",strokeWidth:2.5,strokeLinecap:"round",strokeDasharray:50.26548*.1})})}import{jsx as ul}from"react/jsx-runtime";var Fu=`${50.26548*.025} ${50.26548*.1}`;function hl(){return ul("svg",{width:"24",height:"24",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:ul("circle",{cx:12,cy:12,r:8,fill:"none",strokeWidth:2.5,strokeLinecap:"round",strokeDasharray:Fu})})}import{jsx as ml}from"react/jsx-runtime";function gl(){return ml("svg",{width:"24",height:"24",viewBox:"1 1.5 21 22",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:ml("path",{d:"M10.0162 19.2768C10.0162 19.2768 9.90679 19.2517 9.6879 19.2017C9.46275 19.1454 9.12816 19.0422 8.68413 18.8921C8.23384 18.7358 7.81482 18.545 7.42707 18.3199C7.03307 18.101 6.62343 17.7883 6.19816 17.3818C5.77289 16.9753 5.33511 16.3718 4.88482 15.5713C4.43453 14.7645 4.1531 13.8545 4.04053 12.8414C3.92795 11.822 4.04991 10.8464 4.40639 9.91451C4.76286 8.98266 5.39452 8.10084 6.30135 7.26906C7.21444 6.44353 8.29325 5.83377 9.5378 5.43976C10.7823 5.05202 11.833 4.92068 12.6898 5.04576C13.5466 5.16459 14.3878 5.43664 15.2133 5.86191C16.0388 6.28718 16.7768 6.8688 17.4272 7.60678C18.0714 8.34475 18.5404 9.21406 18.8344 10.2147C19.1283 11.2153 19.1721 12.2598 18.9657 13.348C18.7593 14.4299 18.2872 15.4337 17.5492 16.3593C16.8112 17.2849 15.9263 18.0072 14.8944 18.5263C13.8624 19.0391 12.9056 19.3174 12.0238 19.3612C11.142 19.405 10.2101 19.2705 9.22823 18.9578C8.24635 18.6451 7.35828 18.151 6.56402 17.4756C5.77601 16.8002 6.08871 16.8658 7.50212 17.6726C8.90927 18.4731 10.1444 18.8484 11.2076 18.7983C12.2645 18.7545 13.2965 18.4825 14.3034 17.9822C15.3102 17.4819 16.1264 16.8221 16.7518 16.0028C17.3772 15.1835 17.7681 14.3111 17.9244 13.3855C18.0808 12.4599 18.0401 11.5781 17.8025 10.74C17.5586 9.902 17.1739 9.15464 16.6486 8.49797C16.1233 7.8413 15.2289 7.27844 13.9656 6.80939C12.7086 6.34034 11.4203 6.20901 10.1007 6.41539C8.78732 6.61552 7.69599 7.06893 6.82669 7.77564C5.96363 8.48859 5.34761 9.26409 4.97863 10.1021C4.60964 10.9402 4.45329 11.8376 4.50958 12.7945C4.56586 13.7513 4.79101 14.6238 5.18501 15.4118C5.57276 16.1998 5.96363 16.8002 6.35764 17.2129C6.75164 17.6257 7.13313 17.9509 7.50212 18.1886C7.87736 18.4325 8.28074 18.642 8.71227 18.8171C9.15005 18.9922 9.47839 19.111 9.69728 19.1736C9.91617 19.2361 10.0256 19.2705 10.0256 19.2768H10.0162Z",strokeWidth:"2"})})}import{jsx as fl}from"react/jsx-runtime";function Sl(){return fl("svg",{width:"24",height:"24",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:fl("circle",{cx:12,cy:12,r:8,fill:"none",strokeWidth:2,strokeLinecap:"round"})})}import{jsx as IT,jsxs as PT}from"react/jsx-runtime";import{jsx as yl}from"react/jsx-runtime";function Es(e){var t=e,{flipHorizontal:i}=t,o=Be(t,["flipHorizontal"]);return yl("svg",w(S({width:24,height:24,viewBox:"0 0 15 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:{transform:i?"scale(-1, 1)":"scale(1, 1)"}},o),{children:yl("path",{d:"M10.6707 8.5081C10.6707 10.1923 9.3004 11.5625 7.61631 11.5625H6.5351C6.35593 11.5625 6.21074 11.4173 6.21074 11.2382V11.13C6.21074 10.9508 6.35591 10.8057 6.5351 10.8057H7.61631C8.88313 10.8057 9.91387 9.77492 9.91387 8.5081C9.91387 7.24128 8.88313 6.21054 7.61631 6.21054H5.62155L6.99534 7.58433C7.14289 7.73183 7.14289 7.97195 6.99534 8.11944C6.85216 8.26251 6.60298 8.2623 6.46013 8.11944L4.44045 6.09971C4.36898 6.02824 4.32959 5.93321 4.32959 5.8321C4.32959 5.73106 4.36898 5.63598 4.44045 5.56454L6.46024 3.54472C6.60309 3.40176 6.85248 3.40176 6.99535 3.54472C7.14291 3.69218 7.14291 3.93234 6.99535 4.07979L5.62156 5.45368H7.61631C9.3004 5.45368 10.6707 6.82393 10.6707 8.5081Z"})}))}import{jsx as bl}from"react/jsx-runtime";function vl(i){return bl("svg",w(S({width:24,height:24,viewBox:"-2 -2 28 28",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},i),{children:bl("path",{d:"M12.4239 4.62C13.3572 4.62 14.1572 4.73333 14.8239 4.96C15.4906 5.17333 15.9772 5.43333 16.2839 5.74C16.3639 5.82 16.4039 5.94 16.4039 6.1V8.86H14.0639C13.9172 8.86 13.8439 8.78666 13.8439 8.64V7.26C13.4306 7.12666 12.9572 7.06 12.4239 7.06C11.6506 7.06 11.0639 7.18 10.6639 7.42C10.2639 7.66 10.0639 8.04666 10.0639 8.58V9C10.0639 9.38666 10.1639 9.69333 10.3639 9.92C10.5772 10.1333 11.0306 10.3467 11.7239 10.56L13.6439 11.14C14.4706 11.38 15.1172 11.66 15.5839 11.98C16.0506 12.3 16.3772 12.68 16.5639 13.12C16.7639 13.5467 16.8639 14.0733 16.8639 14.7V15.62C16.8639 16.7933 16.4039 17.7133 15.4839 18.38C14.5639 19.0467 13.2839 19.38 11.6439 19.38C10.6706 19.38 9.79723 19.2867 9.0239 19.1C8.2639 18.9133 7.71056 18.6533 7.3639 18.32C7.3239 18.28 7.29056 18.24 7.2639 18.2C7.25056 18.1467 7.2439 18.06 7.2439 17.94V15.74H7.6239C8.2239 16.1533 8.85056 16.4533 9.5039 16.64C10.1572 16.8267 10.9306 16.92 11.8239 16.92C12.6506 16.92 13.2506 16.7867 13.6239 16.52C14.0106 16.2533 14.2039 15.9333 14.2039 15.56V14.88C14.2039 14.6667 14.1639 14.48 14.0839 14.32C14.0172 14.16 13.8706 14.0133 13.6439 13.88C13.4172 13.7467 13.0572 13.6067 12.5639 13.46L10.6639 12.88C9.7839 12.6133 9.11056 12.3 8.6439 11.94C8.17723 11.58 7.85056 11.18 7.6639 10.74C7.49056 10.3 7.4039 9.83333 7.4039 9.34V8.38C7.4039 7.64666 7.61056 7 8.0239 6.44C8.43723 5.88 9.01723 5.44 9.7639 5.12C10.5239 4.78666 11.4106 4.62 12.4239 4.62Z"})}))}import{jsx as Tl}from"react/jsx-runtime";function xl(i){return Tl("svg",w(S({width:24,height:24,viewBox:"-2 -2 28 28",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},i),{children:Tl("path",{d:"M8.16191 19H5.68191C5.53525 19 5.46191 18.9267 5.46191 18.78V5H8.76191C8.88191 5 8.97525 5.03333 9.04191 5.1C9.10858 5.15333 9.17525 5.27333 9.24191 5.46C9.72191 6.59333 10.1686 7.7 10.5819 8.78C11.0086 9.84667 11.4352 10.98 11.8619 12.18H12.1619C12.6019 10.9667 13.0352 9.79333 13.4619 8.66C13.8886 7.52667 14.3552 6.30667 14.8619 5H18.3219C18.4686 5 18.5419 5.07333 18.5419 5.22V19H16.0619C15.9152 19 15.8419 18.9267 15.8419 18.78V16.26C15.8419 15.5267 15.8486 14.8133 15.8619 14.12C15.8886 13.4267 15.9286 12.6867 15.9819 11.9C16.0486 11.1 16.1419 10.1933 16.2619 9.18H15.9019C15.4352 10.3533 14.9486 11.5667 14.4419 12.82C13.9486 14.06 13.4819 15.2333 13.0419 16.34H11.1019C11.0619 16.34 11.0152 16.3333 10.9619 16.32C10.9219 16.2933 10.8886 16.2467 10.8619 16.18C10.4619 15.18 10.0086 14.06 9.50191 12.82C9.00858 11.58 8.53525 10.3667 8.08191 9.18H7.70191C7.83525 10.18 7.93525 11.0733 8.00191 11.86C8.06858 12.6467 8.10858 13.3933 8.12191 14.1C8.14858 14.8067 8.16191 15.5267 8.16191 16.26V19Z"})}))}import{jsx as kl}from"react/jsx-runtime";function Cl(i){return kl("svg",w(S({width:24,height:24,viewBox:"-2 -2 28 28",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},i),{children:kl("path",{d:"M7.68191 19C7.53525 19 7.46191 18.9267 7.46191 18.78V5H10.1219C10.2686 5 10.3419 5.07333 10.3419 5.22V16.56H13.4419V15.02H15.7619C15.9086 15.02 15.9819 15.0933 15.9819 15.24V19H7.68191Z"})}))}import{jsx as Bs,jsxs as Ou}from"react/jsx-runtime";function wl(){return Ou("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Bs("path",{d:"M1.72838 9.33987L8.84935 2.34732C9.23874 1.96494 9.86279 1.96539 10.2516 2.34831L13.5636 5.60975C13.9655 6.00555 13.9607 6.65526 13.553 7.04507L8.13212 12.2278C7.94604 12.4057 7.69851 12.505 7.44107 12.505L6.06722 12.505L3.83772 12.505C3.5673 12.505 3.30842 12.3954 3.12009 12.2014L1.7114 10.7498C1.32837 10.3551 1.33596 9.72521 1.72838 9.33987Z",stroke:"currentColor"}),Bs("line",{x1:"6.01807",y1:"12.5",x2:"10.7959",y2:"12.5",stroke:"currentColor",strokeLinecap:"round"}),Bs("line",{x1:"5.50834",y1:"5.74606",x2:"10.1984",y2:"10.4361",stroke:"currentColor"})]})}import{jsx as AT}from"react/jsx-runtime";import{jsx as Il}from"react/jsx-runtime";function Pl(){return Il("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:Il("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L11.1464 3.14645C11.3417 2.95118 11.6583 2.95118 11.8536 3.14645C12.0488 3.34171 12.0488 3.65829 11.8536 3.85355L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z"})})}import*as Xn from"@radix-ui/react-dropdown-menu";import{CircleIcon as Dh,SquareIcon as Eh,VercelLogoIcon as Bh}from"@radix-ui/react-icons";import*as Sn from"react";import{useIntl as Mh}from"react-intl";import{createStitches as $u,defaultThemeMap as Gu}from"@stitches/react";var{styled:P,createTheme:ju}=$u({themeMap:S({},Gu),theme:{colors:{bounds:"rgba(13, 153, 255, 1)",boundsBg:"rgba(13, 153, 255, 0.05)",hover:"#3a3a3a",overlay:"rgba(0, 0, 0, 0.25)",overlayContrast:"rgba(255, 255, 255, 0.1)",panel:"#2C2C2C",panelContrast:"#444444",selected:"rgba(13, 153, 255, 1)",selectedContrast:"#ffffff",text:"#E8EAED",tooltip:"#1a1a1a",tooltipContrast:"#ffffff",warn:"rgba(255, 100, 100, 1)",canvas:"#ffffffff",separator:"#444444",inputBg:"#383838",inputBorder:"#555555",textSecondary:"#9AA0A6",accent:"#0D99FF"},shadows:{2:"0px 1px 2px rgba(0, 0, 0, 0.3)",3:"0px 2px 4px rgba(0, 0, 0, 0.3)",4:"0px 4px 8px rgba(0, 0, 0, 0.3)",8:"0px 8px 16px rgba(0, 0, 0, 0.3)",12:"0px 12px 24px rgba(0, 0, 0, 0.3)",24:"0px 24px 48px rgba(0, 0, 0, 0.3)",key:"1px 1px rgba(0,0,0,1)",panel:`0px 0px 12px -2px rgba(0, 0, 0, 0.3),
2
+ 0px 0px 8px -4px rgba(0, 0, 0, 0.2)`},space:{0:"2px",1:"3px",2:"4px",3:"8px",4:"12px",5:"16px",6:"32px",7:"48px"},fontSizes:{0:"10px",1:"11px",2:"12px",3:"13px",4:"16px"},fonts:{ui:'"DM Sans", system-ui, -apple-system, sans-serif',body:'"DM Sans", system-ui, -apple-system, sans-serif',mono:'"Source Code Pro", monospace'},fontWeights:{},lineHeights:{},letterSpacings:{},sizes:{},borderWidths:{0:"$1"},borderStyles:{},radii:{0:"4px",1:"6px",2:"8px",3:"10px",4:"14px",pill:"9999px"},zIndices:{},transitions:{}},media:{micro:"(max-width: 370px)",sm:"(min-width: 640px)",md:"(min-width: 768px)",lg:"(min-width: 1024px)"},utils:{zStrokeWidth:()=>i=>Array.isArray(i)?{strokeWidth:`calc(${i[0]}px / var(--tv-zoom))`}:{strokeWidth:`calc(${i}px / var(--tv-zoom))`}}}),Ms=ju({colors:{bounds:"rgba(13, 153, 255, 1)",boundsBg:"rgba(13, 153, 255, 0.05)",hover:"#444A50",overlay:"rgba(0, 0, 0, 0.2)",overlayContrast:"rgba(255, 255, 255, 0.1)",panel:"#1E1E1E",panelContrast:"#444444",selected:"rgba(13, 153, 255, 1)",selectedContrast:"#ffffff",text:"#E8EAED",tooltip:"#111111",tooltipContrast:"#ffffff",canvas:"#141414",separator:"#333333",inputBg:"#2A2A2A",inputBorder:"#444444",textSecondary:"#888888",accent:"#0D99FF"},shadows:{2:"0px 1px 2px rgba(0, 0, 0, 0.4)",3:"0px 2px 4px rgba(0, 0, 0, 0.4)",4:"0px 4px 8px rgba(0, 0, 0, 0.4)",8:"0px 8px 16px rgba(0, 0, 0, 0.4)",12:"0px 12px 24px rgba(0, 0, 0, 0.4)",24:"0px 24px 48px rgba(0, 0, 0, 0.4)",panel:`0px 0px 12px -2px rgba(0, 0, 0, 0.4),
3
+ 0px 0px 8px -4px rgba(0, 0, 0, 0.3)`}});var mr=P("div",{backgroundColor:"$panel",display:"flex",alignItems:"center",flexDirection:"row",padding:"$2",border:"1px solid $panelContrast",gap:0,overflow:"hidden",variants:{side:{center:{borderRadius:9},left:{padding:0,borderTop:0,borderLeft:0,borderTopRightRadius:0,borderBottomRightRadius:9,borderBottomLeftRadius:0},right:{padding:0,borderTop:0,borderRight:0,borderTopLeftRadius:0,borderBottomLeftRadius:9,borderBottomRightRadius:0}}},"& hr":{height:10,width:"100%",backgroundColor:"red",border:"none"}});import*as Sr from"react";import*as gn from"@radix-ui/react-tooltip";import{Utils as Wu}from"telva-core";import{jsx as Rl}from"react/jsx-runtime";var Nu=()=>Wu.isDarwin()?"\u2318":"Ctrl";function qr({variant:i,children:o}){return Rl(Uu,{variant:i,children:o.split("").map((e,t)=>Rl("span",{children:e.replace("#",Nu())},t))})}var Uu=P("kbd",{marginLeft:"$3",textShadow:"$2",textAlign:"center",fontSize:"$0",fontFamily:"$ui",color:"$text",background:"none",fontWeight:400,gap:"$1",display:"flex",alignItems:"center","& > span":{padding:"$0",borderRadius:"$0",display:"flex",alignItems:"center",justifyContent:"center"},variants:{variant:{tooltip:{"& > span":{color:"$tooltipContrast",background:"$overlayContrast",boxShadow:"$key",width:"20px",height:"20px"}},menu:{}}}});import{jsx as Ro,jsxs as Dl}from"react/jsx-runtime";function Jr({children:i,label:o,kbd:e,id:t,side:n="top"}){return Ro("span",{id:t,children:Ro(gn.Provider,{children:Dl(gn.Root,{children:[Ro(gn.Trigger,{dir:"ltr",asChild:!0,children:Ro("span",{children:i})}),Dl(Ku,{dir:"ltr",side:n,sideOffset:8,children:[o,e?Ro(qr,{variant:"tooltip",children:e}):null,Ro(_u,{})]})]})})})}var Ku=P(gn.Content,{borderRadius:3,padding:"$3 $3 $3 $3",fontSize:"$1",backgroundColor:"$tooltip",color:"$tooltipContrast",boxShadow:"$3",display:"flex",alignItems:"center",fontFamily:"$ui",userSelect:"none",WebkitUserSelect:"none"}),_u=P(gn.Arrow,{fill:"$tooltip",margin:"0 8px"});var nn={"@initial":"mobile","@micro":"micro","@sm":"small","@md":"medium","@lg":"large"};import*as Do from"react";function Yu(){let i=Do.useCallback((r,s)=>z(this,null,function*(){s(r.fileSystemHandle?"saveFirstTime":"saveAgain",()=>z(this,null,function*(){try{yield r.saveProject(),r.newProject()}catch(l){}}),()=>z(this,null,function*(){r.newProject()}),()=>z(this,null,function*(){}))}),[]),o=Do.useCallback((r,s)=>z(this,null,function*(){if(!r.fileSystemHandle&&!r.isDirty){r.openProject();return}s(r.fileSystemHandle?"saveFirstTime":"saveAgain",()=>z(this,null,function*(){try{yield r.saveProject(),yield r.openProject()}catch(l){}}),()=>z(this,null,function*(){r.openProject()}),()=>z(this,null,function*(){}))}),[]),e=Do.useCallback(r=>{r.saveProject()},[]),t=Do.useCallback(r=>{r.saveProjectAs()},[]),n=Do.useCallback(r=>z(this,null,function*(){var s;(s=r.openAsset)==null||s.call(r)}),[]);return{onNewProject:i,onSaveProject:e,onSaveProjectAs:t,onOpenProject:o,onOpenMedia:n}}import*as Eo from"react";function Qr(){let i=N(),{openDialog:o}=ei(),e=Eo.useCallback(l=>z(this,null,function*(){var a,c;l&&i.callbacks.onOpenProject&&l.preventDefault(),(c=(a=i.callbacks).onNewProject)==null||c.call(a,i,o)}),[i,o]),t=Eo.useCallback(l=>{var a,c;l&&i.callbacks.onOpenProject&&l.preventDefault(),(c=(a=i.callbacks).onSaveProject)==null||c.call(a,i)},[i]),n=Eo.useCallback(l=>{var a,c;l&&i.callbacks.onOpenProject&&l.preventDefault(),(c=(a=i.callbacks).onSaveProjectAs)==null||c.call(a,i)},[i]),r=Eo.useCallback(l=>z(this,null,function*(){var a,c;l&&i.callbacks.onOpenProject&&l.preventDefault(),(c=(a=i.callbacks).onOpenProject)==null||c.call(a,i,o)}),[i,o]),s=Eo.useCallback(l=>z(this,null,function*(){var a,c;l&&i.callbacks.onOpenMedia&&l.preventDefault(),(c=(a=i.callbacks).onOpenMedia)==null||c.call(a,i)}),[i]);return{onNewProject:e,onSaveProject:t,onSaveProjectAs:n,onOpenProject:r,onOpenMedia:s}}import*as si from"react";import{useHotkeys as j}from"react-hotkeys-hook";var ti=class{constructor(){d(this,"onPinchStart");d(this,"onPinchEnd");d(this,"onPinch");d(this,"onKeyDown");d(this,"onKeyUp");d(this,"onPointerMove");d(this,"onPointerUp");d(this,"onPan");d(this,"onZoom");d(this,"onPointerDown");d(this,"onPointCanvas");d(this,"onDoubleClickCanvas");d(this,"onRightPointCanvas");d(this,"onDragCanvas");d(this,"onReleaseCanvas");d(this,"onPointShape");d(this,"onDoubleClickShape");d(this,"onRightPointShape");d(this,"onDragShape");d(this,"onHoverShape");d(this,"onUnhoverShape");d(this,"onReleaseShape");d(this,"onPointBounds");d(this,"onDoubleClickBounds");d(this,"onRightPointBounds");d(this,"onDragBounds");d(this,"onHoverBounds");d(this,"onUnhoverBounds");d(this,"onReleaseBounds");d(this,"onPointBoundsHandle");d(this,"onDoubleClickBoundsHandle");d(this,"onRightPointBoundsHandle");d(this,"onDragBoundsHandle");d(this,"onHoverBoundsHandle");d(this,"onUnhoverBoundsHandle");d(this,"onReleaseBoundsHandle");d(this,"onPointHandle");d(this,"onDoubleClickHandle");d(this,"onRightPointHandle");d(this,"onDragHandle");d(this,"onHoverHandle");d(this,"onUnhoverHandle");d(this,"onReleaseHandle");d(this,"onShapeBlur");d(this,"onShapeClone")}},El=(n=>(n.Idle="idle",n.Connecting="connecting",n.Connected="connected",n.Disconnected="disconnected",n))(El||{}),Ve=(u=>(u.Transform="transform",u.Translate="translate",u.TransformSingle="transformSingle",u.Brush="brush",u.Arrow="arrow",u.Draw="draw",u.Erase="erase",u.Rotate="rotate",u.Handle="handle",u.Grid="grid",u.Edit="edit",u))(Ve||{}),Vt=(g=>(g.Idle="idle",g.PointingHandle="pointingHandle",g.PointingBounds="pointingBounds",g.PointingBoundsHandle="pointingBoundsHandle",g.TranslatingLabel="translatingLabel",g.TranslatingHandle="translatingHandle",g.Translating="translating",g.Transforming="transforming",g.Rotating="rotating",g.Pinching="pinching",g.Brushing="brushing",g.Creating="creating",g.EditingText="editing-text",g))(Vt||{}),Ls=(n=>(n.Backward="backward",n.Forward="forward",n.ToFront="toFront",n.ToBack="toBack",n))(Ls||{}),ni=(s=>(s.Top="top",s.CenterVertical="centerVertical",s.Bottom="bottom",s.Left="left",s.CenterHorizontal="centerHorizontal",s.Right="right",s))(ni||{}),oi=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(oi||{}),ri=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(ri||{}),As=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(As||{}),ne=(g=>(g.Sticky="sticky",g.Ellipse="ellipse",g.Rectangle="rectangle",g.Triangle="triangle",g.Draw="draw",g.Arrow="arrow",g.Line="line",g.Text="text",g.Group="group",g.Image="image",g.Video="video",g.ReactComponent="reactComponent",g.Pen="pen",g))(ne||{}),gr=(o=>(o.Arrow="arrow",o))(gr||{}),Vs=(h=>(h.White="white",h.LightGray="lightGray",h.Gray="gray",h.Black="black",h.Green="green",h.Cyan="cyan",h.Blue="blue",h.Indigo="indigo",h.Violet="violet",h.Red="red",h.Orange="orange",h.Yellow="yellow",h))(Vs||{}),ii=(t=>(t.Small="small",t.Medium="medium",t.Large="large",t))(ii||{}),on=(n=>(n.Draw="draw",n.Solid="solid",n.Dashed="dashed",n.Dotted="dotted",n))(on||{}),Xu=(n=>(n.Small="small",n.Medium="medium",n.Large="large",n.ExtraLarge="extraLarge",n))(Xu||{}),Ht=(n=>(n.Start="start",n.Middle="middle",n.End="end",n.Justify="justify",n))(Ht||{}),Bo=(n=>(n.Script="script",n.Sans="sans",n.Serif="serif",n.Mono="mono",n))(Bo||{});function Mo(i){let o=i.stops.map(e=>{let t=e.color.slice(0,7),[n,r,s]=[1,3,5].map(l=>parseInt(t.slice(l,l+2),16));return`rgba(${n},${r},${s},${e.opacity}) ${e.position}%`}).join(", ");switch(i.type){case"linear":return`linear-gradient(${i.angle}deg, ${o})`;case"radial":return`radial-gradient(circle at ${i.centerX}% ${i.centerY}%, ${o})`;case"conic":case"diamond":return`conic-gradient(from ${i.angle}deg at ${i.centerX}% ${i.centerY}%, ${o})`;default:return`linear-gradient(90deg, ${o})`}}var Hs=(e=>(e.Image="image",e.Video="video",e))(Hs||{}),go=(r=>(r.PNG="png",r.JPG="jpeg",r.WEBP="webp",r.SVG="svg",r.JSON="json",r))(go||{}),fr=(n=>(n.Transparent="transparent",n.Auto="auto",n.Light="light",n.Dark="dark",n))(fr||{});function Bl(i){let o=N(),e=si.useCallback((a=!1)=>{let c=i.current;return a&&(o.isMenuOpen||o.settings.keepStyleMenuOpen)?!0:c&&(document.activeElement===c||c.contains(document.activeElement))},[i]);si.useEffect(()=>{if(!o)return;let a=u=>{if(!!e(!0)){if(o.readOnly){o.copy(void 0,u);return}o.cut(void 0,u)}},c=u=>{!e(!0)||o.copy(void 0,u)},p=u=>{!e(!0)||o.readOnly||o.paste(void 0,u)};return document.addEventListener("cut",a),document.addEventListener("copy",c),document.addEventListener("paste",p),()=>{document.removeEventListener("cut",a),document.removeEventListener("copy",c),document.removeEventListener("paste",p)}},[o]),j("v,1",()=>{!e(!0)||o.selectTool("select")},[o,i.current]),j("d,2",()=>{!e(!0)||o.selectTool("draw")},void 0,[o]),j("p",()=>{!e(!0)||o.selectTool("pen")},void 0,[o]),j("e,3",()=>{!e(!0)||o.selectTool("erase")},void 0,[o]),j("r,4",()=>{!e(!0)||o.selectTool("rectangle")},void 0,[o]),j("o,5",()=>{!e(!0)||o.selectTool("ellipse")},void 0,[o]),j("g,6",()=>{!e()||o.selectTool("triangle")},void 0,[o]),j("l,7",()=>{!e(!0)||o.selectTool("line")},void 0,[o]),j("a,8",()=>{!e(!0)||o.selectTool("arrow")},void 0,[o]),j("t,9",()=>{!e(!0)||o.selectTool("text")},void 0,[o]),j("s,0",()=>{!e(!0)||o.selectTool("sticky")},void 0,[o]),j("ctrl+shift+d,\u2318+shift+d",a=>{!e(!0)||(o.toggleDarkMode(),a.preventDefault())},void 0,[o]),j("ctrl+.,\u2318+.",()=>{!e(!0)||o.toggleFocusMode()},void 0,[o]),j("ctrl+shift+g,\u2318+shift+g",()=>{!e(!0)||o.toggleGrid()},void 0,[o]);let{onNewProject:t,onOpenProject:n,onSaveProject:r,onSaveProjectAs:s,onOpenMedia:l}=Qr();j("ctrl+n,\u2318+n",a=>{a.preventDefault(),e()&&t(a)},void 0,[o]),j("ctrl+s,\u2318+s",a=>{!e()||r(a)},void 0,[o]),j("ctrl+shift+s,\u2318+shift+s",a=>{!e()||s(a)},void 0,[o]),j("ctrl+alt+1,\u2318+alt+1",a=>{!e()||o.exportImage("svg",{scale:2,quality:1})},void 0,[o]),j("ctrl+alt+2,\u2318+alt+2",a=>{!e()||o.exportImage("png",{scale:2,quality:1})},void 0,[o]),j("ctrl+alt+3,\u2318+alt+3",a=>{!e()||o.exportImage("jpeg",{scale:2,quality:1})},void 0,[o]),j("ctrl+alt+4,\u2318+alt+4",a=>{!e()||o.exportImage("webp",{scale:2,quality:1})},void 0,[o]),j("ctrl+alt+5,\u2318+alt+5",a=>{!e()||o.exportJson()},void 0,[o]),j("ctrl+o,\u2318+o",a=>{!e()||n(a)},void 0,[o]),j("ctrl+u,\u2318+u",a=>{!e()||l(a)},void 0,[o]),j("\u2318+z,ctrl+z",a=>{a.preventDefault(),e(!0)&&(o.session?o.cancelSession():o.undo())},void 0,[o]),j("ctrl+shift+z,\u2318+shift+z",()=>{!e(!0)||(o.session?o.cancelSession():o.redo())},void 0,[o]),j("\u2318+u,ctrl+u",()=>{!e()||o.undoSelect()},void 0,[o]),j("ctrl+shift-u,\u2318+shift+u",()=>{!e()||o.redoSelect()},void 0,[o]),j("ctrl+=,\u2318+=,ctrl+num_add,\u2318+num_add",a=>{!e(!0)||(o.zoomIn(),a.preventDefault())},void 0,[o]),j("ctrl+-,\u2318+-,ctrl+num_subtract,\u2318+num_subtract",a=>{!e(!0)||(o.zoomOut(),a.preventDefault())},void 0,[o]),j("shift+0,ctrl+numpad_0,\u2318+numpad_0",()=>{!e(!0)||o.resetZoom()},void 0,[o]),j("shift+1",()=>{!e(!0)||o.zoomToFit()},void 0,[o]),j("shift+2",()=>{!e(!0)||o.zoomToSelection()},void 0,[o]),j("ctrl+d,\u2318+d",a=>{!e()||(o.duplicate(),a.preventDefault())},void 0,[o]),j("shift+h",()=>{!e(!0)||o.flipHorizontal()},void 0,[o]),j("shift+v",()=>{!e(!0)||o.flipVertical()},void 0,[o]),j("escape",()=>{!e(!0)||o.cancel()},void 0,[o]),j("backspace,del",()=>{!e()||o.delete()},void 0,[o]),j("\u2318+a,ctrl+a",()=>{!e(!0)||o.selectAll()},void 0,[o]),j("up",()=>{!e()||o.nudge([0,-1],!1)},void 0,[o]),j("right",()=>{!e()||o.nudge([1,0],!1)},void 0,[o]),j("down",()=>{!e()||o.nudge([0,1],!1)},void 0,[o]),j("left",()=>{!e()||o.nudge([-1,0],!1)},void 0,[o]),j("shift+up",()=>{!e()||o.nudge([0,-1],!0)},void 0,[o]),j("shift+right",()=>{!e()||o.nudge([1,0],!0)},void 0,[o]),j("shift+down",()=>{!e()||o.nudge([0,1],!0)},void 0,[o]),j("shift+left",()=>{!e()||o.nudge([-1,0],!0)},void 0,[o]),j("\u2318+shift+l,ctrl+shift+l",()=>{!e()||o.toggleLocked()},void 0,[o]),j("\u2318+shift+c,ctrl+shift+c",a=>{!e()||(o.copySvg(),a.preventDefault())},void 0,[o]),j("\u2318+g,ctrl+g",a=>{!e()||(o.group(),a.preventDefault())},void 0,[o]),j("\u2318+shift+g,ctrl+shift+g",a=>{!e()||(o.ungroup(),a.preventDefault())},void 0,[o]),j("[",()=>{!e(!0)||o.moveBackward()},void 0,[o]),j("]",()=>{!e(!0)||o.moveForward()},void 0,[o]),j("shift+[",()=>{!e(!0)||o.moveToBack()},void 0,[o]),j("shift+]",()=>{!e(!0)||o.moveToFront()},void 0,[o]),j("ctrl+shift+backspace,\u2318+shift+backspace",a=>{!e()||(o.settings.isDebugMode&&o.resetDocument(),a.preventDefault())},void 0,[o]),j("alt+command+l,alt+ctrl+l",a=>{!e(!0)||(o.style({textAlign:"start"}),a.preventDefault())},void 0,[o]),j("alt+command+t,alt+ctrl+t",a=>{!e(!0)||(o.style({textAlign:"middle"}),a.preventDefault())},void 0,[o]),j("alt+command+r,alt+ctrl+r",a=>{!e(!0)||(o.style({textAlign:"end"}),a.preventDefault())},void 0,[o])}import*as fn from"react";var zs=fn.createContext({}),Zu=()=>{let[i,o]=fn.useState(0);fn.useEffect(()=>o(1))};function N(){return fn.useContext(zs)}var Fs=fn.createContext({});function rn(){let i=fn.useContext(Fs);return Zu(),i}import*as dd from"react";var Ml={"style.menu.color":"\u0627\u0644\u0644\u0648\u0646","style.menu.fill":"\u064A\u0645\u0644\u0623","style.menu.dash":"\u0645\u062A\u0642\u0637\u0639","style.menu.size":"\u062D\u062C\u0645","style.menu.keep.open":"\u062A\u0628\u0642\u0649 \u0645\u0641\u062A\u0648\u062D\u0629","style.menu.font":"\u0627\u0644\u062E\u0637","style.menu.align":"\u0645\u062D\u0627\u0630\u0627\u0629",styles:"\u0627\u0644\u0623\u0646\u0645\u0627\u0637","zoom.in":"\u062A\u0643\u0628\u064A\u0631","zoom.out":"\u062A\u0635\u063A\u064A\u0631",to:"\u0625\u0644\u0649","menu.tools":"\u0623\u062F\u0648\u0627\u062A","menu.transform":"\u0627\u0644\u062A\u062D\u0648\u064A\u0644\u0627\u062A","menu.file":"\u0645\u0644\u0641","menu.edit":"\u062A\u062D\u0631\u064A\u0631","menu.view":"\u0645\u0639\u0627\u064A\u0646\u0629","menu.preferences":"\u0627\u0644\u062A\u0641\u0636\u064A\u0644\u0627\u062A","menu.sign.in":"\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644","menu.sign.out":"\u062E\u0631\u0648\u062C","become.a.sponsor":"\u0643\u0646 \u0631\u0627\u0639\u064A\u0627\u064B","zoom.to.content":"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0645\u062D\u062A\u0648\u0649","zoom.to.selection":"\u062A\u0643\u0628\u064A\u0631 \u0644\u0644\u062A\u062D\u062F\u064A\u062F","zoom.to.fit":"\u062A\u0643\u0628\u064A\u0631 \u0644\u062A\u0646\u0627\u0633\u0628","zoom.to":"\u062A\u0643\u0628\u064A\u0631 \u0625\u0644\u0649","preferences.dark.mode":"\u0627\u0644\u0648\u0636\u0639 \u0627\u0644\u062F\u0627\u0643\u0646","preferences.focus.mode":"\u0648\u0636\u0639 \u0627\u0644\u062A\u0631\u0643\u064A\u0632","preferences.debug.mode":"\u0648\u0636\u0639 \u0627\u0644\u062A\u0635\u062D\u064A\u062D","preferences.show.grid":"\u0627\u0638\u0647\u0631 \u0627\u0644\u0634\u0628\u0643\u0629","preferences.use.cad.selection":"\u0627\u0633\u062A\u062E\u062F\u0627\u0645 \u0627\u0644\u062A\u062D\u062F\u064A\u062F CAD","preferences.keep.stylemenu.open":"\u0627\u0644\u0627\u062D\u062A\u0641\u0627\u0638 \u0628\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0646\u0645\u0637 \u0645\u0641\u062A\u0648\u062D\u0629","preferences.always.show.snaps":"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0644\u0642\u0637\u0627\u062A \u062F\u0627\u0626\u0645\u064B\u0627","preferences.rotate.handles":"\u062A\u062F\u0648\u064A\u0631 \u0627\u0644\u0645\u0642\u0627\u0628\u0636","preferences.binding.handles":"\u0645\u0642\u0627\u0628\u0636 \u0645\u0644\u0632\u0645\u0629","preferences.clone.handles":"\u0645\u0642\u0627\u0628\u0636 \u0627\u0633\u062A\u0646\u0633\u0627\u062E",undo:"\u0627\u0644\u063A\u0627\u0621",redo:"\u0625\u0639\u0627\u062F\u0629",cut:"\u0642\u0637\u0639",copy:"\u0646\u0633\u062D",paste:"\u0644\u0635\u0642","copy.as":"\u0646\u0633\u062E \u0627\u0644\u0649","export.as":"\u0635\u062F\u0631 \u0627\u0644\u0649","select.all":"\u0627\u062E\u062A\u0631 \u0627\u0644\u0643\u0644","select.none":"\u0644\u0627 \u062A\u062E\u062A\u0631 \u0634\u064A\u0621",delete:"\u062D\u0630\u0641","new.project":"\u0645\u0634\u0631\u0648\u0639 \u062C\u062F\u064A\u062F",open:"\u0641\u062A\u062D",save:"\u062D\u0641\u0638","save.as":"\u062D\u0641\u0638 \u0628\u0627\u0633\u0645","upload.media":"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0648\u0633\u0627\u0626\u0637","create.page":"\u0625\u0646\u0634\u0627\u0621 \u0635\u0641\u062D\u0629","new.page":"\u0635\u0641\u062D\u0629 \u062C\u062F\u064A\u062F\u0629","page.name":"\u0627\u0633\u0645 \u0627\u0644\u0635\u0641\u062D\u0629",duplicate:"\u0646\u0633\u062E",cancel:"\u0627\u0644\u063A\u0627\u0621","copy.invite.link":"\u0646\u0633\u062E \u0631\u0627\u0628\u0637 \u0627\u0644\u062F\u0639\u0648\u0629","copy.readonly.link":"\u0646\u0633\u062E \u0631\u0627\u0628\u0637 \u062F\u0639\u0648\u0629 \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0641\u0642\u0637","create.multiplayer.project":"\u0642\u0645 \u0628\u0625\u0646\u0634\u0627\u0621 \u0645\u0634\u0631\u0648\u0639 \u0645\u062A\u0639\u062F\u062F \u0627\u0644\u0644\u0627\u0639\u0628\u064A\u0646","copy.multiplayer.project":"\u0646\u0633\u062E \u0625\u0644\u0649 \u0645\u0634\u0631\u0648\u0639 \u0645\u062A\u0639\u062F\u062F \u0627\u0644\u0644\u0627\u0639\u0628\u064A\u0646",select:"\u0627\u062E\u062A\u0631",eraser:"\u0645\u0645\u062D\u0627\u0629",draw:"\u0631\u0633\u0645",arrow:"\u0633\u0647\u0645",text:"\u0646\u0635",sticky:"\u0644\u0627\u0635\u0642",rectangle:"\u0645\u0631\u0628\u0639",ellipse:"\u0628\u064A\u0636\u0627\u0648\u064A",triangle:"\u0645\u062B\u0644\u062B",line:"\u062E\u0637",rotate:"\u062F\u0648\u0651\u0631","lock.aspect.ratio":"\u0642\u0641\u0644 \u0646\u0633\u0628\u0629 \u0627\u0644\u0627\u0628\u0639\u0627\u062F","unlock.aspect.ratio":"\u0641\u062A\u062D \u0642\u0641\u0644 \u0646\u0633\u0628\u0629 \u0627\u0644\u0627\u0628\u0639\u0627\u062F",group:"\u062C\u0645\u0651\u0639",ungroup:"\u0641\u0643 \u0627\u0644\u062A\u062C\u0645\u0639","move.to.back":"\u0627\u0646\u062A\u0642\u0644 \u0625\u0644\u0649 \u0627\u0644\u062E\u0644\u0641","move.backward":"\u062A\u062D\u0631\u064A\u0643 \u0644\u0644\u062E\u0644\u0641","move.forward":"\u062A\u062D\u0631\u064A\u0643 \u0644\u0644\u0623\u0645\u0627\u0645","move.to.front":"\u062A\u062D\u0631\u0643 \u0644\u0644\u0623\u0645\u0627\u0645","reset.angle":"\u0625\u0639\u0627\u062F\u0629 \u0636\u0628\u0637 \u0627\u0644\u0632\u0627\u0648\u064A\u0629",lock:"\u0642\u0641\u0644",unlock:"\u0627\u0644\u063A\u0627\u0621 \u0627\u0644\u0642\u0641\u0644","move.to.page":"\u0627\u0646\u0642\u0644 \u0625\u0644\u0649 \u0627\u0644\u0635\u0641\u062D\u0629","flip.horizontal":"\u0627\u0646\u0639\u0643\u0627\u0633 \u0623\u0641\u0642\u064A","flip.vertical":"\u0627\u0646\u0639\u0643\u0627\u0633 \u0639\u0645\u0648\u062F\u064A",move:"\u062D\u0631\u0651\u0643","to.front":"\u0644\u0644\u0627\u0645\u0627\u0645",forward:"\u0644\u0644\u062E\u0644\u0641",backward:"\u0644\u0644\u0648\u0631\u0627\u0621",back:"\u062E\u0644\u0641",language:"\u0644\u063A\u0629","translation.link":"\u0644\u0644\u0645\u0632\u064A\u062F","dock.position":"\u0645\u0648\u0642\u0639 \u0627\u0644\u0627\u062F\u0648\u0627\u062A",bottom:"\u0627\u0633\u0641\u0644",left:"\u064A\u0633\u0627\u0631",right:"\u064A\u0645\u064A\u0646",top:"\u0623\u0639\u0644\u0649",page:"\u0635\u0641\u062D\u0629","keyboard.shortcuts":"\u0627\u062E\u062A\u0635\u0627\u0631\u0627\u062A \u0644\u0648\u062D\u0629 \u0627\u0644\u0645\u0641\u0627\u062A\u064A\u062D",search:"\u0628\u062D\u062B",loading:"{dots}\u062A\u062D\u0645\u064A\u0644 ","export.background":"\u062A\u0635\u062F\u064A\u0631 \u0627\u0644\u062E\u0644\u0641\u064A\u0629",transparent:"\u0634\u0640\u0641\u0627\u0641",auto:"\u0630\u0627\u062A\u064A",light:"\u062E\u0641\u064A\u0641",dark:"\u063A\u0627\u0645\u0642","dialog.save.firsttime":"\u0647\u0644 \u062A\u0631\u064A\u062F \u062D\u0641\u0638 \u0627\u0644\u062A\u063A\u064A\u064A\u0631\u0627\u062A \u0639\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u0645\u0634\u0631\u0648\u0639\u061F","dialog.save.again":"\u0647\u0644 \u062A\u0631\u064A\u062F \u062D\u0641\u0638 \u0627\u0644\u062A\u063A\u064A\u064A\u0631\u0627\u062A \u0639\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u0645\u0634\u0631\u0648\u0639\u061F","dialog.cancel":"\u0625\u0644\u063A\u0627\u0621","dialog.no":"\u0644\u0627","dialog.yes":"\u0646\u0639\u0645","enter.file.name":"\u0623\u062F\u062E\u0644 \u0627\u0633\u0645 \u0627\u0644\u0645\u0644\u0641",image:"\u0635\u0648\u0631\u0629","align.left":"\u0635\u0641\u0651 \u0644\u0644\u064A\u0633\u0627\u0631","align.center.x":"\u0635\u0641\u0651 \u0627\u0644\u0645\u062D\u0648\u0631 \u0627\u0644\u0623\u0641\u0642\u064A \u0644\u0644\u0648\u0633\u0637","align.right":"\u0635\u0641\u0651 \u0644\u0644\u064A\u0645\u064A\u0646","align.top":"\u0635\u0641\u0651 \u0644\u0644\u0623\u0639\u0644\u0649","align.center.y":"\u0635\u0641\u0651 \u0627\u0644\u0645\u062D\u0648\u0631 \u0627\u0644\u0639\u0645\u0648\u062F\u064A \u0644\u0644\u0648\u0633\u0637","align.bottom":"\u0635\u0641\u0651 \u0644\u0644\u0623\u0633\u0641\u0644","distribute.x":"\u062A\u0648\u0632\u064A\u0639 \u0623\u0641\u0642\u064A","distribute.y":"\u062A\u0648\u0632\u064A\u0639 \u0639\u0645\u0648\u062F\u064A","stretch.x":"\u062A\u0645\u062F\u064A\u062F \u0623\u0641\u0642\u064A","stretch.y":"\u062A\u0645\u062F\u064A\u062F \u0639\u0645\u0648\u062F\u064A"};var Ll={"style.menu.color":"Farve","style.menu.fill":"Fyld","style.menu.dash":"Streg","style.menu.size":"St\xF8rrelse","style.menu.keep.open":"Hold \xE5ben","style.menu.font":"Skrifttype","style.menu.align":"Juster",styles:"Format","zoom.in":"Zoom ind","zoom.out":"Zoom ud",to:"til","menu.tools":"V\xE6rkt\xF8jer","menu.transform":"Transformer","menu.file":"Fil","menu.edit":"Rediger","menu.view":"Vis","menu.preferences":"Indstillinger","menu.sign.in":"Log ind","menu.sign.out":"Log ud","become.a.sponsor":"Bliv sponsor","zoom.to.selection":"Zoom til valgte","zoom.to.fit":"Zoom til l\xE6rred","zoom.to":"Zoom til","zoom.to.content":"Zoom til indhold","preferences.dark.mode":"M\xF8rkt udseende","preferences.focus.mode":"Fokus tilstand","preferences.debug.mode":"Debug tilstand","preferences.show.grid":"Vis net","preferences.use.cad.selection":"Brug CAD udv\xE6lgelse","preferences.keep.stylemenu.open":"Hold formatmenuen \xE5ben","preferences.always.show.snaps":"Vis altid snaps","preferences.rotate.handles":"Roteringsh\xE5ndtag","preferences.binding.handles":"Bindingsh\xE5ndtag","preferences.clone.handles":"Kloningsh\xE5ndtag",undo:"Fortryd",redo:"Gentag",cut:"Klip",copy:"Kopier",paste:"Inds\xE6t","copy.as":"Kopier som","export.as":"Eksporter som","select.all":"V\xE6lg alt","select.none":"Frav\xE6lg alt",delete:"Slet","new.project":"Nyt projekt",open:"\xC5ben",save:"Gem","save.as":"Gem som","upload.media":"Upload medie","create.page":"Opret side","new.page":"Ny side","page.name":"Sidenavn",duplicate:"Dupliker",cancel:"Fortryd","copy.invite.link":"Kopier invitationslink","create.multiplayer.project":"Opret multiplayer projekt","copy.multiplayer.project":"Kopier til multiplayer projekt",select:"V\xE6lg",eraser:"Viskel\xE6der",draw:"Tegn",arrow:"Pil",text:"Tekst",sticky:"Note",rectangle:"Rektangel",ellipse:"Ellipse",triangle:"Trekant",line:"Linje",rotate:"Roter","lock.aspect.ratio":"L\xE5s billedformat","unlock.aspect.ratio":"Frig\xF8r billedformat",group:"Grupper",ungroup:"Opdel gruppe","move.to.back":"Placer bagerst","move.backward":"Flyt tilbage","move.forward":"Flyt frem","move.to.front":"L\xE6g forrest","reset.angle":"Nulstil vinkel",lock:"L\xE5s",unlock:"L\xE5s op","move.to.page":"Flyt til side","flip.horizontal":"Vend vandret","flip.vertical":"Vend lodret",move:"Flyt","to.front":"Forrest",forward:"Frem",backward:"Tilbage",back:"Bagerst",language:"Sprog","align.bottom":"Justering nederst","align.center.x":"Vandret justering centreret","align.center.y":"Lodret justering centreret","align.distribute":"Juster / distribuer","align.left":"Justering til venstre","align.right":"Justering til h\xF8jre","align.top":"Justering \xF8verst","copy.readonly.link":"Kopier skrivebeskyttet link","dialog.save.again":"Vil du gemme \xE6ndringerne til dit projekt?","dialog.save.firsttime":"Vil du gemme dit projekt?","dialog.yes":"Ja","dialog.no":"Nej","dialog.cancel":"Fortryd","enter.file.name":"Skriv filnavn","distribute.x":"Vandret distribuering","distribute.y":"Lodret distribuering","dock.position":"Placering af v\xE6rkt\xF8jslinje",bottom:"Nederst",left:"Venstre",right:"H\xF8jre",top:"\xD8verst","export.background":"Baggrund ved eksport",auto:"Automatisk",light:"Lys",dark:"M\xF8rk",image:"Billede","keyboard.shortcuts":"Tastaturgenveje",loading:"Indl\xE6ser",page:"Side",search:"S\xF8g","stretch.x":"Str\xE6k vandret","stretch.y":"Str\xE6k lodret","translation.link":"L\xE6r mere",transparent:"Gennemsigtig"};var Al={"style.menu.color":"Farbe","style.menu.fill":"F\xFCllen","style.menu.dash":"Strich","style.menu.size":"Gr\xF6\xDFe","style.menu.keep.open":"Offen halten","style.menu.font":"Schriftart","style.menu.align":"Ausrichten",styles:"Stile","zoom.in":"Heranzoomen","zoom.out":"Herauszoomen",to:"zu","menu.tools":"Werkzeuge","menu.transform":"Transformieren","menu.file":"Datei","menu.edit":"Bearbeiten","menu.view":"Ansicht","menu.preferences":"Pr\xE4ferenzen","menu.sign.in":"Einloggen","menu.sign.out":"Ausloggen","become.a.sponsor":"Sponsor werden","zoom.to.content":"Zur\xFCck zum Inhalt","zoom.to.selection":"Zur Auswahl zoomen","zoom.to.fit":"Zoom anpassen","zoom.to":"Zoomen nach","preferences.dark.mode":"Dunkler Modus","preferences.focus.mode":"Fokus Modus","preferences.debug.mode":"Debug Modus","preferences.show.grid":"Gitter anzeigen","preferences.use.cad.selection":"CAD Auswahl verwenden","preferences.keep.stylemenu.open":"Stilmen\xFC offen halten","preferences.always.show.snaps":"Hilfslinien immer anzeigen","preferences.rotate.handles":"Rotiergriffe","preferences.binding.handles":"Bindegriffe","preferences.clone.handles":"Klongriffe",undo:"R\xFCckg\xE4ngig machen",redo:"Wiederherstellen",cut:"Ausschneiden",copy:"Kopieren",paste:"Einf\xFCgen","copy.as":"Kopieren als","export.as":"Exportieren als","select.all":"Alles ausw\xE4hlen","select.none":"Nichts ausw\xE4hlen",delete:"L\xF6schen","new.project":"Neues Projekt",open:"\xD6ffnen",save:"Speichern","save.as":"Speichern als","upload.media":"Medien hochladen","create.page":"Seite erstellen","new.page":"Neue Seite","page.name":"Seitenname",duplicate:"Duplizieren","shape.options":"Form Optionen",shapes:"Fromen",cancel:"Abbrechen","copy.invite.link":"Einladungslink kopieren","copy.readonly.link":"Schreibgesch\xFCtzten Link kopieren","create.multiplayer.project":"Geteiltes Projekt erstellen","copy.multiplayer.project":"In ein Geteiltes Projekt kopieren",select:"Ausw\xE4hlen",eraser:"Radierer",draw:"Malen",arrow:"Pfeil",text:"Text",sticky:"Notiz",rectangle:"Rechteck",ellipse:"Ellipse",triangle:"Dreieck",line:"Linie",rotate:"Drehen","lock.aspect.ratio":"Seitenverh\xE4ltnis sperren","unlock.aspect.ratio":"Seitenverh\xE4ltnis entsperren",group:"Gruppieren",ungroup:"Gruppierung aufheben","move.to.back":"Nach Hinten verschieben","move.backward":"R\xFCckw\xE4rts schieben","move.forward":"Vorw\xE4rts schieben","move.to.front":"Nach Vorne verschieben","reset.angle":"Winkel zur\xFCcksetzen",lock:"Sperren",unlock:"Entsperren","align.distribute":"Ausrichten / Verteilen","move.to.page":"Zu Seite verschieben","flip.horizontal":"Horizontal spiegeln","flip.vertical":"Vertikal spiegeln",move:"Verschieben","to.front":"Nach Vorne",forward:"Vorw\xE4rts",backward:"R\xFCckw\xE4rts",back:"Hinten",language:"Sprache","translation.link":"Mehr erfahren","dock.position":"Dock Position",bottom:"Unten",left:"Links",right:"Rechts",top:"Oben",page:"Seite","keyboard.shortcuts":"Tastaturkurzbefehle",search:"Suche",loading:"Laden{dots}","export.background":"Hintergrund Exportieren",transparent:"Transparent",auto:"Auto",light:"Hell",dark:"Dunkel",github:"Github",twitter:"Twitter",discord:"Discord",image:"Bild","align.left":"Links ausrichten","align.center.x":"Horizontal mittig ausrichten","align.right":"Rechts ausrichten","align.top":"Oben ausrichten","align.center.y":"Vertikal mittig ausrichten","align.bottom":"Unten ausrichten","distribute.x":"Horizontal verteilen","distribute.y":"Vertikal verteilen","stretch.x":"Horizontal strecken","stretch.y":"Vertikal strecken","dialog.save.firsttime":"M\xF6chten Sie Ihr aktuelles Projekt speichern?","dialog.save.again":"M\xF6chten Sie die \xC4nderungen an Ihrem aktuellen Projekt speichern?","dialog.cancel":"Abbrechen","dialog.no":"Nein","dialog.yes":"Ja","enter.file.name":"Dateiname eingeben","telva-beta":"Probieren Sie das neue telva",white:"Wei\xDF",lightGray:"hellgrau",gray:"Frau",black:"Schwarz",green:"Gr\xFCn",cyan:"Cyan",blue:"Blau",indigo:"Indigo",violet:"Violett",red:"Rot",orange:"Orange",yellow:"Gelb",solid:"Durchgehend",dashed:"Gestrichelt",dotted:"Gepunktet",small:"Klein",medium:"Mittel",large:"Gro\xDF"};var Vl={};var Hl={"style.menu.color":"Color","style.menu.fill":"Relleno","style.menu.dash":"L\xEDnea","style.menu.size":"Tama\xF1o","style.menu.keep.open":"Mantener abierto","style.menu.font":"Fuente","style.menu.align":"Alineaci\xF3n",styles:"Estilos","zoom.in":"Acercar","zoom.out":"Alejar",to:"A","menu.tools":"Herramientas","menu.transform":"Transformar","menu.file":"Archivo","menu.edit":"Editar","menu.view":"Ver","menu.preferences":"Preferencias","menu.sign.in":"Iniciar sesi\xF3n","menu.sign.out":"Cerrar sesi\xF3n","become.a.sponsor":"Convi\xE9rtete en patrocinador","zoom.to.content":"Acercar al contenido","zoom.to.selection":"Acercar a la selecci\xF3n","zoom.to.fit":"Ajustar a la ventana","zoom.to":"Acercar a","preferences.dark.mode":"Modo oscuro","preferences.focus.mode":"Modo concentraci\xF3n","preferences.debug.mode":"Modo depuraci\xF3n","preferences.show.grid":"Mostrar cuadr\xEDcula","preferences.use.cad.selection":"Usar selecci\xF3n CAD","preferences.keep.stylemenu.open":"Mantener men\xFA de estilos abierto","preferences.always.show.snaps":"Mostrar puntos de ajuste","preferences.rotate.handles":"Control de rotaci\xF3n","preferences.binding.handles":"Control de vinculaci\xF3n","preferences.clone.handles":"Control de clonaci\xF3n",undo:"Deshacer",redo:"Rehacer",cut:"Cortar",copy:"Copiar",paste:"Pegar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todo","select.none":"Selecionar nada",delete:"Borrar","new.project":"Nuevo Proyecto",open:"Abrir",save:"Guardar","save.as":"Guardar como","upload.media":"Subir medios","create.page":"Crear p\xE1gina","new.page":"Nueva p\xE1gina","page.name":"Nombre de p\xE1gina",duplicate:"Duplicar","shape.options":"Opciones de formas",shapes:"Formas",cancel:"Cancelar","copy.invite.link":"Copiar invitaci\xF3n","copy.readonly.link":"Copiar invitaci\xF3n (solo lectura)","create.multiplayer.project":"Crear proyecto multijugador","copy.multiplayer.project":"Copiar proyecto multijugador",select:"Seleccionar",eraser:"Borrador",draw:"Dibujar",arrow:"Flecha",text:"Texto",sticky:"Pegatina",rectangle:"Rect\xE1ngulo",ellipse:"Elipse",triangle:"Tri\xE1ngulo",line:"L\xEDnea",rotate:"Rotar","lock.aspect.ratio":"Bloquear relaci\xF3n de aspecto","unlock.aspect.ratio":"Desbloquear relaci\xF3n de aspecto",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Mover al fondo","move.backward":"Mover atr\xE1s","move.forward":"Mover adelante","move.to.front":"Mover al frente","reset.angle":"Restablecer \xE1ngulo",lock:"Bloquear",unlock:"Desbloquear","align.distribute":"Alinear / Distribuir","move.to.page":"Mover a p\xE1gina","flip.horizontal":"Voltear horizontalmente","flip.vertical":"Voltear verticalmente",move:"Mover","to.front":"Al frente",forward:"Adelante",backward:"Atr\xE1s",back:"Fondo",language:"Idioma","translation.link":"Saber m\xE1s","dock.position":"Posici\xF3n del dock",bottom:"Abajo",left:"Izquierda",right:"Derecha",top:"Arriba",page:"P\xE1gina","keyboard.shortcuts":"Atajos de teclado",search:"Buscar",loading:"Cargando{dots}","export.background":"Exportar fondo",transparent:"Transparente",auto:"Auto",light:"Claro",dark:"Oscuro",github:"Github",twitter:"Twitter",discord:"Discord",image:"Imagen","align.left":"Alinear a la izquierda","align.center.x":"Alinear al centro horizontalmente","align.right":"Alinear a la derecha","align.top":"Alinear arriba","align.center.y":"Alinear al centro verticalmente","align.bottom":"Alinear abajo","distribute.x":"Distribuir horizontalmente","distribute.y":"Distribuir verticalmente","stretch.x":"Estirar horizontalmente","stretch.y":"Estirar verticalmente","dialog.save.firsttime":"\xBFQuieres guardar el proyecto actual?","dialog.save.again":"\xBFQuieres guardar los cambios en el proyecto actual?","dialog.cancel":"Cancelar","dialog.no":"No","dialog.yes":"S\xED","enter.file.name":"Introduce el nombre del arquivo","telva-beta":"Prueba el nuevo telva",white:"Blanco",lightGray:"Gris claro",gray:"Gris",black:"Negro",green:"Verde",cyan:"Cian",blue:"Azul",indigo:"Indigo",violet:"Violeta",red:"Rojo",orange:"Naranja",yellow:"Amarillo",solid:"Cont\xEDnuo",dashed:"Discont\xEDnuo",dotted:"Punteado",small:"Peque\xF1o",medium:"Mediano",large:"Grande"};var zl={"style.menu.color":"\u0631\u0646\u06AF","style.menu.fill":"\u062A\u0648\u067E\u064F\u0631","style.menu.dash":"\u062E\u0637\u200C\u0686\u06CC\u0646","style.menu.size":"\u0627\u0646\u062F\u0627\u0632\u0647","style.menu.keep.open":"\u0628\u0627\u0632 \u0646\u06AF\u0647\u200C\u062F\u0627\u0634\u062A\u0646","style.menu.font":"\u0642\u0644\u0645","style.menu.align":"\u062A\u0631\u0627\u0632",styles:"\u0633\u0628\u06A9\u200C\u0647\u0627","zoom.in":"\u0628\u0632\u0631\u06AF\u200C\u0646\u0645\u0627\u06CC\u06CC","zoom.out":"\u06A9\u0648\u0686\u06A9\u200C\u0646\u0645\u0627\u06CC\u06CC",to:"\u0628\u0647","menu.tools":"\u0627\u0628\u0632\u0627\u0631\u0647\u0627","menu.transform":"\u062A\u063A\u06CC\u06CC\u0631 \u0634\u06A9\u0644","menu.file":"\u067E\u0631\u0648\u0646\u062F\u0647","menu.edit":"\u0648\u06CC\u0631\u0627\u06CC\u0634","menu.view":"\u0646\u0645\u0627\u06CC\u0634","menu.preferences":"\u062A\u0631\u062C\u06CC\u062D\u0627\u062A","menu.sign.in":"\u0648\u0631\u0648\u062F","menu.sign.out":"\u062E\u0631\u0648\u062C","become.a.sponsor":"\u062D\u0645\u0627\u06CC\u062A\u200C\u06A9\u0646\u0646\u062F\u0647 \u0634\u0648\u06CC\u062F","zoom.to.content":"\u0628\u0627\u0632\u06AF\u0634\u062A \u0628\u0647 \u0645\u062D\u062A\u0648\u0627","zoom.to.selection":"\u0628\u0632\u0631\u06AF\u200C\u0646\u0645\u0627\u06CC\u06CC \u0628\u0647 \u0646\u0627\u062D\u06CC\u0647 \u0627\u0646\u062A\u062E\u0627\u0628\u200C\u0634\u062F\u0647","zoom.to.fit":"\u0628\u0632\u0631\u06AF\u200C\u0646\u0645\u0627\u06CC\u06CC \u0645\u062A\u0646\u0627\u0633\u0628 \u0628\u0627 \u0635\u0641\u062D\u0647","zoom.to":"\u0628\u0632\u0631\u06AF\u200C\u0646\u0645\u0627\u06CC\u06CC \u0628\u0647","preferences.dark.mode":"\u062D\u0627\u0644\u062A \u062A\u0627\u0631\u06CC\u06A9","preferences.focus.mode":"\u062D\u0627\u0644\u062A \u062A\u0645\u0631\u06A9\u0632","preferences.debug.mode":"\u062D\u0627\u0644\u062A \u0639\u06CC\u0628\u200C\u06CC\u0627\u0628\u06CC","preferences.show.grid":"\u0646\u0645\u0627\u06CC\u0634 \u062E\u0637\u0648\u0637 \u0631\u0627\u0647\u0646\u0645\u0627","preferences.use.cad.selection":"\u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0627\u0632 \u062D\u0627\u0644\u062A \u0627\u0646\u062A\u062E\u0627\u0628 CAD","preferences.keep.stylemenu.open":"\u0628\u0627\u0632 \u0646\u06AF\u0647\u200C\u062F\u0627\u0634\u062A\u0646 \u0645\u0646\u0648\u06CC \u0633\u0628\u06A9\u200C\u0647\u0627","preferences.always.show.snaps":"\u0647\u0645\u06CC\u0634\u0647 \u0646\u0642\u0627\u0637 \u0686\u0633\u0628\u0627\u0646 \u0631\u0627 \u0646\u0634\u0627\u0646 \u0628\u062F\u0647","preferences.rotate.handles":"\u062F\u0633\u062A\u06AF\u06CC\u0631\u0647\u200C\u0647\u0627\u06CC \u0686\u0631\u062E\u0634","preferences.binding.handles":"\u062F\u0633\u062A\u06AF\u06CC\u0631\u0647\u200C\u0647\u0627\u06CC \u0627\u062A\u0635\u0627\u0644\u200C\u062F\u0647\u0646\u062F\u0647","preferences.clone.handles":"\u062F\u0633\u062A\u06AF\u06CC\u0631\u0647\u200C\u0647\u0627\u06CC \u062A\u06A9\u062B\u06CC\u0631",undo:"\u0648\u0627\u06AF\u0631\u062F\u0627\u0646\u06CC",redo:"\u0627\u0646\u062C\u0627\u0645 \u062F\u0648\u0628\u0627\u0631\u0647",cut:"\u0628\u0631\u06CC\u062F\u0646",copy:"\u06A9\u067E\u06CC",paste:"\u062C\u0627\u06CC\u200C\u06AF\u0630\u0627\u0631\u06CC","copy.as":"\u06A9\u067E\u06CC \u0628\u0647\u200C\u0639\u0646\u0648\u0627\u0646","export.as":"\u062E\u0631\u0648\u062C\u06CC\u200C\u06AF\u0631\u0641\u062A\u0646 \u0628\u0647\u200C\u0639\u0646\u0648\u0627\u0646","select.all":"\u0627\u0646\u062A\u062E\u0627\u0628 \u0647\u0645\u0647","select.none":"\u0627\u0646\u062A\u062E\u0627\u0628 \u0647\u06CC\u0686\u200C\u06CC\u06A9",delete:"\u062D\u0630\u0641","new.project":"\u067E\u0631\u0648\u0698\u0647 \u062C\u062F\u06CC\u062F",open:"\u0628\u0627\u0632\u06A9\u0631\u062F\u0646",save:"\u0630\u062E\u06CC\u0631\u0647","save.as":"\u0630\u062E\u06CC\u0631\u0647 \u0628\u0647\u200C\u0639\u0646\u0648\u0627\u0646","upload.media":"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u0631\u0633\u0627\u0646\u0647","create.page":"\u0627\u06CC\u062C\u0627\u062F \u0628\u0631\u06AF\u0647","new.page":"\u0628\u0631\u06AF\u0647 \u062C\u062F\u06CC\u062F","page.name":"\u0646\u0627\u0645 \u0628\u0631\u06AF\u0647",duplicate:"\u062A\u06A9\u062B\u06CC\u0631\u06A9\u0631\u062F\u0646","shape.options":"\u06AF\u0632\u06CC\u0646\u0647\u200C\u0647\u0627\u06CC \u0634\u06A9\u0644",shapes:"\u0634\u06A9\u0644\u200C\u0647\u0627",cancel:"\u0644\u063A\u0648","copy.invite.link":"\u06A9\u067E\u06CC\u200C\u06A9\u0631\u062F\u0646 \u067E\u06CC\u0648\u0646\u062F \u062F\u0639\u0648\u062A","copy.readonly.link":"\u06A9\u067E\u06CC\u200C\u06A9\u0631\u062F\u0646 \u067E\u06CC\u0648\u0646\u062F \u063A\u06CC\u0631\u0642\u0627\u0628\u0644 \u0648\u06CC\u0631\u0627\u06CC\u0634","create.multiplayer.project":"\u0627\u06CC\u062C\u0627\u062F \u06CC\u06A9 \u067E\u0631\u0648\u0698\u0647 \u0686\u0646\u062F\u0646\u0641\u0631\u0647","copy.multiplayer.project":"\u06A9\u067E\u06CC \u0628\u0647 \u067E\u0631\u0648\u0698\u0647 \u0686\u0646\u062F\u0646\u0641\u0631\u0647",select:"\u0627\u0646\u062A\u062E\u0627\u0628",eraser:"\u067E\u0627\u06A9\u200C\u06A9\u0646",draw:"\u0631\u0633\u0645",arrow:"\u0641\u0650\u0644\u0650\u0634",text:"\u0645\u062A\u0646",sticky:"\u0628\u0631\u06AF\u0647 \u0686\u0633\u0628\u0627\u0646",rectangle:"\u0686\u0647\u0627\u0631\u06AF\u0648\u0634",ellipse:"\u06AF\u0631\u062F\u06CC",triangle:"\u0633\u0647\u200C\u06AF\u0648\u0634",line:"\u062E\u0637",rotate:"\u0686\u0631\u062E\u0627\u0646\u062F\u0646","lock.aspect.ratio":"\u0642\u0641\u0644\u200C\u06A9\u0631\u062F\u0646 \u0646\u0633\u0628\u062A \u0627\u0628\u0639\u0627\u062F","unlock.aspect.ratio":"\u0627\u062C\u0627\u0632\u0647 \u062A\u063A\u06CC\u06CC\u0631 \u0646\u0633\u0628\u062A \u0627\u0628\u0639\u0627\u062F",group:"\u06AF\u0631\u0648\u0647\u200C\u0628\u0646\u062F\u06CC",ungroup:"\u0644\u063A\u0648 \u06AF\u0631\u0648\u0647\u200C\u0628\u0646\u062F\u06CC","move.to.back":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u0639\u0642\u0628","move.backward":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u0633\u0645\u062A \u0639\u0642\u0628","move.forward":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u0633\u0645\u062A \u062C\u0644\u0648","move.to.front":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u062C\u0644\u0648","reset.angle":"\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u06CC \u0632\u0627\u0648\u06CC\u0647",lock:"\u0642\u0641\u0644",unlock:"\u0628\u0627\u0632\u06A9\u0631\u062F\u0646 \u0642\u0641\u0644","align.distribute":"\u062A\u0631\u0627\u0632 / \u067E\u062E\u0634\u200C\u06A9\u0631\u062F\u0646","move.to.page":"\u0627\u0646\u062A\u0642\u0627\u0644 \u0628\u0647 \u0628\u0631\u06AF\u0647","flip.horizontal":"\u0648\u0627\u0631\u0648\u0646\u0647\u200C\u0633\u0627\u0632\u06CC \u0627\u0641\u0642\u06CC","flip.vertical":"\u0648\u0627\u0631\u0648\u0646\u0647\u200C\u0633\u0627\u0632\u06CC \u0639\u0645\u0648\u062F\u06CC",move:"\u062D\u0631\u06A9\u062A\u200C\u062F\u0627\u062F\u0646","to.front":"\u0628\u0647 \u062C\u0644\u0648",forward:"\u0628\u0647 \u0633\u0645\u062A \u062C\u0644\u0648",backward:"\u0628\u0647 \u0633\u0645\u062A \u0639\u0642\u0628",back:"\u0628\u0647 \u0639\u0642\u0628",language:"\u0632\u0628\u0627\u0646","translation.link":"\u06CC\u0627\u062F\u06AF\u06CC\u0631\u06CC \u0628\u06CC\u0634\u062A\u0631","dock.position":"\u0645\u0648\u0642\u0639\u06CC\u062A \u0646\u0648\u0627\u0631 \u0627\u0628\u0632\u0627\u0631",bottom:"\u067E\u0627\u06CC\u06CC\u0646",left:"\u0686\u067E",right:"\u0631\u0627\u0633\u062A",top:"\u0628\u0627\u0644\u0627",page:"\u0628\u0631\u06AF\u0647","keyboard.shortcuts":"\u0645\u06CC\u0627\u0646\u200C\u0628\u0631\u0647\u0627\u06CC \u0635\u0641\u062D\u0647\u200C\u06A9\u0644\u06CC\u062F",search:"\u062C\u0633\u062A\u062C\u0648",loading:"\u0628\u0627\u0631\u06AF\u06CC\u0631\u06CC{dots}","export.background":"\u062E\u0631\u0648\u062C\u06CC\u200C\u06AF\u0631\u0641\u062A\u0646 \u067E\u0633\u200C\u0632\u0645\u06CC\u0646\u0647",transparent:"\u0634\u0641\u0627\u0641",auto:"\u062E\u0648\u062F\u06A9\u0627\u0631",light:"\u0631\u0648\u0634\u0646",dark:"\u062A\u0627\u0631\u06CC\u06A9",github:"\u06AF\u06CC\u062A\u200C\u0647\u0627\u0628",twitter:"\u062A\u0648\u06CC\u06CC\u062A\u0631",discord:"\u062F\u06CC\u0633\u06A9\u0648\u0631\u062F",image:"\u062A\u0635\u0648\u06CC\u0631","align.left":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0686\u067E","align.center.x":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0645\u0631\u06A9\u0632 \u0627\u0641\u0642\u06CC","align.right":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0631\u0627\u0633\u062A","align.top":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0628\u0627\u0644\u0627","align.center.y":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u0645\u0631\u06A9\u0632 \u0639\u0645\u0648\u062F\u06CC","align.bottom":"\u062A\u0631\u0627\u0632 \u0628\u0647 \u067E\u0627\u06CC\u06CC\u0646","distribute.x":"\u067E\u062E\u0634\u200C\u06A9\u0631\u062F\u0646 \u0627\u0641\u0642\u06CC","distribute.y":"\u067E\u062E\u0634\u200C\u06A9\u0631\u062F\u0646 \u0639\u0645\u0648\u062F\u06CC","stretch.x":"\u06A9\u0634\u200C\u0622\u0648\u0631\u062F\u0646 \u0627\u0641\u0642\u06CC","stretch.y":"\u06A9\u0634\u200C\u0622\u0648\u0631\u062F\u0646 \u0639\u0645\u0648\u062F\u06CC","dialog.save.firsttime":"\u0622\u06CC\u0627 \u0645\u06CC\u200C\u062E\u0648\u0627\u0647\u06CC\u062F \u067E\u0631\u0648\u0698\u0647 \u0641\u0639\u0644\u06CC \u062E\u0648\u062F \u0631\u0627 \u0630\u062E\u06CC\u0631\u0647 \u06A9\u0646\u06CC\u062F\u061F","dialog.save.again":"\u0622\u06CC\u0627 \u0645\u06CC\u200C\u062E\u0648\u0627\u0647\u06CC\u062F \u06A9\u0647 \u062A\u063A\u06CC\u06CC\u0631\u0627\u062A \u0631\u0627 \u062F\u0631 \u067E\u0631\u0648\u0698\u0647 \u0641\u0639\u0644\u06CC \u062E\u0648\u062F \u0630\u062E\u06CC\u0631\u0647 \u06A9\u0646\u06CC\u062F\u061F","dialog.cancel":"\u0644\u063A\u0648","dialog.no":"\u062E\u06CC\u0631","dialog.yes":"\u0628\u0644\u0647","enter.file.name":"\u0646\u0627\u0645 \u067E\u0631\u0648\u0646\u062F\u0647 \u0631\u0627 \u0648\u0627\u0631\u062F \u06A9\u0646\u06CC\u062F","telva-beta":"\u0627\u0645\u062A\u062D\u0627\u0646\u200C\u06A9\u0631\u062F\u0646 telva \u062C\u062F\u06CC\u062F",white:"\u0633\u0641\u06CC\u062F",lightGray:"\u062E\u0627\u06A9\u0633\u062A\u0631\u06CC \u0631\u0648\u0634\u0646",gray:"\u062E\u0627\u06A9\u0633\u062A\u0631\u06CC",black:"\u0645\u0634\u06A9\u06CC",green:"\u0633\u0628\u0632",cyan:"\u0641\u06CC\u0631\u0648\u0632\u0647\u200C\u0627\u06CC",blue:"\u0622\u0628\u06CC",indigo:"\u0646\u06CC\u0644\u06CC",violet:"\u0628\u0646\u0641\u0634",red:"\u0642\u0631\u0645\u0632",orange:"\u0646\u0627\u0631\u0646\u062C\u06CC",yellow:"\u0632\u0631\u062F",solid:"\u062A\u0648\u067E\u064F\u0631",dashed:"\u062E\u0637\u200C\u0686\u06CC\u0646",dotted:"\u0646\u0642\u0637\u0647\u200C\u0686\u06CC\u0646",small:"\u06A9\u0648\u0686\u06A9",medium:"\u0645\u062A\u0648\u0633\u0637",large:"\u0628\u0632\u0631\u06AF"};var Fl={"style.menu.color":"Couleur","style.menu.fill":"Remplir","style.menu.dash":"Bordure","style.menu.size":"Taille","style.menu.keep.open":"Toujours afficher le menu","style.menu.font":"Police","style.menu.align":"Alignement",styles:"Styles","zoom.in":"Zoom avant","zoom.out":"Zoom arri\xE8re",to:"\xC0","menu.tools":"Outils","menu.transform":"Transformation","menu.file":"Fichier","menu.edit":"\xC9dition","menu.view":"Afficher","menu.preferences":"Pr\xE9f\xE9rences","menu.sign.in":"S'authentifier","menu.sign.out":"Se d\xE9connecter","become.a.sponsor":"Devenir un sponsor","zoom.to.content":"Retour au contenu","zoom.to.selection":"Ajuster le zoom \xE0 la s\xE9lection","zoom.to.fit":"Adapter le zoom au contenu","zoom.to":"R\xE9tablir le zoom \xE0","preferences.dark.mode":"Mode sombre","preferences.focus.mode":"Mode focus","preferences.debug.mode":"Afficher la barre d\xE9veloppeur","preferences.show.grid":"Afficher la grille","preferences.use.cad.selection":"Utiliser la s\xE9lection CAD","preferences.keep.stylemenu.open":"Toujours afficher le menu styles","preferences.always.show.snaps":"Afficher les rep\xE8res dynamiques","preferences.rotate.handles":"Manier la rotation","preferences.binding.handles":"Manier les liaisons","preferences.clone.handles":"Manier le clonage",undo:"Annuler",redo:"R\xE9tablir",cut:"Couper",copy:"Copier",paste:"Coller","copy.as":"Copier au format","export.as":"Exporter au format","select.all":"Tout s\xE9lectionner","select.none":"Tout d\xE9s\xE9lectionner",delete:"Supprimer","new.project":"Nouveau project",open:"Ouvrir",save:"Enregistrer","save.as":"Enregistrer sous","upload.media":"Importer un m\xE9dia","create.page":"Cr\xE9er une page","new.page":"Nouvelle Page","page.name":"Nom de la page",duplicate:"Dupliquer",cancel:"Annuler","copy.invite.link":"Copier le lien d'invitation","copy.readonly.link":"Copier le lien en lecture seule d'invitation","create.multiplayer.project":"Cr\xE9er un project multi-joueurs","copy.multiplayer.project":"Copier dans un projet multi-joueurs",select:"S\xE9lection",eraser:"Gomme",draw:"Crayon",arrow:"Fl\xE8che",text:"Texte",sticky:"Note",rectangle:"Rectangle",ellipse:"Cercle",triangle:"Triangle",line:"Ligne",rotate:"Rotation","lock.aspect.ratio":"Verrouiller les proportions","unlock.aspect.ratio":"D\xE9verrouiller les proportions",group:"Grouper",ungroup:"D\xE9grouper","move.to.back":"D\xE9placer \xE0 l'arri\xE8re-plan","move.backward":"Reculer d'un plan","move.forward":"Avancer d'un plan","move.to.front":"Placer au premier plan","reset.angle":"R\xE9initialiser la rotation",lock:"Verrouiller",unlock:"D\xE9verrouiller","align.distribute":"Alignement / R\xE9partion","move.to.page":"D\xE9placer vers la page","flip.horizontal":"Retourner horizontalement","flip.vertical":"Retourner verticalement",move:"Disposition","to.front":"Placer au premier plan",forward:"Avancer d'un plan",backward:"Reculer d'un plan",back:"D\xE9placer \xE0 l'arri\xE8re-plan",language:"Langage","translation.link":"En savoir plus","dock.position":"Position du dock",bottom:"En bas",left:"\xC0 gauche",right:"\xC0 droite",top:"En haut",page:"Page","keyboard.shortcuts":"Raccourcis clavier",search:"Rechercher",loading:"Chargement{dots}","export.background":"Couleur d'arri\xE8re-plan de l'export",transparent:"Transparent",auto:"Automatique",light:"Clair",dark:"Sombre"};var Ol={"style.menu.color":"Cor","style.menu.fill":"Recheo","style.menu.dash":"Li\xF1a","style.menu.size":"Tama\xF1o","style.menu.keep.open":"Manter aberto","style.menu.font":"Fonte","style.menu.align":"Ali\xF1amento",styles:"Estilos","zoom.in":"Achegar","zoom.out":"Afastar",to:"A","menu.tools":"Ferramentas","menu.transform":"Transformar","menu.file":"Arquivo","menu.edit":"Editar","menu.view":"Ver","menu.preferences":"Preferencias","menu.sign.in":"Iniciar sesi\xF3n","menu.sign.out":"Pechar sesi\xF3n","become.a.sponsor":"Conv\xEDrtete en patrocinador","zoom.to.content":"Achegar ao contido","zoom.to.selection":"Achegar \xE1 selecci\xF3n","zoom.to.fit":"Axustar \xE1 vent\xE1","zoom.to":"Achegar a","preferences.dark.mode":"Modo escuro","preferences.focus.mode":"Modo concentraci\xF3n","preferences.debug.mode":"Modo depuraci\xF3n","preferences.show.grid":"Amosar cuadr\xEDcula","preferences.use.cad.selection":"Usar selecci\xF3n CAD","preferences.keep.stylemenu.open":"Manter men\xFA de estilos aberto","preferences.always.show.snaps":"Amosar puntos de axuste","preferences.rotate.handles":"Control de rotaci\xF3n","preferences.binding.handles":"Control de vinculaci\xF3n","preferences.clone.handles":"Control de clonaci\xF3n",undo:"Desfacer",redo:"Refacer",cut:"Cortar",copy:"Copiar",paste:"Pegar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todo","select.none":"Selecionar nada",delete:"Borrar","new.project":"Novo Proxecto",open:"Abrir",save:"Gardar","save.as":"Gardar como","upload.media":"Subir medios","create.page":"Crear p\xE1xina","new.page":"Nova p\xE1xina","page.name":"Nome de p\xE1xina",duplicate:"Duplicar","shape.options":"Opci\xF3ns de formas",shapes:"Formas",cancel:"Cancelar","copy.invite.link":"Copiar invitaci\xF3n","copy.readonly.link":"Copiar invitaci\xF3n (s\xF3 lectura)","create.multiplayer.project":"Crear proxecto multixogador","copy.multiplayer.project":"Copiar proxecto multixogador",select:"Seleccionar",eraser:"Borrador",draw:"Debuxar",arrow:"Frecha",text:"Texto",sticky:"Pegatina",rectangle:"Rect\xE1ngulo",ellipse:"Elipse",triangle:"Tri\xE1ngulo",line:"Li\xF1a",rotate:"Rotar","lock.aspect.ratio":"Bloquear relaci\xF3n de aspecto","unlock.aspect.ratio":"Desbloquear relaci\xF3n de aspecto",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Mover ao fondo","move.backward":"Mover atr\xE1s","move.forward":"Mover adiante","move.to.front":"Mover ao fronte","reset.angle":"Restablecer \xE1ngulo",lock:"Bloquear",unlock:"Desbloquear","align.distribute":"Ali\xF1ar / Distribu\xEDr","move.to.page":"Mover \xE1 p\xE1xina","flip.horizontal":"Voltear horizontalmente","flip.vertical":"Voltear verticalmente",move:"Mover","to.front":"Ao fronte",forward:"Adilante",backward:"Atr\xE1s",back:"Fondo",language:"Idioma","translation.link":"Saber m\xE1is","dock.position":"Posici\xF3n do dock",bottom:"Abaixo",left:"Esquerda",right:"Dereita",top:"Arriba",page:"P\xE1xina","keyboard.shortcuts":"Atallos de teclado",search:"Buscar",loading:"Cargando{dots}","export.background":"Exportar fondo",transparent:"Transparente",auto:"Auto",light:"Claro",dark:"Escuro",github:"Github",twitter:"Twitter",discord:"Discord",image:"Imaxe","align.left":"Ali\xF1ar \xE1 esquerda","align.center.x":"Ali\xF1ar ao centro horizontalmente","align.right":"Ali\xF1ar \xE1 dereita","align.top":"Ali\xF1ar arriba","align.center.y":"Ali\xF1ar ao centro verticalmente","align.bottom":"Ali\xF1ar abaixo","distribute.x":"Distribu\xEDr horizontalmente","distribute.y":"Distribu\xEDr verticalmente","stretch.x":"Estirar horizontalmente","stretch.y":"Estirar verticalmente","dialog.save.firsttime":"Queres gardar o proxecto actual?","dialog.save.again":"Queres gardar os cambios ao proxecto actual?","dialog.cancel":"Cancelar","dialog.no":"No","dialog.yes":"S\xED","enter.file.name":"Introduce o nome do arquivo","telva-beta":"Proba o novo telva",white:"Branco",lightGray:"Gris claro",gray:"Gris",black:"Negro",green:"Verde",cyan:"Cian",blue:"Azul",indigo:"Indigo",violet:"Violeta",red:"Vermello",orange:"Laranxa",yellow:"Amarelo",solid:"Cont\xEDnuo",dashed:"Discont\xEDnuo",dotted:"Punteado",small:"Pequeno",medium:"Mediano",large:"Grande"};var $l={"style.menu.color":"\u05E6\u05D1\u05E2","style.menu.fill":"\u05DE\u05DC\u05D0","style.menu.dash":"\u05D2\u05D1\u05D5\u05DC","style.menu.size":"\u05D2\u05D5\u05D3\u05DC","style.menu.keep.open":"\u05D4\u05E9\u05D0\u05E8 \u05E4\u05EA\u05D5\u05D7","style.menu.font":"\u05D2\u05D5\u05E4\u05DF","style.menu.align":"\u05D9\u05D9\u05E9\u05D5\u05E8",styles:"\u05E2\u05D9\u05E6\u05D5\u05D1","zoom.in":"\u05D4\u05D2\u05D3\u05DC \u05EA\u05E6\u05D5\u05D2\u05D4","zoom.out":"\u05D4\u05E7\u05D8\u05DF \u05EA\u05E6\u05D5\u05D2\u05D4",to:"\u05DC","menu.file":"\u05E7\u05D5\u05D1\u05E5","menu.edit":"\u05E2\u05E8\u05D9\u05DB\u05D4","menu.view":"\u05EA\u05E6\u05D5\u05D2\u05D4","menu.preferences":"\u05DE\u05D0\u05E4\u05D9\u05D9\u05E0\u05D9\u05DD","menu.sign.in":"\u05D4\u05D9\u05E8\u05E9\u05DD","menu.sign.out":"\u05D4\u05EA\u05E0\u05EA\u05E7","become.a.sponsor":"\u05DE\u05EA\u05DF \u05D7\u05E1\u05D5\u05EA","zoom.to.selection":"\u05D6\u05D5\u05DD \u05DC\u05D1\u05D7\u05D9\u05E8\u05D4","zoom.to.fit":"\u05D6\u05D5\u05DD \u05DC\u05D4\u05EA\u05D0\u05DE\u05D4","zoom.to":"\u05D6\u05D5\u05DD \u05DC","preferences.dark.mode":"\u05DE\u05E6\u05D1 \u05D7\u05E9\u05D5\u05DA","preferences.focus.mode":"\u05DE\u05E6\u05D1 \u05E4\u05D5\u05E7\u05D5\u05E1","preferences.debug.mode":"\u05DE\u05E6\u05D1 \u05D3\u05D9\u05D1\u05D0\u05D2","preferences.show.grid":"(\u05D2\u05E8\u05D9\u05D3)\u05D4\u05E8\u05D0\u05D4 \u05E8\u05E9\u05EA \u05E2\u05D9\u05DE\u05D5\u05D3","preferences.use.cad.selection":"\u05E1\u05D9\u05DE\u05D5\u05DF CAD","preferences.keep.stylemenu.open":"\u05D4\u05E9\u05D0\u05E8 \u05EA\u05E4\u05E8\u05D9\u05D8 \u05E2\u05D9\u05E6\u05D5\u05D1 \u05E4\u05EA\u05D5\u05D7","preferences.always.show.snaps":"\u05D4\u05E8\u05D0\u05D4 \u05E7\u05D5\u05D5\u05D9 \u05DE\u05EA\u05D0\u05E8","preferences.rotate.handles":"\u05D4\u05E8\u05D0\u05D4 \u05D9\u05D3\u05D9\u05D5\u05EA \u05E1\u05D9\u05D1\u05D5\u05D1","preferences.binding.handles":"\u05D4\u05E8\u05D0\u05D4 \u05D9\u05D3\u05D9\u05D5\u05EA \u05E7\u05E9\u05D9\u05E8\u05D4","preferences.clone.handles":"\u05D4\u05E8\u05D0\u05D4 \u05D9\u05D3\u05D9\u05D5\u05EA \u05E9\u05D9\u05DB\u05E4\u05D5\u05DC",undo:"\u05D1\u05D8\u05DC",redo:"\u05E2\u05E9\u05D4 \u05DE\u05D7\u05D3\u05E9",cut:"\u05D2\u05D6\u05D5\u05E8",copy:"\u05D4\u05E2\u05EA\u05E7",paste:"\u05D4\u05D3\u05D1\u05E7","copy.as":"\u05D4\u05E2\u05EA\u05E7 \u05DB","export.as":"\u05D9\u05D9\u05E6\u05D0 \u05DB","select.all":"\u05D1\u05D7\u05E8 \u05D4\u05DB\u05DC","select.none":"\u05D1\u05D8\u05DC \u05D1\u05D7\u05D9\u05E8\u05D4",delete:"\u05DE\u05D7\u05E7","new.project":"\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8 \u05D7\u05D3\u05E9",open:"\u05E4\u05EA\u05D7",save:"\u05E9\u05DE\u05D5\u05E8","save.as":"\u05E9\u05DE\u05D5\u05E8 \u05DB","upload.media":"\u05D4\u05E2\u05DC\u05D0\u05EA \u05DE\u05D3\u05D9\u05D4","create.page":"\u05E6\u05D5\u05E8 \u05D3\u05E3","new.page":"\u05D3\u05E3 \u05D7\u05D3\u05E9","page.name":"\u05E9\u05DD \u05D4\u05D3\u05E3",duplicate:"\u05E9\u05DB\u05E4\u05DC",cancel:"\u05D1\u05D8\u05DC","copy.invite.link":"\u05D4\u05E2\u05EA\u05E7 \u05E7\u05D9\u05E9\u05D5\u05E8 \u05D4\u05D6\u05DE\u05E0\u05D4","create.multiplayer.project":"\u05E6\u05D5\u05E8 \u05E4\u05E8\u05D5\u05D9\u05E7\u05D8 \u05E8\u05D1 \u05DE\u05E9\u05EA\u05EA\u05E4\u05D9\u05DD","copy.multiplayer.project":"\u05D4\u05E2\u05EA\u05E7 \u05DC\u05E4\u05E8\u05D5\u05D9\u05E7\u05D8 \u05E8\u05D1 \u05DE\u05E9\u05EA\u05EA\u05E4\u05D9\u05DD",select:"\u05E1\u05DE\u05DF",eraser:"\u05DE\u05D7\u05E7",draw:"\u05E6\u05D9\u05D9\u05E8",arrow:"\u05D7\u05E5",text:"\u05D8\u05E7\u05E1\u05D8",sticky:"\u05D3\u05D1\u05D9\u05E7\u05D9",rectangle:"\u05DE\u05E8\u05D5\u05D1\u05E2",ellipse:"\u05D0\u05DC\u05D9\u05E4\u05E1\u05D4",triangle:"\u05DE\u05E9\u05D5\u05DC\u05E9",line:"\u05E7\u05D5",rotate:"\u05E1\u05D5\u05D1\u05D1","lock.aspect.ratio":"\u05E0\u05E2\u05DC \u05D9\u05D7\u05E1 \u05E8\u05D5\u05D7\u05D1-\u05D2\u05D5\u05D1\u05D4","unlock.aspect.ratio":"\u05E9\u05D7\u05E8\u05E8 \u05E0\u05E2\u05D9\u05DC\u05EA \u05D9\u05D7\u05E1 \u05E8\u05D5\u05D7\u05D1-\u05D2\u05D5\u05D1\u05D4",group:"\u05E7\u05D1\u05E5",ungroup:"\u05D1\u05D8\u05DC \u05E7\u05D9\u05D1\u05D5\u05E5","move.to.back":"\u05D4\u05D1\u05D0 \u05DC\u05EA\u05D7\u05EA\u05D9\u05EA","move.backward":"\u05D4\u05D6\u05D6 \u05D0\u05D7\u05D5\u05E8\u05D4","move.forward":"\u05D4\u05D6\u05D6 \u05E7\u05D3\u05D9\u05DE\u05D4","move.to.front":"\u05D4\u05D1\u05D0 \u05DC\u05D7\u05D6\u05D9\u05EA","reset.angle":"\u05D0\u05E4\u05E1 \u05D6\u05D5\u05D5\u05D9\u05EA",lock:"\u05E0\u05E2\u05DC",unlock:"\u05E9\u05D7\u05E8\u05E8 \u05E0\u05E2\u05D9\u05DC\u05D4","move.to.page":"\u05D4\u05D6\u05D6 \u05DC\u05D3\u05E3","flip.horizontal":"\u05D4\u05E4\u05D5\u05DA \u05D0\u05D5\u05E4\u05E7\u05D9\u05EA","flip.vertical":"\u05D4\u05E4\u05D5\u05DA \u05D0\u05E0\u05DB\u05D9\u05EA",move:"\u05D4\u05D6\u05D6","to.front":"\u05D4\u05D1\u05D0 \u05DC\u05E7\u05D3\u05D9\u05DE\u05D4",forward:"\u05E7\u05D3\u05D9\u05DE\u05D4",backward:"\u05D0\u05D7\u05D5\u05E8\u05D4",back:"\u05D1\u05D7\u05D6\u05E8\u05D4",language:"\u05E9\u05E4\u05D4"};var Gl={"style.menu.color":"Colore","style.menu.fill":"Riempi","style.menu.dash":"Tratteggo","style.menu.size":"Dimensione","style.menu.keep.open":"Mantieni aperto","style.menu.font":"Font","style.menu.align":"Allineamento",styles:"Stile","zoom.in":"Ingrandisci","zoom.out":"Rimpicciolisci",to:"Imposta","menu.file":"File","menu.edit":"Modifica","menu.view":"Visualizzazione","menu.preferences":"Preferenze","menu.sign.in":"Accedi","menu.sign.out":"Esci","become.a.sponsor":"Sponsorizza","zoom.to.selection":"Adatta alla selezione","zoom.to.fit":"Adatta","zoom.to":"Ingrandisci","preferences.dark.mode":"Modalit\xE0 scura","preferences.focus.mode":"Modalit\xE0 zen","preferences.debug.mode":"Modalit\xE0 sviluppatore","preferences.show.grid":"Mostra griglia","preferences.use.cad.selection":"Selezione CAD","preferences.keep.stylemenu.open":"Mantieni menu stile aperto","preferences.always.show.snaps":"Mostra sempre le guide","preferences.rotate.handles":"Controlli d'inclinazione","preferences.binding.handles":"Controlli d'associazione","preferences.clone.handles":"Controlli di clonazione",undo:"Annulla",redo:"Ripristina",cut:"Taglia",copy:"Copia",paste:"Incolla","copy.as":"Copia come","export.as":"Esporta come","select.all":"Seleziona tutto","select.none":"Deseleziona tutto",delete:"Elimina","new.project":"Nuovo progetto",open:"Apri",save:"Salva","save.as":"Salva come","upload.media":"Carica contenuti multimediali","create.page":"Crea nuova pagina","new.page":"Nuova pagina","page.name":"Nome pagina",page:"Pagina",duplicate:"Duplica",cancel:"Chiudi","copy.invite.link":"Copia link invito","create.multiplayer.project":"Crea progetto multiplayer","copy.multiplayer.project":"Trasforma in progetto multiplayer",select:"Seleziona",eraser:"Gomma",draw:"Matita",arrow:"Freccia",text:"Casella di testo",sticky:"Post-it",rectangle:"Rettangolo",ellipse:"Ellisse",triangle:"Triangolo",line:"Linea",rotate:"Ruota","lock.aspect.ratio":"Blocca rapporto lati","unlock.aspect.ratio":"Sblocca rapporto lati",group:"Raggruppa",ungroup:"Separa","move.to.back":"Muovi in fondo","move.backward":"Sposta indietro","move.forward":"Sposta avanti","move.to.front":"Muovi in fronte","reset.angle":"Reimposta angolo",lock:"Blocca",unlock:"Sblocca","move.to.page":"Trasferisci a pagina","flip.horizontal":"Ribalta orizzontalmente","flip.vertical":"Ribalta verticalmente",move:"Sposta","to.front":"In primo piano",forward:"Sposta avanti",backward:"Sposta indietro",back:"In fondo",language:"Lingua","dock.position":"Posizione dock",bottom:"In basso",left:"Sinistra",right:"Destra",top:"In Alto"};var jl={"style.menu.color":"\u8272","style.menu.fill":"\u5857\u308A\u3064\u3076\u3057","style.menu.dash":"\u7DDA","style.menu.size":"\u592A\u3055/\u30B5\u30A4\u30BA","style.menu.keep.open":"\u5E38\u306B\u8868\u793A","style.menu.font":"\u30D5\u30A9\u30F3\u30C8","style.menu.align":"\u914D\u7F6E",styles:"\u30B9\u30BF\u30A4\u30EB","zoom.in":"\u62E1\u5927","zoom.out":"\u7E2E\u5C0F",to:" ","menu.file":"\u30D5\u30A1\u30A4\u30EB","menu.edit":"\u7DE8\u96C6","menu.view":"\u8868\u793A","menu.preferences":"\u8A2D\u5B9A","menu.sign.in":"\u30B5\u30A4\u30F3\u30A4\u30F3","menu.sign.out":"\u30B5\u30A4\u30F3\u30A2\u30A6\u30C8","become.a.sponsor":"\u652F\u63F4\u3059\u308B","zoom.to.selection":"\u9078\u629E\u3057\u305F\u30A2\u30A4\u30C6\u30E0\u306B\u5408\u308F\u305B\u3066\u62E1\u5927","zoom.to.fit":"\u62E1\u5927\u3057\u3066\u3059\u3079\u3066\u3092\u8868\u793A","zoom.to":"\u62E1\u5927\u7387","preferences.dark.mode":"\u30C0\u30FC\u30AF\u30E2\u30FC\u30C9","preferences.focus.mode":"\u30D5\u30A9\u30FC\u30AB\u30B9\u30E2\u30FC\u30C9","preferences.debug.mode":"\u30C7\u30D0\u30C3\u30B0\u30E2\u30FC\u30C9","preferences.show.grid":"\u30B0\u30EA\u30C3\u30C9\u3092\u8868\u793A","preferences.use.cad.selection":"CAD\u306E\u9078\u629E\u6CD5\u3092\u4F7F\u7528","preferences.keep.stylemenu.open":"\u30B9\u30BF\u30A4\u30EB\u30E1\u30CB\u30E5\u30FC\u3092\u5E38\u306B\u8868\u793A","preferences.always.show.snaps":"\u30B9\u30CA\u30C3\u30D7\u3092\u5E38\u306B\u8868\u793A","preferences.rotate.handles":"\u56DE\u8EE2\u30CF\u30F3\u30C9\u30EB\u3092\u8868\u793A","preferences.binding.handles":"\u7D50\u5408\u30CF\u30F3\u30C9\u30EB\u3092\u8868\u793A","preferences.clone.handles":"\u30AF\u30ED\u30FC\u30F3\u30CF\u30F3\u30C9\u30EB\u3092\u8868\u793A",undo:"\u5143\u306B\u623B\u3059",redo:"\u3084\u308A\u76F4\u3057",cut:"\u5207\u308A\u53D6\u308A",copy:"\u30B3\u30D4\u30FC",paste:"\u8CBC\u308A\u4ED8\u3051","copy.as":"\u5F62\u5F0F\u3092\u9078\u629E\u3057\u3066\u30B3\u30D4\u30FC","export.as":"\u5F62\u5F0F\u3092\u9078\u629E\u3057\u3066\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","select.all":"\u3059\u3079\u3066\u9078\u629E","select.none":"\u9078\u629E\u3092\u89E3\u9664",delete:"\u524A\u9664","new.project":"\u65B0\u3057\u3044\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8",open:"\u958B\u304F",save:"\u4FDD\u5B58","save.as":"\u540D\u524D\u3092\u3064\u3051\u3066\u4FDD\u5B58","upload.media":"\u30E1\u30C7\u30A3\u30A2\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9","create.page":"\u30DA\u30FC\u30B8\u3092\u4F5C\u6210","new.page":"\u65B0\u898F\u30DA\u30FC\u30B8","page.name":"\u30DA\u30FC\u30B8\u540D",duplicate:"\u8907\u88FD",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB","copy.invite.link":"\u5171\u6709\u30EA\u30F3\u30AF\u3092\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u306B\u30B3\u30D4\u30FC","create.multiplayer.project":"\u30DE\u30EB\u30C1\u30D7\u30EC\u30A4\u30E4\u30FC\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u4F5C\u6210","copy.multiplayer.project":"\u30DE\u30EB\u30C1\u30D7\u30EC\u30A4\u30E4\u30FC\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u30B3\u30D4\u30FC",select:"\u9078\u629E",eraser:"\u6D88\u3057\u30B4\u30E0",draw:"\u63CF\u753B",arrow:"\u77E2\u5370",text:"\u30C6\u30AD\u30B9\u30C8",sticky:"\u3075\u305B\u3093",rectangle:"\u9577\u65B9\u5F62",ellipse:"\u6955\u5186\u5F62",triangle:"\u4E09\u89D2\u5F62",line:"\u7DDA",rotate:"\u56DE\u8EE2","lock.aspect.ratio":"\u7E26\u6A2A\u6BD4\u3092\u56FA\u5B9A","unlock.aspect.ratio":"\u7E26\u6A2A\u6BD4\u306E\u56FA\u5B9A\u3092\u89E3\u9664",group:"\u30B0\u30EB\u30FC\u30D4\u30F3\u30B0",ungroup:"\u30B0\u30EB\u30FC\u30D7\u89E3\u9664","move.to.back":"\u6700\u80CC\u9762\u306B\u79FB\u52D5","move.backward":"\u3072\u3068\u3064\u5F8C\u308D\u306B\u79FB\u52D5","move.forward":"\u3072\u3068\u3064\u524D\u306B\u79FB\u52D5","move.to.front":"\u6700\u524D\u9762\u306B\u79FB\u52D5","reset.angle":"\u89D2\u5EA6\u3092\u521D\u671F\u5316",lock:"\u30ED\u30C3\u30AF",unlock:"\u30A2\u30F3\u30ED\u30C3\u30AF","move.to.page":"\u30DA\u30FC\u30B8\u3078\u79FB\u52D5","flip.horizontal":"\u6C34\u5E73\u65B9\u5411\u306B\u53CD\u8EE2","flip.vertical":"\u5782\u76F4\u65B9\u5411\u306B\u53CD\u8EE2",move:"\u79FB\u52D5","to.front":"\u6700\u524D\u9762\u3078",forward:"\u3072\u3068\u3064\u524D\u3078",backward:"\u3072\u3068\u3064\u5F8C\u308D\u3078",back:"\u6700\u80CC\u9762\u3078",language:"\u8A00\u8A9E"};var Wl={"style.menu.color":"\uC0C9\uAE54","style.menu.fill":"\uCC44\uC6B0\uAE30","style.menu.dash":"\uD14C\uB450\uB9AC","style.menu.size":"\uD06C\uAE30","style.menu.keep.open":"\uD56D\uC0C1 \uC5F4\uAE30","style.menu.font":"\uAE00\uAF34","style.menu.align":"\uC815\uB82C",styles:"\uC2A4\uD0C0\uC77C","zoom.in":"\uD655\uB300","zoom.out":"\uCD95\uC18C",to:"To","menu.tools":"\uB3C4\uAD6C","menu.transform":"\uBCC0\uD658","menu.file":"\uD30C\uC77C","menu.edit":"\uD3B8\uC9D1","menu.view":"\uBCF4\uAE30","menu.preferences":"\uC124\uC815","menu.sign.in":"\uB85C\uADF8\uC778","menu.sign.out":"\uB85C\uADF8\uC544\uC6C3","become.a.sponsor":"\uD6C4\uC6D0\uC790 \uB418\uAE30","zoom.to.content":"\uCEE8\uD150\uCE20\uB85C \uB3CC\uC544\uAC00\uAE30","zoom.to.selection":"\uC120\uD0DD \uC694\uC18C\uC5D0 \uB9DE\uCD94\uAE30","zoom.to.fit":"\uC804\uCCB4\uC5D0 \uB9DE\uCD94\uAE30","zoom.to":"\uB9DE\uCD94\uAE30","preferences.dark.mode":"\uB2E4\uD06C \uBAA8\uB4DC","preferences.focus.mode":"\uC9D1\uC911 \uBAA8\uB4DC","preferences.debug.mode":"\uB514\uBC84\uADF8 \uBAA8\uB4DC","preferences.show.grid":"\uACA9\uC790 \uBCF4\uAE30","preferences.use.cad.selection":"CAD \uC120\uD0DD \uC0AC\uC6A9","preferences.keep.stylemenu.open":"\uC2A4\uD0C0\uC77C \uBA54\uB274 \uD56D\uC0C1 \uC5F4\uAE30","preferences.always.show.snaps":"Snap \uD56D\uC0C1 \uC5F4\uAE30","preferences.rotate.handles":"\uD68C\uC804 \uBCF4\uC774\uAE30","preferences.binding.handles":"\uBC14\uC778\uB529 \uBCF4\uC774\uAE30","preferences.clone.handles":"\uBCF5\uC81C \uBCF4\uC774\uAE30",undo:"\uC2E4\uD589\uCDE8\uC18C",redo:"\uC7AC\uC2E4\uD589",cut:"\uC790\uB974\uAE30",copy:"\uBCF5\uC0AC",paste:"\uBD99\uC5EC\uB123\uAE30","copy.as":"\uC774\uBBF8\uC9C0\uB85C \uBCF5\uC0AC","export.as":"\uB0B4\uBCF4\uB0B4\uAE30","select.all":"\uC804\uCCB4 \uC120\uD0DD","select.none":"\uC120\uD0DD \uD574\uC81C",delete:"\uC0AD\uC81C","new.project":"\uC0C8 \uD504\uB85C\uC81D\uD2B8",open:"\uC5F4\uAE30",save:"\uC800\uC7A5","save.as":"\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5","upload.media":"\uBBF8\uB514\uC5B4 \uC5C5\uB85C\uB4DC","create.page":"\uC0C8 \uD398\uC774\uC9C0 \uC0DD\uC131","new.page":"\uC0C8 \uD398\uC774\uC9C0","page.name":"\uD398\uC774\uC9C0 \uC774\uB984",duplicate:"\uBCF5\uC81C",cancel:"\uCDE8\uC18C","copy.invite.link":"\uCD08\uB300 \uB9C1\uD06C \uBCF5\uC0AC","copy.readonly.link":"\uC77D\uAE30 \uC804\uC6A9 \uB9C1\uD06C \uBCF5\uC0AC","create.multiplayer.project":"\uC2E4\uC2DC\uAC04 \uD611\uC5C5 \uD504\uB85C\uC81D\uD2B8 \uC0DD\uC131","copy.multiplayer.project":"\uC2E4\uC2DC\uAC04 \uD611\uC5C5 \uD504\uB85C\uC81D\uD2B8\uB85C \uBCF5\uC81C",select:"\uC120\uD0DD",eraser:"\uC9C0\uC6B0\uAC1C",draw:"\uD39C",arrow:"\uD654\uC0B4\uD45C",text:"\uD14D\uC2A4\uD2B8",sticky:"\uC2A4\uD2F0\uD0A4\uB178\uD2B8",rectangle:"\uC0AC\uAC01\uD615",ellipse:"\uC6D0",triangle:"\uC0BC\uAC01\uD615",line:"\uC120",rotate:"\uD68C\uC804","lock.aspect.ratio":"\uBE44\uC728 \uC7A0\uAE08","unlock.aspect.ratio":"\uBE44\uC728 \uC7A0\uAE08 \uD574\uC81C",group:"\uADF8\uB8F9\uD654",ungroup:"\uADF8\uB8F9\uD654 \uD574\uC81C","move.to.back":"\uB9E8 \uB4A4\uB85C \uBCF4\uB0B4\uAE30","move.backward":"\uB4A4\uB85C \uBCF4\uB0B4\uAE30","move.forward":"\uC55E\uC73C\uB85C \uAC00\uC838\uC624\uAE30","move.to.front":"\uB9E8 \uC55E\uC73C\uB85C \uAC00\uC838\uC624\uAE30","reset.angle":"\uD68C\uC804 \uCD08\uAE30\uD654",lock:"\uC7A0\uAE08",unlock:"\uC7A0\uAE08 \uD574\uC81C","align.distribute":"\uC815\uB82C / \uAC04\uACA9 \uB9DE\uCD94\uAE30","move.to.page":"\uD398\uC774\uC9C0\uB85C \uC774\uB3D9","flip.horizontal":"\uC88C\uC6B0 \uB300\uCE6D","flip.vertical":"\uC0C1\uD558 \uB300\uCE6D",move:"\uC21C\uC11C","to.front":"\uB9E8 \uC55E\uC73C\uB85C",forward:"\uC55E\uC73C\uB85C",backward:"\uB4A4\uB85C",back:"\uB9E8 \uB4A4\uB85C",language:"\uC5B8\uC5B4","translation.link":"\uB354 \uC54C\uC544\uBCF4\uAE30","dock.position":"\uB3C5 \uC704\uCE58",bottom:"\uD558\uB2E8",left:"\uC67C\uCABD",right:"\uC624\uB978\uCABD",top:"\uC0C1\uB2E8",page:"\uD398\uC774\uC9C0","keyboard.shortcuts":"\uD0A4\uBCF4\uB4DC \uB2E8\uCD95\uD0A4",search:"\uAC80\uC0C9",loading:"\uB85C\uB529{dots}","export.background":"\uBC30\uACBD \uB0B4\uBCF4\uB0B4\uAE30",transparent:"\uD22C\uBA85",auto:"\uC790\uB3D9",light:"\uB77C\uC774\uD2B8",dark:"\uB2E4\uD06C",github:"Github",twitter:"Twitter",discord:"Discord",image:"\uC774\uBBF8\uC9C0","align.left":"\uC67C\uCABD \uC815\uB82C","align.center.x":"\uC218\uD3C9 \uC911\uC559 \uC815\uB82C","align.right":"\uC624\uB978\uCABD \uC815\uB82C","align.top":"\uC0C1\uB2E8 \uC815\uB82C","align.center.y":"\uC218\uC9C1 \uC911\uC559 \uC815\uB82C","align.bottom":"\uD558\uB2E8 \uC815\uB82C","distribute.x":"\uAC00\uB85C \uAC04\uACA9 \uB9DE\uCD94\uAE30","distribute.y":"\uC138\uB85C \uAC04\uACA9 \uB9DE\uCD94\uAE30","stretch.x":"\uC218\uD3C9\uC73C\uB85C \uB298\uB9AC\uAE30","stretch.y":"\uC218\uC9C1\uC73C\uB85C \uB298\uB9AC\uAE30","dialog.save.firsttime":"\uD604\uC7AC \uD504\uB85C\uC81D\uD2B8\uB97C \uC800\uC7A5\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","dialog.save.again":"\uBCC0\uACBD\uC0AC\uD56D\uC744 \uD604\uC7AC \uD504\uB85C\uC81D\uD2B8\uC5D0 \uC800\uC7A5\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","dialog.cancel":"\uCDE8\uC18C","dialog.no":"\uC544\uB2C8\uC624","dialog.yes":"\uB124","enter.file.name":"\uD30C\uC77C \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694","telva-beta":"\uC0C8\uB85C\uC6B4 telva\uB97C \uC0AC\uC6A9\uD574\uBCF4\uC138\uC694"};var Nl={"style.menu.color":"\u0631\u06D5\u0646\u06AF","style.menu.fill":"\u067E\u0695\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5","style.menu.dash":"\u0644\u06D5\u062A \u0644\u06D5\u062A","style.menu.size":"\u0642\u06D5\u0628\u0627\u0631\u06D5","style.menu.keep.open":"\u0628\u06D5 \u06A9\u0631\u0627\u0648\u06D5\u06CC\u06CC \u0628\u0645\u06CE\u0646\u06D5\u0631\u06D5\u0648\u06D5","style.menu.font":"\u0647\u06CE\u06B5","style.menu.align":"\u0695\u06CE\u06A9\u062E\u0633\u062A\u0646",styles:"\u0646\u06D5\u062E\u0634\u06D5\u06A9\u0627\u0646","zoom.in":"\u0647\u06CE\u0646\u0627\u0646\u06D5 \u067E\u06CE\u0634\u06D5\u0648\u06D5","zoom.out":"\u062F\u0648\u0648\u0631 \u062E\u0633\u062A\u0646\u06D5\u0648\u06D5",to:"\u0628\u06C6","menu.tools":"\u0626\u0627\u0645\u0631\u0627\u0632\u06D5\u06A9\u0627\u0646","menu.transform":"\u06AF\u06C6\u0695\u06CC\u0646","menu.file":"\u0641\u0627\u06CC\u0644\u06CE\u06A9","menu.edit":"\u062F\u06D5\u0633\u062A\u06A9\u0627\u0631\u06CC","menu.view":"\u062F\u06CC\u0645\u06D5\u0646","menu.preferences":"\u062E\u0648\u0627\u0633\u062A","menu.sign.in":"\u0686\u0648\u0648\u0646\u06D5 \u0698\u0648\u0648\u0631\u06D5\u0648\u06D5","menu.sign.out":"\u062F\u06D5\u0631\u0686\u0648\u0648\u0646","become.a.sponsor":"\u0633\u067E\u06C6\u0646\u0633\u06D5\u0631 \u0628\u06D5","zoom.to.content":"\u0632\u0648\u0648\u0645 \u0628\u06A9\u06D5 \u0628\u06C6 \u0646\u0627\u0648\u06D5\u0695\u06C6\u06A9","zoom.to.selection":"\u0632\u0648\u0648\u0645 \u0628\u06A9\u06D5 \u0628\u06C6 \u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u0646","zoom.to.fit":"\u0632\u0648\u0648\u0645 \u0628\u06A9\u06D5 \u0628\u06C6 \u0626\u06D5\u0648\u06D5\u06CC \u0644\u06D5\u06AF\u06D5\u06B5\u06CC\u062F\u0627 \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A","zoom.to":"\u0632\u0648\u0648\u0645 \u0628\u06A9\u06D5 \u0628\u06C6","preferences.dark.mode":"\u062F\u06C6\u062E\u06CC \u062A\u0627\u0631\u06CC\u06A9","preferences.focus.mode":"\u062F\u06C6\u062E\u06CC \u0641\u06C6\u06A9\u06D5\u0633","preferences.debug.mode":"\u0645\u06C6\u062F\u06CC \u0647\u06D5\u06B5\u06D5\u062F\u06C6\u0632\u06CC\u0646","preferences.show.grid":"\u062A\u06C6\u0695\u06CC \u067E\u06CC\u0634\u0627\u0646 \u0628\u062F\u06D5","preferences.use.cad.selection":"\u0628\u06D5\u06A9\u0627\u0631\u0628\u0647\u06CE\u0646\u06D5 CAD \u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u0646\u06CC","preferences.keep.stylemenu.open":"\u0645\u06CE\u0646\u06C6\u06CC \u0633\u062A\u0627\u06CC\u0644 \u0628\u06D5 \u06A9\u0631\u0627\u0648\u06D5\u06CC\u06CC \u0628\u0647\u06CE\u06B5\u06D5\u0631\u06D5\u0648\u06D5","preferences.always.show.snaps":"\u0647\u06D5\u0645\u06CC\u0634\u06D5 \u0648\u06CE\u0646\u06D5\u06CC \u062E\u06CE\u0631\u0627 \u067E\u06CC\u0634\u0627\u0646 \u0628\u062F\u06D5","preferences.rotate.handles":"\u0633\u0648\u0631\u0627\u0646\u06D5\u0648\u06D5\u06CC \u062F\u06D5\u0633\u062A\u06D5\u06A9\u0627\u0646","preferences.binding.handles":"\u0628\u06D5\u0633\u062A\u0646\u06D5\u0648\u06D5\u06CC \u062F\u06D5\u0633\u062A\u06D5\u06A9\u0627\u0646","preferences.clone.handles":"\u06A9\u0644\u06C6\u0646 \u06A9\u0631\u062F\u0646\u06CC \u062F\u06D5\u0633\u062A\u06D5\u06A9\u0627\u0646",undo:"\u067E\u0627\u0634\u06D5\u06A9\u0634\u06D5 \u0628\u06A9\u06D5",redo:"\u062F\u0648\u0648\u0628\u0627\u0631\u06D5 \u0628\u06CC\u06A9\u06D5\u0631\u06D5\u0648\u06D5",cut:"\u0628\u0695\u06CC\u0646",copy:"\u06A9\u06C6\u067E\u06CC \u0628\u06A9\u06D5",paste:"\u067E\u06D5\u06CC\u0633\u062A \u0628\u06A9\u06D5","copy.as":"\u06A9\u06C6\u067E\u06CC \u0648\u06D5\u06A9","export.as":"\u0647\u06D5\u0646\u0627\u0631\u062F\u06D5\u06A9\u0631\u062F\u0646 \u0648\u06D5\u06A9","select.all":"\u0647\u06D5\u0645\u0648\u0648\u06CC\u0627\u0646 \u0647\u06D5\u06B5\u0628\u0698\u06CE\u0631\u0647","select.none":"\u0647\u06CC\u0686 \u0647\u0647\u200C\u06B5\u0645\u0647\u200C\u0628\u0698\u06CE\u0631\u0647\u200C",delete:"\u0633\u0695\u06CC\u0646\u06D5\u0648\u06D5","new.project":"\u067E\u0695\u06C6\u0698\u06D5\u06CC \u0646\u0648\u06CE",open:"\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5",save:"\u0647\u06D5\u06B5\u06AF\u0631\u062A\u0646","save.as":"\u0647\u06D5\u06B5\u06AF\u0631\u062A\u0646 \u0648\u06D5\u06A9","upload.media":"\u062F\u0627\u06AF\u0631\u062A\u0646\u06CC \u0645\u06CC\u062F\u06CC\u0627","create.page":"\u062F\u0631\u0648\u0633\u062A\u06A9\u0631\u062F\u0646\u06CC \u0644\u0627\u067E\u06D5\u0695\u06D5","new.page":"\u0644\u0627\u067E\u06D5\u0695\u06D5\u06CC \u0646\u0648\u06CE","page.name":"\u0646\u0627\u0648\u06CC \u0644\u0627\u067E\u06D5\u0695\u06D5",duplicate:"\u062F\u0648\u0648\u0628\u0627\u0631\u06D5\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5",cancel:"\u0695\u06D5\u062A\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5","copy.invite.link":"\u0644\u06CC\u0646\u06A9\u06CC \u0628\u0627\u0646\u06AF\u0647\u06CE\u0634\u062A\u06A9\u0631\u062F\u0646 \u06A9\u06C6\u067E\u06CC \u0628\u06A9\u06D5","copy.readonly.link":"\u0628\u06D5 \u0634\u06CE\u0648\u06D5\u06CC\u06D5\u06A9\u06CC \u0647\u06D5\u0695\u06D5\u0645\u06D5\u06A9\u06CC \u06A9\u06C6\u067E\u06CC \u0628\u06A9\u06D5","create.multiplayer.project":"\u062F\u0631\u0648\u0633\u062A\u06A9\u0631\u062F\u0646\u06CC \u067E\u0631\u06C6\u0698\u06D5\u06CC \u0641\u0631\u06D5 \u0628\u06D5\u06A9\u0627\u0631\u0647\u06CE\u0646\u06D5\u0631","copy.multiplayer.project":"\u06A9\u06C6\u067E\u06CC \u0628\u06A9\u06D5 \u0628\u06C6 \u067E\u0695\u06C6\u0698\u06D5\u06CC\u06D5\u06A9\u06CC \u0641\u0631\u06D5 \u0628\u06D5\u06A9\u0627\u0631\u0647\u06CE\u0646\u06D5\u0631",select:"\u062F\u06D5\u0633\u0646\u06CC\u0627\u0634\u0646\u06A9\u0631\u062F\u0646",eraser:"\u0633\u0695\u06D5\u0631\u06D5\u0648\u06D5",draw:"\u0648\u06CE\u0646\u06D5\u06A9\u06CE\u0634\u0627\u0646",arrow:"\u062A\u06CC\u0631",text:"\u062F\u06D5\u0642",sticky:"\u0686\u06D5\u0633\u067E\u0627\u0648",rectangle:"\u0644\u0627\u06A9\u06CE\u0634\u06D5",ellipse:"\u0628\u06CC\u0628\u0644\u06CC",triangle:"\u0633\u06CE\u06AF\u06C6\u0634\u06D5",line:"\u0647\u06CE\u06B5",rotate:"\u0633\u0648\u0695\u0627\u0646\u06D5\u0648\u06D5","lock.aspect.ratio":"\u0642\u0641\u06B5\u06A9\u0631\u062F\u0646\u06CC \u0695\u06CE\u0698\u06D5\u06CC \u0695\u0648\u0648\u0628\u06D5\u0631\u06CC","unlock.aspect.ratio":"\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5\u06CC \u0695\u06CE\u0698\u06D5\u06CC \u0695\u0648\u0648\u0628\u06D5\u0631\u06CC",group:"\u06A9\u06C6\u0645\u06D5\u06B5\u06D5",ungroup:"\u0644\u0627\u0628\u0631\u062F\u0646\u06CC \u06A9\u06C6\u0645\u06D5\u06B5\u06D5","move.to.back":"\u0628\u0686\u06C6 \u0628\u06C6 \u067E\u0634\u062A\u06D5\u0648\u06D5","move.backward":"\u0628\u06D5\u0631\u06D5\u0648 \u062F\u0648\u0627\u0648\u06D5","move.forward":"\u0628\u0695\u06C6 \u067E\u06CE\u0634\u06D5\u0648\u06D5","move.to.front":"\u0628\u06AF\u0648\u0627\u0632\u0631\u06CE\u062A\u06D5\u0648\u06D5 \u0628\u06C6 \u067E\u06CE\u0634\u06D5\u0648\u06D5","reset.angle":"\u06AF\u06C6\u0634\u06D5\u06CC \u067E\u0634\u0648\u0648\u062F\u0627\u0646",lock:"\u0642\u0648\u0641\u06B5",unlock:"\u0644\u0627\u0628\u0631\u062F\u0646\u06CC \u0642\u0648\u0641\u06B5","move.to.page":"\u0628\u0686\u06C6 \u0628\u06C6 \u0644\u0627\u067E\u06D5\u0695\u06D5","flip.horizontal":"\u0626\u0627\u0633\u06C6\u06CC\u06CC \u0648\u06D5\u0631\u06AF\u06D5\u0695\u0627\u0646\u062F\u0646","flip.vertical":"\u0633\u062A\u0648\u0646\u06CC \u0648\u06D5\u0631\u06AF\u06D5\u0695\u0627\u0646\u062F\u0646",move:"\u062C\u0648\u0648\u06B5\u06D5","to.front":"\u0628\u06C6 \u067E\u06CE\u0634\u06D5\u0648\u06D5",forward:"\u0628\u06C6\u067E\u0634\u062A\u06D5\u0648\u06D5",backward:"\u0628\u06C6\u062F\u0648\u0627\u0648\u06D5",back:"\u06AF\u06D5\u0695\u0627\u0646\u06D5\u0648\u06D5",language:"\u0632\u0645\u0627\u0646","translation.link":"\u0628\u06D5\u0633\u062A\u06D5\u0631\u06CC \u0648\u06D5\u0631\u06AF\u06CE\u0695\u0627\u0646","dock.position":"\u0634\u0648\u06CE\u0646\u06CC \u062F\u06C6\u06A9",bottom:"\u062E\u0648\u0627\u0631\u06D5\u0648\u06D5",left:"\u0686\u06D5\u067E",right:"\u0695\u0627\u0633\u062A",top:"\u0633\u06D5\u0631\u0648\u0648",page:"\u0644\u0627\u067E\u06D5\u0695\u06D5","keyboard.shortcuts":"\u06A9\u0648\u0631\u062A\u06A9\u0631\u0627\u0648\u06D5\u06A9\u0627\u0646\u06CC \u062A\u06D5\u062E\u062A\u06D5\u06A9\u0644\u06CC\u0644",search:"\u06AF\u06D5\u0695\u0627\u0646",loading:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646","export.background":"\u067E\u0627\u0634\u062E\u0627\u0646\u06CC \u0647\u06D5\u0646\u0627\u0631\u062F\u06D5\u06A9\u0631\u062F\u0646",transparent:"\u0695\u0648\u0648\u0646",auto:"\u0626\u06C6\u062A\u06C6\u0645\u0627\u062A\u06CC\u06A9\u06CC",light:"\u0631\u0648\u0648\u0646\u0627\u06A9",dark:"\u062A\u0627\u0631\u06CC\u06A9"};var Ul={"style.menu.color":"Color","style.menu.fill":"Fill","style.menu.dash":"Dash","style.menu.size":"Size","style.menu.keep.open":"Keep Open","style.menu.font":"Font","style.menu.align":"Align",styles:"Styles","zoom.in":"Zoom In","zoom.out":"Zoom Out",to:"To","menu.tools":"Tools","menu.transform":"Transform","menu.file":"File","menu.edit":"Edit","menu.view":"View","menu.preferences":"Preferences","menu.sign.in":"Sign In","menu.sign.out":"Sign Out","become.a.sponsor":"Become a Sponsor","zoom.to.content":"Back to content","zoom.to.selection":"Zoom to Selection","zoom.to.fit":"Zoom to Fit","zoom.to":"Zoom to","preferences.dark.mode":"Dark Mode","preferences.focus.mode":"Focus Mode","preferences.debug.mode":"Debug Mode","preferences.show.grid":"Show Grid","preferences.use.cad.selection":"Use CAD Selection","preferences.keep.stylemenu.open":"Keep Style Menu Open","preferences.always.show.snaps":"Always Show Snaps","preferences.rotate.handles":"Rotate Handles","preferences.binding.handles":"Binding Handles","preferences.clone.handles":"Clone Handles",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste","copy.as":"Copy As","export.as":"Export As","select.all":"Select All","select.none":"Select None",delete:"Delete","new.project":"New Project",open:"Open",save:"Save","save.as":"Save As","upload.media":"Upload Media","create.page":"Create Page","new.page":"New Page","page.name":"Page Name",duplicate:"Duplicate","shape.options":"Shape Options",shapes:"Shapes",cancel:"Cancel","copy.invite.link":"Copy Invite Link","copy.readonly.link":"Copy ReadOnly Link","create.multiplayer.project":"Create a Multiplayer Project","copy.multiplayer.project":"Copy to Multiplayer Project",select:"Select",eraser:"Eraser",draw:"Draw",arrow:"Arrow",text:"Text",sticky:"Sticky",rectangle:"Rectangle",ellipse:"Ellipse",triangle:"Triangle",line:"Line",rotate:"Rotate","lock.aspect.ratio":"Lock Aspect Ratio","unlock.aspect.ratio":"Unlock Aspect Ratio",group:"Group",ungroup:"Ungroup","move.to.back":"Move to Back","move.backward":"Move Backward","move.forward":"Move Forward","move.to.front":"Move to Front","reset.angle":"Reset Angle",lock:"Lock",unlock:"Unlock","align.distribute":"Align / Distribute","move.to.page":"Move to Page","flip.horizontal":"Flip Horizontal","flip.vertical":"Flip Vertical",move:"Move","to.front":"To Front",forward:"Forward",backward:"Backward",back:"To Back",language:"Language","translation.link":"Learn More","dock.position":"Dock Position",bottom:"Bottom",left:"Left",right:"Right",top:"Top",page:"Page","keyboard.shortcuts":"Keyboard shortcuts",search:"Search",loading:"Loading{dots}","export.background":"Export Background",transparent:"Transparent",auto:"Auto",light:"Light",dark:"Dark",github:"Github",twitter:"Twitter",discord:"Discord",image:"Image","align.left":"Align Left","align.center.x":"Align Horizontal Center","align.right":"Align Right","align.top":"Align Top","align.center.y":"Align Vertical Center","align.bottom":"Align Bottom","distribute.x":"Distribute Horizontal","distribute.y":"Distribute Vertical","stretch.x":"Stretch Horizontal","stretch.y":"Stretch Vertical","dialog.save.firsttime":"Do you want to save your current project?","dialog.save.again":"Do you want to save changes to your current project?","dialog.cancel":"Cancel","dialog.no":"No","dialog.yes":"Yes","enter.file.name":"Enter file name","telva-beta":"Try the new telva",white:"White",lightGray:"Light gray",gray:"Gray",black:"Black",green:"Green",cyan:"Cyan",blue:"Blue",indigo:"Indigo",violet:"Violet",red:"Red",orange:"Orange",yellow:"Yellow",solid:"Solid",dashed:"Dashed",dotted:"Dotted",small:"Small",medium:"Medium",large:"Large"};var Kl={"style.menu.color":"\u1021\u101B\u1031\u102C\u1004\u103A","style.menu.fill":"\u1021\u101B\u1031\u102C\u1004\u103A \u1011\u100A\u103A\u1037\u1019\u100A\u103A","style.menu.dash":"\u1019\u103B\u1025\u103A\u1038\u1005\u1000\u103A","style.menu.size":"\u1021\u101B\u103D\u101A\u103A\u1021\u1005\u102C\u1038","style.menu.keep.open":"\u1016\u103D\u1004\u103A\u1037\u1011\u102C\u1038\u1019\u100A\u103A","style.menu.font":"\u1005\u102C\u101E\u102C\u1038\u1016\u1031\u102C\u1004\u103A\u1037","style.menu.align":"\u1021\u1011\u102C\u1038\u1021\u101E\u102D\u102F",styles:"\u1005\u1010\u102D\u102F\u1004\u103A","zoom.in":"\u1021\u1000\u103C\u102E\u1038\u1001\u103B\u1032\u1037\u1019\u100A\u103A","zoom.out":"\u1015\u103C\u1014\u103A\u1000\u103B\u1025\u103A\u1038\u1019\u100A\u103A",to:"\u101E\u102D\u102F\u1037","menu.tools":"\u1000\u102D\u101B\u102D\u101A\u102C\u1019\u103B\u102C\u1038","menu.transform":"\u1015\u103C\u1031\u102C\u1004\u103A\u1038\u101C\u100A\u103A\u101B\u1014\u103A","menu.file":"\u1016\u102D\u102F\u1004\u103A","menu.edit":"\u1015\u103C\u102F\u1015\u103C\u1004\u103A","menu.view":"\u1021\u1019\u103C\u1004\u103A","menu.preferences":"\u1006\u1000\u103A\u1010\u1004\u103A","menu.sign.in":"\u101D\u1004\u103A\u1019\u100A\u103A","menu.sign.out":"\u1011\u103D\u1000\u103A\u1019\u100A\u103A","become.a.sponsor":"\u1004\u103D\u1031\u1000\u103C\u1031\u1038\u1011\u1031\u102C\u1000\u103A\u1015\u1036\u1019\u100A\u103A","zoom.to.content":"\u1015\u1004\u103A\u1019\u1014\u1031\u101B\u102C\u101E\u102D\u102F\u1037 \u1015\u103C\u1014\u103A\u101E\u103D\u102C\u1038\u1019\u100A\u103A","zoom.to.selection":"\u101B\u103D\u1031\u1038\u1011\u102C\u1038\u101E\u1031\u102C \u1014\u1031\u101B\u102C\u101E\u102D\u102F\u1037 \u1021\u102C\u101B\u102F\u1036\u1015\u103C\u102F\u1019\u100A\u103A","zoom.to.fit":"\u1021\u1036\u1000\u102D\u102F\u1000\u103A\u1016\u103C\u1005\u103A\u1021\u1031\u102C\u1004\u103A \u1001\u103B\u1032\u1037\u1019\u100A\u103A","zoom.to":"\u1015\u102F\u1036\u1019\u103E\u1014\u103A\u1006\u102D\u102F\u1012\u103A\u101E\u102D\u102F\u1037 \u1001\u103B\u1032\u1037\u1019\u100A\u103A","preferences.dark.mode":"\u1021\u1019\u103E\u1031\u102C\u1004\u103A \u1019\u102F\u1012\u103A","preferences.focus.mode":"\u101B\u103E\u1004\u103A\u1038\u101B\u103E\u1004\u103A\u1038\u101C\u1004\u103A\u1038\u101C\u1004\u103A\u1038 \u1019\u102F\u1012\u103A","preferences.debug.mode":"\u1005\u1019\u103A\u1038\u101E\u1015\u103A \u1019\u102F\u1012\u103A","preferences.show.grid":"\u1014\u1031\u102C\u1000\u103A\u1001\u1036 \u1007\u101A\u102C\u1038\u1000\u103D\u1000\u103A\u1015\u103C\u101B\u1014\u103A","preferences.use.cad.selection":"CAD \u1000\u1032\u1037\u101E\u102D\u102F\u1037 \u101B\u103D\u1031\u1038\u1001\u103B\u101A\u103A\u1019\u103E\u102F \u1015\u103C\u102F\u101C\u102F\u1015\u103A\u1019\u100A\u103A","preferences.keep.stylemenu.open":"\u1005\u1010\u102D\u102F\u1004\u103A\u101C\u103A \u1019\u102E\u1014\u1030\u1038\u1000\u102D\u102F \u1021\u1019\u103C\u1032\u1016\u103D\u1004\u103A\u1037\u1011\u102C\u1038\u1019\u100A\u103A","preferences.always.show.snaps":"Always Show Snaps","preferences.rotate.handles":"Rotate Handles","preferences.binding.handles":"Binding Handles","preferences.clone.handles":"Clone Handles",undo:"\u1014\u1002\u102D\u102F\u1019\u1030\u101C\u101E\u102D\u102F\u1037 \u1015\u103C\u1014\u103A\u101C\u102F\u1015\u103A\u101B\u1014\u103A",redo:"\u1015\u103C\u1014\u103A\u101C\u102F\u1015\u103A\u101B\u1014\u103A",cut:"\u1016\u103C\u1010\u103A\u101A\u1030",copy:"\u1000\u1030\u1038\u101A\u1030",paste:"\u1000\u1030\u1038\u101E\u103D\u1004\u103A\u1038","copy.as":"\u1000\u1030\u1038\u101A\u1030\u1019\u100A\u103A\u1037 \u1015\u102F\u1036\u1005\u1036","export.as":"\u1011\u102F\u1010\u103A\u1001\u103B\u1004\u103A\u101E\u100A\u103A\u1037 \u1015\u102F\u1036\u1005\u1036","select.all":"\u1021\u102C\u1038\u101C\u102F\u1036\u1038\u1000\u102D\u102F \u101B\u103D\u1031\u1038\u1001\u103B\u101A\u103A\u101B\u1014\u103A","select.none":"\u1010\u1005\u103A\u1001\u102F\u1019\u103E \u1019\u101B\u103D\u1031\u1038\u1010\u1031\u102C\u1037\u1015\u102B",delete:"\u1016\u103B\u1000\u103A\u1019\u100A\u103A","new.project":"\u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A \u1021\u101E\u1005\u103A",open:"\u1016\u103D\u1004\u103A\u1037\u1019\u100A\u103A",save:"\u101E\u102D\u1019\u103A\u1038\u1019\u100A\u103A","save.as":"\u1021\u1001\u103C\u102C\u1038\u101E\u1031\u102C \u1015\u102F\u1036\u1005\u1036\u1016\u103C\u1004\u103A\u1037 \u101E\u102D\u1019\u103A\u1038\u1019\u100A\u103A","upload.media":"\u1019\u102E\u1012\u102E\u101A\u102C\u1016\u102D\u102F\u1004\u103A\u1019\u103B\u102C\u1038 \u1010\u1004\u103A\u1019\u100A\u103A","create.page":"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C \u1021\u101E\u1005\u103A\u1016\u103D\u1004\u103A\u1037\u1019\u100A\u103A","new.page":"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C \u1021\u101E\u1005\u103A","page.name":"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C \u1021\u1019\u100A\u103A",duplicate:"\u1015\u103D\u102C\u1038\u1019\u100A\u103A",cancel:"\u1019\u101C\u102F\u1015\u103A\u1010\u1031\u102C\u1037\u1015\u102B","copy.invite.link":"\u1016\u102D\u1010\u103A\u1000\u103C\u102C\u1038\u101B\u1014\u103A \u101C\u1004\u103A\u1037\u1001\u103A\u1000\u1030\u1038\u101A\u1030\u1019\u100A\u103A","copy.readonly.link":"\u1000\u103C\u100A\u103A\u1037\u101B\u1030\u101B\u1014\u103A\u1021\u1010\u103D\u1000\u103A\u101E\u102C \u101C\u1004\u103A\u1037\u1001\u103A\u1000\u1030\u1038\u101A\u1030\u1019\u100A\u103A","create.multiplayer.project":"\u1021\u1019\u103B\u102C\u1038\u101E\u102F\u1036\u1038 \u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A\u1021\u1016\u103C\u1005\u103A \u1021\u101E\u1005\u103A\u1016\u1014\u103A\u1010\u102E\u1038\u1019\u100A\u103A","copy.multiplayer.project":"\u1021\u1019\u103B\u102C\u1038\u101E\u102F\u1036\u1038 \u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A\u1021\u1016\u103C\u1005\u103A\u101E\u102D\u102F\u1037 \u1000\u1030\u1038\u101A\u1030\u1019\u100A\u103A",select:"\u101B\u103D\u1031\u1038\u1001\u103B\u101A\u103A\u1019\u103E\u102F",eraser:"\u1001\u1032\u1016\u103B\u1000\u103A",draw:"\u1001\u1032\u1010\u1036",arrow:"\u1019\u103C\u103E\u102C\u1038",text:"\u1005\u102C\u101E\u102C\u1038",sticky:"\u1000\u1015\u103A\u1001\u103D\u102C\u1019\u103E\u1010\u103A\u1005\u102F",rectangle:"\u101C\u1031\u1011\u1031\u102C\u1004\u103A\u1037",ellipse:"\u1018\u1032\u1025",triangle:"\u1010\u103C\u102D\u1002\u1036",line:"\u1019\u103B\u1025\u103A\u1038",rotate:"\u101C\u103E\u100A\u103A\u1037\u1019\u100A\u103A","lock.aspect.ratio":"\u1021\u1001\u103B\u102D\u102F\u1038\u1021\u1005\u102C\u1038 \u1011\u102D\u1014\u103A\u1038\u1011\u102C\u1038\u1019\u100A\u103A","unlock.aspect.ratio":"\u1021\u1001\u103B\u102D\u102F\u1038\u1021\u1005\u102C\u1038 \u1019\u1011\u102D\u1014\u103A\u1038\u1010\u1031\u102C\u1037\u1015\u102B",group:"\u1021\u102F\u1015\u103A\u1005\u102F\u1016\u103D\u1032\u1037",ungroup:"\u1021\u102F\u1015\u103A\u1005\u102F\u1001\u103D\u1032","move.to.back":"\u1014\u1031\u102C\u1000\u103A\u1006\u102F\u1036\u1038\u101E\u102D\u102F\u1037 \u1015\u102D\u102F\u1037\u1019\u100A\u103A","move.backward":"\u1014\u1031\u102C\u1000\u103A\u101E\u102D\u102F\u1037 \u1010\u1005\u103A\u1006\u1004\u103A\u1037\u1015\u102D\u102F\u1037\u1019\u100A\u103A","move.forward":"\u101B\u103E\u1031\u1037\u101E\u102D\u102F\u1037 \u1010\u1005\u103A\u1006\u1004\u103A\u1037\u1015\u102D\u102F\u1037\u1019\u100A\u103A","move.to.front":"\u101B\u103E\u1031\u1037\u1006\u102F\u1036\u1038\u101E\u102D\u102F\u1037 \u1015\u102D\u102F\u1037\u1019\u100A\u103A","reset.angle":"\u1014\u1002\u102D\u102F\u1019\u1030\u101C \u1011\u1031\u102C\u1004\u103A\u1037\u1001\u103B\u102D\u102F\u1038\u1005\u102C\u1038\u101E\u102D\u102F\u1037\u1015\u103C\u1031\u102C\u1004\u103A\u1038\u1019\u100A\u103A",lock:"\u1001\u1010\u103A\u1011\u102C\u1038\u1019\u100A\u103A",unlock:"\u1016\u103D\u1004\u103A\u1037\u1011\u102C\u1038\u1019\u100A\u103A","align.distribute":"\u1014\u1031\u101B\u102C \u1021\u1011\u102C\u1038\u1021\u101E\u102D\u102F/ \u1021\u1006\u1014\u103A\u1037\u1021\u1000\u103B\u102F\u1036\u1037","move.to.page":"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C\u1010\u1005\u103A\u1001\u102F\u101E\u102D\u102F\u1037 \u101B\u103D\u1031\u1038\u1019\u100A\u103A","flip.horizontal":"\u1021\u101C\u103B\u102C\u1038\u101C\u102D\u102F\u1000\u103A \u101C\u103E\u1014\u103A\u1019\u100A\u103A","flip.vertical":"\u1012\u1031\u102B\u1004\u103A\u101C\u102D\u102F\u1000\u103A \u101C\u103E\u1014\u103A\u1019\u100A\u103A",move:"\u101B\u103D\u1031\u1037\u1019\u100A\u103A","to.front":"\u101B\u103E\u1031\u1037\u1006\u102F\u1036\u1038\u101E\u102D\u102F\u1037",forward:"\u101B\u103E\u1031\u1037\u1010\u1005\u103A\u1006\u1004\u103A\u1037",backward:"\u1014\u1031\u102C\u1000\u103A\u1010\u1005\u103A\u1006\u1004\u103A\u1037",back:"\u1014\u1031\u102C\u1000\u103A\u1006\u102F\u1036\u1038\u101E\u102D\u102F\u1037",language:"\u1018\u102C\u101E\u102C\u1005\u1000\u102C\u1038","translation.link":"\u1015\u102D\u102F\u1019\u102D\u102F\u104D \u101C\u1031\u1037\u101C\u102C\u101B\u1014\u103A","dock.position":"\u1000\u102D\u101B\u102D\u101A\u102C \u1021\u1014\u1031\u1021\u1011\u102C\u1038",bottom:"\u1021\u1031\u102C\u1000\u103A",left:"\u1018\u101A\u103A",right:"\u100A\u102C",top:"\u1011\u102D\u1015\u103A",page:"\u1005\u102C\u1019\u103B\u1000\u103A\u1014\u103E\u102C","keyboard.shortcuts":"Keyboard shortcuts",search:"\u101B\u103E\u102C\u1016\u103D\u1031\u101B\u1014\u103A",loading:"\u1001\u100F\u1005\u1031\u102C\u1004\u103A\u1037\u1015\u1031\u1038\u101B\u1014\u103A{dots}","export.background":"\u1014\u1031\u102C\u1000\u103A\u1001\u1036 \u1011\u102F\u1010\u103A\u101A\u1030\u1019\u100A\u103A",transparent:"\u1014\u1031\u102C\u1000\u103A\u1001\u1036 \u1021\u1000\u103C\u100A\u103A",auto:"Auto",light:"\u1021\u101C\u1004\u103A\u1038",dark:"\u1021\u1019\u103E\u1031\u102C\u1004\u103A",github:"Github",twitter:"Twitter",discord:"Discord",image:"\u1013\u102C\u1010\u103A\u1015\u102F\u1036","align.left":"\u1018\u101A\u103A\u1016\u1000\u103A\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.center.x":"\u1021\u101C\u103B\u102C\u1038\u101C\u102D\u102F\u1000\u103A \u1017\u101F\u102D\u102F\u1006\u102E\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.right":"\u100A\u102C\u1016\u1000\u103A\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.top":"\u1021\u1015\u1031\u102B\u103A\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.center.y":"\u1012\u1031\u102B\u1004\u103A\u101C\u102D\u102F\u1000\u103A \u1017\u101F\u102D\u102F\u1006\u102E\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","align.bottom":"\u1021\u1031\u102C\u1000\u103A\u101E\u102D\u102F\u1037 \u100A\u103E\u102D\u101B\u1014\u103A","distribute.x":"\u1021\u101C\u103B\u102C\u1038\u101C\u102D\u102F\u1000\u103A \u1016\u103C\u1014\u103A\u1037\u101B\u1014\u103A","distribute.y":"\u1012\u1031\u102B\u1004\u103A\u101C\u102D\u102F\u1000\u103A \u1016\u103C\u1014\u103A\u1037\u101B\u1014\u103A","stretch.x":"\u1021\u101C\u103B\u102C\u1038\u101C\u102D\u102F\u1000\u103A \u1006\u103D\u1032\u1006\u1014\u103A\u1037\u101B\u1014\u103A","stretch.y":"\u1012\u1031\u102B\u1004\u103A\u101C\u102D\u102F\u1000\u103A \u1006\u103D\u1032\u1006\u1014\u103A\u1037\u101B\u1014\u103A","dialog.save.firsttime":"\u101A\u1001\u102F \u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A\u1000\u102D\u102F \u101E\u102D\u1019\u103A\u1038\u1006\u100A\u103A\u101C\u102D\u102F\u1015\u102B\u101E\u101C\u102C\u1038 ?","dialog.save.again":"\u101A\u1001\u102F \u1015\u101B\u1031\u102C\u1002\u103B\u1000\u103A\u1010\u103D\u1004\u103A \u1015\u103C\u1004\u103A\u1011\u102C\u1038\u101E\u1031\u102C \u1021\u1015\u103C\u1031\u102C\u1004\u103A\u1038\u1021\u101C\u100A\u103A\u1019\u103B\u102C\u1038\u1000\u102D\u102F \u1021\u1010\u100A\u103A\u1015\u103C\u102F \u101E\u102D\u1019\u103A\u1038\u1006\u100A\u103A\u101C\u102D\u102F\u1015\u102B\u101E\u101C\u102C\u1038?","dialog.cancel":"\u1018\u102C\u1019\u103E \u1019\u101C\u102F\u1015\u103A\u1010\u1031\u102C\u1037\u1015\u102B","dialog.no":"\u1019\u101C\u102D\u102F\u1010\u1031\u102C\u1037\u1015\u102B","dialog.yes":"\u101C\u102D\u102F\u1015\u102B\u101E\u100A\u103A","enter.file.name":"\u1016\u102D\u102F\u1004\u103A\u1014\u102C\u1019\u100A\u103A \u1011\u100A\u103A\u1037\u101E\u103D\u1004\u103A\u1038\u101B\u1014\u103A","telva-beta":"telva \u1021\u101E\u1005\u103A\u1005\u1019\u103A\u1038\u101E\u102F\u1036\u1038\u1000\u103C\u100A\u103A\u1037\u101B\u1014\u103A"};var _l={"style.menu.color":"Farge","style.menu.fill":"Fyll","style.menu.dash":"Linje","style.menu.size":"St\xF8rrelse","style.menu.keep.open":"Hold \xE5pen","style.menu.font":"Teksttype","style.menu.align":"Juster",styles:"Stiler","zoom.in":"Zoom inn","zoom.out":"Zoom ut",to:"til","menu.file":"Fil","menu.edit":"Rediger","menu.view":"Vis","menu.preferences":"Preferanser","menu.sign.in":"Logg inn","menu.sign.out":"Logg ut","become.a.sponsor":"Bli en sponsor","zoom.to.selection":"Zoom til valg","zoom.to.fit":"Zoom for \xE5 passe","zoom.to":"Zoom til","preferences.dark.mode":"M\xF8rk modus","preferences.focus.mode":"Fokus modus","preferences.debug.mode":"Debug modus","preferences.show.grid":"Vis rutenett","preferences.use.cad.selection":"Bruk CAD seleksjon","preferences.keep.stylemenu.open":"Hold stilmeny \xE5pen","preferences.always.show.snaps":"Vis alltid snaps","preferences.rotate.handles":"Vis roteringsh\xE5ndtak","preferences.binding.handles":"Vis bindingsh\xE5ndtak","preferences.clone.handles":"Vis kloningsh\xE5ndtak",undo:"Angre",redo:"Gj\xF8r om",cut:"Klipp ut",copy:"Kopier",paste:"Lim inn","copy.as":"Kopier som","export.as":"Eksporter som","select.all":"Velg alle","select.none":"Velg ingen",delete:"Slett","new.project":"Nytt prosjekt",open:"\xC5pne",save:"Lagre","save.as":"Lagre som","upload.media":"Last opp media","create.page":"Opprett side","new.page":"Ny side","page.name":"Sidenavn",duplicate:"Dupliser",cancel:"Avbryt","copy.invite.link":"Kopier invitasjonslink","create.multiplayer.project":"Opprett et flerspiller prosjekt","copy.multiplayer.project":"Kopier til flerspiller prosjekt",select:"Velg",eraser:"Viskel\xE6r",draw:"Tegn",arrow:"Pil",text:"Tekst",sticky:"Lapp",rectangle:"Rektangel",ellipse:"Ellipse",triangle:"Trekant",line:"Linje",rotate:"Roter","lock.aspect.ratio":"L\xE5s st\xF8rrelsesforhold","unlock.aspect.ratio":"L\xE5s opp st\xF8rrelsesforhold",group:"Grupper",ungroup:"Avgrupper","move.to.back":"Flytt bakerst","move.backward":"Flytt bakover","move.forward":"Flytt forover","move.to.front":"Flytt til front","reset.angle":"Tilbakestill vinkel",lock:"L\xE5s",unlock:"L\xE5s opp","move.to.page":"Flytt til side","flip.horizontal":"Snu horisontalt","flip.vertical":"Snu vertikalt",move:"Flytt","to.front":"Foran",forward:"Framover",backward:"Bakover",back:"Bakerst",language:"Spr\xE5k"};var Yl={"style.menu.color":"\u0930\u0902\u0917","style.menu.fill":"\u092D\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","style.menu.dash":"\u0927\u0930\u094D\u0915\u093E","style.menu.size":"\u0906\u0915\u093E\u0930","style.menu.keep.open":"\u0916\u0941\u0932\u093E \u0930\u093E\u0916\u094D\u0928\u0941\u0939\u094B\u0938\u094D","style.menu.font":"\u092B\u0928\u094D\u091F","style.menu.align":"\u092A\u0919\u094D\u0915\u094D\u0924\u093F\u092C\u0926\u094D\u0927",styles:"\u0936\u0948\u0932\u0940\u0939\u0930\u0942","zoom.in":"\u091C\u0941\u092E \u0907\u0928","zoom.out":"\u091C\u0941\u092E \u0906\u0909\u091F",to:"\u091F\u0941","menu.file":"\u092B\u093E\u0907\u0932","menu.edit":"\u0938\u092E\u094D\u092A\u093E\u0926\u0928 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","menu.view":"\u092D\u094D\u092F\u0942","menu.preferences":"\u092A\u094D\u0930\u093E\u0925\u092E\u093F\u0915\u0924\u093E\u0939\u0930\u0942","menu.sign.in":"\u0938\u093E\u0907\u0928 \u0907\u0928 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","menu.sign.out":"\u0938\u093E\u0907\u0928 \u0906\u0909\u091F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","become.a.sponsor":"\u092A\u094D\u0930\u093E\u092F\u094B\u091C\u0915 \u092C\u0928\u094D\u0928\u0941\u0939\u094B\u0938\u094D","zoom.to.selection":"\u091C\u0941\u092E \u091F\u0941 \u0938\u0947\u0932\u0947\u0915\u094D\u0938\u0928","zoom.to.fit":"\u091C\u0941\u092E \u091F\u0941 \u092B\u093F\u091F","zoom.to":"\u091C\u0941\u092E \u091F\u0941","preferences.dark.mode":"\u0905\u0901\u0927\u094D\u092F\u093E\u0930\u094B \u092E\u094B\u0921","preferences.focus.mode":"\u092B\u094B\u0915\u0938 \u092E\u094B\u0921","preferences.debug.mode":"\u0921\u093F\u092C\u0917 \u092E\u094B\u0921","preferences.show.grid":"\u0917\u094D\u0930\u093F\u0921 \u0926\u0947\u0916\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","preferences.use.cad.selection":"CAD \u0938\u0947\u0932\u0947\u0915\u094D\u0938\u0928 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","preferences.keep.stylemenu.open":"\u0938\u094D\u091F\u093E\u0907\u0932 \u092E\u0947\u0928\u0941 \u0916\u0941\u0932\u093E \u0930\u093E\u0916\u094D\u0928\u0941\u0939\u094B\u0938\u094D","preferences.always.show.snaps":"\u0938\u0927\u0948\u0901 \u0938\u094D\u0928\u094D\u092F\u093E\u092A\u0939\u0930\u0942 \u0926\u0947\u0916\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","preferences.rotate.handles":"\u0939\u094D\u092F\u093E\u0928\u094D\u0921\u0932\u0939\u0930\u0942 \u0918\u0941\u092E\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","preferences.binding.handles":"\u092C\u093E\u0907\u0928\u094D\u0921\u093F\u0919 \u0939\u094D\u092F\u093E\u0928\u094D\u0921\u0932\u0939\u0930\u0942","preferences.clone.handles":"\u0915\u094D\u0932\u094B\u0928 \u0939\u094D\u092F\u093E\u0928\u094D\u0921\u0932\u0939\u0930\u0942",undo:"\u092A\u0942\u0930\u094D\u0935\u0935\u0924 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",redo:"\u092A\u0941\u0928\u0903 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",cut:"\u0915\u091F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",copy:"\u0915\u092A\u093F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",paste:"\u092A\u0947\u0938\u094D\u091F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","copy.as":"\u0915\u092A\u093F \u090F\u091C","export.as":"\u090F\u0915\u094D\u0938\u092A\u094B\u0930\u094D\u091F \u090F\u091C","select.all":"\u0938\u092C\u0948 \u091B\u093E\u0928\u094D\u0928\u0941\u0939\u094B\u0938\u094D","select.none":"\u0915\u0947\u0939\u093F \u092A\u0928\u093F \u0938\u0947\u0932\u0947\u0915\u094D\u091F \u0928\u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",delete:"\u092E\u0947\u091F\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","new.project":"\u0928\u092F\u093E\u0901 \u092A\u0930\u093F\u092F\u094B\u091C\u0928\u093E",open:"\u0916\u094B\u0932\u094D\u0928\u0941\u0939\u094B\u0938\u094D",save:"\u0938\u0941\u0930\u0915\u094D\u0937\u093F\u0924 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","save.as":"\u0938\u0947\u092D \u090F\u091C","upload.media":"\u092E\u093F\u0921\u093F\u092F\u093E \u0905\u092A\u0932\u094B\u0921 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","create.page":"\u092A\u0943\u0937\u094D\u0920 \u0938\u093F\u0930\u094D\u091C\u0928\u093E \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","new.page":"\u0928\u092F\u093E\u0901 \u092A\u0943\u0937\u094D\u0920 \u0938\u093F\u0930\u094D\u091C\u0928\u093E \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","page.name":"\u092A\u0943\u0937\u094D\u0920\u0915\u094B \u0928\u093E\u092E",duplicate:"\u0905\u0928\u0941\u0932\u093F\u092A\u093F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",cancel:"\u0930\u0926\u094D\u0926 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","copy.invite.link":"\u0928\u093F\u092E\u0928\u094D\u0924\u094D\u0930\u0923\u093E \u0932\u093F\u0919\u094D\u0915 \u0915\u092A\u093F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","create.multiplayer.project":"\u092E\u0932\u094D\u091F\u093F\u092A\u094D\u0932\u0947\u092F\u0930 \u092A\u0930\u093F\u092F\u094B\u091C\u0928\u093E \u0938\u093F\u0930\u094D\u091C\u0928\u093E \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","copy.multiplayer.project":"\u092E\u0932\u094D\u091F\u093F\u092A\u094D\u0932\u0947\u092F\u0930 \u092A\u094D\u0930\u094B\u091C\u0947\u0915\u094D\u091F\u092E\u093E \u0915\u092A\u093F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",select:"\u0938\u0947\u0932\u0947\u0915\u094D\u091F",eraser:"\u0907\u0930\u0947\u091C\u0930",draw:"\u091A\u093F\u0924\u094D\u0930 \u092C\u0928\u093E\u0909\u0928\u0941",arrow:"\u0924\u0940\u0930",text:"\u0936\u092C\u094D\u0926",sticky:"\u091F\u093E\u0901\u0938\u093F\u0928\u0947",rectangle:"\u0906\u092F\u0924",ellipse:"\u0926\u0940\u0930\u094D\u0918\u0935\u0943\u0924\u094D\u0924",triangle:"\u0924\u094D\u0930\u093F\u092D\u0941\u091C",line:"\u0930\u0947\u0916\u093E",rotate:"\u0918\u0941\u092E\u093E\u0909\u0928\u0941\u0939\u094B\u0938\u094D","lock.aspect.ratio":"\u0906\u0915\u093E\u0930 \u0905\u0928\u0941\u092A\u093E\u0924 \u0932\u0915 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","unlock.aspect.ratio":"\u0906\u0915\u093E\u0930 \u0905\u0928\u0941\u092A\u093E\u0924 \u0905\u0928\u0932\u0915 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",group:"\u0938\u092E\u0942\u0939",ungroup:"\u0938\u092E\u0942\u0939 \u0930\u0926\u094D\u0926 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.to.back":"\u092A\u091B\u093E\u0921\u093F \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.backward":"\u0925\u092A \u092A\u091B\u093E\u0921\u093F \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.forward":"\u0905\u0917\u093E\u0921\u093F \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.to.front":"\u0925\u092A \u0905\u0917\u093E\u0921\u093F \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","reset.angle":"\u0915\u094B\u0923 \u0930\u093F\u0938\u0947\u091F \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",lock:"\u0932\u0915 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",unlock:"\u0905\u0928\u0932\u0915 \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","move.to.page":"\u092A\u0943\u0937\u094D\u0920\u092E\u093E \u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","flip.horizontal":"\u0924\u0947\u0930\u094D\u0938\u094B \u092B\u094D\u0932\u093F\u092A \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","flip.vertical":"\u0920\u093E\u0921\u094B \u092B\u094D\u0932\u093F\u092A \u0917\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D",move:"\u0938\u093E\u0930\u094D\u0928\u0941\u0939\u094B\u0938\u094D","to.front":"\u0925\u092A \u0905\u0917\u093E\u0921\u093F",forward:"\u0905\u0917\u093E\u0921\u093F",backward:"\u092A\u091B\u093E\u0921\u093F",back:"\u0925\u092A \u092A\u091B\u093E\u0921\u093F",language:"\u092D\u093E\u0937\u093E"};var Xl={"style.menu.color":"Farge","style.menu.fill":"Fyll","style.menu.dash":"Line","style.menu.size":"Storleik","style.menu.keep.open":"Hald open","style.menu.font":"Teksttype","style.menu.align":"Tilpass",styles:"Stilar","zoom.in":"Zoom inn","zoom.out":"Zoom ut",to:"til","menu.file":"Fil","menu.edit":"Rediger","menu.view":"Vis","menu.preferences":"Innstillingar","menu.sign.in":"Logg inn","menu.sign.out":"Logg ut","become.a.sponsor":"Vert sponsor","zoom.to.content":"Zoom til innhald","zoom.to.selection":"Zoom til valte element","zoom.to.fit":"Zoom for \xE5 passe","zoom.to":"Zoom til","preferences.dark.mode":"M\xF8rkmodus","preferences.focus.mode":"Fokusmodus","preferences.debug.mode":"Debugmodus","preferences.show.grid":"Vis rutenett","preferences.use.cad.selection":"Bruk CAD-val","preferences.keep.stylemenu.open":"Hald stilmeny open","preferences.always.show.snaps":"Vis alltid snaps","preferences.rotate.handles":"Vis roteringshandtak","preferences.binding.handles":"Vis bindingshandtak","preferences.clone.handles":"Vis kloningshandtak",undo:"Angre",redo:"Gjer om",cut:"Klipp ut",copy:"Kopier",paste:"Lim inn","copy.as":"Kopier som","export.as":"Eksporter som","select.all":"Vel alle","select.none":"Vel ingen",delete:"Slett","new.project":"Nytt prosjekt",open:"Opne",save:"Lagre","save.as":"Lagre som","upload.media":"Last opp media","create.page":"Opprett side","new.page":"Ny side","page.name":"Sidenamn",duplicate:"Dupliser",cancel:"Avbryt","copy.invite.link":"Kopier invitasjonslenke","copy.readonly.link":"Kopier invitasjonslenke (skrivebeskytta)","create.multiplayer.project":"Lag samarbeidsprosjekt","copy.multiplayer.project":"Kopier til samarbeidsprosjekt",select:"Vel",eraser:"Viskel\xEAr",draw:"Teikn",arrow:"Pil",text:"Tekst",sticky:"Lapp",rectangle:"Rektangel",ellipse:"Runding",triangle:"Trekant",line:"Line",rotate:"Roter","lock.aspect.ratio":"L\xE5s storleiksforhold","unlock.aspect.ratio":"L\xE5s opp storleiksforhold",group:"Grupper",ungroup:"Avgrupper","move.to.back":"Flytt bakarst","move.backward":"Flytt bakover","move.forward":"Flytt framover","move.to.front":"Flytt til front","reset.angle":"Tilbakestill vinkel",lock:"L\xE5s",unlock:"L\xE5s opp","move.to.page":"Flytt til side","flip.horizontal":"Snu horisontalt","flip.vertical":"Snu vertikalt",move:"Flytt","to.front":"Framme",forward:"Framover",backward:"Bakover",back:"Bakarst",language:"Spr\xE5k","translation.link":"Les meir","dock.position":"Dokkplassering",bottom:"Nede",left:"Venstre",right:"H\xF8gre",top:"Oppe",page:"Side","keyboard.shortcuts":"Sn\xF8ggtastar",search:"S\xF8k",loading:"Lastar{dots}","export.background":"Eksporter bakgrunn",transparent:"Gjennomsiktig",auto:"Auto",light:"Lys",dark:"M\xF8rk",github:"Github",twitter:"Twitter",discord:"Discord",image:"Bilete","align.left":"Venstrestill","align.center.x":"Midtstill horisontalt","align.right":"H\xF8grestill","align.top":"Still til toppen","align.center.y":"Midtstill vertikalt","align.bottom":"Still til botnen","distribute.x":"Distribuer horisontalt","distribute.y":"Distribuer vertikalt","stretch.x":"Strekk horisontalt","stretch.y":"Strekk vertikalt","dialog.save.firsttime":"Vil du lagre det noverande prosjektet ditt?","dialog.save.again":"Vil du lagre endringane i det noverande prosjektet ditt?","dialog.cancel":"Avbryt","dialog.no":"Nei","dialog.yes":"Ja","enter.file.name":"Fyll inn filnamn","telva-beta":"Pr\xF8v den nye telva",white:"Kvit",lightGray:"Lys gr\xE5",gray:"Gr\xE5",black:"Svart",green:"Gr\xF8n",cyan:"Cyan",blue:"Bk\xE5",indigo:"Indigo",violet:"Fiol",red:"Raud",orange:"Oransj",yellow:"Gul",solid:"Heil",dashed:"Stipla",dotted:"Prikka",small:"Liten",medium:"Mellomstor",large:"Stor"};var Zl={"style.menu.color":"Kolor","style.menu.fill":"Wype\u0142nienie","style.menu.dash":"Linia","style.menu.size":"Rozmiar","style.menu.keep.open":"Zachowaj otwarte","style.menu.font":"Czcionka","style.menu.align":"Wyr\xF3wnanie",styles:"Style","zoom.in":"Przybli\u017C","zoom.out":"Oddal",to:"do","menu.file":"Plik","menu.edit":"Edycja","menu.view":"Widok","menu.preferences":"Preferencje","menu.sign.in":"Zaloguj","menu.sign.out":"Wyloguj","become.a.sponsor":"Zosta\u0144 sponsorem","zoom.to.selection":"Przybli\u017C do zaznaczenia","zoom.to.fit":"Wype\u0142nij ekran","zoom.to":"Przybli\u017C do","preferences.dark.mode":"Tryb ciemny","preferences.focus.mode":"Tryb skupienia","preferences.debug.mode":"Tryb debugowania","preferences.show.grid":"Poka\u017C siatk\u0119","preferences.use.cad.selection":"U\u017Cyj zaznaczania CAD","preferences.keep.stylemenu.open":"Zachowaj menu styli otwarte","preferences.always.show.snaps":"Przyci\u0105gaj obiekty","preferences.rotate.handles":"Uchwyty obrotu","preferences.binding.handles":"Uchwyty powi\u0105zania","preferences.clone.handles":"Uchwyty klonuj\u0105ce",undo:"Cofnij",redo:"Powt\xF3rz",cut:"Wytnij",copy:"Kopiuj",paste:"Wklej","copy.as":"Kopiuj jako","export.as":"Eksportuj jako","select.all":"Zaznacz wszystko","select.none":"Odznacz wszystko",delete:"Usu\u0144","new.project":"Nowy projekt",open:"Otw\xF3rz",save:"Zapisz","save.as":"Zapisz jako","upload.media":"Za\u0142aduj multimedia","create.page":"Utw\xF3rz stron\u0119","new.page":"Nowa strona","page.name":"Nazwa strony",duplicate:"Powiel",cancel:"Anuluj","copy.invite.link":"Kopiuj link zaproszenia","create.multiplayer.project":"Stw\xF3rz projekt wieloosobowy","copy.multiplayer.project":"Kopiuj do projektu wieloosobowego",select:"Zaznacz",eraser:"Gumka",draw:"Rysuj",arrow:"Strza\u0142ka",text:"Tekst",sticky:"Naklejka",rectangle:"Prostok\u0105t",ellipse:"Elipsa",triangle:"Tr\xF3jk\u0105t",line:"Linia",rotate:"Obr\xF3\u0107","lock.aspect.ratio":"Zablokuj proporcje","unlock.aspect.ratio":"Odblokuj proporcje",group:"Grupuj",ungroup:"Rozgrupuj","move.to.back":"Przenie\u015B na ty\u0142","move.backward":"Przesu\u0144 do ty\u0142u","move.forward":"Przesu\u0144 do przodu","move.to.front":"Przenie\u015B na prz\xF3d","reset.angle":"Resetuj k\u0105t",lock:"Zablokuj",unlock:"Odblokuj","move.to.page":"Przenie\u015B na stron\u0119","flip.horizontal":"Odwr\xF3\u0107 w poziomie","flip.vertical":"Odwr\xF3\u0107 w pionie",move:"Przenie\u015B","to.front":"Na wierzch",forward:"Do przodu",backward:"Do ty\u0142u",back:"Na sp\xF3d",language:"J\u0119zyk","translation.link":"Czytaj wi\u0119cej","dock.position":"Pozycja przybornika",bottom:"D\xF3\u0142",left:"Lewa",right:"Prawa",top:"G\xF3ra",page:"Strona","keyboard.shortcuts":"Skr\xF3ty klawiszowe",search:"Szukaj",loading:"\u0141adowanie{dots}","export.background":"Eksportuj t\u0142o",transparent:"Przezroczyste",auto:"Automatyczny",light:"Jasny",dark:"Ciemny",github:"Github",twitter:"Twitter",discord:"Discord",image:"Obraz","align.left":"Wyr\xF3wnaj do lewej","align.center.x":"Wycentruj poziomo","align.right":"Wyr\xF3wnaj do prawej","align.top":"Wyr\xF3wnaj do g\xF3ry","align.center.y":"Wycentruj pionowo","align.bottom":"Wyr\xF3wnaj do do\u0142u","distribute.x":"Roz\u0142\xF3\u017C poziomo","distribute.y":"Roz\u0142\xF3\u017C pionowo","stretch.x":"Rozci\u0105gnij poziomo","stretch.y":"Rozci\u0105gnij pionowo","dialog.save.firsttime":"Czy chcesz zapisa\u0107 bie\u017C\u0105cy projekt?","dialog.save.again":"Czy chcesz zapisa\u0107 zmiany w bie\u017C\u0105cym projekcie?","dialog.cancel":"Anuluj","dialog.no":"Nie","dialog.yes":"Tak","enter.file.name":"Podaj nazw\u0119 pliku","telva-beta":"Wypr\xF3buj nowy telva"};var ql={"style.menu.color":"Cor","style.menu.fill":"Preencher","style.menu.dash":"Tra\xE7o","style.menu.size":"Tamanho","style.menu.keep.open":"Manter aberto","style.menu.font":"Fonte","style.menu.align":"Alinhamento",styles:"Estilos","zoom.in":"Aumentar zoom","zoom.out":"Diminuir zoom",to:"para","menu.file":"Arquivo","menu.edit":"Editar","menu.view":"Visualizar","menu.preferences":"Prefer\xEAncias","menu.sign.in":"Entrar","menu.sign.out":"Sair","become.a.sponsor":"Torne-se um patrocinador","zoom.to.selection":"Zoom para a sele\xE7\xE3o","zoom.to.fit":"Zoom para ajuste","zoom.to":"Zoom para","preferences.dark.mode":"Modo Escuro","preferences.focus.mode":"Modo Foco","preferences.debug.mode":"Modo Debug","preferences.show.grid":"Mostrar Grade","preferences.use.cad.selection":"Usar sele\xE7\xE3o CAD","preferences.keep.stylemenu.open":"Manter Menu de Estilos Aberto","preferences.always.show.snaps":"Mostrar Pontos de Ajuste","preferences.rotate.handles":"Controle de Rota\xE7\xE3o","preferences.binding.handles":"Controle de V\xEDnculos","preferences.clone.handles":"Controle de Clone",undo:"Desfazer",redo:"Refazer",cut:"Cortar",copy:"Copiar",paste:"Colar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todos","select.none":"Selecionar nenhum",delete:"Deletar","new.project":"Novo Projeto",open:"Abrir",save:"Salvar","save.as":"Salvar Como","upload.media":"Carregar M\xEDdia",page:"P\xE1gina",search:"Procurar",loading:"Carregando{dots}","export.background":"Exportar Fundo",transparent:"Transparente",auto:"Autom\xE1tico",light:"Claro",dark:"Escuro","menu.tools":"Ferramentas","menu.transform":"Transformar","zoom.to.content":"Voltar ao Conte\xFAdo","translation.link":"Saiba Mais","copy.readonly.link":"Copiar Link ReadOnly","align.distribute":"Alinhar / Distribuir","create.page":"Criar P\xE1gina","new.page":"Nova P\xE1gina","page.name":"Nome da P\xE1gina",duplicate:"Duplicar",cancel:"Cancelar","copy.invite.link":"Copiar Link de Convite","create.multiplayer.project":"Criar um Projeto Multijogador","copy.multiplayer.project":"Copiar para Projeto Multijogador",select:"Selecionar",eraser:"Borracha",draw:"Desenhar",arrow:"Seta",text:"Texto",sticky:"Adesivo",rectangle:"Ret\xE2ngulo",ellipse:"Elipse",triangle:"Tri\xE2ngulo",line:"Linha",rotate:"Rotacionar","lock.aspect.ratio":"Travar Propor\xE7\xE3o da Tela","unlock.aspect.ratio":"Destravar Propor\xE7\xE3o da Tela",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Recuar","move.backward":"Enviar para Tr\xE1s","move.forward":"Avan\xE7ar","move.to.front":"Trazer para Frente","reset.angle":"Reiniciar \xC2ngulo",lock:"Travar",unlock:"Destravar","move.to.page":"Mover para P\xE1gina","flip.horizontal":"Virar Horizontalmente","flip.vertical":"Virar Verticalmente",move:"Mover","to.front":"Para Frente",forward:"Avan\xE7ar",backward:"Recuar",back:"Voltar",language:"Idioma",image:"Imagem","keyboard.shortcuts":"Atalhos de Teclado","dock.position":"Posi\xE7\xE3o de Ferramentas",bottom:"Inferior",top:"Superior",right:"Direita",left:"Esquerda","align.left":"Alinhar \xE0 esquerda","align.center.x":"Alinhar ao centro na horizontal","align.right":"Alinhar \xE0 direita","align.top":"Alinhas em cima","align.center.y":"Alinhar ao centro na vertical","align.bottom":"Alinhar embaixo","distribute.x":"Distruibuir na horizontal","distribute.y":"Distruibuir na vertical","stretch.x":"Esticar na horizontal","stretch.y":"Esticar na vertical","dialog.save.firsttime":"Voc\xEA deseja salvar seu projeto atual?","dialog.save.again":"Voc\xEA deseja salvar as mudan\xE7as ao projeto atual?","dialog.cancel":"Cancelar","dialog.no":"N\xE3o","dialog.yes":"Sim","enter.file.name":"Insira o nome do arquivo"};var Jl={"style.menu.color":"Cor","style.menu.fill":"Preencher","style.menu.dash":"Tra\xE7o","style.menu.size":"Tamanho","style.menu.keep.open":"Manter aberto","style.menu.font":"Fonte","style.menu.align":"Alinhamento",styles:"Estilos","zoom.in":"Aumentar zoom","zoom.out":"Diminuir zoom",to:"para","menu.file":"Ficheiro","menu.edit":"Editar","menu.view":"Visualizar","menu.preferences":"Prefer\xEAncias","menu.sign.in":"Entrar","menu.sign.out":"Sair","become.a.sponsor":"Torne-se um patrocinador","zoom.to.selection":"Zoom na sele\xE7\xE3o","zoom.to.fit":"Zoom para caber","zoom.to":"Zoom para","preferences.dark.mode":"Modo Escuro","preferences.focus.mode":"Modo Foco","preferences.debug.mode":"Modo Debug","preferences.show.grid":"Mostrar Grelha","preferences.use.cad.selection":"Usar sele\xE7\xE3o CAD","preferences.keep.stylemenu.open":"Manter Menu de Estilos Aberto","preferences.always.show.snaps":"Mostrar Pontos de Ajuste","preferences.rotate.handles":"Controlo de Rota\xE7\xE3o","preferences.binding.handles":"Controlo de Binds","preferences.clone.handles":"Controlo de Clone",undo:"Desfazer",redo:"Refazer",cut:"Cortar",copy:"Copiar",paste:"Colar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todos","select.none":"Selecionar nenhum",delete:"Apagar","new.project":"Novo Projeto",open:"Abrir",save:"Salvar","save.as":"Salvar Como","upload.media":"Upload M\xE9dia","create.page":"Criar P\xE1gina","new.page":"Nova P\xE1gina","page.name":"Nome da P\xE1gina",duplicate:"Duplicar",cancel:"Cancelar","copy.invite.link":"Copiar Link de Convite","create.multiplayer.project":"Criar um Projeto Multi-Utilizador","copy.multiplayer.project":"Copiar num Projeto Multi-Utilizador",select:"Selecionar",eraser:"Borracha",draw:"Desenhar",arrow:"Seta",text:"Texto",sticky:"Post-it",rectangle:"Ret\xE2ngulo",ellipse:"Elipse",triangle:"Tri\xE2ngulo",line:"Linha",rotate:"Rodar","lock.aspect.ratio":"Trancar a Propor\xE7\xE3o","unlock.aspect.ratio":"Destrancar a Propor\xE7\xE3o",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Colocar no Fundo","move.backward":"Mover abaixo","move.forward":"Mover acima","move.to.front":"Colocar \xE0 Frente","reset.angle":"Reiniciar \xC2ngulo",lock:"Trancar",unlock:"Destrancar","move.to.page":"Mover para P\xE1gina","flip.horizontal":"Inverter Horizontalmente","flip.vertical":"Inverter Verticalmente",move:"Mover","to.front":"Para Frente",forward:"Avan\xE7ar",backward:"Recuar",back:"Voltar",language:"L\xEDngua"};var Ql={"style.menu.color":"\u0426\u0432\u0435\u0442","style.menu.fill":"\u0417\u0430\u043F\u043E\u043B\u043D\u044F\u0442\u044C","style.menu.dash":"\u0428\u0442\u0440\u0438\u0445","style.menu.size":"\u0420\u0430\u0437\u043C\u0435\u0440","style.menu.keep.open":"\u0414\u0435\u0440\u0436\u0430\u0442\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C","style.menu.font":"\u0428\u0440\u0438\u0444\u0442","style.menu.align":"\u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435",styles:"\u0421\u0442\u0438\u043B\u044C","zoom.in":"\u0423\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C","zoom.out":"\u0423\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C",to:"\u043A","menu.tools":"\u0418\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u044B","menu.transform":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435","menu.file":"\u0424\u0430\u0439\u043B","menu.edit":"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435","menu.view":"\u0412\u0438\u0434","menu.preferences":"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438","menu.sign.in":"\u0412\u043E\u0439\u0442\u0438","menu.sign.out":"\u0412\u044B\u0439\u0442\u0438","become.a.sponsor":"\u0421\u0442\u0430\u0442\u044C \u0441\u043F\u043E\u043D\u0441\u043E\u0440\u043E\u043C","zoom.to.content":"\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043A \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443","zoom.to.selection":"\u041C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044E","zoom.to.fit":"\u041C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0443 \u044D\u043A\u0440\u0430\u043D\u0430","zoom.to":"\u041C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A","preferences.dark.mode":"\u0422\u0451\u043C\u043D\u0430\u044F \u0442\u0435\u043C\u0430","preferences.focus.mode":"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C","preferences.debug.mode":"\u0420\u0435\u0436\u0438\u043C \u043E\u0442\u043B\u0430\u0434\u043A\u0438","preferences.show.grid":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u0435\u0442\u043A\u0443","preferences.use.cad.selection":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C CAD \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u0435","preferences.keep.stylemenu.open":"\u0414\u0435\u0440\u0436\u0430\u0442\u044C \u043C\u0435\u043D\u044E \u0441\u0442\u0438\u043B\u0435\u0439 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C","preferences.always.show.snaps":"\u0412\u0441\u0435\u0433\u0434\u0430 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0438","preferences.rotate.handles":"\u0420\u0443\u0447\u043A\u0438 \u0432\u0440\u0430\u0449\u0435\u043D\u0438\u044F","preferences.binding.handles":"\u0420\u0443\u0447\u043A\u0438 \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0438","preferences.clone.handles":"\u0420\u0443\u0447\u043A\u0438 \u043A\u043B\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",undo:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",redo:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",cut:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C",copy:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",paste:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C","copy.as":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u0430\u043A","export.as":"\u042D\u043A\u0441\u043F\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u0430\u043A","select.all":"\u0412\u044B\u0434\u0435\u043B\u0438\u0442\u044C \u0432\u0441\u0451","select.none":"\u0421\u043D\u044F\u0442\u044C \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u0435",delete:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","new.project":"\u041D\u043E\u0432\u044B\u0439 \u043F\u0440\u043E\u0435\u043A\u0442",open:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C",save:"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C","save.as":"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043A\u0430\u043A","upload.media":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043C\u0435\u0434\u0438\u0430\u0444\u0430\u0439\u043B","create.page":"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443","new.page":"\u041D\u043E\u0432\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430","page.name":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",duplicate:"\u0414\u0443\u0431\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C",cancel:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C","copy.invite.link":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u043F\u0440\u0438\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F","copy.readonly.link":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F","create.multiplayer.project":"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043C\u043D\u043E\u0433\u043E\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442","copy.multiplayer.project":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 \u043C\u043D\u043E\u0433\u043E\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442",select:"\u0412\u044B\u0434\u0435\u043B\u0438\u0442\u044C",eraser:"\u041B\u0430\u0441\u0442\u0438\u043A",draw:"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C",arrow:"\u0421\u0442\u0440\u0435\u043B\u043A\u0430",text:"\u0422\u0435\u043A\u0441\u0442",sticky:"\u0417\u0430\u043C\u0435\u0442\u043A\u0430",rectangle:"\u041F\u0440\u044F\u043C\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A",ellipse:"\u042D\u043B\u043B\u0438\u043F\u0441",triangle:"\u0422\u0440\u0435\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A",line:"\u041B\u0438\u043D\u0438\u044F",rotate:"\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u044C","lock.aspect.ratio":"\u0417\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043E\u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0435 \u0441\u0442\u043E\u0440\u043E\u043D","unlock.aspect.ratio":"\u0420\u0430\u0437\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043E\u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0435 \u0441\u0442\u043E\u0440\u043E\u043D",group:"\u0421\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",ungroup:"\u0420\u0430\u0437\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","move.to.back":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043D\u0430\u0437\u0430\u0434","move.backward":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043D\u0430 \u0437\u0430\u0434\u043D\u0438\u0439 \u043F\u043B\u0430\u043D","move.forward":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0432\u043F\u0435\u0440\u0451\u0434","move.to.front":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0438\u0439 \u043F\u043B\u0430\u043D","reset.angle":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0443\u0433\u043E\u043B",lock:"\u0411\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C",unlock:"\u0420\u0430\u0437\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C","align.distribute":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C / \u0440\u0430\u0441\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C","move.to.page":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443","flip.horizontal":"\u041F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","flip.vertical":"\u041F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E",move:"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C","to.front":"\u041D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0438\u0439 \u043F\u043B\u0430\u043D",forward:"\u0412\u043F\u0435\u0440\u0435\u0434",backward:"\u041D\u0430 \u0437\u0430\u0434\u043D\u0438\u0439 \u043F\u043B\u0430\u043D",back:"\u041D\u0430\u0437\u0430\u0434",language:"\u042F\u0437\u044B\u043A","translation.link":"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435","dock.position":"\u0420\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0430\u043D\u0435\u043B\u0438 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432",bottom:"\u0421\u043D\u0438\u0437\u0443",left:"\u0421\u043B\u0435\u0432\u0430",right:"\u0421\u043F\u0440\u0430\u0432\u0430",top:"\u0421\u0432\u0435\u0440\u0445\u0443",page:"\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430","keyboard.shortcuts":"\u0421\u043E\u0447\u0435\u0442\u0430\u043D\u0438\u044F \u043A\u043B\u0430\u0432\u0438\u0448",search:"\u041F\u043E\u0438\u0441\u043A",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430","export.background":"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0444\u043E\u043D\u0430",transparent:"\u041F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u044B\u0439",auto:"\u0410\u0432\u0442\u043E",light:"\u0421\u0432\u0435\u0442\u043B\u044B\u0439",dark:"\u0422\u0451\u043C\u043D\u044B\u0439",image:"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435","align.left":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u043B\u0435\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E","align.center.x":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","align.right":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E","align.top":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E","align.center.y":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E","align.bottom":"\u0412\u044B\u0440\u043E\u0432\u043D\u044F\u0442\u044C \u043F\u043E \u043D\u0438\u0436\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E","distribute.x":"\u0420\u0430\u0441\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","distribute.y":"\u0420\u0430\u0441\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E","stretch.x":"\u0420\u0430\u0441\u0442\u044F\u043D\u0443\u0442\u044C \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","stretch.y":"\u0420\u0430\u0441\u0442\u044F\u043D\u0443\u0442\u044C \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E",share:"\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u044C\u0441\u044F","copy.current.page.link":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443","copy.project.link":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u043F\u0440\u043E\u0435\u043A\u0442","data.too.big.encoded":"\u0414\u0430\u043D\u043D\u044B\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0432\u0435\u043B\u0438\u043A\u0438, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0438\u0445 \u0432 \u0441\u0441\u044B\u043B\u043A\u0435. \u041D\u0435 \u0432\u043A\u043B\u044E\u0447\u0430\u0439\u0442\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0438\u043B\u0438 \u0432\u0438\u0434\u0435\u043E!","dialog.save.firsttime":"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442?","dialog.save.again":"\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u0435?","dialog.cancel":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C","dialog.no":"\u041D\u0435\u0442","dialog.yes":"\u0414\u0430","enter.file.name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043C\u044F \u0444\u0430\u0439\u043B\u0430"};var ed={"style.menu.color":"F\xE4rg","style.menu.fill":"Ifylld","style.menu.dash":"Streck","style.menu.size":"Storlek","style.menu.keep.open":"H\xE5ll stilmenyn \xF6ppen","style.menu.font":"Typsnitt","style.menu.align":"Justera",styles:"Utseende","zoom.in":"Zooma in","zoom.out":"Zooma ut",to:"Till","menu.tools":"Verktyg","menu.transform":"Transform","menu.file":"Arkiv","menu.edit":"Redigera","menu.view":"Inneh\xE5ll","menu.preferences":"Inst\xE4llningar","menu.sign.in":"Logga in","menu.sign.out":"Logga ut","become.a.sponsor":"Bli en sponsor","zoom.to.content":"Anpassa zoom till inneh\xE5ll","zoom.to.selection":"Anpassa zoom till urval","zoom.to.fit":"Anpassa zoom till sk\xE4rm","zoom.to":"Zooma till","preferences.dark.mode":"M\xF6rkt l\xE4ge","preferences.focus.mode":"Fokusl\xE4ge","preferences.debug.mode":"Debugl\xE4ge","preferences.show.grid":"Visa rutn\xE4t","preferences.use.cad.selection":"V\xE4lj som i CAD-mjukvara","preferences.keep.stylemenu.open":"H\xE5ll stilmenyn \xF6ppen","preferences.always.show.snaps":"Visa alltid f\xE4stpunkter","preferences.rotate.handles":"Rotationshandtag","preferences.binding.handles":"Bindningshandtag","preferences.clone.handles":"Kloningshandtag",undo:"\xC5ngra",redo:"G\xF6r om",cut:"Klipp ut",copy:"Kopiera",paste:"Klistra in","copy.as":"Kopiera som","export.as":"Exportera till","select.all":"V\xE4lj alla","select.none":"V\xE4lj ingen",delete:"Radera","new.project":"Nytt projekt",open:"\xD6ppna",save:"Spara","save.as":"Spara som","upload.media":"Ladda upp media","create.page":"Skapa sida","new.page":"Ny sida","page.name":"Sidnamn",duplicate:"Duplicera",cancel:"Avbryt","copy.invite.link":"Kopiera l\xE4nk med redigeringsr\xE4ttigheter","copy.readonly.link":"Kopiera l\xE4nk med l\xE4sr\xE4ttigheter","create.multiplayer.project":"Skapa ett Multiplayer-projekt","copy.multiplayer.project":"Kopiera till Multiplayer-project",select:"V\xE4lj",eraser:"Radera",draw:"Rita",arrow:"Pil",text:"Text",sticky:"Klisterlapp",rectangle:"Rektangel",ellipse:"Ellips",triangle:"Triangel",line:"Linje",rotate:"Rotera","lock.aspect.ratio":"L\xE5s storleksf\xF6rh\xE5llande","unlock.aspect.ratio":"L\xE5s upp storleksf\xF6rh\xE5llande",group:"Gruppera",ungroup:"Avgruppera","move.to.back":"Placera l\xE4ngst bak","move.backward":"Flytta bak\xE5t","move.forward":"Flytta fram\xE5t","move.to.front":"Placera l\xE4ngst fram","reset.angle":"\xC5terst\xE4ll vinkel",lock:"L\xE5s",unlock:"L\xE5s upp","align.distribute":"Justera / Placera","move.to.page":"Flytta till sida","flip.horizontal":"V\xE4nd horisontellt","flip.vertical":"V\xE4nd vertikalt",move:"Flytta","to.front":"Till l\xE4ngst fram",forward:"Fram\xE5t",backward:"Bak\xE5t",back:"Till l\xE4ngst bak",language:"Spr\xE5k","translation.link":"Mer information","dock.position":"Dockningsposition",bottom:"Botten",left:"V\xE4nster",right:"H\xF6ger",top:"Topp",page:"Sida","keyboard.shortcuts":"Tangentbordsgenv\xE4gar",search:"S\xF6k",loading:"Laddar{dots}","export.background":"Exportbakgrund",transparent:"Transparent",auto:"Auto",light:"Ljus",dark:"M\xF6rk",github:"Github",twitter:"Twitter",discord:"Discord",image:"Bild"};var td={"style.menu.color":"\u0C30\u0C02\u0C17\u0C41","style.menu.fill":"\u0C28\u0C3F\u0C02\u0C2A\u0C41","style.menu.dash":"\u0C05\u0C21\u0C4D\u0C21 \u0C17\u0C40\u0C24","style.menu.size":"\u0C2A\u0C30\u0C3F\u0C2E\u0C3E\u0C23\u0C02","style.menu.keep.open":"\u0C24\u0C46\u0C30\u0C3F\u0C1A\u0C3F \u0C09\u0C02\u0C1A\u0C41","style.menu.font":"\u0C05\u0C15\u0C4D\u0C37\u0C30\u0C3E\u0C15\u0C43\u0C24\u0C3F","style.menu.align":"\u0C38\u0C30\u0C3F\u0C2A\u0C30\u0C1A\u0C41",styles:"\u0C35\u0C3F\u0C27\u0C2E\u0C41\u0C32\u0C41","zoom.in":"\u0C26\u0C17\u0C4D\u0C17\u0C30\u0C17\u0C3E \u0C1A\u0C42\u0C2A\u0C41","zoom.out":"\u0C26\u0C42\u0C30\u0C02\u0C17\u0C3E \u0C1A\u0C42\u0C2A\u0C41",to:"\u0C35\u0C26\u0C4D\u0C26\u0C15\u0C41","menu.tools":"\u0C2A\u0C30\u0C3F\u0C15\u0C30\u0C3E\u0C32\u0C41","menu.transform":"\u0C2E\u0C3E\u0C30\u0C4D\u0C1A\u0C41","menu.file":"\u0C2B\u0C48\u0C32\u0C4D","menu.edit":"\u0C2A\u0C30\u0C3F\u0C37\u0C4D\u0C15\u0C30\u0C3F\u0C02\u0C1A\u0C41","menu.view":"\u0C1A\u0C42\u0C2A\u0C41","menu.preferences":"\u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C4A\u0C28\u0C4D\u0C28\u0C35\u0C3F","menu.sign.in":"\u0C2A\u0C4D\u0C30\u0C35\u0C47\u0C36\u0C3F\u0C02\u0C1A\u0C41","menu.sign.out":"\u0C28\u0C3F\u0C37\u0C4D\u0C15\u0C4D\u0C30\u0C2E\u0C23","become.a.sponsor":"\u0C35\u0C3F\u0C30\u0C3E\u0C33\u0C26\u0C3E\u0C30\u0C41\u0C32\u0C41 \u0C05\u0C35\u0C4D\u0C35\u0C02\u0C21\u0C3F","zoom.to.content":"\u0C35\u0C3F\u0C37\u0C2F\u0C3E\u0C28\u0C4D\u0C28\u0C47 \u0C1A\u0C42\u0C2A\u0C41","zoom.to.selection":"\u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C41\u0C28\u0C4D\u0C28 \u0C35\u0C3F\u0C37\u0C2F\u0C3E\u0C28\u0C4D\u0C28\u0C47 \u0C1A\u0C42\u0C2A\u0C41","zoom.to.fit":"\u0C38\u0C30\u0C3F\u0C2A\u0C46\u0C1F\u0C4D\u0C1F\u0C3F \u0C1A\u0C42\u0C2A\u0C41","zoom.to":"\u0C1A\u0C42\u0C2A\u0C41","preferences.dark.mode":"\u0C1A\u0C40\u0C15\u0C1F\u0C48\u0C28 \u0C15\u0C4D\u0C30\u0C2E\u0C02","preferences.focus.mode":"\u0C24\u0C40\u0C15\u0C4D\u0C37\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02","preferences.debug.mode":"\u0C24\u0C2A\u0C4D\u0C2A\u0C41\u0C32\u0C47\u0C30\u0C41 \u0C15\u0C4D\u0C30\u0C2E\u0C02","preferences.show.grid":"\u0C1A\u0C1F\u0C4D\u0C30\u0C02 \u0C1A\u0C42\u0C2A\u0C41","preferences.use.cad.selection":"CAD\u0C28\u0C3F \u0C35\u0C3E\u0C21\u0C41","preferences.keep.stylemenu.open":"\u0C35\u0C3F\u0C27\u0C2E\u0C41\u0C32 \u0C2A\u0C24\u0C4D\u0C24\u0C3F \u0C24\u0C46\u0C30\u0C3F\u0C1A\u0C3F\u0C35\u0C41\u0C02\u0C1A\u0C41","preferences.always.show.snaps":"\u0C0E\u0C2A\u0C4D\u0C2A\u0C41\u0C21\u0C42 \u0C26\u0C43\u0C36\u0C4D\u0C2F\u0C2D\u0C3E\u0C17\u0C02 \u0C1A\u0C42\u0C2A\u0C41","preferences.rotate.handles":"\u0C39\u0C4D\u0C2F\u0C3E\u0C02\u0C21\u0C3F\u0C32\u0C4D\u0C38\u0C4D \u0C24\u0C3F\u0C2A\u0C4D\u0C2A\u0C41","preferences.binding.handles":"\u0C2F\u0C3E\u0C02\u0C21\u0C3F\u0C32\u0C4D\u0C38\u0C4D \u0C15\u0C1F\u0C4D\u0C1F\u0C41","preferences.clone.handles":"\u0C2F\u0C3E\u0C02\u0C21\u0C3F\u0C32\u0C4D\u0C38\u0C4D \u0C28\u0C15\u0C32\u0C41",undo:"\u0C2E\u0C3E\u0C30\u0C4D\u0C2A\u0C41\u0C28\u0C3F \u0C24\u0C3F\u0C30\u0C41\u0C17\u0C17\u0C4A\u0C1F\u0C4D\u0C1F\u0C41",redo:"\u0C2E\u0C33\u0C4D\u0C33\u0C40 \u0C2E\u0C3E\u0C30\u0C4D\u0C1A\u0C41",cut:"\u0C15\u0C24\u0C4D\u0C24\u0C3F\u0C30\u0C3F\u0C02\u0C1A\u0C41",copy:"\u0C28\u0C15\u0C32\u0C41",paste:"\u0C05\u0C24\u0C3F\u0C15\u0C3F\u0C02\u0C1A\u0C41","copy.as":"\u0C28\u0C15\u0C32\u0C41\u0C2A\u0C4D\u0C30\u0C24\u0C3F\u0C17\u0C3E \u0C07\u0C15\u0C4D\u0C15\u0C21\u0C3F\u0C15\u0C3F","export.as":"\u0C0E\u0C17\u0C41\u0C2E\u0C24\u0C3F \u0C07\u0C15\u0C4D\u0C15\u0C21\u0C3F\u0C15\u0C3F","select.all":"\u0C05\u0C28\u0C4D\u0C28\u0C40 \u0C0E\u0C02\u0C2A\u0C3F\u0C15\u0C1A\u0C46\u0C2F\u0C4D\u0C2F\u0C3F","select.none":"\u0C0E\u0C26\u0C40 \u0C0E\u0C02\u0C2A\u0C3F\u0C15\u0C1A\u0C46\u0C2F\u0C4D\u0C2F\u0C35\u0C26\u0C4D\u0C26\u0C41",delete:"\u0C24\u0C4A\u0C32\u0C17\u0C3F\u0C02\u0C1A\u0C41","new.project":"\u0C15\u0C4A\u0C24\u0C4D\u0C24 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C41",open:"\u0C24\u0C46\u0C30\u0C41\u0C35\u0C41",save:"\u0C26\u0C3E\u0C2F\u0C3F","save.as":"\u0C07\u0C32\u0C3E \u0C26\u0C3E\u0C2F\u0C3F","upload.media":"\u0C0E\u0C17\u0C41\u0C2E\u0C24\u0C3F \u0C2E\u0C3E\u0C27\u0C4D\u0C2F\u0C02","create.page":"\u0C2A\u0C41\u0C1F \u0C15\u0C32\u0C4D\u0C2A\u0C3F\u0C02\u0C1A\u0C41","new.page":"\u0C15\u0C4A\u0C24\u0C4D\u0C24 \u0C2A\u0C41\u0C1F","page.name":"\u0C2A\u0C41\u0C1F \u0C2A\u0C47\u0C30\u0C41",duplicate:"\u0C2E\u0C3E\u0C30\u0C41\u0C2A\u0C4D\u0C30\u0C24\u0C3F",cancel:"\u0C30\u0C26\u0C4D\u0C26\u0C41\u0C1A\u0C47\u0C2F\u0C3F","copy.invite.link":"\u0C05\u0C39\u0C4D\u0C35\u0C3E\u0C28 \u0C32\u0C3F\u0C02\u0C15\u0C41 \u0C30\u0C3E\u0C2F\u0C3F","copy.readonly.link":"\u0C2E\u0C3E\u0C30\u0C28\u0C3F\u0C2A\u0C4D\u0C30\u0C24\u0C3F \u0C32\u0C3F\u0C02\u0C15\u0C41 \u0C30\u0C3E\u0C2F\u0C3F","create.multiplayer.project":"\u0C2C\u0C39\u0C41\u0C15\u0C30\u0C4D\u0C24\u0C32 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C41 \u0C15\u0C32\u0C4D\u0C2A\u0C3F\u0C02\u0C1A\u0C41","copy.multiplayer.project":"\u0C2C\u0C39\u0C41\u0C15\u0C30\u0C4D\u0C24\u0C32 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C41\u0C15\u0C41 \u0C30\u0C3E\u0C2F\u0C3F",select:"\u0C0E\u0C02\u0C2A\u0C3F\u0C15\u0C1A\u0C46\u0C2F\u0C4D\u0C2F\u0C3F",eraser:"Eraser",draw:"\u0C17\u0C40\u0C2F\u0C4D\u0C2F\u0C3F",arrow:"\u0C2C\u0C3E\u0C23\u0C02",text:"\u0C05\u0C15\u0C4D\u0C37\u0C30\u0C2E\u0C41\u0C32\u0C41",sticky:"\u0C05\u0C24\u0C41\u0C15\u0C4D\u0C15\u0C41\u0C28\u0C47",rectangle:"\u0C26\u0C40\u0C30\u0C4D\u0C18\u0C1A\u0C24\u0C41\u0C30\u0C38\u0C4D\u0C30\u0C02",ellipse:"\u0C26\u0C40\u0C30\u0C4D\u0C18\u0C35\u0C43\u0C24\u0C4D\u0C24\u0C02",triangle:"\u0C24\u0C4D\u0C30\u0C3F\u0C2D\u0C41\u0C1C\u0C02",line:"\u0C17\u0C40\u0C24",rotate:"\u0C24\u0C3F\u0C2A\u0C4D\u0C2A\u0C41","lock.aspect.ratio":"\u0C06\u0C38\u0C4D\u0C2A\u0C46\u0C15\u0C4D\u0C1F\u0C4D \u0C28\u0C3F\u0C37\u0C4D\u0C2A\u0C24\u0C4D\u0C24\u0C3F\u0C15\u0C3F \u0C24\u0C3E\u0C33\u0C02\u0C2A\u0C46\u0C1F\u0C4D\u0C1F\u0C41","unlock.aspect.ratio":"\u0C06\u0C38\u0C4D\u0C2A\u0C46\u0C15\u0C4D\u0C1F\u0C4D \u0C28\u0C3F\u0C37\u0C4D\u0C2A\u0C24\u0C4D\u0C24\u0C3F \u0C24\u0C3E\u0C33\u0C02\u0C24\u0C46\u0C30\u0C41\u0C35\u0C41",group:"\u0C17\u0C41\u0C02\u0C2A\u0C41\u0C17\u0C3E \u0C0F\u0C30\u0C4D\u0C2A\u0C30\u0C1A\u0C41",ungroup:"\u0C17\u0C41\u0C02\u0C2A\u0C41\u0C28\u0C41 \u0C1A\u0C46\u0C26\u0C30\u0C17\u0C4A\u0C1F\u0C4D\u0C1F\u0C41","move.to.back":"\u0C06\u0C16\u0C30\u0C3F\u0C15\u0C3F \u0C1C\u0C30\u0C41\u0C2A\u0C41","move.backward":"\u0C35\u0C46\u0C28\u0C41\u0C15\u0C15\u0C41 \u0C1C\u0C30\u0C41\u0C2A\u0C41","move.forward":"\u0C2E\u0C41\u0C02\u0C26\u0C41\u0C15\u0C41 \u0C1C\u0C30\u0C41\u0C2A\u0C41","move.to.front":"\u0C2E\u0C4A\u0C26\u0C1F\u0C3F\u0C15\u0C3F \u0C1C\u0C30\u0C41\u0C2A\u0C41","reset.angle":"\u0C15\u0C4B\u0C23\u0C02 \u0C30\u0C40\u0C38\u0C46\u0C1F\u0C4D",lock:"\u0C24\u0C3E\u0C33\u0C02 \u0C35\u0C46\u0C2F\u0C4D\u0C2F\u0C3F",unlock:"\u0C24\u0C3E\u0C33\u0C02 \u0C24\u0C3F\u0C2F\u0C4D\u0C2F\u0C3F","align.distribute":" \u0C38\u0C30\u0C3F\u0C2A\u0C30\u0C1A\u0C41/\u0C35\u0C46\u0C26\u0C1C\u0C32\u0C4D\u0C32\u0C41","move.to.page":"\u0C2A\u0C41\u0C1F\u0C32\u0C4B\u0C15\u0C3F \u0C1C\u0C30\u0C41\u0C2A\u0C41","flip.horizontal":"\u0C05\u0C21\u0C4D\u0C21\u0C02\u0C17\u0C3E \u0C2A\u0C32\u0C4D\u0C1F\u0C40","flip.vertical":"\u0C28\u0C3F\u0C32\u0C41\u0C35\u0C41\u0C17\u0C3E \u0C2A\u0C32\u0C4D\u0C1F\u0C40",move:"\u0C1C\u0C30\u0C41\u0C2A\u0C41","to.front":"\u0C2E\u0C4A\u0C26\u0C1F\u0C3F\u0C15\u0C3F",forward:"\u0C2E\u0C41\u0C02\u0C26\u0C41\u0C15\u0C41",backward:"\u0C35\u0C46\u0C28\u0C41\u0C15\u0C15\u0C41",back:"\u0C06\u0C16\u0C30\u0C3F\u0C15\u0C3F",language:"\u0C2D\u0C3E\u0C37","translation.link":"\u0C2E\u0C30\u0C3F \u0C15\u0C4A\u0C28\u0C4D\u0C28\u0C3F \u0C35\u0C3F\u0C37\u0C2F\u0C3E\u0C32\u0C41","dock.position":"\u0C2E\u0C02\u0C1A \u0C38\u0C4D\u0C25\u0C3E\u0C28\u0C02",bottom:"\u0C05\u0C21\u0C41\u0C17\u0C41\u0C28",left:"\u0C0E\u0C21\u0C2E\u0C35\u0C48\u0C2A\u0C41",right:"\u0C15\u0C41\u0C21\u0C3F\u0C35\u0C48\u0C2A\u0C41",top:"\u0C2A\u0C48\u0C28",page:"\u0C2A\u0C41\u0C24","keyboard.shortcuts":"\u0C15\u0C40\u0C2C\u0C4B\u0C30\u0C4D\u0C21\u0C4D \u0C38\u0C24\u0C4D\u0C35\u0C30\u0C2E\u0C3E\u0C30\u0C4D\u0C17\u0C02",search:"\u0C35\u0C46\u0C24\u0C41\u0C15\u0C41",loading:"Loading{dots}","export.background":"\u0C28\u0C47\u0C2A\u0C25\u0C4D\u0C2F\u0C02 \u0C0E\u0C17\u0C41\u0C2E\u0C24\u0C3F",transparent:"\u0C15\u0C3E\u0C02\u0C24\u0C3F \u0C2D\u0C47\u0C26\u0C4D\u0C2F\u0C2E\u0C41",auto:"\u0C38\u0C4D\u0C35\u0C2F\u0C02\u0C15\u0C43\u0C24\u0C02",light:"\u0C35\u0C46\u0C32\u0C41\u0C24\u0C41\u0C30\u0C41",dark:"\u0C1A\u0C40\u0C15\u0C1F\u0C3F",github:"Github",twitter:"Twitter",discord:"Discord",image:"\u0C1A\u0C3F\u0C24\u0C4D\u0C30\u0C02","align.left":"\u0C0E\u0C21\u0C2E\u0C35\u0C48\u0C2A\u0C41\u0C15\u0C41 \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.center.x":"\u0C05\u0C21\u0C4D\u0C21\u0C02\u0C17\u0C3E \u0C2E\u0C27\u0C4D\u0C2F\u0C32\u0C4B \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.right":"\u0C15\u0C41\u0C21\u0C3F\u0C35\u0C48\u0C2A\u0C41\u0C15\u0C41 \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.top":"\u0C2A\u0C48\u0C15\u0C3F \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.center.y":"\u0C28\u0C3F\u0C32\u0C41\u0C35\u0C41\u0C17\u0C3E \u0C2E\u0C27\u0C4D\u0C2F\u0C32\u0C4B \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","align.bottom":"\u0C05\u0C21\u0C41\u0C17\u0C41\u0C28 \u0C15\u0C41\u0C26\u0C41\u0C30\u0C4D\u0C1A\u0C41","distribute.x":"\u0C05\u0C21\u0C4D\u0C21\u0C02\u0C17\u0C3E \u0C2A\u0C02\u0C1A\u0C41","distribute.y":"\u0C28\u0C3F\u0C32\u0C41\u0C35\u0C41\u0C17\u0C3E \u0C2A\u0C02\u0C1A\u0C41","stretch.x":"\u0C05\u0C21\u0C4D\u0C21\u0C02\u0C17\u0C3E \u0C32\u0C3E\u0C17\u0C41","stretch.y":"\u0C28\u0C3F\u0C32\u0C41\u0C35\u0C41\u0C17\u0C3E \u0C32\u0C3E\u0C17\u0C41","dialog.save.firsttime":"\u0C2E\u0C40\u0C30\u0C41 \u0C08 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C4D \u0C2D\u0C26\u0C4D\u0C30\u0C2A\u0C30\u0C1A\u0C41\u0C15\u0C4B\u0C35\u0C3E\u0C32\u0C28\u0C3F \u0C05\u0C28\u0C41\u0C15\u0C41\u0C02\u0C1F\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C30\u0C3E?","dialog.save.again":"\u0C2E\u0C40\u0C30\u0C41 \u0C08 \u0C2A\u0C4D\u0C30\u0C3E\u0C1C\u0C46\u0C15\u0C4D\u0C1F\u0C4D \u0C2D\u0C26\u0C4D\u0C30\u0C2A\u0C30\u0C1A\u0C41\u0C15\u0C4B\u0C35\u0C3E\u0C32\u0C28\u0C3F \u0C05\u0C28\u0C41\u0C15\u0C41\u0C02\u0C1F\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C30\u0C3E?","dialog.cancel":"\u0C30\u0C26\u0C4D\u0C26\u0C41\u0C1A\u0C46\u0C2F\u0C4D\u0C2F\u0C3F","dialog.no":"\u0C35\u0C26\u0C4D\u0C26\u0C41","dialog.yes":"\u0C38\u0C30\u0C47","enter.file.name":"\u0C2B\u0C48\u0C32\u0C4D \u0C2A\u0C46\u0C30\u0C41 \u0C1A\u0C46\u0C2A\u0C4D\u0C2A\u0C02\u0C21\u0C3F"};var nd={"style.menu.color":"\u0E2A\u0E35","style.menu.fill":"\u0E40\u0E15\u0E34\u0E21","style.menu.dash":"\u0E01\u0E23\u0E2D\u0E1A","style.menu.size":"\u0E02\u0E19\u0E32\u0E14","style.menu.keep.open":"\u0E40\u0E1B\u0E34\u0E14\u0E17\u0E34\u0E49\u0E07\u0E44\u0E27\u0E49","style.menu.font":"\u0E41\u0E1A\u0E1A\u0E2D\u0E31\u0E01\u0E29\u0E23","style.menu.align":"\u0E08\u0E31\u0E14\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07",styles:"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A","zoom.in":"\u0E0B\u0E39\u0E21\u0E40\u0E02\u0E49\u0E32","zoom.out":"\u0E0B\u0E39\u0E21\u0E2D\u0E2D\u0E01",to:"\u0E0B\u0E39\u0E21\u0E44\u0E1B\u0E17\u0E35\u0E48","menu.tools":"\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E21\u0E37\u0E2D","menu.transform":"\u0E41\u0E1B\u0E25\u0E07","menu.file":"\u0E44\u0E1F\u0E25\u0E4C","menu.edit":"\u0E41\u0E01\u0E49\u0E44\u0E02","menu.view":"\u0E21\u0E38\u0E21\u0E21\u0E2D\u0E07","menu.preferences":"\u0E01\u0E32\u0E23\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32","menu.sign.in":"\u0E40\u0E02\u0E49\u0E32\u0E2A\u0E39\u0E48\u0E23\u0E30\u0E1A\u0E1A","menu.sign.out":"\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A","become.a.sponsor":"\u0E23\u0E48\u0E27\u0E21\u0E40\u0E1B\u0E47\u0E19\u0E2A\u0E1B\u0E2D\u0E19\u0E40\u0E0B\u0E2D\u0E23\u0E4C","zoom.to.content":"\u0E01\u0E25\u0E31\u0E1A\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32","zoom.to.selection":"\u0E0B\u0E39\u0E21\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E2A\u0E48\u0E27\u0E19\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01","zoom.to.fit":"\u0E0B\u0E39\u0E21\u0E43\u0E2B\u0E49\u0E40\u0E15\u0E47\u0E21\u0E1E\u0E2D\u0E14\u0E35","zoom.to":"\u0E0B\u0E39\u0E21\u0E44\u0E1B\u0E17\u0E35\u0E48","preferences.dark.mode":"\u0E42\u0E2B\u0E21\u0E14\u0E21\u0E37\u0E14","preferences.focus.mode":"\u0E42\u0E2B\u0E21\u0E14\u0E42\u0E1F\u0E01\u0E31\u0E2A","preferences.debug.mode":"\u0E42\u0E2B\u0E21\u0E14\u0E14\u0E35\u0E1A\u0E31\u0E01","preferences.show.grid":"\u0E41\u0E2A\u0E14\u0E07\u0E15\u0E32\u0E23\u0E32\u0E07","preferences.use.cad.selection":"\u0E01\u0E32\u0E23\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E1A\u0E1A CAD","preferences.keep.stylemenu.open":"\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E34\u0E49\u0E07\u0E44\u0E27\u0E49","preferences.always.show.snaps":"\u0E41\u0E2A\u0E14\u0E07\u0E2A\u0E41\u0E19\u0E1B\u0E15\u0E25\u0E2D\u0E14","preferences.rotate.handles":"\u0E41\u0E2A\u0E14\u0E07\u0E08\u0E38\u0E14\u0E08\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E2B\u0E21\u0E38\u0E19","preferences.binding.handles":"\u0E41\u0E2A\u0E14\u0E07\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E2D\u0E49\u0E32\u0E07\u0E2D\u0E34\u0E07","preferences.clone.handles":"\u0E41\u0E2A\u0E14\u0E07\u0E15\u0E31\u0E27\u0E42\u0E04\u0E25\u0E19",undo:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",redo:"\u0E17\u0E33\u0E0B\u0E49\u0E33",cut:"\u0E15\u0E31\u0E14",copy:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",paste:"\u0E27\u0E32\u0E07","copy.as":"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E40\u0E1B\u0E47\u0E19","export.as":"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01\u0E40\u0E1B\u0E47\u0E19","select.all":"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14","select.none":"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E2A\u0E34\u0E48\u0E07\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",delete:"\u0E25\u0E1A","new.project":"\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E01\u0E15\u0E4C\u0E43\u0E2B\u0E21\u0E48",open:"\u0E40\u0E1B\u0E34\u0E14",save:"\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01","save.as":"\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E40\u0E1B\u0E47\u0E19","upload.media":"\u0E2D\u0E31\u0E1E\u0E42\u0E2B\u0E25\u0E14\u0E21\u0E35\u0E40\u0E14\u0E35\u0E22","create.page":"\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E2B\u0E19\u0E49\u0E32","new.page":"\u0E2B\u0E19\u0E49\u0E32\u0E43\u0E2B\u0E21\u0E48","page.name":"\u0E0A\u0E37\u0E48\u0E2D\u0E2B\u0E19\u0E49\u0E32",duplicate:"\u0E2A\u0E33\u0E40\u0E19\u0E32",cancel:"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01","copy.invite.link":"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E40\u0E0A\u0E34\u0E0D","copy.readonly.link":"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E25\u0E34\u0E07\u0E01\u0E4C\u0E41\u0E1A\u0E1A\u0E43\u0E2B\u0E49\u0E2D\u0E48\u0E32\u0E19\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E40\u0E14\u0E35\u0E22\u0E27","create.multiplayer.project":"\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E01\u0E15\u0E4C\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E2B\u0E25\u0E32\u0E22\u0E04\u0E19","copy.multiplayer.project":"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E01\u0E15\u0E4C\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49\u0E07\u0E32\u0E19\u0E2B\u0E25\u0E32\u0E22\u0E04\u0E19",select:"\u0E40\u0E25\u0E37\u0E2D\u0E01",eraser:"\u0E22\u0E32\u0E07\u0E25\u0E1A",draw:"\u0E27\u0E32\u0E14",arrow:"\u0E25\u0E39\u0E01\u0E28\u0E23",text:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",sticky:"\u0E01\u0E23\u0E30\u0E14\u0E32\u0E29\u0E42\u0E19\u0E4A\u0E15",rectangle:"\u0E2A\u0E35\u0E48\u0E40\u0E2B\u0E25\u0E35\u0E48\u0E22\u0E21\u0E1C\u0E37\u0E19\u0E1C\u0E49\u0E32",ellipse:"\u0E27\u0E07\u0E23\u0E35",triangle:"\u0E2A\u0E32\u0E21\u0E40\u0E2B\u0E25\u0E35\u0E48\u0E22\u0E21",line:"\u0E40\u0E2A\u0E49\u0E19",rotate:"\u0E2B\u0E21\u0E38\u0E19","lock.aspect.ratio":"\u0E25\u0E47\u0E2D\u0E04\u0E2D\u0E31\u0E15\u0E23\u0E32\u0E2A\u0E48\u0E27\u0E19\u0E20\u0E32\u0E1E","unlock.aspect.ratio":"\u0E1B\u0E25\u0E14\u0E25\u0E47\u0E2D\u0E01\u0E2D\u0E31\u0E15\u0E23\u0E32\u0E2A\u0E48\u0E27\u0E19\u0E20\u0E32\u0E1E",group:"\u0E01\u0E25\u0E38\u0E48\u0E21",ungroup:"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E01\u0E25\u0E38\u0E48\u0E21","move.to.back":"\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07","move.backward":"\u0E02\u0E22\u0E31\u0E1A\u0E16\u0E2D\u0E22\u0E2B\u0E25\u0E31\u0E07","move.forward":"\u0E02\u0E22\u0E31\u0E1A\u0E44\u0E1B\u0E2B\u0E19\u0E49\u0E32","move.to.front":"\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32","reset.angle":"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E21\u0E38\u0E21",lock:"\u0E25\u0E47\u0E2D\u0E04",unlock:"\u0E1B\u0E25\u0E14\u0E25\u0E47\u0E2D\u0E04","align.distribute":"\u0E08\u0E31\u0E14\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07 / \u0E01\u0E23\u0E30\u0E08\u0E32\u0E22","move.to.page":"\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E2B\u0E19\u0E49\u0E32","flip.horizontal":"\u0E1E\u0E25\u0E34\u0E01\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19","flip.vertical":"\u0E1E\u0E25\u0E34\u0E01\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07",move:"\u0E22\u0E49\u0E32\u0E22","to.front":"\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32",forward:"\u0E02\u0E49\u0E32\u0E07\u0E2B\u0E19\u0E49\u0E32",backward:"\u0E02\u0E49\u0E32\u0E07\u0E2B\u0E25\u0E31\u0E07",back:"\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07",language:"\u0E20\u0E32\u0E29\u0E32","translation.link":"\u0E40\u0E23\u0E35\u0E22\u0E19\u0E23\u0E39\u0E49\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21","dock.position":"\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07\u0E41\u0E16\u0E1A\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E21\u0E37\u0E2D",bottom:"\u0E02\u0E49\u0E32\u0E07\u0E25\u0E48\u0E32\u0E07",left:"\u0E02\u0E49\u0E32\u0E07\u0E0B\u0E49\u0E32\u0E22",right:"\u0E02\u0E49\u0E32\u0E07\u0E02\u0E27\u0E32",top:"\u0E02\u0E49\u0E32\u0E07\u0E1A\u0E19",page:"\u0E2B\u0E19\u0E49\u0E32","keyboard.shortcuts":"\u0E41\u0E1B\u0E49\u0E19\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E25\u0E31\u0E14",search:"\u0E04\u0E49\u0E19\u0E2B\u0E32",loading:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14{dots}","export.background":"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01\u0E1E\u0E37\u0E49\u0E19\u0E2B\u0E25\u0E31\u0E07",transparent:"\u0E42\u0E1B\u0E23\u0E48\u0E07\u0E43\u0E2A",auto:"\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",light:"\u0E2A\u0E27\u0E48\u0E32\u0E07",dark:"\u0E21\u0E37\u0E14",github:"Github",twitter:"Twitter",discord:"Discord",image:"\u0E20\u0E32\u0E1E","align.left":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E0A\u0E34\u0E14\u0E0B\u0E49\u0E32\u0E22","align.center.x":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E2D\u0E22\u0E39\u0E48\u0E01\u0E36\u0E48\u0E07\u0E01\u0E25\u0E32\u0E07\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19","align.right":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E0A\u0E34\u0E14\u0E02\u0E27\u0E32","align.top":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E2D\u0E22\u0E39\u0E48\u0E14\u0E49\u0E32\u0E19\u0E1A\u0E19","align.center.y":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E2D\u0E22\u0E39\u0E48\u0E01\u0E36\u0E48\u0E07\u0E01\u0E25\u0E32\u0E07\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07","align.bottom":"\u0E08\u0E31\u0E14\u0E43\u0E2B\u0E49\u0E2D\u0E22\u0E39\u0E48\u0E14\u0E49\u0E32\u0E19\u0E25\u0E48\u0E32\u0E07","distribute.x":"\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19","distribute.y":"\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07","stretch.x":"\u0E22\u0E37\u0E14\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19","stretch.y":"\u0E22\u0E37\u0E14\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07","dialog.save.firsttime":"\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E47\u0E01\u0E15\u0E4C\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48?","dialog.save.again":"\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07\u0E43\u0E19\u0E42\u0E1B\u0E23\u0E40\u0E08\u0E47\u0E01\u0E15\u0E4C\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48?","dialog.cancel":"\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01","dialog.no":"\u0E44\u0E21\u0E48","dialog.yes":"\u0E43\u0E0A\u0E48","enter.file.name":"\u0E01\u0E23\u0E2D\u0E01\u0E0A\u0E37\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"};var od={"style.menu.color":"Renk","style.menu.fill":"Doldur","style.menu.dash":"\xC7izgi","style.menu.size":"Boyut","style.menu.keep.open":"A\xE7\u0131k Tut","style.menu.font":"Yaz\u0131 Tipi","style.menu.align":"Hizala",styles:"Stiller","zoom.in":"Yak\u0131nla\u015Ft\u0131r","zoom.out":"Uzakla\u015Ft\u0131r",to:"","menu.file":"Dosya","menu.edit":"D\xFCzenle","menu.view":"G\xF6r\xFCnt\xFC","menu.preferences":"Tercihler","menu.sign.in":"Giri\u015F Yap","menu.sign.out":"Oturumu Kapat","become.a.sponsor":"Sponsor Ol","zoom.to.selection":"Se\xE7ime Yak\u0131nla\u015Ft\u0131r","zoom.to.fit":"S\u0131\u011Fd\u0131rmak i\xE7in Yak\u0131nla\u015Ft\u0131r","zoom.to":"Yak\u0131nla\u015Ft\u0131r","preferences.dark.mode":"Karanl\u0131k Mod","preferences.focus.mode":"Odak Modu","preferences.debug.mode":"Debug Modu","preferences.show.grid":"Izgaray\u0131 G\xF6ster","preferences.use.cad.selection":"CAD Se\xE7imi Kullan","preferences.keep.stylemenu.open":"Stil Men\xFCs\xFCn\xFC A\xE7\u0131k Tut","preferences.always.show.snaps":"Hiza \xC7izgilerini Hep G\xF6ster","preferences.rotate.handles":"Rotasyon Kontrolc\xFCleri","preferences.binding.handles":"Ba\u011Flama Kontrolc\xFCleri","preferences.clone.handles":"Klon Kontrolc\xFCleri",undo:"Geri Al",redo:"Yinele",cut:"Kes",copy:"Kopyala",paste:"Yap\u0131\u015Ft\u0131r","copy.as":"Olarak Kopyala","export.as":"Olarak D\u0131\u015Far\u0131 Aktar","select.all":"Hepsini Se\xE7","select.none":"Hi\xE7birini Se\xE7me",delete:"Sil","new.project":"Yeni Proje",open:"A\xE7",save:"Kaydet","save.as":"Farkl\u0131 Kaydet","upload.media":"Medya Y\xFCkle","create.page":"Sayfa Olu\u015Ftur","new.page":"Yeni Sayfa","page.name":"Sayfa \u0130smi",duplicate:"Kopya Olu\u015Ftur",cancel:"\u0130ptal","copy.invite.link":"Davet Linkini Kopyala","create.multiplayer.project":"\xC7ok Oyunculu Proje Olu\u015Ftur","copy.multiplayer.project":"\xC7ok Oyunculu Projeye Kopyala",select:"Se\xE7",eraser:"Silgi",draw:"\xC7izim",arrow:"Ok",text:"Yaz\u0131",sticky:"Yap\u0131\u015Fkan",rectangle:"Dikd\xF6rtgen",ellipse:"Elips",triangle:"\xDC\xE7gen",line:"\xC7izgi",rotate:"D\xF6nd\xFCr","lock.aspect.ratio":"En Boy Oran\u0131n\u0131 Kilitle","unlock.aspect.ratio":"En Boy Oran\u0131 Kilidini A\xE7",group:"Grupla",ungroup:"Gruplamay\u0131 Kald\u0131r","move.to.back":"Arkaya Ta\u015F\u0131","move.backward":"En Arkaya Ta\u015F\u0131","move.forward":"En \xD6ne Ta\u015F\u0131","move.to.front":"\xD6ne Ta\u015F\u0131","reset.angle":"A\xE7\u0131y\u0131 S\u0131f\u0131rla",lock:"Kilitle",unlock:"Kilidini A\xE7","move.to.page":"Sayfaya Ta\u015F\u0131","flip.horizontal":"Yatay \xC7evir","flip.vertical":"Dikey \xC7evir",move:"Ta\u015F\u0131","to.front":"\xD6ne",forward:"En \xD6ne",backward:"En Arkaya",back:"Arkaya",language:"Dil"};var rd={"style.menu.color":"\u041A\u043E\u043B\u0456\u0440","style.menu.fill":"\u0417\u0430\u043F\u043E\u0432\u043D\u044E\u0432\u0430\u0442\u0438","style.menu.dash":"\u0428\u0442\u0440\u0438\u0445","style.menu.size":"\u0420\u043E\u0437\u043C\u0456\u0440","style.menu.keep.open":"\u0422\u0440\u0438\u043C\u0430\u0442\u0438 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438\u043C","style.menu.font":"\u0428\u0440\u0438\u0444\u0442","style.menu.align":"\u0412\u0438\u0440\u0456\u0432\u043D\u044F\u0442\u0438",styles:"\u0421\u0442\u0438\u043B\u044C","zoom.in":"\u0417\u0431\u0456\u043B\u044C\u0448\u0438\u0442\u0438","zoom.out":"\u0417\u043C\u0435\u043D\u0448\u0438\u0442\u0438",to:"\u0434\u043E","menu.file":"\u0424\u0430\u0439\u043B","menu.edit":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F","menu.view":"\u0412\u0438\u0433\u043B\u044F\u0434","menu.preferences":"\u041D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F","menu.sign.in":"\u0423\u0432\u0456\u0439\u0442\u0438","menu.sign.out":"\u0412\u0438\u0439\u0442\u0438","become.a.sponsor":"\u0421\u0442\u0430\u0442\u0438 \u0441\u043F\u043E\u043D\u0441\u043E\u0440\u043E\u043C","zoom.to.selection":"\u041D\u0430\u0431\u043B\u0438\u0437\u0438\u0442\u0438 \u0434\u043E \u0432\u0438\u0434\u0456\u043B\u0435\u043D\u043D\u044F","zoom.to.fit":"\u0417\u0431\u0456\u043B\u044C\u0448\u0438\u0442\u0438 \u0437\u0430 \u0440\u043E\u0437\u043C\u0456\u0440\u043E\u043C \u0435\u043A\u0440\u0430\u043D\u0443","zoom.to":"\u041D\u0430\u0431\u043B\u0438\u0437\u0438\u0442\u0438 \u0434\u043E","preferences.dark.mode":"\u0422\u0435\u043C\u043D\u0430 \u0442\u0435\u043C\u0430","preferences.focus.mode":"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u0456\u0441\u0442\u0438\u0447\u043D\u0438\u0439 \u0440\u0435\u0436\u0438\u043C","preferences.debug.mode":"\u0420\u0435\u0436\u0438\u043C \u043D\u0430\u043B\u0430\u0433\u043E\u0434\u0436\u0435\u043D\u043D\u044F","preferences.show.grid":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u0438 \u0441\u0456\u0442\u043A\u0443","preferences.use.cad.selection":"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0432\u0430\u0442\u0438 CAD \u0432\u0438\u0434\u0456\u043B\u0435\u043D\u043D\u044F","preferences.keep.stylemenu.open":"\u0422\u0440\u0438\u043C\u0430\u0442\u0438 \u043C\u0435\u043D\u044E \u0441\u0442\u0438\u043B\u0456\u0432 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438\u043C","preferences.always.show.snaps":"\u0417\u0430\u0432\u0436\u0434\u0438 \u043F\u043E\u043A\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043F\u0440\u0438\u0432'\u044F\u0437\u043A\u0438","preferences.rotate.handles":"\u0420\u0443\u0447\u043A\u0438 \u043E\u0431\u0435\u0440\u0442\u0430\u043D\u043D\u044F","preferences.binding.handles":"\u0420\u0443\u0447\u043A\u0438 \u043F\u0440\u0438\u0432'\u044F\u0437\u043A\u0438","preferences.clone.handles":"\u0420\u0443\u0447\u043A\u0438 \u043A\u043B\u043E\u043D\u0443\u0432\u0430\u043D\u043D\u044F",undo:"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438",redo:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438",cut:"\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438",copy:"\u0421\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438",paste:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438","copy.as":"\u0421\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u044F\u043A","export.as":"\u0415\u043A\u0441\u043F\u043E\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u044F\u043A","select.all":"\u041E\u0431\u0440\u0430\u0442\u0438 \u0432\u0441\u0435","select.none":"\u0417\u043D\u044F\u0442\u0438 \u0432\u0438\u0434\u0456\u043B\u0435\u043D\u043D\u044F",delete:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438","new.project":"\u041D\u043E\u0432\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442",open:"\u0412\u0456\u0434\u043A\u0440\u0438\u0442\u0438",save:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438","save.as":"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u044F\u043A","upload.media":"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u043C\u0435\u0434\u0456\u0430","create.page":"\u0421\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443","new.page":"\u041D\u043E\u0432\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0430","page.name":"\u041D\u0430\u0437\u0432\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438",duplicate:"\u0414\u0443\u0431\u043B\u044E\u0432\u0430\u0442\u0438",cancel:"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438","copy.invite.link":"\u0421\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044F","create.multiplayer.project":"\u0421\u0442\u0432\u043E\u0440\u0438\u0442\u0438 \u0431\u0430\u0433\u0430\u0442\u043E\u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044C\u043A\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442","copy.multiplayer.project":"\u0421\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u0432 \u0431\u0430\u0433\u0430\u0442\u043E\u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044C\u043A\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442",select:"\u0412\u0438\u0431\u0438\u0440\u0430\u0442\u0438",eraser:"\u041B\u0430\u0441\u0442\u0438\u043A",draw:"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438",arrow:"\u0421\u0442\u0440\u0456\u043B\u043A\u0430",text:"\u0422\u0435\u043A\u0441\u0442",sticky:"\u041D\u043E\u0442\u0430\u0442\u043A\u0430",rectangle:"\u041F\u0440\u044F\u043C\u043E\u043A\u0443\u0442\u043D\u0438\u043A",ellipse:"\u0415\u043B\u0456\u043F\u0441",triangle:"\u0422\u0440\u0438\u043A\u0443\u0442\u043D\u0438\u043A",line:" \u041B\u0456\u043D\u0456\u044F",rotate:"\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u0438","lock.aspect.ratio":"\u0417\u0430\u0431\u043B\u043E\u043A\u0443\u0432\u0430\u0442\u0438 \u0441\u043F\u0456\u0432\u0432\u0456\u0434\u043D\u043E\u0448\u0435\u043D\u043D\u044F \u0441\u0442\u043E\u0440\u0456\u043D","unlock.aspect.ratio":" \u0420\u043E\u0437\u0431\u043B\u043E\u043A\u0443\u0432\u0430\u0442\u0438 \u0441\u043F\u0456\u0432\u0432\u0456\u0434\u043D\u043E\u0448\u0435\u043D\u043D\u044F \u0441\u0442\u043E\u0440\u0456\u043D",group:"\u0417\u0433\u0440\u0443\u043F\u0443\u0432\u0430\u0442\u0438",ungroup:" \u0420\u043E\u0437\u0433\u0440\u0443\u043F\u0443\u0432\u0430\u0442\u0438","move.to.back":"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u043D\u0430\u0437\u0430\u0434","move.backward":"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u043D\u0430 \u0437\u0430\u0434\u043D\u0456\u0439 \u043F\u043B\u0430\u043D","move.forward":"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u0432\u043F\u0435\u0440\u0435\u0434","move.to.front":"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u043D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0456\u0439 \u043F\u043B\u0430\u043D","reset.angle":"\u0421\u043A\u0438\u0434\u0430\u043D\u043D\u044F \u043A\u0443\u0442\u0430",lock:"\u0411\u043B\u043E\u043A\u0443\u0432\u0430\u043D\u043D\u044F",unlock:" \u0420\u043E\u0437\u0431\u043B\u043E\u043A\u0443\u0432\u0430\u043D\u043D\u044F","move.to.page":"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0443","flip.horizontal":"\u041F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0443\u0442\u0438 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E","flip.vertical":"\u041F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0443\u0442\u0438 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E",move:"\u041F\u0435\u0440\u0435\u043C\u0456\u0441\u0442\u0438\u0442\u0438","to.front":"\u041D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0456\u0439 \u043F\u043B\u0430\u043D",forward:" \u0412\u043F\u0435\u0440\u0435\u0434",backward:"\u041D\u0430 \u0437\u0430\u0434\u043D\u0456\u0439 \u043F\u043B\u0430\u043D",back:"\u041D\u0430\u0437\u0430\u0434",language:"\u041C\u043E\u0432\u0430"};var id={"style.menu.color":"\u989C\u8272","style.menu.fill":"\u586B\u5145","style.menu.dash":"\u8FB9\u6846","style.menu.size":"\u5C3A\u5BF8","style.menu.keep.open":"\u4FDD\u6301\u5E38\u5F00","style.menu.font":"\u5B57\u4F53","style.menu.align":"\u5BF9\u9F50",styles:"\u6837\u5F0F","zoom.in":"\u653E\u5927","zoom.out":"\u7F29\u5C0F",to:"\u7F29\u653E\u81F3","menu.tools":"\u5DE5\u5177","menu.transform":"\u8F6C\u6362","menu.file":"\u6587\u4EF6","menu.edit":"\u7F16\u8F91","menu.view":"\u89C6\u56FE","menu.preferences":"\u504F\u597D","menu.sign.in":"\u767B\u5F55","menu.sign.out":"\u767B\u51FA",search:"\u641C\u7D22","become.a.sponsor":"\u6210\u4E3A\u8D5E\u52A9\u8005","zoom.to.selection":"\u7F29\u653E\u9009\u4E2D","zoom.to.fit":"\u81EA\u9002\u5E94\u7F29\u653E","zoom.to":"\u7F29\u653E\u81F3","zoom.to.content":"\u7F29\u653E\u81F3\u5185\u5BB9","preferences.dark.mode":"\u6697\u9ED1\u6A21\u5F0F","preferences.focus.mode":"\u4E13\u6CE8\u6A21\u5F0F","preferences.debug.mode":"\u8C03\u8BD5\u6A21\u5F0F","preferences.show.grid":"\u663E\u793A\u7F51\u683C","preferences.use.cad.selection":"\u4F7F\u7528 CAD \u9009\u62E9","preferences.keep.stylemenu.open":"\u4FDD\u6301\u6837\u5F0F\u83DC\u5355\u5E38\u5F00","preferences.always.show.snaps":"\u603B\u662F\u5C55\u793A\u5BF9\u9F50\u7EBF","preferences.rotate.handles":"\u65CB\u8F6C\u624B\u67C4","preferences.binding.handles":"\u6346\u7ED1\u624B\u67C4","preferences.clone.handles":"\u514B\u9686\u624B\u67C4",undo:"\u64A4\u9500",redo:"\u91CD\u505A",cut:"\u526A\u5207",copy:"\u590D\u5236",paste:"\u7C98\u8D34","copy.as":"\u590D\u5236\u4E3A","export.as":"\u5BFC\u51FA\u4E3A","select.all":"\u9009\u4E2D\u5168\u90E8","select.none":"\u53D6\u6D88\u9009\u4E2D",delete:"\u5220\u9664","new.project":"\u65B0\u9879\u76EE",open:"\u6253\u5F00",save:"\u4FDD\u5B58","save.as":"\u4FDD\u5B58\u4E3A","upload.media":"\u4E0A\u4F20\u5A92\u4F53\u6587\u4EF6","create.page":"\u521B\u5EFA\u9875\u9762","new.page":"\u65B0\u9875\u9762","page.name":"\u9875\u9762\u540D\u79F0",duplicate:"\u590D\u5236",cancel:"\u53D6\u6D88","copy.invite.link":"\u590D\u5236\u9080\u8BF7\u94FE\u63A5","create.multiplayer.project":"\u521B\u5EFA\u591A\u4EBA\u9879\u76EE","copy.multiplayer.project":"\u590D\u5236\u5230\u591A\u4EBA\u9879\u76EE",select:"\u9009\u62E9",eraser:"\u6A61\u76AE",draw:"\u753B\u7B14",arrow:"\u7BAD\u5934",text:"\u6587\u672C",sticky:"\u4FBF\u5229\u8D34",rectangle:"\u77E9\u5F62",ellipse:"\u692D\u5706\u5F62",triangle:"\u4E09\u89D2\u5F62",line:"\u76F4\u7EBF",rotate:"\u65CB\u8F6C","lock.aspect.ratio":"\u9501\u5B9A\u5BBD\u9AD8\u6BD4","unlock.aspect.ratio":"\u89E3\u9501\u5BBD\u9AD8\u6BD4",group:"\u5206\u7EC4",ungroup:"\u53D6\u6D88\u5206\u7EC4","move.to.back":"\u7F6E\u5E95","move.backward":"\u4E0B\u79FB\u4E00\u5C42","move.forward":"\u4E0A\u79FB\u4E00\u5C42","move.to.front":"\u7F6E\u9876","reset.angle":"\u91CD\u7F6E\u65CB\u8F6C\u89D2\u5EA6",lock:"\u9501\u5B9A",unlock:"\u89E3\u9501","move.to.page":"\u79FB\u52A8\u5230\u9875\u9762","flip.horizontal":"\u6C34\u5E73\u7FFB\u8F6C","flip.vertical":"\u5782\u76F4\u7FFB\u8F6C",move:"\u79FB\u52A8","to.front":"\u7F6E\u9876",forward:"\u4E0A\u4E00\u5C42",backward:"\u4E0B\u4E00\u5C42",back:"\u7F6E\u5E95",language:"\u8BED\u8A00","keyboard.shortcuts":"\u952E\u76D8\u5FEB\u6377\u952E","translation.link":"\u4E86\u89E3\u66F4\u591A",page:"\u9875\u9762","dock.position":"\u951A\u70B9\u4F4D\u7F6E",bottom:"\u4E0B\u9762",left:"\u5DE6\u9762",right:"\u53F3\u9762",top:"\u4E0A\u9762","export.background":"\u5BFC\u51FA\u80CC\u666F\u8272",transparent:"\u900F\u660E",auto:"\u81EA\u52A8",light:"\u660E\u4EAE",dark:"\u6697\u9ED1","copy.readonly.link":"\u590D\u5236\u53EA\u8BFB\u94FE\u63A5",image:"\u56FE\u7247","align.distribute":"\u5BF9\u9F50 / \u5206\u6563","dialog.save.firsttime":"\u60A8\u662F\u5426\u60F3\u4FDD\u5B58\u5F53\u524D\u7684\u9879\u76EE\uFF1F","dialog.save.again":"\u60A8\u662F\u5426\u60F3\u4FDD\u5B58\u5BF9\u5F53\u524D\u9879\u76EE\u7684\u66F4\u6539\uFF1F","dialog.cancel":"\u53D6\u6D88","dialog.no":"\u5426","dialog.yes":"\u662F"};var sd={"style.menu.color":"\u984F\u8272","style.menu.fill":"\u586B\u5145","style.menu.dash":"\u865B\u7DDA","style.menu.size":"\u5927\u5C0F","style.menu.keep.open":"\u4FDD\u6301\u958B\u555F","style.menu.font":"\u5B57\u578B","style.menu.align":"\u5C0D\u9F4A",styles:"\u6A23\u5F0F","zoom.in":"\u653E\u5927","zoom.out":"\u7E2E\u5C0F",to:"\u81F3","menu.file":"\u6A94\u6848","menu.edit":"\u7DE8\u8F2F","menu.view":"\u6AA2\u8996","menu.preferences":"\u9078\u9805","menu.sign.in":"\u767B\u5165","menu.sign.out":"\u767B\u51FA","become.a.sponsor":"\u6210\u70BA\u8D0A\u52A9\u8005","zoom.to.selection":"\u7E2E\u653E\u81F3\u9078\u53D6\u7BC4\u570D","zoom.to.fit":"\u7E2E\u653E\u81F3\u9069\u7576\u5927\u5C0F","zoom.to":"\u7E2E\u653E\u81F3","preferences.dark.mode":"\u6DF1\u8272\u6A21\u5F0F","preferences.focus.mode":"\u5C08\u6CE8\u6A21\u5F0F","preferences.debug.mode":"\u9664\u932F\u6A21\u5F0F","preferences.show.grid":"\u986F\u793A\u7DB2\u683C","preferences.use.cad.selection":"\u4F7F\u7528 CAD \u9078\u53D6","preferences.keep.stylemenu.open":"\u6A23\u5F0F\u9078\u55AE\u4FDD\u6301\u958B\u555F","preferences.always.show.snaps":"\u6C38\u9060\u986F\u793A\u5C0D\u9F4A\u7DDA","preferences.rotate.handles":"\u65CB\u8F49\u63A7\u9EDE","preferences.binding.handles":"\u7D81\u5B9A\u63A7\u9EDE","preferences.clone.handles":"\u8907\u88FD\u63A7\u9EDE",undo:"\u5FA9\u539F",redo:"\u53D6\u6D88\u5FA9\u539F",cut:"\u526A\u4E0B",copy:"\u8907\u88FD",paste:"\u8CBC\u4E0A","copy.as":"\u8907\u88FD\u6210","export.as":"\u532F\u51FA\u6210","select.all":"\u5168\u9078","select.none":"\u53D6\u6D88\u9078\u53D6",delete:"\u522A\u9664","new.project":"\u65B0\u5C08\u6848",open:"\u958B\u555F",save:"\u5132\u5B58","save.as":"\u53E6\u5B58\u70BA","upload.media":"\u4E0A\u50B3\u5A92\u9AD4","create.page":"\u5EFA\u7ACB\u9801\u9762","new.page":"\u65B0\u9801\u9762","page.name":"\u9801\u9762\u540D\u7A31",duplicate:"\u8907\u88FD",cancel:"\u53D6\u6D88","copy.invite.link":"\u8907\u88FD\u9080\u8ACB\u9023\u7D50","copy.readonly.link":"\u8907\u88FD\u552F\u8B80\u9023\u7D50","create.multiplayer.project":"\u5EFA\u7ACB\u591A\u4EBA\u5C08\u6848","copy.multiplayer.project":"\u8907\u88FD\u81F3\u591A\u4EBA\u5C08\u6848",select:"\u9078\u53D6",eraser:"\u6A61\u76AE\u64E6",draw:"\u624B\u7E6A",arrow:"\u7BAD\u982D",text:"\u6587\u5B57",sticky:"\u4FBF\u5229\u8CBC",rectangle:"\u9577\u65B9\u5F62",ellipse:"\u6A62\u5713\u5F62",triangle:"\u4E09\u89D2\u5F62",line:"\u76F4\u7DDA",rotate:"\u65CB\u8F49","lock.aspect.ratio":"\u9396\u5B9A\u9577\u5BEC\u6BD4","unlock.aspect.ratio":"\u89E3\u9396\u9577\u5BEC\u6BD4",group:"\u7D44\u6210\u7FA4\u7D44",ungroup:"\u53D6\u6D88\u7FA4\u7D44","move.to.back":"\u79FB\u5230\u6700\u4E0B\u5C64","move.backward":"\u4E0B\u79FB\u4E00\u5C64","move.forward":"\u4E0A\u79FB\u4E00\u5C64","move.to.front":"\u79FB\u5230\u6700\u4E0A\u5C64","reset.angle":"\u91CD\u8A2D\u89D2\u5EA6",lock:"\u9396\u5B9A",unlock:"\u89E3\u9396","move.to.page":"\u79FB\u81F3\u9801\u9762","flip.horizontal":"\u6C34\u5E73\u7FFB\u8F49","flip.vertical":"\u5782\u76F4\u7FFB\u8F49",move:"\u79FB\u52D5","to.front":"\u5230\u6700\u4E0A\u5C64",forward:"\u5230\u4E0A\u4E00\u5C64",backward:"\u5230\u4E0B\u4E00\u5C64",back:"\u5230\u6700\u4E0B\u5C64",language:"\u8A9E\u8A00","translation.link":"\u4E86\u89E3\u8A73\u60C5","dock.position":"\u5DE5\u5177\u5217\u4F4D\u7F6E",bottom:"\u4E0B\u65B9",left:"\u5DE6\u5074",right:"\u53F3\u5074",top:"\u4E0A\u65B9",page:"\u9801\u9762"};var ad=[{locale:"ar",label:"\u0639\u0631\u0628\u064A",messages:Ml},{locale:"da",label:"Danish",messages:Ll},{locale:"de",label:"Deutsch",messages:Al},{locale:"en",label:"English",messages:Vl},{locale:"es",label:"Espa\xF1ol",messages:Hl},{locale:"fa",label:"\u0641\u0627\u0631\u0633\u06CC",messages:zl},{locale:"fr",label:"Fran\xE7ais",messages:Fl},{locale:"gl",label:"Galego",messages:Ol},{locale:"he",label:"\u05E2\u05D1\u05E8\u05D9\u05EA",messages:$l},{locale:"it",label:"Italiano",messages:Gl},{locale:"ja",label:"\u65E5\u672C\u8A9E",messages:jl},{locale:"ko-kr",label:"\uD55C\uAD6D\uC5B4",messages:Wl},{locale:"my",label:"\u1019\u103C\u1014\u103A\u1019\u102C\u1005\u102C",messages:Kl},{locale:"nb-no",label:"Norwegian Bokm\xE5l",messages:_l},{locale:"ne",label:"\u0928\u0947\u092A\u093E\u0932\u0940",messages:Yl},{locale:"nn-no",label:"Norwegian Nynorsk",messages:Xl},{locale:"pl",label:"Polski",messages:Zl},{locale:"pt",label:"Portugu\xEAs - Europeu",messages:Jl},{locale:"pt-br",label:"Portugu\xEAs - Brasil",messages:ql},{locale:"ru",label:"Russian",messages:Ql},{locale:"sv",label:"Svenska",messages:ed},{locale:"te",label:"\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41",messages:td},{locale:"tr",label:"T\xFCrk\xE7e",messages:od},{locale:"uk",label:"Ukrainian",messages:rd},{locale:"zh-ch",label:"\u7B80\u4F53\u4E2D\u6587",messages:id},{locale:"zh-tw",label:"\u7E41\u9AD4\u4E2D\u6587 (\u53F0\u7063)",messages:sd},{locale:"th",label:"\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22",messages:nd},{locale:"ku",label:"\u06A9\u0648\u0631\u062F\u06CC",messages:Nl}];ad.sort((i,o)=>i.locale<o.locale?-1:1);function ld(i){var e;let o=ad.find(t=>t.locale===i);return{locale:i,label:(e=o==null?void 0:o.label)!=null?e:i,messages:S(S({},Ul),o==null?void 0:o.messages)}}function cd(i){return dd.useMemo(()=>{let o=typeof navigator!="undefined"?navigator.language.split(/[-_]/)[0]:"en";return ld(i!=null?i:o)},[i])}import*as ai from"react";var Os=ai.createContext({}),ei=()=>{let i=ai.useContext(Os);if(!i)throw new Error("useCtx must be inside a Provider with a value");return i};import{jsx as li,jsxs as Rh}from"react/jsx-runtime";var Tt=Sr.forwardRef((h,u)=>{var g=h,{onSelect:i,onClick:o,onDoubleClick:e,variant:t,children:n,isToolLocked:r=!1,disabled:s=!1,isActive:l=!1,onKeyDown:a,id:c}=g,p=Be(g,["onSelect","onClick","onDoubleClick","variant","children","isToolLocked","disabled","isActive","onKeyDown","id"]);return Rh(Ih,w(S({ref:u,isActive:l,variant:t,onClick:o,disabled:s,onPointerDown:i,onDoubleClick:e,onKeyDown:a,bp:nn,id:c},p),{children:[li(sn,{children:n}),r&&li(Ph,{})]}))});function $s(r){var s=r,{label:i,kbd:o,variant:e,isLocked:t}=s,n=Be(s,["label","kbd","variant","isLocked"]);let l=N(),a=Sr.useCallback(()=>{l.toggleToolLock()},[]),c=Sr.useCallback(p=>{p.key===" "&&l.isForcePanning&&p.preventDefault()},[]);return li(Jr,{label:i[0].toUpperCase()+i.slice(1),kbd:o,children:li(Tt,w(S({},n),{variant:e,isToolLocked:t&&n.isActive,onDoubleClick:a,onKeyDown:c,"aria-label":i[0].toUpperCase()+i.slice(1)}))})}var sn=P("div",{position:"relative",height:"100%",width:"100%",backgroundColor:"$panel",borderRadius:"$2",margin:"0",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"$ui",color:"inherit",userSelect:"none",WebkitUserSelect:"none",boxSizing:"border-box",border:"1px solid transparent","-webkit-tap-highlight-color":"transparent","tap-highlight-color":"transparent"}),Ih=P("button",{position:"relative",color:"$text",fontSize:"$0",background:"none",margin:"0",padding:"$2",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",cursor:"pointer",pointerEvents:"all",height:"40px",width:"40px",border:"1px solid $panel","-webkit-tap-highlight-color":"transparent","tap-highlight-color":"transparent",[`&:disabled ${sn}`]:{opacity:.618},variants:{variant:{primary:{marginTop:"0"},icon:{[`& ${sn}`]:{display:"grid","& > *":{gridRow:1,gridColumn:1}}},text:{width:"auto",[`& ${sn}`]:{fontSize:"$1",padding:"0 $3",gap:"$3"}},circle:{padding:0,height:32,width:32,border:"none",[`& ${sn}`]:{border:"1px solid $panelContrast",borderRadius:"100%",boxShadow:"$panel"},[`& ${sn} > svg`]:{width:14,height:14}}},isActive:{true:{},false:{}},bp:{mobile:{padding:0},small:{}}},compoundVariants:[{variant:"primary",bp:"mobile",css:{height:40,width:36,[`& ${sn} > svg`]:{width:16,height:16}}},{variant:"primary",bp:"small",css:{height:"40px",width:"40px",[`& ${sn} > svg`]:{width:20,height:20}}},{isActive:!0,css:{[`${sn}`]:{backgroundColor:"$selected",color:"$selectedContrast"}}},{isActive:!1,bp:"small",css:{[`&:hover:not(:disabled) ${sn}`]:{backgroundColor:"$hover"},[`&:focus:not(:disabled) ${sn}`]:{backgroundColor:"$hover"}}}]}),Ph=P("div",{position:"absolute",width:10,height:10,backgroundColor:"$selected",borderRadius:"100%",bottom:-2,border:"2px solid $panel",zIndex:100});import{jsx as an,jsxs as Ah}from"react/jsx-runtime";var Gs=["rectangle","ellipse","triangle","line"],pd={["rectangle"]:an(Eh,{}),["ellipse"]:an(Dh,{}),["triangle"]:an(Bh,{}),["line"]:an(Pl,{})},Lh=i=>i.settings.dockPosition,ud=Sn.memo(function({activeTool:o,isToolLocked:e}){let t=N(),n=Mh(),r=t.useStore(Lh),[s,l]=Sn.useState("rectangle");Sn.useEffect(()=>{Gs.includes(o)&&s!==o&&l(o)},[o]);let a=Sn.useCallback(()=>{t.selectTool(s)},[o,t]),c=Sn.useCallback(()=>{t.toggleToolLock()},[t]),p=Sn.useCallback(m=>{m.key===" "&&t.shiftKey&&m.preventDefault()},[]),u=Gs.includes(o),h=r==="bottom"||r==="top"?"top":r,g=r==="bottom"||r==="top"?"row":"column";return Ah(Xn.Root,{dir:"ltr",onOpenChange:a,children:[an(Xn.Trigger,{dir:"ltr",asChild:!0,id:"TD-PrimaryTools-Shapes",children:an(Tt,{disabled:u&&t.shiftKey,variant:"primary",onDoubleClick:c,isToolLocked:u&&e,isActive:u,onKeyDown:p,"aria-label":n.formatMessage({id:"shapes"}),children:pd[s]})}),an(Xn.Content,{asChild:!0,side:h,sideOffset:12,children:an(mr,{side:"center",style:{flexDirection:g},children:Gs.map((m,f)=>an(Jr,{label:n.formatMessage({id:m}),kbd:(4+f).toString(),id:`TD-PrimaryTools-Shapes-${m}`,children:an(Xn.Item,{asChild:!0,children:an(Tt,{"aria-label":n.formatMessage({id:m}),variant:"primary",onClick:()=>{t.selectTool(m),l(m)},children:pd[m]})})},m))})})]})});import{jsx as ye,jsxs as hd}from"react/jsx-runtime";var jh=i=>i.appState.activeTool,Wh=i=>i.appState.isToolLocked,Nh=i=>i.settings.canvasMode,md=zt.memo(function(){let o=N(),e=Gh(),t=o.useStore(jh),n=o.useStore(Wh),r=o.useStore(Nh),s=zt.useCallback(()=>o.selectTool("select"),[o]),l=zt.useCallback(()=>o.selectTool("erase"),[o]),a=zt.useCallback(()=>o.selectTool("draw"),[o]),c=zt.useCallback(()=>o.selectTool("pen"),[o]),p=zt.useCallback(()=>o.selectTool("arrow"),[o]),u=zt.useCallback(()=>o.selectTool("text"),[o]),h=zt.useCallback(()=>o.selectTool("sticky"),[o]),g=zt.useCallback(()=>z(this,null,function*(){return o.openAsset()}),[o]),m=zt.useCallback(()=>o.toggleCanvasMode(),[o]),f=zt.useCallback(v=>{v.stopPropagation()},[]);return ye(Uh,{onPointerDown:f,children:hd(Kh,{children:[ye(Mn,{onClick:s,isActive:t==="select",title:e.formatMessage({id:"select"}),children:ye(Hh,{})}),ye(js,{}),ye(Mn,{onClick:a,isActive:t==="draw",title:e.formatMessage({id:"draw"}),children:ye(Fh,{})}),ye(Mn,{onClick:c,isActive:t==="pen",title:"Pen",children:ye(Oh,{})}),ye(Mn,{onClick:l,isActive:t==="erase",title:e.formatMessage({id:"eraser"}),children:ye(wl,{})}),ye(js,{}),ye(_h,{children:ye(ud,{activeTool:t,isToolLocked:n})}),ye(Mn,{onClick:p,isActive:t==="arrow",title:e.formatMessage({id:"arrow"}),children:ye(Vh,{})}),ye(Mn,{onClick:u,isActive:t==="text",title:e.formatMessage({id:"text"}),children:ye($h,{})}),ye(Mn,{onClick:h,isActive:t==="sticky",title:"Sticky Note",children:hd("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:[ye("rect",{x:"2",y:"2",width:"11",height:"11",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),ye("line",{x1:"5",y1:"6",x2:"10",y2:"6",stroke:"currentColor",strokeWidth:"1"}),ye("line",{x1:"5",y1:"9",x2:"8",y2:"9",stroke:"currentColor",strokeWidth:"1"})]})}),ye(Mn,{onClick:g,title:e.formatMessage({id:"image"}),children:ye(zh,{})}),ye(js,{}),ye(Mn,{onClick:m,isActive:r==="straight",title:r==="freehand"?"Straight mode":"Freehand mode",children:r==="freehand"?ye("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:ye("path",{d:"M2 12C4 8 6 4 8 6C10 8 11 3 13 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"})}):ye("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:ye("path",{d:"M2 12L7.5 3L13 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})})})]})})}),Uh=P("div",{position:"absolute",bottom:"16px",left:"50%",transform:"translateX(-50%)",zIndex:300,pointerEvents:"all"}),Kh=P("div",{display:"flex",alignItems:"center",gap:"2px",padding:"6px 8px",background:"$panel",borderRadius:"$pill",boxShadow:"0 2px 16px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.06)",backdropFilter:"blur(12px)"}),Mn=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",borderRadius:"$2",color:"$textSecondary",cursor:"pointer",transition:"all 0.12s ease",flexShrink:0,"& svg":{width:"16px",height:"16px"},"&:hover":{background:"$hover",color:"$text"},variants:{isActive:{true:{background:"$accent",color:"white","&:hover":{background:"$accent",color:"white"}}}}}),js=P("div",{width:"1px",height:"20px",background:"$separator",margin:"0 4px",flexShrink:0,opacity:.5}),_h=P("div",{display:"flex","& button":{width:"36px",height:"36px",padding:0,borderRadius:"$2",border:"none"},'& [class*="StyledToolButtonInner"]':{borderRadius:"$2",background:"transparent"}});import*as Ce from"@radix-ui/react-context-menu";import{AlignBottomIcon as Qh,AlignCenterHorizontallyIcon as em,AlignCenterVerticallyIcon as tm,AlignLeftIcon as nm,AlignRightIcon as om,AlignTopIcon as rm,SpaceEvenlyHorizontallyIcon as im,SpaceEvenlyVerticallyIcon as sm,StretchHorizontallyIcon as am,StretchVerticallyIcon as lm}from"@radix-ui/react-icons";import*as de from"react";import{FormattedMessage as We,useIntl as dm}from"react-intl";var ve=P("hr",{height:0,paddingTop:1,width:"calc(100%+8px)",backgroundColor:"$hover",border:"none",margin:"$2 -4px"});var Ln=P("div",{position:"relative",overflow:"hidden",userSelect:"none",WebkitUserSelect:"none",display:"flex",flexDirection:"column",zIndex:99997,minWidth:180,pointerEvents:"all",backgroundColor:"$panel",border:"1px solid $panelContrast",boxShadow:"$panel",padding:"$2 $2",borderRadius:"$3",font:"$ui",maxHeight:"100vh",overflowY:"auto",overflowX:"hidden","&::webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none",variants:{size:{small:{minWidth:72}},overflow:{true:{maxHeight:"60vh"}}}});import{ItemIndicator as Yh}from"@radix-ui/react-dropdown-menu";import{CheckIcon as Xh,ChevronRightIcon as Zh}from"@radix-ui/react-icons";import*as gd from"react";var Rt=P("div",{height:"100%",borderRadius:"4px",marginRight:"1px",width:"fit-content",display:"grid",alignItems:"center",justifyContent:"center",outline:"none",border:"none",pointerEvents:"all",cursor:"pointer",color:"currentColor","& svg":{height:16,width:16,strokeWidth:1},"& > *":{gridRow:1,gridColumn:1}});import{jsx as fo,jsxs as Jh}from"react/jsx-runtime";var Je=gd.forwardRef((u,p)=>{var h=u,{onClick:i,isActive:o=!1,isWarning:e=!1,hasIndicator:t=!1,hasArrow:n=!1,disabled:r=!1,variant:s,kbd:l,children:a}=h,c=Be(h,["onClick","isActive","isWarning","hasIndicator","hasArrow","disabled","variant","kbd","children"]);return fo(qh,w(S({ref:p,bp:nn,isWarning:e,isActive:o,disabled:r,onClick:i,variant:s},c),{children:Jh(fd,{children:[a,l?fo(qr,{variant:"menu",children:l}):void 0,t&&fo(Yh,{dir:"ltr",children:fo(Rt,{children:fo(Xh,{})})}),n&&fo(Rt,{children:fo(Zh,{})})]})}))}),fd=P("div",{height:"100%",width:"100%",backgroundColor:"$panel",borderRadius:"$2",display:"flex",gap:"$1",flexDirection:"row",alignItems:"center",padding:"0 $3",justifyContent:"space-between",border:"1px solid transparent","& svg":{position:"relative",stroke:"$overlay",strokeWidth:1,zIndex:1},[`& > ${Rt}`]:{paddingLeft:"$3"}}),qh=P("button",{position:"relative",width:"100%",background:"none",border:"none",cursor:"pointer",height:32,minHeight:32,outline:"none",color:"$text",fontFamily:"$ui",fontWeight:400,fontSize:"$1",borderRadius:4,userSelect:"none",WebkitUserSelect:"none",margin:0,padding:"0 0","&[data-disabled]":{opacity:.3},"&:disabled":{opacity:.3},[`&:focus:not(:disabled) ${fd}`]:{backgroundColor:"$hover"},"& a":{textDecoration:"none",color:"$text"},variants:{bp:{mobile:{},small:{}},variant:{styleMenu:{margin:"$1 0 $1 0"},wide:{gridColumn:"1 / span 4"}},size:{icon:{padding:"4px ",width:"auto"}},isWarning:{true:{color:"$warn"}},isActive:{true:{backgroundColor:"$hover"},false:{}}}});import{Fragment as ci,jsx as V,jsxs as xt}from"react/jsx-runtime";var cm=i=>i.document.pageStates[i.appState.currentPageId].selectedIds.length,pm=i=>i.settings.isDebugMode,um=i=>i.document.pageStates[i.appState.currentPageId].selectedIds.some(o=>i.document.pages[i.appState.currentPageId].shapes[o].children!==void 0),hm=i=>i.stopPropagation(),mm=({onBlur:i,children:o})=>{let e=rn();return xt(Ce.Root,{dir:"ltr",children:[V(Ce.Trigger,{dir:"ltr",children:o}),V(Ce.Portal,{container:e.current,children:V(Ce.Content,{onEscapeKeyDown:hm,tabIndex:-1,onBlur:i,asChild:!0,children:V(Ln,{id:"TD-ContextMenu",children:V(gm,{})})})})]})},gm=de.memo(function(){let o=N(),e=dm(),t=o.useStore(cm),n=o.useStore(pm),r=o.useStore(um),s=de.useCallback(()=>{o.flipHorizontal()},[o]),l=de.useCallback(()=>{o.flipVertical()},[o]),a=de.useCallback(()=>{o.duplicate()},[o]),c=de.useCallback(()=>{o.toggleLocked()},[o]),p=de.useCallback(()=>{o.group()},[o]),u=de.useCallback(()=>{o.moveToBack()},[o]),h=de.useCallback(()=>{o.moveBackward()},[o]),g=de.useCallback(()=>{o.moveForward()},[o]),m=de.useCallback(()=>{o.moveToFront()},[o]),f=de.useCallback(()=>{o.delete()},[o]),v=de.useCallback(()=>{o.cut()},[o]),b=de.useCallback(()=>{o.copy()},[o]),T=de.useCallback(()=>{o.paste()},[o]),y=de.useCallback(()=>{o.copyImage("svg",{scale:1,quality:1,transparentBackground:!1})},[o]),x=de.useCallback(()=>{o.copyImage("png",{scale:2,quality:1,transparentBackground:!0})},[o]),I=de.useCallback(()=>{o.undo()},[o]),k=de.useCallback(()=>{o.redo()},[o]),R=de.useCallback(()=>z(this,null,function*(){o.exportImage("png",{scale:2,quality:1})}),[o]),C=de.useCallback(()=>z(this,null,function*(){o.exportImage("jpeg",{scale:2,quality:1})}),[o]),E=de.useCallback(()=>z(this,null,function*(){o.exportImage("webp",{scale:2,quality:1})}),[o]),M=de.useCallback(()=>z(this,null,function*(){o.exportImage("svg",{scale:1,quality:1})}),[o]),L=de.useCallback(()=>z(this,null,function*(){o.copyJson()}),[o]),A=de.useCallback(()=>z(this,null,function*(){o.exportJson()}),[o]),K=de.useCallback(()=>z(this,null,function*(){o.convertToImage()}),[o]),re=t>0,F=t>1,ee=t>2,pe=t===1?o.getShape(o.selectedIds[0],o.currentPageId):null,he=(pe==null?void 0:pe.type)==="reactComponent";return V(ci,{children:re?xt(ci,{children:[V(me,{onClick:a,kbd:"#D",id:"TD-ContextMenu-Duplicate",children:V(We,{id:"duplicate"})}),V(me,{onClick:s,kbd:"\u21E7H",id:"TD-ContextMenu-Flip_Horizontal",children:V(We,{id:"flip.horizontal"})}),V(me,{onClick:l,kbd:"\u21E7V",id:"TD-ContextMenu-Flip_Vertical",children:V(We,{id:"flip.vertical"})}),xt(me,{onClick:c,kbd:"#\u21E7L",id:"TD-ContextMenu- Lock_Unlock",children:[V(We,{id:"lock"})," / ",V(We,{id:"unlock"})]}),(F||r)&&V(ve,{}),F&&V(me,{onClick:p,kbd:"#G",id:"TD-ContextMenu-Group",children:V(We,{id:"group"})}),r&&V(me,{onClick:p,kbd:"#G",id:"TD-ContextMenu-Ungroup",children:V(We,{id:"ungroup"})}),V(ve,{}),xt(di,{label:e.formatMessage({id:"move"}),id:"TD-ContextMenu-Move",children:[V(me,{onClick:m,kbd:"\u21E7]",id:"TD-ContextMenu-Move-To_Front",children:V(We,{id:"to.front"})}),V(me,{onClick:g,kbd:"]",id:"TD-ContextMenu-Move-Forward",children:V(We,{id:"forward"})}),V(me,{onClick:h,kbd:"[",id:"TD-ContextMenu-Move-Backward",children:V(We,{id:"backward"})}),V(me,{onClick:u,kbd:"\u21E7[",id:"TD-ContextMenu-Move-To_Back",children:V(We,{id:"back"})})]}),V(vm,{}),F&&V(fm,{hasTwoOrMore:F,hasThreeOrMore:ee}),V(ve,{}),V(me,{onClick:v,kbd:"#X",id:"TD-ContextMenu-Cut",children:V(We,{id:"cut"})}),V(me,{onClick:b,kbd:"#C",id:"TD-ContextMenu-Copy",children:V(We,{id:"copy"})}),V(me,{onClick:T,kbd:"#V",id:"TD-ContextMenu-Paste",children:V(We,{id:"paste"})}),V(ve,{}),xt(di,{label:`${e.formatMessage({id:"copy.as"})}...`,size:"small",id:"TD-ContextMenu-Copy-As",children:[V(me,{onClick:y,id:"TD-ContextMenu-Copy-as-SVG",children:"SVG"}),V(me,{onClick:x,id:"TD-ContextMenu-Copy-As-PNG",children:"PNG"}),n&&V(me,{onClick:L,id:"TD-ContextMenu-Copy_as_JSON",children:"JSON"})]}),xt(di,{label:`${e.formatMessage({id:"export.as"})}...`,size:"small",id:"TD-ContextMenu-Export",children:[V(me,{onClick:M,id:"TD-ContextMenu-Export-SVG",children:"SVG"}),V(me,{onClick:R,id:"TD-ContextMenu-Export-PNG",children:"PNG"}),V(me,{onClick:C,id:"TD-ContextMenu-Export-JPG",children:"JPG"}),V(me,{onClick:E,id:"TD-ContextMenu-Export-WEBP",children:"WEBP"}),n&&V(me,{onClick:A,id:"TD-ContextMenu-Export-JSON",children:"JSON"})]}),V(ve,{}),he&&xt(ci,{children:[V(me,{onClick:K,id:"TD-ContextMenu-Convert-To-Image",children:"Convert to Image"}),V(ve,{})]}),V(me,{onClick:f,kbd:"\u232B",id:"TD-ContextMenu-Delete",children:V(We,{id:"delete"})})]}):xt(ci,{children:[V(me,{onClick:T,kbd:"#V",id:"TD-ContextMenu-Paste",children:V(We,{id:"paste"})}),V(me,{onClick:I,kbd:"#Z",id:"TD-ContextMenu-Undo",children:V(We,{id:"undo"})}),V(me,{onClick:k,kbd:"#\u21E7Z",id:"TD-ContextMenu-Redo",children:V(We,{id:"redo"})}),xt(di,{label:`${e.formatMessage({id:"export.as"})}...`,size:"small",id:"TD-ContextMenu-Export",children:[V(me,{onClick:M,id:"TD-ContextMenu-Export-SVG",children:"SVG"}),V(me,{onClick:R,id:"TD-ContextMenu-Export-PNG",children:"PNG"}),V(me,{onClick:C,id:"TD-ContextMenu-Export-JPG",children:"JPG"}),V(me,{onClick:E,id:"TD-ContextMenu-Export-WEBP",children:"WEBP"}),n&&V(me,{onClick:A,id:"TD-ContextMenu-Export-JSON",children:"JSON"})]})]})})});function fm({hasThreeOrMore:i}){let o=N(),e=de.useCallback(()=>{o.align("top")},[o]),t=de.useCallback(()=>{o.align("centerVertical")},[o]),n=de.useCallback(()=>{o.align("bottom")},[o]),r=de.useCallback(()=>{o.stretch("vertical")},[o]),s=de.useCallback(()=>{o.distribute("vertical")},[o]),l=de.useCallback(()=>{o.align("left")},[o]),a=de.useCallback(()=>{o.align("centerHorizontal")},[o]),c=de.useCallback(()=>{o.align("right")},[o]),p=de.useCallback(()=>{o.stretch("horizontal")},[o]),u=de.useCallback(()=>{o.distribute("horizontal")},[o]),h=rn();return xt(Ce.Sub,{children:[V(Ns,{id:"TD-ContextMenu-Align-Distribute-Trigger",children:V(We,{id:"align.distribute"})}),V(Ce.Portal,{container:h.current,children:V(Ce.SubContent,{asChild:!0,sideOffset:4,alignOffset:-2,children:xt(Sm,{numberOfSelected:i?"threeOrMore":"twoOrMore",children:[V(yn,{onClick:l,id:"TD-ContextMenu-Align_Distribute-AlignLeft",children:V(nm,{})}),V(yn,{onClick:a,id:"TD-ContextMenu-Align_Distribute-AlignCenterHorizontal",children:V(em,{})}),V(yn,{onClick:c,id:"TD-ContextMenu-Align_Distribute-AlignRight",children:V(om,{})}),V(yn,{onClick:p,id:"TD-ContextMenu-Align_Distribute-StretchHorizontal",children:V(am,{})}),i&&V(yn,{onClick:u,id:"TD-ContextMenu-Align_Distribute-SpaceEvenlyHorizontal",children:V(im,{})}),V(yn,{onClick:e,id:"TD-ContextMenu-Align_Distribute-AlignTop",children:V(rm,{})}),V(yn,{onClick:t,id:"TD-ContextMenu-Align_Distribute-AlignCenterVertical",children:V(tm,{})}),V(yn,{onClick:n,id:"TD-ContextMenu-Align_Distribute-AlignBottom",children:V(Qh,{})}),V(yn,{onClick:r,id:"TD-ContextMenu-Align_Distribute-StretchVertical",children:V(lm,{})}),i&&V(yn,{onClick:s,id:"TD-ContextMenu-Align_Distribute-SpaceEvenlyVertical",children:V(sm,{})}),V(Ws,{offset:13})]})})})]})}var Sm=P(Ln,{display:"grid",variants:{numberOfSelected:{threeOrMore:{gridTemplateColumns:"repeat(5, auto)"},twoOrMore:{gridTemplateColumns:"repeat(4, auto)"}}}}),ym=i=>i.appState.currentPageId,bm=i=>i.document.pages;function vm(){let i=N(),o=i.useStore(ym),e=i.useStore(bm),t=Object.values(e).sort((r,s)=>(r.childIndex||0)-(s.childIndex||0)).filter(r=>r.id!==o),n=rn();return t.length===0?null:xt(Ce.Sub,{children:[V(Ns,{children:V(We,{id:"move.to.page"})}),V(Ce.Portal,{container:n.current,children:V(Ce.SubContent,{sideOffset:4,alignOffset:-2,asChild:!0,children:xt(Ln,{children:[t.map(({id:r,name:s},l)=>V(me,{disabled:r===o,onClick:()=>i.moveToPage(r),children:s||`Page ${l}`},r)),V(Ws,{offset:13})]})})})]})}function di({children:i,label:o,size:e,id:t}){let n=rn();return xt(Ce.Sub,{children:[V(Ns,{children:o}),V(Ce.Portal,{container:n.current,children:V(Ce.SubContent,{sideOffset:4,alignOffset:-2,asChild:!0,children:xt(Ln,{size:e,children:[i,V(Ws,{offset:13})]})})})]})}var Ws=P(Ce.ContextMenuArrow,{fill:"$panel"});function yn(e){var t=e,{onSelect:i}=t,o=Be(t,["onSelect"]);return V(Ce.ContextMenuItem,{dir:"ltr",onSelect:i,asChild:!0,children:V(Tt,S({},o))})}var me=e=>{var t=e,{id:i}=t,o=Be(t,["id"]);return V(Ce.ContextMenuItem,{asChild:!0,id:i,children:V(Je,S({},o))})},Ns=e=>{var t=e,{id:i}=t,o=Be(t,["id"]);return V(Ce.SubTrigger,{asChild:!0,id:i,children:V(Je,S({hasArrow:!0},o))})},Us=de.memo(mm);import{jsx as An,jsxs as Ks}from"react/jsx-runtime";function _s({error:i,resetErrorBoundary:o}){let e=N(),t=()=>{window.location.reload(),o()},n=()=>{let l=document.createElement("textarea");l.value=i.message,document.body.appendChild(l),l.select(),document.execCommand("copy"),l.remove()},r=()=>{e.saveProjectAs()},s=()=>{e.resetDocument(),o()};return An(Tm,{children:Ks(xm,{children:[An("div",{children:"We've encountered an error!"}),An("pre",{children:An("code",{children:i.message})}),Ks(km,{children:[An(Je,{onClick:n,children:"Copy Error"}),An(Je,{onClick:t,children:"Refresh Page"})]}),An(ve,{}),Ks("p",{children:["Keep getting this error?"," ",An("a",{onClick:r,title:"Download your project",children:"Download your project"})," ","as a backup and then"," ",An("a",{onClick:s,title:"Reset the document",children:"reset the document"}),"."]})]})})}var Tm=P("div",{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"$canvas"}),xm=P("div",{backgroundColor:"$panel",border:"1px solid $panelContrast",padding:"$5",borderRadius:8,boxShadow:"$panel",maxWidth:320,color:"$text",fontFamily:"$ui",fontSize:"$2",textAlign:"center",display:"flex",flexDirection:"column",gap:"$3","& > pre":{marginTop:"$3",marginBottom:"$3",textAlign:"left",whiteSpace:"pre-wrap",backgroundColor:"$hover",padding:"$4",borderRadius:"$2",fontFamily:'"Menlo", "Monaco", monospace',fontWeight:500},"& p":{fontFamily:"$body",lineHeight:1.7,padding:"$5",margin:0},"& a":{color:"$text",cursor:"pointer",textDecoration:"underline"},"& hr":{marginLeft:"-$5",marginRight:"-$5"}}),km=P("div",{display:"flex","& > button > div":{justifyContent:"center",textAlign:"center"}});import{ChevronDownIcon as Vm,ChevronRightIcon as Hm,EyeClosedIcon as zm,EyeOpenIcon as Fm,LockClosedIcon as Om,LockOpen1Icon as $m}from"@radix-ui/react-icons";import*as pt from"react";import*as Lo from"react";import{Utils as Cm}from"telva-core";import*as pi from"react";var Ys=pi.createContext([]);function ui(){return pi.useContext(Ys)}import{jsx as Vn,jsxs as yr}from"react/jsx-runtime";var Sd=Lo.memo(function(){let o=N(),e=ui(),[t,n]=Lo.useState(null),r=Lo.useCallback(s=>{n(s.id);try{let[l,a]=s.defaultSize,c=o.getPagePoint([window.innerWidth/2-l/2,window.innerHeight/2-a/2]),p=Cm.uniqueId();o.createShapes({id:p,type:"reactComponent",name:s.name,point:c,size:[l,a],componentId:s.id,style:{color:"black",size:"small",dash:"draw"}}),o.select(p)}catch(l){console.error("Failed to import component:",l)}finally{n(null)}},[o]);return yr(wm,{children:[e.length===0?yr(Im,{children:["No components registered.",Vn("br",{}),"Add components in ",Vn("code",{children:"apps/www/react/registry.tsx"})]}):e.map(s=>yr(Pm,{children:[Vn(Rm,{style:{background:s.previewColor||"#6366f1"},children:Vn("span",{children:"<"+s.name+" />"})}),yr(Dm,{children:[Vn(Em,{children:s.name}),Vn(Bm,{children:s.description}),Vn(Mm,{children:s.sourcePath})]}),Vn(Lm,{onClick:()=>r(s),disabled:t===s.id,children:t===s.id?"...":"Import"})]},s.id)),yr(Am,{children:["Components render LIVE on your canvas.",Vn("br",{})]})]})}),wm=P("div",{flex:1,padding:"6px",overflowY:"auto","&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{background:"$separator",borderRadius:"2px"}}),Im=P("div",{padding:"16px 8px",fontSize:"10px",color:"$textSecondary",textAlign:"center",lineHeight:1.5,"& code":{fontSize:"9px",background:"$inputBg",padding:"1px 4px",borderRadius:"$0"}}),Pm=P("div",{display:"flex",alignItems:"center",gap:"6px",padding:"6px",borderRadius:"$2",border:"1px solid $separator",marginBottom:"4px",transition:"background 0.08s","&:hover":{background:"$hover"}}),Rm=P("div",{width:"36px",height:"36px",borderRadius:"$1",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"& span":{fontSize:"7px",color:"rgba(255,255,255,0.8)",fontFamily:"$mono"}}),Dm=P("div",{flex:1,minWidth:0}),Em=P("div",{fontSize:"10px",fontWeight:600,color:"$text",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),Bm=P("div",{fontSize:"9px",color:"$textSecondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),Mm=P("div",{fontSize:"8px",color:"$textSecondary",opacity:.6,fontFamily:"$mono",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),Lm=P("button",{all:"unset",fontSize:"9px",fontWeight:600,color:"white",background:"$accent",padding:"3px 8px",borderRadius:"$1",cursor:"pointer",flexShrink:0,transition:"opacity 0.1s","&:hover":{opacity:.85},"&:disabled":{opacity:.5,cursor:"not-allowed"}}),Am=P("div",{padding:"10px 6px",fontSize:"8px",color:"$textSecondary",lineHeight:1.4,borderTop:"1px solid $separator",marginTop:"6px","& code":{fontSize:"8px",background:"$inputBg",padding:"1px 3px",borderRadius:"$0"}});import{Fragment as eg,jsx as oe,jsxs as Hn}from"react/jsx-runtime";var Gm=i=>{let o=i.document.pages[i.appState.currentPageId];return Object.values(o.shapes).sort((e,t)=>t.childIndex-e.childIndex)},jm=i=>i.document.pageStates[i.appState.currentPageId].selectedIds,yd={["draw"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("path",{d:"M2 12C4 8 8 4 10 6C12 8 13 3 13 3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",fill:"none"})}),["rectangle"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("rect",{x:"2",y:"3",width:"11",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})}),["ellipse"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("ellipse",{cx:"7.5",cy:"7.5",rx:"5.5",ry:"4.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})}),["triangle"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("path",{d:"M7.5 2L13 13H2L7.5 2Z",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})}),["arrow"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("path",{d:"M3 12L12 3M12 3H6M12 3V9",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}),["text"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("path",{d:"M3 3H12M7.5 3V12",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})}),["sticky"]:Hn("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:[oe("rect",{x:"2",y:"2",width:"11",height:"11",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),oe("path",{d:"M5 6H10M5 9H8",stroke:"currentColor",strokeWidth:"0.8"})]}),["line"]:oe("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:oe("line",{x1:"2",y1:"13",x2:"13",y2:"2",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})}),["image"]:Hn("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:[oe("rect",{x:"2",y:"3",width:"11",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),oe("circle",{cx:"5",cy:"6",r:"1",fill:"currentColor"})]}),["video"]:Hn("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:[oe("rect",{x:"2",y:"3",width:"11",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),oe("path",{d:"M6 6V9L9 7.5L6 6Z",fill:"currentColor"})]}),["group"]:Hn("svg",{width:"12",height:"12",viewBox:"0 0 15 15",fill:"none",children:[oe("rect",{x:"1",y:"4",width:"8",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1",fill:"none"}),oe("rect",{x:"5",y:"2",width:"8",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1",fill:"none"})]})},Xs=pt.memo(function(){let[o,e]=pt.useState("layers");return Hn(Nm,{onPointerDown:t=>t.stopPropagation(),onPointerUp:t=>t.stopPropagation(),onClick:t=>t.stopPropagation(),children:[Hn(Um,{children:[oe(bd,{isActive:o==="layers",onClick:()=>e("layers"),children:"Layers"}),oe(bd,{isActive:o==="components",onClick:()=>e("components"),children:"Components"})]}),o==="layers"?oe(Wm,{}):oe(Sd,{})]})});function Wm(){let i=N(),o=i.useStore(Gm),e=i.useStore(jm),[t,n]=pt.useState(null),r=pt.useRef(null),s=pt.useMemo(()=>o.filter(a=>a.parentId===i.currentPageId),[o,i.currentPageId]),l=pt.useCallback((a,c,p)=>{if(a===c)return;let u=[...s],h=u.findIndex(T=>T.id===a);if(h===-1)return;let g=u.filter(T=>T.id!==a),m=g.findIndex(T=>T.id===c);if(m===-1)return;let f=p==="before"?m:m+1;g.splice(f,0,u[h]);let v=g.length,b={};g.forEach((T,y)=>{b[T.id]={childIndex:v-y}}),i.patchState({document:{pages:{[i.currentPageId]:{shapes:b}}}},"reorder_layers")},[s,i]);return oe(Km,{onDragOver:a=>a.preventDefault(),onDrop:()=>{r.current=null,n(null)},children:s.length===0?oe(_m,{children:"No elements on canvas"}):s.map(a=>oe(Td,{shape:a,allShapes:o,selectedIds:e,app:i,depth:0,dragOverInfo:t,onLayerDragStart:c=>{r.current=c},onLayerDragOver:(c,p)=>n({id:c,position:p}),onLayerDrop:(c,p)=>{r.current&&l(r.current,c,p),r.current=null,n(null)},onLayerDragEnd:()=>{r.current=null,n(null)}},a.id))})}function Td({shape:i,allShapes:o,selectedIds:e,app:t,depth:n,dragOverInfo:r,onLayerDragStart:s,onLayerDragOver:l,onLayerDrop:a,onLayerDragEnd:c}){let p=e.includes(i.id),h=i.type==="group"?i.children||[]:[],g=h.length>0,[m,f]=pt.useState(!0),v=pt.useCallback(C=>{C.stopPropagation(),C.shiftKey?p?t.deselect(i.id):t.select(...e,i.id):t.select(i.id)},[t,i.id,e,p]),b=pt.useCallback(C=>{C.stopPropagation(),t.toggleHidden([i.id])},[t,i.id]),T=pt.useCallback(C=>{C.stopPropagation(),t.toggleLocked([i.id])},[t,i.id]),y=yd[i.type]||yd["rectangle"],x=i.name||i.type,I=pt.useMemo(()=>g?h.map(C=>o.find(E=>E.id===C)).filter(Boolean):[],[g,h,o]),R=(r==null?void 0:r.id)===i.id?r.position==="before"?{borderTop:"2px solid #0D99FF"}:{borderBottom:"2px solid #0D99FF"}:{};return Hn(eg,{children:[Hn(xd,{draggable:!!s,onClick:v,isSelected:p,style:S({paddingLeft:`${8+n*14}px`,cursor:s?"grab":"pointer"},R),onDragStart:C=>{C.stopPropagation(),C.dataTransfer.effectAllowed="move",s==null||s(i.id)},onDragOver:C=>{C.preventDefault(),C.stopPropagation();let E=C.currentTarget.getBoundingClientRect(),M=C.clientY<E.top+E.height/2?"before":"after";l==null||l(i.id,M)},onDrop:C=>{C.preventDefault(),C.stopPropagation();let E=C.currentTarget.getBoundingClientRect(),M=C.clientY<E.top+E.height/2?"before":"after";a==null||a(i.id,M)},onDragEnd:C=>{C.stopPropagation(),c==null||c()},children:[g?oe(Ym,{onClick:C=>{C.stopPropagation(),f(!m)},children:m?oe(Vm,{}):oe(Hm,{})}):oe(Xm,{}),oe(Zm,{children:y}),oe(qm,{children:x}),Hn(Jm,{children:[oe(vd,{onClick:b,children:i.isHidden?oe(zm,{}):oe(Fm,{})}),oe(vd,{onClick:T,children:i.isLocked?oe(Om,{}):oe($m,{})})]})]}),g&&m&&oe(Qm,{children:I.map(C=>oe(Td,{shape:C,allShapes:o,selectedIds:e,app:t,depth:n+1},C.id))})]})}var Nm=P("div",{display:"flex",flexDirection:"column",flex:1,minHeight:0,overflow:"hidden"}),Um=P("div",{display:"flex",borderBottom:"1px solid $separator",flexShrink:0}),bd=P("button",{all:"unset",flex:1,padding:"6px 0",fontSize:"9px",fontWeight:600,textAlign:"center",color:"$textSecondary",cursor:"pointer",textTransform:"uppercase",letterSpacing:"0.06em",transition:"all 0.1s",borderBottom:"2px solid transparent","&:hover":{color:"$text"},variants:{isActive:{true:{color:"$accent",borderBottomColor:"$accent"}}}}),Km=P("div",{flex:1,overflowY:"auto",overflowX:"hidden","&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{background:"$separator",borderRadius:"2px"}}),_m=P("div",{padding:"16px 12px",fontSize:"10px",color:"$textSecondary",fontStyle:"italic",textAlign:"center"}),xd=P("div",{display:"flex",alignItems:"center",gap:"4px",height:"26px",paddingRight:"6px",cursor:"pointer",transition:"background 0.08s","&:hover":{background:"$hover"},variants:{isSelected:{true:{background:"rgba(13, 153, 255, 0.15)","&:hover":{background:"rgba(13, 153, 255, 0.2)"}}}}}),Ym=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",cursor:"pointer",color:"$textSecondary",flexShrink:0,"& svg":{width:"10px",height:"10px"},"&:hover":{color:"$text"}}),Xm=P("div",{width:"14px",flexShrink:0}),Zm=P("div",{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",color:"$textSecondary",flexShrink:0}),qm=P("span",{fontSize:"10px",color:"$text",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1,fontWeight:500}),Jm=P("div",{display:"flex",gap:"1px",opacity:0,transition:"opacity 0.1s",[`${xd}:hover &`]:{opacity:1}}),vd=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"$0",color:"$textSecondary",cursor:"pointer","& svg":{width:"10px",height:"10px"},"&:hover":{color:"$text",background:"$hover"}}),Qm=P("div",{borderLeft:"1px solid $separator",marginLeft:"18px"});import*as Cd from"react";import{jsx as kd}from"react/jsx-runtime";var Zs=Cd.memo(function(){return kd(tg,{children:kd(Xs,{})})}),tg=P("div",{display:"flex",flexDirection:"column",width:"200px",height:"100%",background:"$panel",borderRight:"1px solid $separator",zIndex:200,pointerEvents:"all",overflow:"hidden",flexShrink:0});import{FormattedMessage as ng}from"react-intl";import{jsx as wd}from"react/jsx-runtime";var og=i=>i.appState.isLoading;function qs(){let o=N().useStore(og);return wd(rg,{hidden:!o,children:wd(ng,{id:"loading",values:{dots:"..."}})})}var rg=P("div",{position:"absolute",top:0,left:"50%",transform:"translate(-50%, 0)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px",padding:"8px 16px",fontFamily:"var(--fonts-ui)",fontSize:"var(--fontSizes-1)",boxShadow:"var(--shadows-panel)",backgroundColor:"white",zIndex:200,pointerEvents:"none","& > div > *":{pointerEvents:"all"},variants:{transform:{hidden:{transform:"translate(-50%, 100%)"},visible:{transform:"translate(-50%, 0%)"}}}});import*as kt from"@radix-ui/react-alert-dialog";import{FormattedMessage as Js,useIntl as ig}from"react-intl";import{jsx as Ft,jsxs as hi}from"react/jsx-runtime";function sg({children:i,onClose:o,container:e}){return hi(kt.Portal,{container:e,children:[Ft(ug,{}),Ft(hg,{onKeyDown:n=>{switch(n.key){case"Escape":o==null||o();break}},children:i})]})}var ag=P(kt.Description,{marginBottom:20,color:"$text",fontSize:"$2",lineHeight:1.5,textAlign:"center",maxWidth:"62%",minWidth:0,alignSelf:"center"}),lg=kt.Root,dg=sg,cg=ag,Id=kt.Action,pg=kt.Cancel,Pd=({container:i})=>{let{setDialogState:o,dialogState:e,onCancel:t,onNo:n,onYes:r}=ei(),s=ig(),l={saveFirstTime:s.formatMessage({id:"dialog.save.firsttime"}),saveAgain:s.formatMessage({id:"dialog.save.again"})};return Ft(lg,{open:e!==null,children:hi(dg,{onClose:()=>o(null),container:i,children:[e&&Ft(cg,{children:l[e]}),hi("div",{style:{width:"100%",gap:"$6",display:"flex",justifyContent:"space-between"},children:[t&&Ft(pg,{asChild:!0,children:Ft(Ao,{css:{color:"$text"},onClick:()=>{t(),o(null)},children:Ft(Js,{id:"dialog.cancel"})})}),hi("div",{style:{flexShrink:0},children:[n&&Ft(Id,{asChild:!0,children:Ft(Ao,{onClick:()=>{n(),o(null)},children:Ft(Js,{id:"dialog.no"})})}),r&&Ft(Id,{asChild:!0,children:Ft(Ao,{css:{backgroundColor:"#2F80ED",color:"White"},onClick:()=>{r(),o(null)},children:Ft(Js,{id:"dialog.yes"})})})]})]})]})})},ug=P(kt.Overlay,{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, .15)",pointerEvents:"all"}),Wk=P(kt.Overlay,{backgroundColor:"rgba(0, 0, 0, .15)",position:"absolute",pointerEvents:"all",inset:0}),hg=P(kt.Content,{position:"fixed",font:"$ui",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"max-content",padding:"$3",pointerEvents:"all",backgroundColor:"$panel",borderRadius:"$3",display:"flex",flexDirection:"column",justifyContent:"center",fontFamily:"$ui",border:"1px solid $panelContrast",boxShadow:"$panel"}),Ao=P("button",{all:"unset",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"$2",padding:"0 15px",fontSize:"$1",lineHeight:1,fontWeight:"normal",height:36,color:"$text",cursor:"pointer",minWidth:48});import*as ln from"@radix-ui/react-alert-dialog";import{Pencil1Icon as yg}from"@radix-ui/react-icons";import*as Vo from"react";import{FormattedMessage as Ed,useIntl as bg}from"react-intl";import*as Dd from"react";import{jsx as Rd,jsxs as Sg}from"react/jsx-runtime";var mi=Dd.forwardRef((t,e)=>{var n=t,{icon:i}=n,o=Be(n,["icon"]);return Sg(mg,{children:[Rd(gg,w(S({},o),{ref:e})),i?Rd(fg,{children:i}):null]})}),mg=P("div",{position:"relative",width:"100%",height:"min-content"}),gg=P("input",{color:"$text",border:"none",textAlign:"left",width:"100%",paddingLeft:"$3",paddingRight:"$6",backgroundColor:"$background",height:"32px",outline:"none",fontFamily:"$ui",fontSize:"$1","&:focus":{backgroundColor:"$hover"},borderRadius:"$2"}),fg=P(Rt,{top:0,right:0,position:"absolute",paddingLeft:"$3",paddingRight:"$3",pointerEvents:"none",color:"$text"});import{jsx as Ot,jsxs as gi}from"react/jsx-runtime";var Md=({isOpen:i,onClose:o})=>{let e=N(),t=rn(),n=bg(),[r,s]=Vo.useState(e.document.name),[l,a]=Vo.useState("tldr"),c=Vo.useCallback(h=>{let g=h.target.value.trimStart();s(g)},[]);function p(h){h.stopPropagation()}let u=Vo.useCallback(h=>{switch(h.key){case"Enter":{let g=r.trim().replace(/\.(tldr|tld)$/,"");e.saveProjectAs(g,l),o();break}case"Escape":{o();break}}},[r,l]);return Ot(ln.Root,{open:i,children:gi(ln.Portal,{container:t.current,children:[Ot(Tg,{onPointerDown:o}),gi(vg,{dir:"ltr",onKeyDown:p,onKeyUp:p,children:[Ot(kg,{placeholder:n.formatMessage({id:"enter.file.name"}),value:r,onChange:c,onKeyDown:u,icon:Ot(yg,{})}),gi(Cg,{children:[Ot(wg,{children:"Format:"}),Ot(Bd,{active:l==="tldr",onClick:()=>a("tldr"),children:".tldr"}),Ot(Bd,{active:l==="tld",onClick:()=>a("tld"),children:".tld"})]}),gi(xg,{children:[Ot(ln.Action,{asChild:!0,children:Ot(Ao,{onClick:o,children:Ot(Ed,{id:"cancel"})})}),Ot(ln.Action,{asChild:!0,children:Ot(Ao,{css:{backgroundColor:"#2F80ED",color:"White"},onClick:()=>{let h=r.trim().replace(/\.(tldr|tld)$/,"");e.saveProjectAs(h,l),o()},children:Ot(Ed,{id:"save"})})})]})]})]})})},vg=P(ln.Content,{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",minWidth:300,maxWidth:"fit-content",maxHeight:"85vh",marginTop:"-5vh",pointerEvents:"all",backgroundColor:"$panel",padding:"$3",borderRadius:"$2",font:"$ui",zIndex:999999,"&:focus":{outline:"none"}}),Tg=P(ln.Overlay,{backgroundColor:"rgba(0, 0, 0, .15)",position:"absolute",pointerEvents:"all",inset:0,zIndex:999998}),xg=P("div",{width:"100%",display:"flex",alignItems:"center",gap:8,justifyContent:"flex-end",marginTop:10}),kg=P(mi,{background:"$hover"}),Cg=P("div",{display:"flex",alignItems:"center",gap:6,marginTop:8}),wg=P("span",{fontSize:11,color:"$textSecondary",flexShrink:0}),Bd=P("button",{all:"unset",padding:"3px 10px",borderRadius:4,fontSize:11,fontFamily:"monospace",cursor:"pointer",border:"1px solid $separator",color:"$textSecondary",transition:"all 0.1s","&:hover":{background:"$hover",color:"$text"},variants:{active:{true:{background:"#2F80ED",borderColor:"#2F80ED",color:"white","&:hover":{background:"#2F80ED",color:"white"}}}}});import*as yp from"react";import*as Ie from"react";import{Utils as qi}from"telva-core";import{Utils as Ld}from"telva-core";function Dt(i,o){let e=Ld.getFromCache(o,i,()=>{let[t,n]=i.size;return{minX:0,maxX:t,minY:0,maxY:n,width:t,height:n}});return Ld.translateBounds(e,i.point)}var Ig={["start"]:"left",["middle"]:"center",["end"]:"right",["justify"]:"justify"};function Ad(i="start"){return Ig[i]}var Ut="-0.03em";var Ho=[.5,.5],uC=Math.PI*2,Qs=".tldr",So={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>i*(2-i),easeInOutQuad:i=>i<.5?2*i*i:-1+(4-2*i)*i,easeInCubic:i=>i*i*i,easeOutCubic:i=>--i*i*i+1,easeInOutCubic:i=>i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1,easeInQuart:i=>i*i*i*i,easeOutQuart:i=>1- --i*i*i*i,easeInOutQuart:i=>i<.5?8*i*i*i*i:1-8*--i*i*i*i,easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>1+--i*i*i*i*i,easeInOutQuint:i=>i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i,easeInSine:i=>1-Math.cos(i*Math.PI/2),easeOutSine:i=>Math.sin(i*Math.PI/2),easeInOutSine:i=>-(Math.cos(Math.PI*i)-1)/2,easeInExpo:i=>i<=0?0:Math.pow(2,10*i-10),easeOutExpo:i=>i>=1?1:1-Math.pow(2,-10*i),easeInOutExpo:i=>i<=0?0:i>=1?1:i<.5?Math.pow(2,20*i-10)/2:(2-Math.pow(2,-20*i+10))/2};var fi=["#EC5E41","#F2555A","#F04F88","#E34BA9","#BD54C6","#9D5BD2","#7B66DC","#02B1CC","#11B3A3","#39B178","#55B467","#FF802B"],Pg=typeof Window=="undefined"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Vd=typeof Window=="undefined"?!1:/linux/i.test(navigator.userAgent),Si=[".png",".svg",".jpg",".jpeg",".gif"],yi=Pg?[]:[".mp4",".webm"];var Et;function Rg(){var o;(o=document.getElementById("__textLabelMeasure"))==null||o.remove();let i=document.createElement("pre");return i.id="__textLabelMeasure",Object.assign(i.style,{whiteSpace:"pre",width:"auto",border:"1px solid transparent",padding:"4px",margin:"0px",letterSpacing:Ut,opacity:"0",position:"absolute",top:"-500px",left:"0px",zIndex:"9999",pointerEvents:"none",userSelect:"none","-webkit-user-select":"none",alignmentBaseline:"mathematical",dominantBaseline:"mathematical"}),i.tabIndex=-1,document.body.appendChild(i),i}typeof window!="undefined"&&(Et=Rg());var Dg="";function Hd(){Dg=""}function Zn(i,o,e){if(!i)return[16,32];if(!Et)return[10,10];Et.parent||document.body.appendChild(Et),Et.textContent=i,Et.style.font=o,e?(Et.style.whiteSpace="pre-wrap",Et.style.wordBreak="break-word",Et.style.width=`${e}px`):(Et.style.whiteSpace="pre",Et.style.wordBreak="normal",Et.style.width="auto");let t=Et.offsetWidth||1,n=Et.offsetHeight||1;return[t,n]}var Eg=new RegExp(`${[32,160,4961,65792,65793,4153,4241].map(i=>String.fromCodePoint(i)).join("|")}`);function qn(i,o,e,t,n,r=!1){let s="normal",a=Ut,c=Bg({text:i,wrap:r,width:n,fontSize:o,fontWeight:s,fontFamily:e,fontStyle:"normal",textAlign:"left",letterSpacing:Ut,lineHeight:1}),p=document.createElementNS("http://www.w3.org/2000/svg","text");p.setAttribute("font-size",o+"px"),p.setAttribute("font-family",e),p.setAttribute("font-weight",s),p.setAttribute("line-height",1*o+"px"),p.setAttribute("letter-spacing",a),p.setAttribute("text-align",t!=null?t:"left"),p.setAttribute("dominant-baseline","mathematical"),p.setAttribute("alignment-baseline","mathematical");let u=c.map((h,g)=>{let m=document.createElementNS("http://www.w3.org/2000/svg","tspan");return m.textContent=h+`
4
4
  `,m.setAttribute("y",1*o*(g+.5)+"px"),p.appendChild(m),m});switch(t){case"middle":{p.setAttribute("text-align","center"),p.setAttribute("text-anchor","middle"),u.forEach(h=>h.setAttribute("x",n/2+""));break}case"end":{p.setAttribute("text-align","right"),p.setAttribute("text-anchor","end"),u.forEach(h=>h.setAttribute("x",-4+n+""));break}default:p.setAttribute("text-align","left"),p.setAttribute("text-anchor","start"),u.forEach(h=>h.setAttribute("x",4+""))}return p}function Bg(i){let o=document.createElement("div");o.style.setProperty("position","absolute"),o.style.setProperty("top","-9999px"),o.style.setProperty("left","-9999px"),o.style.setProperty("width",i.width+"px"),o.style.setProperty("height","min-content"),o.style.setProperty("font-size",i.fontSize+"px"),o.style.setProperty("font-family",i.fontFamily),o.style.setProperty("font-weight",i.fontWeight),o.style.setProperty("line-height",i.lineHeight*i.fontSize+"px"),o.style.setProperty("letter-spacing",i.letterSpacing),o.style.setProperty("text-align",i.textAlign),document.body.appendChild(o);let e=i.text.split(Eg).flatMap(s=>s.replace(`
5
5
  `,`
6
- `)).join(" ").split(" ");o.innerText=e[0];let t=o.offsetHeight,n=[e[0]],r=[n];for(let s=1;s<e.length;s++){let l=e[s];o.innerText+=" "+l;let a=o.offsetHeight;a>t&&(t=a,n=[],r.push(n)),n.push(l)}return o.remove(),r.map(s=>s.join(" "))}import{jsx as ea,jsxs as Mg}from"react/jsx-runtime";function zd({id:i,bounds:o,labelSize:e,offset:t,scale:n=1}){return ea("defs",{children:Mg("mask",{id:i+"_clip",children:[ea("rect",{x:-100,y:-100,width:o.width+200,height:o.height+200,fill:"white"}),ea("rect",{x:o.width/2-e[0]/2*n+((t==null?void 0:t[0])||0),y:o.height/2-e[1]/2*n+((t==null?void 0:t[1])||0),width:e[0]*n,height:e[1]*n,rx:4*n,ry:4*n,fill:"black",opacity:Math.max(n,.8)})]})})}import{intersectLineLine as Lg}from"telva-intersect";import{Vec as Kt}from"telva-vec";var vi=Math.PI*2,$t=class{static inwardEdgeNormal(o){let e=Kt.sub(o[1],o[0]),t=Kt.len2(e);return[-e[0]/t,e[1]/t]}static outwardEdgeNormal(o){return Kt.neg($t.inwardEdgeNormal(o))}static isReflexVertex(o,e){let t=o.length,n=o[(e+t-1)%t],r=o[e],s=o[(e+1)%t];return $t.leftSide(n,s,r)<0}static getEdges(o){return o.map((e,t)=>[e,o[(t+1)%o.length]])}static edgesIntersection([o,e],[t,n]){let r=(n[1]-t[1])*(e[0]-o[0])-(n[0]-t[0])*(e[1]-o[1]);if(r==0)return null;let s=((n[0]-t[0])*(o[1]-t[1])-(n[1]-t[1])*(o[0]-t[0]))/r,l=((e[0]-o[0])*(o[1]-t[1])-(e[1]-o[1])*(o[0]-t[0]))/r;return s<0||l<0||s>1||l>1?null:[o[0]+s*(e[0]-o[0]),o[1]+s*(e[1]-o[1])]}static appendArc(o,e,t,n,r,s=!1){let l=[...o],a=Math.atan2(n[1]-e[1],n[0]-e[0]),c=Math.atan2(r[1]-e[1],r[0]-e[0]);a<0&&(a+=vi),c<0&&(c+=vi);let p=5,u=a>c?a-c:a+vi-c,h=(s?-u:vi-u)/p;l.push(n);for(let g=1;g<p;++g){let m=a+h*g;l.push([e[0]+Math.cos(m)*t,e[1]+Math.sin(m)*t])}return l.push(r),l}static createOffsetEdge(o,e){return o.map(t=>Kt.add(t,e))}static getOffsetPolygon(o,e=0){let t=$t.getEdges(o),n=t.map(s=>$t.createOffsetEdge(s,Kt.mul($t.outwardEdgeNormal(s),e))),r=[];for(let s=0;s<n.length;s++){let l=n[s],a=n[(s+n.length-1)%n.length],c=$t.edgesIntersection(a,l);c?r.push(c):$t.appendArc(r,t[s][0],e,a[1],l[0],!1)}return r}static createPaddingPolygon(o,e=0){let t=o.map(r=>$t.createOffsetEdge(r,$t.inwardEdgeNormal(r))),n=[];for(let r=0;r<t.length;r++){let s=t[r],l=t[(r+t.length-1)%t.length],a=$t.edgesIntersection(l,s);a?n.push(a):$t.appendArc(n,o[r][0],e,l[1],s[0],!0)}return n}},ta=$t;d(ta,"leftSide",Kt.isLeft);function Fd(i,o){if(i.length<3)throw Error("Polygon must have at least 3 points");let e=i.length;return i.map((t,n)=>[t,i[(n+1)%e]]).map(([t,n])=>{let r=Kt.mul(Kt.per(Kt.uni(Kt.sub(n,t))),o);return[Kt.add(t,r),Kt.add(n,r)]}).map((t,n,r)=>{let s=Lg(t,r[(n+1)%r.length]);if(s===void 0)throw Error("Expected an intersection");return s})}import{Utils as zo}from"telva-core";var Od="#fafafa",na="#343d45",Fo={["white"]:"#f0f1f3",["lightGray"]:"#c6cbd1",["gray"]:"#788492",["black"]:"#1d1d1d",["green"]:"#36b24d",["cyan"]:"#0e98ad",["blue"]:"#1c7ed6",["indigo"]:"#4263eb",["violet"]:"#7746f1",["red"]:"#ff2133",["orange"]:"#ff9433",["yellow"]:"#ffc936"},Ag={light:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(o,Od,.45)]))),{["white"]:"#ffffff",["black"]:"#3d3d3d"}),dark:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(zo.lerpColor(o,"#999999",.3),na,.4)]))),{["white"]:"#1d1d1d",["black"]:"#bbbbbb"})},zn={light:w(S({},Fo),{["white"]:"#1d1d1d"}),dark:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(o,na,.1)]))),{["white"]:"#cecece",["black"]:"#cecece"})},yo={light:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(o,Od,.82)]))),{["white"]:"#fefefe"}),dark:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(o,na,.82)]))),{["white"]:"rgb(30,33,37)",["black"]:"#1e1e1f"})},Vg={["small"]:2,["medium"]:3.5,["large"]:5},Hg={["small"]:28,["medium"]:48,["large"]:96,auto:"auto"},zg={["script"]:'"Caveat Brush"',["sans"]:'"Source Sans Pro"',["serif"]:'"Crimson Pro"',["mono"]:'"Source Code Pro"'},Fg={["script"]:1,["sans"]:1,["serif"]:1,["mono"]:1},Og={["small"]:24,["medium"]:36,["large"]:48,auto:"auto"};function $g(i){return Vg[i]}function bo(i,o="script"){return Hg[i]*Fg[o]}function bn(i="script",o){return o?`"${o}"`:zg[i]}function oa(i){return Og[i]}function Ct(i){let o=bo(i.size,i.font),e=bn(i.font,i.fontFamily),{scale:t=1}=i;return`${o*t}px/1 ${e}`}function $d(i){let o=oa(i.size),e=bn(i.font,i.fontFamily),{scale:t=1}=i;return`${o*t}px/1 ${e}`}function ra(i,o=!1){var r,s;let{color:e}=i,t=o?"dark":"light",n=e==="white"||e==="black"?"yellow":e;return{fill:(r=i.fillHex)!=null?r:Ag[t][n],stroke:(s=i.strokeHex)!=null?s:null,color:o?"#1d1d1d":"#0d0d0d"}}function J(i,o){var l,a,c,p;let{color:e,size:t,isFilled:n}=i,r=(l=i.strokeWidthOverride)!=null?l:$g(t),s=o?"dark":"light";return{stroke:(a=i.strokeHex)!=null?a:zn[s][e],fill:n?(c=i.fillHex)!=null?c:yo[s][e]:"none",strokeWidth:r,opacity:(p=i.opacity)!=null?p:1}}var He={color:"black",size:"small",isFilled:!1,dash:"draw",scale:1},Oo=w(S({},He),{font:"script",textAlign:"middle"});var Gd=" ",Fe=class{static insertTextFirefox(o,e){o.setRangeText(e,o.selectionStart||0,o.selectionEnd||0,"end"),o.dispatchEvent(new InputEvent("input",{data:e,inputType:"insertText",isComposing:!1}))}static insert(o,e){let t=o.ownerDocument,n=t.activeElement;n!==o&&o.focus(),t.execCommand("insertText",!1,e)||Fe.insertTextFirefox(o,e),n===t.body?o.blur():n instanceof HTMLElement&&n!==o&&n.focus()}static set(o,e){o.select(),Fe.insert(o,e)}static getSelection(o){let{selectionStart:e,selectionEnd:t}=o;return o.value.slice(e||void 0,t||void 0)}static wrapSelection(o,e,t){let{selectionStart:n,selectionEnd:r}=o,s=Fe.getSelection(o);Fe.insert(o,e+s+(t!=null?t:e)),o.selectionStart=(n||0)+e.length,o.selectionEnd=(r||0)+e.length}static replace(o,e,t){let n=0;o.value.replace(e,(...r)=>{let s=n+r[r.length-2],l=r[0].length;o.selectionStart=s,o.selectionEnd=s+l;let a=typeof t=="string"?t:t(...r);return Fe.insert(o,a),o.selectionStart=s,n+=a.length-l,a})}static findLineEnd(o,e){let t=o.lastIndexOf(`
6
+ `)).join(" ").split(" ");o.innerText=e[0];let t=o.offsetHeight,n=[e[0]],r=[n];for(let s=1;s<e.length;s++){let l=e[s];o.innerText+=" "+l;let a=o.offsetHeight;a>t&&(t=a,n=[],r.push(n)),n.push(l)}return o.remove(),r.map(s=>s.join(" "))}import{jsx as ea,jsxs as Mg}from"react/jsx-runtime";function zd({id:i,bounds:o,labelSize:e,offset:t,scale:n=1}){return ea("defs",{children:Mg("mask",{id:i+"_clip",children:[ea("rect",{x:-100,y:-100,width:o.width+200,height:o.height+200,fill:"white"}),ea("rect",{x:o.width/2-e[0]/2*n+((t==null?void 0:t[0])||0),y:o.height/2-e[1]/2*n+((t==null?void 0:t[1])||0),width:e[0]*n,height:e[1]*n,rx:4*n,ry:4*n,fill:"black",opacity:Math.max(n,.8)})]})})}import{intersectLineLine as Lg}from"telva-intersect";import{Vec as Kt}from"telva-vec";var bi=Math.PI*2,$t=class{static inwardEdgeNormal(o){let e=Kt.sub(o[1],o[0]),t=Kt.len2(e);return[-e[0]/t,e[1]/t]}static outwardEdgeNormal(o){return Kt.neg($t.inwardEdgeNormal(o))}static isReflexVertex(o,e){let t=o.length,n=o[(e+t-1)%t],r=o[e],s=o[(e+1)%t];return $t.leftSide(n,s,r)<0}static getEdges(o){return o.map((e,t)=>[e,o[(t+1)%o.length]])}static edgesIntersection([o,e],[t,n]){let r=(n[1]-t[1])*(e[0]-o[0])-(n[0]-t[0])*(e[1]-o[1]);if(r==0)return null;let s=((n[0]-t[0])*(o[1]-t[1])-(n[1]-t[1])*(o[0]-t[0]))/r,l=((e[0]-o[0])*(o[1]-t[1])-(e[1]-o[1])*(o[0]-t[0]))/r;return s<0||l<0||s>1||l>1?null:[o[0]+s*(e[0]-o[0]),o[1]+s*(e[1]-o[1])]}static appendArc(o,e,t,n,r,s=!1){let l=[...o],a=Math.atan2(n[1]-e[1],n[0]-e[0]),c=Math.atan2(r[1]-e[1],r[0]-e[0]);a<0&&(a+=bi),c<0&&(c+=bi);let p=5,u=a>c?a-c:a+bi-c,h=(s?-u:bi-u)/p;l.push(n);for(let g=1;g<p;++g){let m=a+h*g;l.push([e[0]+Math.cos(m)*t,e[1]+Math.sin(m)*t])}return l.push(r),l}static createOffsetEdge(o,e){return o.map(t=>Kt.add(t,e))}static getOffsetPolygon(o,e=0){let t=$t.getEdges(o),n=t.map(s=>$t.createOffsetEdge(s,Kt.mul($t.outwardEdgeNormal(s),e))),r=[];for(let s=0;s<n.length;s++){let l=n[s],a=n[(s+n.length-1)%n.length],c=$t.edgesIntersection(a,l);c?r.push(c):$t.appendArc(r,t[s][0],e,a[1],l[0],!1)}return r}static createPaddingPolygon(o,e=0){let t=o.map(r=>$t.createOffsetEdge(r,$t.inwardEdgeNormal(r))),n=[];for(let r=0;r<t.length;r++){let s=t[r],l=t[(r+t.length-1)%t.length],a=$t.edgesIntersection(l,s);a?n.push(a):$t.appendArc(n,o[r][0],e,l[1],s[0],!0)}return n}},ta=$t;d(ta,"leftSide",Kt.isLeft);function Fd(i,o){if(i.length<3)throw Error("Polygon must have at least 3 points");let e=i.length;return i.map((t,n)=>[t,i[(n+1)%e]]).map(([t,n])=>{let r=Kt.mul(Kt.per(Kt.uni(Kt.sub(n,t))),o);return[Kt.add(t,r),Kt.add(n,r)]}).map((t,n,r)=>{let s=Lg(t,r[(n+1)%r.length]);if(s===void 0)throw Error("Expected an intersection");return s})}import{Utils as zo}from"telva-core";var Od="#fafafa",na="#343d45",Fo={["white"]:"#f0f1f3",["lightGray"]:"#c6cbd1",["gray"]:"#788492",["black"]:"#1d1d1d",["green"]:"#36b24d",["cyan"]:"#0e98ad",["blue"]:"#1c7ed6",["indigo"]:"#4263eb",["violet"]:"#7746f1",["red"]:"#ff2133",["orange"]:"#ff9433",["yellow"]:"#ffc936"},Ag={light:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(o,Od,.45)]))),{["white"]:"#ffffff",["black"]:"#3d3d3d"}),dark:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(zo.lerpColor(o,"#999999",.3),na,.4)]))),{["white"]:"#1d1d1d",["black"]:"#bbbbbb"})},zn={light:w(S({},Fo),{["white"]:"#1d1d1d"}),dark:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(o,na,.1)]))),{["white"]:"#cecece",["black"]:"#cecece"})},yo={light:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(o,Od,.82)]))),{["white"]:"#fefefe"}),dark:w(S({},Object.fromEntries(Object.entries(Fo).map(([i,o])=>[i,zo.lerpColor(o,na,.82)]))),{["white"]:"rgb(30,33,37)",["black"]:"#1e1e1f"})},Vg={["small"]:2,["medium"]:3.5,["large"]:5},Hg={["small"]:28,["medium"]:48,["large"]:96,auto:"auto"},zg={["script"]:'"Caveat Brush"',["sans"]:'"Source Sans Pro"',["serif"]:'"Crimson Pro"',["mono"]:'"Source Code Pro"'},Fg={["script"]:1,["sans"]:1,["serif"]:1,["mono"]:1},Og={["small"]:24,["medium"]:36,["large"]:48,auto:"auto"};function $g(i){return Vg[i]}function bo(i,o="script"){return Hg[i]*Fg[o]}function bn(i="script",o){return o?`"${o}"`:zg[i]}function oa(i){return Og[i]}function Ct(i){let o=bo(i.size,i.font),e=bn(i.font,i.fontFamily),{scale:t=1}=i;return`${o*t}px/1 ${e}`}function $d(i){let o=oa(i.size),e=bn(i.font,i.fontFamily),{scale:t=1}=i;return`${o*t}px/1 ${e}`}function ra(i,o=!1){var r,s;let{color:e}=i,t=o?"dark":"light",n=e==="white"||e==="black"?"yellow":e;return{fill:(r=i.fillHex)!=null?r:Ag[t][n],stroke:(s=i.strokeHex)!=null?s:null,color:o?"#1d1d1d":"#0d0d0d"}}function J(i,o){var l,a,c,p;let{color:e,size:t,isFilled:n}=i,r=(l=i.strokeWidthOverride)!=null?l:$g(t),s=o?"dark":"light";return{stroke:(a=i.strokeHex)!=null?a:zn[s][e],fill:n?(c=i.fillHex)!=null?c:yo[s][e]:"none",strokeWidth:r,opacity:(p=i.opacity)!=null?p:1}}var He={color:"black",size:"small",isFilled:!1,dash:"draw",scale:1},Oo=w(S({},He),{font:"script",textAlign:"middle"});var Gd=" ",Fe=class{static insertTextFirefox(o,e){o.setRangeText(e,o.selectionStart||0,o.selectionEnd||0,"end"),o.dispatchEvent(new InputEvent("input",{data:e,inputType:"insertText",isComposing:!1}))}static insert(o,e){let t=o.ownerDocument,n=t.activeElement;n!==o&&o.focus(),t.execCommand("insertText",!1,e)||Fe.insertTextFirefox(o,e),n===t.body?o.blur():n instanceof HTMLElement&&n!==o&&n.focus()}static set(o,e){o.select(),Fe.insert(o,e)}static getSelection(o){let{selectionStart:e,selectionEnd:t}=o;return o.value.slice(e||void 0,t||void 0)}static wrapSelection(o,e,t){let{selectionStart:n,selectionEnd:r}=o,s=Fe.getSelection(o);Fe.insert(o,e+s+(t!=null?t:e)),o.selectionStart=(n||0)+e.length,o.selectionEnd=(r||0)+e.length}static replace(o,e,t){let n=0;o.value.replace(e,(...r)=>{let s=n+r[r.length-2],l=r[0].length;o.selectionStart=s,o.selectionEnd=s+l;let a=typeof t=="string"?t:t(...r);return Fe.insert(o,a),o.selectionStart=s,n+=a.length-l,a})}static findLineEnd(o,e){let t=o.lastIndexOf(`
7
7
  `,e-1)+1;return o.charAt(t)!==" "?e:t+1}static indent(o){var l;let{selectionStart:e,selectionEnd:t,value:n}=o,r=n.slice(e,t),s=(l=/\n/g.exec(r))==null?void 0:l.length;if(s&&s>0){let a=n.lastIndexOf(`
8
8
  `,e-1)+1,c=o.value.slice(a,t-1),p=c.replace(/^|\n/g,`$&${Gd}`),u=p.length-c.length;o.setSelectionRange(a,t-1),Fe.insert(o,p),o.setSelectionRange(e+1,t+u)}else Fe.insert(o,Gd)}static unindent(o){let{selectionStart:e,selectionEnd:t,value:n}=o,r=n.lastIndexOf(`
9
- `,e-1)+1,s=Fe.findLineEnd(n,t),l=o.value.slice(r,s),a=l.replace(/(^|\n)(\t| {1,2})/g,"$1"),c=l.length-a.length;o.setSelectionRange(r,s),Fe.insert(o,a);let p=/\t| {1,2}/.exec(n.slice(r,e)),u=p?p[0].length:0,h=e-u;o.setSelectionRange(e-u,Math.max(h,t-c))}};import*as at from"react";var rt=i=>i.stopPropagation();import{Utils as jt}from"telva-core";import{intersectRayBounds as Pa,intersectRayEllipse as VS,intersectRayLineSegment as HS}from"telva-intersect";import{Vec as X}from"telva-vec";function it(i){if(i===null)return i;if(i instanceof Date)return new Date(i.getTime());if(typeof i=="object")if(typeof i[Symbol.iterator]=="function"){let o=[];if(i.length>0)for(let e of i)o.push(it(e));return o}else{let o=Object.keys(i),e={};if(o.length>0)for(let t of o)e[t]=it(i[t]);return e}return i}import*as To from"react";import{SVGContainer as ef,Utils as dn}from"telva-core";import{intersectArcBounds as tf,intersectLineSegmentBounds as nf,intersectLineSegmentLineSegment as of}from"telva-intersect";import{Vec as U}from"telva-vec";import*as jd from"react";import{TLShapeUtil as Gg,Utils as Fn}from"telva-core";import{intersectLineSegmentBounds as jg,intersectLineSegmentPolyline as Wg,intersectRayBounds as Ng}from"telva-intersect";import{Vec as On}from"telva-vec";var q=class extends Gg{constructor(){super(...arguments);d(this,"canBind",!1);d(this,"canEdit",!1);d(this,"canClone",!1);d(this,"isAspectRatioLocked",!1);d(this,"hideResizeHandles",!1);d(this,"bindingDistance",16);d(this,"hitTestPoint",(e,t)=>Fn.pointInBounds(t,this.getRotatedBounds(e)));d(this,"hitTestLineSegment",(e,t,n)=>{let r=Fn.getBoundsFromPoints([t,n]),s=this.getBounds(e);return Fn.boundsContain(s,r)||e.rotation?Wg(t,n,Fn.getRotatedCorners(this.getBounds(e))).didIntersect:jg(t,n,this.getBounds(e)).length>0});d(this,"create",e=>(this.refMap.set(e.id,jd.createRef()),this.getShape(e)));d(this,"getCenter",e=>Fn.getBoundsCenter(this.getBounds(e)));d(this,"getExpandedBounds",e=>Fn.expandBounds(this.getBounds(e),this.bindingDistance));d(this,"getBindingPoint",(e,t,n,r,s,l)=>{let a=this.getBounds(e),c=this.getExpandedBounds(e);if(!Fn.pointInBounds(n,c))return;let p=Ng(r,s,c).filter(b=>b.didIntersect).map(b=>b.points[0]);if(!p.length)return;let u=this.getCenter(e),h=p.sort((b,T)=>On.dist(T,r)-On.dist(b,r))[0],g=On.med(n,h),m,f;l?(m=On.dist(n,u)<16/2?u:n,f=0):(On.distanceToLineSegment(n,g,u)<16/2?m=u:m=g,Fn.pointInBounds(n,a)?f=this.bindingDistance:f=Math.max(this.bindingDistance,Fn.getBoundsSides(a).map(b=>On.distanceToLineSegment(b[1][0],b[1][1],n)).sort((b,T)=>b-T)[0]));let v=On.divV(On.sub(m,[c.minX,c.minY]),[c.width,c.height]);return{point:On.clampV(v,0,1),distance:f}});d(this,"mutate",(e,t)=>t);d(this,"transform",(e,t,n)=>w(S({},e),{point:[t.minX,t.minY]}));d(this,"transformSingle",(e,t,n)=>this.transform(e,t,n));d(this,"updateChildren");d(this,"onChildrenChange");d(this,"onHandleChange");d(this,"onRightPointHandle");d(this,"onDoubleClickHandle");d(this,"onDoubleClickBoundsHandle");d(this,"onSessionComplete");d(this,"getSvgElement",(e,t)=>{var s,l,a,c,p;let n=(s=document.getElementById(e.id+"_svg"))==null?void 0:s.cloneNode(!0);if(!n)return;if((c=(a=(l=e.label)==null?void 0:l.trim())==null?void 0:a.length)!=null?c:0>0){let u=e,h=document.createElementNS("http://www.w3.org/2000/svg","g"),g=Ct(e.style),m=bo(e.style.size,e.style.font)*((p=e.style.scale)!=null?p:1),f=bn(e.style.font).slice(1,-1),v=this.getBounds(e),b=Math.max(0,v.width-16),T=Zn(e.label,g,b),y=qn(u.label,m,f,"middle",b,!0);return y.setAttribute("transform",`translate(${v.width/2-b/2}, ${v.height/2-T[1]/2})`),y.setAttribute("fill",J(e.style,t).stroke),y.setAttribute("transform-origin","center center"),h.setAttribute("text-align","center"),h.setAttribute("text-anchor","middle"),h.appendChild(n),h.appendChild(y),h}return n})}};import Ud from"perfect-freehand";import{Utils as Jn}from"telva-core";import{intersectCircleCircle as Ug,intersectCircleLineSegment as Kg}from"telva-intersect";import fe from"telva-vec";function Kd(i,o,e,t){return["M",i[0],i[1],"A",e[2],e[2],0,0,t<0?0:1,o[0],o[1]].join(" ")}function vr(i,o){let{start:e,end:t}=i,n=fe.dist(e.point,t.point),r=fe.med(e.point,t.point),s=n/2*o,l=fe.uni(fe.vec(e.point,t.point));return fe.toFixed(Math.abs(s)<10?r:fe.add(r,fe.mul(fe.per(l),s)))}function _d(i,o,e,t,n,r){let s=Jn.rng(i),l=J(o).strokeWidth,a=n?fe.nudge(e,t,l):e,c=r?fe.nudge(t,e,l):t,p=Ud([a,c],{size:l,thinning:.618+s()*.2,easing:So.easeOutQuad,simulatePressure:!0,streamline:0,last:!0});return Jn.getSvgPathFromStroke(p)}function Yd(i,o,e,t,n,r,s,l,a,c){let p=Jn.rng(i),u=J(o).strokeWidth,h=n?fe.rotWith(e,s,u/a):e,g=r?fe.rotWith(t,s,-(u/a)):t,m=fe.angle(s,h),f=fe.angle(s,g),v=[],b=8+Math.floor(Math.abs(a)/20*1+p()/2);for(let y=0;y<b;y++){let x=c(y/b),I=Jn.lerpAngles(m,f,x);v.push(fe.toFixed(fe.nudgeAtAngle(s,I,l)))}let T=Ud([h,...v,g],{size:1+u,thinning:.618+p()*.2,easing:So.easeOutQuad,simulatePressure:!1,streamline:0,last:!0});return Jn.getSvgPathFromStroke(T)}function $n(i,o,e){return Jn.circleFromThreePoints(i,e,o)}function Ti(i,o,e,t,n){let r=Ug(i,o*.618,e,t).points;if(!r)return B.warn("Could not find an intersection for the arrow head."),{left:i,right:i};let s=n?r[0]:r[1],l=s?fe.nudge(fe.rotWith(s,i,Math.PI/6),i,o*-.382):i,a=s?fe.nudge(fe.rotWith(s,i,-Math.PI/6),i,o*-.382):i;return{left:l,right:a}}function xi(i,o,e){let t=Kg(i,e,i,o).points;if(!t)return B.warn("Could not find an intersection for the arrow head."),{left:i,right:i};let n=t[0],r=n?fe.rotWith(n,i,Math.PI/6):i,s=n?fe.rotWith(n,i,-Math.PI/6):i;return{left:r,right:s}}function Wd(i,o,e,t,n){let{left:r,right:s}=Ti(i,o,e,t,n);return`M ${r} L ${i} ${s}`}function Nd(i,o,e){let{left:t,right:n}=xi(i,o,e);return`M ${t} L ${i} ${n}`}function Xd(i,o,e,t,n,r){let{strokeWidth:s}=J(i,!1),l=fe.dist(o,t),a=Math.min(l/3,s*8),c=[];if(fe.dist(e,fe.toFixed(fe.med(o,t)))<1)c.push(`M ${o} L ${t}`),n&&c.push(Nd(o,t,a)),r&&c.push(Nd(t,o,a));else{let u=$n(o,e,t),h=[u[0],u[1]],g=u[2],m=vo(h,g,o,t);c.push(`M ${o} A ${g} ${g} 0 0 ${m>0?"1":"0"} ${t}`),n&&c.push(Wd(o,a,h,g,m<0)),r&&c.push(Wd(t,a,h,g,m>=0))}return c.join(" ")}function Tr(i,o,e){if(fe.dist2(o,fe.med(i,e))<=4)return[i,e];let t=[],n=$n(i,o,e),r=[n[0],n[1]],s=n[2],l=fe.angle(r,i),a=fe.angle(r,e);for(let c=0;c<20;c++){let p=c/19,u=Jn.lerpAngles(l,a,p);t.push(fe.nudgeAtAngle(r,u,s))}return t}function Zd(i,o,e){if(e===i||e===o)return!0;let t=Math.PI*2,n=(o-i+t)%t,r=(e-i+t)%t;return n<=Math.PI!=r>n}function vo(i,o,e,t){let n=Jn.getSweep(i,e,t);return o*(2*Math.PI)*(n/(2*Math.PI))}import*as Qd from"react";import{Utils as Jd}from"telva-core";import Yg from"telva-vec";import{jsx as qd,jsxs as _g}from"react/jsx-runtime";function $o({left:i,middle:o,right:e,stroke:t,strokeWidth:n}){return _g("g",{children:[qd("path",{className:"tv-stroke-hitarea",d:`M ${i} L ${o} ${e}`}),qd("path",{d:`M ${i} L ${o} ${e}`,fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"})]})}import{Fragment as Xg,jsx as ki,jsxs as Zg}from"react/jsx-runtime";var ec=Qd.memo(function({id:o,style:e,start:t,bend:n,end:r,arrowBend:s,decorationStart:l,decorationEnd:a,isDraw:c,isDarkMode:p}){let u=Yg.dist(t,r);if(u<2)return null;let h=J(e,p),{strokeWidth:g}=h,m=1+g*1.618,f=$n(t,n,r),v=[f[0],f[1]],b=f[2],T=vo(v,b,t,r),y=Jd.rng(o),x=So[y()>0?"easeInOutSine":"easeInOutCubic"],I=c?Yd(o,e,t,r,l,a,v,b,T,x):Kd(t,r,f,s),{strokeDasharray:k,strokeDashoffset:R}=Jd.getPerfectDashProps(Math.abs(T),m,e.dash,2,!1),C=Math.min(u/3,g*8),E=l?Ti(t,C,v,b,T<0):null,M=a?Ti(r,C,v,b,T>=0):null;return Zg(Xg,{children:[ki("path",{className:"tv-stroke-hitarea",d:I}),ki("path",{d:I,fill:c?h.stroke:"none",stroke:h.stroke,strokeWidth:c?0:m,strokeDasharray:k,strokeDashoffset:R,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}),E&&ki($o,{left:E.left,middle:t,right:E.right,stroke:h.stroke,strokeWidth:m}),M&&ki($o,{left:M.left,middle:r,right:M.right,stroke:h.stroke,strokeWidth:m})]})});import*as tc from"react";import{Utils as qg}from"telva-core";import ia from"telva-vec";import{Fragment as Jg,jsx as Ci,jsxs as Qg}from"react/jsx-runtime";var nc=tc.memo(function({id:o,style:e,start:t,end:n,decorationStart:r,decorationEnd:s,isDraw:l,isDarkMode:a}){let c=ia.dist(t,n);if(c<2)return null;let p=J(e,a),{strokeWidth:u}=p,h=1+u*1.618,g=l?_d(o,e,t,n,r,s):"M"+ia.toFixed(t)+"L"+ia.toFixed(n),{strokeDasharray:m,strokeDashoffset:f}=qg.getPerfectDashProps(c,u*1.618,e.dash,2,!1),v=Math.min(c/3,u*8),b=r?xi(t,n,v):null,T=s?xi(n,t,v):null;return Qg(Jg,{children:[Ci("path",{className:"tv-stroke-hitarea",d:g}),Ci("path",{d:g,fill:p.stroke,stroke:p.stroke,strokeWidth:l?h/2:h,strokeDasharray:m,strokeDashoffset:f,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"stroke"}),b&&Ci($o,{left:b.left,middle:t,right:b.right,stroke:p.stroke,strokeWidth:h}),T&&Ci($o,{left:T.left,middle:n,right:T.right,stroke:p.stroke,strokeWidth:h})]})});import{Fragment as sf,jsx as Gn,jsxs as wi}from"react/jsx-runtime";var Ii=class extends q{constructor(){super(...arguments);d(this,"type","arrow");d(this,"hideBounds",!0);d(this,"canEdit",!0);d(this,"pathCache",new WeakMap);d(this,"getShape",e=>{var t,n,r,s;return S({id:"id",type:"arrow",name:"Arrow",parentId:"page",childIndex:1,point:[0,0],rotation:0,bend:0,handles:{start:S({id:"start",index:0,point:[0,0],canBind:!0},(t=e.handles)==null?void 0:t.start),end:S({id:"end",index:1,point:[1,1],canBind:!0},(n=e.handles)==null?void 0:n.end),bend:S({id:"bend",index:2,point:[.5,.5]},(r=e.handles)==null?void 0:r.bend)},decorations:(s=e.decorations)!=null?s:{end:"arrow"},style:S(w(S({},He),{isFilled:!1}),e.style),label:"",labelPoint:[.5,.5]},e)});d(this,"Component",q.Component(({shape:e,isEditing:t,isGhost:n,meta:r,events:s,onShapeChange:l,onShapeBlur:a},c)=>{var A,K,re;let{id:p,label:u="",handles:{start:h,bend:g,end:m},decorations:f={},style:v}=e,b=(K=(A=u==null?void 0:u.trim())==null?void 0:A.length)!=null?K:0>0,T=U.dist(g.point,U.toFixed(U.med(h.point,m.point)))<1,y=Ct(v),x=J(v,r.isDarkMode),I=b||t?Zn(u,y):[0,0],k=this.getBounds(e),R=To.useMemo(()=>{let{start:F,bend:ee,end:pe}=e.handles;if(T)return U.dist(F.point,pe.point);let he=$n(F.point,ee.point,pe.point),De=he.slice(0,2),pt=he[2],Ze=vo(De,pt,F.point,pe.point);return Math.abs(Ze)},[e.handles]),C=Math.max(.5,Math.min(1,Math.max(R/(I[1]+128),R/(I[0]+128)))),E=To.useMemo(()=>{let F=this.getBounds(e);return U.sub(e.handles.bend.point,U.toFixed([F.width/2,F.height/2]))},[e,C]),M=To.useCallback(F=>{l==null||l({id:p,label:F})},[l]),L=T?nc:ec;return wi(rf,w(S({ref:c},s),{children:[Gn(Qn,{font:y,text:u,color:(re=v.labelColor)!=null?re:x.stroke,background:v.labelBackground,textGradient:v.textGradient,offsetX:E[0],offsetY:E[1],scale:C,isEditing:t,onChange:M,onBlur:a}),wi(ef,{id:e.id+"_svg",children:[Gn("defs",{children:wi("mask",{id:e.id+"_clip",children:[Gn("rect",{x:-100,y:-100,width:k.width+200,height:k.height+200,fill:"white"}),Gn("rect",{x:k.width/2-I[0]/2*C+E[0],y:k.height/2-I[1]/2*C+E[1],width:I[0]*C,height:I[1]*C,rx:4*C,ry:4*C,fill:"black",opacity:1})]})}),Gn("g",{pointerEvents:"none",opacity:n?.3:x.opacity,mask:b||t?`url(#${e.id}_clip)`:"",children:Gn(L,{id:p,style:v,start:h.point,end:m.point,bend:g.point,arrowBend:e.bend,decorationStart:f==null?void 0:f.start,decorationEnd:f==null?void 0:f.end,isDraw:v.dash==="draw",isDarkMode:r.isDarkMode})})]})]}))}));d(this,"Indicator",q.Indicator(({shape:e,bounds:t})=>{var b,T;let{style:n,decorations:r,label:s,handles:{start:l,bend:a,end:c}}=e,p=(T=(b=s==null?void 0:s.trim())==null?void 0:b.length)!=null?T:0>0,u=Ct(n),h=p?Zn(s,u):[0,0],g=U.dist(a.point,U.toFixed(U.med(l.point,c.point)))<1,m=To.useMemo(()=>{let{start:y,bend:x,end:I}=e.handles;if(g)return U.dist(y.point,I.point);let k=$n(y.point,x.point,I.point),R=k.slice(0,2),C=k[2],E=vo(R,C,y.point,I.point);return Math.abs(E)},[e.handles]),f=Math.max(.5,Math.min(1,Math.max(m/(h[1]+128),m/(h[0]+128)))),v=To.useMemo(()=>{let y=this.getBounds(e);return U.sub(e.handles.bend.point,[y.width/2,y.height/2])},[e,f]);return wi(sf,{children:[p&&Gn(zd,{id:e.id,scale:f,offset:v,bounds:t,labelSize:h}),Gn("path",{d:Xd(n,l.point,a.point,c.point,r==null?void 0:r.start,r==null?void 0:r.end),mask:p?`url(#${e.id}_clip)`:""}),p&&Gn("rect",{x:t.width/2-h[0]/2*f+v[0],y:t.height/2-h[1]/2*f+v[1],width:h[0]*f,height:h[1]*f,rx:4*f,ry:4*f,fill:"transparent"})]})}));d(this,"getBounds",e=>{let t=dn.getFromCache(this.boundsCache,e,()=>{let{handles:{start:n,bend:r,end:s}}=e;return dn.getBoundsFromPoints(Tr(n.point,r.point,s.point))});return dn.translateBounds(t,e.point)});d(this,"getRotatedBounds",e=>{let{handles:{start:t,bend:n,end:r}}=e,s=Tr(t.point,n.point,r.point),{minX:l,minY:a,maxX:c,maxY:p}=dn.getBoundsFromPoints(s);return e.rotation!==0&&(s=s.map(u=>U.rotWith(u,[(l+c)/2,(a+p)/2],e.rotation||0))),dn.translateBounds(dn.getBoundsFromPoints(s),e.point)});d(this,"getCenter",e=>{let{start:t,end:n}=e.handles;return U.add(e.point,U.med(t.point,n.point))});d(this,"shouldRender",(e,t)=>t.decorations!==e.decorations||t.handles!==e.handles||t.style!==e.style||t.label!==e.label);d(this,"hitTestPoint",(e,t)=>{let{handles:{start:n,bend:r,end:s}}=e,l=U.sub(t,e.point),a=Tr(n.point,r.point,s.point);for(let c=1;c<a.length;c++)if(U.distanceToLineSegment(a[c-1],a[c],l)<1)return!0;return!1});d(this,"hitTestLineSegment",(e,t,n)=>{let{handles:{start:r,bend:s,end:l}}=e,a=U.sub(t,e.point),c=U.sub(n,e.point),p=Tr(r.point,s.point,l.point);for(let u=1;u<p.length;u++)if(of(p[u-1],p[u],a,c).didIntersect)return!0;return!1});d(this,"hitTestBounds",(e,t)=>{let{start:n,end:r,bend:s}=e.handles,l=U.add(e.point,n.point),a=U.add(e.point,r.point);if(dn.pointInBounds(l,t)||dn.pointInBounds(a,t))return!0;if(U.isEqual(U.med(n.point,r.point),s.point))return nf(l,a,t).length>0;{let[c,p,u]=$n(n.point,s.point,r.point),h=U.add(e.point,[c,p]);return tf(h,u,l,a,t).length>0}});d(this,"transform",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>{let l=this.getBounds(n),a=["start","end"],c=S({},n.handles);a.forEach(h=>{if(h==="bend")return;let[g,m]=c[h].point,f=g/l.width,v=m/l.height;c[h]=w(S({},c[h]),{point:[t.width*(r<0?1-f:f),t.height*(s<0?1-v:v)]})});let p=r>0&&s<0||r<0&&s>0?-n.bend:n.bend,u=vr(c,p);return c.bend.point=u,{point:U.toFixed([t.minX,t.minY]),handles:c,bend:p}});d(this,"onDoubleClickHandle",(e,t)=>{var n,r;switch(t){case"bend":return{bend:0,handles:w(S({},e.handles),{bend:w(S({},e.handles.bend),{point:vr(e.handles,e.bend)})})};case"start":return{decorations:w(S({},e.decorations),{start:(n=e.decorations)!=null&&n.start?void 0:"arrow"})};case"end":return{decorations:w(S({},e.decorations),{end:(r=e.decorations)!=null&&r.end?void 0:"arrow"})}}return this});d(this,"onHandleChange",(e,t)=>{let n=dn.deepMerge(e.handles,t),r=e.bend;if(n=dn.deepMerge(n,{start:{point:U.toFixed(n.start.point)},end:{point:U.toFixed(n.end.point)}}),U.isEqual(n.start.point,n.end.point))return;if("bend"in t){let{start:p,end:u,bend:h}=n,g=U.dist(p.point,u.point),m=U.med(p.point,u.point),f=U.angle(p.point,u.point),v=U.uni(U.vec(p.point,u.point)),b=U.add(m,U.mul(U.per(v),g)),T=U.sub(m,U.mul(U.per(v),g)),y=U.nearestPointOnLineSegment(b,T,h.point,!0),I=U.dist(m,y)/(g/2);r=dn.clamp(I,-.99,.99);let k=U.angle(p.point,y);U.isEqual(m,vr(n,r))?r=0:Zd(f,f+Math.PI,k)&&(r*=-1)}let s={point:e.point,bend:r,handles:w(S({},n),{bend:w(S({},n.bend),{point:vr(n,r)})})},l=e.point,a=this.getBounds(S({},s)),c=U.sub([a.minX,a.minY],l);return U.isEqual(c,[0,0])||(Object.values(s.handles).forEach(p=>{p.point=U.toFixed(U.sub(p.point,c))}),s.point=U.toFixed(U.add(s.point,c))),s});d(this,"getSvgElement",(e,t)=>{var s,l,a,c,p;let n=(s=document.getElementById(e.id+"_svg"))==null?void 0:s.cloneNode(!0);if(!n)return;if((c=(a=(l=e.label)==null?void 0:l.trim())==null?void 0:a.length)!=null?c:0>0){let u=e,h=document.createElementNS("http://www.w3.org/2000/svg","g"),g=Ct(e.style),m=Zn(e.label,g),f=bo(e.style.size,e.style.font)*((p=e.style.scale)!=null?p:1),v=bn(e.style.font).slice(1,-1),b=qn(u.label,f,v,"start",m[0],!1),T,{start:y,bend:x,end:I}=e.handles;if(U.dist(x.point,U.toFixed(U.med(y.point,I.point)))<1)T=U.dist(y.point,I.point);else{let A=$n(y.point,x.point,I.point),K=A.slice(0,2),re=A[2],F=vo(K,re,y.point,I.point);T=Math.abs(F)}let R=Math.max(.5,Math.min(1,Math.max(T/(m[1]+128),T/(m[0]+128)))),C=this.getBounds(e),E=U.sub(e.handles.bend.point,[C.width/2,C.height/2]),M=C.width/2-m[0]/2*R+E[0],L=C.height/2-m[1]/2*R+E[1];return b.setAttribute("transform",`translate(${M}, ${L})`),b.setAttribute("fill",J(e.style,t).stroke),b.setAttribute("transform-origin","center center"),h.setAttribute("text-align","center"),h.setAttribute("text-anchor","middle"),h.appendChild(n),h.appendChild(b),h}return n})}},rf=P("div",{width:"100%",height:"100%"});import*as Yt from"react";import{SVGContainer as ca,Utils as st}from"telva-core";import{intersectBoundsBounds as pf,intersectBoundsPolyline as dc,intersectLineSegmentBounds as uf,intersectLineSegmentLineSegment as hf}from"telva-intersect";import{Vec as cn}from"telva-vec";import{jsx as xo}from"react/jsx-runtime";function ht(i,o){var s,l,a;let e=o.gradient;if(!e||!o.isFilled||!e.stops||e.stops.length<2)return{defs:null,gradFill:null};let t=`grad-${i}`,n=e.stops.map((c,p)=>xo("stop",{offset:`${c.position}%`,stopColor:c.color,stopOpacity:c.opacity},p));if(e.type==="linear"){let p=(((s=e.angle)!=null?s:90)-90)*Math.PI/180,u=Math.cos(p),h=Math.sin(p),g=50-u*50,m=50-h*50,f=50+u*50,v=50+h*50;return{defs:xo("defs",{children:xo("linearGradient",{id:t,x1:`${g}%`,y1:`${m}%`,x2:`${f}%`,y2:`${v}%`,gradientUnits:"objectBoundingBox",children:n})}),gradFill:`url(#${t})`}}if(e.type==="radial"){let c=((l=e.centerX)!=null?l:50)/100,p=((a=e.centerY)!=null?a:50)/100;return{defs:xo("defs",{children:xo("radialGradient",{id:t,cx:c,cy:p,r:"0.5",gradientUnits:"objectBoundingBox",children:n})}),gradFill:`url(#${t})`}}return{defs:xo("defs",{children:xo("linearGradient",{id:t,x1:"0%",y1:"0%",x2:"100%",y2:"100%",gradientUnits:"objectBoundingBox",children:n})}),gradFill:`url(#${t})`}}import{getStrokeOutlinePoints as af,getStrokePoints as oc}from"perfect-freehand";import{Utils as aa}from"telva-core";import sa from"telva-vec";var lf={easing:i=>Math.sin(i*Math.PI/2),simulatePressure:!0},df={easing:i=>i*i,simulatePressure:!1};function la(i){let o=J(i.style);return w(S({size:1+o.strokeWidth*1.5,thinning:.7,streamline:.35,smoothing:.5},i.points[1][2]===.5?lf:df),{last:i.isComplete})}function rc(i){return i.points.length<2?"":aa.getSvgPathFromStroke(oc(i.points,la(i)).map(o=>o.point))}function ic(i,o){return oc(i.points,o)}function sc(i){if(i.points.length<2)return"";let o=la(i),e=ic(i,o);return aa.getSvgPathFromStroke(af(e,o))}function da(i){let{points:o}=i;if(o.length<2)return"M 0 0 L 0 0";let e=la(i),t=ic(i,e),n=o[o.length-1];return sa.isEqual(t[0].point,n)||t.push({point:n}),aa.getSvgPathFromStrokePoints(t)}function ac(i){let{points:o}=i;if(o.length<2)return"M 0 0 L 0 0";let e=Pi(o,3);if(e.length<2)return`M ${o[0][0]} ${o[0][1]} L ${o[o.length-1][0]} ${o[o.length-1][1]}`;let t=`M ${e[0][0].toFixed(2)} ${e[0][1].toFixed(2)}`;for(let n=1;n<e.length;n++)t+=` L ${e[n][0].toFixed(2)} ${e[n][1].toFixed(2)}`;return t}function lc(i){let{points:o}=i;if(o.length<3)return"";let e=Pi(o,3);if(e.length<3)return"";let t=`M ${e[0][0].toFixed(2)} ${e[0][1].toFixed(2)}`;for(let n=1;n<e.length;n++)t+=` L ${e[n][0].toFixed(2)} ${e[n][1].toFixed(2)}`;return t+=" Z",t}function Pi(i,o){if(i.length<=2)return i;let e=0,t=0,n=i[0],r=i[i.length-1];for(let s=1;s<i.length-1;s++){let l=cf(i[s],n,r);l>e&&(e=l,t=s)}if(e>o){let s=Pi(i.slice(0,t+1),o),l=Pi(i.slice(t),o);return[...s.slice(0,-1),...l]}return[n,r]}function cf(i,o,e){let t=e[0]-o[0],n=e[1]-o[1],r=Math.sqrt(t*t+n*n);if(r===0)return sa.dist(i,o);let s=((i[0]-o[0])*t+(i[1]-o[1])*n)/(r*r),l=[o[0]+s*t,o[1]+s*n];return sa.dist(i,l)}import{jsx as _t,jsxs as Go}from"react/jsx-runtime";var Ri=class extends q{constructor(){super(...arguments);d(this,"type","draw");d(this,"pointsBoundsCache",new WeakMap([]));d(this,"shapeBoundsCache",new Map);d(this,"rotatedCache",new WeakMap([]));d(this,"pointCache",{});d(this,"canClone",!0);d(this,"getShape",e=>st.deepMerge({id:"id",type:"draw",name:"Draw",parentId:"page",childIndex:1,point:[0,0],rotation:0,style:He,points:[],isComplete:!1},e));d(this,"Component",q.Component(({shape:e,meta:t,isSelected:n,isGhost:r,events:s},l)=>{var _e;let{points:a,style:c,isComplete:p}=e,u=t.canvasMode==="straight",h=t.nodeEditingId===e.id,g=N(),m=Yt.useRef(null),[f,v]=Yt.useState(null),b=Yt.useCallback((Se,$)=>cn.sub(g.getPagePoint([Se,$]),e.point),[g,e.point]),T=Yt.useCallback(Se=>{if(Se.length===0)return;let $=Math.min(...Se.map(G=>G[0])),ie=Math.min(...Se.map(G=>G[1])),ae=Se.map(([G,Y,te])=>[+(G-$).toFixed(2),+(Y-ie).toFixed(2),te!=null?te:.5]),_=cn.add(e.point,[$,ie]);g.updateShapes({id:e.id,point:_,points:ae})},[g,e.id,e.point]),y=Yt.useMemo(()=>u?lc(e):rc(e),[a,c.size,u,c.strokeWidthOverride]),x=Yt.useMemo(()=>u?ac(e):c.dash==="draw"?sc(e):da(e),[a,c.size,c.dash,p,u,c.strokeWidthOverride]),I=J(c,t.isDarkMode),{stroke:k,fill:R,strokeWidth:C,opacity:E}=I,{defs:M,gradFill:L}=ht(e.id,c),A=L!=null?L:R,K=(_e=g.zoom)!=null?_e:1,re=Yt.useMemo(()=>{if(!h||a.length<1)return null;let Se=5/K,$=3.5/K,ie=a.map((_,G)=>_t("circle",{cx:_[0],cy:_[1],r:f===G?Se*1.4:Se,fill:f===G?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:1.5/K,style:{cursor:"move",pointerEvents:"all"},onPointerEnter:()=>v(G),onPointerLeave:()=>v(null),onPointerDown:Y=>{Y.stopPropagation(),Y.currentTarget.setPointerCapture(Y.pointerId),m.current={nodeIdx:G}},onPointerMove:Y=>{var Ee;if(!m.current||m.current.nodeIdx!==G)return;Y.stopPropagation();let te=b(Y.clientX,Y.clientY),H=[...a];H[G]=[te[0],te[1],(Ee=a[G][2])!=null?Ee:.5],g.patchState({document:{pages:{[g.currentPageId]:{shapes:{[e.id]:{points:H}}}}}})},onPointerUp:Y=>{var Ee;if(!m.current)return;Y.stopPropagation();let te=b(Y.clientX,Y.clientY),H=[...a];H[G]=[te[0],te[1],(Ee=a[G][2])!=null?Ee:.5],m.current=null,T(H)}},`n-${G}`)),ae=a.slice(0,-1).map((_,G)=>{let Y=a[G+1],te=(_[0]+Y[0])/2,H=(_[1]+Y[1])/2;return _t("circle",{cx:te,cy:H,r:$,fill:"white",stroke:"#0D99FF",strokeWidth:1/K,strokeDasharray:`${2/K} ${2/K}`,style:{cursor:"crosshair",pointerEvents:"all"},onPointerDown:Ee=>{Ee.stopPropagation();let Vt=[te,H,.5],Nt=[...a.slice(0,G+1),Vt,...a.slice(G+1)];g.updateShapes({id:e.id,points:Nt})}},`m-${G}`)});return Go("g",{style:{pointerEvents:"none"},children:[a.slice(0,-1).map((_,G)=>_t("line",{x1:_[0],y1:_[1],x2:a[G+1][0],y2:a[G+1][1],stroke:"#0D99FF",strokeWidth:1/K,strokeOpacity:.4,pointerEvents:"none"},`l-${G}`)),ae,ie]})},[h,a,K,f,e.id,g.currentPageId]),F=this.getBounds(e);if(F.width<=C/2&&F.height<=C/2){let Se=1+C;return Go(ca,w(S({ref:l,id:e.id+"_svg"},s),{children:[M,_t("circle",{r:Se,fill:k,stroke:k,pointerEvents:"all",opacity:r?.3:E})]}))}let pe=c.isFilled&&a.length>3&&cn.dist(a[0],a[a.length-1])<C*2,he=h?{overflow:"visible"}:void 0;if(!u&&e.style.dash==="draw")return Go(ca,w(S({ref:l,id:e.id+"_svg"},s),{style:he,children:[M,Go("g",{opacity:r?.3:E,children:[_t("path",{className:pe||n?"tv-fill-hitarea":"tv-stroke-hitarea",d:x}),pe&&_t("path",{d:y,stroke:"none",fill:A,strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"}),_t("path",{d:x,fill:k,stroke:k,strokeWidth:C/2,strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"})]}),re]}));let De=u?"none":{["draw"]:"none",["solid"]:"none",["dotted"]:`0.1 ${C*4}`,["dashed"]:`${C*4} ${C*4}`}[c.dash],pt=u?"none":{["draw"]:"none",["solid"]:"none",["dotted"]:"0",["dashed"]:"0"}[c.dash],Ze=1+C*1.5;return Go(ca,w(S({ref:l,id:e.id+"_svg"},s),{style:he,children:[M,Go("g",{opacity:r?.3:E,children:[_t("path",{className:pe&&n?"tv-fill-hitarea":"tv-stroke-hitarea",d:x}),_t("path",{d:x,fill:pe?A:"none",stroke:"none",strokeWidth:Math.min(4,C*2),strokeLinejoin:u?"miter":"round",strokeLinecap:u?"square":"round",pointerEvents:"none"}),_t("path",{d:x,fill:"none",stroke:k,strokeWidth:Ze,strokeDasharray:De,strokeDashoffset:pt,strokeLinejoin:u?"miter":"round",strokeLinecap:u?"square":"round",pointerEvents:"none"})]}),re]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{points:t}=e,n=Yt.useMemo(()=>da(e),[t,e.style.size,e.style.strokeWidthOverride]),r=this.getBounds(e);return r.width<4&&r.height<4?_t("circle",{x:r.width/2,y:r.height/2,r:1}):_t("path",{d:n})}));d(this,"transform",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>{let l=st.getFromCache(this.boundsCache,n,()=>st.getBoundsFromPoints(n.points)),a=n.points.map(([u,h,g])=>[t.width*(r<0?1-u/l.width:u/l.width),t.height*(s<0?1-h/l.height:h/l.height),g]),c=st.getBoundsFromPoints(e.points),p=cn.sub([t.minX,t.minY],[c.minX,c.minY]);return{points:a,point:p}});d(this,"getBounds",e=>{let t=!this.pointsBoundsCache.has(e.points),n=this.pointCache[e.id]!==e.point;if(t){let r=st.getBoundsFromPoints(e.points);this.pointsBoundsCache.set(e.points,r),this.shapeBoundsCache.set(e.id,st.translateBounds(r,e.point)),this.pointCache[e.id]=e.point}else n&&!t&&(this.pointCache[e.id]=e.point,this.shapeBoundsCache.set(e.id,st.translateBounds(this.pointsBoundsCache.get(e.points),e.point)));return this.shapeBoundsCache.get(e.id)});d(this,"shouldRender",(e,t)=>t.points!==e.points||t.style!==e.style||t.isComplete!==e.isComplete);d(this,"hitTestPoint",(e,t)=>{let n=cn.sub(t,e.point);return st.pointInPolyline(n,e.points)});d(this,"hitTestLineSegment",(e,t,n)=>{let{points:r,point:s}=e,l=cn.sub(t,s),a=cn.sub(n,s),c=this.getBounds(e);if(c.width<8&&c.height<8)return cn.distanceToLineSegment(t,n,st.getBoundsCenter(c))<5;if(uf(l,a,c)){for(let p=1;p<r.length;p++)if(hf(r[p-1],r[p],l,a).didIntersect)return!0}return!1});d(this,"hitTestBounds",(e,t)=>{if(!e.rotation){let s=this.getBounds(e);return st.boundsContain(t,s)||(st.boundsContain(s,t)||pf(s,t).length>0)&&dc(st.translateBounds(t,cn.neg(e.point)),e.points).length>0}let n=this.getRotatedBounds(e),r=st.getFromCache(this.rotatedCache,e,()=>{let s=st.getBoundsCenter(st.getBoundsFromPoints(e.points));return e.points.map(l=>cn.rotWith(l,s,e.rotation||0))});return st.boundsContain(t,n)||dc(st.translateBounds(t,cn.neg(e.point)),r).length>0})}};import*as bc from"react";import{SVGContainer as vf,Utils as jn}from"telva-core";import{intersectEllipseBounds as Tf,intersectLineSegmentEllipse as ua,intersectRayEllipse as xf}from"telva-intersect";import{Vec as wt}from"telva-vec";import*as uc from"react";import{Utils as cc}from"telva-core";import{Fragment as mf,jsx as pc,jsxs as gf}from"react/jsx-runtime";var hc=uc.memo(function({id:o,radius:e,style:t,isSelected:n,isDarkMode:r}){let{stroke:s,strokeWidth:l,fill:a}=J(t,r),{defs:c,gradFill:p}=ht(o,t),u=p!=null?p:a,h=1+l*1.618,g=Math.max(0,e[0]-h/2),m=Math.max(0,e[1]-h/2),f=cc.perimeterOfEllipse(g,m),{strokeDasharray:v,strokeDashoffset:b}=cc.getPerfectDashProps(f<64?f*2:f,l*1.618,t.dash,4);return gf(mf,{children:[c,pc("ellipse",{className:t.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",cx:e[0],cy:e[1],rx:e[0],ry:e[1]}),pc("ellipse",{cx:e[0],cy:e[1],rx:g,ry:m,fill:u,stroke:s,strokeWidth:h,strokeDasharray:v,strokeDashoffset:b,pointerEvents:"none",strokeLinecap:"round",strokeLinejoin:"round"})]})});import*as fc from"react";import{getStrokeOutlinePoints as ff,getStrokePoints as Sf}from"perfect-freehand";import{Utils as jo}from"telva-core";function mc(i,o,e){let{strokeWidth:t}=J(e),n=jo.rng(i),r=o[0]+n()*t*2,s=o[1]+n()*t*2,l=jo.perimeterOfEllipse(r,s),a=[],c=Math.PI+Math.PI*n(),p=Math.abs(n()),u=Math.max(16,l/10);for(let h=0;h<u;h++){let g=So.easeInOutSine(h/(u+1)),m=c*2+Math.PI*(2+p)*g,f=Math.cos(m),v=Math.sin(m);a.push([r*f+o[0],s*v+o[1],g+.5+n()/2])}return Sf(a,{size:1+t*2,thinning:.618,end:{taper:l/8},start:{taper:l/12},streamline:0,simulatePressure:!0})}function gc(i,o,e){let{strokeWidth:t}=J(e),n=jo.rng(i),r=o[0]+n()*t*2,s=o[1]+n()*t*2,l=jo.perimeterOfEllipse(r,s);return jo.getSvgPathFromStroke(ff(mc(i,o,e),{size:2+t*2,thinning:.618,end:{taper:l/8},start:{taper:l/12},streamline:0,simulatePressure:!0}))}function Di(i,o,e){return jo.getSvgPathFromStrokePoints(mc(i,o,e))}import{Fragment as yf,jsx as pa,jsxs as bf}from"react/jsx-runtime";var Sc=fc.memo(function({id:o,radius:e,style:t,isSelected:n,isDarkMode:r}){let{stroke:s,strokeWidth:l,fill:a}=J(t,r),{defs:c,gradFill:p}=ht(o,t),u=p!=null?p:a,h=gc(o,e,t);return bf(yf,{children:[c,pa("ellipse",{className:t.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",cx:e[0],cy:e[1],rx:e[0],ry:e[1]}),t.isFilled&&pa("path",{d:Di(o,e,t),stroke:"none",fill:u,pointerEvents:"none"}),pa("path",{d:h,fill:s,stroke:s,strokeWidth:l,pointerEvents:"none",strokeLinecap:"round",strokeLinejoin:"round"})]})});import{jsx as xr,jsxs as yc}from"react/jsx-runtime";var Ei=class extends q{constructor(){super(...arguments);d(this,"type","ellipse");d(this,"canBind",!0);d(this,"canClone",!0);d(this,"canEdit",!0);d(this,"getShape",e=>jn.deepMerge({id:"id",type:"ellipse",name:"Ellipse",parentId:"page",childIndex:1,point:[0,0],radius:[1,1],rotation:0,style:He,label:"",labelPoint:[.5,.5]},e));d(this,"Component",q.Component(({shape:e,isGhost:t,isSelected:n,isBinding:r,isEditing:s,meta:l,bounds:a,events:c,onShapeChange:p,onShapeBlur:u},h)=>{var L;let{id:g,radius:m,style:f,label:v="",labelPoint:b=Ho}=e,T=Ct(e.style),y=J(f,l.isDarkMode),x=y.strokeWidth,I=1+x*1.618,k=Math.max(0,m[0]-I/2),R=Math.max(0,m[1]-I/2),E=!(l.canvasMode==="straight")&&f.dash==="draw"?Sc:hc,M=bc.useCallback(A=>p==null?void 0:p({id:g,label:A}),[p]);return yc(kf,w(S({ref:h},c),{children:[xr(Qn,{isEditing:s,onChange:M,onBlur:u,font:T,text:v,color:(L=f.labelColor)!=null?L:y.stroke,background:f.labelBackground,textGradient:f.textGradient,offsetX:(b[0]-.5)*a.width,offsetY:(b[1]-.5)*a.height,width:Math.max(0,a.width*.707-16)}),yc(vf,{id:e.id+"_svg",opacity:t?.3:y.opacity,children:[r&&xr("ellipse",{className:"tv-binding-indicator",cx:a.width/2,cy:a.height/2,rx:Math.max(0,a.width/2),ry:Math.max(0,a.height/2),strokeWidth:y.strokeWidth}),xr(E,{id:g,style:f,radius:m,isSelected:n,isDarkMode:l.isDarkMode})]})]}))}));d(this,"Indicator",q.Indicator(({shape:e,meta:t})=>{let{id:n,radius:r,style:s}=e,a=J(s).strokeWidth,c=1+a*1.618,p=Math.max(0,r[0]-c/2),u=Math.max(0,r[1]-c/2);return!((t==null?void 0:t.canvasMode)==="straight")&&s.dash==="draw"?xr("path",{d:Di(n,r,s)}):xr("ellipse",{cx:r[0],cy:r[1],rx:p,ry:u})}));d(this,"hitTestPoint",(e,t)=>jn.pointInBounds(t,this.getRotatedBounds(e))&&jn.pointInEllipse(t,this.getCenter(e),e.radius[0],e.radius[1],e.rotation||0));d(this,"hitTestLineSegment",(e,t,n)=>ua(t,n,this.getCenter(e),e.radius[0],e.radius[1],e.rotation||0).didIntersect);d(this,"getBounds",e=>jn.getFromCache(this.boundsCache,e,()=>jn.getRotatedEllipseBounds(e.point[0],e.point[1],e.radius[0],e.radius[1],0)));d(this,"getRotatedBounds",e=>jn.getRotatedEllipseBounds(e.point[0],e.point[1],e.radius[0],e.radius[1],e.rotation));d(this,"hitTestBounds",(e,t)=>{let n=this.getBounds(e);return jn.boundsContained(n,t)||Tf(this.getCenter(e),e.radius[0],e.radius[1],e.rotation||0,t).length>0});d(this,"shouldRender",(e,t)=>t.radius!==e.radius||t.style!==e.style||t.label!==e.label);d(this,"getCenter",e=>wt.add(e.point,e.radius));d(this,"getBindingPoint",(e,t,n,r,s,l)=>{{let a=this.getExpandedBounds(e),c=this.getCenter(e),p,u;if(!jn.pointInEllipse(n,c,e.radius[0]+this.bindingDistance,e.radius[1]+this.bindingDistance))return;if(l)wt.dist(n,this.getCenter(e))<12?p=[.5,.5]:p=wt.divV(wt.sub(n,[a.minX,a.minY]),[a.width,a.height]),u=0;else{let h=xf(r,s,c,e.radius[0],e.radius[1],e.rotation||0).points.sort((m,f)=>wt.dist(m,r)-wt.dist(f,r))[0];if(h||(h=ua(n,c,c,e.radius[0],e.radius[1],e.rotation||0).points.sort((m,f)=>wt.dist(m,n)-wt.dist(f,n))[0]),!h)return;let g=wt.med(n,h);if(wt.distanceToLineSegment(n,g,this.getCenter(e))<12?p=[.5,.5]:p=wt.divV(wt.sub(g,[a.minX,a.minY]),[a.width,a.height]),jn.pointInEllipse(n,c,e.radius[0],e.radius[1],e.rotation||0))u=this.bindingDistance/2;else{let m=ua(n,c,c,e.radius[0],e.radius[1],e.rotation||0).points[0];if(!m)return;u=Math.max(this.bindingDistance/2,wt.dist(n,m))}}return{point:p,distance:u}}});d(this,"transform",(e,t,{scaleX:n,scaleY:r,initialShape:s})=>{let{rotation:l=0}=s;return{point:[t.minX,t.minY],radius:[t.width/2,t.height/2],rotation:n<0&&r>=0||r<0&&n>=0?-(l||0):l||0}});d(this,"transformSingle",(e,t)=>({point:wt.toFixed([t.minX,t.minY]),radius:wt.div([t.width,t.height],2)}))}},kf=P("div",{width:"100%",height:"100%"});import{SVGContainer as Cf,Utils as wf}from"telva-core";import{jsx as Wo,jsxs as Tc}from"react/jsx-runtime";var Bi=class extends q{constructor(){super(...arguments);d(this,"type","group");d(this,"canBind",!0);d(this,"getShape",e=>wf.deepMerge({id:"id",type:"group",name:"Group",parentId:"page",childIndex:1,point:[0,0],size:[100,100],rotation:0,children:[],style:He},e));d(this,"Component",q.Component(({shape:e,isBinding:t,isGhost:n,isHovered:r,isSelected:s,events:l},a)=>{let{id:c,size:p}=e,u=2,h=Math.max(0,p[0]-u/2),g=Math.max(0,p[1]-u/2),f=[[[u/2,u/2],[h,u/2],h-u/2],[[h,u/2],[h,g],g-u/2],[[h,g],[u/2,g],h-u/2],[[u/2,g],[u/2,u/2],g-u/2]].map(([v,b],T)=>Wo("line",{x1:v[0],y1:v[1],x2:b[0],y2:b[1]},c+"_"+T));return Tc(Cf,w(S({ref:a},l),{children:[t&&Wo("rect",{className:"tv-binding-indicator",strokeWidth:this.bindingDistance}),Tc("g",{opacity:n?.3:1,children:[Wo("rect",{x:0,y:0,width:p[0],height:p[1],fill:"transparent",pointerEvents:"all"}),Wo(vc,{stroke:"black",opacity:r||s?1:0,strokeLinecap:"round",pointerEvents:"stroke",children:f})]})]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{id:t,size:n}=e,r=2,s=Math.max(0,n[0]-r/2),l=Math.max(0,n[1]-r/2),c=[[[r/2,r/2],[s,r/2],s-r/2],[[s,r/2],[s,l],l-r/2],[[s,l],[r/2,l],s-r/2],[[r/2,l],[r/2,r/2],l-r/2]].map(([p,u],h)=>Wo("line",{x1:p[0],y1:p[1],x2:u[0],y2:u[1]},t+"_"+h));return Wo(vc,{strokeLinecap:"round",pointerEvents:"stroke",children:c})}));d(this,"getBounds",e=>Et(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style)}},vc=P("g",{strokeWidth:"calc(1.5px * var(--tv-scale))",strokeDasharray:"calc(1px * var(--tv-scale)), calc(3px * var(--tv-scale))"});import{styled as xc}from"@stitches/react";import*as kr from"react";import{HTMLContainer as If,Utils as Pf}from"telva-core";import{jsx as Mi,jsxs as Ef}from"react/jsx-runtime";var Li=class extends q{constructor(){super(...arguments);d(this,"type","image");d(this,"canBind",!0);d(this,"canClone",!0);d(this,"isAspectRatioLocked",!0);d(this,"showCloneHandles",!1);d(this,"getShape",e=>Pf.deepMerge({id:"image",type:"image",name:"Image",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:w(S({},He),{isFilled:!0}),assetId:"assetId"},e));d(this,"Component",q.Component(({shape:e,asset:t={src:""},isBinding:n,isGhost:r,meta:s,events:l,onShapeChange:a},c)=>{let{size:p,style:u}=e,{bindingDistance:h}=this,g=kr.useRef(null),m=kr.useRef(null);return kr.useLayoutEffect(()=>{let f=m.current;if(!f)return;let[v,b]=p;f.style.width=`${v}px`,f.style.height=`${b}px`},[p]),Ef(If,w(S({ref:c},l),{children:[n&&Mi("div",{className:"tv-binding-indicator",style:{position:"absolute",top:`calc(${-h}px * var(--tv-zoom))`,left:`calc(${-h}px * var(--tv-zoom))`,width:`calc(100% + ${h*2}px * var(--tv-zoom))`,height:`calc(100% + ${h*2}px * var(--tv-zoom))`,backgroundColor:"var(--tv-selectFill)"}}),Mi(Rf,{ref:m,isDarkMode:s.isDarkMode,isFilled:u.isFilled,isGhost:r,children:Mi(Df,{id:e.id+"_image",ref:g,src:t.src,alt:"tl_image_asset",draggable:!1})})]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:[t,n]}=e;return Mi("rect",{x:0,y:0,rx:2,ry:2,width:Math.max(1,t),height:Math.max(1,n)})}));d(this,"getBounds",e=>Et(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style);d(this,"transform",vn);d(this,"transformSingle",Tn);d(this,"getSvgElement",e=>{let t=this.getBounds(e),n=document.createElementNS("http://www.w3.org/2000/svg","image");return n.setAttribute("width",`${t.width}`),n.setAttribute("height",`${t.height}`),n.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),n})}},Rf=xc("div",{pointerEvents:"all",position:"relative",fontFamily:"sans-serif",fontSize:"2em",height:"100%",width:"100%",borderRadius:"3px",perspective:"800px",overflow:"hidden",p:{userSelect:"none"},img:{userSelect:"none"},variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isFilled:{true:{},false:{}},isDarkMode:{true:{},false:{}}},compoundVariants:[{isFilled:!0,isDarkMode:!0,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.3), 1px 1px 4px rgba(0,0,0,.3), 1px 1px 2px rgba(0,0,0,.3)"}},{isFilled:!0,isDarkMode:!1,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.2), 1px 1px 4px rgba(0,0,0,.16), 1px 1px 2px rgba(0,0,0,.16)"}}]}),Df=xc("img",{position:"absolute",top:0,left:0,width:"100%",height:"100%",maxWidth:"100%",minWidth:"100%",pointerEvents:"none",objectFit:"cover",userSelect:"none",borderRadius:2});import*as pn from"react";import{SVGContainer as Cc,Utils as Gt}from"telva-core";import{intersectBoundsPolyline as Af,intersectLineSegmentLineSegment as Vf}from"telva-intersect";import{Vec as Mt}from"telva-vec";import{Utils as Bf}from"telva-core";var Mf=24;function Lf(i,o,e,t,n){let r=1-n,s=r*r,l=n*n,a=s*r,c=3*s*n,p=3*r*l,u=l*n;return[a*i[0]+c*o[0]+p*e[0]+u*t[0],a*i[1]+c*o[1]+p*e[1]+u*t[1]]}function kc(i,o,e,t){var a,c;let n=(a=o.cp2)!=null?a:o.point,r=(c=e.cp1)!=null?c:e.point;if(!(o.cp2!=null||e.cp1!=null)){i.push(e.point);return}let l=Math.max(4,t);for(let p=1;p<=l;p++){let u=p/l;i.push(Lf(o.point,n,r,e.point,u))}}function Cr(i,o,e=Mf){if(i.length===0)return[];if(i.length===1)return[i[0].point];let t=[i[0].point];for(let n=1;n<i.length;n++)kc(t,i[n-1],i[n],e);return o&&i.length>2&&kc(t,i[i.length-1],i[0],e),t}function ha(i,o){var t,n,r,s;if(i.length===0)return"";if(i.length===1){let{point:l}=i[0];return`M ${l[0]} ${l[1]}`}let e=`M ${i[0].point[0].toFixed(2)} ${i[0].point[1].toFixed(2)}`;for(let l=1;l<i.length;l++){let a=i[l-1],c=i[l],p=(t=a.cp2)!=null?t:a.point,u=(n=c.cp1)!=null?n:c.point;a.cp2!=null||c.cp1!=null?e+=` C ${p[0].toFixed(2)} ${p[1].toFixed(2)} ${u[0].toFixed(2)} ${u[1].toFixed(2)} ${c.point[0].toFixed(2)} ${c.point[1].toFixed(2)}`:e+=` L ${c.point[0].toFixed(2)} ${c.point[1].toFixed(2)}`}if(o&&i.length>2){let l=i[i.length-1],a=i[0],c=(r=l.cp2)!=null?r:l.point,p=(s=a.cp1)!=null?s:a.point;(l.cp2!=null||a.cp1!=null)&&(e+=` C ${c[0].toFixed(2)} ${c[1].toFixed(2)} ${p[0].toFixed(2)} ${p[1].toFixed(2)} ${a.point[0].toFixed(2)} ${a.point[1].toFixed(2)}`),e+=" Z"}return e}function Ai(i,o=!1){if(i.length===0)return{minX:0,minY:0,maxX:1,maxY:1,width:1,height:1};let e=Cr(i,o);return e.length===0?{minX:0,minY:0,maxX:1,maxY:1,width:1,height:1}:Bf.getBoundsFromPoints(e)}function ma(i,o=!1){if(i.length===0)return{segments:i,offset:[0,0]};let e=Ai(i,o),t=[e.minX,e.minY];return{segments:i.map(r=>({point:[r.point[0]-t[0],r.point[1]-t[1]],cp1:r.cp1?[r.cp1[0]-t[0],r.cp1[1]-t[1]]:void 0,cp2:r.cp2?[r.cp2[0]-t[0],r.cp2[1]-t[1]]:void 0})),offset:t}}function wr(i,o){return[2*i[0]-o[0],2*i[1]-o[1]]}import{jsx as mt,jsxs as ga}from"react/jsx-runtime";var Vi=class extends q{constructor(){super(...arguments);d(this,"type","pen");d(this,"canClone",!0);d(this,"pointsBoundsCache",new WeakMap);d(this,"shapeBoundsCache",new Map);d(this,"pointCache",{});d(this,"getShape",e=>Gt.deepMerge({id:"id",type:"pen",name:"Pen",parentId:"page",childIndex:1,point:[0,0],rotation:0,style:He,segments:[],isClosed:!1,isComplete:!1,previewPoint:void 0,isPlacingHandle:!1},e));d(this,"Component",q.Component(({shape:e,meta:t,isSelected:n,isGhost:r,events:s},l)=>{var Ze,_e,Se;let{segments:a,style:c,isClosed:p,isComplete:u,previewPoint:h,isPlacingHandle:g}=e,m=t.nodeEditingId===e.id,f=N(),v=pn.useRef(null),[b,T]=pn.useState(null),y=pn.useCallback(($,ie)=>Mt.sub(f.getPagePoint([$,ie]),e.point),[f,e.point]),x=pn.useCallback($=>{f.patchState({document:{pages:{[f.currentPageId]:{shapes:{[e.id]:{segments:$}}}}}})},[f,e.id]),I=pn.useCallback($=>{f.updateShapes({id:e.id,segments:$})},[f,e.id]),k=J(c,t.isDarkMode),{stroke:R,fill:C,strokeWidth:E,opacity:M}=k,{defs:L,gradFill:A}=ht(e.id,c),K=A!=null?A:C,re=pn.useMemo(()=>ha(a,p),[a,p]),F=(Ze=f.zoom)!=null?Ze:1,ee=1+E*1.5,pe=(_e={["draw"]:"none",["solid"]:"none",["dotted"]:`0.1 ${E*4}`,["dashed"]:`${E*4} ${E*4}`}[c.dash])!=null?_e:"none",he=(Se={["draw"]:"0",["solid"]:"0",["dotted"]:"0",["dashed"]:"0"}[c.dash])!=null?Se:"0",De=pn.useMemo(()=>{if(!m||a.length===0)return null;let $=5/F,ie=3.5/F,ae=1/F,_=[],G=[],Y=[];return a.forEach((te,H)=>{let[Ee,Vt]=te.point;if(te.cp1){let[be,Ye]=te.cp1,qe=`cp1-${H}`;Y.push(mt("line",{x1:Ee,y1:Vt,x2:be,y2:Ye,stroke:"#0D99FF",strokeWidth:ae,strokeOpacity:.6,pointerEvents:"none"},`lcp1-${H}`)),G.push(mt("circle",{cx:be,cy:Ye,r:b===qe?ie*1.4:ie,fill:b===qe?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:ae,style:{cursor:"move"},onPointerEnter:()=>T(qe),onPointerLeave:()=>T(null),onPointerDown:ue=>{ue.stopPropagation(),ue.currentTarget.setPointerCapture(ue.pointerId),v.current={kind:"cp1",idx:H}},onPointerMove:ue=>{if(!v.current||v.current.kind!=="cp1"||v.current.idx!==H)return;ue.stopPropagation();let Te=y(ue.clientX,ue.clientY),we=[...a];we[H]=w(S({},we[H]),{cp1:Te}),x(we)},onPointerUp:ue=>{if(!v.current)return;ue.stopPropagation();let Te=y(ue.clientX,ue.clientY),we=[...a];we[H]=w(S({},we[H]),{cp1:Te}),v.current=null,I(we)}},qe))}if(te.cp2){let[be,Ye]=te.cp2,qe=`cp2-${H}`;Y.push(mt("line",{x1:Ee,y1:Vt,x2:be,y2:Ye,stroke:"#0D99FF",strokeWidth:ae,strokeOpacity:.6,pointerEvents:"none"},`lcp2-${H}`)),G.push(mt("circle",{cx:be,cy:Ye,r:b===qe?ie*1.4:ie,fill:b===qe?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:ae,style:{cursor:"move"},onPointerEnter:()=>T(qe),onPointerLeave:()=>T(null),onPointerDown:ue=>{ue.stopPropagation(),ue.currentTarget.setPointerCapture(ue.pointerId),v.current={kind:"cp2",idx:H}},onPointerMove:ue=>{if(!v.current||v.current.kind!=="cp2"||v.current.idx!==H)return;ue.stopPropagation();let Te=y(ue.clientX,ue.clientY),we=[...a];we[H]=w(S({},we[H]),{cp2:Te}),H+1<we.length&&(we[H+1]=w(S({},we[H+1]),{cp1:wr(we[H].point,Te)})),x(we)},onPointerUp:ue=>{if(!v.current)return;ue.stopPropagation();let Te=y(ue.clientX,ue.clientY),we=[...a];we[H]=w(S({},we[H]),{cp2:Te}),H+1<we.length&&(we[H+1]=w(S({},we[H+1]),{cp1:wr(we[H].point,Te)})),v.current=null,I(we)}},qe))}let Nt=`node-${H}`;if(_.push(mt("circle",{cx:Ee,cy:Vt,r:b===Nt?$*1.4:$,fill:b===Nt?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:1.5/F,style:{cursor:"move"},onPointerEnter:()=>T(Nt),onPointerLeave:()=>T(null),onPointerDown:be=>{be.stopPropagation(),be.currentTarget.setPointerCapture(be.pointerId),v.current={kind:"node",idx:H}},onPointerMove:be=>{if(!v.current||v.current.kind!=="node"||v.current.idx!==H)return;be.stopPropagation();let Ye=y(be.clientX,be.clientY),qe=a[H].point,ue=Mt.sub(Ye,qe),Te=[...a];Te[H]=w(S({},Te[H]),{point:Ye,cp1:Te[H].cp1?Mt.add(Te[H].cp1,ue):void 0,cp2:Te[H].cp2?Mt.add(Te[H].cp2,ue):void 0}),x(Te)},onPointerUp:be=>{if(!v.current)return;be.stopPropagation();let Ye=y(be.clientX,be.clientY),qe=a[H].point,ue=Mt.sub(Ye,qe),Te=[...a];Te[H]=w(S({},Te[H]),{point:Ye,cp1:Te[H].cp1?Mt.add(Te[H].cp1,ue):void 0,cp2:Te[H].cp2?Mt.add(Te[H].cp2,ue):void 0}),v.current=null,I(Te)}},Nt)),H<a.length-1){let be=a[H+1],Ye=(Ee+be.point[0])/2,qe=(Vt+be.point[1])/2;_.push(mt("circle",{cx:Ye,cy:qe,r:ie,fill:"white",stroke:"#0D99FF",strokeWidth:ae,strokeDasharray:`${2/F} ${2/F}`,style:{cursor:"crosshair"},onPointerDown:ue=>{ue.stopPropagation();let Te={point:[Ye,qe]},we=[...a.slice(0,H+1),Te,...a.slice(H+1)];f.updateShapes({id:e.id,segments:we})}},`mid-${H}`))}}),ga("g",{children:[Y,G,_]})},[m,a,F,b,e.id,y,x,I,f]);if(a.length===0)return mt(Cc,w(S({ref:l,id:e.id+"_svg"},s),{children:mt("circle",{r:4,fill:R,stroke:R,pointerEvents:"all"})}));let pt=m||!u?{overflow:"visible"}:void 0;return ga(Cc,w(S({ref:l,id:e.id+"_svg"},s),{style:pt,children:[L,ga("g",{opacity:r?.3:M,children:[mt("path",{className:c.isFilled&&n?"tv-fill-hitarea":"tv-stroke-hitarea",d:re}),c.isFilled&&p&&mt("path",{d:re,fill:K,stroke:"none",pointerEvents:"none"}),mt("path",{d:re,fill:"none",stroke:R,strokeWidth:ee,strokeDasharray:pe,strokeDashoffset:he,strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"}),!u&&h&&a.length>0&&(()=>{let $=a[a.length-1],ie;if(g&&$.cp2){let[ae,_]=$.point,[G,Y]=$.cp2,[te,H]=h;ie=`M ${ae} ${_} C ${G} ${Y} ${te} ${H} ${te} ${H}`}else{let[ae,_]=$.point,[G,Y]=h;ie=`M ${ae} ${_} L ${G} ${Y}`}return mt("path",{d:ie,fill:"none",stroke:R,strokeWidth:ee*.8,strokeDasharray:`${ee*4} ${ee*3}`,strokeLinecap:"round",opacity:.55,pointerEvents:"none"})})(),!u&&h&&a.length>=2&&(()=>{let $=a[0],ie=Math.hypot(h[0]-$.point[0],h[1]-$.point[1]),ae=12/F;return ie<=ae?mt("circle",{cx:$.point[0],cy:$.point[1],r:8/F,fill:"none",stroke:"#0D99FF",strokeWidth:1.5/F,opacity:.8,pointerEvents:"none"}):null})(),!u&&a.length>0&&mt("circle",{cx:a[a.length-1].point[0],cy:a[a.length-1].point[1],r:4/F,fill:R,stroke:"none",pointerEvents:"none"})]}),De]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{segments:t,isClosed:n}=e,r=ha(t,n);return r?mt("path",{d:r}):mt("circle",{r:1})}));d(this,"getBounds",e=>{let t=!this.pointsBoundsCache.has(e.segments),n=this.pointCache[e.id]!==e.point;if(t){let r=e.segments.length>0?Ai(e.segments,e.isClosed):{minX:0,minY:0,maxX:1,maxY:1,width:1,height:1},s=w(S({},r),{width:Math.max(r.width,1),height:Math.max(r.height,1)});this.pointsBoundsCache.set(e.segments,s),this.shapeBoundsCache.set(e.id,Gt.translateBounds(s,e.point)),this.pointCache[e.id]=e.point}else n&&(this.pointCache[e.id]=e.point,this.shapeBoundsCache.set(e.id,Gt.translateBounds(this.pointsBoundsCache.get(e.segments),e.point)));return this.shapeBoundsCache.get(e.id)});d(this,"shouldRender",(e,t)=>t.segments!==e.segments||t.style!==e.style||t.isClosed!==e.isClosed||t.isComplete!==e.isComplete||t.previewPoint!==e.previewPoint||t.isPlacingHandle!==e.isPlacingHandle);d(this,"transform",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>{let l=this.getBounds(n),a=Math.max(l.width,1),c=Math.max(l.height,1),p=m=>({point:[t.width*(r<0?1-(m.point[0]-l.minX)/a:(m.point[0]-l.minX)/a),t.height*(s<0?1-(m.point[1]-l.minY)/c:(m.point[1]-l.minY)/c)],cp1:m.cp1?[t.width*(r<0?1-(m.cp1[0]-l.minX)/a:(m.cp1[0]-l.minX)/a),t.height*(s<0?1-(m.cp1[1]-l.minY)/c:(m.cp1[1]-l.minY)/c)]:void 0,cp2:m.cp2?[t.width*(r<0?1-(m.cp2[0]-l.minX)/a:(m.cp2[0]-l.minX)/a),t.height*(s<0?1-(m.cp2[1]-l.minY)/c:(m.cp2[1]-l.minY)/c)]:void 0}),u=n.segments.map(p),h=Ai(u,e.isClosed),g=Mt.sub([t.minX,t.minY],[h.minX,h.minY]);return{segments:u,point:g}});d(this,"hitTestPoint",(e,t)=>{let n=Cr(e.segments,e.isClosed);if(n.length===0)return!1;let r=Mt.sub(t,e.point),s=8;return e.isClosed&&e.style.isFilled&&Gt.pointInPolygon(r,n)?!0:n.length===1?Mt.dist(r,n[0])<=s:Gt.pointInPolyline(r,n,s)});d(this,"hitTestLineSegment",(e,t,n)=>{let r=Cr(e.segments,e.isClosed);if(r.length===0)return!1;let s=Mt.sub(t,e.point),l=Mt.sub(n,e.point),a=8;if(r.length===1)return Mt.distanceToLineSegment(s,l,r[0])<=a;for(let c=1;c<r.length;c++)if(Vf(r[c-1],r[c],s,l).didIntersect)return!0;return e.isClosed&&e.style.isFilled&&(Gt.pointInPolygon(s,r)||Gt.pointInPolygon(l,r))?!0:Gt.pointInPolyline(s,r,a)||Gt.pointInPolyline(l,r,a)});d(this,"hitTestBounds",(e,t)=>{let n=this.getBounds(e);if(Gt.boundsContain(t,n))return!0;let r=Cr(e.segments,e.isClosed);if(r.length===0)return!1;let s=Gt.translateBounds(t,Mt.neg(e.point));if(r.some(l=>Gt.pointInBounds(l,s))||Af(s,r).length>0)return!0;if(e.isClosed&&e.style.isFilled){let l=[s.minX+s.width/2,s.minY+s.height/2];if(Gt.pointInPolygon(l,r))return!0}return!1})}};import*as No from"react";import{HTMLContainer as Hf,Utils as zf}from"telva-core";import{jsx as Ir,jsxs as Of}from"react/jsx-runtime";var Hi=class extends q{constructor(){super(...arguments);d(this,"type","reactComponent");d(this,"canBind",!1);d(this,"canClone",!0);d(this,"isAspectRatioLocked",!1);d(this,"showCloneHandles",!1);d(this,"getShape",e=>zf.deepMerge({id:"reactComponent",type:"reactComponent",name:"React Component",parentId:"page",childIndex:1,point:[0,0],size:[400,300],rotation:0,style:w(S({},He),{isFilled:!0}),componentId:""},e));d(this,"Component",q.Component(({shape:e,isGhost:t,events:n},r)=>{let{size:s,componentId:l}=e,a=No.useRef(null);return No.useLayoutEffect(()=>{let c=a.current;!c||(c.style.width=`${s[0]}px`,c.style.height=`${s[1]}px`)},[s]),Ir(Hf,w(S({ref:r},n),{children:Ir("div",{id:`${e.id}_react_component`,ref:a,style:{width:`${s[0]}px`,height:`${s[1]}px`,position:"relative",overflow:"hidden",borderRadius:"4px",opacity:t?.3:1,pointerEvents:"all"},children:Ir(Ff,{componentId:l})})}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:[t,n]}=e;return Ir("rect",{x:0,y:0,rx:4,ry:4,width:Math.max(1,t),height:Math.max(1,n),fill:"none",stroke:"var(--tv-selected)"})}));d(this,"getBounds",e=>Et(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.componentId!==e.componentId);d(this,"transform",vn);d(this,"transformSingle",Tn);d(this,"getSvgElement",(e,t)=>z(this,null,function*(){let n=document.getElementById(`${e.id}_react_component`);if(!n)return;let[r,s]=e.size;try{let l=n.querySelector("canvas"),a="";if(l&&(a=l.toDataURL("image/png")),!a||a==="data:,"){let p=(yield import("html2canvas-pro")).default;a=(yield p(n,{width:r,height:s,scale:1,useCORS:!0,backgroundColor:"#ffffff",logging:!1})).toDataURL("image/png")}if(!a||a==="data:,")return;let c=document.createElementNS("http://www.w3.org/2000/svg","image");return c.setAttribute("width",`${r}`),c.setAttribute("height",`${s}`),c.setAttribute("href",a),c}catch(l){console.warn("Failed to snapshot React Component for SVG export",l)}}))}};function Ff({componentId:i}){let o=hi(),e=No.useMemo(()=>o.find(n=>n.id===i),[o,i]);if(!e)return Of("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",color:"white",fontSize:14,fontFamily:"DM Sans, sans-serif",borderRadius:4},children:['Component "',i,'" not found']});let t=e.component;return Ir(t,{})}import*as to from"react";import{SVGContainer as Yf,Utils as Xf}from"telva-core";import Zf from"telva-vec";import{jsx as $f}from"react/jsx-runtime";function wc({strokeWidth:i,size:o}){return $f("rect",{className:"tv-binding-indicator",x:i,y:i,width:Math.max(0,o[0]-i/2),height:Math.max(0,o[1]-i/2),strokeWidth:16*2})}import*as Pc from"react";import{Utils as Ic}from"telva-core";import{Fragment as Gf,jsx as Pr,jsxs as jf}from"react/jsx-runtime";var Rc=Pc.memo(function({id:o,style:e,size:t,isSelected:n,isDarkMode:r}){var y;let{stroke:s,strokeWidth:l,fill:a}=J(e,r),{defs:c,gradFill:p}=ht(o,e),u=p!=null?p:a,h=1+l*1.618,g=Math.max(0,t[0]-h/2),m=Math.max(0,t[1]-h/2),f=(y=e.borderRadius)!=null?y:0,v=f>0||e.dash==="solid",{strokeDasharray:b,strokeDashoffset:T}=Ic.getPerfectDashProps(2*(g+m),l*1.618,e.dash);return jf(Gf,{children:[c,Pr("rect",{className:n||e.isFilled?"tv-fill-hitarea":"tv-stroke-hitarea",x:h/2,y:h/2,width:g,height:m,rx:f,ry:f,strokeWidth:16}),e.isFilled&&Pr("rect",{x:h/2,y:h/2,width:g,height:m,rx:f,ry:f,fill:u,pointerEvents:"none"}),v?Pr("rect",{x:h/2,y:h/2,width:g,height:m,rx:f,ry:f,fill:"none",stroke:s,strokeWidth:h,strokeDasharray:b,strokeDashoffset:T,pointerEvents:"none",strokeLinecap:"round"}):Pr("g",{pointerEvents:"none",stroke:s,strokeWidth:h,strokeLinecap:"round",children:[[[h/2,h/2],[g,h/2],g-h/2],[[g,h/2],[g,m],m-h/2],[[g,m],[h/2,m],g-h/2],[[h/2,m],[h/2,h/2],m-h/2]].map(([x,I,k],R)=>{let C=Ic.getPerfectDashProps(k,l*1.618,e.dash);return Pr("line",{x1:x[0],y1:x[1],x2:I[0],y2:I[1],strokeDasharray:C.strokeDasharray,strokeDashoffset:C.strokeDashoffset},o+"_"+R)})})]})});import*as Bc from"react";import Wf,{getStrokePoints as Nf}from"perfect-freehand";import{Utils as zi}from"telva-core";import gt from"telva-vec";function Uf(i,o,e){let t=J(o),n=zi.rng(i),r=t.strokeWidth,s=Math.max(0,e[0]),l=Math.max(0,e[1]),a=Array.from(Array(4)).map(()=>[n()*r*.75,n()*r*.75]),c=gt.add([r/2,r/2],a[0]),p=gt.add([s-r/2,r/2],a[1]),u=gt.add([s-r/2,l-r/2],a[2]),h=gt.add([r/2,l-r/2],a[3]),g=Math.round(Math.abs(n()*2*4)),m=Math.min(s/4,r*2),f=Math.min(l/4,r*2),v=Math.max(8,Math.floor(s/16)),b=Math.max(8,Math.floor(l/16)),T=zi.rotateArray([gt.pointsBetween(gt.add(c,[m,0]),gt.sub(p,[m,0]),v),gt.pointsBetween(gt.add(p,[0,f]),gt.sub(u,[0,f]),b),gt.pointsBetween(gt.sub(u,[m,0]),gt.add(h,[m,0]),v),gt.pointsBetween(gt.sub(h,[0,f]),gt.add(c,[0,f]),b)],g);return{points:[...T.flat(),...T[0]].slice(5,Math.floor((g%2===0?v:b)/-2)+3)}}function Dc(i,o,e){let{points:t}=Uf(i,o,e),{strokeWidth:n}=J(o);return{points:t,options:{size:n,thinning:.65,streamline:.3,smoothing:1,simulatePressure:!1,last:!0}}}function Ec(i,o,e){let{points:t,options:n}=Dc(i,o,e),r=Wf(t,n);return zi.getSvgPathFromStroke(r)}function Fi(i,o,e){let{points:t,options:n}=Dc(i,o,e);return zi.getSvgPathFromStrokePoints(Nf(t,n))}import{Fragment as Kf,jsx as fa,jsxs as _f}from"react/jsx-runtime";var Mc=Bc.memo(function({id:o,style:e,size:t,isSelected:n,isDarkMode:r}){let{isFilled:s}=e,{stroke:l,strokeWidth:a,fill:c}=J(e,r),{defs:p,gradFill:u}=ht(o,e),h=u!=null?u:c,g=Ec(o,e,t),m=Fi(o,e,t);return _f(Kf,{children:[p,fa("path",{className:e.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",d:m}),s&&fa("path",{d:m,fill:h,pointerEvents:"none"}),fa("path",{d:g,fill:l,stroke:l,strokeWidth:a,pointerEvents:"none"})]})});import{jsx as eo,jsxs as Sa}from"react/jsx-runtime";var Oi=class extends q{constructor(){super(...arguments);d(this,"type","rectangle");d(this,"canBind",!0);d(this,"canClone",!0);d(this,"canEdit",!0);d(this,"getShape",e=>Xf.deepMerge({id:"id",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:He,label:"",labelPoint:[.5,.5]},e));d(this,"Component",q.Component(({shape:e,isEditing:t,isBinding:n,isSelected:r,isGhost:s,meta:l,bounds:a,events:c,onShapeBlur:p,onShapeChange:u},h)=>{var F,ee;let{id:g,size:m,style:f,label:v="",labelPoint:b=Ho}=e,T=Ct(f),y=J(f,l.isDarkMode),I=!(l.canvasMode==="straight")&&f.dash==="draw"?Mc:Rc,k=to.useCallback(pe=>u==null?void 0:u({id:g,label:pe}),[u]),R=l.nodeEditingId===e.id,C=N(),E=to.useRef(null),[M,L]=to.useState(null),A=(F=C.zoom)!=null?F:1,K=to.useMemo(()=>{if(!R)return null;let[pe,he]=m,De=[[0,0],[pe,0],[pe,he],[0,he]],pt=[2,3,0,1],Ze=5/A,_e=1/A;return Sa("g",{children:[De.map((Se,$)=>{let ie=De[($+1)%4];return eo("line",{x1:Se[0],y1:Se[1],x2:ie[0],y2:ie[1],stroke:"#0D99FF",strokeWidth:_e,strokeOpacity:.4,pointerEvents:"none"},`el-${$}`)}),De.map(([Se,$],ie)=>eo("circle",{cx:Se,cy:$,r:M===ie?Ze*1.4:Ze,fill:M===ie?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:1.5/A,style:{cursor:"nwse-resize"},onPointerEnter:()=>L(ie),onPointerLeave:()=>L(null),onPointerDown:ae=>{ae.stopPropagation(),ae.currentTarget.setPointerCapture(ae.pointerId);let _=De[pt[ie]];E.current={nodeIdx:ie,fixedPage:Zf.add(e.point,_)}},onPointerMove:ae=>{if(!E.current||E.current.nodeIdx!==ie)return;ae.stopPropagation();let _=C.getPagePoint([ae.clientX,ae.clientY]),G=E.current.fixedPage,Y=Math.min(_[0],G[0]),te=Math.min(_[1],G[1]),H=Math.max(_[0],G[0]),Ee=Math.max(_[1],G[1]);C.patchState({document:{pages:{[C.currentPageId]:{shapes:{[e.id]:{point:[Y,te],size:[Math.max(1,H-Y),Math.max(1,Ee-te)]}}}}}})},onPointerUp:ae=>{if(!E.current)return;ae.stopPropagation();let _=C.getPagePoint([ae.clientX,ae.clientY]),G=E.current.fixedPage,Y=Math.min(_[0],G[0]),te=Math.min(_[1],G[1]),H=Math.max(_[0],G[0]),Ee=Math.max(_[1],G[1]);E.current=null,C.updateShapes({id:e.id,point:[Y,te],size:[Math.max(1,H-Y),Math.max(1,Ee-te)]})}},`cn-${ie}`)),De.map((Se,$)=>{let ie=De[($+1)%4],ae=(Se[0]+ie[0])/2,_=(Se[1]+ie[1])/2;return eo("circle",{cx:ae,cy:_,r:3.5/A,fill:"white",stroke:"#0D99FF",strokeWidth:_e,strokeDasharray:`${2/A} ${2/A}`,style:{cursor:"crosshair"},pointerEvents:"none"},`mid-${$}`)})]})},[R,m,A,M,e.id,e.point,C]),re=R?{overflow:"visible"}:void 0;return Sa(qf,w(S({ref:h},c),{children:[eo(Qn,{isEditing:t,onChange:k,onBlur:p,font:T,text:v,color:(ee=f.labelColor)!=null?ee:y.stroke,background:f.labelBackground,textGradient:f.textGradient,offsetX:(b[0]-.5)*a.width,offsetY:(b[1]-.5)*a.height,width:Math.max(0,a.width-16)}),Sa(Yf,{id:e.id+"_svg",opacity:s?.3:y.opacity,style:re,children:[n&&eo(wc,{strokeWidth:y.strokeWidth,size:m}),eo(I,{id:g,style:f,size:m,isSelected:r,isDarkMode:l.isDarkMode}),K]})]}))}));d(this,"Indicator",q.Indicator(({shape:e,meta:t})=>{var a,c;let{id:n,style:r,size:s}=e;return!((t==null?void 0:t.canvasMode)==="straight")&&r.dash==="draw"?eo("path",{d:Fi(n,r,s)}):eo("rect",{x:0,y:0,rx:(a=r.borderRadius)!=null?a:0,ry:(c=r.borderRadius)!=null?c:0,width:Math.max(1,s[0]),height:Math.max(1,s[1])})}));d(this,"getBounds",e=>Et(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.label!==e.label);d(this,"transform",vn);d(this,"transformSingle",Tn)}},qf=P("div",{width:"100%",height:"100%"});import*as It from"react";import{HTMLContainer as Jf,Utils as Qf}from"telva-core";import{Vec as eS}from"telva-vec";import{jsx as $i,jsxs as Lc}from"react/jsx-runtime";var Gi=class extends q{constructor(){super(...arguments);d(this,"type","sticky");d(this,"canBind",!0);d(this,"canEdit",!0);d(this,"canClone",!0);d(this,"hideResizeHandles",!0);d(this,"showCloneHandles",!0);d(this,"getShape",e=>Qf.deepMerge({id:"id",type:"sticky",name:"Sticky",parentId:"page",childIndex:1,point:[0,0],size:[200,200],text:"",rotation:0,style:Oo},e));d(this,"Component",q.Component(({shape:e,meta:t,events:n,isGhost:r,isBinding:s,isEditing:l,onShapeBlur:a,onShapeChange:c},p)=>{let u=$d(e.style),{color:h,fill:g,stroke:m}=ra(e.style,t.isDarkMode),f=It.useRef(null),v=It.useRef(null),b=It.useRef(null),T=It.useRef(!1),y=It.useCallback(L=>{L.stopPropagation()},[]),x=It.useCallback(L=>{c==null||c({id:e.id,type:e.type,text:B.normalizeText(L)})},[e.id]),I=It.useCallback(L=>{x(L.currentTarget.value)},[c,x]),k=It.useCallback(L=>{if(L.key==="Escape"){L.preventDefault(),L.stopPropagation(),a==null||a();return}if(L.key==="Tab"&&e.text.length===0){L.preventDefault();return}if(!(L.key==="Meta"||L.metaKey))L.stopPropagation();else if(L.key==="z"&&L.metaKey){L.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1),L.stopPropagation(),L.preventDefault();return}(L.metaKey||L.ctrlKey)&&L.key==="="&&L.preventDefault(),L.key==="Tab"&&(L.preventDefault(),L.shiftKey?Fe.unindent(L.currentTarget):Fe.indent(L.currentTarget),c==null||c(w(S({},e),{text:B.normalizeText(L.currentTarget.value)})))},[e,c]),R=It.useCallback(L=>{L.currentTarget.setSelectionRange(0,0),a==null||a()},[]),C=It.useCallback(L=>{!l||!T.current||L.currentTarget.select()},[l]);It.useEffect(()=>{if(l){T.current=!0;let L=v.current;L.focus(),L.select()}},[l]),It.useEffect(()=>{let L=b.current,{size:A}=e,{offsetHeight:K}=L,re=ya-xn*2,F=A[1]-xn*2;if(K===F)return;if(K>re){c==null||c({id:e.id,size:[A[0],K+xn*2]});return}if(K<re&&A[1]>ya){c==null||c({id:e.id,size:[A[0],ya]});return}let ee=v.current;ee==null||ee.focus()},[e.text,e.size[1],e.style]);let E=e.style.textGradient,M=S({font:u,color:E?"transparent":h,textShadow:t.isDarkMode?"0.5px 0.5px 2px rgba(255, 255, 255,.25)":"0.5px 0.5px 2px rgba(255, 255, 255,.5)"},E?{background:Mo(E),WebkitBackgroundClip:"text",backgroundClip:"text"}:{});return $i(Jf,w(S({ref:p},n),{children:Lc(tS,{ref:f,isDarkMode:t.isDarkMode,isGhost:r,style:S({backgroundColor:g,border:m?`2px solid ${m}`:void 0},M),children:[s&&$i("div",{className:"tv-binding-indicator",style:{position:"absolute",top:-this.bindingDistance,left:-this.bindingDistance,width:`calc(100% + ${this.bindingDistance*2}px)`,height:`calc(100% + ${this.bindingDistance*2}px)`,backgroundColor:"var(--tv-selectFill)"}}),Lc(nS,{ref:b,isEditing:l,alignment:e.style.textAlign,children:[e.text,"\u200B"]}),l&&$i(oS,{ref:v,onPointerDown:y,value:e.text,onChange:I,onKeyDown:k,onFocus:C,onBlur:R,tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,spellCheck:!0,alignment:e.style.textAlign,onContextMenu:rt,onCopy:rt,onPaste:rt,onCut:rt})]})}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:[t,n]}=e;return $i("rect",{x:0,y:0,rx:3,ry:3,width:Math.max(1,t),height:Math.max(1,n)})}));d(this,"getBounds",e=>Et(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.text!==e.text);d(this,"transform",(e,t,{scaleX:n,scaleY:r,transformOrigin:s})=>({point:eS.toFixed([t.minX+(t.width-e.size[0])*(n<0?1-s[0]:s[0]),t.minY+(t.height-e.size[1])*(r<0?1-s[1]:s[1])])}));d(this,"transformSingle",e=>e);d(this,"getSvgElement",(e,t)=>{var h,g;let n=this.getBounds(e),r=ra(e.style,t),s=oa(e.style.size)*((h=e.style.scale)!=null?h:1),l=bn(e.style.font,e.style.fontFamily).slice(1,-1),a=(g=e.style.textAlign)!=null?g:"start",c=qn(e.text,s,l,a,n.width-xn*2,!0);c.setAttribute("fill",r.color),c.setAttribute("transform",`translate(${xn}, ${xn})`);let p=document.createElementNS("http://www.w3.org/2000/svg","g"),u=document.createElementNS("http://www.w3.org/2000/svg","rect");return u.setAttribute("width",n.width+""),u.setAttribute("height",n.height+""),u.setAttribute("fill",r.fill),r.stroke&&(u.setAttribute("stroke",r.stroke),u.setAttribute("stroke-width","2")),u.setAttribute("rx","3"),u.setAttribute("ry","3"),p.appendChild(u),p.appendChild(c),p})}},xn=16,ya=200,tS=P("div",{pointerEvents:"all",position:"relative",backgroundColor:"rgba(255, 220, 100)",fontFamily:"sans-serif",height:"100%",width:"100%",padding:xn+"px",borderRadius:"3px",perspective:"800px",variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isDarkMode:{true:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.3), 1px 1px 4px rgba(0,0,0,.3), 1px 1px 2px rgba(0,0,0,.3)"},false:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.2), 1px 1px 4px rgba(0,0,0,.16), 1px 1px 2px rgba(0,0,0,.16)"}}}}),Ac={whiteSpace:"pre-wrap",overflowWrap:"break-word",letterSpacing:Ut},nS=P("div",S({position:"absolute",top:xn,left:xn,width:`calc(100% - ${xn*2}px)`,height:"fit-content",font:"inherit",pointerEvents:"none",userSelect:"none",variants:{isEditing:{true:{opacity:1},false:{opacity:1}},alignment:{["start"]:{textAlign:"left"},["middle"]:{textAlign:"center"},["end"]:{textAlign:"right"},["justify"]:{textAlign:"justify"}}}},Ac)),oS=P("textarea",w(S({width:"100%",height:"100%",border:"none",overflow:"hidden",background:"none",outline:"none",textAlign:"left",font:"inherit",padding:0,color:"transparent",verticalAlign:"top",resize:"none",caretColor:"black"},Ac),{variants:{alignment:{["start"]:{textAlign:"left"},["middle"]:{textAlign:"center"},["end"]:{textAlign:"right"},["justify"]:{textAlign:"justify"}}},"&:focus":{outline:"none",border:"none"}}));import*as Pt from"react";import{HTMLContainer as rS,Utils as ba}from"telva-core";import{Vec as no}from"telva-vec";import{jsx as Rr,jsxs as dS}from"react/jsx-runtime";var ji=class extends q{constructor(){super(...arguments);d(this,"type","text");d(this,"isAspectRatioLocked",!1);d(this,"canEdit",!0);d(this,"canBind",!0);d(this,"canClone",!0);d(this,"bindingDistance",16/2);d(this,"getShape",e=>ba.deepMerge({id:"id",type:"text",name:"Text",parentId:"page",childIndex:1,point:[0,0],rotation:0,text:" ",style:Oo},e));d(this,"texts",new Map);d(this,"Component",q.Component(({shape:e,isBinding:t,isGhost:n,isEditing:r,onShapeBlur:s,onShapeChange:l,meta:a,events:c},p)=>{let{text:u,style:h}=e,g=J(h,a.isDarkMode),m=Ct(e.style),f=Pt.useRef(null),v=Pt.useRef(!1),b=Pt.useRef(u);Pt.useLayoutEffect(()=>{if(u!==b.current){let C=[0,0];this.texts.set(e.id,u);let E=this.getBounds(e),M=this.getBounds(e);switch(e.style.textAlign){case"start":break;case"middle":{C=no.div([M.width-E.width,0],2);break}case"end":{C=[M.width-E.width,0];break}}b.current=u,l==null||l(w(S({},e),{id:e.id,point:no.sub(e.point,C),text:u}))}},[u]);let T=Pt.useCallback(C=>{let E=[0,0],M=B.normalizeText(C.currentTarget.value),L=this.getBounds(e);this.texts.set(e.id,M);let A=this.getBounds(w(S({},e),{text:M}));switch(e.style.textAlign){case"start":break;case"middle":{E=no.div([A.width-L.width,0],2);break}case"end":{E=[A.width-L.width,0];break}}b.current=M,l==null||l(w(S({},e),{id:e.id,point:no.sub(e.point,E),text:M}))},[e.id,e.point]),y=Pt.useCallback(C=>{if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),s==null||s();return}if(C.key==="Tab"&&e.text.length===0){C.preventDefault();return}if(C.key==="Enter"&&(C.metaKey||C.ctrlKey)){C.preventDefault(),C.stopPropagation(),f.current.blur();return}if(!(C.key==="Meta"||C.metaKey))C.stopPropagation();else if(C.key==="z"&&C.metaKey){C.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1),C.stopPropagation(),C.preventDefault();return}(C.metaKey||C.ctrlKey)&&C.key==="="&&C.preventDefault(),C.key==="Tab"&&(C.preventDefault(),C.shiftKey?Fe.unindent(C.currentTarget):Fe.indent(C.currentTarget),l==null||l(w(S({},e),{text:B.normalizeText(C.currentTarget.value)})))},[e,l]),x=Pt.useCallback(C=>{C.currentTarget.setSelectionRange(0,0),s==null||s()},[]),I=Pt.useCallback(C=>{!r||!v.current||document.activeElement===C.currentTarget&&C.currentTarget.select()},[r]),k=Pt.useCallback(C=>{r&&C.stopPropagation()},[r]),R=Pt.useRef(r);return Pt.useEffect(()=>{r?(R.current=!0,this.texts.set(e.id,u),requestAnimationFrame(()=>{v.current=!0;let C=f.current;C&&(C.focus(),C.select())})):R.current&&(R.current=!1,s==null||s())},[r]),Rr(rS,w(S({ref:p},c),{children:Rr(sS,{isGhost:n,isEditing:r,onPointerDown:k,style:{opacity:n?void 0:g.opacity},children:dS(aS,{style:S({font:m,color:h.textGradient&&!r?"transparent":g.stroke,textAlign:Ad(h.textAlign),width:e.size?`${e.size[0]}px`:"auto",whiteSpace:e.size?"pre-wrap":"pre",wordBreak:e.size?"break-word":"normal",overflowWrap:e.size?"break-word":"normal"},h.textGradient&&!r?{background:Mo(h.textGradient),WebkitBackgroundClip:"text",backgroundClip:"text"}:{}),children:[t&&Rr("div",{className:"tv-binding-indicator",style:{position:"absolute",top:-this.bindingDistance,left:-this.bindingDistance,width:`calc(100% + ${this.bindingDistance*2}px)`,height:`calc(100% + ${this.bindingDistance*2}px)`,backgroundColor:"var(--tv-selectFill)"}}),r?Rr(lS,{ref:f,style:{font:m,color:g.stroke},name:"text",tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,placeholder:"",spellCheck:"true",wrap:"off",dir:"auto",datatype:"wysiwyg",defaultValue:u,color:g.stroke,onFocus:I,onChange:T,onKeyDown:y,onBlur:x,onPointerDown:k,onContextMenu:rt,onCopy:rt,onPaste:rt,onCut:rt}):u,"\u200B"]})})}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{width:t,height:n}=this.getBounds(e);return Rr("rect",{x:0,y:0,width:t,height:n})}));d(this,"getBounds",e=>{let t=ba.getFromCache(this.boundsCache,e,()=>{var s;if(!ft)return{minX:0,minY:0,maxX:10,maxY:10,width:10,height:10};ft.parentNode||document.body.appendChild(ft),ft.style.font=Ct(e.style),ft.textContent=(s=this.texts.get(e.id))!=null?s:e.text,e.size?(ft.style.whiteSpace="pre-wrap",ft.style.wordBreak="break-word",ft.style.overflowWrap="break-word",ft.style.width=`${e.size[0]}px`):(ft.style.whiteSpace="pre",ft.style.wordBreak="normal",ft.style.overflowWrap="normal",ft.style.width="auto");let n=e.size?e.size[0]:ft.offsetWidth||1,r=ft.offsetHeight||1;return{minX:0,maxX:n,minY:0,maxY:r,width:n,height:r}});return ba.translateBounds(t,e.point)});d(this,"shouldRender",(e,t)=>t.text!==e.text||t.style.scale!==e.style.scale||t.style!==e.style||t.size!==e.size);d(this,"transform",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>{let{rotation:l=0,style:{scale:a=1}}=n,c=a*Math.abs(Math.min(r,s));return{point:[t.minX,t.minY],size:[t.width,t.height],rotation:r<0&&s>=0||s<0&&r>=0?-(l||0):l,style:w(S({},n.style),{scale:c})}});d(this,"transformSingle",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>({point:no.toFixed([t.minX,t.minY]),size:[t.width,t.height]}));d(this,"onDoubleClickBoundsHandle",e=>{let t=this.getCenter(e),n=this.getCenter(w(S({},e),{style:w(S({},e.style),{scale:1})}));return{style:w(S({},e.style),{scale:1}),point:no.toFixed(no.add(e.point,no.sub(t,n)))}});d(this,"getSvgElement",(e,t)=>{var p,u;let n=this.getBounds(e),r=J(e.style,t),s=bo(e.style.size,e.style.font)*((p=e.style.scale)!=null?p:1),l=bn(e.style.font).slice(1,-1),a=(u=e.style.textAlign)!=null?u:"middle",c=qn(e.text,s,l,a,e.size?e.size[0]:n.width,!!e.size);return c.setAttribute("fill",r.stroke),c})}},ft;function iS(){var o;(o=document.getElementById("__textMeasure"))==null||o.remove();let i=document.createElement("pre");return i.id="__textMeasure",Object.assign(i.style,{whiteSpace:"pre",width:"auto",border:"1px solid transparent",padding:"4px",margin:"0px",letterSpacing:Ut,opacity:"0",position:"absolute",top:"-500px",left:"0px",zIndex:"9999",pointerEvents:"none",userSelect:"none",alignmentBaseline:"mathematical",dominantBaseline:"mathematical"}),i.tabIndex=-1,document.body.appendChild(i),i}typeof window!="undefined"&&(ft=iS());var sS=P("div",{width:"100%",height:"100%",variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isEditing:{false:{pointerEvents:"all",userSelect:"all"},true:{pointerEvents:"none",userSelect:"none"}}}}),Vc={whiteSpace:"pre-wrap",overflowWrap:"break-word"},aS=P("div",S({position:"absolute",width:"100%",height:"100%",padding:"4px",zIndex:1,minHeight:1,minWidth:1,lineHeight:1,letterSpacing:Ut,outline:0,fontWeight:"500",backfaceVisibility:"hidden",userSelect:"none",pointerEvents:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",isEditing:{false:{},true:{pointerEvents:"all",background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text"}}},Vc)),lS=P("textarea",w(S({position:"absolute",top:0,left:0,zIndex:1,width:"100%",height:"100%",border:"none",padding:"4px",resize:"none",textAlign:"inherit",minHeight:"inherit",minWidth:"inherit",lineHeight:"inherit",letterSpacing:"inherit",outline:0,fontWeight:"inherit",overflow:"hidden",backfaceVisibility:"hidden",display:"inline-block",pointerEvents:"all",background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text"},Vc),{"&:focus":{outline:"none",border:"none"}}));import*as Wn from"react";import{SVGContainer as bS,Utils as oo}from"telva-core";import{intersectBoundsPolygon as vS,intersectLineSegmentPolyline as TS,intersectRayLineSegment as xS}from"telva-intersect";import St from"telva-vec";import*as $c from"react";import{Utils as Oc}from"telva-core";import hS from"telva-vec";import cS,{getStrokePoints as pS}from"perfect-freehand";import{Utils as Wi}from"telva-core";import ko from"telva-vec";function Xt(i,o=0,e=0){let[t,n]=i,r=[[t/2,0],[t,n],[0,n]];return o&&(r=Fd(r,o)),e&&(r=r.map(s=>ko.rotWith(s,[t/2,n/2],e))),r}function va(i){let[o,e]=i,t=[[o/2,0],[o,e],[0,e]];return[(t[0][0]+t[1][0]+t[2][0])/3,(t[0][1]+t[1][1]+t[2][1])/3]}function uS(i,o,e){let[t,n]=o,r=Wi.rng(i),s=Array.from(Array(3)).map(()=>[r()*e*.75,r()*e*.75]),l=[ko.add([t/2,0],s[0]),ko.add([t,n],s[1]),ko.add([0,n],s[2])],a=Math.round(Math.abs(r()*2*3)),c=Wi.rotateArray([ko.pointsBetween(l[0],l[1],32),ko.pointsBetween(l[1],l[2],32),ko.pointsBetween(l[2],l[0],32)],a);return{points:[...c.flat(),...c[0]]}}function Hc(i,o,e){let{strokeWidth:t}=J(e),{points:n}=uS(i,o,t);return{points:n,options:{size:t,thinning:.65,streamline:.3,smoothing:1,simulatePressure:!1,last:!0}}}function zc(i,o,e){let{points:t,options:n}=Hc(i,o,e),r=cS(t,n);return Wi.getSvgPathFromStroke(r)}function Fc(i,o,e){let{points:t,options:n}=Hc(i,o,e);return Wi.getSvgPathFromStrokePoints(pS(t,n))}import{Fragment as mS,jsx as Ni,jsxs as gS}from"react/jsx-runtime";var Gc=$c.memo(function({id:o,size:e,style:t,isSelected:n,isDarkMode:r}){let{stroke:s,strokeWidth:l,fill:a}=J(t,r),{defs:c,gradFill:p}=ht(o,t),u=p!=null?p:a,h=1+l*1.618,g=Xt(e),f=Oc.pointsToLineSegments(g,!0).map(([b,T],y)=>{let{strokeDasharray:x,strokeDashoffset:I}=Oc.getPerfectDashProps(hS.dist(b,T),l*1.618,t.dash);return Ni("line",{x1:b[0],y1:b[1],x2:T[0],y2:T[1],stroke:s,strokeWidth:h,strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:I},o+"_"+y)}),v=g.join();return gS(mS,{children:[c,Ni("polygon",{className:t.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",points:v}),t.isFilled&&Ni("polygon",{fill:u,points:v,pointerEvents:"none"}),Ni("g",{pointerEvents:"stroke",children:f})]})});import*as jc from"react";import{Fragment as fS,jsx as Ta,jsxs as SS}from"react/jsx-runtime";var Wc=jc.memo(function({id:o,size:e,style:t,isSelected:n,isDarkMode:r}){let{stroke:s,strokeWidth:l,fill:a}=J(t,r),{defs:c,gradFill:p}=ht(o,t),u=p!=null?p:a,h=zc(o,e,t),g=Fc(o,e,t);return SS(fS,{children:[c,Ta("path",{className:t.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",d:g}),t.isFilled&&Ta("path",{d:g,fill:u,pointerEvents:"none"}),Ta("path",{d:h,fill:s,stroke:s,strokeWidth:l,pointerEvents:"none"})]})});import{jsx as yS}from"react/jsx-runtime";function Nc({size:i}){let o=Xt(i).join();return yS("polygon",{className:"tv-binding-indicator",points:o,strokeWidth:16*2})}import{jsx as Uo,jsxs as xa}from"react/jsx-runtime";var Ui=class extends q{constructor(){super(...arguments);d(this,"type","triangle");d(this,"canBind",!0);d(this,"canClone",!0);d(this,"canEdit",!0);d(this,"getShape",e=>oo.deepMerge({id:"id",type:"triangle",name:"Triangle",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:He,label:"",labelPoint:[.5,.5]},e));d(this,"Component",q.Component(({shape:e,bounds:t,isBinding:n,isEditing:r,isSelected:s,isGhost:l,meta:a,events:c,onShapeChange:p,onShapeBlur:u},h)=>{var ee,pe;let{id:g,label:m="",size:f,style:v,labelPoint:b=Ho}=e,T=Ct(v),y=J(v,a.isDarkMode),I=!(a.canvasMode==="straight")&&v.dash==="draw"?Wc:Gc,k=Wn.useCallback(he=>p==null?void 0:p({id:g,label:he}),[p]),R=Wn.useMemo(()=>{let he=St.div(f,2);return(va(f)[1]-he[1])*.72},[f]),C=a.nodeEditingId===e.id,E=N(),M=Wn.useRef(null),[L,A]=Wn.useState(null),K=(ee=E.zoom)!=null?ee:1,re=Wn.useMemo(()=>{if(!C)return null;let[he,De]=f,pt=[[0,0],[he,0],[he,De],[0,De]],Ze=[2,3,0,1],_e=5/K,Se=1/K,$=Xt(f);return xa("g",{children:[$.map((ie,ae)=>{let _=$[(ae+1)%$.length];return Uo("line",{x1:ie[0],y1:ie[1],x2:_[0],y2:_[1],stroke:"#0D99FF",strokeWidth:Se,strokeOpacity:.3,pointerEvents:"none"},`tl-${ae}`)}),pt.map(([ie,ae],_)=>Uo("circle",{cx:ie,cy:ae,r:L===_?_e*1.4:_e,fill:L===_?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:1.5/K,style:{cursor:"nwse-resize"},onPointerEnter:()=>A(_),onPointerLeave:()=>A(null),onPointerDown:G=>{G.stopPropagation(),G.currentTarget.setPointerCapture(G.pointerId);let Y=pt[Ze[_]];M.current={nodeIdx:_,fixedPage:St.add(e.point,Y)}},onPointerMove:G=>{if(!M.current||M.current.nodeIdx!==_)return;G.stopPropagation();let Y=E.getPagePoint([G.clientX,G.clientY]),te=M.current.fixedPage,H=Math.min(Y[0],te[0]),Ee=Math.min(Y[1],te[1]),Vt=Math.max(Y[0],te[0]),Nt=Math.max(Y[1],te[1]);E.patchState({document:{pages:{[E.currentPageId]:{shapes:{[e.id]:{point:[H,Ee],size:[Math.max(1,Vt-H),Math.max(1,Nt-Ee)]}}}}}})},onPointerUp:G=>{if(!M.current)return;G.stopPropagation();let Y=E.getPagePoint([G.clientX,G.clientY]),te=M.current.fixedPage,H=Math.min(Y[0],te[0]),Ee=Math.min(Y[1],te[1]),Vt=Math.max(Y[0],te[0]),Nt=Math.max(Y[1],te[1]);M.current=null,E.updateShapes({id:e.id,point:[H,Ee],size:[Math.max(1,Vt-H),Math.max(1,Nt-Ee)]})}},`cn-${_}`))]})},[C,f,K,L,e.id,e.point,E]),F=C?{overflow:"visible"}:void 0;return xa(kS,w(S({ref:h},c),{children:[Uo(Qn,{font:T,text:m,color:(pe=v.labelColor)!=null?pe:y.stroke,background:v.labelBackground,textGradient:v.textGradient,offsetX:(b[0]-.5)*t.width,offsetY:R+(b[1]-.5)*t.height,width:Math.max(0,t.width*.5-16),isEditing:r,onChange:k,onBlur:u}),xa(bS,{id:e.id+"_svg",opacity:l?.3:y.opacity,style:F,children:[n&&Uo(Nc,{size:f}),Uo(I,{id:g,style:v,size:f,isSelected:s,isDarkMode:a.isDarkMode}),re]})]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:t}=e;return Uo("polygon",{points:Xt(t).join()})}));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.label!==e.label);d(this,"getBounds",e=>Et(e,this.boundsCache));d(this,"getExpandedBounds",e=>oo.getBoundsFromPoints(Xt(e.size,this.bindingDistance).map(t=>St.add(t,e.point))));d(this,"hitTestLineSegment",(e,t,n)=>TS(t,n,this.getPoints(e)).didIntersect);d(this,"hitTestBounds",(e,t)=>oo.boundsContained(this.getBounds(e),t)||vS(t,this.getPoints(e)).length>0);d(this,"getBindingPoint",(e,t,n,r,s,l)=>{let a=this.getExpandedBounds(e);if(!oo.pointInBounds(n,a))return;let c=Xt(e.size).map(y=>St.add(y,e.point)),p=Xt(e.size,this.bindingDistance).map(y=>St.add(y,e.point)),u=oo.pointsToLineSegments(c,!0).map(([y,x])=>St.distanceToLineSegment(y,x,n)).sort((y,x)=>y-x)[0];if(!(oo.pointInPolygon(n,p)||u<this.bindingDistance))return;let h=oo.pointsToLineSegments(p.concat([p[0]])).map(y=>xS(r,s,y[0],y[1])).filter(y=>y.didIntersect).flatMap(y=>y.points);if(!h.length)return;let g=St.add(va(e.size),e.point),m=h.sort((y,x)=>St.dist(x,r)-St.dist(y,r))[0],f=St.med(n,m),v,b;l?(v=St.dist(n,g)<16/2?g:n,b=0):(St.distanceToLineSegment(n,f,g)<16/2?v=g:v=f,oo.pointInPolygon(n,c)?b=this.bindingDistance:b=Math.max(this.bindingDistance,u));let T=St.divV(St.sub(v,[a.minX,a.minY]),[a.width,a.height]);return{point:St.clampV(T,0,1),distance:b}});d(this,"transform",vn);d(this,"transformSingle",Tn)}getPoints(e){let{rotation:t=0,point:[n,r],size:[s,l]}=e;return[[n+s/2,r],[n,r+l],[n+s,r+l]].map(a=>St.rotWith(a,this.getCenter(e),t))}},kS=P("div",{width:"100%",height:"100%"});import{styled as Uc}from"@stitches/react";import*as un from"react";import{HTMLContainer as CS,Utils as wS}from"telva-core";import{jsx as Dr,jsxs as RS}from"react/jsx-runtime";var Ki=class extends q{constructor(){super(...arguments);d(this,"type","video");d(this,"canBind",!0);d(this,"canEdit",!0);d(this,"canClone",!0);d(this,"isAspectRatioLocked",!0);d(this,"showCloneHandles",!1);d(this,"isStateful",!0);d(this,"getShape",e=>wS.deepMerge({id:"video",type:"video",name:"Video",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:He,assetId:"assetId",isPlaying:!0,currentTime:0},e));d(this,"Component",q.Component(({shape:e,asset:t={src:""},isBinding:n,isEditing:r,isGhost:s,meta:l,events:a,onShapeChange:c},p)=>{let u=un.useRef(null),h=un.useRef(null),{currentTime:g=0,size:m,isPlaying:f,style:v}=e;un.useLayoutEffect(()=>{let x=h.current;if(!x)return;let[I,k]=m;x.style.width=`${I}px`,x.style.height=`${k}px`},[m]),un.useLayoutEffect(()=>{let x=u.current;!x||(f?x.play():x.pause())},[f]),un.useLayoutEffect(()=>{let x=u.current;!x||g!==x.currentTime&&(x.currentTime=g)},[g]);let b=un.useCallback(()=>{c==null||c({id:e.id,isPlaying:!0})},[]),T=un.useCallback(()=>{c==null||c({id:e.id,isPlaying:!1})},[]),y=un.useCallback(()=>{let x=u.current;!x||!r||c==null||c({id:e.id,currentTime:x.currentTime})},[r]);return RS(CS,w(S({ref:p},a),{children:[n&&Dr("div",{className:"tv-binding-indicator",style:{position:"absolute",top:-this.bindingDistance,left:-this.bindingDistance,width:`calc(100% + ${this.bindingDistance*2}px)`,height:`calc(100% + ${this.bindingDistance*2}px)`,backgroundColor:"var(--tv-selectFill)"}}),Dr(IS,{ref:h,isDarkMode:l.isDarkMode,isGhost:s,isFilled:v.isFilled,children:Dr(PS,{ref:u,id:e.id+"_video",muted:!0,loop:!0,playsInline:!0,disableRemotePlayback:!0,disablePictureInPicture:!0,controls:r,autoPlay:f,onPlay:b,onPause:T,onTimeUpdate:y,children:Dr("source",{src:t.src})})})]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:[t,n]}=e;return Dr("rect",{x:0,y:0,rx:2,ry:2,width:Math.max(1,t),height:Math.max(1,n)})}));d(this,"getBounds",e=>Et(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.isPlaying!==e.isPlaying);d(this,"getSvgElement",e=>{let t=this.getBounds(e),n=document.createElementNS("http://www.w3.org/2000/svg","image");return n.setAttribute("width",`${t.width}`),n.setAttribute("height",`${t.height}`),n.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),n});d(this,"transform",vn);d(this,"transformSingle",Tn)}},IS=Uc("div",{pointerEvents:"all",position:"relative",fontFamily:"sans-serif",fontSize:"2em",height:"100%",width:"100%",borderRadius:"3px",perspective:"800px",overflow:"hidden",p:{userSelect:"none"},img:{userSelect:"none"},variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isFilled:{true:{},false:{}},isDarkMode:{true:{},false:{}}},compoundVariants:[{isFilled:!0,isDarkMode:!0,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.3), 1px 1px 4px rgba(0,0,0,.3), 1px 1px 2px rgba(0,0,0,.3)"}},{isFilled:!0,isDarkMode:!1,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.2), 1px 1px 4px rgba(0,0,0,.16), 1px 1px 2px rgba(0,0,0,.16)"}}]}),PS=Uc("video",{position:"absolute",top:0,left:0,width:"100%",height:"100%",maxWidth:"100%",minWidth:"100%",pointerEvents:"none",objectFit:"cover",userSelect:"none",borderRadius:2});var ka=new Oi,Ca=new Ui,wa=new Ei,Ia=new Ri,Er=new Ii,DS=new ji,ES=new Bi,_i=new Gi,BS=new Li,MS=new Ki,LS=new Hi,AS=new Vi,kn={["rectangle"]:ka,["triangle"]:Ca,["ellipse"]:wa,["draw"]:Ia,["arrow"]:Er,["text"]:DS,["group"]:ES,["sticky"]:_i,["image"]:BS,["video"]:MS,["reactComponent"]:LS,["pen"]:AS},Kc=i=>typeof i=="string"?kn[i]:kn[i.type];var _c=!1,W=class{static getShapeUtil(o){return Kc(o)}static getSelectedShapes(o,e){let t=W.getPage(o,e);return W.getSelectedIds(o,e).map(r=>t.shapes[r])}static screenToWorld(o,e){let t=W.getPageState(o,o.appState.currentPageId).camera;return X.sub(X.div(e,t.zoom),t.point)}static getCameraZoom(o){return jt.clamp(o,.1,5)}static getPage(o,e){return o.document.pages[e]}static getPageState(o,e){return o.document.pageStates[e]}static getSelectedIds(o,e){return W.getPageState(o,e).selectedIds}static getShapes(o,e){return Object.values(W.getPage(o,e).shapes)}static getCamera(o,e){return W.getPageState(o,e).camera}static getShape(o,e,t){return W.getPage(o,t).shapes[e]}static getCenter(o){return W.getShapeUtil(o).getCenter(o)}static getBounds(o){return W.getShapeUtil(o).getBounds(o)}static getRotatedBounds(o){return W.getShapeUtil(o).getRotatedBounds(o)}static getSelectedBounds(o){return jt.getCommonBounds(W.getSelectedShapes(o,o.appState.currentPageId).map(e=>W.getShapeUtil(e).getBounds(e)))}static getParentId(o,e,t){return W.getShape(o,e,t).parentId}static getDocumentBranch(o,e,t){let n=W.getShape(o,e,t);return n.children===void 0?[e]:[e,...n.children.flatMap(r=>W.getDocumentBranch(o,r,t))]}static getSelectedBranchSnapshot(o,e,t){let n=W.getPage(o,e),r=W.getSelectedIds(o,e).flatMap(s=>W.getDocumentBranch(o,s,e).map(l=>n.shapes[l])).filter(s=>!s.isLocked).map(jt.deepClone);return t!==void 0?r.map(s=>S({id:s.id},t(s))):r}static getSelectedShapeSnapshot(o,e,t){let n=W.getSelectedShapes(o,e).filter(r=>!r.isLocked).map(jt.deepClone);return t!==void 0?n.map(r=>S({id:r.id},t(r))):n}static getAllEffectedShapeIds(o,e,t){let n=W.getPage(o,t),r=new Set(e);return e.forEach(s=>{let l=n.shapes[s];function a(p){p.children!==void 0&&p.children.filter(u=>!r.has(u)).forEach(u=>{r.add(u),a(n.shapes[u])})}a(l);function c(p){let u=p.parentId;u!==n.id&&(r.has(u)||(r.add(u),c(n.shapes[u])))}c(l),r.forEach(p=>{Object.values(n.bindings).filter(u=>u.fromId===p||u.toId===p).forEach(u=>r.add(u.fromId===p?u.toId:u.fromId))})}),Array.from(r.values())}static getLinkedShapeIds(o,e,t,n=!0){let r=W.getSelectedIds(o,e),s=W.getPage(o,e),l=new Set(r),a=new Set,c=[...r],p=new Set(Object.values(s.shapes).filter(u=>{var h;return u.type==="arrow"&&(u.handles.start.bindingId||((h=u.handles)==null?void 0:h.end.bindingId))}));for(;c.length;){let u=c.pop();if(!(u&&p.size))break;a.has(u)||(a.add(u),p.forEach(h=>{var T,y;let{handles:{start:{bindingId:g},end:{bindingId:m}}}=h,f=g?s.bindings[g]:null,v=m?s.bindings[m]:null,b=!1;f&&f.toId===u?(t==="center"?b=!0:((T=h.decorations)==null?void 0:T.start)&&v?b=t==="left":b=t==="right",b&&(n&&l.add(h.id),l.add(u),v&&(l.add(v.toId),c.push(v.toId)))):v&&v.toId===u&&(t==="center"?b=!0:((y=h.decorations)==null?void 0:y.end)&&f?b=t==="left":b=t==="right",b&&(n&&l.add(h.id),l.add(u),f&&(l.add(f.toId),c.push(f.toId)))),(!f||l.has(f.toId))&&(!v||l.has(v.toId))&&p.delete(h)}))}return Array.from(l.values())}static getChildIndexAbove(o,e,t){let n=o.document.pages[t],r=n.shapes[e],s;if(r.parentId===n.id)s=Object.values(n.shapes).filter(c=>c.parentId===n.id).sort((c,p)=>c.childIndex-p.childIndex);else{let c=n.shapes[r.parentId];if(!c.children)throw Error("No children in parent!");s=c.children.map(p=>n.shapes[p]).sort((p,u)=>p.childIndex-u.childIndex)}let l=s.indexOf(r),a=s[l+1];return a?a.childIndex:r.childIndex+1}static getBeforeShape(o,e){return Object.fromEntries(Object.keys(e).map(t=>[t,o[t]]))}static mutateShapes(o,e,t,n,r=!1){let s={},l={};e.forEach((c,p)=>{let u=W.getShape(o,c,n);if(u.isLocked)return;(u==null?void 0:u.type)==="group"&&(e.length===1||r)&&u.children.forEach((g,m)=>{let f=W.getShape(o,g,n);if(f.isLocked)return;let v=t(f,m);v&&(s[g]=W.getBeforeShape(f,v),l[g]=v)});let h=t(u,p);h&&(s[c]=W.getBeforeShape(u,h),l[c]=h)});let a=jt.deepMerge(o,{document:{pages:{[o.appState.currentPageId]:{shapes:l}}}});return{before:s,after:l,data:a}}static createShapes(o,e,t){let n={document:{pages:{[t]:{shapes:S({},Object.fromEntries(e.flatMap(s=>{let l=[[s.id,void 0]];if(s.parentId!==t){let a=W.getShape(o,s.parentId,t);if(!a.children)throw Error("No children in parent!");l.push([a.id,{children:a.children}])}return l})))}}}},r={document:{pages:{[t]:{shapes:{shapes:S({},Object.fromEntries(e.flatMap(s=>{let l=[[s.id,s]];if(s.parentId!==t){let a=W.getShape(o,s.parentId,t);if(!a.children)throw Error("No children in parent!");l.push([a.id,{children:[...a.children,s.id]}])}return l})))}}}}};return{before:n,after:r}}static deleteShapes(o,e,t){t=t||o.appState.currentPageId;let n=W.getPage(o,t),r=typeof e[0]=="string"?e:e.map(a=>a.id),s={document:{pages:{[t]:{shapes:S({},Object.fromEntries(r.flatMap(a=>{let c=n.shapes[a],p=[[c.id,c]];if(c.parentId!==t){let u=n.shapes[c.parentId];if(!u.children)throw Error("No children in parent!");p.push([u.id,{children:u.children}])}return p}))),bindings:S({},Object.fromEntries(Object.values(n.bindings).filter(a=>r.includes(a.fromId)||r.includes(a.toId)).map(a=>[a.id,a])))}}}},l={document:{pages:{[t]:{shapes:S({},Object.fromEntries(r.flatMap(a=>{let c=n.shapes[a],p=[[c.id,void 0]];if(c.parentId!==n.id){let u=n.shapes[c.parentId];if(!u.children)throw Error("No children in parent!");p.push([u.id,{children:u.children.filter(h=>h!==c.id)}])}return p})))}}}};return{before:s,after:l}}static onSessionComplete(o){var t,n;let e=(n=(t=W.getShapeUtil(o)).onSessionComplete)==null?void 0:n.call(t,o);return e?S(S({},o),e):o}static onChildrenChange(o,e,t){var r,s;if(!e.children)return;let n=(s=(r=W.getShapeUtil(e)).onChildrenChange)==null?void 0:s.call(r,e,e.children.map(l=>W.getShape(o,l,t)));return n?S(S({},e),n):e}static updateArrowBindings(o,e){var s,l,a,c,p,u;let t={start:it(e.handles.start),end:it(e.handles.end)},n={isBound:!1,handle:e.handles.start,point:X.add(e.handles.start.point,e.point)},r={isBound:!1,handle:e.handles.end,point:X.add(e.handles.end.point,e.point)};if(e.handles.start.bindingId){let h=((s=e.decorations)==null?void 0:s.start)!==void 0,g=e.handles.start,m=o.bindings[e.handles.start.bindingId];if(!m)throw Error("Could not find a binding to match the start handle's bindingId: "+e.handles.start.bindingId);let f=o.shapes[m.toId],v=W.getShapeUtil(f),b=v.getBounds(f),T=v.getExpandedBounds(f),y=h?jt.expandBounds(b,m.distance):b,{minX:x,minY:I,width:k,height:R}=T,C=X.add([x,I],X.mulV([k,R],X.rotWith(m.point,[.5,.5],f.rotation||0)));n={isBound:!0,hasDecoration:h,binding:m,handle:g,point:C,util:v,target:f,bounds:b,expandedBounds:T,intersectBounds:y,center:v.getCenter(f)}}if(e.handles.end.bindingId){let h=((l=e.decorations)==null?void 0:l.end)!==void 0,g=e.handles.end,m=o.bindings[e.handles.end.bindingId];if(!m)throw Error("Could not find a binding to match the end handle's bindingId");let f=o.shapes[m.toId],v=W.getShapeUtil(f),b=v.getBounds(f),T=v.getExpandedBounds(f),y=h?jt.expandBounds(b,m.distance):b,{minX:x,minY:I,width:k,height:R}=T,C=X.add([x,I],X.mulV([k,R],X.rotWith(m.point,[.5,.5],f.rotation||0)));r={isBound:!0,hasDecoration:h,binding:m,handle:g,point:C,util:v,target:f,bounds:b,expandedBounds:T,intersectBounds:y,center:v.getCenter(f)}}for(let h of["end","start"]){let g=h==="start"?n:r,m=h==="start"?r:n;if(g.isBound)if(!g.binding.distance)t[h].point=X.sub(g.point,e.point);else{let f=X.uni(X.sub(g.point,m.point));switch(g.target.type){case"ellipse":{let v=VS(m.point,f,g.center,g.target.radius[0]+(g.hasDecoration?g.binding.distance:0),g.target.radius[1]+(g.hasDecoration?g.binding.distance:0),g.target.rotation||0).points.sort((b,T)=>X.dist(b,m.point)-X.dist(T,m.point));v[0]!==void 0&&(t[h].point=X.toFixed(X.sub(v[0],e.point)));break}case"triangle":{let v=g.target.point,b=Xt(g.target.size,g.hasDecoration?16:0,g.target.rotation).map(y=>X.add(y,v)),T=jt.pointsToLineSegments(b,!0).map(([y,x])=>HS(m.point,f,y,x)).filter(y=>y.didIntersect).flatMap(y=>y.points).sort((y,x)=>X.dist(y,m.point)-X.dist(x,m.point));T[0]!==void 0&&(t[h].point=X.toFixed(X.sub(T[0],e.point)));break}default:{let v=Pa(m.point,f,g.intersectBounds,g.target.rotation).filter(T=>T.didIntersect).map(T=>T.points[0]).sort((T,y)=>X.dist(T,m.point)-X.dist(y,m.point));if(!v[0])continue;let b;if(m.isBound&&(b=Pa(m.point,f,m.intersectBounds,m.target.rotation).filter(y=>y.didIntersect).map(y=>y.points[0]).sort((y,x)=>X.dist(y,m.point)-X.dist(x,m.point))[0]),m.isBound&&(v.length<2||b&&v[0]&&Math.ceil(X.dist(v[0],b))<16*2.5||jt.boundsContain(g.expandedBounds,m.expandedBounds)||jt.boundsCollide(g.expandedBounds,m.expandedBounds))){let T=X.uni(X.sub(m.point,g.point)),y=Pa(g.point,T,g.bounds,g.target.rotation).filter(x=>x.didIntersect).map(x=>x.points[0]);if(!y[0])continue;t[h].point=X.toFixed(X.sub(y[0],e.point)),t[h==="start"?"end":"start"].point=X.toFixed(X.add(X.sub(y[0],e.point),X.mul(T,Math.min(X.dist(y[0],m.point),16*2.5*(jt.boundsContain(m.bounds,g.intersectBounds)?-1:1)))))}else if(!m.isBound&&(v[0]&&X.dist(v[0],m.point)<16*2.5||jt.pointInBounds(m.point,g.intersectBounds))){let T=X.uni(X.sub(g.center,m.point));return(c=(a=W.getShapeUtil(e)).onHandleChange)==null?void 0:c.call(a,e,{[h]:w(S({},e.handles[h]),{point:X.toFixed(X.add(X.sub(m.point,e.point),X.mul(T,16*2.5)))})})}else v[0]&&(t[h].point=X.toFixed(X.sub(v[0],e.point)))}}}}return(u=(p=W.getShapeUtil(e)).onHandleChange)==null?void 0:u.call(p,e,t)}static transform(o,e,t){let n=W.getShapeUtil(o).transform(o,e,t);return n?S(S({},o),n):o}static transformSingle(o,e,t){let n=W.getShapeUtil(o).transformSingle(o,e,t);return n?S(S({},o),n):o}static getRotatedShapeMutation(o,e,t,n){var c,p;let r=X.sub(e,o.point),s=X.rotWith(e,t,n),l=X.toFixed(X.sub(s,r));if(o.handles!==void 0)return(p=(c=this.getShapeUtil(o)).onHandleChange)==null?void 0:p.call(c,w(S({},o),{point:l}),Object.fromEntries(Object.entries(o.handles).map(([h,g])=>{let m=X.toFixed(X.rotWith(g.point,r,n));return[h,w(S({},g),{point:m})]})));let a=jt.clampRadians((o.rotation||0)+n);return{point:l,rotation:a}}static updateParents(o,e,t){let n=W.getPage(o,e);if(t.length===0)return;let{shapes:r}=W.getPage(o,e),s=Array.from(new Set(t.map(l=>r[l].parentId).values())).filter(l=>l!==n.id);for(let l of s){let a=r[l];if(!a.children)throw Error("A shape is parented to a shape without a children array.");W.onChildrenChange(o,a,e)}W.updateParents(o,e,s)}static getBinding(o,e,t){return W.getPage(o,t).bindings[e]}static getBindings(o,e){let t=W.getPage(o,e);return Object.values(t.bindings)}static getBindableShapeIds(o){return W.getShapes(o,o.appState.currentPageId).filter(e=>W.getShapeUtil(e).canBind).sort((e,t)=>t.childIndex-e.childIndex).map(e=>e.id)}static getBindingsWithShapeIds(o,e,t){return Array.from(new Set(W.getBindings(o,t).filter(n=>e.includes(n.toId)||e.includes(n.fromId))).values())}static getRelatedBindings(o,e,t){let n=new Set(e),r=W.getPage(o,t),s=Object.values(r.bindings),l=new Set(s.filter(p=>n.has(p.toId)||n.has(p.fromId))),a=l.size,c=-1;for(;c!==0;)l.forEach(p=>{let u=p.fromId;for(let h of s)h.fromId===u&&l.add(h),h.toId===u&&l.add(h)}),c=l.size-a,a=l.size;return Array.from(l.values())}static normalizeText(o){return o.replace(W.fixNewLines,`
9
+ `,e-1)+1,s=Fe.findLineEnd(n,t),l=o.value.slice(r,s),a=l.replace(/(^|\n)(\t| {1,2})/g,"$1"),c=l.length-a.length;o.setSelectionRange(r,s),Fe.insert(o,a);let p=/\t| {1,2}/.exec(n.slice(r,e)),u=p?p[0].length:0,h=e-u;o.setSelectionRange(e-u,Math.max(h,t-c))}};import*as st from"react";var ot=i=>i.stopPropagation();import{Utils as jt}from"telva-core";import{intersectRayBounds as Pa,intersectRayEllipse as VS,intersectRayLineSegment as HS}from"telva-intersect";import{Vec as X}from"telva-vec";function rt(i){if(i===null)return i;if(i instanceof Date)return new Date(i.getTime());if(typeof i=="object")if(typeof i[Symbol.iterator]=="function"){let o=[];if(i.length>0)for(let e of i)o.push(rt(e));return o}else{let o=Object.keys(i),e={};if(o.length>0)for(let t of o)e[t]=rt(i[t]);return e}return i}import*as To from"react";import{SVGContainer as ef,Utils as dn}from"telva-core";import{intersectArcBounds as tf,intersectLineSegmentBounds as nf,intersectLineSegmentLineSegment as of}from"telva-intersect";import{Vec as U}from"telva-vec";import*as jd from"react";import{TLShapeUtil as Gg,Utils as Fn}from"telva-core";import{intersectLineSegmentBounds as jg,intersectLineSegmentPolyline as Wg,intersectRayBounds as Ng}from"telva-intersect";import{Vec as On}from"telva-vec";var q=class extends Gg{constructor(){super(...arguments);d(this,"canBind",!1);d(this,"canEdit",!1);d(this,"canClone",!1);d(this,"isAspectRatioLocked",!1);d(this,"hideResizeHandles",!1);d(this,"bindingDistance",16);d(this,"hitTestPoint",(e,t)=>Fn.pointInBounds(t,this.getRotatedBounds(e)));d(this,"hitTestLineSegment",(e,t,n)=>{let r=Fn.getBoundsFromPoints([t,n]),s=this.getBounds(e);return Fn.boundsContain(s,r)||e.rotation?Wg(t,n,Fn.getRotatedCorners(this.getBounds(e))).didIntersect:jg(t,n,this.getBounds(e)).length>0});d(this,"create",e=>(this.refMap.set(e.id,jd.createRef()),this.getShape(e)));d(this,"getCenter",e=>Fn.getBoundsCenter(this.getBounds(e)));d(this,"getExpandedBounds",e=>Fn.expandBounds(this.getBounds(e),this.bindingDistance));d(this,"getBindingPoint",(e,t,n,r,s,l)=>{let a=this.getBounds(e),c=this.getExpandedBounds(e);if(!Fn.pointInBounds(n,c))return;let p=Ng(r,s,c).filter(b=>b.didIntersect).map(b=>b.points[0]);if(!p.length)return;let u=this.getCenter(e),h=p.sort((b,T)=>On.dist(T,r)-On.dist(b,r))[0],g=On.med(n,h),m,f;l?(m=On.dist(n,u)<16/2?u:n,f=0):(On.distanceToLineSegment(n,g,u)<16/2?m=u:m=g,Fn.pointInBounds(n,a)?f=this.bindingDistance:f=Math.max(this.bindingDistance,Fn.getBoundsSides(a).map(b=>On.distanceToLineSegment(b[1][0],b[1][1],n)).sort((b,T)=>b-T)[0]));let v=On.divV(On.sub(m,[c.minX,c.minY]),[c.width,c.height]);return{point:On.clampV(v,0,1),distance:f}});d(this,"mutate",(e,t)=>t);d(this,"transform",(e,t,n)=>w(S({},e),{point:[t.minX,t.minY]}));d(this,"transformSingle",(e,t,n)=>this.transform(e,t,n));d(this,"updateChildren");d(this,"onChildrenChange");d(this,"onHandleChange");d(this,"onRightPointHandle");d(this,"onDoubleClickHandle");d(this,"onDoubleClickBoundsHandle");d(this,"onSessionComplete");d(this,"getSvgElement",(e,t)=>{var s,l,a,c,p;let n=(s=document.getElementById(e.id+"_svg"))==null?void 0:s.cloneNode(!0);if(!n)return;if((c=(a=(l=e.label)==null?void 0:l.trim())==null?void 0:a.length)!=null?c:0>0){let u=e,h=document.createElementNS("http://www.w3.org/2000/svg","g"),g=Ct(e.style),m=bo(e.style.size,e.style.font)*((p=e.style.scale)!=null?p:1),f=bn(e.style.font).slice(1,-1),v=this.getBounds(e),b=Math.max(0,v.width-16),T=Zn(e.label,g,b),y=qn(u.label,m,f,"middle",b,!0);return y.setAttribute("transform",`translate(${v.width/2-b/2}, ${v.height/2-T[1]/2})`),y.setAttribute("fill",J(e.style,t).stroke),y.setAttribute("transform-origin","center center"),h.setAttribute("text-align","center"),h.setAttribute("text-anchor","middle"),h.appendChild(n),h.appendChild(y),h}return n})}};import Ud from"perfect-freehand";import{Utils as Jn}from"telva-core";import{intersectCircleCircle as Ug,intersectCircleLineSegment as Kg}from"telva-intersect";import fe from"telva-vec";function Kd(i,o,e,t){return["M",i[0],i[1],"A",e[2],e[2],0,0,t<0?0:1,o[0],o[1]].join(" ")}function br(i,o){let{start:e,end:t}=i,n=fe.dist(e.point,t.point),r=fe.med(e.point,t.point),s=n/2*o,l=fe.uni(fe.vec(e.point,t.point));return fe.toFixed(Math.abs(s)<10?r:fe.add(r,fe.mul(fe.per(l),s)))}function _d(i,o,e,t,n,r){let s=Jn.rng(i),l=J(o).strokeWidth,a=n?fe.nudge(e,t,l):e,c=r?fe.nudge(t,e,l):t,p=Ud([a,c],{size:l,thinning:.618+s()*.2,easing:So.easeOutQuad,simulatePressure:!0,streamline:0,last:!0});return Jn.getSvgPathFromStroke(p)}function Yd(i,o,e,t,n,r,s,l,a,c){let p=Jn.rng(i),u=J(o).strokeWidth,h=n?fe.rotWith(e,s,u/a):e,g=r?fe.rotWith(t,s,-(u/a)):t,m=fe.angle(s,h),f=fe.angle(s,g),v=[],b=8+Math.floor(Math.abs(a)/20*1+p()/2);for(let y=0;y<b;y++){let x=c(y/b),I=Jn.lerpAngles(m,f,x);v.push(fe.toFixed(fe.nudgeAtAngle(s,I,l)))}let T=Ud([h,...v,g],{size:1+u,thinning:.618+p()*.2,easing:So.easeOutQuad,simulatePressure:!1,streamline:0,last:!0});return Jn.getSvgPathFromStroke(T)}function $n(i,o,e){return Jn.circleFromThreePoints(i,e,o)}function vi(i,o,e,t,n){let r=Ug(i,o*.618,e,t).points;if(!r)return B.warn("Could not find an intersection for the arrow head."),{left:i,right:i};let s=n?r[0]:r[1],l=s?fe.nudge(fe.rotWith(s,i,Math.PI/6),i,o*-.382):i,a=s?fe.nudge(fe.rotWith(s,i,-Math.PI/6),i,o*-.382):i;return{left:l,right:a}}function Ti(i,o,e){let t=Kg(i,e,i,o).points;if(!t)return B.warn("Could not find an intersection for the arrow head."),{left:i,right:i};let n=t[0],r=n?fe.rotWith(n,i,Math.PI/6):i,s=n?fe.rotWith(n,i,-Math.PI/6):i;return{left:r,right:s}}function Wd(i,o,e,t,n){let{left:r,right:s}=vi(i,o,e,t,n);return`M ${r} L ${i} ${s}`}function Nd(i,o,e){let{left:t,right:n}=Ti(i,o,e);return`M ${t} L ${i} ${n}`}function Xd(i,o,e,t,n,r){let{strokeWidth:s}=J(i,!1),l=fe.dist(o,t),a=Math.min(l/3,s*8),c=[];if(fe.dist(e,fe.toFixed(fe.med(o,t)))<1)c.push(`M ${o} L ${t}`),n&&c.push(Nd(o,t,a)),r&&c.push(Nd(t,o,a));else{let u=$n(o,e,t),h=[u[0],u[1]],g=u[2],m=vo(h,g,o,t);c.push(`M ${o} A ${g} ${g} 0 0 ${m>0?"1":"0"} ${t}`),n&&c.push(Wd(o,a,h,g,m<0)),r&&c.push(Wd(t,a,h,g,m>=0))}return c.join(" ")}function vr(i,o,e){if(fe.dist2(o,fe.med(i,e))<=4)return[i,e];let t=[],n=$n(i,o,e),r=[n[0],n[1]],s=n[2],l=fe.angle(r,i),a=fe.angle(r,e);for(let c=0;c<20;c++){let p=c/19,u=Jn.lerpAngles(l,a,p);t.push(fe.nudgeAtAngle(r,u,s))}return t}function Zd(i,o,e){if(e===i||e===o)return!0;let t=Math.PI*2,n=(o-i+t)%t,r=(e-i+t)%t;return n<=Math.PI!=r>n}function vo(i,o,e,t){let n=Jn.getSweep(i,e,t);return o*(2*Math.PI)*(n/(2*Math.PI))}import*as Qd from"react";import{Utils as Jd}from"telva-core";import Yg from"telva-vec";import{jsx as qd,jsxs as _g}from"react/jsx-runtime";function $o({left:i,middle:o,right:e,stroke:t,strokeWidth:n}){return _g("g",{children:[qd("path",{className:"tv-stroke-hitarea",d:`M ${i} L ${o} ${e}`}),qd("path",{d:`M ${i} L ${o} ${e}`,fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"})]})}import{Fragment as Xg,jsx as xi,jsxs as Zg}from"react/jsx-runtime";var ec=Qd.memo(function({id:o,style:e,start:t,bend:n,end:r,arrowBend:s,decorationStart:l,decorationEnd:a,isDraw:c,isDarkMode:p}){let u=Yg.dist(t,r);if(u<2)return null;let h=J(e,p),{strokeWidth:g}=h,m=1+g*1.618,f=$n(t,n,r),v=[f[0],f[1]],b=f[2],T=vo(v,b,t,r),y=Jd.rng(o),x=So[y()>0?"easeInOutSine":"easeInOutCubic"],I=c?Yd(o,e,t,r,l,a,v,b,T,x):Kd(t,r,f,s),{strokeDasharray:k,strokeDashoffset:R}=Jd.getPerfectDashProps(Math.abs(T),m,e.dash,2,!1),C=Math.min(u/3,g*8),E=l?vi(t,C,v,b,T<0):null,M=a?vi(r,C,v,b,T>=0):null;return Zg(Xg,{children:[xi("path",{className:"tv-stroke-hitarea",d:I}),xi("path",{d:I,fill:c?h.stroke:"none",stroke:h.stroke,strokeWidth:c?0:m,strokeDasharray:k,strokeDashoffset:R,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}),E&&xi($o,{left:E.left,middle:t,right:E.right,stroke:h.stroke,strokeWidth:m}),M&&xi($o,{left:M.left,middle:r,right:M.right,stroke:h.stroke,strokeWidth:m})]})});import*as tc from"react";import{Utils as qg}from"telva-core";import ia from"telva-vec";import{Fragment as Jg,jsx as ki,jsxs as Qg}from"react/jsx-runtime";var nc=tc.memo(function({id:o,style:e,start:t,end:n,decorationStart:r,decorationEnd:s,isDraw:l,isDarkMode:a}){let c=ia.dist(t,n);if(c<2)return null;let p=J(e,a),{strokeWidth:u}=p,h=1+u*1.618,g=l?_d(o,e,t,n,r,s):"M"+ia.toFixed(t)+"L"+ia.toFixed(n),{strokeDasharray:m,strokeDashoffset:f}=qg.getPerfectDashProps(c,u*1.618,e.dash,2,!1),v=Math.min(c/3,u*8),b=r?Ti(t,n,v):null,T=s?Ti(n,t,v):null;return Qg(Jg,{children:[ki("path",{className:"tv-stroke-hitarea",d:g}),ki("path",{d:g,fill:p.stroke,stroke:p.stroke,strokeWidth:l?h/2:h,strokeDasharray:m,strokeDashoffset:f,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"stroke"}),b&&ki($o,{left:b.left,middle:t,right:b.right,stroke:p.stroke,strokeWidth:h}),T&&ki($o,{left:T.left,middle:n,right:T.right,stroke:p.stroke,strokeWidth:h})]})});import{Fragment as sf,jsx as Gn,jsxs as Ci}from"react/jsx-runtime";var wi=class extends q{constructor(){super(...arguments);d(this,"type","arrow");d(this,"hideBounds",!0);d(this,"canEdit",!0);d(this,"pathCache",new WeakMap);d(this,"getShape",e=>{var t,n,r,s;return S({id:"id",type:"arrow",name:"Arrow",parentId:"page",childIndex:1,point:[0,0],rotation:0,bend:0,handles:{start:S({id:"start",index:0,point:[0,0],canBind:!0},(t=e.handles)==null?void 0:t.start),end:S({id:"end",index:1,point:[1,1],canBind:!0},(n=e.handles)==null?void 0:n.end),bend:S({id:"bend",index:2,point:[.5,.5]},(r=e.handles)==null?void 0:r.bend)},decorations:(s=e.decorations)!=null?s:{end:"arrow"},style:S(w(S({},He),{isFilled:!1}),e.style),label:"",labelPoint:[.5,.5]},e)});d(this,"Component",q.Component(({shape:e,isEditing:t,isGhost:n,meta:r,events:s,onShapeChange:l,onShapeBlur:a},c)=>{var A,K,re;let{id:p,label:u="",handles:{start:h,bend:g,end:m},decorations:f={},style:v}=e,b=(K=(A=u==null?void 0:u.trim())==null?void 0:A.length)!=null?K:0>0,T=U.dist(g.point,U.toFixed(U.med(h.point,m.point)))<1,y=Ct(v),x=J(v,r.isDarkMode),I=b||t?Zn(u,y):[0,0],k=this.getBounds(e),R=To.useMemo(()=>{let{start:F,bend:ee,end:pe}=e.handles;if(T)return U.dist(F.point,pe.point);let he=$n(F.point,ee.point,pe.point),De=he.slice(0,2),ct=he[2],Ze=vo(De,ct,F.point,pe.point);return Math.abs(Ze)},[e.handles]),C=Math.max(.5,Math.min(1,Math.max(R/(I[1]+128),R/(I[0]+128)))),E=To.useMemo(()=>{let F=this.getBounds(e);return U.sub(e.handles.bend.point,U.toFixed([F.width/2,F.height/2]))},[e,C]),M=To.useCallback(F=>{l==null||l({id:p,label:F})},[l]),L=T?nc:ec;return Ci(rf,w(S({ref:c},s),{children:[Gn(Qn,{font:y,text:u,color:(re=v.labelColor)!=null?re:x.stroke,background:v.labelBackground,textGradient:v.textGradient,offsetX:E[0],offsetY:E[1],scale:C,isEditing:t,onChange:M,onBlur:a}),Ci(ef,{id:e.id+"_svg",children:[Gn("defs",{children:Ci("mask",{id:e.id+"_clip",children:[Gn("rect",{x:-100,y:-100,width:k.width+200,height:k.height+200,fill:"white"}),Gn("rect",{x:k.width/2-I[0]/2*C+E[0],y:k.height/2-I[1]/2*C+E[1],width:I[0]*C,height:I[1]*C,rx:4*C,ry:4*C,fill:"black",opacity:1})]})}),Gn("g",{pointerEvents:"none",opacity:n?.3:x.opacity,mask:b||t?`url(#${e.id}_clip)`:"",children:Gn(L,{id:p,style:v,start:h.point,end:m.point,bend:g.point,arrowBend:e.bend,decorationStart:f==null?void 0:f.start,decorationEnd:f==null?void 0:f.end,isDraw:v.dash==="draw",isDarkMode:r.isDarkMode})})]})]}))}));d(this,"Indicator",q.Indicator(({shape:e,bounds:t})=>{var b,T;let{style:n,decorations:r,label:s,handles:{start:l,bend:a,end:c}}=e,p=(T=(b=s==null?void 0:s.trim())==null?void 0:b.length)!=null?T:0>0,u=Ct(n),h=p?Zn(s,u):[0,0],g=U.dist(a.point,U.toFixed(U.med(l.point,c.point)))<1,m=To.useMemo(()=>{let{start:y,bend:x,end:I}=e.handles;if(g)return U.dist(y.point,I.point);let k=$n(y.point,x.point,I.point),R=k.slice(0,2),C=k[2],E=vo(R,C,y.point,I.point);return Math.abs(E)},[e.handles]),f=Math.max(.5,Math.min(1,Math.max(m/(h[1]+128),m/(h[0]+128)))),v=To.useMemo(()=>{let y=this.getBounds(e);return U.sub(e.handles.bend.point,[y.width/2,y.height/2])},[e,f]);return Ci(sf,{children:[p&&Gn(zd,{id:e.id,scale:f,offset:v,bounds:t,labelSize:h}),Gn("path",{d:Xd(n,l.point,a.point,c.point,r==null?void 0:r.start,r==null?void 0:r.end),mask:p?`url(#${e.id}_clip)`:""}),p&&Gn("rect",{x:t.width/2-h[0]/2*f+v[0],y:t.height/2-h[1]/2*f+v[1],width:h[0]*f,height:h[1]*f,rx:4*f,ry:4*f,fill:"transparent"})]})}));d(this,"getBounds",e=>{let t=dn.getFromCache(this.boundsCache,e,()=>{let{handles:{start:n,bend:r,end:s}}=e;return dn.getBoundsFromPoints(vr(n.point,r.point,s.point))});return dn.translateBounds(t,e.point)});d(this,"getRotatedBounds",e=>{let{handles:{start:t,bend:n,end:r}}=e,s=vr(t.point,n.point,r.point),{minX:l,minY:a,maxX:c,maxY:p}=dn.getBoundsFromPoints(s);return e.rotation!==0&&(s=s.map(u=>U.rotWith(u,[(l+c)/2,(a+p)/2],e.rotation||0))),dn.translateBounds(dn.getBoundsFromPoints(s),e.point)});d(this,"getCenter",e=>{let{start:t,end:n}=e.handles;return U.add(e.point,U.med(t.point,n.point))});d(this,"shouldRender",(e,t)=>t.decorations!==e.decorations||t.handles!==e.handles||t.style!==e.style||t.label!==e.label);d(this,"hitTestPoint",(e,t)=>{let{handles:{start:n,bend:r,end:s}}=e,l=U.sub(t,e.point),a=vr(n.point,r.point,s.point);for(let c=1;c<a.length;c++)if(U.distanceToLineSegment(a[c-1],a[c],l)<1)return!0;return!1});d(this,"hitTestLineSegment",(e,t,n)=>{let{handles:{start:r,bend:s,end:l}}=e,a=U.sub(t,e.point),c=U.sub(n,e.point),p=vr(r.point,s.point,l.point);for(let u=1;u<p.length;u++)if(of(p[u-1],p[u],a,c).didIntersect)return!0;return!1});d(this,"hitTestBounds",(e,t)=>{let{start:n,end:r,bend:s}=e.handles,l=U.add(e.point,n.point),a=U.add(e.point,r.point);if(dn.pointInBounds(l,t)||dn.pointInBounds(a,t))return!0;if(U.isEqual(U.med(n.point,r.point),s.point))return nf(l,a,t).length>0;{let[c,p,u]=$n(n.point,s.point,r.point),h=U.add(e.point,[c,p]);return tf(h,u,l,a,t).length>0}});d(this,"transform",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>{let l=this.getBounds(n),a=["start","end"],c=S({},n.handles);a.forEach(h=>{if(h==="bend")return;let[g,m]=c[h].point,f=g/l.width,v=m/l.height;c[h]=w(S({},c[h]),{point:[t.width*(r<0?1-f:f),t.height*(s<0?1-v:v)]})});let p=r>0&&s<0||r<0&&s>0?-n.bend:n.bend,u=br(c,p);return c.bend.point=u,{point:U.toFixed([t.minX,t.minY]),handles:c,bend:p}});d(this,"onDoubleClickHandle",(e,t)=>{var n,r;switch(t){case"bend":return{bend:0,handles:w(S({},e.handles),{bend:w(S({},e.handles.bend),{point:br(e.handles,e.bend)})})};case"start":return{decorations:w(S({},e.decorations),{start:(n=e.decorations)!=null&&n.start?void 0:"arrow"})};case"end":return{decorations:w(S({},e.decorations),{end:(r=e.decorations)!=null&&r.end?void 0:"arrow"})}}return this});d(this,"onHandleChange",(e,t)=>{let n=dn.deepMerge(e.handles,t),r=e.bend;if(n=dn.deepMerge(n,{start:{point:U.toFixed(n.start.point)},end:{point:U.toFixed(n.end.point)}}),U.isEqual(n.start.point,n.end.point))return;if("bend"in t){let{start:p,end:u,bend:h}=n,g=U.dist(p.point,u.point),m=U.med(p.point,u.point),f=U.angle(p.point,u.point),v=U.uni(U.vec(p.point,u.point)),b=U.add(m,U.mul(U.per(v),g)),T=U.sub(m,U.mul(U.per(v),g)),y=U.nearestPointOnLineSegment(b,T,h.point,!0),I=U.dist(m,y)/(g/2);r=dn.clamp(I,-.99,.99);let k=U.angle(p.point,y);U.isEqual(m,br(n,r))?r=0:Zd(f,f+Math.PI,k)&&(r*=-1)}let s={point:e.point,bend:r,handles:w(S({},n),{bend:w(S({},n.bend),{point:br(n,r)})})},l=e.point,a=this.getBounds(S({},s)),c=U.sub([a.minX,a.minY],l);return U.isEqual(c,[0,0])||(Object.values(s.handles).forEach(p=>{p.point=U.toFixed(U.sub(p.point,c))}),s.point=U.toFixed(U.add(s.point,c))),s});d(this,"getSvgElement",(e,t)=>{var s,l,a,c,p;let n=(s=document.getElementById(e.id+"_svg"))==null?void 0:s.cloneNode(!0);if(!n)return;if((c=(a=(l=e.label)==null?void 0:l.trim())==null?void 0:a.length)!=null?c:0>0){let u=e,h=document.createElementNS("http://www.w3.org/2000/svg","g"),g=Ct(e.style),m=Zn(e.label,g),f=bo(e.style.size,e.style.font)*((p=e.style.scale)!=null?p:1),v=bn(e.style.font).slice(1,-1),b=qn(u.label,f,v,"start",m[0],!1),T,{start:y,bend:x,end:I}=e.handles;if(U.dist(x.point,U.toFixed(U.med(y.point,I.point)))<1)T=U.dist(y.point,I.point);else{let A=$n(y.point,x.point,I.point),K=A.slice(0,2),re=A[2],F=vo(K,re,y.point,I.point);T=Math.abs(F)}let R=Math.max(.5,Math.min(1,Math.max(T/(m[1]+128),T/(m[0]+128)))),C=this.getBounds(e),E=U.sub(e.handles.bend.point,[C.width/2,C.height/2]),M=C.width/2-m[0]/2*R+E[0],L=C.height/2-m[1]/2*R+E[1];return b.setAttribute("transform",`translate(${M}, ${L})`),b.setAttribute("fill",J(e.style,t).stroke),b.setAttribute("transform-origin","center center"),h.setAttribute("text-align","center"),h.setAttribute("text-anchor","middle"),h.appendChild(n),h.appendChild(b),h}return n})}},rf=P("div",{width:"100%",height:"100%"});import*as Yt from"react";import{SVGContainer as ca,Utils as it}from"telva-core";import{intersectBoundsBounds as pf,intersectBoundsPolyline as dc,intersectLineSegmentBounds as uf,intersectLineSegmentLineSegment as hf}from"telva-intersect";import{Vec as cn}from"telva-vec";import{jsx as xo}from"react/jsx-runtime";function ut(i,o){var s,l,a;let e=o.gradient;if(!e||!o.isFilled||!e.stops||e.stops.length<2)return{defs:null,gradFill:null};let t=`grad-${i}`,n=e.stops.map((c,p)=>xo("stop",{offset:`${c.position}%`,stopColor:c.color,stopOpacity:c.opacity},p));if(e.type==="linear"){let p=(((s=e.angle)!=null?s:90)-90)*Math.PI/180,u=Math.cos(p),h=Math.sin(p),g=50-u*50,m=50-h*50,f=50+u*50,v=50+h*50;return{defs:xo("defs",{children:xo("linearGradient",{id:t,x1:`${g}%`,y1:`${m}%`,x2:`${f}%`,y2:`${v}%`,gradientUnits:"objectBoundingBox",children:n})}),gradFill:`url(#${t})`}}if(e.type==="radial"){let c=((l=e.centerX)!=null?l:50)/100,p=((a=e.centerY)!=null?a:50)/100;return{defs:xo("defs",{children:xo("radialGradient",{id:t,cx:c,cy:p,r:"0.5",gradientUnits:"objectBoundingBox",children:n})}),gradFill:`url(#${t})`}}return{defs:xo("defs",{children:xo("linearGradient",{id:t,x1:"0%",y1:"0%",x2:"100%",y2:"100%",gradientUnits:"objectBoundingBox",children:n})}),gradFill:`url(#${t})`}}import{getStrokeOutlinePoints as af,getStrokePoints as oc}from"perfect-freehand";import{Utils as aa}from"telva-core";import sa from"telva-vec";var lf={easing:i=>Math.sin(i*Math.PI/2),simulatePressure:!0},df={easing:i=>i*i,simulatePressure:!1};function la(i){let o=J(i.style);return w(S({size:1+o.strokeWidth*1.5,thinning:.7,streamline:.35,smoothing:.5},i.points[1][2]===.5?lf:df),{last:i.isComplete})}function rc(i){return i.points.length<2?"":aa.getSvgPathFromStroke(oc(i.points,la(i)).map(o=>o.point))}function ic(i,o){return oc(i.points,o)}function sc(i){if(i.points.length<2)return"";let o=la(i),e=ic(i,o);return aa.getSvgPathFromStroke(af(e,o))}function da(i){let{points:o}=i;if(o.length<2)return"M 0 0 L 0 0";let e=la(i),t=ic(i,e),n=o[o.length-1];return sa.isEqual(t[0].point,n)||t.push({point:n}),aa.getSvgPathFromStrokePoints(t)}function ac(i){let{points:o}=i;if(o.length<2)return"M 0 0 L 0 0";let e=Ii(o,3);if(e.length<2)return`M ${o[0][0]} ${o[0][1]} L ${o[o.length-1][0]} ${o[o.length-1][1]}`;let t=`M ${e[0][0].toFixed(2)} ${e[0][1].toFixed(2)}`;for(let n=1;n<e.length;n++)t+=` L ${e[n][0].toFixed(2)} ${e[n][1].toFixed(2)}`;return t}function lc(i){let{points:o}=i;if(o.length<3)return"";let e=Ii(o,3);if(e.length<3)return"";let t=`M ${e[0][0].toFixed(2)} ${e[0][1].toFixed(2)}`;for(let n=1;n<e.length;n++)t+=` L ${e[n][0].toFixed(2)} ${e[n][1].toFixed(2)}`;return t+=" Z",t}function Ii(i,o){if(i.length<=2)return i;let e=0,t=0,n=i[0],r=i[i.length-1];for(let s=1;s<i.length-1;s++){let l=cf(i[s],n,r);l>e&&(e=l,t=s)}if(e>o){let s=Ii(i.slice(0,t+1),o),l=Ii(i.slice(t),o);return[...s.slice(0,-1),...l]}return[n,r]}function cf(i,o,e){let t=e[0]-o[0],n=e[1]-o[1],r=Math.sqrt(t*t+n*n);if(r===0)return sa.dist(i,o);let s=((i[0]-o[0])*t+(i[1]-o[1])*n)/(r*r),l=[o[0]+s*t,o[1]+s*n];return sa.dist(i,l)}import{jsx as _t,jsxs as Go}from"react/jsx-runtime";var Pi=class extends q{constructor(){super(...arguments);d(this,"type","draw");d(this,"pointsBoundsCache",new WeakMap([]));d(this,"shapeBoundsCache",new Map);d(this,"rotatedCache",new WeakMap([]));d(this,"pointCache",{});d(this,"canClone",!0);d(this,"getShape",e=>it.deepMerge({id:"id",type:"draw",name:"Draw",parentId:"page",childIndex:1,point:[0,0],rotation:0,style:He,points:[],isComplete:!1},e));d(this,"Component",q.Component(({shape:e,meta:t,isSelected:n,isGhost:r,events:s},l)=>{var _e;let{points:a,style:c,isComplete:p}=e,u=t.canvasMode==="straight",h=t.nodeEditingId===e.id,g=N(),m=Yt.useRef(null),[f,v]=Yt.useState(null),b=Yt.useCallback((Se,$)=>cn.sub(g.getPagePoint([Se,$]),e.point),[g,e.point]),T=Yt.useCallback(Se=>{if(Se.length===0)return;let $=Math.min(...Se.map(G=>G[0])),ie=Math.min(...Se.map(G=>G[1])),ae=Se.map(([G,Y,te])=>[+(G-$).toFixed(2),+(Y-ie).toFixed(2),te!=null?te:.5]),_=cn.add(e.point,[$,ie]);g.updateShapes({id:e.id,point:_,points:ae})},[g,e.id,e.point]),y=Yt.useMemo(()=>u?lc(e):rc(e),[a,c.size,u,c.strokeWidthOverride]),x=Yt.useMemo(()=>u?ac(e):c.dash==="draw"?sc(e):da(e),[a,c.size,c.dash,p,u,c.strokeWidthOverride]),I=J(c,t.isDarkMode),{stroke:k,fill:R,strokeWidth:C,opacity:E}=I,{defs:M,gradFill:L}=ut(e.id,c),A=L!=null?L:R,K=(_e=g.zoom)!=null?_e:1,re=Yt.useMemo(()=>{if(!h||a.length<1)return null;let Se=5/K,$=3.5/K,ie=a.map((_,G)=>_t("circle",{cx:_[0],cy:_[1],r:f===G?Se*1.4:Se,fill:f===G?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:1.5/K,style:{cursor:"move",pointerEvents:"all"},onPointerEnter:()=>v(G),onPointerLeave:()=>v(null),onPointerDown:Y=>{Y.stopPropagation(),Y.currentTarget.setPointerCapture(Y.pointerId),m.current={nodeIdx:G}},onPointerMove:Y=>{var Ee;if(!m.current||m.current.nodeIdx!==G)return;Y.stopPropagation();let te=b(Y.clientX,Y.clientY),H=[...a];H[G]=[te[0],te[1],(Ee=a[G][2])!=null?Ee:.5],g.patchState({document:{pages:{[g.currentPageId]:{shapes:{[e.id]:{points:H}}}}}})},onPointerUp:Y=>{var Ee;if(!m.current)return;Y.stopPropagation();let te=b(Y.clientX,Y.clientY),H=[...a];H[G]=[te[0],te[1],(Ee=a[G][2])!=null?Ee:.5],m.current=null,T(H)}},`n-${G}`)),ae=a.slice(0,-1).map((_,G)=>{let Y=a[G+1],te=(_[0]+Y[0])/2,H=(_[1]+Y[1])/2;return _t("circle",{cx:te,cy:H,r:$,fill:"white",stroke:"#0D99FF",strokeWidth:1/K,strokeDasharray:`${2/K} ${2/K}`,style:{cursor:"crosshair",pointerEvents:"all"},onPointerDown:Ee=>{Ee.stopPropagation();let At=[te,H,.5],Nt=[...a.slice(0,G+1),At,...a.slice(G+1)];g.updateShapes({id:e.id,points:Nt})}},`m-${G}`)});return Go("g",{style:{pointerEvents:"none"},children:[a.slice(0,-1).map((_,G)=>_t("line",{x1:_[0],y1:_[1],x2:a[G+1][0],y2:a[G+1][1],stroke:"#0D99FF",strokeWidth:1/K,strokeOpacity:.4,pointerEvents:"none"},`l-${G}`)),ae,ie]})},[h,a,K,f,e.id,g.currentPageId]),F=this.getBounds(e);if(F.width<=C/2&&F.height<=C/2){let Se=1+C;return Go(ca,w(S({ref:l,id:e.id+"_svg"},s),{children:[M,_t("circle",{r:Se,fill:k,stroke:k,pointerEvents:"all",opacity:r?.3:E})]}))}let pe=c.isFilled&&a.length>3&&cn.dist(a[0],a[a.length-1])<C*2,he=h?{overflow:"visible"}:void 0;if(!u&&e.style.dash==="draw")return Go(ca,w(S({ref:l,id:e.id+"_svg"},s),{style:he,children:[M,Go("g",{opacity:r?.3:E,children:[_t("path",{className:pe||n?"tv-fill-hitarea":"tv-stroke-hitarea",d:x}),pe&&_t("path",{d:y,stroke:"none",fill:A,strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"}),_t("path",{d:x,fill:k,stroke:k,strokeWidth:C/2,strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"})]}),re]}));let De=u?"none":{["draw"]:"none",["solid"]:"none",["dotted"]:`0.1 ${C*4}`,["dashed"]:`${C*4} ${C*4}`}[c.dash],ct=u?"none":{["draw"]:"none",["solid"]:"none",["dotted"]:"0",["dashed"]:"0"}[c.dash],Ze=1+C*1.5;return Go(ca,w(S({ref:l,id:e.id+"_svg"},s),{style:he,children:[M,Go("g",{opacity:r?.3:E,children:[_t("path",{className:pe&&n?"tv-fill-hitarea":"tv-stroke-hitarea",d:x}),_t("path",{d:x,fill:pe?A:"none",stroke:"none",strokeWidth:Math.min(4,C*2),strokeLinejoin:u?"miter":"round",strokeLinecap:u?"square":"round",pointerEvents:"none"}),_t("path",{d:x,fill:"none",stroke:k,strokeWidth:Ze,strokeDasharray:De,strokeDashoffset:ct,strokeLinejoin:u?"miter":"round",strokeLinecap:u?"square":"round",pointerEvents:"none"})]}),re]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{points:t}=e,n=Yt.useMemo(()=>da(e),[t,e.style.size,e.style.strokeWidthOverride]),r=this.getBounds(e);return r.width<4&&r.height<4?_t("circle",{x:r.width/2,y:r.height/2,r:1}):_t("path",{d:n})}));d(this,"transform",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>{let l=it.getFromCache(this.boundsCache,n,()=>it.getBoundsFromPoints(n.points)),a=n.points.map(([u,h,g])=>[t.width*(r<0?1-u/l.width:u/l.width),t.height*(s<0?1-h/l.height:h/l.height),g]),c=it.getBoundsFromPoints(e.points),p=cn.sub([t.minX,t.minY],[c.minX,c.minY]);return{points:a,point:p}});d(this,"getBounds",e=>{let t=!this.pointsBoundsCache.has(e.points),n=this.pointCache[e.id]!==e.point;if(t){let r=it.getBoundsFromPoints(e.points);this.pointsBoundsCache.set(e.points,r),this.shapeBoundsCache.set(e.id,it.translateBounds(r,e.point)),this.pointCache[e.id]=e.point}else n&&!t&&(this.pointCache[e.id]=e.point,this.shapeBoundsCache.set(e.id,it.translateBounds(this.pointsBoundsCache.get(e.points),e.point)));return this.shapeBoundsCache.get(e.id)});d(this,"shouldRender",(e,t)=>t.points!==e.points||t.style!==e.style||t.isComplete!==e.isComplete);d(this,"hitTestPoint",(e,t)=>{let n=cn.sub(t,e.point);return it.pointInPolyline(n,e.points)});d(this,"hitTestLineSegment",(e,t,n)=>{let{points:r,point:s}=e,l=cn.sub(t,s),a=cn.sub(n,s),c=this.getBounds(e);if(c.width<8&&c.height<8)return cn.distanceToLineSegment(t,n,it.getBoundsCenter(c))<5;if(uf(l,a,c)){for(let p=1;p<r.length;p++)if(hf(r[p-1],r[p],l,a).didIntersect)return!0}return!1});d(this,"hitTestBounds",(e,t)=>{if(!e.rotation){let s=this.getBounds(e);return it.boundsContain(t,s)||(it.boundsContain(s,t)||pf(s,t).length>0)&&dc(it.translateBounds(t,cn.neg(e.point)),e.points).length>0}let n=this.getRotatedBounds(e),r=it.getFromCache(this.rotatedCache,e,()=>{let s=it.getBoundsCenter(it.getBoundsFromPoints(e.points));return e.points.map(l=>cn.rotWith(l,s,e.rotation||0))});return it.boundsContain(t,n)||dc(it.translateBounds(t,cn.neg(e.point)),r).length>0})}};import*as bc from"react";import{SVGContainer as vf,Utils as jn}from"telva-core";import{intersectEllipseBounds as Tf,intersectLineSegmentEllipse as ua,intersectRayEllipse as xf}from"telva-intersect";import{Vec as wt}from"telva-vec";import*as uc from"react";import{Utils as cc}from"telva-core";import{Fragment as mf,jsx as pc,jsxs as gf}from"react/jsx-runtime";var hc=uc.memo(function({id:o,radius:e,style:t,isSelected:n,isDarkMode:r}){let{stroke:s,strokeWidth:l,fill:a}=J(t,r),{defs:c,gradFill:p}=ut(o,t),u=p!=null?p:a,h=1+l*1.618,g=Math.max(0,e[0]-h/2),m=Math.max(0,e[1]-h/2),f=cc.perimeterOfEllipse(g,m),{strokeDasharray:v,strokeDashoffset:b}=cc.getPerfectDashProps(f<64?f*2:f,l*1.618,t.dash,4);return gf(mf,{children:[c,pc("ellipse",{className:t.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",cx:e[0],cy:e[1],rx:e[0],ry:e[1]}),pc("ellipse",{cx:e[0],cy:e[1],rx:g,ry:m,fill:u,stroke:s,strokeWidth:h,strokeDasharray:v,strokeDashoffset:b,pointerEvents:"none",strokeLinecap:"round",strokeLinejoin:"round"})]})});import*as fc from"react";import{getStrokeOutlinePoints as ff,getStrokePoints as Sf}from"perfect-freehand";import{Utils as jo}from"telva-core";function mc(i,o,e){let{strokeWidth:t}=J(e),n=jo.rng(i),r=o[0]+n()*t*2,s=o[1]+n()*t*2,l=jo.perimeterOfEllipse(r,s),a=[],c=Math.PI+Math.PI*n(),p=Math.abs(n()),u=Math.max(16,l/10);for(let h=0;h<u;h++){let g=So.easeInOutSine(h/(u+1)),m=c*2+Math.PI*(2+p)*g,f=Math.cos(m),v=Math.sin(m);a.push([r*f+o[0],s*v+o[1],g+.5+n()/2])}return Sf(a,{size:1+t*2,thinning:.618,end:{taper:l/8},start:{taper:l/12},streamline:0,simulatePressure:!0})}function gc(i,o,e){let{strokeWidth:t}=J(e),n=jo.rng(i),r=o[0]+n()*t*2,s=o[1]+n()*t*2,l=jo.perimeterOfEllipse(r,s);return jo.getSvgPathFromStroke(ff(mc(i,o,e),{size:2+t*2,thinning:.618,end:{taper:l/8},start:{taper:l/12},streamline:0,simulatePressure:!0}))}function Ri(i,o,e){return jo.getSvgPathFromStrokePoints(mc(i,o,e))}import{Fragment as yf,jsx as pa,jsxs as bf}from"react/jsx-runtime";var Sc=fc.memo(function({id:o,radius:e,style:t,isSelected:n,isDarkMode:r}){let{stroke:s,strokeWidth:l,fill:a}=J(t,r),{defs:c,gradFill:p}=ut(o,t),u=p!=null?p:a,h=gc(o,e,t);return bf(yf,{children:[c,pa("ellipse",{className:t.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",cx:e[0],cy:e[1],rx:e[0],ry:e[1]}),t.isFilled&&pa("path",{d:Ri(o,e,t),stroke:"none",fill:u,pointerEvents:"none"}),pa("path",{d:h,fill:s,stroke:s,strokeWidth:l,pointerEvents:"none",strokeLinecap:"round",strokeLinejoin:"round"})]})});import{jsx as Tr,jsxs as yc}from"react/jsx-runtime";var Di=class extends q{constructor(){super(...arguments);d(this,"type","ellipse");d(this,"canBind",!0);d(this,"canClone",!0);d(this,"canEdit",!0);d(this,"getShape",e=>jn.deepMerge({id:"id",type:"ellipse",name:"Ellipse",parentId:"page",childIndex:1,point:[0,0],radius:[1,1],rotation:0,style:He,label:"",labelPoint:[.5,.5]},e));d(this,"Component",q.Component(({shape:e,isGhost:t,isSelected:n,isBinding:r,isEditing:s,meta:l,bounds:a,events:c,onShapeChange:p,onShapeBlur:u},h)=>{var L;let{id:g,radius:m,style:f,label:v="",labelPoint:b=Ho}=e,T=Ct(e.style),y=J(f,l.isDarkMode),x=y.strokeWidth,I=1+x*1.618,k=Math.max(0,m[0]-I/2),R=Math.max(0,m[1]-I/2),E=!(l.canvasMode==="straight")&&f.dash==="draw"?Sc:hc,M=bc.useCallback(A=>p==null?void 0:p({id:g,label:A}),[p]);return yc(kf,w(S({ref:h},c),{children:[Tr(Qn,{isEditing:s,onChange:M,onBlur:u,font:T,text:v,color:(L=f.labelColor)!=null?L:y.stroke,background:f.labelBackground,textGradient:f.textGradient,offsetX:(b[0]-.5)*a.width,offsetY:(b[1]-.5)*a.height,width:Math.max(0,a.width*.707-16)}),yc(vf,{id:e.id+"_svg",opacity:t?.3:y.opacity,children:[r&&Tr("ellipse",{className:"tv-binding-indicator",cx:a.width/2,cy:a.height/2,rx:Math.max(0,a.width/2),ry:Math.max(0,a.height/2),strokeWidth:y.strokeWidth}),Tr(E,{id:g,style:f,radius:m,isSelected:n,isDarkMode:l.isDarkMode})]})]}))}));d(this,"Indicator",q.Indicator(({shape:e,meta:t})=>{let{id:n,radius:r,style:s}=e,a=J(s).strokeWidth,c=1+a*1.618,p=Math.max(0,r[0]-c/2),u=Math.max(0,r[1]-c/2);return!((t==null?void 0:t.canvasMode)==="straight")&&s.dash==="draw"?Tr("path",{d:Ri(n,r,s)}):Tr("ellipse",{cx:r[0],cy:r[1],rx:p,ry:u})}));d(this,"hitTestPoint",(e,t)=>jn.pointInBounds(t,this.getRotatedBounds(e))&&jn.pointInEllipse(t,this.getCenter(e),e.radius[0],e.radius[1],e.rotation||0));d(this,"hitTestLineSegment",(e,t,n)=>ua(t,n,this.getCenter(e),e.radius[0],e.radius[1],e.rotation||0).didIntersect);d(this,"getBounds",e=>jn.getFromCache(this.boundsCache,e,()=>jn.getRotatedEllipseBounds(e.point[0],e.point[1],e.radius[0],e.radius[1],0)));d(this,"getRotatedBounds",e=>jn.getRotatedEllipseBounds(e.point[0],e.point[1],e.radius[0],e.radius[1],e.rotation));d(this,"hitTestBounds",(e,t)=>{let n=this.getBounds(e);return jn.boundsContained(n,t)||Tf(this.getCenter(e),e.radius[0],e.radius[1],e.rotation||0,t).length>0});d(this,"shouldRender",(e,t)=>t.radius!==e.radius||t.style!==e.style||t.label!==e.label);d(this,"getCenter",e=>wt.add(e.point,e.radius));d(this,"getBindingPoint",(e,t,n,r,s,l)=>{{let a=this.getExpandedBounds(e),c=this.getCenter(e),p,u;if(!jn.pointInEllipse(n,c,e.radius[0]+this.bindingDistance,e.radius[1]+this.bindingDistance))return;if(l)wt.dist(n,this.getCenter(e))<12?p=[.5,.5]:p=wt.divV(wt.sub(n,[a.minX,a.minY]),[a.width,a.height]),u=0;else{let h=xf(r,s,c,e.radius[0],e.radius[1],e.rotation||0).points.sort((m,f)=>wt.dist(m,r)-wt.dist(f,r))[0];if(h||(h=ua(n,c,c,e.radius[0],e.radius[1],e.rotation||0).points.sort((m,f)=>wt.dist(m,n)-wt.dist(f,n))[0]),!h)return;let g=wt.med(n,h);if(wt.distanceToLineSegment(n,g,this.getCenter(e))<12?p=[.5,.5]:p=wt.divV(wt.sub(g,[a.minX,a.minY]),[a.width,a.height]),jn.pointInEllipse(n,c,e.radius[0],e.radius[1],e.rotation||0))u=this.bindingDistance/2;else{let m=ua(n,c,c,e.radius[0],e.radius[1],e.rotation||0).points[0];if(!m)return;u=Math.max(this.bindingDistance/2,wt.dist(n,m))}}return{point:p,distance:u}}});d(this,"transform",(e,t,{scaleX:n,scaleY:r,initialShape:s})=>{let{rotation:l=0}=s;return{point:[t.minX,t.minY],radius:[t.width/2,t.height/2],rotation:n<0&&r>=0||r<0&&n>=0?-(l||0):l||0}});d(this,"transformSingle",(e,t)=>({point:wt.toFixed([t.minX,t.minY]),radius:wt.div([t.width,t.height],2)}))}},kf=P("div",{width:"100%",height:"100%"});import{SVGContainer as Cf,Utils as wf}from"telva-core";import{jsx as Wo,jsxs as Tc}from"react/jsx-runtime";var Ei=class extends q{constructor(){super(...arguments);d(this,"type","group");d(this,"canBind",!0);d(this,"getShape",e=>wf.deepMerge({id:"id",type:"group",name:"Group",parentId:"page",childIndex:1,point:[0,0],size:[100,100],rotation:0,children:[],style:He},e));d(this,"Component",q.Component(({shape:e,isBinding:t,isGhost:n,isHovered:r,isSelected:s,events:l},a)=>{let{id:c,size:p}=e,u=2,h=Math.max(0,p[0]-u/2),g=Math.max(0,p[1]-u/2),f=[[[u/2,u/2],[h,u/2],h-u/2],[[h,u/2],[h,g],g-u/2],[[h,g],[u/2,g],h-u/2],[[u/2,g],[u/2,u/2],g-u/2]].map(([v,b],T)=>Wo("line",{x1:v[0],y1:v[1],x2:b[0],y2:b[1]},c+"_"+T));return Tc(Cf,w(S({ref:a},l),{children:[t&&Wo("rect",{className:"tv-binding-indicator",strokeWidth:this.bindingDistance}),Tc("g",{opacity:n?.3:1,children:[Wo("rect",{x:0,y:0,width:p[0],height:p[1],fill:"transparent",pointerEvents:"all"}),Wo(vc,{stroke:"black",opacity:r||s?1:0,strokeLinecap:"round",pointerEvents:"stroke",children:f})]})]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{id:t,size:n}=e,r=2,s=Math.max(0,n[0]-r/2),l=Math.max(0,n[1]-r/2),c=[[[r/2,r/2],[s,r/2],s-r/2],[[s,r/2],[s,l],l-r/2],[[s,l],[r/2,l],s-r/2],[[r/2,l],[r/2,r/2],l-r/2]].map(([p,u],h)=>Wo("line",{x1:p[0],y1:p[1],x2:u[0],y2:u[1]},t+"_"+h));return Wo(vc,{strokeLinecap:"round",pointerEvents:"stroke",children:c})}));d(this,"getBounds",e=>Dt(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style)}},vc=P("g",{strokeWidth:"calc(1.5px * var(--tv-scale))",strokeDasharray:"calc(1px * var(--tv-scale)), calc(3px * var(--tv-scale))"});import{styled as xc}from"@stitches/react";import*as xr from"react";import{HTMLContainer as If,Utils as Pf}from"telva-core";import{jsx as Bi,jsxs as Ef}from"react/jsx-runtime";var Mi=class extends q{constructor(){super(...arguments);d(this,"type","image");d(this,"canBind",!0);d(this,"canClone",!0);d(this,"isAspectRatioLocked",!0);d(this,"showCloneHandles",!1);d(this,"getShape",e=>Pf.deepMerge({id:"image",type:"image",name:"Image",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:w(S({},He),{isFilled:!0}),assetId:"assetId"},e));d(this,"Component",q.Component(({shape:e,asset:t={src:""},isBinding:n,isGhost:r,meta:s,events:l,onShapeChange:a},c)=>{let{size:p,style:u}=e,{bindingDistance:h}=this,g=xr.useRef(null),m=xr.useRef(null);return xr.useLayoutEffect(()=>{let f=m.current;if(!f)return;let[v,b]=p;f.style.width=`${v}px`,f.style.height=`${b}px`},[p]),Ef(If,w(S({ref:c},l),{children:[n&&Bi("div",{className:"tv-binding-indicator",style:{position:"absolute",top:`calc(${-h}px * var(--tv-zoom))`,left:`calc(${-h}px * var(--tv-zoom))`,width:`calc(100% + ${h*2}px * var(--tv-zoom))`,height:`calc(100% + ${h*2}px * var(--tv-zoom))`,backgroundColor:"var(--tv-selectFill)"}}),Bi(Rf,{ref:m,isDarkMode:s.isDarkMode,isFilled:u.isFilled,isGhost:r,children:Bi(Df,{id:e.id+"_image",ref:g,src:t.src,alt:"tl_image_asset",draggable:!1})})]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:[t,n]}=e;return Bi("rect",{x:0,y:0,rx:2,ry:2,width:Math.max(1,t),height:Math.max(1,n)})}));d(this,"getBounds",e=>Dt(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style);d(this,"transform",vn);d(this,"transformSingle",Tn);d(this,"getSvgElement",e=>{let t=this.getBounds(e),n=document.createElementNS("http://www.w3.org/2000/svg","image");return n.setAttribute("width",`${t.width}`),n.setAttribute("height",`${t.height}`),n.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),n})}},Rf=xc("div",{pointerEvents:"all",position:"relative",fontFamily:"sans-serif",fontSize:"2em",height:"100%",width:"100%",borderRadius:"3px",perspective:"800px",overflow:"hidden",p:{userSelect:"none"},img:{userSelect:"none"},variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isFilled:{true:{},false:{}},isDarkMode:{true:{},false:{}}},compoundVariants:[{isFilled:!0,isDarkMode:!0,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.3), 1px 1px 4px rgba(0,0,0,.3), 1px 1px 2px rgba(0,0,0,.3)"}},{isFilled:!0,isDarkMode:!1,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.2), 1px 1px 4px rgba(0,0,0,.16), 1px 1px 2px rgba(0,0,0,.16)"}}]}),Df=xc("img",{position:"absolute",top:0,left:0,width:"100%",height:"100%",maxWidth:"100%",minWidth:"100%",pointerEvents:"none",objectFit:"cover",userSelect:"none",borderRadius:2});import*as pn from"react";import{SVGContainer as Cc,Utils as Gt}from"telva-core";import{intersectBoundsPolyline as Af,intersectLineSegmentLineSegment as Vf}from"telva-intersect";import{Vec as Bt}from"telva-vec";import{Utils as Bf}from"telva-core";var Mf=24;function Lf(i,o,e,t,n){let r=1-n,s=r*r,l=n*n,a=s*r,c=3*s*n,p=3*r*l,u=l*n;return[a*i[0]+c*o[0]+p*e[0]+u*t[0],a*i[1]+c*o[1]+p*e[1]+u*t[1]]}function kc(i,o,e,t){var a,c;let n=(a=o.cp2)!=null?a:o.point,r=(c=e.cp1)!=null?c:e.point;if(!(o.cp2!=null||e.cp1!=null)){i.push(e.point);return}let l=Math.max(4,t);for(let p=1;p<=l;p++){let u=p/l;i.push(Lf(o.point,n,r,e.point,u))}}function kr(i,o,e=Mf){if(i.length===0)return[];if(i.length===1)return[i[0].point];let t=[i[0].point];for(let n=1;n<i.length;n++)kc(t,i[n-1],i[n],e);return o&&i.length>2&&kc(t,i[i.length-1],i[0],e),t}function ha(i,o){var t,n,r,s;if(i.length===0)return"";if(i.length===1){let{point:l}=i[0];return`M ${l[0]} ${l[1]}`}let e=`M ${i[0].point[0].toFixed(2)} ${i[0].point[1].toFixed(2)}`;for(let l=1;l<i.length;l++){let a=i[l-1],c=i[l],p=(t=a.cp2)!=null?t:a.point,u=(n=c.cp1)!=null?n:c.point;a.cp2!=null||c.cp1!=null?e+=` C ${p[0].toFixed(2)} ${p[1].toFixed(2)} ${u[0].toFixed(2)} ${u[1].toFixed(2)} ${c.point[0].toFixed(2)} ${c.point[1].toFixed(2)}`:e+=` L ${c.point[0].toFixed(2)} ${c.point[1].toFixed(2)}`}if(o&&i.length>2){let l=i[i.length-1],a=i[0],c=(r=l.cp2)!=null?r:l.point,p=(s=a.cp1)!=null?s:a.point;(l.cp2!=null||a.cp1!=null)&&(e+=` C ${c[0].toFixed(2)} ${c[1].toFixed(2)} ${p[0].toFixed(2)} ${p[1].toFixed(2)} ${a.point[0].toFixed(2)} ${a.point[1].toFixed(2)}`),e+=" Z"}return e}function Li(i,o=!1){if(i.length===0)return{minX:0,minY:0,maxX:1,maxY:1,width:1,height:1};let e=kr(i,o);return e.length===0?{minX:0,minY:0,maxX:1,maxY:1,width:1,height:1}:Bf.getBoundsFromPoints(e)}function ma(i,o=!1){if(i.length===0)return{segments:i,offset:[0,0]};let e=Li(i,o),t=[e.minX,e.minY];return{segments:i.map(r=>({point:[r.point[0]-t[0],r.point[1]-t[1]],cp1:r.cp1?[r.cp1[0]-t[0],r.cp1[1]-t[1]]:void 0,cp2:r.cp2?[r.cp2[0]-t[0],r.cp2[1]-t[1]]:void 0})),offset:t}}function Cr(i,o){return[2*i[0]-o[0],2*i[1]-o[1]]}import{jsx as ht,jsxs as ga}from"react/jsx-runtime";var Ai=class extends q{constructor(){super(...arguments);d(this,"type","pen");d(this,"canClone",!0);d(this,"pointsBoundsCache",new WeakMap);d(this,"shapeBoundsCache",new Map);d(this,"pointCache",{});d(this,"getShape",e=>Gt.deepMerge({id:"id",type:"pen",name:"Pen",parentId:"page",childIndex:1,point:[0,0],rotation:0,style:He,segments:[],isClosed:!1,isComplete:!1,previewPoint:void 0,isPlacingHandle:!1},e));d(this,"Component",q.Component(({shape:e,meta:t,isSelected:n,isGhost:r,events:s},l)=>{var Ze,_e,Se;let{segments:a,style:c,isClosed:p,isComplete:u,previewPoint:h,isPlacingHandle:g}=e,m=t.nodeEditingId===e.id,f=N(),v=pn.useRef(null),[b,T]=pn.useState(null),y=pn.useCallback(($,ie)=>Bt.sub(f.getPagePoint([$,ie]),e.point),[f,e.point]),x=pn.useCallback($=>{f.patchState({document:{pages:{[f.currentPageId]:{shapes:{[e.id]:{segments:$}}}}}})},[f,e.id]),I=pn.useCallback($=>{f.updateShapes({id:e.id,segments:$})},[f,e.id]),k=J(c,t.isDarkMode),{stroke:R,fill:C,strokeWidth:E,opacity:M}=k,{defs:L,gradFill:A}=ut(e.id,c),K=A!=null?A:C,re=pn.useMemo(()=>ha(a,p),[a,p]),F=(Ze=f.zoom)!=null?Ze:1,ee=1+E*1.5,pe=(_e={["draw"]:"none",["solid"]:"none",["dotted"]:`0.1 ${E*4}`,["dashed"]:`${E*4} ${E*4}`}[c.dash])!=null?_e:"none",he=(Se={["draw"]:"0",["solid"]:"0",["dotted"]:"0",["dashed"]:"0"}[c.dash])!=null?Se:"0",De=pn.useMemo(()=>{if(!m||a.length===0)return null;let $=5/F,ie=3.5/F,ae=1/F,_=[],G=[],Y=[];return a.forEach((te,H)=>{let[Ee,At]=te.point;if(te.cp1){let[be,Ye]=te.cp1,qe=`cp1-${H}`;Y.push(ht("line",{x1:Ee,y1:At,x2:be,y2:Ye,stroke:"#0D99FF",strokeWidth:ae,strokeOpacity:.6,pointerEvents:"none"},`lcp1-${H}`)),G.push(ht("circle",{cx:be,cy:Ye,r:b===qe?ie*1.4:ie,fill:b===qe?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:ae,style:{cursor:"move"},onPointerEnter:()=>T(qe),onPointerLeave:()=>T(null),onPointerDown:ue=>{ue.stopPropagation(),ue.currentTarget.setPointerCapture(ue.pointerId),v.current={kind:"cp1",idx:H}},onPointerMove:ue=>{if(!v.current||v.current.kind!=="cp1"||v.current.idx!==H)return;ue.stopPropagation();let Te=y(ue.clientX,ue.clientY),we=[...a];we[H]=w(S({},we[H]),{cp1:Te}),x(we)},onPointerUp:ue=>{if(!v.current)return;ue.stopPropagation();let Te=y(ue.clientX,ue.clientY),we=[...a];we[H]=w(S({},we[H]),{cp1:Te}),v.current=null,I(we)}},qe))}if(te.cp2){let[be,Ye]=te.cp2,qe=`cp2-${H}`;Y.push(ht("line",{x1:Ee,y1:At,x2:be,y2:Ye,stroke:"#0D99FF",strokeWidth:ae,strokeOpacity:.6,pointerEvents:"none"},`lcp2-${H}`)),G.push(ht("circle",{cx:be,cy:Ye,r:b===qe?ie*1.4:ie,fill:b===qe?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:ae,style:{cursor:"move"},onPointerEnter:()=>T(qe),onPointerLeave:()=>T(null),onPointerDown:ue=>{ue.stopPropagation(),ue.currentTarget.setPointerCapture(ue.pointerId),v.current={kind:"cp2",idx:H}},onPointerMove:ue=>{if(!v.current||v.current.kind!=="cp2"||v.current.idx!==H)return;ue.stopPropagation();let Te=y(ue.clientX,ue.clientY),we=[...a];we[H]=w(S({},we[H]),{cp2:Te}),H+1<we.length&&(we[H+1]=w(S({},we[H+1]),{cp1:Cr(we[H].point,Te)})),x(we)},onPointerUp:ue=>{if(!v.current)return;ue.stopPropagation();let Te=y(ue.clientX,ue.clientY),we=[...a];we[H]=w(S({},we[H]),{cp2:Te}),H+1<we.length&&(we[H+1]=w(S({},we[H+1]),{cp1:Cr(we[H].point,Te)})),v.current=null,I(we)}},qe))}let Nt=`node-${H}`;if(_.push(ht("circle",{cx:Ee,cy:At,r:b===Nt?$*1.4:$,fill:b===Nt?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:1.5/F,style:{cursor:"move"},onPointerEnter:()=>T(Nt),onPointerLeave:()=>T(null),onPointerDown:be=>{be.stopPropagation(),be.currentTarget.setPointerCapture(be.pointerId),v.current={kind:"node",idx:H}},onPointerMove:be=>{if(!v.current||v.current.kind!=="node"||v.current.idx!==H)return;be.stopPropagation();let Ye=y(be.clientX,be.clientY),qe=a[H].point,ue=Bt.sub(Ye,qe),Te=[...a];Te[H]=w(S({},Te[H]),{point:Ye,cp1:Te[H].cp1?Bt.add(Te[H].cp1,ue):void 0,cp2:Te[H].cp2?Bt.add(Te[H].cp2,ue):void 0}),x(Te)},onPointerUp:be=>{if(!v.current)return;be.stopPropagation();let Ye=y(be.clientX,be.clientY),qe=a[H].point,ue=Bt.sub(Ye,qe),Te=[...a];Te[H]=w(S({},Te[H]),{point:Ye,cp1:Te[H].cp1?Bt.add(Te[H].cp1,ue):void 0,cp2:Te[H].cp2?Bt.add(Te[H].cp2,ue):void 0}),v.current=null,I(Te)}},Nt)),H<a.length-1){let be=a[H+1],Ye=(Ee+be.point[0])/2,qe=(At+be.point[1])/2;_.push(ht("circle",{cx:Ye,cy:qe,r:ie,fill:"white",stroke:"#0D99FF",strokeWidth:ae,strokeDasharray:`${2/F} ${2/F}`,style:{cursor:"crosshair"},onPointerDown:ue=>{ue.stopPropagation();let Te={point:[Ye,qe]},we=[...a.slice(0,H+1),Te,...a.slice(H+1)];f.updateShapes({id:e.id,segments:we})}},`mid-${H}`))}}),ga("g",{children:[Y,G,_]})},[m,a,F,b,e.id,y,x,I,f]);if(a.length===0)return ht(Cc,w(S({ref:l,id:e.id+"_svg"},s),{children:ht("circle",{r:4,fill:R,stroke:R,pointerEvents:"all"})}));let ct=m||!u?{overflow:"visible"}:void 0;return ga(Cc,w(S({ref:l,id:e.id+"_svg"},s),{style:ct,children:[L,ga("g",{opacity:r?.3:M,children:[ht("path",{className:c.isFilled&&n?"tv-fill-hitarea":"tv-stroke-hitarea",d:re}),c.isFilled&&p&&ht("path",{d:re,fill:K,stroke:"none",pointerEvents:"none"}),ht("path",{d:re,fill:"none",stroke:R,strokeWidth:ee,strokeDasharray:pe,strokeDashoffset:he,strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"}),!u&&h&&a.length>0&&(()=>{let $=a[a.length-1],ie;if(g&&$.cp2){let[ae,_]=$.point,[G,Y]=$.cp2,[te,H]=h;ie=`M ${ae} ${_} C ${G} ${Y} ${te} ${H} ${te} ${H}`}else{let[ae,_]=$.point,[G,Y]=h;ie=`M ${ae} ${_} L ${G} ${Y}`}return ht("path",{d:ie,fill:"none",stroke:R,strokeWidth:ee*.8,strokeDasharray:`${ee*4} ${ee*3}`,strokeLinecap:"round",opacity:.55,pointerEvents:"none"})})(),!u&&h&&a.length>=2&&(()=>{let $=a[0],ie=Math.hypot(h[0]-$.point[0],h[1]-$.point[1]),ae=12/F;return ie<=ae?ht("circle",{cx:$.point[0],cy:$.point[1],r:8/F,fill:"none",stroke:"#0D99FF",strokeWidth:1.5/F,opacity:.8,pointerEvents:"none"}):null})(),!u&&a.length>0&&ht("circle",{cx:a[a.length-1].point[0],cy:a[a.length-1].point[1],r:4/F,fill:R,stroke:"none",pointerEvents:"none"})]}),De]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{segments:t,isClosed:n}=e,r=ha(t,n);return r?ht("path",{d:r}):ht("circle",{r:1})}));d(this,"getBounds",e=>{let t=!this.pointsBoundsCache.has(e.segments),n=this.pointCache[e.id]!==e.point;if(t){let r=e.segments.length>0?Li(e.segments,e.isClosed):{minX:0,minY:0,maxX:1,maxY:1,width:1,height:1},s=w(S({},r),{width:Math.max(r.width,1),height:Math.max(r.height,1)});this.pointsBoundsCache.set(e.segments,s),this.shapeBoundsCache.set(e.id,Gt.translateBounds(s,e.point)),this.pointCache[e.id]=e.point}else n&&(this.pointCache[e.id]=e.point,this.shapeBoundsCache.set(e.id,Gt.translateBounds(this.pointsBoundsCache.get(e.segments),e.point)));return this.shapeBoundsCache.get(e.id)});d(this,"shouldRender",(e,t)=>t.segments!==e.segments||t.style!==e.style||t.isClosed!==e.isClosed||t.isComplete!==e.isComplete||t.previewPoint!==e.previewPoint||t.isPlacingHandle!==e.isPlacingHandle);d(this,"transform",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>{let l=this.getBounds(n),a=Math.max(l.width,1),c=Math.max(l.height,1),p=m=>({point:[t.width*(r<0?1-(m.point[0]-l.minX)/a:(m.point[0]-l.minX)/a),t.height*(s<0?1-(m.point[1]-l.minY)/c:(m.point[1]-l.minY)/c)],cp1:m.cp1?[t.width*(r<0?1-(m.cp1[0]-l.minX)/a:(m.cp1[0]-l.minX)/a),t.height*(s<0?1-(m.cp1[1]-l.minY)/c:(m.cp1[1]-l.minY)/c)]:void 0,cp2:m.cp2?[t.width*(r<0?1-(m.cp2[0]-l.minX)/a:(m.cp2[0]-l.minX)/a),t.height*(s<0?1-(m.cp2[1]-l.minY)/c:(m.cp2[1]-l.minY)/c)]:void 0}),u=n.segments.map(p),h=Li(u,e.isClosed),g=Bt.sub([t.minX,t.minY],[h.minX,h.minY]);return{segments:u,point:g}});d(this,"hitTestPoint",(e,t)=>{let n=kr(e.segments,e.isClosed);if(n.length===0)return!1;let r=Bt.sub(t,e.point),s=8;return e.isClosed&&e.style.isFilled&&Gt.pointInPolygon(r,n)?!0:n.length===1?Bt.dist(r,n[0])<=s:Gt.pointInPolyline(r,n,s)});d(this,"hitTestLineSegment",(e,t,n)=>{let r=kr(e.segments,e.isClosed);if(r.length===0)return!1;let s=Bt.sub(t,e.point),l=Bt.sub(n,e.point),a=8;if(r.length===1)return Bt.distanceToLineSegment(s,l,r[0])<=a;for(let c=1;c<r.length;c++)if(Vf(r[c-1],r[c],s,l).didIntersect)return!0;return e.isClosed&&e.style.isFilled&&(Gt.pointInPolygon(s,r)||Gt.pointInPolygon(l,r))?!0:Gt.pointInPolyline(s,r,a)||Gt.pointInPolyline(l,r,a)});d(this,"hitTestBounds",(e,t)=>{let n=this.getBounds(e);if(Gt.boundsContain(t,n))return!0;let r=kr(e.segments,e.isClosed);if(r.length===0)return!1;let s=Gt.translateBounds(t,Bt.neg(e.point));if(r.some(l=>Gt.pointInBounds(l,s))||Af(s,r).length>0)return!0;if(e.isClosed&&e.style.isFilled){let l=[s.minX+s.width/2,s.minY+s.height/2];if(Gt.pointInPolygon(l,r))return!0}return!1})}};import*as No from"react";import{HTMLContainer as Hf,Utils as zf}from"telva-core";import{jsx as wr,jsxs as Of}from"react/jsx-runtime";var Vi=class extends q{constructor(){super(...arguments);d(this,"type","reactComponent");d(this,"canBind",!1);d(this,"canClone",!0);d(this,"isAspectRatioLocked",!1);d(this,"showCloneHandles",!1);d(this,"getShape",e=>zf.deepMerge({id:"reactComponent",type:"reactComponent",name:"React Component",parentId:"page",childIndex:1,point:[0,0],size:[400,300],rotation:0,style:w(S({},He),{isFilled:!0}),componentId:""},e));d(this,"Component",q.Component(({shape:e,isGhost:t,events:n},r)=>{let{size:s,componentId:l}=e,a=No.useRef(null);return No.useLayoutEffect(()=>{let c=a.current;!c||(c.style.width=`${s[0]}px`,c.style.height=`${s[1]}px`)},[s]),wr(Hf,w(S({ref:r},n),{children:wr("div",{id:`${e.id}_react_component`,ref:a,style:{width:`${s[0]}px`,height:`${s[1]}px`,position:"relative",overflow:"hidden",borderRadius:"4px",opacity:t?.3:1,pointerEvents:"all"},children:wr(Ff,{componentId:l})})}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:[t,n]}=e;return wr("rect",{x:0,y:0,rx:4,ry:4,width:Math.max(1,t),height:Math.max(1,n),fill:"none",stroke:"var(--tv-selected)"})}));d(this,"getBounds",e=>Dt(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.componentId!==e.componentId);d(this,"transform",vn);d(this,"transformSingle",Tn);d(this,"getSvgElement",(e,t)=>z(this,null,function*(){let n=document.getElementById(`${e.id}_react_component`);if(!n)return;let[r,s]=e.size;try{let l="";try{let c=(yield import("html2canvas-pro")).default;l=(yield c(n,{width:r,height:s,scale:1,useCORS:!0,backgroundColor:"#ffffff",logging:!1})).toDataURL("image/png")}catch(c){let p=n.querySelector("canvas");p&&(l=p.toDataURL("image/png"))}if(!l||l==="data:,")return;let a=document.createElementNS("http://www.w3.org/2000/svg","image");return a.setAttribute("width",`${r}`),a.setAttribute("height",`${s}`),a.setAttribute("href",l),a}catch(l){console.warn("Failed to snapshot React Component for SVG export",l)}}))}};function Ff({componentId:i}){let o=ui(),e=No.useMemo(()=>o.find(n=>n.id===i),[o,i]);if(!e)return Of("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",color:"white",fontSize:14,fontFamily:"DM Sans, sans-serif",borderRadius:4},children:['Component "',i,'" not found']});let t=e.component;return wr(t,{})}import*as to from"react";import{SVGContainer as Yf,Utils as Xf}from"telva-core";import Zf from"telva-vec";import{jsx as $f}from"react/jsx-runtime";function wc({strokeWidth:i,size:o}){return $f("rect",{className:"tv-binding-indicator",x:i,y:i,width:Math.max(0,o[0]-i/2),height:Math.max(0,o[1]-i/2),strokeWidth:16*2})}import*as Pc from"react";import{Utils as Ic}from"telva-core";import{Fragment as Gf,jsx as Ir,jsxs as jf}from"react/jsx-runtime";var Rc=Pc.memo(function({id:o,style:e,size:t,isSelected:n,isDarkMode:r}){var y;let{stroke:s,strokeWidth:l,fill:a}=J(e,r),{defs:c,gradFill:p}=ut(o,e),u=p!=null?p:a,h=1+l*1.618,g=Math.max(0,t[0]-h/2),m=Math.max(0,t[1]-h/2),f=(y=e.borderRadius)!=null?y:0,v=f>0||e.dash==="solid",{strokeDasharray:b,strokeDashoffset:T}=Ic.getPerfectDashProps(2*(g+m),l*1.618,e.dash);return jf(Gf,{children:[c,Ir("rect",{className:n||e.isFilled?"tv-fill-hitarea":"tv-stroke-hitarea",x:h/2,y:h/2,width:g,height:m,rx:f,ry:f,strokeWidth:16}),e.isFilled&&Ir("rect",{x:h/2,y:h/2,width:g,height:m,rx:f,ry:f,fill:u,pointerEvents:"none"}),v?Ir("rect",{x:h/2,y:h/2,width:g,height:m,rx:f,ry:f,fill:"none",stroke:s,strokeWidth:h,strokeDasharray:b,strokeDashoffset:T,pointerEvents:"none",strokeLinecap:"round"}):Ir("g",{pointerEvents:"none",stroke:s,strokeWidth:h,strokeLinecap:"round",children:[[[h/2,h/2],[g,h/2],g-h/2],[[g,h/2],[g,m],m-h/2],[[g,m],[h/2,m],g-h/2],[[h/2,m],[h/2,h/2],m-h/2]].map(([x,I,k],R)=>{let C=Ic.getPerfectDashProps(k,l*1.618,e.dash);return Ir("line",{x1:x[0],y1:x[1],x2:I[0],y2:I[1],strokeDasharray:C.strokeDasharray,strokeDashoffset:C.strokeDashoffset},o+"_"+R)})})]})});import*as Bc from"react";import Wf,{getStrokePoints as Nf}from"perfect-freehand";import{Utils as Hi}from"telva-core";import mt from"telva-vec";function Uf(i,o,e){let t=J(o),n=Hi.rng(i),r=t.strokeWidth,s=Math.max(0,e[0]),l=Math.max(0,e[1]),a=Array.from(Array(4)).map(()=>[n()*r*.75,n()*r*.75]),c=mt.add([r/2,r/2],a[0]),p=mt.add([s-r/2,r/2],a[1]),u=mt.add([s-r/2,l-r/2],a[2]),h=mt.add([r/2,l-r/2],a[3]),g=Math.round(Math.abs(n()*2*4)),m=Math.min(s/4,r*2),f=Math.min(l/4,r*2),v=Math.max(8,Math.floor(s/16)),b=Math.max(8,Math.floor(l/16)),T=Hi.rotateArray([mt.pointsBetween(mt.add(c,[m,0]),mt.sub(p,[m,0]),v),mt.pointsBetween(mt.add(p,[0,f]),mt.sub(u,[0,f]),b),mt.pointsBetween(mt.sub(u,[m,0]),mt.add(h,[m,0]),v),mt.pointsBetween(mt.sub(h,[0,f]),mt.add(c,[0,f]),b)],g);return{points:[...T.flat(),...T[0]].slice(5,Math.floor((g%2===0?v:b)/-2)+3)}}function Dc(i,o,e){let{points:t}=Uf(i,o,e),{strokeWidth:n}=J(o);return{points:t,options:{size:n,thinning:.65,streamline:.3,smoothing:1,simulatePressure:!1,last:!0}}}function Ec(i,o,e){let{points:t,options:n}=Dc(i,o,e),r=Wf(t,n);return Hi.getSvgPathFromStroke(r)}function zi(i,o,e){let{points:t,options:n}=Dc(i,o,e);return Hi.getSvgPathFromStrokePoints(Nf(t,n))}import{Fragment as Kf,jsx as fa,jsxs as _f}from"react/jsx-runtime";var Mc=Bc.memo(function({id:o,style:e,size:t,isSelected:n,isDarkMode:r}){let{isFilled:s}=e,{stroke:l,strokeWidth:a,fill:c}=J(e,r),{defs:p,gradFill:u}=ut(o,e),h=u!=null?u:c,g=Ec(o,e,t),m=zi(o,e,t);return _f(Kf,{children:[p,fa("path",{className:e.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",d:m}),s&&fa("path",{d:m,fill:h,pointerEvents:"none"}),fa("path",{d:g,fill:l,stroke:l,strokeWidth:a,pointerEvents:"none"})]})});import{jsx as eo,jsxs as Sa}from"react/jsx-runtime";var Fi=class extends q{constructor(){super(...arguments);d(this,"type","rectangle");d(this,"canBind",!0);d(this,"canClone",!0);d(this,"canEdit",!0);d(this,"getShape",e=>Xf.deepMerge({id:"id",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:He,label:"",labelPoint:[.5,.5]},e));d(this,"Component",q.Component(({shape:e,isEditing:t,isBinding:n,isSelected:r,isGhost:s,meta:l,bounds:a,events:c,onShapeBlur:p,onShapeChange:u},h)=>{var F,ee;let{id:g,size:m,style:f,label:v="",labelPoint:b=Ho}=e,T=Ct(f),y=J(f,l.isDarkMode),I=!(l.canvasMode==="straight")&&f.dash==="draw"?Mc:Rc,k=to.useCallback(pe=>u==null?void 0:u({id:g,label:pe}),[u]),R=l.nodeEditingId===e.id,C=N(),E=to.useRef(null),[M,L]=to.useState(null),A=(F=C.zoom)!=null?F:1,K=to.useMemo(()=>{if(!R)return null;let[pe,he]=m,De=[[0,0],[pe,0],[pe,he],[0,he]],ct=[2,3,0,1],Ze=5/A,_e=1/A;return Sa("g",{children:[De.map((Se,$)=>{let ie=De[($+1)%4];return eo("line",{x1:Se[0],y1:Se[1],x2:ie[0],y2:ie[1],stroke:"#0D99FF",strokeWidth:_e,strokeOpacity:.4,pointerEvents:"none"},`el-${$}`)}),De.map(([Se,$],ie)=>eo("circle",{cx:Se,cy:$,r:M===ie?Ze*1.4:Ze,fill:M===ie?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:1.5/A,style:{cursor:"nwse-resize"},onPointerEnter:()=>L(ie),onPointerLeave:()=>L(null),onPointerDown:ae=>{ae.stopPropagation(),ae.currentTarget.setPointerCapture(ae.pointerId);let _=De[ct[ie]];E.current={nodeIdx:ie,fixedPage:Zf.add(e.point,_)}},onPointerMove:ae=>{if(!E.current||E.current.nodeIdx!==ie)return;ae.stopPropagation();let _=C.getPagePoint([ae.clientX,ae.clientY]),G=E.current.fixedPage,Y=Math.min(_[0],G[0]),te=Math.min(_[1],G[1]),H=Math.max(_[0],G[0]),Ee=Math.max(_[1],G[1]);C.patchState({document:{pages:{[C.currentPageId]:{shapes:{[e.id]:{point:[Y,te],size:[Math.max(1,H-Y),Math.max(1,Ee-te)]}}}}}})},onPointerUp:ae=>{if(!E.current)return;ae.stopPropagation();let _=C.getPagePoint([ae.clientX,ae.clientY]),G=E.current.fixedPage,Y=Math.min(_[0],G[0]),te=Math.min(_[1],G[1]),H=Math.max(_[0],G[0]),Ee=Math.max(_[1],G[1]);E.current=null,C.updateShapes({id:e.id,point:[Y,te],size:[Math.max(1,H-Y),Math.max(1,Ee-te)]})}},`cn-${ie}`)),De.map((Se,$)=>{let ie=De[($+1)%4],ae=(Se[0]+ie[0])/2,_=(Se[1]+ie[1])/2;return eo("circle",{cx:ae,cy:_,r:3.5/A,fill:"white",stroke:"#0D99FF",strokeWidth:_e,strokeDasharray:`${2/A} ${2/A}`,style:{cursor:"crosshair"},pointerEvents:"none"},`mid-${$}`)})]})},[R,m,A,M,e.id,e.point,C]),re=R?{overflow:"visible"}:void 0;return Sa(qf,w(S({ref:h},c),{children:[eo(Qn,{isEditing:t,onChange:k,onBlur:p,font:T,text:v,color:(ee=f.labelColor)!=null?ee:y.stroke,background:f.labelBackground,textGradient:f.textGradient,offsetX:(b[0]-.5)*a.width,offsetY:(b[1]-.5)*a.height,width:Math.max(0,a.width-16)}),Sa(Yf,{id:e.id+"_svg",opacity:s?.3:y.opacity,style:re,children:[n&&eo(wc,{strokeWidth:y.strokeWidth,size:m}),eo(I,{id:g,style:f,size:m,isSelected:r,isDarkMode:l.isDarkMode}),K]})]}))}));d(this,"Indicator",q.Indicator(({shape:e,meta:t})=>{var a,c;let{id:n,style:r,size:s}=e;return!((t==null?void 0:t.canvasMode)==="straight")&&r.dash==="draw"?eo("path",{d:zi(n,r,s)}):eo("rect",{x:0,y:0,rx:(a=r.borderRadius)!=null?a:0,ry:(c=r.borderRadius)!=null?c:0,width:Math.max(1,s[0]),height:Math.max(1,s[1])})}));d(this,"getBounds",e=>Dt(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.label!==e.label);d(this,"transform",vn);d(this,"transformSingle",Tn)}},qf=P("div",{width:"100%",height:"100%"});import*as It from"react";import{HTMLContainer as Jf,Utils as Qf}from"telva-core";import{Vec as eS}from"telva-vec";import{jsx as Oi,jsxs as Lc}from"react/jsx-runtime";var $i=class extends q{constructor(){super(...arguments);d(this,"type","sticky");d(this,"canBind",!0);d(this,"canEdit",!0);d(this,"canClone",!0);d(this,"hideResizeHandles",!0);d(this,"showCloneHandles",!0);d(this,"getShape",e=>Qf.deepMerge({id:"id",type:"sticky",name:"Sticky",parentId:"page",childIndex:1,point:[0,0],size:[200,200],text:"",rotation:0,style:Oo},e));d(this,"Component",q.Component(({shape:e,meta:t,events:n,isGhost:r,isBinding:s,isEditing:l,onShapeBlur:a,onShapeChange:c},p)=>{let u=$d(e.style),{color:h,fill:g,stroke:m}=ra(e.style,t.isDarkMode),f=It.useRef(null),v=It.useRef(null),b=It.useRef(null),T=It.useRef(!1),y=It.useCallback(L=>{L.stopPropagation()},[]),x=It.useCallback(L=>{c==null||c({id:e.id,type:e.type,text:B.normalizeText(L)})},[e.id]),I=It.useCallback(L=>{x(L.currentTarget.value)},[c,x]),k=It.useCallback(L=>{if(L.key==="Escape"){L.preventDefault(),L.stopPropagation(),a==null||a();return}if(L.key==="Tab"&&e.text.length===0){L.preventDefault();return}if(!(L.key==="Meta"||L.metaKey))L.stopPropagation();else if(L.key==="z"&&L.metaKey){L.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1),L.stopPropagation(),L.preventDefault();return}(L.metaKey||L.ctrlKey)&&L.key==="="&&L.preventDefault(),L.key==="Tab"&&(L.preventDefault(),L.shiftKey?Fe.unindent(L.currentTarget):Fe.indent(L.currentTarget),c==null||c(w(S({},e),{text:B.normalizeText(L.currentTarget.value)})))},[e,c]),R=It.useCallback(L=>{L.currentTarget.setSelectionRange(0,0),a==null||a()},[]),C=It.useCallback(L=>{!l||!T.current||L.currentTarget.select()},[l]);It.useEffect(()=>{if(l){T.current=!0;let L=v.current;L.focus(),L.select()}},[l]),It.useEffect(()=>{let L=b.current,{size:A}=e,{offsetHeight:K}=L,re=ya-xn*2,F=A[1]-xn*2;if(K===F)return;if(K>re){c==null||c({id:e.id,size:[A[0],K+xn*2]});return}if(K<re&&A[1]>ya){c==null||c({id:e.id,size:[A[0],ya]});return}let ee=v.current;ee==null||ee.focus()},[e.text,e.size[1],e.style]);let E=e.style.textGradient,M=S({font:u,color:E?"transparent":h,textShadow:t.isDarkMode?"0.5px 0.5px 2px rgba(255, 255, 255,.25)":"0.5px 0.5px 2px rgba(255, 255, 255,.5)"},E?{background:Mo(E),WebkitBackgroundClip:"text",backgroundClip:"text"}:{});return Oi(Jf,w(S({ref:p},n),{children:Lc(tS,{ref:f,isDarkMode:t.isDarkMode,isGhost:r,style:S({backgroundColor:g,border:m?`2px solid ${m}`:void 0},M),children:[s&&Oi("div",{className:"tv-binding-indicator",style:{position:"absolute",top:-this.bindingDistance,left:-this.bindingDistance,width:`calc(100% + ${this.bindingDistance*2}px)`,height:`calc(100% + ${this.bindingDistance*2}px)`,backgroundColor:"var(--tv-selectFill)"}}),Lc(nS,{ref:b,isEditing:l,alignment:e.style.textAlign,children:[e.text,"\u200B"]}),l&&Oi(oS,{ref:v,onPointerDown:y,value:e.text,onChange:I,onKeyDown:k,onFocus:C,onBlur:R,tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,spellCheck:!0,alignment:e.style.textAlign,onContextMenu:ot,onCopy:ot,onPaste:ot,onCut:ot})]})}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:[t,n]}=e;return Oi("rect",{x:0,y:0,rx:3,ry:3,width:Math.max(1,t),height:Math.max(1,n)})}));d(this,"getBounds",e=>Dt(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.text!==e.text);d(this,"transform",(e,t,{scaleX:n,scaleY:r,transformOrigin:s})=>({point:eS.toFixed([t.minX+(t.width-e.size[0])*(n<0?1-s[0]:s[0]),t.minY+(t.height-e.size[1])*(r<0?1-s[1]:s[1])])}));d(this,"transformSingle",e=>e);d(this,"getSvgElement",(e,t)=>{var h,g;let n=this.getBounds(e),r=ra(e.style,t),s=oa(e.style.size)*((h=e.style.scale)!=null?h:1),l=bn(e.style.font,e.style.fontFamily).slice(1,-1),a=(g=e.style.textAlign)!=null?g:"start",c=qn(e.text,s,l,a,n.width-xn*2,!0);c.setAttribute("fill",r.color),c.setAttribute("transform",`translate(${xn}, ${xn})`);let p=document.createElementNS("http://www.w3.org/2000/svg","g"),u=document.createElementNS("http://www.w3.org/2000/svg","rect");return u.setAttribute("width",n.width+""),u.setAttribute("height",n.height+""),u.setAttribute("fill",r.fill),r.stroke&&(u.setAttribute("stroke",r.stroke),u.setAttribute("stroke-width","2")),u.setAttribute("rx","3"),u.setAttribute("ry","3"),p.appendChild(u),p.appendChild(c),p})}},xn=16,ya=200,tS=P("div",{pointerEvents:"all",position:"relative",backgroundColor:"rgba(255, 220, 100)",fontFamily:"sans-serif",height:"100%",width:"100%",padding:xn+"px",borderRadius:"3px",perspective:"800px",variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isDarkMode:{true:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.3), 1px 1px 4px rgba(0,0,0,.3), 1px 1px 2px rgba(0,0,0,.3)"},false:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.2), 1px 1px 4px rgba(0,0,0,.16), 1px 1px 2px rgba(0,0,0,.16)"}}}}),Ac={whiteSpace:"pre-wrap",overflowWrap:"break-word",letterSpacing:Ut},nS=P("div",S({position:"absolute",top:xn,left:xn,width:`calc(100% - ${xn*2}px)`,height:"fit-content",font:"inherit",pointerEvents:"none",userSelect:"none",variants:{isEditing:{true:{opacity:1},false:{opacity:1}},alignment:{["start"]:{textAlign:"left"},["middle"]:{textAlign:"center"},["end"]:{textAlign:"right"},["justify"]:{textAlign:"justify"}}}},Ac)),oS=P("textarea",w(S({width:"100%",height:"100%",border:"none",overflow:"hidden",background:"none",outline:"none",textAlign:"left",font:"inherit",padding:0,color:"transparent",verticalAlign:"top",resize:"none",caretColor:"black"},Ac),{variants:{alignment:{["start"]:{textAlign:"left"},["middle"]:{textAlign:"center"},["end"]:{textAlign:"right"},["justify"]:{textAlign:"justify"}}},"&:focus":{outline:"none",border:"none"}}));import*as Pt from"react";import{HTMLContainer as rS,Utils as ba}from"telva-core";import{Vec as no}from"telva-vec";import{jsx as Pr,jsxs as dS}from"react/jsx-runtime";var Gi=class extends q{constructor(){super(...arguments);d(this,"type","text");d(this,"isAspectRatioLocked",!1);d(this,"canEdit",!0);d(this,"canBind",!0);d(this,"canClone",!0);d(this,"bindingDistance",16/2);d(this,"getShape",e=>ba.deepMerge({id:"id",type:"text",name:"Text",parentId:"page",childIndex:1,point:[0,0],rotation:0,text:" ",style:Oo},e));d(this,"texts",new Map);d(this,"Component",q.Component(({shape:e,isBinding:t,isGhost:n,isEditing:r,onShapeBlur:s,onShapeChange:l,meta:a,events:c},p)=>{let{text:u,style:h}=e,g=J(h,a.isDarkMode),m=Ct(e.style),f=Pt.useRef(null),v=Pt.useRef(!1),b=Pt.useRef(u);Pt.useLayoutEffect(()=>{if(u!==b.current){let C=[0,0];this.texts.set(e.id,u);let E=this.getBounds(e),M=this.getBounds(e);switch(e.style.textAlign){case"start":break;case"middle":{C=no.div([M.width-E.width,0],2);break}case"end":{C=[M.width-E.width,0];break}}b.current=u,l==null||l(w(S({},e),{id:e.id,point:no.sub(e.point,C),text:u}))}},[u]);let T=Pt.useCallback(C=>{let E=[0,0],M=B.normalizeText(C.currentTarget.value),L=this.getBounds(e);this.texts.set(e.id,M);let A=this.getBounds(w(S({},e),{text:M}));switch(e.style.textAlign){case"start":break;case"middle":{E=no.div([A.width-L.width,0],2);break}case"end":{E=[A.width-L.width,0];break}}b.current=M,l==null||l(w(S({},e),{id:e.id,point:no.sub(e.point,E),text:M}))},[e.id,e.point]),y=Pt.useCallback(C=>{if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),s==null||s();return}if(C.key==="Tab"&&e.text.length===0){C.preventDefault();return}if(C.key==="Enter"&&(C.metaKey||C.ctrlKey)){C.preventDefault(),C.stopPropagation(),f.current.blur();return}if(!(C.key==="Meta"||C.metaKey))C.stopPropagation();else if(C.key==="z"&&C.metaKey){C.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1),C.stopPropagation(),C.preventDefault();return}(C.metaKey||C.ctrlKey)&&C.key==="="&&C.preventDefault(),C.key==="Tab"&&(C.preventDefault(),C.shiftKey?Fe.unindent(C.currentTarget):Fe.indent(C.currentTarget),l==null||l(w(S({},e),{text:B.normalizeText(C.currentTarget.value)})))},[e,l]),x=Pt.useCallback(C=>{C.currentTarget.setSelectionRange(0,0),s==null||s()},[]),I=Pt.useCallback(C=>{!r||!v.current||document.activeElement===C.currentTarget&&C.currentTarget.select()},[r]),k=Pt.useCallback(C=>{r&&C.stopPropagation()},[r]),R=Pt.useRef(r);return Pt.useEffect(()=>{r?(R.current=!0,this.texts.set(e.id,u),requestAnimationFrame(()=>{v.current=!0;let C=f.current;C&&(C.focus(),C.select())})):R.current&&(R.current=!1,s==null||s())},[r]),Pr(rS,w(S({ref:p},c),{children:Pr(sS,{isGhost:n,isEditing:r,onPointerDown:k,style:{opacity:n?void 0:g.opacity},children:dS(aS,{style:S({font:m,color:h.textGradient&&!r?"transparent":g.stroke,textAlign:Ad(h.textAlign),width:e.size?`${e.size[0]}px`:"auto",whiteSpace:e.size?"pre-wrap":"pre",wordBreak:e.size?"break-word":"normal",overflowWrap:e.size?"break-word":"normal"},h.textGradient&&!r?{background:Mo(h.textGradient),WebkitBackgroundClip:"text",backgroundClip:"text"}:{}),children:[t&&Pr("div",{className:"tv-binding-indicator",style:{position:"absolute",top:-this.bindingDistance,left:-this.bindingDistance,width:`calc(100% + ${this.bindingDistance*2}px)`,height:`calc(100% + ${this.bindingDistance*2}px)`,backgroundColor:"var(--tv-selectFill)"}}),r?Pr(lS,{ref:f,style:{font:m,color:g.stroke},name:"text",tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,placeholder:"",spellCheck:"true",wrap:"off",dir:"auto",datatype:"wysiwyg",defaultValue:u,color:g.stroke,onFocus:I,onChange:T,onKeyDown:y,onBlur:x,onPointerDown:k,onContextMenu:ot,onCopy:ot,onPaste:ot,onCut:ot}):u,"\u200B"]})})}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{width:t,height:n}=this.getBounds(e);return Pr("rect",{x:0,y:0,width:t,height:n})}));d(this,"getBounds",e=>{let t=ba.getFromCache(this.boundsCache,e,()=>{var s;if(!gt)return{minX:0,minY:0,maxX:10,maxY:10,width:10,height:10};gt.parentNode||document.body.appendChild(gt),gt.style.font=Ct(e.style),gt.textContent=(s=this.texts.get(e.id))!=null?s:e.text,e.size?(gt.style.whiteSpace="pre-wrap",gt.style.wordBreak="break-word",gt.style.overflowWrap="break-word",gt.style.width=`${e.size[0]}px`):(gt.style.whiteSpace="pre",gt.style.wordBreak="normal",gt.style.overflowWrap="normal",gt.style.width="auto");let n=e.size?e.size[0]:gt.offsetWidth||1,r=gt.offsetHeight||1;return{minX:0,maxX:n,minY:0,maxY:r,width:n,height:r}});return ba.translateBounds(t,e.point)});d(this,"shouldRender",(e,t)=>t.text!==e.text||t.style.scale!==e.style.scale||t.style!==e.style||t.size!==e.size);d(this,"transform",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>{let{rotation:l=0,style:{scale:a=1}}=n,c=a*Math.abs(Math.min(r,s));return{point:[t.minX,t.minY],size:[t.width,t.height],rotation:r<0&&s>=0||s<0&&r>=0?-(l||0):l,style:w(S({},n.style),{scale:c})}});d(this,"transformSingle",(e,t,{initialShape:n,scaleX:r,scaleY:s})=>({point:no.toFixed([t.minX,t.minY]),size:[t.width,t.height]}));d(this,"onDoubleClickBoundsHandle",e=>{let t=this.getCenter(e),n=this.getCenter(w(S({},e),{style:w(S({},e.style),{scale:1})}));return{style:w(S({},e.style),{scale:1}),point:no.toFixed(no.add(e.point,no.sub(t,n)))}});d(this,"getSvgElement",(e,t)=>{var p,u;let n=this.getBounds(e),r=J(e.style,t),s=bo(e.style.size,e.style.font)*((p=e.style.scale)!=null?p:1),l=bn(e.style.font).slice(1,-1),a=(u=e.style.textAlign)!=null?u:"middle",c=qn(e.text,s,l,a,e.size?e.size[0]:n.width,!!e.size);return c.setAttribute("fill",r.stroke),c})}},gt;function iS(){var o;(o=document.getElementById("__textMeasure"))==null||o.remove();let i=document.createElement("pre");return i.id="__textMeasure",Object.assign(i.style,{whiteSpace:"pre",width:"auto",border:"1px solid transparent",padding:"4px",margin:"0px",letterSpacing:Ut,opacity:"0",position:"absolute",top:"-500px",left:"0px",zIndex:"9999",pointerEvents:"none",userSelect:"none",alignmentBaseline:"mathematical",dominantBaseline:"mathematical"}),i.tabIndex=-1,document.body.appendChild(i),i}typeof window!="undefined"&&(gt=iS());var sS=P("div",{width:"100%",height:"100%",variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isEditing:{false:{pointerEvents:"all",userSelect:"all"},true:{pointerEvents:"none",userSelect:"none"}}}}),Vc={whiteSpace:"pre-wrap",overflowWrap:"break-word"},aS=P("div",S({position:"absolute",width:"100%",height:"100%",padding:"4px",zIndex:1,minHeight:1,minWidth:1,lineHeight:1,letterSpacing:Ut,outline:0,fontWeight:"500",backfaceVisibility:"hidden",userSelect:"none",pointerEvents:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",isEditing:{false:{},true:{pointerEvents:"all",background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text"}}},Vc)),lS=P("textarea",w(S({position:"absolute",top:0,left:0,zIndex:1,width:"100%",height:"100%",border:"none",padding:"4px",resize:"none",textAlign:"inherit",minHeight:"inherit",minWidth:"inherit",lineHeight:"inherit",letterSpacing:"inherit",outline:0,fontWeight:"inherit",overflow:"hidden",backfaceVisibility:"hidden",display:"inline-block",pointerEvents:"all",background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text"},Vc),{"&:focus":{outline:"none",border:"none"}}));import*as Wn from"react";import{SVGContainer as bS,Utils as oo}from"telva-core";import{intersectBoundsPolygon as vS,intersectLineSegmentPolyline as TS,intersectRayLineSegment as xS}from"telva-intersect";import ft from"telva-vec";import*as $c from"react";import{Utils as Oc}from"telva-core";import hS from"telva-vec";import cS,{getStrokePoints as pS}from"perfect-freehand";import{Utils as ji}from"telva-core";import ko from"telva-vec";function Xt(i,o=0,e=0){let[t,n]=i,r=[[t/2,0],[t,n],[0,n]];return o&&(r=Fd(r,o)),e&&(r=r.map(s=>ko.rotWith(s,[t/2,n/2],e))),r}function va(i){let[o,e]=i,t=[[o/2,0],[o,e],[0,e]];return[(t[0][0]+t[1][0]+t[2][0])/3,(t[0][1]+t[1][1]+t[2][1])/3]}function uS(i,o,e){let[t,n]=o,r=ji.rng(i),s=Array.from(Array(3)).map(()=>[r()*e*.75,r()*e*.75]),l=[ko.add([t/2,0],s[0]),ko.add([t,n],s[1]),ko.add([0,n],s[2])],a=Math.round(Math.abs(r()*2*3)),c=ji.rotateArray([ko.pointsBetween(l[0],l[1],32),ko.pointsBetween(l[1],l[2],32),ko.pointsBetween(l[2],l[0],32)],a);return{points:[...c.flat(),...c[0]]}}function Hc(i,o,e){let{strokeWidth:t}=J(e),{points:n}=uS(i,o,t);return{points:n,options:{size:t,thinning:.65,streamline:.3,smoothing:1,simulatePressure:!1,last:!0}}}function zc(i,o,e){let{points:t,options:n}=Hc(i,o,e),r=cS(t,n);return ji.getSvgPathFromStroke(r)}function Fc(i,o,e){let{points:t,options:n}=Hc(i,o,e);return ji.getSvgPathFromStrokePoints(pS(t,n))}import{Fragment as mS,jsx as Wi,jsxs as gS}from"react/jsx-runtime";var Gc=$c.memo(function({id:o,size:e,style:t,isSelected:n,isDarkMode:r}){let{stroke:s,strokeWidth:l,fill:a}=J(t,r),{defs:c,gradFill:p}=ut(o,t),u=p!=null?p:a,h=1+l*1.618,g=Xt(e),f=Oc.pointsToLineSegments(g,!0).map(([b,T],y)=>{let{strokeDasharray:x,strokeDashoffset:I}=Oc.getPerfectDashProps(hS.dist(b,T),l*1.618,t.dash);return Wi("line",{x1:b[0],y1:b[1],x2:T[0],y2:T[1],stroke:s,strokeWidth:h,strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:I},o+"_"+y)}),v=g.join();return gS(mS,{children:[c,Wi("polygon",{className:t.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",points:v}),t.isFilled&&Wi("polygon",{fill:u,points:v,pointerEvents:"none"}),Wi("g",{pointerEvents:"stroke",children:f})]})});import*as jc from"react";import{Fragment as fS,jsx as Ta,jsxs as SS}from"react/jsx-runtime";var Wc=jc.memo(function({id:o,size:e,style:t,isSelected:n,isDarkMode:r}){let{stroke:s,strokeWidth:l,fill:a}=J(t,r),{defs:c,gradFill:p}=ut(o,t),u=p!=null?p:a,h=zc(o,e,t),g=Fc(o,e,t);return SS(fS,{children:[c,Ta("path",{className:t.isFilled||n?"tv-fill-hitarea":"tv-stroke-hitarea",d:g}),t.isFilled&&Ta("path",{d:g,fill:u,pointerEvents:"none"}),Ta("path",{d:h,fill:s,stroke:s,strokeWidth:l,pointerEvents:"none"})]})});import{jsx as yS}from"react/jsx-runtime";function Nc({size:i}){let o=Xt(i).join();return yS("polygon",{className:"tv-binding-indicator",points:o,strokeWidth:16*2})}import{jsx as Uo,jsxs as xa}from"react/jsx-runtime";var Ni=class extends q{constructor(){super(...arguments);d(this,"type","triangle");d(this,"canBind",!0);d(this,"canClone",!0);d(this,"canEdit",!0);d(this,"getShape",e=>oo.deepMerge({id:"id",type:"triangle",name:"Triangle",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:He,label:"",labelPoint:[.5,.5]},e));d(this,"Component",q.Component(({shape:e,bounds:t,isBinding:n,isEditing:r,isSelected:s,isGhost:l,meta:a,events:c,onShapeChange:p,onShapeBlur:u},h)=>{var ee,pe;let{id:g,label:m="",size:f,style:v,labelPoint:b=Ho}=e,T=Ct(v),y=J(v,a.isDarkMode),I=!(a.canvasMode==="straight")&&v.dash==="draw"?Wc:Gc,k=Wn.useCallback(he=>p==null?void 0:p({id:g,label:he}),[p]),R=Wn.useMemo(()=>{let he=ft.div(f,2);return(va(f)[1]-he[1])*.72},[f]),C=a.nodeEditingId===e.id,E=N(),M=Wn.useRef(null),[L,A]=Wn.useState(null),K=(ee=E.zoom)!=null?ee:1,re=Wn.useMemo(()=>{if(!C)return null;let[he,De]=f,ct=[[0,0],[he,0],[he,De],[0,De]],Ze=[2,3,0,1],_e=5/K,Se=1/K,$=Xt(f);return xa("g",{children:[$.map((ie,ae)=>{let _=$[(ae+1)%$.length];return Uo("line",{x1:ie[0],y1:ie[1],x2:_[0],y2:_[1],stroke:"#0D99FF",strokeWidth:Se,strokeOpacity:.3,pointerEvents:"none"},`tl-${ae}`)}),ct.map(([ie,ae],_)=>Uo("circle",{cx:ie,cy:ae,r:L===_?_e*1.4:_e,fill:L===_?"#0D99FF":"white",stroke:"#0D99FF",strokeWidth:1.5/K,style:{cursor:"nwse-resize"},onPointerEnter:()=>A(_),onPointerLeave:()=>A(null),onPointerDown:G=>{G.stopPropagation(),G.currentTarget.setPointerCapture(G.pointerId);let Y=ct[Ze[_]];M.current={nodeIdx:_,fixedPage:ft.add(e.point,Y)}},onPointerMove:G=>{if(!M.current||M.current.nodeIdx!==_)return;G.stopPropagation();let Y=E.getPagePoint([G.clientX,G.clientY]),te=M.current.fixedPage,H=Math.min(Y[0],te[0]),Ee=Math.min(Y[1],te[1]),At=Math.max(Y[0],te[0]),Nt=Math.max(Y[1],te[1]);E.patchState({document:{pages:{[E.currentPageId]:{shapes:{[e.id]:{point:[H,Ee],size:[Math.max(1,At-H),Math.max(1,Nt-Ee)]}}}}}})},onPointerUp:G=>{if(!M.current)return;G.stopPropagation();let Y=E.getPagePoint([G.clientX,G.clientY]),te=M.current.fixedPage,H=Math.min(Y[0],te[0]),Ee=Math.min(Y[1],te[1]),At=Math.max(Y[0],te[0]),Nt=Math.max(Y[1],te[1]);M.current=null,E.updateShapes({id:e.id,point:[H,Ee],size:[Math.max(1,At-H),Math.max(1,Nt-Ee)]})}},`cn-${_}`))]})},[C,f,K,L,e.id,e.point,E]),F=C?{overflow:"visible"}:void 0;return xa(kS,w(S({ref:h},c),{children:[Uo(Qn,{font:T,text:m,color:(pe=v.labelColor)!=null?pe:y.stroke,background:v.labelBackground,textGradient:v.textGradient,offsetX:(b[0]-.5)*t.width,offsetY:R+(b[1]-.5)*t.height,width:Math.max(0,t.width*.5-16),isEditing:r,onChange:k,onBlur:u}),xa(bS,{id:e.id+"_svg",opacity:l?.3:y.opacity,style:F,children:[n&&Uo(Nc,{size:f}),Uo(I,{id:g,style:v,size:f,isSelected:s,isDarkMode:a.isDarkMode}),re]})]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:t}=e;return Uo("polygon",{points:Xt(t).join()})}));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.label!==e.label);d(this,"getBounds",e=>Dt(e,this.boundsCache));d(this,"getExpandedBounds",e=>oo.getBoundsFromPoints(Xt(e.size,this.bindingDistance).map(t=>ft.add(t,e.point))));d(this,"hitTestLineSegment",(e,t,n)=>TS(t,n,this.getPoints(e)).didIntersect);d(this,"hitTestBounds",(e,t)=>oo.boundsContained(this.getBounds(e),t)||vS(t,this.getPoints(e)).length>0);d(this,"getBindingPoint",(e,t,n,r,s,l)=>{let a=this.getExpandedBounds(e);if(!oo.pointInBounds(n,a))return;let c=Xt(e.size).map(y=>ft.add(y,e.point)),p=Xt(e.size,this.bindingDistance).map(y=>ft.add(y,e.point)),u=oo.pointsToLineSegments(c,!0).map(([y,x])=>ft.distanceToLineSegment(y,x,n)).sort((y,x)=>y-x)[0];if(!(oo.pointInPolygon(n,p)||u<this.bindingDistance))return;let h=oo.pointsToLineSegments(p.concat([p[0]])).map(y=>xS(r,s,y[0],y[1])).filter(y=>y.didIntersect).flatMap(y=>y.points);if(!h.length)return;let g=ft.add(va(e.size),e.point),m=h.sort((y,x)=>ft.dist(x,r)-ft.dist(y,r))[0],f=ft.med(n,m),v,b;l?(v=ft.dist(n,g)<16/2?g:n,b=0):(ft.distanceToLineSegment(n,f,g)<16/2?v=g:v=f,oo.pointInPolygon(n,c)?b=this.bindingDistance:b=Math.max(this.bindingDistance,u));let T=ft.divV(ft.sub(v,[a.minX,a.minY]),[a.width,a.height]);return{point:ft.clampV(T,0,1),distance:b}});d(this,"transform",vn);d(this,"transformSingle",Tn)}getPoints(e){let{rotation:t=0,point:[n,r],size:[s,l]}=e;return[[n+s/2,r],[n,r+l],[n+s,r+l]].map(a=>ft.rotWith(a,this.getCenter(e),t))}},kS=P("div",{width:"100%",height:"100%"});import{styled as Uc}from"@stitches/react";import*as un from"react";import{HTMLContainer as CS,Utils as wS}from"telva-core";import{jsx as Rr,jsxs as RS}from"react/jsx-runtime";var Ui=class extends q{constructor(){super(...arguments);d(this,"type","video");d(this,"canBind",!0);d(this,"canEdit",!0);d(this,"canClone",!0);d(this,"isAspectRatioLocked",!0);d(this,"showCloneHandles",!1);d(this,"isStateful",!0);d(this,"getShape",e=>wS.deepMerge({id:"video",type:"video",name:"Video",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:He,assetId:"assetId",isPlaying:!0,currentTime:0},e));d(this,"Component",q.Component(({shape:e,asset:t={src:""},isBinding:n,isEditing:r,isGhost:s,meta:l,events:a,onShapeChange:c},p)=>{let u=un.useRef(null),h=un.useRef(null),{currentTime:g=0,size:m,isPlaying:f,style:v}=e;un.useLayoutEffect(()=>{let x=h.current;if(!x)return;let[I,k]=m;x.style.width=`${I}px`,x.style.height=`${k}px`},[m]),un.useLayoutEffect(()=>{let x=u.current;!x||(f?x.play():x.pause())},[f]),un.useLayoutEffect(()=>{let x=u.current;!x||g!==x.currentTime&&(x.currentTime=g)},[g]);let b=un.useCallback(()=>{c==null||c({id:e.id,isPlaying:!0})},[]),T=un.useCallback(()=>{c==null||c({id:e.id,isPlaying:!1})},[]),y=un.useCallback(()=>{let x=u.current;!x||!r||c==null||c({id:e.id,currentTime:x.currentTime})},[r]);return RS(CS,w(S({ref:p},a),{children:[n&&Rr("div",{className:"tv-binding-indicator",style:{position:"absolute",top:-this.bindingDistance,left:-this.bindingDistance,width:`calc(100% + ${this.bindingDistance*2}px)`,height:`calc(100% + ${this.bindingDistance*2}px)`,backgroundColor:"var(--tv-selectFill)"}}),Rr(IS,{ref:h,isDarkMode:l.isDarkMode,isGhost:s,isFilled:v.isFilled,children:Rr(PS,{ref:u,id:e.id+"_video",muted:!0,loop:!0,playsInline:!0,disableRemotePlayback:!0,disablePictureInPicture:!0,controls:r,autoPlay:f,onPlay:b,onPause:T,onTimeUpdate:y,children:Rr("source",{src:t.src})})})]}))}));d(this,"Indicator",q.Indicator(({shape:e})=>{let{size:[t,n]}=e;return Rr("rect",{x:0,y:0,rx:2,ry:2,width:Math.max(1,t),height:Math.max(1,n)})}));d(this,"getBounds",e=>Dt(e,this.boundsCache));d(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.isPlaying!==e.isPlaying);d(this,"getSvgElement",e=>{let t=this.getBounds(e),n=document.createElementNS("http://www.w3.org/2000/svg","image");return n.setAttribute("width",`${t.width}`),n.setAttribute("height",`${t.height}`),n.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),n});d(this,"transform",vn);d(this,"transformSingle",Tn)}},IS=Uc("div",{pointerEvents:"all",position:"relative",fontFamily:"sans-serif",fontSize:"2em",height:"100%",width:"100%",borderRadius:"3px",perspective:"800px",overflow:"hidden",p:{userSelect:"none"},img:{userSelect:"none"},variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isFilled:{true:{},false:{}},isDarkMode:{true:{},false:{}}},compoundVariants:[{isFilled:!0,isDarkMode:!0,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.3), 1px 1px 4px rgba(0,0,0,.3), 1px 1px 2px rgba(0,0,0,.3)"}},{isFilled:!0,isDarkMode:!1,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.2), 1px 1px 4px rgba(0,0,0,.16), 1px 1px 2px rgba(0,0,0,.16)"}}]}),PS=Uc("video",{position:"absolute",top:0,left:0,width:"100%",height:"100%",maxWidth:"100%",minWidth:"100%",pointerEvents:"none",objectFit:"cover",userSelect:"none",borderRadius:2});var ka=new Fi,Ca=new Ni,wa=new Di,Ia=new Pi,Dr=new wi,DS=new Gi,ES=new Ei,Ki=new $i,BS=new Mi,MS=new Ui,LS=new Vi,AS=new Ai,kn={["rectangle"]:ka,["triangle"]:Ca,["ellipse"]:wa,["draw"]:Ia,["arrow"]:Dr,["text"]:DS,["group"]:ES,["sticky"]:Ki,["image"]:BS,["video"]:MS,["reactComponent"]:LS,["pen"]:AS},Kc=i=>typeof i=="string"?kn[i]:kn[i.type];var _c=!1,W=class{static getShapeUtil(o){return Kc(o)}static getSelectedShapes(o,e){let t=W.getPage(o,e);return W.getSelectedIds(o,e).map(r=>t.shapes[r])}static screenToWorld(o,e){let t=W.getPageState(o,o.appState.currentPageId).camera;return X.sub(X.div(e,t.zoom),t.point)}static getCameraZoom(o){return jt.clamp(o,.1,5)}static getPage(o,e){return o.document.pages[e]}static getPageState(o,e){return o.document.pageStates[e]}static getSelectedIds(o,e){return W.getPageState(o,e).selectedIds}static getShapes(o,e){return Object.values(W.getPage(o,e).shapes)}static getCamera(o,e){return W.getPageState(o,e).camera}static getShape(o,e,t){return W.getPage(o,t).shapes[e]}static getCenter(o){return W.getShapeUtil(o).getCenter(o)}static getBounds(o){return W.getShapeUtil(o).getBounds(o)}static getRotatedBounds(o){return W.getShapeUtil(o).getRotatedBounds(o)}static getSelectedBounds(o){return jt.getCommonBounds(W.getSelectedShapes(o,o.appState.currentPageId).map(e=>W.getShapeUtil(e).getBounds(e)))}static getParentId(o,e,t){return W.getShape(o,e,t).parentId}static getDocumentBranch(o,e,t){let n=W.getShape(o,e,t);return n.children===void 0?[e]:[e,...n.children.flatMap(r=>W.getDocumentBranch(o,r,t))]}static getSelectedBranchSnapshot(o,e,t){let n=W.getPage(o,e),r=W.getSelectedIds(o,e).flatMap(s=>W.getDocumentBranch(o,s,e).map(l=>n.shapes[l])).filter(s=>!s.isLocked).map(jt.deepClone);return t!==void 0?r.map(s=>S({id:s.id},t(s))):r}static getSelectedShapeSnapshot(o,e,t){let n=W.getSelectedShapes(o,e).filter(r=>!r.isLocked).map(jt.deepClone);return t!==void 0?n.map(r=>S({id:r.id},t(r))):n}static getAllEffectedShapeIds(o,e,t){let n=W.getPage(o,t),r=new Set(e);return e.forEach(s=>{let l=n.shapes[s];function a(p){p.children!==void 0&&p.children.filter(u=>!r.has(u)).forEach(u=>{r.add(u),a(n.shapes[u])})}a(l);function c(p){let u=p.parentId;u!==n.id&&(r.has(u)||(r.add(u),c(n.shapes[u])))}c(l),r.forEach(p=>{Object.values(n.bindings).filter(u=>u.fromId===p||u.toId===p).forEach(u=>r.add(u.fromId===p?u.toId:u.fromId))})}),Array.from(r.values())}static getLinkedShapeIds(o,e,t,n=!0){let r=W.getSelectedIds(o,e),s=W.getPage(o,e),l=new Set(r),a=new Set,c=[...r],p=new Set(Object.values(s.shapes).filter(u=>{var h;return u.type==="arrow"&&(u.handles.start.bindingId||((h=u.handles)==null?void 0:h.end.bindingId))}));for(;c.length;){let u=c.pop();if(!(u&&p.size))break;a.has(u)||(a.add(u),p.forEach(h=>{var T,y;let{handles:{start:{bindingId:g},end:{bindingId:m}}}=h,f=g?s.bindings[g]:null,v=m?s.bindings[m]:null,b=!1;f&&f.toId===u?(t==="center"?b=!0:((T=h.decorations)==null?void 0:T.start)&&v?b=t==="left":b=t==="right",b&&(n&&l.add(h.id),l.add(u),v&&(l.add(v.toId),c.push(v.toId)))):v&&v.toId===u&&(t==="center"?b=!0:((y=h.decorations)==null?void 0:y.end)&&f?b=t==="left":b=t==="right",b&&(n&&l.add(h.id),l.add(u),f&&(l.add(f.toId),c.push(f.toId)))),(!f||l.has(f.toId))&&(!v||l.has(v.toId))&&p.delete(h)}))}return Array.from(l.values())}static getChildIndexAbove(o,e,t){let n=o.document.pages[t],r=n.shapes[e],s;if(r.parentId===n.id)s=Object.values(n.shapes).filter(c=>c.parentId===n.id).sort((c,p)=>c.childIndex-p.childIndex);else{let c=n.shapes[r.parentId];if(!c.children)throw Error("No children in parent!");s=c.children.map(p=>n.shapes[p]).sort((p,u)=>p.childIndex-u.childIndex)}let l=s.indexOf(r),a=s[l+1];return a?a.childIndex:r.childIndex+1}static getBeforeShape(o,e){return Object.fromEntries(Object.keys(e).map(t=>[t,o[t]]))}static mutateShapes(o,e,t,n,r=!1){let s={},l={};e.forEach((c,p)=>{let u=W.getShape(o,c,n);if(u.isLocked)return;(u==null?void 0:u.type)==="group"&&(e.length===1||r)&&u.children.forEach((g,m)=>{let f=W.getShape(o,g,n);if(f.isLocked)return;let v=t(f,m);v&&(s[g]=W.getBeforeShape(f,v),l[g]=v)});let h=t(u,p);h&&(s[c]=W.getBeforeShape(u,h),l[c]=h)});let a=jt.deepMerge(o,{document:{pages:{[o.appState.currentPageId]:{shapes:l}}}});return{before:s,after:l,data:a}}static createShapes(o,e,t){let n={document:{pages:{[t]:{shapes:S({},Object.fromEntries(e.flatMap(s=>{let l=[[s.id,void 0]];if(s.parentId!==t){let a=W.getShape(o,s.parentId,t);if(!a.children)throw Error("No children in parent!");l.push([a.id,{children:a.children}])}return l})))}}}},r={document:{pages:{[t]:{shapes:{shapes:S({},Object.fromEntries(e.flatMap(s=>{let l=[[s.id,s]];if(s.parentId!==t){let a=W.getShape(o,s.parentId,t);if(!a.children)throw Error("No children in parent!");l.push([a.id,{children:[...a.children,s.id]}])}return l})))}}}}};return{before:n,after:r}}static deleteShapes(o,e,t){t=t||o.appState.currentPageId;let n=W.getPage(o,t),r=typeof e[0]=="string"?e:e.map(a=>a.id),s={document:{pages:{[t]:{shapes:S({},Object.fromEntries(r.flatMap(a=>{let c=n.shapes[a],p=[[c.id,c]];if(c.parentId!==t){let u=n.shapes[c.parentId];if(!u.children)throw Error("No children in parent!");p.push([u.id,{children:u.children}])}return p}))),bindings:S({},Object.fromEntries(Object.values(n.bindings).filter(a=>r.includes(a.fromId)||r.includes(a.toId)).map(a=>[a.id,a])))}}}},l={document:{pages:{[t]:{shapes:S({},Object.fromEntries(r.flatMap(a=>{let c=n.shapes[a],p=[[c.id,void 0]];if(c.parentId!==n.id){let u=n.shapes[c.parentId];if(!u.children)throw Error("No children in parent!");p.push([u.id,{children:u.children.filter(h=>h!==c.id)}])}return p})))}}}};return{before:s,after:l}}static onSessionComplete(o){var t,n;let e=(n=(t=W.getShapeUtil(o)).onSessionComplete)==null?void 0:n.call(t,o);return e?S(S({},o),e):o}static onChildrenChange(o,e,t){var r,s;if(!e.children)return;let n=(s=(r=W.getShapeUtil(e)).onChildrenChange)==null?void 0:s.call(r,e,e.children.map(l=>W.getShape(o,l,t)));return n?S(S({},e),n):e}static updateArrowBindings(o,e){var s,l,a,c,p,u;let t={start:rt(e.handles.start),end:rt(e.handles.end)},n={isBound:!1,handle:e.handles.start,point:X.add(e.handles.start.point,e.point)},r={isBound:!1,handle:e.handles.end,point:X.add(e.handles.end.point,e.point)};if(e.handles.start.bindingId){let h=((s=e.decorations)==null?void 0:s.start)!==void 0,g=e.handles.start,m=o.bindings[e.handles.start.bindingId];if(!m)throw Error("Could not find a binding to match the start handle's bindingId: "+e.handles.start.bindingId);let f=o.shapes[m.toId],v=W.getShapeUtil(f),b=v.getBounds(f),T=v.getExpandedBounds(f),y=h?jt.expandBounds(b,m.distance):b,{minX:x,minY:I,width:k,height:R}=T,C=X.add([x,I],X.mulV([k,R],X.rotWith(m.point,[.5,.5],f.rotation||0)));n={isBound:!0,hasDecoration:h,binding:m,handle:g,point:C,util:v,target:f,bounds:b,expandedBounds:T,intersectBounds:y,center:v.getCenter(f)}}if(e.handles.end.bindingId){let h=((l=e.decorations)==null?void 0:l.end)!==void 0,g=e.handles.end,m=o.bindings[e.handles.end.bindingId];if(!m)throw Error("Could not find a binding to match the end handle's bindingId");let f=o.shapes[m.toId],v=W.getShapeUtil(f),b=v.getBounds(f),T=v.getExpandedBounds(f),y=h?jt.expandBounds(b,m.distance):b,{minX:x,minY:I,width:k,height:R}=T,C=X.add([x,I],X.mulV([k,R],X.rotWith(m.point,[.5,.5],f.rotation||0)));r={isBound:!0,hasDecoration:h,binding:m,handle:g,point:C,util:v,target:f,bounds:b,expandedBounds:T,intersectBounds:y,center:v.getCenter(f)}}for(let h of["end","start"]){let g=h==="start"?n:r,m=h==="start"?r:n;if(g.isBound)if(!g.binding.distance)t[h].point=X.sub(g.point,e.point);else{let f=X.uni(X.sub(g.point,m.point));switch(g.target.type){case"ellipse":{let v=VS(m.point,f,g.center,g.target.radius[0]+(g.hasDecoration?g.binding.distance:0),g.target.radius[1]+(g.hasDecoration?g.binding.distance:0),g.target.rotation||0).points.sort((b,T)=>X.dist(b,m.point)-X.dist(T,m.point));v[0]!==void 0&&(t[h].point=X.toFixed(X.sub(v[0],e.point)));break}case"triangle":{let v=g.target.point,b=Xt(g.target.size,g.hasDecoration?16:0,g.target.rotation).map(y=>X.add(y,v)),T=jt.pointsToLineSegments(b,!0).map(([y,x])=>HS(m.point,f,y,x)).filter(y=>y.didIntersect).flatMap(y=>y.points).sort((y,x)=>X.dist(y,m.point)-X.dist(x,m.point));T[0]!==void 0&&(t[h].point=X.toFixed(X.sub(T[0],e.point)));break}default:{let v=Pa(m.point,f,g.intersectBounds,g.target.rotation).filter(T=>T.didIntersect).map(T=>T.points[0]).sort((T,y)=>X.dist(T,m.point)-X.dist(y,m.point));if(!v[0])continue;let b;if(m.isBound&&(b=Pa(m.point,f,m.intersectBounds,m.target.rotation).filter(y=>y.didIntersect).map(y=>y.points[0]).sort((y,x)=>X.dist(y,m.point)-X.dist(x,m.point))[0]),m.isBound&&(v.length<2||b&&v[0]&&Math.ceil(X.dist(v[0],b))<16*2.5||jt.boundsContain(g.expandedBounds,m.expandedBounds)||jt.boundsCollide(g.expandedBounds,m.expandedBounds))){let T=X.uni(X.sub(m.point,g.point)),y=Pa(g.point,T,g.bounds,g.target.rotation).filter(x=>x.didIntersect).map(x=>x.points[0]);if(!y[0])continue;t[h].point=X.toFixed(X.sub(y[0],e.point)),t[h==="start"?"end":"start"].point=X.toFixed(X.add(X.sub(y[0],e.point),X.mul(T,Math.min(X.dist(y[0],m.point),16*2.5*(jt.boundsContain(m.bounds,g.intersectBounds)?-1:1)))))}else if(!m.isBound&&(v[0]&&X.dist(v[0],m.point)<16*2.5||jt.pointInBounds(m.point,g.intersectBounds))){let T=X.uni(X.sub(g.center,m.point));return(c=(a=W.getShapeUtil(e)).onHandleChange)==null?void 0:c.call(a,e,{[h]:w(S({},e.handles[h]),{point:X.toFixed(X.add(X.sub(m.point,e.point),X.mul(T,16*2.5)))})})}else v[0]&&(t[h].point=X.toFixed(X.sub(v[0],e.point)))}}}}return(u=(p=W.getShapeUtil(e)).onHandleChange)==null?void 0:u.call(p,e,t)}static transform(o,e,t){let n=W.getShapeUtil(o).transform(o,e,t);return n?S(S({},o),n):o}static transformSingle(o,e,t){let n=W.getShapeUtil(o).transformSingle(o,e,t);return n?S(S({},o),n):o}static getRotatedShapeMutation(o,e,t,n){var c,p;let r=X.sub(e,o.point),s=X.rotWith(e,t,n),l=X.toFixed(X.sub(s,r));if(o.handles!==void 0)return(p=(c=this.getShapeUtil(o)).onHandleChange)==null?void 0:p.call(c,w(S({},o),{point:l}),Object.fromEntries(Object.entries(o.handles).map(([h,g])=>{let m=X.toFixed(X.rotWith(g.point,r,n));return[h,w(S({},g),{point:m})]})));let a=jt.clampRadians((o.rotation||0)+n);return{point:l,rotation:a}}static updateParents(o,e,t){let n=W.getPage(o,e);if(t.length===0)return;let{shapes:r}=W.getPage(o,e),s=Array.from(new Set(t.map(l=>r[l].parentId).values())).filter(l=>l!==n.id);for(let l of s){let a=r[l];if(!a.children)throw Error("A shape is parented to a shape without a children array.");W.onChildrenChange(o,a,e)}W.updateParents(o,e,s)}static getBinding(o,e,t){return W.getPage(o,t).bindings[e]}static getBindings(o,e){let t=W.getPage(o,e);return Object.values(t.bindings)}static getBindableShapeIds(o){return W.getShapes(o,o.appState.currentPageId).filter(e=>W.getShapeUtil(e).canBind).sort((e,t)=>t.childIndex-e.childIndex).map(e=>e.id)}static getBindingsWithShapeIds(o,e,t){return Array.from(new Set(W.getBindings(o,t).filter(n=>e.includes(n.toId)||e.includes(n.fromId))).values())}static getRelatedBindings(o,e,t){let n=new Set(e),r=W.getPage(o,t),s=Object.values(r.bindings),l=new Set(s.filter(p=>n.has(p.toId)||n.has(p.fromId))),a=l.size,c=-1;for(;c!==0;)l.forEach(p=>{let u=p.fromId;for(let h of s)h.fromId===u&&l.add(h),h.toId===u&&l.add(h)}),c=l.size-a,a=l.size;return Array.from(l.values())}static normalizeText(o){return o.replace(W.fixNewLines,`
10
10
  `).split(`
11
11
  `).map(e=>e||" ").join(`
12
- `)}static assertShapeHasProperty(o,e){if(o[e]===void 0)throw new Error}static warn(o){_c&&console.warn(o)}static error(o){_c&&console.error(o)}static getSvgString(o,e=1){let t=o.cloneNode(!0);return o.setAttribute("width",+o.getAttribute("width")*e+""),o.setAttribute("height",+o.getAttribute("height")*e+""),new XMLSerializer().serializeToString(t).replaceAll("&#10; ","").replaceAll(/((\s|")[0-9]*\.[0-9]{2})([0-9]*)(\b|"|\))/g,"$1")}static getSvgAsDataUrl(o,e=1){let t=W.getSvgString(o,e);return`data:image/svg+xml;base64,${window.btoa(unescape(t))}`}static getImageForSvg(n){return z(this,arguments,function*(o,e="png",t={}){let{scale:r=2,quality:s=1}=t,l=W.getSvgString(o,r);if(!l)return;let a=yield new Promise(p=>{let u=new Image;u.crossOrigin="anonymous";let g=`data:image/svg+xml;base64,${window.btoa(unescape(encodeURIComponent(l)))}`;u.onload=()=>{let m=document.createElement("canvas"),f=m.getContext("2d"),v=u.width,b=u.height;m.width=v,m.height=b,f.drawImage(u,0,0,v,b),URL.revokeObjectURL(g),p(m)},u.onerror=()=>{console.warn("Could not convert that SVG to an image.")},u.src=g});return yield new Promise(p=>a.toBlob(u=>p(u),"image/"+e,s))})}},B=W;d(B,"copyStringToClipboard",o=>{try{navigator.clipboard&&navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"})})])}catch(e){let t=document.createElement("textarea");t.setAttribute("position","fixed"),t.setAttribute("top","0"),t.setAttribute("readonly","true"),t.setAttribute("contenteditable","true"),t.style.position="fixed",t.value=o,document.body.appendChild(t),t.focus(),t.select();try{let n=document.createRange();n.selectNodeContents(t);let r=window.getSelection();r&&(r.removeAllRanges(),r.addRange(n),t.setSelectionRange(0,t.value.length)),document.execCommand("copy")}catch(n){}finally{document.body.removeChild(t)}}}),d(B,"flattenShape",(o,e)=>{var t;return[e,...((t=e.children)!=null?t:[]).map(n=>W.getShape(o,n,o.appState.currentPageId)).sort((n,r)=>n.childIndex-r.childIndex).flatMap(n=>W.flattenShape(o,n))]}),d(B,"flattenPage",(o,e)=>Object.values(o.document.pages[e].shapes).sort((t,n)=>t.childIndex-n.childIndex).reduce((t,n)=>[...t,...W.flattenShape(o,n)],[])),d(B,"getTopChildIndex",(o,e)=>{let t=W.getShapes(o,e);return t.length===0?1:t.filter(n=>n.parentId===e).sort((n,r)=>r.childIndex-n.childIndex)[0].childIndex+1}),d(B,"fixNewLines",/\r?\n|\r/g);import{jsx as Yc,jsxs as $S}from"react/jsx-runtime";var Qn=at.memo(function({font:o,text:e,color:t,background:n,textGradient:r,offsetX:s=0,offsetY:l=0,scale:a=1,isEditing:c=!1,width:p,onBlur:u,onChange:h}){let g=at.useRef(null),m=at.useRef(!1),f=at.useCallback(k=>{h(B.normalizeText(k.currentTarget.value))},[h]),v=at.useCallback(k=>{if(k.key==="Escape"){k.preventDefault(),k.stopPropagation(),u==null||u();return}if(k.key==="Tab"&&e.length===0){k.preventDefault();return}if(!(k.key==="Meta"||k.metaKey))k.stopPropagation();else if(k.key==="z"&&k.metaKey){k.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1),k.stopPropagation(),k.preventDefault();return}(k.metaKey||k.ctrlKey)&&k.key==="="&&k.preventDefault(),k.key==="Tab"&&(k.preventDefault(),k.shiftKey?Fe.unindent(k.currentTarget):Fe.indent(k.currentTarget),h==null||h(B.normalizeText(k.currentTarget.value)))},[h]),b=at.useCallback(k=>{k.currentTarget.setSelectionRange(0,0),u==null||u()},[u]),T=at.useCallback(k=>{!c||!m.current||document.activeElement===k.currentTarget&&k.currentTarget.select()},[c]),y=at.useCallback(k=>{c&&k.stopPropagation()},[c]),x=at.useRef(c);at.useEffect(()=>{c?(x.current=!0,requestAnimationFrame(()=>{m.current=!0;let k=g.current;k&&(k.focus(),k.select())})):x.current&&(u==null||u(),x.current=!1)},[c,u]);let I=at.useRef(null);return at.useLayoutEffect(()=>{let k=I.current;if(!k)return;let R=Zn(e,o,p);k.style.transform=`scale(${a}, ${a}) translate(${s}px, ${l}px)`,k.style.width=p?`${p}px`:R[0]+1+"px",k.style.height=R[1]+1+"px"},[e,o,l,s,a,p]),Yc(zS,{children:$S(FS,{ref:I,hasText:!!e,isEditing:c,style:S({font:o,color:r&&!c?"transparent":t,backgroundColor:n&&n!=="transparent"?n:void 0,borderRadius:n&&n!=="transparent"?2:void 0,padding:n&&n!=="transparent"?"4px 6px":void 0},r&&!c?{background:Mo(r),WebkitBackgroundClip:"text",backgroundClip:"text"}:{}),children:[c?Yc(OS,{ref:g,style:{font:o,color:t},name:"text",tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,placeholder:"",spellCheck:"true",wrap:"off",dir:"auto",datatype:"wysiwyg",defaultValue:e,color:t,onFocus:T,onChange:f,onKeyDown:v,onBlur:b,onPointerDown:y,onContextMenu:rt,onCopy:rt,onPaste:rt,onCut:rt}):e,"\u200B"]})})}),zS=P("div",{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",userSelect:"none",variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}}}}),Xc={whiteSpace:"pre-wrap",overflowWrap:"break-word",letterSpacing:Ut},FS=P("div",S({position:"absolute",padding:"4px",zIndex:1,minHeight:1,minWidth:1,lineHeight:1,outline:0,fontWeight:"500",textAlign:"center",backfaceVisibility:"hidden",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",variants:{hasText:{false:{pointerEvents:"none"},true:{pointerEvents:"all"}},isEditing:{false:{userSelect:"none"},true:{background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text"}}}},Xc)),OS=P("textarea",w(S({position:"absolute",top:0,left:0,zIndex:1,width:"100%",height:"100%",border:"none",padding:"4px",resize:"none",textAlign:"inherit",minHeight:"inherit",minWidth:"inherit",lineHeight:"inherit",outline:0,fontWeight:"inherit",overflow:"hidden",backfaceVisibility:"hidden",display:"inline-block",pointerEvents:"all",background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text",fontSmooth:"always",WebkitFontSmoothing:"subpixel-antialiased",MozOsxFontSmoothing:"auto"},Xc),{"&:focus":{outline:"none",border:"none"}}));import Br from"telva-vec";function vn(i,o,{initialShape:e,transformOrigin:t,scaleX:n,scaleY:r}){if(i.rotation||e.isAspectRatioLocked){let s=Br.toFixed(Br.mul(e.size,Math.min(Math.abs(n),Math.abs(r)))),l=Br.toFixed([o.minX+(o.width-i.size[0])*(n<0?1-t[0]:t[0]),o.minY+(o.height-i.size[1])*(r<0?1-t[1]:t[1])]),a=n<0&&r>=0||r<0&&n>=0?e.rotation?-e.rotation:0:e.rotation;return{size:s,point:l,rotation:a}}else return{point:Br.toFixed([o.minX,o.minY]),size:Br.toFixed([o.width,o.height])}}import Zc from"telva-vec";function Tn(i,o){return{size:Zc.toFixed([o.width,o.height]),point:Zc.toFixed([o.minX,o.minY])}}import*as $e from"react";import{jsx as Oe,jsxs as Cn}from"react/jsx-runtime";function Mr(i,o,e){i=i/360,o=o/100,e=e/100;let t=0,n=0,r=0,s=Math.floor(i*6),l=i*6-s,a=e*(1-o),c=e*(1-l*o),p=e*(1-(1-l)*o);switch(s%6){case 0:t=e,n=p,r=a;break;case 1:t=c,n=e,r=a;break;case 2:t=a,n=e,r=p;break;case 3:t=a,n=c,r=e;break;case 4:t=p,n=a,r=e;break;case 5:t=e,n=a,r=c;break}return[Math.round(t*255),Math.round(n*255),Math.round(r*255)]}function Lr(i,o,e){i/=255,o/=255,e/=255;let t=Math.max(i,o,e),n=Math.min(i,o,e),r=t-n,s=0;r!==0&&(t===i?s=(o-e)/r%6:t===o?s=(e-i)/r+2:s=(i-o)/r+4,s=Math.round(s*60),s<0&&(s+=360));let l=t===0?0:Math.round(r/t*100),a=Math.round(t*100);return[s,l,a]}function Ko(i){let o=i.replace("#","").match(/.{2}/g);return o?[parseInt(o[0],16),parseInt(o[1],16),parseInt(o[2],16)]:[0,0,0]}function Ar(i,o,e){return"#"+[i,o,e].map(t=>t.toString(16).padStart(2,"0")).join("")}var tp="telva_color_history";function np(){try{return JSON.parse(localStorage.getItem(tp)||"[]").slice(0,16)}catch(i){return[]}}function _o(i){if(i==="transparent")return;let o=np().filter(e=>e!==i);o.unshift(i),localStorage.setItem(tp,JSON.stringify(o.slice(0,16)))}var Ra='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAIElEQVQYV2P8////fwYkwMjIyIjCZmBgYEBlMDIiiwEAGiYFA/wQA1AAAAAASUVORK5CYII=")';var Yi=$e.memo(function({color:o,opacity:e=1,onChange:t,showTransparent:n=!0,showOpacity:r=!0}){let s=o==="transparent",l=s?[255,255,255]:Ko(o),[a,c]=$e.useState(()=>Lr(...l));$e.useEffect(()=>{if(!s){let y=Ko(o),x=Lr(...y);c(x)}},[o]);let p=$e.useRef(null),u=$e.useRef(null);$e.useEffect(()=>{let y=p.current;if(!y)return;let x=y.getContext("2d"),I=y.width,k=y.height,[R,C,E]=Mr(a[0],100,100);x.fillStyle=`rgb(${R},${C},${E})`,x.fillRect(0,0,I,k);let M=x.createLinearGradient(0,0,I,0);M.addColorStop(0,"rgba(255,255,255,1)"),M.addColorStop(1,"rgba(255,255,255,0)"),x.fillStyle=M,x.fillRect(0,0,I,k);let L=x.createLinearGradient(0,0,0,k);L.addColorStop(0,"rgba(0,0,0,0)"),L.addColorStop(1,"rgba(0,0,0,1)"),x.fillStyle=L,x.fillRect(0,0,I,k)},[a[0]]),$e.useEffect(()=>{let y=u.current;if(!y)return;let x=y.getContext("2d"),I=y.width,k=x.createLinearGradient(0,0,I,0);for(let R=0;R<=6;R++){let[C,E,M]=Mr(R/6*360,100,100);k.addColorStop(R/6,`rgb(${C},${E},${M})`)}x.fillStyle=k,x.fillRect(0,0,I,y.height)},[]);let h=$e.useCallback((y,x,I,k)=>{let[R,C,E]=Mr(y,x,I),M=Ar(R,C,E);_o(M),t(M,k)},[t]),g=$e.useCallback(y=>{y.preventDefault(),y.stopPropagation();let I=p.current.getBoundingClientRect(),k=E=>{let M=Math.max(0,Math.min(100,(E.clientX-I.left)/I.width*100)),L=Math.max(0,Math.min(100,(1-(E.clientY-I.top)/I.height)*100));c([a[0],M,L]),h(a[0],M,L,e)};k(y);let R=E=>k(E),C=()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",R),document.addEventListener("pointerup",C)},[a,e,h]),m=$e.useCallback(y=>{y.preventDefault(),y.stopPropagation();let I=u.current.getBoundingClientRect(),k=E=>{let M=Math.max(0,Math.min(360,(E.clientX-I.left)/I.width*360));c([M,a[1],a[2]]),h(M,a[1],a[2],e)};k(y);let R=E=>k(E),C=()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",R),document.addEventListener("pointerup",C)},[a,e,h]),f=$e.useRef(null),v=$e.useCallback(y=>{y.preventDefault(),y.stopPropagation();let I=f.current.getBoundingClientRect(),k=E=>{let M=Math.max(0,Math.min(1,(E.clientX-I.left)/I.width));s?t("transparent",M):h(a[0],a[1],a[2],M)};k(y);let R=E=>k(E),C=()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",R),document.addEventListener("pointerup",C)},[a,s,h,t]),b=s?"transparent":Ar(...Mr(a[0],a[1],a[2])),T=s?[255,255,255]:Mr(a[0],a[1],a[2]);return Cn(GS,{onClick:y=>y.stopPropagation(),onPointerDown:y=>y.stopPropagation(),children:[Cn(jS,{children:[Oe("canvas",{ref:p,width:200,height:130,onPointerDown:g,style:{width:"100%",height:"100%",cursor:"crosshair",borderRadius:4}}),!s&&Oe(WS,{style:{left:`${a[1]}%`,top:`${100-a[2]}%`,borderColor:a[2]>50?"#000":"#fff"}})]}),Cn(qc,{children:[Oe("canvas",{ref:u,width:200,height:12,onPointerDown:m,style:{width:"100%",height:"100%",cursor:"pointer",borderRadius:6}}),!s&&Oe(Jc,{style:{left:`${a[0]/360*100}%`}})]}),r&&Cn(qc,{children:[Oe(NS,{ref:f,onPointerDown:v,style:{background:`linear-gradient(to right, transparent, ${b==="transparent"?"#fff":b})`,cursor:"pointer"}}),Oe(Jc,{style:{left:`${e*100}%`}})]}),Cn(US,{children:[Oe(_S,{value:s?"":b.replace("#",""),placeholder:"hex",maxLength:6,onChange:y=>{let x=y.target.value.replace(/[^0-9a-fA-F]/g,"").slice(0,6);if(x.length===6){let I=Ko("#"+x);c(Lr(...I)),t("#"+x,e),_o("#"+x)}},onKeyDown:y=>y.stopPropagation()}),[0,1,2].map(y=>Oe(Qc,{value:T[y],type:"number",min:0,max:255,onChange:x=>{let I=Math.max(0,Math.min(255,Number(x.target.value))),k=[...T];k[y]=I,c(Lr(...k));let R=Ar(...k);t(R,e),_o(R)},onKeyDown:x=>x.stopPropagation()},y)),r&&Oe(Qc,{value:Math.round(e*100),type:"number",min:0,max:100,onChange:y=>{let x=Math.max(0,Math.min(100,Number(y.target.value)))/100;s?t("transparent",x):h(a[0],a[1],a[2],x)},onKeyDown:y=>y.stopPropagation(),style:{width:32}})]}),Cn(KS,{children:[Oe("span",{style:{flex:2},children:"Hex"}),Oe("span",{children:"R"}),Oe("span",{children:"G"}),Oe("span",{children:"B"}),r&&Oe("span",{children:"A"})]}),Cn(YS,{children:[n&&Oe(ep,{title:"Transparent",$active:s,style:{backgroundImage:Ra,backgroundSize:"6px 6px"},onClick:()=>t("transparent",e)}),np().map(y=>Oe(ep,{style:{backgroundColor:y},$active:b===y,onClick:()=>{let x=Ko(y);c(Lr(...x)),t(y,e)}},y))]})]})}),Yo=$e.memo(function({color:o,opacity:e=1,onChange:t,showTransparent:n=!0,showOpacity:r=!0,label:s}){let[l,a]=$e.useState(!1),c=$e.useRef(null),p=o==="transparent";return $e.useEffect(()=>{let h=g=>{c.current&&!c.current.contains(g.target)&&a(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),Cn(XS,{ref:c,children:[Cn(ZS,{children:[s&&Oe(qS,{children:s}),Oe(JS,{onClick:()=>a(!l),style:{backgroundColor:p?"transparent":o,backgroundImage:p?Ra:"none",backgroundSize:"6px 6px"}}),Oe(QS,{value:p?"":(p?"transparent":o).replace("#","").toUpperCase(),placeholder:"\u2014",maxLength:6,onChange:h=>{let g=h.target.value;if(g.toLowerCase()==="transparent"){t("transparent",e);return}let m=g.replace(/[^0-9a-fA-F#]/g,"").slice(0,7);if(/^#[0-9a-fA-F]{6}$/i.test(m)||/^[0-9a-fA-F]{6}$/i.test(m)){let f=m.startsWith("#")?m:"#"+m;t(f,e),_o(f)}},onKeyDown:h=>h.stopPropagation()}),Cn(ey,{children:[Math.round(e*100),"%"]})]}),l&&Oe(ty,{children:Oe(Yi,{color:o,opacity:e,onChange:(h,g)=>t(h,g),showTransparent:n,showOpacity:r})})]})}),GS=P("div",{background:"$panel",border:"1px solid $separator",borderRadius:"8px",padding:"8px",display:"flex",flexDirection:"column",gap:"6px",boxShadow:"0 8px 32px rgba(0,0,0,0.45)",minWidth:210}),jS=P("div",{position:"relative",width:"100%",height:130,borderRadius:4,overflow:"hidden"}),WS=P("div",{position:"absolute",width:10,height:10,borderRadius:"50%",border:"2px solid white",transform:"translate(-50%, -50%)",pointerEvents:"none",boxShadow:"0 0 2px rgba(0,0,0,0.5)"}),qc=P("div",{position:"relative",width:"100%",height:12,borderRadius:6,overflow:"visible"}),Jc=P("div",{position:"absolute",top:"50%",width:14,height:14,borderRadius:"50%",background:"#fff",border:"2px solid rgba(0,0,0,0.2)",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transform:"translate(-50%, -50%)",pointerEvents:"none"}),NS=P("div",{width:"100%",height:"100%",borderRadius:6,backgroundImage:Ra,backgroundSize:"8px 8px",position:"relative"}),US=P("div",{display:"flex",gap:3,alignItems:"center"}),KS=P("div",{display:"flex",gap:3,fontSize:"7px",color:"rgba(255,255,255,0.35)",padding:"0 1px","& > span":{flex:1,textAlign:"center"}}),_S=P("input",{flex:2,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:4,color:"$text",fontSize:"9px",padding:"3px 5px",fontFamily:"$mono",outline:"none",textTransform:"uppercase","&:focus":{borderColor:"$accent"},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),Qc=P("input",{flex:1,width:28,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:4,color:"$text",fontSize:"9px",padding:"3px 4px",fontFamily:"$mono",outline:"none",textAlign:"center","&:focus":{borderColor:"$accent"},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),YS=P("div",{display:"flex",flexWrap:"wrap",gap:3,paddingTop:2}),ep=P("div",{width:18,height:18,borderRadius:3,cursor:"pointer",border:"1px solid $separator",transition:"transform 0.08s, box-shadow 0.08s","&:hover":{transform:"scale(1.15)"},variants:{$active:{true:{boxShadow:"0 0 0 2px $colors$accent",transform:"scale(1.1)"}}}}),XS=P("div",{position:"relative",width:"100%"}),ZS=P("div",{display:"flex",alignItems:"center",gap:4}),qS=P("label",{fontSize:"9px",color:"$textSecondary",fontWeight:500,width:36,flexShrink:0,textAlign:"right"}),JS=P("div",{width:20,height:20,borderRadius:"$0",border:"1px solid $separator",flexShrink:0,cursor:"pointer",transition:"box-shadow 0.08s","&:hover":{boxShadow:"0 0 0 1px $colors$accent"}}),QS=P("input",{flex:1,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:"$1",color:"$text",fontSize:"9px",padding:"3px 5px",fontFamily:"$mono",outline:"none",textTransform:"uppercase","&:focus":{borderColor:"$accent"}}),ey=P("span",{fontSize:"9px",color:"$textSecondary",fontFamily:"$mono",width:32,textAlign:"initial",flexShrink:0}),ty=P("div",{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,marginTop:4,boxShadow:"0 8px 32px rgba(0,0,0,0.5)",borderRadius:"$2",overflow:"visible"});import*as Lt from"react";import{jsx as Da,jsxs as op}from"react/jsx-runtime";var Ue=Lt.memo(function({value:o,onChange:e,label:t,min:n=-1/0,max:r=1/0,step:s=1,suffix:l,style:a,labelWidth:c=18}){let[p,u]=Lt.useState(!1),[h,g]=Lt.useState(String(o)),m=Lt.useRef(null),f=Lt.useRef({active:!1,startX:0,startVal:0});Lt.useEffect(()=>{p||g(String(Math.round(o*100)/100))},[o,p]);let v=x=>Math.min(r,Math.max(n,x)),b=Lt.useCallback(x=>{x.preventDefault(),x.stopPropagation(),f.current={active:!0,startX:x.clientX,startVal:o};let I=x.currentTarget;I.setPointerCapture(x.pointerId);let k=C=>{if(!f.current.active)return;let E=C.clientX-f.current.startX,M=C.shiftKey?10:C.altKey?.1:1,L=Math.round(E*M*s);e(v(f.current.startVal+L))},R=()=>{f.current.active=!1,I.releasePointerCapture(x.pointerId),document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",R)};document.addEventListener("pointermove",k),document.addEventListener("pointerup",R)},[o,e,n,r,s]),T=Lt.useCallback(x=>{x.preventDefault(),x.stopPropagation();let I=x.clientX,k=o,R=!1;f.current={active:!0,startX:I,startVal:k};let C=M=>{let L=M.clientX-I;if(Math.abs(L)>2&&(R=!0),!R)return;let A=M.shiftKey?10:M.altKey?.1:1,K=Math.round(L*A*s);e(v(k+K))},E=()=>{f.current.active=!1,document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",E),R||(u(!0),setTimeout(()=>{var M;return(M=m.current)==null?void 0:M.select()},0))};document.addEventListener("pointermove",C),document.addEventListener("pointerup",E)},[o,e,n,r,s]),y=Lt.useCallback(()=>{u(!1);let x=parseFloat(h);isNaN(x)||e(v(x))},[h,e,n,r]);return op(ny,{style:a,children:[t&&Da(oy,{style:{width:c,cursor:"ew-resize"},onPointerDown:b,children:t}),p?Da(ry,{ref:m,value:h,onChange:x=>g(x.target.value),onBlur:y,onKeyDown:x=>{x.key==="Enter"&&y(),x.key==="Escape"&&u(!1),x.stopPropagation()},autoFocus:!0}):op(iy,{onPointerDown:T,children:[Math.round(o*100)/100,l&&Da(sy,{children:l})]})]})}),ny=P("div",{display:"flex",alignItems:"center",gap:"4px",minWidth:0}),oy=P("label",{fontSize:"9px",color:"$textSecondary",fontWeight:500,flexShrink:0,textAlign:"right",userSelect:"none",cursor:"ew-resize","&:active":{cursor:"ew-resize"}}),ry=P("input",{width:"100%",background:"$inputBg",border:"1px solid $accent",borderRadius:"$1",color:"$text",fontSize:"10px",padding:"3px 5px",fontFamily:"$mono",outline:"none","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),iy=P("div",{flex:1,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:"$1",color:"$text",fontSize:"10px",padding:"3px 5px",fontFamily:"$mono",cursor:"ew-resize",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",userSelect:"none",transition:"border-color 0.1s","&:hover":{borderColor:"$accent"}}),sy=P("span",{fontSize:"8px",color:"$textSecondary",marginLeft:"1px"});import*as Qe from"react";import{jsx as Q,jsxs as Me}from"react/jsx-runtime";function Co(i){let e=[...i.stops].sort((t,n)=>t.position-n.position).map(t=>{let n=t.color,r=Math.round(t.opacity*255).toString(16).padStart(2,"0");return`${n}${r} ${t.position}%`}).join(", ");switch(i.type){case"linear":return`linear-gradient(${i.angle}deg, ${e})`;case"radial":return`radial-gradient(circle at ${i.centerX}% ${i.centerY}%, ${e})`;case"conic":return`conic-gradient(from ${i.angle}deg at ${i.centerX}% ${i.centerY}%, ${e})`;case"diamond":return`conic-gradient(from ${i.angle}deg, ${e})`}}var ay={type:"linear",stops:[{color:"#0D99FF",position:0,opacity:1},{color:"#FF6B00",position:100,opacity:1}],angle:90,centerX:50,centerY:50},Ba="telva_gradient_presets";function Ma(){try{return JSON.parse(localStorage.getItem(Ba)||"[]")}catch(i){return[]}}function ly(i){let o=Ma();o.unshift(i),localStorage.setItem(Ba,JSON.stringify(o.slice(0,12)))}function dy(i){let o=Ma();o.splice(i,1),localStorage.setItem(Ba,JSON.stringify(o))}function cy(){return Me("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[Q("defs",{children:Me("linearGradient",{id:"lg",x1:"0",y1:"0",x2:"1",y2:"1",children:[Q("stop",{offset:"0%",stopColor:"#0D99FF"}),Q("stop",{offset:"100%",stopColor:"#FF6B00"})]})}),Q("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",fill:"url(#lg)"})]})}function py(){return Me("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[Q("defs",{children:Me("radialGradient",{id:"rg",children:[Q("stop",{offset:"0%",stopColor:"#0D99FF"}),Q("stop",{offset:"100%",stopColor:"#FF6B00"})]})}),Q("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",fill:"url(#rg)"})]})}function uy(){return Me("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[Q("circle",{cx:"7",cy:"7",r:"6",fill:"none",stroke:"#0D99FF",strokeWidth:"1.5"}),Q("line",{x1:"7",y1:"7",x2:"7",y2:"1",stroke:"#FF6B00",strokeWidth:"1.5"})]})}function hy(){return Me("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[Q("polygon",{points:"7,1 13,7 7,13 1,7",fill:"none",stroke:"#0D99FF",strokeWidth:"1.2"}),Q("circle",{cx:"7",cy:"7",r:"2",fill:"#FF6B00"})]})}var my={linear:Q(cy,{}),radial:Q(py,{}),conic:Q(uy,{}),diamond:Q(hy,{})},Zi=Qe.memo(function({value:o,onChange:e}){let[t,n]=Qe.useState(o||ay),[r,s]=Qe.useState(0),[l,a]=Qe.useState(!1),c=Qe.useRef(null),p=Qe.useRef(null);Qe.useEffect(()=>{o&&n(o)},[o]),Qe.useEffect(()=>{let y=I=>{(I.key==="Delete"||I.key==="Backspace")&&t.stops.length>2&&(I.preventDefault(),m(r))},x=p.current;if(x)return x.addEventListener("keydown",y),()=>x.removeEventListener("keydown",y)},[t.stops.length,r]);let u=Qe.useCallback(y=>{n(x=>{let I=S(S({},x),y);return e(I,Co(I)),I})},[e]),h=Qe.useCallback((y,x)=>{n(I=>{let k=I.stops.map((C,E)=>E===y?S(S({},C),x):C),R=w(S({},I),{stops:k});return e(R,Co(R)),R})},[e]),g=Qe.useCallback(y=>{if(!c.current||y.target.dataset.thumb)return;let x=c.current.getBoundingClientRect(),I=Math.round((y.clientX-x.left)/x.width*100),k={color:"#888888",position:I,opacity:1};n(R=>{let C=[...R.stops,k],E=w(S({},R),{stops:C});return e(E,Co(E)),s(C.length-1),E})},[e]),m=Qe.useCallback(y=>{t.stops.length<=2||n(x=>{let I=x.stops.filter((R,C)=>C!==y),k=w(S({},x),{stops:I});return e(k,Co(k)),s(Math.min(y,I.length-1)),k})},[t.stops.length,e]),f=Qe.useCallback((y,x)=>{y.preventDefault(),y.stopPropagation(),s(x);let I=c.current.getBoundingClientRect(),k=C=>{let E=Math.max(0,Math.min(100,Math.round((C.clientX-I.left)/I.width*100)));h(x,{position:E})},R=()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",R)};document.addEventListener("pointermove",k),document.addEventListener("pointerup",R)},[h]),v=Co(t),b=t.stops[r],T=Ma();return Me(gy,{ref:p,tabIndex:-1,onClick:y=>y.stopPropagation(),onPointerDown:y=>y.stopPropagation(),children:[Q(fy,{children:["linear","radial","conic","diamond"].map(y=>Me(Sy,{$active:t.type===y,onClick:()=>u({type:y}),title:y.charAt(0).toUpperCase()+y.slice(1),children:[my[y],Q(yy,{children:y.charAt(0).toUpperCase()+y.slice(1)})]},y))}),Q(by,{style:{background:v}}),Me(vy,{children:[Me(Ty,{children:["Stops (",t.stops.length,")"]}),Me(xy,{ref:c,onClick:g,children:[Q(ky,{style:{background:v}}),t.stops.map((y,x)=>Q(Cy,{"data-thumb":"true",$selected:x===r,style:{left:`${y.position}%`,backgroundColor:y.color},onPointerDown:I=>f(I,x),onDoubleClick:()=>m(x)},x))]}),Q(rp,{children:"Click to add \xB7 Double-click to remove \xB7 Drag to move"})]}),b&&Me(wy,{children:[Me(Iy,{children:["Stop ",r+1]}),Q(Xi,{type:"number",min:0,max:100,value:b.position,onChange:y=>h(r,{position:Math.max(0,Math.min(100,Number(y.target.value)))}),onKeyDown:y=>y.stopPropagation()}),Q(ro,{children:"%"})]}),b&&Q(Yi,{color:b.color,opacity:b.opacity,onChange:(y,x)=>{h(r,{color:y,opacity:x}),y!=="transparent"&&_o(y)},showTransparent:!1}),Me(Py,{children:[Q(Ry,{children:"Geometry"}),(t.type==="linear"||t.type==="conic")&&Me(ip,{children:[Q(ro,{children:"Angle"}),Q(Dy,{style:{transform:`rotate(${t.angle}deg)`},onPointerDown:y=>{y.preventDefault(),y.stopPropagation();let x=y.currentTarget.getBoundingClientRect(),I=x.left+x.width/2,k=x.top+x.height/2,R=E=>{let M=Math.round(Math.atan2(E.clientY-k,E.clientX-I)*(180/Math.PI)+90);u({angle:(M%360+360)%360})},C=()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",R),document.addEventListener("pointerup",C)},children:Q(Ey,{})}),Q(Xi,{type:"number",value:t.angle,onChange:y=>u({angle:(Number(y.target.value)%360+360)%360}),onKeyDown:y=>y.stopPropagation()}),Q(ro,{children:"\xB0"})]}),(t.type==="radial"||t.type==="conic"||t.type==="diamond")&&Me(ip,{children:[Q(ro,{children:"Center"}),Q(ro,{children:"X"}),Q(Xi,{type:"number",min:0,max:100,value:t.centerX,onChange:y=>u({centerX:Number(y.target.value)}),onKeyDown:y=>y.stopPropagation()}),Q(ro,{children:"%"}),Q(ro,{style:{marginLeft:4},children:"Y"}),Q(Xi,{type:"number",min:0,max:100,value:t.centerY,onChange:y=>u({centerY:Number(y.target.value)}),onKeyDown:y=>y.stopPropagation()}),Q(ro,{children:"%"})]})]}),Me(By,{children:[Me(Ea,{onClick:()=>{let y=[...t.stops].map(x=>w(S({},x),{position:100-x.position}));u({stops:y})},title:"Reverse gradient",children:[Q("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:Q("path",{d:"M1 6h10M3 4l-2 2 2 2M9 4l2 2-2 2",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})}),"Reverse"]}),Me(Ea,{onClick:()=>m(r),disabled:t.stops.length<=2,title:"Remove selected stop",children:[Q("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:Q("path",{d:"M3 3l6 6M9 3l-6 6",stroke:"currentColor",strokeWidth:"1.2"})}),"Remove"]}),Me(Ea,{onClick:()=>{ly(t),a(!0)},title:"Save as preset",children:[Me("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:[Q("path",{d:"M2 2h8v8H2z",fill:"none",stroke:"currentColor",strokeWidth:"1"}),Q("path",{d:"M4 2v3h4V2",fill:"none",stroke:"currentColor",strokeWidth:"0.8"}),Q("rect",{x:"3",y:"7",width:"6",height:"1",fill:"currentColor",opacity:"0.5"})]}),"Save"]})]}),(l||T.length>0)&&Me(My,{children:[Me(Ly,{onClick:()=>a(!l),children:["Presets (",T.length,")",Q(Ay,{children:l?"\u2212":"+"})]}),l&&Me(Vy,{children:[T.map((y,x)=>Q(Hy,{style:{background:Co(y)},onClick:()=>{n(y),e(y,Co(y)),s(0)},onContextMenu:I=>{I.preventDefault(),dy(x),a(!0)},title:"Click to apply \xB7 Right-click to remove"},x)),T.length===0&&Q(rp,{children:"No presets saved yet"})]})]})]})}),gy=P("div",{background:"$panel",border:"1px solid $separator",borderRadius:"8px",padding:"8px",display:"flex",flexDirection:"column",gap:"8px",boxShadow:"0 8px 32px rgba(0,0,0,0.45)",outline:"none"}),fy=P("div",{display:"flex",gap:2,background:"$inputBg",borderRadius:6,padding:2}),Sy=P("button",{all:"unset",flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:3,fontSize:"8px",fontWeight:600,textAlign:"center",padding:"5px 0",borderRadius:4,color:"$textSecondary",cursor:"pointer",transition:"all 0.12s","&:hover":{color:"$text"},variants:{$active:{true:{background:"$accent",color:"#fff"}}}}),yy=P("span",{fontSize:"7px",fontWeight:500,letterSpacing:"0.02em"}),by=P("div",{width:"100%",height:40,borderRadius:6,border:"1px solid $separator"}),vy=P("div",{display:"flex",flexDirection:"column",gap:4}),Ty=P("span",{fontSize:"8px",color:"$textSecondary",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"}),xy=P("div",{position:"relative",height:24,borderRadius:6,cursor:"crosshair",overflow:"visible"}),ky=P("div",{width:"100%",height:"100%",borderRadius:6,border:"1px solid $separator"}),Cy=P("div",{position:"absolute",top:"50%",width:14,height:14,borderRadius:"50%",border:"2px solid #fff",transform:"translate(-50%, -50%)",cursor:"ew-resize",boxShadow:"0 1px 3px rgba(0,0,0,0.4)",transition:"box-shadow 0.08s",zIndex:2,variants:{$selected:{true:{boxShadow:"0 0 0 2px $colors$accent, 0 1px 4px rgba(0,0,0,0.5)",zIndex:3,width:16,height:16}}}}),rp=P("span",{fontSize:"7px",color:"$textSecondary",fontStyle:"italic",opacity:.6}),wy=P("div",{display:"flex",alignItems:"center",gap:4}),Iy=P("span",{fontSize:"8px",color:"$textSecondary",fontWeight:500,flex:1}),Py=P("div",{display:"flex",flexDirection:"column",gap:6,borderTop:"1px solid $separator",paddingTop:8}),Ry=P("span",{fontSize:"8px",color:"$textSecondary",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"}),ip=P("div",{display:"flex",alignItems:"center",gap:4}),ro=P("span",{fontSize:"8px",color:"$textSecondary",fontWeight:500}),Xi=P("input",{width:40,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:4,color:"$text",fontSize:"9px",padding:"3px 4px",fontFamily:"$mono",textAlign:"center",outline:"none","&:focus":{borderColor:"$accent"},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),Dy=P("div",{width:28,height:28,borderRadius:"50%",border:"1px solid $inputBorder",background:"$inputBg",cursor:"pointer",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}),Ey=P("div",{width:2,height:"40%",background:"$accent",borderRadius:1,position:"absolute",top:3,left:"50%",transform:"translateX(-50%)"}),By=P("div",{display:"flex",gap:3,borderTop:"1px solid $separator",paddingTop:8}),Ea=P("button",{all:"unset",flex:1,fontSize:"8px",fontWeight:500,textAlign:"center",padding:"5px 0",borderRadius:4,color:"$textSecondary",border:"1px solid $separator",cursor:"pointer",transition:"all 0.1s",display:"flex",alignItems:"center",justifyContent:"center",gap:3,"&:hover":{background:"$hover",color:"$text"},"&:disabled":{opacity:.3,cursor:"default"}}),My=P("div",{borderTop:"1px solid $separator",paddingTop:6}),Ly=P("div",{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"8px",color:"$textSecondary",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",cursor:"pointer","&:hover":{color:"$text"}}),Ay=P("span",{fontSize:"10px",color:"$textSecondary"}),Vy=P("div",{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:4,marginTop:6}),Hy=P("div",{height:24,borderRadius:4,border:"1px solid $separator",cursor:"pointer",transition:"transform 0.08s, box-shadow 0.08s","&:hover":{transform:"scale(1.05)",boxShadow:"0 0 0 1px $colors$accent"}});import{Fragment as Fr,jsx as D,jsxs as O}from"react/jsx-runtime";function cp(i,o){let[e,t,n]=Ko(i);return`rgba(${e},${t},${n},${o.toFixed(3)})`}function pp(i,o){if(!i||i==="transparent")return{hex:"transparent",opacity:1};let e=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return e?{hex:Ar(parseInt(e[1]),parseInt(e[2]),parseInt(e[3])),opacity:e[4]!==void 0?parseFloat(e[4]):1}:i.startsWith("#")?{hex:i.slice(0,7),opacity:1}:{hex:o,opacity:1}}var Gy=i=>{let o=i.document.pages[i.appState.currentPageId],t=i.document.pageStates[i.appState.currentPageId].selectedIds.map(n=>o.shapes[n]).filter(Boolean);return{shapes:t,key:JSON.stringify(t)}},jy=i=>i.settings.isDarkMode?"dark":"light",Ha=Ie.memo(function(){let o=N(),{shapes:e}=o.useStore(Gy),t=o.useStore(jy);if(e.length===0)return D(hp,{children:O(Nn,{children:[D(lo,{children:"Design"}),D(rb,{children:"Select an element to edit"})]})});let n=e[0],r=e.length>1,s=n.type==="text"||n.type==="sticky"||"label"in n,l=n.type==="arrow",a=n.type==="rectangle",c=n.type==="pen";return O(hp,{children:[D(Wy,{shape:n,multi:r,count:e.length}),D(Zt,{}),!r&&c&&O(Fr,{children:[D(nb,{shape:n,app:o}),D(Zt,{})]}),!r&&D(Ny,{shape:n,app:o}),r&&D(tb,{app:o}),D(Zt,{}),!r&&D(Uy,{shape:n,app:o}),!r&&D(Zt,{}),D(Ky,{shape:n,app:o,isRect:a}),D(Zt,{}),D(_y,{style:n.style,theme:t,app:o}),D(Zt,{}),D(wo,{title:"Stroke",children:D(Yy,{style:n.style,theme:t,app:o})}),D(Zt,{}),D(wo,{title:"Gradient",children:D(Xy,{shape:n,app:o})}),D(Zt,{}),s&&O(Fr,{children:[D(wo,{title:"Text Style",defaultOpen:!0,children:D(Zy,{style:n.style,app:o,theme:t})}),D(Zt,{})]}),D(wo,{title:"Effects",children:D(Jy,{shape:n,app:o})}),D(Zt,{}),l&&!r&&O(Fr,{children:[D(wo,{title:"Arrow",defaultOpen:!0,children:D(Qy,{shape:n,app:o})}),D(Zt,{})]}),s&&O(Fr,{children:[D(wo,{title:"Typography",defaultOpen:!0,children:D(eb,{style:n.style,app:o})}),D(Zt,{})]}),D(wo,{title:"Export",children:D(ob,{shape:n,app:o})}),D("div",{style:{height:40}})]})});function Wy({shape:i,multi:o,count:e}){let t=o?e+" Selected":i.type.charAt(0).toUpperCase()+i.type.slice(1);return D(Nn,{style:{padding:"10px 12px 6px"},children:O("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[D(lo,{style:{marginBottom:0,fontSize:"11px"},children:t}),D("div",{style:{display:"flex",gap:4},children:["\u229E","\u25D1","\u229F","\u22A0"].map((n,r)=>D(fp,{title:["Clip Mask","Component","Boolean","Flatten"][r],children:n},r))})]})})}function Ny({shape:i,app:o}){let e=i.point||[0,0],t=Math.round((i.rotation||0)*(180/Math.PI)),n=Ie.useCallback((r,s)=>{let l={id:i.id};switch(r){case"x":l.point=[s,e[1]];break;case"y":l.point=[e[0],s];break;case"r":l.rotation=s*Math.PI/180;break}o.updateShapes(l)},[i.id,e,o]);return O(Nn,{children:[D(lo,{children:"Position"}),D(Qi,{children:[{fn:()=>o.align("left"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"2",x2:"2",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"7",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"4",y:"8",width:"5",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Left"},{fn:()=>o.align("centerHorizontal"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"7",y1:"1",x2:"7",y2:"13",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("rect",{x:"3",y:"4",width:"8",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"4",y:"8",width:"6",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Center H"},{fn:()=>o.align("right"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"12",y1:"2",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"3",y:"4",width:"7",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"5",y:"8",width:"5",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Right"},{fn:()=>o.align("top"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"2",x2:"12",y2:"2",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"2.5",height:"7",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"4",width:"2.5",height:"5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Top"},{fn:()=>o.align("centerVertical"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("rect",{x:"4",y:"2",width:"2.5",height:"10",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"3",width:"2.5",height:"8",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Center V"},{fn:()=>o.align("bottom"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"3",width:"2.5",height:"7",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"5",width:"2.5",height:"5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Bottom"}].map(({fn:r,icon:s,t:l},a)=>D(et,{onClick:r,title:l,children:s},a))}),O(gp,{style:{marginTop:8},children:[D(Ue,{label:"X",value:Math.round(e[0]),onChange:r=>n("x",r)}),D(Ue,{label:"Y",value:Math.round(e[1]),onChange:r=>n("y",r)})]}),O("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:4},children:[D(Ue,{label:"R",value:t,onChange:r=>n("r",r),suffix:"\xB0",style:{flex:1}}),O("div",{style:{display:"flex",gap:2},children:[D(et,{onClick:()=>o.flipHorizontal(),title:"Flip Horizontal",children:D("svg",{width:"20",height:"20",viewBox:"0 0 14 14",children:D("path",{d:"M7 2v10M3 5l-1 4h4zM11 5l1 4h-4z",stroke:"currentColor",strokeWidth:"1",fill:"none"})})}),D(et,{onClick:()=>o.flipVertical(),title:"Flip Vertical",children:D("svg",{width:"20",height:"20",viewBox:"0 0 14 14",children:D("path",{d:"M2 7h10M5 3l4-1v4zM5 11l4 1v-4z",stroke:"currentColor",strokeWidth:"1",fill:"none"})})})]})]})]})}function Uy({shape:i,app:o}){let e="size"in i?i.size:"radius"in i?[i.radius[0]*2,i.radius[1]*2]:[0,0],[t,n]=Ie.useState(!1),r=Ie.useCallback((s,l)=>{let a={id:i.id};if("size"in i)if(s==="w"){let c=t?l/e[0]*e[1]:e[1];a.size=[l,c]}else{let c=t?l/e[1]*e[0]:e[0];a.size=[c,l]}else"radius"in i&&(s==="w"?a.radius=[l/2,t?l/2/e[0]*e[1]/2:i.radius[1]]:a.radius=[t?l/2/e[1]*e[0]/2:i.radius[0],l/2]);o.updateShapes(a)},[i,e,t,o]);return O(Nn,{children:[D(lo,{children:"Layout"}),O(sb,{children:[D(Ue,{label:"W",value:Math.round(e[0]),onChange:s=>r("w",s),min:1}),D(Ue,{label:"H",value:Math.round(e[1]),onChange:s=>r("h",s),min:1})]})]})}function Ky({shape:i,app:o,isRect:e}){var r,s;let t=Math.round(((r=i.style.opacity)!=null?r:1)*100),n=(s=i.style.borderRadius)!=null?s:0;return O(Nn,{children:[D(lo,{children:"Appearance"}),D(Ue,{label:"Opacity",value:t,onChange:l=>o.style({opacity:l/100}),min:0,max:100,suffix:"%",labelWidth:36}),e&&D("div",{style:{marginTop:4},children:D(Ue,{label:"Corner",value:n,onChange:l=>o.style({borderRadius:l}),min:0,suffix:"px",labelWidth:36})}),O(so,{style:{marginTop:4},children:[D(ao,{style:{width:36},children:"Dash"}),D(es,{children:[{val:"draw",label:"~"},{val:"solid",label:"\u2014"},{val:"dashed",label:"- -"},{val:"dotted",label:"\xB7\xB7\xB7"}].map(({val:l,label:a})=>D(et,{isActive:i.style.dash===l,onClick:()=>o.style({dash:l}),children:a},l))})]})]})}function _y({style:i,theme:o,app:e}){var r,s;let t=i.isFilled?i.fillHex||((r=yo[o])==null?void 0:r[i.color])||yo.light[i.color]:"transparent",n=Ie.useCallback((l,a)=>{l==="transparent"?e.style({isFilled:!1}):e.style({fillHex:l,isFilled:!0,opacity:a})},[e]);return O(Nn,{children:[D(lo,{children:"Fill"}),D(Yo,{color:t,opacity:(s=i.opacity)!=null?s:1,onChange:n,showTransparent:!0,showOpacity:!0,label:"Color"})]})}function Yy({style:i,theme:o,app:e}){var r,s;let t=i.strokeHex||((r=zn[o])==null?void 0:r[i.color])||zn.light[i.color],n=(s=i.strokeWidthOverride)!=null?s:{small:2,medium:3.5,large:5}[i.size]||2;return O("div",{children:[D(Yo,{color:t,opacity:1,onChange:l=>e.style({strokeHex:l}),showTransparent:!0,showOpacity:!1}),D("div",{style:{marginTop:6},children:D(Ue,{label:"Width",value:n,onChange:l=>e.style({strokeWidthOverride:l}),min:0,step:.01,suffix:"px",max:10,labelWidth:36})})]})}function Xy({shape:i,app:o}){let[e,t]=Ie.useState(!!i.style.gradient),n=i.style.gradient,r=Ie.useCallback(()=>{if(e)o.style({gradient:void 0}),t(!1);else{let s={type:"linear",stops:[{color:"#0D99FF",position:0,opacity:1},{color:"#FF6B00",position:100,opacity:1}],angle:90,centerX:50,centerY:50};o.style({gradient:s,isFilled:!0}),t(!0)}},[e,o]);return O("div",{children:[O(so,{children:[D(ao,{style:{width:36},children:"Enable"}),D(za,{checked:e,onClick:r,children:D(Fa,{checked:e})})]}),e&&D("div",{style:{marginTop:8},children:D(Zi,{value:n,onChange:(s,l)=>{o.style({gradient:s})}})})]})}function Zy({style:i,app:o,theme:e}){var h;let t=((h=zn[e])==null?void 0:h[i.color])||"#000000",{hex:n,opacity:r}=pp(i.labelColor,t),{hex:s,opacity:l}=pp(i.labelBackground,"transparent"),a=i.textGradient,[c,p]=Ie.useState(!!a),u=Ie.useCallback(()=>{if(c)o.style({textGradient:void 0}),p(!1);else{let g={type:"linear",stops:[{color:"#0D99FF",position:0,opacity:1},{color:"#FF6B00",position:100,opacity:1}],angle:90,centerX:50,centerY:50};o.style({textGradient:g}),p(!0)}},[c,o]);return O("div",{children:[D(Yo,{color:n,opacity:r,onChange:(g,m)=>{let f=g==="transparent"?"transparent":cp(g,m);o.style({labelColor:f})},showTransparent:!0,showOpacity:!0,label:"Text"}),D("div",{style:{marginTop:6},children:D(Yo,{color:s,opacity:l,onChange:(g,m)=>{let f=g==="transparent"?"transparent":cp(g,m);o.style({labelBackground:f})},showTransparent:!0,showOpacity:!0,label:"Text Bg"})}),O("div",{style:{marginTop:8},children:[O(so,{children:[D(ao,{style:{width:60},children:"Text Grad"}),D(za,{checked:c,onClick:u,children:D(Fa,{checked:c})})]}),c&&D("div",{style:{marginTop:8},children:D(Zi,{value:a,onChange:g=>o.style({textGradient:g})})})]})]})}function qy(i){if(!i)return[];if(Array.isArray(i))return i;let o=[];i.dropShadow&&o.push({id:Ji.uniqueId(),type:"dropShadow",enabled:i.dropShadow.enabled,x:i.dropShadow.x,y:i.dropShadow.y,blur:i.dropShadow.blur,spread:i.dropShadow.spread,color:i.dropShadow.color});let e={layerBlur:0,blur:0,brightness:100,contrast:100,saturate:100,hueRotate:0,grayscale:0,sepia:0};for(let t of Object.keys(e))i[t]!==void 0&&i[t]!==e[t]&&o.push({id:Ji.uniqueId(),type:t,enabled:!0,value:i[t]});return i.invert&&o.push({id:Ji.uniqueId(),type:"invert",enabled:!0}),o}var up={dropShadow:"Drop Shadow",blur:"Blur",layerBlur:"Layer Blur",brightness:"Brightness",contrast:"Contrast",saturate:"Saturation",hueRotate:"Hue Rotate",grayscale:"Grayscale",sepia:"Sepia",invert:"Invert"};function Jy({shape:i,app:o}){let e=qy(i.effects),t=Ie.useCallback(l=>o.updateShapes({id:i.id,effects:l}),[o,i.id]),n=(l,a)=>{t(e.map(c=>c.id===l?S(S({},c),a):c))},r=l=>{t(e.filter(a=>a.id!==l))},s=l=>{let a={id:Ji.uniqueId(),type:l,enabled:!0};l==="dropShadow"?Object.assign(a,{x:2,y:4,blur:8,spread:0,color:"#00000080"}):["layerBlur","blur"].includes(l)?a.value=4:["brightness","contrast","saturate"].includes(l)?a.value=100:a.value=0,t([...e,a])};return O("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.map(l=>{var a,c,p,u,h,g,m,f,v;return O("div",{style:{borderBottom:"1px solid var(--colors-separator)",paddingBottom:6},children:[O("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[O("div",{style:{display:"flex",alignItems:"center",gap:6},children:[D(za,{checked:l.enabled,onClick:()=>n(l.id,{enabled:!l.enabled}),children:D(Fa,{checked:l.enabled})}),D("span",{style:{fontSize:10,fontWeight:500,color:"var(--colors-text)"},children:up[l.type]})]}),D("button",{onClick:()=>r(l.id),style:{all:"unset",cursor:"pointer",opacity:.5,fontSize:12,lineHeight:1},title:"Remove effect",children:"\u2715"})]}),l.enabled&&O("div",{style:{paddingLeft:22},children:[l.type==="dropShadow"&&O(Fr,{children:[O(gp,{style:{marginBottom:4},children:[D(Ue,{label:"X",value:(a=l.x)!=null?a:0,onChange:b=>n(l.id,{x:b})}),D(Ue,{label:"Y",value:(c=l.y)!=null?c:0,onChange:b=>n(l.id,{y:b})}),D(Ue,{label:"Blur",value:(p=l.blur)!=null?p:0,onChange:b=>n(l.id,{blur:Math.max(0,b)}),labelWidth:26}),D(Ue,{label:"Sprd",value:(u=l.spread)!=null?u:0,onChange:b=>n(l.id,{spread:b}),labelWidth:28})]}),O(so,{children:[D(ao,{style:{width:40,textAlign:"left"},children:"Color"}),D("input",{type:"color",value:((h=l.color)!=null?h:"#000000").slice(0,7),onChange:b=>n(l.id,{color:b.target.value+"80"}),style:{width:24,height:20,border:"none",padding:0,cursor:"pointer"}})]})]}),["layerBlur","blur"].includes(l.type)&&D(Ue,{label:"Radius",value:(g=l.value)!=null?g:0,onChange:b=>n(l.id,{value:Math.max(0,b)}),suffix:"px",labelWidth:40}),["brightness","contrast","saturate"].includes(l.type)&&D(Ue,{label:"Amount",value:(m=l.value)!=null?m:100,onChange:b=>n(l.id,{value:Math.max(0,b)}),suffix:"%",labelWidth:40}),["hueRotate"].includes(l.type)&&D(Ue,{label:"Angle",value:(f=l.value)!=null?f:0,onChange:b=>n(l.id,{value:b}),suffix:"\xB0",labelWidth:40}),["grayscale","sepia"].includes(l.type)&&D(Ue,{label:"Amount",value:(v=l.value)!=null?v:0,onChange:b=>n(l.id,{value:Math.max(0,Math.min(100,b))}),suffix:"%",labelWidth:40})]})]},l.id)}),D("div",{style:{position:"relative"},children:O("select",{value:"",onChange:l=>s(l.target.value),style:{width:"100%",padding:"4px 6px",fontSize:10,borderRadius:4,background:"var(--colors-inputBg)",color:"var(--colors-textSecondary)",border:"1px dashed var(--colors-separator)",cursor:"pointer"},children:[D("option",{value:"",disabled:!0,children:"+ Add Effect"}),Object.entries(up).map(([l,a])=>D("option",{value:l,children:a},l))]})})]})}function Qy({shape:i,app:o}){var r,s;let e=i,t=!!((r=e.decorations)!=null&&r.start),n=((s=e.decorations)==null?void 0:s.end)!==void 0;return O("div",{children:[O(so,{children:[D(ao,{style:{width:36},children:"Start"}),O(es,{children:[D(et,{isActive:!t,onClick:()=>o.updateShapes({id:i.id,decorations:w(S({},e.decorations),{start:void 0})}),children:"None"}),D(et,{isActive:t,onClick:()=>o.updateShapes({id:i.id,decorations:w(S({},e.decorations),{start:"arrow"})}),children:"\u25C4"})]})]}),O(so,{children:[D(ao,{style:{width:36},children:"End"}),O(es,{children:[D(et,{isActive:!n,onClick:()=>o.updateShapes({id:i.id,decorations:w(S({},e.decorations),{end:void 0})}),children:"None"}),D(et,{isActive:n,onClick:()=>o.updateShapes({id:i.id,decorations:w(S({},e.decorations),{end:"arrow"})}),children:"\u25BA"})]})]}),D("div",{style:{marginTop:4},children:D(Ue,{label:"Bend",value:Math.round((e.bend||0)*100),onChange:l=>o.updateShapes({id:i.id,bend:l/100}),min:-99,max:99,suffix:"%",labelWidth:36})})]})}function eb({style:i,app:o}){var g;let[e,t]=Ie.useState(""),[n,r]=Ie.useState(!1),[s,l]=Ie.useState([]),a=Ie.useRef(null);Ie.useEffect(()=>{Promise.resolve().then(()=>(zr(),qi)).then(m=>{l(m.searchGoogleFonts(e))})},[e]);let c=Ie.useCallback(m=>{Promise.resolve().then(()=>(zr(),qi)).then(f=>{f.loadGoogleFont(m.family,m.variants);let v=m.category==="monospace"?"mono":m.category==="serif"?"serif":m.category==="handwriting"?"script":"sans";o.style({font:v,fontFamily:m.family}),t(""),r(!1)})},[o]);Ie.useEffect(()=>{let m=f=>{a.current&&!a.current.contains(f.target)&&(r(!1),t(""))};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);let p=i.font==="mono"?"Monospace":i.font==="serif"?"Serif":i.font==="script"?"Script":"Sans Serif",u=i.fontFamily||p,h=Math.round(((g=i.scale)!=null?g:1)*100);return O("div",{children:[O(so,{children:[D(ao,{style:{width:36},children:"Font"}),O("div",{ref:a,style:{position:"relative",flex:1},children:[D(ib,{value:e||u,onChange:m=>{t(m.target.value),r(!0)},onFocus:()=>{r(!0),Promise.resolve().then(()=>(zr(),qi)).then(m=>m.fetchGoogleFonts())},placeholder:"Search fonts...",style:{fontSize:9}}),n&&s.length>0&&D(ab,{children:s.map(m=>D(lb,{onMouseDown:f=>{f.preventDefault(),c(m)},style:{fontFamily:m.family},children:m.family},m.family))})]})]}),D("div",{style:{marginTop:4},children:D(Ue,{label:"Size",value:h,onChange:m=>o.style({scale:m/100}),min:25,max:300,suffix:"%",labelWidth:36})}),O(so,{style:{marginTop:4},children:[D(ao,{style:{width:36},children:"Align"}),D(es,{children:[{val:"start",svg:D("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:D("path",{d:"M1 2H11M1 5H7M1 8H9M1 11H5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})})},{val:"middle",svg:D("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:D("path",{d:"M1 2H11M3 5H9M2 8H10M4 11H8",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})})},{val:"end",svg:D("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:D("path",{d:"M1 2H11M5 5H11M3 8H11M7 11H11",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})})},{val:"justify",svg:D("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:D("path",{d:"M1 2H11M1 5H11M1 8H11M1 11H11",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})})}].map(({val:m,svg:f})=>D(et,{isActive:i.textAlign===m,onClick:()=>o.style({textAlign:m}),children:f},m))})]})]})}function tb({app:i}){return O(Nn,{children:[D(lo,{children:"Alignment"}),D(Qi,{children:[{fn:()=>i.align("left"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"2",x2:"2",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"7",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"4",y:"8",width:"5",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Left"},{fn:()=>i.align("centerHorizontal"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"7",y1:"1",x2:"7",y2:"13",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("rect",{x:"3",y:"4",width:"8",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"4",y:"8",width:"6",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Center H"},{fn:()=>i.align("right"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"12",y1:"2",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"3",y:"4",width:"7",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"5",y:"8",width:"5",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Right"},{fn:()=>i.align("top"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"2",x2:"12",y2:"2",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"2.5",height:"7",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"4",width:"2.5",height:"5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Top"},{fn:()=>i.align("centerVertical"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("rect",{x:"4",y:"2",width:"2.5",height:"10",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"3",width:"2.5",height:"8",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Center V"},{fn:()=>i.align("bottom"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"3",width:"2.5",height:"7",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"5",width:"2.5",height:"5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Bottom"}].map(({fn:o,icon:e,t},n)=>D(et,{onClick:o,title:t,children:e},n))}),D(mp,{style:{display:"block",marginTop:8,marginBottom:4},children:"Distribute"}),O(Qi,{style:{gridTemplateColumns:"repeat(2, 1fr)"},children:[D(et,{onClick:()=>i.distribute("horizontal"),title:"Distribute Horizontal",children:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"1",y1:"2",x2:"1",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"13",y1:"2",x2:"13",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"6",height:"6",rx:"0.5",fill:"currentColor",opacity:"0.5"})]})}),D(et,{onClick:()=>i.distribute("vertical"),title:"Distribute Vertical",children:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"1",x2:"12",y2:"1",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"2",y1:"13",x2:"12",y2:"13",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"6",height:"6",rx:"0.5",fill:"currentColor",opacity:"0.5"})]})})]}),D(mp,{style:{display:"block",marginTop:8,marginBottom:4},children:"Stretch"}),O(Qi,{style:{gridTemplateColumns:"repeat(2, 1fr)"},children:[D(et,{onClick:()=>i.stretch("horizontal"),title:"Stretch Width",children:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"1",y1:"2",x2:"1",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"13",y1:"2",x2:"13",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("path",{d:"M3 5.5h8",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"}),D("path",{d:"M3 8.5h8",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"})]})}),D(et,{onClick:()=>i.stretch("vertical"),title:"Stretch Height",children:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"1",x2:"12",y2:"1",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"2",y1:"13",x2:"12",y2:"13",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"7",y1:"1",x2:"7",y2:"13",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("path",{d:"M5.5 3v8",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"}),D("path",{d:"M8.5 3v8",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"})]})})]})]})}function Va(i,o){let e=URL.createObjectURL(i),t=document.createElement("a");t.href=e,t.download=o,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)}function nb({shape:i,app:o}){let e=o.useStore(n=>n.appState.nodeEditingId===i.id),t=Ie.useCallback(()=>{e?o.setNodeEditingId(void 0):o.setNodeEditingId(i.id)},[o,i.id,e]);return D(Nn,{children:D(et,{onClick:t,isActive:e,style:{width:"100%"},children:e?"Exit Edit Mode":"Edit Shape"})})}function ob({shape:i,app:o}){let[e,t]=Ie.useState(null),n=i.type+"-"+i.id.slice(0,6);return D("div",{children:O("div",{style:{display:"flex",gap:4},children:[D(et,{style:{flex:1},onClick:()=>z(this,null,function*(){t("svg");try{let a=yield o.exportImage("svg",{ids:[i.id]});a&&Va(a,n+".svg")}catch(a){console.error("SVG export failed",a)}t(null)}),title:"Export as SVG",children:e==="svg"?"...":"SVG"}),D(et,{style:{flex:1},onClick:()=>z(this,null,function*(){t("png");try{let a=yield o.exportImage("png",{ids:[i.id]});a&&Va(a,n+".png")}catch(a){console.error("PNG export failed",a)}t(null)}),title:"Export as PNG",children:e==="png"?"...":"PNG"}),D(et,{style:{flex:1},onClick:()=>{let a=JSON.stringify(i,null,2);navigator.clipboard.writeText(a).catch(c=>{}),Va(new Blob([a],{type:"application/json"}),n+".json")},title:"Copy JSON & download",children:"JSON"})]})})}function wo({title:i,children:o,defaultOpen:e=!1}){let[t,n]=Ie.useState(e);return O(Nn,{children:[O("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"},onClick:()=>n(!t),children:[D(lo,{style:{marginBottom:0},children:i}),D(fp,{onClick:r=>{r.stopPropagation(),n(!t)},children:t?"\u2212":"+"})]}),t&&D("div",{style:{marginTop:8},children:o})]})}var hp=P("div",{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden","&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{background:"$separator",borderRadius:"2px"}}),Nn=P("div",{padding:"8px 12px"}),lo=P("div",{fontSize:"10px",fontWeight:600,color:"$textSecondary",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"8px"}),Zt=P("div",{height:"1px",background:"$separator"}),rb=P("div",{fontSize:"10px",color:"$textSecondary",fontStyle:"italic"}),gp=P("div",{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"4px"}),so=P("div",{display:"flex",alignItems:"center",gap:"6px",marginBottom:"4px"}),ao=P("label",{fontSize:"9px",color:"$textSecondary",fontWeight:500,width:"18px",flexShrink:0,textAlign:"right",cursor:"ew-resize",userSelect:"none"}),lE=P("span",{fontSize:"9px",color:"$textSecondary"}),ib=P("input",{width:"100%",background:"$inputBg",border:"1px solid $inputBorder",borderRadius:"$1",color:"$text",fontSize:"10px",padding:"4px 6px",fontFamily:"$ui",outline:"none",transition:"border-color 0.1s","&:focus":{borderColor:"$accent"},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),mp=P("span",{fontSize:"9px",color:"$textSecondary",fontFamily:"$mono"}),Qi=P("div",{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"3px"}),es=P("div",{display:"flex",gap:"2px",flex:1}),et=P("button",{all:"unset",flex:1,height:"24px",border:"1px solid $separator",borderRadius:"$1",color:"$textSecondary",cursor:"pointer",fontSize:"9px",fontFamily:"$ui",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.08s","&:hover":{background:"$hover",color:"$text"},variants:{isActive:{true:{background:"$accent",borderColor:"$accent",color:"white","&:hover":{background:"$accent",color:"white"}}}}}),fp=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"$0",cursor:"pointer",color:"$textSecondary",fontSize:"11px","&:hover":{background:"$hover",color:"$text"}}),za=P("button",{all:"unset",width:"28px",height:"16px",borderRadius:"$pill",cursor:"pointer",padding:"2px",transition:"background 0.12s",background:"$inputBg",variants:{checked:{true:{background:"$accent"}}}}),Fa=P("div",{width:"12px",height:"12px",borderRadius:"50%",background:"white",transition:"transform 0.12s",variants:{checked:{true:{transform:"translateX(12px)"}}}}),sb=P("div",{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"4px",alignItems:"center"}),dE=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"$1",border:"1px solid $separator",cursor:"pointer",color:"$textSecondary",transition:"all 0.08s",flexShrink:0,"&:hover":{background:"$hover",color:"$text"},variants:{locked:{true:{background:"rgba(13,153,255,0.15)",borderColor:"$accent",color:"$accent"}}}}),ab=P("div",{position:"absolute",top:"100%",left:0,right:0,maxHeight:"140px",overflowY:"auto",background:"$panel",border:"1px solid $separator",borderRadius:"$2",zIndex:1e3,boxShadow:"0 4px 16px rgba(0,0,0,0.3)",marginTop:"2px","&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{background:"$separator",borderRadius:"2px"}}),lb=P("div",{padding:"4px 8px",fontSize:"10px",color:"$text",cursor:"pointer","&:hover":{background:"$hover"}});import{jsx as Sp}from"react/jsx-runtime";var Oa=yp.memo(function(){return Sp(db,{children:Sp(Ha,{})})}),db=P("div",{display:"flex",flexDirection:"column",width:"240px",height:"100%",background:"$panel",borderLeft:"1px solid $separator",zIndex:200,pointerEvents:"all",overflow:"hidden",flexShrink:0});zr();import*as jp from"react";import{useIntl as pv}from"react-intl";import*as Ip from"@radix-ui/react-dropdown-menu";import{HamburgerMenuIcon as Cb}from"@radix-ui/react-icons";import*as Pe from"react";import{FormattedMessage as tt,useIntl as wb}from"react-intl";import{Item as cb}from"@radix-ui/react-dropdown-menu";import{jsx as bp}from"react/jsx-runtime";function ce(t){var n=t,{onSelect:i,id:o}=n,e=Be(n,["onSelect","id"]);return bp(cb,{dir:"ltr",asChild:!0,onSelect:i,id:o,children:bp(Je,S({},e))})}import{CheckboxItem as pb}from"@radix-ui/react-dropdown-menu";var ke=i=>i.preventDefault();import{jsx as vp}from"react/jsx-runtime";function qt({checked:i,disabled:o=!1,variant:e,onCheckedChange:t,kbd:n,id:r,ariaLabel:s,children:l}){return vp(pb,{dir:"ltr",onSelect:ke,onCheckedChange:t,checked:i,disabled:o,asChild:!0,id:r,"aria-label":s,children:vp(Je,{kbd:n,variant:e,hasIndicator:!0,children:l})})}import*as ts from"@radix-ui/react-dropdown-menu";import{jsx as $a}from"react/jsx-runtime";function wn({sideOffset:i=4,alignOffset:o=0,children:e,align:t,variant:n,id:r,overflow:s=!1,side:l="bottom"}){let a=rn();return $a(ts.Portal,{container:a.current,dir:"ltr",children:$a(ts.Content,{align:t,alignOffset:o,sideOffset:i,onEscapeKeyDown:rt,asChild:!0,id:r,side:l,children:$a(ub,{variant:n,overflow:s,children:e})})})}var ub=P(Ln,{width:"fit-content",height:"fit-content",minWidth:0,maxHeight:"100vh",overflowY:"auto",overflowX:"hidden","&::webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none",variants:{variant:{horizontal:{flexDirection:"row"},menu:{minWidth:128}},overflow:{true:{maxHeight:"60vh"}}}});import{Separator as hb}from"@radix-ui/react-dropdown-menu";var zE=P(hb,{backgroundColor:"$hover",height:1,marginTop:"$2",marginRight:"-$2",marginBottom:"$2",marginLeft:"-$2"});import{RadioItem as mb}from"@radix-ui/react-dropdown-menu";var Or=P(mb,{height:"32px",width:"32px",backgroundColor:"$panel",borderRadius:"4px",padding:"0",margin:"0",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",border:"none",pointerEvents:"all",cursor:"pointer",variants:{isActive:{true:{backgroundColor:"$selected",color:"white"},false:{}},bp:{mobile:{},small:{}}},compoundVariants:[{isActive:!1,bp:"small",css:{"&:focus":{backgroundColor:"$hover"},"&:hover:not(:disabled)":{backgroundColor:"$hover"}}}]});import{Arrow as gb,Sub as fb,SubContent as Sb,SubTrigger as yb}from"@radix-ui/react-dropdown-menu";import{jsx as ns,jsxs as Tp}from"react/jsx-runtime";function In({children:i,size:o,overflow:e=!1,disabled:t=!1,label:n,id:r}){return Tp(fb,{children:[ns(yb,{dir:"ltr",asChild:!0,children:ns(Je,{disabled:t,hasArrow:!0,children:n})}),ns(Sb,{asChild:!0,sideOffset:4,alignOffset:-4,children:Tp(Ln,{size:o,overflow:e,children:[i,ns(gb,{offset:13})]})})]},r)}import{Trigger as bb}from"@radix-ui/react-dropdown-menu";import{jsx as xp}from"react/jsx-runtime";function os(t){var n=t,{id:i,children:o}=n,e=Be(n,["id","children"]);return xp(bb,{asChild:!0,id:i,children:xp(xt,w(S({},e),{children:o}))})}import*as Un from"react";import{FormattedMessage as co,useIntl as vb}from"react-intl";import{jsx as Ge,jsxs as kb}from"react/jsx-runtime";var Tb=i=>i.settings,xb=["bottom","left","right","top"];function Cp(){let i=N(),o=vb(),e=i.useStore(Tb),t=Un.useCallback(()=>{i.setSetting("isDebugMode",u=>!u)},[i]),n=Un.useCallback(()=>{i.setSetting("isDarkMode",u=>!u)},[i]),r=Un.useCallback(()=>{i.setSetting("isFocusMode",u=>!u)},[i]),s=Un.useCallback(()=>{i.setSetting("showGrid",u=>!u)},[i]),l=Un.useCallback(()=>{i.setSetting("keepStyleMenuOpen",u=>!u)},[i]),a=Un.useCallback(()=>{i.setSetting("isCadSelectMode",u=>!u)},[i]),c=Un.useCallback(u=>{i.setSetting("dockPosition",u)},[i]),p=Un.useCallback(u=>{i.setSetting("exportBackground",u)},[i]);return kb(In,{label:o.formatMessage({id:"menu.preferences"}),id:"TD-MenuItem-Preferences",children:[Ge(qt,{checked:e.isDarkMode,onCheckedChange:n,kbd:"#\u21E7D",id:"TD-MenuItem-Preferences-Dark_Mode",ariaLabel:o.formatMessage({id:"preferences.dark.mode"}),children:Ge(co,{id:"preferences.dark.mode"})}),Ge(qt,{checked:e.isFocusMode,onCheckedChange:r,kbd:"#.",id:"TD-MenuItem-Preferences-Focus_Mode",ariaLabel:o.formatMessage({id:"preferences.focus.mode"}),children:Ge(co,{id:"preferences.focus.mode"})}),Ge(qt,{checked:e.isDebugMode,onCheckedChange:t,id:"TD-MenuItem-Preferences-Debug_Mode",ariaLabel:o.formatMessage({id:"preferences.debug.mode"}),children:Ge(co,{id:"preferences.debug.mode"})}),Ge(ve,{}),Ge(qt,{checked:e.showGrid,onCheckedChange:s,kbd:"#\u21E7G",id:"TD-MenuItem-Preferences-Grid",ariaLabel:o.formatMessage({id:"preferences.show.grid"}),children:Ge(co,{id:"preferences.show.grid"})}),Ge(qt,{checked:e.isCadSelectMode,onCheckedChange:a,id:"TD-MenuItem-Preferences-Cad_Selection",ariaLabel:o.formatMessage({id:"preferences.use.cad.selection"}),children:Ge(co,{id:"preferences.use.cad.selection"})}),Ge(qt,{checked:e.keepStyleMenuOpen,onCheckedChange:l,id:"TD-MenuItem-Preferences-Style_menu",ariaLabel:o.formatMessage({id:"preferences.keep.stylemenu.open"}),children:Ge(co,{id:"preferences.keep.stylemenu.open"})}),Ge(In,{label:o.formatMessage({id:"dock.position"}),children:xb.map(u=>Ge(qt,{checked:e.dockPosition===u,onCheckedChange:()=>c(u),id:`TD-MenuItem-DockPosition-${u}`,ariaLabel:`DockPosition-${u}`,children:Ge(kp,{children:Ge(co,{id:u})})},u))}),Ge(In,{label:o.formatMessage({id:"export.background"}),children:Object.values(fr).map(u=>Ge(qt,{checked:e.exportBackground===u,onCheckedChange:()=>p(u),id:`TD-MenuItem-ExportBackground-${u}`,ariaLabel:`ExportBackground-${u}`,children:Ge(kp,{children:Ge(co,{id:u})})},u))})]})}var kp=P("span",{textTransform:"capitalize"});import{Fragment as wp,jsx as Z,jsxs as Jt}from"react/jsx-runtime";var Ib=i=>i.document.pageStates[i.appState.currentPageId].selectedIds.length,Pb=i=>i.appState.disableAssets,Pp=Pe.memo(function({readOnly:o}){let e=N(),t=wb(),[n,r]=Pe.useState(!1),s=e.useStore(Ib),l=e.useStore(Pb),[a,c]=Pe.useState(0);Pe.useEffect(()=>c(1),[]);let{onNewProject:p,onOpenProject:u,onSaveProject:h,onSaveProjectAs:g}=ei(),m=Pe.useCallback(()=>{r(!0)},[]),f=Pe.useCallback(()=>{e.delete()},[e]),v=Pe.useCallback(()=>{e.copyImage("svg",{scale:1,quality:1,transparentBackground:!1})},[e]),b=Pe.useCallback(()=>{e.copyImage("png",{scale:2,quality:1,transparentBackground:!0})},[e]),T=Pe.useCallback(()=>z(this,null,function*(){e.exportImage("png",{scale:2,quality:1})}),[e]),y=Pe.useCallback(()=>z(this,null,function*(){e.exportImage("jpeg",{scale:2,quality:1})}),[e]),x=Pe.useCallback(()=>z(this,null,function*(){e.exportImage("webp",{scale:2,quality:1})}),[e]),I=Pe.useCallback(()=>z(this,null,function*(){e.exportImage("svg",{scale:2,quality:1})}),[e]),k=Pe.useCallback(()=>z(this,null,function*(){e.copyJson()}),[e]),R=Pe.useCallback(()=>z(this,null,function*(){e.exportJson()}),[e]),C=Pe.useCallback(()=>{e.cut()},[e]),E=Pe.useCallback(()=>{e.copy()},[e]),M=Pe.useCallback(()=>{e.paste()},[e]),L=Pe.useCallback(()=>{e.selectAll()},[e]),A=Pe.useCallback(()=>{e.selectNone()},[e]),K=Pe.useCallback(()=>{e.openAsset()},[e]),re=Pe.useCallback(()=>{e.zoomTo(1)},[e]),F=e.callbacks.onNewProject||e.callbacks.onOpenProject||e.callbacks.onSaveProject||e.callbacks.onSaveProjectAs||e.callbacks.onExport,ee=s>0;return Jt(wp,{children:[Jt(Ip.Root,{dir:"ltr",children:[Z(os,{id:"TD-MenuIcon",children:Z(Cb,{})}),Jt(wn,{variant:"menu",id:"TD-Menu",side:"bottom",align:"start",sideOffset:4,alignOffset:4,children:[F&&Jt(In,{label:`${t.formatMessage({id:"menu.file"})}...`,id:"TD-MenuItem-File",children:[e.callbacks.onNewProject&&Z(ce,{onClick:p,kbd:"#N",id:"TD-MenuItem-File-New_Project",children:Z(tt,{id:"new.project"})}),e.callbacks.onOpenProject&&Jt(ce,{onClick:u,kbd:"#O",id:"TD-MenuItem-File-Open",children:[Z(tt,{id:"open"}),"..."]}),e.callbacks.onSaveProject&&Z(ce,{onClick:h,kbd:"#S",id:"TD-MenuItem-File-Save",children:Z(tt,{id:"save"})}),e.callbacks.onSaveProjectAs&&Jt(ce,{onClick:m,kbd:"#\u21E7S",id:"TD-MenuItem-File-Save_As",children:[Z(tt,{id:"save.as"}),"..."]}),Jt(In,{label:`${t.formatMessage({id:"export.as"})}...`,size:"small",id:"TD-MenuItem-Export",children:[Z(ce,{onClick:I,id:"TD-MenuItem-Export-SVG",children:"SVG"}),Z(ce,{onClick:T,id:"TD-MenuItem-Export-PNG",children:"PNG"}),Z(ce,{onClick:y,id:"TD-MenuItem-Export-JPG",children:"JPG"}),Z(ce,{onClick:x,id:"TD-MenuItem-Export-WEBP",children:"WEBP"}),Z(ce,{onClick:R,id:"TD-MenuItem-Export-JSON",children:"JSON"})]}),!l&&Jt(wp,{children:[Z(ve,{}),Z(ce,{onClick:K,kbd:"#U",id:"TD-MenuItem-File-Upload_Media",children:Z(tt,{id:"upload.media"})})]})]}),Jt(In,{label:`${t.formatMessage({id:"menu.edit"})}...`,id:"TD-MenuItem-Edit",children:[Z(ce,{onSelect:ke,onClick:e.undo,disabled:o,kbd:"#Z",id:"TD-MenuItem-Edit-Undo",children:Z(tt,{id:"undo"})}),Z(ce,{onSelect:ke,onClick:e.redo,disabled:o,kbd:"#\u21E7Z",id:"TD-MenuItem-Edit-Redo",children:Z(tt,{id:"redo"})}),Z(ve,{}),Z(ce,{onSelect:ke,disabled:!ee||o,onClick:C,kbd:"#X",id:"TD-MenuItem-Edit-Cut",children:Z(tt,{id:"cut"})}),Z(ce,{onSelect:ke,disabled:!ee,onClick:E,kbd:"#C",id:"TD-MenuItem-Edit-Copy",children:Z(tt,{id:"copy"})}),Z(ce,{onSelect:ke,onClick:M,kbd:"#V",id:"TD-MenuItem-Edit-Paste",children:Z(tt,{id:"paste"})}),Z(ve,{}),Jt(In,{label:`${t.formatMessage({id:"copy.as"})}...`,size:"small",id:"TD-MenuItem-Copy-As",children:[Z(ce,{onClick:v,id:"TD-MenuItem-Copy-as-SVG",children:"SVG"}),Z(ce,{onClick:b,id:"TD-MenuItem-Copy-As-PNG",children:"PNG"}),Z(ce,{onClick:k,id:"TD-MenuItem-Copy_as_JSON",children:"JSON"})]}),Z(ve,{}),Z(ce,{onSelect:ke,onClick:L,kbd:"#A",id:"TD-MenuItem-Select_All",children:Z(tt,{id:"select.all"})}),Z(ce,{onSelect:ke,disabled:!ee,onClick:A,id:"TD-MenuItem-Select_None",children:Z(tt,{id:"select.none"})}),Z(ve,{}),Z(ce,{onSelect:f,disabled:!ee,kbd:"\u232B",id:"TD-MenuItem-Delete",children:Z(tt,{id:"delete"})})]}),Jt(In,{label:t.formatMessage({id:"menu.view"}),id:"TD-MenuItem-Edit",children:[Z(ce,{onSelect:ke,onClick:e.zoomIn,kbd:"#+",id:"TD-MenuItem-View-ZoomIn",children:Z(tt,{id:"zoom.in"})}),Z(ce,{onSelect:ke,onClick:e.zoomOut,kbd:"#-",id:"TD-MenuItem-View-ZoomOut",children:Z(tt,{id:"zoom.out"})}),Jt(ce,{onSelect:ke,onClick:re,kbd:"\u21E7+0",id:"TD-MenuItem-View-ZoomTo100",children:[Z(tt,{id:"zoom.to"})," 100%"]}),Z(ce,{onSelect:ke,onClick:e.zoomToFit,kbd:"\u21E7+1",id:"TD-MenuItem-View-ZoomToFit",children:Z(tt,{id:"zoom.to.fit"})}),Z(ce,{onSelect:ke,onClick:e.zoomToSelection,kbd:"\u21E7+2",id:"TD-MenuItem-View-ZoomToSelection",children:Z(tt,{id:"zoom.to.selection"})})]}),Z(ve,{}),Z(Cp,{})]})]}),Z(Md,{isOpen:n,onClose:()=>r(!1)})]})});import*as Mp from"@radix-ui/react-dropdown-menu";import{CheckIcon as Ep,ClipboardIcon as Bp}from"@radix-ui/react-icons";import*as Kn from"react";import{FormattedMessage as rs}from"react-intl";import{Utils as Ga}from"telva-core";import{jsx as Rp}from"react/jsx-runtime";function Dp(){return Rp("svg",{width:"15",height:"15",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:Rp("path",{d:"M1.36482 4.71089C1.36482 3.21371 2.57853 2 4.07572 2C5.5729 2 6.78661 3.21371 6.78661 4.71089C6.78661 5.76842 6.18106 6.68452 5.29779 7.13136C5.80465 7.24611 6.26407 7.44186 6.66028 7.73182C7.18674 8.11711 7.57215 8.64722 7.81073 9.30983C7.81452 9.30606 7.81832 9.3023 7.82212 9.29855C8.30448 8.82317 8.91325 8.52463 9.60905 8.37275C8.68812 7.922 8.05394 6.97569 8.05394 5.88126C8.05394 4.35017 9.29513 3.10898 10.8262 3.10898C12.3573 3.10898 13.5985 4.35017 13.5985 5.88126C13.5985 6.97561 12.9644 7.92186 12.0436 8.37265C12.7396 8.52449 13.3486 8.82306 13.831 9.29854C14.5795 10.0361 14.9481 11.1249 14.9481 12.5176C14.9481 12.7799 14.7354 12.9926 14.473 12.9926C14.2107 12.9926 13.9981 12.7799 13.9981 12.5175C13.9981 11.2848 13.6738 10.4774 13.1642 9.97518C12.6532 9.4716 11.8802 9.20024 10.8266 9.20024C9.77294 9.20024 8.99993 9.4716 8.48896 9.97518C7.97939 10.4774 7.65513 11.2848 7.65513 12.5176C7.65513 12.7799 7.44247 12.9926 7.18013 12.9926C6.9178 12.9926 6.70513 12.7799 6.70513 12.5176C6.70513 11.6734 6.84053 10.941 7.11384 10.3307C7.0922 10.2895 7.0763 10.2444 7.06737 10.1962C6.91739 9.38749 6.57392 8.84586 6.09923 8.49845C5.61626 8.14499 4.94481 7.95427 4.07574 7.95427C3.05232 7.95427 2.30368 8.21784 1.80952 8.70485C1.31675 9.19047 1.00176 9.97257 1.00176 11.1702C1.00176 11.4326 0.789093 11.6452 0.526758 11.6452C0.264423 11.6452 0.0517578 11.4326 0.0517578 11.1702C0.0517578 9.81263 0.411052 8.74925 1.14268 8.02821C1.60624 7.57137 2.18892 7.28191 2.85378 7.13142C1.97043 6.68461 1.36482 5.76848 1.36482 4.71089ZM4.07572 2.95C3.1032 2.95 2.31482 3.73838 2.31482 4.71089C2.31482 5.68341 3.1032 6.47178 4.07572 6.47178C5.04823 6.47178 5.83661 5.68341 5.83661 4.71089C5.83661 3.73838 5.04823 2.95 4.07572 2.95ZM10.8262 4.05898C9.8198 4.05898 9.00394 4.87484 9.00394 5.88126C9.00394 6.88768 9.8198 7.70355 10.8262 7.70355C11.8326 7.70355 12.6485 6.88768 12.6485 5.88126C12.6485 4.87484 11.8326 4.05898 10.8262 4.05898Z"})})}import{jsx as yt,jsxs as is}from"react/jsx-runtime";var Rb=i=>i.room,Lp=function(){let o=N(),e=o.useStore(Rb),[t,n]=Kn.useState(!1),r=Kn.useRef(0),s=Kn.useCallback(()=>{n(!0),B.copyStringToClipboard(window.location.href),clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1200)},[]),l=Kn.useCallback(()=>{n(!0);let p=window.location.href.split("/");p[p.length-2]="v",p[p.length-1]=Ga.lns(p[p.length-1]),B.copyStringToClipboard(p.join("/")),clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1200)},[]),a=Kn.useCallback(()=>z(this,null,function*(){o.isDirty?o.fileSystemHandle?window.confirm("Do you want to save changes to your current project?")&&(yield o.saveProject()):window.confirm("Do you want to save your current project?")&&(yield o.saveProject()):o.fileSystemHandle||window.confirm("Do you want to save your current project?")&&(yield o.saveProject())}),[]),c=Kn.useCallback(()=>z(this,null,function*(){var u,h;let p=Ga.deepClone(o.document);o.setIsLoading(!0);try{if(o.callbacks.onAssetUpload)for(let f in p.assets){let v=p.assets[f];if(v.src.includes("base64")){let b=Db(v.src,((u=v.fileName)!=null?u:v.type==="video")?"image.png":"image.mp4"),T=yield o.callbacks.onAssetUpload(o,b,f);T?v.src=T:v.src=""}}let g=yield fetch("/api/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({roomId:Ga.uniqueId(),pageId:o.currentPageId,document:p})}),m=yield g.json();g.ok&&(m==null?void 0:m.url)?window.location.href=m.url:B.warn((h=m==null?void 0:m.message)!=null?h:g.statusText)}catch(g){B.warn(g.message)}o.setIsLoading(!1)}),[]);return is(Mp.Root,{dir:"ltr",children:[yt(os,{id:"TD-MultiplayerMenuIcon",isActive:!!e,children:yt(Dp,{})}),is(wn,{variant:"menu",id:"TD-MultiplayerMenu",side:"bottom",align:"start",sideOffset:4,children:[is(ce,{id:"TD-Multiplayer-CopyInviteLink",onClick:s,disabled:!e,children:[yt(rs,{id:"copy.invite.link"}),yt(Rt,{children:t?yt(Ep,{}):yt(Bp,{})})]}),is(ce,{id:"TD-Multiplayer-CopyReadOnlyLink",onClick:l,disabled:!e,children:[yt(rs,{id:"copy.readonly.link"}),yt(Rt,{children:t?yt(Ep,{}):yt(Bp,{})})]}),yt(ve,{}),yt(ce,{id:"TD-Multiplayer-CreateMultiplayerProject",onClick:a,children:yt("a",{href:`${window.location.origin}/r`,children:yt(rs,{id:"create.multiplayer.project"})})}),yt(ce,{id:"TD-Multiplayer-CopyToMultiplayerProject",onClick:c,children:yt(rs,{id:"copy.multiplayer.project"})})]})]})};function Db(i,o){var l,a;let e=i.split(","),t=(a=(l=e[0])==null?void 0:l.match(/:(.*?);/))==null?void 0:a[1],n=window.atob(e[1]),r=n.length,s=new Uint8Array(r);for(;r--;)s[r]=n.charCodeAt(r);return new File([s],o,{type:t})}import*as Qt from"@radix-ui/react-dropdown-menu";import{CheckIcon as Hb,PlusIcon as zb}from"@radix-ui/react-icons";import*as bt from"react";import{FormattedMessage as Fb,useIntl as zp}from"react-intl";import*as At from"@radix-ui/react-alert-dialog";import{MixerVerticalIcon as Eb,Pencil1Icon as Bb}from"@radix-ui/react-icons";import*as lt from"react";import{FormattedMessage as ja,useIntl as Mb}from"react-intl";var Ap=P("button",{position:"relative",height:"32px",width:"32px",backgroundColor:"$panel",borderRadius:"4px",padding:"0",margin:"0",outline:"none",border:"none",pointerEvents:"all",fontSize:"$0",color:"$text",cursor:"pointer",display:"grid",alignItems:"center",justifyContent:"center","& > *":{gridRow:1,gridColumn:1},"&:disabled":{opacity:"0.5"},"& > span":{width:"100%",height:"100%",display:"flex",alignItems:"center"},variants:{bp:{mobile:{backgroundColor:"transparent"},small:{"&:hover:not(:disabled)":{backgroundColor:"$hover"}}},size:{small:{height:32,width:32,"& svg:nth-of-type(1)":{height:"16px",width:"16px"}},medium:{height:44,width:44,"& svg:nth-of-type(1)":{height:"18px",width:"18px"}},large:{height:44,width:44,"& svg:nth-of-type(1)":{height:"20px",width:"20px"}}},isActive:{true:{color:"$selected"}}}});import{jsx as nt,jsxs as Wa}from"react/jsx-runtime";var Lb=i=>Object.keys(i.document.pages).length>1;function Hp({page:i,onOpen:o,onClose:e}){let t=N(),n=Mb(),[r,s]=lt.useState(!1),[l,a]=lt.useState(i.name||"Page"),c=t.useStore(Lb),p=lt.useRef(null),u=lt.useCallback(()=>{s(!1)},[]),h=lt.useCallback(()=>{t.duplicatePage(i.id)},[t]),g=lt.useCallback(()=>{window.confirm("Are you sure you want to delete this page?")&&t.deletePage(i.id)},[t]),m=lt.useCallback(k=>{if(s(k),k){o==null||o();return}},[t]);function f(k){k.stopPropagation()}let v=lt.useRef(i.name||"Page"),b=lt.useRef(v.current),T=lt.useCallback(k=>{let R=k.target.value.trimStart();b.current=R,a(R)},[]),y=lt.useCallback(k=>{switch(k.key){case"Enter":{b.current===v.current||(v.current=b.current,t.renamePage(i.id,b.current.trim())),s(!1);break}case"Escape":{if(b.current===v.current){s(!1);return}b.current=v.current,a(v.current),requestAnimationFrame(()=>{let R=p.current;R&&(R.focus(),R.setSelectionRange(0,R.value.length))});break}}},[]),x=lt.useRef(!1);lt.useEffect(()=>(r?(x.current=!0,v.current=i.name||"Page",b.current=v.current,requestAnimationFrame(()=>{let k=p.current;k&&(k.focus(),k.setSelectionRange(0,k.value.length))})):x.current&&(e==null||e()),()=>{b.current!==v.current&&(v.current=b.current,t.renamePage(i.id,b.current))}),[r]);let I=rn();return Wa(At.Root,{open:r,onOpenChange:m,children:[nt(At.Trigger,{asChild:!0,"data-shy":"true",children:nt(Ap,{bp:nn,children:nt(Rt,{children:nt(Eb,{})})})}),Wa(At.Portal,{container:I.current,children:[nt(Vb,{onPointerDown:u}),Wa(Ab,{dir:"ltr",onKeyDown:f,onKeyUp:f,children:[nt(gi,{ref:p,placeholder:n.formatMessage({id:"page.name"}),value:l,onChange:T,onKeyDown:y,icon:nt(Bb,{})}),nt(ve,{}),nt(Vp,{onSelect:h,children:nt(ja,{id:"duplicate"})}),nt(Vp,{disabled:!c,onSelect:g,children:nt(ja,{id:"delete"})}),nt(ve,{}),nt(At.Cancel,{asChild:!0,children:nt(Je,{children:nt(ja,{id:"cancel"})})})]})]})]})}var Ab=P(At.Content,{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",minWidth:240,maxWidth:"fit-content",maxHeight:"85vh",marginTop:"-5vh",pointerEvents:"all",backgroundColor:"$panel",padding:"$1",borderRadius:"$2",font:"$ui",zIndex:999999,"&:focus":{outline:"none"}}),Vb=P(At.Overlay,{backgroundColor:"rgba(0, 0, 0, .15)",position:"absolute",pointerEvents:"all",inset:0,zIndex:999998});function Vp(e){var t=e,{onSelect:i}=t,o=Be(t,["onSelect"]);return nt(At.Action,{asChild:!0,onClick:i,onSelect:i,children:nt(Je,S({},o))})}import{Fragment as Ub,jsx as dt,jsxs as $r}from"react/jsx-runtime";var Ob=i=>Object.values(i.document.pages).sort((o,e)=>(o.childIndex||0)-(e.childIndex||0)),$b=i=>i.document.pages[i.appState.currentPageId].name,Gb=i=>i.document.pages[i.appState.currentPageId].id;function Fp(){let i=N(),o=zp(),e=bt.useRef(!1),[t,n]=bt.useState(!1);bt.useEffect(()=>{e.current!==t&&(e.current=t)},[t]);let r=bt.useCallback(()=>{n(!1)},[n]),s=bt.useCallback(a=>{e.current!==a&&n(a)},[n]),l=i.useStore($b);return $r(Qt.Root,{dir:"ltr",open:t,onOpenChange:s,children:[dt(Qt.Trigger,{dir:"ltr",asChild:!0,id:"TD-Page",children:dt(xt,{variant:"text",children:l||o.formatMessage({id:"page"})})}),dt(wn,{variant:"menu",align:"start",sideOffset:4,children:t&&dt(jb,{onClose:r})})]})}function jb({onClose:i}){let o=N(),e=zp(),t=o.useStore(Ob),n=o.useStore(Gb),r=e.formatMessage({id:"page"}),s=bt.useCallback(()=>{let f=r+" "+(Object.keys(o.document.pages).length+1);o.createPage(void 0,f)},[o]),l=bt.useCallback(f=>{i(),o.changePage(f)},[o]),[a,c]=bt.useState(null),[p,u]=bt.useState(null),h=bt.useCallback(f=>{c(f.currentTarget.id),u(t.findIndex(v=>v.id===f.currentTarget.id)),f.dataTransfer.effectAllowed="move"},[]),g=bt.useCallback(f=>{f.preventDefault();let v=t.findIndex(y=>y.id===f.currentTarget.id),b=f.currentTarget.getBoundingClientRect();v=(f.clientY-b.top)/b.height<.5?v:v+1,u(v)},[a,t]),m=bt.useCallback(()=>{a!==null&&p!==null&&o.movePage(a,p),c(null),u(null)},[a,p]);return $r(Ub,{children:[dt(Qt.RadioGroup,{dir:"ltr",value:n,onValueChange:l,children:t.map((f,v)=>$r(Wb,{isDropAbove:v===p&&v===0,isDropBelow:p!==null&&v===p-1,children:[dt(Qt.RadioItem,{title:f.name||r,value:f.id,id:f.id,asChild:!0,onDragOver:g,onDragStart:h,onDrop:m,draggable:!0,children:$r(Nb,{children:[dt("span",{id:f.id,children:f.name||r}),dt(Qt.ItemIndicator,{children:dt(Rt,{children:dt(Hb,{})})})]})},f.id),dt(Hp,{page:f,onClose:i})]},f.id))}),dt(ve,{}),dt(Qt.Item,{onSelect:s,asChild:!0,children:$r(Je,{children:[dt("span",{children:dt(Fb,{id:"create.page"})}),dt(Rt,{children:dt(zb,{})})]})})]})}var Wb=P("div",{position:"relative",display:"grid",gridTemplateColumns:"1fr auto",gridAutoFlow:"column",margin:0,'& > *[data-shy="true"]':{opacity:0},'&:hover > *[data-shy="true"]':{opacity:1},variants:{isDropAbove:{true:{"&::after":{content:"",display:"block",position:"absolute",top:0,width:"100%",height:"1px",backgroundColor:"$selected",zIndex:999,pointerEvents:"none"}}},isDropBelow:{true:{"&::after":{content:"",display:"block",position:"absolute",width:"100%",height:"1px",top:"100%",backgroundColor:"$selected",zIndex:999,pointerEvents:"none"}}}}}),Nb=P(Je,{minWidth:128});import*as uo from"@radix-ui/react-dropdown-menu";import{TextAlignCenterIcon as Kb,TextAlignJustifyIcon as _b,TextAlignLeftIcon as Yb,TextAlignRightIcon as Xb}from"@radix-ui/react-icons";import*as vt from"react";import{FormattedMessage as po,useIntl as Zb}from"react-intl";import{Fragment as lv,jsx as le,jsxs as Pn}from"react/jsx-runtime";var qb=i=>i.appState.currentStyle,Jb=i=>i.document.pageStates[i.appState.currentPageId].selectedIds,Qb=Object.keys(Oo),Op={["draw"]:le(gl,{}),["solid"]:le(Sl,{}),["dashed"]:le(pl,{}),["dotted"]:le(hl,{})},ev={["small"]:le(vl,{}),["medium"]:le(xl,{}),["large"]:le(Cl,{})},tv={["start"]:le(Yb,{}),["middle"]:le(Kb,{}),["end"]:le(Xb,{}),["justify"]:le(_b,{})},nv=i=>i.settings.isDarkMode?"dark":"light",ov=i=>i.settings.keepStyleMenuOpen,rv=i=>{let{activeTool:o,currentPageId:e}=i.appState;switch(o){case"select":{let t=i.document.pages[e],n=!1,r=!1;for(let s of i.document.pageStates[e].selectedIds)"text"in t.shapes[s]&&(n=!0),"label"in t.shapes[s]&&(r=!0);return n?"text":r?"label":""}case"text":return"text";case"rectangle":return"label";case"ellipse":return"label";case"triangle":return"label";case"arrow":return"label";case"line":return"label"}return!1},$p=vt.memo(function(){let o=N(),e=Zb(),t=o.useStore(nv),n=o.useStore(ov),r=o.useStore(rv),s=o.useStore(qb),l=o.useStore(Jb),[a,c]=vt.useState(s),p=vt.useRef(s);vt.useEffect(()=>{let{appState:{currentStyle:T},page:y,selectedIds:x}=o,I={};if(x.length<=0)I=T;else{let k=new Set([]);o.selectedIds.map(R=>y.shapes[R]).forEach(R=>{Qb.forEach(C=>{if(!k.has(C))if(I[C]===void 0)I[C]=R.style[C];else{if(I[C]===R.style[C])return;I[C]=R.style[C],k.add(C)}})})}JSON.stringify(I)!==JSON.stringify(p.current)&&(p.current=I,c(I))},[s,l]);let u=vt.useCallback(T=>{o.setSetting("keepStyleMenuOpen",T)},[]),h=vt.useCallback(T=>{o.style({isFilled:T})},[]),g=vt.useCallback(T=>{o.style({dash:T})},[]),m=vt.useCallback(T=>{o.style({size:T})},[]),f=vt.useCallback(T=>{o.style({font:T})},[]),v=vt.useCallback(T=>{o.style({textAlign:T})},[]),b=vt.useCallback(T=>{o.setMenuOpen(T)},[o]);return Pn(uo.Root,{dir:"ltr",onOpenChange:b,open:n?!0:void 0,modal:!1,children:[le(uo.Trigger,{asChild:!0,id:"TD-Styles",children:Pn(xt,{"aria-label":e.formatMessage({id:"styles"}),variant:"text",children:[le(po,{id:"styles"}),Pn(sv,{style:{color:zn[t][a.color]},children:[a.isFilled&&le(Es,{size:16,stroke:"none",fill:yo[t][a.color]}),Op[a.dash]]})]})}),Pn(wn,{id:"TD-StylesMenu",side:"bottom",align:"end",sideOffset:4,alignOffset:4,children:[Pn(Gr,{variant:"tall",id:"TD-Styles-Color-Container",children:[le("span",{children:le(po,{id:"style.menu.color"})}),le(iv,{children:Object.keys(zn.light).map(T=>le(uo.Item,{onSelect:ke,asChild:!0,id:`TD-Styles-Color-Swatch-${T}`,children:le(xt,{variant:"icon",isActive:a.color===T,onClick:()=>o.style({color:T}),"aria-label":e.formatMessage({id:T}),children:le(Es,{size:18,strokeWidth:2.5,fill:a.isFilled?yo[t][T]:"transparent",stroke:zn.light[T]})})},T))})]}),le(qt,{variant:"styleMenu",checked:!!a.isFilled,onCheckedChange:h,id:"TD-Styles-Fill",children:le(po,{id:"style.menu.fill"})}),Pn(Gr,{id:"TD-Styles-Dash-Container",children:[le(po,{id:"style.menu.dash"}),le(ss,{dir:"ltr",value:a.dash,onValueChange:g,children:Object.values(on).map(T=>le(Or,{isActive:T===a.dash,value:T,onSelect:ke,bp:nn,id:`TD-Styles-Dash-${T}`,"aria-label":e.formatMessage({id:T}),children:Op[T]},T))})]}),Pn(Gr,{id:"TD-Styles-Size-Container",children:[le(po,{id:"style.menu.size"}),le(ss,{dir:"ltr",value:a.size,onValueChange:m,children:Object.values(si).map(T=>le(Or,{isActive:T===a.size,value:T,onSelect:ke,bp:nn,id:`TD-Styles-Dash-${T}`,"aria-label":e.formatMessage({id:T}),children:ev[T]},T))})]}),(r==="text"||r==="label")&&Pn(lv,{children:[le(ve,{}),Pn(Gr,{id:"TD-Styles-Font-Container",children:[le(po,{id:"style.menu.font"}),le(ss,{dir:"ltr",value:a.font,onValueChange:f,children:Object.values(Bo).map(T=>le(Or,{isActive:T===a.font,value:T,onSelect:ke,bp:nn,id:`TD-Styles-Font-${T}`,children:le(av,{fontStyle:T,children:"Aa"})},T))})]}),r==="text"&&Pn(Gr,{id:"TD-Styles-Align-Container",children:[le(po,{id:"style.menu.align"}),le(ss,{dir:"ltr",value:a.textAlign,onValueChange:v,children:Object.values(zt).map(T=>le(Or,{isActive:T===a.textAlign,value:T,onSelect:ke,bp:nn,id:`TD-Styles-Align-${T}`,children:tv[T]},T))})]})]}),le(ve,{}),le(qt,{variant:"styleMenu",checked:n,onCheckedChange:u,id:"TD-Styles-Keep-Open",children:le(po,{id:"style.menu.keep.open"})})]})]})}),iv=P("div",{display:"grid",gridTemplateColumns:"repeat(4, auto)",gap:0}),Gr=P("div",{position:"relative",width:"100%",background:"none",border:"none",cursor:"pointer",minHeight:"32px",outline:"none",color:"$text",fontFamily:"$ui",fontWeight:400,fontSize:"$1",padding:"$2 0 $2 $3",borderRadius:4,userSelect:"none",WebkitUserSelect:"none",margin:0,display:"flex",gap:"$3",flexDirection:"row",alignItems:"center",justifyContent:"space-between",variants:{variant:{tall:{alignItems:"flex-start",padding:"0 0 0 $3","& > span":{paddingTop:"$4"}}}}}),ss=P(uo.DropdownMenuRadioGroup,{display:"flex",flexDirection:"row",gap:"$1"}),sv=P("div",{display:"grid","& > *":{gridColumn:1,gridRow:1}}),av=P("div",{width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"$3",variants:{fontStyle:{["script"]:{fontFamily:"Caveat Brush"},["sans"]:{fontFamily:"Recursive"},["serif"]:{fontFamily:"Georgia"},["mono"]:{fontFamily:"Recursive Mono"}}}});import*as ls from"@radix-ui/react-dropdown-menu";import{FormattedMessage as jr}from"react-intl";import{jsx as Rn,jsxs as as}from"react/jsx-runtime";var dv=i=>i.document.pageStates[i.appState.currentPageId].camera.zoom,Gp=function(){let o=N(),e=o.useStore(dv);return as(ls.Root,{dir:"ltr",children:[Rn(ls.Trigger,{dir:"ltr",asChild:!0,id:"TD-Zoom",children:as(cv,{onDoubleClick:o.resetZoom,variant:"text",children:[Math.round(e*100),"%"]})}),as(wn,{align:"end",children:[Rn(ce,{onSelect:ke,onClick:o.zoomIn,kbd:"#+",id:"TD-Zoom-Zoom_In",children:Rn(jr,{id:"zoom.in"})}),Rn(ce,{onSelect:ke,onClick:o.zoomOut,kbd:"#\u2212",id:"TD-Zoom-Zoom_Out",children:Rn(jr,{id:"zoom.out"})}),as(ce,{onSelect:ke,onClick:o.resetZoom,kbd:"\u21E70",id:"TD-Zoom-Zoom_To_100%",children:[Rn(jr,{id:"zoom.to"})," 100%"]}),Rn(ce,{onSelect:ke,onClick:o.zoomToFit,kbd:"\u21E71",id:"TD-Zoom-To_Fit",children:Rn(jr,{id:"zoom.to.fit"})}),Rn(ce,{onSelect:ke,onClick:o.zoomToSelection,kbd:"\u21E72",id:"TD-Zoom-To_Selection",children:Rn(jr,{id:"zoom.to.selection"})})]})]})},cv=P(xt,{minWidth:56});import{Fragment as fv,jsx as hn,jsxs as ds}from"react/jsx-runtime";function uv({readOnly:i,showPages:o,showMenu:e,showStyles:t,showZoom:n,showMultiplayerMenu:r}){let s=N(),l=pv();return ds(hv,{children:[(e||o)&&ds(mr,{side:"left",id:"TD-MenuPanel",children:[e&&hn(Pp,{readOnly:i}),r&&hn(Lp,{}),o&&hn(Fp,{})]}),hn(mv,{}),(t||n)&&ds(mr,{side:"right",children:[s.readOnly?hn(gv,{children:"Read Only"}):ds(fv,{children:[hn(Gs,{kbd:"#Z",label:l.formatMessage({id:"undo"}),onClick:s.undo,id:"TD-TopPanel-Undo","aria-label":l.formatMessage({id:"undo"}),children:hn(Bs,{})}),hn(Gs,{kbd:"#\u21E7Z",label:l.formatMessage({id:"redo"}),onClick:s.redo,id:"TD-TopPanel-Redo","aria-label":l.formatMessage({id:"redo"}),children:hn(Bs,{flipHorizontal:!0})})]}),n&&hn(Gp,{}),t&&!i&&hn($p,{})]})]})}var hv=P("div",{width:"100%",position:"absolute",top:0,left:0,right:0,display:"flex",flexDirection:"row",pointerEvents:"none","& > *":{pointerEvents:"all"}}),mv=P("div",{flexGrow:2,pointerEvents:"none"}),gv=P("div",{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"$ui",fontSize:"$1",paddingLeft:"$4",paddingRight:"$1",userSelect:"none",WebkitUserSelect:"none"}),Wp=jp.memo(uv);import Sv from"react";function Np(i){Sv.useEffect(()=>{let o=!1,e=!1,t=i.current;if(!t)return;let n=a=>{a.key===" "&&!e&&(e=!0,o?t.setAttribute("style","cursor: grabbing !important"):t.setAttribute("style","cursor: grab !important"))},r=a=>{a.key===" "&&(e=!1,t.setAttribute("style","cursor: initial"))},s=a=>{o=!0,a.button===1&&t.setAttribute("style","cursor: grabbing !important"),a.button===0&&e&&t.setAttribute("style","cursor: grabbing !important")},l=()=>{o=!1,e?t.setAttribute("style","cursor: grab !important"):t.setAttribute("style","cursor: initial")};return t.addEventListener("keydown",n),t.addEventListener("keyup",r),t.addEventListener("pointerdown",s),t.addEventListener("pointerup",l),()=>{t.removeEventListener("keydown",n),t.removeEventListener("keyup",r),t.removeEventListener("pointerdown",s),t.removeEventListener("pointerup",l)}},[i.current])}import{Utils as ct}from"telva-core";import{Vec as se}from"telva-vec";import{del as d5,get as yv,set as bv}from"idb-keyval";var Up="telva_clipboard";function Kp(){return z(this,null,function*(){return yv(Up)})}function _p(i){return z(this,null,function*(){return bv(Up,i)})}import*as Io from"idb-keyval";import{Utils as vv}from"telva-core";import Tv from"zustand";import xv from"zustand/vanilla";var cs=class{constructor(o,e,t,n){d(this,"_idbId");d(this,"initialState");d(this,"store");d(this,"pointer",-1);d(this,"_state");d(this,"_status","loading");d(this,"stack",[]);d(this,"_snapshot");d(this,"useStore");d(this,"ready");d(this,"isPaused",!1);d(this,"persist",(o,e)=>{if(this._status==="ready"&&(this.onPersist&&this.onPersist(this._state,o,e),this._idbId))return Io.set(this._idbId,this._state).catch(t=>console.error(t))});d(this,"applyPatch",(o,e)=>{let t=this._state,n=vv.deepMerge(this._state,o),r=this.cleanup(n,t,o,e);return this.onStateWillChange&&this.onStateWillChange(r,e),this._state=r,this.store.setState(this._state,!0),this.onStateDidChange&&this.onStateDidChange(this._state,e),this});d(this,"migrate",o=>o);d(this,"cleanup",(o,e,t,n)=>o);d(this,"onStateWillChange");d(this,"onStateDidChange");d(this,"patchState",(o,e)=>(this.applyPatch(o,e),this.onPatch&&this.onPatch(this._state,o,e),this));d(this,"replaceState",(o,e)=>{let t=this.cleanup(o,this._state,o,e);return this.onStateWillChange&&this.onStateWillChange(t,"replace"),this._state=t,this.store.setState(this._state,!0),this.onStateDidChange&&this.onStateDidChange(this._state,"replace"),this});d(this,"setState",(o,e=o.id)=>(this.pointer<this.stack.length-1&&(this.stack=this.stack.slice(0,this.pointer+1)),this.stack.push(w(S({},o),{id:e})),this.pointer=this.stack.length-1,this.applyPatch(o.after,e),this.onCommand&&this.onCommand(this._state,o,e),this.persist(o.after,e),this));d(this,"onReady");d(this,"onPatch");d(this,"onCommand");d(this,"onPersist");d(this,"onReplace");d(this,"onReset");d(this,"onResetHistory");d(this,"onUndo");d(this,"onRedo");d(this,"reset",()=>(this.onStateWillChange&&this.onStateWillChange(this.initialState,"reset"),this._state=this.initialState,this.store.setState(this._state,!0),this.resetHistory(),this.persist({},"reset"),this.onStateDidChange&&this.onStateDidChange(this._state,"reset"),this.onReset&&this.onReset(this._state),this));d(this,"replaceHistory",(o,e=o.length-1)=>(this.stack=o,this.pointer=e,this.onReplace&&this.onReplace(this._state),this));d(this,"resetHistory",()=>(this.stack=[],this.pointer=-1,this.onResetHistory&&this.onResetHistory(this._state),this));d(this,"undo",()=>{if(!this.isPaused){if(!this.canUndo)return this;let o=this.stack[this.pointer];this.pointer--,this.applyPatch(o.before,"undo"),this.persist(o.before,"undo")}return this.onUndo&&this.onUndo(this._state),this});d(this,"redo",()=>{if(!this.isPaused){if(!this.canRedo)return this;this.pointer++;let o=this.stack[this.pointer];this.applyPatch(o.after,"redo"),this.persist(o.after,"undo")}return this.onRedo&&this.onRedo(this._state),this});d(this,"setSnapshot",()=>(this._snapshot=S({},this._state),this));d(this,"forceUpdate",()=>{this.store.setState(this._state,!0)});this._idbId=e,this._state=it(o),this._snapshot=it(o),this.initialState=it(o),this.store=xv(()=>this._state),this.useStore=Tv(this.store),this.ready=new Promise(r=>{let s="none";this._idbId?(s="restored",Io.get(this._idbId).then(l=>z(this,null,function*(){if(l){let a=l;if(t){let p=yield Io.get(e+"_version");p&&p<t&&(a=n?n(l,o,p):o,s="migrated")}yield Io.set(e+"_version",t||-1);let c=this._state.appState.isEmptyCanvas;a=this.migrate(a),this._state=it(a),this._snapshot=it(a),this._state.appState.isEmptyCanvas=c,this.store.setState(this._state,!0)}else yield Io.set(e+"_version",t||-1);this._status="ready",r(s)})).catch(l=>console.error(l))):(this._status="ready",r(s))}).then(r=>(this.onReady&&this.onReady(r),r))}pause(){this.isPaused=!0}resume(){this.isPaused=!1}get canUndo(){return this.pointer>-1}get canRedo(){return this.pointer<this.stack.length-1}get state(){return this._state}get status(){return this._status}get snapshot(){return this._snapshot}};import{Utils as kv}from"telva-core";import{Vec as Yp}from"telva-vec";function Xp(i,o,e){let{currentPageId:t}=i,n=o.map(h=>i.getShape(h)),r=n.map(h=>({id:h.id,point:[...h.point],bounds:B.getBounds(h)})),s=kv.getCommonBounds(r.map(({bounds:h})=>h)),l=s.minX+s.width/2,a=s.minY+s.height/2,c=Object.fromEntries(r.map(({id:h,point:g,bounds:m})=>[h,{prev:g,next:{["top"]:[g[0],s.minY],["centerVertical"]:[g[0],a-m.height/2],["bottom"]:[g[0],s.maxY-m.height],["left"]:[s.minX,g[1]],["centerHorizontal"]:[l-m.width/2,g[1]],["right"]:[s.maxX-m.width,g[1]]}[e]}])),{before:p,after:u}=B.mutateShapes(i.state,o,h=>c[h.id]?{point:c[h.id].next}:h,t,!1);return n.forEach(h=>{if(h.type==="group"){let g=Yp.sub(u[h.id].point,p[h.id].point);h.children.forEach(m=>{let f=i.getShape(m);p[f.id]={point:f.point},u[f.id]={point:Yp.add(f.point,g)}}),delete p[h.id],delete u[h.id]}}),{id:"align",before:{document:{pages:{[t]:{shapes:p}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:u}},pageStates:{[t]:{selectedIds:o}}}}}}function Zp(i,o){return{id:"change_page",before:{appState:{currentPageId:i.currentPageId}},after:{appState:{currentPageId:o}}}}import{Utils as Cv}from"telva-core";function qp(i,o){var n;let e=i,t=new Set(o);for(;t.has(e);)e=(n=/^.*(\d+)$/.exec(e))!=null&&n[1]?e.replace(/(\d+)(?=\D?)$/,r=>(+r+1).toString()):`${e} 1`;return e}function Jp(i,o,e){let t={shapes:{},bindings:{}},n={shapes:{},bindings:{}},r=[],s=new Set,l=new Set;o.filter(c=>!B.getShape(i,c,e).isLocked).forEach(c=>{s.add(c);let p=B.getShape(i,c,e);t.shapes[c]=p,n.shapes[c]=void 0,p.children!==void 0&&p.children.forEach(u=>{s.add(u);let h=B.getShape(i,u,e);t.shapes[u]=h,n.shapes[u]=void 0}),p.parentId!==e&&r.push(B.getShape(i,p.parentId,e)),p.assetId&&l.add(p.assetId)}),r.forEach(c=>{var p;o.includes(c.id)||(s.add(c.id),t.shapes[c.id]={children:c.children},n.shapes[c.id]={children:c.children.filter(u=>!o.includes(u))},((p=n.shapes[c.id])==null?void 0:p.children.length)===0&&(n.shapes[c.id]=void 0,t.shapes[c.id]=B.getShape(i,c.id,e)))});let a=B.getPage(i,e);return Object.values(a.bindings).filter(c=>s.has(c.fromId)||s.has(c.toId)).forEach(c=>{for(let p of[c.toId,c.fromId])if(n.shapes[p]===void 0){t.bindings[c.id]=c,n.bindings[c.id]=void 0;let u=a.shapes[p];u&&u.handles&&Object.values(u.handles).filter(h=>h.bindingId===c.id).forEach(h=>{var g,m,f,v,b,T;t.shapes[p]=w(S({},t.shapes[p]),{handles:w(S({},(g=t.shapes[p])==null?void 0:g.handles),{[h.id]:w(S({},(f=(m=t.shapes[p])==null?void 0:m.handles)==null?void 0:f[h.id]),{bindingId:c.id})})}),s.has(p)||(n.shapes[p]=w(S({},n.shapes[p]),{handles:w(S({},(v=n.shapes[p])==null?void 0:v.handles),{[h.id]:w(S({},(T=(b=n.shapes[p])==null?void 0:b.handles)==null?void 0:T[h.id]),{bindingId:void 0})})}))})}}),Object.values(i.document.pages).flatMap(c=>Object.values(c.shapes)).forEach(c=>{"assetId"in c&&c.assetId&&!s.has(c.id)&&l.delete(c.assetId)}),{before:t,after:n,assetsToRemove:Array.from(l)}}function Qp(i,o,e=Cv.uniqueId(),t="Page"){let{currentPageId:n}=i,r=Object.values(i.state.document.pages).sort((p,u)=>{var h,g;return((h=p.childIndex)!=null?h:0)-((g=u.childIndex)!=null?g:0)}),s=r[r.length-1],l=s!=null&&s.childIndex?(s==null?void 0:s.childIndex)+1:1,a={id:e,name:qp(t,r.map(p=>{var u;return(u=p.name)!=null?u:""})),childIndex:l,shapes:{},bindings:{}},c={id:e,selectedIds:[],camera:{point:o,zoom:1},editingId:void 0,bindingId:void 0,hoveredId:void 0,pointedId:void 0};return{id:"create_page",before:{appState:{currentPageId:n},document:{pages:{[e]:void 0},pageStates:{[e]:void 0}}},after:{appState:{currentPageId:a.id},document:{pages:{[e]:a},pageStates:{[e]:c}}}}}function Na(i,o,e=[]){let{currentPageId:t}=i,n={},r={};o.forEach(a=>{n[a.id]=void 0,r[a.id]=a});let s={},l={};return e.forEach(a=>{s[a.id]=void 0,l[a.id]=a}),{id:"create",before:{document:{pages:{[t]:{shapes:n,bindings:s}},pageStates:{[t]:{selectedIds:[...i.selectedIds]}}}},after:{document:{pages:{[t]:{shapes:r,bindings:l}},pageStates:{[t]:{selectedIds:o.map(a=>a.id)}}}}}}function eu(i,o){let{currentPageId:e,document:{pages:t,pageStates:n}}=i,r=Object.values(t).sort((a,c)=>(a.childIndex||0)-(c.childIndex||0)),s=r.findIndex(a=>a.id===o),l;return o===e?s===r.length-1?l=r[r.length-2].id:l=r[s+1].id:l=e,{id:"delete_page",before:{appState:{currentPageId:o},document:{pages:{[o]:S({},t[o])},pageStates:{[o]:S({},n[o])}}},after:{appState:{currentPageId:l},document:{pages:{[o]:void 0},pageStates:{[o]:void 0}}}}}var wv=(i,o)=>{let e=S({},i);return o.forEach(t=>e[t]=void 0),e};function Ua(i,o,e=i.currentPageId){let{pageState:t,selectedIds:n,document:{assets:r}}=i,{before:s,after:l,assetsToRemove:a}=Jp(i.state,o,e),c=wv(r,a);return{id:"delete",before:{document:{assets:r,pages:{[e]:s},pageStates:{[e]:{selectedIds:[...i.selectedIds]}}}},after:{document:{assets:c,pages:{[e]:l},pageStates:{[e]:{selectedIds:n.filter(p=>!o.includes(p)),hoveredId:t.hoveredId&&o.includes(t.hoveredId)?void 0:t.hoveredId}}}}}}import{Utils as Iv}from"telva-core";import tu from"telva-vec";function nu(i,o,e){let{currentPageId:t}=i,n=o.map(a=>i.getShape(a)),r=Object.fromEntries(Pv(n,e).map(a=>[a.id,a])),{before:s,after:l}=B.mutateShapes(i.state,o.filter(a=>r[a]!==void 0),a=>{var c;return{point:(c=r[a.id])==null?void 0:c.next}},t);return n.forEach(a=>{if(a.type==="group"){let c=tu.sub(l[a.id].point,s[a.id].point);a.children.forEach(p=>{let u=i.getShape(p);s[u.id]={point:u.point},l[u.id]={point:tu.add(u.point,c)}}),delete s[a.id],delete l[a.id]}}),{id:"distribute",before:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:l}},pageStates:{[t]:{selectedIds:o}}}}}}function Pv(i,o){let e=i.map(s=>{let l=B.getShapeUtil(s);return{id:s.id,point:[...s.point],bounds:l.getBounds(s),center:l.getCenter(s)}}),t=e.length,n=Iv.getCommonBounds(e.map(({bounds:s})=>s)),r=[];switch(o){case"horizontal":{let s=e.reduce((l,a)=>l+a.bounds.width,0);if(s>n.width){let l=e.sort((h,g)=>h.bounds.minX-g.bounds.minX)[0],a=e.sort((h,g)=>g.bounds.maxX-h.bounds.maxX)[0],c=e.filter(h=>h!==l&&h!==a).sort((h,g)=>h.center[0]-g.center[0]),p=(a.center[0]-l.center[0])/(t-1),u=l.center[0]+p;c.forEach(({id:h,point:g,bounds:m},f)=>{r.push({id:h,prev:g,next:[u+p*f-m.width/2,m.minY]})})}else{let l=e.sort((p,u)=>p.center[0]-u.center[0]),a=n.minX,c=(n.width-s)/(t-1);l.forEach(({id:p,point:u,bounds:h})=>{r.push({id:p,prev:u,next:[a,h.minY]}),a+=h.width+c})}break}case"vertical":{let s=e.reduce((l,a)=>l+a.bounds.height,0);if(s>n.height){let l=e.sort((h,g)=>h.bounds.minY-g.bounds.minY)[0],a=e.sort((h,g)=>g.bounds.maxY-h.bounds.maxY)[0],c=e.filter(h=>h!==l&&h!==a).sort((h,g)=>h.center[1]-g.center[1]),p=(a.center[1]-l.center[1])/(t-1),u=l.center[1]+p;c.forEach(({id:h,point:g,bounds:m},f)=>{r.push({id:h,prev:g,next:[m.minX,u+p*f-m.height/2]})})}else{let l=e.sort((p,u)=>p.center[1]-u.center[1]),a=n.minY,c=(n.height-s)/(t-1);l.forEach(({id:p,point:u,bounds:h})=>{r.push({id:p,prev:u,next:[h.minX,a]}),a+=h.height+c})}break}}return r}import{Utils as Wr}from"telva-core";function ou(i,o){let{currentPageId:e,pageState:{camera:t}}=i,n=i.document.pages[o],r=Wr.uniqueId(),s=Object.fromEntries([[n.id,r],...Object.keys(n.shapes).map(p=>[p,Wr.uniqueId()]),...Object.keys(n.bindings).map(p=>[p,Wr.uniqueId()])]),l=Object.fromEntries(Object.entries(n.shapes).map(([p,u])=>[s[p],w(S({},Wr.deepClone(u)),{id:s[p],parentId:s[u.parentId]})])),a=Object.fromEntries(Object.entries(n.bindings).map(([p,u])=>[s[p],w(S({},Wr.deepClone(u)),{id:s[u.id],fromId:s[u.fromId],toId:s[u.toId]})]));Object.values(n.bindings).forEach(p=>{let u=s[p.fromId],h=l[u].handles;h&&Object.values(h).forEach(f=>{f.bindingId===p.id&&(f.bindingId=s[p.id])});let g=s[p.toId],m=l[g].handles;m&&Object.values(m).forEach(f=>{f.bindingId===p.id&&(f.bindingId=s[p.id])})});let c=w(S({},n),{id:s[n.id],name:n.name+" Copy",shapes:l,bindings:a});return{id:"duplicate_page",before:{appState:{currentPageId:e},document:{pages:{[r]:void 0},pageStates:{[r]:void 0}}},after:{appState:{currentPageId:r},document:{pages:{[r]:c},pageStates:{[r]:w(S({},n),{id:r,selectedIds:[],camera:S({},t),editingId:void 0,bindingId:void 0,hoveredId:void 0,pointedId:void 0})}}}}}import{Utils as ho}from"telva-core";import{Vec as Ka}from"telva-vec";function ru(i,o,e){let{selectedIds:t,currentPageId:n,page:r,shapes:s}=i,l={shapes:{},bindings:{}},a={shapes:{},bindings:{}},c={},p=o.map(g=>i.getShape(g)).filter(g=>!o.includes(g.parentId));p.forEach(g=>{let m=ho.uniqueId();if(l.shapes[m]=void 0,a.shapes[m]=w(S({},ho.deepClone(g)),{id:m,childIndex:B.getChildIndexAbove(i.state,g.id,n)}),g.children&&(a.shapes[m].children=[]),g.parentId!==n){let f=i.getShape(g.parentId);l.shapes[f.id]=w(S({},l.shapes[f.id]),{children:f.children}),a.shapes[f.id]=w(S({},a.shapes[f.id]),{children:[...(a.shapes[f.id]||f).children,m]})}c[g.id]=m}),p.forEach(g=>{g.children&&g.children.forEach(m=>{var T,y;let f=i.getShape(m),v=ho.uniqueId(),b=c[g.id];l.shapes[v]=void 0,a.shapes[v]=w(S({},ho.deepClone(f)),{id:v,parentId:b,childIndex:B.getChildIndexAbove(i.state,f.id,n)}),c[m]=v,(y=(T=a.shapes[c[g.id]])==null?void 0:T.children)==null||y.push(v)})});let u=new Set(Object.keys(c));Object.values(r.bindings).filter(g=>u.has(g.fromId)||u.has(g.toId)).forEach(g=>{if(u.has(g.fromId))if(u.has(g.toId)){let m=ho.uniqueId(),f=w(S({},ho.deepClone(g)),{id:m,fromId:c[g.fromId],toId:c[g.toId]});l.bindings[m]=void 0,a.bindings[m]=f;let v=a.shapes[f.fromId];Object.values(v.handles).forEach(b=>{b.bindingId===g.id&&(b.bindingId=m)})}else{let m=a.shapes[c[g.fromId]];Object.values(m.handles).forEach(f=>{f.bindingId===g.id&&(f.bindingId=void 0)})}});let h=Object.values(a.shapes);if(e){let g=ho.getCommonBounds(h.map(f=>B.getBounds(f))),m=ho.getBoundsCenter(g);h.forEach(f=>{!f.point||(f.point=Ka.sub(e,Ka.sub(m,f.point)))})}else{let g=[16,16];h.forEach(m=>{!m.point||(m.point=Ka.add(m.point,g))})}return h.forEach(g=>{g.isLocked&&(g.isLocked=!1)}),{id:"duplicate",before:{document:{pages:{[n]:l},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:a},pageStates:{[n]:{selectedIds:Array.from(u.values()).map(g=>c[g])}}}}}}import{TLBoundsCorner as ps,Utils as Nr}from"telva-core";function _a(i,o,e){let{selectedIds:t,currentPageId:n,page:{shapes:r}}=i,s=o.map(u=>B.getBounds(r[u])),l=o.length===1&&r[o[0]].type==="group",a=Nr.getCommonBounds(s),{before:c,after:p}=B.mutateShapes(i.state,o,u=>{let h=B.getBounds(u),g=u.parentId!==n;switch(e){case"horizontal":{if(g&&!l){let f=B.getBounds(r[u.parentId]),b=Nr.getRelativeTransformedBoundingBox(a,a,f,!0,!1).minX-f.minX;return B.getShapeUtil(u).transform(u,w(S({},h),{minX:h.minX+b,maxX:h.maxX+b}),{type:ps.TopLeft,scaleX:1,scaleY:1,initialShape:u,transformOrigin:[.5,.5]})}let m=Nr.getRelativeTransformedBoundingBox(a,a,h,!0,!1);return B.getShapeUtil(u).transform(u,m,{type:ps.TopLeft,scaleX:-1,scaleY:1,initialShape:u,transformOrigin:[.5,.5]})}case"vertical":{if(g&&!l){let f=B.getBounds(r[u.parentId]),b=Nr.getRelativeTransformedBoundingBox(a,a,f,!1,!0).minY-f.minY;return B.getShapeUtil(u).transform(u,w(S({},h),{minY:h.minY+b,maxY:h.maxY+b}),{type:ps.TopLeft,scaleX:1,scaleY:1,initialShape:u,transformOrigin:[.5,.5]})}let m=Nr.getRelativeTransformedBoundingBox(a,a,h,!1,!0);return B.getShapeUtil(u).transform(u,m,{type:ps.TopLeft,scaleX:1,scaleY:-1,initialShape:u,transformOrigin:[.5,.5]})}}},n,!0);return{id:"flip",before:{document:{pages:{[n]:{shapes:c}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:p}},pageStates:{[n]:{selectedIds:o}}}}}}import{Utils as Rv}from"telva-core";function iu(i,o,e,t){var x,I;if(o.length<2)return;let n={},r={},s={},l={},a=[...o],c=[],p=[],u=[];for(let k of o){let R=i.getShape(k);if(!R.isLocked)if(R.children===void 0)c.push(R);else{let C=R.children.filter(E=>!i.getShape(E).isLocked);u.push(R),a.push(...C),c.push(...C.map(E=>i.getShape(E)).filter(Boolean))}}if(c.every(k=>k.parentId===c[0].parentId)&&c[0].parentId!==t&&((x=i.getShape(c[0].parentId).children)==null?void 0:x.length)===a.length)return;let h=B.flattenPage(i.state,t),g=Object.fromEntries(c.map(k=>[k.id,h.indexOf(k)])),m=c.sort((k,R)=>g[k.id]-g[R.id]),f=t,v=(m.filter(k=>k.parentId===t)[0]||m[0]).childIndex,b=Rv.getCommonBounds(c.map(k=>B.getBounds(k)));for(n[e]=void 0,r[e]=B.getShapeUtil("group").create({id:e,childIndex:v,parentId:f,point:[b.minX,b.minY],size:[b.width,b.height],children:m.map(k=>k.id)}),m.forEach((k,R)=>{if(k.parentId!==t){let C=i.getShape(k.parentId);u.push(C)}n[k.id]=w(S({},n[k.id]),{parentId:k.parentId,childIndex:k.childIndex}),r[k.id]=w(S({},r[k.id]),{parentId:e,childIndex:R+1})});u.length>0;){let k=u.pop();if(!k)break;let R=(((I=n[k.id])==null?void 0:I.children)||k.children).filter(C=>C&&!(a.includes(C)||p.includes(C)));R.length===0?(n[k.id]=k,r[k.id]=void 0,k.parentId!==t&&(p.push(k.id),u.push(i.getShape(k.parentId)))):(n[k.id]=w(S({},n[k.id]),{children:k.children}),r[k.id]=w(S({},r[k.id]),{children:R}))}let{bindings:T}=i,y=new Set(p);return T.forEach(k=>{for(let R of[k.toId,k.fromId])if(y.has(R)){s[k.id]=k,l[k.id]=void 0;let C=i.getShape(R);C.handles&&Object.values(C.handles).filter(E=>E.bindingId===k.id).forEach(E=>{var M,L;n[R]=w(S({},n[R]),{handles:w(S({},(M=n[R])==null?void 0:M.handles),{[E.id]:{bindingId:k.id}})}),p.includes(R)||(r[R]=w(S({},r[R]),{handles:w(S({},(L=r[R])==null?void 0:L.handles),{[E.id]:{bindingId:void 0}})}))})}}),{id:"group",before:{document:{pages:{[t]:{shapes:n,bindings:s}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:r,bindings:s}},pageStates:{[t]:{selectedIds:[e]}}}}}}import{Utils as Dv}from"telva-core";import{Vec as su}from"telva-vec";function au(i,o,e,t,n){let{page:r}=i,s={before:{shapes:{},bindings:{}},after:{shapes:{},bindings:{}}},l={before:{shapes:{},bindings:{}},after:{shapes:{},bindings:{}}},a=new Set,c=new Set;o.map(T=>i.getShape(T,t)).filter(T=>!T.isLocked).forEach(T=>{a.add(T.id),c.add(T),T.children!==void 0&&T.children.forEach(y=>{a.add(y),c.add(i.getShape(y,t))})});let p=B.getTopChildIndex(i.state,n),u=Array.from(c.values());u.forEach((T,y)=>{if(s.before.shapes[T.id]=T,s.after.shapes[T.id]=void 0,l.before.shapes[T.id]=void 0,l.after.shapes[T.id]=T,!a.has(T.parentId)&&(l.after.shapes[T.id]=w(S({},T),{parentId:n,childIndex:p+y}),T.parentId!==t)){let x=i.getShape(T.parentId,t);s.before.shapes[x.id]={children:x.children},s.after.shapes[x.id]={children:x.children.filter(I=>I!==T.id)}}}),Object.values(r.bindings).filter(T=>a.has(T.fromId)||a.has(T.toId)).forEach(T=>{s.before.bindings[T.id]=T,s.after.bindings[T.id]=void 0;let y=i.getShape(T.fromId,t);if(a.has(T.fromId)&&a.has(T.toId))l.before.bindings[T.id]=void 0,l.after.bindings[T.id]=T;else if(a.has(T.fromId)){let I=i.getShape(T.fromId,t),R=Object.values(y.handles).find(E=>E.bindingId===T.id).id,C=l.after.shapes[I.id];C.handles=w(S({},C.handles),{[R]:w(S({},C.handles[R]),{bindingId:void 0})})}else{let I=i.getShape(T.fromId,t),k=Object.values(y.handles).find(R=>R.bindingId===T.id);s.before.shapes[I.id]={handles:{[k.id]:{bindingId:T.id}}},s.after.shapes[I.id]={handles:{[k.id]:{bindingId:void 0}}}}});let h=i.state.document.pageStates[n],g=Dv.getCommonBounds(u.map(T=>B.getBounds(T))),m=B.getCameraZoom(e.width<e.height?(e.width-128)/g.width:(e.height-128)/g.height),f=(e.width-g.width*m)/2/m,v=(e.height-g.height*m)/2/m,b=su.toFixed(su.add([-g.minX,-g.minY],[f,v]));return{id:"move_to_page",before:{appState:{currentPageId:t},document:{pages:{[t]:s.before,[n]:l.before},pageStates:{[t]:{selectedIds:o},[n]:{selectedIds:h.selectedIds,camera:h.camera}}}},after:{appState:{currentPageId:n},document:{pages:{[t]:s.after,[n]:l.after},pageStates:{[t]:{selectedIds:[]},[n]:{selectedIds:o,camera:{zoom:m,point:b}}}}}}}function lu(i,o,e){let{pages:t}=i.document,n=t[o],r=Object.values(t).sort((a,c)=>{var p,u;return((p=a.childIndex)!=null?p:0)-((u=c.childIndex)!=null?u:0)}),s=r.indexOf(n),l=[...r];return l.splice(s,1),l.splice(e>s?e-1:e,0,n),{id:"move_page",before:{document:{pages:Object.fromEntries(r.map(a=>[a.id,{childIndex:a.childIndex}]))}},after:{document:{pages:Object.fromEntries(l.map((a,c)=>[a.id,{childIndex:c}]))}}}}function Ur(i,o,e){let{currentPageId:t,page:n}=i,r=new Set(o.map(p=>i.getShape(p).parentId)),s={before:{},after:{}},l,a,c;return Array.from(r.values()).forEach(p=>{let u=[];if(p===n.id)u=Object.values(n.shapes).sort((m,f)=>m.childIndex-f.childIndex);else{let m=i.getShape(p);if(!m.children)throw Error("No children in parent!");u=m.children.map(f=>i.getShape(f)).sort((f,v)=>f.childIndex-v.childIndex)}let h=u.map(m=>m.id),g=o.filter(m=>h.includes(m)).map(m=>h.indexOf(m)).sort((m,f)=>m-f);if(g.length!==h.length)switch(e){case"toBack":{for(let m=0;m<h.length;m++)if(!g.includes(m)){l=m;break}a=u[l].childIndex,c=a/(g.length+1),s=B.mutateShapes(i.state,g.map(m=>u[m].id).reverse(),(m,f)=>({childIndex:a-(f+1)*c}),t);break}case"toFront":{for(let m=h.length-1;m>=0;m--)if(!g.includes(m)){l=m;break}a=u[l].childIndex,c=1,s=B.mutateShapes(i.state,g.map(m=>u[m].id),(m,f)=>({childIndex:a+(f+1)}),t);break}case"backward":{let m={};for(let f=h.length-1;f>=0;f--)if(g.includes(f)){for(let v=f;v>=0;v--)if(!g.includes(v)){let b=u[v].childIndex,T,y;v===0?(T=b/2,y=b/2/(f-v+1)):(T=u[v-1].childIndex,y=(b-T)/(f-v+1),T+=y);for(let x=0;x<f-v;x++)m[u[v+x+1].id]=T+y*x;break}}Object.values(m).length>0&&(s=B.mutateShapes(i.state,g.map(f=>u[f].id),f=>({childIndex:m[f.id]}),t));break}case"forward":{let m={};for(let f=0;f<h.length;f++)if(g.includes(f)){for(let v=f;v<h.length;v++)if(!g.includes(v)){a=u[v].childIndex;let b=v===h.length-1?1:(u[v+1].childIndex-a)/(v-f+1);for(let T=0;T<v-f;T++)m[u[f+T].id]=a+b*(T+1);break}}Object.values(m).length>0&&(s=B.mutateShapes(i.state,g.map(f=>u[f].id),f=>({childIndex:m[f.id]}),t));break}}}),{id:"move",before:{document:{pages:{[t]:{shapes:s.before}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:s.after}},pageStates:{[t]:{selectedIds:o}}}}}}function du(i,o,e){let{page:t}=i;return{id:"rename_page",before:{document:{pages:{[o]:{name:t.name}}}},after:{document:{pages:{[o]:{name:e}}}}}}function Ya(i,o,e){let{currentPageId:t}=i,{before:n,after:r}=B.mutateShapes(i.state,o,s=>{var l,a;return(a=(l=i.getShapeUtil(s)).onDoubleClickBoundsHandle)==null?void 0:a.call(l,s)},e);return{id:"reset_bounds",before:{document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:r}},pageStates:{[t]:{selectedIds:o}}}}}}import{Utils as cu}from"telva-core";var Ev=Math.PI*2;function pu(i,o,e=-Ev/4){let{currentPageId:t}=i,n={},r={},s=o.flatMap(a=>{let c=i.getShape(a);return c.children?c.children.map(p=>i.getShape(p)):c}).filter(a=>!a.isLocked),l=cu.getBoundsCenter(cu.getCommonBounds(s.map(a=>B.getBounds(a))));return s.forEach(a=>{let c=B.getRotatedShapeMutation(a,B.getCenter(a),l,e);!c||(n[a.id]=B.getBeforeShape(a,c),r[a.id]=c)}),{id:"rotate",before:{document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:r}},pageStates:{[t]:{selectedIds:o}}}}}}import{TLBoundsCorner as uu,Utils as Bv}from"telva-core";function hu(i,o,e){let{currentPageId:t,selectedIds:n}=i,r=o.map(u=>i.getShape(u)),s=r.map(u=>B.getBounds(u)),l=Bv.getCommonBounds(s),a=o.flatMap(u=>{let h=i.getShape(u);return h.children?h.children:h.id}).filter(u=>!i.getShape(u).isLocked),{before:c,after:p}=B.mutateShapes(i.state,a,u=>{let h=B.getBounds(u);switch(e){case"horizontal":{let g=w(S({},h),{minX:l.minX,maxX:l.maxX,width:l.width});return B.getShapeUtil(u).transformSingle(u,g,{type:uu.TopLeft,scaleX:g.width/h.width,scaleY:1,initialShape:u,transformOrigin:[.5,.5]})}case"vertical":{let g=w(S({},h),{minY:l.minY,maxY:l.maxY,height:l.height});return B.getShapeUtil(u).transformSingle(u,g,{type:uu.TopLeft,scaleX:1,scaleY:g.height/h.height,initialShape:u,transformOrigin:[.5,.5]})}}},t);return r.forEach(u=>{u.type==="group"&&(delete c[u.id],delete p[u.id])}),{id:"stretch",before:{document:{pages:{[t]:{shapes:c}},pageStates:{[t]:{selectedIds:n}}}},after:{document:{pages:{[t]:{shapes:p}},pageStates:{[t]:{selectedIds:o}}}}}}import{Vec as Xa}from"telva-vec";function mu(i,o,e){let{currentPageId:t,selectedIds:n}=i,r=o.flatMap(a=>B.getDocumentBranch(i.state,a,t)).filter(a=>!i.getShape(a).isLocked),s={},l={};return r.map(a=>i.getShape(a)).filter(a=>!a.isLocked).forEach(a=>{s[a.id]={style:S({},Object.fromEntries(Object.keys(e).map(c=>[c,a.style[c]])))},l[a.id]={style:e},a.type==="text"&&(s[a.id].point=a.point,l[a.id].point=Xa.toFixed(Xa.add(a.point,Xa.sub(i.getShapeUtil(a).getCenter(a),i.getShapeUtil(a).getCenter(w(S({},a),{style:S(S({},a.style),e)}))))))}),{id:"style",before:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:n}}},appState:{currentStyle:S({},i.appState.currentStyle)}},after:{document:{pages:{[t]:{shapes:l}},pageStates:{[t]:{selectedIds:o}}},appState:{currentStyle:e}}}}function gu(i,o,e){let{currentPageId:t,selectedIds:n}=i,r=Object.fromEntries(o.map(l=>{var a;return[l,{decorations:{[e]:(a=i.getShape(l).decorations)==null?void 0:a[e]}}]})),s=Object.fromEntries(o.filter(l=>!i.getShape(l).isLocked).map(l=>{var a;return[l,{decorations:{[e]:(a=i.getShape(l).decorations)!=null&&a[e]?void 0:"arrow"}}]}));return{id:"toggle_decorations",before:{document:{pages:{[t]:{shapes:r}},pageStates:{[t]:{selectedIds:n}}}},after:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:o}}}}}}function us(i,o,e){let{currentPageId:t}=i,n=o.map(a=>i.getShape(a)).filter(a=>e==="isLocked"?!0:!a.isLocked),r=n.every(a=>a[e]),s={},l={};return n.forEach(a=>{s[a.id]={[e]:a[e]},l[a.id]={[e]:!r}}),{id:"toggle",before:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:l}},pageStates:{[t]:{selectedIds:o}}}}}}import{Vec as fu}from"telva-vec";function Su(i,o,e){let{currentPageId:t,selectedIds:n}=i;i.rotationInfo.selectedIds=[...n];let r={shapes:{},bindings:{}},s={shapes:{},bindings:{}},l=o.flatMap(p=>{let u=i.getShape(p);return u.children?u.children:u.id}).filter(p=>!i.getShape(p).isLocked),a=B.mutateShapes(i.state,l,p=>({point:fu.toFixed(fu.add(p.point,e))}),t);return r.shapes=a.before,s.shapes=a.after,B.getBindings(i.state,t).filter(p=>o.includes(p.fromId)&&!o.includes(p.toId)).forEach(p=>{r.bindings[p.id]=p,s.bindings[p.id]=void 0;for(let u of[p.toId,p.fromId]){let h=i.getShape(u);!h.handles||Object.values(h.handles).filter(g=>g.bindingId===p.id).forEach(g=>{var m,f;r.shapes[u]=w(S({},r.shapes[u]),{handles:w(S({},(m=r.shapes[u])==null?void 0:m.handles),{[g.id]:{bindingId:p.id}})}),s.shapes[u]=w(S({},s.shapes[u]),{handles:w(S({},(f=s.shapes[u])==null?void 0:f.handles),{[g.id]:{bindingId:void 0}})})})}}),{id:"translate",before:{document:{pages:{[t]:r},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:s},pageStates:{[t]:{selectedIds:o}}}}}}function yu(i,o,e,t){let{bindings:n}=i,r={},s={},l={},a={},c=o,p=o.filter(u=>!e.find(h=>h.id===u));return e.filter(u=>!u.isLocked).forEach(u=>{let h=[],g=[];r[u.id]=u,s[u.id]=void 0,u.children.forEach(T=>{p.push(T);let y=i.getShape(T,t);h.push(y)});let m=u.childIndex,v=(B.getChildIndexAbove(i.state,u.id,t)-m)/h.length;h.sort((T,y)=>T.childIndex-y.childIndex).forEach((T,y)=>{r[T.id]={parentId:T.parentId,childIndex:T.childIndex},s[T.id]={parentId:t,childIndex:m+v*y}}),n.filter(T=>T.toId===u.id||T.fromId===u.id).forEach(T=>{for(let y of[T.toId,T.fromId])if(s[y]===void 0){l[T.id]=T,a[T.id]=void 0;let x=i.getShape(y,t);x.handles&&Object.values(x.handles).filter(I=>I.bindingId===T.id).forEach(I=>{var k,R;r[y]=w(S({},r[y]),{handles:w(S({},(k=r[y])==null?void 0:k.handles),{[I.id]:{bindingId:T.id}})}),g.includes(y)||(s[y]=w(S({},s[y]),{handles:w(S({},(R=s[y])==null?void 0:R.handles),{[I.id]:{bindingId:void 0}})}))})}})}),{id:"ungroup",before:{document:{pages:{[t]:{shapes:r,bindings:l}},pageStates:{[t]:{selectedIds:c}}}},after:{document:{pages:{[t]:{shapes:s,bindings:l}},pageStates:{[t]:{selectedIds:p}}}}}}function Za(i,o,e){let t=o.map(r=>r.id),n=B.mutateShapes(i.state,t.filter(r=>!i.getShape(r,e).isLocked),(r,s)=>o[s],e);return{id:"update",before:{document:{pages:{[e]:{shapes:n.before}}}},after:{document:{pages:{[e]:{shapes:n.after}}}}}}function bu(i,o,e){let{currentPageId:t,selectedIds:n}=i,r=o.map(c=>i.getShape(c)).filter(c=>e.isLocked?!0:!c.isLocked),s={},l={},a=Object.keys(e);return r.forEach(c=>{s[c.id]=Object.fromEntries(a.map(p=>[p,c[p]])),l[c.id]=e}),{id:"set_props",before:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:n}}}},after:{document:{pages:{[t]:{shapes:l}},pageStates:{[t]:{selectedIds:n}}}}}}import{Utils as en}from"telva-core";import{Vec as Xo}from"telva-vec";function vu(i,o,e={}){let{currentPageId:t}=i,{point:n,select:r,overwrite:s}=e,l=i.document.pages[t],a={shapes:{},bindings:{}},c={},p={shapes:{},bindings:{}};if(s){for(let h of o.shapes)a.shapes[h.id]=l.shapes[h.id],p.shapes[h.id]=h;if(o.bindings)for(let h of o.bindings)a.bindings[h.id]=l.bindings[h.id],p.bindings[h.id]=h;if(o.assets)for(let h of o.assets)c[h.id]=h}else{let h={},g=B.getTopChildIndex(i.state,t),m=o.shapes.sort((b,T)=>b.childIndex-T.childIndex).map(b=>{let T=en.uniqueId();return h[b.id]=T,w(S({},en.deepClone(b)),{id:T})}),f=new Set;for(;m.length>0;){let b=m.shift();if(!b)break;if(f.add(b.id),b.parentId==="currentPageId")b.parentId=t,b.childIndex=g++;else{b.parentId=h[b.parentId];let T=p.shapes[b.parentId];if(!T){f.has(b.id)&&(b.parentId="currentPageId"),m.push(b);continue}T.children.push(b.id)}b.children&&(b.children=[]),a.shapes[b.id]=void 0,p.shapes[b.id]=b}Object.values(p.shapes).forEach(b=>{b.children&&b.children.length===0&&(delete a.shapes[b.id],delete p.shapes[b.id])}),o.bindings&&o.bindings.forEach(b=>{let T=en.uniqueId();h[b.id]=T;let y=h[b.toId],x=h[b.fromId];if(!y||!x){if(x){let C=p.shapes[x].handles;C&&Object.values(C).forEach(E=>{E.bindingId===b.id&&(E.bindingId=void 0)})}if(y){let C=p.shapes[y].handles;C&&Object.values(C).forEach(E=>{E.bindingId===b.id&&(E.bindingId=void 0)})}return}let I=p.shapes[x].handles;I&&Object.values(I).forEach(C=>{C.bindingId===b.id&&(C.bindingId=T)}),p.shapes[y].handles&&Object.values(p.shapes[y].handles).forEach(C=>{C.bindingId===b.id&&(C.bindingId=T)});let R=w(S({},en.deepClone(b)),{id:T,toId:y,fromId:x});a.bindings[R.id]=void 0,p.bindings[R.id]=R});let v=Object.values(p.shapes);if(v.length>0)if(n){let b=en.getCommonBounds(v.map(y=>B.getBounds(y))),T=en.getBoundsCenter(b);v.forEach(y=>{!y.point||(y.point=Xo.sub(n,Xo.sub(T,y.point)))})}else{let b=en.getCommonBounds(v.map(B.getBounds));if(!(en.boundsContain(i.viewport,b)||en.boundsCollide(i.viewport,b))){let T=Xo.toFixed(i.getPagePoint(i.centerPoint)),y=en.centerBounds(b,T),x=Xo.sub(en.getBoundsCenter(y),en.getBoundsCenter(b));v.forEach(I=>{I.point=Xo.toFixed(Xo.add(I.point,x))})}}if(o.assets)for(let b of o.assets)c[b.id]=b}let u=document.createElement("textarea");return Object.values(p.shapes).forEach(h=>{"text"in h&&(u.innerHTML=h.text,h.text=u.value),"label"in h&&(u.innerHTML=h.label,h.label=u.value)}),u.remove(),{id:"insert",before:{document:{pages:{[t]:a},pageStates:{[t]:{selectedIds:[...i.selectedIds]}}}},after:{document:{pages:{[t]:p},assets:c,pageStates:{[t]:{selectedIds:r?Object.keys(p.shapes):[...i.selectedIds]}}}}}}var Zo={};ll(Zo,{fileToBase64:()=>el,fileToText:()=>tl,getImageSizeFromSrc:()=>nl,getVideoSizeFromSrc:()=>ol,loadFileHandle:()=>qa,migrate:()=>Dn,openAssetsFromFileSystem:()=>Qa,openFromFileSystem:()=>Ja,saveFileHandle:()=>hs,saveToFileSystem:()=>ms,tldrawFileToTVDocument:()=>Cu,tvDocumentToTldrawFile:()=>ku});function Dn(i,o){let{document:e,settings:t}=i,{version:n=0}=e;"assets"in e||(e.assets={});let r=new Set;return Object.values(e.pages).forEach(s=>Object.values(s.shapes).forEach(l=>{let{parentId:a,children:c,assetId:p}=l;p&&r.add(p),a!==s.id&&!s.shapes[a]&&(console.warn("Encountered a shape with a missing parent!"),l.parentId=s.id),l.type==="group"&&c&&c.forEach(u=>{s.shapes[u]||(console.warn("Encountered a parent with a missing child!",l.id,u),c==null||c.splice(c.indexOf(u),1))})})),Object.keys(e.assets).forEach(s=>{r.has(s)||delete e.assets[s]}),n!==o&&(n<14&&Object.values(e.pages).forEach(s=>{Object.values(s.shapes).filter(l=>l.type==="text").forEach(l=>l.style.font==="script")}),n<=13&&Object.values(e.pages).forEach(s=>{Object.values(s.bindings).forEach(l=>{Object.assign(l,l.meta)}),Object.values(s.shapes).forEach(l=>{Object.entries(l.style).forEach(([a,c])=>{typeof c=="string"&&(l.style[a]=c.toLowerCase())}),l.type==="arrow"&&l.decorations&&Object.entries(l.decorations).forEach(([a,c])=>{c==="Arrow"&&(l.decorations=w(S({},l.decorations),{[a]:"arrow"}))})})}),n<=13.1&&(e.name="New Document"),n<15&&(e.assets={}),Object.values(e.pages).forEach(s=>{Object.values(s.shapes).forEach(l=>{n<15.2&&(l.type==="image"||l.type==="video")&&(l.style.isFilled=!0),n<15.3&&(l.type==="rectangle"||l.type==="triangle"||l.type==="ellipse"||l.type==="arrow")&&(l.label=l.text||"",l.labelPoint=[.5,.5])})}),n<15.4&&(t.dockPosition="bottom"),n<15.5&&(t.exportBackground="transparent")),Object.values(e.pageStates).forEach(s=>{s.selectedIds=s.selectedIds.filter(l=>e.pages[s.id].shapes[l]!==void 0),s.bindingId=void 0,s.editingId=void 0,s.hoveredId=void 0,s.pointedId=void 0}),Object.values(e.pages).forEach(s=>{Object.values(s.shapes).forEach(l=>{var a,c,p,u,h,g,m,f,v,b,T,y;if(l.type==="arrow"){let x=l;if(!x.handles||!x.handles.start||!x.handles.end||!x.handles.bend){let I=(p=(c=(a=x.handles)==null?void 0:a.start)==null?void 0:c.point)!=null?p:[0,0],k=(g=(h=(u=x.handles)==null?void 0:u.end)==null?void 0:h.point)!=null?g:[100,0],R=(v=(f=(m=x.handles)==null?void 0:m.bend)==null?void 0:f.point)!=null?v:[(I[0]+k[0])/2,(I[1]+k[1])/2];x.handles={start:S({id:"start",index:0,point:I,canBind:!0},(b=x.handles)==null?void 0:b.start),bend:S({id:"bend",index:1,point:R},(T=x.handles)==null?void 0:T.bend),end:S({id:"end",index:2,point:k,canBind:!0},(y=x.handles)==null?void 0:y.end)}}typeof x.bend!="number"&&(x.bend=0)}})}),e.version=o,i}import{fileOpen as xu,fileSave as Lv,supported as Av}from"browser-fs-access";import{get as Vv,set as Hv}from"idb-keyval";var Tu={mode:"readwrite"},zv=i=>z(void 0,null,function*(){return(yield i.queryPermission(Tu))==="granted"||(yield i.requestPermission(Tu))==="granted"});function qa(){return z(this,null,function*(){if(typeof Window=="undefined"||!("_location"in Window))return;let i=yield Vv(`Telva_file_handle_${window.location.origin}`);return i||null})}function hs(i){return z(this,null,function*(){return Hv(`Telva_file_handle_${window.location.origin}`,i)})}var Fv={schemaVersion:1,storeVersion:4,recordVersions:{asset:{version:1,subTypeKey:"type",subTypeVersions:{image:2,video:2,bookmark:0}},camera:{version:1},document:{version:2},instance:{version:22},instance_page_state:{version:5},page:{version:1},shape:{version:3,subTypeKey:"type",subTypeVersions:{}},instance_presence:{version:5},pointer:{version:1}}};function ku(i){var t,n,s,l,a,c;let o=[];o.push({gridSize:10,name:i.name||"",meta:{},id:"document:document",typeName:"document",telvaDocument:i});let e=0;for(let p of Object.keys(i.pages)){let u=i.pages[p],h=i.pageStates[p],g=`a${e+1}`;o.push({meta:{},id:`page:${p}`,name:u.name||`Page ${e+1}`,index:g,typeName:"page"}),o.push({editingShapeId:null,croppingShapeId:null,selectedShapeIds:(t=h==null?void 0:h.selectedIds)!=null?t:[],hoveredShapeId:null,erasingShapeIds:[],hintingShapeIds:[],focusedGroupId:null,meta:{},id:`instance_page_state:page:${p}`,pageId:`page:${p}`,typeName:"instance_page_state"});let m=(n=u.shapes)!=null?n:{},f=0;for(let v of Object.keys(m)){let b=m[v],r=b,{point:T,rotation:y,style:x,type:I}=r,k=Be(r,["point","rotation","style","type"]);o.push({x:(s=T==null?void 0:T[0])!=null?s:0,y:(l=T==null?void 0:T[1])!=null?l:0,rotation:y!=null?y:0,isLocked:(a=b.isLocked)!=null?a:!1,opacity:(c=x==null?void 0:x.opacity)!=null?c:1,meta:{},id:`shape:${v}`,parentId:`page:${p}`,type:I,props:S(S({},k),x),index:`a${f+1}`,typeName:"shape"}),f++}e++}return{tldrawFileFormatVersion:1,schema:Fv,records:o}}function Cu(i){var a,p;let o=(a=i.records)!=null?a:[],e=o.find(u=>u.typeName==="document");if(e!=null&&e.telvaDocument)return e.telvaDocument;let t=o.filter(u=>u.typeName==="page"),n=o.filter(u=>u.typeName==="shape"),r=o.filter(u=>u.typeName==="instance_page_state"),s={},l={};for(let u of t){let h=u.id.startsWith("page:")?u.id.slice(5):u.id,g={};for(let f of n){let v=`page:${h}`;if(f.parentId!==v&&f.parentId!==h)continue;let b=f.id.startsWith("shape:")?f.id.slice(6):f.id,{props:T={},x:y,y:x,rotation:I,type:k}=f,c=T,{opacity:R,start:C,end:E,bend:M,arrowheadStart:L,arrowheadEnd:A}=c,K=Be(c,["opacity","start","end","bend","arrowheadStart","arrowheadEnd"]),re=S({id:b,type:k,point:[y!=null?y:0,x!=null?x:0],rotation:I!=null?I:0,style:S({opacity:R!=null?R:1},K)},K);if(k==="arrow"){let F=(C==null?void 0:C.x)!==void 0?[C.x,C.y]:[0,0],ee=(E==null?void 0:E.x)!==void 0?[E.x,E.y]:[1,1],pe=typeof M=="number"?M:0,he=[(F[0]+ee[0])/2,(F[1]+ee[1])/2];re.handles={start:{id:"start",index:0,point:F,canBind:!0,bindingId:C!=null&&C.boundShapeId?Object.keys(g).find(()=>!0):void 0},bend:{id:"bend",index:1,point:he},end:{id:"end",index:2,point:ee,canBind:!0,bindingId:E!=null&&E.boundShapeId?E.boundShapeId:void 0}},re.bend=pe,(L||A)&&(re.decorations={start:L&&L!=="none"?L:void 0,end:A&&A!=="none"?A:void 0})}g[b]=re}s[h]={id:h,name:u.name||"Page",shapes:g,bindings:{}};let m=r.find(f=>f.pageId===`page:${h}`||f.pageId===h);l[h]={id:h,selectedIds:(p=m==null?void 0:m.selectedShapeIds)!=null?p:[],camera:{point:[0,0],zoom:1}}}if(Object.keys(s).length===0){let u="page";s[u]={id:u,name:"Page 1",shapes:{},bindings:{}},l[u]={id:u,selectedIds:[],camera:{point:[0,0],zoom:1}}}return{id:"document",name:(e==null?void 0:e.name)||"Imported Document",version:15,pages:s,pageStates:l,assets:{}}}function ms(i,o,e,t){return z(this,null,function*(){let n=t==="tld"?".tld":Qs,r,s;if(t==="tld"){let u=ku(i);r=JSON.stringify(u),s="application/vnd.tldraw+json"}else{let u={name:i.name||"New Document",fileHandle:o!=null?o:null,document:i};r=JSON.stringify(u),s="application/vnd.Telva+json"}let l=new Blob([r],{type:s});if(o&&!(yield zv(o)))return null;let a=i.name||"New Document",c=!Av&&(e==null?void 0:e.length)?e:a,p=yield Lv(l,{fileName:`${c}${n}`,description:t==="tld"?"TLDraw File":"Telva File",extensions:[n]},o);return yield hs(p),p})}function Ja(){return z(this,null,function*(){var r,s;let i=yield xu({description:"Telva / TLDraw File",extensions:[Qs,".tld"],multiple:!1});if(!i)return null;let o=yield new Promise(l=>{let a=new FileReader;a.onloadend=()=>{a.readyState===FileReader.DONE&&l(a.result)},a.readAsText(i,"utf8")}),e=JSON.parse(o);if("tldrawFileFormatVersion"in e){let l=(r=i.handle)!=null?r:null;return yield hs(l),{fileHandle:l,document:Cu(e)}}if("telvaFileFormatVersion"in e)return alert("This file was created in a newer version of Telva. Please visit beta.telva.com to open it."),null;let t=e,n=(s=i.handle)!=null?s:null;return yield hs(n),{fileHandle:n,document:t.document}})}function Qa(){return z(this,null,function*(){return xu({description:"Image or Video",extensions:[...yi,...bi],multiple:!0})})}function el(i){return new Promise((o,e)=>{if(i){let t=new FileReader;t.readAsDataURL(i),t.onload=()=>o(t.result),t.onerror=n=>e(n),t.onabort=n=>e(n)}})}function tl(i){return new Promise((o,e)=>{if(i){let t=new FileReader;t.readAsText(i),t.onload=()=>o(t.result),t.onerror=n=>e(n),t.onabort=n=>e(n)}})}function nl(i){return new Promise((o,e)=>{let t=new Image;t.onload=()=>o([t.width,t.height]),t.onerror=()=>e(new Error("Could not get image size")),t.src=i})}function ol(i){return new Promise((o,e)=>{let t=document.createElement("video");t.onloadedmetadata=()=>o([t.videoWidth,t.videoHeight]),t.onerror=()=>e(new Error("Could not get video size")),t.src=i})}qr(Zo,AV);import*as AV from"browser-fs-access";import{Utils as _n}from"telva-core";import{Vec as Re}from"telva-vec";var Le=class{constructor(o){this.app=o}};var gs=class extends Le{constructor(e,t,n,r=!1){var p,u,h;super(e);d(this,"type","arrow");d(this,"performanceMode");d(this,"status","translatingHandle");d(this,"newStartBindingId",_n.uniqueId());d(this,"draggedBindingId",_n.uniqueId());d(this,"didBind",!1);d(this,"initialShape");d(this,"handleId");d(this,"bindableShapeIds");d(this,"initialBinding");d(this,"startBindingShapeId");d(this,"isCreate");d(this,"start",()=>{});d(this,"update",()=>{var k,R,C;let{initialShape:e}=this,{currentPoint:t,shiftKey:n,altKey:r,metaKey:s,currentGrid:l,settings:{showGrid:a}}=this.app,c=this.app.getShape(e.id);if(c.isLocked)return;let{handles:p}=e,u=this.handleId;if(!p[u].canBind)return;let h=Re.sub(t,Re.add(p[u].point,e.point));if(n){let E=r?Re.med(p.start.point,p.end.point):p[u==="start"?"end":"start"].point,M=p[u].point,L=Re.add(M,h),A=Re.angle(E,L),K=Re.rotWith(L,E,_n.snapAngleToSegments(A,24)-A);h=Re.add(h,Re.sub(K,L))}let g=Re.add(p[u].point,h),m={[u]:w(S({},p[u]),{point:a?Re.snap(g,l):Re.toFixed(g),bindingId:void 0})},f=kn["arrow"],v=(k=f.onHandleChange)==null?void 0:k.call(f,e,m);if(!v)return;let b={shape:_n.deepMerge(c,v),bindings:{}},T,y=b.shape.handles[this.handleId],x=b.shape.handles[this.handleId==="start"?"end":"start"];if(this.startBindingShapeId){let E,M=this.app.page.shapes[this.startBindingShapeId],L=B.getShapeUtil(M),A=L.getCenter(M),K=b.shape.handles.start,re=b.shape.handles.end,F=Re.add(K.point,b.shape.point);Re.isEqual(F,A)&&F[1]++;let ee=A,pe=L.hitTestPoint(M,t),he=Re.uni(Re.sub(F,ee)),De=this.app.getBinding(this.newStartBindingId)!==void 0;!s&&!L.hitTestPoint(M,Re.add(b.shape.point,re.point))&&(E=this.findBindingPoint(c,M,"start",this.newStartBindingId,A,ee,he,pe)),E&&!De?(this.didBind=!0,b.bindings[this.newStartBindingId]=E,b.shape=_n.deepMerge(b.shape,{handles:{start:{bindingId:E.id}}})):!E&&De&&(this.didBind=!1,b.bindings[this.newStartBindingId]=void 0,b.shape=_n.deepMerge(e,{handles:{start:{bindingId:void 0}}}))}if(!s){let E=Re.add(x.point,b.shape.point),M=Re.add(y.point,b.shape.point),L=Re.uni(Re.sub(M,E)),A=Re.add(b.shape.point,b.shape.handles.start.point),K=Re.add(b.shape.point,b.shape.handles.end.point),re=this.bindableShapeIds.map(F=>this.app.page.shapes[F]).sort((F,ee)=>ee.childIndex-F.childIndex).filter(F=>{if(F.isLocked)return!1;let ee=B.getShapeUtil(F);return![A,K].every(pe=>ee.hitTestPoint(F,pe))});for(let F of re)if(T=this.findBindingPoint(c,F,this.handleId,this.draggedBindingId,M,E,L,r),T)break}if(T)this.didBind=!0,b.bindings[this.draggedBindingId]=T,b.shape=_n.deepMerge(b.shape,{handles:{[this.handleId]:{bindingId:this.draggedBindingId}}});else{this.didBind=this.didBind||!1;let E=c.handles[this.handleId].bindingId;E!==void 0&&(b.bindings[E]=void 0,b.shape=_n.deepMerge(b.shape,{handles:{[this.handleId]:{bindingId:void 0}}}))}let I=(C=(R=B.getShapeUtil(b.shape)).onHandleChange)==null?void 0:C.call(R,b.shape,b.shape.handles);return{document:{pages:{[this.app.currentPageId]:{shapes:{[c.id]:S(S({},b.shape),I!=null?I:{})},bindings:b.bindings}},pageStates:{[this.app.currentPageId]:{bindingId:b.shape.handles[u].bindingId}}}}});d(this,"cancel",()=>{let{initialShape:e,initialBinding:t,newStartBindingId:n,draggedBindingId:r}=this,s=B.onSessionComplete(this.app.page.shapes[e.id]),l=this.isCreate||Re.dist(s.handles.start.point,s.handles.end.point)<4,a={};return a[r]=void 0,t&&(a[t.id]=l?void 0:t),n&&(a[n]=void 0),{document:{pages:{[this.app.currentPageId]:{shapes:{[e.id]:l?void 0:e},bindings:a}},pageStates:{[this.app.currentPageId]:{selectedIds:l?[]:[e.id],bindingId:void 0,hoveredId:void 0,editingId:void 0}}}}});d(this,"complete",()=>{let{initialShape:e,initialBinding:t,newStartBindingId:n,startBindingShapeId:r,handleId:s}=this,l=B.onSessionComplete(this.app.page.shapes[e.id]),a=l.handles[s].bindingId,c=Re.dist(l.handles.start.point,l.handles.end.point);if(!(a||t)&&c<4)return this.cancel();let p={},u={};return t&&(p[t.id]=this.isCreate?void 0:t,u[t.id]=void 0),a&&(p[a]=void 0,u[a]=this.app.page.bindings[a]),r&&(p[n]=void 0,u[n]=this.app.page.bindings[n]),{id:"arrow",before:{document:{pages:{[this.app.currentPageId]:{shapes:{[e.id]:this.isCreate?void 0:e},bindings:p}},pageStates:{[this.app.currentPageId]:{selectedIds:this.isCreate?[]:[e.id],bindingId:void 0,hoveredId:void 0,editingId:void 0}}}},after:{document:{pages:{[this.app.currentPageId]:{shapes:{[e.id]:l},bindings:u}},pageStates:{[this.app.currentPageId]:{selectedIds:[e.id],bindingId:void 0,hoveredId:void 0,editingId:void 0}}}}}});d(this,"findBindingPoint",(e,t,n,r,s,l,a,c)=>{let u=B.getShapeUtil(t.type).getBindingPoint(t,e,s,l,a,c);if(!!u)return{id:r,type:"arrow",fromId:e.id,toId:t.id,handleId:n,point:Re.toFixed(u.point),distance:u.distance}});this.isCreate=r;let{currentPageId:s}=e.state.appState,l=e.state.document.pages[s];this.handleId=n,this.initialShape=it(l.shapes[t]),this.bindableShapeIds=B.getBindableShapeIds(e.state).filter(g=>!(g===this.initialShape.id||g===this.initialShape.parentId));let a=(p=this.initialShape.handles[n==="start"?"end":"start"])==null?void 0:p.bindingId;if(a){let g=(u=l.bindings[a])==null?void 0:u.toId;g&&(this.bindableShapeIds=this.bindableShapeIds.filter(m=>m!==g))}let{originPoint:c}=this.app;if(this.isCreate)this.startBindingShapeId=(h=this.bindableShapeIds.map(g=>l.shapes[g]).filter(g=>!g.isLocked&&_n.pointInBounds(c,B.getShapeUtil(g).getBounds(g))).sort((g,m)=>m.childIndex-g.childIndex)[0])==null?void 0:h.id,this.startBindingShapeId&&this.bindableShapeIds.splice(this.bindableShapeIds.indexOf(this.startBindingShapeId),1);else{let g=this.initialShape.handles[this.handleId].bindingId;g?this.initialBinding=l.bindings[g]:this.initialShape.handles[this.handleId].bindingId=void 0}}};import{Utils as wu}from"telva-core";var fs=class extends Le{constructor(e){super(e);d(this,"type","brush");d(this,"performanceMode");d(this,"status","brushing");d(this,"initialSelectedIds");d(this,"shapesToTest");d(this,"start",()=>{});d(this,"update",()=>{let{initialSelectedIds:e,shapesToTest:t,app:{metaKey:n,settings:r,originPoint:s,currentPoint:l}}=this,a=wu.getBoundsFromPoints([s,l]),c=r.isCadSelectMode?!n&&s[0]<l[0]:n,p=new Set,u=new Set(e);t.forEach(({id:f,selectId:v})=>{let b=this.app.getShape(f);if(!p.has(v)){let T=this.app.getShapeUtil(b);(c?wu.boundsContain(a,T.getBounds(b)):T.hitTestBounds(b,a))?(p.add(v),u.has(v)||u.add(v)):u.has(v)&&u.delete(v)}});let h=this.app.selectedIds,g=u.size!==h.length||h.some(f=>!u.has(f)),m=g?Array.from(u.values()):h;return g?{appState:{selectByContain:c},document:{pageStates:{[this.app.currentPageId]:{brush:a,selectedIds:m}}}}:{appState:{selectByContain:c},document:{pageStates:{[this.app.currentPageId]:{brush:a}}}}});d(this,"cancel",()=>({appState:{selectByContain:!1},document:{pageStates:{[this.app.currentPageId]:{brush:null,selectedIds:Array.from(this.initialSelectedIds.values())}}}}));d(this,"complete",()=>({appState:{selectByContain:!1},document:{pageStates:{[this.app.currentPageId]:{brush:null,selectedIds:[...this.app.selectedIds]}}}}));let{currentPageId:t}=e;this.initialSelectedIds=new Set(this.app.selectedIds),this.shapesToTest=this.app.shapes.filter(n=>!(n.isLocked||n.isHidden||n.parentId!==t||this.initialSelectedIds.has(n.id)||this.initialSelectedIds.has(n.parentId))).map(n=>({id:n.id,bounds:this.app.getShapeUtil(n).getBounds(n),selectId:n.id})),this.update()}};import{Vec as je}from"telva-vec";var Ss=class extends Le{constructor(e,t){var c;super(e);d(this,"type","draw");d(this,"performanceMode");d(this,"status","creating");d(this,"topLeft");d(this,"points");d(this,"initialShape");d(this,"lastAdjustedPoint");d(this,"shiftedPoints",[]);d(this,"shapeId");d(this,"isLocked");d(this,"isExtending");d(this,"lockedDirection");d(this,"start",()=>{var s;let e=this.app.originPoint,t=[0,0,(s=e[2])!=null?s:.5];this.points.push(t);let n=[Math.min(this.topLeft[0],e[0]),Math.min(this.topLeft[1],e[1])],r=je.sub(n,e);return this.topLeft=n,this.shiftedPoints=this.points.map(l=>je.toFixed(je.sub(l,r)).concat(l[2])),{document:{pages:{[this.app.currentPageId]:{shapes:{[this.shapeId]:{point:this.topLeft,points:this.shiftedPoints}}}},pageStates:{[this.app.currentPageId]:{selectedIds:[this.shapeId]}}}}});d(this,"update",()=>{let{shapeId:e}=this,{currentPoint:t,originPoint:n,shiftKey:r,zoom:s}=this.app;if(!this.lockedDirection&&this.points.length>1){let a=je.sub(t,n);je.len(a)>3/s&&(this.lockedDirection=Math.abs(a[0])>Math.abs(a[1])?"horizontal":"vertical")}if(r){if(!this.isLocked&&this.points.length>2){if(!this.lockedDirection){let c=je.sub(t,n);je.len(c)>3/s&&(this.lockedDirection=Math.abs(c[0])>Math.abs(c[1])?"horizontal":"vertical")}this.isLocked=!0;let a=[...this.lastAdjustedPoint];this.lockedDirection==="vertical"?a[0]=0:a[1]=0,this.points.push(a.concat(t[2]))}}else this.isLocked&&(this.isLocked=!1);this.isLocked&&(this.lockedDirection==="vertical"?t[0]=n[0]:t[1]=n[1]);let l=this.addPoint(t);if(!!l)return{document:{pages:{[this.app.currentPageId]:{shapes:{[e]:l}}},pageStates:{[this.app.currentPageId]:{selectedIds:[e]}}}}});d(this,"cancel",()=>{let{shapeId:e}=this,t=this.app.currentPageId;return{document:{pages:{[t]:{shapes:{[e]:this.isExtending?this.initialShape:void 0}}},pageStates:{[t]:{selectedIds:[]}}}}});d(this,"complete",()=>{let{shapeId:e}=this,t=this.app.currentPageId,n=this.app.getShape(e);return{id:"create_draw",before:{document:{pages:{[t]:{shapes:{[e]:this.isExtending?this.initialShape:void 0}}},pageStates:{[t]:{selectedIds:[]}}}},after:{document:{pages:{[t]:{shapes:{[e]:w(S({},n),{point:je.toFixed(n.point),points:n.points.map(r=>je.toFixed(r)),isComplete:!0})}}},pageStates:{[this.app.currentPageId]:{selectedIds:[]}}}}}});d(this,"addPoint",e=>{let{originPoint:t}=this.app,n=je.toFixed(je.sub(e,t)).concat(e[2]);if(je.isEqual(this.lastAdjustedPoint,n))return;this.points.push(n),this.lastAdjustedPoint=n;let r=[...this.topLeft],s=[Math.min(this.topLeft[0],e[0]),Math.min(this.topLeft[1],e[1])],l=je.sub(s,t),a;return r[0]!==s[0]||r[1]!==s[1]?(this.topLeft=s,a=this.points.map(c=>je.toFixed(je.sub(c,l)).concat(c[2]))):a=[...this.shiftedPoints,je.sub(n,l).concat(n[2])],this.shiftedPoints=a,{point:this.topLeft,points:a}});let{originPoint:n}=this.app;this.shapeId=t,this.initialShape=this.app.getShape(t),this.topLeft=[...this.initialShape.point];let r=[0,0,(c=n[2])!=null?c:.5],s=je.sub(n,this.topLeft),l=this.initialShape.points.map(p=>je.sub(p,s).concat(p[2]));this.isExtending=l.length>0;let a=[];if(this.isExtending){let p=l[l.length-1];if(p){a.push(p,p);let u=Math.floor(je.dist(p,r)/16);if(u>1)for(let h=0;h<u;h++){let g=h/(u-1);a.push(je.lrp(p,r,g).concat(p[2]))}else a.push(r,r)}}else a.push(r);this.points=[...l,...a],this.shiftedPoints=this.points.map(p=>je.add(p,s).concat(p[2])),this.lastAdjustedPoint=this.points[this.points.length-1]}};var ys=class extends Le{constructor(e,t,n){super(e);d(this,"type","edit");d(this,"performanceMode");d(this,"initialShape");d(this,"initialSelectedIds");d(this,"currentPageId");d(this,"isCreating");d(this,"start",()=>{});d(this,"update",()=>{});d(this,"cancel",()=>({document:{pages:{[this.currentPageId]:{shapes:{[this.initialShape.id]:this.isCreating?void 0:this.initialShape}}},pageStates:{[this.currentPageId]:{selectedIds:this.isCreating?[]:this.initialSelectedIds,editingId:void 0}}}}));d(this,"complete",()=>{let e=this.app.getShape(this.initialShape.id);return{id:"edit",before:{document:{pages:{[this.currentPageId]:{shapes:{[this.initialShape.id]:this.isCreating?void 0:this.initialShape}}},pageStates:{[this.currentPageId]:{selectedIds:this.isCreating?[]:this.initialSelectedIds,editingId:void 0}}}},after:{document:{pages:{[this.currentPageId]:{shapes:{[this.initialShape.id]:e}}},pageStates:{[this.currentPageId]:{selectedIds:[e.id],editingId:void 0}}}}}});this.initialShape=e.getShape(t,e.currentPageId),this.currentPageId=e.currentPageId,this.isCreating=n,this.initialSelectedIds=[...e.selectedIds]}};import{Vec as qo}from"telva-vec";var bs=class extends Le{constructor(e){super(e);d(this,"type","draw");d(this,"performanceMode");d(this,"status","creating");d(this,"isLocked");d(this,"lockedDirection");d(this,"erasedShapes",new Set);d(this,"erasedBindings",new Set);d(this,"initialSelectedShapes");d(this,"erasableShapes");d(this,"prevPoint");d(this,"prevEraseShapesSize",0);d(this,"interval");d(this,"timestamp1",0);d(this,"timestamp2",0);d(this,"prevErasePoint",[]);d(this,"loop",()=>{let e=Date.now(),t=e-this.timestamp1,n=e-this.timestamp2,{eraseLine:r}=this.app.appState,s=[...r],l=!1;t>16&&this.prevErasePoint!==this.prevPoint&&(l=!0,s=[...r,this.prevPoint],this.prevErasePoint=this.prevPoint),n>32&&s.length>1&&(l=!0,s.splice(0,Math.ceil(s.length*.1)),this.timestamp2=e),l&&this.app.patchState({appState:{eraseLine:s}},"eraseline"),this.interval=requestAnimationFrame(this.loop)});d(this,"start",()=>{});d(this,"update",()=>{let{page:e,shiftKey:t,originPoint:n,currentPoint:r,zoom:s}=this.app;if(t){let p=qo.sub(r,n);if(!this.isLocked&&qo.len(p)>3/s){if(!this.lockedDirection){let u=qo.sub(r,n);this.lockedDirection=Math.abs(u[0])>Math.abs(u[1])?"horizontal":"vertical"}this.isLocked=!0}}else this.isLocked&&(this.isLocked=!1);this.isLocked&&(this.lockedDirection==="vertical"?r[0]=n[0]:r[1]=n[1]);let l=qo.toFixed(qo.add(n,qo.sub(r,n))),a=new Set([]);this.erasableShapes.forEach(p=>{if(!this.erasedShapes.has(p)&&this.app.getShapeUtil(p).hitTestLineSegment(p,this.prevPoint,l)&&(this.erasedShapes.add(p),a.add(p.id),p.children!==void 0))for(let u of p.children)this.erasedShapes.add(this.app.getShape(u)),a.add(u)}),Object.values(e.bindings).forEach(p=>{for(let u of[p.toId,p.fromId])a.has(u)&&this.erasedBindings.add(p)}),this.erasedShapes.forEach(p=>{this.app.getShape(p.id)||(this.erasedShapes.delete(p),this.erasableShapes.delete(p),a.delete(p.id))});let c=Array.from(this.erasedShapes.values());if(this.prevPoint=l,c.length!==this.prevEraseShapesSize)return this.prevEraseShapesSize=c.length,{document:{pages:{[e.id]:{shapes:Object.fromEntries(c.map(p=>[p.id,{isGhost:!0}]))}}}}});d(this,"cancel",()=>{let{page:e}=this.app;cancelAnimationFrame(this.interval),this.erasedShapes.forEach(n=>{this.app.getShape(n.id)||(this.erasedShapes.delete(n),this.erasableShapes.delete(n))});let t=Array.from(this.erasedShapes.values());return{document:{pages:{[e.id]:{shapes:Object.fromEntries(t.map(n=>[n.id,{isGhost:!1}]))}},pageStates:{[e.id]:{selectedIds:this.initialSelectedShapes.map(n=>n.id)}}},appState:{eraseLine:[]}}});d(this,"complete",()=>{let{page:e}=this.app;cancelAnimationFrame(this.interval),this.erasedShapes.forEach(c=>{this.app.getShape(c.id)||(this.erasedShapes.delete(c),this.erasableShapes.delete(c))}),this.erasedBindings.forEach(c=>{this.app.getBinding(c.id)||this.erasedBindings.delete(c)});let t=Array.from(this.erasedShapes.values()),n=Array.from(this.erasedBindings.values()),r=t.map(c=>c.id),s=n.map(c=>c.id),l={shapes:Object.fromEntries(t.map(c=>[c.id,c])),bindings:Object.fromEntries(n.map(c=>[c.id,c]))},a={shapes:Object.fromEntries(t.map(c=>[c.id,void 0])),bindings:Object.fromEntries(n.map(c=>[c.id,void 0]))};return this.app.shapes.forEach(c=>{c.handles&&!a.shapes[c.id]&&Object.values(c.handles).forEach(p=>{var u,h;p.bindingId&&s.includes(p.bindingId)&&(l.shapes[c.id]=w(S({},l.shapes[c.id]),{handles:w(S({},(u=l.shapes[c.id])==null?void 0:u.handles),{[p.id]:p})}),r.includes(c.id)||(a.shapes[c.id]=w(S({},a.shapes[c.id]),{handles:w(S({},(h=a.shapes[c.id])==null?void 0:h.handles),{[p.id]:w(S({},p),{bindingId:void 0})})})))})}),{id:"erase",before:{document:{pages:{[e.id]:l},pageStates:{[e.id]:{selectedIds:this.initialSelectedShapes.filter(c=>!!this.app.getShape(c.id)).map(c=>c.id)}}},appState:{eraseLine:[]}},after:{document:{pages:{[e.id]:a},pageStates:{[e.id]:{selectedIds:this.initialSelectedShapes.filter(c=>!!this.app.getShape(c.id)).filter(c=>!r.includes(c.id)).map(c=>c.id)}}},appState:{eraseLine:[]}}}});this.prevPoint=[...e.originPoint],this.initialSelectedShapes=this.app.selectedIds.map(t=>this.app.getShape(t)),this.erasableShapes=new Set(this.app.shapes.filter(t=>!t.isLocked)),this.interval=this.loop()}};import{Utils as Iu}from"telva-core";import{Vec as Pu}from"telva-vec";var vs=class extends Le{constructor(e,t){var n;super(e);d(this,"type","grid");d(this,"performanceMode");d(this,"status","translating");d(this,"shape");d(this,"bounds");d(this,"initialSelectedIds");d(this,"initialSiblings");d(this,"grid",{});d(this,"columns",1);d(this,"rows",1);d(this,"isCopying",!1);d(this,"start",()=>{});d(this,"update",()=>{let{currentPageId:e,altKey:t,shiftKey:n,currentPoint:r}=this.app,s={},l={},a=Iu.getBoundsCenter(this.bounds),c=Pu.sub(r,a);n&&(Math.abs(c[0])<Math.abs(c[1])?c[0]=0:c[1]=0);let p=this.bounds.width+32,u=this.bounds.height+32,h=Math.ceil(c[0]/p),g=Math.ceil(c[1]/u),m=Math.min(h,0),f=Math.min(g,0),v=Math.max(h,1),b=Math.max(g,1),T=new Set,y=t;y!==this.isCopying&&(Object.values(this.grid).filter(x=>x!==this.shape.id).forEach(x=>s[x]=void 0),this.grid={"0_0":this.shape.id},this.isCopying=y);for(let x=m;x<v;x++)for(let I=f;I<b;I++){let k=`${x}_${I}`;if(T.add(k),this.grid[k]||x===0&&I===0)continue;let R=this.getClone(Pu.add(this.shape.point,[x*p,I*u]),y);s[R.id]=R,this.grid[k]=R.id}if(Object.entries(this.grid).forEach(([x,I])=>{T.has(x)||(s[I]=void 0,delete this.grid[x])}),Object.values(s).length!==0)return this.initialSiblings&&(s[this.shape.parentId]={children:[...this.initialSiblings,...Object.values(this.grid)]}),{document:{pages:{[e]:{shapes:s}},pageStates:{[e]:l}}}});d(this,"cancel",()=>{let{currentPageId:e}=this.app,t={};return Object.values(this.grid).forEach(n=>{t[n]=void 0}),t[this.shape.id]=w(S({},t[this.shape.id]),{point:this.shape.point}),this.initialSiblings&&(t[this.shape.parentId]={children:[...this.initialSiblings,this.shape.id]}),{document:{pages:{[e]:{shapes:t}},pageStates:{[e]:{selectedIds:[this.shape.id]}}}}});d(this,"complete",()=>{let{currentPageId:e}=this.app,t={},n={},r=[];if(Object.values(this.grid).forEach(s=>{t[s]=void 0,n[s]=this.app.getShape(s),r.push(s)}),t[this.shape.id]=this.shape,this.initialSiblings&&(t[this.shape.parentId]={children:[...this.initialSiblings,this.shape.id]},n[this.shape.parentId]={children:[...this.initialSiblings,...Object.values(this.grid)]}),r.length!==1)return{id:"grid",before:{document:{pages:{[e]:{shapes:t}},pageStates:{[e]:{selectedIds:[],hoveredId:void 0}}}},after:{document:{pages:{[e]:{shapes:n}},pageStates:{[e]:{selectedIds:r,hoveredId:void 0}}}}}});d(this,"getClone",(e,t)=>{let n=w(S({},this.shape),{id:Iu.uniqueId(),point:e});return t||n.type==="sticky"&&(n.text=""),n});this.shape=this.app.getShape(t),this.grid["0_0"]=this.shape.id,this.bounds=this.app.getShapeBounds(t),this.initialSelectedIds=[...this.app.selectedIds],this.shape.parentId!==this.app.currentPageId&&(this.initialSiblings=(n=this.app.getShape(this.shape.parentId).children)==null?void 0:n.filter(r=>r!==this.shape.id))}};import{Vec as rl}from"telva-vec";var Ts=class extends Le{constructor(e,t,n,r="move_handle"){super(e);d(this,"type","handle");d(this,"performanceMode");d(this,"status","translatingHandle");d(this,"commandId");d(this,"topLeft");d(this,"shiftKey",!1);d(this,"initialShape");d(this,"handleId");d(this,"start",()=>{});d(this,"update",()=>{var u,h;let{initialShape:e,app:{currentPageId:t,currentPoint:n}}=this,r=this.app.getShape(e.id);if(r.isLocked)return;let s=r.handles,l=this.handleId,a=rl.sub(n,s[l].point),c={[l]:w(S({},s[l]),{point:rl.sub(rl.add(s[l].point,a),r.point)})},p=(h=(u=B.getShapeUtil(r)).onHandleChange)==null?void 0:h.call(u,r,c);if(!!p)return{document:{pages:{[t]:{shapes:{[r.id]:p}}}}}});d(this,"cancel",()=>{let{initialShape:e,app:{currentPageId:t}}=this;return{document:{pages:{[t]:{shapes:{[e.id]:e}}}}}});d(this,"complete",()=>{let{initialShape:e,app:{currentPageId:t}}=this;return{id:this.commandId,before:{document:{pages:{[t]:{shapes:{[e.id]:e}}}}},after:{document:{pages:{[t]:{shapes:{[e.id]:B.onSessionComplete(this.app.getShape(this.initialShape.id))}}}}}}});let{originPoint:s}=e;this.topLeft=[...s],this.handleId=n,this.initialShape=this.app.getShape(t),this.commandId=r}};import{Utils as xs}from"telva-core";import{Vec as Ru}from"telva-vec";var ks=class extends Le{constructor(e){super(e);d(this,"type","rotate");d(this,"status","transforming");d(this,"performanceMode");d(this,"delta",[0,0]);d(this,"commonBoundsCenter");d(this,"initialAngle");d(this,"initialShapes");d(this,"changes",{});d(this,"start",()=>{});d(this,"update",()=>{let{commonBoundsCenter:e,initialShapes:t,app:{currentPageId:n,currentPoint:r,shiftKey:s}}=this,l={},a=Ru.angle(e,r)-this.initialAngle;return s&&(a=xs.snapAngleToSegments(a,24)),t.forEach(({center:c,shape:p})=>{let{rotation:u=0}=p,h=0;s&&(h=xs.snapAngleToSegments(u,24)-u);let g=B.getRotatedShapeMutation(p,c,e,s?a+h:a);g&&(l[p.id]=g)}),this.changes=l,{document:{pages:{[n]:{shapes:l}}}}});d(this,"cancel",()=>{let{initialShapes:e,app:{currentPageId:t}}=this,n={};return e.forEach(({shape:r})=>n[r.id]=r),{document:{pages:{[t]:{shapes:n}}}}});d(this,"complete",()=>{let{initialShapes:e,app:{currentPageId:t}}=this,n={},r=this.changes;return e.forEach(({shape:{id:s,point:l,rotation:a,handles:c}})=>{n[s]={point:l,rotation:a,handles:c}}),{id:"rotate",before:{document:{pages:{[t]:{shapes:n}}}},after:{document:{pages:{[t]:{shapes:r}}}}}});let{app:{currentPageId:t,pageState:n,originPoint:r}}=this,s=B.getSelectedBranchSnapshot(e.state,t).filter(l=>!l.isLocked);if(s.length===0)throw Error("No selected shapes!");if(e.rotationInfo.selectedIds===n.selectedIds){if(e.rotationInfo.center===void 0)throw Error("We should have a center for rotation!");this.commonBoundsCenter=e.rotationInfo.center}else this.commonBoundsCenter=xs.getBoundsCenter(xs.getCommonBounds(s.map(B.getBounds))),e.rotationInfo.selectedIds=n.selectedIds,e.rotationInfo.center=this.commonBoundsCenter;this.initialShapes=s.filter(l=>l.children===void 0).map(l=>({shape:l,center:this.app.getShapeUtil(l).getCenter(l)})),this.initialAngle=Ru.angle(this.commonBoundsCenter,r)}};import{TLBoundsCorner as Ov,Utils as Tt}from"telva-core";import{Vec as Jo}from"telva-vec";var Cs=class extends Le{constructor(e,t=Ov.BottomRight,n=!1){super(e);this.transformType=t;this.isCreate=n;d(this,"type","transform");d(this,"performanceMode");d(this,"status","transforming");d(this,"scaleX",1);d(this,"scaleY",1);d(this,"initialShapes");d(this,"initialShapeIds");d(this,"initialSelectedIds");d(this,"shapeBounds");d(this,"hasUnlockedShapes");d(this,"isAllAspectRatioLocked");d(this,"initialCommonBounds");d(this,"snapInfo",{state:"empty"});d(this,"prevPoint",[0,0]);d(this,"speed",1);d(this,"start",()=>{this.snapInfo={state:"ready",bounds:this.app.shapes.filter(e=>!this.initialShapeIds.includes(e.id)).map(e=>Tt.getBoundsWithCenter(B.getRotatedBounds(e)))}});d(this,"update",()=>{let{transformType:e,shapeBounds:t,initialCommonBounds:n,isAllAspectRatioLocked:r,app:{currentPageId:s,pageState:{camera:l},viewport:a,currentPoint:c,previousPoint:p,originPoint:u,shiftKey:h,altKey:g,metaKey:m,currentGrid:f,settings:{isSnapping:v,showGrid:b}}}=this,T={},y=g?Jo.mul(Jo.sub(c,u),2):Jo.sub(c,u),x=Tt.getTransformedBoundingBox(n,e,y,0,h||r);g&&(x=S(S({},x),Tt.centerBounds(x,Tt.getBoundsCenter(n)))),b&&(x=S(S({},x),Tt.snapBoundsToGrid(x,f)));let k=Jo.dist(c,p)-this.speed;this.speed=this.speed+k*(k>1?.5:.15);let R=[];if((v&&!m||!v&&m)&&this.speed*l.zoom<10&&this.snapInfo.state==="ready"){let C=Tt.getSnapPoints(Tt.getBoundsWithCenter(x),this.snapInfo.bounds.filter(E=>Tt.boundsContain(a,E)||Tt.boundsCollide(a,E)),5/l.zoom);C&&(R=C.snapLines,x=Tt.getTransformedBoundingBox(n,e,Jo.sub(y,C.offset),0,h||r))}return this.scaleX=x.scaleX,this.scaleY=x.scaleY,t.forEach(({initialShape:C,initialShapeBounds:E,transformOrigin:M})=>{let L=Tt.getRelativeTransformedBoundingBox(x,n,E,this.scaleX<0,this.scaleY<0);b&&(L=Tt.snapBoundsToGrid(L,f));let A=B.transform(this.app.getShape(C.id),L,{type:this.transformType,initialShape:C,scaleX:this.scaleX,scaleY:this.scaleY,transformOrigin:M});T[C.id]=A}),{appState:{snapLines:R},document:{pages:{[s]:{shapes:T}}}}});d(this,"cancel",()=>{let{shapeBounds:e,app:{currentPageId:t}}=this,n={};return this.isCreate?e.forEach(r=>n[r.initialShape.id]=void 0):e.forEach(r=>n[r.initialShape.id]=r.initialShape),{appState:{snapLines:[]},document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:this.isCreate?[]:e.map(r=>r.initialShape.id)}}}}});d(this,"complete",()=>{let{isCreate:e,shapeBounds:t,hasUnlockedShapes:n,app:{currentPageId:r}}=this;if(!n)return;if(this.isCreate&&Jo.dist(this.app.originPoint,this.app.currentPoint)<2)return this.cancel();let s={},l={},a,c;return e?(a=[],c=[],t.forEach(({initialShape:p})=>{s[p.id]=void 0,l[p.id]=this.app.getShape(p.id)})):(a=this.initialSelectedIds,c=this.initialSelectedIds,t.forEach(({initialShape:p})=>{s[p.id]=p,l[p.id]=this.app.getShape(p.id)})),{id:"transform",before:{appState:{snapLines:[]},document:{pages:{[r]:{shapes:s}},pageStates:{[r]:{selectedIds:a,hoveredId:void 0,editingId:void 0}}}},after:{appState:{snapLines:[]},document:{pages:{[r]:{shapes:l}},pageStates:{[r]:{selectedIds:c,hoveredId:void 0,editingId:void 0}}}}}});this.initialSelectedIds=[...this.app.selectedIds],this.app.rotationInfo.selectedIds=[...this.initialSelectedIds],this.initialShapes=B.getSelectedBranchSnapshot(this.app.state,this.app.currentPageId).filter(a=>!a.isLocked),this.initialShapeIds=this.initialShapes.map(a=>a.id),this.hasUnlockedShapes=this.initialShapes.length>0,this.isAllAspectRatioLocked=this.initialShapes.every(a=>a.isAspectRatioLocked||B.getShapeUtil(a).isAspectRatioLocked);let r=Object.fromEntries(this.initialShapes.map(a=>[a.id,B.getBounds(a)])),s=Object.values(r);this.initialCommonBounds=Tt.getCommonBounds(s);let l=Tt.getBoundsFromPoints(s.map(Tt.getBoundsCenter));this.shapeBounds=this.initialShapes.map(a=>{let c=r[a.id],p=Tt.getBoundsCenter(c),u=(p[0]-l.minX)/l.width,h=(p[1]-l.minY)/l.height;return{initialShape:a,initialShapeBounds:c,transformOrigin:[u,h]}})}};import{Utils as En}from"telva-core";import{Vec as Po}from"telva-vec";var ws=class extends Le{constructor(e,t,n,r=!1){super(e);d(this,"type","transformSingle");d(this,"status","transforming");d(this,"performanceMode");d(this,"transformType");d(this,"scaleX",1);d(this,"scaleY",1);d(this,"isCreate");d(this,"initialShape");d(this,"initialShapeBounds");d(this,"initialCommonBounds");d(this,"snapInfo",{state:"empty"});d(this,"prevPoint",[0,0]);d(this,"speed",1);d(this,"start",()=>{this.snapInfo={state:"ready",bounds:this.app.shapes.filter(e=>e.id!==this.initialShape.id).map(e=>En.getBoundsWithCenter(B.getRotatedBounds(e)))}});d(this,"update",()=>{let{transformType:e,initialShape:t,initialShapeBounds:n,app:{settings:{isSnapping:r,showGrid:s},currentPageId:l,pageState:{camera:a},viewport:c,currentPoint:p,previousPoint:u,originPoint:h,currentGrid:g,shiftKey:m,altKey:f,metaKey:v}}=this;if(t.isLocked)return;let b={},T=f?Po.mul(Po.sub(p,h),2):Po.sub(p,h),y=this.app.getShape(t.id),x=B.getShapeUtil(y),I=En.getTransformedBoundingBox(n,e,T,y.rotation,m||y.isAspectRatioLocked||x.isAspectRatioLocked);f&&(I=S(S({},I),En.centerBounds(I,En.getBoundsCenter(n)))),s&&(I=S(S({},I),En.snapBoundsToGrid(I,g)));let R=Po.dist(p,u)-this.speed;this.speed=this.speed+R*(R>1?.5:.15);let C=[];if((r&&!v||!r&&v)&&!t.rotation&&this.speed*a.zoom<10&&this.snapInfo.state==="ready"){let M=En.getSnapPoints(En.getBoundsWithCenter(I),this.snapInfo.bounds.filter(L=>En.boundsContain(c,L)||En.boundsCollide(c,L)),5/a.zoom);M&&(C=M.snapLines,I=En.getTransformedBoundingBox(n,e,Po.sub(T,M.offset),y.rotation,m||y.isAspectRatioLocked||x.isAspectRatioLocked))}let E=B.getShapeUtil(y).transformSingle(y,I,{initialShape:t,type:this.transformType,scaleX:I.scaleX,scaleY:I.scaleY,transformOrigin:[.5,.5]});return E&&(b[y.id]=E),s&&E&&E.point&&(E.point=Po.snap(E.point,g)),{appState:{snapLines:C},document:{pages:{[l]:{shapes:b}}}}});d(this,"cancel",()=>{let{initialShape:e,app:{currentPageId:t}}=this,n={};return this.isCreate?n[e.id]=void 0:n[e.id]=e,{appState:{snapLines:[]},document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:this.isCreate?[]:[e.id]}}}}});d(this,"complete",()=>{let{initialShape:e,app:{currentPageId:t}}=this;if(e.isLocked)return;if(this.isCreate&&Po.dist(this.app.originPoint,this.app.currentPoint)<2)return this.cancel();let n={},r={};return n[e.id]=this.isCreate?void 0:e,r[e.id]=B.onSessionComplete(this.app.getShape(e.id)),{id:"transform_single",before:{appState:{snapLines:[]},document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:this.isCreate?[]:[e.id],editingId:void 0,hoveredId:void 0}}}},after:{appState:{snapLines:[]},document:{pages:{[t]:{shapes:r}},pageStates:{[t]:{selectedIds:[e.id],editingId:void 0,hoveredId:void 0}}}}}});this.isCreate=r,this.transformType=n;let s=this.app.getShape(t);this.initialShape=s,this.initialShapeBounds=B.getBounds(s),this.initialCommonBounds=B.getRotatedBounds(s),this.app.rotationInfo.selectedIds=[s.id]}};import{Utils as Wt}from"telva-core";import{Vec as ze}from"telva-vec";var Is=class extends Le{constructor(e,t=!1,n=!1){super(e);d(this,"performanceMode");d(this,"type","translate");d(this,"status","translating");d(this,"delta",[0,0]);d(this,"prev",[0,0]);d(this,"prevPoint",[0,0]);d(this,"speed",1);d(this,"cloneInfo",{state:"empty"});d(this,"snapInfo",{state:"empty"});d(this,"snapLines",[]);d(this,"isCloning",!1);d(this,"isCreate");d(this,"link");d(this,"initialIds");d(this,"hasUnlockedShapes");d(this,"initialSelectedIds");d(this,"initialCommonBounds");d(this,"initialShapes");d(this,"initialParentChildren");d(this,"bindingsToDelete");d(this,"start",()=>{let{bindingsToDelete:e,initialIds:t,app:{currentPageId:n,page:r}}=this,s=[],l=[];if(Object.values(r.shapes).forEach(p=>{let u=Wt.getBoundsWithCenter(B.getRotatedBounds(p));s.push(u),t.has(p.id)||l.push(u)}),this.snapInfo={state:"ready",bounds:s,others:l},e.length===0)return;let a={},c={};return e.forEach(p=>{a[p.id]=void 0;let u=this.app.getShape(p.fromId);c[p.fromId]={handles:w(S({},u.handles),{[p.handleId]:w(S({},u.handles[p.handleId]),{bindingId:void 0})})}}),{document:{pages:{[n]:{bindings:a,shapes:c}}}}});d(this,"update",()=>{let{initialParentChildren:e,initialShapes:t,initialCommonBounds:n,bindingsToDelete:r,app:{pageState:{camera:s},settings:{isSnapping:l,showGrid:a},currentPageId:c,viewport:p,selectedIds:u,currentPoint:h,previousPoint:g,originPoint:m,altKey:f,shiftKey:v,metaKey:b,currentGrid:T}}=this,y={},x={},I={},k=ze.sub(h,m),R=!1;this.isCreate||(f&&!this.isCloning?(this.isCloning=!0,R=!0):!f&&this.isCloning&&(this.isCloning=!1,R=!0)),v&&(Math.abs(k[0])<Math.abs(k[1])?k[0]=0:k[1]=0);let E=ze.dist(h,g)-this.speed;if(this.speed=this.speed+E*(E>1?.5:.15),this.snapLines=[],(l&&!b||!l&&b)&&this.speed*s.zoom<10&&this.snapInfo.state==="ready"){let M=Wt.getSnapPoints(Wt.getBoundsWithCenter(a?Wt.snapBoundsToGrid(Wt.translateBounds(n,k),T):Wt.translateBounds(n,k)),(this.isCloning?this.snapInfo.bounds:this.snapInfo.others).filter(L=>Wt.boundsContain(p,L)||Wt.boundsCollide(p,L)),5/s.zoom);M&&(this.snapLines=M.snapLines,k=ze.sub(k,M.offset))}if(this.prev=k,this.isCloning)if(R){if(this.cloneInfo.state==="empty"&&this.createCloneInfo(),this.cloneInfo.state==="empty")throw Error;let{clones:M,clonedBindings:L}=this.cloneInfo;this.isCloning=!0,r.forEach(A=>y[A.id]=A),t.forEach(A=>x[A.id]={point:A.point}),M.forEach(A=>{var K;if(x[A.id]=S({},A),A.parentId!==c&&!u.includes(A.parentId)){let re=((K=x[A.parentId])==null?void 0:K.children)||e[A.parentId];re.includes(A.id)||(x[A.parentId]=w(S({},x[A.parentId]),{children:[...re,A.id]}))}});for(let A of L)y[A.id]=A;I.selectedIds=M.map(A=>A.id),M.forEach(A=>{x[A.id]=w(S({},A),{point:a?ze.snap(ze.toFixed(ze.add(A.point,k)),T):ze.toFixed(ze.add(A.point,k))})})}else{if(this.cloneInfo.state==="empty")throw Error;let{clones:M}=this.cloneInfo;M.forEach(L=>{x[L.id]={point:a?ze.snap(ze.toFixed(ze.add(L.point,k)),T):ze.toFixed(ze.add(L.point,k))}})}else if(R){if(this.cloneInfo.state==="empty")throw Error;let{clones:M,clonedBindings:L}=this.cloneInfo;this.isCloning=!1,r.forEach(A=>y[A.id]=void 0),M.forEach(A=>{A.parentId!==c&&(x[A.parentId]=w(S({},x[A.parentId]),{children:e[A.parentId]}))}),M.forEach(A=>x[A.id]=void 0),t.forEach(A=>{x[A.id]={point:a?ze.snap(ze.toFixed(ze.add(A.point,k)),T):ze.toFixed(ze.add(A.point,k))}});for(let A of L)y[A.id]=void 0;I.selectedIds=t.map(A=>A.id)}else t.forEach(M=>{x[M.id]={point:a?ze.snap(ze.toFixed(ze.add(M.point,k)),T):ze.toFixed(ze.add(M.point,k))}});return{appState:{snapLines:this.snapLines},document:{pages:{[c]:{shapes:x,bindings:y}},pageStates:{[c]:I}}}});d(this,"cancel",()=>{let{initialShapes:e,initialSelectedIds:t,bindingsToDelete:n,app:{currentPageId:r}}=this,s={},l={},a={editingId:void 0,hoveredId:void 0};if(this.isCreate?(e.forEach(({id:c})=>l[c]=void 0),a.selectedIds=[]):(e.forEach(({id:c,point:p,handles:u})=>l[c]=u?w(S({},l[c]),{point:p,handles:u}):w(S({},l[c]),{point:p})),a.selectedIds=t,n.forEach(c=>{s[c.id]=c})),this.cloneInfo.state==="ready"){let{clones:c,clonedBindings:p}=this.cloneInfo;c.forEach(u=>l[u.id]=void 0),p.forEach(u=>s[u.id]=void 0)}return{appState:{snapLines:[]},document:{pages:{[r]:{shapes:l,bindings:s}},pageStates:{[r]:a}}}});d(this,"complete",()=>{let{initialShapes:e,initialParentChildren:t,bindingsToDelete:n,app:{currentPageId:r}}=this,s={},l={},a={},c={};if(this.isCloning){if(this.cloneInfo.state==="empty"&&this.createCloneInfo(),this.cloneInfo.state!=="ready")throw Error;let{clones:p,clonedBindings:u}=this.cloneInfo;p.forEach(h=>{l[h.id]=void 0,c[h.id]=this.app.getShape(h.id),h.parentId!==r&&(l[h.parentId]=w(S({},l[h.parentId]),{children:t[h.parentId]}),c[h.parentId]=w(S({},c[h.parentId]),{children:this.app.getShape(h.parentId).children}))}),u.forEach(h=>{s[h.id]=void 0,a[h.id]=this.app.getBinding(h.id)})}else e.forEach(p=>{l[p.id]=this.isCreate?void 0:w(S({},l[p.id]),{point:p.point}),c[p.id]=S(S({},c[p.id]),this.isCreate?this.app.getShape(p.id):{point:this.app.getShape(p.id).point})});return n.forEach(p=>{var u,h,g,m,f;s[p.id]=p,l[p.fromId]=w(S({},l[p.fromId]),{id:p.fromId,handles:w(S({},(u=l[p.fromId])==null?void 0:u.handles),{[p.handleId]:w(S({},(g=(h=l[p.fromId])==null?void 0:h.handles)==null?void 0:g[p.handleId]),{bindingId:p.id})})}),c[p.fromId]=w(S({},c[p.fromId]),{id:p.fromId,handles:w(S({},c[p.fromId].handles),{[p.handleId]:w(S({},(f=(m=c[p.fromId])==null?void 0:m.handles)==null?void 0:f[p.handleId]),{bindingId:void 0})})})}),n.forEach(p=>a[p.id]=void 0),{id:"translate",before:{appState:{snapLines:[]},document:{pages:{[r]:{shapes:l,bindings:s}},pageStates:{[r]:{selectedIds:this.isCreate?[]:[...this.initialSelectedIds]}}}},after:{appState:{snapLines:[]},document:{pages:{[r]:{shapes:c,bindings:a}},pageStates:{[r]:{selectedIds:[...this.app.selectedIds]}}}}}});d(this,"createCloneInfo",()=>{let{initialShapes:e,initialParentChildren:t,app:{selectedIds:n,currentPageId:r,page:s}}=this,l={},a={},c=[],p=[];e.forEach(h=>{let g=Wt.uniqueId();t[g]=t[h.id],l[h.id]=g;let m=w(S({},Wt.deepClone(h)),{id:g,parentId:h.parentId,childIndex:B.getChildIndexAbove(this.app.state,h.id,r)});if(m.type==="video"){let f=document.getElementById(h.id+"_video");f&&(m.currentTime=(f.currentTime+16)%f.duration)}p.push(m)}),p.forEach(h=>{h.children!==void 0&&(h.children=h.children.map(g=>l[g]))}),p.forEach(h=>{n.includes(h.parentId)&&(h.parentId=l[h.parentId])});let u=new Set(Object.keys(l));Object.values(s.bindings).filter(h=>u.has(h.fromId)||u.has(h.toId)).forEach(h=>{if(u.has(h.fromId)&&u.has(h.toId)){let g=Wt.uniqueId(),m=w(S({},Wt.deepClone(h)),{id:g,fromId:l[h.fromId]||h.fromId,toId:l[h.toId]||h.toId});a[h.id]=g,c.push(m)}}),p.forEach(h=>{if(h.handles&&h.handles)for(let g in h.handles){let m=h.handles[g];m.bindingId=m.bindingId?a[m.bindingId]:void 0}}),p.forEach(h=>{if(s.shapes[h.id])throw Error("uh oh, we didn't clone correctly")}),this.cloneInfo={state:"ready",clones:p,cloneMap:l,clonedBindings:c}});this.isCreate=t,this.link=n;let{currentPageId:r,selectedIds:s,page:l}=this.app;this.initialSelectedIds=[...s];let a=(n?B.getLinkedShapeIds(this.app.state,r,n,!1):s).map(p=>this.app.getShape(p)).filter(p=>!p.isLocked),c=new Set(a.map(p=>p.id));this.hasUnlockedShapes=a.length>0,this.initialShapes=Array.from(new Set(a.filter(p=>!c.has(p.parentId)).flatMap(p=>p.children?[p,...p.children.map(u=>this.app.getShape(u))]:[p])).values()),this.initialIds=new Set(this.initialShapes.map(p=>p.id)),this.bindingsToDelete=[],Object.values(l.bindings).filter(p=>this.initialIds.has(p.fromId)||this.initialIds.has(p.toId)).forEach(p=>{this.initialIds.has(p.fromId)&&(this.initialIds.has(p.toId)||this.bindingsToDelete.push(p))}),this.initialParentChildren={},this.initialShapes.map(p=>p.parentId).filter(p=>p!==l.id).forEach(p=>{this.initialParentChildren[p]=this.app.getShape(p).children}),this.initialCommonBounds=Wt.getCommonBounds(this.initialShapes.map(B.getRotatedBounds)),this.app.rotationInfo.selectedIds=[...this.app.selectedIds]}};var $v={["arrow"]:gs,["brush"]:fs,["draw"]:Ss,["erase"]:bs,["handle"]:Ts,["rotate"]:ks,["transform"]:Cs,["transformSingle"]:ws,["translate"]:Is,["grid"]:vs,["edit"]:ys},Du=i=>$v[i];import{Utils as jv}from"telva-core";import Wv from"telva-vec";import{Utils as Gv}from"telva-core";var Ae=class extends ni{constructor(e){super();this.app=e;d(this,"type","select");d(this,"previous");d(this,"status","idle");d(this,"setStatus",e=>{this.status=e,this.app.setStatus(this.status)});d(this,"onEnter",()=>{this.setStatus("idle")});d(this,"onExit",()=>{this.setStatus("idle")});d(this,"onCancel",()=>{this.status==="idle"?this.app.selectTool("select"):this.setStatus("idle"),this.app.cancelSession()});d(this,"getNextChildIndex",()=>{let{shapes:e,appState:{currentPageId:t}}=this.app;return e.length===0?1:e.filter(n=>n.parentId===t).sort((n,r)=>r.childIndex-n.childIndex)[0].childIndex+1});d(this,"onPinchStart",()=>{this.app.cancelSession(),this.setStatus("pinching")});d(this,"onPinchEnd",()=>{Gv.isMobileSafari()&&this.app.undoSelect(),this.setStatus("idle")});d(this,"onPinch",(e,t)=>{var n;this.status==="pinching"&&(isNaN(e.delta[0])||isNaN(e.delta[1])||(this.app.pinchZoom(e.point,e.delta,e.delta[2]),(n=this.onPointerMove)==null||n.call(this,e,t)))});d(this,"onKeyDown",e=>{if(e==="Escape"){this.onCancel();return}if(e==="Meta"||e==="Control"||e==="Alt"){this.app.updateSession();return}});d(this,"onKeyUp",e=>{if(e==="Meta"||e==="Control"||e==="Alt"){this.app.updateSession();return}});d(this,"onPointerMove",()=>{this.status==="creating"&&this.app.updateSession()});d(this,"onPointerUp",()=>{if(this.status==="creating"){this.app.completeSession();let{isToolLocked:e}=this.app.appState;e||this.app.selectTool("select")}this.setStatus("idle")})}};var Qo=class extends Ae{constructor(){super(...arguments);d(this,"type","arrow");d(this,"onPointerDown",()=>{if(this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=jv.uniqueId(),c=Er.create({id:a,parentId:r,childIndex:l,point:n?Wv.snap(e,t):e,style:S({},s)});this.app.patchCreate([c]),this.app.startSession("arrow",c.id,"end",!0),this.setStatus("creating")})}};import{Utils as Nv}from"telva-core";var tr=class extends Ae{constructor(){super(...arguments);d(this,"type","draw");d(this,"lastShapeId");d(this,"onEnter",()=>{this.lastShapeId=void 0});d(this,"onCancel",()=>{switch(this.status){case"idle":{this.app.selectTool("select");break}default:{this.setStatus("idle");break}}this.app.cancelSession()});d(this,"onPointerDown",e=>{if(this.status!=="idle"||this.app.readOnly)return;let{currentPoint:t,appState:{currentPageId:n,currentStyle:r}}=this.app,s=this.lastShapeId&&this.app.getShape(this.lastShapeId);if(e.shiftKey&&s)this.app.startSession("draw",s.id),this.setStatus("extending");else{let l=this.getNextChildIndex(),a=Nv.uniqueId(),c=Ia.create({id:a,parentId:n,childIndex:l,point:t,style:S({},r)});this.lastShapeId=a,this.app.patchCreate([c]),this.app.startSession("draw",a),this.setStatus("creating")}});d(this,"onPointerMove",()=>{if(!this.app.readOnly)switch(this.status){case"extending":case"creating":this.app.updateSession()}});d(this,"onPointerUp",()=>{this.app.completeSession(),this.setStatus("idle")})}};import{TLBoundsCorner as Uv,Utils as Kv}from"telva-core";import _v from"telva-vec";var nr=class extends Ae{constructor(){super(...arguments);d(this,"type","ellipse");d(this,"onPointerDown",()=>{if(this.app.readOnly||this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=Kv.uniqueId(),c=wa.create({id:a,parentId:r,childIndex:l,point:n?_v.snap(e,t):e,style:S({},s)});this.app.patchCreate([c]),this.app.startSession("transformSingle",c.id,Uv.BottomRight,!0),this.setStatus("creating")})}};import Yv from"telva-vec";var or=class extends Ae{constructor(){super(...arguments);d(this,"type","erase");d(this,"status","idle");d(this,"onPointerDown",()=>{this.app.readOnly||this.status==="idle"&&this.setStatus("pointing")});d(this,"onPointerMove",e=>{if(!this.app.readOnly)switch(this.status){case"pointing":{Yv.dist(e.origin,e.point)>3&&(this.app.startSession("erase"),this.app.updateSession(),this.setStatus("erasing"));break}case"erasing":this.app.updateSession()}});d(this,"onPointerUp",()=>{if(!this.app.readOnly){switch(this.status){case"pointing":{let e=this.app.shapes.filter(t=>!t.isLocked).filter(t=>this.app.getShapeUtil(t).hitTestPoint(t,this.app.currentPoint)).flatMap(t=>t.children?[t.id,...t.children]:t.id);this.app.delete(e);break}case"erasing":this.app.completeSession()}this.setStatus("idle")}});d(this,"onCancel",()=>{this.status==="idle"?this.previous?this.app.selectTool(this.previous):this.app.selectTool("select"):this.setStatus("idle"),this.app.cancelSession()})}};import{Utils as Xv}from"telva-core";import Zv from"telva-vec";var rr=class extends Ae{constructor(){super(...arguments);d(this,"type","line");d(this,"onPointerDown",()=>{if(this.app.readOnly||this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=Xv.uniqueId(),c=Er.create({id:a,parentId:r,childIndex:l,point:n?Zv.snap(e,t):e,decorations:{start:void 0,end:void 0},style:S({},s)});this.app.patchCreate([c]),this.app.startSession("arrow",c.id,"end",!0),this.setStatus("creating")})}};import{Utils as qv}from"telva-core";import mn from"telva-vec";var Jv=4,ir=class extends Ae{constructor(){super(...arguments);d(this,"type","pen");d(this,"currentShapeId");d(this,"downPoint");d(this,"currentSegmentIdx",0);d(this,"onEnter",()=>{this.currentShapeId=void 0,this.downPoint=void 0,this.currentSegmentIdx=0,this.setStatus("idle")});d(this,"onExit",()=>{this.currentShapeId&&this.finishShape(),this.currentShapeId=void 0,this.downPoint=void 0,this.currentSegmentIdx=0,this.setStatus("idle")});d(this,"onCancel",()=>{this.currentShapeId&&(this.app.delete([this.currentShapeId]),this.currentShapeId=void 0),this.downPoint=void 0,this.currentSegmentIdx=0,this.setStatus("idle")});d(this,"onPointerDown",e=>{if(this.app.readOnly||e.spaceKey)return;let t=this.app.getPagePoint(e.point);if(this.downPoint=t,this.status==="idle"||!this.currentShapeId){this.startNewShape(t),this.setStatus("placing");return}if(this.status==="drawing"){if(this.isNearFirstNode(t)){let r=this.getShape();if(r&&r.segments.length>=2){let{segments:s,offset:l}=ma(r.segments,!0);this.app.updateShapes({id:r.id,point:mn.add(r.point,l),segments:s,isClosed:!0,isComplete:!0,isPlacingHandle:!1}),this.app.select(r.id),this.currentShapeId=void 0,this.downPoint=void 0,this.setStatus("idle");return}}let n=this.toLocal(t);this.addSegment(n),this.setPreview(t,!0),this.setStatus("placing")}});d(this,"onPointerMove",e=>{if(this.app.readOnly||e.spaceKey||!this.currentShapeId)return;let t=this.app.getPagePoint(e.point);if(this.status==="drawing"){this.setPreview(t,!1);return}if(this.status==="placing"&&this.downPoint)if(this.setPreview(t,!0),mn.dist(t,this.downPoint)>Jv){let r=this.getShape();if(!r||r.segments.length===0)return;let s=r.segments[r.segments.length-1].point,l=mn.sub(this.downPoint,r.point),a=mn.sub(mn.sub(t,r.point),l),c=mn.add(s,a),p=wr(s,c);this.updateLastSegmentHandles(p,c)}else this.updateLastSegmentHandles(void 0,void 0)});d(this,"onPointerUp",e=>{if(!this.app.readOnly&&this.status==="placing"){let t=this.app.getPagePoint(e.point);this.setPreview(t,!1),this.downPoint=void 0,this.setStatus("drawing")}});d(this,"onDoubleClickCanvas",()=>{if(!this.app.readOnly&&this.currentShapeId){let e=this.getShape();if(e&&e.segments.length>1){let t=e.segments.slice(0,-1);this.patchCurrentShape({segments:t})}this.finishShape(),this.setStatus("idle")}});d(this,"onKeyDown",(e,t,n)=>{switch(e){case"Escape":{this.onCancel();break}case"Enter":{this.currentShapeId&&(this.finishShape(),this.setStatus("idle"));break}}})}getShape(){if(!!this.currentShapeId)return this.app.getShape(this.currentShapeId)}get currentSegments(){var e,t;return(t=(e=this.getShape())==null?void 0:e.segments)!=null?t:[]}patchCurrentShape(e){let t=this.getShape();!t||this.app.patchState({document:{pages:{[this.app.currentPageId]:{shapes:{[t.id]:e}}}}})}setPreview(e,t){let n=this.getShape();if(!n)return;let r=mn.sub(e,n.point);this.patchCurrentShape({previewPoint:r,isPlacingHandle:t})}startNewShape(e){let{appState:{currentPageId:t,currentStyle:n}}=this.app,r=qv.uniqueId(),s=this.getNextChildIndex(),l={point:[0,0]},a={id:r,type:"pen",name:"Pen",parentId:t,childIndex:s,point:e,rotation:0,style:S({},n),segments:[l],isClosed:!1,isComplete:!1,previewPoint:[0,0],isPlacingHandle:!0};this.currentShapeId=r,this.currentSegmentIdx=0,this.app.patchCreate([a])}addSegment(e,t,n){let r=this.getShape();if(!r)return;let s={point:e,cp1:t,cp2:n},l=[...r.segments,s];this.currentSegmentIdx=l.length-1,this.patchCurrentShape({segments:l})}updateLastSegmentHandles(e,t){let n=this.getShape();if(!n||n.segments.length===0)return;let r=[...n.segments],s=r[r.length-1];r[r.length-1]=w(S({},s),{cp1:e,cp2:t}),this.patchCurrentShape({segments:r})}toLocal(e){let t=this.getShape();return t?mn.sub(e,t.point):e}isNearFirstNode(e){var r;let t=this.getShape();if(!t||t.segments.length<2)return!1;let n=mn.add(t.point,t.segments[0].point);return mn.dist(e,n)<=10/((r=this.app.zoom)!=null?r:1)}finishShape(){let e=this.currentShapeId;if(!e)return;let t=this.app.getShape(e);if(!t)return;let{segments:n,offset:r}=ma(t.segments,t.isClosed),s=mn.add(t.point,r);this.app.updateShapes({id:e,point:s,segments:n,isComplete:!0,isPlacingHandle:!1}),this.app.select(e),this.currentShapeId=void 0,this.downPoint=void 0,this.currentSegmentIdx=0}};import{TLBoundsCorner as Qv,Utils as eT}from"telva-core";import tT from"telva-vec";var sr=class extends Ae{constructor(){super(...arguments);d(this,"type","rectangle");d(this,"onPointerDown",()=>{if(this.app.readOnly||this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=eT.uniqueId(),c=ka.create({id:a,parentId:r,childIndex:l,point:n?tT.snap(e,t):e,style:S({},s)});this.app.patchCreate([c]),this.app.startSession("transformSingle",c.id,Qv.BottomRight,!0),this.setStatus("creating")})}};import{Utils as Yr}from"telva-core";import Yn from"telva-vec";var ar=class extends Ae{constructor(){super(...arguments);d(this,"type","select");d(this,"pointedId");d(this,"selectedGroupId");d(this,"pointedHandleId");d(this,"pointedBoundsHandle");d(this,"pointedLinkHandleId");d(this,"onEnter",()=>{this.setStatus("idle")});d(this,"onExit",()=>{this.setStatus("idle")});d(this,"clonePaint",e=>{if(this.app.selectedIds.length===0)return;let t=this.app.selectedIds.map(p=>this.app.getShape(p)),n=Yr.expandBounds(Yr.getCommonBounds(t.map(B.getBounds)),16),r=Yr.getBoundsCenter(n),s=[n.width,n.height],l=[r[0]+s[0]*Math.floor((e[0]+s[0]/2-r[0])/s[0]),r[1]+s[1]*Math.floor((e[1]+s[1]/2-r[1])/s[1])],a=Yr.centerBounds(n,l);this.app.shapes.some(p=>B.getShapeUtil(p).hitTestBounds(p,a))||this.app.duplicate(this.app.selectedIds,l)});d(this,"getShapeClone",(e,t)=>{let n=this.app.getShape(e),r=B.getShapeUtil(n);if(r.canClone){let s=r.getBounds(n),l=r.getCenter(n),a={top:[s.minX,s.minY-(s.height+32)],right:[s.maxX+32,s.minY],bottom:[s.minX,s.maxY+32],left:[s.minX-(s.width+32),s.minY],topLeft:[s.minX-(s.width+32),s.minY-(s.height+32)],topRight:[s.maxX+32,s.minY-(s.height+32)],bottomLeft:[s.minX-(s.width+32),s.maxY+32],bottomRight:[s.maxX+32,s.maxY+32]}[t];if(n.rotation!==0){let u=Yn.add(a,[s.width/2,s.height/2]),h=Yn.rotWith(u,l,n.rotation||0);a=Yn.sub(h,[s.width/2,s.height/2])}let c=Yr.uniqueId(),p=w(S({},n),{id:c,point:a});return p.type==="sticky"&&(p.text=""),p}});d(this,"onCancel",()=>{this.app.session?this.app.cancelSession():this.selectNone(),this.setStatus("idle")});d(this,"onKeyDown",(e,t,n)=>{switch(e){case"Escape":{this.onCancel();break}case"Tab":{if(this.app.readOnly)return;if(!this.app.pageState.editingId&&this.status==="idle"&&this.app.selectedIds.length===1){let[r]=this.app.selectedIds,s=this.getShapeClone(r,"right");s&&(this.app.createShapes(s),this.setStatus("idle"),s.type==="sticky"&&(this.app.select(s.id),this.app.setEditingId(s.id)))}break}case"Meta":case"Control":case"Alt":{this.app.updateSession();break}case"Enter":{if(this.app.readOnly)return;let{pageState:r}=this.app;r.selectedIds.length===1&&!r.editingId&&(this.app.setEditingId(r.selectedIds[0]),n.preventDefault())}}});d(this,"onKeyUp",(e,t)=>{if(this.status==="clonePainting"&&!(t.altKey&&t.shiftKey)){this.setStatus("idle");return}if(e==="Meta"||e==="Control"||e==="Alt"){this.app.updateSession();return}});d(this,"onPointerMove",()=>{let{originPoint:e,currentPoint:t}=this.app;if(this.app.readOnly&&this.app.isPointing){this.app.session?this.app.updateSession():Yn.dist(e,t)>3&&(this.app.startSession("brush"),this.setStatus("brushing"));return}switch(this.status){case"pointingBoundsHandle":{if(!this.pointedBoundsHandle)throw Error("No pointed bounds handle");if(Yn.dist(e,t)>3){if(this.pointedBoundsHandle==="rotate")this.setStatus("rotating"),this.app.startSession("rotate");else if(this.pointedBoundsHandle==="center"||this.pointedBoundsHandle==="left"||this.pointedBoundsHandle==="right")this.setStatus("translating"),this.app.startSession("translate",!1,this.pointedBoundsHandle);else{this.setStatus("transforming");let n=this.app.selectedIds.flatMap(r=>B.getDocumentBranch(this.app.state,r,this.app.currentPageId));n.length===1?this.app.startSession("transformSingle",n[0],this.pointedBoundsHandle):this.app.startSession("transform",this.pointedBoundsHandle)}this.app.updateSession()}break}case"pointingCanvas":{Yn.dist(e,t)>3&&(this.app.startSession("brush"),this.setStatus("brushing"));break}case"pointingClone":{Yn.dist(e,t)>3&&(this.setStatus("translatingClone"),this.app.startSession("translate"),this.app.updateSession());break}case"pointingBounds":{Yn.dist(e,t)>3&&(this.setStatus("translating"),this.app.startSession("translate"),this.app.updateSession());break}case"pointingHandle":{if(!this.pointedHandleId)throw Error("No pointed handle");if(Yn.dist(e,t)>3){this.setStatus("translatingHandle");let n=this.app.getShape(this.app.selectedIds[0]);n&&(this.pointedHandleId==="bend"?(this.app.startSession("handle",n.id,this.pointedHandleId),this.app.updateSession()):(this.app.startSession("arrow",n.id,this.pointedHandleId,!1),this.app.updateSession()))}break}case"clonePainting":{this.clonePaint(t);break}default:if(this.app.session){this.app.updateSession();break}}});d(this,"onPointerDown",(e,t)=>{if(e.target==="canvas"&&this.status==="idle"){let{currentPoint:n}=this.app;if(e.spaceKey&&t.buttons===1)return;if(this.status==="idle"&&e.altKey&&e.shiftKey){this.setStatus("clonePainting"),this.clonePaint(n);return}if(!e.shiftKey){if(this.app.onShapeBlur(),e.altKey&&this.app.selectedIds.length>0){this.app.duplicate(this.app.selectedIds,n);return}this.selectNone()}this.setStatus("pointingCanvas")}});d(this,"onPointerUp",e=>{var t;if(this.status==="translatingClone"||this.status==="pointingClone"){this.pointedId&&(this.app.completeSession(),this.app.setEditingId(this.pointedId)),this.setStatus("idle"),this.pointedId=void 0;return}if(this.status==="pointingBounds"){if(e.target==="bounds")this.selectNone();else if(this.app.isSelected(e.target))e.shiftKey?this.pointedId!==e.target&&this.deselect(e.target):this.pointedId!==e.target&&this.app.selectedIds.length>1&&this.select(e.target);else if(this.pointedId===e.target){if(this.app.getShape(e.target).isLocked)return;e.shiftKey?this.pushSelect(e.target):this.select(e.target)}}this.setStatus("idle"),this.pointedBoundsHandle=void 0,this.pointedHandleId=void 0,this.pointedId=void 0,((t=this.app.session)==null?void 0:t.type)!=="edit"&&this.app.completeSession()});d(this,"onDoubleClickCanvas",()=>{this.app.readOnly});d(this,"onPointShape",(e,t)=>{if(e.spaceKey&&t.buttons===1||this.app.getShape(e.target).isLocked)return;let{editingId:n,hoveredId:r}=this.app.pageState;if(n&&e.target!==n&&this.app.onShapeBlur(),(this.status==="idle"||this.status==="pointingBounds")&&e.metaKey&&e.shiftKey&&r){this.pointedId=r,this.app.isSelected(r)?this.deselect(r):(this.pushSelect(r),this.setStatus("pointingBounds"));return}if(this.status==="pointingBounds"){let{parentId:s}=this.app.getShape(e.target);this.pointedId=s===this.app.currentPageId?e.target:s;return}if(this.status==="idle"){if(this.setStatus("pointingBounds"),e.metaKey){e.shiftKey||this.selectNone(),this.app.startSession("brush"),this.setStatus("brushing");return}let s,{parentId:l}=this.app.getShape(e.target);l===this.app.currentPageId?(s=e.target,this.selectedGroupId=void 0):l===this.selectedGroupId?s=e.target:(s=l,this.selectedGroupId=void 0),this.app.isSelected(s)||(this.pointedId=s,e.shiftKey?this.pushSelect(s):this.select(s))}});d(this,"onDoubleClickShape",e=>{if(this.app.readOnly)return;let t=this.app.getShape(e.target);if(t.isLocked){this.app.select(e.target);return}B.getShapeUtil(t.type).canEdit&&(t.parentId===this.app.currentPageId||t.parentId===this.selectedGroupId)&&this.app.setEditingId(e.target),t.parentId!==this.app.currentPageId&&(this.selectedGroupId=t.parentId),this.app.select(e.target)});d(this,"onRightPointShape",e=>{this.app.isSelected(e.target)||this.app.select(e.target)});d(this,"onHoverShape",e=>{this.app.setHoveredId(e.target)});d(this,"onUnhoverShape",e=>{let{currentPageId:t}=this.app;requestAnimationFrame(()=>{t===this.app.currentPageId&&this.app.pageState.hoveredId===e.target&&this.app.setHoveredId(void 0)})});d(this,"onPointBounds",e=>{if(e.metaKey){e.shiftKey||this.selectNone(),this.app.startSession("brush"),this.setStatus("brushing");return}this.setStatus("pointingBounds")});d(this,"onRightPointBounds",(e,t)=>{t.stopPropagation()});d(this,"onReleaseBounds",()=>{(this.status==="translating"||this.status==="brushing")&&this.app.completeSession(),this.setStatus("idle")});d(this,"onPointBoundsHandle",e=>{this.pointedBoundsHandle=e.target,this.setStatus("pointingBoundsHandle")});d(this,"onDoubleClickBoundsHandle",e=>{switch(e.target){case"center":case"left":case"right":{this.app.select(...B.getLinkedShapeIds(this.app.state,this.app.currentPageId,e.target,e.shiftKey));break}default:if(this.app.selectedIds.length===1){this.app.resetBounds(this.app.selectedIds);let t=this.app.getShape(this.app.selectedIds[0]);"label"in t&&this.app.setEditingId(t.id)}}});d(this,"onReleaseBoundsHandle",()=>{this.setStatus("idle")});d(this,"onPointHandle",e=>{this.pointedHandleId=e.target,this.setStatus("pointingHandle")});d(this,"onDoubleClickHandle",e=>{if(e.target==="bend"){let{selectedIds:t}=this.app;if(t.length!==1)return;let n=this.app.getShape(t[0]);B.getShapeUtil(n.type).canEdit&&(n.parentId===this.app.currentPageId||n.parentId===this.selectedGroupId)&&this.app.setEditingId(n.id);return}this.app.toggleDecoration(e.target)});d(this,"onReleaseHandle",()=>{this.setStatus("idle")});d(this,"onShapeClone",e=>{let t=this.app.selectedIds[0],n=this.getShapeClone(t,e.target);e.target==="left"||e.target==="right"||e.target==="top"||e.target==="bottom"?n&&(this.app.createShapes(n),this.pointedId=n.id,this.setStatus("pointingClone")):(this.setStatus("gridCloning"),this.app.startSession("grid",t))})}deselect(e){this.app.select(...this.app.selectedIds.filter(t=>t!==e))}select(e){this.app.select(e)}pushSelect(e){let t=this.app.getShape(e);this.app.select(...this.app.selectedIds.filter(n=>n!==t.parentId),e)}selectNone(){this.app.selectNone()}};import{Utils as nT}from"telva-core";import Eu from"telva-vec";var lr=class extends Ae{constructor(){super(...arguments);d(this,"type","sticky");d(this,"shapeId");d(this,"onPointerDown",()=>{if(!this.app.readOnly){if(this.status==="creating"){this.setStatus("idle"),this.app.appState.isToolLocked||this.app.selectTool("select");return}if(this.status==="idle"){let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=nT.uniqueId();this.shapeId=a;let c=_i.create({id:a,parentId:r,childIndex:l,point:n?Eu.snap(e,t):e,style:S({},s)}),p=_i.getBounds(c);c.point=Eu.sub(c.point,[p.width/2,p.height/2]),this.app.patchCreate([c]),this.app.startSession("translate"),this.setStatus("creating")}}});d(this,"onPointerUp",()=>{this.app.readOnly||this.status==="creating"&&(this.setStatus("idle"),this.app.completeSession(),this.app.selectTool("select"),this.app.setEditingId(this.shapeId))})}};import oT from"telva-vec";var dr=class extends Ae{constructor(){super(...arguments);d(this,"type","text");d(this,"stopEditingShape",()=>{this.setStatus("idle"),this.app.appState.isToolLocked||this.app.selectTool("select")});d(this,"onKeyUp",()=>{});d(this,"onKeyDown",()=>{});d(this,"onPointerDown",()=>{if(this.status==="creating"){this.stopEditingShape();return}if(this.status==="idle"){let{currentPoint:e,currentGrid:t,settings:{showGrid:n}}=this.app;this.app.createTextShapeAtPoint(n?oT.snap(e,t):e,void 0,!0),this.setStatus("creating");return}});d(this,"onPointerUp",()=>{});d(this,"onPointShape",e=>{if(this.app.readOnly)return;let t=this.app.getShape(e.target);t.type==="text"&&(this.setStatus("idle"),this.app.setEditingId(t.id))});d(this,"onShapeBlur",()=>{this.app.readOnly||this.stopEditingShape()})}};import{TLBoundsCorner as rT,Utils as iT}from"telva-core";import sT from"telva-vec";var cr=class extends Ae{constructor(){super(...arguments);d(this,"type","triangle");d(this,"onPointerDown",()=>{if(this.app.readOnly||this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=iT.uniqueId(),c=Ca.create({id:a,parentId:r,childIndex:l,point:n?sT.snap(e,t):e,style:S({},s)});this.app.patchCreate([c]),this.app.startSession("transformSingle",c.id,rT.BottomRight,!0),this.setStatus("creating")})}};var il=ct.uniqueId(),Ke=class extends cs{constructor(e,t={}){super(Ke.defaultState,e,Ke.version,(n,r,s)=>Dn(w(S({},r),{document:w(S(S({},r.document),n.document),{version:s})}),Ke.version));d(this,"callbacks",{});d(this,"tools",{select:new ar(this),erase:new or(this),["text"]:new dr(this),["draw"]:new tr(this),["ellipse"]:new nr(this),["rectangle"]:new sr(this),["triangle"]:new cr(this),["line"]:new rr(this),["arrow"]:new Qo(this),["sticky"]:new lr(this),["pen"]:new ir(this)});d(this,"currentTool",this.tools.select);d(this,"session");d(this,"readOnly",!1);d(this,"isDirty",!1);d(this,"isCreating",!1);d(this,"originPoint",[0,0]);d(this,"currentPoint",[0,0]);d(this,"previousPoint",[0,0]);d(this,"shiftKey",!1);d(this,"altKey",!1);d(this,"metaKey",!1);d(this,"ctrlKey",!1);d(this,"spaceKey",!1);d(this,"isPointing",!1);d(this,"isForcePanning",!1);d(this,"isErasingWithPen",!1);d(this,"isPastePrevented",!1);d(this,"editingStartTime",-1);d(this,"fileSystemHandle",null);d(this,"viewport",ct.getBoundsFromPoints([[0,0],[100,100]]));d(this,"rendererBounds",ct.getBoundsFromPoints([[0,0],[100,100]]));d(this,"selectHistory",{stack:[[]],pointer:0});d(this,"clipboard");d(this,"rotationInfo",{selectedIds:[],center:[0,0]});d(this,"migrate",e=>Dn(e,Ke.version));d(this,"onReady",()=>{var e,t;this.loadDocument(this.document),qa().then(n=>{this.fileSystemHandle=n});try{this.patchState(w(S({},Dn(this.state,Ke.version)),{appState:{status:"idle"}}))}catch(n){console.error("The data appears to be corrupted. Resetting!",n),localStorage.setItem(this.document.id+"_corrupted",JSON.stringify(this.document)),this.patchState(w(S({},Ke.defaultState),{appState:w(S({},Ke.defaultState.appState),{status:"idle"})}))}(t=(e=this.callbacks).onMount)==null||t.call(e,this)});d(this,"cleanup",(e,t)=>{var l,a,c,p,u;let n=S({},e);n.document!==t.document&&Object.entries(n.document.pages).forEach(([h,g])=>{if(g===void 0){delete n.document.pages[h],delete n.document.pageStates[h];return}let m=t.document.pages[h],f={};if(!m||g.shapes!==m.shapes||g.bindings!==m.bindings){g.shapes=S({},g.shapes),g.bindings=S({},g.bindings);let b=new Set;Object.entries(g.shapes).forEach(([x,I])=>{var R;let k;I?k=I.parentId:(k=(R=m==null?void 0:m.shapes[x])==null?void 0:R.parentId,delete g.shapes[x]),g.id===n.appState.currentPageId&&(m==null?void 0:m.shapes[x])!==I&&(f[x]=I),k&&k!==h&&g.shapes[k]!==void 0&&b.add(g.shapes[k])}),Object.keys(g.bindings).forEach(x=>{g.bindings[x]||delete g.bindings[x]}),n.document.pages[h]=g;let T=B.getRelatedBindings(n,Object.keys(f),h),y=new Set;T.forEach(x=>{if(!g.bindings[x.id])return;let I=g.shapes[x.toId],k=g.shapes[x.fromId];if(!(I&&k)){delete n.document.pages[h].bindings[x.id];return}if(y.has(k))return;let R=B.updateArrowBindings(g,k);if(y.add(k),R){let C=S(S({},k),R);g.shapes[k.id]=C}}),b.forEach(x=>{if(!x)throw Error("no group!");let I=x.children.filter(R=>g.shapes[R]!==void 0),k=ct.getCommonBounds(I.map(R=>g.shapes[R]).filter(Boolean).map(R=>B.getRotatedBounds(R)));g.shapes[x.id]=w(S({},x),{point:[k.minX,k.minY],size:[k.width,k.height],children:I})})}let v=S({},n.document.pageStates[h]);v.brush||delete v.brush,v.hoveredId&&!g.shapes[v.hoveredId]&&delete v.hoveredId,v.bindingId&&!g.bindings[v.bindingId]&&(B.warn(`Could not find the binding of ${h}`),delete v.bindingId),v.editingId&&!g.shapes[v.editingId]&&(B.warn("Could not find the editing shape!"),delete v.editingId),n.document.pageStates[h]=v}),Object.keys((l=n.document.assets)!=null?l:{}).forEach(h=>{var g,m;(g=n.document.assets)!=null&&g[h]||(m=n.document.assets)==null||delete m[h]});let r=n.appState.currentPageId,s=n.document.pageStates[r];if(n.room&&n.room!==t.room){let h=w(S({},n.room),{users:S({},n.room.users)});t.room&&Object.values(t.room.users).filter(Boolean).forEach(g=>{h.users[g.id]===void 0&&delete h.users[g.id]}),n.room=h}if(n.room){let h=n.room.users[n.room.userId];n.room.users[n.room.userId]=w(S({},h),{id:(a=h==null?void 0:h.id)!=null?a:n.room.userId,color:(c=h==null?void 0:h.color)!=null?c:Si[0],activeShapes:(p=h==null?void 0:h.activeShapes)!=null?p:[],status:(u=h==null?void 0:h.status)!=null?u:"connected",point:this.currentPoint,selectedIds:s.selectedIds})}return this.readOnly&&(n.document.pages=t.document.pages),n});d(this,"broadcastPatch",(e,t)=>{var p,u,h,g,m,f,v,b,T;let n={},r={},s={},l=(h=(u=(p=e==null?void 0:e.document)==null?void 0:p.pages)==null?void 0:u[this.currentPageId])==null?void 0:h.shapes,a=(f=(m=(g=e==null?void 0:e.document)==null?void 0:g.pages)==null?void 0:m[this.currentPageId])==null?void 0:f.bindings,c=(v=e==null?void 0:e.document)==null?void 0:v.assets;l&&Object.keys(l).forEach(y=>{n[y]=this.getShape(y,this.currentPageId)}),a&&Object.keys(a).forEach(y=>{r[y]=this.getBinding(y,this.currentPageId)}),c&&Object.keys(c).forEach(y=>{s[y]=this.document.assets[y]}),(T=(b=this.callbacks).onChangePage)==null||T.call(b,this,n,r,s,t)});d(this,"onPatch",(e,t,n)=>{var r,s,l,a,c,p;(this.callbacks.onChangePage&&((s=(r=t==null?void 0:t.document)==null?void 0:r.pages)==null?void 0:s[this.currentPageId])||((l=t==null?void 0:t.document)==null?void 0:l.assets))&&(((a=t==null?void 0:t.document)==null?void 0:a.assets)||this.session&&this.session.type!=="brush"&&this.session.type!=="erase"&&this.session.type!=="draw")&&this.broadcastPatch(t,!1),(p=(c=this.callbacks).onPatch)==null||p.call(c,this,t,n)});d(this,"onCommand",(e,t,n)=>{var r,s;this.clearSelectHistory(),this.isDirty=!0,(s=(r=this.callbacks).onCommand)==null||s.call(r,this,t,n)});d(this,"onReplace",()=>{this.clearSelectHistory(),this.isDirty=!1});d(this,"onUndo",()=>{var e,t;this.rotationInfo.selectedIds=[...this.selectedIds],(t=(e=this.callbacks).onUndo)==null||t.call(e,this)});d(this,"onRedo",()=>{var e,t;this.rotationInfo.selectedIds=[...this.selectedIds],(t=(e=this.callbacks).onRedo)==null||t.call(e,this)});d(this,"onPersist",(e,t)=>{var n,r;(r=(n=this.callbacks).onPersist)==null||r.call(n,this),this.broadcastPatch(t,!0)});d(this,"prevSelectedIds",this.selectedIds);d(this,"onStateDidChange",(e,t)=>{var n,r,s,l;(r=(n=this.callbacks).onChange)==null||r.call(n,this,t),this.room&&this.selectedIds!==this.prevSelectedIds&&((l=(s=this.callbacks).onChangePresence)==null||l.call(s,this,w(S({},this.room.users[this.room.userId]),{selectedIds:this.selectedIds,session:!!this.session})),this.prevSelectedIds=this.selectedIds)});d(this,"preventPaste",()=>{if(this.isPastePrevented)return;let e=n=>n.stopImmediatePropagation(),t=()=>{setTimeout(()=>{document.removeEventListener("paste",e,{capture:!0}),this.isPastePrevented=!1},50)};document.addEventListener("paste",e,{capture:!0}),window.addEventListener("pointerup",t,{once:!0}),this.isPastePrevented=!0});d(this,"justSent",!1);d(this,"getReservedContent",(e,t=this.currentPageId)=>{let{bindings:n}=this.document.pages[t],r={},s={},l=Object.values(n),a=new Map(l.map(m=>[m.toId,m])),c=new Map(l.map(m=>[m.fromId,m])),p=[a,c],u=[];this.session&&e.forEach(m=>u.push(m)),this.pageState.editingId&&u.push(this.pageState.editingId);let h=new Set(u),g=new Set;for(;u.length>0;){let m=u.pop();if(!m)break;if(g.has(m))continue;g.add(m);let f=this.getShape(m);r[m]=f,f.parentId!==t&&u.push(f.parentId),f.children&&u.push(...f.children),p.map(v=>v.get(f.id)).filter(Boolean).forEach(v=>{s[v.id]=v,u.push(v.toId,v.fromId)})}return{reservedShapes:r,reservedBindings:s,strongReservedShapeIds:h}});d(this,"replacePageContent",(e,t,n,r=this.currentPageId)=>{if(this.justSent)return this.justSent=!1,this;let s=this.document.pages[this.currentPageId];return Object.values(e).forEach(l=>{l.parentId!==r&&!(s.shapes[l.parentId]||e[l.parentId])&&(console.warn("Added a shape without a parent on the page"),l.parentId=r)}),this.useStore.setState(l=>{let{hoveredId:a,editingId:c,bindingId:p,selectedIds:u}=l.document.pageStates[r],h=[...u],g=c&&l.document.pages[this.currentPageId].shapes[c];g&&h.push(g.id);let{reservedShapes:m,reservedBindings:f,strongReservedShapeIds:v}=this.getReservedContent(h,this.currentPageId);Object.values(m).filter(C=>!("text"in C)).forEach(C=>{let E=e[C.id];if(!!E){if(!(C.type==="arrow"||v.has(C.id))){e[C.id]=E;return}"decorations"in E&&"decorations"in C&&(e[C.id]=w(S({},C),{decorations:E.decorations})),C.style=E.style}});let b=S(S({},e),m);g&&(b[g.id]=g);let T=S(S({},t),f),y=S({},n),x=w(S({},l),{document:w(S({},l.document),{pages:{[r]:w(S({},l.document.pages[r]),{shapes:b,bindings:T})},assets:y,pageStates:w(S({},l.document.pageStates),{[r]:w(S({},l.document.pageStates[r]),{selectedIds:u.filter(C=>b[C]!==void 0),hoveredId:a?b[a]===void 0?void 0:a:void 0,editingId:c,bindingId:p?T[p]===void 0?void 0:p:void 0})})})}),I=x.document.pages[r],k=B.getRelatedBindings(x,Object.keys(b),r),R=new Set;return k.forEach(C=>{if(!I.bindings[C.id])return;let E=I.shapes[C.fromId];if(R.has(E))return;let M=B.updateArrowBindings(I,E);if(R.add(E),M){let L=S(S({},E),M);I.shapes[E.id]=L}}),Object.values(b).forEach(C=>{if(C.type!=="group")return;let E=C.children.filter(L=>I.shapes[L]!==void 0),M=ct.getCommonBounds(E.map(L=>I.shapes[L]).filter(Boolean).map(L=>B.getRotatedBounds(L)));I.shapes[C.id]=w(S({},C),{point:[M.minX,M.minY],size:[M.width,M.height],children:E})}),this.state.document=x.document,x},!0),this});d(this,"updateBounds",e=>{this.rendererBounds=e;let{point:t,zoom:n}=this.camera;this.updateViewport(t,n),!this.readOnly&&this.session&&this.session.update()});d(this,"updateViewport",(e,t)=>{let{width:n,height:r}=this.rendererBounds,[s,l]=se.sub(se.div([0,0],t),e),[a,c]=se.sub(se.div([n,r],t),e);this.viewport={minX:s,minY:l,maxX:a,maxY:c,width:a-s,height:c-l}});d(this,"setEditingId",(e,t=!1)=>{if(!this.readOnly){if(e)this.startSession("edit",e,t);else{if(!this.pageState.editingId)return;this.completeSession()}this.editingStartTime=performance.now(),this.patchState({document:{pageStates:{[this.currentPageId]:{editingId:e}}}},"set_editing_id")}});d(this,"setHoveredId",e=>{this.patchState({document:{pageStates:{[this.currentPageId]:{hoveredId:e}}}},"set_hovered_id")});d(this,"setNodeEditingId",e=>{this.patchState({appState:{nodeEditingId:e}},"set_node_editing_id")});d(this,"setSetting",(e,t)=>{if(this.session)return this;let n={settings:{[e]:typeof t=="function"?t(this.settings[e]):t}};return this.patchState(n,`settings:${e}`),this.persist(n),this});d(this,"toggleFocusMode",()=>{if(this.session)return this;let e={settings:{isFocusMode:!this.settings.isFocusMode}};return this.patchState(e,"settings:toggled_focus_mode"),this.persist(e),this});d(this,"togglePenMode",()=>{if(this.session)return this;let e={settings:{isPenMode:!this.settings.isPenMode}};return this.patchState(e,"settings:toggled_pen_mode"),this.persist(e),this});d(this,"toggleDarkMode",()=>{if(this.session)return this;let e={settings:{isDarkMode:!this.settings.isDarkMode}};return this.patchState(e,"settings:toggled_dark_mode"),this.persist(e),this});d(this,"toggleZoomSnap",()=>{if(this.session)return this;let e={settings:{isZoomSnap:!this.settings.isZoomSnap}};return this.patchState(e,"settings:toggled_zoom_snap"),this.persist(e),this});d(this,"toggleDebugMode",()=>{if(this.session)return this;let e={settings:{isDebugMode:!this.settings.isDebugMode}};return this.patchState(e,"settings:toggled_debug"),this.persist(e),this});d(this,"setMenuOpen",e=>{let t={appState:{isMenuOpen:e}};return this.patchState(t,"ui:toggled_menu_opened"),this.persist(t),this});d(this,"setIsLoading",e=>{let t={appState:{isLoading:e}};return this.patchState(t,"ui:toggled_is_loading"),this.persist(t),this});d(this,"setDisableAssets",e=>(this.patchState({appState:{disableAssets:e}},"ui:toggled_disable_images"),this));d(this,"toggleGrid",()=>{if(this.session)return this;let e={settings:{showGrid:!this.settings.showGrid}};return this.patchState(e,"settings:toggled_grid"),this.persist(e),this});d(this,"toggleCanvasMode",()=>{if(this.session)return this;let t={settings:{canvasMode:this.settings.canvasMode==="freehand"?"straight":"freehand"}};return this.patchState(t,"settings:toggled_canvas_mode"),this.persist(t),this});d(this,"selectTool",e=>{if(this.readOnly||this.session)return this;this.isPointing=!1;let t=this.tools[e];return t===this.currentTool?(this.patchState({appState:{isToolLocked:!1}}),this):(this.currentTool.onExit(),t.previous=this.currentTool.type,this.currentTool=t,this.currentTool.onEnter(),this.patchState({appState:{activeTool:e,isToolLocked:!1}},`selected_tool:${e}`))});d(this,"toggleToolLock",()=>this.session?this:this.patchState({appState:{isToolLocked:!this.appState.isToolLocked}},"toggled_tool_lock"));d(this,"resetDocument",()=>{if(this.session)return this;this.session=void 0,this.currentTool=this.tools.select;let e=Ke.defaultDocument;return e.pages.page.name="Page 1",this.resetHistory().clearSelectHistory().loadDocument(Ke.defaultDocument).persist({}),this});d(this,"updateUsers",(e,t=!1)=>{this.patchState({room:{users:Object.fromEntries(e.map(n=>[n.id,n]))}},t?"room:self:update":"room:user:update")});d(this,"removeUser",e=>{this.patchState({room:{users:{[e]:void 0}}})});d(this,"mergeDocument",e=>{if(this.document.id!==e.id)return this.replaceState(w(S({},Dn(w(S({},this.state),{document:e}),Ke.version)),{appState:w(S({},this.appState),{currentPageId:Object.keys(e.pages)[0]})})),this;let t=S({},this.document.pageStates),n=w(S({},this.appState),{currentPageId:e.pages[this.currentPageId]?this.currentPageId:Object.keys(e.pages)[0],pages:Object.values(e.pages).map((s,l)=>({id:s.id,name:s.name,childIndex:s.childIndex||l}))});this.resetHistory(),Object.keys(this.document.pages).forEach(s=>{e.pages[s]||(s===this.appState.currentPageId&&(this.cancelSession(),this.selectNone()),t[s]=void 0)}),this.session&&this.selectedIds.filter(s=>!e.pages[this.currentPageId].shapes[s]).forEach(s=>e.pages[this.currentPageId].shapes[s]=this.page.shapes[s]),Object.entries(t).forEach(([s,l])=>{l.selectedIds=l.selectedIds.filter(a=>!!e.pages[s].shapes[a])});let{editingId:r}=this.pageState;return r&&(e.pages[this.currentPageId].shapes[r]=this.page.shapes[r],t[this.currentPageId].selectedIds=[r]),this.replaceState(w(S({},Dn(w(S({},this.state),{document:w(S({},e),{pageStates:t})}),Ke.version)),{appState:n}),"merge")});d(this,"updateDocument",(e,t="updated_document")=>{let n=this.state,r=w(S({},n),{document:w(S({},n.document),{assets:e.assets})});e.pages[this.currentPageId]||(r.appState=w(S({},n.appState),{currentPageId:Object.keys(e.pages)[0]}));let s=1;for(let l of Object.values(e.pages))l!==n.document.pages[l.id]&&(r.document.pages[l.id]=l,l.name||(r.document.pages[l.id].name=`Page ${s+1}`,s++));for(let l of Object.values(e.pageStates))if(l!==n.document.pageStates[l.id]){r.document.pageStates[l.id]=l;let a=e.pages[l.id],c=["bindingId","editingId","hoveredId","pointedId"];for(let p of c)a.shapes[p]||(l[p]=void 0);l.selectedIds=l.selectedIds.filter(p=>!!e.pages[a.id].shapes[p])}return this.replaceState(Dn(r,r.document.version||0),`${t}:${e.id}`)});d(this,"loadRoom",e=>(this.patchState({room:{id:e,userId:il,users:{[il]:{id:il,color:Si[Math.floor(Math.random()*Si.length)],point:[100,100],selectedIds:[],activeShapes:[],status:"connected"}}}}),this));d(this,"loadDocument",e=>{this.setIsLoading(!0),this.selectNone(),this.resetHistory(),this.clearSelectHistory(),this.session=void 0;let t=w(S({},Ke.defaultState),{settings:S({},this.state.settings),document:e,appState:w(S(S({},Ke.defaultState.appState),this.state.appState),{currentPageId:Object.keys(e.pages)[0],disableAssets:this.disableAssets})});this.replaceState(Dn(t,Ke.version),"loaded_document");let{point:n,zoom:r}=this.camera;return this.updateViewport(n,r),this.setIsLoading(!1),this});d(this,"loadPageFromURL",(e,t)=>{let n=e.id,r=w(S({},this.state.document),{pageStates:w(S({},this.state.document.pageStates),{[n]:t}),pages:w(S({},this.document.pages),{[n]:e})});this.loadDocument(r),this.persist({})});d(this,"newProject",()=>{!this.isLocal||(this.fileSystemHandle=null,this.resetDocument())});d(this,"saveProject",()=>z(this,null,function*(){if(this.readOnly)return;let e=yield ms(Dn(this.state,Ke.version).document,this.fileSystemHandle);return this.fileSystemHandle=e,this.persist({}),this.isDirty=!1,this}));d(this,"saveProjectAs",(e,t)=>z(this,null,function*(){try{let n=yield ms(this.document,null,e,t);this.fileSystemHandle=n,this.persist({}),this.isDirty=!1}catch(n){console.error(n.message)}return this}));d(this,"openProject",()=>z(this,null,function*(){if(!!this.isLocal)try{let e=yield Ja();if(!e)throw Error();let{fileHandle:t,document:n}=e;this.loadDocument(n),this.fileSystemHandle=t,this.zoomToFit(),this.persist({})}catch(e){console.error(e)}finally{this.persist({})}}));d(this,"openAsset",()=>z(this,null,function*(){if(!this.disableAssets)try{let e=yield Qa();if(Array.isArray(e))this.addMediaFromFiles(e,this.centerPoint);else{if(!e)return;this.addMediaFromFiles([e])}}catch(e){console.error(e)}finally{this.persist({})}}));d(this,"signOut",()=>{});d(this,"getAppState",()=>this.appState);d(this,"getPage",(e=this.currentPageId)=>B.getPage(this.state,e||this.currentPageId));d(this,"getShapes",(e=this.currentPageId)=>B.getShapes(this.state,e||this.currentPageId));d(this,"getBindings",(e=this.currentPageId)=>B.getBindings(this.state,e||this.currentPageId));d(this,"getShape",(e,t=this.currentPageId)=>B.getShape(this.state,e,t));d(this,"getShapeBounds",(e,t=this.currentPageId)=>B.getBounds(this.getShape(e,t)));d(this,"getBinding",(e,t=this.currentPageId)=>B.getBinding(this.state,e,t));d(this,"getPageState",(e=this.currentPageId)=>B.getPageState(this.state,e||this.currentPageId));d(this,"getPagePoint",(e,t=this.currentPageId)=>{let{camera:n}=this.getPageState(t);return se.sub(se.div(e,n.zoom),n.point)});d(this,"createPage",(e,t)=>{if(this.readOnly)return this;let{width:n,height:r}=this.rendererBounds;return this.setState(Qp(this,[-n/2,-r/2],e,t))});d(this,"changePage",e=>this.setState(Zp(this,e)));d(this,"movePage",(e,t)=>this.readOnly?this:this.setState(lu(this,e,t)));d(this,"renamePage",(e,t)=>this.readOnly?this:this.setState(du(this,e,t)));d(this,"duplicatePage",e=>this.readOnly?this:this.setState(ou(this,e)));d(this,"deletePage",e=>this.readOnly?this:Object.values(this.document.pages).length<=1?this:this.setState(eu(this,e||this.currentPageId)));d(this,"cut",(e=this.selectedIds,t)=>(t==null||t.preventDefault(),this.copy(e,t),this.readOnly||this.delete(e),this));d(this,"copy",(e=this.selectedIds,t)=>{var s;t==null||t.preventDefault(),this.clipboard=this.getContent(e);let r=`<telva>${JSON.stringify(S({type:"telva/clipboard",shapes:[],assets:[],bindings:[]},this.clipboard))}</telva>`;return _p(r),t&&((s=t.clipboardData)==null||s.setData("text/html",r)),navigator.clipboard&&window.ClipboardItem&&navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([r],{type:"text/html"})})]),this});d(this,"paste",(e,t)=>z(this,null,function*(){var p,u;if(this.readOnly)return;let n=[],r=[],s,l=h=>z(this,null,function*(){let g=document.createElement("div");g.innerHTML=h;let m=g.firstChild;m.style.setProperty("background-color","transparent");let f=yield B.getImageForSvg(m,"svg",{scale:1,quality:1});if(f){let v=new File([f],"image.svg");n.push(v)}else a(h)}),a=h=>{let g=this.getPagePoint(e!=null?e:this.centerPoint,this.currentPageId),m=h.includes(`
13
- `);r.push(B.getShapeUtil("text").getShape({id:ct.uniqueId(),type:"text",parentId:this.appState.currentPageId,text:B.normalizeText(h.trim()),point:g,style:w(S({},this.appState.currentStyle),{textAlign:m?"start":this.appState.currentStyle.textAlign})}))},c=h=>{var g;try{let m=(g=h.match(/<telva>(.*)<\/telva>/))==null?void 0:g[1];if(!m)return;let f=JSON.parse(m);if(f.type==="telva/clipboard"){s=f;return}else throw Error("Not telva data!")}catch(m){a(h)}};if(t!==void 0){let h=Array.from((u=(p=t.clipboardData)==null?void 0:p.items)!=null?u:[]);yield Promise.all(h.map(g=>z(this,null,function*(){var v;let{type:m,kind:f}=g;switch(f){case"string":{let b=yield new Promise(T=>g.getAsString(T));switch(m){case"text/html":{if((v=b.match(/<telva>(.*)<\/telva>/))!=null&&v[1]){c(b);return}break}case"text/plain":{b.startsWith("<svg")?yield l(b):a(b);break}}break}case"file":{let b=g.getAsFile();b&&n.push(b);break}}})))}if(s)return this.insertContent(s,{point:e,select:!0}),this;if(n.length)return this.addMediaFromFiles(n,e),this;if(r.length){let h=this.getPagePoint(e!=null?e:this.centerPoint,this.currentPageId),g=se.add(h,[0,0]);return r.forEach((m,f)=>{let v=B.getBounds(m);f===0&&(g[0]-=v.width/2,g[1]-=v.height/2),m.point=[...g],g[0]+=v.width}),this.createShapes(...r),this}return this.clipboard?this.insertContent(this.clipboard):Kp().then(h=>{h&&c(h)}),this}));d(this,"getSvg",(...n)=>z(this,[...n],function*(e=this.selectedIds.length?this.selectedIds:Object.keys(this.page.shapes),t={}){var m;if(e.length===0)return;let r=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","defs"),l=document.createElementNS("http://www.w3.org/2000/svg","style");if(typeof window!="undefined"&&window.focus(),t.includeFonts)try{let{fonts:f}=yield fetch(Ke.assetSrc,{mode:"no-cors"}).then(v=>v.json());l.textContent=`
12
+ `)}static assertShapeHasProperty(o,e){if(o[e]===void 0)throw new Error}static warn(o){_c&&console.warn(o)}static error(o){_c&&console.error(o)}static getSvgString(o,e=1){let t=o.cloneNode(!0);return o.setAttribute("width",+o.getAttribute("width")*e+""),o.setAttribute("height",+o.getAttribute("height")*e+""),new XMLSerializer().serializeToString(t).replaceAll("&#10; ","").replaceAll(/((\s|")[0-9]*\.[0-9]{2})([0-9]*)(\b|"|\))/g,"$1")}static getSvgAsDataUrl(o,e=1){let t=W.getSvgString(o,e);return`data:image/svg+xml;base64,${window.btoa(unescape(t))}`}static getImageForSvg(n){return z(this,arguments,function*(o,e="png",t={}){let{scale:r=2,quality:s=1}=t,l=W.getSvgString(o,r);if(!l)return;let a=yield new Promise(p=>{let u=new Image;u.crossOrigin="anonymous";let g=`data:image/svg+xml;base64,${window.btoa(unescape(encodeURIComponent(l)))}`;u.onload=()=>{let m=document.createElement("canvas"),f=m.getContext("2d"),v=u.width,b=u.height;m.width=v,m.height=b,f.drawImage(u,0,0,v,b),URL.revokeObjectURL(g),p(m)},u.onerror=()=>{console.warn("Could not convert that SVG to an image.")},u.src=g});return yield new Promise(p=>a.toBlob(u=>p(u),"image/"+e,s))})}},B=W;d(B,"copyStringToClipboard",o=>{try{navigator.clipboard&&navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"})})])}catch(e){let t=document.createElement("textarea");t.setAttribute("position","fixed"),t.setAttribute("top","0"),t.setAttribute("readonly","true"),t.setAttribute("contenteditable","true"),t.style.position="fixed",t.value=o,document.body.appendChild(t),t.focus(),t.select();try{let n=document.createRange();n.selectNodeContents(t);let r=window.getSelection();r&&(r.removeAllRanges(),r.addRange(n),t.setSelectionRange(0,t.value.length)),document.execCommand("copy")}catch(n){}finally{document.body.removeChild(t)}}}),d(B,"flattenShape",(o,e)=>{var t;return[e,...((t=e.children)!=null?t:[]).map(n=>W.getShape(o,n,o.appState.currentPageId)).sort((n,r)=>n.childIndex-r.childIndex).flatMap(n=>W.flattenShape(o,n))]}),d(B,"flattenPage",(o,e)=>Object.values(o.document.pages[e].shapes).sort((t,n)=>t.childIndex-n.childIndex).reduce((t,n)=>[...t,...W.flattenShape(o,n)],[])),d(B,"getTopChildIndex",(o,e)=>{let t=W.getShapes(o,e);return t.length===0?1:t.filter(n=>n.parentId===e).sort((n,r)=>r.childIndex-n.childIndex)[0].childIndex+1}),d(B,"fixNewLines",/\r?\n|\r/g);import{jsx as Yc,jsxs as $S}from"react/jsx-runtime";var Qn=st.memo(function({font:o,text:e,color:t,background:n,textGradient:r,offsetX:s=0,offsetY:l=0,scale:a=1,isEditing:c=!1,width:p,onBlur:u,onChange:h}){let g=st.useRef(null),m=st.useRef(!1),f=st.useCallback(k=>{h(B.normalizeText(k.currentTarget.value))},[h]),v=st.useCallback(k=>{if(k.key==="Escape"){k.preventDefault(),k.stopPropagation(),u==null||u();return}if(k.key==="Tab"&&e.length===0){k.preventDefault();return}if(!(k.key==="Meta"||k.metaKey))k.stopPropagation();else if(k.key==="z"&&k.metaKey){k.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1),k.stopPropagation(),k.preventDefault();return}(k.metaKey||k.ctrlKey)&&k.key==="="&&k.preventDefault(),k.key==="Tab"&&(k.preventDefault(),k.shiftKey?Fe.unindent(k.currentTarget):Fe.indent(k.currentTarget),h==null||h(B.normalizeText(k.currentTarget.value)))},[h]),b=st.useCallback(k=>{k.currentTarget.setSelectionRange(0,0),u==null||u()},[u]),T=st.useCallback(k=>{!c||!m.current||document.activeElement===k.currentTarget&&k.currentTarget.select()},[c]),y=st.useCallback(k=>{c&&k.stopPropagation()},[c]),x=st.useRef(c);st.useEffect(()=>{c?(x.current=!0,requestAnimationFrame(()=>{m.current=!0;let k=g.current;k&&(k.focus(),k.select())})):x.current&&(u==null||u(),x.current=!1)},[c,u]);let I=st.useRef(null);return st.useLayoutEffect(()=>{let k=I.current;if(!k)return;let R=Zn(e,o,p);k.style.transform=`scale(${a}, ${a}) translate(${s}px, ${l}px)`,k.style.width=p?`${p}px`:R[0]+1+"px",k.style.height=R[1]+1+"px"},[e,o,l,s,a,p]),Yc(zS,{children:$S(FS,{ref:I,hasText:!!e,isEditing:c,style:S({font:o,color:r&&!c?"transparent":t,backgroundColor:n&&n!=="transparent"?n:void 0,borderRadius:n&&n!=="transparent"?2:void 0,padding:n&&n!=="transparent"?"4px 6px":void 0},r&&!c?{background:Mo(r),WebkitBackgroundClip:"text",backgroundClip:"text"}:{}),children:[c?Yc(OS,{ref:g,style:{font:o,color:t},name:"text",tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,placeholder:"",spellCheck:"true",wrap:"off",dir:"auto",datatype:"wysiwyg",defaultValue:e,color:t,onFocus:T,onChange:f,onKeyDown:v,onBlur:b,onPointerDown:y,onContextMenu:ot,onCopy:ot,onPaste:ot,onCut:ot}):e,"\u200B"]})})}),zS=P("div",{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",userSelect:"none",variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}}}}),Xc={whiteSpace:"pre-wrap",overflowWrap:"break-word",letterSpacing:Ut},FS=P("div",S({position:"absolute",padding:"4px",zIndex:1,minHeight:1,minWidth:1,lineHeight:1,outline:0,fontWeight:"500",textAlign:"center",backfaceVisibility:"hidden",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",variants:{hasText:{false:{pointerEvents:"none"},true:{pointerEvents:"all"}},isEditing:{false:{userSelect:"none"},true:{background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text"}}}},Xc)),OS=P("textarea",w(S({position:"absolute",top:0,left:0,zIndex:1,width:"100%",height:"100%",border:"none",padding:"4px",resize:"none",textAlign:"inherit",minHeight:"inherit",minWidth:"inherit",lineHeight:"inherit",outline:0,fontWeight:"inherit",overflow:"hidden",backfaceVisibility:"hidden",display:"inline-block",pointerEvents:"all",background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text",fontSmooth:"always",WebkitFontSmoothing:"subpixel-antialiased",MozOsxFontSmoothing:"auto"},Xc),{"&:focus":{outline:"none",border:"none"}}));import Er from"telva-vec";function vn(i,o,{initialShape:e,transformOrigin:t,scaleX:n,scaleY:r}){if(i.rotation||e.isAspectRatioLocked){let s=Er.toFixed(Er.mul(e.size,Math.min(Math.abs(n),Math.abs(r)))),l=Er.toFixed([o.minX+(o.width-i.size[0])*(n<0?1-t[0]:t[0]),o.minY+(o.height-i.size[1])*(r<0?1-t[1]:t[1])]),a=n<0&&r>=0||r<0&&n>=0?e.rotation?-e.rotation:0:e.rotation;return{size:s,point:l,rotation:a}}else return{point:Er.toFixed([o.minX,o.minY]),size:Er.toFixed([o.width,o.height])}}import Zc from"telva-vec";function Tn(i,o){return{size:Zc.toFixed([o.width,o.height]),point:Zc.toFixed([o.minX,o.minY])}}import*as $e from"react";import{jsx as Oe,jsxs as Cn}from"react/jsx-runtime";function Br(i,o,e){i=i/360,o=o/100,e=e/100;let t=0,n=0,r=0,s=Math.floor(i*6),l=i*6-s,a=e*(1-o),c=e*(1-l*o),p=e*(1-(1-l)*o);switch(s%6){case 0:t=e,n=p,r=a;break;case 1:t=c,n=e,r=a;break;case 2:t=a,n=e,r=p;break;case 3:t=a,n=c,r=e;break;case 4:t=p,n=a,r=e;break;case 5:t=e,n=a,r=c;break}return[Math.round(t*255),Math.round(n*255),Math.round(r*255)]}function Mr(i,o,e){i/=255,o/=255,e/=255;let t=Math.max(i,o,e),n=Math.min(i,o,e),r=t-n,s=0;r!==0&&(t===i?s=(o-e)/r%6:t===o?s=(e-i)/r+2:s=(i-o)/r+4,s=Math.round(s*60),s<0&&(s+=360));let l=t===0?0:Math.round(r/t*100),a=Math.round(t*100);return[s,l,a]}function Ko(i){let o=i.replace("#","").match(/.{2}/g);return o?[parseInt(o[0],16),parseInt(o[1],16),parseInt(o[2],16)]:[0,0,0]}function Lr(i,o,e){return"#"+[i,o,e].map(t=>t.toString(16).padStart(2,"0")).join("")}var tp="telva_color_history";function np(){try{return JSON.parse(localStorage.getItem(tp)||"[]").slice(0,16)}catch(i){return[]}}function _o(i){if(i==="transparent")return;let o=np().filter(e=>e!==i);o.unshift(i),localStorage.setItem(tp,JSON.stringify(o.slice(0,16)))}var Ra='url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAIElEQVQYV2P8////fwYkwMjIyIjCZmBgYEBlMDIiiwEAGiYFA/wQA1AAAAAASUVORK5CYII=")';var _i=$e.memo(function({color:o,opacity:e=1,onChange:t,showTransparent:n=!0,showOpacity:r=!0}){let s=o==="transparent",l=s?[255,255,255]:Ko(o),[a,c]=$e.useState(()=>Mr(...l));$e.useEffect(()=>{if(!s){let y=Ko(o),x=Mr(...y);c(x)}},[o]);let p=$e.useRef(null),u=$e.useRef(null);$e.useEffect(()=>{let y=p.current;if(!y)return;let x=y.getContext("2d"),I=y.width,k=y.height,[R,C,E]=Br(a[0],100,100);x.fillStyle=`rgb(${R},${C},${E})`,x.fillRect(0,0,I,k);let M=x.createLinearGradient(0,0,I,0);M.addColorStop(0,"rgba(255,255,255,1)"),M.addColorStop(1,"rgba(255,255,255,0)"),x.fillStyle=M,x.fillRect(0,0,I,k);let L=x.createLinearGradient(0,0,0,k);L.addColorStop(0,"rgba(0,0,0,0)"),L.addColorStop(1,"rgba(0,0,0,1)"),x.fillStyle=L,x.fillRect(0,0,I,k)},[a[0]]),$e.useEffect(()=>{let y=u.current;if(!y)return;let x=y.getContext("2d"),I=y.width,k=x.createLinearGradient(0,0,I,0);for(let R=0;R<=6;R++){let[C,E,M]=Br(R/6*360,100,100);k.addColorStop(R/6,`rgb(${C},${E},${M})`)}x.fillStyle=k,x.fillRect(0,0,I,y.height)},[]);let h=$e.useCallback((y,x,I,k)=>{let[R,C,E]=Br(y,x,I),M=Lr(R,C,E);_o(M),t(M,k)},[t]),g=$e.useCallback(y=>{y.preventDefault(),y.stopPropagation();let I=p.current.getBoundingClientRect(),k=E=>{let M=Math.max(0,Math.min(100,(E.clientX-I.left)/I.width*100)),L=Math.max(0,Math.min(100,(1-(E.clientY-I.top)/I.height)*100));c([a[0],M,L]),h(a[0],M,L,e)};k(y);let R=E=>k(E),C=()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",R),document.addEventListener("pointerup",C)},[a,e,h]),m=$e.useCallback(y=>{y.preventDefault(),y.stopPropagation();let I=u.current.getBoundingClientRect(),k=E=>{let M=Math.max(0,Math.min(360,(E.clientX-I.left)/I.width*360));c([M,a[1],a[2]]),h(M,a[1],a[2],e)};k(y);let R=E=>k(E),C=()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",R),document.addEventListener("pointerup",C)},[a,e,h]),f=$e.useRef(null),v=$e.useCallback(y=>{y.preventDefault(),y.stopPropagation();let I=f.current.getBoundingClientRect(),k=E=>{let M=Math.max(0,Math.min(1,(E.clientX-I.left)/I.width));s?t("transparent",M):h(a[0],a[1],a[2],M)};k(y);let R=E=>k(E),C=()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",R),document.addEventListener("pointerup",C)},[a,s,h,t]),b=s?"transparent":Lr(...Br(a[0],a[1],a[2])),T=s?[255,255,255]:Br(a[0],a[1],a[2]);return Cn(GS,{onClick:y=>y.stopPropagation(),onPointerDown:y=>y.stopPropagation(),children:[Cn(jS,{children:[Oe("canvas",{ref:p,width:200,height:130,onPointerDown:g,style:{width:"100%",height:"100%",cursor:"crosshair",borderRadius:4}}),!s&&Oe(WS,{style:{left:`${a[1]}%`,top:`${100-a[2]}%`,borderColor:a[2]>50?"#000":"#fff"}})]}),Cn(qc,{children:[Oe("canvas",{ref:u,width:200,height:12,onPointerDown:m,style:{width:"100%",height:"100%",cursor:"pointer",borderRadius:6}}),!s&&Oe(Jc,{style:{left:`${a[0]/360*100}%`}})]}),r&&Cn(qc,{children:[Oe(NS,{ref:f,onPointerDown:v,style:{background:`linear-gradient(to right, transparent, ${b==="transparent"?"#fff":b})`,cursor:"pointer"}}),Oe(Jc,{style:{left:`${e*100}%`}})]}),Cn(US,{children:[Oe(_S,{value:s?"":b.replace("#",""),placeholder:"hex",maxLength:6,onChange:y=>{let x=y.target.value.replace(/[^0-9a-fA-F]/g,"").slice(0,6);if(x.length===6){let I=Ko("#"+x);c(Mr(...I)),t("#"+x,e),_o("#"+x)}},onKeyDown:y=>y.stopPropagation()}),[0,1,2].map(y=>Oe(Qc,{value:T[y],type:"number",min:0,max:255,onChange:x=>{let I=Math.max(0,Math.min(255,Number(x.target.value))),k=[...T];k[y]=I,c(Mr(...k));let R=Lr(...k);t(R,e),_o(R)},onKeyDown:x=>x.stopPropagation()},y)),r&&Oe(Qc,{value:Math.round(e*100),type:"number",min:0,max:100,onChange:y=>{let x=Math.max(0,Math.min(100,Number(y.target.value)))/100;s?t("transparent",x):h(a[0],a[1],a[2],x)},onKeyDown:y=>y.stopPropagation(),style:{width:32}})]}),Cn(KS,{children:[Oe("span",{style:{flex:2},children:"Hex"}),Oe("span",{children:"R"}),Oe("span",{children:"G"}),Oe("span",{children:"B"}),r&&Oe("span",{children:"A"})]}),Cn(YS,{children:[n&&Oe(ep,{title:"Transparent",$active:s,style:{backgroundImage:Ra,backgroundSize:"6px 6px"},onClick:()=>t("transparent",e)}),np().map(y=>Oe(ep,{style:{backgroundColor:y},$active:b===y,onClick:()=>{let x=Ko(y);c(Mr(...x)),t(y,e)}},y))]})]})}),Yo=$e.memo(function({color:o,opacity:e=1,onChange:t,showTransparent:n=!0,showOpacity:r=!0,label:s}){let[l,a]=$e.useState(!1),c=$e.useRef(null),p=o==="transparent";return $e.useEffect(()=>{let h=g=>{c.current&&!c.current.contains(g.target)&&a(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),Cn(XS,{ref:c,children:[Cn(ZS,{children:[s&&Oe(qS,{children:s}),Oe(JS,{onClick:()=>a(!l),style:{backgroundColor:p?"transparent":o,backgroundImage:p?Ra:"none",backgroundSize:"6px 6px"}}),Oe(QS,{value:p?"":(p?"transparent":o).replace("#","").toUpperCase(),placeholder:"\u2014",maxLength:6,onChange:h=>{let g=h.target.value;if(g.toLowerCase()==="transparent"){t("transparent",e);return}let m=g.replace(/[^0-9a-fA-F#]/g,"").slice(0,7);if(/^#[0-9a-fA-F]{6}$/i.test(m)||/^[0-9a-fA-F]{6}$/i.test(m)){let f=m.startsWith("#")?m:"#"+m;t(f,e),_o(f)}},onKeyDown:h=>h.stopPropagation()}),Cn(ey,{children:[Math.round(e*100),"%"]})]}),l&&Oe(ty,{children:Oe(_i,{color:o,opacity:e,onChange:(h,g)=>t(h,g),showTransparent:n,showOpacity:r})})]})}),GS=P("div",{background:"$panel",border:"1px solid $separator",borderRadius:"8px",padding:"8px",display:"flex",flexDirection:"column",gap:"6px",boxShadow:"0 8px 32px rgba(0,0,0,0.45)",minWidth:210}),jS=P("div",{position:"relative",width:"100%",height:130,borderRadius:4,overflow:"hidden"}),WS=P("div",{position:"absolute",width:10,height:10,borderRadius:"50%",border:"2px solid white",transform:"translate(-50%, -50%)",pointerEvents:"none",boxShadow:"0 0 2px rgba(0,0,0,0.5)"}),qc=P("div",{position:"relative",width:"100%",height:12,borderRadius:6,overflow:"visible"}),Jc=P("div",{position:"absolute",top:"50%",width:14,height:14,borderRadius:"50%",background:"#fff",border:"2px solid rgba(0,0,0,0.2)",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transform:"translate(-50%, -50%)",pointerEvents:"none"}),NS=P("div",{width:"100%",height:"100%",borderRadius:6,backgroundImage:Ra,backgroundSize:"8px 8px",position:"relative"}),US=P("div",{display:"flex",gap:3,alignItems:"center"}),KS=P("div",{display:"flex",gap:3,fontSize:"7px",color:"rgba(255,255,255,0.35)",padding:"0 1px","& > span":{flex:1,textAlign:"center"}}),_S=P("input",{flex:2,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:4,color:"$text",fontSize:"9px",padding:"3px 5px",fontFamily:"$mono",outline:"none",textTransform:"uppercase","&:focus":{borderColor:"$accent"},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),Qc=P("input",{flex:1,width:28,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:4,color:"$text",fontSize:"9px",padding:"3px 4px",fontFamily:"$mono",outline:"none",textAlign:"center","&:focus":{borderColor:"$accent"},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),YS=P("div",{display:"flex",flexWrap:"wrap",gap:3,paddingTop:2}),ep=P("div",{width:18,height:18,borderRadius:3,cursor:"pointer",border:"1px solid $separator",transition:"transform 0.08s, box-shadow 0.08s","&:hover":{transform:"scale(1.15)"},variants:{$active:{true:{boxShadow:"0 0 0 2px $colors$accent",transform:"scale(1.1)"}}}}),XS=P("div",{position:"relative",width:"100%"}),ZS=P("div",{display:"flex",alignItems:"center",gap:4}),qS=P("label",{fontSize:"9px",color:"$textSecondary",fontWeight:500,width:36,flexShrink:0,textAlign:"right"}),JS=P("div",{width:20,height:20,borderRadius:"$0",border:"1px solid $separator",flexShrink:0,cursor:"pointer",transition:"box-shadow 0.08s","&:hover":{boxShadow:"0 0 0 1px $colors$accent"}}),QS=P("input",{flex:1,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:"$1",color:"$text",fontSize:"9px",padding:"3px 5px",fontFamily:"$mono",outline:"none",textTransform:"uppercase","&:focus":{borderColor:"$accent"}}),ey=P("span",{fontSize:"9px",color:"$textSecondary",fontFamily:"$mono",width:32,textAlign:"initial",flexShrink:0}),ty=P("div",{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,marginTop:4,boxShadow:"0 8px 32px rgba(0,0,0,0.5)",borderRadius:"$2",overflow:"visible"});import*as Mt from"react";import{jsx as Da,jsxs as op}from"react/jsx-runtime";var Ue=Mt.memo(function({value:o,onChange:e,label:t,min:n=-1/0,max:r=1/0,step:s=1,suffix:l,style:a,labelWidth:c=18}){let[p,u]=Mt.useState(!1),[h,g]=Mt.useState(String(o)),m=Mt.useRef(null),f=Mt.useRef({active:!1,startX:0,startVal:0});Mt.useEffect(()=>{p||g(String(Math.round(o*100)/100))},[o,p]);let v=x=>Math.min(r,Math.max(n,x)),b=Mt.useCallback(x=>{x.preventDefault(),x.stopPropagation(),f.current={active:!0,startX:x.clientX,startVal:o};let I=x.currentTarget;I.setPointerCapture(x.pointerId);let k=C=>{if(!f.current.active)return;let E=C.clientX-f.current.startX,M=C.shiftKey?10:C.altKey?.1:1,L=Math.round(E*M*s);e(v(f.current.startVal+L))},R=()=>{f.current.active=!1,I.releasePointerCapture(x.pointerId),document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",R)};document.addEventListener("pointermove",k),document.addEventListener("pointerup",R)},[o,e,n,r,s]),T=Mt.useCallback(x=>{x.preventDefault(),x.stopPropagation();let I=x.clientX,k=o,R=!1;f.current={active:!0,startX:I,startVal:k};let C=M=>{let L=M.clientX-I;if(Math.abs(L)>2&&(R=!0),!R)return;let A=M.shiftKey?10:M.altKey?.1:1,K=Math.round(L*A*s);e(v(k+K))},E=()=>{f.current.active=!1,document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",E),R||(u(!0),setTimeout(()=>{var M;return(M=m.current)==null?void 0:M.select()},0))};document.addEventListener("pointermove",C),document.addEventListener("pointerup",E)},[o,e,n,r,s]),y=Mt.useCallback(()=>{u(!1);let x=parseFloat(h);isNaN(x)||e(v(x))},[h,e,n,r]);return op(ny,{style:a,children:[t&&Da(oy,{style:{width:c,cursor:"ew-resize"},onPointerDown:b,children:t}),p?Da(ry,{ref:m,value:h,onChange:x=>g(x.target.value),onBlur:y,onKeyDown:x=>{x.key==="Enter"&&y(),x.key==="Escape"&&u(!1),x.stopPropagation()},autoFocus:!0}):op(iy,{onPointerDown:T,children:[Math.round(o*100)/100,l&&Da(sy,{children:l})]})]})}),ny=P("div",{display:"flex",alignItems:"center",gap:"4px",minWidth:0}),oy=P("label",{fontSize:"9px",color:"$textSecondary",fontWeight:500,flexShrink:0,textAlign:"right",userSelect:"none",cursor:"ew-resize","&:active":{cursor:"ew-resize"}}),ry=P("input",{width:"100%",background:"$inputBg",border:"1px solid $accent",borderRadius:"$1",color:"$text",fontSize:"10px",padding:"3px 5px",fontFamily:"$mono",outline:"none","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),iy=P("div",{flex:1,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:"$1",color:"$text",fontSize:"10px",padding:"3px 5px",fontFamily:"$mono",cursor:"ew-resize",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",userSelect:"none",transition:"border-color 0.1s","&:hover":{borderColor:"$accent"}}),sy=P("span",{fontSize:"8px",color:"$textSecondary",marginLeft:"1px"});import*as Qe from"react";import{jsx as Q,jsxs as Me}from"react/jsx-runtime";function Co(i){let e=[...i.stops].sort((t,n)=>t.position-n.position).map(t=>{let n=t.color,r=Math.round(t.opacity*255).toString(16).padStart(2,"0");return`${n}${r} ${t.position}%`}).join(", ");switch(i.type){case"linear":return`linear-gradient(${i.angle}deg, ${e})`;case"radial":return`radial-gradient(circle at ${i.centerX}% ${i.centerY}%, ${e})`;case"conic":return`conic-gradient(from ${i.angle}deg at ${i.centerX}% ${i.centerY}%, ${e})`;case"diamond":return`conic-gradient(from ${i.angle}deg, ${e})`}}var ay={type:"linear",stops:[{color:"#0D99FF",position:0,opacity:1},{color:"#FF6B00",position:100,opacity:1}],angle:90,centerX:50,centerY:50},Ba="telva_gradient_presets";function Ma(){try{return JSON.parse(localStorage.getItem(Ba)||"[]")}catch(i){return[]}}function ly(i){let o=Ma();o.unshift(i),localStorage.setItem(Ba,JSON.stringify(o.slice(0,12)))}function dy(i){let o=Ma();o.splice(i,1),localStorage.setItem(Ba,JSON.stringify(o))}function cy(){return Me("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[Q("defs",{children:Me("linearGradient",{id:"lg",x1:"0",y1:"0",x2:"1",y2:"1",children:[Q("stop",{offset:"0%",stopColor:"#0D99FF"}),Q("stop",{offset:"100%",stopColor:"#FF6B00"})]})}),Q("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",fill:"url(#lg)"})]})}function py(){return Me("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[Q("defs",{children:Me("radialGradient",{id:"rg",children:[Q("stop",{offset:"0%",stopColor:"#0D99FF"}),Q("stop",{offset:"100%",stopColor:"#FF6B00"})]})}),Q("rect",{x:"1",y:"1",width:"12",height:"12",rx:"2",fill:"url(#rg)"})]})}function uy(){return Me("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[Q("circle",{cx:"7",cy:"7",r:"6",fill:"none",stroke:"#0D99FF",strokeWidth:"1.5"}),Q("line",{x1:"7",y1:"7",x2:"7",y2:"1",stroke:"#FF6B00",strokeWidth:"1.5"})]})}function hy(){return Me("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[Q("polygon",{points:"7,1 13,7 7,13 1,7",fill:"none",stroke:"#0D99FF",strokeWidth:"1.2"}),Q("circle",{cx:"7",cy:"7",r:"2",fill:"#FF6B00"})]})}var my={linear:Q(cy,{}),radial:Q(py,{}),conic:Q(uy,{}),diamond:Q(hy,{})},Xi=Qe.memo(function({value:o,onChange:e}){let[t,n]=Qe.useState(o||ay),[r,s]=Qe.useState(0),[l,a]=Qe.useState(!1),c=Qe.useRef(null),p=Qe.useRef(null);Qe.useEffect(()=>{o&&n(o)},[o]),Qe.useEffect(()=>{let y=I=>{(I.key==="Delete"||I.key==="Backspace")&&t.stops.length>2&&(I.preventDefault(),m(r))},x=p.current;if(x)return x.addEventListener("keydown",y),()=>x.removeEventListener("keydown",y)},[t.stops.length,r]);let u=Qe.useCallback(y=>{n(x=>{let I=S(S({},x),y);return e(I,Co(I)),I})},[e]),h=Qe.useCallback((y,x)=>{n(I=>{let k=I.stops.map((C,E)=>E===y?S(S({},C),x):C),R=w(S({},I),{stops:k});return e(R,Co(R)),R})},[e]),g=Qe.useCallback(y=>{if(!c.current||y.target.dataset.thumb)return;let x=c.current.getBoundingClientRect(),I=Math.round((y.clientX-x.left)/x.width*100),k={color:"#888888",position:I,opacity:1};n(R=>{let C=[...R.stops,k],E=w(S({},R),{stops:C});return e(E,Co(E)),s(C.length-1),E})},[e]),m=Qe.useCallback(y=>{t.stops.length<=2||n(x=>{let I=x.stops.filter((R,C)=>C!==y),k=w(S({},x),{stops:I});return e(k,Co(k)),s(Math.min(y,I.length-1)),k})},[t.stops.length,e]),f=Qe.useCallback((y,x)=>{y.preventDefault(),y.stopPropagation(),s(x);let I=c.current.getBoundingClientRect(),k=C=>{let E=Math.max(0,Math.min(100,Math.round((C.clientX-I.left)/I.width*100)));h(x,{position:E})},R=()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",R)};document.addEventListener("pointermove",k),document.addEventListener("pointerup",R)},[h]),v=Co(t),b=t.stops[r],T=Ma();return Me(gy,{ref:p,tabIndex:-1,onClick:y=>y.stopPropagation(),onPointerDown:y=>y.stopPropagation(),children:[Q(fy,{children:["linear","radial","conic","diamond"].map(y=>Me(Sy,{$active:t.type===y,onClick:()=>u({type:y}),title:y.charAt(0).toUpperCase()+y.slice(1),children:[my[y],Q(yy,{children:y.charAt(0).toUpperCase()+y.slice(1)})]},y))}),Q(by,{style:{background:v}}),Me(vy,{children:[Me(Ty,{children:["Stops (",t.stops.length,")"]}),Me(xy,{ref:c,onClick:g,children:[Q(ky,{style:{background:v}}),t.stops.map((y,x)=>Q(Cy,{"data-thumb":"true",$selected:x===r,style:{left:`${y.position}%`,backgroundColor:y.color},onPointerDown:I=>f(I,x),onDoubleClick:()=>m(x)},x))]}),Q(rp,{children:"Click to add \xB7 Double-click to remove \xB7 Drag to move"})]}),b&&Me(wy,{children:[Me(Iy,{children:["Stop ",r+1]}),Q(Yi,{type:"number",min:0,max:100,value:b.position,onChange:y=>h(r,{position:Math.max(0,Math.min(100,Number(y.target.value)))}),onKeyDown:y=>y.stopPropagation()}),Q(ro,{children:"%"})]}),b&&Q(_i,{color:b.color,opacity:b.opacity,onChange:(y,x)=>{h(r,{color:y,opacity:x}),y!=="transparent"&&_o(y)},showTransparent:!1}),Me(Py,{children:[Q(Ry,{children:"Geometry"}),(t.type==="linear"||t.type==="conic")&&Me(ip,{children:[Q(ro,{children:"Angle"}),Q(Dy,{style:{transform:`rotate(${t.angle}deg)`},onPointerDown:y=>{y.preventDefault(),y.stopPropagation();let x=y.currentTarget.getBoundingClientRect(),I=x.left+x.width/2,k=x.top+x.height/2,R=E=>{let M=Math.round(Math.atan2(E.clientY-k,E.clientX-I)*(180/Math.PI)+90);u({angle:(M%360+360)%360})},C=()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",C)};document.addEventListener("pointermove",R),document.addEventListener("pointerup",C)},children:Q(Ey,{})}),Q(Yi,{type:"number",value:t.angle,onChange:y=>u({angle:(Number(y.target.value)%360+360)%360}),onKeyDown:y=>y.stopPropagation()}),Q(ro,{children:"\xB0"})]}),(t.type==="radial"||t.type==="conic"||t.type==="diamond")&&Me(ip,{children:[Q(ro,{children:"Center"}),Q(ro,{children:"X"}),Q(Yi,{type:"number",min:0,max:100,value:t.centerX,onChange:y=>u({centerX:Number(y.target.value)}),onKeyDown:y=>y.stopPropagation()}),Q(ro,{children:"%"}),Q(ro,{style:{marginLeft:4},children:"Y"}),Q(Yi,{type:"number",min:0,max:100,value:t.centerY,onChange:y=>u({centerY:Number(y.target.value)}),onKeyDown:y=>y.stopPropagation()}),Q(ro,{children:"%"})]})]}),Me(By,{children:[Me(Ea,{onClick:()=>{let y=[...t.stops].map(x=>w(S({},x),{position:100-x.position}));u({stops:y})},title:"Reverse gradient",children:[Q("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:Q("path",{d:"M1 6h10M3 4l-2 2 2 2M9 4l2 2-2 2",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})}),"Reverse"]}),Me(Ea,{onClick:()=>m(r),disabled:t.stops.length<=2,title:"Remove selected stop",children:[Q("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:Q("path",{d:"M3 3l6 6M9 3l-6 6",stroke:"currentColor",strokeWidth:"1.2"})}),"Remove"]}),Me(Ea,{onClick:()=>{ly(t),a(!0)},title:"Save as preset",children:[Me("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:[Q("path",{d:"M2 2h8v8H2z",fill:"none",stroke:"currentColor",strokeWidth:"1"}),Q("path",{d:"M4 2v3h4V2",fill:"none",stroke:"currentColor",strokeWidth:"0.8"}),Q("rect",{x:"3",y:"7",width:"6",height:"1",fill:"currentColor",opacity:"0.5"})]}),"Save"]})]}),(l||T.length>0)&&Me(My,{children:[Me(Ly,{onClick:()=>a(!l),children:["Presets (",T.length,")",Q(Ay,{children:l?"\u2212":"+"})]}),l&&Me(Vy,{children:[T.map((y,x)=>Q(Hy,{style:{background:Co(y)},onClick:()=>{n(y),e(y,Co(y)),s(0)},onContextMenu:I=>{I.preventDefault(),dy(x),a(!0)},title:"Click to apply \xB7 Right-click to remove"},x)),T.length===0&&Q(rp,{children:"No presets saved yet"})]})]})]})}),gy=P("div",{background:"$panel",border:"1px solid $separator",borderRadius:"8px",padding:"8px",display:"flex",flexDirection:"column",gap:"8px",boxShadow:"0 8px 32px rgba(0,0,0,0.45)",outline:"none"}),fy=P("div",{display:"flex",gap:2,background:"$inputBg",borderRadius:6,padding:2}),Sy=P("button",{all:"unset",flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:3,fontSize:"8px",fontWeight:600,textAlign:"center",padding:"5px 0",borderRadius:4,color:"$textSecondary",cursor:"pointer",transition:"all 0.12s","&:hover":{color:"$text"},variants:{$active:{true:{background:"$accent",color:"#fff"}}}}),yy=P("span",{fontSize:"7px",fontWeight:500,letterSpacing:"0.02em"}),by=P("div",{width:"100%",height:40,borderRadius:6,border:"1px solid $separator"}),vy=P("div",{display:"flex",flexDirection:"column",gap:4}),Ty=P("span",{fontSize:"8px",color:"$textSecondary",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"}),xy=P("div",{position:"relative",height:24,borderRadius:6,cursor:"crosshair",overflow:"visible"}),ky=P("div",{width:"100%",height:"100%",borderRadius:6,border:"1px solid $separator"}),Cy=P("div",{position:"absolute",top:"50%",width:14,height:14,borderRadius:"50%",border:"2px solid #fff",transform:"translate(-50%, -50%)",cursor:"ew-resize",boxShadow:"0 1px 3px rgba(0,0,0,0.4)",transition:"box-shadow 0.08s",zIndex:2,variants:{$selected:{true:{boxShadow:"0 0 0 2px $colors$accent, 0 1px 4px rgba(0,0,0,0.5)",zIndex:3,width:16,height:16}}}}),rp=P("span",{fontSize:"7px",color:"$textSecondary",fontStyle:"italic",opacity:.6}),wy=P("div",{display:"flex",alignItems:"center",gap:4}),Iy=P("span",{fontSize:"8px",color:"$textSecondary",fontWeight:500,flex:1}),Py=P("div",{display:"flex",flexDirection:"column",gap:6,borderTop:"1px solid $separator",paddingTop:8}),Ry=P("span",{fontSize:"8px",color:"$textSecondary",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"}),ip=P("div",{display:"flex",alignItems:"center",gap:4}),ro=P("span",{fontSize:"8px",color:"$textSecondary",fontWeight:500}),Yi=P("input",{width:40,background:"$inputBg",border:"1px solid $inputBorder",borderRadius:4,color:"$text",fontSize:"9px",padding:"3px 4px",fontFamily:"$mono",textAlign:"center",outline:"none","&:focus":{borderColor:"$accent"},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),Dy=P("div",{width:28,height:28,borderRadius:"50%",border:"1px solid $inputBorder",background:"$inputBg",cursor:"pointer",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}),Ey=P("div",{width:2,height:"40%",background:"$accent",borderRadius:1,position:"absolute",top:3,left:"50%",transform:"translateX(-50%)"}),By=P("div",{display:"flex",gap:3,borderTop:"1px solid $separator",paddingTop:8}),Ea=P("button",{all:"unset",flex:1,fontSize:"8px",fontWeight:500,textAlign:"center",padding:"5px 0",borderRadius:4,color:"$textSecondary",border:"1px solid $separator",cursor:"pointer",transition:"all 0.1s",display:"flex",alignItems:"center",justifyContent:"center",gap:3,"&:hover":{background:"$hover",color:"$text"},"&:disabled":{opacity:.3,cursor:"default"}}),My=P("div",{borderTop:"1px solid $separator",paddingTop:6}),Ly=P("div",{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"8px",color:"$textSecondary",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",cursor:"pointer","&:hover":{color:"$text"}}),Ay=P("span",{fontSize:"10px",color:"$textSecondary"}),Vy=P("div",{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:4,marginTop:6}),Hy=P("div",{height:24,borderRadius:4,border:"1px solid $separator",cursor:"pointer",transition:"transform 0.08s, box-shadow 0.08s","&:hover":{transform:"scale(1.05)",boxShadow:"0 0 0 1px $colors$accent"}});import{Fragment as zr,jsx as D,jsxs as O}from"react/jsx-runtime";function cp(i,o){let[e,t,n]=Ko(i);return`rgba(${e},${t},${n},${o.toFixed(3)})`}function pp(i,o){if(!i||i==="transparent")return{hex:"transparent",opacity:1};let e=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return e?{hex:Lr(parseInt(e[1]),parseInt(e[2]),parseInt(e[3])),opacity:e[4]!==void 0?parseFloat(e[4]):1}:i.startsWith("#")?{hex:i.slice(0,7),opacity:1}:{hex:o,opacity:1}}var Gy=i=>{let o=i.document.pages[i.appState.currentPageId],t=i.document.pageStates[i.appState.currentPageId].selectedIds.map(n=>o.shapes[n]).filter(Boolean);return{shapes:t,key:JSON.stringify(t)}},jy=i=>i.settings.isDarkMode?"dark":"light",Ha=Ie.memo(function(){let o=N(),{shapes:e}=o.useStore(Gy),t=o.useStore(jy);if(e.length===0)return D(hp,{children:O(Nn,{children:[D(lo,{children:"Design"}),D(rb,{children:"Select an element to edit"})]})});let n=e[0],r=e.length>1,s=n.type==="text"||n.type==="sticky"||"label"in n,l=n.type==="arrow",a=n.type==="rectangle",c=n.type==="pen";return O(hp,{children:[D(Wy,{shape:n,multi:r,count:e.length}),D(Zt,{}),!r&&c&&O(zr,{children:[D(nb,{shape:n,app:o}),D(Zt,{})]}),!r&&D(Ny,{shape:n,app:o}),r&&D(tb,{app:o}),D(Zt,{}),!r&&D(Uy,{shape:n,app:o}),!r&&D(Zt,{}),D(Ky,{shape:n,app:o,isRect:a}),D(Zt,{}),D(_y,{style:n.style,theme:t,app:o}),D(Zt,{}),D(wo,{title:"Stroke",children:D(Yy,{style:n.style,theme:t,app:o})}),D(Zt,{}),D(wo,{title:"Gradient",children:D(Xy,{shape:n,app:o})}),D(Zt,{}),s&&O(zr,{children:[D(wo,{title:"Text Style",defaultOpen:!0,children:D(Zy,{style:n.style,app:o,theme:t})}),D(Zt,{})]}),D(wo,{title:"Effects",children:D(Jy,{shape:n,app:o})}),D(Zt,{}),l&&!r&&O(zr,{children:[D(wo,{title:"Arrow",defaultOpen:!0,children:D(Qy,{shape:n,app:o})}),D(Zt,{})]}),s&&O(zr,{children:[D(wo,{title:"Typography",defaultOpen:!0,children:D(eb,{style:n.style,app:o})}),D(Zt,{})]}),D(wo,{title:"Export",children:D(ob,{shape:n,app:o})}),D("div",{style:{height:40}})]})});function Wy({shape:i,multi:o,count:e}){let t=o?e+" Selected":i.type.charAt(0).toUpperCase()+i.type.slice(1);return D(Nn,{style:{padding:"10px 12px 6px"},children:O("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[D(lo,{style:{marginBottom:0,fontSize:"11px"},children:t}),D("div",{style:{display:"flex",gap:4},children:["\u229E","\u25D1","\u229F","\u22A0"].map((n,r)=>D(fp,{title:["Clip Mask","Component","Boolean","Flatten"][r],children:n},r))})]})})}function Ny({shape:i,app:o}){let e=i.point||[0,0],t=Math.round((i.rotation||0)*(180/Math.PI)),n=Ie.useCallback((r,s)=>{let l={id:i.id};switch(r){case"x":l.point=[s,e[1]];break;case"y":l.point=[e[0],s];break;case"r":l.rotation=s*Math.PI/180;break}o.updateShapes(l)},[i.id,e,o]);return O(Nn,{children:[D(lo,{children:"Position"}),D(Ji,{children:[{fn:()=>o.align("left"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"2",x2:"2",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"7",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"4",y:"8",width:"5",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Left"},{fn:()=>o.align("centerHorizontal"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"7",y1:"1",x2:"7",y2:"13",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("rect",{x:"3",y:"4",width:"8",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"4",y:"8",width:"6",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Center H"},{fn:()=>o.align("right"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"12",y1:"2",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"3",y:"4",width:"7",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"5",y:"8",width:"5",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Right"},{fn:()=>o.align("top"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"2",x2:"12",y2:"2",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"2.5",height:"7",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"4",width:"2.5",height:"5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Top"},{fn:()=>o.align("centerVertical"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("rect",{x:"4",y:"2",width:"2.5",height:"10",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"3",width:"2.5",height:"8",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Center V"},{fn:()=>o.align("bottom"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"3",width:"2.5",height:"7",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"5",width:"2.5",height:"5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Bottom"}].map(({fn:r,icon:s,t:l},a)=>D(et,{onClick:r,title:l,children:s},a))}),O(gp,{style:{marginTop:8},children:[D(Ue,{label:"X",value:Math.round(e[0]),onChange:r=>n("x",r)}),D(Ue,{label:"Y",value:Math.round(e[1]),onChange:r=>n("y",r)})]}),O("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:4},children:[D(Ue,{label:"R",value:t,onChange:r=>n("r",r),suffix:"\xB0",style:{flex:1}}),O("div",{style:{display:"flex",gap:2},children:[D(et,{onClick:()=>o.flipHorizontal(),title:"Flip Horizontal",children:D("svg",{width:"20",height:"20",viewBox:"0 0 14 14",children:D("path",{d:"M7 2v10M3 5l-1 4h4zM11 5l1 4h-4z",stroke:"currentColor",strokeWidth:"1",fill:"none"})})}),D(et,{onClick:()=>o.flipVertical(),title:"Flip Vertical",children:D("svg",{width:"20",height:"20",viewBox:"0 0 14 14",children:D("path",{d:"M2 7h10M5 3l4-1v4zM5 11l4 1v-4z",stroke:"currentColor",strokeWidth:"1",fill:"none"})})})]})]})]})}function Uy({shape:i,app:o}){let e="size"in i?i.size:"radius"in i?[i.radius[0]*2,i.radius[1]*2]:[0,0],[t,n]=Ie.useState(!1),r=Ie.useCallback((s,l)=>{let a={id:i.id};if("size"in i)if(s==="w"){let c=t?l/e[0]*e[1]:e[1];a.size=[l,c]}else{let c=t?l/e[1]*e[0]:e[0];a.size=[c,l]}else"radius"in i&&(s==="w"?a.radius=[l/2,t?l/2/e[0]*e[1]/2:i.radius[1]]:a.radius=[t?l/2/e[1]*e[0]/2:i.radius[0],l/2]);o.updateShapes(a)},[i,e,t,o]);return O(Nn,{children:[D(lo,{children:"Layout"}),O(sb,{children:[D(Ue,{label:"W",value:Math.round(e[0]),onChange:s=>r("w",s),min:1}),D(Ue,{label:"H",value:Math.round(e[1]),onChange:s=>r("h",s),min:1})]})]})}function Ky({shape:i,app:o,isRect:e}){var r,s;let t=Math.round(((r=i.style.opacity)!=null?r:1)*100),n=(s=i.style.borderRadius)!=null?s:0;return O(Nn,{children:[D(lo,{children:"Appearance"}),D(Ue,{label:"Opacity",value:t,onChange:l=>o.style({opacity:l/100}),min:0,max:100,suffix:"%",labelWidth:36}),e&&D("div",{style:{marginTop:4},children:D(Ue,{label:"Corner",value:n,onChange:l=>o.style({borderRadius:l}),min:0,suffix:"px",labelWidth:36})}),O(so,{style:{marginTop:4},children:[D(ao,{style:{width:36},children:"Dash"}),D(Qi,{children:[{val:"draw",label:"~"},{val:"solid",label:"\u2014"},{val:"dashed",label:"- -"},{val:"dotted",label:"\xB7\xB7\xB7"}].map(({val:l,label:a})=>D(et,{isActive:i.style.dash===l,onClick:()=>o.style({dash:l}),children:a},l))})]})]})}function _y({style:i,theme:o,app:e}){var r,s;let t=i.isFilled?i.fillHex||((r=yo[o])==null?void 0:r[i.color])||yo.light[i.color]:"transparent",n=Ie.useCallback((l,a)=>{l==="transparent"?e.style({isFilled:!1}):e.style({fillHex:l,isFilled:!0,opacity:a})},[e]);return O(Nn,{children:[D(lo,{children:"Fill"}),D(Yo,{color:t,opacity:(s=i.opacity)!=null?s:1,onChange:n,showTransparent:!0,showOpacity:!0,label:"Color"})]})}function Yy({style:i,theme:o,app:e}){var r,s;let t=i.strokeHex||((r=zn[o])==null?void 0:r[i.color])||zn.light[i.color],n=(s=i.strokeWidthOverride)!=null?s:{small:2,medium:3.5,large:5}[i.size]||2;return O("div",{children:[D(Yo,{color:t,opacity:1,onChange:l=>e.style({strokeHex:l}),showTransparent:!0,showOpacity:!1}),D("div",{style:{marginTop:6},children:D(Ue,{label:"Width",value:n,onChange:l=>e.style({strokeWidthOverride:l}),min:0,step:.01,suffix:"px",max:10,labelWidth:36})})]})}function Xy({shape:i,app:o}){let[e,t]=Ie.useState(!!i.style.gradient),n=i.style.gradient,r=Ie.useCallback(()=>{if(e)o.style({gradient:void 0}),t(!1);else{let s={type:"linear",stops:[{color:"#0D99FF",position:0,opacity:1},{color:"#FF6B00",position:100,opacity:1}],angle:90,centerX:50,centerY:50};o.style({gradient:s,isFilled:!0}),t(!0)}},[e,o]);return O("div",{children:[O(so,{children:[D(ao,{style:{width:36},children:"Enable"}),D(za,{checked:e,onClick:r,children:D(Fa,{checked:e})})]}),e&&D("div",{style:{marginTop:8},children:D(Xi,{value:n,onChange:(s,l)=>{o.style({gradient:s})}})})]})}function Zy({style:i,app:o,theme:e}){var h;let t=((h=zn[e])==null?void 0:h[i.color])||"#000000",{hex:n,opacity:r}=pp(i.labelColor,t),{hex:s,opacity:l}=pp(i.labelBackground,"transparent"),a=i.textGradient,[c,p]=Ie.useState(!!a),u=Ie.useCallback(()=>{if(c)o.style({textGradient:void 0}),p(!1);else{let g={type:"linear",stops:[{color:"#0D99FF",position:0,opacity:1},{color:"#FF6B00",position:100,opacity:1}],angle:90,centerX:50,centerY:50};o.style({textGradient:g}),p(!0)}},[c,o]);return O("div",{children:[D(Yo,{color:n,opacity:r,onChange:(g,m)=>{let f=g==="transparent"?"transparent":cp(g,m);o.style({labelColor:f})},showTransparent:!0,showOpacity:!0,label:"Text"}),D("div",{style:{marginTop:6},children:D(Yo,{color:s,opacity:l,onChange:(g,m)=>{let f=g==="transparent"?"transparent":cp(g,m);o.style({labelBackground:f})},showTransparent:!0,showOpacity:!0,label:"Text Bg"})}),O("div",{style:{marginTop:8},children:[O(so,{children:[D(ao,{style:{width:60},children:"Text Grad"}),D(za,{checked:c,onClick:u,children:D(Fa,{checked:c})})]}),c&&D("div",{style:{marginTop:8},children:D(Xi,{value:a,onChange:g=>o.style({textGradient:g})})})]})]})}function qy(i){if(!i)return[];if(Array.isArray(i))return i;let o=[];i.dropShadow&&o.push({id:qi.uniqueId(),type:"dropShadow",enabled:i.dropShadow.enabled,x:i.dropShadow.x,y:i.dropShadow.y,blur:i.dropShadow.blur,spread:i.dropShadow.spread,color:i.dropShadow.color});let e={layerBlur:0,blur:0,brightness:100,contrast:100,saturate:100,hueRotate:0,grayscale:0,sepia:0};for(let t of Object.keys(e))i[t]!==void 0&&i[t]!==e[t]&&o.push({id:qi.uniqueId(),type:t,enabled:!0,value:i[t]});return i.invert&&o.push({id:qi.uniqueId(),type:"invert",enabled:!0}),o}var up={dropShadow:"Drop Shadow",blur:"Blur",layerBlur:"Layer Blur",brightness:"Brightness",contrast:"Contrast",saturate:"Saturation",hueRotate:"Hue Rotate",grayscale:"Grayscale",sepia:"Sepia",invert:"Invert"};function Jy({shape:i,app:o}){let e=qy(i.effects),t=Ie.useCallback(l=>o.updateShapes({id:i.id,effects:l}),[o,i.id]),n=(l,a)=>{t(e.map(c=>c.id===l?S(S({},c),a):c))},r=l=>{t(e.filter(a=>a.id!==l))},s=l=>{let a={id:qi.uniqueId(),type:l,enabled:!0};l==="dropShadow"?Object.assign(a,{x:2,y:4,blur:8,spread:0,color:"#00000080"}):["layerBlur","blur"].includes(l)?a.value=4:["brightness","contrast","saturate"].includes(l)?a.value=100:a.value=0,t([...e,a])};return O("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.map(l=>{var a,c,p,u,h,g,m,f,v;return O("div",{style:{borderBottom:"1px solid var(--colors-separator)",paddingBottom:6},children:[O("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[O("div",{style:{display:"flex",alignItems:"center",gap:6},children:[D(za,{checked:l.enabled,onClick:()=>n(l.id,{enabled:!l.enabled}),children:D(Fa,{checked:l.enabled})}),D("span",{style:{fontSize:10,fontWeight:500,color:"var(--colors-text)"},children:up[l.type]})]}),D("button",{onClick:()=>r(l.id),style:{all:"unset",cursor:"pointer",opacity:.5,fontSize:12,lineHeight:1},title:"Remove effect",children:"\u2715"})]}),l.enabled&&O("div",{style:{paddingLeft:22},children:[l.type==="dropShadow"&&O(zr,{children:[O(gp,{style:{marginBottom:4},children:[D(Ue,{label:"X",value:(a=l.x)!=null?a:0,onChange:b=>n(l.id,{x:b})}),D(Ue,{label:"Y",value:(c=l.y)!=null?c:0,onChange:b=>n(l.id,{y:b})}),D(Ue,{label:"Blur",value:(p=l.blur)!=null?p:0,onChange:b=>n(l.id,{blur:Math.max(0,b)}),labelWidth:26}),D(Ue,{label:"Sprd",value:(u=l.spread)!=null?u:0,onChange:b=>n(l.id,{spread:b}),labelWidth:28})]}),O(so,{children:[D(ao,{style:{width:40,textAlign:"left"},children:"Color"}),D("input",{type:"color",value:((h=l.color)!=null?h:"#000000").slice(0,7),onChange:b=>n(l.id,{color:b.target.value+"80"}),style:{width:24,height:20,border:"none",padding:0,cursor:"pointer"}})]})]}),["layerBlur","blur"].includes(l.type)&&D(Ue,{label:"Radius",value:(g=l.value)!=null?g:0,onChange:b=>n(l.id,{value:Math.max(0,b)}),suffix:"px",labelWidth:40}),["brightness","contrast","saturate"].includes(l.type)&&D(Ue,{label:"Amount",value:(m=l.value)!=null?m:100,onChange:b=>n(l.id,{value:Math.max(0,b)}),suffix:"%",labelWidth:40}),["hueRotate"].includes(l.type)&&D(Ue,{label:"Angle",value:(f=l.value)!=null?f:0,onChange:b=>n(l.id,{value:b}),suffix:"\xB0",labelWidth:40}),["grayscale","sepia"].includes(l.type)&&D(Ue,{label:"Amount",value:(v=l.value)!=null?v:0,onChange:b=>n(l.id,{value:Math.max(0,Math.min(100,b))}),suffix:"%",labelWidth:40})]})]},l.id)}),D("div",{style:{position:"relative"},children:O("select",{value:"",onChange:l=>s(l.target.value),style:{width:"100%",padding:"4px 6px",fontSize:10,borderRadius:4,background:"var(--colors-inputBg)",color:"var(--colors-textSecondary)",border:"1px dashed var(--colors-separator)",cursor:"pointer"},children:[D("option",{value:"",disabled:!0,children:"+ Add Effect"}),Object.entries(up).map(([l,a])=>D("option",{value:l,children:a},l))]})})]})}function Qy({shape:i,app:o}){var r,s;let e=i,t=!!((r=e.decorations)!=null&&r.start),n=((s=e.decorations)==null?void 0:s.end)!==void 0;return O("div",{children:[O(so,{children:[D(ao,{style:{width:36},children:"Start"}),O(Qi,{children:[D(et,{isActive:!t,onClick:()=>o.updateShapes({id:i.id,decorations:w(S({},e.decorations),{start:void 0})}),children:"None"}),D(et,{isActive:t,onClick:()=>o.updateShapes({id:i.id,decorations:w(S({},e.decorations),{start:"arrow"})}),children:"\u25C4"})]})]}),O(so,{children:[D(ao,{style:{width:36},children:"End"}),O(Qi,{children:[D(et,{isActive:!n,onClick:()=>o.updateShapes({id:i.id,decorations:w(S({},e.decorations),{end:void 0})}),children:"None"}),D(et,{isActive:n,onClick:()=>o.updateShapes({id:i.id,decorations:w(S({},e.decorations),{end:"arrow"})}),children:"\u25BA"})]})]}),D("div",{style:{marginTop:4},children:D(Ue,{label:"Bend",value:Math.round((e.bend||0)*100),onChange:l=>o.updateShapes({id:i.id,bend:l/100}),min:-99,max:99,suffix:"%",labelWidth:36})})]})}function eb({style:i,app:o}){var g;let[e,t]=Ie.useState(""),[n,r]=Ie.useState(!1),[s,l]=Ie.useState([]),a=Ie.useRef(null);Ie.useEffect(()=>{Promise.resolve().then(()=>(Hr(),Zi)).then(m=>{l(m.searchGoogleFonts(e))})},[e]);let c=Ie.useCallback(m=>{Promise.resolve().then(()=>(Hr(),Zi)).then(f=>{f.loadGoogleFont(m.family,m.variants);let v=m.category==="monospace"?"mono":m.category==="serif"?"serif":m.category==="handwriting"?"script":"sans";o.style({font:v,fontFamily:m.family}),t(""),r(!1)})},[o]);Ie.useEffect(()=>{let m=f=>{a.current&&!a.current.contains(f.target)&&(r(!1),t(""))};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);let p=i.font==="mono"?"Monospace":i.font==="serif"?"Serif":i.font==="script"?"Script":"Sans Serif",u=i.fontFamily||p,h=Math.round(((g=i.scale)!=null?g:1)*100);return O("div",{children:[O(so,{children:[D(ao,{style:{width:36},children:"Font"}),O("div",{ref:a,style:{position:"relative",flex:1},children:[D(ib,{value:e||u,onChange:m=>{t(m.target.value),r(!0)},onFocus:()=>{r(!0),Promise.resolve().then(()=>(Hr(),Zi)).then(m=>m.fetchGoogleFonts())},placeholder:"Search fonts...",style:{fontSize:9}}),n&&s.length>0&&D(ab,{children:s.map(m=>D(lb,{onMouseDown:f=>{f.preventDefault(),c(m)},style:{fontFamily:m.family},children:m.family},m.family))})]})]}),D("div",{style:{marginTop:4},children:D(Ue,{label:"Size",value:h,onChange:m=>o.style({scale:m/100}),min:25,max:300,suffix:"%",labelWidth:36})}),O(so,{style:{marginTop:4},children:[D(ao,{style:{width:36},children:"Align"}),D(Qi,{children:[{val:"start",svg:D("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:D("path",{d:"M1 2H11M1 5H7M1 8H9M1 11H5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})})},{val:"middle",svg:D("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:D("path",{d:"M1 2H11M3 5H9M2 8H10M4 11H8",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})})},{val:"end",svg:D("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:D("path",{d:"M1 2H11M5 5H11M3 8H11M7 11H11",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})})},{val:"justify",svg:D("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:D("path",{d:"M1 2H11M1 5H11M1 8H11M1 11H11",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})})}].map(({val:m,svg:f})=>D(et,{isActive:i.textAlign===m,onClick:()=>o.style({textAlign:m}),children:f},m))})]})]})}function tb({app:i}){return O(Nn,{children:[D(lo,{children:"Alignment"}),D(Ji,{children:[{fn:()=>i.align("left"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"2",x2:"2",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"7",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"4",y:"8",width:"5",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Left"},{fn:()=>i.align("centerHorizontal"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"7",y1:"1",x2:"7",y2:"13",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("rect",{x:"3",y:"4",width:"8",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"4",y:"8",width:"6",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Center H"},{fn:()=>i.align("right"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"12",y1:"2",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"3",y:"4",width:"7",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"5",y:"8",width:"5",height:"2.5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Right"},{fn:()=>i.align("top"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"2",x2:"12",y2:"2",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"2.5",height:"7",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"4",width:"2.5",height:"5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Top"},{fn:()=>i.align("centerVertical"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("rect",{x:"4",y:"2",width:"2.5",height:"10",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"3",width:"2.5",height:"8",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Center V"},{fn:()=>i.align("bottom"),icon:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"12",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"3",width:"2.5",height:"7",rx:"0.5",fill:"currentColor",opacity:"0.6"}),D("rect",{x:"8",y:"5",width:"2.5",height:"5",rx:"0.5",fill:"currentColor",opacity:"0.6"})]}),t:"Bottom"}].map(({fn:o,icon:e,t},n)=>D(et,{onClick:o,title:t,children:e},n))}),D(mp,{style:{display:"block",marginTop:8,marginBottom:4},children:"Distribute"}),O(Ji,{style:{gridTemplateColumns:"repeat(2, 1fr)"},children:[D(et,{onClick:()=>i.distribute("horizontal"),title:"Distribute Horizontal",children:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"1",y1:"2",x2:"1",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"13",y1:"2",x2:"13",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"6",height:"6",rx:"0.5",fill:"currentColor",opacity:"0.5"})]})}),D(et,{onClick:()=>i.distribute("vertical"),title:"Distribute Vertical",children:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"1",x2:"12",y2:"1",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"2",y1:"13",x2:"12",y2:"13",stroke:"currentColor",strokeWidth:"1.5"}),D("rect",{x:"4",y:"4",width:"6",height:"6",rx:"0.5",fill:"currentColor",opacity:"0.5"})]})})]}),D(mp,{style:{display:"block",marginTop:8,marginBottom:4},children:"Stretch"}),O(Ji,{style:{gridTemplateColumns:"repeat(2, 1fr)"},children:[D(et,{onClick:()=>i.stretch("horizontal"),title:"Stretch Width",children:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"1",y1:"2",x2:"1",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"13",y1:"2",x2:"13",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("path",{d:"M3 5.5h8",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"}),D("path",{d:"M3 8.5h8",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"})]})}),D(et,{onClick:()=>i.stretch("vertical"),title:"Stretch Height",children:O("svg",{width:"14",height:"14",viewBox:"0 0 14 14",children:[D("line",{x1:"2",y1:"1",x2:"12",y2:"1",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"2",y1:"13",x2:"12",y2:"13",stroke:"currentColor",strokeWidth:"1.5"}),D("line",{x1:"7",y1:"1",x2:"7",y2:"13",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"2 1"}),D("path",{d:"M5.5 3v8",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"}),D("path",{d:"M8.5 3v8",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"})]})})]})]})}function Va(i,o){let e=URL.createObjectURL(i),t=document.createElement("a");t.href=e,t.download=o,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)}function nb({shape:i,app:o}){let e=o.useStore(n=>n.appState.nodeEditingId===i.id),t=Ie.useCallback(()=>{e?o.setNodeEditingId(void 0):o.setNodeEditingId(i.id)},[o,i.id,e]);return D(Nn,{children:D(et,{onClick:t,isActive:e,style:{width:"100%"},children:e?"Exit Edit Mode":"Edit Shape"})})}function ob({shape:i,app:o}){let[e,t]=Ie.useState(null),n=i.type+"-"+i.id.slice(0,6);return D("div",{children:O("div",{style:{display:"flex",gap:4},children:[D(et,{style:{flex:1},onClick:()=>z(this,null,function*(){t("svg");try{let a=yield o.exportImage("svg",{ids:[i.id]});a&&Va(a,n+".svg")}catch(a){console.error("SVG export failed",a)}t(null)}),title:"Export as SVG",children:e==="svg"?"...":"SVG"}),D(et,{style:{flex:1},onClick:()=>z(this,null,function*(){t("png");try{let a=yield o.exportImage("png",{ids:[i.id]});a&&Va(a,n+".png")}catch(a){console.error("PNG export failed",a)}t(null)}),title:"Export as PNG",children:e==="png"?"...":"PNG"}),D(et,{style:{flex:1},onClick:()=>{let a=JSON.stringify(i,null,2);navigator.clipboard.writeText(a).catch(c=>{}),Va(new Blob([a],{type:"application/json"}),n+".json")},title:"Copy JSON & download",children:"JSON"})]})})}function wo({title:i,children:o,defaultOpen:e=!1}){let[t,n]=Ie.useState(e);return O(Nn,{children:[O("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"},onClick:()=>n(!t),children:[D(lo,{style:{marginBottom:0},children:i}),D(fp,{onClick:r=>{r.stopPropagation(),n(!t)},children:t?"\u2212":"+"})]}),t&&D("div",{style:{marginTop:8},children:o})]})}var hp=P("div",{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden","&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{background:"$separator",borderRadius:"2px"}}),Nn=P("div",{padding:"8px 12px"}),lo=P("div",{fontSize:"10px",fontWeight:600,color:"$textSecondary",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"8px"}),Zt=P("div",{height:"1px",background:"$separator"}),rb=P("div",{fontSize:"10px",color:"$textSecondary",fontStyle:"italic"}),gp=P("div",{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"4px"}),so=P("div",{display:"flex",alignItems:"center",gap:"6px",marginBottom:"4px"}),ao=P("label",{fontSize:"9px",color:"$textSecondary",fontWeight:500,width:"18px",flexShrink:0,textAlign:"right",cursor:"ew-resize",userSelect:"none"}),lE=P("span",{fontSize:"9px",color:"$textSecondary"}),ib=P("input",{width:"100%",background:"$inputBg",border:"1px solid $inputBorder",borderRadius:"$1",color:"$text",fontSize:"10px",padding:"4px 6px",fontFamily:"$ui",outline:"none",transition:"border-color 0.1s","&:focus":{borderColor:"$accent"},"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"}}),mp=P("span",{fontSize:"9px",color:"$textSecondary",fontFamily:"$mono"}),Ji=P("div",{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"3px"}),Qi=P("div",{display:"flex",gap:"2px",flex:1}),et=P("button",{all:"unset",flex:1,height:"24px",border:"1px solid $separator",borderRadius:"$1",color:"$textSecondary",cursor:"pointer",fontSize:"9px",fontFamily:"$ui",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.08s","&:hover":{background:"$hover",color:"$text"},variants:{isActive:{true:{background:"$accent",borderColor:"$accent",color:"white","&:hover":{background:"$accent",color:"white"}}}}}),fp=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"$0",cursor:"pointer",color:"$textSecondary",fontSize:"11px","&:hover":{background:"$hover",color:"$text"}}),za=P("button",{all:"unset",width:"28px",height:"16px",borderRadius:"$pill",cursor:"pointer",padding:"2px",transition:"background 0.12s",background:"$inputBg",variants:{checked:{true:{background:"$accent"}}}}),Fa=P("div",{width:"12px",height:"12px",borderRadius:"50%",background:"white",transition:"transform 0.12s",variants:{checked:{true:{transform:"translateX(12px)"}}}}),sb=P("div",{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"4px",alignItems:"center"}),dE=P("button",{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"$1",border:"1px solid $separator",cursor:"pointer",color:"$textSecondary",transition:"all 0.08s",flexShrink:0,"&:hover":{background:"$hover",color:"$text"},variants:{locked:{true:{background:"rgba(13,153,255,0.15)",borderColor:"$accent",color:"$accent"}}}}),ab=P("div",{position:"absolute",top:"100%",left:0,right:0,maxHeight:"140px",overflowY:"auto",background:"$panel",border:"1px solid $separator",borderRadius:"$2",zIndex:1e3,boxShadow:"0 4px 16px rgba(0,0,0,0.3)",marginTop:"2px","&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{background:"$separator",borderRadius:"2px"}}),lb=P("div",{padding:"4px 8px",fontSize:"10px",color:"$text",cursor:"pointer","&:hover":{background:"$hover"}});import{jsx as Sp}from"react/jsx-runtime";var Oa=yp.memo(function(){return Sp(db,{children:Sp(Ha,{})})}),db=P("div",{display:"flex",flexDirection:"column",width:"240px",height:"100%",background:"$panel",borderLeft:"1px solid $separator",zIndex:200,pointerEvents:"all",overflow:"hidden",flexShrink:0});Hr();import*as jp from"react";import{useIntl as pv}from"react-intl";import*as Ip from"@radix-ui/react-dropdown-menu";import{HamburgerMenuIcon as Cb}from"@radix-ui/react-icons";import*as Pe from"react";import{FormattedMessage as tt,useIntl as wb}from"react-intl";import{Item as cb}from"@radix-ui/react-dropdown-menu";import{jsx as bp}from"react/jsx-runtime";function ce(t){var n=t,{onSelect:i,id:o}=n,e=Be(n,["onSelect","id"]);return bp(cb,{dir:"ltr",asChild:!0,onSelect:i,id:o,children:bp(Je,S({},e))})}import{CheckboxItem as pb}from"@radix-ui/react-dropdown-menu";var ke=i=>i.preventDefault();import{jsx as vp}from"react/jsx-runtime";function qt({checked:i,disabled:o=!1,variant:e,onCheckedChange:t,kbd:n,id:r,ariaLabel:s,children:l}){return vp(pb,{dir:"ltr",onSelect:ke,onCheckedChange:t,checked:i,disabled:o,asChild:!0,id:r,"aria-label":s,children:vp(Je,{kbd:n,variant:e,hasIndicator:!0,children:l})})}import*as es from"@radix-ui/react-dropdown-menu";import{jsx as $a}from"react/jsx-runtime";function wn({sideOffset:i=4,alignOffset:o=0,children:e,align:t,variant:n,id:r,overflow:s=!1,side:l="bottom"}){let a=rn();return $a(es.Portal,{container:a.current,dir:"ltr",children:$a(es.Content,{align:t,alignOffset:o,sideOffset:i,onEscapeKeyDown:ot,asChild:!0,id:r,side:l,children:$a(ub,{variant:n,overflow:s,children:e})})})}var ub=P(Ln,{width:"fit-content",height:"fit-content",minWidth:0,maxHeight:"100vh",overflowY:"auto",overflowX:"hidden","&::webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none",variants:{variant:{horizontal:{flexDirection:"row"},menu:{minWidth:128}},overflow:{true:{maxHeight:"60vh"}}}});import{Separator as hb}from"@radix-ui/react-dropdown-menu";var zE=P(hb,{backgroundColor:"$hover",height:1,marginTop:"$2",marginRight:"-$2",marginBottom:"$2",marginLeft:"-$2"});import{RadioItem as mb}from"@radix-ui/react-dropdown-menu";var Fr=P(mb,{height:"32px",width:"32px",backgroundColor:"$panel",borderRadius:"4px",padding:"0",margin:"0",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",border:"none",pointerEvents:"all",cursor:"pointer",variants:{isActive:{true:{backgroundColor:"$selected",color:"white"},false:{}},bp:{mobile:{},small:{}}},compoundVariants:[{isActive:!1,bp:"small",css:{"&:focus":{backgroundColor:"$hover"},"&:hover:not(:disabled)":{backgroundColor:"$hover"}}}]});import{Arrow as gb,Sub as fb,SubContent as Sb,SubTrigger as yb}from"@radix-ui/react-dropdown-menu";import{jsx as ts,jsxs as Tp}from"react/jsx-runtime";function In({children:i,size:o,overflow:e=!1,disabled:t=!1,label:n,id:r}){return Tp(fb,{children:[ts(yb,{dir:"ltr",asChild:!0,children:ts(Je,{disabled:t,hasArrow:!0,children:n})}),ts(Sb,{asChild:!0,sideOffset:4,alignOffset:-4,children:Tp(Ln,{size:o,overflow:e,children:[i,ts(gb,{offset:13})]})})]},r)}import{Trigger as bb}from"@radix-ui/react-dropdown-menu";import{jsx as xp}from"react/jsx-runtime";function ns(t){var n=t,{id:i,children:o}=n,e=Be(n,["id","children"]);return xp(bb,{asChild:!0,id:i,children:xp(Tt,w(S({},e),{children:o}))})}import*as Un from"react";import{FormattedMessage as co,useIntl as vb}from"react-intl";import{jsx as Ge,jsxs as kb}from"react/jsx-runtime";var Tb=i=>i.settings,xb=["bottom","left","right","top"];function Cp(){let i=N(),o=vb(),e=i.useStore(Tb),t=Un.useCallback(()=>{i.setSetting("isDebugMode",u=>!u)},[i]),n=Un.useCallback(()=>{i.setSetting("isDarkMode",u=>!u)},[i]),r=Un.useCallback(()=>{i.setSetting("isFocusMode",u=>!u)},[i]),s=Un.useCallback(()=>{i.setSetting("showGrid",u=>!u)},[i]),l=Un.useCallback(()=>{i.setSetting("keepStyleMenuOpen",u=>!u)},[i]),a=Un.useCallback(()=>{i.setSetting("isCadSelectMode",u=>!u)},[i]),c=Un.useCallback(u=>{i.setSetting("dockPosition",u)},[i]),p=Un.useCallback(u=>{i.setSetting("exportBackground",u)},[i]);return kb(In,{label:o.formatMessage({id:"menu.preferences"}),id:"TD-MenuItem-Preferences",children:[Ge(qt,{checked:e.isDarkMode,onCheckedChange:n,kbd:"#\u21E7D",id:"TD-MenuItem-Preferences-Dark_Mode",ariaLabel:o.formatMessage({id:"preferences.dark.mode"}),children:Ge(co,{id:"preferences.dark.mode"})}),Ge(qt,{checked:e.isFocusMode,onCheckedChange:r,kbd:"#.",id:"TD-MenuItem-Preferences-Focus_Mode",ariaLabel:o.formatMessage({id:"preferences.focus.mode"}),children:Ge(co,{id:"preferences.focus.mode"})}),Ge(qt,{checked:e.isDebugMode,onCheckedChange:t,id:"TD-MenuItem-Preferences-Debug_Mode",ariaLabel:o.formatMessage({id:"preferences.debug.mode"}),children:Ge(co,{id:"preferences.debug.mode"})}),Ge(ve,{}),Ge(qt,{checked:e.showGrid,onCheckedChange:s,kbd:"#\u21E7G",id:"TD-MenuItem-Preferences-Grid",ariaLabel:o.formatMessage({id:"preferences.show.grid"}),children:Ge(co,{id:"preferences.show.grid"})}),Ge(qt,{checked:e.isCadSelectMode,onCheckedChange:a,id:"TD-MenuItem-Preferences-Cad_Selection",ariaLabel:o.formatMessage({id:"preferences.use.cad.selection"}),children:Ge(co,{id:"preferences.use.cad.selection"})}),Ge(qt,{checked:e.keepStyleMenuOpen,onCheckedChange:l,id:"TD-MenuItem-Preferences-Style_menu",ariaLabel:o.formatMessage({id:"preferences.keep.stylemenu.open"}),children:Ge(co,{id:"preferences.keep.stylemenu.open"})}),Ge(In,{label:o.formatMessage({id:"dock.position"}),children:xb.map(u=>Ge(qt,{checked:e.dockPosition===u,onCheckedChange:()=>c(u),id:`TD-MenuItem-DockPosition-${u}`,ariaLabel:`DockPosition-${u}`,children:Ge(kp,{children:Ge(co,{id:u})})},u))}),Ge(In,{label:o.formatMessage({id:"export.background"}),children:Object.values(fr).map(u=>Ge(qt,{checked:e.exportBackground===u,onCheckedChange:()=>p(u),id:`TD-MenuItem-ExportBackground-${u}`,ariaLabel:`ExportBackground-${u}`,children:Ge(kp,{children:Ge(co,{id:u})})},u))})]})}var kp=P("span",{textTransform:"capitalize"});import{Fragment as wp,jsx as Z,jsxs as Jt}from"react/jsx-runtime";var Ib=i=>i.document.pageStates[i.appState.currentPageId].selectedIds.length,Pb=i=>i.appState.disableAssets,Pp=Pe.memo(function({readOnly:o}){let e=N(),t=wb(),[n,r]=Pe.useState(!1),s=e.useStore(Ib),l=e.useStore(Pb),[a,c]=Pe.useState(0);Pe.useEffect(()=>c(1),[]);let{onNewProject:p,onOpenProject:u,onSaveProject:h,onSaveProjectAs:g}=Qr(),m=Pe.useCallback(()=>{r(!0)},[]),f=Pe.useCallback(()=>{e.delete()},[e]),v=Pe.useCallback(()=>{e.copyImage("svg",{scale:1,quality:1,transparentBackground:!1})},[e]),b=Pe.useCallback(()=>{e.copyImage("png",{scale:2,quality:1,transparentBackground:!0})},[e]),T=Pe.useCallback(()=>z(this,null,function*(){e.exportImage("png",{scale:2,quality:1})}),[e]),y=Pe.useCallback(()=>z(this,null,function*(){e.exportImage("jpeg",{scale:2,quality:1})}),[e]),x=Pe.useCallback(()=>z(this,null,function*(){e.exportImage("webp",{scale:2,quality:1})}),[e]),I=Pe.useCallback(()=>z(this,null,function*(){e.exportImage("svg",{scale:2,quality:1})}),[e]),k=Pe.useCallback(()=>z(this,null,function*(){e.copyJson()}),[e]),R=Pe.useCallback(()=>z(this,null,function*(){e.exportJson()}),[e]),C=Pe.useCallback(()=>{e.cut()},[e]),E=Pe.useCallback(()=>{e.copy()},[e]),M=Pe.useCallback(()=>{e.paste()},[e]),L=Pe.useCallback(()=>{e.selectAll()},[e]),A=Pe.useCallback(()=>{e.selectNone()},[e]),K=Pe.useCallback(()=>{e.openAsset()},[e]),re=Pe.useCallback(()=>{e.zoomTo(1)},[e]),F=e.callbacks.onNewProject||e.callbacks.onOpenProject||e.callbacks.onSaveProject||e.callbacks.onSaveProjectAs||e.callbacks.onExport,ee=s>0;return Jt(wp,{children:[Jt(Ip.Root,{dir:"ltr",children:[Z(ns,{id:"TD-MenuIcon",children:Z(Cb,{})}),Jt(wn,{variant:"menu",id:"TD-Menu",side:"bottom",align:"start",sideOffset:4,alignOffset:4,children:[F&&Jt(In,{label:`${t.formatMessage({id:"menu.file"})}...`,id:"TD-MenuItem-File",children:[e.callbacks.onNewProject&&Z(ce,{onClick:p,kbd:"#N",id:"TD-MenuItem-File-New_Project",children:Z(tt,{id:"new.project"})}),e.callbacks.onOpenProject&&Jt(ce,{onClick:u,kbd:"#O",id:"TD-MenuItem-File-Open",children:[Z(tt,{id:"open"}),"..."]}),e.callbacks.onSaveProject&&Z(ce,{onClick:h,kbd:"#S",id:"TD-MenuItem-File-Save",children:Z(tt,{id:"save"})}),e.callbacks.onSaveProjectAs&&Jt(ce,{onClick:m,kbd:"#\u21E7S",id:"TD-MenuItem-File-Save_As",children:[Z(tt,{id:"save.as"}),"..."]}),Jt(In,{label:`${t.formatMessage({id:"export.as"})}...`,size:"small",id:"TD-MenuItem-Export",children:[Z(ce,{onClick:I,id:"TD-MenuItem-Export-SVG",children:"SVG"}),Z(ce,{onClick:T,id:"TD-MenuItem-Export-PNG",children:"PNG"}),Z(ce,{onClick:y,id:"TD-MenuItem-Export-JPG",children:"JPG"}),Z(ce,{onClick:x,id:"TD-MenuItem-Export-WEBP",children:"WEBP"}),Z(ce,{onClick:R,id:"TD-MenuItem-Export-JSON",children:"JSON"})]}),!l&&Jt(wp,{children:[Z(ve,{}),Z(ce,{onClick:K,kbd:"#U",id:"TD-MenuItem-File-Upload_Media",children:Z(tt,{id:"upload.media"})})]})]}),Jt(In,{label:`${t.formatMessage({id:"menu.edit"})}...`,id:"TD-MenuItem-Edit",children:[Z(ce,{onSelect:ke,onClick:e.undo,disabled:o,kbd:"#Z",id:"TD-MenuItem-Edit-Undo",children:Z(tt,{id:"undo"})}),Z(ce,{onSelect:ke,onClick:e.redo,disabled:o,kbd:"#\u21E7Z",id:"TD-MenuItem-Edit-Redo",children:Z(tt,{id:"redo"})}),Z(ve,{}),Z(ce,{onSelect:ke,disabled:!ee||o,onClick:C,kbd:"#X",id:"TD-MenuItem-Edit-Cut",children:Z(tt,{id:"cut"})}),Z(ce,{onSelect:ke,disabled:!ee,onClick:E,kbd:"#C",id:"TD-MenuItem-Edit-Copy",children:Z(tt,{id:"copy"})}),Z(ce,{onSelect:ke,onClick:M,kbd:"#V",id:"TD-MenuItem-Edit-Paste",children:Z(tt,{id:"paste"})}),Z(ve,{}),Jt(In,{label:`${t.formatMessage({id:"copy.as"})}...`,size:"small",id:"TD-MenuItem-Copy-As",children:[Z(ce,{onClick:v,id:"TD-MenuItem-Copy-as-SVG",children:"SVG"}),Z(ce,{onClick:b,id:"TD-MenuItem-Copy-As-PNG",children:"PNG"}),Z(ce,{onClick:k,id:"TD-MenuItem-Copy_as_JSON",children:"JSON"})]}),Z(ve,{}),Z(ce,{onSelect:ke,onClick:L,kbd:"#A",id:"TD-MenuItem-Select_All",children:Z(tt,{id:"select.all"})}),Z(ce,{onSelect:ke,disabled:!ee,onClick:A,id:"TD-MenuItem-Select_None",children:Z(tt,{id:"select.none"})}),Z(ve,{}),Z(ce,{onSelect:f,disabled:!ee,kbd:"\u232B",id:"TD-MenuItem-Delete",children:Z(tt,{id:"delete"})})]}),Jt(In,{label:t.formatMessage({id:"menu.view"}),id:"TD-MenuItem-Edit",children:[Z(ce,{onSelect:ke,onClick:e.zoomIn,kbd:"#+",id:"TD-MenuItem-View-ZoomIn",children:Z(tt,{id:"zoom.in"})}),Z(ce,{onSelect:ke,onClick:e.zoomOut,kbd:"#-",id:"TD-MenuItem-View-ZoomOut",children:Z(tt,{id:"zoom.out"})}),Jt(ce,{onSelect:ke,onClick:re,kbd:"\u21E7+0",id:"TD-MenuItem-View-ZoomTo100",children:[Z(tt,{id:"zoom.to"})," 100%"]}),Z(ce,{onSelect:ke,onClick:e.zoomToFit,kbd:"\u21E7+1",id:"TD-MenuItem-View-ZoomToFit",children:Z(tt,{id:"zoom.to.fit"})}),Z(ce,{onSelect:ke,onClick:e.zoomToSelection,kbd:"\u21E7+2",id:"TD-MenuItem-View-ZoomToSelection",children:Z(tt,{id:"zoom.to.selection"})})]}),Z(ve,{}),Z(Cp,{})]})]}),Z(Md,{isOpen:n,onClose:()=>r(!1)})]})});import*as Mp from"@radix-ui/react-dropdown-menu";import{CheckIcon as Ep,ClipboardIcon as Bp}from"@radix-ui/react-icons";import*as Kn from"react";import{FormattedMessage as os}from"react-intl";import{Utils as Ga}from"telva-core";import{jsx as Rp}from"react/jsx-runtime";function Dp(){return Rp("svg",{width:"15",height:"15",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:Rp("path",{d:"M1.36482 4.71089C1.36482 3.21371 2.57853 2 4.07572 2C5.5729 2 6.78661 3.21371 6.78661 4.71089C6.78661 5.76842 6.18106 6.68452 5.29779 7.13136C5.80465 7.24611 6.26407 7.44186 6.66028 7.73182C7.18674 8.11711 7.57215 8.64722 7.81073 9.30983C7.81452 9.30606 7.81832 9.3023 7.82212 9.29855C8.30448 8.82317 8.91325 8.52463 9.60905 8.37275C8.68812 7.922 8.05394 6.97569 8.05394 5.88126C8.05394 4.35017 9.29513 3.10898 10.8262 3.10898C12.3573 3.10898 13.5985 4.35017 13.5985 5.88126C13.5985 6.97561 12.9644 7.92186 12.0436 8.37265C12.7396 8.52449 13.3486 8.82306 13.831 9.29854C14.5795 10.0361 14.9481 11.1249 14.9481 12.5176C14.9481 12.7799 14.7354 12.9926 14.473 12.9926C14.2107 12.9926 13.9981 12.7799 13.9981 12.5175C13.9981 11.2848 13.6738 10.4774 13.1642 9.97518C12.6532 9.4716 11.8802 9.20024 10.8266 9.20024C9.77294 9.20024 8.99993 9.4716 8.48896 9.97518C7.97939 10.4774 7.65513 11.2848 7.65513 12.5176C7.65513 12.7799 7.44247 12.9926 7.18013 12.9926C6.9178 12.9926 6.70513 12.7799 6.70513 12.5176C6.70513 11.6734 6.84053 10.941 7.11384 10.3307C7.0922 10.2895 7.0763 10.2444 7.06737 10.1962C6.91739 9.38749 6.57392 8.84586 6.09923 8.49845C5.61626 8.14499 4.94481 7.95427 4.07574 7.95427C3.05232 7.95427 2.30368 8.21784 1.80952 8.70485C1.31675 9.19047 1.00176 9.97257 1.00176 11.1702C1.00176 11.4326 0.789093 11.6452 0.526758 11.6452C0.264423 11.6452 0.0517578 11.4326 0.0517578 11.1702C0.0517578 9.81263 0.411052 8.74925 1.14268 8.02821C1.60624 7.57137 2.18892 7.28191 2.85378 7.13142C1.97043 6.68461 1.36482 5.76848 1.36482 4.71089ZM4.07572 2.95C3.1032 2.95 2.31482 3.73838 2.31482 4.71089C2.31482 5.68341 3.1032 6.47178 4.07572 6.47178C5.04823 6.47178 5.83661 5.68341 5.83661 4.71089C5.83661 3.73838 5.04823 2.95 4.07572 2.95ZM10.8262 4.05898C9.8198 4.05898 9.00394 4.87484 9.00394 5.88126C9.00394 6.88768 9.8198 7.70355 10.8262 7.70355C11.8326 7.70355 12.6485 6.88768 12.6485 5.88126C12.6485 4.87484 11.8326 4.05898 10.8262 4.05898Z"})})}import{jsx as St,jsxs as rs}from"react/jsx-runtime";var Rb=i=>i.room,Lp=function(){let o=N(),e=o.useStore(Rb),[t,n]=Kn.useState(!1),r=Kn.useRef(0),s=Kn.useCallback(()=>{n(!0),B.copyStringToClipboard(window.location.href),clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1200)},[]),l=Kn.useCallback(()=>{n(!0);let p=window.location.href.split("/");p[p.length-2]="v",p[p.length-1]=Ga.lns(p[p.length-1]),B.copyStringToClipboard(p.join("/")),clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1200)},[]),a=Kn.useCallback(()=>z(this,null,function*(){o.isDirty?o.fileSystemHandle?window.confirm("Do you want to save changes to your current project?")&&(yield o.saveProject()):window.confirm("Do you want to save your current project?")&&(yield o.saveProject()):o.fileSystemHandle||window.confirm("Do you want to save your current project?")&&(yield o.saveProject())}),[]),c=Kn.useCallback(()=>z(this,null,function*(){var u,h;let p=Ga.deepClone(o.document);o.setIsLoading(!0);try{if(o.callbacks.onAssetUpload)for(let f in p.assets){let v=p.assets[f];if(v.src.includes("base64")){let b=Db(v.src,((u=v.fileName)!=null?u:v.type==="video")?"image.png":"image.mp4"),T=yield o.callbacks.onAssetUpload(o,b,f);T?v.src=T:v.src=""}}let g=yield fetch("/api/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({roomId:Ga.uniqueId(),pageId:o.currentPageId,document:p})}),m=yield g.json();g.ok&&(m==null?void 0:m.url)?window.location.href=m.url:B.warn((h=m==null?void 0:m.message)!=null?h:g.statusText)}catch(g){B.warn(g.message)}o.setIsLoading(!1)}),[]);return rs(Mp.Root,{dir:"ltr",children:[St(ns,{id:"TD-MultiplayerMenuIcon",isActive:!!e,children:St(Dp,{})}),rs(wn,{variant:"menu",id:"TD-MultiplayerMenu",side:"bottom",align:"start",sideOffset:4,children:[rs(ce,{id:"TD-Multiplayer-CopyInviteLink",onClick:s,disabled:!e,children:[St(os,{id:"copy.invite.link"}),St(Rt,{children:t?St(Ep,{}):St(Bp,{})})]}),rs(ce,{id:"TD-Multiplayer-CopyReadOnlyLink",onClick:l,disabled:!e,children:[St(os,{id:"copy.readonly.link"}),St(Rt,{children:t?St(Ep,{}):St(Bp,{})})]}),St(ve,{}),St(ce,{id:"TD-Multiplayer-CreateMultiplayerProject",onClick:a,children:St("a",{href:`${window.location.origin}/r`,children:St(os,{id:"create.multiplayer.project"})})}),St(ce,{id:"TD-Multiplayer-CopyToMultiplayerProject",onClick:c,children:St(os,{id:"copy.multiplayer.project"})})]})]})};function Db(i,o){var l,a;let e=i.split(","),t=(a=(l=e[0])==null?void 0:l.match(/:(.*?);/))==null?void 0:a[1],n=window.atob(e[1]),r=n.length,s=new Uint8Array(r);for(;r--;)s[r]=n.charCodeAt(r);return new File([s],o,{type:t})}import*as Qt from"@radix-ui/react-dropdown-menu";import{CheckIcon as Hb,PlusIcon as zb}from"@radix-ui/react-icons";import*as yt from"react";import{FormattedMessage as Fb,useIntl as zp}from"react-intl";import*as Lt from"@radix-ui/react-alert-dialog";import{MixerVerticalIcon as Eb,Pencil1Icon as Bb}from"@radix-ui/react-icons";import*as at from"react";import{FormattedMessage as ja,useIntl as Mb}from"react-intl";var Ap=P("button",{position:"relative",height:"32px",width:"32px",backgroundColor:"$panel",borderRadius:"4px",padding:"0",margin:"0",outline:"none",border:"none",pointerEvents:"all",fontSize:"$0",color:"$text",cursor:"pointer",display:"grid",alignItems:"center",justifyContent:"center","& > *":{gridRow:1,gridColumn:1},"&:disabled":{opacity:"0.5"},"& > span":{width:"100%",height:"100%",display:"flex",alignItems:"center"},variants:{bp:{mobile:{backgroundColor:"transparent"},small:{"&:hover:not(:disabled)":{backgroundColor:"$hover"}}},size:{small:{height:32,width:32,"& svg:nth-of-type(1)":{height:"16px",width:"16px"}},medium:{height:44,width:44,"& svg:nth-of-type(1)":{height:"18px",width:"18px"}},large:{height:44,width:44,"& svg:nth-of-type(1)":{height:"20px",width:"20px"}}},isActive:{true:{color:"$selected"}}}});import{jsx as nt,jsxs as Wa}from"react/jsx-runtime";var Lb=i=>Object.keys(i.document.pages).length>1;function Hp({page:i,onOpen:o,onClose:e}){let t=N(),n=Mb(),[r,s]=at.useState(!1),[l,a]=at.useState(i.name||"Page"),c=t.useStore(Lb),p=at.useRef(null),u=at.useCallback(()=>{s(!1)},[]),h=at.useCallback(()=>{t.duplicatePage(i.id)},[t]),g=at.useCallback(()=>{window.confirm("Are you sure you want to delete this page?")&&t.deletePage(i.id)},[t]),m=at.useCallback(k=>{if(s(k),k){o==null||o();return}},[t]);function f(k){k.stopPropagation()}let v=at.useRef(i.name||"Page"),b=at.useRef(v.current),T=at.useCallback(k=>{let R=k.target.value.trimStart();b.current=R,a(R)},[]),y=at.useCallback(k=>{switch(k.key){case"Enter":{b.current===v.current||(v.current=b.current,t.renamePage(i.id,b.current.trim())),s(!1);break}case"Escape":{if(b.current===v.current){s(!1);return}b.current=v.current,a(v.current),requestAnimationFrame(()=>{let R=p.current;R&&(R.focus(),R.setSelectionRange(0,R.value.length))});break}}},[]),x=at.useRef(!1);at.useEffect(()=>(r?(x.current=!0,v.current=i.name||"Page",b.current=v.current,requestAnimationFrame(()=>{let k=p.current;k&&(k.focus(),k.setSelectionRange(0,k.value.length))})):x.current&&(e==null||e()),()=>{b.current!==v.current&&(v.current=b.current,t.renamePage(i.id,b.current))}),[r]);let I=rn();return Wa(Lt.Root,{open:r,onOpenChange:m,children:[nt(Lt.Trigger,{asChild:!0,"data-shy":"true",children:nt(Ap,{bp:nn,children:nt(Rt,{children:nt(Eb,{})})})}),Wa(Lt.Portal,{container:I.current,children:[nt(Vb,{onPointerDown:u}),Wa(Ab,{dir:"ltr",onKeyDown:f,onKeyUp:f,children:[nt(mi,{ref:p,placeholder:n.formatMessage({id:"page.name"}),value:l,onChange:T,onKeyDown:y,icon:nt(Bb,{})}),nt(ve,{}),nt(Vp,{onSelect:h,children:nt(ja,{id:"duplicate"})}),nt(Vp,{disabled:!c,onSelect:g,children:nt(ja,{id:"delete"})}),nt(ve,{}),nt(Lt.Cancel,{asChild:!0,children:nt(Je,{children:nt(ja,{id:"cancel"})})})]})]})]})}var Ab=P(Lt.Content,{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",minWidth:240,maxWidth:"fit-content",maxHeight:"85vh",marginTop:"-5vh",pointerEvents:"all",backgroundColor:"$panel",padding:"$1",borderRadius:"$2",font:"$ui",zIndex:999999,"&:focus":{outline:"none"}}),Vb=P(Lt.Overlay,{backgroundColor:"rgba(0, 0, 0, .15)",position:"absolute",pointerEvents:"all",inset:0,zIndex:999998});function Vp(e){var t=e,{onSelect:i}=t,o=Be(t,["onSelect"]);return nt(Lt.Action,{asChild:!0,onClick:i,onSelect:i,children:nt(Je,S({},o))})}import{Fragment as Ub,jsx as lt,jsxs as Or}from"react/jsx-runtime";var Ob=i=>Object.values(i.document.pages).sort((o,e)=>(o.childIndex||0)-(e.childIndex||0)),$b=i=>i.document.pages[i.appState.currentPageId].name,Gb=i=>i.document.pages[i.appState.currentPageId].id;function Fp(){let i=N(),o=zp(),e=yt.useRef(!1),[t,n]=yt.useState(!1);yt.useEffect(()=>{e.current!==t&&(e.current=t)},[t]);let r=yt.useCallback(()=>{n(!1)},[n]),s=yt.useCallback(a=>{e.current!==a&&n(a)},[n]),l=i.useStore($b);return Or(Qt.Root,{dir:"ltr",open:t,onOpenChange:s,children:[lt(Qt.Trigger,{dir:"ltr",asChild:!0,id:"TD-Page",children:lt(Tt,{variant:"text",children:l||o.formatMessage({id:"page"})})}),lt(wn,{variant:"menu",align:"start",sideOffset:4,children:t&&lt(jb,{onClose:r})})]})}function jb({onClose:i}){let o=N(),e=zp(),t=o.useStore(Ob),n=o.useStore(Gb),r=e.formatMessage({id:"page"}),s=yt.useCallback(()=>{let f=r+" "+(Object.keys(o.document.pages).length+1);o.createPage(void 0,f)},[o]),l=yt.useCallback(f=>{i(),o.changePage(f)},[o]),[a,c]=yt.useState(null),[p,u]=yt.useState(null),h=yt.useCallback(f=>{c(f.currentTarget.id),u(t.findIndex(v=>v.id===f.currentTarget.id)),f.dataTransfer.effectAllowed="move"},[]),g=yt.useCallback(f=>{f.preventDefault();let v=t.findIndex(y=>y.id===f.currentTarget.id),b=f.currentTarget.getBoundingClientRect();v=(f.clientY-b.top)/b.height<.5?v:v+1,u(v)},[a,t]),m=yt.useCallback(()=>{a!==null&&p!==null&&o.movePage(a,p),c(null),u(null)},[a,p]);return Or(Ub,{children:[lt(Qt.RadioGroup,{dir:"ltr",value:n,onValueChange:l,children:t.map((f,v)=>Or(Wb,{isDropAbove:v===p&&v===0,isDropBelow:p!==null&&v===p-1,children:[lt(Qt.RadioItem,{title:f.name||r,value:f.id,id:f.id,asChild:!0,onDragOver:g,onDragStart:h,onDrop:m,draggable:!0,children:Or(Nb,{children:[lt("span",{id:f.id,children:f.name||r}),lt(Qt.ItemIndicator,{children:lt(Rt,{children:lt(Hb,{})})})]})},f.id),lt(Hp,{page:f,onClose:i})]},f.id))}),lt(ve,{}),lt(Qt.Item,{onSelect:s,asChild:!0,children:Or(Je,{children:[lt("span",{children:lt(Fb,{id:"create.page"})}),lt(Rt,{children:lt(zb,{})})]})})]})}var Wb=P("div",{position:"relative",display:"grid",gridTemplateColumns:"1fr auto",gridAutoFlow:"column",margin:0,'& > *[data-shy="true"]':{opacity:0},'&:hover > *[data-shy="true"]':{opacity:1},variants:{isDropAbove:{true:{"&::after":{content:"",display:"block",position:"absolute",top:0,width:"100%",height:"1px",backgroundColor:"$selected",zIndex:999,pointerEvents:"none"}}},isDropBelow:{true:{"&::after":{content:"",display:"block",position:"absolute",width:"100%",height:"1px",top:"100%",backgroundColor:"$selected",zIndex:999,pointerEvents:"none"}}}}}),Nb=P(Je,{minWidth:128});import*as uo from"@radix-ui/react-dropdown-menu";import{TextAlignCenterIcon as Kb,TextAlignJustifyIcon as _b,TextAlignLeftIcon as Yb,TextAlignRightIcon as Xb}from"@radix-ui/react-icons";import*as bt from"react";import{FormattedMessage as po,useIntl as Zb}from"react-intl";import{Fragment as lv,jsx as le,jsxs as Pn}from"react/jsx-runtime";var qb=i=>i.appState.currentStyle,Jb=i=>i.document.pageStates[i.appState.currentPageId].selectedIds,Qb=Object.keys(Oo),Op={["draw"]:le(gl,{}),["solid"]:le(Sl,{}),["dashed"]:le(pl,{}),["dotted"]:le(hl,{})},ev={["small"]:le(vl,{}),["medium"]:le(xl,{}),["large"]:le(Cl,{})},tv={["start"]:le(Yb,{}),["middle"]:le(Kb,{}),["end"]:le(Xb,{}),["justify"]:le(_b,{})},nv=i=>i.settings.isDarkMode?"dark":"light",ov=i=>i.settings.keepStyleMenuOpen,rv=i=>{let{activeTool:o,currentPageId:e}=i.appState;switch(o){case"select":{let t=i.document.pages[e],n=!1,r=!1;for(let s of i.document.pageStates[e].selectedIds)"text"in t.shapes[s]&&(n=!0),"label"in t.shapes[s]&&(r=!0);return n?"text":r?"label":""}case"text":return"text";case"rectangle":return"label";case"ellipse":return"label";case"triangle":return"label";case"arrow":return"label";case"line":return"label"}return!1},$p=bt.memo(function(){let o=N(),e=Zb(),t=o.useStore(nv),n=o.useStore(ov),r=o.useStore(rv),s=o.useStore(qb),l=o.useStore(Jb),[a,c]=bt.useState(s),p=bt.useRef(s);bt.useEffect(()=>{let{appState:{currentStyle:T},page:y,selectedIds:x}=o,I={};if(x.length<=0)I=T;else{let k=new Set([]);o.selectedIds.map(R=>y.shapes[R]).forEach(R=>{Qb.forEach(C=>{if(!k.has(C))if(I[C]===void 0)I[C]=R.style[C];else{if(I[C]===R.style[C])return;I[C]=R.style[C],k.add(C)}})})}JSON.stringify(I)!==JSON.stringify(p.current)&&(p.current=I,c(I))},[s,l]);let u=bt.useCallback(T=>{o.setSetting("keepStyleMenuOpen",T)},[]),h=bt.useCallback(T=>{o.style({isFilled:T})},[]),g=bt.useCallback(T=>{o.style({dash:T})},[]),m=bt.useCallback(T=>{o.style({size:T})},[]),f=bt.useCallback(T=>{o.style({font:T})},[]),v=bt.useCallback(T=>{o.style({textAlign:T})},[]),b=bt.useCallback(T=>{o.setMenuOpen(T)},[o]);return Pn(uo.Root,{dir:"ltr",onOpenChange:b,open:n?!0:void 0,modal:!1,children:[le(uo.Trigger,{asChild:!0,id:"TD-Styles",children:Pn(Tt,{"aria-label":e.formatMessage({id:"styles"}),variant:"text",children:[le(po,{id:"styles"}),Pn(sv,{style:{color:zn[t][a.color]},children:[a.isFilled&&le(Ds,{size:16,stroke:"none",fill:yo[t][a.color]}),Op[a.dash]]})]})}),Pn(wn,{id:"TD-StylesMenu",side:"bottom",align:"end",sideOffset:4,alignOffset:4,children:[Pn($r,{variant:"tall",id:"TD-Styles-Color-Container",children:[le("span",{children:le(po,{id:"style.menu.color"})}),le(iv,{children:Object.keys(zn.light).map(T=>le(uo.Item,{onSelect:ke,asChild:!0,id:`TD-Styles-Color-Swatch-${T}`,children:le(Tt,{variant:"icon",isActive:a.color===T,onClick:()=>o.style({color:T}),"aria-label":e.formatMessage({id:T}),children:le(Ds,{size:18,strokeWidth:2.5,fill:a.isFilled?yo[t][T]:"transparent",stroke:zn.light[T]})})},T))})]}),le(qt,{variant:"styleMenu",checked:!!a.isFilled,onCheckedChange:h,id:"TD-Styles-Fill",children:le(po,{id:"style.menu.fill"})}),Pn($r,{id:"TD-Styles-Dash-Container",children:[le(po,{id:"style.menu.dash"}),le(is,{dir:"ltr",value:a.dash,onValueChange:g,children:Object.values(on).map(T=>le(Fr,{isActive:T===a.dash,value:T,onSelect:ke,bp:nn,id:`TD-Styles-Dash-${T}`,"aria-label":e.formatMessage({id:T}),children:Op[T]},T))})]}),Pn($r,{id:"TD-Styles-Size-Container",children:[le(po,{id:"style.menu.size"}),le(is,{dir:"ltr",value:a.size,onValueChange:m,children:Object.values(ii).map(T=>le(Fr,{isActive:T===a.size,value:T,onSelect:ke,bp:nn,id:`TD-Styles-Dash-${T}`,"aria-label":e.formatMessage({id:T}),children:ev[T]},T))})]}),(r==="text"||r==="label")&&Pn(lv,{children:[le(ve,{}),Pn($r,{id:"TD-Styles-Font-Container",children:[le(po,{id:"style.menu.font"}),le(is,{dir:"ltr",value:a.font,onValueChange:f,children:Object.values(Bo).map(T=>le(Fr,{isActive:T===a.font,value:T,onSelect:ke,bp:nn,id:`TD-Styles-Font-${T}`,children:le(av,{fontStyle:T,children:"Aa"})},T))})]}),r==="text"&&Pn($r,{id:"TD-Styles-Align-Container",children:[le(po,{id:"style.menu.align"}),le(is,{dir:"ltr",value:a.textAlign,onValueChange:v,children:Object.values(Ht).map(T=>le(Fr,{isActive:T===a.textAlign,value:T,onSelect:ke,bp:nn,id:`TD-Styles-Align-${T}`,children:tv[T]},T))})]})]}),le(ve,{}),le(qt,{variant:"styleMenu",checked:n,onCheckedChange:u,id:"TD-Styles-Keep-Open",children:le(po,{id:"style.menu.keep.open"})})]})]})}),iv=P("div",{display:"grid",gridTemplateColumns:"repeat(4, auto)",gap:0}),$r=P("div",{position:"relative",width:"100%",background:"none",border:"none",cursor:"pointer",minHeight:"32px",outline:"none",color:"$text",fontFamily:"$ui",fontWeight:400,fontSize:"$1",padding:"$2 0 $2 $3",borderRadius:4,userSelect:"none",WebkitUserSelect:"none",margin:0,display:"flex",gap:"$3",flexDirection:"row",alignItems:"center",justifyContent:"space-between",variants:{variant:{tall:{alignItems:"flex-start",padding:"0 0 0 $3","& > span":{paddingTop:"$4"}}}}}),is=P(uo.DropdownMenuRadioGroup,{display:"flex",flexDirection:"row",gap:"$1"}),sv=P("div",{display:"grid","& > *":{gridColumn:1,gridRow:1}}),av=P("div",{width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"$3",variants:{fontStyle:{["script"]:{fontFamily:"Caveat Brush"},["sans"]:{fontFamily:"Recursive"},["serif"]:{fontFamily:"Georgia"},["mono"]:{fontFamily:"Recursive Mono"}}}});import*as as from"@radix-ui/react-dropdown-menu";import{FormattedMessage as Gr}from"react-intl";import{jsx as Rn,jsxs as ss}from"react/jsx-runtime";var dv=i=>i.document.pageStates[i.appState.currentPageId].camera.zoom,Gp=function(){let o=N(),e=o.useStore(dv);return ss(as.Root,{dir:"ltr",children:[Rn(as.Trigger,{dir:"ltr",asChild:!0,id:"TD-Zoom",children:ss(cv,{onDoubleClick:o.resetZoom,variant:"text",children:[Math.round(e*100),"%"]})}),ss(wn,{align:"end",children:[Rn(ce,{onSelect:ke,onClick:o.zoomIn,kbd:"#+",id:"TD-Zoom-Zoom_In",children:Rn(Gr,{id:"zoom.in"})}),Rn(ce,{onSelect:ke,onClick:o.zoomOut,kbd:"#\u2212",id:"TD-Zoom-Zoom_Out",children:Rn(Gr,{id:"zoom.out"})}),ss(ce,{onSelect:ke,onClick:o.resetZoom,kbd:"\u21E70",id:"TD-Zoom-Zoom_To_100%",children:[Rn(Gr,{id:"zoom.to"})," 100%"]}),Rn(ce,{onSelect:ke,onClick:o.zoomToFit,kbd:"\u21E71",id:"TD-Zoom-To_Fit",children:Rn(Gr,{id:"zoom.to.fit"})}),Rn(ce,{onSelect:ke,onClick:o.zoomToSelection,kbd:"\u21E72",id:"TD-Zoom-To_Selection",children:Rn(Gr,{id:"zoom.to.selection"})})]})]})},cv=P(Tt,{minWidth:56});import{Fragment as fv,jsx as hn,jsxs as ls}from"react/jsx-runtime";function uv({readOnly:i,showPages:o,showMenu:e,showStyles:t,showZoom:n,showMultiplayerMenu:r}){let s=N(),l=pv();return ls(hv,{children:[(e||o)&&ls(mr,{side:"left",id:"TD-MenuPanel",children:[e&&hn(Pp,{readOnly:i}),r&&hn(Lp,{}),o&&hn(Fp,{})]}),hn(mv,{}),(t||n)&&ls(mr,{side:"right",children:[s.readOnly?hn(gv,{children:"Read Only"}):ls(fv,{children:[hn($s,{kbd:"#Z",label:l.formatMessage({id:"undo"}),onClick:s.undo,id:"TD-TopPanel-Undo","aria-label":l.formatMessage({id:"undo"}),children:hn(Es,{})}),hn($s,{kbd:"#\u21E7Z",label:l.formatMessage({id:"redo"}),onClick:s.redo,id:"TD-TopPanel-Redo","aria-label":l.formatMessage({id:"redo"}),children:hn(Es,{flipHorizontal:!0})})]}),n&&hn(Gp,{}),t&&!i&&hn($p,{})]})]})}var hv=P("div",{width:"100%",position:"absolute",top:0,left:0,right:0,display:"flex",flexDirection:"row",pointerEvents:"none","& > *":{pointerEvents:"all"}}),mv=P("div",{flexGrow:2,pointerEvents:"none"}),gv=P("div",{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"$ui",fontSize:"$1",paddingLeft:"$4",paddingRight:"$1",userSelect:"none",WebkitUserSelect:"none"}),Wp=jp.memo(uv);import Sv from"react";function Np(i){Sv.useEffect(()=>{let o=!1,e=!1,t=i.current;if(!t)return;let n=a=>{a.key===" "&&!e&&(e=!0,o?t.setAttribute("style","cursor: grabbing !important"):t.setAttribute("style","cursor: grab !important"))},r=a=>{a.key===" "&&(e=!1,t.setAttribute("style","cursor: initial"))},s=a=>{o=!0,a.button===1&&t.setAttribute("style","cursor: grabbing !important"),a.button===0&&e&&t.setAttribute("style","cursor: grabbing !important")},l=()=>{o=!1,e?t.setAttribute("style","cursor: grab !important"):t.setAttribute("style","cursor: initial")};return t.addEventListener("keydown",n),t.addEventListener("keyup",r),t.addEventListener("pointerdown",s),t.addEventListener("pointerup",l),()=>{t.removeEventListener("keydown",n),t.removeEventListener("keyup",r),t.removeEventListener("pointerdown",s),t.removeEventListener("pointerup",l)}},[i.current])}import{Utils as dt}from"telva-core";import{Vec as se}from"telva-vec";import{del as d5,get as yv,set as bv}from"idb-keyval";var Up="telva_clipboard";function Kp(){return z(this,null,function*(){return yv(Up)})}function _p(i){return z(this,null,function*(){return bv(Up,i)})}import*as Io from"idb-keyval";import{Utils as vv}from"telva-core";import Tv from"zustand";import xv from"zustand/vanilla";var ds=class{constructor(o,e,t,n){d(this,"_idbId");d(this,"initialState");d(this,"store");d(this,"pointer",-1);d(this,"_state");d(this,"_status","loading");d(this,"stack",[]);d(this,"_snapshot");d(this,"useStore");d(this,"ready");d(this,"isPaused",!1);d(this,"persist",(o,e)=>{if(this._status==="ready"&&(this.onPersist&&this.onPersist(this._state,o,e),this._idbId))return Io.set(this._idbId,this._state).catch(t=>console.error(t))});d(this,"applyPatch",(o,e)=>{let t=this._state,n=vv.deepMerge(this._state,o),r=this.cleanup(n,t,o,e);return this.onStateWillChange&&this.onStateWillChange(r,e),this._state=r,this.store.setState(this._state,!0),this.onStateDidChange&&this.onStateDidChange(this._state,e),this});d(this,"migrate",o=>o);d(this,"cleanup",(o,e,t,n)=>o);d(this,"onStateWillChange");d(this,"onStateDidChange");d(this,"patchState",(o,e)=>(this.applyPatch(o,e),this.onPatch&&this.onPatch(this._state,o,e),this));d(this,"replaceState",(o,e)=>{let t=this.cleanup(o,this._state,o,e);return this.onStateWillChange&&this.onStateWillChange(t,"replace"),this._state=t,this.store.setState(this._state,!0),this.onStateDidChange&&this.onStateDidChange(this._state,"replace"),this});d(this,"setState",(o,e=o.id)=>(this.pointer<this.stack.length-1&&(this.stack=this.stack.slice(0,this.pointer+1)),this.stack.push(w(S({},o),{id:e})),this.pointer=this.stack.length-1,this.applyPatch(o.after,e),this.onCommand&&this.onCommand(this._state,o,e),this.persist(o.after,e),this));d(this,"onReady");d(this,"onPatch");d(this,"onCommand");d(this,"onPersist");d(this,"onReplace");d(this,"onReset");d(this,"onResetHistory");d(this,"onUndo");d(this,"onRedo");d(this,"reset",()=>(this.onStateWillChange&&this.onStateWillChange(this.initialState,"reset"),this._state=this.initialState,this.store.setState(this._state,!0),this.resetHistory(),this.persist({},"reset"),this.onStateDidChange&&this.onStateDidChange(this._state,"reset"),this.onReset&&this.onReset(this._state),this));d(this,"replaceHistory",(o,e=o.length-1)=>(this.stack=o,this.pointer=e,this.onReplace&&this.onReplace(this._state),this));d(this,"resetHistory",()=>(this.stack=[],this.pointer=-1,this.onResetHistory&&this.onResetHistory(this._state),this));d(this,"undo",()=>{if(!this.isPaused){if(!this.canUndo)return this;let o=this.stack[this.pointer];this.pointer--,this.applyPatch(o.before,"undo"),this.persist(o.before,"undo")}return this.onUndo&&this.onUndo(this._state),this});d(this,"redo",()=>{if(!this.isPaused){if(!this.canRedo)return this;this.pointer++;let o=this.stack[this.pointer];this.applyPatch(o.after,"redo"),this.persist(o.after,"undo")}return this.onRedo&&this.onRedo(this._state),this});d(this,"setSnapshot",()=>(this._snapshot=S({},this._state),this));d(this,"forceUpdate",()=>{this.store.setState(this._state,!0)});this._idbId=e,this._state=rt(o),this._snapshot=rt(o),this.initialState=rt(o),this.store=xv(()=>this._state),this.useStore=Tv(this.store),this.ready=new Promise(r=>{let s="none";this._idbId?(s="restored",Io.get(this._idbId).then(l=>z(this,null,function*(){if(l){let a=l;if(t){let p=yield Io.get(e+"_version");p&&p<t&&(a=n?n(l,o,p):o,s="migrated")}yield Io.set(e+"_version",t||-1);let c=this._state.appState.isEmptyCanvas;a=this.migrate(a),this._state=rt(a),this._snapshot=rt(a),this._state.appState.isEmptyCanvas=c,this.store.setState(this._state,!0)}else yield Io.set(e+"_version",t||-1);this._status="ready",r(s)})).catch(l=>console.error(l))):(this._status="ready",r(s))}).then(r=>(this.onReady&&this.onReady(r),r))}pause(){this.isPaused=!0}resume(){this.isPaused=!1}get canUndo(){return this.pointer>-1}get canRedo(){return this.pointer<this.stack.length-1}get state(){return this._state}get status(){return this._status}get snapshot(){return this._snapshot}};import{Utils as kv}from"telva-core";import{Vec as Yp}from"telva-vec";function Xp(i,o,e){let{currentPageId:t}=i,n=o.map(h=>i.getShape(h)),r=n.map(h=>({id:h.id,point:[...h.point],bounds:B.getBounds(h)})),s=kv.getCommonBounds(r.map(({bounds:h})=>h)),l=s.minX+s.width/2,a=s.minY+s.height/2,c=Object.fromEntries(r.map(({id:h,point:g,bounds:m})=>[h,{prev:g,next:{["top"]:[g[0],s.minY],["centerVertical"]:[g[0],a-m.height/2],["bottom"]:[g[0],s.maxY-m.height],["left"]:[s.minX,g[1]],["centerHorizontal"]:[l-m.width/2,g[1]],["right"]:[s.maxX-m.width,g[1]]}[e]}])),{before:p,after:u}=B.mutateShapes(i.state,o,h=>c[h.id]?{point:c[h.id].next}:h,t,!1);return n.forEach(h=>{if(h.type==="group"){let g=Yp.sub(u[h.id].point,p[h.id].point);h.children.forEach(m=>{let f=i.getShape(m);p[f.id]={point:f.point},u[f.id]={point:Yp.add(f.point,g)}}),delete p[h.id],delete u[h.id]}}),{id:"align",before:{document:{pages:{[t]:{shapes:p}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:u}},pageStates:{[t]:{selectedIds:o}}}}}}function Zp(i,o){return{id:"change_page",before:{appState:{currentPageId:i.currentPageId}},after:{appState:{currentPageId:o}}}}import{Utils as Cv}from"telva-core";function qp(i,o){var n;let e=i,t=new Set(o);for(;t.has(e);)e=(n=/^.*(\d+)$/.exec(e))!=null&&n[1]?e.replace(/(\d+)(?=\D?)$/,r=>(+r+1).toString()):`${e} 1`;return e}function Jp(i,o,e){let t={shapes:{},bindings:{}},n={shapes:{},bindings:{}},r=[],s=new Set,l=new Set;o.filter(c=>!B.getShape(i,c,e).isLocked).forEach(c=>{s.add(c);let p=B.getShape(i,c,e);t.shapes[c]=p,n.shapes[c]=void 0,p.children!==void 0&&p.children.forEach(u=>{s.add(u);let h=B.getShape(i,u,e);t.shapes[u]=h,n.shapes[u]=void 0}),p.parentId!==e&&r.push(B.getShape(i,p.parentId,e)),p.assetId&&l.add(p.assetId)}),r.forEach(c=>{var p;o.includes(c.id)||(s.add(c.id),t.shapes[c.id]={children:c.children},n.shapes[c.id]={children:c.children.filter(u=>!o.includes(u))},((p=n.shapes[c.id])==null?void 0:p.children.length)===0&&(n.shapes[c.id]=void 0,t.shapes[c.id]=B.getShape(i,c.id,e)))});let a=B.getPage(i,e);return Object.values(a.bindings).filter(c=>s.has(c.fromId)||s.has(c.toId)).forEach(c=>{for(let p of[c.toId,c.fromId])if(n.shapes[p]===void 0){t.bindings[c.id]=c,n.bindings[c.id]=void 0;let u=a.shapes[p];u&&u.handles&&Object.values(u.handles).filter(h=>h.bindingId===c.id).forEach(h=>{var g,m,f,v,b,T;t.shapes[p]=w(S({},t.shapes[p]),{handles:w(S({},(g=t.shapes[p])==null?void 0:g.handles),{[h.id]:w(S({},(f=(m=t.shapes[p])==null?void 0:m.handles)==null?void 0:f[h.id]),{bindingId:c.id})})}),s.has(p)||(n.shapes[p]=w(S({},n.shapes[p]),{handles:w(S({},(v=n.shapes[p])==null?void 0:v.handles),{[h.id]:w(S({},(T=(b=n.shapes[p])==null?void 0:b.handles)==null?void 0:T[h.id]),{bindingId:void 0})})}))})}}),Object.values(i.document.pages).flatMap(c=>Object.values(c.shapes)).forEach(c=>{"assetId"in c&&c.assetId&&!s.has(c.id)&&l.delete(c.assetId)}),{before:t,after:n,assetsToRemove:Array.from(l)}}function Qp(i,o,e=Cv.uniqueId(),t="Page"){let{currentPageId:n}=i,r=Object.values(i.state.document.pages).sort((p,u)=>{var h,g;return((h=p.childIndex)!=null?h:0)-((g=u.childIndex)!=null?g:0)}),s=r[r.length-1],l=s!=null&&s.childIndex?(s==null?void 0:s.childIndex)+1:1,a={id:e,name:qp(t,r.map(p=>{var u;return(u=p.name)!=null?u:""})),childIndex:l,shapes:{},bindings:{}},c={id:e,selectedIds:[],camera:{point:o,zoom:1},editingId:void 0,bindingId:void 0,hoveredId:void 0,pointedId:void 0};return{id:"create_page",before:{appState:{currentPageId:n},document:{pages:{[e]:void 0},pageStates:{[e]:void 0}}},after:{appState:{currentPageId:a.id},document:{pages:{[e]:a},pageStates:{[e]:c}}}}}function Na(i,o,e=[]){let{currentPageId:t}=i,n={},r={};o.forEach(a=>{n[a.id]=void 0,r[a.id]=a});let s={},l={};return e.forEach(a=>{s[a.id]=void 0,l[a.id]=a}),{id:"create",before:{document:{pages:{[t]:{shapes:n,bindings:s}},pageStates:{[t]:{selectedIds:[...i.selectedIds]}}}},after:{document:{pages:{[t]:{shapes:r,bindings:l}},pageStates:{[t]:{selectedIds:o.map(a=>a.id)}}}}}}function eu(i,o){let{currentPageId:e,document:{pages:t,pageStates:n}}=i,r=Object.values(t).sort((a,c)=>(a.childIndex||0)-(c.childIndex||0)),s=r.findIndex(a=>a.id===o),l;return o===e?s===r.length-1?l=r[r.length-2].id:l=r[s+1].id:l=e,{id:"delete_page",before:{appState:{currentPageId:o},document:{pages:{[o]:S({},t[o])},pageStates:{[o]:S({},n[o])}}},after:{appState:{currentPageId:l},document:{pages:{[o]:void 0},pageStates:{[o]:void 0}}}}}var wv=(i,o)=>{let e=S({},i);return o.forEach(t=>e[t]=void 0),e};function Ua(i,o,e=i.currentPageId){let{pageState:t,selectedIds:n,document:{assets:r}}=i,{before:s,after:l,assetsToRemove:a}=Jp(i.state,o,e),c=wv(r,a);return{id:"delete",before:{document:{assets:r,pages:{[e]:s},pageStates:{[e]:{selectedIds:[...i.selectedIds]}}}},after:{document:{assets:c,pages:{[e]:l},pageStates:{[e]:{selectedIds:n.filter(p=>!o.includes(p)),hoveredId:t.hoveredId&&o.includes(t.hoveredId)?void 0:t.hoveredId}}}}}}import{Utils as Iv}from"telva-core";import tu from"telva-vec";function nu(i,o,e){let{currentPageId:t}=i,n=o.map(a=>i.getShape(a)),r=Object.fromEntries(Pv(n,e).map(a=>[a.id,a])),{before:s,after:l}=B.mutateShapes(i.state,o.filter(a=>r[a]!==void 0),a=>{var c;return{point:(c=r[a.id])==null?void 0:c.next}},t);return n.forEach(a=>{if(a.type==="group"){let c=tu.sub(l[a.id].point,s[a.id].point);a.children.forEach(p=>{let u=i.getShape(p);s[u.id]={point:u.point},l[u.id]={point:tu.add(u.point,c)}}),delete s[a.id],delete l[a.id]}}),{id:"distribute",before:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:l}},pageStates:{[t]:{selectedIds:o}}}}}}function Pv(i,o){let e=i.map(s=>{let l=B.getShapeUtil(s);return{id:s.id,point:[...s.point],bounds:l.getBounds(s),center:l.getCenter(s)}}),t=e.length,n=Iv.getCommonBounds(e.map(({bounds:s})=>s)),r=[];switch(o){case"horizontal":{let s=e.reduce((l,a)=>l+a.bounds.width,0);if(s>n.width){let l=e.sort((h,g)=>h.bounds.minX-g.bounds.minX)[0],a=e.sort((h,g)=>g.bounds.maxX-h.bounds.maxX)[0],c=e.filter(h=>h!==l&&h!==a).sort((h,g)=>h.center[0]-g.center[0]),p=(a.center[0]-l.center[0])/(t-1),u=l.center[0]+p;c.forEach(({id:h,point:g,bounds:m},f)=>{r.push({id:h,prev:g,next:[u+p*f-m.width/2,m.minY]})})}else{let l=e.sort((p,u)=>p.center[0]-u.center[0]),a=n.minX,c=(n.width-s)/(t-1);l.forEach(({id:p,point:u,bounds:h})=>{r.push({id:p,prev:u,next:[a,h.minY]}),a+=h.width+c})}break}case"vertical":{let s=e.reduce((l,a)=>l+a.bounds.height,0);if(s>n.height){let l=e.sort((h,g)=>h.bounds.minY-g.bounds.minY)[0],a=e.sort((h,g)=>g.bounds.maxY-h.bounds.maxY)[0],c=e.filter(h=>h!==l&&h!==a).sort((h,g)=>h.center[1]-g.center[1]),p=(a.center[1]-l.center[1])/(t-1),u=l.center[1]+p;c.forEach(({id:h,point:g,bounds:m},f)=>{r.push({id:h,prev:g,next:[m.minX,u+p*f-m.height/2]})})}else{let l=e.sort((p,u)=>p.center[1]-u.center[1]),a=n.minY,c=(n.height-s)/(t-1);l.forEach(({id:p,point:u,bounds:h})=>{r.push({id:p,prev:u,next:[h.minX,a]}),a+=h.height+c})}break}}return r}import{Utils as jr}from"telva-core";function ou(i,o){let{currentPageId:e,pageState:{camera:t}}=i,n=i.document.pages[o],r=jr.uniqueId(),s=Object.fromEntries([[n.id,r],...Object.keys(n.shapes).map(p=>[p,jr.uniqueId()]),...Object.keys(n.bindings).map(p=>[p,jr.uniqueId()])]),l=Object.fromEntries(Object.entries(n.shapes).map(([p,u])=>[s[p],w(S({},jr.deepClone(u)),{id:s[p],parentId:s[u.parentId]})])),a=Object.fromEntries(Object.entries(n.bindings).map(([p,u])=>[s[p],w(S({},jr.deepClone(u)),{id:s[u.id],fromId:s[u.fromId],toId:s[u.toId]})]));Object.values(n.bindings).forEach(p=>{let u=s[p.fromId],h=l[u].handles;h&&Object.values(h).forEach(f=>{f.bindingId===p.id&&(f.bindingId=s[p.id])});let g=s[p.toId],m=l[g].handles;m&&Object.values(m).forEach(f=>{f.bindingId===p.id&&(f.bindingId=s[p.id])})});let c=w(S({},n),{id:s[n.id],name:n.name+" Copy",shapes:l,bindings:a});return{id:"duplicate_page",before:{appState:{currentPageId:e},document:{pages:{[r]:void 0},pageStates:{[r]:void 0}}},after:{appState:{currentPageId:r},document:{pages:{[r]:c},pageStates:{[r]:w(S({},n),{id:r,selectedIds:[],camera:S({},t),editingId:void 0,bindingId:void 0,hoveredId:void 0,pointedId:void 0})}}}}}import{Utils as ho}from"telva-core";import{Vec as Ka}from"telva-vec";function ru(i,o,e){let{selectedIds:t,currentPageId:n,page:r,shapes:s}=i,l={shapes:{},bindings:{}},a={shapes:{},bindings:{}},c={},p=o.map(g=>i.getShape(g)).filter(g=>!o.includes(g.parentId));p.forEach(g=>{let m=ho.uniqueId();if(l.shapes[m]=void 0,a.shapes[m]=w(S({},ho.deepClone(g)),{id:m,childIndex:B.getChildIndexAbove(i.state,g.id,n)}),g.children&&(a.shapes[m].children=[]),g.parentId!==n){let f=i.getShape(g.parentId);l.shapes[f.id]=w(S({},l.shapes[f.id]),{children:f.children}),a.shapes[f.id]=w(S({},a.shapes[f.id]),{children:[...(a.shapes[f.id]||f).children,m]})}c[g.id]=m}),p.forEach(g=>{g.children&&g.children.forEach(m=>{var T,y;let f=i.getShape(m),v=ho.uniqueId(),b=c[g.id];l.shapes[v]=void 0,a.shapes[v]=w(S({},ho.deepClone(f)),{id:v,parentId:b,childIndex:B.getChildIndexAbove(i.state,f.id,n)}),c[m]=v,(y=(T=a.shapes[c[g.id]])==null?void 0:T.children)==null||y.push(v)})});let u=new Set(Object.keys(c));Object.values(r.bindings).filter(g=>u.has(g.fromId)||u.has(g.toId)).forEach(g=>{if(u.has(g.fromId))if(u.has(g.toId)){let m=ho.uniqueId(),f=w(S({},ho.deepClone(g)),{id:m,fromId:c[g.fromId],toId:c[g.toId]});l.bindings[m]=void 0,a.bindings[m]=f;let v=a.shapes[f.fromId];Object.values(v.handles).forEach(b=>{b.bindingId===g.id&&(b.bindingId=m)})}else{let m=a.shapes[c[g.fromId]];Object.values(m.handles).forEach(f=>{f.bindingId===g.id&&(f.bindingId=void 0)})}});let h=Object.values(a.shapes);if(e){let g=ho.getCommonBounds(h.map(f=>B.getBounds(f))),m=ho.getBoundsCenter(g);h.forEach(f=>{!f.point||(f.point=Ka.sub(e,Ka.sub(m,f.point)))})}else{let g=[16,16];h.forEach(m=>{!m.point||(m.point=Ka.add(m.point,g))})}return h.forEach(g=>{g.isLocked&&(g.isLocked=!1)}),{id:"duplicate",before:{document:{pages:{[n]:l},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:a},pageStates:{[n]:{selectedIds:Array.from(u.values()).map(g=>c[g])}}}}}}import{TLBoundsCorner as cs,Utils as Wr}from"telva-core";function _a(i,o,e){let{selectedIds:t,currentPageId:n,page:{shapes:r}}=i,s=o.map(u=>B.getBounds(r[u])),l=o.length===1&&r[o[0]].type==="group",a=Wr.getCommonBounds(s),{before:c,after:p}=B.mutateShapes(i.state,o,u=>{let h=B.getBounds(u),g=u.parentId!==n;switch(e){case"horizontal":{if(g&&!l){let f=B.getBounds(r[u.parentId]),b=Wr.getRelativeTransformedBoundingBox(a,a,f,!0,!1).minX-f.minX;return B.getShapeUtil(u).transform(u,w(S({},h),{minX:h.minX+b,maxX:h.maxX+b}),{type:cs.TopLeft,scaleX:1,scaleY:1,initialShape:u,transformOrigin:[.5,.5]})}let m=Wr.getRelativeTransformedBoundingBox(a,a,h,!0,!1);return B.getShapeUtil(u).transform(u,m,{type:cs.TopLeft,scaleX:-1,scaleY:1,initialShape:u,transformOrigin:[.5,.5]})}case"vertical":{if(g&&!l){let f=B.getBounds(r[u.parentId]),b=Wr.getRelativeTransformedBoundingBox(a,a,f,!1,!0).minY-f.minY;return B.getShapeUtil(u).transform(u,w(S({},h),{minY:h.minY+b,maxY:h.maxY+b}),{type:cs.TopLeft,scaleX:1,scaleY:1,initialShape:u,transformOrigin:[.5,.5]})}let m=Wr.getRelativeTransformedBoundingBox(a,a,h,!1,!0);return B.getShapeUtil(u).transform(u,m,{type:cs.TopLeft,scaleX:1,scaleY:-1,initialShape:u,transformOrigin:[.5,.5]})}}},n,!0);return{id:"flip",before:{document:{pages:{[n]:{shapes:c}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:p}},pageStates:{[n]:{selectedIds:o}}}}}}import{Utils as Rv}from"telva-core";function iu(i,o,e,t){var x,I;if(o.length<2)return;let n={},r={},s={},l={},a=[...o],c=[],p=[],u=[];for(let k of o){let R=i.getShape(k);if(!R.isLocked)if(R.children===void 0)c.push(R);else{let C=R.children.filter(E=>!i.getShape(E).isLocked);u.push(R),a.push(...C),c.push(...C.map(E=>i.getShape(E)).filter(Boolean))}}if(c.every(k=>k.parentId===c[0].parentId)&&c[0].parentId!==t&&((x=i.getShape(c[0].parentId).children)==null?void 0:x.length)===a.length)return;let h=B.flattenPage(i.state,t),g=Object.fromEntries(c.map(k=>[k.id,h.indexOf(k)])),m=c.sort((k,R)=>g[k.id]-g[R.id]),f=t,v=(m.filter(k=>k.parentId===t)[0]||m[0]).childIndex,b=Rv.getCommonBounds(c.map(k=>B.getBounds(k)));for(n[e]=void 0,r[e]=B.getShapeUtil("group").create({id:e,childIndex:v,parentId:f,point:[b.minX,b.minY],size:[b.width,b.height],children:m.map(k=>k.id)}),m.forEach((k,R)=>{if(k.parentId!==t){let C=i.getShape(k.parentId);u.push(C)}n[k.id]=w(S({},n[k.id]),{parentId:k.parentId,childIndex:k.childIndex}),r[k.id]=w(S({},r[k.id]),{parentId:e,childIndex:R+1})});u.length>0;){let k=u.pop();if(!k)break;let R=(((I=n[k.id])==null?void 0:I.children)||k.children).filter(C=>C&&!(a.includes(C)||p.includes(C)));R.length===0?(n[k.id]=k,r[k.id]=void 0,k.parentId!==t&&(p.push(k.id),u.push(i.getShape(k.parentId)))):(n[k.id]=w(S({},n[k.id]),{children:k.children}),r[k.id]=w(S({},r[k.id]),{children:R}))}let{bindings:T}=i,y=new Set(p);return T.forEach(k=>{for(let R of[k.toId,k.fromId])if(y.has(R)){s[k.id]=k,l[k.id]=void 0;let C=i.getShape(R);C.handles&&Object.values(C.handles).filter(E=>E.bindingId===k.id).forEach(E=>{var M,L;n[R]=w(S({},n[R]),{handles:w(S({},(M=n[R])==null?void 0:M.handles),{[E.id]:{bindingId:k.id}})}),p.includes(R)||(r[R]=w(S({},r[R]),{handles:w(S({},(L=r[R])==null?void 0:L.handles),{[E.id]:{bindingId:void 0}})}))})}}),{id:"group",before:{document:{pages:{[t]:{shapes:n,bindings:s}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:r,bindings:s}},pageStates:{[t]:{selectedIds:[e]}}}}}}import{Utils as Dv}from"telva-core";import{Vec as su}from"telva-vec";function au(i,o,e,t,n){let{page:r}=i,s={before:{shapes:{},bindings:{}},after:{shapes:{},bindings:{}}},l={before:{shapes:{},bindings:{}},after:{shapes:{},bindings:{}}},a=new Set,c=new Set;o.map(T=>i.getShape(T,t)).filter(T=>!T.isLocked).forEach(T=>{a.add(T.id),c.add(T),T.children!==void 0&&T.children.forEach(y=>{a.add(y),c.add(i.getShape(y,t))})});let p=B.getTopChildIndex(i.state,n),u=Array.from(c.values());u.forEach((T,y)=>{if(s.before.shapes[T.id]=T,s.after.shapes[T.id]=void 0,l.before.shapes[T.id]=void 0,l.after.shapes[T.id]=T,!a.has(T.parentId)&&(l.after.shapes[T.id]=w(S({},T),{parentId:n,childIndex:p+y}),T.parentId!==t)){let x=i.getShape(T.parentId,t);s.before.shapes[x.id]={children:x.children},s.after.shapes[x.id]={children:x.children.filter(I=>I!==T.id)}}}),Object.values(r.bindings).filter(T=>a.has(T.fromId)||a.has(T.toId)).forEach(T=>{s.before.bindings[T.id]=T,s.after.bindings[T.id]=void 0;let y=i.getShape(T.fromId,t);if(a.has(T.fromId)&&a.has(T.toId))l.before.bindings[T.id]=void 0,l.after.bindings[T.id]=T;else if(a.has(T.fromId)){let I=i.getShape(T.fromId,t),R=Object.values(y.handles).find(E=>E.bindingId===T.id).id,C=l.after.shapes[I.id];C.handles=w(S({},C.handles),{[R]:w(S({},C.handles[R]),{bindingId:void 0})})}else{let I=i.getShape(T.fromId,t),k=Object.values(y.handles).find(R=>R.bindingId===T.id);s.before.shapes[I.id]={handles:{[k.id]:{bindingId:T.id}}},s.after.shapes[I.id]={handles:{[k.id]:{bindingId:void 0}}}}});let h=i.state.document.pageStates[n],g=Dv.getCommonBounds(u.map(T=>B.getBounds(T))),m=B.getCameraZoom(e.width<e.height?(e.width-128)/g.width:(e.height-128)/g.height),f=(e.width-g.width*m)/2/m,v=(e.height-g.height*m)/2/m,b=su.toFixed(su.add([-g.minX,-g.minY],[f,v]));return{id:"move_to_page",before:{appState:{currentPageId:t},document:{pages:{[t]:s.before,[n]:l.before},pageStates:{[t]:{selectedIds:o},[n]:{selectedIds:h.selectedIds,camera:h.camera}}}},after:{appState:{currentPageId:n},document:{pages:{[t]:s.after,[n]:l.after},pageStates:{[t]:{selectedIds:[]},[n]:{selectedIds:o,camera:{zoom:m,point:b}}}}}}}function lu(i,o,e){let{pages:t}=i.document,n=t[o],r=Object.values(t).sort((a,c)=>{var p,u;return((p=a.childIndex)!=null?p:0)-((u=c.childIndex)!=null?u:0)}),s=r.indexOf(n),l=[...r];return l.splice(s,1),l.splice(e>s?e-1:e,0,n),{id:"move_page",before:{document:{pages:Object.fromEntries(r.map(a=>[a.id,{childIndex:a.childIndex}]))}},after:{document:{pages:Object.fromEntries(l.map((a,c)=>[a.id,{childIndex:c}]))}}}}function Nr(i,o,e){let{currentPageId:t,page:n}=i,r=new Set(o.map(p=>i.getShape(p).parentId)),s={before:{},after:{}},l,a,c;return Array.from(r.values()).forEach(p=>{let u=[];if(p===n.id)u=Object.values(n.shapes).sort((m,f)=>m.childIndex-f.childIndex);else{let m=i.getShape(p);if(!m.children)throw Error("No children in parent!");u=m.children.map(f=>i.getShape(f)).sort((f,v)=>f.childIndex-v.childIndex)}let h=u.map(m=>m.id),g=o.filter(m=>h.includes(m)).map(m=>h.indexOf(m)).sort((m,f)=>m-f);if(g.length!==h.length)switch(e){case"toBack":{for(let m=0;m<h.length;m++)if(!g.includes(m)){l=m;break}a=u[l].childIndex,c=a/(g.length+1),s=B.mutateShapes(i.state,g.map(m=>u[m].id).reverse(),(m,f)=>({childIndex:a-(f+1)*c}),t);break}case"toFront":{for(let m=h.length-1;m>=0;m--)if(!g.includes(m)){l=m;break}a=u[l].childIndex,c=1,s=B.mutateShapes(i.state,g.map(m=>u[m].id),(m,f)=>({childIndex:a+(f+1)}),t);break}case"backward":{let m={};for(let f=h.length-1;f>=0;f--)if(g.includes(f)){for(let v=f;v>=0;v--)if(!g.includes(v)){let b=u[v].childIndex,T,y;v===0?(T=b/2,y=b/2/(f-v+1)):(T=u[v-1].childIndex,y=(b-T)/(f-v+1),T+=y);for(let x=0;x<f-v;x++)m[u[v+x+1].id]=T+y*x;break}}Object.values(m).length>0&&(s=B.mutateShapes(i.state,g.map(f=>u[f].id),f=>({childIndex:m[f.id]}),t));break}case"forward":{let m={};for(let f=0;f<h.length;f++)if(g.includes(f)){for(let v=f;v<h.length;v++)if(!g.includes(v)){a=u[v].childIndex;let b=v===h.length-1?1:(u[v+1].childIndex-a)/(v-f+1);for(let T=0;T<v-f;T++)m[u[f+T].id]=a+b*(T+1);break}}Object.values(m).length>0&&(s=B.mutateShapes(i.state,g.map(f=>u[f].id),f=>({childIndex:m[f.id]}),t));break}}}),{id:"move",before:{document:{pages:{[t]:{shapes:s.before}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:s.after}},pageStates:{[t]:{selectedIds:o}}}}}}function du(i,o,e){let{page:t}=i;return{id:"rename_page",before:{document:{pages:{[o]:{name:t.name}}}},after:{document:{pages:{[o]:{name:e}}}}}}function Ya(i,o,e){let{currentPageId:t}=i,{before:n,after:r}=B.mutateShapes(i.state,o,s=>{var l,a;return(a=(l=i.getShapeUtil(s)).onDoubleClickBoundsHandle)==null?void 0:a.call(l,s)},e);return{id:"reset_bounds",before:{document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:r}},pageStates:{[t]:{selectedIds:o}}}}}}import{Utils as cu}from"telva-core";var Ev=Math.PI*2;function pu(i,o,e=-Ev/4){let{currentPageId:t}=i,n={},r={},s=o.flatMap(a=>{let c=i.getShape(a);return c.children?c.children.map(p=>i.getShape(p)):c}).filter(a=>!a.isLocked),l=cu.getBoundsCenter(cu.getCommonBounds(s.map(a=>B.getBounds(a))));return s.forEach(a=>{let c=B.getRotatedShapeMutation(a,B.getCenter(a),l,e);!c||(n[a.id]=B.getBeforeShape(a,c),r[a.id]=c)}),{id:"rotate",before:{document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:r}},pageStates:{[t]:{selectedIds:o}}}}}}import{TLBoundsCorner as uu,Utils as Bv}from"telva-core";function hu(i,o,e){let{currentPageId:t,selectedIds:n}=i,r=o.map(u=>i.getShape(u)),s=r.map(u=>B.getBounds(u)),l=Bv.getCommonBounds(s),a=o.flatMap(u=>{let h=i.getShape(u);return h.children?h.children:h.id}).filter(u=>!i.getShape(u).isLocked),{before:c,after:p}=B.mutateShapes(i.state,a,u=>{let h=B.getBounds(u);switch(e){case"horizontal":{let g=w(S({},h),{minX:l.minX,maxX:l.maxX,width:l.width});return B.getShapeUtil(u).transformSingle(u,g,{type:uu.TopLeft,scaleX:g.width/h.width,scaleY:1,initialShape:u,transformOrigin:[.5,.5]})}case"vertical":{let g=w(S({},h),{minY:l.minY,maxY:l.maxY,height:l.height});return B.getShapeUtil(u).transformSingle(u,g,{type:uu.TopLeft,scaleX:1,scaleY:g.height/h.height,initialShape:u,transformOrigin:[.5,.5]})}}},t);return r.forEach(u=>{u.type==="group"&&(delete c[u.id],delete p[u.id])}),{id:"stretch",before:{document:{pages:{[t]:{shapes:c}},pageStates:{[t]:{selectedIds:n}}}},after:{document:{pages:{[t]:{shapes:p}},pageStates:{[t]:{selectedIds:o}}}}}}import{Vec as Xa}from"telva-vec";function mu(i,o,e){let{currentPageId:t,selectedIds:n}=i,r=o.flatMap(a=>B.getDocumentBranch(i.state,a,t)).filter(a=>!i.getShape(a).isLocked),s={},l={};return r.map(a=>i.getShape(a)).filter(a=>!a.isLocked).forEach(a=>{s[a.id]={style:S({},Object.fromEntries(Object.keys(e).map(c=>[c,a.style[c]])))},l[a.id]={style:e},a.type==="text"&&(s[a.id].point=a.point,l[a.id].point=Xa.toFixed(Xa.add(a.point,Xa.sub(i.getShapeUtil(a).getCenter(a),i.getShapeUtil(a).getCenter(w(S({},a),{style:S(S({},a.style),e)}))))))}),{id:"style",before:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:n}}},appState:{currentStyle:S({},i.appState.currentStyle)}},after:{document:{pages:{[t]:{shapes:l}},pageStates:{[t]:{selectedIds:o}}},appState:{currentStyle:e}}}}function gu(i,o,e){let{currentPageId:t,selectedIds:n}=i,r=Object.fromEntries(o.map(l=>{var a;return[l,{decorations:{[e]:(a=i.getShape(l).decorations)==null?void 0:a[e]}}]})),s=Object.fromEntries(o.filter(l=>!i.getShape(l).isLocked).map(l=>{var a;return[l,{decorations:{[e]:(a=i.getShape(l).decorations)!=null&&a[e]?void 0:"arrow"}}]}));return{id:"toggle_decorations",before:{document:{pages:{[t]:{shapes:r}},pageStates:{[t]:{selectedIds:n}}}},after:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:o}}}}}}function ps(i,o,e){let{currentPageId:t}=i,n=o.map(a=>i.getShape(a)).filter(a=>e==="isLocked"?!0:!a.isLocked),r=n.every(a=>a[e]),s={},l={};return n.forEach(a=>{s[a.id]={[e]:a[e]},l[a.id]={[e]:!r}}),{id:"toggle",before:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:{shapes:l}},pageStates:{[t]:{selectedIds:o}}}}}}import{Vec as fu}from"telva-vec";function Su(i,o,e){let{currentPageId:t,selectedIds:n}=i;i.rotationInfo.selectedIds=[...n];let r={shapes:{},bindings:{}},s={shapes:{},bindings:{}},l=o.flatMap(p=>{let u=i.getShape(p);return u.children?u.children:u.id}).filter(p=>!i.getShape(p).isLocked),a=B.mutateShapes(i.state,l,p=>({point:fu.toFixed(fu.add(p.point,e))}),t);return r.shapes=a.before,s.shapes=a.after,B.getBindings(i.state,t).filter(p=>o.includes(p.fromId)&&!o.includes(p.toId)).forEach(p=>{r.bindings[p.id]=p,s.bindings[p.id]=void 0;for(let u of[p.toId,p.fromId]){let h=i.getShape(u);!h.handles||Object.values(h.handles).filter(g=>g.bindingId===p.id).forEach(g=>{var m,f;r.shapes[u]=w(S({},r.shapes[u]),{handles:w(S({},(m=r.shapes[u])==null?void 0:m.handles),{[g.id]:{bindingId:p.id}})}),s.shapes[u]=w(S({},s.shapes[u]),{handles:w(S({},(f=s.shapes[u])==null?void 0:f.handles),{[g.id]:{bindingId:void 0}})})})}}),{id:"translate",before:{document:{pages:{[t]:r},pageStates:{[t]:{selectedIds:o}}}},after:{document:{pages:{[t]:s},pageStates:{[t]:{selectedIds:o}}}}}}function yu(i,o,e,t){let{bindings:n}=i,r={},s={},l={},a={},c=o,p=o.filter(u=>!e.find(h=>h.id===u));return e.filter(u=>!u.isLocked).forEach(u=>{let h=[],g=[];r[u.id]=u,s[u.id]=void 0,u.children.forEach(T=>{p.push(T);let y=i.getShape(T,t);h.push(y)});let m=u.childIndex,v=(B.getChildIndexAbove(i.state,u.id,t)-m)/h.length;h.sort((T,y)=>T.childIndex-y.childIndex).forEach((T,y)=>{r[T.id]={parentId:T.parentId,childIndex:T.childIndex},s[T.id]={parentId:t,childIndex:m+v*y}}),n.filter(T=>T.toId===u.id||T.fromId===u.id).forEach(T=>{for(let y of[T.toId,T.fromId])if(s[y]===void 0){l[T.id]=T,a[T.id]=void 0;let x=i.getShape(y,t);x.handles&&Object.values(x.handles).filter(I=>I.bindingId===T.id).forEach(I=>{var k,R;r[y]=w(S({},r[y]),{handles:w(S({},(k=r[y])==null?void 0:k.handles),{[I.id]:{bindingId:T.id}})}),g.includes(y)||(s[y]=w(S({},s[y]),{handles:w(S({},(R=s[y])==null?void 0:R.handles),{[I.id]:{bindingId:void 0}})}))})}})}),{id:"ungroup",before:{document:{pages:{[t]:{shapes:r,bindings:l}},pageStates:{[t]:{selectedIds:c}}}},after:{document:{pages:{[t]:{shapes:s,bindings:l}},pageStates:{[t]:{selectedIds:p}}}}}}function Za(i,o,e){let t=o.map(r=>r.id),n=B.mutateShapes(i.state,t.filter(r=>!i.getShape(r,e).isLocked),(r,s)=>o[s],e);return{id:"update",before:{document:{pages:{[e]:{shapes:n.before}}}},after:{document:{pages:{[e]:{shapes:n.after}}}}}}function bu(i,o,e){let{currentPageId:t,selectedIds:n}=i,r=o.map(c=>i.getShape(c)).filter(c=>e.isLocked?!0:!c.isLocked),s={},l={},a=Object.keys(e);return r.forEach(c=>{s[c.id]=Object.fromEntries(a.map(p=>[p,c[p]])),l[c.id]=e}),{id:"set_props",before:{document:{pages:{[t]:{shapes:s}},pageStates:{[t]:{selectedIds:n}}}},after:{document:{pages:{[t]:{shapes:l}},pageStates:{[t]:{selectedIds:n}}}}}}import{Utils as en}from"telva-core";import{Vec as Xo}from"telva-vec";function vu(i,o,e={}){let{currentPageId:t}=i,{point:n,select:r,overwrite:s}=e,l=i.document.pages[t],a={shapes:{},bindings:{}},c={},p={shapes:{},bindings:{}};if(s){for(let h of o.shapes)a.shapes[h.id]=l.shapes[h.id],p.shapes[h.id]=h;if(o.bindings)for(let h of o.bindings)a.bindings[h.id]=l.bindings[h.id],p.bindings[h.id]=h;if(o.assets)for(let h of o.assets)c[h.id]=h}else{let h={},g=B.getTopChildIndex(i.state,t),m=o.shapes.sort((b,T)=>b.childIndex-T.childIndex).map(b=>{let T=en.uniqueId();return h[b.id]=T,w(S({},en.deepClone(b)),{id:T})}),f=new Set;for(;m.length>0;){let b=m.shift();if(!b)break;if(f.add(b.id),b.parentId==="currentPageId")b.parentId=t,b.childIndex=g++;else{b.parentId=h[b.parentId];let T=p.shapes[b.parentId];if(!T){f.has(b.id)&&(b.parentId="currentPageId"),m.push(b);continue}T.children.push(b.id)}b.children&&(b.children=[]),a.shapes[b.id]=void 0,p.shapes[b.id]=b}Object.values(p.shapes).forEach(b=>{b.children&&b.children.length===0&&(delete a.shapes[b.id],delete p.shapes[b.id])}),o.bindings&&o.bindings.forEach(b=>{let T=en.uniqueId();h[b.id]=T;let y=h[b.toId],x=h[b.fromId];if(!y||!x){if(x){let C=p.shapes[x].handles;C&&Object.values(C).forEach(E=>{E.bindingId===b.id&&(E.bindingId=void 0)})}if(y){let C=p.shapes[y].handles;C&&Object.values(C).forEach(E=>{E.bindingId===b.id&&(E.bindingId=void 0)})}return}let I=p.shapes[x].handles;I&&Object.values(I).forEach(C=>{C.bindingId===b.id&&(C.bindingId=T)}),p.shapes[y].handles&&Object.values(p.shapes[y].handles).forEach(C=>{C.bindingId===b.id&&(C.bindingId=T)});let R=w(S({},en.deepClone(b)),{id:T,toId:y,fromId:x});a.bindings[R.id]=void 0,p.bindings[R.id]=R});let v=Object.values(p.shapes);if(v.length>0)if(n){let b=en.getCommonBounds(v.map(y=>B.getBounds(y))),T=en.getBoundsCenter(b);v.forEach(y=>{!y.point||(y.point=Xo.sub(n,Xo.sub(T,y.point)))})}else{let b=en.getCommonBounds(v.map(B.getBounds));if(!(en.boundsContain(i.viewport,b)||en.boundsCollide(i.viewport,b))){let T=Xo.toFixed(i.getPagePoint(i.centerPoint)),y=en.centerBounds(b,T),x=Xo.sub(en.getBoundsCenter(y),en.getBoundsCenter(b));v.forEach(I=>{I.point=Xo.toFixed(Xo.add(I.point,x))})}}if(o.assets)for(let b of o.assets)c[b.id]=b}let u=document.createElement("textarea");return Object.values(p.shapes).forEach(h=>{"text"in h&&(u.innerHTML=h.text,h.text=u.value),"label"in h&&(u.innerHTML=h.label,h.label=u.value)}),u.remove(),{id:"insert",before:{document:{pages:{[t]:a},pageStates:{[t]:{selectedIds:[...i.selectedIds]}}}},after:{document:{pages:{[t]:p},assets:c,pageStates:{[t]:{selectedIds:r?Object.keys(p.shapes):[...i.selectedIds]}}}}}}var Zo={};ll(Zo,{fileToBase64:()=>el,fileToText:()=>tl,getImageSizeFromSrc:()=>nl,getVideoSizeFromSrc:()=>ol,loadFileHandle:()=>qa,migrate:()=>Dn,openAssetsFromFileSystem:()=>Qa,openFromFileSystem:()=>Ja,saveFileHandle:()=>us,saveToFileSystem:()=>hs,tldrawFileToTVDocument:()=>Cu,tvDocumentToTldrawFile:()=>ku});function Dn(i,o){let{document:e,settings:t}=i,{version:n=0}=e;"assets"in e||(e.assets={});let r=new Set;return Object.values(e.pages).forEach(s=>Object.values(s.shapes).forEach(l=>{let{parentId:a,children:c,assetId:p}=l;p&&r.add(p),a!==s.id&&!s.shapes[a]&&(console.warn("Encountered a shape with a missing parent!"),l.parentId=s.id),l.type==="group"&&c&&c.forEach(u=>{s.shapes[u]||(console.warn("Encountered a parent with a missing child!",l.id,u),c==null||c.splice(c.indexOf(u),1))})})),Object.keys(e.assets).forEach(s=>{r.has(s)||delete e.assets[s]}),n!==o&&(n<14&&Object.values(e.pages).forEach(s=>{Object.values(s.shapes).filter(l=>l.type==="text").forEach(l=>l.style.font==="script")}),n<=13&&Object.values(e.pages).forEach(s=>{Object.values(s.bindings).forEach(l=>{Object.assign(l,l.meta)}),Object.values(s.shapes).forEach(l=>{Object.entries(l.style).forEach(([a,c])=>{typeof c=="string"&&(l.style[a]=c.toLowerCase())}),l.type==="arrow"&&l.decorations&&Object.entries(l.decorations).forEach(([a,c])=>{c==="Arrow"&&(l.decorations=w(S({},l.decorations),{[a]:"arrow"}))})})}),n<=13.1&&(e.name="New Document"),n<15&&(e.assets={}),Object.values(e.pages).forEach(s=>{Object.values(s.shapes).forEach(l=>{n<15.2&&(l.type==="image"||l.type==="video")&&(l.style.isFilled=!0),n<15.3&&(l.type==="rectangle"||l.type==="triangle"||l.type==="ellipse"||l.type==="arrow")&&(l.label=l.text||"",l.labelPoint=[.5,.5])})}),n<15.4&&(t.dockPosition="bottom"),n<15.5&&(t.exportBackground="transparent")),Object.values(e.pageStates).forEach(s=>{s.selectedIds=s.selectedIds.filter(l=>e.pages[s.id].shapes[l]!==void 0),s.bindingId=void 0,s.editingId=void 0,s.hoveredId=void 0,s.pointedId=void 0}),Object.values(e.pages).forEach(s=>{Object.values(s.shapes).forEach(l=>{var a,c,p,u,h,g,m,f,v,b,T,y;if(l.type==="arrow"){let x=l;if(!x.handles||!x.handles.start||!x.handles.end||!x.handles.bend){let I=(p=(c=(a=x.handles)==null?void 0:a.start)==null?void 0:c.point)!=null?p:[0,0],k=(g=(h=(u=x.handles)==null?void 0:u.end)==null?void 0:h.point)!=null?g:[100,0],R=(v=(f=(m=x.handles)==null?void 0:m.bend)==null?void 0:f.point)!=null?v:[(I[0]+k[0])/2,(I[1]+k[1])/2];x.handles={start:S({id:"start",index:0,point:I,canBind:!0},(b=x.handles)==null?void 0:b.start),bend:S({id:"bend",index:1,point:R},(T=x.handles)==null?void 0:T.bend),end:S({id:"end",index:2,point:k,canBind:!0},(y=x.handles)==null?void 0:y.end)}}typeof x.bend!="number"&&(x.bend=0)}})}),e.version=o,i}import{fileOpen as xu,fileSave as Lv,supported as Av}from"browser-fs-access";import{get as Vv,set as Hv}from"idb-keyval";var Tu={mode:"readwrite"},zv=i=>z(void 0,null,function*(){return(yield i.queryPermission(Tu))==="granted"||(yield i.requestPermission(Tu))==="granted"});function qa(){return z(this,null,function*(){if(typeof Window=="undefined"||!("_location"in Window))return;let i=yield Vv(`Telva_file_handle_${window.location.origin}`);return i||null})}function us(i){return z(this,null,function*(){return Hv(`Telva_file_handle_${window.location.origin}`,i)})}var Fv={schemaVersion:1,storeVersion:4,recordVersions:{asset:{version:1,subTypeKey:"type",subTypeVersions:{image:2,video:2,bookmark:0}},camera:{version:1},document:{version:2},instance:{version:22},instance_page_state:{version:5},page:{version:1},shape:{version:3,subTypeKey:"type",subTypeVersions:{}},instance_presence:{version:5},pointer:{version:1}}};function ku(i){var t,n,s,l,a,c;let o=[];o.push({gridSize:10,name:i.name||"",meta:{},id:"document:document",typeName:"document",telvaDocument:i});let e=0;for(let p of Object.keys(i.pages)){let u=i.pages[p],h=i.pageStates[p],g=`a${e+1}`;o.push({meta:{},id:`page:${p}`,name:u.name||`Page ${e+1}`,index:g,typeName:"page"}),o.push({editingShapeId:null,croppingShapeId:null,selectedShapeIds:(t=h==null?void 0:h.selectedIds)!=null?t:[],hoveredShapeId:null,erasingShapeIds:[],hintingShapeIds:[],focusedGroupId:null,meta:{},id:`instance_page_state:page:${p}`,pageId:`page:${p}`,typeName:"instance_page_state"});let m=(n=u.shapes)!=null?n:{},f=0;for(let v of Object.keys(m)){let b=m[v],r=b,{point:T,rotation:y,style:x,type:I}=r,k=Be(r,["point","rotation","style","type"]);o.push({x:(s=T==null?void 0:T[0])!=null?s:0,y:(l=T==null?void 0:T[1])!=null?l:0,rotation:y!=null?y:0,isLocked:(a=b.isLocked)!=null?a:!1,opacity:(c=x==null?void 0:x.opacity)!=null?c:1,meta:{},id:`shape:${v}`,parentId:`page:${p}`,type:I,props:S(S({},k),x),index:`a${f+1}`,typeName:"shape"}),f++}e++}return{tldrawFileFormatVersion:1,schema:Fv,records:o}}function Cu(i){var a,p;let o=(a=i.records)!=null?a:[],e=o.find(u=>u.typeName==="document");if(e!=null&&e.telvaDocument)return e.telvaDocument;let t=o.filter(u=>u.typeName==="page"),n=o.filter(u=>u.typeName==="shape"),r=o.filter(u=>u.typeName==="instance_page_state"),s={},l={};for(let u of t){let h=u.id.startsWith("page:")?u.id.slice(5):u.id,g={};for(let f of n){let v=`page:${h}`;if(f.parentId!==v&&f.parentId!==h)continue;let b=f.id.startsWith("shape:")?f.id.slice(6):f.id,{props:T={},x:y,y:x,rotation:I,type:k}=f,c=T,{opacity:R,start:C,end:E,bend:M,arrowheadStart:L,arrowheadEnd:A}=c,K=Be(c,["opacity","start","end","bend","arrowheadStart","arrowheadEnd"]),re=S({id:b,type:k,point:[y!=null?y:0,x!=null?x:0],rotation:I!=null?I:0,style:S({opacity:R!=null?R:1},K)},K);if(k==="arrow"){let F=(C==null?void 0:C.x)!==void 0?[C.x,C.y]:[0,0],ee=(E==null?void 0:E.x)!==void 0?[E.x,E.y]:[1,1],pe=typeof M=="number"?M:0,he=[(F[0]+ee[0])/2,(F[1]+ee[1])/2];re.handles={start:{id:"start",index:0,point:F,canBind:!0,bindingId:C!=null&&C.boundShapeId?Object.keys(g).find(()=>!0):void 0},bend:{id:"bend",index:1,point:he},end:{id:"end",index:2,point:ee,canBind:!0,bindingId:E!=null&&E.boundShapeId?E.boundShapeId:void 0}},re.bend=pe,(L||A)&&(re.decorations={start:L&&L!=="none"?L:void 0,end:A&&A!=="none"?A:void 0})}g[b]=re}s[h]={id:h,name:u.name||"Page",shapes:g,bindings:{}};let m=r.find(f=>f.pageId===`page:${h}`||f.pageId===h);l[h]={id:h,selectedIds:(p=m==null?void 0:m.selectedShapeIds)!=null?p:[],camera:{point:[0,0],zoom:1}}}if(Object.keys(s).length===0){let u="page";s[u]={id:u,name:"Page 1",shapes:{},bindings:{}},l[u]={id:u,selectedIds:[],camera:{point:[0,0],zoom:1}}}return{id:"document",name:(e==null?void 0:e.name)||"Imported Document",version:15,pages:s,pageStates:l,assets:{}}}function hs(i,o,e,t){return z(this,null,function*(){let n=t==="tld"?".tld":Qs,r,s;if(t==="tld"){let u=ku(i);r=JSON.stringify(u),s="application/vnd.tldraw+json"}else{let u={name:i.name||"New Document",fileHandle:o!=null?o:null,document:i};r=JSON.stringify(u),s="application/vnd.Telva+json"}let l=new Blob([r],{type:s});if(o&&!(yield zv(o)))return null;let a=i.name||"New Document",c=!Av&&(e==null?void 0:e.length)?e:a,p=yield Lv(l,{fileName:`${c}${n}`,description:t==="tld"?"TLDraw File":"Telva File",extensions:[n]},o);return yield us(p),p})}function Ja(){return z(this,null,function*(){var r,s;let i=yield xu({description:"Telva / TLDraw File",extensions:[Qs,".tld"],multiple:!1});if(!i)return null;let o=yield new Promise(l=>{let a=new FileReader;a.onloadend=()=>{a.readyState===FileReader.DONE&&l(a.result)},a.readAsText(i,"utf8")}),e=JSON.parse(o);if("tldrawFileFormatVersion"in e){let l=(r=i.handle)!=null?r:null;return yield us(l),{fileHandle:l,document:Cu(e)}}if("telvaFileFormatVersion"in e)return alert("This file was created in a newer version of Telva. Please visit beta.telva.com to open it."),null;let t=e,n=(s=i.handle)!=null?s:null;return yield us(n),{fileHandle:n,document:t.document}})}function Qa(){return z(this,null,function*(){return xu({description:"Image or Video",extensions:[...Si,...yi],multiple:!0})})}function el(i){return new Promise((o,e)=>{if(i){let t=new FileReader;t.readAsDataURL(i),t.onload=()=>o(t.result),t.onerror=n=>e(n),t.onabort=n=>e(n)}})}function tl(i){return new Promise((o,e)=>{if(i){let t=new FileReader;t.readAsText(i),t.onload=()=>o(t.result),t.onerror=n=>e(n),t.onabort=n=>e(n)}})}function nl(i){return new Promise((o,e)=>{let t=new Image;t.onload=()=>o([t.width,t.height]),t.onerror=()=>e(new Error("Could not get image size")),t.src=i})}function ol(i){return new Promise((o,e)=>{let t=document.createElement("video");t.onloadedmetadata=()=>o([t.videoWidth,t.videoHeight]),t.onerror=()=>e(new Error("Could not get video size")),t.src=i})}Zr(Zo,AV);import*as AV from"browser-fs-access";import{Utils as _n}from"telva-core";import{Vec as Re}from"telva-vec";var Le=class{constructor(o){this.app=o}};var ms=class extends Le{constructor(e,t,n,r=!1){var p,u,h;super(e);d(this,"type","arrow");d(this,"performanceMode");d(this,"status","translatingHandle");d(this,"newStartBindingId",_n.uniqueId());d(this,"draggedBindingId",_n.uniqueId());d(this,"didBind",!1);d(this,"initialShape");d(this,"handleId");d(this,"bindableShapeIds");d(this,"initialBinding");d(this,"startBindingShapeId");d(this,"isCreate");d(this,"start",()=>{});d(this,"update",()=>{var k,R,C;let{initialShape:e}=this,{currentPoint:t,shiftKey:n,altKey:r,metaKey:s,currentGrid:l,settings:{showGrid:a}}=this.app,c=this.app.getShape(e.id);if(c.isLocked)return;let{handles:p}=e,u=this.handleId;if(!p[u].canBind)return;let h=Re.sub(t,Re.add(p[u].point,e.point));if(n){let E=r?Re.med(p.start.point,p.end.point):p[u==="start"?"end":"start"].point,M=p[u].point,L=Re.add(M,h),A=Re.angle(E,L),K=Re.rotWith(L,E,_n.snapAngleToSegments(A,24)-A);h=Re.add(h,Re.sub(K,L))}let g=Re.add(p[u].point,h),m={[u]:w(S({},p[u]),{point:a?Re.snap(g,l):Re.toFixed(g),bindingId:void 0})},f=kn["arrow"],v=(k=f.onHandleChange)==null?void 0:k.call(f,e,m);if(!v)return;let b={shape:_n.deepMerge(c,v),bindings:{}},T,y=b.shape.handles[this.handleId],x=b.shape.handles[this.handleId==="start"?"end":"start"];if(this.startBindingShapeId){let E,M=this.app.page.shapes[this.startBindingShapeId],L=B.getShapeUtil(M),A=L.getCenter(M),K=b.shape.handles.start,re=b.shape.handles.end,F=Re.add(K.point,b.shape.point);Re.isEqual(F,A)&&F[1]++;let ee=A,pe=L.hitTestPoint(M,t),he=Re.uni(Re.sub(F,ee)),De=this.app.getBinding(this.newStartBindingId)!==void 0;!s&&!L.hitTestPoint(M,Re.add(b.shape.point,re.point))&&(E=this.findBindingPoint(c,M,"start",this.newStartBindingId,A,ee,he,pe)),E&&!De?(this.didBind=!0,b.bindings[this.newStartBindingId]=E,b.shape=_n.deepMerge(b.shape,{handles:{start:{bindingId:E.id}}})):!E&&De&&(this.didBind=!1,b.bindings[this.newStartBindingId]=void 0,b.shape=_n.deepMerge(e,{handles:{start:{bindingId:void 0}}}))}if(!s){let E=Re.add(x.point,b.shape.point),M=Re.add(y.point,b.shape.point),L=Re.uni(Re.sub(M,E)),A=Re.add(b.shape.point,b.shape.handles.start.point),K=Re.add(b.shape.point,b.shape.handles.end.point),re=this.bindableShapeIds.map(F=>this.app.page.shapes[F]).sort((F,ee)=>ee.childIndex-F.childIndex).filter(F=>{if(F.isLocked)return!1;let ee=B.getShapeUtil(F);return![A,K].every(pe=>ee.hitTestPoint(F,pe))});for(let F of re)if(T=this.findBindingPoint(c,F,this.handleId,this.draggedBindingId,M,E,L,r),T)break}if(T)this.didBind=!0,b.bindings[this.draggedBindingId]=T,b.shape=_n.deepMerge(b.shape,{handles:{[this.handleId]:{bindingId:this.draggedBindingId}}});else{this.didBind=this.didBind||!1;let E=c.handles[this.handleId].bindingId;E!==void 0&&(b.bindings[E]=void 0,b.shape=_n.deepMerge(b.shape,{handles:{[this.handleId]:{bindingId:void 0}}}))}let I=(C=(R=B.getShapeUtil(b.shape)).onHandleChange)==null?void 0:C.call(R,b.shape,b.shape.handles);return{document:{pages:{[this.app.currentPageId]:{shapes:{[c.id]:S(S({},b.shape),I!=null?I:{})},bindings:b.bindings}},pageStates:{[this.app.currentPageId]:{bindingId:b.shape.handles[u].bindingId}}}}});d(this,"cancel",()=>{let{initialShape:e,initialBinding:t,newStartBindingId:n,draggedBindingId:r}=this,s=B.onSessionComplete(this.app.page.shapes[e.id]),l=this.isCreate||Re.dist(s.handles.start.point,s.handles.end.point)<4,a={};return a[r]=void 0,t&&(a[t.id]=l?void 0:t),n&&(a[n]=void 0),{document:{pages:{[this.app.currentPageId]:{shapes:{[e.id]:l?void 0:e},bindings:a}},pageStates:{[this.app.currentPageId]:{selectedIds:l?[]:[e.id],bindingId:void 0,hoveredId:void 0,editingId:void 0}}}}});d(this,"complete",()=>{let{initialShape:e,initialBinding:t,newStartBindingId:n,startBindingShapeId:r,handleId:s}=this,l=B.onSessionComplete(this.app.page.shapes[e.id]),a=l.handles[s].bindingId,c=Re.dist(l.handles.start.point,l.handles.end.point);if(!(a||t)&&c<4)return this.cancel();let p={},u={};return t&&(p[t.id]=this.isCreate?void 0:t,u[t.id]=void 0),a&&(p[a]=void 0,u[a]=this.app.page.bindings[a]),r&&(p[n]=void 0,u[n]=this.app.page.bindings[n]),{id:"arrow",before:{document:{pages:{[this.app.currentPageId]:{shapes:{[e.id]:this.isCreate?void 0:e},bindings:p}},pageStates:{[this.app.currentPageId]:{selectedIds:this.isCreate?[]:[e.id],bindingId:void 0,hoveredId:void 0,editingId:void 0}}}},after:{document:{pages:{[this.app.currentPageId]:{shapes:{[e.id]:l},bindings:u}},pageStates:{[this.app.currentPageId]:{selectedIds:[e.id],bindingId:void 0,hoveredId:void 0,editingId:void 0}}}}}});d(this,"findBindingPoint",(e,t,n,r,s,l,a,c)=>{let u=B.getShapeUtil(t.type).getBindingPoint(t,e,s,l,a,c);if(!!u)return{id:r,type:"arrow",fromId:e.id,toId:t.id,handleId:n,point:Re.toFixed(u.point),distance:u.distance}});this.isCreate=r;let{currentPageId:s}=e.state.appState,l=e.state.document.pages[s];this.handleId=n,this.initialShape=rt(l.shapes[t]),this.bindableShapeIds=B.getBindableShapeIds(e.state).filter(g=>!(g===this.initialShape.id||g===this.initialShape.parentId));let a=(p=this.initialShape.handles[n==="start"?"end":"start"])==null?void 0:p.bindingId;if(a){let g=(u=l.bindings[a])==null?void 0:u.toId;g&&(this.bindableShapeIds=this.bindableShapeIds.filter(m=>m!==g))}let{originPoint:c}=this.app;if(this.isCreate)this.startBindingShapeId=(h=this.bindableShapeIds.map(g=>l.shapes[g]).filter(g=>!g.isLocked&&_n.pointInBounds(c,B.getShapeUtil(g).getBounds(g))).sort((g,m)=>m.childIndex-g.childIndex)[0])==null?void 0:h.id,this.startBindingShapeId&&this.bindableShapeIds.splice(this.bindableShapeIds.indexOf(this.startBindingShapeId),1);else{let g=this.initialShape.handles[this.handleId].bindingId;g?this.initialBinding=l.bindings[g]:this.initialShape.handles[this.handleId].bindingId=void 0}}};import{Utils as wu}from"telva-core";var gs=class extends Le{constructor(e){super(e);d(this,"type","brush");d(this,"performanceMode");d(this,"status","brushing");d(this,"initialSelectedIds");d(this,"shapesToTest");d(this,"start",()=>{});d(this,"update",()=>{let{initialSelectedIds:e,shapesToTest:t,app:{metaKey:n,settings:r,originPoint:s,currentPoint:l}}=this,a=wu.getBoundsFromPoints([s,l]),c=r.isCadSelectMode?!n&&s[0]<l[0]:n,p=new Set,u=new Set(e);t.forEach(({id:f,selectId:v})=>{let b=this.app.getShape(f);if(!p.has(v)){let T=this.app.getShapeUtil(b);(c?wu.boundsContain(a,T.getBounds(b)):T.hitTestBounds(b,a))?(p.add(v),u.has(v)||u.add(v)):u.has(v)&&u.delete(v)}});let h=this.app.selectedIds,g=u.size!==h.length||h.some(f=>!u.has(f)),m=g?Array.from(u.values()):h;return g?{appState:{selectByContain:c},document:{pageStates:{[this.app.currentPageId]:{brush:a,selectedIds:m}}}}:{appState:{selectByContain:c},document:{pageStates:{[this.app.currentPageId]:{brush:a}}}}});d(this,"cancel",()=>({appState:{selectByContain:!1},document:{pageStates:{[this.app.currentPageId]:{brush:null,selectedIds:Array.from(this.initialSelectedIds.values())}}}}));d(this,"complete",()=>({appState:{selectByContain:!1},document:{pageStates:{[this.app.currentPageId]:{brush:null,selectedIds:[...this.app.selectedIds]}}}}));let{currentPageId:t}=e;this.initialSelectedIds=new Set(this.app.selectedIds),this.shapesToTest=this.app.shapes.filter(n=>!(n.isLocked||n.isHidden||n.parentId!==t||this.initialSelectedIds.has(n.id)||this.initialSelectedIds.has(n.parentId))).map(n=>({id:n.id,bounds:this.app.getShapeUtil(n).getBounds(n),selectId:n.id})),this.update()}};import{Vec as je}from"telva-vec";var fs=class extends Le{constructor(e,t){var c;super(e);d(this,"type","draw");d(this,"performanceMode");d(this,"status","creating");d(this,"topLeft");d(this,"points");d(this,"initialShape");d(this,"lastAdjustedPoint");d(this,"shiftedPoints",[]);d(this,"shapeId");d(this,"isLocked");d(this,"isExtending");d(this,"lockedDirection");d(this,"start",()=>{var s;let e=this.app.originPoint,t=[0,0,(s=e[2])!=null?s:.5];this.points.push(t);let n=[Math.min(this.topLeft[0],e[0]),Math.min(this.topLeft[1],e[1])],r=je.sub(n,e);return this.topLeft=n,this.shiftedPoints=this.points.map(l=>je.toFixed(je.sub(l,r)).concat(l[2])),{document:{pages:{[this.app.currentPageId]:{shapes:{[this.shapeId]:{point:this.topLeft,points:this.shiftedPoints}}}},pageStates:{[this.app.currentPageId]:{selectedIds:[this.shapeId]}}}}});d(this,"update",()=>{let{shapeId:e}=this,{currentPoint:t,originPoint:n,shiftKey:r,zoom:s}=this.app;if(!this.lockedDirection&&this.points.length>1){let a=je.sub(t,n);je.len(a)>3/s&&(this.lockedDirection=Math.abs(a[0])>Math.abs(a[1])?"horizontal":"vertical")}if(r){if(!this.isLocked&&this.points.length>2){if(!this.lockedDirection){let c=je.sub(t,n);je.len(c)>3/s&&(this.lockedDirection=Math.abs(c[0])>Math.abs(c[1])?"horizontal":"vertical")}this.isLocked=!0;let a=[...this.lastAdjustedPoint];this.lockedDirection==="vertical"?a[0]=0:a[1]=0,this.points.push(a.concat(t[2]))}}else this.isLocked&&(this.isLocked=!1);this.isLocked&&(this.lockedDirection==="vertical"?t[0]=n[0]:t[1]=n[1]);let l=this.addPoint(t);if(!!l)return{document:{pages:{[this.app.currentPageId]:{shapes:{[e]:l}}},pageStates:{[this.app.currentPageId]:{selectedIds:[e]}}}}});d(this,"cancel",()=>{let{shapeId:e}=this,t=this.app.currentPageId;return{document:{pages:{[t]:{shapes:{[e]:this.isExtending?this.initialShape:void 0}}},pageStates:{[t]:{selectedIds:[]}}}}});d(this,"complete",()=>{let{shapeId:e}=this,t=this.app.currentPageId,n=this.app.getShape(e);return{id:"create_draw",before:{document:{pages:{[t]:{shapes:{[e]:this.isExtending?this.initialShape:void 0}}},pageStates:{[t]:{selectedIds:[]}}}},after:{document:{pages:{[t]:{shapes:{[e]:w(S({},n),{point:je.toFixed(n.point),points:n.points.map(r=>je.toFixed(r)),isComplete:!0})}}},pageStates:{[this.app.currentPageId]:{selectedIds:[]}}}}}});d(this,"addPoint",e=>{let{originPoint:t}=this.app,n=je.toFixed(je.sub(e,t)).concat(e[2]);if(je.isEqual(this.lastAdjustedPoint,n))return;this.points.push(n),this.lastAdjustedPoint=n;let r=[...this.topLeft],s=[Math.min(this.topLeft[0],e[0]),Math.min(this.topLeft[1],e[1])],l=je.sub(s,t),a;return r[0]!==s[0]||r[1]!==s[1]?(this.topLeft=s,a=this.points.map(c=>je.toFixed(je.sub(c,l)).concat(c[2]))):a=[...this.shiftedPoints,je.sub(n,l).concat(n[2])],this.shiftedPoints=a,{point:this.topLeft,points:a}});let{originPoint:n}=this.app;this.shapeId=t,this.initialShape=this.app.getShape(t),this.topLeft=[...this.initialShape.point];let r=[0,0,(c=n[2])!=null?c:.5],s=je.sub(n,this.topLeft),l=this.initialShape.points.map(p=>je.sub(p,s).concat(p[2]));this.isExtending=l.length>0;let a=[];if(this.isExtending){let p=l[l.length-1];if(p){a.push(p,p);let u=Math.floor(je.dist(p,r)/16);if(u>1)for(let h=0;h<u;h++){let g=h/(u-1);a.push(je.lrp(p,r,g).concat(p[2]))}else a.push(r,r)}}else a.push(r);this.points=[...l,...a],this.shiftedPoints=this.points.map(p=>je.add(p,s).concat(p[2])),this.lastAdjustedPoint=this.points[this.points.length-1]}};var Ss=class extends Le{constructor(e,t,n){super(e);d(this,"type","edit");d(this,"performanceMode");d(this,"initialShape");d(this,"initialSelectedIds");d(this,"currentPageId");d(this,"isCreating");d(this,"start",()=>{});d(this,"update",()=>{});d(this,"cancel",()=>({document:{pages:{[this.currentPageId]:{shapes:{[this.initialShape.id]:this.isCreating?void 0:this.initialShape}}},pageStates:{[this.currentPageId]:{selectedIds:this.isCreating?[]:this.initialSelectedIds,editingId:void 0}}}}));d(this,"complete",()=>{let e=this.app.getShape(this.initialShape.id);return{id:"edit",before:{document:{pages:{[this.currentPageId]:{shapes:{[this.initialShape.id]:this.isCreating?void 0:this.initialShape}}},pageStates:{[this.currentPageId]:{selectedIds:this.isCreating?[]:this.initialSelectedIds,editingId:void 0}}}},after:{document:{pages:{[this.currentPageId]:{shapes:{[this.initialShape.id]:e}}},pageStates:{[this.currentPageId]:{selectedIds:[e.id],editingId:void 0}}}}}});this.initialShape=e.getShape(t,e.currentPageId),this.currentPageId=e.currentPageId,this.isCreating=n,this.initialSelectedIds=[...e.selectedIds]}};import{Vec as qo}from"telva-vec";var ys=class extends Le{constructor(e){super(e);d(this,"type","draw");d(this,"performanceMode");d(this,"status","creating");d(this,"isLocked");d(this,"lockedDirection");d(this,"erasedShapes",new Set);d(this,"erasedBindings",new Set);d(this,"initialSelectedShapes");d(this,"erasableShapes");d(this,"prevPoint");d(this,"prevEraseShapesSize",0);d(this,"interval");d(this,"timestamp1",0);d(this,"timestamp2",0);d(this,"prevErasePoint",[]);d(this,"loop",()=>{let e=Date.now(),t=e-this.timestamp1,n=e-this.timestamp2,{eraseLine:r}=this.app.appState,s=[...r],l=!1;t>16&&this.prevErasePoint!==this.prevPoint&&(l=!0,s=[...r,this.prevPoint],this.prevErasePoint=this.prevPoint),n>32&&s.length>1&&(l=!0,s.splice(0,Math.ceil(s.length*.1)),this.timestamp2=e),l&&this.app.patchState({appState:{eraseLine:s}},"eraseline"),this.interval=requestAnimationFrame(this.loop)});d(this,"start",()=>{});d(this,"update",()=>{let{page:e,shiftKey:t,originPoint:n,currentPoint:r,zoom:s}=this.app;if(t){let p=qo.sub(r,n);if(!this.isLocked&&qo.len(p)>3/s){if(!this.lockedDirection){let u=qo.sub(r,n);this.lockedDirection=Math.abs(u[0])>Math.abs(u[1])?"horizontal":"vertical"}this.isLocked=!0}}else this.isLocked&&(this.isLocked=!1);this.isLocked&&(this.lockedDirection==="vertical"?r[0]=n[0]:r[1]=n[1]);let l=qo.toFixed(qo.add(n,qo.sub(r,n))),a=new Set([]);this.erasableShapes.forEach(p=>{if(!this.erasedShapes.has(p)&&this.app.getShapeUtil(p).hitTestLineSegment(p,this.prevPoint,l)&&(this.erasedShapes.add(p),a.add(p.id),p.children!==void 0))for(let u of p.children)this.erasedShapes.add(this.app.getShape(u)),a.add(u)}),Object.values(e.bindings).forEach(p=>{for(let u of[p.toId,p.fromId])a.has(u)&&this.erasedBindings.add(p)}),this.erasedShapes.forEach(p=>{this.app.getShape(p.id)||(this.erasedShapes.delete(p),this.erasableShapes.delete(p),a.delete(p.id))});let c=Array.from(this.erasedShapes.values());if(this.prevPoint=l,c.length!==this.prevEraseShapesSize)return this.prevEraseShapesSize=c.length,{document:{pages:{[e.id]:{shapes:Object.fromEntries(c.map(p=>[p.id,{isGhost:!0}]))}}}}});d(this,"cancel",()=>{let{page:e}=this.app;cancelAnimationFrame(this.interval),this.erasedShapes.forEach(n=>{this.app.getShape(n.id)||(this.erasedShapes.delete(n),this.erasableShapes.delete(n))});let t=Array.from(this.erasedShapes.values());return{document:{pages:{[e.id]:{shapes:Object.fromEntries(t.map(n=>[n.id,{isGhost:!1}]))}},pageStates:{[e.id]:{selectedIds:this.initialSelectedShapes.map(n=>n.id)}}},appState:{eraseLine:[]}}});d(this,"complete",()=>{let{page:e}=this.app;cancelAnimationFrame(this.interval),this.erasedShapes.forEach(c=>{this.app.getShape(c.id)||(this.erasedShapes.delete(c),this.erasableShapes.delete(c))}),this.erasedBindings.forEach(c=>{this.app.getBinding(c.id)||this.erasedBindings.delete(c)});let t=Array.from(this.erasedShapes.values()),n=Array.from(this.erasedBindings.values()),r=t.map(c=>c.id),s=n.map(c=>c.id),l={shapes:Object.fromEntries(t.map(c=>[c.id,c])),bindings:Object.fromEntries(n.map(c=>[c.id,c]))},a={shapes:Object.fromEntries(t.map(c=>[c.id,void 0])),bindings:Object.fromEntries(n.map(c=>[c.id,void 0]))};return this.app.shapes.forEach(c=>{c.handles&&!a.shapes[c.id]&&Object.values(c.handles).forEach(p=>{var u,h;p.bindingId&&s.includes(p.bindingId)&&(l.shapes[c.id]=w(S({},l.shapes[c.id]),{handles:w(S({},(u=l.shapes[c.id])==null?void 0:u.handles),{[p.id]:p})}),r.includes(c.id)||(a.shapes[c.id]=w(S({},a.shapes[c.id]),{handles:w(S({},(h=a.shapes[c.id])==null?void 0:h.handles),{[p.id]:w(S({},p),{bindingId:void 0})})})))})}),{id:"erase",before:{document:{pages:{[e.id]:l},pageStates:{[e.id]:{selectedIds:this.initialSelectedShapes.filter(c=>!!this.app.getShape(c.id)).map(c=>c.id)}}},appState:{eraseLine:[]}},after:{document:{pages:{[e.id]:a},pageStates:{[e.id]:{selectedIds:this.initialSelectedShapes.filter(c=>!!this.app.getShape(c.id)).filter(c=>!r.includes(c.id)).map(c=>c.id)}}},appState:{eraseLine:[]}}}});this.prevPoint=[...e.originPoint],this.initialSelectedShapes=this.app.selectedIds.map(t=>this.app.getShape(t)),this.erasableShapes=new Set(this.app.shapes.filter(t=>!t.isLocked)),this.interval=this.loop()}};import{Utils as Iu}from"telva-core";import{Vec as Pu}from"telva-vec";var bs=class extends Le{constructor(e,t){var n;super(e);d(this,"type","grid");d(this,"performanceMode");d(this,"status","translating");d(this,"shape");d(this,"bounds");d(this,"initialSelectedIds");d(this,"initialSiblings");d(this,"grid",{});d(this,"columns",1);d(this,"rows",1);d(this,"isCopying",!1);d(this,"start",()=>{});d(this,"update",()=>{let{currentPageId:e,altKey:t,shiftKey:n,currentPoint:r}=this.app,s={},l={},a=Iu.getBoundsCenter(this.bounds),c=Pu.sub(r,a);n&&(Math.abs(c[0])<Math.abs(c[1])?c[0]=0:c[1]=0);let p=this.bounds.width+32,u=this.bounds.height+32,h=Math.ceil(c[0]/p),g=Math.ceil(c[1]/u),m=Math.min(h,0),f=Math.min(g,0),v=Math.max(h,1),b=Math.max(g,1),T=new Set,y=t;y!==this.isCopying&&(Object.values(this.grid).filter(x=>x!==this.shape.id).forEach(x=>s[x]=void 0),this.grid={"0_0":this.shape.id},this.isCopying=y);for(let x=m;x<v;x++)for(let I=f;I<b;I++){let k=`${x}_${I}`;if(T.add(k),this.grid[k]||x===0&&I===0)continue;let R=this.getClone(Pu.add(this.shape.point,[x*p,I*u]),y);s[R.id]=R,this.grid[k]=R.id}if(Object.entries(this.grid).forEach(([x,I])=>{T.has(x)||(s[I]=void 0,delete this.grid[x])}),Object.values(s).length!==0)return this.initialSiblings&&(s[this.shape.parentId]={children:[...this.initialSiblings,...Object.values(this.grid)]}),{document:{pages:{[e]:{shapes:s}},pageStates:{[e]:l}}}});d(this,"cancel",()=>{let{currentPageId:e}=this.app,t={};return Object.values(this.grid).forEach(n=>{t[n]=void 0}),t[this.shape.id]=w(S({},t[this.shape.id]),{point:this.shape.point}),this.initialSiblings&&(t[this.shape.parentId]={children:[...this.initialSiblings,this.shape.id]}),{document:{pages:{[e]:{shapes:t}},pageStates:{[e]:{selectedIds:[this.shape.id]}}}}});d(this,"complete",()=>{let{currentPageId:e}=this.app,t={},n={},r=[];if(Object.values(this.grid).forEach(s=>{t[s]=void 0,n[s]=this.app.getShape(s),r.push(s)}),t[this.shape.id]=this.shape,this.initialSiblings&&(t[this.shape.parentId]={children:[...this.initialSiblings,this.shape.id]},n[this.shape.parentId]={children:[...this.initialSiblings,...Object.values(this.grid)]}),r.length!==1)return{id:"grid",before:{document:{pages:{[e]:{shapes:t}},pageStates:{[e]:{selectedIds:[],hoveredId:void 0}}}},after:{document:{pages:{[e]:{shapes:n}},pageStates:{[e]:{selectedIds:r,hoveredId:void 0}}}}}});d(this,"getClone",(e,t)=>{let n=w(S({},this.shape),{id:Iu.uniqueId(),point:e});return t||n.type==="sticky"&&(n.text=""),n});this.shape=this.app.getShape(t),this.grid["0_0"]=this.shape.id,this.bounds=this.app.getShapeBounds(t),this.initialSelectedIds=[...this.app.selectedIds],this.shape.parentId!==this.app.currentPageId&&(this.initialSiblings=(n=this.app.getShape(this.shape.parentId).children)==null?void 0:n.filter(r=>r!==this.shape.id))}};import{Vec as rl}from"telva-vec";var vs=class extends Le{constructor(e,t,n,r="move_handle"){super(e);d(this,"type","handle");d(this,"performanceMode");d(this,"status","translatingHandle");d(this,"commandId");d(this,"topLeft");d(this,"shiftKey",!1);d(this,"initialShape");d(this,"handleId");d(this,"start",()=>{});d(this,"update",()=>{var u,h;let{initialShape:e,app:{currentPageId:t,currentPoint:n}}=this,r=this.app.getShape(e.id);if(r.isLocked)return;let s=r.handles,l=this.handleId,a=rl.sub(n,s[l].point),c={[l]:w(S({},s[l]),{point:rl.sub(rl.add(s[l].point,a),r.point)})},p=(h=(u=B.getShapeUtil(r)).onHandleChange)==null?void 0:h.call(u,r,c);if(!!p)return{document:{pages:{[t]:{shapes:{[r.id]:p}}}}}});d(this,"cancel",()=>{let{initialShape:e,app:{currentPageId:t}}=this;return{document:{pages:{[t]:{shapes:{[e.id]:e}}}}}});d(this,"complete",()=>{let{initialShape:e,app:{currentPageId:t}}=this;return{id:this.commandId,before:{document:{pages:{[t]:{shapes:{[e.id]:e}}}}},after:{document:{pages:{[t]:{shapes:{[e.id]:B.onSessionComplete(this.app.getShape(this.initialShape.id))}}}}}}});let{originPoint:s}=e;this.topLeft=[...s],this.handleId=n,this.initialShape=this.app.getShape(t),this.commandId=r}};import{Utils as Ts}from"telva-core";import{Vec as Ru}from"telva-vec";var xs=class extends Le{constructor(e){super(e);d(this,"type","rotate");d(this,"status","transforming");d(this,"performanceMode");d(this,"delta",[0,0]);d(this,"commonBoundsCenter");d(this,"initialAngle");d(this,"initialShapes");d(this,"changes",{});d(this,"start",()=>{});d(this,"update",()=>{let{commonBoundsCenter:e,initialShapes:t,app:{currentPageId:n,currentPoint:r,shiftKey:s}}=this,l={},a=Ru.angle(e,r)-this.initialAngle;return s&&(a=Ts.snapAngleToSegments(a,24)),t.forEach(({center:c,shape:p})=>{let{rotation:u=0}=p,h=0;s&&(h=Ts.snapAngleToSegments(u,24)-u);let g=B.getRotatedShapeMutation(p,c,e,s?a+h:a);g&&(l[p.id]=g)}),this.changes=l,{document:{pages:{[n]:{shapes:l}}}}});d(this,"cancel",()=>{let{initialShapes:e,app:{currentPageId:t}}=this,n={};return e.forEach(({shape:r})=>n[r.id]=r),{document:{pages:{[t]:{shapes:n}}}}});d(this,"complete",()=>{let{initialShapes:e,app:{currentPageId:t}}=this,n={},r=this.changes;return e.forEach(({shape:{id:s,point:l,rotation:a,handles:c}})=>{n[s]={point:l,rotation:a,handles:c}}),{id:"rotate",before:{document:{pages:{[t]:{shapes:n}}}},after:{document:{pages:{[t]:{shapes:r}}}}}});let{app:{currentPageId:t,pageState:n,originPoint:r}}=this,s=B.getSelectedBranchSnapshot(e.state,t).filter(l=>!l.isLocked);if(s.length===0)throw Error("No selected shapes!");if(e.rotationInfo.selectedIds===n.selectedIds){if(e.rotationInfo.center===void 0)throw Error("We should have a center for rotation!");this.commonBoundsCenter=e.rotationInfo.center}else this.commonBoundsCenter=Ts.getBoundsCenter(Ts.getCommonBounds(s.map(B.getBounds))),e.rotationInfo.selectedIds=n.selectedIds,e.rotationInfo.center=this.commonBoundsCenter;this.initialShapes=s.filter(l=>l.children===void 0).map(l=>({shape:l,center:this.app.getShapeUtil(l).getCenter(l)})),this.initialAngle=Ru.angle(this.commonBoundsCenter,r)}};import{TLBoundsCorner as Ov,Utils as vt}from"telva-core";import{Vec as Jo}from"telva-vec";var ks=class extends Le{constructor(e,t=Ov.BottomRight,n=!1){super(e);this.transformType=t;this.isCreate=n;d(this,"type","transform");d(this,"performanceMode");d(this,"status","transforming");d(this,"scaleX",1);d(this,"scaleY",1);d(this,"initialShapes");d(this,"initialShapeIds");d(this,"initialSelectedIds");d(this,"shapeBounds");d(this,"hasUnlockedShapes");d(this,"isAllAspectRatioLocked");d(this,"initialCommonBounds");d(this,"snapInfo",{state:"empty"});d(this,"prevPoint",[0,0]);d(this,"speed",1);d(this,"start",()=>{this.snapInfo={state:"ready",bounds:this.app.shapes.filter(e=>!this.initialShapeIds.includes(e.id)).map(e=>vt.getBoundsWithCenter(B.getRotatedBounds(e)))}});d(this,"update",()=>{let{transformType:e,shapeBounds:t,initialCommonBounds:n,isAllAspectRatioLocked:r,app:{currentPageId:s,pageState:{camera:l},viewport:a,currentPoint:c,previousPoint:p,originPoint:u,shiftKey:h,altKey:g,metaKey:m,currentGrid:f,settings:{isSnapping:v,showGrid:b}}}=this,T={},y=g?Jo.mul(Jo.sub(c,u),2):Jo.sub(c,u),x=vt.getTransformedBoundingBox(n,e,y,0,h||r);g&&(x=S(S({},x),vt.centerBounds(x,vt.getBoundsCenter(n)))),b&&(x=S(S({},x),vt.snapBoundsToGrid(x,f)));let k=Jo.dist(c,p)-this.speed;this.speed=this.speed+k*(k>1?.5:.15);let R=[];if((v&&!m||!v&&m)&&this.speed*l.zoom<10&&this.snapInfo.state==="ready"){let C=vt.getSnapPoints(vt.getBoundsWithCenter(x),this.snapInfo.bounds.filter(E=>vt.boundsContain(a,E)||vt.boundsCollide(a,E)),5/l.zoom);C&&(R=C.snapLines,x=vt.getTransformedBoundingBox(n,e,Jo.sub(y,C.offset),0,h||r))}return this.scaleX=x.scaleX,this.scaleY=x.scaleY,t.forEach(({initialShape:C,initialShapeBounds:E,transformOrigin:M})=>{let L=vt.getRelativeTransformedBoundingBox(x,n,E,this.scaleX<0,this.scaleY<0);b&&(L=vt.snapBoundsToGrid(L,f));let A=B.transform(this.app.getShape(C.id),L,{type:this.transformType,initialShape:C,scaleX:this.scaleX,scaleY:this.scaleY,transformOrigin:M});T[C.id]=A}),{appState:{snapLines:R},document:{pages:{[s]:{shapes:T}}}}});d(this,"cancel",()=>{let{shapeBounds:e,app:{currentPageId:t}}=this,n={};return this.isCreate?e.forEach(r=>n[r.initialShape.id]=void 0):e.forEach(r=>n[r.initialShape.id]=r.initialShape),{appState:{snapLines:[]},document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:this.isCreate?[]:e.map(r=>r.initialShape.id)}}}}});d(this,"complete",()=>{let{isCreate:e,shapeBounds:t,hasUnlockedShapes:n,app:{currentPageId:r}}=this;if(!n)return;if(this.isCreate&&Jo.dist(this.app.originPoint,this.app.currentPoint)<2)return this.cancel();let s={},l={},a,c;return e?(a=[],c=[],t.forEach(({initialShape:p})=>{s[p.id]=void 0,l[p.id]=this.app.getShape(p.id)})):(a=this.initialSelectedIds,c=this.initialSelectedIds,t.forEach(({initialShape:p})=>{s[p.id]=p,l[p.id]=this.app.getShape(p.id)})),{id:"transform",before:{appState:{snapLines:[]},document:{pages:{[r]:{shapes:s}},pageStates:{[r]:{selectedIds:a,hoveredId:void 0,editingId:void 0}}}},after:{appState:{snapLines:[]},document:{pages:{[r]:{shapes:l}},pageStates:{[r]:{selectedIds:c,hoveredId:void 0,editingId:void 0}}}}}});this.initialSelectedIds=[...this.app.selectedIds],this.app.rotationInfo.selectedIds=[...this.initialSelectedIds],this.initialShapes=B.getSelectedBranchSnapshot(this.app.state,this.app.currentPageId).filter(a=>!a.isLocked),this.initialShapeIds=this.initialShapes.map(a=>a.id),this.hasUnlockedShapes=this.initialShapes.length>0,this.isAllAspectRatioLocked=this.initialShapes.every(a=>a.isAspectRatioLocked||B.getShapeUtil(a).isAspectRatioLocked);let r=Object.fromEntries(this.initialShapes.map(a=>[a.id,B.getBounds(a)])),s=Object.values(r);this.initialCommonBounds=vt.getCommonBounds(s);let l=vt.getBoundsFromPoints(s.map(vt.getBoundsCenter));this.shapeBounds=this.initialShapes.map(a=>{let c=r[a.id],p=vt.getBoundsCenter(c),u=(p[0]-l.minX)/l.width,h=(p[1]-l.minY)/l.height;return{initialShape:a,initialShapeBounds:c,transformOrigin:[u,h]}})}};import{Utils as En}from"telva-core";import{Vec as Po}from"telva-vec";var Cs=class extends Le{constructor(e,t,n,r=!1){super(e);d(this,"type","transformSingle");d(this,"status","transforming");d(this,"performanceMode");d(this,"transformType");d(this,"scaleX",1);d(this,"scaleY",1);d(this,"isCreate");d(this,"initialShape");d(this,"initialShapeBounds");d(this,"initialCommonBounds");d(this,"snapInfo",{state:"empty"});d(this,"prevPoint",[0,0]);d(this,"speed",1);d(this,"start",()=>{this.snapInfo={state:"ready",bounds:this.app.shapes.filter(e=>e.id!==this.initialShape.id).map(e=>En.getBoundsWithCenter(B.getRotatedBounds(e)))}});d(this,"update",()=>{let{transformType:e,initialShape:t,initialShapeBounds:n,app:{settings:{isSnapping:r,showGrid:s},currentPageId:l,pageState:{camera:a},viewport:c,currentPoint:p,previousPoint:u,originPoint:h,currentGrid:g,shiftKey:m,altKey:f,metaKey:v}}=this;if(t.isLocked)return;let b={},T=f?Po.mul(Po.sub(p,h),2):Po.sub(p,h),y=this.app.getShape(t.id),x=B.getShapeUtil(y),I=En.getTransformedBoundingBox(n,e,T,y.rotation,m||y.isAspectRatioLocked||x.isAspectRatioLocked);f&&(I=S(S({},I),En.centerBounds(I,En.getBoundsCenter(n)))),s&&(I=S(S({},I),En.snapBoundsToGrid(I,g)));let R=Po.dist(p,u)-this.speed;this.speed=this.speed+R*(R>1?.5:.15);let C=[];if((r&&!v||!r&&v)&&!t.rotation&&this.speed*a.zoom<10&&this.snapInfo.state==="ready"){let M=En.getSnapPoints(En.getBoundsWithCenter(I),this.snapInfo.bounds.filter(L=>En.boundsContain(c,L)||En.boundsCollide(c,L)),5/a.zoom);M&&(C=M.snapLines,I=En.getTransformedBoundingBox(n,e,Po.sub(T,M.offset),y.rotation,m||y.isAspectRatioLocked||x.isAspectRatioLocked))}let E=B.getShapeUtil(y).transformSingle(y,I,{initialShape:t,type:this.transformType,scaleX:I.scaleX,scaleY:I.scaleY,transformOrigin:[.5,.5]});return E&&(b[y.id]=E),s&&E&&E.point&&(E.point=Po.snap(E.point,g)),{appState:{snapLines:C},document:{pages:{[l]:{shapes:b}}}}});d(this,"cancel",()=>{let{initialShape:e,app:{currentPageId:t}}=this,n={};return this.isCreate?n[e.id]=void 0:n[e.id]=e,{appState:{snapLines:[]},document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:this.isCreate?[]:[e.id]}}}}});d(this,"complete",()=>{let{initialShape:e,app:{currentPageId:t}}=this;if(e.isLocked)return;if(this.isCreate&&Po.dist(this.app.originPoint,this.app.currentPoint)<2)return this.cancel();let n={},r={};return n[e.id]=this.isCreate?void 0:e,r[e.id]=B.onSessionComplete(this.app.getShape(e.id)),{id:"transform_single",before:{appState:{snapLines:[]},document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:this.isCreate?[]:[e.id],editingId:void 0,hoveredId:void 0}}}},after:{appState:{snapLines:[]},document:{pages:{[t]:{shapes:r}},pageStates:{[t]:{selectedIds:[e.id],editingId:void 0,hoveredId:void 0}}}}}});this.isCreate=r,this.transformType=n;let s=this.app.getShape(t);this.initialShape=s,this.initialShapeBounds=B.getBounds(s),this.initialCommonBounds=B.getRotatedBounds(s),this.app.rotationInfo.selectedIds=[s.id]}};import{Utils as Wt}from"telva-core";import{Vec as ze}from"telva-vec";var ws=class extends Le{constructor(e,t=!1,n=!1){super(e);d(this,"performanceMode");d(this,"type","translate");d(this,"status","translating");d(this,"delta",[0,0]);d(this,"prev",[0,0]);d(this,"prevPoint",[0,0]);d(this,"speed",1);d(this,"cloneInfo",{state:"empty"});d(this,"snapInfo",{state:"empty"});d(this,"snapLines",[]);d(this,"isCloning",!1);d(this,"isCreate");d(this,"link");d(this,"initialIds");d(this,"hasUnlockedShapes");d(this,"initialSelectedIds");d(this,"initialCommonBounds");d(this,"initialShapes");d(this,"initialParentChildren");d(this,"bindingsToDelete");d(this,"start",()=>{let{bindingsToDelete:e,initialIds:t,app:{currentPageId:n,page:r}}=this,s=[],l=[];if(Object.values(r.shapes).forEach(p=>{let u=Wt.getBoundsWithCenter(B.getRotatedBounds(p));s.push(u),t.has(p.id)||l.push(u)}),this.snapInfo={state:"ready",bounds:s,others:l},e.length===0)return;let a={},c={};return e.forEach(p=>{a[p.id]=void 0;let u=this.app.getShape(p.fromId);c[p.fromId]={handles:w(S({},u.handles),{[p.handleId]:w(S({},u.handles[p.handleId]),{bindingId:void 0})})}}),{document:{pages:{[n]:{bindings:a,shapes:c}}}}});d(this,"update",()=>{let{initialParentChildren:e,initialShapes:t,initialCommonBounds:n,bindingsToDelete:r,app:{pageState:{camera:s},settings:{isSnapping:l,showGrid:a},currentPageId:c,viewport:p,selectedIds:u,currentPoint:h,previousPoint:g,originPoint:m,altKey:f,shiftKey:v,metaKey:b,currentGrid:T}}=this,y={},x={},I={},k=ze.sub(h,m),R=!1;this.isCreate||(f&&!this.isCloning?(this.isCloning=!0,R=!0):!f&&this.isCloning&&(this.isCloning=!1,R=!0)),v&&(Math.abs(k[0])<Math.abs(k[1])?k[0]=0:k[1]=0);let E=ze.dist(h,g)-this.speed;if(this.speed=this.speed+E*(E>1?.5:.15),this.snapLines=[],(l&&!b||!l&&b)&&this.speed*s.zoom<10&&this.snapInfo.state==="ready"){let M=Wt.getSnapPoints(Wt.getBoundsWithCenter(a?Wt.snapBoundsToGrid(Wt.translateBounds(n,k),T):Wt.translateBounds(n,k)),(this.isCloning?this.snapInfo.bounds:this.snapInfo.others).filter(L=>Wt.boundsContain(p,L)||Wt.boundsCollide(p,L)),5/s.zoom);M&&(this.snapLines=M.snapLines,k=ze.sub(k,M.offset))}if(this.prev=k,this.isCloning)if(R){if(this.cloneInfo.state==="empty"&&this.createCloneInfo(),this.cloneInfo.state==="empty")throw Error;let{clones:M,clonedBindings:L}=this.cloneInfo;this.isCloning=!0,r.forEach(A=>y[A.id]=A),t.forEach(A=>x[A.id]={point:A.point}),M.forEach(A=>{var K;if(x[A.id]=S({},A),A.parentId!==c&&!u.includes(A.parentId)){let re=((K=x[A.parentId])==null?void 0:K.children)||e[A.parentId];re.includes(A.id)||(x[A.parentId]=w(S({},x[A.parentId]),{children:[...re,A.id]}))}});for(let A of L)y[A.id]=A;I.selectedIds=M.map(A=>A.id),M.forEach(A=>{x[A.id]=w(S({},A),{point:a?ze.snap(ze.toFixed(ze.add(A.point,k)),T):ze.toFixed(ze.add(A.point,k))})})}else{if(this.cloneInfo.state==="empty")throw Error;let{clones:M}=this.cloneInfo;M.forEach(L=>{x[L.id]={point:a?ze.snap(ze.toFixed(ze.add(L.point,k)),T):ze.toFixed(ze.add(L.point,k))}})}else if(R){if(this.cloneInfo.state==="empty")throw Error;let{clones:M,clonedBindings:L}=this.cloneInfo;this.isCloning=!1,r.forEach(A=>y[A.id]=void 0),M.forEach(A=>{A.parentId!==c&&(x[A.parentId]=w(S({},x[A.parentId]),{children:e[A.parentId]}))}),M.forEach(A=>x[A.id]=void 0),t.forEach(A=>{x[A.id]={point:a?ze.snap(ze.toFixed(ze.add(A.point,k)),T):ze.toFixed(ze.add(A.point,k))}});for(let A of L)y[A.id]=void 0;I.selectedIds=t.map(A=>A.id)}else t.forEach(M=>{x[M.id]={point:a?ze.snap(ze.toFixed(ze.add(M.point,k)),T):ze.toFixed(ze.add(M.point,k))}});return{appState:{snapLines:this.snapLines},document:{pages:{[c]:{shapes:x,bindings:y}},pageStates:{[c]:I}}}});d(this,"cancel",()=>{let{initialShapes:e,initialSelectedIds:t,bindingsToDelete:n,app:{currentPageId:r}}=this,s={},l={},a={editingId:void 0,hoveredId:void 0};if(this.isCreate?(e.forEach(({id:c})=>l[c]=void 0),a.selectedIds=[]):(e.forEach(({id:c,point:p,handles:u})=>l[c]=u?w(S({},l[c]),{point:p,handles:u}):w(S({},l[c]),{point:p})),a.selectedIds=t,n.forEach(c=>{s[c.id]=c})),this.cloneInfo.state==="ready"){let{clones:c,clonedBindings:p}=this.cloneInfo;c.forEach(u=>l[u.id]=void 0),p.forEach(u=>s[u.id]=void 0)}return{appState:{snapLines:[]},document:{pages:{[r]:{shapes:l,bindings:s}},pageStates:{[r]:a}}}});d(this,"complete",()=>{let{initialShapes:e,initialParentChildren:t,bindingsToDelete:n,app:{currentPageId:r}}=this,s={},l={},a={},c={};if(this.isCloning){if(this.cloneInfo.state==="empty"&&this.createCloneInfo(),this.cloneInfo.state!=="ready")throw Error;let{clones:p,clonedBindings:u}=this.cloneInfo;p.forEach(h=>{l[h.id]=void 0,c[h.id]=this.app.getShape(h.id),h.parentId!==r&&(l[h.parentId]=w(S({},l[h.parentId]),{children:t[h.parentId]}),c[h.parentId]=w(S({},c[h.parentId]),{children:this.app.getShape(h.parentId).children}))}),u.forEach(h=>{s[h.id]=void 0,a[h.id]=this.app.getBinding(h.id)})}else e.forEach(p=>{l[p.id]=this.isCreate?void 0:w(S({},l[p.id]),{point:p.point}),c[p.id]=S(S({},c[p.id]),this.isCreate?this.app.getShape(p.id):{point:this.app.getShape(p.id).point})});return n.forEach(p=>{var u,h,g,m,f;s[p.id]=p,l[p.fromId]=w(S({},l[p.fromId]),{id:p.fromId,handles:w(S({},(u=l[p.fromId])==null?void 0:u.handles),{[p.handleId]:w(S({},(g=(h=l[p.fromId])==null?void 0:h.handles)==null?void 0:g[p.handleId]),{bindingId:p.id})})}),c[p.fromId]=w(S({},c[p.fromId]),{id:p.fromId,handles:w(S({},c[p.fromId].handles),{[p.handleId]:w(S({},(f=(m=c[p.fromId])==null?void 0:m.handles)==null?void 0:f[p.handleId]),{bindingId:void 0})})})}),n.forEach(p=>a[p.id]=void 0),{id:"translate",before:{appState:{snapLines:[]},document:{pages:{[r]:{shapes:l,bindings:s}},pageStates:{[r]:{selectedIds:this.isCreate?[]:[...this.initialSelectedIds]}}}},after:{appState:{snapLines:[]},document:{pages:{[r]:{shapes:c,bindings:a}},pageStates:{[r]:{selectedIds:[...this.app.selectedIds]}}}}}});d(this,"createCloneInfo",()=>{let{initialShapes:e,initialParentChildren:t,app:{selectedIds:n,currentPageId:r,page:s}}=this,l={},a={},c=[],p=[];e.forEach(h=>{let g=Wt.uniqueId();t[g]=t[h.id],l[h.id]=g;let m=w(S({},Wt.deepClone(h)),{id:g,parentId:h.parentId,childIndex:B.getChildIndexAbove(this.app.state,h.id,r)});if(m.type==="video"){let f=document.getElementById(h.id+"_video");f&&(m.currentTime=(f.currentTime+16)%f.duration)}p.push(m)}),p.forEach(h=>{h.children!==void 0&&(h.children=h.children.map(g=>l[g]))}),p.forEach(h=>{n.includes(h.parentId)&&(h.parentId=l[h.parentId])});let u=new Set(Object.keys(l));Object.values(s.bindings).filter(h=>u.has(h.fromId)||u.has(h.toId)).forEach(h=>{if(u.has(h.fromId)&&u.has(h.toId)){let g=Wt.uniqueId(),m=w(S({},Wt.deepClone(h)),{id:g,fromId:l[h.fromId]||h.fromId,toId:l[h.toId]||h.toId});a[h.id]=g,c.push(m)}}),p.forEach(h=>{if(h.handles&&h.handles)for(let g in h.handles){let m=h.handles[g];m.bindingId=m.bindingId?a[m.bindingId]:void 0}}),p.forEach(h=>{if(s.shapes[h.id])throw Error("uh oh, we didn't clone correctly")}),this.cloneInfo={state:"ready",clones:p,cloneMap:l,clonedBindings:c}});this.isCreate=t,this.link=n;let{currentPageId:r,selectedIds:s,page:l}=this.app;this.initialSelectedIds=[...s];let a=(n?B.getLinkedShapeIds(this.app.state,r,n,!1):s).map(p=>this.app.getShape(p)).filter(p=>!p.isLocked),c=new Set(a.map(p=>p.id));this.hasUnlockedShapes=a.length>0,this.initialShapes=Array.from(new Set(a.filter(p=>!c.has(p.parentId)).flatMap(p=>p.children?[p,...p.children.map(u=>this.app.getShape(u))]:[p])).values()),this.initialIds=new Set(this.initialShapes.map(p=>p.id)),this.bindingsToDelete=[],Object.values(l.bindings).filter(p=>this.initialIds.has(p.fromId)||this.initialIds.has(p.toId)).forEach(p=>{this.initialIds.has(p.fromId)&&(this.initialIds.has(p.toId)||this.bindingsToDelete.push(p))}),this.initialParentChildren={},this.initialShapes.map(p=>p.parentId).filter(p=>p!==l.id).forEach(p=>{this.initialParentChildren[p]=this.app.getShape(p).children}),this.initialCommonBounds=Wt.getCommonBounds(this.initialShapes.map(B.getRotatedBounds)),this.app.rotationInfo.selectedIds=[...this.app.selectedIds]}};var $v={["arrow"]:ms,["brush"]:gs,["draw"]:fs,["erase"]:ys,["handle"]:vs,["rotate"]:xs,["transform"]:ks,["transformSingle"]:Cs,["translate"]:ws,["grid"]:bs,["edit"]:Ss},Du=i=>$v[i];import{Utils as jv}from"telva-core";import Wv from"telva-vec";import{Utils as Gv}from"telva-core";var Ae=class extends ti{constructor(e){super();this.app=e;d(this,"type","select");d(this,"previous");d(this,"status","idle");d(this,"setStatus",e=>{this.status=e,this.app.setStatus(this.status)});d(this,"onEnter",()=>{this.setStatus("idle")});d(this,"onExit",()=>{this.setStatus("idle")});d(this,"onCancel",()=>{this.status==="idle"?this.app.selectTool("select"):this.setStatus("idle"),this.app.cancelSession()});d(this,"getNextChildIndex",()=>{let{shapes:e,appState:{currentPageId:t}}=this.app;return e.length===0?1:e.filter(n=>n.parentId===t).sort((n,r)=>r.childIndex-n.childIndex)[0].childIndex+1});d(this,"onPinchStart",()=>{this.app.cancelSession(),this.setStatus("pinching")});d(this,"onPinchEnd",()=>{Gv.isMobileSafari()&&this.app.undoSelect(),this.setStatus("idle")});d(this,"onPinch",(e,t)=>{var n;this.status==="pinching"&&(isNaN(e.delta[0])||isNaN(e.delta[1])||(this.app.pinchZoom(e.point,e.delta,e.delta[2]),(n=this.onPointerMove)==null||n.call(this,e,t)))});d(this,"onKeyDown",e=>{if(e==="Escape"){this.onCancel();return}if(e==="Meta"||e==="Control"||e==="Alt"){this.app.updateSession();return}});d(this,"onKeyUp",e=>{if(e==="Meta"||e==="Control"||e==="Alt"){this.app.updateSession();return}});d(this,"onPointerMove",()=>{this.status==="creating"&&this.app.updateSession()});d(this,"onPointerUp",()=>{if(this.status==="creating"){this.app.completeSession();let{isToolLocked:e}=this.app.appState;e||this.app.selectTool("select")}this.setStatus("idle")})}};var Qo=class extends Ae{constructor(){super(...arguments);d(this,"type","arrow");d(this,"onPointerDown",()=>{if(this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=jv.uniqueId(),c=Dr.create({id:a,parentId:r,childIndex:l,point:n?Wv.snap(e,t):e,style:S({},s)});this.app.patchCreate([c]),this.app.startSession("arrow",c.id,"end",!0),this.setStatus("creating")})}};import{Utils as Nv}from"telva-core";var tr=class extends Ae{constructor(){super(...arguments);d(this,"type","draw");d(this,"lastShapeId");d(this,"onEnter",()=>{this.lastShapeId=void 0});d(this,"onCancel",()=>{switch(this.status){case"idle":{this.app.selectTool("select");break}default:{this.setStatus("idle");break}}this.app.cancelSession()});d(this,"onPointerDown",e=>{if(this.status!=="idle"||this.app.readOnly)return;let{currentPoint:t,appState:{currentPageId:n,currentStyle:r}}=this.app,s=this.lastShapeId&&this.app.getShape(this.lastShapeId);if(e.shiftKey&&s)this.app.startSession("draw",s.id),this.setStatus("extending");else{let l=this.getNextChildIndex(),a=Nv.uniqueId(),c=Ia.create({id:a,parentId:n,childIndex:l,point:t,style:S({},r)});this.lastShapeId=a,this.app.patchCreate([c]),this.app.startSession("draw",a),this.setStatus("creating")}});d(this,"onPointerMove",()=>{if(!this.app.readOnly)switch(this.status){case"extending":case"creating":this.app.updateSession()}});d(this,"onPointerUp",()=>{this.app.completeSession(),this.setStatus("idle")})}};import{TLBoundsCorner as Uv,Utils as Kv}from"telva-core";import _v from"telva-vec";var nr=class extends Ae{constructor(){super(...arguments);d(this,"type","ellipse");d(this,"onPointerDown",()=>{if(this.app.readOnly||this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=Kv.uniqueId(),c=wa.create({id:a,parentId:r,childIndex:l,point:n?_v.snap(e,t):e,style:S({},s)});this.app.patchCreate([c]),this.app.startSession("transformSingle",c.id,Uv.BottomRight,!0),this.setStatus("creating")})}};import Yv from"telva-vec";var or=class extends Ae{constructor(){super(...arguments);d(this,"type","erase");d(this,"status","idle");d(this,"onPointerDown",()=>{this.app.readOnly||this.status==="idle"&&this.setStatus("pointing")});d(this,"onPointerMove",e=>{if(!this.app.readOnly)switch(this.status){case"pointing":{Yv.dist(e.origin,e.point)>3&&(this.app.startSession("erase"),this.app.updateSession(),this.setStatus("erasing"));break}case"erasing":this.app.updateSession()}});d(this,"onPointerUp",()=>{if(!this.app.readOnly){switch(this.status){case"pointing":{let e=this.app.shapes.filter(t=>!t.isLocked).filter(t=>this.app.getShapeUtil(t).hitTestPoint(t,this.app.currentPoint)).flatMap(t=>t.children?[t.id,...t.children]:t.id);this.app.delete(e);break}case"erasing":this.app.completeSession()}this.setStatus("idle")}});d(this,"onCancel",()=>{this.status==="idle"?this.previous?this.app.selectTool(this.previous):this.app.selectTool("select"):this.setStatus("idle"),this.app.cancelSession()})}};import{Utils as Xv}from"telva-core";import Zv from"telva-vec";var rr=class extends Ae{constructor(){super(...arguments);d(this,"type","line");d(this,"onPointerDown",()=>{if(this.app.readOnly||this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=Xv.uniqueId(),c=Dr.create({id:a,parentId:r,childIndex:l,point:n?Zv.snap(e,t):e,decorations:{start:void 0,end:void 0},style:S({},s)});this.app.patchCreate([c]),this.app.startSession("arrow",c.id,"end",!0),this.setStatus("creating")})}};import{Utils as qv}from"telva-core";import mn from"telva-vec";var Jv=4,ir=class extends Ae{constructor(){super(...arguments);d(this,"type","pen");d(this,"currentShapeId");d(this,"downPoint");d(this,"currentSegmentIdx",0);d(this,"onEnter",()=>{this.currentShapeId=void 0,this.downPoint=void 0,this.currentSegmentIdx=0,this.setStatus("idle")});d(this,"onExit",()=>{this.currentShapeId&&this.finishShape(),this.currentShapeId=void 0,this.downPoint=void 0,this.currentSegmentIdx=0,this.setStatus("idle")});d(this,"onCancel",()=>{this.currentShapeId&&(this.app.delete([this.currentShapeId]),this.currentShapeId=void 0),this.downPoint=void 0,this.currentSegmentIdx=0,this.setStatus("idle")});d(this,"onPointerDown",e=>{if(this.app.readOnly||e.spaceKey)return;let t=this.app.getPagePoint(e.point);if(this.downPoint=t,this.status==="idle"||!this.currentShapeId){this.startNewShape(t),this.setStatus("placing");return}if(this.status==="drawing"){if(this.isNearFirstNode(t)){let r=this.getShape();if(r&&r.segments.length>=2){let{segments:s,offset:l}=ma(r.segments,!0);this.app.updateShapes({id:r.id,point:mn.add(r.point,l),segments:s,isClosed:!0,isComplete:!0,isPlacingHandle:!1}),this.app.select(r.id),this.currentShapeId=void 0,this.downPoint=void 0,this.setStatus("idle");return}}let n=this.toLocal(t);this.addSegment(n),this.setPreview(t,!0),this.setStatus("placing")}});d(this,"onPointerMove",e=>{if(this.app.readOnly||e.spaceKey||!this.currentShapeId)return;let t=this.app.getPagePoint(e.point);if(this.status==="drawing"){this.setPreview(t,!1);return}if(this.status==="placing"&&this.downPoint)if(this.setPreview(t,!0),mn.dist(t,this.downPoint)>Jv){let r=this.getShape();if(!r||r.segments.length===0)return;let s=r.segments[r.segments.length-1].point,l=mn.sub(this.downPoint,r.point),a=mn.sub(mn.sub(t,r.point),l),c=mn.add(s,a),p=Cr(s,c);this.updateLastSegmentHandles(p,c)}else this.updateLastSegmentHandles(void 0,void 0)});d(this,"onPointerUp",e=>{if(!this.app.readOnly&&this.status==="placing"){let t=this.app.getPagePoint(e.point);this.setPreview(t,!1),this.downPoint=void 0,this.setStatus("drawing")}});d(this,"onDoubleClickCanvas",()=>{if(!this.app.readOnly&&this.currentShapeId){let e=this.getShape();if(e&&e.segments.length>1){let t=e.segments.slice(0,-1);this.patchCurrentShape({segments:t})}this.finishShape(),this.setStatus("idle")}});d(this,"onKeyDown",(e,t,n)=>{switch(e){case"Escape":{this.onCancel();break}case"Enter":{this.currentShapeId&&(this.finishShape(),this.setStatus("idle"));break}}})}getShape(){if(!!this.currentShapeId)return this.app.getShape(this.currentShapeId)}get currentSegments(){var e,t;return(t=(e=this.getShape())==null?void 0:e.segments)!=null?t:[]}patchCurrentShape(e){let t=this.getShape();!t||this.app.patchState({document:{pages:{[this.app.currentPageId]:{shapes:{[t.id]:e}}}}})}setPreview(e,t){let n=this.getShape();if(!n)return;let r=mn.sub(e,n.point);this.patchCurrentShape({previewPoint:r,isPlacingHandle:t})}startNewShape(e){let{appState:{currentPageId:t,currentStyle:n}}=this.app,r=qv.uniqueId(),s=this.getNextChildIndex(),l={point:[0,0]},a={id:r,type:"pen",name:"Pen",parentId:t,childIndex:s,point:e,rotation:0,style:S({},n),segments:[l],isClosed:!1,isComplete:!1,previewPoint:[0,0],isPlacingHandle:!0};this.currentShapeId=r,this.currentSegmentIdx=0,this.app.patchCreate([a])}addSegment(e,t,n){let r=this.getShape();if(!r)return;let s={point:e,cp1:t,cp2:n},l=[...r.segments,s];this.currentSegmentIdx=l.length-1,this.patchCurrentShape({segments:l})}updateLastSegmentHandles(e,t){let n=this.getShape();if(!n||n.segments.length===0)return;let r=[...n.segments],s=r[r.length-1];r[r.length-1]=w(S({},s),{cp1:e,cp2:t}),this.patchCurrentShape({segments:r})}toLocal(e){let t=this.getShape();return t?mn.sub(e,t.point):e}isNearFirstNode(e){var r;let t=this.getShape();if(!t||t.segments.length<2)return!1;let n=mn.add(t.point,t.segments[0].point);return mn.dist(e,n)<=10/((r=this.app.zoom)!=null?r:1)}finishShape(){let e=this.currentShapeId;if(!e)return;let t=this.app.getShape(e);if(!t)return;let{segments:n,offset:r}=ma(t.segments,t.isClosed),s=mn.add(t.point,r);this.app.updateShapes({id:e,point:s,segments:n,isComplete:!0,isPlacingHandle:!1}),this.app.select(e),this.currentShapeId=void 0,this.downPoint=void 0,this.currentSegmentIdx=0}};import{TLBoundsCorner as Qv,Utils as eT}from"telva-core";import tT from"telva-vec";var sr=class extends Ae{constructor(){super(...arguments);d(this,"type","rectangle");d(this,"onPointerDown",()=>{if(this.app.readOnly||this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=eT.uniqueId(),c=ka.create({id:a,parentId:r,childIndex:l,point:n?tT.snap(e,t):e,style:S({},s)});this.app.patchCreate([c]),this.app.startSession("transformSingle",c.id,Qv.BottomRight,!0),this.setStatus("creating")})}};import{Utils as _r}from"telva-core";import Yn from"telva-vec";var ar=class extends Ae{constructor(){super(...arguments);d(this,"type","select");d(this,"pointedId");d(this,"selectedGroupId");d(this,"pointedHandleId");d(this,"pointedBoundsHandle");d(this,"pointedLinkHandleId");d(this,"onEnter",()=>{this.setStatus("idle")});d(this,"onExit",()=>{this.setStatus("idle")});d(this,"clonePaint",e=>{if(this.app.selectedIds.length===0)return;let t=this.app.selectedIds.map(p=>this.app.getShape(p)),n=_r.expandBounds(_r.getCommonBounds(t.map(B.getBounds)),16),r=_r.getBoundsCenter(n),s=[n.width,n.height],l=[r[0]+s[0]*Math.floor((e[0]+s[0]/2-r[0])/s[0]),r[1]+s[1]*Math.floor((e[1]+s[1]/2-r[1])/s[1])],a=_r.centerBounds(n,l);this.app.shapes.some(p=>B.getShapeUtil(p).hitTestBounds(p,a))||this.app.duplicate(this.app.selectedIds,l)});d(this,"getShapeClone",(e,t)=>{let n=this.app.getShape(e),r=B.getShapeUtil(n);if(r.canClone){let s=r.getBounds(n),l=r.getCenter(n),a={top:[s.minX,s.minY-(s.height+32)],right:[s.maxX+32,s.minY],bottom:[s.minX,s.maxY+32],left:[s.minX-(s.width+32),s.minY],topLeft:[s.minX-(s.width+32),s.minY-(s.height+32)],topRight:[s.maxX+32,s.minY-(s.height+32)],bottomLeft:[s.minX-(s.width+32),s.maxY+32],bottomRight:[s.maxX+32,s.maxY+32]}[t];if(n.rotation!==0){let u=Yn.add(a,[s.width/2,s.height/2]),h=Yn.rotWith(u,l,n.rotation||0);a=Yn.sub(h,[s.width/2,s.height/2])}let c=_r.uniqueId(),p=w(S({},n),{id:c,point:a});return p.type==="sticky"&&(p.text=""),p}});d(this,"onCancel",()=>{this.app.session?this.app.cancelSession():this.selectNone(),this.setStatus("idle")});d(this,"onKeyDown",(e,t,n)=>{switch(e){case"Escape":{this.onCancel();break}case"Tab":{if(this.app.readOnly)return;if(!this.app.pageState.editingId&&this.status==="idle"&&this.app.selectedIds.length===1){let[r]=this.app.selectedIds,s=this.getShapeClone(r,"right");s&&(this.app.createShapes(s),this.setStatus("idle"),s.type==="sticky"&&(this.app.select(s.id),this.app.setEditingId(s.id)))}break}case"Meta":case"Control":case"Alt":{this.app.updateSession();break}case"Enter":{if(this.app.readOnly)return;let{pageState:r}=this.app;r.selectedIds.length===1&&!r.editingId&&(this.app.setEditingId(r.selectedIds[0]),n.preventDefault())}}});d(this,"onKeyUp",(e,t)=>{if(this.status==="clonePainting"&&!(t.altKey&&t.shiftKey)){this.setStatus("idle");return}if(e==="Meta"||e==="Control"||e==="Alt"){this.app.updateSession();return}});d(this,"onPointerMove",()=>{let{originPoint:e,currentPoint:t}=this.app;if(this.app.readOnly&&this.app.isPointing){this.app.session?this.app.updateSession():Yn.dist(e,t)>3&&(this.app.startSession("brush"),this.setStatus("brushing"));return}switch(this.status){case"pointingBoundsHandle":{if(!this.pointedBoundsHandle)throw Error("No pointed bounds handle");if(Yn.dist(e,t)>3){if(this.pointedBoundsHandle==="rotate")this.setStatus("rotating"),this.app.startSession("rotate");else if(this.pointedBoundsHandle==="center"||this.pointedBoundsHandle==="left"||this.pointedBoundsHandle==="right")this.setStatus("translating"),this.app.startSession("translate",!1,this.pointedBoundsHandle);else{this.setStatus("transforming");let n=this.app.selectedIds.flatMap(r=>B.getDocumentBranch(this.app.state,r,this.app.currentPageId));n.length===1?this.app.startSession("transformSingle",n[0],this.pointedBoundsHandle):this.app.startSession("transform",this.pointedBoundsHandle)}this.app.updateSession()}break}case"pointingCanvas":{Yn.dist(e,t)>3&&(this.app.startSession("brush"),this.setStatus("brushing"));break}case"pointingClone":{Yn.dist(e,t)>3&&(this.setStatus("translatingClone"),this.app.startSession("translate"),this.app.updateSession());break}case"pointingBounds":{Yn.dist(e,t)>3&&(this.setStatus("translating"),this.app.startSession("translate"),this.app.updateSession());break}case"pointingHandle":{if(!this.pointedHandleId)throw Error("No pointed handle");if(Yn.dist(e,t)>3){this.setStatus("translatingHandle");let n=this.app.getShape(this.app.selectedIds[0]);n&&(this.pointedHandleId==="bend"?(this.app.startSession("handle",n.id,this.pointedHandleId),this.app.updateSession()):(this.app.startSession("arrow",n.id,this.pointedHandleId,!1),this.app.updateSession()))}break}case"clonePainting":{this.clonePaint(t);break}default:if(this.app.session){this.app.updateSession();break}}});d(this,"onPointerDown",(e,t)=>{if(e.target==="canvas"&&this.status==="idle"){let{currentPoint:n}=this.app;if(e.spaceKey&&t.buttons===1)return;if(this.status==="idle"&&e.altKey&&e.shiftKey){this.setStatus("clonePainting"),this.clonePaint(n);return}if(!e.shiftKey){if(this.app.onShapeBlur(),e.altKey&&this.app.selectedIds.length>0){this.app.duplicate(this.app.selectedIds,n);return}this.selectNone()}this.setStatus("pointingCanvas")}});d(this,"onPointerUp",e=>{var t;if(this.status==="translatingClone"||this.status==="pointingClone"){this.pointedId&&(this.app.completeSession(),this.app.setEditingId(this.pointedId)),this.setStatus("idle"),this.pointedId=void 0;return}if(this.status==="pointingBounds"){if(e.target==="bounds")this.selectNone();else if(this.app.isSelected(e.target))e.shiftKey?this.pointedId!==e.target&&this.deselect(e.target):this.pointedId!==e.target&&this.app.selectedIds.length>1&&this.select(e.target);else if(this.pointedId===e.target){if(this.app.getShape(e.target).isLocked)return;e.shiftKey?this.pushSelect(e.target):this.select(e.target)}}this.setStatus("idle"),this.pointedBoundsHandle=void 0,this.pointedHandleId=void 0,this.pointedId=void 0,((t=this.app.session)==null?void 0:t.type)!=="edit"&&this.app.completeSession()});d(this,"onDoubleClickCanvas",()=>{this.app.readOnly});d(this,"onPointShape",(e,t)=>{if(e.spaceKey&&t.buttons===1||this.app.getShape(e.target).isLocked)return;let{editingId:n,hoveredId:r}=this.app.pageState;if(n&&e.target!==n&&this.app.onShapeBlur(),(this.status==="idle"||this.status==="pointingBounds")&&e.metaKey&&e.shiftKey&&r){this.pointedId=r,this.app.isSelected(r)?this.deselect(r):(this.pushSelect(r),this.setStatus("pointingBounds"));return}if(this.status==="pointingBounds"){let{parentId:s}=this.app.getShape(e.target);this.pointedId=s===this.app.currentPageId?e.target:s;return}if(this.status==="idle"){if(this.setStatus("pointingBounds"),e.metaKey){e.shiftKey||this.selectNone(),this.app.startSession("brush"),this.setStatus("brushing");return}let s,{parentId:l}=this.app.getShape(e.target);l===this.app.currentPageId?(s=e.target,this.selectedGroupId=void 0):l===this.selectedGroupId?s=e.target:(s=l,this.selectedGroupId=void 0),this.app.isSelected(s)||(this.pointedId=s,e.shiftKey?this.pushSelect(s):this.select(s))}});d(this,"onDoubleClickShape",e=>{if(this.app.readOnly)return;let t=this.app.getShape(e.target);if(t.isLocked){this.app.select(e.target);return}B.getShapeUtil(t.type).canEdit&&(t.parentId===this.app.currentPageId||t.parentId===this.selectedGroupId)&&this.app.setEditingId(e.target),t.parentId!==this.app.currentPageId&&(this.selectedGroupId=t.parentId),this.app.select(e.target)});d(this,"onRightPointShape",e=>{this.app.isSelected(e.target)||this.app.select(e.target)});d(this,"onHoverShape",e=>{this.app.setHoveredId(e.target)});d(this,"onUnhoverShape",e=>{let{currentPageId:t}=this.app;requestAnimationFrame(()=>{t===this.app.currentPageId&&this.app.pageState.hoveredId===e.target&&this.app.setHoveredId(void 0)})});d(this,"onPointBounds",e=>{if(e.metaKey){e.shiftKey||this.selectNone(),this.app.startSession("brush"),this.setStatus("brushing");return}this.setStatus("pointingBounds")});d(this,"onRightPointBounds",(e,t)=>{t.stopPropagation()});d(this,"onReleaseBounds",()=>{(this.status==="translating"||this.status==="brushing")&&this.app.completeSession(),this.setStatus("idle")});d(this,"onPointBoundsHandle",e=>{this.pointedBoundsHandle=e.target,this.setStatus("pointingBoundsHandle")});d(this,"onDoubleClickBoundsHandle",e=>{switch(e.target){case"center":case"left":case"right":{this.app.select(...B.getLinkedShapeIds(this.app.state,this.app.currentPageId,e.target,e.shiftKey));break}default:if(this.app.selectedIds.length===1){this.app.resetBounds(this.app.selectedIds);let t=this.app.getShape(this.app.selectedIds[0]);"label"in t&&this.app.setEditingId(t.id)}}});d(this,"onReleaseBoundsHandle",()=>{this.setStatus("idle")});d(this,"onPointHandle",e=>{this.pointedHandleId=e.target,this.setStatus("pointingHandle")});d(this,"onDoubleClickHandle",e=>{if(e.target==="bend"){let{selectedIds:t}=this.app;if(t.length!==1)return;let n=this.app.getShape(t[0]);B.getShapeUtil(n.type).canEdit&&(n.parentId===this.app.currentPageId||n.parentId===this.selectedGroupId)&&this.app.setEditingId(n.id);return}this.app.toggleDecoration(e.target)});d(this,"onReleaseHandle",()=>{this.setStatus("idle")});d(this,"onShapeClone",e=>{let t=this.app.selectedIds[0],n=this.getShapeClone(t,e.target);e.target==="left"||e.target==="right"||e.target==="top"||e.target==="bottom"?n&&(this.app.createShapes(n),this.pointedId=n.id,this.setStatus("pointingClone")):(this.setStatus("gridCloning"),this.app.startSession("grid",t))})}deselect(e){this.app.select(...this.app.selectedIds.filter(t=>t!==e))}select(e){this.app.select(e)}pushSelect(e){let t=this.app.getShape(e);this.app.select(...this.app.selectedIds.filter(n=>n!==t.parentId),e)}selectNone(){this.app.selectNone()}};import{Utils as nT}from"telva-core";import Eu from"telva-vec";var lr=class extends Ae{constructor(){super(...arguments);d(this,"type","sticky");d(this,"shapeId");d(this,"onPointerDown",()=>{if(!this.app.readOnly){if(this.status==="creating"){this.setStatus("idle"),this.app.appState.isToolLocked||this.app.selectTool("select");return}if(this.status==="idle"){let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=nT.uniqueId();this.shapeId=a;let c=Ki.create({id:a,parentId:r,childIndex:l,point:n?Eu.snap(e,t):e,style:S({},s)}),p=Ki.getBounds(c);c.point=Eu.sub(c.point,[p.width/2,p.height/2]),this.app.patchCreate([c]),this.app.startSession("translate"),this.setStatus("creating")}}});d(this,"onPointerUp",()=>{this.app.readOnly||this.status==="creating"&&(this.setStatus("idle"),this.app.completeSession(),this.app.selectTool("select"),this.app.setEditingId(this.shapeId))})}};import oT from"telva-vec";var dr=class extends Ae{constructor(){super(...arguments);d(this,"type","text");d(this,"stopEditingShape",()=>{this.setStatus("idle"),this.app.appState.isToolLocked||this.app.selectTool("select")});d(this,"onKeyUp",()=>{});d(this,"onKeyDown",()=>{});d(this,"onPointerDown",()=>{if(this.status==="creating"){this.stopEditingShape();return}if(this.status==="idle"){let{currentPoint:e,currentGrid:t,settings:{showGrid:n}}=this.app;this.app.createTextShapeAtPoint(n?oT.snap(e,t):e,void 0,!0),this.setStatus("creating");return}});d(this,"onPointerUp",()=>{});d(this,"onPointShape",e=>{if(this.app.readOnly)return;let t=this.app.getShape(e.target);t.type==="text"&&(this.setStatus("idle"),this.app.setEditingId(t.id))});d(this,"onShapeBlur",()=>{this.app.readOnly||this.stopEditingShape()})}};import{TLBoundsCorner as rT,Utils as iT}from"telva-core";import sT from"telva-vec";var cr=class extends Ae{constructor(){super(...arguments);d(this,"type","triangle");d(this,"onPointerDown",()=>{if(this.app.readOnly||this.status!=="idle")return;let{currentPoint:e,currentGrid:t,settings:{showGrid:n},appState:{currentPageId:r,currentStyle:s}}=this.app,l=this.getNextChildIndex(),a=iT.uniqueId(),c=Ca.create({id:a,parentId:r,childIndex:l,point:n?sT.snap(e,t):e,style:S({},s)});this.app.patchCreate([c]),this.app.startSession("transformSingle",c.id,rT.BottomRight,!0),this.setStatus("creating")})}};var il=dt.uniqueId(),Ke=class extends ds{constructor(e,t={}){super(Ke.defaultState,e,Ke.version,(n,r,s)=>Dn(w(S({},r),{document:w(S(S({},r.document),n.document),{version:s})}),Ke.version));d(this,"callbacks",{});d(this,"tools",{select:new ar(this),erase:new or(this),["text"]:new dr(this),["draw"]:new tr(this),["ellipse"]:new nr(this),["rectangle"]:new sr(this),["triangle"]:new cr(this),["line"]:new rr(this),["arrow"]:new Qo(this),["sticky"]:new lr(this),["pen"]:new ir(this)});d(this,"currentTool",this.tools.select);d(this,"session");d(this,"readOnly",!1);d(this,"isDirty",!1);d(this,"isCreating",!1);d(this,"originPoint",[0,0]);d(this,"currentPoint",[0,0]);d(this,"previousPoint",[0,0]);d(this,"shiftKey",!1);d(this,"altKey",!1);d(this,"metaKey",!1);d(this,"ctrlKey",!1);d(this,"spaceKey",!1);d(this,"isPointing",!1);d(this,"isForcePanning",!1);d(this,"isErasingWithPen",!1);d(this,"isPastePrevented",!1);d(this,"editingStartTime",-1);d(this,"fileSystemHandle",null);d(this,"viewport",dt.getBoundsFromPoints([[0,0],[100,100]]));d(this,"rendererBounds",dt.getBoundsFromPoints([[0,0],[100,100]]));d(this,"selectHistory",{stack:[[]],pointer:0});d(this,"clipboard");d(this,"rotationInfo",{selectedIds:[],center:[0,0]});d(this,"migrate",e=>Dn(e,Ke.version));d(this,"onReady",()=>{var e,t;this.loadDocument(this.document),qa().then(n=>{this.fileSystemHandle=n});try{this.patchState(w(S({},Dn(this.state,Ke.version)),{appState:{status:"idle"}}))}catch(n){console.error("The data appears to be corrupted. Resetting!",n),localStorage.setItem(this.document.id+"_corrupted",JSON.stringify(this.document)),this.patchState(w(S({},Ke.defaultState),{appState:w(S({},Ke.defaultState.appState),{status:"idle"})}))}(t=(e=this.callbacks).onMount)==null||t.call(e,this)});d(this,"cleanup",(e,t)=>{var l,a,c,p,u;let n=S({},e);n.document!==t.document&&Object.entries(n.document.pages).forEach(([h,g])=>{if(g===void 0){delete n.document.pages[h],delete n.document.pageStates[h];return}let m=t.document.pages[h],f={};if(!m||g.shapes!==m.shapes||g.bindings!==m.bindings){g.shapes=S({},g.shapes),g.bindings=S({},g.bindings);let b=new Set;Object.entries(g.shapes).forEach(([x,I])=>{var R;let k;I?k=I.parentId:(k=(R=m==null?void 0:m.shapes[x])==null?void 0:R.parentId,delete g.shapes[x]),g.id===n.appState.currentPageId&&(m==null?void 0:m.shapes[x])!==I&&(f[x]=I),k&&k!==h&&g.shapes[k]!==void 0&&b.add(g.shapes[k])}),Object.keys(g.bindings).forEach(x=>{g.bindings[x]||delete g.bindings[x]}),n.document.pages[h]=g;let T=B.getRelatedBindings(n,Object.keys(f),h),y=new Set;T.forEach(x=>{if(!g.bindings[x.id])return;let I=g.shapes[x.toId],k=g.shapes[x.fromId];if(!(I&&k)){delete n.document.pages[h].bindings[x.id];return}if(y.has(k))return;let R=B.updateArrowBindings(g,k);if(y.add(k),R){let C=S(S({},k),R);g.shapes[k.id]=C}}),b.forEach(x=>{if(!x)throw Error("no group!");let I=x.children.filter(R=>g.shapes[R]!==void 0),k=dt.getCommonBounds(I.map(R=>g.shapes[R]).filter(Boolean).map(R=>B.getRotatedBounds(R)));g.shapes[x.id]=w(S({},x),{point:[k.minX,k.minY],size:[k.width,k.height],children:I})})}let v=S({},n.document.pageStates[h]);v.brush||delete v.brush,v.hoveredId&&!g.shapes[v.hoveredId]&&delete v.hoveredId,v.bindingId&&!g.bindings[v.bindingId]&&(B.warn(`Could not find the binding of ${h}`),delete v.bindingId),v.editingId&&!g.shapes[v.editingId]&&(B.warn("Could not find the editing shape!"),delete v.editingId),n.document.pageStates[h]=v}),Object.keys((l=n.document.assets)!=null?l:{}).forEach(h=>{var g,m;(g=n.document.assets)!=null&&g[h]||(m=n.document.assets)==null||delete m[h]});let r=n.appState.currentPageId,s=n.document.pageStates[r];if(n.room&&n.room!==t.room){let h=w(S({},n.room),{users:S({},n.room.users)});t.room&&Object.values(t.room.users).filter(Boolean).forEach(g=>{h.users[g.id]===void 0&&delete h.users[g.id]}),n.room=h}if(n.room){let h=n.room.users[n.room.userId];n.room.users[n.room.userId]=w(S({},h),{id:(a=h==null?void 0:h.id)!=null?a:n.room.userId,color:(c=h==null?void 0:h.color)!=null?c:fi[0],activeShapes:(p=h==null?void 0:h.activeShapes)!=null?p:[],status:(u=h==null?void 0:h.status)!=null?u:"connected",point:this.currentPoint,selectedIds:s.selectedIds})}return this.readOnly&&(n.document.pages=t.document.pages),n});d(this,"broadcastPatch",(e,t)=>{var p,u,h,g,m,f,v,b,T;let n={},r={},s={},l=(h=(u=(p=e==null?void 0:e.document)==null?void 0:p.pages)==null?void 0:u[this.currentPageId])==null?void 0:h.shapes,a=(f=(m=(g=e==null?void 0:e.document)==null?void 0:g.pages)==null?void 0:m[this.currentPageId])==null?void 0:f.bindings,c=(v=e==null?void 0:e.document)==null?void 0:v.assets;l&&Object.keys(l).forEach(y=>{n[y]=this.getShape(y,this.currentPageId)}),a&&Object.keys(a).forEach(y=>{r[y]=this.getBinding(y,this.currentPageId)}),c&&Object.keys(c).forEach(y=>{s[y]=this.document.assets[y]}),(T=(b=this.callbacks).onChangePage)==null||T.call(b,this,n,r,s,t)});d(this,"onPatch",(e,t,n)=>{var r,s,l,a,c,p;(this.callbacks.onChangePage&&((s=(r=t==null?void 0:t.document)==null?void 0:r.pages)==null?void 0:s[this.currentPageId])||((l=t==null?void 0:t.document)==null?void 0:l.assets))&&(((a=t==null?void 0:t.document)==null?void 0:a.assets)||this.session&&this.session.type!=="brush"&&this.session.type!=="erase"&&this.session.type!=="draw")&&this.broadcastPatch(t,!1),(p=(c=this.callbacks).onPatch)==null||p.call(c,this,t,n)});d(this,"onCommand",(e,t,n)=>{var r,s;this.clearSelectHistory(),this.isDirty=!0,(s=(r=this.callbacks).onCommand)==null||s.call(r,this,t,n)});d(this,"onReplace",()=>{this.clearSelectHistory(),this.isDirty=!1});d(this,"onUndo",()=>{var e,t;this.rotationInfo.selectedIds=[...this.selectedIds],(t=(e=this.callbacks).onUndo)==null||t.call(e,this)});d(this,"onRedo",()=>{var e,t;this.rotationInfo.selectedIds=[...this.selectedIds],(t=(e=this.callbacks).onRedo)==null||t.call(e,this)});d(this,"onPersist",(e,t)=>{var n,r;(r=(n=this.callbacks).onPersist)==null||r.call(n,this),this.broadcastPatch(t,!0)});d(this,"prevSelectedIds",this.selectedIds);d(this,"onStateDidChange",(e,t)=>{var n,r,s,l;(r=(n=this.callbacks).onChange)==null||r.call(n,this,t),this.room&&this.selectedIds!==this.prevSelectedIds&&((l=(s=this.callbacks).onChangePresence)==null||l.call(s,this,w(S({},this.room.users[this.room.userId]),{selectedIds:this.selectedIds,session:!!this.session})),this.prevSelectedIds=this.selectedIds)});d(this,"preventPaste",()=>{if(this.isPastePrevented)return;let e=n=>n.stopImmediatePropagation(),t=()=>{setTimeout(()=>{document.removeEventListener("paste",e,{capture:!0}),this.isPastePrevented=!1},50)};document.addEventListener("paste",e,{capture:!0}),window.addEventListener("pointerup",t,{once:!0}),this.isPastePrevented=!0});d(this,"justSent",!1);d(this,"getReservedContent",(e,t=this.currentPageId)=>{let{bindings:n}=this.document.pages[t],r={},s={},l=Object.values(n),a=new Map(l.map(m=>[m.toId,m])),c=new Map(l.map(m=>[m.fromId,m])),p=[a,c],u=[];this.session&&e.forEach(m=>u.push(m)),this.pageState.editingId&&u.push(this.pageState.editingId);let h=new Set(u),g=new Set;for(;u.length>0;){let m=u.pop();if(!m)break;if(g.has(m))continue;g.add(m);let f=this.getShape(m);r[m]=f,f.parentId!==t&&u.push(f.parentId),f.children&&u.push(...f.children),p.map(v=>v.get(f.id)).filter(Boolean).forEach(v=>{s[v.id]=v,u.push(v.toId,v.fromId)})}return{reservedShapes:r,reservedBindings:s,strongReservedShapeIds:h}});d(this,"replacePageContent",(e,t,n,r=this.currentPageId)=>{if(this.justSent)return this.justSent=!1,this;let s=this.document.pages[this.currentPageId];return Object.values(e).forEach(l=>{l.parentId!==r&&!(s.shapes[l.parentId]||e[l.parentId])&&(console.warn("Added a shape without a parent on the page"),l.parentId=r)}),this.useStore.setState(l=>{let{hoveredId:a,editingId:c,bindingId:p,selectedIds:u}=l.document.pageStates[r],h=[...u],g=c&&l.document.pages[this.currentPageId].shapes[c];g&&h.push(g.id);let{reservedShapes:m,reservedBindings:f,strongReservedShapeIds:v}=this.getReservedContent(h,this.currentPageId);Object.values(m).filter(C=>!("text"in C)).forEach(C=>{let E=e[C.id];if(!!E){if(!(C.type==="arrow"||v.has(C.id))){e[C.id]=E;return}"decorations"in E&&"decorations"in C&&(e[C.id]=w(S({},C),{decorations:E.decorations})),C.style=E.style}});let b=S(S({},e),m);g&&(b[g.id]=g);let T=S(S({},t),f),y=S({},n),x=w(S({},l),{document:w(S({},l.document),{pages:{[r]:w(S({},l.document.pages[r]),{shapes:b,bindings:T})},assets:y,pageStates:w(S({},l.document.pageStates),{[r]:w(S({},l.document.pageStates[r]),{selectedIds:u.filter(C=>b[C]!==void 0),hoveredId:a?b[a]===void 0?void 0:a:void 0,editingId:c,bindingId:p?T[p]===void 0?void 0:p:void 0})})})}),I=x.document.pages[r],k=B.getRelatedBindings(x,Object.keys(b),r),R=new Set;return k.forEach(C=>{if(!I.bindings[C.id])return;let E=I.shapes[C.fromId];if(R.has(E))return;let M=B.updateArrowBindings(I,E);if(R.add(E),M){let L=S(S({},E),M);I.shapes[E.id]=L}}),Object.values(b).forEach(C=>{if(C.type!=="group")return;let E=C.children.filter(L=>I.shapes[L]!==void 0),M=dt.getCommonBounds(E.map(L=>I.shapes[L]).filter(Boolean).map(L=>B.getRotatedBounds(L)));I.shapes[C.id]=w(S({},C),{point:[M.minX,M.minY],size:[M.width,M.height],children:E})}),this.state.document=x.document,x},!0),this});d(this,"updateBounds",e=>{this.rendererBounds=e;let{point:t,zoom:n}=this.camera;this.updateViewport(t,n),!this.readOnly&&this.session&&this.session.update()});d(this,"updateViewport",(e,t)=>{let{width:n,height:r}=this.rendererBounds,[s,l]=se.sub(se.div([0,0],t),e),[a,c]=se.sub(se.div([n,r],t),e);this.viewport={minX:s,minY:l,maxX:a,maxY:c,width:a-s,height:c-l}});d(this,"setEditingId",(e,t=!1)=>{if(!this.readOnly){if(e)this.startSession("edit",e,t);else{if(!this.pageState.editingId)return;this.completeSession()}this.editingStartTime=performance.now(),this.patchState({document:{pageStates:{[this.currentPageId]:{editingId:e}}}},"set_editing_id")}});d(this,"setHoveredId",e=>{this.patchState({document:{pageStates:{[this.currentPageId]:{hoveredId:e}}}},"set_hovered_id")});d(this,"setNodeEditingId",e=>{this.patchState({appState:{nodeEditingId:e}},"set_node_editing_id")});d(this,"setSetting",(e,t)=>{if(this.session)return this;let n={settings:{[e]:typeof t=="function"?t(this.settings[e]):t}};return this.patchState(n,`settings:${e}`),this.persist(n),this});d(this,"toggleFocusMode",()=>{if(this.session)return this;let e={settings:{isFocusMode:!this.settings.isFocusMode}};return this.patchState(e,"settings:toggled_focus_mode"),this.persist(e),this});d(this,"togglePenMode",()=>{if(this.session)return this;let e={settings:{isPenMode:!this.settings.isPenMode}};return this.patchState(e,"settings:toggled_pen_mode"),this.persist(e),this});d(this,"toggleDarkMode",()=>{if(this.session)return this;let e={settings:{isDarkMode:!this.settings.isDarkMode}};return this.patchState(e,"settings:toggled_dark_mode"),this.persist(e),this});d(this,"toggleZoomSnap",()=>{if(this.session)return this;let e={settings:{isZoomSnap:!this.settings.isZoomSnap}};return this.patchState(e,"settings:toggled_zoom_snap"),this.persist(e),this});d(this,"toggleDebugMode",()=>{if(this.session)return this;let e={settings:{isDebugMode:!this.settings.isDebugMode}};return this.patchState(e,"settings:toggled_debug"),this.persist(e),this});d(this,"setMenuOpen",e=>{let t={appState:{isMenuOpen:e}};return this.patchState(t,"ui:toggled_menu_opened"),this.persist(t),this});d(this,"setIsLoading",e=>{let t={appState:{isLoading:e}};return this.patchState(t,"ui:toggled_is_loading"),this.persist(t),this});d(this,"setDisableAssets",e=>(this.patchState({appState:{disableAssets:e}},"ui:toggled_disable_images"),this));d(this,"toggleGrid",()=>{if(this.session)return this;let e={settings:{showGrid:!this.settings.showGrid}};return this.patchState(e,"settings:toggled_grid"),this.persist(e),this});d(this,"toggleCanvasMode",()=>{if(this.session)return this;let t={settings:{canvasMode:this.settings.canvasMode==="freehand"?"straight":"freehand"}};return this.patchState(t,"settings:toggled_canvas_mode"),this.persist(t),this});d(this,"selectTool",e=>{if(this.readOnly||this.session)return this;this.isPointing=!1;let t=this.tools[e];return t===this.currentTool?(this.patchState({appState:{isToolLocked:!1}}),this):(this.currentTool.onExit(),t.previous=this.currentTool.type,this.currentTool=t,this.currentTool.onEnter(),this.patchState({appState:{activeTool:e,isToolLocked:!1}},`selected_tool:${e}`))});d(this,"toggleToolLock",()=>this.session?this:this.patchState({appState:{isToolLocked:!this.appState.isToolLocked}},"toggled_tool_lock"));d(this,"resetDocument",()=>{if(this.session)return this;this.session=void 0,this.currentTool=this.tools.select;let e=Ke.defaultDocument;return e.pages.page.name="Page 1",this.resetHistory().clearSelectHistory().loadDocument(Ke.defaultDocument).persist({}),this});d(this,"updateUsers",(e,t=!1)=>{this.patchState({room:{users:Object.fromEntries(e.map(n=>[n.id,n]))}},t?"room:self:update":"room:user:update")});d(this,"removeUser",e=>{this.patchState({room:{users:{[e]:void 0}}})});d(this,"mergeDocument",e=>{if(this.document.id!==e.id)return this.replaceState(w(S({},Dn(w(S({},this.state),{document:e}),Ke.version)),{appState:w(S({},this.appState),{currentPageId:Object.keys(e.pages)[0]})})),this;let t=S({},this.document.pageStates),n=w(S({},this.appState),{currentPageId:e.pages[this.currentPageId]?this.currentPageId:Object.keys(e.pages)[0],pages:Object.values(e.pages).map((s,l)=>({id:s.id,name:s.name,childIndex:s.childIndex||l}))});this.resetHistory(),Object.keys(this.document.pages).forEach(s=>{e.pages[s]||(s===this.appState.currentPageId&&(this.cancelSession(),this.selectNone()),t[s]=void 0)}),this.session&&this.selectedIds.filter(s=>!e.pages[this.currentPageId].shapes[s]).forEach(s=>e.pages[this.currentPageId].shapes[s]=this.page.shapes[s]),Object.entries(t).forEach(([s,l])=>{l.selectedIds=l.selectedIds.filter(a=>!!e.pages[s].shapes[a])});let{editingId:r}=this.pageState;return r&&(e.pages[this.currentPageId].shapes[r]=this.page.shapes[r],t[this.currentPageId].selectedIds=[r]),this.replaceState(w(S({},Dn(w(S({},this.state),{document:w(S({},e),{pageStates:t})}),Ke.version)),{appState:n}),"merge")});d(this,"updateDocument",(e,t="updated_document")=>{let n=this.state,r=w(S({},n),{document:w(S({},n.document),{assets:e.assets})});e.pages[this.currentPageId]||(r.appState=w(S({},n.appState),{currentPageId:Object.keys(e.pages)[0]}));let s=1;for(let l of Object.values(e.pages))l!==n.document.pages[l.id]&&(r.document.pages[l.id]=l,l.name||(r.document.pages[l.id].name=`Page ${s+1}`,s++));for(let l of Object.values(e.pageStates))if(l!==n.document.pageStates[l.id]){r.document.pageStates[l.id]=l;let a=e.pages[l.id],c=["bindingId","editingId","hoveredId","pointedId"];for(let p of c)a.shapes[p]||(l[p]=void 0);l.selectedIds=l.selectedIds.filter(p=>!!e.pages[a.id].shapes[p])}return this.replaceState(Dn(r,r.document.version||0),`${t}:${e.id}`)});d(this,"loadRoom",e=>(this.patchState({room:{id:e,userId:il,users:{[il]:{id:il,color:fi[Math.floor(Math.random()*fi.length)],point:[100,100],selectedIds:[],activeShapes:[],status:"connected"}}}}),this));d(this,"loadDocument",e=>{this.setIsLoading(!0),this.selectNone(),this.resetHistory(),this.clearSelectHistory(),this.session=void 0;let t=w(S({},Ke.defaultState),{settings:S({},this.state.settings),document:e,appState:w(S(S({},Ke.defaultState.appState),this.state.appState),{currentPageId:Object.keys(e.pages)[0],disableAssets:this.disableAssets})});this.replaceState(Dn(t,Ke.version),"loaded_document");let{point:n,zoom:r}=this.camera;return this.updateViewport(n,r),this.setIsLoading(!1),this});d(this,"loadPageFromURL",(e,t)=>{let n=e.id,r=w(S({},this.state.document),{pageStates:w(S({},this.state.document.pageStates),{[n]:t}),pages:w(S({},this.document.pages),{[n]:e})});this.loadDocument(r),this.persist({})});d(this,"newProject",()=>{!this.isLocal||(this.fileSystemHandle=null,this.resetDocument())});d(this,"saveProject",()=>z(this,null,function*(){if(this.readOnly)return;let e=yield hs(Dn(this.state,Ke.version).document,this.fileSystemHandle);return this.fileSystemHandle=e,this.persist({}),this.isDirty=!1,this}));d(this,"saveProjectAs",(e,t)=>z(this,null,function*(){try{let n=yield hs(this.document,null,e,t);this.fileSystemHandle=n,this.persist({}),this.isDirty=!1}catch(n){console.error(n.message)}return this}));d(this,"openProject",()=>z(this,null,function*(){if(!!this.isLocal)try{let e=yield Ja();if(!e)throw Error();let{fileHandle:t,document:n}=e;this.loadDocument(n),this.fileSystemHandle=t,this.zoomToFit(),this.persist({})}catch(e){console.error(e)}finally{this.persist({})}}));d(this,"openAsset",()=>z(this,null,function*(){if(!this.disableAssets)try{let e=yield Qa();if(Array.isArray(e))this.addMediaFromFiles(e,this.centerPoint);else{if(!e)return;this.addMediaFromFiles([e])}}catch(e){console.error(e)}finally{this.persist({})}}));d(this,"signOut",()=>{});d(this,"getAppState",()=>this.appState);d(this,"getPage",(e=this.currentPageId)=>B.getPage(this.state,e||this.currentPageId));d(this,"getShapes",(e=this.currentPageId)=>B.getShapes(this.state,e||this.currentPageId));d(this,"getBindings",(e=this.currentPageId)=>B.getBindings(this.state,e||this.currentPageId));d(this,"getShape",(e,t=this.currentPageId)=>B.getShape(this.state,e,t));d(this,"getShapeBounds",(e,t=this.currentPageId)=>B.getBounds(this.getShape(e,t)));d(this,"getBinding",(e,t=this.currentPageId)=>B.getBinding(this.state,e,t));d(this,"getPageState",(e=this.currentPageId)=>B.getPageState(this.state,e||this.currentPageId));d(this,"getPagePoint",(e,t=this.currentPageId)=>{let{camera:n}=this.getPageState(t);return se.sub(se.div(e,n.zoom),n.point)});d(this,"createPage",(e,t)=>{if(this.readOnly)return this;let{width:n,height:r}=this.rendererBounds;return this.setState(Qp(this,[-n/2,-r/2],e,t))});d(this,"changePage",e=>this.setState(Zp(this,e)));d(this,"movePage",(e,t)=>this.readOnly?this:this.setState(lu(this,e,t)));d(this,"renamePage",(e,t)=>this.readOnly?this:this.setState(du(this,e,t)));d(this,"duplicatePage",e=>this.readOnly?this:this.setState(ou(this,e)));d(this,"deletePage",e=>this.readOnly?this:Object.values(this.document.pages).length<=1?this:this.setState(eu(this,e||this.currentPageId)));d(this,"cut",(e=this.selectedIds,t)=>(t==null||t.preventDefault(),this.copy(e,t),this.readOnly||this.delete(e),this));d(this,"copy",(e=this.selectedIds,t)=>{var s;t==null||t.preventDefault(),this.clipboard=this.getContent(e);let r=`<telva>${JSON.stringify(S({type:"telva/clipboard",shapes:[],assets:[],bindings:[]},this.clipboard))}</telva>`;return _p(r),t&&((s=t.clipboardData)==null||s.setData("text/html",r)),navigator.clipboard&&window.ClipboardItem&&navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([r],{type:"text/html"})})]),this});d(this,"paste",(e,t)=>z(this,null,function*(){var p,u;if(this.readOnly)return;let n=[],r=[],s,l=h=>z(this,null,function*(){let g=document.createElement("div");g.innerHTML=h;let m=g.firstChild;m.style.setProperty("background-color","transparent");let f=yield B.getImageForSvg(m,"svg",{scale:1,quality:1});if(f){let v=new File([f],"image.svg");n.push(v)}else a(h)}),a=h=>{let g=this.getPagePoint(e!=null?e:this.centerPoint,this.currentPageId),m=h.includes(`
13
+ `);r.push(B.getShapeUtil("text").getShape({id:dt.uniqueId(),type:"text",parentId:this.appState.currentPageId,text:B.normalizeText(h.trim()),point:g,style:w(S({},this.appState.currentStyle),{textAlign:m?"start":this.appState.currentStyle.textAlign})}))},c=h=>{var g;try{let m=(g=h.match(/<telva>(.*)<\/telva>/))==null?void 0:g[1];if(!m)return;let f=JSON.parse(m);if(f.type==="telva/clipboard"){s=f;return}else throw Error("Not telva data!")}catch(m){a(h)}};if(t!==void 0){let h=Array.from((u=(p=t.clipboardData)==null?void 0:p.items)!=null?u:[]);yield Promise.all(h.map(g=>z(this,null,function*(){var v;let{type:m,kind:f}=g;switch(f){case"string":{let b=yield new Promise(T=>g.getAsString(T));switch(m){case"text/html":{if((v=b.match(/<telva>(.*)<\/telva>/))!=null&&v[1]){c(b);return}break}case"text/plain":{b.startsWith("<svg")?yield l(b):a(b);break}}break}case"file":{let b=g.getAsFile();b&&n.push(b);break}}})))}if(s)return this.insertContent(s,{point:e,select:!0}),this;if(n.length)return this.addMediaFromFiles(n,e),this;if(r.length){let h=this.getPagePoint(e!=null?e:this.centerPoint,this.currentPageId),g=se.add(h,[0,0]);return r.forEach((m,f)=>{let v=B.getBounds(m);f===0&&(g[0]-=v.width/2,g[1]-=v.height/2),m.point=[...g],g[0]+=v.width}),this.createShapes(...r),this}return this.clipboard?this.insertContent(this.clipboard):Kp().then(h=>{h&&c(h)}),this}));d(this,"getSvg",(...n)=>z(this,[...n],function*(e=this.selectedIds.length?this.selectedIds:Object.keys(this.page.shapes),t={}){var m;if(e.length===0)return;let r=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","defs"),l=document.createElementNS("http://www.w3.org/2000/svg","style");if(typeof window!="undefined"&&window.focus(),t.includeFonts)try{let{fonts:f}=yield fetch(Ke.assetSrc,{mode:"no-cors"}).then(v=>v.json());l.textContent=`
14
14
  @font-face {
15
15
  font-family: 'Caveat Brush';
16
16
  src: url(data:application/x-font-woff;charset=utf-8;base64,${f.caveat}) format('woff');
@@ -35,5 +35,5 @@ var Rs=Object.defineProperty,Lu=Object.defineProperties,Au=Object.getOwnProperty
35
35
  font-weight: 500;
36
36
  font-style: normal;
37
37
  }
38
- `}catch(f){B.warn("Could not find telva-assets.json file.")}else l.textContent="@import url('https://fonts.googleapis.com/css2?family=Caveat+Brush&family=Source+Code+Pro&family=Source+Sans+Pro&family=Crimson+Pro&display=block');";s.append(l),r.append(s);let a=e.map(f=>this.getShape(f,this.currentPageId)).sort((f,v)=>f.childIndex-v.childIndex),c=ct.getCommonBounds(a.map(B.getRotatedBounds)),p=f=>z(this,null,function*(){let v=B.getShapeUtil(f),b=v.getBounds(f),T=yield v.getSvgElement(f,this.settings.isDarkMode);if(!!T)return f.type==="image"?T.setAttribute("href",this.document.assets[f.assetId].src):f.type==="video"&&T.setAttribute("href",this.serializeVideo(f.id)),T.setAttribute("transform",`translate(${(16+f.point[0]-c.minX).toFixed(2)}, ${(16+f.point[1]-c.minY).toFixed(2)}) rotate(${((f.rotation||0)*180/Math.PI).toFixed(2)}, ${(b.width/2).toFixed(2)}, ${(b.height/2).toFixed(2)})`),T});for(let f of a){if((m=f.children)!=null&&m.length){let b=document.createElementNS("http://www.w3.org/2000/svg","g");for(let T of f.children){let y=this.getShape(T,this.currentPageId),x=yield p(y);x&&b.append(x)}r.append(b);continue}let v=yield p(f);v&&r.append(v)}r.setAttribute("viewBox",[0,0,c.width+16*2,c.height+16*2].join(" ")),r.setAttribute("width",(c.width+16*2).toString()),r.setAttribute("height",(c.height+16*2).toString());let u=this.settings.exportBackground,h="#212529",g="rgb(248, 249, 250)";switch(u){case"auto":{r.style.setProperty("background-color",this.settings.isDarkMode?h:g);break}case"dark":{r.style.setProperty("background-color",h);break}case"light":{r.style.setProperty("background-color",g);break}case"transparent":default:{r.style.setProperty("background-color","transparent");break}}return r.querySelectorAll(".tv-fill-hitarea, .tv-stroke-hitarea, .tv-binding-indicator").forEach(f=>f.remove()),r}));d(this,"copySvg",(...t)=>z(this,[...t],function*(e=this.selectedIds.length?this.selectedIds:Object.keys(this.page.shapes)){if(e.length===0)return;let n=yield this.getSvg(e);if(!n)return;let r=B.getSvgString(n,1);this.clipboard=this.getContent(e);let s=JSON.stringify(S({type:"telva/clipboard",shapes:[],assets:[],bindings:[]},this.clipboard));return navigator.clipboard&&window.ClipboardItem&&navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([s],{type:"text/html"}),"text/plain":new Blob([r],{type:"text/plain"})})]),r}));d(this,"getContent",e=>{let t=this.getPage(this.currentPageId);if(e&&e.length===0||(e||(e=this.selectedIds),e.length===0&&(e=Object.keys(t.shapes)),e.length===0))return;let n=e.map(a=>t.shapes[a]).flatMap(a=>{var c;return[a,...((c=a.children)!=null?c:[]).map(p=>t.shapes[p])]}).map(it),r=new Set(n.map(a=>a.id));n.forEach(a=>{a.parentId===this.currentPageId&&(a.parentId="currentPageId")});let s=Object.values(t.bindings).filter(a=>{if(r.has(a.fromId)||r.has(a.toId))return!0;if(r.has(a.fromId)){let p=n.find(u=>u.id===a.fromId).handles;p&&Object.values(p).forEach(u=>{u.bindingId===a.id&&(u.bindingId=void 0)})}if(r.has(a.toId)){let p=n.find(u=>u.id===a.toId).handles;p&&Object.values(p).forEach(u=>{u.bindingId===a.id&&(u.bindingId=void 0)})}return!1}).map(it),l=[...new Set(n.map(a=>{if(!!a.assetId)return this.document.assets[a.assetId]}).filter(Boolean).map(it))];return{shapes:n,bindings:s,assets:l}});d(this,"copyJson",(e=this.selectedIds)=>{let t=this.getContent(e);return t&&B.copyStringToClipboard(JSON.stringify(t)),this});d(this,"exportJson",(e=this.selectedIds)=>{let t=this.getContent(e);if(t){let n=new Blob([JSON.stringify(t)],{type:"application/json"}),r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download="export.json",s.click()}return this});d(this,"insertContent",(e,t={})=>this.setState(vu(this,e,t),"insert_content"));d(this,"getImage",(...n)=>z(this,[...n],function*(e="png",t={}){let{ids:r=this.selectedIds.length?this.selectedIds:Object.keys(this.page.shapes)}=t,s=yield this.getSvg(r,{includeFonts:e!=="svg"});if(!s)return;if(e==="svg"){let a=B.getSvgString(s,1);return new Blob([a],{type:"image/svg+xml"})}let l=yield B.getImageForSvg(s,e,t);if(!!l)return l}));d(this,"copyImage",(...n)=>z(this,[...n],function*(e="png",t={}){if(e==="svg"){this.copySvg(t.ids);return}if(!(navigator.clipboard&&window.ClipboardItem)){console.warn("Sorry, your browser does not support copying images.");return}let r=yield this.getImage(e,t);!r||navigator.clipboard.write([new ClipboardItem({[r.type]:r})])}));d(this,"exportImage",(...n)=>z(this,[...n],function*(e="png",t={}){var a;let{pageId:r=this.currentPageId}=t,s=yield this.getImage(e,t);if(!s)return;let l=(a=this.document.pages[r].name)!=null?a:"export";if(this.callbacks.onExport)this.callbacks.onExport(this,{name:l,type:e,blob:s});else{let c=URL.createObjectURL(s),p=document.createElement("a");p.href=c,p.download=`${l}.${e}`,p.click()}}));d(this,"convertToImage",()=>z(this,null,function*(){let e=this.selectedIds;if(!e.length)return;let t=[],n=[];for(let r of e){let s=this.getShape(r);if(s.type!=="reactComponent")continue;let l=B.getShapeUtil(s);if(!l.getSvgElement)continue;let a=yield l.getSvgElement(s,this.settings.isDarkMode);if(!a)continue;let c=a.getAttribute("href");if(!c)continue;let p=B.getShapeUtil("image").create({id:ct.uniqueId(),parentId:s.parentId,childIndex:s.childIndex,point:[...s.point],size:[...s.size],style:S({},s.style),assetId:"asset-"+ct.uniqueId()});this.patchState({document:{assets:{[`${p.assetId}`]:{id:p.assetId,type:"image",src:c,size:s.size,fileName:"component-snapshot.png"}}}},"add_asset"),t.push(p),n.push(s.id)}t.length>0&&(this.createShapes(...t),this.delete(n),this.select(...t.map(r=>r.id)))}));d(this,"setCamera",(e,t,n)=>(this.updateViewport(e,t),this.patchState({document:{pageStates:{[this.currentPageId]:{camera:{point:e,zoom:t}}}}},n),this));d(this,"resetCamera",()=>this.setCamera(this.centerPoint,1,"reset_camera"));d(this,"pan",e=>{let{camera:t}=this.pageState;return this.setCamera(se.toFixed(se.sub(t.point,e)),t.zoom,"panned")});d(this,"pinchZoom",(e,t,n)=>{let{camera:r}=this.pageState,s=se.sub(r.point,se.div(t,r.zoom)),l=n,a=se.sub(se.div(e,r.zoom),s),c=se.sub(se.div(e,l),s);return this.setCamera(se.toFixed(se.add(s,se.sub(c,a))),l,"pinch_zoomed")});d(this,"zoomTo",(e,t=this.centerPoint)=>{let{zoom:n,point:r}=this.camera,s=se.sub(se.div(t,n),r),l=se.sub(se.div(t,e),r);return this.setCamera(se.toFixed(se.add(r,se.sub(l,s))),e,"zoomed_camera")});d(this,"zoomIn",()=>{let e=Math.round(this.camera.zoom*100/25),t=B.getCameraZoom((e+1)*.25);return this.zoomTo(t)});d(this,"zoomOut",()=>{let e=Math.round(this.camera.zoom*100/25),t=B.getCameraZoom((e-1)*.25);return this.zoomTo(t)});d(this,"zoomToFit",()=>{let{shapes:e,pageState:{camera:t}}=this;if(e.length===0)return this;let{rendererBounds:n}=this,r=ct.getCommonBounds(e.map(B.getBounds)),s=B.getCameraZoom(Math.min((n.width-128)/r.width,(n.height-128)/r.height));s=t.zoom===s||t.zoom<1?Math.min(1,s):s;let l=(n.width-r.width*s)/2/s,a=(n.height-r.height*s)/2/s;return this.setCamera(se.toFixed(se.sub([l,a],[r.minX,r.minY])),s,"zoomed_to_fit")});d(this,"zoomToSelection",()=>{if(this.selectedIds.length===0)return this;let{rendererBounds:e}=this,t=B.getSelectedBounds(this.state),n=B.getCameraZoom(Math.min((e.width-128)/t.width,(e.height-128)/t.height));n=this.camera.zoom===n||this.camera.zoom<1?Math.min(1,n):n;let r=(e.width-t.width*n)/2/n,s=(e.height-t.height*n)/2/n;return this.setCamera(se.toFixed(se.sub([r,s],[t.minX,t.minY])),n,"zoomed_to_selection")});d(this,"zoomToContent",()=>{let e=this.shapes,t=this.pageState;if(e.length===0)return this;let{rendererBounds:n}=this,{zoom:r}=t.camera,s=ct.getCommonBounds(e.map(B.getBounds)),l=(n.width-s.width*r)/2/r,a=(n.height-s.height*r)/2/r;return this.setCamera(se.toFixed(se.sub([l,a],[s.minX,s.minY])),this.camera.zoom,"zoomed_to_content")});d(this,"resetZoom",()=>this.zoomTo(1));d(this,"zoomBy",ct.throttle((e,t)=>{let{zoom:n}=this.camera,r=B.getCameraZoom(n-e*n);return this.zoomTo(r,t)},16));d(this,"clearSelectHistory",()=>(this.selectHistory.pointer=0,this.selectHistory.stack=[this.selectedIds],this));d(this,"addToSelectHistory",e=>(this.selectHistory.pointer<this.selectHistory.stack.length&&(this.selectHistory.stack=this.selectHistory.stack.slice(0,this.selectHistory.pointer+1)),this.selectHistory.pointer++,this.selectHistory.stack.push(e),this));d(this,"setSelectedIds",(e,t=!1)=>{let n=t?[...this.pageState.selectedIds,...e]:[...e];return this.patchState({appState:{activeTool:"select"},document:{pageStates:{[this.currentPageId]:{selectedIds:n}}}},"selected")});d(this,"undoSelect",()=>(this.selectHistory.pointer>0&&(this.selectHistory.pointer--,this.setSelectedIds(this.selectHistory.stack[this.selectHistory.pointer])),this));d(this,"redoSelect",()=>(this.selectHistory.pointer<this.selectHistory.stack.length-1&&(this.selectHistory.pointer++,this.setSelectedIds(this.selectHistory.stack[this.selectHistory.pointer])),this));d(this,"select",(...e)=>(e.forEach(t=>{if(!this.page.shapes[t])throw Error(`That shape does not exist on page ${this.currentPageId}`)}),this.setSelectedIds(e),this.addToSelectHistory(e),this));d(this,"selectAll",(e=this.currentPageId)=>this.session?this:(this.setSelectedIds(Object.values(this.document.pages[e].shapes).filter(t=>t.parentId===e).map(t=>t.id)),this.addToSelectHistory(this.selectedIds),this.selectTool("select"),this));d(this,"selectNone",()=>(this.setSelectedIds([]),this.addToSelectHistory(this.selectedIds),this));d(this,"startSession",(e,...t)=>{var s,l;if(this.readOnly&&e!=="brush")return this;this.session&&(B.warn(`Already in a session! (${this.session.constructor.name})`),this.cancelSession());let n=Du(e);this.session=new n(this,...t);let r=this.session.start();return r&&this.patchState(r,`session:start_${this.session.constructor.name}`),(l=(s=this.callbacks).onSessionStart)==null||l.call(s,this,this.session.constructor.name),this});d(this,"updateSession",()=>{let{session:e}=this;if(!e)return this;let t=e.update();return t?this.patchState(t,`session:${e==null?void 0:e.constructor.name}`):this});d(this,"cancelSession",()=>{var n,r;let{session:e}=this;if(!e)return this;this.session=void 0;let t=e.cancel();return t&&this.patchState(t,`session:cancel:${e.constructor.name}`),this.setEditingId(),(r=(n=this.callbacks).onSessionEnd)==null||r.call(n,this,e.constructor.name),this});d(this,"completeSession",()=>{var n,r,s,l,a,c,p,u,h;let{session:e}=this;if(!e)return this;this.session=void 0;let t=e.complete();if(t===void 0)this.isCreating=!1,this.patchState({appState:{status:"idle"},document:{pageStates:{[this.currentPageId]:{editingId:void 0,bindingId:void 0,hoveredId:void 0}}}},`session:complete:${e.constructor.name}`);else if("after"in t){if(this.isCreating){if(t.before={appState:w(S({},t.before.appState),{status:"idle"}),document:{pages:{[this.currentPageId]:{shapes:Object.fromEntries(this.selectedIds.map(g=>[g,void 0]))}},pageStates:{[this.currentPageId]:{selectedIds:[],editingId:null,bindingId:null,hoveredId:null}}}},this.appState.isToolLocked){let g=((s=(r=(n=t.after)==null?void 0:n.document)==null?void 0:r.pageStates)==null?void 0:s[this.currentPageId])||{};g.selectedIds=[]}this.isCreating=!1}t.after.appState=w(S({},t.after.appState),{status:"idle"}),t.after.document=w(S({},t.after.document),{pageStates:w(S({},(l=t.after.document)==null?void 0:l.pageStates),{[this.currentPageId]:w(S({},(((a=t.after.document)==null?void 0:a.pageStates)||{})[this.currentPageId]),{editingId:null})})}),this.setState(t,`session:complete:${e.constructor.name}`)}else this.patchState(w(S({},t),{appState:w(S({},t.appState),{status:"idle"}),document:w(S({},t.document),{pageStates:{[this.currentPageId]:w(S({},(p=(c=t.document)==null?void 0:c.pageStates)==null?void 0:p[this.currentPageId]),{editingId:null})}})}),`session:complete:${e.constructor.name}`);return(h=(u=this.callbacks).onSessionEnd)==null||h.call(u,this,e.constructor.name),this});d(this,"createShapes",(...e)=>e.length===0?this:this.create(e.map(t=>B.getShapeUtil(t.type).create(S({parentId:this.currentPageId},t)))));d(this,"updateShapes",(...e)=>{let t=this.document.pages[this.currentPageId].shapes,n=e.filter(r=>t[r.id]);return n.length===0?this:this.setState(Za(this,n,this.currentPageId),"updated_shapes")});d(this,"create",(e=[],t=[])=>e.length===0?this:this.setState(Na(this,e,t)));d(this,"patchCreate",(e=[],t=[])=>e.length===0?this:this.patchState(Na(this,e,t).after));d(this,"delete",(e=this.selectedIds)=>{var n,r;if(e.length===0)return this;if(this.session)return this;let t=Ua(this,e);if(this.callbacks.onAssetDelete&&((n=t.before.document)==null?void 0:n.assets)&&((r=t.after.document)==null?void 0:r.assets)){let s=Object.keys(t.before.document.assets).filter(c=>!!t.before.document.assets[c]),l=Object.keys(t.after.document.assets).filter(c=>!!t.after.document.assets[c]);s.filter(c=>!l.includes(c)).forEach(c=>this.callbacks.onAssetDelete(this,c))}return this.setState(t)});d(this,"deleteAll",()=>(this.selectAll(),this.delete(),this));d(this,"style",(e,t=this.selectedIds)=>this.setState(mu(this,t,e)));d(this,"align",(e,t=this.selectedIds)=>t.length<2?this:this.setState(Xp(this,t,e)));d(this,"distribute",(e,t=this.selectedIds)=>t.length<3?this:this.setState(nu(this,t,e)));d(this,"stretch",(e,t=this.selectedIds)=>t.length<2?this:this.setState(hu(this,t,e)));d(this,"flipHorizontal",(e=this.selectedIds)=>e.length===0?this:this.setState(_a(this,e,"horizontal")));d(this,"flipVertical",(e=this.selectedIds)=>e.length===0?this:this.setState(_a(this,e,"vertical")));d(this,"moveToPage",(e,t=this.currentPageId,n=this.selectedIds)=>{if(n.length===0)return this;let{rendererBounds:r}=this;return this.setState(au(this,n,r,t,e)),this});d(this,"moveToBack",(e=this.selectedIds)=>e.length===0?this:this.setState(Ur(this,e,"toBack")));d(this,"moveBackward",(e=this.selectedIds)=>e.length===0?this:this.setState(Ur(this,e,"backward")));d(this,"moveForward",(e=this.selectedIds)=>e.length===0?this:this.setState(Ur(this,e,"forward")));d(this,"moveToFront",(e=this.selectedIds)=>e.length===0?this:this.setState(Ur(this,e,"toFront")));d(this,"nudge",(e,t=!1,n=this.selectedIds)=>{if(n.length===0)return this;let r=t?this.settings.showGrid?this.currentGrid*4:10:this.settings.showGrid?this.currentGrid:1;return this.setState(Su(this,n,se.mul(e,r)))});d(this,"duplicate",(e=this.selectedIds,t)=>this.readOnly?this:e.length===0?this:this.setState(ru(this,e,t)));d(this,"resetBounds",(e=this.selectedIds)=>{let t=Ya(this,e,this.currentPageId);return this.setState(Ya(this,e,this.currentPageId),t.id)});d(this,"toggleHidden",(e=this.selectedIds)=>e.length===0?this:this.setState(us(this,e,"isHidden")));d(this,"toggleLocked",(e=this.selectedIds)=>e.length===0?this:this.setState(us(this,e,"isLocked")));d(this,"toggleAspectRatioLocked",(e=this.selectedIds)=>e.length===0?this:this.setState(us(this,e,"isAspectRatioLocked")));d(this,"toggleDecoration",(e,t=this.selectedIds)=>t.length===0||!(e==="start"||e==="end")?this:this.setState(gu(this,t,e)));d(this,"setShapeProps",(e,t=this.selectedIds)=>this.setState(bu(this,t,e)));d(this,"rotate",(e=Math.PI*-.5,t=this.selectedIds)=>{if(t.length===0)return this;let n=pu(this,t,e);return n?this.setState(n):this});d(this,"group",(e=this.selectedIds,t=ct.uniqueId(),n=this.currentPageId)=>{if(this.readOnly)return this;if(e.length===1&&this.getShape(e[0],n).type==="group")return this.ungroup(e,n);if(e.length<2)return this;let r=iu(this,e,t,n);return r?this.setState(r):this});d(this,"ungroup",(e=this.selectedIds,t=this.currentPageId)=>{if(this.readOnly)return this;let n=e.map(s=>this.getShape(s,t)).filter(s=>s.type==="group");if(n.length===0)return this;let r=yu(this,e,n,t);return r?this.setState(r):this});d(this,"cancel",()=>{var e,t;return(t=(e=this.currentTool).onCancel)==null||t.call(e),this});d(this,"addMediaFromFiles",(n,...r)=>z(this,[n,...r],function*(e,t=this.centerPoint){this.setIsLoading(!0);let s=[],l=this.getPagePoint(t);for(let a of e){let c=ct.uniqueId(),p=a.name.match(/\.[0-9a-z]+$/i);if(!p)throw Error("No extension");let u=yi.includes(p[0].toLowerCase()),h=bi.includes(p[0].toLowerCase());if(!(u||h))throw Error("Wrong extension");let g=u?"image":"video",m=u?"image":"video",f;try{if(this.callbacks.onAssetCreate){let v=yield this.callbacks.onAssetCreate(this,a,c);if(!v)throw Error("Asset creation callback returned false");f=v}else f=yield el(a);if(typeof f=="string"){let v=[0,0];if(u){if(p[0]==".svg"){let y,x=yield tl(a),I=this.getViewboxFromSVG(x);I&&(y=I.split(" "),v[0]=parseFloat(y[2]),v[1]=parseFloat(y[3]))}se.isEqual(v,[0,0])&&(v=yield nl(f))}else v=yield ol(f);let b=Object.values(this.document.assets).find(y=>y.type===m&&y.src===f),T;if(b)T=b.id;else{T=c;let y={id:T,type:m,name:a.name,src:f,size:v};this.patchState({document:{assets:{[T]:y}}})}s.push(this.getImageOrVideoShapeAtPoint(c,g,t,v,T))}}catch(v){console.warn(v)}}if(s.length){let a=se.add(l,[0,0]);s.forEach((p,u)=>{let h=B.getBounds(p);u===0&&(a[0]-=h.width/2,a[1]-=h.height/2),p.point=[...a],a[0]+=h.width});let c=ct.getCommonBounds(s.map(B.getBounds));this.createShapes(...s),ct.boundsContain(this.viewport,c)||(this.zoomToSelection(),this.zoom>1&&this.resetZoom())}return this.setIsLoading(!1),this}));d(this,"getViewboxFromSVG",e=>{let t=/.*?viewBox=["'](-?[\d.]+[, ]+-?[\d.]+[, ][\d.]+[, ][\d.]+)["']/;if(typeof e=="string"){let n=e.match(t);return n&&n.length>=2?n[1]:null}return this.setIsLoading(!1),null});d(this,"onKeyDown",(e,t,n)=>{var r,s;switch(n.key){case"/":{if(this.status==="idle"&&!this.pageState.editingId){let{shiftKey:l,metaKey:a,altKey:c,ctrlKey:p,spaceKey:u}=this;this.onPointerDown({target:"canvas",pointerId:0,origin:t.point,point:t.point,delta:[0,0],pressure:.5,shiftKey:l,ctrlKey:p,metaKey:a,altKey:c,spaceKey:u},{shiftKey:l,altKey:c,ctrlKey:p,pointerId:0,clientX:t.point[0],clientY:t.point[1]})}break}case"Escape":{this.cancel();break}case"Meta":{this.metaKey=!0;break}case"Alt":{this.altKey=!0;break}case"Control":{this.ctrlKey=!0;break}case" ":{this.isForcePanning=!0,this.spaceKey=!0;break}}return(s=(r=this.currentTool).onKeyDown)==null||s.call(r,e,t,n),this});d(this,"onKeyUp",(e,t,n)=>{var r,s;if(!!t){switch(n.key){case"/":{let{currentPoint:l,shiftKey:a,metaKey:c,altKey:p,ctrlKey:u,spaceKey:h}=this;this.onPointerUp({target:"canvas",pointerId:0,origin:l,point:l,delta:[0,0],pressure:.5,shiftKey:a,ctrlKey:u,metaKey:c,altKey:p,spaceKey:h},{shiftKey:a,altKey:p,ctrlKey:u,pointerId:0,clientX:l[0],clientY:l[1]});break}case"Meta":{this.metaKey=!1;break}case"Alt":{this.altKey=!1;break}case"Control":{this.ctrlKey=!1;break}case" ":{this.isForcePanning=!1,this.spaceKey=!1;break}}(s=(r=this.currentTool).onKeyUp)==null||s.call(r,e,t,n)}});d(this,"refreshBoundingBoxes",()=>{let e=this.shapes.map(n=>[n.id,S({point:[...n.point]},"label"in n&&{label:""})]),t=this.shapes.map(n=>[n.id,S({point:[...n.point]},"label"in n&&{label:n.label})]);Hd(),this.patchState({document:{pages:{[this.currentPageId]:{shapes:Object.fromEntries(e)}}}}),this.patchState({document:{pages:{[this.currentPageId]:{shapes:Object.fromEntries(t)}}}})});d(this,"onDragOver",e=>{e.preventDefault()});d(this,"onDrop",e=>z(this,null,function*(){var t;return e.preventDefault(),this.disableAssets?this:((t=e.dataTransfer.files)!=null&&t.length&&this.addMediaFromFiles(Object.values(e.dataTransfer.files),[e.clientX,e.clientY]),this)}));d(this,"onPinchStart",(e,t)=>{var n,r;(r=(n=this.currentTool).onPinchStart)==null||r.call(n,e,t)});d(this,"onPinchEnd",(e,t)=>{var n,r;return(r=(n=this.currentTool).onPinchEnd)==null?void 0:r.call(n,e,t)});d(this,"onPinch",(e,t)=>{var n,r;return(r=(n=this.currentTool).onPinch)==null?void 0:r.call(n,e,t)});d(this,"onPan",(e,t)=>{if(this.appState.status==="pinching")return;let n=se.div(e.delta,this.camera.zoom),r=this.camera.point,s=se.sub(r,n);se.isEqual(s,r)||(this.pan(n),this.isForcePanning||this.onPointerMove(e,t),Vd&&this.isForcePanning&&this.preventPaste())});d(this,"onZoom",(e,t)=>{if(this.state.appState.status!=="idle")return;let n=e.delta[2]/50;this.zoomBy(n,e.point),this.onPointerMove(e,t)});d(this,"updateInputs",e=>{this.currentPoint=this.getPagePoint(e.point).concat(e.pressure),this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey});d(this,"onPointerMove",(e,t)=>{var n,r,s,l,a;if(this.previousPoint=this.currentPoint,this.updateInputs(e,t),this.isForcePanning&&this.isPointing){(n=this.onPan)==null||n.call(this,w(S({},e),{delta:se.neg(e.delta)}),t);return}if((s=(r=this.currentTool).onPointerMove)==null||s.call(r,e,t),this.state.room){let{users:c,userId:p}=this.state.room;(a=(l=this.callbacks).onChangePresence)==null||a.call(l,this,w(S({},c[p]),{point:this.getPagePoint(e.point),session:!!this.session}))}});d(this,"onPointerDown",(e,t)=>{var n,r;if(t.buttons===4)this.isForcePanning=!0;else if(this.isPointing)return;this.isPointing=!0,this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),!this.isForcePanning&&(this.currentTool.type==="draw"&&t.pointerType==="pen"&&t.button===5&&(this.selectTool("erase"),this.isErasingWithPen=!0),(r=(n=this.currentTool).onPointerDown)==null||r.call(n,e,t))});d(this,"onPointerUp",(e,t)=>{var n,r;this.isPointing=!1,this.shiftKey||(this.isForcePanning=!1),this.updateInputs(e,t),(r=(n=this.currentTool).onPointerUp)==null||r.call(n,e,t),this.isErasingWithPen&&t.pointerType==="pen"&&t.button===5&&(this.selectTool("draw"),this.isErasingWithPen=!1)});d(this,"onPointCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onPointCanvas)==null||r.call(n,e,t)});d(this,"onDoubleClickCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDoubleClickCanvas)==null||r.call(n,e,t)});d(this,"onRightPointCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointCanvas)==null||r.call(n,e,t)});d(this,"onDragCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragCanvas)==null||r.call(n,e,t)});d(this,"onReleaseCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseCanvas)==null||r.call(n,e,t)});d(this,"onPointShape",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onPointShape)==null||r.call(n,e,t)});d(this,"onReleaseShape",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseShape)==null||r.call(n,e,t)});d(this,"onDoubleClickShape",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onDoubleClickShape)==null||r.call(n,e,t)});d(this,"onRightPointShape",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointShape)==null||r.call(n,e,t)});d(this,"onDragShape",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragShape)==null||r.call(n,e,t)});d(this,"onHoverShape",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onHoverShape)==null||r.call(n,e,t)});d(this,"onUnhoverShape",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onUnhoverShape)==null||r.call(n,e,t)});d(this,"onPointBounds",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onPointBounds)==null||r.call(n,e,t)});d(this,"onDoubleClickBounds",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onDoubleClickBounds)==null||r.call(n,e,t)});d(this,"onRightPointBounds",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointBounds)==null||r.call(n,e,t)});d(this,"onDragBounds",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragBounds)==null||r.call(n,e,t)});d(this,"onHoverBounds",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onHoverBounds)==null||r.call(n,e,t)});d(this,"onUnhoverBounds",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onUnhoverBounds)==null||r.call(n,e,t)});d(this,"onReleaseBounds",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseBounds)==null||r.call(n,e,t)});d(this,"onPointBoundsHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onPointBoundsHandle)==null||r.call(n,e,t)});d(this,"onDoubleClickBoundsHandle",(e,t)=>{var r,s;if(this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(s=(r=this.currentTool).onDoubleClickBoundsHandle)==null||s.call(r,e,t),this.selectedIds.length!==1)return;let n=this.getShape(this.selectedIds[0]);if(n.type==="image"||n.type==="video"){let l=this.document.assets[n.assetId],a=B.getShapeUtil(n),c=a.getCenter(n),p=a.getCenter(w(S({},n),{size:l.size})),u=se.sub(p,c);this.updateShapes({id:n.id,point:se.sub(n.point,u),size:l.size})}});d(this,"onRightPointBoundsHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointBoundsHandle)==null||r.call(n,e,t)});d(this,"onDragBoundsHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragBoundsHandle)==null||r.call(n,e,t)});d(this,"onHoverBoundsHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onHoverBoundsHandle)==null||r.call(n,e,t)});d(this,"onUnhoverBoundsHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onUnhoverBoundsHandle)==null||r.call(n,e,t)});d(this,"onReleaseBoundsHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseBoundsHandle)==null||r.call(n,e,t)});d(this,"onPointHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onPointHandle)==null||r.call(n,e,t)});d(this,"onDoubleClickHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onDoubleClickHandle)==null||r.call(n,e,t)});d(this,"onRightPointHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointHandle)==null||r.call(n,e,t)});d(this,"onDragHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragHandle)==null||r.call(n,e,t)});d(this,"onHoverHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onHoverHandle)==null||r.call(n,e,t)});d(this,"onUnhoverHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onUnhoverHandle)==null||r.call(n,e,t)});d(this,"onReleaseHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseHandle)==null||r.call(n,e,t)});d(this,"onShapeChange",e=>{let t=this.document.pages[this.currentPageId].shapes,n=S(S({},t[e.id]),e),r=Za(this,[n],this.currentPageId).after;return this.patchState(r,"patched_shapes")});d(this,"onShapeBlur",()=>{var n,r;if(performance.now()-this.editingStartTime<50)return;let{editingId:e}=this.pageState,{isToolLocked:t}=this.getAppState();if(e){let s=this.getShape(e);this.setEditingId(),s.type==="text"&&(s.text.trim().length<=0?this.patchState(Ua(this,[e]).after,"delete_empty_text"):t||this.select(e))}(r=(n=this.currentTool).onShapeBlur)==null||r.call(n)});d(this,"onShapeClone",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onShapeClone)==null||r.call(n,e,t)});d(this,"onRenderCountChange",e=>{let t=this.getAppState();t.isEmptyCanvas&&e.length>0?this.patchState({appState:{isEmptyCanvas:!1}},"empty_canvas:false"):!t.isEmptyCanvas&&e.length<=0&&this.patchState({appState:{isEmptyCanvas:!0}},"empty_canvas:true")});d(this,"onError",()=>{});d(this,"getShapeUtil",B.getShapeUtil);this.callbacks=t}setStatus(e){return this.patchState({appState:{status:e}},`set_status:${e}`)}get isMenuOpen(){return this.appState.isMenuOpen}get isLoading(){return this.appState.isLoading}get disableAssets(){return this.appState.disableAssets}get canvasMode(){var e;return(e=this.settings.canvasMode)!=null?e:"freehand"}get history(){return this.stack.slice(0,this.pointer+1)}set history(e){this.replaceHistory(e)}get document(){return this.state.document}get settings(){return this.state.settings}get appState(){return this.state.appState}get currentPageId(){return this.state.appState.currentPageId}get page(){return this.state.document.pages[this.currentPageId]}get shapes(){return Object.values(this.page.shapes)}get bindings(){return Object.values(this.page.bindings)}get assets(){return Object.values(this.document.assets)}get pageState(){return this.state.document.pageStates[this.currentPageId]}get camera(){return this.pageState.camera}get zoom(){return this.pageState.camera.zoom}get selectedIds(){return this.pageState.selectedIds}createTextShapeAtPoint(e,t,n){let{shapes:r,appState:{currentPageId:s,currentStyle:l}}=this,a=r.length===0?1:r.filter(h=>h.parentId===s).sort((h,g)=>g.childIndex-h.childIndex)[0].childIndex+1,c=kn["text"],p=c.create({id:t||ct.uniqueId(),parentId:s,childIndex:a,point:e,style:S({},l)}),u=c.getBounds(p);return p.point=se.sub(p.point,[u.width/2,u.height/2]),n?this.patchCreate([B.getShapeUtil(p.type).create(p)]):this.createShapes(p),this.setEditingId(p.id,!0),this}getImageOrVideoShapeAtPoint(e,t,n,r,s){let{shapes:l,appState:{currentPageId:a,currentStyle:c}}=this,p=l.length===0?1:l.filter(g=>g.parentId===a).sort((g,m)=>m.childIndex-g.childIndex)[0].childIndex+1,u=kn[t];if(r[0]>this.viewport.width){let g=r[1]/r[0];r[0]=this.viewport.width-128/this.camera.zoom*2,r[1]=r[0]*g,(r[1]<32||r[1]<32)&&(r[1]=32,r[0]=r[1]/g)}else if(r[1]>this.viewport.height){let g=r[0]/r[1];r[1]=this.viewport.height-128/this.camera.zoom*2,r[0]=r[1]*g,(r[1]<32||r[1]<32)&&(r[0]=32,r[1]=r[0]/g)}return u.create({id:e,parentId:a,childIndex:p,point:n,size:r,style:S({},c),assetId:s})}isSelected(e){return this.selectedIds.includes(e)}serializeVideo(e){let t=document.getElementById(e+"_video");if(t){let n=document.createElement("canvas");return n.width=t.videoWidth,n.height=t.videoHeight,n.getContext("2d").drawImage(t,0,0),n.toDataURL("image/png")}else throw new Error("Video with id "+e+" not found")}serializeImage(e){let t=document.getElementById(e+"_image");if(t){let n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),n.toDataURL("image/png")}else throw new Error("Image with id "+e+" not found")}patchAssets(e){this.document.assets=S(S({},this.document.assets),e)}get room(){return this.state.room}get isLocal(){return this.state.room===void 0||this.state.room.id==="local"}get status(){return this.appState.status}get currentUser(){if(!!this.state.room)return this.state.room.users[this.state.room.userId]}get centerPoint(){let{width:e,height:t}=this.rendererBounds;return se.toFixed([e/2,t/2])}get currentGrid(){let{zoom:e}=this.camera;return e<.15?8*16:e<1?8*4:8*1}},Bn=Ke;d(Bn,"version",15.5),d(Bn,"defaultDocument",{id:"doc",name:"New Document",version:Ke.version,pages:{page:{id:"page",name:"Page 1",childIndex:1,shapes:{},bindings:{}}},pageStates:{page:{id:"page",selectedIds:[],camera:{point:[0,0],zoom:1}}},assets:{}}),d(Bn,"defaultState",{settings:{isCadSelectMode:!1,isPenMode:!1,isDarkMode:!1,isZoomSnap:!1,isFocusMode:!1,isSnapping:!0,isDebugMode:!1,isReadonlyMode:!1,keepStyleMenuOpen:!1,nudgeDistanceLarge:16,nudgeDistanceSmall:1,showRotateHandles:!0,showBindingHandles:!0,showCloneHandles:!1,showGrid:!1,language:"en",dockPosition:"bottom",exportBackground:"transparent",canvasMode:"freehand"},appState:{status:"idle",activeTool:"select",hoveredId:void 0,currentPageId:"page",currentStyle:He,isToolLocked:!1,isMenuOpen:!1,isEmptyCanvas:!1,eraseLine:[],snapLines:[],isLoading:!1,disableAssets:!1},document:Ke.defaultDocument}),d(Bn,"assetSrc","telva-assets.json");var Kz={select:ar,erase:or,["text"]:dr,["draw"]:tr,["ellipse"]:nr,["rectangle"]:sr,["triangle"]:cr,["line"]:rr,["arrow"]:Qo,["sticky"]:lr,["pen"]:ir};import{jsx as Xe,jsxs as Xr}from"react/jsx-runtime";var Mu=aT,dT=()=>typeof window!="undefined"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches:!1;function AF({id:i,document:o,currentPageId:e,autofocus:t=!0,showMenu:n=!0,showMultiplayerMenu:r=!0,showPages:s=!0,showTools:l=!0,showZoom:a=!0,showStyles:c=!0,showUI:p=!0,readOnly:u=!1,disableAssets:h=!1,darkMode:g=dT(),components:m,onMount:f,onChange:v,onChangePresence:b,onNewProject:T,onSaveProject:y,onSaveProjectAs:x,onOpenProject:I,onOpenMedia:k,onUndo:R,onRedo:C,onPersist:E,onPatch:M,onCommand:L,onChangePage:A,onAssetCreate:K,onAssetDelete:re,onAssetUpload:F,onSessionStart:ee,onSessionEnd:pe,onExport:he,hideCursors:De,reactComponents:pt,googleFontsApiKey:Ze}){let[_e,Se]=ge.useState(i);ge.useEffect(()=>{Ze&&(La(Ze),Aa())},[Ze]);let[$,ie]=ge.useState(()=>new Bn(i,{onMount:f,onChange:v,onChangePresence:b,onNewProject:T,onSaveProject:y,onSaveProjectAs:x,onOpenProject:I,onOpenMedia:k,onUndo:R,onRedo:C,onPersist:E,onPatch:M,onCommand:L,onChangePage:A,onAssetDelete:re,onAssetCreate:K,onAssetUpload:F,onSessionStart:ee,onSessionEnd:pe})),[ae,_]=ge.useState(null),[G,Y]=ge.useState(null),[te,H]=ge.useState(null),[Ee,Vt]=ge.useState(null),Nt=ge.useCallback((be,Ye,qe,ue)=>{Vt(()=>be),_(()=>ue),Y(()=>Ye),H(()=>qe)},[]);return ge.useLayoutEffect(()=>{if(i===_e)return;let be=new Bn(i,{onMount:f,onChange:v,onChangePresence:b,onNewProject:T,onSaveProject:y,onSaveProjectAs:x,onOpenProject:I,onOpenMedia:k,onUndo:R,onRedo:C,onPersist:E,onPatch:M,onCommand:L,onChangePage:A,onAssetDelete:re,onAssetCreate:K,onAssetUpload:F,onExport:he,onSessionStart:ee,onSessionEnd:pe});Se(i),ie(be)},[_e,i]),ge.useEffect(()=>{!o||(o.id===$.document.id?$.updateDocument(o):$.loadDocument(o))},[o,$]),ge.useEffect(()=>{$.setDisableAssets(h)},[$,h]),ge.useEffect(()=>{!e||$.changePage(e)},[e,$]),ge.useEffect(()=>{$.readOnly=u,u||($.selectNone(),$.cancelSession(),$.setEditingId())},[$,u]),ge.useEffect(()=>{g!==$.settings.isDarkMode&&$.toggleDarkMode()},[$,g]),ge.useEffect(()=>{$.callbacks={onMount:f,onChange:v,onChangePresence:b,onNewProject:T,onSaveProject:y,onSaveProjectAs:x,onOpenProject:I,onOpenMedia:k,onUndo:R,onRedo:C,onPersist:E,onPatch:M,onCommand:L,onChangePage:A,onAssetDelete:re,onAssetCreate:K,onAssetUpload:F,onExport:he,onSessionStart:ee,onSessionEnd:pe}},[f,v,b,T,y,x,I,k,R,C,E,M,L,A,re,K,F,he,ee,pe]),ge.useLayoutEffect(()=>{var Ye;if(typeof window=="undefined"||!((Ye=window.document)!=null&&Ye.fonts))return;function be(){$.refreshBoundingBoxes()}return window.document.fonts.addEventListener("loadingdone",be),()=>{window.document.fonts.removeEventListener("loadingdone",be)}},[$]),Xe(Fs.Provider,{value:$,children:Xe($s.Provider,{value:{onYes:G,onCancel:ae,onNo:te,dialogState:Ee,setDialogState:Vt,openDialog:Nt},children:Xe(Xs.Provider,{value:pt||[],children:Xe(cT,{id:_e,autofocus:t,showPages:s,showMenu:n,showMultiplayerMenu:r,showStyles:c,showZoom:a,showTools:l,showUI:p,readOnly:u,components:m,hideCursors:De,reactComponents:pt},_e||"Telva")})})})}var cT=ge.memo(function({id:o,autofocus:e,showPages:t,showMenu:n,showMultiplayerMenu:r,showZoom:s,showStyles:l,showTools:a,readOnly:c,showUI:p,components:u,hideCursors:h,reactComponents:g}){var $,ie,ae;let m=N(),[f,v]=ge.useState(null),b=ge.useRef(null),T=ge.useRef(null),y=m.useStore(),{document:x,settings:I,appState:k,room:R}=y,C=y.appState.activeTool==="select",E=x.pages[k.currentPageId],M=x.pageStates[E.id],L=x.assets,{selectedIds:A}=M,K=A.length===1&&E.shapes[A[0]]&&B.getShapeUtil(E.shapes[A[0]].type).hideBounds,re=A.length===1&&E.shapes[A[0]]&&B.getShapeUtil(E.shapes[A[0]].type).hideResizeHandles,F=ge.useMemo(()=>({isDarkMode:I.isDarkMode,canvasMode:I.canvasMode||"freehand",nodeEditingId:k.nodeEditingId}),[I.isDarkMode,I.canvasMode,k.nodeEditingId]),ee=I.isCadSelectMode?!k.selectByContain:k.selectByContain,pe=ge.useMemo(()=>{let{selectByContain:_}=k,{isDarkMode:G,isCadSelectMode:Y}=I;if(G){let H=Y?_?"69, 155, 255":"105, 209, 73":"180, 180, 180";return{brushFill:`rgba(${H}, ${Y?.08:.05})`,brushStroke:`rgba(${H}, ${Y?.5:.25})`,brushDashStroke:`rgba(${H}, .6)`,selected:"rgba(13, 153, 255, 1)",selectFill:"rgba(13, 153, 255, 0.05)",background:"#ffffffff",foreground:"#383838"}}let te=Y?_?"0, 89, 242":"51, 163, 23":"0,0,0";return{brushFill:`rgba(${te}, ${Y?.08:.05})`,brushStroke:`rgba(${te}, ${Y?.4:.25})`,brushDashStroke:`rgba(${te}, .6)`,selected:"rgba(13, 153, 255, 1)",selectFill:"rgba(13, 153, 255, 0.05)",background:"#ffffffff",foreground:"#ffffffff"}},[I.isDarkMode,I.isCadSelectMode,k.selectByContain]),he=m.session!==void 0,De=he&&(($=m.session)==null?void 0:$.constructor.name)!=="BrushSession"||!C||K||!!M.editingId||!!k.nodeEditingId,pt=he||!C||!!k.nodeEditingId,Ze=he&&y.appState.status!=="brushing"||!C||!!k.nodeEditingId,_e=he||!C||M.camera.zoom<.2,Se=cd(I.language);return ge.useLayoutEffect(()=>{let _=b.current;!_||(I.isDarkMode?_.classList.add(Ls):_.classList.remove(Ls))},[I.isDarkMode]),Np(b),Xe(Os.Provider,{value:b,children:Xr(lT,{locale:Se.locale,messages:Se.messages,children:[Xe(Pd,{container:f}),Xr(uT,{ref:b,tabIndex:-0,children:[Xe(Js,{}),Xe(pT,{focusableRef:b,autofocus:e}),p&&Xr(hT,{ref:v,children:[Xe(mT,{children:Xe(Wp,{readOnly:c,showPages:t,showMenu:n,showMultiplayerMenu:r,showStyles:!1,showZoom:s})}),Xr(gT,{children:[a&&!c&&Xe(qs,{}),Xr(fT,{ref:T,children:[Xe(Ks,{children:Xe(Mu,{FallbackComponent:Ys,children:Xe(Bu,{id:o,containerRef:T,shapeUtils:kn,page:E,pageState:M,assets:L,snapLines:k.snapLines,eraseLine:k.eraseLine,grid:8,users:R==null?void 0:R.users,userId:R==null?void 0:R.userId,theme:pe,meta:F,components:u,hideCursors:h,hideBounds:De,hideHandles:pt,hideResizeHandles:re,hideIndicators:Ze,hideBindingHandles:!I.showBindingHandles,hideCloneHandles:_e,hideRotateHandles:!I.showRotateHandles,hideGrid:!I.showGrid,showDashedBrush:ee,performanceMode:(ie=m.session)==null?void 0:ie.performanceMode,onPinchStart:m.onPinchStart,onPinchEnd:m.onPinchEnd,onPinch:m.onPinch,onPan:m.onPan,onZoom:m.onZoom,onPointerDown:m.onPointerDown,onPointerMove:m.onPointerMove,onPointerUp:m.onPointerUp,onPointCanvas:m.onPointCanvas,onDoubleClickCanvas:m.onDoubleClickCanvas,onRightPointCanvas:m.onRightPointCanvas,onDragCanvas:m.onDragCanvas,onReleaseCanvas:m.onReleaseCanvas,onPointShape:m.onPointShape,onDoubleClickShape:m.onDoubleClickShape,onRightPointShape:m.onRightPointShape,onDragShape:m.onDragShape,onHoverShape:m.onHoverShape,onUnhoverShape:m.onUnhoverShape,onReleaseShape:m.onReleaseShape,onPointBounds:m.onPointBounds,onDoubleClickBounds:m.onDoubleClickBounds,onRightPointBounds:m.onRightPointBounds,onDragBounds:m.onDragBounds,onHoverBounds:m.onHoverBounds,onUnhoverBounds:m.onUnhoverBounds,onReleaseBounds:m.onReleaseBounds,onPointBoundsHandle:m.onPointBoundsHandle,onDoubleClickBoundsHandle:m.onDoubleClickBoundsHandle,onRightPointBoundsHandle:m.onRightPointBoundsHandle,onDragBoundsHandle:m.onDragBoundsHandle,onHoverBoundsHandle:m.onHoverBoundsHandle,onUnhoverBoundsHandle:m.onUnhoverBoundsHandle,onReleaseBoundsHandle:m.onReleaseBoundsHandle,onPointHandle:m.onPointHandle,onDoubleClickHandle:m.onDoubleClickHandle,onRightPointHandle:m.onRightPointHandle,onDragHandle:m.onDragHandle,onHoverHandle:m.onHoverHandle,onUnhoverHandle:m.onUnhoverHandle,onReleaseHandle:m.onReleaseHandle,onError:m.onError,onRenderCountChange:m.onRenderCountChange,onShapeChange:m.onShapeChange,onShapeBlur:m.onShapeBlur,onShapeClone:m.onShapeClone,onBoundsChange:m.updateBounds,onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,onDragOver:m.onDragOver,onDrop:m.onDrop})})}),a&&!c&&Xe(md,{})]}),Xe(Oa,{})]})]}),!p&&Xe(Ks,{children:Xe(Mu,{FallbackComponent:Ys,children:Xe(Bu,{id:o,containerRef:b,shapeUtils:kn,page:E,pageState:M,assets:L,snapLines:k.snapLines,eraseLine:k.eraseLine,grid:8,users:R==null?void 0:R.users,userId:R==null?void 0:R.userId,theme:pe,meta:F,components:u,hideCursors:h,hideBounds:De,hideHandles:pt,hideResizeHandles:re,hideIndicators:Ze,hideBindingHandles:!I.showBindingHandles,hideCloneHandles:_e,hideRotateHandles:!I.showRotateHandles,hideGrid:!I.showGrid,showDashedBrush:ee,performanceMode:(ae=m.session)==null?void 0:ae.performanceMode,onPinchStart:m.onPinchStart,onPinchEnd:m.onPinchEnd,onPinch:m.onPinch,onPan:m.onPan,onZoom:m.onZoom,onPointerDown:m.onPointerDown,onPointerMove:m.onPointerMove,onPointerUp:m.onPointerUp,onPointCanvas:m.onPointCanvas,onDoubleClickCanvas:m.onDoubleClickCanvas,onRightPointCanvas:m.onRightPointCanvas,onDragCanvas:m.onDragCanvas,onReleaseCanvas:m.onReleaseCanvas,onPointShape:m.onPointShape,onDoubleClickShape:m.onDoubleClickShape,onRightPointShape:m.onRightPointShape,onDragShape:m.onDragShape,onHoverShape:m.onHoverShape,onUnhoverShape:m.onUnhoverShape,onReleaseShape:m.onReleaseShape,onPointBounds:m.onPointBounds,onDoubleClickBounds:m.onDoubleClickBounds,onRightPointBounds:m.onRightPointBounds,onDragBounds:m.onDragBounds,onHoverBounds:m.onHoverBounds,onUnhoverBounds:m.onUnhoverBounds,onReleaseBounds:m.onReleaseBounds,onPointBoundsHandle:m.onPointBoundsHandle,onDoubleClickBoundsHandle:m.onDoubleClickBoundsHandle,onRightPointBoundsHandle:m.onRightPointBoundsHandle,onDragBoundsHandle:m.onDragBoundsHandle,onHoverBoundsHandle:m.onHoverBoundsHandle,onUnhoverBoundsHandle:m.onUnhoverBoundsHandle,onReleaseBoundsHandle:m.onReleaseBoundsHandle,onPointHandle:m.onPointHandle,onDoubleClickHandle:m.onDoubleClickHandle,onRightPointHandle:m.onRightPointHandle,onDragHandle:m.onDragHandle,onHoverHandle:m.onHoverHandle,onUnhoverHandle:m.onUnhoverHandle,onReleaseHandle:m.onReleaseHandle,onError:m.onError,onRenderCountChange:m.onRenderCountChange,onShapeChange:m.onShapeChange,onShapeBlur:m.onShapeBlur,onShapeClone:m.onShapeClone,onBoundsChange:m.updateBounds,onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,onDragOver:m.onDragOver,onDrop:m.onDrop})})})]})]})})}),pT=ge.memo(function({focusableRef:o,autofocus:e}){return Bl(o),ge.useEffect(()=>{var t;e&&((t=o.current)==null||t.focus())},[e]),null}),uT=P("div",{position:"absolute",height:"100%",width:"100%",minHeight:0,minWidth:0,maxHeight:"100%",maxWidth:"100%",overflow:"hidden",boxSizing:"border-box",outline:"none",userSelect:"none",WebkitUserSelect:"none",background:"$canvas","& input, textarea, button, select, label, button":{webkitTouchCallout:"none",webkitUserSelect:"none","-webkit-tap-highlight-color":"transparent","tap-highlight-color":"transparent"}}),hT=P("div",{position:"absolute",top:0,left:0,height:"100%",width:"100%",display:"flex",flexDirection:"column",zIndex:2,pointerEvents:"none"}),mT=P("div",{width:"100%",height:"40px",background:"$panel",borderBottom:"1px solid $separator",display:"flex",alignItems:"center",pointerEvents:"all",flexShrink:0,zIndex:300}),gT=P("div",{display:"flex",flex:1,minHeight:0,position:"relative"}),fT=P("div",{flex:1,position:"relative",overflow:"hidden",pointerEvents:"all",minWidth:0,"& .tv-container":{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:1}});export{zt as AlignStyle,oi as AlignType,Er as Arrow,Hs as ColorStyle,on as DashStyle,gr as Decoration,ii as DistributeType,Ia as Draw,wa as Ellipse,Vs as FlipType,Xu as FontSize,Bo as FontStyle,ES as Group,BS as Image,As as MoveType,AS as Pen,LS as ReactComponent,ka as Rectangle,Ve as SessionType,si as SizeStyle,_i as Sticky,ri as StretchType,zs as TVAssetType,B as TVDR,ni as TVEventHandler,fr as TVExportBackground,go as TVExportType,ne as TVShapeType,Ht as TVStatus,El as TVUserStatus,AF as Telva,Bn as TelvaApp,DS as Text,Ca as Triangle,MS as Video,Mo as buildCssGradient,Kc as getShapeUtil,kn as shapeUtils,Yu as useFileSystem};
38
+ `}catch(f){B.warn("Could not find telva-assets.json file.")}else l.textContent="@import url('https://fonts.googleapis.com/css2?family=Caveat+Brush&family=Source+Code+Pro&family=Source+Sans+Pro&family=Crimson+Pro&display=block');";s.append(l),r.append(s);let a=e.map(f=>this.getShape(f,this.currentPageId)).sort((f,v)=>f.childIndex-v.childIndex),c=dt.getCommonBounds(a.map(B.getRotatedBounds)),p=f=>z(this,null,function*(){let v=B.getShapeUtil(f),b=v.getBounds(f),T=yield v.getSvgElement(f,this.settings.isDarkMode);if(!!T)return f.type==="image"?T.setAttribute("href",this.document.assets[f.assetId].src):f.type==="video"&&T.setAttribute("href",this.serializeVideo(f.id)),T.setAttribute("transform",`translate(${(16+f.point[0]-c.minX).toFixed(2)}, ${(16+f.point[1]-c.minY).toFixed(2)}) rotate(${((f.rotation||0)*180/Math.PI).toFixed(2)}, ${(b.width/2).toFixed(2)}, ${(b.height/2).toFixed(2)})`),T});for(let f of a){if((m=f.children)!=null&&m.length){let b=document.createElementNS("http://www.w3.org/2000/svg","g");for(let T of f.children){let y=this.getShape(T,this.currentPageId),x=yield p(y);x&&b.append(x)}r.append(b);continue}let v=yield p(f);v&&r.append(v)}r.setAttribute("viewBox",[0,0,c.width+16*2,c.height+16*2].join(" ")),r.setAttribute("width",(c.width+16*2).toString()),r.setAttribute("height",(c.height+16*2).toString());let u=this.settings.exportBackground,h="#212529",g="rgb(248, 249, 250)";switch(u){case"auto":{r.style.setProperty("background-color",this.settings.isDarkMode?h:g);break}case"dark":{r.style.setProperty("background-color",h);break}case"light":{r.style.setProperty("background-color",g);break}case"transparent":default:{r.style.setProperty("background-color","transparent");break}}return r.querySelectorAll(".tv-fill-hitarea, .tv-stroke-hitarea, .tv-binding-indicator").forEach(f=>f.remove()),r}));d(this,"copySvg",(...t)=>z(this,[...t],function*(e=this.selectedIds.length?this.selectedIds:Object.keys(this.page.shapes)){if(e.length===0)return;let n=yield this.getSvg(e);if(!n)return;let r=B.getSvgString(n,1);this.clipboard=this.getContent(e);let s=JSON.stringify(S({type:"telva/clipboard",shapes:[],assets:[],bindings:[]},this.clipboard));return navigator.clipboard&&window.ClipboardItem&&navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([s],{type:"text/html"}),"text/plain":new Blob([r],{type:"text/plain"})})]),r}));d(this,"getContent",e=>{let t=this.getPage(this.currentPageId);if(e&&e.length===0||(e||(e=this.selectedIds),e.length===0&&(e=Object.keys(t.shapes)),e.length===0))return;let n=e.map(a=>t.shapes[a]).flatMap(a=>{var c;return[a,...((c=a.children)!=null?c:[]).map(p=>t.shapes[p])]}).map(rt),r=new Set(n.map(a=>a.id));n.forEach(a=>{a.parentId===this.currentPageId&&(a.parentId="currentPageId")});let s=Object.values(t.bindings).filter(a=>{if(r.has(a.fromId)||r.has(a.toId))return!0;if(r.has(a.fromId)){let p=n.find(u=>u.id===a.fromId).handles;p&&Object.values(p).forEach(u=>{u.bindingId===a.id&&(u.bindingId=void 0)})}if(r.has(a.toId)){let p=n.find(u=>u.id===a.toId).handles;p&&Object.values(p).forEach(u=>{u.bindingId===a.id&&(u.bindingId=void 0)})}return!1}).map(rt),l=[...new Set(n.map(a=>{if(!!a.assetId)return this.document.assets[a.assetId]}).filter(Boolean).map(rt))];return{shapes:n,bindings:s,assets:l}});d(this,"copyJson",(e=this.selectedIds)=>{let t=this.getContent(e);return t&&B.copyStringToClipboard(JSON.stringify(t)),this});d(this,"exportJson",(e=this.selectedIds)=>{let t=this.getContent(e);if(t){let n=new Blob([JSON.stringify(t)],{type:"application/json"}),r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download="export.json",s.click()}return this});d(this,"insertContent",(e,t={})=>this.setState(vu(this,e,t),"insert_content"));d(this,"getImage",(...n)=>z(this,[...n],function*(e="png",t={}){let{ids:r=this.selectedIds.length?this.selectedIds:Object.keys(this.page.shapes)}=t,s=yield this.getSvg(r,{includeFonts:e!=="svg"});if(!s)return;if(e==="svg"){let a=B.getSvgString(s,1);return new Blob([a],{type:"image/svg+xml"})}let l=yield B.getImageForSvg(s,e,t);if(!!l)return l}));d(this,"copyImage",(...n)=>z(this,[...n],function*(e="png",t={}){if(e==="svg"){this.copySvg(t.ids);return}if(!(navigator.clipboard&&window.ClipboardItem)){console.warn("Sorry, your browser does not support copying images.");return}let r=yield this.getImage(e,t);!r||navigator.clipboard.write([new ClipboardItem({[r.type]:r})])}));d(this,"exportImage",(...n)=>z(this,[...n],function*(e="png",t={}){var a;let{pageId:r=this.currentPageId}=t,s=yield this.getImage(e,t);if(!s)return;let l=(a=this.document.pages[r].name)!=null?a:"export";if(this.callbacks.onExport)this.callbacks.onExport(this,{name:l,type:e,blob:s});else{let c=URL.createObjectURL(s),p=document.createElement("a");p.href=c,p.download=`${l}.${e}`,p.click()}}));d(this,"convertToImage",()=>z(this,null,function*(){let e=this.selectedIds;if(!e.length)return;let t=[],n=[];for(let r of e){let s=this.getShape(r);if(s.type!=="reactComponent")continue;let l=B.getShapeUtil(s);if(!l.getSvgElement)continue;let a=yield l.getSvgElement(s,this.settings.isDarkMode);if(!a)continue;let c=a.getAttribute("href");if(!c)continue;let p=B.getShapeUtil("image").create({id:dt.uniqueId(),parentId:s.parentId,childIndex:s.childIndex,point:[...s.point],size:[...s.size],style:S({},s.style),assetId:"asset-"+dt.uniqueId()});this.patchState({document:{assets:{[`${p.assetId}`]:{id:p.assetId,type:"image",src:c,size:s.size,fileName:"component-snapshot.png"}}}},"add_asset"),t.push(p),n.push(s.id)}t.length>0&&(this.createShapes(...t),this.delete(n),this.select(...t.map(r=>r.id)))}));d(this,"setCamera",(e,t,n)=>(this.updateViewport(e,t),this.patchState({document:{pageStates:{[this.currentPageId]:{camera:{point:e,zoom:t}}}}},n),this));d(this,"resetCamera",()=>this.setCamera(this.centerPoint,1,"reset_camera"));d(this,"pan",e=>{let{camera:t}=this.pageState;return this.setCamera(se.toFixed(se.sub(t.point,e)),t.zoom,"panned")});d(this,"pinchZoom",(e,t,n)=>{let{camera:r}=this.pageState,s=se.sub(r.point,se.div(t,r.zoom)),l=n,a=se.sub(se.div(e,r.zoom),s),c=se.sub(se.div(e,l),s);return this.setCamera(se.toFixed(se.add(s,se.sub(c,a))),l,"pinch_zoomed")});d(this,"zoomTo",(e,t=this.centerPoint)=>{let{zoom:n,point:r}=this.camera,s=se.sub(se.div(t,n),r),l=se.sub(se.div(t,e),r);return this.setCamera(se.toFixed(se.add(r,se.sub(l,s))),e,"zoomed_camera")});d(this,"zoomIn",()=>{let e=Math.round(this.camera.zoom*100/25),t=B.getCameraZoom((e+1)*.25);return this.zoomTo(t)});d(this,"zoomOut",()=>{let e=Math.round(this.camera.zoom*100/25),t=B.getCameraZoom((e-1)*.25);return this.zoomTo(t)});d(this,"zoomToFit",()=>{let{shapes:e,pageState:{camera:t}}=this;if(e.length===0)return this;let{rendererBounds:n}=this,r=dt.getCommonBounds(e.map(B.getBounds)),s=B.getCameraZoom(Math.min((n.width-128)/r.width,(n.height-128)/r.height));s=t.zoom===s||t.zoom<1?Math.min(1,s):s;let l=(n.width-r.width*s)/2/s,a=(n.height-r.height*s)/2/s;return this.setCamera(se.toFixed(se.sub([l,a],[r.minX,r.minY])),s,"zoomed_to_fit")});d(this,"zoomToSelection",()=>{if(this.selectedIds.length===0)return this;let{rendererBounds:e}=this,t=B.getSelectedBounds(this.state),n=B.getCameraZoom(Math.min((e.width-128)/t.width,(e.height-128)/t.height));n=this.camera.zoom===n||this.camera.zoom<1?Math.min(1,n):n;let r=(e.width-t.width*n)/2/n,s=(e.height-t.height*n)/2/n;return this.setCamera(se.toFixed(se.sub([r,s],[t.minX,t.minY])),n,"zoomed_to_selection")});d(this,"zoomToContent",()=>{let e=this.shapes,t=this.pageState;if(e.length===0)return this;let{rendererBounds:n}=this,{zoom:r}=t.camera,s=dt.getCommonBounds(e.map(B.getBounds)),l=(n.width-s.width*r)/2/r,a=(n.height-s.height*r)/2/r;return this.setCamera(se.toFixed(se.sub([l,a],[s.minX,s.minY])),this.camera.zoom,"zoomed_to_content")});d(this,"resetZoom",()=>this.zoomTo(1));d(this,"zoomBy",dt.throttle((e,t)=>{let{zoom:n}=this.camera,r=B.getCameraZoom(n-e*n);return this.zoomTo(r,t)},16));d(this,"clearSelectHistory",()=>(this.selectHistory.pointer=0,this.selectHistory.stack=[this.selectedIds],this));d(this,"addToSelectHistory",e=>(this.selectHistory.pointer<this.selectHistory.stack.length&&(this.selectHistory.stack=this.selectHistory.stack.slice(0,this.selectHistory.pointer+1)),this.selectHistory.pointer++,this.selectHistory.stack.push(e),this));d(this,"setSelectedIds",(e,t=!1)=>{let n=t?[...this.pageState.selectedIds,...e]:[...e];return this.patchState({appState:{activeTool:"select"},document:{pageStates:{[this.currentPageId]:{selectedIds:n}}}},"selected")});d(this,"undoSelect",()=>(this.selectHistory.pointer>0&&(this.selectHistory.pointer--,this.setSelectedIds(this.selectHistory.stack[this.selectHistory.pointer])),this));d(this,"redoSelect",()=>(this.selectHistory.pointer<this.selectHistory.stack.length-1&&(this.selectHistory.pointer++,this.setSelectedIds(this.selectHistory.stack[this.selectHistory.pointer])),this));d(this,"select",(...e)=>(e.forEach(t=>{if(!this.page.shapes[t])throw Error(`That shape does not exist on page ${this.currentPageId}`)}),this.setSelectedIds(e),this.addToSelectHistory(e),this));d(this,"selectAll",(e=this.currentPageId)=>this.session?this:(this.setSelectedIds(Object.values(this.document.pages[e].shapes).filter(t=>t.parentId===e).map(t=>t.id)),this.addToSelectHistory(this.selectedIds),this.selectTool("select"),this));d(this,"selectNone",()=>(this.setSelectedIds([]),this.addToSelectHistory(this.selectedIds),this));d(this,"startSession",(e,...t)=>{var s,l;if(this.readOnly&&e!=="brush")return this;this.session&&(B.warn(`Already in a session! (${this.session.constructor.name})`),this.cancelSession());let n=Du(e);this.session=new n(this,...t);let r=this.session.start();return r&&this.patchState(r,`session:start_${this.session.constructor.name}`),(l=(s=this.callbacks).onSessionStart)==null||l.call(s,this,this.session.constructor.name),this});d(this,"updateSession",()=>{let{session:e}=this;if(!e)return this;let t=e.update();return t?this.patchState(t,`session:${e==null?void 0:e.constructor.name}`):this});d(this,"cancelSession",()=>{var n,r;let{session:e}=this;if(!e)return this;this.session=void 0;let t=e.cancel();return t&&this.patchState(t,`session:cancel:${e.constructor.name}`),this.setEditingId(),(r=(n=this.callbacks).onSessionEnd)==null||r.call(n,this,e.constructor.name),this});d(this,"completeSession",()=>{var n,r,s,l,a,c,p,u,h;let{session:e}=this;if(!e)return this;this.session=void 0;let t=e.complete();if(t===void 0)this.isCreating=!1,this.patchState({appState:{status:"idle"},document:{pageStates:{[this.currentPageId]:{editingId:void 0,bindingId:void 0,hoveredId:void 0}}}},`session:complete:${e.constructor.name}`);else if("after"in t){if(this.isCreating){if(t.before={appState:w(S({},t.before.appState),{status:"idle"}),document:{pages:{[this.currentPageId]:{shapes:Object.fromEntries(this.selectedIds.map(g=>[g,void 0]))}},pageStates:{[this.currentPageId]:{selectedIds:[],editingId:null,bindingId:null,hoveredId:null}}}},this.appState.isToolLocked){let g=((s=(r=(n=t.after)==null?void 0:n.document)==null?void 0:r.pageStates)==null?void 0:s[this.currentPageId])||{};g.selectedIds=[]}this.isCreating=!1}t.after.appState=w(S({},t.after.appState),{status:"idle"}),t.after.document=w(S({},t.after.document),{pageStates:w(S({},(l=t.after.document)==null?void 0:l.pageStates),{[this.currentPageId]:w(S({},(((a=t.after.document)==null?void 0:a.pageStates)||{})[this.currentPageId]),{editingId:null})})}),this.setState(t,`session:complete:${e.constructor.name}`)}else this.patchState(w(S({},t),{appState:w(S({},t.appState),{status:"idle"}),document:w(S({},t.document),{pageStates:{[this.currentPageId]:w(S({},(p=(c=t.document)==null?void 0:c.pageStates)==null?void 0:p[this.currentPageId]),{editingId:null})}})}),`session:complete:${e.constructor.name}`);return(h=(u=this.callbacks).onSessionEnd)==null||h.call(u,this,e.constructor.name),this});d(this,"createShapes",(...e)=>e.length===0?this:this.create(e.map(t=>B.getShapeUtil(t.type).create(S({parentId:this.currentPageId},t)))));d(this,"updateShapes",(...e)=>{let t=this.document.pages[this.currentPageId].shapes,n=e.filter(r=>t[r.id]);return n.length===0?this:this.setState(Za(this,n,this.currentPageId),"updated_shapes")});d(this,"create",(e=[],t=[])=>e.length===0?this:this.setState(Na(this,e,t)));d(this,"patchCreate",(e=[],t=[])=>e.length===0?this:this.patchState(Na(this,e,t).after));d(this,"delete",(e=this.selectedIds)=>{var n,r;if(e.length===0)return this;if(this.session)return this;let t=Ua(this,e);if(this.callbacks.onAssetDelete&&((n=t.before.document)==null?void 0:n.assets)&&((r=t.after.document)==null?void 0:r.assets)){let s=Object.keys(t.before.document.assets).filter(c=>!!t.before.document.assets[c]),l=Object.keys(t.after.document.assets).filter(c=>!!t.after.document.assets[c]);s.filter(c=>!l.includes(c)).forEach(c=>this.callbacks.onAssetDelete(this,c))}return this.setState(t)});d(this,"deleteAll",()=>(this.selectAll(),this.delete(),this));d(this,"style",(e,t=this.selectedIds)=>this.setState(mu(this,t,e)));d(this,"align",(e,t=this.selectedIds)=>t.length<2?this:this.setState(Xp(this,t,e)));d(this,"distribute",(e,t=this.selectedIds)=>t.length<3?this:this.setState(nu(this,t,e)));d(this,"stretch",(e,t=this.selectedIds)=>t.length<2?this:this.setState(hu(this,t,e)));d(this,"flipHorizontal",(e=this.selectedIds)=>e.length===0?this:this.setState(_a(this,e,"horizontal")));d(this,"flipVertical",(e=this.selectedIds)=>e.length===0?this:this.setState(_a(this,e,"vertical")));d(this,"moveToPage",(e,t=this.currentPageId,n=this.selectedIds)=>{if(n.length===0)return this;let{rendererBounds:r}=this;return this.setState(au(this,n,r,t,e)),this});d(this,"moveToBack",(e=this.selectedIds)=>e.length===0?this:this.setState(Nr(this,e,"toBack")));d(this,"moveBackward",(e=this.selectedIds)=>e.length===0?this:this.setState(Nr(this,e,"backward")));d(this,"moveForward",(e=this.selectedIds)=>e.length===0?this:this.setState(Nr(this,e,"forward")));d(this,"moveToFront",(e=this.selectedIds)=>e.length===0?this:this.setState(Nr(this,e,"toFront")));d(this,"nudge",(e,t=!1,n=this.selectedIds)=>{if(n.length===0)return this;let r=t?this.settings.showGrid?this.currentGrid*4:10:this.settings.showGrid?this.currentGrid:1;return this.setState(Su(this,n,se.mul(e,r)))});d(this,"duplicate",(e=this.selectedIds,t)=>this.readOnly?this:e.length===0?this:this.setState(ru(this,e,t)));d(this,"resetBounds",(e=this.selectedIds)=>{let t=Ya(this,e,this.currentPageId);return this.setState(Ya(this,e,this.currentPageId),t.id)});d(this,"toggleHidden",(e=this.selectedIds)=>e.length===0?this:this.setState(ps(this,e,"isHidden")));d(this,"toggleLocked",(e=this.selectedIds)=>e.length===0?this:this.setState(ps(this,e,"isLocked")));d(this,"toggleAspectRatioLocked",(e=this.selectedIds)=>e.length===0?this:this.setState(ps(this,e,"isAspectRatioLocked")));d(this,"toggleDecoration",(e,t=this.selectedIds)=>t.length===0||!(e==="start"||e==="end")?this:this.setState(gu(this,t,e)));d(this,"setShapeProps",(e,t=this.selectedIds)=>this.setState(bu(this,t,e)));d(this,"rotate",(e=Math.PI*-.5,t=this.selectedIds)=>{if(t.length===0)return this;let n=pu(this,t,e);return n?this.setState(n):this});d(this,"group",(e=this.selectedIds,t=dt.uniqueId(),n=this.currentPageId)=>{if(this.readOnly)return this;if(e.length===1&&this.getShape(e[0],n).type==="group")return this.ungroup(e,n);if(e.length<2)return this;let r=iu(this,e,t,n);return r?this.setState(r):this});d(this,"ungroup",(e=this.selectedIds,t=this.currentPageId)=>{if(this.readOnly)return this;let n=e.map(s=>this.getShape(s,t)).filter(s=>s.type==="group");if(n.length===0)return this;let r=yu(this,e,n,t);return r?this.setState(r):this});d(this,"cancel",()=>{var e,t;return(t=(e=this.currentTool).onCancel)==null||t.call(e),this});d(this,"addMediaFromFiles",(n,...r)=>z(this,[n,...r],function*(e,t=this.centerPoint){this.setIsLoading(!0);let s=[],l=this.getPagePoint(t);for(let a of e){let c=dt.uniqueId(),p=a.name.match(/\.[0-9a-z]+$/i);if(!p)throw Error("No extension");let u=Si.includes(p[0].toLowerCase()),h=yi.includes(p[0].toLowerCase());if(!(u||h))throw Error("Wrong extension");let g=u?"image":"video",m=u?"image":"video",f;try{if(this.callbacks.onAssetCreate){let v=yield this.callbacks.onAssetCreate(this,a,c);if(!v)throw Error("Asset creation callback returned false");f=v}else f=yield el(a);if(typeof f=="string"){let v=[0,0];if(u){if(p[0]==".svg"){let y,x=yield tl(a),I=this.getViewboxFromSVG(x);I&&(y=I.split(" "),v[0]=parseFloat(y[2]),v[1]=parseFloat(y[3]))}se.isEqual(v,[0,0])&&(v=yield nl(f))}else v=yield ol(f);let b=Object.values(this.document.assets).find(y=>y.type===m&&y.src===f),T;if(b)T=b.id;else{T=c;let y={id:T,type:m,name:a.name,src:f,size:v};this.patchState({document:{assets:{[T]:y}}})}s.push(this.getImageOrVideoShapeAtPoint(c,g,t,v,T))}}catch(v){console.warn(v)}}if(s.length){let a=se.add(l,[0,0]);s.forEach((p,u)=>{let h=B.getBounds(p);u===0&&(a[0]-=h.width/2,a[1]-=h.height/2),p.point=[...a],a[0]+=h.width});let c=dt.getCommonBounds(s.map(B.getBounds));this.createShapes(...s),dt.boundsContain(this.viewport,c)||(this.zoomToSelection(),this.zoom>1&&this.resetZoom())}return this.setIsLoading(!1),this}));d(this,"getViewboxFromSVG",e=>{let t=/.*?viewBox=["'](-?[\d.]+[, ]+-?[\d.]+[, ][\d.]+[, ][\d.]+)["']/;if(typeof e=="string"){let n=e.match(t);return n&&n.length>=2?n[1]:null}return this.setIsLoading(!1),null});d(this,"onKeyDown",(e,t,n)=>{var r,s;switch(n.key){case"/":{if(this.status==="idle"&&!this.pageState.editingId){let{shiftKey:l,metaKey:a,altKey:c,ctrlKey:p,spaceKey:u}=this;this.onPointerDown({target:"canvas",pointerId:0,origin:t.point,point:t.point,delta:[0,0],pressure:.5,shiftKey:l,ctrlKey:p,metaKey:a,altKey:c,spaceKey:u},{shiftKey:l,altKey:c,ctrlKey:p,pointerId:0,clientX:t.point[0],clientY:t.point[1]})}break}case"Escape":{this.cancel();break}case"Meta":{this.metaKey=!0;break}case"Alt":{this.altKey=!0;break}case"Control":{this.ctrlKey=!0;break}case" ":{this.isForcePanning=!0,this.spaceKey=!0;break}}return(s=(r=this.currentTool).onKeyDown)==null||s.call(r,e,t,n),this});d(this,"onKeyUp",(e,t,n)=>{var r,s;if(!!t){switch(n.key){case"/":{let{currentPoint:l,shiftKey:a,metaKey:c,altKey:p,ctrlKey:u,spaceKey:h}=this;this.onPointerUp({target:"canvas",pointerId:0,origin:l,point:l,delta:[0,0],pressure:.5,shiftKey:a,ctrlKey:u,metaKey:c,altKey:p,spaceKey:h},{shiftKey:a,altKey:p,ctrlKey:u,pointerId:0,clientX:l[0],clientY:l[1]});break}case"Meta":{this.metaKey=!1;break}case"Alt":{this.altKey=!1;break}case"Control":{this.ctrlKey=!1;break}case" ":{this.isForcePanning=!1,this.spaceKey=!1;break}}(s=(r=this.currentTool).onKeyUp)==null||s.call(r,e,t,n)}});d(this,"refreshBoundingBoxes",()=>{let e=this.shapes.map(n=>[n.id,S({point:[...n.point]},"label"in n&&{label:""})]),t=this.shapes.map(n=>[n.id,S({point:[...n.point]},"label"in n&&{label:n.label})]);Hd(),this.patchState({document:{pages:{[this.currentPageId]:{shapes:Object.fromEntries(e)}}}}),this.patchState({document:{pages:{[this.currentPageId]:{shapes:Object.fromEntries(t)}}}})});d(this,"onDragOver",e=>{e.preventDefault()});d(this,"onDrop",e=>z(this,null,function*(){var t;return e.preventDefault(),this.disableAssets?this:((t=e.dataTransfer.files)!=null&&t.length&&this.addMediaFromFiles(Object.values(e.dataTransfer.files),[e.clientX,e.clientY]),this)}));d(this,"onPinchStart",(e,t)=>{var n,r;(r=(n=this.currentTool).onPinchStart)==null||r.call(n,e,t)});d(this,"onPinchEnd",(e,t)=>{var n,r;return(r=(n=this.currentTool).onPinchEnd)==null?void 0:r.call(n,e,t)});d(this,"onPinch",(e,t)=>{var n,r;return(r=(n=this.currentTool).onPinch)==null?void 0:r.call(n,e,t)});d(this,"onPan",(e,t)=>{if(this.appState.status==="pinching")return;let n=se.div(e.delta,this.camera.zoom),r=this.camera.point,s=se.sub(r,n);se.isEqual(s,r)||(this.pan(n),this.isForcePanning||this.onPointerMove(e,t),Vd&&this.isForcePanning&&this.preventPaste())});d(this,"onZoom",(e,t)=>{if(this.state.appState.status!=="idle")return;let n=e.delta[2]/50;this.zoomBy(n,e.point),this.onPointerMove(e,t)});d(this,"updateInputs",e=>{this.currentPoint=this.getPagePoint(e.point).concat(e.pressure),this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey});d(this,"onPointerMove",(e,t)=>{var n,r,s,l,a;if(this.previousPoint=this.currentPoint,this.updateInputs(e,t),this.isForcePanning&&this.isPointing){(n=this.onPan)==null||n.call(this,w(S({},e),{delta:se.neg(e.delta)}),t);return}if((s=(r=this.currentTool).onPointerMove)==null||s.call(r,e,t),this.state.room){let{users:c,userId:p}=this.state.room;(a=(l=this.callbacks).onChangePresence)==null||a.call(l,this,w(S({},c[p]),{point:this.getPagePoint(e.point),session:!!this.session}))}});d(this,"onPointerDown",(e,t)=>{var n,r;if(t.buttons===4)this.isForcePanning=!0;else if(this.isPointing)return;this.isPointing=!0,this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),!this.isForcePanning&&(this.currentTool.type==="draw"&&t.pointerType==="pen"&&t.button===5&&(this.selectTool("erase"),this.isErasingWithPen=!0),(r=(n=this.currentTool).onPointerDown)==null||r.call(n,e,t))});d(this,"onPointerUp",(e,t)=>{var n,r;this.isPointing=!1,this.shiftKey||(this.isForcePanning=!1),this.updateInputs(e,t),(r=(n=this.currentTool).onPointerUp)==null||r.call(n,e,t),this.isErasingWithPen&&t.pointerType==="pen"&&t.button===5&&(this.selectTool("draw"),this.isErasingWithPen=!1)});d(this,"onPointCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onPointCanvas)==null||r.call(n,e,t)});d(this,"onDoubleClickCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDoubleClickCanvas)==null||r.call(n,e,t)});d(this,"onRightPointCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointCanvas)==null||r.call(n,e,t)});d(this,"onDragCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragCanvas)==null||r.call(n,e,t)});d(this,"onReleaseCanvas",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseCanvas)==null||r.call(n,e,t)});d(this,"onPointShape",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onPointShape)==null||r.call(n,e,t)});d(this,"onReleaseShape",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseShape)==null||r.call(n,e,t)});d(this,"onDoubleClickShape",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onDoubleClickShape)==null||r.call(n,e,t)});d(this,"onRightPointShape",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointShape)==null||r.call(n,e,t)});d(this,"onDragShape",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragShape)==null||r.call(n,e,t)});d(this,"onHoverShape",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onHoverShape)==null||r.call(n,e,t)});d(this,"onUnhoverShape",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onUnhoverShape)==null||r.call(n,e,t)});d(this,"onPointBounds",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onPointBounds)==null||r.call(n,e,t)});d(this,"onDoubleClickBounds",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onDoubleClickBounds)==null||r.call(n,e,t)});d(this,"onRightPointBounds",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointBounds)==null||r.call(n,e,t)});d(this,"onDragBounds",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragBounds)==null||r.call(n,e,t)});d(this,"onHoverBounds",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onHoverBounds)==null||r.call(n,e,t)});d(this,"onUnhoverBounds",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onUnhoverBounds)==null||r.call(n,e,t)});d(this,"onReleaseBounds",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseBounds)==null||r.call(n,e,t)});d(this,"onPointBoundsHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onPointBoundsHandle)==null||r.call(n,e,t)});d(this,"onDoubleClickBoundsHandle",(e,t)=>{var r,s;if(this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(s=(r=this.currentTool).onDoubleClickBoundsHandle)==null||s.call(r,e,t),this.selectedIds.length!==1)return;let n=this.getShape(this.selectedIds[0]);if(n.type==="image"||n.type==="video"){let l=this.document.assets[n.assetId],a=B.getShapeUtil(n),c=a.getCenter(n),p=a.getCenter(w(S({},n),{size:l.size})),u=se.sub(p,c);this.updateShapes({id:n.id,point:se.sub(n.point,u),size:l.size})}});d(this,"onRightPointBoundsHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointBoundsHandle)==null||r.call(n,e,t)});d(this,"onDragBoundsHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragBoundsHandle)==null||r.call(n,e,t)});d(this,"onHoverBoundsHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onHoverBoundsHandle)==null||r.call(n,e,t)});d(this,"onUnhoverBoundsHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onUnhoverBoundsHandle)==null||r.call(n,e,t)});d(this,"onReleaseBoundsHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseBoundsHandle)==null||r.call(n,e,t)});d(this,"onPointHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onPointHandle)==null||r.call(n,e,t)});d(this,"onDoubleClickHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onDoubleClickHandle)==null||r.call(n,e,t)});d(this,"onRightPointHandle",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onRightPointHandle)==null||r.call(n,e,t)});d(this,"onDragHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onDragHandle)==null||r.call(n,e,t)});d(this,"onHoverHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onHoverHandle)==null||r.call(n,e,t)});d(this,"onUnhoverHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onUnhoverHandle)==null||r.call(n,e,t)});d(this,"onReleaseHandle",(e,t)=>{var n,r;this.updateInputs(e,t),(r=(n=this.currentTool).onReleaseHandle)==null||r.call(n,e,t)});d(this,"onShapeChange",e=>{let t=this.document.pages[this.currentPageId].shapes,n=S(S({},t[e.id]),e),r=Za(this,[n],this.currentPageId).after;return this.patchState(r,"patched_shapes")});d(this,"onShapeBlur",()=>{var n,r;if(performance.now()-this.editingStartTime<50)return;let{editingId:e}=this.pageState,{isToolLocked:t}=this.getAppState();if(e){let s=this.getShape(e);this.setEditingId(),s.type==="text"&&(s.text.trim().length<=0?this.patchState(Ua(this,[e]).after,"delete_empty_text"):t||this.select(e))}(r=(n=this.currentTool).onShapeBlur)==null||r.call(n)});d(this,"onShapeClone",(e,t)=>{var n,r;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),(r=(n=this.currentTool).onShapeClone)==null||r.call(n,e,t)});d(this,"onRenderCountChange",e=>{let t=this.getAppState();t.isEmptyCanvas&&e.length>0?this.patchState({appState:{isEmptyCanvas:!1}},"empty_canvas:false"):!t.isEmptyCanvas&&e.length<=0&&this.patchState({appState:{isEmptyCanvas:!0}},"empty_canvas:true")});d(this,"onError",()=>{});d(this,"getShapeUtil",B.getShapeUtil);this.callbacks=t}setStatus(e){return this.patchState({appState:{status:e}},`set_status:${e}`)}get isMenuOpen(){return this.appState.isMenuOpen}get isLoading(){return this.appState.isLoading}get disableAssets(){return this.appState.disableAssets}get canvasMode(){var e;return(e=this.settings.canvasMode)!=null?e:"freehand"}get history(){return this.stack.slice(0,this.pointer+1)}set history(e){this.replaceHistory(e)}get document(){return this.state.document}get settings(){return this.state.settings}get appState(){return this.state.appState}get currentPageId(){return this.state.appState.currentPageId}get page(){return this.state.document.pages[this.currentPageId]}get shapes(){return Object.values(this.page.shapes)}get bindings(){return Object.values(this.page.bindings)}get assets(){return Object.values(this.document.assets)}get pageState(){return this.state.document.pageStates[this.currentPageId]}get camera(){return this.pageState.camera}get zoom(){return this.pageState.camera.zoom}get selectedIds(){return this.pageState.selectedIds}createTextShapeAtPoint(e,t,n){let{shapes:r,appState:{currentPageId:s,currentStyle:l}}=this,a=r.length===0?1:r.filter(h=>h.parentId===s).sort((h,g)=>g.childIndex-h.childIndex)[0].childIndex+1,c=kn["text"],p=c.create({id:t||dt.uniqueId(),parentId:s,childIndex:a,point:e,style:S({},l)}),u=c.getBounds(p);return p.point=se.sub(p.point,[u.width/2,u.height/2]),n?this.patchCreate([B.getShapeUtil(p.type).create(p)]):this.createShapes(p),this.setEditingId(p.id,!0),this}getImageOrVideoShapeAtPoint(e,t,n,r,s){let{shapes:l,appState:{currentPageId:a,currentStyle:c}}=this,p=l.length===0?1:l.filter(g=>g.parentId===a).sort((g,m)=>m.childIndex-g.childIndex)[0].childIndex+1,u=kn[t];if(r[0]>this.viewport.width){let g=r[1]/r[0];r[0]=this.viewport.width-128/this.camera.zoom*2,r[1]=r[0]*g,(r[1]<32||r[1]<32)&&(r[1]=32,r[0]=r[1]/g)}else if(r[1]>this.viewport.height){let g=r[0]/r[1];r[1]=this.viewport.height-128/this.camera.zoom*2,r[0]=r[1]*g,(r[1]<32||r[1]<32)&&(r[0]=32,r[1]=r[0]/g)}return u.create({id:e,parentId:a,childIndex:p,point:n,size:r,style:S({},c),assetId:s})}isSelected(e){return this.selectedIds.includes(e)}serializeVideo(e){let t=document.getElementById(e+"_video");if(t){let n=document.createElement("canvas");return n.width=t.videoWidth,n.height=t.videoHeight,n.getContext("2d").drawImage(t,0,0),n.toDataURL("image/png")}else throw new Error("Video with id "+e+" not found")}serializeImage(e){let t=document.getElementById(e+"_image");if(t){let n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),n.toDataURL("image/png")}else throw new Error("Image with id "+e+" not found")}patchAssets(e){this.document.assets=S(S({},this.document.assets),e)}get room(){return this.state.room}get isLocal(){return this.state.room===void 0||this.state.room.id==="local"}get status(){return this.appState.status}get currentUser(){if(!!this.state.room)return this.state.room.users[this.state.room.userId]}get centerPoint(){let{width:e,height:t}=this.rendererBounds;return se.toFixed([e/2,t/2])}get currentGrid(){let{zoom:e}=this.camera;return e<.15?8*16:e<1?8*4:8*1}},Bn=Ke;d(Bn,"version",15.5),d(Bn,"defaultDocument",{id:"doc",name:"New Document",version:Ke.version,pages:{page:{id:"page",name:"Page 1",childIndex:1,shapes:{},bindings:{}}},pageStates:{page:{id:"page",selectedIds:[],camera:{point:[0,0],zoom:1}}},assets:{}}),d(Bn,"defaultState",{settings:{isCadSelectMode:!1,isPenMode:!1,isDarkMode:!1,isZoomSnap:!1,isFocusMode:!1,isSnapping:!0,isDebugMode:!1,isReadonlyMode:!1,keepStyleMenuOpen:!1,nudgeDistanceLarge:16,nudgeDistanceSmall:1,showRotateHandles:!0,showBindingHandles:!0,showCloneHandles:!1,showGrid:!1,language:"en",dockPosition:"bottom",exportBackground:"transparent",canvasMode:"freehand"},appState:{status:"idle",activeTool:"select",hoveredId:void 0,currentPageId:"page",currentStyle:He,isToolLocked:!1,isMenuOpen:!1,isEmptyCanvas:!1,eraseLine:[],snapLines:[],isLoading:!1,disableAssets:!1},document:Ke.defaultDocument}),d(Bn,"assetSrc","telva-assets.json");var Kz={select:ar,erase:or,["text"]:dr,["draw"]:tr,["ellipse"]:nr,["rectangle"]:sr,["triangle"]:cr,["line"]:rr,["arrow"]:Qo,["sticky"]:lr,["pen"]:ir};import{jsx as Xe,jsxs as Yr}from"react/jsx-runtime";var Mu=aT,dT=()=>typeof window!="undefined"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches:!1;function AF({id:i,document:o,currentPageId:e,autofocus:t=!0,showMenu:n=!0,showMultiplayerMenu:r=!0,showPages:s=!0,showTools:l=!0,showZoom:a=!0,showStyles:c=!0,showUI:p=!0,readOnly:u=!1,disableAssets:h=!1,darkMode:g=dT(),components:m,onMount:f,onChange:v,onChangePresence:b,onNewProject:T,onSaveProject:y,onSaveProjectAs:x,onOpenProject:I,onOpenMedia:k,onUndo:R,onRedo:C,onPersist:E,onPatch:M,onCommand:L,onChangePage:A,onAssetCreate:K,onAssetDelete:re,onAssetUpload:F,onSessionStart:ee,onSessionEnd:pe,onExport:he,hideCursors:De,reactComponents:ct,googleFontsApiKey:Ze}){let[_e,Se]=ge.useState(i);ge.useEffect(()=>{Ze&&(La(Ze),Aa())},[Ze]);let[$,ie]=ge.useState(()=>new Bn(i,{onMount:f,onChange:v,onChangePresence:b,onNewProject:T,onSaveProject:y,onSaveProjectAs:x,onOpenProject:I,onOpenMedia:k,onUndo:R,onRedo:C,onPersist:E,onPatch:M,onCommand:L,onChangePage:A,onAssetDelete:re,onAssetCreate:K,onAssetUpload:F,onSessionStart:ee,onSessionEnd:pe})),[ae,_]=ge.useState(null),[G,Y]=ge.useState(null),[te,H]=ge.useState(null),[Ee,At]=ge.useState(null),Nt=ge.useCallback((be,Ye,qe,ue)=>{At(()=>be),_(()=>ue),Y(()=>Ye),H(()=>qe)},[]);return ge.useLayoutEffect(()=>{if(i===_e)return;let be=new Bn(i,{onMount:f,onChange:v,onChangePresence:b,onNewProject:T,onSaveProject:y,onSaveProjectAs:x,onOpenProject:I,onOpenMedia:k,onUndo:R,onRedo:C,onPersist:E,onPatch:M,onCommand:L,onChangePage:A,onAssetDelete:re,onAssetCreate:K,onAssetUpload:F,onExport:he,onSessionStart:ee,onSessionEnd:pe});Se(i),ie(be)},[_e,i]),ge.useEffect(()=>{!o||(o.id===$.document.id?$.updateDocument(o):$.loadDocument(o))},[o,$]),ge.useEffect(()=>{$.setDisableAssets(h)},[$,h]),ge.useEffect(()=>{!e||$.changePage(e)},[e,$]),ge.useEffect(()=>{$.readOnly=u,u||($.selectNone(),$.cancelSession(),$.setEditingId())},[$,u]),ge.useEffect(()=>{g!==$.settings.isDarkMode&&$.toggleDarkMode()},[$,g]),ge.useEffect(()=>{$.callbacks={onMount:f,onChange:v,onChangePresence:b,onNewProject:T,onSaveProject:y,onSaveProjectAs:x,onOpenProject:I,onOpenMedia:k,onUndo:R,onRedo:C,onPersist:E,onPatch:M,onCommand:L,onChangePage:A,onAssetDelete:re,onAssetCreate:K,onAssetUpload:F,onExport:he,onSessionStart:ee,onSessionEnd:pe}},[f,v,b,T,y,x,I,k,R,C,E,M,L,A,re,K,F,he,ee,pe]),ge.useLayoutEffect(()=>{var Ye;if(typeof window=="undefined"||!((Ye=window.document)!=null&&Ye.fonts))return;function be(){$.refreshBoundingBoxes()}return window.document.fonts.addEventListener("loadingdone",be),()=>{window.document.fonts.removeEventListener("loadingdone",be)}},[$]),Xe(zs.Provider,{value:$,children:Xe(Os.Provider,{value:{onYes:G,onCancel:ae,onNo:te,dialogState:Ee,setDialogState:At,openDialog:Nt},children:Xe(Ys.Provider,{value:ct||[],children:Xe(cT,{id:_e,autofocus:t,showPages:s,showMenu:n,showMultiplayerMenu:r,showStyles:c,showZoom:a,showTools:l,showUI:p,readOnly:u,components:m,hideCursors:De,reactComponents:ct},_e||"Telva")})})})}var cT=ge.memo(function({id:o,autofocus:e,showPages:t,showMenu:n,showMultiplayerMenu:r,showZoom:s,showStyles:l,showTools:a,readOnly:c,showUI:p,components:u,hideCursors:h,reactComponents:g}){var $,ie,ae;let m=N(),[f,v]=ge.useState(null),b=ge.useRef(null),T=ge.useRef(null),y=m.useStore(),{document:x,settings:I,appState:k,room:R}=y,C=y.appState.activeTool==="select",E=x.pages[k.currentPageId],M=x.pageStates[E.id],L=x.assets,{selectedIds:A}=M,K=A.length===1&&E.shapes[A[0]]&&B.getShapeUtil(E.shapes[A[0]].type).hideBounds,re=A.length===1&&E.shapes[A[0]]&&B.getShapeUtil(E.shapes[A[0]].type).hideResizeHandles,F=ge.useMemo(()=>({isDarkMode:I.isDarkMode,canvasMode:I.canvasMode||"freehand",nodeEditingId:k.nodeEditingId}),[I.isDarkMode,I.canvasMode,k.nodeEditingId]),ee=I.isCadSelectMode?!k.selectByContain:k.selectByContain,pe=ge.useMemo(()=>{let{selectByContain:_}=k,{isDarkMode:G,isCadSelectMode:Y}=I;if(G){let H=Y?_?"69, 155, 255":"105, 209, 73":"180, 180, 180";return{brushFill:`rgba(${H}, ${Y?.08:.05})`,brushStroke:`rgba(${H}, ${Y?.5:.25})`,brushDashStroke:`rgba(${H}, .6)`,selected:"rgba(13, 153, 255, 1)",selectFill:"rgba(13, 153, 255, 0.05)",background:"#ffffffff",foreground:"#383838"}}let te=Y?_?"0, 89, 242":"51, 163, 23":"0,0,0";return{brushFill:`rgba(${te}, ${Y?.08:.05})`,brushStroke:`rgba(${te}, ${Y?.4:.25})`,brushDashStroke:`rgba(${te}, .6)`,selected:"rgba(13, 153, 255, 1)",selectFill:"rgba(13, 153, 255, 0.05)",background:"#ffffffff",foreground:"#ffffffff"}},[I.isDarkMode,I.isCadSelectMode,k.selectByContain]),he=m.session!==void 0,De=he&&(($=m.session)==null?void 0:$.constructor.name)!=="BrushSession"||!C||K||!!M.editingId||!!k.nodeEditingId,ct=he||!C||!!k.nodeEditingId,Ze=he&&y.appState.status!=="brushing"||!C||!!k.nodeEditingId,_e=he||!C||M.camera.zoom<.2,Se=cd(I.language);return ge.useLayoutEffect(()=>{let _=b.current;!_||(I.isDarkMode?_.classList.add(Ms):_.classList.remove(Ms))},[I.isDarkMode]),Np(b),Xe(Fs.Provider,{value:b,children:Yr(lT,{locale:Se.locale,messages:Se.messages,children:[Xe(Pd,{container:f}),Yr(uT,{ref:b,tabIndex:-0,children:[Xe(qs,{}),Xe(pT,{focusableRef:b,autofocus:e}),p&&Yr(hT,{ref:v,children:[Xe(mT,{children:Xe(Wp,{readOnly:c,showPages:t,showMenu:n,showMultiplayerMenu:r,showStyles:!1,showZoom:s})}),Yr(gT,{children:[a&&!c&&Xe(Zs,{}),Yr(fT,{ref:T,children:[Xe(Us,{children:Xe(Mu,{FallbackComponent:_s,children:Xe(Bu,{id:o,containerRef:T,shapeUtils:kn,page:E,pageState:M,assets:L,snapLines:k.snapLines,eraseLine:k.eraseLine,grid:8,users:R==null?void 0:R.users,userId:R==null?void 0:R.userId,theme:pe,meta:F,components:u,hideCursors:h,hideBounds:De,hideHandles:ct,hideResizeHandles:re,hideIndicators:Ze,hideBindingHandles:!I.showBindingHandles,hideCloneHandles:_e,hideRotateHandles:!I.showRotateHandles,hideGrid:!I.showGrid,showDashedBrush:ee,performanceMode:(ie=m.session)==null?void 0:ie.performanceMode,onPinchStart:m.onPinchStart,onPinchEnd:m.onPinchEnd,onPinch:m.onPinch,onPan:m.onPan,onZoom:m.onZoom,onPointerDown:m.onPointerDown,onPointerMove:m.onPointerMove,onPointerUp:m.onPointerUp,onPointCanvas:m.onPointCanvas,onDoubleClickCanvas:m.onDoubleClickCanvas,onRightPointCanvas:m.onRightPointCanvas,onDragCanvas:m.onDragCanvas,onReleaseCanvas:m.onReleaseCanvas,onPointShape:m.onPointShape,onDoubleClickShape:m.onDoubleClickShape,onRightPointShape:m.onRightPointShape,onDragShape:m.onDragShape,onHoverShape:m.onHoverShape,onUnhoverShape:m.onUnhoverShape,onReleaseShape:m.onReleaseShape,onPointBounds:m.onPointBounds,onDoubleClickBounds:m.onDoubleClickBounds,onRightPointBounds:m.onRightPointBounds,onDragBounds:m.onDragBounds,onHoverBounds:m.onHoverBounds,onUnhoverBounds:m.onUnhoverBounds,onReleaseBounds:m.onReleaseBounds,onPointBoundsHandle:m.onPointBoundsHandle,onDoubleClickBoundsHandle:m.onDoubleClickBoundsHandle,onRightPointBoundsHandle:m.onRightPointBoundsHandle,onDragBoundsHandle:m.onDragBoundsHandle,onHoverBoundsHandle:m.onHoverBoundsHandle,onUnhoverBoundsHandle:m.onUnhoverBoundsHandle,onReleaseBoundsHandle:m.onReleaseBoundsHandle,onPointHandle:m.onPointHandle,onDoubleClickHandle:m.onDoubleClickHandle,onRightPointHandle:m.onRightPointHandle,onDragHandle:m.onDragHandle,onHoverHandle:m.onHoverHandle,onUnhoverHandle:m.onUnhoverHandle,onReleaseHandle:m.onReleaseHandle,onError:m.onError,onRenderCountChange:m.onRenderCountChange,onShapeChange:m.onShapeChange,onShapeBlur:m.onShapeBlur,onShapeClone:m.onShapeClone,onBoundsChange:m.updateBounds,onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,onDragOver:m.onDragOver,onDrop:m.onDrop})})}),a&&!c&&Xe(md,{})]}),Xe(Oa,{})]})]}),!p&&Xe(Us,{children:Xe(Mu,{FallbackComponent:_s,children:Xe(Bu,{id:o,containerRef:b,shapeUtils:kn,page:E,pageState:M,assets:L,snapLines:k.snapLines,eraseLine:k.eraseLine,grid:8,users:R==null?void 0:R.users,userId:R==null?void 0:R.userId,theme:pe,meta:F,components:u,hideCursors:h,hideBounds:De,hideHandles:ct,hideResizeHandles:re,hideIndicators:Ze,hideBindingHandles:!I.showBindingHandles,hideCloneHandles:_e,hideRotateHandles:!I.showRotateHandles,hideGrid:!I.showGrid,showDashedBrush:ee,performanceMode:(ae=m.session)==null?void 0:ae.performanceMode,onPinchStart:m.onPinchStart,onPinchEnd:m.onPinchEnd,onPinch:m.onPinch,onPan:m.onPan,onZoom:m.onZoom,onPointerDown:m.onPointerDown,onPointerMove:m.onPointerMove,onPointerUp:m.onPointerUp,onPointCanvas:m.onPointCanvas,onDoubleClickCanvas:m.onDoubleClickCanvas,onRightPointCanvas:m.onRightPointCanvas,onDragCanvas:m.onDragCanvas,onReleaseCanvas:m.onReleaseCanvas,onPointShape:m.onPointShape,onDoubleClickShape:m.onDoubleClickShape,onRightPointShape:m.onRightPointShape,onDragShape:m.onDragShape,onHoverShape:m.onHoverShape,onUnhoverShape:m.onUnhoverShape,onReleaseShape:m.onReleaseShape,onPointBounds:m.onPointBounds,onDoubleClickBounds:m.onDoubleClickBounds,onRightPointBounds:m.onRightPointBounds,onDragBounds:m.onDragBounds,onHoverBounds:m.onHoverBounds,onUnhoverBounds:m.onUnhoverBounds,onReleaseBounds:m.onReleaseBounds,onPointBoundsHandle:m.onPointBoundsHandle,onDoubleClickBoundsHandle:m.onDoubleClickBoundsHandle,onRightPointBoundsHandle:m.onRightPointBoundsHandle,onDragBoundsHandle:m.onDragBoundsHandle,onHoverBoundsHandle:m.onHoverBoundsHandle,onUnhoverBoundsHandle:m.onUnhoverBoundsHandle,onReleaseBoundsHandle:m.onReleaseBoundsHandle,onPointHandle:m.onPointHandle,onDoubleClickHandle:m.onDoubleClickHandle,onRightPointHandle:m.onRightPointHandle,onDragHandle:m.onDragHandle,onHoverHandle:m.onHoverHandle,onUnhoverHandle:m.onUnhoverHandle,onReleaseHandle:m.onReleaseHandle,onError:m.onError,onRenderCountChange:m.onRenderCountChange,onShapeChange:m.onShapeChange,onShapeBlur:m.onShapeBlur,onShapeClone:m.onShapeClone,onBoundsChange:m.updateBounds,onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,onDragOver:m.onDragOver,onDrop:m.onDrop})})})]})]})})}),pT=ge.memo(function({focusableRef:o,autofocus:e}){return Bl(o),ge.useEffect(()=>{var t;e&&((t=o.current)==null||t.focus())},[e]),null}),uT=P("div",{position:"absolute",height:"100%",width:"100%",minHeight:0,minWidth:0,maxHeight:"100%",maxWidth:"100%",overflow:"hidden",boxSizing:"border-box",outline:"none",userSelect:"none",WebkitUserSelect:"none",background:"$canvas","& input, textarea, button, select, label, button":{webkitTouchCallout:"none",webkitUserSelect:"none","-webkit-tap-highlight-color":"transparent","tap-highlight-color":"transparent"}}),hT=P("div",{position:"absolute",top:0,left:0,height:"100%",width:"100%",display:"flex",flexDirection:"column",zIndex:2,pointerEvents:"none"}),mT=P("div",{width:"100%",height:"40px",background:"$panel",borderBottom:"1px solid $separator",display:"flex",alignItems:"center",pointerEvents:"all",flexShrink:0,zIndex:300}),gT=P("div",{display:"flex",flex:1,minHeight:0,position:"relative"}),fT=P("div",{flex:1,position:"relative",overflow:"hidden",pointerEvents:"all",minWidth:0,"& .tv-container":{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:1}});export{Ht as AlignStyle,ni as AlignType,Dr as Arrow,Vs as ColorStyle,on as DashStyle,gr as Decoration,ri as DistributeType,Ia as Draw,wa as Ellipse,As as FlipType,Xu as FontSize,Bo as FontStyle,ES as Group,BS as Image,Ls as MoveType,AS as Pen,LS as ReactComponent,ka as Rectangle,Ve as SessionType,ii as SizeStyle,Ki as Sticky,oi as StretchType,Hs as TVAssetType,B as TVDR,ti as TVEventHandler,fr as TVExportBackground,go as TVExportType,ne as TVShapeType,Vt as TVStatus,El as TVUserStatus,AF as Telva,Bn as TelvaApp,DS as Text,Ca as Triangle,MS as Video,Mo as buildCssGradient,Kc as getShapeUtil,kn as shapeUtils,Yu as useFileSystem};
39
39
  //# sourceMappingURL=index.mjs.map