{"version":3,"file":"main.PdzH4i.js","sources":["theme-44/virtual:theme","theme-44/discourse/composer-footnote-button/initializers/composer-footnote-button.js","theme-44/virtual:entrypoint:main"],"sourcesContent":["import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(44);\n\nexport function themePrefix(key) {\n  return `theme_translations.44.${key}`;\n}\n","import { withPluginApi } from \"discourse/lib/plugin-api\";\nimport I18n from \"I18n\";\n\nexport default {\n  name: \"composer-footnote-button\",\n\n  initialize() {\n    withPluginApi(\"0.8\", (api) => {   \n      const currentLocale = I18n.currentLocale();\n      if (!I18n.translations[currentLocale].js.composer) {\n        I18n.translations[currentLocale].js.composer = {};\n      }\n      \n      I18n.translations[currentLocale].js.footnote_button_title = I18n.t(themePrefix(\"composer_footnote_button_title\"));\n      I18n.translations[currentLocale].js.composer.footnote_button_text = I18n.t(themePrefix(\"composer_footnote_button_text\"));\n      \n      api.modifyClass(\"controller:composer\", {\n        pluginId: \"FootnoteButton\",\n\n        actions: {\n          footnoteButton() {\n            this.get(\"toolbarEvent\").applySurround(\n              '^[',\n              \"]\",\n              \"footnote_button_text\",\n              { multiline: false }\n            );\n          },\n        },\n      });\n      \n      if (settings.put_in_popup_menu) {\n        api.addComposerToolbarPopupMenuOption({\n          icon: settings.composer_footnote_button_icon,\n          label: \"footnote_button_title\",\n          action: \"footnoteButton\",\n        });\n      } else {\n        api.onToolbarCreate(function(toolbar) {\n          toolbar.addButton({\n            trimLeading: true,\n            id: \"quick-footnote\",\n            group: settings.composer_footnote_button_group,\n            icon: settings.composer_footnote_button_icon,\n            title: \"footnote_button_title\",\n            perform: function(e) {\n              return e.applySurround(\n                '^[',\n                \"]\",\n                \"footnote_button_text\",\n                { multiline: false }\n              );\n            }\n          });\n        });\n      }\n    });\n  },\n};\n","import * as Mod1 from \"./discourse/composer-footnote-button/initializers/composer-footnote-button\";\nconst compatModules = {\n  \"discourse/composer-footnote-button/initializers/composer-footnote-button\": Mod1,\n};\nexport { compatModules };\nexport default compatModules;\n"],"names":["settings","getObjectForTheme","themePrefix","key","composerFootnoteButton","name","initialize","withPluginApi","api","currentLocale","I18n","translations","js","composer","footnote_button_title","t","footnote_button_text","modifyClass","pluginId","actions","footnoteButton","this","get","applySurround","multiline","put_in_popup_menu","addComposerToolbarPopupMenuOption","icon","composer_footnote_button_icon","label","action","onToolbarCreate","toolbar","addButton","trimLeading","id","group","composer_footnote_button_group","title","perform","e","compatModules"],"mappings":"6RAEaA,EAAWC,EAAkB;AAEnC,SAASC,EAAYC,GAC1B,MAAO,yBAAyBA,GAClC;ACHA,IAAAC,EAAe,CACbC,KAAM,2BAENC,UAAAA;8BACEC,CAAc,MAAQC,IACpB,MAAMC,EAAgBC,EAAKD;AACtBC,EAAKC,aAAaF,GAAeG,GAAGC,WACvCH,EAAKC,aAAaF,GAAeG,GAAGC,SAAW,CAAA,GAGjDH,EAAKC,aAAaF,GAAeG,GAAGE,sBAAwBJ,EAAKK,EAAEb,EAAY,mCAC/EQ,EAAKC,aAAaF,GAAeG,GAAGC,SAASG,qBAAuBN,EAAKK,EAAEb,EAAY,kCAEvFM,EAAIS,YAAY,sBAAuB,CACrCC,SAAU,iBAEVC,QAAS,CACPC,cAAAA,GACEC,KAAKC,IAAI,gBAAgBC,cACvB,KACA,IACA,uBACA,CAAEC,WAAW,GAEjB,KAIAxB,EAASyB,kBACXjB,EAAIkB,kCAAkC,CACpCC,KAAM3B,EAAS4B,8BACfC,MAAO,wBACPC,OAAQ,mBAGVtB,EAAIuB,gBAAgB,SAASC,GAC3BA,EAAQC,UAAU,CAChBC,aAAa,EACbC,GAAI,iBACJC,MAAOpC,EAASqC,+BAChBV,KAAM3B,EAAS4B,8BACfU,MAAO,wBACPC,QAAS,SAASC,GAChB,OAAOA,EAAEjB,cACP,KACA,IACA,uBACA,CAAEC,WAAW,GAEjB,GAEJ,IAGN;ACxDG,MAACiB,EAAgB,CACpB;"}