@wikicasa-dev/utilities 0.2.0 → 1.0.0
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.
- package/dist/ArrayUtils.cjs +1 -0
- package/dist/ArrayUtils.js +4 -0
- package/dist/ColorUtils.cjs +1 -0
- package/dist/ColorUtils.js +8 -0
- package/dist/CookieUtils.cjs +1 -0
- package/dist/CookieUtils.js +32 -0
- package/dist/CurrencyUtils.cjs +1 -0
- package/dist/CurrencyUtils.js +14 -0
- package/dist/DOMUtils.cjs +1 -0
- package/dist/DOMUtils.js +18 -0
- package/dist/DateUtils.cjs +1 -0
- package/dist/DateUtils.js +7 -0
- package/dist/DeviceDetectionUtils.cjs +1 -0
- package/dist/DeviceDetectionUtils.js +8 -0
- package/dist/EmailUtils.cjs +1 -0
- package/dist/EmailUtils.js +27 -0
- package/dist/FunctionUtils.cjs +1 -0
- package/dist/FunctionUtils.js +21 -0
- package/dist/GenericUtils.cjs +1 -0
- package/dist/GenericUtils.js +25 -0
- package/dist/LazyLoadingBg.cjs +1 -0
- package/dist/LazyLoadingBg.js +13 -0
- package/dist/NumberUtils.cjs +1 -0
- package/dist/NumberUtils.js +50 -0
- package/dist/ObjectUtils.cjs +1 -0
- package/dist/ObjectUtils.js +23 -0
- package/dist/ObserverUtils.cjs +1 -0
- package/dist/ObserverUtils.js +20 -0
- package/dist/PermissionUtils.cjs +1 -0
- package/dist/PermissionUtils.js +18 -0
- package/dist/RESB_UrlBuilder.cjs +1 -0
- package/dist/RESB_UrlBuilder.js +80 -0
- package/dist/StringUtils.cjs +1 -0
- package/dist/StringUtils.js +40 -0
- package/dist/URLBuilderUtils.cjs +1 -0
- package/dist/URLBuilderUtils.js +11 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +17 -34
- package/dist/index.js +62 -0
- package/dist/main.cjs +1 -0
- package/dist/vite-env.cjs +1 -0
- package/dist/vite-env.js +1 -0
- package/package.json +17 -13
- package/dist/custom/constants.d.ts +0 -2
- package/dist/custom/icons.d.ts +0 -5
- package/dist/custom/leaflet_map.d.ts +0 -99
- package/dist/services/agencyAPI.d.ts +0 -19
- package/dist/services/geographyAPI.d.ts +0 -9
- package/dist/services/insightsAPI.d.ts +0 -2
- package/dist/services/mailAPI.d.ts +0 -24
- package/dist/services/placesAPI.d.ts +0 -5
- package/dist/services/portfolioCustomerAPI.d.ts +0 -1
- package/dist/services/publicUserAPI.d.ts +0 -20
- package/dist/services/realEstateAPI.d.ts +0 -14
- package/dist/services/requestAPI.d.ts +0 -16
- package/dist/services/servicesUtils.d.ts +0 -8
- package/dist/services/statisticsAPI.d.ts +0 -9
- package/dist/services/valuationAPI.d.ts +0 -11
- package/dist/services/wikicasaPro.d.ts +0 -2
- package/dist/utilities.cjs +0 -5
- package/dist/utilities.iife.js +0 -5
- package/dist/utilities.mjs +0 -2437
- package/dist/utils/FavoriteUtils.d.ts +0 -2
- package/dist/utils/GAutocompleteUtils.d.ts +0 -6
- package/dist/utils/MapUtils.d.ts +0 -23
- package/dist/utils/RequestUtils.d.ts +0 -2
- package/dist/utils/URLPagesFactory.d.ts +0 -9
- package/index.html +0 -13
- package/src/custom/constants.ts +0 -3
- package/src/custom/icons.ts +0 -63
- package/src/custom/leaflet_map.ts +0 -946
- package/src/index.ts +0 -171
- package/src/services/agencyAPI.ts +0 -105
- package/src/services/geographyAPI.ts +0 -129
- package/src/services/insightsAPI.ts +0 -20
- package/src/services/mailAPI.ts +0 -89
- package/src/services/placesAPI.ts +0 -72
- package/src/services/portfolioCustomerAPI.ts +0 -16
- package/src/services/publicUserAPI.ts +0 -216
- package/src/services/realEstateAPI.ts +0 -133
- package/src/services/requestAPI.ts +0 -40
- package/src/services/servicesUtils.ts +0 -27
- package/src/services/statisticsAPI.ts +0 -84
- package/src/services/valuationAPI.ts +0 -45
- package/src/services/wikicasaPro.ts +0 -25
- package/src/utils/ArrayUtils.ts +0 -2
- package/src/utils/ColorUtils.ts +0 -11
- package/src/utils/CookieUtils.ts +0 -43
- package/src/utils/CurrencyUtils.ts +0 -18
- package/src/utils/DOMUtils.ts +0 -28
- package/src/utils/DateUtils.ts +0 -9
- package/src/utils/DeviceDetectionUtils.ts +0 -17
- package/src/utils/EmailUtils.ts +0 -45
- package/src/utils/FavoriteUtils.ts +0 -19
- package/src/utils/FunctionUtils.ts +0 -29
- package/src/utils/GAutocompleteUtils.ts +0 -70
- package/src/utils/GenericUtils.ts +0 -37
- package/src/utils/LazyLoadingBg.ts +0 -18
- package/src/utils/MapUtils.ts +0 -118
- package/src/utils/NumberUtils.ts +0 -90
- package/src/utils/ObjectUtils.ts +0 -34
- package/src/utils/ObserverUtils.ts +0 -32
- package/src/utils/PermissionUtils.ts +0 -41
- package/src/utils/RESB_UrlBuilder.ts +0 -99
- package/src/utils/RequestUtils.ts +0 -20
- package/src/utils/StringUtils.ts +0 -75
- package/src/utils/URLBuilderUtils.ts +0 -21
- package/src/utils/URLPagesFactory.ts +0 -20
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -38
- package/vite.config.ts +0 -42
- /package/{src/main.ts → dist/main.js} +0 -0
package/dist/main.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";console.log("Hello World");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/vite-env.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wikicasa-dev/utilities",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Wikicasa frontend utilities",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "
|
|
7
|
-
"module": "
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"import": "./dist/
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
|
-
"
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
15
18
|
"repository": {
|
|
16
19
|
"type": "git",
|
|
17
20
|
"url": "git+https://matteocarniglia@bitbucket.org/wikicasa/wikicasa-fe.git"
|
|
@@ -25,18 +28,20 @@
|
|
|
25
28
|
"devDependencies": {
|
|
26
29
|
"@types/google-polyline": "^1.0.0",
|
|
27
30
|
"@types/jquery": "^3.5.16",
|
|
28
|
-
"@types/js-cookie": "^3.0.
|
|
31
|
+
"@types/js-cookie": "^3.0.6",
|
|
32
|
+
"@types/leaflet": "^1.9.3",
|
|
29
33
|
"@types/leaflet-draw": "^1.0.7",
|
|
30
34
|
"@types/leaflet-freedraw": "^2.13.3",
|
|
31
35
|
"@types/leaflet.markercluster": "^1.5.1",
|
|
32
36
|
"@types/node": "^20.5.0",
|
|
33
37
|
"@types/uuid": "^9.0.2",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"vite
|
|
38
|
+
"glob": "^10.3.10",
|
|
39
|
+
"typescript": "^5.4.3",
|
|
40
|
+
"vite": "^5.2.3",
|
|
41
|
+
"vite-plugin-dts": "^3.7.3",
|
|
42
|
+
"@wikicasa-dev/types": "^1.0.0"
|
|
37
43
|
},
|
|
38
44
|
"dependencies": {
|
|
39
|
-
"@types/leaflet": "^1.9.3",
|
|
40
45
|
"axios": "^1.4.0",
|
|
41
46
|
"google-polyline": "^1.0.3",
|
|
42
47
|
"js-cookie": "^3.0.5",
|
|
@@ -44,8 +49,7 @@
|
|
|
44
49
|
"leaflet-control-geocoder": "^2.4.0",
|
|
45
50
|
"leaflet-draw": "^1.0.4",
|
|
46
51
|
"leaflet-freedraw": "^2.13.3",
|
|
47
|
-
"uuid": "^9.0.0"
|
|
48
|
-
"@wikicasa-dev/types": "^0.9.0"
|
|
52
|
+
"uuid": "^9.0.0"
|
|
49
53
|
},
|
|
50
54
|
"scripts": {
|
|
51
55
|
"dev": "vite",
|
package/dist/custom/icons.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="jquery" />
|
|
2
|
-
/// <reference types="jquery" />
|
|
3
|
-
export declare const SVG = "<svg viewBox=\"0 0 128 128\" class=\"icon-spin\"><circle class=\"path\" cx=\"64\" cy=\"64\" r=\"42\" fill=\"none\" stroke-width=\"9\"></circle></svg>";
|
|
4
|
-
export declare function addSpinner(btn: HTMLElement | JQuery, append?: boolean): void;
|
|
5
|
-
export declare function removeSpinner(btn: HTMLElement | JQuery): void;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/// <reference types="jquery" />
|
|
2
|
-
/// <reference types="jquery" />
|
|
3
|
-
/// <reference types="jquery" />
|
|
4
|
-
import type { LatLng, MarkerCluster, Popup, Marker, Polyline, MarkerClusterGroup, FitBoundsOptions } from "leaflet";
|
|
5
|
-
declare global {
|
|
6
|
-
interface Window {
|
|
7
|
-
_cdn: string;
|
|
8
|
-
touch: boolean;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export declare const MAX_ZOOM = 18;
|
|
12
|
-
interface LMap extends L.Map {
|
|
13
|
-
touchExtend: Record<string, any>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @author Andrea Moraglia
|
|
17
|
-
*/
|
|
18
|
-
export default class {
|
|
19
|
-
private markers;
|
|
20
|
-
private callbacks;
|
|
21
|
-
private initialized;
|
|
22
|
-
private markerClusterer;
|
|
23
|
-
private clusterHightlight;
|
|
24
|
-
private map;
|
|
25
|
-
private mapContainer;
|
|
26
|
-
private infowindow;
|
|
27
|
-
private infowindowCarousel;
|
|
28
|
-
private freeDraw;
|
|
29
|
-
private shapeLayer;
|
|
30
|
-
private config;
|
|
31
|
-
private drawHandler;
|
|
32
|
-
private spinner;
|
|
33
|
-
private buttonsWrapper;
|
|
34
|
-
private spinnerIcon;
|
|
35
|
-
private drawing;
|
|
36
|
-
private search;
|
|
37
|
-
constructor();
|
|
38
|
-
findMarker(id: number): Marker | undefined;
|
|
39
|
-
findCluster(id: number): Marker | undefined;
|
|
40
|
-
highlightCluster(cluster: MarkerCluster): void;
|
|
41
|
-
highlightMarker(id: number): void;
|
|
42
|
-
clearHighlight(): void;
|
|
43
|
-
addMarkerBulk(data: Array<Marker>, center: L.LatLng | null, limit: number, icon?: string): void;
|
|
44
|
-
addMarker(key: number | null, position: LatLng, icon?: any): void;
|
|
45
|
-
addCompleteMarker(marker: Marker): void;
|
|
46
|
-
removeMarker(id: number): void;
|
|
47
|
-
getVisibleMarkersId(): Array<number>;
|
|
48
|
-
initMarkerClusterer(): Promise<unknown>;
|
|
49
|
-
detachMarkerClusterer(): void;
|
|
50
|
-
attachMarkerClusterer(): void;
|
|
51
|
-
disableControls(): void;
|
|
52
|
-
enableControls(): void;
|
|
53
|
-
setDrawing(): void;
|
|
54
|
-
stopDrawing(): void;
|
|
55
|
-
isDrawing(): boolean;
|
|
56
|
-
initDrawingManager(): Promise<unknown>;
|
|
57
|
-
drawPolygonFromPoints(latLngs: Array<LatLng>): void;
|
|
58
|
-
deleteMarkers(): void;
|
|
59
|
-
deleteShape(): void;
|
|
60
|
-
hasShape(): boolean;
|
|
61
|
-
getShape(): Polyline;
|
|
62
|
-
getShapePoints(): Array<LatLng>;
|
|
63
|
-
initSearch(): Promise<unknown>;
|
|
64
|
-
isInitialized(): boolean;
|
|
65
|
-
getInfowindow(): Popup;
|
|
66
|
-
getInfowindowCarousel(): Popup;
|
|
67
|
-
getMap(): LMap;
|
|
68
|
-
getMapContainer(): HTMLElement;
|
|
69
|
-
getMarkers(): Map<number, Marker>;
|
|
70
|
-
getMarkersCount(): number;
|
|
71
|
-
getMarkerClusterer(): MarkerClusterGroup;
|
|
72
|
-
addListener(obj: any, event: string, fn: (args?: any) => unknown | void): void;
|
|
73
|
-
init(selector: JQuery, apiKey: string, COLORS: Record<string, string>, opts?: any, longLat?: {
|
|
74
|
-
longitude: number;
|
|
75
|
-
latitude: number;
|
|
76
|
-
} | null, zoom?: number): void;
|
|
77
|
-
load(config: any, apiKey: string, opts: any): void;
|
|
78
|
-
startSpinner(): void;
|
|
79
|
-
stopSpinner(): void;
|
|
80
|
-
ready(fn: () => unknown): void;
|
|
81
|
-
on(event: string, fn: any): void;
|
|
82
|
-
setCenter(lat: number, lng: number, zoom?: number): void;
|
|
83
|
-
setZoom(zoom: number): void;
|
|
84
|
-
getZoom(): number;
|
|
85
|
-
reset(): void;
|
|
86
|
-
fitBounds(myBounds: {
|
|
87
|
-
getNorthEast: () => LatLng;
|
|
88
|
-
getSouthWest: () => LatLng;
|
|
89
|
-
}, opts?: FitBoundsOptions): void;
|
|
90
|
-
fitZoom(myPoint: LatLng): void;
|
|
91
|
-
validateCoordinate(lat: number, lng: number): boolean;
|
|
92
|
-
getDistance(latLng: LatLng, otherLatLng: LatLng): number;
|
|
93
|
-
geocode(address: string): JQueryPromise<unknown>;
|
|
94
|
-
isMarkerInsidePolygon(coordinates: Array<number>, points: Array<LatLng>): boolean;
|
|
95
|
-
addButton(btn: JQuery): void;
|
|
96
|
-
addTouchHandler(): void;
|
|
97
|
-
}
|
|
98
|
-
export declare function getL(): any;
|
|
99
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AgencyItem, MapMarker, Contacts, Nullable } from "@wikicasa-dev/types";
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
_serializedAgencySearchBean?: Nullable<any>;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export declare const sendAgencyContactAsync: (data: Contacts) => Promise<boolean>;
|
|
8
|
-
export declare const getAgencyById: (agencyId: number, lang: string) => Promise<AgencyItem>;
|
|
9
|
-
export declare const sendMortgage: (data: {
|
|
10
|
-
name: string;
|
|
11
|
-
email: string;
|
|
12
|
-
phone: string;
|
|
13
|
-
url: string;
|
|
14
|
-
realEstateId: number;
|
|
15
|
-
price: number;
|
|
16
|
-
tenantId: number;
|
|
17
|
-
}) => Promise<boolean>;
|
|
18
|
-
export declare const getAgenciesData: (ids: Array<number>) => Promise<AgencyItem[]>;
|
|
19
|
-
export declare const getMapMarkers: () => Promise<Array<MapMarker> | undefined>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Place, GAutocompleteTypes, GooglePredictionType, GPlaceDetails, Nullable } from "@wikicasa-dev/types";
|
|
2
|
-
export declare const getPlacesAddressAutocomplete: (query: string, radius: number, types?: GAutocompleteTypes[]) => Promise<GooglePredictionType[]>;
|
|
3
|
-
export declare const getPlacesDetails: (placeId: string) => Promise<GPlaceDetails>;
|
|
4
|
-
export declare const guessPlace: (latitude?: number, longitude?: number) => Promise<Place>;
|
|
5
|
-
export declare const getPlaceFromPlaceID: (id?: Nullable<number>) => Promise<Place>;
|
|
6
|
-
export declare const getCountryPolygonJSON: (id: number) => Promise<any>;
|
|
7
|
-
export declare const getRegionPolygonJSON: (id: number) => Promise<any>;
|
|
8
|
-
export declare const getCityPolygonJSON: (id: number) => Promise<any>;
|
|
9
|
-
export declare const getProvincePolygonJSON: (id: number) => Promise<any>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type InfoPremiumPayload = {
|
|
2
|
-
name: string;
|
|
3
|
-
phone: string;
|
|
4
|
-
agency?: string;
|
|
5
|
-
agency_name?: string;
|
|
6
|
-
email: string;
|
|
7
|
-
contact_preference: number;
|
|
8
|
-
service?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const sendInfoPremium: (data: InfoPremiumPayload) => Promise<boolean>;
|
|
11
|
-
export declare const sendBrochureRequest: (data: {
|
|
12
|
-
email: string;
|
|
13
|
-
}) => Promise<boolean>;
|
|
14
|
-
export declare const sendJobApplicationForm: (data: FormData) => Promise<boolean>;
|
|
15
|
-
export declare const sendBrochureMR: (data: {
|
|
16
|
-
email: string;
|
|
17
|
-
}) => Promise<boolean>;
|
|
18
|
-
export declare const sendInfoMR: (data: {
|
|
19
|
-
phone: string;
|
|
20
|
-
email: string;
|
|
21
|
-
agency: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
}) => Promise<boolean>;
|
|
24
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PLACE_TYPE, Place } from "@wikicasa-dev/types";
|
|
2
|
-
export declare const getPlacesByQuery: (value: string, placeType?: PLACE_TYPE[], provinceId?: number | string | null) => Promise<Place[]>;
|
|
3
|
-
export declare function getPlace(query: string, types?: string): Promise<Array<Place>>;
|
|
4
|
-
export declare function getZones(cityID: number): Promise<Array<Place>>;
|
|
5
|
-
export declare const getDistrictsByZoneId: (zoneID: number) => Promise<Place[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const updateNewsletterConsent: (email: string) => Promise<boolean>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { PublicUser, PublicUserMenuInfo, SaveSearchBean } from "@wikicasa-dev/types";
|
|
2
|
-
export declare const getMenuInfo: () => Promise<PublicUserMenuInfo>;
|
|
3
|
-
export declare const getPublicUser: () => Promise<PublicUser>;
|
|
4
|
-
export declare const getMarketingConsent: (email: string) => Promise<boolean>;
|
|
5
|
-
export declare const deleteAllSaveSearch: () => Promise<number>;
|
|
6
|
-
export declare const deleteSaveSearch: (id: number) => Promise<string>;
|
|
7
|
-
export declare const getFavourites: () => Promise<number[]>;
|
|
8
|
-
export declare const addUserFavorite: (id: number) => Promise<boolean>;
|
|
9
|
-
export declare const deleteUserFavorite: (id: number) => Promise<boolean>;
|
|
10
|
-
export declare const updateNote: (id: number, note: string | null) => Promise<boolean>;
|
|
11
|
-
export declare const removeFavourites: () => Promise<boolean>;
|
|
12
|
-
export declare const saveUserFirebaseToken: (firebaseToken: string) => Promise<boolean>;
|
|
13
|
-
export declare const deleteUserFirebaseToken: (firebaseToken: string) => Promise<boolean>;
|
|
14
|
-
export declare const updateMarketingConsent: (data: {
|
|
15
|
-
email: string;
|
|
16
|
-
marketingConsent: boolean;
|
|
17
|
-
}) => Promise<boolean>;
|
|
18
|
-
export declare const getPublicUserSaveSearchList: (offset?: number, limit?: number) => Promise<Array<any>>;
|
|
19
|
-
export declare const updatePublicUserSavedSearchBean: (savedSearchBean: SaveSearchBean) => Promise<SaveSearchBean>;
|
|
20
|
-
export declare const getSavedSearchesCount: () => Promise<number>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AxiosResponse } from "axios";
|
|
2
|
-
import type { RealEstateSearchBean, MapMarker, RealEstateMiniItem, Nullable } from "@wikicasa-dev/types";
|
|
3
|
-
declare global {
|
|
4
|
-
interface Window {
|
|
5
|
-
_serializedSearchBean?: Nullable<any>;
|
|
6
|
-
_locale: string;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export declare const getRealEstateNotes: (realEstateId: number) => Promise<string>;
|
|
10
|
-
export declare const saveSearch: (email: string, title: string, hourly: boolean, resb: RealEstateSearchBean, pushNotifications?: boolean) => Promise<AxiosResponse>;
|
|
11
|
-
export declare const saveSearchFromRequest: (email: string, searchBean: RealEstateSearchBean, pushNotifications?: boolean) => Promise<boolean>;
|
|
12
|
-
export declare const getRealEstateCounter: (resb: RealEstateSearchBean) => Promise<number | null>;
|
|
13
|
-
export declare const getRealEstatesData: (ids: Array<number>) => Promise<Array<RealEstateMiniItem> | null>;
|
|
14
|
-
export declare const getMapMarkers: () => Promise<Array<MapMarker> | undefined>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Contacts } from "@wikicasa-dev/types";
|
|
2
|
-
export declare const sendSuggestion: (suggestion: {
|
|
3
|
-
argument: string;
|
|
4
|
-
email: string;
|
|
5
|
-
message: string;
|
|
6
|
-
privacy: boolean;
|
|
7
|
-
url: string;
|
|
8
|
-
}) => Promise<boolean>;
|
|
9
|
-
export declare const addGenericRequest: (data: Contacts) => Promise<boolean>;
|
|
10
|
-
export declare const sendWidgetRequest: (suggestion: {
|
|
11
|
-
name: string;
|
|
12
|
-
company: string;
|
|
13
|
-
email: string;
|
|
14
|
-
phone: string;
|
|
15
|
-
privacy: boolean;
|
|
16
|
-
}) => Promise<boolean>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Place, GraphData } from "@wikicasa-dev/types";
|
|
2
|
-
export declare const updateViewListing: (data: Array<{
|
|
3
|
-
agencyId: number;
|
|
4
|
-
realEstateId: number;
|
|
5
|
-
}>) => Promise<boolean>;
|
|
6
|
-
export declare const updateRealEstateSearch: (realEstateSearchBean: any) => Promise<boolean>;
|
|
7
|
-
export declare const updatePhoneView: (agencyId: number, id: number) => Promise<boolean>;
|
|
8
|
-
export declare const getPlaceTrendData: (place: Place) => Promise<any>;
|
|
9
|
-
export declare const getSaleGraphData: (place: Place, filters?: any) => Promise<GraphData[]>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { PublicValuation, Nullable } from "@wikicasa-dev/types";
|
|
2
|
-
export interface ValuationResult extends Record<string, number | boolean | undefined> {
|
|
3
|
-
valid: boolean;
|
|
4
|
-
upper: number;
|
|
5
|
-
mean: number;
|
|
6
|
-
lower: number;
|
|
7
|
-
estimated: number;
|
|
8
|
-
count: number;
|
|
9
|
-
maxDistance?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const evaluateRealEstateWidget: (publicValuation: PublicValuation, token: Nullable<string>, conditionTypeId?: number | undefined, floor?: number | undefined) => Promise<PublicValuation>;
|
package/dist/utilities.cjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=window._baseURLIt,h=e=>{const t=`errorMessage: ${e.message}
|
|
2
|
-
`;e.response?console.error(`${t} errorCode: ${e.response.status} \\n ${e.request.data}`):e.request?console.error(`${t}
|
|
3
|
-
${e.request}`):console.error(t)};function ve(e,t){return function(){return e.apply(t,arguments)}}const{toString:gt}=Object.prototype,{getPrototypeOf:ye}=Object,X=(e=>t=>{const r=gt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),$=e=>(e=e.toLowerCase(),t=>X(t)===e),Z=e=>t=>typeof t===e,{isArray:D}=Array,_=Z("undefined");function wt(e){return e!==null&&!_(e)&&e.constructor!==null&&!_(e.constructor)&&A(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _e=$("ArrayBuffer");function bt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_e(e.buffer),t}const St=Z("string"),A=Z("function"),Be=Z("number"),Y=e=>e!==null&&typeof e=="object",Et=e=>e===!0||e===!1,V=e=>{if(X(e)!=="object")return!1;const t=ye(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Rt=$("Date"),At=$("File"),Ot=$("Blob"),Pt=$("FileList"),$t=e=>Y(e)&&A(e.pipe),Ct=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||A(e.append)&&((t=X(e))==="formdata"||t==="object"&&A(e.toString)&&e.toString()==="[object FormData]"))},Tt=$("URLSearchParams"),Nt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function k(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),D(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let c;for(n=0;n<a;n++)c=o[n],t.call(null,e[c],c,e)}}function ke(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const Me=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),je=e=>!_(e)&&e!==Me;function le(){const{caseless:e}=je(this)&&this||{},t={},r=(n,s)=>{const o=e&&ke(t,s)||s;V(t[o])&&V(n)?t[o]=le(t[o],n):V(n)?t[o]=le({},n):D(n)?t[o]=n.slice():t[o]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&k(arguments[n],r);return t}const Ut=(e,t,r,{allOwnKeys:n}={})=>(k(t,(s,o)=>{r&&A(s)?e[o]=ve(s,r):e[o]=s},{allOwnKeys:n}),e),Ft=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Lt=(e,t,r,n)=>{let s,o,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!n||n(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=r!==!1&&ye(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Dt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},It=e=>{if(!e)return null;if(D(e))return e;let t=e.length;if(!Be(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},vt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ye(Uint8Array)),_t=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Bt=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},kt=$("HTMLFormElement"),Mt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Ae=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),jt=$("RegExp"),qe=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};k(r,(s,o)=>{t(s,o,e)!==!1&&(n[o]=s)}),Object.defineProperties(e,n)},qt=e=>{qe(e,(t,r)=>{if(A(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(A(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},zt=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return D(e)?n(e):n(String(e).split(t)),r},Ht=()=>{},Jt=(e,t)=>(e=+e,Number.isFinite(e)?e:t),oe="abcdefghijklmnopqrstuvwxyz",Oe="0123456789",ze={DIGIT:Oe,ALPHA:oe,ALPHA_DIGIT:oe+oe.toUpperCase()+Oe},Vt=(e=16,t=ze.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Wt(e){return!!(e&&A(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Gt=e=>{const t=new Array(10),r=(n,s)=>{if(Y(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[s]=n;const o=D(n)?[]:{};return k(n,(a,c)=>{const d=r(a,s+1);!_(d)&&(o[c]=d)}),t[s]=void 0,o}}return n};return r(e,0)},Kt=$("AsyncFunction"),Qt=e=>e&&(Y(e)||A(e))&&A(e.then)&&A(e.catch),i={isArray:D,isArrayBuffer:_e,isBuffer:wt,isFormData:Ct,isArrayBufferView:bt,isString:St,isNumber:Be,isBoolean:Et,isObject:Y,isPlainObject:V,isUndefined:_,isDate:Rt,isFile:At,isBlob:Ot,isRegExp:jt,isFunction:A,isStream:$t,isURLSearchParams:Tt,isTypedArray:vt,isFileList:Pt,forEach:k,merge:le,extend:Ut,trim:Nt,stripBOM:Ft,inherits:xt,toFlatObject:Lt,kindOf:X,kindOfTest:$,endsWith:Dt,toArray:It,forEachEntry:_t,matchAll:Bt,isHTMLForm:kt,hasOwnProperty:Ae,hasOwnProp:Ae,reduceDescriptors:qe,freezeMethods:qt,toObjectSet:zt,toCamelCase:Mt,noop:Ht,toFiniteNumber:Jt,findKey:ke,global:Me,isContextDefined:je,ALPHABET:ze,generateString:Vt,isSpecCompliantForm:Wt,toJSONObject:Gt,isAsyncFn:Kt,isThenable:Qt};function g(e,t,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s)}i.inherits(g,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:i.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const He=g.prototype,Je={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Je[e]={value:e}});Object.defineProperties(g,Je);Object.defineProperty(He,"isAxiosError",{value:!0});g.from=(e,t,r,n,s,o)=>{const a=Object.create(He);return i.toFlatObject(e,a,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),g.call(a,e.message,t,r,n,s),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const Xt=null;function de(e){return i.isPlainObject(e)||i.isArray(e)}function Ve(e){return i.endsWith(e,"[]")?e.slice(0,-2):e}function Pe(e,t,r){return e?e.concat(t).map(function(s,o){return s=Ve(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function Zt(e){return i.isArray(e)&&!e.some(de)}const Yt=i.toFlatObject(i,{},null,function(t){return/^is[A-Z]/.test(t)});function ee(e,t,r){if(!i.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=i.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,C){return!i.isUndefined(C[y])});const n=r.metaTokens,s=r.visitor||l,o=r.dots,a=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&i.isSpecCompliantForm(t);if(!i.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(i.isDate(p))return p.toISOString();if(!d&&i.isBlob(p))throw new g("Blob is not supported. Use a Buffer instead.");return i.isArrayBuffer(p)||i.isTypedArray(p)?d&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,y,C){let O=p;if(p&&!C&&typeof p=="object"){if(i.endsWith(y,"{}"))y=n?y:y.slice(0,-2),p=JSON.stringify(p);else if(i.isArray(p)&&Zt(p)||(i.isFileList(p)||i.endsWith(y,"[]"))&&(O=i.toArray(p)))return y=Ve(y),O.forEach(function(z,yt){!(i.isUndefined(z)||z===null)&&t.append(a===!0?Pe([y],yt,o):a===null?y:y+"[]",u(z))}),!1}return de(p)?!0:(t.append(Pe(C,y,o),u(p)),!1)}const m=[],S=Object.assign(Yt,{defaultVisitor:l,convertValue:u,isVisitable:de});function w(p,y){if(!i.isUndefined(p)){if(m.indexOf(p)!==-1)throw Error("Circular reference detected in "+y.join("."));m.push(p),i.forEach(p,function(O,F){(!(i.isUndefined(O)||O===null)&&s.call(t,O,i.isString(F)?F.trim():F,y,S))===!0&&w(O,y?y.concat(F):[F])}),m.pop()}}if(!i.isObject(e))throw new TypeError("data must be an object");return w(e),t}function $e(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function ge(e,t){this._pairs=[],e&&ee(e,this,t)}const We=ge.prototype;We.append=function(t,r){this._pairs.push([t,r])};We.toString=function(t){const r=t?function(n){return t.call(this,n,$e)}:$e;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function er(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ge(e,t,r){if(!t)return e;const n=r&&r.encode||er,s=r&&r.serialize;let o;if(s?o=s(t,r):o=i.isURLSearchParams(t)?t.toString():new ge(t,r).toString(n),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class tr{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){i.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ce=tr,Ke={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rr=typeof URLSearchParams<"u"?URLSearchParams:ge,nr=typeof FormData<"u"?FormData:null,sr=typeof Blob<"u"?Blob:null,or=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),ar=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),P={isBrowser:!0,classes:{URLSearchParams:rr,FormData:nr,Blob:sr},isStandardBrowserEnv:or,isStandardBrowserWebWorkerEnv:ar,protocols:["http","https","file","blob","url","data"]};function ir(e,t){return ee(e,new P.classes.URLSearchParams,Object.assign({visitor:function(r,n,s,o){return P.isNode&&i.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function cr(e){return i.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ur(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function Qe(e){function t(r,n,s,o){let a=r[o++];const c=Number.isFinite(+a),d=o>=r.length;return a=!a&&i.isArray(s)?s.length:a,d?(i.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!c):((!s[a]||!i.isObject(s[a]))&&(s[a]=[]),t(r,n,s[a],o)&&i.isArray(s[a])&&(s[a]=ur(s[a])),!c)}if(i.isFormData(e)&&i.isFunction(e.entries)){const r={};return i.forEachEntry(e,(n,s)=>{t(cr(n),s,r,0)}),r}return null}const lr={"Content-Type":void 0};function dr(e,t,r){if(i.isString(e))try{return(t||JSON.parse)(e),i.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const te={transitional:Ke,adapter:["xhr","http"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=i.isObject(t);if(o&&i.isHTMLForm(t)&&(t=new FormData(t)),i.isFormData(t))return s&&s?JSON.stringify(Qe(t)):t;if(i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t))return t;if(i.isArrayBufferView(t))return t.buffer;if(i.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return ir(t,this.formSerializer).toString();if((c=i.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return ee(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),dr(t)):t}],transformResponse:[function(t){const r=this.transitional||te.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(t&&i.isString(t)&&(n&&!this.responseType||s)){const a=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?g.from(c,g.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:P.classes.FormData,Blob:P.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],function(t){te.headers[t]={}});i.forEach(["post","put","patch"],function(t){te.headers[t]=i.merge(lr)});const we=te,fr=i.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pr=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
4
|
-
`).forEach(function(a){s=a.indexOf(":"),r=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!r||t[r]&&fr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Te=Symbol("internals");function I(e){return e&&String(e).trim().toLowerCase()}function W(e){return e===!1||e==null?e:i.isArray(e)?e.map(W):String(e)}function hr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const mr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ae(e,t,r,n,s){if(i.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!i.isString(t)){if(i.isString(n))return t.indexOf(n)!==-1;if(i.isRegExp(n))return n.test(t)}}function yr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function gr(e,t){const r=i.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,o,a){return this[n].call(this,t,s,o,a)},configurable:!0})})}class re{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(c,d,u){const l=I(d);if(!l)throw new Error("header name must be a non-empty string");const m=i.findKey(s,l);(!m||s[m]===void 0||u===!0||u===void 0&&s[m]!==!1)&&(s[m||d]=W(c))}const a=(c,d)=>i.forEach(c,(u,l)=>o(u,l,d));return i.isPlainObject(t)||t instanceof this.constructor?a(t,r):i.isString(t)&&(t=t.trim())&&!mr(t)?a(pr(t),r):t!=null&&o(r,t,n),this}get(t,r){if(t=I(t),t){const n=i.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return hr(s);if(i.isFunction(r))return r.call(this,s,n);if(i.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=I(t),t){const n=i.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ae(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(a){if(a=I(a),a){const c=i.findKey(n,a);c&&(!r||ae(n,n[c],c,r))&&(delete n[c],s=!0)}}return i.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||ae(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return i.forEach(this,(s,o)=>{const a=i.findKey(n,o);if(a){r[a]=W(s),delete r[o];return}const c=t?yr(o):String(o).trim();c!==o&&delete r[o],r[c]=W(s),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return i.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&i.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
5
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[Te]=this[Te]={accessors:{}}).accessors,s=this.prototype;function o(a){const c=I(a);n[c]||(gr(s,a),n[c]=!0)}return i.isArray(t)?t.forEach(o):o(t),this}}re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);i.freezeMethods(re.prototype);i.freezeMethods(re);const T=re;function ie(e,t){const r=this||we,n=t||r,s=T.from(n.headers);let o=n.data;return i.forEach(e,function(c){o=c.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Xe(e){return!!(e&&e.__CANCEL__)}function M(e,t,r){g.call(this,e??"canceled",g.ERR_CANCELED,t,r),this.name="CanceledError"}i.inherits(M,g,{__CANCEL__:!0});function wr(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new g("Request failed with status code "+r.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const br=P.isStandardBrowserEnv?function(){return{write:function(r,n,s,o,a,c){const d=[];d.push(r+"="+encodeURIComponent(n)),i.isNumber(s)&&d.push("expires="+new Date(s).toGMTString()),i.isString(o)&&d.push("path="+o),i.isString(a)&&d.push("domain="+a),c===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Sr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Er(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Ze(e,t){return e&&!Sr(t)?Er(e,t):t}const Rr=P.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function s(o){let a=o;return t&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=s(window.location.href),function(a){const c=i.isString(a)?s(a):a;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}();function Ar(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Or(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(d){const u=Date.now(),l=n[o];a||(a=u),r[s]=d,n[s]=u;let m=o,S=0;for(;m!==s;)S+=r[m++],m=m%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-a<t)return;const w=l&&u-l;return w?Math.round(S*1e3/w):void 0}}function Ne(e,t){let r=0;const n=Or(50,250);return s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,c=o-r,d=n(c),u=o<=a;r=o;const l={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:d||void 0,estimated:d&&a&&u?(a-o)/d:void 0,event:s};l[t?"download":"upload"]=!0,e(l)}}const Pr=typeof XMLHttpRequest<"u",$r=Pr&&function(e){return new Promise(function(r,n){let s=e.data;const o=T.from(e.headers).normalize(),a=e.responseType;let c;function d(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}i.isFormData(s)&&(P.isStandardBrowserEnv||P.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const w=e.auth.username||"",p=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(w+":"+p))}const l=Ze(e.baseURL,e.url);u.open(e.method.toUpperCase(),Ge(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function m(){if(!u)return;const w=T.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),y={data:!a||a==="text"||a==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:w,config:e,request:u};wr(function(O){r(O),d()},function(O){n(O),d()},y),u=null}if("onloadend"in u?u.onloadend=m:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(m)},u.onabort=function(){u&&(n(new g("Request aborted",g.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new g("Network Error",g.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const y=e.transitional||Ke;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),n(new g(p,y.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,e,u)),u=null},P.isStandardBrowserEnv){const w=(e.withCredentials||Rr(l))&&e.xsrfCookieName&&br.read(e.xsrfCookieName);w&&o.set(e.xsrfHeaderName,w)}s===void 0&&o.setContentType(null),"setRequestHeader"in u&&i.forEach(o.toJSON(),function(p,y){u.setRequestHeader(y,p)}),i.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&a!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",Ne(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Ne(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=w=>{u&&(n(!w||w.type?new M(null,e,u):w),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const S=Ar(l);if(S&&P.protocols.indexOf(S)===-1){n(new g("Unsupported protocol "+S+":",g.ERR_BAD_REQUEST,e));return}u.send(s||null)})},G={http:Xt,xhr:$r};i.forEach(G,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Cr={getAdapter:e=>{e=i.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let s=0;s<t&&(r=e[s],!(n=i.isString(r)?G[r.toLowerCase()]:r));s++);if(!n)throw n===!1?new g(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(i.hasOwnProp(G,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`);if(!i.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:G};function ce(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new M(null,e)}function Ue(e){return ce(e),e.headers=T.from(e.headers),e.data=ie.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Cr.getAdapter(e.adapter||we.adapter)(e).then(function(n){return ce(e),n.data=ie.call(e,e.transformResponse,n),n.headers=T.from(n.headers),n},function(n){return Xe(n)||(ce(e),n&&n.response&&(n.response.data=ie.call(e,e.transformResponse,n.response),n.response.headers=T.from(n.response.headers))),Promise.reject(n)})}const Fe=e=>e instanceof T?e.toJSON():e;function x(e,t){t=t||{};const r={};function n(u,l,m){return i.isPlainObject(u)&&i.isPlainObject(l)?i.merge.call({caseless:m},u,l):i.isPlainObject(l)?i.merge({},l):i.isArray(l)?l.slice():l}function s(u,l,m){if(i.isUndefined(l)){if(!i.isUndefined(u))return n(void 0,u,m)}else return n(u,l,m)}function o(u,l){if(!i.isUndefined(l))return n(void 0,l)}function a(u,l){if(i.isUndefined(l)){if(!i.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function c(u,l,m){if(m in t)return n(u,l);if(m in e)return n(void 0,u)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(u,l)=>s(Fe(u),Fe(l),!0)};return i.forEach(Object.keys(Object.assign({},e,t)),function(l){const m=d[l]||s,S=m(e[l],t[l],l);i.isUndefined(S)&&m!==c||(r[l]=S)}),r}const Ye="1.4.0",be={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{be[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const xe={};be.transitional=function(t,r,n){function s(o,a){return"[Axios v"+Ye+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,c)=>{if(t===!1)throw new g(s(a," has been removed"+(r?" in "+r:"")),g.ERR_DEPRECATED);return r&&!xe[a]&&(xe[a]=!0,console.warn(s(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,a,c):!0}};function Tr(e,t,r){if(typeof e!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],a=t[o];if(a){const c=e[o],d=c===void 0||a(c,o,e);if(d!==!0)throw new g("option "+o+" must be "+d,g.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new g("Unknown option "+o,g.ERR_BAD_OPTION)}}const fe={assertOptions:Tr,validators:be},N=fe.validators;class Q{constructor(t){this.defaults=t,this.interceptors={request:new Ce,response:new Ce}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=x(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&fe.assertOptions(n,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(i.isFunction(s)?r.paramsSerializer={serialize:s}:fe.assertOptions(s,{encode:N.function,serialize:N.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a;a=o&&i.merge(o.common,o[r.method]),a&&i.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),r.headers=T.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(d=d&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,m=0,S;if(!d){const p=[Ue.bind(this),void 0];for(p.unshift.apply(p,c),p.push.apply(p,u),S=p.length,l=Promise.resolve(r);m<S;)l=l.then(p[m++],p[m++]);return l}S=c.length;let w=r;for(m=0;m<S;){const p=c[m++],y=c[m++];try{w=p(w)}catch(C){y.call(this,C);break}}try{l=Ue.call(this,w)}catch(p){return Promise.reject(p)}for(m=0,S=u.length;m<S;)l=l.then(u[m++],u[m++]);return l}getUri(t){t=x(this.defaults,t);const r=Ze(t.baseURL,t.url);return Ge(r,t.params,t.paramsSerializer)}}i.forEach(["delete","get","head","options"],function(t){Q.prototype[t]=function(r,n){return this.request(x(n||{},{method:t,url:r,data:(n||{}).data}))}});i.forEach(["post","put","patch"],function(t){function r(n){return function(o,a,c){return this.request(x(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}Q.prototype[t]=r(),Q.prototype[t+"Form"]=r(!0)});const K=Q;class Se{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(c=>{n.subscribe(c),o=c}).then(s);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,c){n.reason||(n.reason=new M(o,a,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new Se(function(s){t=s}),cancel:t}}}const Nr=Se;function Ur(e){return function(r){return e.apply(null,r)}}function Fr(e){return i.isObject(e)&&e.isAxiosError===!0}const pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pe).forEach(([e,t])=>{pe[t]=e});const xr=pe;function et(e){const t=new K(e),r=ve(K.prototype.request,t);return i.extend(r,K.prototype,t,{allOwnKeys:!0}),i.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return et(x(e,s))},r}const b=et(we);b.Axios=K;b.CanceledError=M;b.CancelToken=Nr;b.isCancel=Xe;b.VERSION=Ye;b.toFormData=ee;b.AxiosError=g;b.Cancel=b.CanceledError;b.all=function(t){return Promise.all(t)};b.spread=Ur;b.isAxiosError=Fr;b.mergeConfig=x;b.AxiosHeaders=T;b.formToJSON=e=>Qe(i.isHTMLForm(e)?new FormData(e):e);b.HttpStatusCode=xr;b.default=b;const f=b;function tt(e,t){if(e)for(const r in e)t[r]=e[r]}function Lr(e){return!e||!Object.keys(e).length}function Ee(e){if(!e)return null;for(const t in e){const r=e[t];if(r&&(Array.isArray(r)||Object.keys(r).length>0))return JSON.parse(JSON.stringify(e))}return{...e}}const rt=`${B}/rest/agency`,Dr=async e=>{try{return(await f.post(`${rt}/agencyContacts`,e)).data}catch(t){throw h(t),t}},Ir=async(e,t)=>{try{return(await f.get(`/rest/agency/getAgencyByIDLang/${e}/${t}`)).data}catch(r){throw h(r),r}},vr=async e=>{try{return(await f.post("/rest/agency/sendMutuo",e)).data}catch(t){throw h(t),t}},_r=async e=>{try{return(await f.post(`${rt}/getAgencyListForInfoWindow`,e)).data}catch(t){throw h(t),t}};let H;const Br=new Uint8Array(16);function kr(){if(!H&&(H=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!H))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return H(Br)}const E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function Mr(e,t=0){return(E[e[t+0]]+E[e[t+1]]+E[e[t+2]]+E[e[t+3]]+"-"+E[e[t+4]]+E[e[t+5]]+"-"+E[e[t+6]]+E[e[t+7]]+"-"+E[e[t+8]]+E[e[t+9]]+"-"+E[e[t+10]]+E[e[t+11]]+E[e[t+12]]+E[e[t+13]]+E[e[t+14]]+E[e[t+15]]).toLowerCase()}const jr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Le={randomUUID:jr};function nt(e,t,r){if(Le.randomUUID&&!t&&!e)return Le.randomUUID();e=e||{};const n=e.random||(e.rng||kr)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let s=0;s<16;++s)t[r+s]=n[s];return t}return Mr(n)}const j=(e,t={})=>{if(Object.keys(t).length===0)throw"The params object can't be empty";const r=new URL(e);for(const n in t)r.searchParams.append(n,`${t[n]}`);return r},U=`${B}/rest/geography`;let v=nt();const qr=async(e,t,r=[])=>{v||(v=nt());const n=new URL(`${U}/placesAddressAutocomplete`),s=r.length,o=r.reduce((d,u,l)=>s===1?u:l===s-1?d:d+=`${u}|`,""),a=j(n,{query:e,radius:t,sessionToken:v,types:o}),c=await f.get(a.toString());if(c.data.status!=="OK")throw new Error("There was an error in the request");return c.data.predictions},st=async e=>{const t=new URL(`${U}/getPlacesDetails`),r=j(t,{placeId:e,sessionToken:v}),n=await f.get(r.toString());if(v="",n.data.status!=="OK")throw new Error("There was an error in the request");return n.data.result},ot=async(e,t)=>{const r=new URL(`${U}/guessCityPlace/${e}/${t}`);return(await f.get(r.toString())).data},zr=async e=>{if(e==null)throw new Error("The id can't be null");return(await f.get(`${U}/getPlaceFromPlaceID/${e}`)).data},Hr=async e=>{try{return(await f.get(`${U}/getCountryPolygonJson/${e}`)).data}catch(t){throw h(t),t}},Jr=async e=>{try{return(await f.get(`${U}/getRegionPolygonJson/${e}`)).data}catch(t){throw h(t),t}},Vr=async e=>{try{return(await f.get(`${U}/getCityPolygonJson/${e}`)).data}catch(t){throw h(t),t}},Wr=async e=>{try{return(await f.get(`${U}/getProvincePolygonJson/${e}`)).data}catch(t){throw h(t),t}},Gr="/rest/insights",Kr=async e=>{try{return(await f.post(`${Gr}/getTransactionsGraphData`,e)).data}catch(t){throw h(t),t}},q=`${B}/rest/mail`,Qr=async e=>{try{return(await f.post(`${q}/infoPremium`,e)).data}catch(t){throw h(t),t}},Xr=async e=>{try{return(await f.post(`${q}/sendBrochurePremium`,e)).data}catch(t){throw h(t),t}},Zr=async e=>{try{return(await f.post(`${q}/submitJobApplication`,e,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(t){throw h(t),t}},Yr=async e=>{try{return(await f.post(`${q}/sendBrochureMR`,e)).data}catch(t){throw h(t),t}},en=async e=>{try{return(await f.post(`${q}/infoMR`,e)).data}catch(t){throw h(t),t}},tn=window._baseURLIt,ne="/ws",rn=async(e,t=[],r="")=>{try{return r||(r=""),(await f.get(`${ne}/places?query=${e}&type=${t.join(",")}${r?`&provinceID=${r}`:""}`)).data}catch(n){throw h(n),n}};function nn(e,t="C,P,Z,L,I,R,A"){return new Promise(r=>{f.get(`${ne}/places?query=${e}&type=${t}`).then(n=>{n!=null&&n.data||r([]),r(n==null?void 0:n.data)})})}function sn(e){return new Promise(t=>{f.get(`${ne}/zones?cityID=${e}`).then(r=>{if(!(r!=null&&r.data)){t([]);return}t(r==null?void 0:r.data)})})}const on=async e=>{try{return(await f.get(j(new URL(`${tn}${ne}/districts`),{zoneID:e}).toString())).data}catch(t){throw h(t),t}},an=async e=>{try{return(await f.post(`/rest/portfolioCustomer/updateNewsletterConsent/?email=${e}`)).data}catch(t){throw h(t),t}};var he=(e=>(e[e.SELLING=0]="SELLING",e[e.SALE=1]="SALE",e[e.RENT=2]="RENT",e[e.AUCTION=3]="AUCTION",e))(he||{});const De={priceFrom:"PrezzoMinimo",priceTo:"PrezzoMassimo",sqMfrom:"SuperficieMinima",sqMto:"SuperficieMassima",roomsFrom:"NumeroMinimoLocali",roomsTo:"NumeroMassimoLocali",bathroomsFrom:"NumeroMinimoBagni",bathroomsTo:"NumeroMassimoBagni",conditionType:"StatoImmobile",energyClassFilter:"ClasseEnergetica",floor:"Piano",excludeAuctions:"EscludiAste",shortRentOnly:"SoloAffittiBrevi",excludeBareOwnership:"EscludiNudaProprieta",onlyPublicUser:"DaPrivato",balcony:"Balcone",terrace:"Terrazzo",balconyTerrace:"BalconeTerrazzo",boxCarSpot:"BoxPostoAuto",carSpot:"PostoAuto",box:"Box",lift:"Ascensore",privateGarden:"GiardinoPrivato",publicGarden:"GiardinoPubblico",cellar:"Cantina",airConditioning:"AriaCondizionata",furnished:"Arredato",publicTransport:"Trasporti",school:"Istruzione",market:"Supermercati",hospital:"Ospedali",pharmacy:"Farmacie",charging:"Ricarica",post:"UfficioPostale",bank:"Banche",swimmingPoolPrivate:"PiscinaPrivata",swimmingPoolPublic:"PiscinaCondominiale",luxury:"Lusso",discounted:"Sconto",filterOrderId:"Ordinamento"},ue={sale:"Vendita",rent:"Affitto",auctionType:"Asta",bareOwnershipType:"NudaProprieta",typologyIdList:"Tipologia",filterOrderId:"Ordinamento"};function cn(){return{sale:!0,rent:!1,contractType:window._contractDefault,excludeAuctions:!1,shortRentOnly:!1,excludeBareOwnership:!1,macroTypologyId:window._macroTypologyDefault,listingTypologyId:0,listingTypologyURL:window._listingTypologyURLDefault,listingTypologyIdList:[0],typologyIdList:window._typologyIdListDefault,onlyVisible:!0,subscriptionTypes:window._subscriptionTypesDefault}}function un(){return{active:!0,hourly:!1,latitude:0,longitude:0,saveSearchParameterId:null,searchBean:cn(),title:""}}const ln=window._baseURLIt,R=`${ln}/rest/publicUser`,dn=async()=>{try{return(await f.get(`${R}/getMenuInfo`)).data}catch(e){throw h(e),null}},fn=async()=>{try{return(await f.get(`${R}/getUser`)).data}catch(e){throw h(e),null}},pn=async e=>{try{return(await f.get(`${R}/getMarketingConsent?email=${e}`)).data}catch(t){return h(t),!1}},hn=async()=>{try{return(await f.post(`${R}/deleteAllUserSaveSearch`)).data}catch(e){throw h(e),null}},mn=async e=>{try{return(await f.post(`${R}/deleteUserSaveSearchParam/${e}`)).data}catch(t){throw h(t),null}},yn=async()=>{try{return(await f.get(`${R}/getFavouriteIdList`)).data}catch(e){return h(e),[]}},gn=async e=>{try{return(await f.post(`${R}/addUserFavourite/${e}`)).data}catch(t){return h(t),!1}},wn=async e=>{try{return(await f.post(`${R}/deleteUserFavourite/${e}`)).data}catch(t){return h(t),!1}},bn=async(e,t)=>{if(t===" "||t===" ")return!1;try{return(await f.post(`${R}/updateFavouriteNote`,{realEstateId:e,note:t})).data}catch(r){return h(r),!1}},Sn=async()=>{try{return(await f.post(`${R}/deleteAllUserFavourite`)).data}catch(e){return h(e),!1}},En=async e=>{try{return e?(await f.post(`${R}/refreshUserFirebaseToken?token=${e}`),!0):!1}catch{return!1}},Rn=async e=>{try{return await f.delete(`${R}/deleteUserFirebaseToken?token=${e}`),!0}catch{return!1}},An=async e=>{const{email:t,marketingConsent:r}=e;try{return await f.post(`${R}/updateMarketingConsent?email=${t}&marketingConsent=${r}`,e),!0}catch(n){return h(n),!1}},On=async(e=0,t=10)=>{try{return(await f.get(`${R}/getPublicUserSavedSearchBeanList/${e}/${t}`)).data}catch(r){return h(r),[]}},Pn=async e=>{try{return(await f.post(`${R}/updatePublicUserSavedSearchBean/`,e)).data}catch(t){return h(t),un()}},$n=async()=>{try{return(await f.get(`${R}/getPublicUserSaveSearchCount`)).data}catch(e){return h(e),0}},se=window._baseURLIt,at=`${se}/rest/realEstate`,Cn=async e=>{try{return(await f.post(`${se}/rest/publicUser/getRealEstateNotes/${e}`)).data}catch(t){return h(t),""}},Tn=async(e,t,r,n,s=!1)=>{if(!e||!n)throw`Email or resb are not valid, ${e}, ${n}`;return await f.post(`${at}/saveSearch?email=${e}&title=${t}&hourly=${r}&pushNotifications=${s}`,n)},Nn=async(e,t,r=!1)=>{try{const n="Ricerca salvata";return(await f.post(`${at}/saveSearch?email=${e}&title=${n}&pushNotifications=${r}`,t)).data}catch(n){throw h(n),n}},Un=async e=>{var n;const t=Ee(e);return t.polygonForDB&&(t.polygonFromMap=t.polygonForDB||""),(n=t==null?void 0:t.listingTypologyIdList)!=null&&n.includes(15)&&(t.conditionType=5),await(await f.post("/rest/realEstate/countRealEstateES",t)).data},Fn=async e=>{try{return(await f.post(`${se}/rest/realEstate/getRealEstateListForInfoWindow/${window._locale}`,e)).data}catch(t){return h(t),null}},xn=async()=>{if(!window._serializedSearchBean)return[];const e=Ee(JSON.parse(window._serializedSearchBean));delete e.latitude,delete e.longitude;try{return(await f.post(`${se}/rest/realEstate/getMapMarkers`,e,{headers:{"Content-Type":"application/json",Accept:"application/json"}})).data}catch(t){throw h(t),[]}},it=`${B}/rest/request`,Ln=async e=>(await f.post(`${it}/sendSuggestion`,e)).data,Dn=async e=>{try{return(await f.post("/rest/request/addRequestGeneric",e)).data}catch(t){throw h(t),t}},In=async e=>(await f.post(`${it}/sendWidgetRequest`,e)).data,L="/rest/statistics",vn=async e=>{try{return await f.post(`${L}/updateViewListing/W`,e),!0}catch(t){return h(t),!1}},_n=async e=>{try{return f.post(`${L}/updateRealEstateSearch`,e),!0}catch(t){return h(t),!1}},Bn=async(e,t)=>{try{return(await f.post(t?`${L}/updatePhoneView/${e}/${t}/W`:`/rest/statistics/updatePhoneView/${e}/W`)).data}catch(r){throw h(r),r}},kn=async e=>{try{const t=await f.post(`${L}/getPlaceTrendData?sale=${!0}`,e),r=await f.post(`${L}/getPlaceTrendData?sale=${!1}`,e);return Promise.all([t,r])}catch(t){throw h(t),t}},Mn=async(e,t={contract:"sale",macroTypologyId:1})=>{try{return(await f.post(`${L}/getAveragePriceGraphData/${t.contract}/${t.macroTypologyId}`,e)).data}catch(r){throw h(r),r}},jn="/rest/wikicasaPro",qn=async(e,t,r=void 0,n=void 0)=>{if(!t)throw new Error("The token can't be null");try{let s={token:t};r&&(s={...s,conditionTypeId:r}),n!=null&&(s={...s,floor:n});const o=j(new URL(`${B}${jn}/evaluateRealEstateWidget`),s),a=await f.post(o.toString(),e);return a.data.valid=!!a.data.valid,a.data}catch(s){throw h(s),s}},zn="/rest/wikicasaPro",Hn=async(e,t,r,n=0)=>{try{return(await f.post(`${zn}/userValuationWithPhotoFeedback/?email=${e}&token=${t}&feedback=${r}${n>0?"&userFeedbackValue="+n:""}`)).data}catch(s){throw h(s),s}},Jn=e=>!(e!=null&&e.length);function Vn(e,t){e=e.replace("#","");const r=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),s=parseInt(e.substring(4,6),16);return`rgba(${r}, ${n}, ${s}, ${t})`}/*! js-cookie v3.0.5 | MIT */function J(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var Wn={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function me(e,t){function r(s,o,a){if(!(typeof document>"u")){a=J({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var d in a)a[d]&&(c+="; "+d,a[d]!==!0&&(c+="="+a[d].split(";")[0]));return document.cookie=s+"="+e.write(o,s)+c}}function n(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var o=document.cookie?document.cookie.split("; "):[],a={},c=0;c<o.length;c++){var d=o[c].split("="),u=d.slice(1).join("=");try{var l=decodeURIComponent(d[0]);if(a[l]=e.read(u,l),s===l)break}catch{}}return s?a[s]:a}}return Object.create({set:r,get:n,remove:function(s,o){r(s,"",J({},o,{expires:-1}))},withAttributes:function(s){return me(this.converter,J({},this.attributes,s))},withConverter:function(s){return me(J({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}me(Wn,{path:"/"});function Gn(e,t,r=30,n=!0){const s=new Date;s.setTime(s.getTime()+24*60*60*1e3*r);const o=typeof t!="string"?JSON.stringify(t):t,a=n?btoa(encodeURIComponent(o)):o;document.cookie=e+"="+a+";path=/;expires="+s.toUTCString()}function Kn(e){try{const t=document.cookie.match("(^|;) ?"+e+"=([^;]*)(;|$)");return t?t[2]:null}catch(t){return console.error(t),null}}function Qn(e){try{const t=document.cookie.match("(^|;) ?"+e+"=([^;]*)(;|$)");return t?JSON.parse(decodeURIComponent(atob(t[2]))):null}catch(t){return console.error(t),ct(e),null}}function ct(e){(void 0)(e)}const Xn=(e,t,r="it-IT")=>{if(e===void 0)return"0";const n={style:"currency",currency:"EUR",maximumFractionDigits:0};return tt(t,n),new Intl.NumberFormat(r,n).format(e)};function Zn(e,t=!1){const r=e.getDate(),n=e.getMonth()+1,s=e.getFullYear();return t?`${("0"+r).slice(-2)}-${("0"+n).slice(-2)}-${s}`:`${s}-${("0"+n).slice(-2)}-${("0"+r).slice(-2)}`}const Yn=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,es=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),ts=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),ut=e=>{const t=document.querySelector(e);if(!t)throw new Error(`No element found with the id: ${e}`);return t},rs=e=>{typeof e=="string"?ut(e).textContent="":e.textContent=""},ns=(e,t="block")=>{e&&(e.style.display=t)},ss=e=>{e&&(e.style.display="none")},os=e=>e.includes("@gmail");async function as(e){const t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(o=>o.toString(16).padStart(2,"0")).join("")}const is=e=>{const t=e.split("@");if(t.length<2)throw new Error("The email has nothing before the '@' symbol");const r=t[0];let n="";for(const s of r)if(s!=="."){if(s==="+")break;n+=s}return`${n}@${t[1]}`},cs=e=>{if(!e||!e.trim())throw new Error("The email in null or empty");let t=e;return os(t)&&(t=is(e)),as(t)};function us(e,t){return(...r)=>new Promise((n,s)=>{e.id&&clearTimeout(e.id),e.id=setTimeout(()=>{try{const o=t(...r);n(o)}catch(o){s(o)}},e.delay)})}const ls=e=>{document.querySelectorAll(`a[class^=fav][data-id='${e}']`).forEach(r=>{r.classList.contains("fav-save")?r.style.display="none":r.classList.contains("fav-remove")&&(r.style.display="block")})},ds=e=>{document.querySelectorAll(`a[class^=fav][data-id='${e}']`).forEach(r=>{r.classList.contains("fav-save")?r.style.display="block":r.classList.contains("fav-remove")&&(r.style.display="none")})};function fs(e,t,r){return e.replace(new RegExp(t,"g"),r)}function lt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function dt(e,t,r,n){const s=[];e&&e!=="ND"&&(t&&t!=="ND"&&t!=="0"?s.push(`${e} ${t}`):s.push(e)),r&&n?s.push(`${r} (${n})`):s.push(r);const o=s.filter(a=>!!a).join(", ");return lt(o)}function ps(e){if(!e)return"";const t=document.createElement("span");return t.innerHTML=e,t.textContent||""}function hs(e,t){const r=new RegExp(Object.keys(t).map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|"),"gi");return e.replace(r,function(n){return t[n.toLowerCase()]})}function ft(e){return e.replace(/[\uA78C\uA78B]/g,"'").replace(/[^\x00-\x7F]/g,"")}const ms=(e="")=>!e||!e.trim()?"":(e=e.trim(),e.replace(" ","-").toLowerCase()),pt=async(e,t)=>{const r={};for(let s=0;s<e.address_components.length;s++)e.address_components[s].types.indexOf("administrative_area_level_3")!==-1?r.city=e.address_components[s].long_name:e.address_components[s].types.indexOf("locality")!==-1?r.locality=e.address_components[s].long_name:e.address_components[s].types.indexOf("route")!==-1?r.streetName=e.address_components[s].long_name:e.address_components[s].types.indexOf("street_number")!==-1?r.streetNumber=e.address_components[s].long_name:e.address_components[s].types.indexOf("postal_code")!==-1&&(r.zip=e.address_components[s].long_name);r.latitude=e.geometry.location.lat,r.longitude=e.geometry.location.lng,r.address=ft(t),typeof r.streetNumber>"u"&&(r.streetNumber=null);let n=await ot(r.latitude,r.longitude);if(delete n.city,delete n.locality,n={...n,...r},!n.streetNumber){const s=parseInt(n.address.split(",")[1]),o=parseInt(n.zip);s&&s!==o&&(n.streetNumber=s.toString())}return n},ys=async(e,t)=>{const r=await st(e),n=await pt(r,t),s=n.streetName?dt(n.streetName,n.streetNumber||"",n.cityName):n.address;return{place:n,address:s}},gs=(e,t)=>new Promise((r,n)=>{setTimeout(()=>{try{e&&e(),r()}catch{n()}},t)}),ht=(e,t)=>{t||(t=navigator.language);const r=Intl.NumberFormat(t).format(1111).replace(/\p{Number}/gu,""),n=Intl.NumberFormat(t).format(1.1).replace(/\p{Number}/gu,""),s=parseFloat(`${e}`.replace(new RegExp("\\"+r,"g"),"").replace(new RegExp("\\"+n),"."));return isNaN(s)?"":s},mt=(e,t)=>{if(e==null)return;if(e=parseFloat(`${e}`),isNaN(e))return"";const r={style:"currency",currency:"EUR"};let s={...{maximumFractionDigits:0}};return t!=null&&t.currency&&(s={...s,...r}),new Intl.NumberFormat(navigator.language,{...s}).format(e)};function ws(e,t=!1){return e==null?"":Re(t?Math.round(e):Math.floor(e),0)}function Re(e,t){return!e&&e!==0?"":e.toLocaleString("it-IT",{minimumFractionDigits:t,maximumFractionDigits:t})}function bs(e,t=2){return Re(e,t)}const Ss={formatFn:mt,unFormatFn:ht};function Es(e,t,r){const n=[].slice.call(document.querySelectorAll(e)),s=new IntersectionObserver((o,a)=>{for(let c=0;c<o.length;c++){const d=o[c];if(d.isIntersecting){const u=d.target;t(u,a),a.unobserve(u)}}},r);n.forEach(o=>{s.observe(o)})}let Ie=!1;const Rs=e=>{document.addEventListener("notification-permission-changed",e)},As=()=>{!navigator.permissions||!navigator.permissions.query||(!Ie&&navigator.permissions.query({name:"notifications"}).then(function(e){e.onchange=function(){document.dispatchEvent(new CustomEvent("notification-permission-changed",{detail:{permissionState:this.state}}))}}),Ie=!0)};function Os(e){return new Promise((t,r)=>f.post("/rest/request/addRequestGenericValuation",e,{headers:{"Content-Type":"application/json",dataType:"json"}}).then(()=>{t()}).catch(n=>r(n)))}function Ps(e,t,r,n,s,o,a){let c="/";return r&&(c+=(r==he.AUCTION?window._auctionLabel:r==he.RENT?window._rentLabel:window._saleLabel)+"-"),c+=`${t}/`,o&&(c+=`${o}/`),e&&(c+=`${e.replace(/^-+|-+$/g,"")}/`),n&&(c+=`${n.replace(/^_+|_+$/g,"")}/`),!n&&a&&(c+=`${a.replace(/^_+|_+$/g,"")}/`),s&&(c+=`${s.replace(/^_+|_+$/g,"")}/`),c}function $s(e){const t=Object.keys(De).map(r=>e[r]?encodeURIComponent(De[r])+"="+encodeURIComponent(e[r]):null).filter(r=>r!==null);return t.length?`?${t.join("&")}`:""}function Cs(e){const t=Object.keys(ue).map(r=>{if(e[r])if(Array.isArray(e[r])){const n=e[r],s=ue[r];let o="";for(let a=0;a<n.length;a++)o+=encodeURIComponent(s)+"="+encodeURIComponent(n[a]),o+=a<n.length-1?"&":"";return o}else return encodeURIComponent(ue[r])+"="+encodeURIComponent(e[r]);else return null}).filter(r=>r!==null);return t.length?`?${t.join("&")}`:""}const Ts=e=>{const t=`${window._baseURL}`;switch(e){case"SAVED_SEARCHES":return`${t}/${window._privateURL}/${window._saveSearchesURL}`;default:throw new Error(`There is no matching URL for ${e}`)}};exports.addGenericRequest=Dn;exports.addPermissionStateListener=As;exports.addUserFavorite=gn;exports.appendQueryString=j;exports.awaitableSetTimeout=gs;exports.buildParams=$s;exports.buildParamsForAgency=Cs;exports.buildURL=Ps;exports.capitalizeFirstLetter=lt;exports.cleanASCII=ft;exports.debounce=us;exports.decodeCookie=Qn;exports.decodeTextWithEntities=ps;exports.deepCopy=Ee;exports.deleteAllSaveSearch=hn;exports.deleteSaveSearch=mn;exports.deleteUserFavorite=wn;exports.deleteUserFirebaseToken=Rn;exports.emptyElem=rs;exports.encodeCookie=Gn;exports.evaluateRealEstateWidget=qn;exports.formatAddress=dt;exports.formatCurrency=Xn;exports.formatDate=Zn;exports.formatFloat=bs;exports.formatInteger=ws;exports.formatLocaleNumber=mt;exports.formatNumber=Re;exports.formatterNumberObj=Ss;exports.getAgenciesData=_r;exports.getAgencyById=Ir;exports.getCityPolygonJSON=Vr;exports.getCookie=Kn;exports.getCountryPolygonJSON=Hr;exports.getDistrictsByZoneId=on;exports.getFavourites=yn;exports.getMapMarkers=xn;exports.getMarketingConsent=pn;exports.getMenuInfo=dn;exports.getPlace=nn;exports.getPlaceFromGAutocomplete=ys;exports.getPlaceFromPlaceID=zr;exports.getPlaceTrendData=kn;exports.getPlacesAddressAutocomplete=qr;exports.getPlacesByQuery=rn;exports.getPlacesDetails=st;exports.getProvincePolygonJSON=Wr;exports.getPublicUser=fn;exports.getPublicUserSaveSearchList=On;exports.getRealEstateCounter=Un;exports.getRealEstateNotes=Cn;exports.getRealEstatesData=Fn;exports.getRegionPolygonJSON=Jr;exports.getSaleGraphData=Mn;exports.getSavedSearchesCount=$n;exports.getSingleElement=ut;exports.getTransactionGraphData=Kr;exports.getURLPage=Ts;exports.getZones=sn;exports.googlePlaceConverter=pt;exports.guessPlace=ot;exports.handleAxiosError=h;exports.hashEmail=cs;exports.hideElem=ss;exports.isArrNullOrEmpty=Jn;exports.isEmptyObject=Lr;exports.isMobile=es;exports.isSafari=ts;exports.isiOSDevice=Yn;exports.observeOnce=Es;exports.onNotificationsPermissionChange=Rs;exports.parseLocaleNumber=ht;exports.removeCookie=ct;exports.removeFavourites=Sn;exports.replaceAll=fs;exports.replaceAllTokens=hs;exports.rgba=Vn;exports.saveSearch=Tn;exports.saveSearchFromRequest=Nn;exports.saveUserFirebaseToken=En;exports.sendAgencyContactAsync=Dr;exports.sendBrochureMR=Yr;exports.sendBrochureRequest=Xr;exports.sendInfoMR=en;exports.sendInfoPremium=Qr;exports.sendJobApplicationForm=Zr;exports.sendMortgage=vr;exports.sendRequestGeneric=Os;exports.sendSuggestion=Ln;exports.sendWidgetRequest=In;exports.shallowCopyObjectTo=tt;exports.showAddFavoritesIcon=ds;exports.showElem=ns;exports.showRemoveFavoritesIcons=ls;exports.stringToHyphened=ms;exports.updateMarketingConsent=An;exports.updateNewsletterConsent=an;exports.updateNote=bn;exports.updatePhoneView=Bn;exports.updatePublicUserSavedSearchBean=Pn;exports.updateRealEstateSearch=_n;exports.updateViewListing=vn;exports.userValuationWithPhotoFeedback=Hn;
|