@meetelise/chat 1.20.61 → 1.20.63

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.20.61",
3
+ "version": "1.20.63",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -468,7 +468,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
468
468
  .option.active {
469
469
  background-color: var(--active-option-color);
470
470
  }
471
- `,Yt],Kt([ue({attribute:!1})],Zt.prototype,"options",void 0),Kt([ue({type:String})],Zt.prototype,"placeholder",void 0),Kt([ue({type:String})],Zt.prototype,"value",void 0),Kt([le()],Zt.prototype,"activeOption",void 0),Kt([le()],Zt.prototype,"isOpen",void 0),Kt([de("#select",!0)],Zt.prototype,"meSelect",void 0),Zt=Kt([ae("me-select")],Zt);var en=n(9991),tn=n(7739),nn=n.n(tn);function rn(e){return De(1,arguments),qe(e).getTime()<Date.now()}Math.pow(10,8);var on=36e5;function an(e,t){De(1,arguments);var n=t||{},i=null==n.additionalDigits?2:Ze(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=cn(e);if(o.date){var a=pn(o.date,i);r=fn(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,u=r.getTime(),l=0;if(o.time&&(l=mn(o.time),isNaN(l)))return new Date(NaN);if(!o.timezone){var d=new Date(u+l),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=gn(o.timezone),isNaN(s)?new Date(NaN):new Date(u+l+s)}var sn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},un=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ln=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dn=/^([+-])(\d{2})(?::?(\d{2}))?$/;function cn(e){var t,n={},i=e.split(sn.dateTimeDelimiter);if(i.length>2)return n;if(/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],sn.timeZoneDelimiter.test(n.date)&&(n.date=e.split(sn.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var r=sn.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}function pn(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((i[1]||i[2]).length)}}function fn(e,t){if(null===t)return new Date(NaN);var n=e.match(un);if(!n)return new Date(NaN);var i=!!n[4],r=hn(n[1]),o=hn(n[2])-1,a=hn(n[3]),s=hn(n[4]),u=hn(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,u)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*(t-1)+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}(t,s,u):new Date(NaN);var l=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(yn[t]||(wn(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(wn(e)?366:365)}(t,r)?(l.setUTCFullYear(t,o,Math.max(r,a)),l):new Date(NaN)}function hn(e){return e?parseInt(e):1}function mn(e){var t=e.match(ln);if(!t)return NaN;var n=vn(t[1]),i=vn(t[2]),r=vn(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r)?n*on+6e4*i+1e3*r:NaN}function vn(e){return e&&parseFloat(e.replace(",","."))||0}function gn(e){if("Z"===e)return 0;var t=e.match(dn);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?n*(i*on+6e4*r):NaN}var yn=[31,null,31,30,31,30,31,31,30,31,30,31];function wn(e){return e%400==0||e%4==0&&e%100!=0}const bn={buildingId:null,availabilities:{}},Sn=async e=>{e&&(bn.buildingId=e);const n=bn.buildingId;if(!n)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const i=bn.availabilities;if(i[n])return i[n];const r=function(e){De(1,arguments);var t=qe(e);return t.setHours(0,0,0,0),t}(Date.now()),o=$t(function(e){De(1,arguments);var t=qe(e);return t.setHours(23,59,59,999),t}(function(e,t){De(2,arguments);var n=qe(e),i=Ze(t);return isNaN(i)?new Date(NaN):i?(n.setDate(n.getDate()+i),n):n}(r,30))),a=`https://app.meetelise.com/api/pub/v1/buildings/${n}/tour/availabilities?startTime=${$t(r)}&endTime=${o}`,s=await t().get(a);return bn.availabilities[n]=s.data,s.data},Tn=async(e,t)=>{var n,i;const r=await Sn(t),o=(null===(n=r.availability)||void 0===n?void 0:n[e])?null===(i=r.availability)||void 0===i?void 0:i[e].availableTourStartTimes:[];return r.availability?{...r.availability[e],availableTourStartTimes:o}:null},An=async(e,t)=>{var n,i;const r=await Tn(e,t);if(!r)return{};const o={availableTourStartTimes:null===(n=r.availableTourStartTimes?r.availableTourStartTimes.filter((e=>Je(an(e))&&!rn(an(e)))):[])||void 0===n?void 0:n.map((e=>xn(e)))};return nn()(null!==(i=o.availableTourStartTimes)&&void 0!==i?i:[],(e=>Bt(new Date(e.datetime),"yyyy-MM-dd")))},xn=e=>({datetime:e.slice(0,19),offset:e.slice(19)});n(7294);const Cn=()=>window.matchMedia("(max-width: 767px)").matches;var On=n(6486),In=n(4184),Nn=n.n(In);async function Rn({chatId:e,website:n,referrer:i,buildingSlug:r,selectedLeadSource:o}){try{return(await t().post("https://app.meetelise.com/platformApi/webchat/lead-sourced",{chat_id:e,website:n,referrer:i,query_params:En(),building_slug:r,timestamp:new Date,selected_lead_source:o})).data}catch(e){return null}}function En(){return Object.fromEntries(new URLSearchParams(window.location.search))}const Fn=e=>`https://app.meetelise.com/platformApi/webchat/${e}/chat-ui-feature-flag`;var _n;async function Mn(e){try{const n=await t().get(Fn(e),{params:{building_slug:e,flag_type:"string",feature_flag:"webchat-marketing-source-dropdown-configuration",default_str:"always",default_bool:!0}});return"on-attribution-failure"===n.data?_n.onAttributionFailure:"never"===n.data?_n.never:_n.always}catch(e){return _n.always}}async function Pn(e){try{return(await t().get(Fn(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-dni-phone-number-by-source",default_str:null,default_bool:!1}})).data}catch(e){return!1}}!function(e){e.onAttributionFailure="on-attribution-failure",e.never="never",e.always="always"}(_n||(_n={}));var Dn=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 qn=class extends re{constructor(){super(...arguments),this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.sgtUrl="",this.escortedToursLink="",this.virtualToursLink="",this.orgSlug="",this.tourType=null,this.shouldShowTourType={[Un.Guided]:!0,[Un.Self]:!0,[Un.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.leadSources=[],this.currentLeadSource="",this.featureFlagShowDropdown="",this.firstUpdated=async()=>{const e=await(async()=>{var e,t,n,i,r,o;return{[Un.Guided]:!!(null===(t=null===(e=await Tn(en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[Un.Self]:!!(null===(i=null===(n=await Tn(en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[Un.Virtual]:!!(null===(o=null===(r=await Tn(en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}})();this.shouldShowTourType={[Un.Guided]:this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")&&e[Un.Guided],[Un.Self]:this.tourTypeOptions.map((e=>e.value)).includes("SELF_GUIDED")&&e[Un.Self],[Un.Virtual]:this.tourTypeOptions.map((e=>e.value)).includes("VIRTUAL_SHOWING")&&e[Un.Virtual]},null!==this.tourType?(this.availabilitiesGroupedByDay=await An(Bn[this.tourType]),this.waitingForAvailabilities=!1):this.waitingForAvailabilities=!1},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await An(Bn[this.tourType]))},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const n=e.target.selectionStart;if(1!==e.key.length||Fe(e)){if("Backspace"===e.key){if(Fe(e))return;if(this.phoneInput.selectionEnd&&this.phoneInput.selectionStart&&this.phoneInput.selectionEnd-this.phoneInput.selectionStart>0)return;const t=this.phoneNumber.length,i=this.phoneNumber.slice(0,n).replace(/\D/g,""),r=this.phoneNumber.slice(n).replace(/\D/g,""),o=`${i.slice(0,-1)}${r}`;this.phoneNumber=Ne(o),this.phoneInput.value=this.phoneNumber;const a=n-(t-this.phoneNumber.length);return this.phoneInput.setSelectionRange(a,a),e.preventDefault(),void e.stopPropagation()}if(!["ArrowLeft","ArrowRight"].includes(e.key)||Fe(e)||e.shiftKey)return;if("ArrowLeft"===e.key){const e=((null===(t=this.phoneNumber.slice(0,n).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,i=n-e>-1?n-e:0;this.phoneInput.setSelectionRange(i,i)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(n).split(/\d+/)[0].length||0)+1,t=n+e<this.phoneNumber.length?n+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,n)+e.key+this.phoneNumber.slice(n);this.phoneNumber=Ne(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(!e.key)return;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const n=this.phoneInput.selectionStart,i=n?this.phoneInput.value.slice(n).replace(/\D/g,""):"";this.phoneNumber=Ne(this.phoneInput.value);let r=0,o=i.length;for(;o;)(null===(t=this.phoneNumber.at(r))||void 0===t?void 0:t.match(/\d/))&&o--,r++;const a=this.phoneInput.value.length-r+1;this.phoneInput.setSelectionRange(a,a)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&(null===(n=this.emailInput)||void 0===n?void 0:n.value.includes("@"))&&!!this.phoneNumber&&14===this.phoneNumber.length}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo(),this.timeStringToHoursAndMinutes=e=>{const[t,n]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(n)]},this.submit=async()=>{var e;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const n=new URLSearchParams(window.location.search),i=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource,r={referrer:document.referrer,email_address:this.email,phone_number:`+1${null===(e=this.phoneNumber.match(/\d/g))||void 0===e?void 0:e.join("")}`,building_id:this.buildingId,first_name:this.firstNameInput.value,last_name:this.lastNameInput.value,tour_type:Jn[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,layouts:this.layoutTypeSelect.value?[this.layoutTypeSelect.value]:null,unit_numbers:this.unitTypeSelect&&this.unitTypeSelect.value?[this.unitTypeSelect.value]:null,lead_sources:i?[i,"property-website"]:["property-website"],query_params:Object.fromEntries(n.entries())};this.isSubmitting=!0;try{await t().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",r,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG","org-slug":this.orgSlug}}),await Rn({chatId:this.chatId,website:window.location.origin,referrer:document.referrer,buildingSlug:this.buildingSlug,selectedLeadSource:null!=i?i:""}),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e.response.data.detail||"Failed to book tour";alert(t),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>U`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>U`${this.dateAndTimeMenu(!0)}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>U`<action-confirm-button
471
+ `,Yt],Kt([ue({attribute:!1})],Zt.prototype,"options",void 0),Kt([ue({type:String})],Zt.prototype,"placeholder",void 0),Kt([ue({type:String})],Zt.prototype,"value",void 0),Kt([le()],Zt.prototype,"activeOption",void 0),Kt([le()],Zt.prototype,"isOpen",void 0),Kt([de("#select",!0)],Zt.prototype,"meSelect",void 0),Zt=Kt([ae("me-select")],Zt);var en=n(9991),tn=n(7739),nn=n.n(tn);function rn(e){return De(1,arguments),qe(e).getTime()<Date.now()}Math.pow(10,8);var on=36e5;function an(e,t){De(1,arguments);var n=t||{},i=null==n.additionalDigits?2:Ze(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=cn(e);if(o.date){var a=pn(o.date,i);r=fn(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,u=r.getTime(),l=0;if(o.time&&(l=mn(o.time),isNaN(l)))return new Date(NaN);if(!o.timezone){var d=new Date(u+l),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=gn(o.timezone),isNaN(s)?new Date(NaN):new Date(u+l+s)}var sn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},un=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ln=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dn=/^([+-])(\d{2})(?::?(\d{2}))?$/;function cn(e){var t,n={},i=e.split(sn.dateTimeDelimiter);if(i.length>2)return n;if(/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],sn.timeZoneDelimiter.test(n.date)&&(n.date=e.split(sn.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var r=sn.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}function pn(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((i[1]||i[2]).length)}}function fn(e,t){if(null===t)return new Date(NaN);var n=e.match(un);if(!n)return new Date(NaN);var i=!!n[4],r=hn(n[1]),o=hn(n[2])-1,a=hn(n[3]),s=hn(n[4]),u=hn(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,u)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*(t-1)+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}(t,s,u):new Date(NaN);var l=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(yn[t]||(wn(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(wn(e)?366:365)}(t,r)?(l.setUTCFullYear(t,o,Math.max(r,a)),l):new Date(NaN)}function hn(e){return e?parseInt(e):1}function mn(e){var t=e.match(ln);if(!t)return NaN;var n=vn(t[1]),i=vn(t[2]),r=vn(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r)?n*on+6e4*i+1e3*r:NaN}function vn(e){return e&&parseFloat(e.replace(",","."))||0}function gn(e){if("Z"===e)return 0;var t=e.match(dn);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?n*(i*on+6e4*r):NaN}var yn=[31,null,31,30,31,30,31,31,30,31,30,31];function wn(e){return e%400==0||e%4==0&&e%100!=0}const bn={buildingId:null,availabilities:{}},Sn=async e=>{e&&(bn.buildingId=e);const n=bn.buildingId;if(!n)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const i=bn.availabilities;if(i[n])return i[n];const r=function(e){De(1,arguments);var t=qe(e);return t.setHours(0,0,0,0),t}(Date.now()),o=$t(function(e){De(1,arguments);var t=qe(e);return t.setHours(23,59,59,999),t}(function(e,t){De(2,arguments);var n=qe(e),i=Ze(t);return isNaN(i)?new Date(NaN):i?(n.setDate(n.getDate()+i),n):n}(r,30))),a=`https://app.meetelise.com/api/pub/v1/buildings/${n}/tour/availabilities?startTime=${$t(r)}&endTime=${o}`,s=await t().get(a);return bn.availabilities[n]=s.data,s.data},Tn=async(e,t)=>{var n,i;const r=await Sn(t),o=(null===(n=r.availability)||void 0===n?void 0:n[e])?null===(i=r.availability)||void 0===i?void 0:i[e].availableTourStartTimes:[];return r.availability?{...r.availability[e],availableTourStartTimes:o}:null},An=async(e,t)=>{var n,i;const r=await Tn(e,t);if(!r)return{};const o={availableTourStartTimes:null===(n=r.availableTourStartTimes?r.availableTourStartTimes.filter((e=>Je(an(e))&&!rn(an(e)))):[])||void 0===n?void 0:n.map((e=>xn(e)))};return nn()(null!==(i=o.availableTourStartTimes)&&void 0!==i?i:[],(e=>Bt(new Date(e.datetime),"yyyy-MM-dd")))},xn=e=>({datetime:e.slice(0,19),offset:e.slice(19)});n(7294);const Cn=()=>window.matchMedia("(max-width: 767px)").matches;var On=n(6486),In=n(4184),Nn=n.n(In);async function Rn({chatId:e,website:n,referrer:i,buildingSlug:r,selectedLeadSource:o}){try{return(await t().post("https://app.meetelise.com/platformApi/webchat/lead-sourced",{chat_id:e,website:n,referrer:i,query_params:En(),building_slug:r,timestamp:new Date,selected_lead_source:o})).data}catch(e){return null}}function En(){return Object.fromEntries(new URLSearchParams(window.location.search))}const Fn=e=>`https://app.meetelise.com/platformApi/webchat/${e}/chat-ui-feature-flag`;var _n;async function Mn(e){try{const n=await t().get(Fn(e),{params:{building_slug:e,flag_type:"string",feature_flag:"webchat-marketing-source-dropdown-configuration",default_str:"always",default_bool:!0}});return"on-attribution-failure"===n.data?_n.onAttributionFailure:"never"===n.data?_n.never:_n.always}catch(e){return _n.always}}async function Pn(e){try{return(await t().get(Fn(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-dni-phone-number-by-source",default_str:null,default_bool:!1}})).data}catch(e){return!1}}!function(e){e.onAttributionFailure="on-attribution-failure",e.never="never",e.always="always"}(_n||(_n={}));var Dn=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 qn=class extends re{constructor(){super(...arguments),this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.sgtUrl="",this.escortedToursLink="",this.virtualToursLink="",this.orgSlug="",this.tourType=null,this.shouldShowTourType={[Un.Guided]:!0,[Un.Self]:!0,[Un.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.leadSources=[],this.currentLeadSource="",this.featureFlagShowDropdown="",this.firstUpdated=async()=>{const e=await(async()=>{var e,t,n,i,r,o;return{[Un.Guided]:!!(null===(t=null===(e=await Tn(en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[Un.Self]:!!(null===(i=null===(n=await Tn(en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[Un.Virtual]:!!(null===(o=null===(r=await Tn(en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}})();this.shouldShowTourType={[Un.Guided]:this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")&&e[Un.Guided],[Un.Self]:this.tourTypeOptions.map((e=>e.value)).includes("SELF_GUIDED")&&e[Un.Self],[Un.Virtual]:this.tourTypeOptions.map((e=>e.value)).includes("VIRTUAL_SHOWING")&&e[Un.Virtual]},1===Object.values(this.shouldShowTourType).reduce(((e,t)=>!0===t?e+1:e),0)&&(this.tourType=Object.keys(this.shouldShowTourType).find((e=>this.shouldShowTourType[e]))),null!==this.tourType?(this.availabilitiesGroupedByDay=await An(Bn[this.tourType]),this.waitingForAvailabilities=!1):this.waitingForAvailabilities=!1},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await An(Bn[this.tourType]))},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const n=e.target.selectionStart;if(1!==e.key.length||Fe(e)){if("Backspace"===e.key){if(Fe(e))return;if(this.phoneInput.selectionEnd&&this.phoneInput.selectionStart&&this.phoneInput.selectionEnd-this.phoneInput.selectionStart>0)return;const t=this.phoneNumber.length,i=this.phoneNumber.slice(0,n).replace(/\D/g,""),r=this.phoneNumber.slice(n).replace(/\D/g,""),o=`${i.slice(0,-1)}${r}`;this.phoneNumber=Ne(o),this.phoneInput.value=this.phoneNumber;const a=n-(t-this.phoneNumber.length);return this.phoneInput.setSelectionRange(a,a),e.preventDefault(),void e.stopPropagation()}if(!["ArrowLeft","ArrowRight"].includes(e.key)||Fe(e)||e.shiftKey)return;if("ArrowLeft"===e.key){const e=((null===(t=this.phoneNumber.slice(0,n).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,i=n-e>-1?n-e:0;this.phoneInput.setSelectionRange(i,i)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(n).split(/\d+/)[0].length||0)+1,t=n+e<this.phoneNumber.length?n+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,n)+e.key+this.phoneNumber.slice(n);this.phoneNumber=Ne(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(!e.key)return;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const n=this.phoneInput.selectionStart,i=n?this.phoneInput.value.slice(n).replace(/\D/g,""):"";this.phoneNumber=Ne(this.phoneInput.value);let r=0,o=i.length;for(;o;)(null===(t=this.phoneNumber.at(r))||void 0===t?void 0:t.match(/\d/))&&o--,r++;const a=this.phoneInput.value.length-r+1;this.phoneInput.setSelectionRange(a,a)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&(null===(n=this.emailInput)||void 0===n?void 0:n.value.includes("@"))&&!!this.phoneNumber&&14===this.phoneNumber.length}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo(),this.timeStringToHoursAndMinutes=e=>{const[t,n]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(n)]},this.submit=async()=>{var e;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const n=new URLSearchParams(window.location.search),i=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource,r={referrer:document.referrer,email_address:this.email,phone_number:`+1${null===(e=this.phoneNumber.match(/\d/g))||void 0===e?void 0:e.join("")}`,building_id:this.buildingId,first_name:this.firstNameInput.value,last_name:this.lastNameInput.value,tour_type:Jn[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,layouts:this.layoutTypeSelect.value?[this.layoutTypeSelect.value]:null,unit_numbers:this.unitTypeSelect&&this.unitTypeSelect.value?[this.unitTypeSelect.value]:null,lead_sources:i?[i,"property-website"]:["property-website"],query_params:Object.fromEntries(n.entries())};this.isSubmitting=!0;try{await t().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",r,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG","org-slug":this.orgSlug}}),await Rn({chatId:this.chatId,website:window.location.origin,referrer:document.referrer,buildingSlug:this.buildingSlug,selectedLeadSource:null!=i?i:""}),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e.response.data.detail||"Failed to book tour";alert(t),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>U`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>U`${this.dateAndTimeMenu(!0)}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>U`<action-confirm-button
472
472
  id="schedule"
