@meetelise/chat 1.12.12 → 1.12.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.12.12",
3
+ "version": "1.12.13",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "public/dist/index.js",
@@ -93,6 +93,7 @@
93
93
  MEChat.start({
94
94
  organization: "test-company",
95
95
  building: "e2e-test-yardi-building",
96
+ launcherStyles: { bottom: "300px" },
96
97
  });
97
98
  </script>
98
99
  <main>
@@ -1738,7 +1738,7 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
1738
1738
  .call-us-window__open-times {
1739
1739
  text-transform: lowercase;
1740
1740
  }
1741
- `],sn([oe({attribute:!1})],ln.prototype,"onCloseClicked",void 0),sn([oe()],ln.prototype,"phoneNumber",void 0),sn([oe({attribute:!1})],ln.prototype,"buildingId",void 0),sn([oe({attribute:!1})],ln.prototype,"officeHoursTextInfo",void 0),ln=sn([ne("call-us-window")],ln);const un={};var dn=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let cn=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.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=Se(),this.textUsWindowRef=Se(),this.tourSchedulerRef=Se(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(un[e])return un[e];const t=`http://ivr.internal-meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,i=await ui().get(t);return un[e]=i.data,i.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&4895!==this.buildingId}},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
+ `],sn([oe({attribute:!1})],ln.prototype,"onCloseClicked",void 0),sn([oe()],ln.prototype,"phoneNumber",void 0),sn([oe({attribute:!1})],ln.prototype,"buildingId",void 0),sn([oe({attribute:!1})],ln.prototype,"officeHoursTextInfo",void 0),ln=sn([ne("call-us-window")],ln);const un={};var dn=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let cn=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.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=Se(),this.textUsWindowRef=Se(),this.tourSchedulerRef=Se(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(un[e])return un[e];const t=`http://ivr.internal-meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,i=await ui().get(t);return un[e]=i.data,i.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&4895!==this.buildingId}},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`
1742
1742
  <div
1743
1743
  @click=${this.onClickEmailOption}
1744
1744
  class="launcher__call-to-action-option"
@@ -1777,7 +1777,10 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
1777
1777
  </div>
1778
1778
  </div>
1779
1779
  `,this.renderMiniLauncher=()=>D`
1780
- <div class="launcher__mini-launcher-wrapper">
1780
+ <div
1781
+ class="launcher__mini-launcher-wrapper"
1782
+ style=${zi(this.launcherStyles)}
1783
+ >
1781
1784
  ${this.isEmailWindowOpen?D`<div class="launcher__window-wrapper">
1782
1785
  <email-us-window
1783
1786
  ${xe(this.emailUsWindowRef)}
@@ -1953,7 +1956,7 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
1953
1956
  </div>
1954
1957
  `}
1955
1958
  </div>
