{"version":3,"file":"discourse-templates.js","names":["define","_exports","_component","_component2","_tracking","_object","_runloop","_service","_ajax","_ajaxError","_decorators","_tagDrop","_templateFactory","_dec","_class","_descriptor","_descriptor2","_descriptor3","_descriptor4","_descriptor5","_descriptor6","_initializerDefineProperty","target","property","descriptor","context","Object","defineProperty","enumerable","configurable","writable","value","initializer","call","_applyDecoratedDescriptor","decorators","desc","keys","forEach","key","slice","reverse","reduce","decorator","undefined","default","__COLOCATED_TEMPLATE__","createTemplateFactory","id","block","moduleName","isStrictMode","DTemplatesFilterableList","computed","constructor","super","arguments","this","filteredReplies","filterTitle","listFilter","toLowerCase","replies","map","template","score","title","includes","content","filter","selectedTag","ALL_TAGS_ID","NO_TAG_ID","tags","length","sort","a","b","load","loading","results","ajax","templates","siteSettings","tagging_enabled","availableTags","values","tag","count","name","e","popupAjaxError","schedule","document","querySelector","focus","changeSelectedTag","tagId","insertTemplate","args","onBeforeInsertTemplate","onInsertTemplate","onAfterInsertTemplate","prototype","inject","tracked","getOwnPropertyDescriptor","bind","action","setComponentTemplate","DTemplatesItem","apply","type","catch","_templateOnly","topTags","search","defaultItem","tagFilter","onChange","onChangeSelectedTag","_form","_class2","scope","_getOwner","_obj","SELECTOR_EDITOR_PREVIEW","setupComponent","component","setProperties","templatesVisible","model","getOwnerWithFallback","lookup","appEvents","on","teardownComponent","off","shouldRender","site","mobileView","show","_ref","elemEditorPreview","style","display","set","hide","_debounce","outletArgs","helper","is_template","currentUser","can_create_topic","fetchRaw","topic","dataType","createNewTopic","text","composer","openNewTopic","body","copy","navigator","clipboard","writeText","copyConfirm","resetCopyButton","_keyboardShortcuts","_pluginApi","_variablesChatChannel","_variablesChatThread","initialize","container","discourse_templates_enabled","can_use_templates","withPluginApi","api","dTemplates","addComposerToolbarPopupMenuOption","icon","label","showComposerUI","addOptionsMenuItem","addKeyboardShortcut","PLATFORM_KEY_MODIFIER","event","preventDefault","isComposerFocused","_templateShortcutTargets","isTextAreaFocused","isFocused","activeElement","showTextAreaUI","variables","global","help","category","definition","keys1","keysDelimiter","userCanChat","channelVariablesExtractor","chat","activeChannel","currentMessage","draft","router","threadVariablesExtractor","activeThread","registerChatComposerButton","position","contextVariablesExtractor","textarea","displayed","push","element","addChatIntegration","_application","_replaceVariables","_textareaManipulator","_variablesComposer","_isTextArea","_highjackModal","_showModal","_showComposerPreviewUI","_insertTemplateIntoTextArea","_insertTemplateIntoComposer","_replaceTemplateVariables","_classPrivateMethodInitSpec","obj","privateSet","privateCollection","has","TypeError","_checkPrivateRedeclaration","add","_classPrivateMethodGet","receiver","fn","WeakSet","_insertTemplateIntoComposer2","_showModal2","_showComposerPreviewUI2","variablesExtractor","_isTextArea2","modal","_insertTemplateIntoTextArea2","extractVariables","contains","classList","modalModel","activeModal","opts","composerModel","getOwner","composerElement","nodeName","dTemplatesModal","trigger","_replaceTemplateVariables2","addBlock","templateVariables","replaceVariables","my_username","username","my_name","displayName","_user","TEMPLATES_ALLOWED_VARIABLES","modelVariables","current","replace","RegExp","freeze","_textareaTextManipulation","TextareaManipulator","extend","owner","setOwner","_textarea","ready","init","_addBlock","getSelected","channel","message","inReplyTo","channelVariables","chat_channel_name","chat_channel_url","routeModels","urlFor","reply_to_username","user","reply_to_name","context_title","context_url","thread","originalMessage","threadVariables","chat_thread_name","chat_thread_url","composerVariables","topic_title","topic_url","url","original_poster_username","details","created_by","original_poster_name","post","last_poster_username","reply_to_or_last_poster_username"],"sources":["discourse/plugins/discourse-templates/discourse/components/d-templates/filterable-list.js","discourse/plugins/discourse-templates/discourse/components/d-templates/item.js","discourse/plugins/discourse-templates/discourse/components/d-templates/modal/form.js","discourse/plugins/discourse-templates/discourse/components/d-templates/tag-drop.js","discourse/plugins/discourse-templates/discourse/connectors/below-footer/d-templates-modal-container.js","discourse/plugins/discourse-templates/discourse/connectors/editor-preview/d-templates.js","discourse/plugins/discourse-templates/discourse/connectors/topic-above-posts/discourse-templates-button.js","discourse/plugins/discourse-templates/discourse/initializers/d-templates.js","discourse/plugins/discourse-templates/discourse/services/d-templates-modal.js","discourse/plugins/discourse-templates/discourse/services/d-templates.js","discourse/plugins/discourse-templates/discourse/templates/connectors/editor-preview/d-templates.js","discourse/plugins/discourse-templates/discourse/templates/connectors/topic-above-posts/discourse-templates-button.js","discourse/plugins/discourse-templates/lib/replace-variables.js","discourse/plugins/discourse-templates/lib/textarea-manipulator.js","discourse/plugins/discourse-templates/lib/variables-chat-channel.js","discourse/plugins/discourse-templates/lib/variables-chat-thread.js","discourse/plugins/discourse-templates/lib/variables-composer.js"],"sourcesContent":["define(\"discourse/plugins/discourse-templates/discourse/components/d-templates/filterable-list\", [\"exports\", \"@ember/component\", \"@glimmer/component\", \"@glimmer/tracking\", \"@ember/object\", \"@ember/runloop\", \"@ember/service\", \"discourse/lib/ajax\", \"discourse/lib/ajax-error\", \"discourse-common/utils/decorators\", \"select-kit/components/tag-drop\", \"@ember/template-factory\"], function (_exports, _component, _component2, _tracking, _object, _runloop, _service, _ajax, _ajaxError, _decorators, _tagDrop, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _dec, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;\n  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n  function _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : String(i); }\n  function _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n  const __COLOCATED_TEMPLATE__ = (0, _templateFactory.createTemplateFactory)(\n  /*\n    <div class=\"templates-filterable-list\" {{did-insert this.load}}>\n  \n    <ConditionalLoadingSpinner @condition={{this.loading}}>\n      <div class=\"templates-filter-bar\">\n        {{#if this.siteSettings.tagging_enabled}}\n          <DTemplates::TagDrop\n            @availableTags={{this.availableTags}}\n            @tagId={{this.selectedTag}}\n            @onChangeSelectedTag={{this.changeSelectedTag}}\n          />\n        {{/if}}\n        <TextField\n          class=\"templates-filter\"\n          @value={{this.listFilter}}\n          placeholder={{i18n \"templates.filter_hint\"}}\n        />\n      </div>\n      <div class=\"templates-list\">\n        {{#each this.filteredReplies as |r|}}\n          <DTemplates::Item\n            @template={{r}}\n            @model={{@model}}\n            @onInsertTemplate={{this.insertTemplate}}\n          />\n        {{/each}}\n      </div>\n    </ConditionalLoadingSpinner>\n  </div>\n  */\n  {\n    \"id\": \"MxdRx2Ru\",\n    \"block\": \"[[[11,0],[24,0,\\\"templates-filterable-list\\\"],[4,[38,0],[[30,0,[\\\"load\\\"]]],null],[12],[1,\\\"\\\\n\\\\n  \\\"],[8,[39,1],null,[[\\\"@condition\\\"],[[30,0,[\\\"loading\\\"]]]],[[\\\"default\\\"],[[[[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"templates-filter-bar\\\"],[12],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"siteSettings\\\",\\\"tagging_enabled\\\"]],[[[1,\\\"        \\\"],[8,[39,3],null,[[\\\"@availableTags\\\",\\\"@tagId\\\",\\\"@onChangeSelectedTag\\\"],[[30,0,[\\\"availableTags\\\"]],[30,0,[\\\"selectedTag\\\"]],[30,0,[\\\"changeSelectedTag\\\"]]]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"      \\\"],[8,[39,4],[[24,0,\\\"templates-filter\\\"],[16,\\\"placeholder\\\",[28,[37,5],[\\\"templates.filter_hint\\\"],null]]],[[\\\"@value\\\"],[[30,0,[\\\"listFilter\\\"]]]],null],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"templates-list\\\"],[12],[1,\\\"\\\\n\\\"],[42,[28,[37,7],[[28,[37,7],[[30,0,[\\\"filteredReplies\\\"]]],null]],null],null,[[[1,\\\"        \\\"],[8,[39,8],null,[[\\\"@template\\\",\\\"@model\\\",\\\"@onInsertTemplate\\\"],[[30,1],[30,2],[30,0,[\\\"insertTemplate\\\"]]]],null],[1,\\\"\\\\n\\\"]],[1]],null],[1,\\\"    \\\"],[13],[1,\\\"\\\\n  \\\"]],[]]]]],[1,\\\"\\\\n\\\"],[13]],[\\\"r\\\",\\\"@model\\\"],false,[\\\"did-insert\\\",\\\"conditional-loading-spinner\\\",\\\"if\\\",\\\"d-templates/tag-drop\\\",\\\"text-field\\\",\\\"i18n\\\",\\\"each\\\",\\\"-track-array\\\",\\\"d-templates/item\\\"]]\",\n    \"moduleName\": \"discourse/plugins/discourse-templates/discourse/components/d-templates/filterable-list.hbs\",\n    \"isStrictMode\": false\n  });\n  let DTemplatesFilterableList = _exports.default = (_dec = (0, _object.computed)(\"replies\", \"selectedTag\", \"listFilter\"), (_class = class DTemplatesFilterableList extends _component2.default {\n    constructor() {\n      super(...arguments);\n      _initializerDefineProperty(this, \"siteSettings\", _descriptor, this);\n      _initializerDefineProperty(this, \"loading\", _descriptor2, this);\n      _initializerDefineProperty(this, \"listFilter\", _descriptor3, this);\n      _initializerDefineProperty(this, \"replies\", _descriptor4, this);\n      _initializerDefineProperty(this, \"selectedTag\", _descriptor5, this);\n      _initializerDefineProperty(this, \"availableTags\", _descriptor6, this);\n    }\n    get filteredReplies() {\n      const filterTitle = this.listFilter.toLowerCase();\n      return this.replies.map(template => {\n        /* Give a relevant score to each template. */\n        template.score = 0;\n        if (template.title.toLowerCase().includes(filterTitle)) {\n          template.score += 2;\n        } else if (template.content.toLowerCase().includes(filterTitle)) {\n          template.score += 1;\n        }\n        return template;\n      })\n      // Filter irrelevant replies.\n      .filter(template => template.score !== 0)\n      // Filter only replies tagged with the selected tag.\n      .filter(template => {\n        if (this.selectedTag === _tagDrop.ALL_TAGS_ID) {\n          return true;\n        }\n        if (this.selectedTag === _tagDrop.NO_TAG_ID && template.tags.length === 0) {\n          return true;\n        }\n        return template.tags.includes(this.selectedTag);\n      }).sort((a, b) => {\n        /* Sort replies by relevance and title. */\n        if (a.score !== b.score) {\n          return a.score > b.score ? -1 : 1; /* descending */\n        } else if (a.title !== b.title) {\n          return a.title < b.title ? -1 : 1; /* ascending */\n        }\n        return 0;\n      });\n    }\n    async load() {\n      try {\n        this.loading = true;\n        const results = await (0, _ajax.ajax)(\"/discourse_templates\");\n        this.replies = results.templates;\n        if (this.siteSettings.tagging_enabled) {\n          this.availableTags = Object.values(this.replies.reduce((availableTags, template) => {\n            template.tags.forEach(tag => {\n              if (availableTags[tag]) {\n                availableTags[tag].count += 1;\n              } else {\n                availableTags[tag] = {\n                  id: tag,\n                  name: tag,\n                  count: 1\n                };\n              }\n            });\n            return availableTags;\n          }, {}));\n        }\n      } catch (e) {\n        this.loading = false;\n        (0, _ajaxError.popupAjaxError)(e);\n      } finally {\n        this.loading = false;\n        (0, _runloop.schedule)(\"afterRender\", () => document.querySelector(\".templates-filter\")?.focus());\n      }\n    }\n    changeSelectedTag(tagId) {\n      this.selectedTag = tagId;\n    }\n    insertTemplate(template) {\n      this.args.onBeforeInsertTemplate?.();\n      this.args.onInsertTemplate?.(template);\n      this.args.onAfterInsertTemplate?.();\n    }\n  }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"siteSettings\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"loading\", [_tracking.tracked], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: function () {\n      return true;\n    }\n  }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"listFilter\", [_tracking.tracked], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: function () {\n      return \"\";\n    }\n  }), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"replies\", [_tracking.tracked], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: function () {\n      return [];\n    }\n  }), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"selectedTag\", [_tracking.tracked], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: function () {\n      return _tagDrop.ALL_TAGS_ID;\n    }\n  }), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, \"availableTags\", [_tracking.tracked], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: function () {\n      return [];\n    }\n  }), _applyDecoratedDescriptor(_class.prototype, \"filteredReplies\", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, \"filteredReplies\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"load\", [_decorators.bind], Object.getOwnPropertyDescriptor(_class.prototype, \"load\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"changeSelectedTag\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"changeSelectedTag\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"insertTemplate\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"insertTemplate\"), _class.prototype)), _class));\n  (0, _component.setComponentTemplate)(__COLOCATED_TEMPLATE__, DTemplatesFilterableList);\n});","define(\"discourse/plugins/discourse-templates/discourse/components/d-templates/item\", [\"exports\", \"@ember/component\", \"@glimmer/component\", \"@ember/object\", \"discourse/lib/ajax\", \"discourse/lib/ajax-error\", \"@ember/template-factory\"], function (_exports, _component, _component2, _object, _ajax, _ajaxError, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _class;\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  const __COLOCATED_TEMPLATE__ = (0, _templateFactory.createTemplateFactory)(\n  /*\n    <details class=\"template-item\" id=\"template-item-{{@template.id}}\">\n    <summary class=\"template-item-title\">\n      <div class=\"template-item-title-text\">{{@template.title}}</div>\n  \n      <div class=\"actions\">\n        <DButton\n          class=\"templates-apply\"\n          @action={{action \"apply\"}}\n          @icon=\"far-clipboard\"\n        />\n      </div>\n    </summary>\n  \n    <div class=\"templates-content\">\n      <CookText @rawText={{@template.content}} />\n    </div>\n  </details>\n  */\n  {\n    \"id\": \"mzCrPOh5\",\n    \"block\": \"[[[10,\\\"details\\\"],[14,0,\\\"template-item\\\"],[15,1,[29,[\\\"template-item-\\\",[30,1,[\\\"id\\\"]]]]],[12],[1,\\\"\\\\n  \\\"],[10,\\\"summary\\\"],[14,0,\\\"template-item-title\\\"],[12],[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"template-item-title-text\\\"],[12],[1,[30,1,[\\\"title\\\"]]],[13],[1,\\\"\\\\n\\\\n    \\\"],[10,0],[14,0,\\\"actions\\\"],[12],[1,\\\"\\\\n      \\\"],[8,[39,0],[[24,0,\\\"templates-apply\\\"]],[[\\\"@action\\\",\\\"@icon\\\"],[[28,[37,1],[[30,0],\\\"apply\\\"],null],\\\"far-clipboard\\\"]],null],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n  \\\"],[13],[1,\\\"\\\\n\\\\n  \\\"],[10,0],[14,0,\\\"templates-content\\\"],[12],[1,\\\"\\\\n    \\\"],[8,[39,2],null,[[\\\"@rawText\\\"],[[30,1,[\\\"content\\\"]]]],null],[1,\\\"\\\\n  \\\"],[13],[1,\\\"\\\\n\\\"],[13]],[\\\"@template\\\"],false,[\\\"d-button\\\",\\\"action\\\",\\\"cook-text\\\"]]\",\n    \"moduleName\": \"discourse/plugins/discourse-templates/discourse/components/d-templates/item.hbs\",\n    \"isStrictMode\": false\n  });\n  let DTemplatesItem = _exports.default = (_class = class DTemplatesItem extends _component2.default {\n    apply() {\n      // run parametrized action to insert the template\n      this.args.onInsertTemplate?.(this.args.template);\n      (0, _ajax.ajax)(`/discourse_templates/${this.args.template.id}/use`, {\n        type: \"POST\"\n      }).catch(_ajaxError.popupAjaxError);\n    }\n  }, (_applyDecoratedDescriptor(_class.prototype, \"apply\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"apply\"), _class.prototype)), _class);\n  (0, _component.setComponentTemplate)(__COLOCATED_TEMPLATE__, DTemplatesItem);\n});","define(\"discourse/plugins/discourse-templates/discourse/components/d-templates/modal/form\", [\"exports\", \"@ember/component\", \"@ember/component/template-only\", \"@ember/template-factory\"], function (_exports, _component, _templateOnly, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const __COLOCATED_TEMPLATE__ = (0, _templateFactory.createTemplateFactory)(\n  /*\n    <DModal\n    @closeModal={{@closeModal}}\n    @title={{i18n \"templates.insert_template\"}}\n    class=\"d-templates d-templates-modal\"\n  >\n    <:body>\n      <DTemplates::FilterableList\n        @textarea={{@model.textarea}}\n        @onInsertTemplate={{@model.onInsertTemplate}}\n        @onAfterInsertTemplate={{@closeModal}}\n      />\n    </:body>\n  </DModal>\n  */\n  {\n    \"id\": \"StqqkQ0S\",\n    \"block\": \"[[[8,[39,0],[[24,0,\\\"d-templates d-templates-modal\\\"]],[[\\\"@closeModal\\\",\\\"@title\\\"],[[30,1],[28,[37,1],[\\\"templates.insert_template\\\"],null]]],[[\\\"body\\\"],[[[[1,\\\"\\\\n    \\\"],[8,[39,2],null,[[\\\"@textarea\\\",\\\"@onInsertTemplate\\\",\\\"@onAfterInsertTemplate\\\"],[[30,2,[\\\"textarea\\\"]],[30,2,[\\\"onInsertTemplate\\\"]],[30,1]]],null],[1,\\\"\\\\n  \\\"]],[]]]]]],[\\\"@closeModal\\\",\\\"@model\\\"],false,[\\\"d-modal\\\",\\\"i18n\\\",\\\"d-templates/filterable-list\\\"]]\",\n    \"moduleName\": \"discourse/plugins/discourse-templates/discourse/components/d-templates/modal/form.hbs\",\n    \"isStrictMode\": false\n  });\n  var _default = _exports.default = (0, _component.setComponentTemplate)(__COLOCATED_TEMPLATE__, (0, _templateOnly.default)());\n});","define(\"discourse/plugins/discourse-templates/discourse/components/d-templates/tag-drop\", [\"exports\", \"@ember/object\", \"select-kit/components/tag-drop\"], function (_exports, _object, _tagDrop) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _dec, _class;\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  let DTemplatesTagDrop = _exports.default = (_dec = (0, _object.computed)(\"availableTags.[]\"), (_class = class DTemplatesTagDrop extends _tagDrop.default {\n    get topTags() {\n      // sort tags descending by count and ascending by name\n      return (this.availableTags || []).sort((a, b) => {\n        if (a.count !== b.count) {\n          return b.count - a.count;\n        } // descending\n        if (a.name !== b.name) {\n          return a.name < b.name ? -1 : 1;\n        } // ascending\n        return 0;\n      });\n    }\n    search(filter) {\n      return (this.content || []).map(tag => {\n        if (tag.id && tag.name) {\n          return tag;\n        }\n        return this.defaultItem(tag, tag);\n      }).filter(tag => {\n        if (filter == null) {\n          return true;\n        }\n        const tagFilter = filter.toLowerCase();\n        return tag.id.toLowerCase().includes(tagFilter) || tag.name.toLowerCase().includes(tagFilter);\n      });\n    }\n    onChange(tagId, tag) {\n      // overrides the action onChange of the parent with the value received in\n      // the property onChangeSelectedTag in the handlebars template\n      this.onChangeSelectedTag?.(tagId, tag);\n    }\n  }, (_applyDecoratedDescriptor(_class.prototype, \"topTags\", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, \"topTags\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"onChange\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"onChange\"), _class.prototype)), _class));\n});","define(\"discourse/plugins/discourse-templates/discourse/connectors/below-footer/d-templates-modal-container\", [\"exports\", \"@glimmer/component\", \"@ember/service\", \"discourse/plugins/discourse-templates/discourse/components/d-templates/modal/form\", \"@ember/template-factory\", \"@ember/component\"], function (_exports, _component, _service, _form, _templateFactory, _component2) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _class, _descriptor, _class2;\n  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n  function _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : String(i); }\n  function _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n  let DTemplatesModalContainer = _exports.default = (_class = (_class2 = class DTemplatesModalContainer extends _component.default {\n    constructor() {\n      super(...arguments);\n      _initializerDefineProperty(this, \"dTemplatesModal\", _descriptor, this);\n    }\n  }, (0, _component2.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n  /*\n    \n      {{#if this.dTemplatesModal.model}}\n        <div class=\"modal-container d-templates-modal-container\">\n          <DTemplatesModalForm\n            @closeModal={{this.dTemplatesModal.hide}}\n            @model={{this.dTemplatesModal.model}}\n          />\n        </div>\n      {{/if}}\n    \n  */\n  {\n    \"id\": \"zWRPcu1e\",\n    \"block\": \"[[[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"dTemplatesModal\\\",\\\"model\\\"]],[[[1,\\\"      \\\"],[10,0],[14,0,\\\"modal-container d-templates-modal-container\\\"],[12],[1,\\\"\\\\n        \\\"],[8,[32,0],null,[[\\\"@closeModal\\\",\\\"@model\\\"],[[30,0,[\\\"dTemplatesModal\\\",\\\"hide\\\"]],[30,0,[\\\"dTemplatesModal\\\",\\\"model\\\"]]]],null],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"  \\\"]],[],false,[\\\"if\\\"]]\",\n    \"moduleName\": \"/srv/discourse/app/app/assets/javascripts/discourse/discourse/plugins/discourse-templates/discourse/connectors/below-footer/d-templates-modal-container.js\",\n    \"scope\": () => [_form.default],\n    \"isStrictMode\": true\n  }), _class2), _class2), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"dTemplatesModal\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  })), _class);\n});","define(\"discourse/plugins/discourse-templates/discourse/connectors/editor-preview/d-templates\", [\"exports\", \"@ember/object\", \"discourse-common/lib/get-owner\"], function (_exports, _object, _getOwner) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _obj;\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  const SELECTOR_EDITOR_PREVIEW = \"#reply-control .d-editor-preview-wrapper > .d-editor-preview\";\n  var _default = _exports.default = (_obj = {\n    setupComponent(args, component) {\n      component.setProperties({\n        templatesVisible: false,\n        model: (0, _getOwner.getOwnerWithFallback)(this).lookup(\"controller:composer\").model\n      });\n      this.appEvents.on(\"discourse-templates:show\", this, \"show\");\n      this.appEvents.on(\"discourse-templates:hide\", this, \"hide\");\n    },\n    teardownComponent() {\n      this.appEvents.off(\"discourse-templates:show\", this, \"show\");\n      this.appEvents.off(\"discourse-templates:hide\", this, \"hide\");\n    },\n    shouldRender(args, component) {\n      return !component.site.mobileView;\n    },\n    show(_ref) {\n      let {\n        onInsertTemplate\n      } = _ref;\n      const elemEditorPreview = document.querySelector(SELECTOR_EDITOR_PREVIEW);\n      if (elemEditorPreview) {\n        elemEditorPreview.style.display = \"none\";\n      }\n      this.set(\"onInsertTemplate\", onInsertTemplate);\n      this.set(\"templatesVisible\", true);\n    },\n    hide() {\n      const elemEditorPreview = document.querySelector(SELECTOR_EDITOR_PREVIEW);\n      if (elemEditorPreview) {\n        elemEditorPreview.style.display = \"\";\n      }\n      this.set(\"templatesVisible\", false);\n    }\n  }, (_applyDecoratedDescriptor(_obj, \"show\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"show\"), _obj), _applyDecoratedDescriptor(_obj, \"hide\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"hide\"), _obj)), _obj);\n});","define(\"discourse/plugins/discourse-templates/discourse/connectors/topic-above-posts/discourse-templates-button\", [\"exports\", \"@glimmer/component\", \"@glimmer/tracking\", \"@ember/object\", \"@ember/service\", \"discourse/lib/ajax\", \"discourse-common/lib/debounce\"], function (_exports, _component, _tracking, _object, _service, _ajax, _debounce) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _class, _descriptor, _descriptor2;\n  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n  function _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : String(i); }\n  function _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n  let DiscourseTemplatesButton = _exports.default = (_class = class DiscourseTemplatesButton extends _component.default {\n    constructor() {\n      super(...arguments);\n      _initializerDefineProperty(this, \"composer\", _descriptor, this);\n      _initializerDefineProperty(this, \"copyConfirm\", _descriptor2, this);\n    }\n    static shouldRender(outletArgs, helper) {\n      return outletArgs.model.is_template && helper.currentUser?.can_create_topic;\n    }\n    async fetchRaw() {\n      const topic = this.args.outletArgs.model;\n      return await (0, _ajax.ajax)(`/raw/${topic.id}/1`, {\n        dataType: \"text\"\n      });\n    }\n    async createNewTopic() {\n      const text = await this.fetchRaw();\n      this.composer.openNewTopic({\n        body: text\n      });\n    }\n    async copy() {\n      const text = await this.fetchRaw();\n      navigator.clipboard.writeText(text);\n      this.copyConfirm = true;\n      (0, _debounce.default)(this.resetCopyButton, 2000);\n    }\n    resetCopyButton() {\n      this.copyConfirm = false;\n    }\n  }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"composer\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"copyConfirm\", [_tracking.tracked], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: function () {\n      return false;\n    }\n  }), _applyDecoratedDescriptor(_class.prototype, \"createNewTopic\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"createNewTopic\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"copy\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"copy\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"resetCopyButton\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"resetCopyButton\"), _class.prototype)), _class);\n});","define(\"discourse/plugins/discourse-templates/discourse/initializers/d-templates\", [\"exports\", \"discourse/lib/keyboard-shortcuts\", \"discourse/lib/plugin-api\", \"discourse-common/lib/get-owner\", \"discourse/plugins/discourse-templates/lib/variables-chat-channel\", \"discourse/plugins/discourse-templates/lib/variables-chat-thread\"], function (_exports, _keyboardShortcuts, _pluginApi, _getOwner, _variablesChatChannel, _variablesChatThread) {\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: \"discourse-templates-add-ui-builder\",\n    initialize(container) {\n      const siteSettings = container.lookup(\"service:site-settings\");\n      const currentUser = container.lookup(\"service:current-user\");\n      if (siteSettings.discourse_templates_enabled && currentUser?.can_use_templates) {\n        (0, _pluginApi.withPluginApi)(\"1.13.0\", api => {\n          addOptionsMenuItem(api);\n          addKeyboardShortcut(api, container);\n          addChatIntegration(api, container);\n        });\n      }\n    }\n  };\n  function addOptionsMenuItem(api) {\n    const dTemplates = api.container.lookup(\"service:d-templates\");\n    api.addComposerToolbarPopupMenuOption({\n      icon: \"far-clipboard\",\n      label: \"templates.insert_template\",\n      action: () => {\n        dTemplates.showComposerUI();\n      }\n    });\n  }\n  const _templateShortcutTargets = [];\n  function addKeyboardShortcut(api, container) {\n    api.addKeyboardShortcut(`${_keyboardShortcuts.PLATFORM_KEY_MODIFIER}+shift+i`, event => {\n      event.preventDefault();\n      const dTemplates = container.lookup(\"service:d-templates\");\n      if (dTemplates.isComposerFocused) {\n        dTemplates.showComposerUI();\n        return;\n      }\n      for (const target of _templateShortcutTargets) {\n        if (dTemplates.isTextAreaFocused && target?.isFocused?.(document.activeElement)) {\n          dTemplates.showTextAreaUI(target?.variables);\n          return;\n        }\n      }\n      if (dTemplates.isTextAreaFocused) {\n        dTemplates.showTextAreaUI();\n      }\n    }, {\n      global: true,\n      help: {\n        category: \"templates\",\n        name: \"templates.insert_template\",\n        definition: {\n          keys1: [_keyboardShortcuts.PLATFORM_KEY_MODIFIER, \"shift\", \"I\"],\n          keysDelimiter: \"plus\"\n        }\n      }\n    });\n  }\n  function addChatIntegration(api, container) {\n    if (!container.lookup(\"service:chat\")?.userCanChat) {\n      return;\n    }\n    const channelVariablesExtractor = function () {\n      const chat = (0, _getOwner.getOwnerWithFallback)(this).lookup(\"service:chat\");\n      const activeChannel = chat?.activeChannel;\n      const currentMessage = activeChannel?.draft;\n      const router = (0, _getOwner.getOwnerWithFallback)(this).lookup(\"service:router\");\n      return (0, _variablesChatChannel.default)(activeChannel, currentMessage, router);\n    };\n    const threadVariablesExtractor = function () {\n      const chat = (0, _getOwner.getOwnerWithFallback)(this).lookup(\"service:chat\");\n      const activeThread = chat?.activeChannel?.activeThread;\n      const currentMessage = activeThread?.draft;\n      const router = (0, _getOwner.getOwnerWithFallback)(this).lookup(\"service:router\");\n      return (0, _variablesChatThread.default)(activeThread, currentMessage, router);\n    };\n\n    // add a custom chat composer button\n    api.registerChatComposerButton({\n      id: \"d-templates-chat-insert-template-btn\",\n      icon: \"far-clipboard\",\n      label: \"templates.insert_template\",\n      position: \"dropdown\",\n      action: function () {\n        let contextVariablesExtractor;\n        switch (this.context) {\n          case \"channel\":\n            contextVariablesExtractor = channelVariablesExtractor.bind(this);\n            break;\n          case \"thread\":\n            contextVariablesExtractor = threadVariablesExtractor.bind(this);\n            break;\n          default:\n            contextVariablesExtractor = null;\n        }\n        const textarea = this.composer?.textarea?.textarea; // this.composer.textarea is a TextareaInteractor instance\n\n        (0, _getOwner.getOwnerWithFallback)(this).lookup(\"service:d-templates\").showTextAreaUI(contextVariablesExtractor, textarea);\n      },\n      displayed() {\n        return this.composer?.textarea && (this.context === \"channel\" || this.context === \"thread\");\n      }\n    });\n\n    // add custom keyboard shortcut handlers for the chat channel composer and chat thread composer\n    _templateShortcutTargets.push({\n      isFocused: element => element?.id === \"channel-composer\",\n      variables: channelVariablesExtractor\n    }, {\n      isFocused: element => element?.id === \"thread-composer\",\n      variables: threadVariablesExtractor\n    });\n  }\n});","define(\"discourse/plugins/discourse-templates/discourse/services/d-templates-modal\", [\"exports\", \"@glimmer/tracking\", \"@ember/object\", \"@ember/service\"], function (_exports, _tracking, _object, _service) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _class, _descriptor;\n  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n  function _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : String(i); }\n  function _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n  let DTemplatesModalService = _exports.default = (_class = class DTemplatesModalService extends _service.default {\n    constructor() {\n      super(...arguments);\n      _initializerDefineProperty(this, \"model\", _descriptor, this);\n    }\n    show(model) {\n      this.model = model;\n    }\n    hide() {\n      // return the focus back to the textarea\n      this.model?.textarea?.focus();\n\n      // clear the model\n      this.model = null;\n    }\n  }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"model\", [_tracking.tracked], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: function () {\n      return null;\n    }\n  }), _applyDecoratedDescriptor(_class.prototype, \"show\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"show\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"hide\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"hide\"), _class.prototype)), _class);\n});","define(\"discourse/plugins/discourse-templates/discourse/services/d-templates\", [\"exports\", \"@ember/application\", \"@ember/service\", \"discourse/plugins/discourse-templates/lib/replace-variables\", \"discourse/plugins/discourse-templates/lib/textarea-manipulator\", \"discourse/plugins/discourse-templates/lib/variables-composer\"], function (_exports, _application, _service, _replaceVariables, _textareaManipulator, _variablesComposer) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _isTextArea, _highjackModal, _showModal, _showComposerPreviewUI, _insertTemplateIntoTextArea, _insertTemplateIntoComposer, _replaceTemplateVariables;\n  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }\n  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\n  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n  function _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : String(i); }\n  function _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError(\"attempted to get private field on non-instance\"); } return fn; }\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n  let DTemplatesService = _exports.default = (_class = (_isTextArea = /*#__PURE__*/new WeakSet(), _highjackModal = /*#__PURE__*/new WeakSet(), _showModal = /*#__PURE__*/new WeakSet(), _showComposerPreviewUI = /*#__PURE__*/new WeakSet(), _insertTemplateIntoTextArea = /*#__PURE__*/new WeakSet(), _insertTemplateIntoComposer = /*#__PURE__*/new WeakSet(), _replaceTemplateVariables = /*#__PURE__*/new WeakSet(), class DTemplatesService extends _service.default {\n    constructor() {\n      super(...arguments);\n      _classPrivateMethodInitSpec(this, _replaceTemplateVariables);\n      _classPrivateMethodInitSpec(this, _insertTemplateIntoComposer);\n      _classPrivateMethodInitSpec(this, _insertTemplateIntoTextArea);\n      _classPrivateMethodInitSpec(this, _showComposerPreviewUI);\n      _classPrivateMethodInitSpec(this, _showModal);\n      _classPrivateMethodInitSpec(this, _highjackModal);\n      _classPrivateMethodInitSpec(this, _isTextArea);\n      _initializerDefineProperty(this, \"appEvents\", _descriptor, this);\n      _initializerDefineProperty(this, \"modal\", _descriptor2, this);\n      _initializerDefineProperty(this, \"site\", _descriptor3, this);\n      _initializerDefineProperty(this, \"currentUser\", _descriptor4, this);\n      _initializerDefineProperty(this, \"dTemplatesModal\", _descriptor5, this);\n    }\n    showComposerUI() {\n      const onInsertTemplate = _classPrivateMethodGet(this, _insertTemplateIntoComposer, _insertTemplateIntoComposer2).bind(this);\n      if (this.site.mobileView) {\n        _classPrivateMethodGet(this, _showModal, _showModal2).call(this, null, onInsertTemplate); // textarea must be empty when targeting the composer\n      } else {\n        _classPrivateMethodGet(this, _showComposerPreviewUI, _showComposerPreviewUI2).call(this, onInsertTemplate);\n      }\n    }\n    showTextAreaUI() {\n      let variablesExtractor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n      let textarea = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.activeElement;\n      if (!_classPrivateMethodGet(this, _isTextArea, _isTextArea2).call(this, textarea)) {\n        return;\n      }\n      const modal = document.querySelector(\".d-modal\");\n      const onInsertTemplate = _classPrivateMethodGet(this, _insertTemplateIntoTextArea, _insertTemplateIntoTextArea2).bind(this);\n      const extractVariables = model => variablesExtractor?.(model);\n      if (modal?.contains(textarea)) {\n        if (!modal.classList.contains(\"d-templates\")) {\n          _classPrivateMethodGet(this, _showModal, _showModal2).call(this, textarea, template => {\n            const modalModel = this.modal.activeModal?.opts?.model;\n            onInsertTemplate(textarea, template, extractVariables(modalModel));\n          });\n        }\n      } else {\n        _classPrivateMethodGet(this, _showModal, _showModal2).call(this, textarea, template => onInsertTemplate(textarea, template, extractVariables()));\n      }\n    }\n    get isComposerFocused() {\n      const activeElement = document.activeElement;\n      const composerModel = (0, _application.getOwner)(this).lookup(\"controller:composer\").model;\n      const composerElement = document.querySelector(\".d-editor\");\n      return composerModel && composerElement?.contains(activeElement);\n    }\n    get isTextAreaFocused() {\n      return _classPrivateMethodGet(this, _isTextArea, _isTextArea2).call(this, document.activeElement);\n    }\n  }), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"appEvents\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"modal\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"site\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, \"currentUser\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, \"dTemplatesModal\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  })), _class);\n  function _isTextArea2(element) {\n    return element?.nodeName === \"TEXTAREA\";\n  }\n  function _highjackModal2(textarea, onInsertTemplate) {\n    this.appEvents.trigger(\"discourse-templates:hijack-modal\", {\n      textarea,\n      onInsertTemplate\n    });\n  }\n  function _showModal2(textarea, onInsertTemplate) {\n    this.dTemplatesModal.show({\n      textarea,\n      onInsertTemplate\n    });\n  }\n  function _showComposerPreviewUI2(onInsertTemplate) {\n    this.appEvents.trigger(\"composer-messages:close\");\n    this.appEvents.trigger(\"composer:show-preview\");\n    this.appEvents.trigger(\"discourse-templates:show\", {\n      onInsertTemplate\n    });\n  }\n  function _insertTemplateIntoTextArea2(textarea, template, variables) {\n    template = _classPrivateMethodGet(this, _replaceTemplateVariables, _replaceTemplateVariables2).call(this, template.title, template.content, variables);\n    new _textareaManipulator.default((0, _application.getOwner)(this), textarea).addBlock(template.content);\n  }\n  function _insertTemplateIntoComposer2(template) {\n    const composerModel = (0, _application.getOwner)(this).lookup(\"controller:composer\").model;\n    const templateVariables = (0, _variablesComposer.default)(composerModel);\n    template = _classPrivateMethodGet(this, _replaceTemplateVariables, _replaceTemplateVariables2).call(this, template.title, template.content, templateVariables);\n\n    // insert the title if blank\n    if (composerModel && !composerModel.title) {\n      composerModel.set(\"title\", template.title);\n    }\n\n    // insert the content of the template in the composer\n    this.appEvents.trigger(\"composer:insert-block\", template.content);\n  }\n  function _replaceTemplateVariables2(title, content) {\n    let variables = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n    return (0, _replaceVariables.replaceVariables)(title, content, {\n      ...variables,\n      my_username: this.currentUser?.username,\n      my_name: this.currentUser?.displayName\n    });\n  }\n});","define(\"discourse/plugins/discourse-templates/discourse/templates/connectors/editor-preview/d-templates\", [\"exports\", \"@ember/template-factory\"], function (_exports, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = _exports.default = (0, _templateFactory.createTemplateFactory)(\n  /*\n    {{#if this.templatesVisible}}\n    <div class=\"d-templates-container\">\n      <DButton\n        class=\"modal-close close btn-flat\"\n        @action={{action \"hide\"}}\n        @icon=\"times\"\n      />\n      <DTemplates::FilterableList\n        @onInsertTemplate={{this.onInsertTemplate}}\n        @onAfterInsertTemplate={{action \"hide\"}}\n      />\n    </div>\n  {{/if}}\n  */\n  {\n    \"id\": \"IBGlp3aJ\",\n    \"block\": \"[[[41,[30,0,[\\\"templatesVisible\\\"]],[[[1,\\\"  \\\"],[10,0],[14,0,\\\"d-templates-container\\\"],[12],[1,\\\"\\\\n    \\\"],[8,[39,1],[[24,0,\\\"modal-close close btn-flat\\\"]],[[\\\"@action\\\",\\\"@icon\\\"],[[28,[37,2],[[30,0],\\\"hide\\\"],null],\\\"times\\\"]],null],[1,\\\"\\\\n    \\\"],[8,[39,3],null,[[\\\"@onInsertTemplate\\\",\\\"@onAfterInsertTemplate\\\"],[[30,0,[\\\"onInsertTemplate\\\"]],[28,[37,2],[[30,0],\\\"hide\\\"],null]]],null],[1,\\\"\\\\n  \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null]],[],false,[\\\"if\\\",\\\"d-button\\\",\\\"action\\\",\\\"d-templates/filterable-list\\\"]]\",\n    \"moduleName\": \"discourse/plugins/discourse-templates/discourse/templates/connectors/editor-preview/d-templates.hbs\",\n    \"isStrictMode\": false\n  });\n});","define(\"discourse/plugins/discourse-templates/discourse/templates/connectors/topic-above-posts/discourse-templates-button\", [\"exports\", \"@ember/template-factory\"], function (_exports, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = _exports.default = (0, _templateFactory.createTemplateFactory)(\n  /*\n    <div class=\"template-topic-controls\">\n    <DButton\n      @icon={{if this.copyConfirm \"check\" \"copy\"}}\n      @action={{this.copy}}\n      @label=\"templates.copy\"\n      class={{concat-class\n        \"btn-default\"\n        \"template-copy\"\n        (if this.copyConfirm \"ok\")\n      }}\n    />\n    <DButton\n      @action={{this.createNewTopic}}\n      @label=\"templates.new_topic\"\n      @icon=\"plus\"\n      class=\"template-new-topic\"\n    />\n  </div>\n  */\n  {\n    \"id\": \"JxzWUf6/\",\n    \"block\": \"[[[10,0],[14,0,\\\"template-topic-controls\\\"],[12],[1,\\\"\\\\n  \\\"],[8,[39,0],[[16,0,[28,[37,1],[\\\"btn-default\\\",\\\"template-copy\\\",[52,[30,0,[\\\"copyConfirm\\\"]],\\\"ok\\\"]],null]]],[[\\\"@icon\\\",\\\"@action\\\",\\\"@label\\\"],[[52,[30,0,[\\\"copyConfirm\\\"]],\\\"check\\\",\\\"copy\\\"],[30,0,[\\\"copy\\\"]],\\\"templates.copy\\\"]],null],[1,\\\"\\\\n  \\\"],[8,[39,0],[[24,0,\\\"template-new-topic\\\"]],[[\\\"@action\\\",\\\"@label\\\",\\\"@icon\\\"],[[30,0,[\\\"createNewTopic\\\"]],\\\"templates.new_topic\\\",\\\"plus\\\"]],null],[1,\\\"\\\\n\\\"],[13]],[],false,[\\\"d-button\\\",\\\"concat-class\\\",\\\"if\\\"]]\",\n    \"moduleName\": \"discourse/plugins/discourse-templates/discourse/templates/connectors/topic-above-posts/discourse-templates-button.hbs\",\n    \"isStrictMode\": false\n  });\n});","define(\"discourse/plugins/discourse-templates/lib/replace-variables\", [\"exports\", \"discourse/models/user\"], function (_exports, _user) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.TEMPLATES_ALLOWED_VARIABLES = void 0;\n  _exports.replaceVariables = replaceVariables;\n  // keep this list synchronized with the list in spec/plugin_helper.rb\n  const TEMPLATES_ALLOWED_VARIABLES = _exports.TEMPLATES_ALLOWED_VARIABLES = Object.freeze([\"my_username\", \"my_name\", \"chat_channel_name\", \"chat_channel_url\", \"chat_thread_name\", \"chat_thread_url\", \"context_title\", \"context_url\", \"topic_title\", \"topic_url\", \"original_poster_username\", \"original_poster_name\", \"reply_to_username\", \"reply_to_name\", \"last_poster_username\", \"reply_to_or_last_poster_username\"]);\n  function replaceVariables(title, content, modelVariables) {\n    const currentUser = _user.default.current();\n    const variables = {\n      ...(modelVariables || {}),\n      my_username: currentUser?.username,\n      my_name: currentUser?.displayName\n    };\n    if (variables && typeof variables === \"object\") {\n      for (const key of TEMPLATES_ALLOWED_VARIABLES) {\n        if (variables[key]) {\n          title = title.replace(new RegExp(`%{${key}(,fallback:.[^}]*)?}`, \"g\"), variables[key]);\n          content = content.replace(new RegExp(`%{${key}(,fallback:.[^}]*)?}`, \"g\"), variables[key]);\n        } else {\n          title = title.replace(new RegExp(`%{${key},fallback:(.[^}]*)}`, \"g\"), \"$1\");\n          title = title.replace(new RegExp(`%{${key}}`, \"g\"), \"\");\n          content = content.replace(new RegExp(`%{${key},fallback:(.[^}]*)}`, \"g\"), \"$1\");\n          content = content.replace(new RegExp(`%{${key}}`, \"g\"), \"\");\n        }\n      }\n    }\n    return {\n      title,\n      content\n    };\n  }\n});","define(\"discourse/plugins/discourse-templates/lib/textarea-manipulator\", [\"exports\", \"@ember/application\", \"@ember/object\", \"discourse/mixins/textarea-text-manipulation\"], function (_exports, _application, _object, _textareaTextManipulation) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class TextareaManipulator extends _object.default.extend(_textareaTextManipulation.default) {\n    constructor(owner, textarea) {\n      super(...arguments);\n      (0, _application.setOwner)(this, owner);\n      this._textarea = textarea;\n      this.element = this._textarea;\n      this.ready = true;\n      this.init();\n    }\n    addBlock(text) {\n      this._addBlock(this.getSelected(), text);\n    }\n  }\n  _exports.default = TextareaManipulator;\n});","define(\"discourse/plugins/discourse-templates/lib/variables-chat-channel\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = extractVariablesFromChatChannel;\n  function extractVariablesFromChatChannel(channel, message, router) {\n    if (!channel && !message) {\n      return {};\n    }\n    const inReplyTo = message?.inReplyTo;\n    const channelVariables = {\n      chat_channel_name: channel?.title,\n      chat_channel_url: channel?.routeModels ? router?.urlFor(\"chat.channel\", ...channel.routeModels) : null,\n      reply_to_username: inReplyTo?.user?.username,\n      reply_to_name: inReplyTo?.user?.name\n    };\n    return {\n      ...channelVariables,\n      context_title: channelVariables.chat_channel_name,\n      context_url: channelVariables.chat_channel_url\n    };\n  }\n});","define(\"discourse/plugins/discourse-templates/lib/variables-chat-thread\", [\"exports\", \"discourse/plugins/discourse-templates/lib/variables-chat-channel\"], function (_exports, _variablesChatChannel) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = extractVariablesFromChatThread;\n  function extractVariablesFromChatThread(thread, message, router) {\n    if (!thread && !message) {\n      return {};\n    }\n    const channel = thread?.channel;\n    const inReplyTo = thread?.originalMessage;\n    const channelVariables = (0, _variablesChatChannel.default)(channel, message, router);\n    const threadVariables = {\n      chat_thread_name: thread?.title,\n      chat_thread_url: thread?.routeModels ? router?.urlFor(\"chat.channel.thread\", ...thread.routeModels) : null,\n      reply_to_username: inReplyTo?.user?.username,\n      reply_to_name: inReplyTo?.user?.name\n    };\n    return {\n      ...channelVariables,\n      ...threadVariables,\n      context_title: threadVariables.chat_thread_name || channelVariables.chat_channel_name,\n      context_url: threadVariables.chat_thread_url || channelVariables.chat_channel_url\n    };\n  }\n});","define(\"discourse/plugins/discourse-templates/lib/variables-composer\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = extractVariablesFromComposerModel;\n  function extractVariablesFromComposerModel(model) {\n    if (!model) {\n      return {};\n    }\n    const composerVariables = {\n      topic_title: model.topic?.title,\n      topic_url: model.topic?.url,\n      original_poster_username: model.topic?.details.created_by.username,\n      original_poster_name: model.topic?.details.created_by.name,\n      reply_to_username: model.post?.username,\n      reply_to_name: model.post?.name,\n      last_poster_username: model.topic?.last_poster_username,\n      reply_to_or_last_poster_username: model.post?.username || model.topic?.last_poster_username\n    };\n    return {\n      ...composerVariables,\n      context_title: composerVariables.topic_title,\n      context_url: composerVariables.topic_url\n    };\n  }\n});"],"mappings":"AAAAA,OAAA,4WAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GACA;AAMA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC;AACA,SAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAAAD,GAAAE,OAAAC,eAAAL,EAAAC,EAAA,CAAAK,WAAAJ,EAAAI,WAAAC,aAAAL,EAAAK,aAAAC,SAAAN,EAAAM,SAAAC,MAAAP,EAAAQ,YAAAR,EAAAQ,YAAAC,KAAAR,QAAA,IAIA,SAAAS,EAAAZ,EAAAC,EAAAY,EAAAX,EAAAC,GAAA,IAAAW,EAAA;AAAA,OAAAV,OAAAW,KAAAb,GAAAc,SAAA,SAAAC,GAAAH,EAAAG,GAAAf,EAAAe,EAAA,IAAAH,EAAAR,aAAAQ,EAAAR,WAAAQ,EAAAP,eAAAO,EAAAP,cAAA,UAAAO,KAAAJ,eAAAI,EAAAN,UAAA,GAAAM,EAAAD,EAAAK,QAAAC,UAAAC,QAAA,SAAAN,EAAAO,GAAA,OAAAA,EAAArB,EAAAC,EAAAa,KAAA,GAAAA,GAAAX,QAAA,IAAAW,EAAAJ,cAAAI,EAAAL,MAAAK,EAAAJ,YAAAI,EAAAJ,YAAAC,KAAAR,QAAA,EAAAW,EAAAJ,iBAAAY,QAAA,IAAAR,EAAAJ,cAAAN,OAAAC,eAAAL,EAAAC,E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