@meetelise/chat 1.25.0 → 1.25.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 (136) hide show
  1. package/coverage/lcov-report/base.css +224 -0
  2. package/coverage/lcov-report/block-navigation.js +79 -0
  3. package/coverage/lcov-report/favicon.png +0 -0
  4. package/coverage/lcov-report/index.html +111 -0
  5. package/coverage/lcov-report/index.js.html +17093 -0
  6. package/coverage/lcov-report/prettify.css +1 -0
  7. package/coverage/lcov-report/prettify.js +2 -0
  8. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  9. package/coverage/lcov-report/sorter.js +170 -0
  10. package/coverage/lcov.info +9986 -0
  11. package/dist/index.d.ts +1 -0
  12. package/package.json +1 -1
  13. package/.eslintignore +0 -2
  14. package/.eslintrc.cjs +0 -23
  15. package/.github/pull_request_template.md +0 -61
  16. package/.github/workflows/pull.yml +0 -46
  17. package/.github/workflows/release.yml +0 -23
  18. package/.husky/commit-msg +0 -2
  19. package/.husky/pre-commit +0 -4
  20. package/.idea/codeStyles/Project.xml +0 -57
  21. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  22. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  23. package/.idea/vcs.xml +0 -6
  24. package/.idea/workspace.xml +0 -67
  25. package/.prettierignore +0 -2
  26. package/.prettierrc.json +0 -1
  27. package/.vscode/settings.json +0 -13
  28. package/CONTRIBUTING.md +0 -36
  29. package/public/demo/index.html +0 -347
  30. package/public/demo/secret.html +0 -63
  31. package/src/MyPubnub.ts +0 -792
  32. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section-styles.ts +0 -86
  33. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section.ts +0 -94
  34. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +0 -47
  35. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +0 -50
  36. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +0 -46
  37. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +0 -70
  38. package/src/WebComponent/FeeCalculator/components/index.ts +0 -3
  39. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +0 -39
  40. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +0 -39
  41. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +0 -280
  42. package/src/WebComponent/FeeCalculator/fee-calculator.ts +0 -256
  43. package/src/WebComponent/FeeCalculator/index.ts +0 -4
  44. package/src/WebComponent/FeeCalculator/model/building-fee.ts +0 -83
  45. package/src/WebComponent/FeeCalculator/model/transaction-category.ts +0 -23
  46. package/src/WebComponent/LeadSourceClient.ts +0 -332
  47. package/src/WebComponent/MEChat.css +0 -5
  48. package/src/WebComponent/OfficeHours.ts +0 -73
  49. package/src/WebComponent/Scheduler/date-picker.ts +0 -405
  50. package/src/WebComponent/Scheduler/time-picker.ts +0 -190
  51. package/src/WebComponent/Scheduler/tour-scheduler.ts +0 -1352
  52. package/src/WebComponent/Scheduler/tour-type-option.ts +0 -112
  53. package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +0 -418
  54. package/src/WebComponent/actions/InputStyles.ts +0 -57
  55. package/src/WebComponent/actions/action-confirm-button.ts +0 -125
  56. package/src/WebComponent/actions/call-us-window.ts +0 -445
  57. package/src/WebComponent/actions/collapse-expand-button.ts +0 -65
  58. package/src/WebComponent/actions/details-window.ts +0 -150
  59. package/src/WebComponent/actions/email-us-window.ts +0 -555
  60. package/src/WebComponent/actions/formatPhoneNumber.ts +0 -72
  61. package/src/WebComponent/actions/minimize-expand-button.ts +0 -93
  62. package/src/WebComponent/chat-additional-actions.ts +0 -135
  63. package/src/WebComponent/health-chat.ts +0 -270
  64. package/src/WebComponent/healthchat-styles.ts +0 -119
  65. package/src/WebComponent/icons/ApplyOutlineIcon.ts +0 -22
  66. package/src/WebComponent/icons/BookTourOutlineIcon.ts +0 -13
  67. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +0 -22
  68. package/src/WebComponent/icons/ChatOutlineIcon.ts +0 -10
  69. package/src/WebComponent/icons/ChevronLeftIcon.ts +0 -7
  70. package/src/WebComponent/icons/ChevronRightIcon.ts +0 -7
  71. package/src/WebComponent/icons/ContactResidentIcon.ts +0 -9
  72. package/src/WebComponent/icons/DollarOutlineIcon.ts +0 -18
  73. package/src/WebComponent/icons/EmailOutlineIcon.ts +0 -7
  74. package/src/WebComponent/icons/HeyThereEmojiIcon.ts +0 -12
  75. package/src/WebComponent/icons/PhoneOutlineIcon.ts +0 -7
  76. package/src/WebComponent/icons/SendMessageIcon.ts +0 -17
  77. package/src/WebComponent/icons/TourSelfGuidedIcon.ts +0 -17
  78. package/src/WebComponent/icons/TourVirtuallyIcon.ts +0 -17
  79. package/src/WebComponent/icons/TourWithAgentIcon.ts +0 -17
  80. package/src/WebComponent/icons/XOutlineIcon.ts +0 -8
  81. package/src/WebComponent/index.ts +0 -2
  82. package/src/WebComponent/launcher/Launcher.ts +0 -1193
  83. package/src/WebComponent/launcher/launcherStyles.ts +0 -500
  84. package/src/WebComponent/launcher/mobile-launcher.ts +0 -159
  85. package/src/WebComponent/launcher/typeEmojiStyles.ts +0 -161
  86. package/src/WebComponent/launcher/typeMiniStyles.ts +0 -60
  87. package/src/WebComponent/launcher/typeMobileStyles.ts +0 -50
  88. package/src/WebComponent/leasing-chat-styles.ts +0 -114
  89. package/src/WebComponent/me-chat.ts +0 -1257
  90. package/src/WebComponent/me-select.ts +0 -322
  91. package/src/WebComponent/mini-loader.ts +0 -28
  92. package/src/WebComponent/pubnub-chat-styles.ts +0 -204
  93. package/src/WebComponent/pubnub-chat.ts +0 -928
  94. package/src/WebComponent/pubnub-media.ts +0 -208
  95. package/src/WebComponent/pubnub-message-styles.ts +0 -54
  96. package/src/WebComponent/pubnub-message.ts +0 -431
  97. package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +0 -34
  98. package/src/WebComponent/simple-launcher/simple-launcher.ts +0 -100
  99. package/src/WebComponent/utilities-chat.ts +0 -270
  100. package/src/WebComponent/utilities-styles.ts +0 -110
  101. package/src/WebComponent/utils.ts +0 -82
  102. package/src/analytics.ts +0 -217
  103. package/src/assetUrls.ts +0 -6
  104. package/src/disclaimers.ts +0 -58
  105. package/src/fetchBuildingABTestType.ts +0 -21
  106. package/src/fetchBuildingInfo.ts +0 -87
  107. package/src/fetchBuildingWebchatView.ts +0 -154
  108. package/src/fetchFeatureFlag.ts +0 -250
  109. package/src/fetchLeadSources.ts +0 -98
  110. package/src/fetchPhoneNumberFromSource.ts +0 -31
  111. package/src/fetchWebchatPreferences.ts +0 -54
  112. package/src/getAvailabilities.ts +0 -174
  113. package/src/getBuildingPhoneNumber.ts +0 -26
  114. package/src/getShouldAllowScheduling.ts +0 -16
  115. package/src/getShouldShowWebchat.ts +0 -114
  116. package/src/getTimezoneString.ts +0 -39
  117. package/src/globals.ts +0 -1
  118. package/src/gtm.ts +0 -17
  119. package/src/handleChatId.ts +0 -101
  120. package/src/insertDNIIntoWebsite.ts +0 -146
  121. package/src/insertLeadSourceIntoSchedulerLinks.ts +0 -71
  122. package/src/main/MEChat.test.ts +0 -110
  123. package/src/main/MEChat.ts +0 -404
  124. package/src/main/utils.ts +0 -70
  125. package/src/postLeadSources.ts +0 -44
  126. package/src/rentgrata.ts +0 -74
  127. package/src/replaceSelectButtonsWithNewLink.ts +0 -68
  128. package/src/services/fees/fetchBuildingFees.ts +0 -28
  129. package/src/svgIcons.ts +0 -14
  130. package/src/themes.ts +0 -65
  131. package/src/types/rest-sdk.types.ts +0 -13
  132. package/src/types/webchat-no-show-reason.ts +0 -6
  133. package/src/utils.ts +0 -121
  134. package/tsconfig.json +0 -84
  135. package/web-test-runner.config.js +0 -10
  136. package/webpack.config.cjs +0 -48
