tango-app-ui-shared 3.7.3-dev6-demo5 → 3.7.3-dev6-demo6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8392,6 +8392,1084 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
8392
8392
  args: [{ selector: 'lib-single-clientstore-date', template: "<div class=\"wrapper mx-2\" >\r\n <lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n (selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n\r\n \r\n</div>\r\n<div class=\"wrapper mx-2\" >\r\n<lib-select [items]=\"storeList\" [multi]=\"false\" [searchField]=\"'storeName'\" [disabled]=\"false\" [idField]=\"'storeId'\"\r\n (selected)=\"onStoreSelect($event)\" [selectedValues]=\"[selectedStore]\"></lib-select> \r\n </div> \r\n<div class=\"d-flex align-items-center w-150px position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" type=\"text\" matInput ngxDaterangepickerMd [drops]=\"'down'\"\r\n [opens]=\"'right'\" [showCustomRangeLabel]=\"false\" [alwaysShowCalendars]=\"false\" [autoApply]=\"true\" [singleDatePicker]=\"true\"\r\n [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\" [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1}\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n\r\n<div class=\"btn btn-primary ms-2\" (click)=\"Apply()\">Apply</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:120px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.w-150px{width:160px!important}\n"] }]
8393
8393
  }], ctorParameters: () => [{ type: AuthService }, { type: i1.GlobalStateService }, { type: i0.ChangeDetectorRef }] });
8394
8394
 