473
473
  .onClick=${this.submit}
474
474
  .isLoading=${this.isSubmitting}
@@ -1142,7 +1142,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
1142
1142
  margin-top: 37px;
1143
1143
  }
1144
1144
  }
1145
- `,Yt],Dn([ue({attribute:!1})],qn.prototype,"layoutOptions",void 0),Dn([ue({attribute:!1})],qn.prototype,"unitOptions",void 0),Dn([ue({attribute:!1})],qn.prototype,"tourTypeOptions",void 0),Dn([ue({attribute:!0})],qn.prototype,"chatId",void 0),Dn([ue({type:Number})],qn.prototype,"buildingId",void 0),Dn([ue({attribute:!0})],qn.prototype,"buildingSlug",void 0),Dn([ue({attribute:!0})],qn.prototype,"sgtUrl",void 0),Dn([ue({attribute:!0})],qn.prototype,"escortedToursLink",void 0),Dn([ue({attribute:!0})],qn.prototype,"virtualToursLink",void 0),Dn([ue({attribute:!0})],qn.prototype,"orgSlug",void 0),Dn([le()],qn.prototype,"tourType",void 0),Dn([le()],qn.prototype,"shouldShowTourType",void 0),Dn([le()],qn.prototype,"email",void 0),Dn([le()],qn.prototype,"phoneNumber",void 0),Dn([le()],qn.prototype,"availabilitiesGroupedByDay",void 0),Dn([le()],qn.prototype,"waitingForAvailabilities",void 0),Dn([le()],qn.prototype,"selectedDate",void 0),Dn([le()],qn.prototype,"selectedTime",void 0),Dn([le()],qn.prototype,"mobilePageIndex",void 0),Dn([le()],qn.prototype,"isSubmitting",void 0),Dn([le()],qn.prototype,"tourIsBooked",void 0),Dn([ue({attribute:!1})],qn.prototype,"leadSources",void 0),Dn([ue({attribute:!0})],qn.prototype,"currentLeadSource",void 0),Dn([ue({attribute:!0})],qn.prototype,"featureFlagShowDropdown",void 0),Dn([de(".nameContainer#firstName input")],qn.prototype,"firstNameInput",void 0),Dn([de(".nameContainer#lastName input")],qn.prototype,"lastNameInput",void 0),Dn([de(".inputContainer#email input")],qn.prototype,"emailInput",void 0),Dn([de(".inputContainer#phone input")],qn.prototype,"phoneInput",void 0),Dn([de("me-select#unitType")],qn.prototype,"unitTypeSelect",void 0),Dn([de("me-select#layoutType")],qn.prototype,"layoutTypeSelect",void 0),Dn([de("me-select#leadSource")],qn.prototype,"selectedLeadSource",void 0),qn=Dn([ae("tour-scheduler")],qn),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(Un||(Un={}));const Bn={[Un.Guided]:en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[Un.Self]:en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[Un.Virtual]:en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},Jn={[Un.Guided]:"escorted-tour",[Un.Self]:"self-guided-tour",[Un.Virtual]:"live-virtual-tour"},kn=e=>e.map((e=>(e=>({studio:0,"1br":1,"2br":2,"3br":3,"4br":4,"5br":5,"6br":6,"7br":7,"8br":8,"9br":9,"10br":10}[e]))(e))).filter(On.isNumber).sort().map((e=>(e=>({0:"studio",1:"1br",2:"2br",3:"3br",4:"4br",5:"5br",6:"6br",7:"7br",8:"8br",9:"9br",10:"10br"}[e]))(e))).filter(On.isString);class Ln{constructor(e,t,n){this.org=e,this.building=t,this.chatId=n,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}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:jn()})})}}const jn=()=>{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}};var Hn,Gn=new Uint8Array(16);function Wn(){if(!Hn&&!(Hn="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 Hn(Gn)}const Qn=/^(?:[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,zn=function(e){return"string"==typeof e&&Qn.test(e)};for(var Vn=[],Xn=0;Xn<256;++Xn)Vn.push((Xn+256).toString(16).substr(1));const Yn=function(e,t,n){var i=(e=e||{}).random||(e.rng||Wn)();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=(Vn[e[t+0]]+Vn[e[t+1]]+Vn[e[t+2]]+Vn[e[t+3]]+"-"+Vn[e[t+4]]+Vn[e[t+5]]+"-"+Vn[e[t+6]]+Vn[e[t+7]]+"-"+Vn[e[t+8]]+Vn[e[t+9]]+"-"+Vn[e[t+10]]+Vn[e[t+11]]+Vn[e[t+12]]+Vn[e[t+13]]+Vn[e[t+14]]+Vn[e[t+15]]).toLowerCase();if(!zn(n))throw TypeError("Stringified UUID is invalid");return n}(i)};function Kn(e,t){const n=$n(e,t),i=Yn();return localStorage.setItem(n,i),Zn(e,t),i}function Zn(e,t){const n=ei(e,t),i=(new Date).toISOString();return localStorage.setItem(n,i),i}function $n(e,t){return`com.meetelise.chatID-${e}-${t}`}function ei(e,t){return`com.meetelise.chatIDIssueTime-${e}-${t}`}const ti="#FFFFFF",ni="#202020",ii={user:{textColor:ti,backgroundColor:"#1990FF"},agent:{textColor:ti,backgroundColor:"#1E1E1E"}},ri={user:{textColor:ti,backgroundColor:"#83818E"},agent:{textColor:ti,backgroundColor:ni}},oi={Light:{chatHeader:{backgroundColor:ti,textColor:ni},chatPaneBackgroundColor:"rgba(255, 255, 255, 0.9)",message:ii},Dark:{chatHeader:{backgroundColor:ni,textColor:ti},chatPaneBackgroundColor:"rgba(32, 32, 32, 0.9)",message:ii},Purple:{chatHeader:{backgroundColor:"#550098",textColor:ti},chatPaneBackgroundColor:"rgba(85, 0, 152, 0.6)",message:ii},Blue:{chatHeader:{backgroundColor:"#0814E5",textColor:ti},chatPaneBackgroundColor:"rgba(4, 17, 245, 0.6)",message:ii},Teal:{chatHeader:{backgroundColor:"#6EE7ED",textColor:ni},chatPaneBackgroundColor:"rgba(115, 247, 253, 0.8)",message:ri},Green:{chatHeader:{backgroundColor:"#147B0E",textColor:ti},chatPaneBackgroundColor:"rgba(13, 141, 5, 0.6)",message:ii},Yellow:{chatHeader:{backgroundColor:"#F1E54F",textColor:ni},chatPaneBackgroundColor:"rgba(251, 239, 80, 0.9)",message:ri},Orange:{chatHeader:{backgroundColor:"#C06C31",textColor:ti},chatPaneBackgroundColor:"rgba(238, 126, 49, 0.7)",message:ii},Pink:{chatHeader:{backgroundColor:"#A24599",textColor:ti},chatPaneBackgroundColor:"rgba(167, 70, 157, 0.8)",message:ii},Glass:{chatHeader:{backgroundColor:ti,textColor:ni},chatPaneBackgroundColor:"rgba(0, 0, 0, 0.5)",message:{user:{textColor:"#FFFFFF",backgroundColor:"#000000"},agent:{textColor:"#000000",backgroundColor:"#FFFFFF"}}}},ai=e=>oi[e&&Object.keys(oi).includes(e)?e:"Light"];function si(e,t,n,i,r,o){var a;const s=new Ie.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===ri).toString(),avatarUrl:"image"===t.avatarType&&t.avatarSrc?i:"https://eliseusercontent.meetelise.com/webchat/looping-gradient.gif"},u}async function ui(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}var li;async function di(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/ab-test-type`)).data}catch(e){return null}}async function ci(e,n){try{return(await t().post("https://app.meetelise.com/platformApi/webchat/current-parsed-lead-source",{query_params:En(),building_slug:e,referrer:n,campaign_sources:jn()})).data}catch(e){return null}}!function(e){e.ConceptBlueBlack="Concept 1 (Blue/Black)",e.ConceptBlueWhite="Concept 2 (Blue/White)"}(li||(li={}));const pi=u`
1145
+ `,Yt],Dn([ue({attribute:!1})],qn.prototype,"layoutOptions",void 0),Dn([ue({attribute:!1})],qn.prototype,"unitOptions",void 0),Dn([ue({attribute:!1})],qn.prototype,"tourTypeOptions",void 0),Dn([ue({attribute:!0})],qn.prototype,"chatId",void 0),Dn([ue({type:Number})],qn.prototype,"buildingId",void 0),Dn([ue({attribute:!0})],qn.prototype,"buildingSlug",void 0),Dn([ue({attribute:!0})],qn.prototype,"sgtUrl",void 0),Dn([ue({attribute:!0})],qn.prototype,"escortedToursLink",void 0),Dn([ue({attribute:!0})],qn.prototype,"virtualToursLink",void 0),Dn([ue({attribute:!0})],qn.prototype,"orgSlug",void 0),Dn([le()],qn.prototype,"tourType",void 0),Dn([le()],qn.prototype,"shouldShowTourType",void 0),Dn([le()],qn.prototype,"email",void 0),Dn([le()],qn.prototype,"phoneNumber",void 0),Dn([le()],qn.prototype,"availabilitiesGroupedByDay",void 0),Dn([le()],qn.prototype,"waitingForAvailabilities",void 0),Dn([le()],qn.prototype,"selectedDate",void 0),Dn([le()],qn.prototype,"selectedTime",void 0),Dn([le()],qn.prototype,"mobilePageIndex",void 0),Dn([le()],qn.prototype,"isSubmitting",void 0),Dn([le()],qn.prototype,"tourIsBooked",void 0),Dn([ue({attribute:!1})],qn.prototype,"leadSources",void 0),Dn([ue({attribute:!0})],qn.prototype,"currentLeadSource",void 0),Dn([ue({attribute:!0})],qn.prototype,"featureFlagShowDropdown",void 0),Dn([de(".nameContainer#firstName input")],qn.prototype,"firstNameInput",void 0),Dn([de(".nameContainer#lastName input")],qn.prototype,"lastNameInput",void 0),Dn([de(".inputContainer#email input")],qn.prototype,"emailInput",void 0),Dn([de(".inputContainer#phone input")],qn.prototype,"phoneInput",void 0),Dn([de("me-select#unitType")],qn.prototype,"unitTypeSelect",void 0),Dn([de("me-select#layoutType")],qn.prototype,"layoutTypeSelect",void 0),Dn([de("me-select#leadSource")],qn.prototype,"selectedLeadSource",void 0),qn=Dn([ae("tour-scheduler")],qn),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(Un||(Un={}));const Bn={[Un.Guided]:en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[Un.Self]:en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[Un.Virtual]:en.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},Jn={[Un.Guided]:"escorted-tour",[Un.Self]:"self-guided-tour",[Un.Virtual]:"live-virtual-tour"},kn=e=>e.map((e=>(e=>({studio:0,"1br":1,"2br":2,"3br":3,"4br":4,"5br":5,"6br":6,"7br":7,"8br":8,"9br":9,"10br":10}[e]))(e))).filter(On.isNumber).sort().map((e=>(e=>({0:"studio",1:"1br",2:"2br",3:"3br",4:"4br",5:"5br",6:"6br",7:"7br",8:"8br",9:"9br",10:"10br"}[e]))(e))).filter(On.isString);class Ln{constructor(e,t,n){this.org=e,this.building=t,this.chatId=n,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}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:jn()})})}}const jn=()=>{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}};var Hn,Gn=new Uint8Array(16);function Wn(){if(!Hn&&!(Hn="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 Hn(Gn)}const Qn=/^(?:[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,zn=function(e){return"string"==typeof e&&Qn.test(e)};for(var Vn=[],Xn=0;Xn<256;++Xn)Vn.push((Xn+256).toString(16).substr(1));const Yn=function(e,t,n){var i=(e=e||{}).random||(e.rng||Wn)();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=(Vn[e[t+0]]+Vn[e[t+1]]+Vn[e[t+2]]+Vn[e[t+3]]+"-"+Vn[e[t+4]]+Vn[e[t+5]]+"-"+Vn[e[t+6]]+Vn[e[t+7]]+"-"+Vn[e[t+8]]+Vn[e[t+9]]+"-"+Vn[e[t+10]]+Vn[e[t+11]]+Vn[e[t+12]]+Vn[e[t+13]]+Vn[e[t+14]]+Vn[e[t+15]]).toLowerCase();if(!zn(n))throw TypeError("Stringified UUID is invalid");return n}(i)};function Kn(e,t){const n=$n(e,t),i=Yn();return localStorage.setItem(n,i),Zn(e,t),i}function Zn(e,t){const n=ei(e,t),i=(new Date).toISOString();return localStorage.setItem(n,i),i}function $n(e,t){return`com.meetelise.chatID-${e}-${t}`}function ei(e,t){return`com.meetelise.chatIDIssueTime-${e}-${t}`}const ti="#FFFFFF",ni="#202020",ii={user:{textColor:ti,backgroundColor:"#1990FF"},agent:{textColor:ti,backgroundColor:"#1E1E1E"}},ri={user:{textColor:ti,backgroundColor:"#83818E"},agent:{textColor:ti,backgroundColor:ni}},oi={Light:{chatHeader:{backgroundColor:ti,textColor:ni},chatPaneBackgroundColor:"rgba(255, 255, 255, 0.9)",message:ii},Dark:{chatHeader:{backgroundColor:ni,textColor:ti},chatPaneBackgroundColor:"rgba(32, 32, 32, 0.9)",message:ii},Purple:{chatHeader:{backgroundColor:"#550098",textColor:ti},chatPaneBackgroundColor:"rgba(85, 0, 152, 0.6)",message:ii},Blue:{chatHeader:{backgroundColor:"#0814E5",textColor:ti},chatPaneBackgroundColor:"rgba(4, 17, 245, 0.6)",message:ii},Teal:{chatHeader:{backgroundColor:"#6EE7ED",textColor:ni},chatPaneBackgroundColor:"rgba(115, 247, 253, 0.8)",message:ri},Green:{chatHeader:{backgroundColor:"#147B0E",textColor:ti},chatPaneBackgroundColor:"rgba(13, 141, 5, 0.6)",message:ii},Yellow:{chatHeader:{backgroundColor:"#F1E54F",textColor:ni},chatPaneBackgroundColor:"rgba(251, 239, 80, 0.9)",message:ri},Orange:{chatHeader:{backgroundColor:"#C06C31",textColor:ti},chatPaneBackgroundColor:"rgba(238, 126, 49, 0.7)",message:ii},Pink:{chatHeader:{backgroundColor:"#A24599",textColor:ti},chatPaneBackgroundColor:"rgba(167, 70, 157, 0.8)",message:ii},Glass:{chatHeader:{backgroundColor:ti,textColor:ni},chatPaneBackgroundColor:"rgba(193, 193, 193, 0.3)",message:{user:{textColor:"#FFFFFF",backgroundColor:"#000000"},agent:{textColor:"#000000",backgroundColor:"#FFFFFF"}}}},ai=e=>oi[e&&Object.keys(oi).includes(e)?e:"Light"];function si(e,t,n,i,r,o){var a;const s=new Ie.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===ri).toString(),avatarUrl:"image"===t.avatarType&&t.avatarSrc?i:"https://eliseusercontent.meetelise.com/webchat/looping-gradient.gif"},u}async function ui(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}var li;async function di(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/ab-test-type`)).data}catch(e){return null}}async function ci(e,n){try{return(await t().post("https://app.meetelise.com/platformApi/webchat/current-parsed-lead-source",{query_params:En(),building_slug:e,referrer:n,campaign_sources:jn()})).data}catch(e){return null}}!function(e){e.ConceptBlueBlack="Concept 1 (Blue/Black)",e.ConceptBlueWhite="Concept 2 (Blue/White)"}(li||(li={}));const pi=u`
1146
1146
  * {
1147
1147
  font-family: "Helvetica Neue", Arial;
1148
1148
  font-size: 14px;
@@ -1172,7 +1172,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
1172
1172
  align-items: center;
1173
1173
  background-color: rgba(255, 255, 255, 0.8);
1174
1174
  color: #202020;
1175
- backdrop-filter: blur(10px);
1175
+ backdrop-filter: blur(50px);
1176
1176
  box-shadow: 0px 8px 8px 4px rgba(0, 0, 0, 0.25);
1177
1177
  }
1178
1178
  .launcher:not(.miniLauncher).launcher__mobile {
@@ -2927,7 +2927,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2927
2927
  `:""}
2928
2928
  ${this.isCallToActionWindowOpen()?"":this.renderActionPills()}
2929
2929
  </div>
2930
- `}};zi.styles=pi,Qi([ue({type:Boolean})],zi.prototype,"isMobile",void 0),Qi([ue({type:Boolean})],zi.prototype,"isMinimized",void 0),Qi([ue({type:Boolean})],zi.prototype,"isFirstMount",void 0),Qi([ue()],zi.prototype,"backgroundColor",void 0),Qi([ue()],zi.prototype,"textColor",void 0),Qi([ue({type:Boolean})],zi.prototype,"isMini",void 0),Qi([ue({attribute:!1})],zi.prototype,"autoOpenChatWidget",void 0),Qi([ue()],zi.prototype,"phoneNumber",void 0),Qi([ue({attribute:!0})],zi.prototype,"chatId",void 0),Qi([ue({attribute:!0})],zi.prototype,"chatCallUsHeader",void 0),Qi([ue({attribute:!1})],zi.prototype,"buildingId",void 0),Qi([ue({attribute:!0})],zi.prototype,"buildingSlug",void 0),Qi([ue({attribute:!0})],zi.prototype,"orgSlug",void 0),Qi([ue({attribute:!0})],zi.prototype,"sgtUrl",void 0),Qi([ue({attribute:!0})],zi.prototype,"buildingABTestType",void 0),Qi([ue({attribute:!0})],zi.prototype,"featureFlagShowDropdown",void 0),Qi([ue({attribute:!1})],zi.prototype,"leadSources",void 0),Qi([ue({attribute:!0})],zi.prototype,"currentLeadSource",void 0),Qi([ue({attribute:!0})],zi.prototype,"escortedToursLink",void 0),Qi([ue({attribute:!0})],zi.prototype,"virtualToursLink",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasCallUsEnabled",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasChatEnabled",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasEmailEnabled",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasSSTEnabled",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasTextUsEnabled",void 0),Qi([ue({attribute:!1})],zi.prototype,"layoutOptions",void 0),Qi([ue({attribute:!1})],zi.prototype,"unitOptions",void 0),Qi([ue({attribute:!1})],zi.prototype,"tourTypeOptions",void 0),Qi([ue({attribute:!1})],zi.prototype,"onChatTapped",void 0),Qi([ue({attribute:!1})],zi.prototype,"launcherStyles",void 0),Qi([le()],zi.prototype,"isEmailWindowOpen",void 0),Qi([le()],zi.prototype,"isCallUsWindowOpen",void 0),Qi([le()],zi.prototype,"isSSTWindowOpen",void 0),Qi([le()],zi.prototype,"isTextUsWindowOpen",void 0),zi=Qi([ae("meetelise-launcher")],zi);var Vi=n(3379),Xi=n.n(Vi),Yi=n(7795),Ki=n.n(Yi),Zi=n(569),$i=n.n(Zi),er=n(3565),tr=n.n(er),nr=n(9216),ir=n.n(nr),rr=n(4589),or=n.n(rr),ar=n(3631),sr={};async function ur(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/lead-sources`)).data}catch(e){return[]}}sr.styleTagTransform=or(),sr.setAttributes=tr(),sr.insert=$i().bind(null,"head"),sr.domAPI=Ki(),sr.insertStyleElement=ir(),Xi()(ar.Z,sr),ar.Z&&ar.Z.locals&&ar.Z.locals;var lr,dr=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 cr=lr=class extends re{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.themeId="Glass",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=ai(),this.chatId="",this.analytics=null,this.isMobile=Cn(),this.launcher=null,this.building=null,this.buildingABTestType=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=_n.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.talkjsPopupElement=null,this.yardiDNIScriptInterval=null,this.launcherRef=Ae(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher(),this.isLoading=!1},this.setBuildingDerivedInfo=async()=>{var e,n;if(!this.buildingSlug||!this.orgSlug)return;const[i,r,o,a,s,u]=await Promise.all([ui(this.orgSlug,this.buildingSlug),di(this.buildingSlug),ur(this.buildingSlug),ci(this.buildingSlug,document.referrer),Mn(this.buildingSlug),Pn(this.buildingSlug)]);i.phoneNumber=Re(i.phoneNumber),this.building=i,this.buildingABTestType=null!==(e=null==r?void 0:r.abTestType)&&void 0!==e?e:"",this.leadSources=o,this.currentLeadSource=a,this.featureFlagShowDropdown=s;let l=null;u&&(l=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:Re(i.data.number),isMatch:i.data.isMatch,isPropertyWebsiteCatchall:i.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,this.currentLeadSource)),this.phoneNumberForSource=l||{number:this.building.phoneNumber,isMatch:!1,isPropertyWebsiteCatchall:!0},this.currentLeadSource&&(this.leadSources.includes(this.currentLeadSource)||this.leadSources.push(this.currentLeadSource)),Sn(this.building.id),this.chatId=function(e,t){const n=$n(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=ei(e,t),i=localStorage.getItem(n)||Zn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Kn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=ai(null!==(n=this.themeId)&&void 0!==n?n:this.building.themeId),this.analytics=new Ln(this.orgSlug,this.buildingSlug,this.chatId),this.analytics.ping("webchat_heartbeat")},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,lr.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)=>{var r;const o=n.createPopup(si(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await o.mount({show:!1}),o.on("close",(()=>{this.hideLauncher=!1}));const a=document.querySelector(".__talkjs_popup");if(this.talkjsPopupElement=a,!a)throw new Error("Failed to find chat window");a.classList.add("meetelise-chat","pane"),this.isMobile||a.classList.add("launcher__desktop"),a.style.zIndex="99999999999",this.popup=o;const s=sessionStorage.getItem("autoOpenedTimestamp"),u=!s||s&&rn(an(s));e.autoOpenChatWidget&&u&&!Cn()&&(this.popup.show(),this.hideLauncher=!0,this.hasMounted=!0,sessionStorage.setItem("autoOpenedTimestamp",$t(function(e,t){De(2,arguments);var n=Ze(t);return $e(e,6e4*n)}(new Date,15))),null===(r=this.analytics)||void 0===r||r.ping("autoOpen"))},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.handleContactClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e)},this.handleContactTabClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickPhoneOption(e)},this.adjustTopHeaderContactCoords=()=>{var e;if(this.talkjsPopupElement){const t=function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}(this.talkjsPopupElement),n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("contactTabPopup");if(!n)return;n.style.left=`${t.left+20}px`,n.style.top=t.top-50+"px"}},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&&lr.session))return;this.chatId=Kn(this.orgSlug,this.buildingSlug);const e=await lr.session;this.analytics.chatId=this.chatId,this.popup.select(si(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")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustTopHeaderContactCoords)}disconnectedCallback(){window.removeEventListener("resize",this.adjustTopHeaderContactCoords),super.disconnectedCallback()}updated(){this.adjustTopHeaderContactCoords()}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,w,b,S,T,A,x,C,O,I,N,R,E,F,_,M;window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",zi);const P=!this.hideLauncher||this.isLoading||this.buildingABTestType!==li.ConceptBlueBlack&&this.buildingABTestType!==li.ConceptBlueWhite||this.isMobile;return U`
2930
+ `}};zi.styles=pi,Qi([ue({type:Boolean})],zi.prototype,"isMobile",void 0),Qi([ue({type:Boolean})],zi.prototype,"isMinimized",void 0),Qi([ue({type:Boolean})],zi.prototype,"isFirstMount",void 0),Qi([ue()],zi.prototype,"backgroundColor",void 0),Qi([ue()],zi.prototype,"textColor",void 0),Qi([ue({type:Boolean})],zi.prototype,"isMini",void 0),Qi([ue({attribute:!1})],zi.prototype,"autoOpenChatWidget",void 0),Qi([ue()],zi.prototype,"phoneNumber",void 0),Qi([ue({attribute:!0})],zi.prototype,"chatId",void 0),Qi([ue({attribute:!0})],zi.prototype,"chatCallUsHeader",void 0),Qi([ue({attribute:!1})],zi.prototype,"buildingId",void 0),Qi([ue({attribute:!0})],zi.prototype,"buildingSlug",void 0),Qi([ue({attribute:!0})],zi.prototype,"orgSlug",void 0),Qi([ue({attribute:!0})],zi.prototype,"sgtUrl",void 0),Qi([ue({attribute:!0})],zi.prototype,"buildingABTestType",void 0),Qi([ue({attribute:!0})],zi.prototype,"featureFlagShowDropdown",void 0),Qi([ue({attribute:!1})],zi.prototype,"leadSources",void 0),Qi([ue({attribute:!0})],zi.prototype,"currentLeadSource",void 0),Qi([ue({attribute:!0})],zi.prototype,"escortedToursLink",void 0),Qi([ue({attribute:!0})],zi.prototype,"virtualToursLink",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasCallUsEnabled",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasChatEnabled",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasEmailEnabled",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasSSTEnabled",void 0),Qi([ue({type:Boolean})],zi.prototype,"hasTextUsEnabled",void 0),Qi([ue({attribute:!1})],zi.prototype,"layoutOptions",void 0),Qi([ue({attribute:!1})],zi.prototype,"unitOptions",void 0),Qi([ue({attribute:!1})],zi.prototype,"tourTypeOptions",void 0),Qi([ue({attribute:!1})],zi.prototype,"onChatTapped",void 0),Qi([ue({attribute:!1})],zi.prototype,"launcherStyles",void 0),Qi([le()],zi.prototype,"isEmailWindowOpen",void 0),Qi([le()],zi.prototype,"isCallUsWindowOpen",void 0),Qi([le()],zi.prototype,"isSSTWindowOpen",void 0),Qi([le()],zi.prototype,"isTextUsWindowOpen",void 0),zi=Qi([ae("meetelise-launcher")],zi);var Vi=n(3379),Xi=n.n(Vi),Yi=n(7795),Ki=n.n(Yi),Zi=n(569),$i=n.n(Zi),er=n(3565),tr=n.n(er),nr=n(9216),ir=n.n(nr),rr=n(4589),or=n.n(rr),ar=n(3631),sr={};async function ur(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/lead-sources`)).data}catch(e){return[]}}sr.styleTagTransform=or(),sr.setAttributes=tr(),sr.insert=$i().bind(null,"head"),sr.domAPI=Ki(),sr.insertStyleElement=ir(),Xi()(ar.Z,sr),ar.Z&&ar.Z.locals&&ar.Z.locals;var lr,dr=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 cr=lr=class extends re{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.themeId="Glass",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=ai(),this.chatId="",this.analytics=null,this.isMobile=Cn(),this.launcher=null,this.building=null,this.buildingABTestType=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=_n.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.talkjsPopupElement=null,this.yardiDNIScriptInterval=null,this.launcherRef=Ae(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher(),this.isLoading=!1},this.setBuildingDerivedInfo=async()=>{var e,n;if(!this.buildingSlug||!this.orgSlug)return;const[i,r,o,a,s,u]=await Promise.all([ui(this.orgSlug,this.buildingSlug),di(this.buildingSlug),ur(this.buildingSlug),ci(this.buildingSlug,document.referrer),Mn(this.buildingSlug),Pn(this.buildingSlug)]);i.phoneNumber=Re(i.phoneNumber),this.building=i,this.buildingABTestType=null!==(e=null==r?void 0:r.abTestType)&&void 0!==e?e:"",this.leadSources=o,this.currentLeadSource=a,this.featureFlagShowDropdown=s;let l=null;u&&(l=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:Re(i.data.number),isMatch:i.data.isMatch,isPropertyWebsiteCatchall:i.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,this.currentLeadSource)),this.phoneNumberForSource=l||{number:this.building.phoneNumber,isMatch:!1,isPropertyWebsiteCatchall:!0},this.currentLeadSource&&(this.leadSources.includes(this.currentLeadSource)||this.leadSources.push(this.currentLeadSource)),Sn(this.building.id),this.chatId=function(e,t){const n=$n(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=ei(e,t),i=localStorage.getItem(n)||Zn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Kn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=ai(null!==(n=this.themeId)&&void 0!==n?n:this.building.themeId),this.analytics=new Ln(this.orgSlug,this.buildingSlug,this.chatId),this.analytics.ping("webchat_heartbeat")},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,lr.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(si(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(this.talkjsPopupElement=o,!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");!a||a&&rn(an(a))},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.handleContactClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e)},this.handleContactTabClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickPhoneOption(e)},this.adjustTopHeaderContactCoords=()=>{var e;if(this.talkjsPopupElement){const t=function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}(this.talkjsPopupElement),n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("contactTabPopup");if(!n)return;n.style.left=`${t.left+20}px`,n.style.top=t.top-50+"px"}},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&&lr.session))return;this.chatId=Kn(this.orgSlug,this.buildingSlug);const e=await lr.session;this.analytics.chatId=this.chatId,this.popup.select(si(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")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustTopHeaderContactCoords)}disconnectedCallback(){window.removeEventListener("resize",this.adjustTopHeaderContactCoords),super.disconnectedCallback()}updated(){this.adjustTopHeaderContactCoords()}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,w,b,S,T,A,x,C,O,I,N,R,E,F,_,M;window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",zi);const P=!this.hideLauncher||this.isLoading||this.buildingABTestType!==li.ConceptBlueBlack&&this.buildingABTestType!==li.ConceptBlueWhite||this.isMobile;return U`
2931
2931
  <meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=1">
2932
2932
  <div id="aria-describe-info" style="display: none;">
2933
2933
  EliseAI widget that allows you to chat with a virtual assistant, book
@@ -138,6 +138,22 @@ export class TourScheduler extends LitElement {
138
138
  this.tourTypeOptions.map((o) => o.value).includes("VIRTUAL_SHOWING") &&
139
139
  availabilitiesExistForTourType[TourType.Virtual],
140
140
  };
141
+
142
+ // if there is only a single option for tour type, have that be the default
143
+ const hasOneShowTourType =
144
+ Object.values(this.shouldShowTourType).reduce((acc, cur) => {
145
+ if (cur === true) {
146
+ return acc + 1;
147
+ } else {
148
+ return acc;
149
+ }
150
+ }, 0) === 1;
151
+ if (hasOneShowTourType) {
152
+ this.tourType = Object.keys(this.shouldShowTourType).find(
153
+ (key) => this.shouldShowTourType[key as TourType]
154
+ ) as TourType;
155
+ }
156
+
141
157
  if (this.tourType === null) {
142
158
  this.waitingForAvailabilities = false;
143
159
  return;
@@ -30,7 +30,7 @@ export const launcherStyles = css`
30
30
  align-items: center;
31
31
  background-color: rgba(255, 255, 255, 0.8);
32
32
  color: #202020;
33
- backdrop-filter: blur(10px);
33
+ backdrop-filter: blur(50px);
34
34
  box-shadow: 0px 8px 8px 4px rgba(0, 0, 0, 0.25);
35
35
  }
36
36
  .launcher:not(.miniLauncher).launcher__mobile {
@@ -351,11 +351,18 @@ export class MEChat extends LitElement {
351
351
  }
352
352
  (talkjsPopupElement as HTMLElement).style.zIndex = "99999999999";
353
353
  this.popup = popup;
354
+
355
+ const forceClose = true; // if we want to always keep the widget in the closed state
354
356
  const autoOpenedTimestamp = sessionStorage.getItem("autoOpenedTimestamp");
355
357
  const shouldAutoOpen =
356
358
  !autoOpenedTimestamp ||
357
359
  (autoOpenedTimestamp && isPast(parseISO(autoOpenedTimestamp)));
358
- if (building.autoOpenChatWidget && shouldAutoOpen && !isMobile()) {
360
+ if (
361
+ !forceClose &&
362
+ building.autoOpenChatWidget &&
363
+ shouldAutoOpen &&
364
+ !isMobile()
365
+ ) {
359
366
  this.popup.show();
360
367
  this.hideLauncher = true;
361
368
  this.hasMounted = true;
package/src/themes.ts CHANGED
@@ -124,7 +124,7 @@ const themesById = {
124
124
  backgroundColor: white,
125
125
  textColor: darkGray,
126
126
  },
127
- chatPaneBackgroundColor: "rgba(0, 0, 0, 0.5)",
127
+ chatPaneBackgroundColor: "rgba(193, 193, 193, 0.3)",
128
128
  message: {
129
129
  user: {
130
130
  textColor: "#FFFFFF",