@zsviczian/excalidraw 0.18.0-6 → 0.18.0-7

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.
Files changed (31) hide show
  1. package/dist/excalidraw.development.js +11 -11
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/excalidraw/actions/actionAddToLibrary.d.ts +12 -0
  5. package/types/excalidraw/actions/actionBoundText.d.ts +8 -0
  6. package/types/excalidraw/actions/actionCanvas.d.ts +60 -0
  7. package/types/excalidraw/actions/actionClipboard.d.ts +24 -0
  8. package/types/excalidraw/actions/actionCropEditor.d.ts +4 -0
  9. package/types/excalidraw/actions/actionDeleteSelected.d.ts +12 -0
  10. package/types/excalidraw/actions/actionElementLink.d.ts +4 -0
  11. package/types/excalidraw/actions/actionElementLock.d.ts +8 -0
  12. package/types/excalidraw/actions/actionEmbeddable.d.ts +4 -0
  13. package/types/excalidraw/actions/actionExport.d.ts +36 -0
  14. package/types/excalidraw/actions/actionFinalize.d.ts +8 -0
  15. package/types/excalidraw/actions/actionFrame.d.ts +16 -0
  16. package/types/excalidraw/actions/actionGroup.d.ts +8 -0
  17. package/types/excalidraw/actions/actionLinearEditor.d.ts +4 -0
  18. package/types/excalidraw/actions/actionLink.d.ts +4 -0
  19. package/types/excalidraw/actions/actionMenu.d.ts +12 -0
  20. package/types/excalidraw/actions/actionNavigate.d.ts +8 -0
  21. package/types/excalidraw/actions/actionProperties.d.ts +60 -0
  22. package/types/excalidraw/actions/actionSelectAll.d.ts +4 -0
  23. package/types/excalidraw/actions/actionStyles.d.ts +4 -0
  24. package/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -0
  25. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -0
  26. package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -0
  27. package/types/excalidraw/actions/actionToggleStats.d.ts +4 -0
  28. package/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -0
  29. package/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -0
  30. package/types/excalidraw/components/App.d.ts +0 -8
  31. package/types/excalidraw/types.d.ts +6 -0
@@ -8330,7 +8330,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
8330
8330
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
8331
8331
 
8332
8332
  "use strict";