8395
+ class ZoneHeaderComponent {
8396
+ auth;
8397
+ router;
8398
+ gs;
8399
+ cd;
8400
+ dayjs = dayjs;
8401
+ isCustomDate = (m) => {
8402
+ if (m.isSame(this.dayjs(), "day")) {
8403
+ return "invalid-date"; // disable today
8404
+ }
8405
+ return false;
8406
+ };
8407
+ selectedDateRange = { startDate: dayjs().subtract(30, 'days'),
8408
+ endDate: dayjs().subtract(1, "days"), };
8409
+ selectedFilters = {
8410
+ client: null,
8411
+ clientName: null,
8412
+ clients: [],
8413
+ store: null,
8414
+ stores: [],
8415
+ date: null,
8416
+ group: [],
8417
+ location: [],
8418
+ country: [],
8419
+ };
8420
+ Opendropdown = false;
8421
+ dropdownOpen = null; // 'location' or 'group'
8422
+ searchLocationText = "";
8423
+ searchGroupText = "";
8424
+ locations = [];
8425
+ filteredLocations = [];
8426
+ groupsData = [];
8427
+ filteredGroups = [];
8428
+ filteredStores = [];
8429
+ stores = [];
8430
+ searchStoreText = '';
8431
+ clientList = [];
8432
+ selectedClient;
8433
+ locationLabel = [];
8434
+ groupLabel = [];
8435
+ users;
8436
+ url;
8437
+ filteredCountries = [];
8438
+ countryLabel = [];
8439
+ searchCountryText = "";
8440
+ countries = [];
8441
+ constructor(auth, router, gs, cd) {
8442
+ this.auth = auth;
8443
+ this.router = router;
8444
+ this.gs = gs;
8445
+ this.cd = cd;
8446
+ }
8447
+ onClick(event) {
8448
+ const target = event.target;
8449
+ if (!target.closest('.dropdown2')) {
8450
+ this.Opendropdown = false;
8451
+ }
8452
+ }
8453
+ closeDropdown1() {
8454
+ this.Opendropdown = false;
8455
+ }
8456
+ zoneData = [
8457
+ {
8458
+ "storeId": "11-1578",
8459
+ "storeName": "LKST1757"
8460
+ },
8461
+ {
8462
+ "storeId": "11-1919",
8463
+ "storeName": "LKST2329"
8464
+ },
8465
+ {
8466
+ "storeId": "11-2222",
8467
+ "storeName": "LKST2554"
8468
+ },
8469
+ {
8470
+ "storeId": "11-2391",
8471
+ "storeName": "LKST2598"
8472
+ },
8473
+ {
8474
+ "storeId": "11-376",
8475
+ "storeName": "LKST646"
8476
+ },
8477
+ {
8478
+ "storeId": "11-82",
8479
+ "storeName": "LKST84"
8480
+ }
8481
+ ];
8482
+ ngOnInit() {
8483
+ // this.setRangesBasedOnRoute();
8484
+ // Listen for route changes to update ranges
8485
+ // this.router?.events?.subscribe((event) => {
8486
+ // if (event instanceof NavigationEnd) {
8487
+ // this.setRangesBasedOnRoute();
8488
+ // }
8489
+ // });
8490
+ this.url = this.router.url.split("?")[0].split('/');
8491
+ const user = JSON.parse(localStorage.getItem('user-info'));
8492
+ this.users = user;
8493
+ this.gs?.manageRefreshTrigger?.subscribe((e) => {
8494
+ if (e) {
8495
+ if (user.userType === 'tango') {
8496
+ this.getClient();
8497
+ }
8498
+ else {
8499
+ const storedFilters = localStorage.getItem("header-filters1");
8500
+ if (storedFilters) {
8501
+ const headerFilters = JSON.parse(storedFilters);
8502
+ this.filteredStores = headerFilters?.stores.map((store) => ({
8503
+ ...store,
8504
+ checked: store.checked
8505
+ }));
8506
+ }
8507
+ }
8508
+ }
8509
+ });
8510
+ // Fetch client data if the user is of type 'tango'
8511
+ if (user.userType === 'tango') {
8512
+ this.getClient();
8513
+ }
8514
+ else {
8515
+ this.getCountry();
8516
+ this.getLocations();
8517
+ this.getGroups();
8518
+ this.getStore();
8519
+ const clientFilters = localStorage.getItem("client-details");
8520
+ if (clientFilters) {
8521
+ const headerclientFilters = JSON.parse(clientFilters);
8522
+ this.selectedClient = {
8523
+ trafficDateRange: headerclientFilters.trafficDateRange
8524
+ };
8525
+ }
8526
+ }
8527
+ // Load filters from localStorage if they exist
8528
+ const storedFilters = localStorage.getItem("header-filters1");
8529
+ if (storedFilters) {
8530
+ const headerFilters = JSON.parse(storedFilters);
8531
+ // Initialize selectedFilters with defaults or existing values
8532
+ this.selectedFilters = {
8533
+ client: headerFilters.client || this.users.client,
8534
+ clientName: headerFilters.clientName || '',
8535
+ clients: headerFilters.clients || [],
8536
+ store: headerFilters.store || null,
8537
+ date: headerFilters.date || {},
8538
+ stores: headerFilters.stores || [],
8539
+ group: headerFilters.group || [],
8540
+ location: headerFilters.location || [],
8541
+ country: headerFilters.country || []
8542
+ };
8543
+ // Sync filtered data with stored selections
8544
+ this.filteredCountries = this.syncWithLocalStorage(headerFilters.country);
8545
+ this.filteredLocations = this.syncWithLocalStorage(headerFilters.location);
8546
+ this.filteredGroups = this.syncWithLocalStorage(headerFilters.group);
8547
+ this.filteredStores = this.syncWithLocalStorage(headerFilters.stores);
8548
+ // Format date range if it exists
8549
+ if (headerFilters.date) {
8550
+ this.selectedDateRange = {
8551
+ startDate: this.dayjs(headerFilters.date.startDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
8552
+ endDate: this.dayjs(headerFilters.date.endDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
8553
+ };
8554
+ }
8555
+ else {
8556
+ this.selectedDateRange = {
8557
+ startDate: this.dayjs(this.selectedDateRange.startDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
8558
+ endDate: this.dayjs(this.selectedDateRange.endDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
8559
+ };
8560
+ }
8561
+ // console.log("3")
8562
+ // Emit data via service and update localStorage
8563
+ this.emitAndStoreFilters();
8564
+ }
8565
+ else {
8566
+ // Initialize empty states if no header filters are present in localStorage
8567
+ this.resetFilters();
8568
+ // console.log("2")
8569
+ }
8570
+ }
8571
+ syncWithLocalStorage(items) {
8572
+ return items
8573
+ ? items.map((item) => ({
8574
+ ...item,
8575
+ checked: item.checked === true
8576
+ }))
8577
+ : [];
8578
+ }
8579
+ emitAndStoreFilters() {
8580
+ this.gs.dataRangeValue.next(this.selectedFilters);
8581
+ localStorage.setItem("header-filters1", JSON.stringify(this.selectedFilters));
8582
+ // console.log("1")
8583
+ }
8584
+ /**
8585
+ * Reset selectedFilters and all related arrays to empty states
8586
+ */
8587
+ resetFilters() {
8588
+ this.selectedFilters = {
8589
+ client: null,
8590
+ clientName: '',
8591
+ clients: [],
8592
+ store: null,
8593
+ date: {},
8594
+ stores: [],
8595
+ group: [],
8596
+ location: [],
8597
+ country: []
8598
+ };
8599
+ this.filteredLocations = [];
8600
+ this.filteredGroups = [];
8601
+ this.filteredStores = [];
8602
+ this.filteredCountries = [];
8603
+ }
8604
+ getClient() {
8605
+ this.auth.getClients().subscribe({
8606
+ next: (e) => {
8607
+ if (e) {
8608
+ this.clientList = e.data.result;
8609
+ const headerFilters = JSON.parse(localStorage.getItem("header-filters1") || "{}");
8610
+ if (headerFilters.client) {
8611
+ this.clientList.find((obj) => {
8612
+ if (obj.clientId === headerFilters.client) {
8613
+ this.selectedClient = obj;
8614
+ }
8615
+ });
8616
+ // const startDate = this.dayjs(headerFilters.date.startDate);
8617
+ // const endDate = this.dayjs(headerFilters.date.endDate);
8618
+ // const differenceInDays = endDate.diff(startDate, 'days');
8619
+ // if (differenceInDays >= 90 && this.selectedClient?.trafficDateRange === 90) {
8620
+ // this.selectedDateRange = {
8621
+ // startDate: this.dayjs(headerFilters.date.startDate, "YYYY-MM-DD").subtract(-90, 'days').format("DD-MM-YYYY"),
8622
+ // endDate: this.dayjs(headerFilters.date.endDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
8623
+ // };
8624
+ // } else {
8625
+ // this.selectedDateRange = {
8626
+ // startDate: this.dayjs(this.selectedDateRange.startDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
8627
+ // endDate: this.dayjs(this.selectedDateRange.endDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
8628
+ // };
8629
+ // }
8630
+ this.selectedFilters.client = headerFilters.client;
8631
+ this.selectedFilters.clientName = headerFilters.clientName;
8632
+ this.selectedFilters.clients = headerFilters.clients;
8633
+ this.selectedFilters.store = headerFilters.store;
8634
+ this.selectedFilters.date = headerFilters.date;
8635
+ this.selectedFilters.stores = headerFilters.stores;
8636
+ this.selectedFilters.group = headerFilters.group;
8637
+ this.selectedFilters.location = headerFilters.location;
8638
+ this.selectedFilters.country = headerFilters.country;
8639
+ this.gs.dataRangeValue.next(this.selectedFilters);
8640
+ // console.log("2")
8641
+ // Ensure locations and groups are loaded before fetching stores
8642
+ this.getCountry();
8643
+ this.getLocations();
8644
+ this.getGroups();
8645
+ // Fetch stores only after locations and groups are set
8646
+ this.getStore();
8647
+ }
8648
+ else {
8649
+ this.selectedClient = this.clientList[0];
8650
+ this.selectedFilters.client = this.selectedClient.clientId;
8651
+ this.selectedFilters.clientName = this.selectedClient.clientName;
8652
+ this.selectedFilters.clients = headerFilters.clients;
8653
+ this.selectedFilters.store = headerFilters.store;
8654
+ this.selectedFilters.date = headerFilters.date;
8655
+ this.selectedFilters.stores = headerFilters.stores;
8656
+ this.selectedFilters.group = headerFilters.group;
8657
+ this.selectedFilters.location = headerFilters.location;
8658
+ this.selectedFilters.country = headerFilters.country;
8659
+ localStorage.setItem("header-filters1", JSON.stringify(this.selectedFilters));
8660
+ this.gs.dataRangeValue.next(this.selectedFilters);
8661
+ // console.log("3")
8662
+ this.cd.detectChanges();
8663
+ // Ensure locations and groups are loaded before fetching stores
8664
+ this.getCountry();
8665
+ this.getLocations();
8666
+ this.getGroups();
8667
+ // Fetch stores only after locations and groups are set
8668
+ this.getStore();
8669
+ }
8670
+ }
8671
+ else {
8672
+ this.selectedClient = this.clientList[0];
8673
+ this.selectedFilters.client = this.selectedClient.clientId;
8674
+ this.selectedFilters.clientName = this.selectedClient.clientName;
8675
+ // Ensure locations and groups are loaded before fetching stores
8676
+ this.getCountry();
8677
+ this.getLocations();
8678
+ this.getGroups();
8679
+ // Fetch stores only after locations and groups are set
8680
+ this.getStore();
8681
+ localStorage.setItem("header-filters1", JSON.stringify(this.selectedFilters));
8682
+ this.gs.dataRangeValue.next(this.selectedFilters);
8683
+ // console.log("4")
8684
+ this.cd.detectChanges();
8685
+ }
8686
+ this.getUserInfo(this.selectedFilters.client);
8687
+ },
8688
+ });
8689
+ }
8690
+ getUserInfo(client) {
8691
+ let obj = {
8692
+ clientId: client ? client : ''
8693
+ };
8694
+ if (client) {
8695
+ this.auth.getHeaderUsers(obj).subscribe({
8696
+ next: (e) => {
8697
+ localStorage.setItem("usersEmail-info", JSON.stringify(e?.data?.userEmailData || []));
8698
+ }
8699
+ });
8700
+ }
8701
+ }
8702
+ onClientSelect(event) {
8703
+ // Update the selected client
8704
+ this.selectedClient = event;
8705
+ // Clear previous filtered data and selections
8706
+ this.filteredGroups = [];
8707
+ this.filteredStores = [];
8708
+ this.filteredLocations = [];
8709
+ this.selectedFilters.stores = [];
8710
+ this.selectedFilters.group = [];
8711
+ this.selectedFilters.location = [];
8712
+ this.selectedFilters.country = [];
8713
+ // Fetch header filters from localStorage
8714
+ const headerFilters = JSON.parse(localStorage.getItem("header-filters1") || "{}");
8715
+ // Update the selected filters with the new client
8716
+ this.selectedFilters.client = this.selectedClient.clientId;
8717
+ this.selectedFilters.clientName = this.selectedClient.clientName;
8718
+ // Remove old store, group, and location data from the header filters
8719
+ delete headerFilters.stores;
8720
+ delete headerFilters.groups;
8721
+ delete headerFilters.location;
8722
+ delete headerFilters.country;
8723
+ // Fetch new data based on the new client
8724
+ this.getCountry();
8725
+ this.getLocations();
8726
+ this.getStore();
8727
+ this.getGroups();
8728
+ // Update localStorage with the new client selection and empty filter data
8729
+ localStorage.setItem('header-filters1', JSON.stringify(this.selectedFilters));
8730
+ window.location.reload();
8731
+ // Emit data to the global service
8732
+ // this.gs.dataRangeValue.next(this.selectedFilters);
8733
+ // Trigger change detection to reflect UI changes
8734
+ this.cd.detectChanges();
8735
+ }
8736
+ ranges = {
8737
+ // Today: [dayjs(), dayjs()],
8738
+ Yesterday: [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
8739
+ 'This Week': [dayjs().subtract(7, 'days'), dayjs().subtract(1, 'days')],
8740
+ 'Last Week': [
8741
+ dayjs().subtract(14, 'days').startOf('day'),
8742
+ dayjs().subtract(8, 'days').endOf('day'),
8743
+ ],
8744
+ 'This Month': [dayjs().subtract(30, 'days'), dayjs().subtract(1, 'days')],
8745
+ 'Last Month': [
8746
+ dayjs().subtract(1, 'month').startOf('month'),
8747
+ dayjs().subtract(1, 'month').endOf('month'),
8748
+ ],
8749
+ };
8750
+ onStartDateChange(event) {
8751
+ if (this.dayjs(event.startDate).isValid()) {
8752
+ if (this.selectedClient?.traxDateRange === 90) {
8753
+ this.isCustomDate = (m) => {
8754
+ const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(90, "days"));
8755
+ return isValidDate ? "invalid-date" : false;
8756
+ };
8757
+ }
8758
+ else {
8759
+ this.isCustomDate = (m) => {
8760
+ const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(180, "days"));
8761
+ return isValidDate ? "invalid-date" : false;
8762
+ };
8763
+ }
8764
+ }
8765
+ }
8766
+ datechange(event) {
8767
+ if (event && event.startDate && event.endDate) {
8768
+ if (this.dayjs(event.startDate).isValid() &&
8769
+ this.dayjs(event.endDate).isValid()) {
8770
+ this.selectedDateRange.startDate = event.startDate;
8771
+ this.selectedDateRange.endDate = event.endDate;
8772
+ var datetime = {
8773
+ startDate: this.dayjs(event.startDate, "DD-MM-YYYY").format("YYYY-MM-DD"),
8774
+ endDate: this.dayjs(event.endDate, "DD-MM-YYYY").format("YYYY-MM-DD"),
8775
+ };
8776
+ this.selectedFilters.date = datetime;
8777
+ localStorage.setItem("header-filters1", JSON.stringify(this.selectedFilters));
8778
+ window.location.reload();
8779
+ // this.gs.dataRangeValue.next(this.selectedFilters);
8780
+ }
8781
+ }
8782
+ }
8783
+ opendropdown(e) {
8784
+ e.stopPropagation();
8785
+ this.Opendropdown = !this.Opendropdown;
8786
+ }
8787
+ getLocations() {
8788
+ const country = this.countries
8789
+ .filter(country => country.checked)
8790
+ .map(country => country.country);
8791
+ // const headerFilters: any = JSON.parse(localStorage.getItem("header-filters1") || "{}");
8792
+ let obj = {
8793
+ clientId: this.selectedFilters.client ? this.selectedFilters.client : this.users.clientId,
8794
+ country,
8795
+ city: [],
8796
+ group: [],
8797
+ };
8798
+ this.auth.getLocation(obj).subscribe({
8799
+ next: (res) => {
8800
+ let cityList = this.selectedFilters?.location?.filter((location) => location.checked).map((loc) => loc.city);
8801
+ // Map the fetched locations with default unchecked state
8802
+ this.locations = res?.data?.locationData.map((city) => ({
8803
+ city: city.city,
8804
+ // checked: cityList?.length ? cityList.includes(city.city) : true,
8805
+ checked: cityList?.includes(city.city) ? true : false,
8806
+ }));
8807
+ // Sync the fetched locations with any stored checked values in localStorage
8808
+ if (this.selectedFilters.location && Array.isArray(this.selectedFilters.location)) {
8809
+ this.filteredLocations = this.locations.map(location => {
8810
+ const matchedLocation = this.selectedFilters.location.find((loc) => loc.city === location.city);
8811
+ return matchedLocation ? { ...location, checked: matchedLocation.checked } : location;
8812
+ });
8813
+ }
8814
+ else {
8815
+ this.filteredLocations = this.locations;
8816
+ }
8817
+ if (this.searchLocationText) {
8818
+ this.filteredLocations = this.locations.filter((location) => location.city.toLowerCase().includes(this.searchLocationText.toLowerCase()));
8819
+ }
8820
+ const selectedLocations = this.locations.filter((location) => location.checked).map((location) => location.city);
8821
+ if (selectedLocations.length > 0) {
8822
+ setTimeout(() => {
8823
+ this.getGroups();
8824
+ this.getStore(); // Fetch stores based on selected groups
8825
+ }, 1000);
8826
+ }
8827
+ if (!selectedLocations.length && country.length) {
8828
+ this.getGroups();
8829
+ }
8830
+ },
8831
+ error: (err) => {
8832
+ console.error("Failed to fetch locations", err);
8833
+ },
8834
+ });
8835
+ }
8836
+ isAllLocationsSelected() {
8837
+ return this.filteredLocations.every(location => location.checked);
8838
+ }
8839
+ selectedLocationsLabel() {
8840
+ const selectedLocations = this.locationLabel = this.searchLocationText.length ? this.locations
8841
+ .filter(location => location.checked).map(location => location.city) : this.filteredLocations
8842
+ .filter(location => location.checked).map(location => location.city);
8843
+ return selectedLocations.length === 0
8844
+ ? ''
8845
+ : selectedLocations.length === 1
8846
+ ? selectedLocations[0]
8847
+ : `${selectedLocations.length} Regions`;
8848
+ }
8849
+ removeLocation() {
8850
+ this.Reset();
8851
+ }
8852
+ getGroups() {
8853
+ const country = this.countries
8854
+ .filter(country => country.checked)
8855
+ .map(country => country.country);
8856
+ let city;
8857
+ city = this.locations
8858
+ .filter(location => location.checked)
8859
+ .map(location => location.city);
8860
+ if (!city.length && country.length) {
8861
+ city = this.locations.map((loc) => loc.city);
8862
+ }
8863
+ const obj = { country, city, clientId: this.selectedFilters.client ? this.selectedFilters.client : this.users.clientId, group: [] };
8864
+ this.auth.getGroups(obj).subscribe({
8865
+ next: (res) => {
8866
+ let checkedGroup = this.selectedFilters?.group?.filter((group) => group.checked).map((group) => group.groupName);
8867
+ const combinedGroups = res?.data?.groupData?.map((groupName) => ({
8868
+ groupName: groupName.groupName,
8869
+ checked: checkedGroup?.includes(groupName.groupName) ? true : false,
8870
+ // checked: checkedGroup?.length ? checkedGroup.includes(groupName.groupName) : true,
8871
+ }));
8872
+ this.groupsData = combinedGroups;
8873
+ if (this.searchGroupText.length) {
8874
+ this.filteredGroups = combinedGroups.filter((item) => item.groupName.toLowerCase().includes(this.searchGroupText));
8875
+ }
8876
+ else {
8877
+ this.filteredGroups = combinedGroups;
8878
+ }
8879
+ // Auto-fetch stores when groups are selected
8880
+ const selectedGroups = this.groupsData.filter((group) => group.checked).map((group) => group.groupName);
8881
+ if (selectedGroups.length > 0) {
8882
+ setTimeout(() => {
8883
+ this.getStore(); // Fetch stores based on selected groups
8884
+ }, 1000);
8885
+ }
8886
+ },
8887
+ error: (err) => {
8888
+ console.error("Failed to fetch groups", err);
8889
+ },
8890
+ });
8891
+ }
8892
+ toggleDropdown(type) {
8893
+ if (this.dropdownOpen === type) {
8894
+ // If the dropdown is open, close it and avoid resetting the selected values unnecessarily
8895
+ this.dropdownOpen = null;
8896
+ }
8897
+ else {
8898
+ // Open the specific dropdown and handle data fetching only if necessary
8899
+ this.dropdownOpen = type;
8900
+ if (type === 'country') {
8901
+ // Fetch countries only if not already fetched and no search text exists
8902
+ if ((!this.filteredCountries || this.filteredCountries.length === 0) && !this.searchCountryText.trim()) {
8903
+ this.getCountry();
8904
+ }
8905
+ }
8906
+ if (type === 'group') {
8907
+ // Fetch groups only if there are selected cities and no active search text
8908
+ const selectedCities = this.locations
8909
+ .filter((location) => location.checked)
8910
+ .map((location) => location.city);
8911
+ // Fetch groups only if locations are selected, no search text exists, and dropdown is opened
8912
+ if (this.filteredLocations.length > 0 || (selectedCities.length > 0 && !this.searchGroupText.trim())) {
8913
+ this.getGroups();
8914
+ }
8915
+ else {
8916
+ this.filteredGroups = []; // Clear groups if no locations are selected
8917
+ }
8918
+ }
8919
+ if (type === 'store') {
8920
+ // Fetch stores only if not already fetched and no search text is active
8921
+ if ((!this.filteredStores || this.filteredStores.length === 0) && !this.searchStoreText.trim()) {
8922
+ this.getStore();
8923
+ }
8924
+ }
8925
+ }
8926
+ }
8927
+ handleGroupDropdownClick() {
8928
+ if (this.dropdownOpen === 'group') {
8929
+ this.resetSelectedGroups();
8930
+ }
8931
+ this.toggleDropdown('group');
8932
+ }
8933
+ resetSelectedGroups() {
8934
+ this.filteredGroups.forEach((group) => (group.checked = false));
8935
+ this.searchGroupText = "";
8936
+ }
8937
+ selectedGroupsLabel() {
8938
+ const selectedGroups = this.groupLabel = this.searchGroupText.length ? this.groupsData.filter((group) => group.checked) : this.filteredGroups.filter((group) => group.checked);
8939
+ return selectedGroups.length === 0
8940
+ ? ""
8941
+ : selectedGroups.length === 1
8942
+ ? selectedGroups[0].groupName
8943
+ : `${selectedGroups.length} Clusters`;
8944
+ }
8945
+ removeGroup() {
8946
+ this.Reset();
8947
+ }
8948
+ isAllGroupsSelected() {
8949
+ return this.filteredGroups.length ? this.filteredGroups.every((group) => group.checked) : false;
8950
+ }
8951
+ getStore() {
8952
+ const country = this.countries
8953
+ .filter(country => country.checked)
8954
+ .map(country => country.country);
8955
+ const city = this.locations
8956
+ .filter(location => location.checked)
8957
+ .map(location => location.city);
8958
+ const group = this.groupsData
8959
+ .filter(group => group.checked)
8960
+ .map(group => group.groupName);
8961
+ const data = {
8962
+ country,
8963
+ city,
8964
+ clusters: group,
8965
+ clientId: this.users.clientId || this.selectedFilters.client
8966
+ };
8967
+ this.auth.getHeaderStores(data).subscribe({
8968
+ next: (res) => {
8969
+ if (res && res.code === 200) {
8970
+ // Initialize stores from API response
8971
+ this.stores = this.zoneData;
8972
+ // Check if there are previously selected stores
8973
+ const checkedStoreIds = this.selectedFilters?.stores
8974
+ ? this.selectedFilters.stores.filter((store) => store.checked).map((store) => store.storeId)
8975
+ : [];
8976
+ // Sync the `checked` state
8977
+ this.stores.forEach(store => {
8978
+ store.checked = checkedStoreIds.length
8979
+ ? checkedStoreIds.includes(store.storeId) // Use previous selection
8980
+ : true; // Default to true if no previous selection
8981
+ });
8982
+ // Apply search filter if search text is present
8983
+ if (this.searchStoreText.length) {
8984
+ this.filteredStores = this.stores.filter(store => store.storeName.toLowerCase().includes(this.searchStoreText.toLowerCase()));
8985
+ }
8986
+ else {
8987
+ this.filteredStores = [...this.stores];
8988
+ }
8989
+ // Update `selectedFilters.stores` to reflect the current state
8990
+ this.selectedFilters.stores = this.filteredStores.map(store => ({
8991
+ storeId: store.storeId,
8992
+ storeName: store.storeName,
8993
+ checked: store.checked
8994
+ }));
8995
+ // this.selectedFilters.country = country;
8996
+ // Save updated filters to localStorage
8997
+ localStorage.setItem('header-filters1', JSON.stringify(this.selectedFilters));
8998
+ // Trigger UI change detection
8999
+ this.cd.detectChanges();
9000
+ }
9001
+ else {
9002
+ // Handle empty or error response
9003
+ this.clearStoresState();
9004
+ }
9005
+ },
9006
+ error: (err) => {
9007
+ console.error("Failed to fetch stores", err);
9008
+ this.clearStoresState();
9009
+ }
9010
+ });
9011
+ }
9012
+ // Clear stores state and reset filters
9013
+ clearStoresState() {
9014
+ this.stores = [];
9015
+ this.filteredStores = [];
9016
+ this.selectedFilters.stores = [];
9017
+ localStorage.setItem('header-filters1', JSON.stringify(this.selectedFilters));
9018
+ }
9019
+ resetSelectedStores() {
9020
+ this.filteredStores.forEach((store) => (store.checked = false));
9021
+ this.searchStoreText = "";
9022
+ }
9023
+ selectedStoresLabel() {
9024
+ const selectedStores = this.searchStoreText.length ? this.stores.filter((store) => store.checked) : this.filteredStores.filter((store) => store.checked);
9025
+ return selectedStores.length === 0
9026
+ ? "0 Stores"
9027
+ : selectedStores.length === 1
9028
+ ? selectedStores[0].storeName
9029
+ : `${selectedStores.length} Stores`;
9030
+ }
9031
+ isAllStoresSelected() {
9032
+ return this.filteredStores.length > 0 && this.filteredStores.every(store => store.checked);
9033
+ }
9034
+ // Method to handle dropdown item selection
9035
+ updateSelectedStores() {
9036
+ this.filteredStores.forEach(store => {
9037
+ const filteredStore = this.stores.findIndex(fStore => fStore.storeId === store.storeId);
9038
+ if (filteredStore != -1) {
9039
+ this.stores[filteredStore].checked = store.checked; // Sync the checked state with full store list
9040
+ }
9041
+ });
9042
+ // Update selectedFilters based on the current store selection
9043
+ this.selectedFilters.stores = this.stores.filter(store => store.checked);
9044
+ // Update localStorage with the latest selection
9045
+ localStorage.setItem('header-filters1', JSON.stringify(this.selectedFilters));
9046
+ // Emit updated filters via service
9047
+ // this.gs.dataRangeValue.next(this.selectedFilters);
9048
+ // Trigger change detection if necessary
9049
+ this.cd.detectChanges();
9050
+ }
9051
+ toggleSelectAllLocations(event) {
9052
+ const isChecked = event.target.checked;
9053
+ this.filteredLocations.forEach((location) => (location.checked = isChecked));
9054
+ this.updateSelectedLocations();
9055
+ }
9056
+ toggleSelectAllStores(event) {
9057
+ const checked = event.target.checked;
9058
+ // Apply the selection to both filtered and full list of stores
9059
+ this.filteredStores.forEach(store => store.checked = checked);
9060
+ this.stores.forEach(store => {
9061
+ const filteredStore = this.filteredStores.find(fStore => fStore.storeId === store.storeId);
9062
+ if (filteredStore) {
9063
+ store.checked = checked; // Sync the checked state with full store list
9064
+ }
9065
+ });
9066
+ // Update the selected stores and persist the selection
9067
+ this.updateSelectedStores();
9068
+ }
9069
+ updateSelectedLocations() {
9070
+ // When locations are selected, fetch the related groups
9071
+ const selectedCities = this.filteredLocations
9072
+ .filter((location) => location.checked)
9073
+ .map((location) => location.city);
9074
+ this.filteredLocations.forEach((location) => {
9075
+ let findLocationIndex = this.locations.findIndex((loc) => loc.city == location.city);
9076
+ if (findLocationIndex != -1) {
9077
+ this.locations[findLocationIndex].checked = location.checked;
9078
+ }
9079
+ });
9080
+ if (selectedCities.length > 0 || !selectedCities.length) {
9081
+ this.selectedFilters.stores = [];
9082
+ this.groupsData = [];
9083
+ this.getGroups(); // Fetch groups based on selected cities
9084
+ // If there are selected groups, fetch the stores based on selected groups
9085
+ this.getStore();
9086
+ this.selectedFilters.location = this.locations;
9087
+ }
9088
+ else {
9089
+ this.filteredGroups = []; // Clear groups if no locations are selected
9090
+ this.selectedFilters.location = [];
9091
+ }
9092
+ this.selectedFilters.group = [];
9093
+ this.filteredStores = []; // Reset stores as well
9094
+ this.searchGroupText = '';
9095
+ this.searchStoreText = '';
9096
+ // this.Opendropdown = false;
9097
+ }
9098
+ toggleSelectAllGroups(event) {
9099
+ const isChecked = event.target.checked;
9100
+ this.filteredGroups.forEach((group) => (group.checked = isChecked));
9101
+ this.updateSelectedGroups();
9102
+ }
9103
+ updateSelectedGroups() {
9104
+ // Fetch the relevant stores after groups are selected
9105
+ const selectedGroups = this.filteredGroups
9106
+ .filter((group) => group.checked)
9107
+ .map((group) => group.groupName);
9108
+ this.filteredGroups.forEach((group) => {
9109
+ let findGroupIndex = this.groupsData.findIndex((item) => item.groupName == group.groupName);
9110
+ if (findGroupIndex != -1) {
9111
+ this.groupsData[findGroupIndex].checked = group.checked;
9112
+ }
9113
+ });
9114
+ if (selectedGroups.length > 0 || !selectedGroups.length) {
9115
+ this.selectedFilters.stores = [];
9116
+ // If there are selected groups, fetch the stores based on selected groups
9117
+ this.getStore();
9118
+ this.selectedFilters.group = this.groupsData;
9119
+ }
9120
+ else {
9121
+ // If no groups are selected, clear the stores list
9122
+ this.filteredStores = [];
9123
+ // Also, update localStorage to reflect the cleared store selection
9124
+ this.selectedFilters.stores = [];
9125
+ localStorage.setItem('header-filters1', JSON.stringify(this.selectedFilters));
9126
+ // Emit data via service
9127
+ // this.gs.dataRangeValue.next(this.selectedFilters);
9128
+ }
9129
+ // Clear the search store text when groups are updated
9130
+ this.searchStoreText = '';
9131
+ }
9132
+ Reset() {
9133
+ setTimeout(() => {
9134
+ // Clear selected groups, stores, and locations
9135
+ this.filteredCountries = [];
9136
+ this.filteredGroups = [];
9137
+ this.filteredStores = [];
9138
+ this.filteredLocations = []; // Reset locations as well
9139
+ this.locations = [];
9140
+ this.groupsData = [];
9141
+ this.stores = [];
9142
+ this.countries = [];
9143
+ // Clear search input fields
9144
+ this.searchLocationText = "";
9145
+ this.searchGroupText = "";
9146
+ this.searchStoreText = "";
9147
+ this.selectedFilters.stores = [];
9148
+ this.selectedFilters.group = [];
9149
+ this.selectedFilters.location = [];
9150
+ this.selectedFilters.country = [];
9151
+ // Fetch locations, groups, and stores again
9152
+ this.getCountry();
9153
+ this.getLocations();
9154
+ this.getStore();
9155
+ this.getGroups();
9156
+ // Reset the filters in selectedFilters
9157
+ // // Once stores are fetched, mark all as checked
9158
+ // setTimeout(() => {
9159
+ // this.filteredStores = this.stores.map(store => ({
9160
+ // ...store,
9161
+ // checked: true // Mark all stores as checked
9162
+ // }));
9163
+ // // Sync selectedFilters with the updated store state
9164
+ // this.selectedFilters.stores = this.filteredStores.map(store => ({
9165
+ // ...store,
9166
+ // checked: true
9167
+ // }));
9168
+ // Update localStorage with the latest selectedFilters
9169
+ localStorage.setItem('header-filters1', JSON.stringify(this.selectedFilters));
9170
+ window.location.reload();
9171
+ // Emit the reset filters to update other components if needed
9172
+ // this.gs.dataRangeValue.next(this.selectedFilters);
9173
+ // Trigger change detection
9174
+ this.cd.detectChanges();
9175
+ // Adding a slight delay to ensure stores are fetched first
9176
+ // Close dropdown after reset if necessary
9177
+ this.Opendropdown = false;
9178
+ }, 100);
9179
+ }
9180
+ filterLocations() {
9181
+ const searchText = this.searchLocationText.toLowerCase();
9182
+ if (searchText) {
9183
+ // Preserve the checked state during filtering
9184
+ this.filteredLocations = this.locations
9185
+ .map(location => ({
9186
+ ...location,
9187
+ checked: this.filteredLocations.find(l => l.city === location.city)?.checked || false
9188
+ }))
9189
+ .filter(location => location?.city?.toLowerCase().includes(searchText));
9190
+ }
9191
+ else {
9192
+ // Restore the original checked state when search text is cleared
9193
+ this.filteredLocations = this.locations.map(location => ({
9194
+ ...location,
9195
+ checked: this.selectedFilters.location.find((l) => l.city === location.city)?.checked || false
9196
+ }));
9197
+ }
9198
+ }
9199
+ filterGroups() {
9200
+ const searchText = this.searchGroupText.toLowerCase();
9201
+ if (searchText) {
9202
+ // Preserve the checked state during filtering
9203
+ this.filteredGroups = this.groupsData
9204
+ .map(group => ({
9205
+ ...group,
9206
+ checked: this.filteredGroups.find(g => g.groupName === group.groupName)?.checked || false
9207
+ }))
9208
+ .filter(group => group?.groupName?.toLowerCase().includes(searchText));
9209
+ }
9210
+ else {
9211
+ // Restore the original checked state when search text is cleared
9212
+ this.filteredGroups = this.groupsData.map(group => ({
9213
+ ...group,
9214
+ checked: this.selectedFilters.group.find((g) => g.groupName === group.groupName)?.checked || false
9215
+ }));
9216
+ }
9217
+ }
9218
+ filterStores() {
9219
+ const searchText = this.searchStoreText.toLowerCase();
9220
+ // Preserve checked states during filtering
9221
+ if (searchText) {
9222
+ // Filter based on search text while preserving checked state
9223
+ this.filteredStores = this.stores
9224
+ .map(store => ({
9225
+ ...store,
9226
+ // Check if the store is already checked in filteredStores, fallback to original stores' checked state
9227
+ checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked || store.checked || false
9228
+ }))
9229
+ .filter(store => store.storeName.toLowerCase().includes(searchText));
9230
+ }
9231
+ else {
9232
+ // When the search text is cleared, restore the original list with preserved checked states
9233
+ this.filteredStores = this.stores.map(store => ({
9234
+ ...store,
9235
+ // Preserve the checked state based on the selected filters
9236
+ checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked || store.checked || false
9237
+ }));
9238
+ }
9239
+ }
9240
+ closeDropdown() {
9241
+ this.dropdownOpen = null;
9242
+ }
9243
+ clickOutside(event) {
9244
+ const clickedInside = event.target.closest(".dropdown-container");
9245
+ const clickedoutSide = event.target.closest(".dropdown2");
9246
+ if (!clickedInside) {
9247
+ this.closeDropdown();
9248
+ }
9249
+ if (!clickedoutSide) {
9250
+ this.closeDropdown1();
9251
+ }
9252
+ }
9253
+ // getCountry(): void {
9254
+ // // const headerFilters: any = JSON.parse(localStorage.getItem("header-filters1") || "{}");
9255
+ // let obj ={
9256
+ // clientId: this.selectedFilters.client ? this.selectedFilters.client :this.users.clientId,
9257
+ // }
9258
+ // this.auth.getCountry(obj).subscribe({
9259
+ // next: (res: any) => {
9260
+ // let countryList = this.selectedFilters?.country?.filter((country:any) => country.checked).map((loc:any) => loc.allCountry);
9261
+ // // Map the fetched countries with default unchecked state
9262
+ // this.countires = res?.data?.countryData.map((allCountry: any) => ({
9263
+ // allCountry: allCountry.allCountry,
9264
+ // checked: countryList?.includes(allCountry.allCountry) ? true : false,
9265
+ // }));
9266
+ // // Sync the fetched countries with any stored checked values in localStorage
9267
+ // if (this.selectedFilters.country && Array.isArray(this.selectedFilters.country)) {
9268
+ // this.filteredCountries = this.countries.map(country => {
9269
+ // const matchedLocation = this.selectedFilters.country.find((loc: any) => loc.allCountry === country.allCountry);
9270
+ // return matchedLocation ? { ...country, checked: matchedLocation.checked } : country;
9271
+ // });
9272
+ // } else {
9273
+ // this.filteredCountries = this.countries;
9274
+ // }
9275
+ // if(this.searchLocationText) {
9276
+ // this.filteredCountries = this.countries.filter((country:any) => country.city.toLowerCase().includes(this.searchLocationText.toLowerCase()))
9277
+ // }
9278
+ // const selectedCountries = this.countries.filter((country) => country.checked).map((country) => country.allCountry);
9279
+ // if (selectedCountries.length > 0) {
9280
+ // setTimeout(()=>{
9281
+ // this.getStore(); // Fetch stores based on selected groups
9282
+ // },1000)
9283
+ // }
9284
+ // },
9285
+ // error: (err) => {
9286
+ // console.error("Failed to fetch countries", err);
9287
+ // },
9288
+ // });
9289
+ // }
9290
+ // selectedCountriesLabel(): string {
9291
+ // const selectedCountries = this.countryLabel = this.searchLocationText.length ? this.countries
9292
+ // .filter(country => country.checked).map(country => country.allCountry) : this.filteredCountries
9293
+ // .filter(country => country.checked).map(country => country.allCountry);
9294
+ // return selectedCountries.length === 0
9295
+ // ? ''
9296
+ // : selectedCountries.length === 1
9297
+ // ? selectedCountries[0]
9298
+ // : `${selectedCountries.length} countries`;
9299
+ // }
9300
+ // isAllCountriesSelected(): boolean {
9301
+ // return this.filteredCountries.every(country => country.checked);
9302
+ // }
9303
+ // filterCountries(): void {
9304
+ // const searchText = this.searchCountryText.toLowerCase();
9305
+ // if (searchText) {
9306
+ // // Preserve the checked state during filtering
9307
+ // this.filteredCountries = this.countires
9308
+ // .map(country => ({
9309
+ // ...country,
9310
+ // checked: this.filteredCountries.find(l => l.allCountry === country.allCountry)?.checked || false
9311
+ // }))
9312
+ // .filter(location =>
9313
+ // location?.allCountry?.toLowerCase().includes(searchText)
9314
+ // );
9315
+ // } else {
9316
+ // // Restore the original checked state when search text is cleared
9317
+ // this.filteredCountries = this.countires.map(country => ({
9318
+ // ...country,
9319
+ // checked: this.selectedFilters.country.find((l:any) => l.allCountry === country.allCountry)?.checked || false
9320
+ // }));
9321
+ // }
9322
+ // }
9323
+ getCountry() {
9324
+ let obj = {
9325
+ clientId: this.selectedFilters.client ? this.selectedFilters.client : this.users.clientId,
9326
+ };
9327
+ this.auth.getCountry(obj).subscribe({
9328
+ next: (res) => {
9329
+ // Extract selected countries from existing filters (if any)
9330
+ let countryList = this.selectedFilters?.country?.filter((country) => country.checked).map((loc) => loc.country);
9331
+ // Map API response to frontend model
9332
+ this.countries = res?.data?.countryData.map((item) => ({
9333
+ country: item.country,
9334
+ // checked: countryList?.length ? countryList.includes(item.country) : true,
9335
+ // checked: cityList?.length ? cityList.includes(city.city) : true,
9336
+ checked: countryList?.includes(item.country) ? true : false,
9337
+ }));
9338
+ if (this.selectedFilters.country && Array.isArray(this.selectedFilters.country)) {
9339
+ this.filteredCountries = this.countries.map(location => {
9340
+ const matchedLocation = this.selectedFilters.country.find((loc) => loc.country === location.country);
9341
+ return matchedLocation ? { ...location, checked: matchedLocation.checked } : location;
9342
+ });
9343
+ }
9344
+ else {
9345
+ this.filteredCountries = this.countries;
9346
+ }
9347
+ // Initially, all countries are visible
9348
+ this.filteredCountries = [...this.countries];
9349
+ // If a search text already exists, filter immediately
9350
+ if (this.searchCountryText) {
9351
+ this.filterCountries();
9352
+ }
9353
+ // Fetch stores if at least one country is selected
9354
+ let selectedCountries = this.countries.filter((country) => country.checked);
9355
+ if (selectedCountries.length > 0) {
9356
+ setTimeout(() => {
9357
+ this.getLocations();
9358
+ this.getStore(); // fetch stores
9359
+ }, 1000);
9360
+ }
9361
+ },
9362
+ error: (err) => {
9363
+ console.error("Failed to fetch countries", err);
9364
+ },
9365
+ });
9366
+ }
9367
+ selectedCountriesLabel() {
9368
+ const selectedCountries = this.searchCountryText.length
9369
+ ? this.filteredCountries.filter(country => country.checked).map(country => country.country)
9370
+ : this.countries.filter(country => country.checked).map(country => country.country);
9371
+ return selectedCountries.length === 0
9372
+ ? ''
9373
+ : selectedCountries.length === 1
9374
+ ? selectedCountries[0]
9375
+ : `${selectedCountries.length} countries`;
9376
+ }
9377
+ filterCountries() {
9378
+ const searchText = this.searchCountryText.toLowerCase();
9379
+ if (searchText) {
9380
+ // Filter and preserve checked state
9381
+ this.filteredCountries = this.countries
9382
+ .map(country => ({
9383
+ ...country,
9384
+ checked: this.filteredCountries.find(c => c.country === country.country)?.checked || false
9385
+ }))
9386
+ .filter(country => country.country.toLowerCase().includes(searchText));
9387
+ }
9388
+ else {
9389
+ // Reset to full list
9390
+ this.filteredCountries = this.countries.map((country) => ({
9391
+ ...country,
9392
+ checked: this.selectedFilters.country?.find((c) => c.country === country.country)?.checked || false
9393
+ }));
9394
+ }
9395
+ }
9396
+ isAllCountriesSelected() {
9397
+ return this.filteredCountries.length > 0 && this.filteredCountries.every(country => country.checked);
9398
+ }
9399
+ toggleSelectAllCountries(event) {
9400
+ const isChecked = event.target.checked;
9401
+ this.filteredCountries.forEach((country) => (country.checked = isChecked));
9402
+ this.updateSelectedCountries();
9403
+ }
9404
+ updateSelectedCountries() {
9405
+ // When locations are selected, fetch the related groups
9406
+ const selectedCountries = this.filteredCountries
9407
+ .filter((country) => country.checked)
9408
+ .map((country) => country.country);
9409
+ this.filteredCountries.forEach((country) => {
9410
+ let findCountryIndex = this.countries.findIndex((loc) => loc.country == country.country);
9411
+ if (findCountryIndex != -1) {
9412
+ this.countries[findCountryIndex].checked = country.checked;
9413
+ }
9414
+ });
9415
+ if (selectedCountries.length > 0 || !selectedCountries.length) {
9416
+ this.selectedFilters.stores = [];
9417
+ this.groupsData = [];
9418
+ this.locations = [];
9419
+ this.getLocations();
9420
+ this.getGroups(); // Fetch groups based on selected cities
9421
+ // If there are selected groups, fetch the stores based on selected groups
9422
+ this.getStore();
9423
+ this.selectedFilters.country = this.filteredCountries;
9424
+ }
9425
+ else {
9426
+ this.filteredGroups = []; // Clear groups if no locations are selected
9427
+ this.selectedFilters.country = [];
9428
+ }
9429
+ this.selectedFilters.group = [];
9430
+ this.filteredStores = []; // Reset stores as well
9431
+ this.searchGroupText = '';
9432
+ this.searchStoreText = '';
9433
+ // this.Opendropdown = false;
9434
+ }
9435
+ removeCountry() {
9436
+ this.Reset();
9437
+ }
9438
+ Apply() {
9439
+ // Close the dropdown
9440
+ this.Opendropdown = false;
9441
+ // Fetch existing filters from localStorage
9442
+ const headerFilters = JSON.parse(localStorage.getItem("header-filters1") || "{}");
9443
+ this.selectedFilters.store = null;
9444
+ // Ensure current selections are reflected
9445
+ this.selectedFilters.country = this.filteredCountries;
9446
+ this.selectedFilters.location = this.locations;
9447
+ this.selectedFilters.group = this.groupsData;
9448
+ this.selectedFilters.stores = headerFilters.stores ? headerFilters.stores : this.stores;
9449
+ // Store updated filters back in localStorage
9450
+ localStorage.setItem("header-filters1", JSON.stringify(this.selectedFilters));
9451
+ // this.gs.dataRangeValue.next(this.selectedFilters);
9452
+ window.location.reload();
9453
+ // Emit the updated filters via the service
9454
+ // this.gs.dataRangeValue.next(this.selectedFilters);
9455
+ // Trigger refresh if necessary
9456
+ // this.gs.manageRefreshTrigger.next(true);
9457
+ this.cd.detectChanges();
9458
+ }
9459
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ZoneHeaderComponent, deps: [{ token: AuthService }, { token: i2.Router }, { token: i1.GlobalStateService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
9460
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ZoneHeaderComponent, selector: "lib-zone-header", host: { listeners: { "document:click": "clickOutside($event)" } }, ngImport: i0, template: "<div class=\"\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<!-- <div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div> -->\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker td.available.today{pointer-events:none;text-decoration:line-through;color:#a9a9a9}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CustomSelectComponent, selector: "lib-select", inputs: ["items", "searchField", "multi", "idField", "selectedValues", "disabled", "label"], outputs: ["selected"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
9461
+ }
9462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ZoneHeaderComponent, decorators: [{
9463
+ type: Component,
9464
+ args: [{ selector: 'lib-zone-header', template: "<div class=\"\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<!-- <div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div> -->\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker td.available.today{pointer-events:none;text-decoration:line-through;color:#a9a9a9}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"] }]
9465
+ }], ctorParameters: () => [{ type: AuthService }, { type: i2.Router }, { type: i1.GlobalStateService }, { type: i0.ChangeDetectorRef }], propDecorators: { onClick: [{
9466
+ type: HostListener,
9467
+ args: ['document:click', ['$event']]
9468
+ }], clickOutside: [{
9469
+ type: HostListener,
9470
+ args: ["document:click", ["$event"]]
9471
+ }] } });
9472
+
8395
9473
  class ToolbarComponent {
8396
9474
  layout;
8397
9475
  router;
@@ -8527,10 +9605,10 @@ class ToolbarComponent {
8527
9605
  URL == "/manage/stores" || URL === "/manage/stores?type=stores" || URL === "/manage/stores?type=clusters" ||
8528
9606
  URL == "/manage/stores/addition-method" ||
8529
9607
  URL == "/manage/stores/add-single-store" || URL === "/manage/trax/gallery" || URL == "/notifications/alerts?tab=alert" || URL == "/notifications/alerts?tab=download" || URL === "/manage/trax/audit") {
8530
- this.setUIProperties(true, false, false, false, false, false, false, false, false, false, false, false);
9608
+ this.setUIProperties(true, false, false, false, false, false, false, false, false, false, false, false, false);
8531
9609
  }
8532
9610
  else if (url[3] == "edge-app") {
8533
- this.setUIProperties(false, false, false, false, true, false, false, false, false, false, false, false);
9611
+ this.setUIProperties(false, false, false, false, true, false, false, false, false, false, false, false, false);
8534
9612
  }
8535
9613
  else if (URL == `/manage/stores/infra-ticket?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=infra` ||
8536
9614
  URL == `/manage/stores/settings?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=dataMismatch` ||
@@ -8538,86 +9616,89 @@ class ToolbarComponent {
8538
9616
  URL == `/manage/stores/cameras?storeId=${this.storeId}` ||
8539
9617
  // URL == `/manage/stores/infrastructure?storeId=${this.storeId}` ||
8540
9618
  URL == `/manage/stores/mat?storeId=${this.storeId}`) {
8541
- this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false);
9619
+ this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false, false);
8542
9620
  }
8543
9621
  else if (URL == "/tickets/stores" || URL == "/manage/users/tango/audit") {
8544
- this.setUIProperties(false, false, true, false, false, false, false, false, false, false, false, false);
9622
+ this.setUIProperties(false, false, true, false, false, false, false, false, false, false, false, false, false);
8545
9623
  }
8546
9624
  else if (url[2] === 'controlcenter') {
8547
9625
  if (URL == `/manage/controlcenter/playback?storeId=${this.storeId}` || URL == `/manage/controlcenter/playback`) {
8548
- this.setUIProperties(false, false, false, false, false, false, false, false, true, false, false, false);
9626
+ this.setUIProperties(false, false, false, false, false, false, false, false, true, false, false, false, false);
8549
9627
  }
8550
9628
  else {
8551
- this.setUIProperties(false, false, false, false, true, false, false, false, false, false, false, false);
9629
+ this.setUIProperties(false, false, false, false, true, false, false, false, false, false, false, false, false);
8552
9630
  }
8553
9631
  }
8554
9632
  else if (URL == "/profile" || url[2] === "data-mismatch" || url[2] === "employeetraining"
8555
9633
  || URL == "/manage/brands" || URL == "/manage/users/tango" || (url[1] === "tickets" && url[2] === "audit") || url.includes('list')) {
8556
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false);
9634
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, false);
8557
9635
  }