1956
- `}};cn.styles=Hi,dn([oe({type:Boolean})],cn.prototype,"isMobile",void 0),dn([oe({type:Boolean})],cn.prototype,"isFirstMount",void 0),dn([oe()],cn.prototype,"backgroundColor",void 0),dn([oe()],cn.prototype,"textColor",void 0),dn([oe({type:Boolean})],cn.prototype,"isMini",void 0),dn([oe()],cn.prototype,"phoneNumber",void 0),dn([oe({attribute:!1})],cn.prototype,"buildingId",void 0),dn([oe({type:Boolean})],cn.prototype,"hasEmailEnabled",void 0),dn([oe({type:Boolean})],cn.prototype,"hasSSTEnabled",void 0),dn([oe({type:Boolean})],cn.prototype,"hasTextUsEnabled",void 0),dn([oe({attribute:!1})],cn.prototype,"layoutOptions",void 0),dn([oe({attribute:!1})],cn.prototype,"tourTypeOptions",void 0),dn([oe({attribute:!1})],cn.prototype,"onChatTapped",void 0),dn([ae()],cn.prototype,"isEmailWindowOpen",void 0),dn([ae()],cn.prototype,"isCallUsWindowOpen",void 0),dn([ae()],cn.prototype,"isSSTWindowOpen",void 0),dn([ae()],cn.prototype,"isTextUsWindowOpen",void 0),cn=dn([ne("meetelise-launcher")],cn);var pn=i(3379),fn=i.n(pn),mn=i(7795),hn=i.n(mn),vn=i(569),gn=i.n(vn),yn=i(3565),wn=i.n(yn),Sn=i(9216),bn=i.n(Sn),Tn=i(4589),xn=i.n(Tn),On=i(3631),In={};In.styleTagTransform=xn(),In.setAttributes=wn(),In.insert=gn().bind(null,"head"),In.domAPI=hn(),In.insertStyleElement=bn(),fn()(On.Z,In),On.Z&&On.Z.locals&&On.Z.locals;var Rn,Nn=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Cn=Rn=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.popup=null,this.theme=ki(),this.chatId="",this.analytics=null,this.isMobile=vi(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=Se(),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 i=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,n=await fetch(i);return await n.json()}(this.orgSlug,this.buildingSlug),fi(this.building.id),this.chatId=function(e,t){const i=Fi(e,t),n=localStorage.getItem(i);return n&&!function(e,t){const i=Mi(e,t),n=localStorage.getItem(i)||_i(e,t),r=new Date(new Date(n).getTime()+864e5);return new Date>r}(e,t)?n:Ei(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=ki(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId))},this.initializeLaunchJS=async()=>{if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[e,t,i,n]=await Promise.all([this.building,this.theme,this.avatarSrc,Rn.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,n,i),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,i,n)=>{const r=i.createPopup(Li(i,e,t,n||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,i;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(i=this.analytics)||void 0===i||i.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.theme&&this.popup&&Rn.session))return;this.chatId=Ei(this.orgSlug,this.buildingSlug);const e=await Rn.session;this.analytics.chatId=this.chatId,this.popup.select(Li(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,i,n,r,o,a,s;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",cn),D`
1959
+ `}};cn.styles=Hi,dn([oe({type:Boolean})],cn.prototype,"isMobile",void 0),dn([oe({type:Boolean})],cn.prototype,"isFirstMount",void 0),dn([oe()],cn.prototype,"backgroundColor",void 0),dn([oe()],cn.prototype,"textColor",void 0),dn([oe({type:Boolean})],cn.prototype,"isMini",void 0),dn([oe()],cn.prototype,"phoneNumber",void 0),dn([oe({attribute:!1})],cn.prototype,"buildingId",void 0),dn([oe({type:Boolean})],cn.prototype,"hasEmailEnabled",void 0),dn([oe({type:Boolean})],cn.prototype,"hasSSTEnabled",void 0),dn([oe({type:Boolean})],cn.prototype,"hasTextUsEnabled",void 0),dn([oe({attribute:!1})],cn.prototype,"layoutOptions",void 0),dn([oe({attribute:!1})],cn.prototype,"tourTypeOptions",void 0),dn([oe({attribute:!1})],cn.prototype,"onChatTapped",void 0),dn([oe()],cn.prototype,"launcherStyles",void 0),dn([ae()],cn.prototype,"isEmailWindowOpen",void 0),dn([ae()],cn.prototype,"isCallUsWindowOpen",void 0),dn([ae()],cn.prototype,"isSSTWindowOpen",void 0),dn([ae()],cn.prototype,"isTextUsWindowOpen",void 0),cn=dn([ne("meetelise-launcher")],cn);var pn=i(3379),fn=i.n(pn),mn=i(7795),hn=i.n(mn),vn=i(569),gn=i.n(vn),yn=i(3565),wn=i.n(yn),Sn=i(9216),bn=i.n(Sn),Tn=i(4589),xn=i.n(Tn),On=i(3631),In={};In.styleTagTransform=xn(),In.setAttributes=wn(),In.insert=gn().bind(null,"head"),In.domAPI=hn(),In.insertStyleElement=bn(),fn()(On.Z,In),On.Z&&On.Z.locals&&On.Z.locals;var Rn,Nn=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Cn=Rn=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=ki(),this.chatId="",this.analytics=null,this.isMobile=vi(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=Se(),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 i=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,n=await fetch(i);return await n.json()}(this.orgSlug,this.buildingSlug),fi(this.building.id),this.chatId=function(e,t){const i=Fi(e,t),n=localStorage.getItem(i);return n&&!function(e,t){const i=Mi(e,t),n=localStorage.getItem(i)||_i(e,t),r=new Date(new Date(n).getTime()+864e5);return new Date>r}(e,t)?n:Ei(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=ki(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId))},this.initializeLaunchJS=async()=>{if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[e,t,i,n]=await Promise.all([this.building,this.theme,this.avatarSrc,Rn.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,n,i),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,i,n)=>{const r=i.createPopup(Li(i,e,t,n||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,i;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(i=this.analytics)||void 0===i||i.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.theme&&this.popup&&Rn.session))return;this.chatId=Ei(this.orgSlug,this.buildingSlug);const e=await Rn.session;this.analytics.chatId=this.chatId,this.popup.select(Li(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,i,n,r,o,a,s;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",cn),D`
1957
1960
  <div
