{"version":3,"file":"footnote.js","names":["define","_exports","_component","_modifier","_object","_template","_dTooltip","_api","_component2","_templateFactory","Object","defineProperty","value","default","InlineFootnote","preventDefault","event","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","className","replaceWith","renderGlimmer","length","classList","add","_pluginApi","name","initialize","currentUser","admin","withPluginApi","setAdminPluginIcon","_discourseI18n","_richEditorExtension","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","pmView","EditorView","pmState","EditorState","pmTransform","StepMap","constructor","node","view","getPos","outerView","dom","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","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","NodeSelection","handler","end","paragraph","setSelection"],"sources":["discourse/plugins/footnote/api-initializers/inline-footnotes.js","discourse/plugins/footnote/discourse/initializers/footnote-admin-plugin-configuration-nav.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/float-kit/components/d-tooltip\", \"discourse/lib/api\", \"@ember/component\", \"@ember/template-factory\"], function (_exports, _component, _modifier, _object, _template, _dTooltip, _api, _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 {\n      dt7948.n(this.prototype, \"preventDefault\", [_object.action]);\n    }\n    static {\n      (0, _component2.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\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        \"id\": \"9JYduY+g\",\n        \"block\": \"[[[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  \\\"]],[]]]]]],[\\\"@data\\\"],[]]\",\n        \"moduleName\": \"/root/prime/srv/discourse/app/frontend/discourse/discourse/plugins/footnote/api-initializers/inline-footnotes.js\",\n        \"scope\": () => [_dTooltip.default, _modifier.on, _template.htmlSafe],\n        \"isStrictMode\": true\n      }), this);\n    }\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        expandableFootnote.className = \"inline-footnote\";\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/discourse/initializers/footnote-admin-plugin-configuration-nav\", [\"exports\", \"discourse/lib/plugin-api\"], function (_exports, _pluginApi) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const PLUGIN_ID = \"footnote\";\n  var _default = _exports.default = {\n    name: \"footnote-admin-plugin-configuration-nav\",\n    initialize(container) {\n      const currentUser = container.lookup(\"service:current-user\");\n      if (!currentUser?.admin) {\n        return;\n      }\n      (0, _pluginApi.withPluginApi)(api => {\n        api.setAdminPluginIcon(PLUGIN_ID, \"asterisk\");\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({\n    pmView: {\n      EditorView\n    },\n    pmState: {\n      EditorState\n    },\n    pmTransform: {\n      StepMap\n    }\n  }) {\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({\n      pmModel: {\n        Slice,\n        Fragment\n      }\n    }) {\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({\n      pmState: {\n        NodeSelection\n      }\n    }) {\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,yQAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GACA;AAEAC,OAAAC,eAAAV,EAAA,cACAW,OAAA,IAEAX,EAAAY,aAAA;AACA,MAAAC,UAAAZ,EAAAW,QACA,cAAAE,CAAAC,GACAA,EAAAD,gBACA,QAEAE,OAAAC,EAAAC,KAAAC,UAAA,kBAAAhB,EAAAiB,QACA,SAEA,EAAAb,EAAAc,uBAAA,EAAAb,EAAAc,uBAwBA,CACAC,GAAA,WACAC,MAAA,wgBACAC,WAAA,mHACAC,MAAA,KAAArB,EAAAO,QAAAV,EAAAyB,GAAAvB,EAAAwB,UACAC,cAAA,IACAX,KACA,EAEAlB,EAAAY,SAAA,EAAAN,EAAAwB,gBAAAC,IACAA,EAAAC,sBAAA,CAAAC,EAAAC,KACA,IAAAH,EAAAI,UAAAC,OAAA,yBAAAC,yBACA;AAEA,MAAAC,EAAAL,EAAAM,iBAAA;AACAD,EAAAE,QAAAC,IACA,MAAAC,EAAAD,EAAAE,cAAA;AACA,IAAAD,EACA;AAEA,MAAAE,EAAAF,EAAAG,aAAA,QACAC,EAAAb,EAAAU,cAAAC,IAAAG,UACAC,EAAAC,SAAAC,cAAA;AACAF,EAAAG,UAAA,kBACAV,EAAAW,YAAAJ,GACAd,EAAAmB,cAAAL,EAAAnC,EAAA,CACA+B,aACAE,sBAGAR,EAAAgB,QACArB,EAAAsB,UAAAC,IAAA,uB,GCtEAzD,OAAA,4IAAAC,E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