@zsviczian/excalidraw 0.18.0-69 → 0.18.0-70
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.
|
@@ -14225,7 +14225,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
14225
14225
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
14226
14226
|
|
|
14227
14227
|
"use strict";
|
|
14228
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ACTIVE_THRESHOLD: () => (/* binding */ ACTIVE_THRESHOLD),\n/* harmony export */ ALLOWED_PASTE_MIME_TYPES: () => (/* binding */ ALLOWED_PASTE_MIME_TYPES),\n/* harmony export */ APP_NAME: () => (/* binding */ APP_NAME),\n/* harmony export */ ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO: () => (/* binding */ ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO),\n/* harmony export */ ARROW_LABEL_WIDTH_FRACTION: () => (/* binding */ ARROW_LABEL_WIDTH_FRACTION),\n/* harmony export */ ARROW_TYPE: () => (/* binding */ ARROW_TYPE),\n/* harmony export */ BIND_MODE_TIMEOUT: () => (/* binding */ BIND_MODE_TIMEOUT),\n/* harmony export */ BOUND_TEXT_PADDING: () => (/* binding */ BOUND_TEXT_PADDING),\n/* harmony export */ CANVAS_ONLY_ACTIONS: () => (/* binding */ CANVAS_ONLY_ACTIONS),\n/* harmony export */ CANVAS_SEARCH_TAB: () => (/* binding */ CANVAS_SEARCH_TAB),\n/* harmony export */ CJK_HAND_DRAWN_FALLBACK_FONT: () => (/* binding */ CJK_HAND_DRAWN_FALLBACK_FONT),\n/* harmony export */ CLASSES: () => (/* binding */ CLASSES),\n/* harmony export */ COLOR_CHARCOAL_BLACK: () => (/* binding */ COLOR_CHARCOAL_BLACK),\n/* harmony export */ COLOR_NAMES: () => (/* binding */ COLOR_NAMES),\n/* harmony export */ COLOR_VOICE_CALL: () => (/* binding */ COLOR_VOICE_CALL),\n/* harmony export */ COLOR_WHITE: () => (/* binding */ COLOR_WHITE),\n/* harmony export */ CURSOR_TYPE: () => (/* binding */ CURSOR_TYPE),\n/* harmony export */ DEFAULT_ADAPTIVE_RADIUS: () => (/* binding */ DEFAULT_ADAPTIVE_RADIUS),\n/* harmony export */ DEFAULT_COLLISION_THRESHOLD: () => (/* binding */ DEFAULT_COLLISION_THRESHOLD),\n/* harmony export */ DEFAULT_ELEMENT_PROPS: () => (/* binding */ DEFAULT_ELEMENT_PROPS),\n/* harmony export */ DEFAULT_EXPORT_PADDING: () => (/* binding */ DEFAULT_EXPORT_PADDING),\n/* harmony export */ DEFAULT_FILENAME: () => (/* binding */ DEFAULT_FILENAME),\n/* harmony export */ DEFAULT_FONT_FAMILY: () => (/* binding */ DEFAULT_FONT_FAMILY),\n/* harmony export */ DEFAULT_FONT_SIZE: () => (/* binding */ DEFAULT_FONT_SIZE),\n/* harmony export */ DEFAULT_GRID_SIZE: () => (/* binding */ DEFAULT_GRID_SIZE),\n/* harmony export */ DEFAULT_GRID_STEP: () => (/* binding */ DEFAULT_GRID_STEP),\n/* harmony export */ DEFAULT_LASER_COLOR: () => (/* binding */ DEFAULT_LASER_COLOR),\n/* harmony export */ DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT: () => (/* binding */ DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT),\n/* harmony export */ DEFAULT_PROPORTIONAL_RADIUS: () => (/* binding */ DEFAULT_PROPORTIONAL_RADIUS),\n/* harmony export */ DEFAULT_REDUCED_GLOBAL_ALPHA: () => (/* binding */ DEFAULT_REDUCED_GLOBAL_ALPHA),\n/* harmony export */ DEFAULT_SIDEBAR: () => (/* binding */ DEFAULT_SIDEBAR),\n/* harmony export */ DEFAULT_TEXT_ALIGN: () => (/* binding */ DEFAULT_TEXT_ALIGN),\n/* harmony export */ DEFAULT_TRANSFORM_HANDLE_SPACING: () => (/* binding */ DEFAULT_TRANSFORM_HANDLE_SPACING),\n/* harmony export */ DEFAULT_UI_OPTIONS: () => (/* binding */ DEFAULT_UI_OPTIONS),\n/* harmony export */ DEFAULT_VERSION: () => (/* binding */ DEFAULT_VERSION),\n/* harmony export */ DEFAULT_VERTICAL_ALIGN: () => (/* binding */ DEFAULT_VERTICAL_ALIGN),\n/* harmony export */ DOUBLE_TAP_POSITION_THRESHOLD: () => (/* binding */ DOUBLE_TAP_POSITION_THRESHOLD),\n/* harmony export */ DRAGGING_THRESHOLD: () => (/* binding */ DRAGGING_THRESHOLD),\n/* harmony export */ EDITOR_LS_KEYS: () => (/* binding */ EDITOR_LS_KEYS),\n/* harmony export */ ELEMENT_LINK_KEY: () => (/* binding */ ELEMENT_LINK_KEY),\n/* harmony export */ ELEMENT_READY_TO_ERASE_OPACITY: () => (/* binding */ ELEMENT_READY_TO_ERASE_OPACITY),\n/* harmony export */ ELEMENT_SHIFT_TRANSLATE_AMOUNT: () => (/* binding */ ELEMENT_SHIFT_TRANSLATE_AMOUNT),\n/* harmony export */ ELEMENT_TRANSLATE_AMOUNT: () => (/* binding */ ELEMENT_TRANSLATE_AMOUNT),\n/* harmony export */ ENCRYPTION_KEY_BITS: () => (/* binding */ ENCRYPTION_KEY_BITS),\n/* harmony export */ ENV: () => (/* binding */ ENV),\n/* harmony export */ EPSILON: () => (/* binding */ EPSILON),\n/* harmony export */ EVENT: () => (/* binding */ EVENT),\n/* harmony export */ EXPORT_DATA_TYPES: () => (/* binding */ EXPORT_DATA_TYPES),\n/* harmony export */ EXPORT_IMAGE_TYPES: () => (/* binding */ EXPORT_IMAGE_TYPES),\n/* harmony export */ EXPORT_SCALES: () => (/* binding */ EXPORT_SCALES),\n/* harmony export */ FONT_FAMILY: () => (/* binding */ FONT_FAMILY),\n/* harmony export */ FONT_FAMILY_FALLBACKS: () => (/* binding */ FONT_FAMILY_FALLBACKS),\n/* harmony export */ FONT_FAMILY_GENERIC_FALLBACKS: () => (/* binding */ FONT_FAMILY_GENERIC_FALLBACKS),\n/* harmony export */ FONT_SIZES: () => (/* binding */ FONT_SIZES),\n/* harmony export */ FRAME_STYLE: () => (/* binding */ FRAME_STYLE),\n/* harmony export */ HYPERLINK_TOOLTIP_DELAY: () => (/* binding */ HYPERLINK_TOOLTIP_DELAY),\n/* harmony export */ IDLE_THRESHOLD: () => (/* binding */ IDLE_THRESHOLD),\n/* harmony export */ IMAGE_MIME_TYPES: () => (/* binding */ IMAGE_MIME_TYPES),\n/* harmony export */ IMAGE_RENDER_TIMEOUT: () => (/* binding */ IMAGE_RENDER_TIMEOUT),\n/* harmony export */ LIBRARY_DISABLED_TYPES: () => (/* binding */ LIBRARY_DISABLED_TYPES),\n/* harmony export */ LIBRARY_SIDEBAR_TAB: () => (/* binding */ LIBRARY_SIDEBAR_TAB),\n/* harmony export */ LINE_CONFIRM_THRESHOLD: () => (/* binding */ LINE_CONFIRM_THRESHOLD),\n/* harmony export */ LINE_POLYGON_POINT_MERGE_DISTANCE: () => (/* binding */ LINE_POLYGON_POINT_MERGE_DISTANCE),\n/* harmony export */ MAX_ALLOWED_FILE_BYTES: () => (/* binding */ MAX_ALLOWED_FILE_BYTES),\n/* harmony export */ MAX_DECIMALS_FOR_SVG_EXPORT: () => (/* binding */ MAX_DECIMALS_FOR_SVG_EXPORT),\n/* harmony export */ MAX_ZOOM: () => (/* binding */ MAX_ZOOM),\n/* harmony export */ MIME_TYPES: () => (/* binding */ MIME_TYPES),\n/* harmony export */ MINIMUM_ARROW_SIZE: () => (/* binding */ MINIMUM_ARROW_SIZE),\n/* harmony export */ MIN_FONT_SIZE: () => (/* binding */ MIN_FONT_SIZE),\n/* harmony export */ MIN_WIDTH_OR_HEIGHT: () => (/* binding */ MIN_WIDTH_OR_HEIGHT),\n/* harmony export */ MIN_ZOOM: () => (/* binding */ MIN_ZOOM),\n/* harmony export */ MOBILE_ACTION_BUTTON_BG: () => (/* binding */ MOBILE_ACTION_BUTTON_BG),\n/* harmony export */ MONOSPACE_GENERIC_FONT: () => (/* binding */ MONOSPACE_GENERIC_FONT),\n/* harmony export */ ORIG_ID: () => (/* binding */ ORIG_ID),\n/* harmony export */ POINTER_BUTTON: () => (/* binding */ POINTER_BUTTON),\n/* harmony export */ POINTER_EVENTS: () => (/* binding */ POINTER_EVENTS),\n/* harmony export */ PRECEDING_ELEMENT_KEY: () => (/* binding */ PRECEDING_ELEMENT_KEY),\n/* harmony export */ ROUGHNESS: () => (/* binding */ ROUGHNESS),\n/* harmony export */ ROUNDNESS: () => (/* binding */ ROUNDNESS),\n/* harmony export */ SANS_SERIF_GENERIC_FONT: () => (/* binding */ SANS_SERIF_GENERIC_FONT),\n/* harmony export */ SCROLL_TIMEOUT: () => (/* binding */ SCROLL_TIMEOUT),\n/* harmony export */ SHIFT_LOCKING_ANGLE: () => (/* binding */ SHIFT_LOCKING_ANGLE),\n/* harmony export */ SIDE_RESIZING_THRESHOLD: () => (/* binding */ SIDE_RESIZING_THRESHOLD),\n/* harmony export */ STATS_PANELS: () => (/* binding */ STATS_PANELS),\n/* harmony export */ STRING_MIME_TYPES: () => (/* binding */ STRING_MIME_TYPES),\n/* harmony export */ STROKE_WIDTH: () => (/* binding */ STROKE_WIDTH),\n/* harmony export */ SVG_DOCUMENT_PREAMBLE: () => (/* binding */ SVG_DOCUMENT_PREAMBLE),\n/* harmony export */ SVG_NS: () => (/* binding */ SVG_NS),\n/* harmony export */ TAP_TWICE_TIMEOUT: () => (/* binding */ TAP_TWICE_TIMEOUT),\n/* harmony export */ TEXT_ALIGN: () => (/* binding */ TEXT_ALIGN),\n/* harmony export */ TEXT_AUTOWRAP_THRESHOLD: () => (/* binding */ TEXT_AUTOWRAP_THRESHOLD),\n/* harmony export */ TEXT_TO_CENTER_SNAP_THRESHOLD: () => (/* binding */ TEXT_TO_CENTER_SNAP_THRESHOLD),\n/* harmony export */ THEME: () => (/* binding */ THEME),\n/* harmony export */ TITLE_TIMEOUT: () => (/* binding */ TITLE_TIMEOUT),\n/* harmony export */ TOOL_TYPE: () => (/* binding */ TOOL_TYPE),\n/* harmony export */ TOUCH_CTX_MENU_TIMEOUT: () => (/* binding */ TOUCH_CTX_MENU_TIMEOUT),\n/* harmony export */ URL_HASH_KEYS: () => (/* binding */ URL_HASH_KEYS),\n/* harmony export */ URL_QUERY_KEYS: () => (/* binding */ URL_QUERY_KEYS),\n/* harmony export */ UserIdleState: () => (/* binding */ UserIdleState),\n/* harmony export */ VERSIONS: () => (/* binding */ VERSIONS),\n/* harmony export */ VERSION_TIMEOUT: () => (/* binding */ VERSION_TIMEOUT),\n/* harmony export */ VERTICAL_ALIGN: () => (/* binding */ VERTICAL_ALIGN),\n/* harmony export */ WINDOWS_EMOJI_FALLBACK_FONT: () => (/* binding */ WINDOWS_EMOJI_FALLBACK_FONT),\n/* harmony export */ YOUTUBE_STATES: () => (/* binding */ YOUTUBE_STATES),\n/* harmony export */ ZOOM_STEP: () => (/* binding */ ZOOM_STEP),\n/* harmony export */ getExportSource: () => (/* binding */ getExportSource),\n/* harmony export */ getFontFamilyFallbacks: () => (/* binding */ getFontFamilyFallbacks),\n/* harmony export */ getGenericFontFamilyFallback: () => (/* binding */ getGenericFontFamilyFallback),\n/* harmony export */ supportsResizeObserver: () => (/* binding */ supportsResizeObserver)\n/* harmony export */ });\n/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colors */ \"../common/src/colors.ts\");\n\nconst supportsResizeObserver = typeof window !== \"undefined\" && \"ResizeObserver\" in window;\nconst APP_NAME = \"Excalidraw\"; // distance when creating text before it's considered `autoResize: false`\n// we're using higher threshold so that clicks that end up being drags\n// don't unintentionally create text elements that are wrapped to a few chars\n// (happens a lot with fast clicks with the text tool)\n\nconst TEXT_AUTOWRAP_THRESHOLD = 36; // px\n\nconst DRAGGING_THRESHOLD = 10; // px\n\nconst MINIMUM_ARROW_SIZE = 20; // px\n\nconst LINE_CONFIRM_THRESHOLD = 8; // px\n\nconst ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;\nconst ELEMENT_TRANSLATE_AMOUNT = 1;\nconst TEXT_TO_CENTER_SNAP_THRESHOLD = 30;\nconst SHIFT_LOCKING_ANGLE = Math.PI / 12;\nconst DEFAULT_LASER_COLOR = \"red\";\nconst CURSOR_TYPE = {\n TEXT: \"text\",\n CROSSHAIR: \"crosshair\",\n GRABBING: \"grabbing\",\n GRAB: \"grab\",\n POINTER: \"pointer\",\n MOVE: \"move\",\n AUTO: \"\"\n};\nconst POINTER_BUTTON = {\n MAIN: 0,\n WHEEL: 1,\n SECONDARY: 2,\n TOUCH: -1,\n ERASER: 5\n};\nconst POINTER_EVENTS = {\n enabled: \"all\",\n disabled: \"none\",\n // asserted as any so it can be freely assigned to React Element\n // \"pointerEnvets\" CSS prop\n inheritFromUI: \"var(--ui-pointerEvents)\"\n};\nvar EVENT;\n\n(function (EVENT) {\n EVENT[\"COPY\"] = \"copy\";\n EVENT[\"PASTE\"] = \"paste\";\n EVENT[\"CUT\"] = \"cut\";\n EVENT[\"KEYDOWN\"] = \"keydown\";\n EVENT[\"KEYUP\"] = \"keyup\";\n EVENT[\"MOUSE_MOVE\"] = \"mousemove\";\n EVENT[\"RESIZE\"] = \"resize\";\n EVENT[\"UNLOAD\"] = \"unload\";\n EVENT[\"FOCUS\"] = \"focus\";\n EVENT[\"BLUR\"] = \"blur\";\n EVENT[\"DRAG_OVER\"] = \"dragover\";\n EVENT[\"DROP\"] = \"drop\";\n EVENT[\"GESTURE_END\"] = \"gestureend\";\n EVENT[\"BEFORE_UNLOAD\"] = \"beforeunload\";\n EVENT[\"GESTURE_START\"] = \"gesturestart\";\n EVENT[\"GESTURE_CHANGE\"] = \"gesturechange\";\n EVENT[\"POINTER_MOVE\"] = \"pointermove\";\n EVENT[\"POINTER_DOWN\"] = \"pointerdown\";\n EVENT[\"POINTER_UP\"] = \"pointerup\";\n EVENT[\"STATE_CHANGE\"] = \"statechange\";\n EVENT[\"WHEEL\"] = \"wheel\";\n EVENT[\"TOUCH_START\"] = \"touchstart\";\n EVENT[\"TOUCH_END\"] = \"touchend\";\n EVENT[\"HASHCHANGE\"] = \"hashchange\";\n EVENT[\"VISIBILITY_CHANGE\"] = \"visibilitychange\";\n EVENT[\"SCROLL\"] = \"scroll\"; // custom events\n\n EVENT[\"EXCALIDRAW_LINK\"] = \"excalidraw-link\";\n EVENT[\"MENU_ITEM_SELECT\"] = \"menu.itemSelect\";\n EVENT[\"MESSAGE\"] = \"message\";\n EVENT[\"FULLSCREENCHANGE\"] = \"fullscreenchange\";\n})(EVENT || (EVENT = {}));\n\nconst YOUTUBE_STATES = {\n UNSTARTED: -1,\n ENDED: 0,\n PLAYING: 1,\n PAUSED: 2,\n BUFFERING: 3,\n CUED: 5\n};\nconst ENV = {\n TEST: \"test\",\n DEVELOPMENT: \"development\",\n PRODUCTION: \"production\"\n};\nconst CLASSES = {\n SIDEBAR: \"sidebar\",\n SHAPE_ACTIONS_MENU: \"App-menu__left\",\n SHAPE_ACTIONS_MOBILE_MENU: \"App-mobile-menu\",\n //zsviczian\n SHAPE_ACTIONS_TRAY_MENU: \"App-tray-menu\",\n //zsviczian\n MOBILE_TOOLBAR: \"App-toolbar-content\",\n //zsviczian\n ZOOM_ACTIONS: \"zoom-actions\",\n SEARCH_MENU_INPUT_WRAPPER: \"layer-ui__search-inputWrapper\",\n CONVERT_ELEMENT_TYPE_POPUP: \"ConvertElementTypePopup\",\n SHAPE_ACTIONS_THEME_SCOPE: \"shape-actions-theme-scope\",\n FRAME_NAME: \"frame-name\"\n};\nconst FONT_SIZES = {\n sm: 16,\n md: 20,\n lg: 28,\n xl: 36\n};\nconst CJK_HAND_DRAWN_FALLBACK_FONT = \"Xiaolai\";\nconst WINDOWS_EMOJI_FALLBACK_FONT = \"Segoe UI Emoji\";\n/**\n * // TODO: shouldn't be really `const`, likely neither have integers as values, due to value for the custom fonts, which should likely be some hash.\n *\n * Let's think this through and consider:\n * - https://developer.mozilla.org/en-US/docs/Web/CSS/generic-family\n * - https://drafts.csswg.org/css-fonts-4/#font-family-prop\n * - https://learn.microsoft.com/en-us/typography/opentype/spec/ibmfc\n */\n\nconst FONT_FAMILY = {\n Virgil: 1,\n Helvetica: 2,\n Cascadia: 3,\n \"Local Font\": 4,\n // leave 4 unused as it was historically used for Assistant (which we don't use anymore) or custom font (Obsidian)\n Excalifont: 5,\n Nunito: 6,\n \"Lilita One\": 7,\n \"Comic Shanns\": 8,\n \"Liberation Sans\": 9,\n Assistant: 10\n}; // Segoe UI Emoji fails to properly fallback for some glyphs: ∞, ∫, ≠\n// so we need to have generic font fallback before it\n\nconst SANS_SERIF_GENERIC_FONT = \"sans-serif\";\nconst MONOSPACE_GENERIC_FONT = \"monospace\";\nconst FONT_FAMILY_GENERIC_FALLBACKS = {\n [SANS_SERIF_GENERIC_FONT]: 998,\n [MONOSPACE_GENERIC_FONT]: 999\n};\nconst FONT_FAMILY_FALLBACKS = Object.assign(Object.assign({\n [CJK_HAND_DRAWN_FALLBACK_FONT]: 100\n}, FONT_FAMILY_GENERIC_FALLBACKS), {\n [WINDOWS_EMOJI_FALLBACK_FONT]: 1000\n});\nfunction getGenericFontFamilyFallback(fontFamily) {\n switch (fontFamily) {\n case FONT_FAMILY.Cascadia:\n case FONT_FAMILY[\"Comic Shanns\"]:\n return MONOSPACE_GENERIC_FONT;\n\n default:\n return SANS_SERIF_GENERIC_FONT;\n }\n}\nconst getFontFamilyFallbacks = fontFamily => {\n const genericFallbackFont = getGenericFontFamilyFallback(fontFamily);\n\n switch (fontFamily) {\n case FONT_FAMILY.Excalifont:\n return [CJK_HAND_DRAWN_FALLBACK_FONT, genericFallbackFont, WINDOWS_EMOJI_FALLBACK_FONT];\n\n default:\n return [genericFallbackFont, WINDOWS_EMOJI_FALLBACK_FONT];\n }\n};\nconst THEME = {\n LIGHT: \"light\",\n DARK: \"dark\"\n};\nconst FRAME_STYLE = {\n strokeColor: \"#bbb\",\n strokeWidth: 2,\n strokeStyle: \"solid\",\n fillStyle: \"solid\",\n roughness: 0,\n roundness: null,\n backgroundColor: \"transparent\",\n radius: 8,\n nameOffsetY: 3,\n nameColorLightTheme: \"#999999\",\n nameColorDarkTheme: \"#7a7a7a\",\n nameFontSize: 14,\n nameLineHeight: 1.25\n};\nconst MIN_FONT_SIZE = 1;\nconst DEFAULT_FONT_SIZE = 20;\nconst DEFAULT_FONT_FAMILY = FONT_FAMILY.Excalifont;\nconst DEFAULT_TEXT_ALIGN = \"left\";\nconst DEFAULT_VERTICAL_ALIGN = \"top\";\nconst DEFAULT_VERSION = \"{version}\";\nconst DEFAULT_TRANSFORM_HANDLE_SPACING = 2;\nconst SIDE_RESIZING_THRESHOLD = 2 * DEFAULT_TRANSFORM_HANDLE_SPACING; // a small epsilon to make side resizing always take precedence\n// (avoids an increase in renders and changes to tests)\n\nconst EPSILON = 0.00001;\nconst DEFAULT_COLLISION_THRESHOLD = 2 * SIDE_RESIZING_THRESHOLD - EPSILON;\nconst COLOR_WHITE = \"#ffffff\";\nconst COLOR_CHARCOAL_BLACK = \"#1e1e1e\"; // keep this in sync with CSS\n\nconst COLOR_VOICE_CALL = \"#a2f1a6\";\nconst CANVAS_ONLY_ACTIONS = [\"selectAll\"];\nconst DEFAULT_GRID_SIZE = 20;\nconst DEFAULT_GRID_STEP = 5;\nconst IMAGE_MIME_TYPES = {\n svg: \"image/svg+xml\",\n png: \"image/png\",\n jpg: \"image/jpeg\",\n gif: \"image/gif\",\n webp: \"image/webp\",\n bmp: \"image/bmp\",\n ico: \"image/x-icon\",\n avif: \"image/avif\",\n jfif: \"image/jfif\"\n};\nconst STRING_MIME_TYPES = {\n text: \"text/plain\",\n html: \"text/html\",\n json: \"application/json\",\n // excalidraw data\n excalidraw: \"application/vnd.excalidraw+json\",\n // LEGACY: fully-qualified library JSON data\n excalidrawlib: \"application/vnd.excalidrawlib+json\",\n // list of excalidraw library item ids\n excalidrawlibIds: \"application/vnd.excalidrawlib.ids+json\"\n};\nconst MIME_TYPES = Object.assign(Object.assign(Object.assign({}, STRING_MIME_TYPES), {\n // image-encoded excalidraw data\n \"excalidraw.svg\": \"image/svg+xml\",\n \"excalidraw.png\": \"image/png\",\n // binary\n binary: \"application/octet-stream\"\n}), IMAGE_MIME_TYPES);\nconst ALLOWED_PASTE_MIME_TYPES = [MIME_TYPES.text, MIME_TYPES.html, ...Object.values(IMAGE_MIME_TYPES)];\nconst EXPORT_IMAGE_TYPES = {\n png: \"png\",\n svg: \"svg\",\n clipboard: \"clipboard\"\n};\nconst EXPORT_DATA_TYPES = {\n excalidraw: \"excalidraw\",\n excalidrawClipboard: \"excalidraw/clipboard\",\n excalidrawLibrary: \"excalidrawlib\",\n excalidrawClipboardWithAPI: \"excalidraw-api/clipboard\"\n};\nconst getExportSource = () => window.EXCALIDRAW_EXPORT_SOURCE || window.location.origin; // time in milliseconds\n\nconst IMAGE_RENDER_TIMEOUT = 500;\nconst TAP_TWICE_TIMEOUT = 300;\nconst TOUCH_CTX_MENU_TIMEOUT = 500;\nconst TITLE_TIMEOUT = 10000;\nconst VERSION_TIMEOUT = 30000;\nconst SCROLL_TIMEOUT = 100;\nconst ZOOM_STEP = 0.05; //zsviczian\n\nconst MIN_ZOOM = 0.1;\nconst MAX_ZOOM = 30;\nconst HYPERLINK_TOOLTIP_DELAY = 300; // Report a user inactive after IDLE_THRESHOLD milliseconds\n\nconst IDLE_THRESHOLD = 60000; // Report a user active each ACTIVE_THRESHOLD milliseconds\n\nconst ACTIVE_THRESHOLD = 3000;\nconst URL_QUERY_KEYS = {\n addLibrary: \"addLibrary\"\n};\nconst URL_HASH_KEYS = {\n addLibrary: \"addLibrary\"\n};\nconst DEFAULT_UI_OPTIONS = {\n canvasActions: {\n changeViewBackgroundColor: true,\n clearCanvas: true,\n export: {\n saveFileToDisk: true\n },\n loadScene: true,\n saveToActiveFile: true,\n toggleTheme: null,\n saveAsImage: true\n },\n tools: {\n image: true\n }\n};\nconst MAX_DECIMALS_FOR_SVG_EXPORT = 2;\nconst EXPORT_SCALES = [1, 2, 3];\nconst DEFAULT_EXPORT_PADDING = 10; // px\n\nconst DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT = 2880; //zsviczian was 1440\n\nconst MAX_ALLOWED_FILE_BYTES = 20 * 1024 * 1024;\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\nconst SVG_DOCUMENT_PREAMBLE = `<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n`;\nconst ENCRYPTION_KEY_BITS = 128;\nconst VERSIONS = {\n excalidraw: 2,\n excalidrawLibrary: 2\n};\nconst BOUND_TEXT_PADDING = 5;\nconst ARROW_LABEL_WIDTH_FRACTION = 0.7;\nconst ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO = 11;\nconst VERTICAL_ALIGN = {\n TOP: \"top\",\n MIDDLE: \"middle\",\n BOTTOM: \"bottom\"\n};\nconst TEXT_ALIGN = {\n LEFT: \"left\",\n CENTER: \"center\",\n RIGHT: \"right\"\n};\nconst ELEMENT_READY_TO_ERASE_OPACITY = 20; // Radius represented as 25% of element's largest side (width/height).\n// Used for LEGACY and PROPORTIONAL_RADIUS algorithms, or when the element is\n// below the cutoff size.\n\nconst DEFAULT_PROPORTIONAL_RADIUS = 0.25; // Fixed radius for the ADAPTIVE_RADIUS algorithm. In pixels.\n\nconst DEFAULT_ADAPTIVE_RADIUS = 32; // roundness type (algorithm)\n\nconst ROUNDNESS = {\n // Used for legacy rounding (rectangles), which currently works the same\n // as PROPORTIONAL_RADIUS, but we need to differentiate for UI purposes and\n // forwards-compat.\n LEGACY: 1,\n // Used for linear elements & diamonds\n PROPORTIONAL_RADIUS: 2,\n // Current default algorithm for rectangles, using fixed pixel radius.\n // It's working similarly to a regular border-radius, but attemps to make\n // radius visually similar across differnt element sizes, especially\n // very large and very small elements.\n //\n // NOTE right now we don't allow configuration and use a constant radius\n // (see DEFAULT_ADAPTIVE_RADIUS constant)\n ADAPTIVE_RADIUS: 3\n};\n/** key containt id of precedeing elemnt id we use in reconciliation during\n * collaboration */\n\nconst PRECEDING_ELEMENT_KEY = \"__precedingElement__\"; //zsviczian\n\nconst COLOR_NAMES = {\n aliceblue: \"#f0f8ff\",\n antiquewhite: \"#faebd7\",\n aqua: \"#00ffff\",\n aquamarine: \"#7fffd4\",\n azure: \"#f0ffff\",\n beige: \"#f5f5dc\",\n bisque: \"#ffe4c4\",\n black: \"#000000\",\n blanchedalmond: \"#ffebcd\",\n blue: \"#0000ff\",\n blueviolet: \"#8a2be2\",\n brown: \"#a52a2a\",\n burlywood: \"#deb887\",\n cadetblue: \"#5f9ea0\",\n chartreuse: \"#7fff00\",\n chocolate: \"#d2691e\",\n coral: \"#ff7f50\",\n cornflowerblue: \"#6495ed\",\n cornsilk: \"#fff8dc\",\n crimson: \"#dc143c\",\n cyan: \"#00ffff\",\n darkblue: \"#00008b\",\n darkcyan: \"#008b8b\",\n darkgoldenrod: \"#b8860b\",\n darkgray: \"#a9a9a9\",\n darkgreen: \"#006400\",\n darkkhaki: \"#bdb76b\",\n darkmagenta: \"#8b008b\",\n darkolivegreen: \"#556b2f\",\n darkorange: \"#ff8c00\",\n darkorchid: \"#9932cc\",\n darkred: \"#8b0000\",\n darksalmon: \"#e9967a\",\n darkseagreen: \"#8fbc8f\",\n darkslateblue: \"#483d8b\",\n darkslategray: \"#2f4f4f\",\n darkturquoise: \"#00ced1\",\n darkviolet: \"#9400d3\",\n deeppink: \"#ff1493\",\n deepskyblue: \"#00bfff\",\n dimgray: \"#696969\",\n dodgerblue: \"#1e90ff\",\n firebrick: \"#b22222\",\n floralwhite: \"#fffaf0\",\n forestgreen: \"#228b22\",\n fuchsia: \"#ff00ff\",\n gainsboro: \"#dcdcdc\",\n ghostwhite: \"#f8f8ff\",\n gold: \"#ffd700\",\n goldenrod: \"#daa520\",\n gray: \"#808080\",\n green: \"#008000\",\n greenyellow: \"#adff2f\",\n honeydew: \"#f0fff0\",\n hotpink: \"#ff69b4\",\n indianred: \"#cd5c5c\",\n indigo: \"#4b0082\",\n ivory: \"#fffff0\",\n khaki: \"#f0e68c\",\n lavender: \"#e6e6fa\",\n lavenderblush: \"#fff0f5\",\n lawngreen: \"#7cfc00\",\n lemonchiffon: \"#fffacd\",\n lightblue: \"#add8e6\",\n lightcoral: \"#f08080\",\n lightcyan: \"#e0ffff\",\n lightgoldenrodyellow: \"#fafad2\",\n lightgrey: \"#d3d3d3\",\n lightgreen: \"#90ee90\",\n lightpink: \"#ffb6c1\",\n lightsalmon: \"#ffa07a\",\n lightseagreen: \"#20b2aa\",\n lightskyblue: \"#87cefa\",\n lightslategray: \"#778899\",\n lightsteelblue: \"#b0c4de\",\n lightyellow: \"#ffffe0\",\n lime: \"#00ff00\",\n limegreen: \"#32cd32\",\n linen: \"#faf0e6\",\n magenta: \"#ff00ff\",\n maroon: \"#800000\",\n mediumaquamarine: \"#66cdaa\",\n mediumblue: \"#0000cd\",\n mediumorchid: \"#ba55d3\",\n mediumpurple: \"#9370d8\",\n mediumseagreen: \"#3cb371\",\n mediumslateblue: \"#7b68ee\",\n mediumspringgreen: \"#00fa9a\",\n mediumturquoise: \"#48d1cc\",\n mediumvioletred: \"#c71585\",\n midnightblue: \"#191970\",\n mintcream: \"#f5fffa\",\n mistyrose: \"#ffe4e1\",\n moccasin: \"#ffe4b5\",\n navajowhite: \"#ffdead\",\n navy: \"#000080\",\n oldlace: \"#fdf5e6\",\n olive: \"#808000\",\n olivedrab: \"#6b8e23\",\n orange: \"#ffa500\",\n orangered: \"#ff4500\",\n orchid: \"#da70d6\",\n palegoldenrod: \"#eee8aa\",\n palegreen: \"#98fb98\",\n paleturquoise: \"#afeeee\",\n palevioletred: \"#d87093\",\n papayawhip: \"#ffefd5\",\n peachpuff: \"#ffdab9\",\n peru: \"#cd853f\",\n pink: \"#ffc0cb\",\n plum: \"#dda0dd\",\n powderblue: \"#b0e0e6\",\n purple: \"#800080\",\n rebeccapurple: \"#663399\",\n red: \"#ff0000\",\n rosybrown: \"#bc8f8f\",\n royalblue: \"#4169e1\",\n saddlebrown: \"#8b4513\",\n salmon: \"#fa8072\",\n sandybrown: \"#f4a460\",\n seagreen: \"#2e8b57\",\n seashell: \"#fff5ee\",\n sienna: \"#a0522d\",\n silver: \"#c0c0c0\",\n skyblue: \"#87ceeb\",\n slateblue: \"#6a5acd\",\n slategray: \"#708090\",\n snow: \"#fffafa\",\n springgreen: \"#00ff7f\",\n steelblue: \"#4682b4\",\n tan: \"#d2b48c\",\n teal: \"#008080\",\n thistle: \"#d8bfd8\",\n tomato: \"#ff6347\",\n turquoise: \"#40e0d0\",\n violet: \"#ee82ee\",\n wheat: \"#f5deb3\",\n white: \"#ffffff\",\n whitesmoke: \"#f5f5f5\",\n yellow: \"#ffff00\",\n yellowgreen: \"#9acd32\"\n};\nconst ROUGHNESS = {\n architect: 0,\n artist: 1,\n cartoonist: 2\n};\nconst STROKE_WIDTH = {\n extraThin: 0.5,\n //zsviczian\n thin: 1,\n bold: 2,\n extraBold: 4\n};\nconst DEFAULT_ELEMENT_PROPS = {\n strokeColor: _colors__WEBPACK_IMPORTED_MODULE_0__.COLOR_PALETTE.black,\n backgroundColor: _colors__WEBPACK_IMPORTED_MODULE_0__.COLOR_PALETTE.transparent,\n fillStyle: \"solid\",\n strokeWidth: 2,\n strokeStyle: \"solid\",\n roughness: ROUGHNESS.artist,\n opacity: 100,\n locked: false\n};\nconst LIBRARY_SIDEBAR_TAB = \"library\";\nconst CANVAS_SEARCH_TAB = \"search\";\nconst DEFAULT_SIDEBAR = {\n name: \"default\",\n defaultTab: LIBRARY_SIDEBAR_TAB\n};\nconst LIBRARY_DISABLED_TYPES = new Set([\"iframe\", \"embeddable\", \"image\"]); // use these constants to easily identify reference sites\n\nconst TOOL_TYPE = {\n selection: \"selection\",\n lasso: \"lasso\",\n rectangle: \"rectangle\",\n diamond: \"diamond\",\n ellipse: \"ellipse\",\n arrow: \"arrow\",\n line: \"line\",\n freedraw: \"freedraw\",\n text: \"text\",\n image: \"image\",\n eraser: \"eraser\",\n hand: \"hand\",\n frame: \"frame\",\n magicframe: \"magicframe\",\n embeddable: \"embeddable\",\n laser: \"laser\"\n};\nconst EDITOR_LS_KEYS = {\n OAI_API_KEY: \"excalidraw-oai-api-key\",\n // legacy naming (non)scheme\n MERMAID_TO_EXCALIDRAW: \"mermaid-to-excalidraw\",\n PUBLISH_LIBRARY: \"publish-library-data\"\n};\n/**\n * not translated as this is used only in public, stateless API as default value\n * where filename is optional and we can't retrieve name from app state\n */\n\nconst DEFAULT_FILENAME = \"Untitled\";\nconst STATS_PANELS = {\n generalStats: 1,\n elementProperties: 2\n};\nconst MIN_WIDTH_OR_HEIGHT = 1;\nconst ARROW_TYPE = {\n sharp: \"sharp\",\n round: \"round\",\n elbow: \"elbow\"\n};\nconst DEFAULT_REDUCED_GLOBAL_ALPHA = 0.3;\nconst ELEMENT_LINK_KEY = \"element\";\n/** used in tests */\n\nconst ORIG_ID = Symbol.for(\"__test__originalId__\");\nvar UserIdleState;\n\n(function (UserIdleState) {\n UserIdleState[\"ACTIVE\"] = \"active\";\n UserIdleState[\"AWAY\"] = \"away\";\n UserIdleState[\"IDLE\"] = \"idle\";\n})(UserIdleState || (UserIdleState = {}));\n/**\n * distance at which we merge points instead of adding a new merge-point\n * when converting a line to a polygon (merge currently means overlaping\n * the start and end points)\n */\n\n\nconst LINE_POLYGON_POINT_MERGE_DISTANCE = 20;\nconst DOUBLE_TAP_POSITION_THRESHOLD = 35;\nconst BIND_MODE_TIMEOUT = 700; // ms\n// glass background for mobile action buttons\n\nconst MOBILE_ACTION_BUTTON_BG = {\n background: \"var(--mobile-action-button-bg)\"\n};\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/constants.ts?");
|
|
14228
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ACTIVE_THRESHOLD: () => (/* binding */ ACTIVE_THRESHOLD),\n/* harmony export */ ALLOWED_PASTE_MIME_TYPES: () => (/* binding */ ALLOWED_PASTE_MIME_TYPES),\n/* harmony export */ APP_NAME: () => (/* binding */ APP_NAME),\n/* harmony export */ ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO: () => (/* binding */ ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO),\n/* harmony export */ ARROW_LABEL_WIDTH_FRACTION: () => (/* binding */ ARROW_LABEL_WIDTH_FRACTION),\n/* harmony export */ ARROW_TYPE: () => (/* binding */ ARROW_TYPE),\n/* harmony export */ BIND_MODE_TIMEOUT: () => (/* binding */ BIND_MODE_TIMEOUT),\n/* harmony export */ BOUND_TEXT_PADDING: () => (/* binding */ BOUND_TEXT_PADDING),\n/* harmony export */ CANVAS_ONLY_ACTIONS: () => (/* binding */ CANVAS_ONLY_ACTIONS),\n/* harmony export */ CANVAS_SEARCH_TAB: () => (/* binding */ CANVAS_SEARCH_TAB),\n/* harmony export */ CJK_HAND_DRAWN_FALLBACK_FONT: () => (/* binding */ CJK_HAND_DRAWN_FALLBACK_FONT),\n/* harmony export */ CLASSES: () => (/* binding */ CLASSES),\n/* harmony export */ COLOR_CHARCOAL_BLACK: () => (/* binding */ COLOR_CHARCOAL_BLACK),\n/* harmony export */ COLOR_NAMES: () => (/* binding */ COLOR_NAMES),\n/* harmony export */ COLOR_VOICE_CALL: () => (/* binding */ COLOR_VOICE_CALL),\n/* harmony export */ COLOR_WHITE: () => (/* binding */ COLOR_WHITE),\n/* harmony export */ CURSOR_TYPE: () => (/* binding */ CURSOR_TYPE),\n/* harmony export */ DARK_THEME_FILTER: () => (/* binding */ DARK_THEME_FILTER),\n/* harmony export */ DEFAULT_ADAPTIVE_RADIUS: () => (/* binding */ DEFAULT_ADAPTIVE_RADIUS),\n/* harmony export */ DEFAULT_COLLISION_THRESHOLD: () => (/* binding */ DEFAULT_COLLISION_THRESHOLD),\n/* harmony export */ DEFAULT_ELEMENT_PROPS: () => (/* binding */ DEFAULT_ELEMENT_PROPS),\n/* harmony export */ DEFAULT_EXPORT_PADDING: () => (/* binding */ DEFAULT_EXPORT_PADDING),\n/* harmony export */ DEFAULT_FILENAME: () => (/* binding */ DEFAULT_FILENAME),\n/* harmony export */ DEFAULT_FONT_FAMILY: () => (/* binding */ DEFAULT_FONT_FAMILY),\n/* harmony export */ DEFAULT_FONT_SIZE: () => (/* binding */ DEFAULT_FONT_SIZE),\n/* harmony export */ DEFAULT_GRID_SIZE: () => (/* binding */ DEFAULT_GRID_SIZE),\n/* harmony export */ DEFAULT_GRID_STEP: () => (/* binding */ DEFAULT_GRID_STEP),\n/* harmony export */ DEFAULT_LASER_COLOR: () => (/* binding */ DEFAULT_LASER_COLOR),\n/* harmony export */ DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT: () => (/* binding */ DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT),\n/* harmony export */ DEFAULT_PROPORTIONAL_RADIUS: () => (/* binding */ DEFAULT_PROPORTIONAL_RADIUS),\n/* harmony export */ DEFAULT_REDUCED_GLOBAL_ALPHA: () => (/* binding */ DEFAULT_REDUCED_GLOBAL_ALPHA),\n/* harmony export */ DEFAULT_SIDEBAR: () => (/* binding */ DEFAULT_SIDEBAR),\n/* harmony export */ DEFAULT_TEXT_ALIGN: () => (/* binding */ DEFAULT_TEXT_ALIGN),\n/* harmony export */ DEFAULT_TRANSFORM_HANDLE_SPACING: () => (/* binding */ DEFAULT_TRANSFORM_HANDLE_SPACING),\n/* harmony export */ DEFAULT_UI_OPTIONS: () => (/* binding */ DEFAULT_UI_OPTIONS),\n/* harmony export */ DEFAULT_VERSION: () => (/* binding */ DEFAULT_VERSION),\n/* harmony export */ DEFAULT_VERTICAL_ALIGN: () => (/* binding */ DEFAULT_VERTICAL_ALIGN),\n/* harmony export */ DOUBLE_TAP_POSITION_THRESHOLD: () => (/* binding */ DOUBLE_TAP_POSITION_THRESHOLD),\n/* harmony export */ DRAGGING_THRESHOLD: () => (/* binding */ DRAGGING_THRESHOLD),\n/* harmony export */ EDITOR_LS_KEYS: () => (/* binding */ EDITOR_LS_KEYS),\n/* harmony export */ ELEMENT_LINK_KEY: () => (/* binding */ ELEMENT_LINK_KEY),\n/* harmony export */ ELEMENT_READY_TO_ERASE_OPACITY: () => (/* binding */ ELEMENT_READY_TO_ERASE_OPACITY),\n/* harmony export */ ELEMENT_SHIFT_TRANSLATE_AMOUNT: () => (/* binding */ ELEMENT_SHIFT_TRANSLATE_AMOUNT),\n/* harmony export */ ELEMENT_TRANSLATE_AMOUNT: () => (/* binding */ ELEMENT_TRANSLATE_AMOUNT),\n/* harmony export */ ENCRYPTION_KEY_BITS: () => (/* binding */ ENCRYPTION_KEY_BITS),\n/* harmony export */ ENV: () => (/* binding */ ENV),\n/* harmony export */ EPSILON: () => (/* binding */ EPSILON),\n/* harmony export */ EVENT: () => (/* binding */ EVENT),\n/* harmony export */ EXPORT_DATA_TYPES: () => (/* binding */ EXPORT_DATA_TYPES),\n/* harmony export */ EXPORT_IMAGE_TYPES: () => (/* binding */ EXPORT_IMAGE_TYPES),\n/* harmony export */ EXPORT_SCALES: () => (/* binding */ EXPORT_SCALES),\n/* harmony export */ FONT_FAMILY: () => (/* binding */ FONT_FAMILY),\n/* harmony export */ FONT_FAMILY_FALLBACKS: () => (/* binding */ FONT_FAMILY_FALLBACKS),\n/* harmony export */ FONT_FAMILY_GENERIC_FALLBACKS: () => (/* binding */ FONT_FAMILY_GENERIC_FALLBACKS),\n/* harmony export */ FONT_SIZES: () => (/* binding */ FONT_SIZES),\n/* harmony export */ FRAME_STYLE: () => (/* binding */ FRAME_STYLE),\n/* harmony export */ HYPERLINK_TOOLTIP_DELAY: () => (/* binding */ HYPERLINK_TOOLTIP_DELAY),\n/* harmony export */ IDLE_THRESHOLD: () => (/* binding */ IDLE_THRESHOLD),\n/* harmony export */ IMAGE_MIME_TYPES: () => (/* binding */ IMAGE_MIME_TYPES),\n/* harmony export */ IMAGE_RENDER_TIMEOUT: () => (/* binding */ IMAGE_RENDER_TIMEOUT),\n/* harmony export */ LIBRARY_DISABLED_TYPES: () => (/* binding */ LIBRARY_DISABLED_TYPES),\n/* harmony export */ LIBRARY_SIDEBAR_TAB: () => (/* binding */ LIBRARY_SIDEBAR_TAB),\n/* harmony export */ LINE_CONFIRM_THRESHOLD: () => (/* binding */ LINE_CONFIRM_THRESHOLD),\n/* harmony export */ LINE_POLYGON_POINT_MERGE_DISTANCE: () => (/* binding */ LINE_POLYGON_POINT_MERGE_DISTANCE),\n/* harmony export */ MAX_ALLOWED_FILE_BYTES: () => (/* binding */ MAX_ALLOWED_FILE_BYTES),\n/* harmony export */ MAX_DECIMALS_FOR_SVG_EXPORT: () => (/* binding */ MAX_DECIMALS_FOR_SVG_EXPORT),\n/* harmony export */ MAX_ZOOM: () => (/* binding */ MAX_ZOOM),\n/* harmony export */ MIME_TYPES: () => (/* binding */ MIME_TYPES),\n/* harmony export */ MINIMUM_ARROW_SIZE: () => (/* binding */ MINIMUM_ARROW_SIZE),\n/* harmony export */ MIN_FONT_SIZE: () => (/* binding */ MIN_FONT_SIZE),\n/* harmony export */ MIN_WIDTH_OR_HEIGHT: () => (/* binding */ MIN_WIDTH_OR_HEIGHT),\n/* harmony export */ MIN_ZOOM: () => (/* binding */ MIN_ZOOM),\n/* harmony export */ MOBILE_ACTION_BUTTON_BG: () => (/* binding */ MOBILE_ACTION_BUTTON_BG),\n/* harmony export */ MONOSPACE_GENERIC_FONT: () => (/* binding */ MONOSPACE_GENERIC_FONT),\n/* harmony export */ ORIG_ID: () => (/* binding */ ORIG_ID),\n/* harmony export */ POINTER_BUTTON: () => (/* binding */ POINTER_BUTTON),\n/* harmony export */ POINTER_EVENTS: () => (/* binding */ POINTER_EVENTS),\n/* harmony export */ PRECEDING_ELEMENT_KEY: () => (/* binding */ PRECEDING_ELEMENT_KEY),\n/* harmony export */ ROUGHNESS: () => (/* binding */ ROUGHNESS),\n/* harmony export */ ROUNDNESS: () => (/* binding */ ROUNDNESS),\n/* harmony export */ SANS_SERIF_GENERIC_FONT: () => (/* binding */ SANS_SERIF_GENERIC_FONT),\n/* harmony export */ SCROLL_TIMEOUT: () => (/* binding */ SCROLL_TIMEOUT),\n/* harmony export */ SHIFT_LOCKING_ANGLE: () => (/* binding */ SHIFT_LOCKING_ANGLE),\n/* harmony export */ SIDE_RESIZING_THRESHOLD: () => (/* binding */ SIDE_RESIZING_THRESHOLD),\n/* harmony export */ STATS_PANELS: () => (/* binding */ STATS_PANELS),\n/* harmony export */ STRING_MIME_TYPES: () => (/* binding */ STRING_MIME_TYPES),\n/* harmony export */ STROKE_WIDTH: () => (/* binding */ STROKE_WIDTH),\n/* harmony export */ SVG_DOCUMENT_PREAMBLE: () => (/* binding */ SVG_DOCUMENT_PREAMBLE),\n/* harmony export */ SVG_NS: () => (/* binding */ SVG_NS),\n/* harmony export */ TAP_TWICE_TIMEOUT: () => (/* binding */ TAP_TWICE_TIMEOUT),\n/* harmony export */ TEXT_ALIGN: () => (/* binding */ TEXT_ALIGN),\n/* harmony export */ TEXT_AUTOWRAP_THRESHOLD: () => (/* binding */ TEXT_AUTOWRAP_THRESHOLD),\n/* harmony export */ TEXT_TO_CENTER_SNAP_THRESHOLD: () => (/* binding */ TEXT_TO_CENTER_SNAP_THRESHOLD),\n/* harmony export */ THEME: () => (/* binding */ THEME),\n/* harmony export */ TITLE_TIMEOUT: () => (/* binding */ TITLE_TIMEOUT),\n/* harmony export */ TOOL_TYPE: () => (/* binding */ TOOL_TYPE),\n/* harmony export */ TOUCH_CTX_MENU_TIMEOUT: () => (/* binding */ TOUCH_CTX_MENU_TIMEOUT),\n/* harmony export */ URL_HASH_KEYS: () => (/* binding */ URL_HASH_KEYS),\n/* harmony export */ URL_QUERY_KEYS: () => (/* binding */ URL_QUERY_KEYS),\n/* harmony export */ UserIdleState: () => (/* binding */ UserIdleState),\n/* harmony export */ VERSIONS: () => (/* binding */ VERSIONS),\n/* harmony export */ VERSION_TIMEOUT: () => (/* binding */ VERSION_TIMEOUT),\n/* harmony export */ VERTICAL_ALIGN: () => (/* binding */ VERTICAL_ALIGN),\n/* harmony export */ WINDOWS_EMOJI_FALLBACK_FONT: () => (/* binding */ WINDOWS_EMOJI_FALLBACK_FONT),\n/* harmony export */ YOUTUBE_STATES: () => (/* binding */ YOUTUBE_STATES),\n/* harmony export */ ZOOM_STEP: () => (/* binding */ ZOOM_STEP),\n/* harmony export */ getExportSource: () => (/* binding */ getExportSource),\n/* harmony export */ getFontFamilyFallbacks: () => (/* binding */ getFontFamilyFallbacks),\n/* harmony export */ getGenericFontFamilyFallback: () => (/* binding */ getGenericFontFamilyFallback),\n/* harmony export */ supportsResizeObserver: () => (/* binding */ supportsResizeObserver)\n/* harmony export */ });\n/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colors */ \"../common/src/colors.ts\");\n\nconst supportsResizeObserver = typeof window !== \"undefined\" && \"ResizeObserver\" in window;\nconst APP_NAME = \"Excalidraw\"; // distance when creating text before it's considered `autoResize: false`\n// we're using higher threshold so that clicks that end up being drags\n// don't unintentionally create text elements that are wrapped to a few chars\n// (happens a lot with fast clicks with the text tool)\n\nconst TEXT_AUTOWRAP_THRESHOLD = 36; // px\n\nconst DRAGGING_THRESHOLD = 10; // px\n\nconst MINIMUM_ARROW_SIZE = 20; // px\n\nconst LINE_CONFIRM_THRESHOLD = 8; // px\n\nconst ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;\nconst ELEMENT_TRANSLATE_AMOUNT = 1;\nconst TEXT_TO_CENTER_SNAP_THRESHOLD = 30;\nconst SHIFT_LOCKING_ANGLE = Math.PI / 12;\nconst DEFAULT_LASER_COLOR = \"red\";\nconst CURSOR_TYPE = {\n TEXT: \"text\",\n CROSSHAIR: \"crosshair\",\n GRABBING: \"grabbing\",\n GRAB: \"grab\",\n POINTER: \"pointer\",\n MOVE: \"move\",\n AUTO: \"\"\n};\nconst POINTER_BUTTON = {\n MAIN: 0,\n WHEEL: 1,\n SECONDARY: 2,\n TOUCH: -1,\n ERASER: 5\n};\nconst POINTER_EVENTS = {\n enabled: \"all\",\n disabled: \"none\",\n // asserted as any so it can be freely assigned to React Element\n // \"pointerEnvets\" CSS prop\n inheritFromUI: \"var(--ui-pointerEvents)\"\n};\nvar EVENT;\n\n(function (EVENT) {\n EVENT[\"COPY\"] = \"copy\";\n EVENT[\"PASTE\"] = \"paste\";\n EVENT[\"CUT\"] = \"cut\";\n EVENT[\"KEYDOWN\"] = \"keydown\";\n EVENT[\"KEYUP\"] = \"keyup\";\n EVENT[\"MOUSE_MOVE\"] = \"mousemove\";\n EVENT[\"RESIZE\"] = \"resize\";\n EVENT[\"UNLOAD\"] = \"unload\";\n EVENT[\"FOCUS\"] = \"focus\";\n EVENT[\"BLUR\"] = \"blur\";\n EVENT[\"DRAG_OVER\"] = \"dragover\";\n EVENT[\"DROP\"] = \"drop\";\n EVENT[\"GESTURE_END\"] = \"gestureend\";\n EVENT[\"BEFORE_UNLOAD\"] = \"beforeunload\";\n EVENT[\"GESTURE_START\"] = \"gesturestart\";\n EVENT[\"GESTURE_CHANGE\"] = \"gesturechange\";\n EVENT[\"POINTER_MOVE\"] = \"pointermove\";\n EVENT[\"POINTER_DOWN\"] = \"pointerdown\";\n EVENT[\"POINTER_UP\"] = \"pointerup\";\n EVENT[\"STATE_CHANGE\"] = \"statechange\";\n EVENT[\"WHEEL\"] = \"wheel\";\n EVENT[\"TOUCH_START\"] = \"touchstart\";\n EVENT[\"TOUCH_END\"] = \"touchend\";\n EVENT[\"HASHCHANGE\"] = \"hashchange\";\n EVENT[\"VISIBILITY_CHANGE\"] = \"visibilitychange\";\n EVENT[\"SCROLL\"] = \"scroll\"; // custom events\n\n EVENT[\"EXCALIDRAW_LINK\"] = \"excalidraw-link\";\n EVENT[\"MENU_ITEM_SELECT\"] = \"menu.itemSelect\";\n EVENT[\"MESSAGE\"] = \"message\";\n EVENT[\"FULLSCREENCHANGE\"] = \"fullscreenchange\";\n})(EVENT || (EVENT = {}));\n\nconst YOUTUBE_STATES = {\n UNSTARTED: -1,\n ENDED: 0,\n PLAYING: 1,\n PAUSED: 2,\n BUFFERING: 3,\n CUED: 5\n};\nconst ENV = {\n TEST: \"test\",\n DEVELOPMENT: \"development\",\n PRODUCTION: \"production\"\n};\nconst CLASSES = {\n SIDEBAR: \"sidebar\",\n SHAPE_ACTIONS_MENU: \"App-menu__left\",\n SHAPE_ACTIONS_MOBILE_MENU: \"App-mobile-menu\",\n //zsviczian\n SHAPE_ACTIONS_TRAY_MENU: \"App-tray-menu\",\n //zsviczian\n MOBILE_TOOLBAR: \"App-toolbar-content\",\n //zsviczian\n ZOOM_ACTIONS: \"zoom-actions\",\n SEARCH_MENU_INPUT_WRAPPER: \"layer-ui__search-inputWrapper\",\n CONVERT_ELEMENT_TYPE_POPUP: \"ConvertElementTypePopup\",\n SHAPE_ACTIONS_THEME_SCOPE: \"shape-actions-theme-scope\",\n FRAME_NAME: \"frame-name\"\n};\nconst FONT_SIZES = {\n sm: 16,\n md: 20,\n lg: 28,\n xl: 36\n};\nconst CJK_HAND_DRAWN_FALLBACK_FONT = \"Xiaolai\";\nconst WINDOWS_EMOJI_FALLBACK_FONT = \"Segoe UI Emoji\";\n/**\n * // TODO: shouldn't be really `const`, likely neither have integers as values, due to value for the custom fonts, which should likely be some hash.\n *\n * Let's think this through and consider:\n * - https://developer.mozilla.org/en-US/docs/Web/CSS/generic-family\n * - https://drafts.csswg.org/css-fonts-4/#font-family-prop\n * - https://learn.microsoft.com/en-us/typography/opentype/spec/ibmfc\n */\n\nconst FONT_FAMILY = {\n Virgil: 1,\n Helvetica: 2,\n Cascadia: 3,\n \"Local Font\": 4,\n // leave 4 unused as it was historically used for Assistant (which we don't use anymore) or custom font (Obsidian)\n Excalifont: 5,\n Nunito: 6,\n \"Lilita One\": 7,\n \"Comic Shanns\": 8,\n \"Liberation Sans\": 9,\n Assistant: 10\n}; // Segoe UI Emoji fails to properly fallback for some glyphs: ∞, ∫, ≠\n// so we need to have generic font fallback before it\n\nconst SANS_SERIF_GENERIC_FONT = \"sans-serif\";\nconst MONOSPACE_GENERIC_FONT = \"monospace\";\nconst FONT_FAMILY_GENERIC_FALLBACKS = {\n [SANS_SERIF_GENERIC_FONT]: 998,\n [MONOSPACE_GENERIC_FONT]: 999\n};\nconst FONT_FAMILY_FALLBACKS = Object.assign(Object.assign({\n [CJK_HAND_DRAWN_FALLBACK_FONT]: 100\n}, FONT_FAMILY_GENERIC_FALLBACKS), {\n [WINDOWS_EMOJI_FALLBACK_FONT]: 1000\n});\nfunction getGenericFontFamilyFallback(fontFamily) {\n switch (fontFamily) {\n case FONT_FAMILY.Cascadia:\n case FONT_FAMILY[\"Comic Shanns\"]:\n return MONOSPACE_GENERIC_FONT;\n\n default:\n return SANS_SERIF_GENERIC_FONT;\n }\n}\nconst getFontFamilyFallbacks = fontFamily => {\n const genericFallbackFont = getGenericFontFamilyFallback(fontFamily);\n\n switch (fontFamily) {\n case FONT_FAMILY.Excalifont:\n return [CJK_HAND_DRAWN_FALLBACK_FONT, genericFallbackFont, WINDOWS_EMOJI_FALLBACK_FONT];\n\n default:\n return [genericFallbackFont, WINDOWS_EMOJI_FALLBACK_FONT];\n }\n};\nconst THEME = {\n LIGHT: \"light\",\n DARK: \"dark\"\n};\nconst DARK_THEME_FILTER = \"invert(93%) hue-rotate(180deg)\";\nconst FRAME_STYLE = {\n strokeColor: \"#bbb\",\n strokeWidth: 2,\n strokeStyle: \"solid\",\n fillStyle: \"solid\",\n roughness: 0,\n roundness: null,\n backgroundColor: \"transparent\",\n radius: 8,\n nameOffsetY: 3,\n nameColorLightTheme: \"#999999\",\n nameColorDarkTheme: \"#7a7a7a\",\n nameFontSize: 14,\n nameLineHeight: 1.25\n};\nconst MIN_FONT_SIZE = 1;\nconst DEFAULT_FONT_SIZE = 20;\nconst DEFAULT_FONT_FAMILY = FONT_FAMILY.Excalifont;\nconst DEFAULT_TEXT_ALIGN = \"left\";\nconst DEFAULT_VERTICAL_ALIGN = \"top\";\nconst DEFAULT_VERSION = \"{version}\";\nconst DEFAULT_TRANSFORM_HANDLE_SPACING = 2;\nconst SIDE_RESIZING_THRESHOLD = 2 * DEFAULT_TRANSFORM_HANDLE_SPACING; // a small epsilon to make side resizing always take precedence\n// (avoids an increase in renders and changes to tests)\n\nconst EPSILON = 0.00001;\nconst DEFAULT_COLLISION_THRESHOLD = 2 * SIDE_RESIZING_THRESHOLD - EPSILON;\nconst COLOR_WHITE = \"#ffffff\";\nconst COLOR_CHARCOAL_BLACK = \"#1e1e1e\"; // keep this in sync with CSS\n\nconst COLOR_VOICE_CALL = \"#a2f1a6\";\nconst CANVAS_ONLY_ACTIONS = [\"selectAll\"];\nconst DEFAULT_GRID_SIZE = 20;\nconst DEFAULT_GRID_STEP = 5;\nconst IMAGE_MIME_TYPES = {\n svg: \"image/svg+xml\",\n png: \"image/png\",\n jpg: \"image/jpeg\",\n gif: \"image/gif\",\n webp: \"image/webp\",\n bmp: \"image/bmp\",\n ico: \"image/x-icon\",\n avif: \"image/avif\",\n jfif: \"image/jfif\"\n};\nconst STRING_MIME_TYPES = {\n text: \"text/plain\",\n html: \"text/html\",\n json: \"application/json\",\n // excalidraw data\n excalidraw: \"application/vnd.excalidraw+json\",\n // LEGACY: fully-qualified library JSON data\n excalidrawlib: \"application/vnd.excalidrawlib+json\",\n // list of excalidraw library item ids\n excalidrawlibIds: \"application/vnd.excalidrawlib.ids+json\"\n};\nconst MIME_TYPES = Object.assign(Object.assign(Object.assign({}, STRING_MIME_TYPES), {\n // image-encoded excalidraw data\n \"excalidraw.svg\": \"image/svg+xml\",\n \"excalidraw.png\": \"image/png\",\n // binary\n binary: \"application/octet-stream\"\n}), IMAGE_MIME_TYPES);\nconst ALLOWED_PASTE_MIME_TYPES = [MIME_TYPES.text, MIME_TYPES.html, ...Object.values(IMAGE_MIME_TYPES)];\nconst EXPORT_IMAGE_TYPES = {\n png: \"png\",\n svg: \"svg\",\n clipboard: \"clipboard\"\n};\nconst EXPORT_DATA_TYPES = {\n excalidraw: \"excalidraw\",\n excalidrawClipboard: \"excalidraw/clipboard\",\n excalidrawLibrary: \"excalidrawlib\",\n excalidrawClipboardWithAPI: \"excalidraw-api/clipboard\"\n};\nconst getExportSource = () => window.EXCALIDRAW_EXPORT_SOURCE || window.location.origin; // time in milliseconds\n\nconst IMAGE_RENDER_TIMEOUT = 500;\nconst TAP_TWICE_TIMEOUT = 300;\nconst TOUCH_CTX_MENU_TIMEOUT = 500;\nconst TITLE_TIMEOUT = 10000;\nconst VERSION_TIMEOUT = 30000;\nconst SCROLL_TIMEOUT = 100;\nconst ZOOM_STEP = 0.05; //zsviczian\n\nconst MIN_ZOOM = 0.1;\nconst MAX_ZOOM = 30;\nconst HYPERLINK_TOOLTIP_DELAY = 300; // Report a user inactive after IDLE_THRESHOLD milliseconds\n\nconst IDLE_THRESHOLD = 60000; // Report a user active each ACTIVE_THRESHOLD milliseconds\n\nconst ACTIVE_THRESHOLD = 3000;\nconst URL_QUERY_KEYS = {\n addLibrary: \"addLibrary\"\n};\nconst URL_HASH_KEYS = {\n addLibrary: \"addLibrary\"\n};\nconst DEFAULT_UI_OPTIONS = {\n canvasActions: {\n changeViewBackgroundColor: true,\n clearCanvas: true,\n export: {\n saveFileToDisk: true\n },\n loadScene: true,\n saveToActiveFile: true,\n toggleTheme: null,\n saveAsImage: true\n },\n tools: {\n image: true\n }\n};\nconst MAX_DECIMALS_FOR_SVG_EXPORT = 2;\nconst EXPORT_SCALES = [1, 2, 3];\nconst DEFAULT_EXPORT_PADDING = 10; // px\n\nconst DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT = 2880; //zsviczian was 1440\n\nconst MAX_ALLOWED_FILE_BYTES = 20 * 1024 * 1024;\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\nconst SVG_DOCUMENT_PREAMBLE = `<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n`;\nconst ENCRYPTION_KEY_BITS = 128;\nconst VERSIONS = {\n excalidraw: 2,\n excalidrawLibrary: 2\n};\nconst BOUND_TEXT_PADDING = 5;\nconst ARROW_LABEL_WIDTH_FRACTION = 0.7;\nconst ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO = 11;\nconst VERTICAL_ALIGN = {\n TOP: \"top\",\n MIDDLE: \"middle\",\n BOTTOM: \"bottom\"\n};\nconst TEXT_ALIGN = {\n LEFT: \"left\",\n CENTER: \"center\",\n RIGHT: \"right\"\n};\nconst ELEMENT_READY_TO_ERASE_OPACITY = 20; // Radius represented as 25% of element's largest side (width/height).\n// Used for LEGACY and PROPORTIONAL_RADIUS algorithms, or when the element is\n// below the cutoff size.\n\nconst DEFAULT_PROPORTIONAL_RADIUS = 0.25; // Fixed radius for the ADAPTIVE_RADIUS algorithm. In pixels.\n\nconst DEFAULT_ADAPTIVE_RADIUS = 32; // roundness type (algorithm)\n\nconst ROUNDNESS = {\n // Used for legacy rounding (rectangles), which currently works the same\n // as PROPORTIONAL_RADIUS, but we need to differentiate for UI purposes and\n // forwards-compat.\n LEGACY: 1,\n // Used for linear elements & diamonds\n PROPORTIONAL_RADIUS: 2,\n // Current default algorithm for rectangles, using fixed pixel radius.\n // It's working similarly to a regular border-radius, but attemps to make\n // radius visually similar across differnt element sizes, especially\n // very large and very small elements.\n //\n // NOTE right now we don't allow configuration and use a constant radius\n // (see DEFAULT_ADAPTIVE_RADIUS constant)\n ADAPTIVE_RADIUS: 3\n};\n/** key containt id of precedeing elemnt id we use in reconciliation during\n * collaboration */\n\nconst PRECEDING_ELEMENT_KEY = \"__precedingElement__\"; //zsviczian\n\nconst COLOR_NAMES = {\n aliceblue: \"#f0f8ff\",\n antiquewhite: \"#faebd7\",\n aqua: \"#00ffff\",\n aquamarine: \"#7fffd4\",\n azure: \"#f0ffff\",\n beige: \"#f5f5dc\",\n bisque: \"#ffe4c4\",\n black: \"#000000\",\n blanchedalmond: \"#ffebcd\",\n blue: \"#0000ff\",\n blueviolet: \"#8a2be2\",\n brown: \"#a52a2a\",\n burlywood: \"#deb887\",\n cadetblue: \"#5f9ea0\",\n chartreuse: \"#7fff00\",\n chocolate: \"#d2691e\",\n coral: \"#ff7f50\",\n cornflowerblue: \"#6495ed\",\n cornsilk: \"#fff8dc\",\n crimson: \"#dc143c\",\n cyan: \"#00ffff\",\n darkblue: \"#00008b\",\n darkcyan: \"#008b8b\",\n darkgoldenrod: \"#b8860b\",\n darkgray: \"#a9a9a9\",\n darkgreen: \"#006400\",\n darkkhaki: \"#bdb76b\",\n darkmagenta: \"#8b008b\",\n darkolivegreen: \"#556b2f\",\n darkorange: \"#ff8c00\",\n darkorchid: \"#9932cc\",\n darkred: \"#8b0000\",\n darksalmon: \"#e9967a\",\n darkseagreen: \"#8fbc8f\",\n darkslateblue: \"#483d8b\",\n darkslategray: \"#2f4f4f\",\n darkturquoise: \"#00ced1\",\n darkviolet: \"#9400d3\",\n deeppink: \"#ff1493\",\n deepskyblue: \"#00bfff\",\n dimgray: \"#696969\",\n dodgerblue: \"#1e90ff\",\n firebrick: \"#b22222\",\n floralwhite: \"#fffaf0\",\n forestgreen: \"#228b22\",\n fuchsia: \"#ff00ff\",\n gainsboro: \"#dcdcdc\",\n ghostwhite: \"#f8f8ff\",\n gold: \"#ffd700\",\n goldenrod: \"#daa520\",\n gray: \"#808080\",\n green: \"#008000\",\n greenyellow: \"#adff2f\",\n honeydew: \"#f0fff0\",\n hotpink: \"#ff69b4\",\n indianred: \"#cd5c5c\",\n indigo: \"#4b0082\",\n ivory: \"#fffff0\",\n khaki: \"#f0e68c\",\n lavender: \"#e6e6fa\",\n lavenderblush: \"#fff0f5\",\n lawngreen: \"#7cfc00\",\n lemonchiffon: \"#fffacd\",\n lightblue: \"#add8e6\",\n lightcoral: \"#f08080\",\n lightcyan: \"#e0ffff\",\n lightgoldenrodyellow: \"#fafad2\",\n lightgrey: \"#d3d3d3\",\n lightgreen: \"#90ee90\",\n lightpink: \"#ffb6c1\",\n lightsalmon: \"#ffa07a\",\n lightseagreen: \"#20b2aa\",\n lightskyblue: \"#87cefa\",\n lightslategray: \"#778899\",\n lightsteelblue: \"#b0c4de\",\n lightyellow: \"#ffffe0\",\n lime: \"#00ff00\",\n limegreen: \"#32cd32\",\n linen: \"#faf0e6\",\n magenta: \"#ff00ff\",\n maroon: \"#800000\",\n mediumaquamarine: \"#66cdaa\",\n mediumblue: \"#0000cd\",\n mediumorchid: \"#ba55d3\",\n mediumpurple: \"#9370d8\",\n mediumseagreen: \"#3cb371\",\n mediumslateblue: \"#7b68ee\",\n mediumspringgreen: \"#00fa9a\",\n mediumturquoise: \"#48d1cc\",\n mediumvioletred: \"#c71585\",\n midnightblue: \"#191970\",\n mintcream: \"#f5fffa\",\n mistyrose: \"#ffe4e1\",\n moccasin: \"#ffe4b5\",\n navajowhite: \"#ffdead\",\n navy: \"#000080\",\n oldlace: \"#fdf5e6\",\n olive: \"#808000\",\n olivedrab: \"#6b8e23\",\n orange: \"#ffa500\",\n orangered: \"#ff4500\",\n orchid: \"#da70d6\",\n palegoldenrod: \"#eee8aa\",\n palegreen: \"#98fb98\",\n paleturquoise: \"#afeeee\",\n palevioletred: \"#d87093\",\n papayawhip: \"#ffefd5\",\n peachpuff: \"#ffdab9\",\n peru: \"#cd853f\",\n pink: \"#ffc0cb\",\n plum: \"#dda0dd\",\n powderblue: \"#b0e0e6\",\n purple: \"#800080\",\n rebeccapurple: \"#663399\",\n red: \"#ff0000\",\n rosybrown: \"#bc8f8f\",\n royalblue: \"#4169e1\",\n saddlebrown: \"#8b4513\",\n salmon: \"#fa8072\",\n sandybrown: \"#f4a460\",\n seagreen: \"#2e8b57\",\n seashell: \"#fff5ee\",\n sienna: \"#a0522d\",\n silver: \"#c0c0c0\",\n skyblue: \"#87ceeb\",\n slateblue: \"#6a5acd\",\n slategray: \"#708090\",\n snow: \"#fffafa\",\n springgreen: \"#00ff7f\",\n steelblue: \"#4682b4\",\n tan: \"#d2b48c\",\n teal: \"#008080\",\n thistle: \"#d8bfd8\",\n tomato: \"#ff6347\",\n turquoise: \"#40e0d0\",\n violet: \"#ee82ee\",\n wheat: \"#f5deb3\",\n white: \"#ffffff\",\n whitesmoke: \"#f5f5f5\",\n yellow: \"#ffff00\",\n yellowgreen: \"#9acd32\"\n};\nconst ROUGHNESS = {\n architect: 0,\n artist: 1,\n cartoonist: 2\n};\nconst STROKE_WIDTH = {\n extraThin: 0.5,\n //zsviczian\n thin: 1,\n bold: 2,\n extraBold: 4\n};\nconst DEFAULT_ELEMENT_PROPS = {\n strokeColor: _colors__WEBPACK_IMPORTED_MODULE_0__.COLOR_PALETTE.black,\n backgroundColor: _colors__WEBPACK_IMPORTED_MODULE_0__.COLOR_PALETTE.transparent,\n fillStyle: \"solid\",\n strokeWidth: 2,\n strokeStyle: \"solid\",\n roughness: ROUGHNESS.artist,\n opacity: 100,\n locked: false\n};\nconst LIBRARY_SIDEBAR_TAB = \"library\";\nconst CANVAS_SEARCH_TAB = \"search\";\nconst DEFAULT_SIDEBAR = {\n name: \"default\",\n defaultTab: LIBRARY_SIDEBAR_TAB\n};\nconst LIBRARY_DISABLED_TYPES = new Set([\"iframe\", \"embeddable\", \"image\"]); // use these constants to easily identify reference sites\n\nconst TOOL_TYPE = {\n selection: \"selection\",\n lasso: \"lasso\",\n rectangle: \"rectangle\",\n diamond: \"diamond\",\n ellipse: \"ellipse\",\n arrow: \"arrow\",\n line: \"line\",\n freedraw: \"freedraw\",\n text: \"text\",\n image: \"image\",\n eraser: \"eraser\",\n hand: \"hand\",\n frame: \"frame\",\n magicframe: \"magicframe\",\n embeddable: \"embeddable\",\n laser: \"laser\"\n};\nconst EDITOR_LS_KEYS = {\n OAI_API_KEY: \"excalidraw-oai-api-key\",\n // legacy naming (non)scheme\n MERMAID_TO_EXCALIDRAW: \"mermaid-to-excalidraw\",\n PUBLISH_LIBRARY: \"publish-library-data\"\n};\n/**\n * not translated as this is used only in public, stateless API as default value\n * where filename is optional and we can't retrieve name from app state\n */\n\nconst DEFAULT_FILENAME = \"Untitled\";\nconst STATS_PANELS = {\n generalStats: 1,\n elementProperties: 2\n};\nconst MIN_WIDTH_OR_HEIGHT = 1;\nconst ARROW_TYPE = {\n sharp: \"sharp\",\n round: \"round\",\n elbow: \"elbow\"\n};\nconst DEFAULT_REDUCED_GLOBAL_ALPHA = 0.3;\nconst ELEMENT_LINK_KEY = \"element\";\n/** used in tests */\n\nconst ORIG_ID = Symbol.for(\"__test__originalId__\");\nvar UserIdleState;\n\n(function (UserIdleState) {\n UserIdleState[\"ACTIVE\"] = \"active\";\n UserIdleState[\"AWAY\"] = \"away\";\n UserIdleState[\"IDLE\"] = \"idle\";\n})(UserIdleState || (UserIdleState = {}));\n/**\n * distance at which we merge points instead of adding a new merge-point\n * when converting a line to a polygon (merge currently means overlaping\n * the start and end points)\n */\n\n\nconst LINE_POLYGON_POINT_MERGE_DISTANCE = 20;\nconst DOUBLE_TAP_POSITION_THRESHOLD = 35;\nconst BIND_MODE_TIMEOUT = 700; // ms\n// glass background for mobile action buttons\n\nconst MOBILE_ACTION_BUTTON_BG = {\n background: \"var(--mobile-action-button-bg)\"\n};\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/constants.ts?");
|
|
14229
14229
|
|
|
14230
14230
|
/***/ }),
|
|
14231
14231
|
|
|
@@ -14269,7 +14269,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
14269
14269
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
14270
14270
|
|
|
14271
14271
|
"use strict";
|
|
14272
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ACTIVE_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ACTIVE_THRESHOLD),\n/* harmony export */ ALLOWED_PASTE_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ALLOWED_PASTE_MIME_TYPES),\n/* harmony export */ APP_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.APP_NAME),\n/* harmony export */ ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO),\n/* harmony export */ ARROW_LABEL_WIDTH_FRACTION: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ARROW_LABEL_WIDTH_FRACTION),\n/* harmony export */ ARROW_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ARROW_TYPE),\n/* harmony export */ BIND_MODE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.BIND_MODE_TIMEOUT),\n/* harmony export */ BOUND_TEXT_PADDING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING),\n/* harmony export */ BinaryHeap: () => (/* reexport safe */ _binary_heap__WEBPACK_IMPORTED_MODULE_0__.BinaryHeap),\n/* harmony export */ CANVAS_ONLY_ACTIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CANVAS_ONLY_ACTIONS),\n/* harmony export */ CANVAS_SEARCH_TAB: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CANVAS_SEARCH_TAB),\n/* harmony export */ CJK_HAND_DRAWN_FALLBACK_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CJK_HAND_DRAWN_FALLBACK_FONT),\n/* harmony export */ CLASSES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CLASSES),\n/* harmony export */ CODES: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.CODES),\n/* harmony export */ COLORS_PER_ROW: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.COLORS_PER_ROW),\n/* harmony export */ COLOR_CHARCOAL_BLACK: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.COLOR_CHARCOAL_BLACK),\n/* harmony export */ COLOR_NAMES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.COLOR_NAMES),\n/* harmony export */ COLOR_OUTLINE_CONTRAST_THRESHOLD: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.COLOR_OUTLINE_CONTRAST_THRESHOLD),\n/* harmony export */ COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.COLOR_PALETTE),\n/* harmony export */ COLOR_VOICE_CALL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.COLOR_VOICE_CALL),\n/* harmony export */ COLOR_WHITE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.COLOR_WHITE),\n/* harmony export */ CURSOR_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CURSOR_TYPE),\n/* harmony export */ DEFAULT_ADAPTIVE_RADIUS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_ADAPTIVE_RADIUS),\n/* harmony export */ DEFAULT_CANVAS_BACKGROUND_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_CANVAS_BACKGROUND_PICKS),\n/* harmony export */ DEFAULT_CHART_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_CHART_COLOR_INDEX),\n/* harmony export */ DEFAULT_COLLISION_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_COLLISION_THRESHOLD),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_BACKGROUND_PICKS),\n/* harmony export */ DEFAULT_ELEMENT_PROPS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_ELEMENT_PROPS),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_STROKE_COLOR_INDEX),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_STROKE_COLOR_PALETTE),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_STROKE_PICKS),\n/* harmony export */ DEFAULT_EXPORT_PADDING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_EXPORT_PADDING),\n/* harmony export */ DEFAULT_FILENAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_FILENAME),\n/* harmony export */ DEFAULT_FONT_FAMILY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_FONT_FAMILY),\n/* harmony export */ DEFAULT_FONT_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_FONT_SIZE),\n/* harmony export */ DEFAULT_GRID_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_GRID_SIZE),\n/* harmony export */ DEFAULT_GRID_STEP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_GRID_STEP),\n/* harmony export */ DEFAULT_LASER_COLOR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_LASER_COLOR),\n/* harmony export */ DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT),\n/* harmony export */ DEFAULT_PROPORTIONAL_RADIUS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_PROPORTIONAL_RADIUS),\n/* harmony export */ DEFAULT_REDUCED_GLOBAL_ALPHA: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_REDUCED_GLOBAL_ALPHA),\n/* harmony export */ DEFAULT_SIDEBAR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_SIDEBAR),\n/* harmony export */ DEFAULT_TEXT_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_TEXT_ALIGN),\n/* harmony export */ DEFAULT_TRANSFORM_HANDLE_SPACING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_TRANSFORM_HANDLE_SPACING),\n/* harmony export */ DEFAULT_UI_OPTIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_UI_OPTIONS),\n/* harmony export */ DEFAULT_VERSION: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_VERSION),\n/* harmony export */ DEFAULT_VERTICAL_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_VERTICAL_ALIGN),\n/* harmony export */ DOUBLE_TAP_POSITION_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DOUBLE_TAP_POSITION_THRESHOLD),\n/* harmony export */ DRAGGING_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DRAGGING_THRESHOLD),\n/* harmony export */ EDITOR_LS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EDITOR_LS_KEYS),\n/* harmony export */ ELEMENT_LINK_KEY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_LINK_KEY),\n/* harmony export */ ELEMENT_READY_TO_ERASE_OPACITY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_READY_TO_ERASE_OPACITY),\n/* harmony export */ ELEMENT_SHIFT_TRANSLATE_AMOUNT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_SHIFT_TRANSLATE_AMOUNT),\n/* harmony export */ ELEMENT_TRANSLATE_AMOUNT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_TRANSLATE_AMOUNT),\n/* harmony export */ ENCRYPTION_KEY_BITS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ENCRYPTION_KEY_BITS),\n/* harmony export */ ENV: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ENV),\n/* harmony export */ EPSILON: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EPSILON),\n/* harmony export */ EVENT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EVENT),\n/* harmony export */ EXPORT_DATA_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EXPORT_DATA_TYPES),\n/* harmony export */ EXPORT_IMAGE_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EXPORT_IMAGE_TYPES),\n/* harmony export */ EXPORT_SCALES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EXPORT_SCALES),\n/* harmony export */ Emitter: () => (/* reexport safe */ _emitter__WEBPACK_IMPORTED_MODULE_12__.Emitter),\n/* harmony export */ FONT_FAMILY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FONT_FAMILY),\n/* harmony export */ FONT_FAMILY_FALLBACKS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FONT_FAMILY_FALLBACKS),\n/* harmony export */ FONT_FAMILY_GENERIC_FALLBACKS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FONT_FAMILY_GENERIC_FALLBACKS),\n/* harmony export */ FONT_METADATA: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.FONT_METADATA),\n/* harmony export */ FONT_SIZES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FONT_SIZES),\n/* harmony export */ FRAME_STYLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE),\n/* harmony export */ GOOGLE_FONTS_RANGES: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.GOOGLE_FONTS_RANGES),\n/* harmony export */ HYPERLINK_TOOLTIP_DELAY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.HYPERLINK_TOOLTIP_DELAY),\n/* harmony export */ IDLE_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.IDLE_THRESHOLD),\n/* harmony export */ IMAGE_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.IMAGE_MIME_TYPES),\n/* harmony export */ IMAGE_RENDER_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.IMAGE_RENDER_TIMEOUT),\n/* harmony export */ KEYS: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.KEYS),\n/* harmony export */ KeyCodeMap: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.KeyCodeMap),\n/* harmony export */ LIBRARY_DISABLED_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.LIBRARY_DISABLED_TYPES),\n/* harmony export */ LIBRARY_SIDEBAR_TAB: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.LIBRARY_SIDEBAR_TAB),\n/* harmony export */ LINE_CONFIRM_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.LINE_CONFIRM_THRESHOLD),\n/* harmony export */ LINE_POLYGON_POINT_MERGE_DISTANCE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.LINE_POLYGON_POINT_MERGE_DISTANCE),\n/* harmony export */ LOCAL_FONT_PROTOCOL: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.LOCAL_FONT_PROTOCOL),\n/* harmony export */ MAX_ALLOWED_FILE_BYTES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MAX_ALLOWED_FILE_BYTES),\n/* harmony export */ MAX_CUSTOM_COLORS_USED_IN_CANVAS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.MAX_CUSTOM_COLORS_USED_IN_CANVAS),\n/* harmony export */ MAX_DECIMALS_FOR_SVG_EXPORT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MAX_DECIMALS_FOR_SVG_EXPORT),\n/* harmony export */ MAX_ZOOM: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MAX_ZOOM),\n/* harmony export */ MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MIME_TYPES),\n/* harmony export */ MINIMUM_ARROW_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MINIMUM_ARROW_SIZE),\n/* harmony export */ MIN_FONT_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MIN_FONT_SIZE),\n/* harmony export */ MIN_WIDTH_OR_HEIGHT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MIN_WIDTH_OR_HEIGHT),\n/* harmony export */ MIN_ZOOM: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MIN_ZOOM),\n/* harmony export */ MOBILE_ACTION_BUTTON_BG: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MOBILE_ACTION_BUTTON_BG),\n/* harmony export */ MONOSPACE_GENERIC_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MONOSPACE_GENERIC_FONT),\n/* harmony export */ MQ_MAX_HEIGHT_LANDSCAPE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_HEIGHT_LANDSCAPE),\n/* harmony export */ MQ_MAX_MOBILE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_MOBILE),\n/* harmony export */ MQ_MAX_TABLET: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_TABLET),\n/* harmony export */ MQ_MAX_WIDTH_LANDSCAPE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_WIDTH_LANDSCAPE),\n/* harmony export */ MQ_MIN_TABLET: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MIN_TABLET),\n/* harmony export */ MQ_MIN_WIDTH_DESKTOP: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MIN_WIDTH_DESKTOP),\n/* harmony export */ MQ_RIGHT_SIDEBAR_MIN_WIDTH: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_RIGHT_SIDEBAR_MIN_WIDTH),\n/* harmony export */ ORIG_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ORIG_ID),\n/* harmony export */ POINTER_BUTTON: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.POINTER_BUTTON),\n/* harmony export */ POINTER_EVENTS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.POINTER_EVENTS),\n/* harmony export */ PRECEDING_ELEMENT_KEY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.PRECEDING_ELEMENT_KEY),\n/* harmony export */ PromisePool: () => (/* reexport safe */ _promise_pool__WEBPACK_IMPORTED_MODULE_8__.PromisePool),\n/* harmony export */ Queue: () => (/* reexport safe */ _queue__WEBPACK_IMPORTED_MODULE_5__.Queue),\n/* harmony export */ ROUGHNESS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ROUGHNESS),\n/* harmony export */ ROUNDNESS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ROUNDNESS),\n/* harmony export */ SANS_SERIF_GENERIC_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SANS_SERIF_GENERIC_FONT),\n/* harmony export */ SCROLL_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SCROLL_TIMEOUT),\n/* harmony export */ SHIFT_LOCKING_ANGLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SHIFT_LOCKING_ANGLE),\n/* harmony export */ SIDE_RESIZING_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SIDE_RESIZING_THRESHOLD),\n/* harmony export */ STATS_PANELS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.STATS_PANELS),\n/* harmony export */ STRING_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.STRING_MIME_TYPES),\n/* harmony export */ STROKE_WIDTH: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.STROKE_WIDTH),\n/* harmony export */ SVG_DOCUMENT_PREAMBLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SVG_DOCUMENT_PREAMBLE),\n/* harmony export */ SVG_NS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SVG_NS),\n/* harmony export */ TAP_TWICE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TAP_TWICE_TIMEOUT),\n/* harmony export */ TEXT_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TEXT_ALIGN),\n/* harmony export */ TEXT_AUTOWRAP_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TEXT_AUTOWRAP_THRESHOLD),\n/* harmony export */ TEXT_TO_CENTER_SNAP_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TEXT_TO_CENTER_SNAP_THRESHOLD),\n/* harmony export */ THEME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.THEME),\n/* harmony export */ TITLE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TITLE_TIMEOUT),\n/* harmony export */ TOOL_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TOOL_TYPE),\n/* harmony export */ TOUCH_CTX_MENU_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TOUCH_CTX_MENU_TIMEOUT),\n/* harmony export */ URL_HASH_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.URL_HASH_KEYS),\n/* harmony export */ URL_QUERY_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.URL_QUERY_KEYS),\n/* harmony export */ UserIdleState: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.UserIdleState),\n/* harmony export */ VERSIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.VERSIONS),\n/* harmony export */ VERSION_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.VERSION_TIMEOUT),\n/* harmony export */ VERTICAL_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.VERTICAL_ALIGN),\n/* harmony export */ WINDOWS_EMOJI_FALLBACK_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.WINDOWS_EMOJI_FALLBACK_FONT),\n/* harmony export */ YOUTUBE_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.YOUTUBE_STATES),\n/* harmony export */ ZOOM_STEP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ZOOM_STEP),\n/* harmony export */ addEventListener: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.addEventListener),\n/* harmony export */ allowFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.allowFullScreen),\n/* harmony export */ applyDarkModeFilter: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter),\n/* harmony export */ arrayToList: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.arrayToList),\n/* harmony export */ arrayToMap: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.arrayToMap),\n/* harmony export */ arrayToMapWithIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.arrayToMapWithIndex),\n/* harmony export */ arrayToObject: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.arrayToObject),\n/* harmony export */ assertNever: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.assertNever),\n/* harmony export */ bytesToHexString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.bytesToHexString),\n/* harmony export */ capitalizeString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.capitalizeString),\n/* harmony export */ castArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.castArray),\n/* harmony export */ chunk: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.chunk),\n/* harmony export */ cloneJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.cloneJSON),\n/* harmony export */ colorToHex: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.colorToHex),\n/* harmony export */ composeEventHandlers: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.composeEventHandlers),\n/* harmony export */ createUserAgentDescriptor: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.createUserAgentDescriptor),\n/* harmony export */ debounce: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.debounce),\n/* harmony export */ deriveStylesPanelMode: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.deriveStylesPanelMode),\n/* harmony export */ destroyObsidianUtils: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.destroyObsidianUtils),\n/* harmony export */ distance: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.distance),\n/* harmony export */ easeOut: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.easeOut),\n/* harmony export */ easeToValuesRAF: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.easeToValuesRAF),\n/* harmony export */ escapeDoubleQuotes: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.escapeDoubleQuotes),\n/* harmony export */ exitFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.exitFullScreen),\n/* harmony export */ findIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.findIndex),\n/* harmony export */ findLastIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.findLastIndex),\n/* harmony export */ focusNearestParent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.focusNearestParent),\n/* harmony export */ getAllColorsSpecificShade: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.getAllColorsSpecificShade),\n/* harmony export */ getAreaLimit: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getAreaLimit),\n/* harmony export */ getDateTime: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getDateTime),\n/* harmony export */ getDesktopUIMode: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getDesktopUIMode),\n/* harmony export */ getExportSource: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.getExportSource),\n/* harmony export */ getFeatureFlag: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getFeatureFlag),\n/* harmony export */ getFontFamilyFallbacks: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.getFontFamilyFallbacks),\n/* harmony export */ getFontFamilyString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getFontFamilyString),\n/* harmony export */ getFontString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getFontString),\n/* harmony export */ getFormFactor: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.getFormFactor),\n/* harmony export */ getFrame: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getFrame),\n/* harmony export */ getGenericFontFamilyFallback: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.getGenericFontFamilyFallback),\n/* harmony export */ getGlobalCSSVariable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getGlobalCSSVariable),\n/* harmony export */ getGridPoint: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_7__.getGridPoint),\n/* harmony export */ getHighlightColor: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getHighlightColor),\n/* harmony export */ getHostPlugin: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getHostPlugin),\n/* harmony export */ getLineHeight: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.getLineHeight),\n/* harmony export */ getNearestScrollableContainer: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getNearestScrollableContainer),\n/* harmony export */ getObsidianDeviceInfo: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getObsidianDeviceInfo),\n/* harmony export */ getSizeFromPoints: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_7__.getSizeFromPoints),\n/* harmony export */ getSvgPathFromStroke: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getSvgPathFromStroke),\n/* harmony export */ getUpdatedTimestamp: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getUpdatedTimestamp),\n/* harmony export */ getVersion: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getVersion),\n/* harmony export */ getVerticalOffset: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.getVerticalOffset),\n/* harmony export */ getWidthHeightLimit: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getWidthHeightLimit),\n/* harmony export */ hostPlugin: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.hostPlugin),\n/* harmony export */ initializeObsidianUtils: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.initializeObsidianUtils),\n/* harmony export */ invariant: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.invariant),\n/* harmony export */ isAndroid: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isAndroid),\n/* harmony export */ isAnyTrue: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isAnyTrue),\n/* harmony export */ isArrowKey: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.isArrowKey),\n/* harmony export */ isBounds: () => (/* reexport safe */ _bounds__WEBPACK_IMPORTED_MODULE_1__.isBounds),\n/* harmony export */ isBrave: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isBrave),\n/* harmony export */ isChrome: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isChrome),\n/* harmony export */ isColorDark: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.isColorDark),\n/* harmony export */ isDarwin: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isDarwin),\n/* harmony export */ isDevEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isDevEnv),\n/* harmony export */ isFirefox: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isFirefox),\n/* harmony export */ isFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isFullScreen),\n/* harmony export */ isIOS: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isIOS),\n/* harmony export */ isInputLike: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isInputLike),\n/* harmony export */ isInteractive: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isInteractive),\n/* harmony export */ isLatinChar: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.isLatinChar),\n/* harmony export */ isLocalLink: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_10__.isLocalLink),\n/* harmony export */ isMemberOf: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isMemberOf),\n/* harmony export */ isMobileBreakpoint: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isMobileBreakpoint),\n/* harmony export */ isPrimitive: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isPrimitive),\n/* harmony export */ isProdEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isProdEnv),\n/* harmony export */ isPromiseLike: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isPromiseLike),\n/* harmony export */ isRTL: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isRTL),\n/* harmony export */ isReadonlyArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isReadonlyArray),\n/* harmony export */ isRunningInIframe: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isRunningInIframe),\n/* harmony export */ isSafari: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isSafari),\n/* harmony export */ isSelectionLikeTool: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isSelectionLikeTool),\n/* harmony export */ isServerEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isServerEnv),\n/* harmony export */ isShallowEqual: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isShallowEqual),\n/* harmony export */ isTabletBreakpoint: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isTabletBreakpoint),\n/* harmony export */ isTestEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isTestEnv),\n/* harmony export */ isToolIcon: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isToolIcon),\n/* harmony export */ isTransparent: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.isTransparent),\n/* harmony export */ isWindows: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isWindows),\n/* harmony export */ isWritableElement: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isWritableElement),\n/* harmony export */ loadDesktopUIModePreference: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.loadDesktopUIModePreference),\n/* harmony export */ mapFind: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.mapFind),\n/* harmony export */ matchKey: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.matchKey),\n/* harmony export */ memoize: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.memoize),\n/* harmony export */ muteFSAbortError: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.muteFSAbortError),\n/* harmony export */ nFormatter: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.nFormatter),\n/* harmony export */ nextAnimationFrame: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.nextAnimationFrame),\n/* harmony export */ normalizeEOL: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.normalizeEOL),\n/* harmony export */ normalizeInputColor: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.normalizeInputColor),\n/* harmony export */ normalizeLink: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_10__.normalizeLink),\n/* harmony export */ obsidianId: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_9__.obsidianId),\n/* harmony export */ preventUnload: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.preventUnload),\n/* harmony export */ promiseTry: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.promiseTry),\n/* harmony export */ queryFocusableElements: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.queryFocusableElements),\n/* harmony export */ randomId: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_9__.randomId),\n/* harmony export */ randomInteger: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_9__.randomInteger),\n/* harmony export */ reduceToCommonValue: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.reduceToCommonValue),\n/* harmony export */ removeSelection: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.removeSelection),\n/* harmony export */ rescalePoints: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_7__.rescalePoints),\n/* harmony export */ reseed: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_9__.reseed),\n/* harmony export */ resolvablePromise: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.resolvablePromise),\n/* harmony export */ rgbToHex: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.rgbToHex),\n/* harmony export */ safelyParseJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.safelyParseJSON),\n/* harmony export */ sceneCoordsToViewportCoords: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.sceneCoordsToViewportCoords),\n/* harmony export */ selectNode: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.selectNode),\n/* harmony export */ setDateTimeForTests: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.setDateTimeForTests),\n/* harmony export */ setDesktopUIMode: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.setDesktopUIMode),\n/* harmony export */ setFeatureFlag: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.setFeatureFlag),\n/* harmony export */ shouldMaintainAspectRatio: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio),\n/* harmony export */ shouldResizeFromCenter: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.shouldResizeFromCenter),\n/* harmony export */ shouldRotateWithDiscreteAngle: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.shouldRotateWithDiscreteAngle),\n/* harmony export */ sizeOf: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.sizeOf),\n/* harmony export */ supportsEmoji: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.supportsEmoji),\n/* harmony export */ supportsResizeObserver: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.supportsResizeObserver),\n/* harmony export */ throttleRAF: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.throttleRAF),\n/* harmony export */ toArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.toArray),\n/* harmony export */ toBrandedType: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.toBrandedType),\n/* harmony export */ toIterable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.toIterable),\n/* harmony export */ toValidURL: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_10__.toValidURL),\n/* harmony export */ tupleToCoors: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.tupleToCoors),\n/* harmony export */ updateActiveTool: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.updateActiveTool),\n/* harmony export */ updateObject: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.updateObject),\n/* harmony export */ updateStable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.updateStable),\n/* harmony export */ viewportCoordsToSceneCoords: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.viewportCoordsToSceneCoords),\n/* harmony export */ wrapEvent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.wrapEvent)\n/* harmony export */ });\n/* harmony import */ var _binary_heap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./binary-heap */ \"../common/src/binary-heap.ts\");\n/* harmony import */ var _bounds__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bounds */ \"../common/src/bounds.ts\");\n/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./colors */ \"../common/src/colors.ts\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ \"../common/src/constants.ts\");\n/* harmony import */ var _font_metadata__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./font-metadata */ \"../common/src/font-metadata.ts\");\n/* harmony import */ var _queue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./queue */ \"../common/src/queue.ts\");\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./keys */ \"../common/src/keys.ts\");\n/* harmony import */ var _points__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./points */ \"../common/src/points.ts\");\n/* harmony import */ var _promise_pool__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./promise-pool */ \"../common/src/promise-pool.ts\");\n/* harmony import */ var _random__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./random */ \"../common/src/random.ts\");\n/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./url */ \"../common/src/url.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ \"../common/src/utils.ts\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./emitter */ \"../common/src/emitter.ts\");\n/* harmony import */ var _editorInterface__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./editorInterface */ \"../common/src/editorInterface.ts\");\n/* harmony import */ var _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commonObsidianUtils */ \"../common/src/commonObsidianUtils.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/index.ts?");
|
|
14272
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ACTIVE_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ACTIVE_THRESHOLD),\n/* harmony export */ ALLOWED_PASTE_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ALLOWED_PASTE_MIME_TYPES),\n/* harmony export */ APP_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.APP_NAME),\n/* harmony export */ ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO),\n/* harmony export */ ARROW_LABEL_WIDTH_FRACTION: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ARROW_LABEL_WIDTH_FRACTION),\n/* harmony export */ ARROW_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ARROW_TYPE),\n/* harmony export */ BIND_MODE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.BIND_MODE_TIMEOUT),\n/* harmony export */ BOUND_TEXT_PADDING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING),\n/* harmony export */ BinaryHeap: () => (/* reexport safe */ _binary_heap__WEBPACK_IMPORTED_MODULE_0__.BinaryHeap),\n/* harmony export */ CANVAS_ONLY_ACTIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CANVAS_ONLY_ACTIONS),\n/* harmony export */ CANVAS_SEARCH_TAB: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CANVAS_SEARCH_TAB),\n/* harmony export */ CJK_HAND_DRAWN_FALLBACK_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CJK_HAND_DRAWN_FALLBACK_FONT),\n/* harmony export */ CLASSES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CLASSES),\n/* harmony export */ CODES: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.CODES),\n/* harmony export */ COLORS_PER_ROW: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.COLORS_PER_ROW),\n/* harmony export */ COLOR_CHARCOAL_BLACK: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.COLOR_CHARCOAL_BLACK),\n/* harmony export */ COLOR_NAMES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.COLOR_NAMES),\n/* harmony export */ COLOR_OUTLINE_CONTRAST_THRESHOLD: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.COLOR_OUTLINE_CONTRAST_THRESHOLD),\n/* harmony export */ COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.COLOR_PALETTE),\n/* harmony export */ COLOR_VOICE_CALL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.COLOR_VOICE_CALL),\n/* harmony export */ COLOR_WHITE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.COLOR_WHITE),\n/* harmony export */ CURSOR_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.CURSOR_TYPE),\n/* harmony export */ DARK_THEME_FILTER: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DARK_THEME_FILTER),\n/* harmony export */ DEFAULT_ADAPTIVE_RADIUS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_ADAPTIVE_RADIUS),\n/* harmony export */ DEFAULT_CANVAS_BACKGROUND_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_CANVAS_BACKGROUND_PICKS),\n/* harmony export */ DEFAULT_CHART_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_CHART_COLOR_INDEX),\n/* harmony export */ DEFAULT_COLLISION_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_COLLISION_THRESHOLD),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_BACKGROUND_PICKS),\n/* harmony export */ DEFAULT_ELEMENT_PROPS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_ELEMENT_PROPS),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_STROKE_COLOR_INDEX),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_STROKE_COLOR_PALETTE),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_STROKE_PICKS),\n/* harmony export */ DEFAULT_EXPORT_PADDING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_EXPORT_PADDING),\n/* harmony export */ DEFAULT_FILENAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_FILENAME),\n/* harmony export */ DEFAULT_FONT_FAMILY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_FONT_FAMILY),\n/* harmony export */ DEFAULT_FONT_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_FONT_SIZE),\n/* harmony export */ DEFAULT_GRID_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_GRID_SIZE),\n/* harmony export */ DEFAULT_GRID_STEP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_GRID_STEP),\n/* harmony export */ DEFAULT_LASER_COLOR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_LASER_COLOR),\n/* harmony export */ DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT),\n/* harmony export */ DEFAULT_PROPORTIONAL_RADIUS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_PROPORTIONAL_RADIUS),\n/* harmony export */ DEFAULT_REDUCED_GLOBAL_ALPHA: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_REDUCED_GLOBAL_ALPHA),\n/* harmony export */ DEFAULT_SIDEBAR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_SIDEBAR),\n/* harmony export */ DEFAULT_TEXT_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_TEXT_ALIGN),\n/* harmony export */ DEFAULT_TRANSFORM_HANDLE_SPACING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_TRANSFORM_HANDLE_SPACING),\n/* harmony export */ DEFAULT_UI_OPTIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_UI_OPTIONS),\n/* harmony export */ DEFAULT_VERSION: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_VERSION),\n/* harmony export */ DEFAULT_VERTICAL_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_VERTICAL_ALIGN),\n/* harmony export */ DOUBLE_TAP_POSITION_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DOUBLE_TAP_POSITION_THRESHOLD),\n/* harmony export */ DRAGGING_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.DRAGGING_THRESHOLD),\n/* harmony export */ EDITOR_LS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EDITOR_LS_KEYS),\n/* harmony export */ ELEMENT_LINK_KEY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_LINK_KEY),\n/* harmony export */ ELEMENT_READY_TO_ERASE_OPACITY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_READY_TO_ERASE_OPACITY),\n/* harmony export */ ELEMENT_SHIFT_TRANSLATE_AMOUNT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_SHIFT_TRANSLATE_AMOUNT),\n/* harmony export */ ELEMENT_TRANSLATE_AMOUNT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_TRANSLATE_AMOUNT),\n/* harmony export */ ENCRYPTION_KEY_BITS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ENCRYPTION_KEY_BITS),\n/* harmony export */ ENV: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ENV),\n/* harmony export */ EPSILON: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EPSILON),\n/* harmony export */ EVENT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EVENT),\n/* harmony export */ EXPORT_DATA_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EXPORT_DATA_TYPES),\n/* harmony export */ EXPORT_IMAGE_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EXPORT_IMAGE_TYPES),\n/* harmony export */ EXPORT_SCALES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.EXPORT_SCALES),\n/* harmony export */ Emitter: () => (/* reexport safe */ _emitter__WEBPACK_IMPORTED_MODULE_12__.Emitter),\n/* harmony export */ FONT_FAMILY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FONT_FAMILY),\n/* harmony export */ FONT_FAMILY_FALLBACKS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FONT_FAMILY_FALLBACKS),\n/* harmony export */ FONT_FAMILY_GENERIC_FALLBACKS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FONT_FAMILY_GENERIC_FALLBACKS),\n/* harmony export */ FONT_METADATA: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.FONT_METADATA),\n/* harmony export */ FONT_SIZES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FONT_SIZES),\n/* harmony export */ FRAME_STYLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE),\n/* harmony export */ GOOGLE_FONTS_RANGES: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.GOOGLE_FONTS_RANGES),\n/* harmony export */ HYPERLINK_TOOLTIP_DELAY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.HYPERLINK_TOOLTIP_DELAY),\n/* harmony export */ IDLE_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.IDLE_THRESHOLD),\n/* harmony export */ IMAGE_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.IMAGE_MIME_TYPES),\n/* harmony export */ IMAGE_RENDER_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.IMAGE_RENDER_TIMEOUT),\n/* harmony export */ KEYS: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.KEYS),\n/* harmony export */ KeyCodeMap: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.KeyCodeMap),\n/* harmony export */ LIBRARY_DISABLED_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.LIBRARY_DISABLED_TYPES),\n/* harmony export */ LIBRARY_SIDEBAR_TAB: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.LIBRARY_SIDEBAR_TAB),\n/* harmony export */ LINE_CONFIRM_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.LINE_CONFIRM_THRESHOLD),\n/* harmony export */ LINE_POLYGON_POINT_MERGE_DISTANCE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.LINE_POLYGON_POINT_MERGE_DISTANCE),\n/* harmony export */ LOCAL_FONT_PROTOCOL: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.LOCAL_FONT_PROTOCOL),\n/* harmony export */ MAX_ALLOWED_FILE_BYTES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MAX_ALLOWED_FILE_BYTES),\n/* harmony export */ MAX_CUSTOM_COLORS_USED_IN_CANVAS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.MAX_CUSTOM_COLORS_USED_IN_CANVAS),\n/* harmony export */ MAX_DECIMALS_FOR_SVG_EXPORT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MAX_DECIMALS_FOR_SVG_EXPORT),\n/* harmony export */ MAX_ZOOM: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MAX_ZOOM),\n/* harmony export */ MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MIME_TYPES),\n/* harmony export */ MINIMUM_ARROW_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MINIMUM_ARROW_SIZE),\n/* harmony export */ MIN_FONT_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MIN_FONT_SIZE),\n/* harmony export */ MIN_WIDTH_OR_HEIGHT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MIN_WIDTH_OR_HEIGHT),\n/* harmony export */ MIN_ZOOM: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MIN_ZOOM),\n/* harmony export */ MOBILE_ACTION_BUTTON_BG: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MOBILE_ACTION_BUTTON_BG),\n/* harmony export */ MONOSPACE_GENERIC_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.MONOSPACE_GENERIC_FONT),\n/* harmony export */ MQ_MAX_HEIGHT_LANDSCAPE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_HEIGHT_LANDSCAPE),\n/* harmony export */ MQ_MAX_MOBILE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_MOBILE),\n/* harmony export */ MQ_MAX_TABLET: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_TABLET),\n/* harmony export */ MQ_MAX_WIDTH_LANDSCAPE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_WIDTH_LANDSCAPE),\n/* harmony export */ MQ_MIN_TABLET: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MIN_TABLET),\n/* harmony export */ MQ_MIN_WIDTH_DESKTOP: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MIN_WIDTH_DESKTOP),\n/* harmony export */ MQ_RIGHT_SIDEBAR_MIN_WIDTH: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_RIGHT_SIDEBAR_MIN_WIDTH),\n/* harmony export */ ORIG_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ORIG_ID),\n/* harmony export */ POINTER_BUTTON: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.POINTER_BUTTON),\n/* harmony export */ POINTER_EVENTS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.POINTER_EVENTS),\n/* harmony export */ PRECEDING_ELEMENT_KEY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.PRECEDING_ELEMENT_KEY),\n/* harmony export */ PromisePool: () => (/* reexport safe */ _promise_pool__WEBPACK_IMPORTED_MODULE_8__.PromisePool),\n/* harmony export */ Queue: () => (/* reexport safe */ _queue__WEBPACK_IMPORTED_MODULE_5__.Queue),\n/* harmony export */ ROUGHNESS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ROUGHNESS),\n/* harmony export */ ROUNDNESS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ROUNDNESS),\n/* harmony export */ SANS_SERIF_GENERIC_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SANS_SERIF_GENERIC_FONT),\n/* harmony export */ SCROLL_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SCROLL_TIMEOUT),\n/* harmony export */ SHIFT_LOCKING_ANGLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SHIFT_LOCKING_ANGLE),\n/* harmony export */ SIDE_RESIZING_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SIDE_RESIZING_THRESHOLD),\n/* harmony export */ STATS_PANELS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.STATS_PANELS),\n/* harmony export */ STRING_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.STRING_MIME_TYPES),\n/* harmony export */ STROKE_WIDTH: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.STROKE_WIDTH),\n/* harmony export */ SVG_DOCUMENT_PREAMBLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SVG_DOCUMENT_PREAMBLE),\n/* harmony export */ SVG_NS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SVG_NS),\n/* harmony export */ TAP_TWICE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TAP_TWICE_TIMEOUT),\n/* harmony export */ TEXT_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TEXT_ALIGN),\n/* harmony export */ TEXT_AUTOWRAP_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TEXT_AUTOWRAP_THRESHOLD),\n/* harmony export */ TEXT_TO_CENTER_SNAP_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TEXT_TO_CENTER_SNAP_THRESHOLD),\n/* harmony export */ THEME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.THEME),\n/* harmony export */ TITLE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TITLE_TIMEOUT),\n/* harmony export */ TOOL_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TOOL_TYPE),\n/* harmony export */ TOUCH_CTX_MENU_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.TOUCH_CTX_MENU_TIMEOUT),\n/* harmony export */ URL_HASH_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.URL_HASH_KEYS),\n/* harmony export */ URL_QUERY_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.URL_QUERY_KEYS),\n/* harmony export */ UserIdleState: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.UserIdleState),\n/* harmony export */ VERSIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.VERSIONS),\n/* harmony export */ VERSION_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.VERSION_TIMEOUT),\n/* harmony export */ VERTICAL_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.VERTICAL_ALIGN),\n/* harmony export */ WINDOWS_EMOJI_FALLBACK_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.WINDOWS_EMOJI_FALLBACK_FONT),\n/* harmony export */ YOUTUBE_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.YOUTUBE_STATES),\n/* harmony export */ ZOOM_STEP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.ZOOM_STEP),\n/* harmony export */ addEventListener: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.addEventListener),\n/* harmony export */ allowFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.allowFullScreen),\n/* harmony export */ applyDarkModeFilter: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter),\n/* harmony export */ arrayToList: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.arrayToList),\n/* harmony export */ arrayToMap: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.arrayToMap),\n/* harmony export */ arrayToMapWithIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.arrayToMapWithIndex),\n/* harmony export */ arrayToObject: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.arrayToObject),\n/* harmony export */ assertNever: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.assertNever),\n/* harmony export */ bytesToHexString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.bytesToHexString),\n/* harmony export */ capitalizeString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.capitalizeString),\n/* harmony export */ castArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.castArray),\n/* harmony export */ chunk: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.chunk),\n/* harmony export */ cloneJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.cloneJSON),\n/* harmony export */ colorToHex: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.colorToHex),\n/* harmony export */ composeEventHandlers: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.composeEventHandlers),\n/* harmony export */ createUserAgentDescriptor: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.createUserAgentDescriptor),\n/* harmony export */ debounce: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.debounce),\n/* harmony export */ deriveStylesPanelMode: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.deriveStylesPanelMode),\n/* harmony export */ destroyObsidianUtils: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.destroyObsidianUtils),\n/* harmony export */ distance: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.distance),\n/* harmony export */ easeOut: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.easeOut),\n/* harmony export */ easeToValuesRAF: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.easeToValuesRAF),\n/* harmony export */ escapeDoubleQuotes: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.escapeDoubleQuotes),\n/* harmony export */ exitFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.exitFullScreen),\n/* harmony export */ findIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.findIndex),\n/* harmony export */ findLastIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.findLastIndex),\n/* harmony export */ focusNearestParent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.focusNearestParent),\n/* harmony export */ getAllColorsSpecificShade: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.getAllColorsSpecificShade),\n/* harmony export */ getAreaLimit: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getAreaLimit),\n/* harmony export */ getDateTime: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getDateTime),\n/* harmony export */ getDesktopUIMode: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getDesktopUIMode),\n/* harmony export */ getExportSource: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.getExportSource),\n/* harmony export */ getFeatureFlag: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getFeatureFlag),\n/* harmony export */ getFontFamilyFallbacks: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.getFontFamilyFallbacks),\n/* harmony export */ getFontFamilyString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getFontFamilyString),\n/* harmony export */ getFontString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getFontString),\n/* harmony export */ getFormFactor: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.getFormFactor),\n/* harmony export */ getFrame: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getFrame),\n/* harmony export */ getGenericFontFamilyFallback: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.getGenericFontFamilyFallback),\n/* harmony export */ getGlobalCSSVariable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getGlobalCSSVariable),\n/* harmony export */ getGridPoint: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_7__.getGridPoint),\n/* harmony export */ getHighlightColor: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getHighlightColor),\n/* harmony export */ getHostPlugin: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getHostPlugin),\n/* harmony export */ getLineHeight: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.getLineHeight),\n/* harmony export */ getNearestScrollableContainer: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getNearestScrollableContainer),\n/* harmony export */ getObsidianDeviceInfo: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getObsidianDeviceInfo),\n/* harmony export */ getSizeFromPoints: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_7__.getSizeFromPoints),\n/* harmony export */ getSvgPathFromStroke: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getSvgPathFromStroke),\n/* harmony export */ getUpdatedTimestamp: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getUpdatedTimestamp),\n/* harmony export */ getVersion: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.getVersion),\n/* harmony export */ getVerticalOffset: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_4__.getVerticalOffset),\n/* harmony export */ getWidthHeightLimit: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getWidthHeightLimit),\n/* harmony export */ hostPlugin: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.hostPlugin),\n/* harmony export */ initializeObsidianUtils: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.initializeObsidianUtils),\n/* harmony export */ invariant: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.invariant),\n/* harmony export */ isAndroid: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isAndroid),\n/* harmony export */ isAnyTrue: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isAnyTrue),\n/* harmony export */ isArrowKey: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.isArrowKey),\n/* harmony export */ isBounds: () => (/* reexport safe */ _bounds__WEBPACK_IMPORTED_MODULE_1__.isBounds),\n/* harmony export */ isBrave: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isBrave),\n/* harmony export */ isChrome: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isChrome),\n/* harmony export */ isColorDark: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.isColorDark),\n/* harmony export */ isDarwin: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isDarwin),\n/* harmony export */ isDevEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isDevEnv),\n/* harmony export */ isFirefox: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isFirefox),\n/* harmony export */ isFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isFullScreen),\n/* harmony export */ isIOS: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isIOS),\n/* harmony export */ isInputLike: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isInputLike),\n/* harmony export */ isInteractive: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isInteractive),\n/* harmony export */ isLatinChar: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.isLatinChar),\n/* harmony export */ isLocalLink: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_10__.isLocalLink),\n/* harmony export */ isMemberOf: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isMemberOf),\n/* harmony export */ isMobileBreakpoint: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isMobileBreakpoint),\n/* harmony export */ isPrimitive: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isPrimitive),\n/* harmony export */ isProdEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isProdEnv),\n/* harmony export */ isPromiseLike: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isPromiseLike),\n/* harmony export */ isRTL: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isRTL),\n/* harmony export */ isReadonlyArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isReadonlyArray),\n/* harmony export */ isRunningInIframe: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isRunningInIframe),\n/* harmony export */ isSafari: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isSafari),\n/* harmony export */ isSelectionLikeTool: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isSelectionLikeTool),\n/* harmony export */ isServerEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isServerEnv),\n/* harmony export */ isShallowEqual: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isShallowEqual),\n/* harmony export */ isTabletBreakpoint: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isTabletBreakpoint),\n/* harmony export */ isTestEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isTestEnv),\n/* harmony export */ isToolIcon: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isToolIcon),\n/* harmony export */ isTransparent: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.isTransparent),\n/* harmony export */ isWindows: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isWindows),\n/* harmony export */ isWritableElement: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.isWritableElement),\n/* harmony export */ loadDesktopUIModePreference: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.loadDesktopUIModePreference),\n/* harmony export */ mapFind: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.mapFind),\n/* harmony export */ matchKey: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.matchKey),\n/* harmony export */ memoize: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.memoize),\n/* harmony export */ muteFSAbortError: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.muteFSAbortError),\n/* harmony export */ nFormatter: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.nFormatter),\n/* harmony export */ nextAnimationFrame: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.nextAnimationFrame),\n/* harmony export */ normalizeEOL: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.normalizeEOL),\n/* harmony export */ normalizeInputColor: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.normalizeInputColor),\n/* harmony export */ normalizeLink: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_10__.normalizeLink),\n/* harmony export */ obsidianId: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_9__.obsidianId),\n/* harmony export */ preventUnload: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.preventUnload),\n/* harmony export */ promiseTry: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.promiseTry),\n/* harmony export */ queryFocusableElements: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.queryFocusableElements),\n/* harmony export */ randomId: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_9__.randomId),\n/* harmony export */ randomInteger: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_9__.randomInteger),\n/* harmony export */ reduceToCommonValue: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.reduceToCommonValue),\n/* harmony export */ removeSelection: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.removeSelection),\n/* harmony export */ rescalePoints: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_7__.rescalePoints),\n/* harmony export */ reseed: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_9__.reseed),\n/* harmony export */ resolvablePromise: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.resolvablePromise),\n/* harmony export */ rgbToHex: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_2__.rgbToHex),\n/* harmony export */ safelyParseJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.safelyParseJSON),\n/* harmony export */ sceneCoordsToViewportCoords: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.sceneCoordsToViewportCoords),\n/* harmony export */ selectNode: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.selectNode),\n/* harmony export */ setDateTimeForTests: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.setDateTimeForTests),\n/* harmony export */ setDesktopUIMode: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.setDesktopUIMode),\n/* harmony export */ setFeatureFlag: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.setFeatureFlag),\n/* harmony export */ shouldMaintainAspectRatio: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio),\n/* harmony export */ shouldResizeFromCenter: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.shouldResizeFromCenter),\n/* harmony export */ shouldRotateWithDiscreteAngle: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_6__.shouldRotateWithDiscreteAngle),\n/* harmony export */ sizeOf: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.sizeOf),\n/* harmony export */ supportsEmoji: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.supportsEmoji),\n/* harmony export */ supportsResizeObserver: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.supportsResizeObserver),\n/* harmony export */ throttleRAF: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.throttleRAF),\n/* harmony export */ toArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.toArray),\n/* harmony export */ toBrandedType: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.toBrandedType),\n/* harmony export */ toIterable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.toIterable),\n/* harmony export */ toValidURL: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_10__.toValidURL),\n/* harmony export */ tupleToCoors: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.tupleToCoors),\n/* harmony export */ updateActiveTool: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.updateActiveTool),\n/* harmony export */ updateObject: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.updateObject),\n/* harmony export */ updateStable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.updateStable),\n/* harmony export */ viewportCoordsToSceneCoords: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.viewportCoordsToSceneCoords),\n/* harmony export */ wrapEvent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.wrapEvent)\n/* harmony export */ });\n/* harmony import */ var _binary_heap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./binary-heap */ \"../common/src/binary-heap.ts\");\n/* harmony import */ var _bounds__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bounds */ \"../common/src/bounds.ts\");\n/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./colors */ \"../common/src/colors.ts\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ \"../common/src/constants.ts\");\n/* harmony import */ var _font_metadata__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./font-metadata */ \"../common/src/font-metadata.ts\");\n/* harmony import */ var _queue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./queue */ \"../common/src/queue.ts\");\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./keys */ \"../common/src/keys.ts\");\n/* harmony import */ var _points__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./points */ \"../common/src/points.ts\");\n/* harmony import */ var _promise_pool__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./promise-pool */ \"../common/src/promise-pool.ts\");\n/* harmony import */ var _random__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./random */ \"../common/src/random.ts\");\n/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./url */ \"../common/src/url.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ \"../common/src/utils.ts\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./emitter */ \"../common/src/emitter.ts\");\n/* harmony import */ var _editorInterface__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./editorInterface */ \"../common/src/editorInterface.ts\");\n/* harmony import */ var _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commonObsidianUtils */ \"../common/src/commonObsidianUtils.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/index.ts?");
|
|
14273
14273
|
|
|
14274
14274
|
/***/ }),
|
|
14275
14275
|
|
|
@@ -14676,7 +14676,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
14676
14676
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
14677
14677
|
|
|
14678
14678
|
"use strict";
|
|
14679
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_LINK_SIZE: () => (/* binding */ DEFAULT_LINK_SIZE),\n/* harmony export */ elementWithCanvasCache: () => (/* binding */ elementWithCanvasCache),\n/* harmony export */ getFreedrawOutlineAsSegments: () => (/* binding */ getFreedrawOutlineAsSegments),\n/* harmony export */ getRenderOpacity: () => (/* binding */ getRenderOpacity),\n/* harmony export */ renderElement: () => (/* binding */ renderElement),\n/* harmony export */ renderSelectionElement: () => (/* binding */ renderSelectionElement)\n/* harmony export */ });\n/* harmony import */ var roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! roughjs/bin/rough */ \"../../node_modules/roughjs/bin/rough.js\");\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _bounds__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bounds */ \"../element/src/bounds.ts\");\n/* harmony import */ var _cropElement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cropElement */ \"../element/src/cropElement.ts\");\n/* harmony import */ var _linearElementEditor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./linearElementEditor */ \"../element/src/linearElementEditor.ts\");\n/* harmony import */ var _textElement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./textElement */ \"../element/src/textElement.ts\");\n/* harmony import */ var _textMeasurements__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./textMeasurements */ \"../element/src/textMeasurements.ts\");\n/* harmony import */ var _typeChecks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @excalidraw/element/typeChecks */ \"../element/src/typeChecks.ts\");\n/* harmony import */ var _frame__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./frame */ \"../element/src/frame.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ \"../element/src/utils.ts\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./shape */ \"../element/src/shape.ts\");\n/* harmony import */ var _freedrawPath__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./freedrawPath */ \"../element/src/freedrawPath.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst isPendingImageElement = (element, renderConfig) => (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isInitializedImageElement)(element) && !renderConfig.imageCache.has(element.fileId);\n\nconst getCanvasPadding = element => {\n switch (element.type) {\n case \"freedraw\":\n return element.strokeWidth * 12;\n\n case \"text\":\n return element.fontSize / 2;\n\n case \"arrow\":\n if (element.endArrowhead || element.endArrowhead) {\n return 40;\n }\n\n return 20;\n\n default:\n return 20;\n }\n};\n\nconst getRenderOpacity = (element, containingFrame, elementsPendingErasure, pendingNodes, globalAlpha = 1) => {\n var _a; // multiplying frame opacity with element opacity to combine them\n // (e.g. frame 50% and element 50% opacity should result in 25% opacity)\n\n\n let opacity = ((_a = containingFrame === null || containingFrame === void 0 ? void 0 : containingFrame.opacity) !== null && _a !== void 0 ? _a : 100) * element.opacity / 10000 * globalAlpha; // if pending erasure, multiply again to combine further\n // (so that erasing always results in lower opacity than original)\n\n if (elementsPendingErasure.has(element.id) || pendingNodes && pendingNodes.some(node => node.id === element.id) || containingFrame && elementsPendingErasure.has(containingFrame.id)) {\n opacity *= _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_READY_TO_ERASE_OPACITY / 100;\n }\n\n return opacity;\n};\n\nconst cappedElementCanvasSize = (element, elementsMap, zoom) => {\n // these limits are ballpark, they depend on specific browsers and device.\n // We've chosen lower limits to be safe. We might want to change these limits\n // based on browser/device type, if we get reports of low quality rendering\n // on zoom.\n //\n // ~ safari mobile canvas area limit\n const AREA_LIMIT = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getAreaLimit)(); //zsviczian\n // ~ safari width/height limit based on developer.mozilla.org.\n\n const WIDTH_HEIGHT_LIMIT = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getWidthHeightLimit)(); //zsviczian\n\n const padding = getCanvasPadding(element);\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap);\n const elementWidth = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isFreeDrawElement)(element) ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(x1, x2) : element.width;\n const elementHeight = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isFreeDrawElement)(element) ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(y1, y2) : element.height;\n let width = elementWidth * window.devicePixelRatio + padding * 2;\n let height = elementHeight * window.devicePixelRatio + padding * 2;\n let scale = zoom.value; // rescale to ensure width and height is within limits\n\n if (width * scale > WIDTH_HEIGHT_LIMIT || height * scale > WIDTH_HEIGHT_LIMIT) {\n scale = Math.min(WIDTH_HEIGHT_LIMIT / width, WIDTH_HEIGHT_LIMIT / height);\n } // rescale to ensure canvas area is within limits\n\n\n if (width * height * scale * scale > AREA_LIMIT) {\n scale = Math.sqrt(AREA_LIMIT / (width * height));\n }\n\n width = Math.floor(width * scale);\n height = Math.floor(height * scale);\n return {\n width,\n height,\n scale\n };\n};\n\nconst generateElementCanvas = (element, elementsMap, zoom, renderConfig, appState) => {\n var _a, _b;\n\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n const padding = getCanvasPadding(element);\n const {\n width,\n height,\n scale\n } = cappedElementCanvasSize(element, elementsMap, zoom);\n\n if (!width || !height) {\n return null;\n }\n\n canvas.width = width;\n canvas.height = height;\n let canvasOffsetX = -100;\n let canvasOffsetY = 0;\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isFreeDrawElement)(element)) {\n const [x1, y1] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap);\n canvasOffsetX = element.x > x1 ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(element.x, x1) * window.devicePixelRatio * scale : 0;\n canvasOffsetY = element.y > y1 ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(element.y, y1) * window.devicePixelRatio * scale : 0;\n context.translate(canvasOffsetX, canvasOffsetY);\n }\n\n context.save();\n context.translate(padding * scale, padding * scale);\n context.scale(window.devicePixelRatio * scale, window.devicePixelRatio * scale);\n const rc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__[\"default\"].canvas(canvas);\n drawElementOnCanvas(element, rc, context, renderConfig);\n context.restore();\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, elementsMap);\n const boundTextCanvas = document.createElement(\"canvas\");\n const boundTextCanvasContext = boundTextCanvas.getContext(\"2d\");\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(element) && boundTextElement) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap); // Take max dimensions of arrow canvas so that when canvas is rotated\n // the arrow doesn't get clipped\n\n const maxDim = Math.max((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(x1, x2), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(y1, y2));\n boundTextCanvas.width = maxDim * window.devicePixelRatio * scale + padding * scale * 10;\n boundTextCanvas.height = maxDim * window.devicePixelRatio * scale + padding * scale * 10;\n boundTextCanvasContext.translate(boundTextCanvas.width / 2, boundTextCanvas.height / 2);\n boundTextCanvasContext.rotate(element.angle);\n boundTextCanvasContext.drawImage(canvas, -canvas.width / 2, -canvas.height / 2, canvas.width, canvas.height);\n const [,,,, boundTextCx, boundTextCy] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(boundTextElement, elementsMap);\n boundTextCanvasContext.rotate(-element.angle);\n const offsetX = (boundTextCanvas.width - canvas.width) / 2;\n const offsetY = (boundTextCanvas.height - canvas.height) / 2;\n const shiftX = boundTextCanvas.width / 2 - (boundTextCx - x1) * window.devicePixelRatio * scale - offsetX - padding * scale;\n const shiftY = boundTextCanvas.height / 2 - (boundTextCy - y1) * window.devicePixelRatio * scale - offsetY - padding * scale;\n boundTextCanvasContext.translate(-shiftX, -shiftY); // Clear the bound text area\n\n boundTextCanvasContext.clearRect(-(boundTextElement.width / 2 + _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING) * window.devicePixelRatio * scale, -(boundTextElement.height / 2 + _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING) * window.devicePixelRatio * scale, (boundTextElement.width + _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING * 2) * window.devicePixelRatio * scale, (boundTextElement.height + _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING * 2) * window.devicePixelRatio * scale);\n }\n\n return {\n element,\n canvas,\n theme: appState.theme,\n scale,\n zoomValue: zoom.value,\n canvasOffsetX,\n canvasOffsetY,\n boundTextElementVersion: ((_a = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.version) || null,\n containingFrameOpacity: ((_b = (0,_frame__WEBPACK_IMPORTED_MODULE_9__.getContainingFrame)(element, elementsMap)) === null || _b === void 0 ? void 0 : _b.opacity) || 100,\n boundTextCanvas,\n angle: element.angle,\n imageCrop: (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isImageElement)(element) ? element.crop : null\n };\n};\n\nconst DEFAULT_LINK_SIZE = 14;\nconst IMAGE_PLACEHOLDER_IMG = typeof document !== \"undefined\" ? document.createElement(\"img\") : {\n src: \"\"\n}; // mock image element outside of browser\n\nIMAGE_PLACEHOLDER_IMG.src = `data:${_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.MIME_TYPES.svg},${encodeURIComponent(`<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"image\" class=\"svg-inline--fa fa-image fa-w-16\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"#888\" d=\"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z\"></path></svg>`)}`;\nconst IMAGE_ERROR_PLACEHOLDER_IMG = typeof document !== \"undefined\" ? document.createElement(\"img\") : {\n src: \"\"\n}; // mock image element outside of browser\n\nIMAGE_ERROR_PLACEHOLDER_IMG.src = `data:${_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.MIME_TYPES.svg},${encodeURIComponent(`<svg viewBox=\"0 0 668 668\" xmlns=\"http://www.w3.org/2000/svg\" xml:space=\"preserve\" style=\"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2\"><path d=\"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z\" style=\"fill:#888;fill-rule:nonzero\" transform=\"matrix(.81709 0 0 .81709 124.825 145.825)\"/><path d=\"M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z\" style=\"fill:#888;fill-rule:nonzero\" transform=\"matrix(.30366 0 0 .30366 506.822 60.065)\"/></svg>`)}`;\n\nconst drawImagePlaceholder = (element, context) => {\n context.fillStyle = \"#E7E7E7\";\n context.fillRect(0, 0, element.width, element.height);\n const imageMinWidthOrHeight = Math.min(element.width, element.height);\n const size = Math.min(imageMinWidthOrHeight, Math.min(imageMinWidthOrHeight * 0.4, 100));\n context.drawImage(element.status === \"error\" ? IMAGE_ERROR_PLACEHOLDER_IMG : IMAGE_PLACEHOLDER_IMG, element.width / 2 - size / 2, element.height / 2 - size / 2, size, size);\n};\n\nconst drawElementOnCanvas = (element, rc, context, renderConfig) => {\n var _a;\n\n switch (element.type) {\n case \"rectangle\":\n case \"iframe\":\n case \"embeddable\":\n case \"diamond\":\n case \"ellipse\":\n {\n context.lineJoin = \"round\";\n context.lineCap = \"round\";\n rc.draw(_shape__WEBPACK_IMPORTED_MODULE_11__.ShapeCache.generateElementShape(element, renderConfig));\n break;\n }\n\n case \"arrow\":\n case \"line\":\n {\n context.lineJoin = \"round\";\n context.lineCap = \"round\";\n _shape__WEBPACK_IMPORTED_MODULE_11__.ShapeCache.generateElementShape(element, renderConfig).forEach(shape => {\n rc.draw(shape);\n });\n break;\n }\n\n case \"freedraw\":\n {\n // Draw directly to canvas\n context.save();\n const shapes = _shape__WEBPACK_IMPORTED_MODULE_11__.ShapeCache.generateElementShape(element, renderConfig);\n\n for (const shape of shapes) {\n if (typeof shape === \"string\") {\n const {\n path,\n fillStyle\n } = (() => {\n var _a, _b, _c, _d, _e;\n\n const path = new Path2D((0,_freedrawPath__WEBPACK_IMPORTED_MODULE_12__.getFreeDrawSvgPath)(element));\n const hasOutline = (_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.strokeOptions) === null || _b === void 0 ? void 0 : _b.hasOutline;\n const outlineWidth = (_e = (_d = (_c = element.customData) === null || _c === void 0 ? void 0 : _c.strokeOptions) === null || _d === void 0 ? void 0 : _d.outlineWidth) !== null && _e !== void 0 ? _e : 1;\n const fillColor = hasOutline ? element.backgroundColor : element.strokeColor;\n const fillStyle = renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)(fillColor) : fillColor;\n\n if (hasOutline) {\n context.lineWidth = element.strokeWidth * outlineWidth;\n context.strokeStyle = renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)(element.strokeColor) : element.strokeColor;\n context.stroke(path);\n }\n\n return {\n path,\n fillStyle\n };\n })();\n\n context.fillStyle = fillStyle; //zsviczian\n\n context.fill(path); //zsviczian\n\n /*\n context.fillStyle =\n renderConfig.theme === THEME.DARK\n ? applyDarkModeFilter(element.strokeColor)\n : element.strokeColor;\n context.fill(new Path2D(shape));\n */\n //zsviczian\n } else {\n rc.draw(shape);\n }\n }\n\n context.restore();\n break;\n }\n\n case \"image\":\n {\n const img = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isInitializedImageElement)(element) ? (_a = renderConfig.imageCache.get(element.fileId)) === null || _a === void 0 ? void 0 : _a.image : undefined;\n\n if (img != null && !(img instanceof Promise)) {\n if (element.roundness && context.roundRect) {\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, (0,_utils__WEBPACK_IMPORTED_MODULE_10__.getCornerRadius)(Math.min(element.width, element.height), element));\n context.clip();\n }\n\n const {\n x,\n y,\n width,\n height\n } = element.crop ? element.crop : {\n x: 0,\n y: 0,\n width: img.naturalWidth,\n height: img.naturalHeight\n };\n context.drawImage(img, x, y, width, height, 0\n /* hardcoded for the selection box*/\n , 0, element.width, element.height);\n } else {\n drawImagePlaceholder(element, context);\n }\n\n break;\n }\n\n default:\n {\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isTextElement)(element)) {\n const rtl = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isRTL)(element.text);\n const shouldTemporarilyAttach = rtl && !context.canvas.isConnected;\n\n if (shouldTemporarilyAttach) {\n // to correctly render RTL text mixed with LTR, we have to append it\n // to the DOM\n document.body.appendChild(context.canvas);\n }\n\n context.canvas.setAttribute(\"dir\", rtl ? \"rtl\" : \"ltr\");\n context.save();\n context.font = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getFontString)(element);\n context.fillStyle = renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)(element.strokeColor) : element.strokeColor;\n context.textAlign = element.textAlign; // Canvas does not support multiline text by default\n\n const lines = element.text.replace(/\\r\\n?/g, \"\\n\").split(\"\\n\");\n const horizontalOffset = element.textAlign === \"center\" ? element.width / 2 : element.textAlign === \"right\" ? element.width : 0;\n const lineHeightPx = (0,_textMeasurements__WEBPACK_IMPORTED_MODULE_7__.getLineHeightInPx)(element.fontSize, element.lineHeight);\n const verticalOffset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getVerticalOffset)(element.fontFamily, element.fontSize, lineHeightPx);\n\n for (let index = 0; index < lines.length; index++) {\n context.fillText(lines[index], horizontalOffset, index * lineHeightPx + verticalOffset);\n }\n\n context.restore();\n\n if (shouldTemporarilyAttach) {\n context.canvas.remove();\n }\n } else {\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n }\n};\n\nconst elementWithCanvasCache = new WeakMap();\n\nconst generateElementWithCanvas = (element, elementsMap, renderConfig, appState) => {\n var _a;\n\n const zoom = renderConfig ? appState.zoom : {\n value: 1\n };\n const prevElementWithCanvas = elementWithCanvasCache.get(element);\n const shouldRegenerateBecauseZoom = prevElementWithCanvas && prevElementWithCanvas.zoomValue !== zoom.value && !(appState === null || appState === void 0 ? void 0 : appState.shouldCacheIgnoreZoom);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, elementsMap);\n const boundTextElementVersion = (boundTextElement === null || boundTextElement === void 0 ? void 0 : boundTextElement.version) || null;\n const imageCrop = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isImageElement)(element) ? element.crop : null;\n const containingFrameOpacity = ((_a = (0,_frame__WEBPACK_IMPORTED_MODULE_9__.getContainingFrame)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.opacity) || 100;\n\n if (!prevElementWithCanvas || shouldRegenerateBecauseZoom || prevElementWithCanvas.theme !== appState.theme || prevElementWithCanvas.boundTextElementVersion !== boundTextElementVersion || prevElementWithCanvas.imageCrop !== imageCrop || prevElementWithCanvas.containingFrameOpacity !== containingFrameOpacity || // since we rotate the canvas when copying from cached canvas, we don't\n // regenerate the cached canvas. But we need to in case of labels which are\n // cached alongside the arrow, and we want the labels to remain unrotated\n // with respect to the arrow.\n (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(element) && boundTextElement && element.angle !== prevElementWithCanvas.angle) {\n const elementWithCanvas = generateElementCanvas(element, elementsMap, zoom, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return null;\n }\n\n elementWithCanvasCache.set(element, elementWithCanvas);\n return elementWithCanvas;\n }\n\n return prevElementWithCanvas;\n};\n\nconst drawElementFromCanvas = (elementWithCanvas, context, renderConfig, appState, allElementsMap) => {\n const element = elementWithCanvas.element;\n const padding = getCanvasPadding(element);\n const zoom = elementWithCanvas.scale;\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, allElementsMap);\n const cx = ((x1 + x2) / 2 + appState.scrollX) * window.devicePixelRatio;\n const cy = ((y1 + y2) / 2 + appState.scrollY) * window.devicePixelRatio;\n context.save();\n context.scale(1 / window.devicePixelRatio, 1 / window.devicePixelRatio);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, allElementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(element) && boundTextElement) {\n const offsetX = (elementWithCanvas.boundTextCanvas.width - elementWithCanvas.canvas.width) / 2;\n const offsetY = (elementWithCanvas.boundTextCanvas.height - elementWithCanvas.canvas.height) / 2;\n context.translate(cx, cy);\n context.drawImage(elementWithCanvas.boundTextCanvas, -(x2 - x1) / 2 * window.devicePixelRatio - offsetX / zoom - padding, -(y2 - y1) / 2 * window.devicePixelRatio - offsetY / zoom - padding, elementWithCanvas.boundTextCanvas.width / zoom, elementWithCanvas.boundTextCanvas.height / zoom);\n } else {\n // we translate context to element center so that rotation and scale\n // originates from the element center\n context.translate(cx, cy);\n context.rotate(element.angle);\n\n if (\"scale\" in elementWithCanvas.element && !isPendingImageElement(element, renderConfig) && !(0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isIframeLikeElement)(element) //zsviczian\n ) {\n context.scale(elementWithCanvas.element.scale[0], elementWithCanvas.element.scale[1]);\n } // revert afterwards we don't have account for it during drawing\n\n\n context.translate(-cx, -cy);\n context.drawImage(elementWithCanvas.canvas, (x1 + appState.scrollX) * window.devicePixelRatio - padding * elementWithCanvas.scale / elementWithCanvas.scale, (y1 + appState.scrollY) * window.devicePixelRatio - padding * elementWithCanvas.scale / elementWithCanvas.scale, elementWithCanvas.canvas.width / elementWithCanvas.scale, elementWithCanvas.canvas.height / elementWithCanvas.scale);\n\n if (false) {}\n }\n\n context.restore(); // Clear the nested element we appended to the DOM\n};\n\nconst renderSelectionElement = (element, context, appState, selectionColor) => {\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.fillStyle = \"rgba(0, 0, 200, 0.04)\"; // render from 0.5px offset to get 1px wide line\n // https://stackoverflow.com/questions/7530593/html5-canvas-and-line-width/7531540#7531540\n // TODO can be be improved by offseting to the negative when user selects\n // from right to left\n\n const offset = 0.5 / appState.zoom.value;\n context.fillRect(offset, offset, element.width, element.height);\n context.lineWidth = 1.5 / appState.zoom.value; //zsviczian changed from 1 to 1.5\n\n context.strokeStyle = selectionColor;\n context.strokeRect(offset, offset, element.width, element.height);\n context.restore();\n};\nconst renderElement = (element, elementsMap, allElementsMap, rc, context, renderConfig, appState) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;\n\n const reduceAlphaForSelection = ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\" && !appState.selectedElementIds[element.id] && !appState.hoveredElementIds[element.id];\n context.globalAlpha = getRenderOpacity(element, (0,_frame__WEBPACK_IMPORTED_MODULE_9__.getContainingFrame)(element, elementsMap), renderConfig.elementsPendingErasure, renderConfig.pendingFlowchartNodes, reduceAlphaForSelection ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_REDUCED_GLOBAL_ALPHA : 1);\n\n switch (element.type) {\n case \"magicframe\":\n case \"frame\":\n {\n if ( //zsviczian\n appState.frameRendering.enabled && appState.frameRendering.outline && !(!appState.frameRendering.markerEnabled && element.frameRole === \"marker\")) {\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.fillStyle = (_f = (_d = (_c = (_b = element.customData) === null || _b === void 0 ? void 0 : _b.frameColor) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : (_e = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _e === void 0 ? void 0 : _e.fill) !== null && _f !== void 0 ? _f : \"rgba(0, 0, 200, 0.04)\"; //zsviczian\n\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)((_l = (_j = (_h = (_g = element.customData) === null || _g === void 0 ? void 0 : _g.frameColor) === null || _h === void 0 ? void 0 : _h.stroke) !== null && _j !== void 0 ? _j : (_k = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _k === void 0 ? void 0 : _k.stroke) !== null && _l !== void 0 ? _l : _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeColor) : (_r = (_p = (_o = (_m = element.customData) === null || _m === void 0 ? void 0 : _m.frameColor) === null || _o === void 0 ? void 0 : _o.stroke) !== null && _p !== void 0 ? _p : (_q = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _q === void 0 ? void 0 : _q.stroke) !== null && _r !== void 0 ? _r : _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeColor; //zsviczian\n // TODO change later to only affect AI frames\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isMagicFrameElement)(element)) {\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.LIGHT ? \"#7affd7\" : (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)(\"#1d8264\");\n } //zsviczian\n\n\n if (element.frameRole === \"marker\") {\n const dash = 8 / appState.zoom.value;\n const gap = 6 / appState.zoom.value;\n context.setLineDash([dash, gap]);\n }\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect && element.frameRole !== \"marker\") {\n //zsviczian\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n context.stroke();\n context.closePath();\n } else {\n context.strokeRect(0, 0, element.width, element.height);\n }\n\n context.restore();\n }\n\n break;\n }\n\n case \"freedraw\":\n {\n if (renderConfig.isExporting) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap);\n const cx = (x1 + x2) / 2 + appState.scrollX;\n const cy = (y1 + y2) / 2 + appState.scrollY;\n const shiftX = (x2 - x1) / 2 - (element.x - x1);\n const shiftY = (y2 - y1) / 2 - (element.y - y1);\n context.save();\n context.translate(cx, cy);\n context.rotate(element.angle);\n context.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, rc, context, renderConfig);\n context.restore();\n } else {\n const elementWithCanvas = generateElementWithCanvas(element, allElementsMap, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return;\n }\n\n drawElementFromCanvas(elementWithCanvas, context, renderConfig, appState, allElementsMap);\n }\n\n break;\n }\n\n case \"rectangle\":\n case \"diamond\":\n case \"ellipse\":\n case \"line\":\n case \"arrow\":\n case \"image\":\n case \"text\":\n case \"iframe\":\n case \"embeddable\":\n {\n if (renderConfig.isExporting) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap);\n const cx = (x1 + x2) / 2 + appState.scrollX;\n const cy = (y1 + y2) / 2 + appState.scrollY;\n let shiftX = (x2 - x1) / 2 - (element.x - x1);\n let shiftY = (y2 - y1) / 2 - (element.y - y1);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isTextElement)(element)) {\n const container = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getContainerElement)(element, elementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(container)) {\n const boundTextCoords = _linearElementEditor__WEBPACK_IMPORTED_MODULE_5__.LinearElementEditor.getBoundTextElementPosition(container, element, elementsMap);\n shiftX = (x2 - x1) / 2 - (boundTextCoords.x - x1);\n shiftY = (y2 - y1) / 2 - (boundTextCoords.y - y1);\n }\n }\n\n context.save();\n context.translate(cx, cy);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, elementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(element) && boundTextElement) {\n const tempCanvas = document.createElement(\"canvas\");\n const tempCanvasContext = tempCanvas.getContext(\"2d\"); // Take max dimensions of arrow canvas so that when canvas is rotated\n // the arrow doesn't get clipped\n\n const maxDim = Math.max((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(x1, x2), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(y1, y2));\n const padding = getCanvasPadding(element);\n tempCanvas.width = maxDim * appState.exportScale + padding * 10 * appState.exportScale;\n tempCanvas.height = maxDim * appState.exportScale + padding * 10 * appState.exportScale;\n tempCanvasContext.translate(tempCanvas.width / 2, tempCanvas.height / 2);\n tempCanvasContext.scale(appState.exportScale, appState.exportScale); // Shift the canvas to left most point of the arrow\n\n shiftX = element.width / 2 - (element.x - x1);\n shiftY = element.height / 2 - (element.y - y1);\n tempCanvasContext.rotate(element.angle);\n const tempRc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__[\"default\"].canvas(tempCanvas);\n tempCanvasContext.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, tempRc, tempCanvasContext, renderConfig);\n tempCanvasContext.translate(shiftX, shiftY);\n tempCanvasContext.rotate(-element.angle); // Shift the canvas to center of bound text\n\n const [,,,, boundTextCx, boundTextCy] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(boundTextElement, elementsMap);\n const boundTextShiftX = (x1 + x2) / 2 - boundTextCx;\n const boundTextShiftY = (y1 + y2) / 2 - boundTextCy;\n tempCanvasContext.translate(-boundTextShiftX, -boundTextShiftY); // Clear the bound text area\n\n tempCanvasContext.clearRect(-boundTextElement.width / 2, -boundTextElement.height / 2, boundTextElement.width, boundTextElement.height);\n context.scale(1 / appState.exportScale, 1 / appState.exportScale);\n context.drawImage(tempCanvas, -tempCanvas.width / 2, -tempCanvas.height / 2, tempCanvas.width, tempCanvas.height);\n } else {\n context.rotate(element.angle);\n\n if (element.type === \"image\") {\n // note: scale must be applied *after* rotating\n context.scale(element.scale[0], element.scale[1]);\n }\n\n context.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, rc, context, renderConfig);\n }\n\n context.restore(); // not exporting → optimized rendering (cache & render from element\n // canvases)\n } else {\n const elementWithCanvas = generateElementWithCanvas(element, allElementsMap, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return;\n }\n\n const currentImageSmoothingStatus = context.imageSmoothingEnabled;\n\n if ( // do not disable smoothing during zoom as blurry shapes look better\n // on low resolution (while still zooming in) than sharp ones\n !(appState === null || appState === void 0 ? void 0 : appState.shouldCacheIgnoreZoom) && ( // angle is 0 -> always disable smoothing\n !element.angle || // or check if angle is a right angle in which case we can still\n // disable smoothing without adversely affecting the result\n // We need less-than comparison because of FP artihmetic\n (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.isRightAngleRads)(element.angle))) {\n // Disabling smoothing makes output much sharper, especially for\n // text. Unless for non-right angles, where the aliasing is really\n // terrible on Chromium.\n //\n // Note that `context.imageSmoothingQuality=\"high\"` has almost\n // zero effect.\n //\n context.imageSmoothingEnabled = false;\n }\n\n if (element.id === appState.croppingElementId && (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isImageElement)(elementWithCanvas.element) && elementWithCanvas.element.crop !== null) {\n context.save();\n context.globalAlpha = 0.1;\n const uncroppedElementCanvas = generateElementCanvas((0,_cropElement__WEBPACK_IMPORTED_MODULE_4__.getUncroppedImageElement)(elementWithCanvas.element, elementsMap), allElementsMap, appState.zoom, renderConfig, appState);\n\n if (uncroppedElementCanvas) {\n drawElementFromCanvas(uncroppedElementCanvas, context, renderConfig, appState, allElementsMap);\n }\n\n context.restore();\n }\n\n drawElementFromCanvas(elementWithCanvas, context, renderConfig, appState, allElementsMap); // reset\n\n context.imageSmoothingEnabled = currentImageSmoothingStatus;\n }\n\n break;\n }\n\n default:\n {\n // @ts-ignore\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n\n context.globalAlpha = 1;\n};\nfunction getFreedrawOutlineAsSegments(element, points, elementsMap) {\n const bounds = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementBounds)(Object.assign(Object.assign({}, element), {\n angle: 0\n }), elementsMap);\n const center = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointFrom)((bounds[0] + bounds[2]) / 2, (bounds[1] + bounds[3]) / 2);\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.invariant)(points.length >= 2, \"Freepath outline must have at least 2 points\");\n return points.slice(2).reduce((acc, curr) => {\n acc.push((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.lineSegment)(acc[acc.length - 1][1], (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointFrom)(curr[0] + element.x, curr[1] + element.y), center, element.angle)));\n return acc;\n }, [(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.lineSegment)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointFrom)(points[0][0] + element.x, points[0][1] + element.y), center, element.angle), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointFrom)(points[1][0] + element.x, points[1][1] + element.y), center, element.angle))]);\n}\n\n//# sourceURL=webpack://ExcalidrawLib/../element/src/renderElement.ts?");
|
|
14679
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_LINK_SIZE: () => (/* binding */ DEFAULT_LINK_SIZE),\n/* harmony export */ elementWithCanvasCache: () => (/* binding */ elementWithCanvasCache),\n/* harmony export */ getFreedrawOutlineAsSegments: () => (/* binding */ getFreedrawOutlineAsSegments),\n/* harmony export */ getRenderOpacity: () => (/* binding */ getRenderOpacity),\n/* harmony export */ renderElement: () => (/* binding */ renderElement),\n/* harmony export */ renderSelectionElement: () => (/* binding */ renderSelectionElement)\n/* harmony export */ });\n/* harmony import */ var roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! roughjs/bin/rough */ \"../../node_modules/roughjs/bin/rough.js\");\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _bounds__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bounds */ \"../element/src/bounds.ts\");\n/* harmony import */ var _cropElement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cropElement */ \"../element/src/cropElement.ts\");\n/* harmony import */ var _linearElementEditor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./linearElementEditor */ \"../element/src/linearElementEditor.ts\");\n/* harmony import */ var _textElement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./textElement */ \"../element/src/textElement.ts\");\n/* harmony import */ var _textMeasurements__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./textMeasurements */ \"../element/src/textMeasurements.ts\");\n/* harmony import */ var _typeChecks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @excalidraw/element/typeChecks */ \"../element/src/typeChecks.ts\");\n/* harmony import */ var _frame__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./frame */ \"../element/src/frame.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ \"../element/src/utils.ts\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./shape */ \"../element/src/shape.ts\");\n/* harmony import */ var _freedrawPath__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./freedrawPath */ \"../element/src/freedrawPath.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst isPendingImageElement = (element, renderConfig) => (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isInitializedImageElement)(element) && !renderConfig.imageCache.has(element.fileId);\n\nconst getCanvasPadding = element => {\n switch (element.type) {\n case \"freedraw\":\n return element.strokeWidth * 12;\n\n case \"text\":\n return element.fontSize / 2;\n\n case \"arrow\":\n if (element.endArrowhead || element.endArrowhead) {\n return 40;\n }\n\n return 20;\n\n default:\n return 20;\n }\n};\n\nconst getRenderOpacity = (element, containingFrame, elementsPendingErasure, pendingNodes, globalAlpha = 1) => {\n var _a; // multiplying frame opacity with element opacity to combine them\n // (e.g. frame 50% and element 50% opacity should result in 25% opacity)\n\n\n let opacity = ((_a = containingFrame === null || containingFrame === void 0 ? void 0 : containingFrame.opacity) !== null && _a !== void 0 ? _a : 100) * element.opacity / 10000 * globalAlpha; // if pending erasure, multiply again to combine further\n // (so that erasing always results in lower opacity than original)\n\n if (elementsPendingErasure.has(element.id) || pendingNodes && pendingNodes.some(node => node.id === element.id) || containingFrame && elementsPendingErasure.has(containingFrame.id)) {\n opacity *= _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_READY_TO_ERASE_OPACITY / 100;\n }\n\n return opacity;\n};\n\nconst cappedElementCanvasSize = (element, elementsMap, zoom) => {\n // these limits are ballpark, they depend on specific browsers and device.\n // We've chosen lower limits to be safe. We might want to change these limits\n // based on browser/device type, if we get reports of low quality rendering\n // on zoom.\n //\n // ~ safari mobile canvas area limit\n const AREA_LIMIT = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getAreaLimit)(); //zsviczian\n // ~ safari width/height limit based on developer.mozilla.org.\n\n const WIDTH_HEIGHT_LIMIT = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getWidthHeightLimit)(); //zsviczian\n\n const padding = getCanvasPadding(element);\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap);\n const elementWidth = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isFreeDrawElement)(element) ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(x1, x2) : element.width;\n const elementHeight = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isFreeDrawElement)(element) ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(y1, y2) : element.height;\n let width = elementWidth * window.devicePixelRatio + padding * 2;\n let height = elementHeight * window.devicePixelRatio + padding * 2;\n let scale = zoom.value; // rescale to ensure width and height is within limits\n\n if (width * scale > WIDTH_HEIGHT_LIMIT || height * scale > WIDTH_HEIGHT_LIMIT) {\n scale = Math.min(WIDTH_HEIGHT_LIMIT / width, WIDTH_HEIGHT_LIMIT / height);\n } // rescale to ensure canvas area is within limits\n\n\n if (width * height * scale * scale > AREA_LIMIT) {\n scale = Math.sqrt(AREA_LIMIT / (width * height));\n }\n\n width = Math.floor(width * scale);\n height = Math.floor(height * scale);\n return {\n width,\n height,\n scale\n };\n};\n\nconst generateElementCanvas = (element, elementsMap, zoom, renderConfig, appState) => {\n var _a, _b;\n\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n const padding = getCanvasPadding(element);\n const {\n width,\n height,\n scale\n } = cappedElementCanvasSize(element, elementsMap, zoom);\n\n if (!width || !height) {\n return null;\n }\n\n canvas.width = width;\n canvas.height = height;\n let canvasOffsetX = -100;\n let canvasOffsetY = 0;\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isFreeDrawElement)(element)) {\n const [x1, y1] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap);\n canvasOffsetX = element.x > x1 ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(element.x, x1) * window.devicePixelRatio * scale : 0;\n canvasOffsetY = element.y > y1 ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(element.y, y1) * window.devicePixelRatio * scale : 0;\n context.translate(canvasOffsetX, canvasOffsetY);\n }\n\n context.save();\n context.translate(padding * scale, padding * scale);\n context.scale(window.devicePixelRatio * scale, window.devicePixelRatio * scale);\n const rc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__[\"default\"].canvas(canvas);\n drawElementOnCanvas(element, rc, context, renderConfig);\n context.restore();\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, elementsMap);\n const boundTextCanvas = document.createElement(\"canvas\");\n const boundTextCanvasContext = boundTextCanvas.getContext(\"2d\");\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(element) && boundTextElement) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap); // Take max dimensions of arrow canvas so that when canvas is rotated\n // the arrow doesn't get clipped\n\n const maxDim = Math.max((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(x1, x2), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(y1, y2));\n boundTextCanvas.width = maxDim * window.devicePixelRatio * scale + padding * scale * 10;\n boundTextCanvas.height = maxDim * window.devicePixelRatio * scale + padding * scale * 10;\n boundTextCanvasContext.translate(boundTextCanvas.width / 2, boundTextCanvas.height / 2);\n boundTextCanvasContext.rotate(element.angle);\n boundTextCanvasContext.drawImage(canvas, -canvas.width / 2, -canvas.height / 2, canvas.width, canvas.height);\n const [,,,, boundTextCx, boundTextCy] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(boundTextElement, elementsMap);\n boundTextCanvasContext.rotate(-element.angle);\n const offsetX = (boundTextCanvas.width - canvas.width) / 2;\n const offsetY = (boundTextCanvas.height - canvas.height) / 2;\n const shiftX = boundTextCanvas.width / 2 - (boundTextCx - x1) * window.devicePixelRatio * scale - offsetX - padding * scale;\n const shiftY = boundTextCanvas.height / 2 - (boundTextCy - y1) * window.devicePixelRatio * scale - offsetY - padding * scale;\n boundTextCanvasContext.translate(-shiftX, -shiftY); // Clear the bound text area\n\n boundTextCanvasContext.clearRect(-(boundTextElement.width / 2 + _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING) * window.devicePixelRatio * scale, -(boundTextElement.height / 2 + _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING) * window.devicePixelRatio * scale, (boundTextElement.width + _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING * 2) * window.devicePixelRatio * scale, (boundTextElement.height + _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING * 2) * window.devicePixelRatio * scale);\n }\n\n return {\n element,\n canvas,\n theme: appState.theme,\n scale,\n zoomValue: zoom.value,\n canvasOffsetX,\n canvasOffsetY,\n boundTextElementVersion: ((_a = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.version) || null,\n containingFrameOpacity: ((_b = (0,_frame__WEBPACK_IMPORTED_MODULE_9__.getContainingFrame)(element, elementsMap)) === null || _b === void 0 ? void 0 : _b.opacity) || 100,\n boundTextCanvas,\n angle: element.angle,\n imageCrop: (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isImageElement)(element) ? element.crop : null\n };\n};\n\nconst DEFAULT_LINK_SIZE = 14;\nconst IMAGE_PLACEHOLDER_IMG = typeof document !== \"undefined\" ? document.createElement(\"img\") : {\n src: \"\"\n}; // mock image element outside of browser\n\nIMAGE_PLACEHOLDER_IMG.src = `data:${_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.MIME_TYPES.svg},${encodeURIComponent(`<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"image\" class=\"svg-inline--fa fa-image fa-w-16\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"#888\" d=\"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z\"></path></svg>`)}`;\nconst IMAGE_ERROR_PLACEHOLDER_IMG = typeof document !== \"undefined\" ? document.createElement(\"img\") : {\n src: \"\"\n}; // mock image element outside of browser\n\nIMAGE_ERROR_PLACEHOLDER_IMG.src = `data:${_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.MIME_TYPES.svg},${encodeURIComponent(`<svg viewBox=\"0 0 668 668\" xmlns=\"http://www.w3.org/2000/svg\" xml:space=\"preserve\" style=\"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2\"><path d=\"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z\" style=\"fill:#888;fill-rule:nonzero\" transform=\"matrix(.81709 0 0 .81709 124.825 145.825)\"/><path d=\"M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z\" style=\"fill:#888;fill-rule:nonzero\" transform=\"matrix(.30366 0 0 .30366 506.822 60.065)\"/></svg>`)}`;\n\nconst drawImagePlaceholder = (element, context) => {\n context.fillStyle = \"#E7E7E7\";\n context.fillRect(0, 0, element.width, element.height);\n const imageMinWidthOrHeight = Math.min(element.width, element.height);\n const size = Math.min(imageMinWidthOrHeight, Math.min(imageMinWidthOrHeight * 0.4, 100));\n context.drawImage(element.status === \"error\" ? IMAGE_ERROR_PLACEHOLDER_IMG : IMAGE_PLACEHOLDER_IMG, element.width / 2 - size / 2, element.height / 2 - size / 2, size, size);\n};\n\nconst drawElementOnCanvas = (element, rc, context, renderConfig) => {\n var _a, _b;\n\n switch (element.type) {\n case \"rectangle\":\n case \"iframe\":\n case \"embeddable\":\n case \"diamond\":\n case \"ellipse\":\n {\n context.lineJoin = \"round\";\n context.lineCap = \"round\";\n rc.draw(_shape__WEBPACK_IMPORTED_MODULE_11__.ShapeCache.generateElementShape(element, renderConfig));\n break;\n }\n\n case \"arrow\":\n case \"line\":\n {\n context.lineJoin = \"round\";\n context.lineCap = \"round\";\n _shape__WEBPACK_IMPORTED_MODULE_11__.ShapeCache.generateElementShape(element, renderConfig).forEach(shape => {\n rc.draw(shape);\n });\n break;\n }\n\n case \"freedraw\":\n {\n // Draw directly to canvas\n context.save();\n const shapes = _shape__WEBPACK_IMPORTED_MODULE_11__.ShapeCache.generateElementShape(element, renderConfig);\n\n for (const shape of shapes) {\n if (typeof shape === \"string\") {\n const {\n path,\n fillStyle\n } = (() => {\n var _a, _b, _c, _d, _e;\n\n const path = new Path2D((0,_freedrawPath__WEBPACK_IMPORTED_MODULE_12__.getFreeDrawSvgPath)(element));\n const hasOutline = (_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.strokeOptions) === null || _b === void 0 ? void 0 : _b.hasOutline;\n const outlineWidth = (_e = (_d = (_c = element.customData) === null || _c === void 0 ? void 0 : _c.strokeOptions) === null || _d === void 0 ? void 0 : _d.outlineWidth) !== null && _e !== void 0 ? _e : 1;\n const fillColor = hasOutline ? element.backgroundColor : element.strokeColor;\n const fillStyle = renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)(fillColor) : fillColor;\n\n if (hasOutline) {\n context.lineWidth = element.strokeWidth * outlineWidth;\n context.strokeStyle = renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)(element.strokeColor) : element.strokeColor;\n context.stroke(path);\n }\n\n return {\n path,\n fillStyle\n };\n })();\n\n context.fillStyle = fillStyle; //zsviczian\n\n context.fill(path); //zsviczian\n\n /*\n context.fillStyle =\n renderConfig.theme === THEME.DARK\n ? applyDarkModeFilter(element.strokeColor)\n : element.strokeColor;\n context.fill(new Path2D(shape));\n */\n //zsviczian\n } else {\n rc.draw(shape);\n }\n }\n\n context.restore();\n break;\n }\n\n case \"image\":\n {\n context.save();\n const cacheEntry = element.fileId !== null ? renderConfig.imageCache.get(element.fileId) : null;\n const img = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isInitializedImageElement)(element) ? cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.image : undefined;\n const shouldInvertImage = renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK && ((cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.mimeType) === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.MIME_TYPES.svg || !!((_a = element.customData) === null || _a === void 0 ? void 0 : _a.pdfPageViewProps) || !!((_b = element.customData) === null || _b === void 0 ? void 0 : _b.invertInDarkmode)); //zsviczian\n\n if (shouldInvertImage) {\n context.filter = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DARK_THEME_FILTER;\n }\n\n if (img != null && !(img instanceof Promise)) {\n if (element.roundness && context.roundRect) {\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, (0,_utils__WEBPACK_IMPORTED_MODULE_10__.getCornerRadius)(Math.min(element.width, element.height), element));\n context.clip();\n }\n\n const {\n x,\n y,\n width,\n height\n } = element.crop ? element.crop : {\n x: 0,\n y: 0,\n width: img.naturalWidth,\n height: img.naturalHeight\n };\n context.drawImage(img, x, y, width, height, 0\n /* hardcoded for the selection box*/\n , 0, element.width, element.height);\n } else {\n drawImagePlaceholder(element, context);\n }\n\n context.restore();\n break;\n }\n\n default:\n {\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isTextElement)(element)) {\n const rtl = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isRTL)(element.text);\n const shouldTemporarilyAttach = rtl && !context.canvas.isConnected;\n\n if (shouldTemporarilyAttach) {\n // to correctly render RTL text mixed with LTR, we have to append it\n // to the DOM\n document.body.appendChild(context.canvas);\n }\n\n context.canvas.setAttribute(\"dir\", rtl ? \"rtl\" : \"ltr\");\n context.save();\n context.font = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getFontString)(element);\n context.fillStyle = renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)(element.strokeColor) : element.strokeColor;\n context.textAlign = element.textAlign; // Canvas does not support multiline text by default\n\n const lines = element.text.replace(/\\r\\n?/g, \"\\n\").split(\"\\n\");\n const horizontalOffset = element.textAlign === \"center\" ? element.width / 2 : element.textAlign === \"right\" ? element.width : 0;\n const lineHeightPx = (0,_textMeasurements__WEBPACK_IMPORTED_MODULE_7__.getLineHeightInPx)(element.fontSize, element.lineHeight);\n const verticalOffset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getVerticalOffset)(element.fontFamily, element.fontSize, lineHeightPx);\n\n for (let index = 0; index < lines.length; index++) {\n context.fillText(lines[index], horizontalOffset, index * lineHeightPx + verticalOffset);\n }\n\n context.restore();\n\n if (shouldTemporarilyAttach) {\n context.canvas.remove();\n }\n } else {\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n }\n};\n\nconst elementWithCanvasCache = new WeakMap();\n\nconst generateElementWithCanvas = (element, elementsMap, renderConfig, appState) => {\n var _a;\n\n const zoom = renderConfig ? appState.zoom : {\n value: 1\n };\n const prevElementWithCanvas = elementWithCanvasCache.get(element);\n const shouldRegenerateBecauseZoom = prevElementWithCanvas && prevElementWithCanvas.zoomValue !== zoom.value && !(appState === null || appState === void 0 ? void 0 : appState.shouldCacheIgnoreZoom);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, elementsMap);\n const boundTextElementVersion = (boundTextElement === null || boundTextElement === void 0 ? void 0 : boundTextElement.version) || null;\n const imageCrop = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isImageElement)(element) ? element.crop : null;\n const containingFrameOpacity = ((_a = (0,_frame__WEBPACK_IMPORTED_MODULE_9__.getContainingFrame)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.opacity) || 100;\n\n if (!prevElementWithCanvas || shouldRegenerateBecauseZoom || prevElementWithCanvas.theme !== appState.theme || prevElementWithCanvas.boundTextElementVersion !== boundTextElementVersion || prevElementWithCanvas.imageCrop !== imageCrop || prevElementWithCanvas.containingFrameOpacity !== containingFrameOpacity || // since we rotate the canvas when copying from cached canvas, we don't\n // regenerate the cached canvas. But we need to in case of labels which are\n // cached alongside the arrow, and we want the labels to remain unrotated\n // with respect to the arrow.\n (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(element) && boundTextElement && element.angle !== prevElementWithCanvas.angle) {\n const elementWithCanvas = generateElementCanvas(element, elementsMap, zoom, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return null;\n }\n\n elementWithCanvasCache.set(element, elementWithCanvas);\n return elementWithCanvas;\n }\n\n return prevElementWithCanvas;\n};\n\nconst drawElementFromCanvas = (elementWithCanvas, context, renderConfig, appState, allElementsMap) => {\n const element = elementWithCanvas.element;\n const padding = getCanvasPadding(element);\n const zoom = elementWithCanvas.scale;\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, allElementsMap);\n const cx = ((x1 + x2) / 2 + appState.scrollX) * window.devicePixelRatio;\n const cy = ((y1 + y2) / 2 + appState.scrollY) * window.devicePixelRatio;\n context.save();\n context.scale(1 / window.devicePixelRatio, 1 / window.devicePixelRatio);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, allElementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(element) && boundTextElement) {\n const offsetX = (elementWithCanvas.boundTextCanvas.width - elementWithCanvas.canvas.width) / 2;\n const offsetY = (elementWithCanvas.boundTextCanvas.height - elementWithCanvas.canvas.height) / 2;\n context.translate(cx, cy);\n context.drawImage(elementWithCanvas.boundTextCanvas, -(x2 - x1) / 2 * window.devicePixelRatio - offsetX / zoom - padding, -(y2 - y1) / 2 * window.devicePixelRatio - offsetY / zoom - padding, elementWithCanvas.boundTextCanvas.width / zoom, elementWithCanvas.boundTextCanvas.height / zoom);\n } else {\n // we translate context to element center so that rotation and scale\n // originates from the element center\n context.translate(cx, cy);\n context.rotate(element.angle);\n\n if (\"scale\" in elementWithCanvas.element && !isPendingImageElement(element, renderConfig) && !(0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isIframeLikeElement)(element) //zsviczian\n ) {\n context.scale(elementWithCanvas.element.scale[0], elementWithCanvas.element.scale[1]);\n } // revert afterwards we don't have account for it during drawing\n\n\n context.translate(-cx, -cy);\n context.drawImage(elementWithCanvas.canvas, (x1 + appState.scrollX) * window.devicePixelRatio - padding * elementWithCanvas.scale / elementWithCanvas.scale, (y1 + appState.scrollY) * window.devicePixelRatio - padding * elementWithCanvas.scale / elementWithCanvas.scale, elementWithCanvas.canvas.width / elementWithCanvas.scale, elementWithCanvas.canvas.height / elementWithCanvas.scale);\n\n if (false) {}\n }\n\n context.restore(); // Clear the nested element we appended to the DOM\n};\n\nconst renderSelectionElement = (element, context, appState, selectionColor) => {\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.fillStyle = \"rgba(0, 0, 200, 0.04)\"; // render from 0.5px offset to get 1px wide line\n // https://stackoverflow.com/questions/7530593/html5-canvas-and-line-width/7531540#7531540\n // TODO can be be improved by offseting to the negative when user selects\n // from right to left\n\n const offset = 0.5 / appState.zoom.value;\n context.fillRect(offset, offset, element.width, element.height);\n context.lineWidth = 1.5 / appState.zoom.value; //zsviczian changed from 1 to 1.5\n\n context.strokeStyle = selectionColor;\n context.strokeRect(offset, offset, element.width, element.height);\n context.restore();\n};\nconst renderElement = (element, elementsMap, allElementsMap, rc, context, renderConfig, appState) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;\n\n const reduceAlphaForSelection = ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\" && !appState.selectedElementIds[element.id] && !appState.hoveredElementIds[element.id];\n context.globalAlpha = getRenderOpacity(element, (0,_frame__WEBPACK_IMPORTED_MODULE_9__.getContainingFrame)(element, elementsMap), renderConfig.elementsPendingErasure, renderConfig.pendingFlowchartNodes, reduceAlphaForSelection ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_REDUCED_GLOBAL_ALPHA : 1);\n\n switch (element.type) {\n case \"magicframe\":\n case \"frame\":\n {\n if ( //zsviczian\n appState.frameRendering.enabled && appState.frameRendering.outline && !(!appState.frameRendering.markerEnabled && element.frameRole === \"marker\")) {\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.fillStyle = (_f = (_d = (_c = (_b = element.customData) === null || _b === void 0 ? void 0 : _b.frameColor) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : (_e = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _e === void 0 ? void 0 : _e.fill) !== null && _f !== void 0 ? _f : \"rgba(0, 0, 200, 0.04)\"; //zsviczian\n\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)((_l = (_j = (_h = (_g = element.customData) === null || _g === void 0 ? void 0 : _g.frameColor) === null || _h === void 0 ? void 0 : _h.stroke) !== null && _j !== void 0 ? _j : (_k = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _k === void 0 ? void 0 : _k.stroke) !== null && _l !== void 0 ? _l : _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeColor) : (_r = (_p = (_o = (_m = element.customData) === null || _m === void 0 ? void 0 : _m.frameColor) === null || _o === void 0 ? void 0 : _o.stroke) !== null && _p !== void 0 ? _p : (_q = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _q === void 0 ? void 0 : _q.stroke) !== null && _r !== void 0 ? _r : _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeColor; //zsviczian\n // TODO change later to only affect AI frames\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isMagicFrameElement)(element)) {\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.LIGHT ? \"#7affd7\" : (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.applyDarkModeFilter)(\"#1d8264\");\n } //zsviczian\n\n\n if (element.frameRole === \"marker\") {\n const dash = 8 / appState.zoom.value;\n const gap = 6 / appState.zoom.value;\n context.setLineDash([dash, gap]);\n }\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect && element.frameRole !== \"marker\") {\n //zsviczian\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n context.stroke();\n context.closePath();\n } else {\n context.strokeRect(0, 0, element.width, element.height);\n }\n\n context.restore();\n }\n\n break;\n }\n\n case \"freedraw\":\n {\n if (renderConfig.isExporting) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap);\n const cx = (x1 + x2) / 2 + appState.scrollX;\n const cy = (y1 + y2) / 2 + appState.scrollY;\n const shiftX = (x2 - x1) / 2 - (element.x - x1);\n const shiftY = (y2 - y1) / 2 - (element.y - y1);\n context.save();\n context.translate(cx, cy);\n context.rotate(element.angle);\n context.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, rc, context, renderConfig);\n context.restore();\n } else {\n const elementWithCanvas = generateElementWithCanvas(element, allElementsMap, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return;\n }\n\n drawElementFromCanvas(elementWithCanvas, context, renderConfig, appState, allElementsMap);\n }\n\n break;\n }\n\n case \"rectangle\":\n case \"diamond\":\n case \"ellipse\":\n case \"line\":\n case \"arrow\":\n case \"image\":\n case \"text\":\n case \"iframe\":\n case \"embeddable\":\n {\n if (renderConfig.isExporting) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap);\n const cx = (x1 + x2) / 2 + appState.scrollX;\n const cy = (y1 + y2) / 2 + appState.scrollY;\n let shiftX = (x2 - x1) / 2 - (element.x - x1);\n let shiftY = (y2 - y1) / 2 - (element.y - y1);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isTextElement)(element)) {\n const container = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getContainerElement)(element, elementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(container)) {\n const boundTextCoords = _linearElementEditor__WEBPACK_IMPORTED_MODULE_5__.LinearElementEditor.getBoundTextElementPosition(container, element, elementsMap);\n shiftX = (x2 - x1) / 2 - (boundTextCoords.x - x1);\n shiftY = (y2 - y1) / 2 - (boundTextCoords.y - y1);\n }\n }\n\n context.save();\n context.translate(cx, cy);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_6__.getBoundTextElement)(element, elementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isArrowElement)(element) && boundTextElement) {\n const tempCanvas = document.createElement(\"canvas\");\n const tempCanvasContext = tempCanvas.getContext(\"2d\"); // Take max dimensions of arrow canvas so that when canvas is rotated\n // the arrow doesn't get clipped\n\n const maxDim = Math.max((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(x1, x2), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.distance)(y1, y2));\n const padding = getCanvasPadding(element);\n tempCanvas.width = maxDim * appState.exportScale + padding * 10 * appState.exportScale;\n tempCanvas.height = maxDim * appState.exportScale + padding * 10 * appState.exportScale;\n tempCanvasContext.translate(tempCanvas.width / 2, tempCanvas.height / 2);\n tempCanvasContext.scale(appState.exportScale, appState.exportScale); // Shift the canvas to left most point of the arrow\n\n shiftX = element.width / 2 - (element.x - x1);\n shiftY = element.height / 2 - (element.y - y1);\n tempCanvasContext.rotate(element.angle);\n const tempRc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__[\"default\"].canvas(tempCanvas);\n tempCanvasContext.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, tempRc, tempCanvasContext, renderConfig);\n tempCanvasContext.translate(shiftX, shiftY);\n tempCanvasContext.rotate(-element.angle); // Shift the canvas to center of bound text\n\n const [,,,, boundTextCx, boundTextCy] = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(boundTextElement, elementsMap);\n const boundTextShiftX = (x1 + x2) / 2 - boundTextCx;\n const boundTextShiftY = (y1 + y2) / 2 - boundTextCy;\n tempCanvasContext.translate(-boundTextShiftX, -boundTextShiftY); // Clear the bound text area\n\n tempCanvasContext.clearRect(-boundTextElement.width / 2, -boundTextElement.height / 2, boundTextElement.width, boundTextElement.height);\n context.scale(1 / appState.exportScale, 1 / appState.exportScale);\n context.drawImage(tempCanvas, -tempCanvas.width / 2, -tempCanvas.height / 2, tempCanvas.width, tempCanvas.height);\n } else {\n context.rotate(element.angle);\n\n if (element.type === \"image\") {\n // note: scale must be applied *after* rotating\n context.scale(element.scale[0], element.scale[1]);\n }\n\n context.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, rc, context, renderConfig);\n }\n\n context.restore(); // not exporting → optimized rendering (cache & render from element\n // canvases)\n } else {\n const elementWithCanvas = generateElementWithCanvas(element, allElementsMap, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return;\n }\n\n const currentImageSmoothingStatus = context.imageSmoothingEnabled;\n\n if ( // do not disable smoothing during zoom as blurry shapes look better\n // on low resolution (while still zooming in) than sharp ones\n !(appState === null || appState === void 0 ? void 0 : appState.shouldCacheIgnoreZoom) && ( // angle is 0 -> always disable smoothing\n !element.angle || // or check if angle is a right angle in which case we can still\n // disable smoothing without adversely affecting the result\n // We need less-than comparison because of FP artihmetic\n (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.isRightAngleRads)(element.angle))) {\n // Disabling smoothing makes output much sharper, especially for\n // text. Unless for non-right angles, where the aliasing is really\n // terrible on Chromium.\n //\n // Note that `context.imageSmoothingQuality=\"high\"` has almost\n // zero effect.\n //\n context.imageSmoothingEnabled = false;\n }\n\n if (element.id === appState.croppingElementId && (0,_typeChecks__WEBPACK_IMPORTED_MODULE_8__.isImageElement)(elementWithCanvas.element) && elementWithCanvas.element.crop !== null) {\n context.save();\n context.globalAlpha = 0.1;\n const uncroppedElementCanvas = generateElementCanvas((0,_cropElement__WEBPACK_IMPORTED_MODULE_4__.getUncroppedImageElement)(elementWithCanvas.element, elementsMap), allElementsMap, appState.zoom, renderConfig, appState);\n\n if (uncroppedElementCanvas) {\n drawElementFromCanvas(uncroppedElementCanvas, context, renderConfig, appState, allElementsMap);\n }\n\n context.restore();\n }\n\n drawElementFromCanvas(elementWithCanvas, context, renderConfig, appState, allElementsMap); // reset\n\n context.imageSmoothingEnabled = currentImageSmoothingStatus;\n }\n\n break;\n }\n\n default:\n {\n // @ts-ignore\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n\n context.globalAlpha = 1;\n};\nfunction getFreedrawOutlineAsSegments(element, points, elementsMap) {\n const bounds = (0,_bounds__WEBPACK_IMPORTED_MODULE_3__.getElementBounds)(Object.assign(Object.assign({}, element), {\n angle: 0\n }), elementsMap);\n const center = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointFrom)((bounds[0] + bounds[2]) / 2, (bounds[1] + bounds[3]) / 2);\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.invariant)(points.length >= 2, \"Freepath outline must have at least 2 points\");\n return points.slice(2).reduce((acc, curr) => {\n acc.push((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.lineSegment)(acc[acc.length - 1][1], (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointFrom)(curr[0] + element.x, curr[1] + element.y), center, element.angle)));\n return acc;\n }, [(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.lineSegment)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointFrom)(points[0][0] + element.x, points[0][1] + element.y), center, element.angle), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_1__.pointFrom)(points[1][0] + element.x, points[1][1] + element.y), center, element.angle))]);\n}\n\n//# sourceURL=webpack://ExcalidrawLib/../element/src/renderElement.ts?");
|
|
14680
14680
|
|
|
14681
14681
|
/***/ }),
|
|
14682
14682
|
|
|
@@ -22232,7 +22232,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
22232
22232
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
22233
22233
|
|
|
22234
22234
|
"use strict";
|
|
22235
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ frameClip: () => (/* binding */ frameClip),\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__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/element */ \"../element/src/index.ts\");\n/* harmony import */ var _components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/hyperlink/helpers */ \"./components/hyperlink/helpers.ts\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers */ \"./renderer/helpers.ts\");\n\n\n\n\n\n\n\n\n\n\n/*const GridLineColor = {\n [THEME.LIGHT]: {\n bold: \"#dddddd\",\n regular: \"#e5e5e5\",\n },\n [THEME.DARK]: {\n bold: applyDarkModeFilter(\"#dddddd\"),\n regular: applyDarkModeFilter(\"#e5e5e5\"),\n },\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, theme, width, height, gridLineColor, //zsviczian\ngridDirection = {\n horizontal: true,\n vertical: true\n}) => {\n const bold = //zsviczian\n theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(gridLineColor.Bold) : gridLineColor.Bold;\n const regular = //zsviczian\n theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(gridLineColor.Regular) : gridLineColor.Regular;\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 ? bold : regular; //zsviczian\n\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 ? bold : regular; //zsviczian\n\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};\nconst linkIconCanvasCache = {\n regularLink: null,\n elementLink: null\n};\n\nconst renderLinkIcon = (element, context, appState, elementsMap) => {\n if ((element.link || element.hasTextLink) && !appState.selectedElementIds[element.id]) {\n //zsviczian\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getElementAbsoluteCoords)(element, elementsMap);\n const [x, y, width, height] = (0,_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_2__.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 = !!element.link && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isElementLink)(element.link) //zsviczian\n ? \"elementLink\" : \"regularLink\";\n let linkCanvas = linkIconCanvasCache[canvasKey];\n\n if (!linkCanvas || linkCanvas.zoom !== appState.zoom.value || linkCanvas.linkOpacity !== appState.linkOpacity //zsviczian\n ) {\n linkCanvas = Object.assign(document.createElement(\"canvas\"), {\n zoom: appState.zoom.value,\n linkOpacity: appState.linkOpacity //zsviczian\n\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 = appState.viewBackgroundColor || \"#fff\";\n linkCanvasCacheContext.fillRect(0, 0, width, height);*/\n //zsviczian\n\n if (canvasKey === \"elementLink\") {\n linkCanvasCacheContext.drawImage(_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_2__.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_2__.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_3__.getNormalizedCanvasDimensions)(canvas, scale);\n const context = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.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, renderConfig.theme, 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__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.getTargetFrame)(element, elementsMap, appState);\n\n if (frame && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.shouldApplyFrameClip)(element, frame, appState, elementsMap, inFrameGroupsMap)) {\n frameClip(frame, context, renderConfig, appState);\n }\n\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n } else {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n }\n\n const boundTextElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getBoundTextElement)(element, elementsMap);\n\n if (boundTextElement) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.isIframeLikeElement)(el)).forEach(element => {\n var _a;\n\n try {\n const render = () => {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isIframeLikeElement)(element) && (isExporting || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isEmbeddableElement)(element) && renderConfig.embedsValidationStatus.get(element.id) !== true) && element.width && element.height) {\n const label = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.createPlaceholderEmbeddableLabel)(element);\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.getTargetFrame)(element, elementsMap, appState);\n\n if (frame && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.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/**\n * Static scene is the non-ui canvas where we render elements.\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?");
|
|
22235
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ frameClip: () => (/* binding */ frameClip),\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__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/element */ \"../element/src/index.ts\");\n/* harmony import */ var _components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/hyperlink/helpers */ \"./components/hyperlink/helpers.ts\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers */ \"./renderer/helpers.ts\");\n\n\n\n\n\n\n\n\n\n\n/*const GridLineColor = {\n [THEME.LIGHT]: {\n bold: \"#dddddd\",\n regular: \"#e5e5e5\",\n },\n [THEME.DARK]: {\n bold: applyDarkModeFilter(\"#dddddd\"),\n regular: applyDarkModeFilter(\"#e5e5e5\"),\n },\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, theme, width, height, gridLineColor, //zsviczian\ngridDirection = {\n horizontal: true,\n vertical: true\n}) => {\n const bold = //zsviczian\n theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(gridLineColor.Bold) : gridLineColor.Bold;\n const regular = //zsviczian\n theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(gridLineColor.Regular) : gridLineColor.Regular;\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 ? bold : regular; //zsviczian\n\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 ? bold : regular; //zsviczian\n\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};\nconst linkIconCanvasCache = {\n regularLink: null,\n elementLink: null\n};\n\nconst renderLinkIcon = (element, context, appState, elementsMap) => {\n if ((element.link || element.hasTextLink) && !appState.selectedElementIds[element.id]) {\n //zsviczian\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getElementAbsoluteCoords)(element, elementsMap);\n const [x, y, width, height] = (0,_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_2__.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 = !!element.link && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isElementLink)(element.link) //zsviczian\n ? \"elementLink\" : \"regularLink\";\n let linkCanvas = linkIconCanvasCache[canvasKey];\n\n if (!linkCanvas || linkCanvas.zoom !== appState.zoom.value || linkCanvas.linkOpacity !== appState.linkOpacity //zsviczian\n ) {\n linkCanvas = Object.assign(document.createElement(\"canvas\"), {\n zoom: appState.zoom.value,\n linkOpacity: appState.linkOpacity //zsviczian\n\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 = appState.viewBackgroundColor || \"#fff\";\n linkCanvasCacheContext.fillRect(0, 0, width, height);*/\n //zsviczian\n\n linkCanvasCacheContext.globalAlpha = appState.linkOpacity; //zsviczian\n\n if (canvasKey === \"elementLink\") {\n linkCanvasCacheContext.drawImage(_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_LINK_IMG, 0, 0, width, height);\n } else {\n linkCanvasCacheContext.drawImage(_components_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_2__.EXTERNAL_LINK_IMG, 0, 0, width, height);\n }\n\n linkCanvasCacheContext.restore();\n }\n\n context.globalAlpha = element.opacity / 100;\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_3__.getNormalizedCanvasDimensions)(canvas, scale);\n const context = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.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, renderConfig.theme, 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__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.getTargetFrame)(element, elementsMap, appState);\n\n if (frame && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.shouldApplyFrameClip)(element, frame, appState, elementsMap, inFrameGroupsMap)) {\n frameClip(frame, context, renderConfig, appState);\n }\n\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n } else {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n }\n\n const boundTextElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getBoundTextElement)(element, elementsMap);\n\n if (boundTextElement) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.isIframeLikeElement)(el)).forEach(element => {\n var _a;\n\n try {\n const render = () => {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.renderElement)(element, elementsMap, allElementsMap, rc, context, renderConfig, appState);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isIframeLikeElement)(element) && (isExporting || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isEmbeddableElement)(element) && renderConfig.embedsValidationStatus.get(element.id) !== true) && element.width && element.height) {\n const label = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.createPlaceholderEmbeddableLabel)(element);\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.getTargetFrame)(element, elementsMap, appState);\n\n if (frame && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.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__WEBPACK_IMPORTED_MODULE_1__.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/**\n * Static scene is the non-ui canvas where we render elements.\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?");
|
|
22236
22236
|
|
|
22237
22237
|
/***/ }),
|
|
22238
22238
|
|
|
@@ -22243,7 +22243,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
22243
22243
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
22244
22244
|
|
|
22245
22245
|
"use strict";
|
|
22246
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ renderSceneToSvg: () => (/* binding */ renderSceneToSvg)\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__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/element */ \"../element/src/index.ts\");\n/* harmony import */ var _element_src_freedrawPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../element/src/freedrawPath */ \"../element/src/freedrawPath.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst roughSVGDrawWithPrecision = (rsvg, drawable, precision) => {\n if (typeof precision === \"undefined\") {\n return rsvg.draw(drawable);\n }\n\n const pshape = {\n sets: drawable.sets,\n shape: drawable.shape,\n options: Object.assign(Object.assign({}, drawable.options), {\n fixedDecimalPlaceDigits: precision\n })\n };\n return rsvg.draw(pshape);\n};\n\nconst maybeWrapNodesInFrameClipPath = (element, root, nodes, frameRendering, elementsMap) => {\n if (!frameRendering.enabled || !frameRendering.clip) {\n return null;\n }\n\n const frame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getContainingFrame)(element, elementsMap);\n\n if (frame) {\n const g = root.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n g.setAttributeNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"clip-path\", `url(#${frame.id})`);\n nodes.forEach(node => g.appendChild(node));\n return g;\n }\n\n return null;\n};\n\nconst renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, offsetY, renderConfig) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n\n const offset = {\n x: offsetX,\n y: offsetY\n };\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getElementAbsoluteCoords)(element, elementsMap);\n let cx = (x2 - x1) / 2 - (element.x - x1);\n let cy = (y2 - y1) / 2 - (element.y - y1);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isTextElement)(element)) {\n const container = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getContainerElement)(element, elementsMap);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isArrowElement)(container)) {\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getElementAbsoluteCoords)(container, elementsMap);\n const boundTextCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.LinearElementEditor.getBoundTextElementPosition(container, element, elementsMap);\n cx = (x2 - x1) / 2 - (boundTextCoords.x - x1);\n cy = (y2 - y1) / 2 - (boundTextCoords.y - y1);\n offsetX = offsetX + boundTextCoords.x - element.x;\n offsetY = offsetY + boundTextCoords.y - element.y;\n }\n }\n\n const degree = 180 * element.angle / Math.PI; // element to append node to, most of the time svgRoot\n\n let root = svgRoot; // if the element has a link, create an anchor tag and make that the new root\n\n if (element.link) {\n const anchorTag = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"a\");\n anchorTag.setAttribute(\"href\", (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.normalizeLink)(element.link));\n root.appendChild(anchorTag);\n root = anchorTag;\n }\n\n const addToRoot = (node, element) => {\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.isTestEnv)()) {\n node.setAttribute(\"data-id\", element.id);\n }\n\n root.appendChild(node);\n };\n\n const opacity = ((_b = (_a = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getContainingFrame)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.opacity) !== null && _b !== void 0 ? _b : 100) * element.opacity / 10000;\n\n switch (element.type) {\n case \"selection\":\n {\n // Since this is used only during editing experience, which is canvas based,\n // this should not happen\n throw new Error(\"Selection rendering is not supported for SVG\");\n }\n\n case \"rectangle\":\n case \"diamond\":\n case \"ellipse\":\n {\n const shape = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.ShapeCache.generateElementShape(element, renderConfig);\n const node = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT);\n\n if (opacity !== 1) {\n node.setAttribute(\"stroke-opacity\", `${opacity}`);\n node.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n node.setAttribute(\"stroke-linecap\", \"round\");\n node.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n const g = maybeWrapNodesInFrameClipPath(element, root, [node], renderConfig.frameRendering, elementsMap);\n addToRoot(g || node, element);\n break;\n }\n\n case \"iframe\":\n case \"embeddable\":\n {\n // render placeholder rectangle\n const shape = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.ShapeCache.generateElementShape(element, renderConfig);\n const node = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT);\n const opacity = element.opacity / 100;\n\n if (opacity !== 1) {\n node.setAttribute(\"stroke-opacity\", `${opacity}`);\n node.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n node.setAttribute(\"stroke-linecap\", \"round\");\n node.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n addToRoot(node, element);\n const label = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.createPlaceholderEmbeddableLabel)(element);\n renderElementToSvg(label, elementsMap, rsvg, root, files, label.x + offset.x - element.x, label.y + offset.y - element.y, renderConfig);\n const scaleX = ((_c = element.scale) === null || _c === void 0 ? void 0 : _c[0]) || 1; //zsviczian\n\n const scaleY = ((_d = element.scale) === null || _d === void 0 ? void 0 : _d[1]) || 1; //zsviczian\n // render embeddable element + iframe\n\n const embeddableNode = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT);\n embeddableNode.setAttribute(\"stroke-linecap\", \"round\");\n embeddableNode.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy}) scale(${scaleX}, ${scaleY})`);\n\n while (embeddableNode.firstChild) {\n embeddableNode.removeChild(embeddableNode.firstChild);\n }\n\n const radius = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getCornerRadius)(Math.min(element.width, element.height), element);\n const embedLink = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getEmbedLink)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.toValidURL)(element.link || \"\")); // if rendering embeddables explicitly disabled or\n // embedding documents via srcdoc (which doesn't seem to work for SVGs)\n // replace with a link instead\n\n if (renderConfig.renderEmbeddables === false || (embedLink === null || embedLink === void 0 ? void 0 : embedLink.type) === \"document\") {\n const anchorTag = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"a\");\n anchorTag.setAttribute(\"href\", (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.normalizeLink)(element.link || \"\"));\n anchorTag.setAttribute(\"target\", \"_blank\");\n anchorTag.setAttribute(\"rel\", \"noopener noreferrer\");\n anchorTag.style.borderRadius = `${radius}px`;\n embeddableNode.appendChild(anchorTag);\n } else {\n const foreignObject = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"foreignObject\");\n foreignObject.style.width = `${element.width / scaleX}px`; //zsviczian\n\n foreignObject.style.height = `${element.height / scaleY}px`; //zsviczian\n\n foreignObject.style.border = \"none\";\n const div = foreignObject.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"div\");\n div.setAttribute(\"xmlns\", \"http://www.w3.org/1999/xhtml\");\n div.style.width = \"100%\";\n div.style.height = \"100%\";\n const iframe = div.ownerDocument.createElement(\"iframe\");\n iframe.src = (_e = embedLink === null || embedLink === void 0 ? void 0 : embedLink.link) !== null && _e !== void 0 ? _e : \"\";\n iframe.style.width = \"100%\";\n iframe.style.height = \"100%\";\n iframe.style.border = \"none\";\n iframe.style.borderRadius = `${radius}px`;\n iframe.style.top = \"0\";\n iframe.style.left = \"0\";\n iframe.allowFullscreen = true;\n div.appendChild(iframe);\n foreignObject.appendChild(div);\n embeddableNode.appendChild(foreignObject);\n }\n\n addToRoot(embeddableNode, element);\n break;\n }\n\n case \"line\":\n case \"arrow\":\n {\n const boundText = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getBoundTextElement)(element, elementsMap);\n const maskPath = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"mask\");\n\n if (boundText) {\n maskPath.setAttribute(\"id\", `mask-${element.id}`);\n const maskRectVisible = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n offsetX = offsetX || 0;\n offsetY = offsetY || 0;\n maskRectVisible.setAttribute(\"x\", \"0\");\n maskRectVisible.setAttribute(\"y\", \"0\");\n maskRectVisible.setAttribute(\"fill\", \"#fff\");\n maskRectVisible.setAttribute(\"width\", `${element.width + 100 + offsetX}`);\n maskRectVisible.setAttribute(\"height\", `${element.height + 100 + offsetY}`);\n maskPath.appendChild(maskRectVisible);\n const maskRectInvisible = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n const boundTextCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.LinearElementEditor.getBoundTextElementPosition(element, boundText, elementsMap);\n const maskX = offsetX + boundTextCoords.x - element.x;\n const maskY = offsetY + boundTextCoords.y - element.y;\n maskRectInvisible.setAttribute(\"x\", maskX.toString());\n maskRectInvisible.setAttribute(\"y\", maskY.toString());\n maskRectInvisible.setAttribute(\"fill\", \"#000\");\n maskRectInvisible.setAttribute(\"width\", `${boundText.width}`);\n maskRectInvisible.setAttribute(\"height\", `${boundText.height}`);\n maskRectInvisible.setAttribute(\"opacity\", \"1\");\n maskPath.appendChild(maskRectInvisible);\n }\n\n const group = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n\n if (boundText) {\n group.setAttribute(\"mask\", `url(#mask-${element.id})`);\n }\n\n group.setAttribute(\"stroke-linecap\", \"round\");\n const shapes = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.ShapeCache.generateElementShape(element, renderConfig);\n shapes.forEach(shape => {\n const node = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT);\n\n if (opacity !== 1) {\n node.setAttribute(\"stroke-opacity\", `${opacity}`);\n node.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n node.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n\n if (element.type === \"line\" && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isPathALoop)(element.points) && element.backgroundColor !== \"transparent\") {\n node.setAttribute(\"fill-rule\", \"evenodd\");\n }\n\n group.appendChild(node);\n });\n const g = maybeWrapNodesInFrameClipPath(element, root, [group, maskPath], renderConfig.frameRendering, elementsMap);\n\n if (g) {\n addToRoot(g, element);\n root.appendChild(g);\n } else {\n addToRoot(group, element);\n root.append(maskPath);\n }\n\n break;\n }\n\n case \"freedraw\":\n {\n const wrapper = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n const shapes = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.ShapeCache.generateElementShape(element, renderConfig); // always ordered as [background, stroke]\n\n for (const shape of shapes) {\n if (typeof shape === \"string\") {\n // stroke (SVGPathString)\n //zsviczian - custom stroke options start\n const {\n pathD,\n fillColorThemed\n } = (() => {\n var _a, _b, _c, _d, _e;\n\n const pathD = (0,_element_src_freedrawPath__WEBPACK_IMPORTED_MODULE_2__.getFreeDrawSvgPath)(element);\n const hasOutline = (_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.strokeOptions) === null || _b === void 0 ? void 0 : _b.hasOutline;\n const outlineWidth = (_e = (_d = (_c = element.customData) === null || _c === void 0 ? void 0 : _c.strokeOptions) === null || _d === void 0 ? void 0 : _d.outlineWidth) !== null && _e !== void 0 ? _e : 1;\n const fillColor = hasOutline ? element.backgroundColor : element.strokeColor;\n const fillColorThemed = renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(fillColor) : fillColor;\n\n if (hasOutline) {\n const outline = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"path\");\n outline.setAttribute(\"fill\", \"none\");\n outline.setAttribute(\"stroke\", renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(element.strokeColor) : element.strokeColor);\n outline.setAttribute(\"stroke-width\", `${element.strokeWidth * outlineWidth}`);\n outline.setAttribute(\"d\", pathD);\n wrapper.appendChild(outline);\n }\n\n return {\n pathD,\n fillColorThemed\n };\n })(); //zsviczian - custom stroke options end\n\n\n const path = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"path\");\n /*\n path.setAttribute(\n \"fill\",\n renderConfig.theme === THEME.DARK\n ? applyDarkModeFilter(element.strokeColor)\n : element.strokeColor,\n );\n path.setAttribute(\"d\", shape);\n */\n //zsviczian\n\n path.setAttribute(\"fill\", fillColorThemed); //zsviczian\n\n path.setAttribute(\"d\", pathD); //zsviczian\n\n wrapper.appendChild(path);\n } else {\n // background (Drawable)\n const bgNode = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT); // if children wrapped in <g>, unwrap it\n\n if (bgNode.nodeName === \"g\") {\n while (bgNode.firstChild) {\n wrapper.appendChild(bgNode.firstChild);\n }\n } else {\n wrapper.appendChild(bgNode);\n }\n }\n }\n\n if (opacity !== 1) {\n wrapper.setAttribute(\"stroke-opacity\", `${opacity}`);\n wrapper.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n wrapper.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n wrapper.setAttribute(\"stroke\", \"none\");\n const g = maybeWrapNodesInFrameClipPath(element, root, [wrapper], renderConfig.frameRendering, elementsMap);\n addToRoot(g || wrapper, element);\n break;\n }\n\n case \"image\":\n {\n const width = Math.round(element.width);\n const height = Math.round(element.height);\n const fileData = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isInitializedImageElement)(element) && files[element.fileId];\n\n if (fileData) {\n const {\n reuseImages = true\n } = renderConfig;\n let symbolId = `image-${fileData.id}`;\n let uncroppedWidth = element.width;\n let uncroppedHeight = element.height;\n\n if (element.crop) {\n ({\n width: uncroppedWidth,\n height: uncroppedHeight\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getUncroppedWidthAndHeight)(element));\n symbolId = `image-crop-${fileData.id}-${(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.hashString)(`${uncroppedWidth}x${uncroppedHeight}`)}`;\n }\n\n if (!reuseImages) {\n symbolId = `image-${element.id}`;\n }\n\n let symbol = svgRoot.querySelector(`#${symbolId}`);\n\n if (!symbol) {\n symbol = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"symbol\");\n symbol.id = symbolId;\n const image = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"image\");\n image.setAttribute(\"href\", fileData.dataURL);\n image.setAttribute(\"preserveAspectRatio\", \"none\");\n\n if (element.crop || !reuseImages) {\n image.setAttribute(\"width\", `${uncroppedWidth}`);\n image.setAttribute(\"height\", `${uncroppedHeight}`);\n } else {\n image.setAttribute(\"width\", \"100%\");\n image.setAttribute(\"height\", \"100%\");\n }\n\n symbol.appendChild(image);\n (root.querySelector(\"defs\") || root).prepend(symbol);\n }\n\n const use = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"use\");\n use.setAttribute(\"href\", `#${symbolId}`);\n let normalizedCropX = 0;\n let normalizedCropY = 0;\n\n if (element.crop) {\n const {\n width: uncroppedWidth,\n height: uncroppedHeight\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getUncroppedWidthAndHeight)(element);\n normalizedCropX = element.crop.x / (element.crop.naturalWidth / uncroppedWidth);\n normalizedCropY = element.crop.y / (element.crop.naturalHeight / uncroppedHeight);\n }\n\n const adjustedCenterX = cx + normalizedCropX;\n const adjustedCenterY = cy + normalizedCropY;\n use.setAttribute(\"width\", `${width + normalizedCropX}`);\n use.setAttribute(\"height\", `${height + normalizedCropY}`);\n use.setAttribute(\"opacity\", `${opacity}`); // We first apply `scale` transforms (horizontal/vertical mirroring)\n // on the <use> element, then apply translation and rotation\n // on the <g> element which wraps the <use>.\n // Doing this separately is a quick hack to to work around compositing\n // the transformations correctly (the transform-origin was not being\n // applied correctly).\n\n if (element.scale[0] !== 1 || element.scale[1] !== 1) {\n use.setAttribute(\"transform\", `translate(${adjustedCenterX} ${adjustedCenterY}) scale(${element.scale[0]} ${element.scale[1]}) translate(${-adjustedCenterX} ${-adjustedCenterY})`);\n }\n\n const g = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n\n if (element.crop) {\n const mask = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"mask\");\n mask.setAttribute(\"id\", `mask-image-crop-${element.id}`);\n mask.setAttribute(\"fill\", \"#fff\");\n const maskRect = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n maskRect.setAttribute(\"x\", `${normalizedCropX}`);\n maskRect.setAttribute(\"y\", `${normalizedCropY}`);\n maskRect.setAttribute(\"width\", `${width}`);\n maskRect.setAttribute(\"height\", `${height}`);\n mask.appendChild(maskRect);\n root.appendChild(mask);\n g.setAttribute(\"mask\", `url(#${mask.id})`);\n }\n\n g.appendChild(use);\n g.setAttribute(\"transform\", `translate(${offsetX - normalizedCropX} ${offsetY - normalizedCropY}) rotate(${degree} ${adjustedCenterX} ${adjustedCenterY})`);\n\n if (element.roundness) {\n const clipPath = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"clipPath\");\n clipPath.id = `image-clipPath-${element.id}`;\n clipPath.setAttribute(\"clipPathUnits\", \"userSpaceOnUse\");\n const clipRect = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n const radius = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getCornerRadius)(Math.min(element.width, element.height), element);\n const clipOffsetX = element.crop ? normalizedCropX : 0;\n const clipOffsetY = element.crop ? normalizedCropY : 0;\n clipRect.setAttribute(\"x\", `${clipOffsetX}`);\n clipRect.setAttribute(\"y\", `${clipOffsetY}`);\n clipRect.setAttribute(\"width\", `${element.width}`);\n clipRect.setAttribute(\"height\", `${element.height}`);\n clipRect.setAttribute(\"rx\", `${radius}`);\n clipRect.setAttribute(\"ry\", `${radius}`);\n clipPath.appendChild(clipRect);\n addToRoot(clipPath, element);\n g.setAttributeNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"clip-path\", `url(#${clipPath.id})`);\n }\n\n const clipG = maybeWrapNodesInFrameClipPath(element, root, [g], renderConfig.frameRendering, elementsMap);\n addToRoot(clipG || g, element);\n }\n\n break;\n }\n // frames are not rendered and only acts as a container\n\n case \"frame\":\n case \"magicframe\":\n {\n if (renderConfig.frameRendering.enabled && renderConfig.frameRendering.outline && !(!renderConfig.frameRendering.markerEnabled && element.frameRole === \"marker\") //zsviczian\n ) {\n const rect = document.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n rect.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n rect.setAttribute(\"width\", `${element.width}px`);\n rect.setAttribute(\"height\", `${element.height}px`); // Rounded corners\n\n rect.setAttribute(\"rx\", _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.radius.toString());\n rect.setAttribute(\"ry\", _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.radius.toString());\n rect.setAttribute(\"fill\", \"none\");\n rect.setAttribute(\"stroke\", (() => {\n var _a, _b, _c, _d, _e;\n\n const color = (_e = (_c = (_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.frameColor) === null || _b === void 0 ? void 0 : _b.stroke) !== null && _c !== void 0 ? _c : (_d = renderConfig.frameColor) === null || _d === void 0 ? void 0 : _d.stroke) !== null && _e !== void 0 ? _e : _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.strokeColor; //zsviczian\n\n return renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(color) : color;\n })());\n rect.setAttribute(\"stroke-width\", (_k = (_h = (_g = (_f = element.customData) === null || _f === void 0 ? void 0 : _f.frameColor) === null || _g === void 0 ? void 0 : _g.fill) !== null && _h !== void 0 ? _h : (_j = renderConfig.frameColor) === null || _j === void 0 ? void 0 : _j.fill) !== null && _k !== void 0 ? _k : _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.strokeWidth.toString());\n addToRoot(rect, element);\n }\n\n break;\n }\n\n default:\n {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isTextElement)(element)) {\n const node = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n\n if (opacity !== 1) {\n node.setAttribute(\"stroke-opacity\", `${opacity}`);\n node.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n node.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n const lines = element.text.replace(/\\r\\n?/g, \"\\n\").split(\"\\n\");\n const lineHeightPx = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getLineHeightInPx)(element.fontSize, element.lineHeight);\n const horizontalOffset = element.textAlign === \"center\" ? element.width / 2 : element.textAlign === \"right\" ? element.width : 0;\n const verticalOffset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.getVerticalOffset)(element.fontFamily, element.fontSize, lineHeightPx);\n const direction = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.isRTL)(element.text) ? \"rtl\" : \"ltr\";\n const textAnchor = element.textAlign === \"center\" ? \"middle\" : element.textAlign === \"right\" || direction === \"rtl\" ? \"end\" : \"start\";\n\n for (let i = 0; i < lines.length; i++) {\n const text = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"text\");\n text.textContent = lines[i];\n text.setAttribute(\"x\", `${horizontalOffset}`);\n text.setAttribute(\"y\", `${i * lineHeightPx + verticalOffset}`);\n text.setAttribute(\"font-family\", (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.getFontFamilyString)(element));\n text.setAttribute(\"font-size\", `${element.fontSize}px`);\n text.setAttribute(\"fill\", renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(element.strokeColor) : element.strokeColor);\n text.setAttribute(\"text-anchor\", textAnchor);\n text.setAttribute(\"style\", \"white-space: pre;\");\n text.setAttribute(\"direction\", direction);\n text.setAttribute(\"dominant-baseline\", \"alphabetic\");\n node.appendChild(text);\n }\n\n const g = maybeWrapNodesInFrameClipPath(element, root, [node], renderConfig.frameRendering, elementsMap);\n addToRoot(g || node, element);\n } else {\n // @ts-ignore\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n }\n};\n\nconst renderSceneToSvg = (elements, elementsMap, rsvg, svgRoot, files, renderConfig) => {\n if (!svgRoot) {\n return;\n } // render elements\n\n\n elements.filter(el => !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isIframeLikeElement)(el)).forEach(element => {\n if (!element.isDeleted) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isTextElement)(element) && element.containerId && elementsMap.has(element.containerId)) {\n // will be rendered with the container\n return;\n }\n\n try {\n renderElementToSvg(element, elementsMap, rsvg, svgRoot, files, element.x + renderConfig.offsetX, element.y + renderConfig.offsetY, renderConfig);\n const boundTextElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getBoundTextElement)(element, elementsMap);\n\n if (boundTextElement) {\n renderElementToSvg(boundTextElement, elementsMap, rsvg, svgRoot, files, boundTextElement.x + renderConfig.offsetX, boundTextElement.y + renderConfig.offsetY, renderConfig);\n }\n } catch (error) {\n console.error(error);\n }\n }\n }); // render embeddables on top\n\n elements.filter(el => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isIframeLikeElement)(el)).forEach(element => {\n if (!element.isDeleted) {\n try {\n renderElementToSvg(element, elementsMap, rsvg, svgRoot, files, element.x + renderConfig.offsetX, element.y + renderConfig.offsetY, renderConfig);\n } catch (error) {\n console.error(error);\n }\n }\n });\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./renderer/staticSvgScene.ts?");
|
|
22246
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ renderSceneToSvg: () => (/* binding */ renderSceneToSvg)\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__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/element */ \"../element/src/index.ts\");\n/* harmony import */ var _element_src_freedrawPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../element/src/freedrawPath */ \"../element/src/freedrawPath.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst roughSVGDrawWithPrecision = (rsvg, drawable, precision) => {\n if (typeof precision === \"undefined\") {\n return rsvg.draw(drawable);\n }\n\n const pshape = {\n sets: drawable.sets,\n shape: drawable.shape,\n options: Object.assign(Object.assign({}, drawable.options), {\n fixedDecimalPlaceDigits: precision\n })\n };\n return rsvg.draw(pshape);\n};\n\nconst maybeWrapNodesInFrameClipPath = (element, root, nodes, frameRendering, elementsMap) => {\n if (!frameRendering.enabled || !frameRendering.clip) {\n return null;\n }\n\n const frame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getContainingFrame)(element, elementsMap);\n\n if (frame) {\n const g = root.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n g.setAttributeNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"clip-path\", `url(#${frame.id})`);\n nodes.forEach(node => g.appendChild(node));\n return g;\n }\n\n return null;\n};\n\nconst renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, offsetY, renderConfig) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;\n\n const offset = {\n x: offsetX,\n y: offsetY\n };\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getElementAbsoluteCoords)(element, elementsMap);\n let cx = (x2 - x1) / 2 - (element.x - x1);\n let cy = (y2 - y1) / 2 - (element.y - y1);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isTextElement)(element)) {\n const container = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getContainerElement)(element, elementsMap);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isArrowElement)(container)) {\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getElementAbsoluteCoords)(container, elementsMap);\n const boundTextCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.LinearElementEditor.getBoundTextElementPosition(container, element, elementsMap);\n cx = (x2 - x1) / 2 - (boundTextCoords.x - x1);\n cy = (y2 - y1) / 2 - (boundTextCoords.y - y1);\n offsetX = offsetX + boundTextCoords.x - element.x;\n offsetY = offsetY + boundTextCoords.y - element.y;\n }\n }\n\n const degree = 180 * element.angle / Math.PI; // element to append node to, most of the time svgRoot\n\n let root = svgRoot; // if the element has a link, create an anchor tag and make that the new root\n\n if (element.link) {\n const anchorTag = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"a\");\n anchorTag.setAttribute(\"href\", (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.normalizeLink)(element.link));\n root.appendChild(anchorTag);\n root = anchorTag;\n }\n\n const addToRoot = (node, element) => {\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.isTestEnv)()) {\n node.setAttribute(\"data-id\", element.id);\n }\n\n root.appendChild(node);\n };\n\n const opacity = ((_b = (_a = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getContainingFrame)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.opacity) !== null && _b !== void 0 ? _b : 100) * element.opacity / 10000;\n\n switch (element.type) {\n case \"selection\":\n {\n // Since this is used only during editing experience, which is canvas based,\n // this should not happen\n throw new Error(\"Selection rendering is not supported for SVG\");\n }\n\n case \"rectangle\":\n case \"diamond\":\n case \"ellipse\":\n {\n const shape = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.ShapeCache.generateElementShape(element, renderConfig);\n const node = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT);\n\n if (opacity !== 1) {\n node.setAttribute(\"stroke-opacity\", `${opacity}`);\n node.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n node.setAttribute(\"stroke-linecap\", \"round\");\n node.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n const g = maybeWrapNodesInFrameClipPath(element, root, [node], renderConfig.frameRendering, elementsMap);\n addToRoot(g || node, element);\n break;\n }\n\n case \"iframe\":\n case \"embeddable\":\n {\n // render placeholder rectangle\n const shape = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.ShapeCache.generateElementShape(element, renderConfig);\n const node = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT);\n const opacity = element.opacity / 100;\n\n if (opacity !== 1) {\n node.setAttribute(\"stroke-opacity\", `${opacity}`);\n node.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n node.setAttribute(\"stroke-linecap\", \"round\");\n node.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n addToRoot(node, element);\n const label = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.createPlaceholderEmbeddableLabel)(element);\n renderElementToSvg(label, elementsMap, rsvg, root, files, label.x + offset.x - element.x, label.y + offset.y - element.y, renderConfig);\n const scaleX = ((_c = element.scale) === null || _c === void 0 ? void 0 : _c[0]) || 1; //zsviczian\n\n const scaleY = ((_d = element.scale) === null || _d === void 0 ? void 0 : _d[1]) || 1; //zsviczian\n // render embeddable element + iframe\n\n const embeddableNode = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT);\n embeddableNode.setAttribute(\"stroke-linecap\", \"round\");\n embeddableNode.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy}) scale(${scaleX}, ${scaleY})`);\n\n while (embeddableNode.firstChild) {\n embeddableNode.removeChild(embeddableNode.firstChild);\n }\n\n const radius = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getCornerRadius)(Math.min(element.width, element.height), element);\n const embedLink = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getEmbedLink)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.toValidURL)(element.link || \"\")); // if rendering embeddables explicitly disabled or\n // embedding documents via srcdoc (which doesn't seem to work for SVGs)\n // replace with a link instead\n\n if (renderConfig.renderEmbeddables === false || (embedLink === null || embedLink === void 0 ? void 0 : embedLink.type) === \"document\") {\n const anchorTag = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"a\");\n anchorTag.setAttribute(\"href\", (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.normalizeLink)(element.link || \"\"));\n anchorTag.setAttribute(\"target\", \"_blank\");\n anchorTag.setAttribute(\"rel\", \"noopener noreferrer\");\n anchorTag.style.borderRadius = `${radius}px`;\n embeddableNode.appendChild(anchorTag);\n } else {\n const foreignObject = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"foreignObject\");\n foreignObject.style.width = `${element.width / scaleX}px`; //zsviczian\n\n foreignObject.style.height = `${element.height / scaleY}px`; //zsviczian\n\n foreignObject.style.border = \"none\";\n const div = foreignObject.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"div\");\n div.setAttribute(\"xmlns\", \"http://www.w3.org/1999/xhtml\");\n div.style.width = \"100%\";\n div.style.height = \"100%\";\n const iframe = div.ownerDocument.createElement(\"iframe\");\n iframe.src = (_e = embedLink === null || embedLink === void 0 ? void 0 : embedLink.link) !== null && _e !== void 0 ? _e : \"\";\n iframe.style.width = \"100%\";\n iframe.style.height = \"100%\";\n iframe.style.border = \"none\";\n iframe.style.borderRadius = `${radius}px`;\n iframe.style.top = \"0\";\n iframe.style.left = \"0\";\n iframe.allowFullscreen = true;\n div.appendChild(iframe);\n foreignObject.appendChild(div);\n embeddableNode.appendChild(foreignObject);\n }\n\n addToRoot(embeddableNode, element);\n break;\n }\n\n case \"line\":\n case \"arrow\":\n {\n const boundText = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getBoundTextElement)(element, elementsMap);\n const maskPath = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"mask\");\n\n if (boundText) {\n maskPath.setAttribute(\"id\", `mask-${element.id}`);\n const maskRectVisible = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n offsetX = offsetX || 0;\n offsetY = offsetY || 0;\n maskRectVisible.setAttribute(\"x\", \"0\");\n maskRectVisible.setAttribute(\"y\", \"0\");\n maskRectVisible.setAttribute(\"fill\", \"#fff\");\n maskRectVisible.setAttribute(\"width\", `${element.width + 100 + offsetX}`);\n maskRectVisible.setAttribute(\"height\", `${element.height + 100 + offsetY}`);\n maskPath.appendChild(maskRectVisible);\n const maskRectInvisible = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n const boundTextCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.LinearElementEditor.getBoundTextElementPosition(element, boundText, elementsMap);\n const maskX = offsetX + boundTextCoords.x - element.x;\n const maskY = offsetY + boundTextCoords.y - element.y;\n maskRectInvisible.setAttribute(\"x\", maskX.toString());\n maskRectInvisible.setAttribute(\"y\", maskY.toString());\n maskRectInvisible.setAttribute(\"fill\", \"#000\");\n maskRectInvisible.setAttribute(\"width\", `${boundText.width}`);\n maskRectInvisible.setAttribute(\"height\", `${boundText.height}`);\n maskRectInvisible.setAttribute(\"opacity\", \"1\");\n maskPath.appendChild(maskRectInvisible);\n }\n\n const group = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n\n if (boundText) {\n group.setAttribute(\"mask\", `url(#mask-${element.id})`);\n }\n\n group.setAttribute(\"stroke-linecap\", \"round\");\n const shapes = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.ShapeCache.generateElementShape(element, renderConfig);\n shapes.forEach(shape => {\n const node = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT);\n\n if (opacity !== 1) {\n node.setAttribute(\"stroke-opacity\", `${opacity}`);\n node.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n node.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n\n if (element.type === \"line\" && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isPathALoop)(element.points) && element.backgroundColor !== \"transparent\") {\n node.setAttribute(\"fill-rule\", \"evenodd\");\n }\n\n group.appendChild(node);\n });\n const g = maybeWrapNodesInFrameClipPath(element, root, [group, maskPath], renderConfig.frameRendering, elementsMap);\n\n if (g) {\n addToRoot(g, element);\n root.appendChild(g);\n } else {\n addToRoot(group, element);\n root.append(maskPath);\n }\n\n break;\n }\n\n case \"freedraw\":\n {\n const wrapper = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n const shapes = _excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.ShapeCache.generateElementShape(element, renderConfig); // always ordered as [background, stroke]\n\n for (const shape of shapes) {\n if (typeof shape === \"string\") {\n // stroke (SVGPathString)\n //zsviczian - custom stroke options start\n const {\n pathD,\n fillColorThemed\n } = (() => {\n var _a, _b, _c, _d, _e;\n\n const pathD = (0,_element_src_freedrawPath__WEBPACK_IMPORTED_MODULE_2__.getFreeDrawSvgPath)(element);\n const hasOutline = (_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.strokeOptions) === null || _b === void 0 ? void 0 : _b.hasOutline;\n const outlineWidth = (_e = (_d = (_c = element.customData) === null || _c === void 0 ? void 0 : _c.strokeOptions) === null || _d === void 0 ? void 0 : _d.outlineWidth) !== null && _e !== void 0 ? _e : 1;\n const fillColor = hasOutline ? element.backgroundColor : element.strokeColor;\n const fillColorThemed = renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(fillColor) : fillColor;\n\n if (hasOutline) {\n const outline = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"path\");\n outline.setAttribute(\"fill\", \"none\");\n outline.setAttribute(\"stroke\", renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(element.strokeColor) : element.strokeColor);\n outline.setAttribute(\"stroke-width\", `${element.strokeWidth * outlineWidth}`);\n outline.setAttribute(\"d\", pathD);\n wrapper.appendChild(outline);\n }\n\n return {\n pathD,\n fillColorThemed\n };\n })(); //zsviczian - custom stroke options end\n\n\n const path = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"path\");\n /*\n path.setAttribute(\n \"fill\",\n renderConfig.theme === THEME.DARK\n ? applyDarkModeFilter(element.strokeColor)\n : element.strokeColor,\n );\n path.setAttribute(\"d\", shape);\n */\n //zsviczian\n\n path.setAttribute(\"fill\", fillColorThemed); //zsviczian\n\n path.setAttribute(\"d\", pathD); //zsviczian\n\n wrapper.appendChild(path);\n } else {\n // background (Drawable)\n const bgNode = roughSVGDrawWithPrecision(rsvg, shape, _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MAX_DECIMALS_FOR_SVG_EXPORT); // if children wrapped in <g>, unwrap it\n\n if (bgNode.nodeName === \"g\") {\n while (bgNode.firstChild) {\n wrapper.appendChild(bgNode.firstChild);\n }\n } else {\n wrapper.appendChild(bgNode);\n }\n }\n }\n\n if (opacity !== 1) {\n wrapper.setAttribute(\"stroke-opacity\", `${opacity}`);\n wrapper.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n wrapper.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n wrapper.setAttribute(\"stroke\", \"none\");\n const g = maybeWrapNodesInFrameClipPath(element, root, [wrapper], renderConfig.frameRendering, elementsMap);\n addToRoot(g || wrapper, element);\n break;\n }\n\n case \"image\":\n {\n const width = Math.round(element.width);\n const height = Math.round(element.height);\n const fileData = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isInitializedImageElement)(element) && files[element.fileId];\n\n if (fileData) {\n const {\n reuseImages = true\n } = renderConfig;\n let symbolId = `image-${fileData.id}`;\n let uncroppedWidth = element.width;\n let uncroppedHeight = element.height;\n\n if (element.crop) {\n ({\n width: uncroppedWidth,\n height: uncroppedHeight\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getUncroppedWidthAndHeight)(element));\n symbolId = `image-crop-${fileData.id}-${(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.hashString)(`${uncroppedWidth}x${uncroppedHeight}`)}`;\n }\n\n if (!reuseImages) {\n symbolId = `image-${element.id}`;\n }\n\n let symbol = svgRoot.querySelector(`#${symbolId}`);\n\n if (!symbol) {\n symbol = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"symbol\");\n symbol.id = symbolId;\n const image = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"image\");\n image.setAttribute(\"href\", fileData.dataURL);\n image.setAttribute(\"preserveAspectRatio\", \"none\");\n\n if (element.crop || !reuseImages) {\n image.setAttribute(\"width\", `${uncroppedWidth}`);\n image.setAttribute(\"height\", `${uncroppedHeight}`);\n } else {\n image.setAttribute(\"width\", \"100%\");\n image.setAttribute(\"height\", \"100%\");\n }\n\n symbol.appendChild(image);\n (root.querySelector(\"defs\") || root).prepend(symbol);\n }\n\n const use = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"use\");\n use.setAttribute(\"href\", `#${symbolId}`);\n let normalizedCropX = 0;\n let normalizedCropY = 0;\n\n if (element.crop) {\n const {\n width: uncroppedWidth,\n height: uncroppedHeight\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getUncroppedWidthAndHeight)(element);\n normalizedCropX = element.crop.x / (element.crop.naturalWidth / uncroppedWidth);\n normalizedCropY = element.crop.y / (element.crop.naturalHeight / uncroppedHeight);\n }\n\n const adjustedCenterX = cx + normalizedCropX;\n const adjustedCenterY = cy + normalizedCropY;\n use.setAttribute(\"width\", `${width + normalizedCropX}`);\n use.setAttribute(\"height\", `${height + normalizedCropY}`);\n use.setAttribute(\"opacity\", `${opacity}`); // We first apply `scale` transforms (horizontal/vertical mirroring)\n // on the <use> element, then apply translation and rotation\n // on the <g> element which wraps the <use>.\n // Doing this separately is a quick hack to to work around compositing\n // the transformations correctly (the transform-origin was not being\n // applied correctly).\n\n if (element.scale[0] !== 1 || element.scale[1] !== 1) {\n use.setAttribute(\"transform\", `translate(${adjustedCenterX} ${adjustedCenterY}) scale(${element.scale[0]} ${element.scale[1]}) translate(${-adjustedCenterX} ${-adjustedCenterY})`);\n }\n\n const g = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n\n if (renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK && (fileData.mimeType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.MIME_TYPES.svg || !!((_f = element.customData) === null || _f === void 0 ? void 0 : _f.pdfPageViewProps) || !!((_g = element.customData) === null || _g === void 0 ? void 0 : _g.invertInDarkmode)) //zsviczian\n ) {\n g.setAttribute(\"filter\", _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.DARK_THEME_FILTER);\n }\n\n if (element.crop) {\n const mask = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"mask\");\n mask.setAttribute(\"id\", `mask-image-crop-${element.id}`);\n mask.setAttribute(\"fill\", \"#fff\");\n const maskRect = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n maskRect.setAttribute(\"x\", `${normalizedCropX}`);\n maskRect.setAttribute(\"y\", `${normalizedCropY}`);\n maskRect.setAttribute(\"width\", `${width}`);\n maskRect.setAttribute(\"height\", `${height}`);\n mask.appendChild(maskRect);\n root.appendChild(mask);\n g.setAttribute(\"mask\", `url(#${mask.id})`);\n }\n\n g.appendChild(use);\n g.setAttribute(\"transform\", `translate(${offsetX - normalizedCropX} ${offsetY - normalizedCropY}) rotate(${degree} ${adjustedCenterX} ${adjustedCenterY})`);\n\n if (element.roundness) {\n const clipPath = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"clipPath\");\n clipPath.id = `image-clipPath-${element.id}`;\n clipPath.setAttribute(\"clipPathUnits\", \"userSpaceOnUse\");\n const clipRect = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n const radius = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getCornerRadius)(Math.min(element.width, element.height), element);\n const clipOffsetX = element.crop ? normalizedCropX : 0;\n const clipOffsetY = element.crop ? normalizedCropY : 0;\n clipRect.setAttribute(\"x\", `${clipOffsetX}`);\n clipRect.setAttribute(\"y\", `${clipOffsetY}`);\n clipRect.setAttribute(\"width\", `${element.width}`);\n clipRect.setAttribute(\"height\", `${element.height}`);\n clipRect.setAttribute(\"rx\", `${radius}`);\n clipRect.setAttribute(\"ry\", `${radius}`);\n clipPath.appendChild(clipRect);\n addToRoot(clipPath, element);\n g.setAttributeNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"clip-path\", `url(#${clipPath.id})`);\n }\n\n const clipG = maybeWrapNodesInFrameClipPath(element, root, [g], renderConfig.frameRendering, elementsMap);\n addToRoot(clipG || g, element);\n }\n\n break;\n }\n // frames are not rendered and only acts as a container\n\n case \"frame\":\n case \"magicframe\":\n {\n if (renderConfig.frameRendering.enabled && renderConfig.frameRendering.outline && !(!renderConfig.frameRendering.markerEnabled && element.frameRole === \"marker\") //zsviczian\n ) {\n const rect = document.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"rect\");\n rect.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n rect.setAttribute(\"width\", `${element.width}px`);\n rect.setAttribute(\"height\", `${element.height}px`); // Rounded corners\n\n rect.setAttribute(\"rx\", _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.radius.toString());\n rect.setAttribute(\"ry\", _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.radius.toString());\n rect.setAttribute(\"fill\", \"none\");\n rect.setAttribute(\"stroke\", (() => {\n var _a, _b, _c, _d, _e;\n\n const color = (_e = (_c = (_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.frameColor) === null || _b === void 0 ? void 0 : _b.stroke) !== null && _c !== void 0 ? _c : (_d = renderConfig.frameColor) === null || _d === void 0 ? void 0 : _d.stroke) !== null && _e !== void 0 ? _e : _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.strokeColor; //zsviczian\n\n return renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(color) : color;\n })());\n rect.setAttribute(\"stroke-width\", (_m = (_k = (_j = (_h = element.customData) === null || _h === void 0 ? void 0 : _h.frameColor) === null || _j === void 0 ? void 0 : _j.fill) !== null && _k !== void 0 ? _k : (_l = renderConfig.frameColor) === null || _l === void 0 ? void 0 : _l.fill) !== null && _m !== void 0 ? _m : _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.FRAME_STYLE.strokeWidth.toString());\n addToRoot(rect, element);\n }\n\n break;\n }\n\n default:\n {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isTextElement)(element)) {\n const node = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"g\");\n\n if (opacity !== 1) {\n node.setAttribute(\"stroke-opacity\", `${opacity}`);\n node.setAttribute(\"fill-opacity\", `${opacity}`);\n }\n\n node.setAttribute(\"transform\", `translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`);\n const lines = element.text.replace(/\\r\\n?/g, \"\\n\").split(\"\\n\");\n const lineHeightPx = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getLineHeightInPx)(element.fontSize, element.lineHeight);\n const horizontalOffset = element.textAlign === \"center\" ? element.width / 2 : element.textAlign === \"right\" ? element.width : 0;\n const verticalOffset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.getVerticalOffset)(element.fontFamily, element.fontSize, lineHeightPx);\n const direction = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.isRTL)(element.text) ? \"rtl\" : \"ltr\";\n const textAnchor = element.textAlign === \"center\" ? \"middle\" : element.textAlign === \"right\" || direction === \"rtl\" ? \"end\" : \"start\";\n\n for (let i = 0; i < lines.length; i++) {\n const text = svgRoot.ownerDocument.createElementNS(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.SVG_NS, \"text\");\n text.textContent = lines[i];\n text.setAttribute(\"x\", `${horizontalOffset}`);\n text.setAttribute(\"y\", `${i * lineHeightPx + verticalOffset}`);\n text.setAttribute(\"font-family\", (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.getFontFamilyString)(element));\n text.setAttribute(\"font-size\", `${element.fontSize}px`);\n text.setAttribute(\"fill\", renderConfig.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.THEME.DARK ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.applyDarkModeFilter)(element.strokeColor) : element.strokeColor);\n text.setAttribute(\"text-anchor\", textAnchor);\n text.setAttribute(\"style\", \"white-space: pre;\");\n text.setAttribute(\"direction\", direction);\n text.setAttribute(\"dominant-baseline\", \"alphabetic\");\n node.appendChild(text);\n }\n\n const g = maybeWrapNodesInFrameClipPath(element, root, [node], renderConfig.frameRendering, elementsMap);\n addToRoot(g || node, element);\n } else {\n // @ts-ignore\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n }\n};\n\nconst renderSceneToSvg = (elements, elementsMap, rsvg, svgRoot, files, renderConfig) => {\n if (!svgRoot) {\n return;\n } // render elements\n\n\n elements.filter(el => !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isIframeLikeElement)(el)).forEach(element => {\n if (!element.isDeleted) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isTextElement)(element) && element.containerId && elementsMap.has(element.containerId)) {\n // will be rendered with the container\n return;\n }\n\n try {\n renderElementToSvg(element, elementsMap, rsvg, svgRoot, files, element.x + renderConfig.offsetX, element.y + renderConfig.offsetY, renderConfig);\n const boundTextElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.getBoundTextElement)(element, elementsMap);\n\n if (boundTextElement) {\n renderElementToSvg(boundTextElement, elementsMap, rsvg, svgRoot, files, boundTextElement.x + renderConfig.offsetX, boundTextElement.y + renderConfig.offsetY, renderConfig);\n }\n } catch (error) {\n console.error(error);\n }\n }\n }); // render embeddables on top\n\n elements.filter(el => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_1__.isIframeLikeElement)(el)).forEach(element => {\n if (!element.isDeleted) {\n try {\n renderElementToSvg(element, elementsMap, rsvg, svgRoot, files, element.x + renderConfig.offsetX, element.y + renderConfig.offsetY, renderConfig);\n } catch (error) {\n console.error(error);\n }\n }\n });\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./renderer/staticSvgScene.ts?");
|
|
22247
22247
|
|
|
22248
22248
|
/***/ }),
|
|
22249
22249
|
|