@meetelise/chat 1.20.13 → 1.20.14
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
package/public/dist/index.js
CHANGED
|
@@ -2146,7 +2146,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
2146
2146
|
</div>
|
|
2147
2147
|
`}
|
|
2148
2148
|
</div>
|
|
2149
|
-
`}};bi.styles=Kn,yi([oe({type:Boolean})],bi.prototype,"isMobile",void 0),yi([oe({type:Boolean})],bi.prototype,"isFirstMount",void 0),yi([oe()],bi.prototype,"backgroundColor",void 0),yi([oe()],bi.prototype,"textColor",void 0),yi([oe({type:Boolean})],bi.prototype,"isMini",void 0),yi([oe({attribute:!1})],bi.prototype,"autoOpenChatWidget",void 0),yi([oe()],bi.prototype,"phoneNumber",void 0),yi([oe({attribute:!0})],bi.prototype,"chatCallUsHeader",void 0),yi([oe({attribute:!1})],bi.prototype,"buildingId",void 0),yi([oe({attribute:!0})],bi.prototype,"buildingSlug",void 0),yi([oe({attribute:!0})],bi.prototype,"orgSlug",void 0),yi([oe({type:Boolean})],bi.prototype,"hasCallUsEnabled",void 0),yi([oe({type:Boolean})],bi.prototype,"hasChatEnabled",void 0),yi([oe({type:Boolean})],bi.prototype,"hasEmailEnabled",void 0),yi([oe({type:Boolean})],bi.prototype,"hasSSTEnabled",void 0),yi([oe({type:Boolean})],bi.prototype,"hasTextUsEnabled",void 0),yi([oe({attribute:!1})],bi.prototype,"layoutOptions",void 0),yi([oe({attribute:!1})],bi.prototype,"unitOptions",void 0),yi([oe({attribute:!1})],bi.prototype,"tourTypeOptions",void 0),yi([oe({attribute:!1})],bi.prototype,"onChatTapped",void 0),yi([oe({attribute:!1})],bi.prototype,"launcherStyles",void 0),yi([ae()],bi.prototype,"isEmailWindowOpen",void 0),yi([ae()],bi.prototype,"isCallUsWindowOpen",void 0),yi([ae()],bi.prototype,"isSSTWindowOpen",void 0),yi([ae()],bi.prototype,"isTextUsWindowOpen",void 0),bi=yi([ie("meetelise-launcher")],bi);var wi=n(3379),Si=n.n(wi),Ti=n(7795),xi=n.n(Ti),Oi=n(569),Ii=n.n(Oi),Ri=n(3565),Ni=n.n(Ri),Ai=n(9216),Ci=n.n(Ai),_i=n(4589),Ei=n.n(_i),Fi=n(3631),Mi={};Mi.styleTagTransform=Ei(),Mi.setAttributes=Ni(),Mi.insert=Ii().bind(null,"head"),Mi.domAPI=xi(),Mi.insertStyleElement=Ci(),Si()(Fi.Z,Mi),Fi.Z&&Fi.Z.locals&&Fi.Z.locals;var Pi,Di=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 qi=Pi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=Zn(),this.chatId="",this.analytics=null,this.isMobile=Tn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=we(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(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),yn(this.building.id),this.chatId=function(e,t){const n=Hn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Wn(e,t),i=localStorage.getItem(n)||jn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Bn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=Zn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new Fn(this.orgSlug,this.buildingSlug,this.chatId))},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,Pi.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)=>{const r=n.createPopup(Qn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r;const a=sessionStorage.getItem("autoOpenedTimestamp"),s=!a||a&&en(nn(a));e.autoOpenChatWidget&&s&&(this.popup.show(),this.hideLauncher=!0,this.hasMounted=!0,sessionStorage.setItem("autoOpenedTimestamp",Vt(function(e,t){Ee(2,arguments);var n=Ve(t);return Xe(e,6e4*n)}(new Date,15))))},this.firstUpdated=()=>{this.initializeInstanceVariables()},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&&Pi.session))return;this.chatId=Bn(this.orgSlug,this.buildingSlug);const e=await Pi.session;this.analytics.chatId=this.chatId,this.popup.select(Qn(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")}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,b,w,S,T;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",bi),D`
|
|
2149
|
+
`}};bi.styles=Kn,yi([oe({type:Boolean})],bi.prototype,"isMobile",void 0),yi([oe({type:Boolean})],bi.prototype,"isFirstMount",void 0),yi([oe()],bi.prototype,"backgroundColor",void 0),yi([oe()],bi.prototype,"textColor",void 0),yi([oe({type:Boolean})],bi.prototype,"isMini",void 0),yi([oe({attribute:!1})],bi.prototype,"autoOpenChatWidget",void 0),yi([oe()],bi.prototype,"phoneNumber",void 0),yi([oe({attribute:!0})],bi.prototype,"chatCallUsHeader",void 0),yi([oe({attribute:!1})],bi.prototype,"buildingId",void 0),yi([oe({attribute:!0})],bi.prototype,"buildingSlug",void 0),yi([oe({attribute:!0})],bi.prototype,"orgSlug",void 0),yi([oe({type:Boolean})],bi.prototype,"hasCallUsEnabled",void 0),yi([oe({type:Boolean})],bi.prototype,"hasChatEnabled",void 0),yi([oe({type:Boolean})],bi.prototype,"hasEmailEnabled",void 0),yi([oe({type:Boolean})],bi.prototype,"hasSSTEnabled",void 0),yi([oe({type:Boolean})],bi.prototype,"hasTextUsEnabled",void 0),yi([oe({attribute:!1})],bi.prototype,"layoutOptions",void 0),yi([oe({attribute:!1})],bi.prototype,"unitOptions",void 0),yi([oe({attribute:!1})],bi.prototype,"tourTypeOptions",void 0),yi([oe({attribute:!1})],bi.prototype,"onChatTapped",void 0),yi([oe({attribute:!1})],bi.prototype,"launcherStyles",void 0),yi([ae()],bi.prototype,"isEmailWindowOpen",void 0),yi([ae()],bi.prototype,"isCallUsWindowOpen",void 0),yi([ae()],bi.prototype,"isSSTWindowOpen",void 0),yi([ae()],bi.prototype,"isTextUsWindowOpen",void 0),bi=yi([ie("meetelise-launcher")],bi);var wi=n(3379),Si=n.n(wi),Ti=n(7795),xi=n.n(Ti),Oi=n(569),Ii=n.n(Oi),Ri=n(3565),Ni=n.n(Ri),Ai=n(9216),Ci=n.n(Ai),_i=n(4589),Ei=n.n(_i),Fi=n(3631),Mi={};Mi.styleTagTransform=Ei(),Mi.setAttributes=Ni(),Mi.insert=Ii().bind(null,"head"),Mi.domAPI=xi(),Mi.insertStyleElement=Ci(),Si()(Fi.Z,Mi),Fi.Z&&Fi.Z.locals&&Fi.Z.locals;var Pi,Di=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 qi=Pi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=Zn(),this.chatId="",this.analytics=null,this.isMobile=Tn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=we(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(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),yn(this.building.id),this.chatId=function(e,t){const n=Hn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Wn(e,t),i=localStorage.getItem(n)||jn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Bn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=Zn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new Fn(this.orgSlug,this.buildingSlug,this.chatId))},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,Pi.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)=>{const r=n.createPopup(Qn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r;const a=sessionStorage.getItem("autoOpenedTimestamp"),s=!a||a&&en(nn(a));e.autoOpenChatWidget&&s&&!Tn()&&(this.popup.show(),this.hideLauncher=!0,this.hasMounted=!0,sessionStorage.setItem("autoOpenedTimestamp",Vt(function(e,t){Ee(2,arguments);var n=Ve(t);return Xe(e,6e4*n)}(new Date,15))))},this.firstUpdated=()=>{this.initializeInstanceVariables()},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&&Pi.session))return;this.chatId=Bn(this.orgSlug,this.buildingSlug);const e=await Pi.session;this.analytics.chatId=this.chatId,this.popup.select(Qn(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")}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,b,w,S,T;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",bi),D`
|
|
2150
2150
|
<div
|
|
2151
2151
|
class=${ce({launcherContainer:!0,launcher__mobile:this.isMobile,launcher__desktop:!this.isMobile,"meetelise-chat":!0,launcher:!0,shouldBeVisible:!0})}
|
|
2152
2152
|
>
|
|
@@ -229,7 +229,7 @@ export class MEChat extends LitElement {
|
|
|
229
229
|
const shouldAutoOpen =
|
|
230
230
|
!autoOpenedTimestamp ||
|
|
231
231
|
(autoOpenedTimestamp && isPast(parseISO(autoOpenedTimestamp)));
|
|
232
|
-
if (building.autoOpenChatWidget && shouldAutoOpen) {
|
|
232
|
+
if (building.autoOpenChatWidget && shouldAutoOpen && !isMobile()) {
|
|
233
233
|
this.popup.show();
|
|
234
234
|
this.hideLauncher = true;
|
|
235
235
|
this.hasMounted = true;
|