@meetelise/chat 1.34.1 → 1.34.3
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/package.json +1 -1
- package/dist/src/MyPubnub.d.ts +0 -116
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.d.ts +0 -28
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.d.ts +0 -18
- package/dist/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.d.ts +0 -22
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +0 -46
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card.d.ts +0 -21
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +0 -13
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +0 -34
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +0 -18
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.d.ts +0 -1
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.d.ts +0 -8
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/index.d.ts +0 -1
- package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +0 -5
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +0 -13
- package/dist/src/WebComponent/FeeCalculator/constants.d.ts +0 -3
- package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +0 -1
- package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +0 -55
- package/dist/src/WebComponent/FeeCalculator/index.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/model/building-fee-view.d.ts +0 -41
- package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +0 -82
- package/dist/src/WebComponent/FeeCalculator/model/desired-addon.d.ts +0 -5
- package/dist/src/WebComponent/FeeCalculator/model/desired-rentable-item.d.ts +0 -4
- package/dist/src/WebComponent/FeeCalculator/model/index.d.ts +0 -13
- package/dist/src/WebComponent/FeeCalculator/model/item-combination.d.ts +0 -6
- package/dist/src/WebComponent/FeeCalculator/model/item-quantity.d.ts +0 -4
- package/dist/src/WebComponent/FeeCalculator/model/pricing-matrix.d.ts +0 -18
- package/dist/src/WebComponent/FeeCalculator/model/pricing-rule.d.ts +0 -8
- package/dist/src/WebComponent/FeeCalculator/model/rent-frequency.d.ts +0 -1
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item-summary.d.ts +0 -9
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item.d.ts +0 -9
- package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +0 -23
- package/dist/src/WebComponent/FeeCalculator/model/unit-fee-bundle.d.ts +0 -31
- package/dist/src/WebComponent/LeadSourceClient.d.ts +0 -46
- package/dist/src/WebComponent/OfficeHours.d.ts +0 -21
- package/dist/src/WebComponent/Scheduler/date-picker.d.ts +0 -28
- package/dist/src/WebComponent/Scheduler/time-picker.d.ts +0 -14
- package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +0 -101
- package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +0 -13
- package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +0 -1
- package/dist/src/WebComponent/actions/InputStyles.d.ts +0 -1
- package/dist/src/WebComponent/actions/action-confirm-button.d.ts +0 -13
- package/dist/src/WebComponent/actions/call-us-window.d.ts +0 -37
- package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +0 -8
- package/dist/src/WebComponent/actions/details-window.d.ts +0 -14
- package/dist/src/WebComponent/actions/email-us-window.d.ts +0 -46
- package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +0 -17
- package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +0 -8
- package/dist/src/WebComponent/chat-additional-actions.d.ts +0 -28
- package/dist/src/WebComponent/health-chat.d.ts +0 -47
- package/dist/src/WebComponent/healthchat-styles.d.ts +0 -1
- package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +0 -7
- package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +0 -3
- package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/index.d.ts +0 -2
- package/dist/src/WebComponent/launcher/Launcher.d.ts +0 -99
- package/dist/src/WebComponent/launcher/launcherStyles.d.ts +0 -1
- package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +0 -27
- package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +0 -1
- package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +0 -1
- package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +0 -1
- package/dist/src/WebComponent/leasing-chat-styles.d.ts +0 -1
- package/dist/src/WebComponent/loaders/index.d.ts +0 -4
- package/dist/src/WebComponent/loaders/mega-loader.d.ts +0 -7
- package/dist/src/WebComponent/loaders/skeleton-card.d.ts +0 -12
- package/dist/src/WebComponent/loaders/skeleton-loader-styles.d.ts +0 -3
- package/dist/src/WebComponent/loaders/skeleton-loader.d.ts +0 -13
- package/dist/src/WebComponent/me-chat.d.ts +0 -91
- package/dist/src/WebComponent/me-select.d.ts +0 -24
- package/dist/src/WebComponent/mini-loader.d.ts +0 -5
- package/dist/src/WebComponent/pubnub-chat-styles.d.ts +0 -1
- package/dist/src/WebComponent/pubnub-chat.d.ts +0 -49
- package/dist/src/WebComponent/pubnub-media.d.ts +0 -14
- package/dist/src/WebComponent/pubnub-message-styles.d.ts +0 -1
- package/dist/src/WebComponent/pubnub-message.d.ts +0 -39
- package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +0 -1
- package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +0 -12
- package/dist/src/WebComponent/utilities-chat.d.ts +0 -47
- package/dist/src/WebComponent/utilities-styles.d.ts +0 -1
- package/dist/src/WebComponent/utils.d.ts +0 -31
- package/dist/src/analytics.d.ts +0 -64
- package/dist/src/disclaimers.d.ts +0 -9
- package/dist/src/fetchBuildingABTestType.d.ts +0 -8
- package/dist/src/fetchBuildingInfo.d.ts +0 -57
- package/dist/src/fetchBuildingWebchatView.d.ts +0 -124
- package/dist/src/fetchFeatureFlag.d.ts +0 -14
- package/dist/src/fetchLeadSources.d.ts +0 -4
- package/dist/src/fetchPhoneNumberFromSource.d.ts +0 -6
- package/dist/src/getAvailabilities.d.ts +0 -45
- package/dist/src/getBuildingPhoneNumber.d.ts +0 -1
- package/dist/src/getShouldAllowScheduling.d.ts +0 -1
- package/dist/src/getShouldShowWebchat.d.ts +0 -3
- package/dist/src/getTimezoneString.d.ts +0 -1
- package/dist/src/globals.d.ts +0 -2
- package/dist/src/gtm.d.ts +0 -6
- package/dist/src/handleChatId.d.ts +0 -11
- package/dist/src/insertDNIIntoWebsite.d.ts +0 -5
- package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +0 -4
- package/dist/src/main/MEChat.d.ts +0 -74
- package/dist/src/main/utils.d.ts +0 -2
- package/dist/src/postLeadSources.d.ts +0 -3
- package/dist/src/rentgrata.d.ts +0 -4
- package/dist/src/replaceSelectButtonsWithNewLink.d.ts +0 -5
- package/dist/src/services/fees/calculateQuote.d.ts +0 -14
- package/dist/src/services/fees/fetchBuildingFeesV2.d.ts +0 -10
- package/dist/src/services/fees/fetchBuildingUnits.d.ts +0 -29
- package/dist/src/services/fees/utils.d.ts +0 -1
- package/dist/src/svgIcons.d.ts +0 -5
- package/dist/src/themes.d.ts +0 -5
- package/dist/src/types/incentive-v2.d.ts +0 -23
- package/dist/src/types/rest-sdk.types.d.ts +0 -11
- package/dist/src/types/webchat-no-show-reason.d.ts +0 -1
- package/dist/src/utils/queryParamBuilder.d.ts +0 -8
- package/dist/src/utils.d.ts +0 -13
- package/src/MyPubnub.ts +0 -792
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.ts +0 -35
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.ts +0 -206
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.ts +0 -6
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.ts +0 -101
- package/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.ts +0 -82
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.ts +0 -9
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.ts +0 -124
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +0 -142
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +0 -243
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.ts +0 -65
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card.ts +0 -91
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +0 -44
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +0 -38
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +0 -151
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +0 -248
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +0 -82
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +0 -76
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.ts +0 -40
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.ts +0 -43
- package/src/WebComponent/FeeCalculator/components/incentive-banner/index.ts +0 -1
- package/src/WebComponent/FeeCalculator/components/index.ts +0 -5
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +0 -39
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +0 -39
- package/src/WebComponent/FeeCalculator/constants.ts +0 -5
- package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +0 -310
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +0 -341
- package/src/WebComponent/FeeCalculator/index.ts +0 -4
- package/src/WebComponent/FeeCalculator/model/building-fee-view.ts +0 -84
- package/src/WebComponent/FeeCalculator/model/building-fee.ts +0 -126
- package/src/WebComponent/FeeCalculator/model/desired-addon.ts +0 -6
- package/src/WebComponent/FeeCalculator/model/desired-rentable-item.ts +0 -4
- package/src/WebComponent/FeeCalculator/model/index.ts +0 -13
- package/src/WebComponent/FeeCalculator/model/item-combination.ts +0 -16
- package/src/WebComponent/FeeCalculator/model/item-quantity.ts +0 -4
- package/src/WebComponent/FeeCalculator/model/pricing-matrix.ts +0 -45
- package/src/WebComponent/FeeCalculator/model/pricing-rule.ts +0 -9
- package/src/WebComponent/FeeCalculator/model/rent-frequency.ts +0 -1
- package/src/WebComponent/FeeCalculator/model/rentable-item-summary.ts +0 -10
- package/src/WebComponent/FeeCalculator/model/rentable-item.ts +0 -10
- package/src/WebComponent/FeeCalculator/model/transaction-category.ts +0 -23
- package/src/WebComponent/FeeCalculator/model/unit-fee-bundle.ts +0 -54
- package/src/WebComponent/LeadSourceClient.ts +0 -332
- package/src/WebComponent/MEChat.css +0 -5
- package/src/WebComponent/OfficeHours.ts +0 -73
- package/src/WebComponent/Scheduler/date-picker.ts +0 -405
- package/src/WebComponent/Scheduler/time-picker.ts +0 -190
- package/src/WebComponent/Scheduler/tour-scheduler.ts +0 -1416
- package/src/WebComponent/Scheduler/tour-type-option.ts +0 -112
- package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +0 -418
- package/src/WebComponent/actions/InputStyles.ts +0 -57
- package/src/WebComponent/actions/action-confirm-button.ts +0 -125
- package/src/WebComponent/actions/call-us-window.ts +0 -467
- package/src/WebComponent/actions/collapse-expand-button.ts +0 -65
- package/src/WebComponent/actions/details-window.ts +0 -150
- package/src/WebComponent/actions/email-us-window.ts +0 -556
- package/src/WebComponent/actions/formatPhoneNumber.ts +0 -72
- package/src/WebComponent/actions/minimize-expand-button.ts +0 -93
- package/src/WebComponent/chat-additional-actions.ts +0 -135
- package/src/WebComponent/health-chat.ts +0 -270
- package/src/WebComponent/healthchat-styles.ts +0 -119
- package/src/WebComponent/icons/ApplyOutlineIcon.ts +0 -22
- package/src/WebComponent/icons/BookTourOutlineIcon.ts +0 -13
- package/src/WebComponent/icons/CalculatorOutlineIcon.ts +0 -22
- package/src/WebComponent/icons/ChatOutlineIcon.ts +0 -10
- package/src/WebComponent/icons/ChevronLeftIcon.ts +0 -7
- package/src/WebComponent/icons/ChevronRightIcon.ts +0 -7
- package/src/WebComponent/icons/ContactResidentIcon.ts +0 -9
- package/src/WebComponent/icons/DollarOutlineIcon.ts +0 -26
- package/src/WebComponent/icons/EmailOutlineIcon.ts +0 -7
- package/src/WebComponent/icons/HeyThereEmojiIcon.ts +0 -12
- package/src/WebComponent/icons/PhoneOutlineIcon.ts +0 -7
- package/src/WebComponent/icons/SendMessageIcon.ts +0 -17
- package/src/WebComponent/icons/TourSelfGuidedIcon.ts +0 -17
- package/src/WebComponent/icons/TourVirtuallyIcon.ts +0 -17
- package/src/WebComponent/icons/TourWithAgentIcon.ts +0 -17
- package/src/WebComponent/icons/XOutlineIcon.ts +0 -8
- package/src/WebComponent/index.ts +0 -2
- package/src/WebComponent/launcher/Launcher.ts +0 -1284
- package/src/WebComponent/launcher/launcherStyles.ts +0 -500
- package/src/WebComponent/launcher/mobile-launcher.ts +0 -162
- package/src/WebComponent/launcher/typeEmojiStyles.ts +0 -161
- package/src/WebComponent/launcher/typeMiniStyles.ts +0 -60
- package/src/WebComponent/launcher/typeMobileStyles.ts +0 -50
- package/src/WebComponent/leasing-chat-styles.ts +0 -114
- package/src/WebComponent/loaders/index.ts +0 -7
- package/src/WebComponent/loaders/mega-loader.ts +0 -36
- package/src/WebComponent/loaders/skeleton-card.ts +0 -31
- package/src/WebComponent/loaders/skeleton-loader-styles.ts +0 -112
- package/src/WebComponent/loaders/skeleton-loader.ts +0 -34
- package/src/WebComponent/me-chat.ts +0 -1261
- package/src/WebComponent/me-select.ts +0 -322
- package/src/WebComponent/mini-loader.ts +0 -28
- package/src/WebComponent/pubnub-chat-styles.ts +0 -204
- package/src/WebComponent/pubnub-chat.ts +0 -928
- package/src/WebComponent/pubnub-media.ts +0 -208
- package/src/WebComponent/pubnub-message-styles.ts +0 -54
- package/src/WebComponent/pubnub-message.ts +0 -431
- package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +0 -34
- package/src/WebComponent/simple-launcher/simple-launcher.ts +0 -100
- package/src/WebComponent/utilities-chat.ts +0 -270
- package/src/WebComponent/utilities-styles.ts +0 -110
- package/src/WebComponent/utils.ts +0 -82
- package/src/analytics.ts +0 -217
- package/src/assetUrls.ts +0 -6
- package/src/disclaimers.ts +0 -86
- package/src/fetchBuildingABTestType.ts +0 -21
- package/src/fetchBuildingInfo.ts +0 -87
- package/src/fetchBuildingWebchatView.ts +0 -176
- package/src/fetchFeatureFlag.ts +0 -250
- package/src/fetchLeadSources.ts +0 -98
- package/src/fetchPhoneNumberFromSource.ts +0 -31
- package/src/fetchWebchatPreferences.ts +0 -54
- package/src/getAvailabilities.ts +0 -179
- package/src/getBuildingPhoneNumber.ts +0 -26
- package/src/getShouldAllowScheduling.ts +0 -16
- package/src/getShouldShowWebchat.ts +0 -114
- package/src/getTimezoneString.ts +0 -39
- package/src/globals.ts +0 -3
- package/src/gtm.ts +0 -17
- package/src/handleChatId.ts +0 -101
- package/src/insertDNIIntoWebsite.ts +0 -146
- package/src/insertLeadSourceIntoSchedulerLinks.ts +0 -71
- package/src/main/MEChat.test.ts +0 -110
- package/src/main/MEChat.ts +0 -404
- package/src/main/utils.ts +0 -70
- package/src/postLeadSources.ts +0 -44
- package/src/rentgrata.ts +0 -74
- package/src/replaceSelectButtonsWithNewLink.ts +0 -90
- package/src/services/fees/calculateQuote.ts +0 -74
- package/src/services/fees/fetchBuildingFees.ts +0 -50
- package/src/services/fees/fetchBuildingFeesV2.ts +0 -56
- package/src/services/fees/fetchBuildingFloorplans.ts +0 -74
- package/src/services/fees/fetchBuildingUnits.ts +0 -86
- package/src/services/fees/utils.ts +0 -4
- package/src/svgIcons.ts +0 -14
- package/src/themes.ts +0 -65
- package/src/types/incentive-v2.ts +0 -24
- package/src/types/rest-sdk.types.ts +0 -13
- package/src/types/webchat-no-show-reason.ts +0 -6
- package/src/utils/queryParamBuilder.ts +0 -28
- package/src/utils.ts +0 -121
package/src/analytics.ts
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import { getCookieValue } from "./utils";
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface Window {
|
|
6
|
-
RCTPCampaign?: { CampaignDetails: { Source: string } };
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface CampaignSources {
|
|
11
|
-
entrataCampaignSource: string | null;
|
|
12
|
-
yardiCampaignSource: string | null;
|
|
13
|
-
realpageCampaignSource: string | null;
|
|
14
|
-
utmCampaignSource: string | null;
|
|
15
|
-
bozzutoAdSource: string | null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* A connection to the MeetElise API to send analytics events
|
|
20
|
-
*/
|
|
21
|
-
export default class Analytics {
|
|
22
|
-
private org: string;
|
|
23
|
-
private building: string;
|
|
24
|
-
private featureFlags?: Record<string, boolean>;
|
|
25
|
-
public chatId: string;
|
|
26
|
-
private incomingProcessedLeadSource: string | null;
|
|
27
|
-
|
|
28
|
-
constructor(
|
|
29
|
-
org: string,
|
|
30
|
-
building: string,
|
|
31
|
-
chatId: string,
|
|
32
|
-
incomingProcessedLeadSource: string | null
|
|
33
|
-
) {
|
|
34
|
-
this.org = org;
|
|
35
|
-
this.building = building;
|
|
36
|
-
this.chatId = chatId;
|
|
37
|
-
this.incomingProcessedLeadSource = incomingProcessedLeadSource;
|
|
38
|
-
this.featureFlags = {};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Store feature flag value(s) on the Analytics object to be sent with future pings. If `featureFlags` object is already present, the argument is merged into it.
|
|
43
|
-
*/
|
|
44
|
-
setFeatureFlags(featureFlags: Record<string, boolean>): void {
|
|
45
|
-
this.featureFlags = {
|
|
46
|
-
...this.featureFlags,
|
|
47
|
-
...featureFlags,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Send an event. Takes one argument, the event type name.
|
|
53
|
-
*/
|
|
54
|
-
ping(eventType: string): void {
|
|
55
|
-
fetch(
|
|
56
|
-
"https://app.meetelise.com/platformApi/connectors/talk_js/analytics",
|
|
57
|
-
{
|
|
58
|
-
method: "POST",
|
|
59
|
-
credentials: "omit", // Necessary for successful CORS
|
|
60
|
-
keepalive: true, // Analytics should not abort after browser close
|
|
61
|
-
headers: { "content-type": "application/json; charset=UTF-8" },
|
|
62
|
-
body: JSON.stringify({
|
|
63
|
-
eventType,
|
|
64
|
-
chatId: this.chatId,
|
|
65
|
-
url: location.href,
|
|
66
|
-
org: this.org,
|
|
67
|
-
building: this.building,
|
|
68
|
-
referrer: document.referrer,
|
|
69
|
-
featureFlags: this.featureFlags,
|
|
70
|
-
campaignSources: getCampaignSources(),
|
|
71
|
-
incomingProcessedLeadSource: this.incomingProcessedLeadSource, // if we already know the lead source, send it along
|
|
72
|
-
webchatVersion: process.env.npm_package_version ?? "1.20.155",
|
|
73
|
-
}),
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export const getCampaignSources = (): CampaignSources => {
|
|
80
|
-
try {
|
|
81
|
-
const queryParams = new URL(window.location.href).searchParams;
|
|
82
|
-
const yardiCampaignSource =
|
|
83
|
-
window.RCTPCampaign?.CampaignDetails?.Source ?? null;
|
|
84
|
-
const entrataCampaignSource = queryParams.get("switch_cls[id]");
|
|
85
|
-
const realpageCampaignSource = queryParams.get("ilm");
|
|
86
|
-
const utmCampaignSource = queryParams.get("utm_source");
|
|
87
|
-
const bozzutoAdSource = getCookieValue("bozzuto_ad_source");
|
|
88
|
-
|
|
89
|
-
return {
|
|
90
|
-
entrataCampaignSource,
|
|
91
|
-
realpageCampaignSource,
|
|
92
|
-
utmCampaignSource,
|
|
93
|
-
yardiCampaignSource,
|
|
94
|
-
bozzutoAdSource,
|
|
95
|
-
};
|
|
96
|
-
} catch (e) {
|
|
97
|
-
/**
|
|
98
|
-
* Some clients have pages that overwrite the `URL` class and turn it into a string. This is a workaround for that.
|
|
99
|
-
* Example site: https://ther3.com
|
|
100
|
-
*/
|
|
101
|
-
// eslint-disable-next-line no-console
|
|
102
|
-
console.warn(`Couldnt get campaign sources from url, error: ${e}`);
|
|
103
|
-
const iframe = document.createElement("iframe");
|
|
104
|
-
iframe.style.display = "none";
|
|
105
|
-
document.body.appendChild(iframe);
|
|
106
|
-
if (!iframe.contentWindow) {
|
|
107
|
-
return {
|
|
108
|
-
entrataCampaignSource: null,
|
|
109
|
-
realpageCampaignSource: null,
|
|
110
|
-
utmCampaignSource: null,
|
|
111
|
-
yardiCampaignSource: null,
|
|
112
|
-
bozzutoAdSource: null,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
117
|
-
const OriginalURL = (iframe.contentWindow as any).URL;
|
|
118
|
-
if (!OriginalURL) {
|
|
119
|
-
return {
|
|
120
|
-
entrataCampaignSource: null,
|
|
121
|
-
realpageCampaignSource: null,
|
|
122
|
-
utmCampaignSource: null,
|
|
123
|
-
yardiCampaignSource: null,
|
|
124
|
-
bozzutoAdSource: null,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
const queryParams = new OriginalURL(window.location.href).searchParams;
|
|
128
|
-
const yardiCampaignSource =
|
|
129
|
-
window.RCTPCampaign?.CampaignDetails?.Source ?? null;
|
|
130
|
-
const entrataCampaignSource = queryParams.get("switch_cls[id]");
|
|
131
|
-
const realpageCampaignSource = queryParams.get("ilm");
|
|
132
|
-
const utmCampaignSource = queryParams.get("utm_source");
|
|
133
|
-
const bozzutoAdSource = getCookieValue("bozzuto_ad_source");
|
|
134
|
-
|
|
135
|
-
return {
|
|
136
|
-
entrataCampaignSource,
|
|
137
|
-
realpageCampaignSource,
|
|
138
|
-
utmCampaignSource,
|
|
139
|
-
yardiCampaignSource,
|
|
140
|
-
bozzutoAdSource,
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export enum LogType {
|
|
146
|
-
error = "error",
|
|
147
|
-
info = "info",
|
|
148
|
-
warn = "warn",
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export const sendLoggingEvent = async ({
|
|
152
|
-
logType,
|
|
153
|
-
buildingSlug,
|
|
154
|
-
orgSlug,
|
|
155
|
-
logTitle,
|
|
156
|
-
logData,
|
|
157
|
-
}: {
|
|
158
|
-
logType?: LogType;
|
|
159
|
-
buildingSlug?: string;
|
|
160
|
-
orgSlug?: string;
|
|
161
|
-
logTitle: string;
|
|
162
|
-
logData: Record<string, unknown> | null;
|
|
163
|
-
}): Promise<void> => {
|
|
164
|
-
const host = "https://app.meetelise.com";
|
|
165
|
-
await axios.post(
|
|
166
|
-
`${host}/platformApi/webchat/logging`,
|
|
167
|
-
{
|
|
168
|
-
...logData,
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
headers: {
|
|
172
|
-
"Content-Type": "application/json",
|
|
173
|
-
"building-slug": buildingSlug ?? "",
|
|
174
|
-
"org-slug": orgSlug ?? "",
|
|
175
|
-
"log-type": logType ?? LogType.error,
|
|
176
|
-
"log-title": logTitle.toUpperCase().replace(/\s/g, "_"),
|
|
177
|
-
},
|
|
178
|
-
}
|
|
179
|
-
);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
interface SignalLoggerProps {
|
|
183
|
-
org_slug: string;
|
|
184
|
-
building_slug: string;
|
|
185
|
-
chat_id?: string | null;
|
|
186
|
-
is_pixel_on_site?: boolean | null;
|
|
187
|
-
is_any_webchat_showing?: boolean | null;
|
|
188
|
-
is_form_override_success?: boolean | null;
|
|
189
|
-
is_dni_insert_override_success?: boolean | null;
|
|
190
|
-
is_application_link_replacement_success?: boolean | null;
|
|
191
|
-
extra_data?: Record<string, unknown> | null;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export const logSignal = async ({
|
|
195
|
-
params,
|
|
196
|
-
sampleRate,
|
|
197
|
-
}: {
|
|
198
|
-
params: SignalLoggerProps;
|
|
199
|
-
sampleRate: number; // 0.05 is 5%
|
|
200
|
-
}): Promise<void> => {
|
|
201
|
-
try {
|
|
202
|
-
if (Math.random() >= sampleRate) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
await axios.post(
|
|
206
|
-
`https://app.meetelise.com/platformApi/webchat/log/signal`,
|
|
207
|
-
{
|
|
208
|
-
...params,
|
|
209
|
-
website_origin: window.location.origin,
|
|
210
|
-
website_search: window.location.search,
|
|
211
|
-
}
|
|
212
|
-
);
|
|
213
|
-
} catch (error) {
|
|
214
|
-
// eslint-disable-next-line no-console
|
|
215
|
-
console.warn(error);
|
|
216
|
-
}
|
|
217
|
-
};
|
package/src/assetUrls.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const glowBarMp4 =
|
|
2
|
-
"https://eliseusercontent.meetelise.com/webchat/HorizontalBar-Shadow.mp4";
|
|
3
|
-
export const glowBarWebm =
|
|
4
|
-
"https://eliseusercontent.meetelise.com/webchat/HorizontalBar-Shadow.webm";
|
|
5
|
-
export const glowBackgroundMp4 =
|
|
6
|
-
"https://eliseusercontent.meetelise.com/webchat/01-EliseAI-Hero_1.mp4";
|
package/src/disclaimers.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { html, TemplateResult } from "lit";
|
|
2
|
-
import { styleMap } from "lit/directives/style-map.js";
|
|
3
|
-
|
|
4
|
-
const disclaimerStyles = {
|
|
5
|
-
container: {
|
|
6
|
-
fontSize: "10px",
|
|
7
|
-
paddingTop: "4px",
|
|
8
|
-
},
|
|
9
|
-
link: {
|
|
10
|
-
color: "#4287f5",
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const disclaimer = ({
|
|
15
|
-
phoneNumberInput,
|
|
16
|
-
emailInput,
|
|
17
|
-
orgLegalName,
|
|
18
|
-
orgSlug,
|
|
19
|
-
}: {
|
|
20
|
-
buildingName: string;
|
|
21
|
-
phoneNumberInput?: string;
|
|
22
|
-
emailInput?: string;
|
|
23
|
-
orgLegalName: string;
|
|
24
|
-
orgSlug: string;
|
|
25
|
-
}): TemplateResult => {
|
|
26
|
-
if (phoneNumberInput && orgSlug === "greystar") {
|
|
27
|
-
return html`<div style=${styleMap(disclaimerStyles.container)}>
|
|
28
|
-
By providing your phone number and clicking send, you consent to receive
|
|
29
|
-
recurring marketing calls and voice and text messages from Greystar or on
|
|
30
|
-
its behalf at this number using artificial voice and/or an autodialer.
|
|
31
|
-
Messages may be AI or human-generated. Your phone number and
|
|
32
|
-
communications are shared with and recorded and used by EliseAI. You are
|
|
33
|
-
not required to provide your phone number or consent to these terms to
|
|
34
|
-
lease at this property. Msg & Data rates may apply. You consent to
|
|
35
|
-
<a
|
|
36
|
-
style=${styleMap(disclaimerStyles.link)}
|
|
37
|
-
href="https://www.greystar.com/privacy"
|
|
38
|
-
target="_blank"
|
|
39
|
-
rel="noopener noreferrer"
|
|
40
|
-
>Greystar’s Global Privacy Policy</a
|
|
41
|
-
>
|
|
42
|
-
and
|
|
43
|
-
<a
|
|
44
|
-
style=${styleMap(disclaimerStyles.link)}
|
|
45
|
-
href="http://bit.ly/me_privacy_policy"
|
|
46
|
-
target="_blank"
|
|
47
|
-
rel="noopener noreferrer"
|
|
48
|
-
>EliseAI’s Privacy Policy</a
|
|
49
|
-
>.
|
|
50
|
-
</div>`;
|
|
51
|
-
}
|
|
52
|
-
if (phoneNumberInput) {
|
|
53
|
-
return html` <div style=${styleMap(disclaimerStyles.container)}>
|
|
54
|
-
By providing your number and clicking send, you consent to receive
|
|
55
|
-
recurring marketing calls and voice and text messages from or on behalf of
|
|
56
|
-
${orgLegalName} at this number using artificial voice or an autodialer
|
|
57
|
-
system. Messages may be AI or human generated. This consent is not
|
|
58
|
-
required to lease at this property. Msg & Data rates may apply. You
|
|
59
|
-
consent to this
|
|
60
|
-
<a
|
|
61
|
-
style=${styleMap(disclaimerStyles.link)}
|
|
62
|
-
href="http://bit.ly/me_privacy_policy"
|
|
63
|
-
target="_blank"
|
|
64
|
-
rel="noopener noreferrer"
|
|
65
|
-
>privacy policy</a
|
|
66
|
-
>, including having your number and communications recorded and used by a
|
|
67
|
-
third party.
|
|
68
|
-
</div>`;
|
|
69
|
-
}
|
|
70
|
-
if (emailInput) {
|
|
71
|
-
return html` <div style=${styleMap(disclaimerStyles.container)}>
|
|
72
|
-
By entering your email and clicking submit, you consent to this
|
|
73
|
-
<a
|
|
74
|
-
style=${styleMap(disclaimerStyles.link)}
|
|
75
|
-
href="http://bit.ly/me_privacy_policy"
|
|
76
|
-
target="_blank"
|
|
77
|
-
rel="noopener noreferrer"
|
|
78
|
-
>privacy policy</a
|
|
79
|
-
>, including having your email address and communications collected and
|
|
80
|
-
recorded and used by a third party.
|
|
81
|
-
</div>`;
|
|
82
|
-
}
|
|
83
|
-
return html``;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export default disclaimer;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
interface BuildingABType {
|
|
3
|
-
abTestType: string;
|
|
4
|
-
}
|
|
5
|
-
export enum abTestTypes {
|
|
6
|
-
"ConceptEmoji" = "Concept 2 (Blue/White)",
|
|
7
|
-
}
|
|
8
|
-
export default async function fetchBuildingABTestType(
|
|
9
|
-
buildingSlug: string
|
|
10
|
-
): Promise<BuildingABType | null> {
|
|
11
|
-
const host = "https://app.meetelise.com";
|
|
12
|
-
try {
|
|
13
|
-
const abTestTypeResponse = await axios.get(
|
|
14
|
-
`${host}/platformApi/webchat/${buildingSlug}/ab-test-type`
|
|
15
|
-
);
|
|
16
|
-
//return { abTestType: "Concept 2 (Blue/White)" };
|
|
17
|
-
return abTestTypeResponse.data;
|
|
18
|
-
} catch (_) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
package/src/fetchBuildingInfo.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
|
|
3
|
-
export interface LabeledOption {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string | number;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Use BuildingWebchatView instead.
|
|
10
|
-
* The response from the API.
|
|
11
|
-
*/
|
|
12
|
-
export interface Building {
|
|
13
|
-
id: number;
|
|
14
|
-
themeId: string;
|
|
15
|
-
avatarSrc: string | null;
|
|
16
|
-
avatarType: "image" | "initials" | null;
|
|
17
|
-
chatSubtitle: string | null;
|
|
18
|
-
chatTitle: string | null;
|
|
19
|
-
name: string;
|
|
20
|
-
userFirstName: string;
|
|
21
|
-
userId: number;
|
|
22
|
-
welcomeMessage: string | null;
|
|
23
|
-
systemWelcomeMessage: string | null;
|
|
24
|
-
launchedDateTime: string | null;
|
|
25
|
-
orgId: number;
|
|
26
|
-
phoneNumber: string;
|
|
27
|
-
tourTypeOptions: LabeledOption[];
|
|
28
|
-
chatWidgets?: string[] | null;
|
|
29
|
-
chatCallUsHeader?: string;
|
|
30
|
-
autoOpenChatWidget: boolean;
|
|
31
|
-
sgtUrl: string;
|
|
32
|
-
escortedToursLink: string;
|
|
33
|
-
virtualToursLink: string;
|
|
34
|
-
active: number;
|
|
35
|
-
usesDynamicScheduling: boolean;
|
|
36
|
-
textWithUsPhoneNumber: string | null;
|
|
37
|
-
orgLegalName: string;
|
|
38
|
-
webchatScopeConfigured: boolean;
|
|
39
|
-
virtualTourEnabled: boolean;
|
|
40
|
-
escortedTourEnabled: boolean;
|
|
41
|
-
selfGuidedTourEnabled: boolean;
|
|
42
|
-
escortedToursTypeOffered: string;
|
|
43
|
-
virtualToursTypeOffered: string;
|
|
44
|
-
selfGuidedToursTypeOffered: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type UnitV2 = {
|
|
48
|
-
name: string;
|
|
49
|
-
layout: string;
|
|
50
|
-
availabilityStage: number;
|
|
51
|
-
active: number;
|
|
52
|
-
occupied: boolean;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Load the publicly-available info for a building.
|
|
57
|
-
* @deprecated Use fetchBuildingAndConfig instead.
|
|
58
|
-
* @param orgSlug - The org slug, e.g. "big-prop-co"
|
|
59
|
-
* @param buildingSlug - The buidling slug, e.g. "gravity-falls"
|
|
60
|
-
* @returns The building's ID, name, theme, and agent.
|
|
61
|
-
*/
|
|
62
|
-
export default async function fetchBuildingInfo(
|
|
63
|
-
orgSlug: string,
|
|
64
|
-
buildingSlug: string
|
|
65
|
-
): Promise<Building> {
|
|
66
|
-
const host = "https://app.meetelise.com";
|
|
67
|
-
const buildingUrl = `${host}/api/pub/v1/organization/${orgSlug}/building/${buildingSlug}`;
|
|
68
|
-
|
|
69
|
-
const buildingResponse = await axios.get(buildingUrl);
|
|
70
|
-
|
|
71
|
-
const building: Building = buildingResponse.data;
|
|
72
|
-
try {
|
|
73
|
-
building.welcomeMessage = replaceName(
|
|
74
|
-
building.welcomeMessage ?? "",
|
|
75
|
-
building.userFirstName
|
|
76
|
-
);
|
|
77
|
-
} catch (e) {
|
|
78
|
-
// eslint-disable-next-line no-console
|
|
79
|
-
console.error(e);
|
|
80
|
-
}
|
|
81
|
-
return building;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const replaceName = (originalText: string, newName: string) => {
|
|
85
|
-
const regex = /elise/gi;
|
|
86
|
-
return originalText.replace(regex, newName);
|
|
87
|
-
};
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
|
|
3
|
-
export enum DesignConcepts {
|
|
4
|
-
EMOJI = "emoji",
|
|
5
|
-
PILLS = "pills",
|
|
6
|
-
MINIMIZED = "minimized", // this is also mobile
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
enum TourType {
|
|
10
|
-
UNKNOWN = "UNKNOWN",
|
|
11
|
-
SELF_GUIDED = "SELF_GUIDED",
|
|
12
|
-
VIRTUAL_SHOWING = "VIRTUAL_SHOWING",
|
|
13
|
-
WITH_AGENT = "WITH_AGENT",
|
|
14
|
-
MEDIA_TOUR = "MEDIA_TOUR",
|
|
15
|
-
OPEN_HOUSE_STUDIO = "OPEN_HOUSE_STUDIO",
|
|
16
|
-
OPEN_HOUSE_1BR = "OPEN_HOUSE_1BR",
|
|
17
|
-
OPEN_HOUSE_2BR = "OPEN_HOUSE_2BR",
|
|
18
|
-
OPEN_HOUSE_3BR = "OPEN_HOUSE_3BR",
|
|
19
|
-
OPEN_HOUSE_4BR = "OPEN_HOUSE_4BR",
|
|
20
|
-
OPEN_HOUSE_5BR = "OPEN_HOUSE_5BR",
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
enum TourAccessType {
|
|
24
|
-
LINK = "link",
|
|
25
|
-
CLIENT_SCHEDULED = "client_scheduled",
|
|
26
|
-
SCHEDULED_BY_ME_MANAGED_BY_ME = "scheduled_by_ME_managed_by_ME",
|
|
27
|
-
SCHEDULED_BY_ME_MANAGED_BY_CLIENT = "scheduled_by_ME_managed_by_client",
|
|
28
|
-
SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE = "scheduled_by_ME_managed_by_concierge",
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const shouldOpenTourLink = (
|
|
32
|
-
tourType: string,
|
|
33
|
-
tourTypeOffered: string
|
|
34
|
-
): boolean => {
|
|
35
|
-
if (tourType === "self") {
|
|
36
|
-
const shouldntOpenTourTypesOffered = [
|
|
37
|
-
"SCHEDULED_BY_ME_MANAGED_BY_ME",
|
|
38
|
-
"SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE",
|
|
39
|
-
];
|
|
40
|
-
return !shouldntOpenTourTypesOffered.includes(tourTypeOffered);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (tourType === "virtual") {
|
|
44
|
-
const shouldntOpenTourTypesOffered = ["SCHEDULED_BY_ME_MANAGED_BY_CLIENT"];
|
|
45
|
-
return !shouldntOpenTourTypesOffered.includes(tourTypeOffered);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return true;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export interface LayoutOption {
|
|
52
|
-
value: number;
|
|
53
|
-
label: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
interface TourTypeOption {
|
|
57
|
-
value: TourType;
|
|
58
|
-
label: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface BuildingWebchatView {
|
|
62
|
-
id: number;
|
|
63
|
-
orgId: number;
|
|
64
|
-
name: string;
|
|
65
|
-
userId: number | null;
|
|
66
|
-
active: number | null;
|
|
67
|
-
userFirstName: string;
|
|
68
|
-
userLastName: string | null;
|
|
69
|
-
primaryColor: string | null;
|
|
70
|
-
backgroundColor: string | null;
|
|
71
|
-
logoSrc: string | null;
|
|
72
|
-
welcomeMessage: string | null;
|
|
73
|
-
systemWelcomeMessage: string | null;
|
|
74
|
-
chatTitle: string | null;
|
|
75
|
-
chatSubtitle: string | null;
|
|
76
|
-
bannerColor: string | null;
|
|
77
|
-
bannerTextColor: string | null;
|
|
78
|
-
messageColor: string | null;
|
|
79
|
-
messageTextColor: string | null;
|
|
80
|
-
launchButtonColor: string | null;
|
|
81
|
-
launchButtonIconColor: string | null;
|
|
82
|
-
launchButtonSize: string | null;
|
|
83
|
-
avatarType: "image" | "initials" | null;
|
|
84
|
-
avatarSrc: string | null;
|
|
85
|
-
avatarInitials: string | null;
|
|
86
|
-
themeId: string;
|
|
87
|
-
chatCallUsHeader?: string;
|
|
88
|
-
googleMapsUrl: string | null;
|
|
89
|
-
chatWidgets?: string[] | null;
|
|
90
|
-
streetAddress: string | null;
|
|
91
|
-
postalCode: string | null;
|
|
92
|
-
state: string | null;
|
|
93
|
-
phoneNumber: string;
|
|
94
|
-
textWithUsPhoneNumber: string | null;
|
|
95
|
-
layoutOptions: LayoutOption[];
|
|
96
|
-
tourTypeOptions: TourTypeOption[];
|
|
97
|
-
conversationMaintenanceMode: boolean;
|
|
98
|
-
sgtUrl: string;
|
|
99
|
-
escortedToursLink: string;
|
|
100
|
-
virtualToursLink: string;
|
|
101
|
-
isVirtualTourEnabled: boolean;
|
|
102
|
-
isEscortedTourEnabled: boolean;
|
|
103
|
-
isSelfGuidedTourEnabled: boolean;
|
|
104
|
-
escortedToursTypeOffered: TourAccessType;
|
|
105
|
-
virtualToursTypeOffered: TourAccessType;
|
|
106
|
-
selfGuidedToursTypeOffered: TourAccessType;
|
|
107
|
-
usesDynamicScheduling: boolean;
|
|
108
|
-
numAvailableUnits: number;
|
|
109
|
-
isSchedulingDisabled: boolean;
|
|
110
|
-
shouldBuildingScheduleTours: boolean;
|
|
111
|
-
orgLegalName: string;
|
|
112
|
-
launchedDateTime: Date | null;
|
|
113
|
-
webchatScopeConfigured: boolean;
|
|
114
|
-
displayStyle: DesignConcepts;
|
|
115
|
-
secondaryColor: string | null;
|
|
116
|
-
foregroundColorOnPrimaryBackgroundColor: string | null;
|
|
117
|
-
foregroundColorOnSecondaryBackgroundColor: string | null;
|
|
118
|
-
shouldShowChatDesktop: boolean | null;
|
|
119
|
-
shouldShowChatMobile: boolean | null;
|
|
120
|
-
shouldShowTextDesktop: boolean | null;
|
|
121
|
-
shouldShowTextMobile: boolean | null;
|
|
122
|
-
shouldShowPhoneDesktop: boolean | null;
|
|
123
|
-
shouldShowPhoneMobile: boolean | null;
|
|
124
|
-
shouldShowEmailDesktop: boolean | null;
|
|
125
|
-
shouldShowEmailMobile: boolean | null;
|
|
126
|
-
shouldShowSstDesktop: boolean | null;
|
|
127
|
-
shouldShowSstMobile: boolean | null;
|
|
128
|
-
shouldShowApplyNowDesktop: boolean | null;
|
|
129
|
-
shouldShowApplyNowMobile: boolean | null;
|
|
130
|
-
shouldShowPricingCalculatorDesktop: boolean | null;
|
|
131
|
-
shouldShowPricingCalculatorMobile: boolean | null;
|
|
132
|
-
applicationLink: string | null;
|
|
133
|
-
isLiveOnCollect: boolean | null;
|
|
134
|
-
isLiveOnApplications: boolean | null;
|
|
135
|
-
requiresConsentForChat: boolean | null;
|
|
136
|
-
privacyPolicyUrlForChat: string | null;
|
|
137
|
-
collapseMobileFeatures: boolean | null;
|
|
138
|
-
autoOpenChat: boolean | null;
|
|
139
|
-
isInheritingFromOrg: boolean | null;
|
|
140
|
-
isGlobalDefault: boolean | null;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Load the publicly-available info for a building.
|
|
145
|
-
*
|
|
146
|
-
* @param orgSlug - The org slug, e.g. "big-prop-co"
|
|
147
|
-
* @param buildingSlug - The buidling slug, e.g. "gravity-falls"
|
|
148
|
-
* @returns The building's ID, name, theme, and agent.
|
|
149
|
-
*/
|
|
150
|
-
export default async function fetchBuildingWebchatView(
|
|
151
|
-
orgSlug: string,
|
|
152
|
-
buildingSlug: string
|
|
153
|
-
): Promise<BuildingWebchatView> {
|
|
154
|
-
const host = "https://app.meetelise.com";
|
|
155
|
-
const buildingUrl = `${host}/api/pub/v1/organization/${orgSlug}/building/${buildingSlug}/v2`;
|
|
156
|
-
|
|
157
|
-
const buildingResponse = await axios.get(buildingUrl);
|
|
158
|
-
|
|
159
|
-
const buildingWebchatView: BuildingWebchatView = buildingResponse.data;
|
|
160
|
-
|
|
161
|
-
try {
|
|
162
|
-
buildingWebchatView.welcomeMessage = replaceName(
|
|
163
|
-
buildingWebchatView.welcomeMessage ?? "",
|
|
164
|
-
buildingWebchatView.userFirstName
|
|
165
|
-
);
|
|
166
|
-
} catch (e) {
|
|
167
|
-
// eslint-disable-next-line no-console
|
|
168
|
-
console.error(e);
|
|
169
|
-
}
|
|
170
|
-
return buildingWebchatView;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const replaceName = (originalText: string, newName: string) => {
|
|
174
|
-
const regex = /elise/gi;
|
|
175
|
-
return originalText.replace(regex, newName);
|
|
176
|
-
};
|