@meetelise/chat 1.25.1 → 1.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/package.json +1 -1
  2. package/.prettierignore +0 -2
  3. package/coverage/lcov-report/base.css +0 -224
  4. package/coverage/lcov-report/block-navigation.js +0 -79
  5. package/coverage/lcov-report/favicon.png +0 -0
  6. package/coverage/lcov-report/index.html +0 -111
  7. package/coverage/lcov-report/index.js.html +0 -17093
  8. package/coverage/lcov-report/prettify.css +0 -1
  9. package/coverage/lcov-report/prettify.js +0 -2
  10. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  11. package/coverage/lcov-report/sorter.js +0 -170
  12. package/coverage/lcov.info +0 -9986
  13. package/dist/src/MyPubnub.d.ts +0 -116
  14. package/dist/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section-styles.d.ts +0 -2
  15. package/dist/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section.d.ts +0 -20
  16. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +0 -2
  17. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +0 -14
  18. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +0 -2
  19. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +0 -17
  20. package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +0 -3
  21. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +0 -2
  22. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +0 -13
  23. package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +0 -1
  24. package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +0 -31
  25. package/dist/src/WebComponent/FeeCalculator/index.d.ts +0 -2
  26. package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +0 -75
  27. package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +0 -23
  28. package/dist/src/WebComponent/LeadSourceClient.d.ts +0 -46
  29. package/dist/src/WebComponent/OfficeHours.d.ts +0 -21
  30. package/dist/src/WebComponent/Scheduler/date-picker.d.ts +0 -28
  31. package/dist/src/WebComponent/Scheduler/time-picker.d.ts +0 -14
  32. package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +0 -99
  33. package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +0 -13
  34. package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +0 -1
  35. package/dist/src/WebComponent/actions/InputStyles.d.ts +0 -1
  36. package/dist/src/WebComponent/actions/action-confirm-button.d.ts +0 -13
  37. package/dist/src/WebComponent/actions/call-us-window.d.ts +0 -37
  38. package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +0 -8
  39. package/dist/src/WebComponent/actions/details-window.d.ts +0 -14
  40. package/dist/src/WebComponent/actions/email-us-window.d.ts +0 -46
  41. package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +0 -17
  42. package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +0 -8
  43. package/dist/src/WebComponent/chat-additional-actions.d.ts +0 -28
  44. package/dist/src/WebComponent/health-chat.d.ts +0 -47
  45. package/dist/src/WebComponent/healthchat-styles.d.ts +0 -1
  46. package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +0 -2
  47. package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +0 -2
  48. package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +0 -2
  49. package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +0 -2
  50. package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +0 -2
  51. package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +0 -2
  52. package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +0 -2
  53. package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +0 -3
  54. package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +0 -2
  55. package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +0 -2
  56. package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +0 -2
  57. package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +0 -3
  58. package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +0 -2
  59. package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +0 -2
  60. package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +0 -2
  61. package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +0 -2
  62. package/dist/src/WebComponent/index.d.ts +0 -2
  63. package/dist/src/WebComponent/launcher/Launcher.d.ts +0 -98
  64. package/dist/src/WebComponent/launcher/launcherStyles.d.ts +0 -1
  65. package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +0 -26
  66. package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +0 -1
  67. package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +0 -1
  68. package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +0 -1
  69. package/dist/src/WebComponent/leasing-chat-styles.d.ts +0 -1
  70. package/dist/src/WebComponent/me-chat.d.ts +0 -91
  71. package/dist/src/WebComponent/me-select.d.ts +0 -24
  72. package/dist/src/WebComponent/mini-loader.d.ts +0 -5
  73. package/dist/src/WebComponent/pubnub-chat-styles.d.ts +0 -1
  74. package/dist/src/WebComponent/pubnub-chat.d.ts +0 -49
  75. package/dist/src/WebComponent/pubnub-media.d.ts +0 -14
  76. package/dist/src/WebComponent/pubnub-message-styles.d.ts +0 -1
  77. package/dist/src/WebComponent/pubnub-message.d.ts +0 -39
  78. package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +0 -1
  79. package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +0 -12
  80. package/dist/src/WebComponent/utilities-chat.d.ts +0 -47
  81. package/dist/src/WebComponent/utilities-styles.d.ts +0 -1
  82. package/dist/src/WebComponent/utils.d.ts +0 -31
  83. package/dist/src/analytics.d.ts +0 -64
  84. package/dist/src/disclaimers.d.ts +0 -8
  85. package/dist/src/fetchBuildingABTestType.d.ts +0 -8
  86. package/dist/src/fetchBuildingInfo.d.ts +0 -57
  87. package/dist/src/fetchBuildingWebchatView.d.ts +0 -122
  88. package/dist/src/fetchFeatureFlag.d.ts +0 -14
  89. package/dist/src/fetchLeadSources.d.ts +0 -4
  90. package/dist/src/fetchPhoneNumberFromSource.d.ts +0 -6
  91. package/dist/src/getAvailabilities.d.ts +0 -44
  92. package/dist/src/getBuildingPhoneNumber.d.ts +0 -1
  93. package/dist/src/getShouldAllowScheduling.d.ts +0 -1
  94. package/dist/src/getShouldShowWebchat.d.ts +0 -3
  95. package/dist/src/getTimezoneString.d.ts +0 -1
  96. package/dist/src/globals.d.ts +0 -1
  97. package/dist/src/gtm.d.ts +0 -6
  98. package/dist/src/handleChatId.d.ts +0 -11
  99. package/dist/src/insertDNIIntoWebsite.d.ts +0 -5
  100. package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +0 -4
  101. package/dist/src/main/MEChat.d.ts +0 -74
  102. package/dist/src/main/utils.d.ts +0 -2
  103. package/dist/src/postLeadSources.d.ts +0 -3
  104. package/dist/src/rentgrata.d.ts +0 -4
  105. package/dist/src/replaceSelectButtonsWithNewLink.d.ts +0 -5
  106. package/dist/src/services/fees/fetchBuildingFees.d.ts +0 -3
  107. package/dist/src/svgIcons.d.ts +0 -5
  108. package/dist/src/themes.d.ts +0 -5
  109. package/dist/src/types/rest-sdk.types.d.ts +0 -11
  110. package/dist/src/types/webchat-no-show-reason.d.ts +0 -1
  111. package/dist/src/utils.d.ts +0 -13
  112. package/public/demo/index.html +0 -347
  113. package/public/demo/secret.html +0 -63
  114. package/src/MyPubnub.ts +0 -792
  115. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section-styles.ts +0 -86
  116. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section.ts +0 -94
  117. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +0 -47
  118. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +0 -50
  119. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +0 -46
  120. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +0 -70
  121. package/src/WebComponent/FeeCalculator/components/index.ts +0 -3
  122. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +0 -39
  123. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +0 -39
  124. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +0 -280
  125. package/src/WebComponent/FeeCalculator/fee-calculator.ts +0 -256
  126. package/src/WebComponent/FeeCalculator/index.ts +0 -4
  127. package/src/WebComponent/FeeCalculator/model/building-fee.ts +0 -83
  128. package/src/WebComponent/FeeCalculator/model/transaction-category.ts +0 -23
  129. package/src/WebComponent/LeadSourceClient.ts +0 -332
  130. package/src/WebComponent/MEChat.css +0 -5
  131. package/src/WebComponent/OfficeHours.ts +0 -73
  132. package/src/WebComponent/Scheduler/date-picker.ts +0 -405
  133. package/src/WebComponent/Scheduler/time-picker.ts +0 -190
  134. package/src/WebComponent/Scheduler/tour-scheduler.ts +0 -1352
  135. package/src/WebComponent/Scheduler/tour-type-option.ts +0 -112
  136. package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +0 -418
  137. package/src/WebComponent/actions/InputStyles.ts +0 -57
  138. package/src/WebComponent/actions/action-confirm-button.ts +0 -125
  139. package/src/WebComponent/actions/call-us-window.ts +0 -445
  140. package/src/WebComponent/actions/collapse-expand-button.ts +0 -65
  141. package/src/WebComponent/actions/details-window.ts +0 -150
  142. package/src/WebComponent/actions/email-us-window.ts +0 -555
  143. package/src/WebComponent/actions/formatPhoneNumber.ts +0 -72
  144. package/src/WebComponent/actions/minimize-expand-button.ts +0 -93
  145. package/src/WebComponent/chat-additional-actions.ts +0 -135
  146. package/src/WebComponent/health-chat.ts +0 -270
  147. package/src/WebComponent/healthchat-styles.ts +0 -119
  148. package/src/WebComponent/icons/ApplyOutlineIcon.ts +0 -22
  149. package/src/WebComponent/icons/BookTourOutlineIcon.ts +0 -13
  150. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +0 -22
  151. package/src/WebComponent/icons/ChatOutlineIcon.ts +0 -10
  152. package/src/WebComponent/icons/ChevronLeftIcon.ts +0 -7
  153. package/src/WebComponent/icons/ChevronRightIcon.ts +0 -7
  154. package/src/WebComponent/icons/ContactResidentIcon.ts +0 -9
  155. package/src/WebComponent/icons/DollarOutlineIcon.ts +0 -18
  156. package/src/WebComponent/icons/EmailOutlineIcon.ts +0 -7
  157. package/src/WebComponent/icons/HeyThereEmojiIcon.ts +0 -12
  158. package/src/WebComponent/icons/PhoneOutlineIcon.ts +0 -7
  159. package/src/WebComponent/icons/SendMessageIcon.ts +0 -17
  160. package/src/WebComponent/icons/TourSelfGuidedIcon.ts +0 -17
  161. package/src/WebComponent/icons/TourVirtuallyIcon.ts +0 -17
  162. package/src/WebComponent/icons/TourWithAgentIcon.ts +0 -17
  163. package/src/WebComponent/icons/XOutlineIcon.ts +0 -8
  164. package/src/WebComponent/index.ts +0 -2
  165. package/src/WebComponent/launcher/Launcher.ts +0 -1193
  166. package/src/WebComponent/launcher/launcherStyles.ts +0 -500
  167. package/src/WebComponent/launcher/mobile-launcher.ts +0 -159
  168. package/src/WebComponent/launcher/typeEmojiStyles.ts +0 -161
  169. package/src/WebComponent/launcher/typeMiniStyles.ts +0 -60
  170. package/src/WebComponent/launcher/typeMobileStyles.ts +0 -50
  171. package/src/WebComponent/leasing-chat-styles.ts +0 -114
  172. package/src/WebComponent/me-chat.ts +0 -1257
  173. package/src/WebComponent/me-select.ts +0 -322
  174. package/src/WebComponent/mini-loader.ts +0 -28
  175. package/src/WebComponent/pubnub-chat-styles.ts +0 -204
  176. package/src/WebComponent/pubnub-chat.ts +0 -928
  177. package/src/WebComponent/pubnub-media.ts +0 -208
  178. package/src/WebComponent/pubnub-message-styles.ts +0 -54
  179. package/src/WebComponent/pubnub-message.ts +0 -431
  180. package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +0 -34
  181. package/src/WebComponent/simple-launcher/simple-launcher.ts +0 -100
  182. package/src/WebComponent/utilities-chat.ts +0 -270
  183. package/src/WebComponent/utilities-styles.ts +0 -110
  184. package/src/WebComponent/utils.ts +0 -82
  185. package/src/analytics.ts +0 -217
  186. package/src/assetUrls.ts +0 -6
  187. package/src/disclaimers.ts +0 -58
  188. package/src/fetchBuildingABTestType.ts +0 -21
  189. package/src/fetchBuildingInfo.ts +0 -87
  190. package/src/fetchBuildingWebchatView.ts +0 -154
  191. package/src/fetchFeatureFlag.ts +0 -250
  192. package/src/fetchLeadSources.ts +0 -98
  193. package/src/fetchPhoneNumberFromSource.ts +0 -31
  194. package/src/fetchWebchatPreferences.ts +0 -54
  195. package/src/getAvailabilities.ts +0 -174
  196. package/src/getBuildingPhoneNumber.ts +0 -26
  197. package/src/getShouldAllowScheduling.ts +0 -16
  198. package/src/getShouldShowWebchat.ts +0 -114
  199. package/src/getTimezoneString.ts +0 -39
  200. package/src/globals.ts +0 -1
  201. package/src/gtm.ts +0 -17
  202. package/src/handleChatId.ts +0 -101
  203. package/src/insertDNIIntoWebsite.ts +0 -146
  204. package/src/insertLeadSourceIntoSchedulerLinks.ts +0 -71
  205. package/src/main/MEChat.test.ts +0 -110
  206. package/src/main/MEChat.ts +0 -404
  207. package/src/main/utils.ts +0 -70
  208. package/src/postLeadSources.ts +0 -44
  209. package/src/rentgrata.ts +0 -74
  210. package/src/replaceSelectButtonsWithNewLink.ts +0 -68
  211. package/src/services/fees/fetchBuildingFees.ts +0 -28
  212. package/src/svgIcons.ts +0 -14
  213. package/src/themes.ts +0 -65
  214. package/src/types/rest-sdk.types.ts +0 -13
  215. package/src/types/webchat-no-show-reason.ts +0 -6
  216. package/src/utils.ts +0 -121
  217. package/tsconfig.json +0 -84
