1import{e as u}from"./chunk-QMQ54HP6.js";import{g as y}from"./chunk-GDB2PFOH.js";import{d as F}from"./chunk-OQ4Y2D57.js";import{a as L}from"./chunk-2L2ZYCSH.js";import{Be as v,K as C,Na as m,R as a,Vh as U,ga as g,ka as s,p as c,sa as S,v as p,wa as h}from"./chunk-ZIECK5QA.js";import{a as I,b as f}from"./chunk-3JMZ37NM.js";var l=function(i){return i.FULL="FULL",i.BASIC="BASIC",i.DEFAULT="DEFAULT",i.PREORDER="PREORDER",i}(l||{});var x=(()=>{let n=class n extends U{constructor(){super(...arguments),this.userService=h(F),this.baseStoreService=h(L),this._logger=h(y).getLogger("SipAddressService"),this.billingCountries$=this.userAddressConnector.getBillingCountries().pipe(g(1)),this.shippingCountries$=this.userAddressConnector.getShippingCountries().pipe(g(1)),this.countries$=this.userAddressConnector.getCountries().pipe(g(1))}geoInverseLocation(e,r){return this.userIdService.getUserId().pipe(s(t=>this.userAddressConnector.geoInverseLocation(t,e,r)))}hasTwInternationalBillingAddress(){return this.userService.get().pipe(p(e=>e.hasTwInternationalBillingAddress))}isDefaultAddress(e,r){return this.userService.get().pipe(p(t=>{let o=t.defaultAddress?.id===e.id,d=t.defaultBillingAddress?.id===e.id;return r===u.BILLING?d:r===u.SHIPPING?o:o||d}))}checkAddress(e){return this.userIdService.getUserId().pipe(s(r=>this.userAddressConnector.checkAddress(r,e)))}getCountries(e){return e===u.BILLING?this.billingCountries$:e===u.SHIPPING?this.shippingCountries$:this.countries$}getShippingCountries(){return this.userAddressConnector.getShippingCountries()}resolveAddressCountryName(e,r){let t=e?.country?.isocode;return!t||e.country.name?c(e):this.baseStoreService.getCurrentBaseStore().pipe(a(1),s(o=>t===o.country?.isocode?c(e):this.getCountries(r).pipe(a(1),p((d=[])=>{let A=d.find(k=>k.isocode===t);return A?f(I({},e),{country:A}):e}),C(d=>(this._logger.error("Failed to resolve a country name for address: ",JSON.stringify(d)),c(e))))))}getRegions(e){return this.userAddressConnector.getRegions(e)}getCities(e){return this.userAddressConnector.getCities(e)}getPostalCodesForCity(e,r){return this.userAddressConnector.getPostalCodesForCity(e,r)}getAddresses(e=l.DEFAULT,r){return this.userIdService.takeUserId().pipe(s(t=>this.userAddressConnector.getAll(t,e,r)))}getAddress(e,r,t){return this.userIdService.takeUserId().pipe(s(o=>this.userAddressConnector.get(o,e,r,t)))}updateUserAddress(e,r,t){return this.userIdService.takeUserId().pipe(s(o=>this.userAddressConnector.update(o,e,r,t)))}addUserAddress(e){return this.userIdService.takeUserId().pipe(s(r=>this.userAddressConnector.add(r,e)))}deleteUserAddress(e){return this.userIdService.getUserId().pipe(s(r=>this.userAddressConnector.delete(r,e)))}getLinkedPaymentInfos(e){return this.userIdService.getUserId().pipe(s(r=>this.userAddressConnector.getLinkedPaymentInfos(r,e)))}getAddressesForPage(e,r=u.SHIPPING){return this.userIdService.takeUserId().pipe(s(t=>t===v?c(null):this.userAddressConnector.getAddressesForPage(t,e,r)))}setAddressAsDefault(e,r){return this.userIdService.takeUserId().pipe(s(t=>this.userAddressConnector.update(t,e,{defaultAddress:!0},r)))}};n.\u0275fac=(()=>{let e;return function(t){return(e||(e=m(n)))(t||n)}})(),n.\u0275prov=S({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();export{l as a,x as b};
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.