@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.
Files changed (282) hide show
  1. package/dist/src/MyPubnub.d.ts +116 -0
  2. package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.d.ts +2 -0
  3. package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.d.ts +28 -0
  4. package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.d.ts +2 -0
  5. package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.d.ts +18 -0
  6. package/dist/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.d.ts +2 -0
  7. package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.d.ts +2 -0
  8. package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.d.ts +22 -0
  9. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.d.ts +2 -0
  10. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +46 -0
  11. package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.d.ts +2 -0
  12. package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card.d.ts +21 -0
  13. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +2 -0
  14. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +13 -0
  15. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +2 -0
  16. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +34 -0
  17. package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.d.ts +2 -0
  18. package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +18 -0
  19. package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.d.ts +1 -0
  20. package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.d.ts +8 -0
  21. package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/index.d.ts +1 -0
  22. package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +5 -0
  23. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +2 -0
  24. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +13 -0
  25. package/dist/src/WebComponent/FeeCalculator/constants.d.ts +3 -0
  26. package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +1 -0
  27. package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +55 -0
  28. package/dist/src/WebComponent/FeeCalculator/index.d.ts +2 -0
  29. package/dist/src/WebComponent/FeeCalculator/model/building-fee-view.d.ts +41 -0
  30. package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +82 -0
  31. package/dist/src/WebComponent/FeeCalculator/model/desired-addon.d.ts +5 -0
  32. package/dist/src/WebComponent/FeeCalculator/model/desired-rentable-item.d.ts +4 -0
  33. package/dist/src/WebComponent/FeeCalculator/model/index.d.ts +13 -0
  34. package/dist/src/WebComponent/FeeCalculator/model/item-combination.d.ts +6 -0
  35. package/dist/src/WebComponent/FeeCalculator/model/item-quantity.d.ts +4 -0
  36. package/dist/src/WebComponent/FeeCalculator/model/pricing-matrix.d.ts +18 -0
  37. package/dist/src/WebComponent/FeeCalculator/model/pricing-rule.d.ts +8 -0
  38. package/dist/src/WebComponent/FeeCalculator/model/rent-frequency.d.ts +1 -0
  39. package/dist/src/WebComponent/FeeCalculator/model/rentable-item-summary.d.ts +13 -0
  40. package/dist/src/WebComponent/FeeCalculator/model/rentable-item.d.ts +10 -0
  41. package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +23 -0
  42. package/dist/src/WebComponent/FeeCalculator/model/unit-fee-bundle.d.ts +31 -0
  43. package/dist/src/WebComponent/LeadSourceClient.d.ts +46 -0
  44. package/dist/src/WebComponent/OfficeHours.d.ts +21 -0
  45. package/dist/src/WebComponent/Scheduler/date-picker.d.ts +28 -0
  46. package/dist/src/WebComponent/Scheduler/time-picker.d.ts +16 -0
  47. package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +102 -0
  48. package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +13 -0
  49. package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +1 -0
  50. package/dist/src/WebComponent/actions/InputStyles.d.ts +1 -0
  51. package/dist/src/WebComponent/actions/action-confirm-button.d.ts +13 -0
  52. package/dist/src/WebComponent/actions/call-us-window.d.ts +37 -0
  53. package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +8 -0
  54. package/dist/src/WebComponent/actions/details-window.d.ts +14 -0
  55. package/dist/src/WebComponent/actions/email-us-window.d.ts +46 -0
  56. package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +17 -0
  57. package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +8 -0
  58. package/dist/src/WebComponent/chat-additional-actions.d.ts +28 -0
  59. package/dist/src/WebComponent/health-chat.d.ts +47 -0
  60. package/dist/src/WebComponent/healthchat-styles.d.ts +1 -0
  61. package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +2 -0
  62. package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +2 -0
  63. package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +2 -0
  64. package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +2 -0
  65. package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +2 -0
  66. package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +2 -0
  67. package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +2 -0
  68. package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +7 -0
  69. package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +2 -0
  70. package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +2 -0
  71. package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +2 -0
  72. package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +3 -0
  73. package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +2 -0
  74. package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +2 -0
  75. package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +2 -0
  76. package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +2 -0
  77. package/dist/src/WebComponent/index.d.ts +2 -0
  78. package/dist/src/WebComponent/launcher/Launcher.d.ts +99 -0
  79. package/dist/src/WebComponent/launcher/launcherStyles.d.ts +1 -0
  80. package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +27 -0
  81. package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +1 -0
  82. package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +1 -0
  83. package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +1 -0
  84. package/dist/src/WebComponent/leasing-chat-styles.d.ts +1 -0
  85. package/dist/src/WebComponent/loaders/index.d.ts +4 -0
  86. package/dist/src/WebComponent/loaders/mega-loader.d.ts +7 -0
  87. package/dist/src/WebComponent/loaders/skeleton-card.d.ts +12 -0
  88. package/dist/src/WebComponent/loaders/skeleton-loader-styles.d.ts +3 -0
  89. package/dist/src/WebComponent/loaders/skeleton-loader.d.ts +13 -0
  90. package/dist/src/WebComponent/me-chat.d.ts +91 -0
  91. package/dist/src/WebComponent/me-select.d.ts +24 -0
  92. package/dist/src/WebComponent/mini-loader.d.ts +5 -0
  93. package/dist/src/WebComponent/pubnub-chat-styles.d.ts +1 -0
  94. package/dist/src/WebComponent/pubnub-chat.d.ts +48 -0
  95. package/dist/src/WebComponent/pubnub-media.d.ts +14 -0
  96. package/dist/src/WebComponent/pubnub-message-styles.d.ts +1 -0
  97. package/dist/src/WebComponent/pubnub-message.d.ts +39 -0
  98. package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +1 -0
  99. package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +12 -0
  100. package/dist/src/WebComponent/utilities-chat.d.ts +47 -0
  101. package/dist/src/WebComponent/utilities-styles.d.ts +1 -0
  102. package/dist/src/WebComponent/utils.d.ts +31 -0
  103. package/dist/src/analytics.d.ts +64 -0
  104. package/dist/src/disclaimers.d.ts +16 -0
  105. package/dist/src/fetchBuildingABTestType.d.ts +8 -0
  106. package/dist/src/fetchBuildingInfo.d.ts +58 -0
  107. package/dist/src/fetchBuildingWebchatView.d.ts +124 -0
  108. package/dist/src/fetchFeatureFlag.d.ts +14 -0
  109. package/dist/src/fetchLeadSources.d.ts +4 -0
  110. package/dist/src/fetchPhoneNumberFromSource.d.ts +6 -0
  111. package/dist/src/getAvailabilities.d.ts +46 -0
  112. package/dist/src/getBuildingPhoneNumber.d.ts +1 -0
  113. package/dist/src/getShouldAllowScheduling.d.ts +1 -0
  114. package/dist/src/getShouldShowWebchat.d.ts +3 -0
  115. package/dist/src/getTimezoneString.d.ts +1 -0
  116. package/dist/src/globals.d.ts +2 -0
  117. package/dist/src/gtm.d.ts +6 -0
  118. package/dist/src/handleChatId.d.ts +11 -0
  119. package/dist/src/insertDNIIntoWebsite.d.ts +5 -0
  120. package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +4 -0
  121. package/dist/src/main/MEChat.d.ts +74 -0
  122. package/dist/src/main/utils.d.ts +2 -0
  123. package/dist/src/postLeadSources.d.ts +3 -0
  124. package/dist/src/rentgrata.d.ts +4 -0
  125. package/dist/src/replaceSelectButtonsWithNewLink.d.ts +5 -0
  126. package/dist/src/services/fees/calculateQuote.d.ts +14 -0
  127. package/dist/src/services/fees/fetchBuildingFeesV2.d.ts +10 -0
  128. package/dist/src/services/fees/fetchBuildingUnits.d.ts +29 -0
  129. package/dist/src/services/fees/utils.d.ts +1 -0
  130. package/dist/src/svgIcons.d.ts +5 -0
  131. package/dist/src/themes.d.ts +5 -0
  132. package/dist/src/types/incentive-v2.d.ts +23 -0
  133. package/dist/src/types/rest-sdk.types.d.ts +11 -0
  134. package/dist/src/types/webchat-no-show-reason.d.ts +1 -0
  135. package/dist/src/utils/getWidgetOverrides.d.ts +39 -0
  136. package/dist/src/utils/queryParamBuilder.d.ts +8 -0
  137. package/dist/src/utils.d.ts +13 -0
  138. package/package.json +1 -1
  139. package/public/dist/index.js +250 -164
  140. package/src/MyPubnub.ts +792 -0
  141. package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.ts +39 -0
  142. package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.ts +206 -0
  143. package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.ts +6 -0
  144. package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.ts +101 -0
  145. package/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.ts +98 -0
  146. package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.ts +9 -0
  147. package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.ts +136 -0
  148. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +151 -0
  149. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +261 -0
  150. package/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.ts +65 -0
  151. package/src/WebComponent/FeeCalculator/components/fee-card/fee-card.ts +91 -0
  152. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +44 -0
  153. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +38 -0
  154. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +149 -0
  155. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +247 -0
  156. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +82 -0
  157. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +76 -0
  158. package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.ts +40 -0
  159. package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.ts +43 -0
  160. package/src/WebComponent/FeeCalculator/components/incentive-banner/index.ts +1 -0
  161. package/src/WebComponent/FeeCalculator/components/index.ts +5 -0
  162. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +39 -0
  163. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +39 -0
  164. package/src/WebComponent/FeeCalculator/constants.ts +5 -0
  165. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +310 -0
  166. package/src/WebComponent/FeeCalculator/fee-calculator.ts +341 -0
  167. package/src/WebComponent/FeeCalculator/index.ts +4 -0
  168. package/src/WebComponent/FeeCalculator/model/building-fee-view.ts +84 -0
  169. package/src/WebComponent/FeeCalculator/model/building-fee.ts +126 -0
  170. package/src/WebComponent/FeeCalculator/model/desired-addon.ts +6 -0
  171. package/src/WebComponent/FeeCalculator/model/desired-rentable-item.ts +4 -0
  172. package/src/WebComponent/FeeCalculator/model/index.ts +13 -0
  173. package/src/WebComponent/FeeCalculator/model/item-combination.ts +16 -0
  174. package/src/WebComponent/FeeCalculator/model/item-quantity.ts +4 -0
  175. package/src/WebComponent/FeeCalculator/model/pricing-matrix.ts +45 -0
  176. package/src/WebComponent/FeeCalculator/model/pricing-rule.ts +9 -0
  177. package/src/WebComponent/FeeCalculator/model/rent-frequency.ts +1 -0
  178. package/src/WebComponent/FeeCalculator/model/rentable-item-summary.ts +34 -0
  179. package/src/WebComponent/FeeCalculator/model/rentable-item.ts +21 -0
  180. package/src/WebComponent/FeeCalculator/model/transaction-category.ts +23 -0
  181. package/src/WebComponent/FeeCalculator/model/unit-fee-bundle.ts +54 -0
  182. package/src/WebComponent/LeadSourceClient.ts +332 -0
  183. package/src/WebComponent/MEChat.css +5 -0
  184. package/src/WebComponent/OfficeHours.ts +73 -0
  185. package/src/WebComponent/Scheduler/date-picker.ts +405 -0
  186. package/src/WebComponent/Scheduler/time-picker.ts +195 -0
  187. package/src/WebComponent/Scheduler/tour-scheduler.ts +1430 -0
  188. package/src/WebComponent/Scheduler/tour-type-option.ts +112 -0
  189. package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +418 -0
  190. package/src/WebComponent/actions/InputStyles.ts +57 -0
  191. package/src/WebComponent/actions/action-confirm-button.ts +125 -0
  192. package/src/WebComponent/actions/call-us-window.ts +467 -0
  193. package/src/WebComponent/actions/collapse-expand-button.ts +65 -0
  194. package/src/WebComponent/actions/details-window.ts +150 -0
  195. package/src/WebComponent/actions/email-us-window.ts +556 -0
  196. package/src/WebComponent/actions/formatPhoneNumber.ts +72 -0
  197. package/src/WebComponent/actions/minimize-expand-button.ts +93 -0
  198. package/src/WebComponent/chat-additional-actions.ts +135 -0
  199. package/src/WebComponent/health-chat.ts +270 -0
  200. package/src/WebComponent/healthchat-styles.ts +119 -0
  201. package/src/WebComponent/icons/ApplyOutlineIcon.ts +22 -0
  202. package/src/WebComponent/icons/BookTourOutlineIcon.ts +13 -0
  203. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +80 -0
  204. package/src/WebComponent/icons/ChatOutlineIcon.ts +10 -0
  205. package/src/WebComponent/icons/ChevronLeftIcon.ts +7 -0
  206. package/src/WebComponent/icons/ChevronRightIcon.ts +7 -0
  207. package/src/WebComponent/icons/ContactResidentIcon.ts +9 -0
  208. package/src/WebComponent/icons/DollarOutlineIcon.ts +26 -0
  209. package/src/WebComponent/icons/EmailOutlineIcon.ts +7 -0
  210. package/src/WebComponent/icons/HeyThereEmojiIcon.ts +12 -0
  211. package/src/WebComponent/icons/PhoneOutlineIcon.ts +7 -0
  212. package/src/WebComponent/icons/SendMessageIcon.ts +17 -0
  213. package/src/WebComponent/icons/TourSelfGuidedIcon.ts +17 -0
  214. package/src/WebComponent/icons/TourVirtuallyIcon.ts +17 -0
  215. package/src/WebComponent/icons/TourWithAgentIcon.ts +17 -0
  216. package/src/WebComponent/icons/XOutlineIcon.ts +8 -0
  217. package/src/WebComponent/index.ts +2 -0
  218. package/src/WebComponent/launcher/Launcher.ts +1284 -0
  219. package/src/WebComponent/launcher/launcherStyles.ts +500 -0
  220. package/src/WebComponent/launcher/mobile-launcher.ts +162 -0
  221. package/src/WebComponent/launcher/typeEmojiStyles.ts +161 -0
  222. package/src/WebComponent/launcher/typeMiniStyles.ts +60 -0
  223. package/src/WebComponent/launcher/typeMobileStyles.ts +50 -0
  224. package/src/WebComponent/leasing-chat-styles.ts +114 -0
  225. package/src/WebComponent/loaders/index.ts +7 -0
  226. package/src/WebComponent/loaders/mega-loader.ts +36 -0
  227. package/src/WebComponent/loaders/skeleton-card.ts +31 -0
  228. package/src/WebComponent/loaders/skeleton-loader-styles.ts +112 -0
  229. package/src/WebComponent/loaders/skeleton-loader.ts +34 -0
  230. package/src/WebComponent/me-chat.ts +1264 -0
  231. package/src/WebComponent/me-select.ts +322 -0
  232. package/src/WebComponent/mini-loader.ts +28 -0
  233. package/src/WebComponent/pubnub-chat-styles.ts +204 -0
  234. package/src/WebComponent/pubnub-chat.ts +771 -0
  235. package/src/WebComponent/pubnub-media.ts +208 -0
  236. package/src/WebComponent/pubnub-message-styles.ts +54 -0
  237. package/src/WebComponent/pubnub-message.ts +431 -0
  238. package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +34 -0
  239. package/src/WebComponent/simple-launcher/simple-launcher.ts +100 -0
  240. package/src/WebComponent/utilities-chat.ts +270 -0
  241. package/src/WebComponent/utilities-styles.ts +110 -0
  242. package/src/WebComponent/utils.ts +82 -0
  243. package/src/analytics.ts +217 -0
  244. package/src/assetUrls.ts +6 -0
  245. package/src/disclaimers.ts +301 -0
  246. package/src/fetchBuildingABTestType.ts +21 -0
  247. package/src/fetchBuildingInfo.ts +88 -0
  248. package/src/fetchBuildingWebchatView.ts +176 -0
  249. package/src/fetchFeatureFlag.ts +250 -0
  250. package/src/fetchLeadSources.ts +98 -0
  251. package/src/fetchPhoneNumberFromSource.ts +31 -0
  252. package/src/fetchWebchatPreferences.ts +54 -0
  253. package/src/getAvailabilities.ts +189 -0
  254. package/src/getBuildingPhoneNumber.ts +26 -0
  255. package/src/getShouldAllowScheduling.ts +16 -0
  256. package/src/getShouldShowWebchat.ts +114 -0
  257. package/src/getTimezoneString.ts +40 -0
  258. package/src/globals.ts +3 -0
  259. package/src/gtm.ts +17 -0
  260. package/src/handleChatId.ts +101 -0
  261. package/src/insertDNIIntoWebsite.ts +146 -0
  262. package/src/insertLeadSourceIntoSchedulerLinks.ts +71 -0
  263. package/src/main/MEChat.test.ts +110 -0
  264. package/src/main/MEChat.ts +404 -0
  265. package/src/main/utils.ts +70 -0
  266. package/src/postLeadSources.ts +44 -0
  267. package/src/rentgrata.ts +74 -0
  268. package/src/replaceSelectButtonsWithNewLink.ts +91 -0
  269. package/src/services/fees/calculateQuote.ts +74 -0
  270. package/src/services/fees/fetchBuildingFees.ts +50 -0
  271. package/src/services/fees/fetchBuildingFeesV2.ts +59 -0
  272. package/src/services/fees/fetchBuildingFloorplans.ts +74 -0
  273. package/src/services/fees/fetchBuildingUnits.ts +86 -0
  274. package/src/services/fees/utils.ts +4 -0
  275. package/src/svgIcons.ts +14 -0
  276. package/src/themes.ts +65 -0
  277. package/src/types/incentive-v2.ts +24 -0
  278. package/src/types/rest-sdk.types.ts +13 -0
  279. package/src/types/webchat-no-show-reason.ts +6 -0
  280. package/src/utils/getWidgetOverrides.ts +91 -0
  281. package/src/utils/queryParamBuilder.ts +28 -0
  282. package/src/utils.ts +121 -0
