{"version":3,"file":"footnote.js","names":["define","_exports","_component","_modifier","_object","_template","_api","_dTooltip","_component2","_templateFactory","Object","defineProperty","value","default","InlineFootnote","preventDefault","event","static","dt7948","n","this","prototype","action","setComponentTemplate","createTemplateFactory","id","block","moduleName","scope","on","htmlSafe","isStrictMode","apiInitializer","api","decorateCookedElement","elem","helper","container","lookup","display_footnotes_inline","footnoteRefs","querySelectorAll","forEach","footnoteRef","refLink","querySelector","footnoteId","getAttribute","footnoteContent","innerHTML","expandableFootnote","document","createElement","replaceWith","renderGlimmer","length","classList","add","_pluginApi","_discourseI18n","_richEditorExtension","name","initialize","withPluginApi","registerRichEditorExtension","addComposerToolbarPopupMenuOption","addText","i18n","group","icon","label","setup","registerOptions","opts","siteSettings","features","window","markdownitFootnote","enable_markdown_footnotes","allowList","custom","tag","match","registerPlugin","extension","nodeViews","footnote","_ref","pmView","EditorView","pmState","EditorState","pmTransform","StepMap","constructor","node","view","getPos","outerView","dom","className","innerView","selectNode","open","focus","deselectNode","remove","close","tooltip","appendChild","style","setProperty","getFootnoteCounterValue","state","create","doc","plugins","filter","plugin","test","key","dispatchTransaction","dispatchInner","bind","handleDOMEvents","mousedown","hasFocus","footnotes","closest","Array","from","indexOf","destroy","textContent","tr","transactions","applyTransaction","updateState","getMeta","outerTr","offsetMap","offset","i","steps","j","step","map","docChanged","dispatch","update","sameMarkup","start","content","findDiffStart","a","endA","b","endB","findDiffEnd","overlap","Math","min","replace","slice","setMeta","stopEvent","contains","target","ignoreMutation","nodeSpec","attrs","inline","atom","draggable","parseDOM","toDOM","class","parse","_ref2","pmModel","Slice","Fragment","footnote_ref","getAttrs","token","meta","footnote_block","ignore","footnote_open","tokens","top","innerTokens","footnoteCloseIndex","findIndex","t","type","pos","replacements","descendants","child","childPos","stack","openNode","schema","nodes","parseTokens","closeNode","push","to","splice","footnote_anchor","noCloseToken","serializeNode","firstChild","write","renderContent","contents","footnoteContents","afterSerialize","oldDelim","delim","inputRules","_ref3","NodeSelection","handler","end","paragraph","setSelection"],"sources":["discourse/plugins/footnote/api-initializers/inline-footnotes.js","discourse/plugins/footnote/initializers/composer.js","discourse/plugins/footnote/lib/discourse-markdown/footnotes.js","discourse/plugins/footnote/lib/rich-editor-extension.js"],"sourcesContent":["define(\"discourse/plugins/footnote/api-initializers/inline-footnotes\", [\"exports\", \"@glimmer/component\", \"@ember/modifier\", \"@ember/object\", \"@ember/template\", \"discourse/lib/api\", \"float-kit/components/d-tooltip\", \"@ember/component\", \"@ember/template-factory\"], function (_exports, _component, _modifier, _object, _template, _api, _dTooltip, _component2, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class InlineFootnote extends _component.default {\n    preventDefault(event) {\n      event.preventDefault();\n    }\n    static #_ = (() => dt7948.n(this.prototype, \"preventDefault\", [_object.action]))();\n    static #_2 = (() => (0, _component2.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n    /*\n      \n        <DTooltip\n          @identifier=\"inline-footnote\"\n          @interactive={{true}}\n          @closeOnScroll={{false}}\n          @closeOnClickOutside={{true}}\n        >\n          <:trigger>\n            {{! template-lint-disable no-invalid-link-text }}\n            <a\n              class=\"expand-footnote\"\n              href\n              role=\"button\"\n              data-footnote-id={{@data.footnoteId}}\n              data-footnote-content={{@data.footnoteContent}}\n              {{on \"click\" this.preventDefault}}\n            ></a>\n          </:trigger>\n          <:content>\n            {{htmlSafe @data.footnoteContent}}\n          </:content>\n        </DTooltip>\n      \n    */\n    {\n      \"id\": \"6hwOaO4I\",\n      \"block\": \"[[[1,\\\"\\\\n    \\\"],[8,[32,0],null,[[\\\"@identifier\\\",\\\"@interactive\\\",\\\"@closeOnScroll\\\",\\\"@closeOnClickOutside\\\"],[\\\"inline-footnote\\\",true,false,true]],[[\\\"trigger\\\",\\\"content\\\"],[[[[1,\\\"\\\\n\\\"],[1,\\\"        \\\"],[11,3],[24,0,\\\"expand-footnote\\\"],[24,6,\\\"\\\"],[24,\\\"role\\\",\\\"button\\\"],[16,\\\"data-footnote-id\\\",[30,1,[\\\"footnoteId\\\"]]],[16,\\\"data-footnote-content\\\",[30,1,[\\\"footnoteContent\\\"]]],[4,[32,1],[\\\"click\\\",[30,0,[\\\"preventDefault\\\"]]],null],[12],[13],[1,\\\"\\\\n      \\\"]],[]],[[[1,\\\"\\\\n        \\\"],[1,[28,[32,2],[[30,1,[\\\"footnoteContent\\\"]]],null]],[1,\\\"\\\\n      \\\"]],[]]]]],[1,\\\"\\\\n  \\\"]],[\\\"@data\\\"],false,[]]\",\n      \"moduleName\": \"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/footnote/api-initializers/inline-footnotes.js\",\n      \"scope\": () => [_dTooltip.default, _modifier.on, _template.htmlSafe],\n      \"isStrictMode\": true\n    }), this))();\n  }\n  var _default = _exports.default = (0, _api.apiInitializer)(api => {\n    api.decorateCookedElement((elem, helper) => {\n      if (!api.container.lookup(\"service:site-settings\").display_footnotes_inline) {\n        return;\n      }\n      const footnoteRefs = elem.querySelectorAll(\"sup.footnote-ref\");\n      footnoteRefs.forEach(footnoteRef => {\n        const refLink = footnoteRef.querySelector(\"a\");\n        if (!refLink) {\n          return;\n        }\n        const footnoteId = refLink.getAttribute(\"href\");\n        const footnoteContent = elem.querySelector(footnoteId)?.innerHTML;\n        const expandableFootnote = document.createElement(\"span\");\n        footnoteRef.replaceWith(expandableFootnote);\n        helper.renderGlimmer(expandableFootnote, InlineFootnote, {\n          footnoteId,\n          footnoteContent\n        });\n      });\n      if (footnoteRefs.length) {\n        elem.classList.add(\"inline-footnotes\");\n      }\n    });\n  });\n});","define(\"discourse/plugins/footnote/initializers/composer\", [\"exports\", \"discourse/lib/plugin-api\", \"discourse-i18n\", \"discourse/plugins/footnote/lib/rich-editor-extension\"], function (_exports, _pluginApi, _discourseI18n, _richEditorExtension) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = _exports.default = {\n    name: \"footnotes-composer\",\n    initialize() {\n      (0, _pluginApi.withPluginApi)(api => {\n        api.registerRichEditorExtension(_richEditorExtension.default);\n        api.addComposerToolbarPopupMenuOption({\n          action(event) {\n            event.addText(`^[${(0, _discourseI18n.i18n)(\"footnote.title\")}]`);\n          },\n          group: \"insertions\",\n          icon: \"asterisk\",\n          label: \"footnote.add\"\n        });\n      });\n    }\n  };\n});","define(\"discourse/plugins/footnote/lib/discourse-markdown/footnotes\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.setup = setup;\n  function setup(helper) {\n    helper.registerOptions((opts, siteSettings) => {\n      opts.features[\"footnotes\"] = window.markdownitFootnote && !!siteSettings.enable_markdown_footnotes;\n    });\n    helper.allowList([\"ol.footnotes-list\", \"hr.footnotes-sep\", \"li.footnote-item\", \"a.footnote-backref\", \"sup.footnote-ref\"]);\n    helper.allowList({\n      custom(tag, name, value) {\n        if ((tag === \"a\" || tag === \"li\") && name === \"id\") {\n          return !!value.match(/^fn(ref)?\\d+$/);\n        }\n      }\n    });\n    if (window.markdownitFootnote) {\n      helper.registerPlugin(window.markdownitFootnote);\n    }\n  }\n});","define(\"discourse/plugins/footnote/lib/rich-editor-extension\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  function createFootnoteNodeView(_ref) {\n    let {\n      pmView: {\n        EditorView\n      },\n      pmState: {\n        EditorState\n      },\n      pmTransform: {\n        StepMap\n      }\n    } = _ref;\n    // from https://prosemirror.net/examples/footnote/\n    return class FootnoteNodeView {\n      constructor(node, view, getPos) {\n        this.node = node;\n        this.outerView = view;\n        this.getPos = getPos;\n        this.dom = document.createElement(\"div\");\n        this.dom.className = \"footnote\";\n        this.innerView = null;\n      }\n      selectNode() {\n        this.dom.classList.add(\"ProseMirror-selectednode\");\n        if (!this.innerView) {\n          this.open();\n        }\n        if (this.innerView) {\n          this.innerView.dom.focus();\n        }\n      }\n      deselectNode() {\n        this.dom.classList.remove(\"ProseMirror-selectednode\");\n        if (this.innerView) {\n          this.close();\n        }\n      }\n      open() {\n        const tooltip = this.dom.appendChild(document.createElement(\"div\"));\n        tooltip.style.setProperty(\"--footnote-counter\", `\"${this.#getFootnoteCounterValue()}\"`);\n        tooltip.className = \"footnote-tooltip\";\n        this.innerView = new EditorView(tooltip, {\n          state: EditorState.create({\n            doc: this.node,\n            plugins: this.outerView.state.plugins.filter(plugin => !/^(placeholder|trailing-paragraph)\\$.*/.test(plugin.key))\n          }),\n          dispatchTransaction: this.dispatchInner.bind(this),\n          handleDOMEvents: {\n            mousedown: () => {\n              // Kludge to prevent issues due to the fact that the whole\n              // footnote is node-selected (and thus DOM-selected) when\n              // the parent editor is focused.\n              if (this.outerView.hasFocus()) {\n                this.innerView.focus();\n              }\n            }\n          }\n        });\n      }\n      #getFootnoteCounterValue() {\n        const footnotes = this.dom.closest(\".ProseMirror\")?.querySelectorAll(\".footnote\");\n        return Array.from(footnotes).indexOf(this.dom) + 1;\n      }\n      close() {\n        this.innerView.destroy();\n        this.innerView = null;\n        this.dom.textContent = \"\";\n      }\n      dispatchInner(tr) {\n        const {\n          state,\n          transactions\n        } = this.innerView.state.applyTransaction(tr);\n        this.innerView.updateState(state);\n        if (!tr.getMeta(\"fromOutside\")) {\n          const outerTr = this.outerView.state.tr,\n            offsetMap = StepMap.offset(this.getPos() + 1);\n          for (let i = 0; i < transactions.length; i++) {\n            const steps = transactions[i].steps;\n            for (let j = 0; j < steps.length; j++) {\n              outerTr.step(steps[j].map(offsetMap));\n            }\n          }\n          if (outerTr.docChanged) {\n            this.outerView.dispatch(outerTr);\n          }\n        }\n      }\n      update(node) {\n        if (!node.sameMarkup(this.node)) {\n          return false;\n        }\n        this.node = node;\n        if (this.innerView) {\n          const state = this.innerView.state;\n          const start = node.content.findDiffStart(state.doc.content);\n          if (start != null) {\n            let {\n              a: endA,\n              b: endB\n            } = node.content.findDiffEnd(state.doc.content);\n            let overlap = start - Math.min(endA, endB);\n            if (overlap > 0) {\n              endA += overlap;\n              endB += overlap;\n            }\n            this.innerView.dispatch(state.tr.replace(start, endB, node.slice(start, endA)).setMeta(\"fromOutside\", true));\n          }\n        }\n        return true;\n      }\n      destroy() {\n        if (this.innerView) {\n          this.close();\n        }\n      }\n      stopEvent(event) {\n        return this.innerView && this.innerView.dom.contains(event.target);\n      }\n      ignoreMutation() {\n        return true;\n      }\n    };\n  }\n\n  /** @type {RichEditorExtension} */\n  const extension = {\n    nodeViews: {\n      footnote: createFootnoteNodeView\n    },\n    nodeSpec: {\n      footnote: {\n        attrs: {\n          id: {}\n        },\n        group: \"inline\",\n        content: \"block*\",\n        inline: true,\n        atom: true,\n        draggable: false,\n        parseDOM: [{\n          tag: \"div.footnote\"\n        }],\n        toDOM: () => [\"div\", {\n          class: \"footnote\"\n        }, 0]\n      }\n    },\n    parse(_ref2) {\n      let {\n        pmModel: {\n          Slice,\n          Fragment\n        }\n      } = _ref2;\n      return {\n        footnote_ref: {\n          node: \"footnote\",\n          getAttrs: token => {\n            return {\n              id: token.meta.id\n            };\n          }\n        },\n        footnote_block: {\n          ignore: true\n        },\n        footnote_open(state, token, tokens, i) {\n          // footnote_open should be at the root level\n          const doc = state.top();\n          const id = token.meta.id;\n          let innerTokens = tokens.slice(i + 1, tokens.length - 1);\n          const footnoteCloseIndex = innerTokens.findIndex(t => t.type === \"footnote_close\");\n          innerTokens = innerTokens.slice(0, footnoteCloseIndex);\n          doc.content.forEach((node, pos) => {\n            const replacements = [];\n            node.descendants((child, childPos) => {\n              if (child.type.name !== \"footnote\" || child.attrs.id !== id) {\n                return;\n              }\n\n              // this is a trick to parse this subset of tokens having the footnote as parent\n              state.stack = [];\n              state.openNode(state.schema.nodes.footnote);\n              state.parseTokens(innerTokens);\n              const footnote = state.closeNode();\n              state.stack = [doc];\n              // then we restore the stack as it was before\n\n              const slice = new Slice(Fragment.from(footnote), 0, 0);\n              replacements.push({\n                from: childPos,\n                to: childPos + 2,\n                slice\n              });\n            });\n            for (const {\n              from,\n              to,\n              slice\n            } of replacements) {\n              doc.content[pos] = doc.content[pos].replace(from, to, slice);\n            }\n          });\n\n          // remove the inner tokens + footnote_close from the tokens stream\n          tokens.splice(i + 1, innerTokens.length + 1);\n        },\n        footnote_anchor: {\n          ignore: true,\n          noCloseToken: true\n        }\n      };\n    },\n    serializeNode: {\n      footnote(state, node) {\n        if (node.content.content.length === 1 && node.content.firstChild.type.name === \"paragraph\") {\n          state.write(`^[`);\n          state.renderContent(node.content.firstChild);\n          state.write(`]`);\n        } else {\n          const contents = state.footnoteContents ??= [];\n          contents.push(node.content);\n          state.write(`[^${contents.length}]`);\n        }\n      },\n      afterSerialize(state) {\n        const contents = state.footnoteContents;\n        if (!contents) {\n          return;\n        }\n        for (let i = 0; i < contents.length; i++) {\n          const oldDelim = state.delim;\n          state.write(`[^${i + 1}]: `);\n          state.delim += \"    \";\n          state.renderContent(contents[i]);\n          state.delim = oldDelim;\n        }\n      }\n    },\n    inputRules(_ref3) {\n      let {\n        pmState: {\n          NodeSelection\n        }\n      } = _ref3;\n      return [{\n        match: /\\^\\[(.*?)]$/,\n        handler: (state, match, start, end) => {\n          const content = state.doc.slice(start + 2, end).content;\n          const paragraph = state.schema.nodes.paragraph.create(null, content);\n          const footnote = state.schema.nodes.footnote.create(null, paragraph);\n          return state.tr.replaceWith(start, end, footnote);\n        }\n      }, {\n        match: /\\[\\^\\d+]$/,\n        handler: (state, match, start, end) => {\n          const paragraph = state.schema.nodes.paragraph.create();\n          const footnote = state.schema.nodes.footnote.create(null, paragraph);\n          const tr = state.tr.replaceWith(start, end, footnote);\n          tr.setSelection(NodeSelection.create(tr.doc, start));\n          return tr;\n        }\n      }];\n    }\n  };\n  var _default = _exports.default = extension;\n});"],"mappings":"AAAAA,OAAA,+PAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,G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