@meetelise/chat 1.35.0 → 1.35.2
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/src/MyPubnub.d.ts +116 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.d.ts +28 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.d.ts +18 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.d.ts +22 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +46 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card.d.ts +21 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +34 -0
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +18 -0
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.d.ts +8 -0
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/index.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +5 -0
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/constants.d.ts +3 -0
- package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +55 -0
- package/dist/src/WebComponent/FeeCalculator/index.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/model/building-fee-view.d.ts +41 -0
- package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +82 -0
- package/dist/src/WebComponent/FeeCalculator/model/desired-addon.d.ts +5 -0
- package/dist/src/WebComponent/FeeCalculator/model/desired-rentable-item.d.ts +4 -0
- package/dist/src/WebComponent/FeeCalculator/model/index.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/model/item-combination.d.ts +6 -0
- package/dist/src/WebComponent/FeeCalculator/model/item-quantity.d.ts +4 -0
- package/dist/src/WebComponent/FeeCalculator/model/pricing-matrix.d.ts +18 -0
- package/dist/src/WebComponent/FeeCalculator/model/pricing-rule.d.ts +8 -0
- package/dist/src/WebComponent/FeeCalculator/model/rent-frequency.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item-summary.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item.d.ts +10 -0
- package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +23 -0
- package/dist/src/WebComponent/FeeCalculator/model/unit-fee-bundle.d.ts +31 -0
- package/dist/src/WebComponent/LeadSourceClient.d.ts +46 -0
- package/dist/src/WebComponent/OfficeHours.d.ts +21 -0
- package/dist/src/WebComponent/Scheduler/date-picker.d.ts +28 -0
- package/dist/src/WebComponent/Scheduler/time-picker.d.ts +16 -0
- package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +102 -0
- package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +13 -0
- package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +1 -0
- package/dist/src/WebComponent/actions/InputStyles.d.ts +1 -0
- package/dist/src/WebComponent/actions/action-confirm-button.d.ts +13 -0
- package/dist/src/WebComponent/actions/call-us-window.d.ts +37 -0
- package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +8 -0
- package/dist/src/WebComponent/actions/details-window.d.ts +14 -0
- package/dist/src/WebComponent/actions/email-us-window.d.ts +46 -0
- package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +17 -0
- package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +8 -0
- package/dist/src/WebComponent/chat-additional-actions.d.ts +28 -0
- package/dist/src/WebComponent/health-chat.d.ts +47 -0
- package/dist/src/WebComponent/healthchat-styles.d.ts +1 -0
- package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +7 -0
- package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +3 -0
- package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/index.d.ts +2 -0
- package/dist/src/WebComponent/launcher/Launcher.d.ts +99 -0
- package/dist/src/WebComponent/launcher/launcherStyles.d.ts +1 -0
- package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +27 -0
- package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +1 -0
- package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +1 -0
- package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +1 -0
- package/dist/src/WebComponent/leasing-chat-styles.d.ts +1 -0
- package/dist/src/WebComponent/loaders/index.d.ts +4 -0
- package/dist/src/WebComponent/loaders/mega-loader.d.ts +7 -0
- package/dist/src/WebComponent/loaders/skeleton-card.d.ts +12 -0
- package/dist/src/WebComponent/loaders/skeleton-loader-styles.d.ts +3 -0
- package/dist/src/WebComponent/loaders/skeleton-loader.d.ts +13 -0
- package/dist/src/WebComponent/me-chat.d.ts +91 -0
- package/dist/src/WebComponent/me-select.d.ts +24 -0
- package/dist/src/WebComponent/mini-loader.d.ts +5 -0
- package/dist/src/WebComponent/pubnub-chat-styles.d.ts +1 -0
- package/dist/src/WebComponent/pubnub-chat.d.ts +48 -0
- package/dist/src/WebComponent/pubnub-media.d.ts +14 -0
- package/dist/src/WebComponent/pubnub-message-styles.d.ts +1 -0
- package/dist/src/WebComponent/pubnub-message.d.ts +39 -0
- package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +1 -0
- package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +12 -0
- package/dist/src/WebComponent/utilities-chat.d.ts +47 -0
- package/dist/src/WebComponent/utilities-styles.d.ts +1 -0
- package/dist/src/WebComponent/utils.d.ts +31 -0
- package/dist/src/analytics.d.ts +64 -0
- package/dist/src/disclaimers.d.ts +16 -0
- package/dist/src/fetchBuildingABTestType.d.ts +8 -0
- package/dist/src/fetchBuildingInfo.d.ts +58 -0
- package/dist/src/fetchBuildingWebchatView.d.ts +124 -0
- package/dist/src/fetchFeatureFlag.d.ts +14 -0
- package/dist/src/fetchLeadSources.d.ts +4 -0
- package/dist/src/fetchPhoneNumberFromSource.d.ts +6 -0
- package/dist/src/getAvailabilities.d.ts +46 -0
- package/dist/src/getBuildingPhoneNumber.d.ts +1 -0
- package/dist/src/getShouldAllowScheduling.d.ts +1 -0
- package/dist/src/getShouldShowWebchat.d.ts +3 -0
- package/dist/src/getTimezoneString.d.ts +1 -0
- package/dist/src/globals.d.ts +2 -0
- package/dist/src/gtm.d.ts +6 -0
- package/dist/src/handleChatId.d.ts +11 -0
- package/dist/src/insertDNIIntoWebsite.d.ts +5 -0
- package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +4 -0
- package/dist/src/main/MEChat.d.ts +74 -0
- package/dist/src/main/utils.d.ts +2 -0
- package/dist/src/postLeadSources.d.ts +3 -0
- package/dist/src/rentgrata.d.ts +4 -0
- package/dist/src/replaceSelectButtonsWithNewLink.d.ts +5 -0
- package/dist/src/services/fees/calculateQuote.d.ts +14 -0
- package/dist/src/services/fees/fetchBuildingFeesV2.d.ts +10 -0
- package/dist/src/services/fees/fetchBuildingUnits.d.ts +29 -0
- package/dist/src/services/fees/utils.d.ts +1 -0
- package/dist/src/svgIcons.d.ts +5 -0
- package/dist/src/themes.d.ts +5 -0
- package/dist/src/types/incentive-v2.d.ts +23 -0
- package/dist/src/types/rest-sdk.types.d.ts +11 -0
- package/dist/src/types/webchat-no-show-reason.d.ts +1 -0
- package/dist/src/utils/getWidgetOverrides.d.ts +39 -0
- package/dist/src/utils/queryParamBuilder.d.ts +8 -0
- package/dist/src/utils.d.ts +13 -0
- package/package.json +1 -1
- package/public/dist/index.js +250 -164
- package/src/MyPubnub.ts +792 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.ts +39 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.ts +206 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.ts +6 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.ts +101 -0
- package/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.ts +98 -0
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.ts +9 -0
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.ts +136 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +151 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +261 -0
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.ts +65 -0
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card.ts +91 -0
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +44 -0
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +38 -0
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +149 -0
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +247 -0
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +82 -0
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +76 -0
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.ts +40 -0
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.ts +43 -0
- package/src/WebComponent/FeeCalculator/components/incentive-banner/index.ts +1 -0
- package/src/WebComponent/FeeCalculator/components/index.ts +5 -0
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +39 -0
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +39 -0
- package/src/WebComponent/FeeCalculator/constants.ts +5 -0
- package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +310 -0
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +341 -0
- package/src/WebComponent/FeeCalculator/index.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/building-fee-view.ts +84 -0
- package/src/WebComponent/FeeCalculator/model/building-fee.ts +126 -0
- package/src/WebComponent/FeeCalculator/model/desired-addon.ts +6 -0
- package/src/WebComponent/FeeCalculator/model/desired-rentable-item.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/index.ts +13 -0
- package/src/WebComponent/FeeCalculator/model/item-combination.ts +16 -0
- package/src/WebComponent/FeeCalculator/model/item-quantity.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/pricing-matrix.ts +45 -0
- package/src/WebComponent/FeeCalculator/model/pricing-rule.ts +9 -0
- package/src/WebComponent/FeeCalculator/model/rent-frequency.ts +1 -0
- package/src/WebComponent/FeeCalculator/model/rentable-item-summary.ts +34 -0
- package/src/WebComponent/FeeCalculator/model/rentable-item.ts +21 -0
- package/src/WebComponent/FeeCalculator/model/transaction-category.ts +23 -0
- package/src/WebComponent/FeeCalculator/model/unit-fee-bundle.ts +54 -0
- package/src/WebComponent/LeadSourceClient.ts +332 -0
- package/src/WebComponent/MEChat.css +5 -0
- package/src/WebComponent/OfficeHours.ts +73 -0
- package/src/WebComponent/Scheduler/date-picker.ts +405 -0
- package/src/WebComponent/Scheduler/time-picker.ts +195 -0
- package/src/WebComponent/Scheduler/tour-scheduler.ts +1430 -0
- package/src/WebComponent/Scheduler/tour-type-option.ts +112 -0
- package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +418 -0
- package/src/WebComponent/actions/InputStyles.ts +57 -0
- package/src/WebComponent/actions/action-confirm-button.ts +125 -0
- package/src/WebComponent/actions/call-us-window.ts +467 -0
- package/src/WebComponent/actions/collapse-expand-button.ts +65 -0
- package/src/WebComponent/actions/details-window.ts +150 -0
- package/src/WebComponent/actions/email-us-window.ts +556 -0
- package/src/WebComponent/actions/formatPhoneNumber.ts +72 -0
- package/src/WebComponent/actions/minimize-expand-button.ts +93 -0
- package/src/WebComponent/chat-additional-actions.ts +135 -0
- package/src/WebComponent/health-chat.ts +270 -0
- package/src/WebComponent/healthchat-styles.ts +119 -0
- package/src/WebComponent/icons/ApplyOutlineIcon.ts +22 -0
- package/src/WebComponent/icons/BookTourOutlineIcon.ts +13 -0
- package/src/WebComponent/icons/CalculatorOutlineIcon.ts +80 -0
- package/src/WebComponent/icons/ChatOutlineIcon.ts +10 -0
- package/src/WebComponent/icons/ChevronLeftIcon.ts +7 -0
- package/src/WebComponent/icons/ChevronRightIcon.ts +7 -0
- package/src/WebComponent/icons/ContactResidentIcon.ts +9 -0
- package/src/WebComponent/icons/DollarOutlineIcon.ts +26 -0
- package/src/WebComponent/icons/EmailOutlineIcon.ts +7 -0
- package/src/WebComponent/icons/HeyThereEmojiIcon.ts +12 -0
- package/src/WebComponent/icons/PhoneOutlineIcon.ts +7 -0
- package/src/WebComponent/icons/SendMessageIcon.ts +17 -0
- package/src/WebComponent/icons/TourSelfGuidedIcon.ts +17 -0
- package/src/WebComponent/icons/TourVirtuallyIcon.ts +17 -0
- package/src/WebComponent/icons/TourWithAgentIcon.ts +17 -0
- package/src/WebComponent/icons/XOutlineIcon.ts +8 -0
- package/src/WebComponent/index.ts +2 -0
- package/src/WebComponent/launcher/Launcher.ts +1284 -0
- package/src/WebComponent/launcher/launcherStyles.ts +500 -0
- package/src/WebComponent/launcher/mobile-launcher.ts +162 -0
- package/src/WebComponent/launcher/typeEmojiStyles.ts +161 -0
- package/src/WebComponent/launcher/typeMiniStyles.ts +60 -0
- package/src/WebComponent/launcher/typeMobileStyles.ts +50 -0
- package/src/WebComponent/leasing-chat-styles.ts +114 -0
- package/src/WebComponent/loaders/index.ts +7 -0
- package/src/WebComponent/loaders/mega-loader.ts +36 -0
- package/src/WebComponent/loaders/skeleton-card.ts +31 -0
- package/src/WebComponent/loaders/skeleton-loader-styles.ts +112 -0
- package/src/WebComponent/loaders/skeleton-loader.ts +34 -0
- package/src/WebComponent/me-chat.ts +1264 -0
- package/src/WebComponent/me-select.ts +322 -0
- package/src/WebComponent/mini-loader.ts +28 -0
- package/src/WebComponent/pubnub-chat-styles.ts +204 -0
- package/src/WebComponent/pubnub-chat.ts +771 -0
- package/src/WebComponent/pubnub-media.ts +208 -0
- package/src/WebComponent/pubnub-message-styles.ts +54 -0
- package/src/WebComponent/pubnub-message.ts +431 -0
- package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +34 -0
- package/src/WebComponent/simple-launcher/simple-launcher.ts +100 -0
- package/src/WebComponent/utilities-chat.ts +270 -0
- package/src/WebComponent/utilities-styles.ts +110 -0
- package/src/WebComponent/utils.ts +82 -0
- package/src/analytics.ts +217 -0
- package/src/assetUrls.ts +6 -0
- package/src/disclaimers.ts +301 -0
- package/src/fetchBuildingABTestType.ts +21 -0
- package/src/fetchBuildingInfo.ts +88 -0
- package/src/fetchBuildingWebchatView.ts +176 -0
- package/src/fetchFeatureFlag.ts +250 -0
- package/src/fetchLeadSources.ts +98 -0
- package/src/fetchPhoneNumberFromSource.ts +31 -0
- package/src/fetchWebchatPreferences.ts +54 -0
- package/src/getAvailabilities.ts +189 -0
- package/src/getBuildingPhoneNumber.ts +26 -0
- package/src/getShouldAllowScheduling.ts +16 -0
- package/src/getShouldShowWebchat.ts +114 -0
- package/src/getTimezoneString.ts +40 -0
- package/src/globals.ts +3 -0
- package/src/gtm.ts +17 -0
- package/src/handleChatId.ts +101 -0
- package/src/insertDNIIntoWebsite.ts +146 -0
- package/src/insertLeadSourceIntoSchedulerLinks.ts +71 -0
- package/src/main/MEChat.test.ts +110 -0
- package/src/main/MEChat.ts +404 -0
- package/src/main/utils.ts +70 -0
- package/src/postLeadSources.ts +44 -0
- package/src/rentgrata.ts +74 -0
- package/src/replaceSelectButtonsWithNewLink.ts +91 -0
- package/src/services/fees/calculateQuote.ts +74 -0
- package/src/services/fees/fetchBuildingFees.ts +50 -0
- package/src/services/fees/fetchBuildingFeesV2.ts +59 -0
- package/src/services/fees/fetchBuildingFloorplans.ts +74 -0
- package/src/services/fees/fetchBuildingUnits.ts +86 -0
- package/src/services/fees/utils.ts +4 -0
- package/src/svgIcons.ts +14 -0
- package/src/themes.ts +65 -0
- package/src/types/incentive-v2.ts +24 -0
- package/src/types/rest-sdk.types.ts +13 -0
- package/src/types/webchat-no-show-reason.ts +6 -0
- package/src/utils/getWidgetOverrides.ts +91 -0
- package/src/utils/queryParamBuilder.ts +28 -0
- package/src/utils.ts +121 -0
package/src/analytics.ts
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
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";
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { html, TemplateResult } from "lit";
|
|
2
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
3
|
+
import { CheckboxEmpty } from "./svgIcons";
|
|
4
|
+
import { HeyThereEmoji } from "./WebComponent/icons/HeyThereEmojiIcon";
|
|
5
|
+
|
|
6
|
+
const disclaimerStyles = {
|
|
7
|
+
container: {
|
|
8
|
+
fontSize: "10px",
|
|
9
|
+
paddingTop: "4px",
|
|
10
|
+
},
|
|
11
|
+
link: {
|
|
12
|
+
color: "#4287f5",
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const CURRENT_CONSENT_ID = "currentConsentId";
|
|
17
|
+
|
|
18
|
+
const formDisclaimer = ({
|
|
19
|
+
phoneNumberInput,
|
|
20
|
+
emailInput,
|
|
21
|
+
orgLegalName,
|
|
22
|
+
orgSlug,
|
|
23
|
+
}: {
|
|
24
|
+
buildingName: string;
|
|
25
|
+
phoneNumberInput?: string;
|
|
26
|
+
emailInput?: string;
|
|
27
|
+
orgLegalName: string;
|
|
28
|
+
orgSlug: string;
|
|
29
|
+
}): TemplateResult => {
|
|
30
|
+
if (phoneNumberInput && orgSlug === "greystar") {
|
|
31
|
+
return html`<div style=${styleMap(disclaimerStyles.container)}>
|
|
32
|
+
By providing your phone number and clicking send, you consent to receive
|
|
33
|
+
recurring marketing calls and voice and text messages from Greystar or on
|
|
34
|
+
its behalf at this number using artificial voice and/or an autodialer.
|
|
35
|
+
Messages may be AI or human-generated. Your phone number and
|
|
36
|
+
communications are shared with and recorded and used by EliseAI. You are
|
|
37
|
+
not required to provide your phone number or consent to these terms to
|
|
38
|
+
lease at this property. Msg & Data rates may apply. You consent to
|
|
39
|
+
<a
|
|
40
|
+
style=${styleMap(disclaimerStyles.link)}
|
|
41
|
+
href="https://www.greystar.com/privacy"
|
|
42
|
+
target="_blank"
|
|
43
|
+
rel="noopener noreferrer"
|
|
44
|
+
>Greystar’s Global Privacy Policy</a
|
|
45
|
+
>
|
|
46
|
+
and
|
|
47
|
+
<a
|
|
48
|
+
style=${styleMap(disclaimerStyles.link)}
|
|
49
|
+
href="http://bit.ly/me_privacy_policy"
|
|
50
|
+
target="_blank"
|
|
51
|
+
rel="noopener noreferrer"
|
|
52
|
+
>EliseAI’s Privacy Policy</a
|
|
53
|
+
>.
|
|
54
|
+
</div>`;
|
|
55
|
+
}
|
|
56
|
+
if (phoneNumberInput) {
|
|
57
|
+
return html` <div style=${styleMap(disclaimerStyles.container)}>
|
|
58
|
+
By providing your number and clicking send, you consent to receive
|
|
59
|
+
recurring marketing calls and voice and text messages from or on behalf of
|
|
60
|
+
${orgLegalName} at this number using artificial voice or an autodialer
|
|
61
|
+
system. Messages may be AI or human generated. This consent is not
|
|
62
|
+
required to lease at this property. Msg & Data rates may apply. You
|
|
63
|
+
consent to this
|
|
64
|
+
<a
|
|
65
|
+
style=${styleMap(disclaimerStyles.link)}
|
|
66
|
+
href="http://bit.ly/me_privacy_policy"
|
|
67
|
+
target="_blank"
|
|
68
|
+
rel="noopener noreferrer"
|
|
69
|
+
>privacy policy</a
|
|
70
|
+
>, including having your number and communications recorded and used by a
|
|
71
|
+
third party.
|
|
72
|
+
</div>`;
|
|
73
|
+
}
|
|
74
|
+
if (emailInput) {
|
|
75
|
+
return html` <div style=${styleMap(disclaimerStyles.container)}>
|
|
76
|
+
By entering your email and clicking submit, you consent to this
|
|
77
|
+
<a
|
|
78
|
+
style=${styleMap(disclaimerStyles.link)}
|
|
79
|
+
href="http://bit.ly/me_privacy_policy"
|
|
80
|
+
target="_blank"
|
|
81
|
+
rel="noopener noreferrer"
|
|
82
|
+
>privacy policy</a
|
|
83
|
+
>, including having your email address and communications collected and
|
|
84
|
+
recorded and used by a third party.
|
|
85
|
+
</div>`;
|
|
86
|
+
}
|
|
87
|
+
return html``;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const getConsentPreChatDisclaimer = (
|
|
91
|
+
orgSlug: string | null,
|
|
92
|
+
privacyPolicyUrl: string,
|
|
93
|
+
consentKey: string,
|
|
94
|
+
changeConsent: (hasConsent: boolean) => void
|
|
95
|
+
): TemplateResult => {
|
|
96
|
+
if (orgSlug === "avb" && !localStorage.getItem(consentKey ?? "")) {
|
|
97
|
+
return html`
|
|
98
|
+
<div class="legal-confirmation-inner-container">
|
|
99
|
+
<div>${HeyThereEmoji()}</div>
|
|
100
|
+
<div>
|
|
101
|
+
<span style="font-weight: 600">Confirm to continue</span>
|
|
102
|
+
<p>
|
|
103
|
+
By using this feature you accept our
|
|
104
|
+
<a
|
|
105
|
+
href="https://www.avaloncommunities.com/terms-of-use"
|
|
106
|
+
target="_blank"
|
|
107
|
+
rel="noopener noreferrer"
|
|
108
|
+
class="privacy-policy-link"
|
|
109
|
+
>Terms</a
|
|
110
|
+
>,
|
|
111
|
+
<a
|
|
112
|
+
href="https://www.avaloncommunities.com/privacy-policy"
|
|
113
|
+
target="_blank"
|
|
114
|
+
rel="noopener noreferrer"
|
|
115
|
+
class="privacy-policy-link"
|
|
116
|
+
>Privacy Policy</a
|
|
117
|
+
>,
|
|
118
|
+
<a
|
|
119
|
+
href="https://www.avaloncommunities.com/us-state-privacy-notice"
|
|
120
|
+
target="_blank"
|
|
121
|
+
rel="noopener noreferrer"
|
|
122
|
+
class="privacy-policy-link"
|
|
123
|
+
>U.S. State Privacy Notice</a
|
|
124
|
+
>, and that chats may use automated or AI responses from a bot and
|
|
125
|
+
may be recorded and used by us and our vendors.
|
|
126
|
+
</p>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<button
|
|
130
|
+
class="agreeButton"
|
|
131
|
+
@click=${() => {
|
|
132
|
+
changeConsent(true);
|
|
133
|
+
const consentData = {
|
|
134
|
+
consentGiven: true,
|
|
135
|
+
timestamp: new Date().getTime(),
|
|
136
|
+
consentId: CURRENT_CONSENT_ID,
|
|
137
|
+
};
|
|
138
|
+
localStorage.setItem(consentKey ?? "", JSON.stringify(consentData));
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
I agree
|
|
142
|
+
</button>
|
|
143
|
+
</div>
|
|
144
|
+
`;
|
|
145
|
+
}
|
|
146
|
+
if (orgSlug === "mill-creek") {
|
|
147
|
+
return html`<div class="legal-confirmation-inner-container">
|
|
148
|
+
<div>${HeyThereEmoji()}</div>
|
|
149
|
+
<div>
|
|
150
|
+
<span style="font-weight: 600">Confirm to continue</span>
|
|
151
|
+
<p>
|
|
152
|
+
Hello! I'm your virtual assistant, Milly, and I am here to help you
|
|
153
|
+
today. Before I can answer any questions, it is important that you
|
|
154
|
+
know I am a third-party bot, and I will be collecting our
|
|
155
|
+
communications and other information you provide, consistent with our
|
|
156
|
+
privacy policy.
|
|
157
|
+
</p>
|
|
158
|
+
<div class="confirmation-with-checkbox">
|
|
159
|
+
<div
|
|
160
|
+
class="checkbox"
|
|
161
|
+
@click=${() => {
|
|
162
|
+
changeConsent(true);
|
|
163
|
+
}}
|
|
164
|
+
>
|
|
165
|
+
${CheckboxEmpty}
|
|
166
|
+
</div>
|
|
167
|
+
<p>
|
|
168
|
+
I agree to the
|
|
169
|
+
<a
|
|
170
|
+
href=${privacyPolicyUrl}
|
|
171
|
+
target="_blank"
|
|
172
|
+
rel="noopener noreferrer"
|
|
173
|
+
class="privacy-policy-link"
|
|
174
|
+
>
|
|
175
|
+
privacy policy</a
|
|
176
|
+
>
|
|
177
|
+
and terms and conditions, Let's go!
|
|
178
|
+
</p>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>`;
|
|
182
|
+
}
|
|
183
|
+
return html` <div class="legal-confirmation-inner-container">
|
|
184
|
+
<div>${HeyThereEmoji()}</div>
|
|
185
|
+
<div>
|
|
186
|
+
<span style="font-weight: 600">Confirm to continue</span>
|
|
187
|
+
<p>
|
|
188
|
+
Hello, before I can answer questions for you, it's important that I let
|
|
189
|
+
you know that I am a third-party AI Assistant that will collect our
|
|
190
|
+
conversation and other information you provide, consistent with our
|
|
191
|
+
<a
|
|
192
|
+
href=${privacyPolicyUrl}
|
|
193
|
+
target="_blank"
|
|
194
|
+
rel="noopener noreferrer"
|
|
195
|
+
class="privacy-policy-link"
|
|
196
|
+
>
|
|
197
|
+
privacy policy</a
|
|
198
|
+
>.
|
|
199
|
+
</p>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<button
|
|
203
|
+
class="agreeButton"
|
|
204
|
+
@click=${() => {
|
|
205
|
+
changeConsent(true);
|
|
206
|
+
}}
|
|
207
|
+
>
|
|
208
|
+
I agree
|
|
209
|
+
</button>
|
|
210
|
+
</div>`;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const inChatThreadDisclaimer = ({
|
|
214
|
+
orgSlug,
|
|
215
|
+
buildingState,
|
|
216
|
+
type,
|
|
217
|
+
}: {
|
|
218
|
+
orgSlug: string;
|
|
219
|
+
buildingState: string | null;
|
|
220
|
+
type: "healthcare" | "utilities" | "leasing";
|
|
221
|
+
}): TemplateResult => {
|
|
222
|
+
if (type === "utilities") {
|
|
223
|
+
return html` <p class="utilities-disclaimer-inner">
|
|
224
|
+
By interacting with this system, you consent to
|
|
225
|
+
<a
|
|
226
|
+
href="http://bit.ly/me_privacy_policy"
|
|
227
|
+
target="_blank"
|
|
228
|
+
rel="noopener noreferrer"
|
|
229
|
+
>
|
|
230
|
+
this privacy policy</a
|
|
231
|
+
>
|
|
232
|
+
, including being contacted by AI or a human & having your conversation
|
|
233
|
+
recorded and used by a third party.
|
|
234
|
+
</p>`;
|
|
235
|
+
}
|
|
236
|
+
if (type === "healthcare") {
|
|
237
|
+
return html`
|
|
238
|
+
<p class="healthcare-disclaimer-inner">
|
|
239
|
+
By interacting with this system, you consent to
|
|
240
|
+
<a
|
|
241
|
+
href="http://bit.ly/me_privacy_policy"
|
|
242
|
+
target="_blank"
|
|
243
|
+
rel="noopener noreferrer"
|
|
244
|
+
>
|
|
245
|
+
this privacy policy
|
|
246
|
+
</a>
|
|
247
|
+
, including being contacted by AI or a human & having your conversation
|
|
248
|
+
recorded and used by a third party.
|
|
249
|
+
</p>
|
|
250
|
+
`;
|
|
251
|
+
}
|
|
252
|
+
if (type === "leasing") {
|
|
253
|
+
if (orgSlug === "avb") {
|
|
254
|
+
return html`
|
|
255
|
+
<li class="message-container disclaimer-message">
|
|
256
|
+
<p class="disclaimer-inner">
|
|
257
|
+
Chats may be recorded by us and our vendors.
|
|
258
|
+
</p>
|
|
259
|
+
</li>
|
|
260
|
+
`;
|
|
261
|
+
}
|
|
262
|
+
if (buildingState && buildingState.toUpperCase() === "UT") {
|
|
263
|
+
return html`
|
|
264
|
+
<li class="message-container disclaimer-message">
|
|
265
|
+
<p class="disclaimer-inner">
|
|
266
|
+
By interacting with this system, you consent to
|
|
267
|
+
<a
|
|
268
|
+
href="http://bit.ly/me_privacy_policy"
|
|
269
|
+
target="_blank"
|
|
270
|
+
rel="noopener noreferrer"
|
|
271
|
+
>
|
|
272
|
+
this privacy policy
|
|
273
|
+
</a>
|
|
274
|
+
and to interacting with generative AI or a human & having your
|
|
275
|
+
conversation recorded and used by a third party.
|
|
276
|
+
</p>
|
|
277
|
+
</li>
|
|
278
|
+
`;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return html`
|
|
282
|
+
<li class="message-container disclaimer-message">
|
|
283
|
+
<p class="disclaimer-inner">
|
|
284
|
+
By interacting with this system, you consent to
|
|
285
|
+
<a
|
|
286
|
+
href="http://bit.ly/me_privacy_policy"
|
|
287
|
+
target="_blank"
|
|
288
|
+
rel="noopener noreferrer"
|
|
289
|
+
>
|
|
290
|
+
this privacy policy
|
|
291
|
+
</a>
|
|
292
|
+
, including being contacted by AI or a human & having your
|
|
293
|
+
conversation recorded and used by a third party.
|
|
294
|
+
</p>
|
|
295
|
+
</li>
|
|
296
|
+
`;
|
|
297
|
+
}
|
|
298
|
+
return html``;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export default formDisclaimer;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
state: string | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type UnitV2 = {
|
|
49
|
+
name: string;
|
|
50
|
+
layout: string;
|
|
51
|
+
availabilityStage: number;
|
|
52
|
+
active: number;
|
|
53
|
+
occupied: boolean;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Load the publicly-available info for a building.
|
|
58
|
+
* @deprecated Use fetchBuildingAndConfig instead.
|
|
59
|
+
* @param orgSlug - The org slug, e.g. "big-prop-co"
|
|
60
|
+
* @param buildingSlug - The buidling slug, e.g. "gravity-falls"
|
|
61
|
+
* @returns The building's ID, name, theme, and agent.
|
|
62
|
+
*/
|
|
63
|
+
export default async function fetchBuildingInfo(
|
|
64
|
+
orgSlug: string,
|
|
65
|
+
buildingSlug: string
|
|
66
|
+
): Promise<Building> {
|
|
67
|
+
const host = "https://app.meetelise.com";
|
|
68
|
+
const buildingUrl = `${host}/api/pub/v1/organization/${orgSlug}/building/${buildingSlug}`;
|
|
69
|
+
|
|
70
|
+
const buildingResponse = await axios.get(buildingUrl);
|
|
71
|
+
|
|
72
|
+
const building: Building = buildingResponse.data;
|
|
73
|
+
try {
|
|
74
|
+
building.welcomeMessage = replaceName(
|
|
75
|
+
building.welcomeMessage ?? "",
|
|
76
|
+
building.userFirstName
|
|
77
|
+
);
|
|
78
|
+
} catch (e) {
|
|
79
|
+
// eslint-disable-next-line no-console
|
|
80
|
+
console.error(e);
|
|
81
|
+
}
|
|
82
|
+
return building;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const replaceName = (originalText: string, newName: string) => {
|
|
86
|
+
const regex = /elise/gi;
|
|
87
|
+
return originalText.replace(regex, newName);
|
|
88
|
+
};
|