@meetelise/chat 1.30.4 → 1.31.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.
Files changed (44) hide show
  1. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +1 -1
  2. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +1 -1
  3. package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.d.ts +1 -0
  4. package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.d.ts +8 -0
  5. package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/index.d.ts +1 -0
  6. package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +2 -3
  7. package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +2 -0
  8. package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +1 -0
  9. package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +5 -1
  10. package/dist/src/WebComponent/launcher/Launcher.d.ts +1 -0
  11. package/dist/src/WebComponent/loaders/index.d.ts +4 -0
  12. package/dist/src/WebComponent/loaders/skeleton-card.d.ts +12 -0
  13. package/dist/src/WebComponent/loaders/skeleton-loader-styles.d.ts +3 -0
  14. package/dist/src/WebComponent/loaders/skeleton-loader.d.ts +13 -0
  15. package/dist/src/fetchBuildingWebchatView.d.ts +1 -0
  16. package/dist/src/services/fees/fetchBuildingFees.d.ts +2 -0
  17. package/dist/src/types/incentive-v2.d.ts +23 -0
  18. package/package.json +1 -1
  19. package/public/dist/index.js +455 -299
  20. package/src/WebComponent/FeeCalculator/components/addon-item/addon-item.ts +2 -2
  21. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +19 -12
  22. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +5 -2
  23. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +11 -9
  24. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +1 -1
  25. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +9 -1
  26. package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.ts +40 -0
  27. package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.ts +43 -0
  28. package/src/WebComponent/FeeCalculator/components/incentive-banner/index.ts +1 -0
  29. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +50 -74
  30. package/src/WebComponent/FeeCalculator/fee-calculator.ts +22 -49
  31. package/src/WebComponent/FeeCalculator/model/building-fee.ts +2 -0
  32. package/src/WebComponent/Scheduler/tour-scheduler.ts +24 -7
  33. package/src/WebComponent/icons/DollarOutlineIcon.ts +11 -3
  34. package/src/WebComponent/launcher/Launcher.ts +3 -0
  35. package/src/WebComponent/loaders/index.ts +7 -0
  36. package/src/WebComponent/loaders/skeleton-card.ts +31 -0
  37. package/src/WebComponent/loaders/skeleton-loader-styles.ts +112 -0
  38. package/src/WebComponent/loaders/skeleton-loader.ts +34 -0
  39. package/src/WebComponent/me-chat.ts +2 -0
  40. package/src/fetchBuildingWebchatView.ts +20 -0
  41. package/src/services/fees/fetchBuildingFees.ts +4 -0
  42. package/src/types/incentive-v2.ts +24 -0
  43. /package/dist/src/WebComponent/{mega-loader.d.ts → loaders/mega-loader.d.ts} +0 -0
  44. /package/src/WebComponent/{mega-loader.ts → loaders/mega-loader.ts} +0 -0
@@ -42,6 +42,7 @@ import { getShouldAllowScheduling } from "../../getShouldAllowScheduling";
42
42
  import { TourVirtuallyIcon } from "../icons/TourVirtuallyIcon";
43
43
  import { TourSelfGuidedIcon } from "../icons/TourSelfGuidedIcon";
44
44
  import { TourWithAgentIcon } from "../icons/TourWithAgentIcon";
45
+ import { shouldOpenTourLink } from "../../fetchBuildingWebchatView";
45
46
 
46
47
  @customElement("tour-scheduler")
