{"version":3,"file":"main.js","sources":["theme-15/virtual:init-settings","theme-15/virtual:theme","theme-15/discourse/templates/connectors/above-site-header/brand-header.hbs","theme-15/discourse/initializers/script-tag-hbs-deprecations.js","theme-15/discourse/initializers/theme-field-107-common-html-script-1.js","theme-15/virtual:entrypoint:main"],"sourcesContent":["import { registerSettings } from \"discourse/lib/theme-settings-store\";\n\nregisterSettings(15, {\n  \"brand_name\": \"AT&T API Marketplace Community\",\n  \"website_url\": \"https://apimarket.att.com/\",\n  \"logo_url\": \"\",\n  \"mobile_logo_url\": \"\",\n  \"links\": \"Developer documentation,https://apimarket.att.com/developer,_blank\",\n  \"inlinks\": \"Overview,https://apimarket.att.com/portal/dashboard/overview,_blank|Communication APIs,https://apimarket.att.com/portal/dashboard/self-service-apis,_blank|Resources,https://apimarket.att.com/portal/dashboard/resources,_blank|Developer documentation,https://apimarket.att.com/developer,_blank\",\n  \"icons\": \"\",\n  \"custom_font_awesome_icons\": \"\"\n});\n","import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(15);\n\nexport function themePrefix(key) {\n  return `theme_translations.15.${key}`;\n}\n","\n  {{mount-widget widget=\"brand-header\"}}\n  ","import deprecated from \"discourse/lib/deprecated\";\n\nexport default {\n  initialize(){\n    const names = [\"/connectors/above-site-header/brand-header\"];\n    names.forEach((name) => {\n      deprecated(\n        `[${name}] adding templates to a theme using <script type='text/x-handlebars'> is deprecated. Move to dedicated .hbs or .gjs files.`,\n        {\n          id: \"discourse.script-tag-hbs\",\n          url: \"https://meta.discourse.org/t/366482\",\n        }\n      )\n    });\n    const errors = [];\n    errors.forEach((error) => console.error(error));\n  }\n}\n","import { withPluginApi } from \"discourse/lib/plugin-api\";\nimport deprecated from \"discourse/lib/deprecated\";\n\nexport default {\n  name: \"theme-field-107-common-html-script-1\",\n  after: \"inject-objects\",\n\n  initialize() {\n    deprecated(\n      \"Adding JS code using <script type='text/discourse-plugin'> is deprecated. Move this code to a dedicated JavaScript file.\",\n      {\n        id: \"discourse.script-tag-discourse-plugin\",\n        url: \"https://meta.discourse.org/t/366482\",\n      }\n    )\n    withPluginApi(\"0.8\", (api) => {\n      \n\n  const { h } = require('virtual-dom');\n  const { applyDecorators } = require('discourse/widgets/widget');\n  \n  const flatten = array => [].concat.apply([], array);\n  \n  api.createWidget('nav-links', {\n    tagName: 'nav.links',\n  \n    html(attrs) {\n      const links = [].concat(attrs.contents());\n  \n      return [h('ul.nav.nav-pills', links.map(l => h('li', {}, l)))];\n    }\n  });\n  \n  api.createWidget('nav-icons', {\n    tagName: 'ul.icons.clearfix',\n  \n    html(attrs) {\n      const links = [].concat(attrs.contents());\n  \n      return links.map(l => h('li', {}, l));\n    }\n  });\n  \n  api.createWidget('brand-header-right', {\n    tagName: 'div.panel.clearfix',\n  \n    html(attrs) {\n      return attrs.contents();\n    },\n  });\n  \n  api.createWidget('brand-header-icons', {\n    tagName: 'ul.icons.clearfix',\n  \n    buildAttributes() {\n      return { role: 'navigation' };\n    },\n  \n    html(attrs) {\n      const hamburger = this.attach('header-dropdown', {\n                              title: 'hamburger_brand_menu',\n                              icon: 'bars',\n                              iconId: 'toggle-hamburger-brand-menu',\n                              active: attrs.hamburgerVisible,\n                              action: 'toggleHamburger'\n                            });\n      const icons = [hamburger];\n      return icons;\n    },\n  });\n  \n  api.createWidget('brand-header', {\n    tagName: 'header.b-header.clearfix',\n    buildKey: () => `header`,\n  \n    defaultState() {\n      let states =  {\n        hamburgerVisible: false\n      };\n  \n      return states;\n    },\n\n    toggleHamburger() {\n      if (!this.state.hamburgerVisible && $(\".header-cloak\").css(\"display\") === \"block\") {\n        Ember.run.later(() => {\n          this.sendWidgetAction(\"toggleHamburger\")\n        }, 200);\n      } else {\n        this.state.hamburgerVisible = !this.state.hamburgerVisible;\n      }\n    },\n  \n    generalLinks() {\n      const links = settings.links;\n      const inlinks = settings.inlinks;\n      const hasUser = api.getCurrentUser() != null\n\n      if (hasUser && inlinks) {\n        return inlinks.split(\"|\").map((l, i) => {\n          const values = l.split(\",\");\n          return this.attach('link', {\n              rawLabel: values[0].trim(),\n              href: values[1].trim(),\n              omitSpan: true,\n              attributes: {\n                target: (values[2] || '').trim()\n              }\n          });\n        });\n      } else if (links) {\n        return links.split(\"|\").map((l, i) => {\n          const values = l.split(\",\");\n          return this.attach('link', {\n              rawLabel: values[0].trim(),\n              href: values[1].trim(),\n              omitSpan: true,\n              attributes: {\n                target: (values[2] || '').trim()\n              }\n          });\n        });\n      } else {\n        return [];\n      }\n    },\n  \n    iconLinks() {\n      const icons = settings.icons;\n\n      if (icons) {\n        return icons.split(\"|\").map(l => {\n          const values = l.split(\",\");\n          return this.attach('link', {\n              icon: values[0].trim(),\n              href: values[1].trim(),\n              omitSpan: true,\n              attributes: {\n                target: (values[2] || '').trim()\n              }\n          });\n        });\n      } else {\n        return [];\n      }\n    },\n  \n    html(attrs, state) {\n      const { siteSettings } = this;\n      const mobileView = this.site.mobileView;\n  \n      const contents = [];\n  \n      contents.push(this.attach('brand-logo'));\n  \n      const panelContents = [];\n  \n      if(mobileView) {\n  \n        panelContents.push(this.attach('brand-header-icons', { hamburgerVisible: state.hamburgerVisible }));\n  \n        if (state.hamburgerVisible) {\n          panelContents.push(this.attach('hamburger-brand-menu', { generalLinks: this.generalLinks(), iconLinks: this.iconLinks() }));\n        }\n      } else {\n        contents.push(this.attach('nav-links', { contents: () => this.generalLinks() }));\n        panelContents.push(this.attach('nav-icons', { contents: () => this.iconLinks() }));\n      }\n  \n      contents.push(this.attach('brand-header-right', { contents: () => panelContents }));\n  \n      return h('div.wrap', h('div.contents.clearfix', contents));\n    }\n  \n  });\n  \n  api.createWidget('hamburger-brand-menu', {\n    tagName: 'div.hamburger-panel',\n  \n    panelContents(generalLinks, iconLinks) {\n      const results = [];\n  \n      results.push(this.attach('menu-links', { contents: () => generalLinks }));\n      results.push(this.attach('nav-icons', { contents: () => iconLinks }));\n  \n      return results;\n    },\n  \n    html(attrs) {\n      return this.attach('menu-panel', { contents: () => this.panelContents(attrs.generalLinks, attrs.iconLinks) });\n    },\n  \n    clickOutside() {\n      this.sendWidgetAction('toggleHamburger');\n   }\n  });\n  \n  const { wantsNewWindow } = require('discourse/lib/intercept-click');\n  const DiscourseURL = require('discourse/lib/url').default;\n  \n  api.createWidget('brand-logo', {\n    tagName: 'div.title',\n  \n    logo() {\n      const mobileView = this.site.mobileView;\n  \n      const mobileLogoUrl = settings.mobile_logo_url || \"\";\n      const showMobileLogo = mobileView && (mobileLogoUrl.length > 0);\n  \n      const logoUrl = settings.logo_url || \"\";\n      const title = settings.brand_name;\n  \n      if (showMobileLogo) {\n        return h('img#brand-logo.logo-big', { key: 'logo-mobile', attributes: { src: mobileLogoUrl, alt: title } });\n      } else if (logoUrl.length) {\n        return h('img#brand-logo.logo-big', { key: 'logo-big', attributes: { src: logoUrl, alt: title } });\n      } else {\n        return h('h2#brand-text-logo.text-logo', { key: 'logo-text' }, title);\n      }\n    },\n  \n    html() {\n      return h('a', { attributes: { href: settings.website_url } }, this.logo());\n    },\n  \n    click(e) {\n      if (wantsNewWindow(e)) { return false; }\n      e.preventDefault();\n  \n      DiscourseURL.routeToTag($(e.target).closest('a')[0]);\n      return false;\n    }\n  });\n  \n  \n    });\n  }\n};\n","const compatModules = {};import \"virtual:init-settings\";\nimport * as Mod1 from \"./discourse/templates/connectors/above-site-header/brand-header.hbs\";\ncompatModules[\"discourse/templates/connectors/above-site-header/brand-header\"] = Mod1;\n\nexport * as discourse$templates$connectors$above__site__header$brand__header$$__module from \"./discourse/templates/connectors/above-site-header/brand-header.hbs\";\nexport {\ndefault as discourse$templates$connectors$above__site__header$brand__header$$default\n} from \"./discourse/templates/connectors/above-site-header/brand-header.hbs\";\nimport * as Mod2 from \"./discourse/initializers/script-tag-hbs-deprecations\";\ncompatModules[\"discourse/initializers/script-tag-hbs-deprecations\"] = Mod2;\n\nexport * as discourse$initializers$script__tag__hbs__deprecations$$__module from \"./discourse/initializers/script-tag-hbs-deprecations\";\nexport {\ndefault as discourse$initializers$script__tag__hbs__deprecations$$default\n} from \"./discourse/initializers/script-tag-hbs-deprecations\";\nimport * as Mod3 from \"./discourse/initializers/theme-field-107-common-html-script-1\";\ncompatModules[\"discourse/initializers/theme-field-107-common-html-script-1\"] = Mod3;\n\nexport * as discourse$initializers$theme__field__107__common__html__script__1$$__module from \"./discourse/initializers/theme-field-107-common-html-script-1\";\nexport {\ndefault as discourse$initializers$theme__field__107__common__html__script__1$$default\n} from \"./discourse/initializers/theme-field-107-common-html-script-1\";\nexport default compatModules;\n"],"names":["registerSettings","brand_name","website_url","logo_url","mobile_logo_url","links","inlinks","icons","custom_font_awesome_icons","settings","getObjectForTheme","brandHeader","createTemplateFactory","id","block","moduleName","isStrictMode","deprecated","url","scriptTagHbsDeprecations","initialize","forEach","name","error","console","themeField107CommonHtmlScript1","after","withPluginApi","api","h","require","applyDecorators","createWidget","tagName","html","attrs","concat","contents","map","l","buildAttributes","role","this","attach","title","icon","iconId","active","hamburgerVisible","action","buildKey","defaultState","toggleHamburger","state","$","css","Ember","run","later","sendWidgetAction","generalLinks","getCurrentUser","split","i","values","rawLabel","trim","href","omitSpan","attributes","target","iconLinks","siteSettings","mobileView","site","push","panelContents","results","clickOutside","wantsNewWindow","DiscourseURL","default","logo","mobileLogoUrl","showMobileLogo","length","logoUrl","key","src","alt","click","e","preventDefault","routeToTag","closest","compatModules","Mod1","Mod2","Mod3"],"mappings":";AAEAA,EAAiB,GAAI,CACnBC,WAAc,iCACdC,YAAe,6BACfC,SAAY,GACZC,gBAAmB,GACnBC,MAAS,qEACTC,QAAW,sSACXC,MAAS,GACTC,0BAA6B;ACRxB,MAAMC,EAAWC,EAAkB;ACA5B,IAAAC,EAAAC,EAAA,CAAAC,GAAA,KAAAC,MAAA,qGAAAC,WAAA,6EAAAC,cAAA;AAGAC,EACE,+JACA,CACEJ,GAAI,0BACJK,IAAK;gDCPvBC,EAAe,CACbC,UAAAA,GACgB,CAAC,8CACTC,QAASC,IACbL,EACE,IAAIK,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