{"version":3,"file":"site.22576d582b21eed8e693.js","mappings":"2HAGO,MAAMA,cAEZ,WAAAC,CAA4BC,GAAA,KAAAA,cAAAA,CAE5B,E,aCLM,MAAMC,cAOZ,WAAAF,G,MAIC,GATgB,KAAAG,WAAa,kBACb,KAAAC,WAAa,wBAM7BC,KAAKC,aAAeC,SAASC,cAAc,kBAEtCH,KAAKC,aAOV,GAJAD,KAAKI,mBAA2D,QAAtC,EAAAJ,KAAKC,aAAaI,QAAQC,oBAAY,QAAI,GAInD,SAFAC,aAAaC,QAAQR,KAAKD,YAM1CC,KAAKC,aAAaQ,MAAMC,QAAU,WAGnC,CAGC,MAAMC,EAAeX,KAAKC,aAAaE,cAAc,kBAC/CS,EAAgBZ,KAAKC,aAAaE,cAAc,mBAEtD,IAAKQ,IAAiBC,EACrB,OAEDD,EAAaE,iBAAiB,QAASb,KAAKc,cAAcC,KAAKf,MAAM,IAAO,GAC5EY,EAAcC,iBAAiB,QAASb,KAAKc,cAAcC,KAAKf,MAAM,IAAQ,E,CAEhF,CAEO,aAAAc,CAAcE,GAEpBT,aAAaU,QAAQjB,KAAKD,WAAY,QAElCiB,GAEChB,KAAKI,qBACRF,SAASgB,OAASlB,KAAKI,oBAExBJ,KAAKC,aAAaQ,MAAMC,QAAU,QAIlC,SAAeV,KAAKF,WAEtB,CAEO,iBAAAqB,GAEN,QAAS,MAAYnB,KAAKF,WAC3B,ECrDD,MAECsB,QAAQC,IAAI,yCAEZ,MAAMzB,EAAgB,IAAIC,cAI1ByB,OAAO5B,cAAgB,IAAIA,cAAcE,EACzC,EATD,E","sources":["webpack://temp365.dental/./Content/scripts/blazor/index.ts","webpack://temp365.dental/./Content/scripts/components/cookie-consent.ts","webpack://temp365.dental/./Content/scripts/index.ts"],"sourcesContent":["/* eslint-disable */\r\nimport { CookieConsent } from \"../components/cookie-consent\";\r\n\r\nexport class BlazorInterop\r\n{\r\n\tconstructor(public readonly cookieConsent: CookieConsent)\r\n\t{\r\n\t}\r\n}","import * as Cookies from \"js-cookie\";\r\n\r\nexport class CookieConsent\r\n{\r\n\tprivate readonly cookieName = \".AspNet.Consent\";\r\n\tprivate readonly storageKey = \"cookieConsentActioned\";\r\n\tprivate readonly cookieConsentValue: string;\r\n\tprivate readonly cookieBanner: HTMLElement;\r\n\r\n\tconstructor()\r\n\t{\r\n\t\tthis.cookieBanner = document.querySelector(\"#cookieConsent\") as HTMLElement;\r\n\r\n\t\tif (!this.cookieBanner)\r\n\t\t\treturn;\r\n\r\n\t\tthis.cookieConsentValue = this.cookieBanner.dataset.cookieString ?? \"\";\r\n\r\n\t\tconst actioned = localStorage.getItem(this.storageKey);\r\n\r\n\t\tif (actioned === \"true\")\r\n\t\t{\r\n\t\t\t// If we get here it means that the banner was rendered, but the fact they have actioned before means they declined them.\r\n\t\t\t// Just hide the banner\r\n\t\t\tthis.cookieBanner.style.display = \"none\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// The banner has been rendered but the user has never actioned before\r\n\t\t\t// This is the only time the banner will be displayed. The user can use their account settings to enable cookies at other times.\r\n\t\t\tconst acceptButton = this.cookieBanner.querySelector(\".accept-policy\") as HTMLButtonElement;\r\n\t\t\tconst declineButton = this.cookieBanner.querySelector(\".decline-policy\") as HTMLButtonElement;\r\n\r\n\t\t\tif (!acceptButton || !declineButton)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tacceptButton.addEventListener(\"click\", this.toggleCookies.bind(this, true), false);\r\n\t\t\tdeclineButton.addEventListener(\"click\", this.toggleCookies.bind(this, false), false);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic toggleCookies(enable: boolean): void\r\n\t{\r\n\t\tlocalStorage.setItem(this.storageKey, \"true\");\r\n\r\n\t\tif (enable)\r\n\t\t{\r\n\t\t\tif (this.cookieConsentValue)\r\n\t\t\t\tdocument.cookie = this.cookieConsentValue;\r\n\r\n\t\t\tthis.cookieBanner.style.display = \"none\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tCookies.remove(this.cookieName);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic areCookiesEnabled(): boolean\r\n\t{\r\n\t\treturn !!Cookies.get(this.cookieName);\r\n\t}\r\n}","import \"jquery\";\r\nimport \"bootstrap\";\r\nimport \"../styles/index.scss\";\r\nimport { BlazorInterop } from \"./blazor\";\r\nimport { CookieConsent } from \"./components/cookie-consent\";\r\n\r\ndeclare const APP_ENVIRONMENT: \"Development\" | \"Production\";\r\n\r\n(() =>\r\n{\r\n\tconsole.log(`Temp365 Dental - Loading - ${APP_ENVIRONMENT}`);\r\n\r\n\tconst cookieConsent = new CookieConsent();\r\n\r\n\t// eslint-disable-next-line\r\n\t// @ts-ignore\r\n\twindow.BlazorInterop = new BlazorInterop(cookieConsent);\r\n})();"],"names":["BlazorInterop","constructor","cookieConsent","CookieConsent","cookieName","storageKey","this","cookieBanner","document","querySelector","cookieConsentValue","dataset","cookieString","localStorage","getItem","style","display","acceptButton","declineButton","addEventListener","toggleCookies","bind","enable","setItem","cookie","areCookiesEnabled","console","log","window"],"sourceRoot":""}