{"version":3,"file":"BX_CircleNotes.min.mjs","sources":["../../../src/shapes/BX_CircleNotes.ts"],"sourcesContent":["// @ts-nocheck\nimport { TClassProperties } from '../typedefs';\nimport { classRegistry } from '../ClassRegistry';\nimport { Textbox } from './Textbox';\nimport { createRectNotesDefaultControls } from '../controls/commonControls';\n// @TODO: Many things here are configuration related and shouldn't be on the class nor prototype\n// regexes, list of properties that are not suppose to change by instances, magic consts.\n// this will be a separated effort\nexport const circleNotesDefaultValues: Partial<TClassProperties<CircleNotes>> =\n  {\n    minWidth: 20,\n    dynamicMinWidth: 2,\n    verticalAlign: 'middle',\n    lockScalingFlip: true,\n    noScaleCache: false,\n    _wordJoiners: /[ \\t\\r]/,\n    splitByGrapheme: true,\n    obj_type: 'WBCircleNotes',\n    height: 138,\n    maxHeight: 138,\n    width: 138,\n    noteType: 'circle',\n    radius: 138,\n    breakWords: true,\n    cornerStrokeColor: 'gray',\n    cornerStyle: 'circle',\n    cornerColor: 'white',\n    transparentCorners: false,\n  };\n\n/**\n * Textbox class, based on IText, allows the user to resize the text rectangle\n * and wraps lines automatically. Textboxes have their Y scaling locked, the\n * user can only change width. Height is adjusted automatically based on the\n * wrapping of lines.\n */\nexport class CircleNotes extends Textbox {\n  /**selectable\n   * Minimum width of textbox, in pixels.\n   * @type Number\n   * @default\n   */\n  declare minWidth: number;\n\n  /* boardx cusotm function */\n  declare _id: string;\n\n  declare obj_type: string;\n\n  declare locked: boolean;\n\n  declare whiteboardId: string;\n\n  declare userId: string;\n\n  declare timestamp: Date;\n\n  declare verticalAlign: string;\n\n  declare zIndex: number;\n\n  declare lines: object[];\n\n  declare relationship: object[];\n\n  declare emoj: object[];\n\n  declare userEmoji: object[];\n\n  public extendPropeties = [\n    'obj_type',\n    'whiteboardId',\n    'userId',\n    'timestamp',\n    'zIndex',\n    'locked',\n    'verticalAlign',\n    'lines',\n    '_id',\n    'zIndex',\n    'relationship',\n    'emoj',\n    'userEmoji',\n  ];\n  /**\n   * Minimum calculated width of a textbox, in pixels.\n   * fixed to 2 so that an empty textbox cannot go to 0\n   * and is still selectable without text.\n   * @type Number\n   * @default\n   */\n  declare dynamicMinWidth: number;\n\n  /**\n   * Use this boolean property in order to split strings that have no white space concept.\n   * this is a cheap way to help with chinese/japanese\n   * @type Boolean\n   * @since 2.6.0\n   */\n  declare splitByGrapheme: boolean;\n\n  static textLayoutProperties = [...Textbox.textLayoutProperties, 'width'];\n\n  static ownDefaults: Record<string, any> = circleNotesDefaultValues;\n\n  static getDefaults() {\n    return {\n      ...super.getDefaults(),\n      controls: createRectNotesDefaultControls(),\n      ...CircleNotes.ownDefaults,\n    };\n  }\n\n  /**\n   * Unlike superclass's version of this function, Textbox does not update\n   * its width.\n   * @private\n   * @override\n   */\n  initDimensions() {\n    if (!this.initialized) {\n      return;\n    }\n    this.isEditing && this.initDelayedCursor();\n    this._clearCache();\n    // clear dynamicMinWidth as it will be different after we re-wrap line\n    this.dynamicMinWidth = 0;\n    // wrap lines\n    this._styleMap = this._generateStyleMap(this._splitText());\n    // if after wrapping, the width is smaller than dynamicMinWidth, change the width and re-wrap\n    if (this.dynamicMinWidth > this.width) {\n      this.set('fontSize', this.fontSize - 2);\n      this._splitTextIntoLines(this.text);\n      return;\n    }\n    if (this.textAlign.indexOf('justify') !== -1) {\n      // once text is measured we need to make space fatter to make justified text.\n      this.enlargeSpaces();\n    }\n    // clear cache and re-calculate height\n    const height = this.calcTextHeight();\n    if (height > 76 && this.fontSize > 2) {\n      this.set('fontSize', this.fontSize - 2);\n      this._splitTextIntoLines(this.text);\n      return;\n    }\n\n    this.height = this.maxHeight;\n    return this.height;\n  }\n\n  /**\n   * Generate an object that translates the style object so that it is\n   * broken up by visual lines (new lines and automatic wrapping).\n   * The original text styles object is broken up by actual lines (new lines only),\n   * which is only sufficient for Text / IText\n   * @private\n   */\n  _generateStyleMap(textInfo) {\n    let realLineCount = 0,\n      realLineCharCount = 0,\n      charCount = 0;\n    const map = {};\n\n    for (let i = 0; i < textInfo.graphemeLines.length; i++) {\n      if (textInfo.graphemeText[charCount] === '\\n' && i > 0) {\n        realLineCharCount = 0;\n        charCount++;\n        realLineCount++;\n      } else if (\n        !this.splitByGrapheme &&\n        this._reSpaceAndTab.test(textInfo.graphemeText[charCount]) &&\n        i > 0\n      ) {\n        // this case deals with space's that are removed from end of lines when wrapping\n        realLineCharCount++;\n        charCount++;\n      }\n\n      map[i] = { line: realLineCount, offset: realLineCharCount };\n\n      charCount += textInfo.graphemeLines[i].length;\n      realLineCharCount += textInfo.graphemeLines[i].length;\n    }\n\n    return map;\n  }\n\n  /**\n   * Returns true if object has a style property or has it on a specified line\n   * @param {Number} lineIndex\n   * @return {Boolean}\n   */\n  styleHas(property, lineIndex: number): boolean {\n    if (this._styleMap && !this.isWrapping) {\n      const map = this._styleMap[lineIndex];\n      if (map) {\n        lineIndex = map.line;\n      }\n    }\n    return super.styleHas(property, lineIndex);\n  }\n\n  /**\n   * Returns true if object has no styling or no styling in a line\n   * @param {Number} lineIndex , lineIndex is on wrapped lines.\n   * @return {Boolean}\n   */\n  isEmptyStyles(lineIndex: number): boolean {\n    if (!this.styles) {\n      return true;\n    }\n    let offset = 0,\n      nextLineIndex = lineIndex + 1,\n      nextOffset,\n      shouldLimit = false;\n    const map = this._styleMap[lineIndex],\n      mapNextLine = this._styleMap[lineIndex + 1];\n    if (map) {\n      lineIndex = map.line;\n      offset = map.offset;\n    }\n    if (mapNextLine) {\n      nextLineIndex = mapNextLine.line;\n      shouldLimit = nextLineIndex === lineIndex;\n      nextOffset = mapNextLine.offset;\n    }\n    const obj =\n      typeof lineIndex === 'undefined'\n        ? this.styles\n        : { line: this.styles[lineIndex] };\n    for (const p1 in obj) {\n      for (const p2 in obj[p1]) {\n        if (p2 >= offset && (!shouldLimit || p2 < nextOffset)) {\n          // eslint-disable-next-line no-unused-vars\n          for (const p3 in obj[p1][p2]) {\n            return false;\n          }\n        }\n      }\n    }\n    return true;\n  }\n\n  /**\n   * @param {Number} lineIndex\n   * @param {Number} charIndex\n   * @private\n   */\n  _getStyleDeclaration(lineIndex: number, charIndex: number) {\n    if (this._styleMap && !this.isWrapping) {\n      const map = this._styleMap[lineIndex];\n      if (!map) {\n        return null;\n      }\n      lineIndex = map.line;\n      charIndex = map.offset + charIndex;\n    }\n    return super._getStyleDeclaration(lineIndex, charIndex);\n  }\n\n  /**\n   * @param {Number} lineIndex\n   * @param {Number} charIndex\n   * @param {Object} style\n   * @private\n   */\n  _setStyleDeclaration(lineIndex: number, charIndex: number, style: object) {\n    const map = this._styleMap[lineIndex];\n    lineIndex = map.line;\n    charIndex = map.offset + charIndex;\n\n    this.styles[lineIndex][charIndex] = style;\n  }\n\n  /**\n   * @param {Number} lineIndex\n   * @param {Number} charIndex\n   * @private\n   */\n  _deleteStyleDeclaration(lineIndex: number, charIndex: number) {\n    const map = this._styleMap[lineIndex];\n    lineIndex = map.line;\n    charIndex = map.offset + charIndex;\n    delete this.styles[lineIndex][charIndex];\n  }\n\n  /**\n   * probably broken need a fix\n   * Returns the real style line that correspond to the wrapped lineIndex line\n   * Used just to verify if the line does exist or not.\n   * @param {Number} lineIndex\n   * @returns {Boolean} if the line exists or not\n   * @private\n   */\n  _getLineStyle(lineIndex: number): boolean {\n    const map = this._styleMap[lineIndex];\n    return !!this.styles[map.line];\n  }\n\n  /**\n   * Set the line style to an empty object so that is initialized\n   * @param {Number} lineIndex\n   * @param {Object} style\n   * @private\n   */\n  _setLineStyle(lineIndex: number) {\n    const map = this._styleMap[lineIndex];\n    this.styles[map.line] = {};\n  }\n\n  /**\n   * Wraps text using the 'width' property of Textbox. First this function\n   * splits text on newlines, so we preserve newlines entered by the user.\n   * Then it wraps each line using the width of the Textbox by calling\n   * _wrapLine().\n   * @param {Array} lines The string array of text that is split into lines\n   * @param {Number} desiredWidth width you want to wrap to\n   * @returns {Array} Array of lines\n   */\n  _wrapText(lines: Array<any>, desiredWidth: number): Array<any> {\n    const wrapped = [];\n    this.isWrapping = true;\n    for (let i = 0; i < lines.length; i++) {\n      wrapped.push(...this._wrapLine(lines[i], i, desiredWidth));\n    }\n    this.isWrapping = false;\n    return wrapped;\n  }\n\n  /**\n   * Helper function to measure a string of text, given its lineIndex and charIndex offset\n   * It gets called when charBounds are not available yet.\n   * Override if necessary\n   * Use with {@link Textbox#wordSplit}\n   *\n   * @param {CanvasRenderingContext2D} ctx\n   * @param {String} text\n   * @param {number} lineIndex\n   * @param {number} charOffset\n   * @returns {number}\n   */\n  _measureWord(word, lineIndex: number, charOffset = 0): number {\n    let width = 0,\n      prevGrapheme;\n    const skipLeft = true;\n    for (let i = 0, len = word.length; i < len; i++) {\n      const box = this._getGraphemeBox(\n        word[i],\n        lineIndex,\n        i + charOffset,\n        prevGrapheme,\n        skipLeft\n      );\n      width += box.kernedWidth;\n      prevGrapheme = word[i];\n    }\n    return width;\n  }\n\n  /**\n   * Override this method to customize word splitting\n   * Use with {@link Textbox#_measureWord}\n   * @param {string} value\n   * @returns {string[]} array of words\n   */\n  wordSplit(value: string): string[] {\n    return value.split(this._wordJoiners);\n  }\n\n  /**\n   * Wraps a line of text using the width of the Textbox and a context.\n   * @param {Array} line The grapheme array that represent the line\n   * @param {Number} lineIndex\n   * @param {Number} desiredWidth width you want to wrap the line to\n   * @param {Number} reservedSpace space to remove from wrapping for custom functionalities\n   * @returns {Array} Array of line(s) into which the given text is wrapped\n   * to.\n   */\n  graphemeSplitForRectNotes(textstring: string): string[] {\n    const graphemes = [];\n    const words = textstring.split(/\\b/);\n    for (let i = 0; i < words.length; i++) {\n      // 检查单词是否全为拉丁字母，长度不大于13，且没有四个或更多的连续相同的字母\n      if (\n        /^[a-zA-Z]+$/.test(words[i]) &&\n        words[i].length <= 13 &&\n        !/(\\w)\\1{3,}/.test(words[i])\n      ) {\n        graphemes.push(words[i]);\n      } else {\n        for (let j = 0; j < words[i].length; j++) {\n          graphemes.push(words[i][j]);\n        }\n      }\n    }\n    return graphemes;\n  }\n\n  _wrapLine(\n    _line,\n    lineIndex: number,\n    desiredWidth: number,\n    reservedSpace = 0\n  ): Array<any> {\n    const additionalSpace = this._getWidthOfCharSpacing(),\n      splitByGrapheme = this.splitByGrapheme,\n      graphemeLines = [],\n      words = splitByGrapheme\n        ? this.graphemeSplitForRectNotes(_line)\n        : this.wordSplit(_line),\n      infix = splitByGrapheme ? '' : ' ';\n\n    let lineWidth = 0,\n      line = [],\n      // spaces in different languages?\n      offset = 0,\n      infixWidth = 0,\n      largestWordWidth = 0,\n      lineJustStarted = true;\n    // fix a difference between split and graphemeSplit\n    if (words.length === 0) {\n      words.push([]);\n    }\n    desiredWidth -= reservedSpace;\n    // measure words\n    const data = words.map((word) => {\n      // if using splitByGrapheme words are already in graphemes.\n      word = splitByGrapheme ? word : this.graphemeSplitForRectNotes(word);\n      const width = this._measureWord(word, lineIndex, offset);\n      largestWordWidth = Math.max(width, largestWordWidth);\n      offset += word.length + 1;\n      return { word: word, width: width };\n    });\n    const maxWidth = Math.max(\n      desiredWidth,\n      largestWordWidth,\n      this.dynamicMinWidth\n    );\n    // layout words\n    offset = 0;\n    let i;\n    for (i = 0; i < words.length; i++) {\n      const word = data[i].word;\n      const wordWidth = data[i].width;\n      offset += word.length;\n\n      lineWidth += infixWidth + wordWidth - additionalSpace;\n      if (lineWidth > maxWidth && !lineJustStarted) {\n        graphemeLines.push(line);\n        line = [];\n        lineWidth = wordWidth;\n        lineJustStarted = true;\n      } else {\n        lineWidth += additionalSpace;\n      }\n\n      if (!lineJustStarted && !splitByGrapheme) {\n        line.push(infix);\n      }\n      if (word.length > 1) {\n        line = line.concat(word.split(''));\n      } else {\n        line = line.concat(word);\n      }\n\n      infixWidth = splitByGrapheme\n        ? 0\n        : this._measureWord([infix], lineIndex, offset);\n      offset++;\n      lineJustStarted = false;\n    }\n\n    i && graphemeLines.push(line);\n\n    if (largestWordWidth + reservedSpace > this.dynamicMinWidth) {\n      this.dynamicMinWidth = largestWordWidth - additionalSpace + reservedSpace;\n    }\n    return graphemeLines;\n  }\n\n  /**\n   * Detect if the text line is ended with an hard break\n   * text and itext do not have wrapping, return false\n   * @param {Number} lineIndex text to split\n   * @return {Boolean}\n   */\n  isEndOfWrapping(lineIndex: number): boolean {\n    if (!this._styleMap[lineIndex + 1]) {\n      // is last line, return true;\n      return true;\n    }\n    if (this._styleMap[lineIndex + 1].line !== this._styleMap[lineIndex].line) {\n      // this is last line before a line break, return true;\n      return true;\n    }\n    return false;\n  }\n\n  /**\n   * Detect if a line has a linebreak and so we need to account for it when moving\n   * and counting style.\n   * @return Number\n   */\n  missingNewlineOffset(lineIndex) {\n    if (this.splitByGrapheme) {\n      return this.isEndOfWrapping(lineIndex) ? 1 : 0;\n    }\n    return 1;\n  }\n\n  /**\n   * Gets lines of text to render in the Textbox. This function calculates\n   * text wrapping on the fly every time it is called.\n   * @param {String} text text to split\n   * @returns {Array} Array of lines in the Textbox.\n   * @override\n   */\n  _splitTextIntoLines(text: string) {\n    const newText = super._splitTextIntoLines(text),\n      graphemeLines = this._wrapText(newText.lines, this.width),\n      lines = new Array(graphemeLines.length);\n    for (let i = 0; i < graphemeLines.length; i++) {\n      lines[i] = graphemeLines[i].join('');\n    }\n    newText.lines = lines;\n    newText.graphemeLines = graphemeLines;\n    return newText;\n  }\n\n  getMinWidth() {\n    return Math.max(this.minWidth, this.dynamicMinWidth);\n  }\n\n  _removeExtraneousStyles() {\n    const linesToKeep = {};\n    for (const prop in this._styleMap) {\n      if (this._textLines[prop]) {\n        linesToKeep[this._styleMap[prop].line] = 1;\n      }\n    }\n    for (const prop in this.styles) {\n      if (!linesToKeep[prop]) {\n        delete this.styles[prop];\n      }\n    }\n  }\n\n  getObject() {\n    const object = {};\n    const keys = [\n      '_id', // string, the id of the object\n      'angle', //  integer, angle for recording rotating\n      'backgroundColor', // string,  background color, works when the image is transparent\n      'fill', // the font color\n      'width', // integer, width of the object\n      'height', // integer, height of the object\n      'left', // integer left for position\n      'lines', // array, the arrows array [{…}]\n      'locked', // boolean, lock status for the widget， this is connected to lock\n      'lockMovementX', // boolean, lock the verticle movement\n      'lockMovementY', // boolean, lock the horizontal movement\n      'lockScalingFlip', // boolean,  make it can not be inverted by pulling the width to the negative side\n      'obj_type', // object type\n      'originX', // string, Horizontal origin of transformation of an object (one of \"left\", \"right\", \"center\") See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups\n      'originY', // string, Vertical origin of transformation of an object (one of \"top\", \"bottom\", \"center\") See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups\n      'scaleX', // nunber, Object scale factor (horizontal)\n      'scaleY', // number, Object scale factor (vertical)\n      'selectable', // boolean, When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection). But events still fire on it.\n      'top', // integer, Top position of an object. Note that by default it's relative to object top. You can change this by setting originY={top/center/bottom}\n      'userNo', // string, the unique id for the user, one user id could open mutiple browser, each browser has unique user no\n      'userId', // string, user identity\n      'whiteboardId', // whiteboard id, string\n      'zIndex', // the index for the object on whiteboard, integer\n      'version', // version of the app, string\n      'isPanel', // is this a panel, boolean\n      'panelObj', // if this is a panel, the id of the panel, string\n      'relationship', // array, viewporttransform\n      'subObjList', // [\"5H9qYfNGt4vizhcuS\"] array list _id for sub objects\n      'fontFamily', // string, font family\n      'fontSize', // integer, font size\n      'fontWeight', // integer, font weight\n      'lineHeight', // integer, font height\n      'strokeWidth', //\n      'text', // string, text\n      'textAlign', // string, alignment\n      'imageSrc', // src for the note draw\n      'isDraw', // is this a draw note\n      'emoji', // [0,0,0,0,0], record the emoji\n      'userEmoji', // [{userid,[0,0,0,0,1]},{userid,[0,0,0,0,1]}], record who vote the emoji\n      'editable', // text editable,\n      'lastEditedBy', // last edited by\n    ];\n    keys.forEach((key) => {\n      object[key] = this[key];\n    });\n    return object;\n  }\n\n  /**\n   * Returns object representation of an instance\n   * @method toObject\n   * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output\n   * @return {Object} object representation of an instance\n   */\n  toObject(propertiesToInclude: Array<any>): object {\n    return super.toObject(\n      [...this.extendPropeties, 'minWidth', 'splitByGrapheme'].concat(\n        propertiesToInclude\n      )\n    );\n  }\n  /**boardx custom function */\n\n  getWidgetMenuList() {\n    if (this.isDraw) {\n      return [\n        'textNote',\n        'borderLineIcon',\n        'backgroundColor',\n        'resetDraw',\n        'switchNoteType',\n        'drawOption',\n        'lineWidth',\n        'noteDrawColor', // strokeColor\n        'emojiMenu',\n        'more',\n        'objectLock',\n        'aiassist',\n      ];\n    }\n    if (this.locked) {\n      return ['objectLock'];\n    }\n    return [\n      'drawNote',\n      'more',\n      'borderLineIcon',\n      'switchNoteType',\n      'fontSize',\n      'textAlign',\n      'backgroundColor',\n      'emojiMenu',\n      'fontWeight',\n      'textBullet',\n      'objectLock',\n      'delete',\n      'aiassist',\n    ];\n  }\n  getWidgetMenuTouchList() {\n    if (this.isDraw) {\n      return ['emojiMenu', 'objectLock'];\n    }\n    if (this.locked) {\n      return ['objectLock'];\n    }\n    return [\n      'objectDelete',\n      'moreMenuStickyNote',\n      'backgroundColor',\n      'fontColor',\n      'emojiMenu',\n      'objectLock',\n      'aiassist',\n    ];\n  }\n  getWidgetMenuLength() {\n    if (this.locked) return 50;\n    if (this.isDraw) {\n      return 308;\n    }\n    return 420;\n  }\n  /* caculate cusor positon in the middle of the textbox */\n  getCenteredTop(rectHeight) {\n    const textHeight = this.height;\n    return (rectHeight - textHeight) / 2;\n  }\n\n  _getTopOffset() {\n    switch (this.verticalAlign) {\n      case 'middle':\n        return -this._getTotalLineHeights() / 2;\n      case 'bottom':\n        return this.height / 2 - this._getTotalLineHeights();\n      default:\n        return -this.height / 2;\n    }\n  }\n\n  _getTotalLineHeight() {\n    return this._textLines.reduce(\n      (total, _line, index) => total + this.getHeightOfLine(index),\n      0\n    );\n  }\n\n  _getTotalLineHeights() {\n    return this._textLines.reduce(\n      (total, line, index) => total + this.getHeightOfLine(index),\n      0\n    );\n  }\n\n  _render(ctx) {\n    const path: any = this.path;\n\n    path && !path.isNotVisible() && path._render(ctx);\n    this._setTextStyles(ctx);\n    this._renderTextLinesBackground(ctx);\n    this._renderTextDecoration(ctx, 'underline');\n    this._renderText(ctx);\n    this._renderTextDecoration(ctx, 'overline');\n    this._renderTextDecoration(ctx, 'linethrough');\n\n    const isEmojiExist = !(\n      this.emoji === undefined || this.emoji.join() === '0,0,0,0,0'\n    );\n    if (isEmojiExist) {\n      this.renderEmoji(ctx);\n    }\n  }\n\n  renderEmoji(ctx) {\n    if (this.emoji === undefined) {\n      return;\n    }\n\n    let width = 0;\n    const imageList = [\n      this.canvas.emoji_thumb,\n      this.canvas.emoji_love,\n      this.canvas.emoji_smile,\n      this.canvas.emoji_shock,\n      this.canvas.emoji_question,\n    ];\n    const imageListArray = [];\n    const emojiList = [];\n    for (let i = 0; i < 5; i++) {\n      if (this.emoji[i] !== 0) {\n        imageListArray.push(imageList[i]);\n        emojiList.push(this.emoji[i]);\n        width += 26.6;\n      }\n    }\n\n    if (emojiList.length === 0) return;\n\n    const x = this.width / 2 - width + this.padding / 2;\n    const y = this.height / 2 - 18 + this.padding / 2;\n    ctx.font = '10px Inter ';\n    ctx.lineJoin = 'round';\n    ctx.save();\n    ctx.translate(x - 10, y);\n    this.drawRoundRectPath(ctx, width, 15, 2);\n    ctx.fillStyle = 'rgba(255, 255, 255, 1)';\n    ctx.fill();\n    ctx.restore();\n\n    //ctx.strokeRect(x - 10, y, width, 16);\n    //ctx.fillRect(x - 10 + 10 / 2, y + 10 / 2, width - 10, 16 - 10);\n    ctx.fillStyle = '#000';\n    const isEmojiThumbExist = !(this.canvas.emoji_thumb === undefined);\n    if (isEmojiThumbExist) {\n      let modifier = 0;\n      for (let i = 0; i < imageListArray.length; i++) {\n        const imageX = this.width / 2 - 33.6 + modifier + 2 + this.padding / 2;\n        const imageY = this.height / 2 - 15 + this.padding / 2;\n        const imageW = 10;\n        const imageH = 10;\n        ctx.drawImage(imageListArray[i], imageX, imageY, imageW, imageH);\n        ctx.fillText(\n          emojiList[i].toString(),\n          this.width / 2 - 20.6 + modifier + 1 + this.padding / 2,\n          y + 12\n        );\n        modifier -= 23.6;\n      }\n    }\n  }\n  _renderBackground(ctx) {\n    if (!this.backgroundColor) {\n      return;\n    }\n    const dim = this._getNonTransformedDimensions();\n    ctx.fillStyle = this.backgroundColor;\n    ctx.beginPath(); // start new path\n    const radius =\n      dim.x / 2 + this.padding / this.scaleX / this.canvas?.getZoom();\n    ctx.arc(0, 0, radius, 0, 2 * Math.PI); // draw circle path\n    ctx.closePath(); // close path\n    ctx.strokeStyle = this.backgroundColor;\n    ctx.fillStyle = this.backgroundColor;\n    ctx.stroke();\n    ctx.fill();\n  }\n  _renderText(ctx) {\n    ctx.shadowOffsetX = ctx.shadowOffsetY = ctx.shadowBlur = 0;\n    ctx.shadowColor = '';\n\n    if (this.paintFirst === 'stroke') {\n      this._renderTextStroke(ctx);\n      this._renderTextFill(ctx);\n    } else {\n      this._renderTextFill(ctx);\n      this._renderTextStroke(ctx);\n    }\n  }\n  _renderTextCommon(ctx, method) {\n    ctx.save();\n    let lineHeights = 0;\n    const left = this._getLeftOffset();\n    const top = this._getTopOffset();\n    const offsets = this._applyPatternGradientTransform(\n      ctx,\n      method === 'fillText' ? this.fill : this.stroke\n    );\n\n    for (let i = 0, len = this._textLines.length; i < len; i++) {\n      const heightOfLine = this.getHeightOfLine(i);\n      const maxHeight = heightOfLine / this.lineHeight;\n      const leftOffset = this._getLineLeftOffset(i);\n      this._renderTextLine(\n        method,\n        ctx,\n        this._textLines[i],\n        left + leftOffset - offsets.offsetX,\n        top + lineHeights + maxHeight - offsets.offsetY,\n        i\n      );\n      lineHeights += heightOfLine;\n    }\n    ctx.restore();\n  }\n\n  _getSVGLeftTopOffsets() {\n    return {\n      textLeft: -this.width / 2,\n      textTop: this._getTopOffset(),\n      lineTop: this.getHeightOfLine(0),\n    };\n  }\n\n  drawRoundRectPath(cxt, width, height, radius) {\n    cxt.beginPath(0);\n    //从右下角顺时针绘制，弧度从0到1/2PI\n    cxt.arc(width - radius, height - radius, radius, 0, Math.PI / 2);\n\n    //矩形下边线\n    cxt.lineTo(radius, height);\n\n    //左下角圆弧，弧度从1/2PI到PI\n    cxt.arc(radius, height - radius, radius, Math.PI / 2, Math.PI);\n\n    //矩形左边线\n    cxt.lineTo(0, radius);\n\n    //左上角圆弧，弧度从PI到3/2PI\n    cxt.arc(radius, radius, radius, Math.PI, (Math.PI * 3) / 2);\n\n    //上边线\n    cxt.lineTo(width - radius, 0);\n\n    //右上角圆弧\n    cxt.arc(width - radius, radius, radius, (Math.PI * 3) / 2, Math.PI * 2);\n\n    //右边线\n    cxt.lineTo(width, height - radius);\n    cxt.closePath();\n  }\n}\n\nclassRegistry.setClass(CircleNotes);\nclassRegistry.setSVGClass(CircleNotes, 'circleNotes');\n"],"names":["circleNotesDefaultValues","minWidth","dynamicMinWidth","verticalAlign","lockScalingFlip","noScaleCache","_wordJoiners","splitByGrapheme","obj_type","height","maxHeight","width","noteType","radius","breakWords","cornerStrokeColor","cornerStyle","cornerColor","transparentCorners","CircleNotes","Textbox","constructor","super","arguments","_defineProperty","this","getDefaults","_objectSpread","controls","createRectNotesDefaultControls","ownDefaults","initDimensions","initialized","isEditing","initDelayedCursor","_clearCache","_styleMap","_generateStyleMap","_splitText","set","fontSize","_splitTextIntoLines","text","textAlign","indexOf","enlargeSpaces","calcTextHeight","textInfo","realLineCount","realLineCharCount","charCount","map","i","graphemeLines","length","graphemeText","_reSpaceAndTab","test","line","offset","styleHas","property","lineIndex","isWrapping","isEmptyStyles","styles","nextOffset","nextLineIndex","shouldLimit","mapNextLine","obj","p1","p2","p3","_getStyleDeclaration","charIndex","_setStyleDeclaration","style","_deleteStyleDeclaration","_getLineStyle","_setLineStyle","_wrapText","lines","desiredWidth","wrapped","push","_wrapLine","_measureWord","word","prevGrapheme","charOffset","undefined","len","_getGraphemeBox","kernedWidth","wordSplit","value","split","graphemeSplitForRectNotes","textstring","graphemes","words","j","_line","reservedSpace","additionalSpace","_getWidthOfCharSpacing","infix","lineWidth","infixWidth","largestWordWidth","lineJustStarted","data","Math","max","maxWidth","wordWidth","concat","isEndOfWrapping","missingNewlineOffset","newText","Array","join","getMinWidth","_removeExtraneousStyles","linesToKeep","prop","_textLines","getObject","object","forEach","key","toObject","propertiesToInclude","extendPropeties","getWidgetMenuList","isDraw","locked","getWidgetMenuTouchList","getWidgetMenuLength","getCenteredTop","rectHeight","_getTopOffset","_getTotalLineHeights","_getTotalLineHeight","reduce","total","index","getHeightOfLine","_render","ctx","path","isNotVisible","_setTextStyles","_renderTextLinesBackground","_renderTextDecoration","_renderText","emoji","renderEmoji","imageList","canvas","emoji_thumb","emoji_love","emoji_smile","emoji_shock","emoji_question","imageListArray","emojiList","x","padding","y","font","lineJoin","save","translate","drawRoundRectPath","fillStyle","fill","restore","modifier","imageX","imageY","imageW","imageH","drawImage","fillText","toString","_renderBackground","_this$canvas","backgroundColor","dim","_getNonTransformedDimensions","beginPath","scaleX","getZoom","arc","PI","closePath","strokeStyle","stroke","shadowOffsetX","shadowOffsetY","shadowBlur","shadowColor","paintFirst","_renderTextStroke","_renderTextFill","_renderTextCommon","method","lineHeights","left","_getLeftOffset","top","offsets","_applyPatternGradientTransform","heightOfLine","lineHeight","leftOffset","_getLineLeftOffset","_renderTextLine","offsetX","offsetY","_getSVGLeftTopOffsets","textLeft","textTop","lineTop","cxt","lineTo","textLayoutProperties","classRegistry","setClass","setSVGClass"],"mappings":"8RAQO,MAAMA,EACX,CACEC,SAAU,GACVC,gBAAiB,EACjBC,cAAe,SACfC,iBAAiB,EACjBC,cAAc,EACdC,aAAc,UACdC,iBAAiB,EACjBC,SAAU,gBACVC,OAAQ,IACRC,UAAW,IACXC,MAAO,IACPC,SAAU,SACVC,OAAQ,IACRC,YAAY,EACZC,kBAAmB,OACnBC,YAAa,SACbC,YAAa,QACbC,oBAAoB,GASjB,MAAMC,UAAoBC,EAAQC,WAAAA,GAAAC,SAAAC,WAQvCC,EAAAC,KAAA,kBAyByB,CACvB,WACA,eACA,SACA,YACA,SACA,SACA,gBACA,QACA,MACA,SACA,e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