@meetelise/chat 1.19.5 → 1.20.0

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.19.5",
3
+ "version": "1.20.0",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -1047,7 +1047,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
1047
1047
  margin-top: 37px;
1048
1048
  }
1049
1049
  }
1050
- `,On([oe({attribute:!1})],In.prototype,"layoutOptions",void 0),On([oe({attribute:!1})],In.prototype,"tourTypeOptions",void 0),On([oe({type:Number})],In.prototype,"buildingId",void 0),On([oe({attribute:!1})],In.prototype,"onCloseClicked",void 0),On([ae()],In.prototype,"tourType",void 0),On([ae()],In.prototype,"shouldShowTourType",void 0),On([ae()],In.prototype,"email",void 0),On([ae()],In.prototype,"phoneNumber",void 0),On([ae()],In.prototype,"availabilitiesGroupedByDay",void 0),On([ae()],In.prototype,"waitingForAvailabilities",void 0),On([ae()],In.prototype,"selectedDate",void 0),On([ae()],In.prototype,"selectedTime",void 0),On([ae()],In.prototype,"mobilePageIndex",void 0),On([ae()],In.prototype,"isSubmitting",void 0),On([ae()],In.prototype,"tourIsBooked",void 0),On([se(".inputContainer#firstName input")],In.prototype,"firstNameInput",void 0),On([se(".inputContainer#lastName input")],In.prototype,"lastNameInput",void 0),On([se(".inputContainer#email input")],In.prototype,"emailInput",void 0),On([se(".inputContainer#phone input")],In.prototype,"phoneInput",void 0),On([se("me-select#unitType")],In.prototype,"unitTypeSelect",void 0),In=On([ie("tour-scheduler")],In),function(e){e[e.Guided=0]="Guided",e[e.Self=1]="Self",e[e.Virtual=2]="Virtual"}(Rn||(Rn={}));const Nn={[Rn.Guided]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[Rn.Self]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[Rn.Virtual]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},An={[Rn.Guided]:"escorted-tour",[Rn.Self]:"self-guided-tour",[Rn.Virtual]:"live-virtual-tour"};class Cn{constructor(e,t,n){this.org=e,this.building=t,this.chatId=n,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}campaignSources(){var e,t,n;const i=new URL(window.location.href).searchParams,r=null!==(n=null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&void 0!==n?n:null;return{entrataCampaignSource:i.get("switch_cls[id]"),realpageCampaignSource:i.get("ilm"),utmCampaignSource:i.get("utm_source"),yardiCampaignSource:r}}ping(e){fetch("https://app.meetelise.com/platformApi/connectors/talk_js/analytics",{method:"POST",credentials:"omit",keepalive:!0,headers:{"content-type":"application/json; charset=UTF-8"},body:JSON.stringify({eventType:e,chatId:this.chatId,url:location.href,org:this.org,building:this.building,referrer:document.referrer,featureFlags:this.featureFlags,campaignSources:this.campaignSources()})})}}var En,_n=new Uint8Array(16);function Fn(){if(!En&&!(En="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 En(_n)}const Mn=/^(?:[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,Pn=function(e){return"string"==typeof e&&Mn.test(e)};for(var Dn=[],qn=0;qn<256;++qn)Dn.push((qn+256).toString(16).substr(1));const Un=function(e,t,n){var i=(e=e||{}).random||(e.rng||Fn)();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=(Dn[e[t+0]]+Dn[e[t+1]]+Dn[e[t+2]]+Dn[e[t+3]]+"-"+Dn[e[t+4]]+Dn[e[t+5]]+"-"+Dn[e[t+6]]+Dn[e[t+7]]+"-"+Dn[e[t+8]]+Dn[e[t+9]]+"-"+Dn[e[t+10]]+Dn[e[t+11]]+Dn[e[t+12]]+Dn[e[t+13]]+Dn[e[t+14]]+Dn[e[t+15]]).toLowerCase();if(!Pn(n))throw TypeError("Stringified UUID is invalid");return n}(i)};function Jn(e,t){const n=Ln(e,t),i=Un();return localStorage.setItem(n,i),kn(e,t),i}function kn(e,t){const n=Bn(e,t),i=(new Date).toISOString();return localStorage.setItem(n,i),i}function Ln(e,t){return`com.meetelise.chatID-${e}-${t}`}function Bn(e,t){return`com.meetelise.chatIDIssueTime-${e}-${t}`}const jn="#FFFFFF",Hn="#202020",Wn={user:{textColor:jn,backgroundColor:"#1990FF"},agent:{textColor:jn,backgroundColor:"#1E1E1E"}},Gn={user:{textColor:jn,backgroundColor:"#83818E"},agent:{textColor:jn,backgroundColor:Hn}},$n={Light:{chatHeader:{backgroundColor:jn,textColor:Hn},chatPaneBackgroundColor:"rgba(255, 255, 255, 0.9)",message:Wn},Dark:{chatHeader:{backgroundColor:Hn,textColor:jn},chatPaneBackgroundColor:"rgba(32, 32, 32, 0.9)",message:Wn},Purple:{chatHeader:{backgroundColor:"#550098",textColor:jn},chatPaneBackgroundColor:"rgba(85, 0, 152, 0.6)",message:Wn},Blue:{chatHeader:{backgroundColor:"#0814E5",textColor:jn},chatPaneBackgroundColor:"rgba(4, 17, 245, 0.6)",message:Wn},Teal:{chatHeader:{backgroundColor:"#6EE7ED",textColor:Hn},chatPaneBackgroundColor:"rgba(115, 247, 253, 0.8)",message:Gn},Green:{chatHeader:{backgroundColor:"#147B0E",textColor:jn},chatPaneBackgroundColor:"rgba(13, 141, 5, 0.6)",message:Wn},Yellow:{chatHeader:{backgroundColor:"#F1E54F",textColor:Hn},chatPaneBackgroundColor:"rgba(251, 239, 80, 0.9)",message:Gn},Orange:{chatHeader:{backgroundColor:"#C06C31",textColor:jn},chatPaneBackgroundColor:"rgba(238, 126, 49, 0.7)",message:Wn},Pink:{chatHeader:{backgroundColor:"#A24599",textColor:jn},chatPaneBackgroundColor:"rgba(167, 70, 157, 0.8)",message:Wn}},zn=e=>$n[e&&Object.keys($n).includes(e)?e:"Light"];function Vn(e,t,n,i,r,o){var a;const s=new Oe.User({id:`building_${t.id}`,name:t.userFirstName,email:null,role:"Default",welcomeMessage:t.welcomeMessage}),u=e.getOrCreateConversation(r);return u.setParticipant(e.me),u.setParticipant(s),u.subject=16===t.orgId?"Leasing team":null!==(a=t.chatTitle)&&void 0!==a?a:t.userFirstName,u.custom={buildingId:t.id.toString(),userId:t.userId.toString(),orgId:t.orgId.toString(),subtitle:t.chatSubtitle,url:location.href,buildingName:t.name,isMobile:o.toString(),chatHeaderBackgroundColor:n.chatHeader.backgroundColor,chatHeaderTextColor:n.chatHeader.textColor,chatPaneBackgroundColor:n.chatPaneBackgroundColor,userMessageTextColor:n.message.user.textColor,userMessageBackgroundColor:n.message.user.backgroundColor,agentMessageTextColor:n.message.agent.textColor,agentMessageBackgroundColor:n.message.agent.backgroundColor,isLightTheme:(n.message===Gn).toString(),avatarUrl:"image"===t.avatarType&&t.avatarSrc?i:"https://eliseusercontent.meetelise.com/webchat/looping-gradient.gif"},u}const Xn=a`
1050
+ `,On([oe({attribute:!1})],In.prototype,"layoutOptions",void 0),On([oe({attribute:!1})],In.prototype,"tourTypeOptions",void 0),On([oe({type:Number})],In.prototype,"buildingId",void 0),On([oe({attribute:!1})],In.prototype,"onCloseClicked",void 0),On([ae()],In.prototype,"tourType",void 0),On([ae()],In.prototype,"shouldShowTourType",void 0),On([ae()],In.prototype,"email",void 0),On([ae()],In.prototype,"phoneNumber",void 0),On([ae()],In.prototype,"availabilitiesGroupedByDay",void 0),On([ae()],In.prototype,"waitingForAvailabilities",void 0),On([ae()],In.prototype,"selectedDate",void 0),On([ae()],In.prototype,"selectedTime",void 0),On([ae()],In.prototype,"mobilePageIndex",void 0),On([ae()],In.prototype,"isSubmitting",void 0),On([ae()],In.prototype,"tourIsBooked",void 0),On([se(".inputContainer#firstName input")],In.prototype,"firstNameInput",void 0),On([se(".inputContainer#lastName input")],In.prototype,"lastNameInput",void 0),On([se(".inputContainer#email input")],In.prototype,"emailInput",void 0),On([se(".inputContainer#phone input")],In.prototype,"phoneInput",void 0),On([se("me-select#unitType")],In.prototype,"unitTypeSelect",void 0),In=On([ie("tour-scheduler")],In),function(e){e[e.Guided=0]="Guided",e[e.Self=1]="Self",e[e.Virtual=2]="Virtual"}(Rn||(Rn={}));const Nn={[Rn.Guided]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[Rn.Self]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[Rn.Virtual]:Qt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},An={[Rn.Guided]:"escorted-tour",[Rn.Self]:"self-guided-tour",[Rn.Virtual]:"live-virtual-tour"};class Cn{constructor(e,t,n){this.org=e,this.building=t,this.chatId=n,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}campaignSources(){var e,t,n;const i=new URL(window.location.href).searchParams,r=null!==(n=null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&void 0!==n?n:null;return{entrataCampaignSource:i.get("switch_cls[id]"),realpageCampaignSource:i.get("ilm"),utmCampaignSource:i.get("utm_source"),yardiCampaignSource:r}}ping(e){fetch("https://app.meetelise.com/platformApi/connectors/talk_js/analytics",{method:"POST",credentials:"omit",keepalive:!0,headers:{"content-type":"application/json; charset=UTF-8"},body:JSON.stringify({eventType:e,chatId:this.chatId,url:location.href,org:this.org,building:this.building,referrer:document.referrer,featureFlags:this.featureFlags,campaignSources:this.campaignSources()})})}}var En,_n=new Uint8Array(16);function Fn(){if(!En&&!(En="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 En(_n)}const Mn=/^(?:[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,Pn=function(e){return"string"==typeof e&&Mn.test(e)};for(var Dn=[],qn=0;qn<256;++qn)Dn.push((qn+256).toString(16).substr(1));const Un=function(e,t,n){var i=(e=e||{}).random||(e.rng||Fn)();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=(Dn[e[t+0]]+Dn[e[t+1]]+Dn[e[t+2]]+Dn[e[t+3]]+"-"+Dn[e[t+4]]+Dn[e[t+5]]+"-"+Dn[e[t+6]]+Dn[e[t+7]]+"-"+Dn[e[t+8]]+Dn[e[t+9]]+"-"+Dn[e[t+10]]+Dn[e[t+11]]+Dn[e[t+12]]+Dn[e[t+13]]+Dn[e[t+14]]+Dn[e[t+15]]).toLowerCase();if(!Pn(n))throw TypeError("Stringified UUID is invalid");return n}(i)};function Jn(e,t){const n=Ln(e,t),i=Un();return localStorage.setItem(n,i),kn(e,t),i}function kn(e,t){const n=Bn(e,t),i=(new Date).toISOString();return localStorage.setItem(n,i),i}function Ln(e,t){return`com.meetelise.chatID-${e}-${t}`}function Bn(e,t){return`com.meetelise.chatIDIssueTime-${e}-${t}`}const jn="#FFFFFF",Hn="#202020",Wn={user:{textColor:jn,backgroundColor:"#1990FF"},agent:{textColor:jn,backgroundColor:"#1E1E1E"}},Gn={user:{textColor:jn,backgroundColor:"#83818E"},agent:{textColor:jn,backgroundColor:Hn}},$n={Light:{chatHeader:{backgroundColor:jn,textColor:Hn},chatPaneBackgroundColor:"rgba(255, 255, 255, 0.9)",message:Wn},Dark:{chatHeader:{backgroundColor:Hn,textColor:jn},chatPaneBackgroundColor:"rgba(32, 32, 32, 0.9)",message:Wn},Purple:{chatHeader:{backgroundColor:"#550098",textColor:jn},chatPaneBackgroundColor:"rgba(85, 0, 152, 0.6)",message:Wn},Blue:{chatHeader:{backgroundColor:"#0814E5",textColor:jn},chatPaneBackgroundColor:"rgba(4, 17, 245, 0.6)",message:Wn},Teal:{chatHeader:{backgroundColor:"#6EE7ED",textColor:Hn},chatPaneBackgroundColor:"rgba(115, 247, 253, 0.8)",message:Gn},Green:{chatHeader:{backgroundColor:"#147B0E",textColor:jn},chatPaneBackgroundColor:"rgba(13, 141, 5, 0.6)",message:Wn},Yellow:{chatHeader:{backgroundColor:"#F1E54F",textColor:Hn},chatPaneBackgroundColor:"rgba(251, 239, 80, 0.9)",message:Gn},Orange:{chatHeader:{backgroundColor:"#C06C31",textColor:jn},chatPaneBackgroundColor:"rgba(238, 126, 49, 0.7)",message:Wn},Pink:{chatHeader:{backgroundColor:"#A24599",textColor:jn},chatPaneBackgroundColor:"rgba(167, 70, 157, 0.8)",message:Wn}},zn=e=>$n[e&&Object.keys($n).includes(e)?e:"Light"];function Vn(e,t,n,i,r,o){var a;const s=new Oe.User({id:`building_${t.id}`,name:t.userFirstName,email:null,role:"Default",welcomeMessage:t.welcomeMessage,availabilityText:t.systemWelcomeMessage}),u=e.getOrCreateConversation(r);return u.setParticipant(e.me),u.setParticipant(s),u.subject=16===t.orgId?"Leasing team":null!==(a=t.chatTitle)&&void 0!==a?a:t.userFirstName,u.custom={buildingId:t.id.toString(),userId:t.userId.toString(),orgId:t.orgId.toString(),subtitle:t.chatSubtitle,url:location.href,buildingName:t.name,isMobile:o.toString(),chatHeaderBackgroundColor:n.chatHeader.backgroundColor,chatHeaderTextColor:n.chatHeader.textColor,chatPaneBackgroundColor:n.chatPaneBackgroundColor,userMessageTextColor:n.message.user.textColor,userMessageBackgroundColor:n.message.user.backgroundColor,agentMessageTextColor:n.message.agent.textColor,agentMessageBackgroundColor:n.message.agent.backgroundColor,isLightTheme:(n.message===Gn).toString(),avatarUrl:"image"===t.avatarType&&t.avatarSrc?i:"https://eliseusercontent.meetelise.com/webchat/looping-gradient.gif"},u}const Xn=a`
1051
1051
  :host {
1052
1052
  --glowBarHeight: 11.2px;
1053
1053
  --enterAnimationDuration: 0.5s;
@@ -19,6 +19,7 @@ const stubResponse = {
19
19
  chatSubtitle: "Leasing Agent ExtraordinAIre",
20
20
  welcomeMessage:
21
21
  "Welcome, I'm Elise! If you have any questions about Unit Test Building or would like to schedule a tour, I'm happy to help.",
22
+ systemWelcomeMessage: "I am an AI and may record this conversation!",
22
23
  conversationMaintenanceMode: false,
23
24
  }),
24
25
  };
@@ -20,6 +20,7 @@ export default function createConversation(
20
20
  email: null,
21
21
  role: "Default",
22
22
  welcomeMessage: building.welcomeMessage,
23
+ availabilityText: building.systemWelcomeMessage,
23
24
  });
24
25
  const conversation = session.getOrCreateConversation(chatID);
25
26
  conversation.setParticipant(session.me);
@@ -17,6 +17,7 @@ export interface Building {
17
17
  userFirstName: string;
18
18
  userId: number;
19
19
  welcomeMessage: string | null;
20
+ systemWelcomeMessage: string | null;
20
21
  conversationMaintenanceMode: boolean;
21
22
  orgId: number;
22
23
  phoneNumber: string;