vendor: 2,070 bytes, line 1
1import{c as L,d as Me}from"./chunk-M5TTSMSK.js";import{a as ke}from"./chunk-SGMMG6GE.js";import{a as fe}from"./chunk-KKH5IEL5.js";import{b as be}from"./chunk-K47OYI2O.js";import{q as F,t as ge}from"./chunk-N73AKB6R.js";import{a as b}from"./chunk-UPNOM4OI.js";import{$a as O,Ac as le,Ad as xe,Ba as p,Bc as V,Cd as ve,Db as G,Dc as Q,Eb as H,Ec as U,Fb as K,Fd as ye,Gc as N,Gd as Se,Ib as X,J as P,Ja as d,Jd as Pe,Ka as r,La as M,Mc as ce,Nc as pe,Oc as me,Pa as g,Qc as _e,Ra as f,Rc as ue,S as W,Sa as l,Tc as he,Z as _,Za as I,_ as u,_a as B,bb as c,cb as E,db as w,ea as q,eb as j,ec as J,fa as z,fb as x,fc as Y,g as a,gb as v,gc as $,h as R,hb as y,hc as ee,ic as te,j as Z,jc as ie,kc as se,mc as ne,qb as T,rb as D,sa as o,sc as re,ta as S,uc as de,vc as oe,vd as Ce,wc as ae,xd as Ae,yd as we,za as h}from"./chunk-IVEOF2IW.js";var Ee=["editmodeForm"],Te=["search"];function De(n,m){n&1&&(d(0,"label",15),c(1," The shipping address is already in the system. "),r())}function Ve(n,m){n&1&&(d(0,"div",16),M(1,"mat-progress-spinner",17),r())}function Qe(n,m){n&1&&(d(0,"div",4)(1,"span",15),c(2,"* Enter at least 3 characters to display the addresses"),r()())}function Ue(n,m){if(n&1){let t=g();d(0,"div",4)(1,"label",18),c(2,"Search for shipping address from corporate address book"),r(),d(3,"div",19)(4,"div",20)(5,"mat-form-field",21)(6,"mat-label"),c(7,"Search for your address by entering a street name "),M(8,"address"),r(),d(9,"input",22),f("keyup",function(i){_(t);let s=l();return u(s.searchAddress(i.target.value))})("focus",function(){_(t);let i=l();return u(i.searchFocus())})("blur",function(){_(t);let i=l();return u(i.searchBlur())}),r(),d(10,"mat-icon",23),c(11,"search"),r()()(),h(12,Qe,3,0,"div",13),r()()}if(n&2){let t=l();o(4),p("@changeDivSize",t.divWidth),o(5),p("formControl",t.myControl),o(3),p("ngIf",t.isAtleast3Char)}}function Ne(n,m){if(n&1){let t=g();d(0,"mat-card",28),f("click",function(){_(t);let i=l(2);return u(i.addAddress())}),d(1,"div",29)(2,"div",30)(3,"mat-icon"),c(4,"add"),r()(),d(5,"div",31),c(6," Add address "),r()()()}}
1function Fe(n,m){if(n&1&&(d(0,"span",41),c(1),r()),n&2){let t=l().$implicit;o(),w(", \xA0",t.AddressTwo,"")}}function Le(n,m){if(n&1&&(d(0,"span",41),c(1),r()),n&2){let t=l().$implicit;o(),w(", \xA0",t.AddressThree,"")}}function Re(n,m){if(n&1&&(d(0,"span",41),c(1),r()),n&2){let t=l().$implicit;o(),w(", \xA0",t.AddressFour,"")}}function Ze(n,m){if(n&1&&(d(0,"span"),c(1),r()),n&2){let t=l().$implicit;o(),E(t.City)}}function We(n,m){if(n&1&&(d(0,"span"),c(1),r()),n&2){let t=l().$implicit;o(),w(", \xA0",t.StateFullCode,"")}}function qe(n,m){if(n&1&&(d(0,"span",41),c(1),r()),n&2){let t=l().$implicit;o(),w(", \xA0",t.ZipCode,"")}}function ze(n,m){if(n&1&&(d(0,"span"),c(1),T(2,"uppercase"),r()),n&2){let t=l().$implicit;o(),w(", \xA0",D(2,1,t.Province),"")}}function je(n,m){if(n&1&&(d(0,"div",41),c(1),T(2,"uppercase"),r()),n&2){let t=l().$implicit;o(),w(" ",D(2,1,t.CountryFullCode)," ")}}function Ge(n,m){if(n&1){let t=g();d(0,"a",42),f("click",function(){_(t);let i=l().$implicit,s=l(2);return u(s.setAddress(i))}),c(1,"Select"),r()}}function He(n,m){if(n&1){let t=g();d(0,"a",42),f("click",function(){_(t);let i=l().$implicit,s=l(2);return u(s.setDefaultAddress(i.Id,s.userData.Type))}),c(1,"Set as default"),r()}}function Ke(n,m){if(n&1&&(d(0,"div",25)(1,"mat-card",32)(2,"div",33)(3,"div",34)(4,"div"),c(5),r(),d(6,"div")(7,"span"),c(8),r(),h(9,Fe,2,1,"span",35)(10,Le,2,1,"span",35)(11,Re,2,1,"span",35),r(),d(12,"div",36),h(13,Ze,2,1,"span",37)(14,We,2,1,"span",37)(15,qe,2,1,"span",35)(16,ze,3,3,"span",37),r(),h(17,je,3,3,"div",35),r()(),d(18,"div",38)(19,"ul",39)(20,"li"),h(21,Ge,2,0,"a",40),r(),d(22,"li"),h(23,He,2,0,"a",40),r()()()()()),n&2){let t=m.$implicit,e=l(2);p("@fade500",e.tempAddData.length>0),o(),p("ngClass",t.inUse==!0?"shippingselectpanel":"shippingpanelk1"),o(4),j("",t.FirstName," ",t.LastName,""),o(3),E(t.AddressOne),o(),p("ngIf",t.AddressTwo),o(),p("ngIf",t.AddressThree),o(),p("ngIf",t.AddressFour),o(2),p("ngIf",t.City),o(),p("ngIf",t.StateFullCode),o(),p("ngIf",t.ZipCode),o(),p("ngIf",t.Province),o(),p("ngIf",t.CountryFullCode),o(4),p("ngIf",!t.inUse),o(2),p("ngIf",!t.isDefault&&e.isUserLoggedIn)}}function Xe(n,m){if(n&1&&(d(0,"div",4)(1,"div",24)(2,"div",25),h(3,Ne,7,0,"mat-card",26),r(),h(4,Ke,24,15,"div",27),r()()),n&2){let t=l();o(3),p("ngIf",t.tempAddData&&t.tempAddData.length>0||t.searchedNotFound),o(),p("ngForOf",t.tempAddData)}}function Je(n,m){if(n&1){let t=g();d(0,"a",55),f("click",function(){_(t);let i=l(2);return u(i.backForm())}),d(1,"i",56),c(2,"keyboard_arrow_left "),r(),d(3,"span",57),c(4,"Back"),r()()}}function Ye(n,m){if(n&1&&(d(0,"mat-option",73),c(1),r()),n&2){let t=m.$implicit;p("value",t.CodeId),o(),w(" ",t.Description," ")}}function $e(n,m){if(n&1){let t=g();d(0,"mat-form-field",48)(1,"mat-label"),c(2,"Zip / Postal Code"),r(),d(3,"input",74),f("keypress",function(){_(t);let i=l(3);return u(i.erraseZipcodeError(i.newAddress.ZipCode))})("blur",function(){_(t);let i=l(3);return u(i.getAddress(i.newAddress.ZipCode))}),y("ngModelChange",function(i){_(t);let s=l(3);return v(s.newAddress.ZipCode,i)||(s.newAddress.ZipCode=i),u(i)}),r()()}if(n&2){let t=l(3);o(3),x("ngModel",t.newAddress.ZipCode)}}function et(n,m){if(n&1){let t=g();d(0,"mat-form-field",48)(1,"mat-label"),c(2,"Postal Code"),r(),d(3,"input",75),f("keypress",function(i){_(t);let s=l(3);return u(s.specialcharpanel(i))}),y("ngModelChange",function(i){_(t);let s=l(3);return v(s.newAddress.PostalCode,i)||(s.newAddress.PostalCode=i),u(i)}),r(),d(4,"mat-error",15),c(5,"Please enter valid zip code"),r()()}if(n&2){let t=l(3);o(3),x("ngModel",t.newAddress.PostalCode)}}function tt(n,m){n&1&&(d(0,"label",15),c(1," Please enter valid zip code "),r())}function it(n,m){if(n&1&&(d(0,"mat-option",73),c(1),r()),n&2){let t=m.$implicit;p("value",t.CodeId),o(),w(" ",t.Description," ")}}function st(n,m){if(n&1){let t=g();d(0,"mat-form-field",48)(1,"mat-label"),c(2,"State"),r(),d(3,"mat-select",76),f("selectionChange",function(i){_(t);let s=l(3);return u(s.stateChange(i.value))}),y("ngModelChange",function(i){_(t);let s=l(3);return v(s.newAddress.State,i)||(s.newAddress.State=i),u(i)}),h(4,it,2,2,"mat-option",63),r()()}if(n&2){let t=l(3);o(3),x("ngModel",t.newAddress.State),p("disabled",t.isReadOnly),o(),p("ngForOf",t.states)}}function nt(n,m){if(n&1){let t=g();d(0,"mat-form-field",48)(1,"mat-label"),c(2,"State / Province / Region"),r(),d(3,"input",77),f("keypress",function(i){_(t);let s=l(3);return u(s.specialcharpanel(i))}),y("ngModelChange",function(i){_(t);let s=l(3);return v(s.newAddress.Province,i)||(s.newAddress.Province=i),u(i)}),r()()}if(n&2){let t=l(3);o(3),x("ngModel",t.newAddress.Province)}}
1function rt(n,m){if(n&1&&(d(0,"mat-option",73),c(1),r()),n&2){let t=m.$implicit;p("value",t.CodeId),o(),w(" ",t.Description," ")}}function dt(n,m){if(n&1){let t=g();d(0,"div",59)(1,"mat-form-field",48)(2,"mat-label"),c(3,"County"),r(),d(4,"mat-select",78),y("ngModelChange",function(i){_(t);let s=l(3);return v(s.newAddress.County,i)||(s.newAddress.County=i),u(i)}),h(5,rt,2,2,"mat-option",63),r()()()}if(n&2){let t=l(3);o(4),x("ngModel",t.newAddress.County),o(),p("ngForOf",t.counties)}}function ot(n,m){n&1&&(d(0,"label",15),c(1," Please enter the accurate address, PO BOX is not acceptable. "),r())}function at(n,m){n&1&&(d(0,"label",15),c(1," Please enter the accurate address, PO BOX is not acceptable. "),r())}function lt(n,m){if(n&1){let t=g();d(0,"button",79),f("click",function(){_(t);let i=l(3);return u(i.saveAddress())}),c(1,"Submit"),r()}}function ct(n,m){if(n&1){let t=g();d(0,"button",79),f("click",function(){_(t);let i=l(3);return u(i.guestSaveAddress())}),c(1,"Submit"),r()}}function pt(n,m){if(n&1){let t=g();d(0,"div",58)(1,"div",4)(2,"div",59)(3,"mat-form-field",48)(4,"mat-label"),c(5,"Address Type"),r(),d(6,"mat-select",60),y("valueChange",function(i){_(t);let s=l(2);return v(s.newAddress.Type,i)||(s.newAddress.Type=i),u(i)}),d(7,"mat-option",61),c(8,"Shipping"),r()()()(),d(9,"div",59)(10,"mat-form-field",48)(11,"mat-label"),c(12,"Country"),r(),d(13,"mat-select",62),f("selectionChange",function(i){_(t);let s=l(2);return u(s.countryChange(i.value))}),y("ngModelChange",function(i){_(t);let s=l(2);return v(s.newAddress.Country,i)||(s.newAddress.Country=i),u(i)}),h(14,Ye,2,2,"mat-option",63),r()()(),d(15,"div",59),h(16,$e,4,1,"mat-form-field",64)(17,et,6,1,"mat-form-field",64)(18,tt,2,0,"label",10),r()(),d(19,"div",65)(20,"div",59),h(21,st,5,3,"mat-form-field",64)(22,nt,4,1,"mat-form-field",64),r(),d(23,"div",59)(24,"mat-form-field",48)(25,"mat-label"),c(26,"City"),r(),d(27,"input",66),f("keypress",function(i){_(t);let s=l(2);return u(s.specialcharpanel(i))}),y("ngModelChange",function(i){_(t);let s=l(2);return v(s.newAddress.City,i)||(s.newAddress.City=i),u(i)}),r()()(),h(28,dt,6,2,"div",67),r(),d(29,"div",65)(30,"div",68)(31,"mat-form-field",48)(32,"mat-label"),c(33,"Street Address"),r(),d(34,"input",69),f("blur",function(){_(t);let i=l(2);return u(i.addressBoxError(i.newAddress.Type,i.newAddress.AddressOne))}),y("ngModelChange",function(i){_(t);let s=l(2);return v(s.newAddress.AddressOne,i)||(s.newAddress.AddressOne=i),u(i)}),r()(),h(35,ot,2,0,"label",10),r(),d(36,"div",68)(37,"mat-form-field",48)(38,"mat-label"),c(39,"Street Address 2"),r(),d(40,"input",70),y("ngModelChange",function(i){_(t);let s=l(2);return v(s.newAddress.AddressTwo,i)||(s.newAddress.AddressTwo=i),u(i)}),f("blur",function(){_(t);let i=l(2);return u(i.address2BoxError(i.newAddress.Type,i.newAddress.AddressTwo))}),r()(),h(41,at,2,0,"label",10),r()(),d(42,"div",4)(43,"div",71),h(44,lt,2,0,"button",72)(45,ct,2,0,"button",72),r()()()}if(n&2){let t=l(2);o(6),x("value",t.newAddress.Type),p("disabled",!0),o(7),x("ngModel",t.newAddress.Country),o(),p("ngForOf",t.countries),o(2),p("ngIf",t.isUS),o(),p("ngIf",!t.isUS),o(),p("ngIf",t.zipError),o(3),p("ngIf",t.isUS),o(),p("ngIf",!t.isUS),o(5),x("ngModel",t.newAddress.City),o(),p("ngIf",t.isCaliforniaState),o(6),x("ngModel",t.newAddress.AddressOne),o(),p("ngIf",t.address1POBoxError),o(5),x("ngModel",t.newAddress.AddressTwo),o(),p("ngIf",t.address2POBoxError),o(3),p("ngIf",t.addressModification),o(),p("ngIf",!t.addressModification)}}function mt(n,m){if(n&1){let t=g();d(0,"div",4)(1,"div",4),h(2,Je,5,0,"a",43),r(),d(3,"div",4)(4,"form",44,0)(6,"div",45)(7,"div",46)(8,"div",4)(9,"div",47)(10,"div",20)(11,"mat-form-field",48)(12,"mat-label"),c(13,"Search for your address by entering a street name"),r(),M(14,"input",49,1),r()()()(),d(16,"div",4)(17,"div",50)(18,"a",51),f("click",function(){_(t);let i=l();return u(i.entermanuallyaddress())}),c(19,"Can't see your address? Enter it manually"),r()()()(),h(20,pt,46,17,"div",52),r(),d(21,"div",53)(22,"a",54),f("click",function(){_(t);let i=l();return u(i.Searchanotherviewaddress())}),c(23,"Search for another address"),r()()()()()}if(n&2){let t=l();o(2),p("ngIf",!t.backButtonDisabled),o(5),p("hidden",t.isAddressVisible),o(10),p("hidden",t.isAddressVisible),o(3),p("ngIf",t.isAddressVisible),o(),p("hidden",!t.isAddressVisible)}}function _t(n,m){if(n&1){let t=g();d(0,"div",4)(1,"div",80)(2,"div",15),c(3,"Please add or select address to proceed to next step."),r(),d(4,"div")(5,"input",81),f("click",function(){_(t);let i=l();return u(i.addressPopUpOK())}),r()()()()}}var Zt=(()=>{let m=class m{constructor(e,i,s,C,A,Ie,k){a(this,"_googleMapsService");a(this,"dialogRef");a(this,"ngZone");a(this,"data");a(this,"_snackBar");a(this,"_addressPopupService");a(this,"_addressBookService");a(this,"ngUnsubscribe",new Z);a(this,"addresses",[]);a(this,"userData","");a(this,"countries",[]);a(this,"states",[]);a(this,"counties",[]);a(this,"setAddr",new q);a(this,"editmodeForm");a(this,"searchElementRef");a(this,"editMode",!1);a(this,"newAddress");a(this,"isUS",!0);a(this,"isCaliforniaState",!1);a(this,"snackbar");a(this,"isValidate",!1);a(this,"isDisabled");a(this,"zipError");a(this,"isReadOnly",!0);a(this,"address1POBoxError");a(this,"address2POBoxError");a(this,"IsGuest");a(this,"isAddressVisible",!1);a(this,"searchControl");a(this,"addressModification");a(this,"IsExistingAddress",!1);a(this,"existingAddressId",!1);a(this,"existingAdddress",{});a(this,"pageNotLoaded",!0);a(this,"CloseAddressPopUMessage",!1);a(this,"tempData",[]);a(this,"isAtleast3Char",!1);a(this,"myBooks",[]);a(this,"myAddress",[]);a(this,"isCityLoading",!1);a(this,"searchedAdreess",[]);a(this,"isRecentAddress",!0);
1a(this,"allAddData");a(this,"filteredOptions");a(this,"myControl",new te);a(this,"tempAddData");a(this,"divWidth","initial");a(this,"defaultAddress");a(this,"addressLoading",!1);a(this,"searchedNotFound",!1);a(this,"isFullAddressLoading",!1);a(this,"isUserLoggedIn",!1);a(this,"backButtonDisabled",!1);a(this,"IsNewAddress",!1);this._googleMapsService=e,this.dialogRef=i,this.ngZone=s,this.data=C,this._snackBar=A,this._addressPopupService=Ie,this._addressBookService=k}VaidateAddress(){this.editmodeForm.valid?this._addressBookService.validateAddress(this.newAddress).subscribe(e=>{this.newAddress=e,this.newAddress.State=="CA"?this.isCaliforniaState=!0:this.isCaliforniaState=!1,e.isResolved?this.isValidate=!0:(alert("Address is invalid, please provide correct address."),this.isValidate=!1)},e=>{console.log(e)}):(this.snackbar=new b(this._snackBar),this.snackbar.openSnackBar("Please select all the required fields.","close"))}ngOnInit(){this.dialogRef.disableClose=!0,this.userData=this.data,this._addressPopupService.getCountries().pipe(P(this.ngUnsubscribe)).subscribe(e=>{this.countries=e.Results}),this._addressPopupService.getStates().pipe(P(this.ngUnsubscribe)).subscribe(e=>{this.states=e.Results}),this._addressPopupService.getCounties().pipe(P(this.ngUnsubscribe)).subscribe(e=>{this.counties=e.Results}),localStorage.getItem("token")?(this.isUserLoggedIn=!0,this.backButtonDisabled=!1):this.backButtonDisabled=!0,this.userData.Type.toLowerCase()=="shipping"&&(this.IsNewAddress=this.data.IsNewAddress,this.getAllAddresses()),this.newAddress=new L,this.newAddress.Type="SHIPPING",localStorage.getItem("token")?this.addressModification=!0:this.addressModification=!1}backForm(){this.IsExistingAddress=!1,this.editMode=!1,this.address1POBoxError=!1,this.address2POBoxError=!1}guestSaveAddress(){this.newAddress.Street1=this.newAddress.AddressOne.trim(),this.newAddress.AddressTwo&&(this.newAddress.Street2=this.newAddress.AddressTwo.trim()),this.addressBoxError(this.newAddress.Street1),this.newAddress.Street2&&this.address2BoxError(this.newAddress.Street2),this.newAddress.Type="SHIPPING",!this.address1POBoxError&&!this.address2POBoxError&&(this.editmodeForm.valid?(this.newAddress.ApplicationUserId=this.userData.UserContactId,this.newAddress.AddressOne=this.newAddress.Street1,this.newAddress.AddressTwo=this.newAddress.Street2,this.newAddress.CountryId=this.countries.filter(e=>e.CodeId==this.newAddress.Country)[0].Id,this.newAddress.Country=="us"&&(this.newAddress.StateId=this.states.filter(e=>e.CodeId==this.newAddress.State)[0].Id,this.newAddress.State=="CA"&&(this.newAddress.CountyId=this.counties.filter(e=>e.CodeId==this.newAddress.County)[0].Id)),this.newAddress.Id||this._addressPopupService.saveAddress(this.newAddress).pipe(P(this.ngUnsubscribe)).subscribe(e=>{this.newAddress.Id=e.Id,this.setAddedAddress(this.newAddress)})):(this.snackbar=new b(this._snackBar),this.snackbar.openSnackBar("Please select all the required fields.","close")))}setAddress(e){e.Country=e.CountryCode,e.State=e.StateCode,e.Street1=e.AddressOne,e.Street2=e.AddressTwo,e.Country.toUpperCase()=="US"?e.ZipPostalCode=e.PostalCode?e.PostalCode:e.ZipCode?e.ZipCode:"":e.PostalCode=e.PostalCode?e.PostalCode:e.ZipCode?e.ZipCode:"",this.userData.Type.toLowerCase()=="shipping"&&this.userData.ShippingAddress?(e.FirstName=this.userData.ShippingAddress.FirstName,e.LastName=this.userData.ShippingAddress.LastName,e.PhoneNumber=this.userData.ShippingAddress.PhoneNumber):this.userData.Type.toLowerCase()!="shipping"&&this.userData.BillingAddress&&(e.FirstName=this.userData.BillingAddress.FirstName,e.LastName=this.userData.BillingAddress.LastName,e.PhoneNumber=this.userData.BillingAddress.PhoneNumber),this.setAddr.emit(e),this.dialogRef.close()}setAddedAddress(e){e.ZipPostalCode=e.PostalCode?e.PostalCode:e.ZipCode?e.ZipCode:"",e.PostalCode=e.PostalCode?e.PostalCode:e.ZipCode?e.ZipCode:"",this.userData.Type.toLowerCase()=="shipping"&&this.userData.ShippingAddress?(e.FirstName=this.userData.ShippingAddress.FirstName,e.LastName=this.userData.ShippingAddress.LastName,e.PhoneNumber=this.userData.ShippingAddress.PhoneNumber):this.userData.Type.toLowerCase()!="shipping"&&this.userData.BillingAddress&&(e.FirstName=this.userData.BillingAddress.FirstName,e.LastName=this.userData.BillingAddress.LastName,e.PhoneNumber=this.userData.BillingAddress.PhoneNumber),this.setAddr.emit(e),this.dialogRef.close()}addAddress(){this.IsExistingAddress=!1,this.editMode=!0,this.newAddress=new L,this.newAddress.Country="us",this.countyChange(),this.newAddress.CustomerAccountId=this.userData.CustomerAccountId,this.newAddress.CreatedById=this.userData.UserContactId,setTimeout(()=>{this.AutocompleteFormMethod()},500)}AutocompleteFormMethod(){return R(this,null,function*(){this.isAddressVisible=!1;let e=yield this._googleMapsService.createAutocomplete(this.searchElementRef.nativeElement,{types:["address"]});e.addListener("place_changed",()=>{this.ngZone.run(()=>{var i=e.getPlace();setTimeout(()=>{this.isAddressVisible=!0},300),this.newAddress.Type="SHIPPING",this.newAddress.Country=i.address_components.filter(s=>s.types[0]=="country")[0].short_name.toLocaleLowerCase(),this.countryChange(this.newAddress.Country),this.newAddress.Country=="us"?(this.newAddress.State=i.address_components.filter(s=>s.types[0]=="administrative_area_level_1")[0].short_name,!this.newAddress.State||this.newAddress.State==""?this.isReadOnly=!1:this.isReadOnly=!0):(this.isReadOnly=!1,this.newAddress.Province=i.address_components.filter(s=>s.types[0]=="administrative_area_level_1")[0].long_name),this.isCaliforniaState=!1,i.address_components.forEac
1h(s=>{s.types.includes("street_number")&&(this.newAddress.AddressOne=s.long_name),s.types.includes("route")&&(this.newAddress.AddressOne&&this.newAddress.AddressOne!=""?this.newAddress.AddressOne=this.newAddress.AddressOne+" "+s.long_name:this.newAddress.AddressOne=s.long_name),s.types.includes("locality")&&(this.newAddress.City=s.short_name),s.types.includes("postal_code")&&(this.newAddress.Country=="us"?this.newAddress.ZipCode=s.long_name:this.newAddress.ZipCode=s.long_name),this.newAddress.State=="CA"&&(this.isCaliforniaState=!0,s.types.includes("administrative_area_level_2")&&(this.newAddress.County=s.long_name.replace(" County",""),this.searchElementRef.nativeElement.value=""))}),this.addressBoxError(this.newAddress.AddressOne)})})})}countryChange(e){this.isCaliforniaState=!1,this.zipError=!1,this.newAddress.Type="SHIPPING",e=="us"?(this.isUS=!0,this.newAddress.Province="",this.newAddress.AddressOne="",this.newAddress.AddressTwo="",this.newAddress.Street1="",this.newAddress.Street2="",this.newAddress.AddressOne="",this.newAddress.AddressTwo="",this.newAddress.City="",this.newAddress.State="",this.newAddress.ZipCode="",this.newAddress.isResolved=!0,this.stateChange("")):(this.isUS=!1,this.newAddress.State="",this.newAddress.Province="",this.newAddress.AddressOne="",this.newAddress.AddressTwo="",this.newAddress.Street1="",this.newAddress.Street2="",this.newAddress.City="",this.newAddress.ZipCode="",this.newAddress.isResolved=!0),this.address1POBoxError=!1,this.address2POBoxError=!1}stateChange(e){this.newAddress.Province="",e=="CA"?this.isCaliforniaState=!0:(this.isCaliforniaState=!1,this.newAddress.County="")}saveAddress(){this.newAddress.Street1=this.newAddress.AddressOne.trim(),this.newAddress.AddressTwo&&(this.newAddress.Street2=this.newAddress.AddressTwo.trim()),this.addressBoxError(this.newAddress.Street1),this.newAddress.Street2&&this.address2BoxError(this.newAddress.Street2),this.newAddress.Type="SHIPPING",!this.address1POBoxError&&!this.address2POBoxError&&(this.editmodeForm.valid?(this.newAddress.ApplicationUserId=this.userData.UserContactId,this.newAddress.AddressOne=this.newAddress.Street1,this.newAddress.AddressTwo=this.newAddress.Street2,this.newAddress.CountryId=this.countries.filter(e=>e.CodeId==this.newAddress.Country)[0].Id,this.newAddress.Country=="us"&&(this.newAddress.StateId=this.states.filter(e=>e.CodeId==this.newAddress.State)[0].Id,this.newAddress.State=="CA"&&(this.newAddress.CountyId=this.counties.filter(e=>e.CodeId==this.newAddress.County)[0].Id)),this.newAddress.Id||this._addressPopupService.saveAddress(this.newAddress).pipe(P(this.ngUnsubscribe)).subscribe(e=>{e&&e.isExistingAddress?(this.existingAddressId=e.Id,this.IsExistingAddress=!0):(this.newAddress.Id=e.Id,this.snackbar=new b(this._snackBar),this.snackbar.openSnackBar("Address created sucessfully.","close"),this.setAddedAddress(this.newAddress))})):(this.snackbar=new b(this._snackBar),this.snackbar.openSnackBar("Please select all the required fields.","close")))}countyChange(){this.isValidate=!1}Searchanotherviewaddress(){this.IsExistingAddress=!1,this.searchElementRef.nativeElement.value="",this.isAddressVisible=!this.isAddressVisible,setTimeout(()=>{this.AutocompleteFormMethod()},300),this.newAddress.Country="us",this.countryChange(this.newAddress.Country)}entermanuallyaddress(){this.searchElementRef.nativeElement.value="",this.newAddress.Type="SHIPPING",this.isAddressVisible=!this.isAddressVisible,this.newAddress.Country="us",this.countryChange(this.newAddress.Country)}setState(e){this.newAddress.Country=="us"?(this.isUS=!0,this.newAddress.State=this.states.filter(i=>i.CodeId==e.State)[0].CodeId):(this.isUS=!1,this.newAddress.Province=e.Province),this.newAddress.State=="CA"?this.isCaliforniaState=!0:this.isCaliforniaState=!1}erraseZipcodeError(e){e&&(e=e.replace(/\s/g,"")),this.newAddress.Country=="us"&&(!e||e.length<4)?this.zipError=!0:this.zipError=!1}getAddress(e){this.newAddress.City="",this.newAddress.State="",this.newAddress.County="",this.newAddress.AddressOne="",this.newAddress.AddressTwo="",this.newAddress.Street1="",this.newAddress.Street2="",this.zipError=!1,e=e.replace(/\s/g,""),this.isDisabled=!1,this.isCaliforniaState=!1,this.newAddress.Country=="us"&&(!e||e.length<=4)&&(this.zipError=!0),this.newAddress.Country=="us"&&e.length==5?this._addressBookService.getAddress(e).subscribe(i=>{let s=JSON.parse(i);if(s.status=="ZERO_RESULTS")this.zipError=!0,this.isReadOnly=!0,this.isDisabled=!0,this.newAddress.State="";else{this.zipError=!1;let C=s.results[0].formatted_address.split(",",1)[0],A=s.results[0].formatted_address.split(", ")[1].split(" ")[0];this.newAddress.City=C;var i=this.states.filter(Oe=>Oe.CodeId==A)[0];i?(this.newAddress.State=i.CodeId,this.newAddress.State&&this.newAddress.State!=""?(this.stateChange(this.newAddress.State),this.isReadOnly=!0):(this.newAddress.State="",this.isReadOnly=!1)):(this.newAddress.State="",this.isReadOnly=!1),this.isDisabled=!0;let k=s.results[0].address_components[2].long_name.split(" "),Be=k.slice(0,k.length-1).join(" ");this.newAddress.County=Be}}):this.isReadOnly=!1,this.address1POBoxError=!1,this.address2POBoxError=!1}addressBoxError(e){this.address1POBoxError=F(this.newAddress.Street1)}address2BoxError(e){this.address2POBoxError=F(this.newAddress.Street2)}specialcharpanel(e){return ge(e.charCode,{allowHyphen:!0})}ngOnDestroy(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()}closeModal(){if(this.CloseAddressPopUMessage=!1,this.userData.Type.toLowerCase()=="shipping"&&!this.userData.ShippingAddress&&this.userData.ShipTO==0){this.CloseAddressPopUMessage=!0;return}if(this.userData.Type.toLowerCase()=="shipping"&&this.userData.ShippingAddress){if(!this.userData.ShippingAddress.Country||this.userData.ShippingAddress.Country&&this.userData.ShippingAddress.Country.toUpperCase()=="US"&&(!this.userData.ShippingAddress.State||this.userData.ShippingAddress.State=="")){this.CloseAddressPopUMessage=!0;return}}else if(this.userData.Type.toLowerCase()!="shipping"&&this.userData.BillingAddress){if(!this.userData.BillingAddress.Country||this.userData.BillingAddress.Country&&this.userData.BillingAddress.Country.toUpperCase()=="US"&&(!this.userData.BillingAddress.State||this.userData.BillingAddress.State=="")){this.CloseAddressPopUMessage=!0;return}else if(!this.userData.BillingAddress.Country){this.CloseAddressPopUMessage=!0;return}}this.dialogRef.close()}addressPopUpOK(){this.CloseAddressPopUMessage=!1}getAllAddresses(){this.allAddData=[],this.isFullAddressLoading=!0,this._addressPopupService.getAddressBooksSelectedType(this.userData.Type.toUpperCase(),this.userData.CustomerAccountId).pipe(P(this.ngUnsubscribe)).subscribe(e=>{this.isFullAddressLoading=!1,this.allAddData=[],this.allAddData=e.AddressBookList,this.defaultAddress=e.DefaultAddress,this.defaultAddress&&this.allAddData.push(this.defaultAddress),this.allAddData=this.allAddData.filter((i,s,C)=>s===C.findIndex(A=>A.AddressOne===i.AddressOne&&A.AddressTwo===i.AddressTwo&&A.AddressThree===i.AddressThree&&A.AddressFour===i.AddressFour&&A.City===i.City&&A.StateId===i.StateId&&A.Province===i.Province&&A.CountryId===i.CountryId&&A.CountyId===i.CountyId&&A.ZipCode===i.ZipCode)),this.addresses=this.allAddData,(this.IsNewAddress||!this.isUserLoggedIn)&&this.addAddress()}),this.addressLoading=!0}searchAddress(e){if(this.isAtleast3Char=!1,this.tempAddData=[],this.searchedNotFound=!1,e.length==0)this.isAtleast3Char=!1;else if(e.length>2){if(e!=""){let i=e.toLowerCase();this.allAddData&&this.allAddData.length>0?(this.tempAddData=this.allAddData.filter(s=>s.AddressOne.toLowerCase().includes(i)),this.tempAddData&&this.tempAddData.length==0?this.searchedNotFound=!0:this.tempAddData.forEach(s=>{s.isDefault=!1,s.inUse=!1,this.defaultAddress&&s.Id==this.defaultAddress.Id&&(s.isDefault=!0),s.Id==this.userData.ContactInfo.Address.Id&&(s.inUse=!0)})):this.searchedNotFound=!0}}else this.isAtleast3Char=!0}searchFocus(){this.divWidth="final"}searchBlur(){this.divWidth="initial"}setDefaultAddress(e,i){this._addressBookService.addOrUpdateUserDefaultAddress(i,e).subscribe(s=>{this.tempAddData.forEach(C=>{C.isDefault=!1,C.Id==e&&(C.isDefault=!0)}),this.snackbar=new b(this._snackBar),this.snackbar.openSnackBar("Default address changed sucessfully...","close")})}};a(m,"\u0275fac",function(i){return new(i||m)(S(fe),S(ye),S(z),S(Se),S(ve),S(Me),S(ke))}),a(m,"\u0275cmp",W({type:m,selectors:[["app-quotation-address-book"]],viewQuery:function(i,s){if(i&1&&(I(Ee,5),I(Te,5)),i&2){let C;B(C=O())&&(s.editmodeForm=C.first),B(C=O())&&(s.searchElementRef=C.first)}},decls:20,vars:6,consts:[["editmodeForm","ngForm"],["search",""],[1,"custom-modal"],["mat-dialog-title","",1,"header"],[1,"row"],[1,"col-6","p-0"],[1,"text-xl","text-color-primary"],[1,"float-right"],[1,"close_modal",3,"click"],["role","img","aria-hidden","true",1,"mat-icon","material-icons"],["class","text-color-error text-m",4,"ngIf"],["class","spinner-wrapper",4,"ngIf"],["id","cartmodelpal1",1,"cartmodelpal1"],["class","row",4,"ngIf"],[1,"col-md-12"],[1,"text-color-error","text-m"],[1,"spinner-wrapper"],["mode","indeterminate",1,"spinner"],[1,"text-color-primary","text-l"],[1,"row","w-100","m-t-15"],[1,"custom-form"],["appearance","outline",1,"search-address"],["type","text","placeholder","Search for your address by entering a street name","aria-label","Search for your address by entering a street name","matInput","","name","autosearch1","autocomplete","new-password",3,"keyup","focus","blur","formControl"],["matSuffix",""],[1,"row","Modelviewpanelm1"],[1,"col-12","col-md-6","col-lg-4","address-card-wrapper"],["appearance","outlined","class","address-card mb10 shippingpanelk1 addAddressBlock",3,"click",4,"ngIf"],["class","col-12 col-md-6 col-lg-4 address-card-wrapper",4,"ngFor","ngForOf"],["appearance","outlined",1,"address-card","mb10","shippingpanelk1","addAddressBlock",3,"click"],[1,"regular-card"],[1,"text-center"],[1,"text-color-primary","text-l","text-center"],["appearance","outlined",1,"address-card","mb10",3,"ngClass"],[1,"row","billingaddresviewp1","address-content","text-color-primary","text-m"],[1,"col-md-12","address-content-row"],["class","mySpanDie",4,"ngIf"],[1,"address-content-row"],[4,"ngIf"],[1,"col-12","p-l-5","shippingBtns"],[1,"btnUL","p-0"],["href","javascript:void(0)","class","text-color-link-default text-m",3,"click",4,"ngIf"],[1,"mySpanDie"],["href","javascript:void(0)",1,"text-color-link-default","text-m",3,"click"],["class","text-color-link-default d-flex",3,"click",4,"ngIf"],["name","form","novalidate","",1,"w-100per"],[1,"accountpanelm1"],[1,"row","addresspaml",3,"hidden"],[1,"col-md-10"],["appearance","outline"],["matInput","","placeholder","Search for your address by entering a street name","name","autosearch","required","","type","text","requiredautocorrect","off","autocomplete","false","autocapitalize","off","spellcheck","off","type","text"],[1,"manuallyaddresspl1",3,"hidden"],[1,"text-color-link-default","text-m",3,"click"],["class","AccountViewpanelm1add custom-form",4,"ngIf"],[1,"anotherkl1",3,"hidden"],["name","searchanotheraddress",1,"text-color-link-default","text-m",3,"click"],[1,"text-color-link-default","d-flex",3,"click"],[1,"material-icons"],[1,""],[1,"AccountViewpanelm1add","custom-form"],[1,"col-md-4"],["required","","name","type",3,"valueChange","value","disabled"],["value","SHIPPING"],["name","country","required","",3,"selectionChange","ngModelChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["appearance","outline",4,"ngIf"],[1,"row","ie-display"],["matInput","","placeholder","City","name","city1","minlength","1","maxlength","50","required","",3,"keypress","ngModelChange","ngModel"],["class","col-md-4",4,"ngIf"],[1,"col-md-6"],["matInput","","placeholder","Street Address","minlength","1","maxlength","100","name","Street1","required","",3,"blur","ngModelChange","ngModel"],["matInput","","placeholder","Street Address 2","name","Street2","minlength","1","maxlength","100",3,"ngModelChange","blur","ngModel"],[1,"col-md-12","text-center"],["class","primary-button small-button","type","button","name","addressbutton",3,"click",4,"ngIf"],[3,"value"],["matInput","","placeholder","Zip / Postal Code","type","text","pattern","\\d*","minlength","5","maxlength","5","name","ZipCode","required","","onkeypress","return event.charCode >= 48 && event.charCode <= 57",3,"keypress","blur","ngModelChange","ngModel"],["matInput","","placeholder","Postal Code","type","text","pattern","[a-zA-Z0-9 -]+","minlength","3","maxlength","10","name","ZipPostalCode","required","",3,"keypress","ngModelChange","ngModel"],["required","","name","State",3,"selectionChange","ngModelChange","ngModel","disabled"],["matInput","","placeholder","State / Province / Region","name","province","maxlength","50","required","",3,"keypress","ngModelChange","ngModel"],["required","","name","county",3,"ngModelChange","ngModel"],["type","button","name","addressbutton",1,"primary-button","small-button",3,"click"],[1,"addresspa1"],["type","button","value","ok",1,"primary-button","small-button",3,"click"]],template:function(i,s){i&1&&(d(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6),c(5,"Shipping Address "),r()(),d(6,"div",5)(7,"span",7)(8,"a",8),f("click",function(){return s.closeModal()}),d(9,"mat-icon",9),c(10,"close"),r()()()()()(),h(11,De,2,0,"label",10)(12,Ve,2,0,"div",11),d(13,"div",12),h(14,Ue,13,3,"div",13),d(15,"div",4)(16,"div",14),h(17,Xe,5,2,"div",13)(18,mt,24,5,"div",13)(19,_t,6,0,"div",13),r()()()()),i&2&&(o(11),p("ngIf",s.IsExistingAddress),o(),p("ngIf",s.isFullAddressLoading),o(2),p("ngIf",!s.editMode),o(3),p("ngIf",!s.editMode),o(),p("ngIf",s.editMode),o(),p("ngIf",s.CloseAddressPopUMessage))},dependencies:[se,J,Y,$,re,de,oe,ae,ie,ee,ue,pe,me,_e,he,G,H,K,ne,ce,Ce,Pe,Ae,we,xe,X],styles:[".custom-modal[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{border-bottom:1px solid var(--div
1ider-default);height:fit-content}.custom-modal[_ngcontent-%COMP%] .spinner-wrapper[_ngcontent-%COMP%]{display:block;width:100%;height:100%;background-color:#00000040!important;position:absolute;top:0;left:0}.custom-modal[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{--mdc-circular-progress-active-indicator-color: var(--action-primary-default);height:2rem!important;width:2rem!important;position:absolute;top:50%;left:50%}.custom-modal[_ngcontent-%COMP%] .address-card-wrapper[_ngcontent-%COMP%] .address-card[_ngcontent-%COMP%]{border:1px solid var(--divider-default)}.custom-modal[_ngcontent-%COMP%] .address-card-wrapper[_ngcontent-%COMP%] .address-card[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:39px;color:#ccc;position:relative;left:-3px}.custom-modal[_ngcontent-%COMP%] .address-card-wrapper[_ngcontent-%COMP%] .regular-card[_ngcontent-%COMP%]{min-height:125px;height:100%;padding:.5rem;display:flex;flex-direction:column;justify-content:center;border-radius:5px}.custom-modal[_ngcontent-%COMP%] .address-card-wrapper[_ngcontent-%COMP%] .address-content[_ngcontent-%COMP%]{display:flex;flex-direction:column}.custom-modal[_ngcontent-%COMP%] .address-card-wrapper[_ngcontent-%COMP%] .address-content[_ngcontent-%COMP%] .address-content-row[_ngcontent-%COMP%]:first-of-type{margin-top:.5rem}.custom-modal[_ngcontent-%COMP%] .small-button[_ngcontent-%COMP%]{margin:0 auto} .custom-modal .mat-form-field-appearance-outline .mat-mdc-form-field-icon-suffix{top:8px!important;right:0!important} .cdk-overlay-pane{max-width:775px!important;margin-top:var(--notif-offset)!important;height:auto!important} #AddressAutoSearch .cdk-overlay-pane{width:auto!important;max-width:auto!important;margin-top:0!important;min-height:auto;height:auto!important} .mat-expansion-panel-header{padding:10px!important;height:40px!important;margin-top:5px;width:100%!important} .mat-mdc-card{border:1px solid #f1f1f1}.mat-expansion-panel-header[_ngcontent-%COMP%]{background:#ededed!important;font-weight:600!important}.mat-expansion-panel-spacing[_ngcontent-%COMP%]{margin:0}.p-l-5[_ngcontent-%COMP%]{padding-left:5px}.shippingBtns[_ngcontent-%COMP%]{position:absolute;bottom:0}.mat-mdc-form-field[_ngcontent-%COMP%]{display:inline-block;position:relative;text-align:left;padding-right:15px;padding-left:4px;width:100%}.mat-expansion-panel-body[_ngcontent-%COMP%]{padding:5px}hr[_ngcontent-%COMP%]{padding-top:5px!important;margin-top:0!important}.row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;margin-right:0;margin-left:0;width:100%}.shippingselectpanel[_ngcontent-%COMP%]{min-height:145px!important}.anotherkl1[_ngcontent-%COMP%]{font-family:Nunito Sans,sans-serif;font-size:10pt;text-align:left;right:0;color:#cf102d;float:left;width:100%;margin-top:10px;text-decoration:underline;margin-left:6px;height:36px} .mat-autocomplete-panel{max-width:46%!important;overflow-x:scroll!important;position:absolute!important;z-index:1000} .mat-mdc-option{font-size:10pt;font-family:Arial,sans-serif}.Modelviewpanelm1[_ngcontent-%COMP%]{width:100%!important}.w-100[_ngcontent-%COMP%]{width:100%} .pac-item{cursor:pointer!important}.manuallyaddresspl1[_ngcontent-%COMP%]{font-family:Nunito Sans,sans-serif;font-size:10pt;text-align:left;right:0;color:#cf102d;float:left;width:100%;text-decoration:underline;height:38px;padding:0 8px;margin-top:0}.col-md-5[_ngcontent-%COMP%], .col-md-8[_ngcontent-%COMP%], .col-md-10[_ngcontent-%COMP%], .col-md-6[_ngcontent-%COMP%], .col-md-4[_ngcontent-%COMP%], .col-md-12[_ngcontent-%COMP%]{padding-right:0;padding-left:0;width:100%}.cartmodelpal1[_ngcontent-%COMP%]{width:750px;overflow:auto;overflow-x:hidden;height:425px}#AddressAutoSearch[_ngcontent-%COMP%]{margin-top:-25px}.btnUL[_ngcontent-%COMP%]{list-style:none;padding-left:0;font-size:13px;margin-bottom:5px}.btnUL[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:inline}.btnUL[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#333;text-decoration:underline}.btnUL[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#ce112f;text-decoration:underline}.btnUL[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:first-child{border-right:1px dotted #ccc}.shippingpanelk1[_ngcontent-%COMP%]{margin-right:20px;margin-left:14px;min-height:145px!important}.p-0[_ngcontent-%COMP%]{padding:0}.AccountViewpanelm1add[_ngcontent-%COMP%]{margin-top:8px;width:100%}.billingaddresviewp1[_ngcontent-%COMP%]{font-size:10pt;color:#6d6d6d;font-family:Nunito Sans,sans-serif;font-weight:400;padding:5px}.mb10[_ngcontent-%COMP%]{margin-bottom:25px}.accountpanelm1[_ngcontent-%COMP%]{width:100%} .mat-form-field-appearance-outline .mat-mdc-form-field-icon-suffix{top:10px!important;right:-10px!important}.shippingselectpanel[_ngcontent-%COMP%]{background:#ffcc1e}.shippingselectpanel[_ngcontent-%COMP%], .shippingpanelk1[_ngcontent-%COMP%]{padding:5px;margin:5px}.shippingselectpanel[_ngcontent-%COMP%] .billingaddresviewp1[_ngcontent-%COMP%]{color:#000}.close_modal[_ngcontent-%COMP%]{cursor:pointer;font-size:20px;border-radius:50%;color:#212529}.address-container[_ngcontent-%COMP%] mat-dialog-container.mat-mdc-dialog-container[_ngcontent-%COMP%] .mdc-dialog__surface[_ngcontent-%COMP%]{padding:10px 10px 15px!important;overflow:hidden!important}.addAddressBlock[_ngcontent-%COMP%]{box-shadow:none;border:1px dotted #333}@media (min-width: 320px) and (max-width: 680px){ .mat-autocomplete-panel{width:95%!important}#AddressAutoSearch[_ngcontent-%COMP%]{margin:0}.cartmodelpal1[_ngcontent-%COMP%]{width:100%;min-width:100%}.shippingselectpanel[_ngcontent-%COMP%], .shippingpanelk1[_ngcontent-%COMP%]{height:auto}.mat-mdc-form-field[_ngcontent-%COMP%]{padding-right:1px}}@media (min-width: 680px) and (max-width: 1024px){ .mat-autocomplete-panel{width:auto!important}.cartmodelpal1[_ngcontent-%COMP%]{min-width:100%;height:100%}.cartmodelpal1[_ngcontent-%COMP%]{width:100%}.shippingselectpanel[_ngcontent-%COMP%], .shippingpanelk1[_ngcontent-%COMP%]{height:auto}}@media (min-width: 1025px) and (max-width: 1400px){ .mat-autocomplete-panel{width:auto!important}.cartmodelpal1[_ngcontent-%COMP%]{min-width:100%;height:500px}}.mat-icon[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:36px;width:36px;overflow:hidden}"],data:{animation:[be,le("changeDivSize",[U("initial",Q({width:"55%"})),U("final",Q({width:"75%"})),N("initial=>final",V("300ms")),N("final=>initial",V("250ms"))])]}}));let n=m;return n})();export{Zt as a};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.