@meetelise/chat 1.20.35 → 1.20.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/public/dist/index.js
CHANGED
|
@@ -475,7 +475,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
475
475
|
font-family: "Poppins";
|
|
476
476
|
font-size: 16px;
|
|
477
477
|
}
|
|
478
|
-
`;var Nn=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 An=class extends ne{constructor(){super(...arguments),this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.buildingId=0,this.buildingSlug="",this.sgtUrl="",this.escortedToursLink="",this.virtualToursLink="",this.orgSlug="",this.tourType=null,this.shouldShowTourType={[En.Guided]:!0,[En.Self]:!0,[En.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.firstUpdated=async()=>{const e=await(async()=>{var e,t,n,i,r,o;return{[En.Guided]:!!(null===(t=null===(e=await wn(Kt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[En.Self]:!!(null===(i=null===(n=await wn(Kt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[En.Virtual]:!!(null===(o=null===(r=await wn(Kt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}})();this.shouldShowTourType={[En.Guided]:this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")&&e[En.Guided],[En.Self]:this.tourTypeOptions.map((e=>e.value)).includes("SELF_GUIDED")&&e[En.Self],[En.Virtual]:this.tourTypeOptions.map((e=>e.value)).includes("VIRTUAL_SHOWING")&&e[En.Virtual]},null!==this.tourType?(this.availabilitiesGroupedByDay=await Sn(_n[this.tourType]),this.waitingForAvailabilities=!1):this.waitingForAvailabilities=!1},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await Sn(_n[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||Ne(e)){if("Backspace"===e.key){if(Ne(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=Re(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)||Ne(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=Re(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=Re(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 t={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:Fn[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};this.isSubmitting=!0;try{await Qt().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",
|
|
478
|
+
`;var Nn=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 An=class extends ne{constructor(){super(...arguments),this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.buildingId=0,this.buildingSlug="",this.sgtUrl="",this.escortedToursLink="",this.virtualToursLink="",this.orgSlug="",this.tourType=null,this.shouldShowTourType={[En.Guided]:!0,[En.Self]:!0,[En.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.firstUpdated=async()=>{const e=await(async()=>{var e,t,n,i,r,o;return{[En.Guided]:!!(null===(t=null===(e=await wn(Kt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[En.Self]:!!(null===(i=null===(n=await wn(Kt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[En.Virtual]:!!(null===(o=null===(r=await wn(Kt.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}})();this.shouldShowTourType={[En.Guided]:this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")&&e[En.Guided],[En.Self]:this.tourTypeOptions.map((e=>e.value)).includes("SELF_GUIDED")&&e[En.Self],[En.Virtual]:this.tourTypeOptions.map((e=>e.value)).includes("VIRTUAL_SHOWING")&&e[En.Virtual]},null!==this.tourType?(this.availabilitiesGroupedByDay=await Sn(_n[this.tourType]),this.waitingForAvailabilities=!1):this.waitingForAvailabilities=!1},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await Sn(_n[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||Ne(e)){if("Backspace"===e.key){if(Ne(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=Re(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)||Ne(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=Re(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=Re(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 t=new URLSearchParams(window.location.search),n={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:Fn[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,query_params:Object.fromEntries(t.entries())};this.isSubmitting=!0;try{await Qt().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",n,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG","org-slug":this.orgSlug}}),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:()=>D`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>D`${this.dateAndTimeMenu(!0)}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>D`<action-confirm-button
|
|
479
479
|
id="schedule"
|
|
480
480
|
.onClick=${this.submit}
|
|
481
481
|
.isLoading=${this.isSubmitting}
|
|
@@ -1835,7 +1835,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1835
1835
|
width: 50%;
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
|
-
`,Cn],ui([ae({attribute:!1})],li.prototype,"onCloseClicked",void 0),ui([ae({attribute:!1})],li.prototype,"buildingId",void 0),ui([ae({attribute:!0})],li.prototype,"buildingSlug",void 0),ui([ae({attribute:!0})],li.prototype,"orgSlug",void 0),ui([ae()],li.prototype,"privatePolicyUrl",void 0),ui([ae()],li.prototype,"termsOfServiceUrl",void 0),ui([se()],li.prototype,"firstName",void 0),ui([se()],li.prototype,"lastName",void 0),ui([se()],li.prototype,"email",void 0),ui([se()],li.prototype,"phoneNumber",void 0),ui([se()],li.prototype,"message",void 0),ui([se()],li.prototype,"hasNameError",void 0),ui([se()],li.prototype,"hasEmailError",void 0),ui([se()],li.prototype,"hasPhoneNumberError",void 0),ui([se()],li.prototype,"hasMessageError",void 0),ui([se()],li.prototype,"hasSubmittedForm",void 0),ui([se()],li.prototype,"windowHeight",void 0),ui([se()],li.prototype,"hasSubmissionError",void 0),ui([se()],li.prototype,"isSubmitting",void 0),li=ui([re("email-us-window")],li);const di=async(e,t,n,i,r,o,a,s)=>{const u=
|
|
1838
|
+
`,Cn],ui([ae({attribute:!1})],li.prototype,"onCloseClicked",void 0),ui([ae({attribute:!1})],li.prototype,"buildingId",void 0),ui([ae({attribute:!0})],li.prototype,"buildingSlug",void 0),ui([ae({attribute:!0})],li.prototype,"orgSlug",void 0),ui([ae()],li.prototype,"privatePolicyUrl",void 0),ui([ae()],li.prototype,"termsOfServiceUrl",void 0),ui([se()],li.prototype,"firstName",void 0),ui([se()],li.prototype,"lastName",void 0),ui([se()],li.prototype,"email",void 0),ui([se()],li.prototype,"phoneNumber",void 0),ui([se()],li.prototype,"message",void 0),ui([se()],li.prototype,"hasNameError",void 0),ui([se()],li.prototype,"hasEmailError",void 0),ui([se()],li.prototype,"hasPhoneNumberError",void 0),ui([se()],li.prototype,"hasMessageError",void 0),ui([se()],li.prototype,"hasSubmittedForm",void 0),ui([se()],li.prototype,"windowHeight",void 0),ui([se()],li.prototype,"hasSubmissionError",void 0),ui([se()],li.prototype,"isSubmitting",void 0),li=ui([re("email-us-window")],li);const di=async(e,t,n,i,r,o,a,s)=>{const u="+1"+i.replace("(","").replace(")","").replace(" ","").replace("-",""),l=new URLSearchParams(window.location.search),d={email_address:n,building_id:o,lead_source:"property-website",first_message:r,first_name:e,last_name:t,phone_number:u,referrer:document.referrer,query_params:Object.fromEntries(l.entries())};await Qt().post("https://app.meetelise.com/platformApi/state/create/emailMe",d,{headers:{"building-slug":s,"org-slug":a,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG"}})};var ci=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 pi=class extends ne{constructor(){super(...arguments),this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.inPopup=!1,this.phoneNumberInputRef=Se(),this.phoneNumber="",this.hasSubmittedForm=!1,this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(Ae(e))return;const t=e.target;this.phoneNumber=Re(t.value),this.phoneNumberInputRef.value.value=this.phoneNumber},this.enforceFormat=e=>{Ce(e)||Ae(e)||e.preventDefault()},this.validateFormFields=()=>{this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.phoneNumber&&14===this.phoneNumber.length||(this.hasPhoneNumberError=!0)},this.onClick=async()=>{if(this.validateFormFields(),!this.hasPhoneNumberError)try{this.isSubmitting=!0,await fi(this.phoneNumber,this.buildingId,this.orgSlug,this.buildingSlug),this.hasSubmittedForm=!0,this.isSubmitting=!1}catch(e){this.isSubmitting=!1,this.hasSubmissionError=!0}},this.renderTextUs=()=>D` <div class="text-us-wrapper">
|
|
1839
1839
|
<div class="text-us-window__description">Send us a text</div>
|
|
1840
1840
|
<div class="text-us-window__vertical-spacer"></div>
|
|
1841
1841
|
<div class="text-us-window__input-container">
|
|
@@ -1950,7 +1950,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1950
1950
|
line-height: 22px;
|
|
1951
1951
|
margin-top: 8px;
|
|
1952
1952
|
}
|
|
1953
|
-
`,Cn],ci([ae({attribute:!1})],pi.prototype,"onCloseClicked",void 0),ci([ae({attribute:!1})],pi.prototype,"buildingId",void 0),ci([ae({attribute:!0})],pi.prototype,"buildingSlug",void 0),ci([ae({attribute:!0})],pi.prototype,"orgSlug",void 0),ci([ae({attribute:!0})],pi.prototype,"inPopup",void 0),ci([se()],pi.prototype,"phoneNumber",void 0),ci([se()],pi.prototype,"hasSubmittedForm",void 0),ci([se()],pi.prototype,"hasPhoneNumberError",void 0),ci([se()],pi.prototype,"hasSubmissionError",void 0),ci([se()],pi.prototype,"isSubmitting",void 0),pi=ci([re("text-us-window")],pi);const fi=async(e,t,n,i)=>{const r=
|
|
1953
|
+
`,Cn],ci([ae({attribute:!1})],pi.prototype,"onCloseClicked",void 0),ci([ae({attribute:!1})],pi.prototype,"buildingId",void 0),ci([ae({attribute:!0})],pi.prototype,"buildingSlug",void 0),ci([ae({attribute:!0})],pi.prototype,"orgSlug",void 0),ci([ae({attribute:!0})],pi.prototype,"inPopup",void 0),ci([se()],pi.prototype,"phoneNumber",void 0),ci([se()],pi.prototype,"hasSubmittedForm",void 0),ci([se()],pi.prototype,"hasPhoneNumberError",void 0),ci([se()],pi.prototype,"hasSubmissionError",void 0),ci([se()],pi.prototype,"isSubmitting",void 0),pi=ci([re("text-us-window")],pi);const fi=async(e,t,n,i)=>{const r="+1"+e.replace("(","").replace(")","").replace(" ","").replace("-",""),o=new URLSearchParams(window.location.search),a={building_id:t,lead_source:"property-website",phone_number:r,referrer:document.referrer,query_params:Object.fromEntries(o.entries())};await Qt().post("https://app.meetelise.com/platformApi/state/create/textMe",a,{headers:{"building-slug":i,"org-slug":n,"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG"}})},hi=q`<svg width="18" height="20" viewBox="0 0 18 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1954
1954
|
<path d="M17.5286 6.72109H0.00730896C0.065762 4.35374 2.00202 2.45401 4.38399 2.45401H4.93198V3.91534C4.93198 4.22222 5.18041 4.46333 5.47998 4.46333C5.77955 4.46333 6.02798 4.22222 6.02798 3.91534V2.45401H11.508V3.91534C11.508 4.22222 11.7564 4.46333 12.056 4.46333C12.3555 4.46333 12.604 4.22222 12.604 3.91534V2.45401H13.1519C15.5339 2.45401 17.4702 4.35374 17.5286 6.72109V6.72109Z" fill="#B6C2FE"/>
|
|
1955
1955
|
<path d="M17.5359 7.45181V15.606C17.5359 18.0318 15.5704 19.99 13.1519 19.99H4.38398C1.96548 19.99 0 18.0318 0 15.606V7.45181H17.5359Z" fill="white"/>
|
|
1956
1956
|
<path d="M5.47998 1V2.46133" stroke="#B6C2FE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -2383,4 +2383,4 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
2383
2383
|
.heavyLabel {
|
|
2384
2384
|
font-weight: bold;
|
|
2385
2385
|
}
|
|
2386
|
-
`,Vi.session=Ie.ready.then((()=>{const e=new Ie.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Ie.Session({appId:"ogKIvCor",me:e})})),$i([ae({type:String})],Vi.prototype,"buildingSlug",void 0),$i([ae({type:String})],Vi.prototype,"orgSlug",void 0),$i([ae({type:String})],Vi.prototype,"themeId",void 0),$i([ae({attribute:!1})],Vi.prototype,"avatarSrc",void 0),$i([ae({type:Boolean})],Vi.prototype,"useMiniWidget",void 0),$i([ae({type:Object})],Vi.prototype,"launcherStyles",void 0),$i([se()],Vi.prototype,"popup",void 0),$i([se()],Vi.prototype,"theme",void 0),$i([se()],Vi.prototype,"chatId",void 0),$i([se()],Vi.prototype,"analytics",void 0),$i([se()],Vi.prototype,"isMobile",void 0),$i([se()],Vi.prototype,"launcher",void 0),$i([se()],Vi.prototype,"building",void 0),$i([se()],Vi.prototype,"buildingABTestType",void 0),$i([se()],Vi.prototype,"hasMounted",void 0),$i([se()],Vi.prototype,"hideLauncher",void 0),$i([se()],Vi.prototype,"isLoading",void 0),$i([se()],Vi.prototype,"talkjsPopupElement",void 0),$i([se()],Vi.prototype,"myContactHeader",void 0),Vi=Gi=$i([re("me-chat")],Vi);class zi{static start(e){Xi(),Zi();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),zi.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),zi.meChat=null)}}zi.meChat=null;const Xi=()=>{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)},Zi=()=>{const e=document.createElement("meta");e.setAttribute("name","viewport"),e.setAttribute("content","width=device-width, initial-scale=1, maximum-scale=2"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
|
|
2386
|
+
`,Vi.session=Ie.ready.then((()=>{const e=new Ie.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Ie.Session({appId:"ogKIvCor",me:e})})),$i([ae({type:String})],Vi.prototype,"buildingSlug",void 0),$i([ae({type:String})],Vi.prototype,"orgSlug",void 0),$i([ae({type:String})],Vi.prototype,"themeId",void 0),$i([ae({attribute:!1})],Vi.prototype,"avatarSrc",void 0),$i([ae({type:Boolean})],Vi.prototype,"useMiniWidget",void 0),$i([ae({type:Object})],Vi.prototype,"launcherStyles",void 0),$i([se()],Vi.prototype,"popup",void 0),$i([se()],Vi.prototype,"theme",void 0),$i([se()],Vi.prototype,"chatId",void 0),$i([se()],Vi.prototype,"analytics",void 0),$i([se()],Vi.prototype,"isMobile",void 0),$i([se()],Vi.prototype,"launcher",void 0),$i([se()],Vi.prototype,"building",void 0),$i([se()],Vi.prototype,"buildingABTestType",void 0),$i([se()],Vi.prototype,"hasMounted",void 0),$i([se()],Vi.prototype,"hideLauncher",void 0),$i([se()],Vi.prototype,"isLoading",void 0),$i([se()],Vi.prototype,"talkjsPopupElement",void 0),$i([se()],Vi.prototype,"myContactHeader",void 0),Vi=Gi=$i([re("me-chat")],Vi);class zi{static start(e){if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;Xi(),Zi();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),zi.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),zi.meChat=null)}}zi.meChat=null;const Xi=()=>{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)},Zi=()=>{const e=document.createElement("meta");e.setAttribute("name","viewport"),e.setAttribute("content","width=device-width, initial-scale=1, maximum-scale=2"),document.head.appendChild(e)}})();var r=i.Z;export{r as default};
|
package/src/MEChat.ts
CHANGED
|
@@ -19,6 +19,14 @@ export default class MEChat {
|
|
|
19
19
|
static meChat: MEChatLitElement | null = null;
|
|
20
20
|
|
|
21
21
|
static start(opts: Options): void {
|
|
22
|
+
// If our clients are Yardi and have a resident portal with rentcafe,
|
|
23
|
+
// we do NOT want to display the launcher (if following in shows up anywhere in url)
|
|
24
|
+
if (
|
|
25
|
+
window.location.pathname.includes("residentservices") ||
|
|
26
|
+
window.location.pathname.includes("onlineleasing")
|
|
27
|
+
) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
22
30
|
installFont();
|
|
23
31
|
installTalkjsMobileStyleFix();
|
|
24
32
|
const meChat = document.createElement("me-chat");
|
|
@@ -335,7 +335,9 @@ export class TourScheduler extends LitElement {
|
|
|
335
335
|
submit = async (): Promise<void> => {
|
|
336
336
|
if (!this.selectedDate || !this.selectedTime || this.tourType === null)
|
|
337
337
|
return;
|
|
338
|
+
const queryParams = new URLSearchParams(window.location.search);
|
|
338
339
|
const data = {
|
|
340
|
+
referrer: document.referrer,
|
|
339
341
|
email_address: this.email,
|
|
340
342
|
phone_number: `+1${this.phoneNumber.match(/\d/g)?.join("")}`, // e.g. +12125555555
|
|
341
343
|
building_id: this.buildingId,
|
|
@@ -350,6 +352,9 @@ export class TourScheduler extends LitElement {
|
|
|
350
352
|
this.unitTypeSelect && this.unitTypeSelect.value
|
|
351
353
|
? [this.unitTypeSelect.value]
|
|
352
354
|
: null,
|
|
355
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
356
|
+
// @ts-ignore
|
|
357
|
+
query_params: Object.fromEntries(queryParams.entries()),
|
|
353
358
|
};
|
|
354
359
|
const url = `https://app.meetelise.com/platformApi/state/create/scheduleMe`;
|
|
355
360
|
this.isSubmitting = true;
|
|
@@ -427,6 +427,7 @@ const createEmail = async (
|
|
|
427
427
|
.replace(")", "")
|
|
428
428
|
.replace(" ", "")
|
|
429
429
|
.replace("-", "");
|
|
430
|
+
const queryParams = new URLSearchParams(window.location.search);
|
|
430
431
|
const requestBody = {
|
|
431
432
|
email_address: email,
|
|
432
433
|
building_id: buildingId,
|
|
@@ -435,6 +436,10 @@ const createEmail = async (
|
|
|
435
436
|
first_name: firstName,
|
|
436
437
|
last_name: lastName,
|
|
437
438
|
phone_number: formattedPhoneNumber,
|
|
439
|
+
referrer: document.referrer,
|
|
440
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
441
|
+
// @ts-ignore
|
|
442
|
+
query_params: Object.fromEntries(queryParams.entries()),
|
|
438
443
|
};
|
|
439
444
|
|
|
440
445
|
await axios.post(
|
|
@@ -254,10 +254,15 @@ const createTextWithUs = async (
|
|
|
254
254
|
.replace(")", "")
|
|
255
255
|
.replace(" ", "")
|
|
256
256
|
.replace("-", "");
|
|
257
|
+
const queryParams = new URLSearchParams(window.location.search);
|
|
257
258
|
const requestBody = {
|
|
258
259
|
building_id: buildingId,
|
|
259
260
|
lead_source: "property-website",
|
|
260
261
|
phone_number: formattedPhoneNumber,
|
|
262
|
+
referrer: document.referrer,
|
|
263
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
264
|
+
// @ts-ignore
|
|
265
|
+
query_params: Object.fromEntries(queryParams.entries()),
|
|
261
266
|
};
|
|
262
267
|
|
|
263
268
|
await axios.post(
|