@meetelise/chat 1.20.55 → 1.20.56

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.20.55",
3
+ "version": "1.20.56",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -2,7 +2,10 @@
2
2
  <html lang="en-GB">
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
5
+ <meta
6
+ name="viewport"
7
+ content="width=device-width, initial-scale=1 user-scalable=1"
8
+ />
6
9
  <title>Chat Dev Page</title>
7
10
  <style>
8
11
  /* Uncomment this to check if changing the root font size interferes with any of our widget's styles */
@@ -2871,6 +2871,11 @@ xmlns="http://www.w3.org/2000/svg"
2871
2871
  </div>
2872
2872
  `}};Ji.styles=oi,Bi([ue({type:Boolean})],Ji.prototype,"isMobile",void 0),Bi([ue({type:Boolean})],Ji.prototype,"isFirstMount",void 0),Bi([ue()],Ji.prototype,"backgroundColor",void 0),Bi([ue()],Ji.prototype,"textColor",void 0),Bi([ue({type:Boolean})],Ji.prototype,"isMini",void 0),Bi([ue({attribute:!1})],Ji.prototype,"autoOpenChatWidget",void 0),Bi([ue()],Ji.prototype,"phoneNumber",void 0),Bi([ue({attribute:!0})],Ji.prototype,"chatId",void 0),Bi([ue({attribute:!0})],Ji.prototype,"chatCallUsHeader",void 0),Bi([ue({attribute:!1})],Ji.prototype,"buildingId",void 0),Bi([ue({attribute:!0})],Ji.prototype,"buildingSlug",void 0),Bi([ue({attribute:!0})],Ji.prototype,"orgSlug",void 0),Bi([ue({attribute:!0})],Ji.prototype,"sgtUrl",void 0),Bi([ue({attribute:!0})],Ji.prototype,"buildingABTestType",void 0),Bi([ue({attribute:!0})],Ji.prototype,"featureFlagShowDropdown",void 0),Bi([ue({attribute:!1})],Ji.prototype,"leadSources",void 0),Bi([ue({attribute:!0})],Ji.prototype,"currentLeadSource",void 0),Bi([ue({attribute:!0})],Ji.prototype,"escortedToursLink",void 0),Bi([ue({attribute:!0})],Ji.prototype,"virtualToursLink",void 0),Bi([ue({type:Boolean})],Ji.prototype,"hasCallUsEnabled",void 0),Bi([ue({type:Boolean})],Ji.prototype,"hasChatEnabled",void 0),Bi([ue({type:Boolean})],Ji.prototype,"hasEmailEnabled",void 0),Bi([ue({type:Boolean})],Ji.prototype,"hasSSTEnabled",void 0),Bi([ue({type:Boolean})],Ji.prototype,"hasTextUsEnabled",void 0),Bi([ue({attribute:!1})],Ji.prototype,"layoutOptions",void 0),Bi([ue({attribute:!1})],Ji.prototype,"unitOptions",void 0),Bi([ue({attribute:!1})],Ji.prototype,"tourTypeOptions",void 0),Bi([ue({attribute:!1})],Ji.prototype,"onChatTapped",void 0),Bi([ue({attribute:!1})],Ji.prototype,"launcherStyles",void 0),Bi([le()],Ji.prototype,"isEmailWindowOpen",void 0),Bi([le()],Ji.prototype,"isCallUsWindowOpen",void 0),Bi([le()],Ji.prototype,"isSSTWindowOpen",void 0),Bi([le()],Ji.prototype,"isTextUsWindowOpen",void 0),Ji=Bi([ae("meetelise-launcher")],Ji);var ki=n(3379),Li=n.n(ki),ji=n(7795),Hi=n.n(ji),Gi=n(569),Wi=n.n(Gi),Qi=n(3565),Vi=n.n(Qi),zi=n(9216),Xi=n.n(zi),Yi=n(4589),Ki=n.n(Yi),Zi=n(3631),$i={};$i.styleTagTransform=Ki(),$i.setAttributes=Vi(),$i.insert=Wi().bind(null,"head"),$i.domAPI=Hi(),$i.insertStyleElement=Xi(),Li()(Zi.Z,$i),Zi.Z&&Zi.Z.locals&&Zi.Z.locals;var er,tr=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let nr=er=class extends re{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.themeId="Glass",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=ni(),this.chatId="",this.analytics=null,this.isMobile=xn(),this.launcher=null,this.building=null,this.buildingABTestType=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=Cn.always,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.talkjsPopupElement=null,this.yardiDNIScriptInterval=null,this.launcherRef=Ae(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher(),this.isLoading=!1},this.setBuildingDerivedInfo=async()=>{var e,n;if(!this.buildingSlug||!this.orgSlug)return;this.building=await async function(e,t){const n="https://app.meetelise.com",i=`${n}/api/pub/v1/organization/${e}/building/${t}`,r=await fetch(i),o=await r.json(),a=await fetch(`${n}/eliseCrmApi/pub/building/${t}/units`),s=await a.json(),u=await fetch(`${n}/eliseCrmApi/pub/building/${t}/layouts`),l=await u.json();return o.unitOptionsV2=s,o.layoutOptionsV2=l,o}(this.orgSlug,this.buildingSlug);const i=await async function(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/ab-test-type`)).data}catch(e){return null}}(this.buildingSlug);this.leadSources=await async function(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/lead-sources`)).data}catch(e){return[]}}(this.buildingSlug),this.featureFlagShowDropdown=await async function(e){try{const n=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/chat-ui-feature-flag`,{params:{building_slug:e,flag_type:"string",feature_flag:"webchat-marketing-source-dropdown-configuration",default_str:"always",default_bool:!0}});return"on-attribution-failure"===n.data?Cn.onAttributionFailure:"never"===n.data?Cn.never:Cn.always}catch(e){return Cn.always}}(this.buildingSlug),this.currentLeadSource=await async function(e,n){try{return(await t().post("https://app.meetelise.com/platformApi/webchat/current-parsed-lead-source",{query_params:En(),building_slug:e,referrer:n,campaign_sources:Bn()})).data}catch(e){return null}}(this.buildingSlug,document.referrer),this.currentLeadSource&&(this.leadSources.includes(this.currentLeadSource)||this.leadSources.push(this.currentLeadSource)),this.buildingABTestType=null!==(e=null==i?void 0:i.abTestType)&&void 0!==e?e:"",bn(this.building.id),this.chatId=function(e,t){const n=Xn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Yn(e,t),i=localStorage.getItem(n)||zn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Vn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=ni(null!==(n=this.themeId)&&void 0!==n?n:this.building.themeId),this.analytics=new Un(this.orgSlug,this.buildingSlug,this.chatId),this.analytics.ping("webchat_heartbeat")},this.initializeLaunchJS=async()=>{var e;if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[t,n,i,r]=await Promise.all([this.building,this.theme,this.avatarSrc,er.session]);if(t.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(t,n,r,i),this.configureLauncherElement(),null===(e=this.analytics)||void 0===e||e.ping("load"),this.yardiDNIScriptInterval=setInterval((()=>this.pollForYardiCampaignSource()),1e3),setTimeout(clearInterval,15e3,this.yardiDNIScriptInterval)},this.configureLauncherElement=()=>{this.popup&&this.launcherRef.value&&(this.launcher=this.launcherRef.value)},this.configureTalkJSPopup=async(e,t,n,i)=>{var r;const o=n.createPopup(ii(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await o.mount({show:!1}),o.on("close",(()=>{this.hideLauncher=!1}));const a=document.querySelector(".__talkjs_popup");if(this.talkjsPopupElement=a,!a)throw new Error("Failed to find chat window");a.classList.add("meetelise-chat","pane"),this.isMobile||a.classList.add("launcher__desktop"),a.style.zIndex="99999999999",this.popup=o;const s=sessionStorage.getItem("autoOpenedTimestamp"),u=!s||s&&nn(on(s));e.autoOpenChatWidget&&u&&!xn()&&(this.popup.show(),this.hideLauncher=!0,this.hasMounted=!0,sessionStorage.setItem("autoOpenedTimestamp",Zt(function(e,t){Pe(2,arguments);var n=Ke(t);return Ze(e,6e4*n)}(new Date,15))),null===(r=this.analytics)||void 0===r||r.ping("autoOpen"))},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.handleContactClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e)},this.handleContactTabClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickPhoneOption(e)},this.adjustTopHeaderContactCoords=()=>{var e;if(this.talkjsPopupElement){const t=function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}(this.talkjsPopupElement),n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("contactTabPopup");if(!n)return;n.style.left=`${t.left+20}px`,n.style.top=t.top-50+"px"}},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),null===(e=this.analytics)||void 0===e||e.ping("open"),this.hideLauncher=!0,this.hasMounted=!0)})}}pollForYardiCampaignSource(){var e,t,n;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(n=this.analytics)||void 0===n||n.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.popup&&er.session))return;this.chatId=Vn(this.orgSlug,this.buildingSlug);const e=await er.session;this.analytics.chatId=this.chatId,this.popup.select(ii(e,this.building,this.theme,this.avatarSrc||this.building.avatarSrc,this.chatId,this.isMobile))}remove(){var e;null===(e=this.popup)||void 0===e||e.destroy()}open(){var e;null===(e=this.popup)||void 0===e||e.show()}close(){var e;null===(e=this.popup)||void 0===e||e.hide()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustTopHeaderContactCoords)}disconnectedCallback(){window.removeEventListener("resize",this.adjustTopHeaderContactCoords),super.disconnectedCallback()}updated(){this.adjustTopHeaderContactCoords()}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,w,b,S,T,A,x,C,O,I,N,R,E,F;window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Ji);const _=!this.hideLauncher||this.isLoading||this.buildingABTestType!==ri.ConceptBlueBlack&&this.buildingABTestType!==ri.ConceptBlueWhite||this.isMobile;return U`
2873
2873
  <div>
2874
+ <div id="aria-label" style="display: none;">EliseAI Widget</div>
2875
+ <div id="aria-describe" style="display: none;">
2876
+ EliseAI widget that allows you to chat with a virtual assistant, book
2877
+ a tour, contact the leasing office, and more.
2878
+ </div>
2874
2879
  <div
2875
2880
  id="contactTabPopup"
2876
2881
  class=${he({showTab:!_,hideTab:_})}
@@ -2980,4 +2985,4 @@ xmlns="http://www.w3.org/2000/svg"
2980
2985
  .heavyLabel {
2981
2986
  font-weight: bold;
2982
2987
  }
2983
- `,nr.session=Ie.ready.then((()=>{const e=new Ie.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Ie.Session({appId:"ogKIvCor",me:e})})),tr([ue({type:String})],nr.prototype,"buildingSlug",void 0),tr([ue({type:String})],nr.prototype,"orgSlug",void 0),tr([ue({type:String})],nr.prototype,"themeId",void 0),tr([ue({attribute:!1})],nr.prototype,"avatarSrc",void 0),tr([ue({type:Boolean})],nr.prototype,"useMiniWidget",void 0),tr([ue({type:Object})],nr.prototype,"launcherStyles",void 0),tr([le()],nr.prototype,"popup",void 0),tr([le()],nr.prototype,"theme",void 0),tr([le()],nr.prototype,"chatId",void 0),tr([le()],nr.prototype,"analytics",void 0),tr([le()],nr.prototype,"isMobile",void 0),tr([le()],nr.prototype,"launcher",void 0),tr([le()],nr.prototype,"building",void 0),tr([le()],nr.prototype,"buildingABTestType",void 0),tr([le()],nr.prototype,"leadSources",void 0),tr([le()],nr.prototype,"currentLeadSource",void 0),tr([le()],nr.prototype,"featureFlagShowDropdown",void 0),tr([le()],nr.prototype,"hasMounted",void 0),tr([le()],nr.prototype,"hideLauncher",void 0),tr([le()],nr.prototype,"isLoading",void 0),tr([le()],nr.prototype,"talkjsPopupElement",void 0),nr=er=tr([ae("me-chat")],nr);class ir{static start(e,t=!0){if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug=e.organization,this.hasBuildingSlug=!!e.building),rr(),or();const n=document.createElement("me-chat");n.setAttribute("orgSlug",e.organization),this.handleBuildingslug(n,e.building),n.setAttribute("class","meetelise-chat"),e.themeId&&n.setAttribute("themeId",e.themeId),e.avatarSrc&&n.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(n.useMiniWidget=e.mini),e.launcherStyles&&(n.launcherStyles=e.launcherStyles),document.body.appendChild(n),ir.meChat=n}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),ir.meChat=null)}static async handleBuildingslug(e,t){t?e.setAttribute("buildingSlug",t):this.mutationObserver||(this.handleSingleFamilyUrl(),this.previousUrl=window.location.href,document.body.addEventListener("click",(()=>{requestAnimationFrame((()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,this.handleSingleFamilyUrl())}))}),!0))}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,n=`https://app.meetelise.com/eliseCrmApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,i=await t().get(n,{headers:{"org-slug":this.orgSlug}});if(!i||!i.data)return;const r={organization:this.orgSlug,building:i.data};this.start(r,!1)}}ir.meChat=null,ir.orgSlug="",ir.mutationObserver=null,ir.previousUrl="",ir.hasBuildingSlug=null;const rr=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)},or=()=>{const e=document.createElement("meta");e.setAttribute("name","viewport"),e.setAttribute("content","width=device-width, initial-scale=1, maximum-scale=2"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
2988
+ `,nr.session=Ie.ready.then((()=>{const e=new Ie.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Ie.Session({appId:"ogKIvCor",me:e})})),tr([ue({type:String})],nr.prototype,"buildingSlug",void 0),tr([ue({type:String})],nr.prototype,"orgSlug",void 0),tr([ue({type:String})],nr.prototype,"themeId",void 0),tr([ue({attribute:!1})],nr.prototype,"avatarSrc",void 0),tr([ue({type:Boolean})],nr.prototype,"useMiniWidget",void 0),tr([ue({type:Object})],nr.prototype,"launcherStyles",void 0),tr([le()],nr.prototype,"popup",void 0),tr([le()],nr.prototype,"theme",void 0),tr([le()],nr.prototype,"chatId",void 0),tr([le()],nr.prototype,"analytics",void 0),tr([le()],nr.prototype,"isMobile",void 0),tr([le()],nr.prototype,"launcher",void 0),tr([le()],nr.prototype,"building",void 0),tr([le()],nr.prototype,"buildingABTestType",void 0),tr([le()],nr.prototype,"leadSources",void 0),tr([le()],nr.prototype,"currentLeadSource",void 0),tr([le()],nr.prototype,"featureFlagShowDropdown",void 0),tr([le()],nr.prototype,"hasMounted",void 0),tr([le()],nr.prototype,"hideLauncher",void 0),tr([le()],nr.prototype,"isLoading",void 0),tr([le()],nr.prototype,"talkjsPopupElement",void 0),nr=er=tr([ae("me-chat")],nr);class ir{static start(e,t=!0){if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug=e.organization,this.hasBuildingSlug=!!e.building),rr(),or();const n=document.createElement("me-chat");n.setAttribute("orgSlug",e.organization),this.handleBuildingslug(n,e.building),n.setAttribute("class","meetelise-chat"),n.setAttribute("role","dialog"),n.setAttribute("aria-labelledby","aria-label"),n.setAttribute("aria-describedby","aria-describe"),n.setAttribute("aria-modal","true"),e.themeId&&n.setAttribute("themeId",e.themeId),e.avatarSrc&&n.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(n.useMiniWidget=e.mini),e.launcherStyles&&(n.launcherStyles=e.launcherStyles),document.body.appendChild(n),ir.meChat=n}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),ir.meChat=null)}static async handleBuildingslug(e,t){t?e.setAttribute("buildingSlug",t):this.mutationObserver||(this.handleSingleFamilyUrl(),this.previousUrl=window.location.href,document.body.addEventListener("click",(()=>{requestAnimationFrame((()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,this.handleSingleFamilyUrl())}))}),!0))}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,n=`https://app.meetelise.com/eliseCrmApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,i=await t().get(n,{headers:{"org-slug":this.orgSlug}});if(!i||!i.data)return;const r={organization:this.orgSlug,building:i.data};this.start(r,!1)}}ir.meChat=null,ir.orgSlug="",ir.mutationObserver=null,ir.previousUrl="",ir.hasBuildingSlug=null;const rr=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)},or=()=>{const e=document.createElement("meta");e.setAttribute("name","viewport"),e.setAttribute("content","width=device-width, initial-scale=1, maximum-scale=2"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
package/public/index.html CHANGED
@@ -2,7 +2,10 @@
2
2
  <html lang="en-GB">
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
5
+ <meta
6
+ name="viewport"
7
+ content="width=device-width, initial-scale=1 user-scalable=1"
8
+ />
6
9
  <title>Chat Dev Page</title>
7
10
  <style>
8
11
  body {
package/src/MEChat.ts CHANGED
@@ -42,6 +42,10 @@ export default class MEChat {
42
42
  meChat.setAttribute("orgSlug", opts.organization);
43
43
  this.handleBuildingslug(meChat, opts.building);
44
44
  meChat.setAttribute("class", "meetelise-chat");
45
+ meChat.setAttribute("role", "dialog");
46
+ meChat.setAttribute("aria-labelledby", "aria-label");
47
+ meChat.setAttribute("aria-describedby", "aria-describe");
48
+ meChat.setAttribute("aria-modal", "true");
45
49
  if (opts.themeId) {
46
50
  meChat.setAttribute("themeId", opts.themeId);
47
51
  }
@@ -422,8 +422,14 @@ export class MEChat extends LitElement {
422
422
  (this.buildingABTestType !== abTestTypes.ConceptBlueBlack &&
423
423
  this.buildingABTestType !== abTestTypes.ConceptBlueWhite) ||
424
424
  this.isMobile;
425
+
425
426
  return html`
426
427
  <div>
428
+ <div id="aria-label" style="display: none;">EliseAI Widget</div>
429
+ <div id="aria-describe" style="display: none;">
430
+ EliseAI widget that allows you to chat with a virtual assistant, book
431
+ a tour, contact the leasing office, and more.
432
+ </div>
427
433
  <div
428
434
  id="contactTabPopup"
429
435
  class=${classMap({