47
48
  export class TourScheduler extends LitElement {
@@ -64,6 +65,8 @@ export class TourScheduler extends LitElement {
64
65
  @property({ attribute: true })
65
66
  virtualToursLink = "";
66
67
  @property({ attribute: true })
68
+ virtualToursTypeOffered = "";
69
+ @property({ attribute: true })
67
70
  orgSlug = "";
68
71
  @property({ attribute: true })
69
72
  hasDynamicSchedulingEnabled = false;
@@ -620,8 +623,10 @@ export class TourScheduler extends LitElement {
620
623
  this.tourType = TourType.Self;
621
624
  if (
622
625
  this.sgtUrl &&
623
- this.selfGuidedToursTypeOffered !==
624
- "SCHEDULED_BY_ME_MANAGED_BY_ME"
626
+ shouldOpenTourLink(
627
+ TourType.Self,
628
+ this.selfGuidedToursTypeOffered
629
+ )
625
630
  ) {
626
631
  window.open(this.sgtUrl, "_blank");
627
632
  }
@@ -689,7 +694,13 @@ export class TourScheduler extends LitElement {
689
694
  .backgroundColor=${this.backgroundColor}
690
695
  @click="${async () => {
691
696
  this.tourType = TourType.Virtual;
692
- if (this.virtualToursLink) {
697
+ if (
698
+ this.virtualToursLink &&
699
+ shouldOpenTourLink(
700
+ TourType.Virtual,
701
+ this.virtualToursTypeOffered
702
+ )
703
+ ) {
693
704
  window.open(this.virtualToursLink, "_blank");
694
705
  }
695
706
  this.availabilitiesGroupedByDay =
@@ -719,7 +730,7 @@ export class TourScheduler extends LitElement {
719
730
  if (
720
731
  this.tourType === TourType.Self &&
721
732
  this.sgtUrl &&
722
- this.selfGuidedToursTypeOffered !== "SCHEDULED_BY_ME_MANAGED_BY_ME"
733
+ shouldOpenTourLink(this.tourType, this.selfGuidedToursTypeOffered)
723
734
  ) {
724
735
  return html`<h2 class="journey-header">Date and Time</h2>
725
736
  <div id="dateAndTimeMenu">
@@ -745,8 +756,10 @@ export class TourScheduler extends LitElement {
745
756
  if (
746
757
  this.tourType === TourType.Self &&
747
758
  this.sgtUrl &&
748
- this.selfGuidedToursTypeOffered !==
749
- "SCHEDULED_BY_ME_MANAGED_BY_ME"
759
+ shouldOpenTourLink(
760
+ this.tourType,
761
+ this.selfGuidedToursTypeOffered
762
+ )
750
763
  ) {
751
764
  window.open(this.sgtUrl, "_blank");
752
765
  return;
@@ -755,7 +768,11 @@ export class TourScheduler extends LitElement {
755
768
  window.open(this.escortedToursLink, "_blank");
756
769
  return;
757
770
  }
758
- if (this.tourType === TourType.Virtual && this.virtualToursLink) {
771
+ if (
772
+ this.tourType === TourType.Virtual &&
773
+ this.virtualToursLink &&
774
+ shouldOpenTourLink(this.tourType, this.virtualToursTypeOffered)
775
+ ) {
759
776
  window.open(this.virtualToursLink, "_blank");
760
777
  return;
761
778
  }
@@ -1,7 +1,15 @@
1
1
  import { svg, SVGTemplateResult } from "lit";
2
2
 
3
- const DollarOutlineIcon = (color = "#347FF7"): SVGTemplateResult => svg`
4
- <svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ type DollarOutlineIconProps = {
4
+ color?: string;
5
+ size?: number;
6
+ };
7
+
8
+ const DollarOutlineIcon = ({
9
+ color = "#347FF7",
10
+ size = 24,
11
+ }: DollarOutlineIconProps = {}): SVGTemplateResult => svg`
12
+ <svg width="${size}" height="${size}" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
5
13
  <g id="Frame" clip-path="url(#clip0_18718_332018)">
6
14
  <path id="Vector" d="M3 12.5C3 13.6819 3.23279 14.8522 3.68508 15.9442C4.13738 17.0361 4.80031 18.0282 5.63604 18.864C6.47177 19.6997 7.46392 20.3626 8.55585 20.8149C9.64778 21.2672 10.8181 21.5 12 21.5C13.1819 21.5 14.3522 21.2672 15.4442 20.8149C16.5361 20.3626 17.5282 19.6997 18.364 18.864C19.1997 18.0282 19.8626 17.0361 20.3149 15.9442C20.7672 14.8522 21 13.6819 21 12.5C21 11.3181 20.7672 10.1478 20.3149 9.05585C19.8626 7.96392 19.1997 6.97177 18.364 6.13604C17.5282 5.30031 16.5361 4.63738 15.4442 4.18508C14.3522 3.73279 13.1819 3.5 12 3.5C10.8181 3.5 9.64778 3.73279 8.55585 4.18508C7.46392 4.63738 6.47177 5.30031 5.63604 6.13604C4.80031 6.97177 4.13738 7.96392 3.68508 9.05585C3.23279 10.1478 3 11.3181 3 12.5Z" stroke="${color}" stroke-linecap="round" stroke-linejoin="round"/>
7
15
  <path id="Vector_2" d="M14.8 9.50016C14.6188 9.18592 14.3557 8.92686 14.0386 8.75071C13.7215 8.57456 13.3625 8.48795 13 8.50016H11C10.4696 8.50016 9.96086 8.71087 9.58579 9.08594C9.21071 9.46102 9 9.96972 9 10.5002C9 11.0306 9.21071 11.5393 9.58579 11.9144C9.96086 12.2894 10.4696 12.5002 11 12.5002H13C13.5304 12.5002 14.0391 12.7109 14.4142 13.0859C14.7893 13.461 15 13.9697 15 14.5002C15 15.0306 14.7893 15.5393 14.4142 15.9144C14.0391 16.2894 13.5304 16.5002 13 16.5002H11C10.6375 16.5124 10.2785 16.4258 9.96142 16.2496C9.64435 16.0735 9.38115 15.8144 9.2 15.5002" stroke="${color}" stroke-linecap="round" stroke-linejoin="round"/>
@@ -9,7 +17,7 @@ const DollarOutlineIcon = (color = "#347FF7"): SVGTemplateResult => svg`
9
17
  </g>
10
18
  <defs>
11
19
  <clipPath id="clip0_18718_332018">
12
- <rect width="24" height="24" fill="white" transform="translate(0 0.5)"/>
20
+ <rect width="${size}" height="${size}" fill="white" transform="translate(0 0.5)"/>
13
21
  </clipPath>
14
22
  </defs>
15
23
  </svg>
@@ -96,6 +96,8 @@ export class Launcher extends LitElement {
96
96
  escortedToursLink = "";
97
97
  @property({ attribute: true })
98
98
  virtualToursLink = "";
99
+ @property({ attribute: true })
100
+ virtualToursTypeOffered = "";
99
101
 
100
102
  @property({ type: Boolean })
101
103
  hasChatEnabledDesktop = false;
@@ -1193,6 +1195,7 @@ export class Launcher extends LitElement {
1193
1195
  selfGuidedToursTypeOffered="${this.selfGuidedToursTypeOffered}"
1194
1196
  escortedToursLink="${this.escortedToursLink}"
1195
1197
  virtualToursLink="${this.virtualToursLink}"
1198
+ virtualToursTypeOffered="${this.virtualToursTypeOffered}"
1196
1199
  currentLeadSource="${this.currentLeadSource}"
1197
1200
  .hasDynamicSchedulingEnabled=${this.hasDynamicSchedulingEnabled}
1198
1201
  .leadSources="${this.leadSources}"
@@ -0,0 +1,7 @@
1
+ export * from "./skeleton-loader";
2
+ export * from "./skeleton-card";
3
+ export * from "./mega-loader";
4
+ export {
5
+ skeletonLoaderStyles,
6
+ skeletonCardStyles,
7
+ } from "./skeleton-loader-styles";
@@ -0,0 +1,31 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { skeletonCardStyles } from "./skeleton-loader-styles";
4
+
5
+ @customElement("skeleton-card")
6
+ export class SkeletonCard extends LitElement {
7
+ static styles = skeletonCardStyles;
8
+
9
+ @property({ type: Number })
10
+ rows = 2;
11
+
12
+ @property({ type: Boolean })
13
+ header = true;
14
+
15
+ render(): TemplateResult {
16
+ return html`
17
+ <div class="skeleton-card">
18
+ ${this.header ? html`<div class="skeleton-header"></div>` : ""}
19
+ ${Array(this.rows)
20
+ .fill(0)
21
+ .map(() => html`<div class="skeleton-row"></div>`)}
22
+ </div>
23
+ `;
24
+ }
25
+ }
26
+
27
+ declare global {
28
+ interface HTMLElementTagNameMap {
29
+ "skeleton-card": SkeletonCard;
30
+ }
31
+ }
@@ -0,0 +1,112 @@
1
+ import { css } from "lit";
2
+
3
+ const skeletonBase = css`
4
+ :host {
5
+ --skeleton-bg-color: #eaeaea;
6
+ --skeleton-highlight-color: #f5f5f5;
7
+ }
8
+
9
+ @keyframes shimmer {
10
+ 0% {
11
+ background-position: -200px 0;
12
+ }
13
+ 100% {
14
+ background-position: 200px 0;
15
+ }
16
+ }
17
+ `;
18
+
19
+ export const skeletonCardStyles = css`
20
+ ${skeletonBase}
21
+
22
+ :host {
23
+ display: block;
24
+ width: 100%;
25
+ }
26
+
27
+ .skeleton-card {
28
+ background-color: white;
29
+ border-radius: 4px;
30
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
31
+ padding: 16px;
32
+ width: 100%;
33
+ box-sizing: border-box;
34
+ }
35
+
36
+ .skeleton-header {
37
+ height: 24px;
38
+ width: 40%;
39
+ margin-bottom: 20px;
40
+ background: var(--skeleton-bg-color);
41
+ border-radius: 4px;
42
+ position: relative;
43
+ overflow: hidden;
44
+ animation: shimmer 2s infinite ease-in-out;
45
+ }
46
+
47
+ .skeleton-row {
48
+ height: 16px;
49
+ width: 100%;
50
+ background: var(--skeleton-bg-color);
51
+ border-radius: 4px;
52
+ margin-bottom: 12px;
53
+ position: relative;
54
+ overflow: hidden;
55
+ animation: shimmer 2s infinite ease-in-out;
56
+ }
57
+
58
+ .skeleton-row:last-child {
59
+ width: 70%;
60
+ }
61
+
62
+ .skeleton-header::after,
63
+ .skeleton-row::after {
64
+ content: "";
65
+ position: absolute;
66
+ top: 0;
67
+ left: 0;
68
+ width: 100%;
69
+ height: 100%;
70
+ background: linear-gradient(
71
+ 90deg,
72
+ var(--skeleton-bg-color),
73
+ var(--skeleton-highlight-color),
74
+ var(--skeleton-bg-color)
75
+ );
76
+ background-size: 200px 100%;
77
+ animation: shimmer 2s infinite ease-in-out;
78
+ }
79
+
80
+ @media (max-width: 768px) {
81
+ .skeleton-card {
82
+ margin-bottom: 10px;
83
+ }
84
+ }
85
+ `;
86
+
87
+ export const skeletonLoaderStyles = css`
88
+ ${skeletonBase}
89
+
90
+ :host {
91
+ display: block;
92
+ width: 100%;
93
+ }
94
+
95
+ .skeleton-loader {
96
+ width: 100%;
97
+ display: flex;
98
+ flex-direction: column;
99
+ gap: 16px;
100
+ box-sizing: border-box;
101
+ }
102
+
103
+ @media (max-width: 768px) {
104
+ .skeleton-loader {
105
+ width: 100%;
106
+ padding: 0 10px;
107
+ box-sizing: border-box;
108
+ }
109
+ }
110
+ `;
111
+
112
+ export default skeletonLoaderStyles;
@@ -0,0 +1,34 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { skeletonLoaderStyles } from "./skeleton-loader-styles";
4
+ import "./skeleton-card";
5
+
6
+ @customElement("skeleton-loader")
7
+ export class SkeletonLoader extends LitElement {
8
+ static styles = skeletonLoaderStyles;
9
+
10
+ @property({ type: Number })
11
+ cards = 3;
12
+
13
+ @property({ type: Array })
14
+ rowsPerCard = [3, 2, 1];
15
+
16
+ render(): TemplateResult {
17
+ return html`
18
+ <div class="skeleton-loader">
19
+ ${Array.from({ length: this.cards }, (_, i) => {
20
+ const rowCount = Array.isArray(this.rowsPerCard)
21
+ ? this.rowsPerCard[i] || 2
22
+ : this.rowsPerCard;
23
+ return html`<skeleton-card .rows=${rowCount}></skeleton-card>`;
24
+ })}
25
+ </div>
26
+ `;
27
+ }
28
+ }
29
+
30
+ declare global {
31
+ interface HTMLElementTagNameMap {
32
+ "skeleton-loader": SkeletonLoader;
33
+ }
34
+ }
@@ -926,6 +926,8 @@ export class MEChat extends LitElement {
926
926
  ?.escortedToursLink ?? ""}"
927
927
  virtualToursLink="${this.buildingWebchatView
928
928
  ?.virtualToursLink ?? ""}"
929
+ virtualToursTypeOffered="${this.buildingWebchatView
930
+ .virtualToursTypeOffered ?? ""}"
929
931
  .showTourNextToChat="${this.showTourNextToChat ?? ""}"
930
932
  @closeShowTourNextToChat=${() => {
931
933
  this.showTourNextToChat = false;
@@ -28,6 +28,26 @@ enum TourAccessType {
28
28
  SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE = "scheduled_by_ME_managed_by_concierge",
29
29
  }
30
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
+
31
51
  export interface LayoutOption {
32
52
  value: number;
33
53
  label: string;
@@ -3,10 +3,12 @@ import { LogType, sendLoggingEvent } from "../../analytics";
3
3
  import { BASE_DOMAIN } from "../../globals";
4
4
  import { BuildingFee } from "../../WebComponent/FeeCalculator/model/building-fee";
5
5
  import { camelize } from "../../utils";
6
+ import { IncentiveV2 } from "../../types/incentive-v2";
6
7
 
7
8
  type BuildingFeeResponse = {
8
9
  fees: BuildingFee[];
9
10
  rentableItems: RentableItemSummary[];
11
+ buildingIncentives: IncentiveV2[];
10
12
  };
11
13
 
12
14
  export type RentFrequency = "monthly" | "annually";
@@ -41,6 +43,7 @@ const fetchBuildingFees = async (
41
43
  return {
42
44
  fees: data.fees.map(toBuildingFeeClass),
43
45
  rentableItems: data.rentableItems,
46
+ buildingIncentives: data.buildingIncentives,
44
47
  };
45
48
  }
46
49
  } catch (error) {
@@ -55,6 +58,7 @@ const fetchBuildingFees = async (
55
58
  return {
56
59
  fees: [],
57
60
  rentableItems: [],
61
+ buildingIncentives: [],
58
62
  };
59
63
  };
60
64
 
@@ -0,0 +1,24 @@
1
+ export type UnitData = {
2
+ unitIds: number[];
3
+ unitNumbers: string[];
4
+ layouts: number[];
5
+ floorplanNames: string[];
6
+ };
7
+
8
+ export type IncentiveV2 = {
9
+ id: number;
10
+ originalIncentiveString: string;
11
+ startDate: Date;
12
+ endDate: Date;
13
+ incentiveStatus: string;
14
+ source: string;
15
+ timeCreated: Date;
16
+ nofee: boolean;
17
+ numberOfFreeMonths: number;
18
+ leaseLength: number;
19
+ typeOfCustomerItAppliesTo: number;
20
+ typeOfIncentive: number;
21
+ numberOfMonthsOwnerPays: number;
22
+ unitData: UnitData;
23
+ qualifier: string;
24
+ };