{"version":3,"file":"js/trackingSegment-ccce6b5fcc7171023641.chunk.js","mappings":"uKAIO,MAAMA,EAAoB,CAC/BC,MAAO,CACLC,eAAgB,CACdC,KAAMC,QACNC,UAAU,EACVC,SAAS,IAIbC,OAAAA,GACE,IAAIC,SAASC,IACNC,KAAKR,gBAA8D,QAA5CS,EAAAA,EAAQC,IAAIC,EAAAA,KACtCJ,GAAQ,GAEVK,SAASC,iBAAiBF,EAAAA,IAA4B,KACpDJ,GAAQ,EAAK,GACb,IACDO,KAAKN,KAAKO,UACf,EAEAC,MAAAA,GAEE,OAAOC,EAAAA,EAAAA,GAAE,GACX,E,qECtBF,MCFA,CACEC,OAAQ,C,SAACpB,GAETC,MAAO,CACLoB,SAAU,CACRlB,KAAMmB,OACNjB,UAAU,IAIdkB,QAAS,CACPN,SAAAA,GACEO,OAAOC,UAAUC,KAAKhB,KAAKW,SAC7B,G","sources":["webpack://agra/./app/javascript/components/tracking/check-consent-mixin.js","webpack://agra/./app/javascript/components/tracking/tracking-segment.vue?2073","webpack://agra/./app/javascript/components/tracking/tracking-segment.vue"],"sourcesContent":["import Cookies from 'js-cookie'\nimport { COOKIE_NAME_AGREED_COOKIES } from '@/constants'\nimport { h } from 'vue'\n\nexport const checkConsentMixin = {\n  props: {\n    requireConsent: {\n      type: Boolean,\n      required: false,\n      default: true\n    }\n  },\n\n  created() {\n    new Promise((resolve) => {\n      if (!this.requireConsent || Cookies.get(COOKIE_NAME_AGREED_COOKIES) === 'all') {\n        resolve(true)\n      }\n      document.addEventListener(COOKIE_NAME_AGREED_COOKIES, () => {\n        resolve(true)\n      })\n    }).then(this.trackPage)\n  },\n\n  render() {\n    // render-less view function just returns an empty string.\n    return h('')\n  }\n}\n","import script from \"./tracking-segment.vue?vue&type=script&lang=js\"\nexport * from \"./tracking-segment.vue?vue&type=script&lang=js\"\n\nconst __exports__ = script;\n\nexport default __exports__","<script>\nimport { checkConsentMixin } from './check-consent-mixin'\n\nexport default {\n  mixins: [checkConsentMixin],\n\n  props: {\n    writeKey: {\n      type: String,\n      required: true\n    }\n  },\n\n  methods: {\n    trackPage() {\n      window.analytics.load(this.writeKey)\n    }\n  }\n}\n</script>\n"],"names":["checkConsentMixin","props","requireConsent","type","Boolean","required","default","created","Promise","resolve","this","Cookies","get","COOKIE_NAME_AGREED_COOKIES","document","addEventListener","then","trackPage","render","h","mixins","writeKey","String","methods","window","analytics","load"],"sourceRoot":""}