8558
9636
  else if (URL == "/manage/traffic/nob") {
8559
- this.setUIProperties(false, false, false, false, false, false, false, false, false, true, false, false);
9637
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, true, false, false, false);
8560
9638
  }
8561
- else if (url[2] === "traffic" || url[2] === "zones" || URL == "/manage/analyse/reports") {
8562
- this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false);
9639
+ else if (url[2] === "zones") {
9640
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, true);
9641
+ }
9642
+ else if (url[2] === "traffic" || URL == "/manage/analyse/reports") {
9643
+ this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false, false);
8563
9644
  }
8564
9645
  else if (URL == "/manage/employee-metrics/beeahGroup" || URL == "/manage/employee-metrics/beeahLive") {
8565
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, true);
9646
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, true, false);
8566
9647
  }
8567
9648
  else if (url[2] === "employee-metrics" && url[3] === "heatmap") {
8568
- this.setUIProperties(false, false, false, false, false, false, false, false, true, false, false, false);
9649
+ this.setUIProperties(false, false, false, false, false, false, false, false, true, false, false, false, false);
8569
9650
  }
8570
9651
  else if (url[2] === "employee-metrics") {
8571
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, true, false);
9652
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, true, false, false);
8572
9653
  }
8573
9654
  else if (url[2] == 'trax') {
8574
9655
  if (url[2] == 'trax' && (url.includes('createChecklist') || url.includes('configure') || url.includes('create-order') || url[3] == 'create-task' || url[3] == 'task-configure')) {
8575
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false);
9656
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, false);
8576
9657
  }