8333
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n\n\nlet FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;\nif (typeof process !== 'undefined') {\n\t({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = ({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-5\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}) || 0);\n\tisTTY = process.stdout && process.stdout.isTTY;\n}\n\nconst $ = {\n\tenabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && (\n\t\tFORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY\n\t),\n\n\t// modifiers\n\treset: init(0, 0),\n\tbold: init(1, 22),\n\tdim: init(2, 22),\n\titalic: init(3, 23),\n\tunderline: init(4, 24),\n\tinverse: init(7, 27),\n\thidden: init(8, 28),\n\tstrikethrough: init(9, 29),\n\n\t// colors\n\tblack: init(30, 39),\n\tred: init(31, 39),\n\tgreen: init(32, 39),\n\tyellow: init(33, 39),\n\tblue: init(34, 39),\n\tmagenta: init(35, 39),\n\tcyan: init(36, 39),\n\twhite: init(37, 39),\n\tgray: init(90, 39),\n\tgrey: init(90, 39),\n\n\t// background colors\n\tbgBlack: init(40, 49),\n\tbgRed: init(41, 49),\n\tbgGreen: init(42, 49),\n\tbgYellow: init(43, 49),\n\tbgBlue: init(44, 49),\n\tbgMagenta: init(45, 49),\n\tbgCyan: init(46, 49),\n\tbgWhite: init(47, 49)\n};\n\nfunction run(arr, str) {\n\tlet i=0, tmp, beg='', end='';\n\tfor (; i < arr.length; i++) {\n\t\ttmp = arr[i];\n\t\tbeg += tmp.open;\n\t\tend += tmp.close;\n\t\tif (!!~str.indexOf(tmp.close)) {\n\t\t\tstr = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t}\n\t}\n\treturn beg + str + end;\n}\n\nfunction chain(has, keys) {\n\tlet ctx = { has, keys };\n\n\tctx.reset = $.reset.bind(ctx);\n\tctx.bold = $.bold.bind(ctx);\n\tctx.dim = $.dim.bind(ctx);\n\tctx.italic = $.italic.bind(ctx);\n\tctx.underline = $.underline.bind(ctx);\n\tctx.inverse = $.inverse.bind(ctx);\n\tctx.hidden = $.hidden.bind(ctx);\n\tctx.strikethrough = $.strikethrough.bind(ctx);\n\n\tctx.black = $.black.bind(ctx);\n\tctx.red = $.red.bind(ctx);\n\tctx.green = $.green.bind(ctx);\n\tctx.yellow = $.yellow.bind(ctx);\n\tctx.blue = $.blue.bind(ctx);\n\tctx.magenta = $.magenta.bind(ctx);\n\tctx.cyan = $.cyan.bind(ctx);\n\tctx.white = $.white.bind(ctx);\n\tctx.gray = $.gray.bind(ctx);\n\tctx.grey = $.grey.bind(ctx);\n\n\tctx.bgBlack = $.bgBlack.bind(ctx);\n\tctx.bgRed = $.bgRed.bind(ctx);\n\tctx.bgGreen = $.bgGreen.bind(ctx);\n\tctx.bgYellow = $.bgYellow.bind(ctx);\n\tctx.bgBlue = $.bgBlue.bind(ctx);\n\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\tctx.bgCyan = $.bgCyan.bind(ctx);\n\tctx.bgWhite = $.bgWhite.bind(ctx);\n\n\treturn ctx;\n}\n\nfunction init(open, close) {\n\tlet blk = {\n\t\topen: `\\x1b[${open}m`,\n\t\tclose: `\\x1b[${close}m`,\n\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, 'g')\n\t};\n\treturn function (txt) {\n\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\t!!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk));\n\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';\n\t\t}\n\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';\n\t};\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ($);\n\n\n//# sourceURL=webpack://ExcalidrawLib/../../node_modules/kleur/index.mjs?");
8333
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n\n\nlet FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;\nif (typeof process !== 'undefined') {\n\t({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = ({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-6\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}) || 0);\n\tisTTY = process.stdout && process.stdout.isTTY;\n}\n\nconst $ = {\n\tenabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && (\n\t\tFORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY\n\t),\n\n\t// modifiers\n\treset: init(0, 0),\n\tbold: init(1, 22),\n\tdim: init(2, 22),\n\titalic: init(3, 23),\n\tunderline: init(4, 24),\n\tinverse: init(7, 27),\n\thidden: init(8, 28),\n\tstrikethrough: init(9, 29),\n\n\t// colors\n\tblack: init(30, 39),\n\tred: init(31, 39),\n\tgreen: init(32, 39),\n\tyellow: init(33, 39),\n\tblue: init(34, 39),\n\tmagenta: init(35, 39),\n\tcyan: init(36, 39),\n\twhite: init(37, 39),\n\tgray: init(90, 39),\n\tgrey: init(90, 39),\n\n\t// background colors\n\tbgBlack: init(40, 49),\n\tbgRed: init(41, 49),\n\tbgGreen: init(42, 49),\n\tbgYellow: init(43, 49),\n\tbgBlue: init(44, 49),\n\tbgMagenta: init(45, 49),\n\tbgCyan: init(46, 49),\n\tbgWhite: init(47, 49)\n};\n\nfunction run(arr, str) {\n\tlet i=0, tmp, beg='', end='';\n\tfor (; i < arr.length; i++) {\n\t\ttmp = arr[i];\n\t\tbeg += tmp.open;\n\t\tend += tmp.close;\n\t\tif (!!~str.indexOf(tmp.close)) {\n\t\t\tstr = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t}\n\t}\n\treturn beg + str + end;\n}\n\nfunction chain(has, keys) {\n\tlet ctx = { has, keys };\n\n\tctx.reset = $.reset.bind(ctx);\n\tctx.bold = $.bold.bind(ctx);\n\tctx.dim = $.dim.bind(ctx);\n\tctx.italic = $.italic.bind(ctx);\n\tctx.underline = $.underline.bind(ctx);\n\tctx.inverse = $.inverse.bind(ctx);\n\tctx.hidden = $.hidden.bind(ctx);\n\tctx.strikethrough = $.strikethrough.bind(ctx);\n\n\tctx.black = $.black.bind(ctx);\n\tctx.red = $.red.bind(ctx);\n\tctx.green = $.green.bind(ctx);\n\tctx.yellow = $.yellow.bind(ctx);\n\tctx.blue = $.blue.bind(ctx);\n\tctx.magenta = $.magenta.bind(ctx);\n\tctx.cyan = $.cyan.bind(ctx);\n\tctx.white = $.white.bind(ctx);\n\tctx.gray = $.gray.bind(ctx);\n\tctx.grey = $.grey.bind(ctx);\n\n\tctx.bgBlack = $.bgBlack.bind(ctx);\n\tctx.bgRed = $.bgRed.bind(ctx);\n\tctx.bgGreen = $.bgGreen.bind(ctx);\n\tctx.bgYellow = $.bgYellow.bind(ctx);\n\tctx.bgBlue = $.bgBlue.bind(ctx);\n\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\tctx.bgCyan = $.bgCyan.bind(ctx);\n\tctx.bgWhite = $.bgWhite.bind(ctx);\n\n\treturn ctx;\n}\n\nfunction init(open, close) {\n\tlet blk = {\n\t\topen: `\\x1b[${open}m`,\n\t\tclose: `\\x1b[${close}m`,\n\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, 'g')\n\t};\n\treturn function (txt) {\n\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\t!!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk));\n\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';\n\t\t}\n\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';\n\t};\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ($);\n\n\n//# sourceURL=webpack://ExcalidrawLib/../../node_modules/kleur/index.mjs?");
8334
8334
 
8335
8335
  /***/ }),
8336
8336
 
@@ -12022,7 +12022,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
12022
12022
  \**********************************************************************/
12023
12023
  /***/ ((module, exports, __webpack_require__) => {
12024
12024
 
12025
- eval("/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = ({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-5\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"../../node_modules/micromark/node_modules/debug/src/common.js\")(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n\n\n//# sourceURL=webpack://ExcalidrawLib/../../node_modules/micromark/node_modules/debug/src/browser.js?");
12025
+ eval("/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = ({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-6\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"../../node_modules/micromark/node_modules/debug/src/common.js\")(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n\n\n//# sourceURL=webpack://ExcalidrawLib/../../node_modules/micromark/node_modules/debug/src/browser.js?");
12026
12026
 
12027
12027
  /***/ }),
12028
12028
 
@@ -13025,7 +13025,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
13025
13025
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
13026
13026
 
13027
13027
  "use strict";
13028
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addEventListener: () => (/* binding */ addEventListener),\n/* harmony export */ allowFullScreen: () => (/* binding */ allowFullScreen),\n/* harmony export */ arrayToList: () => (/* binding */ arrayToList),\n/* harmony export */ arrayToMap: () => (/* binding */ arrayToMap),\n/* harmony export */ arrayToMapWithIndex: () => (/* binding */ arrayToMapWithIndex),\n/* harmony export */ arrayToObject: () => (/* binding */ arrayToObject),\n/* harmony export */ assertNever: () => (/* binding */ assertNever),\n/* harmony export */ bytesToHexString: () => (/* binding */ bytesToHexString),\n/* harmony export */ capitalizeString: () => (/* binding */ capitalizeString),\n/* harmony export */ castArray: () => (/* binding */ castArray),\n/* harmony export */ chunk: () => (/* binding */ chunk),\n/* harmony export */ cloneJSON: () => (/* binding */ cloneJSON),\n/* harmony export */ composeEventHandlers: () => (/* binding */ composeEventHandlers),\n/* harmony export */ debounce: () => (/* binding */ debounce),\n/* harmony export */ distance: () => (/* binding */ distance),\n/* harmony export */ easeOut: () => (/* binding */ easeOut),\n/* harmony export */ easeToValuesRAF: () => (/* binding */ easeToValuesRAF),\n/* harmony export */ elementCenterPoint: () => (/* binding */ elementCenterPoint),\n/* harmony export */ escapeDoubleQuotes: () => (/* binding */ escapeDoubleQuotes),\n/* harmony export */ exitFullScreen: () => (/* binding */ exitFullScreen),\n/* harmony export */ findIndex: () => (/* binding */ findIndex),\n/* harmony export */ findLastIndex: () => (/* binding */ findLastIndex),\n/* harmony export */ focusNearestParent: () => (/* binding */ focusNearestParent),\n/* harmony export */ getDateTime: () => (/* binding */ getDateTime),\n/* harmony export */ getFontFamilyString: () => (/* binding */ getFontFamilyString),\n/* harmony export */ getFontString: () => (/* binding */ getFontString),\n/* harmony export */ getFrame: () => (/* binding */ getFrame),\n/* harmony export */ getGlobalCSSVariable: () => (/* binding */ getGlobalCSSVariable),\n/* harmony export */ getNearestScrollableContainer: () => (/* binding */ getNearestScrollableContainer),\n/* harmony export */ getShortcutKey: () => (/* binding */ getShortcutKey),\n/* harmony export */ getSvgPathFromStroke: () => (/* binding */ getSvgPathFromStroke),\n/* harmony export */ getUpdatedTimestamp: () => (/* binding */ getUpdatedTimestamp),\n/* harmony export */ getVersion: () => (/* binding */ getVersion),\n/* harmony export */ invariant: () => (/* binding */ invariant),\n/* harmony export */ isAnyTrue: () => (/* binding */ isAnyTrue),\n/* harmony export */ isBindingFallthroughEnabled: () => (/* binding */ isBindingFallthroughEnabled),\n/* harmony export */ isDevEnv: () => (/* binding */ isDevEnv),\n/* harmony export */ isFullScreen: () => (/* binding */ isFullScreen),\n/* harmony export */ isInputLike: () => (/* binding */ isInputLike),\n/* harmony export */ isInteractive: () => (/* binding */ isInteractive),\n/* harmony export */ isMemberOf: () => (/* binding */ isMemberOf),\n/* harmony export */ isPrimitive: () => (/* binding */ isPrimitive),\n/* harmony export */ isProdEnv: () => (/* binding */ isProdEnv),\n/* harmony export */ isPromiseLike: () => (/* binding */ isPromiseLike),\n/* harmony export */ isRTL: () => (/* binding */ isRTL),\n/* harmony export */ isRunningInIframe: () => (/* binding */ isRunningInIframe),\n/* harmony export */ isServerEnv: () => (/* binding */ isServerEnv),\n/* harmony export */ isShallowEqual: () => (/* binding */ isShallowEqual),\n/* harmony export */ isTestEnv: () => (/* binding */ isTestEnv),\n/* harmony export */ isToolIcon: () => (/* binding */ isToolIcon),\n/* harmony export */ isTransparent: () => (/* binding */ isTransparent),\n/* harmony export */ isWritableElement: () => (/* binding */ isWritableElement),\n/* harmony export */ memoize: () => (/* binding */ memoize),\n/* harmony export */ muteFSAbortError: () => (/* binding */ muteFSAbortError),\n/* harmony export */ nFormatter: () => (/* binding */ nFormatter),\n/* harmony export */ normalizeEOL: () => (/* binding */ normalizeEOL),\n/* harmony export */ preventUnload: () => (/* binding */ preventUnload),\n/* harmony export */ promiseTry: () => (/* binding */ promiseTry),\n/* harmony export */ queryFocusableElements: () => (/* binding */ queryFocusableElements),\n/* harmony export */ removeSelection: () => (/* binding */ removeSelection),\n/* harmony export */ resolvablePromise: () => (/* binding */ resolvablePromise),\n/* harmony export */ safelyParseJSON: () => (/* binding */ safelyParseJSON),\n/* harmony export */ sceneCoordsToViewportCoords: () => (/* binding */ sceneCoordsToViewportCoords),\n/* harmony export */ selectNode: () => (/* binding */ selectNode),\n/* harmony export */ setDateTimeForTests: () => (/* binding */ setDateTimeForTests),\n/* harmony export */ supportsEmoji: () => (/* binding */ supportsEmoji),\n/* harmony export */ throttleRAF: () => (/* binding */ throttleRAF),\n/* harmony export */ toBrandedType: () => (/* binding */ toBrandedType),\n/* harmony export */ tupleToCoors: () => (/* binding */ tupleToCoors),\n/* harmony export */ updateActiveTool: () => (/* binding */ updateActiveTool),\n/* harmony export */ updateObject: () => (/* binding */ updateObject),\n/* harmony export */ updateStable: () => (/* binding */ updateStable),\n/* harmony export */ viewportCoordsToSceneCoords: () => (/* binding */ viewportCoordsToSceneCoords),\n/* harmony export */ wrapEvent: () => (/* binding */ wrapEvent)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ \"../common/src/colors.ts\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ \"../common/src/constants.ts\");\n\n\n\nlet mockDateTime = null;\nconst setDateTimeForTests = dateTime => {\n mockDateTime = dateTime;\n};\nconst getDateTime = () => {\n if (mockDateTime) {\n return mockDateTime;\n }\n\n const date = new Date();\n const year = date.getFullYear();\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const hr = `${date.getHours()}`.padStart(2, \"0\");\n const min = `${date.getMinutes()}`.padStart(2, \"0\");\n return `${year}-${month}-${day}-${hr}${min}`;\n};\nconst capitalizeString = str => str.charAt(0).toUpperCase() + str.slice(1);\nconst isToolIcon = target => target instanceof HTMLElement && target.className.includes(\"ToolIcon\");\nconst isInputLike = target => target instanceof HTMLElement && target.dataset.type === \"wysiwyg\" || target instanceof HTMLBRElement || // newline in wysiwyg\ntarget instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement;\nconst isInteractive = target => {\n return isInputLike(target) || target instanceof Element && !!target.closest(\"label, button\");\n};\nconst isWritableElement = target => target instanceof HTMLElement && target.dataset.type === \"wysiwyg\" || target instanceof HTMLBRElement || // newline in wysiwyg\ntarget instanceof HTMLTextAreaElement || target instanceof HTMLInputElement && (target.type === \"text\" || target.type === \"number\" || target.type === \"password\");\nconst getFontFamilyString = ({\n fontFamily\n}) => {\n for (const [fontFamilyString, id] of Object.entries(_constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY)) {\n if (id === fontFamily) {\n // TODO: we should fallback first to generic family names first\n return `${fontFamilyString}${(0,_constants__WEBPACK_IMPORTED_MODULE_2__.getFontFamilyFallbacks)(id).map(x => `, ${x}`).join(\"\")}`;\n }\n }\n\n return _constants__WEBPACK_IMPORTED_MODULE_2__.WINDOWS_EMOJI_FALLBACK_FONT;\n};\n/** returns fontSize+fontFamily string for assignment to DOM elements */\n\nconst getFontString = ({\n fontSize,\n fontFamily\n}) => {\n return `${fontSize}px ${getFontFamilyString({\n fontFamily\n })}`;\n};\nconst debounce = (fn, timeout) => {\n let handle = 0;\n let lastArgs = null;\n\n const ret = (...args) => {\n lastArgs = args;\n clearTimeout(handle);\n handle = window.setTimeout(() => {\n lastArgs = null;\n fn(...args);\n }, timeout);\n };\n\n ret.flush = () => {\n clearTimeout(handle);\n\n if (lastArgs) {\n const _lastArgs = lastArgs;\n lastArgs = null;\n fn(..._lastArgs);\n }\n };\n\n ret.cancel = () => {\n lastArgs = null;\n clearTimeout(handle);\n };\n\n return ret;\n}; // throttle callback to execute once per animation frame\n\nconst throttleRAF = (fn, opts) => {\n let timerId = null;\n let lastArgs = null;\n let lastArgsTrailing = null;\n\n const scheduleFunc = args => {\n timerId = window.requestAnimationFrame(() => {\n timerId = null;\n fn(...args);\n lastArgs = null;\n\n if (lastArgsTrailing) {\n lastArgs = lastArgsTrailing;\n lastArgsTrailing = null;\n scheduleFunc(lastArgs);\n }\n });\n };\n\n const ret = (...args) => {\n if (isTestEnv()) {\n fn(...args);\n return;\n }\n\n lastArgs = args;\n\n if (timerId === null) {\n scheduleFunc(lastArgs);\n } else if (opts === null || opts === void 0 ? void 0 : opts.trailing) {\n lastArgsTrailing = args;\n }\n };\n\n ret.flush = () => {\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n\n if (lastArgs) {\n fn(...(lastArgsTrailing || lastArgs));\n lastArgs = lastArgsTrailing = null;\n }\n };\n\n ret.cancel = () => {\n lastArgs = lastArgsTrailing = null;\n\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n };\n\n return ret;\n};\n/**\r\n * Exponential ease-out method\r\n *\r\n * @param {number} k - The value to be tweened.\r\n * @returns {number} The tweened value.\r\n */\n\nconst easeOut = k => {\n return 1 - Math.pow(1 - k, 4);\n};\n\nconst easeOutInterpolate = (from, to, progress) => {\n return (to - from) * easeOut(progress) + from;\n};\n/**\r\n * Animates values from `fromValues` to `toValues` using the requestAnimationFrame API.\r\n * Executes the `onStep` callback on each step with the interpolated values.\r\n * Returns a function that can be called to cancel the animation.\r\n *\r\n * @example\r\n * // Example usage:\r\n * const fromValues = { x: 0, y: 0 };\r\n * const toValues = { x: 100, y: 200 };\r\n * const onStep = ({x, y}) => {\r\n * setState(x, y)\r\n * };\r\n * const onCancel = () => {\r\n * console.log(\"Animation canceled\");\r\n * };\r\n *\r\n * const cancelAnimation = easeToValuesRAF({\r\n * fromValues,\r\n * toValues,\r\n * onStep,\r\n * onCancel,\r\n * });\r\n *\r\n * // To cancel the animation:\r\n * cancelAnimation();\r\n */\n\n\nconst easeToValuesRAF = ({\n fromValues,\n toValues,\n onStep,\n duration = 250,\n interpolateValue,\n onStart,\n onEnd,\n onCancel\n}) => {\n let canceled = false;\n let frameId = 0;\n let startTime;\n\n function step(timestamp) {\n if (canceled) {\n return;\n }\n\n if (startTime === undefined) {\n startTime = timestamp;\n onStart === null || onStart === void 0 ? void 0 : onStart();\n }\n\n const elapsed = Math.min(timestamp - startTime, duration);\n const factor = easeOut(elapsed / duration);\n const newValues = {};\n Object.keys(fromValues).forEach(key => {\n const _key = key;\n const result = (toValues[_key] - fromValues[_key]) * factor + fromValues[_key];\n newValues[_key] = result;\n });\n onStep(newValues);\n\n if (elapsed < duration) {\n const progress = elapsed / duration;\n const newValues = {};\n Object.keys(fromValues).forEach(key => {\n const _key = key;\n const startValue = fromValues[_key];\n const endValue = toValues[_key];\n let result;\n result = interpolateValue ? interpolateValue(startValue, endValue, progress, _key) : easeOutInterpolate(startValue, endValue, progress);\n\n if (result == null) {\n result = easeOutInterpolate(startValue, endValue, progress);\n }\n\n newValues[_key] = result;\n });\n onStep(newValues);\n frameId = window.requestAnimationFrame(step);\n } else {\n onStep(toValues);\n onEnd === null || onEnd === void 0 ? void 0 : onEnd();\n }\n }\n\n frameId = window.requestAnimationFrame(step);\n return () => {\n onCancel === null || onCancel === void 0 ? void 0 : onCancel();\n canceled = true;\n window.cancelAnimationFrame(frameId);\n };\n}; // https://github.com/lodash/lodash/blob/es/chunk.js\n\nconst chunk = (array, size) => {\n if (!array.length || size < 1) {\n return [];\n }\n\n let index = 0;\n let resIndex = 0;\n const result = Array(Math.ceil(array.length / size));\n\n while (index < array.length) {\n result[resIndex++] = array.slice(index, index += size);\n }\n\n return result;\n};\nconst selectNode = node => {\n const selection = window.getSelection();\n\n if (selection) {\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n};\nconst removeSelection = () => {\n const selection = window.getSelection();\n\n if (selection) {\n selection.removeAllRanges();\n }\n};\nconst distance = (x, y) => Math.abs(x - y);\nconst updateActiveTool = (appState, data) => {\n var _a, _b, _c;\n\n if (data.type === \"custom\") {\n return Object.assign(Object.assign({}, appState.activeTool), {\n type: \"custom\",\n customType: data.customType,\n locked: (_a = data.locked) !== null && _a !== void 0 ? _a : appState.activeTool.locked\n });\n }\n\n return Object.assign(Object.assign({}, appState.activeTool), {\n lastActiveTool: data.lastActiveToolBeforeEraser === undefined ? appState.activeTool.lastActiveTool : data.lastActiveToolBeforeEraser,\n type: data.type,\n customType: null,\n locked: (_b = data.locked) !== null && _b !== void 0 ? _b : appState.activeTool.locked,\n fromSelection: (_c = data.fromSelection) !== null && _c !== void 0 ? _c : false\n });\n};\nconst isFullScreen = () => {\n var _a;\n\n return ((_a = document.fullscreenElement) === null || _a === void 0 ? void 0 : _a.nodeName) === \"HTML\";\n};\nconst allowFullScreen = () => document.documentElement.requestFullscreen();\nconst exitFullScreen = () => document.exitFullscreen();\nconst getShortcutKey = shortcut => {\n shortcut = shortcut.replace(/\\bAlt\\b/i, \"Alt\").replace(/\\bShift\\b/i, \"Shift\").replace(/\\b(Enter|Return)\\b/i, \"Enter\");\n\n if (_constants__WEBPACK_IMPORTED_MODULE_2__.isDarwin) {\n return shortcut.replace(/\\bCtrlOrCmd\\b/gi, \"Cmd\").replace(/\\bAlt\\b/i, \"Option\");\n }\n\n return shortcut.replace(/\\bCtrlOrCmd\\b/gi, \"Ctrl\");\n};\nconst viewportCoordsToSceneCoords = ({\n clientX,\n clientY\n}, {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY\n}) => {\n const x = (clientX - offsetLeft) / zoom.value - scrollX;\n const y = (clientY - offsetTop) / zoom.value - scrollY;\n return {\n x,\n y\n };\n};\nconst sceneCoordsToViewportCoords = ({\n sceneX,\n sceneY\n}, {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY\n}) => {\n const x = (sceneX + scrollX) * zoom.value + offsetLeft;\n const y = (sceneY + scrollY) * zoom.value + offsetTop;\n return {\n x,\n y\n };\n};\nconst getGlobalCSSVariable = name => getComputedStyle(document.documentElement).getPropertyValue(`--${name}`);\nconst RS_LTR_CHARS = \"A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\" + \"\\u2C00-\\uFB1C\\uFDFE-\\uFE6F\\uFEFD-\\uFFFF\";\nconst RS_RTL_CHARS = \"\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC\";\nconst RE_RTL_CHECK = new RegExp(`^[^${RS_LTR_CHARS}]*[${RS_RTL_CHARS}]`);\n/**\r\n * Checks whether first directional character is RTL. Meaning whether it starts\r\n * with RTL characters, or indeterminate (numbers etc.) characters followed by\r\n * RTL.\r\n * See https://github.com/excalidraw/excalidraw/pull/1722#discussion_r436340171\r\n */\n\nconst isRTL = text => RE_RTL_CHECK.test(text);\nconst tupleToCoors = xyTuple => {\n const [x, y] = xyTuple;\n return {\n x,\n y\n };\n};\n/** use as a rejectionHandler to mute filesystem Abort errors */\n\nconst muteFSAbortError = error => {\n if ((error === null || error === void 0 ? void 0 : error.name) === \"AbortError\") {\n console.warn(error);\n return;\n }\n\n throw error;\n};\nconst findIndex = (array, cb, fromIndex = 0) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n\n fromIndex = Math.min(array.length, Math.max(fromIndex, 0));\n let index = fromIndex - 1;\n\n while (++index < array.length) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n\n return -1;\n};\nconst findLastIndex = (array, cb, fromIndex = array.length - 1) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n\n fromIndex = Math.min(array.length - 1, Math.max(fromIndex, 0));\n let index = fromIndex + 1;\n\n while (--index > -1) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n\n return -1;\n};\nconst isTransparent = color => {\n const isRGBTransparent = color.length === 5 && color.substr(4, 1) === \"0\";\n const isRRGGBBTransparent = color.length === 9 && color.substr(7, 2) === \"00\";\n return isRGBTransparent || isRRGGBBTransparent || color === _colors__WEBPACK_IMPORTED_MODULE_1__.COLOR_PALETTE.transparent;\n};\nconst isBindingFallthroughEnabled = el => el.fillStyle !== \"solid\" || isTransparent(el.backgroundColor);\nconst resolvablePromise = () => {\n let resolve;\n let reject;\n const promise = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n promise.resolve = resolve;\n promise.reject = reject;\n return promise;\n}; //https://stackoverflow.com/a/9462382/8418\n\nconst nFormatter = (num, digits) => {\n const si = [{\n value: 1,\n symbol: \"b\"\n }, {\n value: 1e3,\n symbol: \"k\"\n }, {\n value: 1e6,\n symbol: \"M\"\n }, {\n value: 1e9,\n symbol: \"G\"\n }];\n const rx = /\\.0+$|(\\.[0-9]*[1-9])0+$/;\n let index;\n\n for (index = si.length - 1; index > 0; index--) {\n if (num >= si[index].value) {\n break;\n }\n }\n\n return (num / si[index].value).toFixed(digits).replace(rx, \"$1\") + si[index].symbol;\n};\nconst getVersion = () => {\n var _a;\n\n return ((_a = document.querySelector('meta[name=\"version\"]')) === null || _a === void 0 ? void 0 : _a.content) || _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_VERSION;\n}; // Adapted from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/emoji.js\n\nconst supportsEmoji = () => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n\n if (!ctx) {\n return false;\n }\n\n const offset = 12;\n ctx.fillStyle = \"#f00\";\n ctx.textBaseline = \"top\";\n ctx.font = \"32px Arial\"; // Modernizr used 🐨, but it is sort of supported on Windows 7.\n // Luckily 😀 isn't supported.\n\n ctx.fillText(\"😀\", 0, 0);\n return ctx.getImageData(offset, offset, 1, 1).data[0] !== 0;\n};\nconst getNearestScrollableContainer = element => {\n let parent = element.parentElement;\n\n while (parent) {\n if (parent === document.body) {\n return document;\n }\n\n const {\n overflowY\n } = window.getComputedStyle(parent);\n const hasScrollableContent = parent.scrollHeight > parent.clientHeight;\n\n if (hasScrollableContent && (overflowY === \"auto\" || overflowY === \"scroll\" || overflowY === \"overlay\")) {\n return parent;\n }\n\n parent = parent.parentElement;\n }\n\n return document;\n};\nconst focusNearestParent = element => {\n let parent = element.parentElement;\n\n while (parent) {\n if (parent.tabIndex > -1) {\n parent.focus();\n return;\n }\n\n parent = parent.parentElement;\n }\n};\nconst preventUnload = event => {\n event.preventDefault(); // NOTE: modern browsers no longer allow showing a custom message here\n\n event.returnValue = \"\";\n};\nconst bytesToHexString = bytes => {\n return Array.from(bytes).map(byte => `0${byte.toString(16)}`.slice(-2)).join(\"\");\n};\nconst getUpdatedTimestamp = () => isTestEnv() ? 1 : Date.now();\n/**\r\n * Transforms array of objects containing `id` attribute,\r\n * or array of ids (strings), into a Map, keyd by `id`.\r\n */\n\nconst arrayToMap = items => {\n if (items instanceof Map) {\n return items;\n }\n\n return items.reduce((acc, element) => {\n acc.set(typeof element === \"string\" ? element : element.id, element);\n return acc;\n }, new Map());\n};\nconst arrayToMapWithIndex = elements => elements.reduce((acc, element, idx) => {\n acc.set(element.id, [element, idx]);\n return acc;\n}, new Map());\n/**\r\n * Transform array into an object, use only when array order is irrelevant.\r\n */\n\nconst arrayToObject = (array, groupBy) => array.reduce((acc, value) => {\n acc[groupBy ? groupBy(value) : String(value)] = value;\n return acc;\n}, {});\n/**\r\n * Creates a circular doubly linked list by adding `prev` and `next` props to the existing array nodes.\r\n */\n\nconst arrayToList = array => array.reduce((acc, curr, index) => {\n const node = Object.assign(Object.assign({}, curr), {\n prev: null,\n next: null\n }); // no-op for first item, we don't want circular references on a single item\n\n if (index !== 0) {\n const prevNode = acc[index - 1];\n node.prev = prevNode;\n prevNode.next = node;\n\n if (index === array.length - 1) {\n // make the references circular and connect head & tail\n const firstNode = acc[0];\n node.next = firstNode;\n firstNode.prev = node;\n }\n }\n\n acc.push(node);\n return acc;\n}, []);\nconst isTestEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.TEST;\nconst isDevEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.DEVELOPMENT;\nconst isProdEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.PRODUCTION;\nconst isServerEnv = () => {\n var _a;\n\n return typeof process !== \"undefined\" && !!((_a = process === null || process === void 0 ? void 0 : ({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-5\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true})) === null || _a === void 0 ? void 0 : _a.NODE_ENV);\n};\nconst wrapEvent = (name, nativeEvent) => {\n return new CustomEvent(name, {\n detail: {\n nativeEvent\n },\n cancelable: true\n });\n};\nconst updateObject = (obj, updates) => {\n let didChange = false;\n\n for (const key in updates) {\n const value = updates[key];\n\n if (typeof value !== \"undefined\") {\n if (obj[key] === value && ( // if object, always update because its attrs could have changed\n typeof value !== \"object\" || value === null)) {\n continue;\n }\n\n didChange = true;\n }\n }\n\n if (!didChange) {\n return obj;\n }\n\n return Object.assign(Object.assign({}, obj), updates);\n};\nconst isPrimitive = val => {\n const type = typeof val;\n return val == null || type !== \"object\" && type !== \"function\";\n};\nconst getFrame = () => {\n try {\n return window.self === window.top ? \"top\" : \"iframe\";\n } catch (error) {\n return \"iframe\";\n }\n};\nconst isRunningInIframe = () => getFrame() === \"iframe\";\nconst isPromiseLike = value => {\n return !!value && typeof value === \"object\" && \"then\" in value && \"catch\" in value && \"finally\" in value;\n};\nconst queryFocusableElements = container => {\n const focusableElements = container === null || container === void 0 ? void 0 : container.querySelectorAll(\"button, a, input, select, textarea, div[tabindex], label[tabindex]\");\n return focusableElements ? Array.from(focusableElements).filter(element => element.tabIndex > -1 && !element.disabled) : [];\n};\n/** use as a fallback after identity check (for perf reasons) */\n\nconst _defaultIsShallowComparatorFallback = (a, b) => {\n // consider two empty arrays equal\n if (Array.isArray(a) && Array.isArray(b) && a.length === 0 && b.length === 0) {\n return true;\n }\n\n return a === b;\n};\n/**\r\n * Returns whether object/array is shallow equal.\r\n * Considers empty object/arrays as equal (whether top-level or second-level).\r\n */\n\n\nconst isShallowEqual = (objA, objB, comparators, debug = false) => {\n const aKeys = Object.keys(objA);\n const bKeys = Object.keys(objB);\n\n if (aKeys.length !== bKeys.length) {\n if (debug) {\n console.warn(`%cisShallowEqual: objects don't have same properties ->`, \"color: #8B4000\", objA, objB);\n }\n\n return false;\n }\n\n if (comparators && Array.isArray(comparators)) {\n for (const key of comparators) {\n const ret = objA[key] === objB[key] || _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n\n if (!ret) {\n if (debug) {\n console.warn(`%cisShallowEqual: ${key} not equal ->`, \"color: #8B4000\", objA[key], objB[key]);\n }\n\n return false;\n }\n }\n\n return true;\n }\n\n return aKeys.every(key => {\n const comparator = comparators === null || comparators === void 0 ? void 0 : comparators[key];\n const ret = comparator ? comparator(objA[key], objB[key]) : objA[key] === objB[key] || _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n\n if (!ret && debug) {\n console.warn(`%cisShallowEqual: ${key} not equal ->`, \"color: #8B4000\", objA[key], objB[key]);\n }\n\n return ret;\n });\n}; // taken from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/core/primitive/src/primitive.tsx\n\nconst composeEventHandlers = (originalEventHandler, ourEventHandler, {\n checkForDefaultPrevented = true\n} = {}) => {\n return function handleEvent(event) {\n originalEventHandler === null || originalEventHandler === void 0 ? void 0 : originalEventHandler(event);\n\n if (!checkForDefaultPrevented || !(event === null || event === void 0 ? void 0 : event.defaultPrevented)) {\n return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);\n }\n };\n};\n/**\r\n * supply `null` as message if non-never value is valid, you just need to\r\n * typecheck against it\r\n */\n\nconst assertNever = (value, message, softAssert) => {\n if (!message) {\n return value;\n }\n\n if (softAssert) {\n console.error(message);\n return value;\n }\n\n throw new Error(message);\n};\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n/**\r\n * Memoizes on values of `opts` object (strict equality).\r\n */\n\nconst memoize = func => {\n let lastArgs;\n let lastResult;\n\n const ret = function (opts) {\n const currentArgs = Object.entries(opts);\n\n if (lastArgs) {\n let argsAreEqual = true;\n\n for (const [key, value] of currentArgs) {\n if (lastArgs.get(key) !== value) {\n argsAreEqual = false;\n break;\n }\n }\n\n if (argsAreEqual) {\n return lastResult;\n }\n }\n\n const result = func(opts);\n lastArgs = new Map(currentArgs);\n lastResult = result;\n return result;\n };\n\n ret.clear = () => {\n lastArgs = undefined;\n lastResult = undefined;\n };\n\n return ret;\n};\n/** Checks if value is inside given collection. Useful for type-safety. */\n\nconst isMemberOf = (\n/** Set/Map/Array/Object */\ncollection,\n/** value to look for */\nvalue) => {\n return collection instanceof Set || collection instanceof Map ? collection.has(value) : \"includes\" in collection ? collection.includes(value) : collection.hasOwnProperty(value);\n};\nconst cloneJSON = obj => JSON.parse(JSON.stringify(obj));\nconst updateStable = (prevValue, nextValue) => {\n if (isShallowEqual(prevValue, nextValue)) {\n return prevValue;\n }\n\n return nextValue;\n}; // implem\n\nfunction addEventListener(\n/**\r\n * allows for falsy values so you don't have to type check when adding\r\n * event listeners to optional elements\r\n */\ntarget, type, listener, options) {\n var _a;\n\n if (!target) {\n return () => {};\n }\n\n (_a = target === null || target === void 0 ? void 0 : target.addEventListener) === null || _a === void 0 ? void 0 : _a.call(target, type, listener, options);\n return () => {\n var _a;\n\n (_a = target === null || target === void 0 ? void 0 : target.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(target, type, listener, options);\n };\n}\nfunction getSvgPathFromStroke(points, closed = true) {\n const len = points.length;\n\n if (len < 4) {\n return ``;\n }\n\n let a = points[0];\n let b = points[1];\n const c = points[2];\n let result = `M${a[0].toFixed(2)},${a[1].toFixed(2)} Q${b[0].toFixed(2)},${b[1].toFixed(2)} ${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(b[0], c[0]).toFixed(2)},${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(b[1], c[1]).toFixed(2)} T`;\n\n for (let i = 2, max = len - 1; i < max; i++) {\n a = points[i];\n b = points[i + 1];\n result += `${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(a[0], b[0]).toFixed(2)},${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(a[1], b[1]).toFixed(2)} `;\n }\n\n if (closed) {\n result += \"Z\";\n }\n\n return result;\n}\nconst normalizeEOL = str => {\n return str.replace(/\\r?\\n|\\r/g, \"\\n\");\n};\n/**\r\n * Makes type into a branded type, ensuring that value is assignable to\r\n * the base ubranded type. Optionally you can explicitly supply current value\r\n * type to combine both (useful for composite branded types. Make sure you\r\n * compose branded types which are not composite themselves.)\r\n */\n\nconst toBrandedType = value => {\n return value;\n}; // -----------------------------------------------------------------------------\n// Promise.try, adapted from https://github.com/sindresorhus/p-try\n\nconst promiseTry = async (fn, ...args) => {\n return new Promise(resolve => {\n resolve(fn(...args));\n });\n};\nconst isAnyTrue = (...args) => Math.max(...args.map(arg => arg ? 1 : 0)) > 0;\nconst safelyParseJSON = json => {\n try {\n return JSON.parse(json);\n } catch (_a) {\n return null;\n }\n};\n/**\r\n * use when you need to render unsafe string as HTML attribute, but MAKE SURE\r\n * the attribute is double-quoted when constructing the HTML string\r\n */\n\nconst escapeDoubleQuotes = str => {\n return str.replace(/\"/g, \"&quot;\");\n};\nconst castArray = value => Array.isArray(value) ? value : [value];\nconst elementCenterPoint = (element, xOffset = 0, yOffset = 0) => {\n const {\n x,\n y,\n width,\n height\n } = element;\n const centerXPoint = x + width / 2 + xOffset;\n const centerYPoint = y + height / 2 + yOffset;\n return (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.pointFrom)(centerXPoint, centerYPoint);\n};\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/utils.ts?");
13028
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addEventListener: () => (/* binding */ addEventListener),\n/* harmony export */ allowFullScreen: () => (/* binding */ allowFullScreen),\n/* harmony export */ arrayToList: () => (/* binding */ arrayToList),\n/* harmony export */ arrayToMap: () => (/* binding */ arrayToMap),\n/* harmony export */ arrayToMapWithIndex: () => (/* binding */ arrayToMapWithIndex),\n/* harmony export */ arrayToObject: () => (/* binding */ arrayToObject),\n/* harmony export */ assertNever: () => (/* binding */ assertNever),\n/* harmony export */ bytesToHexString: () => (/* binding */ bytesToHexString),\n/* harmony export */ capitalizeString: () => (/* binding */ capitalizeString),\n/* harmony export */ castArray: () => (/* binding */ castArray),\n/* harmony export */ chunk: () => (/* binding */ chunk),\n/* harmony export */ cloneJSON: () => (/* binding */ cloneJSON),\n/* harmony export */ composeEventHandlers: () => (/* binding */ composeEventHandlers),\n/* harmony export */ debounce: () => (/* binding */ debounce),\n/* harmony export */ distance: () => (/* binding */ distance),\n/* harmony export */ easeOut: () => (/* binding */ easeOut),\n/* harmony export */ easeToValuesRAF: () => (/* binding */ easeToValuesRAF),\n/* harmony export */ elementCenterPoint: () => (/* binding */ elementCenterPoint),\n/* harmony export */ escapeDoubleQuotes: () => (/* binding */ escapeDoubleQuotes),\n/* harmony export */ exitFullScreen: () => (/* binding */ exitFullScreen),\n/* harmony export */ findIndex: () => (/* binding */ findIndex),\n/* harmony export */ findLastIndex: () => (/* binding */ findLastIndex),\n/* harmony export */ focusNearestParent: () => (/* binding */ focusNearestParent),\n/* harmony export */ getDateTime: () => (/* binding */ getDateTime),\n/* harmony export */ getFontFamilyString: () => (/* binding */ getFontFamilyString),\n/* harmony export */ getFontString: () => (/* binding */ getFontString),\n/* harmony export */ getFrame: () => (/* binding */ getFrame),\n/* harmony export */ getGlobalCSSVariable: () => (/* binding */ getGlobalCSSVariable),\n/* harmony export */ getNearestScrollableContainer: () => (/* binding */ getNearestScrollableContainer),\n/* harmony export */ getShortcutKey: () => (/* binding */ getShortcutKey),\n/* harmony export */ getSvgPathFromStroke: () => (/* binding */ getSvgPathFromStroke),\n/* harmony export */ getUpdatedTimestamp: () => (/* binding */ getUpdatedTimestamp),\n/* harmony export */ getVersion: () => (/* binding */ getVersion),\n/* harmony export */ invariant: () => (/* binding */ invariant),\n/* harmony export */ isAnyTrue: () => (/* binding */ isAnyTrue),\n/* harmony export */ isBindingFallthroughEnabled: () => (/* binding */ isBindingFallthroughEnabled),\n/* harmony export */ isDevEnv: () => (/* binding */ isDevEnv),\n/* harmony export */ isFullScreen: () => (/* binding */ isFullScreen),\n/* harmony export */ isInputLike: () => (/* binding */ isInputLike),\n/* harmony export */ isInteractive: () => (/* binding */ isInteractive),\n/* harmony export */ isMemberOf: () => (/* binding */ isMemberOf),\n/* harmony export */ isPrimitive: () => (/* binding */ isPrimitive),\n/* harmony export */ isProdEnv: () => (/* binding */ isProdEnv),\n/* harmony export */ isPromiseLike: () => (/* binding */ isPromiseLike),\n/* harmony export */ isRTL: () => (/* binding */ isRTL),\n/* harmony export */ isRunningInIframe: () => (/* binding */ isRunningInIframe),\n/* harmony export */ isServerEnv: () => (/* binding */ isServerEnv),\n/* harmony export */ isShallowEqual: () => (/* binding */ isShallowEqual),\n/* harmony export */ isTestEnv: () => (/* binding */ isTestEnv),\n/* harmony export */ isToolIcon: () => (/* binding */ isToolIcon),\n/* harmony export */ isTransparent: () => (/* binding */ isTransparent),\n/* harmony export */ isWritableElement: () => (/* binding */ isWritableElement),\n/* harmony export */ memoize: () => (/* binding */ memoize),\n/* harmony export */ muteFSAbortError: () => (/* binding */ muteFSAbortError),\n/* harmony export */ nFormatter: () => (/* binding */ nFormatter),\n/* harmony export */ normalizeEOL: () => (/* binding */ normalizeEOL),\n/* harmony export */ preventUnload: () => (/* binding */ preventUnload),\n/* harmony export */ promiseTry: () => (/* binding */ promiseTry),\n/* harmony export */ queryFocusableElements: () => (/* binding */ queryFocusableElements),\n/* harmony export */ removeSelection: () => (/* binding */ removeSelection),\n/* harmony export */ resolvablePromise: () => (/* binding */ resolvablePromise),\n/* harmony export */ safelyParseJSON: () => (/* binding */ safelyParseJSON),\n/* harmony export */ sceneCoordsToViewportCoords: () => (/* binding */ sceneCoordsToViewportCoords),\n/* harmony export */ selectNode: () => (/* binding */ selectNode),\n/* harmony export */ setDateTimeForTests: () => (/* binding */ setDateTimeForTests),\n/* harmony export */ supportsEmoji: () => (/* binding */ supportsEmoji),\n/* harmony export */ throttleRAF: () => (/* binding */ throttleRAF),\n/* harmony export */ toBrandedType: () => (/* binding */ toBrandedType),\n/* harmony export */ tupleToCoors: () => (/* binding */ tupleToCoors),\n/* harmony export */ updateActiveTool: () => (/* binding */ updateActiveTool),\n/* harmony export */ updateObject: () => (/* binding */ updateObject),\n/* harmony export */ updateStable: () => (/* binding */ updateStable),\n/* harmony export */ viewportCoordsToSceneCoords: () => (/* binding */ viewportCoordsToSceneCoords),\n/* harmony export */ wrapEvent: () => (/* binding */ wrapEvent)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ \"../common/src/colors.ts\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ \"../common/src/constants.ts\");\n\n\n\nlet mockDateTime = null;\nconst setDateTimeForTests = dateTime => {\n mockDateTime = dateTime;\n};\nconst getDateTime = () => {\n if (mockDateTime) {\n return mockDateTime;\n }\n\n const date = new Date();\n const year = date.getFullYear();\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const hr = `${date.getHours()}`.padStart(2, \"0\");\n const min = `${date.getMinutes()}`.padStart(2, \"0\");\n return `${year}-${month}-${day}-${hr}${min}`;\n};\nconst capitalizeString = str => str.charAt(0).toUpperCase() + str.slice(1);\nconst isToolIcon = target => target instanceof HTMLElement && target.className.includes(\"ToolIcon\");\nconst isInputLike = target => target instanceof HTMLElement && target.dataset.type === \"wysiwyg\" || target instanceof HTMLBRElement || // newline in wysiwyg\ntarget instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement;\nconst isInteractive = target => {\n return isInputLike(target) || target instanceof Element && !!target.closest(\"label, button\");\n};\nconst isWritableElement = target => target instanceof HTMLElement && target.dataset.type === \"wysiwyg\" || target instanceof HTMLBRElement || // newline in wysiwyg\ntarget instanceof HTMLTextAreaElement || target instanceof HTMLInputElement && (target.type === \"text\" || target.type === \"number\" || target.type === \"password\");\nconst getFontFamilyString = ({\n fontFamily\n}) => {\n for (const [fontFamilyString, id] of Object.entries(_constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY)) {\n if (id === fontFamily) {\n // TODO: we should fallback first to generic family names first\n return `${fontFamilyString}${(0,_constants__WEBPACK_IMPORTED_MODULE_2__.getFontFamilyFallbacks)(id).map(x => `, ${x}`).join(\"\")}`;\n }\n }\n\n return _constants__WEBPACK_IMPORTED_MODULE_2__.WINDOWS_EMOJI_FALLBACK_FONT;\n};\n/** returns fontSize+fontFamily string for assignment to DOM elements */\n\nconst getFontString = ({\n fontSize,\n fontFamily\n}) => {\n return `${fontSize}px ${getFontFamilyString({\n fontFamily\n })}`;\n};\nconst debounce = (fn, timeout) => {\n let handle = 0;\n let lastArgs = null;\n\n const ret = (...args) => {\n lastArgs = args;\n clearTimeout(handle);\n handle = window.setTimeout(() => {\n lastArgs = null;\n fn(...args);\n }, timeout);\n };\n\n ret.flush = () => {\n clearTimeout(handle);\n\n if (lastArgs) {\n const _lastArgs = lastArgs;\n lastArgs = null;\n fn(..._lastArgs);\n }\n };\n\n ret.cancel = () => {\n lastArgs = null;\n clearTimeout(handle);\n };\n\n return ret;\n}; // throttle callback to execute once per animation frame\n\nconst throttleRAF = (fn, opts) => {\n let timerId = null;\n let lastArgs = null;\n let lastArgsTrailing = null;\n\n const scheduleFunc = args => {\n timerId = window.requestAnimationFrame(() => {\n timerId = null;\n fn(...args);\n lastArgs = null;\n\n if (lastArgsTrailing) {\n lastArgs = lastArgsTrailing;\n lastArgsTrailing = null;\n scheduleFunc(lastArgs);\n }\n });\n };\n\n const ret = (...args) => {\n if (isTestEnv()) {\n fn(...args);\n return;\n }\n\n lastArgs = args;\n\n if (timerId === null) {\n scheduleFunc(lastArgs);\n } else if (opts === null || opts === void 0 ? void 0 : opts.trailing) {\n lastArgsTrailing = args;\n }\n };\n\n ret.flush = () => {\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n\n if (lastArgs) {\n fn(...(lastArgsTrailing || lastArgs));\n lastArgs = lastArgsTrailing = null;\n }\n };\n\n ret.cancel = () => {\n lastArgs = lastArgsTrailing = null;\n\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n };\n\n return ret;\n};\n/**\r\n * Exponential ease-out method\r\n *\r\n * @param {number} k - The value to be tweened.\r\n * @returns {number} The tweened value.\r\n */\n\nconst easeOut = k => {\n return 1 - Math.pow(1 - k, 4);\n};\n\nconst easeOutInterpolate = (from, to, progress) => {\n return (to - from) * easeOut(progress) + from;\n};\n/**\r\n * Animates values from `fromValues` to `toValues` using the requestAnimationFrame API.\r\n * Executes the `onStep` callback on each step with the interpolated values.\r\n * Returns a function that can be called to cancel the animation.\r\n *\r\n * @example\r\n * // Example usage:\r\n * const fromValues = { x: 0, y: 0 };\r\n * const toValues = { x: 100, y: 200 };\r\n * const onStep = ({x, y}) => {\r\n * setState(x, y)\r\n * };\r\n * const onCancel = () => {\r\n * console.log(\"Animation canceled\");\r\n * };\r\n *\r\n * const cancelAnimation = easeToValuesRAF({\r\n * fromValues,\r\n * toValues,\r\n * onStep,\r\n * onCancel,\r\n * });\r\n *\r\n * // To cancel the animation:\r\n * cancelAnimation();\r\n */\n\n\nconst easeToValuesRAF = ({\n fromValues,\n toValues,\n onStep,\n duration = 250,\n interpolateValue,\n onStart,\n onEnd,\n onCancel\n}) => {\n let canceled = false;\n let frameId = 0;\n let startTime;\n\n function step(timestamp) {\n if (canceled) {\n return;\n }\n\n if (startTime === undefined) {\n startTime = timestamp;\n onStart === null || onStart === void 0 ? void 0 : onStart();\n }\n\n const elapsed = Math.min(timestamp - startTime, duration);\n const factor = easeOut(elapsed / duration);\n const newValues = {};\n Object.keys(fromValues).forEach(key => {\n const _key = key;\n const result = (toValues[_key] - fromValues[_key]) * factor + fromValues[_key];\n newValues[_key] = result;\n });\n onStep(newValues);\n\n if (elapsed < duration) {\n const progress = elapsed / duration;\n const newValues = {};\n Object.keys(fromValues).forEach(key => {\n const _key = key;\n const startValue = fromValues[_key];\n const endValue = toValues[_key];\n let result;\n result = interpolateValue ? interpolateValue(startValue, endValue, progress, _key) : easeOutInterpolate(startValue, endValue, progress);\n\n if (result == null) {\n result = easeOutInterpolate(startValue, endValue, progress);\n }\n\n newValues[_key] = result;\n });\n onStep(newValues);\n frameId = window.requestAnimationFrame(step);\n } else {\n onStep(toValues);\n onEnd === null || onEnd === void 0 ? void 0 : onEnd();\n }\n }\n\n frameId = window.requestAnimationFrame(step);\n return () => {\n onCancel === null || onCancel === void 0 ? void 0 : onCancel();\n canceled = true;\n window.cancelAnimationFrame(frameId);\n };\n}; // https://github.com/lodash/lodash/blob/es/chunk.js\n\nconst chunk = (array, size) => {\n if (!array.length || size < 1) {\n return [];\n }\n\n let index = 0;\n let resIndex = 0;\n const result = Array(Math.ceil(array.length / size));\n\n while (index < array.length) {\n result[resIndex++] = array.slice(index, index += size);\n }\n\n return result;\n};\nconst selectNode = node => {\n const selection = window.getSelection();\n\n if (selection) {\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n};\nconst removeSelection = () => {\n const selection = window.getSelection();\n\n if (selection) {\n selection.removeAllRanges();\n }\n};\nconst distance = (x, y) => Math.abs(x - y);\nconst updateActiveTool = (appState, data) => {\n var _a, _b, _c;\n\n if (data.type === \"custom\") {\n return Object.assign(Object.assign({}, appState.activeTool), {\n type: \"custom\",\n customType: data.customType,\n locked: (_a = data.locked) !== null && _a !== void 0 ? _a : appState.activeTool.locked\n });\n }\n\n return Object.assign(Object.assign({}, appState.activeTool), {\n lastActiveTool: data.lastActiveToolBeforeEraser === undefined ? appState.activeTool.lastActiveTool : data.lastActiveToolBeforeEraser,\n type: data.type,\n customType: null,\n locked: (_b = data.locked) !== null && _b !== void 0 ? _b : appState.activeTool.locked,\n fromSelection: (_c = data.fromSelection) !== null && _c !== void 0 ? _c : false\n });\n};\nconst isFullScreen = () => {\n var _a;\n\n return ((_a = document.fullscreenElement) === null || _a === void 0 ? void 0 : _a.nodeName) === \"HTML\";\n};\nconst allowFullScreen = () => document.documentElement.requestFullscreen();\nconst exitFullScreen = () => document.exitFullscreen();\nconst getShortcutKey = shortcut => {\n shortcut = shortcut.replace(/\\bAlt\\b/i, \"Alt\").replace(/\\bShift\\b/i, \"Shift\").replace(/\\b(Enter|Return)\\b/i, \"Enter\");\n\n if (_constants__WEBPACK_IMPORTED_MODULE_2__.isDarwin) {\n return shortcut.replace(/\\bCtrlOrCmd\\b/gi, \"Cmd\").replace(/\\bAlt\\b/i, \"Option\");\n }\n\n return shortcut.replace(/\\bCtrlOrCmd\\b/gi, \"Ctrl\");\n};\nconst viewportCoordsToSceneCoords = ({\n clientX,\n clientY\n}, {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY\n}) => {\n const x = (clientX - offsetLeft) / zoom.value - scrollX;\n const y = (clientY - offsetTop) / zoom.value - scrollY;\n return {\n x,\n y\n };\n};\nconst sceneCoordsToViewportCoords = ({\n sceneX,\n sceneY\n}, {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY\n}) => {\n const x = (sceneX + scrollX) * zoom.value + offsetLeft;\n const y = (sceneY + scrollY) * zoom.value + offsetTop;\n return {\n x,\n y\n };\n};\nconst getGlobalCSSVariable = name => getComputedStyle(document.documentElement).getPropertyValue(`--${name}`);\nconst RS_LTR_CHARS = \"A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\" + \"\\u2C00-\\uFB1C\\uFDFE-\\uFE6F\\uFEFD-\\uFFFF\";\nconst RS_RTL_CHARS = \"\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC\";\nconst RE_RTL_CHECK = new RegExp(`^[^${RS_LTR_CHARS}]*[${RS_RTL_CHARS}]`);\n/**\r\n * Checks whether first directional character is RTL. Meaning whether it starts\r\n * with RTL characters, or indeterminate (numbers etc.) characters followed by\r\n * RTL.\r\n * See https://github.com/excalidraw/excalidraw/pull/1722#discussion_r436340171\r\n */\n\nconst isRTL = text => RE_RTL_CHECK.test(text);\nconst tupleToCoors = xyTuple => {\n const [x, y] = xyTuple;\n return {\n x,\n y\n };\n};\n/** use as a rejectionHandler to mute filesystem Abort errors */\n\nconst muteFSAbortError = error => {\n if ((error === null || error === void 0 ? void 0 : error.name) === \"AbortError\") {\n console.warn(error);\n return;\n }\n\n throw error;\n};\nconst findIndex = (array, cb, fromIndex = 0) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n\n fromIndex = Math.min(array.length, Math.max(fromIndex, 0));\n let index = fromIndex - 1;\n\n while (++index < array.length) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n\n return -1;\n};\nconst findLastIndex = (array, cb, fromIndex = array.length - 1) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n\n fromIndex = Math.min(array.length - 1, Math.max(fromIndex, 0));\n let index = fromIndex + 1;\n\n while (--index > -1) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n\n return -1;\n};\nconst isTransparent = color => {\n const isRGBTransparent = color.length === 5 && color.substr(4, 1) === \"0\";\n const isRRGGBBTransparent = color.length === 9 && color.substr(7, 2) === \"00\";\n return isRGBTransparent || isRRGGBBTransparent || color === _colors__WEBPACK_IMPORTED_MODULE_1__.COLOR_PALETTE.transparent;\n};\nconst isBindingFallthroughEnabled = el => el.fillStyle !== \"solid\" || isTransparent(el.backgroundColor);\nconst resolvablePromise = () => {\n let resolve;\n let reject;\n const promise = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n promise.resolve = resolve;\n promise.reject = reject;\n return promise;\n}; //https://stackoverflow.com/a/9462382/8418\n\nconst nFormatter = (num, digits) => {\n const si = [{\n value: 1,\n symbol: \"b\"\n }, {\n value: 1e3,\n symbol: \"k\"\n }, {\n value: 1e6,\n symbol: \"M\"\n }, {\n value: 1e9,\n symbol: \"G\"\n }];\n const rx = /\\.0+$|(\\.[0-9]*[1-9])0+$/;\n let index;\n\n for (index = si.length - 1; index > 0; index--) {\n if (num >= si[index].value) {\n break;\n }\n }\n\n return (num / si[index].value).toFixed(digits).replace(rx, \"$1\") + si[index].symbol;\n};\nconst getVersion = () => {\n var _a;\n\n return ((_a = document.querySelector('meta[name=\"version\"]')) === null || _a === void 0 ? void 0 : _a.content) || _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_VERSION;\n}; // Adapted from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/emoji.js\n\nconst supportsEmoji = () => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n\n if (!ctx) {\n return false;\n }\n\n const offset = 12;\n ctx.fillStyle = \"#f00\";\n ctx.textBaseline = \"top\";\n ctx.font = \"32px Arial\"; // Modernizr used 🐨, but it is sort of supported on Windows 7.\n // Luckily 😀 isn't supported.\n\n ctx.fillText(\"😀\", 0, 0);\n return ctx.getImageData(offset, offset, 1, 1).data[0] !== 0;\n};\nconst getNearestScrollableContainer = element => {\n let parent = element.parentElement;\n\n while (parent) {\n if (parent === document.body) {\n return document;\n }\n\n const {\n overflowY\n } = window.getComputedStyle(parent);\n const hasScrollableContent = parent.scrollHeight > parent.clientHeight;\n\n if (hasScrollableContent && (overflowY === \"auto\" || overflowY === \"scroll\" || overflowY === \"overlay\")) {\n return parent;\n }\n\n parent = parent.parentElement;\n }\n\n return document;\n};\nconst focusNearestParent = element => {\n let parent = element.parentElement;\n\n while (parent) {\n if (parent.tabIndex > -1) {\n parent.focus();\n return;\n }\n\n parent = parent.parentElement;\n }\n};\nconst preventUnload = event => {\n event.preventDefault(); // NOTE: modern browsers no longer allow showing a custom message here\n\n event.returnValue = \"\";\n};\nconst bytesToHexString = bytes => {\n return Array.from(bytes).map(byte => `0${byte.toString(16)}`.slice(-2)).join(\"\");\n};\nconst getUpdatedTimestamp = () => isTestEnv() ? 1 : Date.now();\n/**\r\n * Transforms array of objects containing `id` attribute,\r\n * or array of ids (strings), into a Map, keyd by `id`.\r\n */\n\nconst arrayToMap = items => {\n if (items instanceof Map) {\n return items;\n }\n\n return items.reduce((acc, element) => {\n acc.set(typeof element === \"string\" ? element : element.id, element);\n return acc;\n }, new Map());\n};\nconst arrayToMapWithIndex = elements => elements.reduce((acc, element, idx) => {\n acc.set(element.id, [element, idx]);\n return acc;\n}, new Map());\n/**\r\n * Transform array into an object, use only when array order is irrelevant.\r\n */\n\nconst arrayToObject = (array, groupBy) => array.reduce((acc, value) => {\n acc[groupBy ? groupBy(value) : String(value)] = value;\n return acc;\n}, {});\n/**\r\n * Creates a circular doubly linked list by adding `prev` and `next` props to the existing array nodes.\r\n */\n\nconst arrayToList = array => array.reduce((acc, curr, index) => {\n const node = Object.assign(Object.assign({}, curr), {\n prev: null,\n next: null\n }); // no-op for first item, we don't want circular references on a single item\n\n if (index !== 0) {\n const prevNode = acc[index - 1];\n node.prev = prevNode;\n prevNode.next = node;\n\n if (index === array.length - 1) {\n // make the references circular and connect head & tail\n const firstNode = acc[0];\n node.next = firstNode;\n firstNode.prev = node;\n }\n }\n\n acc.push(node);\n return acc;\n}, []);\nconst isTestEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.TEST;\nconst isDevEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.DEVELOPMENT;\nconst isProdEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.PRODUCTION;\nconst isServerEnv = () => {\n var _a;\n\n return typeof process !== \"undefined\" && !!((_a = process === null || process === void 0 ? void 0 : ({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-6\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true})) === null || _a === void 0 ? void 0 : _a.NODE_ENV);\n};\nconst wrapEvent = (name, nativeEvent) => {\n return new CustomEvent(name, {\n detail: {\n nativeEvent\n },\n cancelable: true\n });\n};\nconst updateObject = (obj, updates) => {\n let didChange = false;\n\n for (const key in updates) {\n const value = updates[key];\n\n if (typeof value !== \"undefined\") {\n if (obj[key] === value && ( // if object, always update because its attrs could have changed\n typeof value !== \"object\" || value === null)) {\n continue;\n }\n\n didChange = true;\n }\n }\n\n if (!didChange) {\n return obj;\n }\n\n return Object.assign(Object.assign({}, obj), updates);\n};\nconst isPrimitive = val => {\n const type = typeof val;\n return val == null || type !== \"object\" && type !== \"function\";\n};\nconst getFrame = () => {\n try {\n return window.self === window.top ? \"top\" : \"iframe\";\n } catch (error) {\n return \"iframe\";\n }\n};\nconst isRunningInIframe = () => getFrame() === \"iframe\";\nconst isPromiseLike = value => {\n return !!value && typeof value === \"object\" && \"then\" in value && \"catch\" in value && \"finally\" in value;\n};\nconst queryFocusableElements = container => {\n const focusableElements = container === null || container === void 0 ? void 0 : container.querySelectorAll(\"button, a, input, select, textarea, div[tabindex], label[tabindex]\");\n return focusableElements ? Array.from(focusableElements).filter(element => element.tabIndex > -1 && !element.disabled) : [];\n};\n/** use as a fallback after identity check (for perf reasons) */\n\nconst _defaultIsShallowComparatorFallback = (a, b) => {\n // consider two empty arrays equal\n if (Array.isArray(a) && Array.isArray(b) && a.length === 0 && b.length === 0) {\n return true;\n }\n\n return a === b;\n};\n/**\r\n * Returns whether object/array is shallow equal.\r\n * Considers empty object/arrays as equal (whether top-level or second-level).\r\n */\n\n\nconst isShallowEqual = (objA, objB, comparators, debug = false) => {\n const aKeys = Object.keys(objA);\n const bKeys = Object.keys(objB);\n\n if (aKeys.length !== bKeys.length) {\n if (debug) {\n console.warn(`%cisShallowEqual: objects don't have same properties ->`, \"color: #8B4000\", objA, objB);\n }\n\n return false;\n }\n\n if (comparators && Array.isArray(comparators)) {\n for (const key of comparators) {\n const ret = objA[key] === objB[key] || _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n\n if (!ret) {\n if (debug) {\n console.warn(`%cisShallowEqual: ${key} not equal ->`, \"color: #8B4000\", objA[key], objB[key]);\n }\n\n return false;\n }\n }\n\n return true;\n }\n\n return aKeys.every(key => {\n const comparator = comparators === null || comparators === void 0 ? void 0 : comparators[key];\n const ret = comparator ? comparator(objA[key], objB[key]) : objA[key] === objB[key] || _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n\n if (!ret && debug) {\n console.warn(`%cisShallowEqual: ${key} not equal ->`, \"color: #8B4000\", objA[key], objB[key]);\n }\n\n return ret;\n });\n}; // taken from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/core/primitive/src/primitive.tsx\n\nconst composeEventHandlers = (originalEventHandler, ourEventHandler, {\n checkForDefaultPrevented = true\n} = {}) => {\n return function handleEvent(event) {\n originalEventHandler === null || originalEventHandler === void 0 ? void 0 : originalEventHandler(event);\n\n if (!checkForDefaultPrevented || !(event === null || event === void 0 ? void 0 : event.defaultPrevented)) {\n return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);\n }\n };\n};\n/**\r\n * supply `null` as message if non-never value is valid, you just need to\r\n * typecheck against it\r\n */\n\nconst assertNever = (value, message, softAssert) => {\n if (!message) {\n return value;\n }\n\n if (softAssert) {\n console.error(message);\n return value;\n }\n\n throw new Error(message);\n};\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n/**\r\n * Memoizes on values of `opts` object (strict equality).\r\n */\n\nconst memoize = func => {\n let lastArgs;\n let lastResult;\n\n const ret = function (opts) {\n const currentArgs = Object.entries(opts);\n\n if (lastArgs) {\n let argsAreEqual = true;\n\n for (const [key, value] of currentArgs) {\n if (lastArgs.get(key) !== value) {\n argsAreEqual = false;\n break;\n }\n }\n\n if (argsAreEqual) {\n return lastResult;\n }\n }\n\n const result = func(opts);\n lastArgs = new Map(currentArgs);\n lastResult = result;\n return result;\n };\n\n ret.clear = () => {\n lastArgs = undefined;\n lastResult = undefined;\n };\n\n return ret;\n};\n/** Checks if value is inside given collection. Useful for type-safety. */\n\nconst isMemberOf = (\n/** Set/Map/Array/Object */\ncollection,\n/** value to look for */\nvalue) => {\n return collection instanceof Set || collection instanceof Map ? collection.has(value) : \"includes\" in collection ? collection.includes(value) : collection.hasOwnProperty(value);\n};\nconst cloneJSON = obj => JSON.parse(JSON.stringify(obj));\nconst updateStable = (prevValue, nextValue) => {\n if (isShallowEqual(prevValue, nextValue)) {\n return prevValue;\n }\n\n return nextValue;\n}; // implem\n\nfunction addEventListener(\n/**\r\n * allows for falsy values so you don't have to type check when adding\r\n * event listeners to optional elements\r\n */\ntarget, type, listener, options) {\n var _a;\n\n if (!target) {\n return () => {};\n }\n\n (_a = target === null || target === void 0 ? void 0 : target.addEventListener) === null || _a === void 0 ? void 0 : _a.call(target, type, listener, options);\n return () => {\n var _a;\n\n (_a = target === null || target === void 0 ? void 0 : target.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(target, type, listener, options);\n };\n}\nfunction getSvgPathFromStroke(points, closed = true) {\n const len = points.length;\n\n if (len < 4) {\n return ``;\n }\n\n let a = points[0];\n let b = points[1];\n const c = points[2];\n let result = `M${a[0].toFixed(2)},${a[1].toFixed(2)} Q${b[0].toFixed(2)},${b[1].toFixed(2)} ${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(b[0], c[0]).toFixed(2)},${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(b[1], c[1]).toFixed(2)} T`;\n\n for (let i = 2, max = len - 1; i < max; i++) {\n a = points[i];\n b = points[i + 1];\n result += `${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(a[0], b[0]).toFixed(2)},${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(a[1], b[1]).toFixed(2)} `;\n }\n\n if (closed) {\n result += \"Z\";\n }\n\n return result;\n}\nconst normalizeEOL = str => {\n return str.replace(/\\r?\\n|\\r/g, \"\\n\");\n};\n/**\r\n * Makes type into a branded type, ensuring that value is assignable to\r\n * the base ubranded type. Optionally you can explicitly supply current value\r\n * type to combine both (useful for composite branded types. Make sure you\r\n * compose branded types which are not composite themselves.)\r\n */\n\nconst toBrandedType = value => {\n return value;\n}; // -----------------------------------------------------------------------------\n// Promise.try, adapted from https://github.com/sindresorhus/p-try\n\nconst promiseTry = async (fn, ...args) => {\n return new Promise(resolve => {\n resolve(fn(...args));\n });\n};\nconst isAnyTrue = (...args) => Math.max(...args.map(arg => arg ? 1 : 0)) > 0;\nconst safelyParseJSON = json => {\n try {\n return JSON.parse(json);\n } catch (_a) {\n return null;\n }\n};\n/**\r\n * use when you need to render unsafe string as HTML attribute, but MAKE SURE\r\n * the attribute is double-quoted when constructing the HTML string\r\n */\n\nconst escapeDoubleQuotes = str => {\n return str.replace(/\"/g, \"&quot;\");\n};\nconst castArray = value => Array.isArray(value) ? value : [value];\nconst elementCenterPoint = (element, xOffset = 0, yOffset = 0) => {\n const {\n x,\n y,\n width,\n height\n } = element;\n const centerXPoint = x + width / 2 + xOffset;\n const centerYPoint = y + height / 2 + yOffset;\n return (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.pointFrom)(centerXPoint, centerYPoint);\n};\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/utils.ts?");
13029
13029
 
