PageSourceSearch

https://dashboard-heyandes.web.app/main-es2015.js

js dashboard-heyandes.web.app collected 2026-10-03 12:20:55 UTC 329,332 bytes, 5,803 lines download raw bytes

1(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["main"],{
2
3/***/ "./node_modules/moment/locale sync recursive ^\\.\\/.*$":
4/*!**************************************************!*\
5  !*** ./node_modules/moment/locale sync ^\.\/.*$ ***!
6  \**************************************************/
7/*! no static exports found */
8/***/ (function(module, exports, __webpack_require__) {
9
10var map = {
11	"./af": "./node_modules/moment/locale/af.js",
12	"./af.js": "./node_modules/moment/locale/af.js",
13	"./ar": "./node_modules/moment/locale/ar.js",
14	"./ar-dz": "./node_modules/moment/locale/ar-dz.js",
15	"./ar-dz.js": "./node_modules/moment/locale/ar-dz.js",
16	"./ar-kw": "./node_modules/moment/locale/ar-kw.js",
17	"./ar-kw.js": "./node_modules/moment/locale/ar-kw.js",
18	"./ar-ly": "./node_modules/moment/locale/ar-ly.js",
19	"./ar-ly.js": "./node_modules/moment/locale/ar-ly.js",
20	"./ar-ma": "./node_modules/moment/locale/ar-ma.js",
21	"./ar-ma.js": "./node_modules/moment/locale/ar-ma.js",
22	"./ar-sa": "./node_modules/moment/locale/ar-sa.js",
23	"./ar-sa.js": "./node_modules/moment/locale/ar-sa.js",
24	"./ar-tn": "./node_modules/moment/locale/ar-tn.js",
25	"./ar-tn.js": "./node_modules/moment/locale/ar-tn.js",
26	"./ar.js": "./node_modules/moment/locale/ar.js",
27	"./az": "./node_modules/moment/locale/az.js",
28	"./az.js": "./node_modules/moment/locale/az.js",
29	"./be": "./node_modules/moment/locale/be.js",
30	"./be.js": "./node_modules/moment/locale/be.js",
31	"./bg": "./node_modules/moment/locale/bg.js",
32	"./bg.js": "./node_modules/moment/locale/bg.js",
33	"./bm": "./node_modules/moment/locale/bm.js",
34	"./bm.js": "./node_modules/moment/locale/bm.js",
35	"./bn": "./node_modules/moment/locale/bn.js",
36	"./bn-bd": "./node_modules/moment/locale/bn-bd.js",
37	"./bn-bd.js": "./node_modules/moment/locale/bn-bd.js",
38	"./bn.js": "./node_modules/moment/locale/bn.js",
39	"./bo": "./node_modules/moment/locale/bo.js",
40	"./bo.js": "./node_modules/moment/locale/bo.js",
41	"./br": "./node_modules/moment/locale/br.js",
42	"./br.js": "./node_modules/moment/locale/br.js",
43	"./bs": "./node_modules/moment/locale/bs.js",
44	"./bs.js": "./node_modules/moment/locale/bs.js",
45	"./ca": "./node_modules/moment/locale/ca.js",
46	"./ca.js": "./node_modules/moment/locale/ca.js",
47	"./cs": "./node_modules/moment/locale/cs.js",
48	"./cs.js": "./node_modules/moment/locale/cs.js",
49	"./cv": "./node_modules/moment/locale/cv.js",
50	"./cv.js": "./node_modules/moment/locale/cv.js",
51	"./cy": "./node_modules/moment/locale/cy.js",
52	"./cy.js": "./node_modules/moment/locale/cy.js",
53	"./da": "./node_modules/moment/locale/da.js",
54	"./da.js": "./node_modules/moment/locale/da.js",
55	"./de": "./node_modules/moment/locale/de.js",
56	"./de-at": "./node_modules/moment/locale/de-at.js",
57	"./de-at.js": "./node_modules/moment/locale/de-at.js",
58	"./de-ch": "./node_modules/moment/locale/de-ch.js",
59	"./de-ch.js": "./node_modules/moment/locale/de-ch.js",
60	"./de.js": "./node_modules/moment/locale/de.js",
61	"./dv": "./node_modules/moment/locale/dv.js",
62	"./dv.js": "./node_modules/moment/locale/dv.js",
63	"./el": "./node_modules/moment/locale/el.js",
64	"./el.js": "./node_modules/moment/locale/el.js",
65	"./en-au": "./node_modules/moment/locale/en-au.js",
66	"./en-au.js": "./node_modules/moment/locale/en-au.js",
67	"./en-ca": "./node_modules/moment/locale/en-ca.js",
68	"./en-ca.js": "./node_modules/moment/locale/en-ca.js",
69	"./en-gb": "./node_modules/moment/locale/en-gb.js",
70	"./en-gb.js": "./node_modules/moment/locale/en-gb.js",
71	"./en-ie": "./node_modules/moment/locale/en-ie.js",
72	"./en-ie.js": "./node_modules/moment/locale/en-ie.js",
73	"./en-il": "./node_modules/moment/locale/en-il.js",
74	"./en-il.js": "./node_modules/moment/locale/en-il.js",
75	"./en-in": "./node_modules/moment/locale/en-in.js",
76	"./en-in.js": "./node_modules/moment/locale/en-in.js",
77	"./en-nz": "./node_modules/moment/locale/en-nz.js",
78	"./en-nz.js": "./node_modules/moment/locale/en-nz.js",
79	"./en-sg": "./node_modules/moment/locale/en-sg.js",
80	"./en-sg.js": "./node_modules/moment/locale/en-sg.js",
81	"./eo": "./node_modules/moment/locale/eo.js",
82	"./eo.js": "./node_modules/moment/locale/eo.js",
83	"./es": "./node_modules/moment/locale/es.js",
84	"./es-do": "./node_modules/moment/locale/es-do.js",
85	"./es-do.js": "./node_modules/moment/locale/es-do.js",
86	"./es-mx": "./node_modules/moment/locale/es-mx.js",
87	"./es-mx.js": "./node_modules/moment/locale/es-mx.js",
88	"./es-us": "./node_modules/moment/locale/es-us.js",
89	"./es-us.js": "./node_modules/moment/locale/es-us.js",
90	"./es.js": "./node_modules/moment/locale/es.js",
91	"./et": "./node_modules/moment/locale/et.js",
92	"./et.js": "./node_modules/moment/locale/et.js",
93	"./eu": "./node_modules/moment/locale/eu.js",
94	"./eu.js": "./node_modules/moment/locale/eu.js",
95	"./fa": "./node_modules/moment/locale/fa.js",
96	"./fa.js": "./node_modules/moment/locale/fa.js",
97	"./fi": "./node_modules/moment/locale/fi.js",
98	"./fi.js": "./node_modules/moment/locale/fi.js",
99	"./fil": "./node_modules/moment/locale/fil.js",
100	"./fil.js": "./node_modules/moment/locale/fil.js",
101	"./fo": "./node_modules/moment/locale/fo.js",
102	"./fo.js": "./node_modules/moment/locale/fo.js",
103	"./fr": "./node_modules/moment/locale/fr.js",
104	"./fr-ca": "./node_modules/moment/locale/fr-ca.js",
105	"./fr-ca.js": "./node_modules/moment/locale/fr-ca.js",
106	"./fr-ch": "./node_modules/moment/locale/fr-ch.js",
107	"./fr-ch.js": "./node_modules/moment/locale/fr-ch.js",
108	"./fr.js": "./node_modules/moment/locale/fr.js",
109	"./fy": "./node_modules/moment/locale/fy.js",
110	"./fy.js": "./node_modules/moment/locale/fy.js",
111	"./ga": "./node_modules/moment/locale/ga.js",
112	"./ga.js": "./node_modules/moment/locale/ga.js",
113	"./gd": "./node_modules/moment/locale/gd.js",
114	"./gd.js": "./node_modules/moment/locale/gd.js",
115	"./gl": "./node_modules/moment/locale/gl.js",
116	"./gl.js": "./node_modules/moment/locale/gl.js",
117	"./gom-deva": "./node_modules/moment/locale/gom-deva.js",
118	"./gom-deva.js": "./node_modules/moment/locale/gom-deva.js",
119	"./gom-latn": "./node_modules/moment/locale/gom-latn.js",
120	"./gom-latn.js": "./node_modules/moment/locale/gom-latn.js",
121	"./gu": "./node_modules/moment/locale/gu.js",
122	"./gu.js": "./node_modules/moment/locale/gu.js",
123	"./he": "./node_modules/moment/locale/he.js",
124	"./he.js": "./node_modules/moment/locale/he.js",
125	"./hi": "./node_modules/moment/locale/hi.js",
126	"./hi.js": "./node_modules/moment/locale/hi.js",
127	"./hr": "./node_modules/moment/locale/hr.js",
128	"./hr.js": "./node_modules/moment/locale/hr.js",
129	"./hu": "./node_modules/moment/locale/hu.js",
130	"./hu.js": "./node_modules/moment/locale/hu.js",
131	"./hy-am": "./node_modules/moment/locale/hy-am.js",
132	"./hy-am.js": "./node_modules/moment/locale/hy-am.js",
133	"./id": "./node_modules/moment/locale/id.js",
134	"./id.js": "./node_modules/moment/locale/id.js",
135	"./is": "./node_modules/moment/locale/is.js",
136	"./is.js": "./node_modules/moment/locale/is.js",
137	"./it": "./node_modules/moment/locale/it.js",
138	"./it-ch": "./node_modules/moment/locale/it-ch.js",
139	"./it-ch.js": "./node_modules/moment/locale/it-ch.js",
140	"./it.js": "./node_modules/moment/locale/it.js",
141	"./ja": "./node_modules/moment/locale/ja.js",
142	"./ja.js": "./node_modules/moment/locale/ja.js",
143	"./jv": "./node_modules/moment/locale/jv.js",
144	"./jv.js": "./node_modules/moment/locale/jv.js",
145	"./ka": "./node_modules/moment/locale/ka.js",
146	"./ka.js": "./node_modules/moment/locale/ka.js",
147	"./kk": "./node_modules/moment/locale/kk.js",
148	"./kk.js": "./node_modules/moment/locale/kk.js",
149	"./km": "./node_modules/moment/locale/km.js",
150	"./km.js": "./node_modules/moment/locale/km.js",
151	"./kn": "./node_modules/moment/locale/kn.js",
152	"./kn.js": "./node_modules/moment/locale/kn.js",
153	"./ko": "./node_modules/moment/locale/ko.js",
154	"./ko.js": "./node_modules/moment/locale/ko.js",
155	"./ku": "./node_modules/moment/locale/ku.js",
156	"./ku.js": "./node_modules/moment/locale/ku.js",
157	"./ky": "./node_modules/moment/locale/ky.js",
158	"./ky.js": "./node_modules/moment/locale/ky.js",
159	"./lb": "./node_modules/moment/locale/lb.js",
160	"./lb.js": "./node_modules/moment/locale/lb.js",
161	"./lo": "./node_modules/moment/locale/lo.js",
162	"./lo.js": "./node_modules/moment/locale/lo.js",
163	"./lt": "./node_modules/moment/locale/lt.js",
164	"./lt.js": "./node_modules/moment/locale/lt.js",
165	"./lv": "./node_modules/moment/locale/lv.js",
166	"./lv.js": "./node_modules/moment/locale/lv.js",
167	"./me": "./node_modules/moment/locale/me.js",
168	"./me.js": "./node_modules/moment/locale/me.js",
169	"./mi": "./node_modules/moment/locale/mi.js",
170	"./mi.js": "./node_modules/moment/locale/mi.js",
171	"./mk": "./node_modules/moment/locale/mk.js",
172	"./mk.js": "./node_modules/moment/locale/mk.js",
173	"./ml": "./node_modules/moment/locale/ml.js",
174	"./ml.js": "./node_modules/moment/locale/ml.js",
175	"./mn": "./node_modules/moment/locale/mn.js",
176	"./mn.js": "./node_modules/moment/locale/mn.js",
177	"./mr": "./node_modules/moment/locale/mr.js",
178	"./mr.js": "./node_modules/moment/locale/mr.js",
179	"./ms": "./node_modules/moment/locale/ms.js",
180	"./ms-my": "./node_modules/moment/locale/ms-my.js",
181	"./ms-my.js": "./node_modules/moment/locale/ms-my.js",
182	"./ms.js": "./node_modules/moment/locale/ms.js",
183	"./mt": "./node_modules/moment/locale/mt.js",
184	"./mt.js": "./node_modules/moment/locale/mt.js",
185	"./my": "./node_modules/moment/locale/my.js",
186	"./my.js": "./node_modules/moment/locale/my.js",
187	"./nb": "./node_modules/moment/locale/nb.js",
188	"./nb.js": "./node_modules/moment/locale/nb.js",
189	"./ne": "./node_modules/moment/locale/ne.js",
190	"./ne.js": "./node_modules/moment/locale/ne.js",
191	"./nl": "./node_modules/moment/locale/nl.js",
192	"./nl-be": "./node_modules/moment/locale/nl-be.js",
193	"./nl-be.js": "./node_modules/moment/locale/nl-be.js",
194	"./nl.js": "./node_modules/moment/locale/nl.js",
195	"./nn": "./node_modules/moment/locale/nn.js",
196	"./nn.js": "./node_modules/moment/locale/nn.js",
197	"./oc-lnc": "./node_modules/moment/locale/oc-lnc.js",
198	"./oc-lnc.js": "./node_modules/moment/locale/oc-lnc.js",
199	"./pa-in": "./node_modules/moment/locale/pa-in.js",
200	"./pa-in.js": "./node_modules/moment/locale/pa-in.js",
201	"./pl": "./node_modules/moment/locale/pl.js",
202	"./pl.js": "./node_modules/moment/locale/pl.js",
203	"./pt": "./node_modules/moment/locale/pt.js",
204	"./pt-br": "./node_modules/moment/locale/pt-br.js",
205	"./pt-br.js": "./node_modules/moment/locale/pt-br.js",
206	"./pt.js": "./node_modules/moment/locale/pt.js",
207	"./ro": "./node_modules/moment/locale/ro.js",
208	"./ro.js": "./node_modules/moment/locale/ro.js",
209	"./ru": "./node_modules/moment/locale/ru.js",
210	"./ru.js": "./node_modules/moment/locale/ru.js",
211	"./sd": "./node_modules/moment/locale/sd.js",
212	"./sd.js": "./node_modules/moment/locale/sd.js",
213	"./se": "./node_modules/moment/locale/se.js",
214	"./se.js": "./node_modules/moment/locale/se.js",
215	"./si": "./node_modules/moment/locale/si.js",
216	"./si.js": "./node_modules/moment/locale/si.js",
217	"./sk": "./node_modules/moment/locale/sk.js",
218	"./sk.js": "./node_modules/moment/locale/sk.js",
219	"./sl": "./node_modules/moment/locale/sl.js",
220	"./sl.js": "./node_modules/moment/locale/sl.js",
221	"./sq": "./node_modules/moment/locale/sq.js",
222	"./sq.js": "./node_modules/moment/locale/sq.js",
223	"./sr": "./node_modules/moment/locale/sr.js",
224	"./sr-cyrl": "./node_modules/moment/locale/sr-cyrl.js",
225	"./sr-cyrl.js": "./node_modules/moment/locale/sr-cyrl.js",
226	"./sr.js": "./node_modules/moment/locale/sr.js",
227	"./ss": "./node_modules/moment/locale/ss.js",
228	"./ss.js": "./node_modules/moment/locale/ss.js",
229	"./sv": "./node_modules/moment/locale/sv.js",
230	"./sv.js": "./node_modules/moment/locale/sv.js",
231	"./sw": "./node_modules/moment/locale/sw.js",
232	"./sw.js": "./node_modules/moment/locale/sw.js",
233	"./ta": "./node_modules/moment/locale/ta.js",
234	"./ta.js": "./node_modules/moment/locale/ta.js",
235	"./te": "./node_modules/moment/locale/te.js",
236	"./te.js": "./node_modules/moment/locale/te.js",
237	"./tet": "./node_modules/moment/locale/tet.js",
238	"./tet.js": "./node_modules/moment/locale/tet.js",
239	"./tg": "./node_modules/moment/locale/tg.js",
240	"./tg.js": "./node_modules/moment/locale/tg.js",
241	"./th": "./node_modules/moment/locale/th.js",
242	"./th.js": "./node_modules/moment/locale/th.js",
243	"./tk": "./node_modules/moment/locale/tk.js",
244	"./tk.js": "./node_modules/moment/locale/tk.js",
245	"./tl-ph": "./node_modules/moment/locale/tl-ph.js",
246	"./tl-ph.js": "./node_modules/moment/locale/tl-ph.js",
247	"./tlh": "./node_modules/moment/locale/tlh.js",
248	"./tlh.js": "./node_modules/moment/locale/tlh.js",
249	"./tr": "./node_modules/moment/locale/tr.js",
250	"./tr.js": "./node_modules/moment/locale/tr.js",
251	"./tzl": "./node_modules/moment/locale/tzl.js",
252	"./tzl.js": "./node_modules/moment/locale/tzl.js",
253	"./tzm": "./node_modules/moment/locale/tzm.js",
254	"./tzm-latn": "./node_modules/moment/locale/tzm-latn.js",
255	"./tzm-latn.js": "./node_modules/moment/locale/tzm-latn.js",
256	"./tzm.js": "./node_modules/moment/locale/tzm.js",
257	"./ug-cn": "./node_modules/moment/locale/ug-cn.js",
258	"./ug-cn.js": "./node_modules/moment/locale/ug-cn.js",
259	"./uk": "./node_modules/moment/locale/uk.js",
260	"./uk.js": "./node_modules/moment/locale/uk.js",
261	"./ur": "./node_modules/moment/locale/ur.js",
262	"./ur.js": "./node_modules/moment/locale/ur.js",
263	"./uz": "./node_modules/moment/locale/uz.js",
264	"./uz-latn": "./node_modules/moment/locale/uz-latn.js",
265	"./uz-latn.js": "./node_modules/moment/locale/uz-latn.js",
266	"./uz.js": "./node_modules/moment/locale/uz.js",
267	"./vi": "./node_modules/moment/locale/vi.js",
268	"./vi.js": "./node_modules/moment/locale/vi.js",
269	"./x-pseudo": "./node_modules/moment/locale/x-pseudo.js",
270	"./x-pseudo.js": "./node_modules/moment/locale/x-pseudo.js",
271	"./yo": "./node_modules/moment/locale/yo.js",
272	"./yo.js": "./node_modules/moment/locale/yo.js",
273	"./zh-cn": "./node_modules/moment/locale/zh-cn.js",
274	"./zh-cn.js": "./node_modules/moment/locale/zh-cn.js",
275	"./zh-hk": "./node_modules/moment/locale/zh-hk.js",
276	"./zh-hk.js": "./node_modules/moment/locale/zh-hk.js",
277	"./zh-mo": "./node_modules/moment/locale/zh-mo.js",
278	"./zh-mo.js": "./node_modules/moment/locale/zh-mo.js",
279	"./zh-tw": "./node_modules/moment/locale/zh-tw.js",
280	"./zh-tw.js": "./node_modules/moment/locale/zh-tw.js"
281};
282
283
284function webpackContext(req) {
285	var id = webpackContextResolve(req);
286	return __webpack_require__(id);
287}
288function webpackContextResolve(req) {
289	if(!__webpack_require__.o(map, req)) {
290		var e = new Error("Cannot find module '" + req + "'");
291		e.code = 'MODULE_NOT_FOUND';
292		throw e;
293	}
294	return map[req];
295}
296webpackContext.keys = function webpackContextKeys() {
297	return Object.keys(map);
298};
299webpackContext.resolve = webpackContextResolve;
300module.exports = webpackContext;
301webpackContext.id = "./node_modules/moment/locale sync recursive ^\\.\\/.*$";
302
303/***/ }),
304
305/***/ "./src/$$_lazy_route_resource lazy recursive":
306/*!**********************************************************!*\
307  !*** ./src/$$_lazy_route_resource lazy namespace object ***!
308  \**********************************************************/
309/*! no static exports found */
310/***/ (function(module, exports) {
311
312function webpackEmptyAsyncContext(req) {
313	// Here Promise.resolve().then() is used instead of new Promise() to prevent
314	// uncaught exception popping up in devtools
315	return Promise.resolve().then(function() {
316		var e = new Error("Cannot find module '" + req + "'");
317		e.code = 'MODULE_NOT_FOUND';
318		throw e;
319	});
320}
321webpackEmptyAsyncContext.keys = function() { return []; };
322webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
323module.exports = webpackEmptyAsyncContext;
324webpackEmptyAsyncContext.id = "./src/$$_lazy_route_resource lazy recursive";
325
326/***/ }),
327
328/***/ "./src/app/app-routing.module.ts":
329/*!***************************************!*\
330  !*** ./src/app/app-routing.module.ts ***!
331  \***************************************/
332/*! exports provided: Approutes, RouterOptions */
333/***/ (function(module, __webpack_exports__, __webpack_require__) {
334
335"use strict";
336__webpack_require__.r(__webpack_exports__);
337/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Approutes", function() { return Approutes; });
338/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterOptions", function() { return RouterOptions; });
339/* harmony import */ var _layouts_full_full_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./layouts/full/full.component */ "./src/app/layouts/full/full.component.ts");
340
341const Approutes = [
342    {
343        path: 'auth',
344        loadChildren: () => __webpack_require__.e(/*! import() | auth-auth-module */ "auth-auth-module").then(__webpack_require__.bind(null, /*! ./auth/auth.module */ "./src/app/auth/auth.module.ts")).then((m) => m.AuthModule)
345    },
346    {
347        path: '',
348        component: _layouts_full_full_component__WEBPACK_IMPORTED_MODULE_0__["FullComponent"],
349        children: [
350            { path: '', redirectTo: '/auth/login', pathMatch: 'full' },
351            {
352                path: 'marketplace',
353                loadChildren: () => Promise.all(/*! import() | agencies-agencies-module */[__webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~429621f0"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~a3efaafc"), __webpack_require__.e("default~agencies-agencies-module~channel-manager-channel-manager-module~experiences-experiences-modu~43393285"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~resources-resources-module"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~settings-settings-module"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module"), __webpack_require__.e("default~agencies-agencies-module~sales-sales-module"), __webpack_require__.e("common"), __webpack_require__.e("agencies-agencies-module")]).then(__webpack_require__.bind(null, /*! ./agencies/agencies.module */ "./src/app/agencies/agencies.module.ts")).then((m) => m.AgenciesModule)
354            },
355            {
356                path: 'agencies',
357                loadChildren: () => Promise.all(/*! import() | agencies-agencies-module */[__webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~429621f0"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~a3efaafc"), __webpack_require__.e("default~agencies-agencies-module~channel-manager-channel-manager-module~experiences-experiences-modu~43393285"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~resources-resources-module"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~settings-settings-module"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module"), __webpack_require__.e("default~agencies-agencies-module~sales-sales-module"), __webpack_require__.e("common"), __webpack_require__.e("agencies-agencies-module")]).then(__webpack_require__.bind(null, /*! ./agencies/agencies.module */ "./src/app/agencies/agencies.module.ts")).then((m) => m.AgenciesModule)
358            },
359            {
360                path: 'experiences',
361                loadChildren: () => Promise.all(/*! import() | experiences-experiences-module */[__webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~429621f0"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~a3efaafc"), __webpack_require__.e("default~agencies-agencies-module~channel-manager-channel-manager-module~experiences-experiences-modu~43393285"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~resources-resources-module"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~settings-settings-module"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module")]).then(__webpack_require__.bind(null, /*! ./experiences/experiences.module */ "./src/app/experiences/experiences.module.ts")).then((m) => m.ExperiencesModule)
362            },
363            {
364                path: 'agents',
365                loadChildren: () => Promise.all(/*! import() | agents-agents-module */[__webpack_require__.e("common"), __webpack_require__.e("agents-agents-module")]).then(__webpack_require__.bind(null, /*! ./agents/agents.module */ "./src/app/agents/agents.module.ts")).then((m) => m.AgentsModule)
366            },
367            {
368                path: 'settings',
369                loadChildren: () => Promise.all(/*! import() | settings-settings-module */[__webpack_require__.e("default~agencies-agencies-module~channel-manager-channel-manager-module~experiences-experiences-modu~43393285"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~settings-settings-module"), __webpack_require__.e("common"), __webpack_require__.e("settings-settings-module")]).then(__webpack_require__.bind(null, /*! ./settings/sett
369ings.module */ "./src/app/settings/settings.module.ts")).then((m) => m.SettingsModule)
370            },
371            {
372                path: 'collections',
373                loadChildren: () => __webpack_require__.e(/*! import() | collections-collections-module */ "collections-collections-module").then(__webpack_require__.bind(null, /*! ./collections/collections.module */ "./src/app/collections/collections.module.ts")).then((m) => m.CollectionsModule)
374            },
375            {
376                path: 'component',
377                loadChildren: () => __webpack_require__.e(/*! import() | component-component-module */ "component-component-module").then(__webpack_require__.bind(null, /*! ./component/component.module */ "./src/app/component/component.module.ts")).then((m) => m.ComponentsModule)
378            },
379            {
380                path: 'pos',
381                loadChildren: () => Promise.all(/*! import() | pos-pos-module */[__webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~429621f0"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~a3efaafc"), __webpack_require__.e("pos-pos-module")]).then(__webpack_require__.bind(null, /*! ./pos/pos.module */ "./src/app/pos/pos.module.ts")).then((m) => m.PosModule)
382            },
383            {
384                path: 'resources',
385                loadChildren: () => Promise.all(/*! import() | resources-resources-module */[__webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~429621f0"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~resources-resources-module"), __webpack_require__.e("resources-resources-module")]).then(__webpack_require__.bind(null, /*! ./resources/resources.module */ "./src/app/resources/resources.module.ts")).then((m) => m.ResourcesModule)
386            },
387            {
388                path: 'marketing',
389                loadChildren: () => Promise.all(/*! import() | marketing-marketing-module */[__webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~429621f0"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~a3efaafc"), __webpack_require__.e("marketing-marketing-module")]).then(__webpack_require__.bind(null, /*! ./marketing/marketing.module */ "./src/app/marketing/marketing.module.ts")).then((m) => m.MarketingModule)
390            },
391            {
392                path: 'contacts',
393                loadChildren: () => __webpack_require__.e(/*! import() | contacts-contacts-module */ "contacts-contacts-module").then(__webpack_require__.bind(null, /*! ./contacts/contacts.module */ "./src/app/contacts/contacts.module.ts")).then((m) => m.ContactsModule)
394            },
395            {
396                path: 'finance',
397                loadChildren: () => Promise.resolve(/*! import() */).then(__webpack_require__.bind(null, /*! ./finance/finance.module */ "./src/app/finance/finance.module.ts")).then((m) => m.FinanceModule)
398            },
399            {
400                path: 'sales',
401                loadChildren: () => Promise.all(/*! import() | sales-sales-module */[__webpack_require__.e("default~agencies-agencies-module~sales-sales-module"), __webpack_require__.e("sales-sales-module")]).then(__webpack_require__.bind(null, /*! ./sales/sales.module */ "./src/app/sales/sales.module.ts")).then((m) => m.SalesModule)
402            },
403            {
404                path: 'statistics',
405                loadChildren: () => Promise.all(/*! import() | statistics-statistics-module */[__webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~429621f0"), __webpack_require__.e("default~agencies-agencies-module~experiences-experiences-module~marketing-marketing-module~pos-pos-m~a3efaafc"), __webpack_require__.e("statistics-statistics-module")]).then(__webpack_require__.bind(null, /*! ./statistics/statistics.module */ "./src/app/statistics/statistics.module.ts")).then((m) => m.StatisticModule)
406            },
407            {
408                path: 'channelManager',
409                loadChildren: () => Promise.all(/*! import() | channel-manager-channel-manager-module */[__webpack_require__.e("default~agencies-agencies-module~channel-manager-channel-manager-module~experiences-experiences-modu~43393285"), __webpack_require__.e("channel-manager-channel-manager-module")]).then(__webpack_require__.bind(null, /*! ./channel-manager/channel-manager.module */ "./src/app/channel-manager/channel-manager.module.ts")).then((m) => m.ChannelManagerModule)
410            },
411        ]
412    },
413    {
414        path: '**',
415        redirectTo: 'auth'
416    }
417];
418const RouterOptions = {
419    useHash: false,
420    scrollPositionRestoration: 'enabled',
421    anchorScrolling: 'enabled'
422};
423
424
425/***/ }),
426
427/***/ "./src/app/app.component.ts":
428/*!**********************************!*\
429  !*** ./src/app/app.component.ts ***!
430  \**********************************/
431/*! exports provided: AppComponent */
432/***/ (function(module, __webpack_exports__, __webpack_require__) {
433
434"use strict";
435__webpack_require__.r(__webpack_exports__);
436/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppComponent", function() { return AppComponent; });
437/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
438/* harmony import */ var src_app_shared_services_email_notifications_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! src/app/shared/services/email-notifications.service */ "./src/app/shared/services/email-notifications.service.ts");
439/* harmony import */ var _shared_services_auth_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/services/auth.service */ "./src/app/shared/services/auth.service.ts");
440/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
441/* harmony import */ var _shared_spinner_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./shared/spinner.component */ "./src/app/shared/spinner.component.ts");
442
443
444
445
446
447
448
449
450class AppComponent {
451    constructor(emailNotificationsService, authApi) {
452        this.emailNotificationsService = emailNotificationsService;
453        this.authApi = authApi;
454        this.title = 'app';
455    }
456    ngOnInit() {
457        // Call the method from the service
458        this.emailNotificationsService.checkUnreadMessages();
459        // Polling every 1 minute
460        // const interval1 = setInterval(() => {
461        //   this.emailNotificationsService.checkUnreadMessages();
462        // }, 1000); // 1 second in milliseconds
463        //Polling every 5 minutes
464        const interval2 = setInterval(() => {
465            this.emailNotificationsService.checkUnreadMessages();
466        }, 5 * 60 * 1000); // 5 minutes in milliseconds
467    }
468    ngOnDestroy() {
469        clearInterval(this.interval1);
470        clearInterval(this.interval2);
471    }
472}
473AppComponent.ɵfac = function AppComponent_Factory(t) { return new (t || AppComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](src_app_shared_services_email_notifications_service__WEBPACK_IMPORTED_MODULE_1__["EmailNotificationService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"])); };
474AppComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: AppComponent, selectors: [["app-root"]], decls: 2, vars: 0, template: function AppComponent_Template(rf, ctx) { if (rf & 1) {
475        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "router-outlet");
476        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "app-spinner");
477        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
478    } }, directives: [_angular_router__WEBPACK_IMPORTED_MODULE_3__["RouterOutlet"], _shared_spinner_component__WEBPACK_IMPORTED_MODULE_4__["SpinnerComponent"]], styles: ["\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2FwcC5jb21wb25lbnQuY3NzIn0= */"] });
479/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AppComponent, [{
480        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
481        args: [{
482                selector: 'app-root',
483                templateUrl: './app.component.html',
484                styleUrls: ['./app.component.css']
485            }]
486    }], function () { return [{ type: src_app_shared_services_email_notifications_service__WEBPACK_IMPORTED_MODULE_1__["EmailNotificationService"] }, { type: _shared_services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"] }]; }, null); })();
487
488
489/***/ }),
490
491/***/ "./src/app/app.module.ts":
492/*!*******************************!*\
493  !*** ./src/app/app.module.ts ***!
494  \*******************************/
495/*! exports provided: AppModule */
496/***/ (function(module, __webpack_exports__, __webpack_require__) {
497
498"use strict";
499__webpack_require__.r(__webpack_exports__);
500/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppModule", function() { return AppModule; });
501/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/platform-browser.js");
502/* harmony import */ var _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/platform-browser/animations */ "./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/animations.js");
503/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
504/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
505/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
506/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js");
507/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
508/* harmony import */ var _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ng-bootstrap/ng-bootstrap */ "./node_modules/@ng-bootstrap/ng-bootstrap/__ivy_ngcc__/fesm2015/ng-bootstrap.js");
509/* harmony import */ var _layouts_full_full_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./layouts/full/full.component */ "./src/app/layouts/full/full.component.ts");
510/* harmony import */ var _shared_header_navigation_navigation_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./shared/header-navigation/navigation.component */ "./src/app/shared/header-navigation/navigation.component.ts");
511/* harmony import */ var _shared_sidebar_sidebar_component__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./shared/sidebar/sidebar.component */ "./src/app/shared/sidebar/sidebar.component.ts");
512/* harmony import */ var _shared_breadcrumb_breadcrumb_component__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./shared/breadcrumb/breadcrumb.component */ "./src/app/shared/breadcrumb/breadcrumb.component.ts");
513/* harmony import */ var _app_routing_module__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./app-routing.module */ "./src/app/app-routing.module.ts");
514/* harmony import */ var _app_component__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./app.component */ "./src/app/app.component.ts");
515/* harmony import */ var _shared_spinner_component__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./shared/spinner.component */ "./src/app/shared/spinner.component.ts");
516/* harmony import */ var _angular_fire__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/fire */ "./node_modules/@angular/fire/__ivy_ngcc__/es2015/index.js");
517/* harmony import */ var _angular_fire_auth__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @angular/fire/auth */ "./node_modules/@angular/fire/__ivy_ngcc__/auth/es2015/index.js");
518/* harmony import */ var _angular_fire_storage__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @angular/fire/storage */ "./node_modules/@angular/fire/__ivy_ngcc__/storage/es2015/index.js");
519/* harmony import */ var src_environments_environment__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! src/environments/environment */ "./src/environments/environment.ts");
520/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
521/* harmony import */ var ngx_toastr__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ngx-toastr */ "./node_modules/ngx-toastr/__ivy_ngcc__/fesm2015/ngx-toastr.js");
522/* harmony import */ var _shared_guards_auth_guard__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./shared/guards/auth.guard */ "./src/app/shared/guards/auth.guard.ts");
523/* harmony import */ var _shared_guards_agent_secondary_guard__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./shared/guards/agent-secondary.guard */ "./src/app/shared/guards/agent-secondary.guard.ts");
524/* harmony import */ var _shared_guards_admin_guard__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./shared/guards/admin.guard */ "./src/app/shared/guards/admin.guard.ts");
525/* harmony import */ var _shared_services_excel_service__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./shared/services/excel.service */ "./src/app/shared/services/excel.service.ts");
526/* harmony import */ var _shared_services_import_service__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./shared/services/import.service */ "./src/app/shared/services/import.service.ts");
527/* harmony import */ var _finance_finance_module__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./finance/finance.module */ "./src/app/finance/finance.module.ts");
528/* harmony import */ var _shared_upload_file_upload_file_component__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./shared/upload-file/upload-file.component */ "./src/app/shared/upload-file/upload-file.component.ts");
529/* harmony import */ var ngx_image_compress__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ngx-image-compress */ "./node_modules/ngx-image-compress/__ivy_ngcc__/fesm2015/ngx-image-compress.js");
530/* harmony import */ var _shared_services_email_notifications_service__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./shared/services/email-notifications.service */ "./src/app/shared/services/email-notifications.service.ts");
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567class AppModule {
568}
569AppModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineNgModule"]({ type: AppModule, bootstrap: [_app_component__WEBPACK_IMPORTED_MODULE_13__["AppComponent"]] });
570AppModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjector"]({ factory: function AppModule_Factory(t) { return new (t || AppModule)(); }, providers: [
571        { provide: _angular_common__WEBPACK_IMPORTED_MODULE_2__["LocationStrategy"], useClass: _angular_common__WEBPACK_IMPORTED_MODULE_2__["HashLocationStrategy"] },
572        _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_19__["AngularFirestore"],
573        _shared_guards_auth_guard__WEBPACK_IMPORTED_MODULE_21__["AuthGuard"],
574        _shared_guards_admin_guard__WEBPACK_IMPORTED_MODULE_23__["AdminGuard"],
575        _shared_guards_agent_secondary_guard__WEBPACK_IMPORTED_MODULE_22__["AgentSecondaryGuard"],
576        _shared_services_excel_service__WEBPACK_IMPORTED_MODULE_24__["ExcelService"],
577        _shared_services_import_service__WEBPACK_IMPORTED_MODULE_25__["ImportService"],
578        ngx_image_compress__WEBPACK_IMPORTED_MODULE_28__["NgxImageCompressService"],
579        _shared_services_email_notifications_service__WEBPACK_IMPORTED_MODULE_29__["EmailNotificationService"],
580        _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormBuilder"]
581    ], imports: [[
582            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
583            _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__["BrowserModule"],
584            _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_1__["BrowserAnimationsModule"],
585            _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"],
586            _angular_common_http__WEBPACK_IMPORTED_MODULE_5__["HttpClientModule"],
587            _angular_common_http__WEBPACK_IMPORTED_MODULE_5__["HttpClientXsrfModule"].withOptions({
588                cookieName: 'My-XSRF-TOKEN',
589                headerName: 'X-XSRF-TOKEN'
590            }),
591            _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_7__["NgbModule"],
592            _angular_fire__WEBPACK_IMPORTED_MODULE_15__["AngularFireModule"].initializeApp(src_environments_environment__WEBPACK_IMPORTED_MODULE_18__["environment"].firebase),
593            _angular_fire_storage__WEBPACK_IMPORTED_MODULE_17__["AngularFireStorageModule"],
594            _angular_fire_auth__WEBPACK_IMPORTED_MODULE_16__["AngularFireAuthModule"],
595            _angular_router__WEBPACK_IMPORTED_MODULE_6__["RouterModule"].forRoot(_app_routing_module__WEBPACK_IMPORTED_MODULE_12__["Approutes"], _app_routing_module__WEBPACK_IMPORTED_MODULE_12__["RouterOptions"]),
596            ngx_toastr__WEBPACK_IMPORTED_MODULE_20__["ToastrModule"].forRoot(),
597            _finance_finance_module__WEBPACK_IMPORTED_MODULE_26__["FinanceModule"],
598        ]] });
599(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵsetNgModuleScope"](AppModule, { declarations: [_app_component__WEBPACK_IMPORTED_MODULE_13__["AppComponent"],
600        _shared_spinner_component__WEBPACK_IMPORTED_MODULE_14__["SpinnerComponent"],
601        _layouts_full_full_component__WEBPACK_IMPORTED_MODULE_8__["FullComponent"],
602        _shared_header_navigation_navigation_component__WEBPACK_IMPORTED_MODULE_9__["NavigationComponent"],
603        _shared_breadcrumb_breadcrumb_component__WEBPACK_IMPORTED_MODULE_11__["BreadcrumbComponent"],
604        _shared_sidebar_sidebar_component__WEBPACK_IMPORTED_MODULE_10__["SidebarComponent"],
605        _shared_upload_file_upload_file_component__WEBPACK_IMPORTED_MODULE_27__["UploadFileComponent"]], imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
606        _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__["BrowserModule"],
607        _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_1__["BrowserAnimationsModule"],
608        _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"],
609        _angular_common_http__WEBPACK_IMPORTED_MODULE_5__["HttpClientModule"], _angular_common_http__WEBPACK_IMPORTED_MODULE_5__["HttpClientXsrfModule"], _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_7__["NgbModule"], _angular_fire__WEBPACK_IMPORTED_MODULE_15__["AngularFireModule"], _angular_fire_storage__WEBPACK_IMPORTED_MODULE_17__["AngularFireStorageModule"],
610        _angular_fire_auth__WEBPACK_IMPORTED_MODULE_16__["AngularFireAuthModule"], _angular_router__WEBPACK_IMPORTED_MODULE_6__["RouterModule"], ngx_toastr__WEBPACK_IMPORTED_MODULE_20__["ToastrModule"], _finance_finance_module__WEBPACK_IMPORTED_MODULE_26__["FinanceModule"]], exports: [_shared_upload_file_upload_file_component__WEBPACK_IMPORTED_MODULE_27__["UploadFileComponent"]] }); })();
611/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵsetClassMetadata"](AppModule, [{
612        type: _angular_core__WEBPACK_IMPORTED_MODULE_3__["NgModule"],
613        args: [{
614                declarations: [
615                    _app_component__WEBPACK_IMPORTED_MODULE_13__["AppComponent"],
616                    _shared_spinner_component__WEBPACK_IMPORTED_MODULE_14__["SpinnerComponent"],
617                    _layouts_full_full_component__WEBPACK_IMPORTED_MODULE_8__["FullComponent"],
618                    _shared_header_navigation_navigation_component__WEBPACK_IMPORTED_MODULE_9__["NavigationComponent"],
619                    _shared_breadcrumb_breadcrumb_component__WEBPACK_IMPORTED_MODULE_11__["BreadcrumbComponent"],
620                    _shared_sidebar_sidebar_component__WEBPACK_IMPORTED_MODULE_10__["SidebarComponent"],
621                    _shared_upload_file_upload_file_component__WEBPACK_IMPORTED_MODULE_27__["UploadFileComponent"],
622                ],
623                imports: [
624                    _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
625                    _angular_platform_browser__WEBPACK_IMPORTED_MODULE_0__["BrowserModule"],
626                    _angular_platform_browser_animations__WEBPACK_IMPORTED_MODULE_1__["BrowserAnimationsModule"],
627                    _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"],
628                    _angular_common_http__WEBPACK_IMPORTED_MODULE_5__["HttpClientModule"],
629                    _angular_common_http__WEBPACK_IMPORTED_MODULE_5__["HttpClientXsrfModule"].withOptions({
630                        cookieName: 'My-XSRF-TOKEN',
631                        headerName: 'X-XSRF-TOKEN'
632                    }),
633                    _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_7__["NgbModule"],
634                    _angular_fire__WEBPACK_IMPORTED_MODULE_15__["AngularFireModule"].initializeApp(src_environments_environment__WEBPACK_IMPORTED_MODULE_18__["environment"].firebase),
635                    _angular_fire_storage__WEBPACK_IMPORTED_MODULE_17__["AngularFireStorageModule"],
636                    _angular_fire_auth__WEBPACK_IMPORTED_MODULE_16__["AngularFireAuthModule"],
637                    _angular_router__WEBPACK_IMPORTED_MODULE_6__["RouterModule"].forRoot(_app_routing_module__WEBPACK_IMPORTED_MODULE_12__["Approutes"], _app_routing_module__WEBPACK_IMPORTED_MODULE_12__["RouterOptions"]),
638                    ngx_toastr__WEBPACK_IMPORTED_MODULE_20__["ToastrModule"].forRoot(),
639                    _finance_finance_module__WEBPACK_IMPORTED_MODULE_26__["FinanceModule"],
640                ],
641                providers: [
642                    { provide: _angular_common__WEBPACK_IMPORTED_MODULE_2__["LocationStrategy"], useClass: _angular_common__WEBPACK_IMPORTED_MODULE_2__["HashLocationStrategy"] },
643                    _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_19__["AngularFirestore"],
644                    _shared_guards_auth_guard__WEBPACK_IMPORTED_MODULE_21__["AuthGuard"],
645                    _shared_guards_admin_guard__WEBPACK_IMPORTED_MODULE_23__["AdminGuard"],
646                    _shared_guards_agent_secondary_guard__WEBPACK_IMPORTED_MODULE_22__["AgentSecondaryGuard"],
647                    _shared_services_excel_service__WEBPACK_IMPORTED_MODULE_24__["ExcelService"],
648                    _shared_services_import_service__WEBPACK_IMPORTED_MODULE_25__["ImportService"],
649                    ngx_image_compress__WEBPACK_IMPORTED_MODULE_28__["NgxImageCompressService"],
650                    _shared_services_email_notifications_service__WEBPACK_IMPORTED_MODULE_29__["EmailNotificationService"],
651                    _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormBuilder"]
652                ],
653                exports: [
654                    _shared_upload_file_upload_file_component__WEBPACK_IMPORTED_MODULE_27__["UploadFileComponent"],
655                ],
656                bootstrap: [_app_component__WEBPACK_IMPORTED_MODULE_13__["AppComponent"]],
657                schemas: [_angular_core__WEBPACK_IMPORTED_MODULE_3__["CUSTOM_ELEMENTS_SCHEMA"]]
658            }]
659    }], null, null); })();
660
661
662/***/ }),
663
664/***/ "./src/app/finance/dashboard-finance/dashboard-finance.component.ts":
665/*!**************************************************************************!*\
666  !*** ./src/app/finance/dashboard-finance/dashboard-finance.component.ts ***!
667  \**************************************************************************/
668/*! exports provided: DashboardFinanceComponent */
669/***/ (function(module, __webpack_exports__, __webpack_require__) {
670
671"use strict";
672__webpack_require__.r(__webpack_exports__);
673/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DashboardFinanceComponent", function() { return DashboardFinanceComponent; });
674/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
675/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
676/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_1__);
677/* harmony import */ var src_app_shared_services_agency_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/shared/services/agency.service */ "./src/app/shared/services/agency.service.ts");
678/* harmony import */ var src_app_shared_services_auth_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/shared/services/auth.service */ "./src/app/shared/services/auth.service.ts");
679/* harmony import */ var src_app_shared_services_experience_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/shared/services/experience.service */ "./src/app/shared/services/experience.service.ts");
680/* harmony import */ var src_app_shared_services_finance_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/shared/services/finance.service */ "./src/app/shared/services/finance.service.ts");
681/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
682/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
683/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
684/* harmony import */ var _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ng-bootstrap/ng-bootstrap */ "./node_modules/@ng-bootstrap/ng-bootstrap/__ivy_ngcc__/fesm2015/ng-bootstrap.js");
685/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
686/* harmony import */ var ng2_charts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ng2-charts */ "./node_modules/ng2-charts/__ivy_ngcc__/fesm2015/ng2-charts.js");
687var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
688    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
689    return new (P || (P = Promise))(function (resolve, reject) {
690        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
691        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
692        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
693        step((generator = generator.apply(thisArg, _arguments || [])).next());
694    });
695};
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714function DashboardFinanceComponent_canvas_17_Template(rf, ctx) { if (rf & 1) {
715    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "canvas", 28);
716} if (rf & 2) {
717    const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
718    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("datasets", ctx_r0.barChartData)("labels", ctx_r0.barChartLabels)("options", ctx_r0.barChartOptions)("legend", ctx_r0.barChartLegend)("chartType", ctx_r0.barChartType);
719} }
720function DashboardFinanceComponent_ng_template_18_Template(rf, ctx) { if (rf & 1) {
721    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "h2");
722    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "em", 29);
723    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
724} }
725function DashboardFinanceComponent_canvas_27_Template(rf, ctx) { if (rf & 1) {
726    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "canvas", 30);
727} if (rf & 2) {
728    const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
729    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("datasets", ctx_r3.barChartData2)("labels", ctx_r3.barChartLabels2)("c
729olors", ctx_r3.pieChartColors)("options", ctx_r3.barChartOptions2)("legend", ctx_r3.barChartLegend2)("chartType", ctx_r3.barChartType2);
730} }
731function DashboardFinanceComponent_ng_template_28_Template(rf, ctx) { if (rf & 1) {
732    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "h2");
733    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "em", 29);
734    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
735} }
736function DashboardFinanceComponent_option_41_Template(rf, ctx) { if (rf & 1) {
737    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "option", 31);
738    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
739    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](2, "uppercase");
740    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
741} if (rf & 2) {
742    const op_r8 = ctx.$implicit;
743    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("value", op_r8.key);
744    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
745    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](2, 2, op_r8.name), " ");
746} }
747const _c0 = function (a1, a2, a3) { return ["/experiences/reservation/", a1, a2, a3, "service"]; };
748function DashboardFinanceComponent_tr_81_Template(rf, ctx) { if (rf & 1) {
749    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "tr");
750    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "td", 32);
751    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "span", 33);
752    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](3, "titlecase");
753    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](4);
754    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](5, "titlecase");
755    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
756    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
757    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "td", 32);
758    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](7);
759    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](8, "date");
760    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
761    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](9, "td", 32);
762    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](10);
763    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](11, "date");
764    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
765    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](12, "td", 32);
766    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](13, "span", 33);
767    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](14, "titlecase");
768    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](15);
769    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](16, "titlecase");
770    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
771    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
772    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](17, "td", 32);
773    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](18);
774    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](19, "lowercase");
775    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
776    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](20, "td", 32);
777    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](21);
778    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
779    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](22, "td", 32);
780    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](23);
781    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](24, "number");
782    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
783    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](25, "td", 32);
784    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](26);
785    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
786    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](27, "td", 32);
787    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](28);
788    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
789    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](29, "td", 32);
790    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](30, "button", 34);
791    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](31, "em", 35);
792    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](32, " Ver detalle ");
793    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
794    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
795    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
796} if (rf & 2) {
797    const res_r9 = ctx.$implicit;
798    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
799    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngbTooltip", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](3, 12, res_r9.nameExperience));
800    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
801    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](5, 14, res_r9.experience.name), " ");
802    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
803    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind2"](8, 16, res_r9.paymentInfo.transaction_date, "dd-MM-yyyy"), " ");
804    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
805    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind2"](11, 19, res_r9.day, "dd-MM-yyyy") + "/" + res_r9.hour, " ");
806    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
807    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngbTooltip", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](14, 22, res_r9.name + " " + res_r9.lastName));
808    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
809    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](16, 24, res_r9.name + " " + res_r9.lastName), "");
810    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
811    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](19, 26, res_r9.email));
812    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
813    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](res_r9.persons + res_r9.childs);
814    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
815    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"]("$", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](24, 28, res_r9.finalPrice), "");
816    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
817    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", !!res_r9.heyandes ? res_r9.heyandes.status : "N/I", " ");
818    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
819    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" #", res_r9.paymentInfo.authorization_code, " ");
820    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
821    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("routerLink", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction3"](30, _c0, res_r9.agency, res_r9.experience, res_r9.id));
822} }
823moment__WEBPACK_IMPORTED_MODULE_1__["locale"]('es-CL');
824class DashboardFinanceComponent {
825    constructor(financeApi, authApi, experienceApi, agencyApi, afs) {
826        this.financeApi = financeApi;
827        this.authApi = authApi;
828        this.experienceApi = experienceApi;
829        this.agencyApi = agencyApi;
830        this.afs = afs;
831        this.days = [];
832        this.reservations = [];
833        this.colors = [];
834        this.barChartOptions = {
835            scaleShowVerticalLines: false,
836            responsive: true,
837        };
838        this.barChartLabels = [];
839        this.barChartType = 'bar';
840        this.barChartLegend = true;
841        this.barChartData = [
842            { data: [0, 0, 0, 0, 0, 0, 0], label: "Reservas" },
843        ];
844        this.barChartOptions2 = {
845            scaleShowVerticalLines: false,
846            responsive: true
847        };
848        this.barChartLabels2 = [];
849        this.barChartType2 = 'pie';
850        this.barChartLegend2 = true;
851        this.barChartData2 = [
852            { data: [], backgroundColor: [], label: "Experiencias" },
853        ];
854        this.pieChartColors = [{
855                backgroundColor: [],
856            }];
857        this.nameExperiences = [];
858        this.lastWeek = moment__WEBPACK_IMPORTED_MODULE_1__().subtract(1, 'week').startOf('week').format('YYYY-MM-DD HH:mm');
859        this.lastMonth = moment__WEBPACK_IMPORTED_MODULE_1__().subtract(1, 'month').startOf('month').format('YYYY-MM-DD HH:mm');
860        this.lastThreeMonth = moment__WEBPACK_IMPORTED_MODULE_1__().subtract(3, 'month').startOf('month').format('YYYY-MM-DD HH:mm');
861        this.lastSixMonth = moment__WEBPACK_IMPORTED_MODULE_1__().subtract(6, 'month').startOf('month').format('YYYY-MM-DD HH:mm');
862        this.currentDate = moment__WEBPACK_IMPORTED_MODULE_1__().endOf('month').format('YYYY-MM-DD HH:mm');
863        var currentDate = moment__WEBPACK_IMPORTED_MODULE_1__();
864        var weekStart = currentDate.clone().startOf('week');
865        // var weekEnd = currentDate.clone().endOf('week');
866        for (let i = 0; i <= 6; i++) {
867            this.barChartLabels.push(moment__WEBPACK_IMPORTED_MODULE_1__(weekStart).add(i, 'days').format("ddd").toUpperCase());
868            this.days.push(moment__WEBPACK_IMPORTED_MODULE_1__(weekStart).add(i, 'days').format("yyyy-MM-DD"));
869        }
870        ;
871    }
872    ngOnInit() {
873        return __awaiter(this, void 0, void 0, function* () {
874            this.isCharge = true;
875            this.authApi.user$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["take"])(1)).subscribe((res) => __awaiter(this, void 0, void 0, function* () {
876                this.typeUser = res.type;
877                this.agencyId = res.agency;
878                this.agency = this.agencyApi.getAgency(res.agency);
879                this.experiences = yield this.afs.collection(`agency/${res.agency}/experiences`, ref => ref.where('isActive', '==', true)).valueChanges();
880                yield this.afs.collection(`agency/${res.agency}/experiences`)
881                    .get()
882                    .forEach(resExp => {
883                    for (let ne of resExp.docs) {
884                        this.nameExperiences.push(Object.assign({ id: ne.id }, ne.data()));
885                        // this.barChartLabels2.push(ne.data().name.toUpperCase())
886                    }
887                });
888                yield this.afs.collectionGroup('reservations', ref => ref
889                    .where('agency.key', '==', res.agency)
890                    .where('paymentStatus', '==', 'Pago realizado')
891                    .where('status', '==', 'Reserva pagada')
892                    .orderBy('paymentInfo.transaction_date', 'desc'))
893                    .get()
894                    .forEach(response => {
895                    response.docs.map(r => {
896                        this.reservations.push(Object.assign({ id: r.id }, r.data()));
897                        const rs = this.days.findIndex(day => day === r.data().day);
898                        if (rs !== -1) {
899                            this.barChartData[0].data[rs] = this.barChartData[0].data[rs] + r.data().persons;
900                        }
901                    });
902                });
903                //CURRENT MONTH
904                const startOfMonth = moment__WEBPACK_IMPORTED_MODULE_1__().startOf('month').format('YYYY-MM-DD hh:mm');
905                const endOfMonth = moment__WEBPACK_IMPORTED_MODULE_1__().endOf('month').format('YYYY-MM-DD hh:mm');
906                this.total = this.reservations.reduce((tot, sum) => sum.heyandes.status === 'Pendiente de pago' ? tot + sum.finalPrice : tot, 0);
907                this.reservations.map(res => {
908                    if (res.createdAt >= startOfMonth && res.createdAt <= endOfMonth) {
909                        const ie = this.barChartLabels2.findIndex(r => r === res.nameExperience);
910                        if (ie === -1) {
911                            this.barChartLabels2.push(res.nameExperience);
912                            this.barChartData2[0].data.push(res.persons);
913                            var randomColor = Math.floor(Math.random() * 16777215).toString(16);
914                            this.pieChartColors[0].backgroundColor.push('#' + randomColor);
915                        }
916                        else {
917                            this.barChartData2[0].data[ie] = this.barChartData2[0].data[ie] + res.persons;
918                        }
919                    }
920                });
921                this.isCharge = false;
922            }));
923        });
924    }
925    mesActual() {
926        return moment__WEBPACK_IMPORTED_MODULE_1__().format('MMMM YYYY');
927    }
928    getNow() {
929        return moment__WEBPACK_IMPORTED_MODULE_1__().startOf('month').format('YYYY-MM-DD');
930    }
931    getTomorrow() {
932        return moment__WEBPACK_IMPORTED_MODULE_1__().endOf('month').format('YYYY-MM-DD');
933    }
934}
935DashboardFinanceComponent.ɵfac = function DashboardFinanceComponent_Factory(t) { return new (t || DashboardFinanceComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](src_app_shared_services_finance_service__WEBPACK_IMPORTED_MODULE_5__["FinanceService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](src_app_shared_services_auth_service__WEBPACK_IMPORTED_MODULE_3__["AuthService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](src_app_shared_services_experience_service__WEBPACK_IMPORTED_MODULE_4__["ExperienceService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](src_app_shared_services_agency_service__WEBPACK_IMPORTED_MODULE_2__["AgencyService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_fire_firestore__WEBPACK_IMPORTED_MODULE_7__["AngularFirestore"])); };
936DashboardFinanceComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: DashboardFinanceComponent, selectors: [["app-dashboard-finance"]], decls: 82, vars: 14, consts: [[1, "card"], [1, "card-header"], [1, "row"], [1, "col-lg-6"], ["routerLink", "/agencies/create", "disabled", "", "placement", "top", "ngbTooltip", "Listar agencias", 1, "btn", "btn-outline-primary", "btn-circle", "btn-sm"], [1, "fa", "fa-th-list"], [1, "col-lg-6", "text-right", "align-self-center"], [1, "card-body"], [1, "col-lg-5"], [2, "display", "block"], ["baseChart", "", 3, "datasets", "labels", "options", "legend", "chartType", 4, "ngIf", "ngIfElse"], ["chartOne", ""], [1, "col-lg-2"], ["baseChart", "", 3, "datasets", "labels", "colors", "options", "legend", "chartType", 4, "ngIf", "ngIfElse"], [1, "col-lg-12"], [1, "card", 2, "background", "#eaeaea", "margin-top", "15px"], [1, "col-lg-4"], [1, "form-control"], ["value", ""], [3, "value", 4, "ngFor", "ngForOf"], [1, "col-lg-3"], ["type", "date", 1, "form-control", 3, "value"], [1, "align-self-end", "col-lg-2", "mt-1"], [1, "btn", "btn-primary", "btn-block"], [1, "table-responsive"], [1, "table", "table-hover", "table-sm", "table-striped"], [1, "border-top-0"], [4, "ngFor", "ngForOf"], ["baseChart", "", 3, "datasets", "labels", "options", "legend", "chartType"], [1, "fa", "fa-spin", "fa-spinner"], ["baseChart", "", 3, "datasets", "labels", "colors", "options", "legend", "chartType"], [3, "value"], [1, "align-middle"], [1, "text-truncate", 3, "ngbTooltip"], ["placement", "top", "ngbTooltip", "Ver detalle", 1, "btn", "btn-outline-primary", "btn-rounded", "btn-sm", 3, "routerLink"], [1, "fa", "fa-eye"]], template: function DashboardFinanceComponent_Template(rf, ctx) { if (rf & 1) {
937        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0);
938        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "div", 1);
939        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 2);
940        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "div", 3);
941        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "button", 4);
942        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](5, "em", 5);
943        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
944        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
945        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "div", 6);
946        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](7, " Total por pagar: ");
947        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](8, "strong");
948        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](9);
949        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](10, "number");
950        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
951        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
952        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
953        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
954        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](11, "div", 7);
955        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](12, "div", 2);
956        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](13, "div", 8);
957        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](14, "h3");
958        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](15, "Reservas por d\u00EDa");
959        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
960        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](16, "div", 9);
961        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](17, DashboardFinanceComponent_canvas_17_Template, 1, 5, "canvas", 10);
962        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](18, DashboardFinanceComponent_ng_template_18_Template, 2, 0, "ng-template", null, 11, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplateRefExtractor"]);
963        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
964        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
965        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](20, "div", 12);
966        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](21, "div", 8);
967        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](22, "h3");
968        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](23, " Reservas de ");
969        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](24, "strong");
970        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](25);
971        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
972        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
973        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](26, "div", 9);
974        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](27, DashboardFinanceComponent_canvas_27_Template, 1, 6, "canvas", 13);
975        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](28, DashboardFinanceComponent_ng_template_28_Template, 2, 0, "ng-template", null, 11, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplateRefExtractor"]);
976        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
977        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
978        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](30, "div", 14);
979        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](31, "div", 15);
980        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](32, "div", 7);
981        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](33, "div", 2);
982        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](34, "div", 16);
983        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](35, "label");
984        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](36, "small");
985        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](37, "Experiencia");
986        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
987        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
988        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](38, "select", 17);
989        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](39, "option", 18);
990        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](40, "Seleccione una experiencia");
991        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
992        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](41, DashboardFinanceComponent_option_41_Template, 3, 4, "option", 19);
993        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](42, "async");
994        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
995        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
996        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](43, "div", 20);
997        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](44, "label");
998        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](45, "small");
999        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](4
9996, "Desde");
1000        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1001        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1002        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](47, "input", 21);
1003        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1004        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](48, "div", 20);
1005        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](49, "label");
1006        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](50, "small");
1007        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](51, "Hasta");
1008        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1009        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1010        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](52, "input", 21);
1011        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1012        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](53, "div", 22);
1013        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](54, "button", 23);
1014        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](55, "Filtrar");
1015        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1016        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1017        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1018        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1019        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1020        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1021        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1022        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](56, "div", 24);
1023        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](57, "table", 25);
1024        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](58, "thead");
1025        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](59, "tr");
1026        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](60, "th", 26);
1027        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](61, "Experiencia");
1028        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1029        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](62, "th", 26);
1030        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](63, "Fecha\u00A0de\u00A0pago");
1031        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1032        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](64, "th", 26);
1033        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](65, "Fecha\u00A0reserva");
1034        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1035        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](66, "th", 26);
1036        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](67, "Cliente");
1037        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1038        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](68, "th", 26);
1039        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](69, "Email");
1040        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1041        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](70, "th", 26);
1042        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](71, "Reservas");
1043        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1044        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](72, "th", 26);
1045        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](73, "Monto");
1046        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1047        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](74, "th", 26);
1048        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](75, "HeyAndes");
1049        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1050        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](76, "th", 26);
1051        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](77, "Orden\u00A0Tbk");
1052        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1053        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](78, "th", 26);
1054        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](79, "Acci\u00F3n");
1055        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1056        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1057        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1058        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](80, "tbody");
1059        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](81, DashboardFinanceComponent_tr_81_Template, 33, 34, "tr", 27);
1060        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1061        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1062        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1063        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1064        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1065    } if (rf & 2) {
1066        const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](19);
1067        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](9);
1068        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" $", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](10, 10, ctx.total), "");
1069        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](8);
1070        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", !ctx.isCharge)("ngIfElse", _r1);
1071        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](8);
1072        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](ctx.mesActual());
1073        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
1074        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", !ctx.isCharge)("ngIfElse", _r1);
1075        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](14);
1076        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](42, 12, ctx.experiences));
1077        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](6);
1078        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("value", ctx.getNow());
1079        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](5);
1080        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("value", ctx.getTomorrow());
1081        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](29);
1082        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.reservations);
1083    } }, directives: [_angular_router__WEBPACK_IMPORTED_MODULE_8__["RouterLink"], _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_9__["NgbTooltip"], _angular_common__WEBPACK_IMPORTED_MODULE_10__["NgIf"], _angular_common__WEBPACK_IMPORTED_MODULE_10__["NgForOf"], ng2_charts__WEBPACK_IMPORTED_MODULE_11__["BaseChartDirective"]], pipes: [_angular_common__WEBPACK_IMPORTED_MODULE_10__["DecimalPipe"], _angular_common__WEBPACK_IMPORTED_MODULE_10__["AsyncPipe"], _angular_common__WEBPACK_IMPORTED_MODULE_10__["UpperCasePipe"], _angular_common__WEBPACK_IMPORTED_MODULE_10__["TitleCasePipe"], _angular_common__WEBPACK_IMPORTED_MODULE_10__["DatePipe"], _angular_common__WEBPACK_IMPORTED_MODULE_10__["LowerCasePipe"]], styles: [".text-truncate[_ngcontent-%COMP%] {\n  display: inline-block;\n  max-width: 100px;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvZmluYW5jZS9kYXNoYm9hcmQtZmluYW5jZS9kYXNoYm9hcmQtZmluYW5jZS5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UscUJBQXFCO0VBQ3JCLGdCQUFnQjtFQUNoQixtQkFBbUI7RUFDbkIsZ0JBQWdCO0VBQ2hCLHVC
1083QUF1QjtBQUN6QiIsImZpbGUiOiJzcmMvYXBwL2ZpbmFuY2UvZGFzaGJvYXJkLWZpbmFuY2UvZGFzaGJvYXJkLWZpbmFuY2UuY29tcG9uZW50LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi50ZXh0LXRydW5jYXRlIHtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBtYXgtd2lkdGg6IDEwMHB4O1xuICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICBvdmVyZmxvdzogaGlkZGVuO1xuICB0ZXh0LW92ZXJmbG93OiBlbGxpcHNpcztcbn0iXX0= */"] });
1084/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DashboardFinanceComponent, [{
1085        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
1086        args: [{
1087                selector: 'app-dashboard-finance',
1088                templateUrl: './dashboard-finance.component.html',
1089                styleUrls: ['./dashboard-finance.component.css']
1090            }]
1091    }], function () { return [{ type: src_app_shared_services_finance_service__WEBPACK_IMPORTED_MODULE_5__["FinanceService"] }, { type: src_app_shared_services_auth_service__WEBPACK_IMPORTED_MODULE_3__["AuthService"] }, { type: src_app_shared_services_experience_service__WEBPACK_IMPORTED_MODULE_4__["ExperienceService"] }, { type: src_app_shared_services_agency_service__WEBPACK_IMPORTED_MODULE_2__["AgencyService"] }, { type: _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_7__["AngularFirestore"] }]; }, null); })();
1092
1093
1094/***/ }),
1095
1096/***/ "./src/app/finance/finance.module.ts":
1097/*!*******************************************!*\
1098  !*** ./src/app/finance/finance.module.ts ***!
1099  \*******************************************/
1100/*! exports provided: FinanceModule */
1101/***/ (function(module, __webpack_exports__, __webpack_require__) {
1102
1103"use strict";
1104__webpack_require__.r(__webpack_exports__);
1105/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FinanceModule", function() { return FinanceModule; });
1106/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
1107/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
1108/* harmony import */ var _dashboard_finance_dashboard_finance_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dashboard-finance/dashboard-finance.component */ "./src/app/finance/dashboard-finance/dashboard-finance.component.ts");
1109/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
1110/* harmony import */ var _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ng-bootstrap/ng-bootstrap */ "./node_modules/@ng-bootstrap/ng-bootstrap/__ivy_ngcc__/fesm2015/ng-bootstrap.js");
1111/* harmony import */ var ng2_charts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ng2-charts */ "./node_modules/ng2-charts/__ivy_ngcc__/fesm2015/ng2-charts.js");
1112
1113
1114
1115
1116
1117
1118
1119
1120const routes = [
1121    {
1122        path: 'dashboard',
1123        pathMatch: 'full',
1124        // canActivate: [AuthGuard],
1125        data: {
1126            title: 'Módulo de finanzas'
1127        },
1128        component: _dashboard_finance_dashboard_finance_component__WEBPACK_IMPORTED_MODULE_2__["DashboardFinanceComponent"]
1129    }
1130];
1131class FinanceModule {
1132}
1133FinanceModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: FinanceModule });
1134FinanceModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ factory: function FinanceModule_Factory(t) { return new (t || FinanceModule)(); }, imports: [[
1135            _angular_common__WEBPACK_IMPORTED_MODULE_1__["CommonModule"], _angular_router__WEBPACK_IMPORTED_MODULE_3__["RouterModule"].forChild(routes), _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_4__["NgbModule"], ng2_charts__WEBPACK_IMPORTED_MODULE_5__["ChartsModule"]
1136        ]] });
1137(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](FinanceModule, { declarations: [_dashboard_finance_dashboard_finance_component__WEBPACK_IMPORTED_MODULE_2__["DashboardFinanceComponent"]], imports: [_angular_common__WEBPACK_IMPORTED_MODULE_1__["CommonModule"], _angular_router__WEBPACK_IMPORTED_MODULE_3__["RouterModule"], _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_4__["NgbModule"], ng2_charts__WEBPACK_IMPORTED_MODULE_5__["ChartsModule"]], exports: [_dashboard_finance_dashboard_finance_component__WEBPACK_IMPORTED_MODULE_2__["DashboardFinanceComponent"]] }); })();
1138/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FinanceModule, [{
1139        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"],
1140        args: [{
1141                declarations: [
1142                    _dashboard_finance_dashboard_finance_component__WEBPACK_IMPORTED_MODULE_2__["DashboardFinanceComponent"]
1143                ],
1144                imports: [
1145                    _angular_common__WEBPACK_IMPORTED_MODULE_1__["CommonModule"], _angular_router__WEBPACK_IMPORTED_MODULE_3__["RouterModule"].forChild(routes), _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_4__["NgbModule"], ng2_charts__WEBPACK_IMPORTED_MODULE_5__["ChartsModule"]
1146                ],
1147                exports: [
1148                    _dashboard_finance_dashboard_finance_component__WEBPACK_IMPORTED_MODULE_2__["DashboardFinanceComponent"]
1149                ]
1150            }]
1151    }], null, null); })();
1152
1153
1154/***/ }),
1155
1156/***/ "./src/app/layouts/full/full.component.ts":
1157/*!************************************************!*\
1158  !*** ./src/app/layouts/full/full.component.ts ***!
1159  \************************************************/
1160/*! exports provided: FullComponent */
1161/***/ (function(module, __webpack_exports__, __webpack_require__) {
1162
1163"use strict";
1164__webpack_require__.r(__webpack_exports__);
1165/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FullComponent", function() { return FullComponent; });
1166/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
1167/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
1168/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
1169/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_2__);
1170/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
1171/* harmony import */ var _shared_header_navigation_navigation_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/header-navigation/navigation.component */ "./src/app/shared/header-navigation/navigation.component.ts");
1172/* harmony import */ var _shared_sidebar_sidebar_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/sidebar/sidebar.component */ "./src/app/shared/sidebar/sidebar.component.ts");
1173
1174
1175
1176
1177
1178
1179
1180
1181const _c0 = function (a0) { return { "show-sidebar": a0 }; };
1182class FullComponent {
1183    constructor(router) {
1184        this.router = router;
1185        this.isCollapsed = false;
1186        this.showMobileMenu = false;
1187        this.expandLogo = false;
1188        this.options = {
1189            sidebartype: 'full'
1190        };
1191    }
1192    Logo() {
1193        this.expandLogo = !this.expandLogo;
1194    }
1195    ngOnInit() {
1196        if (this.router.url === '/') {
1197            this.router.navigate(['/dashboard/dashboard1']);
1198        }
1199        this.defaultSidebar = this.options.sidebartype;
1200        this.handleSidebar();
1201    }
1202    onResize(event) {
1203        this.handleSidebar();
1204    }
1205    getYear() {
1206        return moment__WEBPACK_IMPORTED_MODULE_2__().format('YYYY');
1207    }
1208    handleSidebar() {
1209        this.innerWidth = window.innerWidth;
1210        switch (this.defaultSidebar) {
1211            case 'full':
1212                if (this.innerWidth < 720) {
1213                    this.options.sidebartype = 'mini-sidebar';
1214                }
1215                else {
1216                    this.options.sidebartype = this.defaultSidebar;
1217                }
1218                break;
1219            default:
1220        }
1221    }
1222}
1223FullComponent.ɵfac = function FullComponent_Factory(t) { return new (t || FullComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"])); };
1224FullComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: FullComponent, selectors: [["app-full-layout"]], hostBindings: function FullComponent_HostBindings(rf, ctx) { if (rf & 1) {
1225        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("resize", function FullComponent_resize_HostBindingHandler($event) { return ctx.onResize($event); }, false, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresolveWindow"]);
1226    } }, decls: 19, vars: 7, consts: [["id", "main-wrapper", "dir", "ltr", "data-theme", "light", "data-layout", "vertical", "data-sidebar-position", "absolute", "data-header-position", "fixed", "data-boxed-layout", "full", 3, "ngClass"], ["data-navbarbg", "skin6", 1, "topbar"], [1, "d-flex", "top-navbar", "navbar-expand-md", "navbar-light"], ["data-logobg", "skin5", 1, "navbar-header", 3, "ngClass"], ["href", "javascript:void(0)", 1, "nav-toggler", "waves-effect", "waves-light", "d-block", "d-md-none", 3, "click"], [3, "ngClass"], ["href", "/", 1, "navbar-brand"], [1, "logo-icon", "text-light", "ml-2"], ["src", "assets/images/logo-white.png", "alt", "homepage", 1, "light-logo"], ["id", "navbarSupportedContent", 1, "navbar-collapse", "collapse"], [1, "w-100"], ["data-sidebarbg", "skin5", 1, "left-sidebar", 3, "mouseover", "mouseout"], [1, "scroll-sidebar"], [1, "page-wrapper"], [1, "container-fluid"], [1, "footer", "text-center"]], template: function FullComponent_Template(rf, ctx) { if (rf & 1) {
1227        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0);
1228        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "header", 1);
1229        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "nav", 2);
1230        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "div", 3);
1231        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "a", 4);
1232        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function FullComponent_Template_a_click_4_listener() { return ctx.showMobileMenu = !ctx.showMobileMenu; });
1233        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](5, "i", 5);
1234        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1235        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "a", 6);
1236        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](7, "b", 7);
1237        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](8, "img", 8);
1238        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1239        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1240        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1241        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](9, "div", 9);
1242        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](10, "app-navigation", 10);
1243        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1244        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1245        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1246        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](11, "aside", 11);
1247        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("mouseover", function FullComponent_Template_aside_mouseover_11_listener() { return ctx.Logo(); })("mouseout", function FullComponent_Template_aside_mouseout_11_listener() { return ctx.Logo(); });
1248        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](12, "div", 12);
1249        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](13, "app-sidebar");
1250        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1251        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1252        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](14, "div", 13);
1253        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](15, "div", 14);
1254        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](16, "router-outlet");
1255        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1256        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](17, "footer", 
125615);
1257        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](18);
1258        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1259        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1260        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1261    } if (rf & 2) {
1262        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngClass", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](5, _c0, ctx.showMobileMenu));
1263        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-sidebartype", ctx.options.sidebartype);
1264        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
1265        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngClass", ctx.expandLogo ? "expand-logo" : "");
1266        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
1267        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngClass", ctx.showMobileMenu ? "ti-close" : "ti-menu");
1268        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](13);
1269        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", ctx.getYear(), " \u00A9 Copyright. Todos los derechos reservados. ");
1270    } }, directives: [_angular_common__WEBPACK_IMPORTED_MODULE_3__["NgClass"], _shared_header_navigation_navigation_component__WEBPACK_IMPORTED_MODULE_4__["NavigationComponent"], _shared_sidebar_sidebar_component__WEBPACK_IMPORTED_MODULE_5__["SidebarComponent"], _angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterOutlet"]], styles: [".light-logo[_ngcontent-%COMP%] {\n  width: 100%;\n  height: auto;\n  -o-object-fit: cover;\n     object-fit: cover;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9vcHQvYXRsYXNzaWFuL3BpcGVsaW5lcy9hZ2VudC9idWlsZC9zcmMvYXBwL2xheW91dHMvZnVsbC9mdWxsLmNvbXBvbmVudC5zY3NzIiwic3JjL2FwcC9sYXlvdXRzL2Z1bGwvZnVsbC5jb21wb25lbnQuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLFdBQVc7RUFDWCxZQUFZO0VBQ1osb0JBQWlCO0tBQWpCLGlCQUFpQjtBQ0NuQiIsImZpbGUiOiJzcmMvYXBwL2xheW91dHMvZnVsbC9mdWxsLmNvbXBvbmVudC5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmxpZ2h0LWxvZ28ge1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiBhdXRvO1xuICBvYmplY3QtZml0OiBjb3Zlcjtcbn1cbiIsIi5saWdodC1sb2dvIHtcbiAgd2lkdGg6IDEwMCU7XG4gIGhlaWdodDogYXV0bztcbiAgb2JqZWN0LWZpdDogY292ZXI7XG59XG4iXX0= */"] });
1271/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FullComponent, [{
1272        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
1273        args: [{
1274                selector: 'app-full-layout',
1275                templateUrl: './full.component.html',
1276                styleUrls: ['./full.component.scss']
1277            }]
1278    }], function () { return [{ type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] }]; }, { onResize: [{
1279            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["HostListener"],
1280            args: ['window:resize', ['$event']]
1281        }] }); })();
1282
1283
1284/***/ }),
1285
1286/***/ "./src/app/shared/breadcrumb/breadcrumb.component.ts":
1287/*!***********************************************************!*\
1288  !*** ./src/app/shared/breadcrumb/breadcrumb.component.ts ***!
1289  \***********************************************************/
1290/*! exports provided: BreadcrumbComponent */
1291/***/ (function(module, __webpack_exports__, __webpack_require__) {
1292
1293"use strict";
1294__webpack_require__.r(__webpack_exports__);
1295/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BreadcrumbComponent", function() { return BreadcrumbComponent; });
1296/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
1297/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/platform-browser.js");
1298/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
1299/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
1300
1301
1302
1303
1304
1305
1306
1307class BreadcrumbComponent {
1308    constructor(router, activatedRoute, titleService) {
1309        this.router = router;
1310        this.activatedRoute = activatedRoute;
1311        this.titleService = titleService;
1312        this.router.events
1313            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])((event) => event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_2__["NavigationEnd"]))
1314            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(() => this.activatedRoute))
1315            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((route) => {
1316            while (route.firstChild) {
1317                route = route.firstChild;
1318            }
1319            return route;
1320        }))
1321            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])((route) => route.outlet === 'primary'))
1322            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])((route) => route.data))
1323            .subscribe((event) => {
1324            this.titleService.setTitle(event['title']);
1325            this.pageInfo = event;
1326        });
1327    }
1328    ngOnInit() { }
1329}
1330BreadcrumbComponent.ɵfac = function BreadcrumbComponent_Factory(t) { return new (t || BreadcrumbComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_platform_browser__WEBPACK_IMPORTED_MODULE_1__["Title"])); };
1331BreadcrumbComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: BreadcrumbComponent, selectors: [["app-breadcrumb"]], inputs: { layout: "layout" }, decls: 5, vars: 1, consts: [[1, "page-breadcrumb"], [1, "row"], [1, "col-12", "align-self-center"], [1, "page-title"]], template: function BreadcrumbComponent_Template(rf, ctx) { if (rf & 1) {
1332        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0);
1333        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "div", 1);
1334        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 2);
1335        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "h3", 3);
1336        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](4);
1337        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1338        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1339        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1340        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1341    } if (rf & 2) {
1342        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
1343        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](ctx.pageInfo == null ? null : ctx.pageInfo.title);
1344    } }, encapsulation: 2 });
1345/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](BreadcrumbComponent, [{
1346        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
1347        args: [{
1348                selector: 'app-breadcrumb',
1349                templateUrl: './breadcrumb.component.html'
1350            }]
1351    }], function () { return [{ type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] }, { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] }, { type: _angular_platform_browser__WEBPACK_IMPORTED_MODULE_1__["Title"] }]; }, { layout: [{
1352            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
1353        }] }); })();
1354
1355
1356/***/ }),
1357
1358/***/ "./src/app/shared/enums/state-payment.enum.ts":
1359/*!****************************************************!*\
1360  !*** ./src/app/shared/enums/state-payment.enum.ts ***!
1361  \****************************************************/
1362/*! exports provided: StatePaymentReservation */
1363/***/ (function(module, __webpack_exports__, __webpack_require__) {
1364
1365"use strict";
1366__webpack_require__.r(__webpack_exports__);
1367/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StatePaymentReservation", function() { return StatePaymentReservation; });
1368var StatePaymentReservation;
1369(function (StatePaymentReservation) {
1370    StatePaymentReservation["DEAL"] = "Deal";
1371    StatePaymentReservation["PAYMENT_PROCESSING"] = "Pago en proceso";
1372    StatePaymentReservation["PAYMENT_SUCCESS"] = "Pago realizado";
1373    StatePaymentReservation["PAYMENT_REJECTED"] = "Pago rechazado";
1374    StatePaymentReservation["PARTIAL_PAYMENT"] = "Pago parcial realizado";
1375    StatePaymentReservation["DEFERRED_PAYMENT"] = "Pago diferido";
1376})(StatePaymentReservation || (StatePaymentReservation = {}));
1377
1378
1379/***/ }),
1380
1381/***/ "./src/app/shared/enums/state-reservation.enum.ts":
1382/*!********************************************************!*\
1383  !*** ./src/app/shared/enums/state-reservation.enum.ts ***!
1384  \********************************************************/
1385/*! exports provided: StateReservation */
1386/***/ (function(module, __webpack_exports__, __webpack_require__) {
1387
1388"use strict";
1389__webpack_require__.r(__webpack_exports__);
1390/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateReservation", function() { return StateReservation; });
1391var StateReservation;
1392(function (StateReservation) {
1393    StateReservation["PENDING"] = "Reserva pendiente de pago";
1394    StateReservation["PAID_OUT"] = "Reserva pagada";
1395    StateReservation["REFUND_PROCESSING"] = "Reembolso en proceso";
1396    StateReservation["REFUND_ACCEPTED"] = "Reembolsado";
1397    StateReservation["REFUND_REJECTED"] = "Reembolso rechazado";
1398    StateReservation["RE_SCHEDULE"] = "Reserva reagendada";
1399    StateReservation["CANCEL"] = "Reserva cancelada";
1400    StateReservation["REQUEST_REFUND"] = "Pendiente de reembolso";
1401})(StateReservation || (StateReservation = {}));
1402
1403
1404/***/ }),
1405
1406/***/ "./src/app/shared/guards/admin.guard.ts":
1407/*!**********************************************!*\
1408  !*** ./src/app/shared/guards/admin.guard.ts ***!
1409  \**********************************************/
1410/*! exports provided: AdminGuard */
1411/***/ (function(module, __webpack_exports__, __webpack_require__) {
1412
1413"use strict";
1414__webpack_require__.r(__webpack_exports__);
1415/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdminGuard", function() { return AdminGuard; });
1416/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
1417/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
1418/* harmony import */ var _services_auth_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../services/auth.service */ "./src/app/shared/services/auth.service.ts");
1419/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
1420/* harmony import */ var ngx_toastr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ngx-toastr */ "./node_modules/ngx-toastr/__ivy_ngcc__/fesm2015/ngx-toastr.js");
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430// import { environment } from "../../environments/environment";
1431class AdminGuard {
1432    constructor(authApi, router, toastr) {
1433        this.authApi = authApi;
1434        this.router = router;
1435        this.toastr = toastr;
1436    }
1437    canActivate() {
1438        return this.authApi.user$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((user) => user && this.authApi.isAdmin(user)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])((canEdit) => {
1439            if (!canEdit) {
1440                this.toastr.warning("No cuentas con el permiso suficiente para ingresar a esta sección", "Atención!");
1441                // this.router.navigateByUrl("/auth/login");
1442            }
1443        }));
1444    }
1445}
1446AdminGuard.ɵfac = function AdminGuard_Factory(t) { return new (t || AdminGuard)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](ngx_toastr__WEBPACK_IMPORTED_MODULE_4__["ToastrService"])); };
1447AdminGuard.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: AdminGuard, factory: AdminGuard.ɵfac });
1448/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AdminGuard, [{
1449        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"]
1450    }], function () { return [{ type: _services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"] }, { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] }, { type: ngx_toastr__WEBPACK_IMPORTED_MODULE_4__["ToastrService"] }]; }, null); })();
1451
1452
1453/***/ }),
1454
1455/***/ "./src/app/shared/guards/agent-secondary.guard.ts":
1456/*!********************************************************!*\
1457  !*** ./src/app/shared/guards/agent-secondary.guard.ts ***!
1458  \********************************************************/
1459/*! exports provided: AgentSecondaryGuard */
1460/***/ (function(module, __webpack_exports__, __webpack_require__) {
1461
1462"use strict";
1463__webpack_require__.r(__webpack_exports__);
1464/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgentSecondaryGuard", function() { return AgentSecondaryGuard; });
1465/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
1466/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
1467/* harmony import */ var _services_auth_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../services/auth.service */ "./src/app/shared/services/auth.service.ts");
1468/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
1469/* harmony import */ var ngx_toastr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ngx-toastr */ "./node_modules/ngx-toastr/__ivy_ngcc__/fesm2015/ngx-toastr.js");
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479class AgentSecondaryGuard {
1480    constructor(authApi, router, toastr) {
1481        this.authApi = authApi;
1482        this.router = router;
1483        this.toastr = toastr;
1484    }
1485    canActivate() {
1486        return this.authApi.user$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((user) => user &&
1487            (this.authApi.isAgent(user) ||
1488                this.authApi.isAdmin(user) ||
1489                this.authApi.isAgentSecondary(user))), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])((canAgent) => {
1490            if (!canAgent) {
1491                this.toastr.warning("No cuentas con el permiso suficiente para ingresar a esta sección 2", "Atención!");
1492                // this.router.navigateByUrl("/auth/login");
1493            }
1494        }));
1495    }
1496}
1497AgentSecondaryGuard.ɵfac = function AgentSecondaryGuard_Factory(t) { return new (t || AgentSecondaryGuard)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](ngx_toastr__WEBPACK_IMPORTED_MODULE_4__["ToastrService"])); };
1498AgentSecondaryGuard.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: AgentSecondaryGuard, factory: AgentSecondaryGuard.ɵfac });
1499/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AgentSecondaryGuard, [{
1500        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"]
1501    }], function () { return [{ type: _services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"] }, { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] }, { type: ngx_toastr__WEBPACK_IMPORTED_MODULE_4__["ToastrService"] }]; }, null); })();
1502
1503
1504/***/ }),
1505
1506/***/ "./src/app/shared/guards/auth.guard.ts":
1507/*!*********************************************!*\
1508  !*** ./src/app/shared/guards/auth.guard.ts ***!
1509  \*********************************************/
1510/*! exports provided: AuthGuard */
1511/***/ (function(module, __webpack_exports__, __webpack_require__) {
1512
1513"use strict";
1514__webpack_require__.r(__webpack_exports__);
1515/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AuthGuard", function() { return AuthGuard; });
1516/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
1517/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
1518/* harmony import */ var _services_auth_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../services/auth.service */ "./src/app/shared/services/auth.service.ts");
1519/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
1520/* harmony import */ var ngx_toastr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ngx-toastr */ "./node_modules/ngx-toastr/__ivy_ngcc__/fesm2015/ngx-toastr.js");
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530class AuthGuard {
1531    constructor(authApi, router, toastr) {
1532        this.authApi = authApi;
1533        this.router = router;
1534        this.toastr = toastr;
1535    }
1536    canActivate() {
1537        return this.authApi.user$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((user) => user && (this.authApi.isAgent(user) || this.authApi.isAdmin(user))), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])((canAgent) => {
1538            if (!canAgent) {
1539                this.toastr.warning("No cuentas con el permiso suficiente para ingresar a esta sección", "Atención!");
1540                // this.router.navigateByUrl("/auth/login");
1541            }
1542        }));
1543    }
1544}
1545AuthGuard.ɵfac = function AuthGuard_Factory(t) { return new (t || AuthGuard)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](ngx_toastr__WEBPACK_IMPORTED_MODULE_4__["ToastrService"])); };
1546AuthGuard.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: AuthGuard, factory: AuthGuard.ɵfac });
1547/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AuthGuard, [{
1548        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"]
1549    }], function () { return [{ type: _services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"] }, { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] }, { type: ngx_toastr__WEBPACK_IMPORTED_MODULE_4__["ToastrService"] }]; }, null); })();
1550
1551
1552/***/ }),
1553
1554/***/ "./src/app/shared/header-navigation/navigation.component.ts":
1555/*!******************************************************************!*\
1556  !*** ./src/app/shared/header-navigation/navigation.component.ts ***!
1557  \******************************************************************/
1558/*! exports provided: NavigationComponent */
1559/***/ (function(module, __webpack_exports__, __webpack_require__) {
1560
1561"use strict";
1562__webpack_require__.r(__webpack_exports__);
1563/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationComponent", function() { return NavigationComponent; });
1564/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
1565/* harmony import */ var _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ng-bootstrap/ng-bootstrap */ "./node_modules/@ng-bootstrap/ng-bootstrap/__ivy_ngcc__/fesm2015/ng-bootstrap.js");
1566/* harmony import */ var _services_auth_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../services/auth.service */ "./src/app/shared/services/auth.service.ts");
1567/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
1568/* harmony import */ var _services_cookies_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../services/cookies.service */ "./src/app/shared/services/cookies.service.ts");
1569/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
1570/* harmony import */ var _breadcrumb_breadcrumb_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../breadcrumb/breadcrumb.component */ "./src/app/shared/breadcrumb/breadcrumb.component.ts");
1571/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
1572var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
1573    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1574    return new (P || (P = Promise))(function (resolve, reject) {
1575        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1576        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1577        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1578        step((generator = generator.apply(thisArg, _arguments || [])).next());
1579    });
1580};
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594function NavigationComponent_img_7_Template(rf, ctx) { if (rf & 1) {
1595    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "img", 13);
1596} if (rf & 2) {
1597    const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
1598    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", ctx_r0.logo, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeUrl"]);
1599} }
1600class NavigationComponent {
1601    constructor(modalService, authApi, router, coockiesApi) {
1602        // this.user = JSON.parse(
1603        //   this.coockiesApi.getCookie(`${environment.helpers.cookies.name}.claims`)
1604        // );
1605        this.modalService = modalService;
1606        this.authApi = authApi;
1607        this.router = router;
1608        this.coockiesApi = coockiesApi;
1609        this.showSearch = false;
1610        this.typeUser = "";
1611        this.logo = "";
1612        this.nameAgency = "";
1613        this.nameUser = "";
1614        // this.getType();
1615    }
1616    ngAfterViewInit() {
1617        return __awaiter(this, void 0, void 0, function* () {
1618            yield this.authApi.user$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["take"])(1)).subscribe((res) => {
1619                this.typeUser = res.type;
1620                this.logo =
1621                    res.type !== "SuperAdmin"
1622                        ? res.logoAgency
1623                        : "https://firebasestorage.googleapis.com/v0/b/heyandes-web.appspot.com/o/src%2Flogo-icon-black.png?alt=media&token=5bf20b84-4555-4bb4-839e-58dbc80dafde";
1624                this.nameAgency = res.nameAgency;
1625                this.nameUser = res.name;
1626            });
1627        });
1628    }
1629    logout() {
1630        return __awaiter(this, void 0, void 0, function* () {
1631            try {
1632                yield this.authApi.logout();
1633                this.router.navigate(["/auth/login"]);
1634            }
1635            catch (error) {
1636                console.log(error);
1637            }
1638        });
1639    }
1640}
1641NavigationComponent.ɵfac = function NavigationComponent_Factory(t) { return new (t || NavigationComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_1__["NgbModal"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_services_cookies_service__WEBPACK_IMPORTED_MODULE_4__["CookiesService"])); };
1642NavigationComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: NavigationComponent, selectors: [["app-navigation"]], decls: 18, vars: 5, consts: [[1, "navbar-nav", "float-left", "mr-auto", "align-self-center"], [1, "nav-item"], [1, "navbar-nav", "float-right"], ["placement", "bottom-right", 1, "nav-item"], [1, "row"], [1, "col-sm-3", "align-self-center"], ["style", "\n            border: 1px solid #333;\n            object-fit: cover;\n            width: 50px;\n            height: 50px;\n            border-radius: 50%;\n            margin-right: 10px;\n          ", 3, "src", 4, "ngIf"], [1, "col-sm-7", "align-self-center", "text-truncate"], [2, "font-size", "14px"], [1, "text-truncate", 2, "margin", "0px", "padding", "0", "margin-top", "-8px"], [1, "col-sm-2", "align-self-center"], [1, "btn", "btn-sm", "btn-circle", "btn-outline-light", 3, "click"], [1, "fa", "fa-power-off"], [2, "border", "1px solid #333", "object-fit", "cover", "width", "50px", "height", "50px", "border-radius", "50%", "margin-right", "10px", 3, "src"]], template: function NavigationComponent_Template(rf, ctx) { if (rf & 1) {
1643        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "ul", 0);
1644        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "li", 1);
1645        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](2, "app-breadcrumb");
1646        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1647        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1648        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "ul", 2);
1649        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "li", 3);
1650        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](5, "div", 4);
1651        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "div", 5);
1652        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](7, NavigationComponent_img_7_Template, 1, 1, "img", 6);
1653        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1654        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](8, "div", 7);
1655        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](9, "b", 8);
1656        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](10);
1657        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](11, "titlecase");
1658        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1659        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](12, "p", 9);
1660        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](13, "small");
1661        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](14);
1662        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1663        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1664        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1665        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](15, "div", 10);
1666        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](16, "button", 11);
1667        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function NavigationComponent_Template_button_click_16_listener() { return ctx.logout(); });
1668        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](17, "i", 12);
1669        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1670        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1671        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1672        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1673        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
1674    } if (rf & 2) {
1675        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](7);
1676        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.logo);
1677        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
1678        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](11, 3, ctx.nameUser));
1679        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
1680        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", ctx.typeUser !== "SuperAdmin" ? ctx.nameAgency : "Super Admin", " ");
1681    } }, directives: [_breadcrumb_breadcrumb_component__WEBPACK_IMPORTED_MODULE_6__["BreadcrumbComponent"], _angular_common__WEBPACK_IMPORTED_MODULE_7__["NgIf"]], pipes: [_angular_common__WEBPACK_IMPORTED_MODULE_7__["TitleCasePipe"]], styles: ["small[_ngcontent-%COMP%]:hover {\n    cursor: pointer !important;\n  }"] });
1682/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NavigationComponent, [{
1683        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
1684        args: [{
1685                selector: "app-navigation",
1686                templateUrl: "./navigation.component.html",
1687            }]
1688    }], function () { return [{ type: _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_1__["NgbModal"] }, { type: _services_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"] }, { type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"] }, { type: _services_cookies_service__WEBPACK_IMPORTED_MODULE_4__["CookiesService"] }]; }, null); })();
1689
1690
1691/***/ }),
1692
1693/***/ "./src/app/shared/helpers/converToSlug.ts":
1694/*!************************************************!*\
1695  !*** ./src/app/shared/helpers/converToSlug.ts ***!
1696  \************************************************/
1697/*! exports provided: default */
1698/***/ (function(module, __webpack_exports__, __webpack_require__) {
1699
1700"use strict";
1701__webpack_require__.r(__webpack_exports__);
1702/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Slug; });
1703class Slug {
1704    static stringToSlug(str) {
1705        if (!!str) {
1706            str = str.replace(/^\s+|\s+$/g, ''); // trim
1707            str = str.toLowerCase();
1708            // remove accents, swap ñ for n, etc
1709            var from = "àáãäâèéëêìíïîòóöôùúüûñç·/_,:;";
1710            var to = "aaaaaeeeeiiiioooouuuunc------";
1711            for (var i = 0, l = from.length; i < l; i++) {
1712                str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
1713            }
1714            str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
1715                .replace(/\s+/g, '-') // collapse whitespace and replace by -
1716                .replace(/-+/g, '-'); // collapse dashes
1717            return str;
1718        }
1719    }
1720}
1721
1722
1723/***/ }),
1724
1725/***/ "./src/app/shared/helpers/roleValidator.ts":
1726/*!*************************************************!*\
1727  !*** ./src/app/shared/helpers/roleValidator.ts ***!
1728  \*************************************************/
1729/*! exports provided: RoleValidator */
1730/***/ (function(module, __webpack_exports__, __webpack_require__) {
1731
1732"use strict";
1733__webpack_require__.r(__webpack_exports__);
1734/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RoleValidator", function() { return RoleValidator; });
1735class RoleValidator {
1736    isAgent(user) {
1737        return user.type === 'Agent';
1738    }
1739    isAgentSecondary(user) {
1740        console.log('user->', user);
1741        return user.type === 'AgentSecondary';
1742    }
1743    isAdmin(user) {
1744        return user.type === 'SuperAdmin';
1745    }
1746}
1747
1748
1749/***/ }),
1750
1751/***/ "./src/app/shared/services/agency.service.ts":
1752/*!***************************************************!*\
1753  !*** ./src/app/shared/services/agency.service.ts ***!
1754  \***************************************************/
1755/*! exports provided: AgencyService */
1756/***/ (function(module, __webpack_exports__, __webpack_require__) {
1757
1758"use strict";
1759__webpack_require__.r(__webpack_exports__);
1760/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgencyService", function() { return AgencyService; });
1761/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
1762/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
1763/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js");
1764/* harmony import */ var _angular_fire_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/fire/auth */ "./node_modules/@angular/fire/__ivy_ngcc__/auth/es2015/index.js");
1765/* harmony import */ var _angular_fire_storage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/fire/storage */ "./node_modules/@angular/fire/__ivy_ngcc__/storage/es2015/index.js");
1766/* harmony import */ var ngx_toastr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ngx-toastr */ "./node_modules/ngx-toastr/__ivy_ngcc__/fesm2015/ngx-toastr.js");
1767/* harmony import */ var src_environments_environment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/environments/environment */ "./src/environments/environment.ts");
1768/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
1769/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_7__);
1770/* harmony import */ var _enums_state_payment_enum__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../enums/state-payment.enum */ "./src/app/shared/enums/state-payment.enum.ts");
1771/* harmony import */ var _enums_state_reservation_enum__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../enums/state-reservation.enum */ "./src/app/shared/enums/state-reservation.enum.ts");
1772/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
1773/* harmony import */ var _logs_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./logs.service */ "./src/app/shared/services/logs.service.ts");
1774/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js");
1775var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
1776    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1777    return new (P || (P = Promise))(function (resolve, reject) {
1778        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1779        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1780        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1781        step((generator = generator.apply(thisArg, _arguments || [])).next());
1782    });
1783};
1784/* eslint-disable @typescript-eslint/no-unused-vars */
1785/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806const { clean } = __webpack_require__(/*! rut.js */ "./node_modules/rut.js/index.js");
1807const _ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
1808class AgencyService {
1809    constructor(firestore, storage, afAuth, toastr, logsService, http) {
1810        this.firestore = firestore;
1811        this.storage = storage;
1812        this.afAuth = afAuth;
1813        this.toastr = toastr;
1814        this.logsService = logsService;
1815        this.http = http;
1816        this.empresas$ = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](null);
1817        this.getAgenciesByText = () => this.firestore.collection('agency').snapshotChanges();
1818        this.getEmpresas$ = () => this.empresas$.asObservable();
1819        this.getEmpresas = () => this.firestore
1820            .collection('agency', (ref) => ref.where('isActive', '==', true))
1821            .snapshotChanges();
1822        this.getEmpresaId = (id) => this.firestore.collection('agency').doc(id).snapshotChanges();
1823        this.agenciesCollection = firestore.collection('agency');
1824        this.agencies = this.agenciesCollection.valueChanges();
1825    }
1826    getAgencies() {
1827        return this.firestore
1828            .collection('agency', (ref) => ref.where('isActive', '==', true).orderBy('name', 'asc'))
1829            .valueChanges();
1830    }
1831    getAgenciesByAgent(agency) {
1832        try {
1833            return this.firestore
1834                .collection('agency', (ref) => ref.where('isActive', '==', true).where('key', '==', agency))
1835                .valueChanges();
1836        }
1837        catch (err) {
1838            return err;
1839        }
1840    }
1841    getAgency(agencyId) {
1842        return this.firestore.doc('agency/' + agencyId).valueChanges();
1843    }
1844    deleteAgency(agencyId) {
1845        this.agencyDoc = this.firestore.doc('agency/' + agencyId);
1846        const agencyDelete = {
1847            isActive: false
1848        };
1849        this.agencyDoc
1850            .update(agencyDelete)
1851            .then((res) => {
1852            console.log(res);
1853            return true;
1854        })
1855            .catch((err) => {
1856            console.log(err);
1857            return false;
1858        });
1859    }
1860    addAgency(agency, logo) {
1861        return new Promise((resolve, reject) => {
1862            this.agenciesCollection
1863                .add(agency)
1864                .then((res) => {
1865                this.agencyDoc = this.firestore.doc('agency/' + res.id);
1866                agency.key = res.id;
1867                // const randomId = Math.random().toString(36).substring(2);
1868                const ref = this.storage.ref('agencies/' + res.id);
1869                const task = ref.put(logo).then((rr) => {
1870                    rr.ref.getDownloadURL().then((refDown) => {
1871                        agency.logo = refDown;
1872                        this.agencyDoc.update(agency);
1873                    });
1874                });
1875                // Add collections neccesary
1876                const dummyExp = {
1877                    key: 'string',
1878                    name: 'string',
1879                    description: 'string',
1880                    meetingPoint: 'string',
1881                    included: 'object',
1882                    equipmentRequired: 'object',
1883                    dateInit: 'string',
1884                    dateEnd: 'string',
1885                    dificulty: 'string',
1886                    location: 'string',
1887                    valuePerPerson: 'number',
1888                    principalImage: 'string',
1889                    linkVideo: '',
1890                    weeklySemanal: '',
1891                    periodicity: '',
1892                    duration: 'number',
1893                    createdAt: 'string',
1894                    isActive: false
1895                };
1896                this.agencyDoc.collection('experiences').add(dummyExp);
1897                resolve(true);
1898            })
1899                .catch((err) => {
1900                reject(err);
1901            });
1902        });
1903    }
1904    updateLogo(logo, agency) {
1905        return new Promise((resolve, reject) => {
1906            const ref = this.storage.ref('agencies/' + agency.key);
1907            const task = ref.put(logo).then((rr) => {
1908                rr.ref.getDownloadURL().then((refDown) => {
1909                    agency.logo = refDown;
1910                    this.firestore
1911                        .doc(`agency/${agency.key}`)
1912                        .update({
1913                        logo: refDown,
1914                        "settings.logo": refDown,
1915                    })
1916                        .then(() => {
1917                        resolve(true);
1918                    })
1919                        .then((err) => {
1920                        reject(err);
1921                    });
1922                });
1923            });
1924        });
1925    }
1926    updateBanner(banner, agency) {
1927        return new Promise((resolve, reject) => {
1928            const ref = this.storage.ref('agencies/' + agency.key + '/banner');
1929            const task = ref.put(banner).then((rr) => {
1930                rr.ref.getDownloadURL().then((refDown) => {
1931                    this.firestore
1932                        .doc(`agency/${agency.key}`)
1933                        .update({
1934                        "settings.banner.url": refDown,
1935                    })
1936                        .then(() => {
1937                        resolve(true);
1938                    })
1939                        .then((err) => {
1940                        reject(err);
1941                    });
1942                });
1943            });
1944        });
1945    }
1946    updateAgency(agency, key) {
1947        return new Promise((resolve, reject) => {
1948            this.agencyDoc = this.firestore.doc(`agency/${key}`);
1949            this.agencyDoc
1950                .update(agency)
1951                .then(() => {
1952                resolve(true);
1953                this.logsService.dataHistory(key, null, null, null, 'PUT', agency);
1954            })
1955                .catch((err) => {
1956                reject(err);
1957            });
1958        });
1959    }
1960    getDefaultTexts(type) {
1961        return this.firestore
1962            .collection('defaultText', (ref) => ref.where('type', '==', type))
1963            .valueChanges();
1964    }
1965    // DESTINATIONS
1966    getDestinationsByAgency(agency) {
1967        return this.firestore
1968            .collection('agency/' + agency + '/destinations')
1969            .valueChanges()
1970            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["map"])((destinations) => destinations.map(destination => destination.name)));
1971    }
1972    getDestinations(agency) {
1973        return this.firestore
1974            .collection(`agency/${agency}/destinations`)
1975            .valueChanges();
1976    }
1977    addDestination(agencyId, destination) {
1978        this.destinationCollection = this.firestore.collection(`agency/${agencyId}/destinations`);
1979        return new Promise((resolve, reject) => {
1980            this.destinationCollection
1981                .add(destination)
1982                .then((res) => {
1983                this.destinationDoc = this.firestore.doc(`agency/${agencyId}/destinations/${res.id}`);
1984                destination.key = res.id;
1985                this.destinationDoc.update(destination);
1986                resolve('ADD_DESTINATION');
1987            })
1988                .catch(() => {
1989                reject('ERROR_DESTINATION');
1990            });
1991        });
1992    }
1993    deleteDestination(agencyId, destination, experienceId) {
1994        this.destinationDoc = this.firestore.doc('agency/' + agencyId + '/destinations/' + destination.key);
1995        return new Promise((resolve, reject) => {
1996            this.destinationDoc.valueChanges().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1)).subscribe(destination => {
1997                //Está condicion sirve para el formulario de creacion
1998                if (destination.experiences.length > 1) {
1999                    //Verificación del destino si es que es usado en más de una experiencia
2000                    reject('DESTINATION_IS_IN_USED');
2001                }
2002                else if (experienceId && destination.experiences.length === 1 && destination.experiences[0] !== experienceId) {
2003                    //Verificación del destino si es que es usado en otra experiencia
2004                    reject('DESTINATION_IS_IN_USED');
2005                }
2006                else if (!experienceId && destination.experiences.length === 1) {
2007                    reject('DESTINATION_IS_IN_USED');
2008                }
2009                else {
2010                    this.destinationDoc
2011                        .delete()
2012                        .then(() => {
2013                        resolve('DESTINATION_REMOVED');
2014                    })
2015                        .catch(error => {
2016                        reject(error);
2017                    });
2018                }
2019            });
2020        });
2021    }
2022    destinationExperiences(agencyId, destinationId) {
2023        return __awaiter(this, void 0, void 0, function* () {
2024            const destination = this.firestore.doc('agency/' + agencyId + '/destinations/' + destinationId).valueChanges().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1));
2025            return destination;
2026        });
2027    }
2028    // ADDONS
2029    getAddons(agency) {
2030        return this.firestore
2031            .collection(`agency/${agency}/addons`, (ref) => ref.where('isActive', '==', true))
2032            .valueChanges();
2033    }
2034    addAddon(agency, addOn) {
2035        this.addOnsCollection = this.firestore.collection(`agency/${agency}/addons`);
2036        return new Promise((resolve, reject) => {
2037            this.addOnsCollection
2038                .add(addOn)
2039                .then((res) => {
2040                this.addOnDoc = this.firestore.doc(`agency/${agency}/addons/${res.id}`);
2041                addOn.key = res.id;
2042                this.addOnDoc.update(addOn);
2043                resolve('ADD_ADDON');
2044            })
2045                .catch(() => {
2046                reject('ERROR_ADDON');
2047            });
2048        });
2049    }
2050    deleteAddOn(agencyId, addon) {
2051        this.addOnDoc = this.firestore.doc('agency/' + agencyId + '/addons/' + addon.key);
2052        const addOnDelete = {
2053            isActive: false
2054        };
2055        this.addOnDoc
2056            .update(addOnDelete)
2057            .then(() => {
2058            return true;
2059        })
2060            .catch(() => {
2061            return false;
2062        });
2063    }
2064    //SALES
2065    getAllSales(data) {
2066        return new Promise((resolve, reject) => {
2067            const url = `${src_environments_environment__WEBPACK_IMPORTED_MODULE_6__["environment"].urlApiSales}/all`;
2068            axios__WEBPACK_IMPORTED_MODULE_7___default()({
2069                method: 'POST',
2070                url,
2071                data,
2072                headers: { 'Content-Type': 'application/json' }
2073            })
2074                .then((res) => {
2075                resolve(res);
2076            })
2077                .catch((err) => {
2078                reject(err);
2079            });
2080        });
2081    }
2082    //SALES BY AGENCY
2083    getSalesAgency(data) {
2084        return new Promise((resolve, reject) => {
2085            const url = `${src_environments_environment__WEBPACK_IMPORTED_MODULE_6__["environment"].urlApiSales}/agency`;
2086            axios__WEBPACK_IMPORTED_MODULE_7___default()({
2087                method: 'POST',
2088                url,
2089                data,
2090                headers: { 'Content-Type': 'application/json' }
2091            })
2092                .then((res) => {
2093                resolve(res);
2094            })
2095                .catch((err) => {
2096                reject(err);
2097            });
2098        });
2099    }
2100    getReservations() {
2101        return this.firestore
2102            .collectionGroup('reservation', (ref) => ref
2103            .where('paymentStatus', '==', _enums_state_payment_enum__WEBPACK_IMPORTED_MODULE_8__["StatePaymentReservation"].PAYMENT_SUCCESS)
2104            .where('status', '==', _enums_state_reservation_enum__WEBPACK_IMPORTED_MODULE_9__["StateReservation"].PAID_OUT))
2105            .snapshotChanges()
2106            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["map"])((actions) => actions.map((a) => {
2107            const data = a.payload.doc.data();
2108            const agencyKey = this.getAgencyKey(a.payload.doc.ref.path);
2109            return Object.assign({ agencyKey }, data);
2110        })));
2111    }
2112    getReservationsObs() {
2113        return this.firestore
2114            .collectionGroup('reservation', (ref) => ref
2115            .where('paymentStatus', '==', _enums_state_payment_enum__WEBPACK_IMPORTED_MODULE_8__["StatePaymentReservation"].PAYMENT_SUCCESS)
2116            .where('status', '==', _enums_state_reservation_enum__WEBPACK_IMPORTED_MODULE_9__["StateReservation"].PAID_OUT))
2117            .snapshotChanges()
2118            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["map"])((actions) => actions.map((a) => {
2119            const data = a.payload.doc.data();
2120            const agencyKey = this.getAgencyKey(a.payload.doc.ref.path);
2121            const month = data.createdAt.split(' ')[0].split('-')[1];
2122            const date = new Date(data.createdAt.split(' ')[0]);
2123            const year = data.createdAt.split(' ')[0].split('-')[0];
2124            return Object.assign({ agencyKey, month, date, year }, data);
2125        })), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["map"])((data) => {
2126            const total = Object.values(data.reduce((acc, { agencyKey, month, year, date, finalPrice }) => {
2127                finalPrice = +finalPrice; // convert to number
2128                const key = agencyKey + '_' + month + '_' + year; // unique combination of id and subject
2129                this.getAgency(agencyKey)
2130                    .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1))
2131                    .subscribe((v) => {
2132                    if (v.key === agencyKey) {
2133                        acc[key].name = v.name;
2134                    }
2135                });
2136                acc[key] = acc[key] || {
2137                    agencyKey,
2138                    month,
2139                    year,
2140                    date,
2141                    finalPrice: 0
2142                };
2143                acc[key].finalPrice += finalPrice;
2144                return acc;
2145            }, {}));
2146            return _.sortBy(Object.keys(total).map((id) => total[id]), ['date', 'name']);
2147        }));
2148    }
2149    getNameAgency(agencyKey) {
2150        return __awaiter(this, void 0, void 0, function* () {
2151            let agencyName = '';
2152            yield this.getAgency(agencyKey)
2153                .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["take"])(1))
2154                .subscribe((v) => {
2155                agencyName = v.name;
2156            });
2157            return agencyName;
2158        });
2159    }
2160    getAgencyKey(path) {
2161        const key = path.split('/')[1];
2162        return key;
2163    }
2164    recoveryPass(email) {
2165        return new Promise((resolve, reject) => {
2166            this.afAuth.auth
2167                .sendPasswordResetEmail(email)
2168                .then(() => {
2169                resolve(true);
2170            })
2171                .catch((err) => {
2172                reject(err);
2173            });
2174        });
2175    }
2176    isActualUser(email) {
2177        return new Promise((resolve, reject) => {
2178            this.afAuth.auth
2179                .fetchSignInMethodsForEmail(email)
2180                .then((res) => {
2181                resolve(res);
2182            })
2183                .catch((err) => {
2184                reject(err);
2185            });
2186        });
2187    }
2188    isBookExists(agencyId) {
2189        return new Promise((resolve, reject) => {
2190            this.firestore
2191                .collection('agency/' + agencyId + '/book')
2192                .get()
2193                .subscribe(querySnapshot => {
2194                if (!querySnapshot.empty) {
2195                    resolve(true); // La colección 'book' tiene al menos un documento
2196                }
2197                else {
2198                    resolve(false); // La colección 'book' está vacía
2199                }
2200            }, error => {
2201                reject(error); // Ocurrió un error al obtener la colección
2202            });
2203        });
2204    }
2205    addBook(agencyId, book) {
2206        return new Promise((resolve, rejected) => {
2207            this.firestore.collection('agency/' + agencyId + '/book')
2208                .add(book)
2209                .then((docRef) => {
2210                docRef.update({ key: docRef.id })
2211                    .then(() => {
2212                    resolve();
2213                })
2214                    .catch((error) => {
2215                    rejected(error);
2216                });
2217            })
2218                .catch((error) => {
2219                rejected(error);
2220            });
2221        });
2222    }
2223    getBook(agencyId) {
2224        return this.firestore
2225            .collection('agency/' + agencyId + '/book')
2226            .valueChanges();
2227    }
2228    updateBook(agencyId, bookId, book) {
2229        return new Promise((resolve, reject) => {
2230            this.firestore.doc('agency/' + agencyId + '/book/' + bookId)
2231                .update(book)
2232                .then(() => {
2233                resolve(); // Resuelve la promesa si la actualización es exitosa
2234            })
2235                .catch((error) => {
2236                reject(error); // Rechaza la promesa en caso de error
2237            });
2238        });
2239    }
2240    addMemberImage(memberImage, agencyId, index) {
2241        return new Promise((resolve, reject) => {
2242            const ref = this.storage.ref(`agencies/${agencyId}/agencyMembers/${index}`);
2243            const task = ref.put(memberImage).then((rr) => {
2244                rr.ref.getDownloadURL().then((refDown) => {
2245                    resolve(refDown); // Resolvemos con la URL de descarga
2246                });
2247            });
2248        });
2249    }
2250    //Consulta a la API web para que ejecute la actualización de los datos de la agencia
2251    updateAgencyWebsite(agencyId) {
2252        this.firestore.doc('agency/' + agencyId)
2253            .valueChanges()
2254            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["map"])((agency) => { var _a; return ((_a = agency) === null || _a === void 0 ? void 0 : _a.web) || ''; }) // Si agency.web no existe, devuelve un string vacío
2255        ).subscribe((web) => {
2256            this.http.post(web + '/wp-json/heyandes/v1/agency?agency_key=' + agencyId, {}).subscribe(() => {
2257                console.log('Datos de agencia actualizada en la web');
2258            }, (error) => {
2259                console.error('Error en la solicitud HTTP:', error);
2260            });
2261        });
2262    }
2263    //Consulta a la API web para que ejecute la actualización del cuaderno
2264    updateBookWebsite(agencyId) {
2265        this.firestore.doc('agency/' + agencyId)
2266            .valueChanges()
2267            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["map"])((agency) => { var _a; return ((_a = agency) === null || _a === void 0 ? void 0 : _a.web) || ''; }) // Si agency.web no existe, devuelve un string vacío
2268        ).subscribe((web) => {
2269            console.log(web + '/wp-json/heyandes/v1/book?agency_key=' + agencyId);
2270            this.http.post(web + '/wp-json/heyandes/v1/book?agency_key=' + agencyId, {}).subscribe(() => {
2271                console.log('Cuaderno actualizado en la web');
2272            }, (error) => {
2273                console.error('Error en la solicitud HTTP:', error);
2274            });
2275        });
2276    }
2277    bookPreview(template, colors) {
2278        return this.http.post(template + 'wp-json/heyandes/v1/bookpreview', colors);
2279    }
2280    sendRackResponse(agencyId, userEmail, showRack) {
2281        this.firestore.doc('agency/' + agencyId)
2282            .valueChanges()
2283            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["map"])((agency) => { var _a; return ((_a = agency) === null || _a === void 0 ? void 0 : _a.web) || ''; }) // Si agency.web no existe, devuelve un string vacío
2284        ).subscribe((web) => {
2285            this.http.post(web + '/wp-json/heyandes/v1/rack?user_email=' + userEmail + '&show_rack=' + showRack, {}).subscribe(() => {
2286                console.log('Respuesta a solicitud flate rate enviada');
2287            }, (error) => {
2288                console.error('Error en la solicitud HTTP:', error);
2289            });
2290        });
2291    }
2292    blockTourOperator(agencyId, userEmail, block) {
2293        this.firestore.doc('agency/' + agencyId)
2294            .valueChanges()
2295            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_10__["map"])((agency) => { var _a; return ((_a = agency) === null || _a === void 0 ? void 0 : _a.web) || ''; }) // Si agency.web no existe, devuelve un string vacío
2296        ).subscribe((web) => {
2297            this.http.post(web + '/wp-json/heyandes/v1/block_user?agency_key=' + agencyId + '&user_email=' + userEmail + '&block=' + block, {}).subscribe(() => {
2298                console.log('Respuesta a solicitud flate rate enviada');
2299            }, (error) => {
2300                console.error('Error en la solicitud HTTP:', error);
2301            });
2302        });
2303    }
2304    //ADD INTEGRATION MERCADOPAGO
2305    mercadoPagoIntegration(config, agency) {
2306        return new Promise((resolve, reject) => {
2307            this.firestore
2308                .doc('agency/' + agency)
2309                .update({
2310                accessTokenMP: config
2311            })
2312                .then(() => {
2313                resolve(true);
2314            })
2315                .catch((err) => {
2316                reject(err);
2317            });
2318        });
2319    }
2320}
2321AgencyService.ɵfac = function AgencyService_Factory(t) { return new (t || AgencyService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_storage__WEBPACK_IMPORTED_MODULE_4__["AngularFireStorage"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_auth__WEBPACK_IMPORTED_MODULE_3__["AngularFireAuth"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](ngx_toastr__WEBPACK_IMPORTED_MODULE_5__["ToastrService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_logs_service__WEBPACK_IMPORTED_MODULE_11__["LogsService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common_http__WEBPACK_IMPORTED_MODULE_12__["HttpClient"])); };
2322AgencyService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: AgencyService, factory: AgencyService.ɵfac, providedIn: 'root' });
2323/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AgencyService, [{
2324        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
2325        args: [{
2326                providedIn: 'root'
2327            }]
2328    }], function () { return [{ type: _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"] }, { type: _angular_fire_storage__WEBPACK_IMPORTED_MODULE_4__["AngularFireStorage"] }, { type: _angular_fire_auth__WEBPACK_IMPORTED_MODULE_3__["AngularFireAuth"] }, { type: ngx_toastr__WEBPACK_IMPORTED_MODULE_5__["ToastrService"] }, { type: _logs_service__WEBPACK_IMPORTED_MODULE_11__["LogsService"] }, { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_12__["HttpClient"] }]; }, null); })();
2329
2330
2331/***/ }),
2332
2333/***/ "./src/app/shared/services/auth.service.ts":
2334/*!*************************************************!*\
2335  !*** ./src/app/shared/services/auth.service.ts ***!
2336  \*************************************************/
2337/*! exports provided: AuthService */
2338/***/ (function(module, __webpack_exports__, __webpack_require__) {
2339
2340"use strict";
2341__webpack_require__.r(__webpack_exports__);
2342/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AuthService", function() { return AuthService; });
2343/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
2344/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
2345/* harmony import */ var _angular_fire_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/fire/auth */ "./node_modules/@angular/fire/__ivy_ngcc__/auth/es2015/index.js");
2346/* harmony import */ var src_environments_environment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/environments/environment */ "./src/environments/environment.ts");
2347/* harmony import */ var _cookies_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cookies.service */ "./src/app/shared/services/cookies.service.ts");
2348/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
2349/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
2350/* harmony import */ var _helpers_roleValidator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/roleValidator */ "./src/app/shared/helpers/roleValidator.ts");
2351/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js");
2352/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
2353/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_9__);
2354var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
2355    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2356    return new (P || (P = Promise))(function (resolve, reject) {
2357        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2358        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2359        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2360        step((generator = generator.apply(thisArg, _arguments || [])).next());
2361    });
2362};
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379class AuthService extends _helpers_roleValidator__WEBPACK_IMPORTED_MODULE_7__["RoleValidator"] {
2380    constructor(afAuth, coockServ, router, fs, cookiesApi) {
2381        super();
2382        this.afAuth = afAuth;
2383        this.coockServ = coockServ;
2384        this.router = router;
2385        this.fs = fs;
2386        this.cookiesApi = cookiesApi;
2387        this.isTypeLogin = null;
2388        this.isSuperAdmin = null;
2389        // public isAgent: any = null;
2390        this.isAgentSecundary = null;
2391        this.uid = null;
2392        this.typeUser = null;
2393        this.user$ = this.afAuth.authState.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["switchMap"])((user) => {
2394            if (user) {
2395                return this.fs.doc(`admins/${user.uid}`).valueChanges();
2396            }
2397            return Object(rxjs__WEBPACK_IMPORTED_MODULE_8__["of"])(null);
2398        }));
2399    }
2400    singIn(email, password) {
2401        return __awaiter(this, void 0, void 0, function* () {
2402            try {
2403                const { user } = yield this.afAuth.auth.signInWithEmailAndPassword(email, password);
2404                // this.updateUserData(user);
2405                const authData = JSON.parse(JSON.stringify(user));
2406                const accessToken = authData.stsTokenManager.accessToken;
2407                this.coockServ.setCookie(`${src_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].helpers.cookies.name}.claims`, JSON.stringify(user), 1);
2408                this.coockServ.setCookie(`${src_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].helpers.cookies.name}.token`, accessToken, 1);
2409                return user;
2410            }
2411            catch (error) {
2412                return error;
2413            }
2414        });
2415    }
2416    logout() {
2417        return __awaiter(this, void 0, void 0, function* () {
2418            try {
2419                yield this.afAuth.auth.signOut();
2420            }
2421            catch (error) {
2422                console.log(error);
2423            }
2424        });
2425    }
2426    isAuth() {
2427        return this.afAuth.authState.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["map"])((auth) => auth));
2428    }
2429    getSignInToken(user) {
2430        return __awaiter(this, void 0, void 0, function* () {
2431            const tokenReponse = yield axios__WEBPACK_IMPORTED_MODULE_9___default()({
2432                method: 'GET',
2433                url: `${src_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].urlAuth}/auth/${user}`,
2434                headers: { 'Content-Type': 'application/json' }
2435            });
2436            return tokenReponse;
2437        });
2438    }
2439    // public async singIn(email, password) {
2440    //   return new Promise(async (resolve, reject) => {
2441    //     await this.af.auth
2442    //       .signInWithEmailAndPassword(email, password)
2443    //       .then((res) => {
2444    //         const authData = JSON.parse(JSON.stringify(res.user));
2445    //         const accessToken = authData.stsTokenManager.accessToken;
2446    //         this.coockServ.setCookie(
2447    //           `${environment.helpers.cookies.name}.claims`,
2448    //           JSON.stringify(res.user),
2449    //           1
2450    //         );
2451    //         this.coockServ.setCookie(`${environment.helpers.cookies.name}.token`, accessToken, 1);
2452    //         resolve(res);
2453    //       })
2454    //       .catch((err) => reject(err));
2455    //   });
2456    // }
2457    // isLoggedIn() {
2458    //   const sess = this.coockServ.getCookie(`${environment.helpers.cookies.name}.token`);
2459    //   const claims = this.coockServ.getCookie(`${environment.helpers.cookies.name}.claims`);
2460    //   if (sess && claims) {
2461    //     return true;
2462    //   } else {
2463    //     this.router.navigate(["/auth"]);
2464    //     return false;
2465    //   }
2466    // }
2467    // isAuth() {
2468    //   return this.af.authState.pipe(map((auth) => auth));
2469    // }
2470    // isUserAdmin(uid) {
2471    //   return this.fs.doc<AdminAgency>(`admins/${uid}`).valueChanges();
2472    // }
2473    // getCurrentUser() {
2474    //   return new Promise((resolve) => {
2475    //     this.isAuth().subscribe(async (auth) => {
2476    //       if (auth) {
2477    //         this.uid = auth.uid;
2478    //         this.isUserAdmin(this.uid).subscribe((user) => {
2479    //           resolve(user);
2480    //         });
2481    //       }
2482    //     });
2483    //   });
2484    // }
2485    // logOut() {
2486    //   return this.af.auth.signOut().then(() => {
2487    //     this.coockServ.deleteCookie(`${environment.helpers.cookies.name}.token`);
2488    //     this.coockServ.deleteCookie(`${environment.helpers.cookies.name}.claims`);
2489    //     this.router.navigate(["/auth/login"]);
2490    //   });
2491    // }
2492    // isLoggedAdmin() {
2493    //   // this is for the open close
2494    //   this.isAuth().subscribe((auth) => {
2495    //     if (auth) {
2496    //       this.uid = auth.uid;
2497    //       this.isUserAdmin(this.uid).subscribe((userRole) => {
2498    //         this.isSuperAdmin = Object.assign({}, userRole.roles).hasOwnProperty("superadmin");
2499    //       });
2500    //     }
2501    //   });
2502    //   return this.isSuperAdmin;
2503    // }
2504    // async getRolUser() {
2505    //   return new Promise((resolve) => {
2506    //     this.isAuth().subscribe(async (auth) => {
2507    //       if (auth) {
2508    //         this.uid = auth.uid;
2509    //         await this.isUserAdmin(this.uid).subscribe((userRole) => {
2510    //           const rol = Object.assign({}, userRole.roles);
2511    //           let type = "";
2512    //           if (rol.hasOwnProperty("superadmin")) {
2513    //             type = "SUPERADMIN";
2514    //           } else if (rol.hasOwnProperty("agent")) {
2515    //             type = "AGENT";
2516    //           } else if (rol.hasOwnProperty("agentSecondary")) {
2517    //             type = "AGENTSECONDARY";
2518    //           } else if (rol.hasOwnProperty("agency")) {
2519    //             type = "AGENCY";
2520    //           }
2521    //           resolve(type);
2522    //         });
2523    //       }
2524    //     });
2525    //   });
2526    //}
2527    //
2528    resetPassword(emailUser) {
2529        return __awaiter(this, void 0, void 0, function* () {
2530            try {
2531                yield this.afAuth.auth.sendPasswordResetEmail(emailUser);
2532                return { sendEmail: true };
2533            }
2534            catch (err) {
2535                return { sendEmail: false, error: err };
2536            }
2537        });
2538    }
2539}
2540AuthService.ɵfac = function AuthService_Factory(t) { return new (t || AuthService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_auth__WEBPACK_IMPORTED_MODULE_2__["AngularFireAuth"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_cookies_service__WEBPACK_IMPORTED_MODULE_4__["CookiesService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_router__WEBPACK_IMPORTED_MODULE_5__["Router"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_cookies_service__WEBPACK_IMPORTED_MODULE_4__["CookiesService"])); };
2541AuthService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: AuthService, factory: AuthService.ɵfac, providedIn: 'root' });
2542/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AuthService, [{
2543        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
2544        args: [{
2545                providedIn: 'root'
2546            }]
2547    }], function () { return [{ type: _angular_fire_auth__WEBPACK_IMPORTED_MODULE_2__["AngularFireAuth"] }, { type: _cookies_service__WEBPACK_IMPORTED_MODULE_4__["CookiesService"] }, { type: _angular_router__WEBPACK_IMPORTED_MODULE_5__["Router"] }, { type: _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"] }, { type: _cookies_service__WEBPACK_IMPORTED_MODULE_4__["CookiesService"] }]; }, null); })();
2548
2549
2550/***/ }),
2551
2552/***/ "./src/app/shared/services/cookies.service.ts":
2553/*!****************************************************!*\
2554  !*** ./src/app/shared/services/cookies.service.ts ***!
2555  \****************************************************/
2556/*! exports provided: CookiesService */
2557/***/ (function(module, __webpack_exports__, __webpack_require__) {
2558
2559"use strict";
2560__webpack_require__.r(__webpack_exports__);
2561/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CookiesService", function() { return CookiesService; });
2562/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
2563
2564
2565class CookiesService {
2566    constructor() {
2567    }
2568    getCookie(cname) {
2569        const name = cname + "=";
2570        const decodedCookie = decodeURIComponent(document.cookie);
2571        const ca = decodedCookie.split(";");
2572        for (let i = 0; i < ca.length; i++) {
2573            let c = ca[i];
2574            while (c.charAt(0) === " ") {
2575                c = c.substring(1);
2576            }
2577            if (c.indexOf(name) === 0) {
2578                return c.substring(name.length, c.length);
2579            }
2580        }
2581        return "";
2582    }
2583    setCookie(cname, cvalue, exdays) {
2584        const d = new Date();
2585        d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
2586        const expires = "expires=" + d.toUTCString();
2587        document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
2588    }
2589    deleteCookie(name) {
2590        this.setCookie(name, "", -1);
2591        // document.cookie = + name + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
2592    }
2593    setStorage(cname, cvalue) {
2594        window.localStorage.setItem(cname, cvalue);
2595    }
2596    getStorage(cname) {
2597        return window.localStorage.getItem(cname);
2598    }
2599    clearStorage(cname) {
2600        // return window.localStorage.getItem(cname);
2601        return window.localStorage.removeItem(cname);
2602    }
2603}
2604CookiesService.ɵfac = function CookiesService_Factory(t) { return new (t || CookiesService)(); };
2605CookiesService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: CookiesService, factory: CookiesService.ɵfac, providedIn: "root" });
2606/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CookiesService, [{
2607        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
2608        args: [{
2609                providedIn: "root",
2610            }]
2611    }], function () { return []; }, null); })();
2612
2613
2614/***/ }),
2615
2616/***/ "./src/app/shared/services/email-notifications.service.ts":
2617/*!****************************************************************!*\
2618  !*** ./src/app/shared/services/email-notifications.service.ts ***!
2619  \****************************************************************/
2620/*! exports provided: EmailNotificationService */
2621/***/ (function(module, __webpack_exports__, __webpack_require__) {
2622
2623"use strict";
2624__webpack_require__.r(__webpack_exports__);
2625/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmailNotificationService", function() { return EmailNotificationService; });
2626/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
2627/* harmony import */ var _email_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./email.service */ "./src/app/shared/services/email.service.ts");
2628/* harmony import */ var _auth_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./auth.service */ "./src/app/shared/services/auth.service.ts");
2629/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
2630/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
2631/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
2632/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
2633/* harmony import */ var ngx_toastr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ngx-toastr */ "./node_modules/ngx-toastr/__ivy_ngcc__/fesm2015/ngx-toastr.js");
2634var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
2635    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2636    return new (P || (P = Promise))(function (resolve, reject) {
2637        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2638        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2639        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2640        step((generator = generator.apply(thisArg, _arguments || [])).next());
2641    });
2642};
2643// email-notification.service.ts
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659class EmailNotificationService {
2660    constructor(emailService, authApi, route, afs, fb, toastr) {
2661        this.emailService = emailService;
2662        this.authApi = authApi;
2663        this.route = route;
2664        this.afs = afs;
2665        this.fb = fb;
2666        this.toastr = toastr;
2667        this.lastMessageId = [];
2668        this.email = this.fb.group({
2669            from: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required]],
2670            to: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required, this.emailListValidator()]],
2671            cco: [''],
2672            cc: [''],
2673            body: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required]],
2674            subject: ['', [_angular_forms__WEBPACK_IMPORTED_MODULE_6__["Validators"].required]],
2675        });
2676    }
2677    checkUnreadMessages() {
2678        return __awaiter(this, void 0, void 0, function* () {
2679            const user = yield this.authApi.user$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1)).toPromise();
2680            if (!user) {
2681                return;
2682            }
2683            this.email.controls['from'].setValue(user.email.toLowerCase());
2684            const funnelQuerySnapshot = yield this.afs.collection(`agency/${user.agency}/funnel`).get().toPromise();
2685            const promises = [];
2686            for (const doc of funnelQuerySnapshot.docs) {
2687                this.idDeal = doc.id;
2688                const splitMail = user.email.split('@');
2689                this.email.controls['cc'].setValue(`${splitMail[0]}+${this.idDeal}@${splitMail[1]}`);
2690                this.res = Object.assign(Object.assign({ id: doc.id }, doc.data()), { path: doc.ref.path });
2691                this.email.get('to').setValue(this.res.contact.email.toLowerCase());
2692                promises.push(this.getIfExist(user.agency), this.emailService.getMails(user, this.res.path, this.email, this.idDeal, this.refreshToken));
2693            }
2694            // Wait for all promises to resolve
2695            yield Promise.all(promises).then(() => __awaiter(this, void 0, void 0, function* () {
2696                // After promises are resolved, check unread messages
2697                yield this.checkUnreadMessagesSpecificLogic(funnelQuerySnapshot);
2698            }));
2699        });
2700    }
2701    checkUnreadMessagesSpecificLogic(funnelQuerySnapshot) {
2702        return __awaiter(this, void 0, void 0, function* () {
2703            for (const doc of funnelQuerySnapshot.docs) {
2704                const historyRef = doc.ref.collection('history');
2705                const unreadMessagesQuery = historyRef.where('read', '==', false);
2706                const unreadMessagesSnapshot = yield unreadMessagesQuery.get();
2707                if (!unreadMessagesSnapshot.empty) {
2708                    this.toastr.warning('Tienes mensajes sin leer en Funnel', 'Alerta!');
2709                }
2710            }
2711        });
2712    }
2713    getIfExist(agency) {
2714        return __awaiter(this, void 0, void 0, function* () {
2715            yield this.afs.collection(`agency/${agency}/settings_gmail`)
2716                .get()
2717                .forEach(docs => {
2718                var _a, _b, _c, _d;
2719                this.isGmailSettings = docs.empty;
2720                this.token = (_b = (_a = docs.docs[0]) === null || _a === void 0 ? void 0 : _a.data()) === null || _b === void 0 ? void 0 : _b.access_token;
2721                this.refreshToken = (_d = (_c = docs.docs[0]) === null || _c === void 0 ? void 0 : _c.data()) === null || _d === void 0 ? void 0 : _d.refresh_token;
2722            });
2723        });
2724    }
2725    emailListValidator() {
2726        return (control) => {
2727            const emails = control.value.split(',');
2728            const emailRegex = /\S+@\S+\.\S+/;
2729            for (let i = 0; i < emails.length; i++) {
2730                if (!emailRegex.test(emails[i].trim())) {
2731                    return { invalidEmail: true };
2732                }
2733            }
2734            return null;
2735        };
2736    }
2737}
2738EmailNotificationService.ɵfac = function EmailNotificationService_Factory(t) { return new (t || EmailNotificationService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_email_service__WEBPACK_IMPORTED_MODULE_1__["EmailService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_router__WEBPACK_IMPORTED_MODULE_4__["ActivatedRoute"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_firestore__WEBPACK_IMPORTED_MODULE_5__["AngularFirestore"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_forms__WEBPACK_IMPORTED_MODULE_6__["FormBuilder"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](ngx_toastr__WEBPACK_IMPORTED_MODULE_7__["ToastrService"])); };
2739EmailNotificationService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: EmailNotificationService, factory: EmailNotificationService.ɵfac, providedIn: 'root' });
2740/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](EmailNotificationService, [{
2741        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
2742        args: [{
2743                providedIn: 'root',
2744            }]
2745    }], function () { return [{ type: _email_service__WEBPACK_IMPORTED_MODULE_1__["EmailService"] }, { type: _auth_service__WEBPACK_IMPORTED_MODULE_2__["AuthService"] }, { type: _angular_router__WEBPACK_IMPORTED_MODULE_4__["ActivatedRoute"] }, { type: _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_5__["AngularFirestore"] }, { type: _angular_forms__WEBPACK_IMPORTED_MODULE_6__["FormBuilder"] }, { type: ngx_toastr__WEBPACK_IMPORTED_MODULE_7__["ToastrService"] }]; }, null); })();
2746
2747
2748/***/ }),
2749
2750/***/ "./src/app/shared/services/email.service.ts":
2751/*!**************************************************!*\
2752  !*** ./src/app/shared/services/email.service.ts ***!
2753  \**************************************************/
2754/*! exports provided: EmailService */
2755/***/ (function(module, __webpack_exports__, __webpack_require__) {
2756
2757"use strict";
2758__webpack_require__.r(__webpack_exports__);
2759/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmailService", function() { return EmailService; });
2760/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
2761/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
2762/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
2763/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
2764/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_3__);
2765/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
2766/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_4__);
2767var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
2768    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2769    return new (P || (P = Promise))(function (resolve, reject) {
2770        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2771        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2772        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2773        step((generator = generator.apply(thisArg, _arguments || [])).next());
2774    });
2775};
2776
2777
2778
2779
2780
2781
2782
2783class EmailService {
2784    constructor(afs) {
2785        this.afs = afs;
2786        this.history = [];
2787        this.lastMessageId = [];
2788        this.isButtonDisabled = false;
2789    }
2790    getMails(res, path, passEmail, idDeal, refreshToken) {
2791        return __awaiter(this, void 0, void 0, function* () {
2792            this.userLogged = {
2793                name: res.name,
2794                email: res.email
2795            };
2796            const threadId = yield this.getThreadId(res.agency, idDeal);
2797            // console.log(threadId)
2798            this.threadId = threadId;
2799            if (!!threadId) {
2800                const url = "https://us-central1-heyandes-dev-f736f.cloudfunctions.net/mailtrack/api/mail/read";
2801                const body = Object.assign(Object.assign({}, passEmail.value), { threadId: threadId, refresh_token: refreshToken });
2802                const config = {
2803                    headers: {
2804                        'Content-Type': 'application/json',
2805                    },
2806                    data: body,
2807                };
2808                yield axios__WEBPACK_IMPORTED_MODULE_3___default.a.post(url, {}, config)
2809                    .then((response) => {
2810                    response.data.forEach((element) => __awaiter(this, void 0, void 0, function* () {
2811                        //logica para los mensajes envidos
2812                        if (!!element.payload.body.decoded) {
2813                            const data = element.payload.headers;
2814                            const body = element.payload.body.decoded;
2815                            const email = {
2816                                from: '',
2817                                to: '',
2818                                cco: '',
2819                                cc: '',
2820                                body: body,
2821                                subject: '',
2822                                messageId: '',
2823                                references: '',
2824                                inReplyTo: '',
2825                            };
2826                            data.forEach((emailData) => {
2827                                const name = emailData.name.toLowerCase();
2828                                switch (name) {
2829                                    case 'from':
2830                                        email.from = emailData.value;
2831                                        break;
2832                                    case 'to':
2833                                        email.to = emailData.value;
2834                                        break;
2835                                    case 'cc':
2836                                        email.cc = emailData.value;
2837                                        break;
2838                                    case 'cco':
2839                                        email.cco = emailData.value;
2840                                        break;
2841                                    case 'subject':
2842                                        email.subject = emailData.value;
2843                                        passEmail.controls['subject'].setValue(emailData.value);
2844                                        break;
2845                                    case 'message-id':
2846                                        email.messageId = emailData.value;
2847                                        break;
2848                                    case 'references':
2849                                        email.references = emailData.value;
2850                                        break;
2851                                    case 'in-reply-to':
2852                                        email.inReplyTo = emailData.value;
2853                                        break;
2854                                }
2855                            });
2856                            yield this.afs
2857                                .collection(`${path}/history`)
2858                                .valueChanges()
2859                                .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["first"])(), // Use the first operator to ensure only the first emission is processed
2860                            Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["map"])((emails) => {
2861                                const isEmailDuplicate = emails.some((mail) =>
2861 mail.messageId === element.id || mail.messageId === email.messageId);
2862                                return { isEmailDuplicate, emails };
2863                            }))
2864                                .subscribe(({ isEmailDuplicate, emails }) => __awaiter(this, void 0, void 0, function* () {
2865                                if (isEmailDuplicate) {
2866                                    // Find the document ID of the existing document with the duplicate messageId
2867                                    const existingDocument = emails.find((mail) => mail.messageId === element.id);
2868                                    const existingDocumentId = existingDocument ? existingDocument.documentId : null;
2869                                    // Update the existing document with the new messageId
2870                                    if (existingDocumentId && element.id === threadId) {
2871                                        this.afs
2872                                            .collection(`${path}/history`)
2873                                            .doc(existingDocumentId)
2874                                            .update({
2875                                            messageId: email.messageId,
2876                                        })
2877                                            .then(() => {
2878                                            console.log('Document successfully updated!');
2879                                        })
2880                                            .catch((error) => {
2881                                            console.error('Error updating document: ', error);
2882                                        });
2883                                    }
2884                                    else if (existingDocumentId && element.id !== threadId) {
2885                                        this.afs
2886                                            .collection(`${path}/history`)
2887                                            .doc(existingDocumentId)
2888                                            .update({
2889                                            messageId: email.messageId,
2890                                            references: email.references,
2891                                            inReplyTo: email.inReplyTo,
2892                                        })
2893                                            .then(() => {
2894                                            console.log('Document successfully updated!');
2895                                        })
2896                                            .catch((error) => {
2897                                            console.error('Error updating document: ', error);
2898                                        });
2899                                    }
2900                                }
2901                                else {
2902                                    // Add a new document if no duplicate messageId is found
2903                                    this.afs
2904                                        .collection(`${path}/history`)
2905                                        .add({
2906                                        createdAt: moment__WEBPACK_IMPORTED_MODULE_4__().format('YYYY-MM-DD HH:mm:ss'),
2907                                        user: this.userLogged,
2908                                        action: `de ${email.from} para ${email.to}`,
2909                                        note: email.body,
2910                                        label: email.subject,
2911                                        email: passEmail.value,
2912                                        threadId: element.threadId,
2913                                        messageId: email.messageId,
2914                                        references: email.references,
2915                                        inReplyTo: email.inReplyTo,
2916                                        read: false
2917                                    })
2918                                        .then(() => {
2919                                        console.log('Document successfully added!');
2920                                    })
2921                                        .catch((error) => {
2922                                        console.error('Error adding document: ', error);
2923                                    });
2924                                }
2925                            }));
2926                            // ... Remaining code ...
2927                            // this.afs
2928                            //   .collection(`${path}/history`)
2929                            //   .valueChanges()
2930                            //   .pipe(
2931                            //     map((emails: any[]) => {
2932                            //       const isEmailDuplicate = emails.some(
2933                            //         (mail) =>
2933 mail.messageId === element.id || mail.messageId === email.messageId
2934                            //       );
2935                            //       return { isEmailDuplicate, emails };
2936                            //     })
2937                            //   )
2938                            //   .subscribe(({ isEmailDuplicate, emails }: { isEmailDuplicate: boolean; emails: any[] }) => {
2939                            //     if (isEmailDuplicate) {
2940                            //       // Find the document ID of the existing document with the duplicate messageId
2941                            //       const existingDocument = emails.find((mail) => mail.messageId === element.id);
2942                            //       const existingDocumentId = existingDocument ? existingDocument.documentId : null;
2943                            //       // Update the existing document with the new messageId
2944                            //       if (existingDocumentId && element.id === threadId) {
2945                            //         this.afs
2946                            //           .collection(`${path}/history`)
2947                            //           .doc(existingDocumentId)
2948                            //           .update({
2949                            //             messageId: email.messageId,
2950                            //           })
2951                            //           .then(() => {
2952                            //             console.log('Document successfully updated!');
2953                            //           })
2954                            //           .catch((error) => {
2955                            //             console.error('Error updating document: ', error);
2956                            //           });
2957                            //       } else if (existingDocumentId && element.id !== threadId) {
2958                            //         this.afs
2959                            //           .collection(`${path}/history`)
2960                            //           .doc(existingDocumentId)
2961                            //           .update({
2962                            //             messageId: email.messageId,
2963                            //             references: email.references,
2964                            //             inReplyTo: email.inReplyTo,
2965                            //           })
2966                            //           .then(() => {
2967                            //             console.log('Document successfully updated!');
2968                            //           })
2969                            //           .catch((error) => {
2970                            //             console.error('Error updating document: ', error);
2971                            //           });
2972                            //       }
2973                            //     } else {
2974                            //       // Add a new document if no duplicate messageId is found
2975                            //       this.afs
2976                            //         .collection(`${path}/history`)
2977                            //         .add({
2978                            //           createdAt: moment().format('YYYY-MM-DD HH:mm:ss'),
2979                            //           user: this.userLogged,
2980                            //           action: `de ${email.from} para ${email.to}`,
2981                            //           note: email.body,
2982                            //           label: email.subject,
2983                            //           email: passEmail.value,
2984                            //           threadId: element.threadId,
2985                            //           messageId: email.messageId,
2986                            //           references: email.references,
2987                            //           inReplyTo: email.inReplyTo,
2988                            //           read: false
2989                            //         })
2990                            //         .then(() => {
2991                            //           console.log('Document successfully added!');
2992                            //         })
2993                            //         .catch((error) => {
2994                            //           console.error('Error adding document: ', error);
2995                            //         });
2996                            //     }
2997                            //   });
2998                            // else {
2999                            //   console.log('Se Duplicate email, skipping:', email);
3000                            // }
3001                        }
3002                        else {
3003                            //logica para mensajes recibidos
3004                            const emailRegex = /<([^>]+)>/; // This regex captures the email within angle brackets
3005                            const data = element.payload.headers;
3006                            var body = element.payload.parts[0].body.decoded.split('\r\n')[0];
3007                            const email = {
3008                                from: '',
3009                                to: '',
3010                                cco: '',
3011                                cc: '',
3012                                body: body,
3013                                subject: '',
3014                                messageId: '',
3015                                references: '',
3016                                inReplyTo: '',
3017                            };
3018                            data.forEach((emailData) => {
3019                                const name = emailData.name.toLowerCase(); // Convert name to lowercase for case-insensitivity
3020                                switch (name) {
3021                                    case 'from':
3022                                        email.from = emailData.value.match(emailRegex)[1];
3023                                        break;
3024                                    case 'to':
3025                                        email.to = emailData.value;
3026                                        break;
3027                                    case 'cc':
3028                                        email.cc = emailData.value;
3029                                        break;
3030                                    case 'cco':
3031                                        email.cco = emailData.value;
3032                                        break;
3033                                    case 'subject':
3034                                        email.subject = emailData.value.split(':')[1].trim();
3035                                        break;
3036                                    case 'message-id':
3037                                        email.messageId = emailData.value;
3038                                        break;
3039                                    case 'references':
3040                                        email.references = emailData.value;
3041                                        break;
3042                                    case 'in-reply-to':
3043                                        email.inReplyTo = emailData.value;
3044                                        break;
3045                                }
3046                            });
3047                            yield this.afs
3048                                .collection(`${path}/history`)
3049                                .valueChanges()
3050                                .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["first"])(), // Use the first operator to ensure only the first emission is processed
3051                            Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["map"])((emails) => {
3052                                const isEmailDuplicate = emails.some((mail) =>
3052 mail.messageId === element.id || mail.messageId === email.messageId);
3053                                return { isEmailDuplicate, emails };
3054                            }))
3055                                .subscribe(({ isEmailDuplicate, emails }) => __awaiter(this, void 0, void 0, function* () {
3056                                if (isEmailDuplicate) {
3057                                    // Find the document ID of the existing document with the duplicate messageId
3058                                    const existingDocument = emails.find((mail) => mail.messageId === element.id);
3059                                    const existingDocumentId = existingDocument ? existingDocument.documentId : null;
3060                                    // Update the existing document with the new messageId
3061                                    if (existingDocumentId && element.id === threadId) {
3062                                        this.afs
3063                                            .collection(`${path}/history`)
3064                                            .doc(existingDocumentId)
3065                                            .update({
3066                                            messageId: email.messageId,
3067                                        })
3068                                            .then(() => {
3069                                            console.log('Document successfully updated!');
3070                                        })
3071                                            .catch((error) => {
3072                                            console.error('Error updating document: ', error);
3073                                        });
3074                                    }
3075                                    else if (existingDocumentId && element.id !== threadId) {
3076                                        this.afs
3077                                            .collection(`${path}/history`)
3078                                            .doc(existingDocumentId)
3079                                            .update({
3080                                            messageId: email.messageId,
3081                                            references: email.references,
3082                                            inReplyTo: email.inReplyTo,
3083                                        })
3084                                            .then(() => {
3085                                            console.log('Document successfully updated!');
3086                                        })
3087                                            .catch((error) => {
3088                                            console.error('Error updating document: ', error);
3089                                        });
3090                                    }
3091                                }
3092                                else {
3093                                    // Add a new document if no duplicate messageId is found
3094                                    this.afs
3095                                        .collection(`${path}/history`)
3096                                        .add({
3097                                        createdAt: moment__WEBPACK_IMPORTED_MODULE_4__().format('YYYY-MM-DD HH:mm:ss'),
3098                                        user: this.userLogged,
3099                                        action: `de ${email.from} para ${email.to}`,
3100                                        note: email.body,
3101                                        label: email.subject,
3102                                        email: passEmail.value,
3103                                        threadId: element.threadId,
3104                                        messageId: email.messageId,
3105                                        references: email.references,
3106                                        inReplyTo: email.inReplyTo,
3107                                        read: false
3108                                    })
3109                                        .then(() => {
3110                                        console.log('Document successfully added!');
3111                                    })
3112                                        .catch((error) => {
3113                                        console.error('Error adding document: ', error);
3114                                    });
3115                                }
3116                            }));
3117                        }
3118                    }));
3119                }).catch(err => {
3120                    console.log(err);
3121                });
3122                return { lastMessageId: this.lastMessageId, threadId: this.threadId };
3123            }
3124            else {
3125                return;
3126            }
3127        });
3128    }
3129    getThreadId(agencyId, idDeal) {
3130        return __awaiter(this, void 0, void 0, function* () {
3131            try {
3132                const docRef = this.afs.doc(`agency/${agencyId}/funnel/${idDeal}`);
3133                const docSnapshot = yield docRef.get().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["take"])(1)).toPromise();
3134                if (docSnapshot.exists) {
3135                    const historyCollectionRef = docRef.collection('history');
3136                    const historySnapshot = yield historyCollectionRef.get().toPromise();
3137                    // historySnapshot.docs.map((historyDoc) => console.log(historyDoc.data().threadId))
3138                    // Use map to extract threadId values
3139                    const threadIds = historySnapshot.docs.map((historyDoc) => historyDoc.data().threadId);
3140                    const cleanThreadIds = threadIds.filter(element => element !== undefined);
3141                    const lastMessageId = historySnapshot.docs.map((historyDoc) => historyDoc.data().messageId);
3142                    this.lastMessageId = lastMessageId.filter(element => element !== undefined);
3143                    // this.lastMessageId = messageID.length > 0 ? messageID[0] : undefined
3144                    // Assuming you want to return the first threadId (or you can modify this logic)
3145                    return threadIds.length > 0 ? cleanThreadIds[0] : undefined;
3146                }
3147                else {
3148                    console.log('Document does not exist');
3149                    return undefined;
3150                }
3151            }
3152            catch (error) {
3153                console.error('Error getting threadId:', error);
3154                throw error; // Rethrow the error if needed
3155            }
3156        });
3157    }
3158}
3159EmailService.ɵfac = function EmailService_Factory(t) { return new (t || EmailService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"])); };
3160EmailService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: EmailService, factory: EmailService.ɵfac, providedIn: 'root' });
3161/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](EmailService, [{
3162        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
3163        args: [{
3164                providedIn: 'root'
3165            }]
3166    }], function () { return [{ type: _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"] }]; }, null); })();
3167
3168
3169/***/ }),
3170
3171/***/ "./src/app/shared/services/excel.service.ts":
3172/*!**************************************************!*\
3173  !*** ./src/app/shared/services/excel.service.ts ***!
3174  \**************************************************/
3175/*! exports provided: ExcelService */
3176/***/ (function(module, __webpack_exports__, __webpack_require__) {
3177
3178"use strict";
3179__webpack_require__.r(__webpack_exports__);
3180/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExcelService", function() { return ExcelService; });
3181/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
3182/* harmony import */ var file_saver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! file-saver */ "./node_modules/file-saver/FileSaver.js");
3183/* harmony import */ var file_saver__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(file_saver__WEBPACK_IMPORTED_MODULE_1__);
3184/* harmony import */ var xlsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! xlsx */ "./node_modules/xlsx/xlsx.js");
3185/* harmony import */ var xlsx__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(xlsx__WEBPACK_IMPORTED_MODULE_2__);
3186
3187
3188
3189
3190const EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
3191const EXCEL_EXTENSION = '.xlsx';
3192class ExcelService {
3193    constructor() {
3194    }
3195    exportAsExcelFile(json, jsonDeals, jsonAddOns, jsonRefunds, jsonChannel, excelFileName) {
3196        const worksheet = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(json);
3197        const worksheetDeals = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(jsonDeals);
3198        const worksheetRefunds = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(jsonRefunds);
3199        const worksheetChannel = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(jsonChannel);
3200        const worksheetAddOns = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(jsonAddOns);
3201        const workbook = { Sheets: { 'Ventas': worksheet, 'Deals': worksheetDeals, 'Reembolsos': worksheetRefunds, 'Reservas Channel Manager': worksheetChannel, 'Add-Ons': worksheetAddOns }, SheetNames: ['Ventas', 'Deals', 'Reembolsos', 'Reservas Channel Manager', 'Add-Ons'] };
3202        const excelBuffer = xlsx__WEBPACK_IMPORTED_MODULE_2__["write"](workbook, { bookType: 'xlsx', type: 'array' });
3203        //const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer' });
3204        this.saveAsExcelFile(excelBuffer, excelFileName);
3205    }
3206    exportStatistics(services, giftCard, discount, deals, excelFileName) {
3207        const worksheetServices = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(services);
3208        const worksheetGiftCard = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(giftCard);
3209        const worksheetDiscount = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(discount);
3210        const worksheetDeals = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(deals);
3211        const workbook = {
3212            Sheets: {
3213                'Servicios': worksheetServices,
3214                'Gift Card': worksheetGiftCard,
3215                'Código de descuento': worksheetDiscount,
3216                'Deals': worksheetDeals
3217            }, SheetNames: ['Servicios', 'Gift Card', 'Código de descuento', 'Deals']
3218        };
3219        const excelBuffer = xlsx__WEBPACK_IMPORTED_MODULE_2__["write"](workbook, { bookType: 'xlsx', type: 'array' });
3220        this.saveAsExcelFile(excelBuffer, excelFileName);
3221    }
3222    exportFunnel(jsonDeals, jsonContacted, jsonFinished, jsonLose, excelFileName) {
3223        const worksheetDeals = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(jsonDeals);
3224        const worksheetContacted = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(jsonContacted);
3225        const worksheetFinished = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(jsonFinished);
3226        const worksheetLose = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(jsonLose);
3227        const workbook = { Sheets: { 'Deals': worksheetDeals, 'Contactado': worksheetContacted, 'Ganado': worksheetFinished, 'Perdido': worksheetLose }, SheetNames: ['Deals', 'Contactado', 'Ganado', 'Perdido'] };
3228        const excelBuffer = xlsx__WEBPACK_IMPORTED_MODULE_2__["write"](workbook, { bookType: 'xlsx', type: 'array' });
3229        //const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer' });
3230        this.saveAsExcelFile(excelBuffer, excelFileName);
3231    }
3232    exportDeals(json, excelFileName) {
3233        const worksheet = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(json);
3234        const workbook = { Sheets: { 'Base_de_datos': worksheet }, SheetNames: ['Base_de_datos'] };
3235        const excelBuffer = xlsx__WEBPACK_IMPORTED_MODULE_2__["write"](workbook, { bookType: 'xlsx', type: 'array' });
3236        this.saveAsExcelFile(excelBuffer, excelFileName);
3237    }
3238    exportAsExcelFileWP(json, excelFileName) {
3239        const worksheet = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(json);
3240        const workbook = { Sheets: { 'Ventas': worksheet }, SheetNames: ['Ventas'] };
3241        const excelBuffer = xlsx__WEBPACK_IMPORTED_MODULE_2__["write"](workbook, { bookType: 'xlsx', type: 'array' });
3242        //const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer' });
3243        this.saveAsExcelFile(excelBuffer, excelFileName);
3244    }
3245    exportAsExcelFilePassenger(json, jsonDeals, excelFileName) {
3246        const worksheet = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(json);
3247        const worksheetDeals = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(jsonDeals);
3248        const workbook = { Sheets: { 'Pasajeros': worksheet, 'Reservas': worksheetDeals }, SheetNames: ['Pasajeros', 'Reservas'] };
3249        const excelBuffer = xlsx__WEBPACK_IMPORTED_MODULE_2__["write"](workbook, { bookType: 'xlsx', type: 'array' });
3250        //const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer' });
3251        this.saveAsExcelFile(excelBuffer, excelFileName);
3252    }
3253    exportAsExcelAllData(vendors, addons, experiences, excelFileName) {
3254        const worksheet = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(vendors);
3255        const worksheetDeals = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(addons);
3256        const worksheetExperiences = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(experiences);
3257        const workbook = {
3258            Sheets: {
3259                'Vendedores': worksheet,
3260                'Addons': worksheetDeals,
3261                'Experiencias': worksheetExperiences
3262            },
3263            SheetNames: ['Vendedores', 'Addons', 'Experiencias']
3264        };
3265        const excelBuffer = xlsx__WEBPACK_IMPORTED_MODULE_2__["write"](workbook, { bookType: 'xlsx', type: 'array' });
3266        this.saveAsExcelFile(excelBuffer, excelFileName);
3267    }
3268    importFromFile(bstr) {
3269        /* read workbook */
3270        const wb = xlsx__WEBPACK_IMPORTED_MODULE_2__["read"](bstr, { type: 'binary' });
3271        /* grab first sheet */
3272        const wsname = wb.SheetNames[0];
3273        const ws = wb.Sheets[wsname];
3274        /* save data */
3275        const data = (xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].sheet_to_json(ws, { header: 1 }));
3276        return data;
3277    }
3278    saveAsExcelFile(buffer, fileName) {
3279        const data = new Blob([buffer], {
3280            type: EXCEL_TYPE
3281        });
3282        file_saver__WEBPACK_IMPORTED_MODULE_1__["saveAs"](data, fileName + '_export_' + new Date().getTime() + EXCEL_EXTENSION);
3283    }
3284}
3285ExcelService.ɵfac = function ExcelService_Factory(t) { return new (t || ExcelService)(); };
3286ExcelService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ExcelService, factory: ExcelService.ɵfac });
3287/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ExcelService, [{
3288        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"]
3289    }], function () { return []; }, null); })();
3290
3291
3292/***/ }),
3293
3294/***/ "./src/app/shared/services/experience.service.ts":
3295/*!*******************************************************!*\
3296  !*** ./src/app/shared/services/experience.service.ts ***!
3297  \*******************************************************/
3298/*! exports provided: ExperienceService */
3299/***/ (function(module, __webpack_exports__, __webpack_require__) {
3300
3301"use strict";
3302__webpack_require__.r(__webpack_exports__);
3303/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExperienceService", function() { return ExperienceService; });
3304/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
3305/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js");
3306/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
3307/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm2015/index.js");
3308/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
3309/* harmony import */ var _angular_fire_storage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/fire/storage */ "./node_modules/@angular/fire/__ivy_ngcc__/storage/es2015/index.js");
3310/* harmony import */ var _enums_state_payment_enum__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../enums/state-payment.enum */ "./src/app/shared/enums/state-payment.enum.ts");
3311/* harmony import */ var _enums_state_reservation_enum__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../enums/state-reservation.enum */ "./src/app/shared/enums/state-reservation.enum.ts");
3312/* harmony import */ var _logs_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./logs.service */ "./src/app/shared/services/logs.service.ts");
3313/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
3314/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_9__);
3315/* harmony import */ var src_environments_environment__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! src/environments/environment */ "./src/environments/environment.ts");
3316/* harmony import */ var _helpers_converToSlug__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../helpers/converToSlug */ "./src/app/shared/helpers/converToSlug.ts");
3317var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
3318    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3319    return new (P || (P = Promise))(function (resolve, reject) {
3320        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
3321        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
3322        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
3323        step((generator = generator.apply(thisArg, _arguments || [])).next());
3324    });
3325};
3326/* eslint-disable @typescript-eslint/no-unused-vars */
3327/* eslint-disable @typescript-eslint/no-explicit-any */
3328/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346class ExperienceService {
3347    constructor(firestore, storage, logsService, http) {
3348        this.firestore = firestore;
3349        this.storage = storage;
3350        this.logsService = logsService;
3351        this.http = http;
3352        this.reservations$ = new rxjs__WEBPACK_IMPORTED_MODULE_3__["BehaviorSubject"](null);
3353        this.setReservations$ = (items) => this.reservations$.next(items);
3354        /** TODO : LIST SERVICES */
3355        this.getAllReservationObs = () => this.firestore
3356            .collectionGroup('reservation', (ref) => ref
3357            .where('paymentStatus', '==', _enums_state_payment_enum__WEBPACK_IMPORTED_MODULE_6__["StatePaymentReservation"].PAYMENT_SUCCESS)
3358            .where('status', '==', _enums_state_reservation_enum__WEBPACK_IMPORTED_MODULE_7__["StateReservation"].PAID_OUT))
3359            .snapshotChanges();
3360        this.getAllServiceObs = () => this.firestore.collectionGroup('services').snapshotChanges();
3361        this.getKeyService = (params) => {
3362            if (params.day && params.hour) {
3363                return this.firestore
3364                    .collection(`/agency/${params.agencyKey}/experiences/${params.experience}/services`, (ref) => ref.where('day', '==', params.day).where('hour', '==', params.hour))
3365                    .snapshotChanges();
3366            }
3367        };
3368        this.experiencesCollection = firestore.collection('experience');
3369        this.experiences = this.experiencesCollection.valueChanges();
3370    }
3371    getAddessInfo(data) {
3372        return __awaiter(this, void 0, void 0, function* () {
3373            return yield axios__WEBPACK_IMPORTED_MODULE_9___default()({
3374                method: 'GET',
3375                url: `${src_environments_environment__WEBPACK_IMPORTED_MODULE_10__["environment"].gmapsApi}&latlng=${data}`,
3376                headers: { 'Content-Type': 'application/json' }
3377            });
3378        });
3379    }
3380    /** END LIST SERVICES */
3381    getAllExpercies(agencyId) {
3382        return this.firestore
3383            .collection('agency/' + agencyId + '/experiences')
3384            .valueChanges();
3385    }
3386    getExperiencesByAgency(agencyId) {
3387        return this.firestore
3388            .collection('agency/' + agencyId + '/experiences', (ref) => ref.where('isActive', '==', true))
3389            .valueChanges();
3390    }
3391    getExperiencesByAgencys(agencyId) {
3392        return this.firestore
3393            .collection('agency/' + agencyId + '/experiences', (ref) => ref.where('isActive', '==', true))
3394            .get();
3395    }
3396    getExperienceByAgency(agencyId, experienceId) {
3397        return this.firestore
3398            .doc('agency/' + agencyId + '/experiences/' + experienceId)
3399            .valueChanges();
3400    }
3401    getScheduleByExperience(agencyId, experienceId) {
3402        return this.firestore
3403            .collection('agency/' + agencyId + '/experiences/' + experienceId + '/schedule', (ref) => ref.where('isActive', '==', true))
3404            .valueChanges();
3405    }
3406    getGalleryByExperience(agencyId, experienceId) {
3407        return __awaiter(this, void 0, void 0, function* () {
3408            const gallery = yield this.firestore
3409                .collection('agency/' + agencyId + '/experiences/' + experienceId + '/gallery', (ref) => ref.where('isActive', '==', true))
3410                .get()
3411                .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["take"])(1))
3412                .toPromise();
3413            if (gallery.docs.length === 0) {
3414                for (let i = 0; i < 6; i++) {
3415                    this.addEmptyImagesForEdit(agencyId, experienceId);
3416                }
3417            }
3418            else if (gallery.docs.length === 3) {
3419                for (let i = 0; i < 3; i++) {
3420                    this.addEmptyImagesForEdit(agencyId, experienceId);
3421                }
3422            }
3423            return this.firestore
3424                .collection('agency/' + agencyId + '/experiences/' + experienceId + '/gallery', (ref) => ref.where('isActive', '==', true))
3425                .valueChanges();
3426        });
3427    }
3428    getExperience(agencyId, experienceId) {
3429        return this.firestore
3430            .collection('agency/' + agencyId + '/experiences/', (ref) => ref.where('isActive', '==', true))
3431            .doc(experienceId)
3432            .valueChanges();
3433    }
3434    deleteExperience(agencyId, experienceId) {
3435        return new Promise((resolve, reject) => {
3436            this.experienceDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + experienceId);
3437            const experienceDelete = {
3438                isActive: false
3439            };
3440            this.firestore
3441                .collection('agency/')
3442                .doc(agencyId)
3443                .get()
3444                .toPromise()
3445                .then((agencyRes) => {
3446                this.experienceDoc
3447                    .get()
3448                    .toPromise()
3449                    .then((expRes) => {
3450                    this.experienceDoc
3451                        .update(experienceDelete)
3452                        .then(() => {
3453                        resolve(true);
3454                        this.logsService.dataHistory(agencyId, expRes.data(), experienceId, null, 'DELET
3454E', agencyRes.data());
3455                    })
3456                        .catch((err) => {
3457                        reject(err);
3458                    });
3459                });
3460            });
3461        });
3462    }
3463    verifyServicesConfirmed(agencyId, experienceId) {
3464        return __awaiter(this, void 0, void 0, function* () {
3465            return yield this.firestore
3466                .collection('agency/' + agencyId + '/experiences/' + experienceId + '/services', (ref) => ref.where('isConfirmed', '==', true))
3467                .valueChanges();
3468        });
3469    }
3470    deleteImage(agencyId, experienceId, image, isPrincipalImage) {
3471        return new Promise((resolve, rejected) => {
3472            this.firestore
3473                .doc('agency/' +
3474                agencyId +
3475                '/experiences/' +
3476                experienceId +
3477                '/gallery/' +
3478                image.key)
3479                .delete()
3480                .then((res) => {
3481                // console.log(res, 'delete')
3482                if (isPrincipalImage) {
3483                    this.experienceDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + experienceId);
3484                    const experience = {
3485                        principalImage: null
3486                    };
3487                    this.experienceDoc.update(experience);
3488                    resolve(res);
3489                }
3490                else {
3491                    resolve(res);
3492                }
3493            })
3494                .catch((err) => {
3495                rejected(err);
3496            });
3497        });
3498    }
3499    updateImage(agencyId, experienceId, image, fileUpload) {
3500        return new Promise((resolve, reject) => {
3501            //Delete actual image
3502            this.galleryDoc = this.firestore.doc('agency/' +
3503                agencyId +
3504                '/experiences/' +
3505                experienceId +
3506                '/gallery/' +
3507                image.key);
3508            //Update new image
3509            const randomId = Math.random().toString(36).substring(2);
3510            const ref = this.storage.ref('agencies/' +
3511                agencyId +
3512                '/experiences/' +
3513                experienceId +
3514                '/gallery/' +
3515                randomId);
3516            if (fileUpload) {
3517                //Add Image 1
3518                ref.put(fileUpload).then((rr) => {
3519                    rr.ref.getDownloadURL().then((refDown) => {
3520                        //Update isPrincipalImage
3521                        if (image.isPrincipalImage) {
3522                            this.experienceDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + experienceId);
3523                            const experience = {
3524                                principalImage: refDown
3525                            };
3526                            this.experienceDoc.update(experience);
3527                        }
3528                        //Update key experience
3529                        this.galleryDoc
3530                            .update({ image: refDown, path: randomId })
3531                            .then((res) => {
3532                            resolve(res);
3533                        })
3534                            .catch((err) => {
3535                            reject(err);
3536                        });
3537                    });
3538                });
3539            }
3540            else {
3541                //eliminar imagen y actualizar firestore
3542                // console.log('eliminar')
3543                const refStorage = this.storage.ref('agencies/' +
3544                    agencyId +
3545                    '/experiences/' +
3546                    experienceId +
3547                    '/gallery/' +
3548                    image.path);
3549                refStorage.delete().subscribe((res) => {
3550                    // console.log(res, 'eliminado con exito')
3551                    this.galleryDoc
3552                        .update({ image: '', path: '' })
3553                        .then((res) => {
3554                        resolve(res);
3555                    })
3556                        .catch((err) => {
3557                        reject(err);
3558                    });
3559                });
3560            }
3561        });
3562    }
3563    addEmptyImagesForEdit(agencyId, experienceId, isPrincipalImage) {
3564        return new Promise((resolve, rejected) => {
3565            const addImage = {
3566                key: null,
3567                image: '',
3568                isActive: true,
3569                path: ''
3570            };
3571            if (isPrincipalImage)
3572                addImage['isPrincipalImage'] = true;
3573            this.galleriesCollection = this.firestore.collection('agency/' + agencyId + '/experiences/' + experienceId + '/gallery');
3574            this.galleriesCollection.add(addImage).then((gal) => {
3575                this.galleryDoc = this.firestore.doc('agency/' +
3576                    agencyId +
3577                    '/experiences/' +
3578                    experienceId +
3579                    '/gallery/' +
3580                    gal.id);
3581                addImage.key = gal.id;
3582                addImage.path = '';
3583                this.galleryDoc.update(addImage);
3584            });
3585        });
3586    }
3587    getDestinationDoc(agencyId, destinationId) {
3588        return this.firestore.doc('agency/' + agencyId + '/destinations/' + destinationId).snapshotChanges().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["take"])(1));
3589    }
3590    addKeyToDestinations(agencyId, destinationId, experienceId) {
3591        return new Promise((resolve, reject) => {
3592            this.getDestinationDoc(agencyId, destinationId).subscribe(action => {
3593                const destinationRef = action.payload.ref;
3594                const destination = action.payload.data();
3595                if (!destination.experiences) {
3596                    destination.experiences = [];
3597                }
3598                if (!destination.experiences.includes(experienceId)) {
3599                    destination.experiences = [...destination.experiences, experienceId];
3600                    destinationRef.update(destination)
3601                        .then(() => {
3602                        // console.log("Destino agregado");
3603                        // console.log(destination);
3604                        resolve('KEY_ADDED');
3605                    })
3606                        .catch(() => {
3607                        reject('KEY_ERROR');
3608                    });
3609                }
3610            });
3611        });
3612    }
3613    removeKeyToDestinations(agencyId, destinationId, experienceId) {
3614        return new Promise((resolve, reject) => {
3615            this.getDestinationDoc(agencyId, destinationId).subscribe(action => {
3616                const destinationRef = action.payload.ref;
3617                const destination = action.payload.data();
3618                destination.experiences = destination.experiences.filter(ex
3618pKeys => expKeys != experienceId);
3619                destinationRef.update(destination)
3620                    .then(() => {
3621                    // console.log("Destino borrado");
3622                    // console.log(destination)
3623                    resolve("DESTINATION_REMOVED");
3624                })
3625                    .catch(error => {
3626                    console.error("Error", error);
3627                    reject("DESTINATION_ERROR");
3628                });
3629            });
3630        });
3631    }
3632    addExperience(agencyId, experience, schedule, gallery, destinationId) {
3633        return new Promise((resolve, rejected) => {
3634            this.firestore.collection('agency/' + agencyId + '/experiences')
3635                .add(experience)
3636                .then((res) => {
3637                this.experienceDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + res.id);
3638                experience.key = res.id;
3639                this.experienceDoc.update({ key: res.id });
3640                if (experience.key) {
3641                    if (destinationId) {
3642                        this.addKeyToDestinations(agencyId, destinationId, experience.key);
3643                    }
3644                    this.createExperienceWebsite(agencyId, experience.key);
3645                    this.scheduleExperiencesCollection =
3646                        this.firestore.collection('agency/' + agencyId + '/experiences/' + res.id + '/schedule');
3647                    this.galleriesCollection = this.firestore.collection('agency/' + agencyId + '/experiences/' + res.id + '/gallery');
3648                    //Add schedule to experience created
3649                    this.scheduleExperiencesCollection.add(schedule).then((sc) => {
3650                        this.scheduleDoc = this.firestore.doc('agency/' +
3651                            agencyId +
3652                            '/experiences/' +
3653                            res.id +
3654                            '/schedule/' +
3655                            sc.id);
3656                        schedule.key = sc.id;
3657                        //Update key shcedule
3658                        this.scheduleDoc.update(schedule).then(() => {
3659                            resolve(true);
3660                        });
3661                    });
3662                    //Add Gallery to experience
3663                    //Ref Image 1 & principalImage
3664                    const randomId = Math.random().toString(36).substring(2);
3665                    const ref = this.storage.ref('agencies/' +
3666                        agencyId +
3667                        '/experiences/' +
3668                        res.id +
3669                        '/gallery/' +
3670                        randomId);
3671                    //Add Image 1 & principalImage
3672                    ref.put(gallery.principalImage).then((rr) => {
3673                        rr.ref.getDownloadURL().then((refDown) => {
3674                            experience.principalImage = refDown;
3675                            //Update key experience
3676                            this.experienceDoc.update(experience);
3677                            const galleryAdd = {
3678                                key: null,
3679                                image: null,
3680                                isActive: true,
3681                                isPrincipalImage: true,
3682                                path: null
3683                            };
3684                            galleryAdd.image = refDown;
3685                            galleryAdd.isActive = true;
3686                            galleryAdd.path = randomId;
3687                            galleryAdd.isPrincipalImage = true;
3688                            this.galleriesCollection.add(galleryAdd).then((gal) => {
3689                                this.galleryDoc = this.firestore.doc('agency/' +
3690                                    agencyId +
3691                                    '/experiences/' +
3692                                    res.id +
3693                                    '/gallery/' +
3694                                    gal.id);
3695                                galleryAdd.key = gal.id;
3696                                this.galleryDoc.update(galleryAdd);
3697                            });
3698                        });
3699                    });
3700                    this.firestore
3701                        .collection('agency/')
3702                        .doc(agencyId)
3703                        .get()
3704                        .toPromise()
3705                        .then((agencyRes) => {
3706                        this.logsService.dataHistory(agencyId, experience, experience.ke
3706y, null, 'POST', agencyRes.data());
3707                    });
3708                    //Add Image 2 & 3 if exist
3709                    if (gallery.imageTwo) {
3710                        const randomId = Math.random().toString(36).substring(2);
3711                        //Ref Gallery
3712                        const refGallery = this.storage.ref('agencies/' +
3713                            agencyId +
3714                            '/experiences/' +
3715                            res.id +
3716                            '/gallery/' +
3717                            randomId);
3718                        refGallery.put(gallery.imageTwo).then((rr) => {
3719                            rr.ref.getDownloadURL().then((refDown) => {
3720                                const addImage = {
3721                                    key: null,
3722                                    image: refDown,
3723                                    isActive: true,
3724                                    path: null
3725                                };
3726                                this.galleriesCollection.add(addImage).then((gal2) => {
3727                                    this.galleryDoc = this.firestore.doc('agency/' +
3728                                        agencyId +
3729                                        '/experiences/' +
3730                                        res.id +
3731                                        '/gallery/' +
3732                                        gal2.id);
3733                                    addImage.key = gal2.id;
3734                                    addImage.path = randomId;
3735                                    this.galleryDoc.update(addImage);
3736                                });
3737                            });
3738                        });
3739                    }
3740                    else {
3741                        const addImage = {
3742                            key: null,
3743                            image: '',
3744                            isActive: true,
3745                            path: ''
3746                        };
3747                        this.galleriesCollection.add(addImage).then((gal) => {
3748                            this.galleryDoc = this.firestore.doc('agency/' +
3749                                agencyId +
3750                                '/experiences/' +
3751                                res.id +
3752                                '/gallery/' +
3753                                gal.id);
3754                            addImage.key = gal.id;
3755                            addImage.path = '';
3756                            this.galleryDoc.update(addImage);
3757                        });
3758                    }
3759                    if (gallery.imageThree) {
3760                        const randomId = Math.random().toString(36).substring(2);
3761                        //Ref Gallery
3762                        const refGallery = this.storage.ref('agencies/' +
3763                            agencyId +
3764                            '/experiences/' +
3765                            res.id +
3766                            '/gallery/' +
3767                            randomId);
3768                        refGallery.put(gallery.imageThree).then((rr) => {
3769                            rr.ref.getDownloadURL().then((refDown) => {
3770                                const addImage = {
3771                                    key: null,
3772                                    image: refDown,
3773                                    isActive: true,
3774                                    path: null
3775                                };
3776                                this.galleriesCollection.add(addImage).then((gal3) => {
3777                                    this.galleryDoc = this.firestore.doc('agency/' +
3778                                        agencyId +
3779                                        '/experiences/' +
3780                                        res.id +
3781                                        '/gallery/' +
3782                                        gal3.id);
3783                                    addImage.key = gal3.id;
3784                                    addImage.path = randomId;
3785                                    this.galleryDoc.update(addImage);
3786                                });
3787                            });
3788                        });
3789                    }
3790                    else {
3791                        const addImage = {
3792                            key: null,
3793                            image: '',
3794                            isActive: true,
3795                            path: ''
3796                        };
3797                        this.galleriesCollection.add(addImage).then((gal) => {
3798                            this.galleryDoc = this.firestore.doc('agency/' +
3799                                agencyId +
3800                                '/experiences/' +
3801                                res.id +
3802                                '/gallery/' +
3803                                gal.id);
3804                            addImage.key = gal.id;
3805                            addImage.path = '';
3806                            this.galleryDoc.update(addImage);
3807                        });
3808                    }
3809                    if (gallery.imageFour) {
3810                        const randomId = Math.random().toString(36).substring(2);
3811                        //Ref Gallery
3812                        const refGallery = this.storage.ref('agencies/' +
3813                            agencyId +
3814                            '/experiences/' +
3815                            res.id +
3816                            '/gallery/' +
3817                            randomId);
3818                        refGallery.put(gallery.imageFour).then((rr) => {
3819                            rr.ref.getDownloadURL().then((refDown) => {
3820                                const addImage = {
3821                                    key: null,
3822                                    image: refDown,
3823                                    isActive: true,
3824                                    path: null
3825                                };
3826                                this.galleriesCollection.add(addImage).then((gal4) => {
3827                                    this.galleryDoc = this.firestore.doc('agency/' +
3828                                        agencyId +
3829                                        '/experiences/' +
3830                                        res.id +
3831                                        '/gallery/' +
3832                                        gal4.id);
3833                                    addImage.key = gal4.id;
3834                                    addImage.path = randomId;
3835                                    this.galleryDoc.update(addImage);
3836                                });
3837                            });
3838                        });
3839                    }
3840                    else {
3841                        const addImage = {
3842                            key: null,
3843                            image: '',
3844                            isActive: true,
3845                            path: ''
3846                        };
3847                        this.galleriesCollection.add(addImage).then((gal) => {
3848                            this.galleryDoc = this.firestore.doc('agency/' +
3849                                agencyId +
3850                                '/experiences/' +
3851                                res.id +
3852                                '/gallery/' +
3853                                gal.id);
3854                            addImage.key = gal.id;
3855                            addImage.path = '';
3856                            this.galleryDoc.update(addImage);
3857                        });
3858                    }
3859                    if (gallery.imageFive) {
3860                        const randomId = Math.random().toString(36).substring(2);
3861                        //Ref Gallery
3862                        const refGallery = this.storage.ref('agencies/' +
3863                            agencyId +
3864                            '/experiences/' +
3865                            res.id +
3866                            '/gallery/' +
3867                            randomId);
3868                        refGallery.put(gallery.imageFive).then((rr) => {
3869                            rr.ref.getDownloadURL().then((refDown) => {
3870                                const addImage = {
3871                                    key: null,
3872                                    image: refDown,
3873                                    isActive: true,
3874                                    path: null
3875                                };
3876                                this.galleriesCollection.add(addImage).then((gal5) => {
3877                                    this.galleryDoc = this.firestore.doc('agency/' +
3878                                        agencyId +
3879                                        '/experiences/' +
3880                                        res.id +
3881                                        '/gallery/' +
3882                                        gal5.id);
3883                                    addImage.key = gal5.id;
3884                                    addImage.path = randomId;
3885                                    this.galleryDoc.update(addImage);
3886                                });
3887                            });
3888                        });
3889                    }
3890                    else {
3891                        const addImage = {
3892                            key: null,
3893                            image: '',
3894                            isActive: true,
3895                            path: ''
3896                        };
3897                        this.galleriesCollection.add(addImage).then((gal) => {
3898                            this.galleryDoc = this.firestore.doc('agency/' +
3899                                agencyId +
3900                                '/experiences/' +
3901                                res.id +
3902                                '/gallery/' +
3903                                gal.id);
3904                            addImage.key = gal.id;
3905                            addImage.path = '';
3906                            this.galleryDoc.update(addImage);
3907                        });
3908                    }
3909                    if (gallery.imageSix) {
3910                        const randomId = Math.random().toString(36).substring(2);
3911                        //Ref Gallery
3912                        const refGallery = this.storage.ref('agencies/' +
3913                            agencyId +
3914                            '/experiences/' +
3915                            res.id +
3916                            '/gallery/' +
3917                            randomId);
3918                        refGallery.put(gallery.imageSix).then((rr) => {
3919                            rr.ref.getDownloadURL().then((refDown) => {
3920                                const addImage = {
3921                                    key: null,
3922                                    image: refDown,
3923                                    isActive: true,
3924                                    path: null
3925                                };
3926                                this.galleriesCollection.add(addImage).then((gal6) => {
3927                                    this.galleryDoc = this.firestore.doc('agency/' +
3928                                        agencyId +
3929                                        '/experiences/' +
3930                                        res.id +
3931                                        '/gallery/' +
3932                                        gal6.id);
3933                                    addImage.key = gal6.id;
3934                                    addImage.path = randomId;
3935                                    this.galleryDoc.update(addImage);
3936                                });
3937                            });
3938                        });
3939                    }
3940                    else {
3941                        const addImage = {
3942                            key: null,
3943                            image: '',
3944                            isActive: true,
3945                            path: ''
3946                        };
3947                        this.galleriesCollection.add(addImage).then((gal) => {
3948                            this.galleryDoc = this.firestore.doc('agency/' +
3949                                agencyId +
3950                                '/experiences/' +
3951                                res.id +
3952                                '/gallery/' +
3953                                gal.id);
3954                            addImage.key = gal.id;
3955                            addImage.path = '';
3956                            this.galleryDoc.update(addImage);
3957                        });
3958                    }
3959                }
3960            })
3961                .catch((err) => rejected(err));
3962        });
3963    }
3964    duplicateExperience(agencyId, experience, schedule, destinationId) {
3965        return new Promise((resolve, rejected) => {
3966            this.firestore.collection('agency/' + agencyId + '/experiences')
3967                .add(experience)
3968                .then((res) => {
3969                this.experienceDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + res.id);
3970                experience.key = res.id;
3971                this.experienceDoc.update({ key: res.id });
3972                if (experience.key) {
3973                    if (destinationId) {
3974                        this.addKeyToDestinations(agencyId, destinationId, res.id);
3975                    }
3976                    this.scheduleExperiencesCollection =
3977                        this.firestore.collection('agency/' + agencyId + '/experiences/' + res.id + '/schedule');
3978                    this.galleriesCollection = this.firestore.collection('agency/' + agencyId + '/experiences/' + res.id + '/gallery');
3979                    this.addEmptyImagesForEdit(agencyId, experience.key, true);
3980                    for (let i = 0; i < 5; i++) {
3981                        this.addEmptyImagesForEdit(agencyId, experience.key);
3982                    }
3983                    //Add schedule to experience created
3984                    this.scheduleExperiencesCollection.add(schedule).then((sc) => {
3985                        this.scheduleDoc = this.firestore.doc('agency/' +
3986                            agencyId +
3987                            '/experiences/' +
3988                            res.id +
3989                            '/schedule/' +
3990                            sc.id);
3991                        schedule.key = sc.id;
3992                        //Update key shcedule
3993                        this.scheduleDoc.update(schedule).then(() => {
3994                            resolve(true);
3995                        });
3996                    });
3997                    //Add Gallery to experience
3998                    //Ref Image 1 & principalImage
3999                    const randomId = Math.random().toString(36).substring(2);
4000                    const ref = this.storage.ref('agencies/' +
4001                        agencyId +
4002                        '/experiences/' +
4003                        res.id +
4004                        '/gallery/' +
4005                        randomId);
4006                }
4007            })
4008                .catch((err) => rejected(err));
4009        });
4010    }
4011    addExperienceRestaurant(agencyId, experience, schedule, gallery) {
4012        return new Promise((resolve, rejected) => {
4013            this.experiencesRestaurantCollection =
4014                this.firestore.collection('agency/' + agencyId + '/experiences');
4015            //Add experience to collection
4016            this.experiencesRestaurantCollection
4017                .add(experience)
4018                .then((res) => {
4019                this.experienceRestaurantDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + res.id);
4020                experience.key = res.id;
4021                if (experience.key) {
4022                    this.scheduleExperiencesCollection =
4023                        this.firestore.collection('agency/' + agencyId + '/experiences/' + res.id + '/schedule');
4024                    this.galleriesCollection = this.firestore.collection('agency/' + agencyId + '/experiences/' + res.id + '/gallery');
4025                    //Add Gallery to experience
4026                    //Ref Image 1 & principalImage
4027                    const randomId = Math.random().toString(36).substring(2);
4028                    const ref = this.storage.ref('agencies/' +
4029                        agencyId +
4030                        '/experiences/' +
4031                        res.id +
4032                        '/gallery/' +
4033                        randomId);
4034                    //Add Image 1 & principalImage
4035                    ref.put(gallery.principalImage).then((rr) => {
4036                        rr.ref.getDownloadURL().then((refDown) => {
4037                            experience.principalImage = refDown;
4038                            //Update key experience
4039                            this.experienceRestaurantDoc.update(experience);
4040                            const galleryAdd = {
4041                                key: null,
4042                                image: null,
4043                                isActive: true,
4044                                isPrincipalImage: true,
4045                                path: null
4046                            };
4047                            galleryAdd.image = refDown;
4048                            galleryAdd.isActive = true;
4049                            galleryAdd.path = randomId;
4050                            galleryAdd.isPrincipalImage = true;
4051                            this.galleriesCollection.add(galleryAdd).then((gal) => {
4052                                this.galleryDoc = this.firestore.doc('agency/' +
4053                                    agencyId +
4054                                    '/experiences/' +
4055                                    res.id +
4056                                    '/gallery/' +
4057                                    gal.id);
4058                                galleryAdd.key = gal.id;
4059                                this.galleryDoc.update(galleryAdd);
4060                            });
4061                        });
4062                    });
4063                    //Add schedule to experience created
4064                    this.scheduleExperiencesCollection.add(schedule).then((sc) => {
4065                        this.scheduleDoc = this.firestore.doc('agency/' +
4066                            agencyId +
4067                            '/experiences/' +
4068                            res.id +
4069                            '/schedule/' +
4070                            sc.id);
4071                        schedule.key = sc.id;
4072                        //Update key shcedule
4073                        this.scheduleDoc.update(schedule).then(() => {
4074                            resolve(res.id);
4075                        });
4076                    });
4077                    this.firestore
4078                        .collection('agency/')
4079                        .doc(agencyId)
4080                        .get()
4081                        .toPromise()
4082                        .then((agencyRes) => {
4083                        this.logsService.dataHistory(agencyId, experience, experience.ke
4083y, null, 'POST', agencyRes.data());
4084                    });
4085                }
4086            })
4087                .catch((err) => rejected(err));
4088        });
4089    }
4090    addExperienceHotel(agencyId, experience, schedule, gallery, destinationId, isTailorMade) {
4091        return new Promise((resolve, rejected) => {
4092            this.experiencesHotelCollection = this.firestore.collection('agency/' + agencyId + '/experiences');
4093            //Add experience to collection
4094            this.experiencesHotelCollection
4095                .add(experience)
4096                .then((res) => {
4097                this.experienceHotelDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + res.id);
4098                experience.key = res.id;
4099                if (experience.key) {
4100                    if (destinationId) {
4101                        this.addKeyToDestinations(agencyId, destinationId, experience.key);
4102                    }
4103                    if (!isTailorMade) {
4104                        this.createExperienceWebsite(agencyId, experience.key);
4105                    }
4106                    this.scheduleExperiencesCollection =
4107                        this.firestore.collection('agency/' + agencyId + '/experiences/' + res.id + '/schedule');
4108                    this.galleriesCollection = this.firestore.collection('agency/' + agencyId + '/experiences/' + res.id + '/gallery');
4109                    //Add Gallery to experience
4110                    //Ref Image 1 & principalImage
4111                    const randomId = Math.random().toString(36).substring(2);
4112                    const ref = this.storage.ref('agencies/' +
4113                        agencyId +
4114                        '/experiences/' +
4115                        res.id +
4116                        '/gallery/' +
4117                        randomId);
4118                    //Add Image 1 & principalImage
4119                    ref.put(gallery.principalImage).then((rr) => {
4120                        rr.ref.getDownloadURL().then((refDown) => {
4121                            experience.principalImage = refDown;
4122                            //Update key experience
4123                            this.experienceHotelDoc.update(experience);
4124                            const galleryAdd = {
4125                                key: null,
4126                                image: null,
4127                                isActive: true,
4128                                isPrincipalImage: true,
4129                                path: null
4130                            };
4131                            galleryAdd.image = refDown;
4132                            galleryAdd.isActive = true;
4133                            galleryAdd.path = randomId;
4134                            galleryAdd.isPrincipalImage = true;
4135                            this.galleriesCollection.add(galleryAdd).then((gal) => {
4136                                this.galleryDoc = this.firestore.doc('agency/' +
4137                                    agencyId +
4138                                    '/experiences/' +
4139                                    res.id +
4140                                    '/gallery/' +
4141                                    gal.id);
4142                                galleryAdd.key = gal.id;
4143                                this.galleryDoc.update(galleryAdd);
4144                            });
4145                        });
4146                    });
4147                    this.firestore
4148                        .collection('agency/')
4149                        .doc(agencyId)
4150                        .get()
4151                        .toPromise()
4152                        .then((agencyRes) => {
4153                        this.logsService.dataHistory(agencyId, experience, experience.key, null, 'POST', agencyRes.data());
4154                    });
4155                    //Add Image 2 & 3 if exist
4156                    if (gallery.imageTwo) {
4157                        const randomId = Math.random().toString(36).substring(2);
4158                        //Ref Gallery
4159                        const refGallery = this.storage.ref('agencies/' +
4160                            agencyId +
4161                            '/experiences/' +
4162                            res.id +
4163                            '/gallery/' +
4164                            randomId);
4165                        refGallery.put(gallery.imageTwo).then((rr) => {
4166                            rr.ref.getDownloadURL().then((refDown) => {
4167                                const addImage = {
4168                                    key: null,
4169                                    image: refDown,
4170                                    isActive: true,
4171                                    path: null
4172                                };
4173                                this.galleriesCollection.add(addImage).then((gal2) => {
4174                                    this.galleryDoc = this.firestore.doc('agency/' +
4175                                        agencyId +
4176                                        '/experiences/' +
4177                                        res.id +
4178                                        '/gallery/' +
4179                                        gal2.id);
4180                                    addImage.key = gal2.id;
4181                                    addImage.path = randomId;
4182                                    this.galleryDoc.update(addImage);
4183                                });
4184                            });
4185                        });
4186                    }
4187                    else {
4188                        const addImage = {
4189                            key: null,
4190                            image: '',
4191                            isActive: true,
4192                            path: ''
4193                        };
4194                        this.galleriesCollection.add(addImage).then((gal) => {
4195                            this.galleryDoc = this.firestore.doc('agency/' +
4196                                agencyId +
4197                                '/experiences/' +
4198                                res.id +
4199                                '/gallery/' +
4200                                gal.id);
4201                            addImage.key = gal.id;
4202                            addImage.path = '';
4203                            this.galleryDoc.update(addImage);
4204                        });
4205                    }
4206                    if (gallery.imageThree) {
4207                        const randomId = Math.random().toString(36).substring(2);
4208                        //Ref Gallery
4209                        const refGallery = this.storage.ref('agencies/' +
4210                            agencyId +
4211                            '/experiences/' +
4212                            res.id +
4213                            '/gallery/' +
4214                            randomId);
4215                        refGallery.put(gallery.imageThree).then((rr) => {
4216                            rr.ref.getDownloadURL().then((refDown) => {
4217                                const addImage = {
4218                                    key: null,
4219                                    image: refDown,
4220                                    isActive: true,
4221                                    path: null
4222                                };
4223                                this.galleriesCollection.add(addImage).then((gal3) => {
4224                                    this.galleryDoc = this.firestore.doc('agency/' +
4225                                        agencyId +
4226                                        '/experiences/' +
4227                                        res.id +
4228                                        '/gallery/' +
4229                                        gal3.id);
4230                                    addImage.key = gal3.id;
4231                                    addImage.path = randomId;
4232                                    this.galleryDoc.update(addImage);
4233                                });
4234                            });
4235                        });
4236                    }
4237                    else {
4238                        const addImage = {
4239                            key: null,
4240                            image: '',
4241                            isActive: true,
4242                            path: ''
4243                        };
4244                        this.galleriesCollection.add(addImage).then((gal) => {
4245                            this.galleryDoc = this.firestore.doc('agency/' +
4246                                agencyId +
4247                                '/experiences/' +
4248                                res.id +
4249                                '/gallery/' +
4250                                gal.id);
4251                            addImage.key = gal.id;
4252                            addImage.path = '';
4253                            this.galleryDoc.update(addImage);
4254                        });
4255                    }
4256                    if (gallery.imageFour) {
4257                        const randomId = Math.random().toString(36).substring(2);
4258                        //Ref Gallery
4259                        const refGallery = this.storage.ref('agencies/' +
4260                            agencyId +
4261                            '/experiences/' +
4262                            res.id +
4263                            '/gallery/' +
4264                            randomId);
4265                        refGallery.put(gallery.imageFour).then((rr) => {
4266                            rr.ref.getDownloadURL().then((refDown) => {
4267                                const addImage = {
4268                                    key: null,
4269                                    image: refDown,
4270                                    isActive: true,
4271                                    path: null
4272                                };
4273                                this.galleriesCollection.add(addImage).then((gal4) => {
4274                                    this.galleryDoc = this.firestore.doc('agency/' +
4275                                        agencyId +
4276                                        '/experiences/' +
4277                                        res.id +
4278                                        '/gallery/' +
4279                                        gal4.id);
4280                                    addImage.key = gal4.id;
4281                                    addImage.path = randomId;
4282                                    this.galleryDoc.update(addImage);
4283                                });
4284                            });
4285                        });
4286                    }
4287                    else {
4288                        const addImage = {
4289                            key: null,
4290                            image: '',
4291                            isActive: true,
4292                            path: ''
4293                        };
4294                        this.galleriesCollection.add(addImage).then((gal) => {
4295                            this.galleryDoc = this.firestore.doc('agency/' +
4296                                agencyId +
4297                                '/experiences/' +
4298                                res.id +
4299                                '/gallery/' +
4300                                gal.id);
4301                            addImage.key = gal.id;
4302                            addImage.path = '';
4303                            this.galleryDoc.update(addImage);
4304                        });
4305                    }
4306                    if (gallery.imageFive) {
4307                        const randomId = Math.random().toString(36).substring(2);
4308                        //Ref Gallery
4309                        const refGallery = this.storage.ref('agencies/' +
4310                            agencyId +
4311                            '/experiences/' +
4312                            res.id +
4313                            '/gallery/' +
4314                            randomId);
4315                        refGallery.put(gallery.imageFive).then((rr) => {
4316                            rr.ref.getDownloadURL().then((refDown) => {
4317                                const addImage = {
4318                                    key: null,
4319                                    image: refDown,
4320                                    isActive: true,
4321                                    path: null
4322                                };
4323                                this.galleriesCollection.add(addImage).then((gal5) => {
4324                                    this.galleryDoc = this.firestore.doc('agency/' +
4325                                        agencyId +
4326                                        '/experiences/' +
4327                                        res.id +
4328                                        '/gallery/' +
4329                                        gal5.id);
4330                                    addImage.key = gal5.id;
4331                                    addImage.path = randomId;
4332                                    this.galleryDoc.update(addImage);
4333                                });
4334                            });
4335                        });
4336                    }
4337                    else {
4338                        const addImage = {
4339                            key: null,
4340                            image: '',
4341                            isActive: true,
4342                            path: ''
4343                        };
4344                        this.galleriesCollection.add(addImage).then((gal) => {
4345                            this.galleryDoc = this.firestore.doc('agency/' +
4346                                agencyId +
4347                                '/experiences/' +
4348                                res.id +
4349                                '/gallery/' +
4350                                gal.id);
4351                            addImage.key = gal.id;
4352                            addImage.path = '';
4353                            this.galleryDoc.update(addImage);
4354                        });
4355                    }
4356                    if (gallery.imageSix) {
4357                        const randomId = Math.random().toString(36).substring(2);
4358                        //Ref Gallery
4359                        const refGallery = this.storage.ref('agencies/' +
4360                            agencyId +
4361                            '/experiences/' +
4362                            res.id +
4363                            '/gallery/' +
4364                            randomId);
4365                        refGallery.put(gallery.imageSix).then((rr) => {
4366                            rr.ref.getDownloadURL().then((refDown) => {
4367                                const addImage = {
4368                                    key: null,
4369                                    image: refDown,
4370                                    isActive: true,
4371                                    path: null
4372                                };
4373                                this.galleriesCollection.add(addImage).then((gal6) => {
4374                                    this.galleryDoc = this.firestore.doc('agency/' +
4375                                        agencyId +
4376                                        '/experiences/' +
4377                                        res.id +
4378                                        '/gallery/' +
4379                                        gal6.id);
4380                                    addImage.key = gal6.id;
4381                                    addImage.path = randomId;
4382                                    this.galleryDoc.update(addImage);
4383                                });
4384                            });
4385                        });
4386                    }
4387                    else {
4388                        const addImage = {
4389                            key: null,
4390                            image: '',
4391                            isActive: true,
4392                            path: ''
4393                        };
4394                        this.galleriesCollection.add(addImage).then((gal) => {
4395                            this.galleryDoc = this.firestore.doc('agency/' +
4396                                agencyId +
4397                                '/experiences/' +
4398                                res.id +
4399                                '/gallery/' +
4400                                gal.id);
4401                            addImage.key = gal.id;
4402                            addImage.path = '';
4403                            this.galleryDoc.update(addImage);
4404                        });
4405                    }
4406                    //Add schedule to experience created
4407                    this.scheduleExperiencesCollection.add(schedule).then((sc) => {
4408                        this.scheduleDoc = this.firestore.doc('agency/' +
4409                            agencyId +
4410                            '/experiences/' +
4411                            res.id +
4412                            '/schedule/' +
4413                            sc.id);
4414                        schedule.key = sc.id;
4415                        //Update key shcedule
4416                        this.scheduleDoc.update(schedule).then(() => {
4417                            resolve(true);
4418                        });
4419                    });
4420                }
4421            })
4422                .catch((err) => rejected(err));
4423        });
4424    }
4425    addExperienceEcommerce(agencyId, experience, gallery) {
4426        return new Promise((resolve, rejected) => {
4427            this.experiencesEcommerceCollection =
4428                this.firestore.collection('agency/' + agencyId + '/experiences');
4429            //Add experience to collection
4430            this.experiencesEcommerceCollection
4431                .add(experience)
4432                .then((res) => {
4433                this.experienceEcommerceDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + res.id);
4434                experience.key = res.id;
4435                if (experience.key) {
4436                    this.galleriesCollection = this.firestore.collection('agency/' + agencyId + '/experiences/' + res.id + '/gallery');
4437                    //Add Gallery to experience
4438                    //Ref Image 1 & principalImage
4439                    const randomId = Math.random().toString(36).substring(2);
4440                    const ref = this.storage.ref('agencies/' +
4441                        agencyId +
4442                        '/experiences/' +
4443                        res.id +
4444                        '/gallery/' +
4445                        randomId);
4446                    //Add Image 1 & principalImage
4447                    ref.put(gallery.principalImage).then((rr) => {
4448                        rr.ref.getDownloadURL().then((refDown) => {
4449                            experience.principalImage = refDown;
4450                            //Update key experience
4451                            this.experienceEcommerceDoc.update(experience);
4452                            const galleryAdd = {
4453                                key: null,
4454                                image: null,
4455                                isActive: true,
4456                                isPrincipalImage: true,
4457                                path: null
4458                            };
4459                            galleryAdd.image = refDown;
4460                            galleryAdd.isActive = true;
4461                            galleryAdd.path = randomId;
4462                            galleryAdd.isPrincipalImage = true;
4463                            this.galleriesCollection.add(galleryAdd).then((gal) => {
4464                                this.galleryDoc = this.firestore.doc('agency/' +
4465                                    agencyId +
4466                                    '/experiences/' +
4467                                    res.id +
4468                                    '/gallery/' +
4469                                    gal.id);
4470                                galleryAdd.key = gal.id;
4471                                this.galleryDoc.update(galleryAdd);
4472                                resolve(res.id);
4473                            });
4474                        });
4475                    });
4476                    // this.firestore
4477                    //   .collection('agency/')
4478                    //   .doc(agencyId)
4479                    //   .get()
4480                    //   .toPromise()
4481                    //   .then((agencyRes) => {
4482                    //     this.logsService.dataHistory(
4483                    //       agencyId,
4484                    //       experience,
4485                    //       experience.key,
4486                    //       null,
4487                    //       'POST',
4488                    //       agencyRes.data()
4489                    //     )
4490                    //   })
4491                }
4492            })
4493                .catch((err) => {
4494                console.log('ERROR', err);
4495                rejected(err);
4496            });
4497        });
4498    }
4499    updateSchedule(agencyId, experienceId, schedule) {
4500        return new Promise((resolve, reject) => {
4501            this.scheduleDoc = this.firestore.doc('agency/' +
4502                agencyId +
4503                '/experiences/' +
4504                experienceId +
4505                '/schedule/' +
4506                schedule.key);
4507            this.scheduleDoc
4508                .update(schedule)
4509                .then((res) => {
4510                resolve(res);
4511            })
4512                .catch((err) => {
4513                reject(err);
4514            });
4515        });
4516    }
4517    getExperienceById(agencyId, experienceId) {
4518        return this.firestore
4519            .collection('agency/' + agencyId + '/experiences/')
4520            .doc(experienceId)
4521            .valueChanges();
4522    }
4523    getExperienceByIdPromise(agencyId, experienceId) {
4524        return __awaiter(this, void 0, void 0, function* () {
4525            const experienceDoc = yield this.firestore
4526                .collection('agency/' + agencyId + '/experiences/')
4527                .doc(experienceId)
4528                .get()
4529                .toPromise();
4530            return experienceDoc.data();
4531        });
4532    }
4533    getExperienceByIdAsync(agencyId, experienceId) {
4534        return __awaiter(this, void 0, void 0, function* () {
4535            return new Promise((resolve, reject) => {
4536                const ref = this.firestore.collection(`agency/${agencyId}/experiences`).doc(experienceId).get();
4537                ref.forEach(res => {
4538                    resolve(res.data());
4539                });
4540            });
4541        });
4542    }
4543    getScheduleExperience(agencyId, experienceId) {
4544        return this.firestore
4545            .collection('agency/' + agencyId + '/experiences/' + experienceId + '/schedule')
4546            .valueChanges();
4547    }
4548    getServicesBussy(data) {
4549        return this.firestore
4550            .collection(`agency/${data.agencyId}/experiences/${data.experienceId}/services`, (ref) => ref.where('day', '==', data.day).where('hour', '==', data.hour))
4551            .valueChanges();
4552    }
4553    getAllReservations(data) {
4554        return this.firestore
4555            .collection(`agency/${data.agencyId}/experiences/${data.experienceId}/reservation`, (ref) => ref
4556            .where('paymentStatus', '==', _enums_state_payment_enum__WEBPACK_IMPORTED_MODULE_6__["StatePaymentReservation"].PAYMENT_SUCCESS)
4557            .where('status', '==', _enums_state_reservation_enum__WEBPACK_IMPORTED_MODULE_7__["StateReservation"].PAID_OUT))
4558            .valueChanges();
4559    }
4560    // EDIT EXPERIENCE
4561    updatePrincipalDataRestaurant(agencyId, experienceId, dataEdited) {
4562        return new Promise((resolve, reject) => {
4563            this.experienceRestaurantDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + experienceId);
4564            this.firestore
4565                .collection('agency/')
4566                .doc(agencyId)
4567                .get()
4568                .toPromise()
4569                .then((agencyRes) => {
4570                this.experienceRestaurantDoc
4571                    .get()
4572                    .toPromise()
4573                    .then((expRes) => {
4574                    this.experienceRestaurantDoc
4575                        .update(dataEdited)
4576                        .then(() => {
4577                        resolve(true);
4578                        this.logsService.dataHistory(agencyId, expRes.data(), experienceId, null, 'PUT', agencyRes.data());
4579                    })
4580                        .catch((err) => {
4581                        reject(err);
4582                    });
4583                });
4584            });
4585        });
4586    }
4587    updatePrincipalData(agencyId, experienceId, dataEdited) {
4588        return new Promise((resolve, reject) => {
4589            this.experienceDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + experienceId);
4590            this.firestore
4591                .collection('agency/')
4592                .doc(agencyId)
4593                .get()
4594                .toPromise()
4595                .then((agencyRes) => {
4596                this.experienceDoc
4597                    .get()
4598                    .toPromise()
4599                    .then((expRes) => {
4600                    this.experienceDoc
4601                        .update(dataEdited)
4602                        .then((res) => {
4603                        //this.updateWebsiteData(agencyId, experienceId);
4604                        resolve(res);
4605                        this.logsService.dataHistory(agencyId, expRes.data(), experienceId, null, 'PUT', agencyRes.data());
4606                    })
4607                        .catch((err) => {
4608                        reject(err);
4609                    });
4610                });
4611            });
4612        });
4613    }
4614    updateSeoSetting(agencyId, experienceId, dataEdited) {
4615        return new Promise((resolve, reject) => {
4616            this.experienceDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + experienceId);
4617            this.firestore
4618                .collection('agency/')
4619                .doc(agencyId)
4620                .get()
4621                .toPromise()
4622                .then((agencyRes) => {
4623                this.experienceDoc
4624                    .get()
4625                    .toPromise()
4626                    .then((expRes) => {
4627                    this.experienceDoc
4628                        .update(dataEdited)
4629                        .then((res) => {
4630                        resolve(res);
4631                        this.logsService.dataHistory(agencyId, expRes.data(), experienceId, null, 'PUT', agencyRes.data());
4632                    })
4633                        .catch((err) => {
4634                        reject(err);
4635                    });
4636                });
4637            });
4638        });
4639    }
4640    updatePrincipalDataHotel(agencyId, experienceId, dataEdited) {
4641        return new Promise((resolve, reject) => {
4642            this.experienceHotelDoc = this.firestore.doc('agency/' + agencyId + '/experiences/' + experienceId);
4643            this.firestore
4644                .collection('agency/')
4645                .doc(agencyId)
4646                .get()
4647                .toPromise()
4648                .then((agencyRes) => {
4649                this.experienceHotelDoc
4650                    .get()
4651                    .toPromise()
4652                    .then((expRes) => {
4653                    this.experienceHotelDoc
4654                        .update(dataEdited)
4655                        .then((res) => {
4656                        resolve(res);
4657                        this.logsService.dataHistory(agencyId, expRes.data(), experienceId, null, 'PUT', agencyRes.data());
4658                    })
4659                        .catch((err) => {
4660                        reject(err);
4661                    });
4662                });
4663            });
4664        });
4665    }
4666    updateDisableExperience(agencyId, experienceId, isDisable) {
4667        return new Promise((resolve, reject) => {
4668            this.firestore
4669                .doc(`agency/${agencyId}/experiences/${experienceId}`)
4670                .update({ isDisable })
4671                .then((res) => resolve(true))
4672                .catch((err) => reject(false));
4673        });
4674    }
4675    checkCurrentSlug(name, agencyId) {
4676        return __awaiter(this, void 0, void 0, function* () {
4677            return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
4678                const slug = _helpers_converToSlug__WEBPACK_IMPORTED_MODULE_11__["default"].stringToSlug(name);
4679                const experiencesRef = this.firestore.collection(`agency/${agencyId}/experiences`).get();
4680                yield experiencesRef.forEach(exp => {
4681                    exp.forEach(e => {
4682                        const { seo } = e.data();
4683                        if (!!seo) {
4684                            // console.log(slug === seo.slug);
4685                            if (slug === seo.slug) {
4686                                const lastChart = slug.charAt(slug.length - 1);
4687                                const nanVerify = parseInt(slug.charAt(slug.length - 1));
4688                                if (!Number.isNaN(nanVerify)) {
4689                                    resolve(slug.slice(0, -1) + (nanVerify + 1));
4690                                }
4691                                else {
4692                                    resolve(slug.slice(0, -1) + lastChart + "-1");
4693                                }
4694                            }
4695                        }
4696                    });
4697                });
4698                resolve('NOT_CURRENT_SLUG');
4699            }));
4700            //Validate Slug
4701            // const lastChart = parseInt(name.charAt(name.length-1));
4702            // if(!Number.isNaN(lastChart)){
4703            // var newSlug = name.slice(0, -1) + (lastChart+1);
4704            // // console.log(newSlug)
4705            // }
4706        });
4707    }
4708    getExperiencesNameByAgency(agencyId) {
4709        return this.firestore
4710            .collection('agency/' + agencyId + '/experiences', (ref) => ref.where('isActive', '==', true))
4711            .valueChanges()
4712            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])((experiences) => experiences.map(exp => exp.name)));
4713    }
4714    createExperienceWebsite(agencyId, experienceId) {
4715        this.firestore.doc('agency/' + agencyId)
4716            .valueChanges()
4717            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])((agency) => { var _a; return ((_a = agency) === null || _a === void 0 ? void 0 : _a.web) || ''; }) // Si agency.web no existe, devuelve un string vacío
4718        ).subscribe((web) => {
4719            this.http.post(web + '/wp-json/heyandes/v1/experiences?agency_key=' + agencyId + '&experience_key=' + experienceId, {}).subscribe(() => {
4720                // console.log('Experiencia creada en la web');
4721            }, (error) => {
4722                console.error('Error en la solicitud HTTP:', error);
4723            });
4724        });
4725    }
4726    updateExperienceWebsite(agencyId, experienceId) {
4727        this.firestore.doc('agency/' + agencyId)
4728            .valueChanges()
4729            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])((agency) => { var _a; return ((_a = agency) === null || _a === void 0 ? void 0 : _a.web) || ''; }) // Si agency.web no existe, devuelve un string vacío
4730        ).subscribe((web) => {
4731            this.http.put(web + '/wp-json/heyandes/v1/experiences?agency_key=' + agencyId + '&experience_key=' + experienceId, {}).subscribe(() => {
4732                // console.log('Experiencia actualizada en la web');
4733            }, (error) => {
4734                console.error('Error en la solicitud HTTP:', error);
4735            });
4736        });
4737    }
4738    //Nota: No borra la página, sólo se elimina la card para no perder poscionamiento
4739    deleteExperienceWebsite(agencyId, experienceId) {
4740        this.firestore.doc('agency/' + agencyId)
4741            .valueChanges()
4742            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])((agency) => { var _a; return ((_a = agency) === null || _a === void 0 ? void 0 : _a.web) || ''; }) // Si agency.web no existe, devuelve un string vacío
4743        ).subscribe((web) => {
4744            this.http.delete(web + '/wp-json/heyandes/v1/experiences?agency_key=' + agencyId + '&experience_key=' + experienceId, {}).subscribe(() => {
4745                // console.log('Card de experiencia eliminada en la web');
4746            }, (error) => {
4747                console.error('Error en la solicitud HTTP:', error);
4748            });
4749        });
4750    }
4751    getExchange(currency = 'USD', amount = 10000) {
4752        const url = `${src_environments_environment__WEBPACK_IMPORTED_MODULE_10__["environment"].urlApiCurrency}`;
4753        const params = {
4754            have: 'CLP',
4755            want: `${currency}`,
4756            amount: `${amount}` //Entre menor es el amount es menos preciso para obtener el ratio, se dejó en 10000 por mejor precision
4757        };
4758        const headers = {
4759            'X-Api-Key': `${src_environments_environment__WEBPACK_IMPORTED_MODULE_10__["environment"].apiKeyCurrency}`,
4760            'Content-Type': 'application/json'
4761        };
4762        const options = {
4763            params,
4764            headers
4765        };
4766        const observable = this.http.get(url, options);
4767        return observable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])((response) => {
4768            return response.old_amount / response.new_amount;
4769        }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["first"])()).toPromise();
4770    }
4771    getExperienceName(agencyId, experienceId) {
4772        return __awaiter(this, void 0, void 0, function* () {
4773            const experience = yield this.firestore.doc('agency/' + agencyId + '/experiences/' + experienceId)
4774                .get().toPromise();
4775            if (!experience.exists)
4776                return '';
4777            const exp = experience.data();
4778            //Retorna '' si la experiencia está desactivada
4779            return exp.isActive ? exp.name : '';
4780        });
4781    }
4782    deleteDestinationExperience(agencyId, experienceId, destinationId) {
4783        return __awaiter(this, void 0, void 0, function* () {
4784            return new Promise((resolve, reject) => {
4785                const destinationDoc = this.firestore.doc('agency/' + agencyId + '/destinations/' + destinationId);
4786                destinationDoc.valueChanges().subscribe((destination) => __awaiter(this, void 0, void 0, function* () {
4787                    const updateExperiences = destination.experiences.filter(ex
4787perience => experience !== experienceId);
4788                    yield destinationDoc.update({ experiences: updateExperiences }).then(() => {
4789                        resolve(true);
4790                    }).catch((error) => {
4791                        reject(error);
4792                    });
4793                }));
4794            });
4795        });
4796    }
4797    //Obtiene el listado de nombre de experiencias a partir de la categoria.
4798    getExperiencesNamesByAgencyAndCategory(agencyId, category, name) {
4799        return this.firestore
4800            .collection('agency/' + agencyId + '/experiences', (ref) => ref.where('isActive', '==', true).where('category', '==', category))
4801            .valueChanges()
4802            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])((experiences) => experiences
4803            .filter(exp => exp.name !== name)
4804            .map(exp => {
4805            var _a;
4806            return ({
4807                name: exp.name,
4808                category: exp.category,
4809                type: exp.type,
4810                periodicity: exp.periodicity,
4811                key: exp.key,
4812                minConfirmation: ((_a = exp) === null || _a === void 0 ? void 0 : _a.minConfirmation) ? exp.minConfirmation : 0
4813            });
4814        })));
4815    }
4816    getScheduleExperienceObject(agencyId, experienceId) {
4817        return __awaiter(this, void 0, void 0, function* () {
4818            const scheduleRef = this.firestore.collection('agency').doc(agencyId).collection('experiences').doc(experienceId).collection('schedule');
4819            let data = {};
4820            const querySnapshot = yield scheduleRef.ref
4821                .get();
4822            querySnapshot.forEach((doc) => {
4823                data = Object.assign(Object.assign({}, doc.data()), { key: doc.id });
4824            });
4825            return data;
4826        });
4827    }
4828    getAllServices(agencyId, experienceId) {
4829        return __awaiter(this, void 0, void 0, function* () {
4830            const serviceRef = this.firestore.collection('agency').doc(agencyId).collection('experiences').doc(experienceId).collection('services');
4831            let services = [];
4832            const querySnapshot = yield serviceRef.ref
4833                .get();
4834            const promises = querySnapshot.docs.map((serviceDoc) => __awaiter(this, void 0, void 0, function* () {
4835                return Object.assign(Object.assign({}, serviceDoc.data()), { key: serviceDoc.id });
4836            }));
4837            const results = yield Promise.all(promises);
4838            services = results.filter((result) => result !== null);
4839            return services;
4840        });
4841    }
4842    getResourcesByDayAndHour(agencyId, experienceId) {
4843        return __awaiter(this, void 0, void 0, function* () {
4844            const resourceRef = this.firestore.collection('agency').doc(agencyId).collection('resources');
4845            const resources = [];
4846            const querySnapshot = yield resourceRef.ref
4847                .where('idsExperiences', 'array-contains', experienceId)
4848                .get();
4849            querySnapshot.forEach((doc) => {
4850                const resourceData = doc.data();
4851                if (resourceData.isActive) {
4852                    resources.push(Object.assign({ id: doc.id }, resourceData));
4853                }
4854            });
4855            return resources;
4856        });
4857    }
4858    getExperienceSchedule(agencyId, experienceId) {
4859        return __awaiter(this, void 0, void 0, function* () {
4860            try {
4861                const scheduleRef = this.firestore.collection('agency').doc(agencyId).collection('experiences').doc(experienceId).collection('schedule').ref;
4862                const scheduleResponse = yield scheduleRef
4863                    .get();
4864                let data = {};
4865                scheduleResponse.forEach((doc) => (data = Object.assign({}, doc.data())));
4866                return data;
4867            }
4868            catch (err) {
4869                return { days: {}, error: err };
4870            }
4871        });
4872    }
4873    ;
4874    getExperienceIdByChannelRoomId(agencyId, roomId) {
4875        return __awaiter(this, void 0, void 0, function* () {
4876            const experiences = yield this.firestore
4877                .collection('agency')
4878                .doc(agencyId)
4879                .collection('experiences', ref => ref.where('channelRoomId', '==', roomId))
4880                .get().toPromise();
4881            return experiences.docs[0].id;
4882        });
4883    }
4884}
4885ExperienceService.ɵfac = function ExperienceService_Factory(t) { return new (t || ExperienceService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_firestore__WEBPACK_IMPORTED_MODULE_2__["AngularFirestore"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_storage__WEBPACK_IMPORTED_MODULE_5__["AngularFireStorage"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_logs_service__WEBPACK_IMPORTED_MODULE_8__["LogsService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"])); };
4886ExperienceService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ExperienceService, factory: ExperienceService.ɵfac, providedIn: 'root' });
4887/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ExperienceService, [{
4888        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
4889        args: [{
4890                providedIn: 'root'
4891            }]
4892    }], function () { return [{ type: _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_2__["AngularFirestore"] }, { type: _angular_fire_storage__WEBPACK_IMPORTED_MODULE_5__["AngularFireStorage"] }, { type: _logs_service__WEBPACK_IMPORTED_MODULE_8__["LogsService"] }, { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"] }]; }, null); })();
4893
4894
4895/***/ }),
4896
4897/***/ "./src/app/shared/services/finance.service.ts":
4898/*!****************************************************!*\
4899  !*** ./src/app/shared/services/finance.service.ts ***!
4900  \****************************************************/
4901/*! exports provided: FinanceService */
4902/***/ (function(module, __webpack_exports__, __webpack_require__) {
4903
4904"use strict";
4905__webpack_require__.r(__webpack_exports__);
4906/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FinanceService", function() { return FinanceService; });
4907/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
4908/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
4909
4910
4911
4912
4913class FinanceService {
4914    constructor(firestore) {
4915        this.firestore = firestore;
4916        this.getAllExperiencesById = (agencyId) => {
4917            const response = this.firestore.collection(`agency/${agencyId}/experiences`).get();
4918            const experiences = [];
4919            // response.forEach((e) => {
4920            //   e.docs.forEach(exp => {
4921            //     experiences.push({ id: exp.id, ...exp.data() })
4922            //   })
4923            // })
4924            response.subscribe(ex => {
4925                for (let exp of ex.docs) {
4926                    experiences.push(Object.assign({ id: exp.id }, exp.data()));
4927                }
4928                return experiences;
4929            });
4930        };
4931    }
4932}
4933FinanceService.ɵfac = function FinanceService_Factory(t) { return new (t || FinanceService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"])); };
4934FinanceService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: FinanceService, factory: FinanceService.ɵfac, providedIn: 'root' });
4935/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](FinanceService, [{
4936        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
4937        args: [{
4938                providedIn: 'root'
4939            }]
4940    }], function () { return [{ type: _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"] }]; }, null); })();
4941
4942
4943/***/ }),
4944
4945/***/ "./src/app/shared/services/import.service.ts":
4946/*!***************************************************!*\
4947  !*** ./src/app/shared/services/import.service.ts ***!
4948  \***************************************************/
4949/*! exports provided: ImportService */
4950/***/ (function(module, __webpack_exports__, __webpack_require__) {
4951
4952"use strict";
4953__webpack_require__.r(__webpack_exports__);
4954/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImportService", function() { return ImportService; });
4955/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
4956/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
4957
4958
4959
4960
4961class ImportService {
4962    constructor(firestore) {
4963        this.firestore = firestore;
4964    }
4965    getAllVendors(agencyId) {
4966        return this.firestore.collectionGroup('admins', ref => ref.where('agency', '==', agencyId)).valueChanges();
4967    }
4968    getAllAddons(agencyId) {
4969        return this.firestore.collection(`agency/${agencyId}/addons`).valueChanges();
4970    }
4971    getAllExperiences(agencyId) {
4972        return this.firestore.collection(`agency/${agencyId}/experiences`).valueChanges();
4973    }
4974}
4975ImportService.ɵfac = function ImportService_Factory(t) { return new (t || ImportService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"])); };
4976ImportService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ImportService, factory: ImportService.ɵfac, providedIn: 'root' });
4977/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ImportService, [{
4978        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
4979        args: [{
4980                providedIn: 'root'
4981            }]
4982    }], function () { return [{ type: _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_1__["AngularFirestore"] }]; }, null); })();
4983
4984
4985/***/ }),
4986
4987/***/ "./src/app/shared/services/logs.service.ts":
4988/*!*************************************************!*\
4989  !*** ./src/app/shared/services/logs.service.ts ***!
4990  \*************************************************/
4991/*! exports provided: LogsService */
4992/***/ (function(module, __webpack_exports__, __webpack_require__) {
4993
4994"use strict";
4995__webpack_require__.r(__webpack_exports__);
4996/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogsService", function() { return LogsService; });
4997/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
4998/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
4999/* harmony import */ var _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/fire/firestore */ "./node_modules/@angular/fire/__ivy_ngcc__/firestore/es2015/index.js");
5000/* harmony import */ var _auth_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./auth.service */ "./src/app/shared/services/auth.service.ts");
5001
5002
5003// Services
5004
5005
5006
5007
5008
5009class LogsService {
5010    constructor(authApi, firestore) {
5011        this.authApi = authApi;
5012        this.firestore = firestore;
5013        this.data = {};
5014        this.authApi.user$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["take"])(1)).subscribe((res) => {
5015            if (res.type === 'Agent' || res.type === 'AgentSecondary') {
5016                this.agent = res;
5017                this.isLoading = false;
5018            }
5019            else if (res.type === 'SuperAdmin') {
5020                this.agent = res;
5021                this.isLoading = false;
5022            }
5023        });
5024    }
5025    dataHistory(agencyId, experience, experienceId, adminAgency, method, agency) {
5026        const options = {
5027            weekday: 'long',
5028            year: 'numeric',
5029            month: 'long',
5030            day: 'numeric',
5031            hour: 'numeric',
5032            minute: 'numeric',
5033            hour12: true
5034        };
5035        const language = navigator.language.split('-')[0];
5036        const dateNow = new Date().toLocaleTimeString(language, options);
5037        switch (method) {
5038            case 'POST':
5039                this.action = 'CREO';
5040                break;
5041            case 'PUT':
5042                this.action = 'EDITO';
5043                break;
5044            case 'DELETE':
5045                this.action = 'ELIMINO';
5046                break;
5047        }
5048        if (experienceId) {
5049            this.data = {
5050                method,
5051                agencyId,
5052                experienceId,
5053                log: `${this.agent.name} ${this.action} la experiencia llamada "${experience.name}" de categoria "${experience.category}" el ${dateNow} de la empresa ${agency.name}`,
5054                createdAt: dateNow
5055            };
5056        }
5057        else if (adminAgency) {
5058            this.data = {
5059                method,
5060                agencyId,
5061                adminAgencyId: adminAgency.key,
5062                log: `${this.agent.name} ${this.action} un administrador de tipo "${adminAgency.type}" llamado "${adminAgency.name}" el ${dateNow} `,
5063                created: dateNow
5064            };
5065        }
5066        else {
5067            this.data = {
5068                method,
5069                agencyId,
5070                log: `${this.agent.name} ${this.action} la empresa "${agency.name}" el ${dateNow} `,
5071                created: dateNow
5072            };
5073        }
5074        this.firestore
5075            .collection('logs')
5076            .add(this.data)
5077            .then(() => {
5078            console.log('Document successfully written!');
5079        })
5080            .catch((error) => {
5081            console.error('Error writing document: ', error);
5082        });
5083    }
5084}
5085LogsService.ɵfac = function LogsService_Factory(t) { return new (t || LogsService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_auth_service__WEBPACK_IMPORTED_MODULE_3__["AuthService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_fire_firestore__WEBPACK_IMPORTED_MODULE_2__["AngularFirestore"])); };
5086LogsService.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: LogsService, factory: LogsService.ɵfac, providedIn: 'root' });
5087/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LogsService, [{
5088        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
5089        args: [{
5090                providedIn: 'root'
5091            }]
5092    }], function () { return [{ type: _auth_service__WEBPACK_IMPORTED_MODULE_3__["AuthService"] }, { type: _angular_fire_firestore__WEBPACK_IMPORTED_MODULE_2__["AngularFirestore"] }]; }, null); })();
5093
5094
5095/***/ }),
5096
5097/***/ "./src/app/shared/sidebar/menu-agent-items.ts":
5098/*!****************************************************!*\
5099  !*** ./src/app/shared/sidebar/menu-agent-items.ts ***!
5100  \****************************************************/
5101/*! exports provided: ROUTESAGENT */
5102/***/ (function(module, __webpack_exports__, __webpack_require__) {
5103
5104"use strict";
5105__webpack_require__.r(__webpack_exports__);
5106/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTESAGENT", function() { return ROUTESAGENT; });
5107const ROUTESAGENT = [
5108    // {
5109    //   path: '/sales/company',
5110    //   title: 'Ventas',
5111    //   icon: 'mdi mdi-chart-pie',
5112    //   class: '',
5113    //   extralink: false,
5114    //   submenu: []
5115    // },
5116    // {
5117    //   path: '/sales/settlement',
5118    //   title: 'Liquidaciones',
5119    //   icon: 'mdi mdi-animation',
5120    //   class: '',
5121    //   extralink: false,
5122    //   submenu: []
5123    // },
5124    {
5125        path: '/experiences/list',
5126        title: 'Experiencias',
5127        icon: 'mdi mdi-heart',
5128        class: '',
5129        extralink: false,
5130        submenu: []
5131    },
5132    {
5133        path: '/experiences/services/blockers',
5134        title: 'Blockers',
5135        icon: 'mdi mdi-lock',
5136        class: '',
5137        extralink: false,
5138        submenu: []
5139    },
5140    // {
5141    //   path: '/sales/list',
5142    //   title: 'Finanzas',
5143    //   icon: 'mdi mdi-calculator',
5144    //   class: '',
5145    //   extralink: false,
5146    //   submenu: []
5147    // },
5148    {
5149        path: '/agents',
5150        title: 'Agentes',
5151        icon: 'mdi mdi-account-multiple',
5152        class: '',
5153        extralink: false,
5154        submenu: []
5155    },
5156    {
5157        path: '/contacts',
5158        title: 'Solicitudes',
5159        icon: 'mdi mdi-email',
5160        class: '',
5161        extralink: false,
5162        submenu: []
5163    },
5164    {
5165        path: '/pos',
5166        title: 'Punto de venta',
5167        icon: 'mdi mdi-store',
5168        class: '',
5169        extralink: false,
5170        submenu: []
5171    },
5172    {
5173        path: '/experiences/calendar',
5174        title: 'Calendario servicios',
5175        icon: 'mdi mdi-calendar',
5176        class: '',
5177        extralink: false,
5178        submenu: []
5179    },
5180    {
5181        path: '/resources',
5182        title: 'Recursos',
5183        icon: 'mdi mdi-animation',
5184        class: '',
5185        extralink: false,
5186        submenu: []
5187    },
5188    {
5189        path: '/statistics',
5190        title: 'Estadísticas',
5191        icon: 'mdi mdi-chart-bar',
5192        class: '',
5193        extralink: false,
5194        submenu: []
5195    },
5196    {
5197        path: '/settings',
5198        title: 'Configuración',
5199        icon: 'mdi mdi-settings',
5200        class: '',
5201        extralink: false,
5202        submenu: []
5203    },
5204    // {
5205    //   path: '/flow',
5206    //   title: 'Pagos Flow',
5207    //   icon: 'mdi mdi-credit-card',
5208    //   class: '',
5209    //   extralink: false,
5210    //   submenu: []
5211    // }
5212    {
5213        path: '/marketing/list',
5214        title: 'Módulo de marketing',
5215        icon: 'mdi mdi-flag-variant',
5216        class: '',
5217        extralink: false,
5218        submenu: []
5219    },
5220];
5221
5222
5223/***/ }),
5224
5225/***/ "./src/app/shared/sidebar/menu-agent-sec-items.ts":
5226/*!********************************************************!*\
5227  !*** ./src/app/shared/sidebar/menu-agent-sec-items.ts ***!
5228  \********************************************************/
5229/*! exports provided: ROUTESAGENTSEC */
5230/***/ (function(module, __webpack_exports__, __webpack_require__) {
5231
5232"use strict";
5233__webpack_require__.r(__webpack_exports__);
5234/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTESAGENTSEC", function() { return ROUTESAGENTSEC; });
5235const ROUTESAGENTSEC = [
5236    {
5237        path: "/experiences/list",
5238        title: "Experiencias",
5239        icon: "mdi mdi-heart",
5240        class: "",
5241        extralink: false,
5242        submenu: [],
5243    },
5244    {
5245        path: '/pos',
5246        title: 'Punto de venta',
5247        icon: 'mdi mdi-store',
5248        class: '',
5249        extralink: false,
5250        submenu: []
5251    },
5252    {
5253        path: "/agents",
5254        title: "Agentes",
5255        icon: "mdi mdi-account-multiple",
5256        class: "",
5257        extralink: false,
5258        submenu: [],
5259    },
5260    {
5261        path: '/experiences/calendar',
5262        title: 'Calendario servicios',
5263        icon: 'mdi mdi-calendar',
5264        class: '',
5265        extralink: false,
5266        submenu: []
5267    },
5268    {
5269        path: '/settings',
5270        title: 'Configuración',
5271        icon: 'mdi mdi-settings',
5272        class: '',
5273        extralink: false,
5274        submenu: []
5275    },
5276];
5277
5278
5279/***/ }),
5280
5281/***/ "./src/app/shared/sidebar/menu-items.ts":
5282/*!**********************************************!*\
5283  !*** ./src/app/shared/sidebar/menu-items.ts ***!
5284  \**********************************************/
5285/*! exports provided: ROUTES */
5286/***/ (function(module, __webpack_exports__, __webpack_require__) {
5287
5288"use strict";
5289__webpack_require__.r(__webpack_exports__);
5290/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTES", function() { return ROUTES; });
5291const ROUTES = [
5292    {
5293        path: '/agencies',
5294        title: 'Agencias',
5295        icon: 'mdi mdi-map',
5296        class: '',
5297        extralink: false,
5298        submenu: []
5299    },
5300    {
5301        path: '/agents',
5302        title: 'Agentes',
5303        icon: 'mdi mdi-account-multiple',
5304        class: '',
5305        extralink: false,
5306        submenu: []
5307    },
5308    {
5309        path: '/settings',
5310        title: 'Configuración',
5311        icon: 'mdi mdi-wrench',
5312        class: '',
5313        extralink: false,
5314        submenu: []
5315    },
5316    {
5317        path: '/agencies/sales',
5318        title: 'Recaudaciones',
5319        icon: 'mdi mdi-chart-pie',
5320        class: '',
5321        extralink: false,
5322        submenu: []
5323    },
5324    {
5325        path: '/agencies/sales-webpay',
5326        title: 'Recaudaciones WP',
5327        icon: 'mdi mdi-credit-card',
5328        class: '',
5329        extralink: false,
5330        submenu: []
5331    },
5332    {
5333        path: '/agencies/settlement',
5334        title: 'Liquidaciones',
5335        icon: 'mdi mdi-coin',
5336        class: '',
5337        extralink: false,
5338        submenu: []
5339    },
5340    // {
5341    //   path: '/agencies/finance',
5342    //   title: 'Finanzas',
5343    //   icon: 'mdi mdi-chart-areaspline',
5344    //   class: '',
5345    //   extralink: false,
5346    //   submenu: []
5347    // },
5348    {
5349        path: '/agencies/calendar',
5350        title: 'Calendario',
5351        icon: 'mdi mdi-calendar',
5352        class: '',
5353        extralink: false,
5354        submenu: []
5355    }
5356];
5357
5358
5359/***/ }),
5360
5361/***/ "./src/app/shared/sidebar/sidebar.component.ts":
5362/*!*****************************************************!*\
5363  !*** ./src/app/shared/sidebar/sidebar.component.ts ***!
5364  \*****************************************************/
5365/*! exports provided: SidebarComponent */
5366/***/ (function(module, __webpack_exports__, __webpack_require__) {
5367
5368"use strict";
5369__webpack_require__.r(__webpack_exports__);
5370/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SidebarComponent", function() { return SidebarComponent; });
5371/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
5372/* harmony import */ var _menu_items__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./menu-items */ "./src/app/shared/sidebar/menu-items.ts");
5373/* harmony import */ var _menu_agent_items__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./menu-agent-items */ "./src/app/shared/sidebar/menu-agent-items.ts");
5374/* harmony import */ var _menu_agent_sec_items__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./menu-agent-sec-items */ "./src/app/shared/sidebar/menu-agent-sec-items.ts");
5375/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
5376/* harmony import */ var _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ng-bootstrap/ng-bootstrap */ "./node_modules/@ng-bootstrap/ng-bootstrap/__ivy_ngcc__/fesm2015/ng-bootstrap.js");
5377/* harmony import */ var _services_auth_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/auth.service */ "./src/app/shared/services/auth.service.ts");
5378/* harmony import */ var _services_cookies_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../services/cookies.service */ "./src/app/shared/services/cookies.service.ts");
5379/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm2015/operators/index.js");
5380/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
5381var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
5382    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5383    return new (P || (P = Promise))(function (resolve, reject) {
5384        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5385        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
5386        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
5387        step((generator = generator.apply(thisArg, _arguments || [])).next());
5388    });
5389};
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405const _c0 = function (a0) { return [a0]; };
5406function SidebarComponent_li_2_div_1_Template(rf, ctx) { if (rf & 1) {
5407    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 10);
5408    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "i", 11);
5409    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "span", 6);
5410    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](3);
5411    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5412    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5413} if (rf & 2) {
5414    const sidebarnavItem_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]().$implicit;
5415    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
5416    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngClass", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](2, _c0, sidebarnavItem_r1.icon));
5417    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
5418    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](sidebarnavItem_r1.title);
5419} }
5420function SidebarComponent_li_2_a_2_Template(rf, ctx) { if (rf & 1) {
5421    const _r7 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
5422    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "a", 12);
5423    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function SidebarComponent_li_2_a_2_Template_a_click_0_listener() { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r7); const sidebarnavItem_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]().$implicit; const ctx_r5 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](); return ctx_r5.addExpandClass(sidebarnavItem_r1.title); });
5424    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "i", 11);
5425    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "span", 6);
5426    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](3);
5427    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5428    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5429} if (rf & 2) {
5430    const sidebarnavItem_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]().$implicit;
5431    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("routerLink", sidebarnavItem_r1.class === "" ? _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](5, _c0, sidebarnavItem_r1.path) : null)("ngClass", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](7, _c0, sidebarnavItem_r1.class))("routerLinkActive", sidebarnavItem_r1.submenu.length != 0 ? "" : "active");
5432    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
5433    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngClass", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](9, _c0, sidebarnavItem_r1.icon));
5434    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
5435    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](sidebarnavItem_r1.title);
5436} }
5437function SidebarComponent_li_2_Template(rf, ctx) { if (rf & 1) {
5438    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "li", 7);
5439    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, SidebarComponent_li_2_div_1_Template, 4, 4, "div", 8);
5440    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, SidebarComponent_li_2_a_2_Template, 4, 11, "a", 9);
5441    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5442} if (rf & 2) {
5443    const sidebarnavItem_r1 = ctx.$implicit;
5444    const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
5445    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("selected", ctx_r0.showMenu === sidebarnavItem_r1.title);
5446    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("routerLinkActive", sidebarnavItem_r1.submenu.length != 0 ? "" : "active");
5447    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
5448    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", sidebarnavItem_r1.extralink === true);
5449    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
5450    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", !sidebarnavItem_r1.extralink);
5451} }
5452class SidebarComponent {
5453    constructor(modalService, router, route, authApi, cookiesApi) {
5454        this.modalService = modalService;
5455        this.router = router;
5456        this.route = route;
5457        this.authApi = authApi;
5458        this.cookiesApi = cookiesApi;
5459        this.showMenu = '';
5460        this.isTypeLogin = null;
5461        this.isSuperAdmin = null;
5462        this.isAgent = null;
5463        this.isAgentSecundary = null;
5464        this.uid = null;
5465        this.typeUser = '';
5466        this.logo = '';
5467        this.nameAgency = '';
5468        this.nameUser = '';
5469    }
5470    // this is for the open close
5471    addExpandClass(element) {
5472        if (element === this.showMenu) {
5473            this.showMenu = '0';
5474        }
5475        else {
5476            this.showMenu = element;
5477        }
5478    }
5479    // End open close
5480    ngOnInit() {
5481        return __awaiter(this, void 0, void 0, function* () {
5482            yield this.authApi.user$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["take"])(1)).subscribe((res) => {
5483                this.typeUser = res.type;
5484                this.logo =
5485                    res.type !== 'SuperAdmin'
5486                        ? res.logoAgency
5487                        : 'https://firebasestorage.googleapis.com/v0/b/heyandes-web.appspot.com/o/src%2Flogo-icon-black.png?alt=media&token=5bf20b84-4555-4bb4-839e-58dbc80dafde';
5488                this.nameAgency = res.nameAgency;
5489                this.nameUser = res.name;
5490            });
5491            yield this.authApi.user$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["take"])(1)).subscribe((res) => {
5492                switch (res.type) {
5493                    case 'SuperAdmin':
5494                        this.sidebarnavItems = _menu_items__WEBPACK_IMPORTED_MODULE_1__["ROUTES"].filter((sidebarnavItem) => sidebarnavItem);
5495                        break;
5496                    case 'Agent':
5497                        this.sidebarnavItems = _menu_agent_items__WEBPACK_IMPORTED_MODULE_2__["ROUTESAGENT"].filter((sidebarnavItem) => sidebarnavItem);
5498                        break;
5499                    case 'AgentSecondary':
5500                        this.sidebarnavItems = _menu_agent_sec_items__WEBPACK_IMPORTED_MODULE_3__["ROUTESAGENTSEC"].filter((sidebarnavItem) => sidebarnavItem);
5501                        break;
5502                }
5503            });
5504        });
5505    }
5506}
5507SidebarComponent.ɵfac = function SidebarComponent_Factory(t) { return new (t || SidebarComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_5__["NgbModal"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_router__WEBPACK_IMPORTED_MODULE_4__["Router"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_router__WEBPACK_IMPORTED_MODULE_4__["ActivatedRoute"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_services_auth_service__WEBPACK_IMPORTED_MODULE_6__["AuthService"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_services_cookies_service__WEBPACK_IMPORTED_MODULE_7__["CookiesService"])); };
5508SidebarComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: SidebarComponent, selectors: [["app-sidebar"]], decls: 8, vars: 1, consts: [[1, "sidebar-nav"], ["id", "sidebarnav"], ["class", "sidebar-item", 3, "selected", "routerLinkActive", 4, "ngFor", "ngForOf"], [1, "sidebar-item"], ["rel", "preload", "href", "https://docs.google.com/forms/d/e/1FAIpQLSdYbzD9tjBSjxKGGbih0GI-SYKL4kayrgncs3cV3K5qINESPw/viewform", "target", "_blank", 1, "sidebar-link", "waves-effect", "waves-dark"], [1, "mdi", "mdi-help-circle"], [1, "hide-menu"], [1, "sidebar-item", 3, "routerLinkActive"], ["class", "nav-small-cap", 4, "ngIf"], ["class", "sidebar-link waves-effect waves-dark", 3, "routerLink", "ngClass", "routerLinkActive", "click", 4, "ngIf"], [1, "nav-small-cap"], [3, "ngClass"], [1, "sidebar-link", "waves-effect", "waves-dark", 3, "routerLink", "ngClass", "routerLinkActive", "click"]], template: function SidebarComponent_Template(rf, ctx) { if (rf & 1) {
5509        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "nav", 0);
5510        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "ul", 1);
5511        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, SidebarComponent_li_2_Template, 3, 5, "li", 2);
5512        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "li", 3);
5513        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "a", 4);
5514        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](5, "i", 5);
5515        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "span", 6);
5516        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](7, "Soporte");
5517        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5518        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5519        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5520        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5521        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5522    } if (rf & 2) {
5523        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
5524        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.sidebarnavItems);
5525    } }, directives: [_angular_common__WEBPACK_IMPORTED_MODULE_9__["NgForOf"], _angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterLinkActive"], _angular_common__WEBPACK_IMPORTED_MODULE_9__["NgIf"], _angular_common__WEBPACK_IMPORTED_MODULE_9__["NgClass"], _angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterLinkWithHref"]], encapsulation: 2 });
5526/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](SidebarComponent, [{
5527        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
5528        args: [{
5529                selector: 'app-sidebar',
5530                templateUrl: './sidebar.component.html'
5531            }]
5532    }], function () { return [{ type: _ng_bootstrap_ng_bootstrap__WEBPACK_IMPORTED_MODULE_5__["NgbModal"] }, { type: _angular_router__WEBPACK_IMPORTED_MODULE_4__["Router"] }, { type: _angular_router__WEBPACK_IMPORTED_MODULE_4__["ActivatedRoute"] }, { type: _services_auth_service__WEBPACK_IMPORTED_MODULE_6__["AuthService"] }, { type: _services_cookies_service__WEBPACK_IMPORTED_MODULE_7__["CookiesService"] }]; }, null); })();
5533
5534
5535/***/ }),
5536
5537/***/ "./src/app/shared/spinner.component.ts":
5538/*!*********************************************!*\
5539  !*** ./src/app/shared/spinner.component.ts ***!
5540  \*********************************************/
5541/*! exports provided: SpinnerComponent */
5542/***/ (function(module, __webpack_exports__, __webpack_require__) {
5543
5544"use strict";
5545__webpack_require__.r(__webpack_exports__);
5546/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpinnerComponent", function() { return SpinnerComponent; });
5547/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
5548/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
5549/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
5550
5551
5552
5553
5554
5555
5556function SpinnerComponent_div_0_Template(rf, ctx) { if (rf & 1) {
5557    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 1);
5558    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "div", 2);
5559    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](2, "div", 3);
5560    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](3, "div", 4);
5561    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5562    _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5563} }
5564class SpinnerComponent {
5565    constructor(router, document) {
5566        this.router = router;
5567        this.document = document;
5568        this.isSpinnerVisible = true;
5569        this.backgroundColor = 'rgba(0, 115, 170, 0.69)';
5570        this.router.events.subscribe(event => {
5571            if (event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_1__["NavigationStart"]) {
5572                this.isSpinnerVisible = true;
5573            }
5574            else if (event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_1__["NavigationEnd"] ||
5575                event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_1__["NavigationCancel"] ||
5576                event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_1__["NavigationError"]) {
5577                this.isSpinnerVisible = false;
5578            }
5579        }, () => {
5580            this.isSpinnerVisible = false;
5581        });
5582    }
5583    ngOnDestroy() {
5584        this.isSpinnerVisible = false;
5585    }
5586}
5587SpinnerComponent.ɵfac = function SpinnerComponent_Factory(t) { return new (t || SpinnerComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_2__["DOCUMENT"])); };
5588SpinnerComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: SpinnerComponent, selectors: [["app-spinner"]], inputs: { backgroundColor: "backgroundColor" }, decls: 1, vars: 1, consts: [["class", "preloader", 4, "ngIf"], [1, "preloader"], [1, "spinner"], [1, "double-bounce1"], [1, "double-bounce2"]], template: function SpinnerComponent_Template(rf, ctx) { if (rf & 1) {
5589        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, SpinnerComponent_div_0_Template, 4, 0, "div", 0);
5590    } if (rf & 2) {
5591        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.isSpinnerVisible);
5592    } }, directives: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["NgIf"]], encapsulation: 2 });
5593/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](SpinnerComponent, [{
5594        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
5595        args: [{
5596                selector: 'app-spinner',
5597                template: `<div class="preloader" *ngIf="isSpinnerVisible">
5598        <div class="spinner">
5599          <div class="double-bounce1"></div>
5600          <div class="double-bounce2"></div>
5601        </div>
5602    </div>`,
5603                encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
5604            }]
5605    }], function () { return [{ type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] }, { type: Document, decorators: [{
5606                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
5607                args: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["DOCUMENT"]]
5608            }] }]; }, { backgroundColor: [{
5609            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
5610        }] }); })();
5611
5612
5613/***/ }),
5614
5615/***/ "./src/app/shared/upload-file/upload-file.component.ts":
5616/*!*************************************************************!*\
5617  !*** ./src/app/shared/upload-file/upload-file.component.ts ***!
5618  \*************************************************************/
5619/*! exports provided: UploadFileComponent */
5620/***/ (function(module, __webpack_exports__, __webpack_require__) {
5621
5622"use strict";
5623__webpack_require__.r(__webpack_exports__);
5624/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UploadFileComponent", function() { return UploadFileComponent; });
5625/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
5626/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/app */ "./node_modules/firebase/app/dist/index.cjs.js");
5627/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(firebase_app__WEBPACK_IMPORTED_MODULE_1__);
5628/* harmony import */ var firebase_storage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! firebase/storage */ "./node_modules/firebase/storage/dist/index.esm.js");
5629
5630
5631
5632
5633class UploadFileComponent {
5634    constructor() {
5635    }
5636    ngOnInit() {
5637    }
5638    uploadFile(event) {
5639        const file = event.target.files[0];
5640        const storageRef = firebase_app__WEBPACK_IMPORTED_MODULE_1___default.a.storage().ref(this.nameFolder);
5641        const fileRef = storageRef.child(file.name);
5642        const task = fileRef.put(file);
5643        console.log(task);
5644    }
5645}
5646UploadFileComponent.ɵfac = function UploadFileComponent_Factory(t) { return new (t || UploadFileComponent)(); };
5647UploadFileComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: UploadFileComponent, selectors: [["app-upload-file"]], inputs: { nameField: "nameField", nameFolder: "nameFolder" }, decls: 4, vars: 1, consts: [[1, "form-group"], ["for", ""], ["type", "file", 1, "form-control", 3, "change"]], template: function UploadFileComponent_Template(rf, ctx) { if (rf & 1) {
5648        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0);
5649        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "label", 1);
5650        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](2);
5651        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5652        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "input", 2);
5653        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function UploadFileComponent_Template_input_change_3_listener($event) { return ctx.uploadFile($event); });
5654        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5655        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
5656    } if (rf & 2) {
5657        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
5658        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate"](ctx.nameField);
5659    } }, styles: ["\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL3NoYXJlZC91cGxvYWQtZmlsZS91cGxvYWQtZmlsZS5jb21wb25lbnQuY3NzIn0= */"] });
5660/*@__PURE__*/ (function () { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](UploadFileComponent, [{
5661        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"],
5662        args: [{
5663                selector: 'app-upload-file',
5664                templateUrl: './upload-file.component.html',
5665                styleUrls: ['./upload-file.component.css']
5666            }]
5667    }], function () { return []; }, { nameField: [{
5668            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"],
5669            args: ['nameField']
5670        }], nameFolder: [{
5671            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"],
5672            args: ['nameFolder']
5673        }] }); })();
5674
5675
5676/***/ }),
5677
5678/***/ "./src/environments/environment.ts":
5679/*!*****************************************!*\
5680  !*** ./src/environments/environment.ts ***!
5681  \*****************************************/
5682/*! exports provided: environment */
5683/***/ (function(module, __webpack_exports__, __webpack_require__) {
5684
5685"use strict";
5686__webpack_require__.r(__webpack_exports__);
5687/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "environment", function() { return environment; });
5688const environment = {
5689    production: true,
5690    firebase: {
5691        apiKey: 'AIzaSyA12kF9Mvox5tbSnsVrx0FjXbZK8vvsjt8',
5692        authDomain: 'heyandes-web.firebaseapp.com',
5693        databaseURL: 'https://heyandes-web.firebaseio.com',
5694        projectId: 'heyandes-web',
5695        storageBucket: 'heyandes-web.appspot.com',
5696        messagingSenderId: '431968500496',
5697        appId: '1:431968500496:web:c2a229311a8b077ecd0395',
5698        measurementId: 'G-24KXN74ZEX'
5699    },
5700    urlBooker: 'https://booker-heyandes.web.app',
5701    urlBookerCopy: 'https://hey-book.com',
5702    urlFunctions: 'https://us-central1-heyandes-web.cloudfunctions.net/webApi/api/v1',
5703    urlAgencyFn: 'https://us-central1-heyandes-web.cloudfunctions.net/agency/api/v1',
5704    urlApiPhp: 'https://www.heyandes-app.com/flow-api-prod',
5705    urlMailing: 'https://us-central1-heyandes-web.cloudfunctions.net/mailing/api/v1',
5706    urlAuth: 'https://us-central1-heyandes-web.cloudfunctions.net/auth/api/v1',
5707    urlFlowPayment: 'https://us-central1-heyandes-web.cloudfunctions.net/flow/api/v1',
5708    urlApiSales: 'https://us-central1-heyandes-web.cloudfunctions.net/sales',
5709    dashboardUrl: 'https://dashboard-heyandes.web.app',
5710    bffCalendar: 'https://us-central1-heyandes-web.cloudfunctions.net/bffcalendar',
5711    helpers: {
5712        cookies: {
5713            name: 'com.heyandes'
5714        }
5715    },
5716    gmapsApi: 'https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyC92E8W5VK-uTuql8ooKti-IyZdlFrQw6s',
5717    panguipulliKey: 'nKSS5K3LvcMzKSYucOh0',
5718    urlApiWebpay: 'https://us-central1-heyandes-web.cloudfunctions.net/webpay/api/v1',
5719    urlMsTransbank: 'https://us-central1-heyandes-web.cloudfunctions.net/ms_transbank/api/v1',
5720    urlApiCurrency: 'https://api.api-ninjas.com/v1/convertcurrency',
5721    apiKeyCurrency: '0qU+UxhtmvnIT85ImG3TzA==tGIWx7jNqsTqLglb',
5722    gmailClientId: '214834274392-jfamn9u1neddkft3gps347e472l3rr37.apps.googleusercontent.com',
5723    urlAnalitycs: 'https://us-central1-heyandes-web.cloudfunctions.net/analitycs/api/v1',
5724    wiredApiUrl: 'https://wired.wubook.net/xrws/',
5725    channelManagerPushNotificationUrl: 'https://us-central1-heyandes-web.cloudfunctions.net/channelManager'
5726};
5727
5728
5729/***/ }),
5730
5731/***/ "./src/main.ts":
5732/*!*********************!*\
5733  !*** ./src/main.ts ***!
5734  \*********************/
5735/*! no exports provided */
5736/***/ (function(module, __webpack_exports__, __webpack_require__) {
5737
5738"use strict";
5739__webpack_require__.r(__webpack_exports__);
5740/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
5741/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./environments/environment */ "./src/environments/environment.ts");
5742/* harmony import */ var _app_app_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./app/app.module */ "./src/app/app.module.ts");
5743/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/platform-browser */ "./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/platform-browser.js");
5744
5745
5746
5747
5748if (_environments_environment__WEBPACK_IMPORTED_MODULE_1__["environment"].production) {
5749    Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["enableProdMode"])();
5750}
5751_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__["platformBrowser"]().bootstrapModule(_app_app_module__WEBPACK_IMPORTED_MODULE_2__["AppModule"])
5752    .catch(err => console.log(err));
5753
5754
5755/***/ })
5755,
5756
5757/***/ 0:
5758/*!***************************!*\
5759  !*** multi ./src/main.ts ***!
5760  \***************************/
5761/*! no static exports found */
5762/***/ (function(module, exports, __webpack_require__) {
5763
5764module.exports = __webpack_require__(/*! /opt/atlassian/pipelines/agent/build/src/main.ts */"./src/main.ts");
5765
5766
5767/***/ }),
5768
5769/***/ 1:
5770/*!********************!*\
5771  !*** fs (ignored) ***!
5772  \********************/
5773/*! no static exports found */
5774/***/ (function(module, exports) {
5775
5776/* (ignored) */
5777
5778/***/ }),
5779
5780/***/ 2:
5781/*!************************!*\
5782  !*** crypto (ignored) ***!
5783  \************************/
5784/*! no static exports found */
5785/***/ (function(module, exports) {
5786
5787/* (ignored) */
5788
5789/***/ }),
5790
5791/***/ 3:
5792/*!************************!*\
5793  !*** stream (ignored) ***!
5794  \************************/
5795/*! no static exports found */
5796/***/ (function(module, exports) {
5797
5798/* (ignored) */
5799
5800/***/ })
5801
5802},[[0,"runtime","vendor"]]]);
5803//# sourceMappingURL=main-es2015.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.