8577
9658
  // else if(url[2] == 'trax' && (url.includes('taskinfo'))){
8578
9659
  // this.setUIProperties(false, false, false, false,false,false,false,true,false,false,false,false);
8579
9660
  // }
8580
9661
  else if (url[2] == 'trax' && url.includes('start')) {
8581
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false);
9662
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, false);
8582
9663
  }
8583
9664
  else if (url[2] == 'trax' && (url.includes('checklist') || url.includes('gallery')) || url.includes('audit')) {
8584
- this.setUIProperties(true, false, false, false, false, false, false, false, false, false, false, false);
9665
+ this.setUIProperties(true, false, false, false, false, false, false, false, false, false, false, false, false);
8585
9666
  }
8586
9667
  else {
8587
- this.setUIProperties(false, false, false, false, false, false, true, false, false, false, false, false);
9668
+ this.setUIProperties(false, false, false, false, false, false, true, false, false, false, false, false, false);
8588
9669
  }
8589
9670
  }
8590
9671
  else if (url[2] == 'planogram') {
8591
9672
  if (url[2] == 'planogram' && (url.includes('verification'))) {
8592
- this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false);
9673
+ this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false, false);
8593
9674
  }
8594
9675
  if (url[2] == 'planogram' && (url.includes('layout-builder'))) {
8595
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false);
9676
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, false);
8596
9677
  }
