{"mappings":";mJAyCO,IAAMA,EAAa,+CAKbC,EAAa,+CAMbC,EAASC,EAAK,OAAsB,CAC/C,KAAM,SAEN,YAAU,CACR,MAAO,CACL,eAAgB,CAAA,IAIpB,WAAS,CACP,MAAO,CACL,CACE,IAAK,GACN,EACD,CACE,IAAK,KACN,EACD,CACE,IAAK,QACN,EACD,CACE,MAAO,kBACP,UAAW,GACX,SAAUC,GAAWA,EAAiB,SAAS,cAAc,EAAI,CAAA,EAAK,EACvE,IAIL,WAAW,CAAE,eAAAC,CAAc,EAAE,CAC3B,MAAO,CAAC,IAAKC,EAAgB,KAAK,QAAQ,eAAgBD,CAAc,EAAG,CAAC,GAG9E,aAAW,CACT,MAAO,CACL,UAAW,IAAM,CAAC,CAAE,SAAAE,CAAQ,IACnBA,EAAS,QAAQ,KAAK,IAAI,EAEnC,aAAc,IAAM,CAAC,CAAE,SAAAA,CAAQ,IACtBA,EAAS,WAAW,KAAK,IAAI,EAEtC,YAAa,IAAM,CAAC,CAAE,SAAAA,CAAQ,IACrBA,EAAS,UAAU,KAAK,IAAI,IAKzC,sBAAoB,CAClB,MAAO,CACL,cAAe,IAAM,KAAK,OAAO,SAAS,aAAY,IAI1D,eAAa,CACX,MAAO,CACLC,EAAc,CACZ,KAAMR,EACN,KAAM,KAAK,KACZ,IAIL,eAAa,CACX,MAAO,CACLS,EAAc,CACZ,KAAMR,EACN,KAAM,KAAK,KACZ,GAGN,CAAA","names":["inputRegex","pasteRegex","Strike","Mark","style","HTMLAttributes","mergeAttributes","commands","markInputRule","markPasteRule"],"sources":["../esm/npm/@tiptap/extension-strike@2.27.3/node_modules/@tiptap/extension-strike/src/strike.ts"],"sourcesContent":["import {\n  Mark,\n  markInputRule,\n  markPasteRule,\n  mergeAttributes,\n} from '@tiptap/core'\n\nexport interface StrikeOptions {\n  /**\n   * HTML attributes to add to the strike element.\n   * @default {}\n   * @example { class: 'foo' }\n   */\n  HTMLAttributes: Record\u003cstring, any\u003e,\n}\n\ndeclare module '@tiptap/core' {\n  interface Commands\u003cReturnType\u003e {\n    strike: {\n      /**\n       * Set a strike mark\n       * @example editor.commands.setStrike()\n       */\n      setStrike: () =\u003e ReturnType,\n      /**\n       * Toggle a strike mark\n       * @example editor.commands.toggleStrike()\n       */\n      toggleStrike: () =\u003e ReturnType,\n      /**\n       * Unset a strike mark\n       * @example editor.commands.unsetStrike()\n       */\n      unsetStrike: () =\u003e ReturnType,\n    }\n  }\n}\n\n/**\n * Matches a strike to a ~~strike~~ on input.\n */\nexport const inputRegex = /(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))$/\n\n/**\n * Matches a strike to a ~~strike~~ on paste.\n */\nexport const pasteRegex = /(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))/g\n\n/**\n * This extension allows you to create strike text.\n * @see https://www.tiptap.dev/api/marks/strike\n */\nexport const Strike = Mark.create\u003cStrikeOptions\u003e({\n  name: 'strike',\n\n  addOptions() {\n    return {\n      HTMLAttributes: {},\n    }\n  },\n\n  parseHTML() {\n    return [\n      {\n        tag: 's',\n      },\n      {\n        tag: 'del',\n      },\n      {\n        tag: 'strike',\n      },\n      {\n        style: 'text-decoration',\n        consuming: false,\n        getAttrs: style =\u003e ((style as string).includes('line-through') ? {} : false),\n      },\n    ]\n  },\n\n  renderHTML({ HTMLAttributes }) {\n    return ['s', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n  },\n\n  addCommands() {\n    return {\n      setStrike: () =\u003e ({ commands }) =\u003e {\n        return commands.setMark(this.name)\n      },\n      toggleStrike: () =\u003e ({ commands }) =\u003e {\n        return commands.toggleMark(this.name)\n      },\n      unsetStrike: () =\u003e ({ commands }) =\u003e {\n        return commands.unsetMark(this.name)\n      },\n    }\n  },\n\n  addKeyboardShortcuts() {\n    return {\n      'Mod-Shift-s': () =\u003e this.editor.commands.toggleStrike(),\n    }\n  },\n\n  addInputRules() {\n    return [\n      markInputRule({\n        find: inputRegex,\n        type: this.type,\n      }),\n    ]\n  },\n\n  addPasteRules() {\n    return [\n      markPasteRule({\n        find: pasteRegex,\n        type: this.type,\n      }),\n    ]\n  },\n})\n"],"version":3}