@@ -1,280 +0,0 @@
1
- import { css } from "lit";
2
-
3
- export const feeCalculatorStyles = css`
4
- :host {
5
- display: block;
6
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
7
- Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
8
- position: relative;
9
- }
10
-
11
- .fee-calculator-container {
12
- background-color: var(--background-color, #ffffff);
13
- border-radius: 8px;
14
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
15
- padding: 20px;
16
- width: 45vw;
17
- max-width: 1000px;
18
- margin: 0 auto;
19
- }
20
-
21
- .fee-calculator-container.compact {
22
- padding: 12px;
23
- max-width: 600px;
24
- }
25
-
26
- .calculator-header {
27
- display: flex;
28
- justify-content: space-between;
29
- align-items: center;
30
- margin-bottom: 12px;
31
- }
32
-
33
- .calculator-header h1 {
34
- font-size: 1.2rem;
35
- font-weight: normal;
36
- color: #333;
37
- }
38
-
39
- .calculator-header-right {
40
- display: flex;
41
- gap: 10px;
42
- }
43
-
44
- .calculator-header-divider {
45
- height: 1px;
46
- background-color: #e0e0e0;
47
- margin-bottom: 20px;
48
- }
49
-
50
- .calculator-body {
51
- padding: 20px 20px 5px 20px;
52
- background-color: #f1f3f5;
53
- max-height: 50vh;
54
- overflow-y: scroll;
55
- }
56
-
57
- .close-button {
58
- background: none;
59
- border: none;
60
- color: #6c757d;
61
- font-size: 24px;
62
- cursor: pointer;
63
- padding: 0;
64
- margin: 0;
65
- line-height: 1;
66
- width: 30px;
67
- height: 30px;
68
- border-radius: 50%;
69
- display: flex;
70
- align-items: center;
71
- justify-content: center;
72
- }
73
-
74
- .close-button:hover {
75
- background-color: #f0f0f0;
76
- color: #000;
77
- }
78
-
79
- h1,
80
- h2 {
81
- margin-top: 0;
82
- color: #333;
83
- }
84
-
85
- h1 {
86
- font-size: 1.5rem;
87
- margin: 0;
88
- }
89
-
90
- h2 {
91
- font-size: 1.2rem;
92
- margin-bottom: 8px;
93
- }
94
-
95
- .input-group {
96
- margin-bottom: 16px;
97
- }
98
-
99
- label {
100
- display: block;
101
- margin-bottom: 6px;
102
- font-weight: 500;
103
- }
104
-
105
- input {
106
- width: 100%;
107
- padding: 10px;
108
- border: 1px solid #ddd;
109
- border-radius: 4px;
110
- font-size: 16px;
111
- }
112
-
113
- button {
114
- background-color: var(--primary-color, #007bff);
115
- color: white;
116
- border: none;
117
- border-radius: 4px;
118
- padding: 10px 16px;
119
- font-size: 16px;
120
- cursor: pointer;
121
- display: flex;
122
- align-items: center;
123
- justify-content: center;
124
- gap: 8px;
125
- transition: background-color 0.2s;
126
- }
127
-
128
- button:hover {
129
- background-color: var(--primary-color-dark, #0069d9);
130
- }
131
-
132
- button:disabled {
133
- opacity: 0.7;
134
- cursor: not-allowed;
135
- }
136
-
137
- .reset-button {
138
- background-color: #6c757d;
139
- margin-top: 16px;
140
- }
141
-
142
- .reset-button:hover {
143
- background-color: #5a6268;
144
- }
145
-
146
- .calculation-results {
147
- margin-top: 24px;
148
- padding-top: 16px;
149
- border-top: 1px solid #eee;
150
- }
151
-
152
- .result-item {
153
- display: flex;
154
- justify-content: space-between;
155
- margin-bottom: 8px;
156
- padding-bottom: 8px;
157
- border-bottom: 1px solid #eee;
158
- color: #333;
159
- }
160
-
161
- .result-item:last-child {
162
- border-bottom: none;
163
- }
164
-
165
- .result-item.total {
166
- font-weight: bold;
167
- font-size: 1.1em;
168
- margin-top: 8px;
169
- padding-top: 8px;
170
- border-top: 1px solid #eee;
171
- }
172
-
173
- .error-message {
174
- color: #dc3545;
175
- text-align: center;
176
- padding: 16px;
177
- }
178
-
179
- .calculator-promos {
180
- margin-bottom: 20px;
181
- }
182
-
183
- .calculator-charges {
184
- margin-bottom: 20px;
185
- }
186
-
187
- .calculator-disclaimer {
188
- color: #666;
189
- font-size: 0.8rem;
190
- text-align: center;
191
- }
192
-
193
- .close-circle-button {
194
- position: absolute;
195
- bottom: -50px;
196
- right: 20px;
197
- width: 50px;
198
- height: 50px;
199
- border-radius: 50%;
200
- background-color: var(--primary-color, #007bff);
201
- color: white;
202
- display: flex;
203
- align-items: center;
204
- justify-content: center;
205
- cursor: pointer;
206
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
207
- border: none;
208
- font-size: 24px;
209
- z-index: 10;
210
- }
211
-
212
- .close-circle-button:hover {
213
- background-color: var(--primary-color-dark, #0069d9);
214
- }
215
-
216
- .additional-actions-toggle {
217
- position: absolute;
218
- bottom: -50px;
219
- left: 20px;
220
- background-color: var(--primary-color, #007bff);
221
- color: white;
222
- border: none;
223
- border-radius: 4px;
224
- padding: 10px 16px;
225
- font-size: 14px;
226
- cursor: pointer;
227
- z-index: 10;
228
- }
229
-
230
- .additional-actions-toggle:hover {
231
- background-color: var(--primary-color-dark, #0069d9);
232
- }
233
-
234
- #calculator-additional-actions {
235
- position: fixed;
236
- box-sizing: border-box;
237
- z-index: 1000000;
238
- margin-left: -1rem;
239
- }
240
-
241
- .hideActions {
242
- display: none;
243
- }
244
-
245
- .showActions {
246
- display: block;
247
- }
248
-
249
- .additional-actions-container {
250
- display: flex;
251
- justify-content: space-around;
252
- gap: 10px;
253
- }
254
-
255
- .action-button {
256
- flex: 1;
257
- background-color: #f8f9fa;
258
- color: #333;
259
- border: 1px solid #ddd;
260
- border-radius: 4px;
261
- padding: 12px;
262
- font-size: 14px;
263
- cursor: pointer;
264
- transition: all 0.2s;
265
- display: flex;
266
- flex-direction: column;
267
- align-items: center;
268
- justify-content: center;
269
- }
270
-
271
- .action-button:hover {
272
- background-color: #e9ecef;
273
- border-color: #ced4da;
274
- }
275
-
276
- .share-button {
277
- color: #347ff7;
278
- background-color: white;
279
- }
280
- `;
@@ -1,256 +0,0 @@
1
- import { LitElement, html, TemplateResult } from "lit";
2
- import { customElement, property, query, state } from "lit/decorators.js";
3
- import { classMap } from "lit/directives/class-map.js";
4
- import { feeCalculatorStyles } from "./fee-calculator-styles";
5
- import fetchBuildingWebchatView, {
6
- BuildingWebchatView,
7
- LayoutOption,
8
- } from "../../fetchBuildingWebchatView";
9
- import { BuildingFee, RecurrenceFrequency } from "./model/building-fee";
10
- import fetchBuildingFees from "../../services/fees/fetchBuildingFees";
11
-
12
- import "./components";
13
- import "../chat-additional-actions";
14
-
15
- @customElement("fee-calculator")
16
- export class FeeCalculator extends LitElement {
17
- static styles = feeCalculatorStyles;
18
-
19
- @property({ attribute: true })
20
- buildingSlug = "";
21
-
22
- @property({ attribute: true })
23
- orgSlug = "";
24
-
25
- @property({ attribute: true })
26
- primaryColor = "#007bff";
27
-
28
- @property({ attribute: true })
29
- backgroundColor = "#ffffff";
30
-
31
- @property({ attribute: true, type: Boolean })
32
- compactDesign = false;
33
-
34
- @property()
35
- onCloseClicked: ((e: MouseEvent) => void) | null = null;
36
-
37
- @state()
38
- private isLoading = false;
39
-
40
- @state()
41
- private buildingWebchatView: BuildingWebchatView | null = null;
42
-
43
- @state()
44
- private groupedFees: Record<RecurrenceFrequency, BuildingFee[]> = {
45
- [RecurrenceFrequency.OneTime]: [],
46
- [RecurrenceFrequency.Daily]: [],
47
- [RecurrenceFrequency.Weekly]: [],
48
- [RecurrenceFrequency.BiWeekly]: [],
49
- [RecurrenceFrequency.Monthly]: [],
50
- [RecurrenceFrequency.Yearly]: [],
51
- [RecurrenceFrequency.Unknown]: [],
52
- };
53
-
54
- get layouts(): LayoutOption[] {
55
- return this.buildingWebchatView?.layoutOptions ?? [];
56
- }
57
-
58
- @state()
59
- private enabledChatWidgets: {
60
- callDesktop: boolean;
61
- callMobile: boolean;
62
- chatMobile: boolean;
63
- chatDesktop: boolean;
64
- emailDesktop: boolean;
65
- emailMobile: boolean;
66
- textDesktop: boolean;
67
- textMobile: boolean;
68
- sstDesktop: boolean;
69
- sstMobile: boolean;
70
- } = {
71
- callDesktop: false,
72
- callMobile: false,
73
- chatMobile: false,
74
- chatDesktop: false,
75
- emailDesktop: false,
76
- emailMobile: false,
77
- textDesktop: false,
78
- textMobile: false,
79
- sstDesktop: false,
80
- sstMobile: false,
81
- };
82
-
83
- @query("#baseAmountInput")
84
- baseAmountInput!: HTMLInputElement;
85
-
86
- @query("#feePercentageInput")
87
- feePercentageInput!: HTMLInputElement;
88
-
89
- constructor() {
90
- super();
91
- }
92
-
93
- firstUpdated = async (): Promise<void> => {
94
- this.style.setProperty("--primary-color", this.primaryColor);
95
- this.style.setProperty("--background-color", this.backgroundColor);
96
-
97
- await this.setupCalculator();
98
- };
99
-
100
- setupCalculator = async (): Promise<void> => {
101
- if (!this.buildingSlug || !this.orgSlug) return;
102
-
103
- const [buildingWebchatView, fees] = await Promise.all([
104
- fetchBuildingWebchatView(this.orgSlug, this.buildingSlug),
105
- fetchBuildingFees(this.buildingSlug),
106
- ]);
107
-
108
- if (!buildingWebchatView || !fees) return;
109
-
110
- this.buildingWebchatView = buildingWebchatView;
111
- this.groupedFees = this.groupFees(fees);
112
- };
113
-
114
- groupFees = (
115
- fees: BuildingFee[]
116
- ): Record<RecurrenceFrequency, BuildingFee[]> => {
117
- return fees.reduce((acc, fee) => {
118
- const frequency =
119
- fee.blueprint.recurrenceInfo?.frequency || RecurrenceFrequency.Unknown;
120
- acc[frequency] = [...(acc[frequency] || []), fee];
121
- return acc;
122
- }, {} as Record<RecurrenceFrequency, BuildingFee[]>);
123
- };
124
-
125
- handleClose = (e: MouseEvent): void => {
126
- e.preventDefault();
127
- if (this.onCloseClicked) {
128
- this.onCloseClicked(e);
129
- }
130
- };
131
-
132
- connectedCallback(): void {
133
- super.connectedCallback();
134
- window.addEventListener("resize", this.adjustPositionAdditionalActions);
135
- }
136
-
137
- disconnectedCallback(): void {
138
- window.removeEventListener("resize", this.adjustPositionAdditionalActions);
139
- super.disconnectedCallback();
140
- }
141
-
142
- updated(changedProperties: Map<string, unknown>): void {
143
- if (
144
- changedProperties.has("primaryColor") ||
145
- changedProperties.has("backgroundColor")
146
- ) {
147
- this.style.setProperty("--primary-color", this.primaryColor);
148
- this.style.setProperty("--background-color", this.backgroundColor);
149
- }
150
- this.adjustPositionAdditionalActions();
151
- }
152
-
153
- adjustPositionAdditionalActions = (): void => {
154
- const additionalActionsElement = this.shadowRoot?.getElementById(
155
- "calculator-additional-actions"
156
- );
157
- if (!additionalActionsElement) return;
158
-
159
- const calculatorContainer = this.shadowRoot?.querySelector(
160
- ".fee-calculator-container"
161
- );
162
-
163
- const containerCoords = calculatorContainer?.getBoundingClientRect();
164
- if (!containerCoords) return;
165
-
166
- additionalActionsElement.style.left = `${containerCoords.left}px`;
167
- additionalActionsElement.style.top = `${containerCoords.bottom + 10}px`;
168
- additionalActionsElement.style.width = `${containerCoords.width}px`;
169
- };
170
-
171
- render(): TemplateResult {
172
- const containerClasses = {
173
- "fee-calculator-container": true,
174
- compact: this.compactDesign,
175
- };
176
-
177
- const primaryColorWithFallback = this.primaryColor || "#007bff";
178
- const backgroundColorWithFallback = this.backgroundColor || "#ffffff";
179
-
180
- return html`
181
- <div class=${classMap(containerClasses)}>
182
- <div class="calculator-header">
183
- <h1>Estimated Cost Calculator</h1>
184
-
185
- <div class="calculator-header-right">
186
- <button class="share-button">Share</button>
187
- <button class="apply-button">Apply</button>
188
- </div>
189
- </div>
190
-
191
- <div class="calculator-header-divider"></div>
192
-
193
- <floor-plan-selector
194
- .primaryColor=${this.primaryColor}
195
- .floorPlans=${this.layouts}
196
- .selectedLayoutId=${-1}
197
- ></floor-plan-selector>
198
-
199
- <div class="calculator-body">
200
- <div class="calculator-promos">
201
- <promo-card
202
- .primaryColor=${this.primaryColor}
203
- promoAmount="(Example) $500"
204
- promoDescription="off first month"
205
- promoValidity="Valid through Mar 1, 2025 for all units"
206
- ></promo-card>
207
- </div>
208
-
209
- <div class="calculator-charges">
210
- <collapsible-fee-section
211
- .primaryColor=${this.primaryColor}
212
- title="Monthly Charges"
213
- totalLabel="Est. Total Charge"
214
- .buildingFees=${this.groupedFees[RecurrenceFrequency.Monthly]}
215
- ></collapsible-fee-section>
216
- </div>
217
-
218
- <div class="calculator-charges">
219
- <collapsible-fee-section
220
- .primaryColor=${this.primaryColor}
221
- title="Prior to Move-in"
222
- totalLabel="Total Due at Signing"
223
- .buildingFees=${this.groupedFees[RecurrenceFrequency.OneTime]}
224
- ></collapsible-fee-section>
225
- </div>
226
-
227
- <div class="calculator-disclaimer">
228
- <p>Prices subject to change. Additional fees may apply.</p>
229
- </div>
230
- </div>
231
- </div>
232
-
233
- <chat-additional-actions
234
- id="calculator-additional-actions"
235
- .showChatAdditionalActions=${!this.isLoading}
236
- .buildingWebchatView=${this.buildingWebchatView}
237
- .primaryColor=${primaryColorWithFallback}
238
- .backgroundColor=${backgroundColorWithFallback}
239
- .enabledChatWidgets=${this.enabledChatWidgets}
240
- .onClickMinimize=${(): void => {
241
- /* TODO */
242
- }}
243
- .onClickEmailOption=${(): void => {
244
- /* TODO */
245
- }}
246
- .onClickPhoneOption=${(): void => {
247
- /* TODO */
248
- }}
249
- .onClickSSTOption=${(): void => {
250
- /* TODO */
251
- }}
252
- .onClose=${this.handleClose}
253
- ></chat-additional-actions>
254
- `;
255
- }
256
- }
@@ -1,4 +0,0 @@
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;
@@ -1,83 +0,0 @@
1
- import { TransactionCategory } from "./transaction-category";
2
-
3
- export interface BuildingFee {
4
- id: number;
5
- buildingId: number;
6
- blueprint: FeeBlueprint;
7
- unitIds: number[] | null;
8
- layoutIds: number[] | null;
9
- startDate: Date | null;
10
- endDate: Date | null;
11
- source: string | null;
12
- timeCreated: Date;
13
- externalKey: string | null;
14
- syncActive: boolean;
15
- hiddenReason: string | null;
16
- refundable: boolean | null;
17
- required?: boolean;
18
- }
19
-
20
- interface FeeBlueprint {
21
- transactionId: number | null;
22
- transactionAmount: number | null;
23
- flowDirection: TransactionFlow;
24
- transactionDescription: string | null;
25
- category: TransactionCategory;
26
- recurrenceInfo: RecurrenceInfo | null;
27
- adjustmentInfo: AdjustmentInfo | null;
28
- triggerInfo: TriggerInfo | null;
29
- addOnInfo: AddOnInfo | null;
30
- priceType: PriceType;
31
- handledByThirdParty: boolean;
32
- handledByThirdPartyReasoning: string | null;
33
- leaseStartDate: Date | null;
34
- leaseEndDate: Date | null;
35
- }
36
-
37
- interface AdjustmentInfo {
38
- reason: string;
39
- percentage: number;
40
- }
41
-
42
- export enum RecurrenceFrequency {
43
- OneTime = "OneTime",
44
- Daily = "Daily",
45
- Weekly = "Weekly",
46
- BiWeekly = "BiWeekly",
47
- Monthly = "Monthly",
48
- Yearly = "Yearly",
49
- Unknown = "Unknown",
50
- }
51
-
52
- interface RecurrenceInfo {
53
- frequency: RecurrenceFrequency;
54
- startDate: Date | null;
55
- endDate: Date | null;
56
- }
57
-
58
- interface TriggerInfo {
59
- triggerEvent: string;
60
- maxDaysBeforeEvent: number;
61
- maxDaysAfterEvent: number;
62
- triggerEventEmbedding: number[] | null;
63
- startDate: Date | null;
64
- endDate: Date | null;
65
- }
66
-
67
- interface AddOnInfo {
68
- addOnType: string;
69
- maxUnitsCharged: number | null;
70
- minUnitsCharged: number | null;
71
- addOnTypeEmbedding: number[] | null;
72
- }
73
-
74
- enum TransactionFlow {
75
- Debit = "Debit",
76
- Credit = "Credit",
77
- }
78
-
79
- enum PriceType {
80
- Fixed = "Fixed",
81
- UsageBased = "UsageBased",
82
- Varies = "Varies",
83
- }
@@ -1,23 +0,0 @@
1
- export enum TransactionCategory {
2
- AdminFee = "AdminFee",
3
- ApplicationFee = "ApplicationFee",
4
- Concession = "Concession",
5
- Insurance = "Insurance",
6
- LateFee = "LateFee",
7
- Legal = "Legal",
8
- NonSufficientFundFee = "NSF",
9
- Other = "Other",
10
- Parking = "Parking",
11
- Penalty = "Penalty",
12
- Pest = "Pest",
13
- PetDeposit = "PetDeposit",
14
- PetRent = "PetRent",
15
- Refund = "Refund",
16
- Relet = "Relet",
17
- Rent = "Rent",
18
- SecurityDeposit = "SecurityDeposit",
19
- Storage = "Storage",
20
- Trash = "Trash",
21
- Utility = "Utility",
22
- WaterSewer = "WaterSewer",
23
- }