8597
9678
  else {
8598
9679
  if (url[2] == 'planogram' && url[3] == 'manage-planogram') {
8599
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false);
9680
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, false);
8600
9681
  }
8601
9682
  else {
8602
- this.setUIProperties(true, false, false, false, false, false, false, false, false, false, false, false);
9683
+ this.setUIProperties(true, false, false, false, false, false, false, false, false, false, false, false, false);
8603
9684
  }
8604
9685
  }
8605
9686
  }
8606
9687
  else {
8607
9688
  if (url[3] == 'plano') {
8608
- this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false);
9689
+ this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false, false);
8609
9690
  }
8610
9691
  else {
8611
- this.setUIProperties(false, false, false, false, true, false, false, false, false, false, false, false);
9692
+ this.setUIProperties(false, false, false, false, true, false, false, false, false, false, false, false, false);
8612
9693
  }
8613
9694
  }
8614
9695
  }
8615
9696
  else {
8616
9697
  if (URL === '/manage/planogram/manage-planograms/verification') {
8617
- this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false);
9698
+ this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false, false);
8618
9699
  }
8619
9700
  if (url[3] == "edge-app") {
8620
- this.setUIProperties(false, false, true, false, false, false, false, false, false, false, false, false);
9701
+ this.setUIProperties(false, false, true, false, false, false, false, false, false, false, false, false, false);
8621
9702
  }
