integration-modules 0.1.4 → 0.1.6

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShapeBoardWidget-BKEMVbRg.cjs","sources":["../../src/components/shapeIcons.jsx","../../src/assets/shape_add.svg","../../src/assets/shape_add_active.svg","../../src/components/ShapeToolbar.jsx","../../src/features/shape/public/shapeNodeTypes.js","../../src/widgets/ShapeBoardWidget.jsx"],"sourcesContent":["import React from \"react\";\n\nexport const SHAPE_ICONS = {\n square: (\n <svg width=\"40\" height=\"40\">\n <rect x=\"4\" y=\"4\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n </svg>\n ),\n\n circle: (\n <svg width=\"40\" height=\"40\">\n <circle cx=\"20\" cy=\"20\" r=\"14\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n </svg>\n ),\n\n triangle: (\n <svg width=\"40\" height=\"40\">\n <polygon points=\"20,6 34,34 6,34\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n </svg>\n ),\n\n star: (\n <svg width=\"40\" height=\"40\">\n <polygon\n points=\"20,4 25,16 38,16 27,24 32,36 20,28 8,36 13,24 2,16 15,16\"\n stroke=\"black\"\n fill=\"none\"\n strokeWidth=\"2\"\n />\n </svg>\n ),\n\n stick: (\n <svg width=\"40\" height=\"40\">\n <rect x=\"16\" y=\"4\" width=\"8\" height=\"32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\" />\n </svg>\n ),\n\n line: (\n <svg width=\"40\" height=\"40\">\n <line x1=\"4\" y1=\"20\" x2=\"36\" y2=\"20\" stroke=\"black\" strokeWidth=\"2\" />\n </svg>\n ),\n\n arrow: (\n <svg width=\"40\" height=\"40\">\n <line x1=\"4\" y1=\"20\" x2=\"30\" y2=\"20\" stroke=\"black\" strokeWidth=\"2\"/>\n <polygon points=\"30,14 38,20 30,26\" fill=\"black\"/>\n </svg>\n ),\n\n dblarrow: (\n <svg width=\"40\" height=\"40\">\n <polygon points=\"4,20 12,14 12,26\" fill=\"black\"/>\n <line x1=\"12\" y1=\"20\" x2=\"28\" y2=\"20\" stroke=\"black\" strokeWidth=\"2\"/>\n <polygon points=\"28,14 36,20 28,26\" fill=\"black\"/>\n </svg>\n ),\n\n parallelogram: (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\n <polygon points=\"8,8 34,8 26,32 0,32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n </svg>\n ),\n\n roundedRect: (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\n <rect x=\"6\" y=\"10\" width=\"28\" height=\"20\" rx=\"4\" ry=\"4\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n </svg>\n ),\n\n capsule: (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\n <rect x=\"6\" y=\"14\" width=\"28\" height=\"12\" rx=\"6\" ry=\"6\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n </svg>\n ),\n\n pentagon: (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\n <polygon points=\"20,6 34,15 28,32 12,32 6,15\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n </svg>\n ),\n\n chevron: (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 100 100\">\n <polyline\n points=\"0,0 50,100 100,0\"\n fill=\"none\"\n stroke=\"black\"\n strokeWidth=\"5\"\n />\n </svg>\n ),\n table3x3: (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\n <rect x=\"4\" y=\"4\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n\n <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"36\" stroke=\"black\" strokeWidth=\"2\"/>\n <line x1=\"26\" y1=\"4\" x2=\"26\" y2=\"36\" stroke=\"black\" strokeWidth=\"2\"/>\n\n <line x1=\"4\" y1=\"14\" x2=\"36\" y2=\"14\" stroke=\"black\" strokeWidth=\"2\"/>\n <line x1=\"4\" y1=\"26\" x2=\"36\" y2=\"26\" stroke=\"black\" strokeWidth=\"2\"/>\n </svg>\n ),\n\n pyramid: (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\n <polygon points=\"20,4 36,36 4,36\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\" />\n <line x1=\"15\" y1=\"12\" x2=\"25\" y2=\"12\" stroke=\"black\" strokeWidth=\"2\" />\n <line x1=\"11\" y1=\"20\" x2=\"28\" y2=\"20\" stroke=\"black\" strokeWidth=\"2\" />\n <line x1=\"7\" y1=\"28\" x2=\"32\" y2=\"28\" stroke=\"black\" strokeWidth=\"2\" />\n </svg>\n ),\n circleArrow: (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\n <circle cx=\"20\" cy=\"20\" r=\"14\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n <line x1=\"20\" y1=\"6\" x2=\"20\" y2=\"0\" stroke=\"black\" strokeWidth=\"2\"/>\n <polygon points=\"18,2 22,2 20,0\" fill=\"black\"/>\n </svg>\n ),\n\n table3x3LeftMerge: (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\n <rect x=\"4\" y=\"4\" width=\"32\" height=\"32\" stroke=\"black\" fill=\"none\" strokeWidth=\"2\"/>\n <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"36\" stroke=\"black\" strokeWidth=\"2\"/>\n <line x1=\"26\" y1=\"4\" x2=\"26\" y2=\"36\" stroke=\"black\" strokeWidth=\"2\"/>\n <line x1=\"14\" y1=\"16\" x2=\"36\" y2=\"16\" stroke=\"black\" strokeWidth=\"2\"/>\n <line x1=\"14\" y1=\"28\" x2=\"36\" y2=\"28\" stroke=\"black\" strokeWidth=\"2\"/>\n </svg>\n ),\n};\n","export default \"data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e\"","// ShapeToolbar.jsx\nimport React, { useState, useRef, useEffect } from 'react';\nimport { SHAPES } from '../features/shape/constants.jsx';\nimport { SHAPE_ICONS } from \"./shapeIcons.jsx\";\nimport { DND_SHAPE } from '../features/board/constants.js';\nimport shapeAdd from '../assets/shape_add.svg';\nimport shapeAddActive from '../assets/shape_add_active.svg';\nimport '../styles/stickerPalette.css';\n\nexport const ShapeToolbar = () => {\n const [shapeOpen, setShapeOpen] = useState(false);\n const wrapperRef = useRef(null);\n\n const toggleShape = (e) => {\n e.stopPropagation();\n setShapeOpen((v) => !v);\n };\n\n useEffect(() => {\n if (!shapeOpen) return;\n const handler = (e) => {\n if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {\n setShapeOpen(false);\n }\n };\n window.addEventListener('pointerdown', handler);\n return () => window.removeEventListener('pointerdown', handler);\n }, [shapeOpen]);\n\n const onShapeDragStart = (shape) => (e) => {\n e.stopPropagation();\n e.dataTransfer.setData(DND_SHAPE, JSON.stringify({ shapeId: shape.id }));\n e.dataTransfer.effectAllowed = 'copy';\n };\n\n return (\n <div className=\"left-toolbar-container dragHandle__custom\" ref={wrapperRef} onClick={(e) => e.stopPropagation()}>\n <div className={`toolbar-card ${shapeOpen ? 'toolbar-card--open' : ''}`}>\n <button onClick={toggleShape} className={`toolbar-btn toolbar-btn--icon toolbar-btn--shape ${shapeOpen ? 'toolbar-btn--active' : ''}`}>\n <div className={`toolbar-shape-plate ${shapeOpen ? 'toolbar-shape-plate--active' : ''}`}>\n <img src={shapeOpen ? shapeAddActive : shapeAdd} alt=\"Фигуры\" draggable={false} />\n </div>\n </button>\n </div>\n {shapeOpen && (\n <div className=\"palette-wrapper\" onClick={(e) => e.stopPropagation()}>\n <div className=\"shape-panel\">\n <div className=\"shape-grid\">\n {SHAPES.map((shape) => (\n <button\n key={shape.id}\n className=\"shape-item\"\n draggable\n onDragStart={onShapeDragStart(shape)}\n title={shape.name}\n >\n {SHAPE_ICONS[shape.id]}\n </button>\n ))}\n </div>\n </div>\n </div>\n )}\n </div>\n );\n};","import { ShapeNode } from '../ui/ShapeNode.jsx'\n\nexport const shapeNodeTypes = {\n shape: ShapeNode,\n}\n","import React, { useEffect, useRef, useState } from 'react'\nimport { ShapeToolbar } from '../components/ShapeToolbar.jsx'\nimport { Board } from '../features/board/ui/Board.jsx'\nimport { useStickersStore } from '../entities/stickers/model/useStickersStore.js'\nimport { shapesApi } from '../shared/api/shapesApi.js'\nimport { shapeNodeTypes } from '../features/shape/public/shapeNodeTypes.js'\n\nconst SafeFallbackWidget = ({ children }) => <div>{children}</div>\n\n/**\n * @typedef {import('@xyflow/react').NodeProps} NodeProps\n * @typedef {Record<string, React.ComponentType<NodeProps>>} NodeTypes\n */\n\n/**\n * @param {{ nodeTypes?: NodeTypes }} props\n */\nexport const ShapeBoardWidget = ({ nodeTypes }) => {\n const setStickers = useStickersStore((state) => state.setStickers)\n const boardRef = useRef(null)\n const [WidgetComp, setWidgetComp] = useState(() => SafeFallbackWidget)\n\n const mergedNodeTypes = {\n ...shapeNodeTypes,\n ...(nodeTypes || {}),\n }\n\n useEffect(() => {\n const loadBoard = async () => {\n try {\n const [allShapes, boardShapes] = await Promise.all([\n shapesApi.getAll(),\n shapesApi.getBoard(),\n ])\n\n const shapeKeyByDbId = new Map(allShapes.map((x) => [String(x.id), x.shapeId]))\n\n let x = 30\n let y = 30\n const items = []\n\n for (const s of boardShapes) {\n const w = s.width ?? 140\n const h = s.height ?? 140\n const r = s.rotation ?? 0\n\n const shapeKey = shapeKeyByDbId.get(String(s.shapeId)) ?? 'square'\n\n items.push({\n id: s.id,\n stickerId: s.id,\n type: 'shape',\n shapeId: shapeKey,\n shapeDbId: s.shapeId,\n x,\n y,\n width: w,\n height: h,\n rotation: r,\n zIndex: 1,\n fill: 'transparent',\n stroke: '#000',\n })\n\n x += 24\n y += 24\n }\n\n setStickers(items)\n } catch (e) {\n console.warn('Не удалось загрузить доску для фигур:', e)\n }\n }\n\n loadBoard()\n }, [setStickers])\n\n useEffect(() => {\n let mounted = true\n\n import('@xyflow/react')\n .then((mod) => {\n if (!mounted) {\n return\n }\n\n const candidate =\n (mod && (mod.Widget || mod.default || mod?.widget || mod?.XyflowWidget)) ?? null\n\n if (typeof candidate === 'function' || React.isValidElement(candidate)) {\n setWidgetComp(() => candidate)\n } else {\n setWidgetComp(() => SafeFallbackWidget)\n }\n })\n .catch(() => {\n if (mounted) {\n setWidgetComp(() => SafeFallbackWidget)\n }\n })\n\n return () => {\n mounted = false\n }\n }, [])\n\n const Wrapper = WidgetComp || SafeFallbackWidget\n\n return (\n <Wrapper>\n <div className=\"relative flex h-screen w-screen bg-gray-100\">\n <ShapeToolbar />\n <Board ref={boardRef} nodeTypes={mergedNodeTypes} />\n </div>\n </Wrapper>\n )\n}\n"],"names":["SHAPE_ICONS","jsx","jsxs","shapeAdd","shapeAddActive","ShapeToolbar","shapeOpen","setShapeOpen","useState","wrapperRef","useRef","toggleShape","e","v","useEffect","handler","onShapeDragStart","shape","DND_SHAPE","SHAPES","shapeNodeTypes","ShapeNode","SafeFallbackWidget","children","ShapeBoardWidget","nodeTypes","setStickers","useStickersStore","state","boardRef","WidgetComp","setWidgetComp","mergedNodeTypes","allShapes","boardShapes","shapesApi","shapeKeyByDbId","x","y","items","s","w","h","r","shapeKey","mounted","mod","candidate","React","Wrapper","Board"],"mappings":"mhBAEaA,EAAc,CACvB,+BACK,MAAA,CAAI,MAAM,KAAK,OAAO,KACnB,SAAAC,EAAAA,kBAAAA,IAAC,OAAA,CAAK,EAAE,IAAI,EAAE,IAAI,MAAM,KAAK,OAAO,KAAK,OAAO,QAAQ,KAAK,OAAO,YAAY,GAAA,CAAG,CAAA,CACvF,EAGJ,+BACK,MAAA,CAAI,MAAM,KAAK,OAAO,KACnB,iCAAC,SAAA,CAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,OAAO,QAAQ,KAAK,OAAO,YAAY,GAAA,CAAG,CAAA,CAC7E,EAGJ,SACIA,EAAAA,kBAAAA,IAAC,MAAA,CAAI,MAAM,KAAK,OAAO,KACnB,SAAAA,wBAAC,UAAA,CAAQ,OAAO,kBAAkB,OAAO,QAAQ,KAAK,OAAO,YAAY,IAAG,EAChF,EAGJ,KACIA,EAAAA,kBAAAA,IAAC,MAAA,CAAI,MAAM,KAAK,OAAO,KACnB,SAAAA,EAAAA,kBAAAA,IAAC,UAAA,CACG,OAAO,2DACP,OAAO,QACP,KAAK,OACL,YAAY,GAAA,CAAA,EAEpB,EAGJ,8BACK,MAAA,CAAI,MAAM,KAAK,OAAO,KACnB,SAAAA,EAAAA,kBAAAA,IAAC,OAAA,CAAK,EAAE,KAAK,EAAE,IAAI,MAAM,IAAI,OAAO,KAAK,OAAO,QAAQ,KAAK,OAAO,YAAY,GAAA,CAAI,CAAA,CACxF,EAGJ,6BACK,MAAA,CAAI,MAAM,KAAK,OAAO,KACnB,iCAAC,OAAA,CAAK,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,OAAO,QAAQ,YAAY,GAAA,CAAI,CAAA,CACxE,EAGJ,MACIC,EAAAA,kBAAAA,KAAC,MAAA,CAAI,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s");exports.EmojiBoardWidget=e.EmojiBoardWidget;exports.emojiNodeTypes=e.emojiNodeTypes;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../chunks/Board-wlHU_0oT.cjs");const e=require("../chunks/EmojiBoardWidget-BA5Xt9cs.cjs");exports.EmojiBoardWidget=e.EmojiBoardWidget;exports.emojiNodeTypes=e.emojiNodeTypes;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,5 +1,7 @@
1
- import { E as a, e as d } from "../EmojiBoardWidget-BSJXzLd_.js";
1
+ import "../chunks/Board-CoDGhH3-.js";
2
+ import { E as m, e as r } from "../chunks/EmojiBoardWidget-C-Uhinz6.js";
2
3
  export {
3
- a as EmojiBoardWidget,
4
- d as emojiNodeTypes
4
+ m as EmojiBoardWidget,
5
+ r as emojiNodeTypes
5
6
  };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./EmojiBoardWidget-Cm305IEM.cjs"),l=require("react"),E="application/x-integration-note",v=["#FFF79A","#FFD7A6","#FFD1F2","#FD9AE7","#99E5FF","#85B3F9","#B2D0FE","#D6C7FF","#A6FFD6","#68DF8B","#FFFFFF","#262626"],R=({onPick:o})=>{const d=a=>()=>{o&&o(a)},c=a=>x=>{x.stopPropagation();try{x.dataTransfer.setData(E,JSON.stringify({color:a})),x.dataTransfer.effectAllowed="copy"}catch(e){console.warn("Не удалось начать перенос заметки:",e)}};return t.jsxRuntimeExports.jsx("div",{className:"palette-panel--large",role:"dialog","aria-label":"Палитра",children:t.jsxRuntimeExports.jsx("div",{className:"palette-grid",children:v.map(a=>t.jsxRuntimeExports.jsx("button",{type:"button",className:"color-swatch color-swatch--large",title:a,style:{background:a},onClick:d(a),draggable:!0,onDragStart:c(a)},a))})})},y="data:image/svg+xml,%3csvg%20width='58'%20height='53'%20viewBox='0%200%2058%2053'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%204.5C1.5%202.84315%202.84315%201.5%204.5%201.5H52.8237C54.4806%201.5%2055.8237%202.84315%2055.8237%204.5V26.2263C55.8237%2040.0334%2044.6308%2051.2263%2030.8237%2051.2263H4.5C2.84315%2051.2263%201.5%2049.8832%201.5%2048.2263V4.5Z'%20stroke='black'%20stroke-width='3'/%3e%3cpath%20d='M35.0601%2031.2097C34.7425%2031.0584%2034.3739%2030.9988%2033.9426%2031.1381L33.7534%2031.2097L33.7524%2031.2107C33.5121%2031.3184%2033.3222%2031.459%2033.2417%2031.6573C33.1549%2031.8715%2033.2259%2032.0712%2033.3187%2032.2156C33.4103%2032.3579%2033.5466%2032.4867%2033.6731%2032.5948C33.7936%2032.6977%2033.9493%2032.8164%2034.0458%2032.896C36.3535%2034.7931%2039.159%2036.2031%2043.164%2036.228L43.163%2036.229C47.4558%2036.378%2051.4539%2036.0058%2054.6019%2034.0582C55.1353%2033.7296%2055.6664%2033.348%2056.0128%2032.9039L56.0118%2032.9029C56.1048%2032.7875%2056.2271%2032.5829%2056.1927%2032.3439C56.1537%2032.0744%2055.9392%2031.8802%2055.6031%2031.7644L55.4249%2031.7188C55.2448%2031.6873%2055.0608%2031.6962%2054.8946%2031.7229C54.6708%2031.7588%2054.4593%2031.8298%2054.2959%2031.903L54.2969%2031.9031C53.9148%2032.0702%2053.565%2032.2641%2053.2255%2032.4511C52.8827%2032.6399%2052.5495%2032.8224%2052.1866%2032.9789L52.1856%2032.9789C48.701%2034.4994%2044.8566%2034.9504%2040.6985%2034.1745L40.6985%2034.1736C38.6283%2033.7916%2037.1913%2032.8572%2035.9052%2031.8179L35.9042%2031.8169C35.6881%2031.6444%2035.3972%2031.3703%2035.0601%2031.2097Z'%20fill='black'%20stroke='black'%20stroke-width='0.5'/%3e%3cpath%20d='M33.3199%2032.0092C33.3711%2031.784%2033.5023%2031.5723%2033.7172%2031.3748L33.7186%2031.3732C33.9351%2031.1771%2034.16%2031.0665%2034.3932%2031.0561C34.6255%2031.0457%2034.8211%2031.1371%2034.9778%2031.2547C35.1328%2031.3711%2035.2665%2031.5255%2035.3799%2031.6731L35.6886%2032.0981C37.637%2034.7374%2038.8375%2037.7048%2037.8721%2041.3534C37.0056%2045.2765%2035.513%2048.7857%2032.1275%2051.0424C31.5557%2051.4251%2030.9218%2051.7831%2030.2602%2051.9579C30.0886%2052.0063%2029.8315%2052.042%2029.586%2051.9604C29.3206%2051.8722%2029.1054%2051.659%2029.0272%2051.288L29.0119%2051.1918C28.9909%2050.9686%2029.0611%2050.7564%2029.156%2050.581C29.2641%2050.3813%2029.4161%2050.208%2029.5556%2050.081C29.8749%2049.7851%2030.2219%2049.5259%2030.5549%2049.2766C30.8073%2049.0875%2031.0527%2048.9034%2031.2845%2048.7058L31.5119%2048.5028L31.5131%2048.5021C34.3886%2045.833%2035.9263%2042.5303%2035.9218%2038.5803L35.9211%2038.5791C35.9245%2036.6231%2035.0456%2035.0563%2033.9747%2033.5785L33.9739%2033.5773C33.9268%2033.5114%2033.8755%2033.4438%2033.821%2033.3711C33.7673%2033.2995%2033.7113%2033.2234%2033.6569%2033.1455C33.5491%2032.9909%2033.4413%2032.8178%2033.3724%2032.6319C33.3026%2032.4439%2033.2691%2032.2329%2033.3199%2032.0092Z'%20fill='black'%20stroke='black'%20stroke-width='0.5'/%3e%3c/svg%3e",S="data:image/svg+xml,%3csvg%20width='58'%20height='53'%20viewBox='0%200%2058%2053'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%204.5C1.5%202.84315%202.84315%201.5%204.5%201.5H52.8237C54.4806%201.5%2055.8237%202.84315%2055.8237%204.5V26.2263C55.8237%2040.0334%2044.6308%2051.2263%2030.8237%2051.2263H4.5C2.84315%2051.2263%201.5%2049.8832%201.5%2048.2263V4.5Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3cpath%20d='M35.0599%2031.2098C34.7423%2031.0585%2034.3737%2030.9989%2033.9424%2031.1382L33.7532%2031.2097L33.7522%2031.2107C33.5119%2031.3185%2033.3221%2031.459%2033.2415%2031.6573C33.1547%2031.8716%2033.2257%2032.0713%2033.3185%2032.2156C33.4101%2032.3579%2033.5464%2032.4868%2033.6729%2032.5948C33.7935%2032.6977%2033.9491%2032.8165%2034.0457%2032.896C36.3533%2034.7932%2039.1588%2036.2031%2043.1638%2036.2281L43.1628%2036.229C47.4556%2036.3781%2051.4537%2036.0059%2054.6017%2034.0583C55.1351%2033.7297%2055.6662%2033.3481%2056.0126%2032.9039L56.0117%2032.9029C56.1047%2032.7876%2056.2269%2032.5829%2056.1925%2032.344C56.1535%2032.0744%2055.939%2031.8803%2055.603%2031.7645L55.4247%2031.7189C55.2446%2031.6874%2055.0607%2031.6962%2054.8944%2031.7229C54.6706%2031.7589%2054.4592%2031.8298%2054.2957%2031.9031L54.2967%2031.9031C53.9146%2032.0702%2053.5648%2032.2642%2053.2253%2032.4511C52.8825%2032.6399%2052.5493%2032.8225%2052.1864%2032.9789L52.1854%2032.9789C48.7008%2034.4994%2044.8564%2034.9504%2040.6983%2034.1746L40.6984%2034.1736C38.6281%2033.7917%2037.1911%2032.8573%2035.905%2031.818L35.904%2031.817C35.688%2031.6445%2035.397%2031.3704%2035.0599%2031.2098Z'%20fill='%230000FF'%20stroke='%230000FF'%20stroke-width='0.5'/%3e%3cpath%20d='M33.32%2032.0091C33.3712%2031.7839%2033.5024%2031.5722%2033.7173%2031.3747L33.7188%2031.373C33.9352%2031.177%2034.1602%2031.0664%2034.3934%2031.056C34.6256%2031.0456%2034.8213%2031.137%2034.9779%2031.2546C35.1329%2031.371%2035.2666%2031.5254%2035.3801%2031.673L35.6888%2032.098C37.6372%2034.7373%2038.8377%2037.7047%2037.8722%2041.3533C37.0057%2045.2764%2035.5131%2048.7856%2032.1276%2051.0422C31.5558%2051.425%2030.9219%2051.783%2030.2604%2051.9578C30.0887%2052.0062%2029.8316%2052.0419%2029.5861%2051.9603C29.3207%2051.8721%2029.1055%2051.6589%2029.0273%2051.2879L29.012%2051.1917C28.9911%2050.9685%2029.0612%2050.7563%2029.1561%2050.5809C29.2643%2050.3812%2029.4162%2050.2079%2029.5557%2050.0809C29.875%2049.785%2030.222%2049.5258%2030.555%2049.2765C30.8075%2049.0874%2031.0529%2048.9032%2031.2846%2048.7057L31.512%2048.5027L31.5132%2048.502C34.3887%2045.8329%2035.9264%2042.5302%2035.9219%2038.5801L35.9212%2038.579C35.9246%2036.623%2035.0457%2035.0562%2033.9748%2033.5784L33.9741%2033.5772C33.927%2033.5113%2033.8756%2033.4437%2033.8211%2033.371C33.7674%2033.2994%2033.7114%2033.2233%2033.6571%2033.1454C33.5492%2032.9908%2033.4414%2032.8177%2033.3725%2032.6318C33.3028%2032.4437%2033.2692%2032.2328%2033.32%2032.0091Z'%20fill='%230000FF'%20stroke='%230000FF'%20stroke-width='0.5'/%3e%3c/svg%3e",W=({onPick:o})=>{const[d,c]=l.useState(!1),a=l.useRef(null),x=e=>{e.stopPropagation(),c(s=>!s)};return l.useEffect(()=>{if(!d)return;const e=s=>{a.current&&!a.current.contains(s.target)&&c(!1)};return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[d]),t.jsxRuntimeExports.jsxs("div",{className:"left-toolbar-container dragHandle__custom",ref:a,onClick:e=>e.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:`toolbar-card ${d?"toolbar-card--open":""}`,children:t.jsxRuntimeExports.jsx("button",{onClick:x,className:`toolbar-btn toolbar-btn--icon toolbar-btn--note ${d?"toolbar-btn--active":""}`,children:t.jsxRuntimeExports.jsx("div",{className:`toolbar-note-plate ${d?"toolbar-note-plate--active":""}`,children:t.jsxRuntimeExports.jsx("img",{src:d?S:y,alt:"Заметки",draggable:!1})})})}),d&&t.jsxRuntimeExports.jsx("div",{className:"palette-wrapper",onClick:e=>e.stopPropagation(),children:t.jsxRuntimeExports.jsx(R,{onPick:e=>{o?.(e),c(!1)}})})]})},w=({children:o})=>t.jsxRuntimeExports.jsx("div",{children:o}),L=()=>{const o=t.useStickersStore(r=>r.addSticker),d=t.useStickersStore(r=>r.setStickers),c=l.useRef(null),[a,x]=l.useState(()=>w);l.useEffect(()=>{(async()=>{try{const i=await t.notesApi.getAll();let h=30,p=30;const k=[];for(const n of i){const u=n.width??t.NOTE_W,g=n.height??t.NOTE_H;k.push({id:n.id,x:h,y:p,color:n.color,width:u,height:g,text:n.content??"",zIndex:1}),h+=24,p+=24}d(k)}catch(i){console.warn("Не удалось загрузить доску для заметок:",i)}})()},[d]),l.useEffect(()=>{let r=!0;return Promise.resolve().then(()=>require("./EmojiBoardWidget-Cm305IEM.cjs")).then(i=>i.index).then(i=>{if(!r)return;const h=(i&&(i.Widget||i.default||i?.widget||i?.XyflowWidget))??null;typeof h=="function"||l.isValidElement(h)?x(()=>h):x(()=>w)}).catch(()=>{r&&x(()=>w)}),()=>{r=!1}},[]);const e=a||w,s=async r=>{try{const i=await t.notesApi.create(r,t.NOTE_W,t.NOTE_H),h=i.width??t.NOTE_W,p=i.height??t.NOTE_H;if(c.current?.addStickerAtCenter){c.current.addStickerAtCenter(r,{id:i.id,text:i.content??"",width:h,height:p});return}o({id:i.id,x:260,y:120,color:r,width:h,height:p,text:i.content??""})}catch(i){console.warn("Не удалось создать заметку:",i)}};return t.jsxRuntimeExports.jsx(e,{children:t.jsxRuntimeExports.jsxs("div",{className:"relative flex h-screen w-screen bg-gray-100",children:[t.jsxRuntimeExports.jsx(W,{onPick:s}),t.jsxRuntimeExports.jsx(t.Board,{ref:c})]})})},M={square:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"32",height:"32",stroke:"black",fill:"none",strokeWidth:"2"})}),circle:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("circle",{cx:"20",cy:"20",r:"14",stroke:"black",fill:"none",strokeWidth:"2"})}),triangle:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("polygon",{points:"20,6 34,34 6,34",stroke:"black",fill:"none",strokeWidth:"2"})}),star:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("polygon",{points:"20,4 25,16 38,16 27,24 32,36 20,28 8,36 13,24 2,16 15,16",stroke:"black",fill:"none",strokeWidth:"2"})}),stick:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("rect",{x:"16",y:"4",width:"8",height:"32",stroke:"black",fill:"none",strokeWidth:"2"})}),line:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",children:t.jsxRuntimeExports.jsx("line",{x1:"4",y1:"20",x2:"36",y2:"20",stroke:"black",strokeWidth:"2"})}),arrow:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",children:[t.jsxRuntimeExports.jsx("line",{x1:"4",y1:"20",x2:"30",y2:"20",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("polygon",{points:"30,14 38,20 30,26",fill:"black"})]}),dblarrow:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",children:[t.jsxRuntimeExports.jsx("polygon",{points:"4,20 12,14 12,26",fill:"black"}),t.jsxRuntimeExports.jsx("line",{x1:"12",y1:"20",x2:"28",y2:"20",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("polygon",{points:"28,14 36,20 28,26",fill:"black"})]}),parallelogram:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:t.jsxRuntimeExports.jsx("polygon",{points:"8,8 34,8 26,32 0,32",stroke:"black",fill:"none",strokeWidth:"2"})}),roundedRect:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:t.jsxRuntimeExports.jsx("rect",{x:"6",y:"10",width:"28",height:"20",rx:"4",ry:"4",stroke:"black",fill:"none",strokeWidth:"2"})}),capsule:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:t.jsxRuntimeExports.jsx("rect",{x:"6",y:"14",width:"28",height:"12",rx:"6",ry:"6",stroke:"black",fill:"none",strokeWidth:"2"})}),pentagon:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:t.jsxRuntimeExports.jsx("polygon",{points:"20,6 34,15 28,32 12,32 6,15",stroke:"black",fill:"none",strokeWidth:"2"})}),chevron:t.jsxRuntimeExports.jsx("svg",{width:"40",height:"40",viewBox:"0 0 100 100",children:t.jsxRuntimeExports.jsx("polyline",{points:"0,0 50,100 100,0",fill:"none",stroke:"black",strokeWidth:"5"})}),table3x3:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[t.jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"32",height:"32",stroke:"black",fill:"none",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"14",y1:"4",x2:"14",y2:"36",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"26",y1:"4",x2:"26",y2:"36",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"4",y1:"14",x2:"36",y2:"14",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"4",y1:"26",x2:"36",y2:"26",stroke:"black",strokeWidth:"2"})]}),pyramid:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[t.jsxRuntimeExports.jsx("polygon",{points:"20,4 36,36 4,36",stroke:"black",fill:"none",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"15",y1:"12",x2:"25",y2:"12",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"11",y1:"20",x2:"28",y2:"20",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"7",y1:"28",x2:"32",y2:"28",stroke:"black",strokeWidth:"2"})]}),circleArrow:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[t.jsxRuntimeExports.jsx("circle",{cx:"20",cy:"20",r:"14",stroke:"black",fill:"none",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"20",y1:"6",x2:"20",y2:"0",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("polygon",{points:"18,2 22,2 20,0",fill:"black"})]}),table3x3LeftMerge:t.jsxRuntimeExports.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",children:[t.jsxRuntimeExports.jsx("rect",{x:"4",y:"4",width:"32",height:"32",stroke:"black",fill:"none",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"14",y1:"4",x2:"14",y2:"36",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"26",y1:"4",x2:"26",y2:"36",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"14",y1:"16",x2:"36",y2:"16",stroke:"black",strokeWidth:"2"}),t.jsxRuntimeExports.jsx("line",{x1:"14",y1:"28",x2:"36",y2:"28",stroke:"black",strokeWidth:"2"})]})},F="data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e",B="data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.5H47C47.8284%201.5%2048.5%202.17157%2048.5%203V47C48.5%2047.8284%2047.8284%2048.5%2047%2048.5H3C2.17157%2048.5%201.5%2047.8284%201.5%2047V3C1.5%202.17157%202.17157%201.5%203%201.5Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e",N=()=>{const[o,d]=l.useState(!1),c=l.useRef(null),a=e=>{e.stopPropagation(),d(s=>!s)};l.useEffect(()=>{if(!o)return;const e=s=>{c.current&&!c.current.contains(s.target)&&d(!1)};return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[o]);const x=e=>s=>{s.stopPropagation(),s.dataTransfer.setData(t.DND_SHAPE,JSON.stringify({shapeId:e.id})),s.dataTransfer.effectAllowed="copy"};return t.jsxRuntimeExports.jsxs("div",{className:"left-toolbar-container dragHandle__custom",ref:c,onClick:e=>e.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:`toolbar-card ${o?"toolbar-card--open":""}`,children:t.jsxRuntimeExports.jsx("button",{onClick:a,className:`toolbar-btn toolbar-btn--icon toolbar-btn--shape ${o?"toolbar-btn--active":""}`,children:t.jsxRuntimeExports.jsx("div",{className:`toolbar-shape-plate ${o?"toolbar-shape-plate--active":""}`,children:t.jsxRuntimeExports.jsx("img",{src:o?B:F,alt:"Фигуры",draggable:!1})})})}),o&&t.jsxRuntimeExports.jsx("div",{className:"palette-wrapper",onClick:e=>e.stopPropagation(),children:t.jsxRuntimeExports.jsx("div",{className:"shape-panel",children:t.jsxRuntimeExports.jsx("div",{className:"shape-grid",children:t.SHAPES.map(e=>t.jsxRuntimeExports.jsx("button",{className:"shape-item",draggable:!0,onDragStart:x(e),title:e.name,children:M[e.id]},e.id))})})})]})},m=({children:o})=>t.jsxRuntimeExports.jsx("div",{children:o}),H=()=>{const o=t.useStickersStore(e=>e.setStickers),d=l.useRef(null),[c,a]=l.useState(()=>m);l.useEffect(()=>{(async()=>{try{const[s,r]=await Promise.all([t.shapesApi.getAll(),t.shapesApi.getBoard()]),i=new Map(s.map(n=>[String(n.id),n.shapeId]));let h=30,p=30;const k=[];for(const n of r){const u=n.width??140,g=n.height??140,f=n.rotation??0,b=i.get(String(n.shapeId))??"square";k.push({id:n.id,stickerId:n.id,type:"shape",shapeId:b,shapeDbId:n.shapeId,x:h,y:p,width:u,height:g,rotation:f,zIndex:1,fill:"transparent",stroke:"#000"}),h+=24,p+=24}o(k)}catch(s){console.warn("Не удалось загрузить доску для фигур:",s)}})()},[o]),l.useEffect(()=>{let e=!0;return Promise.resolve().then(()=>require("./EmojiBoardWidget-Cm305IEM.cjs")).then(s=>s.index).then(s=>{if(!e)return;const r=(s&&(s.Widget||s.default||s?.widget||s?.XyflowWidget))??null;typeof r=="function"||l.isValidElement(r)?a(()=>r):a(()=>m)}).catch(()=>{e&&a(()=>m)}),()=>{e=!1}},[]);const x=c||m;return t.jsxRuntimeExports.jsx(x,{children:t.jsxRuntimeExports.jsxs("div",{className:"relative flex h-screen w-screen bg-gray-100",children:[t.jsxRuntimeExports.jsx(N,{}),t.jsxRuntimeExports.jsx(t.Board,{ref:d})]})})},A="data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='black'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e",I="data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='%230000FF'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e",Z=()=>{const[o,d]=l.useState(!1),c=t.useStickersStore(e=>e.addSticker),a=t.useStickersStore(e=>e.topZ),x=async()=>{if(!o){d(!0);try{const e=(a||1)+1,s=await t.markdownApi.create({content:`# Новый Markdown
