@meetelise/chat 1.43.38 → 1.43.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.43.38",
3
+ "version": "1.43.39",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/MeetElise/chat-ui#readme",
@@ -76,40 +76,50 @@ var e={2:(e,t,n)=>{var i=n(2199),r=n(4664),o=n(5950);e.exports=function(e){retur
76
76
  </button>`}),c=Yt(7,u);return B`
77
77
  <div id="calendar">
78
78
  <div id="header">
79
- <h1>${Gt[this.monthShown]} ${this.yearShown}</h1>
79
+ <h2 aria-live="polite" aria-atomic="true">
80
+ ${Gt[this.monthShown]} ${this.yearShown}
81
+ </h2>
80
82
  <div
81
83
  id="arrows"
82
84
  @click="${e=>{var t,n;(null===(t=e.target)||void 0===t?void 0:t.closest("#back"))&&!qe(this.now,new Date(this.yearShown,this.monthShown,1))&&this.monthShown--,(null===(n=e.target)||void 0===n?void 0:n.closest("#forward"))&&this.monthShown++}}"
83
- @keydown="${e=>{var t,n;[" ","Enter"].includes(e.key)&&((null===(t=e.target)||void 0===t?void 0:t.closest("#back"))&&!qe(this.now,new Date(this.yearShown,this.monthShown,1))?(e.preventDefault(),e.stopPropagation(),this.monthShown--):(null===(n=e.target)||void 0===n?void 0:n.closest("#forward"))&&(e.preventDefault(),e.stopPropagation(),this.monthShown++))}}"
84
85
  >
85
- <svg
86
+ <button
86
87
  id="back"
87
- tabindex="0"
88
- width="9"
89
- height="16"
90
- viewBox="0 0 9 16"
91
- fill="none"
92
- xmlns="http://www.w3.org/2000/svg"
93
- >
94
- <path
95
- d="M8.67727 2.34317L7.26305 0.928955L0.192017 8.00001L7.26308 15.0711L8.6773 13.6569L3.02044 8L8.67727 2.34317Z"
96
- fill="#83818E"
97
- />
98
- </svg>
99
- <svg
100
- id="forward"
101
- tabindex="0"
102
- width="9"
103
- height="16"
104
- viewBox="0 0 9 16"
105
- fill="none"
106
- xmlns="http://www.w3.org/2000/svg"
88
+ type="button"
89
+ aria-label="Previous month"
90
+ ?disabled=${qe(this.now,new Date(this.yearShown,this.monthShown,1))}
107
91
  >
108
- <path
109
- d="M0.157227 2.34315L1.57144 0.928932L8.64251 8L1.57144 15.0711L0.157227 13.6569L5.81408 8L0.157227 2.34315Z"
110
- fill="#83818E"
111
- />
112
- </svg>
92
+ <svg
93
+ aria-hidden="true"
94
+ focusable="false"
95
+ width="9"
96
+ height="16"
97
+ viewBox="0 0 9 16"
98
+ fill="none"
99
+ xmlns="http://www.w3.org/2000/svg"
100
+ >
101
+ <path
102
+ d="M8.67727 2.34317L7.26305 0.928955L0.192017 8.00001L7.26308 15.0711L8.6773 13.6569L3.02044 8L8.67727 2.34317Z"
103
+ fill="#83818E"
104
+ />
105
+ </svg>
106
+ </button>
107
+ <button id="forward" type="button" aria-label="Next month">
108
+ <svg
109
+ aria-hidden="true"
110
+ focusable="false"
111
+ width="9"
112
+ height="16"
113
+ viewBox="0 0 9 16"
114
+ fill="none"
115
+ xmlns="http://www.w3.org/2000/svg"
116
+ >
117
+ <path
118
+ d="M0.157227 2.34315L1.57144 0.928932L8.64251 8L1.57144 15.0711L0.157227 13.6569L5.81408 8L0.157227 2.34315Z"
119
+ fill="#83818E"
120
+ />
121
+ </svg>
122
+ </button>
113
123
  </div>
114
124
  </div>
115
125
 
@@ -163,7 +173,7 @@ var e={2:(e,t,n)=>{var i=n(2199),r=n(4664),o=n(5950);e.exports=function(e){retur
163
173
  margin-bottom: 13px;
164
174
  }
165
175
 
166
- h1 {
176
+ h2 {
167
177
  font-weight: 600;
168
178
  font-size: 12px;
169
179
  margin: 0;
@@ -177,6 +187,23 @@ var e={2:(e,t,n)=>{var i=n(2199),r=n(4664),o=n(5950);e.exports=function(e){retur
177
187
  align-items: center;
178
188
  }
179
189
 
190
+ #arrows button {
191
+ background: none;
192
+ border: none;
193
+ padding: 0;
194
+ margin: 0;
195
+ cursor: pointer;
196
+ display: inline-flex;
197
+ align-items: center;
198
+ justify-content: center;
199
+ color: inherit;
200
+ }
201
+
202
+ #arrows button:disabled {
203
+ cursor: default;
204
+ opacity: 0.4;
205
+ }
206
+
180
207
  #rows {
181
208
  display: flex;
182
209
  flex-direction: column;
@@ -5385,7 +5412,7 @@ xmlns="http://www.w3.org/2000/svg"
5385
5412
  </div>
5386
5413
  </div>
5387
5414
  </div>
5388
- `},this.verticalPillList=()=>{const e="Pacific Urban Residential"===this.orgSlug||"cbc11aba-21c4-4571-bc43-ff9d86a029e3"===this.orgSlug,t=[{pillKey:"Chat",pill:this.hasChatEnabledDesktop?B`
5415
+ `},this.verticalPillList=()=>{const e="Pacific Urban Residential"===this.orgSlug||"cbc11aba-21c4-4571-bc43-ff9d86a029e3"===this.orgSlug,t=[{pillKey:"Chat",optionLabel:"Chat with us",pill:this.hasChatEnabledDesktop?B`
5389
5416
  <button
5390
5417
  class="inner-pill-wrapper"
5391
5418
  style=${Le({background:e?this.backgroundColor:this.primaryColor})}
@@ -5407,7 +5434,7 @@ xmlns="http://www.w3.org/2000/svg"
5407
5434
  ${fa(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
5408
5435
  </div>
5409
5436
  </button>
5410
- `:null},{pillKey:"Price Calculator",pill:this.hasPricingCalculatorEnabledDesktop?B`
5437
+ `:null},{pillKey:"Price Calculator",optionLabel:"Calculate cost",pill:this.hasPricingCalculatorEnabledDesktop?B`
5411
5438
  <button
5412
5439
  @click=${this.onClickPriceCalculatorOption}
5413
5440
  class="inner-pill-wrapper"
@@ -5426,7 +5453,7 @@ xmlns="http://www.w3.org/2000/svg"
5426
5453
  ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5427
5454
  </div>
5428
5455
  </button>
5429
- `:null},{pillKey:"SST",pill:this.hasSSTEnabledDesktop?B`
5456
+ `:null},{pillKey:"SST",optionLabel:"Book a tour",pill:this.hasSSTEnabledDesktop?B`
5430
5457
  <button
5431
5458
  @click=${this.onClickSSTOption}
5432
5459
  id="overlay-inner-pill"
@@ -5450,7 +5477,7 @@ xmlns="http://www.w3.org/2000/svg"
5450
5477
  ${fa(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
5451
5478
  </div>
5452
5479
  </button>
5453
- `:null},{pillKey:"Email",pill:this.hasEmailEnabledDesktop?B`
5480
+ `:null},{pillKey:"Email",optionLabel:"Email an agent",pill:this.hasEmailEnabledDesktop?B`
5454
5481
  <button
5455
5482
  @click=${this.onClickEmailOption}
5456
5483
  class="inner-pill-wrapper"
@@ -5473,7 +5500,7 @@ xmlns="http://www.w3.org/2000/svg"
5473
5500
  ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5474
5501
  </div>
5475
5502
  </button>
5476
- `:null},{pillKey:"Phone",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?B`
5503
+ `:null},{pillKey:"Phone",optionLabel:this.hasCallUsEnabledDesktop&&this.hasTextUsEnabledDesktop?"Call or text us":this.hasCallUsEnabledDesktop?"Call us":"Text us",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?B`
5477
5504
  <button
5478
5505
  @click=${this.onClickPhoneOption}
5479
5506
  class="inner-pill-wrapper"
@@ -5514,7 +5541,7 @@ xmlns="http://www.w3.org/2000/svg"
5514
5541
  ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5515
5542
  </div>
5516
5543
  </button>
5517
- `:null},{pillKey:"Apply",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?B`
5544
+ `:null},{pillKey:"Apply",optionLabel:"Apply now",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?B`
5518
5545
  <button
5519
5546
  @click=${this.onClickApplyNowOption}
5520
5547
  class="inner-pill-wrapper"
@@ -5537,8 +5564,8 @@ xmlns="http://www.w3.org/2000/svg"
5537
5564
  ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5538
5565
  </div>
5539
5566
  </button>
5540
- `:null}].filter(e=>!!e.pill);if(e){const e=t.findIndex(e=>"SST"===e.pillKey);if(-1!==e){const[n]=t.splice(e,1);t.unshift(n)}}return B`
5541
- <div class="vertical-pill-list">
5567
+ `:null}].filter(e=>!!e.pill);if(e){const e=t.findIndex(e=>"SST"===e.pillKey);if(-1!==e){const[n]=t.splice(e,1);t.unshift(n)}}const n=t.map(e=>e.optionLabel);this.overrideRentgrata&&va()&&n.push("Contact a resident");const i=n.length?`EliseAI options: ${n.join(", ")}`:"EliseAI options";return B`
5568
+ <nav class="vertical-pill-list" aria-label=${i}>
5542
5569
  <div class="vertical-pill-list">
5543
5570
  ${this.hasChatEnabledDesktop?B`<button
5544
5571
  @click=${this.onClickMinimize}
@@ -5565,7 +5592,7 @@ xmlns="http://www.w3.org/2000/svg"
5565
5592
  <div class="chevron-right">${fa("black")}</div>
5566
5593
  </button>`:""}
5567
5594
  </div>
5568
- </div>
5595
+ </nav>
5569
5596
  `}}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=vn(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}render(){window.customElements.get("email-us-window")||window.customElements.define("email-us-window",Dr),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",Hr),window.eliseAi.onOpenSST=e=>{this.isSSTWindowOpen=!0,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,this.onExitChat(),e&&e()},(this.hasChatEnabledDesktop||this.hasChatEnabledMobile)&&(window.eliseAi.onOpenChat=e=>{this.handleChatTapped(),this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,e&&e()}),(this.hasCallUsEnabledDesktop||this.hasCallUsEnabledMobile)&&(window.eliseAi.onOpenCallUsWindow=e=>{this.isCallUsWindowOpen=!0,this.isSSTWindowOpen=!1,this.isEmailWindowOpen=!1,this.onExitChat(),e&&e()}),(this.hasEmailEnabledDesktop||this.hasEmailEnabledMobile)&&(window.eliseAi.onOpenEmailUsWindow=e=>{this.isEmailWindowOpen=!0,this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.onExitChat(),e&&e()}),(this.hasPricingCalculatorEnabledDesktop||this.hasPricingCalculatorEnabledMobile)&&(window.eliseAi.onOpenPriceCalculatorWindow=e=>{this.isCalculatorWindowOpen=!0,e&&e()});const e={top:this._isMobile||void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:this._isMobile||void 0===this.bottom||isNaN(this.bottom)?void 0:`${this.bottom}px`,left:this._isMobile||void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:this._isMobile||void 0===this.right||isNaN(this.right)?void 0:`${this.right}px`};return B`
5570
5597
  <div
5571
5598
  class=${ni()({"launcher__mobile-launcher-wrapper":this._isMobile||this.isMinimized,"launcher__mini-launcher-wrapper":!this._isMobile&&!this.isMinimized,"launcher__mini-elevated":"livcor"===this.orgSlug.toLowerCase()&&(this._isMobile||this.isMinimized)})}
@@ -7268,4 +7295,4 @@ xmlns="http://www.w3.org/2000/svg"
7268
7295
  line-height: 150%;
7269
7296
  font-size: 16px;
7270
7297
  }
7271
- `,iu([ue({type:String})],ru.prototype,"orgSlug",void 0),iu([ue({type:Number})],ru.prototype,"right",void 0),iu([ue({type:Number})],ru.prototype,"bottom",void 0),iu([ue({type:Number})],ru.prototype,"top",void 0),iu([ue({type:Number})],ru.prototype,"left",void 0),iu([ce()],ru.prototype,"launcher",void 0),iu([ce()],ru.prototype,"currentLeadSource",void 0),iu([ce()],ru.prototype,"displayPubnubChat",void 0),iu([ce()],ru.prototype,"myPubnub",void 0),iu([ce()],ru.prototype,"requiresConsent",void 0),iu([ce()],ru.prototype,"privacyPolicyUrl",void 0),iu([ce()],ru.prototype,"isLoading",void 0),ru=iu([se("utilities-chat")],ru);const ou=async e=>{const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&Ai({logType:i&&i.data?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),i.data},au=async(e,t=5e3)=>new Promise((n,i)=>{const r=new MutationObserver((t,i)=>{const r=document.getElementById(e);r&&(i.disconnect(),n(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),i(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),n(a))});class su{static healthcareStart(e,t=!0){var n,i,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),uu();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","dialog"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("aria-describedby","aria-describe-info"),a.setAttribute("aria-modal","true"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(n=e.right)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("bottom",(null===(i=e.bottom)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),su.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization,this.hasBuildingSlug=!!e.building,this.overridePlacement={right:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.right,bottom:null===(i=null==e?void 0:e.position)||void 0===i?void 0:i.bottom,top:null===(r=null==e?void 0:e.position)||void 0===r?void 0:r.top,left:null===(o=null==e?void 0:e.position)||void 0===o?void 0:o.left}),uu();let c=null;switch(e.widgetType){case lu.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case lu.Default:c=document.createElement("me-chat");break;case lu.Utilities:c=document.createElement("utilities-chat");break;default:c=document.createElement("me-chat")}if(!c)throw new Error("Invalid widget type");c.setAttribute("orgSlug","Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization),c.setAttribute("widgetType",e.widgetType||lu.Default),c.setAttribute("class","meetelise-chat"),c.setAttribute("role","dialog"),c.setAttribute("aria-label","EliseAI Widget"),c.setAttribute("aria-describedby","aria-describe-info"),c.setAttribute("aria-modal","true"),e.brandColor&&(this.brandColor=e.brandColor,c.setAttribute("primaryColor",((e,t)=>{const n=Be(e),i=0,r=0,o=0,a={r:n.r+Math.round((i-n.r)*t),g:n.g+Math.round((r-n.g)*t),b:n.b+Math.round((o-n.b)*t)};return je(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),c instanceof Vl&&(this.handleBuildingslug(c,e.organization,e.building,e),e.launcherStyles&&(c.launcherStyles=e.launcherStyles),e.mobileStyles&&(c.mobileStyles=e.mobileStyles),e.onWidgetLoaded&&(c.onWidgetLoaded=e.onWidgetLoaded),e.overrideRentgrata&&((async()=>{const e=await au("rg-widget-compact");e&&e.setAttribute("style","display: none")})(),c.overrideRentgrata=!0),e.onSstClose&&(c.onSstClose=e.onSstClose)),e.position&&(c.setAttribute("right",(null===(a=e.position.right)||void 0===a?void 0:a.toString())||"unset"),c.setAttribute("bottom",(null===(s=e.position.bottom)||void 0===s?void 0:s.toString())||"unset"),c.setAttribute("top",(null===(l=e.position.top)||void 0===l?void 0:l.toString())||"unset"),c.setAttribute("left",(null===(u=e.position.left)||void 0===u?void 0:u.toString())||"unset")),window.eliseAi={},document.body.appendChild(c),c instanceof Vl&&(su.meChat=c),c instanceof ru&&(su.utilitiesChat=c)}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),su.meChat=null)}static async handleBuildingslug(e,t,n,i){if(n)return void e.setAttribute("buildingSlug",n);if(this.mutationObserver)return;if(!t)return;const r=await ou(t);if(r){const e={...i,organization:t,building:r};this.start(e,!1)}this.previousUrl=window.location.href,document.body.addEventListener("click",()=>{requestAnimationFrame(()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,ou(t).then(e=>{if(!e)return;const n={...i,organization:t,building:e};this.start(n,!1)}))})},!0)}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,t=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,n=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&Ai({logType:n&&n.data?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),!n||!n.data)return;const i={organization:this.orgSlug,building:n.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(i,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&Ai({logType:i&&i.data===e?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i&&i.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:i&&i.data===e?null:i&&!i.data?"No match found":i&&i.data!==e?"Mismatch":"No match found"}}),i&&i.data}}var lu;su.meChat=null,su.healthChat=null,su.utilitiesChat=null,su.orgSlug="",su.mutationObserver=null,su.previousUrl="",su.hasBuildingSlug=null,su.brandColor="",su.backgroundColor="",su.healthcareId="",su.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(lu||(lu={}));const uu=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{lu as WidgetType,su as default};
7298
+ `,iu([ue({type:String})],ru.prototype,"orgSlug",void 0),iu([ue({type:Number})],ru.prototype,"right",void 0),iu([ue({type:Number})],ru.prototype,"bottom",void 0),iu([ue({type:Number})],ru.prototype,"top",void 0),iu([ue({type:Number})],ru.prototype,"left",void 0),iu([ce()],ru.prototype,"launcher",void 0),iu([ce()],ru.prototype,"currentLeadSource",void 0),iu([ce()],ru.prototype,"displayPubnubChat",void 0),iu([ce()],ru.prototype,"myPubnub",void 0),iu([ce()],ru.prototype,"requiresConsent",void 0),iu([ce()],ru.prototype,"privacyPolicyUrl",void 0),iu([ce()],ru.prototype,"isLoading",void 0),ru=iu([se("utilities-chat")],ru);const ou=async e=>{const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&Ai({logType:i&&i.data?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),i.data},au=async(e,t=5e3)=>new Promise((n,i)=>{const r=new MutationObserver((t,i)=>{const r=document.getElementById(e);r&&(i.disconnect(),n(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),i(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),n(a))});class su{static healthcareStart(e,t=!0){var n,i,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),uu();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","region"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("aria-describedby","aria-describe-info"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(n=e.right)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("bottom",(null===(i=e.bottom)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),su.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization,this.hasBuildingSlug=!!e.building,this.overridePlacement={right:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.right,bottom:null===(i=null==e?void 0:e.position)||void 0===i?void 0:i.bottom,top:null===(r=null==e?void 0:e.position)||void 0===r?void 0:r.top,left:null===(o=null==e?void 0:e.position)||void 0===o?void 0:o.left}),uu();let c=null;switch(e.widgetType){case lu.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case lu.Default:c=document.createElement("me-chat");break;case lu.Utilities:c=document.createElement("utilities-chat");break;default:c=document.createElement("me-chat")}if(!c)throw new Error("Invalid widget type");c.setAttribute("orgSlug","Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization),c.setAttribute("widgetType",e.widgetType||lu.Default),c.setAttribute("class","meetelise-chat"),c.setAttribute("role","region"),c.setAttribute("aria-label","EliseAI Widget"),c.setAttribute("aria-describedby","aria-describe-info"),e.brandColor&&(this.brandColor=e.brandColor,c.setAttribute("primaryColor",((e,t)=>{const n=Be(e),i=0,r=0,o=0,a={r:n.r+Math.round((i-n.r)*t),g:n.g+Math.round((r-n.g)*t),b:n.b+Math.round((o-n.b)*t)};return je(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),c instanceof Vl&&(this.handleBuildingslug(c,e.organization,e.building,e),e.launcherStyles&&(c.launcherStyles=e.launcherStyles),e.mobileStyles&&(c.mobileStyles=e.mobileStyles),e.onWidgetLoaded&&(c.onWidgetLoaded=e.onWidgetLoaded),e.overrideRentgrata&&((async()=>{const e=await au("rg-widget-compact");e&&e.setAttribute("style","display: none")})(),c.overrideRentgrata=!0),e.onSstClose&&(c.onSstClose=e.onSstClose)),e.position&&(c.setAttribute("right",(null===(a=e.position.right)||void 0===a?void 0:a.toString())||"unset"),c.setAttribute("bottom",(null===(s=e.position.bottom)||void 0===s?void 0:s.toString())||"unset"),c.setAttribute("top",(null===(l=e.position.top)||void 0===l?void 0:l.toString())||"unset"),c.setAttribute("left",(null===(u=e.position.left)||void 0===u?void 0:u.toString())||"unset")),window.eliseAi={},document.body.appendChild(c),c instanceof Vl&&(su.meChat=c),c instanceof ru&&(su.utilitiesChat=c)}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),su.meChat=null)}static async handleBuildingslug(e,t,n,i){if(n)return void e.setAttribute("buildingSlug",n);if(this.mutationObserver)return;if(!t)return;const r=await ou(t);if(r){const e={...i,organization:t,building:r};this.start(e,!1)}this.previousUrl=window.location.href,document.body.addEventListener("click",()=>{requestAnimationFrame(()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,ou(t).then(e=>{if(!e)return;const n={...i,organization:t,building:e};this.start(n,!1)}))})},!0)}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,t=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,n=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&Ai({logType:n&&n.data?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),!n||!n.data)return;const i={organization:this.orgSlug,building:n.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(i,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&Ai({logType:i&&i.data===e?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i&&i.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:i&&i.data===e?null:i&&!i.data?"No match found":i&&i.data!==e?"Mismatch":"No match found"}}),i&&i.data}}var lu;su.meChat=null,su.healthChat=null,su.utilitiesChat=null,su.orgSlug="",su.mutationObserver=null,su.previousUrl="",su.hasBuildingSlug=null,su.brandColor="",su.backgroundColor="",su.healthcareId="",su.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(lu||(lu={}));const uu=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{lu as WidgetType,su as default};
@@ -140,7 +140,7 @@ export class DatePicker extends LitElement {
140
140
  margin-bottom: 13px;
141
141
  }
142
142
 
143
- h1 {
143
+ h2 {
144
144
  font-weight: 600;
145
145
  font-size: 12px;
146
146
  margin: 0;
@@ -154,6 +154,23 @@ export class DatePicker extends LitElement {
154
154
  align-items: center;
155
155
  }
156
156
 
157
+ #arrows button {
158
+ background: none;
159
+ border: none;
160
+ padding: 0;
161
+ margin: 0;
162
+ cursor: pointer;
163
+ display: inline-flex;
164
+ align-items: center;
165
+ justify-content: center;
166
+ color: inherit;
167
+ }
168
+
169
+ #arrows button:disabled {
170
+ cursor: default;
171
+ opacity: 0.4;
172
+ }
173
+
157
174
  #rows {
158
175
  display: flex;
159
176
  flex-direction: column;
@@ -324,7 +341,9 @@ export class DatePicker extends LitElement {
324
341
  return html`
325
342
  <div id="calendar">
326
343
  <div id="header">
327
- <h1>${monthNames[this.monthShown]} ${this.yearShown}</h1>
344
+ <h2 aria-live="polite" aria-atomic="true">
345
+ ${monthNames[this.monthShown]} ${this.yearShown}
346
+ </h2>
328
347
  <div
329
348
  id="arrows"
330
349
  @click="${(e: MouseEvent) => {
@@ -341,55 +360,47 @@ export class DatePicker extends LitElement {
341
360
  this.monthShown++;
342
361
  }
343
362
  }}"
344
- @keydown="${(e: KeyboardEvent) => {
345
- if (![" ", "Enter"].includes(e.key)) {
346
- return;
347
- }
348
- if (
349
- (e.target as HTMLElement)?.closest("#back") &&
350
- !isSameMonth(
351
- this.now,
352
- new Date(this.yearShown, this.monthShown, 1)
353
- )
354
- ) {
355
- e.preventDefault();
356
- e.stopPropagation();
357
- this.monthShown--;
358
- } else if ((e.target as HTMLElement)?.closest("#forward")) {
359
- e.preventDefault();
360
- e.stopPropagation();
361
- this.monthShown++;
362
- }
363
- }}"
364
363
  >
365
- <svg
364
+ <button
366
365
  id="back"
367
- tabindex="0"
368
- width="9"
369
- height="16"
370
- viewBox="0 0 9 16"
371
- fill="none"
372
- xmlns="http://www.w3.org/2000/svg"
373
- >
374
- <path
375
- d="M8.67727 2.34317L7.26305 0.928955L0.192017 8.00001L7.26308 15.0711L8.6773 13.6569L3.02044 8L8.67727 2.34317Z"
376
- fill="#83818E"
377
- />
378
- </svg>
379
- <svg
380
- id="forward"
381
- tabindex="0"
382
- width="9"
383
- height="16"
384
- viewBox="0 0 9 16"
385
- fill="none"
386
- xmlns="http://www.w3.org/2000/svg"
366
+ type="button"
367
+ aria-label="Previous month"
368
+ ?disabled=${isSameMonth(
369
+ this.now,
370
+ new Date(this.yearShown, this.monthShown, 1)
371
+ )}
387
372
  >
388
- <path
389
- d="M0.157227 2.34315L1.57144 0.928932L8.64251 8L1.57144 15.0711L0.157227 13.6569L5.81408 8L0.157227 2.34315Z"
390
- fill="#83818E"
391
- />
392
- </svg>
373
+ <svg
374
+ aria-hidden="true"
375
+ focusable="false"
376
+ width="9"
377
+ height="16"
378
+ viewBox="0 0 9 16"
379
+ fill="none"
380
+ xmlns="http://www.w3.org/2000/svg"
381
+ >
382
+ <path
383
+ d="M8.67727 2.34317L7.26305 0.928955L0.192017 8.00001L7.26308 15.0711L8.6773 13.6569L3.02044 8L8.67727 2.34317Z"
384
+ fill="#83818E"
385
+ />
386
+ </svg>
387
+ </button>
388
+ <button id="forward" type="button" aria-label="Next month">
389
+ <svg
390
+ aria-hidden="true"
391
+ focusable="false"
392
+ width="9"
393
+ height="16"
394
+ viewBox="0 0 9 16"
395
+ fill="none"
396
+ xmlns="http://www.w3.org/2000/svg"
397
+ >
398
+ <path
399
+ d="M0.157227 2.34315L1.57144 0.928932L8.64251 8L1.57144 15.0711L0.157227 13.6569L5.81408 8L0.157227 2.34315Z"
400
+ fill="#83818E"
401
+ />
402
+ </svg>
403
+ </button>
393
404
  </div>
394
405
  </div>
395
406
 
@@ -797,9 +797,11 @@ export class Launcher extends LitElement {
797
797
  const verticalPillListItems: {
798
798
  pillKey: string;
799
799
  pill: TemplateResult | null;
800
+ optionLabel: string;
800
801
  }[] = [
801
802
  {
802
803
  pillKey: "Chat",
804
+ optionLabel: "Chat with us",
803
805
  pill: this.hasChatEnabledDesktop
804
806
  ? html`
805
807
  <button
@@ -844,6 +846,7 @@ export class Launcher extends LitElement {
844
846
  },
845
847
  {
846
848
  pillKey: "Price Calculator",
849
+ optionLabel: "Calculate cost",
847
850
  pill: this.hasPricingCalculatorEnabledDesktop
848
851
  ? html`
849
852
  <button
@@ -875,6 +878,7 @@ export class Launcher extends LitElement {
875
878
  },
876
879
  {
877
880
  pillKey: "SST",
881
+ optionLabel: "Book a tour",
878
882
  pill: this.hasSSTEnabledDesktop
879
883
  ? html`
880
884
  <button
@@ -921,6 +925,7 @@ export class Launcher extends LitElement {
921
925
  },
922
926
  {
923
927
  pillKey: "Email",
928
+ optionLabel: "Email an agent",
924
929
  pill: this.hasEmailEnabledDesktop
925
930
  ? html`
926
931
  <button
@@ -958,6 +963,12 @@ export class Launcher extends LitElement {
958
963
  },
959
964
  {
960
965
  pillKey: "Phone",
966
+ optionLabel:
967
+ this.hasCallUsEnabledDesktop && this.hasTextUsEnabledDesktop
968
+ ? "Call or text us"
969
+ : this.hasCallUsEnabledDesktop
970
+ ? "Call us"
971
+ : "Text us",
961
972
  pill:
962
973
  this.phoneNumber &&
963
974
  (this.hasCallUsEnabledDesktop || this.hasTextUsEnabledDesktop)
@@ -1036,6 +1047,7 @@ export class Launcher extends LitElement {
1036
1047
  },
1037
1048
  {
1038
1049
  pillKey: "Apply",
1050
+ optionLabel: "Apply now",
1039
1051
  pill:
1040
1052
  this.applicationLink && this.hasApplyNowEnabledDesktop
1041
1053
  ? html`
@@ -1081,8 +1093,15 @@ export class Launcher extends LitElement {
1081
1093
  pills.unshift(sstPill);
1082
1094
  }
1083
1095
  }
1096
+ const optionLabels = pills.map((p) => p.optionLabel);
1097
+ if (this.overrideRentgrata && hasRentgrata()) {
1098
+ optionLabels.push("Contact a resident");
1099
+ }
1100
+ const navAriaLabel = optionLabels.length
1101
+ ? `EliseAI options: ${optionLabels.join(", ")}`
1102
+ : "EliseAI options";
1084
1103
  return html`
1085
- <div class="vertical-pill-list">
1104
+ <nav class="vertical-pill-list" aria-label=${navAriaLabel}>
1086
1105
  <div class="vertical-pill-list">
1087
1106
  ${this.hasChatEnabledDesktop
1088
1107
  ? html`<button
@@ -1119,7 +1138,7 @@ export class Launcher extends LitElement {
1119
1138
  </button>`
1120
1139
  : ""}
1121
1140
  </div>
1122
- </div>
1141
+ </nav>
1123
1142
  `;
1124
1143
  };
1125
1144
 
@@ -65,10 +65,9 @@ export default class MEChat {
65
65
  installFont();
66
66
  const healthChat = document.createElement("health-chat");
67
67
  healthChat.setAttribute("class", "health-chat");
68
- healthChat.setAttribute("role", "dialog");
68
+ healthChat.setAttribute("role", "region");
69
69
  healthChat.setAttribute("aria-label", "EliseAI Healthcare Widget");
70
70
  healthChat.setAttribute("aria-describedby", "aria-describe-info");
71
- healthChat.setAttribute("aria-modal", "true");
72
71
  healthChat.setAttribute("healthcareId", opts.id);
73
72
 
74
73
  healthChat.setAttribute("right", opts.right?.toString() || "unset");
@@ -140,10 +139,9 @@ export default class MEChat {
140
139
  opts.widgetType || WidgetType.Default
141
140
  );
142
141
  meChatElement.setAttribute("class", "meetelise-chat");
143
- meChatElement.setAttribute("role", "dialog");
142
+ meChatElement.setAttribute("role", "region");
144
143
  meChatElement.setAttribute("aria-label", "EliseAI Widget");
145
144
  meChatElement.setAttribute("aria-describedby", "aria-describe-info");
146
- meChatElement.setAttribute("aria-modal", "true");
147
145
 
148
146
  if (opts.brandColor) {
149
147
  this.brandColor = opts.brandColor;