@@ -1,445 +0,0 @@
1
- import axios from "axios";
2
- import { css, html, LitElement, TemplateResult } from "lit";
3
- import { customElement, property, state } from "lit/decorators.js";
4
- import { classMap } from "lit/directives/class-map.js";
5
- import { createRef, ref, Ref } from "lit/directives/ref.js";
6
- import { pushGtmEvent } from "../../gtm";
7
- import { isMobile } from "../../utils";
8
- import { PhoneOutlineIcon } from "../icons/PhoneOutlineIcon";
9
- import LeadSourceClient, {
10
- getDefaultLeadSourceAttribution,
11
- } from "../LeadSourceClient";
12
-
13
- import { getOfficeHourText } from "../OfficeHours";
14
- import {
15
- formatToPhoneInput,
16
- isModifierKey,
17
- isNumericInput,
18
- } from "./formatPhoneNumber";
19
- import { InputStyles } from "./InputStyles";
20
-
21
- @customElement("call-us-window")
22
- export class CallUsWindow extends LitElement {
23
- static styles = [
24
- InputStyles,
25
- css`
26
- #call-us-window__content-wrapper {
27
- font-family: "Helvetica Neue", Arial;
28
- font-style: normal;
29
- color: 11ee1e;
30
- font-size: 14px;
31
- }
32
- .call-us-window__header {
33
- font-family: "Helvetica Neue", Arial;
34
- font-style: normal;
35
- font-weight: 700;
36
- line-height: 140%;
37
- font-size: 14px;
38
- margin: 0;
39
- }
40
-
41
- .call-us-window__call-us-text {
42
- margin: 0 0 10px;
43
- }
44
-
45
- .call-us-window__phone-redirect {
46
- display: flex;
47
- justify-content: flex-start;
48
- align-items: center;
49
- margin-bottom: 28px;
50
- gap: 8px;
51
-
52
- color: #202020;
53
- font-size: 18px;
54
- line-height: 24px;
55
- }
56
- .call-us-window__phone-redirect > a {
57
- color: unset;
58
- text-decoration: underline;
59
- }
60
-
61
- .call-us-window__office-hours-wrapper {
62
- margin: 0 0 16px;
63
- }
64
-
65
- .call-us-window__oh-header {
66
- line-height: 32px;
67
- font-weight: 400;
68
- }
69
- .call-us-window__day-of-week-wrapper {
70
- font-weight: 400;
71
- line-height: 22px;
72
- color: #202020;
73
- }
74
-
75
- .call-us-window__day-of-week {
76
- width: 100px;
77
- text-transform: Capitalize;
78
- }
79
-
80
- .call-us-window__day-of-week-wrapper {
81
- display: flex;
82
- align-items: center;
83
- margin-bottom: 5px;
84
- }
85
-
86
- .call-us-window__open-times {
87
- width: 123px;
88
- text-transform: lowercase;
89
- text-align: right;
90
- }
91
-
92
- .text-us-wrapper {
93
- color: #202020;
94
- }
95
- .text-us-window__header {
96
- font-family: "Helvetica Neue", Arial;
97
- font-style: normal;
98
- font-weight: 700;
99
- line-height: 140%;
100
- font-size: 14px;
101
- margin: 0;
102
- }
103
-
104
- .text-us-window__input-container {
105
- margin-top: 8px;
106
- margin-bottom: 8px;
107
- width: -webkit-fill-available;
108
- position: relative;
109
- }
110
- .text-us-window__submit-text {
111
- position: absolute;
112
- top: 14px;
113
- right: 6px;
114
- }
115
- .text-us-window__vertical-spacer {
116
- height: 20px;
117
- }
118
- .text-us-window__description,
119
- .text-us-window__error {
120
- font-family: "Helvetica Neue", Arial;
121
- font-style: normal;
122
- font-weight: 400;
123
- font-size: 10px;
124
- line-height: 14px;
125
- }
126
-
127
- .text-us-window__error {
128
- color: rgb(255, 49, 3);
129
- }
130
- `,
131
- ];
132
-
133
- @property({ attribute: true })
134
- buildingSlug = "";
135
- @property({ attribute: true })
136
- orgSlug = "";
137
-
138
- @property({ attribute: false })
139
- onCloseClicked?: (e: MouseEvent) => void;
140
-
141
- @property()
142
- phoneNumberToCall = "";
143
-
144
- @property()
145
- phoneNumberToText = "";
146
-
147
- @property({ attribute: false })
148
- buildingId = 0;
149
- @property({ attribute: false })
150
- buildingName = "";
151
- @property({ attribute: true })
152
- chatCallUsHeader = "";
153
-
154
- @property({ attribute: true })
155
- hasCallUsEnabled = "";
156
-
157
- @property({ attribute: true })
158
- hasTextUsEnabled = "";
159
-
160
- @property({ attribute: true })
161
- currentLeadSource = "";
162
-
163
- @property({ attribute: true })
164
- orgLegalName = "";
165
-
166
- @property({ attribute: true })
167
- private leadSourceClient: LeadSourceClient | null = null;
168
-
169
- phoneNumberInputRef: Ref<HTMLInputElement> = createRef();
170
-
171
- @state()
172
- hasSubmittedForm = false;
173
- @state()
174
- hasPhoneNumberError = false;
175
- @state()
176
- hasSubmissionError = false;
177
-
178
- @state()
179
- submittingTextUsOption = false;
180
-
181
- @property({ attribute: false })
182
- officeHoursTextInfo: (
183
- | string
184
- | { dayOfWeek: string; startTime: string; endTime: string }
185
- )[] = [];
186
-
187
- firstUpdated = async (): Promise<void> => {
188
- if (!this.buildingId || !this.hasCallUsEnabled) return;
189
- this.officeHoursTextInfo = await getOfficeHourText(this.buildingId);
190
- };
191
-
192
- getCallLink = (phoneNumber: string): TemplateResult => {
193
- const rawNumber = (phoneNumber.match(/\d+/g) || []).join("");
194
- const rawInternationalNumber =
195
- rawNumber.length < 11 ? `1${rawNumber}` : rawNumber;
196
- const formattedInternationalNumber = `+${
197
- rawInternationalNumber[0]
198
- }-${rawInternationalNumber.slice(1, 4)}-${rawInternationalNumber.slice(
199
- 4,
200
- 7
201
- )}-${rawInternationalNumber.slice(7)}`;
202
- return html`<a href="tel:${formattedInternationalNumber}"
203
- >${phoneNumber}</a
204
- >`;
205
- };
206
-
207
- enforcePhoneFormat = (e: KeyboardEvent): void => {
208
- if (!isNumericInput(e) && !isModifierKey(e)) {
209
- e.preventDefault();
210
- }
211
- };
212
- onSubmitTextUs = async (): Promise<void> => {
213
- this.hasPhoneNumberError = false;
214
- this.hasSubmissionError = false;
215
- if (!this.phoneNumberToText || this.phoneNumberToText.length !== 14) {
216
- this.hasPhoneNumberError = true;
217
- }
218
- if (this.hasPhoneNumberError) {
219
- return;
220
- }
221
- try {
222
- this.submittingTextUsOption = true;
223
- await createTextWithUs(
224
- this.phoneNumberToText,
225
- this.buildingId,
226
- this.orgSlug,
227
- this.buildingSlug,
228
- [
229
- ...new Set(
230
- this.currentLeadSource
231
- ? [
232
- this.currentLeadSource,
233
- getDefaultLeadSourceAttribution(this.orgSlug),
234
- ]
235
- : [getDefaultLeadSourceAttribution(this.orgSlug)]
236
- ),
237
- ],
238
- this.leadSourceClient?.chatId
239
- );
240
- this.leadSourceClient?.checkAndHandleForLogLeadSource({
241
- webchatAction: "text-us",
242
- stateId: null,
243
- });
244
- this.hasSubmittedForm = true;
245
- this.submittingTextUsOption = false;
246
- } catch (e) {
247
- this.submittingTextUsOption = false;
248
- this.hasSubmissionError = true;
249
- }
250
- };
251
-
252
- onChangePhoneNumber = (e: Event): void => {
253
- if (!e.target || !this.phoneNumberInputRef.value) {
254
- return;
255
- }
256
- if (isModifierKey(e as KeyboardEvent)) {
257
- return;
258
- }
259
- const inputElement = e.target as HTMLInputElement;
260
-
261
- this.phoneNumberToText = formatToPhoneInput(inputElement.value);
262
-
263
- this.phoneNumberInputRef.value.value = this.phoneNumberToText;
264
- };
265
-
266
- private renderFormTextUsOption = (): TemplateResult => {
267
- return html` <div class="text-us-wrapper">
268
- <h1 class="text-us-window__header">Send Us a Text</h1>
269
- <div class="text-us-window__input-container">
270
- <input
271
- ${ref(this.phoneNumberInputRef)}
272
- maxlength="14"
273
- type="text"
274
- placeholder="Enter phone"
275
- inputmode="tel"
276
- class=${classMap({
277
- ["webchat-input"]: true,
278
- ["text-us-window__input-container"]: true,
279
- ["webchat-font__desktop"]: !isMobile(),
280
- ["webchat-font__mobile"]: isMobile(),
281
- })}
282
- .value=${this.phoneNumberToText}
283
- @keydown=${this.enforcePhoneFormat}
284
- @keyup=${this.onChangePhoneNumber}
285
- />
286
- <div class="text-us-window__submit-text">
287
- <action-confirm-button
288
- .onClick=${this.onSubmitTextUs}
289
- .isLoading=${this.submittingTextUsOption}
290
- text="SEND"
291
- ></action-confirm-button>
292
- </div>
293
- ${this.hasPhoneNumberError
294
- ? html`
295
- <div class="text-us-window__error">
296
- Enter a valid phone number
297
- </div>
298
- `
299
- : ""}
300
- </div>
301
-
302
- <div class="text-us-window__description">
303
- By providing your number and clicking send, you consent to receive
304
- recurring marketing calls and voice and text messages from or on behalf
305
- of ${this.orgLegalName} at this number using artificial voice or an
306
- autodialer system. Messages may be AI or human generated. This consent
307
- is not required to lease at this property. Msg & Data rates may apply.
308
- You consent to this
309
- <a target="_blank" href="http://bit.ly/me_privacy_policy"
310
- >privacy policy</a
311
- >, including having your number and communications recorded and used by
312
- a third party.
313
- </div>
314
- </div>`;
315
- };
316
-
317
- private renderSubmittedTextUsOption = (): TemplateResult => {
318
- return html`
319
- <div id="text-us-container-focus" class="text-us-wrapper">
320
- <div class="text-us-window__vertical-spacer"></div>
321
- <svg
322
- width="20"
323
- height="20"
324
- viewBox="0 0 20 20"
325
- fill="none"
326
- xmlns="http://www.w3.org/2000/svg"
327
- >
328
- <path
329
- d="M4.455 16L0 19.5V1C0 0.734784 0.105357 0.48043 0.292893 0.292893C0.48043 0.105357 0.734784 0 1 0H19C19.2652 0 19.5196 0.105357 19.7071 0.292893C19.8946 0.48043 20 0.734784 20 1V15C20 15.2652 19.8946 15.5196 19.7071 15.7071C19.5196 15.8946 19.2652 16 19 16H4.455ZM2 15.385L3.763 14H18V2H2V15.385ZM10 7V4L14 8L10 12V9H6V7H10Z"
330
- fill="#202020"
331
- />
332
- </svg>
333
- <div class="text-us-window__description">
334
- Thank you!<br />Look for a text message from our team. We can answer
335
- questions and help you book a tour through text.
336
- </div>
337
- <div class="text-us-window__description">
338
- Opt out at anytime by texting “Stop”
339
- </div>
340
- </div>
341
- `;
342
- };
343
-
344
- render = (): TemplateResult => {
345
- return html`
346
- <details-window
347
- id="details-window"
348
- height=${this.hasTextUsEnabled ? "600px" : "443px"}
349
- .onCloseClick=${this.onCloseClicked}
350
- >
351
- ${this.hasCallUsEnabled
352
- ? html` <div id="call-us-window__content-wrapper">
353
- <h1 class="call-us-window__call-us-text call-us-window__header">
354
- Contact Our Leasing Team
355
- </h1>
356
- <div class="call-us-window__phone-redirect">
357
- ${PhoneOutlineIcon("black")}
358
- ${this.getCallLink(this.phoneNumberToCall)}
359
- </div>
360
- <div class="call-us-window__office-hours-wrapper">
361
- <h1 class="call-us-window__oh-header call-us-window__header">
362
- Office Hours
363
- </h1>
364
- ${this.officeHoursTextInfo.map((oh) => {
365
- if (typeof oh === "string") {
366
- return html`
367
- <div class="call-us-window__day-of-week-wrapper">
368
- <div class="call-us-window__day-of-week">${oh}</div>
369
- <div class="call-us-window__closed">Closed</div>
370
- </div>
371
- `;
372
- }
373
- return html`
374
- <div class="call-us-window__day-of-week-wrapper">
375
- <div class="call-us-window__day-of-week">
376
- ${oh.dayOfWeek}
377
- </div>
378
- <div class="call-us-window__open-times">
379
- ${oh.startTime}&nbsp;&ndash;&nbsp;${oh.endTime}
380
- </div>
381
- </div>
382
- `;
383
- })}
384
- </div>
385
- </div>`
386
- : ""}
387
- ${this.hasTextUsEnabled
388
- ? this.hasSubmittedForm
389
- ? this.renderSubmittedTextUsOption()
390
- : this.renderFormTextUsOption()
391
- : ""}
392
- </details-window>
393
- `;
394
- };
395
- }
396
-
397
- export const installCallUsWindow = (): void => {
398
- if (!window.customElements.get("call-us-window")) {
399
- window.customElements.define("call-us-window", CallUsWindow);
400
- }
401
- };
402
-
403
- const createTextWithUs = async (
404
- rawPhoneNumber: string,
405
- buildingId: number,
406
- orgSlug: string,
407
- buildingSlug: string,
408
- leadSources: string[],
409
- chatId?: string | null
410
- ) => {
411
- const formattedPhoneNumber =
412
- "+1" +
413
- rawPhoneNumber
414
- .replace("(", "")
415
- .replace(")", "")
416
- .replace(" ", "")
417
- .replace("-", "");
418
- const queryParams = new URLSearchParams(window.location.search);
419
- const requestBody = {
420
- building_id: buildingId,
421
- lead_sources: leadSources,
422
- phone_number: formattedPhoneNumber,
423
- referrer: document.referrer,
424
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
425
- // @ts-ignore
426
- query_params: Object.fromEntries(queryParams.entries()),
427
- conversation_tracking_id: chatId,
428
- };
429
- pushGtmEvent("textUsSubmitted", {
430
- phone: formattedPhoneNumber,
431
- originatingSource:
432
- leadSources.find((i) => i !== "property-website") || null,
433
- });
434
- await axios.post(
435
- "https://app.meetelise.com/platformApi/state/create/textMe",
436
- requestBody,
437
- {
438
- headers: {
439
- ["building-slug"]: buildingSlug,
440
- ["org-slug"]: orgSlug,
441
- ["X-SecurityKey"]: "JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG",
442
- },
443
- }
444
- );
445
- };
@@ -1,65 +0,0 @@
1
- import { css, html, LitElement, TemplateResult } from "lit";
2
- import { customElement, property } from "lit/decorators.js";
3
- import { styleMap } from "lit/directives/style-map.js";
4
- import { defaultPrimaryColor } from "../../themes";
5
- import { ChevronLeftIcon } from "../icons/ChevronLeftIcon";
6
- import { ChevronRightIcon } from "../icons/ChevronRightIcon";
7
-
8
- @customElement("collapse-expand-button")
9
- export class CollapseExpandButton extends LitElement {
10
- static styles = [
11
- css`
12
- .button-container {
13
- width: 36px;
14
- height: 36px;
15
- background: #ffffff;
16
- border: 1px solid rgba(95, 95, 95, 0.2);
17
- border-radius: 1000px;
18
- display: flex;
19
- justify-content: center;
20
- align-items: center;
21
- cursor: pointer;
22
- }
23
- .inner-container {
24
- width: 30px;
25
- height: 30px;
26
- border-radius: 1000px;
27
- border: 1px solid rgba(255, 255, 255, 0.7);
28
- display: flex;
29
- justify-content: center;
30
- align-items: center;
31
- }
32
- .button-container:hover {
33
- filter: brightness(90%);
34
- }
35
- `,
36
- ];
37
-
38
- @property({ attribute: true })
39
- onClick: () => void = () => {
40
- return;
41
- };
42
-
43
- @property({ attribute: true })
44
- primaryColor: string = defaultPrimaryColor;
45
-
46
- @property({ attribute: true })
47
- toExpand = false;
48
-
49
- render(): TemplateResult {
50
- return html`
51
- <div class=${"button-container"} @click=${this.onClick}>
52
- <div
53
- class="inner-container"
54
- style=${styleMap({
55
- background: this.primaryColor,
56
- })}
57
- >
58
- ${this.toExpand
59
- ? ChevronRightIcon("black")
60
- : ChevronLeftIcon("black")}
61
- </div>
62
- </div>
63
- `;
64
- }
65
- }
@@ -1,150 +0,0 @@
1
- import { css, html, LitElement, TemplateResult } from "lit";
2
- import { customElement, property, state } from "lit/decorators.js";
3
- import { styleMap } from "lit/directives/style-map.js";
4
- import { isMobile } from "../../utils";
5
-
6
- @customElement("details-window")
7
- export class DetailsWindow extends LitElement {
8
- static styles = css`
9
- .details-window-wrapper {
10
- background: rgba(255, 255, 255, 0.9);
11
- box-shadow: 0px 0px 14px 5px rgba(0, 0, 0, 0.25);
12
- backdrop-filter: blur(5px);
13
- /* Note: backdrop-filter has minimal browser support */
14
-
15
- border-radius: 10px 0px 0px 10px;
16
- padding: 49px 18px 24px;
17
- }
18
-
19
- .close-window-button {
20
- position: absolute;
21
- top: 22px;
22
- right: 20px;
23
- cursor: pointer;
24
- width: 20px;
25
- height: 20px;
26
- }
27
- .close-window-button:hover {
28
- filter: brightness(90%);
29
- }
30
-
31
- .gradient-window-wrapper {
32
- background: rgba(0, 0, 0 0.75);
33
- border-width: 3px 0px 3px 3px;
34
- border-style: solid;
35
- border-color: #ffffff;
36
- box-shadow: 0px 0px 14px 5px rgba(0, 0, 0, 0.25);
37
- border-radius: 10px 0px 0px 10px;
38
- padding: 16px;
39
- display: block;
40
- background: linear-gradient(
41
- 154.34deg,
42
- rgba(255, 255, 255, 1) 0.55%,
43
- rgba(0, 0, 0, 1) 160.1%
44
- );
45
- }
46
- .details-window-header {
47
- display: flex;
48
- justify-content: space-between;
49
- }
50
- .header-text {
51
- font-weight: 700;
52
- font-size: 14px;
53
- line-height: 22px;
54
-
55
- font-family: "Helvetica", Arial;
56
- font-style: normal;
57
- font-weight: 700;
58
- font-size: 14px;
59
- line-height: 140%;
60
-
61
- color: #202020;
62
- margin-bottom: 14px;
63
- }
64
-
65
- @media screen and (max-width: 767px) {
66
- .details-window-wrapper {
67
- border-radius: 0px 0px 0px 0px;
68
- }
69
- }
70
- `;
71
- @property({ type: String })
72
- height = "425px";
73
-
74
- @property({ type: String })
75
- width = "326px";
76
-
77
- @property({ type: Boolean })
78
- useRoundedBorders = true;
79
-
80
- @property({ type: String })
81
- headerText = "";
82
-
83
- @property({ attribute: false })
84
- onCloseClick?: (e: MouseEvent) => void;
85
-
86
- @state()
87
- isMobileSized = false;
88
-
89
- @property({ attribute: true })
90
- useGradientDesign = false;
91
-
92
- async firstUpdated(): Promise<void> {
93
- // Give the browser a chance to paint
94
- await new Promise((resolve) => setTimeout(resolve, 0));
95
- this.isMobileSized = isMobile();
96
- window.addEventListener("resize", () => {
97
- this.isMobileSized = isMobile();
98
- });
99
- }
100
-
101
- render(): TemplateResult {
102
- return html`
103
- <div
104
- id="details-window-inner"
105
- class="details-window-wrapper"
106
- style=${styleMap({
107
- width: this.isMobileSized ? "-webkit-fill-available" : this.width,
108
- })}
109
- >
110
- <div class="details-window-header">
111
- ${this.headerText
112
- ? html` <div class="header-text">${this.headerText}</div>`
113
- : ""}
114
- ${this.onCloseClick
115
- ? html`<div @click=${this.onCloseClick} class="close-window-button">
116
- <svg
117
- width="19"
118
- height="19"
119
- viewBox="0 0 19 19"
120
- fill="none"
121
- xmlns="http://www.w3.org/2000/svg"
122
- >
123
- <line
124
- x1="0.986863"
125
- y1="18.2746"
126
- x2="18.2929"
127
- y2="0.968589"
128
- stroke="#202020"
129
- stroke-width="2"
130
- />
131
- <path
132
- d="M1.01394 0.999974L18.0103 18.0242"
133
- stroke="#202020"
134
- stroke-width="2"
135
- />
136
- </svg>
137
- </div>`
138
- : ""}
139
- </div>
140
- <slot class="details-window__slot-content"></slot>
141
- </div>
142
- `;
143
- }
144
- }
145
-
146
- export const installDetailsWindow = (): void => {
147
- if (!window.customElements.get("details-window")) {
148
- window.customElements.define("details-window", DetailsWindow);
149
- }
150
- };