{"version":3,"file":"virtual_main.js","sources":["theme-9/virtual:init-settings","theme-9/virtual:theme","theme-9/discourse/initializers/theme-field-31-common-html-script-1.js","theme-9/virtual:main"],"sourcesContent":["import { registerSettings } from \"discourse/lib/theme-settings-store\";\n\nregisterSettings(9, {});\n","import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(9);\n\nexport function themePrefix(key) {\n  return `theme_translations.9.${key}`;\n}\n","import { withPluginApi } from \"discourse/lib/plugin-api\";\nimport deprecated from \"discourse/lib/deprecated\";\n\nexport default {\n  name: \"theme-field-31-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      \nconst decorateLines = (post) => {\n  try {\n    // Combinations of 'number', 'wrap', 'scroll' and/or 'shadow'\n    const classes = ['decorator', 'number', 'scroll', 'shadow'].map(c => `lines-${c}`);\n\n    const split = /^(.*)$/mg;\n    const elems = post.querySelectorAll('pre code:not(.lines-decorator)');\n    elems.forEach(elem => {\n      const count = elem.innerHTML.trim().match(split).length;\n\n      // Discourse uses `<aside>` for quotes of other forum posts\n      const aside = elem.closest('aside');\n      \n      // Formating looks odd when link to a GitHub line of code/quote\n      // so ignore any GitHub quotes\n      if (aside && aside.classList.contains('githubblob')) {\n        return;   \n      }\n      \n      const quote = aside ? ['lines-in-quote'] : [];\n      \n      elem.parentElement.classList.add(`lines-count-${count}`, ...classes, ...quote);\n      elem.classList.add(`lines-count-${count}`, ...classes, ...quote);\n      const lineClass = ['lines-line', ...quote].join(' ');\n\n      // Assume we don't have any event listeners on the line,\n      // and trim to hide trailing blank lines\n      elem.innerHTML = elem.innerHTML.trim().replace(/^(.*)$/mg, `<span class=\"${lineClass}\">$1</span>`);\n    });\n  } catch (e) {\n    console.error(e);\n  }\n}\n\napi.decorateCookedElement(decorateLines, {id: 'decorate-pre-code-lines'});\n\n    });\n  }\n};\n","import \"virtual:init-settings\";\n\nconst themeCompatModules = {};\nimport * as Mod1 from \"./discourse/initializers/theme-field-31-common-html-script-1\";\nthemeCompatModules[\"discourse/initializers/theme-field-31-common-html-script-1\"] = Mod1;\n\nexport default themeCompatModules;\n"],"names":["registerSettings","getObjectForTheme","themeField31CommonHtmlScript1","name","after","initialize","deprecated","id","url","withPluginApi","api","decorateCookedElement","post","classes","map","c","split","querySelectorAll","forEach","elem","count","innerHTML","trim","match","length","aside","closest","classList","contains","quote","parentElement","add","lineClass","join","replace","e","console","error","themeCompatModules","Mod1"],"mappings":";AAEAA,EAAiB,EAAG,CAAA,GCAIC,EAAkB;ACC1C,IAAAC,EAAe,CACbC,KAAM,sCACNC,MAAO,iBAEPC,UAAAA,GACEC,EACE,2HACA,CACEC,GAAI,wCACJC,IAAK,wCAGTC,EAAc,MAAQC,IAoC1BA,EAAIC,sBAlCmBC,IACrB,IAEE,MAAMC,EAAU,CAAC,YAAa,SAAU,SAAU,UAAUC,IAAIC,GAAK,SAASA,KAExEC,EAAQ;AACAJ,EAAKK,iBAAiB,kCAC9BC,QAAQC,IACZ,MAAMC,EAAQD,EAAKE,UAAUC,OAAOC,MAAMP,GAAOQ,OAG3CC,EAAQN,EAAKO,QAAQ;AAI3B,GAAID,GAASA,EAAME,UAAUC,SAAS,cACpC;AAGF,MAAMC,EAAQJ,EAAQ,CAAC,kBAAoB;AAE3CN,EAAKW,cAAcH,UAAUI,IAAI,eAAeX,OAAYP,KAAYgB,GACxEV,EAAKQ,UAAUI,IAAI,eAAeX,OAAYP,KAAYgB;AAC1D,MAAMG,EAAY,CAAC,gBAAiBH,GAAOI,KAAK;AAIhDd,EAAKE,UAAYF,EAAKE,UAAUC,OAAOY,QAAQ,WAAY,gBAAgBF,iBAE/E,CAAE,MAAOG,GACPC,QAAQC,MAAMF,EAChB,GAGuC,CAAC5B,GAAI,6BAG5C;ACpDG,MAAC+B,EAAqB,CAAA;AAE3BA,EAAmB,8DAAgEC;"}