13030
13030
  /***/ }),
13031
13031
 
@@ -14125,7 +14125,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
14125
14125
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
14126
14126
 
14127
14127
  "use strict";
14128
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ trackEvent: () => (/* binding */ trackEvent)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n// place here categories that you want to track. We want to track just a\n // small subset of categories at a given time.\n\nconst ALLOWED_CATEGORIES_TO_TRACK = new Set([\"command_palette\", \"export\"]);\nconst trackEvent = (category, action, label, value) => {\n try {\n if (typeof window === \"undefined\" || ({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-5\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).VITE_WORKER_ID || \"true\" !== \"true\") {\n return;\n }\n\n if (!ALLOWED_CATEGORIES_TO_TRACK.has(category)) {\n return;\n }\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.isDevEnv)()) {\n // comment out to debug in dev\n return;\n }\n\n if (true) {\n console.info(\"trackEvent\", {\n category,\n action,\n label,\n value\n });\n }\n\n if (window.sa_event) {\n window.sa_event(action, {\n category,\n label,\n value\n });\n }\n } catch (error) {\n console.error(\"error during analytics\", error);\n }\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./analytics.ts?");
14128
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ trackEvent: () => (/* binding */ trackEvent)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n// place here categories that you want to track. We want to track just a\n // small subset of categories at a given time.\n\nconst ALLOWED_CATEGORIES_TO_TRACK = new Set([\"command_palette\", \"export\"]);\nconst trackEvent = (category, action, label, value) => {\n try {\n if (typeof window === \"undefined\" || ({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-6\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).VITE_WORKER_ID || \"true\" !== \"true\") {\n return;\n }\n\n if (!ALLOWED_CATEGORIES_TO_TRACK.has(category)) {\n return;\n }\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.isDevEnv)()) {\n // comment out to debug in dev\n return;\n }\n\n if (true) {\n console.info(\"trackEvent\", {\n category,\n action,\n label,\n value\n });\n }\n\n if (window.sa_event) {\n window.sa_event(action, {\n category,\n label,\n value\n });\n }\n } catch (error) {\n console.error(\"error during analytics\", error);\n }\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./analytics.ts?");
14129
14129
 
