{"version":3,"file":"virtual_main.js","sources":["theme-7/virtual:init-settings","theme-7/virtual:theme","theme-7/discourse/initializers/theme-field-22-common-html-script-1.js","theme-7/virtual:main"],"sourcesContent":["import { registerSettings } from \"discourse/lib/theme-settings-store\";\n\nregisterSettings(7, {});\n","import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(7);\n\nexport function themePrefix(key) {\n  return `theme_translations.7.${key}`;\n}\n","import { withPluginApi } from \"discourse/lib/plugin-api\";\nimport deprecated from \"discourse/lib/deprecated\";\n\nexport default {\n  name: \"theme-field-22-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.11.0\", (api) => {\n      \n    window.dataLayer = window.dataLayer || [];\n    function gtag() {\n        dataLayer.push(arguments);\n    }\n    \n    gtag('consent', 'default', {\n        'analytics_storage': 'denied', // no analytics cookies by default\n        'ad_storage': 'denied', // no ads cookies by default\n        'wait_for_update': 2000\n    });\n    \n    gtag('set', 'developer_id.dNzMyY2', true); // OneTrust developer id\n    gtag(\"js\", new Date());\n    gtag('config', 'G-NDG04ENSGD', {\n        'send_page_view': true\n    });\n    \n    api.onAppEvent('page:changed', function (data) {\n        gtag('event', 'page_view', {\n            page_location: document.location.href,\n            page_path: data.url,\n            page_title: data.title\n        });\n    });\n    \n    if (!window._optanonCallbacks) {\n        window._optanonCallbacks = [];\n    }\n    \n    _optanonCallbacks.push(function () {\n        // if consent given for cookies then\n        // update gtag consent\n        var analytics = (OnetrustActiveGroups.indexOf('C0002') != -1);\n        var ads = (OnetrustActiveGroups.indexOf('C0004') != -1);\n        if (analytics || ads) {\n            gtag('consent', 'update', {\n                'analytics_storage': analytics ? 'granted' : 'denied',\n                'ad_storage': ads ? 'granted' : 'denied'\n            });\n        }\n    });\n\n    });\n  }\n};\n","import \"virtual:init-settings\";\n\nconst themeCompatModules = {};\nimport * as Mod1 from \"./discourse/initializers/theme-field-22-common-html-script-1\";\nthemeCompatModules[\"discourse/initializers/theme-field-22-common-html-script-1\"] = Mod1;\n\nexport default themeCompatModules;\n"],"names":["registerSettings","getObjectForTheme","themeField22CommonHtmlScript1","name","after","initialize","deprecated","id","url","withPluginApi","api","gtag","dataLayer","push","arguments","window","analytics_storage","ad_storage","wait_for_update","Date","send_page_view","onAppEvent","data","page_location","document","location","href","page_path","page_title","title","_optanonCallbacks","analytics","OnetrustActiveGroups","indexOf","ads","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,SAAWC,IAGzB,SAASC,IACLC,UAAUC,KAAKC,UACnB,CAHAC,OAAOH,UAAYG,OAAOH,WAAa,GAKvCD,EAAK,UAAW,UAAW,CACvBK,kBAAqB,SACrBC,WAAc,SACdC,gBAAmB,MAGvBP,EAAK,MAAO,wBAAwB,GACpCA,EAAK,KAAM,IAAIQ,MACfR,EAAK,SAAU,eAAgB,CAC3BS,gBAAkB,IAGtBV,EAAIW,WAAW,eAAgB,SAAUC,GACrCX,EAAK,QAAS,YAAa,CACvBY,cAAeC,SAASC,SAASC,KACjCC,UAAWL,EAAKd,IAChBoB,WAAYN,EAAKO,OAEzB,GAEKd,OAAOe,oBACRf,OAAOe,kBAAoB,IAG/BA,kBAAkBjB,KAAK,WAGnB,IAAIkB,GAAsD,GAAzCC,qBAAqBC,QAAQ,SAC1CC,GAAgD,GAAzCF,qBAAqBC,QAAQ,UACpCF,GAAaG,IACbvB,EAAK,UAAW,SAAU,CACtBK,kBAAqBe,EAAY,UAAY,SAC7Cd,WAAciB,EAAM,UAAY,UAG5C,IAGF;AC1DG,MAACC,EAAqB,CAAA;AAE3BA,EAAmB,8DAAgEC;"}