@@ -0,0 +1,39 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import DollarOutlineIcon from "../../../icons/DollarOutlineIcon";
4
+
5
+ import promoCardStyles from "./promo-card-styles";
6
+
7
+ @customElement("promo-card")
8
+ export class PromoCard extends LitElement {
9
+ static styles = promoCardStyles;
10
+
11
+ @property({ type: String })
12
+ promoAmount = "0";
13
+
14
+ @property({ type: String })
15
+ promoDescription = "";
16
+
17
+ @property({ type: String })
18
+ promoValidity = "";
19
+
20
+ render(): TemplateResult {
21
+ return html`
22
+ <div class="promo-card">
23
+ <div class="icon-container">${DollarOutlineIcon()}</div>
24
+ <div class="content-container">
25
+ <h2 class="promo-heading">
26
+ ${this.promoAmount} ${this.promoDescription}
27
+ </h2>
28
+ <div class="promo-subtitle">${this.promoValidity}</div>
29
+ </div>
30
+ </div>
31
+ `;
32
+ }
33
+ }
34
+
35
+ declare global {
36
+ interface HTMLElementTagNameMap {
37
+ "promo-card": PromoCard;
38
+ }
39
+ }
@@ -0,0 +1,5 @@
1
+ export const ALL_LAYOUTS_OPTION = -1;
2
+
3
+ export const CALCULATE_DEBOUNCE_MS = 1000;
4
+
5
+ export const DEFAULT_LEASE_TERM = 12;
@@ -0,0 +1,310 @@
1
+ import { css } from "lit";
2
+
3
+ export const feeCalculatorStyles = css`
4
+ :host {
5
+ display: block;
6
+ position: relative;
7
+ }
8
+
9
+ .fee-calculator-container {
10
+ background-color: white;
11
+ border-radius: 8px;
12
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
13
+ padding: 20px;
14
+ height: 80vh;
15
+ width: 80vw;
16
+ display: flex;
17
+ flex-direction: column;
18
+ overflow: hidden;
19
+ transition: width 0.15s ease, height 0.15s ease, padding 0.15s ease,
20
+ margin 0.15s ease;
21
+ position: fixed;
22
+ top: 50%;
23
+ left: 50%;
24
+ transform: translate(-50%, -50%);
25
+ z-index: 1000;
26
+ }
27
+
28
+ .fee-calculator-container.compact {
29
+ padding: 12px;
30
+ max-width: 800px;
31
+ }
32
+
33
+ .calculator-header {
34
+ display: flex;
35
+ justify-content: space-between;
36
+ align-items: center;
37
+ margin-bottom: 12px;
38
+ transition: margin-bottom 0.15s ease, padding-top 0.15s ease;
39
+ }
40
+
41
+ .calculator-header h1 {
42
+ font-size: 1.2rem;
43
+ color: #333;
44
+ transition: font-size 0.15s ease;
45
+ }
46
+
47
+ .calculator-header-right {
48
+ display: flex;
49
+ gap: 10px;
50
+ align-items: center;
51
+ }
52
+
53
+ .calculator-header-divider {
54
+ height: 1px;
55
+ background-color: #e0e0e0;
56
+ transition: margin 0.15s ease;
57
+ }
58
+
59
+ .calculator-content {
60
+ flex: 1;
61
+ overflow-y: auto;
62
+ background-color: #f8f9fa;
63
+ min-height: 0;
64
+ transition: padding-top 0.15s ease, width 0.15s ease;
65
+ }
66
+
67
+ .incentives-container {
68
+ width: 100%;
69
+ display: flex;
70
+ flex-direction: column;
71
+ gap: 1px;
72
+ margin-bottom: 12px;
73
+ }
74
+
75
+ .incentive-banner {
76
+ width: 100%;
77
+ background-color: #e8f2ff;
78
+ padding: 12px 16px;
79
+ display: flex;
80
+ align-items: center;
81
+ gap: 12px;
82
+ }
83
+
84
+ .incentive-icon {
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: center;
88
+ height: 3rem;
89
+ width: 3rem;
90
+ }
91
+
92
+ .incentive-content {
93
+ flex: 1;
94
+ }
95
+
96
+ .incentive-title {
97
+ margin: 0;
98
+ font-size: 1.1rem;
99
+ }
100
+
101
+ .incentive-subtitle {
102
+ margin: 4px 0 0 0;
103
+ color: #868e96;
104
+ font-size: 0.9rem;
105
+ opacity: 0.9;
106
+ }
107
+
108
+ .close-button {
109
+ background: none;
110
+ border: none;
111
+ font-size: 24px;
112
+ cursor: pointer;
113
+ padding: 0;
114
+ margin: 0;
115
+ line-height: 1;
116
+ width: 30px;
117
+ height: 30px;
118
+ border-radius: 50%;
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ }
123
+
124
+ .close-button:hover {
125
+ background-color: #f0f0f0;
126
+ color: #000;
127
+ }
128
+
129
+ h1,
130
+ h2 {
131
+ margin-top: 0;
132
+ color: #333;
133
+ }
134
+
135
+ h1 {
136
+ font-size: 1.5rem;
137
+ margin: 0;
138
+ }
139
+
140
+ h2 {
141
+ font-size: 1.2rem;
142
+ margin-bottom: 8px;
143
+ }
144
+
145
+ .input-group {
146
+ margin-bottom: 16px;
147
+ }
148
+
149
+ label {
150
+ display: block;
151
+ margin-bottom: 6px;
152
+ font-weight: 500;
153
+ }
154
+
155
+ input {
156
+ width: 100%;
157
+ padding: 10px;
158
+ border: 1px solid #ddd;
159
+ border-radius: 4px;
160
+ font-size: 16px;
161
+ }
162
+
163
+ button {
164
+ background-color: #007bff;
165
+ color: white;
166
+ border: none;
167
+ border-radius: 4px;
168
+ padding: 10px 16px;
169
+ font-size: 16px;
170
+ cursor: pointer;
171
+ display: flex;
172
+ align-items: center;
173
+ justify-content: center;
174
+ gap: 8px;
175
+ transition: background-color 0.15s;
176
+ }
177
+
178
+ button:hover {
179
+ background-color: #0069d9;
180
+ }
181
+
182
+ button:disabled {
183
+ opacity: 0.7;
184
+ cursor: not-allowed;
185
+ }
186
+
187
+ .calculation-results {
188
+ margin-top: 24px;
189
+ padding-top: 16px;
190
+ border-top: 1px solid #eee;
191
+ }
192
+
193
+ .result-item {
194
+ display: flex;
195
+ justify-content: space-between;
196
+ margin-bottom: 8px;
197
+ padding-bottom: 8px;
198
+ border-bottom: 1px solid #eee;
199
+ color: #333;
200
+ }
201
+
202
+ .result-item:last-child {
203
+ border-bottom: none;
204
+ }
205
+
206
+ .result-item.total {
207
+ font-weight: bold;
208
+ font-size: 1.1em;
209
+ margin-top: 8px;
210
+ padding-top: 8px;
211
+ border-top: 1px solid #eee;
212
+ }
213
+
214
+ .error-message {
215
+ color: #dc3545;
216
+ text-align: center;
217
+ padding: 16px;
218
+ }
219
+
220
+ .calculator-promos {
221
+ margin-bottom: 20px;
222
+ }
223
+
224
+ .calculator-charges {
225
+ margin-bottom: 20px;
226
+ }
227
+
228
+ .fee-disclaimer {
229
+ color: #666;
230
+ font-size: 0.8rem;
231
+ text-align: center;
232
+ margin-top: 1rem;
233
+ border-top: 1px solid #e0e0e0;
234
+ }
235
+
236
+ .action-button {
237
+ flex: 1;
238
+ background-color: #f8f9fa;
239
+ color: #333;
240
+ border: 1px solid #ddd;
241
+ border-radius: 4px;
242
+ padding: 12px;
243
+ font-size: 14px;
244
+ cursor: pointer;
245
+ transition: all 0.15s;
246
+ display: flex;
247
+ flex-direction: column;
248
+ align-items: center;
249
+ justify-content: center;
250
+ }
251
+
252
+ .action-button:hover {
253
+ background-color: #e9ecef;
254
+ border-color: #ced4da;
255
+ }
256
+
257
+ .share-button {
258
+ color: var(--primary-color, #646987);
259
+ background-color: var(--background-color, #ffffff);
260
+ }
261
+
262
+ .share-button:hover {
263
+ background-color: var(--background-color, #ffffff);
264
+ }
265
+
266
+ .apply-button {
267
+ color: var(--background-color, #646987);
268
+ background-color: var(--primary-color, #ffffff);
269
+ }
270
+
271
+ @media (max-width: 768px) {
272
+ .fee-calculator-container {
273
+ width: 100vw;
274
+ height: 100vh;
275
+ padding: 8px;
276
+ padding-top: 2px;
277
+ border-radius: 0;
278
+ margin: 0;
279
+ max-width: none;
280
+ box-shadow: none;
281
+ box-sizing: border-box;
282
+ position: fixed;
283
+ top: 0;
284
+ left: 0;
285
+ right: 0;
286
+ bottom: 0;
287
+ transform: none;
288
+ z-index: 9999;
289
+ }
290
+
291
+ .calculator-header {
292
+ margin-bottom: 4px;
293
+ padding-top: 2px;
294
+ }
295
+
296
+ .calculator-header h1 {
297
+ font-size: 1.1rem;
298
+ }
299
+
300
+ .calculator-content {
301
+ padding-top: 2px;
302
+ width: 100%;
303
+ box-sizing: border-box;
304
+ }
305
+
306
+ .calculator-header-divider {
307
+ margin: 2px 0;
308
+ }
309
+ }
310
+ `;
@@ -0,0 +1,341 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property, state } from "lit/decorators.js";
3
+ import { feeCalculatorStyles } from "./fee-calculator-styles";
4
+ import fetchBuildingWebchatView, {
5
+ BuildingWebchatView,
6
+ LayoutOption,
7
+ } from "../../fetchBuildingWebchatView";
8
+ import fetchBuildingFeesV2 from "../../services/fees/fetchBuildingFeesV2";
9
+ import {
10
+ ALL_LAYOUTS_OPTION,
11
+ CALCULATE_DEBOUNCE_MS,
12
+ DEFAULT_LEASE_TERM,
13
+ } from "./constants";
14
+ import {
15
+ calculateQuote,
16
+ CalculateQuoteResponse,
17
+ } from "../../services/fees/calculateQuote";
18
+ import { defaultBackgroundColor, defaultPrimaryColor } from "../../themes";
19
+ import debounce from "lodash/debounce";
20
+ import { XOutlineIcon } from "../icons/XOutlineIcon";
21
+ import { IncentiveV2 } from "../../types/incentive-v2";
22
+ import { Unit } from "../../services/fees/fetchBuildingUnits";
23
+ import { RentableItemSummary } from "./model/rentable-item-summary";
24
+ import { TODAY } from "../../globals";
25
+ import {
26
+ BuildingFeeFrequency,
27
+ BuildingFeeView,
28
+ } from "./model/building-fee-view";
29
+ import { DesiredAddon } from "./model/desired-addon";
30
+ import { DesiredRentableItem } from "./model/desired-rentable-item";
31
+ import { ItemQuantity } from "./model/item-quantity";
32
+
33
+ import "./components";
34
+ import "./components/fee-calculator-layout/fee-calculator-layout";
35
+ import "../chat-additional-actions";
36
+ import "./components/incentive-banner";
37
+
38
+ @customElement("fee-calculator")
39
+ export class FeeCalculator extends LitElement {
40
+ static styles = feeCalculatorStyles;
41
+
42
+ @property({ attribute: true })
43
+ buildingSlug = "";
44
+
45
+ @property({ attribute: true })
46
+ orgSlug = "";
47
+
48
+ @property({ type: String })
49
+ private primaryColor = defaultPrimaryColor;
50
+
51
+ @property({ type: String })
52
+ private backgroundColor: string = defaultBackgroundColor;
53
+
54
+ @property()
55
+ onCloseClicked: (() => void) | null = null;
56
+
57
+ @property()
58
+ onClickEmailOption: ((e: MouseEvent) => void) | null = null;
59
+
60
+ @property()
61
+ onClickPhoneOption: ((e: MouseEvent) => void) | null = null;
62
+
63
+ @property()
64
+ onClickSSTOption: ((e: MouseEvent) => void) | null = null;
65
+
66
+ @property()
67
+ onClickTextUsOption: ((e: MouseEvent) => void) | null = null;
68
+
69
+ @state()
70
+ private isLoading = false;
71
+
72
+ @state()
73
+ private selectedLayoutIds: number[] = [ALL_LAYOUTS_OPTION];
74
+
75
+ @state()
76
+ private selectedUnit: Unit | null = null;
77
+
78
+ @state()
79
+ private desiredAddons: DesiredAddon[] = [];
80
+
81
+ @state()
82
+ private desiredRentableItems: DesiredRentableItem[] = [];
83
+
84
+ @state()
85
+ private leaseTerm = DEFAULT_LEASE_TERM;
86
+
87
+ @state()
88
+ private moveInDate: Date | null = TODAY;
89
+
90
+ @state()
91
+ private buildingWebchatView: BuildingWebchatView | null = null;
92
+
93
+ @state()
94
+ private incentives: IncentiveV2[] = [];
95
+
96
+ @state()
97
+ quote: CalculateQuoteResponse | null = null;
98
+
99
+ @state()
100
+ private groupedFees: Record<BuildingFeeFrequency, BuildingFeeView[]> = {
101
+ [BuildingFeeFrequency.OneTime]: [],
102
+ [BuildingFeeFrequency.Monthly]: [],
103
+ [BuildingFeeFrequency.Quarterly]: [],
104
+ [BuildingFeeFrequency.Annually]: [],
105
+ [BuildingFeeFrequency.PerOccurrence]: [],
106
+ };
107
+
108
+ @state()
109
+ private rentableItems: RentableItemSummary[] = [];
110
+
111
+ private debouncedCalculateQuote = debounce(async (): Promise<void> => {
112
+ if (!this.selectedUnit || !this.moveInDate) return;
113
+
114
+ // If lead's desired move in date is before the their selected unit's earliest available date
115
+ // use the unit's earliest available date (otherwise pricing will be incorrect)
116
+ const moveInDate =
117
+ this.moveInDate < new Date(this.selectedUnit.earliestAvailable)
118
+ ? this.selectedUnit.earliestAvailable
119
+ : this.moveInDate?.toISOString().split("T")[0];
120
+
121
+ try {
122
+ this.quote = await calculateQuote({
123
+ buildingSlug: this.buildingSlug,
124
+ unitId: this.selectedUnit.id,
125
+ addons: this.desiredAddons,
126
+ rentableItems: this.desiredRentableItems,
127
+ leaseTerm: this.leaseTerm,
128
+ moveInDate,
129
+ });
130
+ } finally {
131
+ this.isLoading = false;
132
+ }
133
+ }, CALCULATE_DEBOUNCE_MS);
134
+
135
+ // TODO(Leo): use layouts from units response instead?
136
+ get layouts(): LayoutOption[] {
137
+ return this.buildingWebchatView?.layoutOptions ?? [];
138
+ }
139
+
140
+ firstUpdated = async (): Promise<void> => {
141
+ this.style.setProperty("--primary-color", this.primaryColor);
142
+ this.style.setProperty("--background-color", this.backgroundColor);
143
+
144
+ await this.setupCalculator();
145
+ };
146
+
147
+ setupCalculator = async (): Promise<void> => {
148
+ if (!this.buildingSlug || !this.orgSlug) return;
149
+
150
+ this.isLoading = true;
151
+ const [buildingWebchatView, buildingFeeResponse] = await Promise.all([
152
+ fetchBuildingWebchatView(this.orgSlug, this.buildingSlug),
153
+ fetchBuildingFeesV2(this.buildingSlug),
154
+ ]);
155
+
156
+ if (!buildingWebchatView || !buildingFeeResponse) return;
157
+
158
+ this.buildingWebchatView = buildingWebchatView;
159
+ this.groupedFees = this.groupFees(buildingFeeResponse.fees);
160
+ this.rentableItems = buildingFeeResponse.rentableItems;
161
+ // TODO(Leo): Re-enable
162
+ // this.incentives = buildingFeeResponse.buildingIncentives;
163
+ this.isLoading = false;
164
+ };
165
+
166
+ updated(changedProperties: Map<string, unknown>): void {
167
+ if (
168
+ changedProperties.has("primaryColor") ||
169
+ changedProperties.has("backgroundColor")
170
+ ) {
171
+ this.style.setProperty("--primary-color", this.primaryColor);
172
+ this.style.setProperty("--background-color", this.backgroundColor);
173
+ }
174
+ }
175
+
176
+ disconnectedCallback(): void {
177
+ super.disconnectedCallback();
178
+ this.debouncedCalculateQuote.cancel();
179
+ }
180
+
181
+ calculateQuote = async (): Promise<void> => {
182
+ if (!this.selectedUnit || !this.moveInDate) return;
183
+
184
+ this.isLoading = true;
185
+ this.debouncedCalculateQuote();
186
+ };
187
+
188
+ handleUnitSelect = (unit: Unit): void => {
189
+ this.selectedUnit = unit;
190
+ this.calculateQuote();
191
+ };
192
+
193
+ handleMoveInDateChange = (date: Date): void => {
194
+ this.moveInDate = date;
195
+ this.calculateQuote();
196
+ };
197
+
198
+ handleLeaseTermChange = (leaseTerm: number): void => {
199
+ this.leaseTerm = leaseTerm;
200
+ this.calculateQuote();
201
+ };
202
+
203
+ handleAddonSelect = (addon: DesiredAddon): void => {
204
+ const isExistingAddon = this.desiredAddons.some((a) => a.id === addon.id);
205
+ const isRemoving =
206
+ isExistingAddon &&
207
+ addon.quantities.every((q: ItemQuantity) => q.quantity === 0);
208
+
209
+ if (isRemoving) {
210
+ this.desiredAddons = this.desiredAddons.filter((a) => a.id !== addon.id);
211
+ } else if (isExistingAddon) {
212
+ this.desiredAddons = this.desiredAddons.map((a) =>
213
+ a.id === addon.id ? { ...a, quantities: addon.quantities } : a
214
+ );
215
+ } else {
216
+ this.desiredAddons.push(addon);
217
+ }
218
+
219
+ this.calculateQuote();
220
+ };
221
+
222
+ handleRentableItemSelect = (rentableItem: DesiredRentableItem): void => {
223
+ const isExistingRentableItem = this.desiredRentableItems.some(
224
+ (item) => item.id === rentableItem.id
225
+ );
226
+
227
+ if (isExistingRentableItem) {
228
+ this.desiredRentableItems = this.desiredRentableItems.filter(
229
+ (item) => item.id !== rentableItem.id
230
+ );
231
+ } else {
232
+ this.desiredRentableItems.push(rentableItem);
233
+ }
234
+
235
+ this.calculateQuote();
236
+ };
237
+
238
+ groupFees = (
239
+ fees: BuildingFeeView[]
240
+ ): Record<BuildingFeeFrequency, BuildingFeeView[]> => {
241
+ return fees.reduce((acc, fee) => {
242
+ const frequency = fee.frequency || BuildingFeeFrequency.OneTime;
243
+ acc[frequency] = [...(acc[frequency] || []), fee];
244
+ return acc;
245
+ }, {} as Record<BuildingFeeFrequency, BuildingFeeView[]>);
246
+ };
247
+
248
+ handleClickEmailOption = (e: MouseEvent): void => {
249
+ this.handleClose();
250
+ if (this.onClickEmailOption) this.onClickEmailOption(e);
251
+ };
252
+
253
+ handleClickPhoneOption = (e: MouseEvent): void => {
254
+ this.handleClose();
255
+ if (this.onClickPhoneOption) this.onClickPhoneOption(e);
256
+ };
257
+
258
+ handleClickSSTOption = (e: MouseEvent): void => {
259
+ this.handleClose();
260
+ if (this.onClickSSTOption) this.onClickSSTOption(e);
261
+ };
262
+
263
+ handleClickTextUsOption = (e: MouseEvent): void => {
264
+ this.handleClose();
265
+ if (this.onClickTextUsOption) this.onClickTextUsOption(e);
266
+ };
267
+
268
+ handleClose = (): void => {
269
+ this.onCloseClicked?.();
270
+ };
271
+
272
+ handleSelectLayout = (layoutIds: number[]): void => {
273
+ this.selectedLayoutIds = layoutIds;
274
+ };
275
+
276
+ render(): TemplateResult {
277
+ return html`
278
+ <div
279
+ class="fee-calculator-container"
280
+ @keydown=${(e: KeyboardEvent) => e.stopPropagation()}
281
+ @keyup=${(e: KeyboardEvent) => e.stopPropagation()}
282
+ >
283
+ <div class="calculator-header">
284
+ <h1>Estimated Cost Calculator</h1>
285
+
286
+ <div class="calculator-header-right">
287
+ <!-- TODO(Leo): Return once reqs are clear; also need apps link -->
288
+ <!-- <button class="share-button">Share</button> -->
289
+ <!-- <button class="apply-button">Apply</button> -->
290
+ <button
291
+ aria-label="Close fee calculator"
292
+ class="close-button"
293
+ @click=${this.handleClose}
294
+ >
295
+ ${XOutlineIcon("gray")}
296
+ </button>
297
+ </div>
298
+ </div>
299
+
300
+ <div class="calculator-header-divider"></div>
301
+
302
+ <div class="calculator-content">
303
+ ${this.incentives.length
304
+ ? html`
305
+ <div class="incentives-container">
306
+ ${this.incentives.map(
307
+ (incentive) => html`
308
+ <incentive-banner
309
+ .incentive=${incentive}
310
+ ></incentive-banner>
311
+ `
312
+ )}
313
+ </div>
314
+ `
315
+ : ""}
316
+
317
+ <fee-calculator-layout
318
+ .buildingSlug=${this.buildingSlug}
319
+ .isLoading=${this.isLoading}
320
+ .selectedUnit=${this.selectedUnit}
321
+ .groupedFees=${this.groupedFees}
322
+ .rentableItems=${this.rentableItems}
323
+ .quote=${this.quote}
324
+ .layoutOptions=${this.layouts}
325
+ .selectedLayoutIds=${this.selectedLayoutIds}
326
+ .onSelectLayout=${this.handleSelectLayout}
327
+ .onUnitSelect=${this.handleUnitSelect}
328
+ .onMoveInDateChange=${this.handleMoveInDateChange}
329
+ .onLeaseTermChange=${this.handleLeaseTermChange}
330
+ .onAddonSelect=${this.handleAddonSelect}
331
+ .onRentableItemSelect=${this.handleRentableItemSelect}
332
+ ></fee-calculator-layout>
333
+ </div>
334
+
335
+ <div class="fee-disclaimer">
336
+ <p>Prices subject to change. Additional fees may apply.</p>
337
+ </div>
338
+ </div>
339
+ `;
340
+ }
341
+ }
@@ -0,0 +1,4 @@
1
+ export { FeeCalculator } from "./fee-calculator";
2
+
3
+ // TODO(Leo): odd import issue requires this useless function be imported
4
+ export const installFeeCalculator = (): void => undefined;