@meetelise/chat 1.20.192 → 1.20.194
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/declarations.d.ts +12 -0
- package/package.json +1 -1
- package/public/demo/index.html +17 -7
- package/public/dist/index.js +8 -8
- package/src/MEChat.ts +2 -0
- package/src/WebComponent/health-chat.ts +8 -0
- package/src/WebComponent/launcher/Launcher.ts +53 -0
- package/src/WebComponent/me-chat.ts +9 -6
- package/src/utils.ts +2 -1
package/declarations.d.ts
CHANGED
|
@@ -2,3 +2,15 @@ declare module "*.scss" {
|
|
|
2
2
|
const content: Record<string, string>;
|
|
3
3
|
export default content;
|
|
4
4
|
}
|
|
5
|
+
|
|
6
|
+
// TODO: get the project to recognize these as valid types
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
eliseAi: {
|
|
10
|
+
onOpenSST?: (callback: () => void) => void;
|
|
11
|
+
onOpenChat?: (callback: () => void) => void;
|
|
12
|
+
onOpenCallUsWindow?: (callback: () => void) => void;
|
|
13
|
+
onOpenEmailUsWindow?: (callback: () => void) => void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
package/public/demo/index.html
CHANGED
|
@@ -117,7 +117,9 @@
|
|
|
117
117
|
<!-- Webpack dev server will serve the bundle, index.js, at the path '/' -->
|
|
118
118
|
<script type="module" async>
|
|
119
119
|
import MEChat from "/index.js";
|
|
120
|
-
MEChat.
|
|
120
|
+
MEChat.healthcareStart({
|
|
121
|
+
id: "6a9e65e5-9699-4c96-af75-1741d0df79aa",
|
|
122
|
+
// MEChat.start({
|
|
121
123
|
// 123 Main Street
|
|
122
124
|
// organization: "test-company",
|
|
123
125
|
// building: "e2e-test-yardi-building",
|
|
@@ -145,12 +147,12 @@
|
|
|
145
147
|
// building: "25fead9e-c76f-11ed-83b2-7b1e7b442e9f",
|
|
146
148
|
|
|
147
149
|
// // Taylor Street Apartments
|
|
148
|
-
organization: "test-company",
|
|
149
|
-
building: "e2e-test-yardi-building",
|
|
150
|
-
position: {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
},
|
|
150
|
+
// organization: "test-company",
|
|
151
|
+
// building: "e2e-test-yardi-building",
|
|
152
|
+
// position: {
|
|
153
|
+
// bottom: 100,
|
|
154
|
+
// left: 0,
|
|
155
|
+
// },
|
|
154
156
|
|
|
155
157
|
// // The Qual People
|
|
156
158
|
// // organization: "Pacific Urban Residential",
|
|
@@ -191,6 +193,14 @@
|
|
|
191
193
|
<a href="/secret.html">
|
|
192
194
|
<button id="navigate" type="button">Show me a secret!</button>
|
|
193
195
|
</a>
|
|
196
|
+
<button onclick="window.eliseAi.onOpenChat()">
|
|
197
|
+
Open chat without widget
|
|
198
|
+
</button>
|
|
199
|
+
<div>
|
|
200
|
+
<a href="javascript:void(0);" onclick="window.eliseAi.onOpenSST()"
|
|
201
|
+
>Open SST without using widget</a
|
|
202
|
+
>
|
|
203
|
+
</div>
|
|
194
204
|
<form id="theme">
|
|
195
205
|
<label htmlFor="chatTitle">Title</label>
|
|
196
206
|
<input type="text" id="chatTitle" name="chatTitle" />
|
package/public/dist/index.js
CHANGED
|
@@ -332,7 +332,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
332
332
|
width: 100%;
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
`,Kt([ue({attribute:!1})],Yt.prototype,"options",void 0),Kt([ue({type:Boolean})],Yt.prototype,"selectedDateExists",void 0),Kt([le()],Yt.prototype,"selected",void 0),Kt([ue({attribute:!1})],Yt.prototype,"selectedTime",null),Yt=Kt([ae("time-picker")],Yt),n(7294);var Zt=n(8929),$t=n.n(Zt),en=n(1469),tn=n.n(en),nn=n(3218),rn=n.n(nn),on=n(8718),an=n.n(on),sn=36e5;const un=(e,t)=>an()(e,((e,n,i,r)=>{e[(null==t?void 0:t.includes(i))||tn()(r)?i:$t()(String(i))]=rn()(n)?un(n,t):n})),ln=()=>window.matchMedia("(max-width: 767px)").matches,dn=(e,t)=>function(e,t){Ue(2,arguments);var n=qe(e),i=qe(t);return n.getTime()<i.getTime()}(function(e,t){Ue(2,arguments);var n=et(t);return tt(e,n*sn)}(e,t),Date.now()),cn=u`
|
|
335
|
+
`,Kt([ue({attribute:!1})],Yt.prototype,"options",void 0),Kt([ue({type:Boolean})],Yt.prototype,"selectedDateExists",void 0),Kt([le()],Yt.prototype,"selected",void 0),Kt([ue({attribute:!1})],Yt.prototype,"selectedTime",null),Yt=Kt([ae("time-picker")],Yt),n(7294);var Zt=n(8929),$t=n.n(Zt),en=n(1469),tn=n.n(en),nn=n(3218),rn=n.n(nn),on=n(8718),an=n.n(on),sn=36e5;const un=(e,t)=>an()(e,((e,n,i,r)=>{e[(null==t?void 0:t.includes(i))||tn()(r)?i:$t()(String(i))]=rn()(n)?un(n,t):n})),ln=()=>window.matchMedia("(max-width: 767px)").matches||window.matchMedia("(max-height: 400px)").matches,dn=(e,t)=>function(e,t){Ue(2,arguments);var n=qe(e),i=qe(t);return n.getTime()<i.getTime()}(function(e,t){Ue(2,arguments);var n=et(t);return tt(e,n*sn)}(e,t),Date.now()),cn=u`
|
|
336
336
|
.webchat-input {
|
|
337
337
|
outline: none;
|
|
338
338
|
|
|
@@ -2665,7 +2665,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2665
2665
|
></minimize-expand-button>
|
|
2666
2666
|
`}
|
|
2667
2667
|
</ul>
|
|
2668
|
-
</div>`}};Xi.styles=[Vi],Ki([ue({attribute:!0})],Xi.prototype,"onClickMinimize",void 0),Ki([ue({attribute:!0})],Xi.prototype,"onClickEmailOption",void 0),Ki([ue({attribute:!0})],Xi.prototype,"onClickPhoneOption",void 0),Ki([ue({attribute:!0})],Xi.prototype,"onClickSSTOption",void 0),Ki([ue({attribute:!0})],Xi.prototype,"onChatTapped",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hideChat",void 0),Ki([ue({attribute:!0})],Xi.prototype,"isMobileDesign",void 0),Ki([ue({attribute:!0})],Xi.prototype,"brandColor",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasChatEnabled",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasEmailEnabled",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasCallUsEnabled",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasTextUsEnabled",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasSSTEnabled",void 0),Xi=Ki([ae("mobile-launcher")],Xi);var Yi=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 Zi=class extends re{constructor(){super(...arguments),this.isMinimized=!1,this.mobileStyles={},this.isFirstMount=!1,this.autoOpenChatWidget=!1,this.phoneNumber="",this.buildingName="",this.chatId="",this.chatCallUsHeader="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.sgtUrl="",this.designConcept="",this.featureFlagShowDropdown="",this.leadSources=[],this.currentLeadSource="",this.escortedToursLink="",this.virtualToursLink="",this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.hasDynamicSchedulingEnabled=!1,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.showTourNextToChat=!1,this.onChatTapped=()=>{},this.onClickMinimize=()=>{},this.launcherStyles={},this.brandColor=Fe,this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber&&this.hasCallUsEnabled,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=xe(),this.tourSchedulerRef=xe(),this.updated=async()=>{this.attachOnClickToEmailUsWindow(),this.attachOnClickToSSTWindow(),(this.isEmailWindowOpen||this.isCallUsWindowOpen)&&this.isSSTWindowOpen&&this.onCloseSSTWindow()},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.renderEmailOption=()=>{const e=this.getNumCallToActions()>2?"Email":"Email us";return U`
|
|
2668
|
+
</div>`}};Xi.styles=[Vi],Ki([ue({attribute:!0})],Xi.prototype,"onClickMinimize",void 0),Ki([ue({attribute:!0})],Xi.prototype,"onClickEmailOption",void 0),Ki([ue({attribute:!0})],Xi.prototype,"onClickPhoneOption",void 0),Ki([ue({attribute:!0})],Xi.prototype,"onClickSSTOption",void 0),Ki([ue({attribute:!0})],Xi.prototype,"onChatTapped",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hideChat",void 0),Ki([ue({attribute:!0})],Xi.prototype,"isMobileDesign",void 0),Ki([ue({attribute:!0})],Xi.prototype,"brandColor",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasChatEnabled",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasEmailEnabled",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasCallUsEnabled",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasTextUsEnabled",void 0),Ki([ue({attribute:!0})],Xi.prototype,"hasSSTEnabled",void 0),Xi=Ki([ae("mobile-launcher")],Xi);var Yi=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 Zi=class extends re{constructor(){super(...arguments),this.isMinimized=!1,this.mobileStyles={},this.isFirstMount=!1,this.autoOpenChatWidget=!1,this.phoneNumber="",this.buildingName="",this.chatId="",this.chatCallUsHeader="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.sgtUrl="",this.designConcept="",this.featureFlagShowDropdown="",this.leadSources=[],this.currentLeadSource="",this.escortedToursLink="",this.virtualToursLink="",this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.hasDynamicSchedulingEnabled=!1,this.onExitChat=()=>{},this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.showTourNextToChat=!1,this.onChatTapped=()=>{},this.onClickMinimize=()=>{},this.launcherStyles={},this.brandColor=Fe,this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber&&this.hasCallUsEnabled,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=xe(),this.tourSchedulerRef=xe(),this.updated=async()=>{this.attachOnClickToEmailUsWindow(),this.attachOnClickToSSTWindow(),(this.isEmailWindowOpen||this.isCallUsWindowOpen)&&this.isSSTWindowOpen&&this.onCloseSSTWindow()},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.renderEmailOption=()=>{const e=this.getNumCallToActions()>2?"Email":"Email us";return U`
|
|
2669
2669
|
<div
|
|
2670
2670
|
@click=${this.onClickEmailOption}
|
|
2671
2671
|
class="launcher__call-to-action-option"
|
|
@@ -2920,7 +2920,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2920
2920
|
<div class="chevron-right">${qi}</div>
|
|
2921
2921
|
</div>
|
|
2922
2922
|
`:""}
|
|
2923
|
-
</div>`}render(){return window.customElements.get("email-us-window")||window.customElements.define("email-us-window",Ci),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",Wi),U`
|
|
2923
|
+
</div>`}render(){return window.customElements.get("email-us-window")||window.customElements.define("email-us-window",Ci),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",Wi),this.hasSSTEnabled&&(window.eliseAi.onOpenSST=e=>{this.isSSTWindowOpen=!0,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,this.onExitChat(),e&&e()}),this.hasChatEnabled&&(window.eliseAi.onOpenChat=e=>{this.onChatTapped(),this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,e&&e()}),this.hasCallUsEnabled&&(window.eliseAi.onOpenCallUsWindow=e=>{this.isCallUsWindowOpen=!0,this.isSSTWindowOpen=!1,this.isEmailWindowOpen=!1,this.onExitChat(),e&&e()}),this.hasEmailEnabled&&(window.eliseAi.onOpenEmailUsWindow=e=>{this.isEmailWindowOpen=!0,this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.onExitChat(),e&&e()}),U`
|
|
2924
2924
|
<div
|
|
2925
2925
|
class=${Hn()({"launcher__mobile-launcher-wrapper":ln()||this.isMinimized,"launcher__mini-launcher-wrapper":!ln()&&!this.isMinimized,"launcher__mini-elevated":"livcor"===this.orgSlug.toLowerCase()&&(ln()||this.isMinimized)})}
|
|
2926
2926
|
style=${Pe({...this.launcherStyles,...this.mobileStyles,top:ln()||void 0===this.top||isNaN(this.top)?void 0:this.top-700+"px",bottom:ln()||void 0===this.bottom||isNaN(this.bottom)?"72px":`${this.bottom}px`,left:ln()||void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:ln()||void 0===this.right||isNaN(this.right)?"18px":`${this.right}px`})}
|
|
@@ -2995,7 +2995,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2995
2995
|
${yi}
|
|
2996
2996
|
${bi}
|
|
2997
2997
|
${wi}
|
|
2998
|
-
`,Yi([ue({attribute:!0})],Zi.prototype,"isMinimized",void 0),Yi([ue()],Zi.prototype,"mobileStyles",void 0),Yi([ue({type:Boolean})],Zi.prototype,"isFirstMount",void 0),Yi([ue({attribute:!1})],Zi.prototype,"autoOpenChatWidget",void 0),Yi([ue()],Zi.prototype,"phoneNumber",void 0),Yi([ue({attribute:!0})],Zi.prototype,"buildingName",void 0),Yi([ue({attribute:!0})],Zi.prototype,"chatId",void 0),Yi([ue({attribute:!0})],Zi.prototype,"chatCallUsHeader",void 0),Yi([ue({attribute:!1})],Zi.prototype,"buildingId",void 0),Yi([ue({attribute:!0})],Zi.prototype,"buildingSlug",void 0),Yi([ue({attribute:!0})],Zi.prototype,"orgSlug",void 0),Yi([ue({attribute:!0})],Zi.prototype,"sgtUrl",void 0),Yi([ue({attribute:!0})],Zi.prototype,"designConcept",void 0),Yi([ue({attribute:!0})],Zi.prototype,"featureFlagShowDropdown",void 0),Yi([ue({attribute:!1})],Zi.prototype,"leadSources",void 0),Yi([ue({attribute:!0})],Zi.prototype,"currentLeadSource",void 0),Yi([ue({attribute:!0})],Zi.prototype,"escortedToursLink",void 0),Yi([ue({attribute:!0})],Zi.prototype,"virtualToursLink",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasCallUsEnabled",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasChatEnabled",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasEmailEnabled",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasSSTEnabled",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasTextUsEnabled",void 0),Yi([ue({attribute:!1})],Zi.prototype,"layoutOptions",void 0),Yi([ue({attribute:!1})],Zi.prototype,"unitOptions",void 0),Yi([ue({attribute:!1})],Zi.prototype,"tourTypeOptions",void 0),Yi([ue({attribute:!0})],Zi.prototype,"hasDynamicSchedulingEnabled",void 0),Yi([ue({type:Number})],Zi.prototype,"right",void 0),Yi([ue({type:Number})],Zi.prototype,"bottom",void 0),Yi([ue({type:Number})],Zi.prototype,"top",void 0),Yi([ue({type:Number})],Zi.prototype,"left",void 0),Yi([ue({attribute:!0})],Zi.prototype,"showTourNextToChat",void 0),Yi([ue({attribute:!1})],Zi.prototype,"onChatTapped",void 0),Yi([ue({attribute:!0})],Zi.prototype,"onClickMinimize",void 0),Yi([ue({attribute:!1})],Zi.prototype,"launcherStyles",void 0),Yi([ue({attribute:!0})],Zi.prototype,"brandColor",void 0),Yi([le()],Zi.prototype,"isEmailWindowOpen",void 0),Yi([le()],Zi.prototype,"isCallUsWindowOpen",void 0),Yi([le()],Zi.prototype,"isSSTWindowOpen",void 0),Yi([le()],Zi.prototype,"isTextUsWindowOpen",void 0),Zi=Yi([ae("meetelise-launcher")],Zi);const $i=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Zi)};var er=n(3379),tr=n.n(er),nr=n(7795),ir=n.n(nr),rr=n(569),or=n.n(rr),ar=n(3565),sr=n.n(ar),ur=n(9216),lr=n.n(ur),dr=n(4589),cr=n.n(dr),pr=n(3631),hr={};async function fr(e){try{const n=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/lead-sources`);return n.data?mr(n.data,e):[]}catch(e){return[]}}hr.styleTagTransform=cr(),hr.setAttributes=sr(),hr.insert=or().bind(null,"head"),hr.domAPI=ir(),hr.insertStyleElement=lr(),tr()(pr.Z,hr),pr.Z&&pr.Z.locals&&pr.Z.locals;const mr=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter((e=>{const t=e.toLowerCase();return!n.map((e=>e.toLowerCase())).includes(t)}))};var gr,vr=n(9594),yr=n.n(vr),br=new Uint8Array(16);function wr(){if(!gr&&!(gr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gr(br)}const Sr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Tr=function(e){return"string"==typeof e&&Sr.test(e)};for(var xr=[],Ar=0;Ar<256;++Ar)xr.push((Ar+256).toString(16).substr(1));const Or=function(e,t,n){var i=(e=e||{}).random||(e.rng||wr)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(xr[e[t+0]]+xr[e[t+1]]+xr[e[t+2]]+xr[e[t+3]]+"-"+xr[e[t+4]]+xr[e[t+5]]+"-"+xr[e[t+6]]+xr[e[t+7]]+"-"+xr[e[t+8]]+xr[e[t+9]]+"-"+xr[e[t+10]]+xr[e[t+11]]+xr[e[t+12]]+xr[e[t+13]]+xr[e[t+14]]+xr[e[t+15]]).toLowerCase();if(!Tr(n))throw TypeError("Stringified UUID is invalid");return n}(i)},Cr=e=>localStorage.removeItem("com.elise.webchat.slug="+e),Ir=(e,t,n)=>{const i=fn(new Date),r=n||`lead_${Or()}_${e}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Sn(i),buildingSlug:e,initiatedChat:t}},Nr=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if(Er(e,i))return i}catch(e){console.warn("Error getting chat storage key")}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},Er=(e,t)=>!(t.buildingSlug!==e||!t.leadId||!t.timestamp||dn(t.timestamp,24));var Rr;!function(e){e.noReply="no-reply",e.text="text"}(Rr||(Rr={}));const _r=class{constructor(e,t,n,i=null,r){this.apiHost="https://app.meetelise.com",this.building=null,this.eliseResponseTimeout=null,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.chatListener=null,this.messages=[],this.listenerParams={message:e=>{var t;e.message.messageType!==Rr.noReply&&(this.messages=[...this.messages,{channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken}]);const n="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.messages,isLoading:n}),!n&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=n}},this.isLoadingMessages=!1,this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){this.building&&ai({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.removeChatListeners()},this.removeChatListeners=()=>{this.pubnub&&this.channel&&(this.pubnub.unsubscribe({channels:[this.channel]}),this.pubnub.removeListener(this.listenerParams))},this.sendMessage=async e=>{if(e){if(!this.pubnub){const e=Ir(this.buildingSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken((async()=>{var t,n;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout((()=>{console.error("Elise AI did not respond in time..."),this.building&&ai({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}),9e4),await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(t=this.building)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,userId:null===(n=this.building)||void 0===n?void 0:n.userId,leadSource:this.leadSource}}))})),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.buildingSlug=e,this.building=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`}addChatListener(e){this.chatListener=e}async initializePubnub(e){if(!e.leadId)return;this.leadUserId=e.leadId;const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(yr())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token}),this.withAuthToken((()=>new Promise((()=>this.handleChatListeners())))),await this.withAuthToken((()=>this.getChannelHistory())),this.pubnub):void 0}async fetchToken(e,n){try{return(await t().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${n}&${this.building?"":"industry=health_care"}`)).data}catch(e){this.building&&ai({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return null}async fetchChannelExists(e){try{return(await t().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){this.building&&ai({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return!1}async withAuthToken(t){try{await t()}catch(n){if(n instanceof e.AxiosError&&n&&n.response&&403===n.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const e=await this.fetchToken(this.leadUserId,this.channel);if(!e)return;this.pubnub.setAuthKey(e.auth.result.token),await t()}catch(e){this.building&&ai({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}}async getChannelHistory(){var e;try{const t=await new Promise(((e,t)=>{this.pubnub&&this.channel&&this.pubnub.fetchMessages({channels:[this.channel],count:100},((n,i)=>{n.error?(this.building&&ai({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{channel:this.channel,status:n,response:i},logType:oi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),t(n)):e(i)}))}));if(this.channel&&0!==Object.keys(t.channels).length){const n=t.channels[this.channel],i=[];n.forEach((e=>{e.uuid&&i.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})})),this.messages=i.filter((e=>e.message.messageType!==Rr.noReply)),null===(e=this.chatListener)||void 0===e||e.call(this,{messages:this.messages,isLoading:!1})}}catch(e){this.building&&ai({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:oi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}},Pr=(e,t,n)=>{const i=`tel:${e}`,r=`sms:${e}`,o=`whatsapp://send?phone=${e}}`,a=`facetime:${e}`,s=`facetime-audio:${e}`,u=/\(\d{3}\)\s\d{3}-\d{4}/g,l=/(tel|sms):\(\d{3}\)\s\d{3}-\d{4}/g,d=/whatsapp:\/\/send\?phone=\d+/g,c=/(facetime|facetime-audio):\d+/g,p=document.body.getElementsByTagName("*");let h=!1;const f=e.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");for(let e=0;e<p.length;e++)if(p[e].nodeType===Node.ELEMENT_NODE&&(1===p[e].childNodes.length&&p[e].childNodes[0].nodeType==Node.TEXT_NODE&&(p[e].innerHTML=p[e].innerHTML.replace(u,f),h=!0,ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",originalPhoneNumber:p[e].innerHTML,newPhoneNumber:f,website:window.location.href},logType:oi.info,buildingSlug:n,orgSlug:t})),p[e].hasAttribute("href"))){const u=p[e].getAttribute("href");if(!u)continue;let h="",m=l;u.startsWith("sms:")?h=r:u.startsWith("whatsapp:")?(h=o,m=d):u.startsWith("facetime:")?(h=a,m=c):u.startsWith("facetime-audio:")?(h=s,m=c):h=i;const g=u.replace(m,h);p[e].setAttribute("href",g),ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",hrefAttribute:u,originalPhoneNumber:p[e].innerHTML,newPhoneNumber:f,website:window.location.href},logType:oi.info,buildingSlug:n,orgSlug:t})}h||ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:oi.warn,buildingSlug:n,orgSlug:t})};var Fr=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 Mr=class extends re{constructor(){super(...arguments),this.onClick=()=>{},this.brandColor=Fe,this.toExpand=!1}render(){return U`
|
|
2998
|
+
`,Yi([ue({attribute:!0})],Zi.prototype,"isMinimized",void 0),Yi([ue()],Zi.prototype,"mobileStyles",void 0),Yi([ue({type:Boolean})],Zi.prototype,"isFirstMount",void 0),Yi([ue({attribute:!1})],Zi.prototype,"autoOpenChatWidget",void 0),Yi([ue()],Zi.prototype,"phoneNumber",void 0),Yi([ue({attribute:!0})],Zi.prototype,"buildingName",void 0),Yi([ue({attribute:!0})],Zi.prototype,"chatId",void 0),Yi([ue({attribute:!0})],Zi.prototype,"chatCallUsHeader",void 0),Yi([ue({attribute:!1})],Zi.prototype,"buildingId",void 0),Yi([ue({attribute:!0})],Zi.prototype,"buildingSlug",void 0),Yi([ue({attribute:!0})],Zi.prototype,"orgSlug",void 0),Yi([ue({attribute:!0})],Zi.prototype,"sgtUrl",void 0),Yi([ue({attribute:!0})],Zi.prototype,"designConcept",void 0),Yi([ue({attribute:!0})],Zi.prototype,"featureFlagShowDropdown",void 0),Yi([ue({attribute:!1})],Zi.prototype,"leadSources",void 0),Yi([ue({attribute:!0})],Zi.prototype,"currentLeadSource",void 0),Yi([ue({attribute:!0})],Zi.prototype,"escortedToursLink",void 0),Yi([ue({attribute:!0})],Zi.prototype,"virtualToursLink",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasCallUsEnabled",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasChatEnabled",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasEmailEnabled",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasSSTEnabled",void 0),Yi([ue({type:Boolean})],Zi.prototype,"hasTextUsEnabled",void 0),Yi([ue({attribute:!1})],Zi.prototype,"layoutOptions",void 0),Yi([ue({attribute:!1})],Zi.prototype,"unitOptions",void 0),Yi([ue({attribute:!1})],Zi.prototype,"tourTypeOptions",void 0),Yi([ue({attribute:!0})],Zi.prototype,"hasDynamicSchedulingEnabled",void 0),Yi([ue({attribute:!0})],Zi.prototype,"onExitChat",void 0),Yi([ue({type:Number})],Zi.prototype,"right",void 0),Yi([ue({type:Number})],Zi.prototype,"bottom",void 0),Yi([ue({type:Number})],Zi.prototype,"top",void 0),Yi([ue({type:Number})],Zi.prototype,"left",void 0),Yi([ue({attribute:!0})],Zi.prototype,"showTourNextToChat",void 0),Yi([ue({attribute:!1})],Zi.prototype,"onChatTapped",void 0),Yi([ue({attribute:!0})],Zi.prototype,"onClickMinimize",void 0),Yi([ue({attribute:!1})],Zi.prototype,"launcherStyles",void 0),Yi([ue({attribute:!0})],Zi.prototype,"brandColor",void 0),Yi([le()],Zi.prototype,"isEmailWindowOpen",void 0),Yi([le()],Zi.prototype,"isCallUsWindowOpen",void 0),Yi([le()],Zi.prototype,"isSSTWindowOpen",void 0),Yi([le()],Zi.prototype,"isTextUsWindowOpen",void 0),Zi=Yi([ae("meetelise-launcher")],Zi);const $i=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Zi)};var er=n(3379),tr=n.n(er),nr=n(7795),ir=n.n(nr),rr=n(569),or=n.n(rr),ar=n(3565),sr=n.n(ar),ur=n(9216),lr=n.n(ur),dr=n(4589),cr=n.n(dr),pr=n(3631),hr={};async function fr(e){try{const n=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/lead-sources`);return n.data?mr(n.data,e):[]}catch(e){return[]}}hr.styleTagTransform=cr(),hr.setAttributes=sr(),hr.insert=or().bind(null,"head"),hr.domAPI=ir(),hr.insertStyleElement=lr(),tr()(pr.Z,hr),pr.Z&&pr.Z.locals&&pr.Z.locals;const mr=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter((e=>{const t=e.toLowerCase();return!n.map((e=>e.toLowerCase())).includes(t)}))};var gr,vr=n(9594),yr=n.n(vr),br=new Uint8Array(16);function wr(){if(!gr&&!(gr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gr(br)}const Sr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Tr=function(e){return"string"==typeof e&&Sr.test(e)};for(var xr=[],Ar=0;Ar<256;++Ar)xr.push((Ar+256).toString(16).substr(1));const Or=function(e,t,n){var i=(e=e||{}).random||(e.rng||wr)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(xr[e[t+0]]+xr[e[t+1]]+xr[e[t+2]]+xr[e[t+3]]+"-"+xr[e[t+4]]+xr[e[t+5]]+"-"+xr[e[t+6]]+xr[e[t+7]]+"-"+xr[e[t+8]]+xr[e[t+9]]+"-"+xr[e[t+10]]+xr[e[t+11]]+xr[e[t+12]]+xr[e[t+13]]+xr[e[t+14]]+xr[e[t+15]]).toLowerCase();if(!Tr(n))throw TypeError("Stringified UUID is invalid");return n}(i)},Cr=e=>localStorage.removeItem("com.elise.webchat.slug="+e),Ir=(e,t,n)=>{const i=fn(new Date),r=n||`lead_${Or()}_${e}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Sn(i),buildingSlug:e,initiatedChat:t}},Nr=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if(Er(e,i))return i}catch(e){console.warn("Error getting chat storage key")}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},Er=(e,t)=>!(t.buildingSlug!==e||!t.leadId||!t.timestamp||dn(t.timestamp,24));var Rr;!function(e){e.noReply="no-reply",e.text="text"}(Rr||(Rr={}));const _r=class{constructor(e,t,n,i=null,r){this.apiHost="https://app.meetelise.com",this.building=null,this.eliseResponseTimeout=null,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.chatListener=null,this.messages=[],this.listenerParams={message:e=>{var t;e.message.messageType!==Rr.noReply&&(this.messages=[...this.messages,{channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken}]);const n="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.messages,isLoading:n}),!n&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=n}},this.isLoadingMessages=!1,this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){this.building&&ai({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.removeChatListeners()},this.removeChatListeners=()=>{this.pubnub&&this.channel&&(this.pubnub.unsubscribe({channels:[this.channel]}),this.pubnub.removeListener(this.listenerParams))},this.sendMessage=async e=>{if(e){if(!this.pubnub){const e=Ir(this.buildingSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken((async()=>{var t,n;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout((()=>{console.error("Elise AI did not respond in time..."),this.building&&ai({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}),9e4),await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(t=this.building)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,userId:null===(n=this.building)||void 0===n?void 0:n.userId,leadSource:this.leadSource}}))})),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.buildingSlug=e,this.building=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`}addChatListener(e){this.chatListener=e}async initializePubnub(e){if(!e.leadId)return;this.leadUserId=e.leadId;const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(yr())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token}),this.withAuthToken((()=>new Promise((()=>this.handleChatListeners())))),await this.withAuthToken((()=>this.getChannelHistory())),this.pubnub):void 0}async fetchToken(e,n){try{return(await t().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${n}&${this.building?"":"industry=health_care"}`)).data}catch(e){this.building&&ai({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return null}async fetchChannelExists(e){try{return(await t().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){this.building&&ai({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return!1}async withAuthToken(t){try{await t()}catch(n){if(n instanceof e.AxiosError&&n&&n.response&&403===n.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const e=await this.fetchToken(this.leadUserId,this.channel);if(!e)return;this.pubnub.setAuthKey(e.auth.result.token),await t()}catch(e){this.building&&ai({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:oi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}}async getChannelHistory(){var e;try{const t=await new Promise(((e,t)=>{this.pubnub&&this.channel&&this.pubnub.fetchMessages({channels:[this.channel],count:100},((n,i)=>{n.error?(this.building&&ai({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{channel:this.channel,status:n,response:i},logType:oi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),t(n)):e(i)}))}));if(this.channel&&0!==Object.keys(t.channels).length){const n=t.channels[this.channel],i=[];n.forEach((e=>{e.uuid&&i.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})})),this.messages=i.filter((e=>e.message.messageType!==Rr.noReply)),null===(e=this.chatListener)||void 0===e||e.call(this,{messages:this.messages,isLoading:!1})}}catch(e){this.building&&ai({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:oi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}},Pr=(e,t,n)=>{const i=`tel:${e}`,r=`sms:${e}`,o=`whatsapp://send?phone=${e}}`,a=`facetime:${e}`,s=`facetime-audio:${e}`,u=/\(\d{3}\)\s\d{3}-\d{4}/g,l=/(tel|sms):\(\d{3}\)\s\d{3}-\d{4}/g,d=/whatsapp:\/\/send\?phone=\d+/g,c=/(facetime|facetime-audio):\d+/g,p=document.body.getElementsByTagName("*");let h=!1;const f=e.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");for(let e=0;e<p.length;e++)if(p[e].nodeType===Node.ELEMENT_NODE&&(1===p[e].childNodes.length&&p[e].childNodes[0].nodeType==Node.TEXT_NODE&&(p[e].innerHTML=p[e].innerHTML.replace(u,f),h=!0,ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",originalPhoneNumber:p[e].innerHTML,newPhoneNumber:f,website:window.location.href},logType:oi.info,buildingSlug:n,orgSlug:t})),p[e].hasAttribute("href"))){const u=p[e].getAttribute("href");if(!u)continue;let h="",m=l;u.startsWith("sms:")?h=r:u.startsWith("whatsapp:")?(h=o,m=d):u.startsWith("facetime:")?(h=a,m=c):u.startsWith("facetime-audio:")?(h=s,m=c):h=i;const g=u.replace(m,h);p[e].setAttribute("href",g),ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",hrefAttribute:u,originalPhoneNumber:p[e].innerHTML,newPhoneNumber:f,website:window.location.href},logType:oi.info,buildingSlug:n,orgSlug:t})}h||ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:oi.warn,buildingSlug:n,orgSlug:t})};var Fr=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 Mr=class extends re{constructor(){super(...arguments),this.onClick=()=>{},this.brandColor=Fe,this.toExpand=!1}render(){return U`
|
|
2999
2999
|
<div
|
|
3000
3000
|
class=${this.toExpand?"button-container mini":"button-container"}
|
|
3001
3001
|
@click=${this.onClick}
|
|
@@ -3827,7 +3827,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3827
3827
|
I agree
|
|
3828
3828
|
</button>
|
|
3829
3829
|
</div>
|
|
3830
|
-
`;var Vr=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 Kr=class extends re{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.brandColor=null,this.chatId="",this.analytics=null,this.launcher=null,this.building=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=Vn.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.LeadSourceClient=null,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.enabledChatWidgets={call:!0,chat:!0,email:!0,text:!0,sst:!0},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=xe(),this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{if(!this.buildingSlug||!this.orgSlug)return;const e=await pi(this.orgSlug,this.buildingSlug);e.conversationMaintenanceMode?console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear."):1===e.active?(this.building=e,await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)&&(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.updateAlreadyAutoOpenedTimestamp()),this.isLoading=!1,"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0)):console.warn("MeetElise has detected this building is NOT active. Chat icon will not appear.")},this.setBuildingDerivedInfo=async()=>{var e,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y,b,w,S,T,x,A,O,C,I,N,E;const R=this.building;if(!R)return;R&&this.orgSlug&&Yr(this.orgSlug,this.buildingSlug,null!==(n=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.leadSource)&&void 0!==n?n:null);const[_,P,F,M,D,k]=await Promise.all([vi(this.buildingSlug),fr(this.buildingSlug),Kn(this.buildingSlug),Xn(this.buildingSlug),gi(R.id),Yn(this.buildingSlug)]);this.building&&(this.building.phoneNumber=Ne(R.phoneNumber)),this.designConcept=null!==(i=null==_?void 0:_.abTestType)&&void 0!==i?i:"",this.leadSources=P,this.featureFlagShowDropdown=F;const U=await(async e=>{try{const n="https://app.meetelise.com",i=await t().get(`${n}/platformApi/webchat/${e}/phone-number`);if(i.data)return i.data}catch(t){return ai({logType:oi.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t}}),null}return null})(this.buildingSlug);var q,B;this.enabledChatWidgets={call:D&&!D.isGlobalDefault?D.config.shouldShowPhone:null===(a=null===(o=null===(r=this.building)||void 0===r?void 0:r.chatWidgets)||void 0===o?void 0:o.includes("CALL"))||void 0===a||a,chat:D&&!D.isGlobalDefault?D.config.shouldShowChat:null===(l=null===(u=null===(s=this.building)||void 0===s?void 0:s.chatWidgets)||void 0===u?void 0:u.includes("CHAT"))||void 0===l||l,email:D&&!D.isGlobalDefault?D.config.shouldShowEmail:null===(p=null===(c=null===(d=this.building)||void 0===d?void 0:d.chatWidgets)||void 0===c?void 0:c.includes("EMAIL"))||void 0===p||p,text:(D&&!D.isGlobalDefault?D.config.shouldShowText:null===(m=null===(f=null===(h=this.building)||void 0===h?void 0:h.chatWidgets)||void 0===f?void 0:f.includes("SMS"))||void 0===m||m)&&!!U,sst:D&&!D.isGlobalDefault?D.config.shouldShowSst:null===(y=null===(v=null===(g=this.building)||void 0===g?void 0:g.chatWidgets)||void 0===v?void 0:v.includes("SST"))||void 0===y||y},this.enabledChatWidgets.sst?(B=this.handleTourClicked,document.querySelectorAll("a").forEach((function(e){const t=e.getAttribute("href");t&&t.startsWith("https://app.meetelise.com/")&&e.addEventListener("click",(e=>{e.preventDefault(),B(e)}))})),((e,t,n)=>{if("be948f76-d8f9-11eb-b710-2bc5b16e7492"===t){const e=document.querySelector('a[href="/schedule-a-tour/"]');e&&e.addEventListener("click",(e=>{e.preventDefault(),n(e)}))}})(this.orgSlug,this.buildingSlug,this.handleTourClicked)):(null===(b=this.LeadSourceClient)||void 0===b?void 0:b.leadSource)&&(q=null!==(S=null===(w=this.LeadSourceClient)||void 0===w?void 0:w.leadSource)&&void 0!==S?S:null,document.querySelectorAll("a").forEach((function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(q)}`)}}))),D&&D.config&&(this.brandColor=null!==(T=D.config.primaryColor)&&void 0!==T?T:null,this.webchatConfigHasAutoOpenChat=D.config.autoOpenChat,this.requiresConsent=D.config.requiresConsent,this.privacyPolicyUrl=null!==(x=D.config.privacyPolicyUrl)&&void 0!==x?x:this.privacyPolicyUrl,D.config.displayStyle===fi.MINIMIZED&&(this.isMinimized=!0),D.config.displayStyle===fi.PILLS&&(this.designConcept=null),D.config.displayStyle===fi.EMOJI&&(this.designConcept=fi.EMOJI)),null===this.brandColor&&(this.brandColor=Fe);const L=null!==(O=null===(A=this.building)||void 0===A?void 0:A.phoneNumber)&&void 0!==O?O:"";let J=null;M&&(J=await async function(e,n){try{const i=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source?source=${n}`);return i.data?{number:Ne(i.data.number),isMatch:i.data.match,isPropertyWebsiteCatchall:i.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(I=null===(C=this.LeadSourceClient)||void 0===C?void 0:C.leadSource)&&void 0!==I?I:null),J&&!J.isMatch&&(J.number=L)),k&&(null==J?void 0:J.number)&&Pr(J.number,this.orgSlug,this.buildingSlug);const j=localStorage.getItem("eliseai_phone_number_devtest");j&&(console.info("Using dev test phone number: ",j),Pr(j,this.orgSlug,this.buildingSlug)),this.phoneNumberForSource=J||{number:L,isMatch:!1,isPropertyWebsiteCatchall:!0};const H=null!==(E=null===(N=this.LeadSourceClient)||void 0===N?void 0:N.leadSource)&&void 0!==E?E:null;H&&(this.leadSources.includes(H)||this.leadSources.push(H)),kn(R.id)},this.initializeChatVariables=async()=>{var e,t;if(!this.building)return;const n=Nr(this.buildingSlug),i=Er(this.buildingSlug,n)?n:Ir(this.buildingSlug,!1);if(!i.leadId)throw new Error("Lead ID is null");this.myPubnub=new _r(this.buildingSlug,this.building,this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.leadSource)&&void 0!==t?t:null,i.leadId),i.initiatedChat&&await this.myPubnub.initializePubnub(n)},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!bn(Sn(t)));return!!e&&!!n&&!ln()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",fn(function(e,t){Ue(2,arguments);var n=et(t);return tt(e,6e4*n)}(new Date,15)))},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.handleKeydownTab=e=>{var t,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y,b,w;if("Tab"===e.key){e.preventDefault();const S=this.displayPubnubChat?null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"):null!==(m=null!==(l=null===(u=null===(s=null===(a=null===(o=null===(r=this.shadowRoot)||void 0===r?void 0:r.getElementById("meetelise-launcher"))||void 0===o?void 0:o.shadowRoot)||void 0===a?void 0:a.getElementById("email-us-window"))||void 0===s?void 0:s.shadowRoot)||void 0===u?void 0:u.getElementById("email-us-form"))&&void 0!==l?l:null===(f=null===(h=null===(p=null===(c=null===(d=this.shadowRoot)||void 0===d?void 0:d.getElementById("meetelise-launcher"))||void 0===c?void 0:c.shadowRoot)||void 0===p?void 0:p.getElementById("tour-scheduler-window"))||void 0===h?void 0:h.shadowRoot)||void 0===f?void 0:f.getElementById("scheduler-container"))&&void 0!==m?m:null===(w=null===(b=null===(y=null===(v=null===(g=this.shadowRoot)||void 0===g?void 0:g.getElementById("meetelise-launcher"))||void 0===v?void 0:v.shadowRoot)||void 0===y?void 0:y.getElementById("call-us-window"))||void 0===b?void 0:b.shadowRoot)||void 0===w?void 0:w.getElementById("details-window");if(!S)return;const T=S.querySelectorAll("input, me-select, textarea, action-confirm-button, [tabindex]"),x=Array.from(T),A=x.findIndex((e=>e.matches(":focus")));x[(A+1)%x.length].focus()}},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,localStorage.setItem("isChatOpen","true")})},this.renderChatAdditionalActions=(e,t)=>U` <div
|
|
3830
|
+
`;var Vr=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 Kr=class extends re{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.brandColor=null,this.chatId="",this.analytics=null,this.launcher=null,this.building=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=Vn.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.LeadSourceClient=null,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.enabledChatWidgets={call:!0,chat:!0,email:!0,text:!0,sst:!0},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=xe(),this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{if(!this.buildingSlug||!this.orgSlug)return;const e=await pi(this.orgSlug,this.buildingSlug);e.conversationMaintenanceMode?console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear."):1===e.active?(this.building=e,await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)&&(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.updateAlreadyAutoOpenedTimestamp()),this.isLoading=!1,"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0)):console.warn("MeetElise has detected this building is NOT active. Chat icon will not appear.")},this.setBuildingDerivedInfo=async()=>{var e,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y,b,w,S,T,x,A,O,C,I,N,E;const R=this.building;if(!R)return;R&&this.orgSlug&&Yr(this.orgSlug,this.buildingSlug,null!==(n=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.leadSource)&&void 0!==n?n:null);const[_,P,F,M,D,k]=await Promise.all([vi(this.buildingSlug),fr(this.buildingSlug),Kn(this.buildingSlug),Xn(this.buildingSlug),gi(R.id),Yn(this.buildingSlug)]);this.building&&(this.building.phoneNumber=Ne(R.phoneNumber)),this.designConcept=null!==(i=null==_?void 0:_.abTestType)&&void 0!==i?i:"",this.leadSources=P,this.featureFlagShowDropdown=F;const U=await(async e=>{try{const n="https://app.meetelise.com",i=await t().get(`${n}/platformApi/webchat/${e}/phone-number`);if(i.data)return i.data}catch(t){return ai({logType:oi.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t}}),null}return null})(this.buildingSlug);var q,B;this.enabledChatWidgets={call:D&&!D.isGlobalDefault?D.config.shouldShowPhone:null===(a=null===(o=null===(r=this.building)||void 0===r?void 0:r.chatWidgets)||void 0===o?void 0:o.includes("CALL"))||void 0===a||a,chat:D&&!D.isGlobalDefault?D.config.shouldShowChat:null===(l=null===(u=null===(s=this.building)||void 0===s?void 0:s.chatWidgets)||void 0===u?void 0:u.includes("CHAT"))||void 0===l||l,email:D&&!D.isGlobalDefault?D.config.shouldShowEmail:null===(p=null===(c=null===(d=this.building)||void 0===d?void 0:d.chatWidgets)||void 0===c?void 0:c.includes("EMAIL"))||void 0===p||p,text:(D&&!D.isGlobalDefault?D.config.shouldShowText:null===(m=null===(f=null===(h=this.building)||void 0===h?void 0:h.chatWidgets)||void 0===f?void 0:f.includes("SMS"))||void 0===m||m)&&!!U,sst:D&&!D.isGlobalDefault?D.config.shouldShowSst:null===(y=null===(v=null===(g=this.building)||void 0===g?void 0:g.chatWidgets)||void 0===v?void 0:v.includes("SST"))||void 0===y||y},this.enabledChatWidgets.sst?(B=this.handleTourClicked,document.querySelectorAll("a").forEach((function(e){const t=e.getAttribute("href");t&&t.startsWith("https://app.meetelise.com/")&&e.addEventListener("click",(e=>{e.preventDefault(),B(e)}))})),((e,t,n)=>{if("be948f76-d8f9-11eb-b710-2bc5b16e7492"===t){const e=document.querySelector('a[href="/schedule-a-tour/"]');e&&e.addEventListener("click",(e=>{e.preventDefault(),n(e)}))}})(this.orgSlug,this.buildingSlug,this.handleTourClicked)):(null===(b=this.LeadSourceClient)||void 0===b?void 0:b.leadSource)&&(q=null!==(S=null===(w=this.LeadSourceClient)||void 0===w?void 0:w.leadSource)&&void 0!==S?S:null,document.querySelectorAll("a").forEach((function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(q)}`)}}))),D&&D.config&&(this.brandColor=null!==(T=D.config.primaryColor)&&void 0!==T?T:null,this.webchatConfigHasAutoOpenChat=D.config.autoOpenChat,this.requiresConsent=D.config.requiresConsent,this.privacyPolicyUrl=null!==(x=D.config.privacyPolicyUrl)&&void 0!==x?x:this.privacyPolicyUrl,D.config.displayStyle===fi.MINIMIZED&&(this.isMinimized=!0),D.config.displayStyle===fi.PILLS&&(this.designConcept=null),D.config.displayStyle===fi.EMOJI&&(this.designConcept=fi.EMOJI)),null===this.brandColor&&(this.brandColor=Fe);const L=null!==(O=null===(A=this.building)||void 0===A?void 0:A.phoneNumber)&&void 0!==O?O:"";let J=null;M&&(J=await async function(e,n){try{const i=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source?source=${n}`);return i.data?{number:Ne(i.data.number),isMatch:i.data.match,isPropertyWebsiteCatchall:i.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(I=null===(C=this.LeadSourceClient)||void 0===C?void 0:C.leadSource)&&void 0!==I?I:null),J&&!J.isMatch&&(J.number=L)),k&&(null==J?void 0:J.number)&&Pr(J.number,this.orgSlug,this.buildingSlug);const j=localStorage.getItem("eliseai_phone_number_devtest");j&&(console.info("Using dev test phone number: ",j),Pr(j,this.orgSlug,this.buildingSlug)),this.phoneNumberForSource=J||{number:L,isMatch:!1,isPropertyWebsiteCatchall:!0};const H=null!==(E=null===(N=this.LeadSourceClient)||void 0===N?void 0:N.leadSource)&&void 0!==E?E:null;H&&(this.leadSources.includes(H)||this.leadSources.push(H)),kn(R.id)},this.initializeChatVariables=async()=>{var e,t;if(!this.building)return;const n=Nr(this.buildingSlug),i=Er(this.buildingSlug,n)?n:Ir(this.buildingSlug,!1);if(!i.leadId)throw new Error("Lead ID is null");this.myPubnub=new _r(this.buildingSlug,this.building,this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.leadSource)&&void 0!==t?t:null,i.leadId),i.initiatedChat&&await this.myPubnub.initializePubnub(n)},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!bn(Sn(t)));return!!e&&!!n&&!ln()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",fn(function(e,t){Ue(2,arguments);var n=et(t);return tt(e,6e4*n)}(new Date,15)))},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.handleKeydownTab=e=>{var t,n,i,r,o,a,s,u,l,d,c,p,h,f,m,g,v,y,b,w;if("Tab"===e.key){e.preventDefault();const S=this.displayPubnubChat?null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"):null!==(m=null!==(l=null===(u=null===(s=null===(a=null===(o=null===(r=this.shadowRoot)||void 0===r?void 0:r.getElementById("meetelise-launcher"))||void 0===o?void 0:o.shadowRoot)||void 0===a?void 0:a.getElementById("email-us-window"))||void 0===s?void 0:s.shadowRoot)||void 0===u?void 0:u.getElementById("email-us-form"))&&void 0!==l?l:null===(f=null===(h=null===(p=null===(c=null===(d=this.shadowRoot)||void 0===d?void 0:d.getElementById("meetelise-launcher"))||void 0===c?void 0:c.shadowRoot)||void 0===p?void 0:p.getElementById("tour-scheduler-window"))||void 0===h?void 0:h.shadowRoot)||void 0===f?void 0:f.getElementById("scheduler-container"))&&void 0!==m?m:null===(w=null===(b=null===(y=null===(v=null===(g=this.shadowRoot)||void 0===g?void 0:g.getElementById("meetelise-launcher"))||void 0===v?void 0:v.shadowRoot)||void 0===y?void 0:y.getElementById("call-us-window"))||void 0===b?void 0:b.shadowRoot)||void 0===w?void 0:w.getElementById("details-window");if(!S)return;const T=S.querySelectorAll("input, me-select, textarea, action-confirm-button, [tabindex]"),x=Array.from(T),A=x.findIndex((e=>e.matches(":focus")));x[(A+1)%x.length].focus()}},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,localStorage.setItem("isChatOpen","true")},e.onExitChat=this.onExitChat)},this.onExitChat=()=>{this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,localStorage.setItem("isChatOpen","false")},this.renderChatAdditionalActions=(e,t)=>U` <div
|
|
3831
3831
|
id=${e}
|
|
3832
3832
|
class=${fe({showTab:t,hideTab:!t})}
|
|
3833
3833
|
>
|
|
@@ -3865,7 +3865,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
3865
3865
|
.buildingSlug=${this.buildingSlug}
|
|
3866
3866
|
.building=${this.building}
|
|
3867
3867
|
.brandColor=${this.brandColor}
|
|
3868
|
-
.onClickExit=${
|
|
3868
|
+
.onClickExit=${this.onExitChat}
|
|
3869
3869
|
.onMount=${()=>{this.adjustPositionChatAdditionalActions()}}
|
|
3870
3870
|
.requiresConsent=${this.requiresConsent}
|
|
3871
3871
|
.privacyPolicyUrl=${this.privacyPolicyUrl}
|
|
@@ -4048,7 +4048,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
4048
4048
|
/>
|
|
4049
4049
|
</svg>
|
|
4050
4050
|
</button>
|
|
4051
|
-
</div>`}};to.styles=[$r],eo([ue({type:Number})],to.prototype,"right",void 0),eo([ue({type:Number})],to.prototype,"bottom",void 0),eo([ue({type:Number})],to.prototype,"top",void 0),eo([ue({type:Number})],to.prototype,"left",void 0),eo([ue({attribute:!0})],to.prototype,"isChatOpen",void 0),eo([ue({attribute:!0})],to.prototype,"onClickCloseChat",void 0),eo([ue({attribute:!0})],to.prototype,"onClickOpenChat",void 0),to=eo([ae("healthcare-launcher")],to);var no=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 io=class extends re{constructor(){super(...arguments),this.healthcareId="",this.right=0,this.bottom=0,this.top=0,this.left=0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=xe(),this.firstUpdated=async()=>{
|
|
4051
|
+
</div>`}};to.styles=[$r],eo([ue({type:Number})],to.prototype,"right",void 0),eo([ue({type:Number})],to.prototype,"bottom",void 0),eo([ue({type:Number})],to.prototype,"top",void 0),eo([ue({type:Number})],to.prototype,"left",void 0),eo([ue({attribute:!0})],to.prototype,"isChatOpen",void 0),eo([ue({attribute:!0})],to.prototype,"onClickCloseChat",void 0),eo([ue({attribute:!0})],to.prototype,"onClickOpenChat",void 0),to=eo([ae("healthcare-launcher")],to);var no=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 io=class extends re{constructor(){super(...arguments),this.healthcareId="",this.right=0,this.bottom=0,this.top=0,this.left=0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=xe(),this.firstUpdated=async()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=Nr(this.healthcareId),t=Er(this.healthcareId,e)?e:Ir(this.healthcareId,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new _r(this.healthcareId,null,"",this.currentLeadSource,t.leadId),t.initiatedChat&&await this.myPubnub.initializePubnub(e),ln()||(this.displayPubnubChat=!0),this.attachOnClickToLauncher(),this.isLoading=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0})}}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),Cr(this.healthcareId),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),super.disconnectedCallback()}render(){var e;return $i(),this.isLoading?U``:U`
|
|
4052
4052
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
4053
4053
|
<div id="aria-describe-info" style="display: none;">
|
|
4054
4054
|
EliseAI widget that allows you to chat with a virtual assistant, book
|
|
@@ -4136,4 +4136,4 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
4136
4136
|
line-height: 150%;
|
|
4137
4137
|
font-size: 16px;
|
|
4138
4138
|
}
|
|
4139
|
-
`,no([ue({type:String})],io.prototype,"healthcareId",void 0),no([ue({type:Number})],io.prototype,"right",void 0),no([ue({type:Number})],io.prototype,"bottom",void 0),no([ue({type:Number})],io.prototype,"top",void 0),no([ue({type:Number})],io.prototype,"left",void 0),no([le()],io.prototype,"launcher",void 0),no([le()],io.prototype,"currentLeadSource",void 0),no([le()],io.prototype,"displayPubnubChat",void 0),no([le()],io.prototype,"myPubnub",void 0),no([le()],io.prototype,"requiresConsent",void 0),no([le()],io.prototype,"privacyPolicyUrl",void 0),no([le()],io.prototype,"isLoading",void 0),io=no([ae("health-chat")],io);class ro{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}),oo();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),ro.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,u,l;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"Pacific-Urban-Residential":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}),oo();const d=document.createElement("me-chat");d.setAttribute("orgSlug","Pacific Urban Residential"===e.organization?"Pacific-Urban-Residential":e.organization),this.handleBuildingslug(d,e.building),d.setAttribute("class","meetelise-chat"),d.setAttribute("role","dialog"),d.setAttribute("aria-label","EliseAI Widget"),d.setAttribute("aria-describedby","aria-describe-info"),d.setAttribute("aria-modal","true"),e.launcherStyles&&(d.launcherStyles=e.launcherStyles),e.mobileStyles&&(d.mobileStyles=e.mobileStyles),e.brandColor&&(this.brandColor=e.brandColor,d.setAttribute("brandColor",((e,t)=>{const n=(r=e,{r:parseInt(r.substring(1,3),16),g:parseInt(r.substring(3,5),16),b:parseInt(r.substring(5,7),16)}),i={r:n.r+Math.round(.3*(0-n.r)),g:n.g+Math.round(.3*(0-n.g)),b:n.b+Math.round(.3*(0-n.b))};var r;return((e,t,n)=>"#"+[e,t,n].map((e=>{const t=e.toString(16);return 1===t.length?"0"+t:t})).join(""))(i.r,i.g,i.b)})(e.brandColor))),e.position&&(d.setAttribute("right",(null===(a=e.position.right)||void 0===a?void 0:a.toString())||"unset"),d.setAttribute("bottom",(null===(s=e.position.bottom)||void 0===s?void 0:s.toString())||"unset"),d.setAttribute("top",(null===(u=e.position.top)||void 0===u?void 0:u.toString())||"unset"),d.setAttribute("left",(null===(l=e.position.left)||void 0===l?void 0:l.toString())||"unset")),document.body.appendChild(d),ro.meChat=d}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),ro.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/platformApi/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,brandColor:this.brandColor};this.start(r,!1)}}ro.meChat=null,ro.healthChat=null,ro.orgSlug="",ro.mutationObserver=null,ro.previousUrl="",ro.hasBuildingSlug=null,ro.brandColor="",ro.healthcareId="",ro.overridePlacement={};const oo=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
|
|
4139
|
+
`,no([ue({type:String})],io.prototype,"healthcareId",void 0),no([ue({type:Number})],io.prototype,"right",void 0),no([ue({type:Number})],io.prototype,"bottom",void 0),no([ue({type:Number})],io.prototype,"top",void 0),no([ue({type:Number})],io.prototype,"left",void 0),no([le()],io.prototype,"launcher",void 0),no([le()],io.prototype,"currentLeadSource",void 0),no([le()],io.prototype,"displayPubnubChat",void 0),no([le()],io.prototype,"myPubnub",void 0),no([le()],io.prototype,"requiresConsent",void 0),no([le()],io.prototype,"privacyPolicyUrl",void 0),no([le()],io.prototype,"isLoading",void 0),io=no([ae("health-chat")],io);class ro{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}),oo();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),ro.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,u,l;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"Pacific-Urban-Residential":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}),oo();const d=document.createElement("me-chat");d.setAttribute("orgSlug","Pacific Urban Residential"===e.organization?"Pacific-Urban-Residential":e.organization),this.handleBuildingslug(d,e.building),d.setAttribute("class","meetelise-chat"),d.setAttribute("role","dialog"),d.setAttribute("aria-label","EliseAI Widget"),d.setAttribute("aria-describedby","aria-describe-info"),d.setAttribute("aria-modal","true"),e.launcherStyles&&(d.launcherStyles=e.launcherStyles),e.mobileStyles&&(d.mobileStyles=e.mobileStyles),e.brandColor&&(this.brandColor=e.brandColor,d.setAttribute("brandColor",((e,t)=>{const n=(r=e,{r:parseInt(r.substring(1,3),16),g:parseInt(r.substring(3,5),16),b:parseInt(r.substring(5,7),16)}),i={r:n.r+Math.round(.3*(0-n.r)),g:n.g+Math.round(.3*(0-n.g)),b:n.b+Math.round(.3*(0-n.b))};var r;return((e,t,n)=>"#"+[e,t,n].map((e=>{const t=e.toString(16);return 1===t.length?"0"+t:t})).join(""))(i.r,i.g,i.b)})(e.brandColor))),e.position&&(d.setAttribute("right",(null===(a=e.position.right)||void 0===a?void 0:a.toString())||"unset"),d.setAttribute("bottom",(null===(s=e.position.bottom)||void 0===s?void 0:s.toString())||"unset"),d.setAttribute("top",(null===(u=e.position.top)||void 0===u?void 0:u.toString())||"unset"),d.setAttribute("left",(null===(l=e.position.left)||void 0===l?void 0:l.toString())||"unset")),window.eliseAi={},document.body.appendChild(d),ro.meChat=d}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),ro.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/platformApi/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,brandColor:this.brandColor};this.start(r,!1)}}ro.meChat=null,ro.healthChat=null,ro.orgSlug="",ro.mutationObserver=null,ro.previousUrl="",ro.hasBuildingSlug=null,ro.brandColor="",ro.healthcareId="",ro.overridePlacement={};const oo=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
|
package/src/MEChat.ts
CHANGED
|
@@ -131,6 +131,8 @@ export default class MEChat {
|
|
|
131
131
|
meChat.setAttribute("top", opts.position.top?.toString() || "unset");
|
|
132
132
|
meChat.setAttribute("left", opts.position.left?.toString() || "unset");
|
|
133
133
|
}
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
135
|
+
(window as any).eliseAi = {};
|
|
134
136
|
document.body.appendChild(meChat);
|
|
135
137
|
MEChat.meChat = meChat;
|
|
136
138
|
}
|
|
@@ -116,6 +116,14 @@ export class HealthChat extends LitElement {
|
|
|
116
116
|
launcherRef: Ref<Launcher> = createRef();
|
|
117
117
|
|
|
118
118
|
firstUpdated = async (): Promise<void> => {
|
|
119
|
+
const isInMaintenanceMode = true; // TODO: check
|
|
120
|
+
if (isInMaintenanceMode) {
|
|
121
|
+
// eslint-disable-next-line no-console
|
|
122
|
+
console.warn(
|
|
123
|
+
"MeetElise Chat is in maintenance mode. Chat icon will not appear."
|
|
124
|
+
);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
119
127
|
await this.initializeChatVariables();
|
|
120
128
|
};
|
|
121
129
|
|
|
@@ -94,6 +94,10 @@ export class Launcher extends LitElement {
|
|
|
94
94
|
tourTypeOptions: LabeledOption[] = [];
|
|
95
95
|
@property({ attribute: true })
|
|
96
96
|
hasDynamicSchedulingEnabled = false;
|
|
97
|
+
@property({ attribute: true })
|
|
98
|
+
onExitChat: () => void = () => {
|
|
99
|
+
return;
|
|
100
|
+
};
|
|
97
101
|
|
|
98
102
|
@property({ type: Number })
|
|
99
103
|
private right = undefined;
|
|
@@ -595,6 +599,55 @@ export class Launcher extends LitElement {
|
|
|
595
599
|
installEmailUsWindow();
|
|
596
600
|
installCallUsWindow();
|
|
597
601
|
|
|
602
|
+
if (this.hasSSTEnabled) {
|
|
603
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
604
|
+
(window as any).eliseAi.onOpenSST = (callBack?: () => void) => {
|
|
605
|
+
this.isSSTWindowOpen = true;
|
|
606
|
+
this.isCallUsWindowOpen = false;
|
|
607
|
+
this.isEmailWindowOpen = false;
|
|
608
|
+
this.onExitChat();
|
|
609
|
+
if (callBack) {
|
|
610
|
+
callBack();
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
if (this.hasChatEnabled) {
|
|
615
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
616
|
+
(window as any).eliseAi.onOpenChat = (callBack?: () => void) => {
|
|
617
|
+
this.onChatTapped();
|
|
618
|
+
this.isSSTWindowOpen = false;
|
|
619
|
+
this.isCallUsWindowOpen = false;
|
|
620
|
+
this.isEmailWindowOpen = false;
|
|
621
|
+
if (callBack) {
|
|
622
|
+
callBack();
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
if (this.hasCallUsEnabled) {
|
|
627
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
628
|
+
(window as any).eliseAi.onOpenCallUsWindow = (callBack?: () => void) => {
|
|
629
|
+
this.isCallUsWindowOpen = true;
|
|
630
|
+
this.isSSTWindowOpen = false;
|
|
631
|
+
this.isEmailWindowOpen = false;
|
|
632
|
+
this.onExitChat();
|
|
633
|
+
if (callBack) {
|
|
634
|
+
callBack();
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
if (this.hasEmailEnabled) {
|
|
639
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
640
|
+
(window as any).eliseAi.onOpenEmailUsWindow = (callBack?: () => void) => {
|
|
641
|
+
this.isEmailWindowOpen = true;
|
|
642
|
+
this.isSSTWindowOpen = false;
|
|
643
|
+
this.isCallUsWindowOpen = false;
|
|
644
|
+
this.onExitChat();
|
|
645
|
+
if (callBack) {
|
|
646
|
+
callBack();
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
|
|
598
651
|
return html`
|
|
599
652
|
<div
|
|
600
653
|
class=${classNames({
|
|
@@ -626,6 +626,14 @@ export class MEChat extends LitElement {
|
|
|
626
626
|
this.hasMounted = true;
|
|
627
627
|
localStorage.setItem("isChatOpen", "true");
|
|
628
628
|
};
|
|
629
|
+
launcher.onExitChat = this.onExitChat;
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
onExitChat = (): void => {
|
|
633
|
+
this.displayPubnubChat = false;
|
|
634
|
+
this.hideLauncher = false;
|
|
635
|
+
this.showTourNextToChat = false;
|
|
636
|
+
localStorage.setItem("isChatOpen", "false");
|
|
629
637
|
};
|
|
630
638
|
|
|
631
639
|
render(): TemplateResult {
|
|
@@ -660,12 +668,7 @@ export class MEChat extends LitElement {
|
|
|
660
668
|
.buildingSlug=${this.buildingSlug}
|
|
661
669
|
.building=${this.building}
|
|
662
670
|
.brandColor=${this.brandColor}
|
|
663
|
-
.onClickExit=${
|
|
664
|
-
this.displayPubnubChat = false;
|
|
665
|
-
this.hideLauncher = false;
|
|
666
|
-
this.showTourNextToChat = false;
|
|
667
|
-
localStorage.setItem("isChatOpen", "false");
|
|
668
|
-
}}
|
|
671
|
+
.onClickExit=${this.onExitChat}
|
|
669
672
|
.onMount=${() => {
|
|
670
673
|
this.adjustPositionChatAdditionalActions();
|
|
671
674
|
}}
|
package/src/utils.ts
CHANGED
|
@@ -50,7 +50,8 @@ export function useInterval(callback: () => void, delay: number | null): void {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export const isMobile = (): boolean =>
|
|
53
|
-
window.matchMedia("(max-width: 767px)").matches
|
|
53
|
+
window.matchMedia("(max-width: 767px)").matches ||
|
|
54
|
+
window.matchMedia("(max-height: 400px)").matches;
|
|
54
55
|
|
|
55
56
|
export const isTimestampExpired = (
|
|
56
57
|
timestamp: Date,
|