1
+ "use strict";var v=Object.create;var b=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var y=(s,a,c,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of S(a))!R.call(s,d)&&d!==c&&b(s,d,{get:()=>a[d],enumerable:!(i=L(a,d))||i.enumerable});return s};var f=(s,a,c)=>(c=s!=null?v(M(s)):{},y(a||!s||!s.__esModule?b(c,"default",{value:s,enumerable:!0}):c,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/Board-wlHU_0oT.cjs"),j=require("./chunks/EmojiBoardWidget-BA5Xt9cs.cjs"),p=require("react"),E=require("./chunks/ShapeBoardWidget-BKEMVbRg.cjs"),F="application/x-integration-note",N=["#FFF79A","#FFD7A6","#FFD1F2","#FD9AE7","#99E5FF","#85B3F9","#B2D0FE","#D6C7FF","#A6FFD6","#68DF8B","#FFFFFF","#262626"],W=({onPick:s})=>{const a=i=>()=>{s&&s(i)},c=i=>d=>{d.stopPropagation();try{d.dataTransfer.setData(F,JSON.stringify({color:i})),d.dataTransfer.effectAllowed="copy"}catch(e){console.warn("Не удалось начать перенос заметки:",e)}};return t.jsxRuntimeExports.jsx("div",{className:"palette-panel--large",role:"dialog","aria-label":"Палитра",children:t.jsxRuntimeExports.jsx("div",{className:"palette-grid",children:N.map(i=>t.jsxRuntimeExports.jsx("button",{type:"button",className:"color-swatch color-swatch--large",title:i,style:{background:i},onClick:a(i),draggable:!0,onDragStart:c(i)},i))})})},B="data:image/svg+xml,%3csvg%20width='58'%20height='53'%20viewBox='0%200%2058%2053'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%204.5C1.5%202.84315%202.84315%201.5%204.5%201.5H52.8237C54.4806%201.5%2055.8237%202.84315%2055.8237%204.5V26.2263C55.8237%2040.0334%2044.6308%2051.2263%2030.8237%2051.2263H4.5C2.84315%2051.2263%201.5%2049.8832%201.5%2048.2263V4.5Z'%20stroke='black'%20stroke-width='3'/%3e%3cpath%20d='M35.0601%2031.2097C34.7425%2031.0584%2034.3739%2030.9988%2033.9426%2031.1381L33.7534%2031.2097L33.7524%2031.2107C33.5121%2031.3184%2033.3222%2031.459%2033.2417%2031.6573C33.1549%2031.8715%2033.2259%2032.0712%2033.3187%2032.2156C33.4103%2032.3579%2033.5466%2032.4867%2033.6731%2032.5948C33.7936%2032.6977%2033.9493%2032.8164%2034.0458%2032.896C36.3535%2034.7931%2039.159%2036.2031%2043.164%2036.228L43.163%2036.229C47.4558%2036.378%2051.4539%2036.0058%2054.6019%2034.0582C55.1353%2033.7296%2055.6664%2033.348%2056.0128%2032.9039L56.0118%2032.9029C56.1048%2032.7875%2056.2271%2032.5829%2056.1927%2032.3439C56.1537%2032.0744%2055.9392%2031.8802%2055.6031%2031.7644L55.4249%2031.7188C55.2448%2031.6873%2055.0608%2031.6962%2054.8946%2031.7229C54.6708%2031.7588%2054.4593%2031.8298%2054.2959%2031.903L54.2969%2031.9031C53.9148%2032.0702%2053.565%2032.2641%2053.2255%2032.4511C52.8827%2032.6399%2052.5495%2032.8224%2052.1866%2032.9789L52.1856%2032.9789C48.701%2034.4994%2044.8566%2034.9504%2040.6985%2034.1745L40.6985%2034.1736C38.6283%2033.7916%2037.1913%2032.8572%2035.9052%2031.8179L35.9042%2031.8169C35.6881%2031.6444%2035.3972%2031.3703%2035.0601%2031.2097Z'%20fill='black'%20stroke='black'%20stroke-width='0.5'/%3e%3cpath%20d='M33.3199%2032.0092C33.3711%2031.784%2033.5023%2031.5723%2033.7172%2031.3748L33.7186%2031.3732C33.9351%2031.1771%2034.16%2031.0665%2034.3932%2031.0561C34.6255%2031.0457%2034.8211%2031.1371%2034.9778%2031.2547C35.1328%2031.3711%2035.2665%2031.5255%2035.3799%2031.6731L35.6886%2032.0981C37.637%2034.7374%2038.8375%2037.7048%2037.8721%2041.3534C37.0056%2045.2765%2035.513%2048.7857%2032.1275%2051.0424C31.5557%2051.4251%2030.9218%2051.7831%2030.2602%2051.9579C30.0886%2052.0063%2029.8315%2052.042%2029.586%2051.9604C29.3206%2051.8722%2029.1054%2051.659%2029.0272%2051.288L29.0119%2051.1918C28.9909%2050.9686%2029.0611%2050.7564%2029.156%2050.581C29.2641%2050.3813%2029.4161%2050.208%2029.5556%2050.081C29.8749%2049.7851%2030.2219%2049.5259%2030.5549%2049.2766C30.8073%2049.0875%2031.0527%2048.9034%2031.2845%2048.7058L31.5119%2048.5028L31.5131%2048.5021C34.3886%2045.833%2035.9263%2042.5303%2035.9218%2038.5803L35.9211%2038.5791C35.9245%2036.6231%2035.0456%2035.0563%2033.9747%2033.5785L33.9739%2033.5773C33.9268%2033.5114%2033.8755%2033.4438%2033.821%2033.3711C33.7673%2033.2995%2033.7113%2033.2234%2033.6569%2033.1455C33.5491%2032.9909%2033.4413%2032.8178%2033.3724%2032.6319C33.3026%2032.4439%2033.2691%2032.2329%2033.3199%2032.0092Z'%20fill='black'%20stroke='black'%20stroke-width='0.5'/%3e%3c/svg%3e",Z="data:image/svg+xml,%3csvg%20width='58'%20height='53'%20viewBox='0%200%2058%2053'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%204.5C1.5%202.84315%202.84315%201.5%204.5%201.5H52.8237C54.4806%201.5%2055.8237%202.84315%2055.8237%204.5V26.2263C55.8237%2040.0334%2044.6308%2051.2263%2030.8237%2051.2263H4.5C2.84315%2051.2263%201.5%2049.8832%201.5%2048.2263V4.5Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3cpath%20d='M35.0599%2031.2098C34.7423%2031.0585%2034.3737%2030.9989%2033.9424%2031.1382L33.7532%2031.2097L33.7522%2031.2107C33.5119%2031.3185%2033.3221%2031.459%2033.2415%2031.6573C33.1547%2031.8716%2033.2257%2032.0713%2033.3185%2032.2156C33.4101%2032.3579%2033.5464%2032.4868%2033.6729%2032.5948C33.7935%2032.6977%2033.9491%2032.8165%2034.0457%2032.896C36.3533%2034.7932%2039.1588%2036.2031%2043.1638%2036.2281L43.1628%2036.229C47.4556%2036.3781%2051.4537%2036.0059%2054.6017%2034.0583C55.1351%2033.7297%2055.6662%2033.3481%2056.0126%2032.9039L56.0117%2032.9029C56.1047%2032.7876%2056.2269%2032.5829%2056.1925%2032.344C56.1535%2032.0744%2055.939%2031.8803%2055.603%2031.7645L55.4247%2031.7189C55.2446%2031.6874%2055.0607%2031.6962%2054.8944%2031.7229C54.6706%2031.7589%2054.4592%2031.8298%2054.2957%2031.9031L54.2967%2031.9031C53.9146%2032.0702%2053.5648%2032.2642%2053.2253%2032.4511C52.8825%2032.6399%2052.5493%2032.8225%2052.1864%2032.9789L52.1854%2032.9789C48.7008%2034.4994%2044.8564%2034.9504%2040.6983%2034.1746L40.6984%2034.1736C38.6281%2033.7917%2037.1911%2032.8573%2035.905%2031.818L35.904%2031.817C35.688%2031.6445%2035.397%2031.3704%2035.0599%2031.2098Z'%20fill='%230000FF'%20stroke='%230000FF'%20stroke-width='0.5'/%3e%3cpath%20d='M33.32%2032.0091C33.3712%2031.7839%2033.5024%2031.5722%2033.7173%2031.3747L33.7188%2031.373C33.9352%2031.177%2034.1602%2031.0664%2034.3934%2031.056C34.6256%2031.0456%2034.8213%2031.137%2034.9779%2031.2546C35.1329%2031.371%2035.2666%2031.5254%2035.3801%2031.673L35.6888%2032.098C37.6372%2034.7373%2038.8377%2037.7047%2037.8722%2041.3533C37.0057%2045.2764%2035.5131%2048.7856%2032.1276%2051.0422C31.5558%2051.425%2030.9219%2051.783%2030.2604%2051.9578C30.0887%2052.0062%2029.8316%2052.0419%2029.5861%2051.9603C29.3207%2051.8721%2029.1055%2051.6589%2029.0273%2051.2879L29.012%2051.1917C28.9911%2050.9685%2029.0612%2050.7563%2029.1561%2050.5809C29.2643%2050.3812%2029.4162%2050.2079%2029.5557%2050.0809C29.875%2049.785%2030.222%2049.5258%2030.555%2049.2765C30.8075%2049.0874%2031.0529%2048.9032%2031.2846%2048.7057L31.512%2048.5027L31.5132%2048.502C34.3887%2045.8329%2035.9264%2042.5302%2035.9219%2038.5801L35.9212%2038.579C35.9246%2036.623%2035.0457%2035.0562%2033.9748%2033.5784L33.9741%2033.5772C33.927%2033.5113%2033.8756%2033.4437%2033.8211%2033.371C33.7674%2033.2994%2033.7114%2033.2233%2033.6571%2033.1454C33.5492%2032.9908%2033.4414%2032.8177%2033.3725%2032.6318C33.3028%2032.4437%2033.2692%2032.2328%2033.32%2032.0091Z'%20fill='%230000FF'%20stroke='%230000FF'%20stroke-width='0.5'/%3e%3c/svg%3e",H=({onPick:s})=>{const[a,c]=p.useState(!1),i=p.useRef(null),d=e=>{e.stopPropagation(),c(o=>!o)};return p.useEffect(()=>{if(!a)return;const e=o=>{i.current&&!i.current.contains(o.target)&&c(!1)};return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[a]),t.jsxRuntimeExports.jsxs("div",{className:"left-toolbar-container dragHandle__custom",ref:i,onClick:e=>e.stopPropagation(),children:[t.jsxRuntimeExports.jsx("div",{className:`toolbar-card ${a?"toolbar-card--open":""}`,children:t.jsxRuntimeExports.jsx("button",{onClick:d,className:`toolbar-btn toolbar-btn--icon toolbar-btn--note ${a?"toolbar-btn--active":""}`,children:t.jsxRuntimeExports.jsx("div",{className:`toolbar-note-plate ${a?"toolbar-note-plate--active":""}`,children:t.jsxRuntimeExports.jsx("img",{src:a?Z:B,alt:"Заметки",draggable:!1})})})}),a&&t.jsxRuntimeExports.jsx("div",{className:"palette-wrapper",onClick:e=>e.stopPropagation(),children:t.jsxRuntimeExports.jsx(W,{onPick:e=>{s?.(e),c(!1)}})})]})},x=({children:s})=>t.jsxRuntimeExports.jsx("div",{children:s}),V=()=>{const s=t.useStickersStore(r=>r.addSticker),a=t.useStickersStore(r=>r.setStickers),c=p.useRef(null),[i,d]=p.useState(()=>x);p.useEffect(()=>{(async()=>{try{const n=await t.notesApi.getAll();let h=30,C=30;const k=[];for(const l of n){const u=l.width??t.NOTE_W,m=l.height??t.NOTE_H;k.push({id:l.id,x:h,y:C,color:l.color,width:u,height:m,text:l.content??"",zIndex:1}),h+=24,C+=24}a(k)}catch(n){console.warn("Не удалось загрузить доску для заметок:",n)}})()},[a]),p.useEffect(()=>{let r=!0;return import("@xyflow/react").then(n=>{if(!r)return;const h=(n&&(n.Widget||n.default||n?.widget||n?.XyflowWidget))??null;typeof h=="function"||p.isValidElement(h)?d(()=>h):d(()=>x)}).catch(()=>{r&&d(()=>x)}),()=>{r=!1}},[]);const e=i||x,o=async r=>{try{const n=await t.notesApi.create(r,t.NOTE_W,t.NOTE_H),h=n.width??t.NOTE_W,C=n.height??t.NOTE_H;if(c.current?.addStickerAtCenter){c.current.addStickerAtCenter(r,{id:n.id,text:n.content??"",width:h,height:C});return}s({id:n.id,x:260,y:120,color:r,width:h,height:C,text:n.content??""})}catch(n){console.warn("Не удалось создать заметку:",n)}};return t.jsxRuntimeExports.jsx(e,{children:t.jsxRuntimeExports.jsxs("div",{className:"relative flex h-screen w-screen bg-gray-100",children:[t.jsxRuntimeExports.jsx(H,{onPick:o}),t.jsxRuntimeExports.jsx(t.Board,{ref:c})]})})},A="data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='black'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e",I="data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='%230000FF'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e",T=()=>{const[s,a]=p.useState(!1),c=t.useStickersStore(e=>e.addSticker),i=t.useStickersStore(e=>e.topZ),d=async()=>{if(!s){a(!0);try{const e=(i||1)+1,o=await t.markdownApi.create({content:`# Новый Markdown
2
2
 
3
- Начните писать здесь...`,width:600,height:400,isEditorVisible:!0}),r=window.innerWidth/2-300,i=window.innerHeight/2-200;c({id:s.id,stickerId:s.markdownId,isEditorVisible:s.isEditorVisible??!0,type:"markdown",x:r,y:i,width:s.width??600,height:s.height??400,text:s.content??"",zIndex:e})}catch(e){console.warn("Не удалось создать markdown блок:",e)}finally{d(!1)}}};return t.jsxRuntimeExports.jsx("div",{className:"left-toolbar-container",onClick:e=>e.stopPropagation(),children:t.jsxRuntimeExports.jsx("div",{className:"toolbar-card",children:t.jsxRuntimeExports.jsx("button",{onClick:x,disabled:o,className:`toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${o?"toolbar-btn--active":""}`.trim(),title:"Добавить Markdown блок",children:t.jsxRuntimeExports.jsx("div",{className:`toolbar-markdown-plate ${o?"toolbar-markdown-plate--active":""}`,children:t.jsxRuntimeExports.jsx("img",{src:o?I:A,alt:"Markdown",draggable:!1})})})})})},j=({children:o})=>t.jsxRuntimeExports.jsx("div",{children:o}),V=()=>{const o=t.useStickersStore(e=>e.setStickers),d=l.useRef(null),[c,a]=l.useState(()=>j);l.useEffect(()=>{(async()=>{try{const s=await t.markdownApi.getBoard();let r=30,i=30;const h=[];for(const p of s){const k=p.width??600,n=p.height??400;h.push({id:p.id,stickerId:p.markdownId,isEditorVisible:p.isEditorVisible??!0,type:"markdown",x:r,y:i,width:k,height:n,text:p.content??"",zIndex:1}),r+=24,i+=24}o(h)}catch(s){console.warn("Не удалось загрузить доску для markdown:",s)}})()},[o]),l.useEffect(()=>{let e=!0;return Promise.resolve().then(()=>require("./EmojiBoardWidget-Cm305IEM.cjs")).then(s=>s.index).then(s=>{if(!e)return;const r=(s&&(s.Widget||s.default||s?.widget||s?.XyflowWidget))??null;typeof r=="function"||l.isValidElement(r)?a(()=>r):a(()=>j)}).catch(()=>{e&&a(()=>j)}),()=>{e=!1}},[]);const x=c||j;return t.jsxRuntimeExports.jsx(x,{children:t.jsxRuntimeExports.jsxs("div",{className:"relative flex h-screen w-screen bg-gray-100",children:[t.jsxRuntimeExports.jsx(Z,{createInCenter:()=>({x:300,y:200})}),t.jsxRuntimeExports.jsx(t.Board,{ref:d})]})})},P="data:image/svg+xml,%3csvg%20width='57'%20height='45'%20viewBox='0%200%2057%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.1%2023.36H1V44H49.06L55%2033.1067L49.06%2023.36H41.5M9.1%2023.36V18.2M9.1%2023.36H25.3M25.3%2023.36V14.76M25.3%2023.36H41.5M41.5%2023.36V11.32M41.5%2011.32V1H55L51.22%206.16L55%2011.32H41.5Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M22.5999%2033.6799L16.6599%2043.9999H32.8599L38.7999%2033.6799L32.8599%2023.3599H16.6599L22.5999%2033.6799Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3c/svg%3e",T="data:image/svg+xml,%3csvg%20width='57'%20height='45'%20viewBox='0%200%2057%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.1%2023.36H1V44H49.06L55%2033.1067L49.06%2023.36H41.5M9.1%2023.36V18.2M9.1%2023.36H25.3M25.3%2023.36V14.76M25.3%2023.36H41.5M41.5%2023.36V11.32M41.5%2011.32V1H55L51.22%206.16L55%2011.32H41.5Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M22.5999%2033.6799L16.6599%2043.9999H32.8599L38.7999%2033.6799L32.8599%2023.3599H16.6599L22.5999%2033.6799Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3c/svg%3e",D=()=>{const[o,d]=l.useState(!1),c=t.useStickersStore(e=>e.addSticker),a=t.useStickersStore(e=>e.topZ),x=async()=>{if(!o){d(!0);try{const e=(a||1)+1,s=await t.roadmapApi.create({text:"",description:"",date:null,completed:!1,cancelled:!1,zIndex:e,width:200,height:50,parentId:null}),r=window.innerWidth/2-100,i=window.innerHeight/2-60;c({id:String(s.id),type:"roadmap",x:r,y:i,width:s.width??200,height:s.height??120,text:s.text??"",description:s.description??"",date:s.date??null,completed:s.completed??!1,cancelled:s.cancelled??!1,parentId:s.parentId??null,zIndex:s.zIndex??e})}catch(e){console.warn("Не удалось создать roadmap:",e)}finally{d(!1)}}};return t.jsxRuntimeExports.jsx("div",{className:"left-toolbar-container",onClick:e=>e.stopPropagation(),children:t.jsxRuntimeExports.jsx("div",{className:"toolbar-card",children:t.jsxRuntimeExports.jsx("button",{onClick:x,disabled:o,className:`toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${o?"toolbar-btn--active":""}`,title:"Добавить Roadmap",children:t.jsxRuntimeExports.jsx("div",{className:`toolbar-markdown-plate ${o?"toolbar-markdown-plate--active":""}`,children:t.jsxRuntimeExports.jsx("img",{src:o?T:P,alt:"Roadmap",draggable:!1})})})})})},C=({children:o})=>t.jsxRuntimeExports.jsx("div",{children:o}),O=()=>{const o=t.useStickersStore(s=>s.setStickers),d=t.useStickersStore(s=>s.setEdges),c=l.useRef(null),[a,x]=l.useState(()=>C);l.useEffect(()=>{(async()=>{try{const r=await t.roadmapApi.getAll();let i=30,h=30;const p=[],k=[];for(const n of r){const u=n.width??200,g=n.height??120;p.push({id:String(n.id),type:"roadmap",x:i,y:h,width:u,height:g,text:n.text??"",description:n.description??"",date:n.date??null,completed:n.completed??!1,cancelled:n.cancelled??!1,parentId:n.parentId??null,zIndex:n.zIndex??1}),n.parentId&&k.push({id:`e-${n.parentId}-${n.id}`,source:String(n.parentId),target:String(n.id),type:"default",animated:!1}),i+=24,h+=24}o(p),d(k)}catch(r){console.warn("Не удалось загрузить доску для роадмапа:",r)}})()},[o,d]),l.useEffect(()=>{let s=!0;return Promise.resolve().then(()=>require("./EmojiBoardWidget-Cm305IEM.cjs")).then(r=>r.index).then(r=>{if(!s)return;const i=(r&&(r.Widget||r.default||r?.widget||r?.XyflowWidget))??null;typeof i=="function"||l.isValidElement(i)?x(()=>i):x(()=>C)}).catch(()=>{s&&x(()=>C)}),()=>{s=!1}},[]);const e=a||C;return t.jsxRuntimeExports.jsx(e,{children:t.jsxRuntimeExports.jsxs("div",{className:"relative flex h-screen w-screen bg-gray-100",children:[t.jsxRuntimeExports.jsx(D,{createInCenter:()=>({x:300,y:200})}),t.jsxRuntimeExports.jsx(t.Board,{ref:c})]})})};exports.Board=t.Board;exports.EmojiBoardWidget=t.EmojiBoardWidget;exports.baseNodeTypes=t.baseNodeTypes;exports.emojiNodeTypes=t.emojiNodeTypes;exports.MarkdownBoardWidget=V;exports.NoteBoardWidget=L;exports.RoadmapBoardWidget=O;exports.ShapeBoardWidget=H;
3
+ Начните писать здесь...`,width:600,height:400,isEditorVisible:!0}),r=window.innerWidth/2-300,n=window.innerHeight/2-200;c({id:o.id,stickerId:o.markdownId,isEditorVisible:o.isEditorVisible??!0,type:"markdown",x:r,y:n,width:o.width??600,height:o.height??400,text:o.content??"",zIndex:e})}catch(e){console.warn("Не удалось создать markdown блок:",e)}finally{a(!1)}}};return t.jsxRuntimeExports.jsx("div",{className:"left-toolbar-container",onClick:e=>e.stopPropagation(),children:t.jsxRuntimeExports.jsx("div",{className:"toolbar-card",children:t.jsxRuntimeExports.jsx("button",{onClick:d,disabled:s,className:`toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${s?"toolbar-btn--active":""}`.trim(),title:"Добавить Markdown блок",children:t.jsxRuntimeExports.jsx("div",{className:`toolbar-markdown-plate ${s?"toolbar-markdown-plate--active":""}`,children:t.jsxRuntimeExports.jsx("img",{src:s?I:A,alt:"Markdown",draggable:!1})})})})})},w=({children:s})=>t.jsxRuntimeExports.jsx("div",{children:s}),D=()=>{const s=t.useStickersStore(e=>e.setStickers),a=p.useRef(null),[c,i]=p.useState(()=>w);p.useEffect(()=>{(async()=>{try{const o=await t.markdownApi.getBoard();let r=30,n=30;const h=[];for(const C of o){const k=C.width??600,l=C.height??400;h.push({id:C.id,stickerId:C.markdownId,isEditorVisible:C.isEditorVisible??!0,type:"markdown",x:r,y:n,width:k,height:l,text:C.content??"",zIndex:1}),r+=24,n+=24}s(h)}catch(o){console.warn("Не удалось загрузить доску для markdown:",o)}})()},[s]),p.useEffect(()=>{let e=!0;return import("@xyflow/react").then(o=>{if(!e)return;const r=(o&&(o.Widget||o.default||o?.widget||o?.XyflowWidget))??null;typeof r=="function"||p.isValidElement(r)?i(()=>r):i(()=>w)}).catch(()=>{e&&i(()=>w)}),()=>{e=!1}},[]);const d=c||w;return t.jsxRuntimeExports.jsx(d,{children:t.jsxRuntimeExports.jsxs("div",{className:"relative flex h-screen w-screen bg-gray-100",children:[t.jsxRuntimeExports.jsx(T,{createInCenter:()=>({x:300,y:200})}),t.jsxRuntimeExports.jsx(t.Board,{ref:a})]})})},O="data:image/svg+xml,%3csvg%20width='57'%20height='45'%20viewBox='0%200%2057%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.1%2023.36H1V44H49.06L55%2033.1067L49.06%2023.36H41.5M9.1%2023.36V18.2M9.1%2023.36H25.3M25.3%2023.36V14.76M25.3%2023.36H41.5M41.5%2023.36V11.32M41.5%2011.32V1H55L51.22%206.16L55%2011.32H41.5Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M22.5999%2033.6799L16.6599%2043.9999H32.8599L38.7999%2033.6799L32.8599%2023.3599H16.6599L22.5999%2033.6799Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3c/svg%3e",$="data:image/svg+xml,%3csvg%20width='57'%20height='45'%20viewBox='0%200%2057%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.1%2023.36H1V44H49.06L55%2033.1067L49.06%2023.36H41.5M9.1%2023.36V18.2M9.1%2023.36H25.3M25.3%2023.36V14.76M25.3%2023.36H41.5M41.5%2023.36V11.32M41.5%2011.32V1H55L51.22%206.16L55%2011.32H41.5Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M22.5999%2033.6799L16.6599%2043.9999H32.8599L38.7999%2033.6799L32.8599%2023.3599H16.6599L22.5999%2033.6799Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3c/svg%3e",P=()=>{const[s,a]=p.useState(!1),c=t.useStickersStore(e=>e.addSticker),i=t.useStickersStore(e=>e.topZ),d=async()=>{if(!s){a(!0);try{const e=(i||1)+1,o=await t.roadmapApi.create({text:"",description:"",date:null,completed:!1,cancelled:!1,zIndex:e,width:200,height:50,parentId:null}),r=window.innerWidth/2-100,n=window.innerHeight/2-60;c({id:String(o.id),type:"roadmap",x:r,y:n,width:o.width??200,height:o.height??120,text:o.text??"",description:o.description??"",date:o.date??null,completed:o.completed??!1,cancelled:o.cancelled??!1,parentId:o.parentId??null,zIndex:o.zIndex??e})}catch(e){console.warn("Не удалось создать roadmap:",e)}finally{a(!1)}}};return t.jsxRuntimeExports.jsx("div",{className:"left-toolbar-container",onClick:e=>e.stopPropagation(),children:t.jsxRuntimeExports.jsx("div",{className:"toolbar-card",children:t.jsxRuntimeExports.jsx("button",{onClick:d,disabled:s,className:`toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${s?"toolbar-btn--active":""}`,title:"Добавить Roadmap",children:t.jsxRuntimeExports.jsx("div",{className:`toolbar-markdown-plate ${s?"toolbar-markdown-plate--active":""}`,children:t.jsxRuntimeExports.jsx("img",{src:s?$:O,alt:"Roadmap",draggable:!1})})})})})},g=({children:s})=>t.jsxRuntimeExports.jsx("div",{children:s}),_=()=>{const s=t.useStickersStore(o=>o.setStickers),a=t.useStickersStore(o=>o.setEdges),c=p.useRef(null),[i,d]=p.useState(()=>g);p.useEffect(()=>{(async()=>{try{const r=await t.roadmapApi.getAll();let n=30,h=30;const C=[],k=[];for(const l of r){const u=l.width??200,m=l.height??120;C.push({id:String(l.id),type:"roadmap",x:n,y:h,width:u,height:m,text:l.text??"",description:l.description??"",date:l.date??null,completed:l.completed??!1,cancelled:l.cancelled??!1,parentId:l.parentId??null,zIndex:l.zIndex??1}),l.parentId&&k.push({id:`e-${l.parentId}-${l.id}`,source:String(l.parentId),target:String(l.id),type:"default",animated:!1}),n+=24,h+=24}s(C),a(k)}catch(r){console.warn("Не удалось загрузить доску для роадмапа:",r)}})()},[s,a]),p.useEffect(()=>{let o=!0;return import("@xyflow/react").then(r=>{if(!o)return;const n=(r&&(r.Widget||r.default||r?.widget||r?.XyflowWidget))??null;typeof n=="function"||p.isValidElement(n)?d(()=>n):d(()=>g)}).catch(()=>{o&&d(()=>g)}),()=>{o=!1}},[]);const e=i||g;return t.jsxRuntimeExports.jsx(e,{children:t.jsxRuntimeExports.jsxs("div",{className:"relative flex h-screen w-screen bg-gray-100",children:[t.jsxRuntimeExports.jsx(P,{createInCenter:()=>({x:300,y:200})}),t.jsxRuntimeExports.jsx(t.Board,{ref:c})]})})};exports.Board=t.Board;exports.baseNodeTypes=t.baseNodeTypes;exports.EmojiBoardWidget=j.EmojiBoardWidget;exports.emojiNodeTypes=j.emojiNodeTypes;exports.ShapeBoardWidget=E.ShapeBoardWidget;exports.shapeNodeTypes=E.shapeNodeTypes;exports.MarkdownBoardWidget=D;exports.NoteBoardWidget=V;exports.RoadmapBoardWidget=_;
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/components/ColorPalette.jsx","../src/assets/note_add.svg","../src/assets/note_add_active.svg","../src/components/NoteToolbar.jsx","../src/widgets/NoteBoardWidget.jsx","../src/assets/markdown_add.svg","../src/assets/markdown_add_active.svg","../src/components/MarkdownToolbar.jsx","../src/widgets/MarkdownBoardWidget.jsx","../src/assets/roadmap_add.svg","../src/assets/roadmap_add_active.svg","../src/components/RoadmapToolbar.jsx","../src/widgets/RoadmapBoardWidget.jsx"],"sourcesContent":["import React from 'react'\n\nconst DND_NOTE = 'application/x-integration-note'\n\nconst COLORS = [\n '#FFF79A', '#FFD7A6', '#FFD1F2', '#FD9AE7',\n '#99E5FF', '#85B3F9', '#B2D0FE', '#D6C7FF',\n '#A6FFD6', '#68DF8B', '#FFFFFF', '#262626'\n]\n\nexport const ColorPalette = ({ onPick }) => {\n const onSwatchClick = (color) => () => {\n if (onPick) {\n onPick(color)\n }\n }\n\n const onSwatchDragStart = (color) => (e) => {\n e.stopPropagation()\n\n try {\n e.dataTransfer.setData(DND_NOTE, JSON.stringify({ color }))\n e.dataTransfer.effectAllowed = 'copy'\n } catch (err) {\n console.warn('Не удалось начать перенос заметки:', err)\n }\n }\n\n return (\n <div className=\"palette-panel--large\" role=\"dialog\" aria-label=\"Палитра\">\n <div className=\"palette-grid\">\n {COLORS.map((c) => (\n <button\n key={c}\n type=\"button\"\n className=\"color-swatch color-swatch--large\"\n title={c}\n style={{ background: c }}\n onClick={onSwatchClick(c)}\n draggable\n onDragStart={onSwatchDragStart(c)}\n />\n ))}\n </div>\n </div>\n )\n}","export default \"data:image/svg+xml,%3csvg%20width='58'%20height='53'%20viewBox='0%200%2058%2053'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%204.5C1.5%202.84315%202.84315%201.5%204.5%201.5H52.8237C54.4806%201.5%2055.8237%202.84315%2055.8237%204.5V26.2263C55.8237%2040.0334%2044.6308%2051.2263%2030.8237%2051.2263H4.5C2.84315%2051.2263%201.5%2049.8832%201.5%2048.2263V4.5Z'%20stroke='black'%20stroke-width='3'/%3e%3cpath%20d='M35.0601%2031.2097C34.7425%2031.0584%2034.3739%2030.9988%2033.9426%2031.1381L33.7534%2031.2097L33.7524%2031.2107C33.5121%2031.3184%2033.3222%2031.459%2033.2417%2031.6573C33.1549%2031.8715%2033.2259%2032.0712%2033.3187%2032.2156C33.4103%2032.3579%2033.5466%2032.4867%2033.6731%2032.5948C33.7936%2032.6977%2033.9493%2032.8164%2034.0458%2032.896C36.3535%2034.7931%2039.159%2036.2031%2043.164%2036.228L43.163%2036.229C47.4558%2036.378%2051.4539%2036.0058%2054.6019%2034.0582C55.1353%2033.7296%2055.6664%2033.348%2056.0128%2032.9039L56.0118%2032.9029C56.1048%2032.7875%2056.2271%2032.5829%2056.1927%2032.3439C56.1537%2032.0744%2055.9392%2031.8802%2055.6031%2031.7644L55.4249%2031.7188C55.2448%2031.6873%2055.0608%2031.6962%2054.8946%2031.7229C54.6708%2031.7588%2054.4593%2031.8298%2054.2959%2031.903L54.2969%2031.9031C53.9148%2032.0702%2053.565%2032.2641%2053.2255%2032.4511C52.8827%2032.6399%2052.5495%2032.8224%2052.1866%2032.9789L52.1856%2032.9789C48.701%2034.4994%2044.8566%2034.9504%2040.6985%2034.1745L40.6985%2034.1736C38.6283%2033.7916%2037.1913%2032.8572%2035.9052%2031.8179L35.9042%2031.8169C35.6881%2031.6444%2035.3972%2031.3703%2035.0601%2031.2097Z'%20fill='black'%20stroke='black'%20stroke-width='0.5'/%3e%3cpath%20d='M33.3199%2032.0092C33.3711%2031.784%2033.5023%2031.5723%2033.7172%2031.3748L33.7186%2031.3732C33.9351%2031.1771%2034.16%2031.0665%2034.3932%2031.0561C34.6255%2031.0457%2034.8211%2031.1371%2034.9778%2031.2547C35.1328%2031.3711%2035.2665%2031.5255%2035.3799%2031.6731L35.6886%2032.0981C37.637%2034.7374%2038.8375%2037.7048%2037.8721%2041.3534C37.0056%2045.2765%2035.513%2048.7857%2032.1275%2051.0424C31.5557%2051.4251%2030.9218%2051.7831%2030.2602%2051.9579C30.0886%2052.0063%2029.8315%2052.042%2029.586%2051.9604C29.3206%2051.8722%2029.1054%2051.659%2029.0272%2051.288L29.0119%2051.1918C28.9909%2050.9686%2029.0611%2050.7564%2029.156%2050.581C29.2641%2050.3813%2029.4161%2050.208%2029.5556%2050.081C29.8749%2049.7851%2030.2219%2049.5259%2030.5549%2049.2766C30.8073%2049.0875%2031.0527%2048.9034%2031.2845%2048.7058L31.5119%2048.5028L31.5131%2048.5021C34.3886%2045.833%2035.9263%2042.5303%2035.9218%2038.5803L35.9211%2038.5791C35.9245%2036.6231%2035.0456%2035.0563%2033.9747%2033.5785L33.9739%2033.5773C33.9268%2033.5114%2033.8755%2033.4438%2033.821%2033.3711C33.7673%2033.2995%2033.7113%2033.2234%2033.6569%2033.1455C33.5491%2032.9909%2033.4413%2032.8178%2033.3724%2032.6319C33.3026%2032.4439%2033.2691%2032.2329%2033.3199%2032.0092Z'%20fill='black'%20stroke='black'%20stroke-width='0.5'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='58'%20height='53'%20viewBox='0%200%2058%2053'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%204.5C1.5%202.84315%202.84315%201.5%204.5%201.5H52.8237C54.4806%201.5%2055.8237%202.84315%2055.8237%204.5V26.2263C55.8237%2040.0334%2044.6308%2051.2263%2030.8237%2051.2263H4.5C2.84315%2051.2263%201.5%2049.8832%201.5%2048.2263V4.5Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3cpath%20d='M35.0599%2031.2098C34.7423%2031.0585%2034.3737%2030.9989%2033.9424%2031.1382L33.7532%2031.2097L33.7522%2031.2107C33.5119%2031.3185%2033.3221%2031.459%2033.2415%2031.6573C33.1547%2031.8716%2033.2257%2032.0713%2033.3185%2032.2156C33.4101%2032.3579%2033.5464%2032.4868%2033.6729%2032.5948C33.7935%2032.6977%2033.9491%2032.8165%2034.0457%2032.896C36.3533%2034.7932%2039.1588%2036.2031%2043.1638%2036.2281L43.1628%2036.229C47.4556%2036.3781%2051.4537%2036.0059%2054.6017%2034.0583C55.1351%2033.7297%2055.6662%2033.3481%2056.0126%2032.9039L56.0117%2032.9029C56.1047%2032.7876%2056.2269%2032.5829%2056.1925%2032.344C56.1535%2032.0744%2055.939%2031.8803%2055.603%2031.7645L55.4247%2031.7189C55.2446%2031.6874%2055.0607%2031.6962%2054.8944%2031.7229C54.6706%2031.7589%2054.4592%2031.8298%2054.2957%2031.9031L54.2967%2031.9031C53.9146%2032.0702%2053.5648%2032.2642%2053.2253%2032.4511C52.8825%2032.6399%2052.5493%2032.8225%2052.1864%2032.9789L52.1854%2032.9789C48.7008%2034.4994%2044.8564%2034.9504%2040.6983%2034.1746L40.6984%2034.1736C38.6281%2033.7917%2037.1911%2032.8573%2035.905%2031.818L35.904%2031.817C35.688%2031.6445%2035.397%2031.3704%2035.0599%2031.2098Z'%20fill='%230000FF'%20stroke='%230000FF'%20stroke-width='0.5'/%3e%3cpath%20d='M33.32%2032.0091C33.3712%2031.7839%2033.5024%2031.5722%2033.7173%2031.3747L33.7188%2031.373C33.9352%2031.177%2034.1602%2031.0664%2034.3934%2031.056C34.6256%2031.0456%2034.8213%2031.137%2034.9779%2031.2546C35.1329%2031.371%2035.2666%2031.5254%2035.3801%2031.673L35.6888%2032.098C37.6372%2034.7373%2038.8377%2037.7047%2037.8722%2041.3533C37.0057%2045.2764%2035.5131%2048.7856%2032.1276%2051.0422C31.5558%2051.425%2030.9219%2051.783%2030.2604%2051.9578C30.0887%2052.0062%2029.8316%2052.0419%2029.5861%2051.9603C29.3207%2051.8721%2029.1055%2051.6589%2029.0273%2051.2879L29.012%2051.1917C28.9911%2050.9685%2029.0612%2050.7563%2029.1561%2050.5809C29.2643%2050.3812%2029.4162%2050.2079%2029.5557%2050.0809C29.875%2049.785%2030.222%2049.5258%2030.555%2049.2765C30.8075%2049.0874%2031.0529%2048.9032%2031.2846%2048.7057L31.512%2048.5027L31.5132%2048.502C34.3887%2045.8329%2035.9264%2042.5302%2035.9219%2038.5801L35.9212%2038.579C35.9246%2036.623%2035.0457%2035.0562%2033.9748%2033.5784L33.9741%2033.5772C33.927%2033.5113%2033.8756%2033.4437%2033.8211%2033.371C33.7674%2033.2994%2033.7114%2033.2233%2033.6571%2033.1454C33.5492%2032.9908%2033.4414%2032.8177%2033.3725%2032.6318C33.3028%2032.4437%2033.2692%2032.2328%2033.32%2032.0091Z'%20fill='%230000FF'%20stroke='%230000FF'%20stroke-width='0.5'/%3e%3c/svg%3e\"","// NoteToolbar.jsx\nimport React, { useState, useRef, useEffect } from 'react';\nimport { ColorPalette } from './ColorPalette.jsx';\nimport noteAdd from '../assets/note_add.svg';\nimport noteAddActive from '../assets/note_add_active.svg';\nimport '../styles/stickerPalette.css';\n\nexport const NoteToolbar = ({ onPick }) => {\n const [open, setOpen] = useState(false);\n const wrapperRef = useRef(null);\n\n const toggle = (e) => {\n e.stopPropagation();\n setOpen((v) => !v);\n };\n\n useEffect(() => {\n if (!open) return;\n const handler = (e) => {\n if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {\n setOpen(false);\n }\n };\n window.addEventListener('pointerdown', handler);\n return () => window.removeEventListener('pointerdown', handler);\n }, [open]);\n\n return (\n <div className=\"left-toolbar-container dragHandle__custom\" ref={wrapperRef} onClick={(e) => e.stopPropagation()}>\n <div className={`toolbar-card ${open ? 'toolbar-card--open' : ''}`}>\n <button onClick={toggle} className={`toolbar-btn toolbar-btn--icon toolbar-btn--note ${open ? 'toolbar-btn--active' : ''}`}>\n <div className={`toolbar-note-plate ${open ? 'toolbar-note-plate--active' : ''}`}>\n <img src={open ? noteAddActive : noteAdd} alt=\"Заметки\" draggable={false} />\n </div>\n </button>\n </div>\n {open && (\n <div className=\"palette-wrapper\" onClick={(e) => e.stopPropagation()}>\n <ColorPalette onPick={(color) => { onPick?.(color); setOpen(false); }} />\n </div>\n )}\n </div>\n );\n};","// NoteBoardWidget.jsx\nimport React, { useEffect, useRef, useState } from 'react';\nimport { NoteToolbar } from '../components/NoteToolbar.jsx';\nimport { Board } from '../features/board/ui/Board.jsx';\nimport { useStickersStore } from '../entities/stickers/model/useStickersStore.js';\nimport { notesApi } from '../shared/api/notesApi.js';\nimport { NOTE_W, NOTE_H } from '../features/board/constants';\n\nconst SafeFallbackWidget = ({ children }) => <div>{children}</div>;\n\nexport const NoteBoardWidget = () => {\n const addSticker = useStickersStore((state) => state.addSticker);\n const setStickers = useStickersStore((state) => state.setStickers);\n const boardRef = useRef(null);\n const [WidgetComp, setWidgetComp] = useState(() => SafeFallbackWidget);\n\n useEffect(() => {\n const loadBoard = async () => {\n try {\n const notes = await notesApi.getAll();\n let x = 30;\n let y = 30;\n const items = [];\n for (const n of notes) {\n const w = n.width ?? NOTE_W;\n const h = n.height ?? NOTE_H;\n items.push({\n id: n.id,\n x,\n y,\n color: n.color,\n width: w,\n height: h,\n text: n.content ?? '',\n zIndex: 1,\n });\n x += 24;\n y += 24;\n }\n setStickers(items);\n } catch (e) {\n console.warn('Не удалось загрузить доску для заметок:', e);\n }\n };\n loadBoard();\n }, [setStickers]);\n\n useEffect(() => {\n let mounted = true;\n import('@xyflow/react')\n .then((mod) => {\n if (!mounted) return;\n const candidate = (mod && (mod.Widget || mod.default || mod?.widget || mod?.XyflowWidget)) ?? null;\n if (typeof candidate === 'function' || React.isValidElement(candidate)) {\n setWidgetComp(() => candidate);\n } else {\n setWidgetComp(() => SafeFallbackWidget);\n }\n })\n .catch(() => {\n if (mounted) setWidgetComp(() => SafeFallbackWidget);\n });\n return () => { mounted = false; };\n }, []);\n\n const Wrapper = WidgetComp || SafeFallbackWidget;\n\n const handlePick = async (color) => {\n try {\n const created = await notesApi.create(color, NOTE_W, NOTE_H);\n const w = created.width ?? NOTE_W;\n const h = created.height ?? NOTE_H;\n if (boardRef.current?.addStickerAtCenter) {\n boardRef.current.addStickerAtCenter(color, {\n id: created.id,\n text: created.content ?? '',\n width: w,\n height: h,\n });\n return;\n }\n addSticker({\n id: created.id,\n x: 260,\n y: 120,\n color,\n width: w,\n height: h,\n text: created.content ?? '',\n });\n } catch (e) {\n console.warn('Не удалось создать заметку:', e);\n }\n };\n\n return (\n <Wrapper>\n <div className=\"relative flex h-screen w-screen bg-gray-100\">\n <NoteToolbar onPick={handlePick} />\n <Board ref={boardRef} />\n </div>\n </Wrapper>\n );\n};","export default \"data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='black'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='black'%20stroke-width='3'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='52'%20height='51'%20viewBox='0%200%2052%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.5%2049.0548V1.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M14.0801%2034.3356L1.5%201.50049'%20stroke='%230000FF'%20stroke-width='3'/%3e%3cpath%20d='M14.0801%2034.3356L26.6602%201.50049'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M26.6602%201.50049V49.0548'%20stroke='%230000FF'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M50%2025.2776C50%2031.5634%2047.7786%2037.5611%2043.8701%2041.9583C40.3263%2045.945%2035.6696%2048.3122%2030.7773%2048.7151L30.7773%201.84009C35.6696%202.243%2040.3263%204.61018%2043.8701%208.59692C47.7786%2012.9941%2050%2018.9918%2050%2025.2776Z'%20stroke='%230000FF'%20stroke-width='3'/%3e%3c/svg%3e\"","import React, { useState } from 'react';\nimport markdownAdd from '../assets/markdown_add.svg';\nimport markdownAddActive from '../assets/markdown_add_active.svg';\nimport { useStickersStore } from '../entities/stickers/model/useStickersStore';\nimport { markdownApi } from '../shared/api/markdownApi';\nimport '../styles/stickerPalette.css';\nimport '../features/markdown/markdown.css';\n\nexport const MarkdownToolbar = () => {\n const [isCreating, setIsCreating] = useState(false);\n\n const addSticker = useStickersStore(state => state.addSticker);\n const topZ = useStickersStore(state => state.topZ);\n\n const createMarkdown = async () => {\n if (isCreating) return;\n setIsCreating(true);\n\n try {\n const nextZ = (topZ || 1) + 1;\n\n const created = await markdownApi.create({\n content: '# Новый Markdown\\n\\nНачните писать здесь...',\n width: 600,\n height: 400,\n isEditorVisible: true\n });\n\n const centerX = window.innerWidth / 2 - 300;\n const centerY = window.innerHeight / 2 - 200;\n\n addSticker({\n id: created.id,\n stickerId: created.markdownId,\n isEditorVisible: created.isEditorVisible ?? true,\n type: 'markdown',\n x: centerX,\n y: centerY,\n width: created.width ?? 600,\n height: created.height ?? 400,\n text: created.content ?? '',\n zIndex: nextZ\n });\n } catch (err) {\n console.warn('Не удалось создать markdown блок:', err);\n } finally {\n setIsCreating(false);\n }\n };\n\n return (\n <div className=\"left-toolbar-container\" onClick={e => e.stopPropagation()}>\n <div className=\"toolbar-card\">\n <button\n onClick={createMarkdown}\n disabled={isCreating}\n className={`toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${isCreating ? 'toolbar-btn--active' : ''}`.trim()}\n title=\"Добавить Markdown блок\"\n >\n <div className={`toolbar-markdown-plate ${isCreating ? 'toolbar-markdown-plate--active' : ''}`}>\n <img\n src={isCreating ? markdownAddActive : markdownAdd}\n alt=\"Markdown\"\n draggable={false}\n />\n </div>\n </button>\n </div>\n </div>\n );\n};","// MarkdownBoardWidget.jsx\nimport React, { useEffect, useRef, useState } from 'react';\nimport { MarkdownToolbar } from '../components/MarkdownToolbar.jsx';\nimport { Board } from '../features/board/ui/Board.jsx';\nimport { useStickersStore } from '../entities/stickers/model/useStickersStore.js';\nimport { markdownApi } from '../shared/api/markdownApi';\n\nconst SafeFallbackWidget = ({ children }) => <div>{children}</div>;\n\nexport const MarkdownBoardWidget = () => {\n const setStickers = useStickersStore((state) => state.setStickers);\n const boardRef = useRef(null);\n const [WidgetComp, setWidgetComp] = useState(() => SafeFallbackWidget);\n\n useEffect(() => {\n const loadBoard = async () => {\n try {\n const boardMarkdowns = await markdownApi.getBoard();\n let x = 30;\n let y = 30;\n const items = [];\n for (const m of boardMarkdowns) {\n const w = m.width ?? 600;\n const h = m.height ?? 400;\n items.push({\n id: m.id,\n stickerId: m.markdownId,\n isEditorVisible: m.isEditorVisible ?? true,\n type: 'markdown',\n x,\n y,\n width: w,\n height: h,\n text: m.content ?? '',\n zIndex: 1,\n });\n x += 24;\n y += 24;\n }\n setStickers(items);\n } catch (e) {\n console.warn('Не удалось загрузить доску для markdown:', e);\n }\n };\n loadBoard();\n }, [setStickers]);\n\n useEffect(() => {\n let mounted = true;\n import('@xyflow/react')\n .then((mod) => {\n if (!mounted) return;\n const candidate = (mod && (mod.Widget || mod.default || mod?.widget || mod?.XyflowWidget)) ?? null;\n if (typeof candidate === 'function' || React.isValidElement(candidate)) {\n setWidgetComp(() => candidate);\n } else {\n setWidgetComp(() => SafeFallbackWidget);\n }\n })\n .catch(() => {\n if (mounted) setWidgetComp(() => SafeFallbackWidget);\n });\n return () => { mounted = false; };\n }, []);\n\n const Wrapper = WidgetComp || SafeFallbackWidget;\n\n return (\n <Wrapper>\n <div className=\"relative flex h-screen w-screen bg-gray-100\">\n <MarkdownToolbar createInCenter={() => {\n return { x: 300, y: 200 };\n }} />\n <Board ref={boardRef} />\n </div>\n </Wrapper>\n );\n};","export default \"data:image/svg+xml,%3csvg%20width='57'%20height='45'%20viewBox='0%200%2057%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.1%2023.36H1V44H49.06L55%2033.1067L49.06%2023.36H41.5M9.1%2023.36V18.2M9.1%2023.36H25.3M25.3%2023.36V14.76M25.3%2023.36H41.5M41.5%2023.36V11.32M41.5%2011.32V1H55L51.22%206.16L55%2011.32H41.5Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M22.5999%2033.6799L16.6599%2043.9999H32.8599L38.7999%2033.6799L32.8599%2023.3599H16.6599L22.5999%2033.6799Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='57'%20height='45'%20viewBox='0%200%2057%2045'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.1%2023.36H1V44H49.06L55%2033.1067L49.06%2023.36H41.5M9.1%2023.36V18.2M9.1%2023.36H25.3M25.3%2023.36V14.76M25.3%2023.36H41.5M41.5%2023.36V11.32M41.5%2011.32V1H55L51.22%206.16L55%2011.32H41.5Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M22.5999%2033.6799L16.6599%2043.9999H32.8599L38.7999%2033.6799L32.8599%2023.3599H16.6599L22.5999%2033.6799Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M25.3003%209.45337C26.4817%209.45351%2027.5405%2010.489%2027.5405%2011.8938C27.5403%2013.2983%2026.4816%2014.3331%2025.3003%2014.3333C24.1189%2014.3333%2023.0603%2013.2984%2023.0601%2011.8938C23.0601%2010.4889%2024.1188%209.45337%2025.3003%209.45337Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3cpath%20d='M9.10028%2012.8933C10.2817%2012.8934%2011.3405%2013.929%2011.3405%2015.3337C11.3403%2016.7383%2010.2816%2017.7731%209.10028%2017.7732C7.91887%2017.7732%206.86026%2016.7384%206.86005%2015.3337C6.86005%2013.9289%207.91875%2012.8933%209.10028%2012.8933Z'%20stroke='black'%20stroke-width='2'/%3e%3c/svg%3e\"","import React, { useState } from 'react';\nimport roadmapAdd from '../assets/roadmap_add.svg';\nimport roadmapAddActive from '../assets/roadmap_add_active.svg';\nimport { useStickersStore } from '../entities/stickers/model/useStickersStore';\nimport { roadmapApi } from '../shared/api/roadmapApi.js';\nimport '../styles/stickerPalette.css';\nimport '../features/roadmap/roadmap.css';\n\nexport const RoadmapToolbar = () => {\n const [isCreating, setIsCreating] = useState(false);\n\n const addSticker = useStickersStore(state => state.addSticker);\n const topZ = useStickersStore(state => state.topZ);\n\n const createRoadmap = async () => {\n if (isCreating) return;\n setIsCreating(true);\n\n try {\n const nextZ = (topZ || 1) + 1;\n\n const created = await roadmapApi.create({\n text: '',\n description: '',\n date: null,\n completed: false,\n cancelled: false,\n zIndex: nextZ,\n width: 200,\n height: 50,\n parentId: null\n });\n\n // Добавляем в центр экрана (можно настроить координаты)\n const centerX = window.innerWidth / 2 - 100; // - половина ширины\n const centerY = window.innerHeight / 2 - 60; // - половина высоты\n\n addSticker({\n id: String(created.id),\n type: 'roadmap',\n x: centerX,\n y: centerY,\n width: created.width ?? 200,\n height: created.height ?? 120,\n text: created.text ?? '',\n description: created.description ?? '',\n date: created.date ?? null,\n completed: created.completed ?? false,\n cancelled: created.cancelled ?? false,\n parentId: created.parentId ?? null,\n zIndex: created.zIndex ?? nextZ\n });\n } catch (err) {\n console.warn('Не удалось создать roadmap:', err);\n } finally {\n setIsCreating(false);\n }\n };\n\n return (\n <div className=\"left-toolbar-container\" onClick={e => e.stopPropagation()}>\n <div className=\"toolbar-card\">\n <button\n onClick={createRoadmap}\n disabled={isCreating}\n className={`toolbar-btn toolbar-btn--icon toolbar-btn--markdown ${isCreating ? 'toolbar-btn--active' : ''}`}\n title=\"Добавить Roadmap\"\n >\n <div className={`toolbar-markdown-plate ${isCreating ? 'toolbar-markdown-plate--active' : ''}`}>\n <img\n src={isCreating ? roadmapAddActive : roadmapAdd}\n alt=\"Roadmap\"\n draggable={false}\n />\n </div>\n </button>\n </div>\n </div>\n );\n};","// RoadmapBoardWidget.jsx\nimport React, { useEffect, useRef, useState } from 'react';\nimport { RoadmapToolbar } from '../components/RoadmapToolbar.jsx';\nimport { Board } from '../features/board/ui/Board.jsx';\nimport { useStickersStore } from '../entities/stickers/model/useStickersStore.js';\nimport { roadmapApi } from \"../shared/api/roadmapApi.js\";\n\n\nconst SafeFallbackWidget = ({ children }) => <div>{children}</div>;\n\nexport const RoadmapBoardWidget = () => {\n const setStickers = useStickersStore((state) => state.setStickers);\n const setEdges = useStickersStore((state) => state.setEdges);\n const boardRef = useRef(null);\n const [WidgetComp, setWidgetComp] = useState(() => SafeFallbackWidget);\n\n useEffect(() => {\n const loadBoard = async () => {\n try {\n const roadmaps = await roadmapApi.getAll();\n let x = 30;\n let y = 30;\n const items = [];\n const edges = [];\n for (const r of roadmaps) {\n const w = r.width ?? 200;\n const h = r.height ?? 120;\n items.push({\n id: String(r.id),\n type: 'roadmap',\n x,\n y,\n width: w,\n height: h,\n text: r.text ?? '',\n description: r.description ?? '',\n date: r.date ?? null,\n completed: r.completed ?? false,\n cancelled: r.cancelled ?? false,\n parentId: r.parentId ?? null,\n zIndex: r.zIndex ?? 1,\n });\n if (r.parentId) {\n edges.push({\n id: `e-${r.parentId}-${r.id}`,\n source: String(r.parentId),\n target: String(r.id),\n type: 'default',\n animated: false,\n });\n }\n x += 24;\n y += 24;\n }\n setStickers(items);\n setEdges(edges);\n } catch (e) {\n console.warn('Не удалось загрузить доску для роадмапа:', e);\n }\n };\n loadBoard();\n }, [setStickers, setEdges]);\n\n useEffect(() => {\n let mounted = true;\n import('@xyflow/react')\n .then((mod) => {\n if (!mounted) return;\n const candidate = (mod && (mod.Widget || mod.default || mod?.widget || mod?.XyflowWidget)) ?? null;\n if (typeof candidate === 'function' || React.isValidElement(candidate)) {\n setWidgetComp(() => candidate);\n } else {\n setWidgetComp(() => SafeFallbackWidget);\n }\n })\n .catch(() => {\n if (mounted) setWidgetComp(() => SafeFallbackWidget);\n });\n return () => { mounted = false; };\n }, []);\n\n const Wrapper = WidgetComp || SafeFallbackWidget;\n\n return (\n <Wrapper>\n <div className=\"relative flex h-screen w-screen bg-gray-100\">\n <RoadmapToolbar createInCenter={() => {\n return { x: 300, y: 200 };\n }} />\n <Board ref={boardRef} />\n </div>\n </Wrapper>\n );\n};"],"names":["DND_NOTE","COLORS","ColorPalette","onPick","onSwatchClick","color","onSwatchDragStart","e","err","jsx","c","noteAdd","noteAddActive","NoteToolbar","open","setOpen","useState","wrapperRef","useRef","toggle","v","useEffect","handler","jsxs","SafeFallbackWidget","children","NoteBoardWidget","addSticker","useStickersStore","state","setStickers","boardRef","WidgetComp","setWidgetComp","notes","notesApi","x","y","items","n","w","NOTE_W","h","NOTE_H","mounted","mod","candidate","React","Wrapper","handlePick","created","Board","markdownAdd","markdownAddActive","MarkdownToolbar","isCreating","setIsCreating","topZ","createMarkdown","nextZ","markdownApi","centerX","centerY","MarkdownBoardWidget","boardMarkdowns","m","roadmapAdd","roadmapAddActive","RoadmapToolbar","createRoadmap","roadmapApi","RoadmapBoardWidget","setEdges","roadmaps","edges","r"],"mappings":"qsBAEMA,EAAW,iCAEXC,EAAS,CACX,UAAW,UAAW,UAAW,UACjC,UAAW,UAAW,UAAW,UACjC,UAAW,UAAW,UAAW,SACrC,EAEaC,EAAe,CAAC,CAAE,OAAAC,KAAa,CACxC,MAAMC,EAAiBC,GAAU,IAAM,CAC/BF,GACAA,EAAOE,CAAK,CAEpB,EAEMC,EAAqBD,GAAWE,GAAM,CACxCA,EAAE,gBAAA,EAEF,GAAI,CACAA,EAAE,aAAa,QAAQP,EAAU,KAAK,UAAU,CAAE,MAAAK,CAAA,CAAO,CAAC,EAC1DE,EAAE,aAAa,cAAgB,MACnC,OAASC,EAAK,CACV,QAAQ,KAAK,qCAAsCA,CAAG,CAC1D,CACJ,EAEA,OACIC,EAAAA,kBAAAA,IAAC,MA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