{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm/legacy/chunk-4e92c885.js","webpack:///./node_modules/@ionic/core/dist/esm/legacy/chunk-ba834eff.js","webpack:///./node_modules/@ionic/core/dist/esm/legacy/chunk-c90aaa66.js","webpack:///./node_modules/@ionic/core/dist/esm/legacy/chunk-cae2ca23.js","webpack:///./src/app/services/notification.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACiH;;;;;;;;;;;;;AC1CjH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAY,SAAI;AACiB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kBAAkB,EAAE;AACtD,+BAA+B,iBAAiB,EAAE;AAClD,kCAAkC,iBAAiB,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA,gDAAgD,sBAAsB,EAAE;AACxE;AACA;AACA;AACA,6CAA6C,QAAQ,+CAAiB;AACtE;AACA,WAAW,iDAAmB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC,EAAE;AACkF;;;;;;;;;;;;;ACnDrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,oBAAoB;AACpB;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,UAAU;AACpC;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AAC4L;;;;;;;;;;;;;AChG5L;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,mBAAmB;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,mCAAmC;AAC3E;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9GmB;AACZ;AACoB;AACE;AAG/D,IAAM,WAAW,GAAG,eAAe,CAAC;AAOpC;IAEE,6BAAmB,OAAgB,EAAS,cAA8B,EAAS,eAAgC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AO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,EAAC;qBAC9C;;;iBACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,iDAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAzFU,mBAAmB;QAH/B,gEAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAG4B,sDAAO,EAAyB,wEAAc,EAA0B,0EAAe;OAFxG,mBAAmB,CA2F/B;IAAD,0BAAC;CAAA;AA3F+B","file":"common.js","sourcesContent":["/**\n * Check to see if the Haptic Plugin is available\n * @return Returns `true` or false if the plugin is available\n */\n/**\n * Trigger a selection changed haptic event. Good for one-time events\n * (not for gestures)\n */\nvar hapticSelection = function () {\n var engine = window.TapticEngine;\n if (engine) {\n engine.selection();\n }\n};\n/**\n * Tell the haptic engine that a gesture for a selection change is starting.\n */\nvar hapticSelectionStart = function () {\n var engine = window.TapticEngine;\n if (engine) {\n engine.gestureSelectionStart();\n }\n};\n/**\n * Tell the haptic engine that a selection changed during a gesture.\n */\nvar hapticSelectionChanged = function () {\n var engine = window.TapticEngine;\n if (engine) {\n engine.gestureSelectionChanged();\n }\n};\n/**\n * Tell the haptic engine we are done with a gesture. This needs to be\n * called lest resources are not properly recycled.\n */\nvar hapticSelectionEnd = function () {\n var engine = window.TapticEngine;\n if (engine) {\n engine.gestureSelectionEnd();\n }\n};\nexport { hapticSelectionStart as a, hapticSelectionChanged as b, hapticSelectionEnd as c, hapticSelection as h };\n","var _this = this;\nimport * as tslib_1 from \"tslib\";\nvar hostContext = function (selector, el) {\n return el.closest(selector) !== null;\n};\n/**\n * Create the mode and color classes for the component based on the classes passed in\n */\nvar createColorClasses = function (color) {\n var _a;\n return (typeof color === 'string' && color.length > 0) ? (_a = {\n 'ion-color': true\n },\n _a[\"ion-color-\" + color] = true,\n _a) : undefined;\n};\nvar getClassList = function (classes) {\n if (classes !== undefined) {\n var array = Array.isArray(classes) ? classes : classes.split(' ');\n return array\n .filter(function (c) { return c != null; })\n .map(function (c) { return c.trim(); })\n .filter(function (c) { return c !== ''; });\n }\n return [];\n};\nvar getClassMap = function (classes) {\n var map = {};\n getClassList(classes).forEach(function (c) { return map[c] = true; });\n return map;\n};\nvar SCHEME = /^[a-z][a-z0-9+\\-.]*:/;\nvar openURL = function (url, ev, direction) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\n var router;\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(url != null && url[0] !== '#' && !SCHEME.test(url))) return [3 /*break*/, 2];\n router = document.querySelector('ion-router');\n if (!router) return [3 /*break*/, 2];\n if (ev != null) {\n ev.preventDefault();\n }\n return [4 /*yield*/, router.componentOnReady()];\n case 1:\n _a.sent();\n return [2 /*return*/, router.push(url, direction)];\n case 2: return [2 /*return*/, false];\n }\n });\n}); };\nexport { createColorClasses as c, getClassMap as g, hostContext as h, openURL as o };\n","var rIC = function (callback) {\n if ('requestIdleCallback' in window) {\n window.requestIdleCallback(callback);\n }\n else {\n setTimeout(callback, 32);\n }\n};\nvar hasShadowDom = function (el) {\n return !!el.shadowRoot && !!el.attachShadow;\n};\nvar findItemLabel = function (componentEl) {\n var itemEl = componentEl.closest('ion-item');\n if (itemEl) {\n return itemEl.querySelector('ion-label');\n }\n return null;\n};\nvar renderHiddenInput = function (always, container, name, value, disabled) {\n if (always || hasShadowDom(container)) {\n var input = container.querySelector('input.aux-input');\n if (!input) {\n input = container.ownerDocument.createElement('input');\n input.type = 'hidden';\n input.classList.add('aux-input');\n container.appendChild(input);\n }\n input.disabled = disabled;\n input.name = name;\n input.value = value || '';\n }\n};\nvar clamp = function (min, n, max) {\n return Math.max(min, Math.min(n, max));\n};\nvar assert = function (actual, reason) {\n if (!actual) {\n var message = 'ASSERT: ' + reason;\n console.error(message);\n debugger; // tslint:disable-line\n throw new Error(message);\n }\n};\nvar now = function (ev) {\n return ev.timeStamp || Date.now();\n};\nvar pointerCoord = function (ev) {\n // get X coordinates for either a mouse click\n // or a touch depending on the given event\n if (ev) {\n var changedTouches = ev.changedTouches;\n if (changedTouches && changedTouches.length > 0) {\n var touch = changedTouches[0];\n return { x: touch.clientX, y: touch.clientY };\n }\n if (ev.pageX !== undefined) {\n return { x: ev.pageX, y: ev.pageY };\n }\n }\n return { x: 0, y: 0 };\n};\n/**\n * @hidden\n * Given a side, return if it should be on the end\n * based on the value of dir\n * @param side the side\n * @param isRTL whether the application dir is rtl\n */\nvar isEndSide = function (side) {\n var isRTL = document.dir === 'rtl';\n switch (side) {\n case 'start': return isRTL;\n case 'end': return !isRTL;\n default:\n throw new Error(\"\\\"\" + side + \"\\\" is not a valid value for [side]. Use \\\"start\\\" or \\\"end\\\" instead.\");\n }\n};\nvar debounceEvent = function (event, wait) {\n var original = event._original || event;\n return {\n _original: event,\n emit: debounce(original.emit.bind(original), wait)\n };\n};\nvar debounce = function (func, wait) {\n if (wait === void 0) { wait = 0; }\n var timer;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n clearTimeout(timer);\n timer = setTimeout.apply(void 0, [func, wait].concat(args));\n };\n};\nexport { rIC as a, assert as b, clamp as c, debounceEvent as d, debounce as e, findItemLabel as f, hasShadowDom as h, isEndSide as i, now as n, pointerCoord as p, renderHiddenInput as r };\n","/**\n * Does a simple sanitization of all elements\n * in an untrusted string\n */\nvar sanitizeDOMString = function (untrustedString) {\n try {\n if (typeof untrustedString !== 'string' || untrustedString === '') {\n return untrustedString;\n }\n /**\n * Create a document fragment\n * separate from the main DOM,\n * create a div to do our work in\n */\n var documentFragment_1 = document.createDocumentFragment();\n var workingDiv = document.createElement('div');\n documentFragment_1.appendChild(workingDiv);\n workingDiv.innerHTML = untrustedString;\n /**\n * Remove any elements\n * that are blocked\n */\n blockedTags.forEach(function (blockedTag) {\n var getElementsToRemove = documentFragment_1.querySelectorAll(blockedTag);\n for (var elementIndex = getElementsToRemove.length - 1; elementIndex >= 0; elementIndex--) {\n var element = getElementsToRemove[elementIndex];\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n else {\n documentFragment_1.removeChild(element);\n }\n /**\n * We still need to sanitize\n * the children of this element\n * as they are left behind\n */\n var childElements = getElementChildren(element);\n /* tslint:disable-next-line */\n for (var childIndex = 0; childIndex < childElements.length; childIndex++) {\n sanitizeElement(childElements[childIndex]);\n }\n }\n });\n /**\n * Go through remaining elements and remove\n * non-allowed attribs\n */\n // IE does not support .children on document fragments, only .childNodes\n var documentFragmentChildren = getElementChildren(documentFragment_1);\n /* tslint:disable-next-line */\n for (var childIndex = 0; childIndex < documentFragmentChildren.length; childIndex++) {\n sanitizeElement(documentFragmentChildren[childIndex]);\n }\n // Append document fragment to div\n var fragmentDiv = document.createElement('div');\n fragmentDiv.appendChild(documentFragment_1);\n // First child is always the div we did our work in\n var getInnerDiv = fragmentDiv.querySelector('div');\n return (getInnerDiv !== null) ? getInnerDiv.innerHTML : fragmentDiv.innerHTML;\n }\n catch (err) {\n console.error(err);\n return '';\n }\n};\n/**\n * Clean up current element based on allowed attributes\n * and then recursively dig down into any child elements to\n * clean those up as well\n */\nvar sanitizeElement = function (element) {\n // IE uses childNodes, so ignore nodes that are not elements\n if (element.nodeType && element.nodeType !== 1) {\n return;\n }\n for (var i = element.attributes.length - 1; i >= 0; i--) {\n var attribute = element.attributes[i];\n var attributeName = attribute.name;\n // remove non-allowed attribs\n if (!allowedAttributes.includes(attributeName.toLowerCase())) {\n element.removeAttribute(attributeName);\n continue;\n }\n // clean up any allowed attribs\n // that attempt to do any JS funny-business\n var attributeValue = attribute.value;\n /* tslint:disable-next-line */\n if (attributeValue != null && attributeValue.toLowerCase().includes('javascript:')) {\n element.removeAttribute(attributeName);\n }\n }\n /**\n * Sanitize any nested children\n */\n var childElements = getElementChildren(element);\n /* tslint:disable-next-line */\n for (var i = 0; i < childElements.length; i++) {\n sanitizeElement(childElements[i]);\n }\n};\n/**\n * IE doesn't always support .children\n * so we revert to .childNodes instead\n */\nvar getElementChildren = function (element) {\n return (element.children != null) ? element.children : element.childNodes;\n};\nvar allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];\nvar blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed'];\nexport { sanitizeDOMString as s };\n","import { Component,Injectable } from '@angular/core';\nimport { Storage } from '@ionic/storage';\nimport { OfferteService } from '../services/offerte.service';\nimport { CategoryService } from '../services/category.service';\nimport { debug } from 'util';\n \nconst STORAGE_KEY = 'notifications';\n\n\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NotificationService {\n\n constructor(public storage: Storage, public offerteService: OfferteService, public categoryService: CategoryService) {\n\n\n }\n\n notificationsList = []\n \n isNotificationActive(categoryId) {\n return this.getAllNotifications().then(result => {\n if(result){\n for(var i = 0; i< result.length; i++){\n if(result[i].id == categoryId)\n return true;\n }\n }\n });\n }\n \n notificationsOn(categoryId) {\n\n if((window).FirebasePlugin)\n (window).FirebasePlugin.subscribe(categoryId);\n else{\n \n this.offerteService.subscription(true, categoryId).subscribe(() =>{\n debugger\n });\n }\n\n return this.getAllNotifications().then(result => {\n\n this.offerteService.getSingleCategory(categoryId).subscribe(async item =>{\n if (!result) {\n result = []\n }\n result.push(item[0]);\n \n this.notificationsList = result;\n\n for(var i = 0; i < this.notificationsList.length; i++){\n this.categoryService.getCategoryImage(this.notificationsList[i]);\n }\n\n return this.storage.set(STORAGE_KEY, result);\n \n })\n\n\n });\n }\n \n notificationsOff(categoryId) {\n\n if((window).FirebasePlugin)\n (window).FirebasePlugin.unsubscribe(categoryId);\n else{\n this.offerteService.subscription(false, categoryId).subscribe(() =>{\n debugger\n });\n }\n\n return this.getAllNotifications().then(result => {\n this.offerteService.getSingleCategory(categoryId).subscribe(async item =>{\n if (result) {\n var index = -1;\n for(var j = 0; j< result.length; j++){\n if(result[j].id == categoryId){\n index = j;\n break;\n }\n }\n result.splice(index, 1);\n\n this.notificationsList = result;\n\n for(var i = 0; i < this.notificationsList.length; i++){\n this.categoryService.getCategoryImage(this.notificationsList[i]);\n }\n\n return this.storage.set(STORAGE_KEY, result);\n }\n });\n });\n }\n \n getAllNotifications() {\n return this.storage.get(STORAGE_KEY);\n }\n\n}\n"],"sourceRoot":""}