8622
9703
  else if (URL == `/manage/stores/infra-ticket?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=infra` ||
8623
9704
  URL == `/manage/stores/settings?storeId=${this.storeId}` || URL == `/manage/stores/infra-ticket?storeId=${this.storeId}&type=dataMismatch` ||
@@ -8625,14 +9706,14 @@ class ToolbarComponent {
8625
9706
  URL == `/manage/stores/cameras?storeId=${this.storeId}` ||
8626
9707
  // URL == `/manage/stores/infrastructure?storeId=${this.storeId}` ||
8627
9708
  URL == `/manage/stores/mat?storeId=${this.storeId}`) {
8628
- this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false);
9709
+ this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false, false);
8629
9710
  }
8630
9711
  else if (url[2] === 'controlcenter') {
8631
9712
  if (URL == `/manage/controlcenter/playback?storeId=${this.storeId}` || URL == `/manage/controlcenter/playback`) {
8632
- this.setUIProperties(false, false, false, false, false, false, false, false, true, false, false, false);
9713
+ this.setUIProperties(false, false, false, false, false, false, false, false, true, false, false, false, false);
8633
9714
  }
8634
9715
  else {
8635
- this.setUIProperties(false, false, false, false, true, false, false, false, false, false, false, false);
9716
+ this.setUIProperties(false, false, false, false, true, false, false, false, false, false, false, false, false);
8636
9717
  }
8637
9718
  }
8638
9719
  else if (URL == "/profile" || URL == "/manage/users/client" || URL == "/manage/users/tango" ||
@@ -8640,42 +9721,45 @@ class ToolbarComponent {
8640
9721
  URL == "/manage/stores/addition-method" ||
8641
9722
  URL == "/manage/stores/add-single-store" || url[2] === "data-mismatch" || url[2] === "employeetraining" || URL == "/notifications/alerts?tab=alert" || URL == "/notifications/alerts?tab=download"
8642
9723
  || URL == "/manage/users/tango" || URL === "/manage/controlcenter" || URL === 'manage/controlcenter/template-manager' || url[2] === 'controlcenter' || url.includes('list')) {
8643
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false);
9724
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, false);
8644
9725
  }
8645
9726
  else if (URL == "/manage/traffic/nob") {
8646
- this.setUIProperties(false, false, false, false, false, false, false, false, false, true, false, false);
9727
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, true, false, false, false);
9728
+ }
9729
+ else if (url[2] === "zones") {
9730
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, true);
8647
9731
  }
8648
- else if (url[2] === "traffic" || url[2] === "zones" || URL == "/manage/analyse/reports") {
8649
- this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false);
9732
+ else if (url[2] === "traffic" || URL == "/manage/analyse/reports") {
9733
+ this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false, false);
8650
9734
  }
8651
9735
  else if (URL == "/manage/employee-metrics/beeahGroup" || URL == "/manage/employee-metrics/beeahLive") {
8652
- this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false);
9736
+ this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false, false);
8653
9737
  }
8654
9738
  else if (url[2] === "employee-metrics" && url[3] === "heatmap") {
8655
- this.setUIProperties(false, false, false, false, false, false, false, false, true, false, false, false);
9739
+ this.setUIProperties(false, false, false, false, false, false, false, false, true, false, false, false, false);
8656
9740
  }
8657
9741
  else if (url[2] === "employee-metrics") {
8658
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, true, false);
9742
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, true, false, false);
8659
9743
  }
8660
9744
  else if (url[2] == 'trax') {
8661
9745
  if (url[2] == 'trax' && (url.includes('createChecklist') || url.includes('configure') || url.includes('create-order') || url[3] == 'create-task' || url[3] == 'task-configure')) {
8662
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false);
9746
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, false);
8663
9747
  }
8664
9748
  // else if(url[2] == 'trax' && (url.includes('taskinfo'))){
8665
9749
  // this.setUIProperties(false, false, false, false,false,false,false,true,false,false,false,false);
8666
9750
  // }
8667
9751
  else if (url[2] == 'trax' && url.includes('start')) {
8668
- this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false);
9752
+ this.setUIProperties(false, false, false, false, false, false, false, false, false, false, false, false, false);
8669
9753
  }
8670
9754
  else if (url[2] == 'trax' && (url.includes('checklist') || url.includes('gallery') || url.includes('audit'))) {
8671
- this.setUIProperties(true, false, false, false, false, false, false, false, false, false, false, false);
9755
+ this.setUIProperties(true, false, false, false, false, false, false, false, false, false, false, false, false);
8672
9756
  }
8673
9757
  else {
8674
- this.setUIProperties(false, false, false, false, false, false, true, false, false, false, false, false);
9758
+ this.setUIProperties(false, false, false, false, false, false, true, false, false, false, false, false, false);
8675
9759
  }
8676
9760
  }
8677
9761
  else if (url[2] == 'planogram') {
8678
- this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false);
9762
+ this.setUIProperties(false, false, false, false, false, true, false, false, false, false, false, false, false);
8679
9763
  // if(url[2] == 'planogram' && (url.includes('verification'))){
8680
9764
  // }
8681
9765
  // if(url[2] == 'planogram' && (url.includes('layout-builder'))) {
@@ -8686,10 +9770,10 @@ class ToolbarComponent {
8686
9770
  }
8687
9771
  else {
8688
9772
  if (url[3] == "plano") {
8689
- this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false);
9773
+ this.setUIProperties(false, false, false, true, false, false, false, false, false, false, false, false, false);
8690
9774
  }