1958
1961
  class=${ce({launcherContainer:!0,launcher__mobile:this.isMobile,launcher__desktop:!this.isMobile,"meetelise-chat":!0,launcher:!0,shouldBeVisible:!0})}
1959
1962
  >
@@ -1965,6 +1968,7 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
1965
1968
  .buildingId=${null!==(t=null===(e=this.building)||void 0===e?void 0:e.id)&&void 0!==t?t:0}
1966
1969
  .layoutOptions=${null!==(n=null===(i=this.building)||void 0===i?void 0:i.layoutOptions)&&void 0!==n?n:[]}
1967
1970
  .tourTypeOptions=${null!==(o=null===(r=this.building)||void 0===r?void 0:r.tourTypeOptions)&&void 0!==o?o:[]}
1971
+ .launcherStyles=${this.launcherStyles}
1968
1972
  phoneNumber="${null!==(s=null===(a=this.building)||void 0===a?void 0:a.phoneNumber)&&void 0!==s?s:""}"
1969
1973
  textColor="${this.theme.chatHeader.textColor}"
1970
1974
  backgroundColor="${this.theme.chatPaneBackgroundColor}"
@@ -1985,4 +1989,4 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
1985
1989
  width: 100%;
1986
1990
  height: 100px;
1987
1991
  }
1988
- `,Cn.session=Oe.ready.then((()=>{const e=new Oe.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Oe.Session({appId:"ogKIvCor",me:e})})),Nn([oe({type:String})],Cn.prototype,"buildingSlug",void 0),Nn([oe({type:String})],Cn.prototype,"orgSlug",void 0),Nn([oe({type:String})],Cn.prototype,"themeId",void 0),Nn([oe({attribute:!1})],Cn.prototype,"avatarSrc",void 0),Nn([oe({type:Boolean})],Cn.prototype,"useMiniWidget",void 0),Nn([ae()],Cn.prototype,"popup",void 0),Nn([ae()],Cn.prototype,"theme",void 0),Nn([ae()],Cn.prototype,"chatId",void 0),Nn([ae()],Cn.prototype,"analytics",void 0),Nn([ae()],Cn.prototype,"isMobile",void 0),Nn([ae()],Cn.prototype,"launcher",void 0),Nn([ae()],Cn.prototype,"building",void 0),Nn([ae()],Cn.prototype,"hasMounted",void 0),Nn([ae()],Cn.prototype,"hideLauncher",void 0),Cn=Rn=Nn([ne("me-chat")],Cn);class An{static start(e){En();const t=document.createElement("me-chat");t.setAttribute("orgSlug",e.organization),t.setAttribute("buildingSlug",e.building),t.setAttribute("class","meetelise-chat"),e.themeId&&t.setAttribute("themeId",e.themeId),e.avatarSrc&&t.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(t.useMiniWidget=e.mini),document.body.appendChild(t),An.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}}An.meChat=null;const En=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href","https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap"),document.head.appendChild(e)}})();var r=n.Z;export{r as default};
1992
+ `,Cn.session=Oe.ready.then((()=>{const e=new Oe.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Oe.Session({appId:"ogKIvCor",me:e})})),Nn([oe({type:String})],Cn.prototype,"buildingSlug",void 0),Nn([oe({type:String})],Cn.prototype,"orgSlug",void 0),Nn([oe({type:String})],Cn.prototype,"themeId",void 0),Nn([oe({attribute:!1})],Cn.prototype,"avatarSrc",void 0),Nn([oe({type:Boolean})],Cn.prototype,"useMiniWidget",void 0),Nn([oe()],Cn.prototype,"launcherStyles",void 0),Nn([ae()],Cn.prototype,"popup",void 0),Nn([ae()],Cn.prototype,"theme",void 0),Nn([ae()],Cn.prototype,"chatId",void 0),Nn([ae()],Cn.prototype,"analytics",void 0),Nn([ae()],Cn.prototype,"isMobile",void 0),Nn([ae()],Cn.prototype,"launcher",void 0),Nn([ae()],Cn.prototype,"building",void 0),Nn([ae()],Cn.prototype,"hasMounted",void 0),Nn([ae()],Cn.prototype,"hideLauncher",void 0),Cn=Rn=Nn([ne("me-chat")],Cn);class An{static start(e){En();const t=document.createElement("me-chat");t.setAttribute("orgSlug",e.organization),t.setAttribute("buildingSlug",e.building),t.setAttribute("class","meetelise-chat"),e.themeId&&t.setAttribute("themeId",e.themeId),e.avatarSrc&&t.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(t.useMiniWidget=e.mini),e.launcherStyles&&(t.launcherStyles=e.launcherStyles),document.body.appendChild(t),An.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}}An.meChat=null;const En=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href","https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap"),document.head.appendChild(e)}})();var r=n.Z;export{r as default};
package/src/MEChat.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { StyleInfo } from "lit/directives/style-map";
1
2
  import { ThemeIdString } from "./themes";
