@meetelise/chat 1.13.3 → 1.13.6
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
|
@@ -1737,7 +1737,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1737
1737
|
.call-us-window__open-times {
|
|
1738
1738
|
text-transform: lowercase;
|
|
1739
1739
|
}
|
|
1740
|
-
`],Qn([oe({attribute:!1})],Zn.prototype,"onCloseClicked",void 0),Qn([oe()],Zn.prototype,"phoneNumber",void 0),Qn([oe({attribute:!1})],Zn.prototype,"buildingId",void 0),Qn([oe({attribute:!1})],Zn.prototype,"officeHoursTextInfo",void 0),Zn=Qn([ie("call-us-window")],Zn);const Kn={};var Yn=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 ei=class extends te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.phoneNumber="",this.buildingId=0,this.hasEmailEnabled=!0,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.launcherStyles={},this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=be(),this.textUsWindowRef=be(),this.tourSchedulerRef=be(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(Kn[e])return Kn[e];const t=`http://ivr.internal-meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Xt().get(t);return Kn[e]=n.data,n.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&4895!==this.buildingId
|
|
1740
|
+
`],Qn([oe({attribute:!1})],Zn.prototype,"onCloseClicked",void 0),Qn([oe()],Zn.prototype,"phoneNumber",void 0),Qn([oe({attribute:!1})],Zn.prototype,"buildingId",void 0),Qn([oe({attribute:!1})],Zn.prototype,"officeHoursTextInfo",void 0),Zn=Qn([ie("call-us-window")],Zn);const Kn={};var Yn=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 ei=class extends te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.phoneNumber="",this.buildingId=0,this.hasEmailEnabled=!0,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.launcherStyles={},this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=be(),this.textUsWindowRef=be(),this.tourSchedulerRef=be(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){try{const e=await(async e=>{if(Kn[e])return Kn[e];const t=`http://ivr.internal-meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Xt().get(t);return Kn[e]=n.data,n.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&4895!==this.buildingId}catch(e){console.warn(e)}3660===this.buildingId&&(this.hasSSTEnabled=!0)}},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToTextUsWindow=()=>{const e=this.textUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseTextUsWindow)},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 D`
|
|
1741
1741
|
<div
|
|
1742
1742
|
@click=${this.onClickEmailOption}
|
|
1743
1743
|
class="launcher__call-to-action-option"
|
|
@@ -1953,7 +1953,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1953
1953
|
</div>
|
|
1954
1954
|
`}
|
|
1955
1955
|
</div>
|
|
1956
|
-
`}};ei.styles=Mn,Yn([oe({type:Boolean})],ei.prototype,"isMobile",void 0),Yn([oe({type:Boolean})],ei.prototype,"isFirstMount",void 0),Yn([oe()],ei.prototype,"backgroundColor",void 0),Yn([oe()],ei.prototype,"textColor",void 0),Yn([oe({type:Boolean})],ei.prototype,"isMini",void 0),Yn([oe()],ei.prototype,"phoneNumber",void 0),Yn([oe({attribute:!1})],ei.prototype,"buildingId",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasEmailEnabled",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasSSTEnabled",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasTextUsEnabled",void 0),Yn([oe({attribute:!1})],ei.prototype,"layoutOptions",void 0),Yn([oe({attribute:!1})],ei.prototype,"tourTypeOptions",void 0),Yn([oe({attribute:!1})],ei.prototype,"onChatTapped",void 0),Yn([oe()],ei.prototype,"launcherStyles",void 0),Yn([ae()],ei.prototype,"isEmailWindowOpen",void 0),Yn([ae()],ei.prototype,"isCallUsWindowOpen",void 0),Yn([ae()],ei.prototype,"isSSTWindowOpen",void 0),Yn([ae()],ei.prototype,"isTextUsWindowOpen",void 0),ei=Yn([ie("meetelise-launcher")],ei);var ti=n(3379),ni=n.n(ti),ii=n(7795),ri=n.n(ii),oi=n(569),ai=n.n(oi),si=n(3565),ui=n.n(si),li=n(9216),di=n.n(li),ci=n(4589),pi=n.n(ci),fi=n(3631),hi={};hi.styleTagTransform=pi(),hi.setAttributes=ui(),hi.insert=ai().bind(null,"head"),hi.domAPI=ri(),hi.insertStyleElement=di(),ni()(fi.Z,hi),fi.Z&&fi.Z.locals&&fi.Z.locals;var mi,vi=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 gi=mi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=An(),this.chatId="",this.analytics=null,this.isMobile=rn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=be(),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/api/pub/v1/organization/${e}/building/${t}`,i=await fetch(n);return await i.json()}(this.orgSlug,this.buildingSlug),Yt(this.building.id),this.chatId=function(e,t){const n=Tn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=xn(e,t),i=localStorage.getItem(n)||Sn(e,t),r=new Date(new Date(i).getTime()+864e5);return new Date>r}(e,t)?i:bn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=An(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new cn(this.orgSlug,this.buildingSlug,this.chatId))},this.initializeLaunchJS=async()=>{if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[e,t,n,i]=await Promise.all([this.building,this.theme,this.avatarSrc,mi.session]);if(e.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(e,t,i,n),this.configureLauncherElement(),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(_n(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},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&&mi.session))return;this.chatId=bn(this.orgSlug,this.buildingSlug);const e=await mi.session;this.analytics.chatId=this.chatId,this.popup.select(_n(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;return 182===(null===(e=this.building)||void 0===e?void 0:e.orgId)?D``:(window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",ei),D`
|
|
1956
|
+
`}};ei.styles=Mn,Yn([oe({type:Boolean})],ei.prototype,"isMobile",void 0),Yn([oe({type:Boolean})],ei.prototype,"isFirstMount",void 0),Yn([oe()],ei.prototype,"backgroundColor",void 0),Yn([oe()],ei.prototype,"textColor",void 0),Yn([oe({type:Boolean})],ei.prototype,"isMini",void 0),Yn([oe()],ei.prototype,"phoneNumber",void 0),Yn([oe({attribute:!1})],ei.prototype,"buildingId",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasEmailEnabled",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasSSTEnabled",void 0),Yn([oe({type:Boolean})],ei.prototype,"hasTextUsEnabled",void 0),Yn([oe({attribute:!1})],ei.prototype,"layoutOptions",void 0),Yn([oe({attribute:!1})],ei.prototype,"tourTypeOptions",void 0),Yn([oe({attribute:!1})],ei.prototype,"onChatTapped",void 0),Yn([oe()],ei.prototype,"launcherStyles",void 0),Yn([ae()],ei.prototype,"isEmailWindowOpen",void 0),Yn([ae()],ei.prototype,"isCallUsWindowOpen",void 0),Yn([ae()],ei.prototype,"isSSTWindowOpen",void 0),Yn([ae()],ei.prototype,"isTextUsWindowOpen",void 0),ei=Yn([ie("meetelise-launcher")],ei);var ti=n(3379),ni=n.n(ti),ii=n(7795),ri=n.n(ii),oi=n(569),ai=n.n(oi),si=n(3565),ui=n.n(si),li=n(9216),di=n.n(li),ci=n(4589),pi=n.n(ci),fi=n(3631),hi={};hi.styleTagTransform=pi(),hi.setAttributes=ui(),hi.insert=ai().bind(null,"head"),hi.domAPI=ri(),hi.insertStyleElement=di(),ni()(fi.Z,hi),fi.Z&&fi.Z.locals&&fi.Z.locals;var mi,vi=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 gi=mi=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=An(),this.chatId="",this.analytics=null,this.isMobile=rn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=be(),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/api/pub/v1/organization/${e}/building/${t}`,i=await fetch(n);return await i.json()}(this.orgSlug,this.buildingSlug),Yt(this.building.id),this.chatId=function(e,t){const n=Tn(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=xn(e,t),i=localStorage.getItem(n)||Sn(e,t),r=new Date(new Date(i).getTime()+864e5);return new Date>r}(e,t)?i:bn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=An(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new cn(this.orgSlug,this.buildingSlug,this.chatId))},this.initializeLaunchJS=async()=>{if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[e,t,n,i]=await Promise.all([this.building,this.theme,this.avatarSrc,mi.session]);if(e.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(e,t,i,n),this.configureLauncherElement(),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(_n(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},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&&mi.session))return;this.chatId=bn(this.orgSlug,this.buildingSlug);const e=await mi.session;this.analytics.chatId=this.chatId,this.popup.select(_n(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;return 182===(null===(e=this.building)||void 0===e?void 0:e.orgId)||4930===(null===(t=this.building)||void 0===t?void 0:t.id)?D``:(window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",ei),D`
|
|
1957
1957
|
<div
|
|
1958
1958
|
class=${ce({launcherContainer:!0,launcher__mobile:this.isMobile,launcher__desktop:!this.isMobile,"meetelise-chat":!0,launcher:!0,shouldBeVisible:!0})}
|
|
1959
1959
|
>
|
|
@@ -1962,11 +1962,11 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1962
1962
|
.isMobile=${this.isMobile}
|
|
1963
1963
|
.isFirstMount=${!this.hasMounted}
|
|
1964
1964
|
.isMini=${this.useMiniWidget}
|
|
1965
|
-
.buildingId=${null!==(
|
|
1966
|
-
.layoutOptions=${null!==(
|
|
1967
|
-
.tourTypeOptions=${null!==(
|
|
1965
|
+
.buildingId=${null!==(i=null===(n=this.building)||void 0===n?void 0:n.id)&&void 0!==i?i:0}
|
|
1966
|
+
.layoutOptions=${null!==(o=null===(r=this.building)||void 0===r?void 0:r.layoutOptions)&&void 0!==o?o:[]}
|
|
1967
|
+
.tourTypeOptions=${null!==(s=null===(a=this.building)||void 0===a?void 0:a.tourTypeOptions)&&void 0!==s?s:[]}
|
|
1968
1968
|
.launcherStyles=${this.launcherStyles}
|
|
1969
|
-
phoneNumber="${null!==(
|
|
1969
|
+
phoneNumber="${null!==(l=null===(u=this.building)||void 0===u?void 0:u.phoneNumber)&&void 0!==l?l:""}"
|
|
1970
1970
|
textColor="${this.theme.chatHeader.textColor}"
|
|
1971
1971
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|
|
1972
1972
|
?hidden=${this.hideLauncher}
|
|
@@ -80,11 +80,17 @@ export class Launcher extends LitElement {
|
|
|
80
80
|
this.attachOnClickToTextUsWindow();
|
|
81
81
|
this.attachOnClickToSSTWindow();
|
|
82
82
|
if (this.buildingId) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
try {
|
|
84
|
+
const registeredPhoneNumbers = await getRegisteredPhoneNumbers(
|
|
85
|
+
this.buildingId
|
|
86
|
+
);
|
|
87
|
+
this.hasTextUsEnabled =
|
|
88
|
+
registeredPhoneNumbers.length > 0 && this.buildingId !== 4895;
|
|
89
|
+
} catch (e) {
|
|
90
|
+
// TEMPORARY until we can fix the ivr endpoint to use https
|
|
91
|
+
// eslint-disable-next-line no-console
|
|
92
|
+
console.warn(e);
|
|
93
|
+
}
|
|
88
94
|
if (this.buildingId === 3660) {
|
|
89
95
|
this.hasSSTEnabled = true;
|
|
90
96
|
}
|