{"version":3,"names":["window","require","registerSettings","show_category_name","show_category_description","description_text_size","text_align","show_subcategory_header","show_parent_category_name","show_lock_icon","category_lock_icon","show_category_logo","show_parent_category_logo","show_site_logo","position_logo","size_logo","header_style","header_background_image","show_mobile","force_mobile_alignment","hide_if_no_category_description","hide_category_exceptions","show_read_more_link","read_more_link_text","define","_exports","_templateFactory","Object","defineProperty","value","default","createTemplateFactory","id","block","moduleName","isStrictMode","_deprecated","getObjectForTheme","initialize","forEach","name","url","_pluginApi","settings","after","withPluginApi","api","h","iconNode","lockIcon","createWidget","tagName","html","attrs","state","path","location","pathname","category","service","container","lookup","get","siteSettings","this","isException","split","includes","test","hideMobile","site","mobileView","subCat","parentCategory","noDesc","description_text","ifParentCategory","attributes","href","catDesc","innerHTML","description","ifParentProtected","read_restricted","ifProtected","getHeaderStyle","headerStyle","color","text_color","uploaded_background","aboutTopicUrl","topic_url","$","addClass","slug","style","uploaded_logo","src","logo_small","removeClass","decorateWidget","helper","widget","appEvents","on","scheduleRerender"],"sourceRoot":"theme-23/","sources":["settings.js","discourse/templates/connectors/above-main-container/category-header-widget.js","discourse/initializers/script-tag-hbs-deprecations.js","discourse/initializers/theme-field-119-common-html-script-1.js"],"sourcesContent":["(function() {\n  if ('require' in window) {\n    require(\"discourse/lib/theme-settings-store\").registerSettings(23, {\"show_category_name\":true,\"show_category_description\":true,\"description_text_size\":\"largest\",\"text_align\":\"center\",\"show_subcategory_header\":true,\"show_parent_category_name\":true,\"show_lock_icon\":false,\"category_lock_icon\":\"\",\"show_category_logo\":true,\"show_parent_category_logo\":true,\"show_site_logo\":true,\"position_logo\":\"top\",\"size_logo\":\"small\",\"header_style\":\"none\",\"header_background_image\":\"contain\",\"show_mobile\":true,\"force_mobile_alignment\":true,\"hide_if_no_category_description\":true,\"hide_category_exceptions\":\"\",\"show_read_more_link\":true,\"read_more_link_text\":\"Read more about this category…\"});\n  }\n})();\n","if ('define' in window) {\ndefine(\"discourse/theme-23/discourse/templates/connectors/above-main-container/category-header-widget\", [\"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    \n    {{mount-widget widget=\"category-header-widget\"}}\n  \n  */\n  {\n    \"id\": null,\n    \"block\": \"[[[1,\\\"\\\\n  \\\"],[1,[28,[35,0],null,[[\\\"widget\\\"],[\\\"category-header-widget\\\"]]]],[1,\\\"\\\\n\\\"]],[],false,[\\\"mount-widget\\\"]]\",\n    \"moduleName\": \"discourse/theme-23/discourse/templates/connectors/above-main-container/category-header-widget\",\n    \"isStrictMode\": false\n  });\n});\n}\n","if ('define' in window) {\ndefine(\"discourse/theme-23/discourse/initializers/script-tag-hbs-deprecations\", [\"exports\", \"discourse/lib/deprecated\"], function (_exports, _deprecated) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const settings = require(\"discourse/lib/theme-settings-store\").getObjectForTheme(23);\n  const themePrefix = key => `theme_translations.23.${key}`;\n  var _default = _exports.default = {\n    initialize() {\n      const names = [\"/connectors/above-main-container/category-header-widget\"];\n      names.forEach(name => {\n        (0, _deprecated.default)(`[${name}] adding templates to a theme using <script type='text/x-handlebars'> is deprecated. Move to dedicated .hbs or .gjs files.`, {\n          id: \"discourse.script-tag-hbs\",\n          url: \"https://meta.discourse.org/t/366482\"\n        });\n      });\n    }\n  };\n});\n}\n","if ('define' in window) {\ndefine(\"discourse/theme-23/discourse/initializers/theme-field-119-common-html-script-1\", [\"exports\", \"discourse/lib/plugin-api\", \"discourse/lib/deprecated\"], function (_exports, _pluginApi, _deprecated) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const settings = require(\"discourse/lib/theme-settings-store\").getObjectForTheme(23);\n  const themePrefix = key => `theme_translations.23.${key}`;\n  var _default = _exports.default = {\n    name: \"theme-field-119-common-html-script-1\",\n    after: \"inject-objects\",\n    initialize() {\n      (0, _deprecated.default)(\"Adding JS code using <script type='text/x-handlebars'> is deprecated. Move this code to a dedicated JavaScript file.\", {\n        id: \"discourse.script-tag-discourse-plugin\",\n        url: \"https://meta.discourse.org/t/366482\"\n      });\n      (0, _pluginApi.withPluginApi)(\"0.8\", api => {\n        const {\n          h\n        } = require('virtual-dom');\n        const {\n          iconNode\n        } = require(\"discourse-common/lib/icon-library\");\n        let iconName = settings.category_lock_icon || 'lock'; // Fallback to 'lock' if setting is not defined\n        let lockIcon = iconNode(iconName);\n        api.createWidget('category-header-widget', {\n          tagName: 'span',\n          html(attrs, state) {\n            const path = window.location.pathname;\n            let category;\n            const service = api.container.lookup('service:discovery');\n            category = service.get(\"category\");\n            const siteSettings = this.siteSettings;\n            const isException = category && settings.hide_category_exceptions.split(\"|\").includes(category.name);\n            if (/^\\/c\\//.test(path)) {\n              const hideMobile = !settings.show_mobile && this.site.mobileView;\n              const subCat = !settings.show_subcategory_header && category.parentCategory;\n              const noDesc = !settings.hide_if_no_category_description && !category.description_text;\n              if (!isException && !noDesc && !subCat && !hideMobile) {\n                $(\"body\").addClass(\"category-header\");\n                //list-controls\n\n                function ifParentCategory() {\n                  if (category.parentCategory) {\n                    return h('a.parent-box-link', {\n                      \"attributes\": {\n                        \"href\": category.parentCategory.url\n                      }\n                    }, h('h1', category.parentCategory.name + \": \"));\n                  }\n                }\n                function catDesc() {\n                  if (settings.show_category_description) {\n                    return h('div.cooked', {\n                      innerHTML: category.description\n                    });\n                  }\n                }\n                function logoImg() {\n                  if (settings.show_category_logo && category.uploaded_logo) {\n                    return [h('img', {\n                      \"attributes\": {\n                        \"src\": category.uploaded_logo.url\n                      }\n                    })];\n                  } else if (settings.show_category_logo && settings.show_parent_category_logo && category.parentCategory && category.parentCategory.uploaded_logo) {\n                    return [h('img', {\n                      \"attributes\": {\n                        \"src\": category.parentCategory.uploaded_logo.url\n                      }\n                    })];\n                  } else if (settings.show_site_logo && siteSettings.logo_small) {\n                    return [h('img', {\n                      \"attributes\": {\n                        \"src\": siteSettings.logo_small\n                      }\n                    })];\n                  }\n                }\n                function ifParentProtected() {\n                  if (category.parentCategory && category.parentCategory.read_restricted) {\n                    return lockIcon;\n                  }\n                }\n                function ifProtected() {\n                  if (category.read_restricted) {\n                    return lockIcon;\n                  }\n                }\n                function getHeaderStyle() {\n                  let headerStyle = \"\";\n                  if (settings.header_style == \"box\") {\n                    headerStyle += \"border-left: 6px solid #\" + category.color + \";\";\n                  }\n                  if (settings.header_style == \"banner\") {\n                    headerStyle += \"background-color: #\" + category.color + \"; color: #\" + category.text_color + \";\";\n                  }\n                  if (category.uploaded_background) {\n                    if (settings.header_background_image != \"outside\") {\n                      headerStyle += \"background-image: url(\" + category.uploaded_background.url + \");\";\n                    }\n                  }\n                  return headerStyle;\n                }\n                function aboutTopicUrl() {\n                  if (settings.show_read_more_link && category.topic_url) {\n                    return h('div.category-about-url', [h('a', {\n                      \"attributes\": {\n                        \"href\": category.topic_url\n                      }\n                    }, settings.read_more_link_text)]);\n                  }\n                }\n                return h('div.category-title-header' + \" .category-banner-\" + category.slug, {\n                  \"attributes\": {\n                    \"style\": getHeaderStyle()\n                  }\n                }, [h('div.category-title-contents', [h('div.category-logo.aspect-image', logoImg()), h('div.category-title-name', [ifParentProtected(), ifParentCategory(), ifProtected(), h('h1', category.name)]), h('div.category-title-description', catDesc())]), aboutTopicUrl()]);\n              }\n            } else {\n              $(\"body\").removeClass(\"category-header\");\n            }\n          }\n        }), api.decorateWidget('category-header-widget:after', helper => {\n          helper.widget.appEvents.on('page:changed', () => {\n            helper.widget.scheduleRerender();\n          });\n        });\n      });\n    }\n  };\n});\n}\n"],"mappings":"AACM,YAAaA,QACfC,QAAQ,sCAAsCC,iBAAiB,GAAI,CAACC,oBAAqB,EAAKC,2BAA4B,EAAKC,sBAAwB,UAAUC,WAAa,SAASC,yBAA0B,EAAKC,2BAA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