8691
9775
  else {
8692
- this.setUIProperties(false, false, true, false, false, false, false, false, false, false, false, false);
9776
+ this.setUIProperties(false, false, true, false, false, false, false, false, false, false, false, false, false);
8693
9777
  }
8694
9778
  }
8695
9779
  }
@@ -8697,7 +9781,8 @@ class ToolbarComponent {
8697
9781
  return (this.appPageTitleDisplay &&
8698
9782
  viewsWithPageTitles.some((t) => t === this.appToolbarLayout));
8699
9783
  }
8700
- setUIProperties(singleSelect, multiSelect, datepicker, singleStore, singleSelectdatepicker, trafficdatepicker, traxdatepicker, traxwithoutdatepicker, storesSingle, nobWithoutClient, merticsHeader, singleClientStoreDate) {
9784
+ zoneHeader;
9785
+ setUIProperties(singleSelect, multiSelect, datepicker, singleStore, singleSelectdatepicker, trafficdatepicker, traxdatepicker, traxwithoutdatepicker, storesSingle, nobWithoutClient, merticsHeader, singleClientStoreDate, zoneHeader) {
8701
9786
  this.singleSelect = singleSelect;
8702
9787
  this.multiSelect = multiSelect;
8703
9788
  this.datepicker = datepicker;
@@ -8710,6 +9795,7 @@ class ToolbarComponent {
8710
9795
  this.nobWithoutClient = nobWithoutClient;
8711
9796
  this.merticsHeader = merticsHeader;
8712
9797
  this.singleClientStoreDate = singleClientStoreDate;
9798
+ this.zoneHeader = zoneHeader;
8713
9799
  }
8714
9800
  getUserInfo(client) {
8715
9801
  let obj = {
@@ -8724,11 +9810,11 @@ class ToolbarComponent {
8724
9810
  }
8725
9811
  }
8726
9812
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.LayoutService }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i1.GlobalStateService }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Component });
8727
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ToolbarComponent, selector: "lib-toolbar", inputs: { currentLayoutType: "currentLayoutType", appToolbarLayout: "appToolbarLayout" }, ngImport: i0, template: "<!--begin::Toolbar container-->\r\n<div id=\"kt_app_toolbar_container\" class=\"app-container\" [ngClass]=\"appToolbarContainerCSSClass\">\r\n <ng-container *ngIf=\"(gs.userAccess | async)?.userType === 'tango' || (gs.userAccess | async)?.userType === 'client' || (gs.userAccess | async)?.userType === 'lead'\" >\r\n <ng-container *ngIf=\"showPageTitle()\">\r\n <lib-page-title [appPageTitleDirection]=\"appPageTitleDirection\" [appPageTitleBreadcrumb]=\"appPageTitleBreadcrumb\"\r\n [appPageTitleDescription]=\"appPageTitleDescription\" class=\"page-title d-flex flex-wrap me-3\"\r\n [ngClass]=\"{'flex-column justify-content-center': appPageTitleDirection === 'column', 'align-items-center': appPageTitleDirection !== 'column', appPageTitleCSSClass}\">\r\n </lib-page-title>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiSelect && users.userType ==='tango'\">\r\n <lib-classic class=\"d-flex align-items-center gap-2 gap-lg-3\"></lib-classic>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelect && users.userType ==='tango'\">\r\n <lib-client-settings class=\"d-flex align-items-center me-5\"></lib-client-settings>\r\n </ng-container>\r\n <ng-container *ngIf=\"datepicker && (users.userType ==='client' || users.userType ==='tango')\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker && users.userType ==='tango'\">\r\n <lib-date-single-select class=\"d-flex align-items-center me-5\"></lib-date-single-select>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleStore\">\r\n <lib-single-store class=\"d-flex align-items-center me-5\" [urlString]=\"urlString\"></lib-single-store>\r\n </ng-container>\r\n <ng-container *ngIf=\"trafficdatepicker\">\r\n <lib-traffic-header class=\"d-flex align-items-center me-5\"></lib-traffic-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxdatepicker\">\r\n <lib-trax-header class=\"d-flex align-items-center me-5\"></lib-trax-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxwithoutdatepicker\">\r\n <lib-trax-withoutdate class=\"d-flex align-items-center me-5\"></lib-trax-withoutdate>\r\n </ng-container>\r\n <ng-container *ngIf=\"storesSingle\">\r\n <lib-single-storedate class=\"d-flex align-items-center me-5\"></lib-single-storedate>\r\n </ng-container>\r\n <ng-container *ngIf=\"nobWithoutClient\">\r\n <lib-traffic-nob class=\"d-flex align-items-center me-5\"></lib-traffic-nob>\r\n </ng-container>\r\n <ng-container *ngIf=\"merticsHeader\">\r\n <lib-metrics-header class=\"d-flex align-items-center me-5\"></lib-metrics-header>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"singleClientStoreDate\">\r\n <lib-single-clientstore-date class=\"d-flex align-items-center me-5\"></lib-single-clientstore-date>\r\n </ng-container>\r\n\r\n\r\n <!-- <ng-container *ngIf=\"appToolbarLayout === 'extended'\">\r\n <lib-extended class=\"d-flex align-items-center flex-shrink-0 me-5\"></lib-extended>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'reports'\">\r\n <lib-reports class=\"d-flex align-items-center overflow-auto\" [appPageTitleDisplay]=\"appPageTitleDisplay\">\r\n </lib-reports>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'saas'\">\r\n <lib-saas class=\"d-flex align-items-center gap-2\" [appPageTitleDisplay]=\"appPageTitleDisplay\"></lib-saas>\r\n </ng-container> -->\r\n</ng-container>\r\n</div>\r\n<!--end::Toolbar container-->\r\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PageTitleComponent, selector: "lib-page-title", inputs: ["appPageTitleDirection", "appPageTitleBreadcrumb", "appPageTitleDescription"] }, { kind: "component", type: ClassicComponent, selector: "lib-classic" }, { kind: "component", type: ClientSettingsComponent, selector: "lib-client-settings" }, { kind: "component", type: DatepickerComponent, selector: "lib-datepicker" }, { kind: "component", type: DateSingleSelectComponent, selector: "lib-date-single-select" }, { kind: "component", type: SingleStoreComponent, selector: "lib-single-store", inputs: ["urlString"] }, { kind: "component", type: TrafficHeaderComponent, selector: "lib-traffic-header" }, { kind: "component", type: TraxHeaderComponent, selector: "lib-trax-header" }, { kind: "component", type: SingleStoredateComponent, selector: "lib-single-storedate" }, { kind: "component", type: TraxWithoutdateComponent, selector: "lib-trax-withoutdate" }, { kind: "component", type: TrafficNobComponent, selector: "lib-traffic-nob" }, { kind: "component", type: MetricsHeaderComponent, selector: "lib-metrics-header" }, { kind: "component", type: SingleClientstoreDateComponent, selector: "lib-single-clientstore-date" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
9813
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ToolbarComponent, selector: "lib-toolbar", inputs: { currentLayoutType: "currentLayoutType", appToolbarLayout: "appToolbarLayout" }, ngImport: i0, template: "<!--begin::Toolbar container-->\r\n<div id=\"kt_app_toolbar_container\" class=\"app-container\" [ngClass]=\"appToolbarContainerCSSClass\">\r\n <ng-container *ngIf=\"(gs.userAccess | async)?.userType === 'tango' || (gs.userAccess | async)?.userType === 'client' || (gs.userAccess | async)?.userType === 'lead'\" >\r\n <ng-container *ngIf=\"showPageTitle()\">\r\n <lib-page-title [appPageTitleDirection]=\"appPageTitleDirection\" [appPageTitleBreadcrumb]=\"appPageTitleBreadcrumb\"\r\n [appPageTitleDescription]=\"appPageTitleDescription\" class=\"page-title d-flex flex-wrap me-3\"\r\n [ngClass]=\"{'flex-column justify-content-center': appPageTitleDirection === 'column', 'align-items-center': appPageTitleDirection !== 'column', appPageTitleCSSClass}\">\r\n </lib-page-title>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiSelect && users.userType ==='tango'\">\r\n <lib-classic class=\"d-flex align-items-center gap-2 gap-lg-3\"></lib-classic>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelect && users.userType ==='tango'\">\r\n <lib-client-settings class=\"d-flex align-items-center me-5\"></lib-client-settings>\r\n </ng-container>\r\n <ng-container *ngIf=\"datepicker && (users.userType ==='client' || users.userType ==='tango')\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker && users.userType ==='tango'\">\r\n <lib-date-single-select class=\"d-flex align-items-center me-5\"></lib-date-single-select>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleStore\">\r\n <lib-single-store class=\"d-flex align-items-center me-5\" [urlString]=\"urlString\"></lib-single-store>\r\n </ng-container>\r\n <ng-container *ngIf=\"trafficdatepicker\">\r\n <lib-traffic-header class=\"d-flex align-items-center me-5\"></lib-traffic-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxdatepicker\">\r\n <lib-trax-header class=\"d-flex align-items-center me-5\"></lib-trax-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxwithoutdatepicker\">\r\n <lib-trax-withoutdate class=\"d-flex align-items-center me-5\"></lib-trax-withoutdate>\r\n </ng-container>\r\n <ng-container *ngIf=\"storesSingle\">\r\n <lib-single-storedate class=\"d-flex align-items-center me-5\"></lib-single-storedate>\r\n </ng-container>\r\n <ng-container *ngIf=\"nobWithoutClient\">\r\n <lib-traffic-nob class=\"d-flex align-items-center me-5\"></lib-traffic-nob>\r\n </ng-container>\r\n <ng-container *ngIf=\"merticsHeader\">\r\n <lib-metrics-header class=\"d-flex align-items-center me-5\"></lib-metrics-header>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"singleClientStoreDate\">\r\n <lib-single-clientstore-date class=\"d-flex align-items-center me-5\"></lib-single-clientstore-date>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"zoneHeader\">\r\n <lib-zone-header class=\"d-flex align-items-center me-5\"></lib-zone-header>\r\n </ng-container>\r\n <!-- <ng-container *ngIf=\"appToolbarLayout === 'extended'\">\r\n <lib-extended class=\"d-flex align-items-center flex-shrink-0 me-5\"></lib-extended>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'reports'\">\r\n <lib-reports class=\"d-flex align-items-center overflow-auto\" [appPageTitleDisplay]=\"appPageTitleDisplay\">\r\n </lib-reports>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'saas'\">\r\n <lib-saas class=\"d-flex align-items-center gap-2\" [appPageTitleDisplay]=\"appPageTitleDisplay\"></lib-saas>\r\n </ng-container> -->\r\n</ng-container>\r\n</div>\r\n<!--end::Toolbar container-->\r\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PageTitleComponent, selector: "lib-page-title", inputs: ["appPageTitleDirection", "appPageTitleBreadcrumb", "appPageTitleDescription"] }, { kind: "component", type: ClassicComponent, selector: "lib-classic" }, { kind: "component", type: ClientSettingsComponent, selector: "lib-client-settings" }, { kind: "component", type: DatepickerComponent, selector: "lib-datepicker" }, { kind: "component", type: DateSingleSelectComponent, selector: "lib-date-single-select" }, { kind: "component", type: SingleStoreComponent, selector: "lib-single-store", inputs: ["urlString"] }, { kind: "component", type: TrafficHeaderComponent, selector: "lib-traffic-header" }, { kind: "component", type: TraxHeaderComponent, selector: "lib-trax-header" }, { kind: "component", type: SingleStoredateComponent, selector: "lib-single-storedate" }, { kind: "component", type: TraxWithoutdateComponent, selector: "lib-trax-withoutdate" }, { kind: "component", type: TrafficNobComponent, selector: "lib-traffic-nob" }, { kind: "component", type: MetricsHeaderComponent, selector: "lib-metrics-header" }, { kind: "component", type: SingleClientstoreDateComponent, selector: "lib-single-clientstore-date" }, { kind: "component", type: ZoneHeaderComponent, selector: "lib-zone-header" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
8728
9814
  }