14130
14130
  /***/ }),
14131
14131
 
@@ -14158,7 +14158,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
14158
14158
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
14159
14159
 
14160
14160
  "use strict";
14161
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ cleanAppStateForExport: () => (/* binding */ cleanAppStateForExport),\n/* harmony export */ clearAppStateForDatabase: () => (/* binding */ clearAppStateForDatabase),\n/* harmony export */ clearAppStateForLocalStorage: () => (/* binding */ clearAppStateForLocalStorage),\n/* harmony export */ getDefaultAppState: () => (/* binding */ getDefaultAppState),\n/* harmony export */ isEraserActive: () => (/* binding */ isEraserActive),\n/* harmony export */ isHandToolActive: () => (/* binding */ isHandToolActive),\n/* harmony export */ isLaserPointerActive: () => (/* binding */ isLaserPointerActive)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n\nconst defaultExportScale = 1; //zsviczian - iPad scaling issue on export\n\n/*EXPORT_SCALES.includes(devicePixelRatio)\r\n ? devicePixelRatio\r\n : 1;*/\n\nconst getDefaultAppState = () => {\n return {\n showWelcomeScreen: false,\n theme: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.LIGHT,\n collaborators: new Map(),\n currentChartType: \"bar\",\n currentItemBackgroundColor: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.backgroundColor,\n currentItemEndArrowhead: \"arrow\",\n currentItemFillStyle: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.fillStyle,\n currentItemFontFamily: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_FONT_FAMILY,\n currentItemFontSize: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_FONT_SIZE,\n currentItemOpacity: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.opacity,\n currentItemRoughness: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.roughness,\n currentItemStartArrowhead: null,\n currentItemStrokeColor: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.strokeColor,\n currentItemRoundness: \"round\",\n currentItemArrowType: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.ARROW_TYPE.round,\n currentItemStrokeStyle: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.strokeStyle,\n currentItemStrokeWidth: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.strokeWidth,\n currentItemTextAlign: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_TEXT_ALIGN,\n currentHoveredFontFamily: null,\n cursorButton: \"up\",\n activeEmbeddable: null,\n newElement: null,\n editingTextElement: null,\n editingGroupId: null,\n editingLinearElement: null,\n activeTool: {\n type: \"selection\",\n customType: null,\n locked: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.locked,\n fromSelection: false,\n lastActiveTool: null\n },\n penMode: false,\n penDetected: false,\n errorMessage: null,\n exportBackground: true,\n exportScale: defaultExportScale,\n exportEmbedScene: false,\n exportWithDarkMode: false,\n fileHandle: null,\n gridSize: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_GRID_SIZE,\n gridStep: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_GRID_STEP,\n gridModeEnabled: false,\n isBindingEnabled: true,\n defaultSidebarDockedPreference: false,\n isLoading: false,\n isResizing: false,\n isRotating: false,\n lastPointerDownWith: \"mouse\",\n multiElement: null,\n name: null,\n contextMenu: null,\n openMenu: null,\n openPopup: null,\n openSidebar: null,\n openDialog: null,\n pasteDialog: {\n shown: false,\n data: null\n },\n previousSelectedElementIds: {},\n resizingElement: null,\n scrolledOutside: false,\n scrollX: 0,\n scrollY: 0,\n selectedElementIds: {},\n hoveredElementIds: {},\n selectedGroupIds: {},\n selectedElementsAreBeingDragged: false,\n selectionElement: null,\n shouldCacheIgnoreZoom: false,\n stats: {\n open: false,\n panels: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.STATS_PANELS.generalStats | _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.STATS_PANELS.elementProperties\n },\n startBoundElement: null,\n suggestedBindings: [],\n frameRendering: {\n enabled: true,\n clip: true,\n name: true,\n outline: true\n },\n frameToHighlight: null,\n editingFrame: null,\n elementsToHighlight: null,\n toast: null,\n viewBackgroundColor: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.COLOR_PALETTE.white,\n zenModeEnabled: false,\n zoom: {\n value: 1\n },\n viewModeEnabled: false,\n pendingImageElementId: null,\n showHyperlinkPopup: false,\n linkOpacity: 1,\n trayModeEnabled: false,\n colorPalette: undefined,\n allowPinchZoom: false,\n allowWheelZoom: false,\n pinnedScripts: [],\n customPens: [],\n currentStrokeOptions: null,\n resetCustomPen: null,\n gridColor: {\n Bold: \"#cccccc\",\n Regular: \"#e5e5e5\"\n },\n highlightSearchResult: false,\n dynamicStyle: {},\n frameColor: {\n stroke: \"#bbb\",\n fill: \"rgba(0, 0, 200, 0.04)\",\n nameColor: \"#999999\"\n },\n invertBindingBehaviour: false,\n selectedLinearElement: null,\n snapLines: [],\n originSnapOffset: {\n x: 0,\n y: 0\n },\n objectsSnapModeEnabled: false,\n userToFollow: null,\n followedBy: new Set(),\n isCropping: false,\n croppingElementId: null,\n searchMatches: []\n };\n};\n/**\r\n * Config containing all AppState keys. Used to determine whether given state\r\n * prop should be stripped when exporting to given storage type.\r\n */\n\nconst APP_STATE_STORAGE_CONF = (config => config)({\n showWelcomeScreen: {\n browser: true,\n export: false,\n server: false\n },\n theme: {\n browser: true,\n export: false,\n server: false\n },\n collaborators: {\n browser: false,\n export: false,\n server: false\n },\n currentChartType: {\n browser: true,\n export: false,\n server: false\n },\n currentItemBackgroundColor: {\n browser: true,\n export: false,\n server: false\n },\n currentItemEndArrowhead: {\n browser: true,\n export: false,\n server: false\n },\n currentItemFillStyle: {\n browser: true,\n export: false,\n server: false\n },\n currentItemFontFamily: {\n browser: true,\n export: false,\n server: false\n },\n currentItemFontSize: {\n browser: true,\n export: false,\n server: false\n },\n currentItemRoundness: {\n browser: true,\n export: false,\n server: false\n },\n currentItemArrowType: {\n browser: true,\n export: false,\n server: false\n },\n currentItemOpacity: {\n browser: true,\n export: false,\n server: false\n },\n currentItemRoughness: {\n browser: true,\n export: false,\n server: false\n },\n currentItemStartArrowhead: {\n browser: true,\n export: false,\n server: false\n },\n currentItemStrokeColor: {\n browser: true,\n export: false,\n server: false\n },\n currentItemStrokeStyle: {\n browser: true,\n export: false,\n server: false\n },\n currentItemStrokeWidth: {\n browser: true,\n export: false,\n server: false\n },\n currentItemTextAlign: {\n browser: true,\n export: false,\n server: false\n },\n currentHoveredFontFamily: {\n browser: false,\n export: false,\n server: false\n },\n cursorButton: {\n browser: true,\n export: false,\n server: false\n },\n activeEmbeddable: {\n browser: false,\n export: false,\n server: false\n },\n newElement: {\n browser: false,\n export: false,\n server: false\n },\n editingTextElement: {\n browser: false,\n export: false,\n server: false\n },\n editingGroupId: {\n browser: true,\n export: false,\n server: false\n },\n editingLinearElement: {\n browser: false,\n export: false,\n server: false\n },\n activeTool: {\n browser: true,\n export: false,\n server: false\n },\n penMode: {\n browser: true,\n export: false,\n server: false\n },\n penDetected: {\n browser: true,\n export: false,\n server: false\n },\n errorMessage: {\n browser: false,\n export: false,\n server: false\n },\n exportBackground: {\n browser: true,\n export: false,\n server: false\n },\n exportEmbedScene: {\n browser: true,\n export: false,\n server: false\n },\n exportScale: {\n browser: true,\n export: false,\n server: false\n },\n exportWithDarkMode: {\n browser: true,\n export: false,\n server: false\n },\n fileHandle: {\n browser: false,\n export: false,\n server: false\n },\n gridSize: {\n browser: true,\n export: true,\n server: true\n },\n gridStep: {\n browser: true,\n export: true,\n server: true\n },\n gridModeEnabled: {\n browser: true,\n export: true,\n server: true\n },\n height: {\n browser: false,\n export: false,\n server: false\n },\n isBindingEnabled: {\n browser: false,\n export: false,\n server: false\n },\n defaultSidebarDockedPreference: {\n browser: true,\n export: false,\n server: false\n },\n isLoading: {\n browser: false,\n export: false,\n server: false\n },\n isResizing: {\n browser: false,\n export: false,\n server: false\n },\n isRotating: {\n browser: false,\n export: false,\n server: false\n },\n lastPointerDownWith: {\n browser: true,\n export: false,\n server: false\n },\n multiElement: {\n browser: false,\n export: false,\n server: false\n },\n name: {\n browser: true,\n export: false,\n server: false\n },\n offsetLeft: {\n browser: false,\n export: false,\n server: false\n },\n offsetTop: {\n browser: false,\n export: false,\n server: false\n },\n contextMenu: {\n browser: false,\n export: false,\n server: false\n },\n openMenu: {\n browser: true,\n export: false,\n server: false\n },\n openPopup: {\n browser: false,\n export: false,\n server: false\n },\n openSidebar: {\n browser: true,\n export: false,\n server: false\n },\n openDialog: {\n browser: false,\n export: false,\n server: false\n },\n pasteDialog: {\n browser: false,\n export: false,\n server: false\n },\n previousSelectedElementIds: {\n browser: true,\n export: false,\n server: false\n },\n resizingElement: {\n browser: false,\n export: false,\n server: false\n },\n scrolledOutside: {\n browser: true,\n export: false,\n server: false\n },\n scrollX: {\n browser: true,\n export: false,\n server: false\n },\n scrollY: {\n browser: true,\n export: false,\n server: false\n },\n selectedElementIds: {\n browser: true,\n export: false,\n server: false\n },\n hoveredElementIds: {\n browser: false,\n export: false,\n server: false\n },\n selectedGroupIds: {\n browser: true,\n export: false,\n server: false\n },\n selectedElementsAreBeingDragged: {\n browser: false,\n export: false,\n server: false\n },\n selectionElement: {\n browser: false,\n export: false,\n server: false\n },\n shouldCacheIgnoreZoom: {\n browser: true,\n export: false,\n server: false\n },\n stats: {\n browser: true,\n export: false,\n server: false\n },\n startBoundElement: {\n browser: false,\n export: false,\n server: false\n },\n suggestedBindings: {\n browser: false,\n export: false,\n server: false\n },\n frameRendering: {\n browser: false,\n export: false,\n server: false\n },\n frameToHighlight: {\n browser: false,\n export: false,\n server: false\n },\n editingFrame: {\n browser: false,\n export: false,\n server: false\n },\n elementsToHighlight: {\n browser: false,\n export: false,\n server: false\n },\n toast: {\n browser: false,\n export: false,\n server: false\n },\n viewBackgroundColor: {\n browser: true,\n export: true,\n server: true\n },\n width: {\n browser: false,\n export: false,\n server: false\n },\n zenModeEnabled: {\n browser: true,\n export: false,\n server: false\n },\n zoom: {\n browser: true,\n export: false,\n server: false\n },\n viewModeEnabled: {\n browser: false,\n export: false,\n server: false\n },\n pendingImageElementId: {\n browser: false,\n export: false,\n server: false\n },\n showHyperlinkPopup: {\n browser: false,\n export: false,\n server: false\n },\n linkOpacity: {\n browser: false,\n export: false,\n server: false\n },\n trayModeEnabled: {\n browser: false,\n export: false,\n server: false\n },\n colorPalette: {\n browser: false,\n export: false,\n server: false\n },\n allowPinchZoom: {\n browser: false,\n export: false,\n server: false\n },\n allowWheelZoom: {\n browser: false,\n export: false,\n server: false\n },\n pinnedScripts: {\n browser: false,\n export: false,\n server: false\n },\n customPens: {\n browser: false,\n export: false,\n server: false\n },\n currentStrokeOptions: {\n browser: false,\n export: false,\n server: false\n },\n resetCustomPen: {\n browser: false,\n export: false,\n server: false\n },\n gridColor: {\n browser: false,\n export: false,\n server: false\n },\n highlightSearchResult: {\n browser: false,\n export: false,\n server: false\n },\n dynamicStyle: {\n browser: false,\n export: false,\n server: false\n },\n frameColor: {\n browser: false,\n export: false,\n server: false\n },\n invertBindingBehaviour: {\n browser: false,\n export: false,\n server: false\n },\n selectedLinearElement: {\n browser: true,\n export: false,\n server: false\n },\n snapLines: {\n browser: false,\n export: false,\n server: false\n },\n originSnapOffset: {\n browser: false,\n export: false,\n server: false\n },\n objectsSnapModeEnabled: {\n browser: true,\n export: false,\n server: false\n },\n userToFollow: {\n browser: false,\n export: false,\n server: false\n },\n followedBy: {\n browser: false,\n export: false,\n server: false\n },\n isCropping: {\n browser: false,\n export: false,\n server: false\n },\n croppingElementId: {\n browser: false,\n export: false,\n server: false\n },\n searchMatches: {\n browser: false,\n export: false,\n server: false\n }\n});\n\nconst _clearAppStateForStorage = (appState, exportType) => {\n const stateForExport = {};\n\n for (const key of Object.keys(appState)) {\n const propConfig = APP_STATE_STORAGE_CONF[key];\n\n if (propConfig === null || propConfig === void 0 ? void 0 : propConfig[exportType]) {\n const nextValue = appState[key]; // https://github.com/microsoft/TypeScript/issues/31445\n\n stateForExport[key] = nextValue;\n }\n }\n\n return stateForExport;\n};\n\nconst clearAppStateForLocalStorage = appState => {\n return _clearAppStateForStorage(appState, \"browser\");\n};\nconst cleanAppStateForExport = appState => {\n return _clearAppStateForStorage(appState, \"export\");\n};\nconst clearAppStateForDatabase = appState => {\n return _clearAppStateForStorage(appState, \"server\");\n};\nconst isEraserActive = ({\n activeTool\n}) => activeTool.type === \"eraser\";\nconst isHandToolActive = ({\n activeTool\n}) => {\n return activeTool.type === \"hand\";\n};\nconst isLaserPointerActive = ({\n activeTool\n}) => {\n return activeTool.type === \"laser\";\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./appState.ts?");
14161
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ cleanAppStateForExport: () => (/* binding */ cleanAppStateForExport),\n/* harmony export */ clearAppStateForDatabase: () => (/* binding */ clearAppStateForDatabase),\n/* harmony export */ clearAppStateForLocalStorage: () => (/* binding */ clearAppStateForLocalStorage),\n/* harmony export */ getDefaultAppState: () => (/* binding */ getDefaultAppState),\n/* harmony export */ isEraserActive: () => (/* binding */ isEraserActive),\n/* harmony export */ isHandToolActive: () => (/* binding */ isHandToolActive),\n/* harmony export */ isLaserPointerActive: () => (/* binding */ isLaserPointerActive)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n\nconst defaultExportScale = 1; //zsviczian - iPad scaling issue on export\n\n/*EXPORT_SCALES.includes(devicePixelRatio)\r\n ? devicePixelRatio\r\n : 1;*/\n\nconst getDefaultAppState = () => {\n return {\n showWelcomeScreen: false,\n theme: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.LIGHT,\n collaborators: new Map(),\n currentChartType: \"bar\",\n currentItemBackgroundColor: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.backgroundColor,\n currentItemEndArrowhead: \"arrow\",\n currentItemFillStyle: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.fillStyle,\n currentItemFontFamily: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_FONT_FAMILY,\n currentItemFontSize: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_FONT_SIZE,\n currentItemOpacity: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.opacity,\n currentItemRoughness: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.roughness,\n currentItemStartArrowhead: null,\n currentItemStrokeColor: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.strokeColor,\n currentItemRoundness: \"round\",\n currentItemArrowType: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.ARROW_TYPE.round,\n currentItemStrokeStyle: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.strokeStyle,\n currentItemStrokeWidth: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.strokeWidth,\n currentItemTextAlign: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_TEXT_ALIGN,\n currentHoveredFontFamily: null,\n cursorButton: \"up\",\n activeEmbeddable: null,\n newElement: null,\n editingTextElement: null,\n editingGroupId: null,\n editingLinearElement: null,\n activeTool: {\n type: \"selection\",\n customType: null,\n locked: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ELEMENT_PROPS.locked,\n fromSelection: false,\n lastActiveTool: null\n },\n penMode: false,\n penDetected: false,\n errorMessage: null,\n exportBackground: true,\n exportScale: defaultExportScale,\n exportEmbedScene: false,\n exportWithDarkMode: false,\n fileHandle: null,\n gridSize: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_GRID_SIZE,\n gridStep: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_GRID_STEP,\n gridModeEnabled: false,\n isBindingEnabled: true,\n defaultSidebarDockedPreference: false,\n isLoading: false,\n isResizing: false,\n isRotating: false,\n lastPointerDownWith: \"mouse\",\n multiElement: null,\n name: null,\n contextMenu: null,\n openMenu: null,\n openPopup: null,\n openSidebar: null,\n openDialog: null,\n pasteDialog: {\n shown: false,\n data: null\n },\n previousSelectedElementIds: {},\n resizingElement: null,\n scrolledOutside: false,\n scrollX: 0,\n scrollY: 0,\n selectedElementIds: {},\n hoveredElementIds: {},\n selectedGroupIds: {},\n selectedElementsAreBeingDragged: false,\n selectionElement: null,\n shouldCacheIgnoreZoom: false,\n stats: {\n open: false,\n panels: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.STATS_PANELS.generalStats | _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.STATS_PANELS.elementProperties\n },\n startBoundElement: null,\n suggestedBindings: [],\n frameRendering: {\n enabled: true,\n clip: true,\n name: true,\n outline: true\n },\n frameToHighlight: null,\n editingFrame: null,\n elementsToHighlight: null,\n toast: null,\n viewBackgroundColor: _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.COLOR_PALETTE.white,\n zenModeEnabled: false,\n zoom: {\n value: 1\n },\n viewModeEnabled: false,\n pendingImageElementId: null,\n showHyperlinkPopup: false,\n linkOpacity: 1,\n trayModeEnabled: false,\n colorPalette: undefined,\n allowPinchZoom: false,\n allowWheelZoom: false,\n pinnedScripts: [],\n customPens: [],\n currentStrokeOptions: null,\n resetCustomPen: null,\n gridColor: {\n Bold: \"#cccccc\",\n Regular: \"#e5e5e5\"\n },\n gridDirection: {\n horizontal: true,\n vertical: true\n },\n highlightSearchResult: false,\n dynamicStyle: {},\n frameColor: {\n stroke: \"#bbb\",\n fill: \"rgba(0, 0, 200, 0.04)\",\n nameColor: \"#999999\"\n },\n invertBindingBehaviour: false,\n selectedLinearElement: null,\n snapLines: [],\n originSnapOffset: {\n x: 0,\n y: 0\n },\n objectsSnapModeEnabled: false,\n userToFollow: null,\n followedBy: new Set(),\n isCropping: false,\n croppingElementId: null,\n searchMatches: []\n };\n};\n/**\r\n * Config containing all AppState keys. Used to determine whether given state\r\n * prop should be stripped when exporting to given storage type.\r\n */\n\nconst APP_STATE_STORAGE_CONF = (config => config)({\n showWelcomeScreen: {\n browser: true,\n export: false,\n server: false\n },\n theme: {\n browser: true,\n export: false,\n server: false\n },\n collaborators: {\n browser: false,\n export: false,\n server: false\n },\n currentChartType: {\n browser: true,\n export: false,\n server: false\n },\n currentItemBackgroundColor: {\n browser: true,\n export: false,\n server: false\n },\n currentItemEndArrowhead: {\n browser: true,\n export: false,\n server: false\n },\n currentItemFillStyle: {\n browser: true,\n export: false,\n server: false\n },\n currentItemFontFamily: {\n browser: true,\n export: false,\n server: false\n },\n currentItemFontSize: {\n browser: true,\n export: false,\n server: false\n },\n currentItemRoundness: {\n browser: true,\n export: false,\n server: false\n },\n currentItemArrowType: {\n browser: true,\n export: false,\n server: false\n },\n currentItemOpacity: {\n browser: true,\n export: false,\n server: false\n },\n currentItemRoughness: {\n browser: true,\n export: false,\n server: false\n },\n currentItemStartArrowhead: {\n browser: true,\n export: false,\n server: false\n },\n currentItemStrokeColor: {\n browser: true,\n export: false,\n server: false\n },\n currentItemStrokeStyle: {\n browser: true,\n export: false,\n server: false\n },\n currentItemStrokeWidth: {\n browser: true,\n export: false,\n server: false\n },\n currentItemTextAlign: {\n browser: true,\n export: false,\n server: false\n },\n currentHoveredFontFamily: {\n browser: false,\n export: false,\n server: false\n },\n cursorButton: {\n browser: true,\n export: false,\n server: false\n },\n activeEmbeddable: {\n browser: false,\n export: false,\n server: false\n },\n newElement: {\n browser: false,\n export: false,\n server: false\n },\n editingTextElement: {\n browser: false,\n export: false,\n server: false\n },\n editingGroupId: {\n browser: true,\n export: false,\n server: false\n },\n editingLinearElement: {\n browser: false,\n export: false,\n server: false\n },\n activeTool: {\n browser: true,\n export: false,\n server: false\n },\n penMode: {\n browser: true,\n export: false,\n server: false\n },\n penDetected: {\n browser: true,\n export: false,\n server: false\n },\n errorMessage: {\n browser: false,\n export: false,\n server: false\n },\n exportBackground: {\n browser: true,\n export: false,\n server: false\n },\n exportEmbedScene: {\n browser: true,\n export: false,\n server: false\n },\n exportScale: {\n browser: true,\n export: false,\n server: false\n },\n exportWithDarkMode: {\n browser: true,\n export: false,\n server: false\n },\n fileHandle: {\n browser: false,\n export: false,\n server: false\n },\n gridSize: {\n browser: true,\n export: true,\n server: true\n },\n gridStep: {\n browser: true,\n export: true,\n server: true\n },\n gridModeEnabled: {\n browser: true,\n export: true,\n server: true\n },\n height: {\n browser: false,\n export: false,\n server: false\n },\n isBindingEnabled: {\n browser: false,\n export: false,\n server: false\n },\n defaultSidebarDockedPreference: {\n browser: true,\n export: false,\n server: false\n },\n isLoading: {\n browser: false,\n export: false,\n server: false\n },\n isResizing: {\n browser: false,\n export: false,\n server: false\n },\n isRotating: {\n browser: false,\n export: false,\n server: false\n },\n lastPointerDownWith: {\n browser: true,\n export: false,\n server: false\n },\n multiElement: {\n browser: false,\n export: false,\n server: false\n },\n name: {\n browser: true,\n export: false,\n server: false\n },\n offsetLeft: {\n browser: false,\n export: false,\n server: false\n },\n offsetTop: {\n browser: false,\n export: false,\n server: false\n },\n contextMenu: {\n browser: false,\n export: false,\n server: false\n },\n openMenu: {\n browser: true,\n export: false,\n server: false\n },\n openPopup: {\n browser: false,\n export: false,\n server: false\n },\n openSidebar: {\n browser: true,\n export: false,\n server: false\n },\n openDialog: {\n browser: false,\n export: false,\n server: false\n },\n pasteDialog: {\n browser: false,\n export: false,\n server: false\n },\n previousSelectedElementIds: {\n browser: true,\n export: false,\n server: false\n },\n resizingElement: {\n browser: false,\n export: false,\n server: false\n },\n scrolledOutside: {\n browser: true,\n export: false,\n server: false\n },\n scrollX: {\n browser: true,\n export: false,\n server: false\n },\n scrollY: {\n browser: true,\n export: false,\n server: false\n },\n selectedElementIds: {\n browser: true,\n export: false,\n server: false\n },\n hoveredElementIds: {\n browser: false,\n export: false,\n server: false\n },\n selectedGroupIds: {\n browser: true,\n export: false,\n server: false\n },\n selectedElementsAreBeingDragged: {\n browser: false,\n export: false,\n server: false\n },\n selectionElement: {\n browser: false,\n export: false,\n server: false\n },\n shouldCacheIgnoreZoom: {\n browser: true,\n export: false,\n server: false\n },\n stats: {\n browser: true,\n export: false,\n server: false\n },\n startBoundElement: {\n browser: false,\n export: false,\n server: false\n },\n suggestedBindings: {\n browser: false,\n export: false,\n server: false\n },\n frameRendering: {\n browser: false,\n export: false,\n server: false\n },\n frameToHighlight: {\n browser: false,\n export: false,\n server: false\n },\n editingFrame: {\n browser: false,\n export: false,\n server: false\n },\n elementsToHighlight: {\n browser: false,\n export: false,\n server: false\n },\n toast: {\n browser: false,\n export: false,\n server: false\n },\n viewBackgroundColor: {\n browser: true,\n export: true,\n server: true\n },\n width: {\n browser: false,\n export: false,\n server: false\n },\n zenModeEnabled: {\n browser: true,\n export: false,\n server: false\n },\n zoom: {\n browser: true,\n export: false,\n server: false\n },\n viewModeEnabled: {\n browser: false,\n export: false,\n server: false\n },\n pendingImageElementId: {\n browser: false,\n export: false,\n server: false\n },\n showHyperlinkPopup: {\n browser: false,\n export: false,\n server: false\n },\n linkOpacity: {\n browser: false,\n export: false,\n server: false\n },\n trayModeEnabled: {\n browser: false,\n export: false,\n server: false\n },\n colorPalette: {\n browser: false,\n export: false,\n server: false\n },\n allowPinchZoom: {\n browser: false,\n export: false,\n server: false\n },\n allowWheelZoom: {\n browser: false,\n export: false,\n server: false\n },\n pinnedScripts: {\n browser: false,\n export: false,\n server: false\n },\n customPens: {\n browser: false,\n export: false,\n server: false\n },\n currentStrokeOptions: {\n browser: false,\n export: false,\n server: false\n },\n resetCustomPen: {\n browser: false,\n export: false,\n server: false\n },\n gridColor: {\n browser: false,\n export: false,\n server: false\n },\n gridDirection: {\n browser: false,\n export: false,\n server: false\n },\n highlightSearchResult: {\n browser: false,\n export: false,\n server: false\n },\n dynamicStyle: {\n browser: false,\n export: false,\n server: false\n },\n frameColor: {\n browser: false,\n export: false,\n server: false\n },\n invertBindingBehaviour: {\n browser: false,\n export: false,\n server: false\n },\n selectedLinearElement: {\n browser: true,\n export: false,\n server: false\n },\n snapLines: {\n browser: false,\n export: false,\n server: false\n },\n originSnapOffset: {\n browser: false,\n export: false,\n server: false\n },\n objectsSnapModeEnabled: {\n browser: true,\n export: false,\n server: false\n },\n userToFollow: {\n browser: false,\n export: false,\n server: false\n },\n followedBy: {\n browser: false,\n export: false,\n server: false\n },\n isCropping: {\n browser: false,\n export: false,\n server: false\n },\n croppingElementId: {\n browser: false,\n export: false,\n server: false\n },\n searchMatches: {\n browser: false,\n export: false,\n server: false\n }\n});\n\nconst _clearAppStateForStorage = (appState, exportType) => {\n const stateForExport = {};\n\n for (const key of Object.keys(appState)) {\n const propConfig = APP_STATE_STORAGE_CONF[key];\n\n if (propConfig === null || propConfig === void 0 ? void 0 : propConfig[exportType]) {\n const nextValue = appState[key]; // https://github.com/microsoft/TypeScript/issues/31445\n\n stateForExport[key] = nextValue;\n }\n }\n\n return stateForExport;\n};\n\nconst clearAppStateForLocalStorage = appState => {\n return _clearAppStateForStorage(appState, \"browser\");\n};\nconst cleanAppStateForExport = appState => {\n return _clearAppStateForStorage(appState, \"export\");\n};\nconst clearAppStateForDatabase = appState => {\n return _clearAppStateForStorage(appState, \"server\");\n};\nconst isEraserActive = ({\n activeTool\n}) => activeTool.type === \"eraser\";\nconst isHandToolActive = ({\n activeTool\n}) => {\n return activeTool.type === \"hand\";\n};\nconst isLaserPointerActive = ({\n activeTool\n}) => {\n return activeTool.type === \"laser\";\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./appState.ts?");
14162
14162
 
