{ "version": 3, "sources": ["src/app/core/utilities.ts"], "sourcesContent": ["declare const BUILD_TIME: string\r\n\r\nexport function getRecurrenceFreq(recurrence: string): string | null {\r\n if (!recurrence || !recurrence.includes('RRULE:')) return recurrence;\r\n\r\n const match = recurrence.match(/FREQ=.*/)\r\n\r\n return match ? match[0] : null;\r\n}\r\n\r\nexport function isGuid(guid: string): boolean {\r\n return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(guid)\r\n}\r\n\r\nexport function browserSupportsInputType(type: string): boolean {\r\n const input = document.createElement('input')\r\n input.setAttribute('type', type)\r\n return input.type === type\r\n}\r\n\r\n// create link tag to load css-bundle\r\nexport function loadStyleBundle(bundleName: string): void {\r\n const style = document.createElement('link')\r\n style.id = bundleName\r\n style.rel = 'stylesheet'\r\n style.href = bundleName + '.css?v=' + BUILD_TIME\r\n\r\n // cancel if the stylesheet was already loaded\r\n if (document.querySelector('link[id=\"' + bundleName + '\"]'))\r\n return\r\n\r\n document.getElementsByTagName('head')[0].appendChild(style)\r\n}\r\n\r\n\r\n// source: https://github.com/Cordobo/angularx-qrcode/blob/main/projects/demo-app/src/app/app.component.ts#L216C3-L231C4\r\nexport function convertBase64ToBlob(Base64Image: string) {\r\n // split into two parts\r\n const parts = Base64Image.split(\";base64,\")\r\n // hold the content type\r\n const imageType = parts[0].split(\":\")[1]\r\n // decode base64 string\r\n const decodedData = window.atob(parts[1])\r\n // create unit8array of size same as row data length\r\n const uInt8Array = new Uint8Array(decodedData.length)\r\n // insert all character code into uint8array\r\n for (let i = 0; i < decodedData.length; ++i) {\r\n uInt8Array[i] = decodedData.charCodeAt(i)\r\n }\r\n // return blob image after conversion\r\n return new Blob([uInt8Array], { type: imageType })\r\n}\r\n"], "mappings": "AAEM,SAAUA,EAAkBC,EAAkB,CAClD,GAAI,CAACA,GAAc,CAACA,EAAWC,SAAS,QAAQ,EAAG,OAAOD,EAE1D,IAAME,EAAQF,EAAWE,MAAM,SAAS,EAExC,OAAOA,EAAQA,EAAM,CAAC,EAAI,IAC5B,CAEM,SAAUC,EAAOC,EAAY,CACjC,MAAO,gFAAgFC,KAAKD,CAAI,CAClG,CAEM,SAAUE,EAAyBC,EAAY,CACnD,IAAMC,EAAQC,SAASC,cAAc,OAAO,EAC5CF,OAAAA,EAAMG,aAAa,OAAQJ,CAAI,EACxBC,EAAMD,OAASA,CACxB,CAGM,SAAUK,EAAgBC,EAAkB,CAChD,IAAMC,EAAQL,SAASC,cAAc,MAAM,EAC3CI,EAAMC,GAAKF,EACXC,EAAME,IAAM,aACZF,EAAMG,KAAOJ,EAAa,0BAGtBJ,UAASS,cAAc,YAAcL,EAAa,IAAI,GAG1DJ,SAASU,qBAAqB,MAAM,EAAE,CAAC,EAAEC,YAAYN,CAAK,CAC5D,CAIM,SAAUO,EAAoBC,EAAmB,CAErD,IAAMC,EAAQD,EAAYE,MAAM,UAAU,EAEpCC,EAAYF,EAAM,CAAC,EAAEC,MAAM,GAAG,EAAE,CAAC,EAEjCE,EAAcC,OAAOC,KAAKL,EAAM,CAAC,CAAC,EAElCM,EAAa,IAAIC,WAAWJ,EAAYK,MAAM,EAEpD,QAASC,EAAI,EAAGA,EAAIN,EAAYK,OAAQ,EAAEC,EACxCH,EAAWG,CAAC,EAAIN,EAAYO,WAAWD,CAAC,EAG1C,OAAO,IAAIE,KAAK,CAACL,CAAU,EAAG,CAAEtB,KAAMkB,CAAS,CAAE,CACnD", "names": ["getRecurrenceFreq", "recurrence", "includes", "match", "isGuid", "guid", "test", "browserSupportsInputType", "type", "input", "document", "createElement", "setAttribute", "loadStyleBundle", "bundleName", "style", "id", "rel", "href", "querySelector", "getElementsByTagName", "appendChild", "convertBase64ToBlob", "Base64Image", "parts", "split", "imageType", "decodedData", "window", "atob", "uInt8Array", "Uint8Array", "length", "i", "charCodeAt", "Blob"] }