8729
9815
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToolbarComponent, decorators: [{
8730
9816
  type: Component,
8731
- args: [{ selector: "lib-toolbar", template: "<!--begin::Toolbar container-->\r\n<div id=\"kt_app_toolbar_container\" class=\"app-container\" [ngClass]=\"appToolbarContainerCSSClass\">\r\n <ng-container *ngIf=\"(gs.userAccess | async)?.userType === 'tango' || (gs.userAccess | async)?.userType === 'client' || (gs.userAccess | async)?.userType === 'lead'\" >\r\n <ng-container *ngIf=\"showPageTitle()\">\r\n <lib-page-title [appPageTitleDirection]=\"appPageTitleDirection\" [appPageTitleBreadcrumb]=\"appPageTitleBreadcrumb\"\r\n [appPageTitleDescription]=\"appPageTitleDescription\" class=\"page-title d-flex flex-wrap me-3\"\r\n [ngClass]=\"{'flex-column justify-content-center': appPageTitleDirection === 'column', 'align-items-center': appPageTitleDirection !== 'column', appPageTitleCSSClass}\">\r\n </lib-page-title>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiSelect && users.userType ==='tango'\">\r\n <lib-classic class=\"d-flex align-items-center gap-2 gap-lg-3\"></lib-classic>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelect && users.userType ==='tango'\">\r\n <lib-client-settings class=\"d-flex align-items-center me-5\"></lib-client-settings>\r\n </ng-container>\r\n <ng-container *ngIf=\"datepicker && (users.userType ==='client' || users.userType ==='tango')\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker && users.userType ==='tango'\">\r\n <lib-date-single-select class=\"d-flex align-items-center me-5\"></lib-date-single-select>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleStore\">\r\n <lib-single-store class=\"d-flex align-items-center me-5\" [urlString]=\"urlString\"></lib-single-store>\r\n </ng-container>\r\n <ng-container *ngIf=\"trafficdatepicker\">\r\n <lib-traffic-header class=\"d-flex align-items-center me-5\"></lib-traffic-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxdatepicker\">\r\n <lib-trax-header class=\"d-flex align-items-center me-5\"></lib-trax-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxwithoutdatepicker\">\r\n <lib-trax-withoutdate class=\"d-flex align-items-center me-5\"></lib-trax-withoutdate>\r\n </ng-container>\r\n <ng-container *ngIf=\"storesSingle\">\r\n <lib-single-storedate class=\"d-flex align-items-center me-5\"></lib-single-storedate>\r\n </ng-container>\r\n <ng-container *ngIf=\"nobWithoutClient\">\r\n <lib-traffic-nob class=\"d-flex align-items-center me-5\"></lib-traffic-nob>\r\n </ng-container>\r\n <ng-container *ngIf=\"merticsHeader\">\r\n <lib-metrics-header class=\"d-flex align-items-center me-5\"></lib-metrics-header>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"singleClientStoreDate\">\r\n <lib-single-clientstore-date class=\"d-flex align-items-center me-5\"></lib-single-clientstore-date>\r\n </ng-container>\r\n\r\n\r\n <!-- <ng-container *ngIf=\"appToolbarLayout === 'extended'\">\r\n <lib-extended class=\"d-flex align-items-center flex-shrink-0 me-5\"></lib-extended>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'reports'\">\r\n <lib-reports class=\"d-flex align-items-center overflow-auto\" [appPageTitleDisplay]=\"appPageTitleDisplay\">\r\n </lib-reports>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'saas'\">\r\n <lib-saas class=\"d-flex align-items-center gap-2\" [appPageTitleDisplay]=\"appPageTitleDisplay\"></lib-saas>\r\n </ng-container> -->\r\n</ng-container>\r\n</div>\r\n<!--end::Toolbar container-->\r\n" }]
9817
+ args: [{ selector: "lib-toolbar", template: "<!--begin::Toolbar container-->\r\n<div id=\"kt_app_toolbar_container\" class=\"app-container\" [ngClass]=\"appToolbarContainerCSSClass\">\r\n <ng-container *ngIf=\"(gs.userAccess | async)?.userType === 'tango' || (gs.userAccess | async)?.userType === 'client' || (gs.userAccess | async)?.userType === 'lead'\" >\r\n <ng-container *ngIf=\"showPageTitle()\">\r\n <lib-page-title [appPageTitleDirection]=\"appPageTitleDirection\" [appPageTitleBreadcrumb]=\"appPageTitleBreadcrumb\"\r\n [appPageTitleDescription]=\"appPageTitleDescription\" class=\"page-title d-flex flex-wrap me-3\"\r\n [ngClass]=\"{'flex-column justify-content-center': appPageTitleDirection === 'column', 'align-items-center': appPageTitleDirection !== 'column', appPageTitleCSSClass}\">\r\n </lib-page-title>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiSelect && users.userType ==='tango'\">\r\n <lib-classic class=\"d-flex align-items-center gap-2 gap-lg-3\"></lib-classic>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelect && users.userType ==='tango'\">\r\n <lib-client-settings class=\"d-flex align-items-center me-5\"></lib-client-settings>\r\n </ng-container>\r\n <ng-container *ngIf=\"datepicker && (users.userType ==='client' || users.userType ==='tango')\">\r\n <lib-datepicker class=\"d-flex align-items-center me-5\"></lib-datepicker>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleSelectdatepicker && users.userType ==='tango'\">\r\n <lib-date-single-select class=\"d-flex align-items-center me-5\"></lib-date-single-select>\r\n </ng-container>\r\n <ng-container *ngIf=\"singleStore\">\r\n <lib-single-store class=\"d-flex align-items-center me-5\" [urlString]=\"urlString\"></lib-single-store>\r\n </ng-container>\r\n <ng-container *ngIf=\"trafficdatepicker\">\r\n <lib-traffic-header class=\"d-flex align-items-center me-5\"></lib-traffic-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxdatepicker\">\r\n <lib-trax-header class=\"d-flex align-items-center me-5\"></lib-trax-header>\r\n </ng-container>\r\n <ng-container *ngIf=\"traxwithoutdatepicker\">\r\n <lib-trax-withoutdate class=\"d-flex align-items-center me-5\"></lib-trax-withoutdate>\r\n </ng-container>\r\n <ng-container *ngIf=\"storesSingle\">\r\n <lib-single-storedate class=\"d-flex align-items-center me-5\"></lib-single-storedate>\r\n </ng-container>\r\n <ng-container *ngIf=\"nobWithoutClient\">\r\n <lib-traffic-nob class=\"d-flex align-items-center me-5\"></lib-traffic-nob>\r\n </ng-container>\r\n <ng-container *ngIf=\"merticsHeader\">\r\n <lib-metrics-header class=\"d-flex align-items-center me-5\"></lib-metrics-header>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"singleClientStoreDate\">\r\n <lib-single-clientstore-date class=\"d-flex align-items-center me-5\"></lib-single-clientstore-date>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"zoneHeader\">\r\n <lib-zone-header class=\"d-flex align-items-center me-5\"></lib-zone-header>\r\n </ng-container>\r\n <!-- <ng-container *ngIf=\"appToolbarLayout === 'extended'\">\r\n <lib-extended class=\"d-flex align-items-center flex-shrink-0 me-5\"></lib-extended>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'reports'\">\r\n <lib-reports class=\"d-flex align-items-center overflow-auto\" [appPageTitleDisplay]=\"appPageTitleDisplay\">\r\n </lib-reports>\r\n </ng-container>\r\n <ng-container *ngIf=\"appToolbarLayout === 'saas'\">\r\n <lib-saas class=\"d-flex align-items-center gap-2\" [appPageTitleDisplay]=\"appPageTitleDisplay\"></lib-saas>\r\n </ng-container> -->\r\n</ng-container>\r\n</div>\r\n<!--end::Toolbar container-->\r\n" }]
8732
9818
  }], ctorParameters: () => [{ type: i1.LayoutService }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i1.GlobalStateService }, { type: AuthService }], propDecorators: { currentLayoutType: [{
8733
9819
  type: Input
8734
9820
  }], appToolbarLayout: [{
@@ -10967,7 +12053,8 @@ class LayoutModule {
10967
12053
  TraxWithoutdateComponent,
10968
12054
  TrafficNobComponent,
10969
12055
  MetricsHeaderComponent,
10970
- SingleClientstoreDateComponent], imports: [CommonModule, i2.RouterModule, TranslationModule,
12056
+ SingleClientstoreDateComponent,
12057
+ ZoneHeaderComponent], imports: [CommonModule, i2.RouterModule, TranslationModule,
10971
12058
  InlineSVGModule,
10972
12059
  NgbDropdownModule,
10973
12060
  NgbProgressbarModule,
@@ -11037,7 +12124,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
11037
12124
  TraxWithoutdateComponent,
11038
12125
  TrafficNobComponent,
11039
12126
  MetricsHeaderComponent,
11040
- SingleClientstoreDateComponent
12127
+ SingleClientstoreDateComponent,
12128
+ ZoneHeaderComponent
11041
12129
  ],
11042
12130
  imports: [
11043
12131
  CommonModule,