14163
14163
  /***/ }),
14164
14164
 
@@ -16259,7 +16259,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
16259
16259
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16260
16260
 
16261
16261
  "use strict";
16262
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n */ \"./i18n.ts\");\n/* harmony import */ var _reactUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../reactUtils */ \"./reactUtils.ts\");\n/* harmony import */ var _renderer_interactiveScene__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../renderer/interactiveScene */ \"./renderer/interactiveScene.ts\");\n\n\n\n\n\n\nconst InteractiveCanvas = props => {\n const isComponentMounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n var _a;\n\n if (!isComponentMounted.current) {\n isComponentMounted.current = true;\n return;\n }\n\n const remotePointerButton = new Map();\n const remotePointerViewportCoords = new Map();\n const remoteSelectedElementIds = new Map();\n const remotePointerUsernames = new Map();\n const remotePointerUserStates = new Map();\n props.appState.collaborators.forEach((user, socketId) => {\n if (user.selectedElementIds) {\n for (const id of Object.keys(user.selectedElementIds)) {\n if (!remoteSelectedElementIds.has(id)) {\n remoteSelectedElementIds.set(id, []);\n }\n\n remoteSelectedElementIds.get(id).push(socketId);\n }\n }\n\n if (!user.pointer || user.pointer.renderCursor === false) {\n return;\n }\n\n if (user.username) {\n remotePointerUsernames.set(socketId, user.username);\n }\n\n if (user.userState) {\n remotePointerUserStates.set(socketId, user.userState);\n }\n\n remotePointerViewportCoords.set(socketId, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.sceneCoordsToViewportCoords)({\n sceneX: user.pointer.x,\n sceneY: user.pointer.y\n }, props.appState));\n remotePointerButton.set(socketId, user.button);\n });\n const selectionColor = ((_a = props.containerRef) === null || _a === void 0 ? void 0 : _a.current) && getComputedStyle(props.containerRef.current).getPropertyValue(\"--color-selection\") || \"#6965db\";\n (0,_renderer_interactiveScene__WEBPACK_IMPORTED_MODULE_4__.renderInteractiveScene)({\n canvas: props.canvas,\n elementsMap: props.elementsMap,\n visibleElements: props.visibleElements,\n selectedElements: props.selectedElements,\n allElementsMap: props.allElementsMap,\n scale: window.devicePixelRatio,\n appState: props.appState,\n renderConfig: {\n remotePointerViewportCoords,\n remotePointerButton,\n remoteSelectedElementIds,\n remotePointerUsernames,\n remotePointerUserStates,\n selectionColor,\n renderScrollbars: false\n },\n device: props.device,\n callback: props.renderInteractiveSceneCallback\n }, (0,_reactUtils__WEBPACK_IMPORTED_MODULE_3__.isRenderThrottlingEnabled)());\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"canvas\", {\n className: \"excalidraw__canvas interactive\",\n style: {\n width: props.appState.width,\n height: props.appState.height,\n cursor: props.appState.viewModeEnabled ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.CURSOR_TYPE.GRAB : _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.CURSOR_TYPE.AUTO\n },\n width: props.appState.width * props.scale,\n height: props.appState.height * props.scale,\n ref: props.handleCanvasRef,\n onContextMenu: props.onContextMenu,\n onPointerMove: props.onPointerMove,\n onPointerUp: props.onPointerUp,\n onPointerCancel: props.onPointerCancel,\n onTouchMove: props.onTouchMove,\n onPointerDown: props.onPointerDown,\n onDoubleClick: props.onDoubleClick\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_2__.t)(\"labels.drawingCanvas\"));\n};\n\nconst getRelevantAppStateProps = appState => ({\n zoom: appState.zoom,\n scrollX: appState.scrollX,\n scrollY: appState.scrollY,\n width: appState.width,\n height: appState.height,\n viewModeEnabled: appState.viewModeEnabled,\n openDialog: appState.openDialog,\n editingGroupId: appState.editingGroupId,\n editingLinearElement: appState.editingLinearElement,\n selectedElementIds: appState.selectedElementIds,\n frameToHighlight: appState.frameToHighlight,\n offsetLeft: appState.offsetLeft,\n offsetTop: appState.offsetTop,\n theme: appState.theme,\n pendingImageElementId: appState.pendingImageElementId,\n selectionElement: appState.selectionElement,\n selectedGroupIds: appState.selectedGroupIds,\n selectedLinearElement: appState.selectedLinearElement,\n multiElement: appState.multiElement,\n isBindingEnabled: appState.isBindingEnabled,\n suggestedBindings: appState.suggestedBindings,\n isRotating: appState.isRotating,\n elementsToHighlight: appState.elementsToHighlight,\n collaborators: appState.collaborators,\n activeEmbeddable: appState.activeEmbeddable,\n snapLines: appState.snapLines,\n zenModeEnabled: appState.zenModeEnabled,\n editingTextElement: appState.editingTextElement,\n gridColor: appState.gridColor,\n highlightSearchResult: appState.highlightSearchResult,\n isCropping: appState.isCropping,\n croppingElementId: appState.croppingElementId,\n searchMatches: appState.searchMatches\n});\n\nconst areEqual = (prevProps, nextProps) => {\n // This could be further optimised if needed, as we don't have to render interactive canvas on each scene mutation\n if (prevProps.selectionNonce !== nextProps.selectionNonce || prevProps.sceneNonce !== nextProps.sceneNonce || prevProps.scale !== nextProps.scale || // we need to memoize on elementsMap because they may have renewed\n // even if sceneNonce didn't change (e.g. we filter elements out based\n // on appState)\n prevProps.elementsMap !== nextProps.elementsMap || prevProps.visibleElements !== nextProps.visibleElements || prevProps.selectedElements !== nextProps.selectedElements) {\n return false;\n } // Comparing the interactive appState for changes in case of some edge cases\n\n\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.isShallowEqual)( // asserting AppState because we're being passed the whole AppState\n // but resolve to only the InteractiveCanvas-relevant props\n getRelevantAppStateProps(prevProps.appState), getRelevantAppStateProps(nextProps.appState));\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(InteractiveCanvas, areEqual));\n\n//# sourceURL=webpack://ExcalidrawLib/./components/canvases/InteractiveCanvas.tsx?");
16262
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n */ \"./i18n.ts\");\n/* harmony import */ var _reactUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../reactUtils */ \"./reactUtils.ts\");\n/* harmony import */ var _renderer_interactiveScene__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../renderer/interactiveScene */ \"./renderer/interactiveScene.ts\");\n\n\n\n\n\n\nconst InteractiveCanvas = props => {\n const isComponentMounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n var _a;\n\n if (!isComponentMounted.current) {\n isComponentMounted.current = true;\n return;\n }\n\n const remotePointerButton = new Map();\n const remotePointerViewportCoords = new Map();\n const remoteSelectedElementIds = new Map();\n const remotePointerUsernames = new Map();\n const remotePointerUserStates = new Map();\n props.appState.collaborators.forEach((user, socketId) => {\n if (user.selectedElementIds) {\n for (const id of Object.keys(user.selectedElementIds)) {\n if (!remoteSelectedElementIds.has(id)) {\n remoteSelectedElementIds.set(id, []);\n }\n\n remoteSelectedElementIds.get(id).push(socketId);\n }\n }\n\n if (!user.pointer || user.pointer.renderCursor === false) {\n return;\n }\n\n if (user.username) {\n remotePointerUsernames.set(socketId, user.username);\n }\n\n if (user.userState) {\n remotePointerUserStates.set(socketId, user.userState);\n }\n\n remotePointerViewportCoords.set(socketId, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.sceneCoordsToViewportCoords)({\n sceneX: user.pointer.x,\n sceneY: user.pointer.y\n }, props.appState));\n remotePointerButton.set(socketId, user.button);\n });\n const selectionColor = ((_a = props.containerRef) === null || _a === void 0 ? void 0 : _a.current) && getComputedStyle(props.containerRef.current).getPropertyValue(\"--color-selection\") || \"#6965db\";\n (0,_renderer_interactiveScene__WEBPACK_IMPORTED_MODULE_4__.renderInteractiveScene)({\n canvas: props.canvas,\n elementsMap: props.elementsMap,\n visibleElements: props.visibleElements,\n selectedElements: props.selectedElements,\n allElementsMap: props.allElementsMap,\n scale: window.devicePixelRatio,\n appState: props.appState,\n renderConfig: {\n remotePointerViewportCoords,\n remotePointerButton,\n remoteSelectedElementIds,\n remotePointerUsernames,\n remotePointerUserStates,\n selectionColor,\n renderScrollbars: false\n },\n device: props.device,\n callback: props.renderInteractiveSceneCallback\n }, (0,_reactUtils__WEBPACK_IMPORTED_MODULE_3__.isRenderThrottlingEnabled)());\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"canvas\", {\n className: \"excalidraw__canvas interactive\",\n style: {\n width: props.appState.width,\n height: props.appState.height,\n cursor: props.appState.viewModeEnabled ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.CURSOR_TYPE.GRAB : _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.CURSOR_TYPE.AUTO\n },\n width: props.appState.width * props.scale,\n height: props.appState.height * props.scale,\n ref: props.handleCanvasRef,\n onContextMenu: props.onContextMenu,\n onPointerMove: props.onPointerMove,\n onPointerUp: props.onPointerUp,\n onPointerCancel: props.onPointerCancel,\n onTouchMove: props.onTouchMove,\n onPointerDown: props.onPointerDown,\n onDoubleClick: props.onDoubleClick\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_2__.t)(\"labels.drawingCanvas\"));\n};\n\nconst getRelevantAppStateProps = appState => ({\n zoom: appState.zoom,\n scrollX: appState.scrollX,\n scrollY: appState.scrollY,\n width: appState.width,\n height: appState.height,\n viewModeEnabled: appState.viewModeEnabled,\n openDialog: appState.openDialog,\n editingGroupId: appState.editingGroupId,\n editingLinearElement: appState.editingLinearElement,\n selectedElementIds: appState.selectedElementIds,\n frameToHighlight: appState.frameToHighlight,\n offsetLeft: appState.offsetLeft,\n offsetTop: appState.offsetTop,\n theme: appState.theme,\n pendingImageElementId: appState.pendingImageElementId,\n selectionElement: appState.selectionElement,\n selectedGroupIds: appState.selectedGroupIds,\n selectedLinearElement: appState.selectedLinearElement,\n multiElement: appState.multiElement,\n isBindingEnabled: appState.isBindingEnabled,\n suggestedBindings: appState.suggestedBindings,\n isRotating: appState.isRotating,\n elementsToHighlight: appState.elementsToHighlight,\n collaborators: appState.collaborators,\n activeEmbeddable: appState.activeEmbeddable,\n snapLines: appState.snapLines,\n zenModeEnabled: appState.zenModeEnabled,\n editingTextElement: appState.editingTextElement,\n gridColor: appState.gridColor,\n gridDirection: appState.gridDirection,\n highlightSearchResult: appState.highlightSearchResult,\n isCropping: appState.isCropping,\n croppingElementId: appState.croppingElementId,\n searchMatches: appState.searchMatches\n});\n\nconst areEqual = (prevProps, nextProps) => {\n // This could be further optimised if needed, as we don't have to render interactive canvas on each scene mutation\n if (prevProps.selectionNonce !== nextProps.selectionNonce || prevProps.sceneNonce !== nextProps.sceneNonce || prevProps.scale !== nextProps.scale || // we need to memoize on elementsMap because they may have renewed\n // even if sceneNonce didn't change (e.g. we filter elements out based\n // on appState)\n prevProps.elementsMap !== nextProps.elementsMap || prevProps.visibleElements !== nextProps.visibleElements || prevProps.selectedElements !== nextProps.selectedElements) {\n return false;\n } // Comparing the interactive appState for changes in case of some edge cases\n\n\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.isShallowEqual)( // asserting AppState because we're being passed the whole AppState\n // but resolve to only the InteractiveCanvas-relevant props\n getRelevantAppStateProps(prevProps.appState), getRelevantAppStateProps(nextProps.appState));\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(InteractiveCanvas, areEqual));\n\n//# sourceURL=webpack://ExcalidrawLib/./components/canvases/InteractiveCanvas.tsx?");
16263
16263
 
