///
import { OnDestroy, OnInit, ElementRef } from '@angular/core';
import { FormGroup, FormBuilder } from '@angular/forms';
import { CheckoutService } from '../services/checkout.service';
import { Router } from '@angular/router';
import { ShippingGuardCheckout } from '../checkout-guard/shippingGuard';
import { Subscription } from 'rxjs';
import { AddressingService, FacebookPixelService, LanguageService } from '../../../services';
import { Country, City, Province, Area, Cords } from '../models/countries';
import { Checkout } from '../models/checkout.modal';
import { ConfService } from '../../services/conf.service';
import { TranslatePipe } from '../../pipes/translate.pipe';
import { LoginService } from '../../services/login.service';
import { Branch } from '../../classes/ContactUs';
import * as i0 from "@angular/core";
export declare class AddressingComponent implements OnDestroy, OnInit {
private languageService;
private checkoutService;
private router;
private fb;
private shippingGuardCheckout;
private userAddressingService;
private confService;
protected translatePipe: TranslatePipe;
protected loginService: LoginService;
private fbService;
user_fname: string;
user_lname: string;
user_email: string;
user_phone: string;
isUserHasAddress: boolean;
userOldAddressData: any;
language: {};
addressingForm: FormGroup;
billingAddress: FormGroup;
showAnotherBilling: boolean;
countries: Country[];
citiesOfCountry: any;
citiesOfCountryForBilling: any;
provinces: Province[];
provincesBilling: Province[];
areas: Area[];
areasBilling: Area[];
cities: City[];
citiesForBilling: City[];
shippingData: any;
loading: boolean;
billingLoading: boolean;
orders: Checkout;
apiValidationAddressing: any;
generalError: string;
isSubmitting: boolean;
apiValidationBilling: any;
submitted: boolean;
submittedWithBilling: boolean;
isHasDifferentBillingAddress: boolean;
isSelectOldAddress: boolean;
isOldAddressChanged: boolean;
itemUnAvaliable: boolean;
isProvinceExist: string;
isProvinceExistForBilling: string;
isAreaExist: string;
isAreaExistForBilling: string;
pattern: RegExp;
email: RegExp;
addressIdThatSelected: number;
hideEmailField: boolean;
USER_EMAIL: string;
isLoggedIn: boolean;
isSaveAddress: boolean;
ADDRESS_DATA: {};
clearToggleBtnTimeOut: any;
id: number;
storeid: Subscription;
storesIds: {
prego: number;
};
showNeighborhoodContent: boolean;
HideMap: boolean;
showField: boolean;
provinceTimeOut: any;
areasTimeOut: any;
private _provinceTimeOutForBilling;
get provinceTimeOutForBilling(): any;
set provinceTimeOutForBilling(value: any);
buildingPatten: RegExp;
areaTimeOutForBilling: any;
regexEmail: RegExp;
private destroyed$;
allowConditionTerms: boolean;
isAddressingEmailRequired: boolean;
acceptTermsConditions: boolean;
isAcceptTermsConditions: boolean;
storeIdentitySubscription: Subscription;
termsAndConditionsPage: string;
separateFloorApp: boolean;
allowGeofence: boolean;
area: any;
areaCoords: Cords;
inRange: boolean;
defaultGeoLocation: {
isLocated: boolean;
location: {
lat: number;
lng: number;
};
};
branch: Branch;
pos: any;
firstNameInput: ElementRef;
fullNameInput: ElementRef;
lastNameInput: ElementRef;
emailInput: ElementRef;
phoneInput: ElementRef;
addressInput: ElementRef;
constructor(languageService: LanguageService, checkoutService: CheckoutService, router: Router, fb: FormBuilder, shippingGuardCheckout: ShippingGuardCheckout, userAddressingService: AddressingService, confService: ConfService, translatePipe: TranslatePipe, loginService: LoginService, fbService: FacebookPixelService);
ngOnInit(): void;
private stopSpinner;
createAddressingForm(separateFloorApp: any): void;
/**
* fork-mart asks for a single "Full name" instead of first + last name. The checkout API still
* expects both, so whatever is typed is mirrored into firstName and lastName and submitted in
* both. Other stores keep the two separate fields and never see this control.
*/
private fullNameSub;
get useFullNameField(): boolean;
private setupFullNameField;
/** Push the single name into both API fields. */
private applyFullName;
/** Seed the visible field when the form was filled from a saved address or the logged-in user. */
private syncFullNameFromParts;
getAreaCode(e: any): void;
onCountryChanges(): void;
checkTheDifferanceAddressIfRefresh(checkoutData: any): void;
/**
* Represents the submit state if end user type shipping address or billing address & shipping address
* @returns void
*/
onSubmit(): void;
getFirstInvalidControl(formGroup: FormGroup): ElementRef | null;
getElementRefByControlName(controlName: string): ElementRef | null;
validateAllFormFields(formGroup: FormGroup): void;
isloggedIn(userEmail: string): void;
/**
* Represents that the end user can't type any special charachters in any text input handle arabic & english
* @returns void;
*/
getUpdatedAddress(evt: any): boolean;
/**
* Represents the shippingAddressing that will be send to addressing api
* @returns void
*/
sendShippingAddressingToApi(): void;
numberOnly(event: any): boolean;
showBillingAddress(evt: any): void;
/**
* get country id using country code
* @param countryId
*/
getCountryIdByCode(countryCode: string): number;
/**
* get city id using city code
* @param countryId
*/
getCityIdByCode(cityCode: string, forBilling?: boolean): number;
/**
* reset select values in city and area
* when select the country we first check
* if the countryId is null or undefined
* @param countryCode
*/
selectCountry(countryCode: string): void;
selectCountryForBilling(countryCode: string): void;
selectCity(cityCode: string, firstTime?: boolean): number;
selectCityForBilling(cityCode: string): number;
getCities(countryId: number, firstTime?: boolean): City[];
getCitiesForBilling(countryId: number): City[];
getAreas(cityId: number, firstTime?: boolean): Area[];
/**
* Area-popup stores (fork-mart 12572, mypapers 12272): country/city/area are determined by the
* delivery-area popup, so make them read-only on the checkout addressing form. Disabling
* reactive-form controls keeps their .value accessible via controls['x'].value (which the
* checkout payload uses), so submission is unaffected.
*/
private lockForkLocation;
/**
* Area-popup stores (fork-mart 12572, mypapers 12272) present the Country/City/Area levels to the
* customer as City/Area/Sub-area, so the checkout addressing labels are relabelled accordingly.
*/
get isAreaPopupStore(): boolean;
/**
* fork-mart (12572) only: the delivery area is fixed by the City/Area popup, so the checkout map
* (GPS pin) and the "select from saved address" dropdown are hidden and the geofence requirement
* is bypassed.
*/
get isFork(): boolean;
/**
* PAUSED for fork-mart: the delivery-area popup no longer runs, so checkout must not lock the
* Governorate/City/Area selects to it - the customer picks them here like on any other store.
* The labels stay as they are; only the popup-driven behaviour is switched off.
*/
get areaPopupCheckoutEnabled(): boolean;
/**
* The city/area selects are rendered disabled by default (their values follow the country and
* city above them). Stores whose delivery area is no longer fixed by the popup let the customer
* choose, so the attribute is dropped for them.
*/
get locationSelectsDisabled(): boolean;
/** Error shown (area-popup stores) when a picked saved address isn't deliverable by the current branch. */
areaPopupAddressError: string;
get addressUnavailableMessage(): string;
/**
* Area-popup stores: apply a picked saved address to the (locked) Governorate/City/Area, validating
* against the current branch's deliverable cities/areas (v3 endpoints are branch-scoped). If the
* address' area is not in that set, the Area select is left empty and an error is shown so the order
* can't proceed to an undeliverable area.
*/
private applyAddressLocationForAreaPopup;
get isArabic(): boolean;
get governorateLabel(): string;
get cityLabel(): string;
get areaLabel(): string;
getCityAreasForBilling(cityId: number): Area[];
ngOnDestroy(): void;
/**
* Represents the selected old address that select by the end user
* @returns old address that selected by the user;
*/
getSelectAddress(addressId: any): Promise;
checkOldAddressEqualFormValues(formValues: any): void;
/**
* Represents that the end user can't write special charachter in the text field;
* @returns void;
*/
validateTextInputs(value: string, controlName: string, formName: string): void;
/**
* Represents that the end user can't write special charachter in the text field;
* @returns void;
*/
getOldAddressIfUserLoggedIn(): void;
private getCountries;
/**
* Area-popup stores (fork-mart 12572, mypapers 12272): populate and lock the Governorate/City/Area
* selects straight from the chosen branch, loading each level's options from the branch's own ids so
* every select shows the exact value the customer picked - regardless of which governorate it is.
*/
private setupAreaPopupLocation;
/**
* Represents the next step page shipping when the data sent succesffuly so the end user can access shipping
* @returns void
*/
private canAccessNextStep;
/**
* Represents that the end user can't access the shipping page
* @returns void
*/
private canNotAccessNextStep;
private sendBillingAddressToApi;
goToLogin(): void;
private isShippingAddressEqualToSelectedAddress;
updateStreet(full_user_address: any): void;
getAreaAddressString(pos: google.maps.LatLngLiteral): void;
areaCordsValue(event: any): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}