{"ast":null,"code":"import { Validators } from '@angular/forms';\nimport * as md5 from 'md5';\nimport { environment } from 'src/environments/environment';\nimport { debounceTime } from 'rxjs/operators';\nimport Swal from 'sweetalert2';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/forms\";\nimport * as i2 from \"src/app/services/city.service\";\nimport * as i3 from \"src/app/services/auth-service\";\nimport * as i4 from \"@angular/common\";\n\nfunction RatecalculatormoduleComponent_div_1_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 23);\n    i0.ɵɵelement(1, \"div\", 24);\n    i0.ɵɵelementEnd();\n  }\n}\n\nfunction RatecalculatormoduleComponent_div_11_div_6_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 10);\n    i0.ɵɵtext(1, \" From Pincode is required. \");\n    i0.ɵɵelementEnd();\n  }\n}\n\nfunction RatecalculatormoduleComponent_div_11_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 8);\n    i0.ɵɵelementStart(1, \"label\", 9);\n    i0.ɵɵtext(2, \"From Pincode \");\n    i0.ɵɵelementStart(3, \"span\", 10);\n    i0.ɵɵtext(4, \"*\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n    i0.ɵɵelement(5, \"input\", 25);\n    i0.ɵɵtemplate(6, RatecalculatormoduleComponent_div_11_div_6_Template, 2, 0, \"div\", 14);\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const ctx_r1 = i0.ɵɵnextContext();\n    let tmp_0_0;\n    i0.ɵɵadvance(6);\n    i0.ɵɵproperty(\"ngIf\", ((tmp_0_0 = ctx_r1.rateForm.get(\"fromPincode\")) == null ? null : tmp_0_0.touched) && ((tmp_0_0 = ctx_r1.rateForm.get(\"fromPincode\")) == null ? null : tmp_0_0.hasError(\"required\")));\n  }\n}\n\nfunction RatecalculatormoduleComponent_div_12_div_6_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 10);\n    i0.ɵɵtext(1, \" To Pincode is required. \");\n    i0.ɵɵelementEnd();\n  }\n}\n\nfunction RatecalculatormoduleComponent_div_12_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 8);\n    i0.ɵɵelementStart(1, \"label\", 9);\n    i0.ɵɵtext(2, \"To Pincode \");\n    i0.ɵɵelementStart(3, \"span\", 10);\n    i0.ɵɵtext(4, \"*\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n    i0.ɵɵelement(5, \"input\", 26);\n    i0.ɵɵtemplate(6, RatecalculatormoduleComponent_div_12_div_6_Template, 2, 0, \"div\", 14);\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const ctx_r2 = i0.ɵɵnextContext();\n    let tmp_0_0;\n    i0.ɵɵadvance(6);\n    i0.ɵɵproperty(\"ngIf\", ((tmp_0_0 = ctx_r2.rateForm.get(\"toPincode\")) == null ? null : tmp_0_0.touched) && ((tmp_0_0 = ctx_r2.rateForm.get(\"toPincode\")) == null ? null : tmp_0_0.hasError(\"required\")));\n  }\n}\n\nfunction RatecalculatormoduleComponent_option_21_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"option\", 27);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const city_r13 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", city_r13.code);\n    i0.ɵɵadvance(1);\n    i0.ɵɵtextInterpolate(city_r13.name);\n  }\n}\n\nfunction RatecalculatormoduleComponent_div_22_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 10);\n    i0.ɵɵtext(1, \" Ship From is required. \");\n    i0.ɵɵelementEnd();\n  }\n}\n\nfunction RatecalculatormoduleComponent_option_31_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"option\", 27);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const city_r14 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", city_r14.code);\n    i0.ɵɵadvance(1);\n    i0.ɵɵtextInterpolate(city_r14.name);\n  }\n}\n\nfunction RatecalculatormoduleComponent_div_32_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 10);\n    i0.ɵɵtext(1, \" Ship To is required. \");\n    i0.ɵɵelementEnd();\n  }\n}\n\nfunction RatecalculatormoduleComponent_div_38_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 10);\n    i0.ɵɵtext(1, \" Weight is required. \");\n    i0.ɵɵelementEnd();\n  }\n}\n\nfunction RatecalculatormoduleComponent_span_41_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"span\");\n    i0.ɵɵtext(1, \"View Rate\");\n    i0.ɵɵelementEnd();\n  }\n}\n\nfunction RatecalculatormoduleComponent_span_42_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"span\");\n    i0.ɵɵelement(1, \"span\", 28);\n    i0.ɵɵtext(2, \" Loading... \");\n    i0.ɵɵelementEnd();\n  }\n}\n\nfunction RatecalculatormoduleComponent_div_43_tr_21_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"tr\");\n    i0.ɵɵelementStart(1, \"td\");\n    i0.ɵɵtext(2);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(3, \"td\");\n    i0.ɵɵtext(4);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(5, \"td\");\n    i0.ɵɵtext(6);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(7, \"td\");\n    i0.ɵɵtext(8);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(9, \"td\");\n    i0.ɵɵtext(10);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(11, \"td\");\n    i0.ɵɵtext(12);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(13, \"td\");\n    i0.ɵɵtext(14);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(15, \"td\", 32);\n    i0.ɵɵtext(16);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const item_r16 = ctx.$implicit;\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r16.product);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r16.service);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r16.freightAmount);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r16.otherCharges);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r16.amount);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r16.fuel);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r16.tax);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r16.grandTotal);\n  }\n}\n\nfunction RatecalculatormoduleComponent_div_43_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 29);\n    i0.ɵɵelementStart(1, \"table\", 30);\n    i0.ɵɵelementStart(2, \"thead\");\n    i0.ɵɵelementStart(3, \"tr\");\n    i0.ɵɵelementStart(4, \"th\");\n    i0.ɵɵtext(5, \"Product\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(6, \"th\");\n    i0.ɵɵtext(7, \"Service\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(8, \"th\");\n    i0.ɵɵtext(9, \"Freight Amount\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(10, \"th\");\n    i0.ɵɵtext(11, \"Other Charges\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(12, \"th\");\n    i0.ɵɵtext(13, \"Amount\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(14, \"th\");\n    i0.ɵɵtext(15, \"Fuel\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(16, \"th\");\n    i0.ɵɵtext(17, \"Tax\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(18, \"th\");\n    i0.ɵɵtext(19, \"Grand Total\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(20, \"tbody\");\n    i0.ɵɵtemplate(21, RatecalculatormoduleComponent_div_43_tr_21_Template, 17, 8, \"tr\", 31);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const ctx_r10 = i0.ɵɵnextContext();\n    i0.ɵɵadvance(21);\n    i0.ɵɵproperty(\"ngForOf\", ctx_r10.rateData);\n  }\n}\n\nexport let RatecalculatormoduleComponent = /*#__PURE__*/(() => {\n  class RatecalculatormoduleComponent {\n    constructor(fb, cityService, authService) {\n      this.fb = fb;\n      this.cityService = cityService;\n      this.authService = authService;\n      this.activeTab = 'domestic';\n      this.cities = [];\n      this.fromPincode = '';\n      this.fromLocation = '';\n      this.toPincode = '';\n      this.toLocation = '';\n      this.fromPincodeData = null;\n      this.toPincodeData = null;\n      this.accesstoken = '';\n      this.isLoading = false;\n      this.filteredShipFrom = [];\n      this.filteredShipTo = [];\n      this.rateData = [];\n    }\n\n    ngOnInit() {\n      this.rateForm = this.fb.group({\n        fromPincode: ['', [Validators.required]],\n        toPincode: ['', [Validators.required]],\n        shipFrom: ['', [Validators.required]],\n        shipTo: ['', [Validators.required]],\n        weight: ['', [Validators.required]]\n      });\n      const rawToken = localStorage.getItem('token');\n      const token = rawToken ? JSON.parse(rawToken) : null;\n\n      if (token && token.accesstoken) {\n        if (!this.authService.IsTokenExpired(token.accesstoken)) {\n          this.loadCities(token.accesstoken);\n        } else {\n          this.authenticateUser();\n        }\n      } else {\n        this.authenticateUser();\n      } // 👇 Pincode change listeners\n\n\n      this.setupPincodeListeners(token.accesstoken);\n      this.getRateInformation(token.accesstoken);\n    }\n\n    sendRateCalculationRequest(accesstoken) {\n      var _a;\n\n      this.isLoading = true;\n      const payload = {\n        searchtype: \"Tariff\",\n        type: \"Customer\",\n        customer: null,\n        vendor: null,\n        service: null,\n        product: null,\n        origincountry: [{\n          code: this.fromPincodeData.countrycode\n        }],\n        originstate: [{\n          code: this.fromPincodeData.statecode\n        }],\n        origincity: [{\n          code: this.fromPincodeData.citycode\n        }],\n        originpincode: this.fromPincodeData.pincode,\n        destinationcountry: [{\n          code: this.toPincodeData.countrycode\n        }],\n        destinationstate: [{\n          code: this.toPincodeData.statecode\n        }],\n        destinationcity: [{\n          code: this.toPincodeData.citycode\n        }],\n        destinationpincode: this.toPincodeData.pincode,\n        weight: +((_a = this.rateForm.get('weight')) === null || _a === void 0 ? void 0 : _a.value),\n        bookingdate: new Date().toISOString().split(\"T\")[0] // YYYY-MM-DD\n\n      };\n      console.log('Sending payload:', payload);\n      this.cityService.sendRateRequest(payload, accesstoken).subscribe({\n        next: res => {\n          var _a;\n\n          if ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.length) {\n            console.log('Rates:', res.data);\n\n            if ((res === null || res === void 0 ? void 0 : res.success) && Array.isArray(res.data)) {\n              this.rateData = res.data.map(item => ({\n                product: item.product,\n                service: item.service,\n                freightAmount: item.rate || 0,\n                otherCharges: item.total_otherchargesamount || 0,\n                amount: item.rate + item.total_otherchargesamount || 0,\n                fuel: item.total_fuel || 0,\n                tax: item.taxamount || 0,\n                grandTotal: item.grandtotal || 0\n              }));\n            }\n          } else {\n            // 👇 Show message in popup\n            Swal.fire({\n              icon: 'info',\n              title: 'No Rates Found',\n              text: res.message || 'No active contract or rates available.'\n            });\n          }\n        },\n        error: err => {\n          var _a;\n\n          console.error('Rate request failed:', err);\n          alert(((_a = err === null || err === void 0 ? void 0 : err.error) === null || _a === void 0 ? void 0 : _a.message) || \"Something went wrong while fetching rates.\");\n        },\n        complete: () => {\n          this.isLoading = false; // stop loader ✅\n        }\n      });\n    }\n\n    setupPincodeListeners(accesstoken) {\n      var _a, _b; // FROM PINCODE\n\n\n      (_a = this.rateForm.get('fromPincode')) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(debounceTime(300)).subscribe(pincode => {\n        if ((pincode === null || pincode === void 0 ? void 0 : pincode.length) === 6) {\n          this.cityService.getLocationByPincode(pincode, accesstoken).subscribe({\n            next: res => {\n              var _a; //   const city = res?.data?.[0]?.cityname;\n\n\n              const cityData = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a[0];\n\n              if (cityData.cityname) {\n                this.fromPincodeData = cityData;\n                this.rateForm.patchValue({\n                  shipFrom: cityData.citycode\n                });\n\n                if (!this.cities.includes(cityData.cityname)) {\n                  this.cities.push(cityData.cityname);\n                }\n              }\n            },\n            error: err => {\n              console.error('Invalid From Pincode:', err);\n            }\n          });\n        }\n      }); // TO PINCODE\n\n      (_b = this.rateForm.get('toPincode')) === null || _b === void 0 ? void 0 : _b.valueChanges.pipe(debounceTime(300)).subscribe(pincode => {\n        if ((pincode === null || pincode === void 0 ? void 0 : pincode.length) === 6) {\n          this.cityService.getLocationByPincode(pincode, accesstoken).subscribe({\n            next: res => {\n              var _a; //   const city = res?.data?.[0]?.cityname;\n\n\n              const cityData = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a[0];\n\n              if (cityData.cityname) {\n                this.toPincodeData = cityData;\n                this.rateForm.patchValue({\n                  shipTo: cityData.citycode\n                });\n\n                if (!this.cities.includes(cityData.cityname)) {\n                  this.cities.push(cityData.cityname);\n                }\n              }\n            },\n            error: err => {\n              console.error('Invalid To Pincode:', err);\n            }\n          });\n        }\n      });\n    }\n\n    getRateInformation(accesstoken) {\n      this.isLoading = true;\n      this.cityService.getRateInformation('Tariff', accesstoken).subscribe({\n        next: res => {\n          console.log('Rate Information:', res);\n          const responseData = res.data || []; //  Extract origin & destination lists\n\n          const shipFromList = responseData.map(x => x.origincitycode).filter(Boolean);\n          const shipToList = responseData.map(x => x.destinationcitycode).filter(Boolean); //  If ALL origin codes are null → show all cities, else show filtered\n\n          this.cityService.getCities(accesstoken).subscribe({\n            next: cities => {\n              var _a;\n\n              this.cities = Array.isArray(cities) ? cities : [];\n\n              if ((shipFromList === null || shipFromList === void 0 ? void 0 : shipFromList.length) > 0) {\n                this.filteredShipFrom = (_a = this.cities) === null || _a === void 0 ? void 0 : _a.filter(city => shipFromList.includes(city.code));\n              } else {\n                this.filteredShipFrom = this.cities;\n              }\n            }\n          });\n          console.log('shipToList.length : ', shipToList.length);\n          this.cityService.getCities(accesstoken).subscribe({\n            next: cities => {\n              var _a;\n\n              this.cities = Array.isArray(cities) ? cities : []; // this.filteredShipTo = this.cities;\n\n              if ((shipToList === null || shipToList === void 0 ? void 0 : shipToList.length) > 0) {\n                this.filteredShipTo = (_a = this.cities) === null || _a === void 0 ? void 0 : _a.filter(city => shipToList.includes(city.code));\n              } else {\n                this.filteredShipTo = this.cities;\n              }\n            }\n          }); //  Reset form values\n\n          this.rateForm.patchValue({\n            shipFrom: '',\n            shipTo: ''\n          });\n        },\n        error: err => {\n          console.error('Error:', err);\n        },\n        complete: () => {\n          this.isLoading = false;\n        }\n      });\n    }\n\n    setTab(tab) {\n      var _a, _b, _c, _d, _e, _f;\n\n      this.activeTab = tab;\n\n      if (tab === 'international') {\n        (_a = this.rateForm.get('fromPincode')) === null || _a === void 0 ? void 0 : _a.clearValidators();\n        (_b = this.rateForm.get('toPincode')) === null || _b === void 0 ? void 0 : _b.clearValidators();\n      } else {\n        (_c = this.rateForm.get('fromPincode')) === null || _c === void 0 ? void 0 : _c.setValidators([Validators.required]);\n        (_d = this.rateForm.get('toPincode')) === null || _d === void 0 ? void 0 : _d.setValidators([Validators.required]);\n      }\n\n      (_e = this.rateForm.get('fromPincode')) === null || _e === void 0 ? void 0 : _e.updateValueAndValidity();\n      (_f = this.rateForm.get('toPincode')) === null || _f === void 0 ? void 0 : _f.updateValueAndValidity();\n    }\n\n    loadCities(accesstoken) {\n      this.cityService.getCities(accesstoken).subscribe({\n        next: cities => {\n          this.cities = Array.isArray(cities) ? cities : [];\n        },\n        error: () => {\n          this.cities = [];\n        }\n      });\n    }\n\n    onSubmit() {\n      if (this.rateForm.valid) {\n        const rawToken = localStorage.getItem('token');\n        const token = rawToken ? JSON.parse(rawToken) : null;\n\n        if (!token || !token.accesstoken) {\n          this.authenticateUser();\n        }\n\n        console.log('Form Data:', this.rateForm.value);\n        this.sendRateCalculationRequest(token.accesstoken);\n      } else {\n        this.rateForm.markAllAsTouched();\n      }\n    }\n\n    authenticateUser() {\n      const initialParams = {\n        logintype: environment.logintype,\n        clientid: environment.clientid,\n        email: environment.email,\n        mode: 'email'\n      };\n      this.authService.AuthenticateUser(initialParams).subscribe(res1 => {\n        if (res1 === null || res1 === void 0 ? void 0 : res1.success) {\n          const hashedPassword = md5(environment.password);\n          const loginParams = {\n            logintype: environment.logintype,\n            clientid: environment.clientid,\n            email: environment.email,\n            password: hashedPassword,\n            id: res1.data[0].id,\n            deviceid: 1\n          };\n          this.authService.AuthenticateUser(loginParams).subscribe(res2 => {\n            this.accesstoken = res2.accesstoken;\n\n            if ((res2 === null || res2 === void 0 ? void 0 : res2.success) && res2.accesstoken) {\n              const tokenData = {\n                accesstoken: res2.accesstoken,\n                refreshtoken: res2.refreshtoken,\n                type: 'user'\n              };\n              this.authService.SetToken(tokenData);\n              this.loadCities(tokenData.accesstoken);\n              this.setupPincodeListeners(tokenData.accesstoken);\n              this.getRateInformation(tokenData.accesstoken);\n            }\n          });\n        }\n      });\n    }\n\n  }\n\n  RatecalculatormoduleComponent.ɵfac = function RatecalculatormoduleComponent_Factory(t) {\n    return new (t || RatecalculatormoduleComponent)(i0.ɵɵdirectiveInject(i1.FormBuilder), i0.ɵɵdirectiveInject(i2.CityService), i0.ɵɵdirectiveInject(i3.AuthService));\n  };\n\n  RatecalculatormoduleComponent.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n    type: RatecalculatormoduleComponent,\n    selectors: [[\"app-ratecalculatormodule\"]],\n    decls: 44,\n    vars: 17,\n    consts: [[1, \"rate-card\"], [\"class\", \"loader-overlay\", 4, \"ngIf\"], [1, \"nav\", \"nav-pills\", \"mb-3\", \"justify-content-center\"], [1, \"nav-item\"], [1, \"nav-link\", 3, \"click\"], [3, \"formGroup\", \"ngSubmit\"], [1, \"row\", \"g-3\"], [\"class\", \"col-md-6\", 4, \"ngIf\"], [1, \"col-md-6\"], [1, \"form-label\"], [1, \"text-danger\"], [\"formControlName\", \"shipFrom\", 1, \"form-select\"], [\"value\", \"\"], [3, \"value\", 4, \"ngFor\", \"ngForOf\"], [\"class\", \"text-danger\", 4, \"ngIf\"], [\"formControlName\", \"shipTo\", 1, \"form-select\"], [1, \"row\", \"g-3\", \"mt-3\"], [1, \"col-md-12\"], [\"type\", \"number\", \"formControlName\", \"weight\", \"placeholder\", \"Enter weight\", 1, \"form-control\"], [1, \"text-center\", \"mt-3\"], [\"type\", \"submit\", 1, \"btn\", \"btn-submit\", 3, \"disabled\"], [4, \"ngIf\"], [\"class\", \"rate-table-container\", 4, \"ngIf\"], [1, \"loader-overlay\"], [1, \"loader\"], [\"type\", \"text\", \"formControlName\", \"fromPincode\", \"placeholder\", \"Enter From Pincode\", 1, \"form-control\"], [\"type\", \"text\", \"formControlName\", \"toPincode\", \"placeholder\", \"Enter To Pincode\", 1, \"form-control\"], [3, \"value\"], [1, \"spinner-border\", \"spinner-border-sm\"], [1, \"rate-table-container\"], [1, \"rate-table\"], [4, \"ngFor\", \"ngForOf\"], [1, \"grand-total\"]],\n    template: function RatecalculatormoduleComponent_Template(rf, ctx) {\n      if (rf & 1) {\n        i0.ɵɵelementStart(0, \"div\", 0);\n        i0.ɵɵtemplate(1, RatecalculatormoduleComponent_div_1_Template, 2, 0, \"div\", 1);\n        i0.ɵɵelementStart(2, \"ul\", 2);\n        i0.ɵɵelementStart(3, \"li\", 3);\n        i0.ɵɵelementStart(4, \"button\", 4);\n        i0.ɵɵlistener(\"click\", function RatecalculatormoduleComponent_Template_button_click_4_listener() {\n          return ctx.setTab(\"domestic\");\n        });\n        i0.ɵɵtext(5, \" Domestic \");\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementStart(6, \"li\", 3);\n        i0.ɵɵelementStart(7, \"button\", 4);\n        i0.ɵɵlistener(\"click\", function RatecalculatormoduleComponent_Template_button_click_7_listener() {\n          return ctx.setTab(\"international\");\n        });\n        i0.ɵɵtext(8, \" International \");\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementStart(9, \"form\", 5);\n        i0.ɵɵlistener(\"ngSubmit\", function RatecalculatormoduleComponent_Template_form_ngSubmit_9_listener() {\n          return ctx.onSubmit();\n        });\n        i0.ɵɵelementStart(10, \"div\", 6);\n        i0.ɵɵtemplate(11, RatecalculatormoduleComponent_div_11_Template, 7, 1, \"div\", 7);\n        i0.ɵɵtemplate(12, RatecalculatormoduleComponent_div_12_Template, 7, 1, \"div\", 7);\n        i0.ɵɵelementStart(13, \"div\", 8);\n        i0.ɵɵelementStart(14, \"label\", 9);\n        i0.ɵɵtext(15, \"Ship From \");\n        i0.ɵɵelementStart(16, \"span\", 10);\n        i0.ɵɵtext(17, \"*\");\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementStart(18, \"select\", 11);\n        i0.ɵɵelementStart(19, \"option\", 12);\n        i0.ɵɵtext(20, \"- Choose location -\");\n        i0.ɵɵelementEnd();\n        i0.ɵɵtemplate(21, RatecalculatormoduleComponent_option_21_Template, 2, 2, \"option\", 13);\n        i0.ɵɵelementEnd();\n        i0.ɵɵtemplate(22, RatecalculatormoduleComponent_div_22_Template, 2, 0, \"div\", 14);\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementStart(23, \"div\", 8);\n        i0.ɵɵelementStart(24, \"label\", 9);\n        i0.ɵɵtext(25, \"Ship To \");\n        i0.ɵɵelementStart(26, \"span\", 10);\n        i0.ɵɵtext(27, \"*\");\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementStart(28, \"select\", 15);\n        i0.ɵɵelementStart(29, \"option\", 12);\n        i0.ɵɵtext(30, \"- Choose location -\");\n        i0.ɵɵelementEnd();\n        i0.ɵɵtemplate(31, RatecalculatormoduleComponent_option_31_Template, 2, 2, \"option\", 13);\n        i0.ɵɵelementEnd();\n        i0.ɵɵtemplate(32, RatecalculatormoduleComponent_div_32_Template, 2, 0, \"div\", 14);\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementStart(33, \"div\", 16);\n        i0.ɵɵelementStart(34, \"div\", 17);\n        i0.ɵɵelementStart(35, \"label\", 9);\n        i0.ɵɵtext(36, \"Weight (kg) *\");\n        i0.ɵɵelementEnd();\n        i0.ɵɵelement(37, \"input\", 18);\n        i0.ɵɵtemplate(38, RatecalculatormoduleComponent_div_38_Template, 2, 0, \"div\", 14);\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementStart(39, \"div\", 19);\n        i0.ɵɵelementStart(40, \"button\", 20);\n        i0.ɵɵtemplate(41, RatecalculatormoduleComponent_span_41_Template, 2, 0, \"span\", 21);\n        i0.ɵɵtemplate(42, RatecalculatormoduleComponent_span_42_Template, 3, 0, \"span\", 21);\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementEnd();\n        i0.ɵɵtemplate(43, RatecalculatormoduleComponent_div_43_Template, 22, 1, \"div\", 22);\n      }\n\n      if (rf & 2) {\n        let tmp_7_0;\n        let tmp_9_0;\n        let tmp_10_0;\n        i0.ɵɵadvance(1);\n        i0.ɵɵproperty(\"ngIf\", ctx.isLoading);\n        i0.ɵɵadvance(3);\n        i0.ɵɵclassProp(\"active\", ctx.activeTab === \"domestic\");\n        i0.ɵɵadvance(3);\n        i0.ɵɵclassProp(\"active\", ctx.activeTab === \"international\");\n        i0.ɵɵadvance(2);\n        i0.ɵɵproperty(\"formGroup\", ctx.rateForm);\n        i0.ɵɵadvance(2);\n        i0.ɵɵproperty(\"ngIf\", ctx.activeTab === \"domestic\");\n        i0.ɵɵadvance(1);\n        i0.ɵɵproperty(\"ngIf\", ctx.activeTab === \"domestic\");\n        i0.ɵɵadvance(9);\n        i0.ɵɵproperty(\"ngForOf\", ctx.filteredShipFrom);\n        i0.ɵɵadvance(1);\n        i0.ɵɵproperty(\"ngIf\", ((tmp_7_0 = ctx.rateForm.get(\"shipFrom\")) == null ? null : tmp_7_0.touched) && ((tmp_7_0 = ctx.rateForm.get(\"shipFrom\")) == null ? null : tmp_7_0.hasError(\"required\")));\n        i0.ɵɵadvance(9);\n        i0.ɵɵproperty(\"ngForOf\", ctx.filteredShipTo);\n        i0.ɵɵadvance(1);\n        i0.ɵɵproperty(\"ngIf\", ((tmp_9_0 = ctx.rateForm.get(\"shipTo\")) == null ? null : tmp_9_0.touched) && ((tmp_9_0 = ctx.rateForm.get(\"shipTo\")) == null ? null : tmp_9_0.hasError(\"required\")));\n        i0.ɵɵadvance(6);\n        i0.ɵɵproperty(\"ngIf\", ((tmp_10_0 = ctx.rateForm.get(\"weight\")) == null ? null : tmp_10_0.touched) && ((tmp_10_0 = ctx.rateForm.get(\"weight\")) == null ? null : tmp_10_0.hasError(\"required\")));\n        i0.ɵɵadvance(2);\n        i0.ɵɵproperty(\"disabled\", ctx.isLoading);\n        i0.ɵɵadvance(1);\n        i0.ɵɵproperty(\"ngIf\", !ctx.isLoading);\n        i0.ɵɵadvance(1);\n        i0.ɵɵproperty(\"ngIf\", ctx.isLoading);\n        i0.ɵɵadvance(1);\n        i0.ɵɵproperty(\"ngIf\", ctx.rateData.length > 0);\n      }\n    },\n    directives: [i4.NgIf, i1.ɵNgNoValidate, i1.NgControlStatusGroup, i1.FormGroupDirective, i1.SelectControlValueAccessor, i1.NgControlStatus, i1.FormControlName, i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i4.NgForOf, i1.NumberValueAccessor, i1.DefaultValueAccessor],\n    styles: [\".rate-card[_ngcontent-%COMP%]{border:2px solid #4a148c;border-radius:12px;padding:20px;max-width:600px;margin:auto;background:#fff;box-shadow:0 4px 15px #0000001a}.nav-pills[_ngcontent-%COMP%]   .nav-link[_ngcontent-%COMP%]{border-radius:8px;font-weight:600;color:#4a148c}.nav-pills[_ngcontent-%COMP%]   .nav-link.active[_ngcontent-%COMP%]{background-color:#4a148c;color:#fff}.highlight-box[_ngcontent-%COMP%]{background:orange;border-radius:8px;padding:15px;margin-top:15px}.btn-submit[_ngcontent-%COMP%]{background:#4a148c;color:#fff;font-weight:bold;border-radius:8px;padding:10px 25px}.rate-card[_ngcontent-%COMP%]{position:relative}.loader-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;background:rgba(255,255,255,.8);display:flex;justify-content:center;align-items:center;z-index:10;border-radius:inherit}.loader[_ngcontent-%COMP%]{border:6px solid #f3f3f3;border-top:6px solid #007bff;border-radius:50%;width:60px;height:60px;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.rate-table-container[_ngcontent-%COMP%]{margin:20px auto 40px;border:2px solid #6c2eb9;border-radius:12px;padding:15px;box-shadow:0 4px 10px #6c2eb926;background-color:#fff;max-width:800px;width:90%}.rate-table[_ngcontent-%COMP%]{width:100%;border-collapse:separate;border-spacing:0;font-family:\\\"Poppins\\\",sans-serif;font-size:14px;color:#333}.rate-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{background-color:#f7f2fb}.rate-table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{text-align:left;padding:10px;font-weight:600;color:#6c2eb9;border-bottom:2px solid #e1d5f4}.rate-table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:10px;border-bottom:1px solid #eee}.rate-table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:hover{background-color:#faf6ff}.rate-table[_ngcontent-%COMP%]   .grand-total[_ngcontent-%COMP%]{font-weight:600;color:#6c2eb9}.rate-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:first-child{border-top-left-radius:8px}.rate-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]:last-child{border-top-right-radius:8px}\"]\n  });\n  return RatecalculatormoduleComponent;\n})();","map":null,"metadata":{},"sourceType":"module"}