16264
16264
  /***/ }),
16265
16265
 
@@ -16281,7 +16281,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
16281
16281
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16282
16282
 
16283
16283
  "use strict";
16284
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _reactUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../reactUtils */ \"./reactUtils.ts\");\n/* harmony import */ var _renderer_staticScene__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../renderer/staticScene */ \"./renderer/staticScene.ts\");\n\n\n\n\n\nconst StaticCanvas = props => {\n const wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const isComponentMounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const wrapper = wrapperRef.current;\n\n if (!wrapper) {\n return;\n }\n\n const canvas = props.canvas;\n\n if (!isComponentMounted.current) {\n isComponentMounted.current = true;\n wrapper.replaceChildren(canvas);\n canvas.classList.add(\"excalidraw__canvas\", \"static\");\n }\n\n const widthString = `${props.appState.width}px`;\n const heightString = `${props.appState.height}px`;\n\n if (canvas.style.width !== widthString) {\n canvas.style.width = widthString;\n }\n\n if (canvas.style.height !== heightString) {\n canvas.style.height = heightString;\n }\n\n const scaledWidth = props.appState.width * props.scale;\n const scaledHeight = props.appState.height * props.scale; // setting width/height resets the canvas even if dimensions not changed,\n // which would cause flicker when we skip frame (due to throttling)\n\n if (canvas.width !== scaledWidth) {\n canvas.width = scaledWidth;\n }\n\n if (canvas.height !== scaledHeight) {\n canvas.height = scaledHeight;\n }\n\n (0,_renderer_staticScene__WEBPACK_IMPORTED_MODULE_3__.renderStaticScene)({\n canvas,\n rc: props.rc,\n scale: props.scale,\n elementsMap: props.elementsMap,\n allElementsMap: props.allElementsMap,\n visibleElements: props.visibleElements,\n appState: props.appState,\n renderConfig: props.renderConfig\n }, (0,_reactUtils__WEBPACK_IMPORTED_MODULE_2__.isRenderThrottlingEnabled)());\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"excalidraw__canvas-wrapper\",\n ref: wrapperRef\n });\n};\n\nconst getRelevantAppStateProps = appState => {\n const relevantAppStateProps = {\n zoom: appState.zoom,\n scrollX: appState.scrollX,\n scrollY: appState.scrollY,\n width: appState.width,\n height: appState.height,\n viewModeEnabled: appState.viewModeEnabled,\n openDialog: appState.openDialog,\n hoveredElementIds: appState.hoveredElementIds,\n offsetLeft: appState.offsetLeft,\n offsetTop: appState.offsetTop,\n theme: appState.theme,\n pendingImageElementId: appState.pendingImageElementId,\n shouldCacheIgnoreZoom: appState.shouldCacheIgnoreZoom,\n viewBackgroundColor: appState.viewBackgroundColor,\n exportScale: appState.exportScale,\n selectedElementsAreBeingDragged: appState.selectedElementsAreBeingDragged,\n gridSize: appState.gridSize,\n gridStep: appState.gridStep,\n frameRendering: appState.frameRendering,\n selectedElementIds: appState.selectedElementIds,\n frameToHighlight: appState.frameToHighlight,\n editingGroupId: appState.editingGroupId,\n currentHoveredFontFamily: appState.currentHoveredFontFamily,\n croppingElementId: appState.croppingElementId,\n linkOpacity: appState.linkOpacity,\n gridColor: appState.gridColor,\n frameColor: appState.frameColor //zsviczian\n\n };\n return relevantAppStateProps;\n};\n\nconst areEqual = (prevProps, nextProps) => {\n if (prevProps.sceneNonce !== nextProps.sceneNonce || prevProps.scale !== nextProps.scale || // we need to memoize on elementsMap because they may have renewed\n // even if sceneNonce didn't change (e.g. we filter elements out based\n // on appState)\n prevProps.elementsMap !== nextProps.elementsMap || prevProps.visibleElements !== nextProps.visibleElements) {\n return false;\n }\n\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.isShallowEqual)( // asserting AppState because we're being passed the whole AppState\n // but resolve to only the StaticCanvas-relevant props\n getRelevantAppStateProps(prevProps.appState), getRelevantAppStateProps(nextProps.appState)) && (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.isShallowEqual)(prevProps.renderConfig, nextProps.renderConfig);\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(StaticCanvas, areEqual));\n\n//# sourceURL=webpack://ExcalidrawLib/./components/canvases/StaticCanvas.tsx?");
16284
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _reactUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../reactUtils */ \"./reactUtils.ts\");\n/* harmony import */ var _renderer_staticScene__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../renderer/staticScene */ \"./renderer/staticScene.ts\");\n\n\n\n\n\nconst StaticCanvas = props => {\n const wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const isComponentMounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const wrapper = wrapperRef.current;\n\n if (!wrapper) {\n return;\n }\n\n const canvas = props.canvas;\n\n if (!isComponentMounted.current) {\n isComponentMounted.current = true;\n wrapper.replaceChildren(canvas);\n canvas.classList.add(\"excalidraw__canvas\", \"static\");\n }\n\n const widthString = `${props.appState.width}px`;\n const heightString = `${props.appState.height}px`;\n\n if (canvas.style.width !== widthString) {\n canvas.style.width = widthString;\n }\n\n if (canvas.style.height !== heightString) {\n canvas.style.height = heightString;\n }\n\n const scaledWidth = props.appState.width * props.scale;\n const scaledHeight = props.appState.height * props.scale; // setting width/height resets the canvas even if dimensions not changed,\n // which would cause flicker when we skip frame (due to throttling)\n\n if (canvas.width !== scaledWidth) {\n canvas.width = scaledWidth;\n }\n\n if (canvas.height !== scaledHeight) {\n canvas.height = scaledHeight;\n }\n\n (0,_renderer_staticScene__WEBPACK_IMPORTED_MODULE_3__.renderStaticScene)({\n canvas,\n rc: props.rc,\n scale: props.scale,\n elementsMap: props.elementsMap,\n allElementsMap: props.allElementsMap,\n visibleElements: props.visibleElements,\n appState: props.appState,\n renderConfig: props.renderConfig\n }, (0,_reactUtils__WEBPACK_IMPORTED_MODULE_2__.isRenderThrottlingEnabled)());\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"excalidraw__canvas-wrapper\",\n ref: wrapperRef\n });\n};\n\nconst getRelevantAppStateProps = appState => {\n const relevantAppStateProps = {\n zoom: appState.zoom,\n scrollX: appState.scrollX,\n scrollY: appState.scrollY,\n width: appState.width,\n height: appState.height,\n viewModeEnabled: appState.viewModeEnabled,\n openDialog: appState.openDialog,\n hoveredElementIds: appState.hoveredElementIds,\n offsetLeft: appState.offsetLeft,\n offsetTop: appState.offsetTop,\n theme: appState.theme,\n pendingImageElementId: appState.pendingImageElementId,\n shouldCacheIgnoreZoom: appState.shouldCacheIgnoreZoom,\n viewBackgroundColor: appState.viewBackgroundColor,\n exportScale: appState.exportScale,\n selectedElementsAreBeingDragged: appState.selectedElementsAreBeingDragged,\n gridSize: appState.gridSize,\n gridStep: appState.gridStep,\n frameRendering: appState.frameRendering,\n selectedElementIds: appState.selectedElementIds,\n frameToHighlight: appState.frameToHighlight,\n editingGroupId: appState.editingGroupId,\n currentHoveredFontFamily: appState.currentHoveredFontFamily,\n croppingElementId: appState.croppingElementId,\n linkOpacity: appState.linkOpacity,\n gridColor: appState.gridColor,\n gridDirection: appState.gridDirection,\n frameColor: appState.frameColor //zsviczian\n\n };\n return relevantAppStateProps;\n};\n\nconst areEqual = (prevProps, nextProps) => {\n if (prevProps.sceneNonce !== nextProps.sceneNonce || prevProps.scale !== nextProps.scale || // we need to memoize on elementsMap because they may have renewed\n // even if sceneNonce didn't change (e.g. we filter elements out based\n // on appState)\n prevProps.elementsMap !== nextProps.elementsMap || prevProps.visibleElements !== nextProps.visibleElements) {\n return false;\n }\n\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.isShallowEqual)( // asserting AppState because we're being passed the whole AppState\n // but resolve to only the StaticCanvas-relevant props\n getRelevantAppStateProps(prevProps.appState), getRelevantAppStateProps(nextProps.appState)) && (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.isShallowEqual)(prevProps.renderConfig, nextProps.renderConfig);\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(StaticCanvas, areEqual));\n\n//# sourceURL=webpack://ExcalidrawLib/./components/canvases/StaticCanvas.tsx?");
16285
16285
 
16286
16286
  /***/ }),
16287
16287
 
@@ -16886,7 +16886,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
16886
16886
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16887
16887
 
16888
16888
  "use strict";
16889
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EraserTrail: () => (/* binding */ EraserTrail)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_element_bounds__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/element/bounds */ \"../element/src/bounds.ts\");\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _excalidraw_element_groups__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/element/groups */ \"../element/src/groups.ts\");\n/* harmony import */ var _excalidraw_element_shapes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @excalidraw/element/shapes */ \"../element/src/shapes.ts\");\n/* harmony import */ var _excalidraw_element_collision__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @excalidraw/element/collision */ \"../element/src/collision.ts\");\n/* harmony import */ var _excalidraw_utils_collision__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @excalidraw/utils/collision */ \"../utils/src/collision.ts\");\n/* harmony import */ var _excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @excalidraw/element/typeChecks */ \"../element/src/typeChecks.ts\");\n/* harmony import */ var _excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @excalidraw/element/textElement */ \"../element/src/textElement.ts\");\n/* harmony import */ var _animated_trail__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../animated-trail */ \"./animated-trail.ts\");\n\n\n\n\n\n\n\n\n\n // just enough to form a segment; this is sufficient for eraser\n\nconst POINTS_ON_TRAIL = 2;\nclass EraserTrail extends _animated_trail__WEBPACK_IMPORTED_MODULE_9__.AnimatedTrail {\n constructor(animationFrameHandler, app) {\n super(animationFrameHandler, app, {\n streamline: 0.2,\n size: 5,\n keepHead: true,\n sizeMapping: c => {\n const DECAY_TIME = 200;\n const DECAY_LENGTH = 10;\n const t = Math.max(0, 1 - (performance.now() - c.pressure) / DECAY_TIME);\n const l = (DECAY_LENGTH - Math.min(DECAY_LENGTH, c.totalLength - c.currentIndex)) / DECAY_LENGTH;\n return Math.min((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.easeOut)(l), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.easeOut)(t));\n },\n fill: () => app.state.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.LIGHT ? \"rgba(0, 0, 0, 0.2)\" : \"rgba(255, 255, 255, 0.2)\"\n });\n this.elementsToErase = new Set();\n this.groupsToErase = new Set();\n this.segmentsCache = new Map();\n this.geometricShapesCache = new Map();\n }\n\n startPath(x, y) {\n this.endPath();\n super.startPath(x, y);\n this.elementsToErase.clear();\n }\n\n addPointToPath(x, y, restore = false) {\n super.addPointToPath(x, y);\n const elementsToEraser = this.updateElementsToBeErased(restore);\n return elementsToEraser;\n }\n\n updateElementsToBeErased(restoreToErase) {\n var _a, _b;\n\n let eraserPath = ((_b = (_a = super.getCurrentTrail()) === null || _a === void 0 ? void 0 : _a.originalPoints) === null || _b === void 0 ? void 0 : _b.map(p => (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)(p[0], p[1]))) || []; // for efficiency and avoid unnecessary calculations,\n // take only POINTS_ON_TRAIL points to form some number of segments\n\n eraserPath = eraserPath === null || eraserPath === void 0 ? void 0 : eraserPath.slice(eraserPath.length - POINTS_ON_TRAIL);\n const visibleElementsMap = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.arrayToMap)(this.app.visibleElements);\n const pathSegments = eraserPath.reduce((acc, point, index) => {\n if (index === 0) {\n return acc;\n }\n\n acc.push((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.lineSegment)(eraserPath[index - 1], point));\n return acc;\n }, []);\n\n if (pathSegments.length === 0) {\n return [];\n }\n\n for (const element of this.app.visibleElements) {\n // restore only if already added to the to-be-erased set\n if (restoreToErase && this.elementsToErase.has(element.id)) {\n const intersects = eraserTest(pathSegments, element, this.segmentsCache, this.geometricShapesCache, visibleElementsMap, this.app);\n\n if (intersects) {\n const shallowestGroupId = element.groupIds.at(-1);\n\n if (this.groupsToErase.has(shallowestGroupId)) {\n const elementsInGroup = (0,_excalidraw_element_groups__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(this.app.scene.getNonDeletedElementsMap(), shallowestGroupId);\n\n for (const elementInGroup of elementsInGroup) {\n this.elementsToErase.delete(elementInGroup.id);\n }\n\n this.groupsToErase.delete(shallowestGroupId);\n }\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(element)) {\n this.elementsToErase.delete(element.containerId);\n }\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__.hasBoundTextElement)(element)) {\n const boundText = (0,_excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_8__.getBoundTextElementId)(element);\n\n if (boundText) {\n this.elementsToErase.delete(boundText);\n }\n }\n\n this.elementsToErase.delete(element.id);\n }\n } else if (!restoreToErase && !this.elementsToErase.has(element.id)) {\n const intersects = eraserTest(pathSegments, element, this.segmentsCache, this.geometricShapesCache, visibleElementsMap, this.app);\n\n if (intersects) {\n const shallowestGroupId = element.groupIds.at(-1);\n\n if (!this.groupsToErase.has(shallowestGroupId)) {\n const elementsInGroup = (0,_excalidraw_element_groups__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(this.app.scene.getNonDeletedElementsMap(), shallowestGroupId);\n\n for (const elementInGroup of elementsInGroup) {\n this.elementsToErase.add(elementInGroup.id);\n }\n\n this.groupsToErase.add(shallowestGroupId);\n }\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__.hasBoundTextElement)(element)) {\n const boundText = (0,_excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_8__.getBoundTextElementId)(element);\n\n if (boundText) {\n this.elementsToErase.add(boundText);\n }\n }\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(element)) {\n this.elementsToErase.add(element.containerId);\n }\n\n this.elementsToErase.add(element.id);\n }\n }\n }\n\n return Array.from(this.elementsToErase);\n }\n\n endPath() {\n super.endPath();\n super.clearTrails();\n this.elementsToErase.clear();\n this.groupsToErase.clear();\n this.segmentsCache.clear();\n }\n\n}\n\nconst eraserTest = (pathSegments, element, elementsSegments, shapesCache = new Map(), visibleElementsMap = new Map(), app) => {\n let shape = shapesCache.get(element.id);\n\n if (!shape) {\n shape = (0,_excalidraw_element_shapes__WEBPACK_IMPORTED_MODULE_4__.getElementShape)(element, visibleElementsMap);\n shapesCache.set(element.id, shape);\n }\n\n const lastPoint = pathSegments[pathSegments.length - 1][1];\n\n if ((0,_excalidraw_element_collision__WEBPACK_IMPORTED_MODULE_5__.shouldTestInside)(element) && (0,_excalidraw_utils_collision__WEBPACK_IMPORTED_MODULE_6__.isPointInShape)(lastPoint, shape)) {\n return true;\n }\n\n let elementSegments = elementsSegments.get(element.id);\n\n if (!elementSegments) {\n elementSegments = (0,_excalidraw_element_bounds__WEBPACK_IMPORTED_MODULE_1__.getElementLineSegments)(element, visibleElementsMap);\n elementsSegments.set(element.id, elementSegments);\n }\n\n return pathSegments.some(pathSegment => elementSegments === null || elementSegments === void 0 ? void 0 : elementSegments.some(elementSegment => (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.lineSegmentIntersectionPoints)(pathSegment, elementSegment, app.getElementHitThreshold()) !== null));\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./eraser/index.ts?");
16889
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EraserTrail: () => (/* binding */ EraserTrail)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_element_bounds__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/element/bounds */ \"../element/src/bounds.ts\");\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _excalidraw_element_groups__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/element/groups */ \"../element/src/groups.ts\");\n/* harmony import */ var _excalidraw_element_shapes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @excalidraw/element/shapes */ \"../element/src/shapes.ts\");\n/* harmony import */ var _excalidraw_element_collision__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @excalidraw/element/collision */ \"../element/src/collision.ts\");\n/* harmony import */ var _excalidraw_utils_collision__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @excalidraw/utils/collision */ \"../utils/src/collision.ts\");\n/* harmony import */ var _excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @excalidraw/element/typeChecks */ \"../element/src/typeChecks.ts\");\n/* harmony import */ var _excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @excalidraw/element/textElement */ \"../element/src/textElement.ts\");\n/* harmony import */ var _animated_trail__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../animated-trail */ \"./animated-trail.ts\");\n\n\n\n\n\n\n\n\n\n // just enough to form a segment; this is sufficient for eraser\n\nconst POINTS_ON_TRAIL = 2;\nclass EraserTrail extends _animated_trail__WEBPACK_IMPORTED_MODULE_9__.AnimatedTrail {\n constructor(animationFrameHandler, app) {\n super(animationFrameHandler, app, {\n streamline: 0.2,\n size: 5,\n keepHead: true,\n sizeMapping: c => {\n const DECAY_TIME = 200;\n const DECAY_LENGTH = 10;\n const t = Math.max(0, 1 - (performance.now() - c.pressure) / DECAY_TIME);\n const l = (DECAY_LENGTH - Math.min(DECAY_LENGTH, c.totalLength - c.currentIndex)) / DECAY_LENGTH;\n return Math.min((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.easeOut)(l), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.easeOut)(t));\n },\n fill: () => app.state.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.LIGHT ? \"rgba(0, 0, 0, 0.2)\" : \"rgba(255, 255, 255, 0.2)\"\n });\n this.elementsToErase = new Set();\n this.groupsToErase = new Set();\n this.segmentsCache = new Map();\n this.geometricShapesCache = new Map();\n }\n\n startPath(x, y) {\n this.endPath();\n super.startPath(x, y);\n this.elementsToErase.clear();\n }\n\n addPointToPath(x, y, restore = false) {\n super.addPointToPath(x, y);\n const elementsToEraser = this.updateElementsToBeErased(restore);\n return elementsToEraser;\n }\n\n updateElementsToBeErased(restoreToErase) {\n var _a, _b;\n\n let eraserPath = ((_b = (_a = super.getCurrentTrail()) === null || _a === void 0 ? void 0 : _a.originalPoints) === null || _b === void 0 ? void 0 : _b.map(p => (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)(p[0], p[1]))) || []; // for efficiency and avoid unnecessary calculations,\n // take only POINTS_ON_TRAIL points to form some number of segments\n\n eraserPath = eraserPath === null || eraserPath === void 0 ? void 0 : eraserPath.slice(eraserPath.length - POINTS_ON_TRAIL);\n const candidateElements = this.app.visibleElements.filter(el => !el.locked);\n const candidateElementsMap = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.arrayToMap)(candidateElements);\n const pathSegments = eraserPath.reduce((acc, point, index) => {\n if (index === 0) {\n return acc;\n }\n\n acc.push((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.lineSegment)(eraserPath[index - 1], point));\n return acc;\n }, []);\n\n if (pathSegments.length === 0) {\n return [];\n }\n\n for (const element of candidateElements) {\n // restore only if already added to the to-be-erased set\n if (restoreToErase && this.elementsToErase.has(element.id)) {\n const intersects = eraserTest(pathSegments, element, this.segmentsCache, this.geometricShapesCache, candidateElementsMap, this.app);\n\n if (intersects) {\n const shallowestGroupId = element.groupIds.at(-1);\n\n if (this.groupsToErase.has(shallowestGroupId)) {\n const elementsInGroup = (0,_excalidraw_element_groups__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(this.app.scene.getNonDeletedElementsMap(), shallowestGroupId);\n\n for (const elementInGroup of elementsInGroup) {\n this.elementsToErase.delete(elementInGroup.id);\n }\n\n this.groupsToErase.delete(shallowestGroupId);\n }\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(element)) {\n this.elementsToErase.delete(element.containerId);\n }\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__.hasBoundTextElement)(element)) {\n const boundText = (0,_excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_8__.getBoundTextElementId)(element);\n\n if (boundText) {\n this.elementsToErase.delete(boundText);\n }\n }\n\n this.elementsToErase.delete(element.id);\n }\n } else if (!restoreToErase && !this.elementsToErase.has(element.id)) {\n const intersects = eraserTest(pathSegments, element, this.segmentsCache, this.geometricShapesCache, candidateElementsMap, this.app);\n\n if (intersects) {\n const shallowestGroupId = element.groupIds.at(-1);\n\n if (!this.groupsToErase.has(shallowestGroupId)) {\n const elementsInGroup = (0,_excalidraw_element_groups__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(this.app.scene.getNonDeletedElementsMap(), shallowestGroupId);\n\n for (const elementInGroup of elementsInGroup) {\n this.elementsToErase.add(elementInGroup.id);\n }\n\n this.groupsToErase.add(shallowestGroupId);\n }\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__.hasBoundTextElement)(element)) {\n const boundText = (0,_excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_8__.getBoundTextElementId)(element);\n\n if (boundText) {\n this.elementsToErase.add(boundText);\n }\n }\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(element)) {\n this.elementsToErase.add(element.containerId);\n }\n\n this.elementsToErase.add(element.id);\n }\n }\n }\n\n return Array.from(this.elementsToErase);\n }\n\n endPath() {\n super.endPath();\n super.clearTrails();\n this.elementsToErase.clear();\n this.groupsToErase.clear();\n this.segmentsCache.clear();\n }\n\n}\n\nconst eraserTest = (pathSegments, element, elementsSegments, shapesCache, elementsMap, app) => {\n let shape = shapesCache.get(element.id);\n\n if (!shape) {\n shape = (0,_excalidraw_element_shapes__WEBPACK_IMPORTED_MODULE_4__.getElementShape)(element, elementsMap);\n shapesCache.set(element.id, shape);\n }\n\n const lastPoint = pathSegments[pathSegments.length - 1][1];\n\n if ((0,_excalidraw_element_collision__WEBPACK_IMPORTED_MODULE_5__.shouldTestInside)(element) && (0,_excalidraw_utils_collision__WEBPACK_IMPORTED_MODULE_6__.isPointInShape)(lastPoint, shape)) {\n return true;\n }\n\n let elementSegments = elementsSegments.get(element.id);\n\n if (!elementSegments) {\n elementSegments = (0,_excalidraw_element_bounds__WEBPACK_IMPORTED_MODULE_1__.getElementLineSegments)(element, elementsMap);\n elementsSegments.set(element.id, elementSegments);\n }\n\n return pathSegments.some(pathSegment => elementSegments === null || elementSegments === void 0 ? void 0 : elementSegments.some(elementSegment => (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.lineSegmentIntersectionPoints)(pathSegment, elementSegment, app.getElementHitThreshold()) !== null));\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./eraser/index.ts?");
16890
16890
 