2
3
  import "./WebComponent/me-chat";
3
4
  import { MEChat as MEChatLitElement } from "./WebComponent/me-chat";
@@ -32,6 +33,9 @@ export default class MEChat {
32
33
  if (opts.mini !== undefined) {
33
34
  meChat.useMiniWidget = opts.mini;
34
35
  }
36
+ if (opts.launcherStyles) {
37
+ meChat.launcherStyles = opts.launcherStyles;
38
+ }
35
39
  document.body.appendChild(meChat);
36
40
  MEChat.meChat = meChat;
37
41
  }
@@ -50,6 +54,7 @@ export interface Options {
50
54
  themeId?: ThemeIdString;
51
55
  avatarSrc?: string;
52
56
  mini?: boolean;
57
+ launcherStyles?: StyleInfo;
53
58
  }
54
59
 
55
60
  /** You can't install a font from CSS in a shadow DOM, so we use JS to do it here in the regular DOM. */
@@ -8,7 +8,7 @@ import { glowBarMp4, glowBarWebm } from "../assetUrls";
8
8
  import { launcherStyles } from "./launcherStyles";
9
9
  import { EmailUsWindow, installEmailUsWindow } from "./actions/email-us-window";
10
10
  import { installTextUsWindow, TextUsWindow } from "./actions/text-us-window";
11
- import { styleMap } from "lit/directives/style-map.js";
11
+ import { StyleInfo, styleMap } from "lit/directives/style-map.js";
12
12
  import { classMap } from "lit/directives/class-map.js";
13
13
  import { installCallUsWindow } from "./actions/call-us-window";
14
14
  import { getRegisteredPhoneNumbers } from "../getRegisteredPhoneNumbers";
@@ -54,6 +54,8 @@ export class Launcher extends LitElement {
54
54
  onChatTapped: () => void = () => {
55
55
  return;
56
56
  };
57
+ @property()
58
+ launcherStyles: StyleInfo = {};
57
59
 
58
60
  @state()
59
61
  isEmailWindowOpen = false;
@@ -244,7 +246,10 @@ export class Launcher extends LitElement {
244
246
 
245
247
  renderMiniLauncher = (): TemplateResult => {
246
248
  return html`
247
- <div class="launcher__mini-launcher-wrapper">
249
+ <div
250
+ class="launcher__mini-launcher-wrapper"
251
+ style=${styleMap(this.launcherStyles)}
252
+ >
248
253
  ${this.isEmailWindowOpen
249
254
  ? html`<div class="launcher__window-wrapper">
250
255
  <email-us-window
@@ -15,6 +15,7 @@ import { installLauncher } from "./Launcher";
15
15
 
16
16
  import "./MEChat.css";
17
17
  import { getRawAvailabilities } from "../getAvailabilities";
18
+ import { StyleInfo } from "lit/directives/style-map";
18
19
 
19
20
  export interface Options {
20
21
  building: string;
@@ -62,6 +63,8 @@ export class MEChat extends LitElement {
62
63
  private avatarSrc?: string | null;
63
64
  @property({ type: Boolean })
64
65
  useMiniWidget = true;
66
+ @property()
67
+ launcherStyles: StyleInfo = {};
65
68
 
66
69
  @state()
67
70
  private popup: Talk.Popup | null = null;
@@ -277,6 +280,7 @@ export class MEChat extends LitElement {
277
280
  .buildingId=${this.building?.id ?? 0}
278
281
  .layoutOptions=${this.building?.layoutOptions ?? []}
279
282
  .tourTypeOptions=${this.building?.tourTypeOptions ?? []}
283
+ .launcherStyles=${this.launcherStyles}
280
284
  phoneNumber="${this.building?.phoneNumber ?? ""}"
281
285
  textColor="${this.theme.chatHeader.textColor}"
282
286
  backgroundColor="${this.theme.chatPaneBackgroundColor}"