16891
16891
  /***/ }),
16892
16892
 
@@ -16996,7 +16996,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
16996
16996
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16997
16997
 
16998
16998
  "use strict";
16999
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExcalidrawFontFace: () => (/* binding */ ExcalidrawFontFace)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _subset_subset_main__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../subset/subset-main */ \"./subset/subset-main.ts\");\n/* harmony import */ var _data_encode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../data/encode */ \"./data/encode.ts\");\n/* harmony import */ var _obsidianUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../obsidianUtils */ \"./obsidianUtils.ts\");\n\n\n\n\nclass ExcalidrawFontFace {\n constructor(family, uri, descriptors) {\n this.urls = ExcalidrawFontFace.createUrls(uri);\n const sources = this.urls.map(url => `url(${url}) ${ExcalidrawFontFace.getFormat(url)}`).join(\", \");\n this.fontFace = new FontFace(family, sources, Object.assign({\n display: \"swap\",\n style: \"normal\",\n weight: \"400\"\n }, descriptors));\n }\n /**\r\n * Generates CSS `@font-face` definition with the (subsetted) font source as a data url for the characters within the unicode range.\r\n *\r\n * Retrieves `undefined` otherwise.\r\n */\n\n\n toCSS(characters) {\n // quick exit in case the characters are not within this font face's unicode range\n if (!this.getUnicodeRangeRegex().test(characters)) {\n return;\n } //zsviczian - only woffs are chopped into glyphs other fonts are returned as is\n\n\n if (typeof this.urls[0] === \"string\" && !this.urls[0].startsWith(\"data:font/woff2\")) {\n return Promise.resolve(`@font-face { font-family: ${this.fontFace.family}; src: url(${this.urls[0]}); }`);\n }\n\n const codepoints = Array.from(characters).map(char => char.codePointAt(0));\n return this.getContent(codepoints).then(content => `@font-face { font-family: ${this.fontFace.family}; src: url(${content}); }`);\n }\n /**\r\n * Tries to fetch woff2 content, based on the registered urls (from first to last, treated as fallbacks).\r\n *\r\n * @returns base64 with subsetted glyphs based on the passed codepoint, last defined url otherwise\r\n */\n\n\n async getContent(codePoints) {\n let i = 0;\n const errorMessages = [];\n\n while (i < this.urls.length) {\n const url = this.urls[i];\n\n try {\n const arrayBuffer = await this.fetchFont(url);\n const base64 = await (0,_subset_subset_main__WEBPACK_IMPORTED_MODULE_1__.subsetWoff2GlyphsByCodepoints)(arrayBuffer, codePoints);\n return base64;\n } catch (e) {\n errorMessages.push(`\"${url.toString()}\" returned error \"${e}\"`);\n }\n\n i++;\n }\n\n console.error(`Failed to fetch font family \"${this.fontFace.family}\"`, JSON.stringify(errorMessages, undefined, 2)); // in case of issues, at least return the last url as a content\n // defaults to unpkg for bundled fonts (so that we don't have to host them forever) and http url for others\n\n return this.urls.length ? this.urls[this.urls.length - 1].toString() : \"\";\n }\n\n fetchFont(url) {\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.promiseTry)(async () => {\n const result = await (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_3__.fetchFontFromVault)(url); //zsviczian\n\n if (result) {\n return result;\n }\n\n const response = await fetch(url, {\n // always prefer cache (even stale), otherwise it always triggers an unnecessary validation request\n // which we don't need as we are controlling freshness of the fonts with the stable hash suffix in the url\n // https://developer.mozilla.org/en-US/docs/Web/API/Request/cache\n cache: \"force-cache\",\n headers: {\n Accept: \"font/woff2\"\n }\n });\n\n if (!response.ok) {\n const urlString = url instanceof URL ? url.toString() : \"dataurl\";\n throw new Error(`Failed to fetch \"${urlString}\": ${response.statusText}`);\n }\n\n const arrayBuffer = await response.arrayBuffer();\n return arrayBuffer;\n });\n }\n\n getUnicodeRangeRegex() {\n // using \\u{h} or \\u{hhhhh} to match any number of hex digits,\n // otherwise we would get an \"Invalid Unicode escape\" error\n // e.g. U+0-1007F -> \\u{0}-\\u{1007F}\n const unicodeRangeRegex = this.fontFace.unicodeRange.split(/,\\s*/).map(range => {\n const [start, end] = range.replace(\"U+\", \"\").split(\"-\");\n\n if (end) {\n return `\\\\u{${start}}-\\\\u{${end}}`;\n }\n\n return `\\\\u{${start}}`;\n }).join(\"\");\n return new RegExp(`[${unicodeRangeRegex}]`, \"u\");\n }\n\n static createUrls(uri) {\n if (uri.startsWith(\"data\")) {\n // don't create the URL instance, as parsing the huge dataurl string is expensive\n return [uri];\n }\n\n if (uri.startsWith(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.LOCAL_FONT_PROTOCOL)) {\n // no url for local fonts\n return [];\n }\n\n if (uri.startsWith(\"http\")) {\n // one url for http imports or data url\n return [new URL(uri)];\n } // absolute assets paths, which are found in tests and excalidraw-app build, won't work with base url, so we are stripping initial slash away\n\n\n const assetUrl = uri.replace(/^\\/+/, \"\");\n const urls = [];\n\n if (typeof window.EXCALIDRAW_ASSET_PATH === \"string\") {\n const normalizedBaseUrl = this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);\n urls.push(new URL(assetUrl, normalizedBaseUrl));\n } else if (Array.isArray(window.EXCALIDRAW_ASSET_PATH)) {\n window.EXCALIDRAW_ASSET_PATH.forEach(path => {\n const normalizedBaseUrl = this.normalizeBaseUrl(path);\n urls.push(new URL(assetUrl, normalizedBaseUrl));\n });\n } // fallback url for bundled fonts\n\n\n urls.push(new URL(assetUrl, ExcalidrawFontFace.ASSETS_FALLBACK_URL));\n return urls;\n }\n\n static getFormat(url) {\n if (!(url instanceof URL)) {\n // format is irrelevant for data url\n return \"\";\n }\n\n try {\n const parts = new URL(url).pathname.split(\".\");\n\n if (parts.length === 1) {\n return \"\";\n }\n\n return `format('${parts.pop()}')`;\n } catch (error) {\n return \"\";\n }\n }\n\n static normalizeBaseUrl(baseUrl) {\n var _a;\n\n let result = baseUrl; // in case user passed a root-relative url (~absolute path),\n // like \"/\" or \"/some/path\", or relative (starts with \"./\"),\n // prepend it with `location.origin`\n\n if (/^\\.?\\//.test(result)) {\n result = new URL(result.replace(/^\\.?\\/+/, \"\"), (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.origin).toString();\n } // ensure there is a trailing slash, otherwise url won't be correctly concatenated\n\n\n result = `${result.replace(/\\/+$/, \"\")}/`;\n return result;\n }\n /**\r\n * zsviczian https://github.com/zsviczian/excalidraw/commit/b4cfaaa4b4f46ca01f94e27fb7bf651a9da99daa\r\n */\n\n\n async getContentLegacy() {\n let i = 0;\n const errorMessages = [];\n\n while (i < this.urls.length) {\n const url = this.urls[i];\n\n if (typeof url === \"string\" && url.startsWith(\"data:\")) {\n // it's dataurl, the font is inlined as base64, no need to fetch\n return url;\n }\n\n try {\n const result = await (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_3__.fetchFontFromVault)(url); //zsviczian\n\n if (result) {\n return `data:font/woff2;base64,${(0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.stringToBase64)((0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.toByteString)(result), true)}`;\n }\n\n const response = await fetch(url, {\n headers: {\n Accept: \"font/woff2\"\n }\n });\n\n if (response.ok) {\n const mimeType = response.headers.get(\"Content-Type\");\n const buffer = await response.arrayBuffer();\n return `data:${mimeType};base64,${(0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.stringToBase64)((0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.toByteString)(buffer), true)}`;\n } // response not ok, try to continue\n\n\n errorMessages.push(`\"${url.toString()}\" returned status \"${response.status}\"`);\n } catch (e) {\n errorMessages.push(`\"${url.toString()}\" returned error \"${e}\"`);\n }\n\n i++;\n }\n\n console.error(`Failed to fetch font \"${this.fontFace.family}\" from urls \"${this.urls.toString()}`, JSON.stringify(errorMessages, undefined, 2)); // in case of issues, at least return the last url as a content\n // defaults to unpkg for bundled fonts (so that we don't have to host them forever) and http url for others\n\n return this.urls.length ? this.urls[this.urls.length - 1].toString() : \"\";\n }\n\n}\nExcalidrawFontFace.ASSETS_FALLBACK_URL = `https://esm.sh/${({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-5\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_NAME ? `${({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-5\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_NAME}@${({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-5\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_VERSION}` // is provided during package build\n: \"@excalidraw/excalidraw\" // fallback to the latest package version (i.e. for app)\n}/dist/prod/`;\n\n//# sourceURL=webpack://ExcalidrawLib/./fonts/ExcalidrawFontFace.ts?");
16999
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExcalidrawFontFace: () => (/* binding */ ExcalidrawFontFace)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _subset_subset_main__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../subset/subset-main */ \"./subset/subset-main.ts\");\n/* harmony import */ var _data_encode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../data/encode */ \"./data/encode.ts\");\n/* harmony import */ var _obsidianUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../obsidianUtils */ \"./obsidianUtils.ts\");\n\n\n\n\nclass ExcalidrawFontFace {\n constructor(family, uri, descriptors) {\n this.urls = ExcalidrawFontFace.createUrls(uri);\n const sources = this.urls.map(url => `url(${url}) ${ExcalidrawFontFace.getFormat(url)}`).join(\", \");\n this.fontFace = new FontFace(family, sources, Object.assign({\n display: \"swap\",\n style: \"normal\",\n weight: \"400\"\n }, descriptors));\n }\n /**\r\n * Generates CSS `@font-face` definition with the (subsetted) font source as a data url for the characters within the unicode range.\r\n *\r\n * Retrieves `undefined` otherwise.\r\n */\n\n\n toCSS(characters) {\n // quick exit in case the characters are not within this font face's unicode range\n if (!this.getUnicodeRangeRegex().test(characters)) {\n return;\n } //zsviczian - only woffs are chopped into glyphs other fonts are returned as is\n\n\n if (typeof this.urls[0] === \"string\" && !this.urls[0].startsWith(\"data:font/woff2\")) {\n return Promise.resolve(`@font-face { font-family: ${this.fontFace.family}; src: url(${this.urls[0]}); }`);\n }\n\n const codepoints = Array.from(characters).map(char => char.codePointAt(0));\n return this.getContent(codepoints).then(content => `@font-face { font-family: ${this.fontFace.family}; src: url(${content}); }`);\n }\n /**\r\n * Tries to fetch woff2 content, based on the registered urls (from first to last, treated as fallbacks).\r\n *\r\n * @returns base64 with subsetted glyphs based on the passed codepoint, last defined url otherwise\r\n */\n\n\n async getContent(codePoints) {\n let i = 0;\n const errorMessages = [];\n\n while (i < this.urls.length) {\n const url = this.urls[i];\n\n try {\n const arrayBuffer = await this.fetchFont(url);\n const base64 = await (0,_subset_subset_main__WEBPACK_IMPORTED_MODULE_1__.subsetWoff2GlyphsByCodepoints)(arrayBuffer, codePoints);\n return base64;\n } catch (e) {\n errorMessages.push(`\"${url.toString()}\" returned error \"${e}\"`);\n }\n\n i++;\n }\n\n console.error(`Failed to fetch font family \"${this.fontFace.family}\"`, JSON.stringify(errorMessages, undefined, 2)); // in case of issues, at least return the last url as a content\n // defaults to unpkg for bundled fonts (so that we don't have to host them forever) and http url for others\n\n return this.urls.length ? this.urls[this.urls.length - 1].toString() : \"\";\n }\n\n fetchFont(url) {\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.promiseTry)(async () => {\n const result = await (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_3__.fetchFontFromVault)(url); //zsviczian\n\n if (result) {\n return result;\n }\n\n const response = await fetch(url, {\n // always prefer cache (even stale), otherwise it always triggers an unnecessary validation request\n // which we don't need as we are controlling freshness of the fonts with the stable hash suffix in the url\n // https://developer.mozilla.org/en-US/docs/Web/API/Request/cache\n cache: \"force-cache\",\n headers: {\n Accept: \"font/woff2\"\n }\n });\n\n if (!response.ok) {\n const urlString = url instanceof URL ? url.toString() : \"dataurl\";\n throw new Error(`Failed to fetch \"${urlString}\": ${response.statusText}`);\n }\n\n const arrayBuffer = await response.arrayBuffer();\n return arrayBuffer;\n });\n }\n\n getUnicodeRangeRegex() {\n // using \\u{h} or \\u{hhhhh} to match any number of hex digits,\n // otherwise we would get an \"Invalid Unicode escape\" error\n // e.g. U+0-1007F -> \\u{0}-\\u{1007F}\n const unicodeRangeRegex = this.fontFace.unicodeRange.split(/,\\s*/).map(range => {\n const [start, end] = range.replace(\"U+\", \"\").split(\"-\");\n\n if (end) {\n return `\\\\u{${start}}-\\\\u{${end}}`;\n }\n\n return `\\\\u{${start}}`;\n }).join(\"\");\n return new RegExp(`[${unicodeRangeRegex}]`, \"u\");\n }\n\n static createUrls(uri) {\n if (uri.startsWith(\"data\")) {\n // don't create the URL instance, as parsing the huge dataurl string is expensive\n return [uri];\n }\n\n if (uri.startsWith(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.LOCAL_FONT_PROTOCOL)) {\n // no url for local fonts\n return [];\n }\n\n if (uri.startsWith(\"http\")) {\n // one url for http imports or data url\n return [new URL(uri)];\n } // absolute assets paths, which are found in tests and excalidraw-app build, won't work with base url, so we are stripping initial slash away\n\n\n const assetUrl = uri.replace(/^\\/+/, \"\");\n const urls = [];\n\n if (typeof window.EXCALIDRAW_ASSET_PATH === \"string\") {\n const normalizedBaseUrl = this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);\n urls.push(new URL(assetUrl, normalizedBaseUrl));\n } else if (Array.isArray(window.EXCALIDRAW_ASSET_PATH)) {\n window.EXCALIDRAW_ASSET_PATH.forEach(path => {\n const normalizedBaseUrl = this.normalizeBaseUrl(path);\n urls.push(new URL(assetUrl, normalizedBaseUrl));\n });\n } // fallback url for bundled fonts\n\n\n urls.push(new URL(assetUrl, ExcalidrawFontFace.ASSETS_FALLBACK_URL));\n return urls;\n }\n\n static getFormat(url) {\n if (!(url instanceof URL)) {\n // format is irrelevant for data url\n return \"\";\n }\n\n try {\n const parts = new URL(url).pathname.split(\".\");\n\n if (parts.length === 1) {\n return \"\";\n }\n\n return `format('${parts.pop()}')`;\n } catch (error) {\n return \"\";\n }\n }\n\n static normalizeBaseUrl(baseUrl) {\n var _a;\n\n let result = baseUrl; // in case user passed a root-relative url (~absolute path),\n // like \"/\" or \"/some/path\", or relative (starts with \"./\"),\n // prepend it with `location.origin`\n\n if (/^\\.?\\//.test(result)) {\n result = new URL(result.replace(/^\\.?\\/+/, \"\"), (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.origin).toString();\n } // ensure there is a trailing slash, otherwise url won't be correctly concatenated\n\n\n result = `${result.replace(/\\/+$/, \"\")}/`;\n return result;\n }\n /**\r\n * zsviczian https://github.com/zsviczian/excalidraw/commit/b4cfaaa4b4f46ca01f94e27fb7bf651a9da99daa\r\n */\n\n\n async getContentLegacy() {\n let i = 0;\n const errorMessages = [];\n\n while (i < this.urls.length) {\n const url = this.urls[i];\n\n if (typeof url === \"string\" && url.startsWith(\"data:\")) {\n // it's dataurl, the font is inlined as base64, no need to fetch\n return url;\n }\n\n try {\n const result = await (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_3__.fetchFontFromVault)(url); //zsviczian\n\n if (result) {\n return `data:font/woff2;base64,${(0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.stringToBase64)((0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.toByteString)(result), true)}`;\n }\n\n const response = await fetch(url, {\n headers: {\n Accept: \"font/woff2\"\n }\n });\n\n if (response.ok) {\n const mimeType = response.headers.get(\"Content-Type\");\n const buffer = await response.arrayBuffer();\n return `data:${mimeType};base64,${(0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.stringToBase64)((0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.toByteString)(buffer), true)}`;\n } // response not ok, try to continue\n\n\n errorMessages.push(`\"${url.toString()}\" returned status \"${response.status}\"`);\n } catch (e) {\n errorMessages.push(`\"${url.toString()}\" returned error \"${e}\"`);\n }\n\n i++;\n }\n\n console.error(`Failed to fetch font \"${this.fontFace.family}\" from urls \"${this.urls.toString()}`, JSON.stringify(errorMessages, undefined, 2)); // in case of issues, at least return the last url as a content\n // defaults to unpkg for bundled fonts (so that we don't have to host them forever) and http url for others\n\n return this.urls.length ? this.urls[this.urls.length - 1].toString() : \"\";\n }\n\n}\nExcalidrawFontFace.ASSETS_FALLBACK_URL = `https://esm.sh/${({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-6\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_NAME ? `${({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-6\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_NAME}@${({\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-6\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_VERSION}` // is provided during package build\n: \"@excalidraw/excalidraw\" // fallback to the latest package version (i.e. for app)\n}/dist/prod/`;\n\n//# sourceURL=webpack://ExcalidrawLib/./fonts/ExcalidrawFontFace.ts?");
17000
17000
 
17001
17001
  /***/ }),
17002
17002
 
@@ -20460,7 +20460,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
20460
20460
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20461
20461
 
20462
20462
  "use strict";
20463
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _excalidraw_common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common/constants */ \"../common/src/constants.ts\");\n\n\nif (\"development\" !== _excalidraw_common_constants__WEBPACK_IMPORTED_MODULE_0__.ENV.TEST) {\n /* eslint-disable */\n\n /* global __webpack_public_path__:writable */\n __webpack_require__.p = window.EXCALIDRAW_ASSET_PATH || `https://unpkg.com/${\"@zsviczian/excalidraw\"}@${\"0.18.0-5\"}/dist/`;\n}\n\n//# sourceURL=webpack://ExcalidrawLib/./publicPath.js?");
20463
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _excalidraw_common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common/constants */ \"../common/src/constants.ts\");\n\n\nif (\"development\" !== _excalidraw_common_constants__WEBPACK_IMPORTED_MODULE_0__.ENV.TEST) {\n /* eslint-disable */\n\n /* global __webpack_public_path__:writable */\n __webpack_require__.p = window.EXCALIDRAW_ASSET_PATH || `https://unpkg.com/${\"@zsviczian/excalidraw\"}@${\"0.18.0-6\"}/dist/`;\n}\n\n//# sourceURL=webpack://ExcalidrawLib/./publicPath.js?");
20464
20464
 
20465
20465
  /***/ }),
20466
20466
 
@@ -20537,7 +20537,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
20537
20537
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20538
20538
 
20539
20539
  "use strict";
20540
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ renderStaticScene: () => (/* binding */ renderStaticScene),\n/* harmony export */ renderStaticSceneThrottled: () => (/* binding */ renderStaticSceneThrottled)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_element_elementLink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/element/elementLink */ \"../element/src/elementLink.ts\");\n/* harmony import */ var _excalidraw_element_embeddable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/element/embeddable */ \"../element/src/embeddable.ts\");\n/* harmony import */ var _excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/element/textElement */ \"../element/src/textElement.ts\");\n/* harmony import */ var _excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @excalidraw/element/typeChecks */ \"../element/src/typeChecks.ts\");\n/* harmony import */ var _excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @excalidraw/element/frame */ \"../element/src/frame.ts\");\n/* harmony import */ var _excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @excalidraw/element/renderElement */ \"../element/src/renderElement.ts\");\n/* harmony import */ var _excalidraw_element_bounds__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @excalidraw/element/bounds */ \"../element/src/bounds.ts\");\n/* harmony import */ var _components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/hyperlink/helpers */ \"./components/hyperlink/helpers.ts\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers */ \"./renderer/helpers.ts\");\n\n\n\n\n\n\n\n\n\n\n/*const GridLineColor = {\r\n Bold: \"#dddddd\",\r\n Regular: \"#e5e5e5\",\r\n} as const;*/\n//zsviczian\n\nconst strokeGrid = (context,\n/** grid cell pixel size */\ngridSize,\n/** setting to 1 will disble bold lines */\ngridStep, scrollX, scrollY, zoom, width, height, GridLineColor) => {\n const offsetX = scrollX % gridSize - gridSize;\n const offsetY = scrollY % gridSize - gridSize;\n const actualGridSize = gridSize * zoom.value;\n const spaceWidth = 1 / zoom.value;\n context.save(); // Offset rendering by 0.5 to ensure that 1px wide lines are crisp.\n // We only do this when zoomed to 100% because otherwise the offset is\n // fractional, and also visibly offsets the elements.\n // We also do this per-axis, as each axis may already be offset by 0.5.\n\n if (zoom.value === 1) {\n context.translate(offsetX % 1 ? 0 : 0.5, offsetY % 1 ? 0 : 0.5);\n } // vertical lines\n\n\n for (let x = offsetX; x < offsetX + width + gridSize * 2; x += gridSize) {\n const isBold = gridStep > 1 && Math.round(x - scrollX) % (gridStep * gridSize) === 0; // don't render regular lines when zoomed out and they're barely visible\n\n if (!isBold && actualGridSize < 10) {\n continue;\n }\n\n const lineWidth = Math.min(1 / zoom.value, isBold ? 4 : 1);\n context.lineWidth = lineWidth;\n const lineDash = [lineWidth * 3, spaceWidth + (lineWidth + spaceWidth)];\n context.beginPath();\n context.setLineDash(isBold ? [] : lineDash);\n context.strokeStyle = isBold ? GridLineColor.Bold : GridLineColor.Regular;\n context.moveTo(x, offsetY - gridSize);\n context.lineTo(x, Math.ceil(offsetY + height + gridSize * 2));\n context.stroke();\n }\n\n for (let y = offsetY; y < offsetY + height + gridSize * 2; y += gridSize) {\n const isBold = gridStep > 1 && Math.round(y - scrollY) % (gridStep * gridSize) === 0;\n\n if (!isBold && actualGridSize < 10) {\n continue;\n }\n\n const lineWidth = Math.min(1 / zoom.value, isBold ? 4 : 1);\n context.lineWidth = lineWidth;\n const lineDash = [lineWidth * 3, spaceWidth + (lineWidth + spaceWidth)];\n context.beginPath();\n context.setLineDash(isBold ? [] : lineDash);\n context.strokeStyle = isBold ? GridLineColor.Bold : GridLineColor.Regular;\n context.moveTo(offsetX - gridSize, y);\n context.lineTo(Math.ceil(offsetX + width + gridSize * 2), y);\n context.stroke();\n }\n\n context.restore();\n};\n\nconst frameClip = (frame, context, renderConfig, appState) => {\n context.translate(frame.x + appState.scrollX, frame.y + appState.scrollY);\n context.beginPath();\n\n if (context.roundRect) {\n context.roundRect(0, 0, frame.width, frame.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.radius / appState.zoom.value);\n } else {\n context.rect(0, 0, frame.width, frame.height);\n }\n\n context.clip();\n context.translate(-(frame.x + appState.scrollX), -(frame.y + appState.scrollY));\n};\n\nconst linkIconCanvasCache = {\n regularLink: null,\n elementLink: null\n};\n\nconst renderLinkIcon = (element, context, appState, elementsMap) => {\n if (element.link && !appState.selectedElementIds[element.id]) {\n const [x1, y1, x2, y2] = (0,_excalidraw_element_bounds__WEBPACK_IMPORTED_MODULE_7__.getElementAbsoluteCoords)(element, elementsMap);\n const [x, y, width, height] = (0,_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_8__.getLinkHandleFromCoords)([x1, y1, x2, y2], element.angle, appState);\n const centerX = x + width / 2;\n const centerY = y + height / 2;\n context.save();\n context.translate(appState.scrollX + centerX, appState.scrollY + centerY);\n context.rotate(element.angle);\n const canvasKey = (0,_excalidraw_element_elementLink__WEBPACK_IMPORTED_MODULE_1__.isElementLink)(element.link) ? \"elementLink\" : \"regularLink\";\n let linkCanvas = linkIconCanvasCache[canvasKey];\n\n if (!linkCanvas || linkCanvas.zoom !== appState.zoom.value) {\n linkCanvas = Object.assign(document.createElement(\"canvas\"), {\n zoom: appState.zoom.value\n });\n linkCanvas.width = width * window.devicePixelRatio * appState.zoom.value;\n linkCanvas.height = height * window.devicePixelRatio * appState.zoom.value;\n linkIconCanvasCache[canvasKey] = linkCanvas;\n const linkCanvasCacheContext = linkCanvas.getContext(\"2d\");\n linkCanvasCacheContext.scale(window.devicePixelRatio * appState.zoom.value, window.devicePixelRatio * appState.zoom.value);\n /*linkCanvasCacheContext.fillStyle = \"#fff\";\r\n linkCanvasCacheContext.fillRect(0, 0, width, height);*/\n //zsviczian\n\n if (canvasKey === \"elementLink\") {\n linkCanvasCacheContext.drawImage(_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_8__.ELEMENT_LINK_IMG, 0, 0, width, height);\n } else {\n linkCanvasCacheContext.globalAlpha = appState.linkOpacity; //zsviczian\n\n linkCanvasCacheContext.drawImage(_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_8__.EXTERNAL_LINK_IMG, 0, 0, width, height);\n }\n\n linkCanvasCacheContext.restore();\n }\n\n context.drawImage(linkCanvas, x - centerX, y - centerY, width, height);\n context.restore();\n }\n};\n\nconst _renderStaticScene = ({\n canvas,\n rc,\n elementsMap,\n allElementsMap,\n visibleElements,\n scale,\n appState,\n renderConfig\n}) => {\n var _a;\n\n if (canvas === null) {\n return;\n }\n\n const {\n renderGrid = true,\n isExporting,\n isHighlighterPenDrawing = false\n } = renderConfig; //zsviczian\n\n const [normalizedWidth, normalizedHeight] = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getNormalizedCanvasDimensions)(canvas, scale);\n const context = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.bootstrapCanvas)({\n canvas,\n scale,\n normalizedWidth,\n normalizedHeight,\n theme: appState.theme,\n isExporting,\n viewBackgroundColor: isHighlighterPenDrawing ? \"transparent\" : appState.viewBackgroundColor //zsviczian\n\n }); // Apply zoom\n\n context.scale(appState.zoom.value, appState.zoom.value); // Grid\n\n if (renderGrid) {\n strokeGrid(context, appState.gridSize, appState.gridStep, appState.scrollX, appState.scrollY, appState.zoom, normalizedWidth / appState.zoom.value, normalizedHeight / appState.zoom.value, appState.gridColor);\n }\n\n const groupsToBeAddedToFrame = new Set();\n visibleElements.forEach(element => {\n if (element.groupIds.length > 0 && appState.frameToHighlight && appState.selectedElementIds[element.id] && ((0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.elementOverlapsWithFrame)(element, appState.frameToHighlight, elementsMap) || element.groupIds.find(groupId => groupsToBeAddedToFrame.has(groupId)))) {\n element.groupIds.forEach(groupId => groupsToBeAddedToFrame.add(groupId));\n }\n });\n const inFrameGroupsMap = new Map(); // Paint visible elements\n\n visibleElements.filter(el => !(0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isIframeLikeElement)(el)).forEach(element => {\n var _a;\n\n try {\n const frameId = element.frameId || ((_a = appState.frameToHighlight) === null || _a === void 0 ? void 0 : _a.id);\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isTextElement)(element) && element.containerId && elementsMap.has(element.containerId)) {\n // will be rendered with the container\n return;\n }\n\n context.save();\n\n if (frameId && appState.frameRendering.enabled && appState.frameRendering.clip) {\n const frame = (0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.getTargetFrame)(element, elementsMap, appState);\n\n if (frame && (0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.shouldApplyFrameClip)(element, frame, appState, elementsMap, inFrameGroupsMap)) {\n frameClip(frame, context, renderConfig, appState);\n }\n\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n } else {\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n }\n\n const boundTextElement = (0,_excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_3__.getBoundTextElement)(element, elementsMap);\n\n if (boundTextElement) {\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(boundTextElement, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n }\n\n context.restore();\n\n if (!isExporting) {\n renderLinkIcon(element, context, appState, elementsMap);\n }\n } catch (error) {\n console.error(error, element.id, element.x, element.y, element.width, element.height);\n }\n }); // render embeddables on top\n\n visibleElements.filter(el => (0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isIframeLikeElement)(el)).forEach(element => {\n var _a;\n\n try {\n const render = () => {\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isIframeLikeElement)(element) && (isExporting || (0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isEmbeddableElement)(element) && renderConfig.embedsValidationStatus.get(element.id) !== true) && element.width && element.height) {\n const label = (0,_excalidraw_element_embeddable__WEBPACK_IMPORTED_MODULE_2__.createPlaceholderEmbeddableLabel)(element);\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(label, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n }\n\n if (!isExporting) {\n renderLinkIcon(element, context, appState, elementsMap);\n }\n }; // - when exporting the whole canvas, we DO NOT apply clipping\n // - when we are exporting a particular frame, apply clipping\n // if the containing frame is not selected, apply clipping\n\n\n const frameId = element.frameId || ((_a = appState.frameToHighlight) === null || _a === void 0 ? void 0 : _a.id);\n\n if (frameId && appState.frameRendering.enabled && appState.frameRendering.clip) {\n context.save();\n const frame = (0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.getTargetFrame)(element, elementsMap, appState);\n\n if (frame && (0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.shouldApplyFrameClip)(element, frame, appState, elementsMap, inFrameGroupsMap)) {\n frameClip(frame, context, renderConfig, appState);\n }\n\n render();\n context.restore();\n } else {\n render();\n }\n } catch (error) {\n console.error(error);\n }\n }); // render pending nodes for flowcharts\n\n (_a = renderConfig.pendingFlowchartNodes) === null || _a === void 0 ? void 0 : _a.forEach(element => {\n try {\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n } catch (error) {\n console.error(error);\n }\n });\n};\n/** throttled to animation framerate */\n\n\nconst renderStaticSceneThrottled = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.throttleRAF)(config => {\n _renderStaticScene(config);\n}, {\n trailing: true\n});\n/**\r\n * Static scene is the non-ui canvas where we render elements.\r\n */\n\nconst renderStaticScene = (renderConfig, throttle) => {\n if (throttle) {\n renderStaticSceneThrottled(renderConfig);\n return;\n }\n\n _renderStaticScene(renderConfig);\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./renderer/staticScene.ts?");
20540
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ renderStaticScene: () => (/* binding */ renderStaticScene),\n/* harmony export */ renderStaticSceneThrottled: () => (/* binding */ renderStaticSceneThrottled)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_element_elementLink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/element/elementLink */ \"../element/src/elementLink.ts\");\n/* harmony import */ var _excalidraw_element_embeddable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/element/embeddable */ \"../element/src/embeddable.ts\");\n/* harmony import */ var _excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/element/textElement */ \"../element/src/textElement.ts\");\n/* harmony import */ var _excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @excalidraw/element/typeChecks */ \"../element/src/typeChecks.ts\");\n/* harmony import */ var _excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @excalidraw/element/frame */ \"../element/src/frame.ts\");\n/* harmony import */ var _excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @excalidraw/element/renderElement */ \"../element/src/renderElement.ts\");\n/* harmony import */ var _excalidraw_element_bounds__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @excalidraw/element/bounds */ \"../element/src/bounds.ts\");\n/* harmony import */ var _components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/hyperlink/helpers */ \"./components/hyperlink/helpers.ts\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers */ \"./renderer/helpers.ts\");\n\n\n\n\n\n\n\n\n\n\n/*const gridLineColor = {\r\n Bold: \"#dddddd\",\r\n Regular: \"#e5e5e5\",\r\n} as const;*/\n//zsviczian\n\nconst strokeGrid = (context,\n/** grid cell pixel size */\ngridSize,\n/** setting to 1 will disble bold lines */\ngridStep, scrollX, scrollY, zoom, width, height, gridLineColor, //zsviczian\ngridDirection = {\n horizontal: true,\n vertical: true\n}) => {\n const offsetX = scrollX % gridSize - gridSize;\n const offsetY = scrollY % gridSize - gridSize;\n const actualGridSize = gridSize * zoom.value;\n const spaceWidth = 1 / zoom.value;\n context.save(); // Offset rendering by 0.5 to ensure that 1px wide lines are crisp.\n // We only do this when zoomed to 100% because otherwise the offset is\n // fractional, and also visibly offsets the elements.\n // We also do this per-axis, as each axis may already be offset by 0.5.\n\n if (zoom.value === 1) {\n context.translate(offsetX % 1 ? 0 : 0.5, offsetY % 1 ? 0 : 0.5);\n } // vertical lines\n\n\n if (gridDirection.vertical) {\n //zsviczian\n for (let x = offsetX; x < offsetX + width + gridSize * 2; x += gridSize) {\n const isBold = gridStep > 1 && Math.round(x - scrollX) % (gridStep * gridSize) === 0; // don't render regular lines when zoomed out and they're barely visible\n\n if (!isBold && actualGridSize < 10) {\n continue;\n }\n\n const lineWidth = Math.min(1 / zoom.value, isBold ? 4 : 1);\n context.lineWidth = lineWidth;\n const lineDash = [lineWidth * 3, spaceWidth + (lineWidth + spaceWidth)];\n context.beginPath();\n context.setLineDash(isBold ? [] : lineDash);\n context.strokeStyle = isBold ? gridLineColor.Bold : gridLineColor.Regular;\n context.moveTo(x, offsetY - gridSize);\n context.lineTo(x, Math.ceil(offsetY + height + gridSize * 2));\n context.stroke();\n }\n }\n\n if (gridDirection.horizontal) {\n //zsviczian\n for (let y = offsetY; y < offsetY + height + gridSize * 2; y += gridSize) {\n const isBold = gridStep > 1 && Math.round(y - scrollY) % (gridStep * gridSize) === 0;\n\n if (!isBold && actualGridSize < 10) {\n continue;\n }\n\n const lineWidth = Math.min(1 / zoom.value, isBold ? 4 : 1);\n context.lineWidth = lineWidth;\n const lineDash = [lineWidth * 3, spaceWidth + (lineWidth + spaceWidth)];\n context.beginPath();\n context.setLineDash(isBold ? [] : lineDash);\n context.strokeStyle = isBold ? gridLineColor.Bold : gridLineColor.Regular;\n context.moveTo(offsetX - gridSize, y);\n context.lineTo(Math.ceil(offsetX + width + gridSize * 2), y);\n context.stroke();\n }\n }\n\n context.restore();\n};\n\nconst frameClip = (frame, context, renderConfig, appState) => {\n context.translate(frame.x + appState.scrollX, frame.y + appState.scrollY);\n context.beginPath();\n\n if (context.roundRect) {\n context.roundRect(0, 0, frame.width, frame.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.radius / appState.zoom.value);\n } else {\n context.rect(0, 0, frame.width, frame.height);\n }\n\n context.clip();\n context.translate(-(frame.x + appState.scrollX), -(frame.y + appState.scrollY));\n};\n\nconst linkIconCanvasCache = {\n regularLink: null,\n elementLink: null\n};\n\nconst renderLinkIcon = (element, context, appState, elementsMap) => {\n if (element.link && !appState.selectedElementIds[element.id]) {\n const [x1, y1, x2, y2] = (0,_excalidraw_element_bounds__WEBPACK_IMPORTED_MODULE_7__.getElementAbsoluteCoords)(element, elementsMap);\n const [x, y, width, height] = (0,_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_8__.getLinkHandleFromCoords)([x1, y1, x2, y2], element.angle, appState);\n const centerX = x + width / 2;\n const centerY = y + height / 2;\n context.save();\n context.translate(appState.scrollX + centerX, appState.scrollY + centerY);\n context.rotate(element.angle);\n const canvasKey = (0,_excalidraw_element_elementLink__WEBPACK_IMPORTED_MODULE_1__.isElementLink)(element.link) ? \"elementLink\" : \"regularLink\";\n let linkCanvas = linkIconCanvasCache[canvasKey];\n\n if (!linkCanvas || linkCanvas.zoom !== appState.zoom.value) {\n linkCanvas = Object.assign(document.createElement(\"canvas\"), {\n zoom: appState.zoom.value\n });\n linkCanvas.width = width * window.devicePixelRatio * appState.zoom.value;\n linkCanvas.height = height * window.devicePixelRatio * appState.zoom.value;\n linkIconCanvasCache[canvasKey] = linkCanvas;\n const linkCanvasCacheContext = linkCanvas.getContext(\"2d\");\n linkCanvasCacheContext.scale(window.devicePixelRatio * appState.zoom.value, window.devicePixelRatio * appState.zoom.value);\n /*linkCanvasCacheContext.fillStyle = \"#fff\";\r\n linkCanvasCacheContext.fillRect(0, 0, width, height);*/\n //zsviczian\n\n if (canvasKey === \"elementLink\") {\n linkCanvasCacheContext.drawImage(_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_8__.ELEMENT_LINK_IMG, 0, 0, width, height);\n } else {\n linkCanvasCacheContext.globalAlpha = appState.linkOpacity; //zsviczian\n\n linkCanvasCacheContext.drawImage(_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_8__.EXTERNAL_LINK_IMG, 0, 0, width, height);\n }\n\n linkCanvasCacheContext.restore();\n }\n\n context.drawImage(linkCanvas, x - centerX, y - centerY, width, height);\n context.restore();\n }\n};\n\nconst _renderStaticScene = ({\n canvas,\n rc,\n elementsMap,\n allElementsMap,\n visibleElements,\n scale,\n appState,\n renderConfig\n}) => {\n var _a;\n\n if (canvas === null) {\n return;\n }\n\n const {\n renderGrid = true,\n isExporting,\n isHighlighterPenDrawing = false\n } = renderConfig; //zsviczian\n\n const [normalizedWidth, normalizedHeight] = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getNormalizedCanvasDimensions)(canvas, scale);\n const context = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.bootstrapCanvas)({\n canvas,\n scale,\n normalizedWidth,\n normalizedHeight,\n theme: appState.theme,\n isExporting,\n viewBackgroundColor: isHighlighterPenDrawing ? \"transparent\" : appState.viewBackgroundColor //zsviczian\n\n }); // Apply zoom\n\n context.scale(appState.zoom.value, appState.zoom.value); // Grid\n\n if (renderGrid) {\n strokeGrid(context, appState.gridSize, appState.gridStep, appState.scrollX, appState.scrollY, appState.zoom, normalizedWidth / appState.zoom.value, normalizedHeight / appState.zoom.value, appState.gridColor, //zsviczian\n appState.gridDirection);\n }\n\n const groupsToBeAddedToFrame = new Set();\n visibleElements.forEach(element => {\n if (element.groupIds.length > 0 && appState.frameToHighlight && appState.selectedElementIds[element.id] && ((0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.elementOverlapsWithFrame)(element, appState.frameToHighlight, elementsMap) || element.groupIds.find(groupId => groupsToBeAddedToFrame.has(groupId)))) {\n element.groupIds.forEach(groupId => groupsToBeAddedToFrame.add(groupId));\n }\n });\n const inFrameGroupsMap = new Map(); // Paint visible elements\n\n visibleElements.filter(el => !(0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isIframeLikeElement)(el)).forEach(element => {\n var _a;\n\n try {\n const frameId = element.frameId || ((_a = appState.frameToHighlight) === null || _a === void 0 ? void 0 : _a.id);\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isTextElement)(element) && element.containerId && elementsMap.has(element.containerId)) {\n // will be rendered with the container\n return;\n }\n\n context.save();\n\n if (frameId && appState.frameRendering.enabled && appState.frameRendering.clip) {\n const frame = (0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.getTargetFrame)(element, elementsMap, appState);\n\n if (frame && (0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.shouldApplyFrameClip)(element, frame, appState, elementsMap, inFrameGroupsMap)) {\n frameClip(frame, context, renderConfig, appState);\n }\n\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n } else {\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n }\n\n const boundTextElement = (0,_excalidraw_element_textElement__WEBPACK_IMPORTED_MODULE_3__.getBoundTextElement)(element, elementsMap);\n\n if (boundTextElement) {\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(boundTextElement, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n }\n\n context.restore();\n\n if (!isExporting) {\n renderLinkIcon(element, context, appState, elementsMap);\n }\n } catch (error) {\n console.error(error, element.id, element.x, element.y, element.width, element.height);\n }\n }); // render embeddables on top\n\n visibleElements.filter(el => (0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isIframeLikeElement)(el)).forEach(element => {\n var _a;\n\n try {\n const render = () => {\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n\n if ((0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isIframeLikeElement)(element) && (isExporting || (0,_excalidraw_element_typeChecks__WEBPACK_IMPORTED_MODULE_4__.isEmbeddableElement)(element) && renderConfig.embedsValidationStatus.get(element.id) !== true) && element.width && element.height) {\n const label = (0,_excalidraw_element_embeddable__WEBPACK_IMPORTED_MODULE_2__.createPlaceholderEmbeddableLabel)(element);\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(label, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n }\n\n if (!isExporting) {\n renderLinkIcon(element, context, appState, elementsMap);\n }\n }; // - when exporting the whole canvas, we DO NOT apply clipping\n // - when we are exporting a particular frame, apply clipping\n // if the containing frame is not selected, apply clipping\n\n\n const frameId = element.frameId || ((_a = appState.frameToHighlight) === null || _a === void 0 ? void 0 : _a.id);\n\n if (frameId && appState.frameRendering.enabled && appState.frameRendering.clip) {\n context.save();\n const frame = (0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.getTargetFrame)(element, elementsMap, appState);\n\n if (frame && (0,_excalidraw_element_frame__WEBPACK_IMPORTED_MODULE_5__.shouldApplyFrameClip)(element, frame, appState, elementsMap, inFrameGroupsMap)) {\n frameClip(frame, context, renderConfig, appState);\n }\n\n render();\n context.restore();\n } else {\n render();\n }\n } catch (error) {\n console.error(error);\n }\n }); // render pending nodes for flowcharts\n\n (_a = renderConfig.pendingFlowchartNodes) === null || _a === void 0 ? void 0 : _a.forEach(element => {\n try {\n (0,_excalidraw_element_renderElement__WEBPACK_IMPORTED_MODULE_6__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n } catch (error) {\n console.error(error);\n }\n });\n};\n/** throttled to animation framerate */\n\n\nconst renderStaticSceneThrottled = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.throttleRAF)(config => {\n _renderStaticScene(config);\n}, {\n trailing: true\n});\n/**\r\n * Static scene is the non-ui canvas where we render elements.\r\n */\n\nconst renderStaticScene = (renderConfig, throttle) => {\n if (throttle) {\n renderStaticSceneThrottled(renderConfig);\n return;\n }\n\n _renderStaticScene(renderConfig);\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./renderer/staticScene.ts?");
20541
20541
 
20542
20542
  /***/ }),
20543
20543